[Scummvm-git-logs] scummvm master -> 5f1f19be506359350956a4886052060dfabc5f0c
sev-
sev at scummvm.org
Thu Aug 9 08:39:29 CEST 2018
This automated email contains information about 198 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
e07fe3f1a4 STARTREK: Import my startrek engine
b1878174ec STARTREK: Add detection for the ST25 Mac demo
f2260d1e9a STARTREK: Implement loading "numbered" files
60d672db73 STARTREK: Fixes to file loading.
b84a3bb4f2 STARTREK: Make Bitmap, Sprite, FileStream classes
c71a8a6d2a STARTREK: Implement drawSprite function
cd45502501 STARTREK: Implement draw modes 2 and 3 for sprites
8cd5441959 STARTREK: Implement addSprite and delSprite
2dd96e044f STARTREK: Begin implementation of showText.
7c62092367 STARTREK: Begin implementing menus
a69f025818 STARTREK: Implement drawAllSprites properly.
060d10c463 STARTREK: Fix off-by-1 bug in drawSprite
e4c5a34568 STARTREK: Add mouse cursor
295c55c510 STARTREK: Implement more text routines
fd26d0a790 STARTREK: Begin implementing event system.
9c2ed1d9b7 STARTREK: Implement sound effects in the midis
f43c5d4687 STARTREK: Implement CD Audio handling.
69dac4d62d STARTREK: Add debug channel for sound
e1d70e6a04 STARTREK: Disabling menu buttons + text menu.
2932c392c4 STARTREK: Set default mouse sprite to stop crashes
e206d8e198 STARTREK: Remove executable bit on source files
d37e2aba0e STARTREK: Options menu
273131ce35 STARTREK: Quit game menu and mouse warp function
432a2023e2 STARTREK: Fix placement of textboxes
e578aa131f STARTREK: Rects don't include right/bottom pixel.
aac4b2e99d STARTREK: Music/SFX enable and disable functions
fde5f22f97 STARTREK: setVisibleMenuButtons function
d375429abe STARTREK: Objects and animations.
fc89135a16 STARTREK: Get animation timing working properly
612cf7bdbe STARTREK: Implement "xor'd" animations for crewmen
4927cd90b7 STARTREK: Bitmap scaling
dbeb58f392 STARTREK: Palette fading
0187c795d5 STARTREK: Initialization of away mission.
65d24b0451 STARTREK: Basic walking
1110fee2e4 STARTREK: Sprite layering
2a588200ed STARTREK: Pathfinding
be8e807a4b STARTREK: Warps between rooms
2731ae2287 STARTREK: Refactor text and menus
2120ce1062 STARTREK: Action menu
01970f43df STARTREK: Fix draw priority of menus
edcc80393a STARTREK: Tweak events to update mouse more often
02485484c3 STARTREK: Buffer all changes to the mouse bitmap
6117a89194 STARTREK: Inventory menu and hotspots
ec2306f8b0 STARTREK: Don't memset sprites, add Fixed16 type
f66b77d9fd STARTREK: Rename objects to actors
a6bee58f62 STARTREK: Default behaviour for look action
66b4ec36bd STARTREK: Cleanup some text code
bd79e4d653 STARTREK: Begin on room-specific code for room 1
ca3a9dcc87 STARTREK: Finish implementing first room
45ae72b763 STARTREK: DEMON1 done (klingon attack)
9e314e19d9 STARTREK: Demon2, half of Demon3 done
29e62d1a18 STARTREK: Finish demon3
30c41ae634 STARTREK: Refactor text using integer constants
a6b87e84e7 STARTREK: Talk to miner action in Demon3
5b28ece2b5 STARTREK: Begin with Demon4
2e80a35e08 STARTREK: Sort text alphabetically by ID
e5a97d9137 STARTREK: Demon5
1290b7ea02 STARTREK: Demon6, including the special case menu
fe5658ca17 STARTREK: Mission 1 finished
c17bef8285 STARTREK: Loop audio
84a30e4dce STARTREK: Preliminary saving/loading
ed7d22cd0f STARTREK: Make "missionScore" mission-specific
ad76c744af STARTREK: TUG0 (first room of mission 2)
0c28fd964e STARTREK: TUG1
41997ebc20 STARTREK: Default text for undefined actions
487c3fda32 STARTREK: TUG2
688c988909 STARTREK: Fix some uninitialized variables
a4b67dabf6 STARTREK: Change spawn room back to room 0
d0033df8ea STARTREK: Fix animations underneath textboxes
3d27a9a92c STARTREK: Initialize strings in actor objects
6e322ebfc5 STARTREK: TUG3 (mission 2 finished)
efda57c114 STARTREK: LOVE0 (start of 3rd mission)
28debc6673 STARTREK: Fix some problems on old compilers
933d21429f STARTREK: LOVE1
44b0a4c7bb STARTREK: Remove optional parameters from methods
dc1e44efb9 STARTREK: Most of LOVE2 done
7d110de48f STARTREK: Silence most Visual Studio warnings
16042faa65 STARTREK: Start on LOVE3
08ead492d8 STARTREK: LOVE3 finished.
43a0a574ff STARTREK: LOVE4
958a9065aa STARTREK: LOVE5
d8e255e9e7 STARTREK: Implement synthesizer + bugfixes (LOVE)
a5c7d6ae11 STARTREK: Revamp of action callbacks.
aca1987056 STARTREK: Implement common code for LOVE mission
cfb5daa8f0 STARTREK: Fixes to textboxes
e367f9d25e STARTREK: Fix swapped McCoy & Spock speaker names
d4c5966151 STARTREK: Add missing "look at grate" action.
37e6a886c1 STARTREK: Right-clicking & keyboard in menus
62cd8e4730 STARTREK: Implement keybindings on away missions
dee26355b1 STARTREK: Minor fixes to LOVE mission
14639d85f7 STARTREK: Fix choice numbers in textboxes (again)
c3bd0347ad STARTREK: More minor fixes to LOVE mission
aa41f89395 STARTREK: Fix memory leak in drawAllSprites
d3313e3980 STARTREK: Add another mac version to detection.cpp
644f5118da STARTREK: Reorganize some text
b332c17805 STARTREK: Give name to variable in love mission
4c0eb3aa67 STARTREK: MUDD0
7cff724864 STARTREK: MUDD1
c471503581 STARTREK: MUDD2
0879985ddd STARTREK: MUDD3
a636aacf51 STARTREK: MUDD4
296bad07b8 STARTREK: Missing null-terminator with animations
b3c3174102 STARTREK: MUDD5
f85c296dc3 STARTREK: Move common MUDD functions to mudda.cpp
933ab32b0e STARTREK: Start on MUDD's life-support-loss code
bfb312a319 STARTREK: Done with atmosphere loss event
f583e307df STARTREK: Minor fixes to MUDD mission
51e2c85a25 STARTREK: FEATHER0
051ea8c238 STARTREK: FEATHER1
8c71f2db84 STARTREK: Make Action struct POD again
d486051a6c STARTREK: Fix initializer list warnings
007960e85e STARTREK: Remove MUDD code from LOVE mission
ae3be7b407 STARTREK: FEATHER2
1e60b6f96b STARTREK: FEATHER3
8aef8c4539 STARTREK: FEATHER4
5863f515f7 STARTREK: FEATHER5
6486579e6a STARTREK: Fixes to sprites when off-screen
b02124b5ee STARTREK: FEATHER6
0c41f30f58 STARTREK: FEATHER6 Typos
092cf422ca STARTREK: FEATHER7
6fa0efa4ed STARTREK: Make a macro to simplify room detection
0f3efc0e55 STARTREK: TRIAL0
3cccf65179 STARTREK: TRIAL1
0786bd314b STARTREK: TRIAL1 typos
2f3c4b90d7 STARTREK: TRIAL2
2771797eb0 STARTREK: "Use" action was bypassing "disableWalk"
00445f0cfa STARTREK: TRIAL3
a1bc22f62a STARTREK: TRIAL3 text changes
4375614528 STARTREK: TRIAL4
160bd9ad51 STARTREK: TRIAL4 text changes
793a5b6020 STARTREK: TRIAL5
b9eca08db6 STARTREK: TRIAL5 text changes
52cfe60271 STARTREK: Get starfields working for the intro
639c02b76f STARTREK: Fix sound, support MT32.
a024a3fd45 STARTREK: Move space functions into separate file
ac9cd1f00a STARTREK: Implement fixed-point decimal class
710b9db0fd STARTREK: Rename fixed-point types
2b09f698ed STARTREK: sine & cosine
565bf0e967 STARTREK: atan2 function
eff87179da STARTREK: Half-done implementation of drawR3Shape
c2dd39a6c2 STARTREK: Remove some gotos
0e85e19ee7 STARTREK: Move function descriptions to headers
aa68655742 STARTREK: Formatting corrections
fe98dbb69d STARTREK: Reformat with artistic style
b8c244da87 STARTREK: Clean up room-specific vars in mission 1
d23965e274 STARTREK: Rename tug2 room-specific vars
5572525791 STARTREK: Save mission-specific variables
b1fa6126cc STARTREK: Link away missions together, temporarily
919db23841 STARTREK: Implement "BAN" files.
e3f00320ad STARTREK: Fix elasi guard not shooting Kirk in TUG
2090417612 STARTREK: Move save/load code for rooms to structs
5660ce8134 STARTREK: Fix .BAN file rendering behind textboxes
23b3782b52 STARTREK: SINS0
ae6c86bc7a STARTREK: Implement save loading from launcher
b2213cac9b STARTREK: SINS1
f412328181 STARTREK: Implement text input boxes
42b228144a STARTREK: Allow engine to run without voc files
8970909318 STARTREK: Reorganize includes in room.h
abf711a4d3 STARTREK: text.cpp -> textbox.cpp
dfb3bc586e STARTREK: Move text out of header file
bf1e125fa3 STARTREK: Remove trailing backslash in module.mk
93ca6a7b48 STARTREK: SINS2
b1fde33095 STARTREK: SINS2 text changes
012b9ec47c STARTREK: SINS4
10e22f7480 STARTREK: SINS4 text changes
4424515cce STARTREK: Silence unused variable warning
fe805de2ef STARTREK: SINS3
cba0567327 STARTREK: SINS3 text changes
be4174dc3d STARTREK: Janitorial: Add end of namespace comments
982502650f STARTREK: Replace min & max with MIN & MAX
a1107f0500 STARTREK: Use AD_ENTRY1s for game detection
06d7656d42 STARTREK: Play midi sounds on floppy version
1c89c06508 STARTREK: SINS5
1599e57dfe STARTREK: SINS5 text changes
359b0c2307 STARTREK: Add german floppy version to detection
f33f548884 STARTREK: Saving/loading for SINS mission
91c8320bd9 STARTREK: Rename SINS5 variable
57691c4276 STARTREK: Add missing license headers
c6834a997c STARTREK: Put CD ROM detection into features field
c8335cccd3 STARTREK: Fix memory leak in graphics.cpp
ce42cd940a STARTREK: Use ARRAYSIZE macro
ba05b5539b STARTREK: Various code cleanup
a84746bf66 STARTREK: Add POTFILES
e5e54b8a1f STARTREK: Split up startrek.cpp into more files
ad6a2bb0bb STARTREK: Make FileStream extend MemoryReadStream
08ef636a98 STARTREK: VENG0
bd1b9f66cb STARTREK: Implement republic map screen
a5d7b86206 STARTREK: VENG1
3a83f9b2d9 STARTREK: Comment out incomplete detection entries
d672fb6a3d STARTREK: Add FR, GER CD versions to detection.cpp
a089dc23f7 STARTREK: VENG2
ebc6f194c2 STARTREK: VENG3
1a12a25b54 STARTREK: VENG4
6db428f006 STARTREK: VENG5
5fae11b871 STARTREK: Move VENG function into common code
20cc6ae56d STARTREK: VENG6
4887ba0fd2 STARTREK: VENG6 text changes
5f1f19be50 STARTREK: VENG7
Commit: e07fe3f1a438b245b0a4dbf4506fe4c9d03d9258
https://github.com/scummvm/scummvm/commit/e07fe3f1a438b245b0a4dbf4506fe4c9d03d9258
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Import my startrek engine
Now updated even
Changed paths:
A engines/startrek/configure.engine
A engines/startrek/detection.cpp
A engines/startrek/font.cpp
A engines/startrek/font.h
A engines/startrek/graphics.cpp
A engines/startrek/graphics.h
A engines/startrek/lzss.cpp
A engines/startrek/lzss.h
A engines/startrek/module.mk
A engines/startrek/sound.cpp
A engines/startrek/sound.h
A engines/startrek/startrek.cpp
A engines/startrek/startrek.h
diff --git a/engines/startrek/configure.engine b/engines/startrek/configure.engine
new file mode 100644
index 0000000..bdcd68e
--- /dev/null
+++ b/engines/startrek/configure.engine
@@ -0,0 +1,3 @@
+# This file is included from the main "configure" script
+# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
+add_engine startrek "Star Trek 25th Anniversary/Judgment Rites" no
diff --git a/engines/startrek/detection.cpp b/engines/startrek/detection.cpp
new file mode 100755
index 0000000..f0f2a35
--- /dev/null
+++ b/engines/startrek/detection.cpp
@@ -0,0 +1,217 @@
+/* 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.
+ *
+ * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/detection.cpp $
+ * $Id: detection.cpp 15 2010-06-27 06:13:42Z clone2727 $
+ *
+ */
+
+#include "base/plugins.h"
+
+#include "engines/advancedDetector.h"
+#include "common/config-manager.h"
+#include "common/file.h"
+
+#include "startrek/startrek.h"
+
+namespace StarTrek {
+
+struct StarTrekGameDescription {
+ ADGameDescription desc;
+
+ uint8 gameType;
+ uint32 features;
+ uint16 version;
+};
+
+uint32 StarTrekEngine::getFeatures() const {
+ return _gameDescription->features;
+}
+
+Common::Platform StarTrekEngine::getPlatform() const {
+ return _gameDescription->desc.platform;
+}
+
+uint16 StarTrekEngine::getVersion() const {
+ return _gameDescription->version;
+}
+
+uint8 StarTrekEngine::getGameType() {
+ return _gameDescription->gameType;
+}
+
+Common::Language StarTrekEngine::getLanguage() {
+ return _gameDescription->desc.language;
+}
+
+} // End of Namespace StarTrek
+
+static const PlainGameDescriptor starTrekGames[] = {
+ {"startrek", "Star Trek game"},
+ {"st25", "Star Trek: 25th Anniversary"},
+ {"stjr", "Star Trek: Judgment Rites"},
+ {0, 0}
+};
+
+
+namespace StarTrek {
+
+static const StarTrekGameDescription gameDescriptions[] = {
+ {
+ {
+ "st25",
+ "",
+ AD_ENTRY1("data.001", "57040928a0f374281aa86ba4e7db8444"),
+ Common::EN_ANY,
+ Common::kPlatformDOS,
+ ADGF_NO_FLAGS,
+ GUIO0()
+ },
+ GType_ST25,
+ 0,
+ 0,
+ },
+
+ {
+ {
+ "st25",
+ "",
+ AD_ENTRY1("data.000", "f0918b6d096455ce2ae6dd5ef973292e"),
+ Common::EN_ANY,
+ Common::kPlatformAmiga,
+ ADGF_NO_FLAGS,
+ GUIO0()
+ },
+ GType_ST25,
+ 0,
+ 0,
+ },
+
+ {
+ {
+ "st25",
+ "",
+ AD_ENTRY1("data.000", "70d0e374d5fa973e536dba0f42310672"),
+ Common::DE_DEU,
+ Common::kPlatformAmiga,
+ ADGF_NO_FLAGS,
+ GUIO0()
+ },
+ GType_ST25,
+ 0,
+ 0,
+ },
+
+ {
+ {
+ "st25",
+ "",
+ AD_ENTRY1("data.000", "d0299af1385edd7c7612ed453e417dd8"),
+ Common::FR_FRA,
+ Common::kPlatformAmiga,
+ ADGF_NO_FLAGS,
+ GUIO0()
+ },
+ GType_ST25,
+ 0,
+ 0,
+ },
+
+ {
+ {
+ "st25",
+ "",
+ AD_ENTRY1("Star Trek Data", "871fa51c7680c0a43df9622128f1569f"),
+ Common::EN_ANY,
+ Common::kPlatformMacintosh,
+ ADGF_MACRESFORK,
+ GUIO0()
+ },
+ GType_ST25,
+ 0,
+ 0,
+ },
+
+ {
+ {
+ "st25",
+ "Demo",
+ AD_ENTRY1("data.001", "f68126e7e36ce6286c4c8575f8b594f5"),
+ Common::EN_ANY,
+ Common::kPlatformDOS,
+ ADGF_DEMO,
+ GUIO0()
+ },
+ GType_ST25,
+ GF_DEMO,
+ 0,
+ },
+
+ {
+ {
+ "stjr",
+ "",
+ AD_ENTRY1("data.001", "1c8de3c02f69c07c582d59d3c29e4dd9"),
+ Common::EN_ANY,
+ Common::kPlatformDOS,
+ ADGF_NO_FLAGS,
+ GUIO0()
+ },
+ GType_STJR,
+ 0,
+ 0,
+ },
+
+ { AD_TABLE_END_MARKER, 0, 0, 0 }
+};
+
+} // End of namespace StarTrek
+
+class StarTrekMetaEngine : public AdvancedMetaEngine {
+public:
+ StarTrekMetaEngine() : AdvancedMetaEngine(StarTrek::gameDescriptions, sizeof(StarTrek::StarTrekGameDescription), starTrekGames) {
+ _singleId = "startrek";
+ }
+
+ virtual const char *getName() const {
+ return "Star Trek Engine";
+ }
+
+ virtual const char *getOriginalCopyright() const {
+ return "Star Trek: 25th Anniversary, Star Trek: Judgment Rites (C) Interplay";
+ }
+
+ virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
+};
+
+bool StarTrekMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
+ const StarTrek::StarTrekGameDescription *gd = (const StarTrek::StarTrekGameDescription *)desc;
+
+ *engine = new StarTrek::StarTrekEngine(syst, gd);
+
+ return (gd != 0);
+}
+
+#if PLUGIN_ENABLED_DYNAMIC(STARTREK)
+ REGISTER_PLUGIN_DYNAMIC(STARTREK, PLUGIN_TYPE_ENGINE, StarTrekMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(STARTREK, PLUGIN_TYPE_ENGINE, StarTrekMetaEngine);
+#endif
+
diff --git a/engines/startrek/font.cpp b/engines/startrek/font.cpp
new file mode 100755
index 0000000..157c984
--- /dev/null
+++ b/engines/startrek/font.cpp
@@ -0,0 +1,69 @@
+/* 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.
+ *
+ * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/font.cpp $
+ * $Id: font.cpp 2 2009-09-12 20:13:40Z clone2727 $
+ *
+ */
+
+#include "startrek/font.h"
+
+namespace StarTrek {
+
+static const byte CHARACTER_COUNT = 0x80;
+static const byte CHARACTER_SIZE = 0x40;
+
+Font::Font(StarTrekEngine *vm) : _vm(vm) {
+ Common::SeekableReadStream *fontStream = _vm->openFile("FONT.FNT");
+
+ _characters = new Character[CHARACTER_COUNT];
+
+ for (byte i = 0; i < CHARACTER_COUNT; i++)
+ fontStream->read(_characters[i].data, CHARACTER_SIZE);
+
+ delete fontStream;
+
+#if 0
+ // Code to dump the font
+ printf ("DUMPING FONT");
+ for (byte i = 0; i < CHARACTER_COUNT; i++) {
+ printf ("\n\nCHARACTER %02x (%d):\n", i, i);
+ for (byte j = 0; j < CHARACTER_SIZE; j++) {
+ if (!(j % 8))
+ printf ("\n");
+ if (_characters[i].data[j] == 0x7d)
+ printf ("1 ");
+ else if (_characters[i].data[j] == 0x78)
+ printf ("0 ");
+ else if (_characters[i].data[j] == 0)
+ printf (" ");
+ else
+ printf ("? ");
+ }
+ }
+ printf("\n\n");
+#endif
+}
+
+Font::~Font() {
+ delete[] _characters;
+}
+
+}
diff --git a/engines/startrek/font.h b/engines/startrek/font.h
new file mode 100755
index 0000000..857c98e
--- /dev/null
+++ b/engines/startrek/font.h
@@ -0,0 +1,51 @@
+/* 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.
+ *
+ * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/font.h $
+ * $Id: font.h 2 2009-09-12 20:13:40Z clone2727 $
+ *
+ */
+
+#ifndef STARTREK_FONT_H
+#define STARTREK_FONT_H
+
+#include "startrek/startrek.h"
+
+namespace StarTrek {
+
+class StarTrekEngine;
+
+class Font {
+public:
+ Font(StarTrekEngine *vm);
+ ~Font();
+
+private:
+ StarTrekEngine *_vm;
+
+ struct Character {
+ byte data[0x40];
+ } *_characters;
+};
+
+
+}
+
+#endif
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
new file mode 100755
index 0000000..e2ba266
--- /dev/null
+++ b/engines/startrek/graphics.cpp
@@ -0,0 +1,133 @@
+/* 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.
+ *
+ * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/graphics.cpp $
+ * $Id: graphics.cpp 14 2010-05-26 15:44:12Z clone2727 $
+ *
+ */
+
+#include "startrek/graphics.h"
+
+#include "common/config-manager.h"
+#include "common/rendermode.h"
+#include "graphics/palette.h"
+
+namespace StarTrek {
+
+Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
+ _font = 0;
+ _egaData = 0;
+
+ if (ConfMan.hasKey("render_mode"))
+ _egaMode = (Common::parseRenderMode(ConfMan.get("render_mode").c_str()) == Common::kRenderEGA) && (_vm->getGameType() != GType_STJR) && !(_vm->getFeatures() & GF_DEMO);
+
+ if (_vm->getGameType() == GType_ST25 && _vm->getPlatform() == Common::kPlatformDOS)
+ _font = new Font(_vm);
+}
+
+Graphics::~Graphics() {
+ if (_egaData)
+ free(_egaData);
+
+ delete _font;
+}
+
+void Graphics::setPalette(const char *paletteFile) {
+ // Set the palette from a PAL file
+
+ Common::SeekableReadStream *palStream = _vm->openFile(paletteFile);
+ byte *palette = new byte[256 * 3];
+ palStream->read(palette, 256 * 3);
+
+ // Expand color components
+ if (_vm->getPlatform() == Common::kPlatformDOS || _vm->getPlatform() == Common::kPlatformMacintosh)
+ for (uint16 i = 0; i < 256 * 3; i++)
+ palette[i] <<= 2;
+
+ _vm->_system->getPaletteManager()->setPalette(palette, 0, 256);
+
+ delete[] palette;
+ delete palStream;
+}
+
+void Graphics::loadEGAData(const char *filename) {
+ // Load EGA palette data
+ if (!_egaMode)
+ return;
+
+ if (!_egaData)
+ _egaData = (byte *)malloc(256);
+
+ Common::SeekableReadStream *egaStream = _vm->openFile(filename);
+ egaStream->read(_egaData, 256);
+ delete egaStream;
+}
+
+void Graphics::drawImage(const char *filename) {
+ // Draw a regular bitmap
+
+ Common::SeekableReadStream *imageStream = _vm->openFile(filename);
+ uint16 xoffset = (_vm->getPlatform() == Common::kPlatformAmiga) ? imageStream->readUint16BE() : imageStream->readUint16LE();
+ uint16 yoffset = (_vm->getPlatform() == Common::kPlatformAmiga) ? imageStream->readUint16BE() : imageStream->readUint16LE();
+ uint16 width = (_vm->getPlatform() == Common::kPlatformAmiga) ? imageStream->readUint16BE() : imageStream->readUint16LE();
+ uint16 height = (_vm->getPlatform() == Common::kPlatformAmiga) ? imageStream->readUint16BE() : imageStream->readUint16LE();
+
+ byte *pixels = (byte *)malloc(width * height);
+
+ if (_egaMode && _egaData) {
+ // FIXME: This doesn't work right
+ for (uint32 i = 0; i < (uint32)(width * height); i++)
+ pixels[i] = _egaData[imageStream->readByte()];
+ } else {
+ imageStream->read(pixels, width * height);
+ }
+
+ _vm->_system->copyRectToScreen(pixels, width, xoffset, yoffset, width, height);
+ _vm->_system->updateScreen();
+}
+
+void Graphics::drawBackgroundImage(const char *filename) {
+ // Draw an stjr BGD image (palette built-in)
+
+ Common::SeekableReadStream *imageStream = _vm->openFile(filename);
+ byte *palette = new byte[256 * 3];
+ imageStream->read(palette, 256 * 3);
+
+ // Expand color components
+ for (uint16 i = 0; i < 256 * 3; i++)
+ palette[i] <<= 2;
+
+ uint16 xoffset = imageStream->readUint16LE();
+ uint16 yoffset = imageStream->readUint16LE();
+ uint16 width = imageStream->readUint16LE();
+ uint16 height = imageStream->readUint16LE();
+
+ byte *pixels = (byte *)malloc(width * height);
+ imageStream->read(pixels, width * height);
+
+ _vm->_system->getPaletteManager()->setPalette(palette, 0, 256);
+ _vm->_system->copyRectToScreen(pixels, width, xoffset, yoffset, width, height);
+ _vm->_system->updateScreen();
+
+ delete[] palette;
+ delete imageStream;
+}
+
+}
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
new file mode 100755
index 0000000..b796e83
--- /dev/null
+++ b/engines/startrek/graphics.h
@@ -0,0 +1,58 @@
+/* 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.
+ *
+ * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/graphics.h $
+ * $Id: graphics.h 2 2009-09-12 20:13:40Z clone2727 $
+ *
+ */
+
+#ifndef STARTREK_GRAPHICS_H
+#define STARTREK_GRAPHICS_H
+
+#include "startrek/startrek.h"
+#include "startrek/font.h"
+
+namespace StarTrek {
+
+class Font;
+class StarTrekEngine;
+
+class Graphics {
+public:
+ Graphics(StarTrekEngine *vm);
+ ~Graphics();
+
+ void setPalette(const char *paletteFile);
+ void loadEGAData(const char *egaFile);
+ void drawImage(const char *filename);
+ void drawBackgroundImage(const char *filename);
+
+
+private:
+ StarTrekEngine *_vm;
+ Font *_font;
+
+ bool _egaMode;
+ byte *_egaData;
+};
+
+}
+
+#endif
diff --git a/engines/startrek/lzss.cpp b/engines/startrek/lzss.cpp
new file mode 100755
index 0000000..03aa6de
--- /dev/null
+++ b/engines/startrek/lzss.cpp
@@ -0,0 +1,79 @@
+/* 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.
+ *
+ * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/lzss.cpp $
+ * $Id: lzss.cpp 18 2010-12-17 01:22:54Z clone2727 $
+ *
+ */
+
+#include "startrek/lzss.h"
+#include "common/util.h"
+#include "common/memstream.h"
+
+namespace StarTrek {
+
+Common::SeekableReadStream *decodeLZSS(Common::SeekableReadStream *indata, uint32 uncompressedSize) {
+ uint32 N = 0x1000; /* History buffer size */
+ byte *histbuff = new byte[N]; /* History buffer */
+ memset(histbuff, 0, N);
+ uint32 outstreampos = 0;
+ uint32 bufpos = 0;
+ byte *outLzssBufData = (byte *)malloc(uncompressedSize);
+
+ for (;;) {
+ byte flagbyte = indata->readByte();
+
+ if (indata->eos())
+ break;
+
+ for (byte i = 0; i < 8; i++) {
+ if ((flagbyte & (1 << i)) == 0) {
+ uint32 offsetlen = indata->readUint16LE();
+
+ if (indata->eos())
+ break;
+
+ uint32 length = (offsetlen & 0xF) + 3;
+ uint32 offset = (bufpos - (offsetlen >> 4)) & (N - 1);
+ for (uint32 j = 0; j < length; j++) {
+ byte tempa = histbuff[(offset + j) & (N - 1)];
+ outLzssBufData[outstreampos++] = tempa;
+ histbuff[bufpos] = tempa;
+ bufpos = (bufpos + 1) & (N - 1);
+ }
+ } else {
+ byte tempa = indata->readByte();
+
+ if (indata->eos())
+ break;
+
+ outLzssBufData[outstreampos++] = tempa;
+ histbuff[bufpos] = tempa;
+ bufpos = (bufpos + 1) & (N - 1);
+ }
+ }
+ }
+
+ delete[] histbuff;
+ return new Common::MemoryReadStream(outLzssBufData, uncompressedSize, DisposeAfterUse::YES);
+}
+
+}
+
diff --git a/engines/startrek/lzss.h b/engines/startrek/lzss.h
new file mode 100755
index 0000000..293a689
--- /dev/null
+++ b/engines/startrek/lzss.h
@@ -0,0 +1,57 @@
+/* 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.
+ *
+ * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/lzss.h $
+ * $Id: lzss.h 2 2009-09-12 20:13:40Z clone2727 $
+ *
+ */
+
+#include "common/stream.h"
+
+namespace StarTrek {
+
+Common::SeekableReadStream *decodeLZSS(Common::SeekableReadStream *indata, uint32 uncompressedSize);
+
+/*
+class LzssReadStream : public Common::SeekableReadStream {
+private:
+ uint8 *_outLzssBufData;
+ uint32 _size;
+ uint32 _pos;
+
+ uint32 decodeLZSS(Common::ReadStream *in, uint8 lengthmask, uint8 lengthbits);
+
+public:
+ LzssReadStream(Common::ReadStream *indata, uint8 lengthmask, uint8 lengthbits);
+ ~LzssReadStream();
+
+ bool eos() const;
+ uint32 read(void *buf, uint32 length);
+ int32 pos() const { return _pos; }
+ int32 size() const { return _size; }
+ bool seek(int32 offset, int whence) {
+ // TODO
+ return false;
+ }
+
+};
+*/
+
+}
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
new file mode 100755
index 0000000..75878e0
--- /dev/null
+++ b/engines/startrek/module.mk
@@ -0,0 +1,19 @@
+MODULE := engines/startrek
+
+MODULE_OBJS = \
+ detection.o \
+ font.o \
+ lzss.o \
+ graphics.o \
+ sound.o \
+ startrek.o
+
+
+
+# This module can be built as a plugin
+ifeq ($(ENABLE_STARTREK), DYNAMIC_PLUGIN)
+PLUGIN := 1
+endif
+
+# Include common rules
+include $(srcdir)/rules.mk
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
new file mode 100755
index 0000000..114ec8a
--- /dev/null
+++ b/engines/startrek/sound.cpp
@@ -0,0 +1,192 @@
+/* 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.
+ *
+ * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/sound.cpp $
+ * $Id: sound.cpp 15 2010-06-27 06:13:42Z clone2727 $
+ *
+ */
+
+#include "startrek/sound.h"
+
+#include "common/file.h"
+#include "common/macresman.h"
+
+#include "audio/mods/protracker.h"
+#include "audio/decoders/raw.h"
+
+namespace StarTrek {
+
+// Main Sound Functions
+
+Sound::Sound(StarTrekEngine *vm) : _vm(vm) {
+ if (_vm->getPlatform() == Common::kPlatformDOS || _vm->getPlatform() == Common::kPlatformMacintosh) {
+ // The main PC versions use XMIDI. ST25 Demo and Macintosh versions use SMF.
+ if ((_vm->getGameType() == GType_ST25 && _vm->getFeatures() & GF_DEMO) || _vm->getPlatform() == Common::kPlatformMacintosh)
+ _midiParser = MidiParser::createParser_SMF();
+ else
+ _midiParser = MidiParser::createParser_XMIDI();
+
+ _midiDevice = MidiDriver::detectDevice(MDT_PCSPK|MDT_ADLIB|MDT_MIDI);
+ _midiDriver = MidiDriver::createMidi(_midiDevice);
+ _midiDriver->open();
+ _midiParser->setMidiDriver(_midiDriver);
+ _midiParser->setTimerRate(_midiDriver->getBaseTempo());
+ }
+
+ if (_vm->getPlatform() == Common::kPlatformMacintosh) {
+ _macAudioResFork = new Common::MacResManager();
+ if (!_macAudioResFork->open("Star Trek Audio"))
+ error("Could not open 'Star Trek Audio'");
+ assert(_macAudioResFork->hasResFork());
+ } else
+ _macAudioResFork = 0;
+
+ _soundHandle = new Audio::SoundHandle();
+}
+
+Sound::~Sound() {
+ delete _midiParser;
+ delete _midiDriver;
+ delete _soundHandle;
+ delete _macAudioResFork;
+}
+
+void Sound::playSound(const char *baseSoundName) {
+ if (_vm->getPlatform() == Common::kPlatformAmiga)
+ playAmigaSound(baseSoundName);
+ else if (_vm->getPlatform() == Common::kPlatformMacintosh)
+ playMacSMFSound(baseSoundName);
+ else if (_vm->getFeatures() & GF_DEMO)
+ playSMFSound(baseSoundName);
+ else
+ playXMIDISound(baseSoundName);
+}
+
+void Sound::playSoundEffect(const char *baseSoundName) {
+ if (_vm->getPlatform() == Common::kPlatformAmiga)
+ playAmigaSoundEffect(baseSoundName);
+ else if (_vm->getPlatform() == Common::kPlatformMacintosh)
+ playMacSoundEffect(baseSoundName);
+ else
+ error("PC Sound Effects Not Supported");
+}
+
+// PC Functions
+
+void Sound::playSMFSound(const char *baseSoundName) {
+ Common::String soundName = baseSoundName;
+
+ soundName += '.';
+
+ switch (MidiDriver::getMusicType(_midiDevice)) {
+ case MT_MT32:
+ soundName += "ROL";
+ break;
+ case MT_PCSPK:
+ return; // Not supported...
+ default:
+ soundName += "ADL";
+ break;
+ }
+
+ debug(0, "Playing sound \'%s\'\n", soundName.c_str());
+ Common::SeekableReadStream *soundStream = _vm->openFile(soundName.c_str());
+
+ byte *soundData = (byte *)malloc(soundStream->size());
+ soundStream->read(soundData, soundStream->size());
+ _midiParser->loadMusic(soundData, soundStream->size());
+ delete soundStream;
+
+ _midiDriver->setTimerCallback(_midiParser, MidiParser::timerCallback);
+}
+
+void Sound::playXMIDISound(const char *baseSoundName) {
+ Common::String soundName = baseSoundName;
+
+ soundName += '.';
+
+ switch (MidiDriver::getMusicType(_midiDevice)) {
+ case MT_MT32:
+ soundName += "MT";
+ break;
+ case MT_PCSPK:
+ soundName += "PC";
+ break;
+ default:
+ soundName += "AD";
+ break;
+ }
+
+ debug(0, "Playing sound \'%s\'\n", soundName.c_str());
+ Common::SeekableReadStream *soundStream = _vm->openFile(soundName.c_str());
+
+ byte *soundData = (byte *)malloc(soundStream->size());
+ soundStream->read(soundData, soundStream->size());
+ _midiParser->loadMusic(soundData, soundStream->size());
+ delete soundStream;
+
+ _midiDriver->setTimerCallback(_midiParser, MidiParser::timerCallback);
+}
+
+// Amiga Functions
+
+void Sound::playAmigaSound(const char *baseSoundName) {
+ // Nope, this is wrong... see http://protracker.de/files/amiga/formats/theplayer_41_format.txt
+#if 0
+ Common::String soundName = baseSoundName;
+ soundName += ".SNG";
+ if (_vm->_mixer->isSoundHandleActive(*_soundHandle))
+ _vm->_mixer->stopHandle(*_soundHandle);
+ _vm->_mixer->playInputStream(Audio::Mixer::kMusicSoundType, _soundHandle, Audio::makeProtrackerStream(_vm->openFile(soundName.c_str())));
+#endif
+}
+
+void Sound::playAmigaSoundEffect(const char *baseSoundName) {
+ Common::String soundName = baseSoundName;
+ soundName += ".SFX";
+
+ if (_vm->_mixer->isSoundHandleActive(*_soundHandle))
+ _vm->_mixer->stopHandle(*_soundHandle);
+
+ Audio::AudioStream *audStream = (Audio::AudioStream *)Audio::makeRawStream(_vm->openFile(soundName.c_str()), 11025, 0);
+ _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, _soundHandle, audStream);
+}
+
+// Macintosh Functions
+
+void Sound::playMacSMFSound(const char *baseSoundName) {
+ Common::SeekableReadStream *soundStream = _macAudioResFork->getResource(baseSoundName);
+ byte *soundData = (byte *)malloc(soundStream->size());
+ soundStream->read(soundData, soundStream->size());
+ _midiParser->loadMusic(soundData, soundStream->size());
+ delete soundStream;
+
+ _midiDriver->setTimerCallback(_midiParser, MidiParser::timerCallback);
+}
+
+void Sound::playMacSoundEffect(const char *baseSoundName) {
+ if (_vm->_mixer->isSoundHandleActive(*_soundHandle))
+ _vm->_mixer->stopHandle(*_soundHandle);
+
+ Audio::AudioStream *audStream = (Audio::AudioStream *)Audio::makeRawStream(_macAudioResFork->getResource(baseSoundName), 11025, 0);
+ _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, _soundHandle, audStream);
+}
+
+} // End of namespace StarTrek
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
new file mode 100755
index 0000000..f8f9b88
--- /dev/null
+++ b/engines/startrek/sound.h
@@ -0,0 +1,76 @@
+/* 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.
+ *
+ * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/sound.h $
+ * $Id: sound.h 15 2010-06-27 06:13:42Z clone2727 $
+ *
+ */
+
+#ifndef STARTREK_SOUND_H
+#define STARTREK_SOUND_H
+
+#include "startrek/startrek.h"
+
+#include "audio/midiparser.h"
+#include "audio/mididrv.h"
+#include "audio/mixer.h"
+
+namespace Common {
+ class MacResManager;
+}
+
+namespace StarTrek {
+
+class StarTrekEngine;
+
+class Sound {
+public:
+ Sound(StarTrekEngine *vm);
+ ~Sound();
+
+ void playSound(const char *baseSoundName);
+ void playSoundEffect(const char *baseSoundName);
+
+private:
+ StarTrekEngine *_vm;
+ Audio::SoundHandle *_soundHandle;
+
+ // PC Sound Functions
+ void playXMIDISound(const char *baseSoundName);
+ void playSMFSound(const char *baseSoundName);
+
+ // Macintosh Sound Functions
+ void playMacSMFSound(const char *baseSoundName);
+ void playMacSoundEffect(const char *baseSoundName);
+ Common::MacResManager *_macAudioResFork;
+
+ // Amiga Sound Functions
+ void playAmigaSound(const char *baseSoundName);
+ void playAmigaSoundEffect(const char *baseSoundName);
+
+ // MIDI-Related Variables
+ MidiParser *_midiParser;
+ MidiDriver *_midiDriver;
+ uint32 _midiDevice;
+};
+
+}
+
+#endif
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
new file mode 100755
index 0000000..78b78aa
--- /dev/null
+++ b/engines/startrek/startrek.cpp
@@ -0,0 +1,318 @@
+/* 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.
+ *
+ * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/startrek.cpp $
+ * $Id: startrek.cpp 17 2010-12-16 02:29:35Z clone2727 $
+ *
+ */
+
+#include "base/plugins.h"
+#include "base/version.h"
+#include "common/archive.h"
+#include "common/config-manager.h"
+#include "common/error.h"
+#include "common/events.h"
+#include "common/file.h"
+#include "common/macresman.h"
+#include "graphics/surface.h"
+#include "engines/util.h"
+#include "video/qt_decoder.h"
+
+#include "startrek/lzss.h"
+#include "startrek/startrek.h"
+
+namespace StarTrek {
+
+StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gamedesc) : Engine(syst), _gameDescription(gamedesc) {
+ _macResFork = 0;
+}
+
+StarTrekEngine::~StarTrekEngine() {
+ delete _gfx;
+ delete _sound;
+ delete _macResFork;
+}
+
+Common::Error StarTrekEngine::run() {
+ _gfx = new Graphics(this);
+ _sound = new Sound(this);
+
+ if (getPlatform() == Common::kPlatformMacintosh) {
+ _macResFork = new Common::MacResManager();
+ if (!_macResFork->open("Star Trek Data"))
+ error("Could not load Star Trek Data");
+ assert(_macResFork->hasDataFork() && _macResFork->hasResFork());
+ }
+
+ initGraphics(320, 200);
+
+// Hexdump data
+#if 0
+ Common::SeekableReadStream *stream = openFile("BRIDGE.PAL");
+ byte *data = (byte *)malloc(stream->size());
+ stream->read(data, stream->size());
+ Common::hexdump(data, stream->size());
+ free(data);
+ delete stream;
+#endif
+
+// Test graphics/music:
+
+// Music Status:
+// DOS Full: Adlib and MT-32 Sounds supported
+// DOS Demo: Adlib and MT-32 Sounds supported
+// Amiga: Sound effects supported
+// Macintosh: MIDI and sound effects playable, format not handled.
+
+// Graphics Status:
+// DOS/Amiga/Macintosh/Demo Graphics: 100%
+// Judgment Rites Backgrounds supported too
+// EGA not supported
+#if 1
+ if (getGameType() == GType_ST25) {
+ if (getPlatform() == Common::kPlatformMacintosh) {
+ playMovie("Voice Data/Additional Audio/Intro Movie");
+ _gfx->setPalette("BRIDGES.PAL");
+ _gfx->drawImage("BRIDGE0.BMP");
+ } else {
+ _gfx->setPalette("BRIDGE.PAL");
+ //_gfx->loadEGAData("BRIDGE.EGA");
+ _gfx->drawImage("BRIDGE.BMP");
+ }
+
+ if (getPlatform() == Common::kPlatformAmiga)
+ _sound->playSoundEffect("TREK2");
+ else if (getPlatform() == Common::kPlatformMacintosh)
+ _sound->playSound("title 2");
+ else if (getFeatures() & GF_DEMO)
+ _sound->playSound("STTITLE");
+ else
+ _sound->playSound("TITLE");
+ } else {
+ _gfx->drawBackgroundImage("BRIDGE.BGD");
+ }
+
+ Common::Event event;
+
+ while (!shouldQuit()) {
+ while (_eventMan->pollEvent(event)) {
+ switch (event.type) {
+ case Common::EVENT_QUIT:
+ _system->quit();
+ break;
+ default:
+ break;
+ }
+ }
+ }
+#endif
+
+ return Common::kNoError;
+}
+
+Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename) {
+ // The Judgment Rites demo has its files not in the standard archive
+ if (getGameType() == GType_STJR && (getFeatures() & GF_DEMO)) {
+ Common::File *file = new Common::File();
+ if (!file->open(filename.c_str()))
+ error ("Could not find file \'%s\'", filename.c_str());
+ return file;
+ }
+
+ Common::SeekableReadStream *indexFile = 0;
+
+ if (getPlatform() == Common::kPlatformAmiga) {
+ indexFile = SearchMan.createReadStreamForMember("data000.dir");
+ if (!indexFile)
+ error ("Could not open data000.dir");
+ } else if (getPlatform() == Common::kPlatformMacintosh) {
+ indexFile = _macResFork->getResource("Directory");
+ if (!indexFile)
+ error("Could not find 'Directory' resource in 'Star Trek Data'");
+ } else {
+ indexFile = SearchMan.createReadStreamForMember("data.dir");
+ if (!indexFile)
+ error ("Could not open data.dir");
+ }
+
+ uint32 indexOffset = 0;
+ bool foundData = false;
+ uint16 fileCount = 1;
+ uint16 uncompressedSize = 0;
+
+ while (!indexFile->eos() && !indexFile->err()) {
+ Common::String testfile;
+ for (byte i = 0; i < 8; i++) {
+ char c = indexFile->readByte();
+ if (c)
+ testfile += c;
+ }
+ testfile += '.';
+
+ for (byte i = 0; i < 3; i++)
+ testfile += indexFile->readByte();
+
+ if (getFeatures() & GF_DEMO) {
+ indexFile->readByte(); // Always 0?
+ fileCount = indexFile->readUint16LE(); // Always 1
+ indexOffset = indexFile->readUint32LE();
+ uncompressedSize = indexFile->readUint16LE();
+ } else {
+ if (getPlatform() == Common::kPlatformAmiga)
+ indexOffset = (indexFile->readByte() << 16) + (indexFile->readByte() << 8) + indexFile->readByte();
+ else
+ indexOffset = indexFile->readByte() + (indexFile->readByte() << 8) + (indexFile->readByte() << 16);
+
+ if (indexOffset & (1 << 23)) {
+ fileCount = (indexOffset >> 16) & 0x7F;
+ indexOffset = indexOffset & 0xFFFF;
+
+ // TODO: Replace necessary number with ?
+ } else {
+ fileCount = 1;
+ }
+ }
+
+ if (filename.matchString(testfile)) {
+ foundData = true;
+ break;
+ }
+ }
+
+ delete indexFile;
+
+ if (!foundData)
+ error ("Could not find file \'%s\'", filename.c_str());
+
+ Common::SeekableReadStream *dataFile = 0;
+
+ if (getPlatform() == Common::kPlatformAmiga) {
+ dataFile = SearchMan.createReadStreamForMember("data.000");
+ if (!dataFile)
+ error("Could not open data.000");
+ } else if (getPlatform() == Common::kPlatformMacintosh) {
+ dataFile = _macResFork->getDataFork();
+ if (!dataFile)
+ error("Could not get 'Star Trek Data' data fork");
+ } else {
+ dataFile = SearchMan.createReadStreamForMember("data.001");
+ if (!dataFile)
+ error("Could not open data.001");
+ }
+
+ dataFile->seek(indexOffset);
+
+ if (getFeatures() & GF_DEMO) {
+ assert(fileCount == 1); // Sanity check...
+ Common::SeekableReadStream *stream = dataFile->readStream(uncompressedSize);
+ delete dataFile;
+ return stream;
+ } else {
+ uint16 fileIndex = 0;
+
+ // TODO!
+ //if (fileCount > 1)
+ // fileIndex = filename.lastChar() - '0';
+ if (fileCount != 1)
+ error ("Multi-part files not yet handled");
+
+ for (uint16 i = 0; i < fileCount; i++) {
+ uncompressedSize = (getPlatform() == Common::kPlatformAmiga) ? dataFile->readUint16BE() : dataFile->readUint16LE();
+ uint16 compressedSize = (getPlatform() == Common::kPlatformAmiga) ? dataFile->readUint16BE() : dataFile->readUint16LE();
+ if (i == fileIndex) {
+ debug(0, "Opening file \'%s\'\n", filename.c_str());
+ Common::SeekableReadStream *stream = decodeLZSS(dataFile->readStream(compressedSize), uncompressedSize);
+ delete dataFile;
+ return stream;
+ } else {
+ dataFile->skip(compressedSize);
+ }
+ }
+ }
+
+ // We should not get to this point...
+ error("Could not find data for \'%s\'", filename.c_str());
+
+ return NULL;
+}
+
+byte StarTrekEngine::getStartingIndex(Common::String filename) {
+ // Find last number
+ int32 lastNumIndex = -1;
+ for (uint32 i = 0; i < filename.size(); i++) {
+ if (filename[i] >= '0' && filename[i] <= '9')
+ lastNumIndex = i;
+ else if (filename[i] == '.')
+ break;
+ }
+
+ if (lastNumIndex == -1)
+ return 0;
+ return (filename[lastNumIndex] - '0');
+}
+
+void StarTrekEngine::playMovie(Common::String filename) {
+ if (getPlatform() == Common::kPlatformMacintosh)
+ playMovieMac(filename);
+ else
+ error("Interplay MVE not yet supported");
+}
+
+void StarTrekEngine::playMovieMac(Common::String filename) {
+ // Swap to 16bpp mode
+ initGraphics(512, 384, NULL);
+
+ Video::QuickTimeDecoder *qtDecoder = new Video::QuickTimeDecoder();
+
+ if (!qtDecoder->loadFile(filename))
+ error("Could not open '%s'", filename.c_str());
+
+ bool continuePlaying = true;
+
+ qtDecoder->start();
+
+ while (!qtDecoder->endOfVideo() && !shouldQuit() && continuePlaying) {
+ if (qtDecoder->needsUpdate()) {
+ const ::Graphics::Surface *frame = qtDecoder->decodeNextFrame();
+
+ if (frame) {
+ ::Graphics::Surface *convertedFrame = frame->convertTo(_system->getScreenFormat());
+ _system->copyRectToScreen(convertedFrame->getPixels(), convertedFrame->pitch, 0, 0, convertedFrame->w, convertedFrame->h);
+ _system->updateScreen();
+ convertedFrame->free();
+ delete convertedFrame;
+ }
+ }
+
+ Common::Event event;
+ while (g_system->getEventManager()->pollEvent(event))
+ if (event.type == Common::EVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_ESCAPE)
+ continuePlaying = false;
+
+ g_system->delayMillis(10);
+ }
+
+ delete qtDecoder;
+
+ // Swap back to 8bpp mode
+ initGraphics(320, 200);
+}
+
+} // End of namespace StarTrek
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
new file mode 100755
index 0000000..f181160
--- /dev/null
+++ b/engines/startrek/startrek.h
@@ -0,0 +1,93 @@
+/* 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.
+ *
+ * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/startrek.h $
+ * $Id: startrek.h 14 2010-05-26 15:44:12Z clone2727 $
+ *
+ */
+
+#ifndef STARTREK_H
+#define STARTREK_H
+
+#include "common/scummsys.h"
+#include "common/util.h"
+#include "common/system.h"
+#include "common/rect.h"
+#include "common/str.h"
+#include "common/stream.h"
+
+#include "engines/engine.h"
+
+#include "startrek/graphics.h"
+#include "startrek/sound.h"
+
+namespace Common {
+ class MacResManager;
+}
+
+namespace StarTrek {
+
+enum StarTrekGameType {
+ GType_ST25 = 1,
+ GType_STJR = 2
+};
+
+enum StarTrekGameFeatures {
+ GF_DEMO = (1 << 0)
+};
+
+struct StarTrekGameDescription;
+class Graphics;
+class Sound;
+
+class StarTrekEngine : public ::Engine {
+protected:
+ Common::Error run();
+
+public:
+ StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gamedesc);
+ virtual ~StarTrekEngine();
+
+ // Detection related functions
+ const StarTrekGameDescription *_gameDescription;
+ uint32 getFeatures() const;
+ uint16 getVersion() const;
+ Common::Platform getPlatform() const;
+ uint8 getGameType();
+ Common::Language getLanguage();
+
+ // Resource related functions
+ Common::SeekableReadStream *openFile(Common::String filename);
+
+ // Movie related functions
+ void playMovie(Common::String filename);
+ void playMovieMac(Common::String filename);
+
+private:
+ Graphics *_gfx;
+ Sound *_sound;
+ Common::MacResManager *_macResFork;
+
+ byte getStartingIndex(Common::String filename);
+};
+
+} // End of namespace StarTrek
+
+#endif
Commit: b1878174ec65475046392e6be775cfe7fc302240
https://github.com/scummvm/scummvm/commit/b1878174ec65475046392e6be775cfe7fc302240
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Add detection for the ST25 Mac demo
Changed paths:
engines/startrek/detection.cpp
engines/startrek/startrek.cpp
diff --git a/engines/startrek/detection.cpp b/engines/startrek/detection.cpp
index f0f2a35..d6e449e 100755
--- a/engines/startrek/detection.cpp
+++ b/engines/startrek/detection.cpp
@@ -163,6 +163,21 @@ static const StarTrekGameDescription gameDescriptions[] = {
GF_DEMO,
0,
},
+
+ {
+ {
+ "st25",
+ "Demo",
+ AD_ENTRY1("Star Trek Data", "88f88b81d389a3217fc7efd6ee631c42"),
+ Common::EN_ANY,
+ Common::kPlatformMacintosh,
+ ADGF_MACRESFORK | ADGF_DEMO,
+ GUIO0()
+ },
+ GType_ST25,
+ GF_DEMO,
+ 0,
+ },
{
{
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 78b78aa..303cd59 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -88,9 +88,14 @@ Common::Error StarTrekEngine::run() {
#if 1
if (getGameType() == GType_ST25) {
if (getPlatform() == Common::kPlatformMacintosh) {
- playMovie("Voice Data/Additional Audio/Intro Movie");
- _gfx->setPalette("BRIDGES.PAL");
- _gfx->drawImage("BRIDGE0.BMP");
+ if (getFeatures() & GF_DEMO) {
+ _gfx->setPalette("BRIDGE.PAL");
+ _gfx->drawImage("BRIDGE.BMP");
+ } else {
+ playMovie("Voice Data/Additional Audio/Intro Movie");
+ _gfx->setPalette("BRIDGES.PAL");
+ _gfx->drawImage("BRIDGE0.BMP");
+ }
} else {
_gfx->setPalette("BRIDGE.PAL");
//_gfx->loadEGAData("BRIDGE.EGA");
Commit: f2260d1e9ab5fe745d8f5d62a56063e001289e96
https://github.com/scummvm/scummvm/commit/f2260d1e9ab5fe745d8f5d62a56063e001289e96
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement loading "numbered" files
Changed paths:
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 303cd59..439feb6 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -99,7 +99,8 @@ Common::Error StarTrekEngine::run() {
} else {
_gfx->setPalette("BRIDGE.PAL");
//_gfx->loadEGAData("BRIDGE.EGA");
- _gfx->drawImage("BRIDGE.BMP");
+ _gfx->drawImage("DEMON5.BMP");
+ //_gfx->drawImage("BRIDGE.BMP");
}
if (getPlatform() == Common::kPlatformAmiga)
@@ -132,7 +133,19 @@ Common::Error StarTrekEngine::run() {
return Common::kNoError;
}
-Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename) {
+Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename, int fileIndex) {
+ Common::String basename, extension;
+
+ for (int i=filename.size()-1; ; i--) {
+ if (filename[i] == '.') {
+ basename = filename;
+ extension = filename;
+ basename.replace(i, filename.size()-i, "");
+ extension.replace(0, i+1, "");
+ break;
+ }
+ }
+
// The Judgment Rites demo has its files not in the standard archive
if (getGameType() == GType_STJR && (getFeatures() & GF_DEMO)) {
Common::File *file = new Common::File();
@@ -170,11 +183,11 @@ Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename) {
testfile += c;
}
testfile += '.';
-
+
for (byte i = 0; i < 3; i++)
testfile += indexFile->readByte();
-
- if (getFeatures() & GF_DEMO) {
+
+ if (getFeatures() & GF_DEMO && getPlatform() == Common::kPlatformDOS) {
indexFile->readByte(); // Always 0?
fileCount = indexFile->readUint16LE(); // Always 1
indexOffset = indexFile->readUint32LE();
@@ -188,25 +201,35 @@ Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename) {
if (indexOffset & (1 << 23)) {
fileCount = (indexOffset >> 16) & 0x7F;
indexOffset = indexOffset & 0xFFFF;
-
- // TODO: Replace necessary number with ?
+ assert(fileCount > 1);
} else {
fileCount = 1;
}
}
-
+
if (filename.matchString(testfile)) {
foundData = true;
break;
}
}
-
+
delete indexFile;
-
- if (!foundData)
- error ("Could not find file \'%s\'", filename.c_str());
+
+ if (!foundData) {
+ // Files with a number at the end are stored a bit differently; they are accessed
+ // based on a "base number". See if there's an earlier number that can be opened.
+ if (basename.lastChar() >= '1' && basename.lastChar() <= '9') {
+ basename.setChar(basename.lastChar()-1, basename.size()-1);
+ return openFile(basename + "." + extension, fileIndex+1);
+ } else
+ error ("Could not find file \'%s\'", filename.c_str());
+ }
+
+ if (fileIndex >= fileCount)
+ error("Tried to access file index %d for file '%s' which doesn't exist.", fileIndex, filename.c_str());
Common::SeekableReadStream *dataFile = 0;
+ Common::SeekableReadStream *dataRunFile = 0; // FIXME: Amiga & Mac code don't implement this
if (getPlatform() == Common::kPlatformAmiga) {
dataFile = SearchMan.createReadStreamForMember("data.000");
@@ -220,36 +243,36 @@ Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename) {
dataFile = SearchMan.createReadStreamForMember("data.001");
if (!dataFile)
error("Could not open data.001");
+ dataRunFile = SearchMan.createReadStreamForMember("data.run");
+ if (!dataFile)
+ error("Could not open data.run");
}
-
- dataFile->seek(indexOffset);
-
- if (getFeatures() & GF_DEMO) {
+
+ if (getFeatures() & GF_DEMO && getPlatform() == Common::kPlatformDOS) {
assert(fileCount == 1); // Sanity check...
Common::SeekableReadStream *stream = dataFile->readStream(uncompressedSize);
delete dataFile;
return stream;
} else {
- uint16 fileIndex = 0;
-
- // TODO!
- //if (fileCount > 1)
- // fileIndex = filename.lastChar() - '0';
- if (fileCount != 1)
- error ("Multi-part files not yet handled");
-
- for (uint16 i = 0; i < fileCount; i++) {
- uncompressedSize = (getPlatform() == Common::kPlatformAmiga) ? dataFile->readUint16BE() : dataFile->readUint16LE();
- uint16 compressedSize = (getPlatform() == Common::kPlatformAmiga) ? dataFile->readUint16BE() : dataFile->readUint16LE();
- if (i == fileIndex) {
- debug(0, "Opening file \'%s\'\n", filename.c_str());
- Common::SeekableReadStream *stream = decodeLZSS(dataFile->readStream(compressedSize), uncompressedSize);
- delete dataFile;
- return stream;
- } else {
- dataFile->skip(compressedSize);
+ if (fileCount != 1) {
+ dataRunFile->seek(indexOffset);
+
+ indexOffset = dataRunFile->readByte() + (dataRunFile->readByte() << 8) + (dataRunFile->readByte() << 16);
+ //indexOffset &= 0xFFFFFE;
+
+ for (uint16 i = 0; i < fileIndex; i++) {
+ uint16 size = dataRunFile->readUint16LE();
+ indexOffset += size;
}
}
+ dataFile->seek(indexOffset);
+
+ uncompressedSize = (getPlatform() == Common::kPlatformAmiga) ? dataFile->readUint16BE() : dataFile->readUint16LE();
+ uint16 compressedSize = (getPlatform() == Common::kPlatformAmiga) ? dataFile->readUint16BE() : dataFile->readUint16LE();
+
+ Common::SeekableReadStream *stream = decodeLZSS(dataFile->readStream(compressedSize), uncompressedSize);
+ delete dataFile;
+ return stream;
}
// We should not get to this point...
@@ -258,21 +281,6 @@ Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename) {
return NULL;
}
-byte StarTrekEngine::getStartingIndex(Common::String filename) {
- // Find last number
- int32 lastNumIndex = -1;
- for (uint32 i = 0; i < filename.size(); i++) {
- if (filename[i] >= '0' && filename[i] <= '9')
- lastNumIndex = i;
- else if (filename[i] == '.')
- break;
- }
-
- if (lastNumIndex == -1)
- return 0;
- return (filename[lastNumIndex] - '0');
-}
-
void StarTrekEngine::playMovie(Common::String filename) {
if (getPlatform() == Common::kPlatformMacintosh)
playMovieMac(filename);
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index f181160..9f6935d 100755
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -74,7 +74,7 @@ public:
Common::Language getLanguage();
// Resource related functions
- Common::SeekableReadStream *openFile(Common::String filename);
+ Common::SeekableReadStream *openFile(Common::String filename, int fileIndex=0);
// Movie related functions
void playMovie(Common::String filename);
Commit: 60d672db7315f9a131cfb128a3a10b29ece10112
https://github.com/scummvm/scummvm/commit/60d672db7315f9a131cfb128a3a10b29ece10112
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fixes to file loading.
The "numbered" files that I implemented can also use letters as the last
character.
Changed paths:
engines/startrek/graphics.cpp
engines/startrek/lzss.cpp
engines/startrek/startrek.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index e2ba266..8dcc436 100755
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -89,6 +89,11 @@ void Graphics::drawImage(const char *filename) {
uint16 width = (_vm->getPlatform() == Common::kPlatformAmiga) ? imageStream->readUint16BE() : imageStream->readUint16LE();
uint16 height = (_vm->getPlatform() == Common::kPlatformAmiga) ? imageStream->readUint16BE() : imageStream->readUint16LE();
+ if (xoffset >= 320)
+ xoffset = 0;
+ if (yoffset >= 200)
+ yoffset = 0;
+
byte *pixels = (byte *)malloc(width * height);
if (_egaMode && _egaData) {
diff --git a/engines/startrek/lzss.cpp b/engines/startrek/lzss.cpp
index 03aa6de..2e04d08 100755
--- a/engines/startrek/lzss.cpp
+++ b/engines/startrek/lzss.cpp
@@ -23,9 +23,11 @@
*
*/
-#include "startrek/lzss.h"
-#include "common/util.h"
+#include "common/textconsole.h"
#include "common/memstream.h"
+#include "common/util.h"
+
+#include "startrek/lzss.h"
namespace StarTrek {
@@ -72,6 +74,10 @@ Common::SeekableReadStream *decodeLZSS(Common::SeekableReadStream *indata, uint3
}
delete[] histbuff;
+
+ if (outstreampos != uncompressedSize)
+ error("Size mismatch in LZSS decompression; expected %d bytes, got %d bytes", uncompressedSize, outstreampos);
+
return new Common::MemoryReadStream(outLzssBufData, uncompressedSize, DisposeAfterUse::YES);
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 439feb6..abb8383 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -100,7 +100,6 @@ Common::Error StarTrekEngine::run() {
_gfx->setPalette("BRIDGE.PAL");
//_gfx->loadEGAData("BRIDGE.EGA");
_gfx->drawImage("DEMON5.BMP");
- //_gfx->drawImage("BRIDGE.BMP");
}
if (getPlatform() == Common::kPlatformAmiga)
@@ -134,6 +133,7 @@ Common::Error StarTrekEngine::run() {
}
Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename, int fileIndex) {
+ filename.toUppercase();
Common::String basename, extension;
for (int i=filename.size()-1; ; i--) {
@@ -216,9 +216,10 @@ Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename, in
delete indexFile;
if (!foundData) {
- // Files with a number at the end are stored a bit differently; they are accessed
- // based on a "base number". See if there's an earlier number that can be opened.
- if (basename.lastChar() >= '1' && basename.lastChar() <= '9') {
+ // Files can be accessed "sequentially" if their filenames are the same except for
+ // the last character being incremented by one.
+ if ((basename.lastChar() >= '1' && basename.lastChar() <= '9') ||
+ (basename.lastChar() >= 'B' && basename.lastChar() <= 'Z')) {
basename.setChar(basename.lastChar()-1, basename.size()-1);
return openFile(basename + "." + extension, fileIndex+1);
} else
@@ -252,6 +253,7 @@ Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename, in
assert(fileCount == 1); // Sanity check...
Common::SeekableReadStream *stream = dataFile->readStream(uncompressedSize);
delete dataFile;
+ delete dataRunFile;
return stream;
} else {
if (fileCount != 1) {
@@ -271,7 +273,9 @@ Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename, in
uint16 compressedSize = (getPlatform() == Common::kPlatformAmiga) ? dataFile->readUint16BE() : dataFile->readUint16LE();
Common::SeekableReadStream *stream = decodeLZSS(dataFile->readStream(compressedSize), uncompressedSize);
+
delete dataFile;
+ delete dataRunFile;
return stream;
}
Commit: b84a3bb4f28eb4b9e0bcfc19d405c79867360032
https://github.com/scummvm/scummvm/commit/b84a3bb4f28eb4b9e0bcfc19d405c79867360032
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Make Bitmap, Sprite, FileStream classes
Changed paths:
A engines/startrek/filestream.cpp
A engines/startrek/filestream.h
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/module.mk
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/filestream.cpp b/engines/startrek/filestream.cpp
new file mode 100644
index 0000000..3af5ca8
--- /dev/null
+++ b/engines/startrek/filestream.cpp
@@ -0,0 +1,38 @@
+#include "startrek/filestream.h"
+
+namespace StarTrek {
+
+FileStream::FileStream(Common::SeekableReadStream *stream, bool bigEndian) : Common::SeekableReadStreamEndian(bigEndian) {
+ _stream = stream;
+ _bigEndian = bigEndian;
+}
+
+FileStream::~FileStream() {
+ delete _stream;
+}
+
+// ReadStream functions
+
+bool FileStream::eos() const {
+ return _stream->eos();
+}
+
+uint32 FileStream::read(void* dataPtr, uint32 dataSize) {
+ return _stream->read(dataPtr, dataSize);
+}
+
+// SeekableReadStream functions
+
+int32 FileStream::pos() const {
+ return _stream->pos();
+}
+
+int32 FileStream::size() const {
+ return _stream->size();
+}
+
+bool FileStream::seek(int32 offset, int whence) {
+ return _stream->seek(offset, whence);
+}
+
+}
diff --git a/engines/startrek/filestream.h b/engines/startrek/filestream.h
new file mode 100644
index 0000000..899f639
--- /dev/null
+++ b/engines/startrek/filestream.h
@@ -0,0 +1,52 @@
+/* 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.
+ */
+
+#ifndef STARTREK_FILESTREAM_H
+#define STARTREK_FILESTREAM_H
+
+#include "common/stream.h"
+
+namespace StarTrek {
+
+class FileStream : public Common::SeekableReadStreamEndian {
+
+public:
+ FileStream(Common::SeekableReadStream *stream, bool bigEndian);
+ ~FileStream();
+
+private:
+ Common::SeekableReadStream *_stream;
+ bool _bigEndian;
+
+ // ReadStream functions
+ virtual bool eos() const;
+ virtual uint32 read(void* dataPtr, uint32 dataSize);
+
+ // SeekableReadStream functions
+ virtual int32 pos() const;
+ virtual int32 size() const;
+ virtual bool seek(int32 offset, int whence);
+
+};
+
+}
+
+#endif
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 8dcc436..5304d40 100755
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -31,6 +31,25 @@
namespace StarTrek {
+// Bitmap class
+
+Bitmap::Bitmap(Common::ReadStreamEndian *stream) {
+ xoffset = stream->readUint16();
+ yoffset = stream->readUint16();
+ width = stream->readUint16();
+ height = stream->readUint16();
+
+ pixels = (byte*)malloc(width*height);
+ stream->read(pixels, width*height);
+}
+
+Bitmap::~Bitmap() {
+ free(pixels);
+}
+
+
+// Graphics class
+
Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_font = 0;
_egaData = 0;
@@ -67,6 +86,19 @@ void Graphics::setPalette(const char *paletteFile) {
delete palStream;
}
+void Graphics::drawBitmap(Bitmap *bitmap) {
+ int xoffset = bitmap->xoffset;
+ int yoffset = bitmap->yoffset;
+ if (xoffset >= 320)
+ xoffset = 0;
+ if (yoffset >= 200)
+ yoffset = 0;
+
+ _vm->_system->copyRectToScreen(bitmap->pixels, bitmap->width, xoffset, yoffset, bitmap->width, bitmap->height);
+ _vm->_system->updateScreen();
+}
+
+
void Graphics::loadEGAData(const char *filename) {
// Load EGA palette data
if (!_egaMode)
@@ -80,34 +112,6 @@ void Graphics::loadEGAData(const char *filename) {
delete egaStream;
}
-void Graphics::drawImage(const char *filename) {
- // Draw a regular bitmap
-
- Common::SeekableReadStream *imageStream = _vm->openFile(filename);
- uint16 xoffset = (_vm->getPlatform() == Common::kPlatformAmiga) ? imageStream->readUint16BE() : imageStream->readUint16LE();
- uint16 yoffset = (_vm->getPlatform() == Common::kPlatformAmiga) ? imageStream->readUint16BE() : imageStream->readUint16LE();
- uint16 width = (_vm->getPlatform() == Common::kPlatformAmiga) ? imageStream->readUint16BE() : imageStream->readUint16LE();
- uint16 height = (_vm->getPlatform() == Common::kPlatformAmiga) ? imageStream->readUint16BE() : imageStream->readUint16LE();
-
- if (xoffset >= 320)
- xoffset = 0;
- if (yoffset >= 200)
- yoffset = 0;
-
- byte *pixels = (byte *)malloc(width * height);
-
- if (_egaMode && _egaData) {
- // FIXME: This doesn't work right
- for (uint32 i = 0; i < (uint32)(width * height); i++)
- pixels[i] = _egaData[imageStream->readByte()];
- } else {
- imageStream->read(pixels, width * height);
- }
-
- _vm->_system->copyRectToScreen(pixels, width, xoffset, yoffset, width, height);
- _vm->_system->updateScreen();
-}
-
void Graphics::drawBackgroundImage(const char *filename) {
// Draw an stjr BGD image (palette built-in)
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index b796e83..6637928 100755
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -29,19 +29,62 @@
#include "startrek/startrek.h"
#include "startrek/font.h"
+#include "common/stream.h"
+
namespace StarTrek {
class Font;
class StarTrekEngine;
+
+class Bitmap {
+public:
+ uint16 xoffset;
+ uint16 yoffset;
+ uint16 width;
+ uint16 height;
+ byte *pixels;
+
+public:
+ Bitmap(Common::ReadStreamEndian *stream);
+ ~Bitmap();
+};
+
+class Rectangle {
+ uint16 left;
+ uint16 top;
+ uint16 right;
+ uint16 bottom;
+};
+
+class Sprite {
+ uint16 x,y;
+ uint16 drawPriority;
+ uint16 field6;
+ uint16 field8;
+ Bitmap *bitmap;
+ uint16 drawMode;
+ uint16 fieldE;
+ uint16 bitmapChanged;
+ uint16 redrawCondition2;
+ uint16 redrawCondition3;
+ uint16 field16;
+ Rectangle rectangle1;
+ Rectangle clickRectangle;
+ Rectangle rectangle2;
+ uint16 drawX,drawY;
+};
+
+
class Graphics {
public:
Graphics(StarTrekEngine *vm);
~Graphics();
void setPalette(const char *paletteFile);
+ void drawBitmap(Bitmap *bitmap);
+
void loadEGAData(const char *egaFile);
- void drawImage(const char *filename);
void drawBackgroundImage(const char *filename);
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 75878e0..0b95d7d 100755
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -2,6 +2,7 @@ MODULE := engines/startrek
MODULE_OBJS = \
detection.o \
+ filestream.o \
font.o \
lzss.o \
graphics.o \
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index abb8383..5401e52 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -35,6 +35,7 @@
#include "engines/util.h"
#include "video/qt_decoder.h"
+#include "startrek/filestream.h"
#include "startrek/lzss.h"
#include "startrek/startrek.h"
@@ -87,20 +88,10 @@ Common::Error StarTrekEngine::run() {
// EGA not supported
#if 1
if (getGameType() == GType_ST25) {
- if (getPlatform() == Common::kPlatformMacintosh) {
- if (getFeatures() & GF_DEMO) {
- _gfx->setPalette("BRIDGE.PAL");
- _gfx->drawImage("BRIDGE.BMP");
- } else {
- playMovie("Voice Data/Additional Audio/Intro Movie");
- _gfx->setPalette("BRIDGES.PAL");
- _gfx->drawImage("BRIDGE0.BMP");
- }
- } else {
- _gfx->setPalette("BRIDGE.PAL");
- //_gfx->loadEGAData("BRIDGE.EGA");
- _gfx->drawImage("DEMON5.BMP");
- }
+ _gfx->setPalette("PALETTE.PAL");
+ Bitmap *b = new Bitmap(openFile("DEMON5.BMP"));
+ _gfx->drawBitmap(b);
+ delete b;
if (getPlatform() == Common::kPlatformAmiga)
_sound->playSoundEffect("TREK2");
@@ -132,10 +123,12 @@ Common::Error StarTrekEngine::run() {
return Common::kNoError;
}
-Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename, int fileIndex) {
+Common::SeekableReadStreamEndian *StarTrekEngine::openFile(Common::String filename, int fileIndex) {
filename.toUppercase();
Common::String basename, extension;
+ bool bigEndian = getPlatform() == Common::kPlatformAmiga;
+
for (int i=filename.size()-1; ; i--) {
if (filename[i] == '.') {
basename = filename;
@@ -151,7 +144,7 @@ Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename, in
Common::File *file = new Common::File();
if (!file->open(filename.c_str()))
error ("Could not find file \'%s\'", filename.c_str());
- return file;
+ return new FileStream(file, bigEndian);
}
Common::SeekableReadStream *indexFile = 0;
@@ -210,7 +203,7 @@ Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename, in
if (filename.matchString(testfile)) {
foundData = true;
break;
- }
+ }
}
delete indexFile;
@@ -230,7 +223,7 @@ Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename, in
error("Tried to access file index %d for file '%s' which doesn't exist.", fileIndex, filename.c_str());
Common::SeekableReadStream *dataFile = 0;
- Common::SeekableReadStream *dataRunFile = 0; // FIXME: Amiga & Mac code don't implement this
+ Common::SeekableReadStream *dataRunFile = 0; // FIXME: Amiga & Mac need this implemented
if (getPlatform() == Common::kPlatformAmiga) {
dataFile = SearchMan.createReadStreamForMember("data.000");
@@ -254,7 +247,7 @@ Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename, in
Common::SeekableReadStream *stream = dataFile->readStream(uncompressedSize);
delete dataFile;
delete dataRunFile;
- return stream;
+ return new FileStream(stream, bigEndian);
} else {
if (fileCount != 1) {
dataRunFile->seek(indexOffset);
@@ -276,12 +269,12 @@ Common::SeekableReadStream *StarTrekEngine::openFile(Common::String filename, in
delete dataFile;
delete dataRunFile;
- return stream;
+ return new FileStream(stream, bigEndian);
}
-
+
// We should not get to this point...
error("Could not find data for \'%s\'", filename.c_str());
-
+
return NULL;
}
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 9f6935d..22dec31 100755
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -74,7 +74,7 @@ public:
Common::Language getLanguage();
// Resource related functions
- Common::SeekableReadStream *openFile(Common::String filename, int fileIndex=0);
+ Common::SeekableReadStreamEndian *openFile(Common::String filename, int fileIndex=0);
// Movie related functions
void playMovie(Common::String filename);
Commit: c71a8a6d2acb3be145731e6af344cb16a38c6b46
https://github.com/scummvm/scummvm/commit/c71a8a6d2acb3be145731e6af344cb16a38c6b46
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement drawSprite function
Changed paths:
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/startrek.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 5304d40..acedd72 100755
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -43,6 +43,10 @@ Bitmap::Bitmap(Common::ReadStreamEndian *stream) {
stream->read(pixels, width*height);
}
+Bitmap::Bitmap(int w, int h) : width(w), height(h) {
+ pixels = (byte*)malloc(width*height);
+}
+
Bitmap::~Bitmap() {
free(pixels);
}
@@ -53,22 +57,30 @@ Bitmap::~Bitmap() {
Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_font = 0;
_egaData = 0;
+ _priData = 0;
if (ConfMan.hasKey("render_mode"))
_egaMode = (Common::parseRenderMode(ConfMan.get("render_mode").c_str()) == Common::kRenderEGA) && (_vm->getGameType() != GType_STJR) && !(_vm->getFeatures() & GF_DEMO);
if (_vm->getGameType() == GType_ST25 && _vm->getPlatform() == Common::kPlatformDOS)
_font = new Font(_vm);
+
+ _backgroundImage = new Bitmap(_vm->openFile("DEMON0.BMP"));
+ _canvas = new Bitmap(SCREEN_WIDTH, SCREEN_HEIGHT);
}
Graphics::~Graphics() {
if (_egaData)
free(_egaData);
+ if (_priData)
+ free(_priData);
delete _font;
+ delete _backgroundImage;
+ delete _canvas;
}
-void Graphics::setPalette(const char *paletteFile) {
+void Graphics::loadPalette(const char *paletteFile) {
// Set the palette from a PAL file
Common::SeekableReadStream *palStream = _vm->openFile(paletteFile);
@@ -86,16 +98,84 @@ void Graphics::setPalette(const char *paletteFile) {
delete palStream;
}
-void Graphics::drawBitmap(Bitmap *bitmap) {
- int xoffset = bitmap->xoffset;
- int yoffset = bitmap->yoffset;
- if (xoffset >= 320)
- xoffset = 0;
- if (yoffset >= 200)
- yoffset = 0;
+void Graphics::loadPri(const char *priFile) {
+ Common::SeekableReadStream *priStream = _vm->openFile(priFile);
- _vm->_system->copyRectToScreen(bitmap->pixels, bitmap->width, xoffset, yoffset, bitmap->width, bitmap->height);
- _vm->_system->updateScreen();
+ free(_priData);
+ _priData = (byte*)malloc(SCREEN_WIDTH*SCREEN_HEIGHT/2);
+ priStream->read(_priData, SCREEN_WIDTH*SCREEN_HEIGHT/2);
+}
+
+void Graphics::redrawScreen() {
+ // TODO: get rid of _canvas for efficiency
+ memcpy(_canvas->pixels, _backgroundImage->pixels, SCREEN_WIDTH*SCREEN_HEIGHT);
+
+ // drawSprite test
+ Sprite spr;
+ memset(&spr,0,sizeof(Sprite));
+ spr.bitmap = new Bitmap(_vm->openFile("MWALKE00.BMP"));
+ spr.drawPriority = 1;
+ spr.drawX = 150;
+ spr.drawY = 30;
+
+ drawSprite(spr, Common::Rect(spr.drawX,spr.drawY,spr.drawX+spr.bitmap->width,spr.drawY+spr.bitmap->height));
+
+ drawBitmapToScreen(_canvas);
+}
+
+// rect is the rectangle on-screen to draw. It should encompass the sprite itself, but if
+// it doesn't, part of the sprite will be cut off.
+void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
+ int drawWidth = rect.right - rect.left;
+ int drawHeight = rect.bottom - rect.top;
+
+ if (drawWidth <= 0 || drawHeight <= 0)
+ error("drawSprite: w/h <= 0");
+
+
+ byte *dest = _canvas->pixels + rect.top*SCREEN_WIDTH + rect.left;
+ int canvasOffsetToNextLine = SCREEN_WIDTH - drawWidth;
+
+ switch(sprite.drawMode) {
+ case 0: { // Normal sprite
+ byte *src = sprite.bitmap->pixels + (rect.left - sprite.drawX)
+ + (rect.top - sprite.drawY) * sprite.bitmap->width;
+
+ int spriteOffsetToNextLine = sprite.bitmap->width - drawWidth;
+ int priOffset = rect.top*SCREEN_WIDTH + rect.left;
+
+ for (int y=rect.top; y<rect.bottom; y++) {
+ for (int x=rect.left; x<rect.right; x++) {
+ byte priByte = _priData[priOffset/2];
+ byte bgPri;
+ if ((priOffset%2) == 1)
+ bgPri = (priByte)&0xf;
+ else
+ bgPri = (priByte)>>4;
+ priOffset++;
+
+ byte b = *src++;
+ if (b == 0 || sprite.drawPriority < bgPri) {
+ dest++;
+ continue;
+ }
+ *dest++ = b;
+ }
+
+ src += spriteOffsetToNextLine;
+ dest += canvasOffsetToNextLine;
+ priOffset += canvasOffsetToNextLine;
+ }
+ break;
+ }
+
+ case 1:
+ case 2:
+ case 3:
+ default:
+ error("drawSprite: draw mode %d not implemented", sprite.drawMode);
+ break;
+ }
}
@@ -139,4 +219,18 @@ void Graphics::drawBackgroundImage(const char *filename) {
delete imageStream;
}
+
+void Graphics::drawBitmapToScreen(Bitmap *bitmap) {
+ int xoffset = bitmap->xoffset;
+ int yoffset = bitmap->yoffset;
+ if (xoffset >= 320)
+ xoffset = 0;
+ if (yoffset >= 200)
+ yoffset = 0;
+
+ _vm->_system->copyRectToScreen(bitmap->pixels, bitmap->width, xoffset, yoffset, bitmap->width, bitmap->height);
+ _vm->_system->updateScreen();
+}
+
+
}
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 6637928..a2d9f4f 100755
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -29,6 +29,7 @@
#include "startrek/startrek.h"
#include "startrek/font.h"
+#include "common/rect.h"
#include "common/stream.h"
namespace StarTrek {
@@ -37,27 +38,23 @@ class Font;
class StarTrekEngine;
-class Bitmap {
-public:
+const int SCREEN_WIDTH = 320;
+const int SCREEN_HEIGHT = 200;
+
+
+struct Bitmap {
uint16 xoffset;
uint16 yoffset;
uint16 width;
uint16 height;
byte *pixels;
-public:
Bitmap(Common::ReadStreamEndian *stream);
+ Bitmap(int w, int h);
~Bitmap();
};
-class Rectangle {
- uint16 left;
- uint16 top;
- uint16 right;
- uint16 bottom;
-};
-
-class Sprite {
+struct Sprite {
uint16 x,y;
uint16 drawPriority;
uint16 field6;
@@ -69,9 +66,9 @@ class Sprite {
uint16 redrawCondition2;
uint16 redrawCondition3;
uint16 field16;
- Rectangle rectangle1;
- Rectangle clickRectangle;
- Rectangle rectangle2;
+ Common::Rect rectangle1;
+ Common::Rect clickRectangle;
+ Common::Rect rectangle2;
uint16 drawX,drawY;
};
@@ -81,19 +78,29 @@ public:
Graphics(StarTrekEngine *vm);
~Graphics();
- void setPalette(const char *paletteFile);
- void drawBitmap(Bitmap *bitmap);
+ void loadPalette(const char *paletteFile);
+ void loadPri(const char *priFile);
+
+ void redrawScreen();
+ void drawSprite(const Sprite &sprite, const Common::Rect &rect);
void loadEGAData(const char *egaFile);
void drawBackgroundImage(const char *filename);
private:
+ void drawBitmapToScreen(Bitmap *bitmap);
+
+
StarTrekEngine *_vm;
Font *_font;
bool _egaMode;
byte *_egaData;
+ byte *_priData;
+
+ Bitmap *_backgroundImage;
+ Bitmap *_canvas;
};
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 5401e52..f007301 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -88,10 +88,9 @@ Common::Error StarTrekEngine::run() {
// EGA not supported
#if 1
if (getGameType() == GType_ST25) {
- _gfx->setPalette("PALETTE.PAL");
- Bitmap *b = new Bitmap(openFile("DEMON5.BMP"));
- _gfx->drawBitmap(b);
- delete b;
+ _gfx->loadPalette("PALETTE.PAL");
+ _gfx->loadPri("DEMON0.PRI");
+ _gfx->redrawScreen();
if (getPlatform() == Common::kPlatformAmiga)
_sound->playSoundEffect("TREK2");
@@ -117,6 +116,8 @@ Common::Error StarTrekEngine::run() {
break;
}
}
+
+ _system->delayMillis(1000/60);
}
#endif
Commit: cd45502501787c8003cfd86b7adf48a6f86d68de
https://github.com/scummvm/scummvm/commit/cd45502501787c8003cfd86b7adf48a6f86d68de
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement draw modes 2 and 3 for sprites
Changed paths:
A engines/startrek/bitmap.cpp
A engines/startrek/bitmap.h
engines/startrek/font.cpp
engines/startrek/font.h
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/module.mk
engines/startrek/startrek.cpp
diff --git a/engines/startrek/bitmap.cpp b/engines/startrek/bitmap.cpp
new file mode 100644
index 0000000..43aee81
--- /dev/null
+++ b/engines/startrek/bitmap.cpp
@@ -0,0 +1,55 @@
+/* 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 "startrek/bitmap.h"
+#include "startrek/startrek.h"
+
+namespace StarTrek {
+
+Bitmap::Bitmap(Common::ReadStreamEndian *stream) {
+ xoffset = stream->readUint16();
+ yoffset = stream->readUint16();
+ width = stream->readUint16();
+ height = stream->readUint16();
+
+ pixels = new byte[width*height];
+ stream->read(pixels, width*height);
+}
+
+Bitmap::Bitmap(int w, int h) : width(w), height(h), xoffset(0), yoffset(0) {
+ pixels = new byte[width*height];
+}
+
+Bitmap::~Bitmap() {
+ delete[] pixels;
+}
+
+
+TextBitmap::TextBitmap(int w, int h) {
+ width = w;
+ height = h;
+ // Width and Height are the total dimensions. Since each character takes 8 pixels in
+ // each dimension, the "pixels" array (which actually stores character indices) must
+ // be smaller.
+ pixels = new byte[width/8*height/8];
+}
+
+}
diff --git a/engines/startrek/bitmap.h b/engines/startrek/bitmap.h
new file mode 100644
index 0000000..d30aee1
--- /dev/null
+++ b/engines/startrek/bitmap.h
@@ -0,0 +1,34 @@
+#ifndef STARTREK_BITMAP_H
+#define STARTREK_BITMAP_H
+
+#include "common/stream.h"
+
+namespace StarTrek {
+
+struct Bitmap {
+ uint16 xoffset;
+ uint16 yoffset;
+ uint16 width;
+ uint16 height;
+ byte *pixels;
+
+ Bitmap(Common::ReadStreamEndian *stream);
+ Bitmap(int w, int h);
+ ~Bitmap();
+
+protected:
+ Bitmap() : xoffset(0),yoffset(0),width(0),height(0),pixels(nullptr) {}
+};
+
+
+// TextBitmap is the same as Bitmap, except it stores character indices in its "pixels"
+// array instead of actual pixels.
+// A consequence of this is that the pixels array is smaller than otherwise expected
+// (since width/height still reflect the actual size when drawn).
+struct TextBitmap : Bitmap {
+ TextBitmap(int w, int h);
+};
+
+}
+
+#endif
diff --git a/engines/startrek/font.cpp b/engines/startrek/font.cpp
index 157c984..a6f583a 100755
--- a/engines/startrek/font.cpp
+++ b/engines/startrek/font.cpp
@@ -66,4 +66,8 @@ Font::~Font() {
delete[] _characters;
}
+byte *Font::getCharData(int i) {
+ return _characters[i].data;
+}
+
}
diff --git a/engines/startrek/font.h b/engines/startrek/font.h
index 857c98e..62a354c 100755
--- a/engines/startrek/font.h
+++ b/engines/startrek/font.h
@@ -36,6 +36,8 @@ class Font {
public:
Font(StarTrekEngine *vm);
~Font();
+
+ byte *getCharData(int i);
private:
StarTrekEngine *_vm;
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index acedd72..c597568 100755
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -17,10 +17,6 @@
* 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.
- *
- * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/graphics.cpp $
- * $Id: graphics.cpp 14 2010-05-26 15:44:12Z clone2727 $
- *
*/
#include "startrek/graphics.h"
@@ -31,33 +27,14 @@
namespace StarTrek {
-// Bitmap class
-
-Bitmap::Bitmap(Common::ReadStreamEndian *stream) {
- xoffset = stream->readUint16();
- yoffset = stream->readUint16();
- width = stream->readUint16();
- height = stream->readUint16();
-
- pixels = (byte*)malloc(width*height);
- stream->read(pixels, width*height);
-}
-
-Bitmap::Bitmap(int w, int h) : width(w), height(h) {
- pixels = (byte*)malloc(width*height);
-}
-
-Bitmap::~Bitmap() {
- free(pixels);
-}
-
+Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
+ _font = nullptr;
-// Graphics class
+ _egaData = nullptr;
+ _priData = nullptr;
+ _lutData = nullptr;
-Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
- _font = 0;
- _egaData = 0;
- _priData = 0;
+ _screenRect = Common::Rect(SCREEN_WIDTH, SCREEN_HEIGHT);
if (ConfMan.hasKey("render_mode"))
_egaMode = (Common::parseRenderMode(ConfMan.get("render_mode").c_str()) == Common::kRenderEGA) && (_vm->getGameType() != GType_STJR) && !(_vm->getFeatures() & GF_DEMO);
@@ -70,20 +47,21 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
}
Graphics::~Graphics() {
- if (_egaData)
- free(_egaData);
- if (_priData)
- free(_priData);
+ delete[] _egaData;
+ delete[] _priData;
+ delete[] _lutData;
delete _font;
delete _backgroundImage;
delete _canvas;
}
-void Graphics::loadPalette(const char *paletteFile) {
+void Graphics::loadPalette(const Common::String &paletteName) {
// Set the palette from a PAL file
+ Common::String palFile = paletteName + ".PAL";
+ Common::String lutFile = paletteName + ".LUT";
- Common::SeekableReadStream *palStream = _vm->openFile(paletteFile);
+ Common::SeekableReadStream *palStream = _vm->openFile(palFile.c_str());
byte *palette = new byte[256 * 3];
palStream->read(palette, 256 * 3);
@@ -96,13 +74,22 @@ void Graphics::loadPalette(const char *paletteFile) {
delete[] palette;
delete palStream;
+
+ // Load LUT file
+ Common::SeekableReadStream *lutStream = _vm->openFile(lutFile.c_str());
+
+ delete[] _lutData;
+ _lutData = new byte[256];
+ lutStream->read(_lutData, 256);
+
+ delete lutStream;
}
void Graphics::loadPri(const char *priFile) {
Common::SeekableReadStream *priStream = _vm->openFile(priFile);
- free(_priData);
- _priData = (byte*)malloc(SCREEN_WIDTH*SCREEN_HEIGHT/2);
+ delete[] _priData;
+ _priData = new byte[SCREEN_WIDTH*SCREEN_HEIGHT/2];
priStream->read(_priData, SCREEN_WIDTH*SCREEN_HEIGHT/2);
}
@@ -110,70 +97,177 @@ void Graphics::redrawScreen() {
// TODO: get rid of _canvas for efficiency
memcpy(_canvas->pixels, _backgroundImage->pixels, SCREEN_WIDTH*SCREEN_HEIGHT);
- // drawSprite test
+ // drawSprite tests
+
+ // Draw mode 0
Sprite spr;
memset(&spr,0,sizeof(Sprite));
spr.bitmap = new Bitmap(_vm->openFile("MWALKE00.BMP"));
spr.drawPriority = 1;
spr.drawX = 150;
spr.drawY = 30;
+ spr.drawMode = 0;
+ drawSprite(spr);
+
+ // Draw mode 2 (translucent background)
+ memset(&spr,0,sizeof(Sprite));
+ spr.bitmap = new Bitmap(_vm->openFile("KWALKS00.BMP"));
+ spr.drawPriority = 1;
+ spr.drawX = 200;
+ spr.drawY = 40;
+ spr.drawMode = 2;
+ drawSprite(spr);
- drawSprite(spr, Common::Rect(spr.drawX,spr.drawY,spr.drawX+spr.bitmap->width,spr.drawY+spr.bitmap->height));
+ // Draw mode 3 (text)
+ memset(&spr,0,sizeof(Sprite));
+ spr.bitmap = new Bitmap(8*8,8*8);
+ for (int i=0;i<8*8;i++)
+ spr.bitmap->pixels[i] = 0x40+i;
+ spr.drawX = 8*10;
+ spr.drawY = 50;
+ spr.textColor = 0xb3;
+ spr.drawMode = 3;
+ drawSprite(spr);
drawBitmapToScreen(_canvas);
}
-// rect is the rectangle on-screen to draw. It should encompass the sprite itself, but if
-// it doesn't, part of the sprite will be cut off.
+void Graphics::drawSprite(const Sprite &sprite) {
+ drawSprite(sprite, Common::Rect(sprite.drawX,sprite.drawY,sprite.drawX+sprite.bitmap->width-1,sprite.drawY+sprite.bitmap->height-1));
+}
+
+// rect is the portion of the sprite to update. It must be entirely contained within the
+// sprite's actual, full rectangle.
void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
- int drawWidth = rect.right - rect.left;
- int drawHeight = rect.bottom - rect.top;
+ Common::Rect spriteRect = Common::Rect(sprite.drawX, sprite.drawY,
+ sprite.drawX+sprite.bitmap->width-1, sprite.drawY+sprite.bitmap->height-1);
- if (drawWidth <= 0 || drawHeight <= 0)
- error("drawSprite: w/h <= 0");
-
+ assert(_screenRect.contains(rect));
+ assert(spriteRect.contains(rect));
byte *dest = _canvas->pixels + rect.top*SCREEN_WIDTH + rect.left;
- int canvasOffsetToNextLine = SCREEN_WIDTH - drawWidth;
switch(sprite.drawMode) {
case 0: { // Normal sprite
byte *src = sprite.bitmap->pixels + (rect.left - sprite.drawX)
+ (rect.top - sprite.drawY) * sprite.bitmap->width;
- int spriteOffsetToNextLine = sprite.bitmap->width - drawWidth;
int priOffset = rect.top*SCREEN_WIDTH + rect.left;
for (int y=rect.top; y<rect.bottom; y++) {
for (int x=rect.left; x<rect.right; x++) {
byte priByte = _priData[priOffset/2];
- byte bgPri;
+ byte bgPriority;
if ((priOffset%2) == 1)
- bgPri = (priByte)&0xf;
+ bgPriority = priByte&0xf;
else
- bgPri = (priByte)>>4;
+ bgPriority = priByte>>4;
priOffset++;
byte b = *src++;
- if (b == 0 || sprite.drawPriority < bgPri) {
+ if (b == 0 || sprite.drawPriority < bgPriority) {
dest++;
continue;
}
*dest++ = b;
}
- src += spriteOffsetToNextLine;
- dest += canvasOffsetToNextLine;
- priOffset += canvasOffsetToNextLine;
+ src += sprite.bitmap->width - rect.width();
+ dest += SCREEN_WIDTH - rect.width();
+ priOffset += SCREEN_WIDTH - rect.width();
+ }
+ break;
+ }
+
+ case 1: // Invisible
+ break;
+
+ case 2: { // Normal sprite with darkened background for "transparent" pixels (and no priority)
+ byte *src = sprite.bitmap->pixels + (rect.left - sprite.drawX)
+ + (rect.top - sprite.drawY) * sprite.bitmap->width;
+
+ for (int y=rect.top; y<rect.bottom; y++) {
+ for (int x=rect.left; x<rect.right; x++) {
+ byte b = *src;
+
+ if (b == 0) // Transparent (darken the pixel)
+ *dest = _lutData[*dest];
+ else // Solid color
+ *dest = b;
+
+ src++;
+ dest++;
+ }
+
+ src += sprite.bitmap->width - rect.width();
+ dest += SCREEN_WIDTH - rect.width();
+ }
+
+ break;
+ }
+
+ case 3: { // Text
+ // The sprite's "bitmap" is not actually a bitmap, but instead the list of
+ // characters to display.
+
+ Common::Rect rectangle1;
+
+ rectangle1.left = (rect.left - sprite.drawX)/8;
+ rectangle1.top = (rect.top - sprite.drawY)/8;
+ rectangle1.right = (rect.right - sprite.drawX)/8;
+ rectangle1.bottom = (rect.bottom - sprite.drawY)/8;
+
+ int drawWidth = rectangle1.width() + 1;
+ int drawHeight = rectangle1.height() + 1;
+
+ dest =_canvas->pixels + sprite.drawY*SCREEN_WIDTH + sprite.drawX
+ + rectangle1.top*8*SCREEN_WIDTH + rectangle1.left*8;
+
+ byte *src = sprite.bitmap->pixels + rectangle1.top*sprite.bitmap->width/8 + rectangle1.left;
+
+ for (int y=0; y<drawHeight; y++) {
+ for (int x=0; x<drawWidth; x++) {
+ byte c = *src;
+
+ int textColor;
+ if (c >= 0x10 && c <= 0x1A) // Border characters
+ textColor = 0xb3;
+ else
+ textColor = sprite.textColor;
+
+ byte *fontData = _font->getCharData(c);
+
+ for (int i=0;i<8;i++) {
+ for (int j=0;j<8;j++) {
+ byte b = *fontData;
+
+ if (b == 0) // Transparent: use lookup table to darken this pixel
+ *dest = _lutData[*dest];
+ else if (b == 0x78) // Inner part of character
+ *dest = textColor;
+ else // Outline of character
+ *dest = b;
+
+ fontData++;
+ dest++;
+ }
+ dest += SCREEN_WIDTH - 8;
+ }
+
+ dest -= (SCREEN_WIDTH*8 - 8);
+ src++;
+ }
+
+ src += sprite.bitmap->width/8 - drawWidth;
+ dest += SCREEN_WIDTH*8 - drawWidth*8;
+
}
+
break;
}
- case 1:
- case 2:
- case 3:
default:
- error("drawSprite: draw mode %d not implemented", sprite.drawMode);
+ error("drawSprite: draw mode %d invalid", sprite.drawMode);
break;
}
}
@@ -185,7 +279,7 @@ void Graphics::loadEGAData(const char *filename) {
return;
if (!_egaData)
- _egaData = (byte *)malloc(256);
+ _egaData = new byte[256];
Common::SeekableReadStream *egaStream = _vm->openFile(filename);
egaStream->read(_egaData, 256);
@@ -208,7 +302,7 @@ void Graphics::drawBackgroundImage(const char *filename) {
uint16 width = imageStream->readUint16LE();
uint16 height = imageStream->readUint16LE();
- byte *pixels = (byte *)malloc(width * height);
+ byte *pixels = new byte[width * height];
imageStream->read(pixels, width * height);
_vm->_system->getPaletteManager()->setPalette(palette, 0, 256);
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index a2d9f4f..884f7ed 100755
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -26,6 +26,7 @@
#ifndef STARTREK_GRAPHICS_H
#define STARTREK_GRAPHICS_H
+#include "startrek/bitmap.h"
#include "startrek/startrek.h"
#include "startrek/font.h"
@@ -42,18 +43,6 @@ const int SCREEN_WIDTH = 320;
const int SCREEN_HEIGHT = 200;
-struct Bitmap {
- uint16 xoffset;
- uint16 yoffset;
- uint16 width;
- uint16 height;
- byte *pixels;
-
- Bitmap(Common::ReadStreamEndian *stream);
- Bitmap(int w, int h);
- ~Bitmap();
-};
-
struct Sprite {
uint16 x,y;
uint16 drawPriority;
@@ -61,7 +50,7 @@ struct Sprite {
uint16 field8;
Bitmap *bitmap;
uint16 drawMode;
- uint16 fieldE;
+ uint16 textColor;
uint16 bitmapChanged;
uint16 redrawCondition2;
uint16 redrawCondition3;
@@ -78,10 +67,11 @@ public:
Graphics(StarTrekEngine *vm);
~Graphics();
- void loadPalette(const char *paletteFile);
+ void loadPalette(const Common::String &paletteFile);
void loadPri(const char *priFile);
void redrawScreen();
+ void drawSprite(const Sprite &sprite);
void drawSprite(const Sprite &sprite, const Common::Rect &rect);
void loadEGAData(const char *egaFile);
@@ -98,7 +88,9 @@ private:
bool _egaMode;
byte *_egaData;
byte *_priData;
+ byte *_lutData;
+ Common::Rect _screenRect;
Bitmap *_backgroundImage;
Bitmap *_canvas;
};
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 0b95d7d..c47c19a 100755
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -1,6 +1,7 @@
MODULE := engines/startrek
MODULE_OBJS = \
+ bitmap.o \
detection.o \
filestream.o \
font.o \
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index f007301..55cd646 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -88,7 +88,7 @@ Common::Error StarTrekEngine::run() {
// EGA not supported
#if 1
if (getGameType() == GType_ST25) {
- _gfx->loadPalette("PALETTE.PAL");
+ _gfx->loadPalette("PALETTE");
_gfx->loadPri("DEMON0.PRI");
_gfx->redrawScreen();
@@ -116,6 +116,7 @@ Common::Error StarTrekEngine::run() {
break;
}
}
+ _system->updateScreen();
_system->delayMillis(1000/60);
}
Commit: 8cd5441959108b890d1433e70376c6cc1dd3bdb5
https://github.com/scummvm/scummvm/commit/8cd5441959108b890d1433e70376c6cc1dd3bdb5
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement addSprite and delSprite
Changed paths:
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/startrek.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index c597568..039f62a 100755
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -44,6 +44,8 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_backgroundImage = new Bitmap(_vm->openFile("DEMON0.BMP"));
_canvas = new Bitmap(SCREEN_WIDTH, SCREEN_HEIGHT);
+
+ _numSprites = 0;
}
Graphics::~Graphics() {
@@ -56,6 +58,48 @@ Graphics::~Graphics() {
delete _canvas;
}
+
+void Graphics::loadEGAData(const char *filename) {
+ // Load EGA palette data
+ if (!_egaMode)
+ return;
+
+ if (!_egaData)
+ _egaData = new byte[256];
+
+ Common::SeekableReadStream *egaStream = _vm->openFile(filename);
+ egaStream->read(_egaData, 256);
+ delete egaStream;
+}
+
+void Graphics::drawBackgroundImage(const char *filename) {
+ // Draw an stjr BGD image (palette built-in)
+
+ Common::SeekableReadStream *imageStream = _vm->openFile(filename);
+ byte *palette = new byte[256 * 3];
+ imageStream->read(palette, 256 * 3);
+
+ // Expand color components
+ for (uint16 i = 0; i < 256 * 3; i++)
+ palette[i] <<= 2;
+
+ uint16 xoffset = imageStream->readUint16LE();
+ uint16 yoffset = imageStream->readUint16LE();
+ uint16 width = imageStream->readUint16LE();
+ uint16 height = imageStream->readUint16LE();
+
+ byte *pixels = new byte[width * height];
+ imageStream->read(pixels, width * height);
+
+ _vm->_system->getPaletteManager()->setPalette(palette, 0, 256);
+ _vm->_system->copyRectToScreen(pixels, width, xoffset, yoffset, width, height);
+ _vm->_system->updateScreen();
+
+ delete[] palette;
+ delete imageStream;
+}
+
+
void Graphics::loadPalette(const Common::String &paletteName) {
// Set the palette from a PAL file
Common::String palFile = paletteName + ".PAL";
@@ -97,37 +141,7 @@ void Graphics::redrawScreen() {
// TODO: get rid of _canvas for efficiency
memcpy(_canvas->pixels, _backgroundImage->pixels, SCREEN_WIDTH*SCREEN_HEIGHT);
- // drawSprite tests
-
- // Draw mode 0
- Sprite spr;
- memset(&spr,0,sizeof(Sprite));
- spr.bitmap = new Bitmap(_vm->openFile("MWALKE00.BMP"));
- spr.drawPriority = 1;
- spr.drawX = 150;
- spr.drawY = 30;
- spr.drawMode = 0;
- drawSprite(spr);
-
- // Draw mode 2 (translucent background)
- memset(&spr,0,sizeof(Sprite));
- spr.bitmap = new Bitmap(_vm->openFile("KWALKS00.BMP"));
- spr.drawPriority = 1;
- spr.drawX = 200;
- spr.drawY = 40;
- spr.drawMode = 2;
- drawSprite(spr);
-
- // Draw mode 3 (text)
- memset(&spr,0,sizeof(Sprite));
- spr.bitmap = new Bitmap(8*8,8*8);
- for (int i=0;i<8*8;i++)
- spr.bitmap->pixels[i] = 0x40+i;
- spr.drawX = 8*10;
- spr.drawY = 50;
- spr.textColor = 0xb3;
- spr.drawMode = 3;
- drawSprite(spr);
+ drawAllSprites();
drawBitmapToScreen(_canvas);
}
@@ -272,45 +286,42 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
}
}
-
-void Graphics::loadEGAData(const char *filename) {
- // Load EGA palette data
- if (!_egaMode)
- return;
-
- if (!_egaData)
- _egaData = new byte[256];
-
- Common::SeekableReadStream *egaStream = _vm->openFile(filename);
- egaStream->read(_egaData, 256);
- delete egaStream;
+void Graphics::drawAllSprites() {
+ // TODO: implement properly
+ for (int i=0; i<_numSprites; i++) {
+ Sprite *spr = _sprites[i];
+ drawSprite(*spr);
+ }
}
-void Graphics::drawBackgroundImage(const char *filename) {
- // Draw an stjr BGD image (palette built-in)
+void Graphics::addSprite(Sprite *sprite) {
+ if (_numSprites >= MAX_SPRITES)
+ error("addSprite: too many sprites");
- Common::SeekableReadStream *imageStream = _vm->openFile(filename);
- byte *palette = new byte[256 * 3];
- imageStream->read(palette, 256 * 3);
+ // Initialize some fields
+ sprite->drawMode = 0;
+ sprite->field8 = 0;
+ sprite->field16 = 0;
- // Expand color components
- for (uint16 i = 0; i < 256 * 3; i++)
- palette[i] <<= 2;
+ sprite->rectangle1.top = -1;
+ sprite->rectangle1.left = -1;
+ sprite->rectangle1.bottom = -2;
+ sprite->rectangle1.right = -2;
- uint16 xoffset = imageStream->readUint16LE();
- uint16 yoffset = imageStream->readUint16LE();
- uint16 width = imageStream->readUint16LE();
- uint16 height = imageStream->readUint16LE();
+ _sprites[_numSprites++] = sprite;
+}
- byte *pixels = new byte[width * height];
- imageStream->read(pixels, width * height);
+void Graphics::delSprite(Sprite *sprite) {
+ for (int i=0; i<_numSprites; i++) {
+ if (sprite != _sprites[i])
+ continue;
- _vm->_system->getPaletteManager()->setPalette(palette, 0, 256);
- _vm->_system->copyRectToScreen(pixels, width, xoffset, yoffset, width, height);
- _vm->_system->updateScreen();
+ _numSprites--;
+ _sprites[i] = _sprites[_numSprites];
+ return;
+ }
- delete[] palette;
- delete imageStream;
+ error("delSprite: sprite not in list");
}
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 884f7ed..cefbf70 100755
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -42,6 +42,8 @@ class StarTrekEngine;
const int SCREEN_WIDTH = 320;
const int SCREEN_HEIGHT = 200;
+const int MAX_SPRITES = 32;
+
struct Sprite {
uint16 x,y;
@@ -67,15 +69,19 @@ public:
Graphics(StarTrekEngine *vm);
~Graphics();
+ void loadEGAData(const char *egaFile);
+ void drawBackgroundImage(const char *filename);
+
void loadPalette(const Common::String &paletteFile);
void loadPri(const char *priFile);
void redrawScreen();
void drawSprite(const Sprite &sprite);
void drawSprite(const Sprite &sprite, const Common::Rect &rect);
+ void drawAllSprites();
- void loadEGAData(const char *egaFile);
- void drawBackgroundImage(const char *filename);
+ void addSprite(Sprite *sprite);
+ void delSprite(Sprite *sprite);
private:
@@ -93,6 +99,9 @@ private:
Common::Rect _screenRect;
Bitmap *_backgroundImage;
Bitmap *_canvas;
+
+ Sprite *_sprites[MAX_SPRITES];
+ int _numSprites;
};
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 55cd646..ff3bf5e 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -103,6 +103,39 @@ Common::Error StarTrekEngine::run() {
} else {
_gfx->drawBackgroundImage("BRIDGE.BGD");
}
+
+
+ // Sprite tests
+
+ // Draw mode 0
+ Sprite *spr = new Sprite;
+ _gfx->addSprite(spr);
+ spr->bitmap = new Bitmap(openFile("MWALKE00.BMP"));
+ spr->drawPriority = 1;
+ spr->drawX = 150;
+ spr->drawY = 30;
+ spr->drawMode = 0;
+
+ // Draw mode 2 (translucent background)
+ spr = new Sprite;
+ _gfx->addSprite(spr);
+ spr->bitmap = new Bitmap(openFile("KWALKS00.BMP"));
+ spr->drawPriority = 1;
+ spr->drawX = 200;
+ spr->drawY = 40;
+ spr->drawMode = 2;
+
+ // Draw mode 3 (text)
+ spr = new Sprite;
+ _gfx->addSprite(spr);
+ spr->bitmap = new TextBitmap(8*8,8*8);
+ for (int i=0;i<8*8;i++)
+ spr->bitmap->pixels[i] = 0x40+i;
+ spr->drawX = 8*10;
+ spr->drawY = 50;
+ spr->textColor = 0xb3;
+ spr->drawMode = 3;
+
Common::Event event;
@@ -116,7 +149,7 @@ Common::Error StarTrekEngine::run() {
break;
}
}
- _system->updateScreen();
+ _gfx->redrawScreen();
_system->delayMillis(1000/60);
}
Commit: 2dd96e044f46aed90ed1b6dbc682bc01f43e438c
https://github.com/scummvm/scummvm/commit/2dd96e044f46aed90ed1b6dbc682bc01f43e438c
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Begin implementation of showText.
Also started using SharedPtrs.
Changed paths:
A engines/startrek/sprite.cpp
A engines/startrek/sprite.h
A engines/startrek/text.cpp
engines/startrek/font.cpp
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/module.mk
engines/startrek/sound.cpp
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/font.cpp b/engines/startrek/font.cpp
index a6f583a..db31042 100755
--- a/engines/startrek/font.cpp
+++ b/engines/startrek/font.cpp
@@ -31,15 +31,13 @@ static const byte CHARACTER_COUNT = 0x80;
static const byte CHARACTER_SIZE = 0x40;
Font::Font(StarTrekEngine *vm) : _vm(vm) {
- Common::SeekableReadStream *fontStream = _vm->openFile("FONT.FNT");
+ SharedPtr<Common::SeekableReadStream> fontStream = _vm->openFile("FONT.FNT");
_characters = new Character[CHARACTER_COUNT];
for (byte i = 0; i < CHARACTER_COUNT; i++)
fontStream->read(_characters[i].data, CHARACTER_SIZE);
- delete fontStream;
-
#if 0
// Code to dump the font
printf ("DUMPING FONT");
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 039f62a..307efcb 100755
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -42,7 +42,7 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
if (_vm->getGameType() == GType_ST25 && _vm->getPlatform() == Common::kPlatformDOS)
_font = new Font(_vm);
- _backgroundImage = new Bitmap(_vm->openFile("DEMON0.BMP"));
+ _backgroundImage = new Bitmap(_vm->openFile("DEMON0.BMP").get());
_canvas = new Bitmap(SCREEN_WIDTH, SCREEN_HEIGHT);
_numSprites = 0;
@@ -67,15 +67,14 @@ void Graphics::loadEGAData(const char *filename) {
if (!_egaData)
_egaData = new byte[256];
- Common::SeekableReadStream *egaStream = _vm->openFile(filename);
+ SharedPtr<Common::SeekableReadStream> egaStream = _vm->openFile(filename);
egaStream->read(_egaData, 256);
- delete egaStream;
}
void Graphics::drawBackgroundImage(const char *filename) {
// Draw an stjr BGD image (palette built-in)
- Common::SeekableReadStream *imageStream = _vm->openFile(filename);
+ SharedPtr<Common::SeekableReadStream> imageStream = _vm->openFile(filename);
byte *palette = new byte[256 * 3];
imageStream->read(palette, 256 * 3);
@@ -96,7 +95,6 @@ void Graphics::drawBackgroundImage(const char *filename) {
_vm->_system->updateScreen();
delete[] palette;
- delete imageStream;
}
@@ -105,7 +103,7 @@ void Graphics::loadPalette(const Common::String &paletteName) {
Common::String palFile = paletteName + ".PAL";
Common::String lutFile = paletteName + ".LUT";
- Common::SeekableReadStream *palStream = _vm->openFile(palFile.c_str());
+ SharedPtr<Common::SeekableReadStream> palStream = _vm->openFile(palFile.c_str());
byte *palette = new byte[256 * 3];
palStream->read(palette, 256 * 3);
@@ -117,26 +115,27 @@ void Graphics::loadPalette(const Common::String &paletteName) {
_vm->_system->getPaletteManager()->setPalette(palette, 0, 256);
delete[] palette;
- delete palStream;
// Load LUT file
- Common::SeekableReadStream *lutStream = _vm->openFile(lutFile.c_str());
+ SharedPtr<Common::SeekableReadStream> lutStream = _vm->openFile(lutFile.c_str());
delete[] _lutData;
_lutData = new byte[256];
lutStream->read(_lutData, 256);
-
- delete lutStream;
}
void Graphics::loadPri(const char *priFile) {
- Common::SeekableReadStream *priStream = _vm->openFile(priFile);
+ SharedPtr<Common::SeekableReadStream> priStream = _vm->openFile(priFile);
delete[] _priData;
_priData = new byte[SCREEN_WIDTH*SCREEN_HEIGHT/2];
priStream->read(_priData, SCREEN_WIDTH*SCREEN_HEIGHT/2);
}
+SharedPtr<Bitmap> Graphics::loadBitmap(Common::String basename) {
+ return SharedPtr<Bitmap>(new Bitmap(_vm->openFile(basename+".BMP").get()));
+}
+
void Graphics::redrawScreen() {
// TODO: get rid of _canvas for efficiency
memcpy(_canvas->pixels, _backgroundImage->pixels, SCREEN_WIDTH*SCREEN_HEIGHT);
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index cefbf70..ef146a2 100755
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -27,12 +27,16 @@
#define STARTREK_GRAPHICS_H
#include "startrek/bitmap.h"
-#include "startrek/startrek.h"
#include "startrek/font.h"
+#include "startrek/startrek.h"
+#include "startrek/sprite.h"
+#include "common/ptr.h"
#include "common/rect.h"
#include "common/stream.h"
+using Common::SharedPtr;
+
namespace StarTrek {
class Font;
@@ -44,24 +48,11 @@ const int SCREEN_HEIGHT = 200;
const int MAX_SPRITES = 32;
+const int TEXTBOX_WIDTH = 26;
-struct Sprite {
- uint16 x,y;
- uint16 drawPriority;
- uint16 field6;
- uint16 field8;
- Bitmap *bitmap;
- uint16 drawMode;
- uint16 textColor;
- uint16 bitmapChanged;
- uint16 redrawCondition2;
- uint16 redrawCondition3;
- uint16 field16;
- Common::Rect rectangle1;
- Common::Rect clickRectangle;
- Common::Rect rectangle2;
- uint16 drawX,drawY;
-};
+
+class Graphics;
+typedef Common::String (Graphics::*TextGetterFunc)(int, int, Common::String *);
class Graphics {
@@ -75,6 +66,8 @@ public:
void loadPalette(const Common::String &paletteFile);
void loadPri(const char *priFile);
+ SharedPtr<Bitmap> loadBitmap(Common::String basename);
+
void redrawScreen();
void drawSprite(const Sprite &sprite);
void drawSprite(const Sprite &sprite, const Common::Rect &rect);
@@ -102,6 +95,32 @@ private:
Sprite *_sprites[MAX_SPRITES];
int _numSprites;
+
+ Common::Point _mousePos;
+ Sprite _mouseSprite;
+
+
+ // text.cpp (TODO: separate class)
+public:
+ int showText(TextGetterFunc textGetter, int var, int xoffset, int yoffset, int textColor, int argC, int maxTextLines, int arg10);
+ Common::String tmpFunction(int choiceIndex, int var, Common::String *speakerTextOutput);
+ SharedPtr<TextBitmap> initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite);
+
+private:
+ Common::String skipOverAudioPrompt(const Common::String &str);
+ int getNumLines(const Common::String &str);
+ Common::String readLineFormattedText(TextGetterFunc textGetter, int var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numLines);
+ void loadTextButtons(Common::String mnuFilename, int xpos, int ypos);
+ void warpMousePosition(int x, int y);
+
+ uint16 _textboxVar1;
+ uint32 _textboxVar2;
+ uint32 _textboxVar3;
+ uint16 _textboxVar4;
+ uint16 _textboxVar5;
+ uint16 _textboxVar6;
+ uint16 _textboxVar7;
+ bool _textboxHasMultipleChoices;
};
}
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index c47c19a..e2670b4 100755
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -8,7 +8,9 @@ MODULE_OBJS = \
lzss.o \
graphics.o \
sound.o \
- startrek.o
+ sprite.o \
+ startrek.o \
+ text.o
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 114ec8a..5191fc4 100755
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -107,12 +107,11 @@ void Sound::playSMFSound(const char *baseSoundName) {
}
debug(0, "Playing sound \'%s\'\n", soundName.c_str());
- Common::SeekableReadStream *soundStream = _vm->openFile(soundName.c_str());
+ SharedPtr<Common::SeekableReadStream> soundStream = _vm->openFile(soundName.c_str());
byte *soundData = (byte *)malloc(soundStream->size());
soundStream->read(soundData, soundStream->size());
_midiParser->loadMusic(soundData, soundStream->size());
- delete soundStream;
_midiDriver->setTimerCallback(_midiParser, MidiParser::timerCallback);
}
@@ -135,12 +134,11 @@ void Sound::playXMIDISound(const char *baseSoundName) {
}
debug(0, "Playing sound \'%s\'\n", soundName.c_str());
- Common::SeekableReadStream *soundStream = _vm->openFile(soundName.c_str());
+ SharedPtr<Common::SeekableReadStream> soundStream = _vm->openFile(soundName.c_str());
byte *soundData = (byte *)malloc(soundStream->size());
soundStream->read(soundData, soundStream->size());
_midiParser->loadMusic(soundData, soundStream->size());
- delete soundStream;
_midiDriver->setTimerCallback(_midiParser, MidiParser::timerCallback);
}
@@ -165,7 +163,7 @@ void Sound::playAmigaSoundEffect(const char *baseSoundName) {
if (_vm->_mixer->isSoundHandleActive(*_soundHandle))
_vm->_mixer->stopHandle(*_soundHandle);
- Audio::AudioStream *audStream = (Audio::AudioStream *)Audio::makeRawStream(_vm->openFile(soundName.c_str()), 11025, 0);
+ Audio::AudioStream *audStream = (Audio::AudioStream *)Audio::makeRawStream(_vm->openFile(soundName.c_str()).get(), 11025, 0);
_vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, _soundHandle, audStream);
}
diff --git a/engines/startrek/sprite.cpp b/engines/startrek/sprite.cpp
new file mode 100644
index 0000000..d58cd30
--- /dev/null
+++ b/engines/startrek/sprite.cpp
@@ -0,0 +1,35 @@
+/* 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.
+ *
+ * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/graphics.h $
+ * $Id: graphics.h 2 2009-09-12 20:13:40Z clone2727 $
+ *
+ */
+
+#include "startrek/sprite.h"
+
+namespace StarTrek {
+
+void Sprite::setBitmap(SharedPtr<Bitmap> b) {
+ bitmap = b;
+ bitmapChanged = 1;
+}
+
+}
diff --git a/engines/startrek/sprite.h b/engines/startrek/sprite.h
new file mode 100644
index 0000000..280a0d2
--- /dev/null
+++ b/engines/startrek/sprite.h
@@ -0,0 +1,63 @@
+/* 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.
+ *
+ * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/graphics.h $
+ * $Id: graphics.h 2 2009-09-12 20:13:40Z clone2727 $
+ *
+ */
+
+#ifndef STARTREK_SPRITE_H
+#define STARTREK_SPRITE_H
+
+#include "startrek/bitmap.h"
+
+#include "common/ptr.h"
+#include "common/rect.h"
+#include "common/stream.h"
+
+using Common::SharedPtr;
+
+namespace StarTrek {
+
+
+struct Sprite {
+ Common::Point pos;
+ uint16 drawPriority;
+ uint16 field6;
+ uint16 field8;
+ SharedPtr<Bitmap> bitmap;
+ uint16 drawMode;
+ uint16 textColor;
+ uint16 bitmapChanged;
+ uint16 redrawCondition2;
+ uint16 redrawCondition3;
+ uint16 field16;
+ Common::Rect rectangle1;
+ Common::Rect clickRectangle;
+ Common::Rect rectangle2;
+ uint16 drawX,drawY;
+
+
+ void setBitmap(SharedPtr<Bitmap> b);
+};
+
+}
+
+#endif
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index ff3bf5e..10ec35f 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/startrek.cpp $
- * $Id: startrek.cpp 17 2010-12-16 02:29:35Z clone2727 $
- *
*/
#include "base/plugins.h"
@@ -110,7 +107,7 @@ Common::Error StarTrekEngine::run() {
// Draw mode 0
Sprite *spr = new Sprite;
_gfx->addSprite(spr);
- spr->bitmap = new Bitmap(openFile("MWALKE00.BMP"));
+ spr->bitmap = _gfx->loadBitmap("MWALKE00");
spr->drawPriority = 1;
spr->drawX = 150;
spr->drawY = 30;
@@ -119,7 +116,7 @@ Common::Error StarTrekEngine::run() {
// Draw mode 2 (translucent background)
spr = new Sprite;
_gfx->addSprite(spr);
- spr->bitmap = new Bitmap(openFile("KWALKS00.BMP"));
+ spr->bitmap = _gfx->loadBitmap("KWALKS00");
spr->drawPriority = 1;
spr->drawX = 200;
spr->drawY = 40;
@@ -128,7 +125,7 @@ Common::Error StarTrekEngine::run() {
// Draw mode 3 (text)
spr = new Sprite;
_gfx->addSprite(spr);
- spr->bitmap = new TextBitmap(8*8,8*8);
+ spr->bitmap = SharedPtr<Bitmap>(new TextBitmap(8*8,8*8));
for (int i=0;i<8*8;i++)
spr->bitmap->pixels[i] = 0x40+i;
spr->drawX = 8*10;
@@ -136,29 +133,41 @@ Common::Error StarTrekEngine::run() {
spr->textColor = 0xb3;
spr->drawMode = 3;
-
- Common::Event event;
+ // initTextSprite function
+ spr = new Sprite;
+ int x=0,y=0;
+ _gfx->initTextSprite(&x, &y, 0xb3, 3, false, spr);
+ spr->drawY = 150;
+
+
+ _gfx->showText(&Graphics::tmpFunction, 0, 0, 0, 0xb3, 0, 10, 0);
while (!shouldQuit()) {
- while (_eventMan->pollEvent(event)) {
- switch (event.type) {
- case Common::EVENT_QUIT:
- _system->quit();
- break;
- default:
- break;
- }
- }
- _gfx->redrawScreen();
-
- _system->delayMillis(1000/60);
+ pollEvents();
}
#endif
return Common::kNoError;
}
-Common::SeekableReadStreamEndian *StarTrekEngine::openFile(Common::String filename, int fileIndex) {
+void StarTrekEngine::pollEvents() {
+ Common::Event event;
+
+ while (_eventMan->pollEvent(event)) {
+ switch (event.type) {
+ case Common::EVENT_QUIT:
+ _system->quit();
+ break;
+ default:
+ break;
+ }
+ }
+ _gfx->redrawScreen();
+
+ _system->delayMillis(1000/60);
+}
+
+SharedPtr<FileStream> StarTrekEngine::openFile(Common::String filename, int fileIndex) {
filename.toUppercase();
Common::String basename, extension;
@@ -179,7 +188,7 @@ Common::SeekableReadStreamEndian *StarTrekEngine::openFile(Common::String filena
Common::File *file = new Common::File();
if (!file->open(filename.c_str()))
error ("Could not find file \'%s\'", filename.c_str());
- return new FileStream(file, bigEndian);
+ return SharedPtr<FileStream>(new FileStream(file, bigEndian));
}
Common::SeekableReadStream *indexFile = 0;
@@ -282,7 +291,7 @@ Common::SeekableReadStreamEndian *StarTrekEngine::openFile(Common::String filena
Common::SeekableReadStream *stream = dataFile->readStream(uncompressedSize);
delete dataFile;
delete dataRunFile;
- return new FileStream(stream, bigEndian);
+ return SharedPtr<FileStream>(new FileStream(stream, bigEndian));
} else {
if (fileCount != 1) {
dataRunFile->seek(indexOffset);
@@ -304,13 +313,13 @@ Common::SeekableReadStreamEndian *StarTrekEngine::openFile(Common::String filena
delete dataFile;
delete dataRunFile;
- return new FileStream(stream, bigEndian);
+ return SharedPtr<FileStream>(new FileStream(stream, bigEndian));
}
// We should not get to this point...
error("Could not find data for \'%s\'", filename.c_str());
- return NULL;
+ return SharedPtr<FileStream>();
}
void StarTrekEngine::playMovie(Common::String filename) {
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 22dec31..9bf1065 100755
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -26,18 +26,23 @@
#ifndef STARTREK_H
#define STARTREK_H
-#include "common/scummsys.h"
-#include "common/util.h"
-#include "common/system.h"
+#include "common/ptr.h"
#include "common/rect.h"
+#include "common/scummsys.h"
#include "common/str.h"
#include "common/stream.h"
+#include "common/system.h"
+#include "common/util.h"
#include "engines/engine.h"
+#include "startrek/filestream.h"
#include "startrek/graphics.h"
#include "startrek/sound.h"
+
+using Common::SharedPtr;
+
namespace Common {
class MacResManager;
}
@@ -65,6 +70,9 @@ public:
StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gamedesc);
virtual ~StarTrekEngine();
+ // Running the game
+ void pollEvents();
+
// Detection related functions
const StarTrekGameDescription *_gameDescription;
uint32 getFeatures() const;
@@ -74,7 +82,7 @@ public:
Common::Language getLanguage();
// Resource related functions
- Common::SeekableReadStreamEndian *openFile(Common::String filename, int fileIndex=0);
+ SharedPtr<FileStream> openFile(Common::String filename, int fileIndex=0);
// Movie related functions
void playMovie(Common::String filename);
@@ -84,8 +92,6 @@ private:
Graphics *_gfx;
Sound *_sound;
Common::MacResManager *_macResFork;
-
- byte getStartingIndex(Common::String filename);
};
} // End of namespace StarTrek
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
new file mode 100644
index 0000000..5af9bc0
--- /dev/null
+++ b/engines/startrek/text.cpp
@@ -0,0 +1,271 @@
+/* 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 "common/stream.h"
+
+#include "startrek/graphics.h"
+
+namespace StarTrek {
+
+int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoffset, int textColor, int argC, int maxTextLines, int arg10) {
+ uint16 tmpTextboxVar1 = _textboxVar1;
+
+ uint32 var7c = 8;
+ if (_textboxVar3 > _textboxVar2+1) {
+ var7c = 0x10;
+ }
+
+ int numChoicesWithNames = 0;
+ int numTextboxLines = 0;
+ int numChoices = 0;
+ Common::String speakerText;
+
+ while(true) {
+ Common::String choiceText = (this->*textGetter)(numChoices, var, &speakerText);
+ if (choiceText.empty())
+ break;
+
+ int lines = getNumLines(choiceText);
+ if (lines > numTextboxLines)
+ numTextboxLines = lines;
+
+ if (!speakerText.empty()) // Technically should check for nullptr
+ numChoicesWithNames++;
+
+ numChoices++;
+ }
+
+ if (maxTextLines == 0 || maxTextLines > 12)
+ maxTextLines = 12;
+ if (numTextboxLines > maxTextLines)
+ numTextboxLines = maxTextLines;
+
+ if (numChoicesWithNames != 0 && numChoices != numChoicesWithNames)
+ error("showText: Not all choices have titles.");
+
+ Sprite textboxSprite;
+ SharedPtr<TextBitmap> textBitmap = initTextSprite(&xoffset, &yoffset, textColor, numTextboxLines, numChoicesWithNames, &textboxSprite);
+
+ int choiceIndex = 0;
+ int var28 = 0;
+ if (tmpTextboxVar1 != 0 && tmpTextboxVar1 != 1 && numChoices == 1
+ && _textboxVar5 != 0 && _textboxVar4 == 0)
+ _textboxHasMultipleChoices = false;
+ else
+ _textboxHasMultipleChoices = true;
+
+ if (tmpTextboxVar1 >= 0 && tmpTextboxVar1 <= 2 && _textboxVar5 == 1 && _textboxVar4 == 0)
+ _textboxVar6 = true;
+ else
+ _textboxVar6 = false;
+
+ int numPrintedLines;
+ Common::String lineFormattedText = readLineFormattedText(textGetter, var, choiceIndex, textBitmap, numTextboxLines, &numPrintedLines);
+
+ if (lineFormattedText.empty()) { // Technically should check for nullptr
+ // TODO
+ }
+ else {
+ loadTextButtons("textbtns", xoffset+0x96, yoffset-0x11);
+
+ Common::Point oldMousePos = _mousePos;
+ SharedPtr<Bitmap> oldMouseBitmap = _mouseSprite.bitmap;
+
+ _mousePos.x = xoffset + 0xde;
+ _mousePos.y = yoffset - 0x08;
+ _mouseSprite.pos = _mousePos;
+ _mouseSprite.drawPriority = 15;
+
+ _mouseSprite.setBitmap(loadBitmap("pushbtn"));
+ warpMousePosition(_mousePos.x, _mousePos.y);
+
+ uint16 tmpTextboxVar7 = _textboxVar7;
+ _textboxVar7 = 0;
+
+ int var80 = (numChoices > 1 ? 0x18 : 0);
+
+ // TODO: sub_288FB function call
+ // TODO: sub_28ACA(0x0002);
+
+ if (var7c == 0) {
+ // sub_28ACA(0x0001);
+ }
+ if (argC == 0) {
+ // sub_28ACA(0x0008);
+ }
+
+ bool doneShowingText = false;
+
+ while (!doneShowingText) {
+ // TODO
+ _vm->pollEvents();
+ }
+
+ _mousePos = oldMousePos;
+ _mouseSprite.pos = _mousePos;
+ _mouseSprite.drawPriority = 15;
+ _mouseSprite.setBitmap(oldMouseBitmap);
+ warpMousePosition(_mousePos.x, _mousePos.y);
+
+ _textboxVar7 = tmpTextboxVar7;
+ // sub_29326();
+ textboxSprite.field16 = 1;
+ textboxSprite.bitmapChanged = 1;
+
+ drawAllSprites();
+ delSprite(&textboxSprite);
+ // sub_272B4
+ }
+
+ _textboxVar2 = _textboxVar3;
+ // sub_29EE3();
+ return choiceIndex;
+}
+
+const char* text = "Text test";
+
+Common::String Graphics::tmpFunction(int choiceIndex, int var, Common::String *speakerTextOutput) {
+ if (speakerTextOutput != nullptr)
+ *speakerTextOutput = "Speaker";
+
+ if (choiceIndex >= 1)
+ return NULL;
+ return text;
+}
+
+/**
+ * Creates a blank textbox in a TextBitmap, and initializes a sprite to use it.
+ */
+SharedPtr<TextBitmap> Graphics::initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite) {
+ int linesBeforeTextStart = 2;
+ if (withHeader != 0)
+ linesBeforeTextStart = 4;
+
+ int xoffset = *xoffsetPtr;
+ int yoffset = *yoffsetPtr;
+
+ int textHeight = numTextLines + linesBeforeTextStart;
+
+ SharedPtr<TextBitmap> bitmap(new TextBitmap(TEXTBOX_WIDTH*8, textHeight*8));
+
+ memset(sprite, 0, sizeof(Sprite));
+ sprite->drawPriority = 15;
+ sprite->field6 = 8;
+ sprite->bitmap = bitmap;
+ sprite->textColor = textColor;
+
+ memset(bitmap->pixels, ' ', textHeight*TEXTBOX_WIDTH);
+
+ int varC = SCREEN_WIDTH-1 - xoffset - (bitmap->width+0x1d)/2;
+ if (varC < 0)
+ xoffset += varC;
+
+ varC = xoffset - (bitmap->width+0x1d)/2;
+ if (varC < 1)
+ xoffset += varC-1;
+
+ varC = yoffset - (bitmap->height+0x11) - 20;
+ if (varC < 0)
+ yoffset -= varC;
+
+ xoffset -= (bitmap->width+0x1d)/2;
+ yoffset -= bitmap->height;
+
+ bitmap->pixels[0] = 0x10;
+ memset(&bitmap->pixels[1], 0x11, TEXTBOX_WIDTH-2);
+ bitmap->pixels[TEXTBOX_WIDTH-1] = 0x12;
+
+ byte *textAddr = bitmap->pixels+TEXTBOX_WIDTH;
+
+ if (withHeader) {
+ textAddr[0] = 0x13;
+ textAddr[TEXTBOX_WIDTH-1] = 0x14;
+ textAddr += TEXTBOX_WIDTH;
+
+ textAddr[0] = 0x13;
+ memset(&textAddr[1], 0x19, TEXTBOX_WIDTH-2);
+ textAddr[TEXTBOX_WIDTH-1] = 0x14;
+ textAddr += TEXTBOX_WIDTH;
+ }
+
+ for (int line=0; line<numTextLines; line++) {
+ textAddr[0] = 0x13;
+ textAddr[TEXTBOX_WIDTH-1] = 0x14;
+ textAddr += TEXTBOX_WIDTH;
+ }
+
+ textAddr[0] = 0x15;
+ memset(&textAddr[1], 0x16, TEXTBOX_WIDTH-2);
+ textAddr[TEXTBOX_WIDTH-1] = 0x17;
+
+ addSprite(sprite);
+ sprite->drawMode = 3;
+ sprite->pos.x = xoffset;
+ sprite->pos.y = yoffset;
+ sprite->drawPriority = 15;
+
+ *xoffsetPtr = xoffset;
+ *yoffsetPtr = yoffset;
+
+ return bitmap;
+}
+
+Common::String Graphics::skipOverAudioPrompt(const Common::String &str) {
+ // TODO
+ return str;
+}
+
+int Graphics::getNumLines(const Common::String &str) {
+ // TODO
+ return 1;
+}
+
+Common::String Graphics::readLineFormattedText(TextGetterFunc textGetter, int var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numPrintedLines) {
+ // TODO
+ *numPrintedLines = 1;
+
+ int numChars = textBitmap->width*textBitmap->height;
+
+ Common::String text = (this->*textGetter)(choiceIndex, var, nullptr);
+ while (text.size() < numChars) text += ' ';
+
+ byte *dest = textBitmap->pixels + TEXTBOX_WIDTH + 1;
+
+ for (int y=0; y<*numPrintedLines; y++) {
+ memcpy(dest, text.c_str(), TEXTBOX_WIDTH-2);
+ dest += TEXTBOX_WIDTH;
+ }
+
+ return text;
+}
+
+void Graphics::loadTextButtons(Common::String mnuFilename, int xpos, int ypos) {
+ // TODO: start of function
+
+ SharedPtr<Common::SeekableReadStream> mnuFile = _vm->openFile(mnuFilename + ".MNU");
+ int numEntries = mnuFile->size()/16;
+}
+
+void Graphics::warpMousePosition(int x, int y) {
+ // TODO
+}
+
+}
Commit: 7c62092367d00418d930411ff4a080f6ad2d0417
https://github.com/scummvm/scummvm/commit/7c62092367d00418d930411ff4a080f6ad2d0417
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Begin implementing menus
Changed paths:
engines/startrek/filestream.h
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/sprite.h
engines/startrek/startrek.cpp
engines/startrek/text.cpp
diff --git a/engines/startrek/filestream.h b/engines/startrek/filestream.h
index 899f639..475bbcf 100644
--- a/engines/startrek/filestream.h
+++ b/engines/startrek/filestream.h
@@ -36,6 +36,7 @@ private:
Common::SeekableReadStream *_stream;
bool _bigEndian;
+public:
// ReadStream functions
virtual bool eos() const;
virtual uint32 read(void* dataPtr, uint32 dataSize);
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 307efcb..cf63faa 100755
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -289,6 +289,8 @@ void Graphics::drawAllSprites() {
// TODO: implement properly
for (int i=0; i<_numSprites; i++) {
Sprite *spr = _sprites[i];
+ spr->drawX = spr->pos.x;
+ spr->drawY = spr->pos.y;
drawSprite(*spr);
}
}
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index ef146a2..88e68cb 100755
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -47,10 +47,24 @@ const int SCREEN_WIDTH = 320;
const int SCREEN_HEIGHT = 200;
const int MAX_SPRITES = 32;
+const int MAX_MENUBUTTONS = 16; // This is arbitrary, the original game has no such limit
const int TEXTBOX_WIDTH = 26;
+// Keeps track of data for a list of buttons making up a menu
+struct Menu {
+ Sprite sprites[MAX_MENUBUTTONS];
+ uint16 retvals[MAX_MENUBUTTONS];
+ uint16 buttonVar2;
+ SharedPtr<FileStream> menuFile;
+ uint16 numButtons;
+ uint16 buttonVar1;
+ SharedPtr<Menu> nextMenu;
+
+ Menu() : nextMenu(SharedPtr<Menu>()) {}
+};
+
class Graphics;
typedef Common::String (Graphics::*TextGetterFunc)(int, int, Common::String *);
@@ -110,7 +124,7 @@ private:
Common::String skipOverAudioPrompt(const Common::String &str);
int getNumLines(const Common::String &str);
Common::String readLineFormattedText(TextGetterFunc textGetter, int var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numLines);
- void loadTextButtons(Common::String mnuFilename, int xpos, int ypos);
+ void loadMenuButtons(Common::String mnuFilename, int xpos, int ypos);
void warpMousePosition(int x, int y);
uint16 _textboxVar1;
@@ -121,6 +135,8 @@ private:
uint16 _textboxVar6;
uint16 _textboxVar7;
bool _textboxHasMultipleChoices;
+
+ SharedPtr<Menu> _activeMenu;
};
}
diff --git a/engines/startrek/sprite.h b/engines/startrek/sprite.h
index 280a0d2..93fd2dc 100644
--- a/engines/startrek/sprite.h
+++ b/engines/startrek/sprite.h
@@ -58,6 +58,18 @@ struct Sprite {
void setBitmap(SharedPtr<Bitmap> b);
};
+
+class SpriteList {
+public:
+ SpriteList(int n) { sprites = new Sprite[n]; }
+ ~SpriteList() { delete[] sprites; }
+
+ Sprite &operator[](int i) const { return sprites[i]; }
+
+private:
+ Sprite *sprites;
+};
+
}
#endif
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 10ec35f..8dd4f90 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -109,8 +109,8 @@ Common::Error StarTrekEngine::run() {
_gfx->addSprite(spr);
spr->bitmap = _gfx->loadBitmap("MWALKE00");
spr->drawPriority = 1;
- spr->drawX = 150;
- spr->drawY = 30;
+ spr->pos.x = 150;
+ spr->pos.y = 30;
spr->drawMode = 0;
// Draw mode 2 (translucent background)
@@ -118,8 +118,8 @@ Common::Error StarTrekEngine::run() {
_gfx->addSprite(spr);
spr->bitmap = _gfx->loadBitmap("KWALKS00");
spr->drawPriority = 1;
- spr->drawX = 200;
- spr->drawY = 40;
+ spr->pos.x = 200;
+ spr->pos.y = 40;
spr->drawMode = 2;
// Draw mode 3 (text)
@@ -128,19 +128,21 @@ Common::Error StarTrekEngine::run() {
spr->bitmap = SharedPtr<Bitmap>(new TextBitmap(8*8,8*8));
for (int i=0;i<8*8;i++)
spr->bitmap->pixels[i] = 0x40+i;
- spr->drawX = 8*10;
- spr->drawY = 50;
+ spr->pos.x = 8*10;
+ spr->pos.y = 50;
spr->textColor = 0xb3;
spr->drawMode = 3;
// initTextSprite function
+ /*
spr = new Sprite;
int x=0,y=0;
_gfx->initTextSprite(&x, &y, 0xb3, 3, false, spr);
- spr->drawY = 150;
+ spr->pos.y = 150;
- _gfx->showText(&Graphics::tmpFunction, 0, 0, 0, 0xb3, 0, 10, 0);
+ _gfx->showText(&Graphics::tmpFunction, 0, 50, 50, 0xb3, 0, 10, 0);
+ */
while (!shouldQuit()) {
pollEvents();
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 5af9bc0..dcc4b88 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -64,6 +64,8 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
Sprite textboxSprite;
SharedPtr<TextBitmap> textBitmap = initTextSprite(&xoffset, &yoffset, textColor, numTextboxLines, numChoicesWithNames, &textboxSprite);
+ debug("X: %d, Y: %d\n", xoffset, yoffset);
+
int choiceIndex = 0;
int var28 = 0;
if (tmpTextboxVar1 != 0 && tmpTextboxVar1 != 1 && numChoices == 1
@@ -84,7 +86,7 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
// TODO
}
else {
- loadTextButtons("textbtns", xoffset+0x96, yoffset-0x11);
+ loadMenuButtons("textbtns", xoffset+0x96, yoffset-0x11);
Common::Point oldMousePos = _mousePos;
SharedPtr<Bitmap> oldMouseBitmap = _mouseSprite.bitmap;
@@ -140,15 +142,13 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
return choiceIndex;
}
-const char* text = "Text test";
-
Common::String Graphics::tmpFunction(int choiceIndex, int var, Common::String *speakerTextOutput) {
if (speakerTextOutput != nullptr)
*speakerTextOutput = "Speaker";
if (choiceIndex >= 1)
return NULL;
- return text;
+ return "Text test";
}
/**
@@ -178,17 +178,25 @@ SharedPtr<TextBitmap> Graphics::initTextSprite(int *xoffsetPtr, int *yoffsetPtr,
if (varC < 0)
xoffset += varC;
+ debug("xoffset A: %d", xoffset);
+
varC = xoffset - (bitmap->width+0x1d)/2;
if (varC < 1)
xoffset += varC-1;
+ debug("xoffset B: %d", xoffset);
+
varC = yoffset - (bitmap->height+0x11) - 20;
if (varC < 0)
yoffset -= varC;
+ debug("Mid xoffset: %d", xoffset);
+
xoffset -= (bitmap->width+0x1d)/2;
yoffset -= bitmap->height;
+ debug("Final xoffset: %d", xoffset);
+
bitmap->pixels[0] = 0x10;
memset(&bitmap->pixels[1], 0x11, TEXTBOX_WIDTH-2);
bitmap->pixels[TEXTBOX_WIDTH-1] = 0x12;
@@ -242,7 +250,7 @@ Common::String Graphics::readLineFormattedText(TextGetterFunc textGetter, int va
// TODO
*numPrintedLines = 1;
- int numChars = textBitmap->width*textBitmap->height;
+ uint numChars = textBitmap->width*textBitmap->height;
Common::String text = (this->*textGetter)(choiceIndex, var, nullptr);
while (text.size() < numChars) text += ' ';
@@ -257,11 +265,37 @@ Common::String Graphics::readLineFormattedText(TextGetterFunc textGetter, int va
return text;
}
-void Graphics::loadTextButtons(Common::String mnuFilename, int xpos, int ypos) {
- // TODO: start of function
+void Graphics::loadMenuButtons(Common::String mnuFilename, int xpos, int ypos) {
+ SharedPtr<Menu> oldMenu = _activeMenu;
+ _activeMenu = SharedPtr<Menu>(new Menu());
+ _activeMenu->nextMenu = oldMenu;
- SharedPtr<Common::SeekableReadStream> mnuFile = _vm->openFile(mnuFilename + ".MNU");
- int numEntries = mnuFile->size()/16;
+ SharedPtr<FileStream> stream = _vm->openFile(mnuFilename + ".MNU");
+
+ _activeMenu->menuFile = stream;
+ _activeMenu->numButtons = _activeMenu->menuFile->size()/16;
+
+ for (int i=0; i<_activeMenu->numButtons; i++) {
+ memset(&_activeMenu->sprites[i], 0, sizeof(Sprite));
+ addSprite(&_activeMenu->sprites[i]);
+ _activeMenu->sprites[i].drawMode = 2;
+
+ char bitmapBasename[11];
+ stream->seek(i*16, SEEK_SET);
+ stream->read(bitmapBasename, 10);
+ for (int j=0; j<10; j++) {
+ if (bitmapBasename[j] == ' ')
+ bitmapBasename[j] = '\0';
+ }
+ bitmapBasename[10] = '\0';
+
+ _activeMenu->sprites[i].bitmap = loadBitmap(bitmapBasename);
+ _activeMenu->sprites[i].pos.x = stream->readUint16() + xpos;
+ _activeMenu->sprites[i].pos.y = stream->readUint16() + ypos;
+ _activeMenu->retvals[i] = stream->readUint16();
+
+ _activeMenu->sprites[i].field6 = 8;
+ }
}
void Graphics::warpMousePosition(int x, int y) {
Commit: a69f025818224c9bfeb52be11f31a2b6387bb76f
https://github.com/scummvm/scummvm/commit/a69f025818224c9bfeb52be11f31a2b6387bb76f
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement drawAllSprites properly.
Still need to do the part which calculates sprite priorities.
Changed paths:
A engines/startrek/common.cpp
A engines/startrek/common.h
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/module.mk
engines/startrek/sprite.h
engines/startrek/startrek.cpp
engines/startrek/text.cpp
diff --git a/engines/startrek/common.cpp b/engines/startrek/common.cpp
new file mode 100644
index 0000000..cef01c5
--- /dev/null
+++ b/engines/startrek/common.cpp
@@ -0,0 +1,35 @@
+/* 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 "startrek/common.h"
+
+namespace StarTrek {
+
+Common::Rect getRectEncompassing(Common::Rect r1, Common::Rect r2) {
+ uint16 l = min(r1.left, r2.left);
+ uint16 t = min(r1.top, r2.top);
+ uint16 r = max(r1.right, r2.right);
+ uint16 b = max(r1.bottom, r2.bottom);
+
+ return Common::Rect(l,t,r,b);
+}
+
+}
diff --git a/engines/startrek/common.h b/engines/startrek/common.h
new file mode 100644
index 0000000..4598085
--- /dev/null
+++ b/engines/startrek/common.h
@@ -0,0 +1,39 @@
+/* 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.
+ */
+
+#ifndef STARTREK_COMMON_H
+#define STARTREK_COMMON_H
+
+#include "common/rect.h"
+
+namespace StarTrek {
+
+template<class T>
+T min(T a, T b) { return a < b ? a : b; }
+
+template<class T>
+T max(T a, T b) { return a > b ? a : b; }
+
+Common::Rect getRectEncompassing(Common::Rect r1, Common::Rect r2);
+
+}
+
+#endif
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index cf63faa..467d1f5 100755
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -19,11 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include "startrek/common.h"
#include "startrek/graphics.h"
#include "common/config-manager.h"
#include "common/rendermode.h"
#include "graphics/palette.h"
+#include "graphics/surface.h"
namespace StarTrek {
@@ -34,7 +36,7 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_priData = nullptr;
_lutData = nullptr;
- _screenRect = Common::Rect(SCREEN_WIDTH, SCREEN_HEIGHT);
+ _screenRect = Common::Rect(SCREEN_WIDTH-1, SCREEN_HEIGHT-1);
if (ConfMan.hasKey("render_mode"))
_egaMode = (Common::parseRenderMode(ConfMan.get("render_mode").c_str()) == Common::kRenderEGA) && (_vm->getGameType() != GType_STJR) && !(_vm->getFeatures() & GF_DEMO);
@@ -43,7 +45,6 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_font = new Font(_vm);
_backgroundImage = new Bitmap(_vm->openFile("DEMON0.BMP").get());
- _canvas = new Bitmap(SCREEN_WIDTH, SCREEN_HEIGHT);
_numSprites = 0;
}
@@ -55,7 +56,6 @@ Graphics::~Graphics() {
delete _font;
delete _backgroundImage;
- delete _canvas;
}
@@ -137,12 +137,8 @@ SharedPtr<Bitmap> Graphics::loadBitmap(Common::String basename) {
}
void Graphics::redrawScreen() {
- // TODO: get rid of _canvas for efficiency
- memcpy(_canvas->pixels, _backgroundImage->pixels, SCREEN_WIDTH*SCREEN_HEIGHT);
-
+ _vm->_system->copyRectToScreen(_backgroundImage->pixels, SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
drawAllSprites();
-
- drawBitmapToScreen(_canvas);
}
void Graphics::drawSprite(const Sprite &sprite) {
@@ -158,7 +154,9 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
assert(_screenRect.contains(rect));
assert(spriteRect.contains(rect));
- byte *dest = _canvas->pixels + rect.top*SCREEN_WIDTH + rect.left;
+ ::Graphics::Surface *surface = _vm->_system->lockScreen();
+
+ byte *dest = (byte*)surface->getPixels() + rect.top*SCREEN_WIDTH + rect.left;
switch(sprite.drawMode) {
case 0: { // Normal sprite
@@ -233,7 +231,7 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
int drawWidth = rectangle1.width() + 1;
int drawHeight = rectangle1.height() + 1;
- dest =_canvas->pixels + sprite.drawY*SCREEN_WIDTH + sprite.drawX
+ dest = (byte*)surface->getPixels() + sprite.drawY*SCREEN_WIDTH + sprite.drawX
+ rectangle1.top*8*SCREEN_WIDTH + rectangle1.left*8;
byte *src = sprite.bitmap->pixels + rectangle1.top*sprite.bitmap->width/8 + rectangle1.left;
@@ -283,16 +281,120 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
error("drawSprite: draw mode %d invalid", sprite.drawMode);
break;
}
+
+ _vm->_system->unlockScreen();
}
void Graphics::drawAllSprites() {
- // TODO: implement properly
+ if (_numSprites == 0)
+ return;
+
+ // TODO: calculateSpriteDrawPriority()
+
+ // Update sprite rectangles
for (int i=0; i<_numSprites; i++) {
Sprite *spr = _sprites[i];
- spr->drawX = spr->pos.x;
- spr->drawY = spr->pos.y;
- drawSprite(*spr);
+ spr->bitmapChanged = true; // FIXME (delete this later)
+ Common::Rect rect;
+
+ rect.left = spr->pos.x - spr->bitmap->xoffset;
+ rect.top = spr->pos.y - spr->bitmap->yoffset;
+ rect.right = rect.left + spr->bitmap->width - 1;
+ rect.bottom = rect.top + spr->bitmap->height - 1;
+
+ spr->drawX = rect.left;
+ spr->drawY = rect.top;
+
+ spr->drawRect = rect.findIntersectingRect(_screenRect);
+
+ if (!spr->drawRect.isEmpty()) { // At least partly on-screen
+ if (spr->lastDrawRect.left <= spr->lastDrawRect.right) {
+ // If the sprite's position is close to where it was last time it was
+ // drawn, combine the two rectangles and redraw that whole section.
+ // Otherwise, redraw the old position and current position separately.
+ rect = spr->drawRect.findIntersectingRect(spr->lastDrawRect);
+
+ if (rect.isEmpty())
+ spr->rect2Valid = 0;
+ else {
+ spr->rectangle2 = getRectEncompassing(spr->drawRect, spr->lastDrawRect);
+ spr->rect2Valid = 1;
+ }
+ }
+ else {
+ spr->rectangle2 = spr->drawRect;
+ spr->rect2Valid = 1;
+ }
+
+ spr->isOnScreen = 1;
+ }
+ else { // Off-screen
+ spr->rect2Valid = 0;
+ spr->isOnScreen = 0;
+ }
}
+
+ // Determine what portions of the screen need to be updated
+ Common::Rect dirtyRects[MAX_SPRITES*2];
+ int numDirtyRects = 0;
+
+ for (int i=0; i<_numSprites; i++) {
+ Sprite *spr = _sprites[i];
+
+ if (spr->bitmapChanged) {
+ if (spr->isOnScreen) {
+ if (spr->rect2Valid) {
+ dirtyRects[numDirtyRects++] = spr->rectangle2;
+ }
+ else {
+ dirtyRects[numDirtyRects++] = spr->drawRect;
+ dirtyRects[numDirtyRects++] = spr->lastDrawRect;
+ }
+ }
+ else {
+ dirtyRects[numDirtyRects++] = spr->lastDrawRect;
+ }
+ }
+ }
+
+ // Redraw the background on every dirty rectangle
+ for (int i=0; i<numDirtyRects; i++) {
+ Common::Rect &r = dirtyRects[i];
+
+ int offset = r.top*SCREEN_WIDTH + r.left;
+ _vm->_system->copyRectToScreen(_backgroundImage->pixels+offset, SCREEN_WIDTH, r.left, r.top, r.width(), r.height());
+ }
+
+ // For each sprite, merge the rectangles that overlap with it and redraw the sprite.
+ for (int i=0; i<_numSprites; i++) {
+ Sprite *spr = _sprites[i];
+
+ if (spr->field16 == 0 && spr->isOnScreen) {
+ bool mustRedrawSprite = false;
+ Common::Rect rect2;
+
+ for (int j=0; j<numDirtyRects; j++) {
+ Common::Rect rect1 = spr->drawRect.findIntersectingRect(dirtyRects[j]);
+
+ if (!rect1.isEmpty()) {
+ if (mustRedrawSprite)
+ rect2 = getRectEncompassing(rect1, rect2);
+ else
+ rect2 = rect1;
+ mustRedrawSprite = true;
+ }
+ }
+
+ if (mustRedrawSprite)
+ drawSprite(*spr, rect2);
+ }
+
+ spr->field16 = 0;
+ spr->bitmapChanged = 0;
+ spr->lastDrawRect = spr->drawRect;
+ }
+
+ _vm->_system->updateScreen();
}
void Graphics::addSprite(Sprite *sprite) {
@@ -304,10 +406,10 @@ void Graphics::addSprite(Sprite *sprite) {
sprite->field8 = 0;
sprite->field16 = 0;
- sprite->rectangle1.top = -1;
- sprite->rectangle1.left = -1;
- sprite->rectangle1.bottom = -2;
- sprite->rectangle1.right = -2;
+ sprite->lastDrawRect.top = -1;
+ sprite->lastDrawRect.left = -1;
+ sprite->lastDrawRect.bottom = -2;
+ sprite->lastDrawRect.right = -2;
_sprites[_numSprites++] = sprite;
}
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 88e68cb..fa9f90b 100755
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -105,7 +105,6 @@ private:
Common::Rect _screenRect;
Bitmap *_backgroundImage;
- Bitmap *_canvas;
Sprite *_sprites[MAX_SPRITES];
int _numSprites;
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index e2670b4..23af200 100755
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -2,6 +2,7 @@ MODULE := engines/startrek
MODULE_OBJS = \
bitmap.o \
+ common.o \
detection.o \
filestream.o \
font.o \
diff --git a/engines/startrek/sprite.h b/engines/startrek/sprite.h
index 93fd2dc..5fdc0f5 100644
--- a/engines/startrek/sprite.h
+++ b/engines/startrek/sprite.h
@@ -37,6 +37,12 @@ using Common::SharedPtr;
namespace StarTrek {
+// Note: Rects in Star Trek are probably considered to have their bottom-right pixel
+// contained in the rectangle, but ScummVM is the opposite... (Trek might be inconsistent)
+// Be careful when using some of Rect's functions, including:
+// * The width/height constructor
+// * width/height methods
+// * "contains" method for points (it should work for other rects)
struct Sprite {
Common::Point pos;
uint16 drawPriority;
@@ -45,16 +51,16 @@ struct Sprite {
SharedPtr<Bitmap> bitmap;
uint16 drawMode;
uint16 textColor;
- uint16 bitmapChanged;
- uint16 redrawCondition2;
- uint16 redrawCondition3;
- uint16 field16;
- Common::Rect rectangle1;
- Common::Rect clickRectangle;
+ bool bitmapChanged;
+ bool rect2Valid;
+ bool isOnScreen;
+ uint16 field16; // When set, sprite isn't drawn next refresh? (Gets reset to 0 after)
+ Common::Rect lastDrawRect; // Rect encompassing the sprite last time it was drawn
+ Common::Rect drawRect; // Rect encompassing the sprite currently
Common::Rect rectangle2;
- uint16 drawX,drawY;
-
+ int16 drawX,drawY;
+ Sprite() { memset(this, 0, sizeof(Sprite)); }
void setBitmap(SharedPtr<Bitmap> b);
};
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 8dd4f90..726fc3f 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -101,7 +101,6 @@ Common::Error StarTrekEngine::run() {
_gfx->drawBackgroundImage("BRIDGE.BGD");
}
-
// Sprite tests
// Draw mode 0
@@ -110,7 +109,7 @@ Common::Error StarTrekEngine::run() {
spr->bitmap = _gfx->loadBitmap("MWALKE00");
spr->drawPriority = 1;
spr->pos.x = 150;
- spr->pos.y = 30;
+ spr->pos.y = 100;
spr->drawMode = 0;
// Draw mode 2 (translucent background)
@@ -119,9 +118,10 @@ Common::Error StarTrekEngine::run() {
spr->bitmap = _gfx->loadBitmap("KWALKS00");
spr->drawPriority = 1;
spr->pos.x = 200;
- spr->pos.y = 40;
+ spr->pos.y = 140;
spr->drawMode = 2;
+ /*
// Draw mode 3 (text)
spr = new Sprite;
_gfx->addSprite(spr);
@@ -134,15 +134,14 @@ Common::Error StarTrekEngine::run() {
spr->drawMode = 3;
// initTextSprite function
- /*
spr = new Sprite;
int x=0,y=0;
_gfx->initTextSprite(&x, &y, 0xb3, 3, false, spr);
spr->pos.y = 150;
+ */
- _gfx->showText(&Graphics::tmpFunction, 0, 50, 50, 0xb3, 0, 10, 0);
- */
+ _gfx->showText(&Graphics::tmpFunction, 0, 150, 50, 0xb3, 0, 10, 0);
while (!shouldQuit()) {
pollEvents();
@@ -164,7 +163,7 @@ void StarTrekEngine::pollEvents() {
break;
}
}
- _gfx->redrawScreen();
+ _gfx->drawAllSprites();
_system->delayMillis(1000/60);
}
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index dcc4b88..18a283b 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -64,8 +64,6 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
Sprite textboxSprite;
SharedPtr<TextBitmap> textBitmap = initTextSprite(&xoffset, &yoffset, textColor, numTextboxLines, numChoicesWithNames, &textboxSprite);
- debug("X: %d, Y: %d\n", xoffset, yoffset);
-
int choiceIndex = 0;
int var28 = 0;
if (tmpTextboxVar1 != 0 && tmpTextboxVar1 != 1 && numChoices == 1
@@ -178,25 +176,17 @@ SharedPtr<TextBitmap> Graphics::initTextSprite(int *xoffsetPtr, int *yoffsetPtr,
if (varC < 0)
xoffset += varC;
- debug("xoffset A: %d", xoffset);
-
varC = xoffset - (bitmap->width+0x1d)/2;
if (varC < 1)
xoffset += varC-1;
- debug("xoffset B: %d", xoffset);
-
varC = yoffset - (bitmap->height+0x11) - 20;
if (varC < 0)
yoffset -= varC;
- debug("Mid xoffset: %d", xoffset);
-
xoffset -= (bitmap->width+0x1d)/2;
yoffset -= bitmap->height;
- debug("Final xoffset: %d", xoffset);
-
bitmap->pixels[0] = 0x10;
memset(&bitmap->pixels[1], 0x11, TEXTBOX_WIDTH-2);
bitmap->pixels[TEXTBOX_WIDTH-1] = 0x12;
Commit: 060d10c463f10077d733a41ad0a827b678e8b15d
https://github.com/scummvm/scummvm/commit/060d10c463f10077d733a41ad0a827b678e8b15d
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fix off-by-1 bug in drawSprite
Changed paths:
engines/startrek/graphics.cpp
engines/startrek/startrek.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 467d1f5..a717ec7 100755
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -165,8 +165,8 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
int priOffset = rect.top*SCREEN_WIDTH + rect.left;
- for (int y=rect.top; y<rect.bottom; y++) {
- for (int x=rect.left; x<rect.right; x++) {
+ for (int y=rect.top; y<=rect.bottom; y++) {
+ for (int x=rect.left; x<=rect.right; x++) {
byte priByte = _priData[priOffset/2];
byte bgPriority;
if ((priOffset%2) == 1)
@@ -183,9 +183,9 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
*dest++ = b;
}
- src += sprite.bitmap->width - rect.width();
- dest += SCREEN_WIDTH - rect.width();
- priOffset += SCREEN_WIDTH - rect.width();
+ src += sprite.bitmap->width - rect.width() - 1;
+ dest += SCREEN_WIDTH - rect.width() - 1;
+ priOffset += SCREEN_WIDTH - rect.width() - 1;
}
break;
}
@@ -197,8 +197,8 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
byte *src = sprite.bitmap->pixels + (rect.left - sprite.drawX)
+ (rect.top - sprite.drawY) * sprite.bitmap->width;
- for (int y=rect.top; y<rect.bottom; y++) {
- for (int x=rect.left; x<rect.right; x++) {
+ for (int y=rect.top; y<=rect.bottom; y++) {
+ for (int x=rect.left; x<=rect.right; x++) {
byte b = *src;
if (b == 0) // Transparent (darken the pixel)
@@ -210,8 +210,8 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
dest++;
}
- src += sprite.bitmap->width - rect.width();
- dest += SCREEN_WIDTH - rect.width();
+ src += sprite.bitmap->width - rect.width() - 1;
+ dest += SCREEN_WIDTH - rect.width() - 1;
}
break;
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 726fc3f..b798111 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -117,8 +117,8 @@ Common::Error StarTrekEngine::run() {
_gfx->addSprite(spr);
spr->bitmap = _gfx->loadBitmap("KWALKS00");
spr->drawPriority = 1;
- spr->pos.x = 200;
- spr->pos.y = 140;
+ spr->pos.x = 230;
+ spr->pos.y = 100;
spr->drawMode = 2;
/*
@@ -141,7 +141,7 @@ Common::Error StarTrekEngine::run() {
*/
- _gfx->showText(&Graphics::tmpFunction, 0, 150, 50, 0xb3, 0, 10, 0);
+ _gfx->showText(&Graphics::tmpFunction, 0, 150, 180, 0xb3, 0, 10, 0);
while (!shouldQuit()) {
pollEvents();
Commit: e4c5a34568e38a15dbcd75fcc00f3c34adf4bfaf
https://github.com/scummvm/scummvm/commit/e4c5a34568e38a15dbcd75fcc00f3c34adf4bfaf
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Add mouse cursor
Changed paths:
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/text.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index a717ec7..029928d 100755
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -23,7 +23,9 @@
#include "startrek/graphics.h"
#include "common/config-manager.h"
+#include "common/events.h"
#include "common/rendermode.h"
+#include "graphics/cursorman.h"
#include "graphics/palette.h"
#include "graphics/surface.h"
@@ -47,6 +49,8 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_backgroundImage = new Bitmap(_vm->openFile("DEMON0.BMP").get());
_numSprites = 0;
+
+ CursorMan.showMouse(true);
}
Graphics::~Graphics() {
@@ -136,6 +140,15 @@ SharedPtr<Bitmap> Graphics::loadBitmap(Common::String basename) {
return SharedPtr<Bitmap>(new Bitmap(_vm->openFile(basename+".BMP").get()));
}
+Common::Point Graphics::getMousePos() {
+ return _vm->_system->getEventManager()->getMousePos();
+}
+
+void Graphics::setMouseCursor(SharedPtr<Bitmap> bitmap) {
+ _mouseBitmap = bitmap;
+ _vm->_system->setMouseCursor(bitmap->pixels, bitmap->width, bitmap->height, bitmap->xoffset, bitmap->yoffset, 0);
+}
+
void Graphics::redrawScreen() {
_vm->_system->copyRectToScreen(_backgroundImage->pixels, SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
drawAllSprites();
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index fa9f90b..714d287 100755
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -82,6 +82,9 @@ public:
SharedPtr<Bitmap> loadBitmap(Common::String basename);
+ Common::Point getMousePos();
+ void setMouseCursor(SharedPtr<Bitmap> bitmap);
+
void redrawScreen();
void drawSprite(const Sprite &sprite);
void drawSprite(const Sprite &sprite, const Common::Rect &rect);
@@ -109,8 +112,7 @@ private:
Sprite *_sprites[MAX_SPRITES];
int _numSprites;
- Common::Point _mousePos;
- Sprite _mouseSprite;
+ SharedPtr<Bitmap> _mouseBitmap;
// text.cpp (TODO: separate class)
@@ -124,7 +126,6 @@ private:
int getNumLines(const Common::String &str);
Common::String readLineFormattedText(TextGetterFunc textGetter, int var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numLines);
void loadMenuButtons(Common::String mnuFilename, int xpos, int ypos);
- void warpMousePosition(int x, int y);
uint16 _textboxVar1;
uint32 _textboxVar2;
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 18a283b..08400dc 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -20,6 +20,7 @@
*/
#include "common/stream.h"
+#include "graphics/cursorman.h"
#include "startrek/graphics.h"
@@ -86,16 +87,11 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
else {
loadMenuButtons("textbtns", xoffset+0x96, yoffset-0x11);
- Common::Point oldMousePos = _mousePos;
- SharedPtr<Bitmap> oldMouseBitmap = _mouseSprite.bitmap;
+ Common::Point oldMousePos = getMousePos();
+ SharedPtr<Bitmap> oldMouseBitmap = _mouseBitmap;
- _mousePos.x = xoffset + 0xde;
- _mousePos.y = yoffset - 0x08;
- _mouseSprite.pos = _mousePos;
- _mouseSprite.drawPriority = 15;
-
- _mouseSprite.setBitmap(loadBitmap("pushbtn"));
- warpMousePosition(_mousePos.x, _mousePos.y);
+ _vm->_system->warpMouse(xoffset + 0xde, yoffset - 0x08);
+ setMouseCursor(loadBitmap("pushbtn"));
uint16 tmpTextboxVar7 = _textboxVar7;
_textboxVar7 = 0;
@@ -119,11 +115,8 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
_vm->pollEvents();
}
- _mousePos = oldMousePos;
- _mouseSprite.pos = _mousePos;
- _mouseSprite.drawPriority = 15;
- _mouseSprite.setBitmap(oldMouseBitmap);
- warpMousePosition(_mousePos.x, _mousePos.y);
+ setMouseCursor(oldMouseBitmap);
+ _vm->_system->warpMouse(oldMousePos.x, oldMousePos.y);
_textboxVar7 = tmpTextboxVar7;
// sub_29326();
@@ -288,8 +281,4 @@ void Graphics::loadMenuButtons(Common::String mnuFilename, int xpos, int ypos) {
}
}
-void Graphics::warpMousePosition(int x, int y) {
- // TODO
-}
-
}
Commit: 295c55c510d8ebdbfb453ea769fff243bdfb4e0c
https://github.com/scummvm/scummvm/commit/295c55c510d8ebdbfb453ea769fff243bdfb4e0c
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement more text routines
Changed paths:
A engines/startrek/room.cpp
A engines/startrek/room.h
engines/startrek/graphics.h
engines/startrek/module.mk
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 714d287..62c49f2 100755
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -17,10 +17,6 @@
* 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.
- *
- * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/graphics.h $
- * $Id: graphics.h 2 2009-09-12 20:13:40Z clone2727 $
- *
*/
#ifndef STARTREK_GRAPHICS_H
@@ -36,6 +32,7 @@
#include "common/stream.h"
using Common::SharedPtr;
+using Common::String;
namespace StarTrek {
@@ -66,7 +63,7 @@ struct Menu {
};
class Graphics;
-typedef Common::String (Graphics::*TextGetterFunc)(int, int, Common::String *);
+typedef String (Graphics::*TextGetterFunc)(int, int, String *);
class Graphics {
@@ -77,10 +74,10 @@ public:
void loadEGAData(const char *egaFile);
void drawBackgroundImage(const char *filename);
- void loadPalette(const Common::String &paletteFile);
+ void loadPalette(const String &paletteFile);
void loadPri(const char *priFile);
- SharedPtr<Bitmap> loadBitmap(Common::String basename);
+ SharedPtr<Bitmap> loadBitmap(String basename);
Common::Point getMousePos();
void setMouseCursor(SharedPtr<Bitmap> bitmap);
@@ -117,15 +114,29 @@ private:
// text.cpp (TODO: separate class)
public:
- int showText(TextGetterFunc textGetter, int var, int xoffset, int yoffset, int textColor, int argC, int maxTextLines, int arg10);
- Common::String tmpFunction(int choiceIndex, int var, Common::String *speakerTextOutput);
- SharedPtr<TextBitmap> initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite);
+ int showText(TextGetterFunc textGetter, int var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, int arg10);
+ String tmpFunction(int choiceIndex, int var, String *headerTextOutput);
+ String readTextFromRdf(int choiceIndex, int rdfVar, String *headerTextOutput);
private:
- Common::String skipOverAudioPrompt(const Common::String &str);
- int getNumLines(const Common::String &str);
- Common::String readLineFormattedText(TextGetterFunc textGetter, int var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numLines);
- void loadMenuButtons(Common::String mnuFilename, int xpos, int ypos);
+ int handleTextboxEvents(uint32 arg0, bool arg4);
+
+ SharedPtr<TextBitmap> initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite);
+ void drawMainText(SharedPtr<TextBitmap> bitmap, int numTextLines, int numTextboxLines, const String &text, bool withHeader);
+
+ int getNumLines(const String &str);
+ void getTextboxHeader(String *headerTextOutput, String speakerText, int choiceIndex);
+
+ String readLineFormattedText(TextGetterFunc textGetter, int var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numLines);
+ String putTextIntoLines(const String &text);
+ const char *getNextTextLine(const char *text, char *line, int lineWidth);
+
+ String skipTextAudioPrompt(const String &str);
+ String playTextAudio(const String &str);
+
+ void loadMenuButtons(String mnuFilename, int xpos, int ypos);
+ void setMenuButtonVar2Bits(uint32 bits);
+ void clearMenuButtonVar2Bits(uint32 bits);
uint16 _textboxVar1;
uint32 _textboxVar2;
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 23af200..ea8d4d3 100755
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -8,6 +8,7 @@ MODULE_OBJS = \
font.o \
lzss.o \
graphics.o \
+ room.o \
sound.o \
sprite.o \
startrek.o \
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
new file mode 100644
index 0000000..3516aaa
--- /dev/null
+++ b/engines/startrek/room.cpp
@@ -0,0 +1,49 @@
+/* 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.
+ *
+ * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/graphics.h $
+ * $Id: graphics.h 2 2009-09-12 20:13:40Z clone2727 $
+ *
+ */
+
+#include "startrek/filestream.h"
+#include "startrek/room.h"
+#include "startrek/startrek.h"
+
+
+namespace StarTrek {
+
+Room::Room(StarTrekEngine *vm, Common::String name) : _vm(vm) {
+ SharedPtr<FileStream> rdfFile = _vm->openFile(name + ".RDF");
+
+ int size = rdfFile->size();
+ _rdfData = new byte[size];
+ rdfFile->read(_rdfData, size);
+}
+
+Room::~Room() {
+ delete[] _rdfData;
+}
+
+uint16 Room::readRdfWord(int offset) {
+ return _rdfData[offset] | (_rdfData[offset+1]<<8);
+}
+
+}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
new file mode 100644
index 0000000..afe366b8
--- /dev/null
+++ b/engines/startrek/room.h
@@ -0,0 +1,51 @@
+/* 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.
+ */
+
+#ifndef STARTREK_ROOM_H
+#define STARTREK_ROOM_H
+
+#include "common/ptr.h"
+#include "common/str.h"
+
+using Common::SharedPtr;
+
+
+namespace StarTrek {
+
+class StarTrekEngine;
+
+class Room {
+
+public:
+ Room(StarTrekEngine *vm, Common::String name);
+ ~Room();
+
+ uint16 readRdfWord(int offset);
+
+ byte *_rdfData;
+
+private:
+ StarTrekEngine *_vm;
+};
+
+}
+
+#endif
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index b798111..f83a182 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -39,13 +39,19 @@
namespace StarTrek {
StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gamedesc) : Engine(syst), _gameDescription(gamedesc) {
- _macResFork = 0;
+ _gfx = nullptr;
+ _sound = nullptr;
+ _macResFork = nullptr;
+
+ _room = nullptr;
}
StarTrekEngine::~StarTrekEngine() {
delete _gfx;
delete _sound;
delete _macResFork;
+
+ delete _room;
}
Common::Error StarTrekEngine::run() {
@@ -84,6 +90,7 @@ Common::Error StarTrekEngine::run() {
// Judgment Rites Backgrounds supported too
// EGA not supported
#if 1
+ _room = new Room(this, "DEMON0");
if (getGameType() == GType_ST25) {
_gfx->loadPalette("PALETTE");
_gfx->loadPri("DEMON0.PRI");
@@ -141,7 +148,7 @@ Common::Error StarTrekEngine::run() {
*/
- _gfx->showText(&Graphics::tmpFunction, 0, 150, 180, 0xb3, 0, 10, 0);
+ _gfx->showText(&Graphics::readTextFromRdf, 0x2220, 150, 160, 0xb3, 0, 10, 0);
while (!shouldQuit()) {
pollEvents();
@@ -168,6 +175,10 @@ void StarTrekEngine::pollEvents() {
_system->delayMillis(1000/60);
}
+Room *StarTrekEngine::getRoom() {
+ return _room;
+}
+
SharedPtr<FileStream> StarTrekEngine::openFile(Common::String filename, int fileIndex) {
filename.toUppercase();
Common::String basename, extension;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 9bf1065..e19fd11 100755
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -38,6 +38,7 @@
#include "startrek/filestream.h"
#include "startrek/graphics.h"
+#include "startrek/room.h"
#include "startrek/sound.h"
@@ -72,6 +73,7 @@ public:
// Running the game
void pollEvents();
+ Room *getRoom();
// Detection related functions
const StarTrekGameDescription *_gameDescription;
@@ -92,6 +94,8 @@ private:
Graphics *_gfx;
Sound *_sound;
Common::MacResManager *_macResFork;
+
+ Room *_room;
};
} // End of namespace StarTrek
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 08400dc..9e54e83 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -24,9 +24,28 @@
#include "startrek/graphics.h"
+
+// List of events that can be returned by handleTextEvents.
+enum TextEvent {
+ TEXTEVENT_RCLICK_OFFBUTTON = 0,
+ TEXTEVENT_ENABLEINPUT, // Makes buttons selectable (occurs after a delay)
+ TEXTEVENT_RCLICK_ONBUTTON,
+ TEXTEVENT_LCLICK_OFFBUTTON,
+ TEXTEVENT_CONFIRM,
+ TEXTEVENT_SCROLLUP,
+ TEXTEVENT_SCROLLDOWN,
+ TEXTEVENT_PREVCHOICE,
+ TEXTEVENT_NEXTCHOICE,
+ TEXTEVENT_SCROLLUP_ONELINE,
+ TEXTEVENT_SCROLLDOWN_ONELINE,
+ TEXTEVENT_GOTO_TOP,
+ TEXTEVENT_GOTO_BOTTOM,
+ TEXTEVENT_SPEECH_DONE
+};
+
namespace StarTrek {
-int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoffset, int textColor, int argC, int maxTextLines, int arg10) {
+int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, int arg10) {
uint16 tmpTextboxVar1 = _textboxVar1;
uint32 var7c = 8;
@@ -37,10 +56,10 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
int numChoicesWithNames = 0;
int numTextboxLines = 0;
int numChoices = 0;
- Common::String speakerText;
+ String speakerText;
while(true) {
- Common::String choiceText = (this->*textGetter)(numChoices, var, &speakerText);
+ String choiceText = (this->*textGetter)(numChoices, var, &speakerText);
if (choiceText.empty())
break;
@@ -66,7 +85,7 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
SharedPtr<TextBitmap> textBitmap = initTextSprite(&xoffset, &yoffset, textColor, numTextboxLines, numChoicesWithNames, &textboxSprite);
int choiceIndex = 0;
- int var28 = 0;
+ int scrollOffset = 0;
if (tmpTextboxVar1 != 0 && tmpTextboxVar1 != 1 && numChoices == 1
&& _textboxVar5 != 0 && _textboxVar4 == 0)
_textboxHasMultipleChoices = false;
@@ -78,8 +97,8 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
else
_textboxVar6 = false;
- int numPrintedLines;
- Common::String lineFormattedText = readLineFormattedText(textGetter, var, choiceIndex, textBitmap, numTextboxLines, &numPrintedLines);
+ int numTextLines;
+ String lineFormattedText = readLineFormattedText(textGetter, var, choiceIndex, textBitmap, numTextboxLines, &numTextLines);
if (lineFormattedText.empty()) { // Technically should check for nullptr
// TODO
@@ -104,15 +123,129 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
if (var7c == 0) {
// sub_28ACA(0x0001);
}
- if (argC == 0) {
+ if (loopChoices == 0) {
// sub_28ACA(0x0008);
}
bool doneShowingText = false;
+ // Loop until text is done being displayed
while (!doneShowingText) {
- // TODO
- _vm->pollEvents();
+ int textboxReturnCode = handleTextboxEvents(var7c, true);
+
+ if (var7c == 0) {
+ clearMenuButtonVar2Bits(0x0001);
+ }
+
+ switch(textboxReturnCode) {
+
+ case TEXTEVENT_RCLICK_OFFBUTTON:
+ case TEXTEVENT_RCLICK_ONBUTTON:
+ if (var7c == 0) {
+ doneShowingText = true;
+ if (arg10)
+ choiceIndex = -1;
+ }
+ break;
+
+ case TEXTEVENT_CONFIRM:
+ doneShowingText = true;
+ break;
+
+ case TEXTEVENT_SCROLLUP:
+ scrollOffset -= numTextboxLines;
+ goto readjustScrollUp;
+
+ case TEXTEVENT_SCROLLDOWN:
+ scrollOffset += numTextboxLines;
+ goto readjustScrollDown;
+
+ case TEXTEVENT_SCROLLUP_ONELINE:
+ scrollOffset--;
+ goto readjustScrollUp;
+
+ case TEXTEVENT_SCROLLDOWN_ONELINE:
+ scrollOffset++;
+ goto readjustScrollDown;
+
+ case TEXTEVENT_GOTO_TOP:
+ scrollOffset = 0;
+ goto readjustScrollUp;
+
+ case TEXTEVENT_GOTO_BOTTOM:
+ scrollOffset = numTextLines - numTextboxLines;
+ goto readjustScrollDown;
+
+readjustScrollUp:
+ clearMenuButtonVar2Bits(0x0004);
+ if (scrollOffset < 0)
+ scrollOffset = 0;
+ if (scrollOffset == 0)
+ setMenuButtonVar2Bits(0x0002);
+ goto readjustScroll;
+
+readjustScrollDown:
+ clearMenuButtonVar2Bits(0x0002);
+ if (scrollOffset >= numTextLines)
+ scrollOffset -= numTextboxLines;
+ if (scrollOffset > numTextLines-1)
+ scrollOffset = numTextLines-1;
+ if (scrollOffset+numTextboxLines >= numTextLines)
+ setMenuButtonVar2Bits(0x0004);
+ goto readjustScroll;
+
+readjustScroll:
+ textboxSprite.bitmapChanged = true;
+ // sub_225d3(textBitmap, numTextLines-scrollOffset, numTextboxLines, lineFormattedText+scrollOffset*0x18);
+ break;
+
+ case TEXTEVENT_PREVCHOICE:
+ choiceIndex--;
+ if (!loopChoices && choiceIndex == 0) {
+ setMenuButtonVar2Bits(0x0008);
+ }
+ else {
+ if (choiceIndex < 0)
+ choiceIndex = numChoices-1;
+ }
+ clearMenuButtonVar2Bits(0x0010);
+ goto reloadText;
+
+ case TEXTEVENT_NEXTCHOICE:
+ clearMenuButtonVar2Bits(0x0008);
+ choiceIndex++;
+ if (!loopChoices && choiceIndex == numChoices-1) {
+ setMenuButtonVar2Bits(0x0010);
+ }
+ else {
+ choiceIndex %= numChoices;
+ }
+ goto reloadText;
+
+reloadText:
+ scrollOffset = 0;
+ lineFormattedText = readLineFormattedText(textGetter, var, choiceIndex, textBitmap, numTextboxLines, &numTextLines);
+ if (numTextLines <= numTextboxLines) {
+ // sub_288FB(0x0019);
+ }
+ else {
+ // sub_288FB(0x001F);
+ }
+ clearMenuButtonVar2Bits(0x0004);
+ setMenuButtonVar2Bits(0x0002);
+ textboxSprite.bitmapChanged = true;
+ break;
+
+ case TEXTEVENT_SPEECH_DONE:
+ if (numChoices == 1)
+ doneShowingText = true;
+ break;
+
+ case TEXTEVENT_ENABLEINPUT:
+ case TEXTEVENT_LCLICK_OFFBUTTON:
+ default:
+ break;
+ }
}
setMouseCursor(oldMouseBitmap);
@@ -133,15 +266,48 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
return choiceIndex;
}
-Common::String Graphics::tmpFunction(int choiceIndex, int var, Common::String *speakerTextOutput) {
- if (speakerTextOutput != nullptr)
- *speakerTextOutput = "Speaker";
+int Graphics::handleTextboxEvents(uint32 arg0, bool arg4) {
+ // TODO
+ while (true) {
+ _vm->pollEvents();
+ }
+}
+
+String Graphics::tmpFunction(int choiceIndex, int var, String *headerTextOutput) {
+ if (headerTextOutput != nullptr)
+ *headerTextOutput = "Speaker ";
if (choiceIndex >= 1)
return NULL;
return "Text test";
}
+String Graphics::readTextFromRdf(int choiceIndex, int rdfVar, String *headerTextOutput) {
+ Room *room = _vm->getRoom();
+
+ // FIXME: in original game "rdfVar" is a pointer to the variable holding the offset.
+ // Currently treating it as the offset itself.
+ uint16 textOffset = room->readRdfWord(rdfVar + (choiceIndex+1)*2);
+
+ if (textOffset == 0)
+ return "";
+
+ if (headerTextOutput != nullptr) {
+ uint16 speakerOffset = room->readRdfWord(rdfVar);
+ if (speakerOffset == 0 || room->_rdfData[speakerOffset] == '\0')
+ *headerTextOutput = "";
+ else {
+ char *speakerText = (char*)&room->_rdfData[speakerOffset];
+ if (room->readRdfWord(rdfVar+4) != 0) // Check if there's more than one option
+ getTextboxHeader(headerTextOutput, speakerText, choiceIndex+1);
+ else
+ getTextboxHeader(headerTextOutput, speakerText, 0);
+ }
+ }
+
+ return (char*)&room->_rdfData[textOffset];
+}
+
/**
* Creates a blank textbox in a TextBitmap, and initializes a sprite to use it.
*/
@@ -219,36 +385,220 @@ SharedPtr<TextBitmap> Graphics::initTextSprite(int *xoffsetPtr, int *yoffsetPtr,
return bitmap;
}
-Common::String Graphics::skipOverAudioPrompt(const Common::String &str) {
- // TODO
- return str;
+/**
+ * Draws the "main" text (everything but the header which includes the speaker) to
+ * a TextBitmap.
+ */
+void Graphics::drawMainText(SharedPtr<TextBitmap> bitmap, int numTextLines, int numTextboxLines, const String &_text, bool withHeader) {
+ byte *dest = bitmap->pixels + TEXTBOX_WIDTH + 1; // Start of 2nd row
+ const char *text = _text.c_str();
+
+ if (numTextLines >= numTextboxLines)
+ numTextLines = numTextboxLines;
+
+ if (withHeader)
+ dest += TEXTBOX_WIDTH*2; // Start of 4th row
+
+ int lineIndex = 0;
+ while (lineIndex != numTextLines) {
+ memcpy(dest, text, TEXTBOX_WIDTH-2);
+ text += TEXTBOX_WIDTH-2;
+ dest += TEXTBOX_WIDTH;
+ lineIndex++;
+ }
+
+ debug("%d, %d\n", numTextLines, numTextboxLines);
+ // Fill all remaining blank lines
+ while (lineIndex != numTextboxLines) {
+ memset(dest, ' ', TEXTBOX_WIDTH-2);
+ dest += TEXTBOX_WIDTH;
+ lineIndex++;
+ }
}
-int Graphics::getNumLines(const Common::String &str) {
- // TODO
- return 1;
+/**
+ * Returns the number of lines this string will take up in a textbox.
+ */
+int Graphics::getNumLines(const String &str) {
+ const char *text = str.c_str();
+ char line[TEXTBOX_WIDTH];
+
+ int lines = 0;
+
+ while (text != nullptr) {
+ text = getNextTextLine(text, line, TEXTBOX_WIDTH-2);
+ lines++;
+ }
+ return lines-1;
}
-Common::String Graphics::readLineFormattedText(TextGetterFunc textGetter, int var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numPrintedLines) {
- // TODO
- *numPrintedLines = 1;
+void Graphics::getTextboxHeader(String *headerTextOutput, String speakerText, int choiceIndex) {
+ String header = speakerText;
+
+ if (choiceIndex != 0)
+ header += String::format(" choice %d", choiceIndex);
+
+ if (header.size() > TEXTBOX_WIDTH-2)
+ header.erase(TEXTBOX_WIDTH-2);
+ while (header.size() < TEXTBOX_WIDTH-2)
+ header += ' ';
+
+ *headerTextOutput = header;
+}
+
+String Graphics::readLineFormattedText(TextGetterFunc textGetter, int var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numTextLines) {
+ String headerText;
+ String text = (this->*textGetter)(choiceIndex, var, &headerText);
+
+ if (_textboxVar1 == 2 && _textboxVar5 == 1 && _textboxVar4 == 1) {
+ uint32 oldSize = text.size();
+ text = playTextAudio(text);
+ if (oldSize != text.size())
+ _textboxHasMultipleChoices = true;
+ }
+ else if ((_textboxVar1 == 0 || _textboxVar1 == 1) && _textboxVar5 == 1 && _textboxVar4 == 1) {
+ text = playTextAudio(text);
+ }
+ else {
+ text = skipTextAudioPrompt(text);
+ }
+
+ if (_textboxHasMultipleChoices) {
+ *numTextLines = getNumLines(text);
+
+ bool hasHeader = !headerText.empty();
+
+ String lineFormattedText = putTextIntoLines(text);
+ drawMainText(textBitmap, *numTextLines, numTextboxLines, lineFormattedText, hasHeader);
+
+ assert(headerText.size() == TEXTBOX_WIDTH-2);
+ memcpy(textBitmap->pixels+TEXTBOX_WIDTH+1, headerText.c_str(), TEXTBOX_WIDTH-2);
+
+ return lineFormattedText;
+ }
+ else
+ return nullptr;
+
+ /* Barebones implementation
+ *numTextLines = 1;
uint numChars = textBitmap->width*textBitmap->height;
- Common::String text = (this->*textGetter)(choiceIndex, var, nullptr);
+ String text = (this->*textGetter)(choiceIndex, var, nullptr);
while (text.size() < numChars) text += ' ';
byte *dest = textBitmap->pixels + TEXTBOX_WIDTH + 1;
- for (int y=0; y<*numPrintedLines; y++) {
+ for (int y=0; y<*numTextLines; y++) {
memcpy(dest, text.c_str(), TEXTBOX_WIDTH-2);
dest += TEXTBOX_WIDTH;
}
return text;
+ */
+}
+
+String Graphics::putTextIntoLines(const String &_text) {
+ char line[TEXTBOX_WIDTH];
+
+ const char *text = _text.c_str();
+ String output;
+
+ text = getNextTextLine(text, line, TEXTBOX_WIDTH-2);
+
+ while (text != nullptr) {
+ int len = strlen(line);
+ while (len != TEXTBOX_WIDTH-2) {
+ line[len++] = ' ';
+ line[len] = '\0';
+ }
+ output += line;
+
+ text = getNextTextLine(text, line, TEXTBOX_WIDTH-2);
+ }
+
+ return output;
}
-void Graphics::loadMenuButtons(Common::String mnuFilename, int xpos, int ypos) {
+/**
+ * Gets one line of text (does not include words that won't fit).
+ * Returns position of text to continue from, or nullptr if done.
+ */
+const char *Graphics::getNextTextLine(const char *text, char *lineOutput, int lineWidth) {
+ *lineOutput = '\0';
+ if (*text == '\0')
+ return nullptr;
+
+ const char *lastSpaceInput = nullptr;
+ char *lastSpaceOutput = nullptr;
+ int var4;
+ int charIndex = 0;
+
+ while (charIndex != lineWidth && *text != '\0') {
+ char c = *text;
+
+ if (c == '\n') {
+ *lineOutput = '\0';
+ return text+1;
+ }
+
+ if (c == ' ') {
+ var4 = charIndex;
+ lastSpaceInput = text;
+ lastSpaceOutput = lineOutput;
+ }
+
+ if (c == '\r') {
+ text++;
+ charIndex--;
+ }
+ else {
+ text++;
+ *(lineOutput++) = c;
+ }
+ charIndex++;
+ }
+
+ if (*text == '\0') {
+ *lineOutput = '\0';
+ return text;
+ }
+ if (*text == ' ') {
+ *lineOutput = '\0';
+ return text+1;
+ }
+ if (lastSpaceOutput == nullptr) { // Long word couldn't fit on line
+ *lineOutput = '\0';
+ return text;
+ }
+
+ // In the middle of a word; must go back to the start of it
+ *lastSpaceOutput = '\0';
+ return lastSpaceInput+1;
+}
+
+String Graphics::skipTextAudioPrompt(const String &str) {
+ const char *text = str.c_str();
+
+ if (*text != '#')
+ return str;
+
+ text++;
+ while (*text != '#') {
+ if (*text == '\0')
+ return str;
+ text++;
+ }
+
+ return String(text+1);
+}
+
+String Graphics::playTextAudio(const String &str) {
+ // TODO
+ return skipTextAudioPrompt(str);
+}
+
+void Graphics::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
SharedPtr<Menu> oldMenu = _activeMenu;
_activeMenu = SharedPtr<Menu>(new Menu());
_activeMenu->nextMenu = oldMenu;
@@ -281,4 +631,16 @@ void Graphics::loadMenuButtons(Common::String mnuFilename, int xpos, int ypos) {
}
}
+// 0x0002: Disable scroll up
+// 0x0004: Disable scroll down
+// 0x0008: Disable prev choice
+// 0x0010: Disable next choice
+void Graphics::setMenuButtonVar2Bits(uint32 bits) {
+ // TODO
+}
+
+void Graphics::clearMenuButtonVar2Bits(uint32 bits) {
+ // TODO
+}
+
}
Commit: fd26d0a790342b086fc9430d3cb9d4449104e6ce
https://github.com/scummvm/scummvm/commit/fd26d0a790342b086fc9430d3cb9d4449104e6ce
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Begin implementing event system.
Textbox now responds to mouse input.
Changed paths:
A engines/startrek/events.cpp
engines/startrek/graphics.h
engines/startrek/module.mk
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/events.cpp b/engines/startrek/events.cpp
new file mode 100644
index 0000000..a37ae8c
--- /dev/null
+++ b/engines/startrek/events.cpp
@@ -0,0 +1,94 @@
+/* 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 "startrek/startrek.h"
+
+namespace StarTrek {
+
+void StarTrekEngine::initializeEventsAndMouse() {
+ _mouseMoveEventInQueue = false;
+ _tickEventInQueue = false;
+
+ // TODO: mouse
+}
+
+/**
+ * Returns false if there is no event waiting.
+ */
+bool StarTrekEngine::getNextEvent(TrekEvent *e) {
+ pollSystemEvents(); // TODO: put this somewhere else?
+
+ if (_eventQueue.empty())
+ return false;
+ *e = _eventQueue.front();
+ return true;
+}
+
+void StarTrekEngine::removeNextEvent() {
+ if (_eventQueue.empty())
+ return;
+
+ const TrekEvent &e = _eventQueue.front();
+
+ if (e.type == TREKEVENT_MOUSEMOVE)
+ _mouseMoveEventInQueue = false;
+ if (e.type == TREKEVENT_TICK)
+ _tickEventInQueue = false;
+
+ _eventQueue.pop_front();
+}
+
+bool StarTrekEngine::popNextEvent(TrekEvent *e) {
+ if (!getNextEvent(e))
+ return false;
+
+ removeNextEvent();
+ return true;
+}
+
+void StarTrekEngine::addEventToQueue(const TrekEvent &e) {
+ if (e.type == TREKEVENT_MOUSEMOVE && _mouseMoveEventInQueue) {
+ // Only allow one mouse move event at once
+ for (Common::List<TrekEvent>::iterator i = _eventQueue.begin(); i!=_eventQueue.end(); i++) {
+ if (i->type == TREKEVENT_MOUSEMOVE) {
+ *i = e;
+ return;
+ }
+ }
+
+ error("Couldn't find mouse move event in eventQueue");
+ }
+
+ if (e.type == TREKEVENT_TICK) {
+ // Only allow one tick event at once
+ if (_tickEventInQueue)
+ return;
+ _tickEventInQueue = true;
+ }
+
+ if (e.type == TREKEVENT_MOUSEMOVE)
+ _mouseMoveEventInQueue = true;
+
+ assert(_eventQueue.size() < 0x40);
+ _eventQueue.push_back(e);
+}
+
+}
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 62c49f2..578abdf 100755
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -47,23 +47,24 @@ const int MAX_SPRITES = 32;
const int MAX_MENUBUTTONS = 16; // This is arbitrary, the original game has no such limit
const int TEXTBOX_WIDTH = 26;
+const int MAX_TEXTBOX_LINES = 12;
// Keeps track of data for a list of buttons making up a menu
struct Menu {
Sprite sprites[MAX_MENUBUTTONS];
uint16 retvals[MAX_MENUBUTTONS];
- uint16 buttonVar2;
+ uint32 disabledButtons;
SharedPtr<FileStream> menuFile;
uint16 numButtons;
- uint16 buttonVar1;
+ int16 selectedButton;
SharedPtr<Menu> nextMenu;
Menu() : nextMenu(SharedPtr<Menu>()) {}
};
class Graphics;
-typedef String (Graphics::*TextGetterFunc)(int, int, String *);
+typedef String (Graphics::*TextGetterFunc)(int, void *, String *);
class Graphics {
@@ -115,11 +116,12 @@ private:
// text.cpp (TODO: separate class)
public:
int showText(TextGetterFunc textGetter, int var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, int arg10);
- String tmpFunction(int choiceIndex, int var, String *headerTextOutput);
- String readTextFromRdf(int choiceIndex, int rdfVar, String *headerTextOutput);
+
+ String readTextFromRdf(int choiceIndex, void *data, String *headerTextOutput);
+ String readTextFromBuffer(int choiceIndex, void *data, String *headerTextOutput);
private:
- int handleTextboxEvents(uint32 arg0, bool arg4);
+ int handleTextboxEvents(uint32 ticksUntilClickingEnabled, bool arg4);
SharedPtr<TextBitmap> initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite);
void drawMainText(SharedPtr<TextBitmap> bitmap, int numTextLines, int numTextboxLines, const String &text, bool withHeader);
@@ -134,20 +136,24 @@ private:
String skipTextAudioPrompt(const String &str);
String playTextAudio(const String &str);
+ int getMenuButtonAt(const Menu &menu, int x, int y);
+ void drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color);
void loadMenuButtons(String mnuFilename, int xpos, int ypos);
void setMenuButtonVar2Bits(uint32 bits);
void clearMenuButtonVar2Bits(uint32 bits);
+
uint16 _textboxVar1;
uint32 _textboxVar2;
uint32 _textboxVar3;
- uint16 _textboxVar4;
- uint16 _textboxVar5;
uint16 _textboxVar6;
uint16 _textboxVar7;
bool _textboxHasMultipleChoices;
SharedPtr<Menu> _activeMenu;
+
+ uint16 _textboxButtonVar4;
+ uint16 _word_4B422;
};
}
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index ea8d4d3..9114de4 100755
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -4,6 +4,7 @@ MODULE_OBJS = \
bitmap.o \
common.o \
detection.o \
+ events.o \
filestream.o \
font.o \
lzss.o \
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index f83a182..1b333b9 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -55,6 +55,9 @@ StarTrekEngine::~StarTrekEngine() {
}
Common::Error StarTrekEngine::run() {
+ _cdAudioEnabled = true;
+ _midiAudioEnabled = true;
+
_gfx = new Graphics(this);
_sound = new Sound(this);
@@ -66,6 +69,8 @@ Common::Error StarTrekEngine::run() {
}
initGraphics(320, 200);
+
+ initializeEventsAndMouse();
// Hexdump data
#if 0
@@ -151,21 +156,38 @@ Common::Error StarTrekEngine::run() {
_gfx->showText(&Graphics::readTextFromRdf, 0x2220, 150, 160, 0xb3, 0, 10, 0);
while (!shouldQuit()) {
- pollEvents();
+ pollSystemEvents();
}
#endif
return Common::kNoError;
}
-void StarTrekEngine::pollEvents() {
+Room *StarTrekEngine::getRoom() {
+ return _room;
+}
+
+void StarTrekEngine::pollSystemEvents() {
Common::Event event;
+ TrekEvent trekEvent;
while (_eventMan->pollEvent(event)) {
+ trekEvent.mouse = event.mouse;
+ trekEvent.kbd = event.kbd;
+
switch (event.type) {
case Common::EVENT_QUIT:
_system->quit();
break;
+
+ case Common::EVENT_MOUSEMOVE:
+ trekEvent.type = TREKEVENT_MOUSEMOVE;
+ addEventToQueue(trekEvent);
+ break;
+ case Common::EVENT_LBUTTONDOWN:
+ trekEvent.type = TREKEVENT_LBUTTONDOWN;
+ addEventToQueue(trekEvent);
+ break;
default:
break;
}
@@ -175,8 +197,14 @@ void StarTrekEngine::pollEvents() {
_system->delayMillis(1000/60);
}
-Room *StarTrekEngine::getRoom() {
- return _room;
+void StarTrekEngine::playSound(int id) {
+ // TODO
+}
+
+void StarTrekEngine::updateClockTicks() {
+ // TODO (based on DOS interrupt 1A, AH=0; read system clock counter)
+
+ _clockTicks = 0;
}
SharedPtr<FileStream> StarTrekEngine::openFile(Common::String filename, int fileIndex) {
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index e19fd11..a0b97b9 100755
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -17,15 +17,13 @@
* 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.
- *
- * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/startrek.h $
- * $Id: startrek.h 14 2010-05-26 15:44:12Z clone2727 $
- *
*/
#ifndef STARTREK_H
#define STARTREK_H
+#include "common/events.h"
+#include "common/list.h"
#include "common/ptr.h"
#include "common/rect.h"
#include "common/scummsys.h"
@@ -59,6 +57,24 @@ enum StarTrekGameFeatures {
GF_DEMO = (1 << 0)
};
+
+enum TrekEventType {
+ TREKEVENT_TICK = 0, // DOS clock changes (see updateClockTicks)
+ TREKEVENT_LBUTTONDOWN = 1,
+ TREKEVENT_MOUSEMOVE = 2,
+ TREKEVENT_LBUTTONUP = 3,
+ TREKEVENT_RBUTTONDOWN = 4,
+ TREKEVENT_RBUTTONUP = 5,
+ TREKEVENT_KEYDOWN = 6
+};
+
+struct TrekEvent {
+ TrekEventType type;
+ Common::KeyState kbd;
+ Common::Point mouse;
+ uint32 tick;
+};
+
struct StarTrekGameDescription;
class Graphics;
class Sound;
@@ -72,9 +88,35 @@ public:
virtual ~StarTrekEngine();
// Running the game
- void pollEvents();
Room *getRoom();
+ void pollSystemEvents();
+ void playSound(int id); // TODO: rename, figure out what it is
+
+ // Events
+public:
+ void initializeEventsAndMouse();
+ bool getNextEvent(TrekEvent *e);
+ void removeNextEvent();
+ bool popNextEvent(TrekEvent *e);
+ void addEventToQueue(const TrekEvent &e);
+ void clearEventBuffer();
+ uint32 getClockTicks();
+ void updateEvents();
+ void updateTimerEvent();
+ void updateMouseEvents();
+ void updateKeyboardEvents();
+ void updateClockTicks();
+ bool checkKeyPressed();
+
+ Common::EventManager *getEventMan() { return _eventMan; }
+
+private:
+ Common::List<TrekEvent> _eventQueue;
+ bool _mouseMoveEventInQueue;
+ bool _tickEventInQueue;
+
+public:
// Detection related functions
const StarTrekGameDescription *_gameDescription;
uint32 getFeatures() const;
@@ -89,6 +131,14 @@ public:
// Movie related functions
void playMovie(Common::String filename);
void playMovieMac(Common::String filename);
+
+
+ uint32 _clockTicks;
+
+ bool _midiAudioEnabled;
+ bool _cdAudioEnabled;
+ bool _textboxVar4;
+
private:
Graphics *_gfx;
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 9e54e83..6ac31b0 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -19,19 +19,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include "common/events.h"
#include "common/stream.h"
#include "graphics/cursorman.h"
#include "startrek/graphics.h"
-// List of events that can be returned by handleTextEvents.
+// List of events that can be returned by handleTextboxEvents.
enum TextEvent {
- TEXTEVENT_RCLICK_OFFBUTTON = 0,
+ TEXTEVENT_RCLICK_OFFBUTTON = -4,
TEXTEVENT_ENABLEINPUT, // Makes buttons selectable (occurs after a delay)
TEXTEVENT_RCLICK_ONBUTTON,
TEXTEVENT_LCLICK_OFFBUTTON,
- TEXTEVENT_CONFIRM,
+ TEXTEVENT_CONFIRM = 0,
TEXTEVENT_SCROLLUP,
TEXTEVENT_SCROLLDOWN,
TEXTEVENT_PREVCHOICE,
@@ -59,7 +60,7 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
String speakerText;
while(true) {
- String choiceText = (this->*textGetter)(numChoices, var, &speakerText);
+ String choiceText = (this->*textGetter)(numChoices, &var, &speakerText);
if (choiceText.empty())
break;
@@ -73,8 +74,8 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
numChoices++;
}
- if (maxTextLines == 0 || maxTextLines > 12)
- maxTextLines = 12;
+ if (maxTextLines == 0 || maxTextLines > MAX_TEXTBOX_LINES)
+ maxTextLines = MAX_TEXTBOX_LINES;
if (numTextboxLines > maxTextLines)
numTextboxLines = maxTextLines;
@@ -87,12 +88,12 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
int choiceIndex = 0;
int scrollOffset = 0;
if (tmpTextboxVar1 != 0 && tmpTextboxVar1 != 1 && numChoices == 1
- && _textboxVar5 != 0 && _textboxVar4 == 0)
+ && _vm->_cdAudioEnabled && !_vm->_textboxVar4)
_textboxHasMultipleChoices = false;
else
_textboxHasMultipleChoices = true;
- if (tmpTextboxVar1 >= 0 && tmpTextboxVar1 <= 2 && _textboxVar5 == 1 && _textboxVar4 == 0)
+ if (tmpTextboxVar1 >= 0 && tmpTextboxVar1 <= 2 && _vm->_cdAudioEnabled && !_vm->_textboxVar4)
_textboxVar6 = true;
else
_textboxVar6 = false;
@@ -196,7 +197,12 @@ readjustScrollDown:
readjustScroll:
textboxSprite.bitmapChanged = true;
- // sub_225d3(textBitmap, numTextLines-scrollOffset, numTextboxLines, lineFormattedText+scrollOffset*0x18);
+ drawMainText(
+ textBitmap,
+ numTextLines-scrollOffset,
+ numTextboxLines,
+ lineFormattedText.c_str() + scrollOffset*(TEXTBOX_WIDTH-2),
+ numChoicesWithNames != 0);
break;
case TEXTEVENT_PREVCHOICE:
@@ -266,27 +272,97 @@ reloadText:
return choiceIndex;
}
-int Graphics::handleTextboxEvents(uint32 arg0, bool arg4) {
- // TODO
+int Graphics::handleTextboxEvents(uint32 ticksUntilClickingEnabled, bool arg4) {
+ // TODO: finish
+
+ uint32 tickWhenClickingEnabled = _vm->_clockTicks + ticksUntilClickingEnabled;
+
while (true) {
- _vm->pollEvents();
- }
-}
+ TrekEvent event;
+ while (_vm->popNextEvent(&event)) {
+ switch(event.type) {
+
+ case TREKEVENT_TICK: {
+ case TREKEVENT_MOUSEMOVE: // FIXME: actual game only uses TICK event here
+ Common::Point mousePos = getMousePos();
+ int buttonIndex = getMenuButtonAt(*_activeMenu, mousePos.x, mousePos.y);
+ if (buttonIndex != -1) {
+ if (_activeMenu->disabledButtons & (1<<buttonIndex))
+ buttonIndex = -1;
+ }
-String Graphics::tmpFunction(int choiceIndex, int var, String *headerTextOutput) {
- if (headerTextOutput != nullptr)
- *headerTextOutput = "Speaker ";
+ if (buttonIndex != _activeMenu->selectedButton) {
+ if (_activeMenu->selectedButton != -1) {
+ Sprite &spr = _activeMenu->sprites[_activeMenu->selectedButton];
+ drawMenuButtonOutline(spr.bitmap, 0x00);
+ spr.bitmapChanged = true;
+ }
+ if (buttonIndex != -1) {
+ Sprite &spr = _activeMenu->sprites[buttonIndex];
+ drawMenuButtonOutline(spr.bitmap, 0xda);
+ spr.bitmapChanged = true;
+ }
+ _activeMenu->selectedButton = buttonIndex;
+ }
+ // Not added: updating mouse position (scummvm handles that)
+
+ // sub_10492();
+ // sub_10A91();
+ drawAllSprites();
+ // sub_10BE7();
+ // sub_2A4B1();
+
+ if (_word_4B422 != 0) {
+ _word_4B422 = 0;
+ if (_textboxVar1 != 0) {
+ return TEXTEVENT_SPEECH_DONE;
+ }
+ }
+ // sub_1E88C();
+ _textboxVar3++;
- if (choiceIndex >= 1)
- return NULL;
- return "Text test";
+ if (ticksUntilClickingEnabled != 0 && _vm->_clockTicks >= tickWhenClickingEnabled)
+ return TEXTEVENT_ENABLEINPUT;
+ break;
+ }
+
+ case TREKEVENT_LBUTTONDOWN:
+ if (_activeMenu->selectedButton != -1) {
+ _vm->playSound(0x10);
+ return _activeMenu->retvals[_activeMenu->selectedButton];
+ }
+ else {
+ Common::Point mouse = getMousePos();
+ if (getMenuButtonAt(*_activeMenu, mouse.x, mouse.y) == -1) {
+ _vm->playSound(0x10);
+ return TEXTEVENT_LCLICK_OFFBUTTON;
+ }
+ }
+ break;
+
+ case TREKEVENT_RBUTTONDOWN:
+ // TODO
+ break;
+
+ case TREKEVENT_KEYDOWN:
+ // TODO
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
}
-String Graphics::readTextFromRdf(int choiceIndex, int rdfVar, String *headerTextOutput) {
+/**
+ * Text getter for showText which reads from an rdf file.
+ */
+String Graphics::readTextFromRdf(int choiceIndex, void *data, String *headerTextOutput) {
Room *room = _vm->getRoom();
- // FIXME: in original game "rdfVar" is a pointer to the variable holding the offset.
- // Currently treating it as the offset itself.
+ int rdfVar = *(int*)data;
+
uint16 textOffset = room->readRdfWord(rdfVar + (choiceIndex+1)*2);
if (textOffset == 0)
@@ -309,6 +385,20 @@ String Graphics::readTextFromRdf(int choiceIndex, int rdfVar, String *headerText
}
/**
+ * Text getter for showText which reads from a given buffer.
+ */
+String Graphics::readTextFromBuffer(int choiceIndex, void *data, String *headerTextOutput) {
+ char buf[TEXTBOX_WIDTH];
+ memcpy(buf, data, TEXTBOX_WIDTH-2);
+ buf[TEXTBOX_WIDTH-2] = '\0';
+
+ *headerTextOutput = String(buf);
+
+ char *text = (char*)data+TEXTBOX_WIDTH-2;
+ return String(text);
+}
+
+/**
* Creates a blank textbox in a TextBitmap, and initializes a sprite to use it.
*/
SharedPtr<TextBitmap> Graphics::initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite) {
@@ -407,7 +497,6 @@ void Graphics::drawMainText(SharedPtr<TextBitmap> bitmap, int numTextLines, int
lineIndex++;
}
- debug("%d, %d\n", numTextLines, numTextboxLines);
// Fill all remaining blank lines
while (lineIndex != numTextboxLines) {
memset(dest, ' ', TEXTBOX_WIDTH-2);
@@ -448,15 +537,15 @@ void Graphics::getTextboxHeader(String *headerTextOutput, String speakerText, in
String Graphics::readLineFormattedText(TextGetterFunc textGetter, int var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numTextLines) {
String headerText;
- String text = (this->*textGetter)(choiceIndex, var, &headerText);
+ String text = (this->*textGetter)(choiceIndex, &var, &headerText);
- if (_textboxVar1 == 2 && _textboxVar5 == 1 && _textboxVar4 == 1) {
+ if (_textboxVar1 == 2 && _vm->_cdAudioEnabled && _vm->_textboxVar4) {
uint32 oldSize = text.size();
text = playTextAudio(text);
if (oldSize != text.size())
_textboxHasMultipleChoices = true;
}
- else if ((_textboxVar1 == 0 || _textboxVar1 == 1) && _textboxVar5 == 1 && _textboxVar4 == 1) {
+ else if ((_textboxVar1 == 0 || _textboxVar1 == 1) && _vm->_cdAudioEnabled && _vm->_textboxVar4) {
text = playTextAudio(text);
}
else {
@@ -598,6 +687,58 @@ String Graphics::playTextAudio(const String &str) {
return skipTextAudioPrompt(str);
}
+/**
+ * Returns the index of the button at the given position, or -1 if none.
+ */
+int Graphics::getMenuButtonAt(const Menu &menu, int x, int y) {
+ for (int i=0; i<menu.numButtons; i++) {
+ const Sprite &spr = menu.sprites[i];
+
+ if (spr.drawMode != 2)
+ continue;
+
+ int left = spr.pos.x - spr.bitmap->xoffset;
+ int top = spr.pos.y - spr.bitmap->yoffset;
+
+ // Oddly, this doesn't account for x/yoffset...
+ int right = spr.pos.x + spr.bitmap->width - 1;
+ int bottom = spr.pos.y + spr.bitmap->height - 1;
+
+ if (x >= left && x <= right && y >= top && y <= bottom)
+ return i;
+ }
+
+ return -1;
+}
+
+/**
+ * Draws or removes the outline on menu buttons when the cursor hovers on them, or leaves
+ * them.
+ */
+void Graphics::drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color) {
+ int lineWidth = bitmap->width-2;
+ int offsetToBottom = (bitmap->height-3)*bitmap->width;
+
+ byte *dest = bitmap->pixels + bitmap->width + 1;
+
+ while (lineWidth--) {
+ *dest = color;
+ *(dest+offsetToBottom) = color;
+ dest++;
+ }
+
+ int lineHeight = bitmap->height - 2;
+ int offsetToRight = bitmap->width - 3;
+
+ dest = bitmap->pixels + bitmap->width + 1;
+
+ while (lineHeight--) {
+ *dest = color;
+ *(dest+offsetToRight) = color;
+ dest += bitmap->width;
+ }
+}
+
void Graphics::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
SharedPtr<Menu> oldMenu = _activeMenu;
_activeMenu = SharedPtr<Menu>(new Menu());
@@ -629,6 +770,16 @@ void Graphics::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
_activeMenu->sprites[i].field6 = 8;
}
+
+ if (_activeMenu->retvals[_activeMenu->numButtons-1] == 0) {
+ // Set default retvals for buttons
+ for (int i=0; i<_activeMenu->numButtons; i++)
+ _activeMenu->retvals[i] = i;
+ }
+
+ _activeMenu->selectedButton = -1;
+ _activeMenu->disabledButtons = 0;
+ _textboxButtonVar4 = 0;
}
// 0x0002: Disable scroll up
Commit: 9c2ed1d9b72036b1d1a052b1a4826cc8402bbb21
https://github.com/scummvm/scummvm/commit/9c2ed1d9b72036b1d1a052b1a4826cc8402bbb21
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement sound effects in the midis
Removed amiga and mac sound code for now since I can't test it.
Changed paths:
engines/startrek/sound.cpp
engines/startrek/sound.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 5191fc4..4363162 100755
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -17,10 +17,6 @@
* 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.
- *
- * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/sound.cpp $
- * $Id: sound.cpp 15 2010-06-27 06:13:42Z clone2727 $
- *
*/
#include "startrek/sound.h"
@@ -37,38 +33,78 @@ namespace StarTrek {
Sound::Sound(StarTrekEngine *vm) : _vm(vm) {
if (_vm->getPlatform() == Common::kPlatformDOS || _vm->getPlatform() == Common::kPlatformMacintosh) {
- // The main PC versions use XMIDI. ST25 Demo and Macintosh versions use SMF.
- if ((_vm->getGameType() == GType_ST25 && _vm->getFeatures() & GF_DEMO) || _vm->getPlatform() == Common::kPlatformMacintosh)
- _midiParser = MidiParser::createParser_SMF();
- else
- _midiParser = MidiParser::createParser_XMIDI();
-
_midiDevice = MidiDriver::detectDevice(MDT_PCSPK|MDT_ADLIB|MDT_MIDI);
_midiDriver = MidiDriver::createMidi(_midiDevice);
_midiDriver->open();
- _midiParser->setMidiDriver(_midiDriver);
- _midiParser->setTimerRate(_midiDriver->getBaseTempo());
- }
+ _midiDriver->setTimerCallback(this, Sound::midiDriverCallback);
- if (_vm->getPlatform() == Common::kPlatformMacintosh) {
- _macAudioResFork = new Common::MacResManager();
- if (!_macAudioResFork->open("Star Trek Audio"))
- error("Could not open 'Star Trek Audio'");
- assert(_macAudioResFork->hasResFork());
- } else
- _macAudioResFork = 0;
+ for (int i=0; i<8; i++) {
+ _midiSlots[i].slot = i;
+ _midiSlots[i].track = -1;
+
+ // The main PC versions use XMIDI. ST25 Demo and Macintosh versions use SMF.
+ if ((_vm->getGameType() == GType_ST25 && _vm->getFeatures() & GF_DEMO) || _vm->getPlatform() == Common::kPlatformMacintosh)
+ _midiSlots[i].midiParser = MidiParser::createParser_SMF();
+ else
+ _midiSlots[i].midiParser = MidiParser::createParser_XMIDI();
+
+ _midiSlots[i].midiParser->setMidiDriver(_midiDriver);
+ _midiSlots[i].midiParser->setTimerRate(_midiDriver->getBaseTempo());
+ }
+ }
_soundHandle = new Audio::SoundHandle();
+ loadedSoundData = nullptr;
+
+ for (int i=1; i<8; i++) {
+ _sfxSlotList.push_back(&_midiSlots[i]);
+ }
}
Sound::~Sound() {
- delete _midiParser;
+ for (int i=0; i<8; i++)
+ delete _midiSlots[i].midiParser;
delete _midiDriver;
delete _soundHandle;
- delete _macAudioResFork;
+ delete[] loadedSoundData;
+}
+
+
+void Sound::playMidiTrack(int track) {
+ if (!_vm->_midiAudioEnabled)
+ return;
+ /*
+ if (!_vm->_word_467a8)
+ return;
+ */
+
+ assert(loadedSoundData != NULL);
+
+ // Check if a midi slot for this track exists already
+ for (int i=1; i<8; i++) {
+ if (_midiSlots[i].track == track) {
+ _midiSlots[i].midiParser->loadMusic(loadedSoundData, sizeof(loadedSoundData));
+ _midiSlots[i].midiParser->setTrack(track);
+
+ // Shift this to the back (most recently used)
+ _sfxSlotList.remove(&_midiSlots[i]);
+ _sfxSlotList.push_back(&_midiSlots[i]);
+ return;
+ }
+ }
+
+ // Take the least recently used slot and use that for the sound effect
+ MidiSlot *slot = _sfxSlotList.front();
+ _sfxSlotList.pop_front();
+ _sfxSlotList.push_back(slot);
+ slot->track = track;
+ slot->midiParser->loadMusic(loadedSoundData, sizeof(loadedSoundData));
+ slot->midiParser->setTrack(track);
}
-void Sound::playSound(const char *baseSoundName) {
+void Sound::loadMusicFile(const char *baseSoundName) {
+ clearAllMidiSlots();
+ /*
if (_vm->getPlatform() == Common::kPlatformAmiga)
playAmigaSound(baseSoundName);
else if (_vm->getPlatform() == Common::kPlatformMacintosh)
@@ -76,115 +112,78 @@ void Sound::playSound(const char *baseSoundName) {
else if (_vm->getFeatures() & GF_DEMO)
playSMFSound(baseSoundName);
else
- playXMIDISound(baseSoundName);
+ */
+ loadPCMusicFile(baseSoundName);
}
void Sound::playSoundEffect(const char *baseSoundName) {
+ /*
if (_vm->getPlatform() == Common::kPlatformAmiga)
playAmigaSoundEffect(baseSoundName);
else if (_vm->getPlatform() == Common::kPlatformMacintosh)
playMacSoundEffect(baseSoundName);
else
- error("PC Sound Effects Not Supported");
+ */
+ error("PC Sound Effects Not Supported");
}
// PC Functions
-void Sound::playSMFSound(const char *baseSoundName) {
- Common::String soundName = baseSoundName;
-
- soundName += '.';
-
- switch (MidiDriver::getMusicType(_midiDevice)) {
- case MT_MT32:
- soundName += "ROL";
- break;
- case MT_PCSPK:
- return; // Not supported...
- default:
- soundName += "ADL";
- break;
- }
-
- debug(0, "Playing sound \'%s\'\n", soundName.c_str());
- SharedPtr<Common::SeekableReadStream> soundStream = _vm->openFile(soundName.c_str());
-
- byte *soundData = (byte *)malloc(soundStream->size());
- soundStream->read(soundData, soundStream->size());
- _midiParser->loadMusic(soundData, soundStream->size());
-
- _midiDriver->setTimerCallback(_midiParser, MidiParser::timerCallback);
-}
-void Sound::playXMIDISound(const char *baseSoundName) {
+// XMIDI or SM sound
+void Sound::loadPCMusicFile(const char *baseSoundName) {
Common::String soundName = baseSoundName;
soundName += '.';
switch (MidiDriver::getMusicType(_midiDevice)) {
case MT_MT32:
- soundName += "MT";
+ if (_vm->getFeatures() & GF_DEMO)
+ soundName += "ROL";
+ else
+ soundName += "MT";
break;
case MT_PCSPK:
- soundName += "PC";
+ if (_vm->getFeatures() & GF_DEMO)
+ return; // Not supported...
+ else
+ soundName += "PC";
break;
default:
- soundName += "AD";
+ if (_vm->getFeatures() & GF_DEMO)
+ soundName += "ADL";
+ else
+ soundName += "AD";
break;
}
debug(0, "Playing sound \'%s\'\n", soundName.c_str());
SharedPtr<Common::SeekableReadStream> soundStream = _vm->openFile(soundName.c_str());
- byte *soundData = (byte *)malloc(soundStream->size());
- soundStream->read(soundData, soundStream->size());
- _midiParser->loadMusic(soundData, soundStream->size());
-
- _midiDriver->setTimerCallback(_midiParser, MidiParser::timerCallback);
+ if (loadedSoundData != nullptr)
+ delete[] loadedSoundData;
+ loadedSoundData = new byte[soundStream->size()];
+ soundStream->read(loadedSoundData, soundStream->size());
+ _midiSlots[0].midiParser->loadMusic(loadedSoundData, soundStream->size());
}
-// Amiga Functions
-
-void Sound::playAmigaSound(const char *baseSoundName) {
- // Nope, this is wrong... see http://protracker.de/files/amiga/formats/theplayer_41_format.txt
-#if 0
- Common::String soundName = baseSoundName;
- soundName += ".SNG";
- if (_vm->_mixer->isSoundHandleActive(*_soundHandle))
- _vm->_mixer->stopHandle(*_soundHandle);
- _vm->_mixer->playInputStream(Audio::Mixer::kMusicSoundType, _soundHandle, Audio::makeProtrackerStream(_vm->openFile(soundName.c_str())));
-#endif
+void Sound::clearMidiSlot(int slot) {
+ _midiSlots[slot].midiParser->stopPlaying();
+ _midiSlots[slot].midiParser->unloadMusic();
+ _midiSlots[slot].track = -1;
}
-void Sound::playAmigaSoundEffect(const char *baseSoundName) {
- Common::String soundName = baseSoundName;
- soundName += ".SFX";
-
- if (_vm->_mixer->isSoundHandleActive(*_soundHandle))
- _vm->_mixer->stopHandle(*_soundHandle);
-
- Audio::AudioStream *audStream = (Audio::AudioStream *)Audio::makeRawStream(_vm->openFile(soundName.c_str()).get(), 11025, 0);
- _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, _soundHandle, audStream);
+void Sound::clearAllMidiSlots() {
+ for (int i=0; i<8; i++) {
+ clearMidiSlot(i);
+ }
}
-// Macintosh Functions
-
-void Sound::playMacSMFSound(const char *baseSoundName) {
- Common::SeekableReadStream *soundStream = _macAudioResFork->getResource(baseSoundName);
- byte *soundData = (byte *)malloc(soundStream->size());
- soundStream->read(soundData, soundStream->size());
- _midiParser->loadMusic(soundData, soundStream->size());
- delete soundStream;
-
- _midiDriver->setTimerCallback(_midiParser, MidiParser::timerCallback);
+void Sound::midiDriverCallback(void *data) {
+ Sound *s = (Sound*)data;
+ for (int i=0; i<8; i++)
+ s->_midiSlots[i].midiParser->onTimer();
}
-void Sound::playMacSoundEffect(const char *baseSoundName) {
- if (_vm->_mixer->isSoundHandleActive(*_soundHandle))
- _vm->_mixer->stopHandle(*_soundHandle);
-
- Audio::AudioStream *audStream = (Audio::AudioStream *)Audio::makeRawStream(_macAudioResFork->getResource(baseSoundName), 11025, 0);
- _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, _soundHandle, audStream);
-}
} // End of namespace StarTrek
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
index f8f9b88..f314f2c 100755
--- a/engines/startrek/sound.h
+++ b/engines/startrek/sound.h
@@ -40,35 +40,42 @@ namespace StarTrek {
class StarTrekEngine;
+
+struct MidiSlot {
+ int slot;
+ int track;
+ MidiParser *midiParser;
+};
+
class Sound {
public:
Sound(StarTrekEngine *vm);
~Sound();
- void playSound(const char *baseSoundName);
- void playSoundEffect(const char *baseSoundName);
+ void playMidiTrack(int track);
+
+ void loadMusicFile(const char *baseSoundName);
+ void playSoundEffect(const char *baseSoundName);
private:
StarTrekEngine *_vm;
Audio::SoundHandle *_soundHandle;
- // PC Sound Functions
- void playXMIDISound(const char *baseSoundName);
- void playSMFSound(const char *baseSoundName);
-
- // Macintosh Sound Functions
- void playMacSMFSound(const char *baseSoundName);
- void playMacSoundEffect(const char *baseSoundName);
- Common::MacResManager *_macAudioResFork;
-
- // Amiga Sound Functions
- void playAmigaSound(const char *baseSoundName);
- void playAmigaSoundEffect(const char *baseSoundName);
+ void loadPCMusicFile(const char *baseSoundName);
+ void clearMidiSlot(int slot);
+ void clearAllMidiSlots();
// MIDI-Related Variables
- MidiParser *_midiParser;
MidiDriver *_midiDriver;
+ MidiSlot _midiSlots[8]; // 0 is for music; 1-7 are for sfx
+ Common::List<MidiSlot*> _sfxSlotList; // Sorts midi slots by most recently used
+
+ byte *loadedSoundData;
uint32 _midiDevice;
+
+
+ // Driver callback
+ static void midiDriverCallback(void *data);
};
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 1b333b9..dba8a48 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -101,14 +101,7 @@ Common::Error StarTrekEngine::run() {
_gfx->loadPri("DEMON0.PRI");
_gfx->redrawScreen();
- if (getPlatform() == Common::kPlatformAmiga)
- _sound->playSoundEffect("TREK2");
- else if (getPlatform() == Common::kPlatformMacintosh)
- _sound->playSound("title 2");
- else if (getFeatures() & GF_DEMO)
- _sound->playSound("STTITLE");
- else
- _sound->playSound("TITLE");
+ _sound->loadMusicFile("BRIDGEW");
} else {
_gfx->drawBackgroundImage("BRIDGE.BGD");
}
@@ -197,8 +190,56 @@ void StarTrekEngine::pollSystemEvents() {
_system->delayMillis(1000/60);
}
-void StarTrekEngine::playSound(int id) {
- // TODO
+void StarTrekEngine::playSoundEffectIndex(int index) {
+ switch(index-4) {
+ case 0:
+ _sound->playSoundEffect("tricorde");
+ break;
+ case 1:
+ _sound->playSoundEffect("STDOOR1");
+ break;
+ case 2:
+ _sound->playSoundEffect("PHASSHOT");
+ break;
+ case 3:
+ _sound->playMidiTrack(index);
+ break;
+ case 4:
+ _sound->playSoundEffect("TRANSDEM");
+ break;
+ case 5:
+ _sound->playSoundEffect("TRANSMAT");
+ break;
+ case 6:
+ _sound->playSoundEffect("TRANSENE");
+ break;
+ case 0x0c: // Menu selection sound
+ _sound->playMidiTrack(index);
+ break;
+ case 0x1e:
+ _sound->playSoundEffect("HAILING");
+ break;
+ case 0x20:
+ _sound->playSoundEffect("PHASSHOT");
+ break;
+ case 0x21:
+ _sound->playSoundEffect("PHOTSHOT");
+ break;
+ case 0x22:
+ _sound->playSoundEffect("HITSHIEL");
+ break;
+ case 0x23:
+ _sound->playMidiTrack(index);
+ break;
+ case 0x24:
+ _sound->playSoundEffect("REDALERT");
+ break;
+ case 0x25:
+ _sound->playSoundEffect("WARP");
+ break;
+ default:
+ break;
+ }
}
void StarTrekEngine::updateClockTicks() {
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index a0b97b9..c190659 100755
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -91,7 +91,7 @@ public:
Room *getRoom();
void pollSystemEvents();
- void playSound(int id); // TODO: rename, figure out what it is
+ void playSoundEffectIndex(int index);
// Events
public:
@@ -137,6 +137,8 @@ public:
bool _midiAudioEnabled;
bool _cdAudioEnabled;
+ uint16 _word_467a6;
+ uint16 _word_467a8;
bool _textboxVar4;
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 6ac31b0..fe2f0ee 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -328,13 +328,13 @@ int Graphics::handleTextboxEvents(uint32 ticksUntilClickingEnabled, bool arg4) {
case TREKEVENT_LBUTTONDOWN:
if (_activeMenu->selectedButton != -1) {
- _vm->playSound(0x10);
+ _vm->playSoundEffectIndex(0x10);
return _activeMenu->retvals[_activeMenu->selectedButton];
}
else {
Common::Point mouse = getMousePos();
if (getMenuButtonAt(*_activeMenu, mouse.x, mouse.y) == -1) {
- _vm->playSound(0x10);
+ _vm->playSoundEffectIndex(0x10);
return TEXTEVENT_LCLICK_OFFBUTTON;
}
}
Commit: f43c5d468784b72c92e557c83b22c9c34f8ce497
https://github.com/scummvm/scummvm/commit/f43c5d468784b72c92e557c83b22c9c34f8ce497
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement CD Audio handling.
Changed paths:
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/sound.cpp
engines/startrek/sound.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 029928d..ed4113d 100755
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -49,6 +49,7 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_backgroundImage = new Bitmap(_vm->openFile("DEMON0.BMP").get());
_numSprites = 0;
+ _textboxVar1 = 2;
CursorMan.showMouse(true);
}
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 578abdf..47a0fbf 100755
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -153,7 +153,6 @@ private:
SharedPtr<Menu> _activeMenu;
uint16 _textboxButtonVar4;
- uint16 _word_4B422;
};
}
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 4363162..32b3190 100755
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -24,8 +24,10 @@
#include "common/file.h"
#include "common/macresman.h"
-#include "audio/mods/protracker.h"
+#include "audio/audiostream.h"
#include "audio/decoders/raw.h"
+#include "audio/decoders/voc.h"
+#include "audio/mods/protracker.h"
namespace StarTrek {
@@ -59,6 +61,12 @@ Sound::Sound(StarTrekEngine *vm) : _vm(vm) {
for (int i=1; i<8; i++) {
_sfxSlotList.push_back(&_midiSlots[i]);
}
+
+ if (!SearchMan.hasFile("voc/speech.mrk")) {
+ error("Couldn't find 'voc/speech.mrk'. The 'trekcd/voc/' directory must be dumped from the CD");
+ }
+
+ _playingSpeech = false;
}
Sound::~Sound() {
@@ -71,7 +79,7 @@ Sound::~Sound() {
void Sound::playMidiTrack(int track) {
- if (!_vm->_midiAudioEnabled)
+ if (!_vm->_musicEnabled)
return;
/*
if (!_vm->_word_467a8)
@@ -94,7 +102,7 @@ void Sound::playMidiTrack(int track) {
}
// Take the least recently used slot and use that for the sound effect
- MidiSlot *slot = _sfxSlotList.front();
+ MidiPlaybackSlot *slot = _sfxSlotList.front();
_sfxSlotList.pop_front();
_sfxSlotList.push_back(slot);
slot->track = track;
@@ -124,10 +132,75 @@ void Sound::playSoundEffect(const char *baseSoundName) {
playMacSoundEffect(baseSoundName);
else
*/
- error("PC Sound Effects Not Supported");
+ if (scumm_stricmp(baseSoundName+4, "loop") == 0)
+ _loopingAudioName = Common::String(baseSoundName);
+
+ if (!_vm->_sfxEnabled || !_vm->_audioEnabled)
+ return;
+
+ /*
+ if (word_5113a == 0)
+ sub_2aaa3();
+ */
+
+ for (int i=0; i<MAX_SFX_PLAYING; i++) {
+ if (_vm->_system->getMixer()->isSoundHandleActive(_sfxHandles[i]))
+ continue;
+
+ Common::String soundName = Common::String("voc/sfx/") + baseSoundName + ".voc";
+ Common::SeekableReadStream *readStream = SearchMan.createReadStreamForMember(soundName);
+ if (readStream == nullptr)
+ error("Couldn't open '%s'", soundName.c_str());
+
+ Audio::AudioStream *audioStream = Audio::makeVOCStream(readStream, Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);
+ _vm->_system->getMixer()->playStream(Audio::Mixer::kSFXSoundType, &_sfxHandles[i], audioStream);
+ return;
+ }
}
-// PC Functions
+void Sound::playSpeech(const Common::String &basename) {
+ stopPlayingSpeech();
+
+ Audio::QueuingAudioStream *audioQueue = nullptr;
+ Common::String name = basename;
+
+ // Play a list of comma-separated audio files in sequence (usually there's only one)
+ while (!name.empty()) {
+ uint i = 0;
+ while (i < name.size() && name[i] != ',') {
+ if (name[i] == '\\')
+ name.setChar('/', i);
+ i++;
+ }
+
+ Common::String filename = "voc/" + Common::String(name.c_str(), name.c_str()+i) + ".voc";
+ debug("Playing speech '%s'", filename.c_str());
+ Common::SeekableReadStream *readStream = SearchMan.createReadStreamForMember(filename);
+ if (readStream == nullptr)
+ error("Couldn't open '%s'", filename.c_str());
+
+ Audio::AudioStream *audioStream = Audio::makeVOCStream(readStream, Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);
+ if (audioQueue == nullptr)
+ audioQueue = Audio::makeQueuingAudioStream(audioStream->getRate(), audioStream->isStereo());
+ audioQueue->queueAudioStream(audioStream, DisposeAfterUse::YES);
+
+ name.erase(0,i+1);
+ }
+
+ if (audioQueue != nullptr) {
+ audioQueue->finish();
+ _vm->_system->getMixer()->playStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, audioQueue);
+ }
+
+ _playingSpeech = true;
+}
+
+void Sound::stopPlayingSpeech() {
+ if (_playingSpeech) {
+ _playingSpeech = false;
+ _vm->_system->getMixer()->stopHandle(_speechHandle);
+ }
+}
// XMIDI or SM sound
@@ -179,10 +252,17 @@ void Sound::clearAllMidiSlots() {
}
}
+// Static callback method
void Sound::midiDriverCallback(void *data) {
Sound *s = (Sound*)data;
for (int i=0; i<8; i++)
s->_midiSlots[i].midiParser->onTimer();
+
+ // TODO: put this somewhere other than the midi callback...
+ if (s->_playingSpeech && !s->_vm->_system->getMixer()->isSoundHandleActive(s->_speechHandle)) {
+ s->stopPlayingSpeech();
+ s->_vm->_finishedPlayingSpeech = true;
+ }
}
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
index f314f2c..a911662 100755
--- a/engines/startrek/sound.h
+++ b/engines/startrek/sound.h
@@ -41,12 +41,16 @@ namespace StarTrek {
class StarTrekEngine;
-struct MidiSlot {
+const int MAX_LOADED_SFX_FILES = 8;
+const int MAX_SFX_PLAYING = 4;
+
+struct MidiPlaybackSlot {
int slot;
int track;
MidiParser *midiParser;
};
+
class Sound {
public:
Sound(StarTrekEngine *vm);
@@ -56,6 +60,8 @@ public:
void loadMusicFile(const char *baseSoundName);
void playSoundEffect(const char *baseSoundName);
+ void playSpeech(const Common::String &basename);
+ void stopPlayingSpeech();
private:
StarTrekEngine *_vm;
@@ -67,12 +73,17 @@ private:
// MIDI-Related Variables
MidiDriver *_midiDriver;
- MidiSlot _midiSlots[8]; // 0 is for music; 1-7 are for sfx
- Common::List<MidiSlot*> _sfxSlotList; // Sorts midi slots by most recently used
+ MidiPlaybackSlot _midiSlots[8]; // 0 is for music; 1-7 are for sfx
+ Common::List<MidiPlaybackSlot*> _sfxSlotList; // Sorts midi slots by most recently used
byte *loadedSoundData;
uint32 _midiDevice;
+ // VOC-related variables
+ Common::String _loopingAudioName;
+ Audio::SoundHandle _sfxHandles[MAX_SFX_PLAYING];
+ Audio::SoundHandle _speechHandle;
+ bool _playingSpeech;
// Driver callback
static void midiDriverCallback(void *data);
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index dba8a48..d888d1f 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -42,8 +42,11 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_gfx = nullptr;
_sound = nullptr;
_macResFork = nullptr;
-
_room = nullptr;
+
+ _audioEnabled = true;
+ _musicEnabled = true;
+ _sfxEnabled = true;
}
StarTrekEngine::~StarTrekEngine() {
@@ -55,9 +58,6 @@ StarTrekEngine::~StarTrekEngine() {
}
Common::Error StarTrekEngine::run() {
- _cdAudioEnabled = true;
- _midiAudioEnabled = true;
-
_gfx = new Graphics(this);
_sound = new Sound(this);
@@ -101,7 +101,7 @@ Common::Error StarTrekEngine::run() {
_gfx->loadPri("DEMON0.PRI");
_gfx->redrawScreen();
- _sound->loadMusicFile("BRIDGEW");
+ _sound->loadMusicFile("GROUND");
} else {
_gfx->drawBackgroundImage("BRIDGE.BGD");
}
@@ -191,50 +191,50 @@ void StarTrekEngine::pollSystemEvents() {
}
void StarTrekEngine::playSoundEffectIndex(int index) {
- switch(index-4) {
- case 0:
+ switch(index) {
+ case 0x04:
_sound->playSoundEffect("tricorde");
break;
- case 1:
+ case 0x05:
_sound->playSoundEffect("STDOOR1");
break;
- case 2:
+ case 0x06:
_sound->playSoundEffect("PHASSHOT");
break;
- case 3:
+ case 0x07:
_sound->playMidiTrack(index);
break;
- case 4:
+ case 0x08:
_sound->playSoundEffect("TRANSDEM");
break;
- case 5:
+ case 0x09:
_sound->playSoundEffect("TRANSMAT");
break;
- case 6:
+ case 0x0a:
_sound->playSoundEffect("TRANSENE");
break;
- case 0x0c: // Menu selection sound
+ case 0x10: // Menu selection sound
_sound->playMidiTrack(index);
break;
- case 0x1e:
+ case 0x22:
_sound->playSoundEffect("HAILING");
break;
- case 0x20:
+ case 0x24:
_sound->playSoundEffect("PHASSHOT");
break;
- case 0x21:
+ case 0x25:
_sound->playSoundEffect("PHOTSHOT");
break;
- case 0x22:
+ case 0x26:
_sound->playSoundEffect("HITSHIEL");
break;
- case 0x23:
+ case 0x27:
_sound->playMidiTrack(index);
break;
- case 0x24:
+ case 0x28:
_sound->playSoundEffect("REDALERT");
break;
- case 0x25:
+ case 0x29:
_sound->playSoundEffect("WARP");
break;
default:
@@ -242,6 +242,14 @@ void StarTrekEngine::playSoundEffectIndex(int index) {
}
}
+void StarTrekEngine::playSpeech(const Common::String &filename) {
+ _sound->playSpeech(filename.c_str());
+}
+
+void StarTrekEngine::stopPlayingSpeech() {
+ _sound->stopPlayingSpeech();
+}
+
void StarTrekEngine::updateClockTicks() {
// TODO (based on DOS interrupt 1A, AH=0; read system clock counter)
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index c190659..232482a 100755
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -92,6 +92,8 @@ public:
void pollSystemEvents();
void playSoundEffectIndex(int index);
+ void playSpeech(const Common::String &filename);
+ void stopPlayingSpeech();
// Events
public:
@@ -135,11 +137,12 @@ public:
uint32 _clockTicks;
- bool _midiAudioEnabled;
- bool _cdAudioEnabled;
+ bool _musicEnabled;
+ bool _sfxEnabled;
uint16 _word_467a6;
uint16 _word_467a8;
- bool _textboxVar4;
+ bool _audioEnabled;
+ bool _finishedPlayingSpeech;
private:
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index fe2f0ee..2d875da 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -88,12 +88,12 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
int choiceIndex = 0;
int scrollOffset = 0;
if (tmpTextboxVar1 != 0 && tmpTextboxVar1 != 1 && numChoices == 1
- && _vm->_cdAudioEnabled && !_vm->_textboxVar4)
+ && _vm->_sfxEnabled && !_vm->_audioEnabled)
_textboxHasMultipleChoices = false;
else
_textboxHasMultipleChoices = true;
- if (tmpTextboxVar1 >= 0 && tmpTextboxVar1 <= 2 && _vm->_cdAudioEnabled && !_vm->_textboxVar4)
+ if (tmpTextboxVar1 >= 0 && tmpTextboxVar1 <= 2 && _vm->_sfxEnabled && !_vm->_audioEnabled)
_textboxVar6 = true;
else
_textboxVar6 = false;
@@ -268,7 +268,7 @@ reloadText:
}
_textboxVar2 = _textboxVar3;
- // sub_29EE3();
+ _vm->stopPlayingSpeech();
return choiceIndex;
}
@@ -312,8 +312,8 @@ int Graphics::handleTextboxEvents(uint32 ticksUntilClickingEnabled, bool arg4) {
// sub_10BE7();
// sub_2A4B1();
- if (_word_4B422 != 0) {
- _word_4B422 = 0;
+ if (_vm->_finishedPlayingSpeech != 0) {
+ _vm->_finishedPlayingSpeech = 0;
if (_textboxVar1 != 0) {
return TEXTEVENT_SPEECH_DONE;
}
@@ -539,13 +539,13 @@ String Graphics::readLineFormattedText(TextGetterFunc textGetter, int var, int c
String headerText;
String text = (this->*textGetter)(choiceIndex, &var, &headerText);
- if (_textboxVar1 == 2 && _vm->_cdAudioEnabled && _vm->_textboxVar4) {
+ if (_textboxVar1 == 2 && _vm->_sfxEnabled && _vm->_audioEnabled) {
uint32 oldSize = text.size();
text = playTextAudio(text);
if (oldSize != text.size())
_textboxHasMultipleChoices = true;
}
- else if ((_textboxVar1 == 0 || _textboxVar1 == 1) && _vm->_cdAudioEnabled && _vm->_textboxVar4) {
+ else if ((_textboxVar1 == 0 || _textboxVar1 == 1) && _vm->_sfxEnabled && _vm->_audioEnabled) {
text = playTextAudio(text);
}
else {
@@ -682,9 +682,29 @@ String Graphics::skipTextAudioPrompt(const String &str) {
return String(text+1);
}
+/**
+ * Plays an audio prompt, if it exists, and returns the string starting at the end of the
+ * prompt.
+ */
String Graphics::playTextAudio(const String &str) {
- // TODO
- return skipTextAudioPrompt(str);
+ const char *text = str.c_str();
+ char soundFile[0x100];
+
+ if (*text != '#')
+ return str;
+
+ int len = 0;
+ text++;
+ while (*text != '#') {
+ if (*text == '\0' || len > 0xfa)
+ return str;
+ soundFile[len++] = *text++;
+ }
+
+ soundFile[len] = '\0';
+ _vm->playSpeech(soundFile);
+
+ return String(text+1);
}
/**
Commit: 69dac4d62d8179d0692476efe980934e51bda9ac
https://github.com/scummvm/scummvm/commit/69dac4d62d8179d0692476efe980934e51bda9ac
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Add debug channel for sound
Changed paths:
engines/startrek/sound.cpp
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 32b3190..7b16c28 100755
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -88,6 +88,8 @@ void Sound::playMidiTrack(int track) {
assert(loadedSoundData != NULL);
+ debugC(6, kDebugSound, "Playing MIDI track %d", track);
+
// Check if a midi slot for this track exists already
for (int i=1; i<8; i++) {
if (_midiSlots[i].track == track) {
@@ -152,10 +154,13 @@ void Sound::playSoundEffect(const char *baseSoundName) {
if (readStream == nullptr)
error("Couldn't open '%s'", soundName.c_str());
+ debugC(5, kDebugSound, "Playing sound effect '%s'", baseSoundName);
Audio::AudioStream *audioStream = Audio::makeVOCStream(readStream, Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);
_vm->_system->getMixer()->playStream(Audio::Mixer::kSFXSoundType, &_sfxHandles[i], audioStream);
return;
}
+
+ debugC(3, kDebugSound, "No sound slot to play '%s'", baseSoundName);
}
void Sound::playSpeech(const Common::String &basename) {
@@ -174,7 +179,7 @@ void Sound::playSpeech(const Common::String &basename) {
}
Common::String filename = "voc/" + Common::String(name.c_str(), name.c_str()+i) + ".voc";
- debug("Playing speech '%s'", filename.c_str());
+ debugC(5, kDebugSound, "Playing speech '%s'", filename.c_str());
Common::SeekableReadStream *readStream = SearchMan.createReadStreamForMember(filename);
if (readStream == nullptr)
error("Couldn't open '%s'", filename.c_str());
@@ -197,6 +202,7 @@ void Sound::playSpeech(const Common::String &basename) {
void Sound::stopPlayingSpeech() {
if (_playingSpeech) {
+ debugC(5, kDebugSound, "Canceled speech playback");
_playingSpeech = false;
_vm->_system->getMixer()->stopHandle(_speechHandle);
}
@@ -230,7 +236,7 @@ void Sound::loadPCMusicFile(const char *baseSoundName) {
break;
}
- debug(0, "Playing sound \'%s\'\n", soundName.c_str());
+ debugC(5, kDebugSound, "Loading midi \'%s\'\n", soundName.c_str());
SharedPtr<Common::SeekableReadStream> soundStream = _vm->openFile(soundName.c_str());
if (loadedSoundData != nullptr)
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index d888d1f..e25d427 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -24,6 +24,7 @@
#include "base/version.h"
#include "common/archive.h"
#include "common/config-manager.h"
+#include "common/debug-channels.h"
#include "common/error.h"
#include "common/events.h"
#include "common/file.h"
@@ -39,6 +40,8 @@
namespace StarTrek {
StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gamedesc) : Engine(syst), _gameDescription(gamedesc) {
+ DebugMan.addDebugChannel(kDebugSound, "sound", "Sound");
+
_gfx = nullptr;
_sound = nullptr;
_macResFork = nullptr;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 232482a..faf396a 100755
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -57,6 +57,10 @@ enum StarTrekGameFeatures {
GF_DEMO = (1 << 0)
};
+enum kDebugLevels {
+ kDebugSound = 1 << 0
+};
+
enum TrekEventType {
TREKEVENT_TICK = 0, // DOS clock changes (see updateClockTicks)
Commit: e1d70e6a04bd2457cd3f12e8cbc3e819533787e5
https://github.com/scummvm/scummvm/commit/e1d70e6a04bd2457cd3f12e8cbc3e819533787e5
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Disabling menu buttons + text menu.
Changed paths:
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/sound.cpp
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index ed4113d..66b1cf3 100755
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -49,7 +49,7 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_backgroundImage = new Bitmap(_vm->openFile("DEMON0.BMP").get());
_numSprites = 0;
- _textboxVar1 = 2;
+ _textDisplayMode = TEXTDISPLAY_WAIT;
CursorMan.showMouse(true);
}
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 47a0fbf..9d2c59a 100755
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -64,7 +64,7 @@ struct Menu {
};
class Graphics;
-typedef String (Graphics::*TextGetterFunc)(int, void *, String *);
+typedef String (Graphics::*TextGetterFunc)(int, uintptr, String *);
class Graphics {
@@ -115,10 +115,11 @@ private:
// text.cpp (TODO: separate class)
public:
- int showText(TextGetterFunc textGetter, int var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, int arg10);
+ int showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, int arg10);
- String readTextFromRdf(int choiceIndex, void *data, String *headerTextOutput);
- String readTextFromBuffer(int choiceIndex, void *data, String *headerTextOutput);
+ String readTextFromRdf(int choiceIndex, uintptr data, String *headerTextOutput);
+ String readTextFromBuffer(int choiceIndex, uintptr data, String *headerTextOutput);
+ String readTextFromArray(int choiceIndex, uintptr data, String *headerTextOutput);
private:
int handleTextboxEvents(uint32 ticksUntilClickingEnabled, bool arg4);
@@ -129,7 +130,7 @@ private:
int getNumLines(const String &str);
void getTextboxHeader(String *headerTextOutput, String speakerText, int choiceIndex);
- String readLineFormattedText(TextGetterFunc textGetter, int var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numLines);
+ String readLineFormattedText(TextGetterFunc textGetter, uintptr var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numLines);
String putTextIntoLines(const String &text);
const char *getNextTextLine(const char *text, char *line, int lineWidth);
@@ -139,11 +140,16 @@ private:
int getMenuButtonAt(const Menu &menu, int x, int y);
void drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color);
void loadMenuButtons(String mnuFilename, int xpos, int ypos);
- void setMenuButtonVar2Bits(uint32 bits);
- void clearMenuButtonVar2Bits(uint32 bits);
+ void disableMenuButton(uint32 bits);
+ void enableMenuButton(uint32 bits);
+public:
+ void openTextConfigurationMenu(bool fromOptionMenu);
+ int loadTextDisplayMode();
+ void saveTextDisplayMode(int value);
- uint16 _textboxVar1;
+private:
+ int16 _textDisplayMode;
uint32 _textboxVar2;
uint32 _textboxVar3;
uint16 _textboxVar6;
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 7b16c28..c5e6323 100755
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -154,7 +154,7 @@ void Sound::playSoundEffect(const char *baseSoundName) {
if (readStream == nullptr)
error("Couldn't open '%s'", soundName.c_str());
- debugC(5, kDebugSound, "Playing sound effect '%s'", baseSoundName);
+ debugC(5, kDebugSound, "Playing sound effect '%s'", soundName.c_str());
Audio::AudioStream *audioStream = Audio::makeVOCStream(readStream, Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);
_vm->_system->getMixer()->playStream(Audio::Mixer::kSFXSoundType, &_sfxHandles[i], audioStream);
return;
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index e25d427..44e4713 100755
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -75,16 +75,6 @@ Common::Error StarTrekEngine::run() {
initializeEventsAndMouse();
-// Hexdump data
-#if 0
- Common::SeekableReadStream *stream = openFile("BRIDGE.PAL");
- byte *data = (byte *)malloc(stream->size());
- stream->read(data, stream->size());
- Common::hexdump(data, stream->size());
- free(data);
- delete stream;
-#endif
-
// Test graphics/music:
// Music Status:
@@ -149,6 +139,7 @@ Common::Error StarTrekEngine::run() {
*/
+ _gfx->openTextConfigurationMenu(false);
_gfx->showText(&Graphics::readTextFromRdf, 0x2220, 150, 160, 0xb3, 0, 10, 0);
while (!shouldQuit()) {
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index faf396a..440773f 100755
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -72,6 +72,12 @@ enum TrekEventType {
TREKEVENT_KEYDOWN = 6
};
+enum TextDisplayMode {
+ TEXTDISPLAY_WAIT = 0, // Wait for input before closing text
+ TEXTDISPLAY_SUBTITLES, // Automatically continue when speech is done
+ TEXTDISPLAY_NONE // No text displayed
+};
+
struct TrekEvent {
TrekEventType type;
Common::KeyState kbd;
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 2d875da..b7a642c 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -46,8 +46,8 @@ enum TextEvent {
namespace StarTrek {
-int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, int arg10) {
- uint16 tmpTextboxVar1 = _textboxVar1;
+int Graphics::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, int arg10) {
+ int16 tmpTextDisplayMode = _textDisplayMode;
uint32 var7c = 8;
if (_textboxVar3 > _textboxVar2+1) {
@@ -60,7 +60,7 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
String speakerText;
while(true) {
- String choiceText = (this->*textGetter)(numChoices, &var, &speakerText);
+ String choiceText = (this->*textGetter)(numChoices, var, &speakerText);
if (choiceText.empty())
break;
@@ -87,13 +87,14 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
int choiceIndex = 0;
int scrollOffset = 0;
- if (tmpTextboxVar1 != 0 && tmpTextboxVar1 != 1 && numChoices == 1
- && _vm->_sfxEnabled && !_vm->_audioEnabled)
+ if (tmpTextDisplayMode != TEXTDISPLAY_WAIT && tmpTextDisplayMode != TEXTDISPLAY_SUBTITLES
+ && numChoices == 1 && _vm->_sfxEnabled && !_vm->_audioEnabled)
_textboxHasMultipleChoices = false;
else
_textboxHasMultipleChoices = true;
- if (tmpTextboxVar1 >= 0 && tmpTextboxVar1 <= 2 && _vm->_sfxEnabled && !_vm->_audioEnabled)
+ if (tmpTextDisplayMode >= TEXTDISPLAY_WAIT && tmpTextDisplayMode <= TEXTDISPLAY_NONE
+ && _vm->_sfxEnabled && !_vm->_audioEnabled)
_textboxVar6 = true;
else
_textboxVar6 = false;
@@ -119,13 +120,13 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
int var80 = (numChoices > 1 ? 0x18 : 0);
// TODO: sub_288FB function call
- // TODO: sub_28ACA(0x0002);
+ disableMenuButton(0x0002); // Disable scroll up
- if (var7c == 0) {
- // sub_28ACA(0x0001);
+ if (var7c == 0) { // Disable done button
+ disableMenuButton(0x0001);
}
- if (loopChoices == 0) {
- // sub_28ACA(0x0008);
+ if (!loopChoices) { // Disable prev button
+ disableMenuButton(0x0008);
}
bool doneShowingText = false;
@@ -135,7 +136,7 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
int textboxReturnCode = handleTextboxEvents(var7c, true);
if (var7c == 0) {
- clearMenuButtonVar2Bits(0x0001);
+ enableMenuButton(0x0001);
}
switch(textboxReturnCode) {
@@ -178,21 +179,21 @@ int Graphics::showText(TextGetterFunc textGetter, int var, int xoffset, int yoff
goto readjustScrollDown;
readjustScrollUp:
- clearMenuButtonVar2Bits(0x0004);
+ enableMenuButton(0x0004);
if (scrollOffset < 0)
scrollOffset = 0;
if (scrollOffset == 0)
- setMenuButtonVar2Bits(0x0002);
+ disableMenuButton(0x0002);
goto readjustScroll;
readjustScrollDown:
- clearMenuButtonVar2Bits(0x0002);
+ enableMenuButton(0x0002);
if (scrollOffset >= numTextLines)
scrollOffset -= numTextboxLines;
if (scrollOffset > numTextLines-1)
scrollOffset = numTextLines-1;
if (scrollOffset+numTextboxLines >= numTextLines)
- setMenuButtonVar2Bits(0x0004);
+ disableMenuButton(0x0004);
goto readjustScroll;
readjustScroll:
@@ -208,20 +209,20 @@ readjustScroll:
case TEXTEVENT_PREVCHOICE:
choiceIndex--;
if (!loopChoices && choiceIndex == 0) {
- setMenuButtonVar2Bits(0x0008);
+ disableMenuButton(0x0008);
}
else {
if (choiceIndex < 0)
choiceIndex = numChoices-1;
}
- clearMenuButtonVar2Bits(0x0010);
+ enableMenuButton(0x0010);
goto reloadText;
case TEXTEVENT_NEXTCHOICE:
- clearMenuButtonVar2Bits(0x0008);
+ enableMenuButton(0x0008);
choiceIndex++;
if (!loopChoices && choiceIndex == numChoices-1) {
- setMenuButtonVar2Bits(0x0010);
+ disableMenuButton(0x0010);
}
else {
choiceIndex %= numChoices;
@@ -237,8 +238,8 @@ reloadText:
else {
// sub_288FB(0x001F);
}
- clearMenuButtonVar2Bits(0x0004);
- setMenuButtonVar2Bits(0x0002);
+ enableMenuButton(0x0004);
+ disableMenuButton(0x0002);
textboxSprite.bitmapChanged = true;
break;
@@ -314,7 +315,7 @@ int Graphics::handleTextboxEvents(uint32 ticksUntilClickingEnabled, bool arg4) {
if (_vm->_finishedPlayingSpeech != 0) {
_vm->_finishedPlayingSpeech = 0;
- if (_textboxVar1 != 0) {
+ if (_textDisplayMode != TEXTDISPLAY_WAIT) {
return TEXTEVENT_SPEECH_DONE;
}
}
@@ -358,10 +359,10 @@ int Graphics::handleTextboxEvents(uint32 ticksUntilClickingEnabled, bool arg4) {
/**
* Text getter for showText which reads from an rdf file.
*/
-String Graphics::readTextFromRdf(int choiceIndex, void *data, String *headerTextOutput) {
+String Graphics::readTextFromRdf(int choiceIndex, uintptr data, String *headerTextOutput) {
Room *room = _vm->getRoom();
- int rdfVar = *(int*)data;
+ int rdfVar = (size_t)data;
uint16 textOffset = room->readRdfWord(rdfVar + (choiceIndex+1)*2);
@@ -387,9 +388,9 @@ String Graphics::readTextFromRdf(int choiceIndex, void *data, String *headerText
/**
* Text getter for showText which reads from a given buffer.
*/
-String Graphics::readTextFromBuffer(int choiceIndex, void *data, String *headerTextOutput) {
+String Graphics::readTextFromBuffer(int choiceIndex, uintptr data, String *headerTextOutput) {
char buf[TEXTBOX_WIDTH];
- memcpy(buf, data, TEXTBOX_WIDTH-2);
+ memcpy(buf, (byte*)data, TEXTBOX_WIDTH-2);
buf[TEXTBOX_WIDTH-2] = '\0';
*headerTextOutput = String(buf);
@@ -399,6 +400,25 @@ String Graphics::readTextFromBuffer(int choiceIndex, void *data, String *headerT
}
/**
+ * Text getter for showText which reads choices from an array of pointers.
+ * Last element in the array must be an empty string.
+ */
+String Graphics::readTextFromArray(int choiceIndex, uintptr data, String *headerTextOutput) {
+ const char **textArray = (const char**)data;
+
+ const char *headerText = textArray[0];
+ const char *mainText = textArray[choiceIndex+1];
+
+ if (*mainText == '\0')
+ return Common::String(); // Technically should be nullptr...
+
+ *headerTextOutput = headerText;
+ while (headerTextOutput->size() < TEXTBOX_WIDTH-2)
+ *headerTextOutput += ' ';
+ return String(mainText);
+}
+
+/**
* Creates a blank textbox in a TextBitmap, and initializes a sprite to use it.
*/
SharedPtr<TextBitmap> Graphics::initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite) {
@@ -535,17 +555,18 @@ void Graphics::getTextboxHeader(String *headerTextOutput, String speakerText, in
*headerTextOutput = header;
}
-String Graphics::readLineFormattedText(TextGetterFunc textGetter, int var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numTextLines) {
+String Graphics::readLineFormattedText(TextGetterFunc textGetter, uintptr var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numTextLines) {
String headerText;
- String text = (this->*textGetter)(choiceIndex, &var, &headerText);
+ String text = (this->*textGetter)(choiceIndex, var, &headerText);
- if (_textboxVar1 == 2 && _vm->_sfxEnabled && _vm->_audioEnabled) {
+ if (_textDisplayMode == TEXTDISPLAY_NONE && _vm->_sfxEnabled && _vm->_audioEnabled) {
uint32 oldSize = text.size();
text = playTextAudio(text);
if (oldSize != text.size())
_textboxHasMultipleChoices = true;
}
- else if ((_textboxVar1 == 0 || _textboxVar1 == 1) && _vm->_sfxEnabled && _vm->_audioEnabled) {
+ else if ((_textDisplayMode == TEXTDISPLAY_WAIT || _textDisplayMode == TEXTDISPLAY_SUBTITLES)
+ && _vm->_sfxEnabled && _vm->_audioEnabled) {
text = playTextAudio(text);
}
else {
@@ -802,16 +823,66 @@ void Graphics::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
_textboxButtonVar4 = 0;
}
-// 0x0002: Disable scroll up
-// 0x0004: Disable scroll down
-// 0x0008: Disable prev choice
-// 0x0010: Disable next choice
-void Graphics::setMenuButtonVar2Bits(uint32 bits) {
- // TODO
+// Values for standard text displays:
+// 0x0001: Disable done button
+// 0x0002: Disable scroll up
+// 0x0004: Disable scroll down
+// 0x0008: Disable prev choice
+// 0x0010: Disable next choice
+void Graphics::disableMenuButton(uint32 bits) {
+ _activeMenu->disabledButtons |= bits;
+ if (_activeMenu->selectedButton != -1
+ && (_activeMenu->disabledButtons & (1<<_activeMenu->selectedButton))) {
+ Sprite *sprite = &_activeMenu->sprites[_activeMenu->selectedButton];
+ drawMenuButtonOutline(sprite->bitmap, 0x00);
+
+ sprite->bitmapChanged = true;
+ _activeMenu->selectedButton = -1;
+ }
+}
+
+void Graphics::enableMenuButton(uint32 bits) {
+ _activeMenu->disabledButtons &= ~bits;
+}
+
+/**
+ * This can be called from startup or from the options menu.
+ * On startup, this tries to load the setting without user input.
+ */
+void Graphics::openTextConfigurationMenu(bool fromOptionMenu) {
+ const char *options[] = { // TODO: languages...
+ "Text display",
+ "Text subtitles.",
+ "Display text until you press enter.",
+ "No text displayed.",
+ ""
+ };
+
+ int val;
+ if (fromOptionMenu || (val = loadTextDisplayMode()) == -1) {
+ // TODO: fix X coordinate (should be 0x14, not 130)
+ val = showText(&Graphics::readTextFromArray, (uintptr)options, 130, 0x1e, 0xb0, true, 0, 1);
+ saveTextDisplayMode(val);
+ }
+
+ switch(val) {
+ case 0:
+ _textDisplayMode = TEXTDISPLAY_SUBTITLES;
+ break;
+ case 1:
+ _textDisplayMode = TEXTDISPLAY_WAIT;
+ break;
+ case 2:
+ _textDisplayMode = TEXTDISPLAY_NONE;
+ break;
+ }
}
-void Graphics::clearMenuButtonVar2Bits(uint32 bits) {
- // TODO
+int Graphics::loadTextDisplayMode() {
+ return -1; // TODO
+}
+void Graphics::saveTextDisplayMode(int value) {
+ // TODO;
}
}
Commit: 2932c392c47c135184e8617a59e3185f14a25ce0
https://github.com/scummvm/scummvm/commit/2932c392c47c135184e8617a59e3185f14a25ce0
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Set default mouse sprite to stop crashes
Changed paths:
engines/startrek/bitmap.cpp
engines/startrek/bitmap.h
engines/startrek/graphics.cpp
engines/startrek/graphics.h
diff --git a/engines/startrek/bitmap.cpp b/engines/startrek/bitmap.cpp
index 43aee81..61e5bce 100644
--- a/engines/startrek/bitmap.cpp
+++ b/engines/startrek/bitmap.cpp
@@ -24,7 +24,7 @@
namespace StarTrek {
-Bitmap::Bitmap(Common::ReadStreamEndian *stream) {
+Bitmap::Bitmap(SharedPtr<Common::ReadStreamEndian> stream) {
xoffset = stream->readUint16();
yoffset = stream->readUint16();
width = stream->readUint16();
diff --git a/engines/startrek/bitmap.h b/engines/startrek/bitmap.h
index d30aee1..7d3f2fd 100644
--- a/engines/startrek/bitmap.h
+++ b/engines/startrek/bitmap.h
@@ -1,6 +1,7 @@
#ifndef STARTREK_BITMAP_H
#define STARTREK_BITMAP_H
+#include "common/ptr.h"
#include "common/stream.h"
namespace StarTrek {
@@ -12,7 +13,7 @@ struct Bitmap {
uint16 height;
byte *pixels;
- Bitmap(Common::ReadStreamEndian *stream);
+ Bitmap(Common::SharedPtr<Common::ReadStreamEndian> stream);
Bitmap(int w, int h);
~Bitmap();
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 66b1cf3..41bc6f2 100755
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -46,11 +46,12 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
if (_vm->getGameType() == GType_ST25 && _vm->getPlatform() == Common::kPlatformDOS)
_font = new Font(_vm);
- _backgroundImage = new Bitmap(_vm->openFile("DEMON0.BMP").get());
+ _backgroundImage = loadBitmap("DEMON0");
_numSprites = 0;
_textDisplayMode = TEXTDISPLAY_WAIT;
+ setMouseCursor(loadBitmap("pushbtn"));
CursorMan.showMouse(true);
}
@@ -60,7 +61,6 @@ Graphics::~Graphics() {
delete[] _lutData;
delete _font;
- delete _backgroundImage;
}
@@ -138,7 +138,7 @@ void Graphics::loadPri(const char *priFile) {
}
SharedPtr<Bitmap> Graphics::loadBitmap(Common::String basename) {
- return SharedPtr<Bitmap>(new Bitmap(_vm->openFile(basename+".BMP").get()));
+ return SharedPtr<Bitmap>(new Bitmap(_vm->openFile(basename+".BMP")));
}
Common::Point Graphics::getMousePos() {
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 9d2c59a..b684ced 100755
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -105,7 +105,7 @@ private:
byte *_lutData;
Common::Rect _screenRect;
- Bitmap *_backgroundImage;
+ SharedPtr<Bitmap> _backgroundImage;
Sprite *_sprites[MAX_SPRITES];
int _numSprites;
Commit: e206d8e19875f2545b59e68c753d45b864228f21
https://github.com/scummvm/scummvm/commit/e206d8e19875f2545b59e68c753d45b864228f21
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Remove executable bit on source files
Changed paths:
engines/startrek/detection.cpp
engines/startrek/font.cpp
engines/startrek/font.h
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/lzss.cpp
engines/startrek/lzss.h
engines/startrek/module.mk
engines/startrek/sound.cpp
engines/startrek/sound.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/detection.cpp b/engines/startrek/detection.cpp
old mode 100755
new mode 100644
diff --git a/engines/startrek/font.cpp b/engines/startrek/font.cpp
old mode 100755
new mode 100644
diff --git a/engines/startrek/font.h b/engines/startrek/font.h
old mode 100755
new mode 100644
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
old mode 100755
new mode 100644
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
old mode 100755
new mode 100644
diff --git a/engines/startrek/lzss.cpp b/engines/startrek/lzss.cpp
old mode 100755
new mode 100644
diff --git a/engines/startrek/lzss.h b/engines/startrek/lzss.h
old mode 100755
new mode 100644
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
old mode 100755
new mode 100644
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
old mode 100755
new mode 100644
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
old mode 100755
new mode 100644
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
old mode 100755
new mode 100644
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
old mode 100755
new mode 100644
Commit: d37e2aba0e932c3d9c082823caf526fcb415fd50
https://github.com/scummvm/scummvm/commit/d37e2aba0e932c3d9c082823caf526fcb415fd50
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Options menu
Changed paths:
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/sound.cpp
engines/startrek/sprite.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 41bc6f2..dedbf93 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -383,7 +383,7 @@ void Graphics::drawAllSprites() {
for (int i=0; i<_numSprites; i++) {
Sprite *spr = _sprites[i];
- if (spr->field16 == 0 && spr->isOnScreen) {
+ if (!spr->field16 && spr->isOnScreen) {
bool mustRedrawSprite = false;
Common::Rect rect2;
@@ -403,7 +403,7 @@ void Graphics::drawAllSprites() {
drawSprite(*spr, rect2);
}
- spr->field16 = 0;
+ spr->field16 = false;
spr->bitmapChanged = 0;
spr->lastDrawRect = spr->drawRect;
}
@@ -418,7 +418,7 @@ void Graphics::addSprite(Sprite *sprite) {
// Initialize some fields
sprite->drawMode = 0;
sprite->field8 = 0;
- sprite->field16 = 0;
+ sprite->field16 = false;
sprite->lastDrawRect.top = -1;
sprite->lastDrawRect.left = -1;
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index b684ced..c63b2f6 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -44,7 +44,7 @@ const int SCREEN_WIDTH = 320;
const int SCREEN_HEIGHT = 200;
const int MAX_SPRITES = 32;
-const int MAX_MENUBUTTONS = 16; // This is arbitrary, the original game has no such limit
+const int MAX_MENUBUTTONS = 32;
const int TEXTBOX_WIDTH = 26;
const int MAX_TEXTBOX_LINES = 12;
@@ -59,8 +59,6 @@ struct Menu {
uint16 numButtons;
int16 selectedButton;
SharedPtr<Menu> nextMenu;
-
- Menu() : nextMenu(SharedPtr<Menu>()) {}
};
class Graphics;
@@ -122,7 +120,7 @@ public:
String readTextFromArray(int choiceIndex, uintptr data, String *headerTextOutput);
private:
- int handleTextboxEvents(uint32 ticksUntilClickingEnabled, bool arg4);
+ int handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4);
SharedPtr<TextBitmap> initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite);
void drawMainText(SharedPtr<TextBitmap> bitmap, int numTextLines, int numTextboxLines, const String &text, bool withHeader);
@@ -140,11 +138,13 @@ private:
int getMenuButtonAt(const Menu &menu, int x, int y);
void drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color);
void loadMenuButtons(String mnuFilename, int xpos, int ypos);
- void disableMenuButton(uint32 bits);
- void enableMenuButton(uint32 bits);
+ void unloadMenuButtons();
+ void disableMenuButtons(uint32 bits);
+ void enableMenuButtons(uint32 bits);
public:
- void openTextConfigurationMenu(bool fromOptionMenu);
+ void showOptionsMenu(int x, int y);
+ void showTextConfigurationMenu(bool fromOptionMenu);
int loadTextDisplayMode();
void saveTextDisplayMode(int value);
@@ -153,12 +153,12 @@ private:
uint32 _textboxVar2;
uint32 _textboxVar3;
uint16 _textboxVar6;
- uint16 _textboxVar7;
bool _textboxHasMultipleChoices;
SharedPtr<Menu> _activeMenu;
- uint16 _textboxButtonVar4;
+ // Saved value of StarTrekEngine::_keyboardControlsMouse when menus are up
+ bool _keyboardControlsMouseOutsideMenu;
};
}
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index c5e6323..ac23cf6 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -79,12 +79,8 @@ Sound::~Sound() {
void Sound::playMidiTrack(int track) {
- if (!_vm->_musicEnabled)
+ if (!_vm->_musicEnabled || !_vm->_musicWorking)
return;
- /*
- if (!_vm->_word_467a8)
- return;
- */
assert(loadedSoundData != NULL);
@@ -137,7 +133,7 @@ void Sound::playSoundEffect(const char *baseSoundName) {
if (scumm_stricmp(baseSoundName+4, "loop") == 0)
_loopingAudioName = Common::String(baseSoundName);
- if (!_vm->_sfxEnabled || !_vm->_audioEnabled)
+ if (!_vm->_sfxEnabled || !_vm->_sfxWorking)
return;
/*
diff --git a/engines/startrek/sprite.h b/engines/startrek/sprite.h
index 5fdc0f5..c7a26de 100644
--- a/engines/startrek/sprite.h
+++ b/engines/startrek/sprite.h
@@ -54,7 +54,7 @@ struct Sprite {
bool bitmapChanged;
bool rect2Valid;
bool isOnScreen;
- uint16 field16; // When set, sprite isn't drawn next refresh? (Gets reset to 0 after)
+ bool field16; // When set, sprite isn't drawn next refresh? (Gets reset to 0 after)
Common::Rect lastDrawRect; // Rect encompassing the sprite last time it was drawn
Common::Rect drawRect; // Rect encompassing the sprite currently
Common::Rect rectangle2;
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 44e4713..de851b3 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -47,9 +47,17 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_macResFork = nullptr;
_room = nullptr;
- _audioEnabled = true;
+ _clockTicks = 0;
+
_musicEnabled = true;
_sfxEnabled = true;
+ _word_467a6 = true;
+ _musicWorking = true;
+ _sfxWorking = true;
+ _finishedPlayingSpeech = false;
+
+ _mouseControllingShip = false;
+ _keyboardControlsMouse = true;
}
StarTrekEngine::~StarTrekEngine() {
@@ -139,7 +147,9 @@ Common::Error StarTrekEngine::run() {
*/
- _gfx->openTextConfigurationMenu(false);
+ while (true) {
+ _gfx->showOptionsMenu(0, 0);
+ }
_gfx->showText(&Graphics::readTextFromRdf, 0x2220, 150, 160, 0xb3, 0, 10, 0);
while (!shouldQuit()) {
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 440773f..5f57f9b 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -150,10 +150,17 @@ public:
bool _musicEnabled;
bool _sfxEnabled;
uint16 _word_467a6;
- uint16 _word_467a8;
- bool _audioEnabled;
+ uint16 _musicWorking;
+ bool _sfxWorking;
bool _finishedPlayingSpeech;
+ bool _mouseControllingShip;
+
+ // TODO: make this work.
+ // When false, the keyboard generally acts in a more specific way (ie. move mouse
+ // between items in a menu).
+ bool _keyboardControlsMouse;
+
private:
Graphics *_gfx;
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index b7a642c..8c4f05c 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -26,22 +26,39 @@
#include "startrek/graphics.h"
-// List of events that can be returned by handleTextboxEvents.
-enum TextEvent {
- TEXTEVENT_RCLICK_OFFBUTTON = -4,
- TEXTEVENT_ENABLEINPUT, // Makes buttons selectable (occurs after a delay)
- TEXTEVENT_RCLICK_ONBUTTON,
- TEXTEVENT_LCLICK_OFFBUTTON,
- TEXTEVENT_CONFIRM = 0,
- TEXTEVENT_SCROLLUP,
- TEXTEVENT_SCROLLDOWN,
- TEXTEVENT_PREVCHOICE,
- TEXTEVENT_NEXTCHOICE,
- TEXTEVENT_SCROLLUP_ONELINE,
- TEXTEVENT_SCROLLDOWN_ONELINE,
- TEXTEVENT_GOTO_TOP,
- TEXTEVENT_GOTO_BOTTOM,
- TEXTEVENT_SPEECH_DONE
+// Special events that can be returned by handleMenuEvents.
+enum MenuEvent {
+ MENUEVENT_RCLICK_OFFBUTTON = -4,
+ MENUEVENT_ENABLEINPUT, // Makes buttons selectable (occurs after a delay)
+ MENUEVENT_RCLICK_ONBUTTON,
+ MENUEVENT_LCLICK_OFFBUTTON,
+};
+
+// Buttons for standard text display
+enum TextButtons {
+ TEXTBUTTON_CONFIRM = 0,
+ TEXTBUTTON_SCROLLUP,
+ TEXTBUTTON_SCROLLDOWN,
+ TEXTBUTTON_PREVCHOICE,
+ TEXTBUTTON_NEXTCHOICE,
+ TEXTBUTTON_SCROLLUP_ONELINE,
+ TEXTBUTTON_SCROLLDOWN_ONELINE,
+ TEXTBUTTON_GOTO_TOP,
+ TEXTBUTTON_GOTO_BOTTOM,
+ TEXTBUTTON_SPEECH_DONE // "Virtual" button?
+};
+
+// Buttons for option menu (corresponding to button indices, not button retvals, which are
+// different for some reason)
+enum OptionMenuButtons {
+ OPTIONBUTTON_TEXT,
+ OPTIONBUTTON_SAVE,
+ OPTIONBUTTON_LOAD,
+ OPTIONBUTTON_ENABLEMUSIC,
+ OPTIONBUTTON_DISABLEMUSIC,
+ OPTIONBUTTON_ENABLESFX,
+ OPTIONBUTTON_DISABLESFX,
+ OPTIONBUTTON_QUIT
};
namespace StarTrek {
@@ -88,13 +105,13 @@ int Graphics::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int
int choiceIndex = 0;
int scrollOffset = 0;
if (tmpTextDisplayMode != TEXTDISPLAY_WAIT && tmpTextDisplayMode != TEXTDISPLAY_SUBTITLES
- && numChoices == 1 && _vm->_sfxEnabled && !_vm->_audioEnabled)
+ && numChoices == 1 && _vm->_sfxEnabled && !_vm->_sfxWorking)
_textboxHasMultipleChoices = false;
else
_textboxHasMultipleChoices = true;
if (tmpTextDisplayMode >= TEXTDISPLAY_WAIT && tmpTextDisplayMode <= TEXTDISPLAY_NONE
- && _vm->_sfxEnabled && !_vm->_audioEnabled)
+ && _vm->_sfxEnabled && !_vm->_sfxWorking)
_textboxVar6 = true;
else
_textboxVar6 = false;
@@ -106,7 +123,7 @@ int Graphics::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int
// TODO
}
else {
- loadMenuButtons("textbtns", xoffset+0x96, yoffset-0x11);
+ loadMenuButtons("textbtns", xoffset + 0x96, yoffset - 0x11);
Common::Point oldMousePos = getMousePos();
SharedPtr<Bitmap> oldMouseBitmap = _mouseBitmap;
@@ -114,35 +131,35 @@ int Graphics::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int
_vm->_system->warpMouse(xoffset + 0xde, yoffset - 0x08);
setMouseCursor(loadBitmap("pushbtn"));
- uint16 tmpTextboxVar7 = _textboxVar7;
- _textboxVar7 = 0;
+ bool tmpMouseControllingShip = _vm->_mouseControllingShip;
+ _vm->_mouseControllingShip = false;
int var80 = (numChoices > 1 ? 0x18 : 0);
// TODO: sub_288FB function call
- disableMenuButton(0x0002); // Disable scroll up
+ disableMenuButtons(1 << TEXTBUTTON_SCROLLUP); // Disable scroll up
if (var7c == 0) { // Disable done button
- disableMenuButton(0x0001);
+ disableMenuButtons(1 << TEXTBUTTON_CONFIRM);
}
if (!loopChoices) { // Disable prev button
- disableMenuButton(0x0008);
+ disableMenuButtons(1 << TEXTBUTTON_PREVCHOICE);
}
bool doneShowingText = false;
// Loop until text is done being displayed
while (!doneShowingText) {
- int textboxReturnCode = handleTextboxEvents(var7c, true);
+ int textboxReturnCode = handleMenuEvents(var7c, true);
if (var7c == 0) {
- enableMenuButton(0x0001);
+ enableMenuButtons(1 << TEXTBUTTON_CONFIRM);
}
switch(textboxReturnCode) {
- case TEXTEVENT_RCLICK_OFFBUTTON:
- case TEXTEVENT_RCLICK_ONBUTTON:
+ case MENUEVENT_RCLICK_OFFBUTTON:
+ case MENUEVENT_RCLICK_ONBUTTON:
if (var7c == 0) {
doneShowingText = true;
if (arg10)
@@ -150,50 +167,50 @@ int Graphics::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int
}
break;
- case TEXTEVENT_CONFIRM:
+ case TEXTBUTTON_CONFIRM:
doneShowingText = true;
break;
- case TEXTEVENT_SCROLLUP:
+ case TEXTBUTTON_SCROLLUP:
scrollOffset -= numTextboxLines;
goto readjustScrollUp;
- case TEXTEVENT_SCROLLDOWN:
+ case TEXTBUTTON_SCROLLDOWN:
scrollOffset += numTextboxLines;
goto readjustScrollDown;
- case TEXTEVENT_SCROLLUP_ONELINE:
+ case TEXTBUTTON_SCROLLUP_ONELINE:
scrollOffset--;
goto readjustScrollUp;
- case TEXTEVENT_SCROLLDOWN_ONELINE:
+ case TEXTBUTTON_SCROLLDOWN_ONELINE:
scrollOffset++;
goto readjustScrollDown;
- case TEXTEVENT_GOTO_TOP:
+ case TEXTBUTTON_GOTO_TOP:
scrollOffset = 0;
goto readjustScrollUp;
- case TEXTEVENT_GOTO_BOTTOM:
+ case TEXTBUTTON_GOTO_BOTTOM:
scrollOffset = numTextLines - numTextboxLines;
goto readjustScrollDown;
readjustScrollUp:
- enableMenuButton(0x0004);
+ enableMenuButtons(1 << TEXTBUTTON_SCROLLDOWN);
if (scrollOffset < 0)
scrollOffset = 0;
if (scrollOffset == 0)
- disableMenuButton(0x0002);
+ disableMenuButtons(1 << TEXTBUTTON_SCROLLUP);
goto readjustScroll;
readjustScrollDown:
- enableMenuButton(0x0002);
+ enableMenuButtons(1 << TEXTBUTTON_SCROLLUP);
if (scrollOffset >= numTextLines)
scrollOffset -= numTextboxLines;
if (scrollOffset > numTextLines-1)
scrollOffset = numTextLines-1;
if (scrollOffset+numTextboxLines >= numTextLines)
- disableMenuButton(0x0004);
+ disableMenuButtons(1 << TEXTBUTTON_SCROLLDOWN);
goto readjustScroll;
readjustScroll:
@@ -206,23 +223,23 @@ readjustScroll:
numChoicesWithNames != 0);
break;
- case TEXTEVENT_PREVCHOICE:
+ case TEXTBUTTON_PREVCHOICE:
choiceIndex--;
if (!loopChoices && choiceIndex == 0) {
- disableMenuButton(0x0008);
+ disableMenuButtons(1 << TEXTBUTTON_PREVCHOICE);
}
else {
if (choiceIndex < 0)
choiceIndex = numChoices-1;
}
- enableMenuButton(0x0010);
+ enableMenuButtons(1 << TEXTBUTTON_NEXTCHOICE);
goto reloadText;
- case TEXTEVENT_NEXTCHOICE:
- enableMenuButton(0x0008);
+ case TEXTBUTTON_NEXTCHOICE:
+ enableMenuButtons(1 << TEXTBUTTON_PREVCHOICE);
choiceIndex++;
if (!loopChoices && choiceIndex == numChoices-1) {
- disableMenuButton(0x0010);
+ disableMenuButtons(1 << TEXTBUTTON_NEXTCHOICE);
}
else {
choiceIndex %= numChoices;
@@ -238,18 +255,18 @@ reloadText:
else {
// sub_288FB(0x001F);
}
- enableMenuButton(0x0004);
- disableMenuButton(0x0002);
+ enableMenuButtons(1 << TEXTBUTTON_SCROLLDOWN);
+ disableMenuButtons(1 << TEXTBUTTON_SCROLLUP);
textboxSprite.bitmapChanged = true;
break;
- case TEXTEVENT_SPEECH_DONE:
+ case TEXTBUTTON_SPEECH_DONE:
if (numChoices == 1)
doneShowingText = true;
break;
- case TEXTEVENT_ENABLEINPUT:
- case TEXTEVENT_LCLICK_OFFBUTTON:
+ case MENUEVENT_ENABLEINPUT:
+ case MENUEVENT_LCLICK_OFFBUTTON:
default:
break;
}
@@ -258,10 +275,10 @@ reloadText:
setMouseCursor(oldMouseBitmap);
_vm->_system->warpMouse(oldMousePos.x, oldMousePos.y);
- _textboxVar7 = tmpTextboxVar7;
- // sub_29326();
- textboxSprite.field16 = 1;
- textboxSprite.bitmapChanged = 1;
+ _vm->_mouseControllingShip = tmpMouseControllingShip;
+ unloadMenuButtons();
+ textboxSprite.field16 = true;
+ textboxSprite.bitmapChanged = true;
drawAllSprites();
delSprite(&textboxSprite);
@@ -273,7 +290,11 @@ reloadText:
return choiceIndex;
}
-int Graphics::handleTextboxEvents(uint32 ticksUntilClickingEnabled, bool arg4) {
+/**
+ * This returns either a special menu event (negative number) or the retval of the button
+ * clicked (usually an index, always positive).
+ */
+int Graphics::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4) {
// TODO: finish
uint32 tickWhenClickingEnabled = _vm->_clockTicks + ticksUntilClickingEnabled;
@@ -316,14 +337,14 @@ int Graphics::handleTextboxEvents(uint32 ticksUntilClickingEnabled, bool arg4) {
if (_vm->_finishedPlayingSpeech != 0) {
_vm->_finishedPlayingSpeech = 0;
if (_textDisplayMode != TEXTDISPLAY_WAIT) {
- return TEXTEVENT_SPEECH_DONE;
+ return TEXTBUTTON_SPEECH_DONE;
}
}
// sub_1E88C();
_textboxVar3++;
if (ticksUntilClickingEnabled != 0 && _vm->_clockTicks >= tickWhenClickingEnabled)
- return TEXTEVENT_ENABLEINPUT;
+ return MENUEVENT_ENABLEINPUT;
break;
}
@@ -336,7 +357,7 @@ int Graphics::handleTextboxEvents(uint32 ticksUntilClickingEnabled, bool arg4) {
Common::Point mouse = getMousePos();
if (getMenuButtonAt(*_activeMenu, mouse.x, mouse.y) == -1) {
_vm->playSoundEffectIndex(0x10);
- return TEXTEVENT_LCLICK_OFFBUTTON;
+ return MENUEVENT_LCLICK_OFFBUTTON;
}
}
break;
@@ -559,14 +580,14 @@ String Graphics::readLineFormattedText(TextGetterFunc textGetter, uintptr var, i
String headerText;
String text = (this->*textGetter)(choiceIndex, var, &headerText);
- if (_textDisplayMode == TEXTDISPLAY_NONE && _vm->_sfxEnabled && _vm->_audioEnabled) {
+ if (_textDisplayMode == TEXTDISPLAY_NONE && _vm->_sfxEnabled && _vm->_sfxWorking) {
uint32 oldSize = text.size();
text = playTextAudio(text);
if (oldSize != text.size())
_textboxHasMultipleChoices = true;
}
else if ((_textDisplayMode == TEXTDISPLAY_WAIT || _textDisplayMode == TEXTDISPLAY_SUBTITLES)
- && _vm->_sfxEnabled && _vm->_audioEnabled) {
+ && _vm->_sfxEnabled && _vm->_sfxWorking) {
text = playTextAudio(text);
}
else {
@@ -732,7 +753,7 @@ String Graphics::playTextAudio(const String &str) {
* Returns the index of the button at the given position, or -1 if none.
*/
int Graphics::getMenuButtonAt(const Menu &menu, int x, int y) {
- for (int i=0; i<menu.numButtons; i++) {
+ for (int i = 0; i < menu.numButtons; i++) {
const Sprite &spr = menu.sprites[i];
if (spr.drawMode != 2)
@@ -780,7 +801,13 @@ void Graphics::drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color) {
}
}
+/**
+ * Loads a .MNU file, which is a list of buttons to display.
+ */
void Graphics::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
+ if (_activeMenu == nullptr)
+ _keyboardControlsMouseOutsideMenu = _vm->_keyboardControlsMouse;
+
SharedPtr<Menu> oldMenu = _activeMenu;
_activeMenu = SharedPtr<Menu>(new Menu());
_activeMenu->nextMenu = oldMenu;
@@ -790,7 +817,7 @@ void Graphics::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
_activeMenu->menuFile = stream;
_activeMenu->numButtons = _activeMenu->menuFile->size()/16;
- for (int i=0; i<_activeMenu->numButtons; i++) {
+ for (int i = 0; i < _activeMenu->numButtons; i++) {
memset(&_activeMenu->sprites[i], 0, sizeof(Sprite));
addSprite(&_activeMenu->sprites[i]);
_activeMenu->sprites[i].drawMode = 2;
@@ -814,25 +841,49 @@ void Graphics::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
if (_activeMenu->retvals[_activeMenu->numButtons-1] == 0) {
// Set default retvals for buttons
- for (int i=0; i<_activeMenu->numButtons; i++)
+ for (int i = 0; i < _activeMenu->numButtons; i++)
_activeMenu->retvals[i] = i;
}
_activeMenu->selectedButton = -1;
_activeMenu->disabledButtons = 0;
- _textboxButtonVar4 = 0;
+ _vm->_keyboardControlsMouse = false;
}
-// Values for standard text displays:
-// 0x0001: Disable done button
-// 0x0002: Disable scroll up
-// 0x0004: Disable scroll down
-// 0x0008: Disable prev choice
-// 0x0010: Disable next choice
-void Graphics::disableMenuButton(uint32 bits) {
+void Graphics::unloadMenuButtons() {
+ if (_activeMenu->selectedButton != -1)
+ drawMenuButtonOutline(_activeMenu->sprites[_activeMenu->selectedButton].bitmap, 0x00);
+
+ for (int i = 0; i < _activeMenu->numButtons; i++) {
+ Sprite *sprite = &_activeMenu->sprites[i];
+ if (sprite->drawMode == 2) {
+ sprite->field16 = true;
+ sprite->bitmapChanged = true;
+ }
+ }
+
+ drawAllSprites();
+
+ for (int i = 0; i < _activeMenu->numButtons; i++) {
+ Sprite *sprite = &_activeMenu->sprites[i];
+ sprite->bitmap.reset();
+ if (sprite->drawMode == 2)
+ delSprite(sprite);
+ }
+
+ _activeMenu = _activeMenu->nextMenu;
+
+ if (_activeMenu == nullptr)
+ _vm->_keyboardControlsMouse = _keyboardControlsMouseOutsideMenu;
+}
+
+/**
+ * Disables the given bitmask of buttons.
+ */
+void Graphics::disableMenuButtons(uint32 bits) {
_activeMenu->disabledButtons |= bits;
if (_activeMenu->selectedButton != -1
- && (_activeMenu->disabledButtons & (1<<_activeMenu->selectedButton))) {
+ && (_activeMenu->disabledButtons & (1 << _activeMenu->selectedButton))) {
Sprite *sprite = &_activeMenu->sprites[_activeMenu->selectedButton];
drawMenuButtonOutline(sprite->bitmap, 0x00);
@@ -841,15 +892,75 @@ void Graphics::disableMenuButton(uint32 bits) {
}
}
-void Graphics::enableMenuButton(uint32 bits) {
+void Graphics::enableMenuButtons(uint32 bits) {
_activeMenu->disabledButtons &= ~bits;
}
+
+void Graphics::showOptionsMenu(int x, int y) {
+ bool tmpMouseControllingShip = _vm->_mouseControllingShip;
+ _vm->_mouseControllingShip = false;
+
+ Common::Point oldMousePos = getMousePos();
+ SharedPtr<Bitmap> oldMouseBitmap = _mouseBitmap;
+
+ setMouseCursor(loadBitmap("options"));
+ loadMenuButtons("options", x, y);
+
+ uint32 disabledButtons = 0;
+ if (_vm->_musicWorking) {
+ if (_vm->_musicEnabled)
+ disabledButtons |= (1 << OPTIONBUTTON_ENABLEMUSIC);
+ else
+ disabledButtons |= (1 << OPTIONBUTTON_DISABLEMUSIC);
+ }
+ else
+ disabledButtons |= (1 << OPTIONBUTTON_ENABLEMUSIC) | (1 << OPTIONBUTTON_DISABLEMUSIC);
+
+ if (_vm->_sfxWorking) {
+ if (_vm->_sfxEnabled)
+ disabledButtons |= (1 << OPTIONBUTTON_ENABLESFX);
+ else
+ disabledButtons |= (1 << OPTIONBUTTON_DISABLESFX);
+ }
+ else
+ disabledButtons |= (1 << OPTIONBUTTON_ENABLESFX) | (1 << OPTIONBUTTON_DISABLESFX);
+
+ disableMenuButtons(disabledButtons);
+ // sub_28b5d();
+ int event = handleMenuEvents(0, false);
+
+ unloadMenuButtons();
+ _vm->_mouseControllingShip = tmpMouseControllingShip;
+ setMouseCursor(oldMouseBitmap);
+
+ if (event != MENUEVENT_LCLICK_OFFBUTTON && event != MENUEVENT_RCLICK_OFFBUTTON)
+ _vm->_system->warpMouse(oldMousePos.x, oldMousePos.y);
+
+
+ // Can't use OPTIONBUTTON constants since the button retvals differ from the button
+ // indices...
+ switch(event) { // TODO
+ case 0: // Save
+ case 1: // Load
+ case 2: // Enable music
+ case 3: // Disable music
+ case 4: // Enable sfx
+ case 5: // Disable sfx
+ case 6: // Quit
+ case 7: // Text
+ showTextConfigurationMenu(true);
+ break;
+ default:
+ break;
+ }
+}
+
/**
* This can be called from startup or from the options menu.
* On startup, this tries to load the setting without user input.
*/
-void Graphics::openTextConfigurationMenu(bool fromOptionMenu) {
+void Graphics::showTextConfigurationMenu(bool fromOptionMenu) {
const char *options[] = { // TODO: languages...
"Text display",
"Text subtitles.",
Commit: 273131ce35b6b6151b2ae8bdec983a976909aa2c
https://github.com/scummvm/scummvm/commit/273131ce35b6b6151b2ae8bdec983a976909aa2c
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Quit game menu and mouse warp function
Changed paths:
engines/startrek/graphics.h
engines/startrek/sprite.cpp
engines/startrek/sprite.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index c63b2f6..b3c8493 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -143,8 +143,15 @@ private:
void enableMenuButtons(uint32 bits);
public:
+ void choseMousePositionFromSprites(Sprite *sprites, int numSprites, int spriteIndex, int mode);
void showOptionsMenu(int x, int y);
+ void showSaveMenu();
+ void showLoadMenu();
+ void setMusicEnabled(bool enabled);
+ void setSfxEnabled(bool enabled);
+ void showQuitGamePrompt(int x, int y);
void showTextConfigurationMenu(bool fromOptionMenu);
+
int loadTextDisplayMode();
void saveTextDisplayMode(int value);
diff --git a/engines/startrek/sprite.cpp b/engines/startrek/sprite.cpp
index d58cd30..ba5fa76 100644
--- a/engines/startrek/sprite.cpp
+++ b/engines/startrek/sprite.cpp
@@ -32,4 +32,13 @@ void Sprite::setBitmap(SharedPtr<Bitmap> b) {
bitmapChanged = 1;
}
+/**
+ * Returns a rect containing the sprite's bitmap on the screen.
+ */
+Common::Rect Sprite::getRect() {
+ Common::Rect rect(bitmap->width, bitmap->height);
+ rect.translate(pos.x - bitmap->xoffset, pos.y - bitmap->yoffset);
+ return rect;
+}
+
}
diff --git a/engines/startrek/sprite.h b/engines/startrek/sprite.h
index c7a26de..fa57332 100644
--- a/engines/startrek/sprite.h
+++ b/engines/startrek/sprite.h
@@ -62,6 +62,7 @@ struct Sprite {
Sprite() { memset(this, 0, sizeof(Sprite)); }
void setBitmap(SharedPtr<Bitmap> b);
+ Common::Rect getRect();
};
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index de851b3..82df4be 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -58,6 +58,8 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_mouseControllingShip = false;
_keyboardControlsMouse = true;
+
+ _inQuitGameMenu = false;
}
StarTrekEngine::~StarTrekEngine() {
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 5f57f9b..0453c6a 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -161,6 +161,8 @@ public:
// between items in a menu).
bool _keyboardControlsMouse;
+ bool _inQuitGameMenu;
+
private:
Graphics *_gfx;
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 8c4f05c..de00cb1 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -17,6 +17,7 @@
* 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 "common/events.h"
@@ -31,7 +32,7 @@ enum MenuEvent {
MENUEVENT_RCLICK_OFFBUTTON = -4,
MENUEVENT_ENABLEINPUT, // Makes buttons selectable (occurs after a delay)
MENUEVENT_RCLICK_ONBUTTON,
- MENUEVENT_LCLICK_OFFBUTTON,
+ MENUEVENT_LCLICK_OFFBUTTON
};
// Buttons for standard text display
@@ -896,6 +897,122 @@ void Graphics::enableMenuButtons(uint32 bits) {
_activeMenu->disabledButtons &= ~bits;
}
+/**
+ * This chooses a sprite from the list to place the mouse cursor at. The sprite it chooses
+ * may be, for example, the top-leftmost one in the list. Exact behaviour is determined by
+ * the "mode" parameter.
+ *
+ * If "containMouseSprite" is a valid index, it's ensured that the mouse is contained
+ * within it. "mode" should be -1 in this case.
+ */
+void Graphics::choseMousePositionFromSprites(Sprite *sprites, int numSprites, int containMouseSprite, int mode) {
+ uint16 mouseX1 = 0x7fff; // Candidate positions to warp mouse to
+ uint16 mouseY1 = 0x7fff;
+ uint16 mouseX2 = 0x7fff;
+ uint16 mouseY2 = 0x7fff;
+
+ Common::Point mousePos = getMousePos();
+
+ // Ensure the cursor is contained within one of the sprites
+ if (containMouseSprite >= 0 && containMouseSprite < numSprites) {
+ Common::Rect rect = sprites[containMouseSprite].getRect();
+
+ if (mousePos.x < rect.left || mousePos.x >= rect.right
+ || mousePos.y < rect.top || mousePos.y >= rect.bottom) {
+ mousePos.x = (rect.left + rect.right) / 2;
+ mousePos.y = (rect.top + rect.bottom) / 2;
+ }
+ }
+
+ // Choose a sprite to warp the cursor to
+ for (int i = 0; i < numSprites; i++) {
+ Sprite *sprite = &sprites[i];
+ if (sprite->drawMode != 2)
+ continue;
+
+ Common::Rect rect = sprite->getRect();
+
+ int hCenter = (rect.left + rect.right) / 2;
+ int vCenter = (rect.top + rect.bottom) / 2;
+
+ // Choose which sprite is closest based on certain criteria?
+ switch(mode) {
+ case 0: // Choose topmost, leftmost sprite that's below the cursor
+ if (((vCenter == mousePos.y && hCenter > mousePos.x) || vCenter > mousePos.y)
+ && (vCenter < mouseY1 || (vCenter == mouseY1 && hCenter < mouseX1))) {
+ mouseX1 = hCenter;
+ mouseY1 = vCenter;
+ }
+ // fall through
+
+ case 4: // Choose topmost, leftmost sprite
+ if (vCenter < mouseY2 || (vCenter == mouseY2 && hCenter < mouseX2)) {
+ mouseX2 = hCenter;
+ mouseY2 = vCenter;
+ }
+ break;
+
+ case 1: // Choose bottommost, rightmost sprite that's above the cursor
+ if (((vCenter == mousePos.y && hCenter < mousePos.x) || vCenter < mousePos.y)
+ && (mouseY1 == 0x7fff || vCenter > mouseY1
+ || (vCenter == mouseY1 && hCenter > mouseX1))) {
+ mouseX1 = hCenter;
+ mouseY1 = vCenter;
+ }
+ // fall through
+
+ case 5: // Choose bottommost, rightmost sprite
+ if (mouseY2 == 0x7fff || vCenter > mouseY2
+ || (vCenter == mouseY2 && hCenter > mouseX2)) {
+ mouseX2 = hCenter;
+ mouseY2 = vCenter;
+ }
+ break;
+
+ case 2:
+ // This seems broken... OR condition on first line has no affect on the logic...
+ if ((vCenter < mousePos.y || (vCenter == mouseY1 && hCenter == mousePos.x))
+ && (mouseX1 == 0x7fff || vCenter >= mouseY1)) {
+ mouseX1 = hCenter;
+ mouseY1 = vCenter;
+ debug("Try %d %d", mouseX1, mouseY1);
+ }
+ if (mouseX2 == 0x7fff || vCenter > mouseY2
+ || (hCenter == mouseX2 && vCenter == mouseY2)) {
+ mouseX2 = hCenter;
+ mouseY2 = vCenter;
+ }
+ break;
+
+ case 3:
+ // Similar to above...
+ if ((vCenter > mousePos.y || (vCenter == mouseY1 && hCenter == mousePos.x))
+ && (mouseX1 == 0x7fff || vCenter <= mouseY1)) {
+ mouseX1 = hCenter;
+ mouseY1 = vCenter;
+ }
+ if (mouseX2 == 0x7fff || vCenter < mouseY2
+ || (hCenter == mouseX2 && vCenter == mouseY2)) {
+ mouseX2 = hCenter;
+ mouseY2 = vCenter;
+ }
+ break;
+ }
+ }
+
+ // Warp mouse to one of the coordinates, if one is valid
+ if (mouseX1 != 0x7fff) {
+ mousePos.x = mouseX1;
+ mousePos.y = mouseY1;
+ }
+ else if (mouseX2 != 0x7fff) {
+ mousePos.x = mouseX2;
+ mousePos.y = mouseY2;
+ }
+
+ _vm->_system->warpMouse(mousePos.x, mousePos.y);
+
+}
void Graphics::showOptionsMenu(int x, int y) {
bool tmpMouseControllingShip = _vm->_mouseControllingShip;
@@ -927,7 +1044,7 @@ void Graphics::showOptionsMenu(int x, int y) {
disabledButtons |= (1 << OPTIONBUTTON_ENABLESFX) | (1 << OPTIONBUTTON_DISABLESFX);
disableMenuButtons(disabledButtons);
- // sub_28b5d();
+ choseMousePositionFromSprites(_activeMenu->sprites, _activeMenu->numButtons, -1, 4);
int event = handleMenuEvents(0, false);
unloadMenuButtons();
@@ -940,14 +1057,28 @@ void Graphics::showOptionsMenu(int x, int y) {
// Can't use OPTIONBUTTON constants since the button retvals differ from the button
// indices...
- switch(event) { // TODO
+ switch(event) {
case 0: // Save
+ showSaveMenu();
+ break;
case 1: // Load
+ showLoadMenu();
+ break;
case 2: // Enable music
+ setMusicEnabled(true);
+ break;
case 3: // Disable music
+ setMusicEnabled(false);
+ break;
case 4: // Enable sfx
+ setSfxEnabled(true);
+ break;
case 5: // Disable sfx
+ setSfxEnabled(false);
+ break;
case 6: // Quit
+ showQuitGamePrompt(120, 20); // TODO: revert 120 to 20
+ break;
case 7: // Text
showTextConfigurationMenu(true);
break;
@@ -956,6 +1087,43 @@ void Graphics::showOptionsMenu(int x, int y) {
}
}
+void Graphics::showSaveMenu() {
+ // TODO
+}
+
+void Graphics::showLoadMenu() {
+ // TODO
+}
+
+void Graphics::setMusicEnabled(bool enabled) {
+ // TODO
+}
+
+void Graphics::setSfxEnabled(bool enabled) {
+ // TODO
+}
+
+void Graphics::showQuitGamePrompt(int x, int y) {
+ const char *options[] = {
+ "Quit Game",
+ "#GENE\\GENER028#Yes, quit the game.",
+ "#GENE\\GENER008#No, do not quit the game.",
+ ""
+ };
+
+ if (_vm->_inQuitGameMenu)
+ return;
+
+ _vm->_inQuitGameMenu = true;
+ int val = showText(&Graphics::readTextFromArray, (uintptr)options, x, y, 0xb0, true, 0, 1);
+ _vm->_inQuitGameMenu = false;
+
+ if (val == 0) {
+ // sub_1e70d();
+ _vm->_system->quit();
+ }
+}
+
/**
* This can be called from startup or from the options menu.
* On startup, this tries to load the setting without user input.
Commit: 432a2023e2e1a404788c3b1292313434cce38842
https://github.com/scummvm/scummvm/commit/432a2023e2e1a404788c3b1292313434cce38842
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fix placement of textboxes
Changed paths:
engines/startrek/text.cpp
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index de00cb1..e9c22d4 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -445,7 +445,7 @@ String Graphics::readTextFromArray(int choiceIndex, uintptr data, String *header
*/
SharedPtr<TextBitmap> Graphics::initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite) {
int linesBeforeTextStart = 2;
- if (withHeader != 0)
+ if (withHeader)
linesBeforeTextStart = 4;
int xoffset = *xoffsetPtr;
@@ -463,26 +463,26 @@ SharedPtr<TextBitmap> Graphics::initTextSprite(int *xoffsetPtr, int *yoffsetPtr,
memset(bitmap->pixels, ' ', textHeight*TEXTBOX_WIDTH);
- int varC = SCREEN_WIDTH-1 - xoffset - (bitmap->width+0x1d)/2;
+ int varC = SCREEN_WIDTH-1 - xoffset - (bitmap->width + 0x1d) / 2;
if (varC < 0)
xoffset += varC;
- varC = xoffset - (bitmap->width+0x1d)/2;
+ varC = xoffset - (bitmap->width + 0x1d) / 2;
if (varC < 1)
- xoffset += varC-1;
+ xoffset -= varC - 1;
- varC = yoffset - (bitmap->height+0x11) - 20;
+ varC = yoffset - (bitmap->height + 0x11) - 20;
if (varC < 0)
yoffset -= varC;
- xoffset -= (bitmap->width+0x1d)/2;
+ xoffset -= (bitmap->width + 0x1d)/2;
yoffset -= bitmap->height;
bitmap->pixels[0] = 0x10;
memset(&bitmap->pixels[1], 0x11, TEXTBOX_WIDTH-2);
bitmap->pixels[TEXTBOX_WIDTH-1] = 0x12;
- byte *textAddr = bitmap->pixels+TEXTBOX_WIDTH;
+ byte *textAddr = bitmap->pixels + TEXTBOX_WIDTH;
if (withHeader) {
textAddr[0] = 0x13;
@@ -1077,7 +1077,7 @@ void Graphics::showOptionsMenu(int x, int y) {
setSfxEnabled(false);
break;
case 6: // Quit
- showQuitGamePrompt(120, 20); // TODO: revert 120 to 20
+ showQuitGamePrompt(20, 20);
break;
case 7: // Text
showTextConfigurationMenu(true);
@@ -1139,8 +1139,7 @@ void Graphics::showTextConfigurationMenu(bool fromOptionMenu) {
int val;
if (fromOptionMenu || (val = loadTextDisplayMode()) == -1) {
- // TODO: fix X coordinate (should be 0x14, not 130)
- val = showText(&Graphics::readTextFromArray, (uintptr)options, 130, 0x1e, 0xb0, true, 0, 1);
+ val = showText(&Graphics::readTextFromArray, (uintptr)options, 20, 30, 0xb0, true, 0, 1);
saveTextDisplayMode(val);
}
Commit: e578aa131f8648355069875b58f1e4fd0044e701
https://github.com/scummvm/scummvm/commit/e578aa131f8648355069875b58f1e4fd0044e701
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Rects don't include right/bottom pixel.
Fixes some off-by-one errors.
Changed paths:
engines/startrek/graphics.cpp
engines/startrek/sprite.h
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index dedbf93..ced8d82 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -38,7 +38,7 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_priData = nullptr;
_lutData = nullptr;
- _screenRect = Common::Rect(SCREEN_WIDTH-1, SCREEN_HEIGHT-1);
+ _screenRect = Common::Rect(SCREEN_WIDTH, SCREEN_HEIGHT);
if (ConfMan.hasKey("render_mode"))
_egaMode = (Common::parseRenderMode(ConfMan.get("render_mode").c_str()) == Common::kRenderEGA) && (_vm->getGameType() != GType_STJR) && !(_vm->getFeatures() & GF_DEMO);
@@ -133,12 +133,12 @@ void Graphics::loadPri(const char *priFile) {
SharedPtr<Common::SeekableReadStream> priStream = _vm->openFile(priFile);
delete[] _priData;
- _priData = new byte[SCREEN_WIDTH*SCREEN_HEIGHT/2];
- priStream->read(_priData, SCREEN_WIDTH*SCREEN_HEIGHT/2);
+ _priData = new byte[SCREEN_WIDTH*SCREEN_HEIGHT / 2];
+ priStream->read(_priData, SCREEN_WIDTH*SCREEN_HEIGHT / 2);
}
SharedPtr<Bitmap> Graphics::loadBitmap(Common::String basename) {
- return SharedPtr<Bitmap>(new Bitmap(_vm->openFile(basename+".BMP")));
+ return SharedPtr<Bitmap>(new Bitmap(_vm->openFile(basename + ".BMP")));
}
Common::Point Graphics::getMousePos() {
@@ -156,14 +156,18 @@ void Graphics::redrawScreen() {
}
void Graphics::drawSprite(const Sprite &sprite) {
- drawSprite(sprite, Common::Rect(sprite.drawX,sprite.drawY,sprite.drawX+sprite.bitmap->width-1,sprite.drawY+sprite.bitmap->height-1));
+ int left = sprite.drawX;
+ int top = sprite.drawY;
+ int right = left + sprite.bitmap->width;
+ int bottom = top + sprite.bitmap->height;
+ drawSprite(sprite, Common::Rect(left, top, right, bottom));
}
// rect is the portion of the sprite to update. It must be entirely contained within the
// sprite's actual, full rectangle.
void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
Common::Rect spriteRect = Common::Rect(sprite.drawX, sprite.drawY,
- sprite.drawX+sprite.bitmap->width-1, sprite.drawY+sprite.bitmap->height-1);
+ sprite.drawX+sprite.bitmap->width, sprite.drawY+sprite.bitmap->height);
assert(_screenRect.contains(rect));
assert(spriteRect.contains(rect));
@@ -179,14 +183,14 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
int priOffset = rect.top*SCREEN_WIDTH + rect.left;
- for (int y=rect.top; y<=rect.bottom; y++) {
- for (int x=rect.left; x<=rect.right; x++) {
- byte priByte = _priData[priOffset/2];
+ for (int y = rect.top; y < rect.bottom; y++) {
+ for (int x = rect.left; x < rect.right; x++) {
+ byte priByte = _priData[priOffset / 2];
byte bgPriority;
- if ((priOffset%2) == 1)
- bgPriority = priByte&0xf;
+ if ((priOffset % 2) == 1)
+ bgPriority = priByte & 0xf;
else
- bgPriority = priByte>>4;
+ bgPriority = priByte >> 4;
priOffset++;
byte b = *src++;
@@ -197,9 +201,9 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
*dest++ = b;
}
- src += sprite.bitmap->width - rect.width() - 1;
- dest += SCREEN_WIDTH - rect.width() - 1;
- priOffset += SCREEN_WIDTH - rect.width() - 1;
+ src += sprite.bitmap->width - rect.width();
+ dest += SCREEN_WIDTH - rect.width();
+ priOffset += SCREEN_WIDTH - rect.width();
}
break;
}
@@ -211,8 +215,8 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
byte *src = sprite.bitmap->pixels + (rect.left - sprite.drawX)
+ (rect.top - sprite.drawY) * sprite.bitmap->width;
- for (int y=rect.top; y<=rect.bottom; y++) {
- for (int x=rect.left; x<=rect.right; x++) {
+ for (int y = rect.top; y < rect.bottom; y++) {
+ for (int x = rect.left; x < rect.right; x++) {
byte b = *src;
if (b == 0) // Transparent (darken the pixel)
@@ -224,8 +228,8 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
dest++;
}
- src += sprite.bitmap->width - rect.width() - 1;
- dest += SCREEN_WIDTH - rect.width() - 1;
+ src += sprite.bitmap->width - rect.width();
+ dest += SCREEN_WIDTH - rect.width();
}
break;
@@ -237,21 +241,21 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
Common::Rect rectangle1;
- rectangle1.left = (rect.left - sprite.drawX)/8;
- rectangle1.top = (rect.top - sprite.drawY)/8;
- rectangle1.right = (rect.right - sprite.drawX)/8;
- rectangle1.bottom = (rect.bottom - sprite.drawY)/8;
+ rectangle1.left = (rect.left - sprite.drawX) / 8;
+ rectangle1.top = (rect.top - sprite.drawY) / 8;
+ rectangle1.right = (rect.right - sprite.drawX) / 8;
+ rectangle1.bottom = (rect.bottom - sprite.drawY) / 8;
- int drawWidth = rectangle1.width() + 1;
- int drawHeight = rectangle1.height() + 1;
+ int drawWidth = rectangle1.width();
+ int drawHeight = rectangle1.height();
dest = (byte*)surface->getPixels() + sprite.drawY*SCREEN_WIDTH + sprite.drawX
+ rectangle1.top*8*SCREEN_WIDTH + rectangle1.left*8;
- byte *src = sprite.bitmap->pixels + rectangle1.top*sprite.bitmap->width/8 + rectangle1.left;
+ byte *src = sprite.bitmap->pixels + rectangle1.top * sprite.bitmap->width / 8 + rectangle1.left;
- for (int y=0; y<drawHeight; y++) {
- for (int x=0; x<drawWidth; x++) {
+ for (int y=0; y < drawHeight; y++) {
+ for (int x=0; x < drawWidth; x++) {
byte c = *src;
int textColor;
@@ -262,8 +266,8 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
byte *fontData = _font->getCharData(c);
- for (int i=0;i<8;i++) {
- for (int j=0;j<8;j++) {
+ for (int i = 0; i < 8; i++) {
+ for (int j = 0; j < 8; j++) {
byte b = *fontData;
if (b == 0) // Transparent: use lookup table to darken this pixel
@@ -279,12 +283,12 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
dest += SCREEN_WIDTH - 8;
}
- dest -= (SCREEN_WIDTH*8 - 8);
+ dest -= (SCREEN_WIDTH * 8 - 8);
src++;
}
- src += sprite.bitmap->width/8 - drawWidth;
- dest += SCREEN_WIDTH*8 - drawWidth*8;
+ src += (sprite.bitmap->width / 8) - drawWidth;
+ dest += (SCREEN_WIDTH * 8) - drawWidth * 8;
}
@@ -300,6 +304,8 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
}
void Graphics::drawAllSprites() {
+ // TODO: different video modes?
+
if (_numSprites == 0)
return;
@@ -308,13 +314,12 @@ void Graphics::drawAllSprites() {
// Update sprite rectangles
for (int i=0; i<_numSprites; i++) {
Sprite *spr = _sprites[i];
- spr->bitmapChanged = true; // FIXME (delete this later)
Common::Rect rect;
rect.left = spr->pos.x - spr->bitmap->xoffset;
rect.top = spr->pos.y - spr->bitmap->yoffset;
- rect.right = rect.left + spr->bitmap->width - 1;
- rect.bottom = rect.top + spr->bitmap->height - 1;
+ rect.right = rect.left + spr->bitmap->width;
+ rect.bottom = rect.top + spr->bitmap->height;
spr->drawX = rect.left;
spr->drawY = rect.top;
@@ -322,7 +327,7 @@ void Graphics::drawAllSprites() {
spr->drawRect = rect.findIntersectingRect(_screenRect);
if (!spr->drawRect.isEmpty()) { // At least partly on-screen
- if (spr->lastDrawRect.left <= spr->lastDrawRect.right) {
+ if (spr->lastDrawRect.left < spr->lastDrawRect.right) {
// If the sprite's position is close to where it was last time it was
// drawn, combine the two rectangles and redraw that whole section.
// Otherwise, redraw the old position and current position separately.
@@ -349,10 +354,10 @@ void Graphics::drawAllSprites() {
}
// Determine what portions of the screen need to be updated
- Common::Rect dirtyRects[MAX_SPRITES*2];
+ Common::Rect dirtyRects[MAX_SPRITES * 2];
int numDirtyRects = 0;
- for (int i=0; i<_numSprites; i++) {
+ for (int i = 0; i < _numSprites; i++) {
Sprite *spr = _sprites[i];
if (spr->bitmapChanged) {
@@ -372,22 +377,22 @@ void Graphics::drawAllSprites() {
}
// Redraw the background on every dirty rectangle
- for (int i=0; i<numDirtyRects; i++) {
+ for (int i = 0; i < numDirtyRects; i++) {
Common::Rect &r = dirtyRects[i];
- int offset = r.top*SCREEN_WIDTH + r.left;
+ int offset = r.top * SCREEN_WIDTH + r.left;
_vm->_system->copyRectToScreen(_backgroundImage->pixels+offset, SCREEN_WIDTH, r.left, r.top, r.width(), r.height());
}
// For each sprite, merge the rectangles that overlap with it and redraw the sprite.
- for (int i=0; i<_numSprites; i++) {
+ for (int i = 0; i < _numSprites; i++) {
Sprite *spr = _sprites[i];
if (!spr->field16 && spr->isOnScreen) {
bool mustRedrawSprite = false;
Common::Rect rect2;
- for (int j=0; j<numDirtyRects; j++) {
+ for (int j = 0; j < numDirtyRects; j++) {
Common::Rect rect1 = spr->drawRect.findIntersectingRect(dirtyRects[j]);
if (!rect1.isEmpty()) {
@@ -404,7 +409,7 @@ void Graphics::drawAllSprites() {
}
spr->field16 = false;
- spr->bitmapChanged = 0;
+ spr->bitmapChanged = false;
spr->lastDrawRect = spr->drawRect;
}
@@ -419,6 +424,7 @@ void Graphics::addSprite(Sprite *sprite) {
sprite->drawMode = 0;
sprite->field8 = 0;
sprite->field16 = false;
+ sprite->bitmapChanged = true; // FIXME (delete this later?)
sprite->lastDrawRect.top = -1;
sprite->lastDrawRect.left = -1;
@@ -445,9 +451,9 @@ void Graphics::delSprite(Sprite *sprite) {
void Graphics::drawBitmapToScreen(Bitmap *bitmap) {
int xoffset = bitmap->xoffset;
int yoffset = bitmap->yoffset;
- if (xoffset >= 320)
+ if (xoffset >= SCREEN_WIDTH)
xoffset = 0;
- if (yoffset >= 200)
+ if (yoffset >= SCREEN_HEIGHT)
yoffset = 0;
_vm->_system->copyRectToScreen(bitmap->pixels, bitmap->width, xoffset, yoffset, bitmap->width, bitmap->height);
diff --git a/engines/startrek/sprite.h b/engines/startrek/sprite.h
index fa57332..1e75cc4 100644
--- a/engines/startrek/sprite.h
+++ b/engines/startrek/sprite.h
@@ -37,12 +37,10 @@ using Common::SharedPtr;
namespace StarTrek {
-// Note: Rects in Star Trek are probably considered to have their bottom-right pixel
-// contained in the rectangle, but ScummVM is the opposite... (Trek might be inconsistent)
-// Be careful when using some of Rect's functions, including:
-// * The width/height constructor
-// * width/height methods
-// * "contains" method for points (it should work for other rects)
+// Note: Rects in Star Trek are considered to have their bottom-right pixel contained in
+// the rectangle, but ScummVM rects are not. Functions from Trek have been adapted to use
+// ScummVM's rect format. Be wary of off-by-1 errors...
+
struct Sprite {
Common::Point pos;
uint16 drawPriority;
Commit: aac4b2e99d4cfa64dfb25bae85012235702ab6fe
https://github.com/scummvm/scummvm/commit/aac4b2e99d4cfa64dfb25bae85012235702ab6fe
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Music/SFX enable and disable functions
Changed paths:
engines/startrek/graphics.h
engines/startrek/sound.cpp
engines/startrek/sound.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index b3c8493..efcf27d 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -147,8 +147,6 @@ public:
void showOptionsMenu(int x, int y);
void showSaveMenu();
void showLoadMenu();
- void setMusicEnabled(bool enabled);
- void setSfxEnabled(bool enabled);
void showQuitGamePrompt(int x, int y);
void showTextConfigurationMenu(bool fromOptionMenu);
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index ac23cf6..2871a88 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -17,6 +17,7 @@
* 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 "startrek/sound.h"
@@ -59,7 +60,7 @@ Sound::Sound(StarTrekEngine *vm) : _vm(vm) {
loadedSoundData = nullptr;
for (int i=1; i<8; i++) {
- _sfxSlotList.push_back(&_midiSlots[i]);
+ _midiSlotList.push_back(&_midiSlots[i]);
}
if (!SearchMan.hasFile("voc/speech.mrk")) {
@@ -78,37 +79,50 @@ Sound::~Sound() {
}
+/**
+ * Plays a midi track as a sound effect (one of midi slots 1-7)
+ */
void Sound::playMidiTrack(int track) {
if (!_vm->_musicEnabled || !_vm->_musicWorking)
return;
- assert(loadedSoundData != NULL);
-
- debugC(6, kDebugSound, "Playing MIDI track %d", track);
+ assert(loadedSoundData != nullptr);
// Check if a midi slot for this track exists already
for (int i=1; i<8; i++) {
if (_midiSlots[i].track == track) {
+ debugC(6, kDebugSound, "Playing MIDI track %d (slot %d)", track, i);
_midiSlots[i].midiParser->loadMusic(loadedSoundData, sizeof(loadedSoundData));
_midiSlots[i].midiParser->setTrack(track);
// Shift this to the back (most recently used)
- _sfxSlotList.remove(&_midiSlots[i]);
- _sfxSlotList.push_back(&_midiSlots[i]);
+ _midiSlotList.remove(&_midiSlots[i]);
+ _midiSlotList.push_back(&_midiSlots[i]);
return;
}
}
// Take the least recently used slot and use that for the sound effect
- MidiPlaybackSlot *slot = _sfxSlotList.front();
- _sfxSlotList.pop_front();
- _sfxSlotList.push_back(slot);
- slot->track = track;
- slot->midiParser->loadMusic(loadedSoundData, sizeof(loadedSoundData));
- slot->midiParser->setTrack(track);
+ MidiPlaybackSlot *slot = _midiSlotList.front();
+ _midiSlotList.pop_front();
+ _midiSlotList.push_back(slot);
+ playMidiTrackInSlot(slot->slot, track);
}
-void Sound::loadMusicFile(const char *baseSoundName) {
+void Sound::playMidiTrackInSlot(int slot, int track) {
+ assert(loadedSoundData != nullptr);
+ debugC(6, kDebugSound, "Playing MIDI track %d (slot %d)", track, slot);
+
+ clearMidiSlot(slot);
+
+ if (track != -1) {
+ _midiSlots[slot].track = track;
+ _midiSlots[slot].midiParser->loadMusic(loadedSoundData, sizeof(loadedSoundData));
+ _midiSlots[slot].midiParser->setTrack(track);
+ }
+}
+
+void Sound::loadMusicFile(const Common::String &baseSoundName) {
clearAllMidiSlots();
/*
if (_vm->getPlatform() == Common::kPlatformAmiga)
@@ -122,7 +136,20 @@ void Sound::loadMusicFile(const char *baseSoundName) {
loadPCMusicFile(baseSoundName);
}
-void Sound::playSoundEffect(const char *baseSoundName) {
+void Sound::playMidiMusicTracks(int startTrack, int loopTrack) {
+ if (!_vm->_musicWorking || !_vm->_musicEnabled)
+ return;
+
+ if (loopTrack == -3)
+ _loopingMidiTrack = startTrack;
+ else if (loopTrack != -2)
+ _loopingMidiTrack = loopTrack;
+
+ if (startTrack != -2 && _vm->_musicEnabled)
+ playMidiTrackInSlot(0, startTrack);
+}
+
+void Sound::playVoc(const Common::String &baseSoundName) {
/*
if (_vm->getPlatform() == Common::kPlatformAmiga)
playAmigaSoundEffect(baseSoundName);
@@ -130,13 +157,14 @@ void Sound::playSoundEffect(const char *baseSoundName) {
playMacSoundEffect(baseSoundName);
else
*/
- if (scumm_stricmp(baseSoundName+4, "loop") == 0)
- _loopingAudioName = Common::String(baseSoundName);
+ if (baseSoundName.size() == 8 && baseSoundName.hasSuffixIgnoreCase("loop"))
+ _loopingAudioName = baseSoundName;
if (!_vm->_sfxEnabled || !_vm->_sfxWorking)
return;
/*
+ // This is probably just driver initialization stuff...
if (word_5113a == 0)
sub_2aaa3();
*/
@@ -156,7 +184,7 @@ void Sound::playSoundEffect(const char *baseSoundName) {
return;
}
- debugC(3, kDebugSound, "No sound slot to play '%s'", baseSoundName);
+ debugC(3, kDebugSound, "No sound slot to play '%s'", baseSoundName.c_str());
}
void Sound::playSpeech(const Common::String &basename) {
@@ -196,6 +224,17 @@ void Sound::playSpeech(const Common::String &basename) {
_playingSpeech = true;
}
+/**
+ * Called when disabling sfx.
+ */
+void Sound::stopAllVocSounds() {
+ stopPlayingSpeech();
+
+ for (int i = 0; i < MAX_SFX_PLAYING; i++) {
+ _vm->_system->getMixer()->stopHandle(_sfxHandles[i]);
+ }
+}
+
void Sound::stopPlayingSpeech() {
if (_playingSpeech) {
debugC(5, kDebugSound, "Canceled speech playback");
@@ -205,8 +244,40 @@ void Sound::stopPlayingSpeech() {
}
+void Sound::setMusicEnabled(bool enable) {
+ if (!_vm->_musicWorking || _vm->_musicEnabled == enable)
+ return;
+
+ _vm->_musicEnabled = enable;
+
+ if (enable)
+ playMidiMusicTracks(_loopingMidiTrack, _loopingMidiTrack);
+ else
+ clearMidiSlot(0);
+}
+
+void Sound::setSfxEnabled(bool enable) {
+ if (!_vm->_sfxWorking || _vm->_sfxEnabled == enable)
+ return;
+
+ _vm->_sfxEnabled = enable;
+
+ if (!enable) {
+ for (int i = 1; i < 8; i++)
+ clearMidiSlot(i);
+ }
+
+ if (!enable) {
+ stopAllVocSounds();
+ }
+ else if (!_loopingAudioName.empty()) {
+ playVoc(_loopingAudioName);
+ }
+}
+
+
// XMIDI or SM sound
-void Sound::loadPCMusicFile(const char *baseSoundName) {
+void Sound::loadPCMusicFile(const Common::String &baseSoundName) {
Common::String soundName = baseSoundName;
soundName += '.';
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
index a911662..2caa1d0 100644
--- a/engines/startrek/sound.h
+++ b/engines/startrek/sound.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/sound.h $
- * $Id: sound.h 15 2010-06-27 06:13:42Z clone2727 $
- *
*/
#ifndef STARTREK_SOUND_H
@@ -41,7 +38,7 @@ namespace StarTrek {
class StarTrekEngine;
-const int MAX_LOADED_SFX_FILES = 8;
+// Max # of VOC files that can play at once
const int MAX_SFX_PLAYING = 4;
struct MidiPlaybackSlot {
@@ -57,24 +54,29 @@ public:
~Sound();
void playMidiTrack(int track);
-
- void loadMusicFile(const char *baseSoundName);
- void playSoundEffect(const char *baseSoundName);
+ void playMidiTrackInSlot(int slot, int track);
+ void loadMusicFile(const Common::String &baseSoundName);
+ void playMidiMusicTracks(int startTrack, int loopTrack);
+ void playVoc(const Common::String &baseSoundName);
void playSpeech(const Common::String &basename);
+ void stopAllVocSounds();
void stopPlayingSpeech();
+ void setMusicEnabled(bool enable);
+ void setSfxEnabled(bool enable);
private:
StarTrekEngine *_vm;
Audio::SoundHandle *_soundHandle;
- void loadPCMusicFile(const char *baseSoundName);
+ void loadPCMusicFile(const Common::String &baseSoundName);
void clearMidiSlot(int slot);
void clearAllMidiSlots();
// MIDI-Related Variables
MidiDriver *_midiDriver;
MidiPlaybackSlot _midiSlots[8]; // 0 is for music; 1-7 are for sfx
- Common::List<MidiPlaybackSlot*> _sfxSlotList; // Sorts midi slots by most recently used
+ Common::List<MidiPlaybackSlot*> _midiSlotList; // Sorts midi slots by most recently used
+ int _loopingMidiTrack;
byte *loadedSoundData;
uint32 _midiDevice;
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 82df4be..40fa8d7 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -81,7 +81,7 @@ Common::Error StarTrekEngine::run() {
assert(_macResFork->hasDataFork() && _macResFork->hasResFork());
}
- initGraphics(320, 200);
+ initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT);
initializeEventsAndMouse();
@@ -199,49 +199,49 @@ void StarTrekEngine::pollSystemEvents() {
void StarTrekEngine::playSoundEffectIndex(int index) {
switch(index) {
case 0x04:
- _sound->playSoundEffect("tricorde");
+ _sound->playVoc("tricorde");
break;
case 0x05:
- _sound->playSoundEffect("STDOOR1");
+ _sound->playVoc("STDOOR1");
break;
case 0x06:
- _sound->playSoundEffect("PHASSHOT");
+ _sound->playVoc("PHASSHOT");
break;
case 0x07:
_sound->playMidiTrack(index);
break;
case 0x08:
- _sound->playSoundEffect("TRANSDEM");
+ _sound->playVoc("TRANSDEM");
break;
case 0x09:
- _sound->playSoundEffect("TRANSMAT");
+ _sound->playVoc("TRANSMAT");
break;
case 0x0a:
- _sound->playSoundEffect("TRANSENE");
+ _sound->playVoc("TRANSENE");
break;
case 0x10: // Menu selection sound
_sound->playMidiTrack(index);
break;
case 0x22:
- _sound->playSoundEffect("HAILING");
+ _sound->playVoc("HAILING");
break;
case 0x24:
- _sound->playSoundEffect("PHASSHOT");
+ _sound->playVoc("PHASSHOT");
break;
case 0x25:
- _sound->playSoundEffect("PHOTSHOT");
+ _sound->playVoc("PHOTSHOT");
break;
case 0x26:
- _sound->playSoundEffect("HITSHIEL");
+ _sound->playVoc("HITSHIEL");
break;
case 0x27:
_sound->playMidiTrack(index);
break;
case 0x28:
- _sound->playSoundEffect("REDALERT");
+ _sound->playVoc("REDALERT");
break;
case 0x29:
- _sound->playSoundEffect("WARP");
+ _sound->playVoc("WARP");
break;
default:
break;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 0453c6a..5e81f77 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -164,11 +164,11 @@ public:
bool _inQuitGameMenu;
-private:
Graphics *_gfx;
Sound *_sound;
- Common::MacResManager *_macResFork;
+private:
+ Common::MacResManager *_macResFork;
Room *_room;
};
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index e9c22d4..9f1285b 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -816,7 +816,7 @@ void Graphics::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
SharedPtr<FileStream> stream = _vm->openFile(mnuFilename + ".MNU");
_activeMenu->menuFile = stream;
- _activeMenu->numButtons = _activeMenu->menuFile->size()/16;
+ _activeMenu->numButtons = _activeMenu->menuFile->size() / 16;
for (int i = 0; i < _activeMenu->numButtons; i++) {
memset(&_activeMenu->sprites[i], 0, sizeof(Sprite));
@@ -824,9 +824,9 @@ void Graphics::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
_activeMenu->sprites[i].drawMode = 2;
char bitmapBasename[11];
- stream->seek(i*16, SEEK_SET);
+ stream->seek(i * 16, SEEK_SET);
stream->read(bitmapBasename, 10);
- for (int j=0; j<10; j++) {
+ for (int j = 0; j < 10; j++) {
if (bitmapBasename[j] == ' ')
bitmapBasename[j] = '\0';
}
@@ -840,7 +840,7 @@ void Graphics::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
_activeMenu->sprites[i].field6 = 8;
}
- if (_activeMenu->retvals[_activeMenu->numButtons-1] == 0) {
+ if (_activeMenu->retvals[_activeMenu->numButtons - 1] == 0) {
// Set default retvals for buttons
for (int i = 0; i < _activeMenu->numButtons; i++)
_activeMenu->retvals[i] = i;
@@ -1065,16 +1065,16 @@ void Graphics::showOptionsMenu(int x, int y) {
showLoadMenu();
break;
case 2: // Enable music
- setMusicEnabled(true);
+ _vm->_sound->setMusicEnabled(true);
break;
case 3: // Disable music
- setMusicEnabled(false);
+ _vm->_sound->setMusicEnabled(false);
break;
case 4: // Enable sfx
- setSfxEnabled(true);
+ _vm->_sound->setSfxEnabled(true);
break;
case 5: // Disable sfx
- setSfxEnabled(false);
+ _vm->_sound->setSfxEnabled(false);
break;
case 6: // Quit
showQuitGamePrompt(20, 20);
@@ -1095,14 +1095,6 @@ void Graphics::showLoadMenu() {
// TODO
}
-void Graphics::setMusicEnabled(bool enabled) {
- // TODO
-}
-
-void Graphics::setSfxEnabled(bool enabled) {
- // TODO
-}
-
void Graphics::showQuitGamePrompt(int x, int y) {
const char *options[] = {
"Quit Game",
Commit: fde5f22f9783c557c74d0267d8118c1a0c6d498e
https://github.com/scummvm/scummvm/commit/fde5f22f9783c557c74d0267d8118c1a0c6d498e
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: setVisibleMenuButtons function
Changed paths:
engines/startrek/graphics.h
engines/startrek/text.cpp
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index efcf27d..277c636 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -141,6 +141,7 @@ private:
void unloadMenuButtons();
void disableMenuButtons(uint32 bits);
void enableMenuButtons(uint32 bits);
+ void setVisibleMenuButtons(uint32 bits);
public:
void choseMousePositionFromSprites(Sprite *sprites, int numSprites, int spriteIndex, int mode);
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 9f1285b..923ebc6 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -135,9 +135,14 @@ int Graphics::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int
bool tmpMouseControllingShip = _vm->_mouseControllingShip;
_vm->_mouseControllingShip = false;
- int var80 = (numChoices > 1 ? 0x18 : 0);
+ // Decide which buttons to show
+ uint32 visibleButtons = (1 << TEXTBUTTON_CONFIRM);
+ if (numChoices > 1)
+ visibleButtons |= (1 << TEXTBUTTON_PREVCHOICE) | (1 << TEXTBUTTON_NEXTCHOICE);
+ if (numTextLines > numTextboxLines)
+ visibleButtons |= (1 << TEXTBUTTON_SCROLLUP) | (1 << TEXTBUTTON_SCROLLDOWN);
+ setVisibleMenuButtons(visibleButtons);
- // TODO: sub_288FB function call
disableMenuButtons(1 << TEXTBUTTON_SCROLLUP); // Disable scroll up
if (var7c == 0) { // Disable done button
@@ -251,10 +256,10 @@ reloadText:
scrollOffset = 0;
lineFormattedText = readLineFormattedText(textGetter, var, choiceIndex, textBitmap, numTextboxLines, &numTextLines);
if (numTextLines <= numTextboxLines) {
- // sub_288FB(0x0019);
+ setVisibleMenuButtons((1 << TEXTBUTTON_CONFIRM) | (1 << TEXTBUTTON_PREVCHOICE) | (1 << TEXTBUTTON_NEXTCHOICE));
}
else {
- // sub_288FB(0x001F);
+ setVisibleMenuButtons((1 << TEXTBUTTON_CONFIRM) | (1 << TEXTBUTTON_SCROLLUP) | (1 << TEXTBUTTON_SCROLLDOWN)| (1 << TEXTBUTTON_PREVCHOICE) | (1 << TEXTBUTTON_NEXTCHOICE));
}
enableMenuButtons(1 << TEXTBUTTON_SCROLLDOWN);
disableMenuButtons(1 << TEXTBUTTON_SCROLLUP);
@@ -898,6 +903,52 @@ void Graphics::enableMenuButtons(uint32 bits) {
}
/**
+ * Sets which buttons are visible based on the given bitmask.
+ */
+void Graphics::setVisibleMenuButtons(uint32 bits) {
+ for (int i = 0; i < _activeMenu->numButtons; i++) {
+ Sprite *sprite = &_activeMenu->sprites[i];
+ uint32 spriteBitmask = (1 << i);
+ if (spriteBitmask == 0)
+ break;
+
+ if ((bits & spriteBitmask) == 0 || sprite->drawMode != 0) {
+ if ((bits & spriteBitmask) == 0 && sprite->drawMode == 2) {
+ if (i == _activeMenu->selectedButton) {
+ drawMenuButtonOutline(sprite->bitmap, 0x00);
+ _activeMenu->selectedButton = -1;
+ }
+
+ sprite->field16 = true;
+ sprite->bitmapChanged = true;
+ }
+ }
+ else {
+ addSprite(sprite);
+ sprite->drawMode = 2;
+ sprite->bitmapChanged = true;
+ }
+ }
+
+ drawAllSprites();
+
+ for (int i = 0; i < _activeMenu->numButtons; i++) {
+ Sprite *sprite = &_activeMenu->sprites[i];
+ uint32 spriteBitmask = (1 << i);
+ if (spriteBitmask == 0)
+ break;
+
+ if ((bits & spriteBitmask) == 0 && sprite->drawMode == 2) {
+ delSprite(sprite);
+
+ // Setting drawMode to 0 is the game's way of saying that the menu button is
+ // hidden (since it would normally be 2).
+ sprite->drawMode = 0;
+ }
+ }
+}
+
+/**
* This chooses a sprite from the list to place the mouse cursor at. The sprite it chooses
* may be, for example, the top-leftmost one in the list. Exact behaviour is determined by
* the "mode" parameter.
@@ -927,7 +978,7 @@ void Graphics::choseMousePositionFromSprites(Sprite *sprites, int numSprites, in
// Choose a sprite to warp the cursor to
for (int i = 0; i < numSprites; i++) {
Sprite *sprite = &sprites[i];
- if (sprite->drawMode != 2)
+ if (sprite->drawMode != 2) // Skip hidden buttons
continue;
Common::Rect rect = sprite->getRect();
Commit: d375429abef0109a483970975b053292efa4bd6e
https://github.com/scummvm/scummvm/commit/d375429abef0109a483970975b053292efa4bd6e
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Objects and animations.
Testing them with the transporter room.
Changed paths:
A engines/startrek/object.cpp
A engines/startrek/object.h
engines/startrek/filestream.h
engines/startrek/font.cpp
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/sound.cpp
engines/startrek/sound.h
engines/startrek/sprite.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/filestream.h b/engines/startrek/filestream.h
index 475bbcf..dcc8060 100644
--- a/engines/startrek/filestream.h
+++ b/engines/startrek/filestream.h
@@ -39,7 +39,7 @@ private:
public:
// ReadStream functions
virtual bool eos() const;
- virtual uint32 read(void* dataPtr, uint32 dataSize);
+ virtual uint32 read(void *dataPtr, uint32 dataSize);
// SeekableReadStream functions
virtual int32 pos() const;
diff --git a/engines/startrek/font.cpp b/engines/startrek/font.cpp
index db31042..8463841 100644
--- a/engines/startrek/font.cpp
+++ b/engines/startrek/font.cpp
@@ -31,7 +31,7 @@ static const byte CHARACTER_COUNT = 0x80;
static const byte CHARACTER_SIZE = 0x40;
Font::Font(StarTrekEngine *vm) : _vm(vm) {
- SharedPtr<Common::SeekableReadStream> fontStream = _vm->openFile("FONT.FNT");
+ SharedPtr<Common::SeekableReadStream> fontStream = _vm->loadFile("FONT.FNT");
_characters = new Character[CHARACTER_COUNT];
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index ced8d82..457313c 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -33,9 +33,7 @@ namespace StarTrek {
Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_font = nullptr;
-
_egaData = nullptr;
- _priData = nullptr;
_lutData = nullptr;
_screenRect = Common::Rect(SCREEN_WIDTH, SCREEN_HEIGHT);
@@ -50,6 +48,9 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_numSprites = 0;
_textDisplayMode = TEXTDISPLAY_WAIT;
+ _textboxVar2 = 0;
+ _textboxVar6 = 0;
+ _textboxHasMultipleChoices = false;
setMouseCursor(loadBitmap("pushbtn"));
CursorMan.showMouse(true);
@@ -57,58 +58,22 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
Graphics::~Graphics() {
delete[] _egaData;
- delete[] _priData;
delete[] _lutData;
delete _font;
}
-void Graphics::loadEGAData(const char *filename) {
- // Load EGA palette data
- if (!_egaMode)
- return;
-
- if (!_egaData)
- _egaData = new byte[256];
-
- SharedPtr<Common::SeekableReadStream> egaStream = _vm->openFile(filename);
- egaStream->read(_egaData, 256);
+void Graphics::setBackgroundImage(SharedPtr<Bitmap> bitmap) {
+ _backgroundImage = bitmap;
}
-void Graphics::drawBackgroundImage(const char *filename) {
- // Draw an stjr BGD image (palette built-in)
-
- SharedPtr<Common::SeekableReadStream> imageStream = _vm->openFile(filename);
- byte *palette = new byte[256 * 3];
- imageStream->read(palette, 256 * 3);
-
- // Expand color components
- for (uint16 i = 0; i < 256 * 3; i++)
- palette[i] <<= 2;
-
- uint16 xoffset = imageStream->readUint16LE();
- uint16 yoffset = imageStream->readUint16LE();
- uint16 width = imageStream->readUint16LE();
- uint16 height = imageStream->readUint16LE();
-
- byte *pixels = new byte[width * height];
- imageStream->read(pixels, width * height);
-
- _vm->_system->getPaletteManager()->setPalette(palette, 0, 256);
- _vm->_system->copyRectToScreen(pixels, width, xoffset, yoffset, width, height);
- _vm->_system->updateScreen();
-
- delete[] palette;
-}
-
-
void Graphics::loadPalette(const Common::String &paletteName) {
// Set the palette from a PAL file
Common::String palFile = paletteName + ".PAL";
Common::String lutFile = paletteName + ".LUT";
- SharedPtr<Common::SeekableReadStream> palStream = _vm->openFile(palFile.c_str());
+ SharedPtr<Common::SeekableReadStream> palStream = _vm->loadFile(palFile.c_str());
byte *palette = new byte[256 * 3];
palStream->read(palette, 256 * 3);
@@ -122,7 +87,7 @@ void Graphics::loadPalette(const Common::String &paletteName) {
delete[] palette;
// Load LUT file
- SharedPtr<Common::SeekableReadStream> lutStream = _vm->openFile(lutFile.c_str());
+ SharedPtr<Common::SeekableReadStream> lutStream = _vm->loadFile(lutFile.c_str());
delete[] _lutData;
_lutData = new byte[256];
@@ -130,15 +95,27 @@ void Graphics::loadPalette(const Common::String &paletteName) {
}
void Graphics::loadPri(const char *priFile) {
- SharedPtr<Common::SeekableReadStream> priStream = _vm->openFile(priFile);
-
- delete[] _priData;
- _priData = new byte[SCREEN_WIDTH*SCREEN_HEIGHT / 2];
+ SharedPtr<Common::SeekableReadStream> priStream = _vm->loadFile(priFile);
priStream->read(_priData, SCREEN_WIDTH*SCREEN_HEIGHT / 2);
}
+void Graphics::clearPri() {
+ memset(_priData, 0, sizeof(_priData));
+}
+
+byte Graphics::getPriValue(int x, int y) {
+ assert(_screenRect.contains(x, y));
+
+ int priOffset = y * SCREEN_WIDTH + x;
+ byte b = _priData[priOffset / 2];
+ if ((priOffset % 2) == 1)
+ return b & 0xf;
+ else
+ return b >> 4;
+}
+
SharedPtr<Bitmap> Graphics::loadBitmap(Common::String basename) {
- return SharedPtr<Bitmap>(new Bitmap(_vm->openFile(basename + ".BMP")));
+ return SharedPtr<Bitmap>(new Bitmap(_vm->loadFile(basename + ".BMP")));
}
Common::Point Graphics::getMousePos() {
@@ -150,11 +127,6 @@ void Graphics::setMouseCursor(SharedPtr<Bitmap> bitmap) {
_vm->_system->setMouseCursor(bitmap->pixels, bitmap->width, bitmap->height, bitmap->xoffset, bitmap->yoffset, 0);
}
-void Graphics::redrawScreen() {
- _vm->_system->copyRectToScreen(_backgroundImage->pixels, SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
- drawAllSprites();
-}
-
void Graphics::drawSprite(const Sprite &sprite) {
int left = sprite.drawX;
int top = sprite.drawY;
@@ -448,17 +420,50 @@ void Graphics::delSprite(Sprite *sprite) {
}
-void Graphics::drawBitmapToScreen(Bitmap *bitmap) {
+void Graphics::drawDirectToScreen(SharedPtr<Bitmap> bitmap) {
int xoffset = bitmap->xoffset;
int yoffset = bitmap->yoffset;
- if (xoffset >= SCREEN_WIDTH)
- xoffset = 0;
- if (yoffset >= SCREEN_HEIGHT)
- yoffset = 0;
_vm->_system->copyRectToScreen(bitmap->pixels, bitmap->width, xoffset, yoffset, bitmap->width, bitmap->height);
- _vm->_system->updateScreen();
}
+void Graphics::loadEGAData(const char *filename) {
+ // Load EGA palette data
+ if (!_egaMode)
+ return;
+
+ if (!_egaData)
+ _egaData = new byte[256];
+
+ SharedPtr<Common::SeekableReadStream> egaStream = _vm->loadFile(filename);
+ egaStream->read(_egaData, 256);
+}
+
+void Graphics::drawBackgroundImage(const char *filename) {
+ // Draw an stjr BGD image (palette built-in)
+
+ SharedPtr<Common::SeekableReadStream> imageStream = _vm->loadFile(filename);
+ byte *palette = new byte[256 * 3];
+ imageStream->read(palette, 256 * 3);
+
+ // Expand color components
+ for (uint16 i = 0; i < 256 * 3; i++)
+ palette[i] <<= 2;
+
+ uint16 xoffset = imageStream->readUint16LE();
+ uint16 yoffset = imageStream->readUint16LE();
+ uint16 width = imageStream->readUint16LE();
+ uint16 height = imageStream->readUint16LE();
+
+ byte *pixels = new byte[width * height];
+ imageStream->read(pixels, width * height);
+
+ _vm->_system->getPaletteManager()->setPalette(palette, 0, 256);
+ _vm->_system->copyRectToScreen(pixels, width, xoffset, yoffset, width, height);
+ _vm->_system->updateScreen();
+
+ delete[] palette;
+}
+
}
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 277c636..758f327 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -70,18 +70,17 @@ public:
Graphics(StarTrekEngine *vm);
~Graphics();
- void loadEGAData(const char *egaFile);
- void drawBackgroundImage(const char *filename);
-
+ void setBackgroundImage(SharedPtr<Bitmap> bitmap);
void loadPalette(const String &paletteFile);
void loadPri(const char *priFile);
+ void clearPri();
+ byte getPriValue(int x, int y);
SharedPtr<Bitmap> loadBitmap(String basename);
Common::Point getMousePos();
void setMouseCursor(SharedPtr<Bitmap> bitmap);
- void redrawScreen();
void drawSprite(const Sprite &sprite);
void drawSprite(const Sprite &sprite, const Common::Rect &rect);
void drawAllSprites();
@@ -89,18 +88,19 @@ public:
void addSprite(Sprite *sprite);
void delSprite(Sprite *sprite);
+
+ void drawDirectToScreen(SharedPtr<Bitmap> bitmap);
+ void loadEGAData(const char *egaFile);
+ void drawBackgroundImage(const char *filename);
private:
- void drawBitmapToScreen(Bitmap *bitmap);
-
-
StarTrekEngine *_vm;
Font *_font;
bool _egaMode;
byte *_egaData;
- byte *_priData;
byte *_lutData;
+ byte _priData[SCREEN_WIDTH*SCREEN_HEIGHT / 2];
Common::Rect _screenRect;
SharedPtr<Bitmap> _backgroundImage;
@@ -156,11 +156,13 @@ public:
private:
int16 _textDisplayMode;
+
+public:
uint32 _textboxVar2;
- uint32 _textboxVar3;
uint16 _textboxVar6;
bool _textboxHasMultipleChoices;
+private:
SharedPtr<Menu> _activeMenu;
// Saved value of StarTrekEngine::_keyboardControlsMouse when menus are up
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 9114de4..3b93fbc 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -9,6 +9,7 @@ MODULE_OBJS = \
font.o \
lzss.o \
graphics.o \
+ object.o \
room.o \
sound.o \
sprite.o \
diff --git a/engines/startrek/object.cpp b/engines/startrek/object.cpp
new file mode 100644
index 0000000..aafa138
--- /dev/null
+++ b/engines/startrek/object.cpp
@@ -0,0 +1,27 @@
+/* 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 "object.h"
+
+namespace StarTrek {
+
+}
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
new file mode 100644
index 0000000..41bf1f9
--- /dev/null
+++ b/engines/startrek/object.h
@@ -0,0 +1,83 @@
+/* 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.
+ *
+ */
+
+#ifndef STARTREK_OBJECT_H
+#define STARTREK_OBJECT_H
+
+#include "startrek/sprite.h"
+
+#include "common/scummsys.h"
+
+namespace StarTrek {
+
+class StarTrekEngine;
+class FileStream;
+
+
+struct Object {
+ uint16 spriteDrawn;
+ char animationString3[16];
+ uint16 animType;
+ Sprite sprite;
+ char animationString4[10];
+ uint16 scale;
+ SharedPtr<FileStream> animFile;
+ uint16 numAnimFrames;
+ uint16 animFrame;
+ uint32 frameToStartNextAnim;
+ uint16 field5e;
+ uint16 field60;
+ uint16 field62;
+ uint16 field64;
+ uint16 field66;
+ char animationString2[8];
+ uint16 field70;
+ uint16 field72;
+ uint16 field74;
+ uint16 field76;
+ uint16 iwSrcPosition;
+ uint16 iwDestPosition;
+ uint16 field7c;
+ uint16 field7e;
+ uint16 field80;
+ uint16 field82;
+ uint16 field84;
+ uint16 field86;
+ uint16 field88;
+ uint16 field8a;
+ uint16 field8c;
+ uint16 field8e;
+ uint16 field90;
+ uint16 field92;
+ uint16 field94;
+ uint16 field96;
+ char animationString[9];
+ uint8 fielda1;
+ uint16 fielda2;
+ uint16 fielda4;
+ uint16 fielda6;
+};
+
+}
+
+#endif
+
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 3516aaa..a687374 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -31,7 +31,7 @@
namespace StarTrek {
Room::Room(StarTrekEngine *vm, Common::String name) : _vm(vm) {
- SharedPtr<FileStream> rdfFile = _vm->openFile(name + ".RDF");
+ SharedPtr<FileStream> rdfFile = _vm->loadFile(name + ".RDF");
int size = rdfFile->size();
_rdfData = new byte[size];
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 2871a88..105b3a0 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -149,6 +149,9 @@ void Sound::playMidiMusicTracks(int startTrack, int loopTrack) {
playMidiTrackInSlot(0, startTrack);
}
+/**
+ * TODO: original game had some caching of loaded voc files.
+ */
void Sound::playVoc(const Common::String &baseSoundName) {
/*
if (_vm->getPlatform() == Common::kPlatformAmiga)
@@ -169,7 +172,7 @@ void Sound::playVoc(const Common::String &baseSoundName) {
sub_2aaa3();
*/
- for (int i=0; i<MAX_SFX_PLAYING; i++) {
+ for (int i = 0; i < MAX_SFX_PLAYING; i++) {
if (_vm->_system->getMixer()->isSoundHandleActive(_sfxHandles[i]))
continue;
@@ -304,7 +307,7 @@ void Sound::loadPCMusicFile(const Common::String &baseSoundName) {
}
debugC(5, kDebugSound, "Loading midi \'%s\'\n", soundName.c_str());
- SharedPtr<Common::SeekableReadStream> soundStream = _vm->openFile(soundName.c_str());
+ SharedPtr<Common::SeekableReadStream> soundStream = _vm->loadFile(soundName.c_str());
if (loadedSoundData != nullptr)
delete[] loadedSoundData;
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
index 2caa1d0..6ce4e94 100644
--- a/engines/startrek/sound.h
+++ b/engines/startrek/sound.h
@@ -82,11 +82,14 @@ private:
uint32 _midiDevice;
// VOC-related variables
- Common::String _loopingAudioName;
Audio::SoundHandle _sfxHandles[MAX_SFX_PLAYING];
Audio::SoundHandle _speechHandle;
bool _playingSpeech;
+public:
+ Common::String _loopingAudioName;
+
+private:
// Driver callback
static void midiDriverCallback(void *data);
};
diff --git a/engines/startrek/sprite.h b/engines/startrek/sprite.h
index 1e75cc4..844fb80 100644
--- a/engines/startrek/sprite.h
+++ b/engines/startrek/sprite.h
@@ -63,18 +63,6 @@ struct Sprite {
Common::Rect getRect();
};
-
-class SpriteList {
-public:
- SpriteList(int n) { sprites = new Sprite[n]; }
- ~SpriteList() { delete[] sprites; }
-
- Sprite &operator[](int i) const { return sprites[i]; }
-
-private:
- Sprite *sprites;
-};
-
}
#endif
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 40fa8d7..8b05a5a 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -39,14 +39,24 @@
namespace StarTrek {
-StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gamedesc) : Engine(syst), _gameDescription(gamedesc) {
+StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gamedesc) :
+ Engine(syst),
+ _gameDescription(gamedesc),
+ _kirkObject(&_objectList[0]),
+ _spockObject(&_objectList[1]),
+ _mccoyObject(&_objectList[2]),
+ _redshirtObject(&_objectList[3]) {
+
DebugMan.addDebugChannel(kDebugSound, "sound", "Sound");
+ DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics");
_gfx = nullptr;
_sound = nullptr;
_macResFork = nullptr;
_room = nullptr;
+ _redshirtDead = false;
+
_clockTicks = 0;
_musicEnabled = true;
@@ -82,86 +92,190 @@ Common::Error StarTrekEngine::run() {
}
initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT);
-
initializeEventsAndMouse();
-
-// Test graphics/music:
-
-// Music Status:
-// DOS Full: Adlib and MT-32 Sounds supported
-// DOS Demo: Adlib and MT-32 Sounds supported
-// Amiga: Sound effects supported
-// Macintosh: MIDI and sound effects playable, format not handled.
-
-// Graphics Status:
-// DOS/Amiga/Macintosh/Demo Graphics: 100%
-// Judgment Rites Backgrounds supported too
-// EGA not supported
+
+ _frameIndex = 0;
+
+ _gameMode = -1;
+ _lastGameMode = -1;
+
+ runGameMode(GAMEMODE_BEAMDOWN);
+ return Common::kNoError;
+
+
#if 1
_room = new Room(this, "DEMON0");
- if (getGameType() == GType_ST25) {
- _gfx->loadPalette("PALETTE");
- _gfx->loadPri("DEMON0.PRI");
- _gfx->redrawScreen();
-
- _sound->loadMusicFile("GROUND");
- } else {
- _gfx->drawBackgroundImage("BRIDGE.BGD");
- }
+ _gfx->loadPalette("PALETTE");
+ _gfx->loadPri("DEMON0.PRI");
- // Sprite tests
-
- // Draw mode 0
- Sprite *spr = new Sprite;
- _gfx->addSprite(spr);
- spr->bitmap = _gfx->loadBitmap("MWALKE00");
- spr->drawPriority = 1;
- spr->pos.x = 150;
- spr->pos.y = 100;
- spr->drawMode = 0;
-
- // Draw mode 2 (translucent background)
- spr = new Sprite;
- _gfx->addSprite(spr);
- spr->bitmap = _gfx->loadBitmap("KWALKS00");
- spr->drawPriority = 1;
- spr->pos.x = 230;
- spr->pos.y = 100;
- spr->drawMode = 2;
-
- /*
- // Draw mode 3 (text)
- spr = new Sprite;
- _gfx->addSprite(spr);
- spr->bitmap = SharedPtr<Bitmap>(new TextBitmap(8*8,8*8));
- for (int i=0;i<8*8;i++)
- spr->bitmap->pixels[i] = 0x40+i;
- spr->pos.x = 8*10;
- spr->pos.y = 50;
- spr->textColor = 0xb3;
- spr->drawMode = 3;
-
- // initTextSprite function
- spr = new Sprite;
- int x=0,y=0;
- _gfx->initTextSprite(&x, &y, 0xb3, 3, false, spr);
- spr->pos.y = 150;
- */
+ _sound->loadMusicFile("GROUND");
while (true) {
_gfx->showOptionsMenu(0, 0);
}
- _gfx->showText(&Graphics::readTextFromRdf, 0x2220, 150, 160, 0xb3, 0, 10, 0);
while (!shouldQuit()) {
pollSystemEvents();
}
+
+ return Common::kNoError;
#endif
+}
+
+Common::Error StarTrekEngine::runGameMode(int mode) {
+ _gameMode = mode;
+
+ _sound->stopAllVocSounds();
+ if (!_sound->_loopingAudioName.empty())
+ _sound->playVoc(_sound->_loopingAudioName);
+
+ if (_gameMode == GAMEMODE_START)
+ _gameMode = GAMEMODE_BRIDGE;
+
+ while (true) {
+ if (_gameMode != _lastGameMode) {
+ // Cleanup previous game mode
+ switch (_lastGameMode) {
+ case GAMEMODE_BRIDGE:
+ //cleanupBridgeMode();
+ break;
+
+ case GAMEMODE_AWAYMISSION:
+ //cleanupAwayMissionMode();
+ break;
+
+ case GAMEMODE_BEAMDOWN:
+ case GAMEMODE_BEAMUP:
+ break;
+ }
+
+ _lastGameMode = _gameMode;
+
+ // Load next game mode
+ switch (_gameMode) {
+ case GAMEMODE_BRIDGE:
+ _sound->loadMusicFile("bridge");
+ //initBridge();
+ break;
+
+ case GAMEMODE_AWAYMISSION:
+ //initAwayMission();
+ break;
+
+ case GAMEMODE_BEAMDOWN:
+ _redshirtDead = false;
+ _sound->loadMusicFile("ground");
+ runTransportSequence("teled");
+ _gameMode = GAMEMODE_AWAYMISSION;
+ continue; // Back to start of loop
+
+ case GAMEMODE_BEAMUP:
+ runTransportSequence("teleb");
+ _gameMode = GAMEMODE_BRIDGE;
+ //sub_15c61();
+ _sound->stopAllVocSounds();
+ _sound->playVoc("bridloop");
+ continue; // Back to start of loop
+ }
+ }
+
+ // Run current game mode
+ switch (_gameMode) {
+ case GAMEMODE_BRIDGE:
+ //runBridge();
+ break;
+
+ case GAMEMODE_AWAYMISSION:
+ //runAwayMission();
+ break;
+
+ case GAMEMODE_BEAMDOWN:
+ case GAMEMODE_BEAMUP:
+ error("Can't be here.");
+ break;
+ }
+ }
return Common::kNoError;
}
+void StarTrekEngine::runTransportSequence(const Common::String &name) {
+ const uint16 crewmanTransportPositions[][2] = {
+ { 0x8e, 0x7c },
+ { 0xbe, 0x7c },
+ { 0x7e, 0x72 },
+ { 0xaa, 0x72 }
+ };
+
+ _sound->stopAllVocSounds();
+ // sub_1e70d();
+ objectFunc1();
+ initObjects();
+
+ SharedPtr<Bitmap> bgImage = _gfx->loadBitmap("transprt");
+ _gfx->setBackgroundImage(bgImage);
+ _gfx->clearPri();
+ _gfx->loadPalette("palette");
+ _gfx->drawDirectToScreen(bgImage);
+ _system->updateScreen();
+
+ for (int i = 0; i < (_redshirtDead ? 3 : 4); i++) {
+ Common::String filename = getCrewmanAnimFilename(i, name);
+ int x = crewmanTransportPositions[i][0];
+ int y = crewmanTransportPositions[i][1];
+ loadAnimationForObject(i, filename, x, y, 256);
+ _objectList[i].animationString[0] = '\0';
+ }
+
+ if (_missionToLoad.equalsIgnoreCase("feather") && name[4] == 'b') {
+ loadAnimationForObject(9, "qteleb", 0x61, 0x79, 0x100);
+ }
+ else if (_missionToLoad.equalsIgnoreCase("trial")) {
+ if (name[4] == 'd') {
+ loadAnimationForObject(9, "qteled", 0x61, 0x79, 0x100);
+ }
+ /* TODO
+ else if (word_51156 >= 3) {
+ loadAnimationForObject(9, "qteleb", 0x61, 0x79, 0x100);
+ }
+ */
+ }
+
+ loadAnimationForObject(8, "transc", 0, 0, 0x100);
+
+ // TODO: redraw mouse and sprite_52c4e?
+
+ _gfx->drawAllSprites();
+ // sub_1e6ab();
+
+ playSoundEffectIndex(0x0a);
+
+ if (name.equalsIgnoreCase("teled"))
+ playSoundEffectIndex(0x08);
+ else
+ playSoundEffectIndex(0x09);
+
+ while (_objectList[0].field62 == 0) {
+ TrekEvent event;
+ if (popNextEvent(&event)) {
+ if (event.type == TREKEVENT_TICK) {
+ // TODO: redraw sprite_52c4e?
+ _frameIndex++;
+ updateObjectAnimations();
+ _gfx->drawAllSprites();
+ }
+ }
+ }
+
+ // TODO: redraw sprite_52c4e?
+
+ _gfx->drawAllSprites();
+ // sub_1e70d();
+ objectFunc1();
+ initObjects();
+}
+
Room *StarTrekEngine::getRoom() {
return _room;
}
@@ -191,13 +305,19 @@ void StarTrekEngine::pollSystemEvents() {
break;
}
}
- _gfx->drawAllSprites();
+
+ // FIXME: get the actual duration of a tick right
+ _clockTicks++;
+ TrekEvent tickEvent;
+ tickEvent.type = TREKEVENT_TICK;
+ tickEvent.tick = _clockTicks;
+ addEventToQueue(tickEvent);
_system->delayMillis(1000/60);
}
void StarTrekEngine::playSoundEffectIndex(int index) {
- switch(index) {
+ switch (index) {
case 0x04:
_sound->playVoc("tricorde");
break;
@@ -256,14 +376,262 @@ void StarTrekEngine::stopPlayingSpeech() {
_sound->stopPlayingSpeech();
}
+void StarTrekEngine::initObjects() {
+ for (int i = 0; i < MAX_OBJECTS; i++) {
+ _objectList[i] = Object();
+ }
+ for (int i = 0; i < MAX_OBJECTS / 2; i++)
+ _objectBanFiles[i].reset();
+
+ strcpy(_kirkObject->animationString, "kstnd");
+ strcpy(_spockObject->animationString, "sstnd");
+ strcpy(_mccoyObject->animationString, "mstnd");
+ strcpy(_redshirtObject->animationString, "rstnd");
+}
+
+int StarTrekEngine::loadAnimationForObject(int objectIndex, const Common::String &animName, uint16 x, uint16 y, uint16 arg8) {
+ debugC(6, kDebugGraphics, "Load animation '%s' on object %d", animName.c_str(), objectIndex);
+
+ Object *object;
+
+ if (objectIndex == -1) {
+ // TODO
+ }
+ else
+ object = &_objectList[objectIndex];
+
+ if (object->spriteDrawn) {
+ releaseAnim(object);
+ drawObjectToScreen(object, animName, x, y, arg8, false);
+ }
+ else {
+ drawObjectToScreen(object, animName, x, y, arg8, true);
+ }
+
+ object->field64 = 0;
+ object->field66 = 0;
+
+ return objectIndex;
+}
+
+void StarTrekEngine::updateObjectAnimations() {
+ for (int i = 0; i < MAX_OBJECTS; i++) {
+ Object *object = &_objectList[i];
+ if (!object->spriteDrawn)
+ continue;
+
+ switch (object->animType) {
+ case 0:
+ case 2:
+ if (object->frameToStartNextAnim >= _frameIndex) {
+ int nextAnimIndex = 0; // TODO: "chooseNextAnimFrame" function
+ object->animFile->seek(18 + nextAnimIndex + object->animFrame * 22, SEEK_SET);
+ byte nextAnimFrame = object->animFile->readByte();
+
+ debugC(7, kDebugGraphics, "Object %d animation frame %d", i, nextAnimFrame);
+
+ if (object->animFrame != nextAnimFrame) {
+ if (nextAnimFrame == object->numAnimFrames - 1) {
+ object->field62++;
+ if (object->field64 != 0) {
+ // sub_20099(10, object->field66, 0, 0);
+ }
+ }
+ }
+
+ object->animFrame = nextAnimFrame;
+ if (object->animFrame >= object->numAnimFrames) {
+ if (object->animationString[0] == '\0')
+ removeObjectFromScreen(i);
+ /*
+ else // TODO
+ initStandAnim(i);
+ */
+ }
+ else {
+ Sprite *sprite = &object->sprite;
+
+ object->animFile->seek(object->animFrame * 22, SEEK_SET);
+ char animFrameFilename[16];
+ object->animFile->read(animFrameFilename, 16);
+ sprite->setBitmap(loadAnimationFrame(animFrameFilename, object->scale));
+
+ memset(object->animationString4, 0, 16);
+ strncpy(object->animationString4, animFrameFilename, 15);
+
+ object->animFile->seek(10, SEEK_SET);
+ uint16 xOffset = object->animFile->readUint16();
+ uint16 yOffset = object->animFile->readUint16();
+ uint16 basePriority = object->animFile->readUint16();
+
+ sprite->pos.x = xOffset + object->field5e;
+ sprite->pos.y = yOffset + object->field60;
+ sprite->drawPriority = _gfx->getPriValue(0, yOffset + object->field60) + basePriority;
+ sprite->bitmapChanged = true;
+
+ object->frameToStartNextAnim = object->animFile->readUint16() + _frameIndex;
+ }
+ }
+ break;
+ case 1: // TODO
+ warning("Unimplemented anim type %d", object->animType);
+ break;
+ default:
+ error("Invalid anim type.");
+ break;
+ }
+ }
+}
+
+void StarTrekEngine::removeObjectFromScreen(int objectIndex) {
+ Object *object = &_objectList[objectIndex];
+
+ if (object->spriteDrawn != 1)
+ return;
+
+ debugC(6, kDebugGraphics, "Stop drawing object %d", objectIndex);
+
+ Sprite *sprite = &object->sprite;
+ sprite->field16 = true;
+ sprite->bitmapChanged = true;
+ _gfx->drawAllSprites();
+ _gfx->delSprite(sprite);
+ releaseAnim(object);
+}
+
+void StarTrekEngine::objectFunc1() {
+ for (int i = 0; i < MAX_OBJECTS; i++) {
+ if (_objectList[i].spriteDrawn == 1) {
+ removeObjectFromScreen(i);
+ }
+ }
+
+ for (int i = 0; i < MAX_OBJECTS / 2; i++) {
+ _objectBanFiles[i].reset();
+ }
+}
+
+void StarTrekEngine::drawObjectToScreen(Object *object, const Common::String &_animName, uint16 x, uint16 y, uint16 arg8, bool addSprite) {
+ Common::String animFilename = _animName;
+ if (_animName.hasPrefixIgnoreCase("stnd") /* && word_45d20 == -1 */) // TODO
+ animFilename += 'j';
+ memcpy(object->animationString3, _animName.c_str(), sizeof(object->animationString3));
+
+ object->animType = 2;
+ object->animFile = loadFile(animFilename + ".anm");
+ object->numAnimFrames = object->animFile->size() / 22;
+ object->animFrame = 0;
+ object->field5e = x;
+ object->field60 = y;
+ object->field62 = 0;
+ object->scale = arg8;
+
+ object->animFile->seek(16, SEEK_SET);
+ object->frameToStartNextAnim = object->animFile->readUint16() + _frameIndex;
+
+ char firstFrameFilename[10];
+ object->animFile->seek(0, SEEK_SET);
+ object->animFile->read(firstFrameFilename, 10);
+
+ Sprite *sprite = &object->sprite;
+ if (addSprite)
+ _gfx->addSprite(sprite);
+
+ sprite->setBitmap(loadAnimationFrame(firstFrameFilename, arg8));
+ memset(object->animationString4, 0, sizeof(char) * 10);
+ strncpy(object->animationString4, firstFrameFilename, sizeof(char) * 9);
+
+ object->scale = arg8;
+
+ object->animFile->seek(10, SEEK_SET);
+ uint16 xOffset = object->animFile->readUint16();
+ uint16 yOffset = object->animFile->readUint16();
+ uint16 basePriority = object->animFile->readUint16();
+
+ sprite->pos.x = xOffset + object->field5e;
+ sprite->pos.y = yOffset + object->field60;
+ sprite->drawPriority = _gfx->getPriValue(0, yOffset + object->field60) + basePriority;
+ sprite->bitmapChanged = true;
+
+ object->spriteDrawn = 1;
+}
+
+void StarTrekEngine::releaseAnim(Object *object) {
+ switch (object->animType) {
+ case 0:
+ case 2:
+ object->sprite.bitmap.reset();
+ object->animFile.reset();
+ break;
+ case 1: // TODO
+ warning("Unimplemented anim type %d", object->animType);
+ break;
+ default:
+ error("Invalid anim type.");
+ break;
+ }
+
+ object->spriteDrawn = 0;
+}
+
+SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filename, uint16 arg2) {
+ SharedPtr<Bitmap> bitmapToReturn;
+
+ char basename[5];
+ strncpy(basename, filename.c_str()+1, 4);
+ basename[4] = '\0';
+
+ char c = filename[0];
+ if ((strcmp(basename, "stnd") == 0 || strcmp(basename, "tele") == 0)
+ && (c == 'm' || c == 's' || c == 'k' || c == 'r')) {
+ if (c == 'm') {
+ bitmapToReturn = _gfx->loadBitmap(filename);
+ }
+ else {
+ // bitmapToReturn = _gfx->loadBitmap(filename + ".$bm"); // FIXME: should be this?
+ if (bitmapToReturn == nullptr) {
+ Common::String newFilename = filename;
+ newFilename.setChar('m', 0); // FIXME: original writes directly to argument; does that affect anything?
+ bitmapToReturn = _gfx->loadBitmap(newFilename);
+ }
+ }
+ }
+ else {
+ // TODO: when loading a bitmap, it passes a different argument than is standard to
+ // the "file loading with cache" function...
+ bitmapToReturn = _gfx->loadBitmap(filename);
+ }
+
+ if (arg2 != 256) {
+ // TODO
+ // bitmapToReturn = scaleBitmap(bitmapToReturn, arg2);
+ }
+
+ return bitmapToReturn;
+}
+
+Common::String StarTrekEngine::getCrewmanAnimFilename(int objectIndex, const Common::String &basename) {
+ const char *crewmanChars = "ksmr";
+ assert(objectIndex >= 0 && objectIndex < 4);
+ return crewmanChars[objectIndex] + basename;
+}
+
void StarTrekEngine::updateClockTicks() {
// TODO (based on DOS interrupt 1A, AH=0; read system clock counter)
_clockTicks = 0;
}
-SharedPtr<FileStream> StarTrekEngine::openFile(Common::String filename, int fileIndex) {
+/**
+ * TODO:
+ * - Should return nullptr on failure to open a file?
+ * - This is supposed to cache results, return same FileStream on multiple accesses.
+ * - This is supposed to read from a "patches" folder which overrides files in the
+ * packed blob.
+ */
+SharedPtr<FileStream> StarTrekEngine::loadFile(Common::String filename, int fileIndex) {
filename.toUppercase();
+
Common::String basename, extension;
bool bigEndian = getPlatform() == Common::kPlatformAmiga;
@@ -278,11 +646,18 @@ SharedPtr<FileStream> StarTrekEngine::openFile(Common::String filename, int file
}
}
+ // FIXME: don't know if this is right, or if it goes here
+ while (!basename.empty() && basename.lastChar() == ' ') {
+ basename.erase(basename.size() - 1, 1);
+ }
+
+ filename = basename + '.' + extension;
+
// The Judgment Rites demo has its files not in the standard archive
if (getGameType() == GType_STJR && (getFeatures() & GF_DEMO)) {
Common::File *file = new Common::File();
if (!file->open(filename.c_str()))
- error ("Could not find file \'%s\'", filename.c_str());
+ error("Could not find file \'%s\'", filename.c_str());
return SharedPtr<FileStream>(new FileStream(file, bigEndian));
}
@@ -291,7 +666,7 @@ SharedPtr<FileStream> StarTrekEngine::openFile(Common::String filename, int file
if (getPlatform() == Common::kPlatformAmiga) {
indexFile = SearchMan.createReadStreamForMember("data000.dir");
if (!indexFile)
- error ("Could not open data000.dir");
+ error("Could not open data000.dir");
} else if (getPlatform() == Common::kPlatformMacintosh) {
indexFile = _macResFork->getResource("Directory");
if (!indexFile)
@@ -299,7 +674,7 @@ SharedPtr<FileStream> StarTrekEngine::openFile(Common::String filename, int file
} else {
indexFile = SearchMan.createReadStreamForMember("data.dir");
if (!indexFile)
- error ("Could not open data.dir");
+ error("Could not open data.dir");
}
uint32 indexOffset = 0;
@@ -353,9 +728,9 @@ SharedPtr<FileStream> StarTrekEngine::openFile(Common::String filename, int file
if ((basename.lastChar() >= '1' && basename.lastChar() <= '9') ||
(basename.lastChar() >= 'B' && basename.lastChar() <= 'Z')) {
basename.setChar(basename.lastChar()-1, basename.size()-1);
- return openFile(basename + "." + extension, fileIndex+1);
+ return loadFile(basename + "." + extension, fileIndex+1);
} else
- error ("Could not find file \'%s\'", filename.c_str());
+ error("Could not find file \'%s\'", filename.c_str());
}
if (fileIndex >= fileCount)
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 5e81f77..6cb175c 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -36,6 +36,7 @@
#include "startrek/filestream.h"
#include "startrek/graphics.h"
+#include "startrek/object.h"
#include "startrek/room.h"
#include "startrek/sound.h"
@@ -58,10 +59,25 @@ enum StarTrekGameFeatures {
};
enum kDebugLevels {
- kDebugSound = 1 << 0
+ kDebugSound = 1 << 0,
+ kDebugGraphics = 1 << 1
};
+enum GameMode {
+ GAMEMODE_START = 0,
+ GAMEMODE_BRIDGE,
+ GAMEMODE_AWAYMISSION,
+ GAMEMODE_BEAMDOWN,
+ GAMEMODE_BEAMUP
+};
+
+enum TextDisplayMode {
+ TEXTDISPLAY_WAIT = 0, // Wait for input before closing text
+ TEXTDISPLAY_SUBTITLES, // Automatically continue when speech is done
+ TEXTDISPLAY_NONE // No text displayed
+};
+
enum TrekEventType {
TREKEVENT_TICK = 0, // DOS clock changes (see updateClockTicks)
TREKEVENT_LBUTTONDOWN = 1,
@@ -72,12 +88,6 @@ enum TrekEventType {
TREKEVENT_KEYDOWN = 6
};
-enum TextDisplayMode {
- TEXTDISPLAY_WAIT = 0, // Wait for input before closing text
- TEXTDISPLAY_SUBTITLES, // Automatically continue when speech is done
- TEXTDISPLAY_NONE // No text displayed
-};
-
struct TrekEvent {
TrekEventType type;
Common::KeyState kbd;
@@ -85,6 +95,8 @@ struct TrekEvent {
uint32 tick;
};
+const int MAX_OBJECTS = 0x20;
+
struct StarTrekGameDescription;
class Graphics;
class Sound;
@@ -93,6 +105,11 @@ class StarTrekEngine : public ::Engine {
protected:
Common::Error run();
+private:
+ // Game modes
+ Common::Error runGameMode(int mode);
+ void runTransportSequence(const Common::String &name);
+
public:
StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gamedesc);
virtual ~StarTrekEngine();
@@ -105,6 +122,18 @@ public:
void playSpeech(const Common::String &filename);
void stopPlayingSpeech();
+ // Objects
+ void initObjects();
+ int loadAnimationForObject(int objectIndex, const Common::String &animName, uint16 x, uint16 y, uint16 arg8);
+ void updateObjectAnimations();
+ void removeObjectFromScreen(int objectIndex);
+ void objectFunc1();
+ void drawObjectToScreen(Object *object, const Common::String &animName, uint16 field5e, uint16 field60, uint16 arg8, bool addSprite);
+ void releaseAnim(Object *object);
+
+ SharedPtr<Bitmap> loadAnimationFrame(const Common::String &filename, uint16 arg2);
+ Common::String getCrewmanAnimFilename(int objectIndex, const Common::String &basename);
+
// Events
public:
void initializeEventsAndMouse();
@@ -138,14 +167,30 @@ public:
Common::Language getLanguage();
// Resource related functions
- SharedPtr<FileStream> openFile(Common::String filename, int fileIndex=0);
+ SharedPtr<FileStream> loadFile(Common::String filename, int fileIndex=0);
// Movie related functions
void playMovie(Common::String filename);
void playMovieMac(Common::String filename);
+public:
+ int _gameMode;
+ int _lastGameMode;
+ bool _redshirtDead;
+ Common::String _missionToLoad;
+
+ Object _objectList[MAX_OBJECTS];
+ Object * const _kirkObject;
+ Object * const _spockObject;
+ Object * const _mccoyObject;
+ Object * const _redshirtObject;
+
+ SharedPtr<FileStream> _objectBanFiles[MAX_OBJECTS / 2];
+ uint16 _objectBanVar2[MAX_OBJECTS / 2]; // TODO: initialize?
+
uint32 _clockTicks;
+ uint32 _frameIndex;
bool _musicEnabled;
bool _sfxEnabled;
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 923ebc6..ef5a746 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -68,7 +68,7 @@ int Graphics::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int
int16 tmpTextDisplayMode = _textDisplayMode;
uint32 var7c = 8;
- if (_textboxVar3 > _textboxVar2+1) {
+ if (_vm->_frameIndex > _textboxVar2+1) {
var7c = 0x10;
}
@@ -291,7 +291,7 @@ reloadText:
// sub_272B4
}
- _textboxVar2 = _textboxVar3;
+ _textboxVar2 = _vm->_frameIndex;
_vm->stopPlayingSpeech();
return choiceIndex;
}
@@ -347,7 +347,7 @@ int Graphics::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4) {
}
}
// sub_1E88C();
- _textboxVar3++;
+ _vm->_frameIndex++;
if (ticksUntilClickingEnabled != 0 && _vm->_clockTicks >= tickWhenClickingEnabled)
return MENUEVENT_ENABLEINPUT;
@@ -818,7 +818,7 @@ void Graphics::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
_activeMenu = SharedPtr<Menu>(new Menu());
_activeMenu->nextMenu = oldMenu;
- SharedPtr<FileStream> stream = _vm->openFile(mnuFilename + ".MNU");
+ SharedPtr<FileStream> stream = _vm->loadFile(mnuFilename + ".MNU");
_activeMenu->menuFile = stream;
_activeMenu->numButtons = _activeMenu->menuFile->size() / 16;
Commit: fc89135a16439c7d3b2268038a691e8aa8d6ee50
https://github.com/scummvm/scummvm/commit/fc89135a16439c7d3b2268038a691e8aa8d6ee50
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Get animation timing working properly
Changed paths:
engines/startrek/events.cpp
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/events.cpp b/engines/startrek/events.cpp
index a37ae8c..02b0112 100644
--- a/engines/startrek/events.cpp
+++ b/engines/startrek/events.cpp
@@ -23,9 +23,56 @@
namespace StarTrek {
+void StarTrekEngine::pollSystemEvents() {
+ Common::Event event;
+ TrekEvent trekEvent;
+
+ while (_eventMan->pollEvent(event)) {
+ trekEvent.mouse = event.mouse;
+ trekEvent.kbd = event.kbd;
+
+ switch (event.type) {
+ case Common::EVENT_QUIT:
+ _system->quit();
+ break;
+
+ case Common::EVENT_MOUSEMOVE:
+ trekEvent.type = TREKEVENT_MOUSEMOVE;
+ addEventToQueue(trekEvent);
+ break;
+ case Common::EVENT_LBUTTONDOWN:
+ trekEvent.type = TREKEVENT_LBUTTONDOWN;
+ addEventToQueue(trekEvent);
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (_eventQueue.empty()) {
+ int delay = 1000/18.206 - (_system->getMillis() - _frameStartMillis);
+
+ _clockTicks++;
+ while (delay < 0) { // Check if we're behind...
+ delay += 1000/18.206;
+ _clockTicks++;
+ }
+ _system->delayMillis(delay);
+
+ _frameStartMillis = _system->getMillis();
+
+ TrekEvent tickEvent;
+ tickEvent.type = TREKEVENT_TICK;
+ tickEvent.tick = _clockTicks;
+ addEventToQueue(tickEvent);
+ }
+
+}
+
void StarTrekEngine::initializeEventsAndMouse() {
_mouseMoveEventInQueue = false;
_tickEventInQueue = false;
+ _frameStartMillis = _system->getMillis();
// TODO: mouse
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 8b05a5a..c1c9336 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -134,6 +134,8 @@ Common::Error StarTrekEngine::runGameMode(int mode) {
_gameMode = GAMEMODE_BRIDGE;
while (true) {
+ TrekEvent event;
+
if (_gameMode != _lastGameMode) {
// Cleanup previous game mode
switch (_lastGameMode) {
@@ -183,10 +185,13 @@ Common::Error StarTrekEngine::runGameMode(int mode) {
// Run current game mode
switch (_gameMode) {
case GAMEMODE_BRIDGE:
+ popNextEvent(&event);
//runBridge();
break;
case GAMEMODE_AWAYMISSION:
+ popNextEvent(&event);
+ _system->updateScreen();
//runAwayMission();
break;
@@ -280,42 +285,6 @@ Room *StarTrekEngine::getRoom() {
return _room;
}
-void StarTrekEngine::pollSystemEvents() {
- Common::Event event;
- TrekEvent trekEvent;
-
- while (_eventMan->pollEvent(event)) {
- trekEvent.mouse = event.mouse;
- trekEvent.kbd = event.kbd;
-
- switch (event.type) {
- case Common::EVENT_QUIT:
- _system->quit();
- break;
-
- case Common::EVENT_MOUSEMOVE:
- trekEvent.type = TREKEVENT_MOUSEMOVE;
- addEventToQueue(trekEvent);
- break;
- case Common::EVENT_LBUTTONDOWN:
- trekEvent.type = TREKEVENT_LBUTTONDOWN;
- addEventToQueue(trekEvent);
- break;
- default:
- break;
- }
- }
-
- // FIXME: get the actual duration of a tick right
- _clockTicks++;
- TrekEvent tickEvent;
- tickEvent.type = TREKEVENT_TICK;
- tickEvent.tick = _clockTicks;
- addEventToQueue(tickEvent);
-
- _system->delayMillis(1000/60);
-}
-
void StarTrekEngine::playSoundEffectIndex(int index) {
switch (index) {
case 0x04:
@@ -423,7 +392,7 @@ void StarTrekEngine::updateObjectAnimations() {
switch (object->animType) {
case 0:
case 2:
- if (object->frameToStartNextAnim >= _frameIndex) {
+ if (_frameIndex >= object->frameToStartNextAnim) {
int nextAnimIndex = 0; // TODO: "chooseNextAnimFrame" function
object->animFile->seek(18 + nextAnimIndex + object->animFrame * 22, SEEK_SET);
byte nextAnimFrame = object->animFile->readByte();
@@ -459,17 +428,18 @@ void StarTrekEngine::updateObjectAnimations() {
memset(object->animationString4, 0, 16);
strncpy(object->animationString4, animFrameFilename, 15);
- object->animFile->seek(10, SEEK_SET);
+ object->animFile->seek(10 + object->animFrame * 22, SEEK_SET);
uint16 xOffset = object->animFile->readUint16();
uint16 yOffset = object->animFile->readUint16();
uint16 basePriority = object->animFile->readUint16();
+ uint16 frames = object->animFile->readUint16();
sprite->pos.x = xOffset + object->field5e;
sprite->pos.y = yOffset + object->field60;
sprite->drawPriority = _gfx->getPriValue(0, yOffset + object->field60) + basePriority;
sprite->bitmapChanged = true;
- object->frameToStartNextAnim = object->animFile->readUint16() + _frameIndex;
+ object->frameToStartNextAnim = frames + _frameIndex;
}
}
break;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 6cb175c..921d655 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -116,7 +116,6 @@ public:
// Running the game
Room *getRoom();
- void pollSystemEvents();
void playSoundEffectIndex(int index);
void playSpeech(const Common::String &filename);
@@ -136,6 +135,7 @@ public:
// Events
public:
+ void pollSystemEvents();
void initializeEventsAndMouse();
bool getNextEvent(TrekEvent *e);
void removeNextEvent();
@@ -156,6 +156,7 @@ private:
Common::List<TrekEvent> _eventQueue;
bool _mouseMoveEventInQueue;
bool _tickEventInQueue;
+ uint32 _frameStartMillis;
public:
// Detection related functions
Commit: 612cf7bdbe599d2adbbad62e33f5fcb73de3d58d
https://github.com/scummvm/scummvm/commit/612cf7bdbe599d2adbbad62e33f5fcb73de3d58d
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement "xor'd" animations for crewmen
Changed paths:
engines/startrek/startrek.cpp
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index c1c9336..3acd3d9 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -555,14 +555,75 @@ SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filen
if ((strcmp(basename, "stnd") == 0 || strcmp(basename, "tele") == 0)
&& (c == 'm' || c == 's' || c == 'k' || c == 'r')) {
if (c == 'm') {
+ // Mccoy has the "base" animations for all crewmen
bitmapToReturn = _gfx->loadBitmap(filename);
}
else {
- // bitmapToReturn = _gfx->loadBitmap(filename + ".$bm"); // FIXME: should be this?
+ // All crewman other than mccoy copy the animation frames from mccoy, change
+ // the colors of the uniforms, and load an "xor" file to redraw the face.
+
+ // TODO: The ".$bm" extension is a "virtual file"? Caches the changes to the
+ // file made here?
+ // bitmapToReturn = _gfx->loadBitmap(filename + ".$bm");
+
if (bitmapToReturn == nullptr) {
- Common::String newFilename = filename;
- newFilename.setChar('m', 0); // FIXME: original writes directly to argument; does that affect anything?
- bitmapToReturn = _gfx->loadBitmap(newFilename);
+ Common::String mccoyFilename = filename;
+ mccoyFilename.setChar('m', 0);
+ SharedPtr<Bitmap> bitmap = _gfx->loadBitmap(mccoyFilename);
+
+ uint16 width = bitmap->width;
+ uint16 height = bitmap->height;
+
+ bitmapToReturn = SharedPtr<Bitmap>(new Bitmap(width, height));
+ bitmapToReturn->xoffset = bitmap->xoffset;
+ bitmapToReturn->yoffset = bitmap->yoffset;
+
+ // Change uniform color
+ int16 colorShift;
+ switch (c) {
+ case 'k':
+ colorShift = 8;
+ break;
+ case 'r':
+ colorShift = -8;
+ break;
+ case 's':
+ colorShift = 0;
+ break;
+ }
+
+ if (colorShift == 0) {
+ memcpy(bitmapToReturn->pixels, bitmap->pixels, width * height);
+ }
+ else {
+ byte *src = bitmap->pixels;
+ byte *dest = bitmapToReturn->pixels;
+ byte baseUniformColor = 0xa8;
+
+ for (int i = 0; i < width * height; i++) {
+ byte b = *src++;
+ if (b >= baseUniformColor && b < baseUniformColor + 8)
+ *dest++ = b + colorShift;
+ else
+ *dest++ = b;
+ }
+ }
+
+ // Redraw face with xor file
+ SharedPtr<FileStream> xorFile = loadFile(filename + ".xor");
+ xorFile->seek(0, SEEK_SET);
+ uint16 xoffset = bitmap->xoffset - xorFile->readUint16();
+ uint16 yoffset = bitmap->yoffset - xorFile->readUint16();
+ uint16 xorWidth = xorFile->readUint16();
+ uint16 xorHeight = xorFile->readUint16();
+
+ byte *dest = bitmapToReturn->pixels + yoffset * bitmap->width + xoffset;
+
+ for (int i = 0; i < xorHeight; i++) {
+ for (int j = 0; j < xorWidth; j++)
+ *dest++ ^= xorFile->readByte();
+ dest += (bitmap->width - xorWidth);
+ }
}
}
}
Commit: 4927cd90b7c6d5f1dc7b3eaeb44502e251f7257c
https://github.com/scummvm/scummvm/commit/4927cd90b7c6d5f1dc7b3eaeb44502e251f7257c
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Bitmap scaling
Changed paths:
engines/startrek/events.cpp
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/events.cpp b/engines/startrek/events.cpp
index 02b0112..354dfb1 100644
--- a/engines/startrek/events.cpp
+++ b/engines/startrek/events.cpp
@@ -53,6 +53,8 @@ void StarTrekEngine::pollSystemEvents() {
int delay = 1000/18.206 - (_system->getMillis() - _frameStartMillis);
_clockTicks++;
+ if (delay < 0)
+ debug(5, "Late frame");
while (delay < 0) { // Check if we're behind...
delay += 1000/18.206;
_clockTicks++;
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 3acd3d9..3a434bf 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -229,7 +229,7 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
Common::String filename = getCrewmanAnimFilename(i, name);
int x = crewmanTransportPositions[i][0];
int y = crewmanTransportPositions[i][1];
- loadAnimationForObject(i, filename, x, y, 256);
+ loadAnimationForObject(i, filename, x, y, 128);
_objectList[i].animationString[0] = '\0';
}
@@ -358,7 +358,7 @@ void StarTrekEngine::initObjects() {
strcpy(_redshirtObject->animationString, "rstnd");
}
-int StarTrekEngine::loadAnimationForObject(int objectIndex, const Common::String &animName, uint16 x, uint16 y, uint16 arg8) {
+int StarTrekEngine::loadAnimationForObject(int objectIndex, const Common::String &animName, uint16 x, uint16 y, uint16 scale) {
debugC(6, kDebugGraphics, "Load animation '%s' on object %d", animName.c_str(), objectIndex);
Object *object;
@@ -371,10 +371,10 @@ int StarTrekEngine::loadAnimationForObject(int objectIndex, const Common::String
if (object->spriteDrawn) {
releaseAnim(object);
- drawObjectToScreen(object, animName, x, y, arg8, false);
+ drawObjectToScreen(object, animName, x, y, scale, false);
}
else {
- drawObjectToScreen(object, animName, x, y, arg8, true);
+ drawObjectToScreen(object, animName, x, y, scale, true);
}
object->field64 = 0;
@@ -425,8 +425,8 @@ void StarTrekEngine::updateObjectAnimations() {
object->animFile->read(animFrameFilename, 16);
sprite->setBitmap(loadAnimationFrame(animFrameFilename, object->scale));
- memset(object->animationString4, 0, 16);
- strncpy(object->animationString4, animFrameFilename, 15);
+ memset(object->animationString4, 0, 10);
+ strncpy(object->animationString4, animFrameFilename, 9);
object->animFile->seek(10 + object->animFrame * 22, SEEK_SET);
uint16 xOffset = object->animFile->readUint16();
@@ -481,7 +481,7 @@ void StarTrekEngine::objectFunc1() {
}
}
-void StarTrekEngine::drawObjectToScreen(Object *object, const Common::String &_animName, uint16 x, uint16 y, uint16 arg8, bool addSprite) {
+void StarTrekEngine::drawObjectToScreen(Object *object, const Common::String &_animName, uint16 x, uint16 y, uint16 scale, bool addSprite) {
Common::String animFilename = _animName;
if (_animName.hasPrefixIgnoreCase("stnd") /* && word_45d20 == -1 */) // TODO
animFilename += 'j';
@@ -494,7 +494,7 @@ void StarTrekEngine::drawObjectToScreen(Object *object, const Common::String &_a
object->field5e = x;
object->field60 = y;
object->field62 = 0;
- object->scale = arg8;
+ object->scale = scale;
object->animFile->seek(16, SEEK_SET);
object->frameToStartNextAnim = object->animFile->readUint16() + _frameIndex;
@@ -507,11 +507,11 @@ void StarTrekEngine::drawObjectToScreen(Object *object, const Common::String &_a
if (addSprite)
_gfx->addSprite(sprite);
- sprite->setBitmap(loadAnimationFrame(firstFrameFilename, arg8));
+ sprite->setBitmap(loadAnimationFrame(firstFrameFilename, scale));
memset(object->animationString4, 0, sizeof(char) * 10);
strncpy(object->animationString4, firstFrameFilename, sizeof(char) * 9);
- object->scale = arg8;
+ object->scale = scale;
object->animFile->seek(10, SEEK_SET);
uint16 xOffset = object->animFile->readUint16();
@@ -544,7 +544,7 @@ void StarTrekEngine::releaseAnim(Object *object) {
object->spriteDrawn = 0;
}
-SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filename, uint16 arg2) {
+SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filename, uint16 scale) {
SharedPtr<Bitmap> bitmapToReturn;
char basename[5];
@@ -633,9 +633,8 @@ SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filen
bitmapToReturn = _gfx->loadBitmap(filename);
}
- if (arg2 != 256) {
- // TODO
- // bitmapToReturn = scaleBitmap(bitmapToReturn, arg2);
+ if (scale != 256) {
+ bitmapToReturn = scaleBitmap(bitmapToReturn, scale);
}
return bitmapToReturn;
@@ -647,10 +646,148 @@ Common::String StarTrekEngine::getCrewmanAnimFilename(int objectIndex, const Com
return crewmanChars[objectIndex] + basename;
}
-void StarTrekEngine::updateClockTicks() {
- // TODO (based on DOS interrupt 1A, AH=0; read system clock counter)
+/**
+ * A scale of 256 is the baseline.
+ */
+SharedPtr<Bitmap> StarTrekEngine::scaleBitmap(SharedPtr<Bitmap> bitmap, uint16 scale) {
+ int scaledWidth = (bitmap->width * scale) >> 8;
+ int scaledHeight = (bitmap->height * scale) >> 8;
+ int origWidth = bitmap->width;
+ int origHeight = bitmap->height;
+
+ if (scaledWidth < 1)
+ scaledWidth = 1;
+ if (scaledHeight < 1)
+ scaledHeight = 1;
+
+ SharedPtr<Bitmap> scaledBitmap(new Bitmap(scaledWidth, scaledHeight));
+ scaledBitmap->xoffset = (bitmap->xoffset * scale) >> 8;
+ scaledBitmap->yoffset = (bitmap->yoffset * scale) >> 8;
+
+ // sub_344a5(scaledWidth, origWidth);
+
+ origHeight--;
+ scaledHeight--;
+
+ byte *src = bitmap->pixels;
+ byte *dest = scaledBitmap->pixels;
+
+ if (scale <= 256) {
+ int16 var2e = 0;
+ uint16 var30 = scaledHeight << 1;
+ uint16 var32 = (scaledHeight - origHeight) << 1;
+ uint16 origRow = 0;
+
+ while (origRow <= origHeight) {
+ if (var2e < 0) {
+ var2e += var30;
+ }
+ else {
+ var2e += var32;
+ scaleBitmapRow(src, dest, origWidth, scaledWidth);
+ dest += scaledWidth;
+ }
- _clockTicks = 0;
+ src += bitmap->width;
+ origRow++;
+ }
+ }
+ else {
+ int16 var2e = (origHeight << 1) - scaledHeight;
+ uint16 var30 = origHeight << 1;
+ uint16 var32 = (origHeight - scaledHeight) << 1;
+ uint16 srcRowChanged = true;
+ origWidth = bitmap->width;
+ uint16 scaledRow = 0;
+ byte *rowData = new byte[scaledWidth];
+
+ while (scaledRow++ <= scaledHeight) {
+ if (srcRowChanged) {
+ scaleBitmapRow(src, rowData, origWidth, scaledWidth);
+ srcRowChanged = false;
+ }
+
+ memcpy(dest, rowData, scaledWidth);
+ dest += scaledWidth;
+
+ if (var2e < 0) {
+ var2e += var30;
+ }
+ else {
+ var2e += var32;
+ src += origWidth;
+ srcRowChanged = true;
+ }
+ }
+
+ delete[] rowData;
+ }
+
+ return scaledBitmap;
+}
+
+/**
+ * This was heavily optimized in the original game (manually constructed an unrolled
+ * loop).
+ */
+void StarTrekEngine::scaleBitmapRow(byte *src, byte *dest, uint16 origWidth, uint16 scaledWidth) {
+ if (origWidth >= scaledWidth) {
+ int16 var2 = (scaledWidth << 1) - origWidth;
+ uint16 var4 = scaledWidth << 1;
+ uint16 var6 = (scaledWidth - origWidth) << 1;
+ uint16 varE = 0;
+ uint16 varA = 0;
+ uint16 var8 = origWidth;
+ uint16 di = 0;
+
+ while (var8-- != 0) {
+ if (var2 < 0) {
+ var2 += var4;
+ }
+ else {
+ var2 += var6;
+ if (di != 0) {
+ if (varE != 0) {
+ *(dest - 1) = *src++;
+ varE = 0;
+ di--;
+ }
+ src += di;
+ di = 0;
+ }
+ *dest++ = *src;
+ varE = 1;
+ }
+
+ di++;
+ varA++;
+ }
+ }
+ else {
+ int16 var2 = ((origWidth - 1) << 1) - (scaledWidth - 1);
+ uint16 var4 = (origWidth - 1) << 1;
+ uint16 var6 = ((origWidth - 1) - (scaledWidth - 1)) << 1;
+ uint16 varA = 0;
+ uint16 var8 = scaledWidth;
+ uint16 di = 0;
+
+ while (var8-- != 0) {
+ if (di != 0) {
+ src += di;
+ di = 0;
+ }
+ *dest++ = *src;
+
+ if (var2 < 0)
+ var2 += var4;
+ else {
+ var2 += var6;
+ di++;
+ }
+
+ varA++;
+ }
+ }
}
/**
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 921d655..67c2c80 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -132,6 +132,8 @@ public:
SharedPtr<Bitmap> loadAnimationFrame(const Common::String &filename, uint16 arg2);
Common::String getCrewmanAnimFilename(int objectIndex, const Common::String &basename);
+ SharedPtr<Bitmap> scaleBitmap(SharedPtr<Bitmap> bitmap, uint16 scale);
+ void scaleBitmapRow(byte *src, byte *dest, uint16 origWidth, uint16 scaledWidth);
// Events
public:
@@ -142,7 +144,6 @@ public:
bool popNextEvent(TrekEvent *e);
void addEventToQueue(const TrekEvent &e);
void clearEventBuffer();
- uint32 getClockTicks();
void updateEvents();
void updateTimerEvent();
void updateMouseEvents();
@@ -190,6 +191,9 @@ public:
SharedPtr<FileStream> _objectBanFiles[MAX_OBJECTS / 2];
uint16 _objectBanVar2[MAX_OBJECTS / 2]; // TODO: initialize?
+
+ // _clockTicks is based on DOS interrupt 1A, AH=0; read system clock counter.
+ // Updates 18.206 times every second.
uint32 _clockTicks;
uint32 _frameIndex;
Commit: dbeb58f3926dba1bd0e5cb1556eb71040dd94afc
https://github.com/scummvm/scummvm/commit/dbeb58f3926dba1bd0e5cb1556eb71040dd94afc
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Palette fading
Changed paths:
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/startrek.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 457313c..c94d9f7 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -52,13 +52,17 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_textboxVar6 = 0;
_textboxHasMultipleChoices = false;
+ _palData = new byte[256 * 3];
+ _lutData = new byte[256 * 3];
+
+ _paletteFadeLevel = 0;
+
setMouseCursor(loadBitmap("pushbtn"));
CursorMan.showMouse(true);
}
Graphics::~Graphics() {
delete[] _egaData;
- delete[] _lutData;
delete _font;
}
@@ -68,35 +72,79 @@ void Graphics::setBackgroundImage(SharedPtr<Bitmap> bitmap) {
_backgroundImage = bitmap;
}
+/**
+ * Note: this doesn't flush the palette to the screen (must call "setPaletteFadeLevel")
+ */
void Graphics::loadPalette(const Common::String &paletteName) {
// Set the palette from a PAL file
Common::String palFile = paletteName + ".PAL";
Common::String lutFile = paletteName + ".LUT";
SharedPtr<Common::SeekableReadStream> palStream = _vm->loadFile(palFile.c_str());
- byte *palette = new byte[256 * 3];
- palStream->read(palette, 256 * 3);
-
- // Expand color components
- if (_vm->getPlatform() == Common::kPlatformDOS || _vm->getPlatform() == Common::kPlatformMacintosh)
- for (uint16 i = 0; i < 256 * 3; i++)
- palette[i] <<= 2;
-
- _vm->_system->getPaletteManager()->setPalette(palette, 0, 256);
-
- delete[] palette;
+ palStream->read(_palData, 256 * 3);
// Load LUT file
SharedPtr<Common::SeekableReadStream> lutStream = _vm->loadFile(lutFile.c_str());
- delete[] _lutData;
- _lutData = new byte[256];
lutStream->read(_lutData, 256);
}
+void Graphics::fadeinScreen() {
+ while (_paletteFadeLevel <= 100) {
+ TrekEvent event;
+ do {
+ _vm->popNextEvent(&event);
+ }
+ while (event.type != TREKEVENT_TICK);
+
+ setPaletteFadeLevel(_palData, _paletteFadeLevel);
+ _paletteFadeLevel += 10;
+ }
+
+ _paletteFadeLevel = 100;
+}
+
+void Graphics::fadeoutScreen() {
+ while (_paletteFadeLevel >= 0) {
+ TrekEvent event;
+ do {
+ _vm->popNextEvent(&event);
+ }
+ while (event.type != TREKEVENT_TICK);
+
+ setPaletteFadeLevel(_palData, _paletteFadeLevel);
+ _paletteFadeLevel -= 10;
+ }
+
+ _paletteFadeLevel = 0;
+}
+
+/**
+ * This flushes the palette to the screen. fadeLevel ranges from 0-100.
+ */
+void Graphics::setPaletteFadeLevel(byte *palData, int fadeLevel) {
+ byte palBuffer[256 * 3];
+
+ int multiplier = (fadeLevel << 8) / 100;
+
+ for (uint16 i = 0; i < 256 * 3; i++) {
+ palBuffer[i] = (palData[i] * multiplier) >> 8;
+
+ // Expand color components
+ if (_vm->getPlatform() == Common::kPlatformDOS || _vm->getPlatform() == Common::kPlatformMacintosh)
+ palBuffer[i] <<= 2;
+ }
+
+ _vm->_system->getPaletteManager()->setPalette(palBuffer, 0, 256);
+
+ // FIXME: this isn't supposed to flush changes to graphics, only palettes.
+ // Might not matter...
+ _vm->_system->updateScreen();
+}
+
void Graphics::loadPri(const char *priFile) {
SharedPtr<Common::SeekableReadStream> priStream = _vm->loadFile(priFile);
- priStream->read(_priData, SCREEN_WIDTH*SCREEN_HEIGHT / 2);
+ priStream->read(_priData, SCREEN_WIDTH * SCREEN_HEIGHT / 2);
}
void Graphics::clearPri() {
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 758f327..c50a39f 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -71,7 +71,12 @@ public:
~Graphics();
void setBackgroundImage(SharedPtr<Bitmap> bitmap);
+
void loadPalette(const String &paletteFile);
+ void fadeinScreen();
+ void fadeoutScreen();
+ void setPaletteFadeLevel(byte *palData, int fadeLevel);
+
void loadPri(const char *priFile);
void clearPri();
byte getPriValue(int x, int y);
@@ -99,9 +104,12 @@ private:
bool _egaMode;
byte *_egaData;
+ byte *_palData;
byte *_lutData;
byte _priData[SCREEN_WIDTH*SCREEN_HEIGHT / 2];
+ int16 _paletteFadeLevel;
+
Common::Rect _screenRect;
SharedPtr<Bitmap> _backgroundImage;
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 3a434bf..7c3f728 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -214,7 +214,7 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
};
_sound->stopAllVocSounds();
- // sub_1e70d();
+ _gfx->fadeoutScreen();
objectFunc1();
initObjects();
@@ -229,7 +229,7 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
Common::String filename = getCrewmanAnimFilename(i, name);
int x = crewmanTransportPositions[i][0];
int y = crewmanTransportPositions[i][1];
- loadAnimationForObject(i, filename, x, y, 128);
+ loadAnimationForObject(i, filename, x, y, 256);
_objectList[i].animationString[0] = '\0';
}
@@ -252,7 +252,7 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
// TODO: redraw mouse and sprite_52c4e?
_gfx->drawAllSprites();
- // sub_1e6ab();
+ _gfx->fadeinScreen();
playSoundEffectIndex(0x0a);
@@ -276,7 +276,7 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
// TODO: redraw sprite_52c4e?
_gfx->drawAllSprites();
- // sub_1e70d();
+ _gfx->fadeoutScreen();
objectFunc1();
initObjects();
}
Commit: 0187c795d5e1569105d4cb49a16810f6a50cc261
https://github.com/scummvm/scummvm/commit/0187c795d5e1569105d4cb49a16810f6a50cc261
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Initialization of away mission.
Crew successfully beams in and does their idle animation.
Changed paths:
A engines/startrek/awaymission.cpp
A engines/startrek/awaymission.h
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/module.mk
engines/startrek/object.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
new file mode 100644
index 0000000..73526ee
--- /dev/null
+++ b/engines/startrek/awaymission.cpp
@@ -0,0 +1,237 @@
+/* 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 "startrek/startrek.h"
+
+namespace StarTrek {
+
+void StarTrekEngine::initAwayMission() {
+ _awayMission = AwayMission(); // Initialize members to 0
+
+ // memset(bitmapBuffer->pixels, 0, 0xfa00);
+ // sub_15ab1("ground");
+ // sub_23a60();
+ _sound->loadMusicFile("ground");
+
+ loadRoom(_missionToLoad, _roomIndexToLoad);
+
+ // Load crew positions for beaming in
+ initAwayCrewPositions(4);
+}
+
+void StarTrekEngine::runAwayMission() {
+ while (true) {
+ handleAwayMissionEvents();
+
+ Common::Point mousePos = _gfx->getMousePos();
+ _awayMission.mouseX = mousePos.x;
+ _awayMission.mouseY = mousePos.y;
+
+ assert(_commandQueue.size() <= 16);
+ if (!_commandQueue.empty()) {
+ // sub_200e7();
+ // sub_20118();
+ runAwayMissionCycle();
+ }
+ }
+}
+
+void StarTrekEngine::cleanupAwayMission() {
+ // TODO
+}
+
+void StarTrekEngine::loadRoom(const Common::String &missionName, int roomIndex) {
+ if (_room != nullptr)
+ delete _room;
+
+ _keyboardControlsMouse = true;
+
+ _missionName = _missionToLoad;
+ _roomIndex = _roomIndexToLoad;
+
+ _roomFrameCounter = 0;
+ _awayMission.field1d = 0;
+
+ _gfx->fadeoutScreen();
+ _sound->stopAllVocSounds();
+
+ _screenName = _missionName + (char)(_roomIndex + '0');
+
+ _gfx->setBackgroundImage(_gfx->loadBitmap(_screenName));
+ _gfx->loadPri(_screenName + ".pri");
+ _gfx->loadPalette("palette");
+ _gfx->copyBackgroundScreen();
+
+ _room = new Room(this, _screenName);
+
+ // Original sets up bytes 0-3 of rdf file as "remote function caller"
+
+ // Load map file
+ _awayMission.mapFileLoaded = 1;
+ _mapFilename = _screenName;
+ _mapFile = loadFile(_mapFilename + ".map");
+ // loadIWFile(_mapFilename);
+
+ objectFunc1();
+ initObjects();
+
+ double num = _room->readRdfWord(0x0c) - _room->readRdfWord(0x0a);
+ double den = _room->readRdfWord(0x06) - _room->readRdfWord(0x08) + 1;
+ _playerObjectScale = (int32)(num * 256 / den);
+
+ // TODO: RDF vars 1e/1f and 20/21; relates to BAN files?
+
+ _commandQueue.clear();
+}
+
+void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) {
+ _sound->stopAllVocSounds();
+
+ memset(_awayMission.field25, 0xff, 4);
+
+ switch (warpEntryIndex) {
+ case 0:
+ break;
+ case 1:
+ break;
+ case 2:
+ break;
+ case 3:
+ break;
+ case 4: // Crew is beaming in.
+ warpEntryIndex -= 4;
+ for (int i = 0; i < (_awayMission.redshirtDead ? 3 : 4); i++) {
+ Common::String animFilename = getCrewmanAnimFilename(i, "tele");
+ Common::Point warpPos = _room->getBeamInPosition(i);
+ loadObjectAnimWithRoomScaling(i, animFilename, warpPos.x, warpPos.y);
+ }
+ _kirkObject->field64 = 1;
+ _kirkObject->field66 = 0xff;
+ _awayMission.field1d = 1;
+ playSoundEffectIndex(0x09);
+ // word_466f2 = 0;
+ break;
+ case 5:
+ break;
+ case 6:
+ break;
+ }
+}
+
+void StarTrekEngine::handleAwayMissionEvents() {
+ TrekEvent event;
+
+ if (popNextEvent(&event)) {
+ switch (event.type) {
+ case TREKEVENT_TICK:
+ updateObjectAnimations();
+ // sub_236bb();
+ // sub_2325d();
+ // doSomethingWithBanData1();
+ _gfx->drawAllSprites();
+ // doSomethingWithBanData2();
+ // updateMusic(); // Is this needed?
+ // sub_22de0();
+ _frameIndex++;
+ _roomFrameCounter++;
+ // sub_20099(0, _roomFrameCounter & 0xff, (_roomFrameCounter >> 8) & 0xff, 0);
+ if (_roomFrameCounter >= 2)
+ _gfx->incPaletteFadeLevel();
+ break;
+ case TREKEVENT_LBUTTONDOWN:
+ if (_awayMission.field1d != 0)
+ break;
+ switch (_awayMission.mapFileLoaded) {
+ case 0:
+ if (_awayMission.field1c == 0) {
+ _kirkObject->sprite.drawMode = 1; // Hide these objects for function call below?
+ _spockObject->sprite.drawMode = 1;
+ _mccoyObject->sprite.drawMode = 1;
+ _redshirtObject->sprite.drawMode = 1;
+
+ // findObjectClickedOn();
+ // ...
+
+ _kirkObject->sprite.drawMode = 0;
+ _spockObject->sprite.drawMode = 0;
+ _mccoyObject->sprite.drawMode = 0;
+ _redshirtObject->sprite.drawMode = 0;
+
+ Common::String animFilename = getCrewmanAnimFilename(0, "walk");
+ Common::Point mousePos = _gfx->getMousePos();
+ // objectWalkToPosition(0, animFilename, _kirkObject->pos.x, _kirkObject->pos.y, mousePos.x, mousePos.y);
+ }
+ break;
+ case 1:
+ break;
+ case 2:
+ break;
+ case 3:
+ break;
+ case 4:
+ break;
+ case 5:
+ break;
+ }
+ break;
+ case TREKEVENT_MOUSEMOVE:
+ break;
+ case TREKEVENT_RBUTTONDOWN:
+ break;
+ case TREKEVENT_KEYDOWN:
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+/**
+ * Similar to loadObjectAnim, but scale is determined by the y-position in the room. The
+ * further up (away) the object is, the smaller it is.
+ */
+int StarTrekEngine::loadObjectAnimWithRoomScaling(int objectIndex, const Common::String &animName, int16 x, int16 y) {
+ uint16 scale = getObjectScaleAtPosition(y);
+ return loadObjectAnim(objectIndex, animName, x, y, scale);
+}
+
+uint16 StarTrekEngine::getObjectScaleAtPosition(int16 y) {
+ int16 var06 = _room->getVar06();
+ int16 var08 = _room->getVar08();
+ int16 var0a = _room->getVar0a();
+
+ if (var06 < y)
+ y = var06;
+ if (var08 > y)
+ y = var08;
+
+ return ((_playerObjectScale * (y - var08)) >> 8) + var0a;
+}
+
+Room *StarTrekEngine::getRoom() {
+ return _room;
+}
+
+void StarTrekEngine::runAwayMissionCycle() {
+}
+
+}
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
new file mode 100644
index 0000000..290e5e3
--- /dev/null
+++ b/engines/startrek/awaymission.h
@@ -0,0 +1,40 @@
+/* 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.
+ *
+ */
+
+#ifndef STARTREK_AWAYMISSION_H
+#define STARTREK_AWAYMISSION_H
+
+// All variables here get cleared to 0 upon starting an away mission.
+struct AwayMission {
+ int16 mouseX;
+ int16 mouseY;
+ byte field1c;
+ byte field1d;
+ bool redshirtDead;
+ byte mapFileLoaded;
+ int8 field25[4];
+
+ bool rdfRunNextCommand;
+};
+// Size: 0x129 bytes
+
+#endif
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index c94d9f7..2a99025 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -44,8 +44,6 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
if (_vm->getGameType() == GType_ST25 && _vm->getPlatform() == Common::kPlatformDOS)
_font = new Font(_vm);
- _backgroundImage = loadBitmap("DEMON0");
-
_numSprites = 0;
_textDisplayMode = TEXTDISPLAY_WAIT;
_textboxVar2 = 0;
@@ -142,7 +140,22 @@ void Graphics::setPaletteFadeLevel(byte *palData, int fadeLevel) {
_vm->_system->updateScreen();
}
-void Graphics::loadPri(const char *priFile) {
+void Graphics::incPaletteFadeLevel() {
+ if (_paletteFadeLevel < 100) {
+ _paletteFadeLevel += 10;
+ setPaletteFadeLevel(_palData, _paletteFadeLevel);
+ }
+}
+
+void Graphics::decPaletteFadeLevel() {
+ if (_paletteFadeLevel > 0) {
+ _paletteFadeLevel -= 10;
+ setPaletteFadeLevel(_palData, _paletteFadeLevel);
+ }
+}
+
+
+void Graphics::loadPri(const Common::String &priFile) {
SharedPtr<Common::SeekableReadStream> priStream = _vm->loadFile(priFile);
priStream->read(_priData, SCREEN_WIDTH * SCREEN_HEIGHT / 2);
}
@@ -468,6 +481,10 @@ void Graphics::delSprite(Sprite *sprite) {
}
+void Graphics::copyBackgroundScreen() {
+ drawDirectToScreen(_backgroundImage);
+}
+
void Graphics::drawDirectToScreen(SharedPtr<Bitmap> bitmap) {
int xoffset = bitmap->xoffset;
int yoffset = bitmap->yoffset;
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index c50a39f..f7d9402 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -76,8 +76,10 @@ public:
void fadeinScreen();
void fadeoutScreen();
void setPaletteFadeLevel(byte *palData, int fadeLevel);
+ void incPaletteFadeLevel();
+ void decPaletteFadeLevel();
- void loadPri(const char *priFile);
+ void loadPri(const Common::String &priFile);
void clearPri();
byte getPriValue(int x, int y);
@@ -94,6 +96,7 @@ public:
void delSprite(Sprite *sprite);
+ void copyBackgroundScreen();
void drawDirectToScreen(SharedPtr<Bitmap> bitmap);
void loadEGAData(const char *egaFile);
void drawBackgroundImage(const char *filename);
@@ -106,7 +109,7 @@ private:
byte *_egaData;
byte *_palData;
byte *_lutData;
- byte _priData[SCREEN_WIDTH*SCREEN_HEIGHT / 2];
+ byte _priData[SCREEN_WIDTH * SCREEN_HEIGHT / 2];
int16 _paletteFadeLevel;
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 3b93fbc..b79126a 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -1,6 +1,7 @@
MODULE := engines/startrek
MODULE_OBJS = \
+ awaymission.o \
bitmap.o \
common.o \
detection.o \
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index 41bf1f9..d9b16da 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -44,7 +44,7 @@ struct Object {
uint16 numAnimFrames;
uint16 animFrame;
uint32 frameToStartNextAnim;
- uint16 field5e;
+ Common::Point pos;
uint16 field60;
uint16 field62;
uint16 field64;
@@ -67,7 +67,8 @@ struct Object {
uint16 field8c;
uint16 field8e;
uint16 field90;
- uint16 field92;
+ byte field92;
+ char direction; // Can 'n', 's', 'e', 'w', or 0 for uninitialized?
uint16 field94;
uint16 field96;
char animationString[9];
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index a687374..8cef65d 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -46,4 +46,9 @@ uint16 Room::readRdfWord(int offset) {
return _rdfData[offset] | (_rdfData[offset+1]<<8);
}
+Common::Point Room::getBeamInPosition(int crewmanIndex) {
+ int base = 0xaa + crewmanIndex * 4;
+ return Common::Point(readRdfWord(base), readRdfWord(base + 2));
+}
+
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index afe366b8..a06d2af 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -17,11 +17,13 @@
* 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.
+ *
*/
#ifndef STARTREK_ROOM_H
#define STARTREK_ROOM_H
+#include "common/rect.h"
#include "common/ptr.h"
#include "common/str.h"
@@ -38,8 +40,17 @@ public:
Room(StarTrekEngine *vm, Common::String name);
~Room();
+ // Helper stuff for RDF access
uint16 readRdfWord(int offset);
+ // Scale-related stuff (rename these later)
+ int16 getVar06() { return readRdfWord(0x06); }
+ int16 getVar08() { return readRdfWord(0x08); }
+ int16 getVar0a() { return readRdfWord(0x0a); }
+ int16 getVar0c() { return readRdfWord(0x0c); }
+
+ Common::Point getBeamInPosition(int crewmanIndex);
+
byte *_rdfData;
private:
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 7c3f728..346cb91 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -55,8 +55,6 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_macResFork = nullptr;
_room = nullptr;
- _redshirtDead = false;
-
_clockTicks = 0;
_musicEnabled = true;
@@ -70,6 +68,9 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_keyboardControlsMouse = true;
_inQuitGameMenu = false;
+
+ _missionToLoad = "DEMON";
+ _roomIndexToLoad = 0;
}
StarTrekEngine::~StarTrekEngine() {
@@ -140,11 +141,11 @@ Common::Error StarTrekEngine::runGameMode(int mode) {
// Cleanup previous game mode
switch (_lastGameMode) {
case GAMEMODE_BRIDGE:
- //cleanupBridgeMode();
+ //cleanupBridge();
break;
case GAMEMODE_AWAYMISSION:
- //cleanupAwayMissionMode();
+ cleanupAwayMission();
break;
case GAMEMODE_BEAMDOWN:
@@ -162,11 +163,11 @@ Common::Error StarTrekEngine::runGameMode(int mode) {
break;
case GAMEMODE_AWAYMISSION:
- //initAwayMission();
+ initAwayMission();
break;
case GAMEMODE_BEAMDOWN:
- _redshirtDead = false;
+ _awayMission.redshirtDead = false;
_sound->loadMusicFile("ground");
runTransportSequence("teled");
_gameMode = GAMEMODE_AWAYMISSION;
@@ -190,9 +191,7 @@ Common::Error StarTrekEngine::runGameMode(int mode) {
break;
case GAMEMODE_AWAYMISSION:
- popNextEvent(&event);
- _system->updateScreen();
- //runAwayMission();
+ runAwayMission();
break;
case GAMEMODE_BEAMDOWN:
@@ -225,29 +224,29 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
_gfx->drawDirectToScreen(bgImage);
_system->updateScreen();
- for (int i = 0; i < (_redshirtDead ? 3 : 4); i++) {
+ for (int i = 0; i < (_awayMission.redshirtDead ? 3 : 4); i++) {
Common::String filename = getCrewmanAnimFilename(i, name);
int x = crewmanTransportPositions[i][0];
int y = crewmanTransportPositions[i][1];
- loadAnimationForObject(i, filename, x, y, 256);
+ loadObjectAnim(i, filename, x, y, 256);
_objectList[i].animationString[0] = '\0';
}
if (_missionToLoad.equalsIgnoreCase("feather") && name[4] == 'b') {
- loadAnimationForObject(9, "qteleb", 0x61, 0x79, 0x100);
+ loadObjectAnim(9, "qteleb", 0x61, 0x79, 0x100);
}
else if (_missionToLoad.equalsIgnoreCase("trial")) {
if (name[4] == 'd') {
- loadAnimationForObject(9, "qteled", 0x61, 0x79, 0x100);
+ loadObjectAnim(9, "qteled", 0x61, 0x79, 0x100);
}
/* TODO
else if (word_51156 >= 3) {
- loadAnimationForObject(9, "qteleb", 0x61, 0x79, 0x100);
+ loadObjectAnim(9, "qteleb", 0x61, 0x79, 0x100);
}
*/
}
- loadAnimationForObject(8, "transc", 0, 0, 0x100);
+ loadObjectAnim(8, "transc", 0, 0, 0x100);
// TODO: redraw mouse and sprite_52c4e?
@@ -281,10 +280,6 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
initObjects();
}
-Room *StarTrekEngine::getRoom() {
- return _room;
-}
-
void StarTrekEngine::playSoundEffectIndex(int index) {
switch (index) {
case 0x04:
@@ -358,7 +353,10 @@ void StarTrekEngine::initObjects() {
strcpy(_redshirtObject->animationString, "rstnd");
}
-int StarTrekEngine::loadAnimationForObject(int objectIndex, const Common::String &animName, uint16 x, uint16 y, uint16 scale) {
+/**
+ * Set an object's animation, position, and scale.
+ */
+int StarTrekEngine::loadObjectAnim(int objectIndex, const Common::String &animName, int16 x, int16 y, uint16 scale) {
debugC(6, kDebugGraphics, "Load animation '%s' on object %d", animName.c_str(), objectIndex);
Object *object;
@@ -412,10 +410,8 @@ void StarTrekEngine::updateObjectAnimations() {
if (object->animFrame >= object->numAnimFrames) {
if (object->animationString[0] == '\0')
removeObjectFromScreen(i);
- /*
- else // TODO
+ else
initStandAnim(i);
- */
}
else {
Sprite *sprite = &object->sprite;
@@ -434,9 +430,9 @@ void StarTrekEngine::updateObjectAnimations() {
uint16 basePriority = object->animFile->readUint16();
uint16 frames = object->animFile->readUint16();
- sprite->pos.x = xOffset + object->field5e;
- sprite->pos.y = yOffset + object->field60;
- sprite->drawPriority = _gfx->getPriValue(0, yOffset + object->field60) + basePriority;
+ sprite->pos.x = xOffset + object->pos.x;
+ sprite->pos.y = yOffset + object->pos.y;
+ sprite->drawPriority = _gfx->getPriValue(0, yOffset + object->pos.y) + basePriority;
sprite->bitmapChanged = true;
object->frameToStartNextAnim = frames + _frameIndex;
@@ -491,8 +487,8 @@ void StarTrekEngine::drawObjectToScreen(Object *object, const Common::String &_a
object->animFile = loadFile(animFilename + ".anm");
object->numAnimFrames = object->animFile->size() / 22;
object->animFrame = 0;
- object->field5e = x;
- object->field60 = y;
+ object->pos.x = x;
+ object->pos.y = y;
object->field62 = 0;
object->scale = scale;
@@ -518,9 +514,9 @@ void StarTrekEngine::drawObjectToScreen(Object *object, const Common::String &_a
uint16 yOffset = object->animFile->readUint16();
uint16 basePriority = object->animFile->readUint16();
- sprite->pos.x = xOffset + object->field5e;
- sprite->pos.y = yOffset + object->field60;
- sprite->drawPriority = _gfx->getPriValue(0, yOffset + object->field60) + basePriority;
+ sprite->pos.x = xOffset + object->pos.x;
+ sprite->pos.y = yOffset + object->pos.y;
+ sprite->drawPriority = _gfx->getPriValue(0, yOffset + object->pos.y) + basePriority;
sprite->bitmapChanged = true;
object->spriteDrawn = 1;
@@ -537,13 +533,44 @@ void StarTrekEngine::releaseAnim(Object *object) {
warning("Unimplemented anim type %d", object->animType);
break;
default:
- error("Invalid anim type.");
+ error("Invalid anim type");
break;
}
object->spriteDrawn = 0;
}
+void StarTrekEngine::initStandAnim(int objectIndex) {
+ Object *object = &_objectList[objectIndex];
+
+ if (!object->spriteDrawn)
+ error("initStandAnim: dead anim");
+
+ ////////////////////
+ // sub_239d2
+ const char *directions = "nsew";
+
+ if (objectIndex >= 0 && objectIndex <= 3) {
+ int8 dir = _awayMission.field25[objectIndex];
+ if (dir != -1) {
+ object->direction = directions[dir];
+ _awayMission.field25[objectIndex] = -1;
+ }
+ }
+ // end of sub_239d2
+ ////////////////////
+
+ Common::String animName;
+ if (object->direction != 0)
+ animName = Common::String(object->animationString) + (char)object->direction;
+ else // Default to facing south
+ animName = Common::String(object->animationString) + 's';
+
+ uint16 scale = getObjectScaleAtPosition(object->pos.y);
+ loadObjectAnim(objectIndex, animName, object->pos.x, object->pos.y, scale);
+ object->animType = 0;
+}
+
SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filename, uint16 scale) {
SharedPtr<Bitmap> bitmapToReturn;
@@ -581,13 +608,13 @@ SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filen
// Change uniform color
int16 colorShift;
switch (c) {
- case 'k':
+ case 'k': // Kirk
colorShift = 8;
break;
- case 'r':
+ case 'r': // Redshirt
colorShift = -8;
break;
- case 's':
+ case 's': // Spock
colorShift = 0;
break;
}
@@ -727,6 +754,7 @@ SharedPtr<Bitmap> StarTrekEngine::scaleBitmap(SharedPtr<Bitmap> bitmap, uint16 s
}
/**
+ * This takes a row of an unscaled bitmap, and copies it to a row of a scaled bitmap.
* This was heavily optimized in the original game (manually constructed an unrolled
* loop).
*/
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 67c2c80..52157f4 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -17,6 +17,7 @@
* 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.
+ *
*/
#ifndef STARTREK_H
@@ -34,6 +35,7 @@
#include "engines/engine.h"
+#include "startrek/awaymission.h"
#include "startrek/filestream.h"
#include "startrek/graphics.h"
#include "startrek/object.h"
@@ -95,6 +97,18 @@ struct TrekEvent {
uint32 tick;
};
+enum Commands {
+ COMMAND_TICK = 0,
+ COMMAND_CLICKED_ON_OBJECT
+};
+
+struct Command {
+ byte type;
+ byte b1; // These depend on command type?
+ byte b2;
+ byte b3;
+};
+
const int MAX_OBJECTS = 0x20;
struct StarTrekGameDescription;
@@ -108,6 +122,23 @@ protected:
private:
// Game modes
Common::Error runGameMode(int mode);
+
+ // Away missions
+ void initAwayMission();
+ void runAwayMission();
+ void cleanupAwayMission();
+ void loadRoom(const Common::String &missionName, int roomIndex);
+ void initAwayCrewPositions(int warpEntryIndex);
+ void handleAwayMissionEvents();
+ int loadObjectAnimWithRoomScaling(int objectIndex, const Common::String &animName, int16 x, int16 y);
+ uint16 getObjectScaleAtPosition(int16 y);
+ void runAwayMissionCycle();
+
+public:
+ Room *getRoom();
+
+private:
+ // Transporter room
void runTransportSequence(const Common::String &name);
public:
@@ -115,20 +146,20 @@ public:
virtual ~StarTrekEngine();
// Running the game
- Room *getRoom();
-
void playSoundEffectIndex(int index);
void playSpeech(const Common::String &filename);
void stopPlayingSpeech();
// Objects
void initObjects();
- int loadAnimationForObject(int objectIndex, const Common::String &animName, uint16 x, uint16 y, uint16 arg8);
+ int loadObjectAnim(int objectIndex, const Common::String &animName, int16 x, int16 y, uint16 arg8);
+ bool objectWalkToPosition(int objectIndex, Common::Point src, Common::Point dest);
void updateObjectAnimations();
void removeObjectFromScreen(int objectIndex);
void objectFunc1();
void drawObjectToScreen(Object *object, const Common::String &animName, uint16 field5e, uint16 field60, uint16 arg8, bool addSprite);
void releaseAnim(Object *object);
+ void initStandAnim(int objectIndex);
SharedPtr<Bitmap> loadAnimationFrame(const Common::String &filename, uint16 arg2);
Common::String getCrewmanAnimFilename(int objectIndex, const Common::String &basename);
@@ -179,8 +210,21 @@ public:
public:
int _gameMode;
int _lastGameMode;
- bool _redshirtDead;
+
Common::String _missionToLoad;
+ int _roomIndexToLoad;
+
+ Common::String _missionName;
+ int _roomIndex;
+ Common::String _screenName; // _screenName = _missionName + _roomIndex
+ Common::String _mapFilename; // Similar to _screenName, but used for .map files?
+ SharedPtr<FileStream> _mapFile;
+ int32 _playerObjectScale;
+
+ // Queue of "commands" (ie. next frame, clicked on object) for away mission or bridge
+ Common::Queue<Command> _commandQueue;
+
+ AwayMission _awayMission;
Object _objectList[MAX_OBJECTS];
Object * const _kirkObject;
@@ -196,6 +240,7 @@ public:
// Updates 18.206 times every second.
uint32 _clockTicks;
uint32 _frameIndex;
+ uint32 _roomFrameCounter; // Resets to 0 on loading a room
bool _musicEnabled;
bool _sfxEnabled;
Commit: 65d24b04519a5e0bbd7b1efbf6b379d539b424e5
https://github.com/scummvm/scummvm/commit/65d24b04519a5e0bbd7b1efbf6b379d539b424e5
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Basic walking
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/object.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 73526ee..77576d2 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -158,10 +158,10 @@ void StarTrekEngine::handleAwayMissionEvents() {
_gfx->incPaletteFadeLevel();
break;
case TREKEVENT_LBUTTONDOWN:
- if (_awayMission.field1d != 0)
- break;
+ //if (_awayMission.field1d != 0) // FIXME: uncomment
+ // break;
switch (_awayMission.mapFileLoaded) {
- case 0:
+ case 1:
if (_awayMission.field1c == 0) {
_kirkObject->sprite.drawMode = 1; // Hide these objects for function call below?
_spockObject->sprite.drawMode = 1;
@@ -178,11 +178,9 @@ void StarTrekEngine::handleAwayMissionEvents() {
Common::String animFilename = getCrewmanAnimFilename(0, "walk");
Common::Point mousePos = _gfx->getMousePos();
- // objectWalkToPosition(0, animFilename, _kirkObject->pos.x, _kirkObject->pos.y, mousePos.x, mousePos.y);
+ objectWalkToPosition(0, animFilename, _kirkObject->pos.x, _kirkObject->pos.y, mousePos.x, mousePos.y);
}
break;
- case 1:
- break;
case 2:
break;
case 3:
@@ -232,6 +230,17 @@ Room *StarTrekEngine::getRoom() {
}
void StarTrekEngine::runAwayMissionCycle() {
+ // TODO
+}
+
+/**
+ * Returns true if the given position in the room is solid (not walkable).
+ * Reads from a ".map" file which has a bit for each position in the room, which is true
+ * when that position is solid.
+ */
+bool StarTrekEngine::isPositionSolid(int16 x, int16 y) {
+ _mapFile->seek((y * SCREEN_WIDTH + x) / 8, SEEK_SET);
+ return _mapFile->readByte() & (0x80 >> (x % 8));
}
}
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 290e5e3..f2a9ca6 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -28,7 +28,7 @@ struct AwayMission {
int16 mouseX;
int16 mouseY;
byte field1c;
- byte field1d;
+ byte field1d; // Set while beaming in?
bool redshirtDead;
byte mapFileLoaded;
int8 field25[4];
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index d9b16da..d1cd8fb 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -54,21 +54,25 @@ struct Object {
uint16 field72;
uint16 field74;
uint16 field76;
- uint16 iwSrcPosition;
- uint16 iwDestPosition;
- uint16 field7c;
- uint16 field7e;
- uint16 field80;
- uint16 field82;
- uint16 field84;
- uint16 field86;
- uint16 field88;
- uint16 field8a;
- uint16 field8c;
- uint16 field8e;
+ int16 iwSrcPosition;
+ int16 iwDestPosition;
+
+ // Fixed-point position values (16.16) used while walking.
+ uint32 granularPosX;
+ uint32 granularPosY;
+
+ // Fixed-point speed values (16.16).
+ uint32 speedX;
+ uint32 speedY;
+
+ Common::Point dest; // Position object is walking toward
uint16 field90;
byte field92;
- char direction; // Can 'n', 's', 'e', 'w', or 0 for uninitialized?
+
+ // Can 'n', 's', 'e', 'w', or 0 for uninitialized?
+ // Can also be capitalized?
+ char direction;
+
uint16 field94;
uint16 field96;
char animationString[9];
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 346cb91..9cafd44 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -100,7 +100,7 @@ Common::Error StarTrekEngine::run() {
_gameMode = -1;
_lastGameMode = -1;
- runGameMode(GAMEMODE_BEAMDOWN);
+ runGameMode(GAMEMODE_AWAYMISSION);
return Common::kNoError;
@@ -381,6 +381,43 @@ int StarTrekEngine::loadObjectAnim(int objectIndex, const Common::String &animNa
return objectIndex;
}
+/**
+ * Tries to make an object walk to a position.
+ * Returns true if successful in initiating the walk.
+ */
+bool StarTrekEngine::objectWalkToPosition(int objectIndex, const Common::String &animFile, int16 srcX, int16 srcY, int16 destX, int16 destY) {
+ debugC(6, "Obj %d: walk from (%d,%d) to (%d,%d)", objectIndex, srcX, srcY, destX, destY);
+
+ Object *object = &_objectList[objectIndex];
+
+ object->field64 = 0;
+ if (isPositionSolid(destX, destY))
+ return false;
+
+ if (object->spriteDrawn)
+ releaseAnim(object);
+ else
+ _gfx->addSprite(&object->sprite);
+
+ object->spriteDrawn = true;
+ object->animType = 1;
+ object->frameToStartNextAnim = _frameIndex + 1;
+ strcpy(object->animationString2, animFile.c_str());
+
+ object->dest.x = destX;
+ object->dest.y = destY;
+ object->field92 = 0;
+ object->field64 = 0;
+
+ object->iwDestPosition = -1;
+ object->iwSrcPosition = -1;
+
+ // TODO: if (directPathExists(srcX, srcY, destX, destY)) {
+
+ chooseObjectDirectionForWalking(object, srcX, srcY, destX, destY);
+ updateObjectPositionWhileWalking(object, (object->granularPosX + 0x8000) >> 16, (object->granularPosY + 0x8000) >> 16);
+}
+
void StarTrekEngine::updateObjectAnimations() {
for (int i = 0; i < MAX_OBJECTS; i++) {
Object *object = &_objectList[i];
@@ -388,7 +425,7 @@ void StarTrekEngine::updateObjectAnimations() {
continue;
switch (object->animType) {
- case 0:
+ case 0: // Not walking?
case 2:
if (_frameIndex >= object->frameToStartNextAnim) {
int nextAnimIndex = 0; // TODO: "chooseNextAnimFrame" function
@@ -439,8 +476,60 @@ void StarTrekEngine::updateObjectAnimations() {
}
}
break;
- case 1: // TODO
- warning("Unimplemented anim type %d", object->animType);
+ case 1: // Walking
+ if (_frameIndex < object->frameToStartNextAnim)
+ break;
+ /*
+ if (i == 0) // TODO: Kirk only
+ sub_22c2d(object->pos.x, object->pos.y);
+ */
+ if (object->field90 != 0) {
+ Sprite *sprite = &object->sprite;
+ int loops;
+ if (getObjectScaleAtPosition((object->granularPosY + 0x8000) >> 16) < 0xa0)
+ loops = 1;
+ else
+ loops = 2;
+ for (int k = 0; k < loops; k++) {
+ if (object->field90 == 0)
+ break;
+ object->field90--;
+ uint32 newX = object->granularPosX + object->speedX;
+ uint32 newY = object->granularPosY + object->speedY;
+ if ((object->field90 & 3) == 0) {
+ sprite->bitmap.reset();
+ updateObjectPositionWhileWalking(object, (newX + 0x8000) >> 16, (newY + 0x8000) >> 16);
+ object->field92++;
+ }
+
+ object->granularPosX = newX;
+ object->granularPosY = newY;
+ object->frameToStartNextAnim = _frameIndex;
+ }
+ }
+ else { // object->field90 == 0
+ if (object->iwSrcPosition == -1) {
+ if (object->field64 != 0) {
+ object->field64 = 0;
+ //addCommand(COMMAND_12, object->field66 & 0xff, 0, 0);
+ }
+
+ object->sprite.bitmap.reset();
+ updateObjectPositionWhileWalking(object, (object->granularPosX + 0x8000) >> 16, (object->granularPosY + 0x8000) >> 16);
+ initStandAnim(i);
+ }
+ else { // object->iwSrcPosition != -1
+ if (object->iwSrcPosition == object->iwDestPosition) {
+ object->animationString2[strlen(object->animationString2) - 1] = '\0';
+ object->iwDestPosition = -1;
+ object->iwSrcPosition = -1;
+ // sub_11677(object->pos.x, object->pos.y, object->dest.x, object->dest.y);
+ }
+ else {
+
+ }
+ }
+ }
break;
default:
error("Invalid anim type.");
@@ -477,7 +566,7 @@ void StarTrekEngine::objectFunc1() {
}
}
-void StarTrekEngine::drawObjectToScreen(Object *object, const Common::String &_animName, uint16 x, uint16 y, uint16 scale, bool addSprite) {
+void StarTrekEngine::drawObjectToScreen(Object *object, const Common::String &_animName, int16 x, int16 y, uint16 scale, bool addSprite) {
Common::String animFilename = _animName;
if (_animName.hasPrefixIgnoreCase("stnd") /* && word_45d20 == -1 */) // TODO
animFilename += 'j';
@@ -571,6 +660,86 @@ void StarTrekEngine::initStandAnim(int objectIndex) {
object->animType = 0;
}
+void StarTrekEngine::updateObjectPositionWhileWalking(Object *object, int16 x, int16 y) {
+ object->scale = getObjectScaleAtPosition(y);
+ Common::String animName = Common::String::format("%s%02d", object->animationString2, object->field92 & 7);
+ object->sprite.setBitmap(loadAnimationFrame(animName, object->scale));
+
+ memset(object->animationString4, 0, 10);
+ strncpy(object->animationString4, animName.c_str(), 9);
+
+ Sprite *sprite = &object->sprite;
+ sprite->drawPriority = _gfx->getPriValue(0, y);
+ sprite->pos.x = x;
+ sprite->pos.y = y;
+ sprite->bitmapChanged = true;
+
+ object->frameToStartNextAnim = _frameIndex;
+ object->pos.x = x;
+ object->pos.y = y;
+}
+
+/**
+ * Chooses a value for the object's speed and direction, based on a source position and
+ * a destination position it's walking to.
+ */
+void StarTrekEngine::chooseObjectDirectionForWalking(Object *object, int16 srcX, int16 srcY, int16 destX, int16 destY) {
+ object->granularPosX = srcX << 16;
+ object->granularPosY = srcY << 16;
+
+ int16 distX = destX - srcX;
+ int16 distY = destY - srcY;
+ int16 absDistX = abs(distX);
+ int16 absDistY = abs(distY);
+
+ if (absDistX > absDistY) {
+ char d;
+ if (distX > 0)
+ d = 'E';
+ else
+ d = 'W';
+
+ // Append direction to animation string
+ object->animationString2[strlen(object->animationString2) + 1] = '\0';
+ object->animationString2[strlen(object->animationString2)] = d;
+
+ object->direction = d;
+ object->field90 = absDistX;
+
+ if (distX != 0) {
+ if (distX > 0)
+ object->speedX = 1 << 16;
+ else
+ object->speedX = -1 << 16; // 0xffff0000
+
+ object->speedY = (distY << 16) / absDistX;
+ }
+ }
+ else {
+ char d;
+ if (distY > 0)
+ d = 'S';
+ else
+ d = 'N';
+
+ // Append direction to animation string
+ object->animationString2[strlen(object->animationString2) + 1] = '\0';
+ object->animationString2[strlen(object->animationString2)] = d;
+
+ object->direction = d;
+ object->field90 = absDistY;
+
+ if (distY != 0) {
+ if (distY > 0)
+ object->speedY = 1 << 16;
+ else
+ object->speedY = -1 << 16; // 0xffff0000
+
+ object->speedX = (distX << 16) / absDistY;
+ }
+ }
+}
+
SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filename, uint16 scale) {
SharedPtr<Bitmap> bitmapToReturn;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 52157f4..68a9d51 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -99,7 +99,8 @@ struct TrekEvent {
enum Commands {
COMMAND_TICK = 0,
- COMMAND_CLICKED_ON_OBJECT
+ COMMAND_CLICKED_ON_OBJECT = 1,
+ COMMAND_12 = 12
};
struct Command {
@@ -134,6 +135,8 @@ private:
uint16 getObjectScaleAtPosition(int16 y);
void runAwayMissionCycle();
+ bool isPositionSolid(int16 x, int16 y);
+
public:
Room *getRoom();
@@ -153,13 +156,15 @@ public:
// Objects
void initObjects();
int loadObjectAnim(int objectIndex, const Common::String &animName, int16 x, int16 y, uint16 arg8);
- bool objectWalkToPosition(int objectIndex, Common::Point src, Common::Point dest);
+ bool objectWalkToPosition(int objectIndex, const Common::String &animFile, int16 srcX, int16 srcY, int16 destX, int16 destY);
void updateObjectAnimations();
void removeObjectFromScreen(int objectIndex);
void objectFunc1();
- void drawObjectToScreen(Object *object, const Common::String &animName, uint16 field5e, uint16 field60, uint16 arg8, bool addSprite);
+ void drawObjectToScreen(Object *object, const Common::String &animName, int16 x, int16 y, uint16 scale, bool addSprite);
void releaseAnim(Object *object);
void initStandAnim(int objectIndex);
+ void updateObjectPositionWhileWalking(Object *object, int16 x, int16 y);
+ void chooseObjectDirectionForWalking(Object *object, int16 srcX, int16 srcY, int16 destX, int16 destY);
SharedPtr<Bitmap> loadAnimationFrame(const Common::String &filename, uint16 arg2);
Common::String getCrewmanAnimFilename(int objectIndex, const Common::String &basename);
Commit: 1110fee2e462f28d2013530fa23e692aeec7d5dc
https://github.com/scummvm/scummvm/commit/1110fee2e462f28d2013530fa23e692aeec7d5dc
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Sprite layering
Changed paths:
engines/startrek/graphics.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 2a99025..2504534 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -22,6 +22,7 @@
#include "startrek/common.h"
#include "startrek/graphics.h"
+#include "common/algorithm.h"
#include "common/config-manager.h"
#include "common/events.h"
#include "common/rendermode.h"
@@ -336,13 +337,28 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
_vm->_system->unlockScreen();
}
+/**
+ * Compare 2 sprites for the purpose of sorting them by layer before drawing.
+ * FIXME: Original returned an int, not a bool. This may affect the stability of the sort...
+ */
+bool compareSpritesByLayer(Sprite *s1, Sprite *s2) {
+ if (s1->drawPriority != s2->drawPriority)
+ return s1->drawPriority < s2->drawPriority;
+ if (s1->field6 != s2->field6)
+ return s1->field6 < s2->field6;
+ if (s1->pos.y != s2->pos.y)
+ return s1->pos.y < s2->pos.y;
+ return s1->pos.x < s2->pos.x;
+}
+
void Graphics::drawAllSprites() {
// TODO: different video modes?
if (_numSprites == 0)
return;
- // TODO: calculateSpriteDrawPriority()
+ // Sort sprites by layer
+ Common::sort(_sprites, _sprites + _numSprites, &compareSpritesByLayer);
// Update sprite rectangles
for (int i=0; i<_numSprites; i++) {
Commit: 2a588200ed4907d56c3927de0acc1fc59d22aa7d
https://github.com/scummvm/scummvm/commit/2a588200ed4907d56c3927de0acc1fc59d22aa7d
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Pathfinding
Changed paths:
A engines/startrek/iwfile.cpp
A engines/startrek/iwfile.h
engines/startrek/awaymission.cpp
engines/startrek/common.h
engines/startrek/module.mk
engines/startrek/object.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 77576d2..16ce842 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -20,6 +20,7 @@
*
*/
+#include "startrek/iwfile.h"
#include "startrek/startrek.h"
namespace StarTrek {
@@ -89,13 +90,13 @@ void StarTrekEngine::loadRoom(const Common::String &missionName, int roomIndex)
_awayMission.mapFileLoaded = 1;
_mapFilename = _screenName;
_mapFile = loadFile(_mapFilename + ".map");
- // loadIWFile(_mapFilename);
+ _iwFile = SharedPtr<IWFile>(new IWFile(this, _mapFilename + ".iw"));
objectFunc1();
initObjects();
- double num = _room->readRdfWord(0x0c) - _room->readRdfWord(0x0a);
- double den = _room->readRdfWord(0x06) - _room->readRdfWord(0x08) + 1;
+ double num = _room->getVar0c() - _room->getVar0a();
+ double den = _room->getVar06() - _room->getVar08() + 1;
_playerObjectScale = (int32)(num * 256 / den);
// TODO: RDF vars 1e/1f and 20/21; relates to BAN files?
@@ -239,6 +240,8 @@ void StarTrekEngine::runAwayMissionCycle() {
* when that position is solid.
*/
bool StarTrekEngine::isPositionSolid(int16 x, int16 y) {
+ assert(x >= 0 && x < SCREEN_WIDTH && y >= 0 && y < SCREEN_HEIGHT);
+
_mapFile->seek((y * SCREEN_WIDTH + x) / 8, SEEK_SET);
return _mapFile->readByte() & (0x80 >> (x % 8));
}
diff --git a/engines/startrek/common.h b/engines/startrek/common.h
index 4598085..c84b9c4 100644
--- a/engines/startrek/common.h
+++ b/engines/startrek/common.h
@@ -34,6 +34,10 @@ T max(T a, T b) { return a > b ? a : b; }
Common::Rect getRectEncompassing(Common::Rect r1, Common::Rect r2);
+
+// Fixed-point (16.16) number
+typedef int32 FixedInt;
+
}
#endif
diff --git a/engines/startrek/iwfile.cpp b/engines/startrek/iwfile.cpp
new file mode 100644
index 0000000..830cb78
--- /dev/null
+++ b/engines/startrek/iwfile.cpp
@@ -0,0 +1,82 @@
+
+/* 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 "startrek/iwfile.h"
+
+namespace StarTrek {
+
+IWFile::IWFile(StarTrekEngine *vm, const Common::String &filename) {
+ debug(6, "IW File: %s", filename.c_str());
+
+ _vm = vm;
+
+ SharedPtr<FileStream> file = _vm->loadFile(filename);
+ _numEntries = file->readUint16();
+
+ assert(_numEntries < MAX_KEY_POSITIONS);
+
+ for (int i = 0; i < MAX_KEY_POSITIONS; i++) {
+ int16 x = file->readUint16();
+ int16 y = file->readUint16();
+ _keyPositions[i] = Common::Point(x, y);
+ }
+
+ for (int i = 0; i < _numEntries; i++) {
+ file->read(_iwEntries[i], _numEntries);
+ }
+}
+
+// FIXME: same issue with sorting as with "compareSpritesByLayer" in graphics.cpp.
+bool iwSorter(const Common::Point &p1, const Common::Point &p2) {
+ return p1.y < p2.y;
+}
+
+/**
+ * Returns the index of the nearest "key position" in the room that an object can walk to
+ * (in a straight line) from a given position.
+ */
+int IWFile::getClosestKeyPosition(int16 x, int16 y) {
+ // This is a sorted list of indices from 0 to _numEntries-1.
+ // The index is stored in Point.x, and the "cost" (distance from position) is stored
+ // in Point.y for sorting purposes.
+ Common::Point sortedIndices[MAX_KEY_POSITIONS];
+
+ for (int i = 0; i < _numEntries; i++) {
+ sortedIndices[i].x = i;
+ sortedIndices[i].y = sqrt(_keyPositions[i].sqrDist(Common::Point(x, y)));
+ }
+
+ sort(sortedIndices, sortedIndices + _numEntries, &iwSorter);
+
+ // Iterate through positions from closest to furthest
+ for (int i = 0; i < _numEntries; i++) {
+ int index = sortedIndices[i].x;
+ Common::Point dest = _keyPositions[index];
+ if (_vm->directPathExists(x, y, dest.x, dest.y))
+ return index;
+ }
+
+ return -1;
+}
+
+}
diff --git a/engines/startrek/iwfile.h b/engines/startrek/iwfile.h
new file mode 100644
index 0000000..ffc5467
--- /dev/null
+++ b/engines/startrek/iwfile.h
@@ -0,0 +1,59 @@
+
+/* 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.
+ *
+ */
+
+#ifndef STARTREK_IWFILE_H
+#define STARTREK_IWFILE_H
+
+#include "startrek/startrek.h"
+
+/**
+ * Files with the ".iw" extension define a set of "key points" through a room used for
+ * pathing. This is a basic interface for that.
+ */
+namespace StarTrek {
+
+const int MAX_KEY_POSITIONS = 32;
+
+class IWFile {
+public:
+ IWFile(StarTrekEngine *vm, const Common::String &filename);
+
+ int getNumEntries() { return _numEntries; }
+ int getClosestKeyPosition(int16 x, int16 y);
+
+ ///< List of "key positions" used for pathing.
+ Common::Point _keyPositions[MAX_KEY_POSITIONS];
+
+ ///< _iwEntries[i][j] is the index of the next key position to move to, when one is
+ /// already at key position "i" and is trying to get to key position "j".
+ byte _iwEntries[MAX_KEY_POSITIONS][MAX_KEY_POSITIONS];
+
+private:
+ StarTrekEngine *_vm;
+
+ uint16 _numEntries;
+};
+
+}
+
+#endif
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index b79126a..04f2c7c 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -8,6 +8,7 @@ MODULE_OBJS = \
events.o \
filestream.o \
font.o \
+ iwfile.o \
lzss.o \
graphics.o \
object.o \
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index d1cd8fb..eb0f3da 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -23,6 +23,7 @@
#ifndef STARTREK_OBJECT_H
#define STARTREK_OBJECT_H
+#include "startrek/common.h"
#include "startrek/sprite.h"
#include "common/scummsys.h"
@@ -58,12 +59,12 @@ struct Object {
int16 iwDestPosition;
// Fixed-point position values (16.16) used while walking.
- uint32 granularPosX;
- uint32 granularPosY;
+ FixedInt granularPosX;
+ FixedInt granularPosY;
// Fixed-point speed values (16.16).
- uint32 speedX;
- uint32 speedY;
+ FixedInt speedX;
+ FixedInt speedY;
Common::Point dest; // Position object is walking toward
uint16 field90;
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 9cafd44..15c991e 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -34,6 +34,7 @@
#include "video/qt_decoder.h"
#include "startrek/filestream.h"
+#include "startrek/iwfile.h"
#include "startrek/lzss.h"
#include "startrek/startrek.h"
@@ -412,10 +413,32 @@ bool StarTrekEngine::objectWalkToPosition(int objectIndex, const Common::String
object->iwDestPosition = -1;
object->iwSrcPosition = -1;
- // TODO: if (directPathExists(srcX, srcY, destX, destY)) {
+ if (directPathExists(srcX, srcY, destX, destY)) {
+ chooseObjectDirectionForWalking(object, srcX, srcY, destX, destY);
+ updateObjectPositionWhileWalking(object, (object->granularPosX + 0x8000) >> 16, (object->granularPosY + 0x8000) >> 16);
+ return true;
+ }
+ else {
+ object->iwSrcPosition = _iwFile->getClosestKeyPosition(srcX, srcY);
+ object->iwDestPosition = _iwFile->getClosestKeyPosition(destX, destY);
+
+ if (object->iwSrcPosition == -1 || object->iwDestPosition == -1) {
+ // No path exists; face south by default.
+ strcat(object->animationString2, "S");
+ object->direction = 'S';
- chooseObjectDirectionForWalking(object, srcX, srcY, destX, destY);
- updateObjectPositionWhileWalking(object, (object->granularPosX + 0x8000) >> 16, (object->granularPosY + 0x8000) >> 16);
+ updateObjectPositionWhileWalking(object, srcX, srcY);
+ initStandAnim(objectIndex);
+
+ return false;
+ }
+ else {
+ Common::Point iwSrc = _iwFile->_keyPositions[object->iwSrcPosition];
+ chooseObjectDirectionForWalking(object, srcX, srcY, iwSrc.x, iwSrc.y);
+ updateObjectPositionWhileWalking(object, (object->granularPosX + 0x8000) >> 16, (object->granularPosY + 0x8000) >> 16);
+ return true;
+ }
+ }
}
void StarTrekEngine::updateObjectAnimations() {
@@ -432,8 +455,6 @@ void StarTrekEngine::updateObjectAnimations() {
object->animFile->seek(18 + nextAnimIndex + object->animFrame * 22, SEEK_SET);
byte nextAnimFrame = object->animFile->readByte();
- debugC(7, kDebugGraphics, "Object %d animation frame %d", i, nextAnimFrame);
-
if (object->animFrame != nextAnimFrame) {
if (nextAnimFrame == object->numAnimFrames - 1) {
object->field62++;
@@ -511,7 +532,7 @@ void StarTrekEngine::updateObjectAnimations() {
if (object->iwSrcPosition == -1) {
if (object->field64 != 0) {
object->field64 = 0;
- //addCommand(COMMAND_12, object->field66 & 0xff, 0, 0);
+ //addCommand(COMMAND_12, object->field66 & 0xff, 0, 0); // TODO
}
object->sprite.bitmap.reset();
@@ -523,10 +544,14 @@ void StarTrekEngine::updateObjectAnimations() {
object->animationString2[strlen(object->animationString2) - 1] = '\0';
object->iwDestPosition = -1;
object->iwSrcPosition = -1;
- // sub_11677(object->pos.x, object->pos.y, object->dest.x, object->dest.y);
+ chooseObjectDirectionForWalking(object, object->pos.x, object->pos.y, object->dest.x, object->dest.y);
}
else {
-
+ int index = _iwFile->_iwEntries[object->iwSrcPosition][object->iwDestPosition];
+ object->iwSrcPosition = index;
+ Common::Point dest = _iwFile->_keyPositions[object->iwSrcPosition];
+ object->animationString2[strlen(object->animationString2) - 1] = '\0';
+ chooseObjectDirectionForWalking(object, object->pos.x, object->pos.y, dest.x, dest.y);
}
}
}
@@ -618,8 +643,8 @@ void StarTrekEngine::releaseAnim(Object *object) {
object->sprite.bitmap.reset();
object->animFile.reset();
break;
- case 1: // TODO
- warning("Unimplemented anim type %d", object->animType);
+ case 1:
+ object->sprite.bitmap.reset();
break;
default:
error("Invalid anim type");
@@ -740,6 +765,67 @@ void StarTrekEngine::chooseObjectDirectionForWalking(Object *object, int16 srcX,
}
}
+/**
+ * Returns true if an object can walk directly from a source position to a destination
+ * position without running into unwalkable terrain.
+ */
+bool StarTrekEngine::directPathExists(int16 srcX, int16 srcY, int16 destX, int16 destY) {
+ int32 distX = destX - srcX;
+ int32 distY = destY - srcY;
+
+ int32 absDistX = abs(distX);
+ int32 absDistY = abs(distY);
+
+ int32 distCounter;
+ FixedInt speedX, speedY;
+
+ if (absDistX > absDistY) {
+ distCounter = absDistX;
+
+ if (distCounter == 0)
+ return true;
+
+ speedY = (distY << 16) / absDistX;
+
+ if (distX > 0)
+ speedX = 1 << 16;
+ else
+ speedX = -1 << 16;
+ }
+ else { // absDistX <= absDistY
+ distCounter = absDistY;
+
+ if (distCounter == 0)
+ return true;
+
+ speedX = (distX << 16) / absDistY;
+
+ if (distY > 0)
+ speedY = 1 << 16;
+ else
+ speedY = -1 << 16;
+ }
+
+ FixedInt fixedX = srcX << 16;
+ FixedInt fixedY = srcY << 16;
+
+ if (isPositionSolid((fixedX + 0x8000) >> 16, (fixedY + 0x8000) >> 16))
+ return false;
+
+ while (distCounter-- > 0) {
+ fixedX += speedX;
+ fixedY += speedY;
+
+ if (isPositionSolid((fixedX + 0x8000) >> 16, (fixedY + 0x8000) >> 16))
+ return false;
+ }
+
+ return true;
+}
+
+/**
+ * Loads a bitmap for the animation frame with the given scale.
+ */
SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filename, uint16 scale) {
SharedPtr<Bitmap> bitmapToReturn;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 68a9d51..0c3273f 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -114,6 +114,7 @@ const int MAX_OBJECTS = 0x20;
struct StarTrekGameDescription;
class Graphics;
+class IWFile;
class Sound;
class StarTrekEngine : public ::Engine {
@@ -165,6 +166,7 @@ public:
void initStandAnim(int objectIndex);
void updateObjectPositionWhileWalking(Object *object, int16 x, int16 y);
void chooseObjectDirectionForWalking(Object *object, int16 srcX, int16 srcY, int16 destX, int16 destY);
+ bool directPathExists(int16 srcX, int16 srcY, int16 destX, int16 destY);
SharedPtr<Bitmap> loadAnimationFrame(const Common::String &filename, uint16 arg2);
Common::String getCrewmanAnimFilename(int objectIndex, const Common::String &basename);
@@ -270,6 +272,7 @@ public:
private:
Common::MacResManager *_macResFork;
Room *_room;
+ SharedPtr<IWFile> _iwFile;
};
} // End of namespace StarTrek
Commit: be8e807a4bbf28959e6e07b505d27b8ae622e0ef
https://github.com/scummvm/scummvm/commit/be8e807a4bbf28959e6e07b505d27b8ae622e0ef
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Warps between rooms
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/events.cpp
engines/startrek/object.h
engines/startrek/room.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 16ce842..efa603d 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -51,7 +51,7 @@ void StarTrekEngine::runAwayMission() {
if (!_commandQueue.empty()) {
// sub_200e7();
// sub_20118();
- runAwayMissionCycle();
+ handleAwayMissionCommand();
}
}
}
@@ -61,16 +61,13 @@ void StarTrekEngine::cleanupAwayMission() {
}
void StarTrekEngine::loadRoom(const Common::String &missionName, int roomIndex) {
- if (_room != nullptr)
- delete _room;
-
_keyboardControlsMouse = true;
_missionName = _missionToLoad;
- _roomIndex = _roomIndexToLoad;
+ _roomIndex = roomIndex;
_roomFrameCounter = 0;
- _awayMission.field1d = 0;
+ _awayMission.transitioningIntoRoom = 0;
_gfx->fadeoutScreen();
_sound->stopAllVocSounds();
@@ -82,7 +79,7 @@ void StarTrekEngine::loadRoom(const Common::String &missionName, int roomIndex)
_gfx->loadPalette("palette");
_gfx->copyBackgroundScreen();
- _room = new Room(this, _screenName);
+ _room = SharedPtr<Room>(new Room(this, _screenName));
// Original sets up bytes 0-3 of rdf file as "remote function caller"
@@ -110,13 +107,27 @@ void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) {
memset(_awayMission.field25, 0xff, 4);
switch (warpEntryIndex) {
- case 0:
- break;
+ case 0: // 0-3: Read warp positions from RDF file
case 1:
- break;
case 2:
- break;
case 3:
+ for (int i = 0; i < (_awayMission.redshirtDead ? 3 : 4); i++) {
+ Common::String anim = getCrewmanAnimFilename(i, "walk");
+
+ int16 rdfOffset = RDF_ROOM_ENTRY_POSITIONS + warpEntryIndex * 32 + i * 8;
+
+ int16 srcX = _room->readRdfWord(rdfOffset + 0); // Position to spawn at
+ int16 srcY = _room->readRdfWord(rdfOffset + 2);
+ int16 destX = _room->readRdfWord(rdfOffset + 4); // Position to walk to
+ int16 destY = _room->readRdfWord(rdfOffset + 6);
+
+ objectWalkToPosition(i, anim, srcX, srcY, destX, destY);
+ }
+
+ _kirkObject->walkingIntoRoom = 1;
+ _kirkObject->field66 = 0xff;
+ _awayMission.transitioningIntoRoom = 1;
+ _warpHotspotsActive = false;
break;
case 4: // Crew is beaming in.
warpEntryIndex -= 4;
@@ -125,11 +136,11 @@ void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) {
Common::Point warpPos = _room->getBeamInPosition(i);
loadObjectAnimWithRoomScaling(i, animFilename, warpPos.x, warpPos.y);
}
- _kirkObject->field64 = 1;
+ _kirkObject->walkingIntoRoom = 1;
_kirkObject->field66 = 0xff;
- _awayMission.field1d = 1;
+ _awayMission.transitioningIntoRoom = 1;
playSoundEffectIndex(0x09);
- // word_466f2 = 0;
+ _warpHotspotsActive = false;
break;
case 5:
break;
@@ -154,13 +165,13 @@ void StarTrekEngine::handleAwayMissionEvents() {
// sub_22de0();
_frameIndex++;
_roomFrameCounter++;
- // sub_20099(0, _roomFrameCounter & 0xff, (_roomFrameCounter >> 8) & 0xff, 0);
+ addCommand(Command(COMMAND_TICK, _roomFrameCounter & 0xff, (_roomFrameCounter >> 8) & 0xff, 0));
if (_roomFrameCounter >= 2)
_gfx->incPaletteFadeLevel();
break;
case TREKEVENT_LBUTTONDOWN:
- //if (_awayMission.field1d != 0) // FIXME: uncomment
- // break;
+ if (_awayMission.transitioningIntoRoom != 0)
+ break;
switch (_awayMission.mapFileLoaded) {
case 1:
if (_awayMission.field1c == 0) {
@@ -204,6 +215,14 @@ void StarTrekEngine::handleAwayMissionEvents() {
}
}
+void StarTrekEngine::unloadRoom() {
+ _gfx->fadeoutScreen();
+ // sub_2394b(); // TODO
+ objectFunc1();
+ _room.reset();
+ _mapFile.reset();
+}
+
/**
* Similar to loadObjectAnim, but scale is determined by the y-position in the room. The
* further up (away) the object is, the smaller it is.
@@ -226,12 +245,108 @@ uint16 StarTrekEngine::getObjectScaleAtPosition(int16 y) {
return ((_playerObjectScale * (y - var08)) >> 8) + var0a;
}
-Room *StarTrekEngine::getRoom() {
+SharedPtr<Room> StarTrekEngine::getRoom() {
return _room;
}
-void StarTrekEngine::runAwayMissionCycle() {
- // TODO
+void StarTrekEngine::addCommand(const Command &command) {
+ if (command.type != COMMAND_TICK)
+ debug("Command %d: %x, %x, %x", command.type, command.b1, command.b2, command.b3);
+ _commandQueue.push(command);
+}
+
+void StarTrekEngine::handleAwayMissionCommand() {
+ Command command = _commandQueue.pop();
+
+ if ((command.type == COMMAND_FINISHED_BEAMING_IN || command.type == FINISHED_ENTERING_ROOM) && command.b1 == 0xff) {
+ _awayMission.transitioningIntoRoom = 0;
+ _warpHotspotsActive = true;
+ return;
+ }
+ else if (command.type == FINISHED_ENTERING_ROOM && command.b1 >= 0xe0) { // TODO
+ return;
+ }
+
+ switch (command.type) { // TODO: everything
+ case COMMAND_TOUCHED_WARP:
+ // if (!sub_203e1(command.type)) // Probably calls RDF code
+ {
+ byte warpIndex = command.b1;
+ int16 roomIndex = _room->readRdfWord(RDF_WARP_ROOM_INDICES + warpIndex * 2);
+ unloadRoom();
+ _sound->loadMusicFile("ground");
+ loadRoom(_missionName, roomIndex);
+ initAwayCrewPositions(warpIndex ^ 1);
+ }
+ break;
+ }
+}
+
+/**
+ * Returns true if the given position is contained in a polygon?
+ *
+ * The data passed contains the following words in this order:
+ * * Index of polygon (unused here)
+ * * Number of vertices in polygon
+ * * For each vertex: x and y coordinates.
+ */
+bool StarTrekEngine::isPointInPolygon(int16 *data, int16 x, int16 y) {
+ int16 numVertices = data[1];
+ int16 *vertData = &data[2];
+
+ for (int i = 0; i < numVertices; i++) {
+ Common::Point p1(vertData[0], vertData[1]);
+ Common::Point p2;
+ if (i == numVertices - 1) // Loop to 1st vertex
+ p2 = Common::Point(data[2], data[3]);
+ else
+ p2 = Common::Point(vertData[2], vertData[3]);
+
+ if ((p2.x - p1.x) * (y - p1.y) - (p2.y - p1.y) * (x - p1.x) < 0)
+ return false;
+
+ vertData += 2;
+ }
+
+ return true;
+}
+
+void StarTrekEngine::checkTouchedLoadingZone(int16 x, int16 y) {
+ int16 offset = _room->getFirstDoorPolygonOffset();
+
+ while (offset != _room->getDoorPolygonEndOffset()) {
+ if (isPointInPolygon((int16*)(_room->_rdfData + offset), x, y)) {
+ uint16 var = _room->readRdfWord(offset);
+ if (_activeDoorWarpHotspot != var) {
+ _activeDoorWarpHotspot = var;
+ addCommand(Command(COMMAND_7, var & 0xff, 0, 0));
+ }
+ return;
+ }
+
+ int16 numVertices = _room->readRdfWord(offset + 2);
+ offset += numVertices * 4 + 4;
+ }
+ _activeDoorWarpHotspot = -1;
+
+ if (_awayMission.field24 == 0 && _warpHotspotsActive) {
+ offset = _room->getFirstWarpPolygonOffset();
+
+ while (offset != _room->getWarpPolygonEndOffset()) {
+ if (isPointInPolygon((int16*)(_room->_rdfData + offset), x, y)) {
+ uint16 var = _room->readRdfWord(offset);
+ if (_activeWarpHotspot != var) {
+ _activeWarpHotspot = var;
+ addCommand(Command(COMMAND_TOUCHED_WARP, var & 0xff, 0, 0));
+ }
+ return;
+ }
+
+ int16 numVertices = _room->readRdfWord(offset + 2);
+ offset += numVertices * 4 + 4;
+ }
+ }
+ _activeWarpHotspot = -1;
}
/**
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index f2a9ca6..2036b60 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -28,9 +28,10 @@ struct AwayMission {
int16 mouseX;
int16 mouseY;
byte field1c;
- byte field1d; // Set while beaming in?
+ byte transitioningIntoRoom; // Set while beaming in or walking into a room
bool redshirtDead;
byte mapFileLoaded;
+ byte field24;
int8 field25[4];
bool rdfRunNextCommand;
diff --git a/engines/startrek/events.cpp b/engines/startrek/events.cpp
index 354dfb1..f36ce6a 100644
--- a/engines/startrek/events.cpp
+++ b/engines/startrek/events.cpp
@@ -41,6 +41,8 @@ void StarTrekEngine::pollSystemEvents() {
addEventToQueue(trekEvent);
break;
case Common::EVENT_LBUTTONDOWN:
+ // TODO: what happens when mouse click is outside normal screen bounds?
+ // (apparently this can happen)
trekEvent.type = TREKEVENT_LBUTTONDOWN;
addEventToQueue(trekEvent);
break;
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index eb0f3da..cdcae74 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -48,7 +48,7 @@ struct Object {
Common::Point pos;
uint16 field60;
uint16 field62;
- uint16 field64;
+ uint16 walkingIntoRoom; // Walking or beaming into a room?
uint16 field66;
char animationString2[8];
uint16 field70;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index a06d2af..e9bbbd0 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -34,6 +34,12 @@ namespace StarTrek {
class StarTrekEngine;
+// Offsets of data in RDF files
+
+const int RDF_WARP_ROOM_INDICES = 0x22;
+const int RDF_ROOM_ENTRY_POSITIONS = 0x2a;
+const int RDF_BEAM_IN_POSITIONS = 0xaa;
+
class Room {
public:
@@ -49,6 +55,12 @@ public:
int16 getVar0a() { return readRdfWord(0x0a); }
int16 getVar0c() { return readRdfWord(0x0c); }
+ // Warp-related stuff
+ int16 getFirstWarpPolygonOffset() { return readRdfWord(0x16); }
+ int16 getWarpPolygonEndOffset() { return readRdfWord(0x18); }
+ int16 getFirstDoorPolygonOffset() { return readRdfWord(0x1a); }
+ int16 getDoorPolygonEndOffset() { return readRdfWord(0x1c); }
+
Common::Point getBeamInPosition(int crewmanIndex);
byte *_rdfData;
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 15c991e..82fe2e1 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -54,7 +54,6 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_gfx = nullptr;
_sound = nullptr;
_macResFork = nullptr;
- _room = nullptr;
_clockTicks = 0;
@@ -78,8 +77,6 @@ StarTrekEngine::~StarTrekEngine() {
delete _gfx;
delete _sound;
delete _macResFork;
-
- delete _room;
}
Common::Error StarTrekEngine::run() {
@@ -103,26 +100,6 @@ Common::Error StarTrekEngine::run() {
runGameMode(GAMEMODE_AWAYMISSION);
return Common::kNoError;
-
-
-#if 1
- _room = new Room(this, "DEMON0");
- _gfx->loadPalette("PALETTE");
- _gfx->loadPri("DEMON0.PRI");
-
- _sound->loadMusicFile("GROUND");
-
-
- while (true) {
- _gfx->showOptionsMenu(0, 0);
- }
-
- while (!shouldQuit()) {
- pollSystemEvents();
- }
-
- return Common::kNoError;
-#endif
}
Common::Error StarTrekEngine::runGameMode(int mode) {
@@ -298,10 +275,10 @@ void StarTrekEngine::playSoundEffectIndex(int index) {
case 0x08:
_sound->playVoc("TRANSDEM");
break;
- case 0x09:
+ case 0x09: // Beaming in?
_sound->playVoc("TRANSMAT");
break;
- case 0x0a:
+ case 0x0a: // Beaming out?
_sound->playVoc("TRANSENE");
break;
case 0x10: // Menu selection sound
@@ -376,7 +353,7 @@ int StarTrekEngine::loadObjectAnim(int objectIndex, const Common::String &animNa
drawObjectToScreen(object, animName, x, y, scale, true);
}
- object->field64 = 0;
+ object->walkingIntoRoom = 0;
object->field66 = 0;
return objectIndex;
@@ -391,7 +368,7 @@ bool StarTrekEngine::objectWalkToPosition(int objectIndex, const Common::String
Object *object = &_objectList[objectIndex];
- object->field64 = 0;
+ object->walkingIntoRoom = 0;
if (isPositionSolid(destX, destY))
return false;
@@ -408,7 +385,7 @@ bool StarTrekEngine::objectWalkToPosition(int objectIndex, const Common::String
object->dest.x = destX;
object->dest.y = destY;
object->field92 = 0;
- object->field64 = 0;
+ object->walkingIntoRoom = 0;
object->iwDestPosition = -1;
object->iwSrcPosition = -1;
@@ -458,8 +435,8 @@ void StarTrekEngine::updateObjectAnimations() {
if (object->animFrame != nextAnimFrame) {
if (nextAnimFrame == object->numAnimFrames - 1) {
object->field62++;
- if (object->field64 != 0) {
- // sub_20099(10, object->field66, 0, 0);
+ if (object->walkingIntoRoom != 0) {
+ addCommand(Command(COMMAND_FINISHED_BEAMING_IN, object->field66, 0, 0));
}
}
}
@@ -500,10 +477,8 @@ void StarTrekEngine::updateObjectAnimations() {
case 1: // Walking
if (_frameIndex < object->frameToStartNextAnim)
break;
- /*
- if (i == 0) // TODO: Kirk only
- sub_22c2d(object->pos.x, object->pos.y);
- */
+ if (i == 0) // Kirk only
+ checkTouchedLoadingZone(object->pos.x, object->pos.y);
if (object->field90 != 0) {
Sprite *sprite = &object->sprite;
int loops;
@@ -530,9 +505,9 @@ void StarTrekEngine::updateObjectAnimations() {
}
else { // object->field90 == 0
if (object->iwSrcPosition == -1) {
- if (object->field64 != 0) {
- object->field64 = 0;
- //addCommand(COMMAND_12, object->field66 & 0xff, 0, 0); // TODO
+ if (object->walkingIntoRoom != 0) {
+ object->walkingIntoRoom = 0;
+ addCommand(Command(FINISHED_ENTERING_ROOM, object->field66 & 0xff, 0, 0));
}
object->sprite.bitmap.reset();
@@ -1287,7 +1262,7 @@ void StarTrekEngine::playMovieMac(Common::String filename) {
delete qtDecoder;
// Swap back to 8bpp mode
- initGraphics(320, 200);
+ initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT);
}
} // End of namespace StarTrek
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 0c3273f..7560efa 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -100,14 +100,20 @@ struct TrekEvent {
enum Commands {
COMMAND_TICK = 0,
COMMAND_CLICKED_ON_OBJECT = 1,
- COMMAND_12 = 12
+ COMMAND_TOUCHED_WARP = 6,
+ COMMAND_7 = 7, // Doors? (Or just hotspots activated by Kirk moving there?)
+ COMMAND_FINISHED_BEAMING_IN = 10,
+ FINISHED_ENTERING_ROOM = 12
};
struct Command {
byte type;
- byte b1; // These depend on command type?
+ byte b1;
byte b2;
byte b3;
+
+ Command(byte _type, byte _b1, byte _b2, byte _b3)
+ : type(_type), b1(_b1), b2(_b2), b3(_b3) {}
};
const int MAX_OBJECTS = 0x20;
@@ -132,14 +138,18 @@ private:
void loadRoom(const Common::String &missionName, int roomIndex);
void initAwayCrewPositions(int warpEntryIndex);
void handleAwayMissionEvents();
+ void unloadRoom();
int loadObjectAnimWithRoomScaling(int objectIndex, const Common::String &animName, int16 x, int16 y);
uint16 getObjectScaleAtPosition(int16 y);
- void runAwayMissionCycle();
+ void addCommand(const Command &command);
+ void handleAwayMissionCommand();
+ bool isPointInPolygon(int16 *data, int16 x, int16 y);
+ void checkTouchedLoadingZone(int16 x, int16 y);
bool isPositionSolid(int16 x, int16 y);
public:
- Room *getRoom();
+ SharedPtr<Room> getRoom();
private:
// Transporter room
@@ -232,6 +242,9 @@ public:
Common::Queue<Command> _commandQueue;
AwayMission _awayMission;
+ bool _warpHotspotsActive;
+ int16 _activeWarpHotspot;
+ int16 _activeDoorWarpHotspot;
Object _objectList[MAX_OBJECTS];
Object * const _kirkObject;
@@ -271,7 +284,7 @@ public:
private:
Common::MacResManager *_macResFork;
- Room *_room;
+ SharedPtr<Room> _room;
SharedPtr<IWFile> _iwFile;
};
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index ef5a746..945ff31 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -387,7 +387,7 @@ int Graphics::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4) {
* Text getter for showText which reads from an rdf file.
*/
String Graphics::readTextFromRdf(int choiceIndex, uintptr data, String *headerTextOutput) {
- Room *room = _vm->getRoom();
+ SharedPtr<Room> room = _vm->getRoom();
int rdfVar = (size_t)data;
Commit: 2731ae228795ca1a8d823f147212ef5c22261598
https://github.com/scummvm/scummvm/commit/2731ae228795ca1a8d823f147212ef5c22261598
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Refactor text and menus
Moved them out of the Graphics class and into their own files.
Changed paths:
A engines/startrek/menu.cpp
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/module.mk
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 2504534..ec3c4d0 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -46,10 +46,6 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_font = new Font(_vm);
_numSprites = 0;
- _textDisplayMode = TEXTDISPLAY_WAIT;
- _textboxVar2 = 0;
- _textboxVar6 = 0;
- _textboxHasMultipleChoices = false;
_palData = new byte[256 * 3];
_lutData = new byte[256 * 3];
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index f7d9402..0a737f7 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -44,25 +44,6 @@ const int SCREEN_WIDTH = 320;
const int SCREEN_HEIGHT = 200;
const int MAX_SPRITES = 32;
-const int MAX_MENUBUTTONS = 32;
-
-const int TEXTBOX_WIDTH = 26;
-const int MAX_TEXTBOX_LINES = 12;
-
-
-// Keeps track of data for a list of buttons making up a menu
-struct Menu {
- Sprite sprites[MAX_MENUBUTTONS];
- uint16 retvals[MAX_MENUBUTTONS];
- uint32 disabledButtons;
- SharedPtr<FileStream> menuFile;
- uint16 numButtons;
- int16 selectedButton;
- SharedPtr<Menu> nextMenu;
-};
-
-class Graphics;
-typedef String (Graphics::*TextGetterFunc)(int, uintptr, String *);
class Graphics {
@@ -119,65 +100,8 @@ private:
Sprite *_sprites[MAX_SPRITES];
int _numSprites;
- SharedPtr<Bitmap> _mouseBitmap;
-
-
- // text.cpp (TODO: separate class)
public:
- int showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, int arg10);
-
- String readTextFromRdf(int choiceIndex, uintptr data, String *headerTextOutput);
- String readTextFromBuffer(int choiceIndex, uintptr data, String *headerTextOutput);
- String readTextFromArray(int choiceIndex, uintptr data, String *headerTextOutput);
-
-private:
- int handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4);
-
- SharedPtr<TextBitmap> initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite);
- void drawMainText(SharedPtr<TextBitmap> bitmap, int numTextLines, int numTextboxLines, const String &text, bool withHeader);
-
- int getNumLines(const String &str);
- void getTextboxHeader(String *headerTextOutput, String speakerText, int choiceIndex);
-
- String readLineFormattedText(TextGetterFunc textGetter, uintptr var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numLines);
- String putTextIntoLines(const String &text);
- const char *getNextTextLine(const char *text, char *line, int lineWidth);
-
- String skipTextAudioPrompt(const String &str);
- String playTextAudio(const String &str);
-
- int getMenuButtonAt(const Menu &menu, int x, int y);
- void drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color);
- void loadMenuButtons(String mnuFilename, int xpos, int ypos);
- void unloadMenuButtons();
- void disableMenuButtons(uint32 bits);
- void enableMenuButtons(uint32 bits);
- void setVisibleMenuButtons(uint32 bits);
-
-public:
- void choseMousePositionFromSprites(Sprite *sprites, int numSprites, int spriteIndex, int mode);
- void showOptionsMenu(int x, int y);
- void showSaveMenu();
- void showLoadMenu();
- void showQuitGamePrompt(int x, int y);
- void showTextConfigurationMenu(bool fromOptionMenu);
-
- int loadTextDisplayMode();
- void saveTextDisplayMode(int value);
-
-private:
- int16 _textDisplayMode;
-
-public:
- uint32 _textboxVar2;
- uint16 _textboxVar6;
- bool _textboxHasMultipleChoices;
-
-private:
- SharedPtr<Menu> _activeMenu;
-
- // Saved value of StarTrekEngine::_keyboardControlsMouse when menus are up
- bool _keyboardControlsMouseOutsideMenu;
+ SharedPtr<Bitmap> _mouseBitmap;
};
}
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
new file mode 100644
index 0000000..f10e784
--- /dev/null
+++ b/engines/startrek/menu.cpp
@@ -0,0 +1,569 @@
+/* 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 "common/events.h"
+#include "common/stream.h"
+#include "graphics/cursorman.h"
+
+#include "startrek/graphics.h"
+
+namespace StarTrek {
+
+/**
+ * Returns the index of the button at the given position, or -1 if none.
+ */
+int StarTrekEngine::getMenuButtonAt(const Menu &menu, int x, int y) {
+ for (int i = 0; i < menu.numButtons; i++) {
+ const Sprite &spr = menu.sprites[i];
+
+ if (spr.drawMode != 2)
+ continue;
+
+ int left = spr.pos.x - spr.bitmap->xoffset;
+ int top = spr.pos.y - spr.bitmap->yoffset;
+
+ // Oddly, this doesn't account for x/yoffset...
+ int right = spr.pos.x + spr.bitmap->width - 1;
+ int bottom = spr.pos.y + spr.bitmap->height - 1;
+
+ if (x >= left && x <= right && y >= top && y <= bottom)
+ return i;
+ }
+
+ return -1;
+}
+
+/**
+ * This chooses a sprite from the list to place the mouse cursor at. The sprite it chooses
+ * may be, for example, the top-leftmost one in the list. Exact behaviour is determined by
+ * the "mode" parameter.
+ *
+ * If "containMouseSprite" is a valid index, it's ensured that the mouse is contained
+ * within it. "mode" should be -1 in this case.
+ */
+void StarTrekEngine::chooseMousePositionFromSprites(Sprite *sprites, int numSprites, int containMouseSprite, int mode) {
+ uint16 mouseX1 = 0x7fff; // Candidate positions to warp mouse to
+ uint16 mouseY1 = 0x7fff;
+ uint16 mouseX2 = 0x7fff;
+ uint16 mouseY2 = 0x7fff;
+
+ Common::Point mousePos = _gfx->getMousePos();
+
+ // Ensure the cursor is contained within one of the sprites
+ if (containMouseSprite >= 0 && containMouseSprite < numSprites) {
+ Common::Rect rect = sprites[containMouseSprite].getRect();
+
+ if (mousePos.x < rect.left || mousePos.x >= rect.right
+ || mousePos.y < rect.top || mousePos.y >= rect.bottom) {
+ mousePos.x = (rect.left + rect.right) / 2;
+ mousePos.y = (rect.top + rect.bottom) / 2;
+ }
+ }
+
+ // Choose a sprite to warp the cursor to
+ for (int i = 0; i < numSprites; i++) {
+ Sprite *sprite = &sprites[i];
+ if (sprite->drawMode != 2) // Skip hidden buttons
+ continue;
+
+ Common::Rect rect = sprite->getRect();
+
+ int hCenter = (rect.left + rect.right) / 2;
+ int vCenter = (rect.top + rect.bottom) / 2;
+
+ // Choose which sprite is closest based on certain criteria?
+ switch(mode) {
+ case 0: // Choose topmost, leftmost sprite that's below the cursor
+ if (((vCenter == mousePos.y && hCenter > mousePos.x) || vCenter > mousePos.y)
+ && (vCenter < mouseY1 || (vCenter == mouseY1 && hCenter < mouseX1))) {
+ mouseX1 = hCenter;
+ mouseY1 = vCenter;
+ }
+ // fall through
+
+ case 4: // Choose topmost, leftmost sprite
+ if (vCenter < mouseY2 || (vCenter == mouseY2 && hCenter < mouseX2)) {
+ mouseX2 = hCenter;
+ mouseY2 = vCenter;
+ }
+ break;
+
+ case 1: // Choose bottommost, rightmost sprite that's above the cursor
+ if (((vCenter == mousePos.y && hCenter < mousePos.x) || vCenter < mousePos.y)
+ && (mouseY1 == 0x7fff || vCenter > mouseY1
+ || (vCenter == mouseY1 && hCenter > mouseX1))) {
+ mouseX1 = hCenter;
+ mouseY1 = vCenter;
+ }
+ // fall through
+
+ case 5: // Choose bottommost, rightmost sprite
+ if (mouseY2 == 0x7fff || vCenter > mouseY2
+ || (vCenter == mouseY2 && hCenter > mouseX2)) {
+ mouseX2 = hCenter;
+ mouseY2 = vCenter;
+ }
+ break;
+
+ case 2:
+ // This seems broken... OR condition on first line has no affect on the logic...
+ if ((vCenter < mousePos.y || (vCenter == mouseY1 && hCenter == mousePos.x))
+ && (mouseX1 == 0x7fff || vCenter >= mouseY1)) {
+ mouseX1 = hCenter;
+ mouseY1 = vCenter;
+ debug("Try %d %d", mouseX1, mouseY1);
+ }
+ if (mouseX2 == 0x7fff || vCenter > mouseY2
+ || (hCenter == mouseX2 && vCenter == mouseY2)) {
+ mouseX2 = hCenter;
+ mouseY2 = vCenter;
+ }
+ break;
+
+ case 3:
+ // Similar to above...
+ if ((vCenter > mousePos.y || (vCenter == mouseY1 && hCenter == mousePos.x))
+ && (mouseX1 == 0x7fff || vCenter <= mouseY1)) {
+ mouseX1 = hCenter;
+ mouseY1 = vCenter;
+ }
+ if (mouseX2 == 0x7fff || vCenter < mouseY2
+ || (hCenter == mouseX2 && vCenter == mouseY2)) {
+ mouseX2 = hCenter;
+ mouseY2 = vCenter;
+ }
+ break;
+ }
+ }
+
+ // Warp mouse to one of the coordinates, if one is valid
+ if (mouseX1 != 0x7fff) {
+ mousePos.x = mouseX1;
+ mousePos.y = mouseY1;
+ }
+ else if (mouseX2 != 0x7fff) {
+ mousePos.x = mouseX2;
+ mousePos.y = mouseY2;
+ }
+
+ _system->warpMouse(mousePos.x, mousePos.y);
+
+}
+
+/**
+ * Draws or removes the outline on menu buttons when the cursor hovers on them, or leaves
+ * them.
+ */
+void StarTrekEngine::drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color) {
+ int lineWidth = bitmap->width-2;
+ int offsetToBottom = (bitmap->height-3)*bitmap->width;
+
+ byte *dest = bitmap->pixels + bitmap->width + 1;
+
+ while (lineWidth--) {
+ *dest = color;
+ *(dest+offsetToBottom) = color;
+ dest++;
+ }
+
+ int lineHeight = bitmap->height - 2;
+ int offsetToRight = bitmap->width - 3;
+
+ dest = bitmap->pixels + bitmap->width + 1;
+
+ while (lineHeight--) {
+ *dest = color;
+ *(dest+offsetToRight) = color;
+ dest += bitmap->width;
+ }
+}
+
+void StarTrekEngine::showOptionsMenu(int x, int y) {
+ bool tmpMouseControllingShip = _mouseControllingShip;
+ _mouseControllingShip = false;
+
+ Common::Point oldMousePos = _gfx->getMousePos();
+ SharedPtr<Bitmap> oldMouseBitmap = _gfx->_mouseBitmap;
+
+ _gfx->setMouseCursor(_gfx->loadBitmap("options"));
+ loadMenuButtons("options", x, y);
+
+ uint32 disabledButtons = 0;
+ if (_musicWorking) {
+ if (_musicEnabled)
+ disabledButtons |= (1 << OPTIONBUTTON_ENABLEMUSIC);
+ else
+ disabledButtons |= (1 << OPTIONBUTTON_DISABLEMUSIC);
+ }
+ else
+ disabledButtons |= (1 << OPTIONBUTTON_ENABLEMUSIC) | (1 << OPTIONBUTTON_DISABLEMUSIC);
+
+ if (_sfxWorking) {
+ if (_sfxEnabled)
+ disabledButtons |= (1 << OPTIONBUTTON_ENABLESFX);
+ else
+ disabledButtons |= (1 << OPTIONBUTTON_DISABLESFX);
+ }
+ else
+ disabledButtons |= (1 << OPTIONBUTTON_ENABLESFX) | (1 << OPTIONBUTTON_DISABLESFX);
+
+ disableMenuButtons(disabledButtons);
+ chooseMousePositionFromSprites(_activeMenu->sprites, _activeMenu->numButtons, -1, 4);
+ int event = handleMenuEvents(0, false);
+
+ unloadMenuButtons();
+ _mouseControllingShip = tmpMouseControllingShip;
+ _gfx->setMouseCursor(oldMouseBitmap);
+
+ if (event != MENUEVENT_LCLICK_OFFBUTTON && event != MENUEVENT_RCLICK_OFFBUTTON)
+ _system->warpMouse(oldMousePos.x, oldMousePos.y);
+
+
+ // Can't use OPTIONBUTTON constants since the button retvals differ from the button
+ // indices...
+ switch(event) {
+ case 0: // Save
+ showSaveMenu();
+ break;
+ case 1: // Load
+ showLoadMenu();
+ break;
+ case 2: // Enable music
+ _sound->setMusicEnabled(true);
+ break;
+ case 3: // Disable music
+ _sound->setMusicEnabled(false);
+ break;
+ case 4: // Enable sfx
+ _sound->setSfxEnabled(true);
+ break;
+ case 5: // Disable sfx
+ _sound->setSfxEnabled(false);
+ break;
+ case 6: // Quit
+ showQuitGamePrompt(20, 20);
+ break;
+ case 7: // Text
+ showTextConfigurationMenu(true);
+ break;
+ default:
+ break;
+ }
+}
+
+/**
+ * Loads a .MNU file, which is a list of buttons to display.
+ */
+void StarTrekEngine::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
+ if (_activeMenu == nullptr)
+ _keyboardControlsMouseOutsideMenu = _keyboardControlsMouse;
+
+ SharedPtr<Menu> oldMenu = _activeMenu;
+ _activeMenu = SharedPtr<Menu>(new Menu());
+ _activeMenu->nextMenu = oldMenu;
+
+ SharedPtr<FileStream> stream = loadFile(mnuFilename + ".MNU");
+
+ _activeMenu->menuFile = stream;
+ _activeMenu->numButtons = _activeMenu->menuFile->size() / 16;
+
+ for (int i = 0; i < _activeMenu->numButtons; i++) {
+ memset(&_activeMenu->sprites[i], 0, sizeof(Sprite));
+ _gfx->addSprite(&_activeMenu->sprites[i]);
+ _activeMenu->sprites[i].drawMode = 2;
+
+ char bitmapBasename[11];
+ stream->seek(i * 16, SEEK_SET);
+ stream->read(bitmapBasename, 10);
+ for (int j = 0; j < 10; j++) {
+ if (bitmapBasename[j] == ' ')
+ bitmapBasename[j] = '\0';
+ }
+ bitmapBasename[10] = '\0';
+
+ _activeMenu->sprites[i].bitmap = _gfx->loadBitmap(bitmapBasename);
+ _activeMenu->sprites[i].pos.x = stream->readUint16() + xpos;
+ _activeMenu->sprites[i].pos.y = stream->readUint16() + ypos;
+ _activeMenu->retvals[i] = stream->readUint16();
+
+ _activeMenu->sprites[i].field6 = 8;
+ }
+
+ if (_activeMenu->retvals[_activeMenu->numButtons - 1] == 0) {
+ // Set default retvals for buttons
+ for (int i = 0; i < _activeMenu->numButtons; i++)
+ _activeMenu->retvals[i] = i;
+ }
+
+ _activeMenu->selectedButton = -1;
+ _activeMenu->disabledButtons = 0;
+ _keyboardControlsMouse = false;
+}
+
+/**
+ * Sets which buttons are visible based on the given bitmask.
+ */
+void StarTrekEngine::setVisibleMenuButtons(uint32 bits) {
+ for (int i = 0; i < _activeMenu->numButtons; i++) {
+ Sprite *sprite = &_activeMenu->sprites[i];
+ uint32 spriteBitmask = (1 << i);
+ if (spriteBitmask == 0)
+ break;
+
+ if ((bits & spriteBitmask) == 0 || sprite->drawMode != 0) {
+ if ((bits & spriteBitmask) == 0 && sprite->drawMode == 2) {
+ if (i == _activeMenu->selectedButton) {
+ drawMenuButtonOutline(sprite->bitmap, 0x00);
+ _activeMenu->selectedButton = -1;
+ }
+
+ sprite->field16 = true;
+ sprite->bitmapChanged = true;
+ }
+ }
+ else {
+ _gfx->addSprite(sprite);
+ sprite->drawMode = 2;
+ sprite->bitmapChanged = true;
+ }
+ }
+
+ _gfx->drawAllSprites();
+
+ for (int i = 0; i < _activeMenu->numButtons; i++) {
+ Sprite *sprite = &_activeMenu->sprites[i];
+ uint32 spriteBitmask = (1 << i);
+ if (spriteBitmask == 0)
+ break;
+
+ if ((bits & spriteBitmask) == 0 && sprite->drawMode == 2) {
+ _gfx->delSprite(sprite);
+
+ // Setting drawMode to 0 is the game's way of saying that the menu button is
+ // hidden (since it would normally be 2).
+ sprite->drawMode = 0;
+ }
+ }
+}
+
+/**
+ * Disables the given bitmask of buttons.
+ */
+void StarTrekEngine::disableMenuButtons(uint32 bits) {
+ _activeMenu->disabledButtons |= bits;
+ if (_activeMenu->selectedButton != -1
+ && (_activeMenu->disabledButtons & (1 << _activeMenu->selectedButton))) {
+ Sprite *sprite = &_activeMenu->sprites[_activeMenu->selectedButton];
+ drawMenuButtonOutline(sprite->bitmap, 0x00);
+
+ sprite->bitmapChanged = true;
+ _activeMenu->selectedButton = -1;
+ }
+}
+
+void StarTrekEngine::enableMenuButtons(uint32 bits) {
+ _activeMenu->disabledButtons &= ~bits;
+}
+
+/**
+ * This returns either a special menu event (negative number) or the retval of the button
+ * clicked (usually an index, always positive).
+ */
+int StarTrekEngine::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4) {
+ // TODO: finish
+
+ uint32 tickWhenClickingEnabled = _clockTicks + ticksUntilClickingEnabled;
+
+ while (true) {
+ TrekEvent event;
+ while (popNextEvent(&event)) {
+ switch(event.type) {
+
+ case TREKEVENT_TICK: {
+ case TREKEVENT_MOUSEMOVE: // FIXME: actual game only uses TICK event here
+ Common::Point mousePos = _gfx->getMousePos();
+ int buttonIndex = getMenuButtonAt(*_activeMenu, mousePos.x, mousePos.y);
+ if (buttonIndex != -1) {
+ if (_activeMenu->disabledButtons & (1<<buttonIndex))
+ buttonIndex = -1;
+ }
+
+ if (buttonIndex != _activeMenu->selectedButton) {
+ if (_activeMenu->selectedButton != -1) {
+ Sprite &spr = _activeMenu->sprites[_activeMenu->selectedButton];
+ drawMenuButtonOutline(spr.bitmap, 0x00);
+ spr.bitmapChanged = true;
+ }
+ if (buttonIndex != -1) {
+ Sprite &spr = _activeMenu->sprites[buttonIndex];
+ drawMenuButtonOutline(spr.bitmap, 0xda);
+ spr.bitmapChanged = true;
+ }
+ _activeMenu->selectedButton = buttonIndex;
+ }
+ // Not added: updating mouse position (scummvm handles that)
+
+ // sub_10492();
+ // sub_10A91();
+ _gfx->drawAllSprites();
+ // sub_10BE7();
+ // sub_2A4B1();
+
+ if (_finishedPlayingSpeech != 0) {
+ _finishedPlayingSpeech = 0;
+ if (_textDisplayMode != TEXTDISPLAY_WAIT) {
+ return TEXTBUTTON_SPEECH_DONE;
+ }
+ }
+ // sub_1E88C();
+ _frameIndex++;
+
+ if (ticksUntilClickingEnabled != 0 && _clockTicks >= tickWhenClickingEnabled)
+ return MENUEVENT_ENABLEINPUT;
+ break;
+ }
+
+ case TREKEVENT_LBUTTONDOWN:
+ if (_activeMenu->selectedButton != -1) {
+ playSoundEffectIndex(0x10);
+ return _activeMenu->retvals[_activeMenu->selectedButton];
+ }
+ else {
+ Common::Point mouse = _gfx->getMousePos();
+ if (getMenuButtonAt(*_activeMenu, mouse.x, mouse.y) == -1) {
+ playSoundEffectIndex(0x10);
+ return MENUEVENT_LCLICK_OFFBUTTON;
+ }
+ }
+ break;
+
+ case TREKEVENT_RBUTTONDOWN:
+ // TODO
+ break;
+
+ case TREKEVENT_KEYDOWN:
+ // TODO
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+}
+
+void StarTrekEngine::unloadMenuButtons() {
+ if (_activeMenu->selectedButton != -1)
+ drawMenuButtonOutline(_activeMenu->sprites[_activeMenu->selectedButton].bitmap, 0x00);
+
+ for (int i = 0; i < _activeMenu->numButtons; i++) {
+ Sprite *sprite = &_activeMenu->sprites[i];
+ if (sprite->drawMode == 2) {
+ sprite->field16 = true;
+ sprite->bitmapChanged = true;
+ }
+ }
+
+ _gfx->drawAllSprites();
+
+ for (int i = 0; i < _activeMenu->numButtons; i++) {
+ Sprite *sprite = &_activeMenu->sprites[i];
+ sprite->bitmap.reset();
+ if (sprite->drawMode == 2)
+ _gfx->delSprite(sprite);
+ }
+
+ _activeMenu = _activeMenu->nextMenu;
+
+ if (_activeMenu == nullptr)
+ _keyboardControlsMouse = _keyboardControlsMouseOutsideMenu;
+}
+
+void StarTrekEngine::showSaveMenu() {
+ // TODO
+}
+
+void StarTrekEngine::showLoadMenu() {
+ // TODO
+}
+
+void StarTrekEngine::showQuitGamePrompt(int x, int y) {
+ const char *options[] = {
+ "Quit Game",
+ "#GENE\\GENER028#Yes, quit the game.",
+ "#GENE\\GENER008#No, do not quit the game.",
+ ""
+ };
+
+ if (_inQuitGameMenu)
+ return;
+
+ _inQuitGameMenu = true;
+ int val = showText(&StarTrekEngine::readTextFromArray, (uintptr)options, x, y, 0xb0, true, 0, 1);
+ _inQuitGameMenu = false;
+
+ if (val == 0) {
+ // sub_1e70d();
+ _system->quit();
+ }
+}
+
+/**
+ * This can be called from startup or from the options menu.
+ * On startup, this tries to load the setting without user input.
+ */
+void StarTrekEngine::showTextConfigurationMenu(bool fromOptionMenu) {
+ const char *options[] = { // TODO: languages...
+ "Text display",
+ "Text subtitles.",
+ "Display text until you press enter.",
+ "No text displayed.",
+ ""
+ };
+
+ int val;
+ if (fromOptionMenu || (val = loadTextDisplayMode()) == -1) {
+ val = showText(&StarTrekEngine::readTextFromArray, (uintptr)options, 20, 30, 0xb0, true, 0, 1);
+ saveTextDisplayMode(val);
+ }
+
+ switch(val) {
+ case 0:
+ _textDisplayMode = TEXTDISPLAY_SUBTITLES;
+ break;
+ case 1:
+ _textDisplayMode = TEXTDISPLAY_WAIT;
+ break;
+ case 2:
+ _textDisplayMode = TEXTDISPLAY_NONE;
+ break;
+ }
+}
+
+int StarTrekEngine::loadTextDisplayMode() {
+ return -1; // TODO
+}
+void StarTrekEngine::saveTextDisplayMode(int value) {
+ // TODO;
+}
+
+}
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 04f2c7c..cdaa444 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -8,9 +8,10 @@ MODULE_OBJS = \
events.o \
filestream.o \
font.o \
+ graphics.o \
iwfile.o \
lzss.o \
- graphics.o \
+ menu.o \
object.o \
room.o \
sound.o \
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 82fe2e1..61c78bd 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -68,6 +68,10 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_keyboardControlsMouse = true;
_inQuitGameMenu = false;
+ _textDisplayMode = TEXTDISPLAY_WAIT;
+ _textboxVar2 = 0;
+ _textboxVar6 = 0;
+ _textboxHasMultipleChoices = false;
_missionToLoad = "DEMON";
_roomIndexToLoad = 0;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 7560efa..8031bcb 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -44,6 +44,7 @@
using Common::SharedPtr;
+using Common::String;
namespace Common {
class MacResManager;
@@ -51,6 +52,16 @@ namespace Common {
namespace StarTrek {
+class StarTrekEngine;
+
+typedef String (StarTrekEngine::*TextGetterFunc)(int, uintptr, String *);
+
+const int MAX_OBJECTS = 32;
+const int MAX_MENUBUTTONS = 32;
+const int TEXTBOX_WIDTH = 26;
+const int MAX_TEXTBOX_LINES = 12;
+
+
enum StarTrekGameType {
GType_ST25 = 1,
GType_STJR = 2
@@ -65,7 +76,6 @@ enum kDebugLevels {
kDebugGraphics = 1 << 1
};
-
enum GameMode {
GAMEMODE_START = 0,
GAMEMODE_BRIDGE,
@@ -80,6 +90,52 @@ enum TextDisplayMode {
TEXTDISPLAY_NONE // No text displayed
};
+// Keeps track of data for a list of buttons making up a menu
+struct Menu {
+ Sprite sprites[MAX_MENUBUTTONS];
+ uint16 retvals[MAX_MENUBUTTONS];
+ uint32 disabledButtons;
+ SharedPtr<FileStream> menuFile;
+ uint16 numButtons;
+ int16 selectedButton;
+ SharedPtr<Menu> nextMenu;
+};
+
+// Special events that can be returned by handleMenuEvents.
+enum MenuEvent {
+ MENUEVENT_RCLICK_OFFBUTTON = -4,
+ MENUEVENT_ENABLEINPUT, // Makes buttons selectable (occurs after a delay)
+ MENUEVENT_RCLICK_ONBUTTON,
+ MENUEVENT_LCLICK_OFFBUTTON
+};
+
+// Buttons for standard text display
+enum TextButtons {
+ TEXTBUTTON_CONFIRM = 0,
+ TEXTBUTTON_SCROLLUP,
+ TEXTBUTTON_SCROLLDOWN,
+ TEXTBUTTON_PREVCHOICE,
+ TEXTBUTTON_NEXTCHOICE,
+ TEXTBUTTON_SCROLLUP_ONELINE,
+ TEXTBUTTON_SCROLLDOWN_ONELINE,
+ TEXTBUTTON_GOTO_TOP,
+ TEXTBUTTON_GOTO_BOTTOM,
+ TEXTBUTTON_SPEECH_DONE // "Virtual" button?
+};
+
+// Buttons for option menu (corresponding to button indices, not button retvals, which are
+// different for some reason)
+enum OptionMenuButtons {
+ OPTIONBUTTON_TEXT,
+ OPTIONBUTTON_SAVE,
+ OPTIONBUTTON_LOAD,
+ OPTIONBUTTON_ENABLEMUSIC,
+ OPTIONBUTTON_DISABLEMUSIC,
+ OPTIONBUTTON_ENABLESFX,
+ OPTIONBUTTON_DISABLESFX,
+ OPTIONBUTTON_QUIT
+};
+
enum TrekEventType {
TREKEVENT_TICK = 0, // DOS clock changes (see updateClockTicks)
TREKEVENT_LBUTTONDOWN = 1,
@@ -116,7 +172,6 @@ struct Command {
: type(_type), b1(_b1), b2(_b2), b3(_b3) {}
};
-const int MAX_OBJECTS = 0x20;
struct StarTrekGameDescription;
class Graphics;
@@ -207,8 +262,63 @@ private:
bool _tickEventInQueue;
uint32 _frameStartMillis;
+
+ // text.cpp
public:
+ const char *getNextTextLine(const char *text, char *line, int lineWidth);
+
+ void getTextboxHeader(String *headerTextOutput, String speakerText, int choiceIndex);
+ String readTextFromRdf(int choiceIndex, uintptr data, String *headerTextOutput);
+ String readTextFromBuffer(int choiceIndex, uintptr data, String *headerTextOutput);
+
+ String skipTextAudioPrompt(const String &str);
+ String playTextAudio(const String &str);
+
+ int showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, int arg10);
+
+ int getNumTextboxLines(const String &str);
+ String putTextIntoLines(const String &text);
+
+ SharedPtr<TextBitmap> initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite);
+ void drawMainText(SharedPtr<TextBitmap> bitmap, int numTextLines, int numTextboxLines, const String &text, bool withHeader);
+
+ String readLineFormattedText(TextGetterFunc textGetter, uintptr var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numLines);
+
+ String readTextFromArray(int choiceIndex, uintptr data, String *headerTextOutput);
+
+ // menu.cpp
+public:
+ int getMenuButtonAt(const Menu &menu, int x, int y);
+ void chooseMousePositionFromSprites(Sprite *sprites, int numSprites, int spriteIndex, int mode);
+ void drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color);
+ void showOptionsMenu(int x, int y);
+ void loadMenuButtons(String mnuFilename, int xpos, int ypos);
+ void setVisibleMenuButtons(uint32 bits);
+ void disableMenuButtons(uint32 bits);
+ void enableMenuButtons(uint32 bits);
+ int handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4);
+ void unloadMenuButtons();
+
+ void showSaveMenu();
+ void showLoadMenu();
+ void showQuitGamePrompt(int x, int y);
+ void showTextConfigurationMenu(bool fromOptionMenu);
+
+ int loadTextDisplayMode();
+ void saveTextDisplayMode(int value);
+
+
+private:
+ int16 _textDisplayMode;
+ uint32 _textboxVar2;
+ uint16 _textboxVar6;
+ bool _textboxHasMultipleChoices;
+ SharedPtr<Menu> _activeMenu;
+ // Saved value of StarTrekEngine::_keyboardControlsMouse when menus are up
+ bool _keyboardControlsMouseOutsideMenu;
+
// Detection related functions
+public:
const StarTrekGameDescription *_gameDescription;
uint32 getFeatures() const;
uint16 getVersion() const;
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 945ff31..fed047e 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -27,48 +27,168 @@
#include "startrek/graphics.h"
-// Special events that can be returned by handleMenuEvents.
-enum MenuEvent {
- MENUEVENT_RCLICK_OFFBUTTON = -4,
- MENUEVENT_ENABLEINPUT, // Makes buttons selectable (occurs after a delay)
- MENUEVENT_RCLICK_ONBUTTON,
- MENUEVENT_LCLICK_OFFBUTTON
-};
-
-// Buttons for standard text display
-enum TextButtons {
- TEXTBUTTON_CONFIRM = 0,
- TEXTBUTTON_SCROLLUP,
- TEXTBUTTON_SCROLLDOWN,
- TEXTBUTTON_PREVCHOICE,
- TEXTBUTTON_NEXTCHOICE,
- TEXTBUTTON_SCROLLUP_ONELINE,
- TEXTBUTTON_SCROLLDOWN_ONELINE,
- TEXTBUTTON_GOTO_TOP,
- TEXTBUTTON_GOTO_BOTTOM,
- TEXTBUTTON_SPEECH_DONE // "Virtual" button?
-};
-
-// Buttons for option menu (corresponding to button indices, not button retvals, which are
-// different for some reason)
-enum OptionMenuButtons {
- OPTIONBUTTON_TEXT,
- OPTIONBUTTON_SAVE,
- OPTIONBUTTON_LOAD,
- OPTIONBUTTON_ENABLEMUSIC,
- OPTIONBUTTON_DISABLEMUSIC,
- OPTIONBUTTON_ENABLESFX,
- OPTIONBUTTON_DISABLESFX,
- OPTIONBUTTON_QUIT
-};
-
namespace StarTrek {
-int Graphics::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, int arg10) {
+/**
+ * Gets one line of text (does not include words that won't fit).
+ * Returns position of text to continue from, or nullptr if done.
+ */
+const char *StarTrekEngine::getNextTextLine(const char *text, char *lineOutput, int lineWidth) {
+ *lineOutput = '\0';
+ if (*text == '\0')
+ return nullptr;
+
+ const char *lastSpaceInput = nullptr;
+ char *lastSpaceOutput = nullptr;
+ int var4;
+ int charIndex = 0;
+
+ while (charIndex != lineWidth && *text != '\0') {
+ char c = *text;
+
+ if (c == '\n') {
+ *lineOutput = '\0';
+ return text+1;
+ }
+
+ if (c == ' ') {
+ var4 = charIndex;
+ lastSpaceInput = text;
+ lastSpaceOutput = lineOutput;
+ }
+
+ if (c == '\r') {
+ text++;
+ charIndex--;
+ }
+ else {
+ text++;
+ *(lineOutput++) = c;
+ }
+ charIndex++;
+ }
+
+ if (*text == '\0') {
+ *lineOutput = '\0';
+ return text;
+ }
+ if (*text == ' ') {
+ *lineOutput = '\0';
+ return text+1;
+ }
+ if (lastSpaceOutput == nullptr) { // Long word couldn't fit on line
+ *lineOutput = '\0';
+ return text;
+ }
+
+ // In the middle of a word; must go back to the start of it
+ *lastSpaceOutput = '\0';
+ return lastSpaceInput+1;
+}
+
+void StarTrekEngine::getTextboxHeader(String *headerTextOutput, String speakerText, int choiceIndex) {
+ String header = speakerText;
+
+ if (choiceIndex != 0)
+ header += String::format(" choice %d", choiceIndex);
+
+ if (header.size() > TEXTBOX_WIDTH-2)
+ header.erase(TEXTBOX_WIDTH-2);
+ while (header.size() < TEXTBOX_WIDTH-2)
+ header += ' ';
+
+ *headerTextOutput = header;
+}
+
+/**
+ * Text getter for showText which reads from an rdf file.
+ */
+String StarTrekEngine::readTextFromRdf(int choiceIndex, uintptr data, String *headerTextOutput) {
+ SharedPtr<Room> room = getRoom();
+
+ int rdfVar = (size_t)data;
+
+ uint16 textOffset = room->readRdfWord(rdfVar + (choiceIndex+1)*2);
+
+ if (textOffset == 0)
+ return "";
+
+ if (headerTextOutput != nullptr) {
+ uint16 speakerOffset = room->readRdfWord(rdfVar);
+ if (speakerOffset == 0 || room->_rdfData[speakerOffset] == '\0')
+ *headerTextOutput = "";
+ else {
+ char *speakerText = (char*)&room->_rdfData[speakerOffset];
+ if (room->readRdfWord(rdfVar+4) != 0) // Check if there's more than one option
+ getTextboxHeader(headerTextOutput, speakerText, choiceIndex+1);
+ else
+ getTextboxHeader(headerTextOutput, speakerText, 0);
+ }
+ }
+
+ return (char*)&room->_rdfData[textOffset];
+}
+
+/**
+ * Text getter for showText which reads from a given buffer.
+ */
+String StarTrekEngine::readTextFromBuffer(int choiceIndex, uintptr data, String *headerTextOutput) {
+ char buf[TEXTBOX_WIDTH];
+ memcpy(buf, (byte*)data, TEXTBOX_WIDTH-2);
+ buf[TEXTBOX_WIDTH-2] = '\0';
+
+ *headerTextOutput = String(buf);
+
+ char *text = (char*)data+TEXTBOX_WIDTH-2;
+ return String(text);
+}
+
+String StarTrekEngine::skipTextAudioPrompt(const String &str) {
+ const char *text = str.c_str();
+
+ if (*text != '#')
+ return str;
+
+ text++;
+ while (*text != '#') {
+ if (*text == '\0')
+ return str;
+ text++;
+ }
+
+ return String(text+1);
+}
+
+/**
+ * Plays an audio prompt, if it exists, and returns the string starting at the end of the
+ * prompt.
+ */
+String StarTrekEngine::playTextAudio(const String &str) {
+ const char *text = str.c_str();
+ char soundFile[0x100];
+
+ if (*text != '#')
+ return str;
+
+ int len = 0;
+ text++;
+ while (*text != '#') {
+ if (*text == '\0' || len > 0xfa)
+ return str;
+ soundFile[len++] = *text++;
+ }
+
+ soundFile[len] = '\0';
+ playSpeech(soundFile);
+
+ return String(text+1);
+}
+
+int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, int arg10) {
int16 tmpTextDisplayMode = _textDisplayMode;
uint32 var7c = 8;
- if (_vm->_frameIndex > _textboxVar2+1) {
+ if (_frameIndex > _textboxVar2+1) {
var7c = 0x10;
}
@@ -82,7 +202,7 @@ int Graphics::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int
if (choiceText.empty())
break;
- int lines = getNumLines(choiceText);
+ int lines = getNumTextboxLines(choiceText);
if (lines > numTextboxLines)
numTextboxLines = lines;
@@ -106,13 +226,13 @@ int Graphics::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int
int choiceIndex = 0;
int scrollOffset = 0;
if (tmpTextDisplayMode != TEXTDISPLAY_WAIT && tmpTextDisplayMode != TEXTDISPLAY_SUBTITLES
- && numChoices == 1 && _vm->_sfxEnabled && !_vm->_sfxWorking)
+ && numChoices == 1 && _sfxEnabled && !_sfxWorking)
_textboxHasMultipleChoices = false;
else
_textboxHasMultipleChoices = true;
if (tmpTextDisplayMode >= TEXTDISPLAY_WAIT && tmpTextDisplayMode <= TEXTDISPLAY_NONE
- && _vm->_sfxEnabled && !_vm->_sfxWorking)
+ && _sfxEnabled && !_sfxWorking)
_textboxVar6 = true;
else
_textboxVar6 = false;
@@ -126,14 +246,14 @@ int Graphics::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int
else {
loadMenuButtons("textbtns", xoffset + 0x96, yoffset - 0x11);
- Common::Point oldMousePos = getMousePos();
- SharedPtr<Bitmap> oldMouseBitmap = _mouseBitmap;
+ Common::Point oldMousePos = _gfx->getMousePos();
+ SharedPtr<Bitmap> oldMouseBitmap = _gfx->_mouseBitmap;
- _vm->_system->warpMouse(xoffset + 0xde, yoffset - 0x08);
- setMouseCursor(loadBitmap("pushbtn"));
+ _system->warpMouse(xoffset + 0xde, yoffset - 0x08);
+ _gfx->setMouseCursor(_gfx->loadBitmap("pushbtn"));
- bool tmpMouseControllingShip = _vm->_mouseControllingShip;
- _vm->_mouseControllingShip = false;
+ bool tmpMouseControllingShip = _mouseControllingShip;
+ _mouseControllingShip = false;
// Decide which buttons to show
uint32 visibleButtons = (1 << TEXTBUTTON_CONFIRM);
@@ -278,177 +398,66 @@ reloadText:
}
}
- setMouseCursor(oldMouseBitmap);
- _vm->_system->warpMouse(oldMousePos.x, oldMousePos.y);
+ _gfx->setMouseCursor(oldMouseBitmap);
+ _system->warpMouse(oldMousePos.x, oldMousePos.y);
- _vm->_mouseControllingShip = tmpMouseControllingShip;
+ _mouseControllingShip = tmpMouseControllingShip;
unloadMenuButtons();
textboxSprite.field16 = true;
textboxSprite.bitmapChanged = true;
- drawAllSprites();
- delSprite(&textboxSprite);
+ _gfx->drawAllSprites();
+ _gfx->delSprite(&textboxSprite);
// sub_272B4
}
- _textboxVar2 = _vm->_frameIndex;
- _vm->stopPlayingSpeech();
+ _textboxVar2 = _frameIndex;
+ stopPlayingSpeech();
return choiceIndex;
}
/**
- * This returns either a special menu event (negative number) or the retval of the button
- * clicked (usually an index, always positive).
+ * Returns the number of lines this string will take up in a textbox.
*/
-int Graphics::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4) {
- // TODO: finish
-
- uint32 tickWhenClickingEnabled = _vm->_clockTicks + ticksUntilClickingEnabled;
-
- while (true) {
- TrekEvent event;
- while (_vm->popNextEvent(&event)) {
- switch(event.type) {
-
- case TREKEVENT_TICK: {
- case TREKEVENT_MOUSEMOVE: // FIXME: actual game only uses TICK event here
- Common::Point mousePos = getMousePos();
- int buttonIndex = getMenuButtonAt(*_activeMenu, mousePos.x, mousePos.y);
- if (buttonIndex != -1) {
- if (_activeMenu->disabledButtons & (1<<buttonIndex))
- buttonIndex = -1;
- }
-
- if (buttonIndex != _activeMenu->selectedButton) {
- if (_activeMenu->selectedButton != -1) {
- Sprite &spr = _activeMenu->sprites[_activeMenu->selectedButton];
- drawMenuButtonOutline(spr.bitmap, 0x00);
- spr.bitmapChanged = true;
- }
- if (buttonIndex != -1) {
- Sprite &spr = _activeMenu->sprites[buttonIndex];
- drawMenuButtonOutline(spr.bitmap, 0xda);
- spr.bitmapChanged = true;
- }
- _activeMenu->selectedButton = buttonIndex;
- }
- // Not added: updating mouse position (scummvm handles that)
-
- // sub_10492();
- // sub_10A91();
- drawAllSprites();
- // sub_10BE7();
- // sub_2A4B1();
-
- if (_vm->_finishedPlayingSpeech != 0) {
- _vm->_finishedPlayingSpeech = 0;
- if (_textDisplayMode != TEXTDISPLAY_WAIT) {
- return TEXTBUTTON_SPEECH_DONE;
- }
- }
- // sub_1E88C();
- _vm->_frameIndex++;
-
- if (ticksUntilClickingEnabled != 0 && _vm->_clockTicks >= tickWhenClickingEnabled)
- return MENUEVENT_ENABLEINPUT;
- break;
- }
-
- case TREKEVENT_LBUTTONDOWN:
- if (_activeMenu->selectedButton != -1) {
- _vm->playSoundEffectIndex(0x10);
- return _activeMenu->retvals[_activeMenu->selectedButton];
- }
- else {
- Common::Point mouse = getMousePos();
- if (getMenuButtonAt(*_activeMenu, mouse.x, mouse.y) == -1) {
- _vm->playSoundEffectIndex(0x10);
- return MENUEVENT_LCLICK_OFFBUTTON;
- }
- }
- break;
-
- case TREKEVENT_RBUTTONDOWN:
- // TODO
- break;
+int StarTrekEngine::getNumTextboxLines(const String &str) {
+ const char *text = str.c_str();
+ char line[TEXTBOX_WIDTH];
- case TREKEVENT_KEYDOWN:
- // TODO
- break;
+ int lines = 0;
- default:
- break;
- }
- }
+ while (text != nullptr) {
+ text = getNextTextLine(text, line, TEXTBOX_WIDTH-2);
+ lines++;
}
+ return lines-1;
}
-/**
- * Text getter for showText which reads from an rdf file.
- */
-String Graphics::readTextFromRdf(int choiceIndex, uintptr data, String *headerTextOutput) {
- SharedPtr<Room> room = _vm->getRoom();
-
- int rdfVar = (size_t)data;
+String StarTrekEngine::putTextIntoLines(const String &_text) {
+ char line[TEXTBOX_WIDTH];
- uint16 textOffset = room->readRdfWord(rdfVar + (choiceIndex+1)*2);
+ const char *text = _text.c_str();
+ String output;
- if (textOffset == 0)
- return "";
+ text = getNextTextLine(text, line, TEXTBOX_WIDTH-2);
- if (headerTextOutput != nullptr) {
- uint16 speakerOffset = room->readRdfWord(rdfVar);
- if (speakerOffset == 0 || room->_rdfData[speakerOffset] == '\0')
- *headerTextOutput = "";
- else {
- char *speakerText = (char*)&room->_rdfData[speakerOffset];
- if (room->readRdfWord(rdfVar+4) != 0) // Check if there's more than one option
- getTextboxHeader(headerTextOutput, speakerText, choiceIndex+1);
- else
- getTextboxHeader(headerTextOutput, speakerText, 0);
+ while (text != nullptr) {
+ int len = strlen(line);
+ while (len != TEXTBOX_WIDTH-2) {
+ line[len++] = ' ';
+ line[len] = '\0';
}
- }
-
- return (char*)&room->_rdfData[textOffset];
-}
-
-/**
- * Text getter for showText which reads from a given buffer.
- */
-String Graphics::readTextFromBuffer(int choiceIndex, uintptr data, String *headerTextOutput) {
- char buf[TEXTBOX_WIDTH];
- memcpy(buf, (byte*)data, TEXTBOX_WIDTH-2);
- buf[TEXTBOX_WIDTH-2] = '\0';
-
- *headerTextOutput = String(buf);
-
- char *text = (char*)data+TEXTBOX_WIDTH-2;
- return String(text);
-}
-
-/**
- * Text getter for showText which reads choices from an array of pointers.
- * Last element in the array must be an empty string.
- */
-String Graphics::readTextFromArray(int choiceIndex, uintptr data, String *headerTextOutput) {
- const char **textArray = (const char**)data;
-
- const char *headerText = textArray[0];
- const char *mainText = textArray[choiceIndex+1];
+ output += line;
- if (*mainText == '\0')
- return Common::String(); // Technically should be nullptr...
+ text = getNextTextLine(text, line, TEXTBOX_WIDTH-2);
+ }
- *headerTextOutput = headerText;
- while (headerTextOutput->size() < TEXTBOX_WIDTH-2)
- *headerTextOutput += ' ';
- return String(mainText);
+ return output;
}
/**
* Creates a blank textbox in a TextBitmap, and initializes a sprite to use it.
*/
-SharedPtr<TextBitmap> Graphics::initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite) {
+SharedPtr<TextBitmap> StarTrekEngine::initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite) {
int linesBeforeTextStart = 2;
if (withHeader)
linesBeforeTextStart = 4;
@@ -510,7 +519,7 @@ SharedPtr<TextBitmap> Graphics::initTextSprite(int *xoffsetPtr, int *yoffsetPtr,
memset(&textAddr[1], 0x16, TEXTBOX_WIDTH-2);
textAddr[TEXTBOX_WIDTH-1] = 0x17;
- addSprite(sprite);
+ _gfx->addSprite(sprite);
sprite->drawMode = 3;
sprite->pos.x = xoffset;
sprite->pos.y = yoffset;
@@ -526,7 +535,7 @@ SharedPtr<TextBitmap> Graphics::initTextSprite(int *xoffsetPtr, int *yoffsetPtr,
* Draws the "main" text (everything but the header which includes the speaker) to
* a TextBitmap.
*/
-void Graphics::drawMainText(SharedPtr<TextBitmap> bitmap, int numTextLines, int numTextboxLines, const String &_text, bool withHeader) {
+void StarTrekEngine::drawMainText(SharedPtr<TextBitmap> bitmap, int numTextLines, int numTextboxLines, const String &_text, bool withHeader) {
byte *dest = bitmap->pixels + TEXTBOX_WIDTH + 1; // Start of 2nd row
const char *text = _text.c_str();
@@ -552,48 +561,18 @@ void Graphics::drawMainText(SharedPtr<TextBitmap> bitmap, int numTextLines, int
}
}
-/**
- * Returns the number of lines this string will take up in a textbox.
- */
-int Graphics::getNumLines(const String &str) {
- const char *text = str.c_str();
- char line[TEXTBOX_WIDTH];
-
- int lines = 0;
+String StarTrekEngine::readLineFormattedText(TextGetterFunc textGetter, uintptr var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numTextLines) {
+ String headerText;
+ String text = (this->*textGetter)(choiceIndex, var, &headerText);
- while (text != nullptr) {
- text = getNextTextLine(text, line, TEXTBOX_WIDTH-2);
- lines++;
- }
- return lines-1;
-}
-
-void Graphics::getTextboxHeader(String *headerTextOutput, String speakerText, int choiceIndex) {
- String header = speakerText;
-
- if (choiceIndex != 0)
- header += String::format(" choice %d", choiceIndex);
-
- if (header.size() > TEXTBOX_WIDTH-2)
- header.erase(TEXTBOX_WIDTH-2);
- while (header.size() < TEXTBOX_WIDTH-2)
- header += ' ';
-
- *headerTextOutput = header;
-}
-
-String Graphics::readLineFormattedText(TextGetterFunc textGetter, uintptr var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numTextLines) {
- String headerText;
- String text = (this->*textGetter)(choiceIndex, var, &headerText);
-
- if (_textDisplayMode == TEXTDISPLAY_NONE && _vm->_sfxEnabled && _vm->_sfxWorking) {
- uint32 oldSize = text.size();
- text = playTextAudio(text);
- if (oldSize != text.size())
- _textboxHasMultipleChoices = true;
+ if (_textDisplayMode == TEXTDISPLAY_NONE && _sfxEnabled && _sfxWorking) {
+ uint32 oldSize = text.size();
+ text = playTextAudio(text);
+ if (oldSize != text.size())
+ _textboxHasMultipleChoices = true;
}
else if ((_textDisplayMode == TEXTDISPLAY_WAIT || _textDisplayMode == TEXTDISPLAY_SUBTITLES)
- && _vm->_sfxEnabled && _vm->_sfxWorking) {
+ && _sfxEnabled && _sfxWorking) {
text = playTextAudio(text);
}
else {
@@ -601,7 +580,7 @@ String Graphics::readLineFormattedText(TextGetterFunc textGetter, uintptr var, i
}
if (_textboxHasMultipleChoices) {
- *numTextLines = getNumLines(text);
+ *numTextLines = getNumTextboxLines(text);
bool hasHeader = !headerText.empty();
@@ -635,575 +614,23 @@ String Graphics::readLineFormattedText(TextGetterFunc textGetter, uintptr var, i
*/
}
-String Graphics::putTextIntoLines(const String &_text) {
- char line[TEXTBOX_WIDTH];
-
- const char *text = _text.c_str();
- String output;
-
- text = getNextTextLine(text, line, TEXTBOX_WIDTH-2);
-
- while (text != nullptr) {
- int len = strlen(line);
- while (len != TEXTBOX_WIDTH-2) {
- line[len++] = ' ';
- line[len] = '\0';
- }
- output += line;
-
- text = getNextTextLine(text, line, TEXTBOX_WIDTH-2);
- }
-
- return output;
-}
-
-/**
- * Gets one line of text (does not include words that won't fit).
- * Returns position of text to continue from, or nullptr if done.
- */
-const char *Graphics::getNextTextLine(const char *text, char *lineOutput, int lineWidth) {
- *lineOutput = '\0';
- if (*text == '\0')
- return nullptr;
-
- const char *lastSpaceInput = nullptr;
- char *lastSpaceOutput = nullptr;
- int var4;
- int charIndex = 0;
-
- while (charIndex != lineWidth && *text != '\0') {
- char c = *text;
-
- if (c == '\n') {
- *lineOutput = '\0';
- return text+1;
- }
-
- if (c == ' ') {
- var4 = charIndex;
- lastSpaceInput = text;
- lastSpaceOutput = lineOutput;
- }
-
- if (c == '\r') {
- text++;
- charIndex--;
- }
- else {
- text++;
- *(lineOutput++) = c;
- }
- charIndex++;
- }
-
- if (*text == '\0') {
- *lineOutput = '\0';
- return text;
- }
- if (*text == ' ') {
- *lineOutput = '\0';
- return text+1;
- }
- if (lastSpaceOutput == nullptr) { // Long word couldn't fit on line
- *lineOutput = '\0';
- return text;
- }
-
- // In the middle of a word; must go back to the start of it
- *lastSpaceOutput = '\0';
- return lastSpaceInput+1;
-}
-
-String Graphics::skipTextAudioPrompt(const String &str) {
- const char *text = str.c_str();
-
- if (*text != '#')
- return str;
-
- text++;
- while (*text != '#') {
- if (*text == '\0')
- return str;
- text++;
- }
-
- return String(text+1);
-}
-
-/**
- * Plays an audio prompt, if it exists, and returns the string starting at the end of the
- * prompt.
- */
-String Graphics::playTextAudio(const String &str) {
- const char *text = str.c_str();
- char soundFile[0x100];
-
- if (*text != '#')
- return str;
-
- int len = 0;
- text++;
- while (*text != '#') {
- if (*text == '\0' || len > 0xfa)
- return str;
- soundFile[len++] = *text++;
- }
-
- soundFile[len] = '\0';
- _vm->playSpeech(soundFile);
-
- return String(text+1);
-}
-
-/**
- * Returns the index of the button at the given position, or -1 if none.
- */
-int Graphics::getMenuButtonAt(const Menu &menu, int x, int y) {
- for (int i = 0; i < menu.numButtons; i++) {
- const Sprite &spr = menu.sprites[i];
-
- if (spr.drawMode != 2)
- continue;
-
- int left = spr.pos.x - spr.bitmap->xoffset;
- int top = spr.pos.y - spr.bitmap->yoffset;
-
- // Oddly, this doesn't account for x/yoffset...
- int right = spr.pos.x + spr.bitmap->width - 1;
- int bottom = spr.pos.y + spr.bitmap->height - 1;
-
- if (x >= left && x <= right && y >= top && y <= bottom)
- return i;
- }
-
- return -1;
-}
-
/**
- * Draws or removes the outline on menu buttons when the cursor hovers on them, or leaves
- * them.
- */
-void Graphics::drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color) {
- int lineWidth = bitmap->width-2;
- int offsetToBottom = (bitmap->height-3)*bitmap->width;
-
- byte *dest = bitmap->pixels + bitmap->width + 1;
-
- while (lineWidth--) {
- *dest = color;
- *(dest+offsetToBottom) = color;
- dest++;
- }
-
- int lineHeight = bitmap->height - 2;
- int offsetToRight = bitmap->width - 3;
-
- dest = bitmap->pixels + bitmap->width + 1;
-
- while (lineHeight--) {
- *dest = color;
- *(dest+offsetToRight) = color;
- dest += bitmap->width;
- }
-}
-
-/**
- * Loads a .MNU file, which is a list of buttons to display.
- */
-void Graphics::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
- if (_activeMenu == nullptr)
- _keyboardControlsMouseOutsideMenu = _vm->_keyboardControlsMouse;
-
- SharedPtr<Menu> oldMenu = _activeMenu;
- _activeMenu = SharedPtr<Menu>(new Menu());
- _activeMenu->nextMenu = oldMenu;
-
- SharedPtr<FileStream> stream = _vm->loadFile(mnuFilename + ".MNU");
-
- _activeMenu->menuFile = stream;
- _activeMenu->numButtons = _activeMenu->menuFile->size() / 16;
-
- for (int i = 0; i < _activeMenu->numButtons; i++) {
- memset(&_activeMenu->sprites[i], 0, sizeof(Sprite));
- addSprite(&_activeMenu->sprites[i]);
- _activeMenu->sprites[i].drawMode = 2;
-
- char bitmapBasename[11];
- stream->seek(i * 16, SEEK_SET);
- stream->read(bitmapBasename, 10);
- for (int j = 0; j < 10; j++) {
- if (bitmapBasename[j] == ' ')
- bitmapBasename[j] = '\0';
- }
- bitmapBasename[10] = '\0';
-
- _activeMenu->sprites[i].bitmap = loadBitmap(bitmapBasename);
- _activeMenu->sprites[i].pos.x = stream->readUint16() + xpos;
- _activeMenu->sprites[i].pos.y = stream->readUint16() + ypos;
- _activeMenu->retvals[i] = stream->readUint16();
-
- _activeMenu->sprites[i].field6 = 8;
- }
-
- if (_activeMenu->retvals[_activeMenu->numButtons - 1] == 0) {
- // Set default retvals for buttons
- for (int i = 0; i < _activeMenu->numButtons; i++)
- _activeMenu->retvals[i] = i;
- }
-
- _activeMenu->selectedButton = -1;
- _activeMenu->disabledButtons = 0;
- _vm->_keyboardControlsMouse = false;
-}
-
-void Graphics::unloadMenuButtons() {
- if (_activeMenu->selectedButton != -1)
- drawMenuButtonOutline(_activeMenu->sprites[_activeMenu->selectedButton].bitmap, 0x00);
-
- for (int i = 0; i < _activeMenu->numButtons; i++) {
- Sprite *sprite = &_activeMenu->sprites[i];
- if (sprite->drawMode == 2) {
- sprite->field16 = true;
- sprite->bitmapChanged = true;
- }
- }
-
- drawAllSprites();
-
- for (int i = 0; i < _activeMenu->numButtons; i++) {
- Sprite *sprite = &_activeMenu->sprites[i];
- sprite->bitmap.reset();
- if (sprite->drawMode == 2)
- delSprite(sprite);
- }
-
- _activeMenu = _activeMenu->nextMenu;
-
- if (_activeMenu == nullptr)
- _vm->_keyboardControlsMouse = _keyboardControlsMouseOutsideMenu;
-}
-
-/**
- * Disables the given bitmask of buttons.
- */
-void Graphics::disableMenuButtons(uint32 bits) {
- _activeMenu->disabledButtons |= bits;
- if (_activeMenu->selectedButton != -1
- && (_activeMenu->disabledButtons & (1 << _activeMenu->selectedButton))) {
- Sprite *sprite = &_activeMenu->sprites[_activeMenu->selectedButton];
- drawMenuButtonOutline(sprite->bitmap, 0x00);
-
- sprite->bitmapChanged = true;
- _activeMenu->selectedButton = -1;
- }
-}
-
-void Graphics::enableMenuButtons(uint32 bits) {
- _activeMenu->disabledButtons &= ~bits;
-}
-
-/**
- * Sets which buttons are visible based on the given bitmask.
- */
-void Graphics::setVisibleMenuButtons(uint32 bits) {
- for (int i = 0; i < _activeMenu->numButtons; i++) {
- Sprite *sprite = &_activeMenu->sprites[i];
- uint32 spriteBitmask = (1 << i);
- if (spriteBitmask == 0)
- break;
-
- if ((bits & spriteBitmask) == 0 || sprite->drawMode != 0) {
- if ((bits & spriteBitmask) == 0 && sprite->drawMode == 2) {
- if (i == _activeMenu->selectedButton) {
- drawMenuButtonOutline(sprite->bitmap, 0x00);
- _activeMenu->selectedButton = -1;
- }
-
- sprite->field16 = true;
- sprite->bitmapChanged = true;
- }
- }
- else {
- addSprite(sprite);
- sprite->drawMode = 2;
- sprite->bitmapChanged = true;
- }
- }
-
- drawAllSprites();
-
- for (int i = 0; i < _activeMenu->numButtons; i++) {
- Sprite *sprite = &_activeMenu->sprites[i];
- uint32 spriteBitmask = (1 << i);
- if (spriteBitmask == 0)
- break;
-
- if ((bits & spriteBitmask) == 0 && sprite->drawMode == 2) {
- delSprite(sprite);
-
- // Setting drawMode to 0 is the game's way of saying that the menu button is
- // hidden (since it would normally be 2).
- sprite->drawMode = 0;
- }
- }
-}
-
-/**
- * This chooses a sprite from the list to place the mouse cursor at. The sprite it chooses
- * may be, for example, the top-leftmost one in the list. Exact behaviour is determined by
- * the "mode" parameter.
- *
- * If "containMouseSprite" is a valid index, it's ensured that the mouse is contained
- * within it. "mode" should be -1 in this case.
+ * Text getter for showText which reads choices from an array of pointers.
+ * Last element in the array must be an empty string.
*/
-void Graphics::choseMousePositionFromSprites(Sprite *sprites, int numSprites, int containMouseSprite, int mode) {
- uint16 mouseX1 = 0x7fff; // Candidate positions to warp mouse to
- uint16 mouseY1 = 0x7fff;
- uint16 mouseX2 = 0x7fff;
- uint16 mouseY2 = 0x7fff;
-
- Common::Point mousePos = getMousePos();
-
- // Ensure the cursor is contained within one of the sprites
- if (containMouseSprite >= 0 && containMouseSprite < numSprites) {
- Common::Rect rect = sprites[containMouseSprite].getRect();
-
- if (mousePos.x < rect.left || mousePos.x >= rect.right
- || mousePos.y < rect.top || mousePos.y >= rect.bottom) {
- mousePos.x = (rect.left + rect.right) / 2;
- mousePos.y = (rect.top + rect.bottom) / 2;
- }
- }
-
- // Choose a sprite to warp the cursor to
- for (int i = 0; i < numSprites; i++) {
- Sprite *sprite = &sprites[i];
- if (sprite->drawMode != 2) // Skip hidden buttons
- continue;
-
- Common::Rect rect = sprite->getRect();
-
- int hCenter = (rect.left + rect.right) / 2;
- int vCenter = (rect.top + rect.bottom) / 2;
-
- // Choose which sprite is closest based on certain criteria?
- switch(mode) {
- case 0: // Choose topmost, leftmost sprite that's below the cursor
- if (((vCenter == mousePos.y && hCenter > mousePos.x) || vCenter > mousePos.y)
- && (vCenter < mouseY1 || (vCenter == mouseY1 && hCenter < mouseX1))) {
- mouseX1 = hCenter;
- mouseY1 = vCenter;
- }
- // fall through
-
- case 4: // Choose topmost, leftmost sprite
- if (vCenter < mouseY2 || (vCenter == mouseY2 && hCenter < mouseX2)) {
- mouseX2 = hCenter;
- mouseY2 = vCenter;
- }
- break;
-
- case 1: // Choose bottommost, rightmost sprite that's above the cursor
- if (((vCenter == mousePos.y && hCenter < mousePos.x) || vCenter < mousePos.y)
- && (mouseY1 == 0x7fff || vCenter > mouseY1
- || (vCenter == mouseY1 && hCenter > mouseX1))) {
- mouseX1 = hCenter;
- mouseY1 = vCenter;
- }
- // fall through
-
- case 5: // Choose bottommost, rightmost sprite
- if (mouseY2 == 0x7fff || vCenter > mouseY2
- || (vCenter == mouseY2 && hCenter > mouseX2)) {
- mouseX2 = hCenter;
- mouseY2 = vCenter;
- }
- break;
-
- case 2:
- // This seems broken... OR condition on first line has no affect on the logic...
- if ((vCenter < mousePos.y || (vCenter == mouseY1 && hCenter == mousePos.x))
- && (mouseX1 == 0x7fff || vCenter >= mouseY1)) {
- mouseX1 = hCenter;
- mouseY1 = vCenter;
- debug("Try %d %d", mouseX1, mouseY1);
- }
- if (mouseX2 == 0x7fff || vCenter > mouseY2
- || (hCenter == mouseX2 && vCenter == mouseY2)) {
- mouseX2 = hCenter;
- mouseY2 = vCenter;
- }
- break;
-
- case 3:
- // Similar to above...
- if ((vCenter > mousePos.y || (vCenter == mouseY1 && hCenter == mousePos.x))
- && (mouseX1 == 0x7fff || vCenter <= mouseY1)) {
- mouseX1 = hCenter;
- mouseY1 = vCenter;
- }
- if (mouseX2 == 0x7fff || vCenter < mouseY2
- || (hCenter == mouseX2 && vCenter == mouseY2)) {
- mouseX2 = hCenter;
- mouseY2 = vCenter;
- }
- break;
- }
- }
-
- // Warp mouse to one of the coordinates, if one is valid
- if (mouseX1 != 0x7fff) {
- mousePos.x = mouseX1;
- mousePos.y = mouseY1;
- }
- else if (mouseX2 != 0x7fff) {
- mousePos.x = mouseX2;
- mousePos.y = mouseY2;
- }
-
- _vm->_system->warpMouse(mousePos.x, mousePos.y);
-
-}
-
-void Graphics::showOptionsMenu(int x, int y) {
- bool tmpMouseControllingShip = _vm->_mouseControllingShip;
- _vm->_mouseControllingShip = false;
-
- Common::Point oldMousePos = getMousePos();
- SharedPtr<Bitmap> oldMouseBitmap = _mouseBitmap;
-
- setMouseCursor(loadBitmap("options"));
- loadMenuButtons("options", x, y);
-
- uint32 disabledButtons = 0;
- if (_vm->_musicWorking) {
- if (_vm->_musicEnabled)
- disabledButtons |= (1 << OPTIONBUTTON_ENABLEMUSIC);
- else
- disabledButtons |= (1 << OPTIONBUTTON_DISABLEMUSIC);
- }
- else
- disabledButtons |= (1 << OPTIONBUTTON_ENABLEMUSIC) | (1 << OPTIONBUTTON_DISABLEMUSIC);
-
- if (_vm->_sfxWorking) {
- if (_vm->_sfxEnabled)
- disabledButtons |= (1 << OPTIONBUTTON_ENABLESFX);
- else
- disabledButtons |= (1 << OPTIONBUTTON_DISABLESFX);
- }
- else
- disabledButtons |= (1 << OPTIONBUTTON_ENABLESFX) | (1 << OPTIONBUTTON_DISABLESFX);
-
- disableMenuButtons(disabledButtons);
- choseMousePositionFromSprites(_activeMenu->sprites, _activeMenu->numButtons, -1, 4);
- int event = handleMenuEvents(0, false);
-
- unloadMenuButtons();
- _vm->_mouseControllingShip = tmpMouseControllingShip;
- setMouseCursor(oldMouseBitmap);
-
- if (event != MENUEVENT_LCLICK_OFFBUTTON && event != MENUEVENT_RCLICK_OFFBUTTON)
- _vm->_system->warpMouse(oldMousePos.x, oldMousePos.y);
-
-
- // Can't use OPTIONBUTTON constants since the button retvals differ from the button
- // indices...
- switch(event) {
- case 0: // Save
- showSaveMenu();
- break;
- case 1: // Load
- showLoadMenu();
- break;
- case 2: // Enable music
- _vm->_sound->setMusicEnabled(true);
- break;
- case 3: // Disable music
- _vm->_sound->setMusicEnabled(false);
- break;
- case 4: // Enable sfx
- _vm->_sound->setSfxEnabled(true);
- break;
- case 5: // Disable sfx
- _vm->_sound->setSfxEnabled(false);
- break;
- case 6: // Quit
- showQuitGamePrompt(20, 20);
- break;
- case 7: // Text
- showTextConfigurationMenu(true);
- break;
- default:
- break;
- }
-}
-
-void Graphics::showSaveMenu() {
- // TODO
-}
-
-void Graphics::showLoadMenu() {
- // TODO
-}
-
-void Graphics::showQuitGamePrompt(int x, int y) {
- const char *options[] = {
- "Quit Game",
- "#GENE\\GENER028#Yes, quit the game.",
- "#GENE\\GENER008#No, do not quit the game.",
- ""
- };
-
- if (_vm->_inQuitGameMenu)
- return;
-
- _vm->_inQuitGameMenu = true;
- int val = showText(&Graphics::readTextFromArray, (uintptr)options, x, y, 0xb0, true, 0, 1);
- _vm->_inQuitGameMenu = false;
-
- if (val == 0) {
- // sub_1e70d();
- _vm->_system->quit();
- }
-}
+String StarTrekEngine::readTextFromArray(int choiceIndex, uintptr data, String *headerTextOutput) {
+ const char **textArray = (const char**)data;
-/**
- * This can be called from startup or from the options menu.
- * On startup, this tries to load the setting without user input.
- */
-void Graphics::showTextConfigurationMenu(bool fromOptionMenu) {
- const char *options[] = { // TODO: languages...
- "Text display",
- "Text subtitles.",
- "Display text until you press enter.",
- "No text displayed.",
- ""
- };
-
- int val;
- if (fromOptionMenu || (val = loadTextDisplayMode()) == -1) {
- val = showText(&Graphics::readTextFromArray, (uintptr)options, 20, 30, 0xb0, true, 0, 1);
- saveTextDisplayMode(val);
- }
+ const char *headerText = textArray[0];
+ const char *mainText = textArray[choiceIndex+1];
- switch(val) {
- case 0:
- _textDisplayMode = TEXTDISPLAY_SUBTITLES;
- break;
- case 1:
- _textDisplayMode = TEXTDISPLAY_WAIT;
- break;
- case 2:
- _textDisplayMode = TEXTDISPLAY_NONE;
- break;
- }
-}
+ if (*mainText == '\0')
+ return Common::String(); // Technically should be nullptr...
-int Graphics::loadTextDisplayMode() {
- return -1; // TODO
-}
-void Graphics::saveTextDisplayMode(int value) {
- // TODO;
+ *headerTextOutput = headerText;
+ while (headerTextOutput->size() < TEXTBOX_WIDTH-2)
+ *headerTextOutput += ' ';
+ return String(mainText);
}
}
Commit: 2120ce106210538c9508be1e275bdba97ddda63a
https://github.com/scummvm/scummvm/commit/2120ce106210538c9508be1e275bdba97ddda63a
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Action menu
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/events.cpp
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/menu.cpp
engines/startrek/sound.cpp
engines/startrek/sound.h
engines/startrek/sprite.cpp
engines/startrek/sprite.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index efa603d..aba01c0 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -84,7 +84,7 @@ void StarTrekEngine::loadRoom(const Common::String &missionName, int roomIndex)
// Original sets up bytes 0-3 of rdf file as "remote function caller"
// Load map file
- _awayMission.mapFileLoaded = 1;
+ _awayMission.activeAction = ACTION_WALK;
_mapFilename = _screenName;
_mapFile = loadFile(_mapFilename + ".map");
_iwFile = SharedPtr<IWFile>(new IWFile(this, _mapFilename + ".iw"));
@@ -161,7 +161,7 @@ void StarTrekEngine::handleAwayMissionEvents() {
// doSomethingWithBanData1();
_gfx->drawAllSprites();
// doSomethingWithBanData2();
- // updateMusic(); // Is this needed?
+ _sound->checkLoopMusic();
// sub_22de0();
_frameIndex++;
_roomFrameCounter++;
@@ -172,7 +172,7 @@ void StarTrekEngine::handleAwayMissionEvents() {
case TREKEVENT_LBUTTONDOWN:
if (_awayMission.transitioningIntoRoom != 0)
break;
- switch (_awayMission.mapFileLoaded) {
+ switch (_awayMission.activeAction) {
case 1:
if (_awayMission.field1c == 0) {
_kirkObject->sprite.drawMode = 1; // Hide these objects for function call below?
@@ -205,7 +205,35 @@ void StarTrekEngine::handleAwayMissionEvents() {
break;
case TREKEVENT_MOUSEMOVE:
break;
- case TREKEVENT_RBUTTONDOWN:
+ case TREKEVENT_RBUTTONDOWN: // TODO: also triggered by key press?
+ /*
+ if (_awayMission.field1d)
+ break;
+ */
+ //sub_2394b();
+ playSoundEffectIndex(0x07);
+ _awayMission.activeAction = showActionMenu();
+ /*
+ if (awayMission.activeAction == ACTION_USE) {
+ int16 clickedObject = sub_22f08();
+ if (clickedObject == -1)
+ break;
+ else
+ _awayMission.field20 = clickedObject;
+ }
+ if (_awayMission.activeAction == ACTION_USE
+ && _awayMission.field20 == 0x47 && (_awayMission.field24 & 1) == 0) {
+ if (sub_2330c() == 0) {
+ addCommand(Command(_awayMission.activeAction, _awayMission.field20, 0, 0));
+ _sound->playVoc("communic");
+ _awayMission.activeAction = ACTION_WALK;
+ }
+ }
+ else if (_awayMission.activeAction == ACTION_LOOK)
+ sub_2383a(0);
+ else if (_awayMission.activeAction == ACTION_USE && (_awayMission.field24 & 1) == 0)
+ sub_2383a(1);
+ */
break;
case TREKEVENT_KEYDOWN:
break;
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 2036b60..cb5dfed 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -28,9 +28,11 @@ struct AwayMission {
int16 mouseX;
int16 mouseY;
byte field1c;
+ byte field1d;
byte transitioningIntoRoom; // Set while beaming in or walking into a room
bool redshirtDead;
- byte mapFileLoaded;
+ byte activeAction;
+ byte field20;
byte field24;
int8 field25[4];
diff --git a/engines/startrek/events.cpp b/engines/startrek/events.cpp
index f36ce6a..58c2666 100644
--- a/engines/startrek/events.cpp
+++ b/engines/startrek/events.cpp
@@ -40,17 +40,30 @@ void StarTrekEngine::pollSystemEvents() {
trekEvent.type = TREKEVENT_MOUSEMOVE;
addEventToQueue(trekEvent);
break;
+
case Common::EVENT_LBUTTONDOWN:
// TODO: what happens when mouse click is outside normal screen bounds?
// (apparently this can happen)
trekEvent.type = TREKEVENT_LBUTTONDOWN;
addEventToQueue(trekEvent);
break;
+
+ case Common::EVENT_RBUTTONDOWN:
+ trekEvent.type = TREKEVENT_RBUTTONDOWN;
+ addEventToQueue(trekEvent);
+ break;
+
+ case Common::EVENT_KEYDOWN:
+ trekEvent.type = TREKEVENT_KEYDOWN;
+ addEventToQueue(trekEvent);
+ break;
+
default:
break;
}
}
+ // TODO: check for events other than "tick" more often.
if (_eventQueue.empty()) {
int delay = 1000/18.206 - (_system->getMillis() - _frameStartMillis);
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index ec3c4d0..cf1fa7f 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -51,8 +51,9 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_lutData = new byte[256 * 3];
_paletteFadeLevel = 0;
+ _mouseLocked = false;
- setMouseCursor(loadBitmap("pushbtn"));
+ setMouseBitmap(loadBitmap("pushbtn"));
CursorMan.showMouse(true);
}
@@ -180,9 +181,58 @@ Common::Point Graphics::getMousePos() {
return _vm->_system->getEventManager()->getMousePos();
}
-void Graphics::setMouseCursor(SharedPtr<Bitmap> bitmap) {
+void Graphics::setMouseBitmap(SharedPtr<Bitmap> bitmap) {
_mouseBitmap = bitmap;
_vm->_system->setMouseCursor(bitmap->pixels, bitmap->width, bitmap->height, bitmap->xoffset, bitmap->yoffset, 0);
+
+ if (_mouseLocked) {
+ _lockedMouseSprite.setBitmap(_mouseBitmap);
+ drawAllSprites(false);
+ }
+}
+
+/**
+ * This function is a workaround for when the mouse position needs to be locked in a set
+ * position (used in the action menu). This only affects the position it is drawn at; the
+ * sprite's "real" position is still updated normally.
+ *
+ * This does not call updateScreen.
+ */
+void Graphics::lockMousePosition(int16 x, int16 y) {
+ if (_mouseLocked) {
+ if (x != _lockedMouseSprite.pos.x || y != _lockedMouseSprite.pos.y) {
+ _lockedMouseSprite.pos.x = x;
+ _lockedMouseSprite.pos.y = y;
+ _lockedMouseSprite.bitmapChanged = true;
+ drawAllSprites(false);
+ }
+ return;
+ }
+
+ CursorMan.showMouse(false);
+ _mouseLocked = true;
+
+ _lockedMouseSprite = Sprite();
+ _lockedMouseSprite.setBitmap(_mouseBitmap);
+ _lockedMouseSprite.drawPriority = 15;
+ _lockedMouseSprite.drawPriority2 = 16;
+ _lockedMouseSprite.pos.x = x;
+ _lockedMouseSprite.pos.y = y;
+
+ addSprite(&_lockedMouseSprite);
+ drawAllSprites(false);
+}
+
+void Graphics::unlockMousePosition() {
+ if (!_mouseLocked)
+ return;
+
+ _mouseLocked = false;
+ CursorMan.showMouse(true);
+
+ _lockedMouseSprite.dontDrawNextFrame();
+ drawAllSprites();
+ delSprite(&_lockedMouseSprite);
}
void Graphics::drawSprite(const Sprite &sprite) {
@@ -340,14 +390,14 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
bool compareSpritesByLayer(Sprite *s1, Sprite *s2) {
if (s1->drawPriority != s2->drawPriority)
return s1->drawPriority < s2->drawPriority;
- if (s1->field6 != s2->field6)
- return s1->field6 < s2->field6;
+ if (s1->drawPriority2 != s2->drawPriority2)
+ return s1->drawPriority2 < s2->drawPriority2;
if (s1->pos.y != s2->pos.y)
return s1->pos.y < s2->pos.y;
return s1->pos.x < s2->pos.x;
}
-void Graphics::drawAllSprites() {
+void Graphics::drawAllSprites(bool updateScreen) {
// TODO: different video modes?
if (_numSprites == 0)
@@ -458,7 +508,8 @@ void Graphics::drawAllSprites() {
spr->lastDrawRect = spr->drawRect;
}
- _vm->_system->updateScreen();
+ if (updateScreen)
+ _vm->_system->updateScreen();
}
void Graphics::addSprite(Sprite *sprite) {
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 0a737f7..cba5ddf 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -67,11 +67,13 @@ public:
SharedPtr<Bitmap> loadBitmap(String basename);
Common::Point getMousePos();
- void setMouseCursor(SharedPtr<Bitmap> bitmap);
+ void setMouseBitmap(SharedPtr<Bitmap> bitmap);
+ void lockMousePosition(int16 x, int16 y);
+ void unlockMousePosition();
void drawSprite(const Sprite &sprite);
void drawSprite(const Sprite &sprite, const Common::Rect &rect);
- void drawAllSprites();
+ void drawAllSprites(bool updateScreen=true);
void addSprite(Sprite *sprite);
void delSprite(Sprite *sprite);
@@ -100,6 +102,11 @@ private:
Sprite *_sprites[MAX_SPRITES];
int _numSprites;
+ // These are used as a workaround for when the mouse position must be locked.
+ // The mouse is turned into a native game sprite when this happens.
+ bool _mouseLocked;
+ Sprite _lockedMouseSprite;
+
public:
SharedPtr<Bitmap> _mouseBitmap;
};
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index f10e784..2538c81 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -204,7 +204,7 @@ void StarTrekEngine::showOptionsMenu(int x, int y) {
Common::Point oldMousePos = _gfx->getMousePos();
SharedPtr<Bitmap> oldMouseBitmap = _gfx->_mouseBitmap;
- _gfx->setMouseCursor(_gfx->loadBitmap("options"));
+ _gfx->setMouseBitmap(_gfx->loadBitmap("options"));
loadMenuButtons("options", x, y);
uint32 disabledButtons = 0;
@@ -232,7 +232,7 @@ void StarTrekEngine::showOptionsMenu(int x, int y) {
unloadMenuButtons();
_mouseControllingShip = tmpMouseControllingShip;
- _gfx->setMouseCursor(oldMouseBitmap);
+ _gfx->setMouseBitmap(oldMouseBitmap);
if (event != MENUEVENT_LCLICK_OFFBUTTON && event != MENUEVENT_RCLICK_OFFBUTTON)
_system->warpMouse(oldMousePos.x, oldMousePos.y);
@@ -271,6 +271,262 @@ void StarTrekEngine::showOptionsMenu(int x, int y) {
}
/**
+ * Show the "action selection" menu, ie. look, talk, etc.
+ */
+int StarTrekEngine::showActionMenu() {
+ const int actionMappingUp[] = { // Actions to jump to when up is pressed
+ ACTION_TALK, // <- ACTION_WALK
+ ACTION_TALK, // <- ACTION_USE
+ ACTION_OPTIONS, // <- ACTION_GET
+ ACTION_LOOK, // <- ACTION_LOOK
+ ACTION_LOOK, // <- ACTION_TALK
+ ACTION_OPTIONS // <- ACTION_OPTIONS
+ };
+ const int actionMappingRight[] = { // Actions to jump to when right is pressed
+ ACTION_GET, // <- ACTION_WALK
+ ACTION_WALK, // <- ACTION_USE
+ ACTION_GET, // <- ACTION_GET
+ ACTION_OPTIONS, // <- ACTION_LOOK
+ ACTION_OPTIONS, // <- ACTION_TALK
+ ACTION_OPTIONS // <- ACTION_OPTIONS
+ };
+ const int actionMappingDown[] = { // Actions to jump to when down is pressed
+ ACTION_GET, // <- ACTION_WALK
+ ACTION_WALK, // <- ACTION_USE
+ ACTION_GET, // <- ACTION_GET
+ ACTION_TALK, // <- ACTION_LOOK
+ ACTION_WALK, // <- ACTION_TALK
+ ACTION_GET // <- ACTION_OPTIONS
+ };
+ const int actionMappingLeft[] = { // Actions to jump to when left is pressed
+ ACTION_USE, // <- ACTION_WALK
+ ACTION_USE, // <- ACTION_USE
+ ACTION_WALK, // <- ACTION_GET
+ ACTION_USE, // <- ACTION_LOOK
+ ACTION_USE, // <- ACTION_TALK
+ ACTION_LOOK // <- ACTION_OPTIONS
+ };
+
+ const Common::Point pos(50, 50); // Top-left position to put action menu at
+
+ // Positions to put mouse cursor at to select actions (when using arrow keys)
+ const Common::Point actionPositions[] = {
+ Common::Point(7, 21), // ACTION_USE
+ Common::Point(48, 38), // ACTION_GET
+ Common::Point(28, 5), // ACTION_LOOK
+ Common::Point(28, 14), // ACTION_TALK
+ Common::Point(45, 9) // ACTION_OPTIONS
+ };
+
+ TrekEvent event;
+ Sprite menuSprite;
+
+ bool keyboardControlledMouse = _keyboardControlsMouse;
+ Common::Point oldMousePos = _gfx->getMousePos();
+
+ bool addEventBack = false;
+ int action = ACTION_WALK;
+
+ menuSprite.bitmap = _gfx->loadBitmap("action");
+ int menuWidth = menuSprite.bitmap->width;
+ int menuHeight = menuSprite.bitmap->height;
+
+ _system->warpMouse(pos.x + menuWidth / 2, pos.y + menuHeight / 2);
+
+ _gfx->addSprite(&menuSprite);
+ menuSprite.pos = pos;
+ menuSprite.drawPriority = 15;
+
+ chooseMouseBitmapForAction(action, false);
+
+ _gfx->drawAllSprites();
+
+ menuSprite.drawPriority2 = 8;
+ bool displayMenu = true;
+
+ while (displayMenu) {
+ _sound->checkLoopMusic();
+
+ if (!popNextEvent(&event))
+ continue;
+
+ switch (event.type) {
+
+ case TREKEVENT_TICK:
+ _gfx->incPaletteFadeLevel();
+ _gfx->drawAllSprites();
+ break;
+
+ case TREKEVENT_LBUTTONDOWN:
+selectAndExit:
+ displayMenu = false;
+ addEventBack = true;
+ break;
+
+ case TREKEVENT_MOUSEMOVE:
+mousePosChanged:
+ {
+ Common::Point mouse = _gfx->getMousePos();
+ Common::Point relMouse(mouse.x - pos.x, mouse.y - pos.y);
+
+ Common::String bitmapName;
+ Common::Point lockMousePoint(-1, -1);
+
+ // Check if the mouse is hovering over one of the selectable actions
+ if (relMouse.x >= 39 && relMouse.x <= 50 && relMouse.y >= 2 && relMouse.y <= 17) {
+ action = ACTION_OPTIONS;
+ bitmapName = "options";
+ lockMousePoint = Common::Point(pos.x + 44, pos.y + 2);
+ }
+ else if (relMouse.x >= 18 && relMouse.x <= 38 && relMouse.y >= 2 && relMouse.y <= 9) {
+ action = ACTION_LOOK;
+ bitmapName = "look";
+ lockMousePoint = Common::Point(pos.x + 28, pos.y + 6);
+ }
+ else if (relMouse.x >= 18 && relMouse.x <= 38 && relMouse.y >= 11 && relMouse.y <= 17) {
+ action = ACTION_TALK;
+ bitmapName = "talk";
+ lockMousePoint = Common::Point(pos.x + 27, pos.y + 14);
+ }
+ else if (relMouse.x >= 2 && relMouse.x <= 13 && relMouse.y >= 16 && relMouse.y <= 26) {
+ action = ACTION_USE;
+ bitmapName = "use";
+ lockMousePoint = Common::Point(pos.x + 7, pos.y + 19);
+ }
+ else if (relMouse.x >= 40 && relMouse.x <= 53 && relMouse.y >= 34 && relMouse.y <= 43) {
+ action = ACTION_GET;
+ bitmapName = "get";
+ lockMousePoint = Common::Point(pos.x + 44, pos.y + 38);
+ }
+ else {
+ action = ACTION_WALK;
+ bitmapName = "walk";
+ }
+
+ _gfx->setMouseBitmap(_gfx->loadBitmap(bitmapName));
+
+ if (lockMousePoint.x != -1)
+ _gfx->lockMousePosition(lockMousePoint.x, lockMousePoint.y);
+ else
+ _gfx->unlockMousePosition();
+
+ _system->updateScreen();
+ }
+ break;
+
+ case TREKEVENT_RBUTTONDOWN:
+exitMenu:
+ displayMenu = false;
+ action = ACTION_WALK;
+ break;
+
+ case TREKEVENT_KEYDOWN: {
+ int nextAction = action;
+ const int *lookupArray;
+
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_ESCAPE:
+ case Common::KEYCODE_SPACE:
+ case Common::KEYCODE_F2: // Exit menu without selecting anything
+ goto exitMenu;
+ goto exitMenu;
+
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ case Common::KEYCODE_F1: // Exit menu with whatever is selected
+ goto selectAndExit;
+
+ case Common::KEYCODE_PAGEUP:
+ case Common::KEYCODE_KP9:
+ nextAction = ACTION_OPTIONS;
+ break;
+
+ case Common::KEYCODE_PAGEDOWN:
+ case Common::KEYCODE_KP3:
+ nextAction = ACTION_GET;
+ break;
+
+ // Direction buttons
+ case Common::KEYCODE_UP:
+ case Common::KEYCODE_KP8:
+ lookupArray = actionMappingUp;
+ goto lookupNextAction;
+
+ case Common::KEYCODE_RIGHT:
+ case Common::KEYCODE_KP6:
+ lookupArray = actionMappingRight;
+ goto lookupNextAction;
+
+ case Common::KEYCODE_DOWN:
+ case Common::KEYCODE_KP2:
+ lookupArray = actionMappingDown;
+ goto lookupNextAction;
+
+ case Common::KEYCODE_LEFT:
+ case Common::KEYCODE_KP4:
+ lookupArray = actionMappingLeft;
+ goto lookupNextAction;
+
+lookupNextAction:
+ // Use a lookup table to decide which action is next after a direction
+ // button is pressed.
+ assert((action >= ACTION_WALK && action <= ACTION_TALK) || action == ACTION_OPTIONS);
+ nextAction = lookupArray[action == ACTION_OPTIONS ? 5 : action - 1];
+ break;
+
+ default:
+ break;
+ }
+
+ if (nextAction == action)
+ break;
+
+ action = nextAction;
+
+ // Warp mouse to the position of the selected action
+ if (nextAction == ACTION_WALK)
+ _system->warpMouse(pos.x + menuWidth / 2, pos.y + menuHeight / 2);
+ else {
+ assert((action >= ACTION_WALK && action <= ACTION_TALK) || action == ACTION_OPTIONS);
+ const Common::Point &p = actionPositions[action == ACTION_OPTIONS ? 4 : action - 2];
+ _system->warpMouse(pos.x + p.x, pos.y + p.y);
+ }
+
+ goto mousePosChanged;
+ }
+
+ default:
+ break;
+ }
+ }
+
+ _gfx->unlockMousePosition();
+
+ playSoundEffectIndex(0x10);
+
+ menuSprite.dontDrawNextFrame();
+ _gfx->drawAllSprites();
+ _gfx->delSprite(&menuSprite);
+
+ if (action == ACTION_OPTIONS) {
+ showOptionsMenu(50, 50);
+ action = ACTION_WALK;
+ }
+
+ Common::Point mouse = _gfx->getMousePos();
+ if (mouse.x < pos.x || mouse.x >= pos.x + menuWidth || mouse.y < pos.y || mouse.y >= pos.y + menuHeight) {
+ if (action == ACTION_WALK && addEventBack)
+ addEventToQueue(event); // Add left-click event back to queue so Kirk can walk there
+ }
+ else
+ _system->warpMouse(oldMousePos.x, oldMousePos.y);
+
+ chooseMouseBitmapForAction(action, false);
+ _keyboardControlsMouse = keyboardControlledMouse;
+ return action;
+}
+
+/**
* Loads a .MNU file, which is a list of buttons to display.
*/
void StarTrekEngine::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
@@ -305,7 +561,7 @@ void StarTrekEngine::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
_activeMenu->sprites[i].pos.y = stream->readUint16() + ypos;
_activeMenu->retvals[i] = stream->readUint16();
- _activeMenu->sprites[i].field6 = 8;
+ _activeMenu->sprites[i].drawPriority2 = 8;
}
if (_activeMenu->retvals[_activeMenu->numButtons - 1] == 0) {
@@ -498,6 +754,73 @@ void StarTrekEngine::unloadMenuButtons() {
_keyboardControlsMouse = _keyboardControlsMouseOutsideMenu;
}
+/**
+ * Sets the mouse bitmap based on which action is selected.
+ */
+void StarTrekEngine::chooseMouseBitmapForAction(int action, bool withRedOutline) {
+ const char *lookActionBitmaps[] = {
+ "lookh0", // The "look" action randomly animates with these images
+ "lookh0",
+ "lookh0",
+ "lookh0",
+ "lookh0",
+ "lookh1",
+ "lookh2",
+ "lookh3"
+ };
+
+ Common::String bitmapName;
+
+ switch (action) {
+
+ case ACTION_USE:
+ if (withRedOutline)
+ bitmapName = "useh";
+ else
+ bitmapName = "usen";
+ break;
+
+ case ACTION_GET:
+ if (withRedOutline)
+ bitmapName = "geth";
+ else
+ bitmapName = "getn";
+ break;
+
+ case ACTION_LOOK:
+ if (withRedOutline) {
+ if ((getRandomWord() & 7) == 0)
+ _lookActionBitmapIndex = getRandomWord() & 7; // Choose an image randomly
+ bitmapName = lookActionBitmaps[_lookActionBitmapIndex];
+ }
+ else
+ bitmapName = "lookn";
+ break;
+
+ case ACTION_TALK:
+ if (withRedOutline) {
+ if (getRandomWord() & 3)
+ bitmapName = "talkh0";
+ else
+ bitmapName = "talkh1";
+ }
+ else
+ bitmapName = "talkn";
+ break;
+
+ case ACTION_OPTIONS:
+ bitmapName = "options";
+ break;
+
+ case ACTION_WALK:
+ default:
+ bitmapName = "walk";
+ break;
+ }
+
+ _gfx->setMouseBitmap(_gfx->loadBitmap(bitmapName));
+}
+
void StarTrekEngine::showSaveMenu() {
// TODO
}
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 105b3a0..45b6eb0 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -278,6 +278,11 @@ void Sound::setSfxEnabled(bool enable) {
}
}
+void Sound::checkLoopMusic() {
+ // TODO
+ // It might be better to get rid of this altogether and deal with it in callbacks...
+}
+
// XMIDI or SM sound
void Sound::loadPCMusicFile(const Common::String &baseSoundName) {
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
index 6ce4e94..7030805 100644
--- a/engines/startrek/sound.h
+++ b/engines/startrek/sound.h
@@ -63,6 +63,7 @@ public:
void stopPlayingSpeech();
void setMusicEnabled(bool enable);
void setSfxEnabled(bool enable);
+ void checkLoopMusic();
private:
StarTrekEngine *_vm;
diff --git a/engines/startrek/sprite.cpp b/engines/startrek/sprite.cpp
index ba5fa76..8c1c2f6 100644
--- a/engines/startrek/sprite.cpp
+++ b/engines/startrek/sprite.cpp
@@ -29,9 +29,13 @@ namespace StarTrek {
void Sprite::setBitmap(SharedPtr<Bitmap> b) {
bitmap = b;
- bitmapChanged = 1;
+ bitmapChanged = true;
}
+void Sprite::dontDrawNextFrame() {
+ field16 = true;
+ bitmapChanged = true;
+}
/**
* Returns a rect containing the sprite's bitmap on the screen.
*/
diff --git a/engines/startrek/sprite.h b/engines/startrek/sprite.h
index 844fb80..f2e3780 100644
--- a/engines/startrek/sprite.h
+++ b/engines/startrek/sprite.h
@@ -44,7 +44,7 @@ namespace StarTrek {
struct Sprite {
Common::Point pos;
uint16 drawPriority;
- uint16 field6;
+ uint16 drawPriority2; // If two sprites' drawPriorities are equal, this is checked.
uint16 field8;
SharedPtr<Bitmap> bitmap;
uint16 drawMode;
@@ -59,7 +59,10 @@ struct Sprite {
int16 drawX,drawY;
Sprite() { memset(this, 0, sizeof(Sprite)); }
+
void setBitmap(SharedPtr<Bitmap> b);
+ void dontDrawNextFrame();
+
Common::Rect getRect();
};
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 61c78bd..8147eca 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -43,6 +43,7 @@ namespace StarTrek {
StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gamedesc) :
Engine(syst),
_gameDescription(gamedesc),
+ _randomSource("Star Trek"),
_kirkObject(&_objectList[0]),
_spockObject(&_objectList[1]),
_mccoyObject(&_objectList[2]),
@@ -64,6 +65,8 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_sfxWorking = true;
_finishedPlayingSpeech = false;
+ _lookActionBitmapIndex = 0;
+
_mouseControllingShip = false;
_keyboardControlsMouse = true;
@@ -432,7 +435,7 @@ void StarTrekEngine::updateObjectAnimations() {
case 0: // Not walking?
case 2:
if (_frameIndex >= object->frameToStartNextAnim) {
- int nextAnimIndex = 0; // TODO: "chooseNextAnimFrame" function
+ int nextAnimIndex = getRandomWord() & 3;
object->animFile->seek(18 + nextAnimIndex + object->animFrame * 22, SEEK_SET);
byte nextAnimFrame = object->animFile->readByte();
@@ -1269,4 +1272,8 @@ void StarTrekEngine::playMovieMac(Common::String filename) {
initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT);
}
+uint16 StarTrekEngine::getRandomWord() {
+ return _randomSource.getRandomNumber(0xffff);
+}
+
} // End of namespace StarTrek
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 8031bcb..b146df8 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -26,6 +26,7 @@
#include "common/events.h"
#include "common/list.h"
#include "common/ptr.h"
+#include "common/random.h"
#include "common/rect.h"
#include "common/scummsys.h"
#include "common/str.h"
@@ -137,7 +138,7 @@ enum OptionMenuButtons {
};
enum TrekEventType {
- TREKEVENT_TICK = 0, // DOS clock changes (see updateClockTicks)
+ TREKEVENT_TICK = 0, // DOS clock changes
TREKEVENT_LBUTTONDOWN = 1,
TREKEVENT_MOUSEMOVE = 2,
TREKEVENT_LBUTTONUP = 3,
@@ -153,6 +154,8 @@ struct TrekEvent {
uint32 tick;
};
+// Commands: Signals that can be passed to "handleAwayMissionCommands" or to room-specfiic
+// code.
enum Commands {
COMMAND_TICK = 0,
COMMAND_CLICKED_ON_OBJECT = 1,
@@ -172,6 +175,16 @@ struct Command {
: type(_type), b1(_b1), b2(_b2), b3(_b3) {}
};
+// Actions that can be used on away missions.
+enum Acton {
+ ACTION_WALK = 1,
+ ACTION_USE = 2,
+ ACTION_GET = 3,
+ ACTION_LOOK = 4,
+ ACTION_TALK = 5,
+ ACTION_OPTIONS = 13 // Not really an action, but selectable from action menu
+};
+
struct StarTrekGameDescription;
class Graphics;
@@ -292,6 +305,7 @@ public:
void chooseMousePositionFromSprites(Sprite *sprites, int numSprites, int spriteIndex, int mode);
void drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color);
void showOptionsMenu(int x, int y);
+ int showActionMenu();
void loadMenuButtons(String mnuFilename, int xpos, int ypos);
void setVisibleMenuButtons(uint32 bits);
void disableMenuButtons(uint32 bits);
@@ -299,6 +313,7 @@ public:
int handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4);
void unloadMenuButtons();
+ void chooseMouseBitmapForAction(int action, bool withRedOutline);
void showSaveMenu();
void showLoadMenu();
void showQuitGamePrompt(int x, int y);
@@ -333,6 +348,9 @@ public:
void playMovie(Common::String filename);
void playMovieMac(Common::String filename);
+ // Misc
+ uint16 getRandomWord();
+
public:
int _gameMode;
@@ -355,6 +373,7 @@ public:
bool _warpHotspotsActive;
int16 _activeWarpHotspot;
int16 _activeDoorWarpHotspot;
+ int16 _lookActionBitmapIndex;
Object _objectList[MAX_OBJECTS];
Object * const _kirkObject;
@@ -393,6 +412,8 @@ public:
Sound *_sound;
private:
+ Common::RandomSource _randomSource;
+
Common::MacResManager *_macResFork;
SharedPtr<Room> _room;
SharedPtr<IWFile> _iwFile;
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index fed047e..ed060c7 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -250,7 +250,7 @@ int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset
SharedPtr<Bitmap> oldMouseBitmap = _gfx->_mouseBitmap;
_system->warpMouse(xoffset + 0xde, yoffset - 0x08);
- _gfx->setMouseCursor(_gfx->loadBitmap("pushbtn"));
+ _gfx->setMouseBitmap(_gfx->loadBitmap("pushbtn"));
bool tmpMouseControllingShip = _mouseControllingShip;
_mouseControllingShip = false;
@@ -398,7 +398,7 @@ reloadText:
}
}
- _gfx->setMouseCursor(oldMouseBitmap);
+ _gfx->setMouseBitmap(oldMouseBitmap);
_system->warpMouse(oldMousePos.x, oldMousePos.y);
_mouseControllingShip = tmpMouseControllingShip;
@@ -471,7 +471,7 @@ SharedPtr<TextBitmap> StarTrekEngine::initTextSprite(int *xoffsetPtr, int *yoffs
memset(sprite, 0, sizeof(Sprite));
sprite->drawPriority = 15;
- sprite->field6 = 8;
+ sprite->drawPriority2 = 8;
sprite->bitmap = bitmap;
sprite->textColor = textColor;
Commit: 01970f43dfa90159be82cbcf4828c4bc88e8901f
https://github.com/scummvm/scummvm/commit/01970f43dfa90159be82cbcf4828c4bc88e8901f
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fix draw priority of menus
Changed paths:
engines/startrek/menu.cpp
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index 2538c81..da5b11e 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -561,6 +561,7 @@ void StarTrekEngine::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
_activeMenu->sprites[i].pos.y = stream->readUint16() + ypos;
_activeMenu->retvals[i] = stream->readUint16();
+ _activeMenu->sprites[i].drawPriority = 15;
_activeMenu->sprites[i].drawPriority2 = 8;
}
Commit: edcc80393ab6be8dc946b99d7fdc5132cdbfaaa9
https://github.com/scummvm/scummvm/commit/edcc80393ab6be8dc946b99d7fdc5132cdbfaaa9
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Tweak events to update mouse more often
Changed paths:
engines/startrek/events.cpp
engines/startrek/graphics.cpp
diff --git a/engines/startrek/events.cpp b/engines/startrek/events.cpp
index 58c2666..b80659c 100644
--- a/engines/startrek/events.cpp
+++ b/engines/startrek/events.cpp
@@ -23,67 +23,77 @@
namespace StarTrek {
+/**
+ * Doesn't return until an event occurs.
+ */
void StarTrekEngine::pollSystemEvents() {
Common::Event event;
TrekEvent trekEvent;
- while (_eventMan->pollEvent(event)) {
- trekEvent.mouse = event.mouse;
- trekEvent.kbd = event.kbd;
-
- switch (event.type) {
- case Common::EVENT_QUIT:
- _system->quit();
- break;
-
- case Common::EVENT_MOUSEMOVE:
- trekEvent.type = TREKEVENT_MOUSEMOVE;
- addEventToQueue(trekEvent);
- break;
-
- case Common::EVENT_LBUTTONDOWN:
- // TODO: what happens when mouse click is outside normal screen bounds?
- // (apparently this can happen)
- trekEvent.type = TREKEVENT_LBUTTONDOWN;
- addEventToQueue(trekEvent);
- break;
-
- case Common::EVENT_RBUTTONDOWN:
- trekEvent.type = TREKEVENT_RBUTTONDOWN;
- addEventToQueue(trekEvent);
- break;
-
- case Common::EVENT_KEYDOWN:
- trekEvent.type = TREKEVENT_KEYDOWN;
- addEventToQueue(trekEvent);
- break;
-
- default:
- break;
+ while (_eventQueue.empty()) {
+ while (_eventMan->pollEvent(event)) {
+ trekEvent.mouse = event.mouse;
+ trekEvent.kbd = event.kbd;
+
+ switch (event.type) {
+ case Common::EVENT_QUIT:
+ _system->quit();
+ break;
+
+ case Common::EVENT_MOUSEMOVE:
+ trekEvent.type = TREKEVENT_MOUSEMOVE;
+ addEventToQueue(trekEvent);
+
+ // WORKAROUND: this improves the responsiveness of the mouse.
+ _system->updateScreen();
+ break;
+
+ case Common::EVENT_LBUTTONDOWN:
+ // TODO: what happens when mouse click is outside normal screen bounds?
+ // (apparently this can happen)
+ trekEvent.type = TREKEVENT_LBUTTONDOWN;
+ addEventToQueue(trekEvent);
+ break;
+
+ case Common::EVENT_RBUTTONDOWN:
+ trekEvent.type = TREKEVENT_RBUTTONDOWN;
+ addEventToQueue(trekEvent);
+ break;
+
+ case Common::EVENT_KEYDOWN:
+ trekEvent.type = TREKEVENT_KEYDOWN;
+ addEventToQueue(trekEvent);
+ break;
+
+ default:
+ break;
+ }
}
- }
- // TODO: check for events other than "tick" more often.
- if (_eventQueue.empty()) {
- int delay = 1000/18.206 - (_system->getMillis() - _frameStartMillis);
+ // Check for tick event
+ uint nextFrame = _frameStartMillis + 1000 / 18.206;
- _clockTicks++;
- if (delay < 0)
- debug(5, "Late frame");
- while (delay < 0) { // Check if we're behind...
- delay += 1000/18.206;
+ if (_system->getMillis() >= nextFrame) {
_clockTicks++;
+
+ _frameStartMillis = _system->getMillis();
+
+ TrekEvent tickEvent;
+ tickEvent.type = TREKEVENT_TICK;
+ tickEvent.tick = _clockTicks;
+ addEventToQueue(tickEvent);
}
- _system->delayMillis(delay);
- _frameStartMillis = _system->getMillis();
+ if (!_eventQueue.empty())
+ break;
- TrekEvent tickEvent;
- tickEvent.type = TREKEVENT_TICK;
- tickEvent.tick = _clockTicks;
- addEventToQueue(tickEvent);
+ // Wait a 60th of a second before checking for events again
+ uint delay = 1000 / 60;
+ if (_system->getMillis() + delay > nextFrame)
+ delay = nextFrame - _system->getMillis();
+ if (delay > 0)
+ _system->delayMillis(delay);
}
-
}
void StarTrekEngine::initializeEventsAndMouse() {
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index cf1fa7f..8142c4d 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -89,7 +89,8 @@ void Graphics::fadeinScreen() {
while (_paletteFadeLevel <= 100) {
TrekEvent event;
do {
- _vm->popNextEvent(&event);
+ if (!_vm->popNextEvent(&event))
+ continue;
}
while (event.type != TREKEVENT_TICK);
@@ -104,7 +105,8 @@ void Graphics::fadeoutScreen() {
while (_paletteFadeLevel >= 0) {
TrekEvent event;
do {
- _vm->popNextEvent(&event);
+ if (!_vm->popNextEvent(&event))
+ continue;
}
while (event.type != TREKEVENT_TICK);
Commit: 02485484c31bee3101ecd3ac7ccb86e2db7b029b
https://github.com/scummvm/scummvm/commit/02485484c31bee3101ecd3ac7ccb86e2db7b029b
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Buffer all changes to the mouse bitmap
Changed paths:
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/menu.cpp
engines/startrek/text.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 8142c4d..a51999e 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -52,6 +52,10 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_paletteFadeLevel = 0;
_mouseLocked = false;
+ _mouseToBeShown = false;
+ _mouseToBeHidden = false;
+ _mouseWarpX = -1;
+ _mouseWarpY = -1;
setMouseBitmap(loadBitmap("pushbtn"));
CursorMan.showMouse(true);
@@ -180,17 +184,21 @@ SharedPtr<Bitmap> Graphics::loadBitmap(Common::String basename) {
}
Common::Point Graphics::getMousePos() {
+ if (_mouseWarpX != -1)
+ return Common::Point(_mouseWarpX, _mouseWarpY);
+
return _vm->_system->getEventManager()->getMousePos();
}
+/**
+ * The change to the mouse's bitmap won't take effect until drawAllSprites is called
+ * again.
+ */
void Graphics::setMouseBitmap(SharedPtr<Bitmap> bitmap) {
_mouseBitmap = bitmap;
- _vm->_system->setMouseCursor(bitmap->pixels, bitmap->width, bitmap->height, bitmap->xoffset, bitmap->yoffset, 0);
- if (_mouseLocked) {
+ if (_mouseLocked)
_lockedMouseSprite.setBitmap(_mouseBitmap);
- drawAllSprites(false);
- }
}
/**
@@ -206,13 +214,13 @@ void Graphics::lockMousePosition(int16 x, int16 y) {
_lockedMouseSprite.pos.x = x;
_lockedMouseSprite.pos.y = y;
_lockedMouseSprite.bitmapChanged = true;
- drawAllSprites(false);
}
return;
}
- CursorMan.showMouse(false);
_mouseLocked = true;
+ _mouseToBeHidden = true;
+ _mouseToBeShown = false;
_lockedMouseSprite = Sprite();
_lockedMouseSprite.setBitmap(_mouseBitmap);
@@ -222,7 +230,6 @@ void Graphics::lockMousePosition(int16 x, int16 y) {
_lockedMouseSprite.pos.y = y;
addSprite(&_lockedMouseSprite);
- drawAllSprites(false);
}
void Graphics::unlockMousePosition() {
@@ -230,13 +237,23 @@ void Graphics::unlockMousePosition() {
return;
_mouseLocked = false;
- CursorMan.showMouse(true);
+ _mouseToBeShown = true;
+ _mouseToBeHidden = false;
_lockedMouseSprite.dontDrawNextFrame();
- drawAllSprites();
+ drawAllSprites(false);
delSprite(&_lockedMouseSprite);
}
+SharedPtr<Bitmap> Graphics::getMouseBitmap() {
+ return _mouseBitmap;
+}
+
+void Graphics::warpMouse(int16 x, int16 y) {
+ _mouseWarpX = x;
+ _mouseWarpY = y;
+}
+
void Graphics::drawSprite(const Sprite &sprite) {
int left = sprite.drawX;
int top = sprite.drawY;
@@ -510,8 +527,29 @@ void Graphics::drawAllSprites(bool updateScreen) {
spr->lastDrawRect = spr->drawRect;
}
- if (updateScreen)
+ if (updateScreen) {
+ // Check if there are any pending updates to the mouse.
+ if (_mouseBitmap != _mouseBitmapLastFrame) {
+ _mouseBitmapLastFrame = _mouseBitmap;
+ _vm->_system->setMouseCursor(_mouseBitmap->pixels, _mouseBitmap->width, _mouseBitmap->height, _mouseBitmap->xoffset, _mouseBitmap->yoffset, 0);
+ }
+ if (_mouseToBeShown) {
+ CursorMan.showMouse(true);
+ _mouseToBeShown = false;
+ }
+ else if (_mouseToBeHidden) {
+ CursorMan.showMouse(false);
+ _mouseToBeHidden = false;
+ }
+
+ if (_mouseWarpX != -1) {
+ _vm->_system->warpMouse(_mouseWarpX, _mouseWarpY);
+ _mouseWarpX = -1;
+ _mouseWarpY = -1;
+ }
+
_vm->_system->updateScreen();
+ }
}
void Graphics::addSprite(Sprite *sprite) {
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index cba5ddf..f58e444 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -70,6 +70,8 @@ public:
void setMouseBitmap(SharedPtr<Bitmap> bitmap);
void lockMousePosition(int16 x, int16 y);
void unlockMousePosition();
+ SharedPtr<Bitmap> getMouseBitmap();
+ void warpMouse(int16 x, int16 y);
void drawSprite(const Sprite &sprite);
void drawSprite(const Sprite &sprite, const Common::Rect &rect);
@@ -102,13 +104,21 @@ private:
Sprite *_sprites[MAX_SPRITES];
int _numSprites;
+ // Any changes to the mouse image are buffered until the next time "drawAllSprites" is
+ // called (since the original game treats it like a sprite).
+ bool _mouseToBeShown;
+ bool _mouseToBeHidden;
+ int16 _mouseWarpX, _mouseWarpY;
+ SharedPtr<Bitmap> _mouseBitmapLastFrame;
+ SharedPtr<Bitmap> _mouseBitmap;
+
// These are used as a workaround for when the mouse position must be locked.
// The mouse is turned into a native game sprite when this happens.
bool _mouseLocked;
Sprite _lockedMouseSprite;
+
public:
- SharedPtr<Bitmap> _mouseBitmap;
};
}
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index da5b11e..acd4154 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -165,7 +165,7 @@ void StarTrekEngine::chooseMousePositionFromSprites(Sprite *sprites, int numSpri
mousePos.y = mouseY2;
}
- _system->warpMouse(mousePos.x, mousePos.y);
+ _gfx->warpMouse(mousePos.x, mousePos.y);
}
@@ -202,7 +202,7 @@ void StarTrekEngine::showOptionsMenu(int x, int y) {
_mouseControllingShip = false;
Common::Point oldMousePos = _gfx->getMousePos();
- SharedPtr<Bitmap> oldMouseBitmap = _gfx->_mouseBitmap;
+ SharedPtr<Bitmap> oldMouseBitmap = _gfx->getMouseBitmap();
_gfx->setMouseBitmap(_gfx->loadBitmap("options"));
loadMenuButtons("options", x, y);
@@ -235,7 +235,7 @@ void StarTrekEngine::showOptionsMenu(int x, int y) {
_gfx->setMouseBitmap(oldMouseBitmap);
if (event != MENUEVENT_LCLICK_OFFBUTTON && event != MENUEVENT_RCLICK_OFFBUTTON)
- _system->warpMouse(oldMousePos.x, oldMousePos.y);
+ _gfx->warpMouse(oldMousePos.x, oldMousePos.y);
// Can't use OPTIONBUTTON constants since the button retvals differ from the button
@@ -331,7 +331,7 @@ int StarTrekEngine::showActionMenu() {
int menuWidth = menuSprite.bitmap->width;
int menuHeight = menuSprite.bitmap->height;
- _system->warpMouse(pos.x + menuWidth / 2, pos.y + menuHeight / 2);
+ _gfx->warpMouse(pos.x + menuWidth / 2, pos.y + menuHeight / 2);
_gfx->addSprite(&menuSprite);
menuSprite.pos = pos;
@@ -409,8 +409,6 @@ mousePosChanged:
_gfx->lockMousePosition(lockMousePoint.x, lockMousePoint.y);
else
_gfx->unlockMousePosition();
-
- _system->updateScreen();
}
break;
@@ -485,11 +483,11 @@ lookupNextAction:
// Warp mouse to the position of the selected action
if (nextAction == ACTION_WALK)
- _system->warpMouse(pos.x + menuWidth / 2, pos.y + menuHeight / 2);
+ _gfx->warpMouse(pos.x + menuWidth / 2, pos.y + menuHeight / 2);
else {
assert((action >= ACTION_WALK && action <= ACTION_TALK) || action == ACTION_OPTIONS);
const Common::Point &p = actionPositions[action == ACTION_OPTIONS ? 4 : action - 2];
- _system->warpMouse(pos.x + p.x, pos.y + p.y);
+ _gfx->warpMouse(pos.x + p.x, pos.y + p.y);
}
goto mousePosChanged;
@@ -500,14 +498,14 @@ lookupNextAction:
}
}
- _gfx->unlockMousePosition();
-
playSoundEffectIndex(0x10);
menuSprite.dontDrawNextFrame();
_gfx->drawAllSprites();
_gfx->delSprite(&menuSprite);
+ _gfx->unlockMousePosition();
+
if (action == ACTION_OPTIONS) {
showOptionsMenu(50, 50);
action = ACTION_WALK;
@@ -519,7 +517,7 @@ lookupNextAction:
addEventToQueue(event); // Add left-click event back to queue so Kirk can walk there
}
else
- _system->warpMouse(oldMousePos.x, oldMousePos.y);
+ _gfx->warpMouse(oldMousePos.x, oldMousePos.y);
chooseMouseBitmapForAction(action, false);
_keyboardControlsMouse = keyboardControlledMouse;
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index ed060c7..239e4f5 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -247,9 +247,9 @@ int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset
loadMenuButtons("textbtns", xoffset + 0x96, yoffset - 0x11);
Common::Point oldMousePos = _gfx->getMousePos();
- SharedPtr<Bitmap> oldMouseBitmap = _gfx->_mouseBitmap;
+ SharedPtr<Bitmap> oldMouseBitmap = _gfx->getMouseBitmap();
- _system->warpMouse(xoffset + 0xde, yoffset - 0x08);
+ _gfx->warpMouse(xoffset + 0xde, yoffset - 0x08);
_gfx->setMouseBitmap(_gfx->loadBitmap("pushbtn"));
bool tmpMouseControllingShip = _mouseControllingShip;
@@ -399,7 +399,7 @@ reloadText:
}
_gfx->setMouseBitmap(oldMouseBitmap);
- _system->warpMouse(oldMousePos.x, oldMousePos.y);
+ _gfx->warpMouse(oldMousePos.x, oldMousePos.y);
_mouseControllingShip = tmpMouseControllingShip;
unloadMenuButtons();
Commit: 6117a8919432e7223f3e263f7d9c2f84840f76b9
https://github.com/scummvm/scummvm/commit/6117a8919432e7223f3e263f7d9c2f84840f76b9
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Inventory menu and hotspots
Action buttons now react when hovering over hotspots.
Changed paths:
A engines/startrek/items.h
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/menu.cpp
engines/startrek/room.h
engines/startrek/sprite.cpp
engines/startrek/sprite.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index aba01c0..ae05485 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -157,7 +157,7 @@ void StarTrekEngine::handleAwayMissionEvents() {
case TREKEVENT_TICK:
updateObjectAnimations();
// sub_236bb();
- // sub_2325d();
+ updateMouseBitmap();
// doSomethingWithBanData1();
_gfx->drawAllSprites();
// doSomethingWithBanData2();
@@ -169,11 +169,13 @@ void StarTrekEngine::handleAwayMissionEvents() {
if (_roomFrameCounter >= 2)
_gfx->incPaletteFadeLevel();
break;
+
case TREKEVENT_LBUTTONDOWN:
if (_awayMission.transitioningIntoRoom != 0)
break;
+
switch (_awayMission.activeAction) {
- case 1:
+ case ACTION_WALK:
if (_awayMission.field1c == 0) {
_kirkObject->sprite.drawMode = 1; // Hide these objects for function call below?
_spockObject->sprite.drawMode = 1;
@@ -193,7 +195,33 @@ void StarTrekEngine::handleAwayMissionEvents() {
objectWalkToPosition(0, animFilename, _kirkObject->pos.x, _kirkObject->pos.y, mousePos.x, mousePos.y);
}
break;
- case 2:
+
+ case ACTION_USE:
+ if (_awayMission.activeItem != OBJECT_REDSHIRT
+ || (!_awayMission.redshirtDead && !(_awayMission.field24 & 8))) {
+ int clickedObject = findObjectAt(_gfx->getMousePos());
+ hideInventoryIcons();
+
+ if (clickedObject == OBJECT_INVENTORY_ICON)
+ clickedObject = showInventoryMenu(50, 50, false);
+
+ if (clickedObject == -1)
+ clickedObject = -2;
+
+ _awayMission.passiveItem = clickedObject;
+ if (clickedObject != -2) {
+ // TODO
+ }
+
+ // if (!sub_2330c()) // TODO
+ {
+ if (clickedObject != -2)
+ addCommand(Command(_awayMission.activeAction, _awayMission.activeItem, _awayMission.passiveItem, 0));
+
+ if (!(_awayMission.field24 & 1))
+ showInventoryIcons(true);
+ }
+ }
break;
case 3:
break;
@@ -203,37 +231,39 @@ void StarTrekEngine::handleAwayMissionEvents() {
break;
}
break;
+
case TREKEVENT_MOUSEMOVE:
break;
+
case TREKEVENT_RBUTTONDOWN: // TODO: also triggered by key press?
- /*
if (_awayMission.field1d)
break;
- */
- //sub_2394b();
+ hideInventoryIcons();
playSoundEffectIndex(0x07);
_awayMission.activeAction = showActionMenu();
- /*
- if (awayMission.activeAction == ACTION_USE) {
+ if (_awayMission.activeAction == ACTION_USE) {
+ /*
int16 clickedObject = sub_22f08();
if (clickedObject == -1)
break;
else
- _awayMission.field20 = clickedObject;
+ _awayMission.activeItem = clickedObject;
+ */
}
if (_awayMission.activeAction == ACTION_USE
- && _awayMission.field20 == 0x47 && (_awayMission.field24 & 1) == 0) {
+ && _awayMission.activeItem == 0x47 && (_awayMission.field24 & 1) == 0) {
+ /*
if (sub_2330c() == 0) {
- addCommand(Command(_awayMission.activeAction, _awayMission.field20, 0, 0));
+ addCommand(Command(_awayMission.activeAction, _awayMission.activeItem, 0, 0));
_sound->playVoc("communic");
_awayMission.activeAction = ACTION_WALK;
}
+ */
}
else if (_awayMission.activeAction == ACTION_LOOK)
- sub_2383a(0);
+ showInventoryIcons(false);
else if (_awayMission.activeAction == ACTION_USE && (_awayMission.field24 & 1) == 0)
- sub_2383a(1);
- */
+ showInventoryIcons(true);
break;
case TREKEVENT_KEYDOWN:
break;
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index cb5dfed..c759603 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -32,7 +32,8 @@ struct AwayMission {
byte transitioningIntoRoom; // Set while beaming in or walking into a room
bool redshirtDead;
byte activeAction;
- byte field20;
+ byte activeItem; // The item that is going to be used on something
+ byte passiveItem; // The item that the active item is used on (or the item looked at, etc).
byte field24;
int8 field25[4];
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index a51999e..e33fa51 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -552,6 +552,34 @@ void Graphics::drawAllSprites(bool updateScreen) {
}
}
+/**
+ * Returns the sprite at the given position (ignores mouse).
+ */
+Sprite *Graphics::getSpriteAt(int16 x, int16 y) {
+ for (int i = _numSprites - 1; i >= 0; i--) {
+ Sprite *sprite = _sprites[i];
+
+ if (sprite == &_lockedMouseSprite)
+ continue;
+ if (sprite->drawMode == 1) // Invisible
+ continue;
+
+ if (sprite->drawRect.contains(Common::Point(x, y))) {
+ if (sprite->drawMode == 2 || sprite->drawMode == 3) // Button or text
+ return sprite;
+
+ // For draw mode 0 only, check that we're not clicking on a transparent part.
+ int16 relX = x - sprite->drawX;
+ int16 relY = y - sprite->drawY;
+ byte pixel = sprite->bitmap->pixels[relY * sprite->bitmap->width + relX];
+ if (pixel != 0)
+ return sprite;
+ }
+ }
+
+ return nullptr;
+}
+
void Graphics::addSprite(Sprite *sprite) {
if (_numSprites >= MAX_SPRITES)
error("addSprite: too many sprites");
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index f58e444..5c09cfa 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -76,6 +76,7 @@ public:
void drawSprite(const Sprite &sprite);
void drawSprite(const Sprite &sprite, const Common::Rect &rect);
void drawAllSprites(bool updateScreen=true);
+ Sprite *getSpriteAt(int16 x, int16 y);
void addSprite(Sprite *sprite);
void delSprite(Sprite *sprite);
diff --git a/engines/startrek/items.h b/engines/startrek/items.h
new file mode 100644
index 0000000..6ef69cf
--- /dev/null
+++ b/engines/startrek/items.h
@@ -0,0 +1,184 @@
+/* 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.
+ *
+ */
+
+#ifndef STARTREK_ITEMS_H
+#define STARTREK_ITEMS_H
+
+namespace StarTrek {
+
+struct Item {
+ bool have;
+ int16 field2;
+ char name[10];
+ int16 index;
+};
+
+// This is copied to StarTrekEngine::_itemList when the engine initializes.
+// (TODO: it's possible that only the "have" variable ever changes, in which case the
+// whole thing doesn't need to be copied.)
+const Item g_itemList[] = {
+ { true, 0x40, "iphasers", 0x00 },
+ { true, 0x41, "iphaserk", 0x01 },
+ { false, 0x42, "ihand", 0x02 },
+ { false, 0x43, "irock", 0x03 },
+ { true, 0x44, "istricor", 0x04 },
+ { true, 0x45, "imtricor", 0x05 },
+ { false, 0x46, "ideadguy", 0x06 },
+ { true, 0x47, "icomm", 0x07 },
+ { false, 0x48, "ipbc", 0x08 },
+ { false, 0x49, "iRLG", 0x09 },
+ { false, 0x4A, "iWrench", 0x0A },
+ { false, 0x4B, "iInsulat", 0x0B },
+ { false, 0x4C, "iSample", 0x0C },
+ { false, 0x4D, "iCure", 0x0D },
+ { false, 0x4E, "iDishes", 0x0E },
+ { false, 0x4F, "iRT", 0x0F },
+ { false, 0x50, "iRTWB", 0x10 },
+ { false, 0x51, "iCombBit", 0x11 },
+ { false, 0x52, "iJnkmetl", 0x12 },
+ { false, 0x53, "iWiring", 0x13 },
+ { false, 0x54, "iWirscrp", 0x14 },
+ { false, 0x55, "iPWF", 0x15 },
+ { false, 0x56, "iPWE", 0x16 },
+ { false, 0x57, "iDeadPh", 0x17 },
+ { false, 0x58, "iBomb", 0x18 },
+ { false, 0x59, "iMetal", 0x19 },
+ { false, 0x5A, "iSkull", 0x1A },
+ { false, 0x5B, "iMineral", 0x1B },
+ { false, 0x5C, "iMeteor", 0x1C },
+ { false, 0x5D, "iShells", 0x1D },
+ { false, 0x5E, "iDeGrime", 0x1E },
+ { false, 0x5F, "iLenses", 0x1F },
+ { false, 0x60, "iDisks", 0x20 },
+ { false, 0x61, "iAntigra", 0x21 },
+ { false, 0x62, "iN2gas", 0x22 },
+ { false, 0x63, "iO2gas", 0x23 },
+ { false, 0x64, "iH2gas", 0x24 },
+ { false, 0x65, "iN2O", 0x25 },
+ { false, 0x66, "iNH3", 0x26 },
+ { false, 0x67, "iH2O", 0x27 },
+ { false, 0x68, "iWRod", 0x28 },
+ { false, 0x69, "iIRod", 0x29 },
+ { false, 0x6A, "iRedGem", 0x2A },
+ { false, 0x6B, "iRedGem", 0x2B },
+ { false, 0x6C, "iRedGem", 0x2C },
+ { false, 0x6D, "iGrnGem", 0x2D },
+ { false, 0x6E, "iGrnGem", 0x2E },
+ { false, 0x6F, "iGrnGem", 0x2F },
+ { false, 0x70, "iBluGem", 0x30 },
+ { false, 0x71, "iBluGem", 0x31 },
+ { false, 0x72, "iBluGem", 0x32 },
+ { false, 0x73, "iConect", 0x33 },
+ { false, 0x74, "iS8Rocks", 0x34 },
+ { false, 0x75, "iIDCard", 0x35 },
+ { false, 0x76, "iSnake", 0x36 },
+ { false, 0x77, "iFern", 0x37 },
+ { false, 0x78, "iCrystal", 0x38 },
+ { false, 0x79, "iKnife", 0x39 },
+ { false, 0x7A, "idetoxin", 0x3A },
+ { false, 0x7B, "iberry", 0x3B },
+ { false, 0x7C, "idoover", 0x3C },
+ { false, 0x7D, "ialiendv", 0x3D },
+ { false, 0x7E, "icapsule", 0x3E },
+ { true, 0x7F, "imedkit", 0x3F },
+ { false, 0x80, "iBeam", 0x40 },
+ { false, 0x81, "iDrill", 0x41 },
+ { false, 0x82, "iHypo", 0x42 },
+ { false, 0x83, "iFusion", 0x43 },
+ { false, 0x84, "iCable1", 0x44 },
+ { false, 0x85, "iCable2", 0x45 },
+ { false, 0x86, "iLMD", 0x46 },
+ { false, 0x87, "iDeck", 0x47 },
+ { false, 0x88, "iTech", 0x48 },
+
+ // 64 blank rows?
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 },
+};
+
+const int NUM_ITEMS = sizeof(g_itemList) / sizeof(struct Item);
+
+}
+
+#endif
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index acd4154..50661be 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -31,9 +31,9 @@ namespace StarTrek {
/**
* Returns the index of the button at the given position, or -1 if none.
*/
-int StarTrekEngine::getMenuButtonAt(const Menu &menu, int x, int y) {
- for (int i = 0; i < menu.numButtons; i++) {
- const Sprite &spr = menu.sprites[i];
+int StarTrekEngine::getMenuButtonAt(Sprite *sprites, int numSprites, int x, int y) {
+ for (int i = 0; i < numSprites; i++) {
+ const Sprite &spr = sprites[i];
if (spr.drawMode != 2)
continue;
@@ -130,7 +130,6 @@ void StarTrekEngine::chooseMousePositionFromSprites(Sprite *sprites, int numSpri
&& (mouseX1 == 0x7fff || vCenter >= mouseY1)) {
mouseX1 = hCenter;
mouseY1 = vCenter;
- debug("Try %d %d", mouseX1, mouseY1);
}
if (mouseX2 == 0x7fff || vCenter > mouseY2
|| (hCenter == mouseX2 && vCenter == mouseY2)) {
@@ -656,7 +655,7 @@ int StarTrekEngine::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4
case TREKEVENT_TICK: {
case TREKEVENT_MOUSEMOVE: // FIXME: actual game only uses TICK event here
Common::Point mousePos = _gfx->getMousePos();
- int buttonIndex = getMenuButtonAt(*_activeMenu, mousePos.x, mousePos.y);
+ int buttonIndex = getMenuButtonAt(_activeMenu->sprites, _activeMenu->numButtons, mousePos.x, mousePos.y);
if (buttonIndex != -1) {
if (_activeMenu->disabledButtons & (1<<buttonIndex))
buttonIndex = -1;
@@ -704,7 +703,7 @@ int StarTrekEngine::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4
}
else {
Common::Point mouse = _gfx->getMousePos();
- if (getMenuButtonAt(*_activeMenu, mouse.x, mouse.y) == -1) {
+ if (getMenuButtonAt(_activeMenu->sprites, _activeMenu->numButtons, mouse.x, mouse.y) == -1) {
playSoundEffectIndex(0x10);
return MENUEVENT_LCLICK_OFFBUTTON;
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index e9bbbd0..b6a69c3 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -50,16 +50,19 @@ public:
uint16 readRdfWord(int offset);
// Scale-related stuff (rename these later)
- int16 getVar06() { return readRdfWord(0x06); }
- int16 getVar08() { return readRdfWord(0x08); }
- int16 getVar0a() { return readRdfWord(0x0a); }
- int16 getVar0c() { return readRdfWord(0x0c); }
+ uint16 getVar06() { return readRdfWord(0x06); }
+ uint16 getVar08() { return readRdfWord(0x08); }
+ uint16 getVar0a() { return readRdfWord(0x0a); }
+ uint16 getVar0c() { return readRdfWord(0x0c); }
+
+ uint16 getFirstHotspot() { return readRdfWord(0x12); }
+ uint16 getHotspotEnd() { return readRdfWord(0x14); }
// Warp-related stuff
- int16 getFirstWarpPolygonOffset() { return readRdfWord(0x16); }
- int16 getWarpPolygonEndOffset() { return readRdfWord(0x18); }
- int16 getFirstDoorPolygonOffset() { return readRdfWord(0x1a); }
- int16 getDoorPolygonEndOffset() { return readRdfWord(0x1c); }
+ uint16 getFirstWarpPolygonOffset() { return readRdfWord(0x16); }
+ uint16 getWarpPolygonEndOffset() { return readRdfWord(0x18); }
+ uint16 getFirstDoorPolygonOffset() { return readRdfWord(0x1a); }
+ uint16 getDoorPolygonEndOffset() { return readRdfWord(0x1c); }
Common::Point getBeamInPosition(int crewmanIndex);
diff --git a/engines/startrek/sprite.cpp b/engines/startrek/sprite.cpp
index 8c1c2f6..5804475 100644
--- a/engines/startrek/sprite.cpp
+++ b/engines/startrek/sprite.cpp
@@ -18,15 +18,31 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/graphics.h $
- * $Id: graphics.h 2 2009-09-12 20:13:40Z clone2727 $
- *
*/
#include "startrek/sprite.h"
namespace StarTrek {
+Sprite::Sprite() :
+ pos(),
+ drawPriority(),
+ drawPriority2(),
+ field8(),
+ bitmap(),
+ drawMode(),
+ textColor(),
+ bitmapChanged(),
+ rect2Valid(),
+ isOnScreen(),
+ field16(),
+ lastDrawRect(),
+ drawRect(),
+ rectangle2(),
+ drawX(),
+ drawY()
+ {}
+
void Sprite::setBitmap(SharedPtr<Bitmap> b) {
bitmap = b;
bitmapChanged = true;
diff --git a/engines/startrek/sprite.h b/engines/startrek/sprite.h
index f2e3780..ce53372 100644
--- a/engines/startrek/sprite.h
+++ b/engines/startrek/sprite.h
@@ -58,7 +58,7 @@ struct Sprite {
Common::Rect rectangle2;
int16 drawX,drawY;
- Sprite() { memset(this, 0, sizeof(Sprite)); }
+ Sprite();
void setBitmap(SharedPtr<Bitmap> b);
void dontDrawNextFrame();
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 8147eca..02c80ef 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -78,6 +78,9 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_missionToLoad = "DEMON";
_roomIndexToLoad = 0;
+
+ for (int i = 0; i < NUM_ITEMS; i++)
+ _itemList[i] = g_itemList[i];
}
StarTrekEngine::~StarTrekEngine() {
@@ -805,6 +808,56 @@ bool StarTrekEngine::directPathExists(int16 srcX, int16 srcY, int16 destX, int16
return true;
}
+int StarTrekEngine::findObjectAt(int x, int y) {
+ Sprite *sprite = _gfx->getSpriteAt(x, y);
+
+ if (sprite != nullptr) {
+ if (sprite == &_inventoryIconSprite)
+ return OBJECT_INVENTORY_ICON;
+ else if (sprite == &_itemIconSprite)
+ return _awayMission.activeItem;
+
+ for (int i = 0; i < MAX_OBJECTS; i++) {
+ Object *object = &_objectList[i];
+ if (sprite == &object->sprite)
+ return i;
+ }
+
+ error("findObject: Clicked on an unknown sprite");
+ }
+
+ // word_4b418 = 0;
+ int actionBit = 1 << (_awayMission.activeAction - 1);
+ int offset = _room->getFirstHotspot();
+
+ while (offset != _room->getHotspotEnd()) {
+ uint16 word = _room->readRdfWord(offset);
+ if (word & 0x8000) {
+ if ((word & actionBit) && isPointInPolygon((int16 *)(_room->_rdfData + offset + 6), x, y)) {
+ int objectIndex = _room->readRdfWord(offset + 6);
+ // word_4b418 = 1;
+ // word_4a792 = _room->readRdfWord(offset + 2);
+ // word_4a796 = _room->readRdfWord(offset + 4);
+ return objectIndex;
+ }
+
+ int numVertices = _room->readRdfWord(offset + 8);
+ offset = offset + 10 + numVertices * 4;
+ }
+ else {
+ if (isPointInPolygon((int16 *)(_room->_rdfData + offset), x, y)) {
+ int objectIndex = _room->readRdfWord(offset);
+ return objectIndex;
+ }
+
+ int numVertices = _room->readRdfWord(offset + 2);
+ offset = offset + 4 + numVertices * 4;
+ }
+ }
+
+ return -1;
+}
+
/**
* Loads a bitmap for the animation frame with the given scale.
*/
@@ -911,6 +964,279 @@ Common::String StarTrekEngine::getCrewmanAnimFilename(int objectIndex, const Com
}
/**
+ * Checks whether to change the mouse bitmap to have the red outline.
+ */
+void StarTrekEngine::updateMouseBitmap() {
+ const bool worksOnCrewmen[] = { // True if the action reacts with crewmen
+ false, // ACTION_WALK
+ true, // ACTION_USE
+ false, // ACTION_GET
+ true, // ACTION_LOOK
+ true // ACTION_TALK
+ };
+ const bool worksOnObjects[] = { // True if the action reacts with other objects
+ false, // ACTION_WALK
+ true, // ACTION_USE
+ true, // ACTION_GET
+ true, // ACTION_LOOK
+ true // ACTION_TALK
+ };
+ const bool worksOnHotspots[] = { // True if the action reacts with hotspots?
+ false, // ACTION_WALK
+ true, // ACTION_USE
+ true, // ACTION_GET
+ true, // ACTION_LOOK
+ false // ACTION_TALK
+ };
+
+ Common::Point mousePos = _gfx->getMousePos();
+ int selected = findObjectAt(mousePos.x, mousePos.y);
+ int action = _awayMission.activeAction;
+ assert(action >= 1 && action <= 5);
+
+ bool withRedOutline;
+
+ if (selected >= 0 && selected <= 3 && worksOnCrewmen[action - 1])
+ withRedOutline = true;
+ else if (selected > 3 && selected < MAX_OBJECTS && worksOnObjects[action - 1])
+ withRedOutline = true;
+ else if (selected >= MAX_OBJECTS && selected < MAX_OBJECTS_2 && worksOnHotspots[action - 1])
+ withRedOutline = true;
+ else
+ withRedOutline = false;
+
+ chooseMouseBitmapForAction(action, withRedOutline);
+}
+
+void StarTrekEngine::showInventoryIcons(bool showItem) {
+ const char *crewmanFilenames[] = {
+ "ikirk",
+ "ispock",
+ "imccoy",
+ "iredshir"
+ };
+
+ Common::String itemFilename;
+
+ if (showItem) {
+ int i = _awayMission.activeItem;
+ if (i >= 0 && i <= 3)
+ itemFilename = crewmanFilenames[i];
+ else {
+ // TODO
+ }
+ }
+
+ if (itemFilename.empty())
+ _inventoryIconSprite.pos.x = 10;
+ else {
+ _gfx->addSprite(&_itemIconSprite);
+ _itemIconSprite.drawMode = 2;
+ _itemIconSprite.pos.x = 10;
+ _itemIconSprite.pos.y = 10;
+ _itemIconSprite.drawPriority = 15;
+ _itemIconSprite.drawPriority2 = 8;
+ _itemIconSprite.setBitmap(_gfx->loadBitmap(itemFilename));
+
+ _inventoryIconSprite.pos.x = 46;
+ }
+
+ _gfx->addSprite(&_inventoryIconSprite);
+
+ _inventoryIconSprite.pos.y = 10;
+ _inventoryIconSprite.drawMode = 2;
+ _inventoryIconSprite.drawPriority = 15;
+ _inventoryIconSprite.drawPriority2 = 15;
+ _inventoryIconSprite.setBitmap(_gfx->loadBitmap("inv00"));
+}
+
+void StarTrekEngine::hideInventoryIcons() {
+ // Clear these sprites from the screen
+ if (_itemIconSprite.drawMode == 2)
+ _itemIconSprite.dontDrawNextFrame();
+ if (_inventoryIconSprite.drawMode == 2)
+ _inventoryIconSprite.dontDrawNextFrame();
+
+ _gfx->drawAllSprites();
+
+ if (_itemIconSprite.drawMode == 2) {
+ _gfx->delSprite(&_itemIconSprite);
+ _itemIconSprite.drawMode = 0;
+ _itemIconSprite.bitmap.reset();
+ }
+
+ if (_inventoryIconSprite.drawMode == 2) {
+ _gfx->delSprite(&_inventoryIconSprite);
+ _inventoryIconSprite.drawMode = 0;
+ _inventoryIconSprite.bitmap.reset();
+ }
+}
+
+int StarTrekEngine::showInventoryMenu(int x, int y, bool restoreMouse) {
+ const int ITEMS_PER_ROW = 5;
+
+ Common::Point oldMousePos = _gfx->getMousePos();
+ bool keyboardControlledMouse = _keyboardControlsMouse;
+ _keyboardControlsMouse = false;
+
+ int itemIndex = 0;
+ int numItems = 0;
+
+ char itemNames[NUM_ITEMS][10];
+ Common::Point itemPositions[NUM_ITEMS];
+ int16 itemIndices[NUM_ITEMS];
+
+ while (itemIndex < NUM_ITEMS) {
+ if (_itemList[itemIndex].have) {
+ strcpy(itemNames[numItems], _itemList[itemIndex].name);
+
+ int16 itemX = (numItems % ITEMS_PER_ROW) * 32 + x;
+ int16 itemY = (numItems / ITEMS_PER_ROW) * 32 + y;
+ itemPositions[numItems] = Common::Point(itemX, itemY);
+ itemIndices[numItems] = _itemList[itemIndex].field2;
+
+ numItems++;
+ }
+ itemIndex++;
+ }
+
+ Sprite itemSprites[NUM_ITEMS];
+
+ for (int i = 0; i < numItems; i++) {
+ _gfx->addSprite(&itemSprites[i]);
+
+ itemSprites[i].drawMode = 2;
+ itemSprites[i].pos.x = itemPositions[i].x;
+ itemSprites[i].pos.y = itemPositions[i].y;
+ itemSprites[i].drawPriority = 15;
+ itemSprites[i].drawPriority2 = 8;
+ itemSprites[i].setBitmap(_gfx->loadBitmap(itemNames[i]));
+ }
+
+ chooseMousePositionFromSprites(itemSprites, numItems, -1, 4);
+ bool displayMenu = true;
+ int lastItemIndex = -1;
+
+ while (displayMenu) {
+ _sound->checkLoopMusic();
+
+ TrekEvent event;
+ if (!getNextEvent(&event))
+ continue;
+
+ switch (event.type) {
+ case TREKEVENT_TICK: {
+ Common::Point mousePos = _gfx->getMousePos();
+ itemIndex = getMenuButtonAt(itemSprites, numItems, mousePos.x, mousePos.y);
+ if (itemIndex != lastItemIndex) {
+ if (lastItemIndex != -1) {
+ drawMenuButtonOutline(itemSprites[lastItemIndex].bitmap, 0);
+ itemSprites[lastItemIndex].bitmapChanged = true;
+ }
+ if (itemIndex != -1) {
+ drawMenuButtonOutline(itemSprites[itemIndex].bitmap, 15);
+ itemSprites[itemIndex].bitmapChanged = true;
+ }
+ lastItemIndex = itemIndex;
+ }
+ _gfx->drawAllSprites();
+ break;
+ }
+
+ case TREKEVENT_LBUTTONDOWN:
+exitWithSelection:
+ displayMenu = false;
+ break;
+
+ case TREKEVENT_RBUTTONDOWN:
+exitWithoutSelection:
+ displayMenu = false;
+ lastItemIndex = -1;
+ break;
+
+ case TREKEVENT_KEYDOWN:
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_ESCAPE:
+ case Common::KEYCODE_F2:
+ goto exitWithoutSelection;
+
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ case Common::KEYCODE_F1:
+ goto exitWithSelection;
+
+ case Common::KEYCODE_HOME:
+ case Common::KEYCODE_KP7:
+ chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 4);
+ break;
+
+ case Common::KEYCODE_UP:
+ case Common::KEYCODE_KP8:
+ case Common::KEYCODE_PAGEUP:
+ case Common::KEYCODE_KP9:
+ chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 2);
+ break;
+
+ case Common::KEYCODE_LEFT:
+ case Common::KEYCODE_KP4:
+ chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 1);
+ break;
+
+ case Common::KEYCODE_RIGHT:
+ case Common::KEYCODE_KP6:
+ chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 0);
+ break;
+
+ case Common::KEYCODE_END:
+ case Common::KEYCODE_KP1:
+ chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 5);
+ break;
+
+ case Common::KEYCODE_DOWN:
+ case Common::KEYCODE_KP2:
+ case Common::KEYCODE_PAGEDOWN:
+ case Common::KEYCODE_KP3:
+ chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 3);
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ removeNextEvent();
+ }
+
+ playSoundEffectIndex(0x10);
+ if (lastItemIndex >= 0)
+ drawMenuButtonOutline(itemSprites[lastItemIndex].bitmap, 0);
+
+ for (int i = 0; i < numItems; i++)
+ itemSprites[i].dontDrawNextFrame();
+
+ _gfx->drawAllSprites();
+
+ for (int i = 0; i < numItems; i++) {
+ itemSprites[i].bitmap.reset();
+ _gfx->delSprite(&itemSprites[i]);
+ }
+
+ if (lastItemIndex >= 0) {
+ lastItemIndex = itemIndices[lastItemIndex];
+ }
+
+ if (restoreMouse)
+ _gfx->warpMouse(oldMousePos.x, oldMousePos.y);
+
+ _keyboardControlsMouse = keyboardControlledMouse;
+ return lastItemIndex;
+}
+
+/**
* A scale of 256 is the baseline.
*/
SharedPtr<Bitmap> StarTrekEngine::scaleBitmap(SharedPtr<Bitmap> bitmap, uint16 scale) {
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index b146df8..1e1dbc7 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -39,6 +39,7 @@
#include "startrek/awaymission.h"
#include "startrek/filestream.h"
#include "startrek/graphics.h"
+#include "startrek/items.h"
#include "startrek/object.h"
#include "startrek/room.h"
#include "startrek/sound.h"
@@ -58,6 +59,8 @@ class StarTrekEngine;
typedef String (StarTrekEngine::*TextGetterFunc)(int, uintptr, String *);
const int MAX_OBJECTS = 32;
+const int MAX_OBJECTS_2 = 64; // TODO: better name; indices 32 and above used for something
+
const int MAX_MENUBUTTONS = 32;
const int TEXTBOX_WIDTH = 26;
const int MAX_TEXTBOX_LINES = 12;
@@ -185,6 +188,15 @@ enum Acton {
ACTION_OPTIONS = 13 // Not really an action, but selectable from action menu
};
+// First 4 objects are reserved for crewmen
+enum Objects {
+ OBJECT_KIRK = 0,
+ OBJECT_SPOCK = 1,
+ OBJECT_MCCOY = 2,
+ OBJECT_REDSHIRT = 3,
+ OBJECT_INVENTORY_ICON = 31
+};
+
struct StarTrekGameDescription;
class Graphics;
@@ -246,8 +258,14 @@ public:
void chooseObjectDirectionForWalking(Object *object, int16 srcX, int16 srcY, int16 destX, int16 destY);
bool directPathExists(int16 srcX, int16 srcY, int16 destX, int16 destY);
+ int findObjectAt(int x, int y);
+ int findObjectAt(Common::Point p) { return findObjectAt(p.x, p.y); }
SharedPtr<Bitmap> loadAnimationFrame(const Common::String &filename, uint16 arg2);
Common::String getCrewmanAnimFilename(int objectIndex, const Common::String &basename);
+ void updateMouseBitmap();
+ void showInventoryIcons(bool showItem);
+ void hideInventoryIcons();
+ int showInventoryMenu(int x, int y, bool restoreMouse);
SharedPtr<Bitmap> scaleBitmap(SharedPtr<Bitmap> bitmap, uint16 scale);
void scaleBitmapRow(byte *src, byte *dest, uint16 origWidth, uint16 scaledWidth);
@@ -301,7 +319,7 @@ public:
// menu.cpp
public:
- int getMenuButtonAt(const Menu &menu, int x, int y);
+ int getMenuButtonAt(Sprite *sprites, int numSprites, int x, int y);
void chooseMousePositionFromSprites(Sprite *sprites, int numSprites, int spriteIndex, int mode);
void drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color);
void showOptionsMenu(int x, int y);
@@ -375,6 +393,8 @@ public:
int16 _activeDoorWarpHotspot;
int16 _lookActionBitmapIndex;
+ Item _itemList[NUM_ITEMS];
+
Object _objectList[MAX_OBJECTS];
Object * const _kirkObject;
Object * const _spockObject;
@@ -384,6 +404,8 @@ public:
SharedPtr<FileStream> _objectBanFiles[MAX_OBJECTS / 2];
uint16 _objectBanVar2[MAX_OBJECTS / 2]; // TODO: initialize?
+ Sprite _inventoryIconSprite;
+ Sprite _itemIconSprite;
// _clockTicks is based on DOS interrupt 1A, AH=0; read system clock counter.
// Updates 18.206 times every second.
Commit: ec2306f8b03f4ebfc0cc65b506ec3c1b9135481f
https://github.com/scummvm/scummvm/commit/ec2306f8b03f4ebfc0cc65b506ec3c1b9135481f
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Don't memset sprites, add Fixed16 type
Changed paths:
engines/startrek/common.h
engines/startrek/menu.cpp
engines/startrek/object.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/common.h b/engines/startrek/common.h
index c84b9c4..c5e3efe 100644
--- a/engines/startrek/common.h
+++ b/engines/startrek/common.h
@@ -36,7 +36,10 @@ Common::Rect getRectEncompassing(Common::Rect r1, Common::Rect r2);
// Fixed-point (16.16) number
-typedef int32 FixedInt;
+typedef int32 Fixed32;
+
+// Fixed-point (8.8) number
+typedef int16 Fixed16;
}
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index 50661be..37ab57b 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -540,7 +540,7 @@ void StarTrekEngine::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
_activeMenu->numButtons = _activeMenu->menuFile->size() / 16;
for (int i = 0; i < _activeMenu->numButtons; i++) {
- memset(&_activeMenu->sprites[i], 0, sizeof(Sprite));
+ _activeMenu->sprites[i] = Sprite();
_gfx->addSprite(&_activeMenu->sprites[i]);
_activeMenu->sprites[i].drawMode = 2;
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index cdcae74..8885390 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -40,7 +40,7 @@ struct Object {
uint16 animType;
Sprite sprite;
char animationString4[10];
- uint16 scale;
+ Fixed16 scale;
SharedPtr<FileStream> animFile;
uint16 numAnimFrames;
uint16 animFrame;
@@ -59,12 +59,12 @@ struct Object {
int16 iwDestPosition;
// Fixed-point position values (16.16) used while walking.
- FixedInt granularPosX;
- FixedInt granularPosY;
+ Fixed32 granularPosX;
+ Fixed32 granularPosY;
// Fixed-point speed values (16.16).
- FixedInt speedX;
- FixedInt speedY;
+ Fixed32 speedX;
+ Fixed32 speedY;
Common::Point dest; // Position object is walking toward
uint16 field90;
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 02c80ef..efde236 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -344,7 +344,7 @@ void StarTrekEngine::initObjects() {
/**
* Set an object's animation, position, and scale.
*/
-int StarTrekEngine::loadObjectAnim(int objectIndex, const Common::String &animName, int16 x, int16 y, uint16 scale) {
+int StarTrekEngine::loadObjectAnim(int objectIndex, const Common::String &animName, int16 x, int16 y, Fixed16 scale) {
debugC(6, kDebugGraphics, "Load animation '%s' on object %d", animName.c_str(), objectIndex);
Object *object;
@@ -576,7 +576,7 @@ void StarTrekEngine::objectFunc1() {
}
}
-void StarTrekEngine::drawObjectToScreen(Object *object, const Common::String &_animName, int16 x, int16 y, uint16 scale, bool addSprite) {
+void StarTrekEngine::drawObjectToScreen(Object *object, const Common::String &_animName, int16 x, int16 y, Fixed16 scale, bool addSprite) {
Common::String animFilename = _animName;
if (_animName.hasPrefixIgnoreCase("stnd") /* && word_45d20 == -1 */) // TODO
animFilename += 'j';
@@ -762,7 +762,7 @@ bool StarTrekEngine::directPathExists(int16 srcX, int16 srcY, int16 destX, int16
int32 absDistY = abs(distY);
int32 distCounter;
- FixedInt speedX, speedY;
+ Fixed32 speedX, speedY;
if (absDistX > absDistY) {
distCounter = absDistX;
@@ -791,8 +791,8 @@ bool StarTrekEngine::directPathExists(int16 srcX, int16 srcY, int16 destX, int16
speedY = -1 << 16;
}
- FixedInt fixedX = srcX << 16;
- FixedInt fixedY = srcY << 16;
+ Fixed32 fixedX = srcX << 16;
+ Fixed32 fixedY = srcY << 16;
if (isPositionSolid((fixedX + 0x8000) >> 16, (fixedY + 0x8000) >> 16))
return false;
@@ -837,7 +837,7 @@ int StarTrekEngine::findObjectAt(int x, int y) {
int objectIndex = _room->readRdfWord(offset + 6);
// word_4b418 = 1;
// word_4a792 = _room->readRdfWord(offset + 2);
- // word_4a796 = _room->readRdfWord(offset + 4);
+ // word_4a796 = _room->readRdfWord(offset + 4); // TODO
return objectIndex;
}
@@ -861,7 +861,7 @@ int StarTrekEngine::findObjectAt(int x, int y) {
/**
* Loads a bitmap for the animation frame with the given scale.
*/
-SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filename, uint16 scale) {
+SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filename, Fixed16 scale) {
SharedPtr<Bitmap> bitmapToReturn;
char basename[5];
@@ -1239,7 +1239,7 @@ exitWithoutSelection:
/**
* A scale of 256 is the baseline.
*/
-SharedPtr<Bitmap> StarTrekEngine::scaleBitmap(SharedPtr<Bitmap> bitmap, uint16 scale) {
+SharedPtr<Bitmap> StarTrekEngine::scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed16 scale) {
int scaledWidth = (bitmap->width * scale) >> 8;
int scaledHeight = (bitmap->height * scale) >> 8;
int origWidth = bitmap->width;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 1e1dbc7..f1a5176 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -246,12 +246,12 @@ public:
// Objects
void initObjects();
- int loadObjectAnim(int objectIndex, const Common::String &animName, int16 x, int16 y, uint16 arg8);
+ int loadObjectAnim(int objectIndex, const Common::String &animName, int16 x, int16 y, Fixed16 scale);
bool objectWalkToPosition(int objectIndex, const Common::String &animFile, int16 srcX, int16 srcY, int16 destX, int16 destY);
void updateObjectAnimations();
void removeObjectFromScreen(int objectIndex);
void objectFunc1();
- void drawObjectToScreen(Object *object, const Common::String &animName, int16 x, int16 y, uint16 scale, bool addSprite);
+ void drawObjectToScreen(Object *object, const Common::String &animName, int16 x, int16 y, Fixed16 scale, bool addSprite);
void releaseAnim(Object *object);
void initStandAnim(int objectIndex);
void updateObjectPositionWhileWalking(Object *object, int16 x, int16 y);
@@ -260,13 +260,13 @@ public:
int findObjectAt(int x, int y);
int findObjectAt(Common::Point p) { return findObjectAt(p.x, p.y); }
- SharedPtr<Bitmap> loadAnimationFrame(const Common::String &filename, uint16 arg2);
+ SharedPtr<Bitmap> loadAnimationFrame(const Common::String &filename, Fixed16 scale);
Common::String getCrewmanAnimFilename(int objectIndex, const Common::String &basename);
void updateMouseBitmap();
void showInventoryIcons(bool showItem);
void hideInventoryIcons();
int showInventoryMenu(int x, int y, bool restoreMouse);
- SharedPtr<Bitmap> scaleBitmap(SharedPtr<Bitmap> bitmap, uint16 scale);
+ SharedPtr<Bitmap> scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed16 scale);
void scaleBitmapRow(byte *src, byte *dest, uint16 origWidth, uint16 scaledWidth);
// Events
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 239e4f5..04b40bf 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -469,7 +469,7 @@ SharedPtr<TextBitmap> StarTrekEngine::initTextSprite(int *xoffsetPtr, int *yoffs
SharedPtr<TextBitmap> bitmap(new TextBitmap(TEXTBOX_WIDTH*8, textHeight*8));
- memset(sprite, 0, sizeof(Sprite));
+ *sprite = Sprite();
sprite->drawPriority = 15;
sprite->drawPriority2 = 8;
sprite->bitmap = bitmap;
Commit: f66b77d9fd34e4845a214e1c1ff42e5e2211c991
https://github.com/scummvm/scummvm/commit/f66b77d9fd34e4845a214e1c1ff42e5e2211c991
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Rename objects to actors
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/items.h
engines/startrek/object.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index ae05485..e049924 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -89,12 +89,12 @@ void StarTrekEngine::loadRoom(const Common::String &missionName, int roomIndex)
_mapFile = loadFile(_mapFilename + ".map");
_iwFile = SharedPtr<IWFile>(new IWFile(this, _mapFilename + ".iw"));
- objectFunc1();
- initObjects();
+ actorFunc1();
+ initActors();
double num = _room->getVar0c() - _room->getVar0a();
double den = _room->getVar06() - _room->getVar08() + 1;
- _playerObjectScale = (int32)(num * 256 / den);
+ _playerActorScale = (int32)(num * 256 / den);
// TODO: RDF vars 1e/1f and 20/21; relates to BAN files?
@@ -121,11 +121,11 @@ void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) {
int16 destX = _room->readRdfWord(rdfOffset + 4); // Position to walk to
int16 destY = _room->readRdfWord(rdfOffset + 6);
- objectWalkToPosition(i, anim, srcX, srcY, destX, destY);
+ actorWalkToPosition(i, anim, srcX, srcY, destX, destY);
}
- _kirkObject->walkingIntoRoom = 1;
- _kirkObject->field66 = 0xff;
+ _kirkActor->walkingIntoRoom = 1;
+ _kirkActor->field66 = 0xff;
_awayMission.transitioningIntoRoom = 1;
_warpHotspotsActive = false;
break;
@@ -134,10 +134,10 @@ void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) {
for (int i = 0; i < (_awayMission.redshirtDead ? 3 : 4); i++) {
Common::String animFilename = getCrewmanAnimFilename(i, "tele");
Common::Point warpPos = _room->getBeamInPosition(i);
- loadObjectAnimWithRoomScaling(i, animFilename, warpPos.x, warpPos.y);
+ loadActorAnimWithRoomScaling(i, animFilename, warpPos.x, warpPos.y);
}
- _kirkObject->walkingIntoRoom = 1;
- _kirkObject->field66 = 0xff;
+ _kirkActor->walkingIntoRoom = 1;
+ _kirkActor->field66 = 0xff;
_awayMission.transitioningIntoRoom = 1;
playSoundEffectIndex(0x09);
_warpHotspotsActive = false;
@@ -155,7 +155,7 @@ void StarTrekEngine::handleAwayMissionEvents() {
if (popNextEvent(&event)) {
switch (event.type) {
case TREKEVENT_TICK:
- updateObjectAnimations();
+ updateActorAnimations();
// sub_236bb();
updateMouseBitmap();
// doSomethingWithBanData1();
@@ -177,22 +177,22 @@ void StarTrekEngine::handleAwayMissionEvents() {
switch (_awayMission.activeAction) {
case ACTION_WALK:
if (_awayMission.field1c == 0) {
- _kirkObject->sprite.drawMode = 1; // Hide these objects for function call below?
- _spockObject->sprite.drawMode = 1;
- _mccoyObject->sprite.drawMode = 1;
- _redshirtObject->sprite.drawMode = 1;
+ _kirkActor->sprite.drawMode = 1; // Hide these objects for function call below?
+ _spockActor->sprite.drawMode = 1;
+ _mccoyActor->sprite.drawMode = 1;
+ _redshirtActor->sprite.drawMode = 1;
- // findObjectClickedOn();
+ // findActorClickedOn();
// ...
- _kirkObject->sprite.drawMode = 0;
- _spockObject->sprite.drawMode = 0;
- _mccoyObject->sprite.drawMode = 0;
- _redshirtObject->sprite.drawMode = 0;
+ _kirkActor->sprite.drawMode = 0;
+ _spockActor->sprite.drawMode = 0;
+ _mccoyActor->sprite.drawMode = 0;
+ _redshirtActor->sprite.drawMode = 0;
Common::String animFilename = getCrewmanAnimFilename(0, "walk");
Common::Point mousePos = _gfx->getMousePos();
- objectWalkToPosition(0, animFilename, _kirkObject->pos.x, _kirkObject->pos.y, mousePos.x, mousePos.y);
+ actorWalkToPosition(0, animFilename, _kirkActor->pos.x, _kirkActor->pos.y, mousePos.x, mousePos.y);
}
break;
@@ -276,21 +276,21 @@ void StarTrekEngine::handleAwayMissionEvents() {
void StarTrekEngine::unloadRoom() {
_gfx->fadeoutScreen();
// sub_2394b(); // TODO
- objectFunc1();
+ actorFunc1();
_room.reset();
_mapFile.reset();
}
/**
- * Similar to loadObjectAnim, but scale is determined by the y-position in the room. The
+ * Similar to loadActorAnim, but scale is determined by the y-position in the room. The
* further up (away) the object is, the smaller it is.
*/
-int StarTrekEngine::loadObjectAnimWithRoomScaling(int objectIndex, const Common::String &animName, int16 x, int16 y) {
- uint16 scale = getObjectScaleAtPosition(y);
- return loadObjectAnim(objectIndex, animName, x, y, scale);
+int StarTrekEngine::loadActorAnimWithRoomScaling(int actorIndex, const Common::String &animName, int16 x, int16 y) {
+ uint16 scale = getActorScaleAtPosition(y);
+ return loadActorAnim(actorIndex, animName, x, y, scale);
}
-uint16 StarTrekEngine::getObjectScaleAtPosition(int16 y) {
+uint16 StarTrekEngine::getActorScaleAtPosition(int16 y) {
int16 var06 = _room->getVar06();
int16 var08 = _room->getVar08();
int16 var0a = _room->getVar0a();
@@ -300,7 +300,7 @@ uint16 StarTrekEngine::getObjectScaleAtPosition(int16 y) {
if (var08 > y)
y = var08;
- return ((_playerObjectScale * (y - var08)) >> 8) + var0a;
+ return ((_playerActorScale * (y - var08)) >> 8) + var0a;
}
SharedPtr<Room> StarTrekEngine::getRoom() {
@@ -316,12 +316,12 @@ void StarTrekEngine::addCommand(const Command &command) {
void StarTrekEngine::handleAwayMissionCommand() {
Command command = _commandQueue.pop();
- if ((command.type == COMMAND_FINISHED_BEAMING_IN || command.type == FINISHED_ENTERING_ROOM) && command.b1 == 0xff) {
+ if ((command.type == COMMAND_FINISHED_BEAMING_IN || command.type == COMMAND_FINISHED_ENTERING_ROOM) && command.b1 == 0xff) {
_awayMission.transitioningIntoRoom = 0;
_warpHotspotsActive = true;
return;
}
- else if (command.type == FINISHED_ENTERING_ROOM && command.b1 >= 0xe0) { // TODO
+ else if (command.type == COMMAND_FINISHED_ENTERING_ROOM && command.b1 >= 0xe0) { // TODO
return;
}
diff --git a/engines/startrek/items.h b/engines/startrek/items.h
index 6ef69cf..913ec7d 100644
--- a/engines/startrek/items.h
+++ b/engines/startrek/items.h
@@ -177,7 +177,7 @@ const Item g_itemList[] = {
{ false, 0x00, "", 0x00 },
};
-const int NUM_ITEMS = sizeof(g_itemList) / sizeof(struct Item);
+const int NUM_ITEMS = sizeof(g_itemList) / sizeof(struct Item) - 0x40; // 0x49
}
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index 8885390..71c9f84 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -24,6 +24,7 @@
#define STARTREK_OBJECT_H
#include "startrek/common.h"
+#include "startrek/items.h"
#include "startrek/sprite.h"
#include "common/scummsys.h"
@@ -34,7 +35,37 @@ class StarTrekEngine;
class FileStream;
-struct Object {
+// Objects 0-31 are "actors" that are drawn to the screen, are animated, etc.
+// Objects 32-63 are "hotspots" corresponding to specific regions in the screen.
+// Objects 64+ are "items".
+// All interactions in the game consist of specific object indices interacting with each
+// other, ie. object 0 (kirk) interacts with object 32 (a hotspot) via ACTION_LOOK.
+
+const int ACTORS_START = 0;
+const int ACTORS_END = 32;
+const int NUM_ACTORS = ACTORS_END - ACTORS_START;
+
+const int HOTSPOTS_START = 32;
+const int HOTSPOTS_END = 64;
+const int NUM_HOTSPOTS = HOTSPOTS_END - HOTSPOTS_START;
+
+const int ITEMS_START = 64;
+const int ITEMS_END = ITEMS_START + NUM_ITEMS; // See items.h
+
+const int NUM_OBJECTS = ITEMS_END;
+
+
+// Some object indices are reserved (see items.h for item objects)
+enum Objects {
+ OBJECT_KIRK = 0,
+ OBJECT_SPOCK = 1,
+ OBJECT_MCCOY = 2,
+ OBJECT_REDSHIRT = 3,
+ OBJECT_INVENTORY_ICON = 31
+};
+
+
+struct Actor {
uint16 spriteDrawn;
char animationString3[16];
uint16 animType;
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index efde236..8df22ea 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -44,10 +44,10 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
Engine(syst),
_gameDescription(gamedesc),
_randomSource("Star Trek"),
- _kirkObject(&_objectList[0]),
- _spockObject(&_objectList[1]),
- _mccoyObject(&_objectList[2]),
- _redshirtObject(&_objectList[3]) {
+ _kirkActor(&_actorList[0]),
+ _spockActor(&_actorList[1]),
+ _mccoyActor(&_actorList[2]),
+ _redshirtActor(&_actorList[3]) {
DebugMan.addDebugChannel(kDebugSound, "sound", "Sound");
DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics");
@@ -79,7 +79,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_missionToLoad = "DEMON";
_roomIndexToLoad = 0;
- for (int i = 0; i < NUM_ITEMS; i++)
+ for (int i = 0; i < NUM_OBJECTS; i++)
_itemList[i] = g_itemList[i];
}
@@ -202,8 +202,8 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
_sound->stopAllVocSounds();
_gfx->fadeoutScreen();
- objectFunc1();
- initObjects();
+ actorFunc1();
+ initActors();
SharedPtr<Bitmap> bgImage = _gfx->loadBitmap("transprt");
_gfx->setBackgroundImage(bgImage);
@@ -216,25 +216,25 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
Common::String filename = getCrewmanAnimFilename(i, name);
int x = crewmanTransportPositions[i][0];
int y = crewmanTransportPositions[i][1];
- loadObjectAnim(i, filename, x, y, 256);
- _objectList[i].animationString[0] = '\0';
+ loadActorAnim(i, filename, x, y, 256);
+ _actorList[i].animationString[0] = '\0';
}
if (_missionToLoad.equalsIgnoreCase("feather") && name[4] == 'b') {
- loadObjectAnim(9, "qteleb", 0x61, 0x79, 0x100);
+ loadActorAnim(9, "qteleb", 0x61, 0x79, 0x100);
}
else if (_missionToLoad.equalsIgnoreCase("trial")) {
if (name[4] == 'd') {
- loadObjectAnim(9, "qteled", 0x61, 0x79, 0x100);
+ loadActorAnim(9, "qteled", 0x61, 0x79, 0x100);
}
/* TODO
else if (word_51156 >= 3) {
- loadObjectAnim(9, "qteleb", 0x61, 0x79, 0x100);
+ loadActorAnim(9, "qteleb", 0x61, 0x79, 0x100);
}
*/
}
- loadObjectAnim(8, "transc", 0, 0, 0x100);
+ loadActorAnim(8, "transc", 0, 0, 0x100);
// TODO: redraw mouse and sprite_52c4e?
@@ -248,13 +248,13 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
else
playSoundEffectIndex(0x09);
- while (_objectList[0].field62 == 0) {
+ while (_actorList[0].field62 == 0) {
TrekEvent event;
if (popNextEvent(&event)) {
if (event.type == TREKEVENT_TICK) {
// TODO: redraw sprite_52c4e?
_frameIndex++;
- updateObjectAnimations();
+ updateActorAnimations();
_gfx->drawAllSprites();
}
}
@@ -264,8 +264,8 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
_gfx->drawAllSprites();
_gfx->fadeoutScreen();
- objectFunc1();
- initObjects();
+ actorFunc1();
+ initActors();
}
void StarTrekEngine::playSoundEffectIndex(int index) {
@@ -328,215 +328,215 @@ void StarTrekEngine::stopPlayingSpeech() {
_sound->stopPlayingSpeech();
}
-void StarTrekEngine::initObjects() {
- for (int i = 0; i < MAX_OBJECTS; i++) {
- _objectList[i] = Object();
+void StarTrekEngine::initActors() {
+ for (int i = 0; i < NUM_ACTORS; i++) {
+ _actorList[i] = Actor();
}
- for (int i = 0; i < MAX_OBJECTS / 2; i++)
- _objectBanFiles[i].reset();
+ for (int i = 0; i < NUM_ACTORS / 2; i++)
+ _actorBanFiles[i].reset();
- strcpy(_kirkObject->animationString, "kstnd");
- strcpy(_spockObject->animationString, "sstnd");
- strcpy(_mccoyObject->animationString, "mstnd");
- strcpy(_redshirtObject->animationString, "rstnd");
+ strcpy(_kirkActor->animationString, "kstnd");
+ strcpy(_spockActor->animationString, "sstnd");
+ strcpy(_mccoyActor->animationString, "mstnd");
+ strcpy(_redshirtActor->animationString, "rstnd");
}
/**
- * Set an object's animation, position, and scale.
+ * Set an actor's animation, position, and scale.
*/
-int StarTrekEngine::loadObjectAnim(int objectIndex, const Common::String &animName, int16 x, int16 y, Fixed16 scale) {
- debugC(6, kDebugGraphics, "Load animation '%s' on object %d", animName.c_str(), objectIndex);
+int StarTrekEngine::loadActorAnim(int actorIndex, const Common::String &animName, int16 x, int16 y, Fixed16 scale) {
+ debugC(6, kDebugGraphics, "Load animation '%s' on actor %d", animName.c_str(), actorIndex);
- Object *object;
+ Actor *actor;
- if (objectIndex == -1) {
+ if (actorIndex == -1) {
// TODO
}
else
- object = &_objectList[objectIndex];
+ actor = &_actorList[actorIndex];
- if (object->spriteDrawn) {
- releaseAnim(object);
- drawObjectToScreen(object, animName, x, y, scale, false);
+ if (actor->spriteDrawn) {
+ releaseAnim(actor);
+ drawActorToScreen(actor, animName, x, y, scale, false);
}
else {
- drawObjectToScreen(object, animName, x, y, scale, true);
+ drawActorToScreen(actor, animName, x, y, scale, true);
}
- object->walkingIntoRoom = 0;
- object->field66 = 0;
+ actor->walkingIntoRoom = 0;
+ actor->field66 = 0;
- return objectIndex;
+ return actorIndex;
}
/**
- * Tries to make an object walk to a position.
+ * Tries to make an actor walk to a position.
* Returns true if successful in initiating the walk.
*/
-bool StarTrekEngine::objectWalkToPosition(int objectIndex, const Common::String &animFile, int16 srcX, int16 srcY, int16 destX, int16 destY) {
- debugC(6, "Obj %d: walk from (%d,%d) to (%d,%d)", objectIndex, srcX, srcY, destX, destY);
+bool StarTrekEngine::actorWalkToPosition(int actorIndex, const Common::String &animFile, int16 srcX, int16 srcY, int16 destX, int16 destY) {
+ debugC(6, "Obj %d: walk from (%d,%d) to (%d,%d)", actorIndex, srcX, srcY, destX, destY);
- Object *object = &_objectList[objectIndex];
+ Actor *actor = &_actorList[actorIndex];
- object->walkingIntoRoom = 0;
+ actor->walkingIntoRoom = 0;
if (isPositionSolid(destX, destY))
return false;
- if (object->spriteDrawn)
- releaseAnim(object);
+ if (actor->spriteDrawn)
+ releaseAnim(actor);
else
- _gfx->addSprite(&object->sprite);
+ _gfx->addSprite(&actor->sprite);
- object->spriteDrawn = true;
- object->animType = 1;
- object->frameToStartNextAnim = _frameIndex + 1;
- strcpy(object->animationString2, animFile.c_str());
+ actor->spriteDrawn = true;
+ actor->animType = 1;
+ actor->frameToStartNextAnim = _frameIndex + 1;
+ strcpy(actor->animationString2, animFile.c_str());
- object->dest.x = destX;
- object->dest.y = destY;
- object->field92 = 0;
- object->walkingIntoRoom = 0;
+ actor->dest.x = destX;
+ actor->dest.y = destY;
+ actor->field92 = 0;
+ actor->walkingIntoRoom = 0;
- object->iwDestPosition = -1;
- object->iwSrcPosition = -1;
+ actor->iwDestPosition = -1;
+ actor->iwSrcPosition = -1;
if (directPathExists(srcX, srcY, destX, destY)) {
- chooseObjectDirectionForWalking(object, srcX, srcY, destX, destY);
- updateObjectPositionWhileWalking(object, (object->granularPosX + 0x8000) >> 16, (object->granularPosY + 0x8000) >> 16);
+ chooseActorDirectionForWalking(actor, srcX, srcY, destX, destY);
+ updateActorPositionWhileWalking(actor, (actor->granularPosX + 0x8000) >> 16, (actor->granularPosY + 0x8000) >> 16);
return true;
}
else {
- object->iwSrcPosition = _iwFile->getClosestKeyPosition(srcX, srcY);
- object->iwDestPosition = _iwFile->getClosestKeyPosition(destX, destY);
+ actor->iwSrcPosition = _iwFile->getClosestKeyPosition(srcX, srcY);
+ actor->iwDestPosition = _iwFile->getClosestKeyPosition(destX, destY);
- if (object->iwSrcPosition == -1 || object->iwDestPosition == -1) {
+ if (actor->iwSrcPosition == -1 || actor->iwDestPosition == -1) {
// No path exists; face south by default.
- strcat(object->animationString2, "S");
- object->direction = 'S';
+ strcat(actor->animationString2, "S");
+ actor->direction = 'S';
- updateObjectPositionWhileWalking(object, srcX, srcY);
- initStandAnim(objectIndex);
+ updateActorPositionWhileWalking(actor, srcX, srcY);
+ initStandAnim(actorIndex);
return false;
}
else {
- Common::Point iwSrc = _iwFile->_keyPositions[object->iwSrcPosition];
- chooseObjectDirectionForWalking(object, srcX, srcY, iwSrc.x, iwSrc.y);
- updateObjectPositionWhileWalking(object, (object->granularPosX + 0x8000) >> 16, (object->granularPosY + 0x8000) >> 16);
+ Common::Point iwSrc = _iwFile->_keyPositions[actor->iwSrcPosition];
+ chooseActorDirectionForWalking(actor, srcX, srcY, iwSrc.x, iwSrc.y);
+ updateActorPositionWhileWalking(actor, (actor->granularPosX + 0x8000) >> 16, (actor->granularPosY + 0x8000) >> 16);
return true;
}
}
}
-void StarTrekEngine::updateObjectAnimations() {
- for (int i = 0; i < MAX_OBJECTS; i++) {
- Object *object = &_objectList[i];
- if (!object->spriteDrawn)
+void StarTrekEngine::updateActorAnimations() {
+ for (int i = 0; i < NUM_ACTORS; i++) {
+ Actor *actor = &_actorList[i];
+ if (!actor->spriteDrawn)
continue;
- switch (object->animType) {
+ switch (actor->animType) {
case 0: // Not walking?
case 2:
- if (_frameIndex >= object->frameToStartNextAnim) {
+ if (_frameIndex >= actor->frameToStartNextAnim) {
int nextAnimIndex = getRandomWord() & 3;
- object->animFile->seek(18 + nextAnimIndex + object->animFrame * 22, SEEK_SET);
- byte nextAnimFrame = object->animFile->readByte();
-
- if (object->animFrame != nextAnimFrame) {
- if (nextAnimFrame == object->numAnimFrames - 1) {
- object->field62++;
- if (object->walkingIntoRoom != 0) {
- addCommand(Command(COMMAND_FINISHED_BEAMING_IN, object->field66, 0, 0));
+ actor->animFile->seek(18 + nextAnimIndex + actor->animFrame * 22, SEEK_SET);
+ byte nextAnimFrame = actor->animFile->readByte();
+
+ if (actor->animFrame != nextAnimFrame) {
+ if (nextAnimFrame == actor->numAnimFrames - 1) {
+ actor->field62++;
+ if (actor->walkingIntoRoom != 0) {
+ addCommand(Command(COMMAND_FINISHED_BEAMING_IN, actor->field66, 0, 0));
}
}
}
- object->animFrame = nextAnimFrame;
- if (object->animFrame >= object->numAnimFrames) {
- if (object->animationString[0] == '\0')
- removeObjectFromScreen(i);
+ actor->animFrame = nextAnimFrame;
+ if (actor->animFrame >= actor->numAnimFrames) {
+ if (actor->animationString[0] == '\0')
+ removeActorFromScreen(i);
else
initStandAnim(i);
}
else {
- Sprite *sprite = &object->sprite;
+ Sprite *sprite = &actor->sprite;
- object->animFile->seek(object->animFrame * 22, SEEK_SET);
+ actor->animFile->seek(actor->animFrame * 22, SEEK_SET);
char animFrameFilename[16];
- object->animFile->read(animFrameFilename, 16);
- sprite->setBitmap(loadAnimationFrame(animFrameFilename, object->scale));
+ actor->animFile->read(animFrameFilename, 16);
+ sprite->setBitmap(loadAnimationFrame(animFrameFilename, actor->scale));
- memset(object->animationString4, 0, 10);
- strncpy(object->animationString4, animFrameFilename, 9);
+ memset(actor->animationString4, 0, 10);
+ strncpy(actor->animationString4, animFrameFilename, 9);
- object->animFile->seek(10 + object->animFrame * 22, SEEK_SET);
- uint16 xOffset = object->animFile->readUint16();
- uint16 yOffset = object->animFile->readUint16();
- uint16 basePriority = object->animFile->readUint16();
- uint16 frames = object->animFile->readUint16();
+ actor->animFile->seek(10 + actor->animFrame * 22, SEEK_SET);
+ uint16 xOffset = actor->animFile->readUint16();
+ uint16 yOffset = actor->animFile->readUint16();
+ uint16 basePriority = actor->animFile->readUint16();
+ uint16 frames = actor->animFile->readUint16();
- sprite->pos.x = xOffset + object->pos.x;
- sprite->pos.y = yOffset + object->pos.y;
- sprite->drawPriority = _gfx->getPriValue(0, yOffset + object->pos.y) + basePriority;
+ sprite->pos.x = xOffset + actor->pos.x;
+ sprite->pos.y = yOffset + actor->pos.y;
+ sprite->drawPriority = _gfx->getPriValue(0, yOffset + actor->pos.y) + basePriority;
sprite->bitmapChanged = true;
- object->frameToStartNextAnim = frames + _frameIndex;
+ actor->frameToStartNextAnim = frames + _frameIndex;
}
}
break;
case 1: // Walking
- if (_frameIndex < object->frameToStartNextAnim)
+ if (_frameIndex < actor->frameToStartNextAnim)
break;
if (i == 0) // Kirk only
- checkTouchedLoadingZone(object->pos.x, object->pos.y);
- if (object->field90 != 0) {
- Sprite *sprite = &object->sprite;
+ checkTouchedLoadingZone(actor->pos.x, actor->pos.y);
+ if (actor->field90 != 0) {
+ Sprite *sprite = &actor->sprite;
int loops;
- if (getObjectScaleAtPosition((object->granularPosY + 0x8000) >> 16) < 0xa0)
+ if (getActorScaleAtPosition((actor->granularPosY + 0x8000) >> 16) < 0xa0)
loops = 1;
else
loops = 2;
for (int k = 0; k < loops; k++) {
- if (object->field90 == 0)
+ if (actor->field90 == 0)
break;
- object->field90--;
- uint32 newX = object->granularPosX + object->speedX;
- uint32 newY = object->granularPosY + object->speedY;
- if ((object->field90 & 3) == 0) {
+ actor->field90--;
+ uint32 newX = actor->granularPosX + actor->speedX;
+ uint32 newY = actor->granularPosY + actor->speedY;
+ if ((actor->field90 & 3) == 0) {
sprite->bitmap.reset();
- updateObjectPositionWhileWalking(object, (newX + 0x8000) >> 16, (newY + 0x8000) >> 16);
- object->field92++;
+ updateActorPositionWhileWalking(actor, (newX + 0x8000) >> 16, (newY + 0x8000) >> 16);
+ actor->field92++;
}
- object->granularPosX = newX;
- object->granularPosY = newY;
- object->frameToStartNextAnim = _frameIndex;
+ actor->granularPosX = newX;
+ actor->granularPosY = newY;
+ actor->frameToStartNextAnim = _frameIndex;
}
}
- else { // object->field90 == 0
- if (object->iwSrcPosition == -1) {
- if (object->walkingIntoRoom != 0) {
- object->walkingIntoRoom = 0;
- addCommand(Command(FINISHED_ENTERING_ROOM, object->field66 & 0xff, 0, 0));
+ else { // actor->field90 == 0
+ if (actor->iwSrcPosition == -1) {
+ if (actor->walkingIntoRoom != 0) {
+ actor->walkingIntoRoom = 0;
+ addCommand(Command(COMMAND_FINISHED_ENTERING_ROOM, actor->field66 & 0xff, 0, 0));
}
- object->sprite.bitmap.reset();
- updateObjectPositionWhileWalking(object, (object->granularPosX + 0x8000) >> 16, (object->granularPosY + 0x8000) >> 16);
+ actor->sprite.bitmap.reset();
+ updateActorPositionWhileWalking(actor, (actor->granularPosX + 0x8000) >> 16, (actor->granularPosY + 0x8000) >> 16);
initStandAnim(i);
}
- else { // object->iwSrcPosition != -1
- if (object->iwSrcPosition == object->iwDestPosition) {
- object->animationString2[strlen(object->animationString2) - 1] = '\0';
- object->iwDestPosition = -1;
- object->iwSrcPosition = -1;
- chooseObjectDirectionForWalking(object, object->pos.x, object->pos.y, object->dest.x, object->dest.y);
+ else { // actor->iwSrcPosition != -1
+ if (actor->iwSrcPosition == actor->iwDestPosition) {
+ actor->animationString2[strlen(actor->animationString2) - 1] = '\0';
+ actor->iwDestPosition = -1;
+ actor->iwSrcPosition = -1;
+ chooseActorDirectionForWalking(actor, actor->pos.x, actor->pos.y, actor->dest.x, actor->dest.y);
}
else {
- int index = _iwFile->_iwEntries[object->iwSrcPosition][object->iwDestPosition];
- object->iwSrcPosition = index;
- Common::Point dest = _iwFile->_keyPositions[object->iwSrcPosition];
- object->animationString2[strlen(object->animationString2) - 1] = '\0';
- chooseObjectDirectionForWalking(object, object->pos.x, object->pos.y, dest.x, dest.y);
+ int index = _iwFile->_iwEntries[actor->iwSrcPosition][actor->iwDestPosition];
+ actor->iwSrcPosition = index;
+ Common::Point dest = _iwFile->_keyPositions[actor->iwSrcPosition];
+ actor->animationString2[strlen(actor->animationString2) - 1] = '\0';
+ chooseActorDirectionForWalking(actor, actor->pos.x, actor->pos.y, dest.x, dest.y);
}
}
}
@@ -548,154 +548,154 @@ void StarTrekEngine::updateObjectAnimations() {
}
}
-void StarTrekEngine::removeObjectFromScreen(int objectIndex) {
- Object *object = &_objectList[objectIndex];
+void StarTrekEngine::removeActorFromScreen(int actorIndex) {
+ Actor *actor = &_actorList[actorIndex];
- if (object->spriteDrawn != 1)
+ if (actor->spriteDrawn != 1)
return;
- debugC(6, kDebugGraphics, "Stop drawing object %d", objectIndex);
+ debugC(6, kDebugGraphics, "Stop drawing actor %d", actorIndex);
- Sprite *sprite = &object->sprite;
+ Sprite *sprite = &actor->sprite;
sprite->field16 = true;
sprite->bitmapChanged = true;
_gfx->drawAllSprites();
_gfx->delSprite(sprite);
- releaseAnim(object);
+ releaseAnim(actor);
}
-void StarTrekEngine::objectFunc1() {
- for (int i = 0; i < MAX_OBJECTS; i++) {
- if (_objectList[i].spriteDrawn == 1) {
- removeObjectFromScreen(i);
+void StarTrekEngine::actorFunc1() {
+ for (int i = 0; i < NUM_ACTORS; i++) {
+ if (_actorList[i].spriteDrawn == 1) {
+ removeActorFromScreen(i);
}
}
- for (int i = 0; i < MAX_OBJECTS / 2; i++) {
- _objectBanFiles[i].reset();
+ for (int i = 0; i < NUM_ACTORS / 2; i++) {
+ _actorBanFiles[i].reset();
}
}
-void StarTrekEngine::drawObjectToScreen(Object *object, const Common::String &_animName, int16 x, int16 y, Fixed16 scale, bool addSprite) {
+void StarTrekEngine::drawActorToScreen(Actor *actor, const Common::String &_animName, int16 x, int16 y, Fixed16 scale, bool addSprite) {
Common::String animFilename = _animName;
if (_animName.hasPrefixIgnoreCase("stnd") /* && word_45d20 == -1 */) // TODO
animFilename += 'j';
- memcpy(object->animationString3, _animName.c_str(), sizeof(object->animationString3));
+ memcpy(actor->animationString3, _animName.c_str(), sizeof(actor->animationString3));
- object->animType = 2;
- object->animFile = loadFile(animFilename + ".anm");
- object->numAnimFrames = object->animFile->size() / 22;
- object->animFrame = 0;
- object->pos.x = x;
- object->pos.y = y;
- object->field62 = 0;
- object->scale = scale;
+ actor->animType = 2;
+ actor->animFile = loadFile(animFilename + ".anm");
+ actor->numAnimFrames = actor->animFile->size() / 22;
+ actor->animFrame = 0;
+ actor->pos.x = x;
+ actor->pos.y = y;
+ actor->field62 = 0;
+ actor->scale = scale;
- object->animFile->seek(16, SEEK_SET);
- object->frameToStartNextAnim = object->animFile->readUint16() + _frameIndex;
+ actor->animFile->seek(16, SEEK_SET);
+ actor->frameToStartNextAnim = actor->animFile->readUint16() + _frameIndex;
char firstFrameFilename[10];
- object->animFile->seek(0, SEEK_SET);
- object->animFile->read(firstFrameFilename, 10);
+ actor->animFile->seek(0, SEEK_SET);
+ actor->animFile->read(firstFrameFilename, 10);
- Sprite *sprite = &object->sprite;
+ Sprite *sprite = &actor->sprite;
if (addSprite)
_gfx->addSprite(sprite);
sprite->setBitmap(loadAnimationFrame(firstFrameFilename, scale));
- memset(object->animationString4, 0, sizeof(char) * 10);
- strncpy(object->animationString4, firstFrameFilename, sizeof(char) * 9);
+ memset(actor->animationString4, 0, sizeof(char) * 10);
+ strncpy(actor->animationString4, firstFrameFilename, sizeof(char) * 9);
- object->scale = scale;
+ actor->scale = scale;
- object->animFile->seek(10, SEEK_SET);
- uint16 xOffset = object->animFile->readUint16();
- uint16 yOffset = object->animFile->readUint16();
- uint16 basePriority = object->animFile->readUint16();
+ actor->animFile->seek(10, SEEK_SET);
+ uint16 xOffset = actor->animFile->readUint16();
+ uint16 yOffset = actor->animFile->readUint16();
+ uint16 basePriority = actor->animFile->readUint16();
- sprite->pos.x = xOffset + object->pos.x;
- sprite->pos.y = yOffset + object->pos.y;
- sprite->drawPriority = _gfx->getPriValue(0, yOffset + object->pos.y) + basePriority;
+ sprite->pos.x = xOffset + actor->pos.x;
+ sprite->pos.y = yOffset + actor->pos.y;
+ sprite->drawPriority = _gfx->getPriValue(0, yOffset + actor->pos.y) + basePriority;
sprite->bitmapChanged = true;
- object->spriteDrawn = 1;
+ actor->spriteDrawn = 1;
}
-void StarTrekEngine::releaseAnim(Object *object) {
- switch (object->animType) {
+void StarTrekEngine::releaseAnim(Actor *actor) {
+ switch (actor->animType) {
case 0:
case 2:
- object->sprite.bitmap.reset();
- object->animFile.reset();
+ actor->sprite.bitmap.reset();
+ actor->animFile.reset();
break;
case 1:
- object->sprite.bitmap.reset();
+ actor->sprite.bitmap.reset();
break;
default:
error("Invalid anim type");
break;
}
- object->spriteDrawn = 0;
+ actor->spriteDrawn = 0;
}
-void StarTrekEngine::initStandAnim(int objectIndex) {
- Object *object = &_objectList[objectIndex];
+void StarTrekEngine::initStandAnim(int actorIndex) {
+ Actor *actor = &_actorList[actorIndex];
- if (!object->spriteDrawn)
+ if (!actor->spriteDrawn)
error("initStandAnim: dead anim");
////////////////////
// sub_239d2
const char *directions = "nsew";
- if (objectIndex >= 0 && objectIndex <= 3) {
- int8 dir = _awayMission.field25[objectIndex];
+ if (actorIndex >= 0 && actorIndex <= 3) {
+ int8 dir = _awayMission.field25[actorIndex];
if (dir != -1) {
- object->direction = directions[dir];
- _awayMission.field25[objectIndex] = -1;
+ actor->direction = directions[dir];
+ _awayMission.field25[actorIndex] = -1;
}
}
// end of sub_239d2
////////////////////
Common::String animName;
- if (object->direction != 0)
- animName = Common::String(object->animationString) + (char)object->direction;
+ if (actor->direction != 0)
+ animName = Common::String(actor->animationString) + (char)actor->direction;
else // Default to facing south
- animName = Common::String(object->animationString) + 's';
+ animName = Common::String(actor->animationString) + 's';
- uint16 scale = getObjectScaleAtPosition(object->pos.y);
- loadObjectAnim(objectIndex, animName, object->pos.x, object->pos.y, scale);
- object->animType = 0;
+ uint16 scale = getActorScaleAtPosition(actor->pos.y);
+ loadActorAnim(actorIndex, animName, actor->pos.x, actor->pos.y, scale);
+ actor->animType = 0;
}
-void StarTrekEngine::updateObjectPositionWhileWalking(Object *object, int16 x, int16 y) {
- object->scale = getObjectScaleAtPosition(y);
- Common::String animName = Common::String::format("%s%02d", object->animationString2, object->field92 & 7);
- object->sprite.setBitmap(loadAnimationFrame(animName, object->scale));
+void StarTrekEngine::updateActorPositionWhileWalking(Actor *actor, int16 x, int16 y) {
+ actor->scale = getActorScaleAtPosition(y);
+ Common::String animName = Common::String::format("%s%02d", actor->animationString2, actor->field92 & 7);
+ actor->sprite.setBitmap(loadAnimationFrame(animName, actor->scale));
- memset(object->animationString4, 0, 10);
- strncpy(object->animationString4, animName.c_str(), 9);
+ memset(actor->animationString4, 0, 10);
+ strncpy(actor->animationString4, animName.c_str(), 9);
- Sprite *sprite = &object->sprite;
+ Sprite *sprite = &actor->sprite;
sprite->drawPriority = _gfx->getPriValue(0, y);
sprite->pos.x = x;
sprite->pos.y = y;
sprite->bitmapChanged = true;
- object->frameToStartNextAnim = _frameIndex;
- object->pos.x = x;
- object->pos.y = y;
+ actor->frameToStartNextAnim = _frameIndex;
+ actor->pos.x = x;
+ actor->pos.y = y;
}
/**
- * Chooses a value for the object's speed and direction, based on a source position and
+ * Chooses a value for the actor's speed and direction, based on a source position and
* a destination position it's walking to.
*/
-void StarTrekEngine::chooseObjectDirectionForWalking(Object *object, int16 srcX, int16 srcY, int16 destX, int16 destY) {
- object->granularPosX = srcX << 16;
- object->granularPosY = srcY << 16;
+void StarTrekEngine::chooseActorDirectionForWalking(Actor *actor, int16 srcX, int16 srcY, int16 destX, int16 destY) {
+ actor->granularPosX = srcX << 16;
+ actor->granularPosY = srcY << 16;
int16 distX = destX - srcX;
int16 distY = destY - srcY;
@@ -710,19 +710,19 @@ void StarTrekEngine::chooseObjectDirectionForWalking(Object *object, int16 srcX,
d = 'W';
// Append direction to animation string
- object->animationString2[strlen(object->animationString2) + 1] = '\0';
- object->animationString2[strlen(object->animationString2)] = d;
+ actor->animationString2[strlen(actor->animationString2) + 1] = '\0';
+ actor->animationString2[strlen(actor->animationString2)] = d;
- object->direction = d;
- object->field90 = absDistX;
+ actor->direction = d;
+ actor->field90 = absDistX;
if (distX != 0) {
if (distX > 0)
- object->speedX = 1 << 16;
+ actor->speedX = 1 << 16;
else
- object->speedX = -1 << 16; // 0xffff0000
+ actor->speedX = -1 << 16; // 0xffff0000
- object->speedY = (distY << 16) / absDistX;
+ actor->speedY = (distY << 16) / absDistX;
}
}
else {
@@ -733,25 +733,25 @@ void StarTrekEngine::chooseObjectDirectionForWalking(Object *object, int16 srcX,
d = 'N';
// Append direction to animation string
- object->animationString2[strlen(object->animationString2) + 1] = '\0';
- object->animationString2[strlen(object->animationString2)] = d;
+ actor->animationString2[strlen(actor->animationString2) + 1] = '\0';
+ actor->animationString2[strlen(actor->animationString2)] = d;
- object->direction = d;
- object->field90 = absDistY;
+ actor->direction = d;
+ actor->field90 = absDistY;
if (distY != 0) {
if (distY > 0)
- object->speedY = 1 << 16;
+ actor->speedY = 1 << 16;
else
- object->speedY = -1 << 16; // 0xffff0000
+ actor->speedY = -1 << 16; // 0xffff0000
- object->speedX = (distX << 16) / absDistY;
+ actor->speedX = (distX << 16) / absDistY;
}
}
}
/**
- * Returns true if an object can walk directly from a source position to a destination
+ * Returns true if an actor can walk directly from a source position to a destination
* position without running into unwalkable terrain.
*/
bool StarTrekEngine::directPathExists(int16 srcX, int16 srcY, int16 destX, int16 destY) {
@@ -817,9 +817,9 @@ int StarTrekEngine::findObjectAt(int x, int y) {
else if (sprite == &_itemIconSprite)
return _awayMission.activeItem;
- for (int i = 0; i < MAX_OBJECTS; i++) {
- Object *object = &_objectList[i];
- if (sprite == &object->sprite)
+ for (int i = 0; i < NUM_ACTORS; i++) {
+ Actor *actor = &_actorList[i];
+ if (sprite == &actor->sprite)
return i;
}
@@ -834,11 +834,11 @@ int StarTrekEngine::findObjectAt(int x, int y) {
uint16 word = _room->readRdfWord(offset);
if (word & 0x8000) {
if ((word & actionBit) && isPointInPolygon((int16 *)(_room->_rdfData + offset + 6), x, y)) {
- int objectIndex = _room->readRdfWord(offset + 6);
+ int actorIndex = _room->readRdfWord(offset + 6);
// word_4b418 = 1;
// word_4a792 = _room->readRdfWord(offset + 2);
// word_4a796 = _room->readRdfWord(offset + 4); // TODO
- return objectIndex;
+ return actorIndex;
}
int numVertices = _room->readRdfWord(offset + 8);
@@ -846,8 +846,8 @@ int StarTrekEngine::findObjectAt(int x, int y) {
}
else {
if (isPointInPolygon((int16 *)(_room->_rdfData + offset), x, y)) {
- int objectIndex = _room->readRdfWord(offset);
- return objectIndex;
+ int actorIndex = _room->readRdfWord(offset);
+ return actorIndex;
}
int numVertices = _room->readRdfWord(offset + 2);
@@ -957,10 +957,10 @@ SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filen
return bitmapToReturn;
}
-Common::String StarTrekEngine::getCrewmanAnimFilename(int objectIndex, const Common::String &basename) {
+Common::String StarTrekEngine::getCrewmanAnimFilename(int actorIndex, const Common::String &basename) {
const char *crewmanChars = "ksmr";
- assert(objectIndex >= 0 && objectIndex < 4);
- return crewmanChars[objectIndex] + basename;
+ assert(actorIndex >= 0 && actorIndex < 4);
+ return crewmanChars[actorIndex] + basename;
}
/**
@@ -974,7 +974,7 @@ void StarTrekEngine::updateMouseBitmap() {
true, // ACTION_LOOK
true // ACTION_TALK
};
- const bool worksOnObjects[] = { // True if the action reacts with other objects
+ const bool worksOnActors[] = { // True if the action reacts with other objects
false, // ACTION_WALK
true, // ACTION_USE
true, // ACTION_GET
@@ -998,9 +998,9 @@ void StarTrekEngine::updateMouseBitmap() {
if (selected >= 0 && selected <= 3 && worksOnCrewmen[action - 1])
withRedOutline = true;
- else if (selected > 3 && selected < MAX_OBJECTS && worksOnObjects[action - 1])
+ else if (selected > 3 && selected < NUM_ACTORS && worksOnActors[action - 1])
withRedOutline = true;
- else if (selected >= MAX_OBJECTS && selected < MAX_OBJECTS_2 && worksOnHotspots[action - 1])
+ else if (selected >= NUM_ACTORS && selected < HOTSPOTS_END && worksOnHotspots[action - 1])
withRedOutline = true;
else
withRedOutline = false;
@@ -1082,11 +1082,11 @@ int StarTrekEngine::showInventoryMenu(int x, int y, bool restoreMouse) {
int itemIndex = 0;
int numItems = 0;
- char itemNames[NUM_ITEMS][10];
- Common::Point itemPositions[NUM_ITEMS];
- int16 itemIndices[NUM_ITEMS];
+ char itemNames[NUM_OBJECTS][10];
+ Common::Point itemPositions[NUM_OBJECTS];
+ int16 itemIndices[NUM_OBJECTS];
- while (itemIndex < NUM_ITEMS) {
+ while (itemIndex < NUM_OBJECTS) {
if (_itemList[itemIndex].have) {
strcpy(itemNames[numItems], _itemList[itemIndex].name);
@@ -1100,7 +1100,7 @@ int StarTrekEngine::showInventoryMenu(int x, int y, bool restoreMouse) {
itemIndex++;
}
- Sprite itemSprites[NUM_ITEMS];
+ Sprite itemSprites[NUM_OBJECTS];
for (int i = 0; i < numItems; i++) {
_gfx->addSprite(&itemSprites[i]);
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index f1a5176..b853809 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -58,8 +58,7 @@ class StarTrekEngine;
typedef String (StarTrekEngine::*TextGetterFunc)(int, uintptr, String *);
-const int MAX_OBJECTS = 32;
-const int MAX_OBJECTS_2 = 64; // TODO: better name; indices 32 and above used for something
+
const int MAX_MENUBUTTONS = 32;
const int TEXTBOX_WIDTH = 26;
@@ -106,6 +105,7 @@ struct Menu {
};
// Special events that can be returned by handleMenuEvents.
+// (Normally it returns the "retval" of a pressed button, which is positive.)
enum MenuEvent {
MENUEVENT_RCLICK_OFFBUTTON = -4,
MENUEVENT_ENABLEINPUT, // Makes buttons selectable (occurs after a delay)
@@ -165,7 +165,7 @@ enum Commands {
COMMAND_TOUCHED_WARP = 6,
COMMAND_7 = 7, // Doors? (Or just hotspots activated by Kirk moving there?)
COMMAND_FINISHED_BEAMING_IN = 10,
- FINISHED_ENTERING_ROOM = 12
+ COMMAND_FINISHED_ENTERING_ROOM = 12
};
struct Command {
@@ -188,15 +188,6 @@ enum Acton {
ACTION_OPTIONS = 13 // Not really an action, but selectable from action menu
};
-// First 4 objects are reserved for crewmen
-enum Objects {
- OBJECT_KIRK = 0,
- OBJECT_SPOCK = 1,
- OBJECT_MCCOY = 2,
- OBJECT_REDSHIRT = 3,
- OBJECT_INVENTORY_ICON = 31
-};
-
struct StarTrekGameDescription;
class Graphics;
@@ -219,8 +210,8 @@ private:
void initAwayCrewPositions(int warpEntryIndex);
void handleAwayMissionEvents();
void unloadRoom();
- int loadObjectAnimWithRoomScaling(int objectIndex, const Common::String &animName, int16 x, int16 y);
- uint16 getObjectScaleAtPosition(int16 y);
+ int loadActorAnimWithRoomScaling(int actorIndex, const Common::String &animName, int16 x, int16 y);
+ uint16 getActorScaleAtPosition(int16 y);
void addCommand(const Command &command);
void handleAwayMissionCommand();
@@ -244,24 +235,24 @@ public:
void playSpeech(const Common::String &filename);
void stopPlayingSpeech();
- // Objects
- void initObjects();
- int loadObjectAnim(int objectIndex, const Common::String &animName, int16 x, int16 y, Fixed16 scale);
- bool objectWalkToPosition(int objectIndex, const Common::String &animFile, int16 srcX, int16 srcY, int16 destX, int16 destY);
- void updateObjectAnimations();
- void removeObjectFromScreen(int objectIndex);
- void objectFunc1();
- void drawObjectToScreen(Object *object, const Common::String &animName, int16 x, int16 y, Fixed16 scale, bool addSprite);
- void releaseAnim(Object *object);
- void initStandAnim(int objectIndex);
- void updateObjectPositionWhileWalking(Object *object, int16 x, int16 y);
- void chooseObjectDirectionForWalking(Object *object, int16 srcX, int16 srcY, int16 destX, int16 destY);
+ // Actors
+ void initActors();
+ int loadActorAnim(int actorIndex, const Common::String &animName, int16 x, int16 y, Fixed16 scale);
+ bool actorWalkToPosition(int actorIndex, const Common::String &animFile, int16 srcX, int16 srcY, int16 destX, int16 destY);
+ void updateActorAnimations();
+ void removeActorFromScreen(int actorIndex);
+ void actorFunc1();
+ void drawActorToScreen(Actor *actor, const Common::String &animName, int16 x, int16 y, Fixed16 scale, bool addSprite);
+ void releaseAnim(Actor *actor);
+ void initStandAnim(int actorIndex);
+ void updateActorPositionWhileWalking(Actor *actor, int16 x, int16 y);
+ void chooseActorDirectionForWalking(Actor *actor, int16 srcX, int16 srcY, int16 destX, int16 destY);
bool directPathExists(int16 srcX, int16 srcY, int16 destX, int16 destY);
int findObjectAt(int x, int y);
int findObjectAt(Common::Point p) { return findObjectAt(p.x, p.y); }
SharedPtr<Bitmap> loadAnimationFrame(const Common::String &filename, Fixed16 scale);
- Common::String getCrewmanAnimFilename(int objectIndex, const Common::String &basename);
+ Common::String getCrewmanAnimFilename(int actorIndex, const Common::String &basename);
void updateMouseBitmap();
void showInventoryIcons(bool showItem);
void hideInventoryIcons();
@@ -382,7 +373,7 @@ public:
Common::String _screenName; // _screenName = _missionName + _roomIndex
Common::String _mapFilename; // Similar to _screenName, but used for .map files?
SharedPtr<FileStream> _mapFile;
- int32 _playerObjectScale;
+ int32 _playerActorScale;
// Queue of "commands" (ie. next frame, clicked on object) for away mission or bridge
Common::Queue<Command> _commandQueue;
@@ -395,14 +386,14 @@ public:
Item _itemList[NUM_ITEMS];
- Object _objectList[MAX_OBJECTS];
- Object * const _kirkObject;
- Object * const _spockObject;
- Object * const _mccoyObject;
- Object * const _redshirtObject;
+ Actor _actorList[NUM_ACTORS];
+ Actor * const _kirkActor;
+ Actor * const _spockActor;
+ Actor * const _mccoyActor;
+ Actor * const _redshirtActor;
- SharedPtr<FileStream> _objectBanFiles[MAX_OBJECTS / 2];
- uint16 _objectBanVar2[MAX_OBJECTS / 2]; // TODO: initialize?
+ SharedPtr<FileStream> _actorBanFiles[NUM_ACTORS / 2];
+ uint16 _actorBanVar2[NUM_ACTORS / 2]; // TODO: initialize?
Sprite _inventoryIconSprite;
Sprite _itemIconSprite;
Commit: a6bee58f62f3d7d696c6b5493f248390d5c303ac
https://github.com/scummvm/scummvm/commit/a6bee58f62f3d7d696c6b5493f248390d5c303ac
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Default behaviour for look action
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/bitmap.cpp
engines/startrek/bitmap.h
engines/startrek/filestream.cpp
engines/startrek/filestream.h
engines/startrek/font.cpp
engines/startrek/graphics.cpp
engines/startrek/items.h
engines/startrek/sound.cpp
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index e049924..ec931bb 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -29,8 +29,11 @@ void StarTrekEngine::initAwayMission() {
_awayMission = AwayMission(); // Initialize members to 0
// memset(bitmapBuffer->pixels, 0, 0xfa00);
- // sub_15ab1("ground");
- // sub_23a60();
+
+ _txtFilename = "ground";
+ _itemDescription = "";
+
+ // sub_23a60(); // TODO
_sound->loadMusicFile("ground");
loadRoom(_missionToLoad, _roomIndexToLoad);
@@ -196,41 +199,107 @@ void StarTrekEngine::handleAwayMissionEvents() {
}
break;
- case ACTION_USE:
- if (_awayMission.activeItem != OBJECT_REDSHIRT
- || (!_awayMission.redshirtDead && !(_awayMission.field24 & 8))) {
- int clickedObject = findObjectAt(_gfx->getMousePos());
+ case ACTION_USE: {
+ if (_awayMission.activeObject == OBJECT_REDSHIRT && (_awayMission.redshirtDead || (_awayMission.field24 & 8))) {
hideInventoryIcons();
+ _awayMission.activeAction = ACTION_WALK;
+ break;
+ }
- if (clickedObject == OBJECT_INVENTORY_ICON)
- clickedObject = showInventoryMenu(50, 50, false);
+ int clickedObject = findObjectAt(_gfx->getMousePos());
+ hideInventoryIcons();
- if (clickedObject == -1)
- clickedObject = -2;
+ if (clickedObject == OBJECT_INVENTORY_ICON)
+ clickedObject = showInventoryMenu(50, 50, false);
- _awayMission.passiveItem = clickedObject;
- if (clickedObject != -2) {
- // TODO
+ if (clickedObject == -1)
+ clickedObject = -2;
+
+ _awayMission.passiveObject = clickedObject;
+
+ bool activeIsCrewman = _awayMission.activeObject <= OBJECT_REDSHIRT;
+ bool activeIsItem = _awayMission.activeObject >= ITEMS_START && _awayMission.activeObject < ITEMS_END;
+ bool passiveIsCrewman = _awayMission.passiveObject <= OBJECT_REDSHIRT;
+ bool passiveIsItem = _awayMission.passiveObject >= ITEMS_START && _awayMission.passiveObject <= ITEMS_END; // FIXME: "<= ITEMS_END" doesn't make sense?
+
+ if (clickedObject == -2)
+ goto checkAddCommand;
+ if (checkItemInteractionExists(ACTION_USE, _awayMission.activeObject, _awayMission.passiveObject, 0))
+ goto checkAddCommand;
+ if (_awayMission.activeObject == OBJECT_MCCOY) {
+ if (checkItemInteractionExists(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0))
+ goto checkAddCommand;
+ if (checkItemInteractionExists(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0))
+ goto checkAddCommand;
+ }
+ else if (_awayMission.activeObject == OBJECT_SPOCK) {
+ if (checkItemInteractionExists(ACTION_USE, OBJECT_ISTRICOR, _awayMission.passiveObject, 0))
+ goto checkAddCommand;
+ }
+
+ if ((activeIsCrewman && passiveIsCrewman)
+ || (activeIsCrewman && passiveIsItem)
+ || (activeIsItem && passiveIsItem)) {
+ if (_awayMission.passiveObject == OBJECT_ICOMM) {
+ if (sub_2330c())
+ break;
+ addCommand(Command(ACTION_USE, OBJECT_ICOMM, 0, 0));
+ _sound->playVoc("commun30");
+ if (_awayMission.activeObject <= OBJECT_REDSHIRT) {
+ goto checkShowInventory;
+ }
+ else {
+ _awayMission.activeAction = ACTION_WALK;
+ break;
+ }
}
- // if (!sub_2330c()) // TODO
- {
- if (clickedObject != -2)
- addCommand(Command(_awayMission.activeAction, _awayMission.activeItem, _awayMission.passiveItem, 0));
+ _awayMission.activeObject = _awayMission.passiveObject;
+ goto checkShowInventory;
+ }
- if (!(_awayMission.field24 & 1))
- showInventoryIcons(true);
- }
+checkAddCommand:
+ if (!sub_2330c())
+ {
+ if (clickedObject != -2)
+ addCommand(Command(_awayMission.activeAction, _awayMission.activeObject, _awayMission.passiveObject, 0));
+
+checkShowInventory:
+ if (!(_awayMission.field24 & 1))
+ showInventoryIcons(true);
}
break;
- case 3:
- break;
- case 4:
- break;
- case 5:
+ }
+
+ case ACTION_GET:
+ case ACTION_LOOK:
+ case ACTION_TALK: {
+ int clickedObject = findObjectAt(_gfx->getMousePos());
+ // if (!sub_23611(clickedObject, _awayMission.activeAction)) // TODO
+ {
+ hideInventoryIcons();
+ if (clickedObject == OBJECT_INVENTORY_ICON) {
+ clickedObject = showInventoryMenu(50, 50, false);
+ if (clickedObject == -1)
+ clickedObject = -2;
+ }
+
+ _awayMission.activeObject = clickedObject;
+
+ if (sub_2330c())
+ break;
+
+ if (clickedObject != -2)
+ addCommand(Command(_awayMission.activeAction, _awayMission.activeObject, 0, 0));
+
+ if (_awayMission.activeAction == ACTION_LOOK && !(_awayMission.field24 & 1))
+ showInventoryIcons(false);
+ }
break;
}
- break;
+
+ }
+ break; // End of TREKEVENT_LBUTTONDOWN
case TREKEVENT_MOUSEMOVE:
break;
@@ -241,32 +310,32 @@ void StarTrekEngine::handleAwayMissionEvents() {
hideInventoryIcons();
playSoundEffectIndex(0x07);
_awayMission.activeAction = showActionMenu();
- if (_awayMission.activeAction == ACTION_USE) {
+ if (_awayMission.activeAction == ACTION_USE) { // TODO
/*
int16 clickedObject = sub_22f08();
if (clickedObject == -1)
break;
else
- _awayMission.activeItem = clickedObject;
+ _awayMission.activeObject = clickedObject;
*/
}
if (_awayMission.activeAction == ACTION_USE
- && _awayMission.activeItem == 0x47 && (_awayMission.field24 & 1) == 0) {
- /*
- if (sub_2330c() == 0) {
- addCommand(Command(_awayMission.activeAction, _awayMission.activeItem, 0, 0));
+ && _awayMission.activeObject == OBJECT_ICOMM && (_awayMission.field24 & 1) == 0) { // TODO
+ if (!sub_2330c()) {
+ addCommand(Command(_awayMission.activeAction, _awayMission.activeObject, 0, 0));
_sound->playVoc("communic");
_awayMission.activeAction = ACTION_WALK;
}
- */
}
else if (_awayMission.activeAction == ACTION_LOOK)
showInventoryIcons(false);
else if (_awayMission.activeAction == ACTION_USE && (_awayMission.field24 & 1) == 0)
showInventoryIcons(true);
break;
- case TREKEVENT_KEYDOWN:
+
+ case TREKEVENT_KEYDOWN: // TODO
break;
+
default:
break;
}
@@ -309,27 +378,64 @@ SharedPtr<Room> StarTrekEngine::getRoom() {
void StarTrekEngine::addCommand(const Command &command) {
if (command.type != COMMAND_TICK)
- debug("Command %d: %x, %x, %x", command.type, command.b1, command.b2, command.b3);
+ debug("Command %d: %x, %x, %x", command.type, command.gen.b1, command.gen.b2, command.gen.b3);
_commandQueue.push(command);
}
+bool StarTrekEngine::checkItemInteractionExists(int action, int activeItem, int passiveItem, int16 arg6) {
+ // TODO
+ return false;
+}
+
void StarTrekEngine::handleAwayMissionCommand() {
Command command = _commandQueue.pop();
- if ((command.type == COMMAND_FINISHED_BEAMING_IN || command.type == COMMAND_FINISHED_ENTERING_ROOM) && command.b1 == 0xff) {
+ if ((command.type == COMMAND_FINISHED_BEAMING_IN || command.type == COMMAND_FINISHED_ENTERING_ROOM) && command.gen.b1 == 0xff) {
_awayMission.transitioningIntoRoom = 0;
_warpHotspotsActive = true;
return;
}
- else if (command.type == COMMAND_FINISHED_ENTERING_ROOM && command.b1 >= 0xe0) { // TODO
+ else if (command.type == COMMAND_FINISHED_ENTERING_ROOM && command.gen.b1 >= 0xe0) { // TODO
return;
}
switch (command.type) { // TODO: everything
+
+ case COMMAND_WALK: // TODO
+ break;
+
+ case COMMAND_USE: // TODO
+ break;
+
+ case COMMAND_GET: // TODO
+ break;
+
+ case COMMAND_LOOK:
+ if (command.action.activeObject >= ITEMS_START && command.action.activeObject < ITEMS_END) {
+ int i = command.action.activeObject - ITEMS_START;
+ Common::String text = getItemDescription(_itemList[i].textIndex);
+ showTextbox("", text, 20, 20, TEXTCOLOR_YELLOW, 0);
+ }
+ else if (command.action.activeObject == OBJECT_KIRK)
+ showTextbox("", getItemDescription(0x49), 20, 20, TEXTCOLOR_YELLOW, 0);
+ else if (command.action.activeObject == OBJECT_SPOCK)
+ showTextbox("", getItemDescription(0x4a), 20, 20, TEXTCOLOR_YELLOW, 0);
+ else if (command.action.activeObject == OBJECT_MCCOY)
+ showTextbox("", getItemDescription(0x4b), 20, 20, TEXTCOLOR_YELLOW, 0);
+ else {
+ if (command.action.activeObject == OBJECT_REDSHIRT)
+ showTextbox("", getItemDescription(0x4c), 20, 20, TEXTCOLOR_YELLOW, 0);
+ showTextbox("", getItemDescription(0x4d), 20, 20, TEXTCOLOR_YELLOW, 0);
+ }
+ break;
+
+ case COMMAND_TALK: // TODO
+ break;
+
case COMMAND_TOUCHED_WARP:
// if (!sub_203e1(command.type)) // Probably calls RDF code
{
- byte warpIndex = command.b1;
+ byte warpIndex = command.gen.b1;
int16 roomIndex = _room->readRdfWord(RDF_WARP_ROOM_INDICES + warpIndex * 2);
unloadRoom();
_sound->loadMusicFile("ground");
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index c759603..8972306 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -32,8 +32,8 @@ struct AwayMission {
byte transitioningIntoRoom; // Set while beaming in or walking into a room
bool redshirtDead;
byte activeAction;
- byte activeItem; // The item that is going to be used on something
- byte passiveItem; // The item that the active item is used on (or the item looked at, etc).
+ byte activeObject; // The item that is going to be used on something
+ byte passiveObject; // The item that the active item is used on (or the item looked at, etc).
byte field24;
int8 field25[4];
diff --git a/engines/startrek/bitmap.cpp b/engines/startrek/bitmap.cpp
index 61e5bce..19f1434 100644
--- a/engines/startrek/bitmap.cpp
+++ b/engines/startrek/bitmap.cpp
@@ -24,7 +24,7 @@
namespace StarTrek {
-Bitmap::Bitmap(SharedPtr<Common::ReadStreamEndian> stream) {
+Bitmap::Bitmap(SharedPtr<FileStream> stream) {
xoffset = stream->readUint16();
yoffset = stream->readUint16();
width = stream->readUint16();
diff --git a/engines/startrek/bitmap.h b/engines/startrek/bitmap.h
index 7d3f2fd..fcebd67 100644
--- a/engines/startrek/bitmap.h
+++ b/engines/startrek/bitmap.h
@@ -1,6 +1,8 @@
#ifndef STARTREK_BITMAP_H
#define STARTREK_BITMAP_H
+#include "startrek/filestream.h"
+
#include "common/ptr.h"
#include "common/stream.h"
@@ -13,7 +15,7 @@ struct Bitmap {
uint16 height;
byte *pixels;
- Bitmap(Common::SharedPtr<Common::ReadStreamEndian> stream);
+ Bitmap(Common::SharedPtr<FileStream> stream);
Bitmap(int w, int h);
~Bitmap();
diff --git a/engines/startrek/filestream.cpp b/engines/startrek/filestream.cpp
index 3af5ca8..31cb789 100644
--- a/engines/startrek/filestream.cpp
+++ b/engines/startrek/filestream.cpp
@@ -2,37 +2,60 @@
namespace StarTrek {
-FileStream::FileStream(Common::SeekableReadStream *stream, bool bigEndian) : Common::SeekableReadStreamEndian(bigEndian) {
- _stream = stream;
+FileStream::FileStream(Common::SeekableReadStream *stream, bool bigEndian) {
_bigEndian = bigEndian;
+
+ _pos = 0;
+ _size = stream->size();
+ _data = new byte[_size];
+ stream->read(_data, _size);
+ delete stream;
}
FileStream::~FileStream() {
- delete _stream;
+ delete[] _data;
}
// ReadStream functions
-bool FileStream::eos() const {
- return _stream->eos();
+uint32 FileStream::read(void* dataPtr, uint32 dataSize) {
+ if (_pos + dataSize > (uint32)size())
+ dataSize = size() - _pos;
+ memcpy(dataPtr, _data + _pos, dataSize);
+ _pos += dataSize;
+ return dataSize;
}
-uint32 FileStream::read(void* dataPtr, uint32 dataSize) {
- return _stream->read(dataPtr, dataSize);
+byte FileStream::readByte() {
+ assert(_pos + 1 <= size());
+ return _data[_pos++];
+}
+
+uint16 FileStream::readUint16() {
+ assert(_pos + 2 <= size());
+ uint16 w;
+ if (_bigEndian)
+ w = _data[_pos + 1] | (_data[_pos] << 8);
+ else
+ w = _data[_pos] | (_data[_pos + 1] << 8);
+ _pos += 2;
+ return w;
}
// SeekableReadStream functions
int32 FileStream::pos() const {
- return _stream->pos();
+ return _pos;
}
int32 FileStream::size() const {
- return _stream->size();
+ return _size;
}
bool FileStream::seek(int32 offset, int whence) {
- return _stream->seek(offset, whence);
+ assert(whence == SEEK_SET);
+ _pos = offset;
+ return true;
}
}
diff --git a/engines/startrek/filestream.h b/engines/startrek/filestream.h
index dcc8060..79a919a 100644
--- a/engines/startrek/filestream.h
+++ b/engines/startrek/filestream.h
@@ -26,25 +26,31 @@
namespace StarTrek {
-class FileStream : public Common::SeekableReadStreamEndian {
+class FileStream {
public:
FileStream(Common::SeekableReadStream *stream, bool bigEndian);
~FileStream();
+ byte *_data;
+
private:
- Common::SeekableReadStream *_stream;
bool _bigEndian;
+ int32 _pos;
+ int32 _size;
public:
// ReadStream functions
- virtual bool eos() const;
- virtual uint32 read(void *dataPtr, uint32 dataSize);
+ bool eos() const;
+ uint32 read(void *dataPtr, uint32 dataSize);
+
+ byte readByte();
+ uint16 readUint16();
// SeekableReadStream functions
- virtual int32 pos() const;
- virtual int32 size() const;
- virtual bool seek(int32 offset, int whence);
+ int32 pos() const;
+ int32 size() const;
+ bool seek(int32 offset, int whence);
};
diff --git a/engines/startrek/font.cpp b/engines/startrek/font.cpp
index 8463841..7cba711 100644
--- a/engines/startrek/font.cpp
+++ b/engines/startrek/font.cpp
@@ -31,33 +31,12 @@ static const byte CHARACTER_COUNT = 0x80;
static const byte CHARACTER_SIZE = 0x40;
Font::Font(StarTrekEngine *vm) : _vm(vm) {
- SharedPtr<Common::SeekableReadStream> fontStream = _vm->loadFile("FONT.FNT");
+ SharedPtr<FileStream> fontStream = _vm->loadFile("FONT.FNT");
_characters = new Character[CHARACTER_COUNT];
for (byte i = 0; i < CHARACTER_COUNT; i++)
fontStream->read(_characters[i].data, CHARACTER_SIZE);
-
-#if 0
- // Code to dump the font
- printf ("DUMPING FONT");
- for (byte i = 0; i < CHARACTER_COUNT; i++) {
- printf ("\n\nCHARACTER %02x (%d):\n", i, i);
- for (byte j = 0; j < CHARACTER_SIZE; j++) {
- if (!(j % 8))
- printf ("\n");
- if (_characters[i].data[j] == 0x7d)
- printf ("1 ");
- else if (_characters[i].data[j] == 0x78)
- printf ("0 ");
- else if (_characters[i].data[j] == 0)
- printf (" ");
- else
- printf ("? ");
- }
- }
- printf("\n\n");
-#endif
}
Font::~Font() {
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index e33fa51..2e28951 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -80,11 +80,11 @@ void Graphics::loadPalette(const Common::String &paletteName) {
Common::String palFile = paletteName + ".PAL";
Common::String lutFile = paletteName + ".LUT";
- SharedPtr<Common::SeekableReadStream> palStream = _vm->loadFile(palFile.c_str());
+ SharedPtr<FileStream> palStream = _vm->loadFile(palFile.c_str());
palStream->read(_palData, 256 * 3);
// Load LUT file
- SharedPtr<Common::SeekableReadStream> lutStream = _vm->loadFile(lutFile.c_str());
+ SharedPtr<FileStream> lutStream = _vm->loadFile(lutFile.c_str());
lutStream->read(_lutData, 256);
}
@@ -160,7 +160,7 @@ void Graphics::decPaletteFadeLevel() {
void Graphics::loadPri(const Common::String &priFile) {
- SharedPtr<Common::SeekableReadStream> priStream = _vm->loadFile(priFile);
+ SharedPtr<FileStream> priStream = _vm->loadFile(priFile);
priStream->read(_priData, SCREEN_WIDTH * SCREEN_HEIGHT / 2);
}
@@ -632,14 +632,14 @@ void Graphics::loadEGAData(const char *filename) {
if (!_egaData)
_egaData = new byte[256];
- SharedPtr<Common::SeekableReadStream> egaStream = _vm->loadFile(filename);
+ SharedPtr<FileStream> egaStream = _vm->loadFile(filename);
egaStream->read(_egaData, 256);
}
void Graphics::drawBackgroundImage(const char *filename) {
// Draw an stjr BGD image (palette built-in)
- SharedPtr<Common::SeekableReadStream> imageStream = _vm->loadFile(filename);
+ SharedPtr<FileStream> imageStream = _vm->loadFile(filename);
byte *palette = new byte[256 * 3];
imageStream->read(palette, 256 * 3);
@@ -647,10 +647,10 @@ void Graphics::drawBackgroundImage(const char *filename) {
for (uint16 i = 0; i < 256 * 3; i++)
palette[i] <<= 2;
- uint16 xoffset = imageStream->readUint16LE();
- uint16 yoffset = imageStream->readUint16LE();
- uint16 width = imageStream->readUint16LE();
- uint16 height = imageStream->readUint16LE();
+ uint16 xoffset = imageStream->readUint16();
+ uint16 yoffset = imageStream->readUint16();
+ uint16 width = imageStream->readUint16();
+ uint16 height = imageStream->readUint16();
byte *pixels = new byte[width * height];
imageStream->read(pixels, width * height);
diff --git a/engines/startrek/items.h b/engines/startrek/items.h
index 913ec7d..2bf89f6 100644
--- a/engines/startrek/items.h
+++ b/engines/startrek/items.h
@@ -25,11 +25,87 @@
namespace StarTrek {
+enum Items {
+ OBJECT_IPHASERS = 64,
+ OBJECT_IPHASERK,
+ OBJECT_IHAND,
+ OBJECT_IROCK,
+ OBJECT_ISTRICOR,
+ OBJECT_IMTRICOR,
+ OBJECT_IDEADGUY,
+ OBJECT_ICOMM,
+ OBJECT_IPBC,
+ OBJECT_IRLG,
+ OBJECT_IWRENCH,
+ OBJECT_IINSULAT,
+ OBJECT_ISAMPLE,
+ OBJECT_ICURE,
+ OBJECT_IDISHES,
+ OBJECT_IRT,
+ OBJECT_IRTWB,
+ OBJECT_ICOMBBIT,
+ OBJECT_IJNKMETL,
+ OBJECT_IWIRING,
+ OBJECT_IWIRSCRP,
+ OBJECT_IPWF,
+ OBJECT_IPWE,
+ OBJECT_IDEADPH,
+ OBJECT_IBOMB,
+ OBJECT_IMETAL,
+ OBJECT_ISKULL,
+ OBJECT_IMINERAL,
+ OBJECT_IMETEOR,
+ OBJECT_ISHELLS,
+ OBJECT_IDEGRIME,
+ OBJECT_ILENSES,
+ OBJECT_IDISKS,
+ OBJECT_IANTIGRA,
+ OBJECT_IN2GAS,
+ OBJECT_IO2GAS,
+ OBJECT_IH2GAS,
+ OBJECT_IN2O,
+ OBJECT_INH3,
+ OBJECT_IH2O,
+ OBJECT_IWROD,
+ OBJECT_IIROD,
+ OBJECT_IREDGEM_A, // FIXME: repeated items? (applies to all names with _A, _B, or _C)
+ OBJECT_IREDGEM_B,
+ OBJECT_IREDGEM_C,
+ OBJECT_IGRNGEM_A,
+ OBJECT_IGRNGEM_B,
+ OBJECT_IGRNGEM_C,
+ OBJECT_IBLUGEM_A,
+ OBJECT_IBLUGEM_B,
+ OBJECT_IBLUGEM_C,
+ OBJECT_ICONECT,
+ OBJECT_IS8ROCKS,
+ OBJECT_IIDCARD,
+ OBJECT_ISNAKE,
+ OBJECT_IFERN,
+ OBJECT_ICRYSTAL,
+ OBJECT_IKNIFE,
+ OBJECT_IDETOXIN,
+ OBJECT_IBERRY,
+ OBJECT_IDOOVER,
+ OBJECT_IALIENDV,
+ OBJECT_ICAPSULE,
+ OBJECT_IMEDKIT,
+ OBJECT_IBEAM,
+ OBJECT_IDRILL,
+ OBJECT_IHYPO,
+ OBJECT_IFUSION,
+ OBJECT_ICABLE1,
+ OBJECT_ICABLE2,
+ OBJECT_ILMD,
+ OBJECT_IDECK,
+ OBJECT_ITECH
+};
+
struct Item {
bool have;
int16 field2;
char name[10];
- int16 index;
+ int16 textIndex;
};
// This is copied to StarTrekEngine::_itemList when the engine initializes.
@@ -174,10 +250,10 @@ const Item g_itemList[] = {
{ false, 0x00, "", 0x00 },
{ false, 0x00, "", 0x00 },
{ false, 0x00, "", 0x00 },
- { false, 0x00, "", 0x00 },
+ { false, 0x00, "", 0x00 }
};
-const int NUM_ITEMS = sizeof(g_itemList) / sizeof(struct Item) - 0x40; // 0x49
+const int NUM_ITEMS = sizeof(g_itemList) / sizeof(struct Item) - 64; // 0x49
}
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 45b6eb0..5ae06e2 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -312,7 +312,7 @@ void Sound::loadPCMusicFile(const Common::String &baseSoundName) {
}
debugC(5, kDebugSound, "Loading midi \'%s\'\n", soundName.c_str());
- SharedPtr<Common::SeekableReadStream> soundStream = _vm->loadFile(soundName.c_str());
+ SharedPtr<FileStream> soundStream = _vm->loadFile(soundName.c_str());
if (loadedSoundData != nullptr)
delete[] loadedSoundData;
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 8df22ea..5e64682 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -815,7 +815,7 @@ int StarTrekEngine::findObjectAt(int x, int y) {
if (sprite == &_inventoryIconSprite)
return OBJECT_INVENTORY_ICON;
else if (sprite == &_itemIconSprite)
- return _awayMission.activeItem;
+ return _awayMission.activeObject;
for (int i = 0; i < NUM_ACTORS; i++) {
Actor *actor = &_actorList[i];
@@ -1019,11 +1019,13 @@ void StarTrekEngine::showInventoryIcons(bool showItem) {
Common::String itemFilename;
if (showItem) {
- int i = _awayMission.activeItem;
- if (i >= 0 && i <= 3)
+ int i = _awayMission.activeObject;
+ if (i >= OBJECT_KIRK && i <= OBJECT_REDSHIRT)
itemFilename = crewmanFilenames[i];
else {
- // TODO
+ assert(i >= ITEMS_START && i < ITEMS_END);
+ Item *item = &_itemList[i - ITEMS_START];
+ itemFilename = item->name;
}
}
@@ -1602,4 +1604,20 @@ uint16 StarTrekEngine::getRandomWord() {
return _randomSource.getRandomNumber(0xffff);
}
+/**
+ * ".txt" files are just lists of strings. This traverses the file to get a particular
+ * string index.
+ */
+Common::String StarTrekEngine::getItemDescription(int itemIndex) {
+ SharedPtr<FileStream> txtFile = loadFile(_txtFilename + ".txt");
+
+ byte *data = txtFile->_data;
+ while (itemIndex != 0) {
+ while (*(data++) != '\0');
+ itemIndex--;
+ }
+
+ return (char *)data;
+}
+
} // End of namespace StarTrek
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index b853809..9689c04 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -93,6 +93,10 @@ enum TextDisplayMode {
TEXTDISPLAY_NONE // No text displayed
};
+enum TextColor {
+ TEXTCOLOR_YELLOW = 0xb0
+};
+
// Keeps track of data for a list of buttons making up a menu
struct Menu {
Sprite sprites[MAX_MENUBUTTONS];
@@ -161,7 +165,11 @@ struct TrekEvent {
// code.
enum Commands {
COMMAND_TICK = 0,
- COMMAND_CLICKED_ON_OBJECT = 1,
+ COMMAND_WALK = 1, // Commands 1-5 correspond to Actions of the same number.
+ COMMAND_USE = 2,
+ COMMAND_GET = 3,
+ COMMAND_LOOK = 4,
+ COMMAND_TALK = 5,
COMMAND_TOUCHED_WARP = 6,
COMMAND_7 = 7, // Doors? (Or just hotspots activated by Kirk moving there?)
COMMAND_FINISHED_BEAMING_IN = 10,
@@ -170,12 +178,26 @@ enum Commands {
struct Command {
byte type;
- byte b1;
- byte b2;
- byte b3;
+
+ union { // FIXME: using unions in a dangeous way here...
+ struct {
+ byte b1;
+ byte b2;
+ byte b3;
+ } gen;
+
+ struct {
+ byte activeObject;
+ byte passiveObject;
+ } action;
+ };
Command(byte _type, byte _b1, byte _b2, byte _b3)
- : type(_type), b1(_b1), b2(_b2), b3(_b3) {}
+ : type(_type) {
+ gen.b1 = _b1;
+ gen.b2 = _b2;
+ gen.b3 = _b3;
+ }
};
// Actions that can be used on away missions.
@@ -213,6 +235,7 @@ private:
int loadActorAnimWithRoomScaling(int actorIndex, const Common::String &animName, int16 x, int16 y);
uint16 getActorScaleAtPosition(int16 y);
void addCommand(const Command &command);
+ bool checkItemInteractionExists(int action, int activeItem, int passiveItem, int16 arg6);
void handleAwayMissionCommand();
bool isPointInPolygon(int16 *data, int16 x, int16 y);
@@ -254,6 +277,7 @@ public:
SharedPtr<Bitmap> loadAnimationFrame(const Common::String &filename, Fixed16 scale);
Common::String getCrewmanAnimFilename(int actorIndex, const Common::String &basename);
void updateMouseBitmap();
+ bool sub_2330c() { return false; } // TODO
void showInventoryIcons(bool showItem);
void hideInventoryIcons();
int showInventoryMenu(int x, int y, bool restoreMouse);
@@ -293,6 +317,8 @@ public:
String readTextFromRdf(int choiceIndex, uintptr data, String *headerTextOutput);
String readTextFromBuffer(int choiceIndex, uintptr data, String *headerTextOutput);
+ int showTextbox(String headerText, const String &mainText, int xoffset, int yoffset, byte textColor, int maxTextLines); // TODO: better name. (return type?)
+
String skipTextAudioPrompt(const String &str);
String playTextAudio(const String &str);
@@ -359,6 +385,7 @@ public:
// Misc
uint16 getRandomWord();
+ Common::String getItemDescription(int itemIndex);
public:
@@ -375,6 +402,9 @@ public:
SharedPtr<FileStream> _mapFile;
int32 _playerActorScale;
+ Common::String _txtFilename;
+ Common::String _itemDescription;
+
// Queue of "commands" (ie. next frame, clicked on object) for away mission or bridge
Common::Queue<Command> _commandQueue;
@@ -384,7 +414,7 @@ public:
int16 _activeDoorWarpHotspot;
int16 _lookActionBitmapIndex;
- Item _itemList[NUM_ITEMS];
+ Item _itemList[NUM_OBJECTS];
Actor _actorList[NUM_ACTORS];
Actor * const _kirkActor;
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 04b40bf..217bd7f 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -130,17 +130,32 @@ String StarTrekEngine::readTextFromRdf(int choiceIndex, uintptr data, String *he
}
/**
- * Text getter for showText which reads from a given buffer.
+ * Shows text with the given header and main text.
*/
-String StarTrekEngine::readTextFromBuffer(int choiceIndex, uintptr data, String *headerTextOutput) {
- char buf[TEXTBOX_WIDTH];
- memcpy(buf, (byte*)data, TEXTBOX_WIDTH-2);
- buf[TEXTBOX_WIDTH-2] = '\0';
+int StarTrekEngine::showTextbox(String headerText, const String &mainText, int xoffset, int yoffset, byte textColor, int maxTextLines) {
+ if (!headerText.empty()) {
+ while (headerText.size() < TEXTBOX_WIDTH - 2)
+ headerText += ' ';
+ }
+
+ int newMaxTextLines = (maxTextLines < 0 ? 0 : maxTextLines);
+ if (maxTextLines < 0)
+ maxTextLines = -maxTextLines;
- *headerTextOutput = String(buf);
+ const char *strings[3];
+
+ if (headerText.empty())
+ strings[0] = nullptr;
+ else
+ strings[0] = headerText.c_str();
+ strings[1] = mainText.c_str();
+ strings[2] = "";
- char *text = (char*)data+TEXTBOX_WIDTH-2;
- return String(text);
+ showText(&StarTrekEngine::readTextFromArray, (uintptr)strings, xoffset, yoffset, textColor, false, maxTextLines, 0);
+
+ // TODO
+ // sub_15a77();
+ // sub_14669(newMaxTextLines);
}
String StarTrekEngine::skipTextAudioPrompt(const String &str) {
@@ -587,8 +602,7 @@ String StarTrekEngine::readLineFormattedText(TextGetterFunc textGetter, uintptr
String lineFormattedText = putTextIntoLines(text);
drawMainText(textBitmap, *numTextLines, numTextboxLines, lineFormattedText, hasHeader);
- assert(headerText.size() == TEXTBOX_WIDTH-2);
- memcpy(textBitmap->pixels+TEXTBOX_WIDTH+1, headerText.c_str(), TEXTBOX_WIDTH-2);
+ memcpy(textBitmap->pixels+TEXTBOX_WIDTH+1, headerText.c_str(), headerText.size());
return lineFormattedText;
}
@@ -627,9 +641,13 @@ String StarTrekEngine::readTextFromArray(int choiceIndex, uintptr data, String *
if (*mainText == '\0')
return Common::String(); // Technically should be nullptr...
- *headerTextOutput = headerText;
- while (headerTextOutput->size() < TEXTBOX_WIDTH-2)
- *headerTextOutput += ' ';
+ if (headerText == nullptr)
+ *headerTextOutput = "";
+ else {
+ *headerTextOutput = headerText;
+ while (headerTextOutput->size() < TEXTBOX_WIDTH-2)
+ *headerTextOutput += ' ';
+ }
return String(mainText);
}
Commit: 66b4ec36bdfb19a5242325e58c3180bc79574c89
https://github.com/scummvm/scummvm/commit/66b4ec36bdfb19a5242325e58c3180bc79574c89
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Cleanup some text code
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/menu.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index ec931bb..16d4591 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -31,7 +31,7 @@ void StarTrekEngine::initAwayMission() {
// memset(bitmapBuffer->pixels, 0, 0xfa00);
_txtFilename = "ground";
- _itemDescription = "";
+ _loadedText = "";
// sub_23a60(); // TODO
_sound->loadMusicFile("ground");
@@ -425,6 +425,11 @@ void StarTrekEngine::handleAwayMissionCommand() {
else {
if (command.action.activeObject == OBJECT_REDSHIRT)
showTextbox("", getItemDescription(0x4c), 20, 20, TEXTCOLOR_YELLOW, 0);
+
+ // Show generic "nothing of note" text.
+ // BUG? This text is also shown after looking at the redshirt. However, his
+ // text is normally overridden on a per-mission basis, so perhaps this bug
+ // never manifests itself?
showTextbox("", getItemDescription(0x4d), 20, 20, TEXTCOLOR_YELLOW, 0);
}
break;
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index 37ab57b..b0aea1f 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -839,7 +839,7 @@ void StarTrekEngine::showQuitGamePrompt(int x, int y) {
return;
_inQuitGameMenu = true;
- int val = showText(&StarTrekEngine::readTextFromArray, (uintptr)options, x, y, 0xb0, true, 0, 1);
+ int val = showText(&StarTrekEngine::readTextFromArray, (uintptr)options, x, y, TEXTCOLOR_YELLOW, true, 0, true);
_inQuitGameMenu = false;
if (val == 0) {
@@ -863,7 +863,7 @@ void StarTrekEngine::showTextConfigurationMenu(bool fromOptionMenu) {
int val;
if (fromOptionMenu || (val = loadTextDisplayMode()) == -1) {
- val = showText(&StarTrekEngine::readTextFromArray, (uintptr)options, 20, 30, 0xb0, true, 0, 1);
+ val = showText(&StarTrekEngine::readTextFromArray, (uintptr)options, 20, 30, TEXTCOLOR_YELLOW, true, 0, true);
saveTextDisplayMode(val);
}
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 9689c04..5301f4d 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -317,12 +317,12 @@ public:
String readTextFromRdf(int choiceIndex, uintptr data, String *headerTextOutput);
String readTextFromBuffer(int choiceIndex, uintptr data, String *headerTextOutput);
- int showTextbox(String headerText, const String &mainText, int xoffset, int yoffset, byte textColor, int maxTextLines); // TODO: better name. (return type?)
+ void showTextbox(String headerText, const String &mainText, int xoffset, int yoffset, byte textColor, int maxTextLines); // TODO: better name. (return type?)
String skipTextAudioPrompt(const String &str);
String playTextAudio(const String &str);
- int showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, int arg10);
+ int showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, bool rclickCancelsChoice);
int getNumTextboxLines(const String &str);
String putTextIntoLines(const String &text);
@@ -403,7 +403,7 @@ public:
int32 _playerActorScale;
Common::String _txtFilename;
- Common::String _itemDescription;
+ Common::String _loadedText; // TODO: might be OK to delete this
// Queue of "commands" (ie. next frame, clicked on object) for away mission or bridge
Common::Queue<Command> _commandQueue;
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 217bd7f..11602bf 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -40,7 +40,6 @@ const char *StarTrekEngine::getNextTextLine(const char *text, char *lineOutput,
const char *lastSpaceInput = nullptr;
char *lastSpaceOutput = nullptr;
- int var4;
int charIndex = 0;
while (charIndex != lineWidth && *text != '\0') {
@@ -52,7 +51,6 @@ const char *StarTrekEngine::getNextTextLine(const char *text, char *lineOutput,
}
if (c == ' ') {
- var4 = charIndex;
lastSpaceInput = text;
lastSpaceOutput = lineOutput;
}
@@ -132,13 +130,14 @@ String StarTrekEngine::readTextFromRdf(int choiceIndex, uintptr data, String *he
/**
* Shows text with the given header and main text.
*/
-int StarTrekEngine::showTextbox(String headerText, const String &mainText, int xoffset, int yoffset, byte textColor, int maxTextLines) {
+void StarTrekEngine::showTextbox(String headerText, const String &mainText, int xoffset, int yoffset, byte textColor, int maxTextLines) {
if (!headerText.empty()) {
while (headerText.size() < TEXTBOX_WIDTH - 2)
headerText += ' ';
}
- int newMaxTextLines = (maxTextLines < 0 ? 0 : maxTextLines);
+ int commandParam = (maxTextLines < 0 ? 0 : maxTextLines);
+
if (maxTextLines < 0)
maxTextLines = -maxTextLines;
@@ -151,11 +150,9 @@ int StarTrekEngine::showTextbox(String headerText, const String &mainText, int x
strings[1] = mainText.c_str();
strings[2] = "";
- showText(&StarTrekEngine::readTextFromArray, (uintptr)strings, xoffset, yoffset, textColor, false, maxTextLines, 0);
+ showText(&StarTrekEngine::readTextFromArray, (uintptr)strings, xoffset, yoffset, textColor, false, maxTextLines, false);
- // TODO
- // sub_15a77();
- // sub_14669(newMaxTextLines);
+ addCommand(Command(COMMAND_TALK, commandParam, 0, 0));
}
String StarTrekEngine::skipTextAudioPrompt(const String &str) {
@@ -199,12 +196,16 @@ String StarTrekEngine::playTextAudio(const String &str) {
return String(text+1);
}
-int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, int arg10) {
+/**
+ * @param rclickCancelsChoice If true, right-clicks return "-1" as choice instead of
+ * whetever was selected.
+ */
+int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, bool rclickCancelsChoice) {
int16 tmpTextDisplayMode = _textDisplayMode;
- uint32 var7c = 8;
- if (_frameIndex > _textboxVar2+1) {
- var7c = 0x10;
+ uint32 ticksUntilClickingEnabled = 8;
+ if (_frameIndex > _textboxVar2 + 1) {
+ ticksUntilClickingEnabled = 0x10;
}
int numChoicesWithNames = 0;
@@ -217,11 +218,11 @@ int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset
if (choiceText.empty())
break;
- int lines = getNumTextboxLines(choiceText);
+ int lines = getNumTextboxLines(skipTextAudioPrompt(choiceText));
if (lines > numTextboxLines)
numTextboxLines = lines;
- if (!speakerText.empty()) // Technically should check for nullptr
+ if (!speakerText.empty()) // FIXME: Technically should check for nullptr
numChoicesWithNames++;
numChoices++;
@@ -256,6 +257,8 @@ int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset
String lineFormattedText = readLineFormattedText(textGetter, var, choiceIndex, textBitmap, numTextboxLines, &numTextLines);
if (lineFormattedText.empty()) { // Technically should check for nullptr
+ _gfx->delSprite(&textboxSprite);
+
// TODO
}
else {
@@ -280,7 +283,7 @@ int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset
disableMenuButtons(1 << TEXTBUTTON_SCROLLUP); // Disable scroll up
- if (var7c == 0) { // Disable done button
+ if (ticksUntilClickingEnabled == 0) { // Disable done button
disableMenuButtons(1 << TEXTBUTTON_CONFIRM);
}
if (!loopChoices) { // Disable prev button
@@ -291,9 +294,9 @@ int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset
// Loop until text is done being displayed
while (!doneShowingText) {
- int textboxReturnCode = handleMenuEvents(var7c, true);
+ int textboxReturnCode = handleMenuEvents(ticksUntilClickingEnabled, true);
- if (var7c == 0) {
+ if (ticksUntilClickingEnabled == 0) {
enableMenuButtons(1 << TEXTBUTTON_CONFIRM);
}
@@ -301,9 +304,9 @@ int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset
case MENUEVENT_RCLICK_OFFBUTTON:
case MENUEVENT_RCLICK_ONBUTTON:
- if (var7c == 0) {
+ if (ticksUntilClickingEnabled == 0) {
doneShowingText = true;
- if (arg10)
+ if (rclickCancelsChoice)
choiceIndex = -1;
}
break;
@@ -411,6 +414,8 @@ reloadText:
default:
break;
}
+
+ ticksUntilClickingEnabled = 0;
}
_gfx->setMouseBitmap(oldMouseBitmap);
@@ -418,12 +423,10 @@ reloadText:
_mouseControllingShip = tmpMouseControllingShip;
unloadMenuButtons();
- textboxSprite.field16 = true;
- textboxSprite.bitmapChanged = true;
+ textboxSprite.dontDrawNextFrame();
_gfx->drawAllSprites();
_gfx->delSprite(&textboxSprite);
- // sub_272B4
}
_textboxVar2 = _frameIndex;
Commit: bd79e4d653f9476de1501de149589e583e47411d
https://github.com/scummvm/scummvm/commit/bd79e4d653f9476de1501de149589e583e47411d
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Begin on room-specific code for room 1
Changed paths:
A engines/startrek/action.h
A engines/startrek/rooms/demon0.cpp
A engines/startrek/rooms/function_map.h
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/module.mk
engines/startrek/object.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
new file mode 100644
index 0000000..68d5823
--- /dev/null
+++ b/engines/startrek/action.h
@@ -0,0 +1,65 @@
+/* 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.
+ *
+ */
+
+#ifndef STARTREK_ACTION_H
+#define STARTREK_ACTION_H
+
+
+enum Acton {
+ ACTION_TICK = 0,
+
+ ACTION_WALK = 1, // Actions 1-5 are directly usable on away missions.
+ ACTION_USE = 2,
+ ACTION_GET = 3,
+ ACTION_LOOK = 4,
+ ACTION_TALK = 5,
+
+ ACTION_TOUCHED_WARP = 6,
+ ACTION_TOUCHED_HOTSPOT = 7, // Doors? (Or just hotspots activated by Kirk moving there?)
+ ACTION_FINISHED_BEAMING_IN = 10,
+ ACTION_FINISHED_ENTERING_ROOM = 12,
+ ACTION_OPTIONS = 13 // Not really an action, but selectable from action menu
+};
+
+struct Action {
+ byte type;
+ byte b1;
+ byte b2;
+ byte b3;
+
+ Action(byte _type, byte _b1, byte _b2, byte _b3)
+ : type(_type),
+ b1(_b1),
+ b2(_b2),
+ b3(_b3) {}
+
+
+ // ACTION_USE, ACTION_GET, ACTION_LOOK, ACTION_TALK
+ byte activeObject() { return b1; }
+ byte passiveObject() { return b2; }
+
+ bool operator==(const Action &a) const {
+ return type == a.type && b1 == a.b1 && b2 == a.b2 && b3 == a.b3;
+ }
+};
+
+#endif
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 16d4591..5db0271 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -21,6 +21,7 @@
*/
#include "startrek/iwfile.h"
+#include "startrek/room.h"
#include "startrek/startrek.h"
namespace StarTrek {
@@ -50,11 +51,11 @@ void StarTrekEngine::runAwayMission() {
_awayMission.mouseX = mousePos.x;
_awayMission.mouseY = mousePos.y;
- assert(_commandQueue.size() <= 16);
- if (!_commandQueue.empty()) {
+ assert(_actionQueue.size() <= 16);
+ if (!_actionQueue.empty()) {
// sub_200e7();
// sub_20118();
- handleAwayMissionCommand();
+ handleAwayMissionAction();
}
}
}
@@ -101,7 +102,7 @@ void StarTrekEngine::loadRoom(const Common::String &missionName, int roomIndex)
// TODO: RDF vars 1e/1f and 20/21; relates to BAN files?
- _commandQueue.clear();
+ _actionQueue.clear();
}
void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) {
@@ -168,7 +169,7 @@ void StarTrekEngine::handleAwayMissionEvents() {
// sub_22de0();
_frameIndex++;
_roomFrameCounter++;
- addCommand(Command(COMMAND_TICK, _roomFrameCounter & 0xff, (_roomFrameCounter >> 8) & 0xff, 0));
+ addAction(Action(ACTION_TICK, _roomFrameCounter & 0xff, (_roomFrameCounter >> 8) & 0xff, 0));
if (_roomFrameCounter >= 2)
_gfx->incPaletteFadeLevel();
break;
@@ -209,11 +210,15 @@ void StarTrekEngine::handleAwayMissionEvents() {
int clickedObject = findObjectAt(_gfx->getMousePos());
hideInventoryIcons();
- if (clickedObject == OBJECT_INVENTORY_ICON)
+ if (clickedObject == OBJECT_INVENTORY_ICON) {
clickedObject = showInventoryMenu(50, 50, false);
- if (clickedObject == -1)
- clickedObject = -2;
+ // -1 means "clicked on something unknown"; -2 means "clicked on
+ // nothing". In the case of the inventory, either one clicks on an
+ // inventory item, or no action is performed.
+ if (clickedObject == -1)
+ clickedObject = -2;
+ }
_awayMission.passiveObject = clickedObject;
@@ -223,18 +228,18 @@ void StarTrekEngine::handleAwayMissionEvents() {
bool passiveIsItem = _awayMission.passiveObject >= ITEMS_START && _awayMission.passiveObject <= ITEMS_END; // FIXME: "<= ITEMS_END" doesn't make sense?
if (clickedObject == -2)
- goto checkAddCommand;
- if (checkItemInteractionExists(ACTION_USE, _awayMission.activeObject, _awayMission.passiveObject, 0))
- goto checkAddCommand;
+ goto checkAddAction;
+ if (_room->actionHasCode(Action(ACTION_USE, _awayMission.activeObject, _awayMission.passiveObject, 0)))
+ goto checkAddAction;
if (_awayMission.activeObject == OBJECT_MCCOY) {
- if (checkItemInteractionExists(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0))
- goto checkAddCommand;
- if (checkItemInteractionExists(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0))
- goto checkAddCommand;
+ if (_room->actionHasCode(Action(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0)))
+ goto checkAddAction;
+ if (_room->actionHasCode(Action(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0)))
+ goto checkAddAction;
}
else if (_awayMission.activeObject == OBJECT_SPOCK) {
- if (checkItemInteractionExists(ACTION_USE, OBJECT_ISTRICOR, _awayMission.passiveObject, 0))
- goto checkAddCommand;
+ if (_room->actionHasCode(Action(ACTION_USE, OBJECT_ISTRICOR, _awayMission.passiveObject, 0)))
+ goto checkAddAction;
}
if ((activeIsCrewman && passiveIsCrewman)
@@ -243,7 +248,7 @@ void StarTrekEngine::handleAwayMissionEvents() {
if (_awayMission.passiveObject == OBJECT_ICOMM) {
if (sub_2330c())
break;
- addCommand(Command(ACTION_USE, OBJECT_ICOMM, 0, 0));
+ addAction(Action(ACTION_USE, OBJECT_ICOMM, 0, 0));
_sound->playVoc("commun30");
if (_awayMission.activeObject <= OBJECT_REDSHIRT) {
goto checkShowInventory;
@@ -258,11 +263,11 @@ void StarTrekEngine::handleAwayMissionEvents() {
goto checkShowInventory;
}
-checkAddCommand:
+checkAddAction:
if (!sub_2330c())
{
if (clickedObject != -2)
- addCommand(Command(_awayMission.activeAction, _awayMission.activeObject, _awayMission.passiveObject, 0));
+ addAction(Action(_awayMission.activeAction, _awayMission.activeObject, _awayMission.passiveObject, 0));
checkShowInventory:
if (!(_awayMission.field24 & 1))
@@ -290,7 +295,7 @@ checkShowInventory:
break;
if (clickedObject != -2)
- addCommand(Command(_awayMission.activeAction, _awayMission.activeObject, 0, 0));
+ addAction(Action(_awayMission.activeAction, _awayMission.activeObject, 0, 0));
if (_awayMission.activeAction == ACTION_LOOK && !(_awayMission.field24 & 1))
showInventoryIcons(false);
@@ -310,19 +315,18 @@ checkShowInventory:
hideInventoryIcons();
playSoundEffectIndex(0x07);
_awayMission.activeAction = showActionMenu();
- if (_awayMission.activeAction == ACTION_USE) { // TODO
- /*
- int16 clickedObject = sub_22f08();
+ if (_awayMission.activeAction == ACTION_USE) {
+ //int16 clickedObject = selectObjectForGetAction(); // TODO
+ int16 clickedObject = 0;
if (clickedObject == -1)
break;
else
_awayMission.activeObject = clickedObject;
- */
}
if (_awayMission.activeAction == ACTION_USE
&& _awayMission.activeObject == OBJECT_ICOMM && (_awayMission.field24 & 1) == 0) { // TODO
if (!sub_2330c()) {
- addCommand(Command(_awayMission.activeAction, _awayMission.activeObject, 0, 0));
+ addAction(Action(_awayMission.activeAction, _awayMission.activeObject, 0, 0));
_sound->playVoc("communic");
_awayMission.activeAction = ACTION_WALK;
}
@@ -376,54 +380,57 @@ SharedPtr<Room> StarTrekEngine::getRoom() {
return _room;
}
-void StarTrekEngine::addCommand(const Command &command) {
- if (command.type != COMMAND_TICK)
- debug("Command %d: %x, %x, %x", command.type, command.gen.b1, command.gen.b2, command.gen.b3);
- _commandQueue.push(command);
-}
-
-bool StarTrekEngine::checkItemInteractionExists(int action, int activeItem, int passiveItem, int16 arg6) {
- // TODO
- return false;
+void StarTrekEngine::addAction(const Action &action) {
+ if (action.type != ACTION_TICK)
+ debug("Action %d: %x, %x, %x", action.type, action.b1, action.b2, action.b3);
+ _actionQueue.push(action);
}
-void StarTrekEngine::handleAwayMissionCommand() {
- Command command = _commandQueue.pop();
+void StarTrekEngine::handleAwayMissionAction() {
+ Action action = _actionQueue.pop();
- if ((command.type == COMMAND_FINISHED_BEAMING_IN || command.type == COMMAND_FINISHED_ENTERING_ROOM) && command.gen.b1 == 0xff) {
+ if ((action.type == ACTION_FINISHED_BEAMING_IN || action.type == ACTION_FINISHED_ENTERING_ROOM) && action.b1 == 0xff) {
_awayMission.transitioningIntoRoom = 0;
_warpHotspotsActive = true;
return;
}
- else if (command.type == COMMAND_FINISHED_ENTERING_ROOM && command.gen.b1 >= 0xe0) { // TODO
+ else if (action.type == ACTION_FINISHED_ENTERING_ROOM && action.b1 >= 0xe0) { // TODO
return;
}
- switch (command.type) { // TODO: everything
+ if (_room->handleAction(action))
+ return;
+
+ // Action not defined for the room, check for default behaviour
+
+ switch (action.type) { // TODO: everything
- case COMMAND_WALK: // TODO
+ case ACTION_WALK: // TODO
+ warning("Unhandled walk action: %d %d %d", action.b1, action.b2, action.b3);
break;
- case COMMAND_USE: // TODO
+ case ACTION_USE: // TODO
+ warning("Unhandled use action: %d %d %d", action.b1, action.b2, action.b3);
break;
- case COMMAND_GET: // TODO
+ case ACTION_GET: // TODO
+ warning("Unhandled get action: %d %d %d", action.b1, action.b2, action.b3);
break;
- case COMMAND_LOOK:
- if (command.action.activeObject >= ITEMS_START && command.action.activeObject < ITEMS_END) {
- int i = command.action.activeObject - ITEMS_START;
+ case ACTION_LOOK:
+ if (action.activeObject() >= ITEMS_START && action.activeObject() < ITEMS_END) {
+ int i = action.activeObject() - ITEMS_START;
Common::String text = getItemDescription(_itemList[i].textIndex);
showTextbox("", text, 20, 20, TEXTCOLOR_YELLOW, 0);
}
- else if (command.action.activeObject == OBJECT_KIRK)
+ else if (action.activeObject() == OBJECT_KIRK)
showTextbox("", getItemDescription(0x49), 20, 20, TEXTCOLOR_YELLOW, 0);
- else if (command.action.activeObject == OBJECT_SPOCK)
+ else if (action.activeObject() == OBJECT_SPOCK)
showTextbox("", getItemDescription(0x4a), 20, 20, TEXTCOLOR_YELLOW, 0);
- else if (command.action.activeObject == OBJECT_MCCOY)
+ else if (action.activeObject() == OBJECT_MCCOY)
showTextbox("", getItemDescription(0x4b), 20, 20, TEXTCOLOR_YELLOW, 0);
else {
- if (command.action.activeObject == OBJECT_REDSHIRT)
+ if (action.activeObject() == OBJECT_REDSHIRT)
showTextbox("", getItemDescription(0x4c), 20, 20, TEXTCOLOR_YELLOW, 0);
// Show generic "nothing of note" text.
@@ -434,13 +441,14 @@ void StarTrekEngine::handleAwayMissionCommand() {
}
break;
- case COMMAND_TALK: // TODO
+ case ACTION_TALK: // TODO
+ warning("Unhandled talk action: %d %d %d", action.b1, action.b2, action.b3);
break;
- case COMMAND_TOUCHED_WARP:
- // if (!sub_203e1(command.type)) // Probably calls RDF code
+ case ACTION_TOUCHED_WARP:
+ // if (!sub_203e1(action.type)) // Probably calls RDF code
{
- byte warpIndex = command.gen.b1;
+ byte warpIndex = action.b1;
int16 roomIndex = _room->readRdfWord(RDF_WARP_ROOM_INDICES + warpIndex * 2);
unloadRoom();
_sound->loadMusicFile("ground");
@@ -488,7 +496,7 @@ void StarTrekEngine::checkTouchedLoadingZone(int16 x, int16 y) {
uint16 var = _room->readRdfWord(offset);
if (_activeDoorWarpHotspot != var) {
_activeDoorWarpHotspot = var;
- addCommand(Command(COMMAND_7, var & 0xff, 0, 0));
+ addAction(Action(ACTION_TOUCHED_HOTSPOT, var & 0xff, 0, 0));
}
return;
}
@@ -506,7 +514,7 @@ void StarTrekEngine::checkTouchedLoadingZone(int16 x, int16 y) {
uint16 var = _room->readRdfWord(offset);
if (_activeWarpHotspot != var) {
_activeWarpHotspot = var;
- addCommand(Command(COMMAND_TOUCHED_WARP, var & 0xff, 0, 0));
+ addAction(Action(ACTION_TOUCHED_WARP, var & 0xff, 0, 0));
}
return;
}
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 8972306..b89e9cf 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -34,10 +34,23 @@ struct AwayMission {
byte activeAction;
byte activeObject; // The item that is going to be used on something
byte passiveObject; // The item that the active item is used on (or the item looked at, etc).
+
+ // If this is true after calling room-specific RDF code, the game will continue to run
+ // any "default" code for the event, if any.
+ bool rdfStillDoDefaultAction;
+
byte field24;
int8 field25[4];
- bool rdfRunNextCommand;
+ // Demon Word: nonzero if a rude response was given to the prelate.
+ int16 field29;
+
+ byte field33;
+ byte field36;
+ byte field38;
+ byte field3a;
+
+ int16 missionScore;
};
// Size: 0x129 bytes
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index cdaa444..b011c06 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -17,7 +17,8 @@ MODULE_OBJS = \
sound.o \
sprite.o \
startrek.o \
- text.o
+ text.o \
+ rooms/demon0.o
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index 71c9f84..2cfbbd2 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -42,6 +42,7 @@ class FileStream;
// other, ie. object 0 (kirk) interacts with object 32 (a hotspot) via ACTION_LOOK.
const int ACTORS_START = 0;
+const int SCALED_ACTORS_END = 8; // Only first 8 actors have room scaling applied?
const int ACTORS_END = 32;
const int NUM_ACTORS = ACTORS_END - ACTORS_START;
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 8cef65d..555a721 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -18,24 +18,33 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/graphics.h $
- * $Id: graphics.h 2 2009-09-12 20:13:40Z clone2727 $
- *
*/
#include "startrek/filestream.h"
#include "startrek/room.h"
#include "startrek/startrek.h"
+#include "rooms/function_map.h"
namespace StarTrek {
-Room::Room(StarTrekEngine *vm, Common::String name) : _vm(vm) {
+Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
SharedPtr<FileStream> rdfFile = _vm->loadFile(name + ".RDF");
int size = rdfFile->size();
_rdfData = new byte[size];
rdfFile->read(_rdfData, size);
+
+ // Find room-specific code table
+ if (name == "DEMON0") {
+ _roomActionList = demon0ActionList;
+ _numRoomActions = sizeof(demon0ActionList) / sizeof(RoomAction);
+ }
+ else {
+ warning("Room \"%s\" unimplemented", name.c_str());
+ _numRoomActions = 0;
+ return;
+ }
}
Room::~Room() {
@@ -46,9 +55,153 @@ uint16 Room::readRdfWord(int offset) {
return _rdfData[offset] | (_rdfData[offset+1]<<8);
}
+bool Room::actionHasCode(const Action &action) {
+ RoomAction *roomActionPtr = _roomActionList;
+ int n = _numRoomActions;
+
+ while (n-- > 0) {
+ if (action == roomActionPtr->action)
+ return true;
+ roomActionPtr++;
+ }
+ return false;
+}
+
+bool Room::handleAction(const Action &action) {
+ RoomAction *roomActionPtr = _roomActionList;
+ int n = _numRoomActions;
+
+ while (n-- > 0) {
+ if (action == roomActionPtr->action) {
+ _vm->_awayMission.rdfStillDoDefaultAction = false;
+ (this->*(roomActionPtr->funcPtr))();
+ if (!_vm->_awayMission.rdfStillDoDefaultAction)
+ return true;
+ }
+ roomActionPtr++;
+ }
+ return false;
+}
+
Common::Point Room::getBeamInPosition(int crewmanIndex) {
int base = 0xaa + crewmanIndex * 4;
return Common::Point(readRdfWord(base), readRdfWord(base + 2));
}
+
+// Interface for room-specific code
+
+void Room::loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66) {
+ Actor *actor = &_vm->_actorList[actorIndex];
+
+ if (x == -1 || y == -1) {
+ x = actor->sprite.pos.x;
+ y = actor->sprite.pos.y;
+ }
+
+ if (actorIndex >= 0 && actorIndex < SCALED_ACTORS_END)
+ _vm->loadActorAnimWithRoomScaling(actorIndex, anim, x, y);
+ else
+ _vm->loadActorAnim(actorIndex, anim, x, y, 256);
+
+ if (field66 != 0) {
+ actor->walkingIntoRoom = 1;
+ actor->field66 = field66;
+ }
+}
+
+void Room::loadActorStandAnim(int actorIndex) {
+ if (_vm->_awayMission.redshirtDead && actorIndex == OBJECT_REDSHIRT)
+ _vm->removeActorFromScreen(actorIndex);
+ else {
+ Actor *actor = &_vm->_actorList[actorIndex];
+ if (actor->animationString[0] == '\0')
+ _vm->removeActorFromScreen(actorIndex);
+ else
+ _vm->initStandAnim(actorIndex);
+ }
+}
+
+/**
+ * This is exactly the same as "loadActorAnim", but the game calls it at different times?
+ */
+void Room::loadActorAnim2(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66) {
+ loadActorAnim(actorIndex, anim, x, y, field66);
+}
+
+// TODO: replace "rdfOffset" with a pointer, so we no longer read from RDF files? (This
+// may be necessary to support other platforms; can't leave offsets hardcoded.)
+int Room::showRoomSpecificText(const char **array) {
+ Common::String speaker;
+ byte textColor;
+
+ if (array[0] != nullptr && array[0][0] != '\0') { // TODO
+ speaker = Common::String(array[0]);
+ if (speaker.equalsIgnoreCase("Capt. Kirk"))
+ textColor = TEXTCOLOR_YELLOW;
+ else if (speaker.equalsIgnoreCase("Mr. Spock"))
+ textColor = TEXTCOLOR_BLUE;
+ else if (speaker.equalsIgnoreCase("Dr. McCoy"))
+ textColor = TEXTCOLOR_BLUE;
+ else if (speaker.equalsIgnoreCase("Mr. Chekov"))
+ textColor = TEXTCOLOR_YELLOW;
+ else if (speaker.equalsIgnoreCase("Mr. Scott"))
+ textColor = TEXTCOLOR_RED;
+ else if (speaker.hasPrefixIgnoreCase("Lt"))
+ textColor = TEXTCOLOR_RED;
+ else if (speaker.hasPrefixIgnoreCase("Ensign"))
+ textColor = TEXTCOLOR_RED;
+ else
+ textColor = TEXTCOLOR_GREY;
+ }
+ else
+ textColor = TEXTCOLOR_YELLOW;
+
+ return _vm->showText(&StarTrekEngine::readTextFromArray, (uintptr)array, 20, 20, textColor, true, false, false);
+}
+
+void Room::giveItem(int item) {
+ _vm->_itemList[item - ITEMS_START].have = true;
+}
+
+void Room::loadRoomIndex(int roomIndex, int spawnIndex) {
+ if (_vm->_awayMission.field24 != 0)
+ return;
+
+ _vm->unloadRoom();
+ _vm->_sound->loadMusicFile("ground");
+
+ _vm->loadRoom(_vm->_missionName, roomIndex);
+ _vm->initAwayCrewPositions(spawnIndex % 6);
+
+ // TODO: "retrieveStackVars" call returns program counter directly to beginning of
+ // away mission loop. How to handle this?
+}
+
+void Room::walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 field66) {
+ if (!(actorIndex >= OBJECT_KIRK && actorIndex < OBJECT_REDSHIRT))
+ error("Tried to walk a non PC");
+
+ Actor *actor = &_vm->_actorList[actorIndex];
+ Common::String anim = _vm->getCrewmanAnimFilename(actorIndex, "walk");
+ bool success = _vm->actorWalkToPosition(actorIndex, anim, actor->pos.x, actor->pos.y, destX, destY);
+
+ if (success && field66 != 0) {
+ actor->walkingIntoRoom = 1;
+ actor->field66 = field66;
+ }
+}
+
+void Room::playSoundEffectIndex(int soundEffect) {
+ _vm->playSoundEffectIndex(soundEffect);
+}
+
+void Room::playMidiMusicTracks(int startTrack, int loopTrack) {
+ _vm->playMidiMusicTracks(startTrack, loopTrack);
+}
+
+void Room::playVoc(Common::String filename) {
+ _vm->_sound->playVoc(filename);
+}
+
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index b6a69c3..cb00815 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -27,12 +27,21 @@
#include "common/ptr.h"
#include "common/str.h"
+#include "startrek/startrek.h"
+
using Common::SharedPtr;
namespace StarTrek {
class StarTrekEngine;
+class Room;
+
+// Per-room action functions
+struct RoomAction {
+ const Action action;
+ void (Room::*funcPtr)();
+};
// Offsets of data in RDF files
@@ -43,7 +52,7 @@ const int RDF_BEAM_IN_POSITIONS = 0xaa;
class Room {
public:
- Room(StarTrekEngine *vm, Common::String name);
+ Room(StarTrekEngine *vm, const Common::String &name);
~Room();
// Helper stuff for RDF access
@@ -55,8 +64,13 @@ public:
uint16 getVar0a() { return readRdfWord(0x0a); }
uint16 getVar0c() { return readRdfWord(0x0c); }
+ // words 0x0e and 0x10 in RDF file are pointers to start and end of event code.
+ // That code is instead rewritten on a per-room basis.
+ bool actionHasCode(const Action &action);
+ bool handleAction(const Action &action);
+
uint16 getFirstHotspot() { return readRdfWord(0x12); }
- uint16 getHotspotEnd() { return readRdfWord(0x14); }
+ uint16 getHotspotEnd() { return readRdfWord(0x14); }
// Warp-related stuff
uint16 getFirstWarpPolygonOffset() { return readRdfWord(0x16); }
@@ -66,10 +80,65 @@ public:
Common::Point getBeamInPosition(int crewmanIndex);
+public:
byte *_rdfData;
private:
StarTrekEngine *_vm;
+
+ RoomAction *_roomActionList;
+ int _numRoomActions;
+
+
+ // Interface for room-specific code
+ void loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66); // Cmd 0x00
+ void loadActorStandAnim(int actorIndex); // Cmd 0x01
+ void loadActorAnim2(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66);// Cmd 0x02
+ int showRoomSpecificText(const char **textAddr); // Cmd 0x03
+ void giveItem(int item); // Cmd 0x04
+ void loadRoomIndex(int roomIndex, int spawnIndex); // Cmd 0x06
+ void walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 field66); // Cmd 0x08
+ void playSoundEffectIndex(int soundEffect); // Cmd 0x0f
+ void playMidiMusicTracks(int startTrack, int loopTrack); // Cmd 0x10
+ void playVoc(Common::String filename); // Cmd 0x15
+
+ // Room-specific code
+public:
+ // DEMON0
+ void demon0Tick1();
+ void demon0Tick2();
+ void demon0Tick60();
+ void demon0Tick100();
+ void demon0Tick140();
+ void demon0TouchedWarp0();
+ void demon0TouchedHotspot1();
+ void demon0TouchedHotspot0();
+ void demon0TalkToPrelate();
+ void demon0LookAtPrelate();
+ void demon0UsePhaserOnSnow();
+ void demon0UsePhaserOnSign();
+ void demon0UsePhaserOnShelter();
+ void demon0UsePhaserOnPrelate();
+ void demon0LookAtSign();
+ void demon0LookAtTrees();
+ void demon0LookAtSnow();
+ void demon0LookAnywhere();
+ void demon0LookAtBushes();
+ void demon0LookAtKirk();
+ void demon0LookAtMcCoy();
+ void demon0LookAtRedShirt();
+ void demon0LookAtSpock();
+ void demon0LookAtShelter();
+ void demon0TalkToKirk();
+ void demon0TalkToRedshirt();
+ void demon0TalkToMcCoy();
+ void demon0TalkToSpock();
+ void demon0AskPrelateAboutSightings();
+ void useSTricorderAnywhere();
+ void useMTricorderAnywhere();
+ void useMTricorderOnPrelate();
+
+ void demon0BadResponse();
};
}
diff --git a/engines/startrek/rooms/demon0.cpp b/engines/startrek/rooms/demon0.cpp
new file mode 100644
index 0000000..f687eaa
--- /dev/null
+++ b/engines/startrek/rooms/demon0.cpp
@@ -0,0 +1,538 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+void Room::demon0Tick1() {
+ playVoc("DEM0LOOP");
+ loadActorAnim(9, "s0r0d3", 252, 153, 0);
+ loadActorAnim(10, "s0r0d4", 158, 130, 0);
+}
+
+void Room::demon0Tick2() {
+ if (_vm->_awayMission.field33 == 1)
+ return;
+ loadActorAnim(8, "prel", 120, 190, 0);
+}
+
+void Room::demon0Tick60() {
+ if (_vm->_awayMission.field33 == 1)
+ return;
+ loadActorAnim2(8, "prelclap", 120, 190, 0);
+}
+
+void Room::demon0Tick100() {
+ const char *text[] = {
+ "Prel. Angiven",
+ "#DEM0\\DEM0_036#This is so much better, gentlefolk. We are honored at your presence and hope you will find peace here in our haven.",
+ ""
+ };
+
+ showRoomSpecificText(text);
+}
+
+void Room::demon0Tick140() {
+ const char *text[] = {
+ "Dr. McCoy",
+ "#DEM0\\DEM0_016#Captain, the flora on this planet is very interesting. I wonder how useful it may be for medicinal purposes.",
+ ""
+ };
+
+ if (_vm->_awayMission.field38 == 1)
+ return;
+
+ showRoomSpecificText(text);
+
+ _vm->_awayMission.field38 = 1;
+}
+
+void Room::demon0TouchedWarp0() {
+ _vm->_awayMission.field3a = 1;
+ _vm->_awayMission.rdfStillDoDefaultAction = true;
+}
+
+void Room::demon0TouchedHotspot1() {
+ if (_rdfData[0xcd] != 1) // FIXME: not portable to mac/amiga?
+ return;
+ loadActorAnim2(9, "s0r0d1", 254, 153, 1);
+ playSoundEffectIndex(0x05);
+}
+
+void Room::demon0TouchedHotspot0() {
+ if (_rdfData[0xcd] != 1) // FIXME: not portable to mac/amiga?
+ return;
+ loadActorAnim2(10, "s0r0d2", 158, 130, 2);
+ playSoundEffectIndex(0x05);
+}
+
+void Room::demon0TalkToPrelate() {
+ const char *options1[] = {
+ "Capt. Kirk",
+ "#DEM0\\DEM0_006#I'm Captain James T. Kirk of the U.S.S. Enterprise. We have received word that alien lifeforms are creating problems at your mining facilities at Idyll Mountain. Tell me more.",
+ "#DEM0\\DEM0_008#Most High Prelate Angiven, I am honored to meet you. I consider it my divine duty to assist you in any possible way with the spawn of the devil.",
+ "#DEM0\\DEM0_003#Been seeing ghosts and bogeymen eh? I find that a little hard to believe.",
+ ""
+ };
+ const char *firstResponse0[] = {
+ "Prel. Angiven",
+ "#DEM0\\DEM0_038#Certainly, Captain Kirk. Not aliens, per se -- we have encountered what we believe are demons at Idyll Mountain, creatures surely emerging from the very gates of Hell. Our God would not test us thus without reason, so we believe your might and insight are our God's method to help us discover what is going on.",
+ ""
+ };
+ const char *firstResponse1[] = {
+ "Prel. Angiven",
+ "#DEM0\\DEM0_032#Captain Kirk. I had no idea we were blessed with one of our order in the ranks of Starfleet. We believe we have located the very Gates of Hell below Idyll Mountain.",
+ ""
+ };
+ const char *options2[] = {
+ "Capt. Kirk",
+ "#DEM0\\DEM0_002#Aside from seeing demons, has any hard data been collected? Any evidence I could see?",
+ "#DEM0\\DEM0_005#Demons? Gates of Hell? This is the 23rd Century!",
+ ""
+ };
+ const char *secondResponse[] = {
+ "Prel. Angiven",
+ "#DEM0\\DEM0_031#A skeptic would consider everything merely anecdotal or unproven. My people will gladly tell you their own stories, so you need not hear it secondhand through me.",
+ ""
+ };
+ const char *options3[] = {
+ "Capt. Kirk",
+ "#DEM0\\DEM0_010#What can you tell me about the mine itself?",
+ "#DEM0\\DEM0_012#You're wasting the time of a starship capable of destroying this planet with campfire stories? No wonder you were dumped out here in the middle of nowhere.",
+ ""
+ };
+ const char *thirdResponse[] = {
+ "Prel. Angiven",
+ "#DEM0\\DEM0_035#The area is exceptionally stable tectonically, and easy for our machinery to work in, praise God. We've mined for hafnium and a variety of useful trace elements. The deeper we dig, however, the more anomalous the variety of minerals seems to be. Our Ignaciate, Brother Stephen, has his own theories about why this might be. Either way, the anomalies inspired Brother Kandrey to conduct studies inside the mine. Yesterday, he reported discovering a strange door -- a gate to Hell, surely, for the demons caused a cave-in immediately. Kandrey was trapped, unconscious, and the demons prevent us from rescuing him. We can only hope he is still alive.",
+ ""
+ };
+
+ const char *badConclusion[] = {
+ "Prel. Angiven",
+ "#DEM0\\DEM0_037#We need your help, Kirk. You may have no respect for our beliefs, but I hope you will look beyond that. Godspeed.",
+ ""
+ };
+ const char *goodConclusion[] = {
+ "Prel. Angiven",
+ "#DEM0\\DEM0_034#Thank you for your courtesy, Kirk. May you receive the guidance and protection of our God as you complete this divine mission.",
+ ""
+ };
+
+ if (_vm->_awayMission.field33 != 0)
+ return;
+
+ _vm->_awayMission.missionScore += 3;
+ _vm->_awayMission.field33 = 1;
+
+ const char **response = nullptr;
+
+ switch (showRoomSpecificText(options1)) {
+ case 0:
+ response = firstResponse0;
+ break;
+ case 1:
+ response = firstResponse1;
+ break;
+ case 2:
+ demon0BadResponse();
+ break;
+ }
+
+ if (response != nullptr)
+ showRoomSpecificText(response);
+
+ if (showRoomSpecificText(options2) == 1)
+ demon0BadResponse();
+
+ showRoomSpecificText(secondResponse);
+
+ if (showRoomSpecificText(options3) == 1)
+ demon0BadResponse();
+
+ showRoomSpecificText(thirdResponse);
+
+ if (_vm->_awayMission.field29 != 0)
+ showRoomSpecificText(badConclusion);
+ else
+ showRoomSpecificText(goodConclusion);
+}
+
+void Room::demon0LookAtPrelate() {
+ const char *text[] = {
+ nullptr,
+ "#DEM0\\DEM0N004#High Prelate Angiven waits patiently for you to decide what you will do next.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon0UsePhaserOnSnow() {
+ const char *text[] = {
+ "Ensign Everts",
+ "#DEM0\\DEM0_039#Aw, Captain, please don't melt the snow. I've never seen it before.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon0UsePhaserOnSign() {
+ const char *text[] = {
+ "Dr. McCoy",
+ "#DEM0\\DEM0_017#Quite the vandal aren't we, Jim?",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon0UsePhaserOnShelter() {
+ const char *text1[] = {
+ "Dr. McCoy",
+ "#DEM0\\DEM0_015#Burning down their house is not the best way to gain their confidence Jim!",
+ ""
+ };
+ const char *text2[] = {
+ "Mr. Spock",
+ "#DEM0\\DEM0_013#Captain, Doctor McCoy is correct.",
+ ""
+ };
+ const char *text3[] = {
+ "Ensign Everts",
+ "#DEM0\\DEM0_040#Is he always this trigger happy on ground missions?",
+ ""
+ };
+ showRoomSpecificText(text1);
+ showRoomSpecificText(text2);
+ if (!_vm->_awayMission.redshirtDead)
+ showRoomSpecificText(text3);
+}
+
+void Room::demon0UsePhaserOnPrelate() {
+ const char *text[] = {
+ "Dr. McCoy",
+ "#DEM0\\DEM0_020#Jim! Are you out of your mind?",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon0LookAtSign() {
+ const char *text[] = {
+ "Sign",
+ "All mining equipment use this road.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon0LookAtTrees() {
+ const char *text[] = {
+ nullptr,
+ "#DEM0\\DEM0N006#On the other side of the trees is Idyll Mountain. A tall, forbidding place. You have a vague feeling of danger.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon0LookAtSnow() {
+ const char *text[] = {
+ nullptr,
+ "#DEM0\\DEM0N007#Remnants of a recent snowfall cover the ground.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon0LookAnywhere() {
+ const char *text[] = {
+ nullptr,
+ "#DEM0\\DEM0N000#A beautiful, snow covered scene with a path leading off to Mount Idyll.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon0LookAtBushes() {
+ const char *text[] = {
+ nullptr,
+ "#DEM0\\DEM0N010#Various bushes and shrubs grow along the edge of the forest.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon0LookAtKirk() {
+ const char *text[] = {
+ nullptr,
+ "#DEM0\\DEM0N005#James Tiberius Kirk, Captain of the Enterprise. He's always happy to run an errand of mercy.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon0LookAtMcCoy() {
+ const char *text[] = {
+ nullptr,
+ "#DEM0\\DEM0N002#Dr. Leonard McCoy, the finest doctor in Starfleet, wishes that he were on a warmer planet.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon0LookAtRedShirt() {
+ const char *text[] = {
+ nullptr,
+ "#DEM0\\DEM0N003#Ensign Everts, who has never been this close to snow before in his life, gazes with child-like fascination at the ground.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon0LookAtSpock() {
+ const char *text[] = {
+ nullptr,
+ "#DEM0\\DEM0N009#Spock raises an eyebrow.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon0LookAtShelter() {
+ const char *text[] = {
+ nullptr,
+ "#DEM0\\DEM0N001#A quickly constructed spartan shelter, primarily used by fledgling colonies.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon0TalkToKirk() {
+ const char *text1[] = {
+ "Capt. Kirk",
+ "#DEM0\\DEM0_009#This planet's as beautiful as everyone says it is.",
+ ""
+ };
+ const char *text2[] = {
+ "Dr. McCoy",
+ "#DEM0\\DEM0_027#The trees. The fresh air. The freezing cold...",
+ ""
+ };
+ const char *text3[] = {
+ "Capt. Kirk",
+ "#DEM0\\DEM0_004#C'mon Bones, the cold will improve your circulation.",
+ ""
+ };
+ const char *text4[] = {
+ "Dr. McCoy",
+ "#DEM0\\DEM0_024#Some people get too much circulation!",
+ ""
+ };
+
+ showRoomSpecificText(text1);
+ showRoomSpecificText(text2);
+ showRoomSpecificText(text3);
+ showRoomSpecificText(text4);
+}
+
+void Room::demon0TalkToRedshirt() {
+ const char *text1[] = {
+ "Ensign Everts",
+ "#DEM0\\DEM0_043#I've never seen snow like this before. This is great!",
+ ""
+ };
+ const char *text2[] = {
+ "Dr. McCoy",
+ "#DEM0\\DEM0_026#You mean you've never built a snowman, ensign?",
+ ""
+ };
+ const char *text3[] = {
+ "Ensign Everts",
+ "#DEM0\\DEM0_042#I've never even thrown a snowball. Do you think anyone would mind?",
+ ""
+ };
+ const char *text4[] = {
+ "Dr. McCoy",
+ "#DEM0\\DEM0_025#Well...",
+ ""
+ };
+ const char *text5[] = {
+ "Capt. Kirk",
+ "#DEM0\\DEM0_007#Later Ensign. We have work to do.",
+ ""
+ };
+ const char *text6[] = {
+ "Ensign Everts",
+ "#DEM0\\DEM0_044#Of course, sir.",
+ ""
+ };
+
+ showRoomSpecificText(text1);
+ showRoomSpecificText(text2);
+ showRoomSpecificText(text3);
+ showRoomSpecificText(text4);
+ showRoomSpecificText(text5);
+ showRoomSpecificText(text6);
+}
+
+void Room::demon0TalkToMcCoy() {
+ if (_vm->_awayMission.field33 == 1) {
+ const char *text1[] = {
+ "Capt. Kirk",
+ "#DEM0\\DEM0_011#You look rather cold, Bones.",
+ ""
+ };
+ const char *text2[] = {
+ "Dr. McCoy",
+ "#DEM0\\DEM0_023#I'm not cold, I'm freezing! And that damn transporter just had to set me down in the middle of a snow drift!",
+ ""
+ };
+ const char *text3[] = {
+ "Mr. Spock",
+ "#DEM0\\DEM0_029#A centimeter of snow does not technically constitute a drift, Doctor.",
+ ""
+ };
+ const char *text4[] = {
+ "Ensign Everts",
+ "#DEM0\\DEM0_041#And doctors say that patients complain too much!",
+ ""
+ };
+
+ showRoomSpecificText(text1);
+ showRoomSpecificText(text2);
+ showRoomSpecificText(text3);
+ if (!_vm->_awayMission.redshirtDead)
+ showRoomSpecificText(text4);
+ }
+ else {
+ const char *text1[] = {
+ "Dr. McCoy",
+ "#DEM0\\DEM0_019#I don't know if the problem is real, the result of a new illness, or mass hysteria. But at the very least, there's an injured miner who needs my help.",
+ ""
+ };
+
+ showRoomSpecificText(text1);
+ if (_vm->_awayMission.field36 != 1) {
+ demon0AskPrelateAboutSightings();
+ }
+ }
+}
+
+void Room::demon0TalkToSpock() {
+ const char *text1[] = {
+ "Mr. Spock",
+ "#DEM0\\DEM0_014#Captain, demons and supernatural creatures are, almost by definition, illogical. Yet it is evident these people believe what they have seen. Barring illness or mass hysteria, I agree that a real problem seems to exist.",
+ ""
+ };
+
+ if (_vm->_awayMission.field33 == 1) {
+ showRoomSpecificText(text1);
+ }
+ else {
+ showRoomSpecificText(text1);
+ if (_vm->_awayMission.field36 != 1)
+ demon0AskPrelateAboutSightings();
+ }
+}
+
+void Room::demon0AskPrelateAboutSightings() {
+ const char *text2[] = {
+ "Capt. Kirk",
+ "#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?",
+ ""
+ };
+ const char *text3[] = {
+ "Prel. Angiven",
+ "#DEM0\\DEM0_030#They are already gathered in the chapel, and will cooperate in any way with you. First door on my right.",
+ ""
+ };
+
+ showRoomSpecificText(text2);
+ showRoomSpecificText(text3);
+
+ _vm->_awayMission.field36 = 1;
+}
+
+void Room::useSTricorderAnywhere() {
+ loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+
+ const char *text[] = {
+ "Mr. Spock",
+ "#DEM0\\DEM0_028#Captain, reading the rocks in this area, I find that this locality may have been disturbed in the distant past. Recent disturbances created by the colonists' construction and mining prevent me from discovering anything further.",
+ ""
+ };
+
+ showRoomSpecificText(text);
+}
+
+void Room::useMTricorderAnywhere() {
+ loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+
+ const char *text[] = {
+ "Dr. McCoy",
+ "#DEM0\\DEM0_021#Jim, I am not picking up any unusual life here, just native lifeforms and the settlers. The colonists are all human, except for the one Tellarite. If there are demons here, they don't register on my tricorder.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::useMTricorderOnPrelate() {
+ loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+
+ if (_vm->_awayMission.field33 == 1) {
+ const char *text[] = {
+ "Dr. McCoy",
+ "#DEM0\\DEM0_018#His blood pressure's up a bit, but he believes he's telling the truth.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+ else {
+ const char *text[] = {
+ "Dr. McCoy",
+ "#DEM0\\DEM0_022#The man's in perfect health.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+}
+
+// Helper functions
+void Room::demon0BadResponse() {
+ const char *text[] = {
+ "Prel. Angiven",
+ "#DEM0\\DEM0_033#Starfleet recognizes our freedom to worship and believe as we see fit, Captain. I am surprised that you do not share that feeling. Rest assured that Starfleet Command will be informed of your rudeness.",
+ ""
+ };
+
+ if (_vm->_awayMission.field29 != 0)
+ return;
+
+ _vm->_awayMission.missionScore -= 3;
+ _vm->_awayMission.field29 = 1;
+
+ showRoomSpecificText(text);
+}
+}
+
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
new file mode 100644
index 0000000..6b5dfd0
--- /dev/null
+++ b/engines/startrek/rooms/function_map.h
@@ -0,0 +1,83 @@
+/* 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.
+ *
+ */
+
+#ifndef STARTREK_FUNCTIONMAP_H
+#define STARTREK_FUNCTIONMAP_H
+
+#include "startrek/action.h"
+#include "startrek/room.h"
+
+namespace StarTrek {
+
+RoomAction demon0ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::demon0Tick1 },
+ { Action(ACTION_TICK, 2, 0, 0), &Room::demon0Tick2 },
+ { Action(ACTION_TICK, 60, 0, 0), &Room::demon0Tick60 },
+ { Action(ACTION_TICK, 100, 0, 0), &Room::demon0Tick100 },
+ { Action(ACTION_TICK, 140, 0, 0), &Room::demon0Tick140 },
+
+ { Action(ACTION_TOUCHED_WARP, 0, 0, 0), &Room::demon0TouchedWarp0 },
+
+ // TODO: Walk events; entered room event; beamed in event
+
+ { Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::demon0TouchedHotspot1 },
+ { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::demon0TouchedHotspot0 },
+
+ { Action(ACTION_TALK, 8, 0, 0), &Room::demon0TalkToPrelate },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::demon0LookAtPrelate },
+
+ { Action(ACTION_USE, OBJECT_IPHASERS, 0x23, 0), &Room::demon0UsePhaserOnSnow },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 0x23, 0), &Room::demon0UsePhaserOnSnow },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 0x25, 0), &Room::demon0UsePhaserOnSign },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 0x25, 0), &Room::demon0UsePhaserOnSign },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 0x20, 0), &Room::demon0UsePhaserOnShelter },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::demon0UsePhaserOnPrelate },
+
+ { Action(ACTION_LOOK, 0x25, 0, 0), &Room::demon0LookAtSign },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::demon0LookAtTrees },
+ { Action(ACTION_LOOK, 0x22, 0, 0), &Room::demon0LookAtTrees },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::demon0LookAtSnow },
+ { Action(ACTION_LOOK, 0xff, 0, 0), &Room::demon0LookAnywhere },
+ { Action(ACTION_LOOK, 0x24, 0, 0), &Room::demon0LookAtBushes },
+
+ { Action(ACTION_LOOK, 0, 0, 0), &Room::demon0LookAtKirk },
+ { Action(ACTION_LOOK, 2, 0, 0), &Room::demon0LookAtMcCoy },
+ { Action(ACTION_LOOK, 3, 0, 0), &Room::demon0LookAtRedShirt },
+ { Action(ACTION_LOOK, 1, 0, 0), &Room::demon0LookAtSpock },
+
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::demon0LookAtShelter }, // Door 1
+ { Action(ACTION_LOOK, 10, 0, 0), &Room::demon0LookAtShelter }, // Door 2
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon0LookAtShelter }, // Shelter itself
+
+ { Action(ACTION_TALK, 0, 0, 0), &Room::demon0TalkToKirk },
+ { Action(ACTION_TALK, 3, 0, 0), &Room::demon0TalkToRedshirt },
+ { Action(ACTION_TALK, 2, 0, 0), &Room::demon0TalkToMcCoy },
+ { Action(ACTION_TALK, 1, 0, 0), &Room::demon0TalkToSpock },
+
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0xff, 0), &Room::useSTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0xff, 0), &Room::useMTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::useMTricorderOnPrelate },
+};
+
+}
+
+#endif
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 5e64682..0c1b6d8 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -36,6 +36,7 @@
#include "startrek/filestream.h"
#include "startrek/iwfile.h"
#include "startrek/lzss.h"
+#include "startrek/room.h"
#include "startrek/startrek.h"
namespace StarTrek {
@@ -71,7 +72,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_keyboardControlsMouse = true;
_inQuitGameMenu = false;
- _textDisplayMode = TEXTDISPLAY_WAIT;
+ _textDisplayMode = TEXTDISPLAY_SUBTITLES;
_textboxVar2 = 0;
_textboxVar6 = 0;
_textboxHasMultipleChoices = false;
@@ -320,6 +321,10 @@ void StarTrekEngine::playSoundEffectIndex(int index) {
}
}
+void StarTrekEngine::playMidiMusicTracks(int startTrack, int loopTrack) {
+ _sound->playMidiMusicTracks(startTrack, loopTrack);
+}
+
void StarTrekEngine::playSpeech(const Common::String &filename) {
_sound->playSpeech(filename.c_str());
}
@@ -446,7 +451,7 @@ void StarTrekEngine::updateActorAnimations() {
if (nextAnimFrame == actor->numAnimFrames - 1) {
actor->field62++;
if (actor->walkingIntoRoom != 0) {
- addCommand(Command(COMMAND_FINISHED_BEAMING_IN, actor->field66, 0, 0));
+ addAction(Action(ACTION_FINISHED_BEAMING_IN, actor->field66, 0, 0));
}
}
}
@@ -517,7 +522,7 @@ void StarTrekEngine::updateActorAnimations() {
if (actor->iwSrcPosition == -1) {
if (actor->walkingIntoRoom != 0) {
actor->walkingIntoRoom = 0;
- addCommand(Command(COMMAND_FINISHED_ENTERING_ROOM, actor->field66 & 0xff, 0, 0));
+ addAction(Action(ACTION_FINISHED_ENTERING_ROOM, actor->field66 & 0xff, 0, 0));
}
actor->sprite.bitmap.reset();
@@ -981,7 +986,7 @@ void StarTrekEngine::updateMouseBitmap() {
true, // ACTION_LOOK
true // ACTION_TALK
};
- const bool worksOnHotspots[] = { // True if the action reacts with hotspots?
+ const bool worksOnHotspots[] = { // True if the action reacts with hotspots
false, // ACTION_WALK
true, // ACTION_USE
true, // ACTION_GET
@@ -1048,7 +1053,7 @@ void StarTrekEngine::showInventoryIcons(bool showItem) {
_inventoryIconSprite.pos.y = 10;
_inventoryIconSprite.drawMode = 2;
_inventoryIconSprite.drawPriority = 15;
- _inventoryIconSprite.drawPriority2 = 15;
+ _inventoryIconSprite.drawPriority2 = 8;
_inventoryIconSprite.setBitmap(_gfx->loadBitmap("inv00"));
}
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 5301f4d..217a066 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -36,12 +36,12 @@
#include "engines/engine.h"
+#include "startrek/action.h"
#include "startrek/awaymission.h"
#include "startrek/filestream.h"
#include "startrek/graphics.h"
#include "startrek/items.h"
#include "startrek/object.h"
-#include "startrek/room.h"
#include "startrek/sound.h"
@@ -55,6 +55,7 @@ namespace Common {
namespace StarTrek {
class StarTrekEngine;
+class Room;
typedef String (StarTrekEngine::*TextGetterFunc)(int, uintptr, String *);
@@ -94,7 +95,10 @@ enum TextDisplayMode {
};
enum TextColor {
- TEXTCOLOR_YELLOW = 0xb0
+ TEXTCOLOR_GREY = 0x88,
+ TEXTCOLOR_RED = 0xa1,
+ TEXTCOLOR_YELLOW = 0xb0,
+ TEXTCOLOR_BLUE = 0xc0
};
// Keeps track of data for a list of buttons making up a menu
@@ -161,55 +165,6 @@ struct TrekEvent {
uint32 tick;
};
-// Commands: Signals that can be passed to "handleAwayMissionCommands" or to room-specfiic
-// code.
-enum Commands {
- COMMAND_TICK = 0,
- COMMAND_WALK = 1, // Commands 1-5 correspond to Actions of the same number.
- COMMAND_USE = 2,
- COMMAND_GET = 3,
- COMMAND_LOOK = 4,
- COMMAND_TALK = 5,
- COMMAND_TOUCHED_WARP = 6,
- COMMAND_7 = 7, // Doors? (Or just hotspots activated by Kirk moving there?)
- COMMAND_FINISHED_BEAMING_IN = 10,
- COMMAND_FINISHED_ENTERING_ROOM = 12
-};
-
-struct Command {
- byte type;
-
- union { // FIXME: using unions in a dangeous way here...
- struct {
- byte b1;
- byte b2;
- byte b3;
- } gen;
-
- struct {
- byte activeObject;
- byte passiveObject;
- } action;
- };
-
- Command(byte _type, byte _b1, byte _b2, byte _b3)
- : type(_type) {
- gen.b1 = _b1;
- gen.b2 = _b2;
- gen.b3 = _b3;
- }
-};
-
-// Actions that can be used on away missions.
-enum Acton {
- ACTION_WALK = 1,
- ACTION_USE = 2,
- ACTION_GET = 3,
- ACTION_LOOK = 4,
- ACTION_TALK = 5,
- ACTION_OPTIONS = 13 // Not really an action, but selectable from action menu
-};
-
struct StarTrekGameDescription;
class Graphics;
@@ -220,7 +175,7 @@ class StarTrekEngine : public ::Engine {
protected:
Common::Error run();
-private:
+public:
// Game modes
Common::Error runGameMode(int mode);
@@ -234,9 +189,9 @@ private:
void unloadRoom();
int loadActorAnimWithRoomScaling(int actorIndex, const Common::String &animName, int16 x, int16 y);
uint16 getActorScaleAtPosition(int16 y);
- void addCommand(const Command &command);
+ void addAction(const Action &action);
bool checkItemInteractionExists(int action, int activeItem, int passiveItem, int16 arg6);
- void handleAwayMissionCommand();
+ void handleAwayMissionAction();
bool isPointInPolygon(int16 *data, int16 x, int16 y);
void checkTouchedLoadingZone(int16 x, int16 y);
@@ -255,6 +210,7 @@ public:
// Running the game
void playSoundEffectIndex(int index);
+ void playMidiMusicTracks(int startTrack, int loopTrack);
void playSpeech(const Common::String &filename);
void stopPlayingSpeech();
@@ -405,8 +361,8 @@ public:
Common::String _txtFilename;
Common::String _loadedText; // TODO: might be OK to delete this
- // Queue of "commands" (ie. next frame, clicked on object) for away mission or bridge
- Common::Queue<Command> _commandQueue;
+ // Queue of "actions" (ie. next frame, clicked on object) for away mission or bridge
+ Common::Queue<Action> _actionQueue;
AwayMission _awayMission;
bool _warpHotspotsActive;
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 11602bf..2df5e3b 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -25,6 +25,7 @@
#include "graphics/cursorman.h"
#include "startrek/graphics.h"
+#include "startrek/room.h"
namespace StarTrek {
@@ -136,7 +137,7 @@ void StarTrekEngine::showTextbox(String headerText, const String &mainText, int
headerText += ' ';
}
- int commandParam = (maxTextLines < 0 ? 0 : maxTextLines);
+ int actionParam = (maxTextLines < 0 ? 0 : maxTextLines);
if (maxTextLines < 0)
maxTextLines = -maxTextLines;
@@ -152,7 +153,8 @@ void StarTrekEngine::showTextbox(String headerText, const String &mainText, int
showText(&StarTrekEngine::readTextFromArray, (uintptr)strings, xoffset, yoffset, textColor, false, maxTextLines, false);
- addCommand(Command(COMMAND_TALK, commandParam, 0, 0));
+ if (actionParam != 0)
+ addAction(Action(ACTION_TALK, actionParam, 0, 0));
}
String StarTrekEngine::skipTextAudioPrompt(const String &str) {
Commit: ca3a9dcc8764909e163a860e4a472404620480e2
https://github.com/scummvm/scummvm/commit/ca3a9dcc8764909e163a860e4a472404620480e2
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Finish implementing first room
Doors now work, and the system of "walking, then performing an action
afterward" is implemented.
Changed paths:
engines/startrek/action.h
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/object.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/demon0.cpp
engines/startrek/rooms/function_map.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
index 68d5823..7be09eb 100644
--- a/engines/startrek/action.h
+++ b/engines/startrek/action.h
@@ -35,8 +35,8 @@ enum Acton {
ACTION_TOUCHED_WARP = 6,
ACTION_TOUCHED_HOTSPOT = 7, // Doors? (Or just hotspots activated by Kirk moving there?)
- ACTION_FINISHED_BEAMING_IN = 10,
- ACTION_FINISHED_ENTERING_ROOM = 12,
+ ACTION_FINISHED_ANIMATION = 10,
+ ACTION_FINISHED_WALKING = 12,
ACTION_OPTIONS = 13 // Not really an action, but selectable from action menu
};
@@ -46,6 +46,7 @@ struct Action {
byte b2;
byte b3;
+ Action() {}
Action(byte _type, byte _b1, byte _b2, byte _b3)
: type(_type),
b1(_b1),
@@ -60,6 +61,23 @@ struct Action {
bool operator==(const Action &a) const {
return type == a.type && b1 == a.b1 && b2 == a.b2 && b3 == a.b3;
}
+
+ uint32 getBitmask() const {
+ uint32 ret = 0;
+ if (type != 0xff)
+ ret |= (0xff << 24);
+ if (b1 != 0xff)
+ ret |= (0xff << 16);
+ if (b2 != 0xff)
+ ret |= (0xff << 8);
+ if (b3 != 0xff)
+ ret |= (0xff << 0);
+ return ret;
+ }
+
+ uint32 toUint32() const {
+ return (type << 24) | (b1 << 16) | (b2 << 8) | (b3 << 0);
+ }
};
#endif
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 5db0271..5bd134d 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -128,8 +128,8 @@ void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) {
actorWalkToPosition(i, anim, srcX, srcY, destX, destY);
}
- _kirkActor->walkingIntoRoom = 1;
- _kirkActor->field66 = 0xff;
+ _kirkActor->triggerActionWhenAnimFinished = true;
+ _kirkActor->finishedAnimActionParam = 0xff;
_awayMission.transitioningIntoRoom = 1;
_warpHotspotsActive = false;
break;
@@ -140,8 +140,8 @@ void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) {
Common::Point warpPos = _room->getBeamInPosition(i);
loadActorAnimWithRoomScaling(i, animFilename, warpPos.x, warpPos.y);
}
- _kirkActor->walkingIntoRoom = 1;
- _kirkActor->field66 = 0xff;
+ _kirkActor->triggerActionWhenAnimFinished = true;
+ _kirkActor->finishedAnimActionParam = 0xff;
_awayMission.transitioningIntoRoom = 1;
playSoundEffectIndex(0x09);
_warpHotspotsActive = false;
@@ -179,26 +179,33 @@ void StarTrekEngine::handleAwayMissionEvents() {
break;
switch (_awayMission.activeAction) {
- case ACTION_WALK:
- if (_awayMission.field1c == 0) {
- _kirkActor->sprite.drawMode = 1; // Hide these objects for function call below?
- _spockActor->sprite.drawMode = 1;
- _mccoyActor->sprite.drawMode = 1;
- _redshirtActor->sprite.drawMode = 1;
-
- // findActorClickedOn();
- // ...
-
- _kirkActor->sprite.drawMode = 0;
- _spockActor->sprite.drawMode = 0;
- _mccoyActor->sprite.drawMode = 0;
- _redshirtActor->sprite.drawMode = 0;
-
- Common::String animFilename = getCrewmanAnimFilename(0, "walk");
+ case ACTION_WALK: {
+ if (_awayMission.field1c != 0)
+ break;
+ _kirkActor->sprite.drawMode = 1; // Hide these objects for function call below?
+ _spockActor->sprite.drawMode = 1;
+ _mccoyActor->sprite.drawMode = 1;
+ _redshirtActor->sprite.drawMode = 1;
+
+ int clickedObject = findObjectAt(_gfx->getMousePos());
+
+ _kirkActor->sprite.drawMode = 0;
+ _spockActor->sprite.drawMode = 0;
+ _mccoyActor->sprite.drawMode = 0;
+ _redshirtActor->sprite.drawMode = 0;
+
+ if (walkActiveObjectToHotspot())
+ break;
+
+ if (clickedObject > OBJECT_KIRK && clickedObject < ITEMS_START)
+ addAction(ACTION_WALK, clickedObject, 0, 0);
+ else {
+ Common::String animFilename = getCrewmanAnimFilename(OBJECT_KIRK, "walk");
Common::Point mousePos = _gfx->getMousePos();
- actorWalkToPosition(0, animFilename, _kirkActor->pos.x, _kirkActor->pos.y, mousePos.x, mousePos.y);
+ actorWalkToPosition(OBJECT_KIRK, animFilename, _kirkActor->pos.x, _kirkActor->pos.y, mousePos.x, mousePos.y);
}
break;
+ }
case ACTION_USE: {
if (_awayMission.activeObject == OBJECT_REDSHIRT && (_awayMission.redshirtDead || (_awayMission.field24 & 8))) {
@@ -246,7 +253,7 @@ void StarTrekEngine::handleAwayMissionEvents() {
|| (activeIsCrewman && passiveIsItem)
|| (activeIsItem && passiveIsItem)) {
if (_awayMission.passiveObject == OBJECT_ICOMM) {
- if (sub_2330c())
+ if (walkActiveObjectToHotspot())
break;
addAction(Action(ACTION_USE, OBJECT_ICOMM, 0, 0));
_sound->playVoc("commun30");
@@ -264,7 +271,7 @@ void StarTrekEngine::handleAwayMissionEvents() {
}
checkAddAction:
- if (!sub_2330c())
+ if (!walkActiveObjectToHotspot())
{
if (clickedObject != -2)
addAction(Action(_awayMission.activeAction, _awayMission.activeObject, _awayMission.passiveObject, 0));
@@ -291,13 +298,13 @@ checkShowInventory:
_awayMission.activeObject = clickedObject;
- if (sub_2330c())
+ if (walkActiveObjectToHotspot())
break;
if (clickedObject != -2)
addAction(Action(_awayMission.activeAction, _awayMission.activeObject, 0, 0));
- if (_awayMission.activeAction == ACTION_LOOK && !(_awayMission.field24 & 1))
+ if (_awayMission.activeAction == ACTION_LOOK && !(_awayMission.field24 & (1 << OBJECT_KIRK)))
showInventoryIcons(false);
}
break;
@@ -316,16 +323,15 @@ checkShowInventory:
playSoundEffectIndex(0x07);
_awayMission.activeAction = showActionMenu();
if (_awayMission.activeAction == ACTION_USE) {
- //int16 clickedObject = selectObjectForGetAction(); // TODO
- int16 clickedObject = 0;
+ int16 clickedObject = selectObjectForUseAction();
if (clickedObject == -1)
break;
else
_awayMission.activeObject = clickedObject;
}
if (_awayMission.activeAction == ACTION_USE
- && _awayMission.activeObject == OBJECT_ICOMM && (_awayMission.field24 & 1) == 0) { // TODO
- if (!sub_2330c()) {
+ && _awayMission.activeObject == OBJECT_ICOMM && (_awayMission.field24 & (1 << OBJECT_KIRK)) == 0) {
+ if (!walkActiveObjectToHotspot()) {
addAction(Action(_awayMission.activeAction, _awayMission.activeObject, 0, 0));
_sound->playVoc("communic");
_awayMission.activeAction = ACTION_WALK;
@@ -389,13 +395,17 @@ void StarTrekEngine::addAction(const Action &action) {
void StarTrekEngine::handleAwayMissionAction() {
Action action = _actionQueue.pop();
- if ((action.type == ACTION_FINISHED_BEAMING_IN || action.type == ACTION_FINISHED_ENTERING_ROOM) && action.b1 == 0xff) {
+ if ((action.type == ACTION_FINISHED_ANIMATION || action.type == ACTION_FINISHED_WALKING) && action.b1 == 0xff) {
_awayMission.transitioningIntoRoom = 0;
_warpHotspotsActive = true;
return;
}
- else if (action.type == ACTION_FINISHED_ENTERING_ROOM && action.b1 >= 0xe0) { // TODO
- return;
+ else if (action.type == ACTION_FINISHED_WALKING && action.b1 >= 0xe0) {
+ // Finished walking to a position; perform the action that was input back when
+ // they started walking over there.
+ int index = action.b1 - 0xe0;
+ addAction(_actionOnWalkCompletion[index]);
+ _actionOnWalkCompletionInUse[index] = false;
}
if (_room->handleAction(action))
@@ -403,10 +413,14 @@ void StarTrekEngine::handleAwayMissionAction() {
// Action not defined for the room, check for default behaviour
- switch (action.type) { // TODO: everything
+ switch (action.type) {
- case ACTION_WALK: // TODO
- warning("Unhandled walk action: %d %d %d", action.b1, action.b2, action.b3);
+ case ACTION_WALK:
+ if (!_room->handleActionWithBitmask(action)) {
+ Common::String animFilename = getCrewmanAnimFilename(OBJECT_KIRK, "walk");
+ Common::Point mousePos = _gfx->getMousePos();
+ actorWalkToPosition(OBJECT_KIRK, animFilename, _kirkActor->pos.x, _kirkActor->pos.y, mousePos.x, mousePos.y);
+ }
break;
case ACTION_USE: // TODO
@@ -446,8 +460,7 @@ void StarTrekEngine::handleAwayMissionAction() {
break;
case ACTION_TOUCHED_WARP:
- // if (!sub_203e1(action.type)) // Probably calls RDF code
- {
+ if (!_room->handleActionWithBitmask(action)) {
byte warpIndex = action.b1;
int16 roomIndex = _room->readRdfWord(RDF_WARP_ROOM_INDICES + warpIndex * 2);
unloadRoom();
@@ -538,4 +551,15 @@ bool StarTrekEngine::isPositionSolid(int16 x, int16 y) {
return _mapFile->readByte() & (0x80 >> (x % 8));
}
+void StarTrekEngine::loadRoomIndex(int roomIndex, int spawnIndex) {
+ unloadRoom();
+ _sound->loadMusicFile("ground");
+
+ loadRoom(_missionName, roomIndex);
+ initAwayCrewPositions(spawnIndex % 6);
+
+ // WORKAROUND: original game calls "retrieveStackVars" to return execution directly to
+ // the top of "runAwayMission". That can't really be done here. But does it matter?
+}
+
}
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index b89e9cf..34cdb4b 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -29,7 +29,7 @@ struct AwayMission {
int16 mouseY;
byte field1c;
byte field1d;
- byte transitioningIntoRoom; // Set while beaming in or walking into a room
+ byte transitioningIntoRoom; // Set while beaming in or walking into a room. Disables control?
bool redshirtDead;
byte activeAction;
byte activeObject; // The item that is going to be used on something
@@ -39,8 +39,11 @@ struct AwayMission {
// any "default" code for the event, if any.
bool rdfStillDoDefaultAction;
+ // Bits 0-3 correspond to the crewmen? A bit is set if they're not selectable with
+ // the use action?
byte field24;
- int8 field25[4];
+
+ int8 field25[4]; // Sets an object's direction after they finish walking somewhere?
// Demon Word: nonzero if a rude response was given to the prelate.
int16 field29;
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index 2cfbbd2..8882892 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -56,6 +56,13 @@ const int ITEMS_END = ITEMS_START + NUM_ITEMS; // See items.h
const int NUM_OBJECTS = ITEMS_END;
+enum Directions {
+ DIR_N = 0,
+ DIR_S = 1,
+ DIR_E = 2,
+ DIR_W = 3
+};
+
// Some object indices are reserved (see items.h for item objects)
enum Objects {
OBJECT_KIRK = 0,
@@ -80,8 +87,8 @@ struct Actor {
Common::Point pos;
uint16 field60;
uint16 field62;
- uint16 walkingIntoRoom; // Walking or beaming into a room?
- uint16 field66;
+ bool triggerActionWhenAnimFinished;
+ uint16 finishedAnimActionParam;
char animationString2[8];
uint16 field70;
uint16 field72;
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 555a721..17d66d8 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -83,6 +83,23 @@ bool Room::handleAction(const Action &action) {
return false;
}
+bool Room::handleActionWithBitmask(const Action &action) {
+ RoomAction *roomActionPtr = _roomActionList;
+ int n = _numRoomActions;
+
+ while (n-- > 0) {
+ uint32 bitmask = action.getBitmask();
+ if ((action.toUint32() & bitmask) == (roomActionPtr->action.toUint32() & bitmask)) {
+ _vm->_awayMission.rdfStillDoDefaultAction = false;
+ (this->*(roomActionPtr->funcPtr))();
+ if (!_vm->_awayMission.rdfStillDoDefaultAction)
+ return true;
+ }
+ roomActionPtr++;
+ }
+ return false;
+}
+
Common::Point Room::getBeamInPosition(int crewmanIndex) {
int base = 0xaa + crewmanIndex * 4;
return Common::Point(readRdfWord(base), readRdfWord(base + 2));
@@ -91,7 +108,7 @@ Common::Point Room::getBeamInPosition(int crewmanIndex) {
// Interface for room-specific code
-void Room::loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66) {
+void Room::loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y, uint16 finishedAnimActionParam) {
Actor *actor = &_vm->_actorList[actorIndex];
if (x == -1 || y == -1) {
@@ -104,9 +121,9 @@ void Room::loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y,
else
_vm->loadActorAnim(actorIndex, anim, x, y, 256);
- if (field66 != 0) {
- actor->walkingIntoRoom = 1;
- actor->field66 = field66;
+ if (finishedAnimActionParam != 0) {
+ actor->triggerActionWhenAnimFinished = true;
+ actor->finishedAnimActionParam = finishedAnimActionParam;
}
}
@@ -125,8 +142,8 @@ void Room::loadActorStandAnim(int actorIndex) {
/**
* This is exactly the same as "loadActorAnim", but the game calls it at different times?
*/
-void Room::loadActorAnim2(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66) {
- loadActorAnim(actorIndex, anim, x, y, field66);
+void Room::loadActorAnim2(int actorIndex, Common::String anim, int16 x, int16 y, uint16 finishedAnimActionParam) {
+ loadActorAnim(actorIndex, anim, x, y, finishedAnimActionParam);
}
// TODO: replace "rdfOffset" with a pointer, so we no longer read from RDF files? (This
@@ -168,17 +185,15 @@ void Room::loadRoomIndex(int roomIndex, int spawnIndex) {
if (_vm->_awayMission.field24 != 0)
return;
- _vm->unloadRoom();
- _vm->_sound->loadMusicFile("ground");
-
- _vm->loadRoom(_vm->_missionName, roomIndex);
- _vm->initAwayCrewPositions(spawnIndex % 6);
+ _vm->loadRoomIndex(roomIndex, spawnIndex);
- // TODO: "retrieveStackVars" call returns program counter directly to beginning of
- // away mission loop. How to handle this?
+ // This room has now been deleted, don't do anything else here.
+ // FIXME: this could a bit dangerous since this is generally called from room-specific
+ // code, which isn't guaranteed to do nothing afterward. Original game would
+ // manipulate the stack to jump directly back to the start of "runAwayMission"...
}
-void Room::walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 field66) {
+void Room::walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam) {
if (!(actorIndex >= OBJECT_KIRK && actorIndex < OBJECT_REDSHIRT))
error("Tried to walk a non PC");
@@ -186,9 +201,9 @@ void Room::walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 field66)
Common::String anim = _vm->getCrewmanAnimFilename(actorIndex, "walk");
bool success = _vm->actorWalkToPosition(actorIndex, anim, actor->pos.x, actor->pos.y, destX, destY);
- if (success && field66 != 0) {
- actor->walkingIntoRoom = 1;
- actor->field66 = field66;
+ if (success && finishedAnimActionParam != 0) {
+ actor->triggerActionWhenAnimFinished = true;
+ actor->finishedAnimActionParam = finishedAnimActionParam;
}
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index cb00815..220c733 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -69,6 +69,9 @@ public:
bool actionHasCode(const Action &action);
bool handleAction(const Action &action);
+ // Same as above, but if any byte in the action is -1 (0xff), it matches any value.
+ bool handleActionWithBitmask(const Action &action);
+
uint16 getFirstHotspot() { return readRdfWord(0x12); }
uint16 getHotspotEnd() { return readRdfWord(0x14); }
@@ -94,10 +97,10 @@ private:
void loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66); // Cmd 0x00
void loadActorStandAnim(int actorIndex); // Cmd 0x01
void loadActorAnim2(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66);// Cmd 0x02
- int showRoomSpecificText(const char **textAddr); // Cmd 0x03
+ int showRoomSpecificText(const char **textAddr); // Cmd 0x03
void giveItem(int item); // Cmd 0x04
void loadRoomIndex(int roomIndex, int spawnIndex); // Cmd 0x06
- void walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 field66); // Cmd 0x08
+ void walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam);// Cmd 0x08
void playSoundEffectIndex(int soundEffect); // Cmd 0x0f
void playMidiMusicTracks(int startTrack, int loopTrack); // Cmd 0x10
void playVoc(Common::String filename); // Cmd 0x15
@@ -111,8 +114,12 @@ public:
void demon0Tick100();
void demon0Tick140();
void demon0TouchedWarp0();
+ void demon0WalkToBottomDoor();
void demon0TouchedHotspot1();
+ void demon0ReachedBottomDoor();
+ void demon0WalkToTopDoor();
void demon0TouchedHotspot0();
+ void demon0ReachedTopDoor();
void demon0TalkToPrelate();
void demon0LookAtPrelate();
void demon0UsePhaserOnSnow();
@@ -134,9 +141,9 @@ public:
void demon0TalkToMcCoy();
void demon0TalkToSpock();
void demon0AskPrelateAboutSightings();
- void useSTricorderAnywhere();
- void useMTricorderAnywhere();
- void useMTricorderOnPrelate();
+ void demon0UseSTricorderAnywhere();
+ void demon0UseMTricorderAnywhere();
+ void demon0UseMTricorderOnPrelate();
void demon0BadResponse();
};
diff --git a/engines/startrek/rooms/demon0.cpp b/engines/startrek/rooms/demon0.cpp
index f687eaa..41a5bbf 100644
--- a/engines/startrek/rooms/demon0.cpp
+++ b/engines/startrek/rooms/demon0.cpp
@@ -72,6 +72,13 @@ void Room::demon0TouchedWarp0() {
_vm->_awayMission.rdfStillDoDefaultAction = true;
}
+void Room::demon0WalkToBottomDoor() {
+ _vm->_awayMission.transitioningIntoRoom = 1;
+ _rdfData[0xcd] = 1; // FIXME
+ _vm->_awayMission.field25[OBJECT_KIRK] = DIR_E;
+ walkCrewman(OBJECT_KIRK, 243, 158, 1);
+}
+
void Room::demon0TouchedHotspot1() {
if (_rdfData[0xcd] != 1) // FIXME: not portable to mac/amiga?
return;
@@ -79,13 +86,32 @@ void Room::demon0TouchedHotspot1() {
playSoundEffectIndex(0x05);
}
+void Room::demon0ReachedBottomDoor() {
+ if (++_rdfData[0xca] != 2) // FIXME
+ return;
+ loadRoomIndex(5, 0);
+}
+
+void Room::demon0WalkToTopDoor() {
+ _vm->_awayMission.transitioningIntoRoom = 1;
+ _rdfData[0xcc] = 1; // FIXME
+ _vm->_awayMission.field25[OBJECT_KIRK] = DIR_E;
+ walkCrewman(OBJECT_KIRK, 157, 134, 2);
+}
+
void Room::demon0TouchedHotspot0() {
- if (_rdfData[0xcd] != 1) // FIXME: not portable to mac/amiga?
+ if (_rdfData[0xcc] != 1) // FIXME: not portable to mac/amiga?
return;
loadActorAnim2(10, "s0r0d2", 158, 130, 2);
playSoundEffectIndex(0x05);
}
+void Room::demon0ReachedTopDoor() {
+ if (++_rdfData[0xcb] != 2) // FIXME
+ return;
+ loadRoomIndex(6, 3);
+}
+
void Room::demon0TalkToPrelate() {
const char *options1[] = {
"Capt. Kirk",
@@ -471,7 +497,7 @@ void Room::demon0AskPrelateAboutSightings() {
_vm->_awayMission.field36 = 1;
}
-void Room::useSTricorderAnywhere() {
+void Room::demon0UseSTricorderAnywhere() {
loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
playSoundEffectIndex(0x04);
@@ -484,7 +510,7 @@ void Room::useSTricorderAnywhere() {
showRoomSpecificText(text);
}
-void Room::useMTricorderAnywhere() {
+void Room::demon0UseMTricorderAnywhere() {
loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
playSoundEffectIndex(0x04);
@@ -496,7 +522,7 @@ void Room::useMTricorderAnywhere() {
showRoomSpecificText(text);
}
-void Room::useMTricorderOnPrelate() {
+void Room::demon0UseMTricorderOnPrelate() {
loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
playSoundEffectIndex(0x04);
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 6b5dfd0..ae7e8eb 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -37,10 +37,17 @@ RoomAction demon0ActionList[] = {
{ Action(ACTION_TOUCHED_WARP, 0, 0, 0), &Room::demon0TouchedWarp0 },
- // TODO: Walk events; entered room event; beamed in event
-
+ { Action(ACTION_WALK, 0x27, 0, 0), &Room::demon0WalkToBottomDoor },
+ { Action(ACTION_WALK, 9, 0, 0), &Room::demon0WalkToBottomDoor },
{ Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::demon0TouchedHotspot1 },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::demon0ReachedBottomDoor },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::demon0ReachedBottomDoor },
+
+ { Action(ACTION_WALK, 0x26, 0, 0), &Room::demon0WalkToTopDoor },
+ { Action(ACTION_WALK, 10, 0, 0), &Room::demon0WalkToTopDoor },
{ Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::demon0TouchedHotspot0 },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::demon0ReachedTopDoor },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::demon0ReachedTopDoor },
{ Action(ACTION_TALK, 8, 0, 0), &Room::demon0TalkToPrelate },
{ Action(ACTION_LOOK, 8, 0, 0), &Room::demon0LookAtPrelate },
@@ -59,23 +66,23 @@ RoomAction demon0ActionList[] = {
{ Action(ACTION_LOOK, 0xff, 0, 0), &Room::demon0LookAnywhere },
{ Action(ACTION_LOOK, 0x24, 0, 0), &Room::demon0LookAtBushes },
- { Action(ACTION_LOOK, 0, 0, 0), &Room::demon0LookAtKirk },
- { Action(ACTION_LOOK, 2, 0, 0), &Room::demon0LookAtMcCoy },
- { Action(ACTION_LOOK, 3, 0, 0), &Room::demon0LookAtRedShirt },
- { Action(ACTION_LOOK, 1, 0, 0), &Room::demon0LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::demon0LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::demon0LookAtMcCoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::demon0LookAtRedShirt },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::demon0LookAtSpock },
{ Action(ACTION_LOOK, 9, 0, 0), &Room::demon0LookAtShelter }, // Door 1
{ Action(ACTION_LOOK, 10, 0, 0), &Room::demon0LookAtShelter }, // Door 2
{ Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon0LookAtShelter }, // Shelter itself
- { Action(ACTION_TALK, 0, 0, 0), &Room::demon0TalkToKirk },
- { Action(ACTION_TALK, 3, 0, 0), &Room::demon0TalkToRedshirt },
- { Action(ACTION_TALK, 2, 0, 0), &Room::demon0TalkToMcCoy },
- { Action(ACTION_TALK, 1, 0, 0), &Room::demon0TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::demon0TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::demon0TalkToRedshirt },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::demon0TalkToMcCoy },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::demon0TalkToSpock },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0xff, 0), &Room::useSTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0xff, 0), &Room::useMTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::useMTricorderOnPrelate },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::demon0UseSTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::demon0UseMTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::demon0UseMTricorderOnPrelate },
};
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 0c1b6d8..b4777a9 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -57,6 +57,8 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_sound = nullptr;
_macResFork = nullptr;
+ memset(_actionOnWalkCompletionInUse, 0, sizeof(_actionOnWalkCompletionInUse));
+
_clockTicks = 0;
_musicEnabled = true;
@@ -368,8 +370,8 @@ int StarTrekEngine::loadActorAnim(int actorIndex, const Common::String &animName
drawActorToScreen(actor, animName, x, y, scale, true);
}
- actor->walkingIntoRoom = 0;
- actor->field66 = 0;
+ actor->triggerActionWhenAnimFinished = false;
+ actor->finishedAnimActionParam = 0;
return actorIndex;
}
@@ -383,7 +385,7 @@ bool StarTrekEngine::actorWalkToPosition(int actorIndex, const Common::String &a
Actor *actor = &_actorList[actorIndex];
- actor->walkingIntoRoom = 0;
+ actor->triggerActionWhenAnimFinished = false;
if (isPositionSolid(destX, destY))
return false;
@@ -400,7 +402,7 @@ bool StarTrekEngine::actorWalkToPosition(int actorIndex, const Common::String &a
actor->dest.x = destX;
actor->dest.y = destY;
actor->field92 = 0;
- actor->walkingIntoRoom = 0;
+ actor->triggerActionWhenAnimFinished = false;
actor->iwDestPosition = -1;
actor->iwSrcPosition = -1;
@@ -450,8 +452,8 @@ void StarTrekEngine::updateActorAnimations() {
if (actor->animFrame != nextAnimFrame) {
if (nextAnimFrame == actor->numAnimFrames - 1) {
actor->field62++;
- if (actor->walkingIntoRoom != 0) {
- addAction(Action(ACTION_FINISHED_BEAMING_IN, actor->field66, 0, 0));
+ if (actor->triggerActionWhenAnimFinished) {
+ addAction(Action(ACTION_FINISHED_ANIMATION, actor->finishedAnimActionParam, 0, 0));
}
}
}
@@ -520,9 +522,9 @@ void StarTrekEngine::updateActorAnimations() {
}
else { // actor->field90 == 0
if (actor->iwSrcPosition == -1) {
- if (actor->walkingIntoRoom != 0) {
- actor->walkingIntoRoom = 0;
- addAction(Action(ACTION_FINISHED_ENTERING_ROOM, actor->field66 & 0xff, 0, 0));
+ if (actor->triggerActionWhenAnimFinished) {
+ actor->triggerActionWhenAnimFinished = false;
+ addAction(Action(ACTION_FINISHED_WALKING, actor->finishedAnimActionParam & 0xff, 0, 0));
}
actor->sprite.bitmap.reset();
@@ -831,7 +833,7 @@ int StarTrekEngine::findObjectAt(int x, int y) {
error("findObject: Clicked on an unknown sprite");
}
- // word_4b418 = 0;
+ _objectHasWalkPosition = false;
int actionBit = 1 << (_awayMission.activeAction - 1);
int offset = _room->getFirstHotspot();
@@ -840,9 +842,9 @@ int StarTrekEngine::findObjectAt(int x, int y) {
if (word & 0x8000) {
if ((word & actionBit) && isPointInPolygon((int16 *)(_room->_rdfData + offset + 6), x, y)) {
int actorIndex = _room->readRdfWord(offset + 6);
- // word_4b418 = 1;
- // word_4a792 = _room->readRdfWord(offset + 2);
- // word_4a796 = _room->readRdfWord(offset + 4); // TODO
+ _objectHasWalkPosition = true;
+ _objectWalkPosition.x = _room->readRdfWord(offset + 2);
+ _objectWalkPosition.y = _room->readRdfWord(offset + 4);
return actorIndex;
}
@@ -962,6 +964,112 @@ SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filen
return bitmapToReturn;
}
+
+/**
+ * Called when the "get" action is first selected. Returns a selected object.
+ * This behaves like other menus in that it holds game execution, but no actual menu pops
+ * up; it just waits for the player to select something on the screen.
+ */
+int StarTrekEngine::selectObjectForUseAction() {
+ while (true) {
+ if (!(_awayMission.field24 & (1 << OBJECT_KIRK)))
+ showInventoryIcons(false);
+
+ TrekEvent event;
+
+ while (true) {
+ if (!getNextEvent(&event))
+ continue;
+
+ if (event.type == TREKEVENT_TICK) {
+ updateMouseBitmap();
+ _gfx->drawAllSprites();
+ _sound->checkLoopMusic();
+ }
+ else if (event.type == TREKEVENT_LBUTTONDOWN) {
+ removeNextEvent();
+ break;
+ }
+ else if (event.type == TREKEVENT_MOUSEMOVE) {
+ }
+ else if (event.type == TREKEVENT_RBUTTONDOWN) {
+ // Allow this to be processed by main away mission loop
+ break;
+ }
+ else if (event.type == TREKEVENT_KEYDOWN) {
+ if (event.kbd.keycode == Common::KEYCODE_ESCAPE
+ || event.kbd.keycode == Common::KEYCODE_w
+ || event.kbd.keycode == Common::KEYCODE_t
+ || event.kbd.keycode == Common::KEYCODE_u
+ || event.kbd.keycode == Common::KEYCODE_g
+ || event.kbd.keycode == Common::KEYCODE_l
+ || event.kbd.keycode == Common::KEYCODE_SPACE
+ || event.kbd.keycode == Common::KEYCODE_F2) {
+ // Allow these buttons to be processed by main away mission loop
+ break;
+ }
+ else if (event.kbd.keycode == Common::KEYCODE_i) {
+ removeNextEvent();
+ break;
+ }
+ else if (event.kbd.keycode == Common::KEYCODE_RETURN || event.kbd.keycode == Common::KEYCODE_KP_ENTER || event.kbd.keycode == Common::KEYCODE_F1) {
+ // Simulate left-click
+ removeNextEvent();
+ event.type = TREKEVENT_LBUTTONDOWN;
+ break;
+ }
+ }
+
+ removeNextEvent();
+ }
+
+ if (event.type == TREKEVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_i) {
+ hideInventoryIcons();
+ int clickedObject = showInventoryMenu(50, 50, true);
+ if (clickedObject == -1)
+ continue;
+ return clickedObject;
+ }
+ else if (event.type == TREKEVENT_LBUTTONDOWN) {
+ int clickedObject = findObjectAt(_gfx->getMousePos());
+ hideInventoryIcons();
+
+ if (clickedObject == -1)
+ continue;
+ else if (isObjectUnusable(clickedObject, ACTION_USE))
+ continue;
+ else if (clickedObject == OBJECT_INVENTORY_ICON) {
+ clickedObject = showInventoryMenu(50, 50, false);
+ if (clickedObject == -1)
+ continue;
+ else
+ return clickedObject;
+ }
+ else if (clickedObject <= OBJECT_REDSHIRT)
+ return clickedObject;
+ else if (isObjectUnusable(OBJECT_KIRK, ACTION_USE))
+ continue;
+ else if (_room->actionHasCode(Action(ACTION_USE, OBJECT_KIRK, clickedObject, 0))
+ || _room->actionHasCode(Action(ACTION_GET, clickedObject, 0, 0))
+ || _room->actionHasCode(Action(ACTION_WALK, clickedObject, 0, 0))) {
+ _awayMission.activeObject = OBJECT_KIRK;
+ _awayMission.passiveObject = clickedObject;
+ _awayMission.activeAction = ACTION_USE;
+ clickedObject = OBJECT_KIRK;
+ if (!walkActiveObjectToHotspot())
+ addAction(Action(_awayMission.activeAction, _awayMission.activeObject, _awayMission.passiveObject, 0));
+ return clickedObject;
+ }
+ else
+ continue;
+ }
+ else {
+ hideInventoryIcons();
+ return -1;
+ }
+ }
+}
+
Common::String StarTrekEngine::getCrewmanAnimFilename(int actorIndex, const Common::String &basename) {
const char *crewmanChars = "ksmr";
assert(actorIndex >= 0 && actorIndex < 4);
@@ -1013,6 +1121,72 @@ void StarTrekEngine::updateMouseBitmap() {
chooseMouseBitmapForAction(action, withRedOutline);
}
+/**
+ * Checks whether to walk a crewman to a hotspot (the last one obtained from
+ * a "findObjectAt" call).
+ */
+bool StarTrekEngine::walkActiveObjectToHotspot() {
+ if (!_objectHasWalkPosition)
+ return false;
+
+ int objectIndex;
+ if (_awayMission.activeAction != ACTION_USE)
+ objectIndex = OBJECT_KIRK;
+ else if (_awayMission.activeObject >= OBJECT_KIRK && _awayMission.activeObject <= OBJECT_REDSHIRT)
+ objectIndex = _awayMission.activeObject;
+ else if (_awayMission.activeObject >= ITEMS_START && _awayMission.activeObject <= ITEMS_END) { // FIXME: "<= ITEMS_END" doesn't make sense?
+ if (_awayMission.activeObject == OBJECT_ISTRICOR)
+ objectIndex = OBJECT_SPOCK;
+ else if (_awayMission.activeObject == OBJECT_IMTRICOR)
+ objectIndex = OBJECT_MCCOY;
+ else
+ objectIndex = OBJECT_KIRK;
+ }
+ else // This is the original error message...
+ error("Jay didn't think about pmcheck");
+
+ byte finishedAnimActionParam = false;
+ bool walk = false;
+
+ if (_awayMission.activeAction == ACTION_WALK)
+ walk = true;
+ else {
+ // If this action has code defined for it in this room, buffer the action to be
+ // done after the object finished walking there.
+ Action action(_awayMission.activeAction, _awayMission.activeObject, 0, 0);
+ if (_awayMission.activeAction == ACTION_USE)
+ action.b2 = _awayMission.passiveObject;
+
+ if (_room->actionHasCode(action)) {
+ for (int i = 0; i < MAX_BUFFERED_WALK_ACTIONS; i++) {
+ if (!_actionOnWalkCompletionInUse[i]) {
+ finishedAnimActionParam = i + 0xe0;
+ _actionOnWalkCompletionInUse[i] = true;
+ _actionOnWalkCompletion[i] = action;
+ walk = true;
+ break;
+ }
+ }
+ }
+ }
+
+ if (walk) {
+ Actor *actor = &_actorList[objectIndex];
+ Common::String anim = getCrewmanAnimFilename(objectIndex, "walk");
+ actorWalkToPosition(objectIndex, anim, actor->pos.x, actor->pos.y, _objectWalkPosition.x, _objectWalkPosition.y);
+ if (finishedAnimActionParam != 0) {
+ actor->triggerActionWhenAnimFinished = true;
+ actor->finishedAnimActionParam = finishedAnimActionParam;
+ }
+ _objectHasWalkPosition = false;
+ return true;
+ }
+ else {
+ _objectHasWalkPosition = false;
+ return false;
+ }
+}
+
void StarTrekEngine::showInventoryIcons(bool showItem) {
const char *crewmanFilenames[] = {
"ikirk",
@@ -1057,6 +1231,23 @@ void StarTrekEngine::showInventoryIcons(bool showItem) {
_inventoryIconSprite.setBitmap(_gfx->loadBitmap("inv00"));
}
+/**
+ * Return true if an object is unselectable with use?
+ */
+bool StarTrekEngine::isObjectUnusable(int object, int action) {
+ if (action == ACTION_LOOK)
+ return false;
+ if (object == OBJECT_REDSHIRT && _awayMission.redshirtDead)
+ return true;
+ if (object >= OBJECT_KIRK && object <= OBJECT_REDSHIRT && (_awayMission.field24 & (1 << object)))
+ return true;
+ if (object == OBJECT_IMTRICOR && (_awayMission.field24 & (1 << OBJECT_MCCOY)))
+ return true;
+ if (object == OBJECT_ISTRICOR && (_awayMission.field24 & (1 << OBJECT_SPOCK)))
+ return true;
+ return false;
+}
+
void StarTrekEngine::hideInventoryIcons() {
// Clear these sprites from the screen
if (_itemIconSprite.drawMode == 2)
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 217a066..b408b39 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -65,6 +65,8 @@ const int MAX_MENUBUTTONS = 32;
const int TEXTBOX_WIDTH = 26;
const int MAX_TEXTBOX_LINES = 12;
+const int MAX_BUFFERED_WALK_ACTIONS = 32;
+
enum StarTrekGameType {
GType_ST25 = 1,
@@ -190,12 +192,14 @@ public:
int loadActorAnimWithRoomScaling(int actorIndex, const Common::String &animName, int16 x, int16 y);
uint16 getActorScaleAtPosition(int16 y);
void addAction(const Action &action);
+ void addAction(byte b1, byte b2, byte b3, byte b4) { addAction(Action(b1, b2, b3, b4)); }
bool checkItemInteractionExists(int action, int activeItem, int passiveItem, int16 arg6);
void handleAwayMissionAction();
bool isPointInPolygon(int16 *data, int16 x, int16 y);
void checkTouchedLoadingZone(int16 x, int16 y);
bool isPositionSolid(int16 x, int16 y);
+ void loadRoomIndex(int roomIndex, int spawnIndex);
public:
SharedPtr<Room> getRoom();
@@ -231,9 +235,12 @@ public:
int findObjectAt(int x, int y);
int findObjectAt(Common::Point p) { return findObjectAt(p.x, p.y); }
SharedPtr<Bitmap> loadAnimationFrame(const Common::String &filename, Fixed16 scale);
+
+ int selectObjectForUseAction();
Common::String getCrewmanAnimFilename(int actorIndex, const Common::String &basename);
void updateMouseBitmap();
- bool sub_2330c() { return false; } // TODO
+ bool walkActiveObjectToHotspot();
+ bool isObjectUnusable(int objectIndex, int action);
void showInventoryIcons(bool showItem);
void hideInventoryIcons();
int showInventoryMenu(int x, int y, bool restoreMouse);
@@ -384,6 +391,15 @@ public:
Sprite _inventoryIconSprite;
Sprite _itemIconSprite;
+ // Certain hotspots store a position value where objects must walk to before
+ // interacting with them. After calling "findObjectAt", these values are updated.
+ bool _objectHasWalkPosition;
+ Common::Point _objectWalkPosition;
+
+ // Actions to perform after a crewman finishes walking to a position.
+ Action _actionOnWalkCompletion[MAX_BUFFERED_WALK_ACTIONS];
+ bool _actionOnWalkCompletionInUse[MAX_BUFFERED_WALK_ACTIONS];
+
// _clockTicks is based on DOS interrupt 1A, AH=0; read system clock counter.
// Updates 18.206 times every second.
uint32 _clockTicks;
Commit: 45ae72b763268d87a5a6613231b7a11a2fbd8168
https://github.com/scummvm/scummvm/commit/45ae72b763268d87a5a6613231b7a11a2fbd8168
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: DEMON1 done (klingon attack)
Changed paths:
A engines/startrek/rooms/demon1.cpp
engines/startrek/action.h
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/menu.cpp
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/demon0.cpp
engines/startrek/rooms/function_map.h
engines/startrek/sound.cpp
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
index 7be09eb..232dc22 100644
--- a/engines/startrek/action.h
+++ b/engines/startrek/action.h
@@ -35,6 +35,7 @@ enum Acton {
ACTION_TOUCHED_WARP = 6,
ACTION_TOUCHED_HOTSPOT = 7, // Doors? (Or just hotspots activated by Kirk moving there?)
+ ACTION_TIMER_EXPIRED = 8,
ACTION_FINISHED_ANIMATION = 10,
ACTION_FINISHED_WALKING = 12,
ACTION_OPTIONS = 13 // Not really an action, but selectable from action menu
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 5bd134d..0265f4e 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -108,7 +108,7 @@ void StarTrekEngine::loadRoom(const Common::String &missionName, int roomIndex)
void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) {
_sound->stopAllVocSounds();
- memset(_awayMission.field25, 0xff, 4);
+ memset(_awayMission.crewDirectionsAfterWalk, 0xff, 4);
switch (warpEntryIndex) {
case 0: // 0-3: Read warp positions from RDF file
@@ -160,13 +160,13 @@ void StarTrekEngine::handleAwayMissionEvents() {
switch (event.type) {
case TREKEVENT_TICK:
updateActorAnimations();
- // sub_236bb();
+ updateCrewmanGetupTimers();
updateMouseBitmap();
// doSomethingWithBanData1();
_gfx->drawAllSprites();
// doSomethingWithBanData2();
_sound->checkLoopMusic();
- // sub_22de0();
+ updateAwayMissionTimers();
_frameIndex++;
_roomFrameCounter++;
addAction(Action(ACTION_TICK, _roomFrameCounter & 0xff, (_roomFrameCounter >> 8) & 0xff, 0));
@@ -180,7 +180,7 @@ void StarTrekEngine::handleAwayMissionEvents() {
switch (_awayMission.activeAction) {
case ACTION_WALK: {
- if (_awayMission.field1c != 0)
+ if (_awayMission.disableWalking)
break;
_kirkActor->sprite.drawMode = 1; // Hide these objects for function call below?
_spockActor->sprite.drawMode = 1;
@@ -208,7 +208,7 @@ void StarTrekEngine::handleAwayMissionEvents() {
}
case ACTION_USE: {
- if (_awayMission.activeObject == OBJECT_REDSHIRT && (_awayMission.redshirtDead || (_awayMission.field24 & 8))) {
+ if (_awayMission.activeObject == OBJECT_REDSHIRT && (_awayMission.redshirtDead || (_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT)))) {
hideInventoryIcons();
_awayMission.activeAction = ACTION_WALK;
break;
@@ -277,7 +277,7 @@ checkAddAction:
addAction(Action(_awayMission.activeAction, _awayMission.activeObject, _awayMission.passiveObject, 0));
checkShowInventory:
- if (!(_awayMission.field24 & 1))
+ if (!(_awayMission.crewDownBitset & (1 << OBJECT_KIRK)))
showInventoryIcons(true);
}
break;
@@ -304,7 +304,7 @@ checkShowInventory:
if (clickedObject != -2)
addAction(Action(_awayMission.activeAction, _awayMission.activeObject, 0, 0));
- if (_awayMission.activeAction == ACTION_LOOK && !(_awayMission.field24 & (1 << OBJECT_KIRK)))
+ if (_awayMission.activeAction == ACTION_LOOK && !(_awayMission.crewDownBitset & (1 << OBJECT_KIRK)))
showInventoryIcons(false);
}
break;
@@ -317,7 +317,7 @@ checkShowInventory:
break;
case TREKEVENT_RBUTTONDOWN: // TODO: also triggered by key press?
- if (_awayMission.field1d)
+ if (_awayMission.transitioningIntoRoom)
break;
hideInventoryIcons();
playSoundEffectIndex(0x07);
@@ -330,7 +330,7 @@ checkShowInventory:
_awayMission.activeObject = clickedObject;
}
if (_awayMission.activeAction == ACTION_USE
- && _awayMission.activeObject == OBJECT_ICOMM && (_awayMission.field24 & (1 << OBJECT_KIRK)) == 0) {
+ && _awayMission.activeObject == OBJECT_ICOMM && (_awayMission.crewDownBitset & (1 << OBJECT_KIRK)) == 0) {
if (!walkActiveObjectToHotspot()) {
addAction(Action(_awayMission.activeAction, _awayMission.activeObject, 0, 0));
_sound->playVoc("communic");
@@ -339,7 +339,7 @@ checkShowInventory:
}
else if (_awayMission.activeAction == ACTION_LOOK)
showInventoryIcons(false);
- else if (_awayMission.activeAction == ACTION_USE && (_awayMission.field24 & 1) == 0)
+ else if (_awayMission.activeAction == ACTION_USE && (_awayMission.crewDownBitset & 1) == 0)
showInventoryIcons(true);
break;
@@ -519,7 +519,7 @@ void StarTrekEngine::checkTouchedLoadingZone(int16 x, int16 y) {
}
_activeDoorWarpHotspot = -1;
- if (_awayMission.field24 == 0 && _warpHotspotsActive) {
+ if (_awayMission.crewDownBitset == 0 && _warpHotspotsActive) {
offset = _room->getFirstWarpPolygonOffset();
while (offset != _room->getWarpPolygonEndOffset()) {
@@ -540,6 +540,20 @@ void StarTrekEngine::checkTouchedLoadingZone(int16 x, int16 y) {
}
/**
+ * Updates any nonzero away mission timers, and invokes ACTION_TIMER_EXPIRED when any one
+ * reached 0.
+ */
+void StarTrekEngine::updateAwayMissionTimers() {
+ for (int i = 0; i < 8; i++) {
+ if (_awayMission.timers[i] == 0)
+ continue;
+ _awayMission.timers[i]--;
+ if (_awayMission.timers[i] == 0)
+ addAction(ACTION_TIMER_EXPIRED, i, 0, 0);
+ }
+}
+
+/**
* Returns true if the given position in the room is solid (not walkable).
* Reads from a ".map" file which has a bit for each position in the room, which is true
* when that position is solid.
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 34cdb4b..2e5b7d9 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -25,33 +25,47 @@
// All variables here get cleared to 0 upon starting an away mission.
struct AwayMission {
- int16 mouseX;
- int16 mouseY;
- byte field1c;
- byte field1d;
- byte transitioningIntoRoom; // Set while beaming in or walking into a room. Disables control?
- bool redshirtDead;
- byte activeAction;
- byte activeObject; // The item that is going to be used on something
- byte passiveObject; // The item that the active item is used on (or the item looked at, etc).
+ // These timers count down automatically when nonzero. When they reach 0,
+ // ACTION_TIMER_EXPIRED is invoked with the corresponding index (0-7).
+ int16 timers[8]; // 0x00-0x0f
+
+ int16 mouseX; // 0x10
+ int16 mouseY; // 0x12
+ int16 crewGetupTimers[4]; // 0x14
+ bool disableWalking; // 0x1c
+ byte transitioningIntoRoom; // 0x1d; Set while beaming in or walking into a room. Disables control?
+ bool redshirtDead; // 0x1e
+ byte activeAction; // 0x1f
+ byte activeObject; // 0x20; The item that is going to be used on something
+ byte passiveObject; // 0x21; The item that the active item is used on (or the item looked at, etc).
// If this is true after calling room-specific RDF code, the game will continue to run
// any "default" code for the event, if any.
- bool rdfStillDoDefaultAction;
+ bool rdfStillDoDefaultAction; // 0x23
+
+ // If a bit in "crewDownBitset" is set, the corresponding timer in "crewGetupTimers"
+ // begins counting down. When it reaches 0, they get up.
+ byte crewDownBitset;
- // Bits 0-3 correspond to the crewmen? A bit is set if they're not selectable with
- // the use action?
- byte field24;
+ int8 crewDirectionsAfterWalk[4]; // Sets an object's direction after they finish walking somewhere?
- int8 field25[4]; // Sets an object's direction after they finish walking somewhere?
+ // Mission-specific variables
+ union {
+ // Demon World
+ struct {
+ bool wasRudeToPrelate; // 0x29
+ bool beatKlingons; // 0x2f
+ bool tookKlingonHand; // 0x31
- // Demon Word: nonzero if a rude response was given to the prelate.
- int16 field29;
+ bool talkedToPrelate; // 0x33
+ bool askedPrelateAboutSightings; // 0x36
+ byte field37; // 0x37
+ bool mccoyMentionedFlora; // 0x38
+ byte enteredFrom; // 0x3a
- byte field33;
- byte field36;
- byte field38;
- byte field3a;
+ bool warpsDisabled; // 0x48
+ } demon;
+ };
int16 missionScore;
};
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index b0aea1f..d6929d0 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -848,6 +848,39 @@ void StarTrekEngine::showQuitGamePrompt(int x, int y) {
}
}
+void StarTrekEngine::showGameOverMenu() {
+ const char *options[] = {
+ "Game Over",
+ "#GENE\\GENER006#Load a previously saved game.",
+ "#GENE\\GENER020#Restart the game.",
+ "#GENE\\GENER018#Quit the game.",
+ ""
+ };
+
+ while (true) {
+ _inQuitGameMenu = true;
+ int selected = showText(&StarTrekEngine::readTextFromArray, (uintptr)options, 20, 20, TEXTCOLOR_YELLOW, true, false, true);
+ _inQuitGameMenu = false;
+
+ switch (selected) {
+ case 0: // Load game
+ _gfx->fadeoutScreen();
+ showLoadMenu(); // TODO: this probably manipulates the stack to jump out of this function...
+ break;
+ case 1: // Restart
+ _gfx->fadeoutScreen();
+ // TODO
+ break;
+ case 2: // Quit
+ _gfx->fadeoutScreen();
+ _system->quit();
+ break;
+ default:
+ break;
+ }
+ }
+}
+
/**
* This can be called from startup or from the options menu.
* On startup, this tries to load the setting without user input.
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index b011c06..94c2c8c 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -18,7 +18,8 @@ MODULE_OBJS = \
sprite.o \
startrek.o \
text.o \
- rooms/demon0.o
+ rooms/demon0.o \
+ rooms/demon1.o
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 17d66d8..f6e94f7 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -40,11 +40,16 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_roomActionList = demon0ActionList;
_numRoomActions = sizeof(demon0ActionList) / sizeof(RoomAction);
}
+ else if (name == "DEMON1") {
+ _roomActionList = demon1ActionList;
+ _numRoomActions = sizeof(demon1ActionList) / sizeof(RoomAction);
+ }
else {
warning("Room \"%s\" unimplemented", name.c_str());
_numRoomActions = 0;
- return;
}
+
+ memset(&_roomVar, 0, sizeof(_roomVar));
}
Room::~Room() {
@@ -182,7 +187,7 @@ void Room::giveItem(int item) {
}
void Room::loadRoomIndex(int roomIndex, int spawnIndex) {
- if (_vm->_awayMission.field24 != 0)
+ if (_vm->_awayMission.crewDownBitset != 0)
return;
_vm->loadRoomIndex(roomIndex, spawnIndex);
@@ -215,6 +220,10 @@ void Room::playMidiMusicTracks(int startTrack, int loopTrack) {
_vm->playMidiMusicTracks(startTrack, loopTrack);
}
+void Room::showGameOverMenu() {
+ _vm->showGameOverMenu();
+}
+
void Room::playVoc(Common::String filename) {
_vm->_sound->playVoc(filename);
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 220c733..c739244 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -103,6 +103,7 @@ private:
void walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam);// Cmd 0x08
void playSoundEffectIndex(int soundEffect); // Cmd 0x0f
void playMidiMusicTracks(int startTrack, int loopTrack); // Cmd 0x10
+ void showGameOverMenu(); // Cmd 0x12
void playVoc(Common::String filename); // Cmd 0x15
// Room-specific code
@@ -144,8 +145,75 @@ public:
void demon0UseSTricorderAnywhere();
void demon0UseMTricorderAnywhere();
void demon0UseMTricorderOnPrelate();
-
void demon0BadResponse();
+
+ // DEMON1
+ void demon1Tick1();
+ void demon1WalkToCave();
+ void demon1TouchedTopWarp();
+ void demon1TouchedBottomWarp();
+ void demon1Timer2Expired();
+ void demon1Timer0Expired();
+ void demon1Timer3Expired();
+ void demon1Timer1Expired();
+ void demon1KlingonFinishedAimingWeapon();
+ void demon1KirkShot();
+ void demon1UsePhaserOnAnything();
+ void demon1UsePhaserOnKlingon1();
+ void demon1ShootKlingon1();
+ void demon1KlingonDropsHand();
+ void demon1UsePhaserOnKlingon2();
+ void demon1ShootKlingon2();
+ void demon1UsePhaserOnKlingon3();
+ void demon1ShootKlingon3();
+ void demon1AllKlingonsDead();
+ void demon1Timer5Expired();
+ void demon1UseMTricorderOnKlingon();
+ void demon1UseSTricorderOnTulips();
+ void demon1UseSTricorderOnPods();
+ void demon1UseSTricorderOnCattails();
+ void demon1UseSTricorderOnFerns();
+ void demon1UseSTricorderOnHand();
+ void demon1UseSTricorderOnKlingon1();
+ void demon1UseSTricorderOnKlingon2Or3();
+ void demon1UseMTricorderOnKirk();
+ void demon1UseMTricorderOnSpock();
+ void demon1UseMTricorderOnRedshirt();
+ void demon1UseMTricorderOnCrewman();
+ void demon1GetHand();
+ void demon1ReachedHand();
+ void demon1PickedUpHand();
+ void demon1FinishedGettingHand();
+ void demon1LookAtKlingon();
+ void demon1LookAtCattails();
+ void demon1LookAtTulips();
+ void demon1LookAtPods();
+ void demon1LookAtFerns();
+ void demon1LookAtStream();
+ void demon1LookAtMine();
+ void demon1LookAtMountain();
+ void demon1LookAtHand();
+ void demon1LookAnywhere();
+ void demon1LookAtKirk();
+ void demon1LookAtSpock();
+ void demon1LookAtMcCoy();
+ void demon1LookAtRedshirt();
+ void demon1TalkToKirk();
+ void demon1TalkToSpock();
+ void demon1TalkToMcCoy();
+ void demon1TalkToRedshirt();
+ void demon1TalkToUnconsciousCrewman();
+
+private:
+ // Room-specific variables. This is memset'ed to 0 when the room is initialized.
+ union {
+ struct {
+ int numKlingonsKilled;
+ byte attackIndex;
+ bool kirkShooting;
+ char d6[10];
+ } demon1;
+ } _roomVar;
};
}
diff --git a/engines/startrek/rooms/demon0.cpp b/engines/startrek/rooms/demon0.cpp
index 41a5bbf..b9c0137 100644
--- a/engines/startrek/rooms/demon0.cpp
+++ b/engines/startrek/rooms/demon0.cpp
@@ -31,13 +31,13 @@ void Room::demon0Tick1() {
}
void Room::demon0Tick2() {
- if (_vm->_awayMission.field33 == 1)
+ if (_vm->_awayMission.demon.talkedToPrelate)
return;
loadActorAnim(8, "prel", 120, 190, 0);
}
void Room::demon0Tick60() {
- if (_vm->_awayMission.field33 == 1)
+ if (_vm->_awayMission.demon.talkedToPrelate)
return;
loadActorAnim2(8, "prelclap", 120, 190, 0);
}
@@ -59,23 +59,23 @@ void Room::demon0Tick140() {
""
};
- if (_vm->_awayMission.field38 == 1)
+ if (_vm->_awayMission.demon.mccoyMentionedFlora)
return;
showRoomSpecificText(text);
- _vm->_awayMission.field38 = 1;
+ _vm->_awayMission.demon.mccoyMentionedFlora = true;
}
void Room::demon0TouchedWarp0() {
- _vm->_awayMission.field3a = 1;
+ _vm->_awayMission.demon.enteredFrom = 1;
_vm->_awayMission.rdfStillDoDefaultAction = true;
}
void Room::demon0WalkToBottomDoor() {
_vm->_awayMission.transitioningIntoRoom = 1;
_rdfData[0xcd] = 1; // FIXME
- _vm->_awayMission.field25[OBJECT_KIRK] = DIR_E;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 243, 158, 1);
}
@@ -95,7 +95,7 @@ void Room::demon0ReachedBottomDoor() {
void Room::demon0WalkToTopDoor() {
_vm->_awayMission.transitioningIntoRoom = 1;
_rdfData[0xcc] = 1; // FIXME
- _vm->_awayMission.field25[OBJECT_KIRK] = DIR_E;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 157, 134, 2);
}
@@ -164,11 +164,11 @@ void Room::demon0TalkToPrelate() {
""
};
- if (_vm->_awayMission.field33 != 0)
+ if (_vm->_awayMission.demon.talkedToPrelate)
return;
_vm->_awayMission.missionScore += 3;
- _vm->_awayMission.field33 = 1;
+ _vm->_awayMission.demon.talkedToPrelate = true;
const char **response = nullptr;
@@ -197,7 +197,7 @@ void Room::demon0TalkToPrelate() {
showRoomSpecificText(thirdResponse);
- if (_vm->_awayMission.field29 != 0)
+ if (_vm->_awayMission.demon.wasRudeToPrelate)
showRoomSpecificText(badConclusion);
else
showRoomSpecificText(goodConclusion);
@@ -213,6 +213,7 @@ void Room::demon0LookAtPrelate() {
}
void Room::demon0UsePhaserOnSnow() {
+ // BUG: doesn't check if redshirt is dead.
const char *text[] = {
"Ensign Everts",
"#DEM0\\DEM0_039#Aw, Captain, please don't melt the snow. I've never seen it before.",
@@ -420,7 +421,7 @@ void Room::demon0TalkToRedshirt() {
}
void Room::demon0TalkToMcCoy() {
- if (_vm->_awayMission.field33 == 1) {
+ if (_vm->_awayMission.demon.talkedToPrelate) {
const char *text1[] = {
"Capt. Kirk",
"#DEM0\\DEM0_011#You look rather cold, Bones.",
@@ -456,7 +457,7 @@ void Room::demon0TalkToMcCoy() {
};
showRoomSpecificText(text1);
- if (_vm->_awayMission.field36 != 1) {
+ if (!_vm->_awayMission.demon.askedPrelateAboutSightings) {
demon0AskPrelateAboutSightings();
}
}
@@ -469,12 +470,12 @@ void Room::demon0TalkToSpock() {
""
};
- if (_vm->_awayMission.field33 == 1) {
+ if (_vm->_awayMission.demon.talkedToPrelate) {
showRoomSpecificText(text1);
}
else {
showRoomSpecificText(text1);
- if (_vm->_awayMission.field36 != 1)
+ if (!_vm->_awayMission.demon.askedPrelateAboutSightings)
demon0AskPrelateAboutSightings();
}
}
@@ -494,7 +495,7 @@ void Room::demon0AskPrelateAboutSightings() {
showRoomSpecificText(text2);
showRoomSpecificText(text3);
- _vm->_awayMission.field36 = 1;
+ _vm->_awayMission.demon.askedPrelateAboutSightings = true;
}
void Room::demon0UseSTricorderAnywhere() {
@@ -526,7 +527,7 @@ void Room::demon0UseMTricorderOnPrelate() {
loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
playSoundEffectIndex(0x04);
- if (_vm->_awayMission.field33 == 1) {
+ if (_vm->_awayMission.demon.talkedToPrelate) {
const char *text[] = {
"Dr. McCoy",
"#DEM0\\DEM0_018#His blood pressure's up a bit, but he believes he's telling the truth.",
@@ -552,11 +553,11 @@ void Room::demon0BadResponse() {
""
};
- if (_vm->_awayMission.field29 != 0)
+ if (_vm->_awayMission.demon.wasRudeToPrelate)
return;
_vm->_awayMission.missionScore -= 3;
- _vm->_awayMission.field29 = 1;
+ _vm->_awayMission.demon.wasRudeToPrelate = true;
showRoomSpecificText(text);
}
diff --git a/engines/startrek/rooms/demon1.cpp b/engines/startrek/rooms/demon1.cpp
new file mode 100644
index 0000000..7559dd7
--- /dev/null
+++ b/engines/startrek/rooms/demon1.cpp
@@ -0,0 +1,827 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+// BUG: under certain circumstances, the klingons just stop firing?
+
+void Room::demon1Tick1() {
+ playVoc("DEM1LOOP");
+
+ if (!_vm->_awayMission.demon.beatKlingons)
+ playMidiMusicTracks(1, -1);
+
+ if (_vm->_awayMission.demon.enteredFrom == 1) { // Entered from south
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
+ }
+ else if (_vm->_awayMission.demon.enteredFrom == 2) { // Entered from north?
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
+ }
+
+ if (!_vm->_awayMission.demon.beatKlingons) {
+ _vm->_awayMission.disableWalking = true;
+ _vm->_awayMission.timers[2] = 50;
+ }
+ else {
+ loadActorAnim(8, "klg1d2", 0x120, 0x82, 0);
+ if (!_vm->_awayMission.demon.tookKlingonHand)
+ loadActorAnim(13, "klghnd", 0x10b, 0x8e, 0);
+ loadActorAnim(9, "klg2d2", 0xaa, 0x7c, 0);
+ loadActorAnim(10, "klg3d2", 0, 0, 0);
+
+ _rdfData[0xca] = 1; // FIXME
+ _rdfData[0xcb] = 1;
+ _rdfData[0xcc] = 1;
+ _roomVar.demon1.numKlingonsKilled = 3;
+ }
+}
+
+void Room::demon1WalkToCave() {
+ if (_roomVar.demon1.numKlingonsKilled != 3)
+ return;
+ walkCrewman(OBJECT_KIRK, 0xa3, 0x56, 2);
+}
+
+void Room::demon1TouchedTopWarp() {
+ if (_vm->_awayMission.demon.warpsDisabled)
+ return;
+ loadRoomIndex(2, 1);
+}
+
+void Room::demon1TouchedBottomWarp() {
+ if (_vm->_awayMission.demon.warpsDisabled)
+ return;
+ loadRoomIndex(0, 0);
+}
+
+void Room::demon1Timer2Expired() {
+ if (_vm->_awayMission.demon.beatKlingons)
+ return;
+ _vm->_awayMission.demon.field37 = 1;
+ _vm->_awayMission.demon.beatKlingons = true;
+ _vm->_awayMission.demon.warpsDisabled = true;
+ _vm->_awayMission.timers[0] = 5;
+ _vm->_awayMission.timers[3] = 2;
+ _vm->_awayMission.timers[1] = 100;
+ loadActorAnim(8, "klg1u", 0x120, 0x82, 0);
+}
+
+void Room::demon1Timer0Expired() {
+ loadActorAnim(9, "klg2u", 0xaa, 0x7c, 0);
+}
+
+void Room::demon1Timer3Expired() {
+ loadActorAnim(10, "klg3u", 0xdb, 0x6d, 0);
+}
+
+void Room::demon1Timer1Expired() {
+ int shooter;
+ Common::String anim;
+
+ if (_rdfData[0xca] != 1) {
+ anim = "klg1f";
+ shooter = 8;
+
+ switch (_roomVar.demon1.attackIndex) {
+ case 0:
+ strcpy(_roomVar.demon1.d6, "klg1fr");
+ break;
+ case 1:
+ strcpy(_roomVar.demon1.d6, "klg1fm");
+ break;
+ case 2:
+ strcpy(_roomVar.demon1.d6, "klg1fs");
+ break;
+ case 3:
+ strcpy(_roomVar.demon1.d6, "klg1fk");
+ break;
+ default:
+ // TODO
+ return;
+ }
+ }
+ else if (_rdfData[0xcb] != 1) {
+ anim = "klg2f";
+ shooter = 9;
+ switch (_roomVar.demon1.attackIndex) {
+ case 0:
+ strcpy(_roomVar.demon1.d6, "klg2fr");
+ break;
+ case 1:
+ strcpy(_roomVar.demon1.d6, "klg2fm");
+ break;
+ case 2:
+ strcpy(_roomVar.demon1.d6, "klg2fs");
+ break;
+ case 3:
+ strcpy(_roomVar.demon1.d6, "klg2fk");
+ break;
+ default:
+ // TODO
+ return;
+ }
+ }
+ else {
+ anim = "klg3f";
+ shooter = 10;
+ switch (_roomVar.demon1.attackIndex) {
+ case 0:
+ strcpy(_roomVar.demon1.d6, "klg3fr");
+ break;
+ case 1:
+ strcpy(_roomVar.demon1.d6, "klg3fm");
+ break;
+ case 2:
+ strcpy(_roomVar.demon1.d6, "klg3fs");
+ break;
+ case 3:
+ strcpy(_roomVar.demon1.d6, "klg3fk");
+ break;
+ default:
+ // TODO
+ return;
+ }
+ }
+
+ loadActorAnim2(shooter, anim, -1, -1, 2);
+}
+
+void Room::demon1KlingonFinishedAimingWeapon() {
+ loadActorAnim(11, _roomVar.demon1.d6, 0, 0, 0);
+ playSoundEffectIndex(0x06);
+
+ _roomVar.demon1.attackIndex++;
+ int crewman;
+ if (_roomVar.demon1.attackIndex == 1) {
+ loadActorAnim2(OBJECT_REDSHIRT, "rstunn", -1, -1, 0);
+ crewman = OBJECT_REDSHIRT;
+ }
+ else if (_roomVar.demon1.attackIndex == 2) {
+ loadActorAnim2(OBJECT_SPOCK, "sstunn", -1, -1, 0);
+ crewman = OBJECT_SPOCK;
+ }
+ else if (_roomVar.demon1.attackIndex == 3) {
+ loadActorAnim2(OBJECT_MCCOY, "mstune", -1, -1, 0);
+ crewman = OBJECT_MCCOY;
+ }
+ else if (_roomVar.demon1.attackIndex == 4) {
+ loadActorAnim2(OBJECT_KIRK, "kstunn", -1, -1, 1);
+ crewman = OBJECT_KIRK;
+ }
+
+ _vm->_awayMission.crewDirectionsAfterWalk[crewman] = DIR_N;
+ _vm->_awayMission.crewGetupTimers[crewman] = 650;
+ _vm->_awayMission.crewDownBitset |= (1 << crewman);
+
+ _vm->_awayMission.timers[1] = 100;
+}
+
+void Room::demon1KirkShot() {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N000#Captain Kirk is fatally shot by a Klingon, game over.",
+ ""
+ };
+
+ showRoomSpecificText(text);
+ showGameOverMenu();
+}
+
+void Room::demon1UsePhaserOnAnything() {
+ const char *text[] = {
+ "Dr. McCoy",
+ "#DEM1\\DEM1_011#The fire fight is over, Jim. I think you can put that away now.",
+ ""
+ };
+
+ if (_roomVar.demon1.numKlingonsKilled == 3)
+ showRoomSpecificText(text);
+}
+
+void Room::demon1UsePhaserOnKlingon1() {
+ if (_rdfData[0xca] != 0)
+ return;
+ _vm->_awayMission.transitioningIntoRoom = 1;
+ _rdfData[0xca] = 1;
+
+ if (_roomVar.demon1.kirkShooting) {
+ demon1ShootKlingon1();
+ }
+ else {
+ loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 3);
+ _roomVar.demon1.kirkShooting = true;
+ }
+}
+
+void Room::demon1ShootKlingon1() {
+ _roomVar.demon1.numKlingonsKilled++;
+ if (_roomVar.demon1.numKlingonsKilled == 3) {
+ _vm->_awayMission.timers[1] = 0;
+ _vm->_awayMission.timers[5] = 180;
+ _vm->_awayMission.timers[6] = 1;
+ _vm->_awayMission.demon.warpsDisabled = false;
+ _vm->_awayMission.disableWalking = false;
+ }
+ loadActorAnim(12, "s0ks1", 0, 0, 0);
+ playSoundEffectIndex(0x06);
+ playVoc("EFX19");
+ loadActorAnim2(8, "klg1d", 0x120, 0x84, 7);
+}
+
+void Room::demon1KlingonDropsHand() {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N020#You see a small explosion, and the Klingon's hand falls to the ground with a dull thud.",
+ ""
+ };
+ loadActorAnim(13, "klghnd", 0x10b, 0x8e, 0);
+ _vm->_awayMission.transitioningIntoRoom = 0;
+ _vm->_awayMission.timers[1] = 0;
+ showRoomSpecificText(text);
+
+ if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT))
+ return;
+
+ const char *rshirtText[] = {
+ "Ensign Everts",
+ "#DEM1\\DEM1_025#I guess they don't make Klingons like they used to, Sir.",
+ ""
+ };
+ showRoomSpecificText(rshirtText);
+
+ if (_roomVar.demon1.numKlingonsKilled == 3)
+ return;
+
+ const char *klingonText[] = {
+ "Klingon",
+ "#DEM1\\DEM1_F23#Federation Scum!",
+ ""
+ };
+ showRoomSpecificText(klingonText);
+
+ _vm->_awayMission.timers[1] = 1;
+}
+
+void Room::demon1UsePhaserOnKlingon2() {
+ if (_rdfData[0xcb] != 0)
+ return;
+ _vm->_awayMission.transitioningIntoRoom = 1;
+ _rdfData[0xcb] = 1;
+
+ if (_roomVar.demon1.kirkShooting) {
+ demon1ShootKlingon2();
+ }
+ else {
+ loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 4);
+ _roomVar.demon1.kirkShooting = true;
+ }
+}
+
+void Room::demon1ShootKlingon2() {
+ _roomVar.demon1.numKlingonsKilled++;
+ if (_roomVar.demon1.numKlingonsKilled == 3) {
+ _vm->_awayMission.timers[1] = 0;
+ _vm->_awayMission.timers[5] = 180;
+ _vm->_awayMission.timers[6] = 1;
+ _vm->_awayMission.demon.warpsDisabled = false;
+ _vm->_awayMission.disableWalking = false;
+ }
+ loadActorAnim(12, "s0ks2", 0, 0, 0);
+ playSoundEffectIndex(0x06);
+ loadActorAnim2(9, "klg2d", 0xaa, 0x7c, 0);
+ _vm->_awayMission.transitioningIntoRoom = 0;
+}
+
+void Room::demon1UsePhaserOnKlingon3() {
+ if (_rdfData[0xcc] != 0)
+ return;
+ _vm->_awayMission.transitioningIntoRoom = 1;
+ _rdfData[0xcc] = 1;
+
+ if (_roomVar.demon1.kirkShooting) {
+ demon1ShootKlingon3();
+ }
+ else {
+ loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 5);
+ _roomVar.demon1.kirkShooting = true;
+ }
+}
+
+void Room::demon1ShootKlingon3() {
+ _roomVar.demon1.numKlingonsKilled++;
+ if (_roomVar.demon1.numKlingonsKilled == 3) {
+ _vm->_awayMission.timers[1] = 0;
+ _vm->_awayMission.timers[5] = 180;
+ _vm->_awayMission.timers[6] = 1;
+ _vm->_awayMission.demon.warpsDisabled = false;
+ _vm->_awayMission.disableWalking = false;
+ }
+ loadActorAnim(12, "s0ks3", 0, 0, 0);
+ playSoundEffectIndex(0x06);
+ loadActorAnim2(10, "klg3d", 0, 0, 0);
+ _vm->_awayMission.transitioningIntoRoom = 0;
+}
+
+// Timer 6 expired
+void Room::demon1AllKlingonsDead() {
+ _vm->_awayMission.crewGetupTimers[OBJECT_KIRK] = 45;
+ _vm->_awayMission.crewGetupTimers[OBJECT_SPOCK] = 45;
+ _vm->_awayMission.crewGetupTimers[OBJECT_MCCOY] = 45;
+ _vm->_awayMission.crewGetupTimers[OBJECT_REDSHIRT] = 45;
+}
+
+void Room::demon1Timer5Expired() {
+ if (_vm->_awayMission.crewDownBitset != 0)
+ return;
+
+ const char *text1[] = {
+ "Lt. Uhura",
+ "#DEM1\\DEM1U077#Captain we registered Phaser fire and an unknown energy beam. Is everyone OK?",
+ ""
+ };
+ const char *text2[] = {
+ "Capt. Kirk",
+ "#DEM1\\DEM1_003#We're fine. Did you register any Disruptor fire?",
+ ""
+ };
+ const char *text3[] = {
+ "Lt. Uhura",
+ "#DEM1\\DEM1U078#No, Captain. Why, are Klingons down there?",
+ ""
+ };
+ const char *text4[] = {
+ "Capt. Kirk",
+ "#DEM1\\DEM1_002#No just an idea, Kirk out.",
+ ""
+ };
+ const char *text5[] = {
+ "Mr. Spock",
+ "#DEM1\\DEM1_020#Fascinating. I begin to suspect that we have stumbled upon something that the colonists would never have uncovered.",
+ ""
+ };
+ const char *text6[] = {
+ "Capt. Kirk",
+ "#DEM1\\DEM1_004#What is it, Spock?",
+ ""
+ };
+ const char *text7[] = {
+ "Mr. Spock",
+ "#DEM1\\DEM1_021#I wish to gather further data before making a definite conclusion, Captain.",
+ ""
+ };
+
+ showRoomSpecificText(text1);
+ showRoomSpecificText(text2);
+ showRoomSpecificText(text3);
+ showRoomSpecificText(text4);
+ showRoomSpecificText(text5);
+ showRoomSpecificText(text6);
+ showRoomSpecificText(text7);
+}
+
+
+void Room::demon1UseMTricorderOnKlingon() {
+ const char *text[] = {
+ "Dr. McCoy",
+ "#DEM1\\DEM1_012#This is definitely not a real klingon Jim.",
+ ""
+ };
+ loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ showRoomSpecificText(text);
+}
+
+void Room::demon1UseSTricorderOnTulips() {
+ const char *text[] = {
+ "Mr. Spock",
+ "#DEM1\\DEM1_007#Khytellian tulips are a perennial flower that survive in almost any climate.",
+ ""
+ };
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ showRoomSpecificText(text);
+}
+
+void Room::demon1UseSTricorderOnPods() {
+ const char *text[] = {
+ "Mr. Spock",
+ "#DEM1\\DEM1_008#The Brandzite pod is similar to terran milkweed except that the silk pods are in bright iridecent colors.",
+ ""
+ };
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ showRoomSpecificText(text);
+}
+
+void Room::demon1UseSTricorderOnCattails() {
+ const char *text[] = {
+ "Mr. Spock",
+ "#DEM1\\DEM1_005#Doctis Cattails are similar to their terran name sake except that they are known to cause hives if in contact with flesh for any amount of time.",
+ ""
+ };
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ showRoomSpecificText(text);
+}
+
+void Room::demon1UseSTricorderOnFerns() {
+ const char *text[] = {
+ "Mr. Spock",
+ "#DEM1\\DEM1_006#Gindorian ferns are regarded as an intergalactic weed, Captain.",
+ ""
+ };
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ showRoomSpecificText(text);
+}
+
+void Room::demon1UseSTricorderOnHand() {
+ const char *text[] = {
+ "Mr. Spock",
+ "#DEM1\\DEM1_017#This is a detached hand with some kind of circuitry in the palm, Captain.",
+ ""
+ };
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ showRoomSpecificText(text);
+}
+
+void Room::demon1UseSTricorderOnKlingon1() {
+ // NOTE: it sets up the stack, but doesn't call the function...
+ //loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+
+ if (_roomVar.demon1.numKlingonsKilled == 3 && !_vm->_awayMission.demon.tookKlingonHand && _rdfData[0xcf] != 1) {
+ const char *text[] = {
+ "Mr. Spock",
+ "#DEM1\\DEM1_018#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial. There is something different about this particular construct. Come here, Captain, look at the hand.It seems to have been separated from the body. There is a wiring circuit in the middle of the palm.",
+ ""
+ };
+ showRoomSpecificText(text);
+ _rdfData[0xcf] = 1;
+ }
+ else {
+ const char *text[] = {
+ "Mr. Spock",
+ "#DEM1\\DEM1_019#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+}
+
+void Room::demon1UseSTricorderOnKlingon2Or3() {
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+
+ const char *text[] = {
+ "Mr. Spock",
+ "#DEM1\\DEM1_019#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon1UseMTricorderOnKirk() {
+ if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_KIRK))
+ demon1UseMTricorderOnCrewman();
+}
+
+void Room::demon1UseMTricorderOnSpock() {
+ if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_SPOCK))
+ demon1UseMTricorderOnCrewman();
+}
+
+void Room::demon1UseMTricorderOnRedshirt() {
+ if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT))
+ demon1UseMTricorderOnCrewman();
+}
+
+void Room::demon1UseMTricorderOnCrewman() {
+ const char *text[] = {
+ "Dr. McCoy",
+ "#DEM1\\DEM1_009#He's only stunned. He'll be back up in a few seconds.",
+ ""
+ };
+ loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ showRoomSpecificText(text);
+}
+
+void Room::demon1GetHand() {
+ if (_roomVar.demon1.numKlingonsKilled != 3)
+ return;
+ walkCrewman(OBJECT_KIRK, 0x104, 0x8e, 1);
+}
+
+void Room::demon1ReachedHand() {
+ loadActorAnim2(OBJECT_KIRK, "s5r1kg", -1, -1, 6);
+}
+
+void Room::demon1PickedUpHand() {
+ loadActorStandAnim(13);
+ _vm->_awayMission.missionScore += 3;
+ loadActorStandAnim(OBJECT_KIRK);
+ _vm->_awayMission.timers[4] = 2;
+}
+
+// Timer 4 expired
+void Room::demon1FinishedGettingHand() {
+ const char *text1[] = {
+ nullptr,
+ "#DEM1\\DEM1N005#You already took the hand from the Klingon.",
+ ""
+ };
+ const char *text2[] = {
+ nullptr,
+ "#DEM1\\DEM1N007#You take the Klingon's detached hand.",
+ ""
+ };
+
+ if (_vm->_awayMission.demon.tookKlingonHand)
+ showRoomSpecificText(text1);
+ else {
+ _vm->_awayMission.demon.tookKlingonHand = true;
+ giveItem(OBJECT_IHAND);
+ showRoomSpecificText(text2);
+ }
+}
+
+void Room::demon1LookAtKlingon() {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N004#They look like Klingons.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon1LookAtCattails() {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N018#These are very beautiful Doctis Cattails.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon1LookAtTulips() {
+ const char *text[] = {
+ nullptr,
+ "M1\\DEM1N010#A large patch of Khytellian Tulips.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon1LookAtPods() {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N019#These Brandzite Pods add a nice touch to the local flora.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon1LookAtFerns() {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N009#A Gindorian Fern.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon1LookAtStream() {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N011#A small stream flows down towards the forest.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon1LookAtMine() {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N021#You see the mine entrance ahead.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon1LookAtMountain() {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N016#Mt. Idyll rises above you.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon1LookAtHand() {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N023#It's the Klingon's detached hand!",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+void Room::demon1LookAnywhere() {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N017#The path is surrounded by some beautiful shrubbery.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon1LookAtKirk() {
+ if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_KIRK)) {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N012#Captain Kirk is unconscious.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+ else {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N003#James Kirk, filled with a premonition of more dangers yet to come.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+}
+
+void Room::demon1LookAtSpock() {
+ if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_SPOCK)) {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N015#Mr. Spock is unconscious.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+ else {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N008#Your Vulcan science officer seems to be lost in thought, but remains alert.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+}
+
+void Room::demon1LookAtMcCoy() {
+ if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_MCCOY)) {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N013#Dr. McCoy is unconscious.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+ else {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N001#Dr. McCoy, still hoping the cold winds that whip around Mount Idyll will soon die down.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+}
+
+void Room::demon1LookAtRedshirt() {
+ if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT)) {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N014#Ensign Everts is unconscious.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+ else {
+ const char *text[] = {
+ nullptr,
+ "#DEM1\\DEM1N002#Ensign Everts seems to be rattled by the attack of the Klingons.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+}
+
+void Room::demon1TalkToKirk() {
+ const char *text[] = {
+ "Capt. Kirk",
+ "#DEM1\\DEM1_001#We were caught flat footed there. I don't want any more surprises to catch us off guard.",
+ ""
+ };
+ if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_KIRK))
+ demon1TalkToUnconsciousCrewman();
+ else if (_roomVar.demon1.numKlingonsKilled == 3)
+ showRoomSpecificText(text);
+}
+
+void Room::demon1TalkToSpock() {
+ if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_SPOCK))
+ demon1TalkToUnconsciousCrewman();
+ else {
+ const char *text1[] = {
+ "Mr. Spock",
+ "#DEM1\\DEM1_022#Captain, I detect a recent avalanche, approximately 6.2 kilometers away, that occurred within the last three days. The mountain may be quite dangerous.",
+ ""
+ };
+ const char *text2[] = {
+ "Dr. McCoy",
+ "#DEM1\\DEM1_013#Demons, Klingons, avalanches... What's next, the Wicked Witch of the West?",
+ ""
+ };
+ const char *text3[] = {
+ "Mr. Spock",
+ "#DEM1\\DEM1_024#That is not logical, doctor.",
+ ""
+ };
+ const char *text4[] = {
+ "Dr. McCoy",
+ "#DEM1\\DEM1_014#It wasn't supposed to be logical, you green blooded Vulcan! Why does everything have to be so damned logical?",
+ ""
+ };
+ showRoomSpecificText(text1);
+ showRoomSpecificText(text2);
+ showRoomSpecificText(text3);
+ showRoomSpecificText(text4);
+ }
+}
+
+void Room::demon1TalkToMcCoy() {
+ if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_MCCOY))
+ demon1TalkToUnconsciousCrewman();
+ else {
+ const char *text1[] = {
+ "Dr. McCoy",
+ "#DEM1\\DEM1_015#Well, we've seen Klingons. Now all we need is a few Romulans...",
+ ""
+ };
+ const char *text2[] = {
+ "Mr. Spock",
+ "#DEM1\\DEM1_023#Control your thoughts, Doctor. There is a high probability that something here is using our own memories against us.",
+ ""
+ };
+ showRoomSpecificText(text1);
+ showRoomSpecificText(text2);
+ }
+}
+
+void Room::demon1TalkToRedshirt() {
+ if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT))
+ demon1TalkToUnconsciousCrewman();
+ else {
+ const char *text[] = {
+ "Ensign Everts",
+ "#DEM1\\DEM1_026#I guess this isn't such a great planet after all.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+}
+
+// FIXME: this doesn't happen in actual game? (does the event get blocked from higher up?)
+void Room::demon1TalkToUnconsciousCrewman() {
+ const char *text[] = {
+ nullptr,
+ "Zzzzz....",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+}
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index ae7e8eb..0743b79 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -85,6 +85,91 @@ RoomAction demon0ActionList[] = {
{ Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::demon0UseMTricorderOnPrelate },
};
+RoomAction demon1ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::demon1Tick1 },
+
+ { Action(ACTION_WALK, 0x25, 0, 0), &Room::demon1WalkToCave },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::demon1TouchedTopWarp },
+ { Action(ACTION_TOUCHED_WARP, 0, 0, 0), &Room::demon1TouchedTopWarp },
+ { Action(ACTION_TOUCHED_WARP, 1, 0, 0), &Room::demon1TouchedBottomWarp },
+
+ { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::demon1Timer2Expired },
+ { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::demon1Timer0Expired },
+ { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::demon1Timer3Expired },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::demon1Timer1Expired },
+
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::demon1KlingonFinishedAimingWeapon },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::demon1KirkShot },
+
+ { Action(ACTION_USE, OBJECT_IPHASERK, -1, 0), &Room::demon1UsePhaserOnAnything },
+ { Action(ACTION_USE, OBJECT_IPHASERS, -1, 0), &Room::demon1UsePhaserOnAnything },
+
+ { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::demon1UsePhaserOnKlingon1 },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::demon1UsePhaserOnKlingon1 },
+ { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::demon1ShootKlingon1 },
+ { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::demon1KlingonDropsHand },
+
+ { Action(ACTION_USE, OBJECT_IPHASERK, 9, 0), &Room::demon1UsePhaserOnKlingon2 },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 9, 0), &Room::demon1UsePhaserOnKlingon2 },
+ { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::demon1ShootKlingon2 },
+
+ { Action(ACTION_USE, OBJECT_IPHASERK, 10, 0), &Room::demon1UsePhaserOnKlingon3 },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 10, 0), &Room::demon1UsePhaserOnKlingon3 },
+ { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::demon1ShootKlingon3 },
+
+ { Action(ACTION_TIMER_EXPIRED, 6, 0, 0), &Room::demon1AllKlingonsDead },
+ { Action(ACTION_TIMER_EXPIRED, 5, 0, 0), &Room::demon1Timer5Expired },
+
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 13, 0), &Room::demon1UseMTricorderOnKlingon },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::demon1UseSTricorderOnTulips },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::demon1UseSTricorderOnPods },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::demon1UseSTricorderOnCattails },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::demon1UseSTricorderOnFerns },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 13, 0), &Room::demon1UseSTricorderOnHand },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::demon1UseSTricorderOnKlingon1 },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 10, 0), &Room::demon1UseSTricorderOnKlingon2Or3 },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 9, 0), &Room::demon1UseSTricorderOnKlingon2Or3 },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 8, 0), &Room::demon1UseMTricorderOnKlingon },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::demon1UseMTricorderOnKlingon },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 10, 0), &Room::demon1UseMTricorderOnKlingon },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 9, 0), &Room::demon1UseMTricorderOnKlingon },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 10, 0), &Room::demon1UseMTricorderOnKlingon },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 9, 0), &Room::demon1UseMTricorderOnKlingon },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::demon1UseSTricorderOnKlingon2Or3 }, // This is redundant
+
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0), &Room::demon1UseMTricorderOnKirk },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0), &Room::demon1UseMTricorderOnSpock },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0), &Room::demon1UseMTricorderOnRedshirt },
+
+ { Action(ACTION_GET, 13, 0, 0), &Room::demon1GetHand },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::demon1ReachedHand },
+ { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::demon1PickedUpHand },
+ { Action(ACTION_TIMER_EXPIRED, 4, 0, 0), &Room::demon1FinishedGettingHand },
+
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::demon1LookAtKlingon },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::demon1LookAtKlingon },
+ { Action(ACTION_LOOK, 10, 0, 0), &Room::demon1LookAtKlingon },
+
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon1LookAtCattails },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::demon1LookAtTulips },
+ { Action(ACTION_LOOK, 0x22, 0, 0), &Room::demon1LookAtPods },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::demon1LookAtFerns },
+ { Action(ACTION_LOOK, 0x24, 0, 0), &Room::demon1LookAtStream },
+ { Action(ACTION_LOOK, 0x25, 0, 0), &Room::demon1LookAtMine },
+ { Action(ACTION_LOOK, 0x26, 0, 0), &Room::demon1LookAtMountain },
+ { Action(ACTION_LOOK, 13, 0, 0), &Room::demon1LookAtHand },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::demon1LookAnywhere },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::demon1LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::demon1LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::demon1LookAtMcCoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::demon1LookAtRedshirt },
+
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::demon1TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::demon1TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::demon1TalkToMcCoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::demon1TalkToRedshirt },
+};
+
}
#endif
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 5ae06e2..553d011 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -318,7 +318,9 @@ void Sound::loadPCMusicFile(const Common::String &baseSoundName) {
delete[] loadedSoundData;
loadedSoundData = new byte[soundStream->size()];
soundStream->read(loadedSoundData, soundStream->size());
- _midiSlots[0].midiParser->loadMusic(loadedSoundData, soundStream->size());
+
+ // FIXME: should music start playing when this is called?
+ //_midiSlots[0].midiParser->loadMusic(loadedSoundData, soundStream->size());
}
void Sound::clearMidiSlot(int slot) {
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index b4777a9..35a6c9f 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -657,10 +657,10 @@ void StarTrekEngine::initStandAnim(int actorIndex) {
const char *directions = "nsew";
if (actorIndex >= 0 && actorIndex <= 3) {
- int8 dir = _awayMission.field25[actorIndex];
+ int8 dir = _awayMission.crewDirectionsAfterWalk[actorIndex];
if (dir != -1) {
actor->direction = directions[dir];
- _awayMission.field25[actorIndex] = -1;
+ _awayMission.crewDirectionsAfterWalk[actorIndex] = -1;
}
}
// end of sub_239d2
@@ -972,7 +972,7 @@ SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filen
*/
int StarTrekEngine::selectObjectForUseAction() {
while (true) {
- if (!(_awayMission.field24 & (1 << OBJECT_KIRK)))
+ if (!(_awayMission.crewDownBitset & (1 << OBJECT_KIRK)))
showInventoryIcons(false);
TrekEvent event;
@@ -1239,11 +1239,11 @@ bool StarTrekEngine::isObjectUnusable(int object, int action) {
return false;
if (object == OBJECT_REDSHIRT && _awayMission.redshirtDead)
return true;
- if (object >= OBJECT_KIRK && object <= OBJECT_REDSHIRT && (_awayMission.field24 & (1 << object)))
+ if (object >= OBJECT_KIRK && object <= OBJECT_REDSHIRT && (_awayMission.crewDownBitset & (1 << object)))
return true;
- if (object == OBJECT_IMTRICOR && (_awayMission.field24 & (1 << OBJECT_MCCOY)))
+ if (object == OBJECT_IMTRICOR && (_awayMission.crewDownBitset & (1 << OBJECT_MCCOY)))
return true;
- if (object == OBJECT_ISTRICOR && (_awayMission.field24 & (1 << OBJECT_SPOCK)))
+ if (object == OBJECT_ISTRICOR && (_awayMission.crewDownBitset & (1 << OBJECT_SPOCK)))
return true;
return false;
}
@@ -1270,6 +1270,51 @@ void StarTrekEngine::hideInventoryIcons() {
}
}
+/**
+ * When a crewman is collapsed, they get once a timer reaches 0.
+ */
+void StarTrekEngine::updateCrewmanGetupTimers() {
+ if (_awayMission.crewDownBitset == 0)
+ return;
+ for (int i = OBJECT_KIRK; i <= OBJECT_REDSHIRT; i++) {
+ Actor *actor = &_actorList[i];
+
+ if (!(_awayMission.crewDownBitset & (1 << i)))
+ continue;
+
+ _awayMission.crewGetupTimers[i]--;
+ if (_awayMission.crewGetupTimers[i] <= 0) {
+ Common::String anim = getCrewmanAnimFilename(i, "getu");
+ int8 dir = _awayMission.crewDirectionsAfterWalk[i];
+ char d;
+ if (dir == -1) {
+ d = actor->direction;
+ }
+ else {
+ const char *dirs = "nsew";
+ uint16 scale = getActorScaleAtPosition(actor->sprite.pos.y);
+ d = dirs[dir];
+
+ int16 xOffset = 0, yOffset = 0;
+ if (d == 'n') {
+ xOffset = -24;
+ yOffset = -8;
+ }
+ else if (d == 'w') {
+ xOffset = -35;
+ yOffset = -12;
+ }
+ actor->sprite.pos.x += (scale * xOffset) >> 8;
+ actor->sprite.pos.y += (scale * yOffset) >> 8;
+ }
+
+ anim += (char)d;
+ loadActorAnimWithRoomScaling(i, anim, actor->sprite.pos.x, actor->sprite.pos.y);
+ _awayMission.crewDownBitset &= ~(1 << i);
+ }
+ }
+}
+
int StarTrekEngine::showInventoryMenu(int x, int y, bool restoreMouse) {
const int ITEMS_PER_ROW = 5;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index b408b39..f5715d5 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -198,6 +198,7 @@ public:
bool isPointInPolygon(int16 *data, int16 x, int16 y);
void checkTouchedLoadingZone(int16 x, int16 y);
+ void updateAwayMissionTimers();
bool isPositionSolid(int16 x, int16 y);
void loadRoomIndex(int roomIndex, int spawnIndex);
@@ -241,6 +242,7 @@ public:
void updateMouseBitmap();
bool walkActiveObjectToHotspot();
bool isObjectUnusable(int objectIndex, int action);
+ void updateCrewmanGetupTimers();
void showInventoryIcons(bool showItem);
void hideInventoryIcons();
int showInventoryMenu(int x, int y, bool restoreMouse);
@@ -315,6 +317,7 @@ public:
void showSaveMenu();
void showLoadMenu();
void showQuitGamePrompt(int x, int y);
+ void showGameOverMenu();
void showTextConfigurationMenu(bool fromOptionMenu);
int loadTextDisplayMode();
Commit: 9e314e19d98bfb952c5fb1eb216fa97d0e95179f
https://github.com/scummvm/scummvm/commit/9e314e19d98bfb952c5fb1eb216fa97d0e95179f
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Demon2, half of Demon3 done
Changed paths:
A engines/startrek/rooms/demon2.cpp
A engines/startrek/rooms/demon3.cpp
engines/startrek/awaymission.h
engines/startrek/bitmap.h
engines/startrek/graphics.cpp
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/demon0.cpp
engines/startrek/rooms/demon1.cpp
engines/startrek/rooms/function_map.h
engines/startrek/sound.cpp
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 2e5b7d9..9087589 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -61,9 +61,23 @@ struct AwayMission {
bool askedPrelateAboutSightings; // 0x36
byte field37; // 0x37
bool mccoyMentionedFlora; // 0x38
+ byte numBouldersGone; // 0x39
byte enteredFrom; // 0x3a
-
+ bool field3c; // 0x3c
+ bool curedBrother; // 0x3d
+ bool knowAboutHypoDytoxin; // 0x3f
+ byte field41; // 0x41
+ bool foundMiner; // 0x43
+ bool field45; // 0x45
bool warpsDisabled; // 0x48
+ bool boulder1Gone; // 0x49
+ bool boulder2Gone; // 0x4a
+ bool boulder3Gone; // 0x4b
+ bool boulder4Gone; // 0x4c
+ bool doorRevealed; // 0x4d
+ bool gotBerries; // 0x50
+ bool madeHypoDytoxin; // 0x51
+ byte field56; // 0x56
} demon;
};
diff --git a/engines/startrek/bitmap.h b/engines/startrek/bitmap.h
index fcebd67..b4c7a87 100644
--- a/engines/startrek/bitmap.h
+++ b/engines/startrek/bitmap.h
@@ -9,10 +9,10 @@
namespace StarTrek {
struct Bitmap {
- uint16 xoffset;
- uint16 yoffset;
- uint16 width;
- uint16 height;
+ int16 xoffset;
+ int16 yoffset;
+ int16 width;
+ int16 height;
byte *pixels;
Bitmap(Common::SharedPtr<FileStream> stream);
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 2e28951..a5b2b7b 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -493,6 +493,8 @@ void Graphics::drawAllSprites(bool updateScreen) {
// Redraw the background on every dirty rectangle
for (int i = 0; i < numDirtyRects; i++) {
Common::Rect &r = dirtyRects[i];
+ if (r.width() == 0 || r.height() == 0)
+ continue;
int offset = r.top * SCREEN_WIDTH + r.left;
_vm->_system->copyRectToScreen(_backgroundImage->pixels+offset, SCREEN_WIDTH, r.left, r.top, r.width(), r.height());
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 94c2c8c..a374f80 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -19,7 +19,9 @@ MODULE_OBJS = \
startrek.o \
text.o \
rooms/demon0.o \
- rooms/demon1.o
+ rooms/demon1.o \
+ rooms/demon2.o \
+ rooms/demon3.o
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index f6e94f7..1de1215 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -21,6 +21,7 @@
*/
#include "startrek/filestream.h"
+#include "startrek/iwfile.h"
#include "startrek/room.h"
#include "startrek/startrek.h"
@@ -44,6 +45,14 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_roomActionList = demon1ActionList;
_numRoomActions = sizeof(demon1ActionList) / sizeof(RoomAction);
}
+ else if (name == "DEMON2") {
+ _roomActionList = demon2ActionList;
+ _numRoomActions = sizeof(demon2ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "DEMON3") {
+ _roomActionList = demon3ActionList;
+ _numRoomActions = sizeof(demon3ActionList) / sizeof(RoomAction);
+ }
else {
warning("Room \"%s\" unimplemented", name.c_str());
_numRoomActions = 0;
@@ -199,7 +208,7 @@ void Room::loadRoomIndex(int roomIndex, int spawnIndex) {
}
void Room::walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam) {
- if (!(actorIndex >= OBJECT_KIRK && actorIndex < OBJECT_REDSHIRT))
+ if (!(actorIndex >= OBJECT_KIRK && actorIndex <= OBJECT_REDSHIRT))
error("Tried to walk a non PC");
Actor *actor = &_vm->_actorList[actorIndex];
@@ -212,6 +221,21 @@ void Room::walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finished
}
}
+/**
+ * Loads a pair of .map and .iw files to change the room's collisions and pathfinding.
+ */
+void Room::loadMapFile(const Common::String &name) {
+ _vm->_mapFilename = name;
+ _vm->_iwFile.reset();
+ _vm->_mapFile.reset();
+ _vm->_iwFile = SharedPtr<IWFile>(new IWFile(_vm, name + ".iw"));
+ _vm->_mapFile = _vm->loadFile(name + ".map");
+}
+
+Common::Point Room::getActorPos(int actorIndex) {
+ return _vm->_actorList[actorIndex].pos;
+}
+
void Room::playSoundEffectIndex(int soundEffect) {
_vm->playSoundEffectIndex(soundEffect);
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index c739244..785be27 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -49,6 +49,11 @@ const int RDF_WARP_ROOM_INDICES = 0x22;
const int RDF_ROOM_ENTRY_POSITIONS = 0x2a;
const int RDF_BEAM_IN_POSITIONS = 0xaa;
+const char SPEAKER_KIRK[] = "Capt. Kirk";
+const char SPEAKER_SPOCK[] = "Mr. Spock";
+const char SPEAKER_MCCOY[] = "Dr. McCoy";
+const char SPEAKER_EVERTS[] = "Ensign Everts";
+
class Room {
public:
@@ -101,6 +106,8 @@ private:
void giveItem(int item); // Cmd 0x04
void loadRoomIndex(int roomIndex, int spawnIndex); // Cmd 0x06
void walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam);// Cmd 0x08
+ void loadMapFile(const Common::String &name); // Cmd 0x09
+ Common::Point getActorPos(int actorIndex); // Cmd 0x0d
void playSoundEffectIndex(int soundEffect); // Cmd 0x0f
void playMidiMusicTracks(int startTrack, int loopTrack); // Cmd 0x10
void showGameOverMenu(); // Cmd 0x12
@@ -204,6 +211,68 @@ public:
void demon1TalkToRedshirt();
void demon1TalkToUnconsciousCrewman();
+ // DEMON2
+ void demon2Tick1();
+ void demon2WalkToCave();
+ void demon2ReachedCave();
+ void demon2TouchedWarp1();
+ void demon2LookAtCave();
+ void demon2LookAtMountain();
+ void demon2LookAtBerries();
+ void demon2LookAtFern();
+ void demon2LookAtMoss();
+ void demon2LookAtLights();
+ void demon2LookAtAnything();
+ void demon2LookAtKirk();
+ void demon2LookAtSpock();
+ void demon2LookAtMcCoy();
+ void demon2LookAtRedshirt();
+ void demon2TalkToKirk();
+ void demon2TalkToSpock();
+ void demon2TalkToMcCoy();
+ void demon2TalkToRedshirt();
+ void demon2UsePhaserOnBerries();
+ void demon2UseSTricorderOnBerries();
+ void demon2UseSTricorderOnMoss();
+ void demon2UseSTricorderOnFern();
+ void demon2UseSTricorderOnCave();
+ void demon2UseMTricorderOnBerries();
+ void demon2GetBerries();
+ void demon2ReachedBerries();
+ void demon2PickedUpBerries();
+
+ // DEMON3
+ void demon3Tick1();
+ void demon3Timer0Expired();
+ void demon3Timer1Expired();
+ void demon3Timer3Expired();
+ void demon3FinishedAnimation1();
+ void demon3FinishedAnimation2();
+ void demon3FinishedWalking5();
+ void demon3McCoyInFiringPosition();
+ void demon3SpockInFiringPosition();
+ void demon3RedShirtInFiringPosition();
+ void demon3KirkInFiringPosition();
+ void demon3CrewmanInFiringPosition();
+ void demon3PullOutPhaserAndFireAtBoulder();
+ void demon3FireAtBoulder();
+ void demon3UsePhaserOnRedshirt();
+ void demon3UseStunPhaserOnBoulder();
+ void demon3UsePhaserOnBoulder1();
+ void demon3UsePhaserOnBoulder2();
+ void demon3UsePhaserOnBoulder3();
+ void demon3UsePhaserOnBoulder4();
+ void demon3BoulderCommon();
+ void demon3UseSTricorderOnMiner();
+ void demon3UseSTricorderOnPanel();
+ void demon3UseSTricorderOnBoulder();
+ void demon3UseMTricorderOnBoulder();
+ void demon3UseCrewmanOnPanel();
+ void demon3UseRedshirtOnPanel();
+ void demon3RedshirtReachedPanel();
+ void demon3RedshirtUsedPanel();
+ void demon3RedshirtElectrocuted();
+
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
@@ -213,6 +282,19 @@ private:
bool kirkShooting;
char d6[10];
} demon1;
+
+ struct {
+ bool shootingBoulder; // 0xca
+ bool boulder1Shot; // 0xcb
+ byte boulderBeingShot; // 0xcc
+ bool kirkInPosition; // 0xcd
+ bool redshirtInPosition; // 0xce
+ bool spockInPosition; // 0xcf
+ bool mccoyInPosition; // 0xd0
+ bool inFiringPosition; // 0xd1
+ bool kirkPhaserOut; // 0xd3
+ char boulderAnim[10]; // 0xd4
+ } demon3;
} _roomVar;
};
diff --git a/engines/startrek/rooms/demon0.cpp b/engines/startrek/rooms/demon0.cpp
index b9c0137..529bf74 100644
--- a/engines/startrek/rooms/demon0.cpp
+++ b/engines/startrek/rooms/demon0.cpp
@@ -54,7 +54,7 @@ void Room::demon0Tick100() {
void Room::demon0Tick140() {
const char *text[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM0\\DEM0_016#Captain, the flora on this planet is very interesting. I wonder how useful it may be for medicinal purposes.",
""
};
@@ -114,7 +114,7 @@ void Room::demon0ReachedTopDoor() {
void Room::demon0TalkToPrelate() {
const char *options1[] = {
- "Capt. Kirk",
+ SPEAKER_KIRK,
"#DEM0\\DEM0_006#I'm Captain James T. Kirk of the U.S.S. Enterprise. We have received word that alien lifeforms are creating problems at your mining facilities at Idyll Mountain. Tell me more.",
"#DEM0\\DEM0_008#Most High Prelate Angiven, I am honored to meet you. I consider it my divine duty to assist you in any possible way with the spawn of the devil.",
"#DEM0\\DEM0_003#Been seeing ghosts and bogeymen eh? I find that a little hard to believe.",
@@ -131,7 +131,7 @@ void Room::demon0TalkToPrelate() {
""
};
const char *options2[] = {
- "Capt. Kirk",
+ SPEAKER_KIRK,
"#DEM0\\DEM0_002#Aside from seeing demons, has any hard data been collected? Any evidence I could see?",
"#DEM0\\DEM0_005#Demons? Gates of Hell? This is the 23rd Century!",
""
@@ -142,7 +142,7 @@ void Room::demon0TalkToPrelate() {
""
};
const char *options3[] = {
- "Capt. Kirk",
+ SPEAKER_KIRK,
"#DEM0\\DEM0_010#What can you tell me about the mine itself?",
"#DEM0\\DEM0_012#You're wasting the time of a starship capable of destroying this planet with campfire stories? No wonder you were dumped out here in the middle of nowhere.",
""
@@ -215,7 +215,7 @@ void Room::demon0LookAtPrelate() {
void Room::demon0UsePhaserOnSnow() {
// BUG: doesn't check if redshirt is dead.
const char *text[] = {
- "Ensign Everts",
+ SPEAKER_EVERTS,
"#DEM0\\DEM0_039#Aw, Captain, please don't melt the snow. I've never seen it before.",
""
};
@@ -224,7 +224,7 @@ void Room::demon0UsePhaserOnSnow() {
void Room::demon0UsePhaserOnSign() {
const char *text[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM0\\DEM0_017#Quite the vandal aren't we, Jim?",
""
};
@@ -233,17 +233,17 @@ void Room::demon0UsePhaserOnSign() {
void Room::demon0UsePhaserOnShelter() {
const char *text1[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM0\\DEM0_015#Burning down their house is not the best way to gain their confidence Jim!",
""
};
const char *text2[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM0\\DEM0_013#Captain, Doctor McCoy is correct.",
""
};
const char *text3[] = {
- "Ensign Everts",
+ SPEAKER_EVERTS,
"#DEM0\\DEM0_040#Is he always this trigger happy on ground missions?",
""
};
@@ -255,7 +255,7 @@ void Room::demon0UsePhaserOnShelter() {
void Room::demon0UsePhaserOnPrelate() {
const char *text[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM0\\DEM0_020#Jim! Are you out of your mind?",
""
};
@@ -354,22 +354,22 @@ void Room::demon0LookAtShelter() {
void Room::demon0TalkToKirk() {
const char *text1[] = {
- "Capt. Kirk",
+ SPEAKER_KIRK,
"#DEM0\\DEM0_009#This planet's as beautiful as everyone says it is.",
""
};
const char *text2[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM0\\DEM0_027#The trees. The fresh air. The freezing cold...",
""
};
const char *text3[] = {
- "Capt. Kirk",
+ SPEAKER_KIRK,
"#DEM0\\DEM0_004#C'mon Bones, the cold will improve your circulation.",
""
};
const char *text4[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM0\\DEM0_024#Some people get too much circulation!",
""
};
@@ -382,32 +382,32 @@ void Room::demon0TalkToKirk() {
void Room::demon0TalkToRedshirt() {
const char *text1[] = {
- "Ensign Everts",
+ SPEAKER_EVERTS,
"#DEM0\\DEM0_043#I've never seen snow like this before. This is great!",
""
};
const char *text2[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM0\\DEM0_026#You mean you've never built a snowman, ensign?",
""
};
const char *text3[] = {
- "Ensign Everts",
+ SPEAKER_EVERTS,
"#DEM0\\DEM0_042#I've never even thrown a snowball. Do you think anyone would mind?",
""
};
const char *text4[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM0\\DEM0_025#Well...",
""
};
const char *text5[] = {
- "Capt. Kirk",
+ SPEAKER_KIRK,
"#DEM0\\DEM0_007#Later Ensign. We have work to do.",
""
};
const char *text6[] = {
- "Ensign Everts",
+ SPEAKER_EVERTS,
"#DEM0\\DEM0_044#Of course, sir.",
""
};
@@ -423,22 +423,22 @@ void Room::demon0TalkToRedshirt() {
void Room::demon0TalkToMcCoy() {
if (_vm->_awayMission.demon.talkedToPrelate) {
const char *text1[] = {
- "Capt. Kirk",
+ SPEAKER_KIRK,
"#DEM0\\DEM0_011#You look rather cold, Bones.",
""
};
const char *text2[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM0\\DEM0_023#I'm not cold, I'm freezing! And that damn transporter just had to set me down in the middle of a snow drift!",
""
};
const char *text3[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM0\\DEM0_029#A centimeter of snow does not technically constitute a drift, Doctor.",
""
};
const char *text4[] = {
- "Ensign Everts",
+ SPEAKER_EVERTS,
"#DEM0\\DEM0_041#And doctors say that patients complain too much!",
""
};
@@ -451,7 +451,7 @@ void Room::demon0TalkToMcCoy() {
}
else {
const char *text1[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM0\\DEM0_019#I don't know if the problem is real, the result of a new illness, or mass hysteria. But at the very least, there's an injured miner who needs my help.",
""
};
@@ -465,7 +465,7 @@ void Room::demon0TalkToMcCoy() {
void Room::demon0TalkToSpock() {
const char *text1[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM0\\DEM0_014#Captain, demons and supernatural creatures are, almost by definition, illogical. Yet it is evident these people believe what they have seen. Barring illness or mass hysteria, I agree that a real problem seems to exist.",
""
};
@@ -482,7 +482,7 @@ void Room::demon0TalkToSpock() {
void Room::demon0AskPrelateAboutSightings() {
const char *text2[] = {
- "Capt. Kirk",
+ SPEAKER_KIRK,
"#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?",
""
};
@@ -503,7 +503,7 @@ void Room::demon0UseSTricorderAnywhere() {
playSoundEffectIndex(0x04);
const char *text[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM0\\DEM0_028#Captain, reading the rocks in this area, I find that this locality may have been disturbed in the distant past. Recent disturbances created by the colonists' construction and mining prevent me from discovering anything further.",
""
};
@@ -516,7 +516,7 @@ void Room::demon0UseMTricorderAnywhere() {
playSoundEffectIndex(0x04);
const char *text[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM0\\DEM0_021#Jim, I am not picking up any unusual life here, just native lifeforms and the settlers. The colonists are all human, except for the one Tellarite. If there are demons here, they don't register on my tricorder.",
""
};
@@ -529,7 +529,7 @@ void Room::demon0UseMTricorderOnPrelate() {
if (_vm->_awayMission.demon.talkedToPrelate) {
const char *text[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM0\\DEM0_018#His blood pressure's up a bit, but he believes he's telling the truth.",
""
};
@@ -537,7 +537,7 @@ void Room::demon0UseMTricorderOnPrelate() {
}
else {
const char *text[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM0\\DEM0_022#The man's in perfect health.",
""
};
diff --git a/engines/startrek/rooms/demon1.cpp b/engines/startrek/rooms/demon1.cpp
index 7559dd7..2830ff9 100644
--- a/engines/startrek/rooms/demon1.cpp
+++ b/engines/startrek/rooms/demon1.cpp
@@ -216,7 +216,7 @@ void Room::demon1KirkShot() {
void Room::demon1UsePhaserOnAnything() {
const char *text[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM1\\DEM1_011#The fire fight is over, Jim. I think you can put that away now.",
""
};
@@ -270,7 +270,7 @@ void Room::demon1KlingonDropsHand() {
return;
const char *rshirtText[] = {
- "Ensign Everts",
+ SPEAKER_EVERTS,
"#DEM1\\DEM1_025#I guess they don't make Klingons like they used to, Sir.",
""
};
@@ -367,7 +367,7 @@ void Room::demon1Timer5Expired() {
""
};
const char *text2[] = {
- "Capt. Kirk",
+ SPEAKER_KIRK,
"#DEM1\\DEM1_003#We're fine. Did you register any Disruptor fire?",
""
};
@@ -377,22 +377,22 @@ void Room::demon1Timer5Expired() {
""
};
const char *text4[] = {
- "Capt. Kirk",
+ SPEAKER_KIRK,
"#DEM1\\DEM1_002#No just an idea, Kirk out.",
""
};
const char *text5[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM1\\DEM1_020#Fascinating. I begin to suspect that we have stumbled upon something that the colonists would never have uncovered.",
""
};
const char *text6[] = {
- "Capt. Kirk",
+ SPEAKER_KIRK,
"#DEM1\\DEM1_004#What is it, Spock?",
""
};
const char *text7[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM1\\DEM1_021#I wish to gather further data before making a definite conclusion, Captain.",
""
};
@@ -409,7 +409,7 @@ void Room::demon1Timer5Expired() {
void Room::demon1UseMTricorderOnKlingon() {
const char *text[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM1\\DEM1_012#This is definitely not a real klingon Jim.",
""
};
@@ -420,7 +420,7 @@ void Room::demon1UseMTricorderOnKlingon() {
void Room::demon1UseSTricorderOnTulips() {
const char *text[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM1\\DEM1_007#Khytellian tulips are a perennial flower that survive in almost any climate.",
""
};
@@ -431,7 +431,7 @@ void Room::demon1UseSTricorderOnTulips() {
void Room::demon1UseSTricorderOnPods() {
const char *text[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM1\\DEM1_008#The Brandzite pod is similar to terran milkweed except that the silk pods are in bright iridecent colors.",
""
};
@@ -442,7 +442,7 @@ void Room::demon1UseSTricorderOnPods() {
void Room::demon1UseSTricorderOnCattails() {
const char *text[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM1\\DEM1_005#Doctis Cattails are similar to their terran name sake except that they are known to cause hives if in contact with flesh for any amount of time.",
""
};
@@ -453,7 +453,7 @@ void Room::demon1UseSTricorderOnCattails() {
void Room::demon1UseSTricorderOnFerns() {
const char *text[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM1\\DEM1_006#Gindorian ferns are regarded as an intergalactic weed, Captain.",
""
};
@@ -464,7 +464,7 @@ void Room::demon1UseSTricorderOnFerns() {
void Room::demon1UseSTricorderOnHand() {
const char *text[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM1\\DEM1_017#This is a detached hand with some kind of circuitry in the palm, Captain.",
""
};
@@ -480,7 +480,7 @@ void Room::demon1UseSTricorderOnKlingon1() {
if (_roomVar.demon1.numKlingonsKilled == 3 && !_vm->_awayMission.demon.tookKlingonHand && _rdfData[0xcf] != 1) {
const char *text[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM1\\DEM1_018#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial. There is something different about this particular construct. Come here, Captain, look at the hand.It seems to have been separated from the body. There is a wiring circuit in the middle of the palm.",
""
};
@@ -489,7 +489,7 @@ void Room::demon1UseSTricorderOnKlingon1() {
}
else {
const char *text[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM1\\DEM1_019#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial.",
""
};
@@ -502,7 +502,7 @@ void Room::demon1UseSTricorderOnKlingon2Or3() {
playSoundEffectIndex(0x04);
const char *text[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM1\\DEM1_019#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial.",
""
};
@@ -526,7 +526,7 @@ void Room::demon1UseMTricorderOnRedshirt() {
void Room::demon1UseMTricorderOnCrewman() {
const char *text[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM1\\DEM1_009#He's only stunned. He'll be back up in a few seconds.",
""
};
@@ -741,7 +741,7 @@ void Room::demon1LookAtRedshirt() {
void Room::demon1TalkToKirk() {
const char *text[] = {
- "Capt. Kirk",
+ SPEAKER_KIRK,
"#DEM1\\DEM1_001#We were caught flat footed there. I don't want any more surprises to catch us off guard.",
""
};
@@ -756,22 +756,22 @@ void Room::demon1TalkToSpock() {
demon1TalkToUnconsciousCrewman();
else {
const char *text1[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM1\\DEM1_022#Captain, I detect a recent avalanche, approximately 6.2 kilometers away, that occurred within the last three days. The mountain may be quite dangerous.",
""
};
const char *text2[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM1\\DEM1_013#Demons, Klingons, avalanches... What's next, the Wicked Witch of the West?",
""
};
const char *text3[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM1\\DEM1_024#That is not logical, doctor.",
""
};
const char *text4[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM1\\DEM1_014#It wasn't supposed to be logical, you green blooded Vulcan! Why does everything have to be so damned logical?",
""
};
@@ -787,12 +787,12 @@ void Room::demon1TalkToMcCoy() {
demon1TalkToUnconsciousCrewman();
else {
const char *text1[] = {
- "Dr. McCoy",
+ SPEAKER_MCCOY,
"#DEM1\\DEM1_015#Well, we've seen Klingons. Now all we need is a few Romulans...",
""
};
const char *text2[] = {
- "Mr. Spock",
+ SPEAKER_SPOCK,
"#DEM1\\DEM1_023#Control your thoughts, Doctor. There is a high probability that something here is using our own memories against us.",
""
};
@@ -806,7 +806,7 @@ void Room::demon1TalkToRedshirt() {
demon1TalkToUnconsciousCrewman();
else {
const char *text[] = {
- "Ensign Everts",
+ SPEAKER_EVERTS,
"#DEM1\\DEM1_026#I guess this isn't such a great planet after all.",
""
};
diff --git a/engines/startrek/rooms/demon2.cpp b/engines/startrek/rooms/demon2.cpp
new file mode 100644
index 0000000..7d2d019
--- /dev/null
+++ b/engines/startrek/rooms/demon2.cpp
@@ -0,0 +1,342 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+void Room::demon2Tick1() {
+ playVoc("DEM2LOOP");
+}
+
+void Room::demon2WalkToCave() {
+ walkCrewman(OBJECT_KIRK, 0x83, 0x5c, 2);
+}
+
+void Room::demon2ReachedCave() {
+ loadRoomIndex(3, 1);
+}
+
+void Room::demon2TouchedWarp1() {
+ _vm->_awayMission.demon.enteredFrom = 2;
+ _vm->_awayMission.rdfStillDoDefaultAction = true;
+}
+
+void Room::demon2LookAtCave() {
+ const char *text[] = {
+ nullptr,
+ "#DEM2\\DEM2N009#Mine entrance.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2LookAtMountain() {
+ const char *text[] = {
+ nullptr,
+ "#DEM2\\DEM2N007#Idyll Mountain.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2LookAtBerries() {
+ const char *text[] = {
+ nullptr,
+ "#DEM2\\DEM2N012#Various types of berries grow amongst the bushes.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2LookAtFern() {
+ const char *text[] = {
+ nullptr,
+ "#DEM2\\DEM2N005#A Gindorian fern.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2LookAtMoss() {
+ const char *text[] = {
+ nullptr,
+ "#DEM2\\DEM2N010#Phequedian moss grows on the cave wall.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2LookAtLights() {
+ const char *text[] = {
+ nullptr,
+ "#DEM2\\DEM2N006#Feeble lights illuminate the mine tunnel.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2LookAtAnything() {
+ const char *text[] = {
+ nullptr,
+ "#DEM2\\DEM2N011#The mine entrance goes deep into Mount Idyll.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2LookAtKirk() {
+ const char *text[] = {
+ nullptr,
+ "#DEM2\\DEM2N002#James T. Kirk. Always wondering what the next surprise will be.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2LookAtSpock() {
+ const char *text[] = {
+ nullptr,
+ "#DEM2\\DEM2N004#Spock. Perhaps the most brilliant mind in Starfleet, pondering a most peculiar mystery.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2LookAtMcCoy() {
+ const char *text[] = {
+ nullptr,
+ "#DEM2\\DEM2N003#Leonard McCoy. Hoping that the cave will be warmer than outside.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2LookAtRedshirt() {
+ const char *text[] = {
+ nullptr,
+ "#DEM2\\DEM2N000#Ensign Everts. Keeping a sharp eye out for anything dangerous.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2TalkToKirk() {
+ const char *text[] = {
+ SPEAKER_KIRK,
+ "#DEM2\\DEM2_001#The answer to this mystery lies ahead of us, gentlemen.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2TalkToSpock() {
+ const char *text1[] = {
+ SPEAKER_SPOCK,
+ "#DEM2\\DEM2_018#Whoever was trying to stop us may not stop with those Klingons, Captain. I recommend extreme caution.",
+ ""
+ };
+ const char *text2[] = {
+ SPEAKER_KIRK,
+ "#DEM2\\DEM2_003#The thought had occurred to me, Mr. Spock, but thank you for mentioning it.",
+ ""
+ };
+ showRoomSpecificText(text1);
+ showRoomSpecificText(text2);
+}
+
+void Room::demon2TalkToMcCoy() {
+ const char *text1[] = {
+ SPEAKER_MCCOY,
+ "#DEM2\\DEM2_015#Does your tricorder say the cave is warmer, Spock...",
+ ""
+ };
+ const char *text2[] = {
+ SPEAKER_SPOCK,
+ "#DEM2\\DEM2_017#It is not logical for me to use my tricorder to determine the cave's temperature, doctor. I do not see what purpose it would serve.",
+ ""
+ };
+ const char *text3[] = {
+ SPEAKER_MCCOY,
+ "#DEM2\\DEM2_016#Spock, everybody talks about the weather!",
+ ""
+ };
+ showRoomSpecificText(text1);
+ showRoomSpecificText(text2);
+ showRoomSpecificText(text3);
+}
+
+void Room::demon2TalkToRedshirt() {
+ const char *text1[] = {
+ SPEAKER_EVERTS,
+ "#DEM2\\DEM2_019#I'm sorry I let you down with those Klingons back there. I should have been paying more attention.",
+ ""
+ };
+ const char *text2[] = {
+ SPEAKER_KIRK,
+ "#DEM2\\DEM2_002#Just don't make that mistake again, Ensign.",
+ ""
+ };
+ const char *text3[] = {
+ SPEAKER_EVERTS,
+ "#DEM2\\DEM2_020#Those Klingons give me the willies. They always have. My sister was wounded by them in the Chozon ambush.",
+ ""
+ };
+ const char *text4[] = {
+ SPEAKER_KIRK,
+ "#DEM2\\DEM2_004#We've all had our share of conflict with Klingons, Ensign. The Organians told me that one day Humans and Klingons will become good friends. I wonder if I'll ever live to see that day.",
+ ""
+ };
+ showRoomSpecificText(text1);
+ showRoomSpecificText(text2);
+ showRoomSpecificText(text3);
+ showRoomSpecificText(text4);
+}
+
+void Room::demon2UsePhaserOnBerries() {
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM2\\DEM2_011#Jim, you usually pick food and then cook it.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2UseSTricorderOnBerries() {
+ loadActorAnim2(OBJECT_SPOCK, "sscane", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+
+ const char *text[] = {
+ SPEAKER_SPOCK,
+ "#DEM2\\DEM2_008#These seem to be Laraxian berries, Captain. They have several medicinal uses, but Dr. McCoy would know more.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2UseSTricorderOnMoss() {
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+
+ const char *text[] = {
+ SPEAKER_SPOCK,
+ "#DEM2\\DEM2_007#The Phequedine moss extracts nourishment from hafnium, Captain.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2UseSTricorderOnFern() {
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+
+ const char *text[] = {
+ SPEAKER_SPOCK,
+ "#DEM2\\DEM2_006#Gindorian ferns are regarded as an intergalactic weed, Captain.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2UseSTricorderOnCave() {
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+
+ // NOTE: audio file for this is empty.
+ const char *text[] = {
+ SPEAKER_SPOCK,
+ "#DEM2\\DEM2_005#Captain, I'm having trouble getting reliable readings from inside the mountain. Unusual crystalline structures within the ore may be at fault, though I cannot say for certain.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon2UseMTricorderOnBerries() {
+ loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+
+ if (_vm->_awayMission.demon.curedBrother) {
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM2\\DEM2_013#These are the Laraxian Berries we used to cure Brother Chub.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+ else if (_vm->_awayMission.demon.madeHypoDytoxin) {
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM2\\DEM2_009#Jim, these are Laraxian Berries that we used to make the Hypo-Dytoxin.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+ else if (_vm->_awayMission.demon.knowAboutHypoDytoxin) {
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM2\\DEM2_010#Jim, these are the berries we need to synthesize the Hypo-Dytoxin. We must get these to Brother Stephen quickly.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+ else {
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM2\\DEM2_012#These are Laraxian Berries. From what I remember, certain chemical compounds in the berry can be used to treat Nugaireyn infections.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+}
+
+void Room::demon2GetBerries() {
+ if (_vm->_awayMission.demon.gotBerries) {
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM2\\DEM2_014#We don't need any more berries, Jim.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+ else {
+ walkCrewman(OBJECT_KIRK, 0xe8, 0x97, 1);
+ }
+}
+
+void Room::demon2ReachedBerries() {
+ loadActorAnim2(OBJECT_KIRK, "kusehe", -1, -1, 1);
+ playVoc("PIKBERRY");
+}
+
+void Room::demon2PickedUpBerries() {
+ const char *text[] = {
+ nullptr,
+ "#DEM2\\DEM2N013#You have retrieved a sample of berries.",
+ ""
+ };
+ showRoomSpecificText(text);
+ giveItem(OBJECT_IBERRY);
+ _vm->_awayMission.demon.gotBerries = true;
+ _vm->_awayMission.missionScore += 1;
+}
+
+}
diff --git a/engines/startrek/rooms/demon3.cpp b/engines/startrek/rooms/demon3.cpp
new file mode 100644
index 0000000..c7ad9ce
--- /dev/null
+++ b/engines/startrek/rooms/demon3.cpp
@@ -0,0 +1,437 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+void Room::demon3Tick1() {
+ playVoc("DEM3LOOP");
+ loadActorAnim(8, "light", 0xab, 0x03, 0);
+
+ _roomVar.demon3.boulder1Shot = true;
+ if (!_vm->_awayMission.demon.boulder1Gone) {
+ loadActorAnim(9, "bldr1", 0x26, 0, 0);
+ _roomVar.demon3.boulder1Shot = false;
+ }
+ if (!_vm->_awayMission.demon.boulder2Gone) {
+ loadActorAnim(10, "bldr2", 0x22, 0, 0);
+ }
+ if (!_vm->_awayMission.demon.boulder3Gone) {
+ loadActorAnim(11, "bldr3", 0x22, 0, 0);
+ }
+ if (!_vm->_awayMission.demon.boulder4Gone) {
+ loadActorAnim(12, "bldr4", 0x22, 0, 0);
+ }
+
+ if (_vm->_awayMission.demon.doorRevealed) {
+ loadActorAnim(14, "door2", 0x82, 0x0c, 0);
+ }
+ else {
+ loadMapFile("demon3a");
+ }
+
+ if (!_vm->_awayMission.demon.field3c && _vm->_awayMission.demon.boulder4Gone)
+ loadActorAnim(13, "miner", 0xda, 0x6c, 0);
+ if (_vm->_awayMission.redshirtDead && !_vm->_awayMission.demon.field45)
+ loadActorAnim(OBJECT_REDSHIRT, "deadre", 0x46, 0xa0, 0);
+
+ if (_vm->_awayMission.demon.field41 == 0)
+ _vm->_awayMission.demon.field41++;
+
+ if (!_vm->_awayMission.demon.field56) {
+ _vm->_awayMission.demon.field56 = true;
+ playMidiMusicTracks(0, -1);
+ }
+}
+
+// Boulder falling over
+void Room::demon3Timer0Expired() {
+ _roomVar.demon3.boulder1Shot = true;
+ loadActorAnim2(9, "drbldr", 0x26, 0, 0);
+ _vm->_awayMission.timers[1] = 13;
+ _vm->_awayMission.demon.boulder1Gone = true;
+ _vm->_awayMission.demon.numBouldersGone++;
+ _vm->_awayMission.transitioningIntoRoom = true;
+ playMidiMusicTracks(2, -1);
+ playVoc("BOULDERK");
+}
+
+// Redshirt pushing Kirk away
+void Room::demon3Timer1Expired() {
+ _roomVar.demon3.kirkPhaserOut = false;
+ loadActorAnim2(OBJECT_REDSHIRT, "redkil", 0x46, 0xa0, 0);
+ loadActorAnim2(OBJECT_KIRK, "redkil", 0x46, 0xa0, 1);
+}
+
+void Room::demon3Timer3Expired() {
+ // TODO
+}
+
+void Room::demon3FinishedAnimation1() {
+ loadActorAnim2(OBJECT_KIRK, "kstnds", 0xee, 0xa6, 0);
+ loadActorAnim2(OBJECT_REDSHIRT, "deadre", 0x46, 0xa0, 0);
+ loadActorStandAnim(OBJECT_SPOCK);
+ walkCrewman(OBJECT_MCCOY, 0x9c, 0xb2, 5);
+ _roomVar.demon3.inFiringPosition = false;
+ _vm->_awayMission.redshirtDead = true;
+}
+
+void Room::demon3FinishedAnimation2() {
+ // TODO
+}
+
+void Room::demon3FinishedWalking5() {
+ loadActorAnim2(OBJECT_MCCOY, "mscanw", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM3\\DEM3_019#He's dead, Jim...",
+ ""
+ };
+ showRoomSpecificText(text);
+
+ _vm->_awayMission.transitioningIntoRoom = false;
+}
+
+void Room::demon3McCoyInFiringPosition() {
+ loadActorAnim2(OBJECT_MCCOY, "mwaitn", 0xd6, 0xb8, 0);
+ _roomVar.demon3.mccoyInPosition = true;
+ demon3CrewmanInFiringPosition();
+}
+
+void Room::demon3SpockInFiringPosition() {
+ loadActorAnim2(OBJECT_SPOCK, "swaitn", 0xae, 0xb4, 0);
+ _roomVar.demon3.spockInPosition = true;
+ demon3CrewmanInFiringPosition();
+}
+
+void Room::demon3RedShirtInFiringPosition() {
+ loadActorAnim2(OBJECT_REDSHIRT, "rwaitn", 0x46, 0xa0, 0);
+ _roomVar.demon3.redshirtInPosition = true;
+ demon3CrewmanInFiringPosition();
+}
+
+void Room::demon3KirkInFiringPosition() {
+ loadActorAnim2(OBJECT_KIRK, "kwaitn", 0x79, 0xa0, 0);
+ _roomVar.demon3.kirkInPosition = true;
+ demon3CrewmanInFiringPosition();
+}
+
+void Room::demon3CrewmanInFiringPosition() {
+ if (_roomVar.demon3.kirkInPosition && _roomVar.demon3.spockInPosition && _roomVar.demon3.mccoyInPosition && (_vm->_awayMission.redshirtDead || _roomVar.demon3.redshirtInPosition))
+ demon3PullOutPhaserAndFireAtBoulder();
+}
+
+void Room::demon3PullOutPhaserAndFireAtBoulder() {
+ if (_roomVar.demon3.kirkPhaserOut)
+ demon3FireAtBoulder();
+ else {
+ loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 4);
+ _roomVar.demon3.kirkPhaserOut = true;
+ }
+}
+
+void Room::demon3FireAtBoulder() {
+ _roomVar.demon3.kirkInPosition = false;
+ _roomVar.demon3.spockInPosition = false;
+ _roomVar.demon3.mccoyInPosition = false;
+ _roomVar.demon3.redshirtInPosition = false;
+ _roomVar.demon3.shootingBoulder = false;
+
+ switch (_roomVar.demon3.boulderBeingShot) {
+ case 1:
+ loadActorAnim2(9, "sbldr1", 0x22, 0, 0);
+ break;
+ case 2:
+ loadActorAnim2(10, "sbldr2", 0x22, 0, 0);
+ break;
+ case 3:
+ loadActorAnim2(11, "sbldr3", 0x22, 0, 0);
+ break;
+ case 4:
+ loadActorAnim2(12, "sbldr4", 0x22, 0, 0);
+ break;
+ default: {
+ // This should never happen (in the original game, this would cause a stack
+ // misalignment?
+ const char *text[] = {
+ "wes",
+ "There is a boulder check error.",
+ ""
+ };
+ showRoomSpecificText(text);
+ break;
+ }
+ }
+
+ loadActorAnim(17, _roomVar.demon3.boulderAnim, 0, 0, 0);
+ playSoundEffectIndex(0x06);
+ if (!_roomVar.demon3.boulder1Shot)
+ _vm->_awayMission.timers[0] = 1;
+ _vm->_awayMission.transitioningIntoRoom = false;
+}
+
+void Room::demon3UsePhaserOnRedshirt() {
+ if (!_vm->_awayMission.redshirtDead)
+ return;
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM3\\DEM3_013#He's already dead, Jim. Isn't that good enough for you?",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3UseStunPhaserOnBoulder() {
+ const char *text[] = {
+ SPEAKER_SPOCK,
+ "#DEM3\\DEM3_007#Captain, the stun setting would be very ineffective on these boulders.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3UsePhaserOnBoulder1() {
+ if (_roomVar.demon3.shootingBoulder || _vm->_awayMission.demon.boulder1Gone)
+ return;
+ _vm->_awayMission.demon.boulder1Gone = true;
+ _vm->_awayMission.demon.numBouldersGone++;
+ _roomVar.demon3.boulderBeingShot = 1;
+ _roomVar.demon3.boulder1Shot = true;
+ strcpy(_roomVar.demon3.boulderAnim, "s0r3s2");
+ demon3BoulderCommon();
+}
+
+void Room::demon3UsePhaserOnBoulder2() {
+ if (_roomVar.demon3.shootingBoulder || _vm->_awayMission.demon.boulder2Gone)
+ return;
+ _vm->_awayMission.demon.boulder2Gone = true;
+ _vm->_awayMission.demon.numBouldersGone++;
+ _roomVar.demon3.boulderBeingShot = 2;
+ strcpy(_roomVar.demon3.boulderAnim, "s0r3s3");
+ demon3BoulderCommon();
+}
+
+void Room::demon3UsePhaserOnBoulder3() {
+ if (_vm->_awayMission.demon.boulder1Gone) {
+ if (_roomVar.demon3.shootingBoulder || _vm->_awayMission.demon.boulder3Gone)
+ return;
+ _vm->_awayMission.demon.boulder3Gone = true;
+ _vm->_awayMission.demon.numBouldersGone++;
+ _roomVar.demon3.boulderBeingShot = 3;
+ strcpy(_roomVar.demon3.boulderAnim, "s0r3s1");
+ demon3BoulderCommon();
+ }
+ else {
+ const char *text[] = {
+ SPEAKER_SPOCK,
+ "#DEM3\\DEM3_006#Captain, the structure is extremely unstable. I would not recommend disturbing the lower section before the upper sections have been cleared.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+}
+
+void Room::demon3UsePhaserOnBoulder4() {
+ if (_vm->_awayMission.demon.boulder2Gone) {
+ if (_roomVar.demon3.shootingBoulder || _vm->_awayMission.demon.boulder4Gone)
+ return;
+ _vm->_awayMission.demon.boulder4Gone = true;
+ _vm->_awayMission.demon.numBouldersGone++;
+ _roomVar.demon3.boulderBeingShot = 4;
+ strcpy(_roomVar.demon3.boulderAnim, "s0r3s4");
+ _vm->_awayMission.demon.foundMiner = true;
+ demon3BoulderCommon();
+ }
+ else {
+ // BUG: Spock doesn't speak, even though an audio file exists
+ const char *text[] = {
+ SPEAKER_SPOCK,
+ "Captain, the structure is extremely unstable. I would not recommend disturbing the lower section before the upper sections have been cleared.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+}
+
+void Room::demon3BoulderCommon() {
+ _vm->_awayMission.transitioningIntoRoom = true;
+ Common::Point pos = getActorPos(13);
+ /* FIXME
+ if (!(pos.x == 0x79 && pos.y == 0xa0)) {
+ _roomVar.demon3.inFiringPosition = false;
+ _roomVar.demon3.kirkPhaserOut = false;
+ }
+ */
+
+ if (_roomVar.demon3.inFiringPosition) {
+ demon3PullOutPhaserAndFireAtBoulder();
+ }
+ else {
+ const char *text[] = {
+ SPEAKER_KIRK,
+ "#DEM3\\DEM3_001#Assume firing positions.",
+ ""
+ };
+ showRoomSpecificText(text);
+
+ walkCrewman(OBJECT_KIRK, 0x79, 0xa0, 1);
+ walkCrewman(OBJECT_SPOCK, 0xae, 0xb4, 2);
+ walkCrewman(OBJECT_MCCOY, 0xd6, 0xb8, 3);
+ if (!_vm->_awayMission.redshirtDead)
+ walkCrewman(OBJECT_REDSHIRT, 0x46, 0xa0, 4);
+
+ _roomVar.demon3.shootingBoulder = true;
+ _roomVar.demon3.inFiringPosition = true;
+ }
+}
+
+void Room::demon3UseSTricorderOnMiner() {
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ const char *text[] = {
+ SPEAKER_SPOCK,
+ "#DEM3\\DEM3_008#I think Doctor McCoy would be better suited to deal with this.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3UseSTricorderOnPanel() {
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ const char *text[] = {
+ SPEAKER_SPOCK,
+ "#DEM3\\DEM3_009#It appears to be a security lock designed to open the door when the correct hand print is registered.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3UseSTricorderOnBoulder() {
+ if (_vm->_awayMission.demon.foundMiner)
+ return;
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ const char *text[] = {
+ SPEAKER_SPOCK,
+ "#DEM3\\DEM3_010#Captain, there are several weak points in the cave-in's structure. Careful use of our phasers, from the top down, should be able to clear it.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3UseMTricorderOnBoulder() {
+ if (_vm->_awayMission.demon.foundMiner)
+ return;
+ loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM3\\DEM3_020#I'm picking up weak vital signs. If we don't dig him out soon, we're going to lose him!",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3UseCrewmanOnPanel() {
+ if (_vm->_awayMission.demon.numBouldersGone != 4 || _vm->_awayMission.redshirtDead)
+ return;
+ const char *text[] = {
+ SPEAKER_EVERTS,
+ "#DEM3\\DEM3_031#Sir, it may be dangerous. Let me try it.",
+ ""
+ };
+ showRoomSpecificText(text);
+ demon3UseRedshirtOnPanel();
+}
+
+void Room::demon3UseRedshirtOnPanel() {
+ if (_vm->_awayMission.redshirtDead)
+ return;
+ if (_vm->_awayMission.demon.numBouldersGone != 4) {
+ const char *text[] = {
+ SPEAKER_EVERTS,
+ "#DEM3\\DEM3_030#Sir, I think we should clear the rest of the rocks before we check out the device.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+ else {
+ walkCrewman(OBJECT_REDSHIRT, 0xd8, 0x70, 8);
+ }
+}
+
+void Room::demon3RedshirtReachedPanel() {
+ loadActorAnim2(OBJECT_REDSHIRT, "rusehn", -1, -1, 5);
+}
+
+void Room::demon3RedshirtUsedPanel() {
+ if (!_vm->_awayMission.demon.foundMiner)
+ return;
+
+ _vm->_awayMission.demon.field41++;
+ if (_vm->_awayMission.demon.field41 == 5) {
+ playVoc("EFX3");
+ const char *text[] = {
+ SPEAKER_EVERTS,
+ "#DEM3\\DEM3_A32#Aieeee!",
+ ""
+ };
+ showRoomSpecificText(text);
+
+ loadActorAnim2(OBJECT_REDSHIRT, "rkille", -1, -1, 3);
+ playSoundEffectIndex(0x06);
+ _vm->_awayMission.redshirtDead = true;
+ _vm->_awayMission.demon.field45 = true;
+ }
+ else {
+ const char *textTable[] = {
+ "#DEM3\\DEM3N005#Nothing happens.",
+ "#DEM3\\DEM3_033#I think I was shocked, sir.",
+ "#DEM3\\DEM3_035#That was definitely a mild shock.",
+ "#DEM3\\DEM3_034#Ouch, that hurt.",
+ };
+
+ const char *text[] = {
+ "SPEAKER_EVERTS",
+ nullptr,
+ ""
+ };
+ text[1] = textTable[_vm->_awayMission.demon.field41 - 1];
+ showRoomSpecificText(text);
+ walkCrewman(OBJECT_REDSHIRT, 0xbe, 0x9b, 0);
+ }
+}
+
+void Room::demon3RedshirtElectrocuted() {
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM3\\DEM3_018#He's dead Jim.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+}
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 0743b79..274dea7 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -170,6 +170,98 @@ RoomAction demon1ActionList[] = {
{ Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::demon1TalkToRedshirt },
};
+RoomAction demon2ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::demon2Tick1 },
+ { Action(ACTION_WALK, 0x27, 0, 0), &Room::demon2WalkToCave },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::demon2ReachedCave },
+ { Action(ACTION_TOUCHED_WARP, 1, 0, 0), &Room::demon2TouchedWarp1 },
+
+ { Action(ACTION_LOOK, 0x27, 0, 0), &Room::demon2LookAtCave },
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon2LookAtCave },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::demon2LookAtMountain },
+ { Action(ACTION_LOOK, 0x22, 0, 0), &Room::demon2LookAtMountain },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::demon2LookAtBerries },
+ { Action(ACTION_LOOK, 0x24, 0, 0), &Room::demon2LookAtFern },
+ { Action(ACTION_LOOK, 0x25, 0, 0), &Room::demon2LookAtMoss },
+ { Action(ACTION_LOOK, 0x26, 0, 0), &Room::demon2LookAtLights },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::demon2LookAtAnything },
+
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::demon2LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::demon2LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::demon2LookAtMcCoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::demon2LookAtRedshirt },
+
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::demon2TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::demon2TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::demon2TalkToMcCoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::demon2TalkToRedshirt },
+
+ { Action(ACTION_USE, OBJECT_IPHASERK, 0x23, 0), &Room::demon2UsePhaserOnBerries },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 0x23, 0), &Room::demon2UsePhaserOnBerries },
+
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::demon2UseSTricorderOnBerries },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x25, 0), &Room::demon2UseSTricorderOnMoss },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x24, 0), &Room::demon2UseSTricorderOnFern },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::demon2UseSTricorderOnCave },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::demon2UseSTricorderOnCave },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::demon2UseSTricorderOnCave },
+
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0x23, 0), &Room::demon2UseMTricorderOnBerries },
+ { Action(ACTION_GET, 0x23, 0, 0), &Room::demon2GetBerries },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::demon2ReachedBerries },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::demon2PickedUpBerries },
+};
+
+RoomAction demon3ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::demon3Tick1 },
+ { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::demon3Timer0Expired },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::demon3Timer1Expired },
+ { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::demon3Timer3Expired },
+
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::demon3FinishedAnimation1 },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::demon3FinishedAnimation2 },
+ { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::demon3FinishedWalking5 },
+
+ { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::demon3McCoyInFiringPosition },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::demon3SpockInFiringPosition },
+ { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::demon3RedShirtInFiringPosition },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::demon3KirkInFiringPosition },
+
+ { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::demon3FireAtBoulder },
+
+ { Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_REDSHIRT, 0), &Room::demon3UsePhaserOnRedshirt },
+ { Action(ACTION_USE, OBJECT_IPHASERK, OBJECT_REDSHIRT, 0), &Room::demon3UsePhaserOnRedshirt },
+
+ { Action(ACTION_USE, OBJECT_IPHASERS, 9, 0), &Room::demon3UseStunPhaserOnBoulder },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 10, 0), &Room::demon3UseStunPhaserOnBoulder },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 11, 0), &Room::demon3UseStunPhaserOnBoulder },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 12, 0), &Room::demon3UseStunPhaserOnBoulder },
+
+ { Action(ACTION_USE, OBJECT_IPHASERK, 9, 0), &Room::demon3UsePhaserOnBoulder1 },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 10, 0), &Room::demon3UsePhaserOnBoulder2 },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 11, 0), &Room::demon3UsePhaserOnBoulder3 },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 12, 0), &Room::demon3UsePhaserOnBoulder4 },
+
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 13, 0), &Room::demon3UseSTricorderOnMiner },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::demon3UseSTricorderOnPanel },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 9, 0), &Room::demon3UseSTricorderOnBoulder },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 10, 0), &Room::demon3UseSTricorderOnBoulder },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 11, 0), &Room::demon3UseSTricorderOnBoulder },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 12, 0), &Room::demon3UseSTricorderOnBoulder },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 9, 0), &Room::demon3UseMTricorderOnBoulder },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 10, 0), &Room::demon3UseMTricorderOnBoulder },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 11, 0), &Room::demon3UseMTricorderOnBoulder },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 12, 0), &Room::demon3UseMTricorderOnBoulder },
+
+ { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::demon3UseCrewmanOnPanel },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::demon3UseCrewmanOnPanel },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::demon3UseCrewmanOnPanel },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::demon3UseRedshirtOnPanel },
+ { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::demon3RedshirtReachedPanel },
+ { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::demon3RedshirtUsedPanel },
+ { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::demon3RedshirtElectrocuted },
+};
+
}
#endif
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 553d011..128c968 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -212,9 +212,11 @@ void Sound::playSpeech(const Common::String &basename) {
error("Couldn't open '%s'", filename.c_str());
Audio::AudioStream *audioStream = Audio::makeVOCStream(readStream, Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);
- if (audioQueue == nullptr)
- audioQueue = Audio::makeQueuingAudioStream(audioStream->getRate(), audioStream->isStereo());
- audioQueue->queueAudioStream(audioStream, DisposeAfterUse::YES);
+ if (audioStream != nullptr) {
+ if (audioQueue == nullptr)
+ audioQueue = Audio::makeQueuingAudioStream(audioStream->getRate(), audioStream->isStereo());
+ audioQueue->queueAudioStream(audioStream, DisposeAfterUse::YES);
+ }
name.erase(0,i+1);
}
@@ -222,9 +224,8 @@ void Sound::playSpeech(const Common::String &basename) {
if (audioQueue != nullptr) {
audioQueue->finish();
_vm->_system->getMixer()->playStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, audioQueue);
+ _playingSpeech = true;
}
-
- _playingSpeech = true;
}
/**
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 35a6c9f..96e74bf 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -358,6 +358,7 @@ int StarTrekEngine::loadActorAnim(int actorIndex, const Common::String &animName
if (actorIndex == -1) {
// TODO
+ warning("loadActorAnim: actor == -1");
}
else
actor = &_actorList[actorIndex];
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index f5715d5..e37f442 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -428,13 +428,13 @@ public:
Graphics *_gfx;
Sound *_sound;
+ SharedPtr<IWFile> _iwFile;
private:
Common::RandomSource _randomSource;
Common::MacResManager *_macResFork;
SharedPtr<Room> _room;
- SharedPtr<IWFile> _iwFile;
};
} // End of namespace StarTrek
Commit: 29e62d1a187e0df65411b8c5e3f7ed663dc421d5
https://github.com/scummvm/scummvm/commit/29e62d1a187e0df65411b8c5e3f7ed663dc421d5
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Finish demon3
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/demon3.cpp
engines/startrek/rooms/function_map.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 9087589..178b788 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -63,9 +63,11 @@ struct AwayMission {
bool mccoyMentionedFlora; // 0x38
byte numBouldersGone; // 0x39
byte enteredFrom; // 0x3a
- bool field3c; // 0x3c
+ bool field3b; // 0x3b
+ bool healedMiner; // 0x3c
bool curedBrother; // 0x3d
bool knowAboutHypoDytoxin; // 0x3f
+ bool minerDead; // 0x40
byte field41; // 0x41
bool foundMiner; // 0x43
bool field45; // 0x45
@@ -74,7 +76,7 @@ struct AwayMission {
bool boulder2Gone; // 0x4a
bool boulder3Gone; // 0x4b
bool boulder4Gone; // 0x4c
- bool doorRevealed; // 0x4d
+ bool doorOpened; // 0x4d
bool gotBerries; // 0x50
bool madeHypoDytoxin; // 0x51
byte field56; // 0x56
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 785be27..4f0e49b 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -272,6 +272,36 @@ public:
void demon3RedshirtReachedPanel();
void demon3RedshirtUsedPanel();
void demon3RedshirtElectrocuted();
+ void demon3UseSTricorderOnDoor();
+ void demon3UseSTricorderOnAnything();
+ void demon3UseMTricorderOnDoor();
+ void demon3UsePhaserOnDoor();
+ void demon3UseHandOnPanel();
+ void demon3KirkReachedHandPanel();
+ void demon3KirkUsedHandPanel();
+ void demon3UseMTricorderOnMiner();
+ void demon3UseMedkitOnMiner();
+ void demon3McCoyReachedMiner();
+ void demon3McCoyFinishedHealingMiner();
+ void demon3GetMiner();
+ void demon3TalkToKirk();
+ void demon3TalkToSpock();
+ void demon3TalkToMccoy();
+ void demon3TalkToRedshirt();
+ void demon3LookAtKirk();
+ void demon3LookAtSpock();
+ void demon3LookAtMccoy();
+ void demon3LookAtRedshirt();
+ void demon3LookAnywhere();
+ void demon3LookAtMiner();
+ void demon3LookAtBoulder1();
+ void demon3LookAtBoulder2();
+ void demon3LookAtBoulder3();
+ void demon3LookAtBoulder4();
+ void demon3LookAtStructure();
+ void demon3LookAtDoor();
+ void demon3LookAtPanel();
+ void demon3LookAtLight();
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
@@ -294,6 +324,7 @@ private:
bool inFiringPosition; // 0xd1
bool kirkPhaserOut; // 0xd3
char boulderAnim[10]; // 0xd4
+ int16 usedPhaserOnDoor; // 0xd6
} demon3;
} _roomVar;
};
diff --git a/engines/startrek/rooms/demon3.cpp b/engines/startrek/rooms/demon3.cpp
index c7ad9ce..3af6da9 100644
--- a/engines/startrek/rooms/demon3.cpp
+++ b/engines/startrek/rooms/demon3.cpp
@@ -43,14 +43,14 @@ void Room::demon3Tick1() {
loadActorAnim(12, "bldr4", 0x22, 0, 0);
}
- if (_vm->_awayMission.demon.doorRevealed) {
+ if (_vm->_awayMission.demon.doorOpened) {
loadActorAnim(14, "door2", 0x82, 0x0c, 0);
}
else {
loadMapFile("demon3a");
}
- if (!_vm->_awayMission.demon.field3c && _vm->_awayMission.demon.boulder4Gone)
+ if (!_vm->_awayMission.demon.healedMiner && _vm->_awayMission.demon.boulder4Gone)
loadActorAnim(13, "miner", 0xda, 0x6c, 0);
if (_vm->_awayMission.redshirtDead && !_vm->_awayMission.demon.field45)
loadActorAnim(OBJECT_REDSHIRT, "deadre", 0x46, 0xa0, 0);
@@ -83,8 +83,28 @@ void Room::demon3Timer1Expired() {
loadActorAnim2(OBJECT_KIRK, "redkil", 0x46, 0xa0, 1);
}
+// Door just opened
void Room::demon3Timer3Expired() {
- // TODO
+ if (_vm->_awayMission.demon.field3b) {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N008#The hand's circuitry triggers a connection, and the door opens.",
+ ""
+ };
+ showRoomSpecificText(text);
+ loadActorAnim(14, "door", 0x82, 0xc, 0);
+ loadMapFile("demon3");
+ _vm->_awayMission.demon.doorOpened = true;
+ _vm->_awayMission.missionScore += 2;
+ }
+ else {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N007#The fit is perfect, but something seems to be shorting out.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
}
void Room::demon3FinishedAnimation1() {
@@ -96,8 +116,9 @@ void Room::demon3FinishedAnimation1() {
_vm->_awayMission.redshirtDead = true;
}
+// Just destroyed boulder 4 (revealing the miner)
void Room::demon3FinishedAnimation2() {
- // TODO
+ loadActorAnim(13, "miner", 0xda, 0x6c, 0);
}
void Room::demon3FinishedWalking5() {
@@ -160,7 +181,7 @@ void Room::demon3FireAtBoulder() {
_roomVar.demon3.shootingBoulder = false;
switch (_roomVar.demon3.boulderBeingShot) {
- case 1:
+ case 1: // FIXME: animation overlaps on Kirk, probably due to sprite sorting inaccuracy
loadActorAnim2(9, "sbldr1", 0x22, 0, 0);
break;
case 2:
@@ -170,7 +191,7 @@ void Room::demon3FireAtBoulder() {
loadActorAnim2(11, "sbldr3", 0x22, 0, 0);
break;
case 4:
- loadActorAnim2(12, "sbldr4", 0x22, 0, 0);
+ loadActorAnim2(12, "sbldr4", 0x22, 0, 2);
break;
default: {
// This should never happen (in the original game, this would cause a stack
@@ -265,10 +286,11 @@ void Room::demon3UsePhaserOnBoulder4() {
demon3BoulderCommon();
}
else {
- // BUG: Spock doesn't speak, even though an audio file exists
+ // BUGFIX: In the original, the audio didn't play, despite the file existing (and
+ // despite it being used for the boulder on the left).
const char *text[] = {
SPEAKER_SPOCK,
- "Captain, the structure is extremely unstable. I would not recommend disturbing the lower section before the upper sections have been cleared.",
+ "#DEM3\\DEM3_006#Captain, the structure is extremely unstable. I would not recommend disturbing the lower section before the upper sections have been cleared.",
""
};
showRoomSpecificText(text);
@@ -277,13 +299,11 @@ void Room::demon3UsePhaserOnBoulder4() {
void Room::demon3BoulderCommon() {
_vm->_awayMission.transitioningIntoRoom = true;
- Common::Point pos = getActorPos(13);
- /* FIXME
+ Common::Point pos = getActorPos(OBJECT_KIRK);
if (!(pos.x == 0x79 && pos.y == 0xa0)) {
_roomVar.demon3.inFiringPosition = false;
_roomVar.demon3.kirkPhaserOut = false;
}
- */
if (_roomVar.demon3.inFiringPosition) {
demon3PullOutPhaserAndFireAtBoulder();
@@ -434,4 +454,395 @@ void Room::demon3RedshirtElectrocuted() {
showRoomSpecificText(text);
}
+void Room::demon3UseSTricorderOnDoor() {
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ const char *text[] = {
+ SPEAKER_SPOCK,
+ "#DEM3\\DEM3_012#Fascinating, Captain. This door is made of an unknown material. It is clearly built by an alien race we have no knowledge of.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3UseSTricorderOnAnything() {
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ const char *text[] = {
+ SPEAKER_SPOCK,
+ "#DEM3\\DEM3_027#Fascinating... I'm registering low-intensity shielding unlike anything we've encountered before. That kept this door -- and whatever is behind it -- hidden from the ship's sensors and earlier tricorder readings.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3UseMTricorderOnDoor() {
+ loadActorAnim2(OBJECT_SPOCK, "mscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM3\\DEM3_016#This is incredible, Jim. I'm picking up faint lifesign readings behind this door!",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3UsePhaserOnDoor() {
+ _roomVar.demon3.usedPhaserOnDoor++;
+ if (_roomVar.demon3.usedPhaserOnDoor == 1) {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N009#There is no apparent effect.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+ else if (_roomVar.demon3.usedPhaserOnDoor == 2) {
+ const char *text[] = {
+ SPEAKER_SPOCK,
+ "#DEM3\\DEM3_011#Captain, this course of action is ineffectual.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+}
+
+void Room::demon3UseHandOnPanel() {
+ if (_vm->_awayMission.demon.numBouldersGone == 4) {
+ if (_vm->_awayMission.demon.doorOpened)
+ return;
+ walkCrewman(OBJECT_KIRK, 0xd8, 0x70, 7);
+ }
+ else {
+ const char *text[] = {
+ SPEAKER_SPOCK,
+ "#DEM3\\DEM3_005#Captain, I would strongly recommend clearing all the debris first.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+}
+
+void Room::demon3KirkReachedHandPanel() {
+ loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 6);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ playVoc("MUR4E1");
+}
+
+void Room::demon3KirkUsedHandPanel() {
+ loadActorAnim(15, "panel", 0xd6, 0x3d, 0);
+ _vm->_awayMission.timers[3] = 10;
+ playVoc("SE0FORCE");
+}
+
+void Room::demon3UseMTricorderOnMiner() {
+ loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+
+ if (_vm->_awayMission.demon.minerDead) {
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM3\\DEM3_022#The miner is dead.",
+ };
+ showRoomSpecificText(text);
+ }
+ else {
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM3\\DEM3_023#This man is badly hurt, and suffering from shock and exposure as well.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+}
+
+void Room::demon3UseMedkitOnMiner() {
+ if (_vm->_awayMission.demon.healedMiner) {
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM3\\DEM3_015#I've done all I can. He just needs rest now.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+ else {
+ walkCrewman(OBJECT_MCCOY, 0xe6, 0x7b, 6);
+ _roomVar.demon3.inFiringPosition = false;
+ _roomVar.demon3.kirkPhaserOut = false;
+ }
+}
+
+void Room::demon3McCoyReachedMiner() {
+ loadActorAnim2(OBJECT_MCCOY, "museln", -1, -1, 7);
+}
+
+void Room::demon3McCoyFinishedHealingMiner() {
+ if (_vm->_awayMission.demon.minerDead) {
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM3\\DEM3_022#The miner is dead.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+ else {
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM3\\DEM3_021#It was a near thing, but he'll live.",
+ ""
+ };
+ showRoomSpecificText(text);
+ _vm->_awayMission.demon.healedMiner = true;
+ loadActorAnim2(13, "drmine", 0xda, 0x6c, 0);
+ _vm->_awayMission.missionScore += 2;
+ walkCrewman(OBJECT_MCCOY, 0x104, 0x96, 0);
+ }
+}
+
+void Room::demon3GetMiner() {
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM3\\DEM3_017#Dammit, Jim, I'm a doctor, not a bellhop. This man's too hurt to be moved.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3TalkToKirk() {
+ const char *text1[] = {
+ SPEAKER_KIRK,
+ "#DEM3\\DEM3_002#A gateway to an alien race. The wonders of the galaxy are endless, aren't they, Mr. Spock?",
+ ""
+ };
+ const char *text2[] = {
+ SPEAKER_SPOCK,
+ "#DEM3\\DEM3_029#Indeed, Captain.",
+ ""
+ };
+ const char *text3[] = {
+ SPEAKER_MCCOY,
+ "#DEM3\\DEM3_026#They can also be damned cold.",
+ ""
+ };
+ showRoomSpecificText(text1);
+ showRoomSpecificText(text2);
+ showRoomSpecificText(text3);
+}
+
+void Room::demon3TalkToSpock() {
+ const char *text[] = {
+ SPEAKER_SPOCK,
+ "#DEM3\\DEM3_028#I recommend as thorough an analysis of this area as possible.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3TalkToMccoy() {
+ if (_vm->_awayMission.redshirtDead) {
+ const char *text[] = {
+ SPEAKER_MCCOY,
+ "#DEM3\\DEM3_014#I'm sorry, Jim. Ensign Everts is beyond my help.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+ else {
+ const char *text1[] = {
+ SPEAKER_MCCOY,
+ "#DEM3\\DEM3_025#Jim, the next time you need medical help on a snowball...",
+ ""
+ };
+ const char *text2[] = {
+ SPEAKER_KIRK,
+ "#DEM3\\DEM3_003#Bones..",
+ ""
+ };
+ const char *text3[] = {
+ SPEAKER_MCCOY,
+ "#DEM3\\DEM3_024#I'll probably end up coming along.",
+ ""
+ };
+ showRoomSpecificText(text1);
+ showRoomSpecificText(text2);
+ showRoomSpecificText(text3);
+
+ }
+}
+
+void Room::demon3TalkToRedshirt() {
+ // FIXME: this shouldn't work if he's dead. Should it check higher up whether that's
+ // the case?
+ const char *text1[] = {
+ SPEAKER_EVERTS,
+ "#DEM3\\DEM3_036#No sign of demons, Klingons, or other hostiles, Captain. I promise I'll let you know the instant something appears.",
+ ""
+ };
+ const char *text2[] = {
+ SPEAKER_KIRK,
+ "#DEM3\\DEM3_004#Don't be too anxious, Ensign. We may want to talk with them.",
+ ""
+ };
+ showRoomSpecificText(text1);
+ showRoomSpecificText(text2);
+}
+
+void Room::demon3LookAtKirk() {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N004#James T. Kirk. Captain of the Enterprise.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3LookAtSpock() {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N001#Commander Spock; curious about what lies ahead.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3LookAtMccoy() {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N002#Doctor Leonard McCoy, glad that the cave provides some shelter from the breeze.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3LookAtRedshirt() {
+ if (_vm->_awayMission.redshirtDead) {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N017#Ensign Everts lies dead, crushed by the boulder.",
+ ""
+ };
+ showRoomSpecificText(text);
+ // NOTE: there's an alternate string that isn't used?
+ // "#DEM3\\DEM3N018#The crushed body of Ensign Everts reminds you of your poor command judgement.",
+ }
+ else {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N003#Ensign Everts, wary of more ambushes.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+}
+
+void Room::demon3LookAnywhere() {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N010#A cavern, deep in Mount Idyll.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3LookAtMiner() {
+ if (_vm->_awayMission.demon.healedMiner) {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N000#Brother Kandrey is barely conscious, and is lying still, trying to regain his strength.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+ else {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N006#One of the Acolytes, who was trapped by the the rockfall.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+}
+
+void Room::demon3LookAtBoulder1() {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N011#A huge boulder sits upon a large pile of rubble.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3LookAtBoulder2() {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N013#A large pile of rubble blocks what appears to be a large metallic structure.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3LookAtBoulder3() {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N013#A large pile of rubble blocks what appears to be a large metallic structure.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3LookAtBoulder4() {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N020#You notice what appears to be a man's arm sticking out from beneath the rubble.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3LookAtStructure() {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N016#A structure built into the surrounding rock. It must have been buried here for millennia.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3LookAtDoor() {
+ if (_vm->_awayMission.demon.doorOpened) {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N014#A long tunnel descends into the mountain.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+ else {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N012#A large metallic door is set in the structure.",
+ ""
+ };
+ showRoomSpecificText(text);
+ }
+}
+
+void Room::demon3LookAtPanel() {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N019#This looks like some of the hand security panels on the Enterprise.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
+void Room::demon3LookAtLight() {
+ const char *text[] = {
+ nullptr,
+ "#DEM3\\DEM3N015#A pulsing red light is set in the structure above the door.",
+ ""
+ };
+ showRoomSpecificText(text);
+}
+
}
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 274dea7..9c6c89f 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -184,7 +184,7 @@ RoomAction demon2ActionList[] = {
{ Action(ACTION_LOOK, 0x24, 0, 0), &Room::demon2LookAtFern },
{ Action(ACTION_LOOK, 0x25, 0, 0), &Room::demon2LookAtMoss },
{ Action(ACTION_LOOK, 0x26, 0, 0), &Room::demon2LookAtLights },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::demon2LookAtAnything },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::demon2LookAtAnything },
{ Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::demon2LookAtKirk },
{ Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::demon2LookAtSpock },
@@ -260,6 +260,52 @@ RoomAction demon3ActionList[] = {
{ Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::demon3RedshirtReachedPanel },
{ Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::demon3RedshirtUsedPanel },
{ Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::demon3RedshirtElectrocuted },
+
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::demon3UseSTricorderOnDoor },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::demon3UseSTricorderOnAnything },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 14, 0), &Room::demon3UseMTricorderOnDoor },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::demon3UseMTricorderOnDoor },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0x22, 0), &Room::demon3UseMTricorderOnDoor },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 14, 0), &Room::demon3UsePhaserOnDoor },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 14, 0), &Room::demon3UsePhaserOnDoor },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 0x21, 0), &Room::demon3UsePhaserOnDoor },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 0x21, 0), &Room::demon3UsePhaserOnDoor },
+
+ { Action(ACTION_USE, OBJECT_IHAND, 0x20, 0), &Room::demon3UseHandOnPanel },
+ { Action(ACTION_FINISHED_WALKING, 7, 0, 0), &Room::demon3KirkReachedHandPanel },
+ { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::demon3KirkUsedHandPanel },
+
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 13, 0), &Room::demon3UseMTricorderOnMiner },
+ { Action(ACTION_USE, OBJECT_MCCOY, 13, 0), &Room::demon3UseMedkitOnMiner },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 13, 0), &Room::demon3UseMedkitOnMiner },
+ { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::demon3McCoyReachedMiner },
+ { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::demon3McCoyFinishedHealingMiner },
+
+ { Action(ACTION_GET, 13, 0, 0), &Room::demon3GetMiner },
+
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::demon3TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::demon3TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::demon3TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::demon3TalkToRedshirt },
+
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::demon3LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::demon3LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::demon3LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::demon3LookAtRedshirt },
+
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::demon3LookAnywhere },
+ { Action(ACTION_LOOK, 13, 0, 0), &Room::demon3LookAtMiner },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::demon3LookAtBoulder1 },
+ { Action(ACTION_LOOK, 10, 0, 0), &Room::demon3LookAtBoulder2 },
+ { Action(ACTION_LOOK, 11, 0, 0), &Room::demon3LookAtBoulder3 },
+ { Action(ACTION_LOOK, 12, 0, 0), &Room::demon3LookAtBoulder4 },
+ { Action(ACTION_LOOK, 0x22, 0, 0), &Room::demon3LookAtStructure },
+ { Action(ACTION_LOOK, 14, 0, 0), &Room::demon3LookAtDoor },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::demon3LookAtDoor },
+ { Action(ACTION_LOOK, 15, 0, 0), &Room::demon3LookAtPanel },
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon3LookAtPanel },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::demon3LookAtLight },
+
};
}
Commit: 30c41ae6341045ca6aacf0532aa413402a5c0656
https://github.com/scummvm/scummvm/commit/30c41ae6341045ca6aacf0532aa413402a5c0656
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Refactor text using integer constants
Changed paths:
A engines/startrek/text.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/demon0.cpp
engines/startrek/rooms/demon1.cpp
engines/startrek/rooms/demon2.cpp
engines/startrek/rooms/demon3.cpp
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 1de1215..d44ad96 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -160,8 +160,6 @@ void Room::loadActorAnim2(int actorIndex, Common::String anim, int16 x, int16 y,
loadActorAnim(actorIndex, anim, x, y, finishedAnimActionParam);
}
-// TODO: replace "rdfOffset" with a pointer, so we no longer read from RDF files? (This
-// may be necessary to support other platforms; can't leave offsets hardcoded.)
int Room::showRoomSpecificText(const char **array) {
Common::String speaker;
byte textColor;
@@ -191,6 +189,32 @@ int Room::showRoomSpecificText(const char **array) {
return _vm->showText(&StarTrekEngine::readTextFromArray, (uintptr)array, 20, 20, textColor, true, false, false);
}
+int Room::showText(const int *textIDs) {
+ int numIDs = 0;
+ while (textIDs[numIDs] != TX_BLANK)
+ numIDs++;
+
+ const char **text = (const char **)malloc(sizeof(const char *) * (numIDs + 1));
+ for (int i = 0; i <= numIDs; i++)
+ text[i] = g_gameStrings[textIDs[i]];
+ int retval = showRoomSpecificText(text);
+ free(text);
+
+ return retval;
+}
+
+int Room::showText(int speaker, int text) {
+ int textIDs[3];
+ textIDs[0] = speaker;
+ textIDs[1] = text;
+ textIDs[2] = TX_BLANK;
+ showText(textIDs);
+}
+
+int Room::showText(int text) {
+ showText(TX_NULL, text);
+}
+
void Room::giveItem(int item) {
_vm->_itemList[item - ITEMS_START].have = true;
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 4f0e49b..12468b5 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -28,6 +28,7 @@
#include "common/str.h"
#include "startrek/startrek.h"
+#include "startrek/text.h"
using Common::SharedPtr;
@@ -102,7 +103,10 @@ private:
void loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66); // Cmd 0x00
void loadActorStandAnim(int actorIndex); // Cmd 0x01
void loadActorAnim2(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66);// Cmd 0x02
- int showRoomSpecificText(const char **textAddr); // Cmd 0x03
+ int showRoomSpecificText(const char **textAddr); // (Deprecated, use function below) // Cmd 0x03
+ int showText(const int *text); // Cmd 0x03
+ int showText(int speaker, int text); // Cmd 0x03
+ int showText(int text); // Cmd 0x03
void giveItem(int item); // Cmd 0x04
void loadRoomIndex(int roomIndex, int spawnIndex); // Cmd 0x06
void walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam);// Cmd 0x08
diff --git a/engines/startrek/rooms/demon0.cpp b/engines/startrek/rooms/demon0.cpp
index 529bf74..397a3eb 100644
--- a/engines/startrek/rooms/demon0.cpp
+++ b/engines/startrek/rooms/demon0.cpp
@@ -43,26 +43,14 @@ void Room::demon0Tick60() {
}
void Room::demon0Tick100() {
- const char *text[] = {
- "Prel. Angiven",
- "#DEM0\\DEM0_036#This is so much better, gentlefolk. We are honored at your presence and hope you will find peace here in our haven.",
- ""
- };
-
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_ANGIVEN, TX_DEM0_036);
}
void Room::demon0Tick140() {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM0\\DEM0_016#Captain, the flora on this planet is very interesting. I wonder how useful it may be for medicinal purposes.",
- ""
- };
-
if (_vm->_awayMission.demon.mccoyMentionedFlora)
return;
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM0_016);
_vm->_awayMission.demon.mccoyMentionedFlora = true;
}
@@ -113,55 +101,54 @@ void Room::demon0ReachedTopDoor() {
}
void Room::demon0TalkToPrelate() {
- const char *options1[] = {
- SPEAKER_KIRK,
- "#DEM0\\DEM0_006#I'm Captain James T. Kirk of the U.S.S. Enterprise. We have received word that alien lifeforms are creating problems at your mining facilities at Idyll Mountain. Tell me more.",
- "#DEM0\\DEM0_008#Most High Prelate Angiven, I am honored to meet you. I consider it my divine duty to assist you in any possible way with the spawn of the devil.",
- "#DEM0\\DEM0_003#Been seeing ghosts and bogeymen eh? I find that a little hard to believe.",
- ""
- };
- const char *firstResponse0[] = {
- "Prel. Angiven",
- "#DEM0\\DEM0_038#Certainly, Captain Kirk. Not aliens, per se -- we have encountered what we believe are demons at Idyll Mountain, creatures surely emerging from the very gates of Hell. Our God would not test us thus without reason, so we believe your might and insight are our God's method to help us discover what is going on.",
- ""
- };
- const char *firstResponse1[] = {
- "Prel. Angiven",
- "#DEM0\\DEM0_032#Captain Kirk. I had no idea we were blessed with one of our order in the ranks of Starfleet. We believe we have located the very Gates of Hell below Idyll Mountain.",
- ""
- };
- const char *options2[] = {
- SPEAKER_KIRK,
- "#DEM0\\DEM0_002#Aside from seeing demons, has any hard data been collected? Any evidence I could see?",
- "#DEM0\\DEM0_005#Demons? Gates of Hell? This is the 23rd Century!",
- ""
- };
- const char *secondResponse[] = {
- "Prel. Angiven",
- "#DEM0\\DEM0_031#A skeptic would consider everything merely anecdotal or unproven. My people will gladly tell you their own stories, so you need not hear it secondhand through me.",
- ""
- };
- const char *options3[] = {
- SPEAKER_KIRK,
- "#DEM0\\DEM0_010#What can you tell me about the mine itself?",
- "#DEM0\\DEM0_012#You're wasting the time of a starship capable of destroying this planet with campfire stories? No wonder you were dumped out here in the middle of nowhere.",
- ""
- };
- const char *thirdResponse[] = {
- "Prel. Angiven",
- "#DEM0\\DEM0_035#The area is exceptionally stable tectonically, and easy for our machinery to work in, praise God. We've mined for hafnium and a variety of useful trace elements. The deeper we dig, however, the more anomalous the variety of minerals seems to be. Our Ignaciate, Brother Stephen, has his own theories about why this might be. Either way, the anomalies inspired Brother Kandrey to conduct studies inside the mine. Yesterday, he reported discovering a strange door -- a gate to Hell, surely, for the demons caused a cave-in immediately. Kandrey was trapped, unconscious, and the demons prevent us from rescuing him. We can only hope he is still alive.",
- ""
- };
-
- const char *badConclusion[] = {
- "Prel. Angiven",
- "#DEM0\\DEM0_037#We need your help, Kirk. You may have no respect for our beliefs, but I hope you will look beyond that. Godspeed.",
- ""
- };
- const char *goodConclusion[] = {
- "Prel. Angiven",
- "#DEM0\\DEM0_034#Thank you for your courtesy, Kirk. May you receive the guidance and protection of our God as you complete this divine mission.",
- ""
+ const int options1[] = {
+ TX_SPEAKER_KIRK,
+ TX_DEM0_006,
+ TX_DEM0_008,
+ TX_DEM0_003,
+ TX_BLANK
+ };
+ const int firstResponse0[] = {
+ TX_SPEAKER_ANGIVEN,
+ TX_DEM0_038,
+ TX_BLANK
+ };
+ const int firstResponse1[] = {
+ TX_SPEAKER_ANGIVEN,
+ TX_DEM0_032,
+ TX_BLANK
+ };
+ const int options2[] = {
+ TX_SPEAKER_KIRK,
+ TX_DEM0_002,
+ TX_DEM0_005,
+ TX_BLANK
+ };
+ const int secondResponse[] = {
+ TX_SPEAKER_ANGIVEN,
+ TX_DEM0_031,
+ TX_BLANK
+ };
+ const int options3[] = {
+ TX_SPEAKER_KIRK,
+ TX_DEM0_010,
+ TX_DEM0_012,
+ TX_BLANK
+ };
+ const int thirdResponse[] = {
+ TX_SPEAKER_ANGIVEN,
+ TX_DEM0_035,
+ TX_BLANK
+ };
+ const int badConclusion[] = {
+ TX_SPEAKER_ANGIVEN,
+ TX_DEM0_037,
+ TX_BLANK
+ };
+ const int goodConclusion[] = {
+ TX_SPEAKER_ANGIVEN,
+ TX_DEM0_034,
+ TX_BLANK
};
if (_vm->_awayMission.demon.talkedToPrelate)
@@ -170,9 +157,9 @@ void Room::demon0TalkToPrelate() {
_vm->_awayMission.missionScore += 3;
_vm->_awayMission.demon.talkedToPrelate = true;
- const char **response = nullptr;
+ const int *response = nullptr;
- switch (showRoomSpecificText(options1)) {
+ switch (showText(options1)) {
case 0:
response = firstResponse0;
break;
@@ -185,278 +172,114 @@ void Room::demon0TalkToPrelate() {
}
if (response != nullptr)
- showRoomSpecificText(response);
+ showText(response);
- if (showRoomSpecificText(options2) == 1)
+ if (showText(options2) == 1)
demon0BadResponse();
- showRoomSpecificText(secondResponse);
+ showText(secondResponse);
- if (showRoomSpecificText(options3) == 1)
+ if (showText(options3) == 1)
demon0BadResponse();
- showRoomSpecificText(thirdResponse);
+ showText(thirdResponse);
if (_vm->_awayMission.demon.wasRudeToPrelate)
- showRoomSpecificText(badConclusion);
+ showText(badConclusion);
else
- showRoomSpecificText(goodConclusion);
+ showText(goodConclusion);
}
void Room::demon0LookAtPrelate() {
- const char *text[] = {
- nullptr,
- "#DEM0\\DEM0N004#High Prelate Angiven waits patiently for you to decide what you will do next.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM0N004);
}
void Room::demon0UsePhaserOnSnow() {
// BUG: doesn't check if redshirt is dead.
- const char *text[] = {
- SPEAKER_EVERTS,
- "#DEM0\\DEM0_039#Aw, Captain, please don't melt the snow. I've never seen it before.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_EVERTS, TX_DEM0_039);
}
void Room::demon0UsePhaserOnSign() {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM0\\DEM0_017#Quite the vandal aren't we, Jim?",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM0_017);
}
void Room::demon0UsePhaserOnShelter() {
- const char *text1[] = {
- SPEAKER_MCCOY,
- "#DEM0\\DEM0_015#Burning down their house is not the best way to gain their confidence Jim!",
- ""
- };
- const char *text2[] = {
- SPEAKER_SPOCK,
- "#DEM0\\DEM0_013#Captain, Doctor McCoy is correct.",
- ""
- };
- const char *text3[] = {
- SPEAKER_EVERTS,
- "#DEM0\\DEM0_040#Is he always this trigger happy on ground missions?",
- ""
- };
- showRoomSpecificText(text1);
- showRoomSpecificText(text2);
+ showText(TX_SPEAKER_MCCOY, TX_DEM0_015);
+ showText(TX_SPEAKER_SPOCK, TX_DEM0_013);
if (!_vm->_awayMission.redshirtDead)
- showRoomSpecificText(text3);
+ showText(TX_SPEAKER_EVERTS, TX_DEM0_040);
}
void Room::demon0UsePhaserOnPrelate() {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM0\\DEM0_020#Jim! Are you out of your mind?",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM0_020);
}
void Room::demon0LookAtSign() {
- const char *text[] = {
- "Sign",
- "All mining equipment use this road.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SIGN, TX_DEM0C001);
}
void Room::demon0LookAtTrees() {
- const char *text[] = {
- nullptr,
- "#DEM0\\DEM0N006#On the other side of the trees is Idyll Mountain. A tall, forbidding place. You have a vague feeling of danger.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM0N006);
}
void Room::demon0LookAtSnow() {
- const char *text[] = {
- nullptr,
- "#DEM0\\DEM0N007#Remnants of a recent snowfall cover the ground.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM0N007);
}
void Room::demon0LookAnywhere() {
- const char *text[] = {
- nullptr,
- "#DEM0\\DEM0N000#A beautiful, snow covered scene with a path leading off to Mount Idyll.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM0N000);
}
void Room::demon0LookAtBushes() {
- const char *text[] = {
- nullptr,
- "#DEM0\\DEM0N010#Various bushes and shrubs grow along the edge of the forest.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM0N010);
}
void Room::demon0LookAtKirk() {
- const char *text[] = {
- nullptr,
- "#DEM0\\DEM0N005#James Tiberius Kirk, Captain of the Enterprise. He's always happy to run an errand of mercy.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM0N005);
}
void Room::demon0LookAtMcCoy() {
- const char *text[] = {
- nullptr,
- "#DEM0\\DEM0N002#Dr. Leonard McCoy, the finest doctor in Starfleet, wishes that he were on a warmer planet.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM0N002);
}
void Room::demon0LookAtRedShirt() {
- const char *text[] = {
- nullptr,
- "#DEM0\\DEM0N003#Ensign Everts, who has never been this close to snow before in his life, gazes with child-like fascination at the ground.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM0N003);
}
void Room::demon0LookAtSpock() {
- const char *text[] = {
- nullptr,
- "#DEM0\\DEM0N009#Spock raises an eyebrow.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM0N009);
}
void Room::demon0LookAtShelter() {
- const char *text[] = {
- nullptr,
- "#DEM0\\DEM0N001#A quickly constructed spartan shelter, primarily used by fledgling colonies.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM0N001);
}
void Room::demon0TalkToKirk() {
- const char *text1[] = {
- SPEAKER_KIRK,
- "#DEM0\\DEM0_009#This planet's as beautiful as everyone says it is.",
- ""
- };
- const char *text2[] = {
- SPEAKER_MCCOY,
- "#DEM0\\DEM0_027#The trees. The fresh air. The freezing cold...",
- ""
- };
- const char *text3[] = {
- SPEAKER_KIRK,
- "#DEM0\\DEM0_004#C'mon Bones, the cold will improve your circulation.",
- ""
- };
- const char *text4[] = {
- SPEAKER_MCCOY,
- "#DEM0\\DEM0_024#Some people get too much circulation!",
- ""
- };
-
- showRoomSpecificText(text1);
- showRoomSpecificText(text2);
- showRoomSpecificText(text3);
- showRoomSpecificText(text4);
+ showText(TX_SPEAKER_KIRK, TX_DEM0_009);
+ showText(TX_SPEAKER_MCCOY, TX_DEM0_027);
+ showText(TX_SPEAKER_KIRK, TX_DEM0_004);
+ showText(TX_SPEAKER_MCCOY, TX_DEM0_024);
}
void Room::demon0TalkToRedshirt() {
- const char *text1[] = {
- SPEAKER_EVERTS,
- "#DEM0\\DEM0_043#I've never seen snow like this before. This is great!",
- ""
- };
- const char *text2[] = {
- SPEAKER_MCCOY,
- "#DEM0\\DEM0_026#You mean you've never built a snowman, ensign?",
- ""
- };
- const char *text3[] = {
- SPEAKER_EVERTS,
- "#DEM0\\DEM0_042#I've never even thrown a snowball. Do you think anyone would mind?",
- ""
- };
- const char *text4[] = {
- SPEAKER_MCCOY,
- "#DEM0\\DEM0_025#Well...",
- ""
- };
- const char *text5[] = {
- SPEAKER_KIRK,
- "#DEM0\\DEM0_007#Later Ensign. We have work to do.",
- ""
- };
- const char *text6[] = {
- SPEAKER_EVERTS,
- "#DEM0\\DEM0_044#Of course, sir.",
- ""
- };
-
- showRoomSpecificText(text1);
- showRoomSpecificText(text2);
- showRoomSpecificText(text3);
- showRoomSpecificText(text4);
- showRoomSpecificText(text5);
- showRoomSpecificText(text6);
+ showText(TX_SPEAKER_EVERTS, TX_DEM0_043);
+ showText(TX_SPEAKER_MCCOY, TX_DEM0_026);
+ showText(TX_SPEAKER_EVERTS, TX_DEM0_042);
+ showText(TX_SPEAKER_MCCOY, TX_DEM0_025);
+ showText(TX_SPEAKER_KIRK, TX_DEM0_007);
+ showText(TX_SPEAKER_EVERTS, TX_DEM0_044);
}
void Room::demon0TalkToMcCoy() {
if (_vm->_awayMission.demon.talkedToPrelate) {
- const char *text1[] = {
- SPEAKER_KIRK,
- "#DEM0\\DEM0_011#You look rather cold, Bones.",
- ""
- };
- const char *text2[] = {
- SPEAKER_MCCOY,
- "#DEM0\\DEM0_023#I'm not cold, I'm freezing! And that damn transporter just had to set me down in the middle of a snow drift!",
- ""
- };
- const char *text3[] = {
- SPEAKER_SPOCK,
- "#DEM0\\DEM0_029#A centimeter of snow does not technically constitute a drift, Doctor.",
- ""
- };
- const char *text4[] = {
- SPEAKER_EVERTS,
- "#DEM0\\DEM0_041#And doctors say that patients complain too much!",
- ""
- };
-
- showRoomSpecificText(text1);
- showRoomSpecificText(text2);
- showRoomSpecificText(text3);
+ showText(TX_SPEAKER_KIRK, TX_DEM0_011);
+ showText(TX_SPEAKER_MCCOY, TX_DEM0_023);
+ showText(TX_SPEAKER_SPOCK, TX_DEM0_029);
if (!_vm->_awayMission.redshirtDead)
- showRoomSpecificText(text4);
+ showText(TX_SPEAKER_EVERTS, TX_DEM0_041);
}
else {
- const char *text1[] = {
- SPEAKER_MCCOY,
- "#DEM0\\DEM0_019#I don't know if the problem is real, the result of a new illness, or mass hysteria. But at the very least, there's an injured miner who needs my help.",
- ""
- };
-
- showRoomSpecificText(text1);
+ showText(TX_SPEAKER_MCCOY, TX_DEM0_019);
if (!_vm->_awayMission.demon.askedPrelateAboutSightings) {
demon0AskPrelateAboutSightings();
}
@@ -464,36 +287,15 @@ void Room::demon0TalkToMcCoy() {
}
void Room::demon0TalkToSpock() {
- const char *text1[] = {
- SPEAKER_SPOCK,
- "#DEM0\\DEM0_014#Captain, demons and supernatural creatures are, almost by definition, illogical. Yet it is evident these people believe what they have seen. Barring illness or mass hysteria, I agree that a real problem seems to exist.",
- ""
- };
+ showText(TX_SPEAKER_SPOCK, TX_DEM0_014);
- if (_vm->_awayMission.demon.talkedToPrelate) {
- showRoomSpecificText(text1);
- }
- else {
- showRoomSpecificText(text1);
- if (!_vm->_awayMission.demon.askedPrelateAboutSightings)
- demon0AskPrelateAboutSightings();
- }
+ if (!_vm->_awayMission.demon.talkedToPrelate && !_vm->_awayMission.demon.askedPrelateAboutSightings)
+ demon0AskPrelateAboutSightings();
}
void Room::demon0AskPrelateAboutSightings() {
- const char *text2[] = {
- SPEAKER_KIRK,
- "#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?",
- ""
- };
- const char *text3[] = {
- "Prel. Angiven",
- "#DEM0\\DEM0_030#They are already gathered in the chapel, and will cooperate in any way with you. First door on my right.",
- ""
- };
-
- showRoomSpecificText(text2);
- showRoomSpecificText(text3);
+ showText(TX_SPEAKER_KIRK, TX_DEM0_001);
+ showText(TX_SPEAKER_ANGIVEN, TX_DEM0_030);
_vm->_awayMission.demon.askedPrelateAboutSightings = true;
}
@@ -501,65 +303,34 @@ void Room::demon0AskPrelateAboutSightings() {
void Room::demon0UseSTricorderAnywhere() {
loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
playSoundEffectIndex(0x04);
-
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM0\\DEM0_028#Captain, reading the rocks in this area, I find that this locality may have been disturbed in the distant past. Recent disturbances created by the colonists' construction and mining prevent me from discovering anything further.",
- ""
- };
-
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM0_028);
}
void Room::demon0UseMTricorderAnywhere() {
loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
playSoundEffectIndex(0x04);
-
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM0\\DEM0_021#Jim, I am not picking up any unusual life here, just native lifeforms and the settlers. The colonists are all human, except for the one Tellarite. If there are demons here, they don't register on my tricorder.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM0_021);
}
void Room::demon0UseMTricorderOnPrelate() {
loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
playSoundEffectIndex(0x04);
- if (_vm->_awayMission.demon.talkedToPrelate) {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM0\\DEM0_018#His blood pressure's up a bit, but he believes he's telling the truth.",
- ""
- };
- showRoomSpecificText(text);
- }
- else {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM0\\DEM0_022#The man's in perfect health.",
- ""
- };
- showRoomSpecificText(text);
- }
+ if (_vm->_awayMission.demon.talkedToPrelate)
+ showText(TX_SPEAKER_MCCOY, TX_DEM0_018);
+ else
+ showText(TX_SPEAKER_MCCOY, TX_DEM0_022);
}
// Helper functions
void Room::demon0BadResponse() {
- const char *text[] = {
- "Prel. Angiven",
- "#DEM0\\DEM0_033#Starfleet recognizes our freedom to worship and believe as we see fit, Captain. I am surprised that you do not share that feeling. Rest assured that Starfleet Command will be informed of your rudeness.",
- ""
- };
-
if (_vm->_awayMission.demon.wasRudeToPrelate)
return;
_vm->_awayMission.missionScore -= 3;
_vm->_awayMission.demon.wasRudeToPrelate = true;
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_ANGIVEN, TX_DEM0_033);
}
}
diff --git a/engines/startrek/rooms/demon1.cpp b/engines/startrek/rooms/demon1.cpp
index 2830ff9..fb5a66e 100644
--- a/engines/startrek/rooms/demon1.cpp
+++ b/engines/startrek/rooms/demon1.cpp
@@ -204,25 +204,13 @@ void Room::demon1KlingonFinishedAimingWeapon() {
}
void Room::demon1KirkShot() {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N000#Captain Kirk is fatally shot by a Klingon, game over.",
- ""
- };
-
- showRoomSpecificText(text);
+ showText(TX_DEM1N000);
showGameOverMenu();
}
void Room::demon1UsePhaserOnAnything() {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM1\\DEM1_011#The fire fight is over, Jim. I think you can put that away now.",
- ""
- };
-
if (_roomVar.demon1.numKlingonsKilled == 3)
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM1_011);
}
void Room::demon1UsePhaserOnKlingon1() {
@@ -256,35 +244,20 @@ void Room::demon1ShootKlingon1() {
}
void Room::demon1KlingonDropsHand() {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N020#You see a small explosion, and the Klingon's hand falls to the ground with a dull thud.",
- ""
- };
loadActorAnim(13, "klghnd", 0x10b, 0x8e, 0);
_vm->_awayMission.transitioningIntoRoom = 0;
_vm->_awayMission.timers[1] = 0;
- showRoomSpecificText(text);
+ showText(TX_DEM1N020);
if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT))
return;
- const char *rshirtText[] = {
- SPEAKER_EVERTS,
- "#DEM1\\DEM1_025#I guess they don't make Klingons like they used to, Sir.",
- ""
- };
- showRoomSpecificText(rshirtText);
+ showText(TX_SPEAKER_EVERTS, TX_DEM1_025);
if (_roomVar.demon1.numKlingonsKilled == 3)
return;
- const char *klingonText[] = {
- "Klingon",
- "#DEM1\\DEM1_F23#Federation Scum!",
- ""
- };
- showRoomSpecificText(klingonText);
+ showText(TX_SPEAKER_KLINGON, TX_DEM1_F23);
_vm->_awayMission.timers[1] = 1;
}
@@ -361,116 +334,50 @@ void Room::demon1Timer5Expired() {
if (_vm->_awayMission.crewDownBitset != 0)
return;
- const char *text1[] = {
- "Lt. Uhura",
- "#DEM1\\DEM1U077#Captain we registered Phaser fire and an unknown energy beam. Is everyone OK?",
- ""
- };
- const char *text2[] = {
- SPEAKER_KIRK,
- "#DEM1\\DEM1_003#We're fine. Did you register any Disruptor fire?",
- ""
- };
- const char *text3[] = {
- "Lt. Uhura",
- "#DEM1\\DEM1U078#No, Captain. Why, are Klingons down there?",
- ""
- };
- const char *text4[] = {
- SPEAKER_KIRK,
- "#DEM1\\DEM1_002#No just an idea, Kirk out.",
- ""
- };
- const char *text5[] = {
- SPEAKER_SPOCK,
- "#DEM1\\DEM1_020#Fascinating. I begin to suspect that we have stumbled upon something that the colonists would never have uncovered.",
- ""
- };
- const char *text6[] = {
- SPEAKER_KIRK,
- "#DEM1\\DEM1_004#What is it, Spock?",
- ""
- };
- const char *text7[] = {
- SPEAKER_SPOCK,
- "#DEM1\\DEM1_021#I wish to gather further data before making a definite conclusion, Captain.",
- ""
- };
-
- showRoomSpecificText(text1);
- showRoomSpecificText(text2);
- showRoomSpecificText(text3);
- showRoomSpecificText(text4);
- showRoomSpecificText(text5);
- showRoomSpecificText(text6);
- showRoomSpecificText(text7);
+ showText(TX_SPEAKER_UHURA, TX_DEM1U077);
+ showText(TX_SPEAKER_KIRK, TX_DEM1_003);
+ showText(TX_SPEAKER_UHURA, TX_DEM1U078);
+ showText(TX_SPEAKER_KIRK, TX_DEM1_002);
+ showText(TX_SPEAKER_SPOCK, TX_DEM1_020);
+ showText(TX_SPEAKER_KIRK, TX_DEM1_004);
+ showText(TX_SPEAKER_SPOCK, TX_DEM1_021);
}
void Room::demon1UseMTricorderOnKlingon() {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM1\\DEM1_012#This is definitely not a real klingon Jim.",
- ""
- };
loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
playSoundEffectIndex(0x04);
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM1_012);
}
void Room::demon1UseSTricorderOnTulips() {
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM1\\DEM1_007#Khytellian tulips are a perennial flower that survive in almost any climate.",
- ""
- };
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(0x04);
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM1_007);
}
void Room::demon1UseSTricorderOnPods() {
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM1\\DEM1_008#The Brandzite pod is similar to terran milkweed except that the silk pods are in bright iridecent colors.",
- ""
- };
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(0x04);
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM1_008);
}
void Room::demon1UseSTricorderOnCattails() {
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM1\\DEM1_005#Doctis Cattails are similar to their terran name sake except that they are known to cause hives if in contact with flesh for any amount of time.",
- ""
- };
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(0x04);
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM1_005);
}
void Room::demon1UseSTricorderOnFerns() {
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM1\\DEM1_006#Gindorian ferns are regarded as an intergalactic weed, Captain.",
- ""
- };
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(0x04);
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM1_006);
}
void Room::demon1UseSTricorderOnHand() {
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM1\\DEM1_017#This is a detached hand with some kind of circuitry in the palm, Captain.",
- ""
- };
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(0x04);
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM1_017);
}
void Room::demon1UseSTricorderOnKlingon1() {
@@ -479,34 +386,18 @@ void Room::demon1UseSTricorderOnKlingon1() {
playSoundEffectIndex(0x04);
if (_roomVar.demon1.numKlingonsKilled == 3 && !_vm->_awayMission.demon.tookKlingonHand && _rdfData[0xcf] != 1) {
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM1\\DEM1_018#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial. There is something different about this particular construct. Come here, Captain, look at the hand.It seems to have been separated from the body. There is a wiring circuit in the middle of the palm.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM1_018);
_rdfData[0xcf] = 1;
}
else {
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM1\\DEM1_019#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM1_019);
}
}
void Room::demon1UseSTricorderOnKlingon2Or3() {
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(0x04);
-
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM1\\DEM1_019#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM1_019);
}
void Room::demon1UseMTricorderOnKirk() {
@@ -525,14 +416,9 @@ void Room::demon1UseMTricorderOnRedshirt() {
}
void Room::demon1UseMTricorderOnCrewman() {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM1\\DEM1_009#He's only stunned. He'll be back up in a few seconds.",
- ""
- };
loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
playSoundEffectIndex(0x04);
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM1_009);
}
void Room::demon1GetHand() {
@@ -554,231 +440,98 @@ void Room::demon1PickedUpHand() {
// Timer 4 expired
void Room::demon1FinishedGettingHand() {
- const char *text1[] = {
- nullptr,
- "#DEM1\\DEM1N005#You already took the hand from the Klingon.",
- ""
- };
- const char *text2[] = {
- nullptr,
- "#DEM1\\DEM1N007#You take the Klingon's detached hand.",
- ""
- };
if (_vm->_awayMission.demon.tookKlingonHand)
- showRoomSpecificText(text1);
+ showText(TX_DEM1N005);
else {
_vm->_awayMission.demon.tookKlingonHand = true;
giveItem(OBJECT_IHAND);
- showRoomSpecificText(text2);
+ showText(TX_DEM1N007);
}
}
void Room::demon1LookAtKlingon() {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N004#They look like Klingons.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM1N004);
}
void Room::demon1LookAtCattails() {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N018#These are very beautiful Doctis Cattails.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM1N018);
}
void Room::demon1LookAtTulips() {
- const char *text[] = {
- nullptr,
- "M1\\DEM1N010#A large patch of Khytellian Tulips.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM1N010);
}
void Room::demon1LookAtPods() {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N019#These Brandzite Pods add a nice touch to the local flora.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM1N019);
}
void Room::demon1LookAtFerns() {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N009#A Gindorian Fern.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM1N009);
}
void Room::demon1LookAtStream() {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N011#A small stream flows down towards the forest.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM1N011);
}
void Room::demon1LookAtMine() {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N021#You see the mine entrance ahead.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM1N021);
}
void Room::demon1LookAtMountain() {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N016#Mt. Idyll rises above you.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM1N016);
}
void Room::demon1LookAtHand() {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N023#It's the Klingon's detached hand!",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM1N023);
}
void Room::demon1LookAnywhere() {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N017#The path is surrounded by some beautiful shrubbery.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM1N017);
}
void Room::demon1LookAtKirk() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_KIRK)) {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N012#Captain Kirk is unconscious.",
- ""
- };
- showRoomSpecificText(text);
- }
- else {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N003#James Kirk, filled with a premonition of more dangers yet to come.",
- ""
- };
- showRoomSpecificText(text);
- }
+ if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_KIRK))
+ showText(TX_DEM1N012);
+ else
+ showText(TX_DEM1N003);
}
void Room::demon1LookAtSpock() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_SPOCK)) {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N015#Mr. Spock is unconscious.",
- ""
- };
- showRoomSpecificText(text);
- }
- else {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N008#Your Vulcan science officer seems to be lost in thought, but remains alert.",
- ""
- };
- showRoomSpecificText(text);
- }
+ if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_SPOCK))
+ showText(TX_DEM1N015);
+ else
+ showText(TX_DEM1N008);
}
void Room::demon1LookAtMcCoy() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_MCCOY)) {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N013#Dr. McCoy is unconscious.",
- ""
- };
- showRoomSpecificText(text);
- }
- else {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N001#Dr. McCoy, still hoping the cold winds that whip around Mount Idyll will soon die down.",
- ""
- };
- showRoomSpecificText(text);
- }
+ if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_MCCOY))
+ showText(TX_DEM1N013);
+ else
+ showText(TX_DEM1N001);
}
void Room::demon1LookAtRedshirt() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT)) {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N014#Ensign Everts is unconscious.",
- ""
- };
- showRoomSpecificText(text);
- }
- else {
- const char *text[] = {
- nullptr,
- "#DEM1\\DEM1N002#Ensign Everts seems to be rattled by the attack of the Klingons.",
- ""
- };
- showRoomSpecificText(text);
- }
+ if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT))
+ showText(TX_DEM1N014);
+ else
+ showText(TX_DEM1N002);
}
void Room::demon1TalkToKirk() {
- const char *text[] = {
- SPEAKER_KIRK,
- "#DEM1\\DEM1_001#We were caught flat footed there. I don't want any more surprises to catch us off guard.",
- ""
- };
if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_KIRK))
demon1TalkToUnconsciousCrewman();
else if (_roomVar.demon1.numKlingonsKilled == 3)
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_KIRK, TX_DEM1_001);
}
void Room::demon1TalkToSpock() {
if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_SPOCK))
demon1TalkToUnconsciousCrewman();
else {
- const char *text1[] = {
- SPEAKER_SPOCK,
- "#DEM1\\DEM1_022#Captain, I detect a recent avalanche, approximately 6.2 kilometers away, that occurred within the last three days. The mountain may be quite dangerous.",
- ""
- };
- const char *text2[] = {
- SPEAKER_MCCOY,
- "#DEM1\\DEM1_013#Demons, Klingons, avalanches... What's next, the Wicked Witch of the West?",
- ""
- };
- const char *text3[] = {
- SPEAKER_SPOCK,
- "#DEM1\\DEM1_024#That is not logical, doctor.",
- ""
- };
- const char *text4[] = {
- SPEAKER_MCCOY,
- "#DEM1\\DEM1_014#It wasn't supposed to be logical, you green blooded Vulcan! Why does everything have to be so damned logical?",
- ""
- };
- showRoomSpecificText(text1);
- showRoomSpecificText(text2);
- showRoomSpecificText(text3);
- showRoomSpecificText(text4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM1_022);
+ showText(TX_SPEAKER_MCCOY, TX_DEM1_013);
+ showText(TX_SPEAKER_SPOCK, TX_DEM1_024);
+ showText(TX_SPEAKER_MCCOY, TX_DEM1_014);
}
}
@@ -786,32 +539,16 @@ void Room::demon1TalkToMcCoy() {
if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_MCCOY))
demon1TalkToUnconsciousCrewman();
else {
- const char *text1[] = {
- SPEAKER_MCCOY,
- "#DEM1\\DEM1_015#Well, we've seen Klingons. Now all we need is a few Romulans...",
- ""
- };
- const char *text2[] = {
- SPEAKER_SPOCK,
- "#DEM1\\DEM1_023#Control your thoughts, Doctor. There is a high probability that something here is using our own memories against us.",
- ""
- };
- showRoomSpecificText(text1);
- showRoomSpecificText(text2);
+ showText(TX_SPEAKER_MCCOY, TX_DEM1_015);
+ showText(TX_SPEAKER_SPOCK, TX_DEM1_023);
}
}
void Room::demon1TalkToRedshirt() {
if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT))
demon1TalkToUnconsciousCrewman();
- else {
- const char *text[] = {
- SPEAKER_EVERTS,
- "#DEM1\\DEM1_026#I guess this isn't such a great planet after all.",
- ""
- };
- showRoomSpecificText(text);
- }
+ else
+ showText(TX_SPEAKER_EVERTS, TX_DEM1_026);
}
// FIXME: this doesn't happen in actual game? (does the event get blocked from higher up?)
diff --git a/engines/startrek/rooms/demon2.cpp b/engines/startrek/rooms/demon2.cpp
index 7d2d019..c707e25 100644
--- a/engines/startrek/rooms/demon2.cpp
+++ b/engines/startrek/rooms/demon2.cpp
@@ -42,219 +42,91 @@ void Room::demon2TouchedWarp1() {
}
void Room::demon2LookAtCave() {
- const char *text[] = {
- nullptr,
- "#DEM2\\DEM2N009#Mine entrance.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM2N009);
}
void Room::demon2LookAtMountain() {
- const char *text[] = {
- nullptr,
- "#DEM2\\DEM2N007#Idyll Mountain.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM2N007);
}
void Room::demon2LookAtBerries() {
- const char *text[] = {
- nullptr,
- "#DEM2\\DEM2N012#Various types of berries grow amongst the bushes.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM2N012);
}
void Room::demon2LookAtFern() {
- const char *text[] = {
- nullptr,
- "#DEM2\\DEM2N005#A Gindorian fern.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM2N005);
}
void Room::demon2LookAtMoss() {
- const char *text[] = {
- nullptr,
- "#DEM2\\DEM2N010#Phequedian moss grows on the cave wall.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM2N010);
}
void Room::demon2LookAtLights() {
- const char *text[] = {
- nullptr,
- "#DEM2\\DEM2N006#Feeble lights illuminate the mine tunnel.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM2N006);
}
void Room::demon2LookAtAnything() {
- const char *text[] = {
- nullptr,
- "#DEM2\\DEM2N011#The mine entrance goes deep into Mount Idyll.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM2N011);
}
void Room::demon2LookAtKirk() {
- const char *text[] = {
- nullptr,
- "#DEM2\\DEM2N002#James T. Kirk. Always wondering what the next surprise will be.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM2N002);
}
void Room::demon2LookAtSpock() {
- const char *text[] = {
- nullptr,
- "#DEM2\\DEM2N004#Spock. Perhaps the most brilliant mind in Starfleet, pondering a most peculiar mystery.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM2N004);
}
void Room::demon2LookAtMcCoy() {
- const char *text[] = {
- nullptr,
- "#DEM2\\DEM2N003#Leonard McCoy. Hoping that the cave will be warmer than outside.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM2N003);
}
void Room::demon2LookAtRedshirt() {
- const char *text[] = {
- nullptr,
- "#DEM2\\DEM2N000#Ensign Everts. Keeping a sharp eye out for anything dangerous.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM2N000);
}
void Room::demon2TalkToKirk() {
- const char *text[] = {
- SPEAKER_KIRK,
- "#DEM2\\DEM2_001#The answer to this mystery lies ahead of us, gentlemen.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_KIRK, TX_DEM2_001);
}
void Room::demon2TalkToSpock() {
- const char *text1[] = {
- SPEAKER_SPOCK,
- "#DEM2\\DEM2_018#Whoever was trying to stop us may not stop with those Klingons, Captain. I recommend extreme caution.",
- ""
- };
- const char *text2[] = {
- SPEAKER_KIRK,
- "#DEM2\\DEM2_003#The thought had occurred to me, Mr. Spock, but thank you for mentioning it.",
- ""
- };
- showRoomSpecificText(text1);
- showRoomSpecificText(text2);
+ showText(TX_SPEAKER_SPOCK, TX_DEM2_018);
+ showText(TX_SPEAKER_KIRK, TX_DEM2_003);
}
void Room::demon2TalkToMcCoy() {
- const char *text1[] = {
- SPEAKER_MCCOY,
- "#DEM2\\DEM2_015#Does your tricorder say the cave is warmer, Spock...",
- ""
- };
- const char *text2[] = {
- SPEAKER_SPOCK,
- "#DEM2\\DEM2_017#It is not logical for me to use my tricorder to determine the cave's temperature, doctor. I do not see what purpose it would serve.",
- ""
- };
- const char *text3[] = {
- SPEAKER_MCCOY,
- "#DEM2\\DEM2_016#Spock, everybody talks about the weather!",
- ""
- };
- showRoomSpecificText(text1);
- showRoomSpecificText(text2);
- showRoomSpecificText(text3);
+ showText(TX_SPEAKER_MCCOY, TX_DEM2_015);
+ showText(TX_SPEAKER_SPOCK, TX_DEM2_017);
+ showText(TX_SPEAKER_MCCOY, TX_DEM2_016);
}
void Room::demon2TalkToRedshirt() {
- const char *text1[] = {
- SPEAKER_EVERTS,
- "#DEM2\\DEM2_019#I'm sorry I let you down with those Klingons back there. I should have been paying more attention.",
- ""
- };
- const char *text2[] = {
- SPEAKER_KIRK,
- "#DEM2\\DEM2_002#Just don't make that mistake again, Ensign.",
- ""
- };
- const char *text3[] = {
- SPEAKER_EVERTS,
- "#DEM2\\DEM2_020#Those Klingons give me the willies. They always have. My sister was wounded by them in the Chozon ambush.",
- ""
- };
- const char *text4[] = {
- SPEAKER_KIRK,
- "#DEM2\\DEM2_004#We've all had our share of conflict with Klingons, Ensign. The Organians told me that one day Humans and Klingons will become good friends. I wonder if I'll ever live to see that day.",
- ""
- };
- showRoomSpecificText(text1);
- showRoomSpecificText(text2);
- showRoomSpecificText(text3);
- showRoomSpecificText(text4);
+ showText(TX_SPEAKER_EVERTS, TX_DEM2_019);
+ showText(TX_SPEAKER_KIRK, TX_DEM2_002);
+ showText(TX_SPEAKER_EVERTS, TX_DEM2_020);
+ showText(TX_SPEAKER_KIRK, TX_DEM2_004);
}
void Room::demon2UsePhaserOnBerries() {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM2\\DEM2_011#Jim, you usually pick food and then cook it.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM2_011);
}
void Room::demon2UseSTricorderOnBerries() {
loadActorAnim2(OBJECT_SPOCK, "sscane", -1, -1, 0);
playSoundEffectIndex(0x04);
-
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM2\\DEM2_008#These seem to be Laraxian berries, Captain. They have several medicinal uses, but Dr. McCoy would know more.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM2_008);
}
void Room::demon2UseSTricorderOnMoss() {
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(0x04);
-
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM2\\DEM2_007#The Phequedine moss extracts nourishment from hafnium, Captain.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM2_007);
}
void Room::demon2UseSTricorderOnFern() {
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(0x04);
-
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM2\\DEM2_006#Gindorian ferns are regarded as an intergalactic weed, Captain.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM2_006);
}
void Room::demon2UseSTricorderOnCave() {
@@ -262,64 +134,28 @@ void Room::demon2UseSTricorderOnCave() {
playSoundEffectIndex(0x04);
// NOTE: audio file for this is empty.
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM2\\DEM2_005#Captain, I'm having trouble getting reliable readings from inside the mountain. Unusual crystalline structures within the ore may be at fault, though I cannot say for certain.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM2_005);
}
void Room::demon2UseMTricorderOnBerries() {
loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0);
playSoundEffectIndex(0x04);
- if (_vm->_awayMission.demon.curedBrother) {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM2\\DEM2_013#These are the Laraxian Berries we used to cure Brother Chub.",
- ""
- };
- showRoomSpecificText(text);
- }
- else if (_vm->_awayMission.demon.madeHypoDytoxin) {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM2\\DEM2_009#Jim, these are Laraxian Berries that we used to make the Hypo-Dytoxin.",
- ""
- };
- showRoomSpecificText(text);
- }
- else if (_vm->_awayMission.demon.knowAboutHypoDytoxin) {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM2\\DEM2_010#Jim, these are the berries we need to synthesize the Hypo-Dytoxin. We must get these to Brother Stephen quickly.",
- ""
- };
- showRoomSpecificText(text);
- }
- else {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM2\\DEM2_012#These are Laraxian Berries. From what I remember, certain chemical compounds in the berry can be used to treat Nugaireyn infections.",
- ""
- };
- showRoomSpecificText(text);
- }
+ if (_vm->_awayMission.demon.curedBrother)
+ showText(TX_SPEAKER_MCCOY, TX_DEM2_013);
+ else if (_vm->_awayMission.demon.madeHypoDytoxin)
+ showText(TX_SPEAKER_MCCOY, TX_DEM2_009);
+ else if (_vm->_awayMission.demon.knowAboutHypoDytoxin)
+ showText(TX_SPEAKER_MCCOY, TX_DEM2_010);
+ else
+ showText(TX_SPEAKER_MCCOY, TX_DEM2_012);
}
void Room::demon2GetBerries() {
- if (_vm->_awayMission.demon.gotBerries) {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM2\\DEM2_014#We don't need any more berries, Jim.",
- ""
- };
- showRoomSpecificText(text);
- }
- else {
+ if (_vm->_awayMission.demon.gotBerries)
+ showText(TX_SPEAKER_MCCOY, TX_DEM2_014);
+ else
walkCrewman(OBJECT_KIRK, 0xe8, 0x97, 1);
- }
}
void Room::demon2ReachedBerries() {
@@ -328,12 +164,7 @@ void Room::demon2ReachedBerries() {
}
void Room::demon2PickedUpBerries() {
- const char *text[] = {
- nullptr,
- "#DEM2\\DEM2N013#You have retrieved a sample of berries.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM2N013);
giveItem(OBJECT_IBERRY);
_vm->_awayMission.demon.gotBerries = true;
_vm->_awayMission.missionScore += 1;
diff --git a/engines/startrek/rooms/demon3.cpp b/engines/startrek/rooms/demon3.cpp
index 3af6da9..eb31f29 100644
--- a/engines/startrek/rooms/demon3.cpp
+++ b/engines/startrek/rooms/demon3.cpp
@@ -86,24 +86,14 @@ void Room::demon3Timer1Expired() {
// Door just opened
void Room::demon3Timer3Expired() {
if (_vm->_awayMission.demon.field3b) {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N008#The hand's circuitry triggers a connection, and the door opens.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N008);
loadActorAnim(14, "door", 0x82, 0xc, 0);
loadMapFile("demon3");
_vm->_awayMission.demon.doorOpened = true;
_vm->_awayMission.missionScore += 2;
}
else {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N007#The fit is perfect, but something seems to be shorting out.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N007);
}
}
@@ -124,13 +114,7 @@ void Room::demon3FinishedAnimation2() {
void Room::demon3FinishedWalking5() {
loadActorAnim2(OBJECT_MCCOY, "mscanw", -1, -1, 0);
playSoundEffectIndex(0x04);
-
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM3\\DEM3_019#He's dead, Jim...",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_019);
_vm->_awayMission.transitioningIntoRoom = false;
}
@@ -216,21 +200,11 @@ void Room::demon3FireAtBoulder() {
void Room::demon3UsePhaserOnRedshirt() {
if (!_vm->_awayMission.redshirtDead)
return;
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM3\\DEM3_013#He's already dead, Jim. Isn't that good enough for you?",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_013);
}
void Room::demon3UseStunPhaserOnBoulder() {
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM3\\DEM3_007#Captain, the stun setting would be very ineffective on these boulders.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM3_007);
}
void Room::demon3UsePhaserOnBoulder1() {
@@ -265,12 +239,7 @@ void Room::demon3UsePhaserOnBoulder3() {
demon3BoulderCommon();
}
else {
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM3\\DEM3_006#Captain, the structure is extremely unstable. I would not recommend disturbing the lower section before the upper sections have been cleared.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM3_006);
}
}
@@ -288,12 +257,7 @@ void Room::demon3UsePhaserOnBoulder4() {
else {
// BUGFIX: In the original, the audio didn't play, despite the file existing (and
// despite it being used for the boulder on the left).
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM3\\DEM3_006#Captain, the structure is extremely unstable. I would not recommend disturbing the lower section before the upper sections have been cleared.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM3_006);
}
}
@@ -309,12 +273,7 @@ void Room::demon3BoulderCommon() {
demon3PullOutPhaserAndFireAtBoulder();
}
else {
- const char *text[] = {
- SPEAKER_KIRK,
- "#DEM3\\DEM3_001#Assume firing positions.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_KIRK, TX_DEM3_001);
walkCrewman(OBJECT_KIRK, 0x79, 0xa0, 1);
walkCrewman(OBJECT_SPOCK, 0xae, 0xb4, 2);
@@ -330,23 +289,13 @@ void Room::demon3BoulderCommon() {
void Room::demon3UseSTricorderOnMiner() {
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(0x04);
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM3\\DEM3_008#I think Doctor McCoy would be better suited to deal with this.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM3_008);
}
void Room::demon3UseSTricorderOnPanel() {
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(0x04);
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM3\\DEM3_009#It appears to be a security lock designed to open the door when the correct hand print is registered.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM3_009);
}
void Room::demon3UseSTricorderOnBoulder() {
@@ -354,12 +303,7 @@ void Room::demon3UseSTricorderOnBoulder() {
return;
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(0x04);
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM3\\DEM3_010#Captain, there are several weak points in the cave-in's structure. Careful use of our phasers, from the top down, should be able to clear it.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM3_010);
}
void Room::demon3UseMTricorderOnBoulder() {
@@ -367,40 +311,24 @@ void Room::demon3UseMTricorderOnBoulder() {
return;
loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
playSoundEffectIndex(0x04);
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM3\\DEM3_020#I'm picking up weak vital signs. If we don't dig him out soon, we're going to lose him!",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_020);
}
void Room::demon3UseCrewmanOnPanel() {
if (_vm->_awayMission.demon.numBouldersGone != 4 || _vm->_awayMission.redshirtDead)
return;
- const char *text[] = {
- SPEAKER_EVERTS,
- "#DEM3\\DEM3_031#Sir, it may be dangerous. Let me try it.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_EVERTS, TX_DEM3_031);
demon3UseRedshirtOnPanel();
}
void Room::demon3UseRedshirtOnPanel() {
if (_vm->_awayMission.redshirtDead)
return;
- if (_vm->_awayMission.demon.numBouldersGone != 4) {
- const char *text[] = {
- SPEAKER_EVERTS,
- "#DEM3\\DEM3_030#Sir, I think we should clear the rest of the rocks before we check out the device.",
- ""
- };
- showRoomSpecificText(text);
- }
- else {
+
+ if (_vm->_awayMission.demon.numBouldersGone != 4)
+ showText(TX_SPEAKER_EVERTS, TX_DEM3_030);
+ else
walkCrewman(OBJECT_REDSHIRT, 0xd8, 0x70, 8);
- }
}
void Room::demon3RedshirtReachedPanel() {
@@ -414,12 +342,7 @@ void Room::demon3RedshirtUsedPanel() {
_vm->_awayMission.demon.field41++;
if (_vm->_awayMission.demon.field41 == 5) {
playVoc("EFX3");
- const char *text[] = {
- SPEAKER_EVERTS,
- "#DEM3\\DEM3_A32#Aieeee!",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_EVERTS, TX_DEM3_A32);
loadActorAnim2(OBJECT_REDSHIRT, "rkille", -1, -1, 3);
playSoundEffectIndex(0x06);
@@ -427,84 +350,53 @@ void Room::demon3RedshirtUsedPanel() {
_vm->_awayMission.demon.field45 = true;
}
else {
- const char *textTable[] = {
- "#DEM3\\DEM3N005#Nothing happens.",
- "#DEM3\\DEM3_033#I think I was shocked, sir.",
- "#DEM3\\DEM3_035#That was definitely a mild shock.",
- "#DEM3\\DEM3_034#Ouch, that hurt.",
+ const int textTable[] = {
+ TX_DEM3N005,
+ TX_DEM3_033,
+ TX_DEM3_035,
+ TX_DEM3_034,
};
- const char *text[] = {
- "SPEAKER_EVERTS",
- nullptr,
- ""
+ int text[] = {
+ TX_SPEAKER_EVERTS,
+ TX_NULL,
+ TX_BLANK
};
text[1] = textTable[_vm->_awayMission.demon.field41 - 1];
- showRoomSpecificText(text);
+ showText(text);
walkCrewman(OBJECT_REDSHIRT, 0xbe, 0x9b, 0);
}
}
void Room::demon3RedshirtElectrocuted() {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM3\\DEM3_018#He's dead Jim.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_018);
}
void Room::demon3UseSTricorderOnDoor() {
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(0x04);
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM3\\DEM3_012#Fascinating, Captain. This door is made of an unknown material. It is clearly built by an alien race we have no knowledge of.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM3_012);
}
void Room::demon3UseSTricorderOnAnything() {
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(0x04);
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM3\\DEM3_027#Fascinating... I'm registering low-intensity shielding unlike anything we've encountered before. That kept this door -- and whatever is behind it -- hidden from the ship's sensors and earlier tricorder readings.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM3_027);
}
void Room::demon3UseMTricorderOnDoor() {
loadActorAnim2(OBJECT_SPOCK, "mscann", -1, -1, 0);
playSoundEffectIndex(0x04);
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM3\\DEM3_016#This is incredible, Jim. I'm picking up faint lifesign readings behind this door!",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_016);
}
void Room::demon3UsePhaserOnDoor() {
_roomVar.demon3.usedPhaserOnDoor++;
- if (_roomVar.demon3.usedPhaserOnDoor == 1) {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N009#There is no apparent effect.",
- ""
- };
- showRoomSpecificText(text);
- }
- else if (_roomVar.demon3.usedPhaserOnDoor == 2) {
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM3\\DEM3_011#Captain, this course of action is ineffectual.",
- ""
- };
- showRoomSpecificText(text);
- }
+
+ if (_roomVar.demon3.usedPhaserOnDoor == 1)
+ showText(TX_DEM3N009);
+ else if (_roomVar.demon3.usedPhaserOnDoor == 2)
+ showText(TX_SPEAKER_SPOCK, TX_DEM3_011);
}
void Room::demon3UseHandOnPanel() {
@@ -514,12 +406,7 @@ void Room::demon3UseHandOnPanel() {
walkCrewman(OBJECT_KIRK, 0xd8, 0x70, 7);
}
else {
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM3\\DEM3_005#Captain, I would strongly recommend clearing all the debris first.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM3_005);
}
}
@@ -540,30 +427,16 @@ void Room::demon3UseMTricorderOnMiner() {
playSoundEffectIndex(0x04);
if (_vm->_awayMission.demon.minerDead) {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM3\\DEM3_022#The miner is dead.",
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_022);
}
else {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM3\\DEM3_023#This man is badly hurt, and suffering from shock and exposure as well.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_023);
}
}
void Room::demon3UseMedkitOnMiner() {
if (_vm->_awayMission.demon.healedMiner) {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM3\\DEM3_015#I've done all I can. He just needs rest now.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_015);
}
else {
walkCrewman(OBJECT_MCCOY, 0xe6, 0x7b, 6);
@@ -578,20 +451,10 @@ void Room::demon3McCoyReachedMiner() {
void Room::demon3McCoyFinishedHealingMiner() {
if (_vm->_awayMission.demon.minerDead) {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM3\\DEM3_022#The miner is dead.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_022);
}
else {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM3\\DEM3_021#It was a near thing, but he'll live.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_021);
_vm->_awayMission.demon.healedMiner = true;
loadActorAnim2(13, "drmine", 0xda, 0x6c, 0);
_vm->_awayMission.missionScore += 2;
@@ -600,72 +463,27 @@ void Room::demon3McCoyFinishedHealingMiner() {
}
void Room::demon3GetMiner() {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM3\\DEM3_017#Dammit, Jim, I'm a doctor, not a bellhop. This man's too hurt to be moved.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_017);
}
void Room::demon3TalkToKirk() {
- const char *text1[] = {
- SPEAKER_KIRK,
- "#DEM3\\DEM3_002#A gateway to an alien race. The wonders of the galaxy are endless, aren't they, Mr. Spock?",
- ""
- };
- const char *text2[] = {
- SPEAKER_SPOCK,
- "#DEM3\\DEM3_029#Indeed, Captain.",
- ""
- };
- const char *text3[] = {
- SPEAKER_MCCOY,
- "#DEM3\\DEM3_026#They can also be damned cold.",
- ""
- };
- showRoomSpecificText(text1);
- showRoomSpecificText(text2);
- showRoomSpecificText(text3);
+ showText(TX_SPEAKER_KIRK, TX_DEM3_002);
+ showText(TX_SPEAKER_SPOCK, TX_DEM3_029);
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_026);
}
void Room::demon3TalkToSpock() {
- const char *text[] = {
- SPEAKER_SPOCK,
- "#DEM3\\DEM3_028#I recommend as thorough an analysis of this area as possible.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_SPOCK, TX_DEM3_028);
}
void Room::demon3TalkToMccoy() {
if (_vm->_awayMission.redshirtDead) {
- const char *text[] = {
- SPEAKER_MCCOY,
- "#DEM3\\DEM3_014#I'm sorry, Jim. Ensign Everts is beyond my help.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_014);
}
else {
- const char *text1[] = {
- SPEAKER_MCCOY,
- "#DEM3\\DEM3_025#Jim, the next time you need medical help on a snowball...",
- ""
- };
- const char *text2[] = {
- SPEAKER_KIRK,
- "#DEM3\\DEM3_003#Bones..",
- ""
- };
- const char *text3[] = {
- SPEAKER_MCCOY,
- "#DEM3\\DEM3_024#I'll probably end up coming along.",
- ""
- };
- showRoomSpecificText(text1);
- showRoomSpecificText(text2);
- showRoomSpecificText(text3);
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_025);
+ showText(TX_SPEAKER_KIRK, TX_DEM3_003);
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_024);
}
}
@@ -673,176 +491,80 @@ void Room::demon3TalkToMccoy() {
void Room::demon3TalkToRedshirt() {
// FIXME: this shouldn't work if he's dead. Should it check higher up whether that's
// the case?
- const char *text1[] = {
- SPEAKER_EVERTS,
- "#DEM3\\DEM3_036#No sign of demons, Klingons, or other hostiles, Captain. I promise I'll let you know the instant something appears.",
- ""
- };
- const char *text2[] = {
- SPEAKER_KIRK,
- "#DEM3\\DEM3_004#Don't be too anxious, Ensign. We may want to talk with them.",
- ""
- };
- showRoomSpecificText(text1);
- showRoomSpecificText(text2);
+ showText(TX_SPEAKER_EVERTS, TX_DEM3_036);
+ showText(TX_SPEAKER_KIRK, TX_DEM3_004);
}
void Room::demon3LookAtKirk() {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N004#James T. Kirk. Captain of the Enterprise.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N004);
}
void Room::demon3LookAtSpock() {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N001#Commander Spock; curious about what lies ahead.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N001);
}
void Room::demon3LookAtMccoy() {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N002#Doctor Leonard McCoy, glad that the cave provides some shelter from the breeze.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N002);
}
void Room::demon3LookAtRedshirt() {
if (_vm->_awayMission.redshirtDead) {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N017#Ensign Everts lies dead, crushed by the boulder.",
- ""
- };
- showRoomSpecificText(text);
- // NOTE: there's an alternate string that isn't used?
- // "#DEM3\\DEM3N018#The crushed body of Ensign Everts reminds you of your poor command judgement.",
+ showText(TX_DEM3N017);
+ // NOTE: there's an alternate string that isn't used? (TX_DEM3N018)
}
else {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N003#Ensign Everts, wary of more ambushes.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N003);
}
}
void Room::demon3LookAnywhere() {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N010#A cavern, deep in Mount Idyll.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N010);
}
void Room::demon3LookAtMiner() {
if (_vm->_awayMission.demon.healedMiner) {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N000#Brother Kandrey is barely conscious, and is lying still, trying to regain his strength.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N000);
}
else {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N006#One of the Acolytes, who was trapped by the the rockfall.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N006);
}
}
void Room::demon3LookAtBoulder1() {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N011#A huge boulder sits upon a large pile of rubble.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N011);
}
void Room::demon3LookAtBoulder2() {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N013#A large pile of rubble blocks what appears to be a large metallic structure.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N013);
}
void Room::demon3LookAtBoulder3() {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N013#A large pile of rubble blocks what appears to be a large metallic structure.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N013);
}
void Room::demon3LookAtBoulder4() {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N020#You notice what appears to be a man's arm sticking out from beneath the rubble.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N020);
}
void Room::demon3LookAtStructure() {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N016#A structure built into the surrounding rock. It must have been buried here for millennia.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N016);
}
void Room::demon3LookAtDoor() {
if (_vm->_awayMission.demon.doorOpened) {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N014#A long tunnel descends into the mountain.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N014);
}
else {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N012#A large metallic door is set in the structure.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N012);
}
}
void Room::demon3LookAtPanel() {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N019#This looks like some of the hand security panels on the Enterprise.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N019);
}
void Room::demon3LookAtLight() {
- const char *text[] = {
- nullptr,
- "#DEM3\\DEM3N015#A pulsing red light is set in the structure above the door.",
- ""
- };
- showRoomSpecificText(text);
+ showText(TX_DEM3N015);
}
}
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
new file mode 100644
index 0000000..5dfd6e2
--- /dev/null
+++ b/engines/startrek/text.h
@@ -0,0 +1,471 @@
+/* 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.
+ *
+ */
+
+#ifndef STARTREK_TEXT_H
+#define STARTREK_TEXT_H
+
+namespace StarTrek {
+
+enum GameStringIDs {
+ TX_NULL,
+ TX_BLANK,
+ TX_SPEAKER_KIRK,
+ TX_SPEAKER_SPOCK,
+ TX_SPEAKER_MCCOY,
+ TX_SPEAKER_UHURA,
+ TX_SPEAKER_EVERTS,
+
+ TX_SPEAKER_ANGIVEN,
+ TX_SPEAKER_SIGN,
+ TX_DEM0_016,
+ TX_DEM0_039,
+ TX_DEM0_017,
+ TX_DEM0_015,
+ TX_DEM0_013,
+ TX_DEM0_040,
+ TX_DEM0_036,
+ TX_DEM0_006,
+ TX_DEM0_008,
+ TX_DEM0_003,
+ TX_DEM0_038,
+ TX_DEM0_032,
+ TX_DEM0_033,
+ TX_DEM0_002,
+ TX_DEM0_005,
+ TX_DEM0_031,
+ TX_DEM0_010,
+ TX_DEM0_012,
+ TX_DEM0_035,
+ TX_DEM0_037,
+ TX_DEM0_034,
+ TX_DEM0N004,
+ TX_DEM0N008,
+ TX_DEM0N000,
+ TX_DEM0N006,
+ TX_DEM0N001,
+ TX_DEM0N007,
+ TX_DEM0N010,
+ TX_DEM0N009,
+ TX_DEM0N005,
+ TX_DEM0N002,
+ TX_DEM0N003,
+ TX_DEM0_019,
+ TX_DEM0_014,
+ TX_DEM0_011,
+ TX_DEM0_023,
+ TX_DEM0_029,
+ TX_DEM0_041,
+ TX_DEM0_043,
+ TX_DEM0_026,
+ TX_DEM0_042,
+ TX_DEM0_025,
+ TX_DEM0_007,
+ TX_DEM0_044,
+ TX_DEM0_009,
+ TX_DEM0_027,
+ TX_DEM0_004,
+ TX_DEM0_024,
+ TX_DEM0_030,
+ TX_DEM0_001,
+ TX_DEM0_022,
+ TX_DEM0_018,
+ TX_DEM0_021,
+ TX_DEM0_028,
+ TX_DEM0_020,
+ TX_DEM0C001, // "C" = "Custom" (no ID originally assigned)
+
+
+ TX_SPEAKER_KLINGON,
+ TX_DEM1_011,
+ TX_DEM1N020,
+ TX_DEM1_025,
+ TX_DEM1_F23,
+ TX_DEM1U077,
+ TX_DEM1_003,
+ TX_DEM1U078,
+ TX_DEM1_002,
+ TX_DEM1_020,
+ TX_DEM1_004,
+ TX_DEM1_021,
+ TX_DEM1_007,
+ TX_DEM1_008,
+ TX_DEM1_005,
+ TX_DEM1_006,
+ TX_DEM1_009,
+ TX_DEM1N018,
+ TX_DEM1N010,
+ TX_DEM1N019,
+ TX_DEM1N009,
+ TX_DEM1N011,
+ TX_DEM1N021,
+ TX_DEM1N016,
+ TX_DEM1N023,
+ TX_DEM1N017,
+ TX_DEM1N012,
+ TX_DEM1N015,
+ TX_DEM1N013,
+ TX_DEM1N014,
+ TX_DEM1N003,
+ TX_DEM1N001,
+ TX_DEM1N008,
+ TX_DEM1N002,
+ TX_DEM1N000,
+ TX_DEM1_018,
+ TX_DEM1N006,
+ TX_DEM1_012,
+ TX_DEM1_017,
+ TX_DEM1_019,
+ TX_DEM1_016,
+ TX_DEM1N005,
+ TX_DEM1N007,
+ TX_DEM1N004,
+ TX_DEM1_001,
+ TX_DEM1_022,
+ TX_DEM1_013,
+ TX_DEM1_024,
+ TX_DEM1_014,
+ TX_DEM1_015,
+ TX_DEM1_023,
+ TX_DEM1_026,
+
+
+ TX_DEM2N009,
+ TX_DEM2N007,
+ TX_DEM2N008,
+ TX_DEM2N012,
+ TX_DEM2N005,
+ TX_DEM2N010,
+ TX_DEM2N006,
+ TX_DEM2N011,
+ TX_DEM2_011,
+ TX_DEM2_008,
+ TX_DEM2_007,
+ TX_DEM2_006,
+ TX_DEM2_005,
+ TX_DEM2_013,
+ TX_DEM2_009,
+ TX_DEM2_010,
+ TX_DEM2_012,
+ TX_DEM2_014,
+ TX_DEM2N013,
+ TX_DEM2N002,
+ TX_DEM2N004,
+ TX_DEM2N003,
+ TX_DEM2N000,
+ TX_DEM2_001,
+ TX_DEM2_015,
+ TX_DEM2_017,
+ TX_DEM2_016,
+ TX_DEM2_019,
+ TX_DEM2_002,
+ TX_DEM2_020,
+ TX_DEM2_004,
+ TX_DEM2_018,
+ TX_DEM2_003,
+
+
+ TX_DEM3_013,
+ TX_DEM3_007,
+ TX_DEM3_006,
+ TX_DEM3_008,
+ TX_DEM3_009,
+ TX_DEM3_031,
+ TX_DEM3_030,
+ TX_DEM3_A32,
+ TX_DEM3_016,
+ TX_DEM3_005,
+ TX_DEM3_015,
+ TX_DEM3_014,
+ TX_DEM3N017,
+ TX_DEM3N010,
+ TX_DEM3N018,
+ TX_DEM3N011,
+ TX_DEM3N013,
+ TX_DEM3N020,
+ TX_DEM3N016,
+ TX_DEM3N012,
+ TX_DEM3N014,
+ TX_DEM3N019,
+ TX_DEM3N015,
+ TX_DEM3N004,
+ TX_DEM3N001,
+ TX_DEM3N002,
+ TX_DEM3N003,
+ TX_DEM3N006,
+ TX_DEM3N000,
+ TX_DEM3_002,
+ TX_DEM3_029,
+ TX_DEM3_026,
+ TX_DEM3_028,
+ TX_DEM3_025,
+ TX_DEM3_003,
+ TX_DEM3_024,
+ TX_DEM3_036,
+ TX_DEM3_004,
+ TX_DEM3_001,
+ TX_DEM3_020,
+ TX_DEM3_010,
+ TX_DEM3_023,
+ TX_DEM3_021,
+ TX_DEM3_022,
+ TX_DEM3_017,
+ TX_DEM3N005,
+ TX_DEM3_033,
+ TX_DEM3_035,
+ TX_DEM3_034,
+ TX_DEM3_B32,
+ TX_DEM3_018,
+ TX_DEM3_012,
+ TX_DEM3_027,
+ TX_DEM3N009,
+ TX_DEM3_011,
+ TX_DEM3N007,
+ TX_DEM3N008,
+ TX_DEM3_019,
+ TX_DEM3_F21,
+
+
+ TX_END
+};
+
+const char * const g_gameStrings[] = {
+ nullptr,
+ "",
+ "Capt. Kirk",
+ "Mr. Spock",
+ "Dr. McCoy",
+ "Lt. Uhura",
+ "Ensign Everts",
+
+ "Prel. Angiven",
+ "Sign",
+ "#DEM0\\DEM0_016#Captain, the flora on this planet is very interesting. I wonder how useful it may be for medicinal purposes.",
+ "#DEM0\\DEM0_039#Aw, Captain, please don't melt the snow. I've never seen it before.",
+ "#DEM0\\DEM0_017#Quite the vandal aren't we, Jim?",
+ "#DEM0\\DEM0_015#Burning down their house is not the best way to gain their confidence Jim!",
+ "#DEM0\\DEM0_013#Captain, Doctor McCoy is correct.",
+ "#DEM0\\DEM0_040#Is he always this trigger happy on ground missions?",
+ "#DEM0\\DEM0_036#This is so much better, gentlefolk. We are honored at your presence and hope you will find peace here in our haven.",
+ "#DEM0\\DEM0_006#I'm Captain James T. Kirk of the U.S.S. Enterprise. We have received word that alien lifeforms are creating problems at your mining facilities at Idyll Mountain. Tell me more.",
+ "#DEM0\\DEM0_008#Most High Prelate Angiven, I am honored to meet you. I consider it my divine duty to assist you in any possible way with the spawn of the devil.",
+ "#DEM0\\DEM0_003#Been seeing ghosts and bogeymen eh? I find that a little hard to believe.",
+ "#DEM0\\DEM0_038#Certainly, Captain Kirk. Not aliens, per se -- we have encountered what we believe are demons at Idyll Mountain, creatures surely emerging from the very gates of Hell. Our God would not test us thus without reason, so we believe your might and insight are our God's method to help us discover what is going on.",
+ "#DEM0\\DEM0_032#Captain Kirk. I had no idea we were blessed with one of our order in the ranks of Starfleet. We believe we have located the very Gates of Hell below Idyll Mountain.",
+ "#DEM0\\DEM0_033#Starfleet recognizes our freedom to worship and believe as we see fit, Captain. I am surprised that you do not share that feeling. Rest assured that Starfleet Command will be informed of your rudeness.",
+ "#DEM0\\DEM0_002#Aside from seeing demons, has any hard data been collected? Any evidence I could see?",
+ "#DEM0\\DEM0_005#Demons? Gates of Hell? This is the 23rd Century!",
+ "#DEM0\\DEM0_031#A skeptic would consider everything merely anecdotal or unproven. My people will gladly tell you their own stories, so you need not hear it secondhand through me.",
+ "#DEM0\\DEM0_010#What can you tell me about the mine itself?",
+ "#DEM0\\DEM0_012#You're wasting the time of a starship capable of destroying this planet with campfire stories? No wonder you were dumped out here in the middle of nowhere.",
+ "#DEM0\\DEM0_035#The area is exceptionally stable tectonically, and easy for our machinery to work in, praise God. We've mined for hafnium and a variety of useful trace elements. The deeper we dig, however, the more anomalous the variety of minerals seems to be. Our Ignaciate, Brother Stephen, has his own theories about why this might be. Either way, the anomalies inspired Brother Kandrey to conduct studies inside the mine. Yesterday, he reported discovering a strange door -- a gate to Hell, surely, for the demons caused a cave-in immediately. Kandrey was trapped, unconscious, and the demons prevent us from rescuing him. We can only hope he is still alive.",
+ "#DEM0\\DEM0_037#We need your help, Kirk. You may have no respect for our beliefs, but I hope you will look beyond that. Godspeed.",
+ "#DEM0\\DEM0_034#Thank you for your courtesy, Kirk. May you receive the guidance and protection of our God as you complete this divine mission.",
+ "#DEM0\\DEM0N004#High Prelate Angiven waits patiently for you to decide what you will do next.",
+ "#DEM0\\DEM0N008#Some colonists.",
+ "#DEM0\\DEM0N000#A beautiful, snow covered scene with a path leading off to Mount Idyll.",
+ "#DEM0\\DEM0N006#On the other side of the trees is Idyll Mountain. A tall, forbidding place. You have a vague feeling of danger.",
+ "#DEM0\\DEM0N001#A quickly constructed spartan shelter, primarily used by fledgling colonies.",
+ "#DEM0\\DEM0N007#Remnants of a recent snowfall cover the ground.",
+ "#DEM0\\DEM0N010#Various bushes and shrubs grow along the edge of the forest.",
+ "#DEM0\\DEM0N009#Spock raises an eyebrow.",
+ "#DEM0\\DEM0N005#James Tiberius Kirk, Captain of the Enterprise. He's always happy to run an errand of mercy.",
+ "#DEM0\\DEM0N002#Dr. Leonard McCoy, the finest doctor in Starfleet, wishes that he were on a warmer planet.",
+ "#DEM0\\DEM0N003#Ensign Everts, who has never been this close to snow before in his life, gazes with child-like fascination at the ground.",
+ "#DEM0\\DEM0_019#I don't know if the problem is real, the result of a new illness, or mass hysteria. But at the very least, there's an injured miner who needs my help.",
+ "#DEM0\\DEM0_014#Captain, demons and supernatural creatures are, almost by definition, illogical. Yet it is evident these people believe what they have seen. Barring illness or mass hysteria, I agree that a real problem seems to exist.",
+ "#DEM0\\DEM0_011#You look rather cold, Bones.",
+ "#DEM0\\DEM0_023#I'm not cold, I'm freezing! And that damn transporter just had to set me down in the middle of a snow drift!",
+ "#DEM0\\DEM0_029#A centimeter of snow does not technically constitute a drift, Doctor.",
+ "#DEM0\\DEM0_041#And doctors say that patients complain too much!",
+ "#DEM0\\DEM0_043#I've never seen snow like this before. This is great!",
+ "#DEM0\\DEM0_026#You mean you've never built a snowman, ensign?",
+ "#DEM0\\DEM0_042#I've never even thrown a snowball. Do you think anyone would mind?",
+ "#DEM0\\DEM0_025#Well...",
+ "#DEM0\\DEM0_007#Later Ensign. We have work to do.",
+ "#DEM0\\DEM0_044#Of course, sir.",
+ "#DEM0\\DEM0_009#This planet's as beautiful as everyone says it is.",
+ "#DEM0\\DEM0_027#The trees. The fresh air. The freezing cold...",
+ "#DEM0\\DEM0_004#C'mon Bones, the cold will improve your circulation.",
+ "#DEM0\\DEM0_024#Some people get too much circulation!",
+ "#DEM0\\DEM0_030#They are already gathered in the chapel, and will cooperate in any way with you. First door on my right.",
+ "#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?",
+ "#DEM0\\DEM0_022#The man's in perfect health.",
+ "#DEM0\\DEM0_018#His blood pressure's up a bit, but he believes he's telling the truth.",
+ "#DEM0\\DEM0_021#Jim, I am not picking up any unusual life here, just native lifeforms and the settlers. The colonists are all human, except for the one Tellarite. If there are demons here, they don't register on my tricorder.",
+ "#DEM0\\DEM0_028#Captain, reading the rocks in this area, I find that this locality may have been disturbed in the distant past. Recent disturbances created by the colonists' construction and mining prevent me from discovering anything further.",
+ "#DEM0\\DEM0_020#Jim! Are you out of your mind?",
+ "All mining equipment use this road.",
+
+
+ "Klingon",
+ "#DEM1\\DEM1_011#The fire fight is over, Jim. I think you can put that away now.",
+ "#DEM1\\DEM1N020#You see a small explosion, and the Klingon's hand falls to the ground with a dull thud.",
+ "#DEM1\\DEM1_025#I guess they don't make Klingons like they used to, Sir.",
+ "#DEM1\\DEM1_F23#Federation Scum!",
+ "#DEM1\\DEM1U077#Captain we registered Phaser fire and an unknown energy beam. Is everyone OK?",
+ "#DEM1\\DEM1_003#We're fine. Did you register any Disruptor fire?",
+ "#DEM1\\DEM1U078#No, Captain. Why, are Klingons down there?",
+ "#DEM1\\DEM1_002#No just an idea, Kirk out.",
+ "#DEM1\\DEM1_020#Fascinating. I begin to suspect that we have stumbled upon something that the colonists would never have uncovered.",
+ "#DEM1\\DEM1_004#What is it, Spock?",
+ "#DEM1\\DEM1_021#I wish to gather further data before making a definite conclusion, Captain.",
+ "#DEM1\\DEM1_007#Khytellian tulips are a perennial flower that survive in almost any climate.",
+ "#DEM1\\DEM1_008#The Brandzite pod is similar to terran milkweed except that the silk pods are in bright iridecent colors.",
+ "#DEM1\\DEM1_005#Doctis Cattails are similar to their terran name sake except that they are known to cause hives if in contact with flesh for any amount of time.",
+ "#DEM1\\DEM1_006#Gindorian ferns are regarded as an intergalactic weed, Captain.",
+ "#DEM1\\DEM1_009#He's only stunned. He'll be back up in a few seconds.",
+ "#DEM1\\DEM1N018#These are very beautiful Doctis Cattails.",
+ "#DEM1\\DEM1N010#A large patch of Khytellian Tulips.",
+ "#DEM1\\DEM1N019#These Brandzite Pods add a nice touch to the local flora.",
+ "#DEM1\\DEM1N009#A Gindorian Fern.",
+ "#DEM1\\DEM1N011#A small stream flows down towards the forest.",
+ "#DEM1\\DEM1N021#You see the mine entrance ahead.",
+ "#DEM1\\DEM1N016#Mt. Idyll rises above you.",
+ "#DEM1\\DEM1N023#It's the Klingon's detached hand!",
+ "#DEM1\\DEM1N017#The path is surrounded by some beautiful shrubbery.",
+ "#DEM1\\DEM1N012#Captain Kirk is unconscious.",
+ "#DEM1\\DEM1N015#Mr. Spock is unconscious.",
+ "#DEM1\\DEM1N013#Dr. McCoy is unconscious.",
+ "#DEM1\\DEM1N014#Ensign Everts is unconscious.",
+ "#DEM1\\DEM1N003#James Kirk, filled with a premonition of more dangers yet to come.",
+ "#DEM1\\DEM1N001#Dr. McCoy, still hoping the cold winds that whip around Mount Idyll will soon die down.",
+ "#DEM1\\DEM1N008#Your Vulcan science officer seems to be lost in thought, but remains alert.",
+ "#DEM1\\DEM1N002#Ensign Everts seems to be rattled by the attack of the Klingons.",
+ "#DEM1\\DEM1N000#Captain Kirk is fatally shot by a Klingon, game over.",
+ "#DEM1\\DEM1_018#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial. There is something different about this particular construct. Come here, Captain, look at the hand.It seems to have been separated from the body. There is a wiring circuit in the middle of the palm.",
+ "#DEM1\\DEM1N006#You find nothing new.",
+ "#DEM1\\DEM1_012#This is definitely not a real klingon Jim.",
+ "#DEM1\\DEM1_017#This is a detached hand with some kind of circuitry in the palm, Captain.",
+ "#DEM1\\DEM1_019#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial.",
+ "#DEM1\\DEM1_016#The circuit was damaged. It appears reparable, but some specialized equipment will be required.",
+ "#DEM1\\DEM1N005#You already took the hand from the Klingon.",
+ "#DEM1\\DEM1N007#You take the Klingon's detached hand.",
+ "#DEM1\\DEM1N004#They look like Klingons.",
+ "#DEM1\\DEM1_001#We were caught flat footed there. I don't want any more surprises to catch us off guard.",
+ "#DEM1\\DEM1_022#Captain, I detect a recent avalanche, approximately 6.2 kilometers away, that occurred within the last three days. The mountain may be quite dangerous.",
+ "#DEM1\\DEM1_013#Demons, Klingons, avalanches... What's next, the Wicked Witch of the West?",
+ "#DEM1\\DEM1_024#That is not logical, doctor.",
+ "#DEM1\\DEM1_014#It wasn't supposed to be logical, you green blooded Vulcan! Why does everything have to be so damned logical?",
+ "#DEM1\\DEM1_015#Well, we've seen Klingons. Now all we need is a few Romulans...",
+ "#DEM1\\DEM1_023#Control your thoughts, Doctor. There is a high probability that something here is using our own memories against us.",
+ "#DEM1\\DEM1_026#I guess this isn't such a great planet after all.",
+
+
+ "#DEM2\\DEM2N009#Mine entrance.",
+ "#DEM2\\DEM2N007#Idyll Mountain.",
+ "#DEM2\\DEM2N008#Idyll Mountain.",
+ "#DEM2\\DEM2N012#Various types of berries grow amongst the bushes.",
+ "#DEM2\\DEM2N005#A Gindorian fern.",
+ "#DEM2\\DEM2N010#Phequedian moss grows on the cave wall.",
+ "#DEM2\\DEM2N006#Feeble lights illuminate the mine tunnel.",
+ "#DEM2\\DEM2N011#The mine entrance goes deep into Mount Idyll.",
+ "#DEM2\\DEM2_011#Jim, you usually pick food and then cook it.",
+ "#DEM2\\DEM2_008#These seem to be Laraxian berries, Captain. They have several medicinal uses, but Dr. McCoy would know more.",
+ "#DEM2\\DEM2_007#The Phequedine moss extracts nourishment from hafnium, Captain.",
+ "#DEM2\\DEM2_006#Gindorian ferns are regarded as an intergalactic weed, Captain.",
+ "#DEM2\\DEM2_005#Captain, I'm having trouble getting reliable readings from inside the mountain. Unusual crystalline structures within the ore may be at fault, though I cannot say for certain.",
+ "#DEM2\\DEM2_013#These are the Laraxian Berries we used to cure Brother Chub.",
+ "#DEM2\\DEM2_009#Jim, these are Laraxian Berries that we used to make the Hypo-Dytoxin.",
+ "#DEM2\\DEM2_010#Jim, these are the berries we need to synthesize the Hypo-Dytoxin. We must get these to Brother Stephen quickly.",
+ "#DEM2\\DEM2_012#These are Laraxian Berries. From what I remember, certain chemical compounds in the berry can be used to treat Nugaireyn infections.",
+ "#DEM2\\DEM2_014#We don't need any more berries, Jim.",
+ "#DEM2\\DEM2N013#You have retrieved a sample of berries.",
+ "#DEM2\\DEM2N002#James T. Kirk. Always wondering what the next surprise will be.",
+ "#DEM2\\DEM2N004#Spock. Perhaps the most brilliant mind in Starfleet, pondering a most peculiar mystery.",
+ "#DEM2\\DEM2N003#Leonard McCoy. Hoping that the cave will be warmer than outside.",
+ "#DEM2\\DEM2N000#Ensign Everts. Keeping a sharp eye out for anything dangerous.",
+ "#DEM2\\DEM2_001#The answer to this mystery lies ahead of us, gentlemen.",
+ "#DEM2\\DEM2_015#Does your tricorder say the cave is warmer, Spock...",
+ "#DEM2\\DEM2_017#It is not logical for me to use my tricorder to determine the cave's temperature, doctor. I do not see what purpose it would serve.",
+ "#DEM2\\DEM2_016#Spock, everybody talks about the weather!",
+ "#DEM2\\DEM2_019#I'm sorry I let you down with those Klingons back there. I should have been paying more attention.",
+ "#DEM2\\DEM2_002#Just don't make that mistake again, Ensign.",
+ "#DEM2\\DEM2_020#Those Klingons give me the willies. They always have. My sister was wounded by them in the Chozon ambush.",
+ "#DEM2\\DEM2_004#We've all had our share of conflict with Klingons, Ensign. The Organians told me that one day Humans and Klingons will become good friends. I wonder if I'll ever live to see that day.",
+ "#DEM2\\DEM2_018#Whoever was trying to stop us may not stop with those Klingons, Captain. I recommend extreme caution.",
+ "#DEM2\\DEM2_003#The thought had occurred to me, Mr. Spock, but thank you for mentioning it.",
+
+
+ "#DEM3\\DEM3_013#He's already dead, Jim. Isn't that good enough for you?",
+ "#DEM3\\DEM3_007#Captain, the stun setting would be very ineffective on these boulders.",
+ "#DEM3\\DEM3_006#Captain, the structure is extremely unstable. I would not recommend disturbing the lower section before the upper sections have been cleared.",
+ "#DEM3\\DEM3_008#I think Doctor McCoy would be better suited to deal with this.",
+ "#DEM3\\DEM3_009#It appears to be a security lock designed to open the door when the correct hand print is registered.",
+ "#DEM3\\DEM3_031#Sir, it may be dangerous. Let me try it.",
+ "#DEM3\\DEM3_030#Sir, I think we should clear the rest of the rocks before we check out the device.",
+ "#DEM3\\DEM3_A32#Aieeee!",
+ "#DEM3\\DEM3_016#This is incredible, Jim. I'm picking up faint lifesign readings behind this door!",
+ "#DEM3\\DEM3_005#Captain, I would strongly recommend clearing all the debris first.",
+ "#DEM3\\DEM3_015#I've done all I can. He just needs rest now.",
+ "#DEM3\\DEM3_014#I'm sorry, Jim. Ensign Everts is beyond my help.",
+ "#DEM3\\DEM3N017#Ensign Everts lies dead, crushed by the boulder.",
+ "#DEM3\\DEM3N010#A cavern, deep in Mount Idyll.",
+ "#DEM3\\DEM3N018#The crushed body of Ensign Everts reminds you of your poor command judgement.",
+ "#DEM3\\DEM3N011#A huge boulder sits upon a large pile of rubble.",
+ "#DEM3\\DEM3N013#A large pile of rubble blocks what appears to be a large metallic structure.",
+ "#DEM3\\DEM3N020#You notice what appears to be a man's arm sticking out from beneath the rubble.",
+ "#DEM3\\DEM3N016#A structure built into the surrounding rock. It must have been buried here for millennia.",
+ "#DEM3\\DEM3N012#A large metallic door is set in the structure.",
+ "#DEM3\\DEM3N014#A long tunnel descends into the mountain.",
+ "#DEM3\\DEM3N019#This looks like some of the hand security panels on the Enterprise.",
+ "#DEM3\\DEM3N015#A pulsing red light is set in the structure above the door.",
+ "#DEM3\\DEM3N004#James T. Kirk. Captain of the Enterprise.",
+ "#DEM3\\DEM3N001#Commander Spock; curious about what lies ahead.",
+ "#DEM3\\DEM3N002#Doctor Leonard McCoy, glad that the cave provides some shelter from the breeze.",
+ "#DEM3\\DEM3N003#Ensign Everts, wary of more ambushes.",
+ "#DEM3\\DEM3N006#One of the Acolytes, who was trapped by the the rockfall.",
+ "#DEM3\\DEM3N000#Brother Kandrey is barely conscious, and is lying still, trying to regain his strength.",
+ "#DEM3\\DEM3_002#A gateway to an alien race. The wonders of the galaxy are endless, aren't they, Mr. Spock?",
+ "#DEM3\\DEM3_029#Indeed, Captain.",
+ "#DEM3\\DEM3_026#They can also be damned cold.",
+ "#DEM3\\DEM3_028#I recommend as thorough an analysis of this area as possible.",
+ "#DEM3\\DEM3_025#Jim, the next time you need medical help on a snowball...",
+ "#DEM3\\DEM3_003#Bones..",
+ "#DEM3\\DEM3_024#I'll probably end up coming along.",
+ "#DEM3\\DEM3_036#No sign of demons, Klingons, or other hostiles, Captain. I promise I'll let you know the instant something appears.",
+ "#DEM3\\DEM3_004#Don't be too anxious, Ensign. We may want to talk with them.",
+ "#DEM3\\DEM3_001#Assume firing positions.",
+ "#DEM3\\DEM3_020#I'm picking up weak vital signs. If we don't dig him out soon, we're going to lose him!",
+ "#DEM3\\DEM3_010#Captain, there are several weak points in the cave-in's structure. Careful use of our phasers, from the top down, should be able to clear it.",
+ "#DEM3\\DEM3_023#This man is badly hurt, and suffering from shock and exposure as well.",
+ "#DEM3\\DEM3_021#It was a near thing, but he'll live.",
+ "#DEM3\\DEM3_022#The miner is dead.",
+ "#DEM3\\DEM3_017#Dammit, Jim, I'm a doctor, not a bellhop. This man's too hurt to be moved.",
+ "#DEM3\\DEM3N005#Nothing happens.",
+ "#DEM3\\DEM3_033#I think I was shocked, sir.",
+ "#DEM3\\DEM3_035#That was definitely a mild shock.",
+ "#DEM3\\DEM3_034#Ouch, that hurt.",
+ "#DEM3\\DEM3_B32#Aieeeee.",
+ "#DEM3\\DEM3_018#He's dead Jim.",
+ "#DEM3\\DEM3_012#Fascinating, Captain. This door is made of an unknown material. It is clearly built by an alien race we have no knowledge of.",
+ "#DEM3\\DEM3_027#Fascinating... I'm registering low-intensity shielding unlike anything we've encountered before. That kept this door -- and whatever is behind it -- hidden from the ship's sensors and earlier tricorder readings.",
+ "#DEM3\\DEM3N009#There is no apparent effect.",
+ "#DEM3\\DEM3_011#Captain, this course of action is ineffectual.",
+ "#DEM3\\DEM3N007#The fit is perfect, but something seems to be shorting out.",
+ "#DEM3\\DEM3N008#The hand's circuitry triggers a connection, and the door opens.",
+ "#DEM3\\DEM3_019#He's dead, Jim...",
+ "#DEM3\\DEM3_F21#Oh, thank you, kind souls, for saving my life. Let me rest here for a little before returning to report this miracle to Prelate Angiven.",
+};
+
+}
+
+#endif
Commit: a6b87e84e7ef782f179f8c6a7abbdf9a1d388cf5
https://github.com/scummvm/scummvm/commit/a6b87e84e7ef782f179f8c6a7abbdf9a1d388cf5
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Talk to miner action in Demon3
Changed paths:
engines/startrek/room.h
engines/startrek/rooms/demon3.cpp
engines/startrek/rooms/function_map.h
engines/startrek/text.h
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 12468b5..a9aca44 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -288,6 +288,7 @@ public:
void demon3McCoyReachedMiner();
void demon3McCoyFinishedHealingMiner();
void demon3GetMiner();
+ void demon3TalkToMiner();
void demon3TalkToKirk();
void demon3TalkToSpock();
void demon3TalkToMccoy();
diff --git a/engines/startrek/rooms/demon3.cpp b/engines/startrek/rooms/demon3.cpp
index eb31f29..4a62282 100644
--- a/engines/startrek/rooms/demon3.cpp
+++ b/engines/startrek/rooms/demon3.cpp
@@ -466,6 +466,12 @@ void Room::demon3GetMiner() {
showText(TX_SPEAKER_MCCOY, TX_DEM3_017);
}
+void Room::demon3TalkToMiner() {
+ if (!_vm->_awayMission.demon.healedMiner)
+ return;
+ showText(TX_SPEAKER_KANDREY, TX_DEM3_F21);
+}
+
void Room::demon3TalkToKirk() {
showText(TX_SPEAKER_KIRK, TX_DEM3_002);
showText(TX_SPEAKER_SPOCK, TX_DEM3_029);
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 9c6c89f..fca7aaa 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -282,6 +282,7 @@ RoomAction demon3ActionList[] = {
{ Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::demon3McCoyFinishedHealingMiner },
{ Action(ACTION_GET, 13, 0, 0), &Room::demon3GetMiner },
+ { Action(ACTION_TALK, 13, 0, 0), &Room::demon3TalkToMiner },
{ Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::demon3TalkToKirk },
{ Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::demon3TalkToSpock },
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 5dfd6e2..e1a4864 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -36,6 +36,8 @@ enum GameStringIDs {
TX_SPEAKER_ANGIVEN,
TX_SPEAKER_SIGN,
+ TX_SPEAKER_KLINGON,
+ TX_SPEAKER_KANDREY,
TX_DEM0_016,
TX_DEM0_039,
TX_DEM0_017,
@@ -94,7 +96,6 @@ enum GameStringIDs {
TX_DEM0C001, // "C" = "Custom" (no ID originally assigned)
- TX_SPEAKER_KLINGON,
TX_DEM1_011,
TX_DEM1N020,
TX_DEM1_025,
@@ -258,6 +259,8 @@ const char * const g_gameStrings[] = {
"Prel. Angiven",
"Sign",
+ "Klingon",
+ "Brother Kandrey",
"#DEM0\\DEM0_016#Captain, the flora on this planet is very interesting. I wonder how useful it may be for medicinal purposes.",
"#DEM0\\DEM0_039#Aw, Captain, please don't melt the snow. I've never seen it before.",
"#DEM0\\DEM0_017#Quite the vandal aren't we, Jim?",
@@ -316,7 +319,6 @@ const char * const g_gameStrings[] = {
"All mining equipment use this road.",
- "Klingon",
"#DEM1\\DEM1_011#The fire fight is over, Jim. I think you can put that away now.",
"#DEM1\\DEM1N020#You see a small explosion, and the Klingon's hand falls to the ground with a dull thud.",
"#DEM1\\DEM1_025#I guess they don't make Klingons like they used to, Sir.",
Commit: 5b28ece2b5a4461cb0ef9c2fe24d73a35414a402
https://github.com/scummvm/scummvm/commit/5b28ece2b5a4461cb0ef9c2fe24d73a35414a402
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Begin with Demon4
Changed paths:
A engines/startrek/rooms/demon4.cpp
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 0265f4e..f352fb6 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -465,7 +465,7 @@ void StarTrekEngine::handleAwayMissionAction() {
int16 roomIndex = _room->readRdfWord(RDF_WARP_ROOM_INDICES + warpIndex * 2);
unloadRoom();
_sound->loadMusicFile("ground");
- loadRoom(_missionName, roomIndex);
+ loadRoom(_missionName, 4); // FIXME
initAwayCrewPositions(warpIndex ^ 1);
}
break;
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 178b788..15333da 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -45,9 +45,9 @@ struct AwayMission {
// If a bit in "crewDownBitset" is set, the corresponding timer in "crewGetupTimers"
// begins counting down. When it reaches 0, they get up.
- byte crewDownBitset;
+ byte crewDownBitset; // 0x24
- int8 crewDirectionsAfterWalk[4]; // Sets an object's direction after they finish walking somewhere?
+ int8 crewDirectionsAfterWalk[4]; // 0x25: Sets an object's direction after they finish walking somewhere?
// Mission-specific variables
union {
@@ -71,15 +71,19 @@ struct AwayMission {
byte field41; // 0x41
bool foundMiner; // 0x43
bool field45; // 0x45
+ bool field47; // 0x47
bool warpsDisabled; // 0x48
bool boulder1Gone; // 0x49
bool boulder2Gone; // 0x4a
bool boulder3Gone; // 0x4b
bool boulder4Gone; // 0x4c
bool doorOpened; // 0x4d
+ bool field4e; // 0x4e
+ byte field4f; // 0x4f
bool gotBerries; // 0x50
bool madeHypoDytoxin; // 0x51
byte field56; // 0x56
+ bool foundAlienRoom; // 0x57
} demon;
};
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index a374f80..79dd0ec 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -21,7 +21,8 @@ MODULE_OBJS = \
rooms/demon0.o \
rooms/demon1.o \
rooms/demon2.o \
- rooms/demon3.o
+ rooms/demon3.o \
+ rooms/demon4.o
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index d44ad96..2c181a5 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -53,6 +53,10 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_roomActionList = demon3ActionList;
_numRoomActions = sizeof(demon3ActionList) / sizeof(RoomAction);
}
+ else if (name == "DEMON4") {
+ _roomActionList = demon4ActionList;
+ _numRoomActions = sizeof(demon4ActionList) / sizeof(RoomAction);
+ }
else {
warning("Room \"%s\" unimplemented", name.c_str());
_numRoomActions = 0;
@@ -208,11 +212,11 @@ int Room::showText(int speaker, int text) {
textIDs[0] = speaker;
textIDs[1] = text;
textIDs[2] = TX_BLANK;
- showText(textIDs);
+ return showText(textIDs);
}
int Room::showText(int text) {
- showText(TX_NULL, text);
+ return showText(TX_NULL, text);
}
void Room::giveItem(int item) {
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index a9aca44..da93a1e 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -308,6 +308,32 @@ public:
void demon3LookAtPanel();
void demon3LookAtLight();
+ // DEMON4
+ void demon4Tick1();
+ void demon4FinishedAnimation1();
+ void demon4FinishedAnimation2();
+ void demon4FinishedAnimation3();
+ void demon4UsePhaserOnPanel();
+ void demon4UsePhaserOnPattern();
+ void demon4UsePhaserOnMccoy();
+ void demon4LookAtPattern();
+ void demon4LookAtAlien();
+ void demon4LookAnywhere();
+ void demon4LookAtSecurityEquipment();
+ void demon4LookAtFloor();
+ void demon4LookAtKirk();
+ void demon4LookAtMccoy();
+ void demon4LookAtSpock();
+ void demon4LookAtRedshirt();
+ void demon4LookAtChamber();
+ void demon4LookAtPanel();
+ void demon4UseKirkOnPanel();
+ void demon4UseSpockOnPanel();
+ void demon4UseMccoyOnPanel();
+ void demon4UseRedshirtOnPanel();
+ void demon4UseCrewmanOnPanel();
+ void demon4CrewmanReachedPanel();
+
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
@@ -331,6 +357,11 @@ private:
char boulderAnim[10]; // 0xd4
int16 usedPhaserOnDoor; // 0xd6
} demon3;
+
+ struct {
+ bool cb; // 0xcb
+ int16 crewmanUsingPanel; // 0xcf
+ } demon4;
} _roomVar;
};
diff --git a/engines/startrek/rooms/demon4.cpp b/engines/startrek/rooms/demon4.cpp
new file mode 100644
index 0000000..3596761
--- /dev/null
+++ b/engines/startrek/rooms/demon4.cpp
@@ -0,0 +1,147 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+void Room::demon4Tick1() {
+ playVoc("DEM4LOOP");
+
+ if (!_vm->_awayMission.demon.healedMiner)
+ _vm->_awayMission.demon.minerDead = true;
+
+ if (_vm->_awayMission.demon.field4e) {
+ loadActorAnim(10, "bxrise2", 0x122, 0x91, 0);
+ loadActorAnim(8, "stpout2", 0x107, 0x92, 0);
+ _roomVar.demon4.cb = true;
+
+ if ((_vm->_awayMission.demon.field4f & 0x10) && !_vm->_awayMission.demon.field47)
+ _vm->_awayMission.timers[6] = 20;
+ }
+
+ if (!_vm->_awayMission.demon.foundAlienRoom) {
+ _vm->_awayMission.demon.foundAlienRoom = true;
+ playMidiMusicTracks(1, -1);
+ }
+}
+
+void Room::demon4FinishedAnimation1() {
+ // TODO
+}
+
+void Room::demon4FinishedAnimation2() {
+}
+
+void Room::demon4FinishedAnimation3() {
+}
+
+void Room::demon4UsePhaserOnPanel() {
+ showText(TX_SPEAKER_SPOCK, TX_DEM4_013);
+}
+
+void Room::demon4UsePhaserOnPattern() {
+ showText(TX_SPEAKER_SPOCK, TX_DEM4_045);
+}
+
+void Room::demon4UsePhaserOnMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_DEM4_018);
+}
+
+void Room::demon4LookAtPattern() {
+ showText(TX_DEM4N002);
+
+}
+
+void Room::demon4LookAtAlien() {
+ showText(TX_DEM4N007);
+}
+
+void Room::demon4LookAnywhere() {
+ showText(TX_DEM4N004);
+}
+
+void Room::demon4LookAtSecurityEquipment() {
+ showText(TX_DEM4N008);
+}
+
+void Room::demon4LookAtFloor() {
+ showText(TX_DEM4N009);
+}
+
+void Room::demon4LookAtKirk() {
+ showText(TX_DEM4N003);
+}
+
+void Room::demon4LookAtMccoy() {
+ showText(TX_DEM4N000);
+}
+
+void Room::demon4LookAtSpock() {
+ showText(TX_DEM4N005);
+}
+
+void Room::demon4LookAtRedshirt() {
+ showText(TX_DEM4N001);
+}
+
+void Room::demon4LookAtChamber() {
+ showText(TX_DEM4N006);
+}
+
+void Room::demon4LookAtPanel() {
+ showText(TX_DEM4N012);
+}
+
+void Room::demon4UseKirkOnPanel() {
+ _roomVar.demon4.crewmanUsingPanel = OBJECT_KIRK;
+ demon4UseCrewmanOnPanel();
+}
+
+void Room::demon4UseSpockOnPanel() {
+ _roomVar.demon4.crewmanUsingPanel = OBJECT_SPOCK;
+ demon4UseCrewmanOnPanel();
+}
+
+void Room::demon4UseMccoyOnPanel() {
+ _roomVar.demon4.crewmanUsingPanel = OBJECT_MCCOY;
+ demon4UseCrewmanOnPanel();
+}
+
+void Room::demon4UseRedshirtOnPanel() {
+ _roomVar.demon4.crewmanUsingPanel = OBJECT_REDSHIRT;
+ demon4UseCrewmanOnPanel();
+}
+
+void Room::demon4UseCrewmanOnPanel() {
+ if (_vm->_awayMission.demon.field4e)
+ return;
+ walkCrewman(_roomVar.demon4.crewmanUsingPanel, 0xda, 0x83, 3);
+ _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.demon4.crewmanUsingPanel] = DIR_N;
+ _vm->_awayMission.transitioningIntoRoom = true;
+}
+
+void Room::demon4CrewmanReachedPanel() {
+ // TODO: puzzle implementation
+}
+
+}
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index fca7aaa..1761bda 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -309,6 +309,41 @@ RoomAction demon3ActionList[] = {
};
+RoomAction demon4ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::demon4Tick1 },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::demon4FinishedAnimation1 },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::demon4FinishedAnimation2 },
+ { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::demon4FinishedAnimation3 },
+
+ // TODO: everything
+
+ { Action(ACTION_USE, OBJECT_IPHASERS, 0x21, 0), &Room::demon4UsePhaserOnPanel },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 0x20, 0), &Room::demon4UsePhaserOnPattern },
+ { Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_MCCOY, 0), &Room::demon4UsePhaserOnMccoy },
+
+ // TODO
+
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon4LookAtPattern },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::demon4LookAtAlien },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::demon4LookAnywhere },
+ { Action(ACTION_LOOK, 0x22, 0, 0), &Room::demon4LookAtSecurityEquipment },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::demon4LookAtFloor },
+
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::demon4LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::demon4LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::demon4LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::demon4LookAtRedshirt },
+
+ { Action(ACTION_LOOK, 10, 0, 0), &Room::demon4LookAtChamber },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::demon4LookAtPanel },
+
+ { Action(ACTION_USE, OBJECT_KIRK, 0x21, 0), &Room::demon4UseKirkOnPanel },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x21, 0), &Room::demon4UseSpockOnPanel },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x21, 0), &Room::demon4UseMccoyOnPanel },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x21, 0), &Room::demon4UseRedshirtOnPanel },
+ { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::demon4CrewmanReachedPanel },
+};
+
}
#endif
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index e1a4864..f23736b 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -245,6 +245,68 @@ enum GameStringIDs {
TX_DEM3_F21,
+ TX_DEM4_010,
+ TX_DEM4_035,
+ TX_DEM4_030,
+ TX_DEM4_011,
+ TX_DEM4N014,
+ TX_DEM4_031,
+ TX_DEM4N012,
+ TX_DEM4N013,
+ TX_DEM4_001,
+ TX_DEM4_012,
+ TX_DEM4_044,
+ TX_DEM4_002,
+ TX_DEM4_004,
+ TX_DEM4_009,
+ TX_DEM4_042,
+ TX_DEM4_043,
+ TX_DEM4_039,
+ TX_DEM4_008,
+ TX_DEM4_007,
+ TX_DEM4_041,
+ TX_DEM4_040,
+ TX_DEM4_038,
+ TX_DEM4_037,
+ TX_DEM4N002,
+ TX_DEM4N010,
+ TX_DEM4N008,
+ TX_DEM4N007,
+ TX_DEM4N000,
+ TX_DEM4N005,
+ TX_DEM4N001,
+ TX_DEM4N004,
+ TX_DEM4N003,
+ TX_DEM4_015,
+ TX_DEM4_024,
+ TX_DEM4_046,
+ TX_DEM4_019,
+ TX_DEM4_022,
+ TX_DEM4_047,
+ TX_DEM4_021,
+ TX_DEM4_020,
+ TX_DEM4_014,
+ TX_DEM4_025,
+ TX_DEM4_023,
+ TX_DEM4_027,
+ TX_DEM4_026,
+ TX_DEM4_029,
+ TX_DEM4_033,
+ TX_DEM4_032,
+ TX_DEM4_013,
+ TX_DEM4_045,
+ TX_DEM4_018,
+ TX_DEM4N011,
+ TX_DEM4_034,
+ TX_DEM4_017,
+ TX_DEM4_036,
+ TX_DEM4_006,
+ TX_DEM4_003,
+ TX_DEM4_005,
+ TX_DEM4N009,
+ TX_DEM4N006,
+
+
TX_END
};
@@ -466,6 +528,68 @@ const char * const g_gameStrings[] = {
"#DEM3\\DEM3N008#The hand's circuitry triggers a connection, and the door opens.",
"#DEM3\\DEM3_019#He's dead, Jim...",
"#DEM3\\DEM3_F21#Oh, thank you, kind souls, for saving my life. Let me rest here for a little before returning to report this miracle to Prelate Angiven.",
+
+
+ "#DEM4\\DEM4_010#I would be glad to accept your application to the Federation. We shall have a diplomatic envoy sent to make the final arrangements.",
+ "#DEM4\\DEM4_035#We look forward to meeting them. We also look forward to having discourse with the colonists. Farewell. May the Holy One bless you.",
+ "#DEM4\\DEM4_030#Live long and prosper.",
+ "#DEM4\\DEM4_011#Kirk to Enterprise... Beam us up, Mr. Scott.",
+ "#DEM4\\DEM4N014#You fit the key into the slot, but you cannot find a way to turn it.",
+ "#DEM4\\DEM4_031#Have you found the key?",
+ "#DEM4\\DEM4N012#It looks like a control panel with slide switches.",
+ "#DEM4\\DEM4N013#Nothing Happens.",
+ "#DEM4\\DEM4_001#I think we've found the answer to our mystery.",
+ "#DEM4\\DEM4_012#This seems to be a Cryogenic Suspension chamber, Captain.",
+ "#DEM4\\DEM4_044#Welcome to our home. Thank you for repairing our Sonambutron.",
+ "#DEM4\\DEM4_002#Stop! You're trespassing on Federation territory.",
+ "#DEM4\\DEM4_004#I welcome you on behalf of the United Federation of Planets. Who are you? Where do you come from?",
+ "#DEM4\\DEM4_009#We did fix your machine. Can we write the repair bill off against rent on this land?",
+ "#DEM4\\DEM4_042#Violence is hardly necessary, Captain Kirk. We owe you a debt for your service to us, and are more than willing to peacefully co-exist with your kind.",
+ "#DEM4\\DEM4_043#We call ourselves Nauians. Thousands of years ago, we saw that meteor impacts were going to cause an Ice Age. We created this huge underground shelter to preserve our race, keeping us in suspended animation until the planet had recovered. We programmed the machinery to revive us at the next eclipse, but we did not count on the destruction of our moon.",
+ "#DEM4\\DEM4_039#So the Ferengi are not the only traders in the universe! Yes, Captain Kirk, excusing the settlers' debts is an excellent way of ensuring that our people will be friends.",
+ "#DEM4\\DEM4_008#Some advanced civilization!",
+ "#DEM4\\DEM4_007#Perhaps you can tell us about the demons.",
+ "#DEM4\\DEM4_041#There is no need for disrespect, intruder. Our race is old and powerful, wise in many things. Like our guardians, for example.",
+ "#DEM4\\DEM4_040#The demons, as you call them, are created by a machine designed to keep intruders away from our sleep chambers. It pulls from the minds of any approaching creature their most feared enemy and produces replicas to scare them away. For you and your crew it was Klingons, for the Tellarite a wolf-demon, and for the other Humans a demon from their religion. On behalf of my people, thank you for waking us. I will turn off the machinery which creates our guardians, so that they no longer bedevil those with whom we now share our home.",
+ "#DEM4\\DEM4_038#Oh woe! Alas! The key is missing, I can do nothing! Even we will suffer the attacks of our own guardians unless the key can be found! I implore you, if you can help, please do so.",
+ "#DEM4\\DEM4_037#I see you have already shut off the machinery that creates the guardians. I have no way to thank you, Captain, but please carry this request from my people to yours. We have much ancient knowledge we can share, and we would like to join your Federation. Go in peace.",
+ "#DEM4\\DEM4N002#It appears to be an abstract piece of alien art.",
+ "#DEM4\\DEM4N010#This is where the panel should pop up.",
+ "#DEM4\\DEM4N008#This appears to control some unusual security equipment.",
+ "#DEM4\\DEM4N007#The alien is humanoid, with green reptilian skin. It appears unarmed.",
+ "#DEM4\\DEM4N000#Dr. McCoy looks back.",
+ "#DEM4\\DEM4N005#Spock is analyzing the alien machines.",
+ "#DEM4\\DEM4N001#Ensign Everts is looking around.",
+ "#DEM4\\DEM4N004#Many alien machines fill the room.",
+ "#DEM4\\DEM4N003#James T. Kirk, Captain of the Enterprise.",
+ "#DEM4\\DEM4_015#I wonder who, or what, constructed all this.",
+ "#DEM4\\DEM4_024#Logically, the machinery is sustaining some type of life in suspended animation. If we can reactivate the machines, then we may be able to meet its creators.",
+ "#DEM4\\DEM4_046#I'm just a security officer, sir.",
+ "#DEM4\\DEM4_019#Perhaps we should try to communicate with the alien.",
+ "#DEM4\\DEM4_022#Fascinating. this lifeform may represent what would have happened had the dinosaurs of your earth not become extinct.",
+ "#DEM4\\DEM4_047#What is that?",
+ "#DEM4\\DEM4_021#You should ask Spock, Jim.",
+ "#DEM4\\DEM4_020#This is a very old and very complex life-support system. It appears to still be operational.",
+ "#DEM4\\DEM4_014#Fascinating, Captain. It is a diagram of a lunar eclipse of this planet. See how the red ball, the moon, is casting a shadow on the blue ball, Pollux V. This must be a very old piece of work, because this planet's moon was destroyed thousands of years ago.",
+ "#DEM4\\DEM4_025#The machinery is waiting for the gravitational pull of another eclipse to activate it, an eclipse that will never come. And one other thing, Captain. This may also be a diagram showing the proper settings on that control panel.",
+ "#DEM4\\DEM4_023#It is an alien life-support system, Captain, utilizing geothermal energy. It is still functioning, waiting for some sort of signal.",
+ "#DEM4\\DEM4_027#This control panel is a manual override for the alien life-support equipment.",
+ "#DEM4\\DEM4_026#This alien construction takes readings of mental activity. It also activates manufacturing equipment related to security, and includes a short-distance transportation device.",
+ "#DEM4\\DEM4_029#This lifeform appears to be intelligent, a new sentient race. There appear to be resemblances between it and the silotis, although the present forms are quite small and definitely nonsentient.",
+ "#DEM4\\DEM4_033#There is no need for violence, Captain. We are a peaceful people.",
+ "#DEM4\\DEM4_032#Our patience is exhausted! Now feel our wrath!",
+ "#DEM4\\DEM4_013#Captain, Starfleet would not be pleased.",
+ "#DEM4\\DEM4_045#I do not think that would be a prudent action, sir.",
+ "#DEM4\\DEM4_018#Ouch!",
+ "#DEM4\\DEM4N011#You meet your death at the hands of a race that could have been your ally. What a waste. Better luck next time.",
+ "#DEM4\\DEM4_034#You found the key! I can now turn off the machinery creating our guardians, and no more sentients shall be at risk. Surely the Holy One smiles upon us all. I have no way to thank you, Captain, but please carry this request from my people to yours. We have much ancient knowledge we can share, and we would like to join your Federation. Go in peace.",
+ "#DEM4\\DEM4_017#Jim, think about that skull we picked up from Brother Stephen. Now look at this alien. See the resemblance?",
+ "#DEM4\\DEM4_036#A child? No, I see many differences. This must be what our people who did not slumber have become. Still, I would like to see these remains properly interred, according to the precepts of our religion. May I keep this?",
+ "#DEM4\\DEM4_006#Of course. I think you will get along well with the Pollux inhabitants, and I'm sure you will have interesting theological discussions.",
+ "#DEM4\\DEM4_003#I think I should return it to where I got it from.",
+ "#DEM4\\DEM4_005#No, I want to keep it as a memento for myself.",
+ "#DEM4\\DEM4N009#This floor contains conduits for conducting geothermal energy.",
+ "#DEM4\\DEM4N006#The alien emerged from this metal chamber.",
};
}
Commit: 2e80a35e08bf360a65592784631425e5d1081d65
https://github.com/scummvm/scummvm/commit/2e80a35e08bf360a65592784631425e5d1081d65
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Sort text alphabetically by ID
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index f352fb6..0265f4e 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -465,7 +465,7 @@ void StarTrekEngine::handleAwayMissionAction() {
int16 roomIndex = _room->readRdfWord(RDF_WARP_ROOM_INDICES + warpIndex * 2);
unloadRoom();
_sound->loadMusicFile("ground");
- loadRoom(_missionName, 4); // FIXME
+ loadRoom(_missionName, roomIndex);
initAwayCrewPositions(warpIndex ^ 1);
}
break;
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index f23736b..e352bad 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -32,279 +32,280 @@ enum GameStringIDs {
TX_SPEAKER_SPOCK,
TX_SPEAKER_MCCOY,
TX_SPEAKER_UHURA,
- TX_SPEAKER_EVERTS,
+ TX_SPEAKER_EVERTS,
TX_SPEAKER_ANGIVEN,
TX_SPEAKER_SIGN,
TX_SPEAKER_KLINGON,
TX_SPEAKER_KANDREY,
- TX_DEM0_016,
- TX_DEM0_039,
- TX_DEM0_017,
- TX_DEM0_015,
- TX_DEM0_013,
- TX_DEM0_040,
- TX_DEM0_036,
- TX_DEM0_006,
- TX_DEM0_008,
- TX_DEM0_003,
- TX_DEM0_038,
- TX_DEM0_032,
- TX_DEM0_033,
+
+ TX_DEM0_001,
TX_DEM0_002,
+ TX_DEM0_003,
+ TX_DEM0_004,
TX_DEM0_005,
- TX_DEM0_031,
+ TX_DEM0_006,
+ TX_DEM0_007,
+ TX_DEM0_008,
+ TX_DEM0_009,
TX_DEM0_010,
+ TX_DEM0_011,
TX_DEM0_012,
- TX_DEM0_035,
- TX_DEM0_037,
- TX_DEM0_034,
- TX_DEM0N004,
- TX_DEM0N008,
- TX_DEM0N000,
- TX_DEM0N006,
- TX_DEM0N001,
- TX_DEM0N007,
- TX_DEM0N010,
- TX_DEM0N009,
- TX_DEM0N005,
- TX_DEM0N002,
- TX_DEM0N003,
- TX_DEM0_019,
+ TX_DEM0_013,
TX_DEM0_014,
- TX_DEM0_011,
+ TX_DEM0_015,
+ TX_DEM0_016,
+ TX_DEM0_017,
+ TX_DEM0_018,
+ TX_DEM0_019,
+ TX_DEM0_020,
+ TX_DEM0_021,
+ TX_DEM0_022,
TX_DEM0_023,
+ TX_DEM0_024,
+ TX_DEM0_025,
+ TX_DEM0_026,
+ TX_DEM0_027,
+ TX_DEM0_028,
TX_DEM0_029,
+ TX_DEM0_030,
+ TX_DEM0_031,
+ TX_DEM0_032,
+ TX_DEM0_033,
+ TX_DEM0_034,
+ TX_DEM0_035,
+ TX_DEM0_036,
+ TX_DEM0_037,
+ TX_DEM0_038,
+ TX_DEM0_039,
+ TX_DEM0_040,
TX_DEM0_041,
- TX_DEM0_043,
- TX_DEM0_026,
TX_DEM0_042,
- TX_DEM0_025,
- TX_DEM0_007,
+ TX_DEM0_043,
TX_DEM0_044,
- TX_DEM0_009,
- TX_DEM0_027,
- TX_DEM0_004,
- TX_DEM0_024,
- TX_DEM0_030,
- TX_DEM0_001,
- TX_DEM0_022,
- TX_DEM0_018,
- TX_DEM0_021,
- TX_DEM0_028,
- TX_DEM0_020,
+ TX_DEM0N000,
+ TX_DEM0N001,
+ TX_DEM0N002,
+ TX_DEM0N003,
+ TX_DEM0N004,
+ TX_DEM0N005,
+ TX_DEM0N006,
+ TX_DEM0N007,
+ TX_DEM0N008,
+ TX_DEM0N009,
+ TX_DEM0N010,
TX_DEM0C001, // "C" = "Custom" (no ID originally assigned)
- TX_DEM1_011,
- TX_DEM1N020,
- TX_DEM1_025,
- TX_DEM1_F23,
- TX_DEM1U077,
- TX_DEM1_003,
- TX_DEM1U078,
+ TX_DEM1_001,
TX_DEM1_002,
- TX_DEM1_020,
+ TX_DEM1_003,
TX_DEM1_004,
- TX_DEM1_021,
- TX_DEM1_007,
- TX_DEM1_008,
TX_DEM1_005,
TX_DEM1_006,
+ TX_DEM1_007,
+ TX_DEM1_008,
TX_DEM1_009,
- TX_DEM1N018,
- TX_DEM1N010,
- TX_DEM1N019,
- TX_DEM1N009,
- TX_DEM1N011,
- TX_DEM1N021,
- TX_DEM1N016,
- TX_DEM1N023,
- TX_DEM1N017,
- TX_DEM1N012,
- TX_DEM1N015,
- TX_DEM1N013,
- TX_DEM1N014,
- TX_DEM1N003,
- TX_DEM1N001,
- TX_DEM1N008,
- TX_DEM1N002,
- TX_DEM1N000,
- TX_DEM1_018,
- TX_DEM1N006,
+ TX_DEM1_011,
TX_DEM1_012,
- TX_DEM1_017,
- TX_DEM1_019,
- TX_DEM1_016,
- TX_DEM1N005,
- TX_DEM1N007,
- TX_DEM1N004,
- TX_DEM1_001,
- TX_DEM1_022,
TX_DEM1_013,
- TX_DEM1_024,
TX_DEM1_014,
TX_DEM1_015,
+ TX_DEM1_016,
+ TX_DEM1_017,
+ TX_DEM1_018,
+ TX_DEM1_019,
+ TX_DEM1_020,
+ TX_DEM1_021,
+ TX_DEM1_022,
TX_DEM1_023,
+ TX_DEM1_024,
+ TX_DEM1_025,
TX_DEM1_026,
+ TX_DEM1_F23,
+ TX_DEM1N000,
+ TX_DEM1N001,
+ TX_DEM1N002,
+ TX_DEM1N003,
+ TX_DEM1N004,
+ TX_DEM1N005,
+ TX_DEM1N006,
+ TX_DEM1N007,
+ TX_DEM1N008,
+ TX_DEM1N009,
+ TX_DEM1N010,
+ TX_DEM1N011,
+ TX_DEM1N012,
+ TX_DEM1N013,
+ TX_DEM1N014,
+ TX_DEM1N015,
+ TX_DEM1N016,
+ TX_DEM1N017,
+ TX_DEM1N018,
+ TX_DEM1N019,
+ TX_DEM1N020,
+ TX_DEM1N021,
+ TX_DEM1N023,
+ TX_DEM1U077,
+ TX_DEM1U078,
- TX_DEM2N009,
- TX_DEM2N007,
- TX_DEM2N008,
- TX_DEM2N012,
- TX_DEM2N005,
- TX_DEM2N010,
- TX_DEM2N006,
- TX_DEM2N011,
- TX_DEM2_011,
- TX_DEM2_008,
- TX_DEM2_007,
- TX_DEM2_006,
+ TX_DEM2_001,
+ TX_DEM2_002,
+ TX_DEM2_003,
+ TX_DEM2_004,
TX_DEM2_005,
- TX_DEM2_013,
+ TX_DEM2_006,
+ TX_DEM2_007,
+ TX_DEM2_008,
TX_DEM2_009,
TX_DEM2_010,
+ TX_DEM2_011,
TX_DEM2_012,
+ TX_DEM2_013,
TX_DEM2_014,
- TX_DEM2N013,
- TX_DEM2N002,
- TX_DEM2N004,
- TX_DEM2N003,
- TX_DEM2N000,
- TX_DEM2_001,
TX_DEM2_015,
- TX_DEM2_017,
TX_DEM2_016,
+ TX_DEM2_017,
+ TX_DEM2_018,
TX_DEM2_019,
- TX_DEM2_002,
TX_DEM2_020,
- TX_DEM2_004,
- TX_DEM2_018,
- TX_DEM2_003,
+ TX_DEM2N000,
+ TX_DEM2N002,
+ TX_DEM2N003,
+ TX_DEM2N004,
+ TX_DEM2N005,
+ TX_DEM2N006,
+ TX_DEM2N007,
+ TX_DEM2N008,
+ TX_DEM2N009,
+ TX_DEM2N010,
+ TX_DEM2N011,
+ TX_DEM2N012,
+ TX_DEM2N013,
- TX_DEM3_013,
- TX_DEM3_007,
+ TX_DEM3_001,
+ TX_DEM3_002,
+ TX_DEM3_003,
+ TX_DEM3_004,
+ TX_DEM3_005,
TX_DEM3_006,
+ TX_DEM3_007,
TX_DEM3_008,
TX_DEM3_009,
- TX_DEM3_031,
+ TX_DEM3_010,
+ TX_DEM3_011,
+ TX_DEM3_012,
+ TX_DEM3_013,
+ TX_DEM3_014,
+ TX_DEM3_015,
+ TX_DEM3_016,
+ TX_DEM3_017,
+ TX_DEM3_018,
+ TX_DEM3_019,
+ TX_DEM3_020,
+ TX_DEM3_021,
+ TX_DEM3_022,
+ TX_DEM3_023,
+ TX_DEM3_024,
+ TX_DEM3_025,
+ TX_DEM3_026,
+ TX_DEM3_027,
+ TX_DEM3_028,
+ TX_DEM3_029,
TX_DEM3_030,
+ TX_DEM3_031,
+ TX_DEM3_033,
+ TX_DEM3_034,
+ TX_DEM3_035,
+ TX_DEM3_036,
TX_DEM3_A32,
- TX_DEM3_016,
- TX_DEM3_005,
- TX_DEM3_015,
- TX_DEM3_014,
- TX_DEM3N017,
- TX_DEM3N010,
- TX_DEM3N018,
- TX_DEM3N011,
- TX_DEM3N013,
- TX_DEM3N020,
- TX_DEM3N016,
- TX_DEM3N012,
- TX_DEM3N014,
- TX_DEM3N019,
- TX_DEM3N015,
- TX_DEM3N004,
+ TX_DEM3_B32,
+ TX_DEM3_F21,
+ TX_DEM3N000,
TX_DEM3N001,
TX_DEM3N002,
TX_DEM3N003,
- TX_DEM3N006,
- TX_DEM3N000,
- TX_DEM3_002,
- TX_DEM3_029,
- TX_DEM3_026,
- TX_DEM3_028,
- TX_DEM3_025,
- TX_DEM3_003,
- TX_DEM3_024,
- TX_DEM3_036,
- TX_DEM3_004,
- TX_DEM3_001,
- TX_DEM3_020,
- TX_DEM3_010,
- TX_DEM3_023,
- TX_DEM3_021,
- TX_DEM3_022,
- TX_DEM3_017,
+ TX_DEM3N004,
TX_DEM3N005,
- TX_DEM3_033,
- TX_DEM3_035,
- TX_DEM3_034,
- TX_DEM3_B32,
- TX_DEM3_018,
- TX_DEM3_012,
- TX_DEM3_027,
- TX_DEM3N009,
- TX_DEM3_011,
+ TX_DEM3N006,
TX_DEM3N007,
TX_DEM3N008,
- TX_DEM3_019,
- TX_DEM3_F21,
+ TX_DEM3N009,
+ TX_DEM3N010,
+ TX_DEM3N011,
+ TX_DEM3N012,
+ TX_DEM3N013,
+ TX_DEM3N014,
+ TX_DEM3N015,
+ TX_DEM3N016,
+ TX_DEM3N017,
+ TX_DEM3N018,
+ TX_DEM3N019,
+ TX_DEM3N020,
- TX_DEM4_010,
- TX_DEM4_035,
- TX_DEM4_030,
- TX_DEM4_011,
- TX_DEM4N014,
- TX_DEM4_031,
- TX_DEM4N012,
- TX_DEM4N013,
TX_DEM4_001,
- TX_DEM4_012,
- TX_DEM4_044,
TX_DEM4_002,
+ TX_DEM4_003,
TX_DEM4_004,
- TX_DEM4_009,
- TX_DEM4_042,
- TX_DEM4_043,
- TX_DEM4_039,
- TX_DEM4_008,
+ TX_DEM4_005,
+ TX_DEM4_006,
TX_DEM4_007,
- TX_DEM4_041,
- TX_DEM4_040,
- TX_DEM4_038,
- TX_DEM4_037,
- TX_DEM4N002,
- TX_DEM4N010,
- TX_DEM4N008,
- TX_DEM4N007,
- TX_DEM4N000,
- TX_DEM4N005,
- TX_DEM4N001,
- TX_DEM4N004,
- TX_DEM4N003,
+ TX_DEM4_008,
+ TX_DEM4_009,
+ TX_DEM4_010,
+ TX_DEM4_011,
+ TX_DEM4_012,
+ TX_DEM4_013,
+ TX_DEM4_014,
TX_DEM4_015,
- TX_DEM4_024,
- TX_DEM4_046,
+ TX_DEM4_017,
+ TX_DEM4_018,
TX_DEM4_019,
- TX_DEM4_022,
- TX_DEM4_047,
- TX_DEM4_021,
TX_DEM4_020,
- TX_DEM4_014,
- TX_DEM4_025,
+ TX_DEM4_021,
+ TX_DEM4_022,
TX_DEM4_023,
- TX_DEM4_027,
+ TX_DEM4_024,
+ TX_DEM4_025,
TX_DEM4_026,
+ TX_DEM4_027,
TX_DEM4_029,
- TX_DEM4_033,
+ TX_DEM4_030,
+ TX_DEM4_031,
TX_DEM4_032,
- TX_DEM4_013,
- TX_DEM4_045,
- TX_DEM4_018,
- TX_DEM4N011,
+ TX_DEM4_033,
TX_DEM4_034,
- TX_DEM4_017,
+ TX_DEM4_035,
TX_DEM4_036,
- TX_DEM4_006,
- TX_DEM4_003,
- TX_DEM4_005,
- TX_DEM4N009,
+ TX_DEM4_037,
+ TX_DEM4_038,
+ TX_DEM4_039,
+ TX_DEM4_040,
+ TX_DEM4_041,
+ TX_DEM4_042,
+ TX_DEM4_043,
+ TX_DEM4_044,
+ TX_DEM4_045,
+ TX_DEM4_046,
+ TX_DEM4_047,
+ TX_DEM4N000,
+ TX_DEM4N001,
+ TX_DEM4N002,
+ TX_DEM4N003,
+ TX_DEM4N004,
+ TX_DEM4N005,
TX_DEM4N006,
+ TX_DEM4N007,
+ TX_DEM4N008,
+ TX_DEM4N009,
+ TX_DEM4N010,
+ TX_DEM4N011,
+ TX_DEM4N012,
+ TX_DEM4N013,
+ TX_DEM4N014,
TX_END
@@ -317,279 +318,280 @@ const char * const g_gameStrings[] = {
"Mr. Spock",
"Dr. McCoy",
"Lt. Uhura",
- "Ensign Everts",
+ "Ensign Everts",
"Prel. Angiven",
"Sign",
"Klingon",
"Brother Kandrey",
- "#DEM0\\DEM0_016#Captain, the flora on this planet is very interesting. I wonder how useful it may be for medicinal purposes.",
- "#DEM0\\DEM0_039#Aw, Captain, please don't melt the snow. I've never seen it before.",
- "#DEM0\\DEM0_017#Quite the vandal aren't we, Jim?",
- "#DEM0\\DEM0_015#Burning down their house is not the best way to gain their confidence Jim!",
- "#DEM0\\DEM0_013#Captain, Doctor McCoy is correct.",
- "#DEM0\\DEM0_040#Is he always this trigger happy on ground missions?",
- "#DEM0\\DEM0_036#This is so much better, gentlefolk. We are honored at your presence and hope you will find peace here in our haven.",
- "#DEM0\\DEM0_006#I'm Captain James T. Kirk of the U.S.S. Enterprise. We have received word that alien lifeforms are creating problems at your mining facilities at Idyll Mountain. Tell me more.",
- "#DEM0\\DEM0_008#Most High Prelate Angiven, I am honored to meet you. I consider it my divine duty to assist you in any possible way with the spawn of the devil.",
- "#DEM0\\DEM0_003#Been seeing ghosts and bogeymen eh? I find that a little hard to believe.",
- "#DEM0\\DEM0_038#Certainly, Captain Kirk. Not aliens, per se -- we have encountered what we believe are demons at Idyll Mountain, creatures surely emerging from the very gates of Hell. Our God would not test us thus without reason, so we believe your might and insight are our God's method to help us discover what is going on.",
- "#DEM0\\DEM0_032#Captain Kirk. I had no idea we were blessed with one of our order in the ranks of Starfleet. We believe we have located the very Gates of Hell below Idyll Mountain.",
- "#DEM0\\DEM0_033#Starfleet recognizes our freedom to worship and believe as we see fit, Captain. I am surprised that you do not share that feeling. Rest assured that Starfleet Command will be informed of your rudeness.",
+
+ "#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?",
"#DEM0\\DEM0_002#Aside from seeing demons, has any hard data been collected? Any evidence I could see?",
+ "#DEM0\\DEM0_003#Been seeing ghosts and bogeymen eh? I find that a little hard to believe.",
+ "#DEM0\\DEM0_004#C'mon Bones, the cold will improve your circulation.",
"#DEM0\\DEM0_005#Demons? Gates of Hell? This is the 23rd Century!",
- "#DEM0\\DEM0_031#A skeptic would consider everything merely anecdotal or unproven. My people will gladly tell you their own stories, so you need not hear it secondhand through me.",
+ "#DEM0\\DEM0_006#I'm Captain James T. Kirk of the U.S.S. Enterprise. We have received word that alien lifeforms are creating problems at your mining facilities at Idyll Mountain. Tell me more.",
+ "#DEM0\\DEM0_007#Later Ensign. We have work to do.",
+ "#DEM0\\DEM0_008#Most High Prelate Angiven, I am honored to meet you. I consider it my divine duty to assist you in any possible way with the spawn of the devil.",
+ "#DEM0\\DEM0_009#This planet's as beautiful as everyone says it is.",
"#DEM0\\DEM0_010#What can you tell me about the mine itself?",
+ "#DEM0\\DEM0_011#You look rather cold, Bones.",
"#DEM0\\DEM0_012#You're wasting the time of a starship capable of destroying this planet with campfire stories? No wonder you were dumped out here in the middle of nowhere.",
- "#DEM0\\DEM0_035#The area is exceptionally stable tectonically, and easy for our machinery to work in, praise God. We've mined for hafnium and a variety of useful trace elements. The deeper we dig, however, the more anomalous the variety of minerals seems to be. Our Ignaciate, Brother Stephen, has his own theories about why this might be. Either way, the anomalies inspired Brother Kandrey to conduct studies inside the mine. Yesterday, he reported discovering a strange door -- a gate to Hell, surely, for the demons caused a cave-in immediately. Kandrey was trapped, unconscious, and the demons prevent us from rescuing him. We can only hope he is still alive.",
- "#DEM0\\DEM0_037#We need your help, Kirk. You may have no respect for our beliefs, but I hope you will look beyond that. Godspeed.",
- "#DEM0\\DEM0_034#Thank you for your courtesy, Kirk. May you receive the guidance and protection of our God as you complete this divine mission.",
- "#DEM0\\DEM0N004#High Prelate Angiven waits patiently for you to decide what you will do next.",
- "#DEM0\\DEM0N008#Some colonists.",
- "#DEM0\\DEM0N000#A beautiful, snow covered scene with a path leading off to Mount Idyll.",
- "#DEM0\\DEM0N006#On the other side of the trees is Idyll Mountain. A tall, forbidding place. You have a vague feeling of danger.",
- "#DEM0\\DEM0N001#A quickly constructed spartan shelter, primarily used by fledgling colonies.",
- "#DEM0\\DEM0N007#Remnants of a recent snowfall cover the ground.",
- "#DEM0\\DEM0N010#Various bushes and shrubs grow along the edge of the forest.",
- "#DEM0\\DEM0N009#Spock raises an eyebrow.",
- "#DEM0\\DEM0N005#James Tiberius Kirk, Captain of the Enterprise. He's always happy to run an errand of mercy.",
- "#DEM0\\DEM0N002#Dr. Leonard McCoy, the finest doctor in Starfleet, wishes that he were on a warmer planet.",
- "#DEM0\\DEM0N003#Ensign Everts, who has never been this close to snow before in his life, gazes with child-like fascination at the ground.",
- "#DEM0\\DEM0_019#I don't know if the problem is real, the result of a new illness, or mass hysteria. But at the very least, there's an injured miner who needs my help.",
+ "#DEM0\\DEM0_013#Captain, Doctor McCoy is correct.",
"#DEM0\\DEM0_014#Captain, demons and supernatural creatures are, almost by definition, illogical. Yet it is evident these people believe what they have seen. Barring illness or mass hysteria, I agree that a real problem seems to exist.",
- "#DEM0\\DEM0_011#You look rather cold, Bones.",
+ "#DEM0\\DEM0_015#Burning down their house is not the best way to gain their confidence Jim!",
+ "#DEM0\\DEM0_016#Captain, the flora on this planet is very interesting. I wonder how useful it may be for medicinal purposes.",
+ "#DEM0\\DEM0_017#Quite the vandal aren't we, Jim?",
+ "#DEM0\\DEM0_018#His blood pressure's up a bit, but he believes he's telling the truth.",
+ "#DEM0\\DEM0_019#I don't know if the problem is real, the result of a new illness, or mass hysteria. But at the very least, there's an injured miner who needs my help.",
+ "#DEM0\\DEM0_020#Jim! Are you out of your mind?",
+ "#DEM0\\DEM0_021#Jim, I am not picking up any unusual life here, just native lifeforms and the settlers. The colonists are all human, except for the one Tellarite. If there are demons here, they don't register on my tricorder.",
+ "#DEM0\\DEM0_022#The man's in perfect health.",
"#DEM0\\DEM0_023#I'm not cold, I'm freezing! And that damn transporter just had to set me down in the middle of a snow drift!",
+ "#DEM0\\DEM0_024#Some people get too much circulation!",
+ "#DEM0\\DEM0_025#Well...",
+ "#DEM0\\DEM0_026#You mean you've never built a snowman, ensign?",
+ "#DEM0\\DEM0_027#The trees. The fresh air. The freezing cold...",
+ "#DEM0\\DEM0_028#Captain, reading the rocks in this area, I find that this locality may have been disturbed in the distant past. Recent disturbances created by the colonists' construction and mining prevent me from discovering anything further.",
"#DEM0\\DEM0_029#A centimeter of snow does not technically constitute a drift, Doctor.",
+ "#DEM0\\DEM0_030#They are already gathered in the chapel, and will cooperate in any way with you. First door on my right.",
+ "#DEM0\\DEM0_031#A skeptic would consider everything merely anecdotal or unproven. My people will gladly tell you their own stories, so you need not hear it secondhand through me.",
+ "#DEM0\\DEM0_032#Captain Kirk. I had no idea we were blessed with one of our order in the ranks of Starfleet. We believe we have located the very Gates of Hell below Idyll Mountain.",
+ "#DEM0\\DEM0_033#Starfleet recognizes our freedom to worship and believe as we see fit, Captain. I am surprised that you do not share that feeling. Rest assured that Starfleet Command will be informed of your rudeness.",
+ "#DEM0\\DEM0_034#Thank you for your courtesy, Kirk. May you receive the guidance and protection of our God as you complete this divine mission.",
+ "#DEM0\\DEM0_035#The area is exceptionally stable tectonically, and easy for our machinery to work in, praise God. We've mined for hafnium and a variety of useful trace elements. The deeper we dig, however, the more anomalous the variety of minerals seems to be. Our Ignaciate, Brother Stephen, has his own theories about why this might be. Either way, the anomalies inspired Brother Kandrey to conduct studies inside the mine. Yesterday, he reported discovering a strange door -- a gate to Hell, surely, for the demons caused a cave-in immediately. Kandrey was trapped, unconscious, and the demons prevent us from rescuing him. We can only hope he is still alive.",
+ "#DEM0\\DEM0_036#This is so much better, gentlefolk. We are honored at your presence and hope you will find peace here in our haven.",
+ "#DEM0\\DEM0_037#We need your help, Kirk. You may have no respect for our beliefs, but I hope you will look beyond that. Godspeed.",
+ "#DEM0\\DEM0_038#Certainly, Captain Kirk. Not aliens, per se -- we have encountered what we believe are demons at Idyll Mountain, creatures surely emerging from the very gates of Hell. Our God would not test us thus without reason, so we believe your might and insight are our God's method to help us discover what is going on.",
+ "#DEM0\\DEM0_039#Aw, Captain, please don't melt the snow. I've never seen it before.",
+ "#DEM0\\DEM0_040#Is he always this trigger happy on ground missions?",
"#DEM0\\DEM0_041#And doctors say that patients complain too much!",
- "#DEM0\\DEM0_043#I've never seen snow like this before. This is great!",
- "#DEM0\\DEM0_026#You mean you've never built a snowman, ensign?",
"#DEM0\\DEM0_042#I've never even thrown a snowball. Do you think anyone would mind?",
- "#DEM0\\DEM0_025#Well...",
- "#DEM0\\DEM0_007#Later Ensign. We have work to do.",
+ "#DEM0\\DEM0_043#I've never seen snow like this before. This is great!",
"#DEM0\\DEM0_044#Of course, sir.",
- "#DEM0\\DEM0_009#This planet's as beautiful as everyone says it is.",
- "#DEM0\\DEM0_027#The trees. The fresh air. The freezing cold...",
- "#DEM0\\DEM0_004#C'mon Bones, the cold will improve your circulation.",
- "#DEM0\\DEM0_024#Some people get too much circulation!",
- "#DEM0\\DEM0_030#They are already gathered in the chapel, and will cooperate in any way with you. First door on my right.",
- "#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?",
- "#DEM0\\DEM0_022#The man's in perfect health.",
- "#DEM0\\DEM0_018#His blood pressure's up a bit, but he believes he's telling the truth.",
- "#DEM0\\DEM0_021#Jim, I am not picking up any unusual life here, just native lifeforms and the settlers. The colonists are all human, except for the one Tellarite. If there are demons here, they don't register on my tricorder.",
- "#DEM0\\DEM0_028#Captain, reading the rocks in this area, I find that this locality may have been disturbed in the distant past. Recent disturbances created by the colonists' construction and mining prevent me from discovering anything further.",
- "#DEM0\\DEM0_020#Jim! Are you out of your mind?",
+ "#DEM0\\DEM0N000#A beautiful, snow covered scene with a path leading off to Mount Idyll.",
+ "#DEM0\\DEM0N001#A quickly constructed spartan shelter, primarily used by fledgling colonies.",
+ "#DEM0\\DEM0N002#Dr. Leonard McCoy, the finest doctor in Starfleet, wishes that he were on a warmer planet.",
+ "#DEM0\\DEM0N003#Ensign Everts, who has never been this close to snow before in his life, gazes with child-like fascination at the ground.",
+ "#DEM0\\DEM0N004#High Prelate Angiven waits patiently for you to decide what you will do next.",
+ "#DEM0\\DEM0N005#James Tiberius Kirk, Captain of the Enterprise. He's always happy to run an errand of mercy.",
+ "#DEM0\\DEM0N006#On the other side of the trees is Idyll Mountain. A tall, forbidding place. You have a vague feeling of danger.",
+ "#DEM0\\DEM0N007#Remnants of a recent snowfall cover the ground.",
+ "#DEM0\\DEM0N008#Some colonists.",
+ "#DEM0\\DEM0N009#Spock raises an eyebrow.",
+ "#DEM0\\DEM0N010#Various bushes and shrubs grow along the edge of the forest.",
"All mining equipment use this road.",
- "#DEM1\\DEM1_011#The fire fight is over, Jim. I think you can put that away now.",
- "#DEM1\\DEM1N020#You see a small explosion, and the Klingon's hand falls to the ground with a dull thud.",
- "#DEM1\\DEM1_025#I guess they don't make Klingons like they used to, Sir.",
- "#DEM1\\DEM1_F23#Federation Scum!",
- "#DEM1\\DEM1U077#Captain we registered Phaser fire and an unknown energy beam. Is everyone OK?",
- "#DEM1\\DEM1_003#We're fine. Did you register any Disruptor fire?",
- "#DEM1\\DEM1U078#No, Captain. Why, are Klingons down there?",
+ "#DEM1\\DEM1_001#We were caught flat footed there. I don't want any more surprises to catch us off guard.",
"#DEM1\\DEM1_002#No just an idea, Kirk out.",
- "#DEM1\\DEM1_020#Fascinating. I begin to suspect that we have stumbled upon something that the colonists would never have uncovered.",
+ "#DEM1\\DEM1_003#We're fine. Did you register any Disruptor fire?",
"#DEM1\\DEM1_004#What is it, Spock?",
- "#DEM1\\DEM1_021#I wish to gather further data before making a definite conclusion, Captain.",
- "#DEM1\\DEM1_007#Khytellian tulips are a perennial flower that survive in almost any climate.",
- "#DEM1\\DEM1_008#The Brandzite pod is similar to terran milkweed except that the silk pods are in bright iridecent colors.",
"#DEM1\\DEM1_005#Doctis Cattails are similar to their terran name sake except that they are known to cause hives if in contact with flesh for any amount of time.",
"#DEM1\\DEM1_006#Gindorian ferns are regarded as an intergalactic weed, Captain.",
+ "#DEM1\\DEM1_007#Khytellian tulips are a perennial flower that survive in almost any climate.",
+ "#DEM1\\DEM1_008#The Brandzite pod is similar to terran milkweed except that the silk pods are in bright iridecent colors.",
"#DEM1\\DEM1_009#He's only stunned. He'll be back up in a few seconds.",
- "#DEM1\\DEM1N018#These are very beautiful Doctis Cattails.",
- "#DEM1\\DEM1N010#A large patch of Khytellian Tulips.",
- "#DEM1\\DEM1N019#These Brandzite Pods add a nice touch to the local flora.",
- "#DEM1\\DEM1N009#A Gindorian Fern.",
- "#DEM1\\DEM1N011#A small stream flows down towards the forest.",
- "#DEM1\\DEM1N021#You see the mine entrance ahead.",
- "#DEM1\\DEM1N016#Mt. Idyll rises above you.",
- "#DEM1\\DEM1N023#It's the Klingon's detached hand!",
- "#DEM1\\DEM1N017#The path is surrounded by some beautiful shrubbery.",
- "#DEM1\\DEM1N012#Captain Kirk is unconscious.",
- "#DEM1\\DEM1N015#Mr. Spock is unconscious.",
- "#DEM1\\DEM1N013#Dr. McCoy is unconscious.",
- "#DEM1\\DEM1N014#Ensign Everts is unconscious.",
- "#DEM1\\DEM1N003#James Kirk, filled with a premonition of more dangers yet to come.",
- "#DEM1\\DEM1N001#Dr. McCoy, still hoping the cold winds that whip around Mount Idyll will soon die down.",
- "#DEM1\\DEM1N008#Your Vulcan science officer seems to be lost in thought, but remains alert.",
- "#DEM1\\DEM1N002#Ensign Everts seems to be rattled by the attack of the Klingons.",
- "#DEM1\\DEM1N000#Captain Kirk is fatally shot by a Klingon, game over.",
- "#DEM1\\DEM1_018#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial. There is something different about this particular construct. Come here, Captain, look at the hand.It seems to have been separated from the body. There is a wiring circuit in the middle of the palm.",
- "#DEM1\\DEM1N006#You find nothing new.",
+ "#DEM1\\DEM1_011#The fire fight is over, Jim. I think you can put that away now.",
"#DEM1\\DEM1_012#This is definitely not a real klingon Jim.",
- "#DEM1\\DEM1_017#This is a detached hand with some kind of circuitry in the palm, Captain.",
- "#DEM1\\DEM1_019#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial.",
- "#DEM1\\DEM1_016#The circuit was damaged. It appears reparable, but some specialized equipment will be required.",
- "#DEM1\\DEM1N005#You already took the hand from the Klingon.",
- "#DEM1\\DEM1N007#You take the Klingon's detached hand.",
- "#DEM1\\DEM1N004#They look like Klingons.",
- "#DEM1\\DEM1_001#We were caught flat footed there. I don't want any more surprises to catch us off guard.",
- "#DEM1\\DEM1_022#Captain, I detect a recent avalanche, approximately 6.2 kilometers away, that occurred within the last three days. The mountain may be quite dangerous.",
"#DEM1\\DEM1_013#Demons, Klingons, avalanches... What's next, the Wicked Witch of the West?",
- "#DEM1\\DEM1_024#That is not logical, doctor.",
"#DEM1\\DEM1_014#It wasn't supposed to be logical, you green blooded Vulcan! Why does everything have to be so damned logical?",
"#DEM1\\DEM1_015#Well, we've seen Klingons. Now all we need is a few Romulans...",
+ "#DEM1\\DEM1_016#The circuit was damaged. It appears reparable, but some specialized equipment will be required.",
+ "#DEM1\\DEM1_017#This is a detached hand with some kind of circuitry in the palm, Captain.",
+ "#DEM1\\DEM1_018#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial. There is something different about this particular construct. Come here, Captain, look at the hand.It seems to have been separated from the body. There is a wiring circuit in the middle of the palm.",
+ "#DEM1\\DEM1_019#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial.",
+ "#DEM1\\DEM1_020#Fascinating. I begin to suspect that we have stumbled upon something that the colonists would never have uncovered.",
+ "#DEM1\\DEM1_021#I wish to gather further data before making a definite conclusion, Captain.",
+ "#DEM1\\DEM1_022#Captain, I detect a recent avalanche, approximately 6.2 kilometers away, that occurred within the last three days. The mountain may be quite dangerous.",
"#DEM1\\DEM1_023#Control your thoughts, Doctor. There is a high probability that something here is using our own memories against us.",
+ "#DEM1\\DEM1_024#That is not logical, doctor.",
+ "#DEM1\\DEM1_025#I guess they don't make Klingons like they used to, Sir.",
"#DEM1\\DEM1_026#I guess this isn't such a great planet after all.",
+ "#DEM1\\DEM1_F23#Federation Scum!",
+ "#DEM1\\DEM1N000#Captain Kirk is fatally shot by a Klingon, game over.",
+ "#DEM1\\DEM1N001#Dr. McCoy, still hoping the cold winds that whip around Mount Idyll will soon die down.",
+ "#DEM1\\DEM1N002#Ensign Everts seems to be rattled by the attack of the Klingons.",
+ "#DEM1\\DEM1N003#James Kirk, filled with a premonition of more dangers yet to come.",
+ "#DEM1\\DEM1N004#They look like Klingons.",
+ "#DEM1\\DEM1N005#You already took the hand from the Klingon.",
+ "#DEM1\\DEM1N006#You find nothing new.",
+ "#DEM1\\DEM1N007#You take the Klingon's detached hand.",
+ "#DEM1\\DEM1N008#Your Vulcan science officer seems to be lost in thought, but remains alert.",
+ "#DEM1\\DEM1N009#A Gindorian Fern.",
+ "#DEM1\\DEM1N010#A large patch of Khytellian Tulips.",
+ "#DEM1\\DEM1N011#A small stream flows down towards the forest.",
+ "#DEM1\\DEM1N012#Captain Kirk is unconscious.",
+ "#DEM1\\DEM1N013#Dr. McCoy is unconscious.",
+ "#DEM1\\DEM1N014#Ensign Everts is unconscious.",
+ "#DEM1\\DEM1N015#Mr. Spock is unconscious.",
+ "#DEM1\\DEM1N016#Mt. Idyll rises above you.",
+ "#DEM1\\DEM1N017#The path is surrounded by some beautiful shrubbery.",
+ "#DEM1\\DEM1N018#These are very beautiful Doctis Cattails.",
+ "#DEM1\\DEM1N019#These Brandzite Pods add a nice touch to the local flora.",
+ "#DEM1\\DEM1N020#You see a small explosion, and the Klingon's hand falls to the ground with a dull thud.",
+ "#DEM1\\DEM1N021#You see the mine entrance ahead.",
+ "#DEM1\\DEM1N023#It's the Klingon's detached hand!",
+ "#DEM1\\DEM1U077#Captain we registered Phaser fire and an unknown energy beam. Is everyone OK?",
+ "#DEM1\\DEM1U078#No, Captain. Why, are Klingons down there?",
- "#DEM2\\DEM2N009#Mine entrance.",
- "#DEM2\\DEM2N007#Idyll Mountain.",
- "#DEM2\\DEM2N008#Idyll Mountain.",
- "#DEM2\\DEM2N012#Various types of berries grow amongst the bushes.",
- "#DEM2\\DEM2N005#A Gindorian fern.",
- "#DEM2\\DEM2N010#Phequedian moss grows on the cave wall.",
- "#DEM2\\DEM2N006#Feeble lights illuminate the mine tunnel.",
- "#DEM2\\DEM2N011#The mine entrance goes deep into Mount Idyll.",
- "#DEM2\\DEM2_011#Jim, you usually pick food and then cook it.",
- "#DEM2\\DEM2_008#These seem to be Laraxian berries, Captain. They have several medicinal uses, but Dr. McCoy would know more.",
- "#DEM2\\DEM2_007#The Phequedine moss extracts nourishment from hafnium, Captain.",
- "#DEM2\\DEM2_006#Gindorian ferns are regarded as an intergalactic weed, Captain.",
+ "#DEM2\\DEM2_001#The answer to this mystery lies ahead of us, gentlemen.",
+ "#DEM2\\DEM2_002#Just don't make that mistake again, Ensign.",
+ "#DEM2\\DEM2_003#The thought had occurred to me, Mr. Spock, but thank you for mentioning it.",
+ "#DEM2\\DEM2_004#We've all had our share of conflict with Klingons, Ensign. The Organians told me that one day Humans and Klingons will become good friends. I wonder if I'll ever live to see that day.",
"#DEM2\\DEM2_005#Captain, I'm having trouble getting reliable readings from inside the mountain. Unusual crystalline structures within the ore may be at fault, though I cannot say for certain.",
- "#DEM2\\DEM2_013#These are the Laraxian Berries we used to cure Brother Chub.",
+ "#DEM2\\DEM2_006#Gindorian ferns are regarded as an intergalactic weed, Captain.",
+ "#DEM2\\DEM2_007#The Phequedine moss extracts nourishment from hafnium, Captain.",
+ "#DEM2\\DEM2_008#These seem to be Laraxian berries, Captain. They have several medicinal uses, but Dr. McCoy would know more.",
"#DEM2\\DEM2_009#Jim, these are Laraxian Berries that we used to make the Hypo-Dytoxin.",
"#DEM2\\DEM2_010#Jim, these are the berries we need to synthesize the Hypo-Dytoxin. We must get these to Brother Stephen quickly.",
+ "#DEM2\\DEM2_011#Jim, you usually pick food and then cook it.",
"#DEM2\\DEM2_012#These are Laraxian Berries. From what I remember, certain chemical compounds in the berry can be used to treat Nugaireyn infections.",
+ "#DEM2\\DEM2_013#These are the Laraxian Berries we used to cure Brother Chub.",
"#DEM2\\DEM2_014#We don't need any more berries, Jim.",
- "#DEM2\\DEM2N013#You have retrieved a sample of berries.",
- "#DEM2\\DEM2N002#James T. Kirk. Always wondering what the next surprise will be.",
- "#DEM2\\DEM2N004#Spock. Perhaps the most brilliant mind in Starfleet, pondering a most peculiar mystery.",
- "#DEM2\\DEM2N003#Leonard McCoy. Hoping that the cave will be warmer than outside.",
- "#DEM2\\DEM2N000#Ensign Everts. Keeping a sharp eye out for anything dangerous.",
- "#DEM2\\DEM2_001#The answer to this mystery lies ahead of us, gentlemen.",
"#DEM2\\DEM2_015#Does your tricorder say the cave is warmer, Spock...",
- "#DEM2\\DEM2_017#It is not logical for me to use my tricorder to determine the cave's temperature, doctor. I do not see what purpose it would serve.",
"#DEM2\\DEM2_016#Spock, everybody talks about the weather!",
+ "#DEM2\\DEM2_017#It is not logical for me to use my tricorder to determine the cave's temperature, doctor. I do not see what purpose it would serve.",
+ "#DEM2\\DEM2_018#Whoever was trying to stop us may not stop with those Klingons, Captain. I recommend extreme caution.",
"#DEM2\\DEM2_019#I'm sorry I let you down with those Klingons back there. I should have been paying more attention.",
- "#DEM2\\DEM2_002#Just don't make that mistake again, Ensign.",
"#DEM2\\DEM2_020#Those Klingons give me the willies. They always have. My sister was wounded by them in the Chozon ambush.",
- "#DEM2\\DEM2_004#We've all had our share of conflict with Klingons, Ensign. The Organians told me that one day Humans and Klingons will become good friends. I wonder if I'll ever live to see that day.",
- "#DEM2\\DEM2_018#Whoever was trying to stop us may not stop with those Klingons, Captain. I recommend extreme caution.",
- "#DEM2\\DEM2_003#The thought had occurred to me, Mr. Spock, but thank you for mentioning it.",
+ "#DEM2\\DEM2N000#Ensign Everts. Keeping a sharp eye out for anything dangerous.",
+ "#DEM2\\DEM2N002#James T. Kirk. Always wondering what the next surprise will be.",
+ "#DEM2\\DEM2N003#Leonard McCoy. Hoping that the cave will be warmer than outside.",
+ "#DEM2\\DEM2N004#Spock. Perhaps the most brilliant mind in Starfleet, pondering a most peculiar mystery.",
+ "#DEM2\\DEM2N005#A Gindorian fern.",
+ "#DEM2\\DEM2N006#Feeble lights illuminate the mine tunnel.",
+ "#DEM2\\DEM2N007#Idyll Mountain.",
+ "#DEM2\\DEM2N008#Idyll Mountain.",
+ "#DEM2\\DEM2N009#Mine entrance.",
+ "#DEM2\\DEM2N010#Phequedian moss grows on the cave wall.",
+ "#DEM2\\DEM2N011#The mine entrance goes deep into Mount Idyll.",
+ "#DEM2\\DEM2N012#Various types of berries grow amongst the bushes.",
+ "#DEM2\\DEM2N013#You have retrieved a sample of berries.",
- "#DEM3\\DEM3_013#He's already dead, Jim. Isn't that good enough for you?",
- "#DEM3\\DEM3_007#Captain, the stun setting would be very ineffective on these boulders.",
+ "#DEM3\\DEM3_001#Assume firing positions.",
+ "#DEM3\\DEM3_002#A gateway to an alien race. The wonders of the galaxy are endless, aren't they, Mr. Spock?",
+ "#DEM3\\DEM3_003#Bones..",
+ "#DEM3\\DEM3_004#Don't be too anxious, Ensign. We may want to talk with them.",
+ "#DEM3\\DEM3_005#Captain, I would strongly recommend clearing all the debris first.",
"#DEM3\\DEM3_006#Captain, the structure is extremely unstable. I would not recommend disturbing the lower section before the upper sections have been cleared.",
+ "#DEM3\\DEM3_007#Captain, the stun setting would be very ineffective on these boulders.",
"#DEM3\\DEM3_008#I think Doctor McCoy would be better suited to deal with this.",
"#DEM3\\DEM3_009#It appears to be a security lock designed to open the door when the correct hand print is registered.",
- "#DEM3\\DEM3_031#Sir, it may be dangerous. Let me try it.",
- "#DEM3\\DEM3_030#Sir, I think we should clear the rest of the rocks before we check out the device.",
- "#DEM3\\DEM3_A32#Aieeee!",
- "#DEM3\\DEM3_016#This is incredible, Jim. I'm picking up faint lifesign readings behind this door!",
- "#DEM3\\DEM3_005#Captain, I would strongly recommend clearing all the debris first.",
- "#DEM3\\DEM3_015#I've done all I can. He just needs rest now.",
+ "#DEM3\\DEM3_010#Captain, there are several weak points in the cave-in's structure. Careful use of our phasers, from the top down, should be able to clear it.",
+ "#DEM3\\DEM3_011#Captain, this course of action is ineffectual.",
+ "#DEM3\\DEM3_012#Fascinating, Captain. This door is made of an unknown material. It is clearly built by an alien race we have no knowledge of.",
+ "#DEM3\\DEM3_013#He's already dead, Jim. Isn't that good enough for you?",
"#DEM3\\DEM3_014#I'm sorry, Jim. Ensign Everts is beyond my help.",
- "#DEM3\\DEM3N017#Ensign Everts lies dead, crushed by the boulder.",
- "#DEM3\\DEM3N010#A cavern, deep in Mount Idyll.",
- "#DEM3\\DEM3N018#The crushed body of Ensign Everts reminds you of your poor command judgement.",
- "#DEM3\\DEM3N011#A huge boulder sits upon a large pile of rubble.",
- "#DEM3\\DEM3N013#A large pile of rubble blocks what appears to be a large metallic structure.",
- "#DEM3\\DEM3N020#You notice what appears to be a man's arm sticking out from beneath the rubble.",
- "#DEM3\\DEM3N016#A structure built into the surrounding rock. It must have been buried here for millennia.",
- "#DEM3\\DEM3N012#A large metallic door is set in the structure.",
- "#DEM3\\DEM3N014#A long tunnel descends into the mountain.",
- "#DEM3\\DEM3N019#This looks like some of the hand security panels on the Enterprise.",
- "#DEM3\\DEM3N015#A pulsing red light is set in the structure above the door.",
- "#DEM3\\DEM3N004#James T. Kirk. Captain of the Enterprise.",
- "#DEM3\\DEM3N001#Commander Spock; curious about what lies ahead.",
- "#DEM3\\DEM3N002#Doctor Leonard McCoy, glad that the cave provides some shelter from the breeze.",
- "#DEM3\\DEM3N003#Ensign Everts, wary of more ambushes.",
- "#DEM3\\DEM3N006#One of the Acolytes, who was trapped by the the rockfall.",
- "#DEM3\\DEM3N000#Brother Kandrey is barely conscious, and is lying still, trying to regain his strength.",
- "#DEM3\\DEM3_002#A gateway to an alien race. The wonders of the galaxy are endless, aren't they, Mr. Spock?",
- "#DEM3\\DEM3_029#Indeed, Captain.",
- "#DEM3\\DEM3_026#They can also be damned cold.",
- "#DEM3\\DEM3_028#I recommend as thorough an analysis of this area as possible.",
- "#DEM3\\DEM3_025#Jim, the next time you need medical help on a snowball...",
- "#DEM3\\DEM3_003#Bones..",
- "#DEM3\\DEM3_024#I'll probably end up coming along.",
- "#DEM3\\DEM3_036#No sign of demons, Klingons, or other hostiles, Captain. I promise I'll let you know the instant something appears.",
- "#DEM3\\DEM3_004#Don't be too anxious, Ensign. We may want to talk with them.",
- "#DEM3\\DEM3_001#Assume firing positions.",
+ "#DEM3\\DEM3_015#I've done all I can. He just needs rest now.",
+ "#DEM3\\DEM3_016#This is incredible, Jim. I'm picking up faint lifesign readings behind this door!",
+ "#DEM3\\DEM3_017#Dammit, Jim, I'm a doctor, not a bellhop. This man's too hurt to be moved.",
+ "#DEM3\\DEM3_018#He's dead Jim.",
+ "#DEM3\\DEM3_019#He's dead, Jim...",
"#DEM3\\DEM3_020#I'm picking up weak vital signs. If we don't dig him out soon, we're going to lose him!",
- "#DEM3\\DEM3_010#Captain, there are several weak points in the cave-in's structure. Careful use of our phasers, from the top down, should be able to clear it.",
- "#DEM3\\DEM3_023#This man is badly hurt, and suffering from shock and exposure as well.",
"#DEM3\\DEM3_021#It was a near thing, but he'll live.",
"#DEM3\\DEM3_022#The miner is dead.",
- "#DEM3\\DEM3_017#Dammit, Jim, I'm a doctor, not a bellhop. This man's too hurt to be moved.",
- "#DEM3\\DEM3N005#Nothing happens.",
+ "#DEM3\\DEM3_023#This man is badly hurt, and suffering from shock and exposure as well.",
+ "#DEM3\\DEM3_024#I'll probably end up coming along.",
+ "#DEM3\\DEM3_025#Jim, the next time you need medical help on a snowball...",
+ "#DEM3\\DEM3_026#They can also be damned cold.",
+ "#DEM3\\DEM3_027#Fascinating... I'm registering low-intensity shielding unlike anything we've encountered before. That kept this door -- and whatever is behind it -- hidden from the ship's sensors and earlier tricorder readings.",
+ "#DEM3\\DEM3_028#I recommend as thorough an analysis of this area as possible.",
+ "#DEM3\\DEM3_029#Indeed, Captain.",
+ "#DEM3\\DEM3_030#Sir, I think we should clear the rest of the rocks before we check out the device.",
+ "#DEM3\\DEM3_031#Sir, it may be dangerous. Let me try it.",
"#DEM3\\DEM3_033#I think I was shocked, sir.",
- "#DEM3\\DEM3_035#That was definitely a mild shock.",
"#DEM3\\DEM3_034#Ouch, that hurt.",
+ "#DEM3\\DEM3_035#That was definitely a mild shock.",
+ "#DEM3\\DEM3_036#No sign of demons, Klingons, or other hostiles, Captain. I promise I'll let you know the instant something appears.",
+ "#DEM3\\DEM3_A32#Aieeee!",
"#DEM3\\DEM3_B32#Aieeeee.",
- "#DEM3\\DEM3_018#He's dead Jim.",
- "#DEM3\\DEM3_012#Fascinating, Captain. This door is made of an unknown material. It is clearly built by an alien race we have no knowledge of.",
- "#DEM3\\DEM3_027#Fascinating... I'm registering low-intensity shielding unlike anything we've encountered before. That kept this door -- and whatever is behind it -- hidden from the ship's sensors and earlier tricorder readings.",
- "#DEM3\\DEM3N009#There is no apparent effect.",
- "#DEM3\\DEM3_011#Captain, this course of action is ineffectual.",
+ "#DEM3\\DEM3_F21#Oh, thank you, kind souls, for saving my life. Let me rest here for a little before returning to report this miracle to Prelate Angiven.",
+ "#DEM3\\DEM3N000#Brother Kandrey is barely conscious, and is lying still, trying to regain his strength.",
+ "#DEM3\\DEM3N001#Commander Spock; curious about what lies ahead.",
+ "#DEM3\\DEM3N002#Doctor Leonard McCoy, glad that the cave provides some shelter from the breeze.",
+ "#DEM3\\DEM3N003#Ensign Everts, wary of more ambushes.",
+ "#DEM3\\DEM3N004#James T. Kirk. Captain of the Enterprise.",
+ "#DEM3\\DEM3N005#Nothing happens.",
+ "#DEM3\\DEM3N006#One of the Acolytes, who was trapped by the the rockfall.",
"#DEM3\\DEM3N007#The fit is perfect, but something seems to be shorting out.",
"#DEM3\\DEM3N008#The hand's circuitry triggers a connection, and the door opens.",
- "#DEM3\\DEM3_019#He's dead, Jim...",
- "#DEM3\\DEM3_F21#Oh, thank you, kind souls, for saving my life. Let me rest here for a little before returning to report this miracle to Prelate Angiven.",
+ "#DEM3\\DEM3N009#There is no apparent effect.",
+ "#DEM3\\DEM3N010#A cavern, deep in Mount Idyll.",
+ "#DEM3\\DEM3N011#A huge boulder sits upon a large pile of rubble.",
+ "#DEM3\\DEM3N012#A large metallic door is set in the structure.",
+ "#DEM3\\DEM3N013#A large pile of rubble blocks what appears to be a large metallic structure.",
+ "#DEM3\\DEM3N014#A long tunnel descends into the mountain.",
+ "#DEM3\\DEM3N015#A pulsing red light is set in the structure above the door.",
+ "#DEM3\\DEM3N016#A structure built into the surrounding rock. It must have been buried here for millennia.",
+ "#DEM3\\DEM3N017#Ensign Everts lies dead, crushed by the boulder.",
+ "#DEM3\\DEM3N018#The crushed body of Ensign Everts reminds you of your poor command judgement.",
+ "#DEM3\\DEM3N019#This looks like some of the hand security panels on the Enterprise.",
+ "#DEM3\\DEM3N020#You notice what appears to be a man's arm sticking out from beneath the rubble.",
- "#DEM4\\DEM4_010#I would be glad to accept your application to the Federation. We shall have a diplomatic envoy sent to make the final arrangements.",
- "#DEM4\\DEM4_035#We look forward to meeting them. We also look forward to having discourse with the colonists. Farewell. May the Holy One bless you.",
- "#DEM4\\DEM4_030#Live long and prosper.",
- "#DEM4\\DEM4_011#Kirk to Enterprise... Beam us up, Mr. Scott.",
- "#DEM4\\DEM4N014#You fit the key into the slot, but you cannot find a way to turn it.",
- "#DEM4\\DEM4_031#Have you found the key?",
- "#DEM4\\DEM4N012#It looks like a control panel with slide switches.",
- "#DEM4\\DEM4N013#Nothing Happens.",
"#DEM4\\DEM4_001#I think we've found the answer to our mystery.",
- "#DEM4\\DEM4_012#This seems to be a Cryogenic Suspension chamber, Captain.",
- "#DEM4\\DEM4_044#Welcome to our home. Thank you for repairing our Sonambutron.",
"#DEM4\\DEM4_002#Stop! You're trespassing on Federation territory.",
+ "#DEM4\\DEM4_003#I think I should return it to where I got it from.",
"#DEM4\\DEM4_004#I welcome you on behalf of the United Federation of Planets. Who are you? Where do you come from?",
- "#DEM4\\DEM4_009#We did fix your machine. Can we write the repair bill off against rent on this land?",
- "#DEM4\\DEM4_042#Violence is hardly necessary, Captain Kirk. We owe you a debt for your service to us, and are more than willing to peacefully co-exist with your kind.",
- "#DEM4\\DEM4_043#We call ourselves Nauians. Thousands of years ago, we saw that meteor impacts were going to cause an Ice Age. We created this huge underground shelter to preserve our race, keeping us in suspended animation until the planet had recovered. We programmed the machinery to revive us at the next eclipse, but we did not count on the destruction of our moon.",
- "#DEM4\\DEM4_039#So the Ferengi are not the only traders in the universe! Yes, Captain Kirk, excusing the settlers' debts is an excellent way of ensuring that our people will be friends.",
- "#DEM4\\DEM4_008#Some advanced civilization!",
+ "#DEM4\\DEM4_005#No, I want to keep it as a memento for myself.",
+ "#DEM4\\DEM4_006#Of course. I think you will get along well with the Pollux inhabitants, and I'm sure you will have interesting theological discussions.",
"#DEM4\\DEM4_007#Perhaps you can tell us about the demons.",
- "#DEM4\\DEM4_041#There is no need for disrespect, intruder. Our race is old and powerful, wise in many things. Like our guardians, for example.",
- "#DEM4\\DEM4_040#The demons, as you call them, are created by a machine designed to keep intruders away from our sleep chambers. It pulls from the minds of any approaching creature their most feared enemy and produces replicas to scare them away. For you and your crew it was Klingons, for the Tellarite a wolf-demon, and for the other Humans a demon from their religion. On behalf of my people, thank you for waking us. I will turn off the machinery which creates our guardians, so that they no longer bedevil those with whom we now share our home.",
- "#DEM4\\DEM4_038#Oh woe! Alas! The key is missing, I can do nothing! Even we will suffer the attacks of our own guardians unless the key can be found! I implore you, if you can help, please do so.",
- "#DEM4\\DEM4_037#I see you have already shut off the machinery that creates the guardians. I have no way to thank you, Captain, but please carry this request from my people to yours. We have much ancient knowledge we can share, and we would like to join your Federation. Go in peace.",
- "#DEM4\\DEM4N002#It appears to be an abstract piece of alien art.",
- "#DEM4\\DEM4N010#This is where the panel should pop up.",
- "#DEM4\\DEM4N008#This appears to control some unusual security equipment.",
- "#DEM4\\DEM4N007#The alien is humanoid, with green reptilian skin. It appears unarmed.",
- "#DEM4\\DEM4N000#Dr. McCoy looks back.",
- "#DEM4\\DEM4N005#Spock is analyzing the alien machines.",
- "#DEM4\\DEM4N001#Ensign Everts is looking around.",
- "#DEM4\\DEM4N004#Many alien machines fill the room.",
- "#DEM4\\DEM4N003#James T. Kirk, Captain of the Enterprise.",
+ "#DEM4\\DEM4_008#Some advanced civilization!",
+ "#DEM4\\DEM4_009#We did fix your machine. Can we write the repair bill off against rent on this land?",
+ "#DEM4\\DEM4_010#I would be glad to accept your application to the Federation. We shall have a diplomatic envoy sent to make the final arrangements.",
+ "#DEM4\\DEM4_011#Kirk to Enterprise... Beam us up, Mr. Scott.",
+ "#DEM4\\DEM4_012#This seems to be a Cryogenic Suspension chamber, Captain.",
+ "#DEM4\\DEM4_013#Captain, Starfleet would not be pleased.",
+ "#DEM4\\DEM4_014#Fascinating, Captain. It is a diagram of a lunar eclipse of this planet. See how the red ball, the moon, is casting a shadow on the blue ball, Pollux V. This must be a very old piece of work, because this planet's moon was destroyed thousands of years ago.",
"#DEM4\\DEM4_015#I wonder who, or what, constructed all this.",
- "#DEM4\\DEM4_024#Logically, the machinery is sustaining some type of life in suspended animation. If we can reactivate the machines, then we may be able to meet its creators.",
- "#DEM4\\DEM4_046#I'm just a security officer, sir.",
+ "#DEM4\\DEM4_017#Jim, think about that skull we picked up from Brother Stephen. Now look at this alien. See the resemblance?",
+ "#DEM4\\DEM4_018#Ouch!",
"#DEM4\\DEM4_019#Perhaps we should try to communicate with the alien.",
- "#DEM4\\DEM4_022#Fascinating. this lifeform may represent what would have happened had the dinosaurs of your earth not become extinct.",
- "#DEM4\\DEM4_047#What is that?",
- "#DEM4\\DEM4_021#You should ask Spock, Jim.",
"#DEM4\\DEM4_020#This is a very old and very complex life-support system. It appears to still be operational.",
- "#DEM4\\DEM4_014#Fascinating, Captain. It is a diagram of a lunar eclipse of this planet. See how the red ball, the moon, is casting a shadow on the blue ball, Pollux V. This must be a very old piece of work, because this planet's moon was destroyed thousands of years ago.",
- "#DEM4\\DEM4_025#The machinery is waiting for the gravitational pull of another eclipse to activate it, an eclipse that will never come. And one other thing, Captain. This may also be a diagram showing the proper settings on that control panel.",
+ "#DEM4\\DEM4_021#You should ask Spock, Jim.",
+ "#DEM4\\DEM4_022#Fascinating. this lifeform may represent what would have happened had the dinosaurs of your earth not become extinct.",
"#DEM4\\DEM4_023#It is an alien life-support system, Captain, utilizing geothermal energy. It is still functioning, waiting for some sort of signal.",
- "#DEM4\\DEM4_027#This control panel is a manual override for the alien life-support equipment.",
+ "#DEM4\\DEM4_024#Logically, the machinery is sustaining some type of life in suspended animation. If we can reactivate the machines, then we may be able to meet its creators.",
+ "#DEM4\\DEM4_025#The machinery is waiting for the gravitational pull of another eclipse to activate it, an eclipse that will never come. And one other thing, Captain. This may also be a diagram showing the proper settings on that control panel.",
"#DEM4\\DEM4_026#This alien construction takes readings of mental activity. It also activates manufacturing equipment related to security, and includes a short-distance transportation device.",
+ "#DEM4\\DEM4_027#This control panel is a manual override for the alien life-support equipment.",
"#DEM4\\DEM4_029#This lifeform appears to be intelligent, a new sentient race. There appear to be resemblances between it and the silotis, although the present forms are quite small and definitely nonsentient.",
- "#DEM4\\DEM4_033#There is no need for violence, Captain. We are a peaceful people.",
+ "#DEM4\\DEM4_030#Live long and prosper.",
+ "#DEM4\\DEM4_031#Have you found the key?",
"#DEM4\\DEM4_032#Our patience is exhausted! Now feel our wrath!",
- "#DEM4\\DEM4_013#Captain, Starfleet would not be pleased.",
- "#DEM4\\DEM4_045#I do not think that would be a prudent action, sir.",
- "#DEM4\\DEM4_018#Ouch!",
- "#DEM4\\DEM4N011#You meet your death at the hands of a race that could have been your ally. What a waste. Better luck next time.",
+ "#DEM4\\DEM4_033#There is no need for violence, Captain. We are a peaceful people.",
"#DEM4\\DEM4_034#You found the key! I can now turn off the machinery creating our guardians, and no more sentients shall be at risk. Surely the Holy One smiles upon us all. I have no way to thank you, Captain, but please carry this request from my people to yours. We have much ancient knowledge we can share, and we would like to join your Federation. Go in peace.",
- "#DEM4\\DEM4_017#Jim, think about that skull we picked up from Brother Stephen. Now look at this alien. See the resemblance?",
+ "#DEM4\\DEM4_035#We look forward to meeting them. We also look forward to having discourse with the colonists. Farewell. May the Holy One bless you.",
"#DEM4\\DEM4_036#A child? No, I see many differences. This must be what our people who did not slumber have become. Still, I would like to see these remains properly interred, according to the precepts of our religion. May I keep this?",
- "#DEM4\\DEM4_006#Of course. I think you will get along well with the Pollux inhabitants, and I'm sure you will have interesting theological discussions.",
- "#DEM4\\DEM4_003#I think I should return it to where I got it from.",
- "#DEM4\\DEM4_005#No, I want to keep it as a memento for myself.",
- "#DEM4\\DEM4N009#This floor contains conduits for conducting geothermal energy.",
+ "#DEM4\\DEM4_037#I see you have already shut off the machinery that creates the guardians. I have no way to thank you, Captain, but please carry this request from my people to yours. We have much ancient knowledge we can share, and we would like to join your Federation. Go in peace.",
+ "#DEM4\\DEM4_038#Oh woe! Alas! The key is missing, I can do nothing! Even we will suffer the attacks of our own guardians unless the key can be found! I implore you, if you can help, please do so.",
+ "#DEM4\\DEM4_039#So the Ferengi are not the only traders in the universe! Yes, Captain Kirk, excusing the settlers' debts is an excellent way of ensuring that our people will be friends.",
+ "#DEM4\\DEM4_040#The demons, as you call them, are created by a machine designed to keep intruders away from our sleep chambers. It pulls from the minds of any approaching creature their most feared enemy and produces replicas to scare them away. For you and your crew it was Klingons, for the Tellarite a wolf-demon, and for the other Humans a demon from their religion. On behalf of my people, thank you for waking us. I will turn off the machinery which creates our guardians, so that they no longer bedevil those with whom we now share our home.",
+ "#DEM4\\DEM4_041#There is no need for disrespect, intruder. Our race is old and powerful, wise in many things. Like our guardians, for example.",
+ "#DEM4\\DEM4_042#Violence is hardly necessary, Captain Kirk. We owe you a debt for your service to us, and are more than willing to peacefully co-exist with your kind.",
+ "#DEM4\\DEM4_043#We call ourselves Nauians. Thousands of years ago, we saw that meteor impacts were going to cause an Ice Age. We created this huge underground shelter to preserve our race, keeping us in suspended animation until the planet had recovered. We programmed the machinery to revive us at the next eclipse, but we did not count on the destruction of our moon.",
+ "#DEM4\\DEM4_044#Welcome to our home. Thank you for repairing our Sonambutron.",
+ "#DEM4\\DEM4_045#I do not think that would be a prudent action, sir.",
+ "#DEM4\\DEM4_046#I'm just a security officer, sir.",
+ "#DEM4\\DEM4_047#What is that?",
+ "#DEM4\\DEM4N000#Dr. McCoy looks back.",
+ "#DEM4\\DEM4N001#Ensign Everts is looking around.",
+ "#DEM4\\DEM4N002#It appears to be an abstract piece of alien art.",
+ "#DEM4\\DEM4N003#James T. Kirk, Captain of the Enterprise.",
+ "#DEM4\\DEM4N004#Many alien machines fill the room.",
+ "#DEM4\\DEM4N005#Spock is analyzing the alien machines.",
"#DEM4\\DEM4N006#The alien emerged from this metal chamber.",
+ "#DEM4\\DEM4N007#The alien is humanoid, with green reptilian skin. It appears unarmed.",
+ "#DEM4\\DEM4N008#This appears to control some unusual security equipment.",
+ "#DEM4\\DEM4N009#This floor contains conduits for conducting geothermal energy.",
+ "#DEM4\\DEM4N010#This is where the panel should pop up.",
+ "#DEM4\\DEM4N011#You meet your death at the hands of a race that could have been your ally. What a waste. Better luck next time.",
+ "#DEM4\\DEM4N012#It looks like a control panel with slide switches.",
+ "#DEM4\\DEM4N013#Nothing Happens.",
+ "#DEM4\\DEM4N014#You fit the key into the slot, but you cannot find a way to turn it.",
};
}
Commit: e5a97d91373e20815c4f093803dc569112e0c922
https://github.com/scummvm/scummvm/commit/e5a97d91373e20815c4f093803dc569112e0c922
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Demon5
Changed paths:
A engines/startrek/rooms/demon5.cpp
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/demon0.cpp
engines/startrek/rooms/demon1.cpp
engines/startrek/rooms/demon2.cpp
engines/startrek/rooms/demon3.cpp
engines/startrek/rooms/demon4.cpp
engines/startrek/rooms/function_map.h
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 0265f4e..e118b3d 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -71,7 +71,7 @@ void StarTrekEngine::loadRoom(const Common::String &missionName, int roomIndex)
_roomIndex = roomIndex;
_roomFrameCounter = 0;
- _awayMission.transitioningIntoRoom = 0;
+ _awayMission.disableInput = false;
_gfx->fadeoutScreen();
_sound->stopAllVocSounds();
@@ -130,7 +130,7 @@ void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) {
_kirkActor->triggerActionWhenAnimFinished = true;
_kirkActor->finishedAnimActionParam = 0xff;
- _awayMission.transitioningIntoRoom = 1;
+ _awayMission.disableInput = true;
_warpHotspotsActive = false;
break;
case 4: // Crew is beaming in.
@@ -142,7 +142,7 @@ void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) {
}
_kirkActor->triggerActionWhenAnimFinished = true;
_kirkActor->finishedAnimActionParam = 0xff;
- _awayMission.transitioningIntoRoom = 1;
+ _awayMission.disableInput = true;
playSoundEffectIndex(0x09);
_warpHotspotsActive = false;
break;
@@ -175,7 +175,7 @@ void StarTrekEngine::handleAwayMissionEvents() {
break;
case TREKEVENT_LBUTTONDOWN:
- if (_awayMission.transitioningIntoRoom != 0)
+ if (_awayMission.disableInput)
break;
switch (_awayMission.activeAction) {
@@ -317,7 +317,7 @@ checkShowInventory:
break;
case TREKEVENT_RBUTTONDOWN: // TODO: also triggered by key press?
- if (_awayMission.transitioningIntoRoom)
+ if (_awayMission.disableInput)
break;
hideInventoryIcons();
playSoundEffectIndex(0x07);
@@ -396,7 +396,7 @@ void StarTrekEngine::handleAwayMissionAction() {
Action action = _actionQueue.pop();
if ((action.type == ACTION_FINISHED_ANIMATION || action.type == ACTION_FINISHED_WALKING) && action.b1 == 0xff) {
- _awayMission.transitioningIntoRoom = 0;
+ _awayMission.disableInput = false;
_warpHotspotsActive = true;
return;
}
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 15333da..f27a65c 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -33,7 +33,7 @@ struct AwayMission {
int16 mouseY; // 0x12
int16 crewGetupTimers[4]; // 0x14
bool disableWalking; // 0x1c
- byte transitioningIntoRoom; // 0x1d; Set while beaming in or walking into a room. Disables control?
+ byte disableInput; // 0x1d; Set while beaming in or walking into a room. Disables control?
bool redshirtDead; // 0x1e
byte activeAction; // 0x1f
byte activeObject; // 0x20; The item that is going to be used on something
@@ -65,7 +65,8 @@ struct AwayMission {
byte enteredFrom; // 0x3a
bool field3b; // 0x3b
bool healedMiner; // 0x3c
- bool curedBrother; // 0x3d
+ bool curedChub; // 0x3d
+ bool field3e; // 0x3e
bool knowAboutHypoDytoxin; // 0x3f
bool minerDead; // 0x40
byte field41; // 0x41
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 79dd0ec..7f089ca 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -22,7 +22,8 @@ MODULE_OBJS = \
rooms/demon1.o \
rooms/demon2.o \
rooms/demon3.o \
- rooms/demon4.o
+ rooms/demon4.o \
+ rooms/demon5.o
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 2c181a5..8a71961 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -57,6 +57,10 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_roomActionList = demon4ActionList;
_numRoomActions = sizeof(demon4ActionList) / sizeof(RoomAction);
}
+ else if (name == "DEMON5") {
+ _roomActionList = demon5ActionList;
+ _numRoomActions = sizeof(demon5ActionList) / sizeof(RoomAction);
+ }
else {
warning("Room \"%s\" unimplemented", name.c_str());
_numRoomActions = 0;
@@ -220,6 +224,7 @@ int Room::showText(int text) {
}
void Room::giveItem(int item) {
+ assert(item >= ITEMS_START && item < ITEMS_END);
_vm->_itemList[item - ITEMS_START].have = true;
}
@@ -235,6 +240,11 @@ void Room::loadRoomIndex(int roomIndex, int spawnIndex) {
// manipulate the stack to jump directly back to the start of "runAwayMission"...
}
+void Room::loseItem(int item) {
+ assert(item >= ITEMS_START && item < ITEMS_END);
+ _vm->_itemList[item - ITEMS_START].have = false;
+}
+
void Room::walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam) {
if (!(actorIndex >= OBJECT_KIRK && actorIndex <= OBJECT_REDSHIRT))
error("Tried to walk a non PC");
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index da93a1e..9943509 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -50,11 +50,6 @@ const int RDF_WARP_ROOM_INDICES = 0x22;
const int RDF_ROOM_ENTRY_POSITIONS = 0x2a;
const int RDF_BEAM_IN_POSITIONS = 0xaa;
-const char SPEAKER_KIRK[] = "Capt. Kirk";
-const char SPEAKER_SPOCK[] = "Mr. Spock";
-const char SPEAKER_MCCOY[] = "Dr. McCoy";
-const char SPEAKER_EVERTS[] = "Ensign Everts";
-
class Room {
public:
@@ -109,6 +104,7 @@ private:
int showText(int text); // Cmd 0x03
void giveItem(int item); // Cmd 0x04
void loadRoomIndex(int roomIndex, int spawnIndex); // Cmd 0x06
+ void loseItem(int item); // Cmd 0x07
void walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam);// Cmd 0x08
void loadMapFile(const Common::String &name); // Cmd 0x09
Common::Point getActorPos(int actorIndex); // Cmd 0x0d
@@ -334,6 +330,46 @@ public:
void demon4UseCrewmanOnPanel();
void demon4CrewmanReachedPanel();
+ // DEMON5
+ void demon5Tick1();
+ void demon5WalkToDoor();
+ void demon5TouchedDoorOpenTrigger();
+ void demon5DoorOpenedOrReachedDoor();
+ void demon5UseSTricorderOnCrate();
+ void demon5UsePhaserOnAnything();
+ void demon5UseHandOnStephen();
+ void demon5UseBerryOnStephen();
+ void demon5UseHypoDytoxinOnChub();
+ void demon5MccoyReachedChub();
+ void demon5MccoyHealedChub();
+ void demon5UseHypoDytoxinOnAnything();
+ void demon5UseBerryOnChub();
+ void demon5LookAtRoberts();
+ void demon5LookAtGrisnash();
+ void demon5LookAtStephen();
+ void demon5LookAtKirk();
+ void demon5LookAtSpock();
+ void demon5LookAtMccoy();
+ void demon5LookAtRedshirt();
+ void demon5LookAtMountain();
+ void demon5LookAtCrate();
+ void demon5LookAnywhere();
+ void demon5LookAtChub();
+ void demon5TalkToRoberts();
+ void demon5TalkToChub();
+ void demon5TalkToGrisnash();
+ void demon5TalkToStephen();
+ void demon5TalkToKirk();
+ void demon5TalkToSpock();
+ void demon5TalkToRedshirt();
+ void demon5TalkToMccoy();
+ void demon5UseMTricorderOnRoberts();
+ void demon5UseMTricorderOnChub();
+ void demon5UseMTricorderOnGrisnash();
+ void demon5UseMTricorderOnStephen();
+ void demon5CheckCompletedStudy();
+ void demon5GetCrate();
+
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
@@ -362,6 +398,22 @@ private:
bool cb; // 0xcb
int16 crewmanUsingPanel; // 0xcf
} demon4;
+
+ struct {
+ bool scannedRoberts; // 0xca
+ bool scannedChub; // 0xcb
+ bool scannedGrisnash; // 0xcc
+ bool scannedStephen; // 0xcd
+ byte numScanned; // 0xce
+ byte numTalkedTo; // 0xcf
+ bool talkedToRoberts; // 0xd0
+ bool talkedToChub; // 0xd1
+ bool talkedToGrisnash; // 0xd2
+ bool talkedToStephen; // 0xd3
+ byte doorCounter; // 0xd4
+ bool movingToDoor; // 0xd5
+ } demon5;
+
} _roomVar;
};
diff --git a/engines/startrek/rooms/demon0.cpp b/engines/startrek/rooms/demon0.cpp
index 397a3eb..d69f8f1 100644
--- a/engines/startrek/rooms/demon0.cpp
+++ b/engines/startrek/rooms/demon0.cpp
@@ -61,7 +61,7 @@ void Room::demon0TouchedWarp0() {
}
void Room::demon0WalkToBottomDoor() {
- _vm->_awayMission.transitioningIntoRoom = 1;
+ _vm->_awayMission.disableInput = 1;
_rdfData[0xcd] = 1; // FIXME
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 243, 158, 1);
@@ -81,7 +81,7 @@ void Room::demon0ReachedBottomDoor() {
}
void Room::demon0WalkToTopDoor() {
- _vm->_awayMission.transitioningIntoRoom = 1;
+ _vm->_awayMission.disableInput = 1;
_rdfData[0xcc] = 1; // FIXME
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 157, 134, 2);
diff --git a/engines/startrek/rooms/demon1.cpp b/engines/startrek/rooms/demon1.cpp
index fb5a66e..325f13c 100644
--- a/engines/startrek/rooms/demon1.cpp
+++ b/engines/startrek/rooms/demon1.cpp
@@ -216,7 +216,7 @@ void Room::demon1UsePhaserOnAnything() {
void Room::demon1UsePhaserOnKlingon1() {
if (_rdfData[0xca] != 0)
return;
- _vm->_awayMission.transitioningIntoRoom = 1;
+ _vm->_awayMission.disableInput = 1;
_rdfData[0xca] = 1;
if (_roomVar.demon1.kirkShooting) {
@@ -245,7 +245,7 @@ void Room::demon1ShootKlingon1() {
void Room::demon1KlingonDropsHand() {
loadActorAnim(13, "klghnd", 0x10b, 0x8e, 0);
- _vm->_awayMission.transitioningIntoRoom = 0;
+ _vm->_awayMission.disableInput = 0;
_vm->_awayMission.timers[1] = 0;
showText(TX_DEM1N020);
@@ -265,7 +265,7 @@ void Room::demon1KlingonDropsHand() {
void Room::demon1UsePhaserOnKlingon2() {
if (_rdfData[0xcb] != 0)
return;
- _vm->_awayMission.transitioningIntoRoom = 1;
+ _vm->_awayMission.disableInput = 1;
_rdfData[0xcb] = 1;
if (_roomVar.demon1.kirkShooting) {
@@ -289,13 +289,13 @@ void Room::demon1ShootKlingon2() {
loadActorAnim(12, "s0ks2", 0, 0, 0);
playSoundEffectIndex(0x06);
loadActorAnim2(9, "klg2d", 0xaa, 0x7c, 0);
- _vm->_awayMission.transitioningIntoRoom = 0;
+ _vm->_awayMission.disableInput = 0;
}
void Room::demon1UsePhaserOnKlingon3() {
if (_rdfData[0xcc] != 0)
return;
- _vm->_awayMission.transitioningIntoRoom = 1;
+ _vm->_awayMission.disableInput = 1;
_rdfData[0xcc] = 1;
if (_roomVar.demon1.kirkShooting) {
@@ -319,7 +319,7 @@ void Room::demon1ShootKlingon3() {
loadActorAnim(12, "s0ks3", 0, 0, 0);
playSoundEffectIndex(0x06);
loadActorAnim2(10, "klg3d", 0, 0, 0);
- _vm->_awayMission.transitioningIntoRoom = 0;
+ _vm->_awayMission.disableInput = 0;
}
// Timer 6 expired
diff --git a/engines/startrek/rooms/demon2.cpp b/engines/startrek/rooms/demon2.cpp
index c707e25..9f54cde 100644
--- a/engines/startrek/rooms/demon2.cpp
+++ b/engines/startrek/rooms/demon2.cpp
@@ -141,7 +141,7 @@ void Room::demon2UseMTricorderOnBerries() {
loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0);
playSoundEffectIndex(0x04);
- if (_vm->_awayMission.demon.curedBrother)
+ if (_vm->_awayMission.demon.curedChub)
showText(TX_SPEAKER_MCCOY, TX_DEM2_013);
else if (_vm->_awayMission.demon.madeHypoDytoxin)
showText(TX_SPEAKER_MCCOY, TX_DEM2_009);
diff --git a/engines/startrek/rooms/demon3.cpp b/engines/startrek/rooms/demon3.cpp
index 4a62282..07bb454 100644
--- a/engines/startrek/rooms/demon3.cpp
+++ b/engines/startrek/rooms/demon3.cpp
@@ -71,7 +71,7 @@ void Room::demon3Timer0Expired() {
_vm->_awayMission.timers[1] = 13;
_vm->_awayMission.demon.boulder1Gone = true;
_vm->_awayMission.demon.numBouldersGone++;
- _vm->_awayMission.transitioningIntoRoom = true;
+ _vm->_awayMission.disableInput = true;
playMidiMusicTracks(2, -1);
playVoc("BOULDERK");
}
@@ -116,7 +116,7 @@ void Room::demon3FinishedWalking5() {
playSoundEffectIndex(0x04);
showText(TX_SPEAKER_MCCOY, TX_DEM3_019);
- _vm->_awayMission.transitioningIntoRoom = false;
+ _vm->_awayMission.disableInput = false;
}
void Room::demon3McCoyInFiringPosition() {
@@ -194,7 +194,7 @@ void Room::demon3FireAtBoulder() {
playSoundEffectIndex(0x06);
if (!_roomVar.demon3.boulder1Shot)
_vm->_awayMission.timers[0] = 1;
- _vm->_awayMission.transitioningIntoRoom = false;
+ _vm->_awayMission.disableInput = false;
}
void Room::demon3UsePhaserOnRedshirt() {
@@ -262,7 +262,7 @@ void Room::demon3UsePhaserOnBoulder4() {
}
void Room::demon3BoulderCommon() {
- _vm->_awayMission.transitioningIntoRoom = true;
+ _vm->_awayMission.disableInput = true;
Common::Point pos = getActorPos(OBJECT_KIRK);
if (!(pos.x == 0x79 && pos.y == 0xa0)) {
_roomVar.demon3.inFiringPosition = false;
diff --git a/engines/startrek/rooms/demon4.cpp b/engines/startrek/rooms/demon4.cpp
index 3596761..2993c17 100644
--- a/engines/startrek/rooms/demon4.cpp
+++ b/engines/startrek/rooms/demon4.cpp
@@ -137,7 +137,7 @@ void Room::demon4UseCrewmanOnPanel() {
return;
walkCrewman(_roomVar.demon4.crewmanUsingPanel, 0xda, 0x83, 3);
_vm->_awayMission.crewDirectionsAfterWalk[_roomVar.demon4.crewmanUsingPanel] = DIR_N;
- _vm->_awayMission.transitioningIntoRoom = true;
+ _vm->_awayMission.disableInput = true;
}
void Room::demon4CrewmanReachedPanel() {
diff --git a/engines/startrek/rooms/demon5.cpp b/engines/startrek/rooms/demon5.cpp
new file mode 100644
index 0000000..94962db
--- /dev/null
+++ b/engines/startrek/rooms/demon5.cpp
@@ -0,0 +1,338 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+void Room::demon5Tick1() {
+ playVoc("DEM5LOOP");
+
+ if (!_vm->_awayMission.demon.curedChub || _vm->_awayMission.demon.field37 != 1)
+ loadActorAnim(11, "oldman", 0x7a, 0xb0, 0);
+ loadActorAnim(8, "brorob", 0xc9, 0xa8, 0);
+ loadActorAnim(9, "crip", 0xe3, 0xa8, 0);
+ loadActorAnim(10, "brotel", 0xf9, 0xbc, 0);
+ loadActorAnim(12, "s0r6d2", 0xa0, 0x92, 0);
+}
+
+void Room::demon5WalkToDoor() {
+ _vm->_awayMission.disableInput = true;
+ _roomVar.demon5.movingToDoor = true;
+ walkCrewman(OBJECT_KIRK, 0xa0, 0x94, 1);
+}
+
+void Room::demon5TouchedDoorOpenTrigger() {
+ if (!_roomVar.demon5.movingToDoor)
+ return;
+ loadActorAnim(12, "s0r6d1", 0xa0, 0x92, 1);
+ playSoundEffectIndex(0x05);
+}
+
+void Room::demon5DoorOpenedOrReachedDoor() {
+ // This is invoked when the door opens and when Kirk reaches the door.
+ // Must wait for both to occur.
+ _roomVar.demon5.doorCounter++;
+ if (_roomVar.demon5.doorCounter == 2)
+ loadRoomIndex(0, 1);
+}
+
+void Room::demon5UseSTricorderOnCrate() {
+ loadActorAnim(OBJECT_SPOCK, "sscans", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ showText(TX_SPEAKER_SPOCK, TX_DEM5_006);
+}
+
+void Room::demon5UsePhaserOnAnything() {
+ showText(TX_SPEAKER_SPOCK, TX_DEM5_007);
+}
+
+void Room::demon5UseHandOnStephen() {
+ if (_vm->_awayMission.demon.field3b)
+ showText(TX_SPEAKER_STEPHEN, TX_DEM5_036);
+ else
+ showText(TX_SPEAKER_STEPHEN, TX_DEM5_039);
+}
+
+void Room::demon5UseBerryOnStephen() {
+ if (_vm->_awayMission.demon.knowAboutHypoDytoxin)
+ showText(TX_SPEAKER_STEPHEN, TX_DEM5_033);
+ else
+ showText(TX_SPEAKER_STEPHEN, TX_DEM5_037);
+}
+
+void Room::demon5UseHypoDytoxinOnChub() {
+ walkCrewman(OBJECT_MCCOY, 0xe1, 0xb0, 2);
+}
+
+void Room::demon5MccoyReachedChub() {
+ loadActorAnim2(OBJECT_MCCOY, "musemn", -1, -1, 2);
+}
+
+void Room::demon5MccoyHealedChub() {
+ walkCrewman(OBJECT_MCCOY, 0xc8, 0xba, 0);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ showText(TX_SPEAKER_CHUB, TX_DEM5L027);
+ loseItem(OBJECT_IDETOXIN);
+ _vm->_awayMission.demon.curedChub = true;
+ _vm->_awayMission.missionScore += 2;
+}
+
+void Room::demon5UseHypoDytoxinOnAnything() {
+ showText(TX_SPEAKER_MCCOY, TX_DEM5_008);
+}
+
+void Room::demon5UseBerryOnChub() {
+ showText(TX_SPEAKER_MCCOY, TX_DEM5_009);
+}
+
+void Room::demon5LookAtRoberts() {
+ showText(TX_DEM5N001);
+}
+
+void Room::demon5LookAtGrisnash() {
+ showText(TX_DEM5N009);
+}
+
+void Room::demon5LookAtStephen() {
+ showText(TX_DEM5N003);
+}
+
+void Room::demon5LookAtKirk() {
+ showText(TX_DEM5N006);
+}
+
+void Room::demon5LookAtSpock() {
+ showText(TX_DEM5N008);
+}
+
+void Room::demon5LookAtMccoy() {
+ showText(TX_DEM5N007);
+}
+
+void Room::demon5LookAtRedshirt() {
+ showText(TX_DEM5N005);
+}
+
+void Room::demon5LookAtMountain() {
+ showText(TX_DEM5N002);
+}
+
+void Room::demon5LookAtCrate() {
+ showText(TX_DEM5N004);
+}
+
+void Room::demon5LookAnywhere() {
+ showText(TX_DEM5N000);
+}
+
+void Room::demon5LookAtChub() {
+ showText(TX_SPEAKER_CHUB, TX_DEM5L028);
+}
+
+void Room::demon5TalkToRoberts() {
+ if (_vm->_awayMission.demon.curedChub) {
+ showText(TX_SPEAKER_ROBERTS, TX_DEM5_030);
+ if (!_roomVar.demon5.talkedToRoberts) {
+ _roomVar.demon5.talkedToRoberts = true;
+ _roomVar.demon5.numTalkedTo++;
+ demon5CheckCompletedStudy();
+ }
+ }
+ else {
+ showText(TX_DEM5N010);
+ }
+}
+
+void Room::demon5TalkToChub() {
+ if (_vm->_awayMission.demon.curedChub) {
+ showText(TX_SPEAKER_CHUB, TX_DEM5L029);
+ showText(TX_SPEAKER_KIRK, TX_DEM5_002);
+ showText(TX_SPEAKER_CHUB, TX_DEM5L030);
+ showText(TX_SPEAKER_KIRK, TX_DEM5_005);
+ showText(TX_SPEAKER_CHUB, TX_DEM5L031);
+
+ if (!_roomVar.demon5.talkedToChub) {
+ _roomVar.demon5.talkedToChub = true;
+ _roomVar.demon5.numTalkedTo++;
+ demon5CheckCompletedStudy();
+ }
+ }
+ else {
+ showText(TX_DEM5N013);
+ }
+}
+
+void Room::demon5TalkToGrisnash() {
+ if (_vm->_awayMission.demon.curedChub) {
+ showText(TX_SPEAKER_GRISNASH, TX_DEM5_028);
+ showText(TX_SPEAKER_SPOCK, TX_DEM5_024);
+ showText(TX_SPEAKER_GRISNASH, TX_DEM5_029);
+ showText(TX_SPEAKER_SPOCK, TX_DEM5_025);
+
+ if (!_roomVar.demon5.talkedToGrisnash) {
+ _roomVar.demon5.talkedToGrisnash = true;
+ _roomVar.demon5.numTalkedTo++;
+ demon5CheckCompletedStudy();
+ }
+ }
+ else {
+ showText(TX_DEM5N011);
+ }
+}
+
+void Room::demon5TalkToStephen() {
+ if (_vm->_awayMission.demon.curedChub) {
+ showText(TX_SPEAKER_STEPHEN, TX_DEM5_041);
+ showText(TX_SPEAKER_MCCOY, TX_DEM5_022);
+ showText(TX_SPEAKER_STEPHEN, TX_DEM5_043);
+ showText(TX_SPEAKER_ROBERTS, TX_DEM5_031);
+ showText(TX_SPEAKER_STEPHEN, TX_DEM5_042);
+
+ if (!_roomVar.demon5.talkedToStephen) {
+ _roomVar.demon5.talkedToStephen = true;
+ _roomVar.demon5.numTalkedTo++;
+ demon5CheckCompletedStudy();
+ }
+ }
+ else if (!_vm->_awayMission.demon.knowAboutHypoDytoxin) {
+ showText(TX_SPEAKER_ROBERTS, TX_DEM5_034);
+ }
+ else if (_vm->_awayMission.demon.madeHypoDytoxin) {
+ showText(TX_SPEAKER_ROBERTS, TX_DEM5_035);
+ }
+ else if (_vm->_awayMission.demon.gotBerries) {
+ showText(TX_SPEAKER_ROBERTS, TX_DEM5_032);
+ _vm->_awayMission.demon.field3e = false;
+ }
+ else if (_vm->_awayMission.demon.field3e) {
+ showText(TX_SPEAKER_ROBERTS, TX_DEM5_038);
+ }
+ else {
+ showText(TX_SPEAKER_ROBERTS, TX_DEM5_034);
+ }
+}
+
+void Room::demon5TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_DEM5_001);
+}
+
+void Room::demon5TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_DEM5_027);
+ showText(TX_SPEAKER_MCCOY, TX_DEM5_018);
+}
+
+void Room::demon5TalkToRedshirt() {
+ showText(TX_SPEAKER_EVERTS, TX_DEM5_045);
+ showText(TX_SPEAKER_MCCOY, TX_DEM5_021);
+ showText(TX_SPEAKER_KIRK, TX_DEM5_003);
+}
+
+void Room::demon5TalkToMccoy() {
+ if (_vm->_awayMission.demon.curedChub) {
+ showText(TX_SPEAKER_MCCOY, TX_DEM5_023);
+ showText(TX_SPEAKER_KIRK, TX_DEM5_004);
+ if (!_vm->_awayMission.redshirtDead) {
+ showText(TX_SPEAKER_EVERTS, TX_DEM5_044);
+ showText(TX_SPEAKER_MCCOY, TX_DEM5_020);
+ showText(TX_SPEAKER_SPOCK, TX_DEM5_026);
+ showText(TX_SPEAKER_MCCOY, TX_DEM5_019);
+ }
+ }
+ else {
+ showText(TX_SPEAKER_MCCOY, TX_DEM5_017);
+ }
+}
+
+void Room::demon5UseMTricorderOnRoberts() {
+ if (_roomVar.demon5.scannedRoberts)
+ return;
+ loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ showText(TX_SPEAKER_MCCOY, TX_DEM5_015);
+
+ _roomVar.demon5.scannedRoberts = true;
+ _roomVar.demon5.numScanned++;
+ demon5CheckCompletedStudy();
+}
+
+void Room::demon5UseMTricorderOnChub() {
+ loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+
+ if (_vm->_awayMission.demon.curedChub) {
+ if (_roomVar.demon5.scannedChub)
+ return;
+ showText(TX_SPEAKER_MCCOY, TX_DEM5_016);
+ _roomVar.demon5.scannedChub = true;
+ _roomVar.demon5.numScanned++;
+ demon5CheckCompletedStudy();
+ }
+ else {
+ if (_vm->_awayMission.demon.field3e)
+ showText(TX_SPEAKER_MCCOY, TX_DEM5_010);
+ else {
+ showText(TX_SPEAKER_MCCOY, TX_DEM5_012);
+ showText(TX_SPEAKER_STEPHEN, TX_DEM5_040);
+ _vm->_awayMission.demon.knowAboutHypoDytoxin = true;
+ _vm->_awayMission.demon.field3e = true;
+ }
+ }
+}
+
+
+void Room::demon5UseMTricorderOnGrisnash() {
+ if (_roomVar.demon5.scannedGrisnash)
+ return;
+ loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ showText(TX_SPEAKER_MCCOY, TX_DEM5_013);
+
+ _roomVar.demon5.scannedGrisnash = true;
+ _roomVar.demon5.numScanned++;
+ demon5CheckCompletedStudy();
+}
+
+void Room::demon5UseMTricorderOnStephen() {
+ if (_roomVar.demon5.scannedStephen)
+ return;
+ loadActorAnim2(OBJECT_MCCOY, "mscanw", -1, -1, 0);
+ playSoundEffectIndex(0x04);
+ showText(TX_SPEAKER_MCCOY, TX_DEM5_014);
+
+ _roomVar.demon5.scannedStephen = true;
+ _roomVar.demon5.numScanned++;
+ demon5CheckCompletedStudy();
+}
+
+void Room::demon5CheckCompletedStudy() {
+ if (_roomVar.demon5.numScanned == 4 && _roomVar.demon5.numTalkedTo == 4) {
+ showText(TX_SPEAKER_MCCOY, TX_DEM5_011);
+ _roomVar.demon5.numTalkedTo = 5;
+ }
+}
+
+void Room::demon5GetCrate() {
+ showText(TX_DEM5N012);
+}
+
+}
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 1761bda..d0cbff8 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -344,6 +344,61 @@ RoomAction demon4ActionList[] = {
{ Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::demon4CrewmanReachedPanel },
};
+RoomAction demon5ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::demon5Tick1 },
+ { Action(ACTION_WALK, 0x22, 0, 0), &Room::demon5WalkToDoor },
+ { Action(ACTION_WALK, 12, 0, 0), &Room::demon5WalkToDoor },
+ { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::demon5TouchedDoorOpenTrigger },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::demon5DoorOpenedOrReachedDoor },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::demon5DoorOpenedOrReachedDoor },
+
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::demon5UseSTricorderOnCrate },
+ { Action(ACTION_USE, OBJECT_IPHASERK, -1, 0), &Room::demon5UsePhaserOnAnything },
+ { Action(ACTION_USE, OBJECT_IPHASERS, -1, 0), &Room::demon5UsePhaserOnAnything },
+
+ { Action(ACTION_USE, OBJECT_IHAND, 11, 0), &Room::demon5UseHandOnStephen },
+ { Action(ACTION_USE, OBJECT_IBERRY, 11, 0), &Room::demon5UseBerryOnStephen },
+ { Action(ACTION_USE, OBJECT_IDETOXIN, 9, 0), &Room::demon5UseHypoDytoxinOnChub },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::demon5MccoyReachedChub },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::demon5MccoyHealedChub },
+
+ { Action(ACTION_USE, OBJECT_IDETOXIN, -1, 0), &Room::demon5UseHypoDytoxinOnAnything },
+ { Action(ACTION_USE, OBJECT_IBERRY, 9, 0), &Room::demon5UseBerryOnChub },
+
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::demon5LookAtRoberts },
+ { Action(ACTION_LOOK, 10, 0, 0), &Room::demon5LookAtGrisnash },
+ { Action(ACTION_LOOK, 11, 0, 0), &Room::demon5LookAtStephen },
+
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::demon5LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::demon5LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::demon5LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::demon5LookAtRedshirt },
+
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon5LookAtMountain },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::demon5LookAtCrate },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::demon5LookAnywhere },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::demon5LookAtChub },
+
+ { Action(ACTION_TALK, 8, 0, 0), &Room::demon5TalkToRoberts },
+ { Action(ACTION_TALK, 9, 0, 0), &Room::demon5TalkToChub },
+ { Action(ACTION_TALK, 10, 0, 0), &Room::demon5TalkToGrisnash },
+ { Action(ACTION_TALK, 11, 0, 0), &Room::demon5TalkToStephen },
+
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::demon5TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::demon5TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::demon5TalkToRedshirt },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::demon5TalkToMccoy },
+
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::demon5UseMTricorderOnRoberts },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 9, 0), &Room::demon5UseMTricorderOnChub },
+ { Action(ACTION_USE, OBJECT_MCCOY, 9, 0), &Room::demon5UseMTricorderOnChub },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 9, 0), &Room::demon5UseMTricorderOnChub },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 10, 0), &Room::demon5UseMTricorderOnGrisnash },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 11, 0), &Room::demon5UseMTricorderOnStephen },
+
+ { Action(ACTION_GET, 0x21, 0, 0), &Room::demon5GetCrate },
+};
+
}
#endif
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index e352bad..a8e7552 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -38,6 +38,10 @@ enum GameStringIDs {
TX_SPEAKER_SIGN,
TX_SPEAKER_KLINGON,
TX_SPEAKER_KANDREY,
+ TX_SPEAKER_STEPHEN,
+ TX_SPEAKER_CHUB,
+ TX_SPEAKER_ROBERTS,
+ TX_SPEAKER_GRISNASH,
TX_DEM0_001,
TX_DEM0_002,
@@ -308,6 +312,72 @@ enum GameStringIDs {
TX_DEM4N014,
+ TX_DEM5_001,
+ TX_DEM5_002,
+ TX_DEM5_003,
+ TX_DEM5_004,
+ TX_DEM5_005,
+ TX_DEM5_006,
+ TX_DEM5_007,
+ TX_DEM5_008,
+ TX_DEM5_009,
+ TX_DEM5_010,
+ TX_DEM5_011,
+ TX_DEM5_012,
+ TX_DEM5_013,
+ TX_DEM5_014,
+ TX_DEM5_015,
+ TX_DEM5_016,
+ TX_DEM5_017,
+ TX_DEM5_018,
+ TX_DEM5_019,
+ TX_DEM5_020,
+ TX_DEM5_021,
+ TX_DEM5_022,
+ TX_DEM5_023,
+ TX_DEM5_024,
+ TX_DEM5_025,
+ TX_DEM5_026,
+ TX_DEM5_027,
+ TX_DEM5_028,
+ TX_DEM5_029,
+ TX_DEM5_030,
+ TX_DEM5_031,
+ TX_DEM5_032,
+ TX_DEM5_033,
+ TX_DEM5_034,
+ TX_DEM5_035,
+ TX_DEM5_036,
+ TX_DEM5_037,
+ TX_DEM5_038,
+ TX_DEM5_039,
+ TX_DEM5_040,
+ TX_DEM5_041,
+ TX_DEM5_042,
+ TX_DEM5_043,
+ TX_DEM5_044,
+ TX_DEM5_045,
+ TX_DEM5L027,
+ TX_DEM5L028,
+ TX_DEM5L029,
+ TX_DEM5L030,
+ TX_DEM5L031,
+ TX_DEM5N000,
+ TX_DEM5N001,
+ TX_DEM5N002,
+ TX_DEM5N003,
+ TX_DEM5N004,
+ TX_DEM5N005,
+ TX_DEM5N006,
+ TX_DEM5N007,
+ TX_DEM5N008,
+ TX_DEM5N009,
+ TX_DEM5N010,
+ TX_DEM5N011,
+ TX_DEM5N012,
+ TX_DEM5N013,
+
+
TX_END
};
@@ -324,6 +394,10 @@ const char * const g_gameStrings[] = {
"Sign",
"Klingon",
"Brother Kandrey",
+ "Brother Stephen",
+ "Brother Chub",
+ "Brother Roberts",
+ "Brother Grisnash",
"#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?",
"#DEM0\\DEM0_002#Aside from seeing demons, has any hard data been collected? Any evidence I could see?",
@@ -592,6 +666,72 @@ const char * const g_gameStrings[] = {
"#DEM4\\DEM4N012#It looks like a control panel with slide switches.",
"#DEM4\\DEM4N013#Nothing Happens.",
"#DEM4\\DEM4N014#You fit the key into the slot, but you cannot find a way to turn it.",
+
+
+ "#DEM5\\DEM5_001#Just thinking to myself. Don't mind me.",
+ "#DEM5\\DEM5_002#Can you tell us what they looked like?",
+ "#DEM5\\DEM5_003#It will be good to help them for a change.",
+ "#DEM5\\DEM5_004#Not the good ones, that's for sure.",
+ "#DEM5\\DEM5_005#The demons didn't follow you?",
+ "#DEM5\\DEM5_006#I detect various pieces of mining equipment but nothing of note.",
+ "#DEM5\\DEM5_007#May I suggest using a more diplomatic approach to questioning the colonists. Force will gain us little, if anything.",
+ "#DEM5\\DEM5_008#Jim, that wouldn't be wise.",
+ "#DEM5\\DEM5_009#Jim, these need to be processed first!",
+ "#DEM5\\DEM5_010#This man is getting worse. We've got to find those berries before he dies.",
+ "#DEM5\\DEM5_011#Jim, I've completed my study. I find no evidence for physical or mental disturbances among the colonists, causing them to see hallucinations. There must be other reasons for what these people are seeing.",
+ "#DEM5\\DEM5_012#Jim, this man has suffered severe physical injuries to his head and arm. The wounds have been adequately cared for; however, he has developed the Nugaireyn infection. If not treated swiftly, the effects can be fatal. The infection can normally be treated with Hypo-Dytoxin, but there's none on the Enterprise.",
+ "#DEM5\\DEM5_013#The alien's lifesigns seem stress-elevated. Otherwise he appears fundamentally healthy.",
+ "#DEM5\\DEM5_014#The man is suffering moderately from the effects of his age, but seems healthy, alert, and in fine spirits.",
+ "#DEM5\\DEM5_015#The man seems worried and stressed, but all body functions appear within normal limits.",
+ "#DEM5\\DEM5_016#This man has recently suffered a nasty but non-life-threatening wound. The damage has been adequately cared for. The man's vital effects are attributable to shock and stress.",
+ "#DEM5\\DEM5_017#This man needs help, Jim, and I wouldn't want to put it off for too long.",
+ "#DEM5\\DEM5_018#By our standards yes. Here the Acolytes prefer a simpler life style; unfortunately, this is one of the consequences.",
+ "#DEM5\\DEM5_019#Neither were some of my professors.",
+ "#DEM5\\DEM5_020#So did I, but I became one anyway.",
+ "#DEM5\\DEM5_021#The Acolytes did a lot of good work for the needy in this quadrant.",
+ "#DEM5\\DEM5_022#Why, Spock, you two should get along fine, he sounds just like you.",
+ "#DEM5\\DEM5_023#You know Jim, they can take a captain out of a starship, and a science officer out of his lab, but you can never retire a doctor.",
+ "#DEM5\\DEM5_024#Captain, a Krognik-demon has a decidedly wolfish appearance. Brother Grisnash, is this not the traditional shape of the Evil One and his minions among Tellarites?",
+ "#DEM5\\DEM5_025#I believe this may be significant, Captain.",
+ "#DEM5\\DEM5_026#That is not logical, doctor.",
+ "#DEM5\\DEM5_027#The medical methods of these people seem primitive to me, doctor.",
+ "#DEM5\\DEM5_028#I am Brother Grisnash. I went up the mountainside in solitary prayer, seeking to face my fears. Indeed I found them. A bellowing Krognik-demon with sharp teeth and a long snout descended upon me in a rush of wind.",
+ "#DEM5\\DEM5_029#It is.",
+ "#DEM5\\DEM5_030#Brother Kandrey was -- is -- my partner. I was on the communications link when the demons caused the rockfall and silenced him. He said he'd found a strange door with devilish writing. Truly he came upon the Gate of Hell itself.",
+ "#DEM5\\DEM5_031#You tread close to unholy knowledge, Brother Stephen!",
+ "#DEM5\\DEM5_032#Ahh, I see you found the berries. Meet me in my lab.",
+ "#DEM5\\DEM5_033#Good, you have found the berries. Bring them to my lab quickly.",
+ "#DEM5\\DEM5_034#I am worried about Brother Chub. Can you examine him, Doctor?",
+ "#DEM5\\DEM5_035#Please hurry Doctor. Brother Chub is looking worse.",
+ "#DEM5\\DEM5_036#That's very nice, but I'm busy now.",
+ "#DEM5\\DEM5_037#Those are Laraxian berries. They grow wild by the mine entrance.",
+ "#DEM5\\DEM5_038#Time is of the essence, you must hurry and retrieve the berry.",
+ "#DEM5\\DEM5_039#What an interesting artifact. Hmmm... It appears to have been damaged. When you have a chance, take it to my lab and we'll see if it can be repaired.",
+ "#DEM5\\DEM5_040#I may be of some assistance. The Laraxian Berry grows near the mouth of the cave. If I could acquire it, I would be able to synthesize the Hypo-Dytoxin from the berry. Unfortunately, the demons prevent us from approaching the cave entrance. perhaps you could retrieve it for me.",
+ "#DEM5\\DEM5_041#I am Brother Stephen, an Ignaciate, following the holy teachings with mind and soul alike. I believe the anomalous mineral readings, in combination with evidence of ancient disturbances in this otherwise highly stable geologic location indicates previous habitation of the region, eons ago.",
+ "#DEM5\\DEM5_042#I appreciate your prayers, Brother Roberts. Captain, if you and your people go up the mountain, I hope afterward you will visit me in my study, which is next door. I am too old to make the trek myself, but I am eager for knowledge. In return, I will offer you what insights our God grants these old eyes.",
+ "#DEM5\\DEM5_043#I would be equally honored to discuss medicine with you, Doctor, as science with your Vulcan associate. Let me continue. I believe our God made humans, aliens -- and demons all. If I could get a real demon into my study, I would bless our God for the opportunity, as I thank Him for everything in this life.",
+ "#DEM5\\DEM5_044#My mom wanted me to become a doctor. Honest. But I hated my biology classes.",
+ "#DEM5\\DEM5_045#My uncle John lived with the Acolytes a long time ago. He died in their service, helping plague victims on New Ontario VI twenty years ago.",
+ "#DEM5\\DEM5L027#Thank you. You are most kind.",
+ "#DEM5\\DEM5L028#You'll understand if I don't stand up, I hope. I am not well.",
+ "#DEM5\\DEM5L029#I headed up the party that sought to rescue Brother Kandrey. Without warning, the demons appeared and attacked us as we approached the mine!",
+ "#DEM5\\DEM5L030#Like the demons that have plagued devout folk since before our people left the Earth. Huge muscular demons, with ruddy skin. Truly the manifestation of Evil, with batwings, horns and talons, and a pointed tail. God preserve us all. One tore open my arm and I surely would have perished -- but for my companions who bore me back down the mountain.",
+ "#DEM5\\DEM5L031#No.",
+ "#DEM5\\DEM5N000#A chapel typical of the Acolytes of the Stars.",
+ "#DEM5\\DEM5N001#A grim-faced miner-colonist nods curtly at you.",
+ "#DEM5\\DEM5N002#A majestic view of Mt. Idyll can be seen through the skylight.",
+ "#DEM5\\DEM5N003#A sturdy man of advanced years, whose blue eyes meet yours with clarity, curiosity, and directness.",
+ "#DEM5\\DEM5N004#Boxes of supplies and mining equipment litter the floor.",
+ "#DEM5\\DEM5N005#Ensign Everts cannot take his eyes off the sight of Mount Idyll.",
+ "#DEM5\\DEM5N006#James Kirk takes time to rest and ponder the remainder of the mission.",
+ "#DEM5\\DEM5N007#McCoy looks anxiously about the room.",
+ "#DEM5\\DEM5N008#Spock waits for your command, patient as ever.",
+ "#DEM5\\DEM5N009#The Tellarite appears completely at home surrounded by humans, but the wrinkling on his brow indicates a great deal of worry.",
+ "#DEM5\\DEM5N010#He is too busy consoling the wounded man.",
+ "#DEM5\\DEM5N011#He is too busy consoling the wounded man.",
+ "#DEM5\\DEM5N012#They are too heavy to move.",
+ "#DEM5\\DEM5N013#This man is in no condition to talk.",
};
}
Commit: 1290b7ea0298dc6a565e2593ecb703710d051830
https://github.com/scummvm/scummvm/commit/1290b7ea0298dc6a565e2593ecb703710d051830
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Demon6, including the special case menu
Changed paths:
A engines/startrek/rooms/demon6.cpp
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/demon0.cpp
engines/startrek/rooms/demon3.cpp
engines/startrek/rooms/demon4.cpp
engines/startrek/rooms/demon5.cpp
engines/startrek/rooms/function_map.h
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index e118b3d..e023200 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -79,7 +79,7 @@ void StarTrekEngine::loadRoom(const Common::String &missionName, int roomIndex)
_screenName = _missionName + (char)(_roomIndex + '0');
_gfx->setBackgroundImage(_gfx->loadBitmap(_screenName));
- _gfx->loadPri(_screenName + ".pri");
+ _gfx->loadPri(_screenName);
_gfx->loadPalette("palette");
_gfx->copyBackgroundScreen();
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index f27a65c..0ad2946 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -54,16 +54,19 @@ struct AwayMission {
// Demon World
struct {
bool wasRudeToPrelate; // 0x29
+ bool insultedStephen; // 0x2b
bool beatKlingons; // 0x2f
bool tookKlingonHand; // 0x31
bool talkedToPrelate; // 0x33
+ bool stephenWelcomedToStudy; // 0x34
+ bool prelateWelcomedCrew; // 0x35
bool askedPrelateAboutSightings; // 0x36
byte field37; // 0x37
bool mccoyMentionedFlora; // 0x38
byte numBouldersGone; // 0x39
byte enteredFrom; // 0x3a
- bool field3b; // 0x3b
+ bool repairedHand; // 0x3b
bool healedMiner; // 0x3c
bool curedChub; // 0x3d
bool field3e; // 0x3e
@@ -80,9 +83,11 @@ struct AwayMission {
bool boulder4Gone; // 0x4c
bool doorOpened; // 0x4d
bool field4e; // 0x4e
- byte field4f; // 0x4f
+ byte itemsTakenFromCase; // 0x4f
bool gotBerries; // 0x50
bool madeHypoDytoxin; // 0x51
+ bool gavePointsForDytoxin; // 0x54
+ bool lookedAtComputer; // 0x55
byte field56; // 0x56
bool foundAlienRoom; // 0x57
} demon;
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index a5b2b7b..145a156 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -46,6 +46,7 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_font = new Font(_vm);
_numSprites = 0;
+ _pushedNumSprites = -1;
_palData = new byte[256 * 3];
_lutData = new byte[256 * 3];
@@ -160,7 +161,7 @@ void Graphics::decPaletteFadeLevel() {
void Graphics::loadPri(const Common::String &priFile) {
- SharedPtr<FileStream> priStream = _vm->loadFile(priFile);
+ SharedPtr<FileStream> priStream = _vm->loadFile(priFile + ".pri");
priStream->read(_priData, SCREEN_WIDTH * SCREEN_HEIGHT / 2);
}
@@ -555,6 +556,15 @@ void Graphics::drawAllSprites(bool updateScreen) {
}
/**
+ * Sets "bitmapChanged" to true on all sprites before calling drawAllSprites.
+ */
+void Graphics::forceDrawAllSprites(bool updateScreen) {
+ for (int i = 0; i < _numSprites; i++)
+ _sprites[i]->bitmapChanged = true;
+ drawAllSprites(updateScreen);
+}
+
+/**
* Returns the sprite at the given position (ignores mouse).
*/
Sprite *Graphics::getSpriteAt(int16 x, int16 y) {
@@ -613,6 +623,24 @@ void Graphics::delSprite(Sprite *sprite) {
error("delSprite: sprite not in list");
}
+void Graphics::pushSprites() {
+ if (_pushedNumSprites != -1)
+ error("Tried to push sprites more than once");
+ _pushedNumSprites = _numSprites;
+ memcpy(_pushedSprites, _sprites, sizeof(_sprites));
+
+ _numSprites = 0;
+}
+
+void Graphics::popSprites() {
+ if (_pushedNumSprites == -1)
+ error("Tried to pop sprites without a prior push");
+ _numSprites = _pushedNumSprites;
+ memcpy(_sprites, _pushedSprites, sizeof(_sprites));
+
+ _pushedNumSprites = -1;
+}
+
void Graphics::copyBackgroundScreen() {
drawDirectToScreen(_backgroundImage);
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 5c09cfa..49d2a3a 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -76,11 +76,16 @@ public:
void drawSprite(const Sprite &sprite);
void drawSprite(const Sprite &sprite, const Common::Rect &rect);
void drawAllSprites(bool updateScreen=true);
+ void forceDrawAllSprites(bool updateScreen=true);
Sprite *getSpriteAt(int16 x, int16 y);
+ Sprite *getSpriteAt(Common::Point p) { return getSpriteAt(p.x, p.y); }
void addSprite(Sprite *sprite);
void delSprite(Sprite *sprite);
+ // Save/load the current state of sprites. Can only push once for now.
+ void pushSprites();
+ void popSprites();
void copyBackgroundScreen();
void drawDirectToScreen(SharedPtr<Bitmap> bitmap);
@@ -105,6 +110,10 @@ private:
Sprite *_sprites[MAX_SPRITES];
int _numSprites;
+ // Analagous to above, used when pushing/popping
+ Sprite *_pushedSprites[MAX_SPRITES];
+ int _pushedNumSprites;
+
// Any changes to the mouse image are buffered until the next time "drawAllSprites" is
// called (since the original game treats it like a sprite).
bool _mouseToBeShown;
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 7f089ca..040091d 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -23,7 +23,8 @@ MODULE_OBJS = \
rooms/demon2.o \
rooms/demon3.o \
rooms/demon4.o \
- rooms/demon5.o
+ rooms/demon5.o \
+ rooms/demon6.o \
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 8a71961..7110c4d 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -61,6 +61,10 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_roomActionList = demon5ActionList;
_numRoomActions = sizeof(demon5ActionList) / sizeof(RoomAction);
}
+ else if (name == "DEMON6") {
+ _roomActionList = demon6ActionList;
+ _numRoomActions = sizeof(demon6ActionList) / sizeof(RoomAction);
+ }
else {
warning("Room \"%s\" unimplemented", name.c_str());
_numRoomActions = 0;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 9943509..027dbd6 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -107,6 +107,7 @@ private:
void loseItem(int item); // Cmd 0x07
void walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam);// Cmd 0x08
void loadMapFile(const Common::String &name); // Cmd 0x09
+ // Command 0x0c: "demon6ShowCase"
Common::Point getActorPos(int actorIndex); // Cmd 0x0d
void playSoundEffectIndex(int soundEffect); // Cmd 0x0f
void playMidiMusicTracks(int startTrack, int loopTrack); // Cmd 0x10
@@ -370,6 +371,71 @@ public:
void demon5CheckCompletedStudy();
void demon5GetCrate();
+ // DEMON6
+ void demon6Tick1();
+ void demon6Tick30();
+ void demon6SpockReachedComputer();
+ void demon6WalkToDoor();
+ void demon6TouchedDoorOpenTrigger();
+ void demon6DoorOpenedOrReachedDoor();
+ void demon6UsePhaserOnStephen();
+ void demon6UsePhaserOnCase();
+ void demon6LookAtWorkspace();
+ void demon6LookAtCase();
+ void demon6LookAtTable();
+ void demon6LookAtMineral();
+ void demon6LookAtShells();
+ void demon6LookAtSkull();
+ void demon6LookAtMetal();
+ void demon6LookAtMeteor();
+ void demon6LookAtMountain();
+ void demon6LookAtSynthesizer();
+ void demon6LookAtKirk();
+ void demon6LookAtSpock();
+ void demon6LookAtMccoy();
+ void demon6LookAtRedshirt();
+ void demon6LookAtComputer();
+ void demon6LookAnywhere();
+ void demon6LookAtStephen();
+ void demon6TalkToMccoy();
+ void demon6TalkToSpock();
+ void demon6TalkToKirk();
+ void demon6TalkToRedshirt();
+ void demon6TalkToStephen();
+ void demon6UseBerryOnStephen();
+ void demon6UseBerryOnSynthesizer();
+ void demon6MccoyReachedSynthesizer();
+ void demon6FinishedMakingHypoDytoxin();
+ void demon6UseHandOnWorkspace();
+ void demon6SpockReachedWorkspace();
+ void demon6SpockFinishedRepairingHand();
+ void demon6UseAnythingOnWorkspace();
+ void demon6UseCrewmanOnCase();
+ void demon6UseKirkOnComputer();
+ void demon6UseMccoyOnComputer();
+ void demon6UseRedshirtOnComputer();
+ void demon6UseSpockOnComputer();
+ void demon6UseMineralOnStephen();
+ void demon6UseShellsOnStephen();
+ void demon6UseMeteorOnStephen();
+ void demon6UseSkullOnStephen();
+ void demon6UseMetalOnStephen();
+ void demon6ReturnItemToStephen(int item);
+ void demon6UseHandOnStephen();
+ void demon6UseMTricoderOnStephen();
+ void demon6UseSTricoderOnTable();
+ void demon6UseSTricoderOnComputer();
+ void demon6UseSTricoderOnMineral();
+ void demon6UseSTricoderOnShells();
+ void demon6UseSTricoderOnSkull();
+ void demon6UseSTricoderOnMetal();
+ void demon6UseSTricoderOnMeteor();
+ void demon6UseSTricoderOnCase();
+ void demon6UseSTricoderOnSynthesizer();
+ void demon6GetCase();
+ void demon6KirkReachedCase();
+ int demon6ShowCase(int visible);
+
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
@@ -414,6 +480,14 @@ private:
bool movingToDoor; // 0xd5
} demon5;
+ struct {
+ bool insultedStephenRecently; // 0xca
+ bool stephenInRoom; // 0xcb
+ bool caseOpened; // 0xcd
+ byte doorCounter; // 0xce
+ bool movingToDoor; // 0xcf
+ } demon6;
+
} _roomVar;
};
diff --git a/engines/startrek/rooms/demon0.cpp b/engines/startrek/rooms/demon0.cpp
index d69f8f1..2986810 100644
--- a/engines/startrek/rooms/demon0.cpp
+++ b/engines/startrek/rooms/demon0.cpp
@@ -43,6 +43,9 @@ void Room::demon0Tick60() {
}
void Room::demon0Tick100() {
+ if (_vm->_awayMission.demon.talkedToPrelate || _vm->_awayMission.demon.prelateWelcomedCrew)
+ return;
+ _vm->_awayMission.demon.prelateWelcomedCrew = true;
showText(TX_SPEAKER_ANGIVEN, TX_DEM0_036);
}
diff --git a/engines/startrek/rooms/demon3.cpp b/engines/startrek/rooms/demon3.cpp
index 07bb454..dbd0c67 100644
--- a/engines/startrek/rooms/demon3.cpp
+++ b/engines/startrek/rooms/demon3.cpp
@@ -85,7 +85,7 @@ void Room::demon3Timer1Expired() {
// Door just opened
void Room::demon3Timer3Expired() {
- if (_vm->_awayMission.demon.field3b) {
+ if (_vm->_awayMission.demon.repairedHand) {
showText(TX_DEM3N008);
loadActorAnim(14, "door", 0x82, 0xc, 0);
loadMapFile("demon3");
diff --git a/engines/startrek/rooms/demon4.cpp b/engines/startrek/rooms/demon4.cpp
index 2993c17..5228632 100644
--- a/engines/startrek/rooms/demon4.cpp
+++ b/engines/startrek/rooms/demon4.cpp
@@ -35,7 +35,7 @@ void Room::demon4Tick1() {
loadActorAnim(8, "stpout2", 0x107, 0x92, 0);
_roomVar.demon4.cb = true;
- if ((_vm->_awayMission.demon.field4f & 0x10) && !_vm->_awayMission.demon.field47)
+ if ((_vm->_awayMission.demon.itemsTakenFromCase & 0x10) && !_vm->_awayMission.demon.field47)
_vm->_awayMission.timers[6] = 20;
}
diff --git a/engines/startrek/rooms/demon5.cpp b/engines/startrek/rooms/demon5.cpp
index 94962db..4282ca1 100644
--- a/engines/startrek/rooms/demon5.cpp
+++ b/engines/startrek/rooms/demon5.cpp
@@ -62,12 +62,13 @@ void Room::demon5UseSTricorderOnCrate() {
showText(TX_SPEAKER_SPOCK, TX_DEM5_006);
}
+// FIXME: should work when used on people as well, but doesn't
void Room::demon5UsePhaserOnAnything() {
showText(TX_SPEAKER_SPOCK, TX_DEM5_007);
}
void Room::demon5UseHandOnStephen() {
- if (_vm->_awayMission.demon.field3b)
+ if (_vm->_awayMission.demon.repairedHand)
showText(TX_SPEAKER_STEPHEN, TX_DEM5_036);
else
showText(TX_SPEAKER_STEPHEN, TX_DEM5_039);
diff --git a/engines/startrek/rooms/demon6.cpp b/engines/startrek/rooms/demon6.cpp
new file mode 100644
index 0000000..42bb662
--- /dev/null
+++ b/engines/startrek/rooms/demon6.cpp
@@ -0,0 +1,571 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+void Room::demon6Tick1() {
+ playVoc("DEM6LOOP");
+ if (_vm->_awayMission.demon.gotBerries || (!_vm->_awayMission.demon.field3e && _vm->_awayMission.demon.field37)) {
+ loadActorAnim(8, "oldman", 0x5f, 0xb1, 0);
+ _roomVar.demon6.stephenInRoom = true;
+ }
+ loadActorAnim(10, "s0r6d2", 0xa0, 0x92, 0);
+ loadActorAnim(9, "scrnan", 0, 0xc7, 0);
+}
+
+void Room::demon6Tick30() {
+ if (!_vm->_awayMission.demon.gotBerries)
+ return;
+ if (_vm->_awayMission.demon.field3e)
+ return;
+ if (!_vm->_awayMission.demon.field37)
+ return;
+ if (_vm->_awayMission.demon.stephenWelcomedToStudy)
+ return;
+
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_042);
+ _vm->_awayMission.demon.stephenWelcomedToStudy = true;
+}
+
+void Room::demon6SpockReachedComputer() {
+ showText(TX_SPEAKER_SPOCK, TX_DEM6_014);
+}
+
+void Room::demon6WalkToDoor() {
+ _vm->_awayMission.disableInput = true;
+ _roomVar.demon6.movingToDoor = true;
+ walkCrewman(OBJECT_KIRK, 0xa0, 0x94, 4);
+}
+
+void Room::demon6TouchedDoorOpenTrigger() {
+ if (!_roomVar.demon6.movingToDoor)
+ return;
+ loadActorAnim(10, "s0r6d1", 0xa0, 0x92, 2);
+ playSoundEffectIndex(5);
+}
+
+void Room::demon6DoorOpenedOrReachedDoor() {
+ _roomVar.demon6.doorCounter++;
+ if (_roomVar.demon6.doorCounter == 2)
+ loadRoomIndex(0, 2);
+}
+
+void Room::demon6UsePhaserOnStephen() {
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_028);
+}
+
+void Room::demon6UsePhaserOnCase() {
+ showText(TX_SPEAKER_MCCOY, TX_DEM6_017);
+}
+
+void Room::demon6LookAtWorkspace() {
+ showText(TX_DEM6N003);
+}
+
+void Room::demon6LookAtCase() {
+ showText(TX_DEM6N001);
+}
+
+void Room::demon6LookAtTable() {
+ showText(TX_DEM6N007);
+}
+
+void Room::demon6LookAtMineral() {
+ showText(TX_DEM6N016);
+}
+
+void Room::demon6LookAtShells() {
+ showText(TX_DEM6N011);
+}
+
+void Room::demon6LookAtSkull() {
+ showText(TX_DEM6N017);
+}
+
+void Room::demon6LookAtMetal() {
+ showText(TX_DEM6N005);
+}
+
+void Room::demon6LookAtMeteor() {
+ showText(TX_DEM6N000);
+}
+
+void Room::demon6LookAtMountain() {
+ showText(TX_DEM6N002);
+}
+
+void Room::demon6LookAtSynthesizer() {
+ showText(TX_DEM6N004);
+}
+
+void Room::demon6LookAtKirk() {
+ showText(TX_DEM6N008);
+}
+
+void Room::demon6LookAtSpock() {
+ showText(TX_DEM6N015);
+}
+
+void Room::demon6LookAtMccoy() {
+ showText(TX_DEM6N009);
+}
+
+void Room::demon6LookAtRedshirt() {
+ showText(TX_DEM6N010);
+}
+
+void Room::demon6LookAtComputer() {
+ showText(TX_DEM6N006);
+ if (!_vm->_awayMission.demon.lookedAtComputer) {
+ _vm->_awayMission.demon.lookedAtComputer = true;
+ _vm->_awayMission.missionScore++;
+ }
+}
+
+void Room::demon6LookAnywhere() {
+ showText(TX_DEM6N024);
+}
+
+void Room::demon6LookAtStephen() {
+ showText(TX_DEM6N021);
+}
+
+void Room::demon6TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_DEM6_020);
+}
+
+void Room::demon6TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_DEM6_025);
+}
+
+void Room::demon6TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_DEM6_002);
+}
+
+void Room::demon6TalkToRedshirt() {
+ showText(TX_SPEAKER_EVERTS, TX_DEM6_053);
+}
+
+void Room::demon6TalkToStephen() {
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_035);
+}
+
+void Room::demon6UseBerryOnStephen() {
+ if (_vm->_awayMission.demon.knowAboutHypoDytoxin) {
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_027);
+ }
+ else {
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_026);
+ }
+}
+
+void Room::demon6UseBerryOnSynthesizer() {
+ if (!_vm->_awayMission.demon.knowAboutHypoDytoxin)
+ return;
+ walkCrewman(OBJECT_MCCOY, 0x104, 0xa5, 1);
+}
+
+void Room::demon6MccoyReachedSynthesizer() {
+ loadActorAnim2(OBJECT_MCCOY, "musemn", -1, -1, 1);
+ playVoc("LD1REPLI");
+}
+
+void Room::demon6FinishedMakingHypoDytoxin() {
+ playMidiMusicTracks(-1, -1);
+ showText(TX_DEM6N023);
+ showText(TX_SPEAKER_MCCOY, TX_DEM6_018);
+
+ giveItem(OBJECT_IDETOXIN);
+ _vm->_awayMission.demon.madeHypoDytoxin = true;
+ loseItem(OBJECT_IBERRY);
+
+ if (!_vm->_awayMission.demon.gavePointsForDytoxin) {
+ _vm->_awayMission.demon.gavePointsForDytoxin = true;
+ _vm->_awayMission.missionScore++;
+ }
+}
+
+void Room::demon6UseHandOnWorkspace() {
+ if (_vm->_awayMission.demon.repairedHand) {
+ showText(TX_SPEAKER_SPOCK, TX_DEM6N018); // FIXME
+ }
+ else {
+ _vm->_awayMission.disableInput = true;
+ showText(TX_SPEAKER_KIRK, TX_DEM6_005);
+ walkCrewman(OBJECT_SPOCK, 0xb3, 0xbb, 2);
+ }
+}
+
+void Room::demon6SpockReachedWorkspace() {
+ loadActorAnim(OBJECT_SPOCK, "spokop", 0xb3, 0xbb, 3);
+}
+
+void Room::demon6SpockFinishedRepairingHand() {
+ showText(TX_SPEAKER_SPOCK, TX_DEM6_024);
+ _vm->_awayMission.demon.repairedHand = true;
+ _vm->_awayMission.missionScore += 2;
+ loadActorStandAnim(OBJECT_SPOCK);
+ _vm->_awayMission.disableInput = false;
+}
+
+// FIXME: doesn't work
+void Room::demon6UseAnythingOnWorkspace() {
+ showText(TX_DEM6N020);
+}
+
+void Room::demon6UseCrewmanOnCase() {
+ if (_roomVar.demon6.stephenInRoom) {
+ if (_roomVar.demon6.insultedStephenRecently)
+ return;
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_044);
+ int choices1[] = {TX_SPEAKER_KIRK, TX_DEM6_001, TX_DEM6_006, TX_DEM6_003, TX_BLANK};
+ int choice = showText(choices1);
+
+ if (choice == 0) {
+insult:
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_030);
+ _roomVar.demon6.insultedStephenRecently = true;
+ _vm->_awayMission.demon.insultedStephen = true;
+ }
+ else if (choice == 1) {
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_034);
+explain:
+ while (true) {
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_051);
+ int choices2[] = {TX_SPEAKER_STEPHEN, TX_DEM6_045, TX_DEM6_046, TX_DEM6_047, TX_DEM6_048, TX_DEM6_049, TX_DEM6_050, TX_BLANK};
+ choice = showText(choices2);
+
+ switch (choice) {
+ case 0:
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_040);
+ break;
+ case 1:
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_033);
+ break;
+ case 2:
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_036);
+ break;
+ case 3:
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_038);
+ break;
+ case 4:
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_039);
+ break;
+ case 5:
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_041);
+ _roomVar.demon6.caseOpened = true;
+ return;
+ default:
+ goto error;
+ }
+ }
+ }
+ else if (choice == 2) {
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_031);
+ int choices3[] = {TX_SPEAKER_KIRK, TX_DEM6_001, TX_DEM6_006, TX_BLANK};
+ choice = showText(choices3);
+
+ if (choice == 0)
+ goto insult;
+ else if (choice == 1)
+ goto explain;
+ else
+ goto error;
+ }
+ else {
+error:
+ showText(TX_DIALOG_ERROR);
+ }
+ }
+ else {
+ showText(TX_DEM6N012);
+ showText(TX_SPEAKER_MCCOY, TX_DEM6_019);
+ }
+}
+
+void Room::demon6UseKirkOnComputer() {
+ showText(TX_SPEAKER_KIRK, TX_DEM6_004);
+ demon6UseSpockOnComputer();
+}
+
+void Room::demon6UseMccoyOnComputer() {
+ showText(TX_SPEAKER_MCCOY, TX_DEM6_015);
+}
+
+void Room::demon6UseRedshirtOnComputer() {
+ showText(TX_SPEAKER_EVERTS, TX_DEM6_052);
+}
+
+void Room::demon6UseSpockOnComputer() {
+ walkCrewman(OBJECT_SPOCK, 0x3d, 0xc5, 3);
+}
+
+void Room::demon6UseMineralOnStephen() {
+ _vm->_awayMission.demon.itemsTakenFromCase &= ~8;
+ demon6ReturnItemToStephen(OBJECT_IMINERAL);
+}
+
+void Room::demon6UseShellsOnStephen() {
+ _vm->_awayMission.demon.itemsTakenFromCase &= ~2;
+ demon6ReturnItemToStephen(OBJECT_ISHELLS);
+}
+
+void Room::demon6UseMeteorOnStephen() {
+ _vm->_awayMission.demon.itemsTakenFromCase &= ~4;
+ demon6ReturnItemToStephen(OBJECT_IMETEOR);
+}
+
+void Room::demon6UseSkullOnStephen() {
+ _vm->_awayMission.demon.itemsTakenFromCase &= ~16;
+ demon6ReturnItemToStephen(OBJECT_ISKULL);
+}
+
+void Room::demon6UseMetalOnStephen() {
+ _vm->_awayMission.demon.itemsTakenFromCase &= ~1;
+ demon6ReturnItemToStephen(OBJECT_IMETAL);
+}
+
+void Room::demon6ReturnItemToStephen(int item) {
+ loseItem(item);
+ showText(TX_DEM6N019);
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_029);
+}
+
+void Room::demon6UseHandOnStephen() {
+ if (_vm->_awayMission.demon.repairedHand)
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_037);
+ else
+ showText(TX_SPEAKER_STEPHEN, TX_DEM6_043);
+}
+
+void Room::demon6UseMTricoderOnStephen() {
+ loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_MCCOY, TX_DEM6_016);
+}
+
+void Room::demon6UseSTricoderOnTable() {
+ loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM6_009);
+}
+
+void Room::demon6UseSTricoderOnComputer() {
+ loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM6_007);
+}
+
+void Room::demon6UseSTricoderOnMineral() {
+ loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM6_013);
+}
+
+void Room::demon6UseSTricoderOnShells() {
+ loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM6_021);
+}
+
+void Room::demon6UseSTricoderOnSkull() {
+ loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM6_012);
+}
+
+void Room::demon6UseSTricoderOnMetal() {
+ loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM6_011);
+}
+
+void Room::demon6UseSTricoderOnMeteor() {
+ loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM6_010);
+}
+
+void Room::demon6UseSTricoderOnCase() {
+ loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM6_023);
+}
+
+void Room::demon6UseSTricoderOnSynthesizer() {
+ loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM6_008);
+}
+
+void Room::demon6GetCase() {
+ if (!_roomVar.demon6.caseOpened)
+ showText(TX_DEM6N022);
+ else
+ walkCrewman(OBJECT_KIRK, 0xff, 0xba, 5);
+}
+
+void Room::demon6KirkReachedCase() {
+ const int items[] = { OBJECT_IMETAL, OBJECT_ISHELLS, OBJECT_IMETEOR, OBJECT_IMINERAL, OBJECT_ISKULL };
+ byte ret = 0x1f ^ demon6ShowCase(_vm->_awayMission.demon.itemsTakenFromCase ^ 0x1f);
+ _vm->_awayMission.demon.itemsTakenFromCase = ret;
+
+ const int *i = items;
+ while (ret != 0) {
+ if (ret & 1)
+ giveItem(*i);
+ i++;
+ ret >>= 1;
+ }
+}
+
+int Room::demon6ShowCase(int visible) {
+ const Common::Point spritePositions[] = {
+ Common::Point(0x29, 0x80),
+ Common::Point(0x58, 0x7d),
+ Common::Point(0x82, 0x7d),
+ Common::Point(0xae, 0x79),
+ Common::Point(0xe1, 0x7d)
+ };
+
+ _vm->_gfx->fadeoutScreen();
+ _vm->_gfx->pushSprites();
+
+ _vm->_gfx->setBackgroundImage(_vm->_gfx->loadBitmap("stlcase"));
+ _vm->_gfx->copyBackgroundScreen();
+ _vm->_gfx->clearPri();
+
+ Sprite sprites[5];
+
+ for (int i = 0; i < 5; i++) {
+ if (!(visible & (0x10 >> i)))
+ continue;
+ _vm->_gfx->addSprite(&sprites[i]);
+ sprites[i].pos.x = spritePositions[i].x;
+ sprites[i].pos.y = spritePositions[i].y;
+ sprites[i].drawPriority = 2;
+ sprites[i].bitmapChanged = true;
+ sprites[i].bitmap = _vm->_gfx->loadBitmap(Common::String::format("stlitem%d", i));
+ }
+
+ Sprite buttonSprite;
+ _vm->_gfx->addSprite(&buttonSprite);
+
+ // BUGFIX: use draw mode 2 so the entire button is clickable (not just non-transparent parts)
+ buttonSprite.drawMode = 2;
+
+ buttonSprite.pos.x = 0xe1;
+ buttonSprite.pos.y = 0x19;
+ buttonSprite.drawPriority = 2;
+ buttonSprite.bitmapChanged = true;
+ buttonSprite.bitmap = _vm->_gfx->loadBitmap("donebutt");
+
+ _vm->_gfx->forceDrawAllSprites();
+ _vm->_gfx->fadeinScreen();
+
+ bool exitLoop = false;
+
+ while (!exitLoop) {
+ TrekEvent event;
+ if (!_vm->popNextEvent(&event))
+ continue;
+
+ switch (event.type) {
+ case TREKEVENT_TICK:
+ _vm->_gfx->drawAllSprites();
+ break;
+
+ case TREKEVENT_LBUTTONDOWN: {
+lclick:
+ Sprite *clickedSprite = _vm->_gfx->getSpriteAt(_vm->_gfx->getMousePos());
+ if (clickedSprite == &buttonSprite)
+ exitLoop = true;
+ else if (clickedSprite != nullptr) {
+ while (clickedSprite->pos.y < SCREEN_HEIGHT) { // Move the selected item down and off the screen.
+ clickedSprite->drawPriority = 8;
+ clickedSprite->bitmapChanged = true;
+ _vm->_gfx->drawAllSprites();
+
+ // WORKAROUND: original game had no bound on how fast the items move
+ // off the screen. Here I bind it to the tick event.
+ // (This was probably the intended behaviour since the original game
+ // does check the clock cycle, but doesn't do a proper comparison with
+ // it.)
+ while (event.type != TREKEVENT_TICK) {
+ if (!_vm->popNextEvent(&event))
+ continue;
+ }
+ clickedSprite->pos.y++;
+ }
+
+ clickedSprite->dontDrawNextFrame();
+ _vm->_gfx->drawAllSprites();
+ _vm->_gfx->delSprite(clickedSprite);
+ clickedSprite->bitmap.reset();
+ int i = clickedSprite - sprites;
+ visible ^= (0x10 >> i);
+ }
+ break;
+ }
+
+ case TREKEVENT_RBUTTONDOWN:
+ exitLoop = true;
+ break;
+
+ case TREKEVENT_KEYDOWN:
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_ESCAPE:
+ exitLoop = true;
+ break;
+
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ case Common::KEYCODE_F1:
+ goto lclick;
+
+ case Common::KEYCODE_F2:
+ exitLoop = true;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ _vm->_gfx->fadeoutScreen();
+ _vm->_gfx->popSprites();
+ _vm->_gfx->loadPri(_vm->_screenName);
+ _vm->_gfx->setBackgroundImage(_vm->_gfx->loadBitmap(_vm->_screenName));
+ _vm->_gfx->copyBackgroundScreen();
+ _vm->_gfx->forceDrawAllSprites();
+
+ return visible;
+}
+
+}
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index d0cbff8..fc5f73a 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -399,6 +399,86 @@ RoomAction demon5ActionList[] = {
{ Action(ACTION_GET, 0x21, 0, 0), &Room::demon5GetCrate },
};
+RoomAction demon6ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::demon6Tick1 },
+ { Action(ACTION_TICK, 30, 0, 0), &Room::demon6Tick30 },
+ { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::demon6SpockReachedComputer },
+
+ { Action(ACTION_WALK, 0x26, 0, 0), &Room::demon6WalkToDoor },
+ { Action(ACTION_WALK, 10, 0, 0), &Room::demon6WalkToDoor },
+ { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::demon6TouchedDoorOpenTrigger },
+ { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::demon6DoorOpenedOrReachedDoor },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::demon6DoorOpenedOrReachedDoor },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::demon6UsePhaserOnStephen },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::demon6UsePhaserOnStephen },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 0x20, 0), &Room::demon6UsePhaserOnCase },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 0x20, 0), &Room::demon6UsePhaserOnCase },
+ { Action(ACTION_LOOK, 0x22, 0, 0), &Room::demon6LookAtWorkspace },
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon6LookAtCase },
+ { Action(ACTION_LOOK, 0x25, 0, 0), &Room::demon6LookAtTable },
+ { Action(ACTION_LOOK, OBJECT_IMINERAL, 0, 0), &Room::demon6LookAtMineral },
+ { Action(ACTION_LOOK, OBJECT_ISHELLS, 0, 0), &Room::demon6LookAtShells },
+ { Action(ACTION_LOOK, OBJECT_ISKULL, 0, 0), &Room::demon6LookAtSkull },
+ { Action(ACTION_LOOK, OBJECT_IMETAL, 0, 0), &Room::demon6LookAtMetal },
+ { Action(ACTION_LOOK, OBJECT_IMETEOR, 0, 0), &Room::demon6LookAtMeteor },
+ { Action(ACTION_LOOK, 0x24, 0, 0), &Room::demon6LookAtMountain },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::demon6LookAtSynthesizer },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::demon6LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::demon6LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::demon6LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::demon6LookAtRedshirt },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::demon6LookAtComputer },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::demon6LookAtComputer },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::demon6LookAnywhere },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::demon6LookAtStephen },
+
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::demon6TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::demon6TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::demon6TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::demon6TalkToRedshirt },
+ { Action(ACTION_TALK, 8, 0, 0), &Room::demon6TalkToStephen },
+ { Action(ACTION_USE, OBJECT_IBERRY, 8, 0), &Room::demon6UseBerryOnStephen },
+ { Action(ACTION_USE, OBJECT_IBERRY, 0x23, 0), &Room::demon6UseBerryOnSynthesizer },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::demon6MccoyReachedSynthesizer },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::demon6FinishedMakingHypoDytoxin },
+ { Action(ACTION_USE, OBJECT_IHAND, 0x22, 0), &Room::demon6UseHandOnWorkspace },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::demon6SpockReachedWorkspace },
+ { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::demon6SpockFinishedRepairingHand },
+ { Action(ACTION_USE, -1, 0x22, 0), &Room::demon6UseAnythingOnWorkspace },
+ { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::demon6UseCrewmanOnCase },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::demon6UseCrewmanOnCase },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::demon6UseCrewmanOnCase },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::demon6UseCrewmanOnCase },
+
+ { Action(ACTION_USE, OBJECT_KIRK, 0x21, 0), &Room::demon6UseKirkOnComputer },
+ { Action(ACTION_USE, OBJECT_KIRK, 9, 0), &Room::demon6UseKirkOnComputer },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x21, 0), &Room::demon6UseMccoyOnComputer },
+ { Action(ACTION_USE, OBJECT_MCCOY, 9, 0), &Room::demon6UseMccoyOnComputer },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x21, 0), &Room::demon6UseRedshirtOnComputer },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 9, 0), &Room::demon6UseRedshirtOnComputer },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x21, 0), &Room::demon6UseSpockOnComputer },
+ { Action(ACTION_USE, OBJECT_SPOCK, 9, 0), &Room::demon6UseSpockOnComputer },
+ { Action(ACTION_USE, OBJECT_IMINERAL, 8, 0), &Room::demon6UseMineralOnStephen },
+ { Action(ACTION_USE, OBJECT_ISHELLS, 8, 0), &Room::demon6UseShellsOnStephen },
+ { Action(ACTION_USE, OBJECT_IMETEOR, 8, 0), &Room::demon6UseMeteorOnStephen },
+ { Action(ACTION_USE, OBJECT_ISKULL, 8, 0), &Room::demon6UseSkullOnStephen },
+ { Action(ACTION_USE, OBJECT_IMETAL, 8, 0), &Room::demon6UseMetalOnStephen },
+ { Action(ACTION_USE, OBJECT_IHAND, 8, 0), &Room::demon6UseHandOnStephen },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::demon6UseMTricoderOnStephen },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x25, 0), &Room::demon6UseSTricoderOnTable },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 9, 0), &Room::demon6UseSTricoderOnComputer },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::demon6UseSTricoderOnComputer },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, OBJECT_IMINERAL, 0), &Room::demon6UseSTricoderOnMineral },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, OBJECT_ISHELLS, 0), &Room::demon6UseSTricoderOnShells },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, OBJECT_ISKULL, 0), &Room::demon6UseSTricoderOnSkull },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, OBJECT_IMETAL, 0), &Room::demon6UseSTricoderOnMetal },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, OBJECT_IMETEOR, 0), &Room::demon6UseSTricoderOnMeteor },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::demon6UseSTricoderOnCase },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::demon6UseSTricoderOnSynthesizer },
+ { Action(ACTION_GET, 0x20, 0, 0), &Room::demon6GetCase },
+ { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::demon6KirkReachedCase },
+};
+
}
#endif
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index a8e7552..95b49a1 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -28,6 +28,8 @@ namespace StarTrek {
enum GameStringIDs {
TX_NULL,
TX_BLANK,
+ TX_DIALOG_ERROR,
+
TX_SPEAKER_KIRK,
TX_SPEAKER_SPOCK,
TX_SPEAKER_MCCOY,
@@ -378,12 +380,94 @@ enum GameStringIDs {
TX_DEM5N013,
+ TX_DEM6_001,
+ TX_DEM6_002,
+ TX_DEM6_003,
+ TX_DEM6_004,
+ TX_DEM6_005,
+ TX_DEM6_006,
+ TX_DEM6_007,
+ TX_DEM6_008,
+ TX_DEM6_009,
+ TX_DEM6_010,
+ TX_DEM6_011,
+ TX_DEM6_012,
+ TX_DEM6_013,
+ TX_DEM6_014,
+ TX_DEM6_015,
+ TX_DEM6_016,
+ TX_DEM6_017,
+ TX_DEM6_018,
+ TX_DEM6_019,
+ TX_DEM6_020,
+ TX_DEM6_021,
+ TX_DEM6_022,
+ TX_DEM6_023,
+ TX_DEM6_024,
+ TX_DEM6_025,
+ TX_DEM6_026,
+ TX_DEM6_027,
+ TX_DEM6_028,
+ TX_DEM6_029,
+ TX_DEM6_030,
+ TX_DEM6_031,
+ TX_DEM6_032,
+ TX_DEM6_033,
+ TX_DEM6_034,
+ TX_DEM6_035,
+ TX_DEM6_036,
+ TX_DEM6_037,
+ TX_DEM6_038,
+ TX_DEM6_039,
+ TX_DEM6_040,
+ TX_DEM6_041,
+ TX_DEM6_042,
+ TX_DEM6_043,
+ TX_DEM6_044,
+ TX_DEM6_045,
+ TX_DEM6_046,
+ TX_DEM6_047,
+ TX_DEM6_048,
+ TX_DEM6_049,
+ TX_DEM6_050,
+ TX_DEM6_051,
+ TX_DEM6_052,
+ TX_DEM6_053,
+ TX_DEM6N000,
+ TX_DEM6N001,
+ TX_DEM6N002,
+ TX_DEM6N003,
+ TX_DEM6N004,
+ TX_DEM6N005,
+ TX_DEM6N006,
+ TX_DEM6N007,
+ TX_DEM6N008,
+ TX_DEM6N009,
+ TX_DEM6N010,
+ TX_DEM6N011,
+ TX_DEM6N012,
+ TX_DEM6N013,
+ TX_DEM6N014,
+ TX_DEM6N015,
+ TX_DEM6N016,
+ TX_DEM6N017,
+ TX_DEM6N018,
+ TX_DEM6N019,
+ TX_DEM6N020,
+ TX_DEM6N021,
+ TX_DEM6N022,
+ TX_DEM6N023,
+ TX_DEM6N024,
+
+
TX_END
};
const char * const g_gameStrings[] = {
nullptr,
"",
+ "There is a dialog error here.",
+
"Capt. Kirk",
"Mr. Spock",
"Dr. McCoy",
@@ -732,6 +816,86 @@ const char * const g_gameStrings[] = {
"#DEM5\\DEM5N011#He is too busy consoling the wounded man.",
"#DEM5\\DEM5N012#They are too heavy to move.",
"#DEM5\\DEM5N013#This man is in no condition to talk.",
+
+
+ "#DEM6\\DEM6_001#Looks like a pile of junk if you ask me.",
+ "#DEM6\\DEM6_002#Well, what happens next?",
+ "#DEM6\\DEM6_003#Where did you find all this?",
+ "#DEM6\\DEM6_004#Mr. Spock, See what you can dig up from that old fashioned computer terminal.",
+ "#DEM6\\DEM6_005#Mr. Spock, see what you can do about that hand.",
+ "#DEM6\\DEM6_006#Yes, tell us about these things.",
+ "#DEM6\\DEM6_007#A vintage 801286 of the mid-21st century. It is a fine museum piece.",
+ "#DEM6\\DEM6_008#Fascinating, Captain. It is an Ardak-4 molecular synthesizer. A museum piece in perfect working order.",
+ "#DEM6\\DEM6_009#Residue of several different compounds are in the tubes. None of the compounds would explain the sightings.",
+ "#DEM6\\DEM6_010#A completely ordinary nickel-iron meteorite.",
+ "#DEM6\\DEM6_011#A manufactured vanadium-tungsten alloy of considerable age and indeterminate use.",
+ "#DEM6\\DEM6_012#A sample of a local lifeform called a siloti, the largest animal reported on this planet. About the size of an Earth housecat, the silotis have an insectoid-reptilian genotype with praying mantis like forelimbs.",
+ "#DEM6\\DEM6_013#A variety of rock specimens, including native silver, azurite, crystalline forms of various minerals.",
+ "#DEM6\\DEM6_014#Captain, this appears to be a model of the Earth. Notice how it models the proper situation for a total eclipse?",
+ "#DEM6\\DEM6_015#Do I look like a pointy eared, green blooded, know-it-all alien?",
+ "#DEM6\\DEM6_016#He's in fine physical and mental condition, Jim.",
+ "#DEM6\\DEM6_017#Jim, that would destroy the glass case!",
+ "#DEM6\\DEM6_018#We've got to get this to brother Chub as quickly as possible, Jim!",
+ "#DEM6\\DEM6_019#I think we should wait and talk to the owner when he comes back, Jim.",
+ "#DEM6\\DEM6_020#This place looks real comfortable, a place to combine work and contemplation. The man's got an eye for the beauty of useful things, and the use of beautiful things. I think we could get along fine.",
+ "#DEM6\\DEM6_021#Fossil shells in limestone substrate, compatible with local geologic features.",
+ "#DEM6\\DEM6_022#I feel like this is delicate as surgery, Captain, but I've got it back in working order now.",
+ "#DEM6\\DEM6_023#I read a collection of small items of no evident value. I would characterize this as a small museum display, Captain.",
+ "#DEM6\\DEM6_024#This machinery is delicate but I have managed to repair the circuitry.",
+ "#DEM6\\DEM6_025#This study represents a man with a keen mind, Captain. To judge by what I see, there is little which does not interest him. The equipment is antiquated, but practical.",
+ "#DEM6\\DEM6_026#Fascinating, these berries can be used to synthesize Hypo-Dytoxin.",
+ "#DEM6\\DEM6_027#The settings on the Ardak-4 have already been adjusted. Simply place the berry in the machine and the Hypo-Dytoxin will be synthesized.",
+ "#DEM6\\DEM6_028#There is no need to threaten me if you need to use my study.",
+ "#DEM6\\DEM6_029#Bless you for returning my things.",
+ "#DEM6\\DEM6_030#Everything of this world is secondary to the perfection of the next, Captain.",
+ "#DEM6\\DEM6_031#Here and there. Much of it was brought to me by others exploring widely.",
+ "#DEM6\\DEM6_032#How interesting! Praise God for this opportunity. He brings me through you.",
+ "#DEM6\\DEM6_033#I believe this is evidence of the cataclysm which destroyed the moon of Pollux V eons past. I've constructed a theoretical model based on analysis of the planet's ring of what things might have been like. I think that the moon, like Earth's moon, would have made a total eclipse of the sun possible. I would have liked to have seen that, for conditions making a perfect total eclipse are rare in the Universe. Our God creates great wonders.",
+ "#DEM6\\DEM6_034#I enjoy talking about these treasures.",
+ "#DEM6\\DEM6_035#I never dreamed that Starfleet would be interested in my discoveries, Captain, but our God often surprises us.",
+ "#DEM6\\DEM6_036#One of the oldest forms I've seen on this planet. Our God makes beautiful things, indeed.",
+ "#DEM6\\DEM6_037#See how the fingertips have microsized sensors? I wonder what use they may have.",
+ "#DEM6\\DEM6_038#The skull of a modern siloti, the largest creature native to this planet, about the size of a housecat from Earth. The silotis combine a rather insectoid pattern with four-legged reptilian form including praying mantis-like forelimbs.",
+ "#DEM6\\DEM6_039#This chunk of rock is a greatly weathered example of a vanadium-tungsten alloy -- which doesn't occur naturally. It is my best evidence that the area was previously inhabited.",
+ "#DEM6\\DEM6_040#True curiosities, nothing more. I think they're very pretty, don't you?",
+ "#DEM6\\DEM6_041#Very well. I can't imagine why, but if you have a further interest in any of this, take what you like. But please remember to return my treasures when you are done with them.",
+ "#DEM6\\DEM6_042#Welcome to my study! Feel free to look around. My medical and scientific equipment is surely not so sophisticated as you are accustomed to, but if there is anything you wish to use, please feel free. Also, I would be interested in anything you might have to show me.",
+ "#DEM6\\DEM6_043#What a fascinating piece of equipment! Highly advanced technology. You see here, it seems to have been damaged, however. Take it to my workbench and let's see if it can be repaired. I fear my hands are too shaky to perform such fine work, but perhaps one of you can do it.",
+ "#DEM6\\DEM6_044#You are interested in my little museum of curiosities?",
+ "#DEM6\\DEM6_045#Mineral Specimens,",
+ "#DEM6\\DEM6_046#Meteorite,",
+ "#DEM6\\DEM6_047#Fossil Shells,",
+ "#DEM6\\DEM6_048#Skull of a small alien animal,",
+ "#DEM6\\DEM6_049#Twist of Metal,",
+ "#DEM6\\DEM6_050#or would you rather move on to something else?",
+ "#DEM6\\DEM6_051#Shall I go into...",
+ "#DEM6\\DEM6_052#I believe Mr. Spock would be more helpful with this, sir.",
+ "#DEM6\\DEM6_053#I wonder if any of this stuff might be useful.",
+ "#DEM6\\DEM6N000#A common-looking meteorite, about the size of a fist.",
+ "#DEM6\\DEM6N001#A glass-fronted display of mineral specimens including a meteorite, a few fossil shells, the skull of a cat-sized alien animal, and a very encrusted twist of metal.",
+ "#DEM6\\DEM6N002#A majestic view of Mt. Idyll can be seen through the skylight.",
+ "#DEM6\\DEM6N003#A multi-purpose work space, with fine, well-worn tools and equipment close at hand.",
+ "#DEM6\\DEM6N004#An antiquated molecular synthesizer sits in the corner.",
+ "#DEM6\\DEM6N005#An old corroded twist of metal.",
+ "#DEM6\\DEM6N006#An old-fashioned computer. It appears to have some type of simulation running.",
+ "#DEM6\\DEM6N007#Assorted pieces of glass rest on this table, from ancient beakers, to double burners.",
+ "#DEM6\\DEM6N008#Captain Kirk wonders what is going to happen on this mission.",
+ "#DEM6\\DEM6N009#Dr. McCoy is glad that he is in a warm, heated room.",
+ "#DEM6\\DEM6N010#Ensign Everts finds himself fascinated by the Acolytes and their planet.",
+ "#DEM6\\DEM6N011#Fossil shells of esthetic interest.",
+ "#DEM6\\DEM6N012#It is locked.",
+ "#DEM6\\DEM6N013#It opens.",
+ "#DEM6\\DEM6N014#It opens.",
+ "#DEM6\\DEM6N015#Mr. Spock finds the scientific equipment in this room to be rather primitive.",
+ "#DEM6\\DEM6N016#Pretty rock specimens.",
+ "#DEM6\\DEM6N017#The braincase of a small creature, looking slightly insectoid, somewhat reptilian.",
+ "#DEM6\\DEM6N018#The mechanism in the hand has already been repaired.",
+ "#DEM6\\DEM6N019#The old man carefully returns the items to his cabinet.",
+ "#DEM6\\DEM6N020#You tinker with it but do nothing significant.",
+ "#DEM6\\DEM6N021#Brother Stephen watches patiently as you examine his study.",
+ "#DEM6\\DEM6N022#The glass case is locked.",
+ "#DEM6\\DEM6N023#The machine synthesizes a quantity of Hypo-Dytoxin.",
+ "#DEM6\\DEM6N024#This appears to be a study and lab. The equipment looks very ancient.",
};
}
Commit: fe5658ca175810f7ea6cbcaa078e6fc86faf36f1
https://github.com/scummvm/scummvm/commit/fe5658ca175810f7ea6cbcaa078e6fc86faf36f1
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Mission 1 finished
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/menu.cpp
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/demon1.cpp
engines/startrek/rooms/demon4.cpp
engines/startrek/rooms/function_map.h
engines/startrek/sprite.cpp
engines/startrek/sprite.h
engines/startrek/startrek.h
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index e023200..4a604b9 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -38,6 +38,7 @@ void StarTrekEngine::initAwayMission() {
_sound->loadMusicFile("ground");
loadRoom(_missionToLoad, _roomIndexToLoad);
+ _roomIndexToLoad = -1;
// Load crew positions for beaming in
initAwayCrewPositions(4);
@@ -45,6 +46,14 @@ void StarTrekEngine::initAwayMission() {
void StarTrekEngine::runAwayMission() {
while (true) {
+ // Original game manipulates the stack when the room changes to return execution
+ // to this point. Instead of doing that, just check if a variable is set.
+ if (_roomIndexToLoad != -1 && _spawnIndexToLoad != -1) {
+ loadRoomIndex(_roomIndexToLoad, _spawnIndexToLoad);
+ _roomIndexToLoad = -1;
+ _spawnIndexToLoad = -1;
+ }
+
handleAwayMissionEvents();
Common::Point mousePos = _gfx->getMousePos();
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 0ad2946..5029c8c 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -55,6 +55,7 @@ struct AwayMission {
struct {
bool wasRudeToPrelate; // 0x29
bool insultedStephen; // 0x2b
+ bool field2d; // 0x2d
bool beatKlingons; // 0x2f
bool tookKlingonHand; // 0x31
@@ -75,17 +76,18 @@ struct AwayMission {
byte field41; // 0x41
bool foundMiner; // 0x43
bool field45; // 0x45
- bool field47; // 0x47
+ bool gaveSkullToNauian; // 0x47
bool warpsDisabled; // 0x48
bool boulder1Gone; // 0x49
bool boulder2Gone; // 0x4a
bool boulder3Gone; // 0x4b
bool boulder4Gone; // 0x4c
bool doorOpened; // 0x4d
- bool field4e; // 0x4e
+ bool solvedSunPuzzle; // 0x4e
byte itemsTakenFromCase; // 0x4f
bool gotBerries; // 0x50
bool madeHypoDytoxin; // 0x51
+ bool metNauian; // 0x53
bool gavePointsForDytoxin; // 0x54
bool lookedAtComputer; // 0x55
byte field56; // 0x56
@@ -93,7 +95,7 @@ struct AwayMission {
} demon;
};
- int16 missionScore;
+ int16 missionScore; // 0x58
};
// Size: 0x129 bytes
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index d6929d0..1f67fb2 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -653,7 +653,6 @@ int StarTrekEngine::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4
switch(event.type) {
case TREKEVENT_TICK: {
- case TREKEVENT_MOUSEMOVE: // FIXME: actual game only uses TICK event here
Common::Point mousePos = _gfx->getMousePos();
int buttonIndex = getMenuButtonAt(_activeMenu->sprites, _activeMenu->numButtons, mousePos.x, mousePos.y);
if (buttonIndex != -1) {
@@ -676,11 +675,11 @@ int StarTrekEngine::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4
}
// Not added: updating mouse position (scummvm handles that)
- // sub_10492();
- // sub_10A91();
+ // sub_10492(); // TODO
+ // updateActorAnimations(); // TODO: uncomment and fix animations under textboxes
_gfx->drawAllSprites();
- // sub_10BE7();
- // sub_2A4B1();
+ // sub_10BE7(); // TODO
+ _sound->checkLoopMusic();
if (_finishedPlayingSpeech != 0) {
_finishedPlayingSpeech = 0;
@@ -688,7 +687,7 @@ int StarTrekEngine::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4
return TEXTBUTTON_SPEECH_DONE;
}
}
- // sub_1E88C();
+ _gfx->incPaletteFadeLevel();
_frameIndex++;
if (ticksUntilClickingEnabled != 0 && _clockTicks >= tickWhenClickingEnabled)
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 7110c4d..2a8f5e6 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -236,17 +236,24 @@ void Room::loadRoomIndex(int roomIndex, int spawnIndex) {
if (_vm->_awayMission.crewDownBitset != 0)
return;
- _vm->loadRoomIndex(roomIndex, spawnIndex);
+ _vm->_missionToLoad = _vm->_missionName;
+ _vm->_roomIndexToLoad = roomIndex;
+ _vm->_spawnIndexToLoad = spawnIndex;
- // This room has now been deleted, don't do anything else here.
- // FIXME: this could a bit dangerous since this is generally called from room-specific
- // code, which isn't guaranteed to do nothing afterward. Original game would
- // manipulate the stack to jump directly back to the start of "runAwayMission"...
+ // WORKAROUND: original game manipulates the stack to return directly to the start of
+ // "runAwayMission". Instead, we set some variables and the room will be changed
+ // later. (We wouldn't want to delete the room we're currently in...)
}
void Room::loseItem(int item) {
assert(item >= ITEMS_START && item < ITEMS_END);
_vm->_itemList[item - ITEMS_START].have = false;
+
+ if (_vm->_awayMission.activeAction == ACTION_USE && _vm->_awayMission.activeObject == item) {
+ _vm->_awayMission.activeAction = ACTION_WALK;
+ _vm->chooseMouseBitmapForAction(ACTION_WALK, false);
+ _vm->hideInventoryIcons();
+ }
}
void Room::walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam) {
@@ -286,6 +293,30 @@ void Room::playMidiMusicTracks(int startTrack, int loopTrack) {
_vm->playMidiMusicTracks(startTrack, loopTrack);
}
+void Room::endMission(int16 score, int16 arg1, int16 arg2) {
+ _vm->_awayMission.disableInput = true;
+
+ for (int i = 0; i < (_vm->_awayMission.redshirtDead ? 3 : 4); i++) {
+ Actor *actor = &_vm->_actorList[i];
+ Common::String anim = _vm->getCrewmanAnimFilename(i, "teled");
+ _vm->loadActorAnimWithRoomScaling(i, anim, actor->sprite.pos.x, actor->sprite.pos.y);
+ }
+
+ _vm->_kirkActor->animationString[0] = '\0';
+ _vm->_spockActor->animationString[0] = '\0';
+ _vm->_mccoyActor->animationString[0] = '\0';
+ _vm->_redshirtActor->animationString[0] = '\0';
+
+ playSoundEffectIndex(8);
+
+ while (_vm->_kirkActor->spriteDrawn)
+ _vm->handleAwayMissionEvents();
+
+ _vm->_awayMission.disableInput = false;
+
+ // TODO: game mode switch
+}
+
void Room::showGameOverMenu() {
_vm->showGameOverMenu();
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 027dbd6..4dd6e05 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -103,6 +103,7 @@ private:
int showText(int speaker, int text); // Cmd 0x03
int showText(int text); // Cmd 0x03
void giveItem(int item); // Cmd 0x04
+ // Command 0x05: "demon4ShowSunPuzzle"
void loadRoomIndex(int roomIndex, int spawnIndex); // Cmd 0x06
void loseItem(int item); // Cmd 0x07
void walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam);// Cmd 0x08
@@ -111,6 +112,7 @@ private:
Common::Point getActorPos(int actorIndex); // Cmd 0x0d
void playSoundEffectIndex(int soundEffect); // Cmd 0x0f
void playMidiMusicTracks(int startTrack, int loopTrack); // Cmd 0x10
+ void endMission(int16 score, int16 arg2, int16 arg3); // Cmd 0x11
void showGameOverMenu(); // Cmd 0x12
void playVoc(Common::String filename); // Cmd 0x15
@@ -310,9 +312,26 @@ public:
void demon4FinishedAnimation1();
void demon4FinishedAnimation2();
void demon4FinishedAnimation3();
+ void demon4Timer0Expired();
+ void demon4Timer1Expired();
+ void demon4CrewmanReachedBeamoutPosition();
+ void demon4Timer2Expired();
+ void demon4Timer3Expired();
+ void demon4Timer4Expired();
+ void demon4Timer5Expired();
+ void demon4Timer6Expired();
+ void demon4UsePhaserOnNauian();
+ void demon4UseMetalOnSecurityEquipment();
+ void demon4KirkReachedSecurityEquipment();
+ void demon4KirkFinishedUsingSecurityEquipment();
+ void demon4UseMetalOnNauian();
+ void demon4KirkReachedNauian();
+ void demon4UseSkullOnNauian();
+ void demon4KirkReachedNauianWithSkull();
void demon4UsePhaserOnPanel();
void demon4UsePhaserOnPattern();
void demon4UsePhaserOnMccoy();
+ void demon4TalkToNauian();
void demon4LookAtPattern();
void demon4LookAtAlien();
void demon4LookAnywhere();
@@ -330,6 +349,22 @@ public:
void demon4UseRedshirtOnPanel();
void demon4UseCrewmanOnPanel();
void demon4CrewmanReachedPanel();
+ bool demon4ShowSunPuzzle();
+ void demon4TalkToKirk();
+ void demon4TalkToMccoy();
+ void demon4TalkToSpock();
+ void demon4TalkToRedshirt();
+ void demon4UseSTricorderOnChamber();
+ void demon4UseSTricorderOnPattern();
+ void demon4UseMTricorderOnPattern();
+ void demon4UseSTricorderOnPanel();
+ void demon4UseMTricorderOnPanel();
+ void demon4UseSTricorderOnAnything();
+ void demon4UseMTricorderOnAnything();
+ void demon4UseSTricorderOnNauian();
+ void demon4UseMTricorderOnNauian();
+ void demon4UseSTricorderOnSecurityEquipment();
+ void demon4UseMTricorderOnSecurityEquipment();
// DEMON5
void demon5Tick1();
@@ -461,7 +496,11 @@ private:
} demon3;
struct {
- bool cb; // 0xcb
+ bool triedToShootNauian; // 0xca
+ bool nauianEmerged; // 0xcb
+ bool disabledSecurity; // 0xcc
+ bool cd; // 0xcd
+ byte crewReadyToBeamOut; // 0xce
int16 crewmanUsingPanel; // 0xcf
} demon4;
diff --git a/engines/startrek/rooms/demon1.cpp b/engines/startrek/rooms/demon1.cpp
index 325f13c..a5c42d3 100644
--- a/engines/startrek/rooms/demon1.cpp
+++ b/engines/startrek/rooms/demon1.cpp
@@ -381,8 +381,10 @@ void Room::demon1UseSTricorderOnHand() {
}
void Room::demon1UseSTricorderOnKlingon1() {
- // NOTE: it sets up the stack, but doesn't call the function...
- //loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ // BUGFIX: Original game sets up the stack for this function call, but doesn't
+ // actually call the function...
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+
playSoundEffectIndex(0x04);
if (_roomVar.demon1.numKlingonsKilled == 3 && !_vm->_awayMission.demon.tookKlingonHand && _rdfData[0xcf] != 1) {
diff --git a/engines/startrek/rooms/demon4.cpp b/engines/startrek/rooms/demon4.cpp
index 5228632..8f2e310 100644
--- a/engines/startrek/rooms/demon4.cpp
+++ b/engines/startrek/rooms/demon4.cpp
@@ -24,18 +24,21 @@
namespace StarTrek {
+// TODO: this room should have animations on computer terminals, but this isn't where
+// they're implemented. Could be related to ".BAN" files which rooms can load?
+
void Room::demon4Tick1() {
playVoc("DEM4LOOP");
if (!_vm->_awayMission.demon.healedMiner)
_vm->_awayMission.demon.minerDead = true;
- if (_vm->_awayMission.demon.field4e) {
+ if (_vm->_awayMission.demon.solvedSunPuzzle) {
loadActorAnim(10, "bxrise2", 0x122, 0x91, 0);
loadActorAnim(8, "stpout2", 0x107, 0x92, 0);
- _roomVar.demon4.cb = true;
+ _roomVar.demon4.nauianEmerged = true;
- if ((_vm->_awayMission.demon.itemsTakenFromCase & 0x10) && !_vm->_awayMission.demon.field47)
+ if ((_vm->_awayMission.demon.itemsTakenFromCase & 0x10) && !_vm->_awayMission.demon.gaveSkullToNauian)
_vm->_awayMission.timers[6] = 20;
}
@@ -45,14 +48,164 @@ void Room::demon4Tick1() {
}
}
+// Alien emerged
void Room::demon4FinishedAnimation1() {
- // TODO
+ loadActorAnim(8, "stpout", 0x107, 0x92, 5);
+ _roomVar.demon4.nauianEmerged = true;
+ if (_vm->_awayMission.demon.itemsTakenFromCase & 0x10)
+ _vm->_awayMission.timers[6] = 45;
}
void Room::demon4FinishedAnimation2() {
+ if (!_roomVar.demon4.cd) {
+ _roomVar.demon4.cd = true;
+ showText(TX_DEM4N011);
+ }
+
+ showGameOverMenu();
+
+ // WORKAROUND: original game has the below line; however, it's never executed anyway
+ // since the game over menu manipulates the stack. Here, the menu could delete this
+ // room object, so it should be the last statement...
+ //_vm->_awayMission.disableInput = false;
}
void Room::demon4FinishedAnimation3() {
+ showText(TX_SPEAKER_NAUIAN, TX_DEM4_034);
+ showText(TX_SPEAKER_KIRK, TX_DEM4_010);
+ showText(TX_SPEAKER_NAUIAN, TX_DEM4_035);
+ showText(TX_SPEAKER_SPOCK, TX_DEM4_030);
+
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.missionScore += 5;
+ _vm->_awayMission.timers[1] = 20;
+}
+
+// Just solved sun puzzle
+void Room::demon4Timer0Expired() {
+ loadActorAnim(10, "bxrise", 0x122, 0x91, 1);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ loadActorStandAnim(OBJECT_KIRK);
+ playVoc("SE2POWER");
+}
+
+// Mission end
+void Room::demon4Timer1Expired() {
+ showText(TX_SPEAKER_KIRK, TX_DEM4_011);
+
+ walkCrewman(OBJECT_KIRK, 0xbe, 0xa5, 4);
+ walkCrewman(OBJECT_SPOCK, 0xb4, 0x9b, 4);
+ walkCrewman(OBJECT_MCCOY, 0xc8, 0x9b, 4);
+
+ if (!_vm->_awayMission.redshirtDead)
+ walkCrewman(OBJECT_REDSHIRT, 0xc1, 0x91, 4);
+ else
+ _roomVar.demon4.crewReadyToBeamOut++;
+}
+
+void Room::demon4CrewmanReachedBeamoutPosition() {
+ _roomVar.demon4.crewReadyToBeamOut++;
+ if (_roomVar.demon4.crewReadyToBeamOut != 4)
+ return;
+
+ if (!_vm->_awayMission.demon.insultedStephen)
+ _vm->_awayMission.missionScore += 3;
+ if (!_vm->_awayMission.redshirtDead)
+ _vm->_awayMission.missionScore += 2;
+
+ endMission(_vm->_awayMission.missionScore, 0x24, 0);
+}
+
+void Room::demon4Timer2Expired() {
+ loadActorAnim2(OBJECT_SPOCK, "skille", -1, -1, 0);
+}
+
+void Room::demon4Timer3Expired() {
+ loadActorAnim2(OBJECT_REDSHIRT, "rkille", -1, -1, 0);
+}
+
+void Room::demon4Timer4Expired() {
+ loadActorAnim2(OBJECT_MCCOY, "mkille", -1, -1, 0);
+}
+
+void Room::demon4Timer5Expired() {
+ loadActorAnim2(OBJECT_KIRK, "kkille", -1, -1, 2);
+}
+
+void Room::demon4Timer6Expired() {
+ showText(TX_SPEAKER_MCCOY, TX_DEM4_017);
+}
+
+void Room::demon4UsePhaserOnNauian() {
+ if (!_roomVar.demon4.triedToShootNauian) { // Lenient the first time
+ showText(TX_SPEAKER_NAUIAN, TX_DEM4_033);
+ _roomVar.demon4.triedToShootNauian = true;
+ }
+ else { // Murdery the second time
+ showText(TX_SPEAKER_NAUIAN, TX_DEM4_032);
+ loadActorAnim2(10, "bxfire", 0, 0, 2);
+ playVoc("V0SPOCKT");
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.timers[2] = 7;
+ _vm->_awayMission.timers[3] = 8;
+ _vm->_awayMission.timers[4] = 7;
+ _vm->_awayMission.timers[5] = 8;
+ }
+}
+
+void Room::demon4UseMetalOnSecurityEquipment() {
+ _vm->_awayMission.disableInput = true;
+ walkCrewman(OBJECT_KIRK, 0xf5, 0x90, 5);
+}
+
+void Room::demon4KirkReachedSecurityEquipment() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 4);
+}
+
+void Room::demon4KirkFinishedUsingSecurityEquipment() {
+ _vm->_awayMission.disableInput = false;
+ showText(TX_DEM4N014);
+}
+
+void Room::demon4UseMetalOnNauian() {
+ walkCrewman(OBJECT_KIRK, 0xe9, 0x90, 1);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+}
+
+void Room::demon4KirkReachedNauian() {
+ loadActorAnim2(8, "usekey", 0x107, 0x8e, 3);
+ loseItem(OBJECT_IMETAL);
+ _vm->_awayMission.missionScore += 2;
+ _vm->_awayMission.demon.itemsTakenFromCase &= ~1;
+}
+
+void Room::demon4UseSkullOnNauian() {
+ walkCrewman(OBJECT_KIRK, 0xe9, 0x90, 2);
+}
+
+void Room::demon4KirkReachedNauianWithSkull() {
+ showText(TX_SPEAKER_NAUIAN, TX_DEM4_036);
+
+ const int choices[] = { TX_SPEAKER_KIRK, TX_DEM4_006, TX_DEM4_003, TX_DEM4_005, TX_BLANK };
+ int choice = showText(choices);
+
+ switch (choice) {
+ case 0:
+ _vm->_awayMission.missionScore++;
+ loadActorAnim2(8, "takesk", 0x107, 0x8e, 0);
+ loseItem(OBJECT_ISKULL);
+ _vm->_awayMission.demon.itemsTakenFromCase &= ~16; // BUG: skull reappears in case? Can abuse for infinite ponits?
+ _vm->_awayMission.demon.gaveSkullToNauian = true;
+ break;
+
+ case 1:
+ case 2:
+ break;
+
+ default:
+ showText(TX_DIALOG_ERROR);
+ break;
+ }
}
void Room::demon4UsePhaserOnPanel() {
@@ -67,9 +220,77 @@ void Room::demon4UsePhaserOnMccoy() {
showText(TX_SPEAKER_MCCOY, TX_DEM4_018);
}
+void Room::demon4TalkToNauian() {
+ _vm->_awayMission.disableInput = false;
+
+ if (!_vm->_awayMission.demon.metNauian) {
+ _vm->_awayMission.demon.metNauian = true;
+ showText(TX_SPEAKER_NAUIAN, TX_DEM4_044);
+
+ const int choices[] = { TX_SPEAKER_KIRK, TX_DEM4_002, TX_DEM4_004, TX_DEM4_009, TX_BLANK };
+ int choice = showText(choices);
+
+ switch (choice) {
+ case 0:
+ _vm->_awayMission.demon.field2d = true;
+ showText(TX_SPEAKER_NAUIAN, TX_DEM4_042);
+ break;
+
+ case 1:
+ break;
+
+ case 2:
+ showText(TX_SPEAKER_NAUIAN, TX_DEM4_039);
+ break;
+
+ default:
+ showText(TX_DIALOG_ERROR);
+ break;
+ }
+
+ showText(TX_SPEAKER_NAUIAN, TX_DEM4_043);
+
+ const int choices2[] = { TX_SPEAKER_KIRK, TX_DEM4_008, TX_DEM4_007, TX_BLANK };
+ choice = showText(choices2);
+
+ switch (choice) {
+ case 0:
+ _vm->_awayMission.demon.field2d = true;
+ showText(TX_SPEAKER_NAUIAN, TX_DEM4_041);
+ break;
+ case 1:
+ break;
+ default:
+ showText(TX_DIALOG_ERROR);
+ break;
+ }
+
+ showText(TX_SPEAKER_NAUIAN, TX_DEM4_040);
+
+ if (_roomVar.demon4.disabledSecurity) { // Impossible condition?
+ showText(TX_SPEAKER_NAUIAN, TX_DEM4_037);
+
+ // BUGFIX: Originally all of these used no audio, despite the files existing
+ // (being used elsewhere).
+ showText(TX_SPEAKER_KIRK, TX_DEM4_010);
+ showText(TX_SPEAKER_NAUIAN, TX_DEM4_035);
+ showText(TX_SPEAKER_SPOCK, TX_DEM4_030);
+
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.missionScore += 5;
+ _vm->_awayMission.timers[1] = 20;
+ }
+ else {
+ showText(TX_SPEAKER_NAUIAN, TX_DEM4_038);
+ }
+ }
+ else {
+ showText(TX_SPEAKER_NAUIAN, TX_DEM4_031);
+ }
+}
+
void Room::demon4LookAtPattern() {
showText(TX_DEM4N002);
-
}
void Room::demon4LookAtAlien() {
@@ -133,7 +354,7 @@ void Room::demon4UseRedshirtOnPanel() {
}
void Room::demon4UseCrewmanOnPanel() {
- if (_vm->_awayMission.demon.field4e)
+ if (_vm->_awayMission.demon.solvedSunPuzzle)
return;
walkCrewman(_roomVar.demon4.crewmanUsingPanel, 0xda, 0x83, 3);
_vm->_awayMission.crewDirectionsAfterWalk[_roomVar.demon4.crewmanUsingPanel] = DIR_N;
@@ -141,7 +362,270 @@ void Room::demon4UseCrewmanOnPanel() {
}
void Room::demon4CrewmanReachedPanel() {
- // TODO: puzzle implementation
+ if (demon4ShowSunPuzzle()) {
+ _vm->_awayMission.demon.solvedSunPuzzle = true;
+ loadActorAnim(9, "ctrl", 0, 0, 0);
+ _vm->_awayMission.missionScore += 3;
+ _vm->_awayMission.timers[0] = 10;
+ }
+ else
+ showText(TX_DEM4N013);
+
+ walkCrewman(_roomVar.demon4.crewmanUsingPanel, 0xae, 0x93, 0);
+ _vm->_awayMission.disableInput = false;
+}
+
+bool Room::demon4ShowSunPuzzle() {
+ bool solved = false;
+
+ int sliderY = 17;
+ int sliderR = -17;
+ int sliderB = 17;
+
+ _vm->_gfx->fadeoutScreen();
+ _vm->_sound->stopAllVocSounds();
+
+ _vm->_gfx->pushSprites();
+ _vm->_gfx->setBackgroundImage(_vm->_gfx->loadBitmap("machineb"));
+ _vm->_gfx->copyBackgroundScreen();
+ _vm->_gfx->clearPri();
+
+ Sprite sprites[21];
+
+ for (int i = 0; i < 21; i++) {
+ _vm->_gfx->addSprite(&sprites[i]);
+ }
+
+ sprites[0].setBitmap(_vm->_gfx->loadBitmap("levery"));
+ sprites[1].setBitmap(_vm->_gfx->loadBitmap("leverr"));
+ sprites[2].setBitmap(_vm->_gfx->loadBitmap("leverb"));
+
+ SharedPtr<Bitmap> lightyBitmap = _vm->_gfx->loadBitmap("lighty");
+ SharedPtr<Bitmap> lightrBitmap = _vm->_gfx->loadBitmap("lightr");
+ SharedPtr<Bitmap> lightbBitmap = _vm->_gfx->loadBitmap("lightb");
+
+ for (int i = 3; i < 9; i++)
+ sprites[i].bitmap = lightyBitmap;
+ for (int i = 9; i < 15; i++)
+ sprites[i].bitmap = lightrBitmap;
+ for (int i = 15; i < 21; i++)
+ sprites[i].bitmap = lightbBitmap;
+
+ Sprite doneButtonSprite;
+ _vm->_gfx->addSprite(&doneButtonSprite);
+ doneButtonSprite.setXYAndPriority(0x104, 0x64, 2);
+ doneButtonSprite.setBitmap(_vm->_gfx->loadBitmap("donebutt"));
+ // BUGFIX: use draw mode 2 so the entire button is clickable (not just non-transparent
+ // pixels)
+ doneButtonSprite.drawMode = 2;
+
+ _vm->_gfx->fadeinScreen();
+
+ bool continueLoop = true;
+ bool sliderChanged = true;
+
+ while (continueLoop) {
+ if (sliderChanged) {
+ sprites[0].setXYAndPriority(0xa0, sliderY + 0x75, 14);
+ sprites[1].setXYAndPriority(0xa8, sliderR + 0x75, 14);
+ sprites[2].setXYAndPriority(0xb0, sliderB + 0x75, 14);
+
+ int var56 = 0x82;
+ int var58 = 0x83;
+ int var5a = 3;
+ int numSprites = abs(sliderY) / 3;
+ for (int i = 0; i < 6; i++) {
+ sprites[i + var5a].setXYAndPriority(var58, var56, 14);
+ }
+ var56 -= 6;
+ for (int i = 0; i < numSprites; i++) {
+ sprites[i + var5a].setXYAndPriority(var58, var56, 14);
+ var56 -= 6;
+ }
+
+ var56 = 0x82;
+ var58 = 0x8b;
+ var5a = 9;
+ numSprites = abs(sliderR) / 3;
+ for (int i = 0; i < 6; i++) {
+ sprites[i + var5a].setXYAndPriority(var58, var56, 14);
+ }
+ var56 -= 6;
+ for (int i = 0; i < numSprites; i++) {
+ sprites[i + var5a].setXYAndPriority(var58, var56, 14);
+ var56 -= 6;
+ }
+
+ var56 = 0x82;
+ var58 = 0x93;
+ var5a = 15;
+ numSprites = abs(sliderB) / 3;
+ for (int i = 0; i < 6; i++) {
+ sprites[i + var5a].setXYAndPriority(var58, var56, 14);
+ }
+ var56 -= 6;
+ for (int i = 0; i < numSprites; i++) {
+ sprites[i + var5a].setXYAndPriority(var58, var56, 14);
+ var56 -= 6;
+ }
+
+ sliderChanged = false;
+ }
+
+ TrekEvent event;
+ if (!_vm->popNextEvent(&event))
+ continue;
+
+ switch (event.type) {
+ case TREKEVENT_LBUTTONDOWN: {
+lclick:
+ Common::Point mousePos = _vm->_gfx->getMousePos();
+ if (_vm->_gfx->getSpriteAt(mousePos) == &doneButtonSprite)
+ goto done;
+ else {
+ if (mousePos.y >= 0x64 && mousePos.y <= 0x86) {
+ if (mousePos.x >= 0xa0 && mousePos.x <= 0xa6)
+ sliderY = mousePos.y - 0x75;
+ else if (mousePos.x >= 0xa8 && mousePos.x <= 0xae)
+ sliderR = mousePos.y - 0x75;
+ else if (mousePos.x >= 0xb0 && mousePos.x <= 0xb6)
+ sliderB = mousePos.y - 0x75;
+ sliderChanged = true;
+ }
+ }
+ break;
+ }
+
+ case TREKEVENT_RBUTTONDOWN:
+done:
+ if (abs(sliderY) <= 2 && abs(sliderR) <= 2 && abs(sliderB) <= 2)
+ solved = true;
+ else
+ solved = false;
+ continueLoop = false;
+ break;
+
+ case TREKEVENT_KEYDOWN:
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_ESCAPE:
+ case Common::KEYCODE_F2:
+ goto done;
+
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ case Common::KEYCODE_F1:
+ goto lclick;
+
+ default:
+ break;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ _vm->_gfx->drawAllSprites();
+ }
+
+ _vm->_gfx->fadeoutScreen();
+ _vm->_gfx->popSprites();
+ _vm->_gfx->loadPri(_vm->_screenName);
+ _vm->_gfx->setBackgroundImage(_vm->_gfx->loadBitmap(_vm->_screenName));
+ _vm->_gfx->copyBackgroundScreen();
+ _vm->_gfx->forceDrawAllSprites();
+
+ return solved;
+}
+
+void Room::demon4TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_DEM4_001);
+}
+
+void Room::demon4TalkToMccoy() {
+ if (_roomVar.demon4.nauianEmerged)
+ showText(TX_SPEAKER_MCCOY, TX_DEM4_019);
+ else
+ showText(TX_SPEAKER_MCCOY, TX_DEM4_015);
+}
+
+void Room::demon4TalkToSpock() {
+ if (_roomVar.demon4.nauianEmerged)
+ showText(TX_SPEAKER_SPOCK, TX_DEM4_022);
+ else
+ showText(TX_SPEAKER_SPOCK, TX_DEM4_024);
+}
+
+void Room::demon4TalkToRedshirt() {
+ if (_roomVar.demon4.nauianEmerged)
+ showText(TX_SPEAKER_EVERTS, TX_DEM4_047);
+ else
+ showText(TX_SPEAKER_EVERTS, TX_DEM4_046);
+}
+
+void Room::demon4UseSTricorderOnChamber() {
+ loadActorAnim2(OBJECT_SPOCK, "sscane", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM4_012);
+}
+
+void Room::demon4UseSTricorderOnPattern() {
+ loadActorAnim2(OBJECT_SPOCK, "sscane", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM4_014);
+ showText(TX_SPEAKER_SPOCK, TX_DEM4_025);
+}
+
+void Room::demon4UseMTricorderOnPattern() {
+ showText(TX_SPEAKER_MCCOY, TX_DEM4_021);
+}
+
+void Room::demon4UseSTricorderOnPanel() {
+ loadActorAnim2(OBJECT_SPOCK, "sscane", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM4_027);
+}
+
+void Room::demon4UseMTricorderOnPanel() {
+ loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_MCCOY, TX_DEM4_027); // BUG: Uses spock's voice (though speaker says "Mccoy")
+}
+
+void Room::demon4UseSTricorderOnAnything() {
+ loadActorAnim2(OBJECT_SPOCK, "sscane", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM4_023);
+}
+
+void Room::demon4UseMTricorderOnAnything() {
+ loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_MCCOY, TX_DEM4_020);
+}
+
+void Room::demon4UseSTricorderOnNauian() {
+ loadActorAnim2(OBJECT_SPOCK, "sscane", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM4_029);
+}
+
+void Room::demon4UseMTricorderOnNauian() {
+ loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM4_029); // BUG: Uses spock's voice (speaker says "Spock" too)
+}
+
+void Room::demon4UseSTricorderOnSecurityEquipment() {
+ loadActorAnim2(OBJECT_SPOCK, "sscane", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM4_026);
+}
+
+void Room::demon4UseMTricorderOnSecurityEquipment() {
+ loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0);
+ playSoundEffectIndex(4);
+ showText(TX_SPEAKER_SPOCK, TX_DEM4_026); // BUG: Uses spock's voice (speaker says "Spock" too)
}
}
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index fc5f73a..db647df 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -314,14 +314,31 @@ RoomAction demon4ActionList[] = {
{ Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::demon4FinishedAnimation1 },
{ Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::demon4FinishedAnimation2 },
{ Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::demon4FinishedAnimation3 },
-
- // TODO: everything
+ { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::demon4Timer0Expired },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::demon4Timer1Expired },
+ { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::demon4CrewmanReachedBeamoutPosition },
+ { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::demon4Timer2Expired },
+ { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::demon4Timer3Expired },
+ { Action(ACTION_TIMER_EXPIRED, 4, 0, 0), &Room::demon4Timer4Expired },
+ { Action(ACTION_TIMER_EXPIRED, 5, 0, 0), &Room::demon4Timer5Expired },
+ { Action(ACTION_TIMER_EXPIRED, 6, 0, 0), &Room::demon4Timer6Expired },
+
+ { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::demon4UsePhaserOnNauian },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::demon4UsePhaserOnNauian },
+ { Action(ACTION_USE, OBJECT_IMETAL, 0x22, 0), &Room::demon4UseMetalOnSecurityEquipment },
+ { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::demon4KirkReachedSecurityEquipment },
+ { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::demon4KirkFinishedUsingSecurityEquipment },
+ { Action(ACTION_USE, OBJECT_IMETAL, 8, 0), &Room::demon4UseMetalOnNauian },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::demon4KirkReachedNauian },
+ { Action(ACTION_USE, OBJECT_ISKULL, 8, 0), &Room::demon4UseSkullOnNauian },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::demon4KirkReachedNauianWithSkull },
{ Action(ACTION_USE, OBJECT_IPHASERS, 0x21, 0), &Room::demon4UsePhaserOnPanel },
{ Action(ACTION_USE, OBJECT_IPHASERS, 0x20, 0), &Room::demon4UsePhaserOnPattern },
{ Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_MCCOY, 0), &Room::demon4UsePhaserOnMccoy },
- // TODO
+ { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::demon4TalkToNauian },
+ { Action(ACTION_TALK, 8, 0, 0), &Room::demon4TalkToNauian },
{ Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon4LookAtPattern },
{ Action(ACTION_LOOK, 8, 0, 0), &Room::demon4LookAtAlien },
@@ -342,6 +359,23 @@ RoomAction demon4ActionList[] = {
{ Action(ACTION_USE, OBJECT_MCCOY, 0x21, 0), &Room::demon4UseMccoyOnPanel },
{ Action(ACTION_USE, OBJECT_REDSHIRT, 0x21, 0), &Room::demon4UseRedshirtOnPanel },
{ Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::demon4CrewmanReachedPanel },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::demon4TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::demon4TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::demon4TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::demon4TalkToRedshirt },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 10, 0), &Room::demon4UseSTricorderOnChamber },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::demon4UseSTricorderOnPattern },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0x20, 0), &Room::demon4UseMTricorderOnPattern },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::demon4UseSTricorderOnPanel },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::demon4UseMTricorderOnPanel },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::demon4UseSTricorderOnAnything },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::demon4UseSTricorderOnAnything },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0x23, 0), &Room::demon4UseMTricorderOnAnything },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::demon4UseMTricorderOnAnything },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::demon4UseSTricorderOnNauian },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::demon4UseMTricorderOnNauian },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::demon4UseSTricorderOnSecurityEquipment },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0x22, 0), &Room::demon4UseMTricorderOnSecurityEquipment },
};
RoomAction demon5ActionList[] = {
diff --git a/engines/startrek/sprite.cpp b/engines/startrek/sprite.cpp
index 5804475..f6ba48d 100644
--- a/engines/startrek/sprite.cpp
+++ b/engines/startrek/sprite.cpp
@@ -48,6 +48,13 @@ void Sprite::setBitmap(SharedPtr<Bitmap> b) {
bitmapChanged = true;
}
+void Sprite::setXYAndPriority(int16 x, int16 y, int16 priority) {
+ pos.x = x;
+ pos.y = y;
+ drawPriority = priority;
+ bitmapChanged = true;
+}
+
void Sprite::dontDrawNextFrame() {
field16 = true;
bitmapChanged = true;
diff --git a/engines/startrek/sprite.h b/engines/startrek/sprite.h
index ce53372..e182f92 100644
--- a/engines/startrek/sprite.h
+++ b/engines/startrek/sprite.h
@@ -61,6 +61,7 @@ struct Sprite {
Sprite();
void setBitmap(SharedPtr<Bitmap> b);
+ void setXYAndPriority(int16 x, int16 y, int16 priority);
void dontDrawNextFrame();
Common::Rect getRect();
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index e37f442..52d23c5 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -360,6 +360,7 @@ public:
Common::String _missionToLoad;
int _roomIndexToLoad;
+ int _spawnIndexToLoad;
Common::String _missionName;
int _roomIndex;
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 95b49a1..7a8a80f 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -44,6 +44,7 @@ enum GameStringIDs {
TX_SPEAKER_CHUB,
TX_SPEAKER_ROBERTS,
TX_SPEAKER_GRISNASH,
+ TX_SPEAKER_NAUIAN,
TX_DEM0_001,
TX_DEM0_002,
@@ -482,6 +483,7 @@ const char * const g_gameStrings[] = {
"Brother Chub",
"Brother Roberts",
"Brother Grisnash",
+ "Nauian",
"#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?",
"#DEM0\\DEM0_002#Aside from seeing demons, has any hard data been collected? Any evidence I could see?",
Commit: c17bef8285086d438a03fcff6ae5f3d15b5532e8
https://github.com/scummvm/scummvm/commit/c17bef8285086d438a03fcff6ae5f3d15b5532e8
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Loop audio
Changed paths:
engines/startrek/sound.cpp
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 128c968..f344746 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -160,8 +160,11 @@ void Sound::playVoc(const Common::String &baseSoundName) {
playMacSoundEffect(baseSoundName);
else
*/
- if (baseSoundName.size() == 8 && baseSoundName.hasSuffixIgnoreCase("loop"))
+ bool loop = false;
+ if (baseSoundName.size() == 8 && baseSoundName.hasSuffixIgnoreCase("loop")) {
_loopingAudioName = baseSoundName;
+ loop = true;
+ }
if (!_vm->_sfxEnabled || !_vm->_sfxWorking)
return;
@@ -182,7 +185,13 @@ void Sound::playVoc(const Common::String &baseSoundName) {
error("Couldn't open '%s'", soundName.c_str());
debugC(5, kDebugSound, "Playing sound effect '%s'", soundName.c_str());
- Audio::AudioStream *audioStream = Audio::makeVOCStream(readStream, Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);
+
+ Audio::RewindableAudioStream *srcStream = Audio::makeVOCStream(readStream, Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);
+ Audio::AudioStream *audioStream;
+ if (loop)
+ audioStream = new Audio::LoopingAudioStream(srcStream, 0, DisposeAfterUse::YES);
+ else
+ audioStream = srcStream;
_vm->_system->getMixer()->playStream(Audio::Mixer::kSFXSoundType, &_sfxHandles[i], audioStream);
return;
}
Commit: 84a30e4dce6bdaf3d40656342e53b5dcd12746be
https://github.com/scummvm/scummvm/commit/84a30e4dce6bdaf3d40656342e53b5dcd12746be
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Preliminary saving/loading
Changed paths:
A engines/startrek/saveload.cpp
engines/startrek/action.h
engines/startrek/common.cpp
engines/startrek/common.h
engines/startrek/detection.cpp
engines/startrek/menu.cpp
engines/startrek/module.mk
engines/startrek/object.h
engines/startrek/room.cpp
engines/startrek/sound.cpp
engines/startrek/sound.h
engines/startrek/sprite.cpp
engines/startrek/sprite.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
index 232dc22..15d3ea1 100644
--- a/engines/startrek/action.h
+++ b/engines/startrek/action.h
@@ -23,6 +23,7 @@
#ifndef STARTREK_ACTION_H
#define STARTREK_ACTION_H
+#include "common/serializer.h"
enum Acton {
ACTION_TICK = 0,
@@ -41,7 +42,7 @@ enum Acton {
ACTION_OPTIONS = 13 // Not really an action, but selectable from action menu
};
-struct Action {
+struct Action : Common::Serializable {
byte type;
byte b1;
byte b2;
@@ -79,6 +80,13 @@ struct Action {
uint32 toUint32() const {
return (type << 24) | (b1 << 16) | (b2 << 8) | (b3 << 0);
}
+
+ virtual void saveLoadWithSerializer(Common::Serializer &ser) {
+ ser.syncAsByte(type);
+ ser.syncAsByte(b1);
+ ser.syncAsByte(b2);
+ ser.syncAsByte(b3);
+ }
};
#endif
diff --git a/engines/startrek/common.cpp b/engines/startrek/common.cpp
index cef01c5..a742860 100644
--- a/engines/startrek/common.cpp
+++ b/engines/startrek/common.cpp
@@ -19,6 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include "common/rect.h"
+#include "common/serializer.h"
+
#include "startrek/common.h"
namespace StarTrek {
@@ -32,4 +35,11 @@ Common::Rect getRectEncompassing(Common::Rect r1, Common::Rect r2) {
return Common::Rect(l,t,r,b);
}
+void serializeRect(Common::Rect rect, Common::Serializer &ser) {
+ ser.syncAsSint16LE(rect.left);
+ ser.syncAsSint16LE(rect.top);
+ ser.syncAsSint16LE(rect.right);
+ ser.syncAsSint16LE(rect.bottom);
+}
+
}
diff --git a/engines/startrek/common.h b/engines/startrek/common.h
index c5e3efe..e4930b6 100644
--- a/engines/startrek/common.h
+++ b/engines/startrek/common.h
@@ -22,7 +22,12 @@
#ifndef STARTREK_COMMON_H
#define STARTREK_COMMON_H
-#include "common/rect.h"
+#include "common/scummsys.h"
+
+namespace Common {
+class Rect;
+class Serializer;
+}
namespace StarTrek {
@@ -33,6 +38,7 @@ template<class T>
T max(T a, T b) { return a > b ? a : b; }
Common::Rect getRectEncompassing(Common::Rect r1, Common::Rect r2);
+void serializeRect(Common::Rect rect, Common::Serializer &ser);
// Fixed-point (16.16) number
diff --git a/engines/startrek/detection.cpp b/engines/startrek/detection.cpp
index d6e449e..3440bb4 100644
--- a/engines/startrek/detection.cpp
+++ b/engines/startrek/detection.cpp
@@ -26,8 +26,12 @@
#include "base/plugins.h"
#include "engines/advancedDetector.h"
+
+#include "graphics/thumbnail.h"
+
#include "common/config-manager.h"
#include "common/file.h"
+#include "common/savefile.h"
#include "startrek/startrek.h"
@@ -213,9 +217,27 @@ public:
return "Star Trek: 25th Anniversary, Star Trek: Judgment Rites (C) Interplay";
}
+ virtual bool hasFeature(MetaEngineFeature f) const;
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
+
+ virtual SaveStateList listSaves(const char *target) const;
+ virtual int getMaximumSaveSlot() const;
+ virtual void removeSaveState(const char *target, int slot) const;
+ SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
};
+bool StarTrekMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsLoadingDuringStartup) ||
+ (f == kSupportsDeleteSave) ||
+ (f == kSavesSupportMetaInfo) ||
+ (f == kSavesSupportThumbnail) ||
+ (f == kSavesSupportCreationDate) ||
+ (f == kSavesSupportPlayTime) ||
+ (f == kSimpleSavesNames);
+}
+
bool StarTrekMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
const StarTrek::StarTrekGameDescription *gd = (const StarTrek::StarTrekGameDescription *)desc;
@@ -224,6 +246,116 @@ bool StarTrekMetaEngine::createInstance(OSystem *syst, Engine **engine, const AD
return (gd != 0);
}
+SaveStateList StarTrekMetaEngine::listSaves(const char *target) const {
+ Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
+ Common::StringArray filenames;
+ Common::String pattern = target;
+ pattern += ".###";
+
+ filenames = saveFileMan->listSavefiles(pattern);
+
+ SaveStateList saveList;
+ for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
+ // Obtain the last 3 digits of the filename, since they correspond to the save slot
+ int slotNr = atoi(file->c_str() + file->size() - 3);
+
+ if (slotNr >= 0 && slotNr <= getMaximumSaveSlot()) {
+ Common::InSaveFile *in = saveFileMan->openForLoading(*file);
+ if (in) {
+ StarTrek::SavegameMetadata meta;
+ StarTrek::saveOrLoadMetadata(in, nullptr, &meta);
+ delete in;
+
+ uint16 descriptionPos = 0;
+
+ // Security-check, if saveDescription has a terminating NUL
+ while (meta.description[descriptionPos]) {
+ descriptionPos++;
+ if (descriptionPos >= sizeof(meta.description))
+ break;
+ }
+ if (descriptionPos >= sizeof(meta.description)) {
+ strcpy(meta.description, "[broken saved game]");
+ }
+
+ saveList.push_back(SaveStateDescriptor(slotNr, meta.description));
+ }
+ }
+ }
+
+ // Sort saves based on slot number.
+ Common::sort(saveList.begin(), saveList.end(), SaveStateDescriptorSlotComparator());
+ return saveList;
+}
+
+
+int StarTrekMetaEngine::getMaximumSaveSlot() const { return 999; }
+
+void StarTrekMetaEngine::removeSaveState(const char *target, int slot) const {
+ Common::String fileName = Common::String::format("%s.%03d", target, slot);
+ g_system->getSavefileManager()->removeSavefile(fileName);
+}
+
+SaveStateDescriptor StarTrekMetaEngine::querySaveMetaInfos(const char *target, int slotNr) const {
+ Common::String fileName = Common::String::format("%s.%03d", target, slotNr);
+
+ Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(fileName);
+
+ if (in) {
+ StarTrek::SavegameMetadata meta;
+ StarTrek::saveOrLoadMetadata(in, nullptr, &meta);
+ delete in;
+
+ uint16 descriptionPos = 0;
+
+ while (meta.description[descriptionPos]) {
+ descriptionPos++;
+ if (descriptionPos >= sizeof(meta.description))
+ break;
+ }
+ if (descriptionPos >= sizeof(meta.description)) {
+ // broken meta.description, ignore it
+ SaveStateDescriptor descriptor(slotNr, "[broken saved game]");
+ return descriptor;
+ }
+
+ SaveStateDescriptor descriptor(slotNr, meta.description);
+
+ // Do not allow save slot 0 (used for auto-saving) to be deleted or
+ // overwritten.
+ if (slotNr == 0) {
+ descriptor.setWriteProtectedFlag(true);
+ descriptor.setDeletableFlag(false);
+ } else {
+ descriptor.setWriteProtectedFlag(false);
+ descriptor.setDeletableFlag(true);
+ }
+
+ if (meta.thumbnail == nullptr) {
+ return SaveStateDescriptor();
+ }
+
+ descriptor.setThumbnail(meta.thumbnail);
+ descriptor.setPlayTime(meta.playTime);
+ descriptor.setSaveDate(meta.getYear(), meta.getMonth(), meta.getDay());
+ descriptor.setSaveTime(meta.getHour(), meta.getMinute());
+
+ return descriptor;
+
+ } else {
+ SaveStateDescriptor emptySave;
+ // Do not allow save slot 0 (used for auto-saving) to be overwritten.
+ if (slotNr == 0) {
+ emptySave.setWriteProtectedFlag(true);
+ } else {
+ emptySave.setWriteProtectedFlag(false);
+ }
+ return emptySave;
+ }
+}
+
+
+
#if PLUGIN_ENABLED_DYNAMIC(STARTREK)
REGISTER_PLUGIN_DYNAMIC(STARTREK, PLUGIN_TYPE_ENGINE, StarTrekMetaEngine);
#else
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index 1f67fb2..84f6f28 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -818,14 +818,6 @@ void StarTrekEngine::chooseMouseBitmapForAction(int action, bool withRedOutline)
_gfx->setMouseBitmap(_gfx->loadBitmap(bitmapName));
}
-void StarTrekEngine::showSaveMenu() {
- // TODO
-}
-
-void StarTrekEngine::showLoadMenu() {
- // TODO
-}
-
void StarTrekEngine::showQuitGamePrompt(int x, int y) {
const char *options[] = {
"Quit Game",
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 040091d..f061ac3 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -14,6 +14,7 @@ MODULE_OBJS = \
menu.o \
object.o \
room.o \
+ saveload.o \
sound.o \
sprite.o \
startrek.o \
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index 8882892..6a79116 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -74,11 +74,11 @@ enum Objects {
struct Actor {
- uint16 spriteDrawn;
- char animationString3[16];
+ bool spriteDrawn;
+ char animFilename[16];
uint16 animType;
Sprite sprite;
- char animationString4[10];
+ char bitmapFilename[10];
Fixed16 scale;
SharedPtr<FileStream> animFile;
uint16 numAnimFrames;
@@ -115,8 +115,10 @@ struct Actor {
uint16 field94;
uint16 field96;
- char animationString[9];
- uint8 fielda1;
+
+ char animationString[10];
+
+ // These might be part of "animationString"?
uint16 fielda2;
uint16 fielda4;
uint16 fielda6;
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 2a8f5e6..a2cc0d2 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -319,6 +319,7 @@ void Room::endMission(int16 score, int16 arg1, int16 arg2) {
void Room::showGameOverMenu() {
_vm->showGameOverMenu();
+ // TODO: shouldn't do this within a room
}
void Room::playVoc(Common::String filename) {
diff --git a/engines/startrek/saveload.cpp b/engines/startrek/saveload.cpp
new file mode 100644
index 0000000..443d4a5
--- /dev/null
+++ b/engines/startrek/saveload.cpp
@@ -0,0 +1,370 @@
+/* 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 "gui/saveload.h"
+
+#include "graphics/thumbnail.h"
+
+#include "common/file.h"
+#include "common/savefile.h"
+#include "common/serializer.h"
+#include "common/translation.h"
+
+#include "startrek/startrek.h"
+
+namespace StarTrek {
+
+bool StarTrekEngine::showSaveMenu() {
+ GUI::SaveLoadChooser *dialog;
+ Common::String desc;
+ int slot;
+
+ dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
+
+ slot = dialog->runModalWithCurrentTarget();
+ desc = dialog->getResultString();
+
+ if (desc.empty()) {
+ // create our own description for the saved game, the user didnt enter it
+ desc = dialog->createDefaultSaveDescription(slot);
+ }
+
+ if (desc.size() > 28)
+ desc = Common::String(desc.c_str(), 28);
+
+ /*
+ dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
+ slot = dialog->runModalWithCurrentTarget();
+ */
+
+ delete dialog;
+
+ if (slot < 0)
+ return true;
+
+ return saveGame(slot, desc);
+}
+
+bool StarTrekEngine::showLoadMenu() {
+ GUI::SaveLoadChooser *dialog;
+ int slot;
+
+ dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
+ slot = dialog->runModalWithCurrentTarget();
+
+ delete dialog;
+
+ if (slot < 0)
+ return true;
+
+ return loadGame(slot);
+}
+
+const uint32 CURRENT_SAVEGAME_VERSION = 0;
+
+bool StarTrekEngine::saveGame(int slot, Common::String desc) {
+ Common::String filename = getSavegameFilename(slot);
+ Common::OutSaveFile *out;
+
+ if (!(out = _saveFileMan->openForSaving(filename))) {
+ warning("Can't create file '%s', game not saved", filename.c_str());
+ return false;
+ } else {
+ debug(3, "Successfully opened %s for writing", filename.c_str());
+ }
+
+ SavegameMetadata meta;
+ meta.version = CURRENT_SAVEGAME_VERSION;
+ memset(meta.description, 0, sizeof(meta.description));
+ strncpy(meta.description, desc.c_str(), SAVEGAME_DESCRIPTION_LEN);
+
+ TimeDate curTime;
+ _system->getTimeAndDate(curTime);
+ meta.setSaveTimeAndDate(curTime);
+ meta.playTime = g_engine->getTotalPlayTime();
+
+ if (!saveOrLoadMetadata(nullptr, out, &meta)) {
+ delete out;
+ return false;
+ }
+ if (!saveOrLoadGameData(nullptr, out, &meta)) {
+ delete out;
+ return false;
+ }
+
+ out->finalize();
+ delete out;
+ return true;
+}
+
+bool StarTrekEngine::loadGame(int slot) {
+ Common::String filename = getSavegameFilename(slot);
+ Common::InSaveFile *in;
+
+ if (!(in = _saveFileMan->openForLoading(filename))) {
+ warning("Can't open file '%s', game not loaded", filename.c_str());
+ return false;
+ } else {
+ debug(3, "Successfully opened %s for loading", filename.c_str());
+ }
+
+ SavegameMetadata meta;
+ if (!saveOrLoadMetadata(in, nullptr, &meta)) {
+ delete in;
+ return false;
+ }
+
+ if (meta.version > CURRENT_SAVEGAME_VERSION) {
+ delete in;
+ error("Savegame version (%d) is newer than current version (%d). A newer version of ScummVM is needed", meta.version, CURRENT_SAVEGAME_VERSION);
+ }
+
+ if (!saveOrLoadGameData(in, nullptr, &meta)) {
+ delete in;
+ return false;
+ }
+
+ delete in;
+
+ _lastGameMode = _gameMode;
+
+ if (_gameMode == GAMEMODE_AWAYMISSION) {
+ for (int i = 0; i < NUM_ACTORS; i++) {
+ Actor *a = &_actorList[i];
+ if (a->spriteDrawn) {
+ if (a->animType != 1)
+ a->animFile = loadFile(Common::String(a->animFilename) + ".anm");
+ _gfx->addSprite(&a->sprite);
+ a->sprite.setBitmap(loadAnimationFrame(a->bitmapFilename, a->scale));
+ }
+ }
+ }
+ else if (_gameMode == -1) {
+ initBridge(true);
+ _lastGameMode = GAMEMODE_BRIDGE;
+ // TODO: mode change
+ }
+ else {
+ _txtFilename = _missionToLoad;
+ initBridge(false);
+ // TODO: mode change
+ }
+
+ return true;
+}
+
+/**
+ * Call this after loading "saveOrLoadMetadata" to load all the data pertaining to game
+ * execution.
+ */
+bool StarTrekEngine::saveOrLoadGameData(Common::SeekableReadStream *in, Common::WriteStream *out, SavegameMetadata *meta) {
+ Common::Serializer ser(in, out);
+
+ if (ser.isLoading()) {
+ if (_lastGameMode == GAMEMODE_BRIDGE)
+ cleanupBridge();
+ else // Assume GAMEMODE_AWAYMISSION
+ unloadRoom();
+ }
+
+ ser.syncAsUint16LE(_gameMode);
+ // TODO: sub_1d8eb (save) / sub_1d958 (load) (probably bridge / space combat state)
+
+ ser.syncString(_sound->_loadedMidiFilename);
+ ser.syncAsSint16LE(_sound->_loopingMidiTrack);
+
+ if (ser.isLoading()) {
+ if (_sound->_loadedMidiFilename.empty())
+ _sound->clearAllMidiSlots();
+ else {
+ _sound->loadMusicFile(_sound->_loadedMidiFilename);
+ _sound->playMidiMusicTracks(_sound->_loopingMidiTrack, _sound->_loopingMidiTrack);
+ }
+ }
+
+ ser.syncAsUint16LE(_frameIndex);
+ ser.syncAsUint16LE(_mouseControllingShip);
+ // TODO: word_45aa8
+ // TODO: word_45aaa
+ // TODO: word_45aac
+ // TODO: word_5082e
+ // TODO: dword_519b0
+ // TODO: word_45ab2
+ // TODO: word_45ab4
+ // TODO: word_45ab8
+
+ ser.syncString(_missionToLoad);
+ // TODO: word_4b032
+ // TODO: word_519bc
+ // TODO: word_45c5c
+ // TODO: unk_52afe
+ ser.syncString(_sound->_loopingAudioName);
+
+ if (ser.isLoading()) {
+ if (!_sound->_loopingAudioName.empty())
+ _sound->playVoc(_sound->_loopingAudioName);
+ }
+
+ // TODO: word_45a50
+
+ for (int i = 0; i < NUM_OBJECTS; i++) {
+ ser.syncAsByte(_itemList[i].have);
+ }
+
+ if (_gameMode == GAMEMODE_AWAYMISSION) {
+ ser.syncString(_missionName);
+ ser.syncAsSint16LE(_roomIndex);
+
+ if (ser.isLoading()) {
+ _gfx->fadeoutScreen();
+ _txtFilename = "ground";
+
+ // This must be done before loading the actor variables, since this clears
+ // them.
+ loadRoom(_missionName, _roomIndex);
+ }
+
+ ser.syncAsUint32LE(_roomFrameCounter);
+ ser.syncAsUint32LE(_frameIndex); // FIXME: redundant
+
+ // Serialize the "actor" class
+ for (int i = 0; i < NUM_ACTORS; i++) {
+ Actor *a = &_actorList[i];
+ ser.syncAsUint16LE(a->spriteDrawn);
+ ser.syncBytes((byte *)a->animFilename, 16);
+ ser.syncAsUint16LE(a->animType);
+
+ a->sprite.saveLoadWithSerializer(ser);
+
+ ser.syncBytes((byte *)a->bitmapFilename, 10);
+ ser.syncAsUint16LE(a->scale);
+ // Can't save "animFile" (will be reloaded)
+ ser.syncAsUint16LE(a->numAnimFrames);
+ ser.syncAsUint16LE(a->animFrame);
+ ser.syncAsUint32LE(a->frameToStartNextAnim);
+ ser.syncAsSint16LE(a->pos.x);
+ ser.syncAsSint16LE(a->pos.y);
+ ser.syncAsUint16LE(a->field60);
+ ser.syncAsUint16LE(a->field62);
+ ser.syncAsUint16LE(a->triggerActionWhenAnimFinished);
+ ser.syncAsUint16LE(a->finishedAnimActionParam);
+ ser.syncBytes((byte *)a->animationString2, 8);
+ ser.syncAsUint16LE(a->field70);
+ ser.syncAsUint16LE(a->field72);
+ ser.syncAsUint16LE(a->field74);
+ ser.syncAsUint16LE(a->field76);
+ ser.syncAsSint16LE(a->iwSrcPosition);
+ ser.syncAsSint16LE(a->iwDestPosition);
+ ser.syncAsSint32LE(a->granularPosX);
+ ser.syncAsSint32LE(a->granularPosY);
+ ser.syncAsSint32LE(a->speedX);
+ ser.syncAsSint32LE(a->speedY);
+ ser.syncAsSint16LE(a->dest.x);
+ ser.syncAsSint16LE(a->dest.y);
+ ser.syncAsUint16LE(a->field90);
+ ser.syncAsByte(a->field92);
+ ser.syncAsByte(a->direction);
+ ser.syncAsUint16LE(a->field94);
+ ser.syncAsUint16LE(a->field96);
+ ser.syncBytes((byte *)a->animationString, 10);
+ ser.syncAsUint16LE(a->fielda2);
+ ser.syncAsUint16LE(a->fielda4);
+ ser.syncAsUint16LE(a->fielda6);
+ }
+
+ ser.syncString(_mapFilename);
+ // TODO: awayMissionStruct
+
+ // The action queue
+ if (ser.isLoading()) {
+ _actionQueue = Common::Queue<Action>();
+ int16 n;
+ ser.syncAsSint16LE(n);
+ for (int i = 0; i < n; i++) {
+ Action a;
+ a.saveLoadWithSerializer(ser);
+ _actionQueue.push(a);
+ }
+ }
+ else { // Saving
+ int16 n = _actionQueue.size();
+ ser.syncAsSint16LE(n);
+ for (int i = 0; i < n; i++) {
+ Action a = _actionQueue.pop();
+ a.saveLoadWithSerializer(ser);
+ _actionQueue.push(a);
+ }
+ }
+
+ // Original game located changes in RDF files and saved them. Since RDF files
+ // aren't modified directly here, that's skipped.
+
+ ser.syncAsSint16LE(_objectHasWalkPosition);
+ ser.syncAsSint16LE(_objectWalkPosition.x);
+ ser.syncAsSint16LE(_objectWalkPosition.y);
+
+ for (int i = 0; i < MAX_BUFFERED_WALK_ACTIONS; i++) {
+ _actionOnWalkCompletion[i].saveLoadWithSerializer(ser);
+ ser.syncAsByte(_actionOnWalkCompletionInUse[i]);
+ }
+
+ ser.syncAsSint16LE(_warpHotspotsActive);
+ }
+
+ return true;
+}
+
+Common::String StarTrekEngine::getSavegameFilename(int slotId) const {
+ Common::String saveLoadSlot = _targetName;
+ saveLoadSlot += Common::String::format(".%.3d", slotId);
+ return saveLoadSlot;
+}
+
+
+// Static function (reused in detection.cpp)
+bool saveOrLoadMetadata(Common::SeekableReadStream *in, Common::WriteStream *out, SavegameMetadata *meta) {
+ Common::Serializer ser(in, out);
+
+ ser.syncAsUint32LE(meta->version);
+ ser.syncBytes((byte *)meta->description, SAVEGAME_DESCRIPTION_LEN + 1);
+
+ // Thumbnail
+ if (ser.isLoading()) {
+ if (!::Graphics::loadThumbnail(*in, meta->thumbnail))
+ meta->thumbnail = nullptr;
+ }
+ else
+ ::Graphics::saveThumbnail(*out);
+
+ // Creation date/time
+ ser.syncAsUint32LE(meta->saveDate);
+ debugC(5, kDebugSavegame, "Save date: %d", meta->saveDate);
+ ser.syncAsUint16LE(meta->saveTime);
+ debugC(5, kDebugSavegame, "Save time: %d", meta->saveTime);
+ ser.syncAsByte(meta->saveTimeSecs); // write seconds of save time as well
+ ser.syncAsUint32LE(meta->playTime);
+ debugC(5, kDebugSavegame, "Play time: %d", meta->playTime);
+
+ return true;
+}
+
+}
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index f344746..4686796 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -79,6 +79,12 @@ Sound::~Sound() {
}
+void Sound::clearAllMidiSlots() {
+ for (int i=0; i<8; i++) {
+ clearMidiSlot(i);
+ }
+}
+
/**
* Plays a midi track as a sound effect (one of midi slots 1-7)
*/
@@ -124,6 +130,12 @@ void Sound::playMidiTrackInSlot(int slot, int track) {
void Sound::loadMusicFile(const Common::String &baseSoundName) {
clearAllMidiSlots();
+
+ if (baseSoundName == _loadedMidiFilename)
+ return;
+
+ _loadedMidiFilename = baseSoundName;
+
/*
if (_vm->getPlatform() == Common::kPlatformAmiga)
playAmigaSound(baseSoundName);
@@ -339,12 +351,6 @@ void Sound::clearMidiSlot(int slot) {
_midiSlots[slot].track = -1;
}
-void Sound::clearAllMidiSlots() {
- for (int i=0; i<8; i++) {
- clearMidiSlot(i);
- }
-}
-
// Static callback method
void Sound::midiDriverCallback(void *data) {
Sound *s = (Sound*)data;
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
index 7030805..3885d81 100644
--- a/engines/startrek/sound.h
+++ b/engines/startrek/sound.h
@@ -53,6 +53,7 @@ public:
Sound(StarTrekEngine *vm);
~Sound();
+ void clearAllMidiSlots();
void playMidiTrack(int track);
void playMidiTrackInSlot(int slot, int track);
void loadMusicFile(const Common::String &baseSoundName);
@@ -71,13 +72,11 @@ private:
void loadPCMusicFile(const Common::String &baseSoundName);
void clearMidiSlot(int slot);
- void clearAllMidiSlots();
// MIDI-Related Variables
MidiDriver *_midiDriver;
MidiPlaybackSlot _midiSlots[8]; // 0 is for music; 1-7 are for sfx
Common::List<MidiPlaybackSlot*> _midiSlotList; // Sorts midi slots by most recently used
- int _loopingMidiTrack;
byte *loadedSoundData;
uint32 _midiDevice;
@@ -89,6 +88,8 @@ private:
public:
Common::String _loopingAudioName;
+ Common::String _loadedMidiFilename;
+ int _loopingMidiTrack;
private:
// Driver callback
diff --git a/engines/startrek/sprite.cpp b/engines/startrek/sprite.cpp
index f6ba48d..8961f9c 100644
--- a/engines/startrek/sprite.cpp
+++ b/engines/startrek/sprite.cpp
@@ -20,6 +20,7 @@
*
*/
+#include "startrek/common.h"
#include "startrek/sprite.h"
namespace StarTrek {
@@ -68,4 +69,24 @@ Common::Rect Sprite::getRect() {
return rect;
}
+void Sprite::saveLoadWithSerializer(Common::Serializer &ser) {
+ ser.syncAsSint16LE(pos.x);
+ ser.syncAsSint16LE(pos.y);
+ ser.syncAsUint16LE(drawPriority);
+ ser.syncAsUint16LE(drawPriority2);
+ ser.syncAsUint16LE(field8);
+ // Note: bitmap must be reloaded
+ ser.syncAsUint16LE(drawMode);
+ ser.syncAsUint16LE(textColor);
+ ser.syncAsUint16LE(bitmapChanged);
+ ser.syncAsUint16LE(rect2Valid);
+ ser.syncAsUint16LE(isOnScreen);
+ ser.syncAsUint16LE(field16);
+ serializeRect(lastDrawRect, ser);
+ serializeRect(drawRect, ser);
+ serializeRect(rectangle2, ser);
+ ser.syncAsSint16LE(drawX);
+ ser.syncAsSint16LE(drawY);
+}
+
}
diff --git a/engines/startrek/sprite.h b/engines/startrek/sprite.h
index e182f92..9b052a1 100644
--- a/engines/startrek/sprite.h
+++ b/engines/startrek/sprite.h
@@ -30,6 +30,7 @@
#include "common/ptr.h"
#include "common/rect.h"
+#include "common/serializer.h"
#include "common/stream.h"
using Common::SharedPtr;
@@ -41,7 +42,7 @@ namespace StarTrek {
// the rectangle, but ScummVM rects are not. Functions from Trek have been adapted to use
// ScummVM's rect format. Be wary of off-by-1 errors...
-struct Sprite {
+struct Sprite : Common::Serializable {
Common::Point pos;
uint16 drawPriority;
uint16 drawPriority2; // If two sprites' drawPriorities are equal, this is checked.
@@ -65,6 +66,9 @@ struct Sprite {
void dontDrawNextFrame();
Common::Rect getRect();
+
+ /// NOTE: even after calling this, "bitmap" must be reloaded by the caller.
+ virtual void saveLoadWithSerializer(Common::Serializer &ser);
};
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 96e74bf..f3f14bd 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -52,6 +52,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
DebugMan.addDebugChannel(kDebugSound, "sound", "Sound");
DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics");
+ DebugMan.addDebugChannel(kDebugSavegame, "savegame", "Savegames");
_gfx = nullptr;
_sound = nullptr;
@@ -474,8 +475,8 @@ void StarTrekEngine::updateActorAnimations() {
actor->animFile->read(animFrameFilename, 16);
sprite->setBitmap(loadAnimationFrame(animFrameFilename, actor->scale));
- memset(actor->animationString4, 0, 10);
- strncpy(actor->animationString4, animFrameFilename, 9);
+ memset(actor->bitmapFilename, 0, 10);
+ strncpy(actor->bitmapFilename, animFrameFilename, 9);
actor->animFile->seek(10 + actor->animFrame * 22, SEEK_SET);
uint16 xOffset = actor->animFile->readUint16();
@@ -588,7 +589,7 @@ void StarTrekEngine::drawActorToScreen(Actor *actor, const Common::String &_anim
Common::String animFilename = _animName;
if (_animName.hasPrefixIgnoreCase("stnd") /* && word_45d20 == -1 */) // TODO
animFilename += 'j';
- memcpy(actor->animationString3, _animName.c_str(), sizeof(actor->animationString3));
+ memcpy(actor->animFilename, _animName.c_str(), sizeof(actor->animFilename));
actor->animType = 2;
actor->animFile = loadFile(animFilename + ".anm");
@@ -611,8 +612,8 @@ void StarTrekEngine::drawActorToScreen(Actor *actor, const Common::String &_anim
_gfx->addSprite(sprite);
sprite->setBitmap(loadAnimationFrame(firstFrameFilename, scale));
- memset(actor->animationString4, 0, sizeof(char) * 10);
- strncpy(actor->animationString4, firstFrameFilename, sizeof(char) * 9);
+ memset(actor->bitmapFilename, 0, sizeof(char) * 10);
+ strncpy(actor->bitmapFilename, firstFrameFilename, sizeof(char) * 9);
actor->scale = scale;
@@ -683,8 +684,8 @@ void StarTrekEngine::updateActorPositionWhileWalking(Actor *actor, int16 x, int1
Common::String animName = Common::String::format("%s%02d", actor->animationString2, actor->field92 & 7);
actor->sprite.setBitmap(loadAnimationFrame(animName, actor->scale));
- memset(actor->animationString4, 0, 10);
- strncpy(actor->animationString4, animName.c_str(), 9);
+ memset(actor->bitmapFilename, 0, 10);
+ strncpy(actor->bitmapFilename, animName.c_str(), 9);
Sprite *sprite = &actor->sprite;
sprite->drawPriority = _gfx->getPriValue(0, y);
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 52d23c5..cf678eb 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -29,11 +29,14 @@
#include "common/random.h"
#include "common/rect.h"
#include "common/scummsys.h"
+#include "common/serializer.h"
#include "common/str.h"
#include "common/stream.h"
#include "common/system.h"
#include "common/util.h"
+#include "gui/saveload-dialog.h"
+
#include "engines/engine.h"
#include "startrek/action.h"
@@ -60,6 +63,32 @@ class Room;
typedef String (StarTrekEngine::*TextGetterFunc)(int, uintptr, String *);
+const int SAVEGAME_DESCRIPTION_LEN = 30;
+
+struct SavegameMetadata {
+ uint32 version;
+ char description[SAVEGAME_DESCRIPTION_LEN + 1];
+
+ uint32 saveDate;
+ uint16 saveTime;
+ byte saveTimeSecs;
+ uint32 playTime;
+
+ ::Graphics::Surface *thumbnail;
+
+ void setSaveTimeAndDate(TimeDate time) {
+ saveDate = ((time.tm_mday & 0xFF) << 24) | (((time.tm_mon + 1) & 0xFF) << 16) | ((time.tm_year + 1900) & 0xFFFF);
+ saveTime = ((time.tm_hour & 0xFF) << 8) | ((time.tm_min) & 0xFF);
+ saveTimeSecs = time.tm_sec & 0xFF;
+ }
+
+ int getDay() { return (saveDate >> 24) & 0xFF; }
+ int getMonth() { return (saveDate >> 16) & 0xFF; }
+ int getYear() { return saveDate & 0xFFFF; }
+ int getHour() { return (saveTime >> 8) & 0xFF; }
+ int getMinute() { return saveTime & 0xFF; }
+};
+
const int MAX_MENUBUTTONS = 32;
const int TEXTBOX_WIDTH = 26;
@@ -79,7 +108,8 @@ enum StarTrekGameFeatures {
enum kDebugLevels {
kDebugSound = 1 << 0,
- kDebugGraphics = 1 << 1
+ kDebugGraphics = 1 << 1,
+ kDebugSavegame = 2 << 1
};
enum GameMode {
@@ -209,6 +239,10 @@ private:
// Transporter room
void runTransportSequence(const Common::String &name);
+ // Bridge
+ void initBridge(bool b) {}; // TODO
+ void cleanupBridge() {}; // TODO
+
public:
StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gamedesc);
virtual ~StarTrekEngine();
@@ -314,8 +348,6 @@ public:
void unloadMenuButtons();
void chooseMouseBitmapForAction(int action, bool withRedOutline);
- void showSaveMenu();
- void showLoadMenu();
void showQuitGamePrompt(int x, int y);
void showGameOverMenu();
void showTextConfigurationMenu(bool fromOptionMenu);
@@ -333,6 +365,18 @@ private:
// Saved value of StarTrekEngine::_keyboardControlsMouse when menus are up
bool _keyboardControlsMouseOutsideMenu;
+ // saveload.cpp
+public:
+ bool showSaveMenu();
+ bool showLoadMenu();
+
+ bool saveGame(int slot, Common::String desc);
+ bool loadGame(int slot);
+
+ bool saveOrLoadGameData(Common::SeekableReadStream *in, Common::WriteStream *out, SavegameMetadata *meta);
+
+ Common::String getSavegameFilename(int slotId) const;
+
// Detection related functions
public:
const StarTrekGameDescription *_gameDescription;
@@ -358,6 +402,9 @@ public:
int _gameMode;
int _lastGameMode;
+ // NOTE: this has a different meaning than the original game. When non-empty, a new
+ // room load is triggered, as opposed to original behaviour where this was only read
+ // when "loadRoom" was called.
Common::String _missionToLoad;
int _roomIndexToLoad;
int _spawnIndexToLoad;
@@ -438,6 +485,9 @@ private:
SharedPtr<Room> _room;
};
+// Static function
+bool saveOrLoadMetadata(Common::SeekableReadStream *in, Common::WriteStream *out, SavegameMetadata *meta);
+
} // End of namespace StarTrek
#endif
Commit: ed7d22cd0f2ac6a42bde79d49d417c7c981e0758
https://github.com/scummvm/scummvm/commit/ed7d22cd0f2ac6a42bde79d49d417c7c981e0758
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Make "missionScore" mission-specific
Changed paths:
engines/startrek/awaymission.h
engines/startrek/rooms/demon0.cpp
engines/startrek/rooms/demon1.cpp
engines/startrek/rooms/demon2.cpp
engines/startrek/rooms/demon3.cpp
engines/startrek/rooms/demon4.cpp
engines/startrek/rooms/demon5.cpp
engines/startrek/rooms/demon6.cpp
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 5029c8c..60d9b5bd7 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -92,10 +92,9 @@ struct AwayMission {
bool lookedAtComputer; // 0x55
byte field56; // 0x56
bool foundAlienRoom; // 0x57
+ int16 missionScore; // 0x58
} demon;
};
-
- int16 missionScore; // 0x58
};
// Size: 0x129 bytes
diff --git a/engines/startrek/rooms/demon0.cpp b/engines/startrek/rooms/demon0.cpp
index 2986810..9adb2eb 100644
--- a/engines/startrek/rooms/demon0.cpp
+++ b/engines/startrek/rooms/demon0.cpp
@@ -157,7 +157,7 @@ void Room::demon0TalkToPrelate() {
if (_vm->_awayMission.demon.talkedToPrelate)
return;
- _vm->_awayMission.missionScore += 3;
+ _vm->_awayMission.demon.missionScore += 3;
_vm->_awayMission.demon.talkedToPrelate = true;
const int *response = nullptr;
@@ -330,7 +330,7 @@ void Room::demon0BadResponse() {
if (_vm->_awayMission.demon.wasRudeToPrelate)
return;
- _vm->_awayMission.missionScore -= 3;
+ _vm->_awayMission.demon.missionScore -= 3;
_vm->_awayMission.demon.wasRudeToPrelate = true;
showText(TX_SPEAKER_ANGIVEN, TX_DEM0_033);
diff --git a/engines/startrek/rooms/demon1.cpp b/engines/startrek/rooms/demon1.cpp
index a5c42d3..3bd3e7c 100644
--- a/engines/startrek/rooms/demon1.cpp
+++ b/engines/startrek/rooms/demon1.cpp
@@ -435,7 +435,7 @@ void Room::demon1ReachedHand() {
void Room::demon1PickedUpHand() {
loadActorStandAnim(13);
- _vm->_awayMission.missionScore += 3;
+ _vm->_awayMission.demon.missionScore += 3;
loadActorStandAnim(OBJECT_KIRK);
_vm->_awayMission.timers[4] = 2;
}
diff --git a/engines/startrek/rooms/demon2.cpp b/engines/startrek/rooms/demon2.cpp
index 9f54cde..4e8f8b2 100644
--- a/engines/startrek/rooms/demon2.cpp
+++ b/engines/startrek/rooms/demon2.cpp
@@ -167,7 +167,7 @@ void Room::demon2PickedUpBerries() {
showText(TX_DEM2N013);
giveItem(OBJECT_IBERRY);
_vm->_awayMission.demon.gotBerries = true;
- _vm->_awayMission.missionScore += 1;
+ _vm->_awayMission.demon.missionScore += 1;
}
}
diff --git a/engines/startrek/rooms/demon3.cpp b/engines/startrek/rooms/demon3.cpp
index dbd0c67..689882d 100644
--- a/engines/startrek/rooms/demon3.cpp
+++ b/engines/startrek/rooms/demon3.cpp
@@ -90,7 +90,7 @@ void Room::demon3Timer3Expired() {
loadActorAnim(14, "door", 0x82, 0xc, 0);
loadMapFile("demon3");
_vm->_awayMission.demon.doorOpened = true;
- _vm->_awayMission.missionScore += 2;
+ _vm->_awayMission.demon.missionScore += 2;
}
else {
showText(TX_DEM3N007);
@@ -457,7 +457,7 @@ void Room::demon3McCoyFinishedHealingMiner() {
showText(TX_SPEAKER_MCCOY, TX_DEM3_021);
_vm->_awayMission.demon.healedMiner = true;
loadActorAnim2(13, "drmine", 0xda, 0x6c, 0);
- _vm->_awayMission.missionScore += 2;
+ _vm->_awayMission.demon.missionScore += 2;
walkCrewman(OBJECT_MCCOY, 0x104, 0x96, 0);
}
}
diff --git a/engines/startrek/rooms/demon4.cpp b/engines/startrek/rooms/demon4.cpp
index 8f2e310..b42eb80 100644
--- a/engines/startrek/rooms/demon4.cpp
+++ b/engines/startrek/rooms/demon4.cpp
@@ -77,7 +77,7 @@ void Room::demon4FinishedAnimation3() {
showText(TX_SPEAKER_SPOCK, TX_DEM4_030);
_vm->_awayMission.disableInput = true;
- _vm->_awayMission.missionScore += 5;
+ _vm->_awayMission.demon.missionScore += 5;
_vm->_awayMission.timers[1] = 20;
}
@@ -109,11 +109,11 @@ void Room::demon4CrewmanReachedBeamoutPosition() {
return;
if (!_vm->_awayMission.demon.insultedStephen)
- _vm->_awayMission.missionScore += 3;
+ _vm->_awayMission.demon.missionScore += 3;
if (!_vm->_awayMission.redshirtDead)
- _vm->_awayMission.missionScore += 2;
+ _vm->_awayMission.demon.missionScore += 2;
- endMission(_vm->_awayMission.missionScore, 0x24, 0);
+ endMission(_vm->_awayMission.demon.missionScore, 0x24, 0);
}
void Room::demon4Timer2Expired() {
@@ -175,7 +175,7 @@ void Room::demon4UseMetalOnNauian() {
void Room::demon4KirkReachedNauian() {
loadActorAnim2(8, "usekey", 0x107, 0x8e, 3);
loseItem(OBJECT_IMETAL);
- _vm->_awayMission.missionScore += 2;
+ _vm->_awayMission.demon.missionScore += 2;
_vm->_awayMission.demon.itemsTakenFromCase &= ~1;
}
@@ -191,7 +191,7 @@ void Room::demon4KirkReachedNauianWithSkull() {
switch (choice) {
case 0:
- _vm->_awayMission.missionScore++;
+ _vm->_awayMission.demon.missionScore++;
loadActorAnim2(8, "takesk", 0x107, 0x8e, 0);
loseItem(OBJECT_ISKULL);
_vm->_awayMission.demon.itemsTakenFromCase &= ~16; // BUG: skull reappears in case? Can abuse for infinite ponits?
@@ -277,7 +277,7 @@ void Room::demon4TalkToNauian() {
showText(TX_SPEAKER_SPOCK, TX_DEM4_030);
_vm->_awayMission.disableInput = true;
- _vm->_awayMission.missionScore += 5;
+ _vm->_awayMission.demon.missionScore += 5;
_vm->_awayMission.timers[1] = 20;
}
else {
@@ -365,7 +365,7 @@ void Room::demon4CrewmanReachedPanel() {
if (demon4ShowSunPuzzle()) {
_vm->_awayMission.demon.solvedSunPuzzle = true;
loadActorAnim(9, "ctrl", 0, 0, 0);
- _vm->_awayMission.missionScore += 3;
+ _vm->_awayMission.demon.missionScore += 3;
_vm->_awayMission.timers[0] = 10;
}
else
diff --git a/engines/startrek/rooms/demon5.cpp b/engines/startrek/rooms/demon5.cpp
index 4282ca1..010b90c 100644
--- a/engines/startrek/rooms/demon5.cpp
+++ b/engines/startrek/rooms/demon5.cpp
@@ -95,7 +95,7 @@ void Room::demon5MccoyHealedChub() {
showText(TX_SPEAKER_CHUB, TX_DEM5L027);
loseItem(OBJECT_IDETOXIN);
_vm->_awayMission.demon.curedChub = true;
- _vm->_awayMission.missionScore += 2;
+ _vm->_awayMission.demon.missionScore += 2;
}
void Room::demon5UseHypoDytoxinOnAnything() {
diff --git a/engines/startrek/rooms/demon6.cpp b/engines/startrek/rooms/demon6.cpp
index 42bb662..ca0c1a0 100644
--- a/engines/startrek/rooms/demon6.cpp
+++ b/engines/startrek/rooms/demon6.cpp
@@ -139,7 +139,7 @@ void Room::demon6LookAtComputer() {
showText(TX_DEM6N006);
if (!_vm->_awayMission.demon.lookedAtComputer) {
_vm->_awayMission.demon.lookedAtComputer = true;
- _vm->_awayMission.missionScore++;
+ _vm->_awayMission.demon.missionScore++;
}
}
@@ -202,7 +202,7 @@ void Room::demon6FinishedMakingHypoDytoxin() {
if (!_vm->_awayMission.demon.gavePointsForDytoxin) {
_vm->_awayMission.demon.gavePointsForDytoxin = true;
- _vm->_awayMission.missionScore++;
+ _vm->_awayMission.demon.missionScore++;
}
}
@@ -224,7 +224,7 @@ void Room::demon6SpockReachedWorkspace() {
void Room::demon6SpockFinishedRepairingHand() {
showText(TX_SPEAKER_SPOCK, TX_DEM6_024);
_vm->_awayMission.demon.repairedHand = true;
- _vm->_awayMission.missionScore += 2;
+ _vm->_awayMission.demon.missionScore += 2;
loadActorStandAnim(OBJECT_SPOCK);
_vm->_awayMission.disableInput = false;
}
Commit: ad76c744afc777c2e602fb2f3646ef7b93925db2
https://github.com/scummvm/scummvm/commit/ad76c744afc777c2e602fb2f3646ef7b93925db2
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: TUG0 (first room of mission 2)
Changed paths:
A engines/startrek/rooms/tug0.cpp
engines/startrek/awaymission.h
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/sound.h
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 60d9b5bd7..bf97739 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -94,6 +94,19 @@ struct AwayMission {
bool foundAlienRoom; // 0x57
int16 missionScore; // 0x58
} demon;
+
+ // Hijacked
+ struct {
+ int16 missionScore; // 0x29
+ int16 field2b; // 0x2b
+ int16 field2d; // 0x2d;
+ bool engineerConscious; // 0x30
+ bool gotTransmogrifier; // 0x43
+ bool transporterRepaired; // 0x44
+ bool spockExaminedTransporter; // 0x45
+ bool usedTransmogrifierOnTransporter; // 0x46
+ bool haveBomb; // 0x49
+ } tug;
};
};
// Size: 0x129 bytes
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index f061ac3..36aff9e 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -26,6 +26,7 @@ MODULE_OBJS = \
rooms/demon4.o \
rooms/demon5.o \
rooms/demon6.o \
+ rooms/tug0.o \
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index a2cc0d2..b66764f 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -65,6 +65,10 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_roomActionList = demon6ActionList;
_numRoomActions = sizeof(demon6ActionList) / sizeof(RoomAction);
}
+ else if (name == "TUG0") {
+ _roomActionList = tug0ActionList;
+ _numRoomActions = sizeof(tug0ActionList) / sizeof(RoomAction);
+ }
else {
warning("Room \"%s\" unimplemented", name.c_str());
_numRoomActions = 0;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 4dd6e05..84b1b69 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -471,6 +471,70 @@ public:
void demon6KirkReachedCase();
int demon6ShowCase(int visible);
+ // TUG0
+ void tug0Tick1();
+ void tug0LookAtEngineer();
+ void tug0GetEngineer();
+ void tug0LookAtControls();
+ void tug0UseSpockOnControls();
+ void tug0SpockReachedControlsToExamine();
+ void tug0SpockExaminedControls();
+ void tug0UseTransmogrifierWithoutBitOnControls();
+ void tug0UseTransmogrifierWithBitOnControls();
+ void tug0SpockReachedControlsWithTransmogrifier();
+ void tug0SpockFinishedUsingTransmogrifier();
+ void tug0TransporterScreenFullyLit();
+ void tug0UseWireScrapsOnControls();
+ void tug0UseWireOnControls();
+ void tug0SpockReachedControlsWithWire();
+ void tug0SpockFinishedUsingWire();
+ void tug0UseMedkitOnEngineer();
+ void tug0MccoyReachedEngineer();
+ void tug0MccoyHealedEngineer();
+ void tug0EngineerGotUp();
+ void tug0GetTransmogrifier();
+ void tug0KirkReachedToolbox();
+ void tug0KirkGotTransmogrifier();
+ void tug0LookAtToolbox();
+ void tug0UsePhaserOnWelder();
+ void tug0UseWelderOnWireScraps();
+ void tug0UseWelderOnMetalScraps();
+ void tug0UseCombBitOnTransmogrifier();
+ void tug0UseTransporter();
+ void tug0SpockReachedControlsToTransport();
+ void tug0SpockPreparedTransporter();
+ void tug0SpockReachedTransporter();
+ void tug0FinishedTransporting();
+ void tug0UseBombOnTransporter();
+ void tug0KirkReachedTransporter();
+ void tug0KirkPlacedBomb();
+ void tug0SpockReachedControlsForBomb();
+ void tug0SpockBeginsBeamingBomb();
+ void tug0SpockFinishesBeamingBomb();
+ void tug0BombExploded();
+ void tug0UseMTricorderOnControls();
+ void tug0UseSTricorderOnControls();
+ void tug0UseMTricorderOnEngineer();
+ void tug0MccoyReachedEngineerToScan();
+ void tug0MccoyFinishedScanningEngineer();
+ void tug0UseSTricorderOnEngineer();
+ void tug0WalkToDoor();
+ void tug0LookAtKirk();
+ void tug0LookAtSpock();
+ void tug0LookAtMccoy();
+ void tug0LookAtRedshirt();
+ void tug0LookAtTransporter();
+ void tug0LookAtDoor();
+ void tug0TalkToKirk();
+ void tug0TalkToMccoy();
+ void tug0TalkToSpock();
+ void tug0TalkToRedshirt();
+ void tug0TalkToEngineer();
+ void tug0UseCommunicator();
+ void tug0LookAnywhere();
+ void tug0UseSTricorderAnywhere();
+ void tug0UseMTricorderAnywhere();
+
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index db647df..1b52b05 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -513,6 +513,82 @@ RoomAction demon6ActionList[] = {
{ Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::demon6KirkReachedCase },
};
+
+RoomAction tug0ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::tug0Tick1 },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::tug0LookAtEngineer },
+ { Action(ACTION_GET, 8, 0, 0), &Room::tug0GetEngineer },
+
+ { Action(ACTION_LOOK, 11, 0, 0), &Room::tug0LookAtControls },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::tug0LookAtControls },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x21, 0), &Room::tug0UseSpockOnControls },
+ { Action(ACTION_FINISHED_WALKING, 16, 0, 0), &Room::tug0SpockReachedControlsToExamine },
+ { Action(ACTION_FINISHED_ANIMATION, 17, 0, 0), &Room::tug0SpockExaminedControls },
+ { Action(ACTION_USE, OBJECT_IRT, 0x21, 0), &Room::tug0UseTransmogrifierWithoutBitOnControls },
+ { Action(ACTION_USE, OBJECT_IRTWB, 0x21, 0), &Room::tug0UseTransmogrifierWithBitOnControls },
+ { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::tug0SpockReachedControlsWithTransmogrifier },
+ { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::tug0SpockFinishedUsingTransmogrifier },
+ { Action(ACTION_FINISHED_ANIMATION, 22, 0, 0), &Room::tug0TransporterScreenFullyLit },
+ { Action(ACTION_USE, OBJECT_IWIRSCRP, 0x21, 0), &Room::tug0UseWireScrapsOnControls },
+ { Action(ACTION_USE, OBJECT_IWIRING, 0x21, 0), &Room::tug0UseWireOnControls },
+ { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::tug0SpockReachedControlsWithWire },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::tug0SpockFinishedUsingWire },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 8, 0), &Room::tug0UseMedkitOnEngineer },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::tug0MccoyReachedEngineer },
+ { Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::tug0MccoyHealedEngineer },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::tug0EngineerGotUp },
+ { Action(ACTION_GET, 9, 0, 0), &Room::tug0GetTransmogrifier },
+ { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::tug0KirkReachedToolbox },
+ { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::tug0KirkGotTransmogrifier },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::tug0LookAtToolbox },
+
+ { Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_IPWE, 0), &Room::tug0UsePhaserOnWelder },
+ { Action(ACTION_USE, OBJECT_IPHASERK, OBJECT_IPWE, 0), &Room::tug0UsePhaserOnWelder },
+ { Action(ACTION_USE, OBJECT_IPWE, OBJECT_IWIRSCRP, 0), &Room::tug0UseWelderOnWireScraps },
+ { Action(ACTION_USE, OBJECT_IPWE, OBJECT_IJNKMETL, 0), &Room::tug0UseWelderOnMetalScraps },
+ { Action(ACTION_USE, OBJECT_ICOMBBIT, OBJECT_IRT, 0), &Room::tug0UseCombBitOnTransmogrifier },
+
+ { Action(ACTION_USE, OBJECT_SPOCK, 11, 0), &Room::tug0UseTransporter },
+ { Action(ACTION_USE, OBJECT_KIRK, 0x22, 0), &Room::tug0UseTransporter },
+ { Action(ACTION_FINISHED_WALKING, 14, 0, 0), &Room::tug0SpockReachedControlsToTransport },
+ { Action(ACTION_FINISHED_ANIMATION, 18, 0, 0), &Room::tug0SpockPreparedTransporter },
+ { Action(ACTION_FINISHED_WALKING, 20, 0, 0), &Room::tug0SpockReachedTransporter },
+ { Action(ACTION_FINISHED_ANIMATION, 21, 0, 0), &Room::tug0FinishedTransporting },
+
+ { Action(ACTION_USE, OBJECT_IBOMB, 0x22, 0), &Room::tug0UseBombOnTransporter },
+ { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::tug0KirkReachedTransporter },
+ { Action(ACTION_FINISHED_ANIMATION, 10, 0, 0), &Room::tug0KirkPlacedBomb },
+ { Action(ACTION_FINISHED_WALKING, 15, 0, 0), &Room::tug0SpockReachedControlsForBomb },
+ { Action(ACTION_FINISHED_ANIMATION, 19, 0, 0), &Room::tug0SpockBeginsBeamingBomb },
+ { Action(ACTION_FINISHED_ANIMATION, 12, 0, 0), &Room::tug0SpockFinishesBeamingBomb },
+ { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::tug0BombExploded },
+
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x21, 0), &Room::tug0UseMTricorderOnControls },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::tug0UseMTricorderOnControls },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::tug0UseSTricorderOnControls },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::tug0UseMTricorderOnEngineer },
+ { Action(ACTION_FINISHED_WALKING, 24, 0, 0), &Room::tug0MccoyReachedEngineerToScan },
+ { Action(ACTION_FINISHED_ANIMATION, 25, 0, 0), &Room::tug0MccoyFinishedScanningEngineer },
+ { Action(ACTION_USE, OBJECT_SPOCK, 8, 0), &Room::tug0UseSTricorderOnEngineer },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::tug0UseSTricorderOnEngineer },
+ { Action(ACTION_WALK, 0x23, 0, 0), &Room::tug0WalkToDoor },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::tug0LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::tug0LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::tug0LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::tug0LookAtRedshirt },
+ { Action(ACTION_LOOK, 0x22, 0, 0), &Room::tug0LookAtTransporter },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::tug0LookAtDoor },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::tug0TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::tug0TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::tug0TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::tug0TalkToRedshirt },
+ { Action(ACTION_TALK, 8, 0, 0), &Room::tug0TalkToEngineer },
+ { Action(ACTION_USE, OBJECT_ICOMM, 0, 0), &Room::tug0UseCommunicator },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::tug0LookAnywhere },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::tug0UseSTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::tug0UseMTricorderAnywhere },
+};
+
}
#endif
diff --git a/engines/startrek/rooms/tug0.cpp b/engines/startrek/rooms/tug0.cpp
new file mode 100644
index 0000000..016bbbb
--- /dev/null
+++ b/engines/startrek/rooms/tug0.cpp
@@ -0,0 +1,455 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+void Room::tug0Tick1() {
+ playVoc("TUG0LOOP");
+ playMidiMusicTracks(0, -1);
+
+ _vm->_awayMission.tug.field2b = 0x23;
+ if (_vm->_awayMission.tug.transporterRepaired)
+ loadActorAnim2(11, "t0con2", 0x105, 0xc2, 0);
+
+ if (!_vm->_awayMission.tug.engineerConscious)
+ loadActorAnim2(8, "tcdown", 0x27, 0xa8, 0);
+ else {
+ loadActorAnim2(8, "tcupd", 0x27, 0xa8, 0);
+
+ if (_vm->_awayMission.tug.gotTransmogrifier)
+ loadActorAnim2(9, "pempty", 0x27, 0xa9, 0);
+ else {
+ loadActorAnim2(9, "popend", 0x27, 0xa9, 0);
+ playVoc("MUR4E6S");
+ }
+ }
+}
+
+void Room::tug0LookAtEngineer() {
+ if (_vm->_awayMission.tug.engineerConscious)
+ showText(TX_TUG0N002);
+ else
+ showText(TX_TUG0N014);
+}
+
+void Room::tug0GetEngineer() {
+ showText(TX_SPEAKER_MCCOY, TX_TUG0_019);
+}
+
+void Room::tug0LookAtControls() {
+ if (_vm->_awayMission.tug.transporterRepaired)
+ showText(TX_TUG0N012);
+ else
+ showText(TX_TUG0N001);
+}
+
+void Room::tug0UseSpockOnControls() {
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ walkCrewman(OBJECT_SPOCK, 0xdb, 0xc5, 16);
+}
+
+void Room::tug0SpockReachedControlsToExamine() {
+ loadActorAnim2(OBJECT_SPOCK, "sscane", -1, -1, 17);
+ playSoundEffectIndex(SND_TRICORDER);
+}
+
+void Room::tug0SpockExaminedControls() {
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_040);
+ showText(TX_SPEAKER_KIRK, TX_TUG0_005);
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_043);
+ showText(TX_SPEAKER_KIRK, TX_TUG0_013);
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_038);
+ showText(TX_SPEAKER_KIRK, TX_TUG0_008);
+ _vm->_awayMission.tug.spockExaminedTransporter = true;
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::tug0UseTransmogrifierWithoutBitOnControls() {
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_014);
+}
+
+void Room::tug0UseTransmogrifierWithBitOnControls() {
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ walkCrewman(OBJECT_SPOCK, 0xdb, 0xc5, 6);
+}
+
+void Room::tug0SpockReachedControlsWithTransmogrifier() {
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_029);
+ loadActorAnim2(OBJECT_SPOCK, "susehn", -1, -1, 7);
+ playSoundEffectIndex(SND_BLANK_0b); // FIXME: blank sound?
+}
+
+void Room::tug0SpockFinishedUsingTransmogrifier() {
+ loseItem(OBJECT_IRTWB);
+ _vm->_awayMission.tug.usedTransmogrifierOnTransporter = true;
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.tug.missionScore++;
+}
+
+void Room::tug0TransporterScreenFullyLit() {
+ loadActorAnim2(11, "t0con2", 0x105, 0xc2, 0);
+}
+
+void Room::tug0UseWireScrapsOnControls() {
+ if (_vm->_awayMission.tug.usedTransmogrifierOnTransporter)
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_034);
+}
+
+void Room::tug0UseWireOnControls() {
+ if (_vm->_awayMission.tug.usedTransmogrifierOnTransporter) {
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ walkCrewman(OBJECT_SPOCK, 0xdb, 0xc5, 8);
+ }
+}
+
+void Room::tug0SpockReachedControlsWithWire() {
+ loadActorAnim2(OBJECT_SPOCK, "susehn", -1, -1, 9);
+}
+
+void Room::tug0SpockFinishedUsingWire() {
+ _vm->_awayMission.disableInput = false;
+ loseItem(OBJECT_IWIRING);
+ _vm->_awayMission.tug.missionScore++;
+ loadActorAnim2(11, "t0con1", 0x105, 0xc2, 22);
+
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_039);
+
+ _vm->_awayMission.tug.transporterRepaired = true;
+
+ showText(TX_SPEAKER_KIRK, TX_TUG0_010);
+ showText(TX_SPEAKER_MCCOY, TX_TUG0_022);
+ showText(TX_SPEAKER_KIRK, TX_TUG0_002);
+ showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L009);
+ showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L008);
+
+ if (_vm->_awayMission.tug.haveBomb) {
+ showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L010);
+ showText(TX_SPEAKER_MCCOY, TX_TUG0_021);
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_041);
+ }
+}
+
+void Room::tug0UseMedkitOnEngineer() {
+ if (_vm->_awayMission.tug.engineerConscious)
+ return;
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ walkCrewman(OBJECT_MCCOY, 0x2d, 0xaf, 2);
+}
+
+void Room::tug0MccoyReachedEngineer() {
+ loadActorAnim2(OBJECT_MCCOY, "museln", -1, -1, 13);
+}
+
+void Room::tug0MccoyHealedEngineer() {
+ loadActorAnim2(8, "tcup", 0x27, 0xa8, 1);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
+ walkCrewman(OBJECT_MCCOY, 0x41, 0xaf, 0);
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.tug.missionScore++;
+}
+
+void Room::tug0EngineerGotUp() {
+ showText(TX_SPEAKER_SIMPSON, TX_TUG0_F31);
+ _vm->_awayMission.tug.engineerConscious = true;
+ loadActorAnim2(8, "tcshow", 0x27, 0xa8, 0);
+ loadActorAnim2(9, "popen", 0x27, 0xa9, 0);
+ playVoc("MUR4E6S");
+}
+
+void Room::tug0GetTransmogrifier() {
+ if (_vm->_awayMission.tug.gotTransmogrifier)
+ return;
+ _vm->_awayMission.disableInput = true;
+ walkCrewman(OBJECT_KIRK, 0x1e, 0xb1, 3);
+}
+
+void Room::tug0KirkReachedToolbox() {
+ loadActorAnim2(OBJECT_KIRK, "kuselw", -1, -1, 4);
+}
+
+void Room::tug0KirkGotTransmogrifier() {
+ _vm->_awayMission.tug.gotTransmogrifier = true;
+ giveItem(OBJECT_IRT);
+ loadActorAnim2(9, "pempty", 0x27, 0xa9, 0);
+ loadActorStandAnim(OBJECT_KIRK);
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.tug.missionScore++;
+}
+
+void Room::tug0LookAtToolbox() {
+ if (_vm->_awayMission.tug.gotTransmogrifier)
+ showText(TX_TUG0N008);
+ else
+ showText(TX_TUG0N000);
+}
+
+void Room::tug0UsePhaserOnWelder() {
+ loseItem(OBJECT_IPWE);
+ giveItem(OBJECT_IPWF);
+ showText(TX_TUG0N006);
+}
+
+void Room::tug0UseWelderOnWireScraps() {
+ showText(TX_TUG0N010);
+ loseItem(OBJECT_IWIRSCRP);
+}
+
+void Room::tug0UseWelderOnMetalScraps() {
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_032);
+ loseItem(OBJECT_IJNKMETL);
+ giveItem(OBJECT_ICOMBBIT);
+}
+
+void Room::tug0UseCombBitOnTransmogrifier() {
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_035);
+ loseItem(OBJECT_ICOMBBIT);
+ loseItem(OBJECT_IRT);
+ giveItem(OBJECT_IRTWB);
+}
+
+void Room::tug0UseTransporter() {
+ if (!_vm->_awayMission.tug.transporterRepaired)
+ return;
+ _vm->_awayMission.disableInput = true;
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ walkCrewman(OBJECT_KIRK, 0x62, 0x7f, 0);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ walkCrewman(OBJECT_SPOCK, 0x11e, 0xc7, 14);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ walkCrewman(OBJECT_MCCOY, 0x7b, 0x7a, 0);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
+ walkCrewman(OBJECT_REDSHIRT, 0x4a, 0x7b, 0);
+}
+
+void Room::tug0SpockReachedControlsToTransport() {
+ loadActorAnim2(OBJECT_SPOCK, "susehw", -1, -1, 18);
+ playSoundEffectIndex(SND_07);
+ playSoundEffectIndex(SND_TRANSENE);
+}
+
+void Room::tug0SpockPreparedTransporter() {
+ showText(TX_SPEAKER_KIRK, TX_TUG0_001);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ walkCrewman(OBJECT_SPOCK, 0x9a, 0x7e, 20);
+}
+
+void Room::tug0SpockReachedTransporter() {
+ playSoundEffectIndex(SND_TRANSDEM);
+ loadActorAnim2(OBJECT_KIRK, "kteled", -1, -1, 21);
+ loadActorAnim2(OBJECT_SPOCK, "steled", -1, -1, 0);
+ loadActorAnim2(OBJECT_MCCOY, "mteled", -1, -1, 0);
+ loadActorAnim2(OBJECT_REDSHIRT, "rteled", -1, -1, 0);
+}
+
+void Room::tug0FinishedTransporting() {
+ _vm->_awayMission.tug.missionScore += 3;
+ _vm->_awayMission.disableInput = true;
+ loadRoomIndex(3, 4);
+}
+
+void Room::tug0UseBombOnTransporter() {
+ _vm->_awayMission.disableInput = true;
+
+ walkCrewman(OBJECT_KIRK, 0x62, 0x7f, 5);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ walkCrewman(OBJECT_MCCOY, 0x46, 0xbe, 0);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
+ walkCrewman(OBJECT_REDSHIRT, 0x78, 0xbe, 0);
+}
+
+void Room::tug0KirkReachedTransporter() {
+ loadActorAnim2(OBJECT_KIRK, "kpickw", -1, -1, 10);
+}
+
+void Room::tug0KirkPlacedBomb() {
+ loseItem(OBJECT_IBOMB);
+ loadActorAnim2(10, "bomb1", 0x5a, 0x7f, 0);
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ walkCrewman(OBJECT_KIRK, 0xc8, 0xbe, 11);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ walkCrewman(OBJECT_SPOCK, 0x11e, 0xc7, 15);
+}
+
+void Room::tug0SpockReachedControlsForBomb() {
+ loadActorAnim2(OBJECT_SPOCK, "susehw", -1, -1, 19);
+ playSoundEffectIndex(SND_07);
+ playSoundEffectIndex(SND_TRANSENE);
+}
+
+void Room::tug0SpockBeginsBeamingBomb() {
+ playSoundEffectIndex(SND_TRANSDEM);
+ loadActorAnim2(10, "bomb2", 0x5a, 0x7f, 12);
+}
+
+void Room::tug0SpockFinishesBeamingBomb() {
+ playSoundEffectIndex(SND_BLANK_14);
+ _vm->_awayMission.tug.missionScore = 0;
+ _vm->_awayMission.timers[0] = 64;
+}
+
+void Room::tug0BombExploded() {
+ playMidiMusicTracks(2, -1);
+ showText(TX_SPEAKER_MCCOY, TX_TUG0_023);
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_037);
+ showText(TX_SPEAKER_MCCOY, TX_TUG0_027);
+ showText(TX_SPEAKER_KIRK, TX_TUG0_004);
+ showText(TX_SPEAKER_SCOTT, TX_TUG0_S11);
+ showText(TX_SPEAKER_KIRK, TX_TUG0_003);
+ showText(TX_SPEAKER_SCOTT, TX_TUG0_S06);
+
+ _vm->_awayMission.tug.field2d = 1;
+ _vm->_awayMission.disableInput = true;
+ if (_vm->_awayMission.tug.missionScore < 0)
+ _vm->_awayMission.tug.missionScore = 0;
+ endMission(_vm->_awayMission.tug.missionScore, _vm->_awayMission.tug.field2b, _vm->_awayMission.tug.field2d);
+}
+
+void Room::tug0UseMTricorderOnControls() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_SPEAKER_MCCOY, TX_TUG0_016);
+}
+
+void Room::tug0UseSTricorderOnControls() {
+ loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 23);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_015);
+}
+
+void Room::tug0UseMTricorderOnEngineer() {
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ walkCrewman(OBJECT_MCCOY, 0x2d, 0xaf, 24);
+}
+
+void Room::tug0MccoyReachedEngineerToScan() {
+ playSoundEffectIndex(SND_TRICORDER);
+ loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 25);
+}
+
+void Room::tug0MccoyFinishedScanningEngineer() {
+ if (_vm->_awayMission.tug.engineerConscious)
+ showText(TX_SPEAKER_MCCOY, TX_TUG0_017);
+ else
+ showText(TX_SPEAKER_MCCOY, TX_TUG0_018);
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ walkCrewman(OBJECT_MCCOY, 0x41, 0xaf, 26);
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::tug0UseSTricorderOnEngineer() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_030);
+}
+
+void Room::tug0WalkToDoor() {
+ walkCrewman(OBJECT_KIRK, 0x138, 0xaa, 0);
+}
+
+void Room::tug0LookAtKirk() {
+ showText(TX_TUG0N003);
+}
+
+void Room::tug0LookAtSpock() {
+ showText(TX_TUG0N007);
+}
+
+void Room::tug0LookAtMccoy() {
+ showText(TX_TUG0N005);
+}
+
+void Room::tug0LookAtRedshirt() {
+ showText(TX_TUG0N004);
+}
+
+void Room::tug0LookAtTransporter() {
+ showText(TX_TUG0N013);
+}
+
+void Room::tug0LookAtDoor() {
+ showText(TX_TUG0N011);
+}
+
+void Room::tug0TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_TUG0_006);
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_036);
+ showText(TX_SPEAKER_KIRK, TX_TUG0_011);
+}
+
+void Room::tug0TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_TUG0_025);
+ showText(TX_SPEAKER_KIRK, TX_TUG0_007);
+ showText(TX_SPEAKER_MCCOY, TX_TUG0_024);
+}
+
+void Room::tug0TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_042);
+ showText(TX_SPEAKER_KIRK, TX_TUG0_009);
+}
+
+void Room::tug0TalkToRedshirt() {
+ showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L006);
+}
+
+void Room::tug0TalkToEngineer() {
+ if (_vm->_awayMission.tug.engineerConscious) {
+ showText(TX_SPEAKER_SIMPSON, TX_TUG0_F30);
+ showText(TX_SPEAKER_MCCOY, TX_TUG0_026);
+ showText(TX_SPEAKER_KIRK, TX_TUG0_012);
+ }
+}
+
+void Room::tug0UseCommunicator() {
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_031);
+}
+
+void Room::tug0LookAnywhere() {
+ showText(TX_TUG0N009);
+}
+
+void Room::tug0UseSTricorderAnywhere() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_028);
+}
+
+void Room::tug0UseMTricorderAnywhere() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_SPEAKER_MCCOY, TX_TUG0_020); // BUG: typo
+}
+
+}
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
index 3885d81..6e4dfcd 100644
--- a/engines/startrek/sound.h
+++ b/engines/startrek/sound.h
@@ -38,6 +38,27 @@ namespace StarTrek {
class StarTrekEngine;
+// Sound effects for "playSoundEffectIndex" function
+enum SoundEffects {
+ SND_TRICORDER = 4,
+ SND_DOOR1 = 5,
+ SND_PHASSHOT = 6,
+ SND_07 = 7,
+ SND_TRANSDEM = 8,
+ SND_TRANSMAT = 9,
+ SND_TRANSENE = 0x0a,
+ SND_BLANK_0b = 0x0b,
+ SND_SELECTION = 0x10,
+ SND_BLANK_14 = 0x14,
+ SND_HAILING = 0x22,
+ SND_PHASSHOT_2 = 0x24,
+ SND_PHOTSHOT = 0x25,
+ SND_HITSHIEL = 0x26,
+ SND_27 = 0x27,
+ SND_REDALERT = 0x28,
+ SND_WARP = 0x29
+};
+
// Max # of VOC files that can play at once
const int MAX_SFX_PLAYING = 4;
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index f3f14bd..7e9f9bb 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -80,7 +80,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxVar6 = 0;
_textboxHasMultipleChoices = false;
- _missionToLoad = "DEMON";
+ _missionToLoad = "TUG";
_roomIndexToLoad = 0;
for (int i = 0; i < NUM_OBJECTS; i++)
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 7a8a80f..dba4bab 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -34,6 +34,7 @@ enum GameStringIDs {
TX_SPEAKER_SPOCK,
TX_SPEAKER_MCCOY,
TX_SPEAKER_UHURA,
+ TX_SPEAKER_SCOTT,
TX_SPEAKER_EVERTS,
TX_SPEAKER_ANGIVEN,
@@ -46,6 +47,9 @@ enum GameStringIDs {
TX_SPEAKER_GRISNASH,
TX_SPEAKER_NAUIAN,
+ TX_SPEAKER_CHRISTENSEN,
+ TX_SPEAKER_SIMPSON,
+
TX_DEM0_001,
TX_DEM0_002,
TX_DEM0_003,
@@ -461,6 +465,74 @@ enum GameStringIDs {
TX_DEM6N024,
+ TX_TUG0_001,
+ TX_TUG0_002,
+ TX_TUG0_003,
+ TX_TUG0_004,
+ TX_TUG0_005,
+ TX_TUG0_006,
+ TX_TUG0_007,
+ TX_TUG0_008,
+ TX_TUG0_009,
+ TX_TUG0_010,
+ TX_TUG0_011,
+ TX_TUG0_012,
+ TX_TUG0_013,
+ TX_TUG0_014,
+ TX_TUG0_015,
+ TX_TUG0_016,
+ TX_TUG0_017,
+ TX_TUG0_018,
+ TX_TUG0_019,
+ TX_TUG0_020,
+ TX_TUG0_021,
+ TX_TUG0_022,
+ TX_TUG0_023,
+ TX_TUG0_024,
+ TX_TUG0_025,
+ TX_TUG0_026,
+ TX_TUG0_027,
+ TX_TUG0_028,
+ TX_TUG0_029,
+ TX_TUG0_030,
+ TX_TUG0_031,
+ TX_TUG0_032,
+ TX_TUG0_033,
+ TX_TUG0_034,
+ TX_TUG0_035,
+ TX_TUG0_036,
+ TX_TUG0_037,
+ TX_TUG0_038,
+ TX_TUG0_039,
+ TX_TUG0_040,
+ TX_TUG0_041,
+ TX_TUG0_042,
+ TX_TUG0_043,
+ TX_TUG0_F30,
+ TX_TUG0_F31,
+ TX_TUG0_S06,
+ TX_TUG0_S11,
+ TX_TUG0L006,
+ TX_TUG0L008,
+ TX_TUG0L009,
+ TX_TUG0L010,
+ TX_TUG0N000,
+ TX_TUG0N001,
+ TX_TUG0N002,
+ TX_TUG0N003,
+ TX_TUG0N004,
+ TX_TUG0N005,
+ TX_TUG0N006,
+ TX_TUG0N007,
+ TX_TUG0N008,
+ TX_TUG0N009,
+ TX_TUG0N010,
+ TX_TUG0N011,
+ TX_TUG0N012,
+ TX_TUG0N013,
+ TX_TUG0N014,
+
+
TX_END
};
@@ -473,6 +545,7 @@ const char * const g_gameStrings[] = {
"Mr. Spock",
"Dr. McCoy",
"Lt. Uhura",
+ "Mr. Scott",
"Ensign Everts",
"Prel. Angiven",
@@ -485,6 +558,9 @@ const char * const g_gameStrings[] = {
"Brother Grisnash",
"Nauian",
+ "Lt. Christensen",
+ "Crewman Simpson",
+
"#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?",
"#DEM0\\DEM0_002#Aside from seeing demons, has any hard data been collected? Any evidence I could see?",
"#DEM0\\DEM0_003#Been seeing ghosts and bogeymen eh? I find that a little hard to believe.",
@@ -898,6 +974,74 @@ const char * const g_gameStrings[] = {
"#DEM6\\DEM6N022#The glass case is locked.",
"#DEM6\\DEM6N023#The machine synthesizes a quantity of Hypo-Dytoxin.",
"#DEM6\\DEM6N024#This appears to be a study and lab. The equipment looks very ancient.",
+
+
+ "#TUG0\\TUG0_001#I'm going to have a word for you, Spock, if we appear inside the door!",
+ "#TUG0\\TUG0_002#Analysis, Lt. Christensen",
+ "#TUG0\\TUG0_003#Beam us out of here.",
+ "#TUG0\\TUG0_004#Bones, later. Kirk to Enterprise.",
+ "#TUG0\\TUG0_005#Can they be repaired, Spock?",
+ "#TUG0\\TUG0_006#Get what you can from this area -- let's get moving.",
+ "#TUG0\\TUG0_007#I can't see them winning any popularity contests, Bones.",
+ "#TUG0\\TUG0_008#I've always been a gambler, Spock. Figure out what you'll need.",
+ "#TUG0\\TUG0_009#Let's not look too far ahead, Mr. Spock.",
+ "#TUG0\\TUG0_010#Mr. Spock, you're a genius!",
+ "#TUG0\\TUG0_011#Okay, but let's not stay too long in one place.",
+ "#TUG0\\TUG0_012#Provided the Elasi don't have anything to say about it.",
+ "#TUG0\\TUG0_013#Spock, we don't have two days. If we can repair the transporter, we might be able to transport onto the bridge and capture the Elasi.",
+ "#TUG0\\TUG0_014#Captain, I need to find a bit that will fit into the transmogrifier before I can go further with this.",
+ "#TUG0\\TUG0_015#Even our most efficient Chief Engineer Scott would have trouble repairing this damage in less than two days.",
+ "#TUG0\\TUG0_016#Damn it, Jim. I'm a doctor, not a rocket scientist.",
+ "#TUG0\\TUG0_017#He will be all right, but we shouldn't move him.",
+ "#TUG0\\TUG0_018#He's not hurt badly. I can revive him.",
+ "#TUG0\\TUG0_019#I don't think he should be moved, Jim.",
+ "#TUG0\\TUG0_020#Well, at least I'm not picking up residue of any biologicalweapons. The Elasi used some restraint if you can call it that.",
+ "#TUG0\\TUG0_021#And any hostages on the bridge will be killed when the bomb goes off! No, Jim, that's inhuman!",
+ "#TUG0\\TUG0_022#I wouldn't go that far, Jim. But I do have to congratulate you, Mr. Spock. Now we can really risk shooting our atoms around the universe. Is this really necessary, Jim?",
+ "#TUG0\\TUG0_023#My God Jim, what have you done! You killed them all. You probably blew up the whole damn bridge.",
+ "#TUG0\\TUG0_024#They can forget about my vote.",
+ "#TUG0\\TUG0_025#Well Jim, there's one thing I can tell you -- I don't like Elasi.",
+ "#TUG0\\TUG0_026#Well, with any luck, you won't have to worry about that for quite some time.",
+ "#TUG0\\TUG0_027#You cold blooded emotionless...",
+ "#TUG0\\TUG0_028#I am registering energy residue from phaser fire and phaser grenade detonations. There are readings of another energy weapon, but the type is unknown.",
+ "#TUG0\\TUG0_029#I attach these here... Now all I need is a spare length of wiring.",
+ "#TUG0\\TUG0_030#I believe this would be in Dr. McCoy's field of expertise.",
+ "#TUG0\\TUG0_031#I strongly recommend that we keep our silence, Captain. The Elasi are quite capable of tracing any communication from within this vessel.",
+ "#TUG0\\TUG0_032#I think that does it -- a Comb Bit for the transmogrifier. Now I can continue repairs on the transporter controls. ",
+ "#TUG0\\TUG0_033#I'll be able to use this later, so I want to keep it -- but I need to get some equipment in here first.",
+ "#TUG0\\TUG0_034#The bits are not long enough, I need a longer piece of wire.",
+ "#TUG0\\TUG0_035#The parts fit together satisfactorily.",
+ "#TUG0\\TUG0_036#Captain, a thorough analysis is required.",
+ "#TUG0\\TUG0_037#Captain, the ship will crash into the planet in 18.32 seconds, I would recommend, leaving the ship immediately.",
+ "#TUG0\\TUG0_038#I can attempt to jury-rig repairs if I can find parts. However, there is only a 67.357 percent probability of success.",
+ "#TUG0\\TUG0_039#The controls are set for just inside the bridge door Captain.",
+ "#TUG0\\TUG0_040#The controls have been virtually destroyed, Captain.",
+ "#TUG0\\TUG0_041#To say nothing of the possible damage to the bridge controls.",
+ "#TUG0\\TUG0_042#When this operation is complete, Captain, we should have Mr. Scott or Transporter Chief Kyle come here to assist with the repairs.",
+ "#TUG0\\TUG0_043#With chief Engineer Scott's assistance, I believe we could get them in perfect working order in two days.",
+ "#TUG0\\TUG0_F30#I suppose I should be grateful to see anyone after that. I thought I was dead.",
+ "#TUG0\\TUG0_F31#Thank you, Doctor. Be careful, Captain, the Elasi like to set boobytraps. if you need any equipment I've got my tools in this workspace.",
+ "#TUG0\\TUG0_S06#Aye Captain.",
+ "#TUG0\\TUG0_S11#Captain, you're alive!",
+ "#TUG0\\TUG0L006#This is just like their raid on Damocles Station, hard, fast, and dirty.",
+ "#TUG0\\TUG0L008#If we could get past the forcefield on the door of the bridge, we should be able to surprise them for sure.",
+ "#TUG0\\TUG0L009#Security analysis, sir: if we transport onto the bridge, we'll have the drop on them -- assuming Mr. Spock has the transporter working porperly.",
+ "#TUG0\\TUG0L010#Since we have a bomb, Captain, we could rearm it, transport it onto the bridge, and perhaps the Elasi will flee into the hallway. Then we could capture them.",
+ "#TUG0\\TUG0N000#A Runcinate Transmogrifier: An engineering tool used in the maintainance of transporters, which can be fitted with bits having a variety of irregularly serrated surfaces.",
+ "#TUG0\\TUG0N001#A small bomb appears to have damaged the transporter controls.",
+ "#TUG0\\TUG0N002#Crewman Simpson.",
+ "#TUG0\\TUG0N003#James T. Kirk cautiously watches the area.",
+ "#TUG0\\TUG0N004#Lieutenant Christensen stands ready.",
+ "#TUG0\\TUG0N005#McCoy wonders how many patients he'll have on this mission.",
+ "#TUG0\\TUG0N006#Phaser Welder is now charged.",
+ "#TUG0\\TUG0N007#Spock quietly analyzes the damaged areas of this transporter room.",
+ "#TUG0\\TUG0N008#The cabinet is empty.",
+ "#TUG0\\TUG0N009#The transporter bay has been damaged in a recent fire fight.",
+ "#TUG0\\TUG0N010#The wire scraps are too small, they melt instead of fusing together, and you're left with nothing. ",
+ "#TUG0\\TUG0N011#These doors have been scarred by phaser fire. There was a battle here.",
+ "#TUG0\\TUG0N012#These transporter controls are now operational. They are set for just inside the bridge door.",
+ "#TUG0\\TUG0N013#This is the main transporter pad of the Masada.",
+ "#TUG0\\TUG0N014#This man was obviously the transporter engineer. He is unconscious, but alive.",
};
}
Commit: 0c28fd964e5aab156539d6ff64b82aa06cb22aef
https://github.com/scummvm/scummvm/commit/0c28fd964e5aab156539d6ff64b82aa06cb22aef
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: TUG1
Changed paths:
A engines/startrek/rooms/tug1.cpp
engines/startrek/awaymission.h
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/tug0.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index bf97739..d91ad46 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -101,10 +101,12 @@ struct AwayMission {
int16 field2b; // 0x2b
int16 field2d; // 0x2d;
bool engineerConscious; // 0x30
+ bool gotJunkPile; // 0x3f
bool gotTransmogrifier; // 0x43
bool transporterRepaired; // 0x44
bool spockExaminedTransporter; // 0x45
bool usedTransmogrifierOnTransporter; // 0x46
+ bool forceFieldDown; // 0x47
bool haveBomb; // 0x49
} tug;
};
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 36aff9e..fd3f80a 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -27,6 +27,7 @@ MODULE_OBJS = \
rooms/demon5.o \
rooms/demon6.o \
rooms/tug0.o \
+ rooms/tug1.o \
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index b66764f..4f960fb 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -69,6 +69,10 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_roomActionList = tug0ActionList;
_numRoomActions = sizeof(tug0ActionList) / sizeof(RoomAction);
}
+ else if (name == "TUG1") {
+ _roomActionList = tug1ActionList;
+ _numRoomActions = sizeof(tug1ActionList) / sizeof(RoomAction);
+ }
else {
warning("Room \"%s\" unimplemented", name.c_str());
_numRoomActions = 0;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 84b1b69..943ed90 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -535,6 +535,54 @@ public:
void tug0UseSTricorderAnywhere();
void tug0UseMTricorderAnywhere();
+ // TUG1
+ void tug1Tick1();
+ void tug1UseSTricorderOnAnything();
+ void tug1LookAtBridgeDoor();
+ void tug1UseSTricorderOnBridgeDoor();
+ void tug1UsePhaserOnBridgeDoor();
+ void tug1KirkReachedFiringPosition();
+ void tug1KirkPulledOutPhaser();
+ void tug1KirkFinishedFiringPhaser();
+ void tug1TalkToSpock();
+ void tug1UseSTricorderOnJunkPile();
+ void tug1LookAtJunkPile();
+ void tug1GetJunkPile();
+ void tug1KirkReachedJunkPile();
+ void tug1KirkFinishedTakingJunkPile();
+ void tug1UsePhaserOnWelder();
+ void tug1UseWelderOnWireScraps();
+ void tug1UseWelderOnMetalScraps();
+ void tug1UseCombBitOnTransmogrifier();
+ void tug1UsePhaserWelderOnBridgeDoor();
+ void tug1UsePhaserWelderOnBridgeDoorInLeftSpot();
+ void tug1KirkReachedBridgeDoorWithWelder();
+ void tug1KirkFinishedUsingWelder();
+ void tug1KirkReachedBridgeDoorWithWelderInLeftSpot();
+ void tug1KirkFinishedUsingWelderInLeftSpot();
+ void tug1LookAnywhere();
+ void tug1LookAtMccoy();
+ void tug1LookAtSpock();
+ void tug1LookAtRedshirt();
+ void tug1TalkToMccoy();
+ void tug1TalkToRedshirt();
+ void tug1LookAtTerminal();
+ void tug1LookAtDebris();
+ void tug1LookAtBrigDoor();
+ void tug1UseSTricorderOnBrigDoor();
+ void tug1TalkToKirk();
+ void tug1UseCommunicator();
+ void tug1WalkToBridgeDoor();
+ void tug1KirkReachedBridgeDoor();
+ void tug1BridgeDoorOpened();
+ void tug1WalkToBrigDoor();
+ void tug1UseMTricorderAnywhere();
+ void tug1UseMTricorderOnBridgeDoor();
+ void tug1UseMTricorderOnBrigDoor();
+ void tug1UseSpockOnBridgeDoor();
+ void tug1UseRedshirtOnBridgeDoor();
+ void tug1UseMedkitOnBridgeDoor();
+
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 1b52b05..7ea0139 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -544,8 +544,8 @@ RoomAction tug0ActionList[] = {
{ Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_IPWE, 0), &Room::tug0UsePhaserOnWelder },
{ Action(ACTION_USE, OBJECT_IPHASERK, OBJECT_IPWE, 0), &Room::tug0UsePhaserOnWelder },
- { Action(ACTION_USE, OBJECT_IPWE, OBJECT_IWIRSCRP, 0), &Room::tug0UseWelderOnWireScraps },
- { Action(ACTION_USE, OBJECT_IPWE, OBJECT_IJNKMETL, 0), &Room::tug0UseWelderOnMetalScraps },
+ { Action(ACTION_USE, OBJECT_IPWF, OBJECT_IWIRSCRP, 0), &Room::tug0UseWelderOnWireScraps },
+ { Action(ACTION_USE, OBJECT_IPWF, OBJECT_IJNKMETL, 0), &Room::tug0UseWelderOnMetalScraps },
{ Action(ACTION_USE, OBJECT_ICOMBBIT, OBJECT_IRT, 0), &Room::tug0UseCombBitOnTransmogrifier },
{ Action(ACTION_USE, OBJECT_SPOCK, 11, 0), &Room::tug0UseTransporter },
@@ -589,6 +589,69 @@ RoomAction tug0ActionList[] = {
{ Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::tug0UseMTricorderAnywhere },
};
+
+// TUG1
+RoomAction tug1ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::tug1Tick1 },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::tug1UseSTricorderOnAnything },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::tug1LookAtBridgeDoor },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::tug1UseSTricorderOnBridgeDoor },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 0x21, 0), &Room::tug1UsePhaserOnBridgeDoor },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 0x21, 0), &Room::tug1UsePhaserOnBridgeDoor },
+ { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::tug1KirkReachedFiringPosition },
+ { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::tug1KirkPulledOutPhaser },
+ { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::tug1KirkFinishedFiringPhaser },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::tug1TalkToSpock },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::tug1UseSTricorderOnJunkPile },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::tug1LookAtJunkPile },
+ { Action(ACTION_GET, 8, 0, 0), &Room::tug1GetJunkPile },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::tug1KirkReachedJunkPile },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::tug1KirkFinishedTakingJunkPile },
+ { Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_IPWE, 0), &Room::tug1UsePhaserOnWelder },
+ { Action(ACTION_USE, OBJECT_IPHASERK, OBJECT_IPWE, 0), &Room::tug1UsePhaserOnWelder },
+ { Action(ACTION_USE, OBJECT_IPWF, OBJECT_IWIRSCRP, 0), &Room::tug1UseWelderOnWireScraps },
+ { Action(ACTION_USE, OBJECT_IPWF, OBJECT_IJNKMETL, 0), &Room::tug1UseWelderOnMetalScraps },
+ { Action(ACTION_USE, OBJECT_ICOMBBIT, OBJECT_IRT, 0), &Room::tug1UseCombBitOnTransmogrifier },
+ { Action(ACTION_USE, OBJECT_IPWF, 0x22, 0), &Room::tug1UsePhaserWelderOnBridgeDoor },
+ { Action(ACTION_USE, OBJECT_IPWF, 0x21, 0), &Room::tug1UsePhaserWelderOnBridgeDoor },
+ { Action(ACTION_USE, OBJECT_IPWF, 0x20, 0), &Room::tug1UsePhaserWelderOnBridgeDoorInLeftSpot },
+ { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::tug1KirkReachedBridgeDoorWithWelder },
+ { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::tug1KirkFinishedUsingWelder },
+ { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::tug1KirkReachedBridgeDoorWithWelderInLeftSpot },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::tug1KirkFinishedUsingWelderInLeftSpot },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::tug1LookAnywhere },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::tug1LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::tug1LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::tug1LookAtRedshirt },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::tug1TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::tug1TalkToRedshirt },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::tug1LookAtTerminal },
+ { Action(ACTION_LOOK, 0x24, 0, 0), &Room::tug1LookAtDebris },
+ { Action(ACTION_LOOK, 0x25, 0, 0), &Room::tug1LookAtBrigDoor },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x25, 0), &Room::tug1UseSTricorderOnBrigDoor },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::tug1TalkToKirk },
+ { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::tug1UseCommunicator },
+ { Action(ACTION_WALK, 0x21, 0, 0), &Room::tug1WalkToBridgeDoor },
+ { Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::tug1KirkReachedBridgeDoor },
+ { Action(ACTION_FINISHED_ANIMATION, 11, 0, 0), &Room::tug1BridgeDoorOpened },
+ { Action(ACTION_WALK, 0x25, 0, 0), &Room::tug1WalkToBrigDoor },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::tug1UseMTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::tug1UseMTricorderOnBridgeDoor },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0x20, 0), &Room::tug1UseMTricorderOnBridgeDoor },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0x22, 0), &Room::tug1UseMTricorderOnBridgeDoor },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0x25, 0), &Room::tug1UseMTricorderOnBrigDoor },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::tug1UseSpockOnBridgeDoor },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x21, 0), &Room::tug1UseSpockOnBridgeDoor },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x22, 0), &Room::tug1UseSpockOnBridgeDoor },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::tug1UseRedshirtOnBridgeDoor },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x21, 0), &Room::tug1UseRedshirtOnBridgeDoor },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x22, 0), &Room::tug1UseRedshirtOnBridgeDoor },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 0x20, 0), &Room::tug1UseMedkitOnBridgeDoor },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 0x21, 0), &Room::tug1UseMedkitOnBridgeDoor },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 0x22, 0), &Room::tug1UseMedkitOnBridgeDoor },
+
+};
+
}
#endif
diff --git a/engines/startrek/rooms/tug0.cpp b/engines/startrek/rooms/tug0.cpp
index 016bbbb..e90544d 100644
--- a/engines/startrek/rooms/tug0.cpp
+++ b/engines/startrek/rooms/tug0.cpp
@@ -212,6 +212,10 @@ void Room::tug0UsePhaserOnWelder() {
loseItem(OBJECT_IPWE);
giveItem(OBJECT_IPWF);
showText(TX_TUG0N006);
+
+ // BUGFIX: this following line didn't exist, despite it existing in TUG1; meaning this
+ // was supposed to give points, but it only did in a specific room.
+ _vm->_awayMission.tug.missionScore += 3;
}
void Room::tug0UseWelderOnWireScraps() {
diff --git a/engines/startrek/rooms/tug1.cpp b/engines/startrek/rooms/tug1.cpp
new file mode 100644
index 0000000..467d496
--- /dev/null
+++ b/engines/startrek/rooms/tug1.cpp
@@ -0,0 +1,311 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+#define OBJECT_JUNKPILE 8
+#define OBJECT_PHASERSHOT 9
+
+#define HOTSPOT_BRIDGEDOOR 0x21
+#define HOTSPOT_BRIDGEARCH 0x22
+#define HOTSPOT_TERMINAL 0x23
+#define HOTSPOT_DEBRIS 0x24
+#define HOTSPOT_BRIGDOOR 0x25
+
+void Room::tug1Tick1() {
+ playVoc("TUG1LOOP");
+
+ if (!_vm->_awayMission.tug.gotJunkPile)
+ loadActorAnim2(OBJECT_JUNKPILE, "jnkpil", 0xfd, 0xa0, 0);
+}
+
+void Room::tug1UseSTricorderOnAnything() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_SPEAKER_SPOCK, TX_TUG1_014);
+
+ // NOTE: this action has a second implementation (which is never called). It displayed
+ // TX_TUG1_006. Was this meant to be displayed after the force field is down?
+}
+
+void Room::tug1LookAtBridgeDoor() {
+ if (_vm->_awayMission.tug.forceFieldDown)
+ return;
+ showText(TX_TUG1N005);
+}
+
+void Room::tug1UseSTricorderOnBridgeDoor() {
+ if (_vm->_awayMission.tug.forceFieldDown)
+ return;
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_SPEAKER_SPOCK, TX_TUG1_002);
+}
+
+void Room::tug1UsePhaserOnBridgeDoor() {
+ if (_vm->_awayMission.tug.forceFieldDown)
+ showText(TX_TUG1N007);
+ else {
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ walkCrewman(OBJECT_KIRK, 0xbe, 0x78, 3);
+ }
+}
+
+void Room::tug1KirkReachedFiringPosition() {
+ loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 4);
+}
+
+void Room::tug1KirkPulledOutPhaser() {
+ loadActorAnim2(OBJECT_PHASERSHOT, "t1phas", 0, 0, 5);
+ playSoundEffectIndex(SND_PHASSHOT);
+}
+
+void Room::tug1KirkFinishedFiringPhaser() {
+ _vm->_awayMission.disableInput = false;
+ loadActorStandAnim(OBJECT_KIRK);
+ loadActorStandAnim(OBJECT_PHASERSHOT);
+}
+
+void Room::tug1TalkToSpock() {
+ if (!_vm->_awayMission.tug.forceFieldDown)
+ showText(TX_SPEAKER_SPOCK, TX_TUG1_010);
+}
+
+void Room::tug1UseSTricorderOnJunkPile() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_SPEAKER_SPOCK, TX_TUG1_009);
+}
+
+void Room::tug1LookAtJunkPile() {
+ showText(TX_TUG1N000);
+}
+
+void Room::tug1GetJunkPile() {
+ walkCrewman(OBJECT_KIRK, 0xe1, 0xaa, 1);
+}
+
+void Room::tug1KirkReachedJunkPile() {
+ loadActorAnim2(OBJECT_KIRK, "kpicke", 0xe1, 0xaa, 2);
+}
+
+void Room::tug1KirkFinishedTakingJunkPile() {
+ _vm->_awayMission.tug.gotJunkPile = true;
+ giveItem(OBJECT_IDEADPH);
+ giveItem(OBJECT_IPWE);
+ _vm->_awayMission.tug.missionScore++;
+ giveItem(OBJECT_IWIRSCRP);
+ giveItem(OBJECT_IJNKMETL);
+
+ loadActorStandAnim(OBJECT_JUNKPILE);
+ loadActorStandAnim(OBJECT_KIRK);
+}
+
+void Room::tug1UsePhaserOnWelder() {
+ loseItem(OBJECT_IPWE);
+ giveItem(OBJECT_IPWF);
+ showText(TX_TUG1N004);
+
+ _vm->_awayMission.tug.missionScore += 3;
+}
+
+void Room::tug1UseWelderOnWireScraps() {
+ showText(TX_TUG1N009);
+ loseItem(OBJECT_IWIRSCRP);
+}
+
+void Room::tug1UseWelderOnMetalScraps() {
+ showText(TX_SPEAKER_SPOCK, TX_TUG1_012);
+ loseItem(OBJECT_IJNKMETL);
+ giveItem(OBJECT_ICOMBBIT);
+}
+
+void Room::tug1UseCombBitOnTransmogrifier() {
+ showText(TX_SPEAKER_SPOCK, TX_TUG1_017);
+ loseItem(OBJECT_ICOMBBIT);
+ loseItem(OBJECT_IRT);
+ giveItem(OBJECT_IRTWB);
+}
+
+void Room::tug1UsePhaserWelderOnBridgeDoor() {
+ if (_vm->_awayMission.tug.forceFieldDown)
+ showText(TX_TUG1N008);
+ else {
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ walkCrewman(OBJECT_KIRK, 0xc2, 0x6a, 6);
+ }
+}
+
+void Room::tug1UsePhaserWelderOnBridgeDoorInLeftSpot() {
+ if (_vm->_awayMission.tug.forceFieldDown)
+ showText(TX_TUG1N007);
+ else {
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ walkCrewman(OBJECT_KIRK, 0xb1, 0x6a, 8);
+ }
+}
+
+void Room::tug1KirkReachedBridgeDoorWithWelder() {
+ playVoc("MUR4E9S");
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 0);
+ loadActorAnim2(OBJECT_PHASERSHOT, "t1weld", 0, 0, 7);
+}
+
+void Room::tug1KirkFinishedUsingWelder() {
+ loadActorStandAnim(OBJECT_PHASERSHOT);
+ showText(TX_SPEAKER_SPOCK, TX_TUG1_016);
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::tug1KirkReachedBridgeDoorWithWelderInLeftSpot() {
+ playVoc("MUR4E9S");
+ loadActorAnim2(OBJECT_KIRK, "kuseln", -1, -1, 0);
+ loadActorAnim2(OBJECT_PHASERSHOT, "t1weld", 0, 0, 9);
+}
+
+void Room::tug1KirkFinishedUsingWelderInLeftSpot() {
+ loadActorStandAnim(OBJECT_PHASERSHOT);
+ showText(TX_SPEAKER_SPOCK, TX_TUG1_015);
+ _vm->_awayMission.tug.forceFieldDown = true;
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.tug.missionScore++;
+}
+
+void Room::tug1LookAnywhere() {
+ showText(TX_TUG1N013);
+}
+
+void Room::tug1LookAtMccoy() {
+ showText(TX_TUG1N003);
+}
+
+void Room::tug1LookAtSpock() {
+ showText(TX_TUG1N006);
+}
+
+void Room::tug1LookAtRedshirt() {
+ showText(TX_TUG1N002);
+}
+
+void Room::tug1TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN3_012); // NOTE: uses "SIN3" text?
+}
+
+void Room::tug1TalkToRedshirt() {
+ showText(TX_SPEAKER_CHRISTENSEN, TX_TUG1L005);
+}
+
+void Room::tug1LookAtTerminal() {
+ showText(TX_TUG1N010);
+}
+
+void Room::tug1LookAtDebris() {
+ showText(TX_TUG1N011);
+}
+
+void Room::tug1LookAtBrigDoor() {
+ showText(TX_TUG1N001);
+}
+
+void Room::tug1UseSTricorderOnBrigDoor() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_SPEAKER_SPOCK, TX_TUG1_018);
+}
+
+void Room::tug1TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_TUG1_001);
+ showText(TX_SPEAKER_MCCOY, TX_TUG1_008);
+}
+
+// FIXME: not working
+void Room::tug1UseCommunicator() {
+ showText(TX_SPEAKER_SPOCK, TX_TUG1_011);
+}
+
+void Room::tug1WalkToBridgeDoor() {
+ if (!_vm->_awayMission.tug.forceFieldDown)
+ return;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ walkCrewman(OBJECT_KIRK, 0xc2, 0x6e, 10);
+}
+
+void Room::tug1KirkReachedBridgeDoor() {
+ _vm->_awayMission.disableInput = true;
+ loadActorAnim2(OBJECT_PHASERSHOT, "h1do", 0, 0, 11);
+}
+
+void Room::tug1BridgeDoorOpened() {
+ walkCrewman(OBJECT_KIRK, 0xc2, 0x63, 0);
+}
+
+void Room::tug1WalkToBrigDoor() {
+ walkCrewman(OBJECT_KIRK, 0xe9, 0x81, 0);
+}
+
+void Room::tug1UseMTricorderAnywhere() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_SPEAKER_MCCOY, TX_TUG1_003);
+}
+
+void Room::tug1UseMTricorderOnBridgeDoor() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_SPEAKER_MCCOY, TX_TUG1_007);
+}
+
+void Room::tug1UseMTricorderOnBrigDoor() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_SPEAKER_MCCOY, TX_TUG1_005);
+}
+
+void Room::tug1UseSpockOnBridgeDoor() {
+ if (!_vm->_awayMission.tug.forceFieldDown)
+ showText(TX_SPEAKER_SPOCK, TX_TUG1_013);
+}
+
+void Room::tug1UseRedshirtOnBridgeDoor() {
+ if (!_vm->_awayMission.tug.forceFieldDown)
+ showText(TX_SPEAKER_CHRISTENSEN, TX_TUG1L000);
+}
+
+void Room::tug1UseMedkitOnBridgeDoor() {
+ if (!_vm->_awayMission.tug.forceFieldDown)
+ showText(TX_SPEAKER_MCCOY, TX_TUG1_004);
+}
+
+}
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index dba4bab..2dc686a 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -533,6 +533,42 @@ enum GameStringIDs {
TX_TUG0N014,
+ TX_SIN3_012,
+ TX_TUG1_001,
+ TX_TUG1_002,
+ TX_TUG1_003,
+ TX_TUG1_004,
+ TX_TUG1_005,
+ TX_TUG1_006,
+ TX_TUG1_007,
+ TX_TUG1_008,
+ TX_TUG1_009,
+ TX_TUG1_010,
+ TX_TUG1_011,
+ TX_TUG1_012,
+ TX_TUG1_013,
+ TX_TUG1_014,
+ TX_TUG1_015,
+ TX_TUG1_016,
+ TX_TUG1_017,
+ TX_TUG1_018,
+ TX_TUG1L000,
+ TX_TUG1L005,
+ TX_TUG1N000,
+ TX_TUG1N001,
+ TX_TUG1N002,
+ TX_TUG1N003,
+ TX_TUG1N004,
+ TX_TUG1N005,
+ TX_TUG1N006,
+ TX_TUG1N007,
+ TX_TUG1N008,
+ TX_TUG1N009,
+ TX_TUG1N010,
+ TX_TUG1N011,
+ TX_TUG1N013,
+
+
TX_END
};
@@ -1042,6 +1078,42 @@ const char * const g_gameStrings[] = {
"#TUG0\\TUG0N012#These transporter controls are now operational. They are set for just inside the bridge door.",
"#TUG0\\TUG0N013#This is the main transporter pad of the Masada.",
"#TUG0\\TUG0N014#This man was obviously the transporter engineer. He is unconscious, but alive.",
+
+
+ "#SIN3\\SIN3_012#Can't say I like the decor.", // FIXME
+ "#TUG1\\TUG1_001#This is a mess now, isn't it?",
+ "#TUG1\\TUG1_002#A forcefield of unusual configurations has been erected in front of the doorway which leads into the bridge. I don't think it would be healthy to approach too closely, Captain.",
+ "#TUG1\\TUG1_003#I'm getting life readings both on the bridge and in the brig, Jim.",
+ "#TUG1\\TUG1_004#Jim, I can only perform medical miracles not engineering ones.",
+ "#TUG1\\TUG1_005#Jim, I'm picking up 11 life forms in the brig. That accounts for over half the crew. I don't like what that indicates.",
+ "#TUG1\\TUG1_006#Nothing unusual is detected.",
+ "#TUG1\\TUG1_007#The force field is interfering too much to get an accurate reading, Jim",
+ "#TUG1\\TUG1_008#My daddy would have sent me to bed without supper if I'd done something like this.",
+ "#TUG1\\TUG1_009#Five phasers without power packs, a drained phaser welder, insulation and bits of wire, and droplets of cooled molten metal.",
+ "#TUG1\\TUG1_010#I don't think we can bring down that forcefield, Captain. If we could, though, it might be less risky than trying to transport onto the bridge.",
+ "#TUG1\\TUG1_011#I strongly recommend that we keep our silence, Captain. The Elasi are quite capable of tracing any communication from within this vessel.",
+ "#TUG1\\TUG1_012#I think that does it -- a Comb Bit for the transmogrifier. Now I can continue repairs on the transporter controls. ",
+ "#TUG1\\TUG1_013#If we could find a point to interrupt the flow of power to the field we could gain access to the bridge, Captain.",
+ "#TUG1\\TUG1_014#Strong electromagnetic readings come from the doorway at the far end of the hallway.",
+ "#TUG1\\TUG1_015#That did it. The field is deactivated, Captain.",
+ "#TUG1\\TUG1_016#The field is absorbing the energy.",
+ "#TUG1\\TUG1_017#he parts fit together satisfactorily.",
+ "#TUG1\\TUG1_018#Tricorder readings indicate an indeterminate number of people in the brig. At least 2 are armed with phasers. I recommend caution when entering.",
+ "#TUG1\\TUG1L000#I doubt that our phasers could get through that, Captain.",
+ "#TUG1\\TUG1L005#This corridor provides access to the transporter room, Captain. It is secure.",
+ "#TUG1\\TUG1N000#A tangle of mangled equipment, reduced to junk. There are the remains of five phasers without power packs, a drained phaser welder, and scraps of wire and uncertain bits of metal junk.",
+ "#TUG1\\TUG1N001#According to the deckplans of this class of Starship, this is the entrance to the ship's brig.",
+ "#TUG1\\TUG1N002#Lt. Christensen is carefully watching the hallway",
+ "#TUG1\\TUG1N003#McCoy is fidgeting around.",
+ "#TUG1\\TUG1N004#Phaser Welder is now charged.",
+ "#TUG1\\TUG1N005#Some kind of forcefield appears to cover the door. ",
+ "#TUG1\\TUG1N006#Spock is analyzing the surroundings.",
+ "#TUG1\\TUG1N007#The field has already been deactivated.",
+ "#TUG1\\TUG1N008#The field has already been deactivated",
+ "#TUG1\\TUG1N009#The wire scraps are too small, they melt instead of fusing together, and you're left with nothing. ",
+ "#TUG1\\TUG1N010#This viewscreen/ communication terminal has been damaged beyond repair.",
+ "#TUG1\\TUG1N011#Twisted debris has been scattered along the side of the corridor.",
+ "#TUG1\\TUG1N013#You are in a typical starship corridor.",
};
}
Commit: 41997ebc20a9d1de7225e589bad5472de5c9c132
https://github.com/scummvm/scummvm/commit/41997ebc20a9d1de7225e589bad5472de5c9c132
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Default text for undefined actions
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 4a604b9..55ede50 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -37,11 +37,11 @@ void StarTrekEngine::initAwayMission() {
// sub_23a60(); // TODO
_sound->loadMusicFile("ground");
- loadRoom(_missionToLoad, _roomIndexToLoad);
+ loadRoom(_missionToLoad, 1); // FIXME
_roomIndexToLoad = -1;
// Load crew positions for beaming in
- initAwayCrewPositions(4);
+ initAwayCrewPositions(1);
}
void StarTrekEngine::runAwayMission() {
@@ -432,40 +432,133 @@ void StarTrekEngine::handleAwayMissionAction() {
}
break;
- case ACTION_USE: // TODO
- warning("Unhandled use action: %d %d %d", action.b1, action.b2, action.b3);
+ case ACTION_USE:
+ if (action.activeObject() != action.passiveObject()) {
+ switch (action.activeObject()) {
+ case OBJECT_KIRK:
+ if (!_room->handleAction(ACTION_WALK, action.passiveObject(), 0, 0)
+ && !_room->handleAction(ACTION_GET, action.passiveObject(), 0, 0)) {
+ showTextbox("Capt. Kirk", getLoadedText(GROUNDTX_KIRK_USE), 20, 20, TEXTCOLOR_YELLOW, 0);
+ }
+ break;
+
+ case OBJECT_SPOCK:
+ if (!_room->handleAction(ACTION_USE, OBJECT_ISTRICOR, action.passiveObject(), 0)) {
+ // BUGFIX: Original game has just "Spock" instead of "Mr. Spock" as the
+ // speaker. That's inconsistent.
+ // Same applies to other parts of this function.
+ showTextbox("Mr. Spock", getLoadedText(GROUNDTX_SPOCK_USE), 20, 20, TEXTCOLOR_BLUE, 0);
+ }
+ break;
+
+ case OBJECT_MCCOY:
+ if (!_room->handleAction(ACTION_USE, OBJECT_IMEDKIT, action.passiveObject(), 0)
+ && !_room->handleAction(ACTION_USE, OBJECT_IMTRICOR, action.passiveObject(), 0)) {
+ // BUGFIX: Original game has just "McCoy" instead of "Dr. McCoy".
+ showTextbox("Dr. McCoy", getLoadedText(GROUNDTX_MCCOY_USE), 20, 20, TEXTCOLOR_BLUE, 0);
+ }
+ break;
+
+ case OBJECT_REDSHIRT:
+ showTextbox(nullptr, getLoadedText(GROUNDTX_REDSHIRT_USE), 20, 20, TEXTCOLOR_YELLOW, 0);
+ break;
+
+ case OBJECT_IPHASERS:
+ case OBJECT_IPHASERK:
+ if (action.passiveObject() == OBJECT_SPOCK) {
+ int text = GROUNDTX_PHASER_ON_SPOCK + getRandomWord() % 8;
+ showTextbox("Dr. McCoy", getLoadedText(text), 20, 20, TEXTCOLOR_BLUE, 0);
+ }
+ else if (action.passiveObject() == OBJECT_MCCOY) {
+ int text = GROUNDTX_PHASER_ON_MCCOY + getRandomWord() % 8;
+ showTextbox("Mr. Spock", getLoadedText(text), 20, 20, TEXTCOLOR_BLUE, 0);
+ }
+ else if (action.passiveObject() == OBJECT_REDSHIRT) {
+ Common::String text = getLoadedText(GROUNDTX_PHASER_ON_REDSHIRT + getRandomWord() % 8);
+ // Replace audio filename with start of mission name (to load the
+ // audio for the crewman specific to the mission))
+ text.setChar(_missionName[0], 6);
+ text.setChar(_missionName[1], 7);
+ text.setChar(_missionName[2], 8);
+ showTextbox("Security Officer", text, 20, 20, TEXTCOLOR_RED, 0);
+ // TODO: replace "Security Officer" string with their actual name as
+ // an enhancement?
+ }
+ else if (!_room->handleActionWithBitmask(action)) {
+ int index = getRandomWord() % 7;
+ if (index & 1)
+ showTextbox("Dr. McCoy", getLoadedText(GROUNDTX_PHASER_ANYWHERE + index), 20, 20, TEXTCOLOR_BLUE, 0);
+ else
+ showTextbox("Mr. Spock", getLoadedText(GROUNDTX_PHASER_ANYWHERE + index), 20, 20, TEXTCOLOR_BLUE, 0);
+ }
+ break;
+
+ case OBJECT_ISTRICOR:
+ showTextbox("Mr. Spock", getLoadedText(GROUNDTX_SPOCK_SCAN), 20, 20, TEXTCOLOR_BLUE, 0);
+ break;
+
+ case OBJECT_IMTRICOR:
+ showTextbox("Dr. McCoy", getLoadedText(GROUNDTX_MCCOY_SCAN), 20, 20, TEXTCOLOR_BLUE, 0);
+ break;
+
+ case OBJECT_ICOMM:
+ if (!_room->handleAction(ACTION_USE, OBJECT_ICOMM, -1, 0))
+ showTextbox("Lt. Uhura", getLoadedText(GROUNDTX_USE_COMMUNICATOR), 20, 20, TEXTCOLOR_RED, 0);
+ break;
+
+ case OBJECT_IMEDKIT:
+ showTextbox("Dr. McCoy", getLoadedText(GROUNDTX_USE_MEDKIT), 20, 20, TEXTCOLOR_BLUE, 0);
+ break;
+
+ default:
+ if (!_room->handleActionWithBitmask(action.type, action.b1, action.b2, action.b3))
+ showTextbox("", getLoadedText(GROUNDTX_NOTHING_HAPPENS), 20, 20, TEXTCOLOR_YELLOW, 0);
+ }
+ }
break;
- case ACTION_GET: // TODO
- warning("Unhandled get action: %d %d %d", action.b1, action.b2, action.b3);
+ case ACTION_GET:
+ if (!_room->handleActionWithBitmask(action.type, action.b1, action.b2, action.b3))
+ showTextbox("", getLoadedText(GROUNDTX_FAIL_TO_OBTAIN_ANYTHING), 20, 20, TEXTCOLOR_YELLOW, 0);
break;
case ACTION_LOOK:
if (action.activeObject() >= ITEMS_START && action.activeObject() < ITEMS_END) {
int i = action.activeObject() - ITEMS_START;
- Common::String text = getItemDescription(_itemList[i].textIndex);
+ Common::String text = getLoadedText(_itemList[i].textIndex);
showTextbox("", text, 20, 20, TEXTCOLOR_YELLOW, 0);
}
else if (action.activeObject() == OBJECT_KIRK)
- showTextbox("", getItemDescription(0x49), 20, 20, TEXTCOLOR_YELLOW, 0);
+ showTextbox("", getLoadedText(GROUNDTX_LOOK_KIRK), 20, 20, TEXTCOLOR_YELLOW, 0);
else if (action.activeObject() == OBJECT_SPOCK)
- showTextbox("", getItemDescription(0x4a), 20, 20, TEXTCOLOR_YELLOW, 0);
+ showTextbox("", getLoadedText(GROUNDTX_LOOK_SPOCK), 20, 20, TEXTCOLOR_YELLOW, 0);
else if (action.activeObject() == OBJECT_MCCOY)
- showTextbox("", getItemDescription(0x4b), 20, 20, TEXTCOLOR_YELLOW, 0);
+ showTextbox("", getLoadedText(GROUNDTX_LOOK_MCCOY), 20, 20, TEXTCOLOR_YELLOW, 0);
else {
if (action.activeObject() == OBJECT_REDSHIRT)
- showTextbox("", getItemDescription(0x4c), 20, 20, TEXTCOLOR_YELLOW, 0);
+ showTextbox("", getLoadedText(GROUNDTX_LOOK_REDSHIRT), 20, 20, TEXTCOLOR_YELLOW, 0);
// Show generic "nothing of note" text.
// BUG? This text is also shown after looking at the redshirt. However, his
// text is normally overridden on a per-mission basis, so perhaps this bug
// never manifests itself?
- showTextbox("", getItemDescription(0x4d), 20, 20, TEXTCOLOR_YELLOW, 0);
+ showTextbox("", getLoadedText(GROUNDTX_LOOK_ANYWHERE), 20, 20, TEXTCOLOR_YELLOW, 0);
}
break;
- case ACTION_TALK: // TODO
- warning("Unhandled talk action: %d %d %d", action.b1, action.b2, action.b3);
+ case ACTION_TALK:
+ switch (action.activeObject()) {
+ case OBJECT_KIRK:
+ case OBJECT_SPOCK:
+ case OBJECT_MCCOY:
+ case OBJECT_REDSHIRT:
+ showTextbox("", getLoadedText(GROUNDTX_TALK_TO_CREWMAN), 20, 20, TEXTCOLOR_YELLOW, 0);
+ break;
+
+ default:
+ showTextbox("", getLoadedText(GROUNDTX_NO_RESPONSE), 20, 20, TEXTCOLOR_YELLOW, 0);
+ break;
+ }
break;
case ACTION_TOUCHED_WARP:
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 4f960fb..8e1de88 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -122,7 +122,7 @@ bool Room::handleActionWithBitmask(const Action &action) {
int n = _numRoomActions;
while (n-- > 0) {
- uint32 bitmask = action.getBitmask();
+ uint32 bitmask = roomActionPtr->action.getBitmask();
if ((action.toUint32() & bitmask) == (roomActionPtr->action.toUint32() & bitmask)) {
_vm->_awayMission.rdfStillDoDefaultAction = false;
(this->*(roomActionPtr->funcPtr))();
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 943ed90..e3b2cf6 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -69,9 +69,11 @@ public:
// That code is instead rewritten on a per-room basis.
bool actionHasCode(const Action &action);
bool handleAction(const Action &action);
+ bool handleAction(byte type, byte b1, byte b2, byte b3) { return handleAction(Action(type, b1, b2, b3)); };
// Same as above, but if any byte in the action is -1 (0xff), it matches any value.
bool handleActionWithBitmask(const Action &action);
+ bool handleActionWithBitmask(byte type, byte b1, byte b2, byte b3) { return handleActionWithBitmask(Action(type, b1, b2, b3)); };
uint16 getFirstHotspot() { return readRdfWord(0x12); }
uint16 getHotspotEnd() { return readRdfWord(0x14); }
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 7e9f9bb..c623c1b 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -1851,7 +1851,7 @@ uint16 StarTrekEngine::getRandomWord() {
* ".txt" files are just lists of strings. This traverses the file to get a particular
* string index.
*/
-Common::String StarTrekEngine::getItemDescription(int itemIndex) {
+Common::String StarTrekEngine::getLoadedText(int itemIndex) {
SharedPtr<FileStream> txtFile = loadFile(_txtFilename + ".txt");
byte *data = txtFile->_data;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index cf678eb..ee741eb 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -395,7 +395,7 @@ public:
// Misc
uint16 getRandomWord();
- Common::String getItemDescription(int itemIndex);
+ Common::String getLoadedText(int itemIndex);
public:
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 2dc686a..cf949b2 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -25,6 +25,37 @@
namespace StarTrek {
+// Text that's loaded from "GROUND.TXT". First 0x40 pieces of text are for items.
+enum GroundTextIDs {
+ // Generic "perform undefined action" text (ie. look at nothing, talk to wall)
+ GROUNDTX_LOOK_KIRK = 0x49,
+ GROUNDTX_LOOK_SPOCK = 0x4a,
+ GROUNDTX_LOOK_MCCOY = 0x4b,
+ GROUNDTX_LOOK_REDSHIRT = 0x4c,
+ GROUNDTX_LOOK_ANYWHERE = 0x4d,
+ GROUNDTX_TALK_TO_CREWMAN = 0x4e,
+ GROUNDTX_NO_RESPONSE = 0x4f,
+
+ GROUNDTX_KIRK_USE = 0x50,
+ GROUNDTX_SPOCK_USE = 0x51,
+ GROUNDTX_MCCOY_USE = 0x52,
+ GROUNDTX_REDSHIRT_USE = 0x53,
+ GROUNDTX_SPOCK_SCAN = 0x54,
+ GROUNDTX_MCCOY_SCAN = 0x55,
+ GROUNDTX_USE_MEDKIT = 0x56,
+
+ GROUNDTX_PHASER_ON_MCCOY = 0x57, // 8 variations
+ GROUNDTX_PHASER_ON_SPOCK = 0x5f, // 8 variations
+ GROUNDTX_PHASER_ON_REDSHIRT = 0x67, // 8 variations
+ GROUNDTX_PHASER_ANYWHERE = 0x6f, // 7 variations
+
+ GROUNDTX_USE_COMMUNICATOR = 0x76,
+ GROUNDTX_NOTHING_HAPPENS = 0x77,
+ GROUNDTX_FAIL_TO_OBTAIN_ANYTHING = 0x78
+};
+
+// Text that's hardcoded into "RDF" files, and copied into here for a sane referencing
+// scheme.
enum GameStringIDs {
TX_NULL,
TX_BLANK,
Commit: 487c3fda3252536fdd57e9db4020d23f20069aae
https://github.com/scummvm/scummvm/commit/487c3fda3252536fdd57e9db4020d23f20069aae
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: TUG2
Changed paths:
A engines/startrek/rooms/tug2.cpp
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/tug1.cpp
engines/startrek/sound.h
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 55ede50..585f789 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -37,11 +37,11 @@ void StarTrekEngine::initAwayMission() {
// sub_23a60(); // TODO
_sound->loadMusicFile("ground");
- loadRoom(_missionToLoad, 1); // FIXME
+ loadRoom(_missionToLoad, 2); // FIXME
_roomIndexToLoad = -1;
// Load crew positions for beaming in
- initAwayCrewPositions(1);
+ initAwayCrewPositions(3);
}
void StarTrekEngine::runAwayMission() {
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index d91ad46..aa581d8 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -51,7 +51,7 @@ struct AwayMission {
// Mission-specific variables
union {
- // Demon World
+ // Demon World (TODO: label remaining generic variables)
struct {
bool wasRudeToPrelate; // 0x29
bool insultedStephen; // 0x2b
@@ -101,13 +101,27 @@ struct AwayMission {
int16 field2b; // 0x2b
int16 field2d; // 0x2d;
bool engineerConscious; // 0x30
+ byte field35; // 0x35
+ bool gotWires; // 0x37
bool gotJunkPile; // 0x3f
bool gotTransmogrifier; // 0x43
bool transporterRepaired; // 0x44
bool spockExaminedTransporter; // 0x45
bool usedTransmogrifierOnTransporter; // 0x46
- bool forceFieldDown; // 0x47
+ bool bridgeForceFieldDown; // 0x47
+ bool savedPrisoners; // 0x48
bool haveBomb; // 0x49
+ bool field4a; // 0x4a
+ byte field4b; // 0x4b
+ byte guard1Status; // 0x4c
+ byte guard2Status; // 0x4d
+ byte field4e; // 0x4e
+ bool crewmanKilled[4]; // 0x4f
+ bool brigForceFieldDown; // 0x58
+ byte field59; // 0x59
+ byte field5b; // 0x5b
+ byte kirkPhaserDrawn; // 0x5d
+ bool talkedToBrigCrewman; // 0x5f
} tug;
};
};
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index fd3f80a..b3fed14 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -28,6 +28,7 @@ MODULE_OBJS = \
rooms/demon6.o \
rooms/tug0.o \
rooms/tug1.o \
+ rooms/tug2.o \
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 8e1de88..cc07488 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -73,6 +73,10 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_roomActionList = tug1ActionList;
_numRoomActions = sizeof(tug1ActionList) / sizeof(RoomAction);
}
+ else if (name == "TUG2") {
+ _roomActionList = tug2ActionList;
+ _numRoomActions = sizeof(tug2ActionList) / sizeof(RoomAction);
+ }
else {
warning("Room \"%s\" unimplemented", name.c_str());
_numRoomActions = 0;
@@ -289,6 +293,32 @@ void Room::loadMapFile(const Common::String &name) {
_vm->_mapFile = _vm->loadFile(name + ".map");
}
+void Room::showBitmapFor5Ticks(const Common::String &bmpName, int priority) {
+ if (priority < 0 || priority > 15)
+ priority = 5;
+
+ Sprite sprite;
+ _vm->_gfx->addSprite(&sprite);
+ sprite.setXYAndPriority(0, 0, priority);
+ sprite.setBitmap(_vm->_gfx->loadBitmap(bmpName));
+
+ _vm->_gfx->drawAllSprites();
+
+ TrekEvent event;
+ int ticks = 0;
+
+ while (ticks < 5) {
+ while (!_vm->popNextEvent(&event));
+
+ if (event.type == TREKEVENT_TICK)
+ ticks++;
+ }
+
+ sprite.dontDrawNextFrame();
+ _vm->_gfx->drawAllSprites();
+ _vm->_gfx->delSprite(&sprite);
+}
+
Common::Point Room::getActorPos(int actorIndex) {
return _vm->_actorList[actorIndex].pos;
}
@@ -334,4 +364,26 @@ void Room::playVoc(Common::String filename) {
_vm->_sound->playVoc(filename);
}
+void Room::spockScan(int direction, int text) {
+ const char *dirs = "nsew";
+ Common::String anim = "sscan_";
+ anim.setChar(dirs[direction], 5);
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = direction;
+ loadActorAnim2(OBJECT_SPOCK, anim, -1, -1, 0);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_SPEAKER_SPOCK, text);
+}
+
+void Room::mccoyScan(int direction, int text) {
+ const char *dirs = "nsew";
+ Common::String anim = "mscan_";
+ anim.setChar(dirs[direction], 5);
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = direction;
+ loadActorAnim2(OBJECT_MCCOY, anim, -1, -1, 0);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_SPEAKER_MCCOY, text);
+}
+
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index e3b2cf6..1523f33 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -110,6 +110,7 @@ private:
void loseItem(int item); // Cmd 0x07
void walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam);// Cmd 0x08
void loadMapFile(const Common::String &name); // Cmd 0x09
+ void showBitmapFor5Ticks(const Common::String &bmpName, int priority); // Cmd 0x0a
// Command 0x0c: "demon6ShowCase"
Common::Point getActorPos(int actorIndex); // Cmd 0x0d
void playSoundEffectIndex(int soundEffect); // Cmd 0x0f
@@ -118,6 +119,10 @@ private:
void showGameOverMenu(); // Cmd 0x12
void playVoc(Common::String filename); // Cmd 0x15
+ // Helper functions for repetitive stuff
+ void spockScan(int direction, int text);
+ void mccoyScan(int direction, int text);
+
// Room-specific code
public:
// DEMON0
@@ -585,6 +590,88 @@ public:
void tug1UseRedshirtOnBridgeDoor();
void tug1UseMedkitOnBridgeDoor();
+ // TUG2
+ void tug2Tick1();
+ void tug2Tick60();
+ void tug2LookAtButton();
+ void tug2LookAtMccoy();
+ void tug2LookAtSpock();
+ void tug2LookAtRedshirt();
+ void tug2GetBomb();
+ void tug2KirkReachedBomb();
+ void tug2KirkGotBomb();
+ void tug2LookAtBomb();
+ void tug2LookAtGuard1();
+ void tug2LookAtGuard2();
+ void tug2LookAtWires();
+ void tug2UseSTricorderOnButton();
+ void tug2UseMccoyOnWires();
+ void tug2UseMccoyOnBomb();
+ void tug2UseRedshirtOnWires();
+ void tug2RedshirtReachedWires();
+ void tug2RedshirtDefusedBomb();
+ void tug2RedshirtReturnedToPosition();
+ void tug2UseKirkOnWires();
+ void tug2KirkReachedWires();
+ void tug2UseSpockOnWires();
+ void tug2SpockReachedWires();
+ void tug2SpockReturnedToPosition();
+ void tug2GetWires();
+ void tug2KirkReachedWiresToGet();
+ void tug2KirkGotWires();
+ void tug2UseKirkOnButton();
+ void tug2KirkReachedButton();
+ void tug2UseSpockOnButton();
+ void tug2SpockReachedButton();
+ void tug2UseMccoyOnButton();
+ void tug2MccoyReachedButton();
+ void tug2UseRedshirtOnButton();
+ void tug2RedshirtReachedButton();
+ void tug2TurnedOffForceField();
+ void tug2PrisonersDead();
+ void tug2PrisonersReleased();
+ void tug2UsePhaserOnBrig();
+ void tug2ElasiReadyPhaser();
+ void tug2CheckEndFirefight();
+ void tug2UseStunPhaserOnGuard1();
+ void tug2KirkShootGuard1();
+ void tug2UseStunPhaserOnGuard2();
+ void tug2KirkShootGuard2();
+ void tug2UseKillPhaserOnGuard1();
+ void tug2KirkKillGuard1();
+ void tug2UseKillPhaserOnGuard2();
+ void tug2KirkKillGuard2();
+ void tug2UsePhaserOnWelder();
+ void tug2UseWelderOnWireScraps();
+ void tug2UseWelderOnMetalScraps();
+ void tug2UseCombBitOnTransmogrifier();
+ void tug2ShotByElasi();
+ void tug2WalkToDoor();
+ void tug2LookAtDoor();
+ void tug2LookAtKirk();
+ void tug2TalkToKirk();
+ void tug2TalkToMccoy();
+ void tug2TalkToRedshirt();
+ void tug2TalkToSpock();
+ void tug2UseCommunicator();
+ void tug2DetermineElasiShooter();
+ void tug2Timer0Expired();
+ void tug2GuardShootsCrewman();
+ void tug2Timer2Expired();
+ void tug2UseSTricorderOnBomb();
+ void tug2UseMTricorderOnGuard1();
+ void tug2UseMTricorderOnGuard2();
+ void tug2TalkToGuard1();
+ void tug2TalkToGuard2();
+ void tug2UseMedkitOnBomb();
+ void tug2UseMedkitOnGuard1();
+ void tug2UseMedkitOnGuard2();
+ void tug2LookAnywhere();
+ void tug2TalkToBrig();
+ void tug2UseMTricorderOnBrig();
+ void tug2UseMTricorderOnOpenBrig();
+ void tug2UsePhaserAnywhere();
+
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
@@ -641,6 +728,13 @@ private:
bool movingToDoor; // 0xcf
} demon6;
+ struct {
+ byte shootingObject; // 0x1ec1
+ byte shootingTarget;
+ bool elasiPhaserOnKill;
+ byte _1ec4; // 0x1ec4
+ } tug2;
+
} _roomVar;
};
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 7ea0139..a88214c 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -590,7 +590,6 @@ RoomAction tug0ActionList[] = {
};
-// TUG1
RoomAction tug1ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::tug1Tick1 },
{ Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::tug1UseSTricorderOnAnything },
@@ -607,11 +606,13 @@ RoomAction tug1ActionList[] = {
{ Action(ACTION_GET, 8, 0, 0), &Room::tug1GetJunkPile },
{ Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::tug1KirkReachedJunkPile },
{ Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::tug1KirkFinishedTakingJunkPile },
+
{ Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_IPWE, 0), &Room::tug1UsePhaserOnWelder },
{ Action(ACTION_USE, OBJECT_IPHASERK, OBJECT_IPWE, 0), &Room::tug1UsePhaserOnWelder },
{ Action(ACTION_USE, OBJECT_IPWF, OBJECT_IWIRSCRP, 0), &Room::tug1UseWelderOnWireScraps },
{ Action(ACTION_USE, OBJECT_IPWF, OBJECT_IJNKMETL, 0), &Room::tug1UseWelderOnMetalScraps },
{ Action(ACTION_USE, OBJECT_ICOMBBIT, OBJECT_IRT, 0), &Room::tug1UseCombBitOnTransmogrifier },
+
{ Action(ACTION_USE, OBJECT_IPWF, 0x22, 0), &Room::tug1UsePhaserWelderOnBridgeDoor },
{ Action(ACTION_USE, OBJECT_IPWF, 0x21, 0), &Room::tug1UsePhaserWelderOnBridgeDoor },
{ Action(ACTION_USE, OBJECT_IPWF, 0x20, 0), &Room::tug1UsePhaserWelderOnBridgeDoorInLeftSpot },
@@ -652,6 +653,98 @@ RoomAction tug1ActionList[] = {
};
+
+RoomAction tug2ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::tug2Tick1 },
+ { Action(ACTION_TICK, 60, 0, 0), &Room::tug2Tick60 },
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::tug2LookAtButton },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::tug2LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::tug2LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::tug2LookAtRedshirt },
+ { Action(ACTION_GET, 11, 0, 0), &Room::tug2GetBomb },
+ { Action(ACTION_FINISHED_WALKING, 12, 0, 0), &Room::tug2KirkReachedBomb },
+ { Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::tug2KirkGotBomb },
+ { Action(ACTION_LOOK, 11, 0, 0), &Room::tug2LookAtBomb },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::tug2LookAtGuard1 },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::tug2LookAtGuard2 },
+ { Action(ACTION_LOOK, 12, 0, 0), &Room::tug2LookAtWires },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 12, 0), &Room::tug2UseSTricorderOnButton },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::tug2UseSTricorderOnButton },
+ { Action(ACTION_USE, OBJECT_MCCOY, 12, 0), &Room::tug2UseMccoyOnWires },
+ { Action(ACTION_USE, OBJECT_MCCOY, 11, 0), &Room::tug2UseMccoyOnBomb },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 12, 0), &Room::tug2UseRedshirtOnWires },
+ { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::tug2RedshirtReachedWires },
+ { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::tug2RedshirtDefusedBomb },
+ { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::tug2RedshirtReturnedToPosition },
+ { Action(ACTION_USE, OBJECT_KIRK, 12, 0), &Room::tug2UseKirkOnWires },
+ { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::tug2KirkReachedWires },
+ { Action(ACTION_USE, OBJECT_SPOCK, 12, 0), &Room::tug2UseSpockOnWires },
+ { Action(ACTION_FINISHED_WALKING, 9, 0, 0), &Room::tug2SpockReachedWires },
+ { Action(ACTION_FINISHED_WALKING, 11, 0, 0), &Room::tug2SpockReturnedToPosition },
+ { Action(ACTION_GET, 12, 0, 0), &Room::tug2GetWires },
+ { Action(ACTION_FINISHED_WALKING, 28, 0, 0), &Room::tug2KirkReachedWiresToGet },
+ { Action(ACTION_FINISHED_ANIMATION, 29, 0, 0), &Room::tug2KirkGotWires },
+ { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::tug2UseKirkOnButton },
+ { Action(ACTION_FINISHED_WALKING, 14, 0, 0), &Room::tug2KirkReachedButton },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::tug2UseSpockOnButton },
+ { Action(ACTION_FINISHED_WALKING, 16, 0, 0), &Room::tug2SpockReachedButton },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::tug2UseMccoyOnButton },
+ { Action(ACTION_FINISHED_WALKING, 18, 0, 0), &Room::tug2MccoyReachedButton },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::tug2UseRedshirtOnButton },
+ { Action(ACTION_FINISHED_WALKING, 20, 0, 0), &Room::tug2RedshirtReachedButton },
+ { Action(ACTION_FINISHED_ANIMATION, 15, 0, 0), &Room::tug2TurnedOffForceField },
+ { Action(ACTION_FINISHED_ANIMATION, 17, 0, 0), &Room::tug2TurnedOffForceField },
+ { Action(ACTION_FINISHED_ANIMATION, 19, 0, 0), &Room::tug2TurnedOffForceField },
+ { Action(ACTION_FINISHED_ANIMATION, 21, 0, 0), &Room::tug2TurnedOffForceField },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::tug2PrisonersDead },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::tug2PrisonersReleased },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 10, 0), &Room::tug2UsePhaserOnBrig },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 10, 0), &Room::tug2UsePhaserOnBrig },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::tug2UseStunPhaserOnGuard1 },
+ { Action(ACTION_FINISHED_ANIMATION, 22, 0, 0), &Room::tug2KirkShootGuard1 },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 9, 0), &Room::tug2UseStunPhaserOnGuard2 },
+ { Action(ACTION_FINISHED_ANIMATION, 23, 0, 0), &Room::tug2KirkShootGuard2 },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::tug2UseKillPhaserOnGuard1 },
+ { Action(ACTION_FINISHED_ANIMATION, 24, 0, 0), &Room::tug2KirkKillGuard1 },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 9, 0), &Room::tug2UseKillPhaserOnGuard2 },
+ { Action(ACTION_FINISHED_ANIMATION, 25, 0, 0), &Room::tug2KirkKillGuard2 },
+
+ { Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_IPWE, 0), &Room::tug2UsePhaserOnWelder },
+ { Action(ACTION_USE, OBJECT_IPHASERK, OBJECT_IPWE, 0), &Room::tug2UsePhaserOnWelder },
+ { Action(ACTION_USE, OBJECT_IPWF, OBJECT_IWIRSCRP, 0), &Room::tug2UseWelderOnWireScraps },
+ { Action(ACTION_USE, OBJECT_IPWF, OBJECT_IJNKMETL, 0), &Room::tug2UseWelderOnMetalScraps },
+ { Action(ACTION_USE, OBJECT_ICOMBBIT, OBJECT_IRT, 0), &Room::tug2UseCombBitOnTransmogrifier },
+
+ { Action(ACTION_FINISHED_ANIMATION, 26, 0, 0), &Room::tug2ShotByElasi },
+ { Action(ACTION_FINISHED_ANIMATION, 27, 0, 0), &Room::tug2ShotByElasi },
+ { Action(ACTION_WALK, 0x21, 0, 0), &Room::tug2WalkToDoor },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::tug2LookAtDoor },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::tug2LookAtKirk },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::tug2TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::tug2TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::tug2TalkToRedshirt },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::tug2TalkToSpock },
+ { Action(ACTION_USE, OBJECT_ICOMM, 0, 0), &Room::tug2UseCommunicator },
+ { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::tug2Timer0Expired },
+ { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::tug2Timer2Expired },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 11, 0), &Room::tug2UseSTricorderOnBomb },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::tug2UseMTricorderOnGuard1 },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 9, 0), &Room::tug2UseMTricorderOnGuard2 },
+ { Action(ACTION_TALK, 8, 0, 0), &Room::tug2TalkToGuard1 },
+ { Action(ACTION_TALK, 9, 0, 0), &Room::tug2TalkToGuard2 },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 11, 0), &Room::tug2UseMedkitOnBomb },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 8, 0), &Room::tug2UseMedkitOnGuard1 },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 9, 0), &Room::tug2UseMedkitOnGuard2 },
+ { Action(ACTION_LOOK, 10, 0, 0), &Room::tug2LookAnywhere },
+ { Action(ACTION_LOOK, 0x22, 0, 0), &Room::tug2LookAnywhere },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::tug2LookAnywhere },
+ { Action(ACTION_TALK, 10, 0, 0), &Room::tug2TalkToBrig },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 10, 0), &Room::tug2UseMTricorderOnBrig },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0x22, 0), &Room::tug2UseMTricorderOnOpenBrig },
+ { Action(ACTION_USE, OBJECT_IPHASERS, -1, 0), &Room::tug2UsePhaserAnywhere },
+ { Action(ACTION_USE, OBJECT_IPHASERK, -1, 0), &Room::tug2UsePhaserAnywhere },
+};
+
}
#endif
diff --git a/engines/startrek/rooms/tug1.cpp b/engines/startrek/rooms/tug1.cpp
index 467d496..f2b1dae 100644
--- a/engines/startrek/rooms/tug1.cpp
+++ b/engines/startrek/rooms/tug1.cpp
@@ -51,13 +51,13 @@ void Room::tug1UseSTricorderOnAnything() {
}
void Room::tug1LookAtBridgeDoor() {
- if (_vm->_awayMission.tug.forceFieldDown)
+ if (_vm->_awayMission.tug.bridgeForceFieldDown)
return;
showText(TX_TUG1N005);
}
void Room::tug1UseSTricorderOnBridgeDoor() {
- if (_vm->_awayMission.tug.forceFieldDown)
+ if (_vm->_awayMission.tug.bridgeForceFieldDown)
return;
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
@@ -67,7 +67,7 @@ void Room::tug1UseSTricorderOnBridgeDoor() {
}
void Room::tug1UsePhaserOnBridgeDoor() {
- if (_vm->_awayMission.tug.forceFieldDown)
+ if (_vm->_awayMission.tug.bridgeForceFieldDown)
showText(TX_TUG1N007);
else {
_vm->_awayMission.disableInput = true;
@@ -92,7 +92,7 @@ void Room::tug1KirkFinishedFiringPhaser() {
}
void Room::tug1TalkToSpock() {
- if (!_vm->_awayMission.tug.forceFieldDown)
+ if (!_vm->_awayMission.tug.bridgeForceFieldDown)
showText(TX_SPEAKER_SPOCK, TX_TUG1_010);
}
@@ -154,7 +154,7 @@ void Room::tug1UseCombBitOnTransmogrifier() {
}
void Room::tug1UsePhaserWelderOnBridgeDoor() {
- if (_vm->_awayMission.tug.forceFieldDown)
+ if (_vm->_awayMission.tug.bridgeForceFieldDown)
showText(TX_TUG1N008);
else {
_vm->_awayMission.disableInput = true;
@@ -164,7 +164,7 @@ void Room::tug1UsePhaserWelderOnBridgeDoor() {
}
void Room::tug1UsePhaserWelderOnBridgeDoorInLeftSpot() {
- if (_vm->_awayMission.tug.forceFieldDown)
+ if (_vm->_awayMission.tug.bridgeForceFieldDown)
showText(TX_TUG1N007);
else {
_vm->_awayMission.disableInput = true;
@@ -194,7 +194,7 @@ void Room::tug1KirkReachedBridgeDoorWithWelderInLeftSpot() {
void Room::tug1KirkFinishedUsingWelderInLeftSpot() {
loadActorStandAnim(OBJECT_PHASERSHOT);
showText(TX_SPEAKER_SPOCK, TX_TUG1_015);
- _vm->_awayMission.tug.forceFieldDown = true;
+ _vm->_awayMission.tug.bridgeForceFieldDown = true;
_vm->_awayMission.disableInput = false;
_vm->_awayMission.tug.missionScore++;
}
@@ -253,7 +253,7 @@ void Room::tug1UseCommunicator() {
}
void Room::tug1WalkToBridgeDoor() {
- if (!_vm->_awayMission.tug.forceFieldDown)
+ if (!_vm->_awayMission.tug.bridgeForceFieldDown)
return;
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewman(OBJECT_KIRK, 0xc2, 0x6e, 10);
@@ -294,17 +294,17 @@ void Room::tug1UseMTricorderOnBrigDoor() {
}
void Room::tug1UseSpockOnBridgeDoor() {
- if (!_vm->_awayMission.tug.forceFieldDown)
+ if (!_vm->_awayMission.tug.bridgeForceFieldDown)
showText(TX_SPEAKER_SPOCK, TX_TUG1_013);
}
void Room::tug1UseRedshirtOnBridgeDoor() {
- if (!_vm->_awayMission.tug.forceFieldDown)
+ if (!_vm->_awayMission.tug.bridgeForceFieldDown)
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG1L000);
}
void Room::tug1UseMedkitOnBridgeDoor() {
- if (!_vm->_awayMission.tug.forceFieldDown)
+ if (!_vm->_awayMission.tug.bridgeForceFieldDown)
showText(TX_SPEAKER_MCCOY, TX_TUG1_004);
}
diff --git a/engines/startrek/rooms/tug2.cpp b/engines/startrek/rooms/tug2.cpp
new file mode 100644
index 0000000..e89aff7
--- /dev/null
+++ b/engines/startrek/rooms/tug2.cpp
@@ -0,0 +1,877 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+#define OBJECT_GUARD_1 8
+#define OBJECT_GUARD_2 9
+#define OBJECT_BRIG 10
+#define OBJECT_BOMB 11
+#define OBJECT_WIRE 12
+#define OBJECT_13 13
+
+#define HOTSPOT_BUTTON 0x20
+#define HOTSPOT_DOOR 0x21
+#define HOTSPOT_OPEN_BRIG 0x22
+
+#define GUARDSTAT_UP 0
+#define GUARDSTAT_STUNNED 1
+#define GUARDSTAT_DEAD 2
+#define GUARDSTAT_TIED 8
+
+void Room::tug2Tick1() {
+ playVoc("TUG2LOOP");
+
+ if (!_vm->_awayMission.tug.haveBomb)
+ loadActorAnim2(OBJECT_BOMB, "t2bomb", -3, 1, 0);
+ if (!_vm->_awayMission.tug.gotWires)
+ loadActorAnim2(OBJECT_WIRE, "t2wire", 0, 1, 0);
+
+ if (!_vm->_awayMission.tug.brigForceFieldDown)
+ loadActorAnim2(OBJECT_BRIG, "fld01", 0, 0, 0);
+ else
+ loadActorAnim2(OBJECT_BRIG, "fld10d", 0, 0, 0);
+ if (_vm->_awayMission.tug.field35 == 6)
+ loadActorAnim2(OBJECT_BRIG, "zapdon", 0, 0, 0);
+
+ // Security guy 1
+ if (_vm->_awayMission.tug.guard1Status == 8)
+ loadActorAnim2(OBJECT_GUARD_1, "p5tied", 0xe0, 0xb1, 0);
+ else if (_vm->_awayMission.tug.guard1Status == 1 && _vm->_awayMission.tug.brigForceFieldDown) {
+ loadActorAnim2(OBJECT_GUARD_1, "p5tied", 0xe0, 0xb1, 0);
+ _vm->_awayMission.tug.guard1Status = 8;
+ }
+ if (_vm->_awayMission.tug.guard1Status == 1 && !_vm->_awayMission.tug.brigForceFieldDown) {
+ _vm->_awayMission.tug.guard1Status = 0;
+ _vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] = false;
+ _vm->_awayMission.tug.crewmanKilled[OBJECT_SPOCK] = false;
+ _vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY] = false;
+ if (!_vm->_awayMission.redshirtDead)
+ _vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT] = false;
+ _vm->_awayMission.tug.field5b = 0;
+ }
+ if (_vm->_awayMission.tug.guard1Status == 0)
+ loadActorAnim2(OBJECT_GUARD_1, "p5redy", 0xe0, 0xb1, 0);
+ if (_vm->_awayMission.tug.guard1Status == 2)
+ loadActorAnim2(OBJECT_GUARD_1, "p5hat", 0xe0, 0xb1, 0);
+
+ // Security guy 2
+ if (_vm->_awayMission.tug.guard2Status == 8)
+ loadActorAnim2(OBJECT_GUARD_2, "p6tied", 0xfb, 0xc5, 0);
+ else if (_vm->_awayMission.tug.guard2Status == 1 && _vm->_awayMission.tug.brigForceFieldDown) {
+ loadActorAnim2(OBJECT_GUARD_2, "p6tied", 0xfb, 0xc5, 0);
+ _vm->_awayMission.tug.guard2Status = 8;
+ }
+ if (_vm->_awayMission.tug.guard2Status == 1 && !_vm->_awayMission.tug.brigForceFieldDown) {
+ _vm->_awayMission.tug.guard2Status = 0;
+ _vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] = false;
+ _vm->_awayMission.tug.crewmanKilled[OBJECT_SPOCK] = false;
+ _vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY] = false;
+ if (!_vm->_awayMission.redshirtDead)
+ _vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT] = false;
+ _vm->_awayMission.tug.field5b = 0;
+ }
+ if (_vm->_awayMission.tug.guard2Status == 0)
+ loadActorAnim2(OBJECT_GUARD_2, "p6draw", 0xfb, 0xc5, 0);
+ if (_vm->_awayMission.tug.guard2Status == 2)
+ loadActorAnim2(OBJECT_GUARD_2, "p5hat", 0xfb, 0xc5, 0); // FIXME
+
+
+ if (_vm->_awayMission.tug.field4e == 0)
+ loadActorAnim2(OBJECT_13, "wallht", 0, 0, 0);
+
+ if (_vm->_awayMission.tug.field5b == 0) {
+ _vm->_awayMission.disableWalking = true;
+ playMidiMusicTracks(32, -1);
+ }
+
+ _vm->_awayMission.tug.field5b = 1;
+ _vm->_awayMission.tug.kirkPhaserDrawn = 0;
+}
+
+void Room::tug2Tick60() {
+ if (!_vm->_awayMission.tug.guard1Status || !_vm->_awayMission.tug.guard2Status) {
+ _vm->_awayMission.timers[0] = 60;
+ showText(TX_SPEAKER_ELASI_GUARD, TX_TUG2L085);
+ tug2ElasiReadyPhaser();
+ }
+}
+
+void Room::tug2LookAtButton() {
+ showText(TX_TUG2N011);
+}
+
+void Room::tug2LookAtMccoy() {
+ showText(TX_TUG2N005);
+}
+
+void Room::tug2LookAtSpock() {
+ showText(TX_TUG2N007);
+}
+
+void Room::tug2LookAtRedshirt() {
+ showText(TX_TUG2N004);
+}
+
+void Room::tug2GetBomb() {
+ if (_vm->_awayMission.tug.brigForceFieldDown) {
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ walkCrewman(OBJECT_KIRK, 0xc9, 0xa0, 12);
+ }
+ else
+ showText(TX_TUG2N024);
+}
+
+void Room::tug2KirkReachedBomb() {
+ loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 13);
+}
+
+void Room::tug2KirkGotBomb() {
+ loadActorStandAnim(OBJECT_BOMB);
+ giveItem(OBJECT_IBOMB);
+ _vm->_awayMission.tug.haveBomb = true;
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::tug2LookAtBomb() {
+ showText(TX_TUG2N000);
+}
+
+void Room::tug2LookAtGuard1() {
+ if (_vm->_awayMission.tug.guard1Status == 0)
+ showText(TX_TUG2N001);
+ else if (_vm->_awayMission.tug.guard1Status == 1)
+ showText(TX_TUG2N013);
+ else if (_vm->_awayMission.tug.guard1Status == 8)
+ showText(TX_TUG2N015);
+ else if (_vm->_awayMission.tug.guard1Status == 2)
+ showText(TX_TUG2N106);
+}
+
+void Room::tug2LookAtGuard2() {
+ if (_vm->_awayMission.tug.guard2Status == 0)
+ showText(TX_TUG2N037);
+ else if (_vm->_awayMission.tug.guard2Status == 1)
+ showText(TX_TUG2N014);
+ else if (_vm->_awayMission.tug.guard2Status == 8)
+ showText(TX_TUG2N016);
+ else if (_vm->_awayMission.tug.guard2Status == 2)
+ showText(TX_TUG2N106);
+}
+
+void Room::tug2LookAtWires() {
+ showText(TX_TUG2N010);
+}
+
+void Room::tug2UseSTricorderOnButton() {
+ if (_vm->_awayMission.tug.field35 != 0)
+ return;
+ spockScan(DIR_E, TX_TUG2_007);
+}
+
+void Room::tug2UseMccoyOnWires() {
+ if (_vm->_awayMission.tug.field35 != 0)
+ return;
+ showText(TX_SPEAKER_MCCOY, TX_TUG2_009);
+}
+
+void Room::tug2UseMccoyOnBomb() {
+ showText(TX_SPEAKER_MCCOY, TX_TUG2_011);
+}
+
+void Room::tug2UseRedshirtOnWires() {
+ if (_vm->_awayMission.disableWalking || _vm->_awayMission.tug.field35 != 0)
+ return;
+ showText(TX_SPEAKER_CHRISTENSEN, TX_TUG2L007);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
+ _vm->_awayMission.disableInput = true;
+ walkCrewman(OBJECT_REDSHIRT, 0xc9, 0xa0, 6);
+}
+
+void Room::tug2RedshirtReachedWires() {
+ loadActorAnim2(OBJECT_REDSHIRT, "rusemn", -1, -1, 7);
+}
+
+void Room::tug2RedshirtDefusedBomb() {
+ showText(TX_TUG2C001);
+ showText(TX_SPEAKER_CHRISTENSEN, TX_TUG2L011);
+ _vm->_awayMission.tug.field35 = 4;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
+ walkCrewman(OBJECT_REDSHIRT, 0x44, 0xc2, 8);
+}
+
+void Room::tug2RedshirtReturnedToPosition() {
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.tug.missionScore += 2;
+}
+
+void Room::tug2UseKirkOnWires() {
+ if (_vm->_awayMission.disableWalking || _vm->_awayMission.tug.field35 != 0)
+ return;
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ walkCrewman(OBJECT_KIRK, 0xc9, 0xa0, 5);
+}
+
+void Room::tug2KirkReachedWires() {
+ showText(TX_SPEAKER_KIRK, TX_TUG2_003);
+ showText(TX_SPEAKER_SPOCK, TX_TUG2_023);
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ walkCrewman(OBJECT_KIRK, 0x66, 0xb8, 0);
+ _vm->_awayMission.disableInput = false;
+ tug2UseSpockOnWires();
+}
+
+void Room::tug2UseSpockOnWires() {
+ if (_vm->_awayMission.disableWalking || _vm->_awayMission.tug.field35 != 0)
+ return;
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ walkCrewman(OBJECT_SPOCK, 0xc9, 0xa0, 9);
+}
+
+void Room::tug2SpockReachedWires() {
+ loadActorAnim2(OBJECT_SPOCK, "suseme", -1, -1, 0);
+ playVoc("WIRESNIP");
+ showText(TX_SPEAKER_SPOCK, TX_TUG2_024);
+ _vm->_awayMission.tug.field35 = 4;
+
+ if (_vm->_awayMission.tug.spockExaminedTransporter)
+ showText(TX_SPEAKER_SPOCK, TX_TUG2_008);
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ walkCrewman(OBJECT_SPOCK, 0x56, 0xa9, 11);
+}
+
+void Room::tug2SpockReturnedToPosition() {
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.tug.missionScore += 2;
+}
+
+void Room::tug2GetWires() {
+ if (_vm->_awayMission.disableWalking)
+ return;
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ walkCrewman(OBJECT_KIRK, 0xc9, 0xa0, 28);
+}
+
+void Room::tug2KirkReachedWiresToGet() {
+ loadActorAnim2(OBJECT_KIRK, "kuseme", -1, -1, 29);
+}
+
+void Room::tug2KirkGotWires() {
+ if (_vm->_awayMission.tug.field35 == 0) {
+ playMidiMusicTracks(2, -1);
+ loadActorAnim2(OBJECT_BRIG, "zap", 0, 0, 1);
+ playVoc("NM8EXPLO");
+ loadActorAnim2(OBJECT_BOMB, "t2bbo", -3, 1, 0);
+ playSoundEffectIndex(SND_PHASSHOT);
+ playSoundEffectIndex(SND_BLANK_16);
+ _vm->_awayMission.tug.field35 = 6;
+ loadActorStandAnim(OBJECT_WIRE);
+ giveItem(OBJECT_IWIRING);
+ _vm->_awayMission.tug.gotWires = true;
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.tug.missionScore += 3;
+ }
+ else {
+ loadActorStandAnim(OBJECT_WIRE);
+ giveItem(OBJECT_IWIRING);
+ _vm->_awayMission.tug.gotWires = true;
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.tug.missionScore += 3;
+ }
+}
+
+void Room::tug2UseKirkOnButton() {
+ if (_vm->_awayMission.disableWalking)
+ return;
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ walkCrewman(OBJECT_KIRK, 0xc9, 0xa0, 14);
+}
+
+void Room::tug2KirkReachedButton() {
+ loadActorAnim2(OBJECT_KIRK, "kusehe", -1, -1, 15);
+ playSoundEffectIndex(SND_07);
+}
+
+void Room::tug2UseSpockOnButton() {
+ if (_vm->_awayMission.disableWalking)
+ return;
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ walkCrewman(OBJECT_SPOCK, 0xc9, 0xa0, 16);
+}
+
+void Room::tug2SpockReachedButton() {
+ loadActorAnim2(OBJECT_SPOCK, "susehe", -1, -1, 17);
+ playSoundEffectIndex(SND_07);
+}
+
+void Room::tug2UseMccoyOnButton() {
+ if (_vm->_awayMission.disableWalking)
+ return;
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
+ walkCrewman(OBJECT_MCCOY, 0xc9, 0xa0, 18);
+}
+
+void Room::tug2MccoyReachedButton() {
+ loadActorAnim2(OBJECT_MCCOY, "musehe", -1, -1, 19);
+ playSoundEffectIndex(SND_07);
+}
+
+void Room::tug2UseRedshirtOnButton() {
+ if (_vm->_awayMission.disableWalking)
+ return;
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
+ walkCrewman(OBJECT_REDSHIRT, 0xc9, 0xa0, 20);
+}
+
+void Room::tug2RedshirtReachedButton() {
+ loadActorAnim2(OBJECT_REDSHIRT, "rusehe", -1, -1, 21);
+ playSoundEffectIndex(SND_07);
+}
+
+void Room::tug2TurnedOffForceField() {
+ _vm->_awayMission.disableInput = false;
+ if (_vm->_awayMission.tug.field35 == 0) {
+ playMidiMusicTracks(2, -1);
+ loadActorAnim2(OBJECT_BRIG, "zap", 0, 0, 1);
+ playVoc("NM8EXPLO");
+ loadActorAnim2(OBJECT_BOMB, "t2bbo", -3, 1, 0);
+ // FIXME: doesn't play "PHASSHOT" sound effect like when kirk removes wires?
+ _vm->_awayMission.tug.field35 = 6;
+ }
+ else if (_vm->_awayMission.tug.field35 == 4 && !_vm->_awayMission.tug.brigForceFieldDown) {
+ _vm->_awayMission.tug.brigForceFieldDown = true;
+ loadActorAnim2(OBJECT_BRIG, "fld10", 0, 0, 2);
+ _vm->_awayMission.tug.missionScore += 6;
+ playVoc("EFX15");
+ }
+}
+
+void Room::tug2PrisonersDead() {
+ loadActorAnim2(OBJECT_BRIG, "zapdon", 0, 0, 0);
+ showText(TX_TUG2N026);
+}
+
+void Room::tug2PrisonersReleased() {
+ loadActorAnim2(OBJECT_BRIG, "fld10d", 0, 0, 0);
+ showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_029);
+ showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_030);
+ showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_028);
+ _vm->_awayMission.tug.savedPrisoners = true;
+}
+
+void Room::tug2UsePhaserOnBrig() {
+ if (_vm->_awayMission.tug.field35 == 0)
+ showText(TX_SPEAKER_SPOCK, TX_TUG2_006);
+ else if (_vm->_awayMission.tug.brigForceFieldDown) {
+ // BUGFIX: this function had two implementations; one for firing on the brig, and
+ // one for firing on the masada crewman (who replaces the brig object). The first
+ // took priority, meaning the latter code never ran. That's fixed here.
+ showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_025);
+ }
+}
+
+void Room::tug2ElasiReadyPhaser() {
+ if (_vm->_awayMission.tug.guard1Status == 0 && _vm->_awayMission.tug.field59 == 0) {
+ loadActorAnim2(OBJECT_GUARD_1, "p5draw", -1, -1, 0);
+ _vm->_awayMission.tug.field59++;
+ }
+}
+
+void Room::tug2CheckEndFirefight() {
+ if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_UP || _vm->_awayMission.tug.guard2Status == GUARDSTAT_UP)
+ return;
+ _vm->_awayMission.disableWalking = false;
+ if (_vm->_awayMission.tug.kirkPhaserDrawn)
+ loadActorStandAnim(OBJECT_KIRK);
+}
+
+void Room::tug2UseStunPhaserOnGuard1() {
+ if (_vm->_awayMission.tug.guard1Status != GUARDSTAT_UP)
+ tug2KirkShootGuard1();
+ else {
+ tug2ElasiReadyPhaser();
+ _vm->_awayMission.disableInput = true;
+ if (_vm->_awayMission.tug.kirkPhaserDrawn)
+ tug2KirkShootGuard1();
+ else {
+ loadActorAnim2(OBJECT_KIRK, "kdrawe", -1, -1, 22);
+ _vm->_awayMission.tug.kirkPhaserDrawn = true;
+ }
+ }
+}
+
+void Room::tug2KirkShootGuard1() {
+ if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_UP) {
+ loadActorAnim2(OBJECT_GUARD_1, "p5stun", -1, -1, 0);
+ _vm->_awayMission.tug.guard1Status = GUARDSTAT_STUNNED;
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t2beem03", 5);
+ tug2CheckEndFirefight();
+ }
+
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::tug2UseStunPhaserOnGuard2() {
+ if (_vm->_awayMission.tug.guard2Status != GUARDSTAT_UP)
+ tug2KirkShootGuard2();
+ else {
+ tug2ElasiReadyPhaser();
+ _vm->_awayMission.disableInput = true;
+ if (_vm->_awayMission.tug.kirkPhaserDrawn)
+ tug2KirkShootGuard2();
+ else {
+ loadActorAnim2(OBJECT_KIRK, "kdrawe", -1, -1, 23);
+ _vm->_awayMission.tug.kirkPhaserDrawn = true;
+ }
+ }
+}
+
+void Room::tug2KirkShootGuard2() {
+ if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_UP){
+ loadActorAnim2(OBJECT_GUARD_2, "p6stun", -1, -1, 0);
+ _vm->_awayMission.tug.guard2Status = GUARDSTAT_STUNNED;
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t2beem02", 5);
+ tug2CheckEndFirefight();
+ }
+
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::tug2UseKillPhaserOnGuard1() {
+ if (_vm->_awayMission.tug.guard1Status != GUARDSTAT_UP)
+ tug2KirkKillGuard1();
+ else {
+ tug2ElasiReadyPhaser();
+ _vm->_awayMission.disableInput = true;
+ if (_vm->_awayMission.tug.kirkPhaserDrawn)
+ tug2KirkKillGuard1();
+ else {
+ loadActorAnim2(OBJECT_KIRK, "kdrawe", -1, -1, 24);
+ _vm->_awayMission.tug.kirkPhaserDrawn = true;
+ _vm->_awayMission.tug.field4a = true;
+ }
+ }
+}
+
+void Room::tug2KirkKillGuard1() {
+ if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_UP){
+ loadActorAnim2(OBJECT_GUARD_1, "p5kill", -1, -1, 0);
+ _vm->_awayMission.tug.guard1Status = GUARDSTAT_DEAD;
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t2beem05", 5);
+ tug2CheckEndFirefight();
+ }
+
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::tug2UseKillPhaserOnGuard2() {
+ if (_vm->_awayMission.tug.guard2Status != GUARDSTAT_UP)
+ tug2KirkKillGuard2();
+ else {
+ tug2ElasiReadyPhaser();
+ _vm->_awayMission.disableInput = true;
+ if (_vm->_awayMission.tug.kirkPhaserDrawn)
+ tug2KirkKillGuard2();
+ else {
+ loadActorAnim2(OBJECT_KIRK, "kdrawe", -1, -1, 25);
+ _vm->_awayMission.tug.kirkPhaserDrawn = true;
+ _vm->_awayMission.tug.field4a = true;
+ }
+ }
+}
+
+void Room::tug2KirkKillGuard2() {
+ if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_UP){
+ loadActorAnim2(OBJECT_GUARD_2, "p6kill", -1, -1, 0);
+ _vm->_awayMission.tug.guard2Status = GUARDSTAT_DEAD;
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t2beem04", 5);
+ tug2CheckEndFirefight();
+ }
+
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::tug2UsePhaserOnWelder() {
+ loseItem(OBJECT_IPWE);
+ giveItem(OBJECT_IPWF);
+ showText(TX_TUG2N006);
+
+ // BUGFIX: this following line didn't exist, despite it existing in TUG1; meaning this
+ // was supposed to give points, but it only did in a specific room.
+ _vm->_awayMission.tug.missionScore += 3;
+}
+
+void Room::tug2UseWelderOnWireScraps() {
+ showText(TX_TUG2N009);
+ loseItem(OBJECT_IWIRSCRP);
+}
+
+void Room::tug2UseWelderOnMetalScraps() {
+ showText(TX_SPEAKER_SPOCK, TX_TUG2_112);
+ loseItem(OBJECT_IJNKMETL);
+ giveItem(OBJECT_ICOMBBIT);
+}
+
+void Room::tug2UseCombBitOnTransmogrifier() {
+ showText(TX_SPEAKER_SPOCK, TX_TUG2_021);
+ loseItem(OBJECT_ICOMBBIT);
+ loseItem(OBJECT_IRT);
+ giveItem(OBJECT_IRTWB);
+}
+
+void Room::tug2ShotByElasi() {
+ showText(TX_TUG2N025);
+ showGameOverMenu();
+
+ // Unused: additional textbox that says "***Game over man!***"
+}
+
+void Room::tug2WalkToDoor() {
+ walkCrewman(OBJECT_KIRK, 0x0b, 0xab, 0);
+}
+
+void Room::tug2LookAtDoor() {
+ showText(TX_TUG2N012);
+}
+
+void Room::tug2LookAtKirk() {
+ showText(TX_TUG2N003);
+}
+
+void Room::tug2TalkToKirk() {
+ if (_vm->_awayMission.tug.field35 == 6)
+ showText(TX_SPEAKER_KIRK, TX_TUG2_001);
+ else
+ showText(TX_SPEAKER_KIRK, TX_TUG2_002);
+}
+
+void Room::tug2TalkToMccoy() {
+ if (_vm->_awayMission.tug.field35 == 6)
+ showText(TX_SPEAKER_MCCOY, TX_TUG2_018);
+ else
+ showText(TX_SPEAKER_MCCOY, TX_TUG2_010);
+}
+
+void Room::tug2TalkToRedshirt() {
+ // BUGFIX: the original game has two implementations of this function; the first takes
+ // precedence, however, it's just generic, unhelpful text. The second implementation
+ // is more interesting, so that one is used instead.
+ if (_vm->_awayMission.tug.field35 == 6)
+ showText(TX_SPEAKER_CHRISTENSEN, TX_TUG2L004);
+ else
+ showText(TX_SPEAKER_CHRISTENSEN, TX_TUG2J003);
+
+ // Original text: "I'm just a security officer, sir."
+ //showText(TX_SPEAKER_CHRISTENSEN, TX_TUG2L002);
+}
+
+void Room::tug2TalkToSpock() {
+ if (_vm->_awayMission.tug.field35 == 6)
+ showText(TX_SPEAKER_SPOCK, TX_TUG2_005);
+ else
+ showText(TX_SPEAKER_SPOCK, TX_TUG2_020);
+}
+
+void Room::tug2UseCommunicator() {
+ showText(TX_SPEAKER_SPOCK, TX_TUG1_011);
+}
+
+void Room::tug2DetermineElasiShooter() {
+ if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_UP)
+ _roomVar.tug2.shootingObject = OBJECT_GUARD_2;
+ if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_UP)
+ _roomVar.tug2.shootingObject = OBJECT_GUARD_1;
+}
+
+// Elasi shoots someone
+void Room::tug2Timer0Expired() {
+ if (_vm->_awayMission.tug.guard1Status != GUARDSTAT_UP && _vm->_awayMission.tug.guard2Status != GUARDSTAT_UP)
+ return;
+
+ _roomVar.tug2.elasiPhaserOnKill = 0;
+ if (_vm->_awayMission.tug.field4a)
+ _roomVar.tug2.elasiPhaserOnKill = 1;
+
+ switch (_vm->_awayMission.tug.field4b) {
+ case 0:
+ _vm->_awayMission.tug.field4b++;
+ if (_vm->_awayMission.tug.guard2Status != GUARDSTAT_UP) {
+ // BUGFIX: reset the timer to allow guard 1 to continue if guard 2 is down
+ _vm->_awayMission.timers[0] = 60;
+ return;
+ }
+
+ // Guard misses and shoots wall
+ loadActorAnim2(OBJECT_13, "wallht", 0, 0, 0);
+ showBitmapFor5Ticks("t2beem00", 5);
+ playSoundEffectIndex(SND_PHASSHOT);
+ loadActorAnim2(OBJECT_GUARD_2, "p6fire", -1, -1, 0);
+ _vm->_awayMission.tug.field4e = _roomVar.tug2.elasiPhaserOnKill;
+ _vm->_awayMission.timers[0] = 60;
+ break;
+
+ case 1:
+ // Guard shoots redshirt
+ _vm->_awayMission.tug.field4b++;
+ if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT]) {
+ tug2DetermineElasiShooter();
+ _roomVar.tug2.shootingTarget = OBJECT_REDSHIRT;
+ _vm->_awayMission.timers[0] = 60;
+ tug2GuardShootsCrewman();
+ }
+ break;
+
+ case 2:
+ // Guard shoots spock (or kirk)
+ _vm->_awayMission.tug.field4b++;
+ _roomVar.tug2._1ec4 = 0;
+ if (_vm->_awayMission.tug.field4a)
+ _roomVar.tug2._1ec4 = 1;
+ tug2DetermineElasiShooter();
+ if (_roomVar.tug2._1ec4 == 0)
+ _roomVar.tug2.shootingTarget = OBJECT_SPOCK;
+ else
+ _roomVar.tug2.shootingTarget = OBJECT_KIRK;
+ _vm->_awayMission.timers[0] = 60;
+ tug2GuardShootsCrewman();
+ break;
+
+ case 3:
+ _vm->_awayMission.tug.field4b++;
+ if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY]) {
+ tug2DetermineElasiShooter();
+ _roomVar.tug2.shootingTarget = OBJECT_MCCOY;
+ _vm->_awayMission.timers[0] = 80;
+ tug2GuardShootsCrewman();
+ }
+ break;
+
+ case 4:
+ _vm->_awayMission.tug.field4b++;
+ if (_roomVar.tug2._1ec4 == 0) {
+ tug2DetermineElasiShooter();
+ _roomVar.tug2.shootingTarget = OBJECT_KIRK;
+ _vm->_awayMission.timers[2] = 40; // TODO
+ tug2GuardShootsCrewman();
+ }
+ else if (_roomVar.tug2._1ec4 == 1) {
+ tug2DetermineElasiShooter();
+ _roomVar.tug2.shootingTarget = OBJECT_SPOCK;
+ _vm->_awayMission.timers[2] = 40;
+ tug2GuardShootsCrewman();
+ }
+ break;
+ }
+}
+
+void Room::tug2GuardShootsCrewman() {
+ const char *g1ShotsOnStun[] = {
+ "t2beem15",
+ "t2beem14",
+ "t2beem17",
+ "t2beem16"
+ };
+ const char *g1ShotsOnKill[] = {
+ "t2beem19",
+ "t2beem20",
+ "t2beem21",
+ "t2beem18",
+ };
+ const char *g2ShotsOnStun[] = { // BUG: these look wrong. But correct animations don't seem to exist.
+ "t2beem07",
+ "t2beem08",
+ "t2beem09",
+ "t2beem06"
+ };
+ const char *g2ShotsOnKill[] = {
+ "t2beem11",
+ "t2beem12",
+ "t2beem13",
+ "t2beem10",
+ };
+
+ const char *crewPrefixes = "ksmr";
+
+ if (!_roomVar.tug2.elasiPhaserOnKill)
+ _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.tug2.shootingTarget] = DIR_W;
+
+ Common::String anim;
+ const char **bitmapArray;
+ if (_roomVar.tug2.elasiPhaserOnKill) {
+ anim = "_Kille";
+ if (_roomVar.tug2.shootingObject == OBJECT_GUARD_1)
+ bitmapArray = g1ShotsOnKill;
+ else
+ bitmapArray = g2ShotsOnKill;
+ }
+ else {
+ anim = "_stune";
+ if (_roomVar.tug2.shootingObject == OBJECT_GUARD_1)
+ bitmapArray = g1ShotsOnStun;
+ else
+ bitmapArray = g2ShotsOnStun;
+ }
+ anim.setChar(crewPrefixes[_roomVar.tug2.shootingTarget], 0);
+
+ if (_roomVar.tug2.shootingTarget != OBJECT_KIRK)
+ loadActorAnim2(_roomVar.tug2.shootingTarget, anim, -1, -1, 0);
+ else if (_roomVar.tug2.elasiPhaserOnKill)
+ loadActorAnim2(_roomVar.tug2.shootingTarget, anim, -1, -1, 27);
+ else
+ loadActorAnim2(_roomVar.tug2.shootingTarget, anim, -1, -1, 26);
+
+ showBitmapFor5Ticks(bitmapArray[_roomVar.tug2.shootingTarget], 5);
+ playSoundEffectIndex(SND_PHASSHOT);
+
+ if (_roomVar.tug2.shootingObject == OBJECT_GUARD_1)
+ loadActorAnim2(OBJECT_GUARD_1, "p5fire", -1, -1, 0);
+ else
+ loadActorAnim2(OBJECT_GUARD_2, "p6fire", -1, -1, 0);
+
+ _vm->_awayMission.tug.crewmanKilled[_roomVar.tug2.shootingTarget] = _roomVar.tug2.elasiPhaserOnKill;
+
+ if (!_roomVar.tug2.elasiPhaserOnKill) {
+ // BUG: crew goes down for 120 frames, but they start to get up before the fight
+ // is over. Perhaps this number should be increased.
+ _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.tug2.shootingTarget] = DIR_W;
+ _vm->_awayMission.crewGetupTimers[_roomVar.tug2.shootingTarget] = 120;
+ _vm->_awayMission.crewDownBitset |= (1 << _roomVar.tug2.shootingTarget);
+ }
+ if (_roomVar.tug2.elasiPhaserOnKill && _roomVar.tug2.shootingTarget == OBJECT_REDSHIRT)
+ _vm->_awayMission.redshirtDead = true;
+}
+
+void Room::tug2Timer2Expired() {
+ // NOTE: is this function redundant? There's another that shows the game over menu
+ // when Kirk's death animation finishes. That one seems to take precedence.
+ showGameOverMenu();
+}
+
+void Room::tug2UseSTricorderOnBomb() {
+ spockScan(DIR_E, TX_TUG2_004);
+}
+
+void Room::tug2UseMTricorderOnGuard1() {
+ if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED)
+ mccoyScan(DIR_E, TX_TUG2_016);
+}
+
+void Room::tug2UseMTricorderOnGuard2() {
+ // BUGFIX: original didn't play audio for this (despite being the same as above).
+ if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED)
+ mccoyScan(DIR_E, TX_TUG2_016);
+}
+
+void Room::tug2TalkToGuard1() {
+ if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_TIED)
+ showText(TX_SPEAKER_ELASI_GUARD, TX_TUG2L086);
+ else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED)
+ showText(TX_SPEAKER_MCCOY, TX_TUG2_012);
+}
+
+void Room::tug2TalkToGuard2() {
+ if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_TIED)
+ showText(TX_SPEAKER_ELASI_GUARD, TX_TUG2L086);
+ else if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED)
+ showText(TX_SPEAKER_MCCOY, TX_TUG2_013);
+}
+
+void Room::tug2UseMedkitOnBomb() {
+ showText(TX_SPEAKER_MCCOY, TX_TUG2_017);
+}
+
+void Room::tug2UseMedkitOnGuard1() {
+ if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED)
+ showText(TX_SPEAKER_MCCOY, TX_TUG2_014);
+}
+
+void Room::tug2UseMedkitOnGuard2() {
+ if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED)
+ showText(TX_SPEAKER_MCCOY, TX_TUG2_014);
+}
+
+void Room::tug2LookAnywhere() {
+ if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_DEAD && _vm->_awayMission.tug.guard2Status == GUARDSTAT_DEAD && _vm->_awayMission.tug.field35 == 6)
+ showText(TX_TUG2N019);
+ else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_DEAD && _vm->_awayMission.tug.guard2Status == GUARDSTAT_DEAD && !_vm->_awayMission.tug.brigForceFieldDown)
+ showText(TX_TUG2N017);
+ else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED && _vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED && _vm->_awayMission.tug.field35 == 6)
+ showText(TX_TUG2N020);
+ else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED && _vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED && !_vm->_awayMission.tug.brigForceFieldDown)
+ showText(TX_TUG2N018);
+ else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED && _vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED && _vm->_awayMission.tug.brigForceFieldDown)
+ showText(TX_TUG2N021);
+ else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_DEAD && _vm->_awayMission.tug.guard2Status == GUARDSTAT_DEAD && _vm->_awayMission.tug.brigForceFieldDown)
+ showText(TX_TUG2N022);
+ else
+ showText(TX_TUG2N023);
+}
+
+void Room::tug2TalkToBrig() {
+ // The "brig" can also be a masada crewman, when the force field is down, so there are
+ // at least two cases here.
+
+ if (_vm->_awayMission.tug.brigForceFieldDown && !_vm->_awayMission.tug.talkedToBrigCrewman) {
+ loadActorAnim2(OBJECT_BRIG, "fld10d", 0, 0, 0);
+ showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_026);
+ _vm->_awayMission.tug.talkedToBrigCrewman = true;
+ }
+
+ if (_vm->_awayMission.tug.brigForceFieldDown && _vm->_awayMission.tug.talkedToBrigCrewman)
+ showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_027);
+ else if (!_vm->_awayMission.tug.brigForceFieldDown)
+ mccoyScan(DIR_E, TX_TUG2_015);
+}
+
+void Room::tug2UseMTricorderOnBrig() {
+ if (_vm->_awayMission.tug.field35 == 6)
+ mccoyScan(DIR_E, TX_TUG2_019);
+ else if (!_vm->_awayMission.tug.brigForceFieldDown)
+ mccoyScan(DIR_E, TX_TUG2_015);
+}
+
+void Room::tug2UseMTricorderOnOpenBrig() {
+ if (_vm->_awayMission.tug.brigForceFieldDown)
+ mccoyScan(DIR_E, TX_TUG2_015);
+}
+
+void Room::tug2UsePhaserAnywhere() {
+ // Stub function to suppress "you can't do that" messages.
+}
+
+}
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
index 6e4dfcd..9c7f16a 100644
--- a/engines/startrek/sound.h
+++ b/engines/startrek/sound.h
@@ -50,6 +50,7 @@ enum SoundEffects {
SND_BLANK_0b = 0x0b,
SND_SELECTION = 0x10,
SND_BLANK_14 = 0x14,
+ SND_BLANK_16 = 0x16,
SND_HAILING = 0x22,
SND_PHASSHOT_2 = 0x24,
SND_PHOTSHOT = 0x25,
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index cf949b2..b56a20a 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -80,6 +80,8 @@ enum GameStringIDs {
TX_SPEAKER_CHRISTENSEN,
TX_SPEAKER_SIMPSON,
+ TX_SPEAKER_ELASI_GUARD,
+ TX_SPEAKER_MASADA_CREWMAN,
TX_DEM0_001,
TX_DEM0_002,
@@ -600,6 +602,78 @@ enum GameStringIDs {
TX_TUG1N013,
+ TX_TUG2_001,
+ TX_TUG2_002,
+ TX_TUG2_003,
+ TX_TUG2_004,
+ TX_TUG2_005,
+ TX_TUG2_006,
+ TX_TUG2_007,
+ TX_TUG2_008,
+ TX_TUG2_009,
+ TX_TUG2_010,
+ TX_TUG2_011,
+ TX_TUG2_012,
+ TX_TUG2_013,
+ TX_TUG2_014,
+ TX_TUG2_015,
+ TX_TUG2_016,
+ TX_TUG2_017,
+ TX_TUG2_018,
+ TX_TUG2_019,
+ TX_TUG2_020,
+ TX_TUG2_021,
+ TX_TUG2_022,
+ TX_TUG2_023,
+ TX_TUG2_024,
+ TX_TUG2_025,
+ TX_TUG2_026,
+ TX_TUG2_027,
+ TX_TUG2_028,
+ TX_TUG2_029,
+ TX_TUG2_030,
+ TX_TUG2_112,
+ TX_TUG2J000,
+ TX_TUG2J001,
+ TX_TUG2J002,
+ TX_TUG2J003,
+ TX_TUG2L002,
+ TX_TUG2L004,
+ TX_TUG2L007,
+ TX_TUG2L011,
+ TX_TUG2L085,
+ TX_TUG2L086,
+ TX_TUG2N000,
+ TX_TUG2N001,
+ TX_TUG2N002,
+ TX_TUG2N003,
+ TX_TUG2N004,
+ TX_TUG2N005,
+ TX_TUG2N006,
+ TX_TUG2N007,
+ TX_TUG2N009,
+ TX_TUG2N010,
+ TX_TUG2N011,
+ TX_TUG2N012,
+ TX_TUG2N013,
+ TX_TUG2N014,
+ TX_TUG2N015,
+ TX_TUG2N016,
+ TX_TUG2N017,
+ TX_TUG2N018,
+ TX_TUG2N019,
+ TX_TUG2N020,
+ TX_TUG2N021,
+ TX_TUG2N022,
+ TX_TUG2N023,
+ TX_TUG2N024,
+ TX_TUG2N025,
+ TX_TUG2N026,
+ TX_TUG2N037,
+ TX_TUG2N106,
+ TX_TUG2C001, // Custom
+
+
TX_END
};
@@ -627,6 +701,8 @@ const char * const g_gameStrings[] = {
"Lt. Christensen",
"Crewman Simpson",
+ "Elasi Guard",
+ "Masada Crewman",
"#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?",
"#DEM0\\DEM0_002#Aside from seeing demons, has any hard data been collected? Any evidence I could see?",
@@ -1145,6 +1221,78 @@ const char * const g_gameStrings[] = {
"#TUG1\\TUG1N010#This viewscreen/ communication terminal has been damaged beyond repair.",
"#TUG1\\TUG1N011#Twisted debris has been scattered along the side of the corridor.",
"#TUG1\\TUG1N013#You are in a typical starship corridor.",
+
+
+ "#TUG2\\TUG2_001#My God, what have we done?",
+ "#TUG2\\TUG2_002#They've turned this freighter into a prison barge.",
+ "#TUG2\\TUG2_003#Spock see if you can disarm this.",
+ "#TUG2\\TUG2_004#A medium strength phaser bomb. The brig force field would contain the explosion but it would kill the crew members within the cell. I recommend that we find a way of disarming it, Captain.",
+ "#TUG2\\TUG2_005#All of the crewmen are dead, Captain.",
+ "#TUG2\\TUG2_006#Captain, if we could manage to overload the forcefield, it would probably detonate the bomb before we could rescue the crewmen.",
+ "#TUG2\\TUG2_007#Captain, the switch has been booby-trapped to detonate a bomb, presumably inside the brig somewhere.",
+ "#TUG2\\TUG2_008#Captain, this wiring may prove useful in repairing the transporter.",
+ "#TUG2\\TUG2_009#Damn it, Jim, I'm a doctor, not an electrical engineer! I'm likely to blow us all up.",
+ "#TUG2\\TUG2_010#I don't like the looks of this, Jim.",
+ "#TUG2\\TUG2_011#I don't operate on bombs, Jim, unless you like big explosions.",
+ "#TUG2\\TUG2_012#I don't think he is in any shape to respond.",
+ "#TUG2\\TUG2_013#I don't think he is in any shape to respond.",
+ "#TUG2\\TUG2_014#I don't think it would be a good idea to wake them up, Jim.",
+ "#TUG2\\TUG2_015#The crew is tired and has elevated signs from extreme stress, but they will survive.",
+ "#TUG2\\TUG2_016#The pirates won't wake for a while, but they are going to be quite unhappy when they do. I recommend that we not be here when they awake.",
+ "#TUG2\\TUG2_017#These aren't the right tools for the right job, Jim.",
+ "#TUG2\\TUG2_018#We came here to save these people, now look what we've done!",
+ "#TUG2\\TUG2_019#They're all dead, Jim. What in God's name were you thinking?",
+ "#TUG2\\TUG2_020#I see that the Elasi live up to their reputation, Captain.",
+ "#TUG2\\TUG2_021#The parts fit together satisfactorily.",
+ "#TUG2\\TUG2_022#I believe that no diety had any bearing on this doctor, but the Captain should have been more careful. Starfleet will not be pleased by their deaths.",
+ "#TUG2\\TUG2_023#I'll do my best, Captain.",
+ "#TUG2\\TUG2_024#There. I believe the bomb is now defused, Captain.",
+ "#TUG2\\TUG2_025#I'm on your side, Sir! There's no need to fire at me.",
+ "#TUG2\\TUG2_026#Thank you for freeing us. You'd better take the bridge before they suspect anything is up.",
+ "#TUG2\\TUG2_027#You'd better hurry up or they'll catch on, Sir!",
+ "#TUG2\\TUG2_028#But if you used a charged Phaser Welder two feet to the left of the door and one foot off the ground, you might be able to shut down the forcefield, and get a jump on the Elasi.",
+ "#TUG2\\TUG2_029#Thank you for freeing us, Captain! We'll secure the area so they don't come up behind you.",
+ "#TUG2\\TUG2_030#We've had electrical problems with our door to our bridge, Captain. The Elasi don't know we put in an electric shutdown device -- you'd never find it by chance.",
+ "#TUG2\\TUG2_112#I think that does it -- a Comb Bit for the transmogrifier. Now I can continue repairs on the transporter controls. ",
+ "#TUG2\\TUG2J000#Ouch! That hurt!",
+ "#TUG2\\TUG2J001#Don't you know any better?",
+ "#TUG2\\TUG2J002#What kind of idiot are you?",
+ "#TUG2\\TUG2J003#I recommend extreme caution, Captain. We must be ready to expect anything.",
+ "#TUG2\\TUG2L002#I'm just a security officer, sir.",
+ "#TUG2\\TUG2L004#It's my fault. They did the same thing on Damocles Station... ",
+ "#TUG2\\TUG2L007#I believe I can disarm this, Captain.",
+ "#TUG2\\TUG2L011#There, It's defused.",
+ "#TUG2\\TUG2L085#Hey, what are you doing here?",
+ "#TUG2\\TUG2L086#You imperialist Federation scum! We will never surrender! Cereth is a great man with a great vision. I spit upon you.",
+ "#TUG2\\TUG2N000#A bomb located just inside the forcefield.",
+ "#TUG2\\TUG2N001#He doesn't look to friendly.",
+ "#TUG2\\TUG2N002#Kirk falls to the floor stunned.",
+ "#TUG2\\TUG2N003#Kirk seems concerned by what he sees in this room.",
+ "#TUG2\\TUG2N004#Lt. Christensen is fumbling for his phaser",
+ "#TUG2\\TUG2N005#McCoy is looking at the guards.",
+ "#TUG2\\TUG2N006#Phaser Welder is now charged.",
+ "#TUG2\\TUG2N007#Spock raises an eyebrow.",
+ "#TUG2\\TUG2N009#The wire scraps are too small, they melt instead of fusing together, and you're left with nothing. ",
+ "#TUG2\\TUG2N010#These wires look like a modification of some sort.",
+ "#TUG2\\TUG2N011#This appears to be the button that turns the brig forcefield on and off.",
+ "#TUG2\\TUG2N012#This door leads back to the main corridor.",
+ "#TUG2\\TUG2N013#This guard is stunned.",
+ "#TUG2\\TUG2N014#This guard is stunned.",
+ "#TUG2\\TUG2N015#This guard is tied up.",
+ "#TUG2\\TUG2N016#This guard is tied up.",
+ "#TUG2\\TUG2N017#You are in the brig of the Masada. Nine of the crew members are held in the cell. The berets of two dead Elasi guards litter the floor.",
+ "#TUG2\\TUG2N018#You are in the brig of the Masada. Nine of the crew members are held in the cell. Two Elasi guards lie on the floor.",
+ "#TUG2\\TUG2N019#You are in the brig of the Masada. The cell contains the smoldering remains of nine crew members. The berets of two dead Elasi guards litter the floor.",
+ "#TUG2\\TUG2N020#You are in the brig of the Masada. The cell contains the smoldering remains of nine crew members. Two Elasi guards lie on the floor.",
+ "#TUG2\\TUG2N021#You are in the brig of the Masada. The cell is open freeing the nine crew members. Two Elasi guards lie on the floor.",
+ "#TUG2\\TUG2N022#You are in the brig of the Masada. The cell is open freeing the nine crew members. The hats of two dead Elasi guards litter the floor.",
+ "#TUG2\\TUG2N023#You are in the brig of the Masada.",
+ "#TUG2\\TUG2N024#You can't. it is located just inside the forcefield.",
+ "#TUG2\\TUG2N025#You have been taken captive by Elasi Cereth, and you know Starfleet does not negotiate with terrorists. As you look forward to a long captivity, you wonder who will take over command of the Enterprise. Better luck next time.",
+ "#TUG2\\TUG2N026#You've set off some type of booby trap. The force field protected you from the blast, but everyone inside the brig is dead.",
+ "#TUG2\\TUG2N037#He doesn't look to friendly.",
+ "#TUG2\\TUG2N106#Only the red beret of the elasi guard remains.",
+ "Snip...snip...snip.",
};
}
Commit: 688c98890929acf4fb6a43a115e28f250fb7d466
https://github.com/scummvm/scummvm/commit/688c98890929acf4fb6a43a115e28f250fb7d466
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fix some uninitialized variables
Changed paths:
engines/startrek/graphics.cpp
engines/startrek/object.h
engines/startrek/startrek.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 145a156..fc37154 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -51,6 +51,9 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_palData = new byte[256 * 3];
_lutData = new byte[256 * 3];
+ memset(_palData, 0, 256 * 3);
+ memset(_lutData, 0, 256 * 3);
+
_paletteFadeLevel = 0;
_mouseLocked = false;
_mouseToBeShown = false;
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index 6a79116..9259788 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -122,6 +122,50 @@ struct Actor {
uint16 fielda2;
uint16 fielda4;
uint16 fielda6;
+
+public:
+ Actor() :
+ spriteDrawn(),
+ //animFilename[16],
+ animType(),
+ sprite(),
+ //bitmapFilename[10],
+ scale(),
+ animFile(),
+ numAnimFrames(),
+ animFrame(),
+ frameToStartNextAnim(),
+ pos(),
+ field60(),
+ field62(),
+ triggerActionWhenAnimFinished(),
+ finishedAnimActionParam(),
+ //animationString2[8](),
+ field70(),
+ field72(),
+ field74(),
+ field76(),
+ iwSrcPosition(),
+ iwDestPosition(),
+ granularPosX(),
+ granularPosY(),
+ speedX(),
+ speedY(),
+
+ dest(),
+ field90(),
+ field92(),
+
+ direction(),
+ field94(),
+ field96(),
+ //char animationString[10];
+
+ fielda2(),
+ fielda4(),
+ fielda6()
+ {}
+
};
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index c623c1b..82ac94e 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -1134,7 +1134,7 @@ bool StarTrekEngine::walkActiveObjectToHotspot() {
int objectIndex;
if (_awayMission.activeAction != ACTION_USE)
objectIndex = OBJECT_KIRK;
- else if (_awayMission.activeObject >= OBJECT_KIRK && _awayMission.activeObject <= OBJECT_REDSHIRT)
+ else if (_awayMission.activeObject <= OBJECT_REDSHIRT)
objectIndex = _awayMission.activeObject;
else if (_awayMission.activeObject >= ITEMS_START && _awayMission.activeObject <= ITEMS_END) { // FIXME: "<= ITEMS_END" doesn't make sense?
if (_awayMission.activeObject == OBJECT_ISTRICOR)
Commit: a4b67dabf68dcbb24dabe07270519625357d4be3
https://github.com/scummvm/scummvm/commit/a4b67dabf68dcbb24dabe07270519625357d4be3
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Change spawn room back to room 0
Changed paths:
engines/startrek/awaymission.cpp
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 585f789..341624b 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -37,11 +37,11 @@ void StarTrekEngine::initAwayMission() {
// sub_23a60(); // TODO
_sound->loadMusicFile("ground");
- loadRoom(_missionToLoad, 2); // FIXME
+ loadRoom(_missionToLoad, _roomIndexToLoad);
_roomIndexToLoad = -1;
// Load crew positions for beaming in
- initAwayCrewPositions(3);
+ initAwayCrewPositions(4);
}
void StarTrekEngine::runAwayMission() {
Commit: d0033df8ea3148160c0e96f7d33067ce843a9371
https://github.com/scummvm/scummvm/commit/d0033df8ea3148160c0e96f7d33067ce843a9371
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fix animations underneath textboxes
Changed paths:
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/menu.cpp
engines/startrek/startrek.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index fc37154..f369c11 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -258,25 +258,23 @@ void Graphics::warpMouse(int16 x, int16 y) {
_mouseWarpY = y;
}
-void Graphics::drawSprite(const Sprite &sprite) {
+void Graphics::drawSprite(const Sprite &sprite, ::Graphics::Surface *surface) {
int left = sprite.drawX;
int top = sprite.drawY;
int right = left + sprite.bitmap->width;
int bottom = top + sprite.bitmap->height;
- drawSprite(sprite, Common::Rect(left, top, right, bottom));
+ drawSprite(sprite, surface, Common::Rect(left, top, right, bottom));
}
// rect is the portion of the sprite to update. It must be entirely contained within the
// sprite's actual, full rectangle.
-void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
+void Graphics::drawSprite(const Sprite &sprite, ::Graphics::Surface *surface, const Common::Rect &rect) {
Common::Rect spriteRect = Common::Rect(sprite.drawX, sprite.drawY,
sprite.drawX+sprite.bitmap->width, sprite.drawY+sprite.bitmap->height);
assert(_screenRect.contains(rect));
assert(spriteRect.contains(rect));
- ::Graphics::Surface *surface = _vm->_system->lockScreen();
-
byte *dest = (byte*)surface->getPixels() + rect.top*SCREEN_WIDTH + rect.left;
switch(sprite.drawMode) {
@@ -342,12 +340,14 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
// The sprite's "bitmap" is not actually a bitmap, but instead the list of
// characters to display.
+ // Units of this rect are "characters" instead of pixels. This contains all
+ // characters to be drawn.
Common::Rect rectangle1;
rectangle1.left = (rect.left - sprite.drawX) / 8;
rectangle1.top = (rect.top - sprite.drawY) / 8;
- rectangle1.right = (rect.right - sprite.drawX) / 8;
- rectangle1.bottom = (rect.bottom - sprite.drawY) / 8;
+ rectangle1.right = (rect.right - sprite.drawX + 7) / 8;
+ rectangle1.bottom = (rect.bottom - sprite.drawY + 7) / 8;
int drawWidth = rectangle1.width();
int drawHeight = rectangle1.height();
@@ -402,8 +402,6 @@ void Graphics::drawSprite(const Sprite &sprite, const Common::Rect &rect) {
error("drawSprite: draw mode %d invalid", sprite.drawMode);
break;
}
-
- _vm->_system->unlockScreen();
}
/**
@@ -495,13 +493,17 @@ void Graphics::drawAllSprites(bool updateScreen) {
}
// Redraw the background on every dirty rectangle
+ const ::Graphics::PixelFormat format = ::Graphics::PixelFormat::createFormatCLUT8();
+ ::Graphics::Surface surface;
+ surface.create(SCREEN_WIDTH, SCREEN_HEIGHT, format);
+
for (int i = 0; i < numDirtyRects; i++) {
Common::Rect &r = dirtyRects[i];
if (r.width() == 0 || r.height() == 0)
continue;
int offset = r.top * SCREEN_WIDTH + r.left;
- _vm->_system->copyRectToScreen(_backgroundImage->pixels+offset, SCREEN_WIDTH, r.left, r.top, r.width(), r.height());
+ surface.copyRectToSurface(_backgroundImage->pixels + offset, SCREEN_WIDTH, r.left, r.top, r.width(), r.height());
}
// For each sprite, merge the rectangles that overlap with it and redraw the sprite.
@@ -525,7 +527,7 @@ void Graphics::drawAllSprites(bool updateScreen) {
}
if (mustRedrawSprite)
- drawSprite(*spr, rect2);
+ drawSprite(*spr, &surface, rect2);
}
spr->field16 = false;
@@ -533,6 +535,13 @@ void Graphics::drawAllSprites(bool updateScreen) {
spr->lastDrawRect = spr->drawRect;
}
+ // Copy dirty rects to screen
+ for (int j = 0; j < numDirtyRects; j++) {
+ Common::Rect &r = dirtyRects[j];
+ int offset = r.left + r.top * SCREEN_WIDTH;
+ _vm->_system->copyRectToScreen((byte *)surface.getPixels() + offset, SCREEN_WIDTH, r.left, r.top, r.width(), r.height());
+ }
+
if (updateScreen) {
// Check if there are any pending updates to the mouse.
if (_mouseBitmap != _mouseBitmapLastFrame) {
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 49d2a3a..37ac7da 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -73,8 +73,9 @@ public:
SharedPtr<Bitmap> getMouseBitmap();
void warpMouse(int16 x, int16 y);
- void drawSprite(const Sprite &sprite);
- void drawSprite(const Sprite &sprite, const Common::Rect &rect);
+ void drawTextChar(::Graphics::Surface *surface, const Sprite &sprite, int x, int y, const Common::Rect &rect);
+ void drawSprite(const Sprite &sprite, ::Graphics::Surface *surface);
+ void drawSprite(const Sprite &sprite, ::Graphics::Surface *surface, const Common::Rect &rect);
void drawAllSprites(bool updateScreen=true);
void forceDrawAllSprites(bool updateScreen=true);
Sprite *getSpriteAt(int16 x, int16 y);
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index 84f6f28..4de519d 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -676,7 +676,7 @@ int StarTrekEngine::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4
// Not added: updating mouse position (scummvm handles that)
// sub_10492(); // TODO
- // updateActorAnimations(); // TODO: uncomment and fix animations under textboxes
+ updateActorAnimations();
_gfx->drawAllSprites();
// sub_10BE7(); // TODO
_sound->checkLoopMusic();
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 82ac94e..7b3f428 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -29,7 +29,10 @@
#include "common/events.h"
#include "common/file.h"
#include "common/macresman.h"
+
+#include "graphics/pixelformat.h"
#include "graphics/surface.h"
+
#include "engines/util.h"
#include "video/qt_decoder.h"
@@ -104,7 +107,8 @@ Common::Error StarTrekEngine::run() {
assert(_macResFork->hasDataFork() && _macResFork->hasResFork());
}
- initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT);
+ const ::Graphics::PixelFormat format = ::Graphics::PixelFormat::createFormatCLUT8();
+ initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT, &format);
initializeEventsAndMouse();
_frameIndex = 0;
Commit: 3d27a9a92cc7bcf88f58aa8f4b2639573bb5e697
https://github.com/scummvm/scummvm/commit/3d27a9a92cc7bcf88f58aa8f4b2639573bb5e697
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Initialize strings in actor objects
Changed paths:
engines/startrek/object.h
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index 9259788..18e2145 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -164,7 +164,12 @@ public:
fielda2(),
fielda4(),
fielda6()
- {}
+ {
+ memset(animFilename, 0, sizeof(animFilename));
+ memset(bitmapFilename, 0, sizeof(bitmapFilename));
+ memset(animationString2, 0, sizeof(animationString2));
+ memset(animationString, 0, sizeof(animationString));
+ }
};
Commit: 6e322ebfc5279ee16076b07b82a1dc2c44122b26
https://github.com/scummvm/scummvm/commit/6e322ebfc5279ee16076b07b82a1dc2c44122b26
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: TUG3 (mission 2 finished)
Changed paths:
A engines/startrek/rooms/tug3.cpp
engines/startrek/awaymission.h
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/tug0.cpp
engines/startrek/rooms/tug2.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index aa581d8..b649477 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -99,10 +99,13 @@ struct AwayMission {
struct {
int16 missionScore; // 0x29
int16 field2b; // 0x2b
- int16 field2d; // 0x2d;
+ int16 field2d; // 0x2d
bool engineerConscious; // 0x30
byte field35; // 0x35
bool gotWires; // 0x37
+ byte orbitalDecayCounter; // 0x3b
+ bool bridgeElasiDrewPhasers; // 0x3d
+ bool talkedToCereth; // 0x3e
bool gotJunkPile; // 0x3f
bool gotTransmogrifier; // 0x43
bool transporterRepaired; // 0x44
@@ -111,16 +114,27 @@ struct AwayMission {
bool bridgeForceFieldDown; // 0x47
bool savedPrisoners; // 0x48
bool haveBomb; // 0x49
- bool field4a; // 0x4a
+ bool brigElasiPhasersOnKill; // 0x4a
byte field4b; // 0x4b
byte guard1Status; // 0x4c
byte guard2Status; // 0x4d
byte field4e; // 0x4e
- bool crewmanKilled[4]; // 0x4f
+ byte crewmanKilled[4]; // 0x4f
+ byte bridgeElasi1Status; // 0x53
+ byte bridgeElasi2Status; // 0x54
+ byte bridgeElasi3Status; // 0x55
+ byte bridgeElasi4Status; // 0x56
bool brigForceFieldDown; // 0x58
byte field59; // 0x59
byte field5b; // 0x5b
+ bool elasiSurrendered; // 0x5c
byte kirkPhaserDrawn; // 0x5d
+
+ // 1: Decided to shoot them
+ // 2: Talked, and they surrendered immediately
+ // 3: They deorbited the ship (and perhps surrendered after)
+ byte bridgeWinMethod; // 0x5e
+
bool talkedToBrigCrewman; // 0x5f
} tug;
};
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index b3fed14..acf696f 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -29,6 +29,7 @@ MODULE_OBJS = \
rooms/tug0.o \
rooms/tug1.o \
rooms/tug2.o \
+ rooms/tug3.o \
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index cc07488..844b8c3 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -77,6 +77,10 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_roomActionList = tug2ActionList;
_numRoomActions = sizeof(tug2ActionList) / sizeof(RoomAction);
}
+ else if (name == "TUG3") {
+ _roomActionList = tug3ActionList;
+ _numRoomActions = sizeof(tug3ActionList) / sizeof(RoomAction);
+ }
else {
warning("Room \"%s\" unimplemented", name.c_str());
_numRoomActions = 0;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 1523f33..1127de8 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -672,6 +672,44 @@ public:
void tug2UseMTricorderOnOpenBrig();
void tug2UsePhaserAnywhere();
+ // TUG3
+ void tug3Tick1();
+ void tug3Tick40();
+ void tug3LookAnywhere();
+ void tug3ElasiSurrendered();
+ void tug3UsePhaserAnywhere();
+ void tug3ElasiDrawPhasers();
+ void tug3UseStunPhaserOnElasi1();
+ void tug3UseStunPhaserOnElasi2();
+ void tug3UseStunPhaserOnElasi3();
+ void tug3UseStunPhaserOnElasi4();
+ void tug3UseKillPhaserOnElasi1();
+ void tug3UseKillPhaserOnElasi2();
+ void tug3UseKillPhaserOnElasi3();
+ void tug3UseKillPhaserOnElasi4();
+ void tug3ElasiStunnedOrKilled();
+ void tug3TalkToElasi1();
+ void tug3Elasi1DrewPhaser();
+ void tug3Elasi1ShotConsole();
+ void tug3Elasi1DrewPhaser2();
+ void tug3Elasi1ShotConsoleAndSurrenders();
+ void tug3LookAtMccoy();
+ void tug3LookAtSpock();
+ void tug3LookAtRedshirt();
+ void tug3LookAtElasi1();
+ void tug3LookAtElasi2();
+ void tug3LookAtElasi3();
+ void tug3LookAtElasi4();
+ void tug3TalkToMccoy();
+ void tug3TalkToSpock();
+ void tug3TalkToRedshirt();
+ void tug3UseCommunicator();
+ void tug3Timer0Expired();
+ void tug3AllCrewmenDead();
+ void tug3Timer1Expired();
+ void tug3EndMission();
+ void tug3SecurityTeamBeamedIn();
+
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
@@ -732,7 +770,7 @@ private:
byte shootingObject; // 0x1ec1
byte shootingTarget;
bool elasiPhaserOnKill;
- byte _1ec4; // 0x1ec4
+ byte shootKirkOverride; // 0x1ec4
} tug2;
} _roomVar;
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index a88214c..0eb8d97 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -650,7 +650,6 @@ RoomAction tug1ActionList[] = {
{ Action(ACTION_USE, OBJECT_IMEDKIT, 0x20, 0), &Room::tug1UseMedkitOnBridgeDoor },
{ Action(ACTION_USE, OBJECT_IMEDKIT, 0x21, 0), &Room::tug1UseMedkitOnBridgeDoor },
{ Action(ACTION_USE, OBJECT_IMEDKIT, 0x22, 0), &Room::tug1UseMedkitOnBridgeDoor },
-
};
@@ -745,6 +744,44 @@ RoomAction tug2ActionList[] = {
{ Action(ACTION_USE, OBJECT_IPHASERK, -1, 0), &Room::tug2UsePhaserAnywhere },
};
+
+RoomAction tug3ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::tug3Tick1 },
+ { Action(ACTION_TICK, 40, 0, 0), &Room::tug3Tick40 },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::tug3LookAnywhere },
+ { Action(ACTION_USE, OBJECT_IPHASERS, -1, 0), &Room::tug3UsePhaserAnywhere },
+ { Action(ACTION_USE, OBJECT_IPHASERK, -1, 0), &Room::tug3UsePhaserAnywhere },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::tug3UseStunPhaserOnElasi1 },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 9, 0), &Room::tug3UseStunPhaserOnElasi2 },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 10, 0), &Room::tug3UseStunPhaserOnElasi3 },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 11, 0), &Room::tug3UseStunPhaserOnElasi4 },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::tug3UseKillPhaserOnElasi1 },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 9, 0), &Room::tug3UseKillPhaserOnElasi2 },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 10, 0), &Room::tug3UseKillPhaserOnElasi3 },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 11, 0), &Room::tug3UseKillPhaserOnElasi4 },
+ { Action(ACTION_FINISHED_ANIMATION, 12, 0, 0), &Room::tug3ElasiStunnedOrKilled },
+ { Action(ACTION_TALK, 8, 0, 0), &Room::tug3TalkToElasi1 },
+ { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::tug3Elasi1DrewPhaser },
+ { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::tug3Elasi1ShotConsole },
+ { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::tug3Elasi1DrewPhaser2 },
+ { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::tug3Elasi1ShotConsoleAndSurrenders },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::tug3LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::tug3LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::tug3LookAtRedshirt },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::tug3LookAtElasi1 },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::tug3LookAtElasi2 },
+ { Action(ACTION_LOOK, 10, 0, 0), &Room::tug3LookAtElasi3 },
+ { Action(ACTION_LOOK, 11, 0, 0), &Room::tug3LookAtElasi4 },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::tug3TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::tug3TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::tug3TalkToRedshirt },
+ { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::tug3UseCommunicator },
+ { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::tug3Timer0Expired },
+ { Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::tug3AllCrewmenDead },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::tug3Timer1Expired },
+ { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::tug3SecurityTeamBeamedIn },
+};
+
}
#endif
diff --git a/engines/startrek/rooms/tug0.cpp b/engines/startrek/rooms/tug0.cpp
index e90544d..4461b22 100644
--- a/engines/startrek/rooms/tug0.cpp
+++ b/engines/startrek/rooms/tug0.cpp
@@ -142,14 +142,19 @@ void Room::tug0SpockFinishedUsingWire() {
showText(TX_SPEAKER_KIRK, TX_TUG0_010);
showText(TX_SPEAKER_MCCOY, TX_TUG0_022);
- showText(TX_SPEAKER_KIRK, TX_TUG0_002);
- showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L009);
- showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L008);
-
- if (_vm->_awayMission.tug.haveBomb) {
- showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L010);
- showText(TX_SPEAKER_MCCOY, TX_TUG0_021);
- showText(TX_SPEAKER_SPOCK, TX_TUG0_041);
+
+ // BUGFIX: check if the redshirt is dead.
+ if (!_vm->_awayMission.redshirtDead) {
+ showText(TX_SPEAKER_KIRK, TX_TUG0_002);
+
+ showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L009);
+ showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L008);
+
+ if (_vm->_awayMission.tug.haveBomb) {
+ showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L010);
+ showText(TX_SPEAKER_MCCOY, TX_TUG0_021);
+ showText(TX_SPEAKER_SPOCK, TX_TUG0_041);
+ }
}
}
diff --git a/engines/startrek/rooms/tug2.cpp b/engines/startrek/rooms/tug2.cpp
index e89aff7..3c6aad2 100644
--- a/engines/startrek/rooms/tug2.cpp
+++ b/engines/startrek/rooms/tug2.cpp
@@ -481,7 +481,7 @@ void Room::tug2UseKillPhaserOnGuard1() {
else {
loadActorAnim2(OBJECT_KIRK, "kdrawe", -1, -1, 24);
_vm->_awayMission.tug.kirkPhaserDrawn = true;
- _vm->_awayMission.tug.field4a = true;
+ _vm->_awayMission.tug.brigElasiPhasersOnKill = true;
}
}
}
@@ -509,7 +509,7 @@ void Room::tug2UseKillPhaserOnGuard2() {
else {
loadActorAnim2(OBJECT_KIRK, "kdrawe", -1, -1, 25);
_vm->_awayMission.tug.kirkPhaserDrawn = true;
- _vm->_awayMission.tug.field4a = true;
+ _vm->_awayMission.tug.brigElasiPhasersOnKill = true;
}
}
}
@@ -624,7 +624,7 @@ void Room::tug2Timer0Expired() {
return;
_roomVar.tug2.elasiPhaserOnKill = 0;
- if (_vm->_awayMission.tug.field4a)
+ if (_vm->_awayMission.tug.brigElasiPhasersOnKill)
_roomVar.tug2.elasiPhaserOnKill = 1;
switch (_vm->_awayMission.tug.field4b) {
@@ -659,14 +659,14 @@ void Room::tug2Timer0Expired() {
case 2:
// Guard shoots spock (or kirk)
_vm->_awayMission.tug.field4b++;
- _roomVar.tug2._1ec4 = 0;
- if (_vm->_awayMission.tug.field4a)
- _roomVar.tug2._1ec4 = 1;
+ _roomVar.tug2.shootKirkOverride = false;
+ if (_vm->_awayMission.tug.brigElasiPhasersOnKill)
+ _roomVar.tug2.shootKirkOverride = true;
tug2DetermineElasiShooter();
- if (_roomVar.tug2._1ec4 == 0)
- _roomVar.tug2.shootingTarget = OBJECT_SPOCK;
- else
+ if (_roomVar.tug2.shootKirkOverride)
_roomVar.tug2.shootingTarget = OBJECT_KIRK;
+ else
+ _roomVar.tug2.shootingTarget = OBJECT_SPOCK;
_vm->_awayMission.timers[0] = 60;
tug2GuardShootsCrewman();
break;
@@ -683,16 +683,16 @@ void Room::tug2Timer0Expired() {
case 4:
_vm->_awayMission.tug.field4b++;
- if (_roomVar.tug2._1ec4 == 0) {
+ if (_roomVar.tug2.shootKirkOverride) {
tug2DetermineElasiShooter();
- _roomVar.tug2.shootingTarget = OBJECT_KIRK;
- _vm->_awayMission.timers[2] = 40; // TODO
+ _roomVar.tug2.shootingTarget = OBJECT_SPOCK;
+ _vm->_awayMission.timers[2] = 40;
tug2GuardShootsCrewman();
}
- else if (_roomVar.tug2._1ec4 == 1) {
+ else if (_roomVar.tug2.shootKirkOverride) {
tug2DetermineElasiShooter();
- _roomVar.tug2.shootingTarget = OBJECT_SPOCK;
- _vm->_awayMission.timers[2] = 40;
+ _roomVar.tug2.shootingTarget = OBJECT_KIRK;
+ _vm->_awayMission.timers[2] = 40; // TODO
tug2GuardShootsCrewman();
}
break;
diff --git a/engines/startrek/rooms/tug3.cpp b/engines/startrek/rooms/tug3.cpp
new file mode 100644
index 0000000..6c1b674
--- /dev/null
+++ b/engines/startrek/rooms/tug3.cpp
@@ -0,0 +1,504 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+#define OBJECT_ELASI_1 8
+#define OBJECT_ELASI_2 9
+#define OBJECT_ELASI_3 10
+#define OBJECT_ELASI_4 11
+#define OBJECT_12 12
+#define OBJECT_13 13
+#define OBJECT_14 14
+#define OBJECT_15 15
+
+#define GUARDSTAT_UP 0
+#define GUARDSTAT_STUNNED 1
+#define GUARDSTAT_DEAD 2
+#define GUARDSTAT_SURRENDERED 4
+#define GUARDSTAT_TIED 8
+
+void Room::tug3Tick1() {
+ playVoc("TUG3LOOP");
+
+ _vm->_awayMission.disableWalking = true;
+ loadActorAnim2(OBJECT_ELASI_1, "p1turn", 0xa4, 0x98, 0);
+ loadActorAnim2(OBJECT_ELASI_2, "p2turn", 0xd1, 0x88, 0);
+ loadActorAnim2(OBJECT_ELASI_3, "p3turn", 0xfb, 0xc4, 0);
+ loadActorAnim2(OBJECT_ELASI_4, "p4turn", 0x5a, 0x9e, 0);
+}
+
+void Room::tug3Tick40() {
+ loadActorAnim2(OBJECT_KIRK, "kdraws", -1, -1, 0); // Draw phaser
+}
+
+void Room::tug3LookAnywhere() {
+ showText(TX_TUG3N007);
+}
+
+void Room::tug3ElasiSurrendered() {
+ // BUGFIX: the original game had the condition below. However, this would cause
+ // problems if you start shooting, then get them to surrender; if timed correctly,
+ // they could shoot Kirk as he's beaming out and the mission is "successful". To
+ // prevent that, the below condition is removed in ScummVM.
+ /*
+ if (_vm->_awayMission.tug.bridgeElasiDrewPhasers)
+ return;
+ */
+
+ // Also part of the bugfix (stop shooting)
+ _vm->_awayMission.timers[0] = 0;
+
+ _vm->_awayMission.tug.elasiSurrendered = true;
+ loadActorAnim2(OBJECT_ELASI_1, "p1surr", -1, -1, 0);
+ _vm->_awayMission.tug.bridgeElasi1Status = GUARDSTAT_SURRENDERED;
+
+ if (_vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_UP) {
+ loadActorAnim2(OBJECT_ELASI_2, "p2surr", -1, -1, 0);
+ _vm->_awayMission.tug.bridgeElasi2Status = GUARDSTAT_SURRENDERED;
+ }
+ if (_vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_UP) {
+ loadActorAnim2(OBJECT_ELASI_3, "p3surr", -1, -1, 0);
+ _vm->_awayMission.tug.bridgeElasi3Status = GUARDSTAT_SURRENDERED;
+ }
+ if (_vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_UP) {
+ loadActorAnim2(OBJECT_ELASI_4, "p4surr", -1, -1, 0);
+ _vm->_awayMission.tug.bridgeElasi4Status = GUARDSTAT_SURRENDERED;
+ }
+
+ _vm->_awayMission.tug.missionScore += 4;
+}
+
+void Room::tug3UsePhaserAnywhere() {
+ // Stub function to suppress "you can't do that" messages
+}
+
+void Room::tug3ElasiDrawPhasers() {
+ if (_vm->_awayMission.tug.bridgeElasiDrewPhasers)
+ return;
+
+ _vm->_awayMission.tug.bridgeElasiDrewPhasers = true;
+
+ // If brig guards are alive & untied, kill the hostages
+ if (_vm->_awayMission.tug.guard1Status == 0 || _vm->_awayMission.tug.guard2Status == 0) {
+ showText(TX_SPEAKER_ELASI_CLANSMAN, TX_TUG3L081);
+ _vm->_awayMission.tug.missionScore = 0;
+ }
+
+ if (_vm->_awayMission.timers[0] == 0)
+ _vm->_awayMission.timers[0] = 10;
+
+ // Make all elasi draw their phasers
+ if (_vm->_awayMission.tug.bridgeElasi1Status == 0)
+ loadActorAnim2(OBJECT_ELASI_1, "p1draw", -1, -1, 0);
+ if (_vm->_awayMission.tug.bridgeElasi2Status == 0)
+ loadActorAnim2(OBJECT_ELASI_2, "p2draw", -1, -1, 0);
+ if (_vm->_awayMission.tug.bridgeElasi3Status == 0)
+ loadActorAnim2(OBJECT_ELASI_3, "p3draw", -1, -1, 0);
+ if (_vm->_awayMission.tug.bridgeElasi4Status == 0)
+ loadActorAnim2(OBJECT_ELASI_4, "p4draw", -1, -1, 0);
+}
+
+void Room::tug3UseStunPhaserOnElasi1() {
+ if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi1Status != GUARDSTAT_UP)
+ return;
+ loadActorAnim2(OBJECT_ELASI_1, "p1stun", -1, -1, 12);
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t3beem05", 5);
+ _vm->_awayMission.tug.bridgeElasi1Status = GUARDSTAT_STUNNED;
+ tug3ElasiDrawPhasers();
+}
+
+void Room::tug3UseStunPhaserOnElasi2() {
+ if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi2Status != GUARDSTAT_UP)
+ return;
+ loadActorAnim2(OBJECT_ELASI_2, "p2stun", -1, -1, 12);
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t3beem06", 5);
+ _vm->_awayMission.tug.bridgeElasi2Status = GUARDSTAT_STUNNED;
+ tug3ElasiDrawPhasers();
+}
+
+void Room::tug3UseStunPhaserOnElasi3() {
+ if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi3Status != GUARDSTAT_UP)
+ return;
+ loadActorAnim2(OBJECT_ELASI_3, "p3stun", -1, -1, 12);
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t3beem07", 5);
+ _vm->_awayMission.tug.bridgeElasi3Status = GUARDSTAT_STUNNED;
+ tug3ElasiDrawPhasers();
+}
+
+void Room::tug3UseStunPhaserOnElasi4() {
+ if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi4Status != GUARDSTAT_UP)
+ return;
+ loadActorAnim2(OBJECT_ELASI_4, "p4stun", -1, -1, 12);
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t3beem04", 5);
+ _vm->_awayMission.tug.bridgeElasi4Status = GUARDSTAT_STUNNED;
+ tug3ElasiDrawPhasers();
+}
+
+void Room::tug3UseKillPhaserOnElasi1() {
+ if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi1Status != GUARDSTAT_UP)
+ return;
+ loadActorAnim2(OBJECT_ELASI_1, "p1Kill", -1, -1, 12);
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t3beem25", 5);
+ _vm->_awayMission.tug.bridgeElasi1Status = GUARDSTAT_DEAD;
+ _vm->_awayMission.tug.missionScore -= 2;
+ tug3ElasiDrawPhasers();
+}
+
+void Room::tug3UseKillPhaserOnElasi2() {
+ if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi2Status != GUARDSTAT_UP)
+ return;
+ loadActorAnim2(OBJECT_ELASI_2, "p2Kill", -1, -1, 12);
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t3beem27", 5);
+ _vm->_awayMission.tug.bridgeElasi2Status = GUARDSTAT_DEAD;
+ _vm->_awayMission.tug.missionScore -= 2;
+ tug3ElasiDrawPhasers();
+}
+
+void Room::tug3UseKillPhaserOnElasi3() {
+ if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi3Status != GUARDSTAT_UP)
+ return;
+ loadActorAnim2(OBJECT_ELASI_3, "p3Kill", -1, -1, 12);
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t3beem26", 5);
+ _vm->_awayMission.tug.bridgeElasi3Status = GUARDSTAT_DEAD;
+ _vm->_awayMission.tug.missionScore -= 2;
+ tug3ElasiDrawPhasers();
+}
+
+void Room::tug3UseKillPhaserOnElasi4() {
+ if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi4Status != GUARDSTAT_UP)
+ return;
+ loadActorAnim2(OBJECT_ELASI_4, "p4Kill", -1, -1, 12);
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t3beem24", 5);
+ _vm->_awayMission.tug.bridgeElasi4Status = GUARDSTAT_DEAD;
+ _vm->_awayMission.tug.missionScore -= 2;
+ tug3ElasiDrawPhasers();
+}
+
+void Room::tug3ElasiStunnedOrKilled() {
+ if (_vm->_awayMission.tug.bridgeWinMethod == 1)
+ return;
+ if (_vm->_awayMission.tug.bridgeElasi1Status == GUARDSTAT_UP || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_UP
+ || _vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_UP || _vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_UP)
+ return;
+
+ // BUGFIX: if the ship is deorbiting, the mission isn't won yet.
+ if (_vm->_awayMission.tug.orbitalDecayCounter != 0)
+ return;
+
+ _vm->_awayMission.tug.bridgeWinMethod = 1;
+ tug3EndMission();
+}
+
+void Room::tug3TalkToElasi1() {
+ if (_vm->_awayMission.tug.bridgeElasi1Status != GUARDSTAT_UP || _vm->_awayMission.tug.talkedToCereth)
+ return;
+ _vm->_awayMission.tug.talkedToCereth = true;
+
+ const int choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_TUG3_004,
+ TX_TUG3_003,
+ TX_TUG3_002,
+ TX_BLANK
+ };
+ int choice = showText(choices);
+
+ switch (choice) {
+ case 0: // They surrender
+ showText(TX_SPEAKER_ELASI_CERETH, TX_TUG3L084);
+ _vm->_awayMission.tug.bridgeElasi1Status = GUARDSTAT_SURRENDERED;
+ loadActorAnim2(OBJECT_ELASI_1, "p1surr", -1, -1, 0);
+ tug3ElasiSurrendered();
+ _vm->_awayMission.tug.bridgeWinMethod = 2;
+ _vm->_awayMission.tug.missionScore += 8;
+ tug3EndMission();
+ break;
+
+ case 1: // Cereth shoots console, doesn't surrender
+ _vm->_awayMission.disableInput = true;
+ showText(TX_SPEAKER_ELASI_CERETH, TX_TUG3_F27);
+ loadActorAnim2(OBJECT_ELASI_1, "p1draw", -1, -1, 3);
+ break;
+
+ case 2: // Cereth shoots console and surrenders
+ _vm->_awayMission.disableInput = true;
+ showText(TX_SPEAKER_ELASI_CERETH, TX_TUG3L083);
+ loadActorAnim2(OBJECT_ELASI_1, "p1draw", -1, -1, 5);
+
+ // BUGFIX: they're going to surrender, so stop the firefight.
+ _vm->_awayMission.timers[0] = 0;
+ break;
+ }
+}
+
+void Room::tug3Elasi1DrewPhaser() {
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t3beem41", 13);
+ playSoundEffectIndex(SND_BLANK_16);
+ loadActorAnim2(OBJECT_12, "sparks", 0xa0, 0xad, 4);
+}
+
+void Room::tug3Elasi1ShotConsole() {
+ tug3ElasiDrawPhasers();
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.tug.bridgeWinMethod = 3;
+ _vm->_awayMission.timers[1] = 10;
+}
+
+void Room::tug3Elasi1DrewPhaser2() {
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t3beem41", 13);
+ loadActorAnim2(OBJECT_12, "sparks", 0xa0, 0xad, 6);
+}
+
+void Room::tug3Elasi1ShotConsoleAndSurrenders() {
+ showText(TX_SPEAKER_ELASI_CERETH, TX_TUG3L080);
+ tug3ElasiSurrendered();
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.tug.bridgeWinMethod = 3;
+ _vm->_awayMission.timers[1] = 10;
+}
+
+void Room::tug3LookAtMccoy() {
+ showText(TX_TUG3N000);
+}
+
+void Room::tug3LookAtSpock() {
+ showText(TX_TUG3N002);
+}
+
+void Room::tug3LookAtRedshirt() {
+ showText(TX_TUG3N001);
+}
+
+void Room::tug3LookAtElasi1() {
+ // BUGFIX: there were two implementations of this function; the first was the same as
+ // the other 3 elasi, the second was specific to the captain. The second was never
+ // called in the original game, but it's used here instead for more variety.
+ // The function itself is changed by checking both if he's stunned or if he's dead,
+ // instead of just checking if he's stunned.
+
+ if (_vm->_awayMission.tug.bridgeElasi1Status == GUARDSTAT_STUNNED || _vm->_awayMission.tug.bridgeElasi1Status == GUARDSTAT_DEAD)
+ showText(TX_TUG3N003);
+ else
+ showText(TX_TUG3N008);
+}
+
+void Room::tug3LookAtElasi2() {
+ // BUGFIX: also check if stunned. They can't "glare at the crewmembers" if they're
+ // unconscious. (applies to below functions too.)
+ if (_vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_DEAD || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_STUNNED)
+ showText(TX_TUG3N004);
+ else
+ showText(TX_TUG3N005);
+}
+
+void Room::tug3LookAtElasi3() {
+ if (_vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_DEAD || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_STUNNED)
+ showText(TX_TUG3N004);
+ else
+ showText(TX_TUG3N005);
+}
+
+void Room::tug3LookAtElasi4() {
+ if (_vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_DEAD || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_STUNNED)
+ showText(TX_TUG3N004);
+ else
+ showText(TX_TUG3N005);
+}
+
+void Room::tug3TalkToMccoy() {
+ if (_vm->_awayMission.tug.orbitalDecayCounter != 0 || _vm->_awayMission.tug.bridgeElasi1Status != GUARDSTAT_UP) {
+ if (_vm->_awayMission.tug.orbitalDecayCounter >= 10) {
+ if (_vm->_awayMission.tug.orbitalDecayCounter < 16)
+ showText(TX_SPEAKER_MCCOY, TX_TUG3_011);
+ }
+ else if (_vm->_awayMission.tug.orbitalDecayCounter != 0) {
+ // BUGFIX: original game displays a blank textbox. An appropriate audio file
+ // exists, but the corresponding text was written from scratch for ScummVM.
+ // TODO: check if original floppy version has text for this.
+ showText(TX_SPEAKER_MCCOY, TX_TUG3_012);
+ }
+ }
+ else
+ showText(TX_SPEAKER_MCCOY, TX_TUG3_013);
+}
+
+void Room::tug3TalkToSpock() {
+ if (_vm->_awayMission.tug.orbitalDecayCounter != 0) {
+ if (_vm->_awayMission.tug.orbitalDecayCounter >= 10) {
+ if (_vm->_awayMission.tug.orbitalDecayCounter < 16)
+ showText(TX_SPEAKER_SPOCK, TX_TUG3_008);
+ }
+ else
+ showText(TX_SPEAKER_SPOCK, TX_TUG3_009);
+ }
+}
+
+void Room::tug3TalkToRedshirt() {
+ showText(TX_SPEAKER_CHRISTENSEN, TX_TUG3L003);
+}
+
+void Room::tug3UseCommunicator() {
+ if (_vm->_awayMission.tug.orbitalDecayCounter == 0)
+ return;
+
+ if (_vm->_awayMission.tug.orbitalDecayCounter < 10) {
+ showText(TX_SPEAKER_KIRK, TX_TUG3_007);
+ showText(TX_SPEAKER_SULU, TX_TUG3_015);
+ showText(TX_SPEAKER_SHIPS_COMPUTER, TX_COMPA180);
+ _vm->_awayMission.timers[1] = 0;
+
+ // BUGFIX: if still fighting the elasi, the mission isn't done yet.
+ _vm->_awayMission.tug.orbitalDecayCounter = 0;
+ if (!_vm->_awayMission.tug.elasiSurrendered &&
+ (_vm->_awayMission.tug.bridgeElasi1Status == GUARDSTAT_UP
+ || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_UP
+ || _vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_UP
+ || _vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_UP))
+ return;
+
+ tug3EndMission();
+ }
+ else {
+ if (_vm->_awayMission.tug.orbitalDecayCounter < 16) {
+ showText(TX_SPEAKER_KIRK, TX_TUG3_006);
+ showText(TX_SPEAKER_SCOTT, TX_TUG3_S07);
+
+ playMidiMusicTracks(-1, -1);
+
+ _vm->_awayMission.disableInput = true;
+ if (_vm->_awayMission.tug.missionScore < 0)
+ _vm->_awayMission.tug.missionScore = 0;
+ endMission(_vm->_awayMission.tug.missionScore, _vm->_awayMission.tug.field2b, _vm->_awayMission.tug.field2d);
+ }
+ }
+}
+
+// One of the elasi shoots one of the crewmen
+void Room::tug3Timer0Expired() {
+ const char *beamAnims[][4] = {
+ { "t3beem33", "t3beem35", "t3beem34", "t3beem32" },
+ { "t3beem37", "t3beem39", "t3beem38", "t3beem36" },
+ { "t3beem29", "t3beem31", "t3beem30", "t3beem28" },
+ };
+
+ int elasiShooter, elasiTarget;
+
+ if (_vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_UP)
+ elasiShooter = 0;
+ else if (_vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_UP)
+ elasiShooter = 1;
+ else if (_vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_UP)
+ elasiShooter = 2;
+ else
+ return;
+
+ if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT]) {
+ _vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT] = 2;
+ _vm->_awayMission.redshirtDead = true;
+ loadActorAnim2(OBJECT_REDSHIRT, "rkills", -1, -1, 0);
+ elasiTarget = OBJECT_REDSHIRT;
+ }
+ else if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK]) {
+ _vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] = 2;
+ _vm->_awayMission.disableInput = true;
+ loadActorAnim2(OBJECT_KIRK, "kkills", -1, -1, 0);
+ elasiTarget = OBJECT_KIRK;
+ }
+ else if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_SPOCK]) {
+ _vm->_awayMission.tug.crewmanKilled[OBJECT_SPOCK] = 2;
+ loadActorAnim2(OBJECT_SPOCK, "skills", -1, -1, 0);
+ elasiTarget = OBJECT_SPOCK;
+ }
+ else if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY]) {
+ _vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY] = 2;
+ loadActorAnim2(OBJECT_MCCOY, "mkills", -1, -1, 13);
+ elasiTarget = OBJECT_MCCOY;
+ }
+ else
+ return;
+
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks(beamAnims[elasiShooter][elasiTarget], 5);
+ _vm->_awayMission.timers[0] = 50;
+}
+
+void Room::tug3AllCrewmenDead() {
+ playMidiMusicTracks(2, -1);
+ showGameOverMenu();
+}
+
+// "Orbital decay" countdown timer
+void Room::tug3Timer1Expired() {
+ if (_vm->_awayMission.tug.orbitalDecayCounter < 10) { // Decay still preventable
+ showText(TX_SPEAKER_SHIPS_COMPUTER, TX_COMPU182);
+ _vm->_awayMission.timers[1] = 100;
+ _vm->_awayMission.tug.orbitalDecayCounter++;
+ }
+ else if (_vm->_awayMission.tug.orbitalDecayCounter < 16) { // Decay now unavoidable
+ showText(TX_SPEAKER_SHIPS_COMPUTER, TX_COMPU181);
+ _vm->_awayMission.timers[1] = 100;
+ _vm->_awayMission.tug.orbitalDecayCounter++;
+ }
+ else { // Game over
+ showText(TX_TUG3N006);
+ showGameOverMenu();
+ }
+}
+
+void Room::tug3EndMission() {
+ playMidiMusicTracks(28, -1);
+ showText(TX_SPEAKER_KIRK, TX_TUG3_001);
+ playSoundEffectIndex(SND_TRANSMAT);
+ loadActorAnim2(OBJECT_13, "rteleb", 0x14, 0xa0, 7);
+ loadActorAnim2(OBJECT_14, "rteleb", 0x118, 0xa0, 0);
+ loadActorAnim2(OBJECT_15, "rteleb", 0x96, 0xbe, 0);
+}
+
+void Room::tug3SecurityTeamBeamedIn() {
+ loadActorAnim2(OBJECT_13, "rdrawe", -1, -1, 8);
+ loadActorAnim2(OBJECT_14, "rdraws", -1, -1, 9);
+ loadActorAnim2(OBJECT_15, "rfiren", -1, -1, 10);
+
+ showText(TX_SPEAKER_KIRK, TX_TUG3_005);
+ showText(TX_SPEAKER_SCOTT, TX_TUG3_S08);
+
+ playMidiMusicTracks(-1, -1);
+ _vm->_awayMission.disableInput = true;
+ if (_vm->_awayMission.tug.missionScore < 0)
+ _vm->_awayMission.tug.missionScore = 0;
+ endMission(_vm->_awayMission.tug.missionScore, _vm->_awayMission.tug.field2b, _vm->_awayMission.tug.field2d);
+}
+
+}
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index b56a20a..1a9e182 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -66,6 +66,8 @@ enum GameStringIDs {
TX_SPEAKER_MCCOY,
TX_SPEAKER_UHURA,
TX_SPEAKER_SCOTT,
+ TX_SPEAKER_SULU,
+ TX_SPEAKER_SHIPS_COMPUTER,
TX_SPEAKER_EVERTS,
TX_SPEAKER_ANGIVEN,
@@ -81,6 +83,8 @@ enum GameStringIDs {
TX_SPEAKER_CHRISTENSEN,
TX_SPEAKER_SIMPSON,
TX_SPEAKER_ELASI_GUARD,
+ TX_SPEAKER_ELASI_CLANSMAN,
+ TX_SPEAKER_ELASI_CERETH,
TX_SPEAKER_MASADA_CREWMAN,
TX_DEM0_001,
@@ -674,6 +678,41 @@ enum GameStringIDs {
TX_TUG2C001, // Custom
+ TX_COMPA180,
+ TX_COMPU181,
+ TX_COMPU182,
+ TX_TUG3_001,
+ TX_TUG3_002,
+ TX_TUG3_003,
+ TX_TUG3_004,
+ TX_TUG3_005,
+ TX_TUG3_006,
+ TX_TUG3_007,
+ TX_TUG3_008,
+ TX_TUG3_009,
+ TX_TUG3_011,
+ TX_TUG3_012,
+ TX_TUG3_013,
+ TX_TUG3_015,
+ TX_TUG3_F27,
+ TX_TUG3_S07,
+ TX_TUG3_S08,
+ TX_TUG3L003,
+ TX_TUG3L080,
+ TX_TUG3L081,
+ TX_TUG3L083,
+ TX_TUG3L084,
+ TX_TUG3N000,
+ TX_TUG3N001,
+ TX_TUG3N002,
+ TX_TUG3N003,
+ TX_TUG3N004,
+ TX_TUG3N005,
+ TX_TUG3N006,
+ TX_TUG3N007,
+ TX_TUG3N008,
+
+
TX_END
};
@@ -687,6 +726,8 @@ const char * const g_gameStrings[] = {
"Dr. McCoy",
"Lt. Uhura",
"Mr. Scott",
+ "Mr. Sulu",
+ "Ship's Computer",
"Ensign Everts",
"Prel. Angiven",
@@ -702,6 +743,8 @@ const char * const g_gameStrings[] = {
"Lt. Christensen",
"Crewman Simpson",
"Elasi Guard",
+ "Elasi Clansman",
+ "Elasi Cereth",
"Masada Crewman",
"#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?",
@@ -1138,7 +1181,7 @@ const char * const g_gameStrings[] = {
"#TUG0\\TUG0_017#He will be all right, but we shouldn't move him.",
"#TUG0\\TUG0_018#He's not hurt badly. I can revive him.",
"#TUG0\\TUG0_019#I don't think he should be moved, Jim.",
- "#TUG0\\TUG0_020#Well, at least I'm not picking up residue of any biologicalweapons. The Elasi used some restraint if you can call it that.",
+ "#TUG0\\TUG0_020#Well, at least I'm not picking up residue of any biological weapons. The Elasi used some restraint if you can call it that.",
"#TUG0\\TUG0_021#And any hostages on the bridge will be killed when the bomb goes off! No, Jim, that's inhuman!",
"#TUG0\\TUG0_022#I wouldn't go that far, Jim. But I do have to congratulate you, Mr. Spock. Now we can really risk shooting our atoms around the universe. Is this really necessary, Jim?",
"#TUG0\\TUG0_023#My God Jim, what have you done! You killed them all. You probably blew up the whole damn bridge.",
@@ -1194,7 +1237,7 @@ const char * const g_gameStrings[] = {
"#TUG1\\TUG1_004#Jim, I can only perform medical miracles not engineering ones.",
"#TUG1\\TUG1_005#Jim, I'm picking up 11 life forms in the brig. That accounts for over half the crew. I don't like what that indicates.",
"#TUG1\\TUG1_006#Nothing unusual is detected.",
- "#TUG1\\TUG1_007#The force field is interfering too much to get an accurate reading, Jim",
+ "#TUG1\\TUG1_007#The force field is interfering too much to get an accurate reading, Jim.", // TYPO
"#TUG1\\TUG1_008#My daddy would have sent me to bed without supper if I'd done something like this.",
"#TUG1\\TUG1_009#Five phasers without power packs, a drained phaser welder, insulation and bits of wire, and droplets of cooled molten metal.",
"#TUG1\\TUG1_010#I don't think we can bring down that forcefield, Captain. If we could, though, it might be less risky than trying to transport onto the bridge.",
@@ -1293,6 +1336,41 @@ const char * const g_gameStrings[] = {
"#TUG2\\TUG2N037#He doesn't look to friendly.",
"#TUG2\\TUG2N106#Only the red beret of the elasi guard remains.",
"Snip...snip...snip.",
+
+
+ "#COMP\\COMPA180#Orbit Stabilized. Warning Cancelled.", // FIXME
+ "#COMP\\COMPU181#Warning. Orbital Decay is now irreversible. Abandon Ship. Abandon Ship.",
+ "#COMP\\COMPU182#Warning. Orbital decay detected. Warning.",
+ "#TUG3\\TUG3_001#Scotty, beam down a security team to the bridge. We have regained control.",
+ "#TUG3\\TUG3_002#Check and mate, Elasi. Don't do anything foolish.",
+ "#TUG3\\TUG3_003#Freeze, don't even think about it.",
+ "#TUG3\\TUG3_004#It's over, Cereth. Surrender and I'll guarantee the lives of you and your crew.",
+ "#TUG3\\TUG3_005#Mr. Scott, beam us out of here.",
+ "#TUG3\\TUG3_006#Mr. Scott, get us out of here.",
+ "#TUG3\\TUG3_007#Mr. Sulu, we need some help over here.",
+ "#TUG3\\TUG3_008#Captain, I highly recommend returning to the Enterprise within the next 57.32 seconds.",
+ "#TUG3\\TUG3_009#Captain, I recommend that Mr. Sulu stabilize the Masada's orbit from the Enterprise.",
+ "#TUG3\\TUG3_011#I think we should return to the Enterprise before we burn up, Jim.",
+ "#TUG3\\TUG3_012#I'm a doctor, not a space jockey! Talk to Mr. Sulu about fixing our orbit!",
+ "#TUG3\\TUG3_013#Jim, that man is mad.",
+ "#TUG3\\TUG3_015#Aye, Captain, using prefix code override to stabilize Masada's orbit. Sulu out.",
+ "#TUG3\\TUG3_F27#Foolhardy words, Kirk. You have underestimated me at every turn.",
+ "#TUG3\\TUG3_S07#Aye, Captain.",
+ "#TUG3\\TUG3_S08#Aye, Captain.",
+ "#TUG3\\TUG3L003#I'm just a security officer, sir.",
+ "#TUG3\\TUG3L080#A blow struck for freedom, Captain. Now I surrender.",
+ "#TUG3\\TUG3L081#Bridge to brig, kill the hostages!",
+ "#TUG3\\TUG3L083#I still have a gambit or two left, my friend.",
+ "#TUG3\\TUG3L084#You are an honorable and worthy opponent, Kirk. I accept your offer.",
+ "#TUG3\\TUG3N000#Dr. McCoy appears a bit restless.",
+ "#TUG3\\TUG3N001#Lt. Christensen is carefully observing Elasi.",
+ "#TUG3\\TUG3N002#Spock is analyzing the surroundings.",
+ "#TUG3\\TUG3N003#The body of Elasi Cereth lies on the ground.",
+ "#TUG3\\TUG3N004#The body of the Elasi clanmember lies on the ground here.",
+ "#TUG3\\TUG3N005#The Elasi clanmember glares at the party.",
+ "#TUG3\\TUG3N006#The Masada goes down in a fireball over Beta Myamid, with you on it. Better luck next season.",
+ "#TUG3\\TUG3N007#This is a standard Starfleet bridge, perhaps not as impressive as the one on the Enterprise. There are quite a few pirates here.",
+ "#TUG3\\TUG3N008#You carefully eye the chief lieutenant of the Elasi Clan, Elasi Cereth.",
};
}
Commit: efda57c114ecbf62b4d5b76c12e648837d814cdb
https://github.com/scummvm/scummvm/commit/efda57c114ecbf62b4d5b76c12e648837d814cdb
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: LOVE0 (start of 3rd mission)
Changed paths:
A engines/startrek/rooms/love0.cpp
engines/startrek/action.h
engines/startrek/awaymission.h
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
index 15d3ea1..af27177 100644
--- a/engines/startrek/action.h
+++ b/engines/startrek/action.h
@@ -35,7 +35,7 @@ enum Acton {
ACTION_TALK = 5,
ACTION_TOUCHED_WARP = 6,
- ACTION_TOUCHED_HOTSPOT = 7, // Doors? (Or just hotspots activated by Kirk moving there?)
+ ACTION_TOUCHED_HOTSPOT = 7, // Second kind of "hotspot" only relevant when an object touches them
ACTION_TIMER_EXPIRED = 8,
ACTION_FINISHED_ANIMATION = 10,
ACTION_FINISHED_WALKING = 12,
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index b649477..3fca387 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -137,6 +137,19 @@ struct AwayMission {
bool talkedToBrigCrewman; // 0x5f
} tug;
+
+ // Love's Labor Jeopardized
+ struct {
+ bool alreadyStartedMission; // 0x29
+ bool knowAboutVirus; // 0x2a
+ bool field2c; // 0x2c
+ bool field2d; // 0x2d
+ byte field36; // 0x36
+ byte field37; // 0x37
+ bool spockAccessedConsole; // 0x49
+ bool mccoyAccessedConsole; // 0x4a
+ int16 missionScore; // 0x52
+ } love;
};
};
// Size: 0x129 bytes
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index acf696f..85a31df 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -30,6 +30,7 @@ MODULE_OBJS = \
rooms/tug1.o \
rooms/tug2.o \
rooms/tug3.o \
+ rooms/love0.o \
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 844b8c3..245edb7 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -81,6 +81,10 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_roomActionList = tug3ActionList;
_numRoomActions = sizeof(tug3ActionList) / sizeof(RoomAction);
}
+ else if (name == "LOVE0") {
+ _roomActionList = love0ActionList;
+ _numRoomActions = sizeof(love0ActionList) / sizeof(RoomAction);
+ }
else {
warning("Room \"%s\" unimplemented", name.c_str());
_numRoomActions = 0;
@@ -327,6 +331,13 @@ Common::Point Room::getActorPos(int actorIndex) {
return _vm->_actorList[actorIndex].pos;
}
+/**
+ * Returns a word in range [start, end] (that's inclusive).
+ */
+int16 Room::getRandomWordInRange(int start, int end) {
+ return _vm->getRandomWord() % (end - start + 1) + start;
+}
+
void Room::playSoundEffectIndex(int soundEffect) {
_vm->playSoundEffectIndex(soundEffect);
}
@@ -368,23 +379,27 @@ void Room::playVoc(Common::String filename) {
_vm->_sound->playVoc(filename);
}
-void Room::spockScan(int direction, int text) {
+void Room::spockScan(int direction, int text, bool changeDirection) {
const char *dirs = "nsew";
Common::String anim = "sscan_";
anim.setChar(dirs[direction], 5);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = direction;
+ if (changeDirection) // Check whether he should turn back to original direction after scanning
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = direction;
+
loadActorAnim2(OBJECT_SPOCK, anim, -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_SPOCK, text);
}
-void Room::mccoyScan(int direction, int text) {
+void Room::mccoyScan(int direction, int text, bool changeDirection) {
const char *dirs = "nsew";
Common::String anim = "mscan_";
anim.setChar(dirs[direction], 5);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = direction;
+ if (changeDirection)
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = direction;
+
loadActorAnim2(OBJECT_MCCOY, anim, -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_MCCOY, text);
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 1127de8..660af0f 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -113,6 +113,7 @@ private:
void showBitmapFor5Ticks(const Common::String &bmpName, int priority); // Cmd 0x0a
// Command 0x0c: "demon6ShowCase"
Common::Point getActorPos(int actorIndex); // Cmd 0x0d
+ int16 getRandomWordInRange(int start, int end); // Cmd 0x0e
void playSoundEffectIndex(int soundEffect); // Cmd 0x0f
void playMidiMusicTracks(int startTrack, int loopTrack); // Cmd 0x10
void endMission(int16 score, int16 arg2, int16 arg3); // Cmd 0x11
@@ -120,8 +121,8 @@ private:
void playVoc(Common::String filename); // Cmd 0x15
// Helper functions for repetitive stuff
- void spockScan(int direction, int text);
- void mccoyScan(int direction, int text);
+ void spockScan(int direction, int text, bool changeDirection = true);
+ void mccoyScan(int direction, int text, bool changeDirection = true);
// Room-specific code
public:
@@ -710,6 +711,41 @@ public:
void tug3EndMission();
void tug3SecurityTeamBeamedIn();
+ // LOVE0
+ void love0Tick1();
+ void love0Tick10();
+ void love0WalkToDoor2();
+ void love0OpenDoor2();
+ void love0ReachedDoor2();
+ void love0WalkToDoor1();
+ void love0OpenDoor1();
+ void love0ReachedDoor1();
+ void love0LookAtConsole();
+ void love0LookAtViewscreen();
+ void love0LookAnywhere();
+ void love0LookAtDoor1();
+ void love0LookAtDoor2();
+ void love0LookAtKirk();
+ void love0LookAtMccoy();
+ void love0LookAtSpock();
+ void love0LookAtRedshirt();
+ void love0TalkToKirk();
+ void love0TalkToMccoy();
+ void love0TalkToSpock();
+ void love0TalkToRedshirt();
+ void love0UseMTricorderAnywhere();
+ void love0UseSTricorderOnConsole();
+ void love0UseSTricorderAnywhere();
+ void love0UseKirkOnConsole();
+ void love0UseRedshirtOnConsole();
+ void love0UseSpockOnConsole();
+ void love0SpockReachedConsole();
+ void love0SpockAccessedConsole();
+ void love0UseMccoyOnConsole();
+ void love0MccoyReachedConsole();
+ void love0MccoyAccessedConsole();
+ void love0InteractWithConsole();
+
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
@@ -773,6 +809,21 @@ private:
byte shootKirkOverride; // 0x1ec4
} tug2;
+ struct {
+ bool heardSummaryOfVirus; // 0xda
+ byte door2OpenCounter; // 0xdc
+ byte door1OpenCounter; // 0xdd
+ byte _de; // 0xde
+
+ int16 consoleCrewman; // 0xe3
+ char consoleAnimation[10]; // 0xe5
+ int32 consoleSpeaker; // 0xe7
+ int32 consoleText; // 0xe9
+
+ byte _8ab; // 0x8ab
+ byte _8ac; // 0x8ac
+ } love0;
+
} _roomVar;
};
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 0eb8d97..dcf8bf3 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -744,7 +744,6 @@ RoomAction tug2ActionList[] = {
{ Action(ACTION_USE, OBJECT_IPHASERK, -1, 0), &Room::tug2UsePhaserAnywhere },
};
-
RoomAction tug3ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::tug3Tick1 },
{ Action(ACTION_TICK, 40, 0, 0), &Room::tug3Tick40 },
@@ -782,6 +781,48 @@ RoomAction tug3ActionList[] = {
{ Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::tug3SecurityTeamBeamedIn },
};
+
+RoomAction love0ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::love0Tick1 },
+ { Action(ACTION_TICK, 10, 0, 0), &Room::love0Tick10 },
+ { Action(ACTION_WALK, 0x21, 0, 0), &Room::love0WalkToDoor2 },
+ { Action(ACTION_WALK, 9, 0, 0), &Room::love0WalkToDoor2 },
+ { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::love0OpenDoor2 },
+ { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::love0ReachedDoor2 },
+ { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love0ReachedDoor2 },
+ { Action(ACTION_WALK, 0x22, 0, 0), &Room::love0WalkToDoor1 },
+ { Action(ACTION_WALK, 8, 0, 0), &Room::love0WalkToDoor1 },
+ { Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::love0OpenDoor1 },
+ { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::love0ReachedDoor1 },
+ { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love0ReachedDoor1 },
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::love0LookAtConsole },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::love0LookAtViewscreen },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::love0LookAnywhere },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::love0LookAtDoor1 },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::love0LookAtDoor2 },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::love0LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::love0LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::love0LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::love0LookAtRedshirt },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::love0TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::love0TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::love0TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::love0TalkToRedshirt },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::love0UseMTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::love0UseSTricorderOnConsole },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::love0UseSTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::love0UseKirkOnConsole },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::love0UseRedshirtOnConsole },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::love0UseSpockOnConsole },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::love0SpockReachedConsole },
+ { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::love0SpockAccessedConsole },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::love0UseMccoyOnConsole },
+ { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::love0MccoyReachedConsole },
+ { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love0MccoyAccessedConsole },
+ // TODO: there's a lot of "extra" stuff at the end of the file. I don't think it's
+ // unused, but I'm not sure how it's run.
+};
+
}
#endif
diff --git a/engines/startrek/rooms/love0.cpp b/engines/startrek/rooms/love0.cpp
new file mode 100644
index 0000000..7ab161a
--- /dev/null
+++ b/engines/startrek/rooms/love0.cpp
@@ -0,0 +1,274 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR1 8
+#define OBJECT_DOOR2 9
+
+#define HOTSPOT_CONSOLE 0x20
+#define HOTSPOT_DOOR2 0x21
+#define HOTSPOT_DOOR1 0x22
+#define HOTSPOT_VIEWSCREEN 0x23
+
+namespace StarTrek {
+
+void Room::love0Tick1() {
+ if (!_vm->_awayMission.love.alreadyStartedMission) {
+ _vm->_awayMission.love.field36 = 1;
+ _vm->_awayMission.love.field37 = 2;
+ _vm->_awayMission.love.alreadyStartedMission = true;
+ playVoc("LOV0LOOP"); // FIXME: no audio after first entry?
+ }
+
+ if (_vm->_awayMission.love.field2c)
+ _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
+ if (_vm->_awayMission.love.field2d)
+ _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
+ _vm->_awayMission.timers[2] = 200;
+
+ loadActorAnim(OBJECT_DOOR2, "s3r0d2a", 0xe6, 0x80, 0);
+ loadActorAnim(OBJECT_DOOR1, "s3r0d1a", 0x123, 0x8d, 0);
+ _roomVar.love0._8ab = 0xf4;
+ _roomVar.love0._8ac = 0x8f;
+}
+
+void Room::love0Tick10() {
+}
+
+void Room::love0WalkToDoor2() {
+ _vm->_awayMission.disableInput = true;
+ _roomVar.love0._de = 2;
+ walkCrewman(OBJECT_KIRK, 0xe6, 0x81, 4);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love0OpenDoor2() {
+ if (_roomVar.love0._de == 2) {
+ loadActorAnim(OBJECT_DOOR2, "s3r0d2", 0xe6, 0x80, 3);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+}
+
+void Room::love0ReachedDoor2() {
+ _roomVar.love0.door2OpenCounter++;
+ if (_roomVar.love0.door2OpenCounter == 2)
+ loadRoomIndex(2, 1);
+}
+
+void Room::love0WalkToDoor1() {
+ _vm->_awayMission.disableInput = true;
+ _roomVar.love0._de = 1;
+ walkCrewman(OBJECT_KIRK, 0x125, 0x8d, 5);
+}
+
+void Room::love0OpenDoor1() {
+ if (_roomVar.love0._de == 1) {
+ loadActorAnim(OBJECT_DOOR1, "s3r0d1", 0x123, 0x8d, 4);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+}
+
+void Room::love0ReachedDoor1() {
+ _roomVar.love0.door1OpenCounter++;
+ if (_roomVar.love0.door1OpenCounter == 2)
+ loadRoomIndex(3, 1);
+}
+
+void Room::love0LookAtConsole() {
+ showText(TX_LOV0N006);
+}
+
+void Room::love0LookAtViewscreen() {
+ showText(TX_LOV0N000);
+}
+
+void Room::love0LookAnywhere() {
+ showText(TX_LOV0N009);
+}
+
+void Room::love0LookAtDoor1() {
+ showText(TX_LOV0N008);
+}
+
+void Room::love0LookAtDoor2() {
+ showText(TX_LOV0N007);
+}
+
+void Room::love0LookAtKirk() {
+ showText(TX_LOV0N002);
+}
+
+void Room::love0LookAtMccoy() {
+ showText(TX_LOV0N004);
+}
+
+void Room::love0LookAtSpock() {
+ showText(TX_LOV0N005);
+}
+
+void Room::love0LookAtRedshirt() {
+ showText(TX_LOV0N003);
+}
+
+void Room::love0TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_LOV0_003);
+}
+
+void Room::love0TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV0_007);
+}
+
+void Room::love0TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_LOV0_027);
+}
+
+void Room::love0TalkToRedshirt() {
+ showText(TX_SPEAKER_FERRIS, TX_LOV0_038);
+}
+
+void Room::love0UseMTricorderAnywhere() {
+ if (_vm->_awayMission.love.knowAboutVirus)
+ mccoyScan(DIR_N, TX_LOV0_008, false);
+ else
+ mccoyScan(DIR_N, TX_LOV0_006, false);
+}
+
+void Room::love0UseSTricorderOnConsole() {
+ spockScan(DIR_N, TX_LOV0_031, false);
+}
+
+void Room::love0UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_LOV0_028, false);
+}
+
+void Room::love0UseKirkOnConsole() {
+ showText(TX_SPEAKER_KIRK, TX_LOV0_002);
+ love0UseSpockOnConsole();
+}
+
+void Room::love0UseRedshirtOnConsole() {
+ showText(TX_SPEAKER_FERRIS, TX_LOV0_036);
+}
+
+void Room::love0UseSpockOnConsole() {
+ _roomVar.love0.consoleCrewman = OBJECT_SPOCK;
+ _roomVar.love0.consoleSpeaker = TX_SPEAKER_SPOCK;
+ _roomVar.love0.consoleText = TX_LOV0_005;
+ strcpy(_roomVar.love0.consoleAnimation, "susemn");
+
+ walkCrewman(_roomVar.love0.consoleCrewman, 0x9a, 0x9a, 2);
+ if (!_vm->_awayMission.love.spockAccessedConsole) {
+ _vm->_awayMission.love.spockAccessedConsole = true;
+ _vm->_awayMission.love.missionScore += 4;
+ }
+}
+
+void Room::love0SpockReachedConsole() {
+ loadActorAnim2(_roomVar.love0.consoleCrewman, _roomVar.love0.consoleAnimation, -1, -1, 5);
+}
+
+void Room::love0SpockAccessedConsole() {
+ playVoc("V6KIRKTY");
+ if (_vm->_awayMission.love.knowAboutVirus)
+ love0InteractWithConsole();
+ else {
+ showText(TX_SPEAKER_COMPUTER, TX_COMPU188);
+ showText(_roomVar.love0.consoleSpeaker, _roomVar.love0.consoleText);
+ _roomVar.love0.heardSummaryOfVirus = true;
+ }
+}
+
+void Room::love0UseMccoyOnConsole() {
+ walkCrewman(OBJECT_MCCOY, 0x78, 0x98, 3);
+}
+
+void Room::love0MccoyReachedConsole() {
+ loadActorAnim2(OBJECT_MCCOY, "musemw", -1, -1, 6);
+}
+
+void Room::love0MccoyAccessedConsole() {
+ playVoc("V6KIRKTY");
+ if (!_vm->_awayMission.love.mccoyAccessedConsole) {
+ _vm->_awayMission.love.mccoyAccessedConsole = true;
+ _vm->_awayMission.love.missionScore += 2;
+ }
+
+ if (_vm->_awayMission.love.knowAboutVirus)
+ love0InteractWithConsole();
+ else {
+ if (!_roomVar.love0.heardSummaryOfVirus) {
+ showText(TX_SPEAKER_COMPUTER, TX_COMPU188);
+ _roomVar.love0.heardSummaryOfVirus = true;
+ }
+ showText(TX_SPEAKER_MCCOY, TX_LOV0_024);
+ showText(TX_SPEAKER_SPOCK, TX_LOV0_035);
+ showText(TX_SPEAKER_MCCOY, TX_LOV0_023);
+ showText(TX_SPEAKER_KIRK, TX_LOV0_004);
+ showText(TX_SPEAKER_MCCOY, TX_LOV0_009);
+ _vm->_awayMission.love.knowAboutVirus = true;
+ }
+}
+
+// Interact with computer console, by selecting topics for the computer to talk about
+void Room::love0InteractWithConsole() {
+ const int choices[] = {
+ TX_SPEAKER_COMPUTER,
+ TX_COMPA190,
+ TX_COMPA193,
+ TX_COMPA189,
+ TX_COMPA186,
+ TX_COMPA187,
+ TX_COMPA191,
+ TX_BLANK
+ };
+
+ while (true) {
+ showText(TX_SPEAKER_COMPUTER, TX_COMPU192);
+ int choice = showText(choices);
+
+ switch (choice) {
+ case 0:
+ showText(TX_SPEAKER_COMPUTER, TX_COMPU190);
+ break;
+ case 1:
+ showText(TX_SPEAKER_COMPUTER, TX_COMPU193);
+ break;
+ case 2:
+ showText(TX_SPEAKER_COMPUTER, TX_COMPU189);
+ break;
+ case 3:
+ showText(TX_SPEAKER_COMPUTER, TX_COMPU186);
+ break;
+ case 4:
+ showText(TX_SPEAKER_COMPUTER, TX_COMPU187);
+ break;
+ case 5:
+ return;
+ default:
+ showText(TX_DIALOG_ERROR);
+ break;
+ }
+ }
+}
+
+}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 7b3f428..4fd6b40 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -83,7 +83,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxVar6 = 0;
_textboxHasMultipleChoices = false;
- _missionToLoad = "TUG";
+ _missionToLoad = "LOVE";
_roomIndexToLoad = 0;
for (int i = 0; i < NUM_OBJECTS; i++)
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 1a9e182..c71dcb7 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -67,7 +67,6 @@ enum GameStringIDs {
TX_SPEAKER_UHURA,
TX_SPEAKER_SCOTT,
TX_SPEAKER_SULU,
- TX_SPEAKER_SHIPS_COMPUTER,
TX_SPEAKER_EVERTS,
TX_SPEAKER_ANGIVEN,
@@ -79,6 +78,7 @@ enum GameStringIDs {
TX_SPEAKER_ROBERTS,
TX_SPEAKER_GRISNASH,
TX_SPEAKER_NAUIAN,
+ TX_SPEAKER_SHIPS_COMPUTER,
TX_SPEAKER_CHRISTENSEN,
TX_SPEAKER_SIMPSON,
@@ -87,6 +87,9 @@ enum GameStringIDs {
TX_SPEAKER_ELASI_CERETH,
TX_SPEAKER_MASADA_CREWMAN,
+ TX_SPEAKER_FERRIS,
+ TX_SPEAKER_COMPUTER,
+
TX_DEM0_001,
TX_DEM0_002,
TX_DEM0_003,
@@ -713,6 +716,107 @@ enum GameStringIDs {
TX_TUG3N008,
+ TX_BRIDU146,
+ TX_COMPA186,
+ TX_COMPA187,
+ TX_COMPA189,
+ TX_COMPA190,
+ TX_COMPA191,
+ TX_COMPA193,
+ TX_COMPU186,
+ TX_COMPU187,
+ TX_COMPU188,
+ TX_COMPU189,
+ TX_COMPU190,
+ TX_COMPU192,
+ TX_COMPU193,
+ TX_GENER004,
+ TX_LOV0_001,
+ TX_LOV0_002,
+ TX_LOV0_003,
+ TX_LOV0_004,
+ TX_LOV0_005,
+ TX_LOV0_006,
+ TX_LOV0_007,
+ TX_LOV0_008,
+ TX_LOV0_009,
+ TX_LOV0_010,
+ TX_LOV0_011,
+ TX_LOV0_012,
+ TX_LOV0_013,
+ TX_LOV0_014,
+ TX_LOV0_015,
+ TX_LOV0_016,
+ TX_LOV0_017,
+ TX_LOV0_019,
+ TX_LOV0_020,
+ TX_LOV0_021,
+ TX_LOV0_022,
+ TX_LOV0_023,
+ TX_LOV0_024,
+ TX_LOV0_025,
+ TX_LOV0_026,
+ TX_LOV0_027,
+ TX_LOV0_028,
+ TX_LOV0_029,
+ TX_LOV0_030,
+ TX_LOV0_031,
+ TX_LOV0_033,
+ TX_LOV0_035,
+ TX_LOV0_036,
+ TX_LOV0_037,
+ TX_LOV0_038,
+ TX_LOV0_039,
+ TX_LOV0_040,
+ TX_LOV0_041,
+ TX_LOV0_042,
+ TX_LOV0_043,
+ TX_LOV0_045,
+ TX_LOV0_046,
+ TX_LOV0_047,
+ TX_LOV0_048,
+ TX_LOV0_049,
+ TX_LOV0_050,
+ TX_LOV0_101,
+ TX_LOV0_102,
+ TX_LOV0_103,
+ TX_LOV0_104,
+ TX_LOV0_105,
+ TX_LOV0_106,
+ TX_LOV0_107,
+ TX_LOV0_124,
+ TX_LOV0N000,
+ TX_LOV0N001,
+ TX_LOV0N002,
+ TX_LOV0N003,
+ TX_LOV0N004,
+ TX_LOV0N005,
+ TX_LOV0N006,
+ TX_LOV0N007,
+ TX_LOV0N008,
+ TX_LOV0N009,
+ TX_LOV2N005,
+ TX_LOV5_015,
+ TX_LOV5_019,
+ TX_LOV5_027,
+ TX_LOV5_030,
+ TX_LOV5_038,
+ TX_LOVA_100,
+ TX_LOVA_F01,
+ TX_LOVA_F02,
+ TX_LOVA_F03,
+ TX_LOVA_F04,
+ TX_LOVA_F07,
+ TX_LOVA_F08,
+ TX_LOVA_F10,
+ TX_LOVA_F54,
+ TX_LOVA_F55,
+ TX_MUD2_040,
+ TX_MUD4_018,
+ TX_spokcoff,
+ TX_VENA_F41,
+
+
TX_END
};
@@ -727,7 +831,6 @@ const char * const g_gameStrings[] = {
"Lt. Uhura",
"Mr. Scott",
"Mr. Sulu",
- "Ship's Computer",
"Ensign Everts",
"Prel. Angiven",
@@ -739,6 +842,7 @@ const char * const g_gameStrings[] = {
"Brother Roberts",
"Brother Grisnash",
"Nauian",
+ "Ship's Computer",
"Lt. Christensen",
"Crewman Simpson",
@@ -747,6 +851,9 @@ const char * const g_gameStrings[] = {
"Elasi Cereth",
"Masada Crewman",
+ "Lt. Ferris",
+ "Computer",
+
"#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?",
"#DEM0\\DEM0_002#Aside from seeing demons, has any hard data been collected? Any evidence I could see?",
"#DEM0\\DEM0_003#Been seeing ghosts and bogeymen eh? I find that a little hard to believe.",
@@ -1371,6 +1478,107 @@ const char * const g_gameStrings[] = {
"#TUG3\\TUG3N006#The Masada goes down in a fireball over Beta Myamid, with you on it. Better luck next season.",
"#TUG3\\TUG3N007#This is a standard Starfleet bridge, perhaps not as impressive as the one on the Enterprise. There are quite a few pirates here.",
"#TUG3\\TUG3N008#You carefully eye the chief lieutenant of the Elasi Clan, Elasi Cereth.",
+
+
+ "#BRID\\BRIDU146#Nothing to report, Captain.",
+ "#COMP\\COMPA186#Ammonia",
+ "#COMP\\COMPA187#Di-hydrogen Oxide",
+ "#COMP\\COMPA189#Nitrous Oxide",
+ "#COMP\\COMPA190#Oroborus Virus",
+ "#COMP\\COMPA191#Exit Database",
+ "#COMP\\COMPA193#TLTDH Gas",
+ "#COMP\\COMPU186#Ammonia: a colorless pungent compound NH3, a common byproduct of metabolism in carbon-based lifeforms. Liquid or gaseous at 1 atm. Compounds widely used in agricultural, medical and industrial applications.",
+ "#COMP\\COMPU187#Di-hydrogen Oxide: a colorless, tasteless, nonflammable compound HO- water. Liquid, solid, or gaseous at 1 atm. Temperature scales defined in most humanoid cultures by state-shift of pure water.",
+ "#COMP\\COMPU188#Dr. Marcus' Log, Supplemental: Continued testing of the Oroborus Virus confirms its potential harmful effects on Romulan/Vulcan humanoids. As soon as the spill has been cleaned up, we will sterilize both labs and purge the circulation system to make sure no traces of the virus will remain viable. Then all research files must be erased -- we must leave no chance that this terrible accident will ever be repeated.",
+ "#COMP\\COMPU189#Nitrous Oxide: a colorless nonflammable compound NO, gaseous at 1 atm and temperatures within the human norm. Early anesthetic among humans, in whom it produces laughter, feelings of exhiliration, euphoria; sometimes leading to unconsciousness.",
+ "#COMP\\COMPU190#Oroborus virus: Atypical growth patterns for L-Type virus. Opportunistic pneumococcal mimic affecting Romulo-Vulcan genotype. Etiology: contact or airborne vector with alveoli microcollapse involvement immediately upon exposure. Tissue dehydration follows pneumal flooding. Mortality: 0.6 in 1.0 stardates, 1.0 within 2.0 stardates Treatment: none. Named for the mythic worldsnake that swallows its own tail.",
+ "#COMP\\COMPU192#Please select subject file...",
+ "#COMP\\COMPU193#TLTDH gas: The chemical compound tantalum bi-lithium thalo-dihydroxide. Colorless, odorless, nonflammable gaseous at 1 atm and temperatures within the human norm. Early anesthetic among Vulcans and Romulans, in whom it produces laughter, feelings of exhiliration, euphoria; sometimes leading to unconsciousness. In post-industrial/pre-spaceflight era, a social problem evolved when crude TLTDH became popular to \"cook up\" from non-conductive tantalo-lithial compounds commonly used as electrical insulation.",
+ "#GENE\\GENER004#Game Over",
+ "#LOV0\\LOV0_001#A medical data file is attached -- your bailiwick, Bones.",
+ "#LOV0\\LOV0_002#Spock, check out the station's computer and see what you can dig up.",
+ "#LOV0\\LOV0_003#Strange that the bridge is empty. Stay sharp everyone. The station's computer system might give us some answers.",
+ "#LOV0\\LOV0_004#Gentlemen, I think we have more pressing problems.",
+ "#LOV0\\LOV0_005#Doctor, you may be interested in the medical data file appended to the log.",
+ "#LOV0\\LOV0_006#I'm picking up some strange, airborne virus. I can't identify it without more information.",
+ "#LOV0\\LOV0_007#Nice view of the Romulan ship. How comforting.",
+ "#LOV0\\LOV0_008#Except for the Oroborus virus, I'm not picking up anything unusual.",
+ "#LOV0\\LOV0_009#Jim, there is an appended medical database online. Also, it would be useful for me to experiment on how the virus grows in the presence of different gases. I'm sure the station has the necessary equipment.",
+ "#LOV0\\LOV0_010#Ouch!",
+ "#LOV0\\LOV0_011#Hee hee hee hee...",
+ "#LOV0\\LOV0_012#I think we're all feeling just woooonderful!",
+ "#LOV0\\LOV0_013#I'm a little teapot short and stout...",
+ "#LOV0\\LOV0_014#I'm floating up and up and up...",
+ "#LOV0\\LOV0_015#I'm so happy, I want to hug the world!",
+ "#LOV0\\LOV0_016#Ooka! Ooka! Ooka!",
+ "#LOV0\\LOV0_017#Row, row, row, your boat. Aww, come on Spock.",
+ "#LOV0\\LOV0_019#Spock, ol' buddy, ol' friend, you look soo funny standing there!",
+ "#LOV0\\LOV0_020#The hills are alive... With the sounds of...",
+ "#LOV0\\LOV0_021#The moon in June's a boon to tunes... er, something like that.",
+ "#LOV0\\LOV0_022#This is how I want to feel all the time!",
+ "#LOV0\\LOV0_023#Now listen here, you pointy-eared...",
+ "#LOV0\\LOV0_024#Now that's interesting -- there's more here. All of Dr. Marcus' research data on the Oroborous virus. Let me see...virus growth patterns, pneumonococcal mimic affecting Romulo-Vulcan genotype ... alveoli involvement in-- Boy, Jim, this bug works fast!",
+ "#LOV0\\LOV0_025#How many Admirals does it take to wire in a logic transmogrifier?",
+ "#LOV0\\LOV0_026#I don't believe you'd behave like this if you could avoid it.",
+ "#LOV0\\LOV0_027#Nothing unusual here, Captain, though the station's computer may be able to tell us something.",
+ "#LOV0\\LOV0_028#Nothing unusual is detected.",
+ "#LOV0\\LOV0_029#Please, gentlemen, try to control yourselves",
+ "#LOV0\\LOV0_030#That is not logical, Captain.",
+ "#LOV0\\LOV0_031#The main computer banks of the Ark7. It looks like someone has recently been rummaging through the main data banks.",
+ "#LOV0\\LOV0_033#Try taking deep breaths to clear your heads.",
+ "#LOV0\\LOV0_035#Is this really the time to catch up on your reading, Doctor?",
+ "#LOV0\\LOV0_036#I think Mr. Spock would be more qualified in examining the station's computer.",
+ "#LOV0\\LOV0_037#A detailed data file is with the log. Do you want to look at it, Doctor McCoy?",
+ "#LOV0\\LOV0_038#This is a very dangerous situation, sir. We should proceed with caution.",
+ "#LOV0\\LOV0_039#Hee hee hee hee...",
+ "#LOV0\\LOV0_040#I think we're all feeling just woooonderful!",
+ "#LOV0\\LOV0_041#I'm a little teapot short and stout...",
+ "#LOV0\\LOV0_042#I'm floating up and up and up...",
+ "#LOV0\\LOV0_043#I'm so happy, I want to hug the world!",
+ "#LOV0\\LOV0_045#Ooka! Ooka! Ooka!",
+ "#LOV0\\LOV0_046#Row, row, row, your boat. Aww, come on Spock.",
+ "#LOV0\\LOV0_047#Spock, ol' buddy, ol' friend, you look soo funny standing there!",
+ "#LOV0\\LOV0_048#The hills are alive... With the sounds of...",
+ "#LOV0\\LOV0_049#The moon in June's a boon to tunes... er, something like that.",
+ "#LOV0\\LOV0_050#This is how I want to feel all the time!",
+ "#LOV0\\LOV0_101#Fascinating. I am experiencing an urge to laugh.",
+ "#LOV0\\LOV0_102#I am a Vulcan. I must resist these unchecked emotions.",
+ "#LOV0\\LOV0_103#Logic...What happened to my logic?",
+ "#LOV0\\LOV0_104#Jim, is this how you feel on shore leave?",
+ "#LOV0\\LOV0_105#I remember my mother trying to tell me jokes when I was a child. Now, I finally understand them.",
+ "#LOV0\\LOV0_106#Romulan laughing gas. My father would never approve.",
+ "#LOV0\\LOV0_107#Why do they call you \"Bones\", doctor?",
+ "#LOV0\\LOV0_124#I'm trying to be patient, Captain.",
+ "#LOV0\\LOV0N000#A Romulan bird of prey hovers menacingly on the view screen.",
+ "#LOV0\\LOV0N001#It is bolted down and cannot be moved.",
+ "#LOV0\\LOV0N002#James Kirk watches the Romulan ship with concern.",
+ "#LOV0\\LOV0N003#Lt. Ferris watches the exits carefully.",
+ "#LOV0\\LOV0N004#McCoy is fidgeting around.",
+ "#LOV0\\LOV0N005#Spock is analyzing the surroundings.",
+ "#LOV0\\LOV0N006#This computer terminal is linked into the station's main computer. It is currently running an open file of log programs.",
+ "#LOV0\\LOV0N007#This is a heavily secured door, leading to another section of the station. Its access code has been breached.",
+ "#LOV0\\LOV0N008#This is a standard door, leading to another room on this deck.",
+ "#LOV0\\LOV0N009#You are on the bridge of the ARK7.",
+ "#LOV2\\LOV2N005#A loud hissing fills the room.",
+ "#LOV5\\LOV5_015#He's already cured, Jim.",
+ "#LOV5\\LOV5_019#I don't have the proper medicine to cure him, Jim.",
+ "#LOV5\\LOV5_027#Finally, a human response!",
+ "#LOV5\\LOV5_030#There. You're now cured.",
+ "#LOV5\\LOV5_038#Thank you, Doctor.",
+ "#LOVA\\LOVA_100#He's dead, Jim.",
+ "#LOVA\\LOVA_F01#He's been cured of the Oroborus virus.",
+ "#LOVA\\LOVA_F02#I'm picking up some kind of virus. I can't identify it without more information.",
+ "#LOVA\\LOVA_F03#He's infected with the virus, Jim.",
+ "#LOVA\\LOVA_F04#The virus affects the Romulan-Vulcan genotype, Jim.",
+ "#LOVA\\LOVA_F07#All lifesigns are normal.",
+ "#LOVA\\LOVA_F08#It's what I was afraid of, Jim. I think spock is getting worse.",
+ "#LOVA\\LOVA_F10#He has weak vital signs.",
+ "#LOVA\\LOVA_F54#The virus has spread to me, Captain.Isuggestyouconcentrateyoureffortsonthe",
+ "#LOVA\\LOVA_F55#Jim, we need to sysnthesize more to make the serum before we can use it.",
+ "#MUD2\\MUD2_040#You look troubled, Captain.",
+ "#MUD4\\MUD4_018#Kirk to Enterprise ... Kirk to Enterprise.",
+ "#sfx\\spokcoff#cough... cough...",
+ "#VENA\\VENA_F41#Kirk out.",
};
}
Commit: 28debc6673eb51b764d4d8229a596740df8ec7f5
https://github.com/scummvm/scummvm/commit/28debc6673eb51b764d4d8229a596740df8ec7f5
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fix some problems on old compilers
Changed paths:
engines/startrek/common.h
engines/startrek/iwfile.cpp
diff --git a/engines/startrek/common.h b/engines/startrek/common.h
index e4930b6..d76ef66 100644
--- a/engines/startrek/common.h
+++ b/engines/startrek/common.h
@@ -25,7 +25,7 @@
#include "common/scummsys.h"
namespace Common {
-class Rect;
+struct Rect;
class Serializer;
}
diff --git a/engines/startrek/iwfile.cpp b/engines/startrek/iwfile.cpp
index 830cb78..d97c20e 100644
--- a/engines/startrek/iwfile.cpp
+++ b/engines/startrek/iwfile.cpp
@@ -63,7 +63,7 @@ int IWFile::getClosestKeyPosition(int16 x, int16 y) {
for (int i = 0; i < _numEntries; i++) {
sortedIndices[i].x = i;
- sortedIndices[i].y = sqrt(_keyPositions[i].sqrDist(Common::Point(x, y)));
+ sortedIndices[i].y = (int16)sqrt((double)_keyPositions[i].sqrDist(Common::Point(x, y)));
}
sort(sortedIndices, sortedIndices + _numEntries, &iwSorter);
Commit: 933d21429fdb3cc1c97237bbee1cd2168c33d95f
https://github.com/scummvm/scummvm/commit/933d21429fdb3cc1c97237bbee1cd2168c33d95f
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: LOVE1
Changed paths:
A engines/startrek/rooms/love1.cpp
A engines/startrek/rooms/love2.cpp
A engines/startrek/rooms/love3.cpp
A engines/startrek/rooms/love4.cpp
A engines/startrek/rooms/love5.cpp
engines/startrek/awaymission.h
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/love0.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 3fca387..8b8e7e1 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -142,16 +142,32 @@ struct AwayMission {
struct {
bool alreadyStartedMission; // 0x29
bool knowAboutVirus; // 0x2a
+ bool field2b; // 0x2b
bool field2c; // 0x2c
bool field2d; // 0x2d
+ bool chamberHasCure; // 0x2e
+ bool freezerOpen; // 0x2f
+ bool chamberHasDish; // 0x30
+ byte bottleInNozzle; // 0x31
byte field36; // 0x36
byte field37; // 0x37
+ bool field41; // 0x41
bool spockAccessedConsole; // 0x49
bool mccoyAccessedConsole; // 0x4a
+ bool gotPolyberylcarbonate; // 0x4b
int16 missionScore; // 0x52
} love;
};
};
// Size: 0x129 bytes
+// Bottle types for Love's Labor Jeopardized
+enum BottleTypes {
+ BOTTLETYPE_NONE = 0,
+ BOTTLETYPE_N2O = 1,
+ BOTTLETYPE_NH3 = 2,
+ BOTTLETYPE_H2O = 3,
+ BOTTLETYPE_RLG = 4 // Romulan Laughing Gas
+};
+
#endif
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 85a31df..1696da7 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -31,6 +31,11 @@ MODULE_OBJS = \
rooms/tug2.o \
rooms/tug3.o \
rooms/love0.o \
+ rooms/love1.o \
+ rooms/love2.o \
+ rooms/love3.o \
+ rooms/love4.o \
+ rooms/love5.o \
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 245edb7..b1b26b0 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -85,6 +85,26 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_roomActionList = love0ActionList;
_numRoomActions = sizeof(love0ActionList) / sizeof(RoomAction);
}
+ else if (name == "LOVE1") {
+ _roomActionList = love1ActionList;
+ _numRoomActions = sizeof(love1ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "LOVE2") {
+ _roomActionList = love2ActionList;
+ _numRoomActions = sizeof(love2ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "LOVE3") {
+ _roomActionList = love3ActionList;
+ _numRoomActions = sizeof(love3ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "LOVE4") {
+ _roomActionList = love4ActionList;
+ _numRoomActions = sizeof(love4ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "LOVE5") {
+ _roomActionList = love5ActionList;
+ _numRoomActions = sizeof(love5ActionList) / sizeof(RoomAction);
+ }
else {
warning("Room \"%s\" unimplemented", name.c_str());
_numRoomActions = 0;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 660af0f..a6a2e70 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -746,6 +746,110 @@ public:
void love0MccoyAccessedConsole();
void love0InteractWithConsole();
+ // LOVE1
+ void love1Tick1();
+ void love1WalkToDoor3();
+ void love1OpenDoor3();
+ void love1ReachedDoor3();
+ void love1WalkToDoor1();
+ void love1OpenDoor1();
+ void love1ReachedDoor1();
+ void love1WalkToDoor2();
+ void love1OpenDoor2();
+ void love1ReachedDoor2();
+ void love1LookAtLaser();
+ void love1LookAtKirk();
+ void love1LookAtSpock();
+ void love1LookAtMccoy();
+ void love1LookAtRedshirt();
+ void love1LookAnywhere();
+ void love1LookAtNozzle();
+ void love1LookAtLadder();
+ void love1LookAtDoor1Or2();
+ void love1LookAtDoor3();
+ void love1LookAtDistillator();
+ void love1LookAtChamber();
+ void love1LookAtReplicator();
+ void love1LookAtFreezer();
+ void love1LookAtDishes();
+ void love1TalkToKirk();
+ void love1TalkToSpock();
+ void love1TalkToMccoy();
+ void love1TalkToRedshirt();
+ void love1UseMTricorderOnDishes();
+ void love1UseMTricorderAnywhere();
+ void love1UseSTricorderOnReplicator();
+ void love1UseSTricorderOnLaser();
+ void love1UseSTricorderOnFreezer();
+ void love1UseSTricorderAnywhere();
+ void love1UseSTricorderOnDishes();
+ void love1UseSTricorderOnDistillator();
+ void love1GetFreezer();
+ void love1KirkReachedFreezer();
+ void love1KirkGotVirusCulture();
+ void love1GetFromChamber();
+ void love1KirkReachedChamber();
+ void love1KirkGotCureSample();
+ void love1GetFromNozzle();
+ void love1KirkReachedNozzleToGet();
+ void love1KirkGotBottleFromNozzle();
+ void love1UseN2OOnNozzle();
+ void love1UseH2OOnNozzle();
+ void love1UseNH3OnNozzle();
+ void love1UseRLGOnNozzle();
+ void love1KirkReachedNozzleToPut();
+ void love1KirkPutBottleInNozzle();
+ void love1UseAnthingOnNozzle();
+ void love1UseSpockOnReplicator();
+ void love1UseRedshirtOnReplicator();
+ void love1UseMccoyOnReplicator();
+ void love1MccoyReachedReplicator();
+ void love1MccoyUsedReplicator();
+ void love1ChamberClosed();
+ void love1ChamberOpened();
+ void love1UseAnythingOnChamber();
+ void love1UseDishesOnChamber();
+ void love1KirkReachedChamberToPut();
+ void love1ChamberOpenedForDish();
+ void love1KirkPutDishInChamber();
+ void love1UseInsulationOnDistillator();
+ void love1KirkReachedDistillator();
+ void love1KirkGotPolyberylcarbonate();
+ void love1UseKirkOnFreezer();
+ void love1UseRedshirtOnFreezer();
+ void love1UseSpockOnFreezer();
+ void love1UseMccoyOnFreezer();
+ void love1CrewmanReachedFreezer();
+ void love1CrewmanOpenedOrClosedFreezer();
+ void love1UseAnythingOnFreezer();
+ void love1ReachedFreezerWithArbitraryItem();
+ void love1FinishedUsingArbitraryItemOnFreezer();
+ void love1UseAnythingOnReplicator();
+ void love1ReachedReplicatorWithArbitraryItem();
+ void love1FinishedUsingArbitraryItemOnReplicator();
+ void love1UseAnythingOnDistillator();
+ void love1ReachedDistillatorWithArbitraryItem();
+ void love1FinishedUsingArbitraryItemOnDistillator();
+ void love1UseKirkOnLadder();
+ void love1UseSpockOnLadder();
+ void love1UseMccoyOnLadder();
+ void love1UseRedshirtOnLadder();
+ void love1CrewmanReachedLadder();
+ void love1CrewmanDiedFromPhaser();
+ void love1TouchedHotspot0();
+
+ // LOVE2
+ void love2Tick1();
+
+ // LOVE3
+ void love3Tick1();
+
+ // LOVE4
+ void love4Tick1();
+
+ // LOVE5
+ void love5Tick1();
+
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
@@ -824,6 +928,22 @@ private:
byte _8ac; // 0x8ac
} love0;
+ struct {
+ byte door3OpenCounter; // 0xcb
+ byte door1OpenCounter; // 0xcc
+ byte door2OpenCounter; // 0xcd
+ bool walkingToDoor; // 0xce
+ int32 dyingSpeaker; // 0xcf
+ int16 crewmanUsingFreezerRetX; // 0xd1
+ int16 crewmanUsingFreezerRetY; // 0xd3
+ int16 crewmanUsingDevice; // 0xd9
+ int16 itemInNozzle; // 0xdd
+ char bottleAnimation[10]; // 0xdf
+
+ byte _1d2a; // 0x1d2a
+ byte _1d2b; // 0x1d2b
+ } love1;
+
} _roomVar;
};
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index dcf8bf3..a1cb928 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -823,6 +823,144 @@ RoomAction love0ActionList[] = {
// unused, but I'm not sure how it's run.
};
+RoomAction love1ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::love1Tick1 },
+
+ { Action(ACTION_WALK, 10, 0, 0), &Room::love1WalkToDoor3 },
+ { Action(ACTION_WALK, 0x26, 0, 0), &Room::love1WalkToDoor3 },
+ { Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::love1OpenDoor3 },
+ { Action(ACTION_FINISHED_WALKING, 15, 0, 0), &Room::love1ReachedDoor3 },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::love1ReachedDoor3 },
+
+ { Action(ACTION_WALK, 8, 0, 0), &Room::love1WalkToDoor1 },
+ { Action(ACTION_WALK, 0x27, 0, 0), &Room::love1WalkToDoor1 },
+ { Action(ACTION_TOUCHED_HOTSPOT, 2, 0, 0), &Room::love1OpenDoor1 },
+ { Action(ACTION_FINISHED_WALKING, 16, 0, 0), &Room::love1ReachedDoor1 },
+ { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love1ReachedDoor1 },
+
+ { Action(ACTION_WALK, 9, 0, 0), &Room::love1WalkToDoor2 },
+ { Action(ACTION_WALK, 0x28, 0, 0), &Room::love1WalkToDoor2 },
+ { Action(ACTION_TOUCHED_HOTSPOT, 3, 0, 0), &Room::love1OpenDoor2 },
+ { Action(ACTION_FINISHED_WALKING, 17, 0, 0), &Room::love1ReachedDoor2 },
+ { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love1ReachedDoor2 },
+
+ { Action(ACTION_LOOK, 0x25, 0, 0), &Room::love1LookAtLaser },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::love1LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::love1LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::love1LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::love1LookAtRedshirt },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::love1LookAnywhere },
+ { Action(ACTION_LOOK, 15, 0, 0), &Room::love1LookAtNozzle },
+ { Action(ACTION_LOOK, 0x24, 0, 0), &Room::love1LookAtNozzle },
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::love1LookAtLadder },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::love1LookAtDoor1Or2 },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::love1LookAtDoor1Or2 },
+ { Action(ACTION_LOOK, 10, 0, 0), &Room::love1LookAtDoor3 },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::love1LookAtDistillator },
+ { Action(ACTION_LOOK, 14, 0, 0), &Room::love1LookAtChamber },
+ { Action(ACTION_LOOK, 12, 0, 0), &Room::love1LookAtChamber },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::love1LookAtReplicator },
+ { Action(ACTION_LOOK, 11, 0, 0), &Room::love1LookAtFreezer },
+ { Action(ACTION_LOOK, 0x22, 0, 0), &Room::love1LookAtFreezer },
+ { Action(ACTION_LOOK, OBJECT_IDISHES, 0, 0), &Room::love1LookAtDishes },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::love1TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::love1TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::love1TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::love1TalkToRedshirt },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_IDISHES, 0), &Room::love1UseMTricorderOnDishes },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::love1UseMTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::love1UseSTricorderOnReplicator },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 12, 0), &Room::love1UseSTricorderOnReplicator },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x25, 0), &Room::love1UseSTricorderOnLaser },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x25, 0), &Room::love1UseSTricorderOnLaser },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::love1UseSTricorderOnFreezer },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::love1UseSTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, OBJECT_IDISHES, 0), &Room::love1UseSTricorderOnDishes },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::love1UseSTricorderOnDistillator },
+ { Action(ACTION_GET, 11, 0, 0), &Room::love1GetFreezer },
+ { Action(ACTION_GET, 0x22, 0, 0), &Room::love1GetFreezer },
+ { Action(ACTION_FINISHED_WALKING, 14, 0, 0), &Room::love1KirkReachedFreezer },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::love1KirkGotVirusCulture },
+ { Action(ACTION_GET, 14, 0, 0), &Room::love1GetFromChamber },
+ { Action(ACTION_GET, 12, 0, 0), &Room::love1GetFromChamber },
+ { Action(ACTION_GET, 0x23, 0, 0), &Room::love1GetFromChamber },
+ { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::love1KirkReachedChamber },
+ { Action(ACTION_FINISHED_ANIMATION, 10, 0, 0), &Room::love1KirkGotCureSample },
+ { Action(ACTION_GET, 15, 0, 0), &Room::love1GetFromNozzle },
+ { Action(ACTION_GET, 0x24, 0, 0), &Room::love1GetFromNozzle },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::love1KirkReachedNozzleToGet },
+ { Action(ACTION_FINISHED_ANIMATION, 11, 0, 0), &Room::love1KirkGotBottleFromNozzle },
+ { Action(ACTION_USE, OBJECT_IN2O, 0x24, 0), &Room::love1UseN2OOnNozzle },
+ { Action(ACTION_USE, OBJECT_IH2O, 0x24, 0), &Room::love1UseH2OOnNozzle },
+ { Action(ACTION_USE, OBJECT_INH3, 0x24, 0), &Room::love1UseNH3OnNozzle },
+ { Action(ACTION_USE, OBJECT_IRLG, 0x24, 0), &Room::love1UseRLGOnNozzle },
+ { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::love1KirkReachedNozzleToPut },
+ { Action(ACTION_FINISHED_ANIMATION, 12, 0, 0), &Room::love1KirkPutBottleInNozzle },
+ { Action(ACTION_USE, -1, 0x24, 0), &Room::love1UseAnthingOnNozzle },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x23, 0), &Room::love1UseSpockOnReplicator },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x23, 0), &Room::love1UseRedshirtOnReplicator },
+ { Action(ACTION_USE, OBJECT_MCCOY, 14, 0), &Room::love1UseMccoyOnReplicator },
+ { Action(ACTION_USE, OBJECT_MCCOY, 15, 0), &Room::love1UseMccoyOnReplicator },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x23, 0), &Room::love1UseMccoyOnReplicator },
+ { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::love1MccoyReachedReplicator },
+ { Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::love1MccoyUsedReplicator },
+ { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::love1ChamberClosed },
+ { Action(ACTION_FINISHED_ANIMATION, 8, 0, 0), &Room::love1ChamberOpened },
+ { Action(ACTION_USE, -1, 12, 0), &Room::love1UseAnythingOnChamber },
+ { Action(ACTION_USE, OBJECT_IDISHES, 12, 0), &Room::love1UseDishesOnChamber },
+ { Action(ACTION_USE, OBJECT_IDISHES, 0x23, 0), &Room::love1UseDishesOnChamber },
+ { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::love1KirkReachedChamberToPut },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::love1ChamberOpenedForDish },
+ { Action(ACTION_FINISHED_ANIMATION, 14, 0, 0), &Room::love1KirkPutDishInChamber },
+ { Action(ACTION_USE, OBJECT_IINSULAT, 0x21, 0), &Room::love1UseInsulationOnDistillator },
+ { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::love1KirkReachedDistillator },
+ { Action(ACTION_FINISHED_ANIMATION, 15, 0, 0), &Room::love1KirkGotPolyberylcarbonate },
+ { Action(ACTION_USE, OBJECT_KIRK, 0x22, 0), &Room::love1UseKirkOnFreezer },
+ { Action(ACTION_USE, OBJECT_KIRK, 11, 0), &Room::love1UseKirkOnFreezer },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x22, 0), &Room::love1UseRedshirtOnFreezer },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 11, 0), &Room::love1UseRedshirtOnFreezer },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x22, 0), &Room::love1UseSpockOnFreezer },
+ { Action(ACTION_USE, OBJECT_SPOCK, 11, 0), &Room::love1UseSpockOnFreezer },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x22, 0), &Room::love1UseMccoyOnFreezer },
+ { Action(ACTION_USE, OBJECT_MCCOY, 11, 0), &Room::love1UseMccoyOnFreezer },
+ { Action(ACTION_FINISHED_WALKING, 7, 0, 0), &Room::love1CrewmanReachedFreezer },
+ { Action(ACTION_FINISHED_ANIMATION, 16, 0, 0), &Room::love1CrewmanOpenedOrClosedFreezer },
+ { Action(ACTION_USE, -1, 0x22, 0), &Room::love1UseAnythingOnFreezer },
+ { Action(ACTION_FINISHED_WALKING, 11, 0, 0), &Room::love1ReachedFreezerWithArbitraryItem },
+ { Action(ACTION_FINISHED_ANIMATION, 17, 0, 0), &Room::love1FinishedUsingArbitraryItemOnFreezer },
+ { Action(ACTION_USE, -1, 0x23, 0), &Room::love1UseAnythingOnReplicator },
+ { Action(ACTION_FINISHED_WALKING, 12, 0, 0), &Room::love1ReachedReplicatorWithArbitraryItem },
+ { Action(ACTION_FINISHED_ANIMATION, 18, 0, 0), &Room::love1FinishedUsingArbitraryItemOnReplicator },
+ { Action(ACTION_USE, -1, 0x21, 0), &Room::love1UseAnythingOnDistillator },
+ { Action(ACTION_FINISHED_WALKING, 13, 0, 0), &Room::love1ReachedDistillatorWithArbitraryItem },
+ { Action(ACTION_FINISHED_ANIMATION, 19, 0, 0), &Room::love1FinishedUsingArbitraryItemOnDistillator },
+ { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::love1UseKirkOnLadder },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::love1UseSpockOnLadder },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::love1UseMccoyOnLadder },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::love1UseRedshirtOnLadder },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::love1CrewmanReachedLadder },
+ { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love1CrewmanDiedFromPhaser },
+ { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::love1TouchedHotspot0 },
+ // TODO: common code
+};
+
+RoomAction love2ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::love2Tick1 },
+};
+
+RoomAction love3ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::love3Tick1 },
+};
+
+RoomAction love4ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::love4Tick1 },
+};
+
+RoomAction love5ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::love5Tick1 },
+};
+
+
}
#endif
diff --git a/engines/startrek/rooms/love0.cpp b/engines/startrek/rooms/love0.cpp
index 7ab161a..e4e3932 100644
--- a/engines/startrek/rooms/love0.cpp
+++ b/engines/startrek/rooms/love0.cpp
@@ -91,7 +91,7 @@ void Room::love0OpenDoor1() {
void Room::love0ReachedDoor1() {
_roomVar.love0.door1OpenCounter++;
if (_roomVar.love0.door1OpenCounter == 2)
- loadRoomIndex(3, 1);
+ loadRoomIndex(1, 3);
}
void Room::love0LookAtConsole() {
diff --git a/engines/startrek/rooms/love1.cpp b/engines/startrek/rooms/love1.cpp
new file mode 100644
index 0000000..509f35f
--- /dev/null
+++ b/engines/startrek/rooms/love1.cpp
@@ -0,0 +1,661 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR1 8
+#define OBJECT_DOOR2 9
+#define OBJECT_DOOR3 10
+#define OBJECT_FREEZER 11
+#define OBJECT_CHAMBER 12
+#define OBJECT_PHASERSHOT 13
+#define OBJECT_DISH_IN_CHAMBER 14
+#define OBJECT_BOTTLE 15
+
+#define HOTSPOT_LADDER 0x20
+#define HOTSPOT_DISTILLATOR 0x21
+#define HOTSPOT_FREEZER 0x22
+#define HOTSPOT_REPLICATOR 0x23
+#define HOTSPOT_NOZZLE 0x24
+#define HOTSPOT_LASER 0x25
+#define HOTSPOT_DOOR3 0x26
+#define HOTSPOT_DOOR1 0x27
+#define HOTSPOT_DOOR2 0x28
+
+namespace StarTrek {
+
+void Room::love1Tick1() {
+ playVoc("LOV1LOOP");
+
+ if (_vm->_awayMission.love.freezerOpen)
+ loadActorAnim(OBJECT_FREEZER, "s3r2d4o", 0x67, 0x8d, 0);
+
+ if (_vm->_awayMission.love.chamberHasDish)
+ loadActorAnim(OBJECT_CHAMBER, "s3r2d5o", 0xb4, 0x75, 0);
+ else
+ loadActorAnim(OBJECT_CHAMBER, "s3r2d5c", 0xb4, 0x75, 0);
+
+ if (_vm->_awayMission.love.chamberHasDish)
+ loadActorAnim(OBJECT_DISH_IN_CHAMBER, "dishes", 0xb4, 0x71, 0);
+
+ switch (_vm->_awayMission.love.bottleInNozzle) {
+ case BOTTLETYPE_N2O:
+ strcpy(_roomVar.love1.bottleAnimation, "btle1");
+ _roomVar.love1.itemInNozzle = OBJECT_IN2O;
+ goto common;
+ case BOTTLETYPE_NH3:
+ strcpy(_roomVar.love1.bottleAnimation, "btle2");
+ _roomVar.love1.itemInNozzle = OBJECT_INH3;
+ goto common;
+ case BOTTLETYPE_H2O:
+ strcpy(_roomVar.love1.bottleAnimation, "btle3");
+ _roomVar.love1.itemInNozzle = OBJECT_IH2O;
+ goto common;
+ case BOTTLETYPE_RLG:
+ strcpy(_roomVar.love1.bottleAnimation, "btle4");
+ _roomVar.love1.itemInNozzle = OBJECT_IRLG;
+ goto common;
+
+common:
+ loadActorAnim(OBJECT_BOTTLE, _roomVar.love1.bottleAnimation, 0xa3, 0x72, 0);
+ // fall through
+
+ case BOTTLETYPE_NONE:
+ if (_vm->_awayMission.love.field2c)
+ _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
+ break;
+ }
+
+ if (_vm->_awayMission.love.field2d)
+ _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
+ _vm->_awayMission.timers[2] = 200;
+
+ loadActorAnim(OBJECT_DOOR3, "s3r2d3a", 0xdb, 0x7e, 0);
+ loadActorAnim(OBJECT_DOOR1, "s3r2d1a", 0, 0, 0);
+ loadActorAnim(OBJECT_DOOR2, "s3r2d2a", 0, 0, 0);
+
+ _roomVar.love1._1d2a = 0x90;
+ _roomVar.love1._1d2b = 0xa7;
+}
+
+void Room::love1WalkToDoor3() {
+ _vm->_awayMission.disableInput = true;
+ _roomVar.love1.walkingToDoor = true;
+ walkCrewman(OBJECT_KIRK, 0xd9, 0x81, 15);
+}
+
+void Room::love1OpenDoor3() {
+ if (_roomVar.love1.walkingToDoor) {
+ loadActorAnim(OBJECT_DOOR3, "s3r2d3", 0xdb, 0x7e, 2);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+}
+
+// Door 3 opened, or door 3 reached (both must occur before transition happens)
+void Room::love1ReachedDoor3() {
+ _roomVar.love1.door3OpenCounter++;
+ if (_roomVar.love1.door3OpenCounter == 2)
+ loadRoomIndex(3, 1);
+}
+
+void Room::love1WalkToDoor1() {
+ _vm->_awayMission.disableInput = true;
+ _roomVar.love1.walkingToDoor = true;
+ walkCrewman(OBJECT_KIRK, 0x42, 0x97, 16);
+}
+
+void Room::love1OpenDoor1() {
+ if (_roomVar.love1.walkingToDoor) {
+ loadActorAnim(OBJECT_DOOR1, "s3r2d1", 0, 0, 3);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+}
+
+// Door 1 opened, or door 1 reached
+void Room::love1ReachedDoor1() {
+ _roomVar.love1.door1OpenCounter++;
+ if (_roomVar.love1.door1OpenCounter == 2)
+ loadRoomIndex(0, 2);
+}
+
+void Room::love1WalkToDoor2() {
+ _vm->_awayMission.disableInput = true;
+ _roomVar.love1.walkingToDoor = true;
+ walkCrewman(OBJECT_KIRK, 0x79, 0x85, 17);
+}
+
+void Room::love1OpenDoor2() {
+ if (_roomVar.love1.walkingToDoor) {
+ loadActorAnim(OBJECT_DOOR2, "s3r2d2", 0, 0, 4);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+}
+
+// Door 2 opened, or door 2 reached
+void Room::love1ReachedDoor2() {
+ _roomVar.love1.door2OpenCounter++;
+ if (_roomVar.love1.door2OpenCounter == 2)
+ loadRoomIndex(2, 0);
+}
+
+void Room::love1LookAtLaser() {
+ showText(TX_LOV1N000);
+}
+
+void Room::love1LookAtKirk() {
+ showText(TX_LOV1N003);
+}
+
+void Room::love1LookAtSpock() {
+ showText(TX_LOV1N004);
+}
+
+void Room::love1LookAtMccoy() {
+ showText(TX_LOV1N001);
+}
+
+void Room::love1LookAtRedshirt() {
+ showText(TX_LOV1N002);
+}
+
+void Room::love1LookAnywhere() {
+ showText(TX_LOV1N019);
+}
+
+void Room::love1LookAtNozzle() {
+ showText(TX_LOV1N022);
+}
+
+void Room::love1LookAtLadder() {
+ showText(TX_LOV1N021);
+}
+
+void Room::love1LookAtDoor1Or2() {
+ showText(TX_LOV1N020);
+}
+
+void Room::love1LookAtDoor3() {
+ showText(TX_LOV1N017);
+}
+
+void Room::love1LookAtDistillator() {
+ showText(TX_LOV1N016);
+}
+
+void Room::love1LookAtChamber() {
+ if (_vm->_awayMission.love.chamberHasCure)
+ showText(TX_LOV1N013);
+ else
+ showText(TX_LOV1N014);
+}
+
+void Room::love1LookAtReplicator() {
+ showText(TX_LOV1N015);
+}
+
+void Room::love1LookAtFreezer() {
+ if (_vm->_awayMission.love.freezerOpen)
+ showText(TX_LOV1N023);
+ else
+ showText(TX_LOV1N018);
+}
+
+void Room::love1LookAtDishes() {
+ showText(TX_LOV1N012);
+}
+
+void Room::love1TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_LOV1_001);
+}
+
+void Room::love1TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_LOV1_005);
+}
+
+void Room::love1TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV1_011);
+}
+
+void Room::love1TalkToRedshirt() {
+ showText(TX_SPEAKER_FERRIS, TX_LOV1_027);
+}
+
+void Room::love1UseMTricorderOnDishes() {
+ mccoyScan(DIR_W, TX_LOV1_017, false);
+ // TODO: only works in this room, despite being inventory item?
+}
+
+void Room::love1UseMTricorderAnywhere() {
+ if (_vm->_awayMission.love.knowAboutVirus)
+ mccoyScan(DIR_S, TX_LOV1_009, false);
+ else
+ mccoyScan(DIR_S, TX_LOV1_010, false);
+}
+
+void Room::love1UseSTricorderOnReplicator() {
+ spockScan(DIR_N, TX_LOV1_022, false);
+}
+
+void Room::love1UseSTricorderOnLaser() {
+ spockScan(DIR_E, TX_LOV1_006, false);
+}
+
+void Room::love1UseSTricorderOnFreezer() {
+ spockScan(DIR_W, TX_LOV1_023, false);
+}
+
+void Room::love1UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_LOV1_003, false);
+}
+
+void Room::love1UseSTricorderOnDishes() {
+ spockScan(DIR_W, TX_LOV1_004, false);
+ // TODO: only works in this room, despite being inventory item?
+}
+
+void Room::love1UseSTricorderOnDistillator() {
+ spockScan(DIR_S, TX_LOV1_007, false);
+}
+
+void Room::love1GetFreezer() {
+ walkCrewman(OBJECT_KIRK, 0x71, 0x8e, 14);
+}
+
+void Room::love1KirkReachedFreezer() {
+ if (_vm->_awayMission.love.freezerOpen)
+ loadActorAnim2(OBJECT_KIRK, "kusehw", -1, -1, 9);
+ else
+ showText(TX_LOV1N010);
+}
+
+void Room::love1KirkGotVirusCulture() {
+ giveItem(OBJECT_IDISHES);
+ showText(TX_LOV1N006);
+}
+
+void Room::love1GetFromChamber() {
+ if (!_vm->_awayMission.love.chamberHasDish)
+ showText(TX_LOV1N009);
+ else
+ walkCrewman(OBJECT_KIRK, 0xb5, 0x8c, 8);
+}
+
+void Room::love1KirkReachedChamber() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 10);
+}
+
+void Room::love1KirkGotCureSample() {
+ if (_vm->_awayMission.love.chamberHasCure) {
+ giveItem(OBJECT_ISAMPLE);
+ showText(TX_LOV1N035);
+ }
+ else {
+ giveItem(OBJECT_IDISHES);
+ showText(TX_LOV1N006);
+ }
+
+ loadActorStandAnim(OBJECT_DISH_IN_CHAMBER);
+ loadActorAnim2(OBJECT_CHAMBER, "s3r2d6", 0xb4, 0x75, 0);
+ playSoundEffectIndex(SND_DOOR1);
+ _vm->_awayMission.love.chamberHasDish = false;
+}
+
+void Room::love1GetFromNozzle() {
+ walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 2);
+}
+
+void Room::love1KirkReachedNozzleToGet() {
+ if (_vm->_awayMission.love.bottleInNozzle == 0)
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 11);
+ else
+ showText(TX_LOV1N011);
+}
+
+void Room::love1KirkGotBottleFromNozzle() {
+ switch (_vm->_awayMission.love.bottleInNozzle) {
+ case BOTTLETYPE_N2O:
+ giveItem(OBJECT_IN2O);
+ break;
+ case BOTTLETYPE_NH3:
+ giveItem(OBJECT_INH3);
+ break;
+ case BOTTLETYPE_H2O:
+ giveItem(OBJECT_IH2O);
+ break;
+ case BOTTLETYPE_RLG:
+ giveItem(OBJECT_IRLG);
+ break;
+ default:
+ showText(TX_DIALOG_ERROR);
+ break;
+ }
+
+ _vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_NONE;
+ loadActorStandAnim(OBJECT_BOTTLE);
+ showText(TX_LOV1N007);
+ _roomVar.love1.itemInNozzle = 0;
+}
+
+void Room::love1UseN2OOnNozzle() {
+ if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
+ _roomVar.love1.itemInNozzle = OBJECT_IN2O;
+ strcpy(_roomVar.love1.bottleAnimation, "btle1");
+ _vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_N2O;
+ walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 3);
+ }
+}
+
+void Room::love1UseH2OOnNozzle() {
+ if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
+ _roomVar.love1.itemInNozzle = OBJECT_IH2O;
+ strcpy(_roomVar.love1.bottleAnimation, "btle3");
+ _vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_H2O;
+ walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 3);
+ }
+}
+
+void Room::love1UseNH3OnNozzle() {
+ if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
+ _roomVar.love1.itemInNozzle = OBJECT_INH3;
+ strcpy(_roomVar.love1.bottleAnimation, "btle2");
+ _vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_NH3;
+ walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 3);
+ }
+}
+
+void Room::love1UseRLGOnNozzle() {
+ if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
+ _roomVar.love1.itemInNozzle = OBJECT_IRLG;
+ strcpy(_roomVar.love1.bottleAnimation, "btle4");
+ _vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_RLG;
+ walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 3);
+ }
+}
+
+void Room::love1KirkReachedNozzleToPut() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 12);
+}
+
+void Room::love1KirkPutBottleInNozzle() {
+ loadActorAnim(OBJECT_BOTTLE, _roomVar.love1.bottleAnimation, 0xa3, 0x72, 0);
+ loseItem(_roomVar.love1.itemInNozzle);
+}
+
+void Room::love1UseAnthingOnNozzle() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV1_012);
+}
+
+void Room::love1UseSpockOnReplicator() {
+ showText(TX_SPEAKER_SPOCK, TX_LOV1_002);
+}
+
+void Room::love1UseRedshirtOnReplicator() {
+ showText(TX_SPEAKER_FERRIS, TX_LOV1_026);
+}
+
+void Room::love1UseMccoyOnReplicator() {
+ walkCrewman(OBJECT_MCCOY, 0xb1, 0x8c, 4);
+}
+
+void Room::love1MccoyReachedReplicator() {
+ if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
+ showText(TX_SPEAKER_MCCOY, TX_LOV1_021);
+ walkCrewman(OBJECT_MCCOY, 0xbf, 0x98, 0);
+ }
+ else if (!_vm->_awayMission.love.chamberHasDish) {
+ showText(TX_SPEAKER_MCCOY, TX_LOV1_015);
+ walkCrewman(OBJECT_MCCOY, 0xbf, 0x98, 0);
+ }
+ else
+ loadActorAnim2(OBJECT_MCCOY, "musehn", -1, -1, 13);
+}
+
+void Room::love1MccoyUsedReplicator() {
+ if (_roomVar.love1.itemInNozzle == OBJECT_INH3) {
+ loadActorStandAnim(OBJECT_DISH_IN_CHAMBER);
+ loadActorAnim2(OBJECT_CHAMBER, "s3r2d6", 0xb4, 0x75, 7);
+ playSoundEffectIndex(SND_DOOR1);
+ walkCrewman(OBJECT_MCCOY, 0xbf, 0x98, 0);
+ }
+ else {
+ showText(TX_SPEAKER_MCCOY, TX_LOV1_019);
+ walkCrewman(OBJECT_MCCOY, 0xbf, 0x98, 0);
+ }
+}
+
+void Room::love1ChamberClosed() {
+ loadActorAnim2(OBJECT_CHAMBER, "s3r2d5", 0xb4, 0x75, 8);
+ playSoundEffectIndex(SND_DOOR1);
+}
+
+void Room::love1ChamberOpened() {
+ loadActorAnim(OBJECT_DISH_IN_CHAMBER, "dishes", 0xb4, 0x71, 0);
+ showText(TX_SPEAKER_MCCOY, TX_LOV1_018);
+ _vm->_awayMission.love.chamberHasCure = true;
+}
+
+void Room::love1UseAnythingOnChamber() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV1_013);
+}
+
+void Room::love1UseDishesOnChamber() {
+ walkCrewman(OBJECT_KIRK, 0xb3, 0x8c, 5);
+}
+
+void Room::love1KirkReachedChamberToPut() {
+ if (_vm->_awayMission.love.chamberHasDish)
+ showText(TX_LOV1_014); // TODO: test
+ else {
+ loadActorAnim(OBJECT_CHAMBER, "s3r2d5", 0xb4, 0x75, 1);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+}
+
+void Room::love1ChamberOpenedForDish() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 14);
+}
+
+void Room::love1KirkPutDishInChamber() {
+ loadActorAnim(OBJECT_DISH_IN_CHAMBER, "dishes", 0xb4, 0x71, 0);
+ loseItem(OBJECT_IDISHES);
+ _vm->_awayMission.love.chamberHasDish = true;
+}
+
+void Room::love1UseInsulationOnDistillator() {
+ walkCrewman(OBJECT_KIRK, 0xbe, 0xc1, 6);
+}
+
+void Room::love1KirkReachedDistillator() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 15);
+ playVoc("LD1PROCE");
+}
+
+void Room::love1KirkGotPolyberylcarbonate() {
+ // Result of using insulation on distillator
+ showText(TX_LOV1N034);
+ if (!_vm->_awayMission.love.gotPolyberylcarbonate) {
+ _vm->_awayMission.love.gotPolyberylcarbonate = true;
+ _vm->_awayMission.love.missionScore++;
+ }
+
+ giveItem(OBJECT_IPBC);
+ loseItem(OBJECT_IINSULAT);
+}
+
+void Room::love1UseKirkOnFreezer() {
+ _roomVar.love1.crewmanUsingFreezerRetY = 0xa0;
+ _roomVar.love1.crewmanUsingFreezerRetX = 0x96;
+ _roomVar.love1.crewmanUsingDevice = OBJECT_KIRK;
+ walkCrewman(_roomVar.love1.crewmanUsingDevice, 0x71, 0x8e, 7);
+ _vm->_awayMission.disableInput = true;
+}
+
+void Room::love1UseRedshirtOnFreezer() {
+ _roomVar.love1.crewmanUsingFreezerRetY = 0x89;
+ _roomVar.love1.crewmanUsingFreezerRetX = 0x95;
+ _roomVar.love1.crewmanUsingDevice = OBJECT_REDSHIRT;
+ walkCrewman(_roomVar.love1.crewmanUsingDevice, 0x71, 0x8e, 7);
+ _vm->_awayMission.disableInput = true;
+}
+
+void Room::love1UseSpockOnFreezer() {
+ _roomVar.love1.crewmanUsingFreezerRetY = 0xa9;
+ _roomVar.love1.crewmanUsingFreezerRetX = 0x61;
+ _roomVar.love1.crewmanUsingDevice = OBJECT_SPOCK;
+ walkCrewman(_roomVar.love1.crewmanUsingDevice, 0x71, 0x8e, 7);
+ _vm->_awayMission.disableInput = true;
+}
+
+void Room::love1UseMccoyOnFreezer() {
+ _roomVar.love1.crewmanUsingFreezerRetY = 0x98;
+ _roomVar.love1.crewmanUsingFreezerRetX = 0xbf;
+ _roomVar.love1.crewmanUsingDevice = OBJECT_MCCOY;
+ walkCrewman(_roomVar.love1.crewmanUsingDevice, 0x71, 0x8e, 7);
+ _vm->_awayMission.disableInput = true;
+}
+
+void Room::love1CrewmanReachedFreezer() {
+ Common::String useAnim = _vm->getCrewmanAnimFilename(_roomVar.love1.crewmanUsingDevice, "usehw");
+
+ loadActorAnim2(_roomVar.love1.crewmanUsingDevice, useAnim, -1, -1, 16);
+}
+
+void Room::love1CrewmanOpenedOrClosedFreezer() {
+ if (_vm->_awayMission.love.freezerOpen)
+ loadActorAnim(OBJECT_FREEZER, "s3r2d4a", 0x67, 0x8d, 0);
+ else
+ loadActorAnim(OBJECT_FREEZER, "s3r2d4", 0x67, 0x8d, 0);
+
+ playSoundEffectIndex(SND_DOOR1);
+ _vm->_awayMission.love.freezerOpen = !_vm->_awayMission.love.freezerOpen;
+
+ walkCrewman(_roomVar.love1.crewmanUsingDevice, _roomVar.love1.crewmanUsingFreezerRetX, _roomVar.love1.crewmanUsingFreezerRetY, 0);
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::love1UseAnythingOnFreezer() {
+ walkCrewman(OBJECT_KIRK, 0x6f, 0x8e, 11);
+}
+
+void Room::love1ReachedFreezerWithArbitraryItem() {
+ loadActorAnim2(OBJECT_KIRK, "kusemw", -1, -1, 17);
+}
+
+void Room::love1FinishedUsingArbitraryItemOnFreezer() {
+ showText(TX_LOV1N008);
+}
+
+void Room::love1UseAnythingOnReplicator() {
+ walkCrewman(OBJECT_KIRK, 0xb5, 0x8c, 12);
+}
+
+void Room::love1ReachedReplicatorWithArbitraryItem() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 18);
+}
+
+void Room::love1FinishedUsingArbitraryItemOnReplicator() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV1_016);
+}
+
+void Room::love1UseAnythingOnDistillator() {
+ walkCrewman(OBJECT_KIRK, 0xc2, 0xb2, 13);
+}
+
+void Room::love1ReachedDistillatorWithArbitraryItem() {
+ loadActorAnim2(OBJECT_KIRK, "kuseme", -1, -1, 19);
+}
+
+void Room::love1FinishedUsingArbitraryItemOnDistillator() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV1_008);
+}
+
+void Room::love1UseKirkOnLadder() {
+ _roomVar.love1.crewmanUsingDevice = OBJECT_KIRK;
+ _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love1.crewmanUsingDevice] = DIR_N;
+ walkCrewman(_roomVar.love1.crewmanUsingDevice, 0x102, 0x89, 1);
+ _vm->_awayMission.disableInput = true;
+}
+
+void Room::love1UseSpockOnLadder() {
+ _roomVar.love1.crewmanUsingDevice = OBJECT_SPOCK;
+ _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love1.crewmanUsingDevice] = DIR_N;
+ walkCrewman(_roomVar.love1.crewmanUsingDevice, 0x102, 0x89, 1);
+ _vm->_awayMission.disableInput = true;
+}
+
+void Room::love1UseMccoyOnLadder() {
+ _roomVar.love1.crewmanUsingDevice = OBJECT_MCCOY;
+ _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love1.crewmanUsingDevice] = DIR_N;
+ walkCrewman(_roomVar.love1.crewmanUsingDevice, 0x102, 0x89, 1);
+ _vm->_awayMission.disableInput = true;
+}
+
+void Room::love1UseRedshirtOnLadder() {
+ _roomVar.love1.crewmanUsingDevice = OBJECT_REDSHIRT;
+ _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love1.crewmanUsingDevice] = DIR_N;
+ walkCrewman(_roomVar.love1.crewmanUsingDevice, 0x102, 0x89, 1);
+ _vm->_awayMission.disableInput = true;
+}
+
+void Room::love1CrewmanReachedLadder() {
+ const int32 speakers[] = {
+ TX_SPEAKER_KIRK,
+ TX_SPEAKER_SPOCK,
+ TX_SPEAKER_MCCOY,
+ TX_SPEAKER_FERRIS
+ };
+
+ if (_vm->_awayMission.love.field2b || _vm->_awayMission.love.field41) // Romulans unconscious
+ loadRoomIndex(4, 3);
+ else { // Romulans still conscious, they shoot you
+ loadActorAnim(OBJECT_PHASERSHOT, "s3r2s2", 0xf3, 0x89, 0);
+ playSoundEffectIndex(SND_PHASSHOT);
+
+ Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love1.crewmanUsingDevice, "killw");
+ loadActorAnim(_roomVar.love1.crewmanUsingDevice, anim, 0x102, 0x89, 6);
+ _roomVar.love1.dyingSpeaker = speakers[_roomVar.love1.crewmanUsingDevice];
+ }
+}
+
+void Room::love1CrewmanDiedFromPhaser() {
+ if (_roomVar.love1.crewmanUsingDevice == OBJECT_REDSHIRT) {
+ _vm->_awayMission.disableInput = false;
+ showText(TX_SPEAKER_FERRIS, TX_LOV1_024);
+ _vm->_awayMission.redshirtDead = true;
+ }
+ else {
+ showText(_roomVar.love1.dyingSpeaker, TX_LOV1_025);
+ showGameOverMenu();
+ }
+}
+
+// Romulans fire a "warning shot" when you go to the right part of the room.
+void Room::love1TouchedHotspot0() {
+ if (_vm->_awayMission.love.field2b || _vm->_awayMission.love.field41)
+ return;
+ loadActorAnim(OBJECT_PHASERSHOT, "s3r2s1", 0xf3, 0x89, 0);
+ playSoundEffectIndex(SND_PHASSHOT);
+ if (!_vm->_awayMission.redshirtDead)
+ showText(TX_SPEAKER_FERRIS, TX_LOV1_028);
+}
+
+}
diff --git a/engines/startrek/rooms/love2.cpp b/engines/startrek/rooms/love2.cpp
new file mode 100644
index 0000000..43cdd64
--- /dev/null
+++ b/engines/startrek/rooms/love2.cpp
@@ -0,0 +1,35 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR1 8
+
+#define HOTSPOT_CONSOLE 0x20
+
+namespace StarTrek {
+
+void Room::love2Tick1() {
+
+}
+
+}
diff --git a/engines/startrek/rooms/love3.cpp b/engines/startrek/rooms/love3.cpp
new file mode 100644
index 0000000..44203df
--- /dev/null
+++ b/engines/startrek/rooms/love3.cpp
@@ -0,0 +1,35 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR1 8
+
+#define HOTSPOT_CONSOLE 0x20
+
+namespace StarTrek {
+
+void Room::love3Tick1() {
+
+}
+
+}
diff --git a/engines/startrek/rooms/love4.cpp b/engines/startrek/rooms/love4.cpp
new file mode 100644
index 0000000..ec82191
--- /dev/null
+++ b/engines/startrek/rooms/love4.cpp
@@ -0,0 +1,35 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR1 8
+
+#define HOTSPOT_CONSOLE 0x20
+
+namespace StarTrek {
+
+void Room::love4Tick1() {
+
+}
+
+}
diff --git a/engines/startrek/rooms/love5.cpp b/engines/startrek/rooms/love5.cpp
new file mode 100644
index 0000000..0abeb59
--- /dev/null
+++ b/engines/startrek/rooms/love5.cpp
@@ -0,0 +1,35 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR1 8
+
+#define HOTSPOT_CONSOLE 0x20
+
+namespace StarTrek {
+
+void Room::love5Tick1() {
+
+}
+
+}
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index c71dcb7..81a198d 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -60,6 +60,7 @@ enum GameStringIDs {
TX_NULL,
TX_BLANK,
TX_DIALOG_ERROR,
+ TX_ANIMATION_ERROR,
TX_SPEAKER_KIRK,
TX_SPEAKER_SPOCK,
@@ -817,13 +818,69 @@ enum GameStringIDs {
TX_VENA_F41,
+ TX_LOV1_001,
+ TX_LOV1_002,
+ TX_LOV1_003,
+ TX_LOV1_004,
+ TX_LOV1_005,
+ TX_LOV1_006,
+ TX_LOV1_007,
+ TX_LOV1_008,
+ TX_LOV1_009,
+ TX_LOV1_010,
+ TX_LOV1_011,
+ TX_LOV1_012,
+ TX_LOV1_013,
+ TX_LOV1_014,
+ TX_LOV1_015,
+ TX_LOV1_016,
+ TX_LOV1_017,
+ TX_LOV1_018,
+ TX_LOV1_019,
+ TX_LOV1_021,
+ TX_LOV1_022,
+ TX_LOV1_023,
+ TX_LOV1_024,
+ TX_LOV1_025,
+ TX_LOV1_026,
+ TX_LOV1_027,
+ TX_LOV1_028,
+ TX_LOV1N000,
+ TX_LOV1N001,
+ TX_LOV1N002,
+ TX_LOV1N003,
+ TX_LOV1N004,
+ TX_LOV1N005,
+ TX_LOV1N006,
+ TX_LOV1N007,
+ TX_LOV1N008,
+ TX_LOV1N009,
+ TX_LOV1N010,
+ TX_LOV1N011,
+ TX_LOV1N012,
+ TX_LOV1N013,
+ TX_LOV1N014,
+ TX_LOV1N015,
+ TX_LOV1N016,
+ TX_LOV1N017,
+ TX_LOV1N018,
+ TX_LOV1N019,
+ TX_LOV1N020,
+ TX_LOV1N021,
+ TX_LOV1N022,
+ TX_LOV1N023,
+ TX_LOV1N034,
+ TX_LOV1N035,
+
+
TX_END
};
const char * const g_gameStrings[] = {
nullptr,
"",
- "There is a dialog error here.",
+ "Dialog error",
+ "Animation error",
"Capt. Kirk",
"Mr. Spock",
@@ -1579,6 +1636,61 @@ const char * const g_gameStrings[] = {
"#MUD4\\MUD4_018#Kirk to Enterprise ... Kirk to Enterprise.",
"#sfx\\spokcoff#cough... cough...",
"#VENA\\VENA_F41#Kirk out.",
+
+
+ "#LOV1\\LOV1_001#When you are finished admiring all the equipment Bones, maybe you can help us figure out what's going on here.",
+ "#LOV1\\LOV1_002#Captain, I believe Dr. McCoy has the necessary skills to run that equipment.",
+ "#LOV1\\LOV1_003#It is a standard research lab.",
+ "#LOV1\\LOV1_004#The seals on these dishes are intact, but that's all I can determine.",
+ "#LOV1\\LOV1_005#This is a very well-equipped laboratory, Captain. Perhaps Dr. McCoy could be of some use here.",
+ "#LOV1\\LOV1_006#A Hawking Neutrino Accelerator. It is one of the finest in production today.",
+ "#LOV1\\LOV1_007#A Khrygellian II Basic Compound Distillator. Excellent piece of equipment for reducing complex materials to their basic compounds.",
+ "#LOV1\\LOV1_008#Careful, Jim! That's a distillator, not a can-opener.",
+ "#LOV1\\LOV1_009#Except for the Oroborus virus, I'm not picking up anything unusual.",
+ "#LOV1\\LOV1_010#I'm picking up some strange, airborne virus. I can't identify it without more information.",
+ "#LOV1\\LOV1_011#Jim, this lab is incredible! What I wouldn't give to have some of this equipment on the Enterprise.",
+ "#LOV1\\LOV1_012#That nozzle is for anti-agents only, Jim.",
+ "#LOV1\\LOV1_013#That's for Virus Cultures only, Jim.",
+ "#LOV1\\LOV1_014#There is already something in the chamber.",
+ "#LOV1\\LOV1_015#There is no specimen in the chamber.",
+ "#LOV1\\LOV1_016#This isn't a microwave, Jim! This is a delicate piece of equipment!",
+ "#LOV1\\LOV1_017#Jim, these viral cultures are alive. I can use them to work on a cure.",
+ "#LOV1\\LOV1_018#Eureka! This is it, Jim! There's not much, but all I need to do is synthesize some more, and we're in business.",
+ "#LOV1\\LOV1_019#This isn't the result I was hoping for, Jim.",
+ "#LOV1\\LOV1_021#We have to attach something to the nozzle first.",
+ "#LOV1\\LOV1_022#Residue of a viral agent is still within the chamber.",
+ "#LOV1\\LOV1_023#There are multiple culture samples of the virus within the freezer, Captain.",
+ "#LOV1\\LOV1_024#Arrggghhh!",
+ "#LOV1\\LOV1_025#Aieee!!",
+ "#LOV1\\LOV1_026#Sir, I think Dr. McCoy should run it. I may break it.",
+ "#LOV1\\LOV1_027#This level appears to be deserted, sir, but I'm worried about a Romulan counter-attack. They outnumber us.",
+ "#LOV1\\LOV1_028#Watch out, sir! It looks like the Romulans have taken control of the lower decks.",
+ "#LOV1\\LOV1N000#A device to accelerate neutrinos. Not much good for anything else.",
+ "#LOV1\\LOV1N001#Dr. McCoy is thinking about chemical formulas.",
+ "#LOV1\\LOV1N002#Ensign Ferris doesn't know much about chemical formulas.",
+ "#LOV1\\LOV1N003#James Tiberius Kirk.",
+ "#LOV1\\LOV1N004#Mr. Spock is thinking about chemical formulas.",
+ "#LOV1\\LOV1N005#You already have a culture dish.",
+ "#LOV1\\LOV1N006#You take the Oroborus virus culture.",
+ "#LOV1\\LOV1N007#Done.",
+ "#LOV1\\LOV1N008#It gets a little colder, but nothing else happens.",
+ "#LOV1\\LOV1N009#The chamber is empty.",
+ "#LOV1\\LOV1N010#The Freezer unit is too large to take.",
+ "#LOV1\\LOV1N011#The nozzle is empty.",
+ "#LOV1\\LOV1N012#There are many virus culture dishes, all of them labeled, \"Oroborus Virus -- DANGER!!\".",
+ "#LOV1\\LOV1N013#There is a single viral culture dish in here, and it contains a sample of the Oroborus cure.",
+ "#LOV1\\LOV1N014#This chamber is where virus samples are placed.",
+ "#LOV1\\LOV1N015#This device is used for the rapid reproduction of virus cultures in the presence of suspected anti-agents.",
+ "#LOV1\\LOV1N016#This is a distillator, used to isolate specific compounds from raw material.",
+ "#LOV1\\LOV1N017#This is a large engineering safety door with heavy shielding. Its entry codes seem to be breached.",
+ "#LOV1\\LOV1N018#This is a large refrigeration unit.",
+ "#LOV1\\LOV1N019#This is a research lab, with lots of expensive equipment.",
+ "#LOV1\\LOV1N020#This is a standard door, leading to another room on this deck.",
+ "#LOV1\\LOV1N021#This is an access ladder. It appears to lead to the next deck below.",
+ "#LOV1\\LOV1N022#This nozzle is where anti-agents are placed.",
+ "#LOV1\\LOV1N023#This refrigerator has a number of specimen dishes inside.",
+ "#LOV1\\LOV1N034#You have distilled a quantity of Polyberylcarbonate.",
+ "#LOV1\\LOV1N035#You retrieve the Oroborus cure sample.",
};
}
Commit: 44b0a4c7bb4615933a7e9f6124a7fffbd309da8d
https://github.com/scummvm/scummvm/commit/44b0a4c7bb4615933a7e9f6124a7fffbd309da8d
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Remove optional parameters from methods
Changed paths:
engines/startrek/room.h
engines/startrek/rooms/tug2.cpp
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index a6a2e70..05db770 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -120,9 +120,12 @@ private:
void showGameOverMenu(); // Cmd 0x12
void playVoc(Common::String filename); // Cmd 0x15
- // Helper functions for repetitive stuff
- void spockScan(int direction, int text, bool changeDirection = true);
- void mccoyScan(int direction, int text, bool changeDirection = true);
+ // Helper functions for repetitive stuff.
+
+ // If "changeDirection" is true, they remain facing that direction even after their
+ // animation is finished. The game is inconsistent about doing this.
+ void spockScan(int direction, int text, bool changeDirection);
+ void mccoyScan(int direction, int text, bool changeDirection);
// Room-specific code
public:
diff --git a/engines/startrek/rooms/tug2.cpp b/engines/startrek/rooms/tug2.cpp
index 3c6aad2..8c24a36 100644
--- a/engines/startrek/rooms/tug2.cpp
+++ b/engines/startrek/rooms/tug2.cpp
@@ -188,7 +188,7 @@ void Room::tug2LookAtWires() {
void Room::tug2UseSTricorderOnButton() {
if (_vm->_awayMission.tug.field35 != 0)
return;
- spockScan(DIR_E, TX_TUG2_007);
+ spockScan(DIR_E, TX_TUG2_007, true);
}
void Room::tug2UseMccoyOnWires() {
@@ -783,18 +783,18 @@ void Room::tug2Timer2Expired() {
}
void Room::tug2UseSTricorderOnBomb() {
- spockScan(DIR_E, TX_TUG2_004);
+ spockScan(DIR_E, TX_TUG2_004, true);
}
void Room::tug2UseMTricorderOnGuard1() {
if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED)
- mccoyScan(DIR_E, TX_TUG2_016);
+ mccoyScan(DIR_E, TX_TUG2_016, true);
}
void Room::tug2UseMTricorderOnGuard2() {
// BUGFIX: original didn't play audio for this (despite being the same as above).
if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED)
- mccoyScan(DIR_E, TX_TUG2_016);
+ mccoyScan(DIR_E, TX_TUG2_016, true);
}
void Room::tug2TalkToGuard1() {
@@ -855,19 +855,19 @@ void Room::tug2TalkToBrig() {
if (_vm->_awayMission.tug.brigForceFieldDown && _vm->_awayMission.tug.talkedToBrigCrewman)
showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_027);
else if (!_vm->_awayMission.tug.brigForceFieldDown)
- mccoyScan(DIR_E, TX_TUG2_015);
+ mccoyScan(DIR_E, TX_TUG2_015, true);
}
void Room::tug2UseMTricorderOnBrig() {
if (_vm->_awayMission.tug.field35 == 6)
- mccoyScan(DIR_E, TX_TUG2_019);
+ mccoyScan(DIR_E, TX_TUG2_019, true);
else if (!_vm->_awayMission.tug.brigForceFieldDown)
- mccoyScan(DIR_E, TX_TUG2_015);
+ mccoyScan(DIR_E, TX_TUG2_015, true);
}
void Room::tug2UseMTricorderOnOpenBrig() {
if (_vm->_awayMission.tug.brigForceFieldDown)
- mccoyScan(DIR_E, TX_TUG2_015);
+ mccoyScan(DIR_E, TX_TUG2_015, true);
}
void Room::tug2UsePhaserAnywhere() {
Commit: dc1e44efb9863333300482bcb4c352cf8de66bf8
https://github.com/scummvm/scummvm/commit/dc1e44efb9863333300482bcb4c352cf8de66bf8
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Most of LOVE2 done
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/love0.cpp
engines/startrek/rooms/love2.cpp
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 341624b..83e16c9 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -41,7 +41,7 @@ void StarTrekEngine::initAwayMission() {
_roomIndexToLoad = -1;
// Load crew positions for beaming in
- initAwayCrewPositions(4);
+ initAwayCrewPositions(0);
}
void StarTrekEngine::runAwayMission() {
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 8b8e7e1..9114bb9 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -149,12 +149,18 @@ struct AwayMission {
bool freezerOpen; // 0x2f
bool chamberHasDish; // 0x30
byte bottleInNozzle; // 0x31
- byte field36; // 0x36
- byte field37; // 0x37
+ bool cabinetOpen; // 0x32
+ bool gasFeedOn; // 0x33
+ byte synthesizerProduct; // 0x34
+ byte field35; // 0x35
+ byte canister1; // 0x36
+ byte canister2; // 0x37
bool field41; // 0x41
bool spockAccessedConsole; // 0x49
bool mccoyAccessedConsole; // 0x4a
bool gotPolyberylcarbonate; // 0x4b
+ bool gotTLDH; // 0x4c (Got romulan laughing gas)
+ bool gotCure; // 0x4f
int16 missionScore; // 0x52
} love;
};
@@ -170,4 +176,12 @@ enum BottleTypes {
BOTTLETYPE_RLG = 4 // Romulan Laughing Gas
};
+// Canister types for Love's Labor Jeopardized
+enum CanisterTypes {
+ CANTYPE_NONE = 0,
+ CANTYPE_O2 = 1,
+ CANTYPE_H2 = 2,
+ CANTYPE_N2 = 3
+};
+
#endif
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index b1b26b0..0564507 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -347,6 +347,10 @@ void Room::showBitmapFor5Ticks(const Common::String &bmpName, int priority) {
_vm->_gfx->delSprite(&sprite);
}
+bool Room::haveItem(int item) {
+ return _vm->_itemList[item - 0x40].have;
+}
+
Common::Point Room::getActorPos(int actorIndex) {
return _vm->_actorList[actorIndex].pos;
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 05db770..371d57f 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -112,6 +112,7 @@ private:
void loadMapFile(const Common::String &name); // Cmd 0x09
void showBitmapFor5Ticks(const Common::String &bmpName, int priority); // Cmd 0x0a
// Command 0x0c: "demon6ShowCase"
+ bool haveItem(int item); // Cmd 0x0b
Common::Point getActorPos(int actorIndex); // Cmd 0x0d
int16 getRandomWordInRange(int start, int end); // Cmd 0x0e
void playSoundEffectIndex(int soundEffect); // Cmd 0x0f
@@ -843,6 +844,97 @@ public:
// LOVE2
void love2Tick1();
+ void love2TouchedWarp1();
+ void love2Timer3Expired();
+ void love2WalkToDoor();
+ void love2TouchedHotspot0();
+ void love2DoorReachedOrOpened();
+ void love2LookAtCabinet();
+ void love2LookAtDoor();
+ void love2LookAtSynthesizer();
+ void love2LookAtAnywhere();
+ void love2LookAtAntigrav();
+ void love2LookAtMccoy();
+ void love2LookAtSpock();
+ void love2LookAtRedshirt();
+ void love2LookAtKirk();
+ void love2LookAtArdak();
+ void love2LookAtChamber();
+ void love2LookAtCan1();
+ void love2LookAtCan2();
+ void love2TalkToKirk();
+ void love2TalkToSpock();
+ void love2TalkToMccoy();
+ void love2TalkToRedshirt();
+ void love2UseMTricorderAnywhere();
+ void love2UseSTricorderAnywhere();
+ void love2UseKirkOnCabinet();
+ void love2UseSpockOnCabinet();
+ void love2UseMccoyOnCabinet();
+ void love2UseRedshirtOnCabinet();
+ void love2CrewmanReachedCabinet();
+ void love2CrewmanAccessedCabinet();
+ void love2CrewmanOpenedOrClosedCabinet();
+ void love2UseWrenchOnGasFeed();
+ void love2ReachedGasFeed();
+ void love2ChangedGasFeed();
+ void love2UseO2GasOnCanisterSlot();
+ void love2UseH2GasOnCanisterSlot();
+ void love2UseN2GasOnCanisterSlot();
+ void love2ReachedCanisterSlot();
+ void love2PutCanisterInSlot1();
+ void love2PutCanisterInSlot2();
+ void love2UseAntigravOnCanister1();
+ void love2ReachedCanisterSlot1ToGet();
+ void love2TookCanister1();
+ void love2UseAntigravOnCanister2();
+ void love2ReachedCanisterSlot2ToGet();
+ void love2TookCanister2();
+ void love2UseKirkOnSynthesizer();
+ void love2UseSpockOnSynthesizer();
+ void love2UseMccoyOnSynthesizer();
+ void love2UseRedshirtOnSynthesizer();
+ void love2CrewmanReachedSynthesizer();
+ void love2CrewmanUsedSynthesizer();
+ void love2SpockReachedGasFeeds();
+ void love2SpockEnabledGasFeeds();
+ void love2UseSynthesizer();
+ void love2SynthesizerDoorClosed();
+ void love2SynthesizerFinished();
+ void love2FinishedAnimation27();
+ void love2UsePolyberylcarbonateOnSynthesizerDoor();
+ void love2KirkReachedSynthesizerWithPolyberylcarbonate();
+ void love2SynthesizerDoorOpenedWithPolyberylcarbonate();
+ void love2PutPolyberylcarbonateInSynthesizer();
+ void love2UseDishesOnSynthesizerDoor();
+ void love2KirkReachedSynthesizerWithDishes();
+ void love2SynthesizerDoorOpenedWithDishes();
+ void love2PutDishesInSynthesizer();
+ void love2UseSampleOnSynthesizerDoor();
+ void love2KirkReachedSynthesizerWithSample();
+ void love2SynthesizerDoorOpenedWithSample();
+ void love2PutSampleInSynthesizer();
+ void love2UseAnythingOnSynthesizerDoor();
+ void love2UseAnythingOnSynthesizer();
+ void love2GetCanister();
+ void love2GetAntigrav();
+ void love2ReachedAntigrav();
+ void love2GotAntigrav();
+ void love2GetPolyberylcarbonate();
+ void love2ReachedPolyberylcarbonate();
+ void love2GotPolyberylcarbonate();
+ void love2GetDishes();
+ void love2ReachedDishes();
+ void love2GotDishes();
+ void love2GetSample();
+ void love2ReachedSample();
+ void love2GotSample();
+ void love2GetSynthesizerOutput();
+ void love2ReachedSynthesizerOutput();
+ void love2GotSynthesizerOutput();
+ void love2GetCure();
+ void love2ReachedCure();
+ void love2GotCure();
// LOVE3
void love3Tick1();
@@ -947,6 +1039,21 @@ private:
byte _1d2b; // 0x1d2b
} love1;
+ struct {
+ byte canisterType; // 0xca
+ byte cb; // 0xcb
+ bool walkingToDoor; // 0xcc
+ byte doorOpenCounter; // 0xcd
+ int16 canisterItem; // 0xce
+ char canisterAnim[10]; // 0xd0
+ int16 d2; // 0xd2
+ char d6[10]; // 0xd6
+ char d8[10]; // 0xd8
+ byte _2966; // 0x2966
+ byte _2967; // 0x2967
+ } love2;
+
+
} _roomVar;
};
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index a1cb928..b16dbff 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -946,6 +946,119 @@ RoomAction love1ActionList[] = {
RoomAction love2ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::love2Tick1 },
+ { Action(ACTION_TOUCHED_WARP, 1, 0, 0), &Room::love2TouchedWarp1 },
+ { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::love2Timer3Expired },
+ { Action(ACTION_WALK, 10, 0, 0), &Room::love2WalkToDoor },
+ { Action(ACTION_WALK, 0x22, 0, 0), &Room::love2WalkToDoor },
+ { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::love2TouchedHotspot0 },
+ { Action(ACTION_FINISHED_WALKING, 14, 0, 0), &Room::love2DoorReachedOrOpened },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::love2DoorReachedOrOpened },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::love2LookAtCabinet },
+ { Action(ACTION_LOOK, 10, 0, 0), &Room::love2LookAtDoor },
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::love2LookAtSynthesizer },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::love2LookAtAnywhere },
+ { Action(ACTION_LOOK, 14, 0, 0), &Room::love2LookAtAntigrav },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::love2LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::love2LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::love2LookAtRedshirt },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::love2LookAtKirk },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::love2LookAtArdak },
+ { Action(ACTION_LOOK, 15, 0, 0), &Room::love2LookAtChamber },
+ { Action(ACTION_LOOK, 16, 0, 0), &Room::love2LookAtChamber },
+ { Action(ACTION_LOOK, 18, 0, 0), &Room::love2LookAtChamber },
+ { Action(ACTION_LOOK, 19, 0, 0), &Room::love2LookAtChamber },
+ { Action(ACTION_LOOK, 17, 0, 0), &Room::love2LookAtChamber },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::love2LookAtChamber },
+ { Action(ACTION_LOOK, 12, 0, 0), &Room::love2LookAtCan1 },
+ { Action(ACTION_LOOK, 13, 0, 0), &Room::love2LookAtCan2 },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::love2TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::love2TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::love2TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::love2TalkToRedshirt },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::love2UseMTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::love2UseSTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_KIRK, 8, 0), &Room::love2UseKirkOnCabinet },
+ { Action(ACTION_USE, OBJECT_SPOCK, 8, 0), &Room::love2UseSpockOnCabinet },
+ { Action(ACTION_USE, OBJECT_MCCOY, 8, 0), &Room::love2UseMccoyOnCabinet },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 8, 0), &Room::love2UseRedshirtOnCabinet },
+ { Action(ACTION_FINISHED_WALKING, 12, 0, 0), &Room::love2CrewmanReachedCabinet },
+ { Action(ACTION_FINISHED_ANIMATION, 11, 0, 0), &Room::love2CrewmanAccessedCabinet },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::love2CrewmanOpenedOrClosedCabinet },
+ { Action(ACTION_USE, OBJECT_IWRENCH, 11, 0), &Room::love2UseWrenchOnGasFeed },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::love2ReachedGasFeed },
+ { Action(ACTION_FINISHED_ANIMATION, 12, 0, 0), &Room::love2ChangedGasFeed },
+ { Action(ACTION_USE, OBJECT_IO2GAS, 0x23, 0), &Room::love2UseO2GasOnCanisterSlot },
+ { Action(ACTION_USE, OBJECT_IH2GAS, 0x23, 0), &Room::love2UseH2GasOnCanisterSlot },
+ { Action(ACTION_USE, OBJECT_IN2GAS, 0x23, 0), &Room::love2UseN2GasOnCanisterSlot },
+ { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::love2ReachedCanisterSlot },
+ { Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::love2PutCanisterInSlot1 },
+ { Action(ACTION_FINISHED_ANIMATION, 14, 0, 0), &Room::love2PutCanisterInSlot2 },
+ { Action(ACTION_USE, OBJECT_IANTIGRA, 12, 0), &Room::love2UseAntigravOnCanister1 },
+ { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::love2ReachedCanisterSlot1ToGet },
+ { Action(ACTION_FINISHED_ANIMATION, 15, 0, 0), &Room::love2TookCanister1 },
+ { Action(ACTION_USE, OBJECT_IANTIGRA, 13, 0), &Room::love2UseAntigravOnCanister2 },
+ { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::love2ReachedCanisterSlot2ToGet },
+ { Action(ACTION_FINISHED_ANIMATION, 16, 0, 0), &Room::love2TookCanister2 },
+ { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::love2UseKirkOnSynthesizer },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::love2UseSpockOnSynthesizer },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::love2UseMccoyOnSynthesizer },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::love2UseRedshirtOnSynthesizer },
+ { Action(ACTION_FINISHED_WALKING, 13, 0, 0), &Room::love2CrewmanReachedSynthesizer },
+ { Action(ACTION_FINISHED_ANIMATION, 17, 0, 0), &Room::love2CrewmanUsedSynthesizer },
+ { Action(ACTION_FINISHED_WALKING, 16, 0, 0), &Room::love2SpockReachedGasFeeds },
+ { Action(ACTION_FINISHED_ANIMATION, 18, 0, 0), &Room::love2SpockEnabledGasFeeds },
+ { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love2SynthesizerDoorClosed },
+ { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love2SynthesizerFinished },
+ { Action(ACTION_FINISHED_ANIMATION, 27, 0, 0), &Room::love2FinishedAnimation27 },
+
+ // TODO: more
+
+ { Action(ACTION_USE, OBJECT_IPBC, 9, 0), &Room::love2UsePolyberylcarbonateOnSynthesizerDoor },
+ { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::love2KirkReachedSynthesizerWithPolyberylcarbonate },
+ { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::love2SynthesizerDoorOpenedWithPolyberylcarbonate },
+ { Action(ACTION_FINISHED_ANIMATION, 19, 0, 0), &Room::love2PutPolyberylcarbonateInSynthesizer },
+
+ { Action(ACTION_USE, OBJECT_IDISHES, 9, 0), &Room::love2UseDishesOnSynthesizerDoor },
+ { Action(ACTION_FINISHED_WALKING, 7, 0, 0), &Room::love2KirkReachedSynthesizerWithDishes },
+ { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love2SynthesizerDoorOpenedWithDishes },
+ { Action(ACTION_FINISHED_ANIMATION, 20, 0, 0), &Room::love2PutDishesInSynthesizer },
+
+ { Action(ACTION_USE, OBJECT_ISAMPLE, 9, 0), &Room::love2UseSampleOnSynthesizerDoor },
+ { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::love2KirkReachedSynthesizerWithSample },
+ { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::love2SynthesizerDoorOpenedWithSample },
+ { Action(ACTION_FINISHED_ANIMATION, 21, 0, 0), &Room::love2PutSampleInSynthesizer },
+
+ { Action(ACTION_USE, -1, 9, 0), &Room::love2UseAnythingOnSynthesizerDoor },
+ { Action(ACTION_USE, -1, 0x20, 0), &Room::love2UseAnythingOnSynthesizer },
+ { Action(ACTION_GET, 13, 0, 0), &Room::love2GetCanister },
+ { Action(ACTION_GET, 12, 0, 0), &Room::love2GetCanister },
+
+ { Action(ACTION_GET, 14, 0, 0), &Room::love2GetAntigrav },
+ { Action(ACTION_FINISHED_WALKING, 9, 0, 0), &Room::love2ReachedAntigrav },
+ { Action(ACTION_FINISHED_ANIMATION, 22, 0, 0), &Room::love2GotAntigrav },
+
+ { Action(ACTION_GET, 16, 0, 0), &Room::love2GetPolyberylcarbonate },
+ { Action(ACTION_FINISHED_WALKING, 18, 0, 0), &Room::love2ReachedPolyberylcarbonate },
+ { Action(ACTION_FINISHED_ANIMATION, 26, 0, 0), &Room::love2GotPolyberylcarbonate },
+
+ { Action(ACTION_GET, 17, 0, 0), &Room::love2GetDishes },
+ { Action(ACTION_FINISHED_WALKING, 17, 0, 0), &Room::love2ReachedDishes },
+ { Action(ACTION_FINISHED_ANIMATION, 25, 0, 0), &Room::love2GotDishes },
+
+ { Action(ACTION_GET, 18, 0, 0), &Room::love2GetSample },
+ { Action(ACTION_FINISHED_WALKING, 19, 0, 0), &Room::love2ReachedSample },
+ { Action(ACTION_FINISHED_ANIMATION, 28, 0, 0), &Room::love2GotSample },
+
+ { Action(ACTION_GET, 15, 0, 0), &Room::love2GetSynthesizerOutput },
+ { Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::love2ReachedSynthesizerOutput },
+ { Action(ACTION_FINISHED_ANIMATION, 23, 0, 0), &Room::love2GotSynthesizerOutput },
+
+ // TODO: test these
+ { Action(ACTION_GET, 19, 0, 0), &Room::love2GetCure },
+ { Action(ACTION_FINISHED_WALKING, 11, 0, 0), &Room::love2ReachedCure },
+ { Action(ACTION_FINISHED_ANIMATION, 24, 0, 0), &Room::love2GotCure },
+
+ // TODO: common code
};
RoomAction love3ActionList[] = {
diff --git a/engines/startrek/rooms/love0.cpp b/engines/startrek/rooms/love0.cpp
index e4e3932..d43f35d 100644
--- a/engines/startrek/rooms/love0.cpp
+++ b/engines/startrek/rooms/love0.cpp
@@ -34,8 +34,8 @@ namespace StarTrek {
void Room::love0Tick1() {
if (!_vm->_awayMission.love.alreadyStartedMission) {
- _vm->_awayMission.love.field36 = 1;
- _vm->_awayMission.love.field37 = 2;
+ _vm->_awayMission.love.canister1 = CANTYPE_O2;
+ _vm->_awayMission.love.canister2 = CANTYPE_H2;
_vm->_awayMission.love.alreadyStartedMission = true;
playVoc("LOV0LOOP"); // FIXME: no audio after first entry?
}
diff --git a/engines/startrek/rooms/love2.cpp b/engines/startrek/rooms/love2.cpp
index 43cdd64..1744b10 100644
--- a/engines/startrek/rooms/love2.cpp
+++ b/engines/startrek/rooms/love2.cpp
@@ -20,16 +20,837 @@
*
*/
+// BUGFIX: some of the audio filenames in the text were incorrect? (see text.h)
+
#include "startrek/room.h"
-#define OBJECT_DOOR1 8
+#define OBJECT_CABINET 8
+#define OBJECT_SYNTHESIZER_DOOR 9
+#define OBJECT_DOOR 10
+#define OBJECT_GAS_FEED 11
+#define OBJECT_CAN1 12
+#define OBJECT_CAN2 13
+#define OBJECT_ANTIGRAV 14
+#define OBJECT_SYNTHESIZER_OUTPUT 15
+#define OBJECT_POLYBERYLCARBONATE 16
+#define OBJECT_DISHES 17
+#define OBJECT_CURESAMPLE 18
+#define OBJECT_CURE 19
-#define HOTSPOT_CONSOLE 0x20
+#define HOTSPOT_SYNTHESIZER 0x20
+#define HOTSPOT_ARDAK 0x21
+#define HOTSPOT_DOOR 0x22
+#define HOTSPOT_CANISTER_SLOT 0x23
namespace StarTrek {
void Room::love2Tick1() {
+ playVoc("LOV2LOOP");
+
+ char canName[10];
+
+ switch (_vm->_awayMission.love.canister1) {
+ case CANTYPE_O2:
+ strcpy(canName, "o2can");
+ break;
+ case CANTYPE_H2:
+ strcpy(canName, "h2can");
+ break;
+ case CANTYPE_N2:
+ strcpy(canName, "n2can");
+ break;
+ default:
+ break;
+ }
+
+ if (_vm->_awayMission.love.canister1 >= 1 && _vm->_awayMission.love.canister1 <= 3)
+ loadActorAnim(OBJECT_CAN1, canName, 0xa7, 0xae, 0);
+
+ switch (_vm->_awayMission.love.canister2) {
+ case CANTYPE_O2:
+ strcpy(canName, "o2can");
+ break;
+ case CANTYPE_H2:
+ strcpy(canName, "h2can");
+ break;
+ case CANTYPE_N2:
+ strcpy(canName, "n2can");
+ break;
+ default:
+ break;
+ }
+
+ if (_vm->_awayMission.love.canister2 >= 1 && _vm->_awayMission.love.canister2 <= 3)
+ loadActorAnim(OBJECT_CAN2, canName, 0xb1, 0xaf, 0);
+
+ if (_vm->_awayMission.love.gasFeedOn)
+ loadActorAnim(OBJECT_GAS_FEED, "s3r3vo", 0xac, 0x75, 0);
+ else
+ loadActorAnim(OBJECT_GAS_FEED, "s3r3vc", 0xac, 0x75, 0);
+
+ if (_vm->_awayMission.love.cabinetOpen)
+ loadActorAnim(OBJECT_CABINET, "s3r3d1o", 0x1e, 0xaf, 0);
+ else
+ loadActorAnim(OBJECT_CABINET, "s3r3d1c", 0x1e, 0xaf, 0);
+
+ if (_vm->_awayMission.love.cabinetOpen && !haveItem(OBJECT_IANTIGRA))
+ loadActorAnim(OBJECT_ANTIGRAV, "antigr", 0x1f, 0xa7, 0);
+
+ if (_vm->_awayMission.love.field35 != 0)
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2o", 0x8a, 0x8d, 0);
+ else
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2c", 0x8a, 0x8d, 0);
+
+ bool valid = true;
+
+ switch (_vm->_awayMission.love.field35) {
+ case 1:
+ strcpy(_roomVar.love2.d6, "pbcanm");
+ _roomVar.love2.d2 = 0x10;
+ break;
+ case 2:
+ strcpy(_roomVar.love2.d6, "dishes");
+ _roomVar.love2.d2 = 0x11;
+ break;
+ case 3:
+ strcpy(_roomVar.love2.d6, "dishes");
+ _roomVar.love2.d2 = 0x12;
+ break;
+ case 9:
+ switch (_vm->_awayMission.love.synthesizerProduct) {
+ case 1:
+ strcpy(_roomVar.love2.d8, "btle1");
+ _roomVar.love2.d2 = 0x0f;
+ break;
+ case 2:
+ strcpy(_roomVar.love2.d8, "btle2");
+ _roomVar.love2.d2 = 0x0f;
+ break;
+ case 3:
+ strcpy(_roomVar.love2.d8, "btle3");
+ _roomVar.love2.d2 = 0x0f;
+ break;
+ case 4:
+ strcpy(_roomVar.love2.d8, "btle4");
+ _roomVar.love2.d2 = 0x0f;
+ break;
+ default:
+ strcpy(_roomVar.love2.d8, "cure");
+ _roomVar.love2.d2 = 0x13;
+ break;
+ }
+ break;
+ default:
+ valid = false;
+ break;
+ }
+
+ if (valid) {
+ if (_vm->_awayMission.love.field35 == 9)
+ loadActorAnim2(_roomVar.love2.d2, _roomVar.love2.d8, 0x8a, 0x8b, 0);
+ else
+ loadActorAnim2(_roomVar.love2.d2, _roomVar.love2.d6, 0x8a, 0x8b, 0);
+ }
+
+ if (_vm->_awayMission.love.field2c)
+ _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
+ if (_vm->_awayMission.love.field2d)
+ _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
+ _vm->_awayMission.timers[2] = 200;
+
+ loadActorAnim(OBJECT_DOOR, "s3r3d3a", 0x12a, 0xb5, 0);
+
+ _roomVar.love2._2966 = 0xc9;
+ _roomVar.love2._2967 = 0xb7;
+}
+
+void Room::love2TouchedWarp1() {
+ _vm->_awayMission.disableInput = true;
+ playSoundEffectIndex(SND_DOOR1);
+ _vm->_awayMission.timers[3] = 10;
+}
+
+void Room::love2Timer3Expired() {
+ loadRoomIndex(0, 0);
+}
+
+void Room::love2WalkToDoor() {
+ _vm->_awayMission.disableInput = true;
+ _roomVar.love2.walkingToDoor = true;
+ walkCrewman(OBJECT_KIRK, 0x127, 0xba, 14);
+}
+
+// Triggers door opening
+void Room::love2TouchedHotspot0() {
+ if (_roomVar.love2.walkingToDoor) {
+ loadActorAnim(OBJECT_DOOR, "s3r3d3", 0x12a, 0xb5, 1);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+}
+
+void Room::love2DoorReachedOrOpened() {
+ _roomVar.love2.doorOpenCounter++;
+ if (_roomVar.love2.doorOpenCounter == 2)
+ loadRoomIndex(1, 1);
+}
+
+void Room::love2LookAtCabinet() {
+ showText(TX_LOV2N027);
+}
+
+void Room::love2LookAtDoor() {
+ showText(TX_LOV2N001);
+}
+
+void Room::love2LookAtSynthesizer() {
+ showText(TX_LOV2N028);
+}
+
+void Room::love2LookAtAnywhere() {
+ showText(TX_LOV2N026);
+}
+
+void Room::love2LookAtAntigrav() {
+ showText(TX_LOV2N006);
+}
+
+void Room::love2LookAtMccoy() {
+ showText(TX_LOV2N011);
+}
+
+void Room::love2LookAtSpock() {
+ showText(TX_LOV2N014);
+}
+
+void Room::love2LookAtRedshirt() {
+ showText(TX_LOV2N010);
+}
+
+void Room::love2LookAtKirk() {
+ showText(TX_LOV2N009);
+}
+
+void Room::love2LookAtArdak() {
+ showText(TX_LOV2N045);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_037);
+}
+
+void Room::love2LookAtChamber() {
+ showText(TX_LOV2N029);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_035);
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_019);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_033);
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_016);
+}
+
+void Room::love2LookAtCan1() {
+ switch (_vm->_awayMission.love.canister1) {
+ case CANTYPE_O2:
+ showText(TX_LOV2N004);
+ break;
+ case CANTYPE_H2:
+ showText(TX_LOV2N002);
+ break;
+ case CANTYPE_N2:
+ default:
+ showText(TX_LOV2N003);
+ break;
+ }
+}
+
+void Room::love2LookAtCan2() {
+ switch (_vm->_awayMission.love.canister2) {
+ case CANTYPE_O2:
+ showText(TX_LOV2N004);
+ break;
+ case CANTYPE_H2:
+ showText(TX_LOV2N002);
+ break;
+ case CANTYPE_N2:
+ default:
+ showText(TX_LOV2N003);
+ break;
+ }
+}
+
+void Room::love2TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_LOV2_001);
+}
+
+void Room::love2TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_029);
+}
+
+void Room::love2TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_009);
+}
+
+void Room::love2TalkToRedshirt() {
+ showText(TX_SPEAKER_FERRIS, TX_LOV2_041);
+}
+
+void Room::love2UseMTricorderAnywhere() {
+ if (_vm->_awayMission.love.knowAboutVirus)
+ mccoyScan(DIR_S, TX_LOV2_008, false);
+ else
+ // BUGFIX: should be TX_LOV2_012, but the audio file is missing. Using equivalent
+ // audio from another room.
+ mccoyScan(DIR_S, TX_LOV1_010, false);
+}
+
+void Room::love2UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_LOV2_027, false);
+}
+
+void Room::love2UseKirkOnCabinet() {
+ _roomVar.love2.d2 = OBJECT_KIRK;
+ walkCrewman(OBJECT_KIRK, 0x2b, 0xbb, 12);
+}
+
+void Room::love2UseSpockOnCabinet() {
+ _roomVar.love2.d2 = OBJECT_SPOCK;
+ walkCrewman(OBJECT_SPOCK, 0x2b, 0xbb, 12);
+}
+
+void Room::love2UseMccoyOnCabinet() {
+ _roomVar.love2.d2 = OBJECT_MCCOY;
+ walkCrewman(OBJECT_MCCOY, 0x2b, 0xbb, 12);
+}
+
+void Room::love2UseRedshirtOnCabinet() {
+ _roomVar.love2.d2 = OBJECT_REDSHIRT;
+ walkCrewman(OBJECT_REDSHIRT, 0x2b, 0xbb, 12);
+}
+
+void Room::love2CrewmanReachedCabinet() {
+ Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love2.d2, "usehw");
+ loadActorAnim2(_roomVar.love2.d2, anim, -1, -1, 11);
+}
+
+void Room::love2CrewmanAccessedCabinet() {
+ if (_vm->_awayMission.love.cabinetOpen)
+ loadActorAnim2(OBJECT_CABINET, "s3r3d4", 0x1e, 0xaf, 2);
+ else
+ loadActorAnim2(OBJECT_CABINET, "s3r3d1", 0x1e, 0xaf, 2);
+
+ playSoundEffectIndex(SND_DOOR1);
+
+ if (_vm->_awayMission.love.cabinetOpen)
+ loadActorStandAnim(OBJECT_ANTIGRAV);
+
+ _vm->_awayMission.love.cabinetOpen = !_vm->_awayMission.love.cabinetOpen;
+}
+
+void Room::love2CrewmanOpenedOrClosedCabinet() {
+ if (_vm->_awayMission.love.cabinetOpen && !haveItem(OBJECT_IANTIGRA))
+ loadActorAnim(OBJECT_ANTIGRAV, "antigr", 0x1f, 0xa7, 0);
+}
+
+void Room::love2UseWrenchOnGasFeed() {
+ walkCrewman(OBJECT_KIRK, 0xa8, 0xb7, 1);
+}
+
+void Room::love2ReachedGasFeed() {
+ loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 12);
+ playVoc("MUR3E1S");
+}
+
+void Room::love2ChangedGasFeed() {
+ if (_vm->_awayMission.love.gasFeedOn) {
+ _vm->_awayMission.love.gasFeedOn = false;
+ loadActorAnim2(OBJECT_GAS_FEED, "s3r3v2", 0xac, 0x75, 0);
+ showText(TX_LOV2N007);
+ }
+ else {
+ _vm->_awayMission.love.gasFeedOn = true;
+ loadActorAnim2(OBJECT_GAS_FEED, "s3r3v1", 0xac, 0x75, 0);
+ showText(TX_LOV2N008);
+ }
+}
+
+void Room::love2UseO2GasOnCanisterSlot() {
+ _roomVar.love2.canisterType = CANTYPE_O2;
+ strcpy(_roomVar.love2.canisterAnim, "o2can");
+ _roomVar.love2.canisterItem = OBJECT_IO2GAS;
+ walkCrewman(OBJECT_KIRK, 0xa8, 0xb7, 3);
+}
+
+void Room::love2UseH2GasOnCanisterSlot() {
+ _roomVar.love2.canisterType = CANTYPE_H2;
+ strcpy(_roomVar.love2.canisterAnim, "h2can");
+ _roomVar.love2.canisterItem = OBJECT_IH2GAS;
+ walkCrewman(OBJECT_KIRK, 0xa8, 0xb7, 3);
+}
+
+void Room::love2UseN2GasOnCanisterSlot() {
+ _roomVar.love2.canisterType = CANTYPE_N2;
+ strcpy(_roomVar.love2.canisterAnim, "n2can");
+ _roomVar.love2.canisterItem = OBJECT_IN2GAS;
+ walkCrewman(OBJECT_KIRK, 0xa8, 0xb7, 3);
+}
+
+void Room::love2ReachedCanisterSlot() {
+ if (_vm->_awayMission.love.gasFeedOn)
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_026);
+ else {
+ if (_vm->_awayMission.love.canister1 == CANTYPE_NONE)
+ loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 13);
+ else if (_vm->_awayMission.love.canister2 == CANTYPE_NONE)
+ loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 14);
+ else
+ showText(TX_LOV2N024);
+ }
+}
+
+void Room::love2PutCanisterInSlot1() {
+ playVoc("SE6FOOD");
+ loadActorAnim(OBJECT_CAN1, _roomVar.love2.canisterAnim, 0xa7, 0xae, 0);
+ _vm->_awayMission.love.canister1 = _roomVar.love2.canisterType;
+ showText(TX_LOV2N034);
+ loseItem(_roomVar.love2.canisterItem);
+}
+
+void Room::love2PutCanisterInSlot2() {
+ playVoc("SE6FOOD");
+ loadActorAnim(OBJECT_CAN2, _roomVar.love2.canisterAnim, 0xb1, 0xaf, 0);
+ _vm->_awayMission.love.canister2 = _roomVar.love2.canisterType;
+ showText(TX_LOV2N035);
+ loseItem(_roomVar.love2.canisterItem);
+}
+
+void Room::love2UseAntigravOnCanister1() {
+ walkCrewman(OBJECT_KIRK, 0xa8, 0xb7, 4);
+}
+
+void Room::love2ReachedCanisterSlot1ToGet() {
+ if (_vm->_awayMission.love.gasFeedOn)
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_025);
+ else {
+ loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 15);
+ // BUGFIX: original game only played this for canister 2
+ playVoc("SEPLBAT");
+ }
+}
+
+void Room::love2TookCanister1() {
+ showText(TX_LOV2N030);
+ loadActorStandAnim(OBJECT_CAN1);
+
+ switch (_vm->_awayMission.love.canister1) {
+ case CANTYPE_O2:
+ giveItem(OBJECT_IO2GAS);
+ break;
+ case CANTYPE_H2:
+ giveItem(OBJECT_IH2GAS);
+ break;
+ case CANTYPE_N2:
+ default:
+ giveItem(OBJECT_IN2GAS);
+ break;
+ }
+}
+
+void Room::love2UseAntigravOnCanister2() {
+ walkCrewman(OBJECT_KIRK, 0xa8, 0xb7, 5);
+}
+
+void Room::love2ReachedCanisterSlot2ToGet() {
+ if (_vm->_awayMission.love.gasFeedOn)
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_025);
+ else {
+ loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 16);
+ playVoc("SEPLBAT");
+ }
+}
+
+void Room::love2TookCanister2() {
+ showText(TX_LOV2N031);
+ loadActorStandAnim(OBJECT_CAN2);
+
+ switch (_vm->_awayMission.love.canister2) {
+ case CANTYPE_O2:
+ giveItem(OBJECT_IO2GAS);
+ break;
+ case CANTYPE_H2:
+ giveItem(OBJECT_IH2GAS);
+ break;
+ case CANTYPE_N2:
+ default:
+ giveItem(OBJECT_IN2GAS);
+ break;
+ }
+}
+
+void Room::love2UseKirkOnSynthesizer() {
+ _roomVar.love2.d2 = OBJECT_KIRK;
+ walkCrewman(_roomVar.love2.d2, 0x46, 0xae, 13);
+}
+
+void Room::love2UseSpockOnSynthesizer() {
+ _roomVar.love2.d2 = OBJECT_SPOCK;
+ walkCrewman(_roomVar.love2.d2, 0x46, 0xae, 13);
+}
+
+void Room::love2UseMccoyOnSynthesizer() {
+ _roomVar.love2.d2 = OBJECT_MCCOY;
+ walkCrewman(_roomVar.love2.d2, 0x46, 0xae, 13);
+}
+
+void Room::love2UseRedshirtOnSynthesizer() {
+ _roomVar.love2.d2 = OBJECT_REDSHIRT;
+ walkCrewman(_roomVar.love2.d2, 0x46, 0xae, 13);
+}
+
+void Room::love2CrewmanReachedSynthesizer() {
+ Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love2.d2, "usemn");
+ loadActorAnim2(_roomVar.love2.d2, anim, -1, -1, 17);
+}
+
+void Room::love2CrewmanUsedSynthesizer() {
+ if (_vm->_awayMission.love.gasFeedOn) {
+ love2UseSynthesizer();
+ }
+ else {
+ if (_roomVar.love2.cb == 3) {
+ if (haveItem(OBJECT_IWRENCH)) {
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_005);
+ walkCrewman(OBJECT_SPOCK, 0xa8, 0xb7, 16);
+ }
+ else
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_006);
+ }
+ else {
+ _roomVar.love2.cb++;
+ showText(TX_LOV2N012);
+ }
+ }
+}
+
+
+void Room::love2SpockReachedGasFeeds() {
+ loadActorAnim2(OBJECT_SPOCK, "susehn", -1, -1, 18);
+}
+
+void Room::love2SpockEnabledGasFeeds() {
+ _vm->_awayMission.love.gasFeedOn = true;
+
+ loadActorAnim2(OBJECT_GAS_FEED, "s3r3v1", 0xac, 0x75, 0);
+ showText(TX_LOV2N008);
+ walkCrewman(OBJECT_SPOCK, 0xc6, 0xbb, 0);
+
+ love2UseSynthesizer();
+}
+
+void Room::love2UseSynthesizer() {
+ if (_vm->_awayMission.love.canister1 != 0) {
+ if (_vm->_awayMission.love.canister2 != 0) {
+ // TODO
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 3);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+ else {
+ playVoc("EFX24");
+ showText(TX_LOV2N005);
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_010);
+ }
+ }
+ else {
+ playVoc("EFX24");
+ showText(TX_SPEAKER_SPOCK, TX_LOV2N005);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_024);
+ }
+}
+
+void Room::love2SynthesizerDoorClosed() {
+ playVoc("LD1SCAN");
+ loadActorAnim(OBJECT_SYNTHESIZER_OUTPUT, _roomVar.love2.d8, 0x8a, 0x8d, 4);
+ _vm->_awayMission.love.field35 = 9;
+}
+
+// Final product of synthesizer is produced
+void Room::love2SynthesizerFinished() {
+ switch (_vm->_awayMission.love.synthesizerProduct) {
+ case BOTTLETYPE_N2O:
+ showText(TX_LOV2N017);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_032);
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_015);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_036);
+ break;
+
+ case BOTTLETYPE_NH3:
+ showText(TX_LOV2N016);
+ if (!_vm->_awayMission.redshirtDead) {
+ showText(TX_SPEAKER_FERRIS, TX_LOV2_043);
+ showText(TX_SPEAKER_KIRK, TX_LOV2_003);
+ }
+ break;
+
+ case BOTTLETYPE_H2O:
+ showText(TX_LOV2N018);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_004);
+ break;
+
+ case BOTTLETYPE_RLG:
+ default:
+ showText(TX_LOV2N019);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_031);
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_018);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_030);
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_022);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_038);
+ break;
+ }
+}
+
+void Room::love2FinishedAnimation27() {
+ // TODO: better name
+ _vm->_awayMission.love.synthesizerProduct = BOTTLETYPE_RLG;
+ strcpy(_roomVar.love2.d8, "btle4");
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 3);
+ playSoundEffectIndex(SND_DOOR1);
+}
+
+
+// Put polycarbonate in synthesizer
+void Room::love2UsePolyberylcarbonateOnSynthesizerDoor() {
+ walkCrewman(OBJECT_KIRK, 0x85, 0xad, 6);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love2KirkReachedSynthesizerWithPolyberylcarbonate() {
+ if (_vm->_awayMission.love.field35 != 0)
+ showText(TX_LOV2N025);
+ else {
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 5);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+}
+
+void Room::love2SynthesizerDoorOpenedWithPolyberylcarbonate() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 19);
+}
+
+void Room::love2PutPolyberylcarbonateInSynthesizer() {
+ loadActorAnim(OBJECT_POLYBERYLCARBONATE, "pbcanm", 0x8a, 0x8b, 0);
+ loseItem(OBJECT_IPBC);
+ _vm->_awayMission.love.field35 = 1;
+}
+
+
+// Put dish (virus sample) in synthesizer
+void Room::love2UseDishesOnSynthesizerDoor() {
+ walkCrewman(OBJECT_KIRK, 0x85, 0xad, 7);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love2KirkReachedSynthesizerWithDishes() {
+ if (_vm->_awayMission.love.field35 != 0)
+ showText(TX_LOV2N025);
+ else {
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 6);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+}
+
+void Room::love2SynthesizerDoorOpenedWithDishes() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 20);
+}
+
+void Room::love2PutDishesInSynthesizer() {
+ loadActorAnim(OBJECT_DISHES, "dishes", 0x8a, 0x8b, 0);
+ loseItem(OBJECT_IDISHES);
+ _vm->_awayMission.love.field35 = 2;
+}
+
+
+// Put cure sample in synthesizer
+void Room::love2UseSampleOnSynthesizerDoor() {
+ walkCrewman(OBJECT_KIRK, 0x85, 0xad, 8);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love2KirkReachedSynthesizerWithSample() {
+ if (_vm->_awayMission.love.field35 != 0)
+ showText(TX_LOV2N025); // BUGFIX: original didn't play audio
+ else {
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 7);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+}
+
+void Room::love2SynthesizerDoorOpenedWithSample() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 21);
+}
+
+void Room::love2PutSampleInSynthesizer() {
+ loadActorAnim(OBJECT_CURESAMPLE, "dishes", 0x8a, 0x8b, 0);
+ loseItem(OBJECT_ISAMPLE);
+ _vm->_awayMission.love.field35 = 3;
+}
+
+
+
+void Room::love2UseAnythingOnSynthesizerDoor() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_014);
+}
+
+void Room::love2UseAnythingOnSynthesizer() {
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_007);
+}
+
+void Room::love2GetCanister() {
+ if (_vm->_awayMission.redshirtDead)
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_011);
+ else
+ showText(TX_SPEAKER_FERRIS, TX_LOV2_040);
+}
+
+
+// Get antigrav from cabinet
+void Room::love2GetAntigrav() {
+ walkCrewman(OBJECT_KIRK, 0x37, 0xb4, 9);
+}
+
+void Room::love2ReachedAntigrav() {
+ loadActorAnim2(OBJECT_KIRK, "kusehw", -1, -1, 22);
+}
+
+void Room::love2GotAntigrav() {
+ loadActorStandAnim(OBJECT_ANTIGRAV);
+ giveItem(OBJECT_IANTIGRA);
+ showText(TX_LOV2N042);
+}
+
+
+// Get polyberylcarbonate from synthesizer
+void Room::love2GetPolyberylcarbonate() {
+ walkCrewman(OBJECT_KIRK, 0x85, 0xad, 18);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love2ReachedPolyberylcarbonate() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 26);
+}
+
+void Room::love2GotPolyberylcarbonate() {
+ loadActorStandAnim(OBJECT_POLYBERYLCARBONATE);
+ showText(TX_LOV2N044);
+ giveItem(OBJECT_IPBC);
+ _vm->_awayMission.love.field35 = 0;
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
+ playSoundEffectIndex(SND_DOOR1);
+}
+
+
+// Get virus sample from synthesizer
+void Room::love2GetDishes() {
+ walkCrewman(OBJECT_KIRK, 0x85, 0xad, 17);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love2ReachedDishes() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 25);
+}
+
+void Room::love2GotDishes() {
+ loadActorStandAnim(OBJECT_DISHES);
+ showText(TX_LOV2N036);
+ giveItem(OBJECT_IDISHES);
+ _vm->_awayMission.love.field35 = 0;
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
+ playSoundEffectIndex(SND_DOOR1);
+}
+
+
+// Get cure sample from synthesizer
+void Room::love2GetSample() {
+ walkCrewman(OBJECT_KIRK, 0x85, 0xad, 19);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love2ReachedSample() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 28);
+}
+
+void Room::love2GotSample() {
+ loadActorStandAnim(OBJECT_CURESAMPLE);
+ showText(TX_LOV2N037);
+ giveItem(OBJECT_ISAMPLE);
+ _vm->_awayMission.love.field35 = 0;
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
+ playSoundEffectIndex(SND_DOOR1);
+}
+
+
+// Get synthesizer output
+void Room::love2GetSynthesizerOutput() {
+ walkCrewman(OBJECT_KIRK, 0x85, 0xad, 10);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love2ReachedSynthesizerOutput() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 23);
+}
+
+void Room::love2GotSynthesizerOutput() {
+ switch (_vm->_awayMission.love.synthesizerProduct) {
+ case BOTTLETYPE_N2O:
+ showText(TX_LOV2N040);
+ giveItem(OBJECT_IN2O);
+ break;
+
+ case BOTTLETYPE_NH3:
+ showText(TX_LOV2N039);
+ giveItem(OBJECT_INH3);
+ break;
+
+ case BOTTLETYPE_H2O:
+ showText(TX_LOV2N041);
+ giveItem(OBJECT_IH2O);
+ break;
+
+ case BOTTLETYPE_RLG:
+ default:
+ showText(TX_LOV2N038);
+ if (!_vm->_awayMission.love.gotTLDH) {
+ _vm->_awayMission.love.gotTLDH = true;
+ _vm->_awayMission.love.missionScore += 4;
+ }
+ giveItem(OBJECT_IRLG);
+ break;
+ }
+
+ loadActorStandAnim(OBJECT_SYNTHESIZER_OUTPUT);
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
+ playSoundEffectIndex(SND_DOOR1);
+
+ _vm->_awayMission.love.field35 = 0;
+ _vm->_awayMission.love.synthesizerProduct = 0;
+}
+
+// Get the cure
+void Room::love2GetCure() {
+ walkCrewman(OBJECT_KIRK, 0x85, 0xad, 11);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love2ReachedCure() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 24);
+}
+
+void Room::love2GotCure() {
+ if (!_vm->_awayMission.love.gotCure) {
+ _vm->_awayMission.love.gotCure = true;
+ _vm->_awayMission.love.missionScore += 5;
+ }
+
+ giveItem(OBJECT_ICURE);
+ loadActorStandAnim(OBJECT_CURE);
+ showText(TX_LOV2N043);
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
+ playSoundEffectIndex(SND_DOOR1);
+ _vm->_awayMission.love.field35 = 0;
}
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 4fd6b40..26c8c54 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -84,7 +84,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxHasMultipleChoices = false;
_missionToLoad = "LOVE";
- _roomIndexToLoad = 0;
+ _roomIndexToLoad = 2;
for (int i = 0; i < NUM_OBJECTS; i++)
_itemList[i] = g_itemList[i];
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 81a198d..b6b1c0d 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -796,7 +796,6 @@ enum GameStringIDs {
TX_LOV0N007,
TX_LOV0N008,
TX_LOV0N009,
- TX_LOV2N005,
TX_LOV5_015,
TX_LOV5_019,
TX_LOV5_027,
@@ -873,6 +872,97 @@ enum GameStringIDs {
TX_LOV1N035,
+ TX_LOV2_001,
+ TX_LOV2_002,
+ TX_LOV2_003,
+ TX_LOV2_004,
+ TX_LOV2_005,
+ TX_LOV2_006,
+ TX_LOV2_007,
+ TX_LOV2_008,
+ TX_LOV2_009,
+ TX_LOV2_010,
+ TX_LOV2_011,
+ TX_LOV2_012,
+ TX_LOV2_014,
+ TX_LOV2_015,
+ TX_LOV2_016,
+ TX_LOV2_017,
+ TX_LOV2_018,
+ TX_LOV2_019,
+ TX_LOV2_020,
+ TX_LOV2_021,
+ TX_LOV2_022,
+ TX_LOV2_023,
+ TX_LOV2_024,
+ TX_LOV2_025,
+ TX_LOV2_026,
+ TX_LOV2_027,
+ TX_LOV2_028,
+ TX_LOV2_029,
+ TX_LOV2_030,
+ TX_LOV2_031,
+ TX_LOV2_032,
+ TX_LOV2_033,
+ TX_LOV2_034,
+ TX_LOV2_035,
+ TX_LOV2_036,
+ TX_LOV2_037,
+ TX_LOV2_038,
+ TX_LOV2_039,
+ TX_LOV2_040,
+ TX_LOV2_041,
+ TX_LOV2_043,
+ TX_LOV2N000,
+ TX_LOV2N001,
+ TX_LOV2N002,
+ TX_LOV2N003,
+ TX_LOV2N004,
+ TX_LOV2N005,
+ TX_LOV2N006,
+ TX_LOV2N007,
+ TX_LOV2N008,
+ TX_LOV2N009,
+ TX_LOV2N010,
+ TX_LOV2N011,
+ TX_LOV2N012,
+ TX_LOV2N013,
+ TX_LOV2N014,
+ TX_LOV2N015,
+ TX_LOV2N016,
+ TX_LOV2N017,
+ TX_LOV2N018,
+ TX_LOV2N019,
+ TX_LOV2N024,
+ TX_LOV2N025,
+ TX_LOV2N026,
+ TX_LOV2N027,
+ TX_LOV2N028,
+ TX_LOV2N029,
+ TX_LOV2N030,
+ TX_LOV2N031,
+ TX_LOV2N033,
+ TX_LOV2N034,
+ TX_LOV2N035,
+ TX_LOV2N036,
+ TX_LOV2N037,
+ TX_LOV2N038,
+ TX_LOV2N039,
+ TX_LOV2N040,
+ TX_LOV2N041,
+ TX_LOV2N042,
+ TX_LOV2N043,
+ TX_LOV2N044,
+ TX_LOV2N045,
+ TX_LOV2N046,
+ TX_LOV2N047,
+ TX_LOV2N048,
+ TX_LOV2N049,
+ TX_LOV2N050,
+ TX_LOV2N051,
+
+
+
TX_END
};
@@ -1616,7 +1706,6 @@ const char * const g_gameStrings[] = {
"#LOV0\\LOV0N007#This is a heavily secured door, leading to another section of the station. Its access code has been breached.",
"#LOV0\\LOV0N008#This is a standard door, leading to another room on this deck.",
"#LOV0\\LOV0N009#You are on the bridge of the ARK7.",
- "#LOV2\\LOV2N005#A loud hissing fills the room.",
"#LOV5\\LOV5_015#He's already cured, Jim.",
"#LOV5\\LOV5_019#I don't have the proper medicine to cure him, Jim.",
"#LOV5\\LOV5_027#Finally, a human response!",
@@ -1691,6 +1780,96 @@ const char * const g_gameStrings[] = {
"#LOV1\\LOV1N023#This refrigerator has a number of specimen dishes inside.",
"#LOV1\\LOV1N034#You have distilled a quantity of Polyberylcarbonate.",
"#LOV1\\LOV1N035#You retrieve the Oroborus cure sample.",
+
+
+ "#LOV2\\LOV2_001#Well, gentlemen, I believe this equipment may be of some use.",
+ "#LOV2\\LOV2_002#I think we can call that one a failure, Bones.",
+ "#LOV2\\LOV2_003#I think we can set this aside and not worry about it.",
+ "#LOV2\\LOV2_004#A clean drink of water, but I don't see its application in the context of our difficulties, Captain.",
+ "#LOV2\\LOV2_005#Captain, I see the problem: the gas feeds are turned off. If you'll permit me...",
+ "#LOV2\\LOV2_006#Captain, I see the problem: the gas feeds are turned off.",
+ "#LOV2\\LOV2_007#Fascinating, Captain, but it doesn't appear to get us any closer to our goal.",
+ "#LOV2\\LOV2_008#Except for the Oroborus virus, I'm not picking up anything unusual.",
+ "#LOV2\\LOV2_009#Go bother Spock. This is the kind of place he likes.",
+ "#LOV2\\LOV2_010#I think I'll stick to combining two gases in future experiments. That's how the machine's designed, after all.",
+ "#LOV2\\LOV2_011#I wouldn't try to lift that. You might hurt yourself.",
+ "#LOV2\\LOV2_012#I'm picking up some strange, airborne virus. I can't identify it without more information.", // BUG: audio file missing
+ "#LOV2\\LOV2_014#That's not the right material to put in there, Jim.",
+ "#LOV2\\LOV2_015#Do you mean to say it's undignified, Spock?",
+ "#LOV2\\LOV2_016#I rest my case.",
+ "#LOV2\\LOV2_017#I think I'd have more luck hypergrowing the virus in the presence of a limited quantity of gas.",
+ "#LOV2\\LOV2_018#It doesn't affect Vulcans, of course.",
+ "#LOV2\\LOV2_019#Next he'll tell us the DNA molecule is simple!",
+ "#LOV2\\LOV2_020#That's it, Jim. We've got enough serum here to cure everybody on the station!",
+ "#LOV2\\LOV2_021#We must be doing something wrong, Jim.",
+ "#LOV2\\LOV2_022#Why that's just dandy! Vulcan laughing gas!",
+ "#LOV2\\LOV2_023#You're wrong, Spock. Look... the virus culture has been eliminated. That's why it's clear. It'd be more useful for me to see how the virus might grow in the presence of a limited quantity of ammonia gas.",
+ "#LOV2\\LOV2_024#I recommend we follow the design specifications of the machine. Two gas tanks should always be attached before activating it.",
+ "#LOV2\\LOV2_025#I would not recommend removing the canister without turning off the valve.",
+ "#LOV2\\LOV2_026#It would be very dangerous to place the tanks without first turning off the valve.",
+ "#LOV2\\LOV2_027#Nothing unusual is detected.",
+ "#LOV2\\LOV2_028#The machine does not seem to be able to process that particular item.",
+ "#LOV2\\LOV2_029#This is an outstanding facility, Captain.",
+ "#LOV2\\LOV2_030#Actually, Doctor, both Romulans and Vulcans suffer its effects.",
+ "#LOV2\\LOV2_031#An unusual compound, Captain. It can induce laughter and feelings of exhiliration in some, much the way nitrous oxide affects humans.",
+ "#LOV2\\LOV2_032#Be careful with that canister, Captain. I think you would not care to fall under the effects of laughing gas in these straits.",
+ "#LOV2\\LOV2_033#Compared to many molecular models, it is, Doctor.",
+ "#LOV2\\LOV2_034#I don't think that's useful in your experiment, Doctor.", // TYPO (in audio filename)
+ "#LOV2\\LOV2_035#In principle, Captain, this device is quite simple. When this chamber is empty and gas tanks are attached, it will combine the gases to make new compounds. If chemicals are placed in the chamber, the machine will combine them with the gases to create new materials.",
+ "#LOV2\\LOV2_036#It is, at the least, inappropriate for a starship crew on duty, Doctor.",
+ "#LOV2\\LOV2_037#It would take us several hours to get this machine working, Captain. I do not believe we will need it. The synthesis chamber should be able to give us what we need.",
+ "#LOV2\\LOV2_038#Please, Doctor. This is not a laughing matter.",
+ "#LOV2\\LOV2_039#This does not appear to provide us with anything useful.", // TYPO (in audio filename)
+ "#LOV2\\LOV2_040#The can looks much too heavy to carry, sir.",
+ "#LOV2\\LOV2_041#This room is very defensible, Captain -- if things get nasty, we may want to retreat to here.",
+ "#LOV2\\LOV2_043#I hope you don't want me to swab the deck with that, Captain.",
+ "#LOV2\\LOV2N000#You already have the ?.",
+ "#LOV2\\LOV2N001#A door.",
+ "#LOV2\\LOV2N002#A gas tank marked 'H2'.", // TYPO
+ "#LOV2\\LOV2N003#A gas tank marked 'N2',", // TYPO
+ "#LOV2\\LOV2N004#A gas tank marked 'O2'.", // TYPO
+ "#LOV2\\LOV2N005#A loud hissing fills the room.",
+ "#LOV2\\LOV2N006#A small field-effect anti-gravity unit, useful for moving things too heavy to lift and carry by muscle alone.",
+ "#LOV2\\LOV2N007#Gas feed is off.",
+ "#LOV2\\LOV2N008#Gas feed is on.",
+ "#LOV2\\LOV2N009#James Tiberius Kirk.",
+ "#LOV2\\LOV2N010#Lt. Ferris is carefully watching the hallway.", // TYPO
+ "#LOV2\\LOV2N011#McCoy is fidgeting around.",
+ "#LOV2\\LOV2N012#Nothing Happens.",
+ "#LOV2\\LOV2N013#Nothing happens.",
+ "#LOV2\\LOV2N014#Spock is analyzing the surroundings.",
+ "#LOV2\\LOV2N015#The item is much soggier than it used to be, but otherwise undamaged.",
+ "#LOV2\\LOV2N016#The machine synthesizes a liter of ammonia.",
+ "#LOV2\\LOV2N017#The machine synthesizes a liter of nitrous oxide.",
+ "#LOV2\\LOV2N018#The machine synthesizes a liter of pure water.",
+ "#LOV2\\LOV2N019#The machine synthesizes one liter of TLTDH gas.",
+ "#LOV2\\LOV2N024#There is no room for another canister.",
+ "#LOV2\\LOV2N025#There is something already in the chamber.",
+ "#LOV2\\LOV2N026#This is a science lab.",
+ "#LOV2\\LOV2N027#This is a storage cabinet.",
+ "#LOV2\\LOV2N028#This is a synthesizer, used to combine and replicate chemicals and form new compounds. This particular model has twin gas feeds.",
+ "#LOV2\\LOV2N029#This is the door to the synthesis chamber.",
+ "#LOV2\\LOV2N030#You attach the antigrav unit to the gas tank. It can be moved freely.",
+ "#LOV2\\LOV2N031#You attach the antigrav unit to the gas tank. It can be moved freely.",
+ "#LOV2\\LOV2N033#You have synthesized one liter of Romulan Laughing Gas.",
+ "#LOV2\\LOV2N034#You install the gas tank to the synthesizer's feed lines.",
+ "#LOV2\\LOV2N035#You install the gas tank to the synthesizer's feed lines.",
+ "#LOV2\\LOV2N036#Oroborus virus culture taken.",
+ "#LOV2\\LOV2N037#Oroborus virus cure sample taken.",
+ "#LOV2\\LOV2N038#You take a one litre container of TLTDH gas.",
+ "#LOV2\\LOV2N039#You take a one litre container of Ammonia.",
+ "#LOV2\\LOV2N040#You take a one litre container of Nitrous Oxide.",
+ "#LOV2\\LOV2N041#You take a one litre container of pure water.",
+ "#LOV2\\LOV2N042#You take the antigrav unit.",
+ "#LOV2\\LOV2N043#You take the hypo with Oroborus toxin cure.",
+ "#LOV2\\LOV2N044#You take the Polyberylcarbonate.",
+ "#LOV2\\LOV2N045#An Ardak 1000, the last word in molecular replication, one of the most advanced pieces of scientific equipment ever constructed.",
+ "#LOV2\\LOV2N046#The machine synthesizes a quantity serum in a hypo.",
+ "#LOV2\\LOV2N047#The machine synthesizes a quantity of bubbling grey goo.",
+ "#LOV2\\LOV2N048#The machine synthesizes a quantity of colorless goo.",
+ "#LOV2\\LOV2N049#The machine synthesizes a quantity of inert matter.",
+ "#LOV2\\LOV2N050#The machine synthesizes a quantity of wet grey goo.",
+ "#LOV2\\LOV2N051#The machine synthesizes a quantity of wet grey goo.",
};
}
Commit: 7d110de48f8aa0af09b34fa1741eaf992b1201c8
https://github.com/scummvm/scummvm/commit/7d110de48f8aa0af09b34fa1741eaf992b1201c8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Silence most Visual Studio warnings
Enums are signed in at least Visual Studio, and it was generating
many warnings of the cast to byte in the Action constructor was
losing precision. Likewise, there were some cases of -1 being
passed as a parameter to Action. This resolves these warnings by
making the constructor parameters int
Changed paths:
engines/startrek/action.h
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
index af27177..a501b78 100644
--- a/engines/startrek/action.h
+++ b/engines/startrek/action.h
@@ -25,6 +25,8 @@
#include "common/serializer.h"
+namespace StarTrek {
+
enum Acton {
ACTION_TICK = 0,
@@ -49,11 +51,11 @@ struct Action : Common::Serializable {
byte b3;
Action() {}
- Action(byte _type, byte _b1, byte _b2, byte _b3)
- : type(_type),
- b1(_b1),
- b2(_b2),
- b3(_b3) {}
+ Action(int _type, int _b1, int _b2, int _b3)
+ : type((byte)_type),
+ b1((byte)_b1),
+ b2((byte)_b2),
+ b3((byte)_b3) {}
// ACTION_USE, ACTION_GET, ACTION_LOOK, ACTION_TALK
@@ -89,4 +91,6 @@ struct Action : Common::Serializable {
}
};
+}
+
#endif
Commit: 16042faa655f53553ec26ef908e5528871e046ce
https://github.com/scummvm/scummvm/commit/16042faa655f53553ec26ef908e5528871e046ce
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Start on LOVE3
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/love1.cpp
engines/startrek/rooms/love3.cpp
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 83e16c9..1526e6a 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -41,7 +41,7 @@ void StarTrekEngine::initAwayMission() {
_roomIndexToLoad = -1;
// Load crew positions for beaming in
- initAwayCrewPositions(0);
+ initAwayCrewPositions(1);
}
void StarTrekEngine::runAwayMission() {
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 9114bb9..c827d7a 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -142,7 +142,7 @@ struct AwayMission {
struct {
bool alreadyStartedMission; // 0x29
bool knowAboutVirus; // 0x2a
- bool field2b; // 0x2b
+ bool putLaughingGasInVent; // 0x2b
bool field2c; // 0x2c
bool field2d; // 0x2d
bool chamberHasCure; // 0x2e
@@ -155,6 +155,13 @@ struct AwayMission {
byte field35; // 0x35
byte canister1; // 0x36
byte canister2; // 0x37
+ bool servicePanelOpen; // 0x38
+ bool gasTankUnscrewed; // 0x39
+ bool wrenchTaken; // 0x3a
+ bool tookN2TankFromServicePanel; // 0x3b
+ bool grateRemoved; // 0x3d
+ bool field3e; // 0x3e
+ bool field3f; // 0x3f
bool field41; // 0x41
bool spockAccessedConsole; // 0x49
bool mccoyAccessedConsole; // 0x4a
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 371d57f..3ab458a 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -938,6 +938,42 @@ public:
// LOVE3
void love3Tick1();
+ void love3Tick80();
+ void love3TouchedWarp1();
+ void love3Timer3Expired();
+ void love3LookAtServicePanel();
+ void love3LookAtMonitor();
+ void love3LookAtWrench();
+ void love3LookAtKirk();
+ void love3LookAtMccoy();
+ void love3LookAtSpock();
+ void love3LookAtRedshirt();
+ void love3LookAnywhere();
+ void love3LookAtShaft();
+ void love3LookAtPanel();
+ void love3LookAtGasTank();
+ void love3LookAtTurbines();
+ void love3TalkToKirk();
+ void love3TalkToSpock();
+ void love3TalkToMccoy();
+ void love3TalkToRedshirt();
+ void love3UseMTricorderAnywhere();
+ void love3UseSTricorderOnTurbines();
+ void love3UseSTricorderOnInsulation();
+ void love3UseSTricorderAnywhere();
+ void love3UseKirkOnServicePanel();
+ void love3UseSpockOnServicePanel();
+ void love3UseMccoyOnServicePanel();
+ void love3UseRedshirtOnServicePanel();
+ void love3CrewmanReachedServicePanel();
+ void love3OpenedOrClosedServicePanel();
+ void love3UseWrenchOnGasTank();
+ void love3ReachedGasTankToUnscrew();
+ void love3ScrewedOrUnscrewedGasTank();
+ void love3UseWrenchOnO2OrH2Gas();
+ void love3UseWrenchOnN2Gas();
+ void love3ReachedGasTankToPutDown();
+ void love3PutN2TankBack();
// LOVE4
void love4Tick1();
@@ -1053,6 +1089,12 @@ private:
byte _2967; // 0x2967
} love2;
+ struct {
+ byte activeCrewman;
+ byte _188e; // 0x188e
+ byte _188f; // 0x188f
+ } love3;
+
} _roomVar;
};
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index b16dbff..dab82aa 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1063,6 +1063,44 @@ RoomAction love2ActionList[] = {
RoomAction love3ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::love3Tick1 },
+ { Action(ACTION_TICK, 80, 0, 0), &Room::love3Tick80 },
+ { Action(ACTION_TOUCHED_WARP, 1, 0, 0), &Room::love3TouchedWarp1 },
+ { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::love3Timer3Expired },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::love3LookAtServicePanel },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::love3LookAtMonitor },
+ { Action(ACTION_LOOK, 10, 0, 0), &Room::love3LookAtWrench },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::love3LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::love3LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::love3LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::love3LookAtRedshirt },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::love3LookAnywhere },
+ { Action(ACTION_LOOK, 0x22, 0, 0), &Room::love3LookAtShaft },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::love3LookAtPanel },
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::love3LookAtPanel },
+ { Action(ACTION_LOOK, 12, 0, 0), &Room::love3LookAtGasTank },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::love3LookAtTurbines },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::love3TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::love3TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::love3TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::love3TalkToRedshirt },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::love3UseMTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::love3UseSTricorderOnTurbines },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 9, 0), &Room::love3UseSTricorderOnInsulation },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::love3UseSTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_KIRK, 8, 0), &Room::love3UseKirkOnServicePanel },
+ { Action(ACTION_USE, OBJECT_SPOCK, 8, 0), &Room::love3UseSpockOnServicePanel },
+ { Action(ACTION_USE, OBJECT_MCCOY, 8, 0), &Room::love3UseMccoyOnServicePanel },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 8, 0), &Room::love3UseRedshirtOnServicePanel },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::love3CrewmanReachedServicePanel },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::love3OpenedOrClosedServicePanel },
+ { Action(ACTION_USE, OBJECT_IWRENCH, 12, 0), &Room::love3UseWrenchOnGasTank },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::love3ReachedGasTankToUnscrew },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::love3ScrewedOrUnscrewedGasTank },
+ { Action(ACTION_USE, OBJECT_IWRENCH, OBJECT_IO2GAS, 0), &Room::love3UseWrenchOnO2OrH2Gas },
+ { Action(ACTION_USE, OBJECT_IWRENCH, OBJECT_IH2GAS, 0), &Room::love3UseWrenchOnO2OrH2Gas },
+ { Action(ACTION_USE, OBJECT_IWRENCH, OBJECT_IN2GAS, 0), &Room::love3UseWrenchOnN2Gas },
+ { Action(ACTION_FINISHED_WALKING, 15, 0, 0), &Room::love3ReachedGasTankToPutDown },
+ { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love3PutN2TankBack },
};
RoomAction love4ActionList[] = {
diff --git a/engines/startrek/rooms/love1.cpp b/engines/startrek/rooms/love1.cpp
index 509f35f..d2ffe21 100644
--- a/engines/startrek/rooms/love1.cpp
+++ b/engines/startrek/rooms/love1.cpp
@@ -624,7 +624,7 @@ void Room::love1CrewmanReachedLadder() {
TX_SPEAKER_FERRIS
};
- if (_vm->_awayMission.love.field2b || _vm->_awayMission.love.field41) // Romulans unconscious
+ if (_vm->_awayMission.love.putLaughingGasInVent || _vm->_awayMission.love.field41) // Romulans unconscious
loadRoomIndex(4, 3);
else { // Romulans still conscious, they shoot you
loadActorAnim(OBJECT_PHASERSHOT, "s3r2s2", 0xf3, 0x89, 0);
@@ -650,7 +650,7 @@ void Room::love1CrewmanDiedFromPhaser() {
// Romulans fire a "warning shot" when you go to the right part of the room.
void Room::love1TouchedHotspot0() {
- if (_vm->_awayMission.love.field2b || _vm->_awayMission.love.field41)
+ if (_vm->_awayMission.love.putLaughingGasInVent || _vm->_awayMission.love.field41)
return;
loadActorAnim(OBJECT_PHASERSHOT, "s3r2s1", 0xf3, 0x89, 0);
playSoundEffectIndex(SND_PHASSHOT);
diff --git a/engines/startrek/rooms/love3.cpp b/engines/startrek/rooms/love3.cpp
index 44203df..149c53c 100644
--- a/engines/startrek/rooms/love3.cpp
+++ b/engines/startrek/rooms/love3.cpp
@@ -22,14 +22,255 @@
#include "startrek/room.h"
-#define OBJECT_DOOR1 8
+#define OBJECT_SERVICE_PANEL 8
+#define OBJECT_INSULATION 9
+#define OBJECT_WRENCH 10
+#define OBJECT_GRATE 11
+#define OBJECT_GAS_TANK 12
-#define HOTSPOT_CONSOLE 0x20
+#define HOTSPOT_INSULATION 0x20
+#define HOTSPOT_MONITOR 0x21
+#define HOTSPOT_SHAFT 0x22
+#define HOTSPOT_TURBINES 0x23
namespace StarTrek {
void Room::love3Tick1() {
+ playVoc("LOV3LOOP");
+ if (!_vm->_awayMission.love.wrenchTaken)
+ loadActorAnim(OBJECT_WRENCH, "wrench", 0x10a, 0xb6, 0);
+
+ if (_vm->_awayMission.love.grateRemoved)
+ loadActorAnim(OBJECT_GRATE, "s3r4g3", 0, 0, 0);
+ else
+ loadActorAnim(OBJECT_GRATE, "s3r4g1", 0x116, 0x8f, 0);
+
+ if (_vm->_awayMission.love.field3e)
+ loadActorAnim(OBJECT_INSULATION, "s3r4p2", 0, 0, 0);
+
+ if (!_vm->_awayMission.love.tookN2TankFromServicePanel)
+ loadActorAnim(OBJECT_GAS_TANK, "r4n2", 0, 0, 0);
+
+ if (_vm->_awayMission.love.servicePanelOpen)
+ loadActorAnim(OBJECT_SERVICE_PANEL, "s3r4d1a", 1, 0, 0);
+ else
+ loadActorAnim(OBJECT_SERVICE_PANEL, "s3r4d2", 1, 0, 0);
+
+ if (_vm->_awayMission.love.field2c)
+ _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
+ if (_vm->_awayMission.love.field2d)
+ _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
+
+ _vm->_awayMission.timers[2] = 200;
+
+ _roomVar.love3._188e = 0xb4;
+ _roomVar.love3._188f = 0xb7;
+}
+
+void Room::love3Tick80() {
+ if (!_vm->_awayMission.love.field3f && haveItem(OBJECT_IRLG)) {
+ showText(TX_SPEAKER_MCCOY, TX_LOV3_010);
+ showText(TX_SPEAKER_SPOCK, TX_LOV3_020);
+ }
+}
+
+void Room::love3TouchedWarp1() {
+ _vm->_awayMission.disableInput = true;
+ playSoundEffectIndex(SND_DOOR1);
+ _vm->_awayMission.timers[3] = 10;
+}
+
+void Room::love3Timer3Expired() {
+ loadRoomIndex(1, 0);
+}
+
+void Room::love3LookAtServicePanel() {
+ showText(TX_LOV3NA20);
+}
+
+void Room::love3LookAtMonitor() {
+ showText(TX_LOV3N000); // BUGFIX: original didn't play the audio
+}
+
+void Room::love3LookAtWrench() {
+ showText(TX_LOV3N002);
+}
+
+void Room::love3LookAtKirk() {
+ showText(TX_LOV3N003);
+}
+
+void Room::love3LookAtMccoy() {
+ showText(TX_LOV3N005);
+}
+
+void Room::love3LookAtSpock() {
+ showText(TX_LOV3N008);
+}
+
+void Room::love3LookAtRedshirt() {
+ showText(TX_LOV3N004);
+}
+
+void Room::love3LookAnywhere() {
+ showText(TX_LOV3NA23);
+}
+
+void Room::love3LookAtShaft() {
+ showText(TX_LOV3N019);
+}
+
+void Room::love3LookAtPanel() {
+ if (_vm->_awayMission.love.field3e)
+ showText(TX_LOV3N017);
+ else
+ showText(TX_LOV3NA22);
+}
+
+void Room::love3LookAtGasTank() {
+ showText(TX_LOV3N006);
+}
+
+void Room::love3LookAtTurbines() {
+ showText(TX_LOV3N026);
+ showText(TX_SPEAKER_MCCOY, TX_LOV3_009);
+ showText(TX_SPEAKER_SPOCK, TX_LOV3_019);
+ if (!_vm->_awayMission.redshirtDead)
+ showText(TX_SPEAKER_FERRIS, TX_LOV3_026);
+}
+
+void Room::love3TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_LOV3_001);
+}
+
+void Room::love3TalkToSpock() {
+ if (_vm->_awayMission.love.field3f)
+ showText(TX_SPEAKER_SPOCK, TX_LOV3_003);
+ if (_vm->_awayMission.love.putLaughingGasInVent)
+ showText(TX_SPEAKER_SPOCK, TX_LOV3_017);
+ else if (haveItem(OBJECT_IRLG))
+ showText(TX_SPEAKER_SPOCK, TX_LOV3_004);
+ else
+ showText(TX_SPEAKER_SPOCK, TX_LOV3_003);
+}
+
+void Room::love3TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV3_008);
+}
+
+void Room::love3TalkToRedshirt() {
+ showText(TX_SPEAKER_FERRIS, TX_LOV3_024);
+}
+
+void Room::love3UseMTricorderAnywhere() {
+ if (_vm->_awayMission.love.knowAboutVirus)
+ mccoyScan(DIR_S, TX_LOV3_005, false);
+ else
+ mccoyScan(DIR_S, TX_LOV3_006, false);
+}
+
+void Room::love3UseSTricorderOnTurbines() {
+ spockScan(DIR_N, TX_LOV3_014, false);
+}
+
+void Room::love3UseSTricorderOnInsulation() {
+ if (_vm->_awayMission.love.field3e)
+ spockScan(DIR_W, TX_LOV3_002, false);
+}
+
+void Room::love3UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_LOV3_013, false);
+}
+
+void Room::love3UseKirkOnServicePanel() {
+ _roomVar.love3.activeCrewman = OBJECT_KIRK;
+ walkCrewman(_roomVar.love3.activeCrewman, 0x104, 0xae, 1);
+}
+
+void Room::love3UseSpockOnServicePanel() {
+ _roomVar.love3.activeCrewman = OBJECT_SPOCK;
+ walkCrewman(_roomVar.love3.activeCrewman, 0x104, 0xae, 1);
+}
+
+void Room::love3UseMccoyOnServicePanel() {
+ _roomVar.love3.activeCrewman = OBJECT_MCCOY;
+ walkCrewman(_roomVar.love3.activeCrewman, 0x104, 0xae, 1);
+}
+
+void Room::love3UseRedshirtOnServicePanel() {
+ _roomVar.love3.activeCrewman = OBJECT_REDSHIRT;
+ walkCrewman(_roomVar.love3.activeCrewman, 0x104, 0xae, 1);
+}
+
+void Room::love3CrewmanReachedServicePanel() {
+ Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love3.activeCrewman, "usehe");
+ loadActorAnim2(_roomVar.love3.activeCrewman, anim, -1, -1, 1);
+}
+
+void Room::love3OpenedOrClosedServicePanel() {
+ if (_vm->_awayMission.love.servicePanelOpen)
+ loadActorAnim2(OBJECT_SERVICE_PANEL, "s3r4d1b", 1, 0, 0);
+ else
+ loadActorAnim2(OBJECT_SERVICE_PANEL, "s3r4d1", 1, 0, 0);
+
+ playVoc("SMADOOR1");
+ _vm->_awayMission.love.servicePanelOpen = !_vm->_awayMission.love.servicePanelOpen;
+
+ if (_vm->_awayMission.love.servicePanelOpen) {
+ if (_vm->_awayMission.love.tookN2TankFromServicePanel)
+ showText(TX_LOV3N023);
+ else
+ showText(TX_LOV3N022);
+ }
+ else
+ showText(TX_LOV3N020);
+}
+
+// Use wrench on gas tank, to screw or unscrew it in position
+void Room::love3UseWrenchOnGasTank() {
+ walkCrewman(OBJECT_KIRK, 0x10e, 0xae, 2);
+}
+
+void Room::love3ReachedGasTankToUnscrew() {
+ loadActorAnim2(OBJECT_KIRK, "kusehe", -1, -1, 2);
+ playVoc("MUR3E1S");
+}
+
+void Room::love3ScrewedOrUnscrewedGasTank() {
+ if (!_vm->_awayMission.love.gasTankUnscrewed) {
+ showText(TX_LOV3N012);
+ if (!_vm->_awayMission.redshirtDead)
+ showText(TX_SPEAKER_FERRIS, TX_LOV3_022);
+ _vm->_awayMission.love.gasTankUnscrewed = true;
+ }
+ else {
+ showText(TX_LOV3N015);
+ _vm->_awayMission.love.gasTankUnscrewed = false;
+ }
+}
+
+
+void Room::love3UseWrenchOnO2OrH2Gas() {
+ showText(TX_SPEAKER_SPOCK, TX_LOV3_016);
+}
+
+
+// Use wrench on N2 gas = putting it from the inventory back to the service panel
+void Room::love3UseWrenchOnN2Gas() {
+ walkCrewman(OBJECT_KIRK, 0x10e, 0xae, 15);
+}
+
+void Room::love3ReachedGasTankToPutDown() {
+ loadActorAnim2(OBJECT_KIRK, "kusehe", -1, -1, 3);
+ playVoc("MUR3E1S");
+}
+
+void Room::love3PutN2TankBack() {
+ showText(TX_LOV3N013);
+ _vm->_awayMission.love.tookN2TankFromServicePanel = false;
+ loseItem(OBJECT_IN2GAS);
+ loadActorAnim(OBJECT_GAS_TANK, "r4n2", 0, 0, 0);
}
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 26c8c54..16c5d20 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -84,7 +84,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxHasMultipleChoices = false;
_missionToLoad = "LOVE";
- _roomIndexToLoad = 2;
+ _roomIndexToLoad = 3;
for (int i = 0; i < NUM_OBJECTS; i++)
_itemList[i] = g_itemList[i];
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index b6b1c0d..53062fb 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -962,6 +962,74 @@ enum GameStringIDs {
TX_LOV2N051,
+ TX_LOV3_001,
+ TX_LOV3_002,
+ TX_LOV3_003,
+ TX_LOV3_004,
+ TX_LOV3_005,
+ TX_LOV3_006,
+ TX_LOV3_007,
+ TX_LOV3_008,
+ TX_LOV3_009,
+ TX_LOV3_010,
+ TX_LOV3_011,
+ TX_LOV3_012,
+ TX_LOV3_013,
+ TX_LOV3_014,
+ TX_LOV3_015,
+ TX_LOV3_016,
+ TX_LOV3_017,
+ TX_LOV3_018,
+ TX_LOV3_019,
+ TX_LOV3_020,
+ TX_LOV3_021,
+ TX_LOV3_022,
+ TX_LOV3_023,
+ TX_LOV3_024,
+ TX_LOV3_025,
+ TX_LOV3_026,
+ TX_LOV3N000,
+ TX_LOV3N001,
+ TX_LOV3N002,
+ TX_LOV3N003,
+ TX_LOV3N004,
+ TX_LOV3N005,
+ TX_LOV3N006,
+ TX_LOV3N007,
+ TX_LOV3N008,
+ TX_LOV3N009,
+ TX_LOV3N010,
+ TX_LOV3N011,
+ TX_LOV3N012,
+ TX_LOV3N013,
+ TX_LOV3N014,
+ TX_LOV3N015,
+ TX_LOV3N016,
+ TX_LOV3N017,
+ TX_LOV3N018,
+ TX_LOV3N019,
+ TX_LOV3N020,
+ TX_LOV3N021,
+ TX_LOV3N022,
+ TX_LOV3N023,
+ TX_LOV3N024,
+ TX_LOV3N025,
+ TX_LOV3N026,
+ TX_LOV3N027,
+ TX_LOV3N028,
+ TX_LOV3N029,
+ TX_LOV3N030,
+ TX_LOV3N031,
+ TX_LOV3N032,
+ TX_LOV3NA08,
+ TX_LOV3NA09,
+ TX_LOV3NA20,
+ TX_LOV3NA21,
+ TX_LOV3NA22,
+ TX_LOV3NA23,
+ TX_LOV3NJ32,
+
+
TX_END
};
@@ -1870,6 +1938,74 @@ const char * const g_gameStrings[] = {
"#LOV2\\LOV2N049#The machine synthesizes a quantity of inert matter.",
"#LOV2\\LOV2N050#The machine synthesizes a quantity of wet grey goo.",
"#LOV2\\LOV2N051#The machine synthesizes a quantity of wet grey goo.",
+
+
+ "#LOV3\\LOV3_001#At least all this equipment appears to be operating.",
+ "#LOV3\\LOV3_002#A prime source of raw material for TLDTH gas.",
+ "#LOV3\\LOV3_003#Captain, the fusion reactor doesn't seem to have been tampered with. I suggest we leave the controls as they are.",
+ "#LOV3\\LOV3_004#Captain, we can introduce the Romulan Laughing Gas into the station's ventilation system from here.",
+ "#LOV3\\LOV3_005#Except for the Oroborus virus, I'm not picking up anything unusual.",
+ "#LOV3\\LOV3_006#I'm picking up some strange, airborne virus. I can't identify it without more information.",
+ "#LOV3\\LOV3_007#Ouch!",
+ "#LOV3\\LOV3_008#Ah. The station's fusion reactor. Very nice. What are we going to tour next, the ventilation system?",
+ "#LOV3\\LOV3_009#I didn't realize that they used these old fusion reactors anymore.",
+ "#LOV3\\LOV3_010#I don't suppose you'd enjoy the psychological release of a few good belly laughs, Spock? We could open the canister right here, if you like.",
+ "#LOV3\\LOV3_011#I think one application of gas is sufficient, Captain.",
+ "#LOV3\\LOV3_012#Nitrous oxide affects humans, but not Romulans. However, a similar effect can be produced by the gas TLTDH.",
+ "#LOV3\\LOV3_013#Nothing unusual is detected.",
+ "#LOV3\\LOV3_014#The fusion reactor is functioning at peak efficiency. There is no need to tamper with its current operation.",
+ "#LOV3\\LOV3_015#The unit cannot lift something fastened to the body of the station, Captain. The tank must be detached first.",
+ "#LOV3\\LOV3_016#This is not wise, Captain. I don't believe we can safely substitute a different gas in this location.",
+ "#LOV3\\LOV3_017#We should now be able to proceed safely to the lower level.",
+ "#LOV3\\LOV3_018#Captain, the instruments are far too delicate for such abuse. We may set off a chain reaction that would destroy the entire space station.",
+ "#LOV3\\LOV3_019#Actually, doctor, as Mr. Scott would tell you, the Cochrane-500 is renowned for its reliability and perfectly suited for a station of this size.",
+ "#LOV3\\LOV3_020#I would strongly recommend against it, Doctor.",
+ "#LOV3\\LOV3_021#Good thing the person who designed these stations built in safeguards against an accidental spill!",
+ "#LOV3\\LOV3_022#I guess this made it easier to replace the tank every so often, eh Captain?",
+ "#LOV3\\LOV3_023#It doesn't sound like it subdued them, Captain. If anything, it just made them angry.",
+ "#LOV3\\LOV3_024#Sir, I'll watch the door so we don't get cornered.",
+ "#LOV3\\LOV3_025#It sure beats hauling it around on our backs, sir.",
+ "#LOV3\\LOV3_026#Hey, this thing's real old, isn't it?",
+ "#LOV3\\LOV3N000#All readings are normal.", // TYPO: audio filename was wrong
+ "#LOV3\\LOV3N001#Cursing and coughing echo up the air shaft.",
+ "#LOV3\\LOV3N002#It's a standard adjustable metric socket wrench.",
+ "#LOV3\\LOV3N003#Kirk is looking closely at the equipment.",
+ "#LOV3\\LOV3N004#Lt. Ferris is carefully watching the hallway",
+ "#LOV3\\LOV3N005#McCoy is fidgeting around.",
+ "#LOV3\\LOV3N006#N gas tank.", // FIXME: N2 (with superscript)
+ "#LOV3\\LOV3N007#The tank is too heavy to move by muscle alone.",
+ "#LOV3\\LOV3N008#Spock is analyzing the surroundings.",
+ "#LOV3\\LOV3N009#The air vent becomes wet.",
+ "#LOV3\\LOV3N010#The antigrav unit hums and emits the stink of ozone before it failsafes.",
+ "#LOV3\\LOV3N011#The shaft is too small to crawl through.",
+ "#LOV3\\LOV3N012#The tank detaches easily.",
+ "#LOV3\\LOV3N013#The tank fits into place and is easy to reattach.",
+ "#LOV3\\LOV3N014#The tank is large and heavy, with its feed lines firmly attached.",
+ "#LOV3\\LOV3N015#The tank is now firmly attached to its feed lines.",
+ "#LOV3\\LOV3N016#The vent is now open. It leads to the lower deck.",
+ "#LOV3\\LOV3N017#There is a pile of stripped insulation that fell out of the Engineering access panel.",
+ "#LOV3\\LOV3N018#There seems to be no effect.",
+ "#LOV3\\LOV3N019#This is a screen and filter for the ventilation shaft.",
+ "#LOV3\\LOV3N020#The panel closes.",
+ "#LOV3\\LOV3N021#The panel is open. You see vast quantities of dust and stripped insulation from wiring repairs made to the console in the past.",
+ "#LOV3\\LOV3N022#The panel opens. You see a gas tank labeled N, with its feed lines running deeper into the wall.", // FIXME: N2 (with superscript)
+ "#LOV3\\LOV3N023#The panel opens.",
+ "#LOV3\\LOV3N024#This is the engineering room. All appears normal.",
+ "#LOV3\\LOV3N025#This vent is currently closed.",
+ "#LOV3\\LOV3N026#Turbines of a Cochrane-500 Class Fusion drive, manufactured over a century ago on Alpha Centuri.",
+ "#LOV3\\LOV3N027#You already have some insulation.",
+ "#LOV3\\LOV3N028#You already have the wrench.",
+ "#LOV3\\LOV3N029#You grab a handful of insulation.",
+ "#LOV3\\LOV3N030#You need something to pry this open.",
+ "#LOV3\\LOV3N031#You pick up a large wrench.",
+ "#LOV3\\LOV3N032#You replace the air vent cover.",
+ "#LOV3\\LOV3NA08#With a hiss, the Romulan Laughing Gas billows down the vent. Things are strangely quiet below.",
+ "#LOV3\\LOV3NA09#With a hiss, the Romulan Laughing Gas billows down the vent. You hear the muffled sounds through the vent of hearty Romulan laughter, followed by the dull thud of bodies hitting the deck.",
+ "#LOV3\\LOV3NA20#This is a service access panel, permitting used-up or worn materials to be replaced.",
+ "#LOV3\\LOV3NA21#This is a vent shaft that leads to the lower level.",
+ "#LOV3\\LOV3NA22#This is an engineering access panel, allowing repairs to be made to the interior wiring in the equipment.",
+ "#LOV3\\LOV3NA23#This is the engineering center for the ARK7 space station.",
+ "#LOV3\\LOV3NJ32#You attach the antigrav unit to the gas tank. It can be moved freely.",
};
}
Commit: 08ead492d8ff338a469ca92881919d8ff22e12b3
https://github.com/scummvm/scummvm/commit/08ead492d8ff338a469ca92881919d8ff22e12b3
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: LOVE3 finished.
Added "callback" variants of the "walkCrewman" and "loadActorAnim"
functions to simplify chains of calls in room-specific code.
Changed paths:
engines/startrek/action.h
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/object.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/love1.cpp
engines/startrek/rooms/love3.cpp
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
index a501b78..4270eb9 100644
--- a/engines/startrek/action.h
+++ b/engines/startrek/action.h
@@ -27,6 +27,8 @@
namespace StarTrek {
+class Room;
+
enum Acton {
ACTION_TICK = 0,
@@ -41,7 +43,9 @@ enum Acton {
ACTION_TIMER_EXPIRED = 8,
ACTION_FINISHED_ANIMATION = 10,
ACTION_FINISHED_WALKING = 12,
- ACTION_OPTIONS = 13 // Not really an action, but selectable from action menu
+ ACTION_OPTIONS = 13, // Not really an action, but selectable from action menu
+
+ ACTION_CALLBACK = 255 // Custom action in ScummVM; calls a function in the Room class
};
struct Action : Common::Serializable {
@@ -50,6 +54,8 @@ struct Action : Common::Serializable {
byte b2;
byte b3;
+ void (Room::*roomFuncPtr)();
+
Action() {}
Action(int _type, int _b1, int _b2, int _b3)
: type((byte)_type),
@@ -57,6 +63,10 @@ struct Action : Common::Serializable {
b2((byte)_b2),
b3((byte)_b3) {}
+ Action(int _type, void (Room::*funcPtr)())
+ : type((byte)_type),
+ roomFuncPtr(funcPtr) {}
+
// ACTION_USE, ACTION_GET, ACTION_LOOK, ACTION_TALK
byte activeObject() { return b1; }
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 1526e6a..48c474e 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -61,8 +61,8 @@ void StarTrekEngine::runAwayMission() {
_awayMission.mouseY = mousePos.y;
assert(_actionQueue.size() <= 16);
- if (!_actionQueue.empty()) {
- // sub_200e7();
+ while (!_actionQueue.empty()) {
+ // sub_200e7(); // TODO
// sub_20118();
handleAwayMissionAction();
}
@@ -571,6 +571,12 @@ void StarTrekEngine::handleAwayMissionAction() {
initAwayCrewPositions(warpIndex ^ 1);
}
break;
+
+ case ACTION_CALLBACK:
+ // Custom action for ScummVM; calls a function in the Room class. Useful for
+ // simplifying chains of calls.
+ (_room.get()->*(action.roomFuncPtr))();
+ break;
}
}
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index c827d7a..f1a7e77 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -142,7 +142,7 @@ struct AwayMission {
struct {
bool alreadyStartedMission; // 0x29
bool knowAboutVirus; // 0x2a
- bool putLaughingGasInVent; // 0x2b
+ bool romulansUnconsciousFromLaughingGas; // 0x2b
bool field2c; // 0x2c
bool field2d; // 0x2d
bool chamberHasCure; // 0x2e
@@ -159,14 +159,17 @@ struct AwayMission {
bool gasTankUnscrewed; // 0x39
bool wrenchTaken; // 0x3a
bool tookN2TankFromServicePanel; // 0x3b
+ bool field3c; // 0x3c
bool grateRemoved; // 0x3d
- bool field3e; // 0x3e
+ bool insulationOnGround; // 0x3e
bool field3f; // 0x3f
- bool field41; // 0x41
+ bool romulansUnconsciousFromVirus; // 0x41
bool spockAccessedConsole; // 0x49
bool mccoyAccessedConsole; // 0x4a
bool gotPolyberylcarbonate; // 0x4b
bool gotTLDH; // 0x4c (Got romulan laughing gas)
+ bool gotPointsForOpeningGrate; // 0x4d
+ bool gotPointsForGassingRomulans; // 0x4e
bool gotCure; // 0x4f
int16 missionScore; // 0x52
} love;
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index 18e2145..6736ca5 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -33,6 +33,7 @@ namespace StarTrek {
class StarTrekEngine;
class FileStream;
+class Room;
// Objects 0-31 are "actors" that are drawn to the screen, are animated, etc.
@@ -87,8 +88,17 @@ struct Actor {
Common::Point pos;
uint16 field60;
uint16 field62;
+
+ // When an object finished walking somewhere or finishes an animation, if
+ // "triggerActionWhenAnimFinished" is true, it will create an action of type
+ // "ACTION_FINISHED_WALKING" or "ACTION_FINISHED_ANIMATION", with the integer value
+ // "finishedAnimActionParam".
+ // To make things simpler, it can also use a callback to a function in the Room class,
+ // if "finishedAnimCallback" is non-null.
bool triggerActionWhenAnimFinished;
uint16 finishedAnimActionParam;
+ void (Room::*finishedAnimCallback)();
+
char animationString2[8];
uint16 field70;
uint16 field72;
@@ -140,6 +150,7 @@ public:
field62(),
triggerActionWhenAnimFinished(),
finishedAnimActionParam(),
+ finishedAnimCallback(),
//animationString2[8](),
field70(),
field72(),
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 0564507..62949be 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -190,6 +190,29 @@ void Room::loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y,
if (finishedAnimActionParam != 0) {
actor->triggerActionWhenAnimFinished = true;
actor->finishedAnimActionParam = finishedAnimActionParam;
+ actor->finishedAnimCallback = nullptr;
+ }
+}
+
+// Same as above, but accepts a callback for when the animation finished (instead of an
+// integer for an action)
+void Room::loadActorAnimC(int actorIndex, Common::String anim, int16 x, int16 y, void (Room::*funcPtr)()) {
+ Actor *actor = &_vm->_actorList[actorIndex];
+
+ if (x == -1 || y == -1) {
+ x = actor->sprite.pos.x;
+ y = actor->sprite.pos.y;
+ }
+
+ if (actorIndex >= 0 && actorIndex < SCALED_ACTORS_END)
+ _vm->loadActorAnimWithRoomScaling(actorIndex, anim, x, y);
+ else
+ _vm->loadActorAnim(actorIndex, anim, x, y, 256);
+
+ if (funcPtr != nullptr) {
+ actor->triggerActionWhenAnimFinished = true;
+ actor->finishedAnimActionParam = 0;
+ actor->finishedAnimCallback = funcPtr;
}
}
@@ -307,6 +330,24 @@ void Room::walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finished
if (success && finishedAnimActionParam != 0) {
actor->triggerActionWhenAnimFinished = true;
actor->finishedAnimActionParam = finishedAnimActionParam;
+ actor->finishedAnimCallback = nullptr;
+ }
+}
+
+// Same as above, but with a function callback instead of an integer value to generate an
+// action
+void Room::walkCrewmanC(int actorIndex, int16 destX, int16 destY, void (Room::*funcPtr)()) {
+ if (!(actorIndex >= OBJECT_KIRK && actorIndex <= OBJECT_REDSHIRT))
+ error("Tried to walk a non PC");
+
+ Actor *actor = &_vm->_actorList[actorIndex];
+ Common::String anim = _vm->getCrewmanAnimFilename(actorIndex, "walk");
+ bool success = _vm->actorWalkToPosition(actorIndex, anim, actor->pos.x, actor->pos.y, destX, destY);
+
+ if (success && funcPtr != nullptr) {
+ actor->triggerActionWhenAnimFinished = true;
+ actor->finishedAnimActionParam = 0;
+ actor->finishedAnimCallback = funcPtr;
}
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 3ab458a..59b37e6 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -98,6 +98,7 @@ private:
// Interface for room-specific code
void loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66); // Cmd 0x00
+ void loadActorAnimC(int actorIndex, Common::String anim, int16 x, int16 y, void (Room::*funcPtr)());// Cmd 0x00
void loadActorStandAnim(int actorIndex); // Cmd 0x01
void loadActorAnim2(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66);// Cmd 0x02
int showRoomSpecificText(const char **textAddr); // (Deprecated, use function below) // Cmd 0x03
@@ -109,6 +110,7 @@ private:
void loadRoomIndex(int roomIndex, int spawnIndex); // Cmd 0x06
void loseItem(int item); // Cmd 0x07
void walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam);// Cmd 0x08
+ void walkCrewmanC(int actorIndex, int16 destX, int16 destY, void (Room::*funcPtr)()); // Cmd 0x08
void loadMapFile(const Common::String &name); // Cmd 0x09
void showBitmapFor5Ticks(const Common::String &bmpName, int priority); // Cmd 0x0a
// Command 0x0c: "demon6ShowCase"
@@ -974,6 +976,41 @@ public:
void love3UseWrenchOnN2Gas();
void love3ReachedGasTankToPutDown();
void love3PutN2TankBack();
+ void love3UseWrenchOnEngineeringPanel();
+ void love3ReachedEngineeringPanel();
+ void love3OpenedEngineeringPanel();
+ void love3UseWrenchOnMonitor();
+ void love3UseWaterOnMonitor();
+ void love3ReachedMonitorToUseWater();
+ void love3PouredWaterOnMonitor();
+ void love3UseCrewmanOnEngineeringPanelOrGrate();
+ void love3UseWrenchOnGrate();
+ void love3ReachedGateWithWrench();
+ void love3OpenedOrClosedGrate();
+ void love3UseCrewmanOnShaft();
+ void love3UseWaterOnShaft();
+ void love3ReachedShaftUsingWater();
+ void love3PouredWaterDownShaft();
+ void love3UseNitrousOxideOnShaft();
+ void love3ReachedShaftUsingNitrousOxide();
+ void love3PouredNitrousOxideDownShaft();
+ void love3UseAmmoniaOnShaft();
+ void love3ReachedShaftUsingAmmonia();
+ void love3PouredAmmoniaDownShaft();
+ void love3UseRomulanLaughingGasOnShaft();
+ void love3ReachedShaftUsingRomulanLaughingGas();
+ void love3PouredRomulanLaughingGasDownShaft();
+ void love3GetWrench();
+ void love3ReachedWrenchToGet();
+ void love3PickedUpWrench();
+ void love3GetGasTank();
+ void love3ReachedGasTankToGet();
+ void love3UseAntigravOnGasTank();
+ void love3ReachedGasTankUsingAntigrav();
+ void love3PickedUpGasTank();
+ void love3GetInsulation();
+ void love3ReachedInsulationToGet();
+ void love3PickedUpInsulation();
// LOVE4
void love4Tick1();
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index dab82aa..8c8df37 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1090,17 +1090,53 @@ RoomAction love3ActionList[] = {
{ Action(ACTION_USE, OBJECT_KIRK, 8, 0), &Room::love3UseKirkOnServicePanel },
{ Action(ACTION_USE, OBJECT_SPOCK, 8, 0), &Room::love3UseSpockOnServicePanel },
{ Action(ACTION_USE, OBJECT_MCCOY, 8, 0), &Room::love3UseMccoyOnServicePanel },
+
{ Action(ACTION_USE, OBJECT_REDSHIRT, 8, 0), &Room::love3UseRedshirtOnServicePanel },
{ Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::love3CrewmanReachedServicePanel },
{ Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::love3OpenedOrClosedServicePanel },
+
{ Action(ACTION_USE, OBJECT_IWRENCH, 12, 0), &Room::love3UseWrenchOnGasTank },
{ Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::love3ReachedGasTankToUnscrew },
{ Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::love3ScrewedOrUnscrewedGasTank },
+
{ Action(ACTION_USE, OBJECT_IWRENCH, OBJECT_IO2GAS, 0), &Room::love3UseWrenchOnO2OrH2Gas },
{ Action(ACTION_USE, OBJECT_IWRENCH, OBJECT_IH2GAS, 0), &Room::love3UseWrenchOnO2OrH2Gas },
+
{ Action(ACTION_USE, OBJECT_IWRENCH, OBJECT_IN2GAS, 0), &Room::love3UseWrenchOnN2Gas },
{ Action(ACTION_FINISHED_WALKING, 15, 0, 0), &Room::love3ReachedGasTankToPutDown },
{ Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love3PutN2TankBack },
+
+ { Action(ACTION_USE, OBJECT_IWRENCH, 0x20, 0), &Room::love3UseWrenchOnEngineeringPanel },
+ { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::love3ReachedEngineeringPanel },
+ { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love3OpenedEngineeringPanel },
+
+ { Action(ACTION_USE, OBJECT_IWRENCH, 0x21, 0), &Room::love3UseWrenchOnMonitor },
+
+ { Action(ACTION_USE, OBJECT_IH2O, 0x21, 0), &Room::love3UseWaterOnMonitor },
+
+ { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
+ { Action(ACTION_USE, OBJECT_KIRK, 11, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
+ { Action(ACTION_USE, OBJECT_SPOCK, 11, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
+ { Action(ACTION_USE, OBJECT_MCCOY, 11, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 11, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
+
+ { Action(ACTION_USE, OBJECT_IWRENCH, 11, 0), &Room::love3UseWrenchOnGrate },
+ { Action(ACTION_USE, OBJECT_KIRK, 0x22, 0), &Room::love3UseCrewmanOnShaft },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x22, 0), &Room::love3UseCrewmanOnShaft },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x22, 0), &Room::love3UseCrewmanOnShaft },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x22, 0), &Room::love3UseCrewmanOnShaft },
+ { Action(ACTION_USE, OBJECT_IH2O, 0x22, 0), &Room::love3UseWaterOnShaft },
+ { Action(ACTION_USE, OBJECT_IN2O, 0x22, 0), &Room::love3UseNitrousOxideOnShaft },
+ { Action(ACTION_USE, OBJECT_INH3, 0x22, 0), &Room::love3UseAmmoniaOnShaft },
+ { Action(ACTION_USE, OBJECT_IRLG, 0x22, 0), &Room::love3UseRomulanLaughingGasOnShaft },
+ { Action(ACTION_GET, 10, 0, 0), &Room::love3GetWrench },
+ { Action(ACTION_GET, 12, 0, 0), &Room::love3GetGasTank },
+ { Action(ACTION_USE, OBJECT_IANTIGRA, 12, 0), &Room::love3UseAntigravOnGasTank },
+ { Action(ACTION_GET, 9, 0, 0), &Room::love3GetInsulation },
+ // TODO: common code
};
RoomAction love4ActionList[] = {
diff --git a/engines/startrek/rooms/love1.cpp b/engines/startrek/rooms/love1.cpp
index d2ffe21..9f4617b 100644
--- a/engines/startrek/rooms/love1.cpp
+++ b/engines/startrek/rooms/love1.cpp
@@ -624,7 +624,7 @@ void Room::love1CrewmanReachedLadder() {
TX_SPEAKER_FERRIS
};
- if (_vm->_awayMission.love.putLaughingGasInVent || _vm->_awayMission.love.field41) // Romulans unconscious
+ if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas || _vm->_awayMission.love.romulansUnconsciousFromVirus) // Romulans unconscious
loadRoomIndex(4, 3);
else { // Romulans still conscious, they shoot you
loadActorAnim(OBJECT_PHASERSHOT, "s3r2s2", 0xf3, 0x89, 0);
@@ -650,7 +650,7 @@ void Room::love1CrewmanDiedFromPhaser() {
// Romulans fire a "warning shot" when you go to the right part of the room.
void Room::love1TouchedHotspot0() {
- if (_vm->_awayMission.love.putLaughingGasInVent || _vm->_awayMission.love.field41)
+ if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas || _vm->_awayMission.love.romulansUnconsciousFromVirus)
return;
loadActorAnim(OBJECT_PHASERSHOT, "s3r2s1", 0xf3, 0x89, 0);
playSoundEffectIndex(SND_PHASSHOT);
diff --git a/engines/startrek/rooms/love3.cpp b/engines/startrek/rooms/love3.cpp
index 149c53c..4e73ed8 100644
--- a/engines/startrek/rooms/love3.cpp
+++ b/engines/startrek/rooms/love3.cpp
@@ -28,7 +28,7 @@
#define OBJECT_GRATE 11
#define OBJECT_GAS_TANK 12
-#define HOTSPOT_INSULATION 0x20
+#define HOTSPOT_ENGINEERING_PANEL 0x20
#define HOTSPOT_MONITOR 0x21
#define HOTSPOT_SHAFT 0x22
#define HOTSPOT_TURBINES 0x23
@@ -46,7 +46,7 @@ void Room::love3Tick1() {
else
loadActorAnim(OBJECT_GRATE, "s3r4g1", 0x116, 0x8f, 0);
- if (_vm->_awayMission.love.field3e)
+ if (_vm->_awayMission.love.insulationOnGround)
loadActorAnim(OBJECT_INSULATION, "s3r4p2", 0, 0, 0);
if (!_vm->_awayMission.love.tookN2TankFromServicePanel)
@@ -122,7 +122,7 @@ void Room::love3LookAtShaft() {
}
void Room::love3LookAtPanel() {
- if (_vm->_awayMission.love.field3e)
+ if (_vm->_awayMission.love.insulationOnGround)
showText(TX_LOV3N017);
else
showText(TX_LOV3NA22);
@@ -147,7 +147,7 @@ void Room::love3TalkToKirk() {
void Room::love3TalkToSpock() {
if (_vm->_awayMission.love.field3f)
showText(TX_SPEAKER_SPOCK, TX_LOV3_003);
- if (_vm->_awayMission.love.putLaughingGasInVent)
+ if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas)
showText(TX_SPEAKER_SPOCK, TX_LOV3_017);
else if (haveItem(OBJECT_IRLG))
showText(TX_SPEAKER_SPOCK, TX_LOV3_004);
@@ -175,7 +175,7 @@ void Room::love3UseSTricorderOnTurbines() {
}
void Room::love3UseSTricorderOnInsulation() {
- if (_vm->_awayMission.love.field3e)
+ if (_vm->_awayMission.love.insulationOnGround)
spockScan(DIR_W, TX_LOV3_002, false);
}
@@ -273,4 +273,260 @@ void Room::love3PutN2TankBack() {
loadActorAnim(OBJECT_GAS_TANK, "r4n2", 0, 0, 0);
}
+
+// Use wrench on engineering panel, insulation comes out
+void Room::love3UseWrenchOnEngineeringPanel() {
+ walkCrewman(OBJECT_KIRK, 0x37, 0xb4, 3);
+}
+
+void Room::love3ReachedEngineeringPanel() {
+ loadActorAnim2(OBJECT_KIRK, "kuselw", -1, -1, 4);
+ playVoc("MUR3E1S");
+}
+
+void Room::love3OpenedEngineeringPanel() {
+ if (!_vm->_awayMission.love.insulationOnGround) {
+ playVoc("MADR4E4A");
+ loadActorAnim(OBJECT_INSULATION, "s3r4p1", 0, 0, 0);
+ _vm->_awayMission.love.insulationOnGround = true;
+ }
+ showText(TX_LOV3N021);
+}
+
+
+void Room::love3UseWrenchOnMonitor() {
+ showText(TX_SPEAKER_SPOCK, TX_LOV3_018);
+}
+
+
+void Room::love3UseWaterOnMonitor() {
+ walkCrewmanC(OBJECT_KIRK, 0xc8, 0xb2, &Room::love3ReachedMonitorToUseWater);
+}
+
+void Room::love3ReachedMonitorToUseWater() {
+ loadActorAnimC(OBJECT_KIRK, "kusemn", -1, -1, &Room::love3PouredWaterOnMonitor);
+}
+
+void Room::love3PouredWaterOnMonitor() {
+ // BUGFIX: the speaker should be Lt. Ferris. In the original, the speaker wasn't
+ // specified.
+ // However, there is no substitute text for when Lt. Ferris is dead.
+ showText(TX_SPEAKER_FERRIS, TX_LOV3_021);
+
+ loseItem(OBJECT_IH2O);
+}
+
+
+void Room::love3UseCrewmanOnEngineeringPanelOrGrate() {
+ showText(TX_LOV3N030);
+}
+
+
+void Room::love3UseWrenchOnGrate() {
+ walkCrewmanC(OBJECT_KIRK, 0xf6, 0xaa, &Room::love3ReachedGateWithWrench);
+ _vm->_awayMission.disableInput = true;
+}
+
+void Room::love3ReachedGateWithWrench() {
+ if (_vm->_awayMission.love.grateRemoved)
+ loadActorAnimC(OBJECT_KIRK, "s3r4g2a", -1, -1, &Room::love3OpenedOrClosedGrate);
+ else
+ loadActorAnimC(OBJECT_KIRK, "s3r4g2", -1, -1, &Room::love3OpenedOrClosedGrate);
+ loadActorStandAnim(OBJECT_GRATE);
+ playVoc("MUR3E1S");
+}
+
+void Room::love3OpenedOrClosedGrate() {
+ _vm->_awayMission.disableInput = false;
+ loadActorStandAnim(OBJECT_KIRK);
+
+ if (!_vm->_awayMission.love.grateRemoved) {
+ _vm->_awayMission.love.grateRemoved = true;
+ loadActorAnim(OBJECT_GRATE, "s3r4g3", 0, 0, 0);
+ showText(TX_LOV3N016);
+ if (!_vm->_awayMission.love.gotPointsForOpeningGrate) {
+ _vm->_awayMission.love.gotPointsForOpeningGrate = true;
+ _vm->_awayMission.love.missionScore++;
+ }
+ }
+ else {
+ loadActorAnim(OBJECT_GRATE, "s3r4g1", 0x116, 0x8f, 0);
+ _vm->_awayMission.love.grateRemoved = false;
+ showText(TX_LOV3N032);
+ }
+}
+
+
+void Room::love3UseCrewmanOnShaft() {
+ showText(TX_LOV3N011);
+}
+
+
+void Room::love3UseWaterOnShaft() {
+ walkCrewmanC(OBJECT_KIRK, 0x100, 0xa6, &Room::love3ReachedShaftUsingWater);
+}
+
+void Room::love3ReachedShaftUsingWater() {
+ if (!_vm->_awayMission.love.grateRemoved)
+ showText(TX_LOV3N025);
+ else
+ loadActorAnimC(OBJECT_KIRK, "kuseme", -1, -1, &Room::love3PouredWaterDownShaft);
+}
+
+void Room::love3PouredWaterDownShaft() {
+ showText(TX_LOV3N009);
+ loseItem(OBJECT_IH2O);
+}
+
+
+void Room::love3UseNitrousOxideOnShaft() {
+ walkCrewmanC(OBJECT_KIRK, 0x100, 0xa6, &Room::love3ReachedShaftUsingNitrousOxide);
+}
+
+void Room::love3ReachedShaftUsingNitrousOxide() {
+ if (!_vm->_awayMission.love.grateRemoved)
+ showText(TX_LOV3N025);
+ else
+ loadActorAnimC(OBJECT_KIRK, "kuseme", -1, -1, &Room::love3PouredNitrousOxideDownShaft);
+}
+
+void Room::love3PouredNitrousOxideDownShaft() {
+ showText(TX_LOV3N018);
+ showText(TX_SPEAKER_SPOCK, TX_LOV3_012);
+ loseItem(OBJECT_IN2O);
+}
+
+
+void Room::love3UseAmmoniaOnShaft() {
+ walkCrewmanC(OBJECT_KIRK, 0x100, 0xa6, &Room::love3ReachedShaftUsingAmmonia);
+}
+
+void Room::love3ReachedShaftUsingAmmonia() {
+ if (!_vm->_awayMission.love.grateRemoved)
+ showText(TX_LOV3N025);
+ else
+ loadActorAnimC(OBJECT_KIRK, "kuseme", -1, -1, &Room::love3PouredAmmoniaDownShaft);
+}
+
+void Room::love3PouredAmmoniaDownShaft() {
+ if (!_vm->_awayMission.love.romulansUnconsciousFromVirus) {
+ showText(TX_LOV3N001);
+ if (!_vm->_awayMission.redshirtDead)
+ showText(TX_SPEAKER_FERRIS, TX_LOV3_023);
+ }
+
+ loseItem(OBJECT_INH3);
+}
+
+
+void Room::love3UseRomulanLaughingGasOnShaft() {
+ if (_vm->_awayMission.love.gotPointsForGassingRomulans) {
+ // BUG-ish: you could get the points for this by starting the action, then
+ // canceling it before Kirk reaches the shaft.
+ _vm->_awayMission.love.gotPointsForGassingRomulans = true;
+ _vm->_awayMission.love.missionScore += 6;
+ }
+ if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas)
+ showText(TX_SPEAKER_SPOCK, TX_LOV3_011);
+ else {
+ walkCrewmanC(OBJECT_KIRK, 0xf6, 0xa4, &Room::love3ReachedShaftUsingRomulanLaughingGas);
+ }
+}
+
+void Room::love3ReachedShaftUsingRomulanLaughingGas() {
+ if (!_vm->_awayMission.love.grateRemoved)
+ showText(TX_LOV3N025);
+ else {
+ loadActorAnimC(OBJECT_KIRK, "kuseme", -1, -1, &Room::love3PouredRomulanLaughingGasDownShaft);
+ playVoc("EFX24");
+ }
+}
+
+void Room::love3PouredRomulanLaughingGasDownShaft() {
+ loseItem(OBJECT_IRLG);
+ _vm->_awayMission.love.romulansUnconsciousFromLaughingGas = true;
+
+ if (_vm->_awayMission.love.romulansUnconsciousFromVirus) {
+ showText(TX_LOV3NA08);
+ _vm->_awayMission.love.romulansUnconsciousFromLaughingGas = false;
+ }
+ else {
+ showText(TX_LOV3NA09);
+ playVoc("ROMULANL");
+ }
+}
+
+
+// Get the wrench on the ground
+void Room::love3GetWrench() {
+ walkCrewmanC(OBJECT_KIRK, 0x104, 0xb6, &Room::love3ReachedWrenchToGet);
+}
+
+void Room::love3ReachedWrenchToGet() {
+ loadActorAnimC(OBJECT_KIRK, "s5r1kg", -1, -1, &Room::love3PickedUpWrench);
+}
+
+void Room::love3PickedUpWrench() {
+ loadActorStandAnim(OBJECT_KIRK);
+ giveItem(OBJECT_IWRENCH);
+ loadActorStandAnim(OBJECT_WRENCH);
+ _vm->_awayMission.love.wrenchTaken = true;
+ showText(TX_LOV3N031);
+}
+
+
+// Get the N2 gas tank in the service panel (fails due to weight)
+void Room::love3GetGasTank() {
+ walkCrewmanC(OBJECT_KIRK, 0x121, 0xb7, &Room::love3ReachedGasTankToGet);
+}
+
+void Room::love3ReachedGasTankToGet() {
+ if (_vm->_awayMission.love.gasTankUnscrewed)
+ showText(TX_LOV3N007);
+ else
+ showText(TX_LOV3N014);
+}
+
+
+// Use antigrav unit N2 gas tank in the service panel (succeeds)
+void Room::love3UseAntigravOnGasTank() {
+ walkCrewmanC(OBJECT_KIRK, 0x10e, 0xae, &Room::love3ReachedGasTankUsingAntigrav);
+}
+
+void Room::love3ReachedGasTankUsingAntigrav() {
+ if (_vm->_awayMission.love.gasTankUnscrewed) {
+ loadActorAnimC(OBJECT_KIRK, "kusehe", -1, -1, &Room::love3PickedUpGasTank);
+ playVoc("SE3PLBAT");
+ }
+ else {
+ showText(TX_LOV3N010);
+ showText(TX_SPEAKER_SPOCK, TX_LOV3_015);
+ }
+}
+
+void Room::love3PickedUpGasTank() {
+ giveItem(OBJECT_IN2GAS);
+ loadActorStandAnim(OBJECT_GAS_TANK);
+ _vm->_awayMission.love.tookN2TankFromServicePanel = true;
+
+ showText(TX_LOV3NJ32);
+ if (!_vm->_awayMission.redshirtDead)
+ showText(TX_SPEAKER_FERRIS, TX_LOV3_025);
+}
+
+void Room::love3GetInsulation() {
+ walkCrewmanC(OBJECT_KIRK, 0x32, 0xbe, &Room::love3ReachedInsulationToGet);
+}
+
+void Room::love3ReachedInsulationToGet() {
+ if (!_vm->_awayMission.love.field3c)
+ loadActorAnimC(OBJECT_KIRK, "s5r1kg", -1, -1, &Room::love3PickedUpInsulation);
+}
+
+void Room::love3PickedUpInsulation() {
+ loadActorStandAnim(OBJECT_KIRK);
+ giveItem(OBJECT_IINSULAT);
+ showText(TX_LOV3N029);
+}
+
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 16c5d20..2960ff1 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -459,7 +459,12 @@ void StarTrekEngine::updateActorAnimations() {
if (nextAnimFrame == actor->numAnimFrames - 1) {
actor->field62++;
if (actor->triggerActionWhenAnimFinished) {
- addAction(Action(ACTION_FINISHED_ANIMATION, actor->finishedAnimActionParam, 0, 0));
+ if (actor->finishedAnimCallback != nullptr) {
+ addAction(Action(ACTION_CALLBACK, actor->finishedAnimCallback));
+ actor->finishedAnimCallback = nullptr;
+ }
+ else
+ addAction(Action(ACTION_FINISHED_ANIMATION, actor->finishedAnimActionParam, 0, 0));
}
}
}
@@ -530,7 +535,12 @@ void StarTrekEngine::updateActorAnimations() {
if (actor->iwSrcPosition == -1) {
if (actor->triggerActionWhenAnimFinished) {
actor->triggerActionWhenAnimFinished = false;
- addAction(Action(ACTION_FINISHED_WALKING, actor->finishedAnimActionParam & 0xff, 0, 0));
+ if (actor->finishedAnimCallback != nullptr) {
+ addAction(Action(ACTION_CALLBACK, actor->finishedAnimCallback));
+ actor->finishedAnimCallback = nullptr;
+ }
+ else
+ addAction(Action(ACTION_FINISHED_WALKING, actor->finishedAnimActionParam & 0xff, 0, 0));
}
actor->sprite.bitmap.reset();
@@ -1855,13 +1865,13 @@ uint16 StarTrekEngine::getRandomWord() {
* ".txt" files are just lists of strings. This traverses the file to get a particular
* string index.
*/
-Common::String StarTrekEngine::getLoadedText(int itemIndex) {
+Common::String StarTrekEngine::getLoadedText(int textIndex) {
SharedPtr<FileStream> txtFile = loadFile(_txtFilename + ".txt");
byte *data = txtFile->_data;
- while (itemIndex != 0) {
+ while (textIndex != 0) {
while (*(data++) != '\0');
- itemIndex--;
+ textIndex--;
}
return (char *)data;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index ee741eb..acd912a 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -395,7 +395,7 @@ public:
// Misc
uint16 getRandomWord();
- Common::String getLoadedText(int itemIndex);
+ Common::String getLoadedText(int textIndex);
public:
@@ -448,6 +448,8 @@ public:
Common::Point _objectWalkPosition;
// Actions to perform after a crewman finishes walking to a position.
+ // Room-specific code can specify that a specific action of type
+ // "ACTION_FINISHED_WALKING" occurs after moving a crewman somewhere.
Action _actionOnWalkCompletion[MAX_BUFFERED_WALK_ACTIONS];
bool _actionOnWalkCompletionInUse[MAX_BUFFERED_WALK_ACTIONS];
Commit: 43a0a574ff72c88a4f659f8fd5482a33bcaac8cb
https://github.com/scummvm/scummvm/commit/43a0a574ff72c88a4f659f8fd5482a33bcaac8cb
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: LOVE4
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/love3.cpp
engines/startrek/rooms/love4.cpp
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 48c474e..01520fa 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -41,7 +41,7 @@ void StarTrekEngine::initAwayMission() {
_roomIndexToLoad = -1;
// Load crew positions for beaming in
- initAwayCrewPositions(1);
+ initAwayCrewPositions(0);
}
void StarTrekEngine::runAwayMission() {
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index f1a7e77..13d8c83 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -162,7 +162,8 @@ struct AwayMission {
bool field3c; // 0x3c
bool grateRemoved; // 0x3d
bool insulationOnGround; // 0x3e
- bool field3f; // 0x3f
+ bool visitedRoomWithRomulans; // 0x3f
+ bool romulansCured; // 0x40
bool romulansUnconsciousFromVirus; // 0x41
bool spockAccessedConsole; // 0x49
bool mccoyAccessedConsole; // 0x4a
@@ -171,6 +172,7 @@ struct AwayMission {
bool gotPointsForOpeningGrate; // 0x4d
bool gotPointsForGassingRomulans; // 0x4e
bool gotCure; // 0x4f
+ bool gotPointsForHydratingRomulans; // 0x51
int16 missionScore; // 0x52
} love;
};
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 59b37e6..0a3a0e2 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -97,10 +97,10 @@ private:
// Interface for room-specific code
- void loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66); // Cmd 0x00
+ void loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66 = 0); // Cmd 0x00
void loadActorAnimC(int actorIndex, Common::String anim, int16 x, int16 y, void (Room::*funcPtr)());// Cmd 0x00
void loadActorStandAnim(int actorIndex); // Cmd 0x01
- void loadActorAnim2(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66);// Cmd 0x02
+ void loadActorAnim2(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66 = 0);// Cmd 0x02
int showRoomSpecificText(const char **textAddr); // (Deprecated, use function below) // Cmd 0x03
int showText(const int *text); // Cmd 0x03
int showText(int speaker, int text); // Cmd 0x03
@@ -1014,6 +1014,42 @@ public:
// LOVE4
void love4Tick1();
+ void love4Tick10();
+ void love4WalkToDoor();
+ void love4TouchedHotspot0();
+ void love4DoorOpenedOrReached();
+ void love4UseKirkOnLadder();
+ void love4ReachedLadder();
+ void love4UseStunPhaserOnRomulan();
+ void love4LookAnywhere();
+ void love4LookAtLadder();
+ void love4LookAtDoor();
+ void love4LookAtKirk();
+ void love4LookAtMccoy();
+ void love4LookAtSpock();
+ void love4LookAtRedshirt();
+ void love4LookAtRomulan();
+ void love4TalkToKirk();
+ void love4TalkToMccoy();
+ void love4TalkToRedshirt();
+ void love4TalkToSpock();
+ void love4TalkToRomulan();
+ void love4UseMTricorderOnRomulan();
+ void love4UseMTricorderAnywhere();
+ void love4UseSTricorderAnywhere();
+ void love4UseCureOnRomulan();
+ void love4MccoyReachedRomulan4();
+ void love4MccoyCuredRomulan4();
+ void love4MccoyReachedRomulan3();
+ void love4MccoyCuredRomulan3();
+ void love4MccoyReachedRomulan2();
+ void love4MccoyCuredRomulan2();
+ void love4MccoyReachedRomulan1();
+ void love4MccoyCuredRomulan1();
+ void love4UseWaterOnRomulan();
+ void love4UseMedkitOnRomulan();
+ void love4UseCureSampleOnRomulan();
+ void love4UseAnythingOnRomulan();
// LOVE5
void love5Tick1();
@@ -1132,6 +1168,12 @@ private:
byte _188f; // 0x188f
} love3;
+ struct {
+ bool gaveWaterToRomulans; // 0xca
+ byte doorOpenCounter; // 0xcb
+ bool walkingToDoor; // 0xcc
+ } love4;
+
} _roomVar;
};
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 8c8df37..22cecb6 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1141,6 +1141,60 @@ RoomAction love3ActionList[] = {
RoomAction love4ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::love4Tick1 },
+ { Action(ACTION_TICK, 10, 0, 0), &Room::love4Tick10 },
+ { Action(ACTION_WALK, 8, 0, 0), &Room::love4WalkToDoor },
+ { Action(ACTION_WALK, 0x20, 0, 0), &Room::love4WalkToDoor },
+ { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::love4TouchedHotspot0 },
+ { Action(ACTION_USE, OBJECT_KIRK, 0x21, 0), &Room::love4UseKirkOnLadder },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 9, 0), &Room::love4UseStunPhaserOnRomulan },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 10, 0), &Room::love4UseStunPhaserOnRomulan },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 11, 0), &Room::love4UseStunPhaserOnRomulan },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 12, 0), &Room::love4UseStunPhaserOnRomulan },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::love4LookAnywhere },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::love4LookAtLadder },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::love4LookAtDoor },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::love4LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::love4LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::love4LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::love4LookAtRedshirt },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::love4LookAtRomulan },
+ { Action(ACTION_LOOK, 10, 0, 0), &Room::love4LookAtRomulan },
+ { Action(ACTION_LOOK, 11, 0, 0), &Room::love4LookAtRomulan },
+ { Action(ACTION_LOOK, 12, 0, 0), &Room::love4LookAtRomulan },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::love4TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::love4TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::love4TalkToRedshirt },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::love4TalkToSpock },
+ { Action(ACTION_TALK, 9, 0, 0), &Room::love4TalkToRomulan },
+ { Action(ACTION_TALK, 10, 0, 0), &Room::love4TalkToRomulan },
+ { Action(ACTION_TALK, 11, 0, 0), &Room::love4TalkToRomulan },
+ { Action(ACTION_TALK, 12, 0, 0), &Room::love4TalkToRomulan },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 9, 0), &Room::love4UseMTricorderOnRomulan },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 10, 0), &Room::love4UseMTricorderOnRomulan },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 11, 0), &Room::love4UseMTricorderOnRomulan },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 12, 0), &Room::love4UseMTricorderOnRomulan },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::love4UseMTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::love4UseSTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_ICURE, 9, 0), &Room::love4UseCureOnRomulan },
+ { Action(ACTION_USE, OBJECT_ICURE, 10, 0), &Room::love4UseCureOnRomulan },
+ { Action(ACTION_USE, OBJECT_ICURE, 11, 0), &Room::love4UseCureOnRomulan },
+ { Action(ACTION_USE, OBJECT_ICURE, 12, 0), &Room::love4UseCureOnRomulan },
+ { Action(ACTION_USE, OBJECT_IH2O, 9, 0), &Room::love4UseWaterOnRomulan },
+ { Action(ACTION_USE, OBJECT_IH2O, 10, 0), &Room::love4UseWaterOnRomulan },
+ { Action(ACTION_USE, OBJECT_IH2O, 11, 0), &Room::love4UseWaterOnRomulan },
+ { Action(ACTION_USE, OBJECT_IH2O, 12, 0), &Room::love4UseWaterOnRomulan },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 9, 0), &Room::love4UseMedkitOnRomulan },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 10, 0), &Room::love4UseMedkitOnRomulan },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 11, 0), &Room::love4UseMedkitOnRomulan },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 12, 0), &Room::love4UseMedkitOnRomulan },
+ { Action(ACTION_USE, OBJECT_ISAMPLE, 9, 0), &Room::love4UseCureSampleOnRomulan },
+ { Action(ACTION_USE, OBJECT_ISAMPLE, 10, 0), &Room::love4UseCureSampleOnRomulan },
+ { Action(ACTION_USE, OBJECT_ISAMPLE, 11, 0), &Room::love4UseCureSampleOnRomulan },
+ { Action(ACTION_USE, OBJECT_ISAMPLE, 12, 0), &Room::love4UseCureSampleOnRomulan },
+ { Action(ACTION_USE, -1, 9, 0), &Room::love4UseAnythingOnRomulan },
+ { Action(ACTION_USE, -1, 10, 0), &Room::love4UseAnythingOnRomulan },
+ { Action(ACTION_USE, -1, 11, 0), &Room::love4UseAnythingOnRomulan },
+ { Action(ACTION_USE, -1, 12, 0), &Room::love4UseAnythingOnRomulan },
};
RoomAction love5ActionList[] = {
diff --git a/engines/startrek/rooms/love3.cpp b/engines/startrek/rooms/love3.cpp
index 4e73ed8..0ac2885 100644
--- a/engines/startrek/rooms/love3.cpp
+++ b/engines/startrek/rooms/love3.cpp
@@ -61,7 +61,6 @@ void Room::love3Tick1() {
_vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
if (_vm->_awayMission.love.field2d)
_vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
-
_vm->_awayMission.timers[2] = 200;
_roomVar.love3._188e = 0xb4;
@@ -69,7 +68,7 @@ void Room::love3Tick1() {
}
void Room::love3Tick80() {
- if (!_vm->_awayMission.love.field3f && haveItem(OBJECT_IRLG)) {
+ if (!_vm->_awayMission.love.visitedRoomWithRomulans && haveItem(OBJECT_IRLG)) {
showText(TX_SPEAKER_MCCOY, TX_LOV3_010);
showText(TX_SPEAKER_SPOCK, TX_LOV3_020);
}
@@ -145,9 +144,9 @@ void Room::love3TalkToKirk() {
}
void Room::love3TalkToSpock() {
- if (_vm->_awayMission.love.field3f)
+ if (_vm->_awayMission.love.visitedRoomWithRomulans)
showText(TX_SPEAKER_SPOCK, TX_LOV3_003);
- if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas)
+ else if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas)
showText(TX_SPEAKER_SPOCK, TX_LOV3_017);
else if (haveItem(OBJECT_IRLG))
showText(TX_SPEAKER_SPOCK, TX_LOV3_004);
diff --git a/engines/startrek/rooms/love4.cpp b/engines/startrek/rooms/love4.cpp
index ec82191..63d1d9d 100644
--- a/engines/startrek/rooms/love4.cpp
+++ b/engines/startrek/rooms/love4.cpp
@@ -22,14 +22,275 @@
#include "startrek/room.h"
-#define OBJECT_DOOR1 8
+#define OBJECT_DOOR 8
+#define OBJECT_ROMULAN_1 9
+#define OBJECT_ROMULAN_2 10
+#define OBJECT_ROMULAN_3 11
+#define OBJECT_ROMULAN_4 12
-#define HOTSPOT_CONSOLE 0x20
+#define HOTSPOT_DOOR 0x20
+#define HOTSPOT_LADDER 0x21
namespace StarTrek {
void Room::love4Tick1() {
+ playVoc("LOV4LOOP");
+ if (_vm->_awayMission.love.romulansCured) {
+ loadActorAnim2(OBJECT_ROMULAN_1, "s3r5r1b", 0x36, 0xb3, 0);
+ loadActorAnim2(OBJECT_ROMULAN_2, "s3r5r2b", 0xb9, 0xbb, 0);
+ loadActorAnim2(OBJECT_ROMULAN_3, "s3r5r3b", 0xef, 0xc4, 0);
+ loadActorAnim2(OBJECT_ROMULAN_4, "s3r5r4b", 0x12a, 0xaa, 0);
+ }
+ else {
+ loadActorAnim2(OBJECT_ROMULAN_1, "s3r5r1a", 0x36, 0xb3, 0);
+ loadActorAnim2(OBJECT_ROMULAN_2, "s3r5r2a", 0xb9, 0xbb, 0);
+ loadActorAnim2(OBJECT_ROMULAN_3, "s3r5r3a", 0xef, 0xc4, 0);
+ loadActorAnim2(OBJECT_ROMULAN_4, "s3r5r4a", 0x12a, 0xaa, 0);
+ }
+
+ if (_vm->_awayMission.love.field2c)
+ _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
+ if (_vm->_awayMission.love.field2d)
+ _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
+ _vm->_awayMission.timers[2] = 200;
+
+ loadActorAnim(OBJECT_DOOR, "s3r5d1a", 0x90, 0x99, 0);
+}
+
+void Room::love4Tick10() {
+ if (!_vm->_awayMission.love.visitedRoomWithRomulans) {
+ playMidiMusicTracks(1, -1);
+ _vm->_awayMission.love.visitedRoomWithRomulans = true;
+ }
+}
+
+void Room::love4WalkToDoor() {
+ _vm->_awayMission.disableInput = true;
+ _roomVar.love4.walkingToDoor = true;
+ walkCrewmanC(OBJECT_KIRK, 0x91, 0x9c, &Room::love4DoorOpenedOrReached);
+}
+
+// Triggers the door opening
+void Room::love4TouchedHotspot0() {
+ if (_roomVar.love4.walkingToDoor) {
+ loadActorAnimC(OBJECT_DOOR, "s3r5d1", 0x90, 0x99, &Room::love4DoorOpenedOrReached);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+}
+
+void Room::love4DoorOpenedOrReached() {
+ _roomVar.love4.doorOpenCounter++;
+ if (_roomVar.love4.doorOpenCounter == 2)
+ loadRoomIndex(5, 1);
+}
+
+void Room::love4UseKirkOnLadder() {
+ walkCrewmanC(OBJECT_KIRK, 0xf6, 0xac, &Room::love4ReachedLadder);
+}
+
+void Room::love4ReachedLadder() {
+ loadRoomIndex(1, 2);
+}
+
+void Room::love4UseStunPhaserOnRomulan() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV4_007);
+}
+
+void Room::love4LookAnywhere() {
+ showText(TX_LOV4N009);
+}
+
+void Room::love4LookAtLadder() {
+ showText(TX_LOV4N010);
+}
+
+void Room::love4LookAtDoor() {
+ showText(TX_LOV4N008);
+}
+
+void Room::love4LookAtKirk() {
+ showText(TX_LOV4N002);
+}
+
+void Room::love4LookAtMccoy() {
+ // BUGFIX: original game plays audio "LOV4/LOV4_025". This is mccoy saying something.
+ // It doesn't match up with the actual text, which is the narrator saying that mccoy
+ // is thinking it.
+ // Not sure if this was an intentional decision, but there is another unused audio
+ // file which matches with the text more accurately, so I'm using that instead.
+ showText(TX_LOV4N012);
+}
+
+void Room::love4LookAtSpock() {
+ showText(TX_LOV4N003);
+}
+
+void Room::love4LookAtRedshirt() {
+ showText(TX_LOV4N001);
+}
+
+void Room::love4LookAtRomulan() {
+ if (!_vm->_awayMission.love.romulansCured)
+ showText(TX_LOV4N006);
+ else
+ showText(TX_LOV4N011);
+}
+
+void Room::love4TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_LOV4_005);
+ showText(TX_SPEAKER_MCCOY, TX_LOV4_024);
+ showText(TX_SPEAKER_KIRK, TX_LOV4_002);
+}
+
+void Room::love4TalkToMccoy() {
+ if (_vm->_awayMission.love.romulansCured)
+ showText(TX_SPEAKER_MCCOY, TX_LOV4_022);
+ else
+ showText(TX_SPEAKER_MCCOY, TX_LOV4_010);
+}
+
+void Room::love4TalkToRedshirt() {
+ showText(TX_SPEAKER_FERRIS, TX_LOV4_028);
+}
+
+void Room::love4TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_LOV4_027);
+ showText(TX_SPEAKER_KIRK, TX_LOV4_003);
+}
+
+void Room::love4TalkToRomulan() {
+ if (_vm->_awayMission.love.romulansCured)
+ showText(TX_LOV4N007); // BUGFIX: original didn't play audio
+}
+
+void Room::love4UseMTricorderOnRomulan() {
+ if (_vm->_awayMission.love.romulansCured)
+ mccoyScan(DIR_S, TX_LOV4_018, false);
+ else
+ mccoyScan(DIR_S, TX_LOV4_015, false);
+}
+
+void Room::love4UseMTricorderAnywhere() {
+ if (_vm->_awayMission.love.romulansCured)
+ mccoyScan(DIR_S, TX_LOV4_019, false);
+ else if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas)
+ mccoyScan(DIR_S, TX_LOV4_020, false);
+ else
+ mccoyScan(DIR_S, TX_LOV4_021, false);
+}
+
+void Room::love4UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_LOV4_006, false);
+}
+
+
+// Mccoy walks around to all romulans, giving each the cure
+void Room::love4UseCureOnRomulan() {
+ if (_vm->_awayMission.love.romulansCured)
+ showText(TX_SPEAKER_MCCOY, TX_LOV4_013);
+ else {
+ _vm->_awayMission.love.missionScore += 2;
+ _vm->_awayMission.love.romulansCured = true;
+ _vm->_awayMission.disableInput = true;
+ walkCrewmanC(OBJECT_MCCOY, 0x10e, 0xb1, &Room::love4MccoyReachedRomulan4);
+ }
+}
+
+void Room::love4MccoyReachedRomulan4() {
+ loadActorAnimC(OBJECT_MCCOY, "museme", -1, -1, &Room::love4MccoyCuredRomulan4);
+}
+
+void Room::love4MccoyCuredRomulan4() {
+ loadActorAnim2(OBJECT_ROMULAN_4, "s3r5r4", 0x12a, 0xaa);
+ walkCrewmanC(OBJECT_MCCOY, 0xeb, 0xc4, &Room::love4MccoyReachedRomulan3);
+}
+
+void Room::love4MccoyReachedRomulan3() {
+ loadActorAnimC(OBJECT_MCCOY, "musele", -1, -1, &Room::love4MccoyCuredRomulan3);
+}
+
+void Room::love4MccoyCuredRomulan3() {
+ loadActorAnim2(OBJECT_ROMULAN_3, "s3r5r3", 0xef, 0xc4);
+ walkCrewmanC(OBJECT_MCCOY, 0xb9, 0xc3, &Room::love4MccoyReachedRomulan2);
+}
+
+void Room::love4MccoyReachedRomulan2() {
+ loadActorAnimC(OBJECT_MCCOY, "musemn", -1, -1, &Room::love4MccoyCuredRomulan2);
+}
+
+void Room::love4MccoyCuredRomulan2() {
+ loadActorAnim2(OBJECT_ROMULAN_2, "s3r5r2", 0xb9, 0xbb);
+ walkCrewmanC(OBJECT_MCCOY, 0x36, 0xba, &Room::love4MccoyReachedRomulan1);
+}
+
+void Room::love4MccoyReachedRomulan1() {
+ loadActorAnimC(OBJECT_MCCOY, "musemn", -1, -1, &Room::love4MccoyCuredRomulan1);
+}
+
+void Room::love4MccoyCuredRomulan1() {
+ loadActorAnim2(OBJECT_ROMULAN_1, "s3r5r1", 0x36, 0xb3, 0);
+
+ showText(TX_LOV4N005);
+ if (!_roomVar.love4.gaveWaterToRomulans)
+ showText(TX_LOV4_023);
+
+ _vm->_awayMission.disableInput = false;
+}
+
+
+void Room::love4UseWaterOnRomulan() {
+ // BUGFIX: If the romulans are unconscious, you can't use water on them.
+ // In the original, you could use water on them, but there would be no corresponding
+ // narration, you'd get no points for it, and you'd lose the water anyway.
+ if (!_vm->_awayMission.love.romulansCured)
+ showText(TX_SPEAKER_MCCOY, TX_LOV4_009);
+ else {
+ _roomVar.love4.gaveWaterToRomulans = true;
+ if (_vm->_awayMission.love.romulansCured) {
+ showText(TX_LOV4N013);
+ showText(TX_SPEAKER_MCCOY, TX_LOV4_026);
+ showText(TX_SPEAKER_KIRK, TX_LOV4_001);
+ if (!_vm->_awayMission.love.gotPointsForHydratingRomulans) {
+ _vm->_awayMission.love.gotPointsForHydratingRomulans = true;
+ _vm->_awayMission.love.missionScore += 2;
+ }
+ }
+
+ loseItem(OBJECT_IH2O);
+ }
+
+ // Note the following unused block of code, an alternative implementation of the
+ // function? If they succumbed to the virus from taking too long, McCoy doesn't let
+ // you hydrate them, saying it's dangerous. Otherwise, the romulans get up even
+ // without receiving the cure. (At least the narration says they do.)
+ // These events don't make too much sense, probably cut in the original release, but
+ // they did get voice acted anyway.
+ if (false) {
+ if (_vm->_awayMission.love.romulansUnconsciousFromVirus)
+ showText(TX_SPEAKER_MCCOY, TX_LOV4_009);
+ else {
+ showText(TX_LOV4N004);
+ if (!_vm->_awayMission.redshirtDead) {
+ showText(TX_SPEAKER_FERRIS, TX_LOV4_029);
+ showText(TX_SPEAKER_KIRK, TX_LOV4_004);
+ }
+ showText(TX_SPEAKER_MCCOY, TX_LOV4_011);
+ loseItem(OBJECT_IH2O);
+ }
+ }
+}
+
+void Room::love4UseMedkitOnRomulan() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV4_012);
+}
+
+void Room::love4UseCureSampleOnRomulan() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV4_014);
+}
+
+void Room::love4UseAnythingOnRomulan() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV4_017);
}
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 2960ff1..e239806 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -84,7 +84,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxHasMultipleChoices = false;
_missionToLoad = "LOVE";
- _roomIndexToLoad = 3;
+ _roomIndexToLoad = 4;
for (int i = 0; i < NUM_OBJECTS; i++)
_itemList[i] = g_itemList[i];
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 53062fb..a72c253 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -1030,6 +1030,49 @@ enum GameStringIDs {
TX_LOV3NJ32,
+ TX_LOV4_001,
+ TX_LOV4_002,
+ TX_LOV4_003,
+ TX_LOV4_004,
+ TX_LOV4_005,
+ TX_LOV4_006,
+ TX_LOV4_007,
+ TX_LOV4_009,
+ TX_LOV4_010,
+ TX_LOV4_011,
+ TX_LOV4_012,
+ TX_LOV4_013,
+ TX_LOV4_014,
+ TX_LOV4_015,
+ TX_LOV4_016,
+ TX_LOV4_017,
+ TX_LOV4_018,
+ TX_LOV4_019,
+ TX_LOV4_020,
+ TX_LOV4_021,
+ TX_LOV4_022,
+ TX_LOV4_023,
+ TX_LOV4_024,
+ TX_LOV4_025,
+ TX_LOV4_026,
+ TX_LOV4_027,
+ TX_LOV4_028,
+ TX_LOV4_029,
+ TX_LOV4N000,
+ TX_LOV4N001,
+ TX_LOV4N002,
+ TX_LOV4N003,
+ TX_LOV4N004,
+ TX_LOV4N005,
+ TX_LOV4N006,
+ TX_LOV4N007,
+ TX_LOV4N008,
+ TX_LOV4N009,
+ TX_LOV4N010,
+ TX_LOV4N011,
+ TX_LOV4N012,
+ TX_LOV4N013,
+
TX_END
};
@@ -2006,6 +2049,50 @@ const char * const g_gameStrings[] = {
"#LOV3\\LOV3NA22#This is an engineering access panel, allowing repairs to be made to the interior wiring in the equipment.",
"#LOV3\\LOV3NA23#This is the engineering center for the ARK7 space station.",
"#LOV3\\LOV3NJ32#You attach the antigrav unit to the gas tank. It can be moved freely.",
+
+
+ "#LOV4\\LOV4_001#We aren't barbarians, in spite of what some people think.",
+ "#LOV4\\LOV4_002#Being surrounded by Romulans and not at gun point.",
+ "#LOV4\\LOV4_003#I know Mr. Spock. But we'll get through this.",
+ "#LOV4\\LOV4_004#Lt. Ferris, collect their weapons.",
+ "#LOV4\\LOV4_005#Well, there's a first time for everything.",
+ "#LOV4\\LOV4_006#Except for the Romulans, I can detect no other lifeforms in this room.",
+ "#LOV4\\LOV4_007#Are you crazy, Jim! That's not going to help in the least!",
+ "#LOV4\\LOV4_009#Careful there! They're suffering from dehydration but it's dangerous to give water to someone while they're unconscious. These men need serum or they're going to die!",
+ "#LOV4\\LOV4_010#Dammit, Jim, I'm a doctor, not a diplomat. I've got to try and save these men.",
+ "#LOV4\\LOV4_011#Dammit, Jim, these men are sick! They need my help!",
+ "#LOV4\\LOV4_012#I don't have the proper medicine to cure them, Jim.",
+ "#LOV4\\LOV4_013#I don't think they need another shot, Jim.",
+ "#LOV4\\LOV4_014#Jim, we need to synthesize more before we can use it.",
+ "#LOV4\\LOV4_015#Jim, we've got to help these men before they die.",
+ "#LOV4\\LOV4_016#Ouch!",
+ "#LOV4\\LOV4_017#That's not working, Jim.",
+ "#LOV4\\LOV4_018#The Romulans have been cured of the Oroborus virus, but they are severely dehydrated and need some rest.",
+ "#LOV4\\LOV4_019#The Romulans have been cured of the Oroborus virus.",
+ "#LOV4\\LOV4_020#The laughing gas did the trick, Jim, but these Romulans are still very, very sick -- they've only got hours left.",
+ "#LOV4\\LOV4_021#These Romulans will die soon if we can't cure them.",
+ "#LOV4\\LOV4_022#They'll be fine now, Jim. They just need some rest.",
+ "#LOV4\\LOV4_023#They're severely dehydrated, but they'll live. We got to them in time.",
+ "#LOV4\\LOV4_024#First time for what?",
+ "#LOV4\\LOV4_025#McCoy thinks to himself: 'Dammit, I'm a doctor, not a diplomat!'",
+ "#LOV4\\LOV4_026#Take it easy now... You'll feel better in a few minutes. Good thing we had the water available, Jim.",
+ "#LOV4\\LOV4_027#I have been in more comfortable situations, Captain.",
+ "#LOV4\\LOV4_028#These Romulans appear to be a negligible threat, sir.",
+ "#LOV4\\LOV4_029#Freeze, Romulans! You're covered!",
+ "#LOV4\\LOV4N000#Door Opens.",
+ "#LOV4\\LOV4N001#Ensign Ferris is looking at the Romulans, in case one of them decides to try something.",
+ "#LOV4\\LOV4N002#James Kirk views the scene with concern.",
+ "#LOV4\\LOV4N003#Mr. Spock is his usual stoic self.",
+ "#LOV4\\LOV4N004#The Romulans come to weakly, reaching for their weapons.",
+ "#LOV4\\LOV4N005#The Romulans stir weakly, then begin to get up... they've all been cured!",
+ "#LOV4\\LOV4N006#These Romulans are totally out of it.",
+ "#LOV4\\LOV4N007#They are in no condition to talk right now.",
+ "#LOV4\\LOV4N008#This door leads into another section of the base.",
+ "#LOV4\\LOV4N009#This is the ARK7's crew quarters. There are only Romulans here.",
+ "#LOV4\\LOV4N010#This ladder leads back to the research lab.",
+ "#LOV4\\LOV4N011#This Romulan is groggy, but conscious.",
+ "#LOV4\\LOV4N012#McCoy thinks to himself: 'Dammit, I'm a doctor, not a diplomat!'",
+ "#LOV4\\LOV4N013#The Romulans drink thirstily and empty the container.",
};
}
Commit: 958a9065aa07644698215d9aef7f24f501b569a4
https://github.com/scummvm/scummvm/commit/958a9065aa07644698215d9aef7f24f501b569a4
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: LOVE5
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/love4.cpp
engines/startrek/rooms/love5.cpp
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 01520fa..4c2e8a1 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -41,7 +41,7 @@ void StarTrekEngine::initAwayMission() {
_roomIndexToLoad = -1;
// Load crew positions for beaming in
- initAwayCrewPositions(0);
+ initAwayCrewPositions(4);
}
void StarTrekEngine::runAwayMission() {
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 13d8c83..fdf46ee 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -165,6 +165,9 @@ struct AwayMission {
bool visitedRoomWithRomulans; // 0x3f
bool romulansCured; // 0x40
bool romulansUnconsciousFromVirus; // 0x41
+ bool freedMarcusAndCheever; // 0x42
+ bool preaxCured; // 0x43
+ bool spockCured; // 0x46
bool spockAccessedConsole; // 0x49
bool mccoyAccessedConsole; // 0x4a
bool gotPolyberylcarbonate; // 0x4b
@@ -172,6 +175,7 @@ struct AwayMission {
bool gotPointsForOpeningGrate; // 0x4d
bool gotPointsForGassingRomulans; // 0x4e
bool gotCure; // 0x4f
+ bool gotPointsForHydratingPreax; // 0x50
bool gotPointsForHydratingRomulans; // 0x51
int16 missionScore; // 0x52
} love;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 0a3a0e2..3775974 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -109,7 +109,7 @@ private:
// Command 0x05: "demon4ShowSunPuzzle"
void loadRoomIndex(int roomIndex, int spawnIndex); // Cmd 0x06
void loseItem(int item); // Cmd 0x07
- void walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam);// Cmd 0x08
+ void walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam = 0);// Cmd 0x08
void walkCrewmanC(int actorIndex, int16 destX, int16 destY, void (Room::*funcPtr)()); // Cmd 0x08
void loadMapFile(const Common::String &name); // Cmd 0x09
void showBitmapFor5Ticks(const Common::String &bmpName, int priority); // Cmd 0x0a
@@ -1053,6 +1053,47 @@ public:
// LOVE5
void love5Tick1();
+ void love5TouchedWarp1();
+ void love5Timer4Expired();
+ void love5UseStunPhaserOnPreax();
+ void love5LookAtKirk();
+ void love5LookAtSpock();
+ void love5LookAtMccoy();
+ void love5LookAtRedshirt();
+ void love5LookAnywhere();
+ void love5LookAtDevice();
+ void love5LookAtConsole();
+ void love5LookAtDrMarcus();
+ void love5LookAtDrCheever();
+ void love5LookAtPreax();
+ void love5TalkToPreax();
+ void love5MccoyReachedSpockToCure();
+ void love5MccoyCuredSpock();
+ void love5EndMission();
+ void love5CrewmanReachedBeamoutPosition();
+ void love5TalkToDrMarcus();
+ void love5TalkToDrCheever();
+ void love5TalkToKirk();
+ void love5TalkToSpock();
+ void love5TalkToMccoy();
+ void love5TalkToRedshirt();
+ void love5UseSTricorderAnywhere();
+ void love5UseSTricorderOnDevice();
+ void love5UseMTricorderOnMarcusOrCheever();
+ void love5UseMTricorderOnPreax();
+ void love5UseMedkitOnPreax();
+ void love5UseWaterOnPreax();
+ void love5UseCureSampleOnPreax();
+ void love5UseCureOnPreax();
+ void love5ReachedPreaxUsingCure();
+ void love5CuredPreax();
+ void love5UseAnythingOnPreax();
+ void love5UseKirkOnMarcusOrCheever();
+ void love5KirkReachedCheever();
+ void love5KirkUntiedCheever();
+ void love5KirkReachedMarcus();
+ void love5KirkUntiedMarcus();
+ void love5MarcusStoodUp();
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
@@ -1174,6 +1215,10 @@ private:
bool walkingToDoor; // 0xcc
} love4;
+ struct {
+ byte numCrewmenReadyToBeamOut; // 0xcb
+ } love5;
+
} _roomVar;
};
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 22cecb6..54b1028 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1150,6 +1150,7 @@ RoomAction love4ActionList[] = {
{ Action(ACTION_USE, OBJECT_IPHASERS, 10, 0), &Room::love4UseStunPhaserOnRomulan },
{ Action(ACTION_USE, OBJECT_IPHASERS, 11, 0), &Room::love4UseStunPhaserOnRomulan },
{ Action(ACTION_USE, OBJECT_IPHASERS, 12, 0), &Room::love4UseStunPhaserOnRomulan },
+ // NOTE: nothing for OBJECT_IPHASERK. There's an unused audio file which might fit.
{ Action(ACTION_LOOK, -1, 0, 0), &Room::love4LookAnywhere },
{ Action(ACTION_LOOK, 0x21, 0, 0), &Room::love4LookAtLadder },
{ Action(ACTION_LOOK, 8, 0, 0), &Room::love4LookAtDoor },
@@ -1195,10 +1196,45 @@ RoomAction love4ActionList[] = {
{ Action(ACTION_USE, -1, 10, 0), &Room::love4UseAnythingOnRomulan },
{ Action(ACTION_USE, -1, 11, 0), &Room::love4UseAnythingOnRomulan },
{ Action(ACTION_USE, -1, 12, 0), &Room::love4UseAnythingOnRomulan },
+ // TODO: common code
};
RoomAction love5ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::love5Tick1 },
+ { Action(ACTION_TOUCHED_WARP, 1, 0, 0), &Room::love5TouchedWarp1 },
+ { Action(ACTION_TIMER_EXPIRED, 4, 0, 0), &Room::love5Timer4Expired },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 9, 0), &Room::love5UseStunPhaserOnPreax },
+ // NOTE: nothing for OBJECT_IPHASERK. There's an unused audio file which might fit.
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::love5LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::love5LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::love5LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::love5LookAtRedshirt },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::love5LookAnywhere },
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::love5LookAtDevice },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::love5LookAtConsole },
+ { Action(ACTION_LOOK, 10, 0, 0), &Room::love5LookAtDrMarcus },
+ { Action(ACTION_LOOK, 11, 0, 0), &Room::love5LookAtDrCheever },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::love5LookAtPreax },
+ { Action(ACTION_TALK, 9, 0, 0), &Room::love5TalkToPreax },
+ { Action(ACTION_TALK, 10, 0, 0), &Room::love5TalkToDrMarcus },
+ { Action(ACTION_TALK, 11, 0, 0), &Room::love5TalkToDrCheever },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::love5TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::love5TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::love5TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::love5TalkToRedshirt },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::love5UseSTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::love5UseSTricorderOnDevice },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 10, 0), &Room::love5UseMTricorderOnMarcusOrCheever },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 11, 0), &Room::love5UseMTricorderOnMarcusOrCheever },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 9, 0), &Room::love5UseMTricorderOnPreax },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 9, 0), &Room::love5UseMedkitOnPreax },
+ { Action(ACTION_USE, OBJECT_IH2O, 9, 0), &Room::love5UseWaterOnPreax },
+ { Action(ACTION_USE, OBJECT_ISAMPLE, 9, 0), &Room::love5UseCureSampleOnPreax },
+ { Action(ACTION_USE, OBJECT_ICURE, 9, 0), &Room::love5UseCureOnPreax },
+ { Action(ACTION_USE, -1, 9, 0), &Room::love5UseAnythingOnPreax },
+ { Action(ACTION_USE, OBJECT_KIRK, 10, 0), &Room::love5UseKirkOnMarcusOrCheever },
+ { Action(ACTION_USE, OBJECT_KIRK, 11, 0), &Room::love5UseKirkOnMarcusOrCheever },
+ // TODO: common code
};
diff --git a/engines/startrek/rooms/love4.cpp b/engines/startrek/rooms/love4.cpp
index 63d1d9d..e1cfcf3 100644
--- a/engines/startrek/rooms/love4.cpp
+++ b/engines/startrek/rooms/love4.cpp
@@ -261,9 +261,10 @@ void Room::love4UseWaterOnRomulan() {
}
// Note the following unused block of code, an alternative implementation of the
- // function? If they succumbed to the virus from taking too long, McCoy doesn't let
- // you hydrate them, saying it's dangerous. Otherwise, the romulans get up even
- // without receiving the cure. (At least the narration says they do.)
+ // function, resembling the version in love5. If they succumbed to the virus from
+ // taking too long, McCoy doesn't let you hydrate them, saying it's dangerous.
+ // Otherwise, the romulans get up even without receiving the cure. (At least the
+ // narration says they do.)
// These events don't make too much sense, probably cut in the original release, but
// they did get voice acted anyway.
if (false) {
diff --git a/engines/startrek/rooms/love5.cpp b/engines/startrek/rooms/love5.cpp
index 0abeb59..9a0cd8d 100644
--- a/engines/startrek/rooms/love5.cpp
+++ b/engines/startrek/rooms/love5.cpp
@@ -22,14 +22,401 @@
#include "startrek/room.h"
-#define OBJECT_DOOR1 8
+#define OBJECT_8 8
+#define OBJECT_PREAX 9
+#define OBJECT_MARCUS 10
+#define OBJECT_CHEEVER 11
-#define HOTSPOT_CONSOLE 0x20
+#define HOTSPOT_DEVICE 0x20
+#define HOTSPOT_CONSOLE 0x21
namespace StarTrek {
void Room::love5Tick1() {
+ playVoc("LOV5LOOP");
+ loadActorAnim(OBJECT_8, "s3r6c1", 0x27, 0xa9);
+
+ if (_vm->_awayMission.love.freedMarcusAndCheever) {
+ loadActorAnim(OBJECT_MARCUS, "marcusst", 0x28, 0xa6);
+ loadActorAnim(OBJECT_CHEEVER, "s3gtupst", 0x49, 0xac);
+ }
+ else {
+ loadActorAnim(OBJECT_MARCUS, "marcus2", 0x28, 0xa6);
+ loadActorAnim(OBJECT_CHEEVER, "s3gtup2", 0x49, 0xac);
+ }
+
+ if (_vm->_awayMission.love.preaxCured)
+ loadActorAnim(OBJECT_PREAX, "s3r6r3", 0x116, 0xba);
+ else
+ loadActorAnim(OBJECT_PREAX, "s3r6r2", 0x116, 0xba);
+
+ if (_vm->_awayMission.love.field2c)
+ _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
+ if (_vm->_awayMission.love.field2d)
+ _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
+ _vm->_awayMission.timers[2] = 200;
+}
+
+void Room::love5TouchedWarp1() {
+ _vm->_awayMission.disableInput = true;
+ playSoundEffectIndex(SND_DOOR1);
+ _vm->_awayMission.timers[4] = 10;
+}
+
+void Room::love5Timer4Expired() {
+ loadRoomIndex(4, 0);
+}
+
+void Room::love5UseStunPhaserOnPreax() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_011);
+
+ // BUG: this function has two implementations. The second one (which is shadowed) is
+ // below.
+ // Perhaps one was supposed to be for IPHASERK, or for Dr. Marcus?
+ //showText(TX_SPEAKER_MCCOY, TX_FEA5_008);
+}
+
+void Room::love5LookAtKirk() {
+ showText(TX_LOV5N004);
+}
+
+void Room::love5LookAtSpock() {
+ showText(TX_LOV5N005);
+}
+
+void Room::love5LookAtMccoy() {
+ showText(TX_LOV5N002);
+}
+
+void Room::love5LookAtRedshirt() {
+ showText(TX_LOV5N003);
+}
+
+void Room::love5LookAnywhere() {
+ showText(TX_LOV5N008);
+
+ // There is an unused version of this function, which states "This is Dr. Marcus's
+ // quarters, and there are hostages and 4 romulans here". That description doesn't
+ // match any actual room.
+ // There are LOVE6.MAP and LOVE6.IW files, but none of the other necessary files to
+ // load room LOVE6. This may be a leftover from a removed room that somehow ended up
+ // here.
+
+ //showText(TX_LOV5N009);
+}
+
+void Room::love5LookAtDevice() {
+ showText(TX_LOV5N013);
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_028);
+ showText(TX_SPEAKER_MARCUS, TX_LOV5_044);
+}
+
+void Room::love5LookAtConsole() {
+ showText(TX_LOV5N016);
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_031);
+ showText(TX_SPEAKER_MARCUS, TX_LOV5_050);
+}
+
+void Room::love5LookAtDrMarcus() {
+ if (_vm->_awayMission.love.freedMarcusAndCheever)
+ showText(TX_LOV5N001);
+ else {
+ // BUGFIX: originally played audio "LOV5N001", which is only the first sentence of
+ // what should be spoken.
+ showText(TX_LOV5N015);
+
+ showText(TX_SPEAKER_MARCUS, TX_LOV5_046);
+ }
+}
+
+void Room::love5LookAtDrCheever() {
+ if (_vm->_awayMission.love.freedMarcusAndCheever)
+ showText(TX_LOV5N000);
+ else {
+ showText(TX_LOV5N014);
+ showText(TX_SPEAKER_CHEEVER, TX_LOV5_057);
+ if (!_vm->_awayMission.redshirtDead) {
+ showText(TX_SPEAKER_FERRIS, TX_LOV5_054);
+ showText(TX_SPEAKER_CHEEVER, TX_LOV5_058);
+ }
+ }
+}
+
+void Room::love5LookAtPreax() {
+ if (_vm->_awayMission.love.preaxCured)
+ showText(TX_LOV5N011);
+ else
+ showText(TX_LOV5N012);
+}
+
+void Room::love5TalkToPreax() {
+ if (_vm->_awayMission.love.preaxCured) {
+ if (!_vm->_awayMission.love.freedMarcusAndCheever)
+ showText(TX_LOV5N006);
+ else {
+ const int choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_LOV5_008,
+ TX_LOV5_004,
+ TX_LOV5_006,
+ TX_BLANK,
+ };
+
+ showText(TX_SPEAKER_PREAX, TX_LOV5_059);
+ int choice = showText(choices);
+
+ switch (choice) {
+ case 1:
+ showText(TX_SPEAKER_MARCUS, TX_LOV5_043);
+ // fall through
+ case 0:
+ showText(TX_SPEAKER_PREAX, TX_LOV5_061);
+ showText(TX_SPEAKER_KIRK, TX_LOV5_010);
+
+ // NOTE: This just says "(Spock raises an eyebrow)". No audio associated.
+ showText(TX_SPEAKER_SPOCK, TX_LOV5C001);
+
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_032);
+
+ break;
+ case 2:
+ showText(TX_SPEAKER_PREAX, TX_LOV5_060);
+ break;
+ default:
+ showText(TX_DIALOG_ERROR);
+ break;
+ }
+
+ showText(TX_SPEAKER_KIRK, TX_LOV5_002);
+ showText(TX_SPEAKER_MARCUS, TX_LOV5_045);
+
+ _vm->_awayMission.disableInput = true;
+
+ if (!_vm->_awayMission.love.spockCured) {
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_021);
+ walkCrewmanC(OBJECT_MCCOY, 0x87, 0xc3, &Room::love5MccoyReachedSpockToCure);
+ }
+ else
+ love5EndMission();
+ }
+ } else
+ showText(TX_SPEAKER_MARCUS, TX_LOV5_018);
+}
+
+void Room::love5MccoyReachedSpockToCure() {
+ loadActorAnimC(OBJECT_MCCOY, "musemn", -1, -1, &Room::love5MccoyCuredSpock);
+}
+
+void Room::love5MccoyCuredSpock() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_030);
+ showText(TX_SPEAKER_SPOCK, TX_LOV5_038);
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_027);
+ // NOTE: This just says "(Spock raises an eyebrow)". No audio associated.
+ showText(TX_SPEAKER_SPOCK, TX_LOV5C001);
+ love5EndMission();
+}
+
+void Room::love5EndMission() {
+ showText(TX_SPEAKER_KIRK, TX_LOV5_001);
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ walkCrewmanC(OBJECT_KIRK, 0x64, 0xc2, &Room::love5CrewmanReachedBeamoutPosition);
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ walkCrewmanC(OBJECT_SPOCK, 0x5a, 0xb8, &Room::love5CrewmanReachedBeamoutPosition);
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ walkCrewmanC(OBJECT_MCCOY, 0x6e, 0xb8, &Room::love5CrewmanReachedBeamoutPosition);
+
+ if (!_vm->_awayMission.redshirtDead) {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
+ walkCrewmanC(OBJECT_REDSHIRT, 0x69, 0xae, &Room::love5CrewmanReachedBeamoutPosition);
+ _roomVar.love5.numCrewmenReadyToBeamOut--;
+ }
+}
+
+void Room::love5CrewmanReachedBeamoutPosition() {
+ _roomVar.love5.numCrewmenReadyToBeamOut++;
+ if (_roomVar.love5.numCrewmenReadyToBeamOut == 3) {
+ _vm->_awayMission.love.missionScore += 17;
+ endMission(_vm->_awayMission.love.missionScore, 0x2c, 0);
+ }
+}
+
+void Room::love5TalkToDrMarcus() {
+ if (!_vm->_awayMission.love.freedMarcusAndCheever)
+ showText(TX_SPEAKER_MARCUS, TX_LOV5_040);
+ else {
+ if (!haveItem(OBJECT_ICURE))
+ showText(TX_SPEAKER_MARCUS, TX_LOV5_039);
+ else
+ showText(TX_SPEAKER_MARCUS, TX_LOV5_042);
+ }
+}
+
+void Room::love5TalkToDrCheever() {
+ if (!_vm->_awayMission.love.freedMarcusAndCheever)
+ showText(TX_SPEAKER_CHEEVER, TX_LOV5_055);
+ else
+ showText(TX_SPEAKER_CHEEVER, TX_LOV5_056);
+}
+
+void Room::love5TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_LOV5_003);
+ showText(TX_SPEAKER_MARCUS, TX_LOV5_048);
+ showText(TX_SPEAKER_KIRK, TX_LOV5_009);
+ showText(TX_SPEAKER_MARCUS, TX_LOV5_047);
+}
+
+void Room::love5TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_LOV5_036);
+ showText(TX_SPEAKER_MARCUS, TX_LOV5_051);
+ showText(TX_SPEAKER_SPOCK, TX_G_024);
+}
+
+void Room::love5TalkToMccoy() {
+ if (!_vm->_awayMission.love.preaxCured)
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_014);
+}
+
+void Room::love5TalkToRedshirt() {
+ showText(TX_SPEAKER_FERRIS, TX_LOV5_052);
+}
+
+void Room::love5UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_LOV5_033, false);
+}
+
+void Room::love5UseSTricorderOnDevice() {
+ spockScan(DIR_N, TX_LOV5_034, false);
+ showText(TX_SPEAKER_MARCUS, TX_LOV5_049);
+}
+
+void Room::love5UseMTricorderOnMarcusOrCheever() {
+ mccoyScan(DIR_W, TX_LOV5_025, false);
+}
+
+void Room::love5UseMTricorderOnPreax() {
+ if (!_vm->_awayMission.love.preaxCured) {
+ if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas)
+ mccoyScan(DIR_E, TX_LOV5_024, false);
+ else
+ mccoyScan(DIR_E, TX_LOV5_016, false);
+ }
+}
+
+void Room::love5UseMedkitOnPreax() {
+ if (_vm->_awayMission.love.preaxCured)
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_015);
+ else
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_019);
+}
+
+void Room::love5UseWaterOnPreax() {
+ if (_vm->_awayMission.love.preaxCured) {
+ showText(TX_LOV5N018);
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_029);
+ showText(TX_SPEAKER_KIRK, TX_LOV5_007);
+ if (!_vm->_awayMission.love.gotPointsForHydratingPreax) {
+ _vm->_awayMission.love.gotPointsForHydratingPreax = true;
+ _vm->_awayMission.love.missionScore++;
+ }
+ loseItem(OBJECT_IH2O);
+ }
+ else {
+ if (_vm->_awayMission.love.romulansUnconsciousFromVirus) {
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_013);
+ // BUGFIX: original didn't have correct speaker. Also, you shouldn't lose your
+ // water since it's not actually used here, so a "loseItem" line was removed.
+ }
+ else {
+ showText(TX_LOV5N017);
+ if (!_vm->_awayMission.redshirtDead) {
+ showText(TX_SPEAKER_FERRIS, TX_LOV5_053);
+ showText(TX_SPEAKER_KIRK, TX_LOV5_005);
+ }
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_026);
+ loseItem(OBJECT_IH2O);
+
+ // BUGFIX: give a point for hydrating the Preax. It's inconsistent to only
+ // give points if he's already cured.
+ if (!_vm->_awayMission.love.gotPointsForHydratingPreax) {
+ _vm->_awayMission.love.gotPointsForHydratingPreax = true;
+ _vm->_awayMission.love.missionScore++;
+ }
+ }
+ }
+}
+
+void Room::love5UseCureSampleOnPreax() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_020); // BUGFIX: original didn't have correct speaker
+}
+
+
+void Room::love5UseCureOnPreax() {
+ if (!_vm->_awayMission.love.preaxCured)
+ walkCrewmanC(OBJECT_MCCOY, 0x116, 0xbf, &Room::love5ReachedPreaxUsingCure);
+}
+
+void Room::love5ReachedPreaxUsingCure() {
+ loadActorAnimC(OBJECT_MCCOY, "musemn", -1, -1, &Room::love5CuredPreax);
+}
+
+void Room::love5CuredPreax() {
+ walkCrewman(OBJECT_MCCOY, 0xdc, 0xc3);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
+
+ showText(TX_LOV5N007);
+
+ // BUG: says he's dehydrated, but doesn't check whether you've given water to him
+ // already (like it does in LOVE4).
+ // TODO: make the whole "giving water to romulans" thing consistent between LOVE4 and
+ // LOVE5?
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_017);
+
+ loadActorAnim2(OBJECT_PREAX, "s3r6r1", 0x116, 0xba);
+ _vm->_awayMission.love.preaxCured = true;
+}
+
+
+void Room::love5UseAnythingOnPreax() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_023);
+}
+
+
+// Kirk walks to Cheever, unties him, then walks to Marcus, unties her.
+void Room::love5UseKirkOnMarcusOrCheever() {
+ if (!_vm->_awayMission.love.freedMarcusAndCheever) {
+ _vm->_awayMission.disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x49, 0xb1, &Room::love5KirkReachedCheever);
+ _vm->_awayMission.love.freedMarcusAndCheever = true;
+ }
+}
+
+void Room::love5KirkReachedCheever() {
+ loadActorAnimC(OBJECT_KIRK, "kuntie", -1, -1, &Room::love5KirkUntiedCheever);
+}
+
+void Room::love5KirkUntiedCheever() {
+ loadActorAnim2(OBJECT_CHEEVER, "s3gtup", 0x49, 0xac);
+ walkCrewmanC(OBJECT_KIRK, 0x26, 0xb1, &Room::love5KirkReachedMarcus);
+}
+
+void Room::love5KirkReachedMarcus() {
+ loadActorAnimC(OBJECT_KIRK, "kuntie", -1, -1, &Room::love5KirkUntiedMarcus);
+}
+
+void Room::love5KirkUntiedMarcus() {
+ loadActorStandAnim(OBJECT_KIRK);
+ loadActorAnimC(OBJECT_MARCUS, "marcus", 0x28, 0xa6, &Room::love5MarcusStoodUp);
+ walkCrewman(OBJECT_KIRK, 0x35, 0xb9);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love5MarcusStoodUp() {
+ _vm->_awayMission.disableInput = false;
+ showText(TX_SPEAKER_MARCUS, TX_LOV5_041);
}
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index e239806..8d1bcf4 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -84,7 +84,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxHasMultipleChoices = false;
_missionToLoad = "LOVE";
- _roomIndexToLoad = 4;
+ _roomIndexToLoad = 0;
for (int i = 0; i < NUM_OBJECTS; i++)
_itemList[i] = g_itemList[i];
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index a72c253..cb407ce 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -90,6 +90,11 @@ enum GameStringIDs {
TX_SPEAKER_FERRIS,
TX_SPEAKER_COMPUTER,
+ TX_SPEAKER_MARCUS,
+ TX_SPEAKER_CHEEVER,
+ TX_SPEAKER_PREAX,
+
+ TX_G_024,
TX_DEM0_001,
TX_DEM0_002,
@@ -796,11 +801,6 @@ enum GameStringIDs {
TX_LOV0N007,
TX_LOV0N008,
TX_LOV0N009,
- TX_LOV5_015,
- TX_LOV5_019,
- TX_LOV5_027,
- TX_LOV5_030,
- TX_LOV5_038,
TX_LOVA_100,
TX_LOVA_F01,
TX_LOVA_F02,
@@ -1074,6 +1074,85 @@ enum GameStringIDs {
TX_LOV4N013,
+ TX_LOV5_001,
+ TX_LOV5_002,
+ TX_LOV5_003,
+ TX_LOV5_004,
+ TX_LOV5_005,
+ TX_LOV5_006,
+ TX_LOV5_007,
+ TX_LOV5_008,
+ TX_LOV5_009,
+ TX_LOV5_010,
+ TX_LOV5_011,
+ TX_LOV5_013,
+ TX_LOV5_014,
+ TX_LOV5_015,
+ TX_LOV5_016,
+ TX_LOV5_017,
+ TX_LOV5_018,
+ TX_LOV5_019,
+ TX_LOV5_020,
+ TX_LOV5_021,
+ TX_LOV5_023,
+ TX_LOV5_024,
+ TX_LOV5_025,
+ TX_LOV5_026,
+ TX_LOV5_027,
+ TX_LOV5_028,
+ TX_LOV5_029,
+ TX_LOV5_030,
+ TX_LOV5_031,
+ TX_LOV5_032,
+ TX_LOV5_033,
+ TX_LOV5_034,
+ TX_LOV5_036,
+ TX_LOV5_038,
+ TX_LOV5_039,
+ TX_LOV5_040,
+ TX_LOV5_041,
+ TX_LOV5_042,
+ TX_LOV5_043,
+ TX_LOV5_044,
+ TX_LOV5_045,
+ TX_LOV5_046,
+ TX_LOV5_047,
+ TX_LOV5_048,
+ TX_LOV5_049,
+ TX_LOV5_050,
+ TX_LOV5_051,
+ TX_LOV5_052,
+ TX_LOV5_053,
+ TX_LOV5_054,
+ TX_LOV5_055,
+ TX_LOV5_056,
+ TX_LOV5_057,
+ TX_LOV5_058,
+ TX_LOV5_059,
+ TX_LOV5_060,
+ TX_LOV5_061,
+ TX_LOV5N000,
+ TX_LOV5N001,
+ TX_LOV5N002,
+ TX_LOV5N003,
+ TX_LOV5N004,
+ TX_LOV5N005,
+ TX_LOV5N006,
+ TX_LOV5N007,
+ TX_LOV5N008,
+ TX_LOV5N009,
+ TX_LOV5N010,
+ TX_LOV5N011,
+ TX_LOV5N012,
+ TX_LOV5N013,
+ TX_LOV5N014,
+ TX_LOV5N015,
+ TX_LOV5N016,
+ TX_LOV5N017,
+ TX_LOV5N018,
+ TX_LOV5C001, // Custom
+
+
TX_END
};
@@ -1111,6 +1190,11 @@ const char * const g_gameStrings[] = {
"Lt. Ferris",
"Computer",
+ "Dr. Marcus",
+ "Dr. Cheever",
+ "Preax",
+
+ "#GENE\\G_024#Fascinating.",
"#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?",
"#DEM0\\DEM0_002#Aside from seeing demons, has any hard data been collected? Any evidence I could see?",
@@ -1817,11 +1901,6 @@ const char * const g_gameStrings[] = {
"#LOV0\\LOV0N007#This is a heavily secured door, leading to another section of the station. Its access code has been breached.",
"#LOV0\\LOV0N008#This is a standard door, leading to another room on this deck.",
"#LOV0\\LOV0N009#You are on the bridge of the ARK7.",
- "#LOV5\\LOV5_015#He's already cured, Jim.",
- "#LOV5\\LOV5_019#I don't have the proper medicine to cure him, Jim.",
- "#LOV5\\LOV5_027#Finally, a human response!",
- "#LOV5\\LOV5_030#There. You're now cured.",
- "#LOV5\\LOV5_038#Thank you, Doctor.",
"#LOVA\\LOVA_100#He's dead, Jim.",
"#LOVA\\LOVA_F01#He's been cured of the Oroborus virus.",
"#LOVA\\LOVA_F02#I'm picking up some kind of virus. I can't identify it without more information.",
@@ -2093,6 +2172,85 @@ const char * const g_gameStrings[] = {
"#LOV4\\LOV4N011#This Romulan is groggy, but conscious.",
"#LOV4\\LOV4N012#McCoy thinks to himself: 'Dammit, I'm a doctor, not a diplomat!'",
"#LOV4\\LOV4N013#The Romulans drink thirstily and empty the container.",
+
+
+ "#LOV5\\LOV5_001#Well gentlemen, let's go home.",
+ "#LOV5\\LOV5_002#Goodbye Carol.",
+ "#LOV5\\LOV5_003#Hello, Carol. It's good to see you again.",
+ "#LOV5\\LOV5_004#I assure you, the Federation would never undertake such a foul program. It was all an accident, right, Dr. Marcus?",
+ "#LOV5\\LOV5_005#Lt. Ferris, collect his weapon.",
+ "#LOV5\\LOV5_006#Save it for someone who's buying, Preax. Leave Federation space immediately or we'll scatter your atoms across the quadrant.",
+ "#LOV5\\LOV5_007#We aren't barbarians, in spite of what some might think.",
+ "#LOV5\\LOV5_008#You also conducted yourself in the most honorable fashion, Centurion Preax. You may return to Romulan space without Federation interference.",
+ "#LOV5\\LOV5_009#You always could put me in my place, couldn't you?",
+ "#LOV5\\LOV5_010#You are also a worthy opponent, Preax. May you live long and prosper.",
+ "#LOV5\\LOV5_011#Are you crazy, Jim? That's not going to help in the least!",
+ "#LOV5\\LOV5_013#Careful there! He's suffering from dehydration but it's dangerous to give water to someone while they're unconscious. This man needs serum or he's going to die!",
+ "#LOV5\\LOV5_014#Dammit, Jim, I'm a doctor, not a diplomat. These people will be fine. I've got to try and save the Romulans.",
+ "#LOV5\\LOV5_015#He's already cured, Jim.",
+ "#LOV5\\LOV5_016#He's infected with the virus too, Jim.",
+ "#LOV5\\LOV5_017#He's severely dehydrated, but he'll live.",
+ "#LOV5\\LOV5_018#He's too weak to talk, Jim. He needs medical attention.",
+ "#LOV5\\LOV5_019#I don't have the proper medicine to cure him, Jim.",
+ "#LOV5\\LOV5_020#Jim, we need to synthesize more before we can use it.",
+ "#LOV5\\LOV5_021#Oops! Almost forgot about you Spock.",
+ "#LOV5\\LOV5_023#That's not working, Jim.",
+ "#LOV5\\LOV5_024#The hostages are scared, but fine. The laughing gas did the trick, Jim, but the Romulan is still very, very sick -- he's only got hours left.",
+ "#LOV5\\LOV5_025#They've been through a good deal of stress, but they are already starting to recover. Their heart rate is dropping, and their blood pressure is also dropping.",
+ "#LOV5\\LOV5_026#Dammit, Jim, these men are sick! They need my help!",
+ "#LOV5\\LOV5_027#Finally, a human response!",
+ "#LOV5\\LOV5_028#My God, that's some kind of weapon!",
+ "#LOV5\\LOV5_029#Take it easy now... You'll feel better in a few minutes. Good thing we had the water available, Jim.",
+ "#LOV5\\LOV5_030#There. You're now cured.",
+ "#LOV5\\LOV5_031#What does this stuff do? What's going on here?",
+ "#LOV5\\LOV5_032#You'll never cease to amaze me, Jim.",
+ "#LOV5\\LOV5_033#I detect no other lifeforms in the room, Captain.",
+ "#LOV5\\LOV5_034#Fascinating. This device contains over ten million forms of life. Patterns I have never seen before.",
+ "#LOV5\\LOV5_036#Fascinating equipment. I believe I have seen this sort of equipment someplace before.",
+ "#LOV5\\LOV5_038#Thank you, Doctor.",
+ "#LOV5\\LOV5_039#Anthony and I will look after these Romulans, Jim. Dr. McCoy, we could use your expertise on discovering a cure for the virus. All our equipment is at your disposal.",
+ "#LOV5\\LOV5_040#Jim, it's you! Please untie us!",
+ "#LOV5\\LOV5_041#Thank God it's you, Jim. I'm so glad you came.",
+ "#LOV5\\LOV5_042#Thank you for saving our station, Jim.",
+ "#LOV5\\LOV5_043#Absolutely. We've already destroyed all cultures and purged the data files. This will never happen again.",
+ "#LOV5\\LOV5_044#Everyone on this project is an avowed pacifist, doctor. Myself included. We do not make weapons.",
+ "#LOV5\\LOV5_045#Goodbye Jim.",
+ "#LOV5\\LOV5_046#How about someone giving us a hand?",
+ "#LOV5\\LOV5_047#That's the one thing I could never do. Your place was wandering the galaxy, and that's the one thing I could never give you.",
+ "#LOV5\\LOV5_048#There was a time when I wouldn't have agreed with that statement. But I guess some things do get better with age.",
+ "#LOV5\\LOV5_049#We call this the Cradle, Mr. Spock. One day, I hope, something wonderful will be produced here.",
+ "#LOV5\\LOV5_050#We're conducting research into the origins of life in the universe. This is our equipment. We believe that... uh, well, I guess you don't have the time. You can get the background in my doctoral thesis.",
+ "#LOV5\\LOV5_051#We're testing the effect of radiation on combinations of simple and complex molecules. We're trying to see what new forms of life are developed, and how they compare to our own early development.",
+ "#LOV5\\LOV5_052#These Romulans appear to be a negligible threat, sir.",
+ "#LOV5\\LOV5_053#Freeze, Romulan! You're covered!",
+ "#LOV5\\LOV5_054#I do. You just pull on the ropes until they're untied.",
+ "#LOV5\\LOV5_055#Hey! Would you please untie us?",
+ "#LOV5\\LOV5_056#It's about time someone got here.",
+ "#LOV5\\LOV5_057#Hey? Does anyone in Starfleet know how to untie a knot?",
+ "#LOV5\\LOV5_058#I don't care who does it, but could somebody get around to doing it on this Stardate?",
+ "#LOV5\\LOV5_059#I have called off the Romulan attack on this station, Kirk. I believed your virus was some kind of deliberate attack, but your great honor and compassion have convinced me otherwise.",
+ "#LOV5\\LOV5_060#Phah! And I thought you a man of honor... You need not worry, Captain Kirk. Your lack of warrior spirit stinks even across the vacuum of space, and I am eager to be free of it.",
+ "#LOV5\\LOV5_061#You are an honorable adversary, Kirk. Jolan-tru.",
+ "#LOV5\\LOV5N000#Dr. Anthony Cheever, the assistant of Dr. Marcus.",
+ "#LOV5\\LOV5N001#Dr. Carol Marcus, head of this station's research team.",
+ "#LOV5\\LOV5N002#Dr. McCoy is viewing this scene with interest.",
+ "#LOV5\\LOV5N003#Ensign Ferris is wondering when they're going to give him a tough assignment for a change.",
+ "#LOV5\\LOV5N004#James T. Kirk, glad to see Carol Marcus again, yet slightly uncomfortable.",
+ "#LOV5\\LOV5N005#Mr. Spock is fascinated by these machines.",
+ "#LOV5\\LOV5N006#The Preax remains silent, but glances between you and your tied up companions.",
+ "#LOV5\\LOV5N007#The Romulan Preax stirs weakly, then begins to get up... he has been cured!",
+ "#LOV5\\LOV5N008#This is a very advanced research laboratory.",
+ "#LOV5\\LOV5N009#This is Dr. Carol Marcus' quarters. The hostages and four Romulans are here.",
+ "#LOV5\\LOV5N010#This ladder leads back to the main level of the station.",
+ "#LOV5\\LOV5N011#This Romulan commander is cautiously looking at you.",
+ "#LOV5\\LOV5N012#This Romulan commander is unconscious.",
+ "#LOV5\\LOV5N013#An odd looking device, almost like a 20th Century torpedo, fitted with an experimental gear.",
+ "#LOV5\\LOV5N014#Dr. Anthony Cheever, Marcus's assistant. He has been bound by the Romulans.",
+ "#LOV5\\LOV5N015#Dr. Carol Marcus, head of this station's research team. She has been bound by the Romulans.",
+ "#LOV5\\LOV5N016#Some odd looking equipment, connected to the torpedo.",
+ "#LOV5\\LOV5N017#The Romulan Preax weakly regains conscienceness, reaching for his weapon.",
+ "#LOV5\\LOV5N018#The Romulan Preax drinks thirstily and empties the container.",
+ "(Raises an eyebrow).", // NOTE: no corresponding audio
};
}
Commit: d8e255e9e7fcd1b91f85ea0a14596d679542fae6
https://github.com/scummvm/scummvm/commit/d8e255e9e7fcd1b91f85ea0a14596d679542fae6
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement synthesizer + bugfixes (LOVE)
Changed paths:
engines/startrek/action.h
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/love1.cpp
engines/startrek/rooms/love2.cpp
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
index 4270eb9..6774000 100644
--- a/engines/startrek/action.h
+++ b/engines/startrek/action.h
@@ -54,6 +54,8 @@ struct Action : Common::Serializable {
byte b2;
byte b3;
+ // Only used with ACTION_CALLBACK.
+ // TODO: Fix serialization. Can this even be serialized?
void (Room::*roomFuncPtr)();
Action() {}
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index fdf46ee..8eaabbe 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -200,4 +200,13 @@ enum CanisterTypes {
CANTYPE_N2 = 3
};
+// Synthesizer contents for Love's Labor Jeopardized (values for field35)
+enum SynthesizerContent {
+ SYNTHITEM_NONE = 0,
+ SYNTHITEM_PBC = 1,
+ SYNTHITEM_VIRUS_SAMPLE = 2,
+ SYNTHITEM_CURE_SAMPLE = 3,
+ SYNTHITEM_BOTTLE = 9 // Contents of bottle determined by "synthesizerProduct" variable
+};
+
#endif
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 3775974..f6bfe42 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -903,19 +903,22 @@ public:
void love2UseSynthesizer();
void love2SynthesizerDoorClosed();
void love2SynthesizerFinished();
- void love2FinishedAnimation27();
+ void love2ClosedSynthesizerDoorMakingRLG();
+ void love2ClosedSynthesizerDoorMakingCure();
+ void love2CureStartedSynthesizing();
+ void love2CureSynthesized();
void love2UsePolyberylcarbonateOnSynthesizerDoor();
void love2KirkReachedSynthesizerWithPolyberylcarbonate();
void love2SynthesizerDoorOpenedWithPolyberylcarbonate();
void love2PutPolyberylcarbonateInSynthesizer();
- void love2UseDishesOnSynthesizerDoor();
- void love2KirkReachedSynthesizerWithDishes();
- void love2SynthesizerDoorOpenedWithDishes();
- void love2PutDishesInSynthesizer();
- void love2UseSampleOnSynthesizerDoor();
- void love2KirkReachedSynthesizerWithSample();
- void love2SynthesizerDoorOpenedWithSample();
- void love2PutSampleInSynthesizer();
+ void love2UseVirusSampleOnSynthesizerDoor();
+ void love2KirkReachedSynthesizerWithVirusSample();
+ void love2SynthesizerDoorOpenedWithVirusSample();
+ void love2PutVirusSampleInSynthesizer();
+ void love2UseCureSampleOnSynthesizerDoor();
+ void love2KirkReachedSynthesizerWithCureSample();
+ void love2SynthesizerDoorOpenedWithCureSample();
+ void love2PutCureSampleInSynthesizer();
void love2UseAnythingOnSynthesizerDoor();
void love2UseAnythingOnSynthesizer();
void love2GetCanister();
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 54b1028..a28b5b3 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1009,24 +1009,24 @@ RoomAction love2ActionList[] = {
{ Action(ACTION_FINISHED_ANIMATION, 18, 0, 0), &Room::love2SpockEnabledGasFeeds },
{ Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love2SynthesizerDoorClosed },
{ Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love2SynthesizerFinished },
- { Action(ACTION_FINISHED_ANIMATION, 27, 0, 0), &Room::love2FinishedAnimation27 },
-
- // TODO: more
-
+ { Action(ACTION_FINISHED_ANIMATION, 27, 0, 0), &Room::love2ClosedSynthesizerDoorMakingRLG },
+ { Action(ACTION_FINISHED_ANIMATION, 8, 0, 0), &Room::love2ClosedSynthesizerDoorMakingCure },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::love2CureStartedSynthesizing },
+ { Action(ACTION_FINISHED_ANIMATION, 10, 0, 0), &Room::love2CureSynthesized },
{ Action(ACTION_USE, OBJECT_IPBC, 9, 0), &Room::love2UsePolyberylcarbonateOnSynthesizerDoor },
{ Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::love2KirkReachedSynthesizerWithPolyberylcarbonate },
{ Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::love2SynthesizerDoorOpenedWithPolyberylcarbonate },
{ Action(ACTION_FINISHED_ANIMATION, 19, 0, 0), &Room::love2PutPolyberylcarbonateInSynthesizer },
- { Action(ACTION_USE, OBJECT_IDISHES, 9, 0), &Room::love2UseDishesOnSynthesizerDoor },
- { Action(ACTION_FINISHED_WALKING, 7, 0, 0), &Room::love2KirkReachedSynthesizerWithDishes },
- { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love2SynthesizerDoorOpenedWithDishes },
- { Action(ACTION_FINISHED_ANIMATION, 20, 0, 0), &Room::love2PutDishesInSynthesizer },
+ { Action(ACTION_USE, OBJECT_IDISHES, 9, 0), &Room::love2UseVirusSampleOnSynthesizerDoor },
+ { Action(ACTION_FINISHED_WALKING, 7, 0, 0), &Room::love2KirkReachedSynthesizerWithVirusSample },
+ { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love2SynthesizerDoorOpenedWithVirusSample },
+ { Action(ACTION_FINISHED_ANIMATION, 20, 0, 0), &Room::love2PutVirusSampleInSynthesizer },
- { Action(ACTION_USE, OBJECT_ISAMPLE, 9, 0), &Room::love2UseSampleOnSynthesizerDoor },
- { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::love2KirkReachedSynthesizerWithSample },
- { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::love2SynthesizerDoorOpenedWithSample },
- { Action(ACTION_FINISHED_ANIMATION, 21, 0, 0), &Room::love2PutSampleInSynthesizer },
+ { Action(ACTION_USE, OBJECT_ISAMPLE, 9, 0), &Room::love2UseCureSampleOnSynthesizerDoor },
+ { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::love2KirkReachedSynthesizerWithCureSample },
+ { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::love2SynthesizerDoorOpenedWithCureSample },
+ { Action(ACTION_FINISHED_ANIMATION, 21, 0, 0), &Room::love2PutCureSampleInSynthesizer },
{ Action(ACTION_USE, -1, 9, 0), &Room::love2UseAnythingOnSynthesizerDoor },
{ Action(ACTION_USE, -1, 0x20, 0), &Room::love2UseAnythingOnSynthesizer },
diff --git a/engines/startrek/rooms/love1.cpp b/engines/startrek/rooms/love1.cpp
index 9f4617b..6398b38 100644
--- a/engines/startrek/rooms/love1.cpp
+++ b/engines/startrek/rooms/love1.cpp
@@ -307,8 +307,11 @@ void Room::love1KirkGotCureSample() {
if (_vm->_awayMission.love.chamberHasCure) {
giveItem(OBJECT_ISAMPLE);
showText(TX_LOV1N035);
- }
- else {
+
+ // BUGFIX: after removing the cure, unset this variable.
+ // Otherwise, any normal dish inserted afterward automagically becomes a cure.
+ _vm->_awayMission.love.chamberHasCure = false;
+ } else {
giveItem(OBJECT_IDISHES);
showText(TX_LOV1N006);
}
@@ -420,12 +423,10 @@ void Room::love1MccoyReachedReplicator() {
if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
showText(TX_SPEAKER_MCCOY, TX_LOV1_021);
walkCrewman(OBJECT_MCCOY, 0xbf, 0x98, 0);
- }
- else if (!_vm->_awayMission.love.chamberHasDish) {
+ } else if (!_vm->_awayMission.love.chamberHasDish) {
showText(TX_SPEAKER_MCCOY, TX_LOV1_015);
walkCrewman(OBJECT_MCCOY, 0xbf, 0x98, 0);
- }
- else
+ } else
loadActorAnim2(OBJECT_MCCOY, "musehn", -1, -1, 13);
}
@@ -435,8 +436,7 @@ void Room::love1MccoyUsedReplicator() {
loadActorAnim2(OBJECT_CHAMBER, "s3r2d6", 0xb4, 0x75, 7);
playSoundEffectIndex(SND_DOOR1);
walkCrewman(OBJECT_MCCOY, 0xbf, 0x98, 0);
- }
- else {
+ } else {
showText(TX_SPEAKER_MCCOY, TX_LOV1_019);
walkCrewman(OBJECT_MCCOY, 0xbf, 0x98, 0);
}
@@ -641,8 +641,7 @@ void Room::love1CrewmanDiedFromPhaser() {
_vm->_awayMission.disableInput = false;
showText(TX_SPEAKER_FERRIS, TX_LOV1_024);
_vm->_awayMission.redshirtDead = true;
- }
- else {
+ } else {
showText(_roomVar.love1.dyingSpeaker, TX_LOV1_025);
showGameOverMenu();
}
diff --git a/engines/startrek/rooms/love2.cpp b/engines/startrek/rooms/love2.cpp
index 1744b10..7ccbfd2 100644
--- a/engines/startrek/rooms/love2.cpp
+++ b/engines/startrek/rooms/love2.cpp
@@ -33,7 +33,7 @@
#define OBJECT_ANTIGRAV 14
#define OBJECT_SYNTHESIZER_OUTPUT 15
#define OBJECT_POLYBERYLCARBONATE 16
-#define OBJECT_DISHES 17
+#define OBJECT_VIRUSSAMPLE 17
#define OBJECT_CURESAMPLE 18
#define OBJECT_CURE 19
@@ -104,39 +104,39 @@ void Room::love2Tick1() {
bool valid = true;
switch (_vm->_awayMission.love.field35) {
- case 1:
+ case SYNTHITEM_PBC:
strcpy(_roomVar.love2.d6, "pbcanm");
- _roomVar.love2.d2 = 0x10;
+ _roomVar.love2.d2 = OBJECT_POLYBERYLCARBONATE;
break;
- case 2:
+ case SYNTHITEM_VIRUS_SAMPLE:
strcpy(_roomVar.love2.d6, "dishes");
- _roomVar.love2.d2 = 0x11;
+ _roomVar.love2.d2 = OBJECT_VIRUSSAMPLE;
break;
- case 3:
+ case SYNTHITEM_CURE_SAMPLE:
strcpy(_roomVar.love2.d6, "dishes");
- _roomVar.love2.d2 = 0x12;
+ _roomVar.love2.d2 = OBJECT_CURESAMPLE;
break;
- case 9:
+ case SYNTHITEM_BOTTLE:
switch (_vm->_awayMission.love.synthesizerProduct) {
case 1:
strcpy(_roomVar.love2.d8, "btle1");
- _roomVar.love2.d2 = 0x0f;
+ _roomVar.love2.d2 = OBJECT_SYNTHESIZER_OUTPUT;
break;
case 2:
strcpy(_roomVar.love2.d8, "btle2");
- _roomVar.love2.d2 = 0x0f;
+ _roomVar.love2.d2 = OBJECT_SYNTHESIZER_OUTPUT;
break;
case 3:
strcpy(_roomVar.love2.d8, "btle3");
- _roomVar.love2.d2 = 0x0f;
+ _roomVar.love2.d2 = OBJECT_SYNTHESIZER_OUTPUT;
break;
case 4:
strcpy(_roomVar.love2.d8, "btle4");
- _roomVar.love2.d2 = 0x0f;
+ _roomVar.love2.d2 = OBJECT_SYNTHESIZER_OUTPUT;
break;
default:
strcpy(_roomVar.love2.d8, "cure");
- _roomVar.love2.d2 = 0x13;
+ _roomVar.love2.d2 = OBJECT_CURE;
break;
}
break;
@@ -360,8 +360,7 @@ void Room::love2ChangedGasFeed() {
_vm->_awayMission.love.gasFeedOn = false;
loadActorAnim2(OBJECT_GAS_FEED, "s3r3v2", 0xac, 0x75, 0);
showText(TX_LOV2N007);
- }
- else {
+ } else {
_vm->_awayMission.love.gasFeedOn = true;
loadActorAnim2(OBJECT_GAS_FEED, "s3r3v1", 0xac, 0x75, 0);
showText(TX_LOV2N008);
@@ -428,7 +427,7 @@ void Room::love2ReachedCanisterSlot1ToGet() {
else {
loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 15);
// BUGFIX: original game only played this for canister 2
- playVoc("SEPLBAT");
+ playVoc("SE3PLBAT");
}
}
@@ -448,6 +447,8 @@ void Room::love2TookCanister1() {
giveItem(OBJECT_IN2GAS);
break;
}
+
+ _vm->_awayMission.love.canister1 = CANTYPE_NONE;
}
void Room::love2UseAntigravOnCanister2() {
@@ -459,7 +460,7 @@ void Room::love2ReachedCanisterSlot2ToGet() {
showText(TX_SPEAKER_SPOCK, TX_LOV2_025);
else {
loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 16);
- playVoc("SEPLBAT");
+ playVoc("SE3PLBAT");
}
}
@@ -479,6 +480,8 @@ void Room::love2TookCanister2() {
giveItem(OBJECT_IN2GAS);
break;
}
+
+ _vm->_awayMission.love.canister2 = CANTYPE_NONE;
}
void Room::love2UseKirkOnSynthesizer() {
@@ -509,17 +512,14 @@ void Room::love2CrewmanReachedSynthesizer() {
void Room::love2CrewmanUsedSynthesizer() {
if (_vm->_awayMission.love.gasFeedOn) {
love2UseSynthesizer();
- }
- else {
+ } else {
if (_roomVar.love2.cb == 3) {
if (haveItem(OBJECT_IWRENCH)) {
showText(TX_SPEAKER_SPOCK, TX_LOV2_005);
walkCrewman(OBJECT_SPOCK, 0xa8, 0xb7, 16);
- }
- else
+ } else
showText(TX_SPEAKER_SPOCK, TX_LOV2_006);
- }
- else {
+ } else {
_roomVar.love2.cb++;
showText(TX_LOV2N012);
}
@@ -541,30 +541,130 @@ void Room::love2SpockEnabledGasFeeds() {
love2UseSynthesizer();
}
+// Synthesizer takes the input and produces some output
void Room::love2UseSynthesizer() {
if (_vm->_awayMission.love.canister1 != 0) {
if (_vm->_awayMission.love.canister2 != 0) {
- // TODO
- loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 3);
- playSoundEffectIndex(SND_DOOR1);
- }
- else {
+ int c1 = _vm->_awayMission.love.canister1;
+ int c2 = _vm->_awayMission.love.canister2;
+ if (c1 > c2) {
+ int tmp = c1;
+ c1 = c2;
+ c2 = tmp;
+ }
+
+ if (c1 == CANTYPE_O2 && c2 == CANTYPE_H2) {
+ switch (_vm->_awayMission.love.field35) {
+ case SYNTHITEM_PBC: // Romulan Laughing Gas
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", -1, -1, 27); // -> love2ClosedSynthesizerDoorMakingRLG
+ playSoundEffectIndex(SND_DOOR1);
+ loadActorStandAnim(OBJECT_POLYBERYLCARBONATE);
+ break;
+
+ case SYNTHITEM_VIRUS_SAMPLE: // Wet goo
+ showText(TX_LOV2N051);
+ showText(TX_SPEAKER_KIRK, TX_LOV2_002);
+ loadActorStandAnim(OBJECT_VIRUSSAMPLE);
+ goto closeSynthesizerDoor;
+
+ case SYNTHITEM_CURE_SAMPLE: // Wet goo
+wetGooFailure:
+ showText(TX_LOV2N050);
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_021);
+ loadActorStandAnim(OBJECT_CURESAMPLE);
+ goto closeSynthesizerDoor;
+
+ case SYNTHITEM_BOTTLE: // Nothing happens
+bottleFailure:
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_028);
+ break;
+
+ case SYNTHITEM_NONE: // Water
+ default:
+ _vm->_awayMission.love.synthesizerProduct = BOTTLETYPE_H2O;
+ strcpy(_roomVar.love2.d8, "btle3");
+produceBottle:
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 3); // -> love2SynthesizerDoorClosed
+ playSoundEffectIndex(SND_DOOR1);
+ break;
+
+closeSynthesizerDoor:
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
+ playSoundEffectIndex(SND_DOOR1);
+ _vm->_awayMission.love.field35 = 0;
+ break;
+ }
+ } else if (c1 == CANTYPE_H2 && c2 == CANTYPE_N2) {
+ switch (_vm->_awayMission.love.field35) {
+ case SYNTHITEM_PBC: // Inert matter
+inertMatterFailure:
+ showText(TX_LOV2N049);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_039); // BUGFIX: original didn't play audio
+ loadActorStandAnim(OBJECT_POLYBERYLCARBONATE);
+ goto closeSynthesizerDoor;
+
+ case SYNTHITEM_VIRUS_SAMPLE: // Colorless goo (with useful information about virus in ammonia)
+ showText(TX_LOV2N048);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_034); // BUGFIX: original didn't play audio
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_023);
+ loadActorStandAnim(OBJECT_VIRUSSAMPLE);
+ goto closeSynthesizerDoor;
+
+ case SYNTHITEM_CURE_SAMPLE: // Cure
+ loadActorStandAnim(OBJECT_CURESAMPLE);
+ loadActorAnim2(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 8); // -> love2ClosedSynthesizerDoorMakingCure
+ playSoundEffectIndex(SND_DOOR1);
+ break;
+
+ case SYNTHITEM_BOTTLE: // Nothing happens
+ goto bottleFailure;
+
+ case SYNTHITEM_NONE: // Ammonia
+ default:
+ _vm->_awayMission.love.synthesizerProduct = BOTTLETYPE_NH3;
+ strcpy(_roomVar.love2.d8, "btle2");
+ goto produceBottle;
+ }
+ } else if (c1 == CANTYPE_O2 && c2 == CANTYPE_N2) {
+ switch (_vm->_awayMission.love.field35) {
+ case SYNTHITEM_PBC: // Inert matter
+ goto inertMatterFailure;
+
+ case SYNTHITEM_VIRUS_SAMPLE: // Wet goo
+ showText(TX_LOV2N047);
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_017);
+ loadActorStandAnim(OBJECT_VIRUSSAMPLE);
+ goto closeSynthesizerDoor;
+
+ case SYNTHITEM_CURE_SAMPLE: // Wet goo
+ goto wetGooFailure;
+
+ case SYNTHITEM_BOTTLE: // Nothing happens
+ goto bottleFailure;
+
+ case SYNTHITEM_NONE: // Laughing gas
+ default:
+ _vm->_awayMission.love.synthesizerProduct = BOTTLETYPE_N2O;
+ strcpy(_roomVar.love2.d8, "btle1");
+ goto produceBottle;
+ }
+ }
+ } else {
playVoc("EFX24");
showText(TX_LOV2N005);
showText(TX_SPEAKER_MCCOY, TX_LOV2_010);
}
- }
- else {
+ } else {
playVoc("EFX24");
- showText(TX_SPEAKER_SPOCK, TX_LOV2N005);
+ showText(TX_LOV2N005);
showText(TX_SPEAKER_SPOCK, TX_LOV2_024);
}
}
void Room::love2SynthesizerDoorClosed() {
playVoc("LD1SCAN");
- loadActorAnim(OBJECT_SYNTHESIZER_OUTPUT, _roomVar.love2.d8, 0x8a, 0x8d, 4);
- _vm->_awayMission.love.field35 = 9;
+ loadActorAnim(OBJECT_SYNTHESIZER_OUTPUT, _roomVar.love2.d8, 0x8a, 0x8d, 4); // -> love2SynthesizerFinished
+ _vm->_awayMission.love.field35 = SYNTHITEM_BOTTLE;
}
// Final product of synthesizer is produced
@@ -602,14 +702,27 @@ void Room::love2SynthesizerFinished() {
}
}
-void Room::love2FinishedAnimation27() {
- // TODO: better name
+void Room::love2ClosedSynthesizerDoorMakingRLG() {
_vm->_awayMission.love.synthesizerProduct = BOTTLETYPE_RLG;
strcpy(_roomVar.love2.d8, "btle4");
- loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 3);
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 3); // -> love2SynthesizerDoorClosed
playSoundEffectIndex(SND_DOOR1);
}
+// Synthesizer door closed, using N2 + O2 on cure sample
+void Room::love2ClosedSynthesizerDoorMakingCure() {
+ loadActorAnim2(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 9); // -> love2CureStartedSynthesizing
+}
+
+void Room::love2CureStartedSynthesizing() {
+ loadActorAnim(OBJECT_CURE, "cure", 0x8a, 0x8b, 10); // -> love2CureSynthesized
+}
+
+void Room::love2CureSynthesized() {
+ showText(TX_LOV2N046);
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_020);
+}
+
// Put polycarbonate in synthesizer
void Room::love2UsePolyberylcarbonateOnSynthesizerDoor() {
@@ -633,17 +746,17 @@ void Room::love2SynthesizerDoorOpenedWithPolyberylcarbonate() {
void Room::love2PutPolyberylcarbonateInSynthesizer() {
loadActorAnim(OBJECT_POLYBERYLCARBONATE, "pbcanm", 0x8a, 0x8b, 0);
loseItem(OBJECT_IPBC);
- _vm->_awayMission.love.field35 = 1;
+ _vm->_awayMission.love.field35 = SYNTHITEM_PBC;
}
// Put dish (virus sample) in synthesizer
-void Room::love2UseDishesOnSynthesizerDoor() {
+void Room::love2UseVirusSampleOnSynthesizerDoor() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 7);
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
-void Room::love2KirkReachedSynthesizerWithDishes() {
+void Room::love2KirkReachedSynthesizerWithVirusSample() {
if (_vm->_awayMission.love.field35 != 0)
showText(TX_LOV2N025);
else {
@@ -652,24 +765,24 @@ void Room::love2KirkReachedSynthesizerWithDishes() {
}
}
-void Room::love2SynthesizerDoorOpenedWithDishes() {
+void Room::love2SynthesizerDoorOpenedWithVirusSample() {
loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 20);
}
-void Room::love2PutDishesInSynthesizer() {
- loadActorAnim(OBJECT_DISHES, "dishes", 0x8a, 0x8b, 0);
+void Room::love2PutVirusSampleInSynthesizer() {
+ loadActorAnim(OBJECT_VIRUSSAMPLE, "dishes", 0x8a, 0x8b, 0);
loseItem(OBJECT_IDISHES);
- _vm->_awayMission.love.field35 = 2;
+ _vm->_awayMission.love.field35 = SYNTHITEM_VIRUS_SAMPLE;
}
// Put cure sample in synthesizer
-void Room::love2UseSampleOnSynthesizerDoor() {
+void Room::love2UseCureSampleOnSynthesizerDoor() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 8);
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
-void Room::love2KirkReachedSynthesizerWithSample() {
+void Room::love2KirkReachedSynthesizerWithCureSample() {
if (_vm->_awayMission.love.field35 != 0)
showText(TX_LOV2N025); // BUGFIX: original didn't play audio
else {
@@ -678,14 +791,14 @@ void Room::love2KirkReachedSynthesizerWithSample() {
}
}
-void Room::love2SynthesizerDoorOpenedWithSample() {
+void Room::love2SynthesizerDoorOpenedWithCureSample() {
loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 21);
}
-void Room::love2PutSampleInSynthesizer() {
+void Room::love2PutCureSampleInSynthesizer() {
loadActorAnim(OBJECT_CURESAMPLE, "dishes", 0x8a, 0x8b, 0);
loseItem(OBJECT_ISAMPLE);
- _vm->_awayMission.love.field35 = 3;
+ _vm->_awayMission.love.field35 = SYNTHITEM_CURE_SAMPLE;
}
@@ -753,8 +866,8 @@ void Room::love2ReachedDishes() {
}
void Room::love2GotDishes() {
- loadActorStandAnim(OBJECT_DISHES);
- showText(TX_LOV2N036);
+ loadActorStandAnim(OBJECT_VIRUSSAMPLE);
+ showText(TX_LOV2N036); // FIXME: text doesn't match audio
giveItem(OBJECT_IDISHES);
_vm->_awayMission.love.field35 = 0;
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 8d1bcf4..0296e35 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -84,7 +84,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxHasMultipleChoices = false;
_missionToLoad = "LOVE";
- _roomIndexToLoad = 0;
+ _roomIndexToLoad = 2;
for (int i = 0; i < NUM_OBJECTS; i++)
_itemList[i] = g_itemList[i];
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index cb407ce..7ae6b0b 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -23,6 +23,10 @@
#ifndef STARTREK_TEXT_H
#define STARTREK_TEXT_H
+
+// In this file, the TYPO tag is used when a typo is fixed in a piece of text, or when
+// text is changed to match the audio.
+
namespace StarTrek {
// Text that's loaded from "GROUND.TXT". First 0x40 pieces of text are for items.
@@ -2044,8 +2048,8 @@ const char * const g_gameStrings[] = {
"#LOV2\\LOV2N033#You have synthesized one liter of Romulan Laughing Gas.",
"#LOV2\\LOV2N034#You install the gas tank to the synthesizer's feed lines.",
"#LOV2\\LOV2N035#You install the gas tank to the synthesizer's feed lines.",
- "#LOV2\\LOV2N036#Oroborus virus culture taken.",
- "#LOV2\\LOV2N037#Oroborus virus cure sample taken.",
+ "#LOV2\\LOV2N036#You retrieve the Oroborus virus culture.", // TYPO
+ "#LOV2\\LOV2N037#You retrieve the Oroborus virus cure sample.", // TYPO
"#LOV2\\LOV2N038#You take a one litre container of TLTDH gas.",
"#LOV2\\LOV2N039#You take a one litre container of Ammonia.",
"#LOV2\\LOV2N040#You take a one litre container of Nitrous Oxide.",
Commit: a5c7d6ae11c255647e2026ae447e76f0ae52c67f
https://github.com/scummvm/scummvm/commit/a5c7d6ae11c255647e2026ae447e76f0ae52c67f
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Revamp of action callbacks.
Old system of putting a callback in an action wouldn't work since it
wasn't serializable. Now it seaches for an index corresponding to the
function pointer before constructing an action.
Changed paths:
engines/startrek/action.h
engines/startrek/awaymission.cpp
engines/startrek/object.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/startrek.cpp
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
index 6774000..55a08da 100644
--- a/engines/startrek/action.h
+++ b/engines/startrek/action.h
@@ -43,9 +43,7 @@ enum Acton {
ACTION_TIMER_EXPIRED = 8,
ACTION_FINISHED_ANIMATION = 10,
ACTION_FINISHED_WALKING = 12,
- ACTION_OPTIONS = 13, // Not really an action, but selectable from action menu
-
- ACTION_CALLBACK = 255 // Custom action in ScummVM; calls a function in the Room class
+ ACTION_OPTIONS = 13 // Not really an action, but selectable from action menu
};
struct Action : Common::Serializable {
@@ -54,10 +52,6 @@ struct Action : Common::Serializable {
byte b2;
byte b3;
- // Only used with ACTION_CALLBACK.
- // TODO: Fix serialization. Can this even be serialized?
- void (Room::*roomFuncPtr)();
-
Action() {}
Action(int _type, int _b1, int _b2, int _b3)
: type((byte)_type),
@@ -65,10 +59,6 @@ struct Action : Common::Serializable {
b2((byte)_b2),
b3((byte)_b3) {}
- Action(int _type, void (Room::*funcPtr)())
- : type((byte)_type),
- roomFuncPtr(funcPtr) {}
-
// ACTION_USE, ACTION_GET, ACTION_LOOK, ACTION_TALK
byte activeObject() { return b1; }
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 4c2e8a1..944e0a2 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -571,12 +571,6 @@ void StarTrekEngine::handleAwayMissionAction() {
initAwayCrewPositions(warpIndex ^ 1);
}
break;
-
- case ACTION_CALLBACK:
- // Custom action for ScummVM; calls a function in the Room class. Useful for
- // simplifying chains of calls.
- (_room.get()->*(action.roomFuncPtr))();
- break;
}
}
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index 6736ca5..3a2dc33 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -93,11 +93,8 @@ struct Actor {
// "triggerActionWhenAnimFinished" is true, it will create an action of type
// "ACTION_FINISHED_WALKING" or "ACTION_FINISHED_ANIMATION", with the integer value
// "finishedAnimActionParam".
- // To make things simpler, it can also use a callback to a function in the Room class,
- // if "finishedAnimCallback" is non-null.
bool triggerActionWhenAnimFinished;
uint16 finishedAnimActionParam;
- void (Room::*finishedAnimCallback)();
char animationString2[8];
uint16 field70;
@@ -150,7 +147,6 @@ public:
field62(),
triggerActionWhenAnimFinished(),
finishedAnimActionParam(),
- finishedAnimCallback(),
//animationString2[8](),
field70(),
field72(),
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 62949be..ae5523f 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -172,6 +172,23 @@ Common::Point Room::getBeamInPosition(int crewmanIndex) {
}
+// For actions of type ACTION_FINISHED_ANIMATION or ACTION_FINISHED_WALKING, this takes
+// a function pointer and returns the index corresponding to that callback.
+// Creates a fatal error on failure.
+int Room::findFunctionPointer(int action, void (Room::*funcPtr)()) {
+ assert(action == ACTION_FINISHED_ANIMATION || action == ACTION_FINISHED_WALKING);
+
+ for (int i = 0; i < _numRoomActions; i++) {
+ if (_roomActionList[i].action.type == action && _roomActionList[i].funcPtr == funcPtr)
+ return _roomActionList[i].action.b1;
+ }
+
+ if (action == ACTION_FINISHED_ANIMATION)
+ error("Couldn't find FINISHED_ANIMATION function pointer");
+ else
+ error("Couldn't find FINISHED_WALKING function pointer");
+}
+
// Interface for room-specific code
void Room::loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y, uint16 finishedAnimActionParam) {
@@ -190,7 +207,6 @@ void Room::loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y,
if (finishedAnimActionParam != 0) {
actor->triggerActionWhenAnimFinished = true;
actor->finishedAnimActionParam = finishedAnimActionParam;
- actor->finishedAnimCallback = nullptr;
}
}
@@ -211,8 +227,7 @@ void Room::loadActorAnimC(int actorIndex, Common::String anim, int16 x, int16 y,
if (funcPtr != nullptr) {
actor->triggerActionWhenAnimFinished = true;
- actor->finishedAnimActionParam = 0;
- actor->finishedAnimCallback = funcPtr;
+ actor->finishedAnimActionParam = findFunctionPointer(ACTION_FINISHED_ANIMATION, funcPtr);
}
}
@@ -330,7 +345,6 @@ void Room::walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finished
if (success && finishedAnimActionParam != 0) {
actor->triggerActionWhenAnimFinished = true;
actor->finishedAnimActionParam = finishedAnimActionParam;
- actor->finishedAnimCallback = nullptr;
}
}
@@ -347,7 +361,7 @@ void Room::walkCrewmanC(int actorIndex, int16 destX, int16 destY, void (Room::*f
if (success && funcPtr != nullptr) {
actor->triggerActionWhenAnimFinished = true;
actor->finishedAnimActionParam = 0;
- actor->finishedAnimCallback = funcPtr;
+ actor->finishedAnimActionParam = findFunctionPointer(ACTION_FINISHED_WALKING, funcPtr);
}
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index f6bfe42..74a191f 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -96,6 +96,8 @@ private:
int _numRoomActions;
+ int findFunctionPointer(int action, void (Room::*funcPtr)());
+
// Interface for room-specific code
void loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66 = 0); // Cmd 0x00
void loadActorAnimC(int actorIndex, Common::String anim, int16 x, int16 y, void (Room::*funcPtr)());// Cmd 0x00
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index a28b5b3..7eafd5b 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1113,6 +1113,8 @@ RoomAction love3ActionList[] = {
{ Action(ACTION_USE, OBJECT_IWRENCH, 0x21, 0), &Room::love3UseWrenchOnMonitor },
{ Action(ACTION_USE, OBJECT_IH2O, 0x21, 0), &Room::love3UseWaterOnMonitor },
+ { Action(ACTION_FINISHED_WALKING, 14, 0, 0), &Room::love3ReachedMonitorToUseWater },
+ { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love3PouredWaterOnMonitor },
{ Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
{ Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
@@ -1124,28 +1126,59 @@ RoomAction love3ActionList[] = {
{ Action(ACTION_USE, OBJECT_REDSHIRT, 11, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
{ Action(ACTION_USE, OBJECT_IWRENCH, 11, 0), &Room::love3UseWrenchOnGrate },
+ { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::love3ReachedGateWithWrench },
+ { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::love3OpenedOrClosedGrate },
+
{ Action(ACTION_USE, OBJECT_KIRK, 0x22, 0), &Room::love3UseCrewmanOnShaft },
{ Action(ACTION_USE, OBJECT_SPOCK, 0x22, 0), &Room::love3UseCrewmanOnShaft },
{ Action(ACTION_USE, OBJECT_MCCOY, 0x22, 0), &Room::love3UseCrewmanOnShaft },
{ Action(ACTION_USE, OBJECT_REDSHIRT, 0x22, 0), &Room::love3UseCrewmanOnShaft },
+
{ Action(ACTION_USE, OBJECT_IH2O, 0x22, 0), &Room::love3UseWaterOnShaft },
+ { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::love3ReachedShaftUsingWater },
+ { Action(ACTION_FINISHED_ANIMATION, 8, 0, 0), &Room::love3PouredWaterDownShaft },
+
{ Action(ACTION_USE, OBJECT_IN2O, 0x22, 0), &Room::love3UseNitrousOxideOnShaft },
+ { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::love3ReachedShaftUsingNitrousOxide },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::love3PouredNitrousOxideDownShaft },
+
{ Action(ACTION_USE, OBJECT_INH3, 0x22, 0), &Room::love3UseAmmoniaOnShaft },
+ { Action(ACTION_FINISHED_WALKING, 7, 0, 0), &Room::love3ReachedShaftUsingAmmonia },
+ { Action(ACTION_FINISHED_ANIMATION, 10, 0, 0), &Room::love3PouredAmmoniaDownShaft },
+
{ Action(ACTION_USE, OBJECT_IRLG, 0x22, 0), &Room::love3UseRomulanLaughingGasOnShaft },
+ { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::love3ReachedShaftUsingRomulanLaughingGas },
+ { Action(ACTION_FINISHED_ANIMATION, 11, 0, 0), &Room::love3PouredRomulanLaughingGasDownShaft },
+
{ Action(ACTION_GET, 10, 0, 0), &Room::love3GetWrench },
+ { Action(ACTION_FINISHED_WALKING, 9, 0, 0), &Room::love3ReachedWrenchToGet },
+ { Action(ACTION_FINISHED_ANIMATION, 12, 0, 0), &Room::love3PickedUpWrench },
+
{ Action(ACTION_GET, 12, 0, 0), &Room::love3GetGasTank },
+ { Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::love3ReachedGasTankToGet },
+
{ Action(ACTION_USE, OBJECT_IANTIGRA, 12, 0), &Room::love3UseAntigravOnGasTank },
+ { Action(ACTION_FINISHED_WALKING, 11, 0, 0), &Room::love3ReachedGasTankUsingAntigrav },
+ { Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::love3PickedUpGasTank },
+
{ Action(ACTION_GET, 9, 0, 0), &Room::love3GetInsulation },
+ { Action(ACTION_FINISHED_WALKING, 12, 0, 0), &Room::love3ReachedInsulationToGet },
+ { Action(ACTION_FINISHED_ANIMATION, 14, 0, 0), &Room::love3PickedUpInsulation },
// TODO: common code
};
RoomAction love4ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::love4Tick1 },
{ Action(ACTION_TICK, 10, 0, 0), &Room::love4Tick10 },
+
{ Action(ACTION_WALK, 8, 0, 0), &Room::love4WalkToDoor },
{ Action(ACTION_WALK, 0x20, 0, 0), &Room::love4WalkToDoor },
{ Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::love4TouchedHotspot0 },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::love4DoorOpenedOrReached },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::love4DoorOpenedOrReached },
+
{ Action(ACTION_USE, OBJECT_KIRK, 0x21, 0), &Room::love4UseKirkOnLadder },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::love4ReachedLadder },
{ Action(ACTION_USE, OBJECT_IPHASERS, 9, 0), &Room::love4UseStunPhaserOnRomulan },
{ Action(ACTION_USE, OBJECT_IPHASERS, 10, 0), &Room::love4UseStunPhaserOnRomulan },
{ Action(ACTION_USE, OBJECT_IPHASERS, 11, 0), &Room::love4UseStunPhaserOnRomulan },
@@ -1176,10 +1209,20 @@ RoomAction love4ActionList[] = {
{ Action(ACTION_USE, OBJECT_IMTRICOR, 12, 0), &Room::love4UseMTricorderOnRomulan },
{ Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::love4UseMTricorderAnywhere },
{ Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::love4UseSTricorderAnywhere },
+
{ Action(ACTION_USE, OBJECT_ICURE, 9, 0), &Room::love4UseCureOnRomulan },
{ Action(ACTION_USE, OBJECT_ICURE, 10, 0), &Room::love4UseCureOnRomulan },
{ Action(ACTION_USE, OBJECT_ICURE, 11, 0), &Room::love4UseCureOnRomulan },
{ Action(ACTION_USE, OBJECT_ICURE, 12, 0), &Room::love4UseCureOnRomulan },
+ { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::love4MccoyReachedRomulan4 },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::love4MccoyCuredRomulan4 },
+ { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::love4MccoyReachedRomulan3 },
+ { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love4MccoyCuredRomulan3 },
+ { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::love4MccoyReachedRomulan2 },
+ { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love4MccoyCuredRomulan2 },
+ { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::love4MccoyReachedRomulan1 },
+ { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::love4MccoyCuredRomulan1 },
+
{ Action(ACTION_USE, OBJECT_IH2O, 9, 0), &Room::love4UseWaterOnRomulan },
{ Action(ACTION_USE, OBJECT_IH2O, 10, 0), &Room::love4UseWaterOnRomulan },
{ Action(ACTION_USE, OBJECT_IH2O, 11, 0), &Room::love4UseWaterOnRomulan },
@@ -1216,6 +1259,9 @@ RoomAction love5ActionList[] = {
{ Action(ACTION_LOOK, 11, 0, 0), &Room::love5LookAtDrCheever },
{ Action(ACTION_LOOK, 9, 0, 0), &Room::love5LookAtPreax },
{ Action(ACTION_TALK, 9, 0, 0), &Room::love5TalkToPreax },
+ { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::love5MccoyReachedSpockToCure },
+ { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love5MccoyCuredSpock },
+ { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::love5CrewmanReachedBeamoutPosition },
{ Action(ACTION_TALK, 10, 0, 0), &Room::love5TalkToDrMarcus },
{ Action(ACTION_TALK, 11, 0, 0), &Room::love5TalkToDrCheever },
{ Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::love5TalkToKirk },
@@ -1231,9 +1277,16 @@ RoomAction love5ActionList[] = {
{ Action(ACTION_USE, OBJECT_IH2O, 9, 0), &Room::love5UseWaterOnPreax },
{ Action(ACTION_USE, OBJECT_ISAMPLE, 9, 0), &Room::love5UseCureSampleOnPreax },
{ Action(ACTION_USE, OBJECT_ICURE, 9, 0), &Room::love5UseCureOnPreax },
+ { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::love5ReachedPreaxUsingCure },
+ { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::love5CuredPreax },
{ Action(ACTION_USE, -1, 9, 0), &Room::love5UseAnythingOnPreax },
{ Action(ACTION_USE, OBJECT_KIRK, 10, 0), &Room::love5UseKirkOnMarcusOrCheever },
{ Action(ACTION_USE, OBJECT_KIRK, 11, 0), &Room::love5UseKirkOnMarcusOrCheever },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::love5KirkReachedCheever },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::love5KirkUntiedCheever },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::love5KirkReachedMarcus },
+ { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love5KirkUntiedMarcus },
+ { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love5MarcusStoodUp },
// TODO: common code
};
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 0296e35..7fe0257 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -459,12 +459,7 @@ void StarTrekEngine::updateActorAnimations() {
if (nextAnimFrame == actor->numAnimFrames - 1) {
actor->field62++;
if (actor->triggerActionWhenAnimFinished) {
- if (actor->finishedAnimCallback != nullptr) {
- addAction(Action(ACTION_CALLBACK, actor->finishedAnimCallback));
- actor->finishedAnimCallback = nullptr;
- }
- else
- addAction(Action(ACTION_FINISHED_ANIMATION, actor->finishedAnimActionParam, 0, 0));
+ addAction(Action(ACTION_FINISHED_ANIMATION, actor->finishedAnimActionParam, 0, 0));
}
}
}
@@ -535,12 +530,7 @@ void StarTrekEngine::updateActorAnimations() {
if (actor->iwSrcPosition == -1) {
if (actor->triggerActionWhenAnimFinished) {
actor->triggerActionWhenAnimFinished = false;
- if (actor->finishedAnimCallback != nullptr) {
- addAction(Action(ACTION_CALLBACK, actor->finishedAnimCallback));
- actor->finishedAnimCallback = nullptr;
- }
- else
- addAction(Action(ACTION_FINISHED_WALKING, actor->finishedAnimActionParam & 0xff, 0, 0));
+ addAction(Action(ACTION_FINISHED_WALKING, actor->finishedAnimActionParam & 0xff, 0, 0));
}
actor->sprite.bitmap.reset();
Commit: aca19870562fe4dfcd98f3b062bf74dd0dee6daa
https://github.com/scummvm/scummvm/commit/aca19870562fe4dfcd98f3b062bf74dd0dee6daa
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement common code for LOVE mission
Changed paths:
A engines/startrek/rooms/lovea.cpp
engines/startrek/awaymission.h
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/love0.cpp
engines/startrek/rooms/love1.cpp
engines/startrek/rooms/love2.cpp
engines/startrek/rooms/love3.cpp
engines/startrek/rooms/love4.cpp
engines/startrek/rooms/love5.cpp
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 8eaabbe..2edcf18 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -143,8 +143,8 @@ struct AwayMission {
bool alreadyStartedMission; // 0x29
bool knowAboutVirus; // 0x2a
bool romulansUnconsciousFromLaughingGas; // 0x2b
- bool field2c; // 0x2c
- bool field2d; // 0x2d
+ bool releasedHumanLaughingGas; // 0x2c
+ bool releasedRomulanLaughingGas; // 0x2d
bool chamberHasCure; // 0x2e
bool freezerOpen; // 0x2f
bool chamberHasDish; // 0x30
@@ -167,7 +167,10 @@ struct AwayMission {
bool romulansUnconsciousFromVirus; // 0x41
bool freedMarcusAndCheever; // 0x42
bool preaxCured; // 0x43
+ byte spockInfectionCounter; // 0x45: When this reached 100, Spock dies.
bool spockCured; // 0x46
+ bool contactedEnterpriseBeforeCure; // 0x47
+ bool contactedEnterpriseAfterCure; // 0x48
bool spockAccessedConsole; // 0x49
bool mccoyAccessedConsole; // 0x4a
bool gotPolyberylcarbonate; // 0x4b
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 1696da7..6de706e 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -36,6 +36,7 @@ MODULE_OBJS = \
rooms/love3.o \
rooms/love4.o \
rooms/love5.o \
+ rooms/lovea.o \
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index ae5523f..f4d9dd8 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -279,7 +279,7 @@ int Room::showRoomSpecificText(const char **array) {
return _vm->showText(&StarTrekEngine::readTextFromArray, (uintptr)array, 20, 20, textColor, true, false, false);
}
-int Room::showText(const int *textIDs) {
+int Room::showText(const TextRef *textIDs) {
int numIDs = 0;
while (textIDs[numIDs] != TX_BLANK)
numIDs++;
@@ -293,7 +293,7 @@ int Room::showText(const int *textIDs) {
return retval;
}
-int Room::showText(int speaker, int text) {
+int Room::showText(TextRef speaker, TextRef text) {
int textIDs[3];
textIDs[0] = speaker;
textIDs[1] = text;
@@ -301,7 +301,7 @@ int Room::showText(int speaker, int text) {
return showText(textIDs);
}
-int Room::showText(int text) {
+int Room::showText(TextRef text) {
return showText(TX_NULL, text);
}
@@ -458,7 +458,7 @@ void Room::playVoc(Common::String filename) {
_vm->_sound->playVoc(filename);
}
-void Room::spockScan(int direction, int text, bool changeDirection) {
+void Room::spockScan(int direction, TextRef text, bool changeDirection) {
const char *dirs = "nsew";
Common::String anim = "sscan_";
anim.setChar(dirs[direction], 5);
@@ -471,7 +471,7 @@ void Room::spockScan(int direction, int text, bool changeDirection) {
showText(TX_SPEAKER_SPOCK, text);
}
-void Room::mccoyScan(int direction, int text, bool changeDirection) {
+void Room::mccoyScan(int direction, TextRef text, bool changeDirection) {
const char *dirs = "nsew";
Common::String anim = "mscan_";
anim.setChar(dirs[direction], 5);
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 74a191f..c203c34 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -104,9 +104,9 @@ private:
void loadActorStandAnim(int actorIndex); // Cmd 0x01
void loadActorAnim2(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66 = 0);// Cmd 0x02
int showRoomSpecificText(const char **textAddr); // (Deprecated, use function below) // Cmd 0x03
- int showText(const int *text); // Cmd 0x03
- int showText(int speaker, int text); // Cmd 0x03
- int showText(int text); // Cmd 0x03
+ int showText(const TextRef *text); // Cmd 0x03
+ int showText(TextRef speaker, TextRef text); // Cmd 0x03
+ int showText(TextRef text); // Cmd 0x03
void giveItem(int item); // Cmd 0x04
// Command 0x05: "demon4ShowSunPuzzle"
void loadRoomIndex(int roomIndex, int spawnIndex); // Cmd 0x06
@@ -129,8 +129,8 @@ private:
// If "changeDirection" is true, they remain facing that direction even after their
// animation is finished. The game is inconsistent about doing this.
- void spockScan(int direction, int text, bool changeDirection);
- void mccoyScan(int direction, int text, bool changeDirection);
+ void spockScan(int direction, TextRef text, bool changeDirection);
+ void mccoyScan(int direction, TextRef text, bool changeDirection);
// Room-specific code
public:
@@ -753,6 +753,7 @@ public:
void love0MccoyReachedConsole();
void love0MccoyAccessedConsole();
void love0InteractWithConsole();
+ void love0GetDoorOrConsole();
// LOVE1
void love1Tick1();
@@ -1100,6 +1101,22 @@ public:
void love5KirkUntiedMarcus();
void love5MarcusStoodUp();
+ // LOVEA (common code)
+ void loveaTimer0Expired();
+ void loveaTimer1Expired();
+ void loveaUseMedkitOnSpock();
+ void loveaUseCureSampleOnSpock();
+ void loveaUseCureOnSpock();
+ void loveaSpockOrMccoyInPositionToUseCure();
+ void loveaFinishedCuringSpock();
+ void loveaTimer2Expired();
+ void loveaUseMTricorderOnSpock();
+ void loveaUseMTricorderOnHuman();
+ void loveaUseRomulanLaughingGas();
+ void loveaUseHumanLaughingGas();
+ void loveaUseAmmonia();
+ void loveaUseCommunicator();
+
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
@@ -1163,66 +1180,48 @@ private:
byte shootKirkOverride; // 0x1ec4
} tug2;
+
struct {
+ // love0
bool heardSummaryOfVirus; // 0xda
- byte door2OpenCounter; // 0xdc
- byte door1OpenCounter; // 0xdd
- byte _de; // 0xde
-
int16 consoleCrewman; // 0xe3
char consoleAnimation[10]; // 0xe5
- int32 consoleSpeaker; // 0xe7
- int32 consoleText; // 0xe9
+ TextRef consoleSpeaker; // 0xe7
+ TextRef consoleText; // 0xe9
- byte _8ab; // 0x8ab
- byte _8ac; // 0x8ac
- } love0;
-
- struct {
- byte door3OpenCounter; // 0xcb
- byte door1OpenCounter; // 0xcc
- byte door2OpenCounter; // 0xcd
- bool walkingToDoor; // 0xce
- int32 dyingSpeaker; // 0xcf
+ // love1
+ TextRef dyingSpeaker; // 0xcf
int16 crewmanUsingFreezerRetX; // 0xd1
int16 crewmanUsingFreezerRetY; // 0xd3
int16 crewmanUsingDevice; // 0xd9
int16 itemInNozzle; // 0xdd
char bottleAnimation[10]; // 0xdf
- byte _1d2a; // 0x1d2a
- byte _1d2b; // 0x1d2b
- } love1;
-
- struct {
+ // love2
byte canisterType; // 0xca
byte cb; // 0xcb
- bool walkingToDoor; // 0xcc
- byte doorOpenCounter; // 0xcd
int16 canisterItem; // 0xce
char canisterAnim[10]; // 0xd0
- int16 d2; // 0xd2
- char d6[10]; // 0xd6
- char d8[10]; // 0xd8
- byte _2966; // 0x2966
- byte _2967; // 0x2967
- } love2;
+ int16 chamberObject; // 0xd2
+ char chamberInputAnim[10]; // 0xd6
+ char chamberOutputAnim[10]; // 0xd8
- struct {
+ // love3
byte activeCrewman;
- byte _188e; // 0x188e
- byte _188f; // 0x188f
- } love3;
- struct {
+ // love4
bool gaveWaterToRomulans; // 0xca
- byte doorOpenCounter; // 0xcb
- bool walkingToDoor; // 0xcc
- } love4;
- struct {
+ // love5
byte numCrewmenReadyToBeamOut; // 0xcb
- } love5;
+
+ // common
+ byte walkingToDoor;
+ byte doorOpenCounter;
+ byte spockAndMccoyReadyToUseCure;
+ byte cmnXPosToCureSpock;
+ byte cmnYPosToCureSpock;
+ } love;
} _roomVar;
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 7eafd5b..18f7005 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -819,8 +819,27 @@ RoomAction love0ActionList[] = {
{ Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::love0UseMccoyOnConsole },
{ Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::love0MccoyReachedConsole },
{ Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love0MccoyAccessedConsole },
- // TODO: there's a lot of "extra" stuff at the end of the file. I don't think it's
- // unused, but I'm not sure how it's run.
+ { Action(ACTION_GET, 8, 0, 0), &Room::love0GetDoorOrConsole },
+ { Action(ACTION_GET, 9, 0, 0), &Room::love0GetDoorOrConsole },
+ { Action(ACTION_GET, 0x20, 0, 0), &Room::love0GetDoorOrConsole },
+
+ // Common code
+ { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::loveaTimer0Expired },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::loveaTimer1Expired },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0), &Room::loveaUseMedkitOnSpock },
+ { Action(ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0), &Room::loveaUseCureSampleOnSpock },
+ { Action(ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0), &Room::loveaUseCureOnSpock },
+ { Action(ACTION_FINISHED_WALKING, 99, 0, 0), &Room::loveaSpockOrMccoyInPositionToUseCure },
+ { Action(ACTION_FINISHED_ANIMATION, 99, 0, 0), &Room::loveaFinishedCuringSpock },
+ { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::loveaTimer2Expired },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0), &Room::loveaUseMTricorderOnSpock },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IRLG, -1, 0), &Room::loveaUseRomulanLaughingGas },
+ { Action(ACTION_USE, OBJECT_IN2O, -1, 0), &Room::loveaUseHumanLaughingGas },
+ { Action(ACTION_USE, OBJECT_INH3, -1, 0), &Room::loveaUseAmmonia },
+ { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::loveaUseCommunicator },
};
RoomAction love1ActionList[] = {
@@ -941,7 +960,24 @@ RoomAction love1ActionList[] = {
{ Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::love1CrewmanReachedLadder },
{ Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love1CrewmanDiedFromPhaser },
{ Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::love1TouchedHotspot0 },
- // TODO: common code
+
+ // Common code
+ { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::loveaTimer0Expired },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::loveaTimer1Expired },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0), &Room::loveaUseMedkitOnSpock },
+ { Action(ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0), &Room::loveaUseCureSampleOnSpock },
+ { Action(ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0), &Room::loveaUseCureOnSpock },
+ { Action(ACTION_FINISHED_WALKING, 99, 0, 0), &Room::loveaSpockOrMccoyInPositionToUseCure },
+ { Action(ACTION_FINISHED_ANIMATION, 99, 0, 0), &Room::loveaFinishedCuringSpock },
+ { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::loveaTimer2Expired },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0), &Room::loveaUseMTricorderOnSpock },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IRLG, -1, 0), &Room::loveaUseRomulanLaughingGas },
+ { Action(ACTION_USE, OBJECT_IN2O, -1, 0), &Room::loveaUseHumanLaughingGas },
+ { Action(ACTION_USE, OBJECT_INH3, -1, 0), &Room::loveaUseAmmonia },
+ { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::loveaUseCommunicator },
};
RoomAction love2ActionList[] = {
@@ -1058,7 +1094,23 @@ RoomAction love2ActionList[] = {
{ Action(ACTION_FINISHED_WALKING, 11, 0, 0), &Room::love2ReachedCure },
{ Action(ACTION_FINISHED_ANIMATION, 24, 0, 0), &Room::love2GotCure },
- // TODO: common code
+ // Common code
+ { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::loveaTimer0Expired },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::loveaTimer1Expired },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0), &Room::loveaUseMedkitOnSpock },
+ { Action(ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0), &Room::loveaUseCureSampleOnSpock },
+ { Action(ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0), &Room::loveaUseCureOnSpock },
+ { Action(ACTION_FINISHED_WALKING, 99, 0, 0), &Room::loveaSpockOrMccoyInPositionToUseCure },
+ { Action(ACTION_FINISHED_ANIMATION, 99, 0, 0), &Room::loveaFinishedCuringSpock },
+ { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::loveaTimer2Expired },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0), &Room::loveaUseMTricorderOnSpock },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IRLG, -1, 0), &Room::loveaUseRomulanLaughingGas },
+ { Action(ACTION_USE, OBJECT_IN2O, -1, 0), &Room::loveaUseHumanLaughingGas },
+ { Action(ACTION_USE, OBJECT_INH3, -1, 0), &Room::loveaUseAmmonia },
+ { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::loveaUseCommunicator },
};
RoomAction love3ActionList[] = {
@@ -1164,7 +1216,24 @@ RoomAction love3ActionList[] = {
{ Action(ACTION_GET, 9, 0, 0), &Room::love3GetInsulation },
{ Action(ACTION_FINISHED_WALKING, 12, 0, 0), &Room::love3ReachedInsulationToGet },
{ Action(ACTION_FINISHED_ANIMATION, 14, 0, 0), &Room::love3PickedUpInsulation },
- // TODO: common code
+
+ // Common code
+ { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::loveaTimer0Expired },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::loveaTimer1Expired },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0), &Room::loveaUseMedkitOnSpock },
+ { Action(ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0), &Room::loveaUseCureSampleOnSpock },
+ { Action(ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0), &Room::loveaUseCureOnSpock },
+ { Action(ACTION_FINISHED_WALKING, 99, 0, 0), &Room::loveaSpockOrMccoyInPositionToUseCure },
+ { Action(ACTION_FINISHED_ANIMATION, 99, 0, 0), &Room::loveaFinishedCuringSpock },
+ { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::loveaTimer2Expired },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0), &Room::loveaUseMTricorderOnSpock },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IRLG, -1, 0), &Room::loveaUseRomulanLaughingGas },
+ { Action(ACTION_USE, OBJECT_IN2O, -1, 0), &Room::loveaUseHumanLaughingGas },
+ { Action(ACTION_USE, OBJECT_INH3, -1, 0), &Room::loveaUseAmmonia },
+ { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::loveaUseCommunicator },
};
RoomAction love4ActionList[] = {
@@ -1239,7 +1308,24 @@ RoomAction love4ActionList[] = {
{ Action(ACTION_USE, -1, 10, 0), &Room::love4UseAnythingOnRomulan },
{ Action(ACTION_USE, -1, 11, 0), &Room::love4UseAnythingOnRomulan },
{ Action(ACTION_USE, -1, 12, 0), &Room::love4UseAnythingOnRomulan },
- // TODO: common code
+
+ // Common code
+ { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::loveaTimer0Expired },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::loveaTimer1Expired },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0), &Room::loveaUseMedkitOnSpock },
+ { Action(ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0), &Room::loveaUseCureSampleOnSpock },
+ { Action(ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0), &Room::loveaUseCureOnSpock },
+ { Action(ACTION_FINISHED_WALKING, 99, 0, 0), &Room::loveaSpockOrMccoyInPositionToUseCure },
+ { Action(ACTION_FINISHED_ANIMATION, 99, 0, 0), &Room::loveaFinishedCuringSpock },
+ { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::loveaTimer2Expired },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0), &Room::loveaUseMTricorderOnSpock },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IRLG, -1, 0), &Room::loveaUseRomulanLaughingGas },
+ { Action(ACTION_USE, OBJECT_IN2O, -1, 0), &Room::loveaUseHumanLaughingGas },
+ { Action(ACTION_USE, OBJECT_INH3, -1, 0), &Room::loveaUseAmmonia },
+ { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::loveaUseCommunicator },
};
RoomAction love5ActionList[] = {
@@ -1287,7 +1373,24 @@ RoomAction love5ActionList[] = {
{ Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::love5KirkReachedMarcus },
{ Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love5KirkUntiedMarcus },
{ Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love5MarcusStoodUp },
- // TODO: common code
+
+ // Common code
+ { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::loveaTimer0Expired },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::loveaTimer1Expired },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0), &Room::loveaUseMedkitOnSpock },
+ { Action(ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0), &Room::loveaUseCureSampleOnSpock },
+ { Action(ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0), &Room::loveaUseCureOnSpock },
+ { Action(ACTION_FINISHED_WALKING, 99, 0, 0), &Room::loveaSpockOrMccoyInPositionToUseCure },
+ { Action(ACTION_FINISHED_ANIMATION, 99, 0, 0), &Room::loveaFinishedCuringSpock },
+ { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::loveaTimer2Expired },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0), &Room::loveaUseMTricorderOnSpock },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0), &Room::loveaUseMTricorderOnHuman },
+ { Action(ACTION_USE, OBJECT_IRLG, -1, 0), &Room::loveaUseRomulanLaughingGas },
+ { Action(ACTION_USE, OBJECT_IN2O, -1, 0), &Room::loveaUseHumanLaughingGas },
+ { Action(ACTION_USE, OBJECT_INH3, -1, 0), &Room::loveaUseAmmonia },
+ { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::loveaUseCommunicator },
};
diff --git a/engines/startrek/rooms/love0.cpp b/engines/startrek/rooms/love0.cpp
index d43f35d..e3a5ab2 100644
--- a/engines/startrek/rooms/love0.cpp
+++ b/engines/startrek/rooms/love0.cpp
@@ -40,16 +40,16 @@ void Room::love0Tick1() {
playVoc("LOV0LOOP"); // FIXME: no audio after first entry?
}
- if (_vm->_awayMission.love.field2c)
+ if (_vm->_awayMission.love.releasedHumanLaughingGas)
_vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.field2d)
+ if (_vm->_awayMission.love.releasedRomulanLaughingGas)
_vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
_vm->_awayMission.timers[2] = 200;
loadActorAnim(OBJECT_DOOR2, "s3r0d2a", 0xe6, 0x80, 0);
loadActorAnim(OBJECT_DOOR1, "s3r0d1a", 0x123, 0x8d, 0);
- _roomVar.love0._8ab = 0xf4;
- _roomVar.love0._8ac = 0x8f;
+ _roomVar.love.cmnXPosToCureSpock = 0xf4;
+ _roomVar.love.cmnYPosToCureSpock = 0x8f;
}
void Room::love0Tick10() {
@@ -57,40 +57,40 @@ void Room::love0Tick10() {
void Room::love0WalkToDoor2() {
_vm->_awayMission.disableInput = true;
- _roomVar.love0._de = 2;
+ _roomVar.love.walkingToDoor = 2;
walkCrewman(OBJECT_KIRK, 0xe6, 0x81, 4);
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love0OpenDoor2() {
- if (_roomVar.love0._de == 2) {
+ if (_roomVar.love.walkingToDoor == 2) {
loadActorAnim(OBJECT_DOOR2, "s3r0d2", 0xe6, 0x80, 3);
playSoundEffectIndex(SND_DOOR1);
}
}
void Room::love0ReachedDoor2() {
- _roomVar.love0.door2OpenCounter++;
- if (_roomVar.love0.door2OpenCounter == 2)
+ _roomVar.love.doorOpenCounter++;
+ if (_roomVar.love.doorOpenCounter == 2)
loadRoomIndex(2, 1);
}
void Room::love0WalkToDoor1() {
_vm->_awayMission.disableInput = true;
- _roomVar.love0._de = 1;
+ _roomVar.love.walkingToDoor = 1;
walkCrewman(OBJECT_KIRK, 0x125, 0x8d, 5);
}
void Room::love0OpenDoor1() {
- if (_roomVar.love0._de == 1) {
+ if (_roomVar.love.walkingToDoor == 1) {
loadActorAnim(OBJECT_DOOR1, "s3r0d1", 0x123, 0x8d, 4);
playSoundEffectIndex(SND_DOOR1);
}
}
void Room::love0ReachedDoor1() {
- _roomVar.love0.door1OpenCounter++;
- if (_roomVar.love0.door1OpenCounter == 2)
+ _roomVar.love.doorOpenCounter++;
+ if (_roomVar.love.doorOpenCounter == 2)
loadRoomIndex(1, 3);
}
@@ -171,12 +171,12 @@ void Room::love0UseRedshirtOnConsole() {
}
void Room::love0UseSpockOnConsole() {
- _roomVar.love0.consoleCrewman = OBJECT_SPOCK;
- _roomVar.love0.consoleSpeaker = TX_SPEAKER_SPOCK;
- _roomVar.love0.consoleText = TX_LOV0_005;
- strcpy(_roomVar.love0.consoleAnimation, "susemn");
+ _roomVar.love.consoleCrewman = OBJECT_SPOCK;
+ _roomVar.love.consoleSpeaker = TX_SPEAKER_SPOCK;
+ _roomVar.love.consoleText = TX_LOV0_005;
+ strcpy(_roomVar.love.consoleAnimation, "susemn");
- walkCrewman(_roomVar.love0.consoleCrewman, 0x9a, 0x9a, 2);
+ walkCrewman(_roomVar.love.consoleCrewman, 0x9a, 0x9a, 2);
if (!_vm->_awayMission.love.spockAccessedConsole) {
_vm->_awayMission.love.spockAccessedConsole = true;
_vm->_awayMission.love.missionScore += 4;
@@ -184,7 +184,7 @@ void Room::love0UseSpockOnConsole() {
}
void Room::love0SpockReachedConsole() {
- loadActorAnim2(_roomVar.love0.consoleCrewman, _roomVar.love0.consoleAnimation, -1, -1, 5);
+ loadActorAnim2(_roomVar.love.consoleCrewman, _roomVar.love.consoleAnimation, -1, -1, 5);
}
void Room::love0SpockAccessedConsole() {
@@ -193,8 +193,8 @@ void Room::love0SpockAccessedConsole() {
love0InteractWithConsole();
else {
showText(TX_SPEAKER_COMPUTER, TX_COMPU188);
- showText(_roomVar.love0.consoleSpeaker, _roomVar.love0.consoleText);
- _roomVar.love0.heardSummaryOfVirus = true;
+ showText(_roomVar.love.consoleSpeaker, _roomVar.love.consoleText);
+ _roomVar.love.heardSummaryOfVirus = true;
}
}
@@ -216,9 +216,9 @@ void Room::love0MccoyAccessedConsole() {
if (_vm->_awayMission.love.knowAboutVirus)
love0InteractWithConsole();
else {
- if (!_roomVar.love0.heardSummaryOfVirus) {
+ if (!_roomVar.love.heardSummaryOfVirus) {
showText(TX_SPEAKER_COMPUTER, TX_COMPU188);
- _roomVar.love0.heardSummaryOfVirus = true;
+ _roomVar.love.heardSummaryOfVirus = true;
}
showText(TX_SPEAKER_MCCOY, TX_LOV0_024);
showText(TX_SPEAKER_SPOCK, TX_LOV0_035);
@@ -271,4 +271,15 @@ void Room::love0InteractWithConsole() {
}
}
+void Room::love0GetDoorOrConsole() {
+ // BUGFIX: There was a problem with "get door 1" where it would execute a bit of
+ // non-code before reaching where it was supposed to be. Not sure if it had any actual
+ // effect.
+ showText(TX_LOV0N001);
+
+ // NOTE: There is an unused block of code that's jumped over in the "get door 2"
+ // function. (Spock says "that's not logical".)
+ //showText(TX_SPEAKER_SPOCK, TX_LOV0_030);
+}
+
}
diff --git a/engines/startrek/rooms/love1.cpp b/engines/startrek/rooms/love1.cpp
index 6398b38..bdcbb6a 100644
--- a/engines/startrek/rooms/love1.cpp
+++ b/engines/startrek/rooms/love1.cpp
@@ -59,33 +59,33 @@ void Room::love1Tick1() {
switch (_vm->_awayMission.love.bottleInNozzle) {
case BOTTLETYPE_N2O:
- strcpy(_roomVar.love1.bottleAnimation, "btle1");
- _roomVar.love1.itemInNozzle = OBJECT_IN2O;
+ strcpy(_roomVar.love.bottleAnimation, "btle1");
+ _roomVar.love.itemInNozzle = OBJECT_IN2O;
goto common;
case BOTTLETYPE_NH3:
- strcpy(_roomVar.love1.bottleAnimation, "btle2");
- _roomVar.love1.itemInNozzle = OBJECT_INH3;
+ strcpy(_roomVar.love.bottleAnimation, "btle2");
+ _roomVar.love.itemInNozzle = OBJECT_INH3;
goto common;
case BOTTLETYPE_H2O:
- strcpy(_roomVar.love1.bottleAnimation, "btle3");
- _roomVar.love1.itemInNozzle = OBJECT_IH2O;
+ strcpy(_roomVar.love.bottleAnimation, "btle3");
+ _roomVar.love.itemInNozzle = OBJECT_IH2O;
goto common;
case BOTTLETYPE_RLG:
- strcpy(_roomVar.love1.bottleAnimation, "btle4");
- _roomVar.love1.itemInNozzle = OBJECT_IRLG;
+ strcpy(_roomVar.love.bottleAnimation, "btle4");
+ _roomVar.love.itemInNozzle = OBJECT_IRLG;
goto common;
common:
- loadActorAnim(OBJECT_BOTTLE, _roomVar.love1.bottleAnimation, 0xa3, 0x72, 0);
+ loadActorAnim(OBJECT_BOTTLE, _roomVar.love.bottleAnimation, 0xa3, 0x72, 0);
// fall through
case BOTTLETYPE_NONE:
- if (_vm->_awayMission.love.field2c)
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
break;
}
- if (_vm->_awayMission.love.field2d)
+ if (_vm->_awayMission.love.releasedHumanLaughingGas)
+ _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
+ if (_vm->_awayMission.love.releasedRomulanLaughingGas)
_vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
_vm->_awayMission.timers[2] = 200;
@@ -93,18 +93,18 @@ common:
loadActorAnim(OBJECT_DOOR1, "s3r2d1a", 0, 0, 0);
loadActorAnim(OBJECT_DOOR2, "s3r2d2a", 0, 0, 0);
- _roomVar.love1._1d2a = 0x90;
- _roomVar.love1._1d2b = 0xa7;
+ _roomVar.love.cmnXPosToCureSpock = 0x90;
+ _roomVar.love.cmnYPosToCureSpock = 0xa7;
}
void Room::love1WalkToDoor3() {
_vm->_awayMission.disableInput = true;
- _roomVar.love1.walkingToDoor = true;
+ _roomVar.love.walkingToDoor = true;
walkCrewman(OBJECT_KIRK, 0xd9, 0x81, 15);
}
void Room::love1OpenDoor3() {
- if (_roomVar.love1.walkingToDoor) {
+ if (_roomVar.love.walkingToDoor) {
loadActorAnim(OBJECT_DOOR3, "s3r2d3", 0xdb, 0x7e, 2);
playSoundEffectIndex(SND_DOOR1);
}
@@ -112,19 +112,19 @@ void Room::love1OpenDoor3() {
// Door 3 opened, or door 3 reached (both must occur before transition happens)
void Room::love1ReachedDoor3() {
- _roomVar.love1.door3OpenCounter++;
- if (_roomVar.love1.door3OpenCounter == 2)
+ _roomVar.love.doorOpenCounter++;
+ if (_roomVar.love.doorOpenCounter == 2)
loadRoomIndex(3, 1);
}
void Room::love1WalkToDoor1() {
_vm->_awayMission.disableInput = true;
- _roomVar.love1.walkingToDoor = true;
+ _roomVar.love.walkingToDoor = true;
walkCrewman(OBJECT_KIRK, 0x42, 0x97, 16);
}
void Room::love1OpenDoor1() {
- if (_roomVar.love1.walkingToDoor) {
+ if (_roomVar.love.walkingToDoor) {
loadActorAnim(OBJECT_DOOR1, "s3r2d1", 0, 0, 3);
playSoundEffectIndex(SND_DOOR1);
}
@@ -132,19 +132,19 @@ void Room::love1OpenDoor1() {
// Door 1 opened, or door 1 reached
void Room::love1ReachedDoor1() {
- _roomVar.love1.door1OpenCounter++;
- if (_roomVar.love1.door1OpenCounter == 2)
+ _roomVar.love.doorOpenCounter++;
+ if (_roomVar.love.doorOpenCounter == 2)
loadRoomIndex(0, 2);
}
void Room::love1WalkToDoor2() {
_vm->_awayMission.disableInput = true;
- _roomVar.love1.walkingToDoor = true;
+ _roomVar.love.walkingToDoor = true;
walkCrewman(OBJECT_KIRK, 0x79, 0x85, 17);
}
void Room::love1OpenDoor2() {
- if (_roomVar.love1.walkingToDoor) {
+ if (_roomVar.love.walkingToDoor) {
loadActorAnim(OBJECT_DOOR2, "s3r2d2", 0, 0, 4);
playSoundEffectIndex(SND_DOOR1);
}
@@ -152,8 +152,8 @@ void Room::love1OpenDoor2() {
// Door 2 opened, or door 2 reached
void Room::love1ReachedDoor2() {
- _roomVar.love1.door2OpenCounter++;
- if (_roomVar.love1.door2OpenCounter == 2)
+ _roomVar.love.doorOpenCounter++;
+ if (_roomVar.love.doorOpenCounter == 2)
loadRoomIndex(2, 0);
}
@@ -355,13 +355,13 @@ void Room::love1KirkGotBottleFromNozzle() {
_vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_NONE;
loadActorStandAnim(OBJECT_BOTTLE);
showText(TX_LOV1N007);
- _roomVar.love1.itemInNozzle = 0;
+ _roomVar.love.itemInNozzle = 0;
}
void Room::love1UseN2OOnNozzle() {
if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
- _roomVar.love1.itemInNozzle = OBJECT_IN2O;
- strcpy(_roomVar.love1.bottleAnimation, "btle1");
+ _roomVar.love.itemInNozzle = OBJECT_IN2O;
+ strcpy(_roomVar.love.bottleAnimation, "btle1");
_vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_N2O;
walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 3);
}
@@ -369,8 +369,8 @@ void Room::love1UseN2OOnNozzle() {
void Room::love1UseH2OOnNozzle() {
if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
- _roomVar.love1.itemInNozzle = OBJECT_IH2O;
- strcpy(_roomVar.love1.bottleAnimation, "btle3");
+ _roomVar.love.itemInNozzle = OBJECT_IH2O;
+ strcpy(_roomVar.love.bottleAnimation, "btle3");
_vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_H2O;
walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 3);
}
@@ -378,8 +378,8 @@ void Room::love1UseH2OOnNozzle() {
void Room::love1UseNH3OnNozzle() {
if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
- _roomVar.love1.itemInNozzle = OBJECT_INH3;
- strcpy(_roomVar.love1.bottleAnimation, "btle2");
+ _roomVar.love.itemInNozzle = OBJECT_INH3;
+ strcpy(_roomVar.love.bottleAnimation, "btle2");
_vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_NH3;
walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 3);
}
@@ -387,8 +387,8 @@ void Room::love1UseNH3OnNozzle() {
void Room::love1UseRLGOnNozzle() {
if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
- _roomVar.love1.itemInNozzle = OBJECT_IRLG;
- strcpy(_roomVar.love1.bottleAnimation, "btle4");
+ _roomVar.love.itemInNozzle = OBJECT_IRLG;
+ strcpy(_roomVar.love.bottleAnimation, "btle4");
_vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_RLG;
walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 3);
}
@@ -399,8 +399,8 @@ void Room::love1KirkReachedNozzleToPut() {
}
void Room::love1KirkPutBottleInNozzle() {
- loadActorAnim(OBJECT_BOTTLE, _roomVar.love1.bottleAnimation, 0xa3, 0x72, 0);
- loseItem(_roomVar.love1.itemInNozzle);
+ loadActorAnim(OBJECT_BOTTLE, _roomVar.love.bottleAnimation, 0xa3, 0x72, 0);
+ loseItem(_roomVar.love.itemInNozzle);
}
void Room::love1UseAnthingOnNozzle() {
@@ -431,7 +431,7 @@ void Room::love1MccoyReachedReplicator() {
}
void Room::love1MccoyUsedReplicator() {
- if (_roomVar.love1.itemInNozzle == OBJECT_INH3) {
+ if (_roomVar.love.itemInNozzle == OBJECT_INH3) {
loadActorStandAnim(OBJECT_DISH_IN_CHAMBER);
loadActorAnim2(OBJECT_CHAMBER, "s3r2d6", 0xb4, 0x75, 7);
playSoundEffectIndex(SND_DOOR1);
@@ -502,41 +502,41 @@ void Room::love1KirkGotPolyberylcarbonate() {
}
void Room::love1UseKirkOnFreezer() {
- _roomVar.love1.crewmanUsingFreezerRetY = 0xa0;
- _roomVar.love1.crewmanUsingFreezerRetX = 0x96;
- _roomVar.love1.crewmanUsingDevice = OBJECT_KIRK;
- walkCrewman(_roomVar.love1.crewmanUsingDevice, 0x71, 0x8e, 7);
+ _roomVar.love.crewmanUsingFreezerRetY = 0xa0;
+ _roomVar.love.crewmanUsingFreezerRetX = 0x96;
+ _roomVar.love.crewmanUsingDevice = OBJECT_KIRK;
+ walkCrewman(_roomVar.love.crewmanUsingDevice, 0x71, 0x8e, 7);
_vm->_awayMission.disableInput = true;
}
void Room::love1UseRedshirtOnFreezer() {
- _roomVar.love1.crewmanUsingFreezerRetY = 0x89;
- _roomVar.love1.crewmanUsingFreezerRetX = 0x95;
- _roomVar.love1.crewmanUsingDevice = OBJECT_REDSHIRT;
- walkCrewman(_roomVar.love1.crewmanUsingDevice, 0x71, 0x8e, 7);
+ _roomVar.love.crewmanUsingFreezerRetY = 0x89;
+ _roomVar.love.crewmanUsingFreezerRetX = 0x95;
+ _roomVar.love.crewmanUsingDevice = OBJECT_REDSHIRT;
+ walkCrewman(_roomVar.love.crewmanUsingDevice, 0x71, 0x8e, 7);
_vm->_awayMission.disableInput = true;
}
void Room::love1UseSpockOnFreezer() {
- _roomVar.love1.crewmanUsingFreezerRetY = 0xa9;
- _roomVar.love1.crewmanUsingFreezerRetX = 0x61;
- _roomVar.love1.crewmanUsingDevice = OBJECT_SPOCK;
- walkCrewman(_roomVar.love1.crewmanUsingDevice, 0x71, 0x8e, 7);
+ _roomVar.love.crewmanUsingFreezerRetY = 0xa9;
+ _roomVar.love.crewmanUsingFreezerRetX = 0x61;
+ _roomVar.love.crewmanUsingDevice = OBJECT_SPOCK;
+ walkCrewman(_roomVar.love.crewmanUsingDevice, 0x71, 0x8e, 7);
_vm->_awayMission.disableInput = true;
}
void Room::love1UseMccoyOnFreezer() {
- _roomVar.love1.crewmanUsingFreezerRetY = 0x98;
- _roomVar.love1.crewmanUsingFreezerRetX = 0xbf;
- _roomVar.love1.crewmanUsingDevice = OBJECT_MCCOY;
- walkCrewman(_roomVar.love1.crewmanUsingDevice, 0x71, 0x8e, 7);
+ _roomVar.love.crewmanUsingFreezerRetY = 0x98;
+ _roomVar.love.crewmanUsingFreezerRetX = 0xbf;
+ _roomVar.love.crewmanUsingDevice = OBJECT_MCCOY;
+ walkCrewman(_roomVar.love.crewmanUsingDevice, 0x71, 0x8e, 7);
_vm->_awayMission.disableInput = true;
}
void Room::love1CrewmanReachedFreezer() {
- Common::String useAnim = _vm->getCrewmanAnimFilename(_roomVar.love1.crewmanUsingDevice, "usehw");
+ Common::String useAnim = _vm->getCrewmanAnimFilename(_roomVar.love.crewmanUsingDevice, "usehw");
- loadActorAnim2(_roomVar.love1.crewmanUsingDevice, useAnim, -1, -1, 16);
+ loadActorAnim2(_roomVar.love.crewmanUsingDevice, useAnim, -1, -1, 16);
}
void Room::love1CrewmanOpenedOrClosedFreezer() {
@@ -548,7 +548,7 @@ void Room::love1CrewmanOpenedOrClosedFreezer() {
playSoundEffectIndex(SND_DOOR1);
_vm->_awayMission.love.freezerOpen = !_vm->_awayMission.love.freezerOpen;
- walkCrewman(_roomVar.love1.crewmanUsingDevice, _roomVar.love1.crewmanUsingFreezerRetX, _roomVar.love1.crewmanUsingFreezerRetY, 0);
+ walkCrewman(_roomVar.love.crewmanUsingDevice, _roomVar.love.crewmanUsingFreezerRetX, _roomVar.love.crewmanUsingFreezerRetY, 0);
_vm->_awayMission.disableInput = false;
}
@@ -589,30 +589,30 @@ void Room::love1FinishedUsingArbitraryItemOnDistillator() {
}
void Room::love1UseKirkOnLadder() {
- _roomVar.love1.crewmanUsingDevice = OBJECT_KIRK;
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love1.crewmanUsingDevice] = DIR_N;
- walkCrewman(_roomVar.love1.crewmanUsingDevice, 0x102, 0x89, 1);
+ _roomVar.love.crewmanUsingDevice = OBJECT_KIRK;
+ _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
+ walkCrewman(_roomVar.love.crewmanUsingDevice, 0x102, 0x89, 1);
_vm->_awayMission.disableInput = true;
}
void Room::love1UseSpockOnLadder() {
- _roomVar.love1.crewmanUsingDevice = OBJECT_SPOCK;
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love1.crewmanUsingDevice] = DIR_N;
- walkCrewman(_roomVar.love1.crewmanUsingDevice, 0x102, 0x89, 1);
+ _roomVar.love.crewmanUsingDevice = OBJECT_SPOCK;
+ _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
+ walkCrewman(_roomVar.love.crewmanUsingDevice, 0x102, 0x89, 1);
_vm->_awayMission.disableInput = true;
}
void Room::love1UseMccoyOnLadder() {
- _roomVar.love1.crewmanUsingDevice = OBJECT_MCCOY;
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love1.crewmanUsingDevice] = DIR_N;
- walkCrewman(_roomVar.love1.crewmanUsingDevice, 0x102, 0x89, 1);
+ _roomVar.love.crewmanUsingDevice = OBJECT_MCCOY;
+ _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
+ walkCrewman(_roomVar.love.crewmanUsingDevice, 0x102, 0x89, 1);
_vm->_awayMission.disableInput = true;
}
void Room::love1UseRedshirtOnLadder() {
- _roomVar.love1.crewmanUsingDevice = OBJECT_REDSHIRT;
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love1.crewmanUsingDevice] = DIR_N;
- walkCrewman(_roomVar.love1.crewmanUsingDevice, 0x102, 0x89, 1);
+ _roomVar.love.crewmanUsingDevice = OBJECT_REDSHIRT;
+ _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
+ walkCrewman(_roomVar.love.crewmanUsingDevice, 0x102, 0x89, 1);
_vm->_awayMission.disableInput = true;
}
@@ -630,19 +630,19 @@ void Room::love1CrewmanReachedLadder() {
loadActorAnim(OBJECT_PHASERSHOT, "s3r2s2", 0xf3, 0x89, 0);
playSoundEffectIndex(SND_PHASSHOT);
- Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love1.crewmanUsingDevice, "killw");
- loadActorAnim(_roomVar.love1.crewmanUsingDevice, anim, 0x102, 0x89, 6);
- _roomVar.love1.dyingSpeaker = speakers[_roomVar.love1.crewmanUsingDevice];
+ Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love.crewmanUsingDevice, "killw");
+ loadActorAnim(_roomVar.love.crewmanUsingDevice, anim, 0x102, 0x89, 6);
+ _roomVar.love.dyingSpeaker = speakers[_roomVar.love.crewmanUsingDevice];
}
}
void Room::love1CrewmanDiedFromPhaser() {
- if (_roomVar.love1.crewmanUsingDevice == OBJECT_REDSHIRT) {
+ if (_roomVar.love.crewmanUsingDevice == OBJECT_REDSHIRT) {
_vm->_awayMission.disableInput = false;
showText(TX_SPEAKER_FERRIS, TX_LOV1_024);
_vm->_awayMission.redshirtDead = true;
} else {
- showText(_roomVar.love1.dyingSpeaker, TX_LOV1_025);
+ showText(_roomVar.love.dyingSpeaker, TX_LOV1_025);
showGameOverMenu();
}
}
diff --git a/engines/startrek/rooms/love2.cpp b/engines/startrek/rooms/love2.cpp
index 7ccbfd2..c8bec64 100644
--- a/engines/startrek/rooms/love2.cpp
+++ b/engines/startrek/rooms/love2.cpp
@@ -105,38 +105,38 @@ void Room::love2Tick1() {
switch (_vm->_awayMission.love.field35) {
case SYNTHITEM_PBC:
- strcpy(_roomVar.love2.d6, "pbcanm");
- _roomVar.love2.d2 = OBJECT_POLYBERYLCARBONATE;
+ strcpy(_roomVar.love.chamberInputAnim, "pbcanm");
+ _roomVar.love.chamberObject = OBJECT_POLYBERYLCARBONATE;
break;
case SYNTHITEM_VIRUS_SAMPLE:
- strcpy(_roomVar.love2.d6, "dishes");
- _roomVar.love2.d2 = OBJECT_VIRUSSAMPLE;
+ strcpy(_roomVar.love.chamberInputAnim, "dishes");
+ _roomVar.love.chamberObject = OBJECT_VIRUSSAMPLE;
break;
case SYNTHITEM_CURE_SAMPLE:
- strcpy(_roomVar.love2.d6, "dishes");
- _roomVar.love2.d2 = OBJECT_CURESAMPLE;
+ strcpy(_roomVar.love.chamberInputAnim, "dishes");
+ _roomVar.love.chamberObject = OBJECT_CURESAMPLE;
break;
case SYNTHITEM_BOTTLE:
switch (_vm->_awayMission.love.synthesizerProduct) {
case 1:
- strcpy(_roomVar.love2.d8, "btle1");
- _roomVar.love2.d2 = OBJECT_SYNTHESIZER_OUTPUT;
+ strcpy(_roomVar.love.chamberOutputAnim, "btle1");
+ _roomVar.love.chamberObject = OBJECT_SYNTHESIZER_OUTPUT;
break;
case 2:
- strcpy(_roomVar.love2.d8, "btle2");
- _roomVar.love2.d2 = OBJECT_SYNTHESIZER_OUTPUT;
+ strcpy(_roomVar.love.chamberOutputAnim, "btle2");
+ _roomVar.love.chamberObject = OBJECT_SYNTHESIZER_OUTPUT;
break;
case 3:
- strcpy(_roomVar.love2.d8, "btle3");
- _roomVar.love2.d2 = OBJECT_SYNTHESIZER_OUTPUT;
+ strcpy(_roomVar.love.chamberOutputAnim, "btle3");
+ _roomVar.love.chamberObject = OBJECT_SYNTHESIZER_OUTPUT;
break;
case 4:
- strcpy(_roomVar.love2.d8, "btle4");
- _roomVar.love2.d2 = OBJECT_SYNTHESIZER_OUTPUT;
+ strcpy(_roomVar.love.chamberOutputAnim, "btle4");
+ _roomVar.love.chamberObject = OBJECT_SYNTHESIZER_OUTPUT;
break;
default:
- strcpy(_roomVar.love2.d8, "cure");
- _roomVar.love2.d2 = OBJECT_CURE;
+ strcpy(_roomVar.love.chamberOutputAnim, "cure");
+ _roomVar.love.chamberObject = OBJECT_CURE;
break;
}
break;
@@ -147,21 +147,21 @@ void Room::love2Tick1() {
if (valid) {
if (_vm->_awayMission.love.field35 == 9)
- loadActorAnim2(_roomVar.love2.d2, _roomVar.love2.d8, 0x8a, 0x8b, 0);
+ loadActorAnim2(_roomVar.love.chamberObject, _roomVar.love.chamberOutputAnim, 0x8a, 0x8b, 0);
else
- loadActorAnim2(_roomVar.love2.d2, _roomVar.love2.d6, 0x8a, 0x8b, 0);
+ loadActorAnim2(_roomVar.love.chamberObject, _roomVar.love.chamberInputAnim, 0x8a, 0x8b, 0);
}
- if (_vm->_awayMission.love.field2c)
+ if (_vm->_awayMission.love.releasedHumanLaughingGas)
_vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.field2d)
+ if (_vm->_awayMission.love.releasedRomulanLaughingGas)
_vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
_vm->_awayMission.timers[2] = 200;
loadActorAnim(OBJECT_DOOR, "s3r3d3a", 0x12a, 0xb5, 0);
- _roomVar.love2._2966 = 0xc9;
- _roomVar.love2._2967 = 0xb7;
+ _roomVar.love.cmnXPosToCureSpock = 0xc9;
+ _roomVar.love.cmnYPosToCureSpock = 0xb7;
}
void Room::love2TouchedWarp1() {
@@ -176,21 +176,21 @@ void Room::love2Timer3Expired() {
void Room::love2WalkToDoor() {
_vm->_awayMission.disableInput = true;
- _roomVar.love2.walkingToDoor = true;
+ _roomVar.love.walkingToDoor = true;
walkCrewman(OBJECT_KIRK, 0x127, 0xba, 14);
}
// Triggers door opening
void Room::love2TouchedHotspot0() {
- if (_roomVar.love2.walkingToDoor) {
+ if (_roomVar.love.walkingToDoor) {
loadActorAnim(OBJECT_DOOR, "s3r3d3", 0x12a, 0xb5, 1);
playSoundEffectIndex(SND_DOOR1);
}
}
void Room::love2DoorReachedOrOpened() {
- _roomVar.love2.doorOpenCounter++;
- if (_roomVar.love2.doorOpenCounter == 2)
+ _roomVar.love.doorOpenCounter++;
+ if (_roomVar.love.doorOpenCounter == 2)
loadRoomIndex(1, 1);
}
@@ -303,28 +303,28 @@ void Room::love2UseSTricorderAnywhere() {
}
void Room::love2UseKirkOnCabinet() {
- _roomVar.love2.d2 = OBJECT_KIRK;
+ _roomVar.love.chamberObject = OBJECT_KIRK;
walkCrewman(OBJECT_KIRK, 0x2b, 0xbb, 12);
}
void Room::love2UseSpockOnCabinet() {
- _roomVar.love2.d2 = OBJECT_SPOCK;
+ _roomVar.love.chamberObject = OBJECT_SPOCK;
walkCrewman(OBJECT_SPOCK, 0x2b, 0xbb, 12);
}
void Room::love2UseMccoyOnCabinet() {
- _roomVar.love2.d2 = OBJECT_MCCOY;
+ _roomVar.love.chamberObject = OBJECT_MCCOY;
walkCrewman(OBJECT_MCCOY, 0x2b, 0xbb, 12);
}
void Room::love2UseRedshirtOnCabinet() {
- _roomVar.love2.d2 = OBJECT_REDSHIRT;
+ _roomVar.love.chamberObject = OBJECT_REDSHIRT;
walkCrewman(OBJECT_REDSHIRT, 0x2b, 0xbb, 12);
}
void Room::love2CrewmanReachedCabinet() {
- Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love2.d2, "usehw");
- loadActorAnim2(_roomVar.love2.d2, anim, -1, -1, 11);
+ Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love.chamberObject, "usehw");
+ loadActorAnim2(_roomVar.love.chamberObject, anim, -1, -1, 11);
}
void Room::love2CrewmanAccessedCabinet() {
@@ -368,23 +368,23 @@ void Room::love2ChangedGasFeed() {
}
void Room::love2UseO2GasOnCanisterSlot() {
- _roomVar.love2.canisterType = CANTYPE_O2;
- strcpy(_roomVar.love2.canisterAnim, "o2can");
- _roomVar.love2.canisterItem = OBJECT_IO2GAS;
+ _roomVar.love.canisterType = CANTYPE_O2;
+ strcpy(_roomVar.love.canisterAnim, "o2can");
+ _roomVar.love.canisterItem = OBJECT_IO2GAS;
walkCrewman(OBJECT_KIRK, 0xa8, 0xb7, 3);
}
void Room::love2UseH2GasOnCanisterSlot() {
- _roomVar.love2.canisterType = CANTYPE_H2;
- strcpy(_roomVar.love2.canisterAnim, "h2can");
- _roomVar.love2.canisterItem = OBJECT_IH2GAS;
+ _roomVar.love.canisterType = CANTYPE_H2;
+ strcpy(_roomVar.love.canisterAnim, "h2can");
+ _roomVar.love.canisterItem = OBJECT_IH2GAS;
walkCrewman(OBJECT_KIRK, 0xa8, 0xb7, 3);
}
void Room::love2UseN2GasOnCanisterSlot() {
- _roomVar.love2.canisterType = CANTYPE_N2;
- strcpy(_roomVar.love2.canisterAnim, "n2can");
- _roomVar.love2.canisterItem = OBJECT_IN2GAS;
+ _roomVar.love.canisterType = CANTYPE_N2;
+ strcpy(_roomVar.love.canisterAnim, "n2can");
+ _roomVar.love.canisterItem = OBJECT_IN2GAS;
walkCrewman(OBJECT_KIRK, 0xa8, 0xb7, 3);
}
@@ -403,18 +403,18 @@ void Room::love2ReachedCanisterSlot() {
void Room::love2PutCanisterInSlot1() {
playVoc("SE6FOOD");
- loadActorAnim(OBJECT_CAN1, _roomVar.love2.canisterAnim, 0xa7, 0xae, 0);
- _vm->_awayMission.love.canister1 = _roomVar.love2.canisterType;
+ loadActorAnim(OBJECT_CAN1, _roomVar.love.canisterAnim, 0xa7, 0xae, 0);
+ _vm->_awayMission.love.canister1 = _roomVar.love.canisterType;
showText(TX_LOV2N034);
- loseItem(_roomVar.love2.canisterItem);
+ loseItem(_roomVar.love.canisterItem);
}
void Room::love2PutCanisterInSlot2() {
playVoc("SE6FOOD");
- loadActorAnim(OBJECT_CAN2, _roomVar.love2.canisterAnim, 0xb1, 0xaf, 0);
- _vm->_awayMission.love.canister2 = _roomVar.love2.canisterType;
+ loadActorAnim(OBJECT_CAN2, _roomVar.love.canisterAnim, 0xb1, 0xaf, 0);
+ _vm->_awayMission.love.canister2 = _roomVar.love.canisterType;
showText(TX_LOV2N035);
- loseItem(_roomVar.love2.canisterItem);
+ loseItem(_roomVar.love.canisterItem);
}
void Room::love2UseAntigravOnCanister1() {
@@ -485,42 +485,42 @@ void Room::love2TookCanister2() {
}
void Room::love2UseKirkOnSynthesizer() {
- _roomVar.love2.d2 = OBJECT_KIRK;
- walkCrewman(_roomVar.love2.d2, 0x46, 0xae, 13);
+ _roomVar.love.chamberObject = OBJECT_KIRK;
+ walkCrewman(_roomVar.love.chamberObject, 0x46, 0xae, 13);
}
void Room::love2UseSpockOnSynthesizer() {
- _roomVar.love2.d2 = OBJECT_SPOCK;
- walkCrewman(_roomVar.love2.d2, 0x46, 0xae, 13);
+ _roomVar.love.chamberObject = OBJECT_SPOCK;
+ walkCrewman(_roomVar.love.chamberObject, 0x46, 0xae, 13);
}
void Room::love2UseMccoyOnSynthesizer() {
- _roomVar.love2.d2 = OBJECT_MCCOY;
- walkCrewman(_roomVar.love2.d2, 0x46, 0xae, 13);
+ _roomVar.love.chamberObject = OBJECT_MCCOY;
+ walkCrewman(_roomVar.love.chamberObject, 0x46, 0xae, 13);
}
void Room::love2UseRedshirtOnSynthesizer() {
- _roomVar.love2.d2 = OBJECT_REDSHIRT;
- walkCrewman(_roomVar.love2.d2, 0x46, 0xae, 13);
+ _roomVar.love.chamberObject = OBJECT_REDSHIRT;
+ walkCrewman(_roomVar.love.chamberObject, 0x46, 0xae, 13);
}
void Room::love2CrewmanReachedSynthesizer() {
- Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love2.d2, "usemn");
- loadActorAnim2(_roomVar.love2.d2, anim, -1, -1, 17);
+ Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love.chamberObject, "usemn");
+ loadActorAnim2(_roomVar.love.chamberObject, anim, -1, -1, 17);
}
void Room::love2CrewmanUsedSynthesizer() {
if (_vm->_awayMission.love.gasFeedOn) {
love2UseSynthesizer();
} else {
- if (_roomVar.love2.cb == 3) {
+ if (_roomVar.love.cb == 3) {
if (haveItem(OBJECT_IWRENCH)) {
showText(TX_SPEAKER_SPOCK, TX_LOV2_005);
walkCrewman(OBJECT_SPOCK, 0xa8, 0xb7, 16);
} else
showText(TX_SPEAKER_SPOCK, TX_LOV2_006);
} else {
- _roomVar.love2.cb++;
+ _roomVar.love.cb++;
showText(TX_LOV2N012);
}
}
@@ -582,7 +582,7 @@ bottleFailure:
case SYNTHITEM_NONE: // Water
default:
_vm->_awayMission.love.synthesizerProduct = BOTTLETYPE_H2O;
- strcpy(_roomVar.love2.d8, "btle3");
+ strcpy(_roomVar.love.chamberOutputAnim, "btle3");
produceBottle:
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 3); // -> love2SynthesizerDoorClosed
playSoundEffectIndex(SND_DOOR1);
@@ -622,7 +622,7 @@ inertMatterFailure:
case SYNTHITEM_NONE: // Ammonia
default:
_vm->_awayMission.love.synthesizerProduct = BOTTLETYPE_NH3;
- strcpy(_roomVar.love2.d8, "btle2");
+ strcpy(_roomVar.love.chamberOutputAnim, "btle2");
goto produceBottle;
}
} else if (c1 == CANTYPE_O2 && c2 == CANTYPE_N2) {
@@ -645,7 +645,7 @@ inertMatterFailure:
case SYNTHITEM_NONE: // Laughing gas
default:
_vm->_awayMission.love.synthesizerProduct = BOTTLETYPE_N2O;
- strcpy(_roomVar.love2.d8, "btle1");
+ strcpy(_roomVar.love.chamberOutputAnim, "btle1");
goto produceBottle;
}
}
@@ -663,7 +663,7 @@ inertMatterFailure:
void Room::love2SynthesizerDoorClosed() {
playVoc("LD1SCAN");
- loadActorAnim(OBJECT_SYNTHESIZER_OUTPUT, _roomVar.love2.d8, 0x8a, 0x8d, 4); // -> love2SynthesizerFinished
+ loadActorAnim(OBJECT_SYNTHESIZER_OUTPUT, _roomVar.love.chamberOutputAnim, 0x8a, 0x8d, 4); // -> love2SynthesizerFinished
_vm->_awayMission.love.field35 = SYNTHITEM_BOTTLE;
}
@@ -704,7 +704,7 @@ void Room::love2SynthesizerFinished() {
void Room::love2ClosedSynthesizerDoorMakingRLG() {
_vm->_awayMission.love.synthesizerProduct = BOTTLETYPE_RLG;
- strcpy(_roomVar.love2.d8, "btle4");
+ strcpy(_roomVar.love.chamberOutputAnim, "btle4");
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 3); // -> love2SynthesizerDoorClosed
playSoundEffectIndex(SND_DOOR1);
}
diff --git a/engines/startrek/rooms/love3.cpp b/engines/startrek/rooms/love3.cpp
index 0ac2885..d562d69 100644
--- a/engines/startrek/rooms/love3.cpp
+++ b/engines/startrek/rooms/love3.cpp
@@ -57,14 +57,14 @@ void Room::love3Tick1() {
else
loadActorAnim(OBJECT_SERVICE_PANEL, "s3r4d2", 1, 0, 0);
- if (_vm->_awayMission.love.field2c)
+ if (_vm->_awayMission.love.releasedHumanLaughingGas)
_vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.field2d)
+ if (_vm->_awayMission.love.releasedRomulanLaughingGas)
_vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
_vm->_awayMission.timers[2] = 200;
- _roomVar.love3._188e = 0xb4;
- _roomVar.love3._188f = 0xb7;
+ _roomVar.love.cmnXPosToCureSpock = 0xb4;
+ _roomVar.love.cmnYPosToCureSpock = 0xb7;
}
void Room::love3Tick80() {
@@ -183,28 +183,28 @@ void Room::love3UseSTricorderAnywhere() {
}
void Room::love3UseKirkOnServicePanel() {
- _roomVar.love3.activeCrewman = OBJECT_KIRK;
- walkCrewman(_roomVar.love3.activeCrewman, 0x104, 0xae, 1);
+ _roomVar.love.activeCrewman = OBJECT_KIRK;
+ walkCrewman(_roomVar.love.activeCrewman, 0x104, 0xae, 1);
}
void Room::love3UseSpockOnServicePanel() {
- _roomVar.love3.activeCrewman = OBJECT_SPOCK;
- walkCrewman(_roomVar.love3.activeCrewman, 0x104, 0xae, 1);
+ _roomVar.love.activeCrewman = OBJECT_SPOCK;
+ walkCrewman(_roomVar.love.activeCrewman, 0x104, 0xae, 1);
}
void Room::love3UseMccoyOnServicePanel() {
- _roomVar.love3.activeCrewman = OBJECT_MCCOY;
- walkCrewman(_roomVar.love3.activeCrewman, 0x104, 0xae, 1);
+ _roomVar.love.activeCrewman = OBJECT_MCCOY;
+ walkCrewman(_roomVar.love.activeCrewman, 0x104, 0xae, 1);
}
void Room::love3UseRedshirtOnServicePanel() {
- _roomVar.love3.activeCrewman = OBJECT_REDSHIRT;
- walkCrewman(_roomVar.love3.activeCrewman, 0x104, 0xae, 1);
+ _roomVar.love.activeCrewman = OBJECT_REDSHIRT;
+ walkCrewman(_roomVar.love.activeCrewman, 0x104, 0xae, 1);
}
void Room::love3CrewmanReachedServicePanel() {
- Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love3.activeCrewman, "usehe");
- loadActorAnim2(_roomVar.love3.activeCrewman, anim, -1, -1, 1);
+ Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love.activeCrewman, "usehe");
+ loadActorAnim2(_roomVar.love.activeCrewman, anim, -1, -1, 1);
}
void Room::love3OpenedOrClosedServicePanel() {
diff --git a/engines/startrek/rooms/love4.cpp b/engines/startrek/rooms/love4.cpp
index e1cfcf3..6aad01e 100644
--- a/engines/startrek/rooms/love4.cpp
+++ b/engines/startrek/rooms/love4.cpp
@@ -49,13 +49,16 @@ void Room::love4Tick1() {
loadActorAnim2(OBJECT_ROMULAN_4, "s3r5r4a", 0x12a, 0xaa, 0);
}
- if (_vm->_awayMission.love.field2c)
+ if (_vm->_awayMission.love.releasedHumanLaughingGas)
_vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.field2d)
+ if (_vm->_awayMission.love.releasedRomulanLaughingGas)
_vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
_vm->_awayMission.timers[2] = 200;
loadActorAnim(OBJECT_DOOR, "s3r5d1a", 0x90, 0x99, 0);
+
+ _roomVar.love.cmnXPosToCureSpock = 0x6b;
+ _roomVar.love.cmnYPosToCureSpock = 0xb2;
}
void Room::love4Tick10() {
@@ -67,21 +70,21 @@ void Room::love4Tick10() {
void Room::love4WalkToDoor() {
_vm->_awayMission.disableInput = true;
- _roomVar.love4.walkingToDoor = true;
+ _roomVar.love.walkingToDoor = true;
walkCrewmanC(OBJECT_KIRK, 0x91, 0x9c, &Room::love4DoorOpenedOrReached);
}
// Triggers the door opening
void Room::love4TouchedHotspot0() {
- if (_roomVar.love4.walkingToDoor) {
+ if (_roomVar.love.walkingToDoor) {
loadActorAnimC(OBJECT_DOOR, "s3r5d1", 0x90, 0x99, &Room::love4DoorOpenedOrReached);
playSoundEffectIndex(SND_DOOR1);
}
}
void Room::love4DoorOpenedOrReached() {
- _roomVar.love4.doorOpenCounter++;
- if (_roomVar.love4.doorOpenCounter == 2)
+ _roomVar.love.doorOpenCounter++;
+ if (_roomVar.love.doorOpenCounter == 2)
loadRoomIndex(5, 1);
}
@@ -232,7 +235,7 @@ void Room::love4MccoyCuredRomulan1() {
loadActorAnim2(OBJECT_ROMULAN_1, "s3r5r1", 0x36, 0xb3, 0);
showText(TX_LOV4N005);
- if (!_roomVar.love4.gaveWaterToRomulans)
+ if (!_roomVar.love.gaveWaterToRomulans)
showText(TX_LOV4_023);
_vm->_awayMission.disableInput = false;
@@ -246,7 +249,7 @@ void Room::love4UseWaterOnRomulan() {
if (!_vm->_awayMission.love.romulansCured)
showText(TX_SPEAKER_MCCOY, TX_LOV4_009);
else {
- _roomVar.love4.gaveWaterToRomulans = true;
+ _roomVar.love.gaveWaterToRomulans = true;
if (_vm->_awayMission.love.romulansCured) {
showText(TX_LOV4N013);
showText(TX_SPEAKER_MCCOY, TX_LOV4_026);
diff --git a/engines/startrek/rooms/love5.cpp b/engines/startrek/rooms/love5.cpp
index 9a0cd8d..26708a8 100644
--- a/engines/startrek/rooms/love5.cpp
+++ b/engines/startrek/rooms/love5.cpp
@@ -51,9 +51,9 @@ void Room::love5Tick1() {
else
loadActorAnim(OBJECT_PREAX, "s3r6r2", 0x116, 0xba);
- if (_vm->_awayMission.love.field2c)
+ if (_vm->_awayMission.love.releasedHumanLaughingGas)
_vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.field2d)
+ if (_vm->_awayMission.love.releasedRomulanLaughingGas)
_vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
_vm->_awayMission.timers[2] = 200;
}
@@ -232,13 +232,13 @@ void Room::love5EndMission() {
if (!_vm->_awayMission.redshirtDead) {
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
walkCrewmanC(OBJECT_REDSHIRT, 0x69, 0xae, &Room::love5CrewmanReachedBeamoutPosition);
- _roomVar.love5.numCrewmenReadyToBeamOut--;
+ _roomVar.love.numCrewmenReadyToBeamOut--;
}
}
void Room::love5CrewmanReachedBeamoutPosition() {
- _roomVar.love5.numCrewmenReadyToBeamOut++;
- if (_roomVar.love5.numCrewmenReadyToBeamOut == 3) {
+ _roomVar.love.numCrewmenReadyToBeamOut++;
+ if (_roomVar.love.numCrewmenReadyToBeamOut == 3) {
_vm->_awayMission.love.missionScore += 17;
endMission(_vm->_awayMission.love.missionScore, 0x2c, 0);
}
diff --git a/engines/startrek/rooms/lovea.cpp b/engines/startrek/rooms/lovea.cpp
new file mode 100644
index 0000000..59e0bb7
--- /dev/null
+++ b/engines/startrek/rooms/lovea.cpp
@@ -0,0 +1,253 @@
+/* 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.
+ *
+ */
+
+// Common code for all rooms in LOVE mission.
+// TODO: from a cursory glance, this seems to be different in the floppy version?
+
+#include "startrek/room.h"
+
+namespace StarTrek {
+
+// Mccoy or Ferris say something under effects of laughing gas
+void Room::loveaTimer0Expired() {
+ const TextRef ferrisText[] = {
+ TX_LOV0_039,
+ TX_LOV0_048,
+ TX_LOV0_045,
+ TX_LOV0_040,
+ TX_LOV0_042,
+ TX_LOV0_050,
+ TX_LOV0_043,
+ TX_LOV0_041,
+ TX_LOV0_047,
+ TX_LOV0_046,
+ TX_LOV0_039
+ };
+
+ const TextRef mccoyText[] = {
+ TX_LOV0_011,
+ TX_LOV0_020,
+ TX_LOV0_016,
+ TX_LOV0_012,
+ TX_LOV0_014,
+ TX_LOV0_022,
+ TX_LOV0_015,
+ TX_LOV0_021,
+ TX_LOV0_013,
+ TX_LOV0_019,
+ TX_LOV0_017
+ };
+
+ // BUGFIX: should range from 0-1, not 0-2. Original had "get name errors" when it
+ // rolled a 2.
+ byte randomVal = getRandomWordInRange(0, 1);
+ TextRef speaker;
+
+ const TextRef *textTable;
+
+ if (randomVal == 0 || _vm->_awayMission.redshirtDead) {
+ speaker = TX_SPEAKER_MCCOY;
+ textTable = mccoyText;
+ }
+ else {
+ speaker = TX_SPEAKER_FERRIS;
+ textTable = ferrisText;
+ }
+
+ randomVal = getRandomWordInRange(0, 10);
+
+ showText(speaker, textTable[randomVal]);
+
+ if (!_vm->_awayMission.love.releasedRomulanLaughingGas) {
+ const int spockText[] = {
+ TX_LOV0_029,
+ TX_LOV0_033,
+ TX_LOV0_026,
+ TX_LOV0_124
+ };
+ showText(TX_SPEAKER_SPOCK, spockText[getRandomWordInRange(0, 3)]);
+
+ // BUG(?): This is in an if statement, meaning the human crewmen stop talking from
+ // laughing gas if Spock is under laughing gas effects. Might be intentional, to
+ // reduce "spamming" of text?
+ _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
+ }
+}
+
+// Spock says something under effects of laughing gas
+void Room::loveaTimer1Expired() {
+ const int spockText[] = {
+ TX_LOV0_025,
+ TX_LOV0_101,
+ TX_LOV0_102,
+ TX_LOV0_103,
+ TX_LOV0_104,
+ TX_LOV0_105,
+ TX_LOV0_106,
+ TX_LOV0_107
+ };
+
+ showText(TX_SPEAKER_SPOCK, spockText[getRandomWordInRange(0, 7)]);
+
+ _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
+}
+
+void Room::loveaUseMedkitOnSpock() {
+ if (_vm->_awayMission.love.spockCured)
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_015);
+ else
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_019);
+}
+
+void Room::loveaUseCureSampleOnSpock() {
+ if (_vm->_awayMission.love.spockCured) {
+ walkCrewman(OBJECT_SPOCK, _roomVar.love.cmnXPosToCureSpock, _roomVar.love.cmnYPosToCureSpock, 99);
+ walkCrewman(OBJECT_MCCOY, _roomVar.love.cmnXPosToCureSpock, _roomVar.love.cmnYPosToCureSpock + 10, 99);
+ }
+ else
+ showText(TX_SPEAKER_MCCOY, TX_LOVA_F55);
+}
+
+
+void Room::loveaUseCureOnSpock() {
+ if (_vm->_awayMission.love.spockCured)
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_015);
+ else {
+ walkCrewman(OBJECT_SPOCK, _roomVar.love.cmnXPosToCureSpock, _roomVar.love.cmnYPosToCureSpock, 99);
+ walkCrewman(OBJECT_MCCOY, _roomVar.love.cmnXPosToCureSpock, _roomVar.love.cmnYPosToCureSpock + 10, 99);
+ }
+}
+
+void Room::loveaSpockOrMccoyInPositionToUseCure() {
+ _roomVar.love.spockAndMccoyReadyToUseCure++;
+ if (_roomVar.love.spockAndMccoyReadyToUseCure == 2)
+ loadActorAnim2(OBJECT_MCCOY, "musemn", -1, -1, 99);
+}
+
+void Room::loveaFinishedCuringSpock() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_030);
+ showText(TX_SPEAKER_SPOCK, TX_LOV5_038);
+ showText(TX_SPEAKER_MCCOY, TX_LOV5_027);
+ showText(TX_SPEAKER_SPOCK, TX_LOV5C001);
+}
+
+
+// Timer 2 counts down the time until Spock and the Romulans succumb to the virus.
+// BUG(-ish): once Spock is cured, the romulans will never succumb to the virus.
+void Room::loveaTimer2Expired() {
+ if (!_vm->_awayMission.love.spockCured) {
+ _vm->_awayMission.love.spockInfectionCounter++;
+ if (_vm->_awayMission.love.spockInfectionCounter >= 100) { // Spock succumbs, game over
+ loadActorAnim(OBJECT_SPOCK, "sgetdn", -1, -1, 0);
+ playMidiMusicTracks(2, -1); // FIXME: assembly had no second parameter...?
+ showText(TX_GENER004);
+ showGameOverMenu();
+ }
+ else if (_vm->_awayMission.love.spockInfectionCounter == 15) {
+ showText(TX_SPEAKER_SPOCK, TX_SPOKCOFF);
+ _vm->_awayMission.love.spockInfectionCounter++;
+ }
+ else if (_vm->_awayMission.love.spockInfectionCounter == 30) {
+ showText(TX_SPEAKER_MCCOY, TX_LOVA_F08);
+ _vm->_awayMission.love.spockInfectionCounter++;
+ }
+ else if (_vm->_awayMission.love.spockInfectionCounter == 45) {
+ showText(TX_SPEAKER_SPOCK, TX_SPOKCOFF);
+ _vm->_awayMission.love.spockInfectionCounter++;
+ }
+ else if (_vm->_awayMission.love.spockInfectionCounter == 60) {
+ showText(TX_SPEAKER_SPOCK, TX_LOVA_F54);
+ _vm->_awayMission.love.romulansUnconsciousFromVirus = true;
+ _vm->_awayMission.love.spockInfectionCounter++;
+ }
+ }
+
+ _vm->_awayMission.timers[2] = 200;
+}
+
+void Room::loveaUseMTricorderOnSpock() {
+ // Mccoy doesn't do his animation, I guess because he doesn't know which way to face?
+ // (possible future enhancement?)
+ playSoundEffectIndex(SND_TRICORDER);
+
+ if (_vm->_awayMission.love.spockCured)
+ showText(TX_SPEAKER_MCCOY, TX_LOVA_F01);
+ else if (!_vm->_awayMission.love.knowAboutVirus)
+ showText(TX_SPEAKER_MCCOY, TX_LOVA_F02);
+ else if (_vm->_awayMission.love.spockInfectionCounter < 10)
+ showText(TX_SPEAKER_MCCOY, TX_LOVA_F04);
+ else if (_vm->_awayMission.love.spockInfectionCounter < 30)
+ showText(TX_SPEAKER_MCCOY, TX_LOVA_F03);
+ else if (_vm->_awayMission.love.spockInfectionCounter < 50)
+ showText(TX_SPEAKER_MCCOY, TX_LOVA_F08);
+ else if (_vm->_awayMission.love.spockInfectionCounter < 70) // BUGFIX: < 70 instead of == 70
+ showText(TX_SPEAKER_MCCOY, TX_TUG2_010);
+ else if (_vm->_awayMission.love.spockInfectionCounter < 100)
+ showText(TX_SPEAKER_MCCOY, TX_LOVA_F10);
+ else
+ showText(TX_SPEAKER_MCCOY, TX_LOVA_100);
+}
+
+void Room::loveaUseMTricorderOnHuman() {
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_SPEAKER_MCCOY, TX_LOVA_F07);
+}
+
+void Room::loveaUseRomulanLaughingGas() {
+ showText(TX_LOV2N005);
+ _vm->_awayMission.love.releasedRomulanLaughingGas = true;
+ loseItem(OBJECT_IRLG);
+
+ // BUGFIX: start the effects immediately
+ _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
+}
+
+void Room::loveaUseHumanLaughingGas() {
+ showText(TX_LOV2N005);
+ showText(TX_SPEAKER_SPOCK, TX_MUD2_040);
+ _vm->_awayMission.love.releasedHumanLaughingGas = true;
+ loseItem(OBJECT_IN2O);
+ playMidiMusicTracks(3, -1); // FIXME: assembly had no second parameter...?
+
+ // BUGFIX: start the effects immediately
+ _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
+}
+
+void Room::loveaUseAmmonia() {
+ showText(TX_LOV2N005);
+ // TODO: redshirt says something in floppy edition only
+ loseItem(OBJECT_INH3);
+}
+
+void Room::loveaUseCommunicator() {
+ // There were originally number of branches here, based on whether we've got the cure
+ // and whether we've contacted the enterprise already; but all of them branch to the
+ // exact same code.
+ // TODO: perhaps the floppy edition had different text for each case.
+
+ showText(TX_SPEAKER_KIRK, TX_MUD4_018);
+ showText(TX_SPEAKER_UHURA, TX_BRIDU146);
+ showText(TX_SPEAKER_KIRK, TX_VENA_F41);
+ _vm->_awayMission.love.contactedEnterpriseBeforeCure = true;
+}
+
+}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 7fe0257..b0eb045 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -84,7 +84,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxHasMultipleChoices = false;
_missionToLoad = "LOVE";
- _roomIndexToLoad = 2;
+ _roomIndexToLoad = 0;
for (int i = 0; i < NUM_OBJECTS; i++)
_itemList[i] = g_itemList[i];
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 7ae6b0b..e7a529d 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -29,6 +29,8 @@
namespace StarTrek {
+typedef int32 TextRef;
+
// Text that's loaded from "GROUND.TXT". First 0x40 pieces of text are for items.
enum GroundTextIDs {
// Generic "perform undefined action" text (ie. look at nothing, talk to wall)
@@ -805,20 +807,6 @@ enum GameStringIDs {
TX_LOV0N007,
TX_LOV0N008,
TX_LOV0N009,
- TX_LOVA_100,
- TX_LOVA_F01,
- TX_LOVA_F02,
- TX_LOVA_F03,
- TX_LOVA_F04,
- TX_LOVA_F07,
- TX_LOVA_F08,
- TX_LOVA_F10,
- TX_LOVA_F54,
- TX_LOVA_F55,
- TX_MUD2_040,
- TX_MUD4_018,
- TX_spokcoff,
- TX_VENA_F41,
TX_LOV1_001,
@@ -1157,6 +1145,22 @@ enum GameStringIDs {
TX_LOV5C001, // Custom
+ TX_LOVA_100,
+ TX_LOVA_F01,
+ TX_LOVA_F02,
+ TX_LOVA_F03,
+ TX_LOVA_F04,
+ TX_LOVA_F07,
+ TX_LOVA_F08,
+ TX_LOVA_F10,
+ TX_LOVA_F54,
+ TX_LOVA_F55,
+ TX_MUD2_040,
+ TX_MUD4_018,
+ TX_SPOKCOFF,
+ TX_VENA_F41,
+
+
TX_END
};
@@ -1905,20 +1909,6 @@ const char * const g_gameStrings[] = {
"#LOV0\\LOV0N007#This is a heavily secured door, leading to another section of the station. Its access code has been breached.",
"#LOV0\\LOV0N008#This is a standard door, leading to another room on this deck.",
"#LOV0\\LOV0N009#You are on the bridge of the ARK7.",
- "#LOVA\\LOVA_100#He's dead, Jim.",
- "#LOVA\\LOVA_F01#He's been cured of the Oroborus virus.",
- "#LOVA\\LOVA_F02#I'm picking up some kind of virus. I can't identify it without more information.",
- "#LOVA\\LOVA_F03#He's infected with the virus, Jim.",
- "#LOVA\\LOVA_F04#The virus affects the Romulan-Vulcan genotype, Jim.",
- "#LOVA\\LOVA_F07#All lifesigns are normal.",
- "#LOVA\\LOVA_F08#It's what I was afraid of, Jim. I think spock is getting worse.",
- "#LOVA\\LOVA_F10#He has weak vital signs.",
- "#LOVA\\LOVA_F54#The virus has spread to me, Captain.Isuggestyouconcentrateyoureffortsonthe",
- "#LOVA\\LOVA_F55#Jim, we need to sysnthesize more to make the serum before we can use it.",
- "#MUD2\\MUD2_040#You look troubled, Captain.",
- "#MUD4\\MUD4_018#Kirk to Enterprise ... Kirk to Enterprise.",
- "#sfx\\spokcoff#cough... cough...",
- "#VENA\\VENA_F41#Kirk out.",
"#LOV1\\LOV1_001#When you are finished admiring all the equipment Bones, maybe you can help us figure out what's going on here.",
@@ -2255,6 +2245,22 @@ const char * const g_gameStrings[] = {
"#LOV5\\LOV5N017#The Romulan Preax weakly regains conscienceness, reaching for his weapon.",
"#LOV5\\LOV5N018#The Romulan Preax drinks thirstily and empties the container.",
"(Raises an eyebrow).", // NOTE: no corresponding audio
+
+
+ "#LOVA\\LOVA_100#He's dead, Jim.",
+ "#LOVA\\LOVA_F01#He's been cured of the Oroborus virus.",
+ "#LOVA\\LOVA_F02#I'm picking up some kind of virus. I can't identify it without more information.",
+ "#LOVA\\LOVA_F03#He's infected with the virus, Jim.",
+ "#LOVA\\LOVA_F04#The virus affects the Romulan-Vulcan genotype, Jim.",
+ "#LOVA\\LOVA_F07#All lifesigns are normal.",
+ "#LOVA\\LOVA_F08#It's what I was afraid of, Jim. I think Spock is getting worse.", // TYPO
+ "#LOVA\\LOVA_F10#He has weak vital signs.",
+ "#LOVA\\LOVA_F54#The virus has spread to me, Captain. I suggest you concentrate your efforts on the problem.",
+ "#LOVA\\LOVA_F55#Jim, we need to synthesize more to make the serum before we can use it.", // TYPO
+ "#MUD2\\MUD2_040#You look troubled, Captain.",
+ "#MUD4\\MUD4_018#Kirk to Enterprise ... Kirk to Enterprise.",
+ "#sfx\\spokcoff#cough... cough...",
+ "#VENA\\VENA_F41#Kirk out.",
};
}
Commit: cfb5daa8f07b11178d46ec12787b317d7f9ef312
https://github.com/scummvm/scummvm/commit/cfb5daa8f07b11178d46ec12787b317d7f9ef312
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fixes to textboxes
Center the speaker name, and show the choice number when there are
multiple choices.
Changed paths:
engines/startrek/room.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index f4d9dd8..730d42f 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -254,7 +254,7 @@ int Room::showRoomSpecificText(const char **array) {
Common::String speaker;
byte textColor;
- if (array[0] != nullptr && array[0][0] != '\0') { // TODO
+ if (array[0] != nullptr && array[0][0] != '\0') {
speaker = Common::String(array[0]);
if (speaker.equalsIgnoreCase("Capt. Kirk"))
textColor = TEXTCOLOR_YELLOW;
@@ -276,7 +276,7 @@ int Room::showRoomSpecificText(const char **array) {
else
textColor = TEXTCOLOR_YELLOW;
- return _vm->showText(&StarTrekEngine::readTextFromArray, (uintptr)array, 20, 20, textColor, true, false, false);
+ return _vm->showText(&StarTrekEngine::readTextFromArrayWithChoices, (uintptr)array, 20, 20, textColor, true, false, false);
}
int Room::showText(const TextRef *textIDs) {
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index acd912a..67e09fc 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -92,6 +92,7 @@ struct SavegameMetadata {
const int MAX_MENUBUTTONS = 32;
const int TEXTBOX_WIDTH = 26;
+const int TEXT_CHARS_PER_LINE = TEXTBOX_WIDTH - 2;
const int MAX_TEXTBOX_LINES = 12;
const int MAX_BUFFERED_WALK_ACTIONS = 32;
@@ -312,6 +313,7 @@ private:
public:
const char *getNextTextLine(const char *text, char *line, int lineWidth);
+ String centerTextboxHeader(String headerText);
void getTextboxHeader(String *headerTextOutput, String speakerText, int choiceIndex);
String readTextFromRdf(int choiceIndex, uintptr data, String *headerTextOutput);
String readTextFromBuffer(int choiceIndex, uintptr data, String *headerTextOutput);
@@ -332,6 +334,7 @@ public:
String readLineFormattedText(TextGetterFunc textGetter, uintptr var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numLines);
String readTextFromArray(int choiceIndex, uintptr data, String *headerTextOutput);
+ String readTextFromArrayWithChoices(int choiceIndex, uintptr data, String *headerTextOutput);
// menu.cpp
public:
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 2df5e3b..5472680 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -48,7 +48,7 @@ const char *StarTrekEngine::getNextTextLine(const char *text, char *lineOutput,
if (c == '\n') {
*lineOutput = '\0';
- return text+1;
+ return text + 1;
}
if (c == ' ') {
@@ -59,8 +59,7 @@ const char *StarTrekEngine::getNextTextLine(const char *text, char *lineOutput,
if (c == '\r') {
text++;
charIndex--;
- }
- else {
+ } else {
text++;
*(lineOutput++) = c;
}
@@ -82,7 +81,20 @@ const char *StarTrekEngine::getNextTextLine(const char *text, char *lineOutput,
// In the middle of a word; must go back to the start of it
*lastSpaceOutput = '\0';
- return lastSpaceInput+1;
+ return lastSpaceInput + 1;
+}
+
+String StarTrekEngine::centerTextboxHeader(String headerText) {
+ char text[TEXT_CHARS_PER_LINE + 1];
+ memset(text, ' ', sizeof(text));
+ text[TEXT_CHARS_PER_LINE] = '\0';
+
+ int strlen = headerText.size();
+ strlen = min(strlen, TEXT_CHARS_PER_LINE);
+
+ memcpy(text + (TEXT_CHARS_PER_LINE - strlen) / 2, headerText.c_str(), strlen);
+
+ return Common::String(text);
}
void StarTrekEngine::getTextboxHeader(String *headerTextOutput, String speakerText, int choiceIndex) {
@@ -91,23 +103,20 @@ void StarTrekEngine::getTextboxHeader(String *headerTextOutput, String speakerTe
if (choiceIndex != 0)
header += String::format(" choice %d", choiceIndex);
- if (header.size() > TEXTBOX_WIDTH-2)
- header.erase(TEXTBOX_WIDTH-2);
- while (header.size() < TEXTBOX_WIDTH-2)
- header += ' ';
-
- *headerTextOutput = header;
+ *headerTextOutput = centerTextboxHeader(speakerText);
}
/**
* Text getter for showText which reads from an rdf file.
+ * Not really used, since it would require hardcoding text locations in RDF files.
+ * "readTextFromArrayWithChoices" replaces this.
*/
String StarTrekEngine::readTextFromRdf(int choiceIndex, uintptr data, String *headerTextOutput) {
SharedPtr<Room> room = getRoom();
int rdfVar = (size_t)data;
- uint16 textOffset = room->readRdfWord(rdfVar + (choiceIndex+1)*2);
+ uint16 textOffset = room->readRdfWord(rdfVar + (choiceIndex + 1) * 2);
if (textOffset == 0)
return "";
@@ -118,8 +127,8 @@ String StarTrekEngine::readTextFromRdf(int choiceIndex, uintptr data, String *he
*headerTextOutput = "";
else {
char *speakerText = (char*)&room->_rdfData[speakerOffset];
- if (room->readRdfWord(rdfVar+4) != 0) // Check if there's more than one option
- getTextboxHeader(headerTextOutput, speakerText, choiceIndex+1);
+ if (room->readRdfWord(rdfVar + 4) != 0) // Check if there's more than one option
+ getTextboxHeader(headerTextOutput, speakerText, choiceIndex + 1);
else
getTextboxHeader(headerTextOutput, speakerText, 0);
}
@@ -132,10 +141,8 @@ String StarTrekEngine::readTextFromRdf(int choiceIndex, uintptr data, String *he
* Shows text with the given header and main text.
*/
void StarTrekEngine::showTextbox(String headerText, const String &mainText, int xoffset, int yoffset, byte textColor, int maxTextLines) {
- if (!headerText.empty()) {
- while (headerText.size() < TEXTBOX_WIDTH - 2)
- headerText += ' ';
- }
+ if (!headerText.empty())
+ headerText = centerTextboxHeader(headerText);
int actionParam = (maxTextLines < 0 ? 0 : maxTextLines);
@@ -262,8 +269,7 @@ int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset
_gfx->delSprite(&textboxSprite);
// TODO
- }
- else {
+ } else {
loadMenuButtons("textbtns", xoffset + 0x96, yoffset - 0x11);
Common::Point oldMousePos = _gfx->getMousePos();
@@ -373,8 +379,7 @@ readjustScroll:
choiceIndex--;
if (!loopChoices && choiceIndex == 0) {
disableMenuButtons(1 << TEXTBUTTON_PREVCHOICE);
- }
- else {
+ } else {
if (choiceIndex < 0)
choiceIndex = numChoices-1;
}
@@ -386,8 +391,7 @@ readjustScroll:
choiceIndex++;
if (!loopChoices && choiceIndex == numChoices-1) {
disableMenuButtons(1 << TEXTBUTTON_NEXTCHOICE);
- }
- else {
+ } else {
choiceIndex %= numChoices;
}
goto reloadText;
@@ -397,8 +401,7 @@ reloadText:
lineFormattedText = readLineFormattedText(textGetter, var, choiceIndex, textBitmap, numTextboxLines, &numTextLines);
if (numTextLines <= numTextboxLines) {
setVisibleMenuButtons((1 << TEXTBUTTON_CONFIRM) | (1 << TEXTBUTTON_PREVCHOICE) | (1 << TEXTBUTTON_NEXTCHOICE));
- }
- else {
+ } else {
setVisibleMenuButtons((1 << TEXTBUTTON_CONFIRM) | (1 << TEXTBUTTON_SCROLLUP) | (1 << TEXTBUTTON_SCROLLDOWN)| (1 << TEXTBUTTON_PREVCHOICE) | (1 << TEXTBUTTON_NEXTCHOICE));
}
enableMenuButtons(1 << TEXTBUTTON_SCROLLDOWN);
@@ -563,19 +566,19 @@ void StarTrekEngine::drawMainText(SharedPtr<TextBitmap> bitmap, int numTextLines
numTextLines = numTextboxLines;
if (withHeader)
- dest += TEXTBOX_WIDTH*2; // Start of 4th row
+ dest += TEXTBOX_WIDTH * 2; // Start of 4th row
int lineIndex = 0;
while (lineIndex != numTextLines) {
- memcpy(dest, text, TEXTBOX_WIDTH-2);
- text += TEXTBOX_WIDTH-2;
+ memcpy(dest, text, TEXTBOX_WIDTH - 2);
+ text += TEXTBOX_WIDTH - 2;
dest += TEXTBOX_WIDTH;
lineIndex++;
}
// Fill all remaining blank lines
while (lineIndex != numTextboxLines) {
- memset(dest, ' ', TEXTBOX_WIDTH-2);
+ memset(dest, ' ', TEXTBOX_WIDTH - 2);
dest += TEXTBOX_WIDTH;
lineIndex++;
}
@@ -590,12 +593,10 @@ String StarTrekEngine::readLineFormattedText(TextGetterFunc textGetter, uintptr
text = playTextAudio(text);
if (oldSize != text.size())
_textboxHasMultipleChoices = true;
- }
- else if ((_textDisplayMode == TEXTDISPLAY_WAIT || _textDisplayMode == TEXTDISPLAY_SUBTITLES)
+ } else if ((_textDisplayMode == TEXTDISPLAY_WAIT || _textDisplayMode == TEXTDISPLAY_SUBTITLES)
&& _sfxEnabled && _sfxWorking) {
text = playTextAudio(text);
- }
- else {
+ } else {
text = skipTextAudioPrompt(text);
}
@@ -607,11 +608,10 @@ String StarTrekEngine::readLineFormattedText(TextGetterFunc textGetter, uintptr
String lineFormattedText = putTextIntoLines(text);
drawMainText(textBitmap, *numTextLines, numTextboxLines, lineFormattedText, hasHeader);
- memcpy(textBitmap->pixels+TEXTBOX_WIDTH+1, headerText.c_str(), headerText.size());
+ memcpy(textBitmap->pixels + TEXTBOX_WIDTH + 1, headerText.c_str(), headerText.size());
return lineFormattedText;
- }
- else
+ } else
return nullptr;
/* Barebones implementation
@@ -638,20 +638,43 @@ String StarTrekEngine::readLineFormattedText(TextGetterFunc textGetter, uintptr
* Last element in the array must be an empty string.
*/
String StarTrekEngine::readTextFromArray(int choiceIndex, uintptr data, String *headerTextOutput) {
- const char **textArray = (const char**)data;
+ const char **textArray = (const char **)data;
const char *headerText = textArray[0];
- const char *mainText = textArray[choiceIndex+1];
+ const char *mainText = textArray[choiceIndex + 1];
if (*mainText == '\0')
return Common::String(); // Technically should be nullptr...
if (headerText == nullptr)
*headerTextOutput = "";
- else {
- *headerTextOutput = headerText;
- while (headerTextOutput->size() < TEXTBOX_WIDTH-2)
- *headerTextOutput += ' ';
+ else
+ *headerTextOutput = centerTextboxHeader(headerText);
+ return String(mainText);
+}
+
+/**
+ * Similar to above, but shows the choice index when multiple choices are present.
+ * Effectively replaces the "readTextFromRdf" function.
+ */
+String StarTrekEngine::readTextFromArrayWithChoices(int choiceIndex, uintptr data, String *headerTextOutput) {
+ const char **textArray = (const char **)data;
+
+ const char *headerText = textArray[0];
+ const char *mainText = textArray[choiceIndex + 1];
+
+ if (*mainText == '\0')
+ return Common::String(); // Technically should be nullptr...
+
+ if (headerTextOutput != nullptr) {
+ if (headerText == nullptr || headerText[0] == '\0')
+ *headerTextOutput = "";
+ else {
+ if (textArray[2] != nullptr && textArray[2][0] != '\0') // More than one choice
+ getTextboxHeader(headerTextOutput, headerText, choiceIndex + 1);
+ else
+ getTextboxHeader(headerTextOutput, headerText, 0);
+ }
}
return String(mainText);
}
Commit: e367f9d25ef7b14ea1ed2ec392f41a61cce34c4c
https://github.com/scummvm/scummvm/commit/e367f9d25ef7b14ea1ed2ec392f41a61cce34c4c
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fix swapped McCoy & Spock speaker names
Changed paths:
engines/startrek/awaymission.cpp
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 944e0a2..8889cd6 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -467,11 +467,11 @@ void StarTrekEngine::handleAwayMissionAction() {
case OBJECT_IPHASERK:
if (action.passiveObject() == OBJECT_SPOCK) {
int text = GROUNDTX_PHASER_ON_SPOCK + getRandomWord() % 8;
- showTextbox("Dr. McCoy", getLoadedText(text), 20, 20, TEXTCOLOR_BLUE, 0);
+ showTextbox("Mr. Spock", getLoadedText(text), 20, 20, TEXTCOLOR_BLUE, 0);
}
else if (action.passiveObject() == OBJECT_MCCOY) {
int text = GROUNDTX_PHASER_ON_MCCOY + getRandomWord() % 8;
- showTextbox("Mr. Spock", getLoadedText(text), 20, 20, TEXTCOLOR_BLUE, 0);
+ showTextbox("Dr. McCoy", getLoadedText(text), 20, 20, TEXTCOLOR_BLUE, 0);
}
else if (action.passiveObject() == OBJECT_REDSHIRT) {
Common::String text = getLoadedText(GROUNDTX_PHASER_ON_REDSHIRT + getRandomWord() % 8);
Commit: d4c59661519b7f1fb9f836c649aa10a3b0fe039d
https://github.com/scummvm/scummvm/commit/d4c59661519b7f1fb9f836c649aa10a3b0fe039d
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Add missing "look at grate" action.
Also fix missing subscript for some text relating to N2 gas.
Changed paths:
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/love3.cpp
engines/startrek/text.h
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index c203c34..009913d 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -958,6 +958,7 @@ public:
void love3LookAtRedshirt();
void love3LookAnywhere();
void love3LookAtShaft();
+ void love3LookAtGrate();
void love3LookAtPanel();
void love3LookAtGasTank();
void love3LookAtTurbines();
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 18f7005..71c7087 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1127,6 +1127,7 @@ RoomAction love3ActionList[] = {
{ Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::love3LookAtRedshirt },
{ Action(ACTION_LOOK, -1, 0, 0), &Room::love3LookAnywhere },
{ Action(ACTION_LOOK, 0x22, 0, 0), &Room::love3LookAtShaft },
+ { Action(ACTION_LOOK, 11, 0, 0), &Room::love3LookAtGrate },
{ Action(ACTION_LOOK, 9, 0, 0), &Room::love3LookAtPanel },
{ Action(ACTION_LOOK, 0x20, 0, 0), &Room::love3LookAtPanel },
{ Action(ACTION_LOOK, 12, 0, 0), &Room::love3LookAtGasTank },
@@ -1142,7 +1143,6 @@ RoomAction love3ActionList[] = {
{ Action(ACTION_USE, OBJECT_KIRK, 8, 0), &Room::love3UseKirkOnServicePanel },
{ Action(ACTION_USE, OBJECT_SPOCK, 8, 0), &Room::love3UseSpockOnServicePanel },
{ Action(ACTION_USE, OBJECT_MCCOY, 8, 0), &Room::love3UseMccoyOnServicePanel },
-
{ Action(ACTION_USE, OBJECT_REDSHIRT, 8, 0), &Room::love3UseRedshirtOnServicePanel },
{ Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::love3CrewmanReachedServicePanel },
{ Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::love3OpenedOrClosedServicePanel },
diff --git a/engines/startrek/rooms/love3.cpp b/engines/startrek/rooms/love3.cpp
index d562d69..f7d4af4 100644
--- a/engines/startrek/rooms/love3.cpp
+++ b/engines/startrek/rooms/love3.cpp
@@ -117,6 +117,10 @@ void Room::love3LookAnywhere() {
}
void Room::love3LookAtShaft() {
+ showText(TX_LOV3NA21);
+}
+
+void Room::love3LookAtGrate() {
showText(TX_LOV3N019);
}
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index e7a529d..b140c55 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -1838,9 +1838,9 @@ const char * const g_gameStrings[] = {
"#COMP\\COMPA191#Exit Database",
"#COMP\\COMPA193#TLTDH Gas",
"#COMP\\COMPU186#Ammonia: a colorless pungent compound NH3, a common byproduct of metabolism in carbon-based lifeforms. Liquid or gaseous at 1 atm. Compounds widely used in agricultural, medical and industrial applications.",
- "#COMP\\COMPU187#Di-hydrogen Oxide: a colorless, tasteless, nonflammable compound HO- water. Liquid, solid, or gaseous at 1 atm. Temperature scales defined in most humanoid cultures by state-shift of pure water.",
+ "#COMP\\COMPU187#Di-hydrogen Oxide: a colorless, tasteless, nonflammable compound HO- water. Liquid, solid, or gaseous at 1 atm. Temperature scales defined in most humanoid cultures by state-shift of pure water.",
"#COMP\\COMPU188#Dr. Marcus' Log, Supplemental: Continued testing of the Oroborus Virus confirms its potential harmful effects on Romulan/Vulcan humanoids. As soon as the spill has been cleaned up, we will sterilize both labs and purge the circulation system to make sure no traces of the virus will remain viable. Then all research files must be erased -- we must leave no chance that this terrible accident will ever be repeated.",
- "#COMP\\COMPU189#Nitrous Oxide: a colorless nonflammable compound NO, gaseous at 1 atm and temperatures within the human norm. Early anesthetic among humans, in whom it produces laughter, feelings of exhiliration, euphoria; sometimes leading to unconsciousness.",
+ "#COMP\\COMPU189#Nitrous Oxide: a colorless nonflammable compound NO, gaseous at 1 atm and temperatures within the human norm. Early anesthetic among humans, in whom it produces laughter, feelings of exhiliration, euphoria; sometimes leading to unconsciousness.",
"#COMP\\COMPU190#Oroborus virus: Atypical growth patterns for L-Type virus. Opportunistic pneumococcal mimic affecting Romulo-Vulcan genotype. Etiology: contact or airborne vector with alveoli microcollapse involvement immediately upon exposure. Tissue dehydration follows pneumal flooding. Mortality: 0.6 in 1.0 stardates, 1.0 within 2.0 stardates Treatment: none. Named for the mythic worldsnake that swallows its own tail.",
"#COMP\\COMPU192#Please select subject file...",
"#COMP\\COMPU193#TLTDH gas: The chemical compound tantalum bi-lithium thalo-dihydroxide. Colorless, odorless, nonflammable gaseous at 1 atm and temperatures within the human norm. Early anesthetic among Vulcans and Romulans, in whom it produces laughter, feelings of exhiliration, euphoria; sometimes leading to unconsciousness. In post-industrial/pre-spaceflight era, a social problem evolved when crude TLTDH became popular to \"cook up\" from non-conductive tantalo-lithial compounds commonly used as electrical insulation.",
@@ -2009,9 +2009,9 @@ const char * const g_gameStrings[] = {
"#LOV2\\LOV2_043#I hope you don't want me to swab the deck with that, Captain.",
"#LOV2\\LOV2N000#You already have the ?.",
"#LOV2\\LOV2N001#A door.",
- "#LOV2\\LOV2N002#A gas tank marked 'H2'.", // TYPO
- "#LOV2\\LOV2N003#A gas tank marked 'N2',", // TYPO
- "#LOV2\\LOV2N004#A gas tank marked 'O2'.", // TYPO
+ "#LOV2\\LOV2N002#A gas tank marked 'H'.",
+ "#LOV2\\LOV2N003#A gas tank marked 'N',",
+ "#LOV2\\LOV2N004#A gas tank marked 'O'.",
"#LOV2\\LOV2N005#A loud hissing fills the room.",
"#LOV2\\LOV2N006#A small field-effect anti-gravity unit, useful for moving things too heavy to lift and carry by muscle alone.",
"#LOV2\\LOV2N007#Gas feed is off.",
@@ -2088,7 +2088,7 @@ const char * const g_gameStrings[] = {
"#LOV3\\LOV3N003#Kirk is looking closely at the equipment.",
"#LOV3\\LOV3N004#Lt. Ferris is carefully watching the hallway",
"#LOV3\\LOV3N005#McCoy is fidgeting around.",
- "#LOV3\\LOV3N006#N gas tank.", // FIXME: N2 (with superscript)
+ "#LOV3\\LOV3N006#N gas tank.",
"#LOV3\\LOV3N007#The tank is too heavy to move by muscle alone.",
"#LOV3\\LOV3N008#Spock is analyzing the surroundings.",
"#LOV3\\LOV3N009#The air vent becomes wet.",
@@ -2104,7 +2104,7 @@ const char * const g_gameStrings[] = {
"#LOV3\\LOV3N019#This is a screen and filter for the ventilation shaft.",
"#LOV3\\LOV3N020#The panel closes.",
"#LOV3\\LOV3N021#The panel is open. You see vast quantities of dust and stripped insulation from wiring repairs made to the console in the past.",
- "#LOV3\\LOV3N022#The panel opens. You see a gas tank labeled N, with its feed lines running deeper into the wall.", // FIXME: N2 (with superscript)
+ "#LOV3\\LOV3N022#The panel opens. You see a gas tank labeled N, with its feed lines running deeper into the wall.",
"#LOV3\\LOV3N023#The panel opens.",
"#LOV3\\LOV3N024#This is the engineering room. All appears normal.",
"#LOV3\\LOV3N025#This vent is currently closed.",
Commit: 37e6a886c10d7345b9bf9e5299a081b3d56e803e
https://github.com/scummvm/scummvm/commit/37e6a886c10d7345b9bf9e5299a081b3d56e803e
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Right-clicking & keyboard in menus
Changed paths:
engines/startrek/menu.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index 4de519d..d712518 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -158,8 +158,7 @@ void StarTrekEngine::chooseMousePositionFromSprites(Sprite *sprites, int numSpri
if (mouseX1 != 0x7fff) {
mousePos.x = mouseX1;
mousePos.y = mouseY1;
- }
- else if (mouseX2 != 0x7fff) {
+ } else if (mouseX2 != 0x7fff) {
mousePos.x = mouseX2;
mousePos.y = mouseY2;
}
@@ -212,8 +211,7 @@ void StarTrekEngine::showOptionsMenu(int x, int y) {
disabledButtons |= (1 << OPTIONBUTTON_ENABLEMUSIC);
else
disabledButtons |= (1 << OPTIONBUTTON_DISABLEMUSIC);
- }
- else
+ } else
disabledButtons |= (1 << OPTIONBUTTON_ENABLEMUSIC) | (1 << OPTIONBUTTON_DISABLEMUSIC);
if (_sfxWorking) {
@@ -221,8 +219,7 @@ void StarTrekEngine::showOptionsMenu(int x, int y) {
disabledButtons |= (1 << OPTIONBUTTON_ENABLESFX);
else
disabledButtons |= (1 << OPTIONBUTTON_DISABLESFX);
- }
- else
+ } else
disabledButtons |= (1 << OPTIONBUTTON_ENABLESFX) | (1 << OPTIONBUTTON_DISABLESFX);
disableMenuButtons(disabledButtons);
@@ -376,28 +373,23 @@ mousePosChanged:
action = ACTION_OPTIONS;
bitmapName = "options";
lockMousePoint = Common::Point(pos.x + 44, pos.y + 2);
- }
- else if (relMouse.x >= 18 && relMouse.x <= 38 && relMouse.y >= 2 && relMouse.y <= 9) {
+ } else if (relMouse.x >= 18 && relMouse.x <= 38 && relMouse.y >= 2 && relMouse.y <= 9) {
action = ACTION_LOOK;
bitmapName = "look";
lockMousePoint = Common::Point(pos.x + 28, pos.y + 6);
- }
- else if (relMouse.x >= 18 && relMouse.x <= 38 && relMouse.y >= 11 && relMouse.y <= 17) {
+ } else if (relMouse.x >= 18 && relMouse.x <= 38 && relMouse.y >= 11 && relMouse.y <= 17) {
action = ACTION_TALK;
bitmapName = "talk";
lockMousePoint = Common::Point(pos.x + 27, pos.y + 14);
- }
- else if (relMouse.x >= 2 && relMouse.x <= 13 && relMouse.y >= 16 && relMouse.y <= 26) {
+ } else if (relMouse.x >= 2 && relMouse.x <= 13 && relMouse.y >= 16 && relMouse.y <= 26) {
action = ACTION_USE;
bitmapName = "use";
lockMousePoint = Common::Point(pos.x + 7, pos.y + 19);
- }
- else if (relMouse.x >= 40 && relMouse.x <= 53 && relMouse.y >= 34 && relMouse.y <= 43) {
+ } else if (relMouse.x >= 40 && relMouse.x <= 53 && relMouse.y >= 34 && relMouse.y <= 43) {
action = ACTION_GET;
bitmapName = "get";
lockMousePoint = Common::Point(pos.x + 44, pos.y + 38);
- }
- else {
+ } else {
action = ACTION_WALK;
bitmapName = "walk";
}
@@ -497,7 +489,7 @@ lookupNextAction:
}
}
- playSoundEffectIndex(0x10);
+ playSoundEffectIndex(SND_SELECTION);
menuSprite.dontDrawNextFrame();
_gfx->drawAllSprites();
@@ -514,8 +506,7 @@ lookupNextAction:
if (mouse.x < pos.x || mouse.x >= pos.x + menuWidth || mouse.y < pos.y || mouse.y >= pos.y + menuHeight) {
if (action == ACTION_WALK && addEventBack)
addEventToQueue(event); // Add left-click event back to queue so Kirk can walk there
- }
- else
+ } else
_gfx->warpMouse(oldMousePos.x, oldMousePos.y);
chooseMouseBitmapForAction(action, false);
@@ -593,8 +584,7 @@ void StarTrekEngine::setVisibleMenuButtons(uint32 bits) {
sprite->field16 = true;
sprite->bitmapChanged = true;
}
- }
- else {
+ } else {
_gfx->addSprite(sprite);
sprite->drawMode = 2;
sprite->bitmapChanged = true;
@@ -642,9 +632,7 @@ void StarTrekEngine::enableMenuButtons(uint32 bits) {
* This returns either a special menu event (negative number) or the retval of the button
* clicked (usually an index, always positive).
*/
-int StarTrekEngine::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4) {
- // TODO: finish
-
+int StarTrekEngine::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool inTextbox) {
uint32 tickWhenClickingEnabled = _clockTicks + ticksUntilClickingEnabled;
while (true) {
@@ -696,29 +684,177 @@ int StarTrekEngine::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4
}
case TREKEVENT_LBUTTONDOWN:
+lclick:
if (_activeMenu->selectedButton != -1) {
- playSoundEffectIndex(0x10);
+ playSoundEffectIndex(SND_SELECTION);
return _activeMenu->retvals[_activeMenu->selectedButton];
- }
- else {
+ } else {
Common::Point mouse = _gfx->getMousePos();
if (getMenuButtonAt(_activeMenu->sprites, _activeMenu->numButtons, mouse.x, mouse.y) == -1) {
- playSoundEffectIndex(0x10);
+ playSoundEffectIndex(SND_SELECTION);
return MENUEVENT_LCLICK_OFFBUTTON;
}
}
break;
case TREKEVENT_RBUTTONDOWN:
- // TODO
+rclick:
+ playSoundEffectIndex(SND_SELECTION);
+ if (_activeMenu->selectedButton == -1)
+ return MENUEVENT_RCLICK_OFFBUTTON;
+ else
+ return MENUEVENT_RCLICK_ONBUTTON;
break;
case TREKEVENT_KEYDOWN:
- // TODO
- break;
+ if (inTextbox) {
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_ESCAPE:
+ case Common::KEYCODE_F2:
+ goto rclick;
+
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ case Common::KEYCODE_F1:
+ playSoundEffectIndex(SND_SELECTION);
+ return TEXTBUTTON_CONFIRM;
+
+ case Common::KEYCODE_SPACE:
+ if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_NEXTCHOICE))
+ && _activeMenu->sprites[TEXTBUTTON_NEXTCHOICE].drawMode == 2) {
+ playSoundEffectIndex(SND_SELECTION);
+ return TEXTBUTTON_NEXTCHOICE;
+ }
+ break;
+
+ case Common::KEYCODE_HOME:
+ case Common::KEYCODE_KP7:
+ if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_SCROLLUP))
+ && _activeMenu->sprites[TEXTBUTTON_SCROLLUP].drawMode == 2) {
+ playSoundEffectIndex(SND_SELECTION);
+ return TEXTBUTTON_GOTO_TOP;
+ }
+ break;
+
+ case Common::KEYCODE_UP:
+ case Common::KEYCODE_KP8:
+ if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_SCROLLUP))
+ && _activeMenu->sprites[TEXTBUTTON_SCROLLUP].drawMode == 2) {
+ playSoundEffectIndex(SND_SELECTION);
+ return TEXTBUTTON_SCROLLUP_ONELINE;
+ }
+ break;
+
+ case Common::KEYCODE_PAGEUP:
+ case Common::KEYCODE_KP9:
+ if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_SCROLLUP))
+ && _activeMenu->sprites[TEXTBUTTON_SCROLLUP].drawMode == 2) {
+ playSoundEffectIndex(SND_SELECTION);
+ return TEXTBUTTON_SCROLLUP;
+ }
+ break;
+
+ case Common::KEYCODE_LEFT:
+ case Common::KEYCODE_KP4:
+ if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_PREVCHOICE))
+ && _activeMenu->sprites[TEXTBUTTON_PREVCHOICE].drawMode == 2) {
+ playSoundEffectIndex(SND_SELECTION);
+ return TEXTBUTTON_PREVCHOICE;
+ }
+ break;
+
+ case Common::KEYCODE_RIGHT:
+ case Common::KEYCODE_KP6:
+ if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_NEXTCHOICE))
+ && _activeMenu->sprites[TEXTBUTTON_NEXTCHOICE].drawMode == 2) {
+ playSoundEffectIndex(SND_SELECTION);
+ return TEXTBUTTON_NEXTCHOICE;
+ }
+ break;
+
+ case Common::KEYCODE_END:
+ case Common::KEYCODE_KP1:
+ if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_SCROLLDOWN))
+ && _activeMenu->sprites[TEXTBUTTON_SCROLLDOWN].drawMode == 2) {
+ playSoundEffectIndex(SND_SELECTION);
+ return TEXTBUTTON_GOTO_BOTTOM;
+ }
+ break;
+
+ case Common::KEYCODE_DOWN:
+ case Common::KEYCODE_KP2:
+ if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_SCROLLDOWN))
+ && _activeMenu->sprites[TEXTBUTTON_SCROLLDOWN].drawMode == 2) {
+ playSoundEffectIndex(SND_SELECTION);
+ return TEXTBUTTON_SCROLLDOWN_ONELINE;
+ }
+ break;
+
+ case Common::KEYCODE_PAGEDOWN:
+ case Common::KEYCODE_KP3:
+ if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_SCROLLDOWN))
+ && _activeMenu->sprites[TEXTBUTTON_SCROLLDOWN].drawMode == 2) {
+ playSoundEffectIndex(SND_SELECTION);
+ return TEXTBUTTON_SCROLLDOWN;
+ }
+ break;
+
+ default:
+ break;
+ }
+ } else { // Not in textbox
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_ESCAPE:
+ case Common::KEYCODE_F2:
+ goto rclick;
+
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ case Common::KEYCODE_F1:
+ goto lclick;
+
+ case Common::KEYCODE_HOME:
+ case Common::KEYCODE_KP7:
+ chooseMousePositionFromSprites(_activeMenu->sprites, _activeMenu->numButtons, _activeMenu->selectedButton, 4);
+ break;
+
+ case Common::KEYCODE_UP:
+ case Common::KEYCODE_KP8:
+ case Common::KEYCODE_PAGEUP:
+ case Common::KEYCODE_KP9:
+ chooseMousePositionFromSprites(_activeMenu->sprites, _activeMenu->numButtons, _activeMenu->selectedButton, 2);
+ break;
+
+ case Common::KEYCODE_LEFT:
+ case Common::KEYCODE_KP4:
+ chooseMousePositionFromSprites(_activeMenu->sprites, _activeMenu->numButtons, _activeMenu->selectedButton, 1);
+ break;
+
+ case Common::KEYCODE_RIGHT:
+ case Common::KEYCODE_KP6:
+ chooseMousePositionFromSprites(_activeMenu->sprites, _activeMenu->numButtons, _activeMenu->selectedButton, 0);
+ break;
+
+ case Common::KEYCODE_END:
+ case Common::KEYCODE_KP1:
+ chooseMousePositionFromSprites(_activeMenu->sprites, _activeMenu->numButtons, _activeMenu->selectedButton, 5);
+ break;
+
+ case Common::KEYCODE_DOWN:
+ case Common::KEYCODE_KP2:
+ case Common::KEYCODE_PAGEDOWN:
+ case Common::KEYCODE_KP3:
+ chooseMousePositionFromSprites(_activeMenu->sprites, _activeMenu->numButtons, _activeMenu->selectedButton, 3);
+ break;
+
+ default:
+ break;
+ }
+ break;
- default:
- break;
+ default:
+ break;
+ }
}
}
}
@@ -789,8 +925,7 @@ void StarTrekEngine::chooseMouseBitmapForAction(int action, bool withRedOutline)
if ((getRandomWord() & 7) == 0)
_lookActionBitmapIndex = getRandomWord() & 7; // Choose an image randomly
bitmapName = lookActionBitmaps[_lookActionBitmapIndex];
- }
- else
+ } else
bitmapName = "lookn";
break;
@@ -800,8 +935,7 @@ void StarTrekEngine::chooseMouseBitmapForAction(int action, bool withRedOutline)
bitmapName = "talkh0";
else
bitmapName = "talkh1";
- }
- else
+ } else
bitmapName = "talkn";
break;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 67e09fc..8f17a0f 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -347,7 +347,7 @@ public:
void setVisibleMenuButtons(uint32 bits);
void disableMenuButtons(uint32 bits);
void enableMenuButtons(uint32 bits);
- int handleMenuEvents(uint32 ticksUntilClickingEnabled, bool arg4);
+ int handleMenuEvents(uint32 ticksUntilClickingEnabled, bool inTextbox);
void unloadMenuButtons();
void chooseMouseBitmapForAction(int action, bool withRedOutline);
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 5472680..28b465f 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -291,12 +291,11 @@ int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset
disableMenuButtons(1 << TEXTBUTTON_SCROLLUP); // Disable scroll up
- if (ticksUntilClickingEnabled == 0) { // Disable done button
+ if (ticksUntilClickingEnabled != 0) // Disable done button
disableMenuButtons(1 << TEXTBUTTON_CONFIRM);
- }
- if (!loopChoices) { // Disable prev button
+
+ if (!loopChoices) // Disable prev button
disableMenuButtons(1 << TEXTBUTTON_PREVCHOICE);
- }
bool doneShowingText = false;
@@ -304,9 +303,8 @@ int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset
while (!doneShowingText) {
int textboxReturnCode = handleMenuEvents(ticksUntilClickingEnabled, true);
- if (ticksUntilClickingEnabled == 0) {
+ if (ticksUntilClickingEnabled != 0)
enableMenuButtons(1 << TEXTBUTTON_CONFIRM);
- }
switch(textboxReturnCode) {
Commit: 62cd8e4730582f35c42f7f3eb79394325042137e
https://github.com/scummvm/scummvm/commit/62cd8e4730582f35c42f7f3eb79394325042137e
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement keybindings on away missions
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/startrek.cpp
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 8889cd6..a5cf80a 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -164,6 +164,7 @@ void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) {
void StarTrekEngine::handleAwayMissionEvents() {
TrekEvent event;
+ int clickedObject = -1;
if (popNextEvent(&event)) {
switch (event.type) {
@@ -184,6 +185,7 @@ void StarTrekEngine::handleAwayMissionEvents() {
break;
case TREKEVENT_LBUTTONDOWN:
+lclick:
if (_awayMission.disableInput)
break;
@@ -196,7 +198,7 @@ void StarTrekEngine::handleAwayMissionEvents() {
_mccoyActor->sprite.drawMode = 1;
_redshirtActor->sprite.drawMode = 1;
- int clickedObject = findObjectAt(_gfx->getMousePos());
+ clickedObject = findObjectAt(_gfx->getMousePos());
_kirkActor->sprite.drawMode = 0;
_spockActor->sprite.drawMode = 0;
@@ -223,12 +225,13 @@ void StarTrekEngine::handleAwayMissionEvents() {
break;
}
- int clickedObject = findObjectAt(_gfx->getMousePos());
+ clickedObject = findObjectAt(_gfx->getMousePos());
hideInventoryIcons();
if (clickedObject == OBJECT_INVENTORY_ICON) {
clickedObject = showInventoryMenu(50, 50, false);
+useInventory:
// -1 means "clicked on something unknown"; -2 means "clicked on
// nothing". In the case of the inventory, either one clicks on an
// inventory item, or no action is performed.
@@ -295,12 +298,13 @@ checkShowInventory:
case ACTION_GET:
case ACTION_LOOK:
case ACTION_TALK: {
- int clickedObject = findObjectAt(_gfx->getMousePos());
- // if (!sub_23611(clickedObject, _awayMission.activeAction)) // TODO
- {
+ clickedObject = findObjectAt(_gfx->getMousePos());
+ if (!isObjectUnusable(clickedObject, _awayMission.activeAction)) {
hideInventoryIcons();
+
if (clickedObject == OBJECT_INVENTORY_ICON) {
clickedObject = showInventoryMenu(50, 50, false);
+lookInventory:
if (clickedObject == -1)
clickedObject = -2;
}
@@ -325,14 +329,17 @@ checkShowInventory:
case TREKEVENT_MOUSEMOVE:
break;
- case TREKEVENT_RBUTTONDOWN: // TODO: also triggered by key press?
+ case TREKEVENT_RBUTTONDOWN:
+rclick:
if (_awayMission.disableInput)
break;
hideInventoryIcons();
playSoundEffectIndex(0x07);
_awayMission.activeAction = showActionMenu();
+
+checkSelectedAction:
if (_awayMission.activeAction == ACTION_USE) {
- int16 clickedObject = selectObjectForUseAction();
+ clickedObject = selectObjectForUseAction();
if (clickedObject == -1)
break;
else
@@ -352,7 +359,63 @@ checkShowInventory:
showInventoryIcons(true);
break;
- case TREKEVENT_KEYDOWN: // TODO
+ case TREKEVENT_KEYDOWN:
+ if (_awayMission.disableInput)
+ break;
+
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_ESCAPE:
+ case Common::KEYCODE_SPACE:
+ case Common::KEYCODE_F2:
+ goto rclick;
+
+ case Common::KEYCODE_w:
+ hideInventoryIcons();
+ _awayMission.activeAction = ACTION_WALK;
+ break;
+
+ case Common::KEYCODE_t:
+ hideInventoryIcons();
+ _awayMission.activeAction = ACTION_TALK;
+ goto checkSelectedAction;
+
+ case Common::KEYCODE_u:
+ hideInventoryIcons();
+ _awayMission.activeAction = ACTION_USE;
+ goto checkSelectedAction;
+
+ case Common::KEYCODE_i:
+ if (_awayMission.activeAction == ACTION_USE) {
+ hideInventoryIcons();
+ clickedObject = showInventoryMenu(50, 50, true);
+ goto useInventory;
+ }
+ else if (_awayMission.activeAction == ACTION_LOOK) {
+ hideInventoryIcons();
+ clickedObject = showInventoryMenu(50, 50, true);
+ goto lookInventory;
+ }
+ break;
+
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ case Common::KEYCODE_F1:
+ goto lclick;
+
+ case Common::KEYCODE_g:
+ hideInventoryIcons();
+ _awayMission.activeAction = ACTION_GET;
+ goto checkSelectedAction;
+
+ case Common::KEYCODE_l:
+ hideInventoryIcons();
+ _awayMission.activeAction = ACTION_LOOK;
+ goto checkSelectedAction;
+
+
+ default:
+ break;
+ }
break;
default:
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index b0eb045..993be77 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -1238,7 +1238,7 @@ void StarTrekEngine::showInventoryIcons(bool showItem) {
}
/**
- * Return true if an object is unselectable with use?
+ * Return true if an object is unselectable with the given action?
*/
bool StarTrekEngine::isObjectUnusable(int object, int action) {
if (action == ACTION_LOOK)
Commit: dee26355b1606ac9a23275b9c6f5233966e876a0
https://github.com/scummvm/scummvm/commit/dee26355b1606ac9a23275b9c6f5233966e876a0
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Minor fixes to LOVE mission
Changed paths:
engines/startrek/rooms/love0.cpp
engines/startrek/rooms/love5.cpp
diff --git a/engines/startrek/rooms/love0.cpp b/engines/startrek/rooms/love0.cpp
index e3a5ab2..49ba136 100644
--- a/engines/startrek/rooms/love0.cpp
+++ b/engines/startrek/rooms/love0.cpp
@@ -33,11 +33,13 @@
namespace StarTrek {
void Room::love0Tick1() {
+ // BUGFIX: moved this out of the if statement below.
+ playVoc("LOV0LOOP");
+
if (!_vm->_awayMission.love.alreadyStartedMission) {
_vm->_awayMission.love.canister1 = CANTYPE_O2;
_vm->_awayMission.love.canister2 = CANTYPE_H2;
_vm->_awayMission.love.alreadyStartedMission = true;
- playVoc("LOV0LOOP"); // FIXME: no audio after first entry?
}
if (_vm->_awayMission.love.releasedHumanLaughingGas)
@@ -48,6 +50,7 @@ void Room::love0Tick1() {
loadActorAnim(OBJECT_DOOR2, "s3r0d2a", 0xe6, 0x80, 0);
loadActorAnim(OBJECT_DOOR1, "s3r0d1a", 0x123, 0x8d, 0);
+
_roomVar.love.cmnXPosToCureSpock = 0xf4;
_roomVar.love.cmnYPosToCureSpock = 0x8f;
}
diff --git a/engines/startrek/rooms/love5.cpp b/engines/startrek/rooms/love5.cpp
index 26708a8..4bb9cb6 100644
--- a/engines/startrek/rooms/love5.cpp
+++ b/engines/startrek/rooms/love5.cpp
@@ -56,6 +56,9 @@ void Room::love5Tick1() {
if (_vm->_awayMission.love.releasedRomulanLaughingGas)
_vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
_vm->_awayMission.timers[2] = 200;
+
+ _roomVar.love.cmnXPosToCureSpock = 0x89;
+ _roomVar.love.cmnXPosToCureSpock = 0xb9;
}
void Room::love5TouchedWarp1() {
Commit: 14639d85f72a87fbcb5185a6d1b8477666d3850a
https://github.com/scummvm/scummvm/commit/14639d85f72a87fbcb5185a6d1b8477666d3850a
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fix choice numbers in textboxes (again)
Changed paths:
engines/startrek/text.cpp
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 28b465f..64e5dc2 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -103,7 +103,7 @@ void StarTrekEngine::getTextboxHeader(String *headerTextOutput, String speakerTe
if (choiceIndex != 0)
header += String::format(" choice %d", choiceIndex);
- *headerTextOutput = centerTextboxHeader(speakerText);
+ *headerTextOutput = centerTextboxHeader(header);
}
/**
Commit: c3bd0347ada48ab5188d058104c884f3a0d61c21
https://github.com/scummvm/scummvm/commit/c3bd0347ada48ab5188d058104c884f3a0d61c21
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: More minor fixes to LOVE mission
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/events.cpp
engines/startrek/rooms/love1.cpp
engines/startrek/rooms/love4.cpp
engines/startrek/rooms/lovea.cpp
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index a5cf80a..ebdaa56 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -355,7 +355,7 @@ checkSelectedAction:
}
else if (_awayMission.activeAction == ACTION_LOOK)
showInventoryIcons(false);
- else if (_awayMission.activeAction == ACTION_USE && (_awayMission.crewDownBitset & 1) == 0)
+ else if (_awayMission.activeAction == ACTION_USE && (_awayMission.crewDownBitset & (1 << OBJECT_KIRK)) == 0)
showInventoryIcons(true);
break;
@@ -412,7 +412,6 @@ checkSelectedAction:
_awayMission.activeAction = ACTION_LOOK;
goto checkSelectedAction;
-
default:
break;
}
diff --git a/engines/startrek/events.cpp b/engines/startrek/events.cpp
index b80659c..88bca9d 100644
--- a/engines/startrek/events.cpp
+++ b/engines/startrek/events.cpp
@@ -49,8 +49,6 @@ void StarTrekEngine::pollSystemEvents() {
break;
case Common::EVENT_LBUTTONDOWN:
- // TODO: what happens when mouse click is outside normal screen bounds?
- // (apparently this can happen)
trekEvent.type = TREKEVENT_LBUTTONDOWN;
addEventToQueue(trekEvent);
break;
diff --git a/engines/startrek/rooms/love1.cpp b/engines/startrek/rooms/love1.cpp
index bdcbb6a..23a6e2a 100644
--- a/engines/startrek/rooms/love1.cpp
+++ b/engines/startrek/rooms/love1.cpp
@@ -328,9 +328,9 @@ void Room::love1GetFromNozzle() {
void Room::love1KirkReachedNozzleToGet() {
if (_vm->_awayMission.love.bottleInNozzle == 0)
- loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 11);
- else
showText(TX_LOV1N011);
+ else
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 11);
}
void Room::love1KirkGotBottleFromNozzle() {
@@ -463,7 +463,7 @@ void Room::love1UseDishesOnChamber() {
void Room::love1KirkReachedChamberToPut() {
if (_vm->_awayMission.love.chamberHasDish)
- showText(TX_LOV1_014); // TODO: test
+ showText(TX_SPEAKER_MCCOY, TX_LOV1_014); // TODO: test
else {
loadActorAnim(OBJECT_CHAMBER, "s3r2d5", 0xb4, 0x75, 1);
playSoundEffectIndex(SND_DOOR1);
diff --git a/engines/startrek/rooms/love4.cpp b/engines/startrek/rooms/love4.cpp
index 6aad01e..cc05f72 100644
--- a/engines/startrek/rooms/love4.cpp
+++ b/engines/startrek/rooms/love4.cpp
@@ -236,7 +236,7 @@ void Room::love4MccoyCuredRomulan1() {
showText(TX_LOV4N005);
if (!_roomVar.love.gaveWaterToRomulans)
- showText(TX_LOV4_023);
+ showText(TX_SPEAKER_MCCOY, TX_LOV4_023);
_vm->_awayMission.disableInput = false;
}
diff --git a/engines/startrek/rooms/lovea.cpp b/engines/startrek/rooms/lovea.cpp
index 59e0bb7..9805123 100644
--- a/engines/startrek/rooms/lovea.cpp
+++ b/engines/startrek/rooms/lovea.cpp
@@ -148,6 +148,7 @@ void Room::loveaFinishedCuringSpock() {
showText(TX_SPEAKER_SPOCK, TX_LOV5_038);
showText(TX_SPEAKER_MCCOY, TX_LOV5_027);
showText(TX_SPEAKER_SPOCK, TX_LOV5C001);
+ _vm->_awayMission.love.spockCured = true;
}
Commit: aa41f89395b3fa3e74a4e060a06c1dbfd537c158
https://github.com/scummvm/scummvm/commit/aa41f89395b3fa3e74a4e060a06c1dbfd537c158
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fix memory leak in drawAllSprites
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/graphics.cpp
engines/startrek/menu.cpp
engines/startrek/text.cpp
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index ebdaa56..6d845da 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -705,7 +705,7 @@ void StarTrekEngine::checkTouchedLoadingZone(int16 x, int16 y) {
/**
* Updates any nonzero away mission timers, and invokes ACTION_TIMER_EXPIRED when any one
- * reached 0.
+ * reaches 0.
*/
void StarTrekEngine::updateAwayMissionTimers() {
for (int i = 0; i < 8; i++) {
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index f369c11..9dc484f 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -542,6 +542,8 @@ void Graphics::drawAllSprites(bool updateScreen) {
_vm->_system->copyRectToScreen((byte *)surface.getPixels() + offset, SCREEN_WIDTH, r.left, r.top, r.width(), r.height());
}
+ surface.free();
+
if (updateScreen) {
// Check if there are any pending updates to the mouse.
if (_mouseBitmap != _mouseBitmapLastFrame) {
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index d712518..39f4c5a 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -418,7 +418,6 @@ exitMenu:
case Common::KEYCODE_SPACE:
case Common::KEYCODE_F2: // Exit menu without selecting anything
goto exitMenu;
- goto exitMenu;
case Common::KEYCODE_RETURN:
case Common::KEYCODE_KP_ENTER:
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 64e5dc2..071dc6d 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -207,7 +207,7 @@ String StarTrekEngine::playTextAudio(const String &str) {
/**
* @param rclickCancelsChoice If true, right-clicks return "-1" as choice instead of
- * whetever was selected.
+ * whatever was selected.
*/
int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, bool rclickCancelsChoice) {
int16 tmpTextDisplayMode = _textDisplayMode;
Commit: d3313e398046308f35ee9a1f47a60962897c4019
https://github.com/scummvm/scummvm/commit/d3313e398046308f35ee9a1f47a60962897c4019
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Add another mac version to detection.cpp
Changed paths:
engines/startrek/detection.cpp
diff --git a/engines/startrek/detection.cpp b/engines/startrek/detection.cpp
index 3440bb4..ebeb30a 100644
--- a/engines/startrek/detection.cpp
+++ b/engines/startrek/detection.cpp
@@ -156,6 +156,21 @@ static const StarTrekGameDescription gameDescriptions[] = {
{
{
"st25",
+ "",
+ AD_ENTRY1("Star Trek Data", "d95eb00532b7082d53862c906c7ac3dc"),
+ Common::EN_ANY,
+ Common::kPlatformMacintosh,
+ ADGF_MACRESFORK,
+ GUIO0()
+ },
+ GType_ST25,
+ 0,
+ 0,
+ },
+
+ {
+ {
+ "st25",
"Demo",
AD_ENTRY1("data.001", "f68126e7e36ce6286c4c8575f8b594f5"),
Common::EN_ANY,
Commit: 644f5118da0ed0b079c60aecf08e9e5aa9d34cc4
https://github.com/scummvm/scummvm/commit/644f5118da0ed0b079c60aecf08e9e5aa9d34cc4
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Reorganize some text
Changed paths:
engines/startrek/text.h
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index b140c55..457f87b 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -100,8 +100,30 @@ enum GameStringIDs {
TX_SPEAKER_CHEEVER,
TX_SPEAKER_PREAX,
+ TX_BRIDU146,
+
TX_G_024,
+ TX_GENER004,
+
+ TX_COMPA180,
+ TX_COMPA186,
+ TX_COMPA187,
+ TX_COMPA189,
+ TX_COMPA190,
+ TX_COMPA191,
+ TX_COMPA193,
+ TX_COMPU181,
+ TX_COMPU182,
+ TX_COMPU186,
+ TX_COMPU187,
+ TX_COMPU188,
+ TX_COMPU189,
+ TX_COMPU190,
+ TX_COMPU192,
+ TX_COMPU193,
+
+
TX_DEM0_001,
TX_DEM0_002,
TX_DEM0_003,
@@ -585,7 +607,6 @@ enum GameStringIDs {
TX_TUG0N014,
- TX_SIN3_012,
TX_TUG1_001,
TX_TUG1_002,
TX_TUG1_003,
@@ -693,9 +714,6 @@ enum GameStringIDs {
TX_TUG2C001, // Custom
- TX_COMPA180,
- TX_COMPU181,
- TX_COMPU182,
TX_TUG3_001,
TX_TUG3_002,
TX_TUG3_003,
@@ -728,21 +746,6 @@ enum GameStringIDs {
TX_TUG3N008,
- TX_BRIDU146,
- TX_COMPA186,
- TX_COMPA187,
- TX_COMPA189,
- TX_COMPA190,
- TX_COMPA191,
- TX_COMPA193,
- TX_COMPU186,
- TX_COMPU187,
- TX_COMPU188,
- TX_COMPU189,
- TX_COMPU190,
- TX_COMPU192,
- TX_COMPU193,
- TX_GENER004,
TX_LOV0_001,
TX_LOV0_002,
TX_LOV0_003,
@@ -1155,12 +1158,23 @@ enum GameStringIDs {
TX_LOVA_F10,
TX_LOVA_F54,
TX_LOVA_F55,
+
+
TX_MUD2_040,
+
+
TX_MUD4_018,
- TX_SPOKCOFF,
+
+
+ TX_SIN3_012,
+
+
TX_VENA_F41,
+ TX_SPOKCOFF,
+
+
TX_END
};
@@ -1202,8 +1216,30 @@ const char * const g_gameStrings[] = {
"Dr. Cheever",
"Preax",
+ "#BRID\\BRIDU146#Nothing to report, Captain.",
+
"#GENE\\G_024#Fascinating.",
+ "#GENE\\GENER004#Game Over",
+
+ "#COMP\\COMPA180#Orbit Stabilized. Warning Cancelled.",
+ "#COMP\\COMPA186#Ammonia",
+ "#COMP\\COMPA187#Di-hydrogen Oxide",
+ "#COMP\\COMPA189#Nitrous Oxide",
+ "#COMP\\COMPA190#Oroborus Virus",
+ "#COMP\\COMPA191#Exit Database",
+ "#COMP\\COMPA193#TLTDH Gas",
+ "#COMP\\COMPU181#Warning. Orbital Decay is now irreversible. Abandon Ship. Abandon Ship.",
+ "#COMP\\COMPU182#Warning. Orbital decay detected. Warning.",
+ "#COMP\\COMPU186#Ammonia: a colorless pungent compound NH3, a common byproduct of metabolism in carbon-based lifeforms. Liquid or gaseous at 1 atm. Compounds widely used in agricultural, medical and industrial applications.",
+ "#COMP\\COMPU187#Di-hydrogen Oxide: a colorless, tasteless, nonflammable compound HO- water. Liquid, solid, or gaseous at 1 atm. Temperature scales defined in most humanoid cultures by state-shift of pure water.",
+ "#COMP\\COMPU188#Dr. Marcus' Log, Supplemental: Continued testing of the Oroborus Virus confirms its potential harmful effects on Romulan/Vulcan humanoids. As soon as the spill has been cleaned up, we will sterilize both labs and purge the circulation system to make sure no traces of the virus will remain viable. Then all research files must be erased -- we must leave no chance that this terrible accident will ever be repeated.",
+ "#COMP\\COMPU189#Nitrous Oxide: a colorless nonflammable compound NO, gaseous at 1 atm and temperatures within the human norm. Early anesthetic among humans, in whom it produces laughter, feelings of exhiliration, euphoria; sometimes leading to unconsciousness.",
+ "#COMP\\COMPU190#Oroborus virus: Atypical growth patterns for L-Type virus. Opportunistic pneumococcal mimic affecting Romulo-Vulcan genotype. Etiology: contact or airborne vector with alveoli microcollapse involvement immediately upon exposure. Tissue dehydration follows pneumal flooding. Mortality: 0.6 in 1.0 stardates, 1.0 within 2.0 stardates Treatment: none. Named for the mythic worldsnake that swallows its own tail.",
+ "#COMP\\COMPU192#Please select subject file...",
+ "#COMP\\COMPU193#TLTDH gas: The chemical compound tantalum bi-lithium thalo-dihydroxide. Colorless, odorless, nonflammable gaseous at 1 atm and temperatures within the human norm. Early anesthetic among Vulcans and Romulans, in whom it produces laughter, feelings of exhiliration, euphoria; sometimes leading to unconsciousness. In post-industrial/pre-spaceflight era, a social problem evolved when crude TLTDH became popular to \"cook up\" from non-conductive tantalo-lithial compounds commonly used as electrical insulation.",
+
+
"#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?",
"#DEM0\\DEM0_002#Aside from seeing demons, has any hard data been collected? Any evidence I could see?",
"#DEM0\\DEM0_003#Been seeing ghosts and bogeymen eh? I find that a little hard to believe.",
@@ -1687,7 +1723,6 @@ const char * const g_gameStrings[] = {
"#TUG0\\TUG0N014#This man was obviously the transporter engineer. He is unconscious, but alive.",
- "#SIN3\\SIN3_012#Can't say I like the decor.", // FIXME
"#TUG1\\TUG1_001#This is a mess now, isn't it?",
"#TUG1\\TUG1_002#A forcefield of unusual configurations has been erected in front of the doorway which leads into the bridge. I don't think it would be healthy to approach too closely, Captain.",
"#TUG1\\TUG1_003#I'm getting life readings both on the bridge and in the brig, Jim.",
@@ -1795,9 +1830,6 @@ const char * const g_gameStrings[] = {
"Snip...snip...snip.",
- "#COMP\\COMPA180#Orbit Stabilized. Warning Cancelled.", // FIXME
- "#COMP\\COMPU181#Warning. Orbital Decay is now irreversible. Abandon Ship. Abandon Ship.",
- "#COMP\\COMPU182#Warning. Orbital decay detected. Warning.",
"#TUG3\\TUG3_001#Scotty, beam down a security team to the bridge. We have regained control.",
"#TUG3\\TUG3_002#Check and mate, Elasi. Don't do anything foolish.",
"#TUG3\\TUG3_003#Freeze, don't even think about it.",
@@ -1830,21 +1862,6 @@ const char * const g_gameStrings[] = {
"#TUG3\\TUG3N008#You carefully eye the chief lieutenant of the Elasi Clan, Elasi Cereth.",
- "#BRID\\BRIDU146#Nothing to report, Captain.",
- "#COMP\\COMPA186#Ammonia",
- "#COMP\\COMPA187#Di-hydrogen Oxide",
- "#COMP\\COMPA189#Nitrous Oxide",
- "#COMP\\COMPA190#Oroborus Virus",
- "#COMP\\COMPA191#Exit Database",
- "#COMP\\COMPA193#TLTDH Gas",
- "#COMP\\COMPU186#Ammonia: a colorless pungent compound NH3, a common byproduct of metabolism in carbon-based lifeforms. Liquid or gaseous at 1 atm. Compounds widely used in agricultural, medical and industrial applications.",
- "#COMP\\COMPU187#Di-hydrogen Oxide: a colorless, tasteless, nonflammable compound HO- water. Liquid, solid, or gaseous at 1 atm. Temperature scales defined in most humanoid cultures by state-shift of pure water.",
- "#COMP\\COMPU188#Dr. Marcus' Log, Supplemental: Continued testing of the Oroborus Virus confirms its potential harmful effects on Romulan/Vulcan humanoids. As soon as the spill has been cleaned up, we will sterilize both labs and purge the circulation system to make sure no traces of the virus will remain viable. Then all research files must be erased -- we must leave no chance that this terrible accident will ever be repeated.",
- "#COMP\\COMPU189#Nitrous Oxide: a colorless nonflammable compound NO, gaseous at 1 atm and temperatures within the human norm. Early anesthetic among humans, in whom it produces laughter, feelings of exhiliration, euphoria; sometimes leading to unconsciousness.",
- "#COMP\\COMPU190#Oroborus virus: Atypical growth patterns for L-Type virus. Opportunistic pneumococcal mimic affecting Romulo-Vulcan genotype. Etiology: contact or airborne vector with alveoli microcollapse involvement immediately upon exposure. Tissue dehydration follows pneumal flooding. Mortality: 0.6 in 1.0 stardates, 1.0 within 2.0 stardates Treatment: none. Named for the mythic worldsnake that swallows its own tail.",
- "#COMP\\COMPU192#Please select subject file...",
- "#COMP\\COMPU193#TLTDH gas: The chemical compound tantalum bi-lithium thalo-dihydroxide. Colorless, odorless, nonflammable gaseous at 1 atm and temperatures within the human norm. Early anesthetic among Vulcans and Romulans, in whom it produces laughter, feelings of exhiliration, euphoria; sometimes leading to unconsciousness. In post-industrial/pre-spaceflight era, a social problem evolved when crude TLTDH became popular to \"cook up\" from non-conductive tantalo-lithial compounds commonly used as electrical insulation.",
- "#GENE\\GENER004#Game Over",
"#LOV0\\LOV0_001#A medical data file is attached -- your bailiwick, Bones.",
"#LOV0\\LOV0_002#Spock, check out the station's computer and see what you can dig up.",
"#LOV0\\LOV0_003#Strange that the bridge is empty. Stay sharp everyone. The station's computer system might give us some answers.",
@@ -2257,10 +2274,21 @@ const char * const g_gameStrings[] = {
"#LOVA\\LOVA_F10#He has weak vital signs.",
"#LOVA\\LOVA_F54#The virus has spread to me, Captain. I suggest you concentrate your efforts on the problem.",
"#LOVA\\LOVA_F55#Jim, we need to synthesize more to make the serum before we can use it.", // TYPO
+
+
"#MUD2\\MUD2_040#You look troubled, Captain.",
+
+
"#MUD4\\MUD4_018#Kirk to Enterprise ... Kirk to Enterprise.",
- "#sfx\\spokcoff#cough... cough...",
+
+
+ "#SIN3\\SIN3_012#Can't say I like the decor.",
+
+
"#VENA\\VENA_F41#Kirk out.",
+
+
+ "#sfx\\spokcoff#cough... cough...",
};
}
Commit: b332c17805c8ade038eac551345e7e22f245e7c1
https://github.com/scummvm/scummvm/commit/b332c17805c8ade038eac551345e7e22f245e7c1
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Give name to variable in love mission
Changed paths:
engines/startrek/awaymission.h
engines/startrek/rooms/love2.cpp
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 2edcf18..2a0b323 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -151,8 +151,8 @@ struct AwayMission {
byte bottleInNozzle; // 0x31
bool cabinetOpen; // 0x32
bool gasFeedOn; // 0x33
- byte synthesizerProduct; // 0x34
- byte field35; // 0x35
+ byte synthesizerBottleIndex; // 0x34
+ byte synthesizerContents; // 0x35
byte canister1; // 0x36
byte canister2; // 0x37
bool servicePanelOpen; // 0x38
@@ -203,13 +203,13 @@ enum CanisterTypes {
CANTYPE_N2 = 3
};
-// Synthesizer contents for Love's Labor Jeopardized (values for field35)
+// Synthesizer contents for Love's Labor Jeopardized (values for synthesizerContents)
enum SynthesizerContent {
SYNTHITEM_NONE = 0,
SYNTHITEM_PBC = 1,
SYNTHITEM_VIRUS_SAMPLE = 2,
SYNTHITEM_CURE_SAMPLE = 3,
- SYNTHITEM_BOTTLE = 9 // Contents of bottle determined by "synthesizerProduct" variable
+ SYNTHITEM_BOTTLE = 9 // Contents of bottle determined by "synthesizerBottleIndex" variable
};
#endif
diff --git a/engines/startrek/rooms/love2.cpp b/engines/startrek/rooms/love2.cpp
index c8bec64..61feac9 100644
--- a/engines/startrek/rooms/love2.cpp
+++ b/engines/startrek/rooms/love2.cpp
@@ -96,14 +96,14 @@ void Room::love2Tick1() {
if (_vm->_awayMission.love.cabinetOpen && !haveItem(OBJECT_IANTIGRA))
loadActorAnim(OBJECT_ANTIGRAV, "antigr", 0x1f, 0xa7, 0);
- if (_vm->_awayMission.love.field35 != 0)
+ if (_vm->_awayMission.love.synthesizerContents != 0)
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2o", 0x8a, 0x8d, 0);
else
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2c", 0x8a, 0x8d, 0);
bool valid = true;
- switch (_vm->_awayMission.love.field35) {
+ switch (_vm->_awayMission.love.synthesizerContents) {
case SYNTHITEM_PBC:
strcpy(_roomVar.love.chamberInputAnim, "pbcanm");
_roomVar.love.chamberObject = OBJECT_POLYBERYLCARBONATE;
@@ -117,7 +117,7 @@ void Room::love2Tick1() {
_roomVar.love.chamberObject = OBJECT_CURESAMPLE;
break;
case SYNTHITEM_BOTTLE:
- switch (_vm->_awayMission.love.synthesizerProduct) {
+ switch (_vm->_awayMission.love.synthesizerBottleIndex) {
case 1:
strcpy(_roomVar.love.chamberOutputAnim, "btle1");
_roomVar.love.chamberObject = OBJECT_SYNTHESIZER_OUTPUT;
@@ -146,7 +146,7 @@ void Room::love2Tick1() {
}
if (valid) {
- if (_vm->_awayMission.love.field35 == 9)
+ if (_vm->_awayMission.love.synthesizerContents == 9)
loadActorAnim2(_roomVar.love.chamberObject, _roomVar.love.chamberOutputAnim, 0x8a, 0x8b, 0);
else
loadActorAnim2(_roomVar.love.chamberObject, _roomVar.love.chamberInputAnim, 0x8a, 0x8b, 0);
@@ -554,7 +554,7 @@ void Room::love2UseSynthesizer() {
}
if (c1 == CANTYPE_O2 && c2 == CANTYPE_H2) {
- switch (_vm->_awayMission.love.field35) {
+ switch (_vm->_awayMission.love.synthesizerContents) {
case SYNTHITEM_PBC: // Romulan Laughing Gas
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", -1, -1, 27); // -> love2ClosedSynthesizerDoorMakingRLG
playSoundEffectIndex(SND_DOOR1);
@@ -581,7 +581,7 @@ bottleFailure:
case SYNTHITEM_NONE: // Water
default:
- _vm->_awayMission.love.synthesizerProduct = BOTTLETYPE_H2O;
+ _vm->_awayMission.love.synthesizerBottleIndex = BOTTLETYPE_H2O;
strcpy(_roomVar.love.chamberOutputAnim, "btle3");
produceBottle:
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 3); // -> love2SynthesizerDoorClosed
@@ -591,11 +591,11 @@ produceBottle:
closeSynthesizerDoor:
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.love.field35 = 0;
+ _vm->_awayMission.love.synthesizerContents = 0;
break;
}
} else if (c1 == CANTYPE_H2 && c2 == CANTYPE_N2) {
- switch (_vm->_awayMission.love.field35) {
+ switch (_vm->_awayMission.love.synthesizerContents) {
case SYNTHITEM_PBC: // Inert matter
inertMatterFailure:
showText(TX_LOV2N049);
@@ -621,12 +621,12 @@ inertMatterFailure:
case SYNTHITEM_NONE: // Ammonia
default:
- _vm->_awayMission.love.synthesizerProduct = BOTTLETYPE_NH3;
+ _vm->_awayMission.love.synthesizerBottleIndex = BOTTLETYPE_NH3;
strcpy(_roomVar.love.chamberOutputAnim, "btle2");
goto produceBottle;
}
} else if (c1 == CANTYPE_O2 && c2 == CANTYPE_N2) {
- switch (_vm->_awayMission.love.field35) {
+ switch (_vm->_awayMission.love.synthesizerContents) {
case SYNTHITEM_PBC: // Inert matter
goto inertMatterFailure;
@@ -644,7 +644,7 @@ inertMatterFailure:
case SYNTHITEM_NONE: // Laughing gas
default:
- _vm->_awayMission.love.synthesizerProduct = BOTTLETYPE_N2O;
+ _vm->_awayMission.love.synthesizerBottleIndex = BOTTLETYPE_N2O;
strcpy(_roomVar.love.chamberOutputAnim, "btle1");
goto produceBottle;
}
@@ -664,12 +664,12 @@ inertMatterFailure:
void Room::love2SynthesizerDoorClosed() {
playVoc("LD1SCAN");
loadActorAnim(OBJECT_SYNTHESIZER_OUTPUT, _roomVar.love.chamberOutputAnim, 0x8a, 0x8d, 4); // -> love2SynthesizerFinished
- _vm->_awayMission.love.field35 = SYNTHITEM_BOTTLE;
+ _vm->_awayMission.love.synthesizerContents = SYNTHITEM_BOTTLE;
}
// Final product of synthesizer is produced
void Room::love2SynthesizerFinished() {
- switch (_vm->_awayMission.love.synthesizerProduct) {
+ switch (_vm->_awayMission.love.synthesizerBottleIndex) {
case BOTTLETYPE_N2O:
showText(TX_LOV2N017);
showText(TX_SPEAKER_SPOCK, TX_LOV2_032);
@@ -703,7 +703,7 @@ void Room::love2SynthesizerFinished() {
}
void Room::love2ClosedSynthesizerDoorMakingRLG() {
- _vm->_awayMission.love.synthesizerProduct = BOTTLETYPE_RLG;
+ _vm->_awayMission.love.synthesizerBottleIndex = BOTTLETYPE_RLG;
strcpy(_roomVar.love.chamberOutputAnim, "btle4");
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 3); // -> love2SynthesizerDoorClosed
playSoundEffectIndex(SND_DOOR1);
@@ -731,7 +731,7 @@ void Room::love2UsePolyberylcarbonateOnSynthesizerDoor() {
}
void Room::love2KirkReachedSynthesizerWithPolyberylcarbonate() {
- if (_vm->_awayMission.love.field35 != 0)
+ if (_vm->_awayMission.love.synthesizerContents != 0)
showText(TX_LOV2N025);
else {
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 5);
@@ -746,7 +746,7 @@ void Room::love2SynthesizerDoorOpenedWithPolyberylcarbonate() {
void Room::love2PutPolyberylcarbonateInSynthesizer() {
loadActorAnim(OBJECT_POLYBERYLCARBONATE, "pbcanm", 0x8a, 0x8b, 0);
loseItem(OBJECT_IPBC);
- _vm->_awayMission.love.field35 = SYNTHITEM_PBC;
+ _vm->_awayMission.love.synthesizerContents = SYNTHITEM_PBC;
}
@@ -757,7 +757,7 @@ void Room::love2UseVirusSampleOnSynthesizerDoor() {
}
void Room::love2KirkReachedSynthesizerWithVirusSample() {
- if (_vm->_awayMission.love.field35 != 0)
+ if (_vm->_awayMission.love.synthesizerContents != 0)
showText(TX_LOV2N025);
else {
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 6);
@@ -772,7 +772,7 @@ void Room::love2SynthesizerDoorOpenedWithVirusSample() {
void Room::love2PutVirusSampleInSynthesizer() {
loadActorAnim(OBJECT_VIRUSSAMPLE, "dishes", 0x8a, 0x8b, 0);
loseItem(OBJECT_IDISHES);
- _vm->_awayMission.love.field35 = SYNTHITEM_VIRUS_SAMPLE;
+ _vm->_awayMission.love.synthesizerContents = SYNTHITEM_VIRUS_SAMPLE;
}
@@ -783,7 +783,7 @@ void Room::love2UseCureSampleOnSynthesizerDoor() {
}
void Room::love2KirkReachedSynthesizerWithCureSample() {
- if (_vm->_awayMission.love.field35 != 0)
+ if (_vm->_awayMission.love.synthesizerContents != 0)
showText(TX_LOV2N025); // BUGFIX: original didn't play audio
else {
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 7);
@@ -798,7 +798,7 @@ void Room::love2SynthesizerDoorOpenedWithCureSample() {
void Room::love2PutCureSampleInSynthesizer() {
loadActorAnim(OBJECT_CURESAMPLE, "dishes", 0x8a, 0x8b, 0);
loseItem(OBJECT_ISAMPLE);
- _vm->_awayMission.love.field35 = SYNTHITEM_CURE_SAMPLE;
+ _vm->_awayMission.love.synthesizerContents = SYNTHITEM_CURE_SAMPLE;
}
@@ -849,7 +849,7 @@ void Room::love2GotPolyberylcarbonate() {
loadActorStandAnim(OBJECT_POLYBERYLCARBONATE);
showText(TX_LOV2N044);
giveItem(OBJECT_IPBC);
- _vm->_awayMission.love.field35 = 0;
+ _vm->_awayMission.love.synthesizerContents = 0;
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
}
@@ -869,7 +869,7 @@ void Room::love2GotDishes() {
loadActorStandAnim(OBJECT_VIRUSSAMPLE);
showText(TX_LOV2N036); // FIXME: text doesn't match audio
giveItem(OBJECT_IDISHES);
- _vm->_awayMission.love.field35 = 0;
+ _vm->_awayMission.love.synthesizerContents = 0;
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
}
@@ -889,7 +889,7 @@ void Room::love2GotSample() {
loadActorStandAnim(OBJECT_CURESAMPLE);
showText(TX_LOV2N037);
giveItem(OBJECT_ISAMPLE);
- _vm->_awayMission.love.field35 = 0;
+ _vm->_awayMission.love.synthesizerContents = 0;
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
}
@@ -906,7 +906,7 @@ void Room::love2ReachedSynthesizerOutput() {
}
void Room::love2GotSynthesizerOutput() {
- switch (_vm->_awayMission.love.synthesizerProduct) {
+ switch (_vm->_awayMission.love.synthesizerBottleIndex) {
case BOTTLETYPE_N2O:
showText(TX_LOV2N040);
giveItem(OBJECT_IN2O);
@@ -937,8 +937,8 @@ void Room::love2GotSynthesizerOutput() {
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.love.field35 = 0;
- _vm->_awayMission.love.synthesizerProduct = 0;
+ _vm->_awayMission.love.synthesizerContents = 0;
+ _vm->_awayMission.love.synthesizerBottleIndex = 0;
}
// Get the cure
@@ -963,7 +963,7 @@ void Room::love2GotCure() {
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.love.field35 = 0;
+ _vm->_awayMission.love.synthesizerContents = 0;
}
}
Commit: 4c0eb3aa67bc5c4381e311c0b37284acb6f7497c
https://github.com/scummvm/scummvm/commit/4c0eb3aa67bc5c4381e311c0b37284acb6f7497c
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: MUDD0
Changed paths:
A engines/startrek/rooms/mudd0.cpp
A engines/startrek/rooms/mudd1.cpp
A engines/startrek/rooms/mudd2.cpp
A engines/startrek/rooms/mudd3.cpp
A engines/startrek/rooms/mudd4.cpp
A engines/startrek/rooms/mudd5.cpp
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 6d845da..d87c690 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -467,7 +467,9 @@ void StarTrekEngine::handleAwayMissionAction() {
Action action = _actionQueue.pop();
if ((action.type == ACTION_FINISHED_ANIMATION || action.type == ACTION_FINISHED_WALKING) && action.b1 == 0xff) {
- _awayMission.disableInput = false;
+ // Just finished walking or beaming into a room
+ if (_awayMission.disableInput == 1)
+ _awayMission.disableInput = false;
_warpHotspotsActive = true;
return;
}
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 2a0b323..af93218 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -33,7 +33,12 @@ struct AwayMission {
int16 mouseY; // 0x12
int16 crewGetupTimers[4]; // 0x14
bool disableWalking; // 0x1c
- byte disableInput; // 0x1d; Set while beaming in or walking into a room. Disables control?
+
+ // 0 / false: input enabled
+ // 1 / true: input disabled, turns back on after walking or beaming into a room
+ // 2: input disabled, doesn't turn back on after walking or beaming into room
+ byte disableInput; // 0x1d
+
bool redshirtDead; // 0x1e
byte activeAction; // 0x1f
byte activeObject; // 0x20; The item that is going to be used on something
@@ -182,6 +187,20 @@ struct AwayMission {
bool gotPointsForHydratingRomulans; // 0x51
int16 missionScore; // 0x52
} love;
+
+ struct {
+ byte field29; // 0x29
+
+ // True if you've combined the lense + degrimer and fired it off, discovering
+ // it's a weapon
+ bool discoveredLenseAndDegrimerFunction; // 0x3c
+ bool gotMemoryDisk; // 0x48
+ bool gotLense; // 0x49
+ bool gotDegrimer; // 0x4a
+
+ bool enteredRoom0ForFirstTime; // 0x54
+ int16 missionScore; // 0x5a
+ } mudd;
};
};
// Size: 0x129 bytes
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 6de706e..4271aef 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -37,6 +37,12 @@ MODULE_OBJS = \
rooms/love4.o \
rooms/love5.o \
rooms/lovea.o \
+ rooms/mudd0.o \
+ rooms/mudd1.o \
+ rooms/mudd2.o \
+ rooms/mudd3.o \
+ rooms/mudd4.o \
+ rooms/mudd5.o \
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 730d42f..0076e76 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -105,6 +105,30 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_roomActionList = love5ActionList;
_numRoomActions = sizeof(love5ActionList) / sizeof(RoomAction);
}
+ else if (name == "MUDD0") {
+ _roomActionList = mudd0ActionList;
+ _numRoomActions = sizeof(mudd0ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "MUDD1") {
+ _roomActionList = mudd1ActionList;
+ _numRoomActions = sizeof(mudd1ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "MUDD2") {
+ _roomActionList = mudd2ActionList;
+ _numRoomActions = sizeof(mudd2ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "MUDD3") {
+ _roomActionList = mudd3ActionList;
+ _numRoomActions = sizeof(mudd3ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "MUDD4") {
+ _roomActionList = mudd4ActionList;
+ _numRoomActions = sizeof(mudd4ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "MUDD5") {
+ _roomActionList = mudd5ActionList;
+ _numRoomActions = sizeof(mudd5ActionList) / sizeof(RoomAction);
+ }
else {
warning("Room \"%s\" unimplemented", name.c_str());
_numRoomActions = 0;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 009913d..ad08ce3 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -120,7 +120,7 @@ private:
Common::Point getActorPos(int actorIndex); // Cmd 0x0d
int16 getRandomWordInRange(int start, int end); // Cmd 0x0e
void playSoundEffectIndex(int soundEffect); // Cmd 0x0f
- void playMidiMusicTracks(int startTrack, int loopTrack); // Cmd 0x10
+ void playMidiMusicTracks(int startTrack, int loopTrack = -1); // Cmd 0x10
void endMission(int16 score, int16 arg2, int16 arg3); // Cmd 0x11
void showGameOverMenu(); // Cmd 0x12
void playVoc(Common::String filename); // Cmd 0x15
@@ -1118,6 +1118,64 @@ public:
void loveaUseAmmonia();
void loveaUseCommunicator();
+
+ // MUDD0
+ void mudd0Tick1();
+ void mudd0Tick50();
+ void mudd0Tick60();
+ void mudd0UsePhaserOnMudd();
+ void mudd0UseCommunicator();
+ void mudd0LookAtFoodBox();
+ void mudd0LookAtComponentBox();
+ void mudd0LookAnywhere();
+ void mudd0LookAtMemoryDiskBox();
+ void mudd0LookAtDegrimerBox();
+ void mudd0LookAtLense();
+ void mudd0UseSTricorderAnywhere();
+ void mudd0UseMTricorderAnywhere();
+ void mudd0UseSTricorderOnMemoryDiskBox();
+ void mudd0UseSTricorderOnDegrimerBox();
+ void mudd0UseMTricorderOnLense();
+ void mudd0UseLenseOnDegrimer();
+ void mudd0UseAlienDevice();
+ void mudd0FiredAlienDevice();
+ void mudd0UseDegrimer();
+ void mudd0GetLense();
+ void mudd0GetMemoryDisk();
+ void mudd0GetDegrimer();
+ void mudd0PickedUpLense();
+ void mudd0PickedUpItem();
+ void mudd0WalkToSouthDoor();
+ void mudd0TouchedHotspot1();
+ void mudd0WalkToNorthDoor();
+ void mudd0TouchedHotspot0();
+ void mudd0UseMedkit();
+ void mudd0LookAtKirk();
+ void mudd0LookAtSpock();
+ void mudd0LookAtMccoy();
+ void mudd0LookAtRedshirt();
+ void mudd0LookAtMudd();
+ void mudd0TalkToKirk();
+ void mudd0TalkToSpock();
+ void mudd0TalkToMccoy();
+ void mudd0TalkToRedshirt();
+ void mudd0TalkToMudd();
+
+ // MUDD1
+ void mudd1Tick1();
+
+ // MUDD2
+ void mudd2Tick1();
+
+ // MUDD3
+ void mudd3Tick1();
+
+ // MUDD4
+ void mudd4Tick1();
+
+ // MUDD5
+ void mudd5Tick1();
+
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
@@ -1224,6 +1282,11 @@ private:
byte cmnYPosToCureSpock;
} love;
+ struct {
+ // mudd0
+ bool walkingToDoor; // 0x22a9
+ } mudd;
+
} _roomVar;
};
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 71c7087..92b5f98 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -28,6 +28,8 @@
namespace StarTrek {
+// FIXME: calling a constructor in global scope not allowed in scummvm?
+
RoomAction demon0ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::demon0Tick1 },
{ Action(ACTION_TICK, 2, 0, 0), &Room::demon0Tick2 },
@@ -1393,6 +1395,66 @@ RoomAction love5ActionList[] = {
{ Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::loveaUseCommunicator },
};
+RoomAction mudd0ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::mudd0Tick1 },
+ { Action(ACTION_TICK, 50, 0, 0), &Room::mudd0Tick50 },
+ { Action(ACTION_TICK, 60, 0, 0), &Room::mudd0Tick60 },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::mudd0UsePhaserOnMudd },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::mudd0UsePhaserOnMudd },
+ { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd0UseCommunicator },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::mudd0LookAtFoodBox },
+ { Action(ACTION_LOOK, 0x24, 0, 0), &Room::mudd0LookAtComponentBox },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::mudd0LookAnywhere },
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd0LookAtMemoryDiskBox },
+ { Action(ACTION_LOOK, 0x22, 0, 0), &Room::mudd0LookAtDegrimerBox },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::mudd0LookAtLense },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::mudd0UseSTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::mudd0UseMTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::mudd0UseSTricorderOnMemoryDiskBox },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::mudd0UseSTricorderOnDegrimerBox },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::mudd0UseMTricorderOnLense },
+ { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
+ { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
+ { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
+ { Action(ACTION_GET, 0x21, 0, 0), &Room::mudd0GetLense },
+ { Action(ACTION_GET, 0x20, 0, 0), &Room::mudd0GetMemoryDisk },
+ { Action(ACTION_GET, 0x22, 0, 0), &Room::mudd0GetDegrimer },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd0PickedUpLense },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::mudd0PickedUpItem },
+ { Action(ACTION_WALK, 0x26, 0, 0), &Room::mudd0WalkToSouthDoor },
+ { Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::mudd0TouchedHotspot1 },
+ { Action(ACTION_WALK, 0x25, 0, 0), &Room::mudd0WalkToNorthDoor },
+ { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd0TouchedHotspot0 },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd0UseMedkit },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd0LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd0LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd0LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd0LookAtRedshirt },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::mudd0LookAtMudd },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd0TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd0TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd0TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd0TalkToRedshirt },
+ { Action(ACTION_TALK, 8, 0, 0), &Room::mudd0TalkToMudd },
+ // TODO: remainder? something about losing atmosphere?
+};
+
+RoomAction mudd1ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::mudd1Tick1 },
+};
+RoomAction mudd2ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::mudd2Tick1 },
+};
+RoomAction mudd3ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::mudd3Tick1 },
+};
+RoomAction mudd4ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::mudd4Tick1 },
+};
+RoomAction mudd5ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::mudd5Tick1 },
+};
}
diff --git a/engines/startrek/rooms/mudd0.cpp b/engines/startrek/rooms/mudd0.cpp
new file mode 100644
index 0000000..d482aa7
--- /dev/null
+++ b/engines/startrek/rooms/mudd0.cpp
@@ -0,0 +1,349 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_MUDD 8
+#define OBJECT_ALIENDV 9
+#define OBJECT_DOOR 10
+
+#define HOTSPOT_MEMORY_DISK_BOX 0x20
+#define HOTSPOT_LENSE 0x21
+#define HOTSPOT_DEGRIMER_BOX 0x22
+#define HOTSPOT_FOOD_BOX 0x23
+#define HOTSPOT_COMPONENT_BOX 0x24
+#define HOTSPOT_DOOR 0x25
+#define HOTSPOT_BOTTOM_OF_ROOM 0x26
+
+// BUG: Mudd is sometimes present when he shouldn't be.
+
+namespace StarTrek {
+
+void Room::mudd0Tick1() {
+ playVoc("MUD0LOOP");
+
+ _vm->_awayMission.disableInput = 2;
+ loadActorAnim(OBJECT_MUDD, "s4cbhr", 0xa2, 0xa9, 0);
+
+ // Floppy version's code.
+ /*
+ if (_vm->_awayMission.mudd.field29 == 0)
+ _vm->_awayMission.mudd.field29 = 2;
+ else {
+ _vm->_awayMission.mudd.field1d = 2;
+ loadActorAnim(OBJECT_MUDD, "s4cbhr", 0xa2, 0xa9, 0);
+ }
+ */
+}
+
+void Room::mudd0Tick50() {
+ if (!_vm->_awayMission.mudd.enteredRoom0ForFirstTime) {
+ playMidiMusicTracks(3);
+ _vm->_awayMission.mudd.enteredRoom0ForFirstTime = true;
+ }
+}
+
+void Room::mudd0Tick60() {
+ _vm->_awayMission.disableInput = false;
+
+ if (_vm->_awayMission.mudd.field29 == 0) {
+ _vm->_awayMission.mudd.field29++;
+
+ showText(TX_SPEAKER_MUDD, TX_MUD0_037);
+ showText(TX_SPEAKER_KIRK, TX_MUD0_009);
+ showText(TX_SPEAKER_MUDD, TX_MUD0_028);
+ showText(TX_SPEAKER_MCCOY, TX_MUD0_017);
+ showText(TX_SPEAKER_MUDD, TX_MUD0_026);
+ showText(TX_SPEAKER_KIRK, TX_MUD0_006);
+ showText(TX_SPEAKER_MUDD, TX_MUD0_033);
+ showText(TX_SPEAKER_KIRK, TX_MUD0_005);
+ showText(TX_SPEAKER_MUDD, TX_MUD0_029);
+ }
+}
+
+void Room::mudd0UsePhaserOnMudd() {
+ showText(TX_SPEAKER_MUDD, TX_MUD0_025);
+}
+
+void Room::mudd0UseCommunicator() {
+ showText(TX_SPEAKER_KIRK, TX_MUD0_001);
+ showText(TX_SPEAKER_UHURA, TX_STATICU1);
+}
+
+void Room::mudd0LookAtFoodBox() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ loadActorStandAnim(OBJECT_KIRK);
+ showText(TX_MUD0N012);
+}
+
+void Room::mudd0LookAtComponentBox() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ loadActorStandAnim(OBJECT_KIRK);
+ showText(TX_MUD0N013);
+}
+
+void Room::mudd0LookAnywhere() {
+ showText(TX_MUD0N019);
+}
+
+void Room::mudd0LookAtMemoryDiskBox() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ loadActorStandAnim(OBJECT_KIRK);
+ showText(TX_MUD0N010);
+}
+
+void Room::mudd0LookAtDegrimerBox() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ loadActorStandAnim(OBJECT_KIRK);
+ showText(TX_MUD0N008);
+}
+
+void Room::mudd0LookAtLense() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ loadActorStandAnim(OBJECT_KIRK);
+ showText(TX_MUD0N014);
+}
+
+void Room::mudd0UseSTricorderAnywhere() {
+ // Narrator says something, not Spock (so we don't use "spockScan" function)
+ loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_MUD0N015);
+}
+
+void Room::mudd0UseMTricorderAnywhere() {
+ // Narrator says something, not Mccoy (so we don't use "mccoyScan" function)
+ // BUGFIX-ish: original game had "McCoy" as the speaker, which is inconsistent with
+ // above.
+ loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_MUD0N015);
+}
+
+void Room::mudd0UseSTricorderOnMemoryDiskBox() {
+ spockScan(DIR_N, TX_MUD0_021, true);
+}
+
+void Room::mudd0UseSTricorderOnDegrimerBox() {
+ // Narrator says something, not Spock (so we don't use "spockScan" function)
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ loadActorAnim2(OBJECT_SPOCK, "sscanw", -1, -1, 0);
+ playSoundEffectIndex(SND_TRICORDER);
+ showText(TX_MUD0N000);
+}
+
+void Room::mudd0UseMTricorderOnLense() {
+ if (_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction)
+ mccoyScan(DIR_E, TX_MUD0_012, true);
+ else
+ mccoyScan(DIR_E, TX_MUD0_013, true);
+}
+
+void Room::mudd0UseLenseOnDegrimer() {
+ giveItem(OBJECT_IALIENDV);
+ loseItem(OBJECT_IDEGRIME);
+ loseItem(OBJECT_ILENSES);
+
+ _vm->_awayMission.mudd.missionScore++;
+ showText(TX_MUD0N011);
+ // Identical (?) audio files: TX_MUD0N011, TX_MUD1N013
+}
+
+
+void Room::mudd0UseAlienDevice() {
+ _vm->_awayMission.disableInput = true;
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ loadActorStandAnim(OBJECT_KIRK);
+ Common::Point pos = getActorPos(OBJECT_KIRK);
+ loadActorAnimC(OBJECT_ALIENDV, "s4cbxp", pos.x, 10, &Room::mudd0FiredAlienDevice);
+ playVoc("EXPLO3");
+}
+
+void Room::mudd0FiredAlienDevice() {
+ _vm->_awayMission.disableInput = false;
+ if (!_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction) {
+ _vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction = true;
+ _vm->_awayMission.mudd.missionScore += 5;
+ showText(TX_SPEAKER_KIRK, TX_MUD0_002);
+ // Identical (?) audio files: TX_MUD0_002, TX_MUD1_002
+ }
+}
+
+
+void Room::mudd0UseDegrimer() {
+ // Identical (?) audio files: TX_MUD0N002, TX_MUD1N004, ...
+ showText(TX_MUD0N002);
+}
+
+
+void Room::mudd0GetLense() {
+ if (_vm->_awayMission.mudd.gotLense)
+ showText(TX_MUD0N016);
+ else {
+ _vm->_awayMission.mudd.gotLense = true;
+ _vm->_awayMission.mudd.missionScore++;
+ giveItem(OBJECT_ILENSES);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ loadActorAnim2(OBJECT_KIRK, "s5r1kg", -1, -1);
+ _vm->_awayMission.timers[1] = 27;
+ }
+}
+
+void Room::mudd0GetMemoryDisk() {
+ if (_vm->_awayMission.mudd.gotMemoryDisk)
+ showText(TX_MUD0N016);
+ else {
+ _vm->_awayMission.mudd.gotMemoryDisk = true;
+ _vm->_awayMission.mudd.missionScore++;
+ giveItem(OBJECT_IDISKS);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ loadActorAnimC(OBJECT_KIRK, "kuseln", -1, -1, &Room::mudd0PickedUpItem);
+ }
+}
+
+void Room::mudd0GetDegrimer() {
+ if (_vm->_awayMission.mudd.gotDegrimer)
+ showText(TX_MUD0N016);
+ else {
+ _vm->_awayMission.mudd.gotDegrimer = true;
+ _vm->_awayMission.mudd.missionScore++;
+ giveItem(OBJECT_IDEGRIME);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ loadActorAnimC(OBJECT_KIRK, "kusemw", -1, -1, &Room::mudd0PickedUpItem);
+ }
+}
+
+// Timer 1 expired
+void Room::mudd0PickedUpLense() {
+ loadActorStandAnim(OBJECT_KIRK);
+ mudd0PickedUpItem();
+}
+
+void Room::mudd0PickedUpItem() {
+ _vm->_awayMission.disableInput = false; // NOTE: this was never set to true
+ showText(TX_LOV1N007);
+}
+
+
+void Room::mudd0WalkToSouthDoor() {
+ _roomVar.mudd.walkingToDoor = true;
+ _vm->_awayMission.disableInput = true;
+ walkCrewman(OBJECT_KIRK, 0x5a, 0xc7);
+}
+
+void Room::mudd0TouchedHotspot1() { // Trigger bottom door opening
+ if (_roomVar.mudd.walkingToDoor)
+ playVoc("SMADOOR3");
+}
+
+void Room::mudd0WalkToNorthDoor() {
+ _roomVar.mudd.walkingToDoor = true;
+ _vm->_awayMission.disableInput = true;
+ walkCrewman(OBJECT_KIRK, 0xa0, 0x68);
+}
+
+void Room::mudd0TouchedHotspot0() { // Trigger top door opening
+ if (_roomVar.mudd.walkingToDoor) {
+ playVoc("SMADOOR3");
+ loadActorAnim2(OBJECT_DOOR, "s4cbdo", 0xa0, 0x6b);
+ }
+}
+
+void Room::mudd0UseMedkit() {
+ showText(TX_SPEAKER_MCCOY, TX_MUD0_011);
+}
+
+void Room::mudd0LookAtKirk() {
+ showText(TX_MUD0N004);
+}
+
+void Room::mudd0LookAtSpock() {
+ showText(TX_MUD0N007);
+}
+
+void Room::mudd0LookAtMccoy() {
+ showText(TX_MUD0N001);
+}
+
+void Room::mudd0LookAtRedshirt() {
+ showText(TX_MUD0N005);
+}
+
+void Room::mudd0LookAtMudd() {
+ showText(TX_MUD0N003);
+}
+
+void Room::mudd0TalkToKirk() {
+ if (_vm->_awayMission.mudd.field29 == 2)
+ showText(TX_SPEAKER_KIRK, TX_MUD0_010);
+ else {
+ showText(TX_SPEAKER_KIRK, TX_MUD0_010);
+ showText(TX_SPEAKER_MUDD, TX_MUD0_031);
+ showText(TX_SPEAKER_KIRK, TX_MUD0_007);
+ }
+}
+
+void Room::mudd0TalkToSpock() {
+ if (_vm->_awayMission.mudd.field29 == 2)
+ showText(TX_SPEAKER_SPOCK, TX_MUD0_022);
+ else {
+ showText(TX_SPEAKER_SPOCK, TX_MUD0_022);
+ showText(TX_SPEAKER_MUDD, TX_MUD0_034);
+ showText(TX_SPEAKER_SPOCK, TX_MUD0_023);
+ showText(TX_SPEAKER_MCCOY, TX_MUD0_015);
+ showText(TX_SPEAKER_MUDD, TX_MUD0_038);
+ }
+}
+
+void Room::mudd0TalkToMccoy() {
+ if (_vm->_awayMission.mudd.field29 == 2)
+ showText(TX_SPEAKER_MCCOY, TX_MUD0_016);
+ else {
+ showText(TX_SPEAKER_MCCOY, TX_MUD0_016);
+ showText(TX_SPEAKER_KIRK, TX_MUD0_003);
+ showText(TX_SPEAKER_MUDD, TX_MUD0_027);
+ showText(TX_SPEAKER_MCCOY, TX_MUD0_014);
+ }
+}
+
+void Room::mudd0TalkToRedshirt() {
+ if (_vm->_awayMission.mudd.field29 == 2)
+ showText(TX_SPEAKER_BUCHERT, TX_MUD0_016);
+ else {
+ showText(TX_SPEAKER_BUCHERT, TX_MUD0_040);
+ showText(TX_SPEAKER_MUDD, TX_MUD0_030);
+ showText(TX_SPEAKER_BUCHERT, TX_MUD0_041);
+ showText(TX_SPEAKER_MUDD, TX_MUD0_036);
+ showText(TX_SPEAKER_BUCHERT, TX_MUD0_039);
+ showText(TX_SPEAKER_KIRK, TX_MUD0_008);
+ }
+}
+
+void Room::mudd0TalkToMudd() {
+ showText(TX_SPEAKER_MUDD, TX_MUD0_032);
+ showText(TX_SPEAKER_SPOCK, TX_MUD0_024);
+ showText(TX_SPEAKER_MUDD, TX_MUD0_035);
+ showText(TX_SPEAKER_KIRK, TX_MUD0_004);
+}
+
+}
diff --git a/engines/startrek/rooms/mudd1.cpp b/engines/startrek/rooms/mudd1.cpp
new file mode 100644
index 0000000..9029251
--- /dev/null
+++ b/engines/startrek/rooms/mudd1.cpp
@@ -0,0 +1,34 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR1 8
+
+#define HOTSPOT_CONSOLE 0x20
+
+namespace StarTrek {
+
+void Room::mudd1Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/mudd2.cpp b/engines/startrek/rooms/mudd2.cpp
new file mode 100644
index 0000000..f4b5b5f
--- /dev/null
+++ b/engines/startrek/rooms/mudd2.cpp
@@ -0,0 +1,34 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR1 8
+
+#define HOTSPOT_CONSOLE 0x20
+
+namespace StarTrek {
+
+void Room::mudd2Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/mudd3.cpp b/engines/startrek/rooms/mudd3.cpp
new file mode 100644
index 0000000..e3f215f
--- /dev/null
+++ b/engines/startrek/rooms/mudd3.cpp
@@ -0,0 +1,34 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR1 8
+
+#define HOTSPOT_CONSOLE 0x20
+
+namespace StarTrek {
+
+void Room::mudd3Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/mudd4.cpp b/engines/startrek/rooms/mudd4.cpp
new file mode 100644
index 0000000..f6a0e55
--- /dev/null
+++ b/engines/startrek/rooms/mudd4.cpp
@@ -0,0 +1,34 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR1 8
+
+#define HOTSPOT_CONSOLE 0x20
+
+namespace StarTrek {
+
+void Room::mudd4Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/mudd5.cpp b/engines/startrek/rooms/mudd5.cpp
new file mode 100644
index 0000000..30ddc98
--- /dev/null
+++ b/engines/startrek/rooms/mudd5.cpp
@@ -0,0 +1,34 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR1 8
+
+#define HOTSPOT_CONSOLE 0x20
+
+namespace StarTrek {
+
+void Room::mudd5Tick1() {
+}
+
+}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 993be77..24fa741 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -83,7 +83,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxVar6 = 0;
_textboxHasMultipleChoices = false;
- _missionToLoad = "LOVE";
+ _missionToLoad = "MUDD";
_roomIndexToLoad = 0;
for (int i = 0; i < NUM_OBJECTS; i++)
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 457f87b..93f1b8f 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -100,6 +100,9 @@ enum GameStringIDs {
TX_SPEAKER_CHEEVER,
TX_SPEAKER_PREAX,
+ TX_SPEAKER_BUCHERT,
+ TX_SPEAKER_MUDD,
+
TX_BRIDU146,
TX_G_024,
@@ -1160,6 +1163,69 @@ enum GameStringIDs {
TX_LOVA_F55,
+ TX_MUD0_001,
+ TX_MUD0_002,
+ TX_MUD0_003,
+ TX_MUD0_004,
+ TX_MUD0_005,
+ TX_MUD0_006,
+ TX_MUD0_007,
+ TX_MUD0_008,
+ TX_MUD0_009,
+ TX_MUD0_010,
+ TX_MUD0_011,
+ TX_MUD0_012,
+ TX_MUD0_013,
+ TX_MUD0_014,
+ TX_MUD0_015,
+ TX_MUD0_016,
+ TX_MUD0_017,
+ TX_MUD0_018,
+ TX_MUD0_019,
+ TX_MUD0_020,
+ TX_MUD0_021,
+ TX_MUD0_022,
+ TX_MUD0_023,
+ TX_MUD0_024,
+ TX_MUD0_025,
+ TX_MUD0_026,
+ TX_MUD0_027,
+ TX_MUD0_028,
+ TX_MUD0_029,
+ TX_MUD0_030,
+ TX_MUD0_031,
+ TX_MUD0_032,
+ TX_MUD0_033,
+ TX_MUD0_034,
+ TX_MUD0_035,
+ TX_MUD0_036,
+ TX_MUD0_037,
+ TX_MUD0_038,
+ TX_MUD0_039,
+ TX_MUD0_040,
+ TX_MUD0_041,
+ TX_MUD0N000,
+ TX_MUD0N001,
+ TX_MUD0N002,
+ TX_MUD0N003,
+ TX_MUD0N004,
+ TX_MUD0N005,
+ TX_MUD0N006,
+ TX_MUD0N007,
+ TX_MUD0N008,
+ TX_MUD0N009,
+ TX_MUD0N010,
+ TX_MUD0N011,
+ TX_MUD0N012,
+ TX_MUD0N013,
+ TX_MUD0N014,
+ TX_MUD0N015,
+ TX_MUD0N016,
+ TX_MUD0N017,
+ // UNUSED
+ TX_MUD0N019,
+
+
TX_MUD2_040,
@@ -1173,6 +1239,7 @@ enum GameStringIDs {
TX_SPOKCOFF,
+ TX_STATICU1,
TX_END
@@ -1216,6 +1283,9 @@ const char * const g_gameStrings[] = {
"Dr. Cheever",
"Preax",
+ "Lt. Buchert",
+ "Harry Mudd",
+
"#BRID\\BRIDU146#Nothing to report, Captain.",
"#GENE\\G_024#Fascinating.",
@@ -2276,6 +2346,68 @@ const char * const g_gameStrings[] = {
"#LOVA\\LOVA_F55#Jim, we need to synthesize more to make the serum before we can use it.", // TYPO
+ "#MUD0\\MUD0_001#Kirk to Enterprise...",
+ "#MUD0\\MUD0_002#Well! Now I think we know why the Elasi pirates were so interested in finding out where Mudd was getting these!",
+ "#MUD0\\MUD0_003#Bones, Federation law is clear on this. Federation law protects everyone, even Harry Mudd. ",
+ "#MUD0\\MUD0_004#Don't push your luck, Harry. ",
+ "#MUD0\\MUD0_005#Harry, as official representatives of the Federation, and of Starfleet, we recognize your rights to legitimate salvage. Need I say more? ",
+ "#MUD0\\MUD0_006#I see, Harry. Well, we'll look around here while the Enterprise remains close by.",
+ "#MUD0\\MUD0_007#It was a rhetorical question, Harry. ",
+ "#MUD0\\MUD0_008#No Lieutenant, that was Horatio Jones, but Harry Mudd is worse.",
+ "#MUD0\\MUD0_009#Well, you're terrible trouble to me, Harry. Tell me what this is all about.",
+ "#MUD0\\MUD0_010#Why do I have the feeling that I am about to have a bad day? ",
+ "#MUD0\\MUD0_011#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#MUD0\\MUD0_012#These lenses were definitely not made to correct the aliens' vision. Mudd might've been able to sell these among humans as magnifiers, but these people must have had another use for them.",
+ "#MUD0\\MUD0_013#These lenses are finely made magnifiers, but I can't help but wonder if that's what the aliens really used them for. ",
+ "#MUD0\\MUD0_014#About as much as the Klingons are devoted to pacifism... ",
+ "#MUD0\\MUD0_015#For once Spock, I couldn't have said it better myself. ",
+ "#MUD0\\MUD0_016#Jim? You can't seriously be thinking of helping Mudd after all he's done. ",
+ "#MUD0\\MUD0_017#Then something went wrong, right?",
+ "#MUD0\\MUD0_018#Life support down to 25%, Captain.",
+ "#MUD0\\MUD0_019#Life support down to 50%, Captain.",
+ "#MUD0\\MUD0_020#Life support down to 75%, Captain.",
+ "#MUD0\\MUD0_021#These are computer memory transfer media, probably designed for use with the alien computer system.",
+ "#MUD0\\MUD0_022#Given the past record of Harry Mudd, Captain, I strongly recommend that you do not trust him. ",
+ "#MUD0\\MUD0_023#I am. Your record is that of a greedy, amoral, sociopathic fraud who preys upon human emotion, most notably, gullibility. ", // TYPO (gullability)
+ "#MUD0\\MUD0_024#There was the time that you tried to commandeer the Enterprise to sell wives to miners, and then there was the time you stole the Enterprise to exchange us for androids who were holding you prisoner... ",
+ "#MUD0\\MUD0_025#Kirk, after all we've been through you wouldn't shoot me would you?",
+ "#MUD0\\MUD0_026#Actually no, Doctor, not then. I'd started offering a few other little items I found -- Mudd's Limited coffee substitute -- a great little specialty item; lenses to a firm packaging BuildYerOwn telescope kits; a collection of novelty paints -- things like that. All of a sudden, the Elasi pirates are asking for me in every quadrant, and wanting to know where I'm getting my goods!",
+ "#MUD0\\MUD0_027#And we all know how devoted I am to Federation law. ",
+ "#MUD0\\MUD0_028#I happened upon this ship not long ago, and dutifully registered it as salvage, mind you! In the hold here, I discovered one of these devices -- in that box over there. When I tried one on a wall, it floated off the grease and dirt -- perfect for cleaning, near as I could see. I peddled a few of these Mudd's Miracle De-Grimers and everything was going perfectly well.",
+ "#MUD0\\MUD0_029#I understand perfectly, Captain -- Carry on, Captain.",
+ "#MUD0\\MUD0_030#It's a system that cost a gambler his life, boy. He crawled up to me and whispered it with his dying breath, and it can be yours for a mere... 200 credits. ",
+ "#MUD0\\MUD0_031#Kirk! Now that we're together... ",
+ "#MUD0\\MUD0_032#Kirk, my friend! When have I ever given you the slightest bit of trouble? ",
+ "#MUD0\\MUD0_033#Look around all you like, Captain, but I'll be keeping an eye on you. I've registered this derelict as my salvage, and I don't want you running off with all my prizes! ",
+ "#MUD0\\MUD0_034#Mr. Spock! Whatever gave you that impression! I thought Vulcans were supposed to be logical. ",
+ "#MUD0\\MUD0_035#Perhaps there have been a few minor misunderstandings... ",
+ "#MUD0\\MUD0_036#Starfleet! You're all the same. No sense of adventure! ",
+ "#MUD0\\MUD0_037#Welcome, Captain Kirk! So glad you're here. The Elasi have been terrible trouble to me.",
+ "#MUD0\\MUD0_038#Why I've never been so insulted in all my life! ",
+ "#MUD0\\MUD0_039#Didn't Mudd bring those tribbles on board the Enterprise?",
+ "#MUD0\\MUD0_040#So you say you know how to break the gambling machines on Curalon IV? ",
+ "#MUD0\\MUD0_041#Sorry Mr. Mudd. My mother didn't raise any fools in her family. ",
+ "#MUD0\\MUD0N000#A small energy device with a flanged opening at the front, about the size of one's thumbnail.",
+ "#MUD0\\MUD0N001#Dr. McCoy looks like he would like to violate the Hippocratic Oath on Harry Mudd, but you know he won't. ",
+ "#MUD0\\MUD0N002#Dust and grease lifts off the surface, leaving this item clean as new.",
+ "#MUD0\\MUD0N003#Harcourt Fenton Mudd. Of course, he's going to be honest and fair with you... ",
+ "#MUD0\\MUD0N004#James T. Kirk looks rather exasperated right now. ",
+ "#MUD0\\MUD0N005#Lieutenant Buchert is standing around, watching everyone else converse with Harry Mudd. ",
+ "#MUD0\\MUD0N006#Life support fails completely and you fall unconscious.",
+ "#MUD0\\MUD0N007#Mr. Spock is as close to annoyed as a Vulcan can get. ",
+ "#MUD0\\MUD0N008#Odd-looking contraptions small enough to hold in one hand.",
+ "#MUD0\\MUD0N009#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
+ "#MUD0\\MUD0N010#There are shiny, multi-sided, spherical objects in this box.",
+ "#MUD0\\MUD0N011#These two things fit together like they were made for each other.",
+ "#MUD0\\MUD0N012#This container holds bricks of what might have been preprocessed food -- a long time ago.",
+ "#MUD0\\MUD0N013#This container holds small mechanical components unfamiliar to you.",
+ "#MUD0\\MUD0N014#This lense, about the size of one's thumbnail, magnifies like a fine optical glass. ",
+ "#MUD0\\MUD0N015#This storage bay is stockpiled with all manner of goods.",
+ "#MUD0\\MUD0N016#You already have that.",
+ "#MUD0\\MUD0N017#You can't take that.",
+ "#MUD0\\MUD0N019#This place is cluttered with stored goods of every sort. It would take an army of workers weeks to examine every container and determine what is inside.",
+
+
"#MUD2\\MUD2_040#You look troubled, Captain.",
@@ -2289,6 +2421,7 @@ const char * const g_gameStrings[] = {
"#sfx\\spokcoff#cough... cough...",
+ "#SFX\\STATICU1#Ent... neu ... trans...",
};
}
Commit: 7cff7248642f3639f9f880178232686f60b7e315
https://github.com/scummvm/scummvm/commit/7cff7248642f3639f9f880178232686f60b7e315
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: MUDD1
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/mudd1.cpp
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index d87c690..fd1f61f 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -41,7 +41,7 @@ void StarTrekEngine::initAwayMission() {
_roomIndexToLoad = -1;
// Load crew positions for beaming in
- initAwayCrewPositions(4);
+ initAwayCrewPositions(1);
}
void StarTrekEngine::runAwayMission() {
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index af93218..2e3663f 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -190,15 +190,22 @@ struct AwayMission {
struct {
byte field29; // 0x29
+ bool torpedoLoaded; // 0x33
+ bool knowAboutTorpedo; // 0x34
// True if you've combined the lense + degrimer and fired it off, discovering
// it's a weapon
bool discoveredLenseAndDegrimerFunction; // 0x3c
+ byte torpedoStatus; // 0x3d
bool gotMemoryDisk; // 0x48
bool gotLense; // 0x49
bool gotDegrimer; // 0x4a
bool enteredRoom0ForFirstTime; // 0x54
+ bool gotPointsForLoadingTorpedo; // 0x55
+ bool gotPointsForPressingRedButton; // 0x56
+ bool enteredRoom1ForFirstTime; // 0x58
+ bool field58; // 0x58
int16 missionScore; // 0x5a
} mudd;
};
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 0076e76..b727c2d 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -36,6 +36,8 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_rdfData = new byte[size];
rdfFile->read(_rdfData, size);
+ _roomIndex = name.lastChar() - '0';
+
// Find room-specific code table
if (name == "DEMON0") {
_roomActionList = demon0ActionList;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index ad08ce3..144434b 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -95,18 +95,20 @@ private:
RoomAction *_roomActionList;
int _numRoomActions;
+ int _roomIndex; // ie. for DEMON2, this is 2
+
int findFunctionPointer(int action, void (Room::*funcPtr)());
// Interface for room-specific code
- void loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66 = 0); // Cmd 0x00
+ void loadActorAnim(int actorIndex, Common::String anim, int16 x = -1, int16 y = -1, uint16 field66 = 0); // Cmd 0x00
void loadActorAnimC(int actorIndex, Common::String anim, int16 x, int16 y, void (Room::*funcPtr)());// Cmd 0x00
void loadActorStandAnim(int actorIndex); // Cmd 0x01
- void loadActorAnim2(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66 = 0);// Cmd 0x02
+ void loadActorAnim2(int actorIndex, Common::String anim, int16 x = -1, int16 y = -1, uint16 field66 = 0);// Cmd 0x02
int showRoomSpecificText(const char **textAddr); // (Deprecated, use function below) // Cmd 0x03
- int showText(const TextRef *text); // Cmd 0x03
- int showText(TextRef speaker, TextRef text); // Cmd 0x03
- int showText(TextRef text); // Cmd 0x03
+ int showText(const TextRef *text); // Cmd 0x03
+ int showText(TextRef speaker, TextRef text); // Cmd 0x03
+ int showText(TextRef text); // Cmd 0x03
void giveItem(int item); // Cmd 0x04
// Command 0x05: "demon4ShowSunPuzzle"
void loadRoomIndex(int roomIndex, int spawnIndex); // Cmd 0x06
@@ -1163,6 +1165,46 @@ public:
// MUDD1
void mudd1Tick1();
+ void mudd1Timer1Expired();
+ void mudd1UseCommunicator();
+ void mudd1UseSpockOnBlueButton();
+ void mudd1SpockReachedBlueButton();
+ void mudd1SpockPressedBlueButton();
+ void mudd1CraneFinishedMoving();
+ void mudd1UseSpockOnYellowButton();
+ void mudd1SpockReachedYellowButton();
+ void mudd1SpockPressedYellowButton();
+ void mudd1UseSpockOnRedButton();
+ void mudd1SpockReachedRedButton();
+ void mudd1SpockPressedRedButton();
+ void mudd1GetTorpedo();
+ void mudd1UseSTricorderOnTorpedo();
+ void mudd1UseSTricorderOnTorpedoLauncher();
+ void mudd1UseSTricorderOnButton();
+ void mudd1UseSTricorderOnCrane();
+ void mudd1UseMedkitAnywhere();
+ void mudd1LookAnywhere();
+ void mudd1LookAtTorpedo();
+ void mudd1LookAtFallenTorpedo();
+ void mudd1LookAtTorpedoLauncher();
+ void mudd1LookAtKirk();
+ void mudd1LookAtSpock();
+ void mudd1LookAtMccoy();
+ void mudd1LookAtRedshirt();
+ void mudd1LookAtCrane();
+ void mudd1LookAtRedButton();
+ void mudd1LookAtBlueButton();
+ void mudd1LookAtYellowButton();
+ void mudd1TalkToKirk();
+ void mudd1TalkToSpock();
+ void mudd1TalkToMccoy();
+ void mudd1TalkToRedshirt();
+ void mudd1WalkToSouthDoor();
+ void mudd1TouchedHotspot2();
+ void mudd1WalkToNorthDoor();
+ void mudd1TouchedHotspot1();
+ void mudd1WalkToWestDoor();
+ void mudd1TouchedHotspot0();
// MUDD2
void mudd2Tick1();
@@ -1176,6 +1218,8 @@ public:
// MUDD5
void mudd5Tick1();
+ // MUDDA
+
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
@@ -1283,8 +1327,8 @@ private:
} love;
struct {
- // mudd0
- bool walkingToDoor; // 0x22a9
+ // common
+ byte walkingToDoor;
} mudd;
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 92b5f98..23c9653 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1413,10 +1413,13 @@ RoomAction mudd0ActionList[] = {
{ Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::mudd0UseSTricorderOnMemoryDiskBox },
{ Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::mudd0UseSTricorderOnDegrimerBox },
{ Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::mudd0UseMTricorderOnLense },
+
+ // TODO: move these to common code
{ Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
{ Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
{ Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
{ Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
+
{ Action(ACTION_GET, 0x21, 0, 0), &Room::mudd0GetLense },
{ Action(ACTION_GET, 0x20, 0, 0), &Room::mudd0GetMemoryDisk },
{ Action(ACTION_GET, 0x22, 0, 0), &Room::mudd0GetDegrimer },
@@ -1442,7 +1445,64 @@ RoomAction mudd0ActionList[] = {
RoomAction mudd1ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd1Tick1 },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd1Timer1Expired },
+
+ { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd1UseCommunicator },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x23, 0), &Room::mudd1UseSpockOnBlueButton },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::mudd1SpockReachedBlueButton },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::mudd1SpockPressedBlueButton },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::mudd1CraneFinishedMoving },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x24, 0), &Room::mudd1UseSpockOnYellowButton },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::mudd1SpockReachedYellowButton },
+ { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::mudd1SpockPressedYellowButton },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x25, 0), &Room::mudd1UseSpockOnRedButton },
+ { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::mudd1SpockReachedRedButton },
+ { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::mudd1SpockPressedRedButton },
+
+ // Common code
+ { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
+ { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
+ { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
+
+ { Action(ACTION_GET, 9, 0, 0), &Room::mudd1GetTorpedo },
+ { Action(ACTION_GET, 0x21, 0, 0), &Room::mudd1GetTorpedo },
+ { Action(ACTION_GET, 0x20, 0, 0), &Room::mudd1GetTorpedo },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::mudd1UseSTricorderOnTorpedo },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 9, 0), &Room::mudd1UseSTricorderOnTorpedo },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::mudd1UseSTricorderOnTorpedo },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::mudd1UseSTricorderOnTorpedoLauncher },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x25, 0), &Room::mudd1UseSTricorderOnButton },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::mudd1UseSTricorderOnButton },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x24, 0), &Room::mudd1UseSTricorderOnButton },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::mudd1UseSTricorderOnCrane },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd1UseMedkitAnywhere },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::mudd1LookAnywhere },
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd1LookAtTorpedo },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::mudd1LookAtTorpedo },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::mudd1LookAtFallenTorpedo },
+ { Action(ACTION_LOOK, 0x22, 0, 0), &Room::mudd1LookAtTorpedoLauncher },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd1LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd1LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd1LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd1LookAtRedshirt },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::mudd1LookAtCrane },
+ { Action(ACTION_LOOK, 0x25, 0, 0), &Room::mudd1LookAtRedButton },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::mudd1LookAtBlueButton },
+ { Action(ACTION_LOOK, 0x24, 0, 0), &Room::mudd1LookAtYellowButton },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd1TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd1TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd1TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd1TalkToRedshirt },
+ { Action(ACTION_WALK, 0x28, 0, 0), &Room::mudd1WalkToSouthDoor },
+ { Action(ACTION_TOUCHED_HOTSPOT, 2, 0, 0), &Room::mudd1TouchedHotspot2 },
+ { Action(ACTION_WALK, 0x27, 0, 0), &Room::mudd1WalkToNorthDoor },
+ { Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::mudd1TouchedHotspot1 },
+ { Action(ACTION_WALK, 0x26, 0, 0), &Room::mudd1WalkToWestDoor },
+ { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd1TouchedHotspot0 },
+ // TODO: remainder? something about losing atmosphere?
};
+
RoomAction mudd2ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd2Tick1 },
};
diff --git a/engines/startrek/rooms/mudd1.cpp b/engines/startrek/rooms/mudd1.cpp
index 9029251..eecc846 100644
--- a/engines/startrek/rooms/mudd1.cpp
+++ b/engines/startrek/rooms/mudd1.cpp
@@ -22,13 +22,302 @@
#include "startrek/room.h"
-#define OBJECT_DOOR1 8
+#define OBJECT_CRANE 8
+#define OBJECT_TORPEDO 9
+#define OBJECT_CRANE_ANIMATION 10
+#define OBJECT_NORTH_DOOR 11
+#define OBJECT_WEST_DOOR 12
+#define OBJECT_ALIENDV 13
-#define HOTSPOT_CONSOLE 0x20
+#define HOTSPOT_TORPEDO 0x20
+#define HOTSPOT_FALLEN_TORPEDO 0x21
+#define HOTSPOT_TORPEDO_LAUNCHER 0x22
+#define HOTSPOT_BLUE_BUTTON 0x23
+#define HOTSPOT_YELLOW_BUTTON 0x24
+#define HOTSPOT_PURPLE_BUTTON 0x25
+#define HOTSPOT_WEST_DOOR 0x26
+#define HOTSPOT_NORTH_DOOR 0x27
+#define HOTSPOT_SOUTH_DOOR 0x28
+
+// BUG: The action menu appears sort of behind a torpedo. ScummVM-exclusive bug. Also,
+// during the loading animation, it can appear on top of Kirk if he's standing in front
+// (not scummvm-exclusive).
namespace StarTrek {
void Room::mudd1Tick1() {
+ playVoc("MUD1LOOP"); // BUGFIX: moved this out of below if statement
+
+ if (!_vm->_awayMission.mudd.enteredRoom1ForFirstTime) {
+ playMidiMusicTracks(0);
+ _vm->_awayMission.mudd.enteredRoom1ForFirstTime = true;
+ }
+
+ loadActorAnim2(OBJECT_CRANE, "s4wbhs", 0x9b, 0x31);
+
+ if (!_vm->_awayMission.mudd.torpedoLoaded)
+ loadActorAnim(OBJECT_TORPEDO, "s4wbcs", 0x32, 0x65);
+}
+
+void Room::mudd1Timer1Expired() {
+ playSoundEffectIndex(SND_07);
+}
+
+void Room::mudd1UseCommunicator() {
+ showText(TX_SPEAKER_KIRK, TX_MUD1_001);
+ showText(TX_SPEAKER_UHURA, TX_STATICU1);
+}
+
+
+void Room::mudd1UseSpockOnBlueButton() { // Loads up the torpedo
+ if (!_vm->_awayMission.mudd.torpedoLoaded) {
+ walkCrewmanC(OBJECT_SPOCK, 0x2f, 0x9f, &Room::mudd1SpockReachedBlueButton);
+ _vm->_awayMission.disableInput = true;
+ if (!_vm->_awayMission.mudd.gotPointsForLoadingTorpedo) {
+ _vm->_awayMission.mudd.gotPointsForLoadingTorpedo = true;
+ _vm->_awayMission.mudd.missionScore += 2;
+ }
+ }
+}
+
+void Room::mudd1SpockReachedBlueButton() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ loadActorAnimC(OBJECT_SPOCK, "susemn", -1, -1, &Room::mudd1SpockPressedBlueButton);
+ _vm->_awayMission.timers[1] = 5;
+}
+
+void Room::mudd1SpockPressedBlueButton() {
+ playVoc("crn2can");
+ loadActorAnim(OBJECT_CRANE, "s4wbcr");
+ loadActorAnim(OBJECT_TORPEDO, "s4wbcn");
+ loadActorAnimC(OBJECT_CRANE_ANIMATION, "s4wbsl", 0x77, 0x83, &Room::mudd1CraneFinishedMoving);
+ _vm->_awayMission.mudd.torpedoLoaded = true;
+}
+
+void Room::mudd1CraneFinishedMoving() {
+ _vm->_awayMission.disableInput = false;
+ walkCrewman(OBJECT_SPOCK, 0x43, 0x9f);
+
+ if (_vm->_awayMission.mudd.torpedoLoaded)
+ showText(TX_SPEAKER_SPOCK, TX_MUD1_017);
+ else
+ showText(TX_SPEAKER_SPOCK, TX_MUD1_016);
+}
+
+
+void Room::mudd1UseSpockOnYellowButton() { // Unloads the torpedo
+ if (_vm->_awayMission.mudd.torpedoLoaded) {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ walkCrewmanC(OBJECT_SPOCK, 0x2f, 0x9f, &Room::mudd1SpockReachedYellowButton);
+ _vm->_awayMission.disableInput = true;
+ }
+}
+
+void Room::mudd1SpockReachedYellowButton() {
+ loadActorAnim2(OBJECT_SPOCK, "susemn", -1, -1, 3);
+ _vm->_awayMission.timers[1] = 5;
+}
+
+void Room::mudd1SpockPressedYellowButton() {
+ playVoc("crn2rack");
+ loadActorAnim2(OBJECT_CRANE, "s4wbhb");
+ loadActorAnim2(OBJECT_TORPEDO, "s4wbcb", 0x32, 0x65, 0);
+ loadActorAnimC(OBJECT_CRANE_ANIMATION, "s4wbsb", -1, -1, &Room::mudd1CraneFinishedMoving);
+ _vm->_awayMission.mudd.torpedoLoaded = false;
+}
+
+
+void Room::mudd1UseSpockOnRedButton() {
+ if (_vm->_awayMission.mudd.torpedoLoaded) {
+ walkCrewmanC(OBJECT_SPOCK, 0x2f, 0x9f, &Room::mudd1SpockReachedRedButton);
+ _vm->_awayMission.disableInput = true;
+ if (!_vm->_awayMission.mudd.gotPointsForPressingRedButton) {
+ _vm->_awayMission.mudd.gotPointsForPressingRedButton = true;
+ _vm->_awayMission.mudd.missionScore += 3;
+ }
+ }
+}
+
+void Room::mudd1SpockReachedRedButton() {
+ loadActorAnimC(OBJECT_SPOCK, "susemn", -1, -1, &Room::mudd1SpockPressedRedButton);
+ _vm->_awayMission.timers[1] = 5;
+}
+
+void Room::mudd1SpockPressedRedButton() {
+ walkCrewman(OBJECT_SPOCK, 0x43, 0x9f);
+
+ showText(TX_SPEAKER_SPOCK, TX_MUD1_022);
+ showText(TX_SPEAKER_SPOCK, TX_MUD1_021);
+ showText(TX_SPEAKER_SPOCK, TX_MUD1_023);
+
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.mudd.knowAboutTorpedo = true;
+
+ const int choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_MUD1_004,
+ TX_MUD1_003,
+ TX_MUD1_007,
+ TX_BLANK
+ };
+
+ int choice = showText(choices);
+
+ switch (choice) {
+ case 0:
+ _vm->_awayMission.mudd.torpedoStatus = false;
+
+ // ENHANCEMENT: Original text was just "(Spock raises eyebrow)" without any audio.
+ // This changes it to a narration to make it flow better.
+ showText(TX_DEM0N009);
+ break;
+
+ case 1:
+ showText(TX_SPEAKER_KIRK, TX_MUD1_007);
+ // fall through
+
+ case 2:
+ _vm->_awayMission.mudd.torpedoStatus = true;
+ showText(TX_SPEAKER_UHURA, TX_STATICU1);
+ break;
+ }
+}
+
+
+void Room::mudd1GetTorpedo() {
+ showText(TX_MUD1N014);
+}
+
+void Room::mudd1UseSTricorderOnTorpedo() {
+ spockScan(DIR_W, TX_MUD1_025, false);
+ showText(TX_SPEAKER_BUCHERT, TX_MUD1_027);
+ showText(TX_SPEAKER_SPOCK, TX_MUD1_020);
+ showText(TX_SPEAKER_BUCHERT, TX_MUD1_028);
+ showText(TX_SPEAKER_SPOCK, TX_MUD1_024);
+}
+
+void Room::mudd1UseSTricorderOnTorpedoLauncher() {
+ spockScan(DIR_W, TX_MUD1_010, false);
+}
+
+void Room::mudd1UseSTricorderOnButton() {
+ // ENHANCEMENT: Do the whole "spockScan" thing, don't just show the text
+ spockScan(DIR_W, TX_MUD1_015, false);
+}
+
+void Room::mudd1UseSTricorderOnCrane() {
+ // ENHANCEMENT: See above
+ spockScan(DIR_N, TX_MUD1_014, false);
+}
+
+void Room::mudd1UseMedkitAnywhere() {
+ showText(TX_SPEAKER_MCCOY, TX_MUD1_011);
+}
+
+void Room::mudd1LookAnywhere() {
+ showText(TX_MUD1N011);
+}
+
+void Room::mudd1LookAtTorpedo() {
+ showText(TX_MUD1N002);
+}
+
+void Room::mudd1LookAtFallenTorpedo() {
+ showText(TX_MUD1N012);
+}
+
+void Room::mudd1LookAtTorpedoLauncher() {
+ showText(TX_MUD1N003);
+}
+
+void Room::mudd1LookAtKirk() {
+ showText(TX_MUD1N005);
+}
+
+void Room::mudd1LookAtSpock() {
+ showText(TX_MUD1N009);
+}
+
+void Room::mudd1LookAtMccoy() {
+ showText(TX_MUD1N008);
+}
+
+void Room::mudd1LookAtRedshirt() {
+ showText(TX_MUD1N006);
+}
+
+void Room::mudd1LookAtCrane() {
+ showText(TX_MUD1N000);
+}
+
+void Room::mudd1LookAtRedButton() {
+ showText(TX_MUD1N001);
+}
+
+void Room::mudd1LookAtBlueButton() {
+ showText(TX_MUD1N015);
+}
+
+void Room::mudd1LookAtYellowButton() {
+ showText(TX_MUD1N016);
+}
+
+void Room::mudd1TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_MUD1_006);
+ showText(TX_SPEAKER_MCCOY, TX_MUD1_013);
+ showText(TX_SPEAKER_KIRK, TX_MUD1_005);
+}
+
+void Room::mudd1TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_MUD1_019);
+ showText(TX_SPEAKER_KIRK, TX_MUD1_008);
+}
+
+void Room::mudd1TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_MUD1_012);
+}
+
+void Room::mudd1TalkToRedshirt() {
+ showText(TX_SPEAKER_BUCHERT, TX_MUD1_026);
+ showText(TX_SPEAKER_KIRK, TX_MUD1_009);
+}
+
+void Room::mudd1WalkToSouthDoor() {
+ _roomVar.mudd.walkingToDoor = 1;
+ _vm->_awayMission.disableInput = true;
+ walkCrewman(OBJECT_KIRK, 0xa0, 0xc7);
+}
+
+void Room::mudd1TouchedHotspot2() { // Trigger door at bottom of room
+ if (_roomVar.mudd.walkingToDoor == 1) {
+ playVoc("SMADOOR3");
+ }
+}
+
+void Room::mudd1WalkToNorthDoor() {
+ _roomVar.mudd.walkingToDoor = 1;
+ _vm->_awayMission.disableInput = true;
+ walkCrewman(OBJECT_KIRK, 0xab, 0x71);
+}
+
+void Room::mudd1TouchedHotspot1() { // Trigger door at top of room
+ if (_roomVar.mudd.walkingToDoor == 1) {
+ playVoc("SMADOOR3");
+ loadActorAnim(OBJECT_NORTH_DOOR, "s4wbd1", 0xab, 0x73);
+ }
+}
+
+void Room::mudd1WalkToWestDoor() {
+ _roomVar.mudd.walkingToDoor = 2;
+ _vm->_awayMission.disableInput = true;
+ walkCrewman(OBJECT_KIRK, 0x35, 0x71);
+}
+
+void Room::mudd1TouchedHotspot0() {
+ if (_roomVar.mudd.walkingToDoor == 2) {
+ playVoc("SMADOOR3");
+ loadActorAnim(OBJECT_WEST_DOOR, "s4wbd2", 0x37, 0x73);
+ }
}
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 24fa741..5843576 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -84,7 +84,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxHasMultipleChoices = false;
_missionToLoad = "MUDD";
- _roomIndexToLoad = 0;
+ _roomIndexToLoad = 1;
for (int i = 0; i < NUM_OBJECTS; i++)
_itemList[i] = g_itemList[i];
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 93f1b8f..c5034a5 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -1226,6 +1226,53 @@ enum GameStringIDs {
TX_MUD0N019,
+ TX_MUD1_001,
+ TX_MUD1_002,
+ TX_MUD1_003,
+ TX_MUD1_004,
+ TX_MUD1_005,
+ TX_MUD1_006,
+ TX_MUD1_007,
+ TX_MUD1_008,
+ TX_MUD1_009,
+ TX_MUD1_010,
+ TX_MUD1_011,
+ TX_MUD1_012,
+ TX_MUD1_013,
+ TX_MUD1_014,
+ TX_MUD1_015,
+ TX_MUD1_016,
+ TX_MUD1_017,
+ // UNUSED
+ TX_MUD1_019,
+ TX_MUD1_020,
+ TX_MUD1_021,
+ TX_MUD1_022,
+ TX_MUD1_023,
+ TX_MUD1_024,
+ TX_MUD1_025,
+ TX_MUD1_026,
+ TX_MUD1_027,
+ TX_MUD1_028,
+ TX_MUD1N000,
+ TX_MUD1N001,
+ TX_MUD1N002,
+ TX_MUD1N003,
+ TX_MUD1N004,
+ TX_MUD1N005,
+ TX_MUD1N006,
+ TX_MUD1N007,
+ TX_MUD1N008,
+ TX_MUD1N009,
+ TX_MUD1N010,
+ TX_MUD1N011,
+ TX_MUD1N012,
+ TX_MUD1N013,
+ TX_MUD1N014,
+ TX_MUD1N015,
+ TX_MUD1N016,
+
+
TX_MUD2_040,
@@ -2408,6 +2455,52 @@ const char * const g_gameStrings[] = {
"#MUD0\\MUD0N019#This place is cluttered with stored goods of every sort. It would take an army of workers weeks to examine every container and determine what is inside.",
+ "#MUD1\\MUD1_001#Kirk to Enterprise...",
+ "#MUD1\\MUD1_002#Well, now! I think we know why the Elasi pirates were so interested in finding out where Mudd was getting these!",
+ "#MUD1\\MUD1_003#I agree that we should take it aboard the Enterprise. ",
+ "#MUD1\\MUD1_004#I don't think we should tinker with technology we don't understand, Spock. And I'm surprised you'd suggest such a thing.",
+ "#MUD1\\MUD1_005#I know, Bones. ",
+ "#MUD1\\MUD1_006#I wonder what's happening on the Enterprise right now. ",
+ "#MUD1\\MUD1_007#I'll try to raise the ship... Kirk to Enterprise, Kirk to Enterprise...",
+ "#MUD1\\MUD1_008#If the Elasi gets hold of this, they'll make Mudd seem like a perfect caretaker by comparison. ",
+ "#MUD1\\MUD1_009#That machinery in the middle of the room, however, is like nothing I recognize -- and I thought I'd seen just about everything.",
+ "#MUD1\\MUD1_010#A weapons-delivery system. It appears to be an accessory tied directly to the alien equivalent of our ship's phasers and photon torpedoes.",
+ "#MUD1\\MUD1_011#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#MUD1\\MUD1_012#I wonder where that Mudd has gone. I wouldn't let him out of my sight... mind you, I'm not too crazy about having him in my sight either. ",
+ "#MUD1\\MUD1_013#Scotty will take good care of it, Jim. He has before. ",
+ "#MUD1\\MUD1_014#It seems to be part of the loading system for the weapon. It is also fully functional.",
+ "#MUD1\\MUD1_015#The control panel has power running to it, Captain.",
+ "#MUD1\\MUD1_016#The device has been unloaded, Captain.",
+ "#MUD1\\MUD1_017#The device has finished loading, Captain.",
+ "#MUD1\\MUD1_019#A most interesting technology, Captain.",
+ "#MUD1\\MUD1_020#Evidently these are more than theoretical, Lt. Buchert. The energy initially released is infinitesimally small but boosts itself until the power finally released is comparable to our photon torpedoes.",
+ "#MUD1\\MUD1_021#However, I've already examined the weapons console and the main weapons battery on this ship was completely destroyed in the action which made her a derelict.",
+ "#MUD1\\MUD1_022#I believe, Captain, that this weapon must be hooked up through the main weapons battery.",
+ "#MUD1\\MUD1_023#Mr. Scott would have to go over this thoroughly, but I would recommend we try to take this weapon with us to the Enterprise.",
+ "#MUD1\\MUD1_024#The machinery to deliver these cartridges would be an engineering feat as well, Captain.",
+ "#MUD1\\MUD1_025#Unique, Captain. I believe these are self-referencing packed-quantum cartridges. ",
+ "#MUD1\\MUD1_026#It looks to me like these people knew how to defend themselves, Captain.",
+ "#MUD1\\MUD1_027#Powerboosters! I've read about those -- but they're just theoretical.",
+ "#MUD1\\MUD1_028#The technical journals discussing the possibilities indicated it would create a weapon of greater range than those we have now, if not a greater punch. ",
+ "#MUD1\\MUD1N000#A large claw-like device hanging from the ceiling.",
+ "#MUD1\\MUD1N001#A red triangular button.",
+ "#MUD1\\MUD1N002#A row of unmarked cylindrical containers.",
+ "#MUD1\\MUD1N003#An elaborate piece of alien-looking machinery.",
+ "#MUD1\\MUD1N004#Dust and grease lifts off the surface, leaving this item clean as new.",
+ "#MUD1\\MUD1N005#James T. Kirk, dwarfed by the technology that surrounds him. ",
+ "#MUD1\\MUD1N006#Lieutenant Buchert, waiting for a chance to perform his duty. ",
+ "#MUD1\\MUD1N007#Life support fails completely and you fall unconscious.",
+ "#MUD1\\MUD1N008#McCoy is scowling, probably from your meeting with Harcourt Fenton Mudd. ",
+ "#MUD1\\MUD1N009#Mr. Spock is looking forward to the moment that he can sit down at the main computer and analyze the findings of this mission. ",
+ "#MUD1\\MUD1N010#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
+ "#MUD1\\MUD1N011#The room reminds you of the weapons-room of some old-style warships from the early days of starfaring.",
+ "#MUD1\\MUD1N012#These cylinders have fallen down from the rest.",
+ "#MUD1\\MUD1N013#These two things fit together like they were made for each other.",
+ "#MUD1\\MUD1N014#This is much too heavy to lift.",
+ "#MUD1\\MUD1N015#Three triangular blue buttons.",
+ "#MUD1\\MUD1N016#Two yellow triangular buttons.",
+
+
"#MUD2\\MUD2_040#You look troubled, Captain.",
Commit: c47150358157524c4b0079b7927ded660359f99f
https://github.com/scummvm/scummvm/commit/c47150358157524c4b0079b7927ded660359f99f
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: MUDD2
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/mudd0.cpp
engines/startrek/rooms/mudd1.cpp
engines/startrek/rooms/mudd2.cpp
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index fd1f61f..694e0cc 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -41,7 +41,7 @@ void StarTrekEngine::initAwayMission() {
_roomIndexToLoad = -1;
// Load crew positions for beaming in
- initAwayCrewPositions(1);
+ initAwayCrewPositions(3);
}
void StarTrekEngine::runAwayMission() {
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 2e3663f..612e7dc 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -192,14 +192,21 @@ struct AwayMission {
byte field29; // 0x29
bool torpedoLoaded; // 0x33
bool knowAboutTorpedo; // 0x34
+ bool field36; // 0x36
+ bool muddDroppedCapsule; // 0x39
// True if you've combined the lense + degrimer and fired it off, discovering
// it's a weapon
bool discoveredLenseAndDegrimerFunction; // 0x3c
byte torpedoStatus; // 0x3d
+ bool field3f; // 0x3f
bool gotMemoryDisk; // 0x48
bool gotLense; // 0x49
bool gotDegrimer; // 0x4a
+ bool field4c; // 0x4c
+ bool muddUnconscious; // 0x4d
+ byte field4e; // 0x4e
+ bool muddInhaledGas; // 0x4f
bool enteredRoom0ForFirstTime; // 0x54
bool gotPointsForLoadingTorpedo; // 0x55
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 144434b..d76589e 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1207,7 +1207,53 @@ public:
void mudd1TouchedHotspot0();
// MUDD2
+ void mudd2WalkToNorthDoor();
+ void mudd2TouchedHotspot0();
+ void mudd2WalkToSouthDoor();
+ void mudd2TouchedHotspot1();
void mudd2Tick1();
+ void mudd2Timer1Expired();
+ void mudd2UseSTricorderAnywhere();
+ void mudd2UseSpockOnCapsules();
+ void mudd2GetCapsules();
+ void mudd2MccoyReachedCapsules();
+ void mudd2MccoyPickedUpCapsules();
+ void mudd2UseCommunicator();
+ void mudd2LookAtCapsules();
+ void mudd2UseMTricorderOnCapsules();
+ void mudd2UseCapsuleOnControlPanel();
+ void mudd2MccoyReachedControlPanel();
+ void mudd2MccoyPutCapsuleInControlPanel();
+ void mudd2UseKirkOnBed();
+ void mudd2KirkReachedBed();
+ void mudd2MuddNoticedKirk();
+ void mudd2MuddDroppedCapsule();
+ void mudd2UsePhaserOnMudd();
+ void mudd2UseSpockOnMudd();
+ void mudd2SpockReachedMudd();
+ void mudd2SpockPinchedMudd();
+ void mudd2UseKirkOnMudd();
+ void mudd2UseRedshirtOnMudd();
+ void mudd2RedshirtReachedMudd();
+ void mudd2Timer2Expired();
+ void mudd2MuddFinishedPushingRedshirt();
+ void mudd2RedshirtPushedAway();
+ void mudd2UseMTricorderOnMudd();
+ void mudd2UseMedkitOnMudd();
+ void mudd2MccoyReachedMudd();
+ void mudd2MccoyCuredMudd();
+ void mudd2LookAtKirk();
+ void mudd2LookAtSpock();
+ void mudd2LookAtMccoy();
+ void mudd2LookAtRedshirt();
+ void mudd2LookAtMudd();
+ void mudd2LookAtControlPanel();
+ void mudd2LookAtBed();
+ void mudd2TalkToKirk();
+ void mudd2TalkToSpock();
+ void mudd2TalkToMccoy();
+ void mudd2TalkToRedshirt();
+ void mudd2TalkToMudd();
// MUDD3
void mudd3Tick1();
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 23c9653..d1f3b78 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1460,10 +1460,10 @@ RoomAction mudd1ActionList[] = {
{ Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::mudd1SpockPressedRedButton },
// Common code
+ { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
{ Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
{ Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
{ Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
- { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
{ Action(ACTION_GET, 9, 0, 0), &Room::mudd1GetTorpedo },
{ Action(ACTION_GET, 0x21, 0, 0), &Room::mudd1GetTorpedo },
@@ -1504,8 +1504,69 @@ RoomAction mudd1ActionList[] = {
};
RoomAction mudd2ActionList[] = {
+ { Action(ACTION_WALK, 0x21, 0, 0), &Room::mudd2WalkToNorthDoor },
+ { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd2TouchedHotspot0 },
+ { Action(ACTION_WALK, 0x22, 0, 0), &Room::mudd2WalkToSouthDoor },
+ { Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::mudd2TouchedHotspot1 },
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd2Tick1 },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd2Timer1Expired },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::mudd2UseSTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::mudd2UseSpockOnCapsules },
+ { Action(ACTION_GET, 0x20, 0, 0), &Room::mudd2GetCapsules },
+ { Action(ACTION_FINISHED_WALKING, 12, 0, 0), &Room::mudd2MccoyReachedCapsules },
+ { Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::mudd2MccoyPickedUpCapsules },
+ { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd2UseCommunicator },
+
+ // Common code
+ { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
+ { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
+ { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
+ { Action(ACTION_FINISHED_ANIMATION, 18, 0, 0), &Room::mudd0FiredAlienDevice },
+
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd2LookAtCapsules },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0x20, 0), &Room::mudd2UseMTricorderOnCapsules },
+ { Action(ACTION_USE, OBJECT_ICAPSULE, 0x23, 0), &Room::mudd2UseCapsuleOnControlPanel },
+ { Action(ACTION_FINISHED_WALKING, 15, 0, 0), &Room::mudd2MccoyReachedControlPanel },
+ { Action(ACTION_FINISHED_ANIMATION, 15, 0, 0), &Room::mudd2MccoyPutCapsuleInControlPanel },
+ { Action(ACTION_USE, OBJECT_KIRK, 0x24, 0), &Room::mudd2UseKirkOnBed },
+ { Action(ACTION_USE, OBJECT_KIRK, 0x25, 0), &Room::mudd2UseKirkOnBed },
+ { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::mudd2KirkReachedBed },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::mudd2MuddNoticedKirk },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::mudd2MuddDroppedCapsule },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::mudd2UsePhaserOnMudd },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::mudd2UsePhaserOnMudd },
+
+ { Action(ACTION_USE, OBJECT_SPOCK, 8, 0), &Room::mudd2UseSpockOnMudd },
+ { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::mudd2SpockReachedMudd },
+ { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::mudd2SpockPinchedMudd },
+ { Action(ACTION_USE, OBJECT_KIRK, 8, 0), &Room::mudd2UseKirkOnMudd },
+
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 8, 0), &Room::mudd2UseRedshirtOnMudd },
+ { Action(ACTION_FINISHED_WALKING, 16, 0, 0), &Room::mudd2RedshirtReachedMudd },
+ { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::mudd2Timer2Expired },
+ { Action(ACTION_FINISHED_ANIMATION, 17, 0, 0), &Room::mudd2MuddFinishedPushingRedshirt },
+ { Action(ACTION_FINISHED_ANIMATION, 16, 0, 0), &Room::mudd2RedshirtPushedAway },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::mudd2UseMTricorderOnMudd },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, 8, 0), &Room::mudd2UseMedkitOnMudd },
+ { Action(ACTION_USE, OBJECT_MCCOY, 8, 0), &Room::mudd2UseMedkitOnMudd },
+ { Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::mudd2MccoyReachedMudd },
+ { Action(ACTION_FINISHED_ANIMATION, 11, 0, 0), &Room::mudd2MccoyCuredMudd },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd2LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd2LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd2LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd2LookAtRedshirt },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::mudd2LookAtMudd },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::mudd2LookAtControlPanel },
+ { Action(ACTION_LOOK, 0x25, 0, 0), &Room::mudd2LookAtBed },
+ { Action(ACTION_LOOK, 0x24, 0, 0), &Room::mudd2LookAtBed },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd2TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd2TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd2TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd2TalkToRedshirt },
+ { Action(ACTION_TALK, 8, 0, 0), &Room::mudd2TalkToMudd },
+ // TODO: remainder? something about losing atmosphere?
};
+
RoomAction mudd3ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd3Tick1 },
};
diff --git a/engines/startrek/rooms/mudd0.cpp b/engines/startrek/rooms/mudd0.cpp
index d482aa7..54b3a22 100644
--- a/engines/startrek/rooms/mudd0.cpp
+++ b/engines/startrek/rooms/mudd0.cpp
@@ -165,17 +165,23 @@ void Room::mudd0UseLenseOnDegrimer() {
_vm->_awayMission.mudd.missionScore++;
showText(TX_MUD0N011);
- // Identical (?) audio files: TX_MUD0N011, TX_MUD1N013
+ // Identical (?) audio files: TX_MUD0N011, TX_MUD1N013, TX_MUD2N010
}
void Room::mudd0UseAlienDevice() {
+ const int deviceObjectIndices[] = {
+ 9, // MUDD0
+ 13, // MUDD1
+ 11, // MUDD2
+ };
+
_vm->_awayMission.disableInput = true;
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
loadActorStandAnim(OBJECT_KIRK);
Common::Point pos = getActorPos(OBJECT_KIRK);
- loadActorAnimC(OBJECT_ALIENDV, "s4cbxp", pos.x, 10, &Room::mudd0FiredAlienDevice);
+ loadActorAnimC(deviceObjectIndices[_roomIndex], "s4cbxp", pos.x, 10, &Room::mudd0FiredAlienDevice);
playVoc("EXPLO3");
}
@@ -191,7 +197,7 @@ void Room::mudd0FiredAlienDevice() {
void Room::mudd0UseDegrimer() {
- // Identical (?) audio files: TX_MUD0N002, TX_MUD1N004, ...
+ // Identical (?) audio files: TX_MUD0N002, TX_MUD1N004, TX_MUD2N001...
showText(TX_MUD0N002);
}
diff --git a/engines/startrek/rooms/mudd1.cpp b/engines/startrek/rooms/mudd1.cpp
index eecc846..074b4bf 100644
--- a/engines/startrek/rooms/mudd1.cpp
+++ b/engines/startrek/rooms/mudd1.cpp
@@ -156,7 +156,7 @@ void Room::mudd1SpockPressedRedButton() {
const int choices[] = {
TX_SPEAKER_KIRK,
TX_MUD1_004,
- TX_MUD1_003,
+ TX_MUD1_003,
TX_MUD1_007,
TX_BLANK
};
@@ -313,7 +313,7 @@ void Room::mudd1WalkToWestDoor() {
walkCrewman(OBJECT_KIRK, 0x35, 0x71);
}
-void Room::mudd1TouchedHotspot0() {
+void Room::mudd1TouchedHotspot0() { // Trigger door at west of room
if (_roomVar.mudd.walkingToDoor == 2) {
playVoc("SMADOOR3");
loadActorAnim(OBJECT_WEST_DOOR, "s4wbd2", 0x37, 0x73);
diff --git a/engines/startrek/rooms/mudd2.cpp b/engines/startrek/rooms/mudd2.cpp
index f4b5b5f..81a975d 100644
--- a/engines/startrek/rooms/mudd2.cpp
+++ b/engines/startrek/rooms/mudd2.cpp
@@ -22,13 +22,384 @@
#include "startrek/room.h"
-#define OBJECT_DOOR1 8
+#define OBJECT_MUDD 8
+#define OBJECT_CAPSULE 9
+#define OBJECT_NORTH_DOOR 10
+#define OBJECT_ALIENDV 11
-#define HOTSPOT_CONSOLE 0x20
+#define HOTSPOT_CAPSULES 0x20
+#define HOTSPOT_NORTH_DOOR 0x21
+#define HOTSPOT_WEST_DOOR 0x22
+#define HOTSPOT_CONTROL_PANEL 0x23
+#define HOTSPOT_LEFT_BED 0x24
+#define HOTSPOT_RIGHT_BED 0x25
namespace StarTrek {
+void Room::mudd2WalkToNorthDoor() {
+ _roomVar.mudd.walkingToDoor = true;
+ _vm->_awayMission.disableInput = true;
+ walkCrewman(OBJECT_KIRK, 0xbc, 0x6a);
+}
+
+void Room::mudd2TouchedHotspot0() { // Trigger north door
+ if (_roomVar.mudd.walkingToDoor) {
+ playVoc("SMADOOR3");
+ loadActorAnim(OBJECT_NORTH_DOOR, "s4sbdo", 0xbe, 0x6b);
+ }
+}
+
+void Room::mudd2WalkToSouthDoor() {
+ _roomVar.mudd.walkingToDoor = true;
+ _vm->_awayMission.disableInput = true;
+ walkCrewman(OBJECT_KIRK, 0x46, 0x6f);
+}
+
+void Room::mudd2TouchedHotspot1() {
+ if (_roomVar.mudd.walkingToDoor) {
+ playVoc("SMADOOR3");
+ }
+}
+
void Room::mudd2Tick1() {
+ playVoc("MUD2LOOP");
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ _vm->_awayMission.mudd.muddDroppedCapsule = false;
+
+ if (_vm->_awayMission.mudd.field4e == 0) {
+ _vm->_awayMission.mudd.field4e = 0;
+ } else if (_vm->_awayMission.mudd.field4e == 2) {
+ _vm->_awayMission.mudd.muddDroppedCapsule = true;
+ if (!_vm->_awayMission.mudd.muddUnconscious) {
+ _vm->_awayMission.mudd.muddUnconscious = false;
+ loadActorAnim2(OBJECT_MUDD, "s4sbhn", 0x9f, 0xbf);
+ loadActorAnim2(OBJECT_CAPSULE, "s4sbvp", 0x93, 0xc3);
+ } else {
+ loadActorAnim2(OBJECT_MUDD, "s4sbob", 0x9f, 0xba);
+ }
+ } else if (_vm->_awayMission.mudd.field3f) {
+ _vm->_awayMission.mudd.field4e = 0;
+ } else if (_vm->_awayMission.mudd.field4e == 1) {
+ playMidiMusicTracks(3);
+ loadActorAnim2(OBJECT_MUDD, "s4sbhw", 0x99, 0xbf);
+ _vm->_awayMission.disableInput = 2;
+ _vm->_awayMission.mudd.muddInhaledGas = true;
+ _vm->_awayMission.timers[1] = 70;
+ _vm->_awayMission.mudd.field4e = 2;
+ _vm->_awayMission.mudd.field3f = true;
+ }
+}
+
+void Room::mudd2Timer1Expired() {
+ loadActorAnimC(OBJECT_MUDD, "s4sbmt", 0xa0, 0xbf, &Room::mudd2MuddNoticedKirk);
+}
+
+void Room::mudd2UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_MUD2_037, false);
+}
+
+void Room::mudd2UseSpockOnCapsules() {
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_018);
+}
+
+void Room::mudd2GetCapsules() {
+ if (!_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
+ if (!_vm->_awayMission.mudd.field36)
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_024);
+ else
+ walkCrewmanC(OBJECT_MCCOY, 0x9f, 0xbf, &Room::mudd2MccoyReachedCapsules);
+ } else {
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_023);
+ }
+}
+
+void Room::mudd2MccoyReachedCapsules() {
+ loadActorAnimC(OBJECT_MCCOY, "musehn", -1, -1, &Room::mudd2MccoyPickedUpCapsules);
+ giveItem(OBJECT_ICAPSULE);
+}
+
+void Room::mudd2MccoyPickedUpCapsules() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ walkCrewman(OBJECT_MCCOY, 0xfe, 0xb2);
+}
+
+void Room::mudd2UseCommunicator() {
+ showText(TX_SPEAKER_KIRK, TX_MUD2_009);
+ showText(TX_SPEAKER_UHURA, TX_STATICU1);
+}
+
+void Room::mudd2LookAtCapsules() {
+ showText(TX_MUD2N008);
+}
+
+void Room::mudd2UseMTricorderOnCapsules() {
+ mccoyScan(DIR_W, TX_MUD2_030, false);
+ showText(TX_SPEAKER_KIRK, TX_MUD2_004);
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_019);
+}
+
+void Room::mudd2UseCapsuleOnControlPanel() {
+ if (!_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious)
+ walkCrewmanC(OBJECT_MCCOY, 0x9f, 0xbf, &Room::mudd2MccoyReachedControlPanel);
+ else
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_023);
+}
+
+void Room::mudd2MccoyReachedControlPanel() {
+ if (_vm->_awayMission.mudd.field36)
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_014);
+ else
+ loadActorAnimC(OBJECT_MCCOY, "musehn", -1, -1, &Room::mudd2MccoyPutCapsuleInControlPanel);
+}
+
+void Room::mudd2MccoyPutCapsuleInControlPanel() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ loadActorStandAnim(OBJECT_MCCOY);
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_020);
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_029);
+ showText(TX_SPEAKER_SPOCK, TX_MUD2_039);
+ if (_vm->_awayMission.mudd.muddUnconscious)
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_034);
+
+ loseItem(OBJECT_ICAPSULE);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ walkCrewman(OBJECT_MCCOY, 0xfe, 0xb2);
+}
+
+void Room::mudd2UseKirkOnBed() {
+ if (!_vm->_awayMission.mudd.field4c && !_vm->_awayMission.mudd.field36) {
+ walkCrewmanC(OBJECT_KIRK, 0xd7, 0xbd, &Room::mudd2KirkReachedBed);
+ } else if (_vm->_awayMission.mudd.field36) {
+ walkCrewman(OBJECT_KIRK, 0xd7, 0xbd, 7); // BUG(?): no continuation?
+ }
+}
+
+void Room::mudd2KirkReachedBed() {
+ // BUGFIX: Speaker is mccoy, not none
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_022);
+}
+
+
+void Room::mudd2MuddNoticedKirk() {
+ showText(TX_SPEAKER_MUDD, TX_MUD2_044);
+ playVoc("BATTYGAS");
+ loadActorAnimC(OBJECT_MUDD, "s4sbhb", 0x9f, 0xbf, &Room::mudd2MuddDroppedCapsule); // Drops the capsule
+ playMidiMusicTracks(0);
+}
+
+void Room::mudd2MuddDroppedCapsule() {
+ loadActorAnim2(OBJECT_MUDD, "s4sbhn", 0x9f, 0xbf, 3); // NOTE: no callback from this
+ loadActorAnim2(OBJECT_CAPSULE, "s4sbvp", 0x93, 0xc3);
+ _vm->_awayMission.mudd.muddDroppedCapsule = true;
+
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_032);
+ showText(TX_SPEAKER_MUDD, TX_MUD2_049);
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_026);
+ showText(TX_SPEAKER_MUDD, TX_MUD2_051);
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_031);
+ showText(TX_SPEAKER_MUDD, TX_MUD2_050);
+
+ _vm->_awayMission.disableInput = false;
+}
+
+
+void Room::mudd2UsePhaserOnMudd() {
+ if (_vm->_awayMission.mudd.muddInhaledGas && !_vm->_awayMission.mudd.muddUnconscious) {
+ showText(TX_SPEAKER_BUCHERT, TX_MUD2_053);
+ showText(TX_SPEAKER_MUDD, TX_MUD2_042);
+ showText(TX_SPEAKER_MUDD, TX_MUD2_043);
+ }
+}
+
+
+// Spock neck-pinches Mudd
+void Room::mudd2UseSpockOnMudd() {
+ if (_vm->_awayMission.mudd.muddInhaledGas && !_vm->_awayMission.mudd.muddUnconscious) {
+ _vm->_awayMission.disableInput = true;
+ walkCrewmanC(OBJECT_SPOCK, 0x8a, 0xbf, &Room::mudd2SpockReachedMudd);
+ }
+}
+
+void Room::mudd2SpockReachedMudd() {
+ loadActorAnimC(OBJECT_SPOCK, "s4sbsp", 0x9f, 0xbf, &Room::mudd2SpockPinchedMudd);
+ loadActorStandAnim(OBJECT_MUDD);
+}
+
+void Room::mudd2SpockPinchedMudd() {
+ loadActorAnim2(OBJECT_MUDD, "s4sbob", 0x9f, 0xba);
+ loadActorAnim2(OBJECT_SPOCK, "sstnde", 0xd0, 0xbd);
+
+ showText(TX_SPEAKER_SPOCK, TX_MUD2_012);
+
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.mudd.muddUnconscious = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ walkCrewman(OBJECT_SPOCK, 0x118, 0xc4);
+}
+
+void Room::mudd2UseKirkOnMudd() {
+ if (_vm->_awayMission.mudd.muddInhaledGas && !_vm->_awayMission.mudd.muddUnconscious) {
+ showText(TX_SPEAKER_KIRK, TX_MUD2_001);
+ mudd2UseSpockOnMudd();
+ }
+}
+
+
+void Room::mudd2UseRedshirtOnMudd() {
+ if (_vm->_awayMission.mudd.muddInhaledGas && !_vm->_awayMission.mudd.muddUnconscious) {
+ _vm->_awayMission.disableInput = true;
+ walkCrewmanC(OBJECT_REDSHIRT, 0xc3, 0xbe, &Room::mudd2RedshirtReachedMudd);
+ }
+}
+
+void Room::mudd2RedshirtReachedMudd() {
+ _vm->_awayMission.timers[2] = 8;
+ loadActorAnimC(OBJECT_REDSHIRT, "s4sbrh", -1, -1, &Room::mudd2RedshirtPushedAway);
+ playVoc("ROCKFACE");
+ loadActorAnimC(OBJECT_MUDD, "s4sbhh", 0x9f, 0xbf, &Room::mudd2MuddFinishedPushingRedshirt);
+}
+
+void Room::mudd2Timer2Expired() {
+ playSoundEffectIndex(SND_BLANK_0b);
+}
+
+void Room::mudd2MuddFinishedPushingRedshirt() {
+ loadActorAnim2(OBJECT_MUDD, "s4sbhn");
+}
+
+void Room::mudd2RedshirtPushedAway() {
+ showText(TX_SPEAKER_BUCHERT, TX_MUD2_052);
+ loadActorAnim(OBJECT_REDSHIRT, "rstnds", 0xd8, 0xc3);
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ walkCrewman(OBJECT_REDSHIRT, 0x117, 0xae);
+}
+
+
+// BUGFIX: This was originally "Action 0x45 on Mudd"; as far as I know, action 0x45
+// doesn't exist. It's far more likely that 0x45 is supposed to correspond to
+// OBJECT_IMTRICOR in a USE action.
+// The function itself was also modified (ie. condition for showing text was inverted).
+void Room::mudd2UseMTricorderOnMudd() {
+ if (_vm->_awayMission.mudd.muddInhaledGas && !_vm->_awayMission.mudd.muddUnconscious)
+ mccoyScan(DIR_W, TX_MUD2_013, false);
+}
+
+
+void Room::mudd2UseMedkitOnMudd() {
+ if (!_vm->_awayMission.mudd.muddInhaledGas)
+ return;
+ else if (_vm->_awayMission.mudd.muddUnconscious) {
+ if (!_vm->_awayMission.mudd.field36)
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_015);
+ else if (!_vm->_awayMission.mudd.field4c)
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_021);
+ else
+ walkCrewmanC(OBJECT_MCCOY, 0xde, 0xaf, &Room::mudd2MccoyReachedMudd);
+ }
+ else // Can't get to him since he's busy being crazy
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_016);
+}
+
+void Room::mudd2MccoyReachedMudd() {
+ _vm->_awayMission.mudd.missionScore += 2;
+ loadActorAnimC(OBJECT_MCCOY, "s4sbms", -1, -1, &Room::mudd2MccoyCuredMudd);
+}
+
+void Room::mudd2MccoyCuredMudd() {
+ _vm->_awayMission.mudd.field3f = false;
+ _vm->_awayMission.mudd.field4e = 3;
+ _vm->_awayMission.mudd.muddDroppedCapsule = false;
+ _vm->_awayMission.mudd.muddInhaledGas = false;
+
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_033);
+ showText(TX_SPEAKER_MUDD, TX_MUD2_045);
+
+ _vm->_awayMission.mudd.muddUnconscious = false;
+}
+
+
+void Room::mudd2LookAtKirk() {
+ showText(TX_MUD2N003);
+}
+
+void Room::mudd2LookAtSpock() {
+ showText(TX_MUD2N006);
+}
+
+void Room::mudd2LookAtMccoy() {
+ showText(TX_MUD2N000);
+}
+
+void Room::mudd2LookAtRedshirt() {
+ showText(TX_MUD2N004);
+}
+
+void Room::mudd2LookAtMudd() {
+ showText(TX_MUD2N002);
+}
+
+void Room::mudd2LookAtControlPanel() {
+ showText(TX_MUD2N011);
+}
+
+void Room::mudd2LookAtBed() {
+ showText(TX_MUD2N007);
+}
+
+// FIXME: The conditions in the below functions seem wrong.
+void Room::mudd2TalkToKirk() {
+ if (!_vm->_awayMission.mudd.muddDroppedCapsule || _vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious)
+ showText(TX_SPEAKER_KIRK, TX_MUD2_010);
+ else {
+ showText(TX_SPEAKER_KIRK, TX_MUD2_005);
+ showText(TX_SPEAKER_MUDD, TX_MUD2_046);
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_035);
+ }
+}
+
+void Room::mudd2TalkToSpock() {
+ if (!_vm->_awayMission.mudd.muddDroppedCapsule || _vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
+ showText(TX_SPEAKER_SPOCK, TX_MUD2_040);
+ showText(TX_SPEAKER_KIRK, TX_MUD2_011);
+ } else {
+ showText(TX_SPEAKER_SPOCK, TX_MUD2_038);
+ }
+}
+
+void Room::mudd2TalkToMccoy() {
+ if (!_vm->_awayMission.mudd.muddDroppedCapsule || _vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_025);
+ showText(TX_SPEAKER_KIRK, TX_MUD2_007);
+ } else {
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_027);
+ }
+}
+
+void Room::mudd2TalkToRedshirt() {
+ if (!_vm->_awayMission.mudd.muddDroppedCapsule || _vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
+ showText(TX_SPEAKER_BUCHERT, TX_MUD2_054);
+ showText(TX_SPEAKER_KIRK, TX_MUD2_008);
+ } else {
+ showText(TX_SPEAKER_BUCHERT, TX_MUD2_055);
+ showText(TX_SPEAKER_KIRK, TX_MUD2_003);
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_048);
+ }
+}
+
+void Room::mudd2TalkToMudd() {
+ if (!_vm->_awayMission.mudd.muddDroppedCapsule || _vm->_awayMission.mudd.muddUnconscious)
+ return;
+ else if (_vm->_awayMission.mudd.muddInhaledGas) {
+ showText(TX_SPEAKER_MUDD, TX_MUD2_048);
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_028);
+ } else {
+ showText(TX_SPEAKER_MUDD, TX_MUD2_047);
+ showText(TX_SPEAKER_KIRK, TX_MUD2_006);
+ }
}
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 5843576..1fa88bb 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -84,7 +84,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxHasMultipleChoices = false;
_missionToLoad = "MUDD";
- _roomIndexToLoad = 1;
+ _roomIndexToLoad = 2;
for (int i = 0; i < NUM_OBJECTS; i++)
_itemList[i] = g_itemList[i];
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index c5034a5..611305a 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -1273,7 +1273,73 @@ enum GameStringIDs {
TX_MUD1N016,
+ TX_MUD2_001,
+ TX_MUD2_002,
+ TX_MUD2_003,
+ TX_MUD2_004,
+ TX_MUD2_005,
+ TX_MUD2_006,
+ TX_MUD2_007,
+ TX_MUD2_008,
+ TX_MUD2_009,
+ TX_MUD2_010,
+ TX_MUD2_011,
+ TX_MUD2_012,
+ TX_MUD2_013,
+ TX_MUD2_014,
+ TX_MUD2_015,
+ TX_MUD2_016,
+ // UNUSED
+ TX_MUD2_018,
+ TX_MUD2_019,
+ TX_MUD2_020,
+ TX_MUD2_021,
+ TX_MUD2_022,
+ TX_MUD2_023,
+ TX_MUD2_024,
+ TX_MUD2_025,
+ TX_MUD2_026,
+ TX_MUD2_027,
+ TX_MUD2_028,
+ TX_MUD2_029,
+ TX_MUD2_030,
+ TX_MUD2_031,
+ TX_MUD2_032,
+ TX_MUD2_033,
+ TX_MUD2_034,
+ TX_MUD2_035,
+ TX_MUD2_036,
+ TX_MUD2_037,
+ TX_MUD2_038,
+ TX_MUD2_039,
TX_MUD2_040,
+ // UNUSED
+ TX_MUD2_042,
+ TX_MUD2_043,
+ TX_MUD2_044,
+ TX_MUD2_045,
+ TX_MUD2_046,
+ TX_MUD2_047,
+ TX_MUD2_048,
+ TX_MUD2_049,
+ TX_MUD2_050,
+ TX_MUD2_051,
+ TX_MUD2_052,
+ TX_MUD2_053,
+ TX_MUD2_054,
+ TX_MUD2_055,
+ TX_MUD2N000,
+ TX_MUD2N001,
+ TX_MUD2N002,
+ TX_MUD2N003,
+ TX_MUD2N004,
+ TX_MUD2N005,
+ TX_MUD2N006,
+ TX_MUD2N007,
+ TX_MUD2N008,
+ TX_MUD2N009,
+ TX_MUD2N010,
+ TX_MUD2N011,
TX_MUD4_018,
@@ -2501,7 +2567,71 @@ const char * const g_gameStrings[] = {
"#MUD1\\MUD1N016#Two yellow triangular buttons.",
+ "#MUD2\\MUD2_001#Spock, see if you can outflank him...",
+ "#MUD2\\MUD2_002#Well, now I think we know why the Elasi pirates were so interested in finding out where Mudd was getting these>",
+ "#MUD2\\MUD2_003#Almost worth a try. Bones? ",
+ "#MUD2\\MUD2_004#Do they pose any threat to us, Doctor?",
+ "#MUD2\\MUD2_005#Harry! Calm down Harry, it's only us! ",
+ "#MUD2\\MUD2_006#Harry, when did you become a comedian? ",
+ "#MUD2\\MUD2_007#I can't think of anything we did that was THAT bad. ",
+ "#MUD2\\MUD2_008#There's not much I wouldn't do to not have to deal with Mudd. ",
+ "#MUD2\\MUD2_009#Kirk to Enterprise...",
+ "#MUD2\\MUD2_010#Sometimes I wish I had become an archeology professor instead of a Starfleet Captain. ",
+ "#MUD2\\MUD2_011#Sorry if I was bothering you. I was just silently cursing the day I met Harry Mudd. ",
+ "#MUD2\\MUD2_012#All yours now, Doctor McCoy.",
+ "#MUD2\\MUD2_013#He's showing definite signs of hallucination and a marked increase in adrenalin. I would recommend extreme caution in handling him.",
+ "#MUD2\\MUD2_014#I feel sure that these would have been used here, but I don't understand enough of how the aliens thought, to make it work.",
+ "#MUD2\\MUD2_015#I need to understand more about the aliens before I can make this bed and its instrumentation function.",
+ "#MUD2\\MUD2_016#I'm not fast enough to get him with a tranquilizer hypo, Jim!",
+ "#MUD2\\MUD2_018#Jim, these look like the capsules we might use in a hypo. I wouldn't recommend experimenting with them, though. Alien physiology or not, you can never be sure what unusual chemicals will do to the human body.",
+ "#MUD2\\MUD2_019#None seems likely to have any effect on human -- or Vulcan -- physiology. To be on the safe side, though, I wouldn't recommend taking a snootful from one of the capsules!",
+ "#MUD2\\MUD2_020#The capsules slide into the machinery on the bed exactly as they're designed to.",
+ "#MUD2\\MUD2_021#The volatile chemicals have evaporated over the time the derelict hung in space. I need to refill the capsule-dispenser for the bed to activate and effect a cure on our friend Harry, here.",
+ "#MUD2\\MUD2_022#This is no time for a nap!", // TYPO
+ "#MUD2\\MUD2_023#We can't get near that equipment with mudd going nuts over there, Jim.",
+ "#MUD2\\MUD2_024#We won't be able to operate any of this equipment unless we can learn more about the aliens, Jim.",
+ "#MUD2\\MUD2_025#Are you religious, Jim? Is Harry Mudd a divine punishment for anything we did wrong? ",
+ "#MUD2\\MUD2_026#Deleterious effects. I guess I don't even need my tricorder to know that.",
+ "#MUD2\\MUD2_027#He's delirious Jim. Actually, it's kinda funny. ",
+ "#MUD2\\MUD2_028#I think I liked him better when he was less delirious. ",
+ "#MUD2\\MUD2_029#I'm telling the program our physiology is not the same as the aliens' physiology. Don't want it to try to cure us of being human!",
+ "#MUD2\\MUD2_030#It would be interesting to analyze them back aboard the Enterprise, but these are probably vaccines, medicines, and research viruses.",
+ "#MUD2\\MUD2_031#If we can get him on one of the beds, and get it active, I think he can be cured. Otherwise, he's likely to become increasingly violent.",
+ "#MUD2\\MUD2_032#Jim, that doesn't look good at all... Harry, let me take a look at you and check whether that had some deleterious effect...",
+ "#MUD2\\MUD2_033#Okay, Harry, you should start to feel better in a few minutes. Just lie there quietly until you feel like moving.",
+ "#MUD2\\MUD2_034#Particularly when we're talking about Harry Mudd...",
+ "#MUD2\\MUD2_035#Well, he got one thing right. ",
+ "#MUD2\\MUD2_036#Who knows what effect a phaser might have on him with all those chemicals in his system? We must find another way to handle this. ",
+ "#MUD2\\MUD2_037#This room closely resembles the Enterprise sickbay. The beds are powered, as is the central post console. ",
+ "#MUD2\\MUD2_038#It would appear that the accident has made Harry Mudd even less logical than before. ",
+ "#MUD2\\MUD2_039#That would be too much to hope for, would it not, Doctor?",
"#MUD2\\MUD2_040#You look troubled, Captain.",
+ "#MUD2\\MUD2_042#Ahh, I feel faster -- smarter -- strong enough to take you all on! You're really lizard men wearing human masks -- his is coming off -- Hahahahahah!",
+ "#MUD2\\MUD2_043#I know you for what you really are! I'll tell the whole world, and then where will you be!",
+ "#MUD2\\MUD2_044#Why C-c-Captain!",
+ "#MUD2\\MUD2_045#*Groan.* Give me something for this headache, Doc. A herd of Hamali tree-elephants landed behind my eyeballs and did a mating dance...",
+ "#MUD2\\MUD2_046#Argh! My most dire enemies have found me! ",
+ "#MUD2\\MUD2_047#Kirk, you sound as though you aren't happy to see me! After all we've been through together, I thought we had built a genuine bond of camraderie, two men fighting side by side against impossible odds! ",
+ "#MUD2\\MUD2_048#No! You're going to sell me to space aliens! Use my brain as a weapon to destroy the human race! And here I am, willing to help out in a good cause... ",
+ "#MUD2\\MUD2_049#No! You're all space aliens! You're little grey men from inside the hollow earth! You want to experiment on my body parts! Stay away from me!",
+ "#MUD2\\MUD2_050#Stay away from me!>",
+ "#MUD2\\MUD2_051#You'll mind control me, kidnap my children! Dissect my dog!",
+ "#MUD2\\MUD2_052#He's unnaturally strong, Captain! I can't take him down!",
+ "#MUD2\\MUD2_053#I don't think the phaser will have the usual effect, Captain.... we'll have to think of something else!",
+ "#MUD2\\MUD2_054#Captain, count your blessings! We haven't met any salt vampires, deranged computers, blood-draining clouds, cell imploding sirens, Greek gods, or any of the other things people keep telling me about in security. ",
+ "#MUD2\\MUD2_055#Sir, I can phaser him. A stun setting would just leave him queasy. ",
+ "#MUD2\\MUD2N000#Dr. McCoy, who isn't arguing as much with Spock as usual. ",
+ "#MUD2\\MUD2N001#Dust and grease lifts off the surface, leaving this item clean as new.",
+ "#MUD2\\MUD2N002#Harcourt Fenton Mudd. Three of the most prominent psychologists in the galaxy became famous by publishing case studies in sociopathy about him. ",
+ "#MUD2\\MUD2N003#James Kirk, the paragon of a Starfleet captain, feels nothing like a paragon right now. ",
+ "#MUD2\\MUD2N004#Lieutenant Buchert. His is not to reason why. His is to obey orders and stay alert. ",
+ "#MUD2\\MUD2N005#Life support fails completely and you fall unconscious.",
+ "#MUD2\\MUD2N006#Mr. Spock, your loyal science officer. ",
+ "#MUD2\\MUD2N007#Padded inclines resembling a bed.",
+ "#MUD2\\MUD2N008#Small containers of oddly-colored liquids.",
+ "#MUD2\\MUD2N009#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
+ "#MUD2\\MUD2N010#These two things fit together like they were made for each other.",
+ "#MUD2\\MUD2N011#This seems to be the main monitoring station for the beds. Above it is some sort of dispensary.",
"#MUD4\\MUD4_018#Kirk to Enterprise ... Kirk to Enterprise.",
Commit: 0879985ddd27dd1e119efb6e8200df5f0ba3e970
https://github.com/scummvm/scummvm/commit/0879985ddd27dd1e119efb6e8200df5f0ba3e970
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: MUDD3
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/mudd0.cpp
engines/startrek/rooms/mudd2.cpp
engines/startrek/rooms/mudd3.cpp
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 694e0cc..fd1f61f 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -41,7 +41,7 @@ void StarTrekEngine::initAwayMission() {
_roomIndexToLoad = -1;
// Load crew positions for beaming in
- initAwayCrewPositions(3);
+ initAwayCrewPositions(1);
}
void StarTrekEngine::runAwayMission() {
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 612e7dc..eaae68b 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -192,20 +192,29 @@ struct AwayMission {
byte field29; // 0x29
bool torpedoLoaded; // 0x33
bool knowAboutTorpedo; // 0x34
- bool field36; // 0x36
+ bool discoveredBase3System; // 0x35
+ bool translatedAlienLanguage; // 0x36
+ bool databaseDestroyed; // 0x37
+ bool muddInDatabaseRoom; // 0x38
bool muddDroppedCapsule; // 0x39
+ bool computerDataErased; // 0x3a
+ bool gaveMuddDatabaseAccess; // 0x3b
// True if you've combined the lense + degrimer and fired it off, discovering
// it's a weapon
bool discoveredLenseAndDegrimerFunction; // 0x3c
byte torpedoStatus; // 0x3d
- bool field3f; // 0x3f
+ bool muddCurrentlyInsane; // 0x3f
+ bool muddVisitedDatabaseRoom; // 0x40
+ bool accessedAlienDatabase; // 0x41
+ bool tookRepairToolFromDatabaseRoom; // 0x42
+ bool gotPointsForDownloadingData; // 0x43
bool gotMemoryDisk; // 0x48
bool gotLense; // 0x49
bool gotDegrimer; // 0x4a
- bool field4c; // 0x4c
+ bool putCapsuleInMedicalMachine; // 0x4c
bool muddUnconscious; // 0x4d
- byte field4e; // 0x4e
+ byte muddState; // 0x4e
bool muddInhaledGas; // 0x4f
bool enteredRoom0ForFirstTime; // 0x54
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index d76589e..9eea5d1 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1257,6 +1257,40 @@ public:
// MUDD3
void mudd3Tick1();
+ void mudd3UseCommunicator();
+ void mudd3LookAtScreen();
+ void mudd3UseSTricorderOnScreen();
+ void mudd3UseKirkOnScreen();
+ void mudd3UseSpockOnSphere();
+ void mudd3Timer3Expired();
+ void mudd3UseMccoyOnSphere();
+ void mudd3UseRedshirtOnSphere();
+ void mudd3UseMTricorderOnSphere();
+ void mudd3UseSTricorderOnSphere();
+ void mudd3ReadyToHookUpTricorders();
+ void mudd3Timer1Expired();
+ void mudd3Timer2Expired();
+ void mudd3Timer4Expired();
+ void mudd3UseMemoryDiskOnSphere();
+ void mudd3GetRepairTool();
+ void mudd3ReachedRepairTool();
+ void mudd3PickedUpRepairTool();
+ void mudd3LookAtSphere();
+ void mudd3WalkToNorthDoor();
+ void mudd3TouchedHotspot0();
+ void mudd3WalkToEastDoor();
+ void mudd3TouchedHotspot1();
+ void mudd3LookAtKirk();
+ void mudd3LookAtSpock();
+ void mudd3LookAtMccoy();
+ void mudd3LookAtRedshirt();
+ void mudd3LookAtMudd();
+ void mudd3TalkToKirk();
+ void mudd3TalkToSpock();
+ void mudd3TalkToMccoy();
+ void mudd3TalkToRedshirt();
+ void mudd3TalkToMudd();
+ void mudd3UseMedkit();
// MUDD4
void mudd4Tick1();
@@ -1373,6 +1407,10 @@ private:
} love;
struct {
+ // mudd3
+ bool suggestedUsingTricorders; // 0xca
+ bool tricordersUnavailable; // 0xcb
+
// common
byte walkingToDoor;
} mudd;
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index d1f3b78..89b0397 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1569,7 +1569,50 @@ RoomAction mudd2ActionList[] = {
RoomAction mudd3ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd3Tick1 },
+ { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd3UseCommunicator },
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd3LookAtScreen },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::mudd3UseSTricorderOnScreen },
+ { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::mudd3UseKirkOnScreen },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x21, 0), &Room::mudd3UseSpockOnSphere },
+ { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::mudd3Timer3Expired },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x21, 0), &Room::mudd3UseMccoyOnSphere },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x21, 0), &Room::mudd3UseRedshirtOnSphere },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::mudd3UseMTricorderOnSphere },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::mudd3UseSTricorderOnSphere },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::mudd3ReadyToHookUpTricorders },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd3Timer1Expired },
+ { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::mudd3Timer2Expired },
+ { Action(ACTION_TIMER_EXPIRED, 4, 0, 0), &Room::mudd3Timer4Expired },
+ { Action(ACTION_USE, OBJECT_IDISKS, 0x21, 0), &Room::mudd3UseMemoryDiskOnSphere },
+
+ // Common code
+ { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
+ { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
+ { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
+
+ { Action(ACTION_GET, 13, 0, 0), &Room::mudd3GetRepairTool },
+ { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::mudd3ReachedRepairTool },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::mudd3PickedUpRepairTool },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::mudd3LookAtSphere },
+ { Action(ACTION_WALK, 0x22, 0, 0), &Room::mudd3WalkToNorthDoor },
+ { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd3TouchedHotspot0 },
+ { Action(ACTION_WALK, 0x23, 0, 0), &Room::mudd3WalkToEastDoor },
+ { Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::mudd3TouchedHotspot1 },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd3LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd3LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd3LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd3LookAtRedshirt },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::mudd3LookAtMudd },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd3TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd3TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd3TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd3TalkToRedshirt },
+ { Action(ACTION_TALK, 8, 0, 0), &Room::mudd3TalkToMudd },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd3UseMedkit },
+ // TODO: remainder? something about losing atmosphere?
};
+
RoomAction mudd4ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd4Tick1 },
};
diff --git a/engines/startrek/rooms/mudd0.cpp b/engines/startrek/rooms/mudd0.cpp
index 54b3a22..381a07a 100644
--- a/engines/startrek/rooms/mudd0.cpp
+++ b/engines/startrek/rooms/mudd0.cpp
@@ -165,7 +165,7 @@ void Room::mudd0UseLenseOnDegrimer() {
_vm->_awayMission.mudd.missionScore++;
showText(TX_MUD0N011);
- // Identical (?) audio files: TX_MUD0N011, TX_MUD1N013, TX_MUD2N010
+ // Identical (?) audio files: TX_MUD0N011, TX_MUD1N013, TX_MUD2N010, TX_MUD3N016
}
@@ -174,6 +174,7 @@ void Room::mudd0UseAlienDevice() {
9, // MUDD0
13, // MUDD1
11, // MUDD2
+ 11, // MUDD3
};
_vm->_awayMission.disableInput = true;
@@ -191,13 +192,13 @@ void Room::mudd0FiredAlienDevice() {
_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction = true;
_vm->_awayMission.mudd.missionScore += 5;
showText(TX_SPEAKER_KIRK, TX_MUD0_002);
- // Identical (?) audio files: TX_MUD0_002, TX_MUD1_002
+ // Identical (?) audio files: TX_MUD0_002, TX_MUD1_002, TX_MUD2_002
}
}
void Room::mudd0UseDegrimer() {
- // Identical (?) audio files: TX_MUD0N002, TX_MUD1N004, TX_MUD2N001...
+ // Identical (?) audio files: TX_MUD0N002, TX_MUD1N004, TX_MUD2N001, TX_MUD3N001...
showText(TX_MUD0N002);
}
diff --git a/engines/startrek/rooms/mudd2.cpp b/engines/startrek/rooms/mudd2.cpp
index 81a975d..d2a420d 100644
--- a/engines/startrek/rooms/mudd2.cpp
+++ b/engines/startrek/rooms/mudd2.cpp
@@ -69,9 +69,9 @@ void Room::mudd2Tick1() {
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
_vm->_awayMission.mudd.muddDroppedCapsule = false;
- if (_vm->_awayMission.mudd.field4e == 0) {
- _vm->_awayMission.mudd.field4e = 0;
- } else if (_vm->_awayMission.mudd.field4e == 2) {
+ if (_vm->_awayMission.mudd.muddState == 0) {
+ _vm->_awayMission.mudd.muddState = 0;
+ } else if (_vm->_awayMission.mudd.muddState == 2) {
_vm->_awayMission.mudd.muddDroppedCapsule = true;
if (!_vm->_awayMission.mudd.muddUnconscious) {
_vm->_awayMission.mudd.muddUnconscious = false;
@@ -80,16 +80,16 @@ void Room::mudd2Tick1() {
} else {
loadActorAnim2(OBJECT_MUDD, "s4sbob", 0x9f, 0xba);
}
- } else if (_vm->_awayMission.mudd.field3f) {
- _vm->_awayMission.mudd.field4e = 0;
- } else if (_vm->_awayMission.mudd.field4e == 1) {
+ } else if (_vm->_awayMission.mudd.muddCurrentlyInsane) {
+ _vm->_awayMission.mudd.muddState = 0;
+ } else if (_vm->_awayMission.mudd.muddState == 1) {
playMidiMusicTracks(3);
loadActorAnim2(OBJECT_MUDD, "s4sbhw", 0x99, 0xbf);
_vm->_awayMission.disableInput = 2;
_vm->_awayMission.mudd.muddInhaledGas = true;
_vm->_awayMission.timers[1] = 70;
- _vm->_awayMission.mudd.field4e = 2;
- _vm->_awayMission.mudd.field3f = true;
+ _vm->_awayMission.mudd.muddState = 2;
+ _vm->_awayMission.mudd.muddCurrentlyInsane = true;
}
}
@@ -107,7 +107,7 @@ void Room::mudd2UseSpockOnCapsules() {
void Room::mudd2GetCapsules() {
if (!_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
- if (!_vm->_awayMission.mudd.field36)
+ if (!_vm->_awayMission.mudd.translatedAlienLanguage)
showText(TX_SPEAKER_MCCOY, TX_MUD2_024);
else
walkCrewmanC(OBJECT_MCCOY, 0x9f, 0xbf, &Room::mudd2MccoyReachedCapsules);
@@ -149,7 +149,7 @@ void Room::mudd2UseCapsuleOnControlPanel() {
}
void Room::mudd2MccoyReachedControlPanel() {
- if (_vm->_awayMission.mudd.field36)
+ if (_vm->_awayMission.mudd.translatedAlienLanguage)
showText(TX_SPEAKER_MCCOY, TX_MUD2_014);
else
loadActorAnimC(OBJECT_MCCOY, "musehn", -1, -1, &Room::mudd2MccoyPutCapsuleInControlPanel);
@@ -164,15 +164,17 @@ void Room::mudd2MccoyPutCapsuleInControlPanel() {
if (_vm->_awayMission.mudd.muddUnconscious)
showText(TX_SPEAKER_MCCOY, TX_MUD2_034);
+ _vm->_awayMission.mudd.putCapsuleInMedicalMachine = true;
+
loseItem(OBJECT_ICAPSULE);
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
walkCrewman(OBJECT_MCCOY, 0xfe, 0xb2);
}
void Room::mudd2UseKirkOnBed() {
- if (!_vm->_awayMission.mudd.field4c && !_vm->_awayMission.mudd.field36) {
+ if (!_vm->_awayMission.mudd.putCapsuleInMedicalMachine && !_vm->_awayMission.mudd.translatedAlienLanguage) {
walkCrewmanC(OBJECT_KIRK, 0xd7, 0xbd, &Room::mudd2KirkReachedBed);
- } else if (_vm->_awayMission.mudd.field36) {
+ } else if (_vm->_awayMission.mudd.translatedAlienLanguage) {
walkCrewman(OBJECT_KIRK, 0xd7, 0xbd, 7); // BUG(?): no continuation?
}
}
@@ -293,9 +295,9 @@ void Room::mudd2UseMedkitOnMudd() {
if (!_vm->_awayMission.mudd.muddInhaledGas)
return;
else if (_vm->_awayMission.mudd.muddUnconscious) {
- if (!_vm->_awayMission.mudd.field36)
+ if (!_vm->_awayMission.mudd.translatedAlienLanguage)
showText(TX_SPEAKER_MCCOY, TX_MUD2_015);
- else if (!_vm->_awayMission.mudd.field4c)
+ else if (!_vm->_awayMission.mudd.putCapsuleInMedicalMachine)
showText(TX_SPEAKER_MCCOY, TX_MUD2_021);
else
walkCrewmanC(OBJECT_MCCOY, 0xde, 0xaf, &Room::mudd2MccoyReachedMudd);
@@ -310,8 +312,8 @@ void Room::mudd2MccoyReachedMudd() {
}
void Room::mudd2MccoyCuredMudd() {
- _vm->_awayMission.mudd.field3f = false;
- _vm->_awayMission.mudd.field4e = 3;
+ _vm->_awayMission.mudd.muddCurrentlyInsane = false;
+ _vm->_awayMission.mudd.muddState = 3;
_vm->_awayMission.mudd.muddDroppedCapsule = false;
_vm->_awayMission.mudd.muddInhaledGas = false;
diff --git a/engines/startrek/rooms/mudd3.cpp b/engines/startrek/rooms/mudd3.cpp
index e3f215f..1eed3de 100644
--- a/engines/startrek/rooms/mudd3.cpp
+++ b/engines/startrek/rooms/mudd3.cpp
@@ -22,13 +22,415 @@
#include "startrek/room.h"
-#define OBJECT_DOOR1 8
+#define OBJECT_MUDD 8
+#define OBJECT_9 9
+#define OBJECT_ALIEN_IMAGE 10
+#define OBJECT_ALIENDV 11
+#define OBJECT_NORTH_DOOR 12
+#define OBJECT_REPAIR_TOOL 13
-#define HOTSPOT_CONSOLE 0x20
+#define HOTSPOT_SCREEN 0x20
+#define HOTSPOT_SPHERE 0x21
+#define HOTSPOT_NORTH_DOOR 0x22
+#define HOTSPOT_EAST_DOOR 0x23
namespace StarTrek {
void Room::mudd3Tick1() {
+ playVoc("MUD3LOOP");
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+
+ if (_vm->_awayMission.mudd.databaseDestroyed) {
+ loadActorAnim(OBJECT_9, "s4lbpb", 0xa2, 0x9f);
+
+ // FIXME: is this supposed to be in this if statement?
+ if (!_vm->_awayMission.mudd.tookRepairToolFromDatabaseRoom)
+ loadActorAnim(OBJECT_REPAIR_TOOL, "s4lbdv", 0xb7, 0xa8);
+ }
+
+ _vm->_awayMission.mudd.muddInDatabaseRoom = false;
+
+ if (!_vm->_awayMission.mudd.muddVisitedDatabaseRoom && _vm->_awayMission.mudd.translatedAlienLanguage && !_vm->_awayMission.mudd.muddCurrentlyInsane) {
+ _vm->_awayMission.mudd.muddVisitedDatabaseRoom = true;
+ loadActorAnim(OBJECT_MUDD, "s4lbhs", 0xa2, 0x9f);
+ playMidiMusicTracks(3);
+ _vm->_awayMission.mudd.muddInDatabaseRoom = true;
+ _vm->_awayMission.timers[2] = 10;
+ }
+}
+
+void Room::mudd3UseCommunicator() {
+ showText(TX_SPEAKER_KIRK, TX_MUD3_003);
+ showText(TX_SPEAKER_UHURA, TX_STATICU1);
+}
+
+void Room::mudd3LookAtScreen() {
+ if (_vm->_awayMission.mudd.translatedAlienLanguage) // FIXME: flipped conditions?
+ showText(TX_MUD3N017);
+ else
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_038);
+}
+
+void Room::mudd3UseSTricorderOnScreen() {
+ if (_roomVar.mudd.tricordersUnavailable)
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_039);
+ else
+ spockScan(DIR_S, TX_MUD3_017, false);
+}
+
+// BUGFIX: Event was actually "use screen on kirk", which makes no sense.
+void Room::mudd3UseKirkOnScreen() {
+ if (!_vm->_awayMission.mudd.translatedAlienLanguage) {
+ showText(TX_MUD3N011);
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_037);
+ }
+}
+
+void Room::mudd3UseSpockOnSphere() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ loadActorStandAnim(OBJECT_SPOCK);
+
+ if (_vm->_awayMission.mudd.computerDataErased) {
+ if (!_vm->_awayMission.mudd.databaseDestroyed) {
+ showText(TX_MUD3N000);
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_052);
+ showText(TX_SPEAKER_KIRK, TX_MUD3_012);
+ showText(TX_SPEAKER_MCCOY, TX_MUD3_024);
+ }
+ showText(TX_SPEAKER_KIRK, TX_MUD3_006);
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_048);
+ showText(TX_SPEAKER_KIRK, TX_MUD3_008);
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_051);
+ } else if (_vm->_awayMission.mudd.translatedAlienLanguage) {
+ if (_vm->_awayMission.mudd.accessedAlienDatabase)
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_035);
+ else {
+ _vm->_awayMission.mudd.accessedAlienDatabase = true;
+
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_054);
+ showText(TX_SPEAKER_MCCOY, TX_MUD3_032);
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_050);
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_049);
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_046);
+ showText(TX_SPEAKER_KIRK, TX_MUD3_007);
+
+ _vm->_awayMission.mudd.missionScore++;
+ playVoc("LSHAIANS");
+ loadActorAnim(OBJECT_ALIEN_IMAGE, "s4lbap", 0x32, 0x64);
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ loadActorStandAnim(OBJECT_KIRK);
+ loadActorStandAnim(OBJECT_SPOCK);
+ loadActorStandAnim(OBJECT_MCCOY);
+ loadActorStandAnim(OBJECT_REDSHIRT);
+
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.timers[3] = 40;
+ }
+ } else if (_vm->_awayMission.mudd.discoveredBase3System) {
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_043);
+ showText(TX_SPEAKER_MCCOY, TX_MUD3_022);
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_056);
+ showText(TX_SPEAKER_KIRK, TX_MUD3_015);
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_047);
+ _roomVar.mudd.suggestedUsingTricorders = true;
+ } else {
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_044);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ walkCrewman(OBJECT_SPOCK, 0xcd, 0x87);
+ }
+}
+
+// Finished looking at alien image
+void Room::mudd3Timer3Expired() {
+ _vm->_awayMission.disableInput = false;
+
+ showText(TX_SPEAKER_MCCOY, TX_MUD3_027);
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_053);
+ showText(TX_SPEAKER_MCCOY, TX_MUD3_028);
+ showText(TX_SPEAKER_MCCOY, TX_MUD3_026);
+}
+
+void Room::mudd3UseMccoyOnSphere() {
+ // ENHANCEMENT: Turn to face south
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ loadActorStandAnim(OBJECT_MCCOY);
+
+ showText(TX_SPEAKER_MCCOY, TX_MUD3_021);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ walkCrewman(OBJECT_MCCOY, 0xec, 0x84);
+}
+
+void Room::mudd3UseRedshirtOnSphere() {
+ // ENHANCEMENT: Turn to face south
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
+ loadActorStandAnim(OBJECT_REDSHIRT);
+
+ showText(TX_SPEAKER_BUCHERT, TX_MUD3_068); // BUGFIX: original played McCoy's audio by mistake
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ walkCrewman(OBJECT_REDSHIRT, 0xec, 0x84);
+}
+
+void Room::mudd3UseMTricorderOnSphere() {
+ if (_roomVar.mudd.tricordersUnavailable)
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_039); // BUGFIX: speaker is Spock
+ else {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ loadActorStandAnim(OBJECT_MCCOY);
+ if (!_vm->_awayMission.mudd.translatedAlienLanguage && _roomVar.mudd.suggestedUsingTricorders && _vm->_awayMission.mudd.discoveredBase3System) {
+ _vm->_awayMission.disableInput = true;
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ walkCrewman(OBJECT_MCCOY, 0xac, 0x88);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ walkCrewmanC(OBJECT_SPOCK, 0xa5, 0x8c, &Room::mudd3ReadyToHookUpTricorders);
+ } else {
+ showText(TX_SPEAKER_MCCOY, TX_MUD3_021);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ walkCrewman(OBJECT_MCCOY, 0xec, 0x84);
+ }
+ }
+}
+
+void Room::mudd3UseSTricorderOnSphere() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ loadActorStandAnim(OBJECT_SPOCK);
+
+ if (_roomVar.mudd.tricordersUnavailable)
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_039); // BUGFIX: speaker is Spock
+ else if (_vm->_awayMission.mudd.translatedAlienLanguage || (_vm->_awayMission.mudd.discoveredBase3System && !_roomVar.mudd.suggestedUsingTricorders)) {
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_041);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ walkCrewman(OBJECT_SPOCK, 0xcd, 0x87);
+ } else if (_vm->_awayMission.mudd.discoveredBase3System && _roomVar.mudd.suggestedUsingTricorders) { // Hooking up tricorders
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ walkCrewmanC(OBJECT_MCCOY, 0xca, 0x88, &Room::mudd3ReadyToHookUpTricorders);
+ } else { // No idea how to access it
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_042);
+ walkCrewman(OBJECT_SPOCK, 0xcd, 0x87);
+ }
+}
+
+void Room::mudd3ReadyToHookUpTricorders() {
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_018);
+
+ _roomVar.mudd.tricordersUnavailable = true;
+ _vm->_awayMission.timers[1] = 50;
+
+ loadActorAnim2(OBJECT_SPOCK, "sscans");
+ playSoundEffectIndex(SND_TRICORDER);
+}
+
+void Room::mudd3Timer1Expired() { // Tricorders ready for use again
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_040);
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_034);
+
+ _vm->_awayMission.disableInput = false;
+ _roomVar.mudd.tricordersUnavailable = false;
+ _roomVar.mudd.suggestedUsingTricorders = false;
+ _vm->_awayMission.mudd.translatedAlienLanguage = true;
+ _vm->_awayMission.mudd.missionScore++;
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ walkCrewman(OBJECT_SPOCK, 0xcd, 0x87);
+ walkCrewman(OBJECT_MCCOY, 0xec, 0x84);
+}
+
+// Harry Mudd stumbled into the room
+void Room::mudd3Timer2Expired() {
+ const int choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_MUD3_010,
+ TX_MUD3_009,
+ TX_BLANK
+ };
+
+ _vm->_awayMission.mudd.computerDataErased = true;
+
+ showText(TX_SPEAKER_MUDD, TX_MUD3_065);
+ int choice = showText(choices);
+
+ if (choice == 0) { // Allow him to access the database
+ showText(TX_SPEAKER_MUDD, TX_MUD3_066);
+ _vm->_awayMission.mudd.gaveMuddDatabaseAccess = true;
+ } else { // Don't allow it (he destroys it by accident)
+ showText(TX_SPEAKER_MUDD, TX_MUD3_064);
+ _vm->_awayMission.timers[4] = 98;
+ _vm->_awayMission.disableInput = 2;
+ playMidiMusicTracks(26);
+ loadActorAnim(OBJECT_MUDD, "s4lbhb", 0xa2, 0x9f);
+ }
+}
+
+void Room::mudd3Timer4Expired() {
+ _vm->_awayMission.mudd.databaseDestroyed = true;
+
+ showText(TX_SPEAKER_MUDD, TX_MUD3_063);
+ showText(TX_SPEAKER_MCCOY, TX_MUD3_031);
+
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::mudd3UseMemoryDiskOnSphere() {
+ if (_vm->_awayMission.mudd.databaseDestroyed)
+ showText(TX_MUD3N014);
+ else if (_vm->_awayMission.mudd.translatedAlienLanguage && !_vm->_awayMission.mudd.gaveMuddDatabaseAccess) {
+ showText(TX_MUD3N020);
+ if (!_vm->_awayMission.mudd.gotPointsForDownloadingData) {
+ _vm->_awayMission.mudd.missionScore += 3;
+ _vm->_awayMission.mudd.gotPointsForDownloadingData = true;
+ }
+ } else
+ showText(TX_MUD3N019);
+}
+
+
+void Room::mudd3GetRepairTool() {
+ if (_vm->_awayMission.mudd.tookRepairToolFromDatabaseRoom)
+ showText(TX_MUD3N018); // NOTE: unused, since the object disappears, can't be selected again
+ else {
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ walkCrewmanC(OBJECT_KIRK, 0xba, 0xc1, &Room::mudd3ReachedRepairTool);
+ }
+}
+
+void Room::mudd3ReachedRepairTool() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ loadActorAnimC(OBJECT_KIRK, "kusemn", -1, -1, &Room::mudd3PickedUpRepairTool);
+}
+
+void Room::mudd3PickedUpRepairTool() {
+ _vm->_awayMission.disableInput = false;
+ loadActorStandAnim(OBJECT_REPAIR_TOOL);
+ _vm->_awayMission.mudd.tookRepairToolFromDatabaseRoom = true;
+ _vm->_awayMission.mudd.missionScore++;
+ giveItem(OBJECT_IDOOVER);
+}
+
+void Room::mudd3LookAtSphere() {
+ // ENHANCEMENT: Turn to face south
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ loadActorStandAnim(OBJECT_KIRK);
+
+ showText(TX_MUD3N015);
+}
+
+void Room::mudd3WalkToNorthDoor() {
+ _roomVar.mudd.walkingToDoor = true;
+ _vm->_awayMission.disableInput = true;
+ walkCrewman(OBJECT_KIRK, 0xb8, 0x70);
+}
+
+void Room::mudd3TouchedHotspot0() { // Triggers north door
+ if (_roomVar.mudd.walkingToDoor) {
+ playVoc("SMADOOR3");
+ loadActorAnim(OBJECT_NORTH_DOOR, "s4lbdo", 0xba, 0x6f);
+ }
+}
+
+void Room::mudd3WalkToEastDoor() {
+ _roomVar.mudd.walkingToDoor = true;
+ _vm->_awayMission.disableInput = true;
+ walkCrewman(OBJECT_KIRK, 0x121, 0x81);
+}
+
+void Room::mudd3TouchedHotspot1() {
+ if (_roomVar.mudd.walkingToDoor) {
+ playVoc("SMADOOR3");
+ }
+}
+
+void Room::mudd3LookAtKirk() {
+ if (!_vm->_awayMission.mudd.muddInDatabaseRoom)
+ showText(TX_MUD3N005);
+ else
+ showText(TX_MUD3N004);
+}
+
+void Room::mudd3LookAtSpock() {
+ if (!_vm->_awayMission.mudd.muddInDatabaseRoom)
+ showText(TX_MUD3N012);
+ else
+ showText(TX_MUD3N002);
+}
+
+void Room::mudd3LookAtMccoy() {
+ if (!_vm->_awayMission.mudd.muddInDatabaseRoom)
+ showText(TX_MUD3N010);
+ else
+ showText(TX_MUD3N009);
+}
+
+void Room::mudd3LookAtRedshirt() {
+ if (!_vm->_awayMission.mudd.muddInDatabaseRoom)
+ showText(TX_MUD3N007);
+ else
+ showText(TX_MUD3N006);
+}
+
+void Room::mudd3LookAtMudd() {
+ showText(TX_MUD3N003);
+}
+
+void Room::mudd3TalkToKirk() {
+ if (!_vm->_awayMission.mudd.muddInDatabaseRoom) {
+ showText(TX_SPEAKER_KIRK, TX_MUD3_014);
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_057);
+ showText(TX_SPEAKER_MCCOY, TX_MUD3_025);
+ } else
+ showText(TX_SPEAKER_KIRK, TX_MUD3_002);
+}
+
+void Room::mudd3TalkToSpock() {
+ if (!_vm->_awayMission.mudd.muddInDatabaseRoom) {
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_055);
+ showText(TX_SPEAKER_MCCOY, TX_MUD3_033);
+ showText(TX_SPEAKER_KIRK, TX_MUD3_011);
+ } else
+ showText(TX_SPEAKER_SPOCK, TX_MUD3_019);
+}
+
+void Room::mudd3TalkToMccoy() {
+ if (!_vm->_awayMission.mudd.muddInDatabaseRoom)
+ showText(TX_SPEAKER_MCCOY, TX_MUD3_023);
+ else {
+ showText(TX_SPEAKER_MCCOY, TX_MUD3_030);
+ showText(TX_SPEAKER_MUDD, TX_MUD3_062);
+ }
+}
+
+void Room::mudd3TalkToRedshirt() {
+ if (!_vm->_awayMission.mudd.muddInDatabaseRoom) {
+ showText(TX_SPEAKER_BUCHERT, TX_MUD3_070);
+ showText(TX_SPEAKER_KIRK, TX_MUD3_016);
+ showText(TX_SPEAKER_BUCHERT, TX_MUD3_071);
+ } else
+ showText(TX_SPEAKER_BUCHERT, TX_MUD3_067);
+}
+
+void Room::mudd3TalkToMudd() {
+ if (_vm->_awayMission.mudd.databaseDestroyed) {
+ showText(TX_SPEAKER_MUDD, TX_MUD3_060);
+ showText(TX_SPEAKER_MCCOY, TX_MUD3_029);
+ showText(TX_SPEAKER_MUDD, TX_MUD3_061);
+ showText(TX_SPEAKER_KIRK, TX_MUD3_013);
+ showText(TX_SPEAKER_MUDD, TX_MUD3_058);
+ showText(TX_SPEAKER_SPOCK, TX_MUD3C001);
+ showText(TX_SPEAKER_BUCHERT, TX_MUD3_069);
+ showText(TX_SPEAKER_MUDD, TX_MUD3_059);
+ showText(TX_SPEAKER_KIRK, TX_MUD3_005);
+ }
+}
+
+void Room::mudd3UseMedkit() {
+ showText(TX_SPEAKER_MCCOY, TX_MUD3_020);
}
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 1fa88bb..beb18e7 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -84,7 +84,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxHasMultipleChoices = false;
_missionToLoad = "MUDD";
- _roomIndexToLoad = 2;
+ _roomIndexToLoad = 3;
for (int i = 0; i < NUM_OBJECTS; i++)
_itemList[i] = g_itemList[i];
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 611305a..546a7cf 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -1342,6 +1342,99 @@ enum GameStringIDs {
TX_MUD2N011,
+ TX_MUD3_002,
+ TX_MUD3_003,
+ TX_MUD3_005,
+ TX_MUD3_006,
+ TX_MUD3_007,
+ TX_MUD3_008,
+ TX_MUD3_009,
+ TX_MUD3_010,
+ TX_MUD3_011,
+ TX_MUD3_012,
+ TX_MUD3_013,
+ TX_MUD3_014,
+ TX_MUD3_015,
+ TX_MUD3_016,
+ TX_MUD3_017,
+ TX_MUD3_018,
+ TX_MUD3_019,
+ TX_MUD3_020,
+ TX_MUD3_021,
+ TX_MUD3_022,
+ TX_MUD3_023,
+ TX_MUD3_024,
+ TX_MUD3_025,
+ TX_MUD3_026,
+ TX_MUD3_027,
+ TX_MUD3_028,
+ TX_MUD3_029,
+ TX_MUD3_030,
+ TX_MUD3_031,
+ TX_MUD3_032,
+ TX_MUD3_033,
+ TX_MUD3_034,
+ TX_MUD3_035,
+ TX_MUD3_036,
+ TX_MUD3_037,
+ TX_MUD3_038,
+ TX_MUD3_039,
+ TX_MUD3_040,
+ TX_MUD3_041,
+ TX_MUD3_042,
+ TX_MUD3_043,
+ TX_MUD3_044,
+ // UNUSED
+ TX_MUD3_046,
+ TX_MUD3_047,
+ TX_MUD3_048,
+ TX_MUD3_049,
+ TX_MUD3_050,
+ TX_MUD3_051,
+ TX_MUD3_052,
+ TX_MUD3_053,
+ TX_MUD3_054,
+ TX_MUD3_055,
+ TX_MUD3_056,
+ TX_MUD3_057,
+ TX_MUD3_058,
+ TX_MUD3_059,
+ TX_MUD3_060,
+ TX_MUD3_061,
+ TX_MUD3_062,
+ TX_MUD3_063,
+ TX_MUD3_064,
+ TX_MUD3_065,
+ TX_MUD3_066,
+ TX_MUD3_067,
+ TX_MUD3_068,
+ TX_MUD3_069,
+ TX_MUD3_070,
+ TX_MUD3_071,
+ TX_MUD3N000,
+ TX_MUD3N001,
+ TX_MUD3N002,
+ TX_MUD3N003,
+ TX_MUD3N004,
+ TX_MUD3N005,
+ TX_MUD3N006,
+ TX_MUD3N007,
+ TX_MUD3N008,
+ TX_MUD3N009,
+ TX_MUD3N010,
+ TX_MUD3N011,
+ TX_MUD3N012,
+ TX_MUD3N013,
+ TX_MUD3N014,
+ TX_MUD3N015,
+ TX_MUD3N016,
+ TX_MUD3N017,
+ TX_MUD3N018,
+ TX_MUD3N019,
+ TX_MUD3N020,
+ TX_MUD3C001,
+
+
TX_MUD4_018,
@@ -2444,7 +2537,7 @@ const char * const g_gameStrings[] = {
"#LOV5\\LOV5N016#Some odd looking equipment, connected to the torpedo.",
"#LOV5\\LOV5N017#The Romulan Preax weakly regains conscienceness, reaching for his weapon.",
"#LOV5\\LOV5N018#The Romulan Preax drinks thirstily and empties the container.",
- "(Raises an eyebrow).", // NOTE: no corresponding audio
+ "(Raises an eyebrow)", // NOTE: no corresponding audio
"#LOVA\\LOVA_100#He's dead, Jim.",
@@ -2568,7 +2661,7 @@ const char * const g_gameStrings[] = {
"#MUD2\\MUD2_001#Spock, see if you can outflank him...",
- "#MUD2\\MUD2_002#Well, now I think we know why the Elasi pirates were so interested in finding out where Mudd was getting these>",
+ "#MUD2\\MUD2_002#Well, now! I think we know why the Elasi pirates were so interested in finding out where Mudd was getting these!", // TYPO
"#MUD2\\MUD2_003#Almost worth a try. Bones? ",
"#MUD2\\MUD2_004#Do they pose any threat to us, Doctor?",
"#MUD2\\MUD2_005#Harry! Calm down Harry, it's only us! ",
@@ -2634,6 +2727,98 @@ const char * const g_gameStrings[] = {
"#MUD2\\MUD2N011#This seems to be the main monitoring station for the beds. Above it is some sort of dispensary.",
+ "#MUD3\\MUD3_002#Harry! Look what you've done! ",
+ "#MUD3\\MUD3_003#Kirk to Enterprise...",
+ "#MUD3\\MUD3_005#At ease, lieutenant. He's not worth it. ",
+ "#MUD3\\MUD3_006#At least our life support system isn't dependent on the alien computer.",
+ "#MUD3\\MUD3_007#By all means, Spock.",
+ "#MUD3\\MUD3_008#But their essence, their souls -- are gone, Spock.",
+ "#MUD3\\MUD3_009#Get away from that this instant, Harry, or I'll shoot you where you stand.",
+ "#MUD3\\MUD3_010#Help yourself, Harry. Knowledge is for everyone.",
+ "#MUD3\\MUD3_011#It would be nice to think after all the stunts that Harry has pulled that he would do something right for a change. ",
+ "#MUD3\\MUD3_012#Spock, we're talking about Harry Mudd. He was probably trying to download it so he could sell it to the highest bidder.",
+ "#MUD3\\MUD3_013#Teeny bit clumsy? Mudd, you're a disgrace to the entire human race! ",
+ "#MUD3\\MUD3_014#This technology is unbelievable, Mr. Spock. I've never seen anything like it. ",
+ "#MUD3\\MUD3_015#With the Enterprise out of range, that's not an option, Mr. Spock.What else can you do?",
+ "#MUD3\\MUD3_016#You better believe it, lieutenant. ",
+ "#MUD3\\MUD3_017#Apparently an information data screen, something like the display readers on the Enterprise.",
+ "#MUD3\\MUD3_018#Both our tricorders are now working on basic processing of the aliens' computer data system. The tricorders are not the equal of the Universal Translator, but we should be able to retrieve basic information and get an insight into their culture and lifesystems. I don't believe we could have gotten even this far, had we not deduced their fixation on base-6 mathematics and esthetics.",
+ "#MUD3\\MUD3_019#Captain, it was not logical to allow Harry Mudd to get within one hundred meters of this room. ",
+ "#MUD3\\MUD3_020#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#MUD3\\MUD3_021#Not my area of expertise, I'm afraid.",
+ "#MUD3\\MUD3_022#That would be quite a find, Jim. This is an alien race unknown to us, and they were certain to have knowledge new to us.",
+ "#MUD3\\MUD3_023#This equipment's way out of my league, Jim. ",
+ "#MUD3\\MUD3_024#And instead, he wiped the memory. That knowledge was priceless!",
+ "#MUD3\\MUD3_025#If you're incapable of emotion, how do you know what \"awe\" is, Spock? ",
+ "#MUD3\\MUD3_026#Interesting data here about the six-eyed vision processing in the brain. Their eyesight must have been excellent, and almost 300 degrees around.",
+ "#MUD3\\MUD3_027#Look at their physiology, Jim -- I think this explains the L'Shaians' fascination with threes and sixes.",
+ "#MUD3\\MUD3_028#Medical knowledge is comprehensive, and lifespan is extended considerably over archaic expectations, with maintenance of quality of life.",
+ "#MUD3\\MUD3_029#Mudd! Don't you realize what you've done! That knowledge was irreplaceable! You just burned down the galactic equivalent of the Library of Alexandria! Millions of lives might have been saved by the knowledge you destroyed! ",
+ "#MUD3\\MUD3_030#Mudd! If I were to perform an autopsy on you right now, I might be able to find a cure for stupidity! ",
+ "#MUD3\\MUD3_031#Mudd, do you know what you just did!? That knowledge was priceless -- and you've just destroyed it forever!!",
+ "#MUD3\\MUD3_032#To say nothing of fulfilling our mandate to seek out new life and new civilizations...",
+ "#MUD3\\MUD3_033#You can't be serious, Spock! ",
+ "#MUD3\\MUD3_034#I believe I have downloaded enough information to our tricorders to enable operation of most of the ship's controls, Captain.",
+ "#MUD3\\MUD3_035#I believe I have retrieved as much data as I can, Captain.",
+ "#MUD3\\MUD3_036#I believe I've extracted a copy of the main databank, Captain.",
+ "#MUD3\\MUD3_037#I would suggest, Captain, that the controls to this screen are elsewhere in this room.",
+ "#MUD3\\MUD3_038#The data viewscreen is operational. The information selectors are controlled from the console platform.",
+ "#MUD3\\MUD3_039#The tricorder's entire sensor and data processing capabilities are presently occupied with decipherment of the ship's library.",
+ "#MUD3\\MUD3_040#The tricorders are again available for general use. The alien ship's computer data is now accessible from the ship's library.",
+ "#MUD3\\MUD3_041#This platform contains the control console for the ship's computer library. Data may be accessed by using this console.",
+ "#MUD3\\MUD3_042#This platform contains the control console for what appears to be the information center of the ship -- the computer library, if you will. It appears functional, but incomprehensible without some better understanding of the aliens who built it.",
+ "#MUD3\\MUD3_043#This seems to activate the ship's computer bank control node. Given the aliens' predilection for multiples of 3, it may be possible to use our tricorders to decipher the information carried in these data banks.",
+ "#MUD3\\MUD3_044#This seems to activate the ship's computer bank control node. I lack sufficient information to commence data retrieval, however. Simply put, without some understanding of the aliens' mindset, there's no place to start.",
+ "#MUD3\\MUD3_046#I believe I can produce a picture of a member of their race, Captain.",
+ "#MUD3\\MUD3_047#I believe if Dr. McCoy and I conjoin our two tricorders, we may be able to process enough sample data to get a basic understanding of the aliens' computer system. This will completely tie up both our tricorders for an extended amount of time, however.",
+ "#MUD3\\MUD3_048#I believe, Captain, that the basic functions of the ship remain, even now. This is the library module -- the art, history, and cultural memory of the aliens are gone, but the mechanical necessities of sick bay, engineering, and sensors continue to work.",
+ "#MUD3\\MUD3_049#I have found an entry on an experimental long-range weapon booster, recently installed, named the Whyos weapon. It does not alter the power of the primary weapons systems, but it does increase the range at which those weapons are effective.",
+ "#MUD3\\MUD3_050#I'm recieving data now, Captain. Most internal and external functions are controlled from the bridge. These include Engineering, Navigation, Communications, and Sensors. Weapons functions are controlled from the weapons room.",
+ "#MUD3\\MUD3_051#Illogical, Captain. This race has been extinct for millenia.",
+ "#MUD3\\MUD3_052#It appears our good friend Harry Mudd has crashed the main computers. I doubt if it was a very easy thing to manage.",
+ "#MUD3\\MUD3_053#It should be no surprise that physiology affects mind and behavior. I would say a six-fingered, six-eyed people would naturally develop their sciences and arts around base-six numerical systems, just as I observed on the bridge.",
+ "#MUD3\\MUD3_054#Not all topics will necessarily be available, Captain. Nor do I believe we can get full details on all data -- the tricorders could only do so much processing. It would be worth our effort to locate the central databanks for delivery to the Kornephoros Life Sciences University, I believe.",
+ "#MUD3\\MUD3_055#This is a major archeological find, Captain. I believe the galaxy may actually have cause to thank Harry Mudd. ",
+ "#MUD3\\MUD3_056#Were the Universal Translator available, this would be simple.",
+ "#MUD3\\MUD3_057#It is indeed impressive Captain. If I were capable of emotion, I would be in awe of this place. ",
+ "#MUD3\\MUD3_058#How dare you, Kirk! I have half a mind to sue for defamation of character... ",
+ "#MUD3\\MUD3_059#Kirk! Get this muscle-bound clod away from me. I'm allergic to violence! ",
+ "#MUD3\\MUD3_060#Kirk, look what you made me do! You and your clumsy Starfleet... ",
+ "#MUD3\\MUD3_061#Now see here, Dr. McCoy! Don't blame me if Kirk's bellowing causes me to be a teeny bit clumsy... ",
+ "#MUD3\\MUD3_062#Now, you aren't... I mean.... Kirk! ",
+ "#MUD3\\MUD3_063#Ooops!",
+ "#MUD3\\MUD3_064#Whatever you say, Captain!",
+ "#MUD3\\MUD3_065#Why, Captain! I see you got this machine to work -- I tried to get it up and running for the longest time.",
+ "#MUD3\\MUD3_066#Why, Kirk, I didn't think you had it in you. Thank you!",
+ "#MUD3\\MUD3_067#Captain, I think I understand why you dislike this Mudd guy so much. ",
+ "#MUD3\\MUD3_068#Not my area of expertise, I'm afraid.",
+ "#MUD3\\MUD3_069#Captain, I think Mr. Mudd looks like he's getting out of control... ",
+ "#MUD3\\MUD3_070#Captain, does this mean that I'm a part of a major archeological discovery? ",
+ "#MUD3\\MUD3_071#I don't see why you're complaining about this Mudd guy. Who knows what advances we could get from all this knowledge? ",
+ "#MUD3\\MUD3N000#Databanks erased.",
+ "#MUD3\\MUD3N001#Dust and grease lifts off the surface, leaving this item clean as new.",
+ "#MUD3\\MUD3N002#Even Spock is visibly disturbed by Mudd's carelessness. ",
+ "#MUD3\\MUD3N003#Harry Mudd hopes he can make it back to his ship and get away in one piece. ",
+ "#MUD3\\MUD3N004#Kirk is dismayed by the destruction he has seen. ",
+ "#MUD3\\MUD3N005#Kirk is silently worried about what is happening back on the Enterprise. ",
+ "#MUD3\\MUD3N006#Lieutenant Buchert is not at all happy with Harcourt Fenton Mudd. ",
+ "#MUD3\\MUD3N007#Lieutenant Buchert seems to have limitless energy. It makes you feel old just watching him. ",
+ "#MUD3\\MUD3N008#Life support fails completely and you fall unconscious.",
+ "#MUD3\\MUD3N009#McCoy is aghast at this turn of events. ",
+ "#MUD3\\MUD3N010#McCoy is his usual crusty old self. ",
+ "#MUD3\\MUD3N011#Nothing happens.",
+ "#MUD3\\MUD3N012#Sometimes you wonder if Spock will ever show emotion. ",
+ "#MUD3\\MUD3N013#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
+ "#MUD3\\MUD3N014#The computer has nothing to write to the spheroid.",
+ "#MUD3\\MUD3N015#The sphere in the middle of this console appears to be some sort of control mechanism.",
+ "#MUD3\\MUD3N016#These two things fit together like they were made for each other.",
+ "#MUD3\\MUD3N017#This might be a data screen of some kind.",
+ "#MUD3\\MUD3N018#You already have a doover.",
+ "#MUD3\\MUD3N019#You can't seem to make this work.",
+ "#MUD3\\MUD3N020#You download major portions of the alien library onto the yellow spheroid.",
+ "(Raises eyebrow)", // Custom
+
+
"#MUD4\\MUD4_018#Kirk to Enterprise ... Kirk to Enterprise.",
Commit: a636aacf5161161180bd948c7f72bc8acd0113db
https://github.com/scummvm/scummvm/commit/a636aacf5161161180bd948c7f72bc8acd0113db
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: MUDD4
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/mudd0.cpp
engines/startrek/rooms/mudd1.cpp
engines/startrek/rooms/mudd3.cpp
engines/startrek/rooms/mudd4.cpp
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index fd1f61f..0ba73e8 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -41,7 +41,7 @@ void StarTrekEngine::initAwayMission() {
_roomIndexToLoad = -1;
// Load crew positions for beaming in
- initAwayCrewPositions(1);
+ initAwayCrewPositions(2);
}
void StarTrekEngine::runAwayMission() {
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index eaae68b..7097f44 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -203,12 +203,14 @@ struct AwayMission {
// True if you've combined the lense + degrimer and fired it off, discovering
// it's a weapon
bool discoveredLenseAndDegrimerFunction; // 0x3c
- byte torpedoStatus; // 0x3d
+ int16 torpedoStatus; // 0x3d
bool muddCurrentlyInsane; // 0x3f
bool muddVisitedDatabaseRoom; // 0x40
bool accessedAlienDatabase; // 0x41
- bool tookRepairToolFromDatabaseRoom; // 0x42
+ bool tookRepairTool; // 0x42
bool gotPointsForDownloadingData; // 0x43
+ bool contactedEnterpriseFirstTime; // 0x44
+ bool viewScreenEnabled; // 0x45
bool gotMemoryDisk; // 0x48
bool gotLense; // 0x49
bool gotDegrimer; // 0x4a
@@ -220,6 +222,7 @@ struct AwayMission {
bool enteredRoom0ForFirstTime; // 0x54
bool gotPointsForLoadingTorpedo; // 0x55
bool gotPointsForPressingRedButton; // 0x56
+ bool gotPointsForEnablingViewscreen; // 0x57
bool enteredRoom1ForFirstTime; // 0x58
bool field58; // 0x58
int16 missionScore; // 0x5a
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 9eea5d1..81f9832 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1294,6 +1294,53 @@ public:
// MUDD4
void mudd4Tick1();
+ void mudd4UseCommunicator();
+ void mudd4Timer2Expired();
+ void mudd4Timer3Expired();
+ void mudd4UseSpockOnLeftConsole();
+ void mudd4UseSpockOnRightConsole();
+ void mudd4UseSpockOnConsole();
+ void mudd4SpockReachedChair();
+ void mudd4SpockSatInChair();
+ void mudd4ShowLeftConsoleMenu();
+ void mudd4SpockUsedSensors();
+ void mudd4SpockUsedEngineering();
+ void mudd4SpockUsedNavigation();
+ void mudd4FinishedWalking3();
+ void mudd4UseKirkOnRightConsole();
+ void mudd4UseKirkOnLeftConsole();
+ void mudd4UseKirkOnConsole();
+ void mudd4KirkReachedRightConsole();
+ void mudd4KirkSatInChair();
+ void mudd4ShowRightConsoleMenu();
+ void mudd4KirkUsedViewScreen();
+ void mudd4Timer1Expired();
+ void mudd4KirkUsedCommunications();
+ void mudd4TalkWithMuddAtMissionEnd();
+ void mudd4KirkReachedPositionToTalkToMudd();
+ void mudd4UseMccoyOnConsole();
+ void mudd4UseRedshirtOnConsole();
+ void mudd4UseSTricorderOnRepairTool();
+ void mudd4UseSTricorderOnConsole();
+ void mudd4UseSTricorderOnViewscreen();
+ void mudd4UseMedkit();
+ void mudd4GetRepairTool();
+ void mudd4ReachedRepairTool();
+ void mudd4PickedUpRepairTool();
+ void mudd4LookAtConsole();
+ void mudd4LookAtViewscreen();
+ void mudd4LookAtKirk();
+ void mudd4LookAtSpock();
+ void mudd4LookAtMccoy();
+ void mudd4LookAtRedshirt();
+ void mudd4LookAtRepairTool();
+ void mudd4TalkToKirk();
+ void mudd4TalkToSpock();
+ void mudd4TalkToMccoy();
+ void mudd4TalkToRedshirt();
+ void mudd4WalkToEastDoor();
+ void mudd4WalkToWestDoor();
+ void mudd4TouchedHotspot0();
// MUDD5
void mudd5Tick1();
@@ -1411,6 +1458,10 @@ private:
bool suggestedUsingTricorders; // 0xca
bool tricordersUnavailable; // 0xcb
+ // mudd4
+ bool usingLeftConsole; // 0xca
+ bool kirkUsingRightConsole; // 0xcb
+
// common
byte walkingToDoor;
} mudd;
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 89b0397..2f729b5 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1615,7 +1615,81 @@ RoomAction mudd3ActionList[] = {
RoomAction mudd4ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd4Tick1 },
+ { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd4UseCommunicator },
+ { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::mudd4Timer2Expired },
+ { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::mudd4Timer3Expired },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x21, 0), &Room::mudd4UseSpockOnLeftConsole },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x22, 0), &Room::mudd4UseSpockOnLeftConsole },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x23, 0), &Room::mudd4UseSpockOnRightConsole },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::mudd4SpockReachedChair },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::mudd4SpockSatInChair },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::mudd4SpockUsedSensors },
+ { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::mudd4SpockUsedEngineering },
+ { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::mudd4SpockUsedNavigation },
+ { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::mudd4FinishedWalking3 },
+ { Action(ACTION_USE, OBJECT_KIRK, 0x21, 0), &Room::mudd4UseKirkOnRightConsole },
+ { Action(ACTION_USE, OBJECT_KIRK, 0x23, 0), &Room::mudd4UseKirkOnRightConsole },
+ { Action(ACTION_USE, OBJECT_KIRK, 0x22, 0), &Room::mudd4UseKirkOnLeftConsole },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::mudd4KirkReachedRightConsole },
+ { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::mudd4KirkSatInChair },
+ { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::mudd4KirkUsedViewScreen },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd4Timer1Expired },
+ { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::mudd4KirkUsedCommunications },
+ { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::mudd4KirkReachedPositionToTalkToMudd },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x21, 0), &Room::mudd4UseMccoyOnConsole },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x22, 0), &Room::mudd4UseMccoyOnConsole },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x23, 0), &Room::mudd4UseMccoyOnConsole },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x21, 0), &Room::mudd4UseRedshirtOnConsole },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x22, 0), &Room::mudd4UseRedshirtOnConsole },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x23, 0), &Room::mudd4UseRedshirtOnConsole },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 10, 0), &Room::mudd4UseSTricorderOnRepairTool },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::mudd4UseSTricorderOnConsole },
+
+ // ENHANCEMENT: Allow scanning the console to work when scanning the specific stations
+ // as well
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::mudd4UseSTricorderOnConsole },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::mudd4UseSTricorderOnConsole },
+
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::mudd4UseSTricorderOnViewscreen },
+
+ // ENHANCEMENT: Allow scanning the viewscreen when it's on, not just when off
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::mudd4UseSTricorderOnViewscreen },
+
+ // Common code
+ { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
+ { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
+ { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
+
+ { Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd4UseMedkit },
+ { Action(ACTION_GET, 10, 0, 0), &Room::mudd4GetRepairTool },
+ { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::mudd4ReachedRepairTool },
+ { Action(ACTION_FINISHED_ANIMATION, 10, 0, 0), &Room::mudd4PickedUpRepairTool },
+
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::mudd4LookAtConsole },
+ // ENHANCEMENT: Allow look action work with the specific stations as well
+ { Action(ACTION_LOOK, 0x22, 0, 0), &Room::mudd4LookAtConsole },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::mudd4LookAtConsole },
+
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd4LookAtViewscreen },
+ // ENHANCEMENT: Allow look action work when viewscreen is on, not just when off
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::mudd4LookAtViewscreen },
+
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd4LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd4LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd4LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd4LookAtRedshirt },
+ { Action(ACTION_LOOK, 10, 0, 0), &Room::mudd4LookAtRepairTool },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd4TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd4TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd4TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd4TalkToRedshirt },
+ { Action(ACTION_WALK, 0x24, 0, 0), &Room::mudd4WalkToEastDoor },
+ { Action(ACTION_WALK, 0x25, 0, 0), &Room::mudd4WalkToWestDoor },
+ { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd4TouchedHotspot0 },
+ // TODO: remainder? something about losing atmosphere?
};
+
RoomAction mudd5ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd5Tick1 },
};
diff --git a/engines/startrek/rooms/mudd0.cpp b/engines/startrek/rooms/mudd0.cpp
index 381a07a..dbb1c99 100644
--- a/engines/startrek/rooms/mudd0.cpp
+++ b/engines/startrek/rooms/mudd0.cpp
@@ -165,7 +165,8 @@ void Room::mudd0UseLenseOnDegrimer() {
_vm->_awayMission.mudd.missionScore++;
showText(TX_MUD0N011);
- // Identical (?) audio files: TX_MUD0N011, TX_MUD1N013, TX_MUD2N010, TX_MUD3N016
+ // TODO: Identical (?) audio files: TX_MUD0N011, TX_MUD1N013, TX_MUD2N010, TX_MUD3N016,
+ // TX_MUD4009
}
@@ -175,6 +176,7 @@ void Room::mudd0UseAlienDevice() {
13, // MUDD1
11, // MUDD2
11, // MUDD3
+ 9, // MUDD4
};
_vm->_awayMission.disableInput = true;
@@ -192,13 +194,14 @@ void Room::mudd0FiredAlienDevice() {
_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction = true;
_vm->_awayMission.mudd.missionScore += 5;
showText(TX_SPEAKER_KIRK, TX_MUD0_002);
- // Identical (?) audio files: TX_MUD0_002, TX_MUD1_002, TX_MUD2_002
+ // TODO: Identical (?) audio files: TX_MUD0_002, TX_MUD1_002, TX_MUD2_002
}
}
void Room::mudd0UseDegrimer() {
- // Identical (?) audio files: TX_MUD0N002, TX_MUD1N004, TX_MUD2N001, TX_MUD3N001...
+ // TODO: Identical (?) audio files: TX_MUD0N002, TX_MUD1N004, TX_MUD2N001,
+ // TX_MUD3N001, TX_MUD4N002
showText(TX_MUD0N002);
}
diff --git a/engines/startrek/rooms/mudd1.cpp b/engines/startrek/rooms/mudd1.cpp
index 074b4bf..a2baf71 100644
--- a/engines/startrek/rooms/mudd1.cpp
+++ b/engines/startrek/rooms/mudd1.cpp
@@ -165,7 +165,7 @@ void Room::mudd1SpockPressedRedButton() {
switch (choice) {
case 0:
- _vm->_awayMission.mudd.torpedoStatus = false;
+ _vm->_awayMission.mudd.torpedoStatus = 0;
// ENHANCEMENT: Original text was just "(Spock raises eyebrow)" without any audio.
// This changes it to a narration to make it flow better.
@@ -177,7 +177,7 @@ void Room::mudd1SpockPressedRedButton() {
// fall through
case 2:
- _vm->_awayMission.mudd.torpedoStatus = true;
+ _vm->_awayMission.mudd.torpedoStatus = 1;
showText(TX_SPEAKER_UHURA, TX_STATICU1);
break;
}
diff --git a/engines/startrek/rooms/mudd3.cpp b/engines/startrek/rooms/mudd3.cpp
index 1eed3de..b0bc5a3 100644
--- a/engines/startrek/rooms/mudd3.cpp
+++ b/engines/startrek/rooms/mudd3.cpp
@@ -36,6 +36,9 @@
namespace StarTrek {
+// BUG-ish: trying to scan the sphere while someone is behind it causes it to scan that
+// object instead.
+
void Room::mudd3Tick1() {
playVoc("MUD3LOOP");
@@ -45,7 +48,7 @@ void Room::mudd3Tick1() {
loadActorAnim(OBJECT_9, "s4lbpb", 0xa2, 0x9f);
// FIXME: is this supposed to be in this if statement?
- if (!_vm->_awayMission.mudd.tookRepairToolFromDatabaseRoom)
+ if (!_vm->_awayMission.mudd.tookRepairTool)
loadActorAnim(OBJECT_REPAIR_TOOL, "s4lbdv", 0xb7, 0xa8);
}
@@ -292,7 +295,7 @@ void Room::mudd3UseMemoryDiskOnSphere() {
void Room::mudd3GetRepairTool() {
- if (_vm->_awayMission.mudd.tookRepairToolFromDatabaseRoom)
+ if (_vm->_awayMission.mudd.tookRepairTool)
showText(TX_MUD3N018); // NOTE: unused, since the object disappears, can't be selected again
else {
_vm->_awayMission.disableInput = true;
@@ -309,7 +312,7 @@ void Room::mudd3ReachedRepairTool() {
void Room::mudd3PickedUpRepairTool() {
_vm->_awayMission.disableInput = false;
loadActorStandAnim(OBJECT_REPAIR_TOOL);
- _vm->_awayMission.mudd.tookRepairToolFromDatabaseRoom = true;
+ _vm->_awayMission.mudd.tookRepairTool = true;
_vm->_awayMission.mudd.missionScore++;
giveItem(OBJECT_IDOOVER);
}
diff --git a/engines/startrek/rooms/mudd4.cpp b/engines/startrek/rooms/mudd4.cpp
index f6a0e55..502a650 100644
--- a/engines/startrek/rooms/mudd4.cpp
+++ b/engines/startrek/rooms/mudd4.cpp
@@ -22,13 +22,549 @@
#include "startrek/room.h"
-#define OBJECT_DOOR1 8
+#define OBJECT_VIEWSCREEN 8
+#define OBJECT_ALIENDV 9
+#define OBJECT_REPAIR_TOOL 10
+#define OBJECT_11 11
-#define HOTSPOT_CONSOLE 0x20
+#define HOTSPOT_SCREEN 0x20
+#define HOTSPOT_CONSOLE 0x21
+#define HOTSPOT_LEFT_CONSOLE 0x22
+#define HOTSPOT_RIGHT_CONSOLE 0x23
+#define HOTSPOT_EAST_DOOR 0x24
+#define HOTSPOT_WEST_DOOR 0x25
namespace StarTrek {
void Room::mudd4Tick1() {
+ playVoc("MUD4LOOP");
+
+ if (!_vm->_awayMission.mudd.tookRepairTool)
+ loadActorAnim(OBJECT_REPAIR_TOOL, "s4crdv", 0xc9, 0x8e);
+
+ if (_vm->_awayMission.mudd.viewScreenEnabled)
+ loadActorAnim(OBJECT_VIEWSCREEN, "s4crvo", 0xa5, 0x76);
+}
+
+void Room::mudd4UseCommunicator() {
+ showText(TX_SPEAKER_KIRK, TX_MUD4_018);
+ showText(TX_SPEAKER_UHURA, TX_STATICU1);
+}
+
+void Room::mudd4Timer2Expired() { // TODO: better name
+ playSoundEffectIndex(SND_07);
+}
+
+void Room::mudd4Timer3Expired() { // TODO: better name
+ playSoundEffectIndex(SND_TRANSENE);
+}
+
+void Room::mudd4UseSpockOnLeftConsole() {
+ _roomVar.mudd.usingLeftConsole = true;
+ mudd4UseSpockOnConsole();
+}
+
+void Room::mudd4UseSpockOnRightConsole() {
+ _roomVar.mudd.usingLeftConsole = false;
+ mudd4UseSpockOnConsole();
+}
+
+void Room::mudd4UseSpockOnConsole() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ loadActorStandAnim(OBJECT_SPOCK);
+
+ if (_vm->_awayMission.mudd.translatedAlienLanguage) {
+ if (!_roomVar.mudd.usingLeftConsole)
+ showText(TX_SPEAKER_SPOCK, TX_MUD4_057);
+ } else if (_vm->_awayMission.mudd.discoveredBase3System) {
+ showText(TX_SPEAKER_SPOCK, TX_MUD4_062);
+ } else {
+ showText(TX_SPEAKER_SPOCK, TX_MUD4_061);
+ showText(TX_SPEAKER_KIRK, TX_MUD4_013);
+ showText(TX_SPEAKER_SPOCK, TX_MUD4_062);
+ showText(TX_SPEAKER_MCCOY, TX_MUD4_048);
+ showText(TX_SPEAKER_SPOCK, TX_MUD4_059);
+ showText(TX_SPEAKER_KIRK, TX_MUD4_031);
+ showText(TX_SPEAKER_SPOCK, TX_MUD4_060);
+
+ if (!_vm->_awayMission.mudd.discoveredBase3System) {
+ _vm->_awayMission.mudd.discoveredBase3System = true;
+ _vm->_awayMission.mudd.missionScore++;
+ }
+ }
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ walkCrewmanC(OBJECT_SPOCK, 0x6d, 0x9a, &Room::mudd4SpockReachedChair);
+ _vm->_awayMission.disableInput = true;
+}
+
+void Room::mudd4SpockReachedChair() {
+ if (_roomVar.mudd.usingLeftConsole && _vm->_awayMission.mudd.translatedAlienLanguage)
+ loadActorAnimC(OBJECT_SPOCK, "s4crss", -1, -1, &Room::mudd4SpockSatInChair);
+ else
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::mudd4SpockSatInChair() {
+ loadActorAnim2(OBJECT_SPOCK, "s4crsr", 0x55, 0x98);
+
+ showText(TX_SPEAKER_SPOCK, TX_MUD4_058);
+ mudd4ShowLeftConsoleMenu();
+}
+
+void Room::mudd4ShowLeftConsoleMenu() {
+ const TextRef choices[] = {
+ TX_SPEAKER_SPOCK,
+ TX_MUD4_038,
+ TX_MUD4_039,
+ TX_MUD4_040,
+ TX_MUD4_041,
+ TX_BLANK
+ };
+
+ int choice = showText(choices);
+
+ switch (choice) {
+ case 0: // Sensors
+ loadActorAnimC(OBJECT_SPOCK, "s4crsr", 0x55, 0x98, &Room::mudd4SpockUsedSensors);
+ _vm->_awayMission.timers[2] = 5;
+ break;
+
+ case 1: // Navigation
+ loadActorAnimC(OBJECT_SPOCK, "s4crsl", 0x55, 0x98, &Room::mudd4SpockUsedNavigation);
+ _vm->_awayMission.timers[2] = 5;
+ break;
+
+ case 2: // Engineering
+ loadActorAnimC(OBJECT_SPOCK, "s4crsr", 0x55, 0x98, &Room::mudd4SpockUsedEngineering);
+ _vm->_awayMission.timers[2] = 5;
+ break;
+
+ case 3: // Done
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ walkCrewman(OBJECT_SPOCK, 0x69, 0xb7);
+ break;
+ }
+}
+
+void Room::mudd4SpockUsedSensors() {
+ _vm->_awayMission.disableInput = false;
+ showText(TX_SPEAKER_SPOCK, TX_MUD4_053);
+ mudd4ShowLeftConsoleMenu();
+}
+
+void Room::mudd4SpockUsedEngineering() {
+ _vm->_awayMission.disableInput = false;
+ showText(TX_SPEAKER_SPOCK, TX_MUD4_056);
+ mudd4ShowLeftConsoleMenu();
+}
+
+void Room::mudd4SpockUsedNavigation() {
+ _vm->_awayMission.disableInput = false;
+ showText(TX_SPEAKER_SPOCK, TX_MUD4_055);
+ mudd4ShowLeftConsoleMenu();
+}
+
+void Room::mudd4FinishedWalking3() { // Spock reaches console after attempting to use Kirk on one
+ _vm->_awayMission.disableInput = false;
+ mudd4UseSpockOnLeftConsole();
+}
+
+void Room::mudd4UseKirkOnRightConsole() {
+ _roomVar.mudd.kirkUsingRightConsole = true;
+ mudd4UseKirkOnConsole();
+}
+
+void Room::mudd4UseKirkOnLeftConsole() {
+ _roomVar.mudd.kirkUsingRightConsole = false;
+ mudd4UseKirkOnConsole();
+}
+
+void Room::mudd4UseKirkOnConsole() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ loadActorStandAnim(OBJECT_KIRK);
+
+ if (!_vm->_awayMission.mudd.translatedAlienLanguage) {
+ showText(TX_SPEAKER_KIRK, TX_MUD4_006);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ walkCrewmanC(OBJECT_SPOCK, 0x6d, 0x9a, &Room::mudd4FinishedWalking3);
+ _vm->_awayMission.disableInput = true;
+ }
+ else {
+ if (!_roomVar.mudd.kirkUsingRightConsole)
+ showText(TX_SPEAKER_KIRK, TX_MUD4_049);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ walkCrewmanC(OBJECT_KIRK, 0x7e, 0x98, &Room::mudd4KirkReachedRightConsole);
+ _vm->_awayMission.disableInput = true;
+ }
+}
+
+void Room::mudd4KirkReachedRightConsole() {
+ if (_roomVar.mudd.kirkUsingRightConsole && _vm->_awayMission.mudd.translatedAlienLanguage)
+ loadActorAnimC(OBJECT_KIRK, "s4crks", -1, -1, &Room::mudd4KirkSatInChair);
+ else
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::mudd4KirkSatInChair() {
+ loadActorAnim2(OBJECT_KIRK, "s4crkl", 0x94, 0x98);
+ _vm->_awayMission.timers[2] = 5;
+ _vm->_awayMission.disableInput = false;
+
+ showText(TX_SPEAKER_SPOCK, TX_MUD4_052); // NOTE: why is Spock talking here?
+
+ mudd4ShowRightConsoleMenu();
+}
+
+void Room::mudd4ShowRightConsoleMenu() {
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_MUD4_002,
+ TX_MUD4_007,
+ TX_MUD4_003, // BUGFIX: this used Spock's voice instead of Kirk's in original
+ TX_BLANK
+ };
+
+ int choice = showText(choices);
+
+ switch (choice) {
+ case 0: // Communications
+ _vm->_awayMission.disableInput = true;
+ loadActorAnimC(OBJECT_KIRK, "s4crkr", 0x94, 0x98, &Room::mudd4KirkUsedCommunications);
+ break;
+
+ case 1: // View Screen
+ _vm->_awayMission.disableInput = true;
+ loadActorAnimC(OBJECT_KIRK, "s4crkl", 0x94, 0x98, &Room::mudd4KirkUsedViewScreen);
+ break;
+
+ case 2: // Done
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ walkCrewman(OBJECT_KIRK, 0x83, 0xb6);
+ break;
+ }
+}
+
+void Room::mudd4KirkUsedViewScreen() {
+ if (!_vm->_awayMission.mudd.viewScreenEnabled) {
+ _vm->_awayMission.mudd.viewScreenEnabled = true;
+ playVoc("SE2BIGAS");
+ loadActorAnim(OBJECT_VIEWSCREEN, "s4crvs", 0xa5, 0x76);
+ _vm->_awayMission.timers[3] = 5;
+ _vm->_awayMission.timers[1] = 50;
+ if (!_vm->_awayMission.mudd.gotPointsForEnablingViewscreen) {
+ _vm->_awayMission.mudd.gotPointsForEnablingViewscreen = true;
+ _vm->_awayMission.mudd.missionScore++;
+ }
+ }
+ else {
+ _vm->_awayMission.mudd.viewScreenEnabled = false;
+ loadActorAnim(OBJECT_VIEWSCREEN, "s4crvf", 0xa5, 0x76);
+ _vm->_awayMission.timers[3] = 5;
+ _vm->_awayMission.timers[1] = 30;
+ }
+}
+
+void Room::mudd4Timer1Expired() {
+ _vm->_awayMission.disableInput = false;
+ if (_vm->_awayMission.mudd.viewScreenEnabled)
+ showText(TX_SPEAKER_KIRK, TX_MUD4_004);
+ mudd4ShowRightConsoleMenu();
+}
+
+void Room::mudd4KirkUsedCommunications() {
+ _vm->_awayMission.disableInput = false;
+ if (!_vm->_awayMission.mudd.knowAboutTorpedo) {
+ showText(TX_SPEAKER_SPOCK, TX_MUD4_054);
+ mudd4ShowRightConsoleMenu();
+ } else {
+ if (!_vm->_awayMission.mudd.contactedEnterpriseFirstTime) {
+ _vm->_awayMission.mudd.missionScore++;
+ showText(TX_SPEAKER_KIRK, TX_MUD4_025);
+ showText(TX_SPEAKER_SCOTT, TX_MUD4_S02);
+
+ if (_vm->_awayMission.mudd.torpedoStatus == 1)
+ showText(TX_SPEAKER_KIRK, TX_MUD4_027);
+ else
+ showText(TX_SPEAKER_KIRK, TX_MUD4_028);
+
+ showText(TX_SPEAKER_SCOTT, TX_MUD4_S04);
+
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_MUD4_024,
+ TX_MUD4_033,
+ TX_MUD4_022, // ENHANCEMENT: This line was recorded twice (MUD4_022 and MUD4_023). It's used twice, so, might as well make use of the second recording.
+ TX_BLANK
+ };
+
+ int choice = showText(choices);
+
+ if (choice == 1) {
+ endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
+ } else if (choice == 0) {
+ _vm->_awayMission.mudd.contactedEnterpriseFirstTime = true;
+ } else { // choice == 2
+ mudd4TalkWithMuddAtMissionEnd();
+ }
+ } else {
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_MUD4_019,
+ TX_MUD4_A29,
+ TX_MUD4_023,
+ TX_BLANK
+ };
+
+ showText(TX_SPEAKER_KIRK, TX_MUD4_020);
+ showText(TX_SPEAKER_SCOTT, TX_MUD4_S03);
+ int choice = showText(choices);
+
+ if (choice == 1) {
+ endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
+ } else if (choice == 2) {
+ mudd4TalkWithMuddAtMissionEnd();
+ }
+ }
+ }
+}
+
+void Room::mudd4TalkWithMuddAtMissionEnd() {
+ if (_vm->_awayMission.mudd.muddCurrentlyInsane)
+ return;
+ else {
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ walkCrewmanC(OBJECT_KIRK, 0x83, 0xb4, &Room::mudd4KirkReachedPositionToTalkToMudd);
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ walkCrewman(OBJECT_SPOCK, 0x69, 0xb7);
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ loadActorStandAnim(OBJECT_MCCOY);
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
+ loadActorStandAnim(OBJECT_REDSHIRT);
+
+ playMidiMusicTracks(3);
+ loadActorAnim(OBJECT_11, "s4crhw", 0x13f, 0xc7);
+ }
+}
+
+void Room::mudd4KirkReachedPositionToTalkToMudd() {
+ _vm->_awayMission.disableInput = false;
+
+ if (_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction
+ || _vm->_awayMission.mudd.gaveMuddDatabaseAccess
+ || _vm->_awayMission.mudd.databaseDestroyed
+ || !_vm->_awayMission.mudd.accessedAlienDatabase) { // NOTE: why this last line? Test this...
+ const int choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_MUD4_009,
+ TX_MUD4_016,
+ TX_BLANK
+ };
+
+ showText(TX_SPEAKER_MUDD, TX_MUD4_066);
+ int choice = showText(choices);
+
+ if (choice == 1) {
+ // Copy of code at very bottom of function
+ showText(TX_SPEAKER_MUDD, TX_MUD4_074);
+ showText(TX_SPEAKER_KIRK, TX_MUD4_017);
+ showText(TX_SPEAKER_MUDD, TX_MUD4_072);
+ showText(TX_SPEAKER_KIRK, TX_MUD4_008);
+ showText(TX_SPEAKER_MUDD, TX_MUD4_068);
+ showText(TX_SPEAKER_KIRK, TX_MUD4_032);
+
+ endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
+ } else {
+ // Threaten to arrest Mudd.
+ if (_vm->_awayMission.mudd.gaveMuddDatabaseAccess || _vm->_awayMission.mudd.databaseDestroyed)
+ showText(TX_SPEAKER_KIRK, TX_MUD4_034);
+ if (_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction)
+ showText(TX_SPEAKER_KIRK, TX_MUD4_037);
+
+ showText(TX_SPEAKER_KIRK, TX_MUD4_026);
+
+ if (_vm->_awayMission.mudd.gaveMuddDatabaseAccess && _vm->_awayMission.mudd.databaseDestroyed) {
+ // NOTE: This combination is probably impossible, making this unused?
+ // (Either you give Mudd access to the database, or he destroys it.)
+
+ // Mudd offers to copy the lost data to the enterprise computer.
+ showText(TX_SPEAKER_MUDD, TX_MUD4_071);
+ showText(TX_SPEAKER_KIRK, TX_MUD4_036);
+ showText(TX_SPEAKER_SPOCK, TX_MUD4_029);
+ showText(TX_SPEAKER_KIRK, TX_MUD4_030);
+ }
+ else {
+ // Mudd is forced to agree to give samples to a university.
+ showText(TX_SPEAKER_MUDD, TX_MUD4_064);
+ showText(TX_SPEAKER_KIRK, TX_MUD4_012);
+ showText(TX_SPEAKER_MUDD, TX_MUD4_070);
+ showText(TX_SPEAKER_KIRK, TX_MUD4_010);
+ showText(TX_SPEAKER_MUDD, TX_MUD4_067);
+ showText(TX_SPEAKER_KIRK, TX_MUD4_011);
+
+ _vm->_awayMission.mudd.missionScore += 4;
+ playMidiMusicTracks(30);
+
+ showText(TX_SPEAKER_MUDD, TX_MUD4_073);
+ showText(TX_SPEAKER_KIRK, TX_MUD4_035);
+ }
+ showText(TX_SPEAKER_MUDD, TX_MUD4_069);
+ showText(TX_SPEAKER_KIRK, TX_MUD4_001);
+
+ endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
+ }
+ }
+ else {
+ const int choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_MUD4_014,
+ TX_MUD4_021,
+ TX_BLANK
+ };
+
+ showText(TX_SPEAKER_MUDD, TX_MUD4_065);
+ int choice = showText(choices);
+
+ if (choice == 1) {
+ showText(TX_SPEAKER_MUDD, TX_MUD4_074);
+ showText(TX_SPEAKER_KIRK, TX_MUD4_017);
+ }
+ showText(TX_SPEAKER_MUDD, TX_MUD4_072);
+ showText(TX_SPEAKER_KIRK, TX_MUD4_008);
+ showText(TX_SPEAKER_MUDD, TX_MUD4_068);
+ showText(TX_SPEAKER_KIRK, TX_MUD4_032);
+
+ endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
+ }
+}
+
+void Room::mudd4UseMccoyOnConsole() {
+ // NOTE: This audio was recorded twice (TX_MUD4_045, and TX_MUD4_044 which is unused)
+ showText(TX_SPEAKER_MCCOY, TX_MUD4_045);
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ walkCrewman(OBJECT_MCCOY, 0x7d, 0xc3);
+}
+
+void Room::mudd4UseRedshirtOnConsole() {
+ // Floppy version shows two different pieces of text here, but in the CD version,
+ // there's no difference
+ if (!_vm->_awayMission.mudd.translatedAlienLanguage)
+ showText(TX_SPEAKER_BUCHERT, TX_MUD4_075);
+ else
+ showText(TX_SPEAKER_BUCHERT, TX_MUD4_075);
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
+ walkCrewman(OBJECT_REDSHIRT, 0x2a, 0xbb);
+}
+
+void Room::mudd4UseSTricorderOnRepairTool() {
+ spockScan(DIR_E, TX_MUD4_051, false);
+}
+
+void Room::mudd4UseSTricorderOnConsole() {
+ spockScan(DIR_N, TX_MUD4_042, false);
+}
+
+void Room::mudd4UseSTricorderOnViewscreen() {
+ spockScan(DIR_N, TX_MUD4_050, false);
+}
+
+void Room::mudd4UseMedkit() {
+ showText(TX_SPEAKER_MCCOY, TX_MUD4_043);
+}
+
+void Room::mudd4GetRepairTool() {
+ if (_vm->_awayMission.mudd.tookRepairTool)
+ showText(TX_MUD4N012); // NOTE: unused, since the object disappears, can't be selected again
+ else {
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ walkCrewmanC(OBJECT_KIRK, 0xcb, 0x9e, &Room::mudd4ReachedRepairTool);
+ }
+}
+
+void Room::mudd4ReachedRepairTool() {
+ loadActorAnimC(OBJECT_KIRK, "kuseln", -1, -1, &Room::mudd4PickedUpRepairTool);
+}
+
+void Room::mudd4PickedUpRepairTool() {
+ _vm->_awayMission.disableInput = false;
+ loadActorStandAnim(OBJECT_REPAIR_TOOL);
+ _vm->_awayMission.mudd.tookRepairTool = true;
+ _vm->_awayMission.mudd.missionScore++;
+ giveItem(OBJECT_IDOOVER);
+}
+
+void Room::mudd4LookAtConsole() {
+ showText(TX_MUD4N000);
+}
+
+void Room::mudd4LookAtViewscreen() {
+ if (_vm->_awayMission.mudd.viewScreenEnabled)
+ showText(TX_MUD4N008);
+ else
+ showText(TX_MUD4N013);
+}
+
+void Room::mudd4LookAtKirk() {
+ showText(TX_MUD4N003);
+}
+
+void Room::mudd4LookAtSpock() {
+ showText(TX_MUD4N006);
+}
+
+void Room::mudd4LookAtMccoy() {
+ showText(TX_MUD4N001);
+}
+
+void Room::mudd4LookAtRedshirt() {
+ showText(TX_MUD4N004);
+}
+
+void Room::mudd4LookAtRepairTool() {
+ showText(TX_MUD4N011);
+}
+
+void Room::mudd4TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_MUD4_005);
+}
+
+void Room::mudd4TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_MUD4_063);
+ showText(TX_SPEAKER_KIRK, TX_MUD4_015);
+ showText(TX_SPEAKER_MCCOY, TX_MUD4_047);
+}
+
+void Room::mudd4TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_MUD4_046);
+}
+
+void Room::mudd4TalkToRedshirt() {
+ showText(TX_SPEAKER_BUCHERT, TX_MUD4_076);
+}
+
+void Room::mudd4WalkToEastDoor() {
+ _roomVar.mudd.walkingToDoor = true;
+ _vm->_awayMission.disableInput = true;
+ walkCrewman(OBJECT_KIRK, 0xf0, 0xc7);
+}
+
+void Room::mudd4WalkToWestDoor() {
+ _roomVar.mudd.walkingToDoor = true;
+ _vm->_awayMission.disableInput = true;
+ walkCrewman(OBJECT_KIRK, 0x50, 0xc7);
+}
+
+void Room::mudd4TouchedHotspot0() { // Trigger door sound
+ if (_roomVar.mudd.walkingToDoor)
+ playVoc("SMADOOR3");
}
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index beb18e7..48f8879 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -84,7 +84,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxHasMultipleChoices = false;
_missionToLoad = "MUDD";
- _roomIndexToLoad = 3;
+ _roomIndexToLoad = 4;
for (int i = 0; i < NUM_OBJECTS; i++)
_itemList[i] = g_itemList[i];
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 546a7cf..0ecac51 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -1435,7 +1435,99 @@ enum GameStringIDs {
TX_MUD3C001,
+ TX_MUD4_001,
+ TX_MUD4_002,
+ TX_MUD4_003,
+ TX_MUD4_004,
+ TX_MUD4_005,
+ TX_MUD4_006,
+ TX_MUD4_007,
+ TX_MUD4_008,
+ TX_MUD4_009,
+ TX_MUD4_010,
+ TX_MUD4_011,
+ TX_MUD4_012,
+ TX_MUD4_013,
+ TX_MUD4_014,
+ TX_MUD4_015,
+ TX_MUD4_016,
+ TX_MUD4_017,
TX_MUD4_018,
+ TX_MUD4_019,
+ TX_MUD4_020,
+ TX_MUD4_021,
+ TX_MUD4_022,
+ TX_MUD4_023,
+ TX_MUD4_024,
+ TX_MUD4_025,
+ TX_MUD4_026,
+ TX_MUD4_027,
+ TX_MUD4_028,
+ TX_MUD4_029,
+ TX_MUD4_030,
+ TX_MUD4_031,
+ TX_MUD4_032,
+ TX_MUD4_033,
+ TX_MUD4_034,
+ TX_MUD4_035,
+ TX_MUD4_036,
+ TX_MUD4_037,
+ TX_MUD4_038,
+ TX_MUD4_039,
+ TX_MUD4_040,
+ TX_MUD4_041,
+ TX_MUD4_042,
+ TX_MUD4_043,
+ // UNUSED
+ TX_MUD4_045,
+ TX_MUD4_046,
+ TX_MUD4_047,
+ TX_MUD4_048,
+ TX_MUD4_049,
+ TX_MUD4_050,
+ TX_MUD4_051,
+ TX_MUD4_052,
+ TX_MUD4_053,
+ TX_MUD4_054,
+ TX_MUD4_055,
+ TX_MUD4_056,
+ TX_MUD4_057,
+ TX_MUD4_058,
+ TX_MUD4_059,
+ TX_MUD4_060,
+ TX_MUD4_061,
+ TX_MUD4_062,
+ TX_MUD4_063,
+ TX_MUD4_064,
+ TX_MUD4_065,
+ TX_MUD4_066,
+ TX_MUD4_067,
+ TX_MUD4_068,
+ TX_MUD4_069,
+ TX_MUD4_070,
+ TX_MUD4_071,
+ TX_MUD4_072,
+ TX_MUD4_073,
+ TX_MUD4_074,
+ TX_MUD4_075,
+ TX_MUD4_076,
+ TX_MUD4_A29,
+ TX_MUD4_S02,
+ TX_MUD4_S03,
+ TX_MUD4_S04,
+ TX_MUD4N000,
+ TX_MUD4N001,
+ TX_MUD4N002,
+ TX_MUD4N003,
+ TX_MUD4N004,
+ TX_MUD4N005,
+ TX_MUD4N006,
+ TX_MUD4N007,
+ TX_MUD4N008,
+ TX_MUD4N009,
+ TX_MUD4N011,
+ TX_MUD4N012,
+ TX_MUD4N013,
TX_SIN3_012,
@@ -2668,7 +2760,7 @@ const char * const g_gameStrings[] = {
"#MUD2\\MUD2_006#Harry, when did you become a comedian? ",
"#MUD2\\MUD2_007#I can't think of anything we did that was THAT bad. ",
"#MUD2\\MUD2_008#There's not much I wouldn't do to not have to deal with Mudd. ",
- "#MUD2\\MUD2_009#Kirk to Enterprise...",
+ "#MUD2\\MUD2_009#Kirk to Enterprise ... Kirk to Enterprise.", // TYPO
"#MUD2\\MUD2_010#Sometimes I wish I had become an archeology professor instead of a Starfleet Captain. ",
"#MUD2\\MUD2_011#Sorry if I was bothering you. I was just silently cursing the day I met Harry Mudd. ",
"#MUD2\\MUD2_012#All yours now, Doctor McCoy.",
@@ -2819,7 +2911,98 @@ const char * const g_gameStrings[] = {
"(Raises eyebrow)", // Custom
- "#MUD4\\MUD4_018#Kirk to Enterprise ... Kirk to Enterprise.",
+ "#MUD4\\MUD4_001#Bring us home, Mr. Scott.",
+ "#MUD4\\MUD4_002#<<Communications>>",
+ "#MUD4\\MUD4_003#<<Done>>",
+ "#MUD4\\MUD4_004#I guess the universe looks about like it did the last time we saw it.",
+ "#MUD4\\MUD4_005#I'm speechless, Mr. Spock. Words cannot adequately describe this place. ",
+ "#MUD4\\MUD4_006#Mr. Spock, come take a look at this. This is evidently the main bridge. What do you make of it?",
+ "#MUD4\\MUD4_007#<<View Screen>>",
+ "#MUD4\\MUD4_008#Did you know Stella's still looking for you? What's it worth to you for me not to tell her where to find you, Harry?", // TYPO
+ "#MUD4\\MUD4_009#Don't rush off, Harry. There's still a few things we need to discuss.",
+ "#MUD4\\MUD4_010#Five of each.",
+ "#MUD4\\MUD4_011#Five. Remember, I could confiscate your entire stock as illegal goods. You might get it back through the courts... in a few years.",
+ "#MUD4\\MUD4_012#For free?",
+ "#MUD4\\MUD4_013#Go on, Mr. Spock.",
+ "#MUD4\\MUD4_014#I was sure you wouldn't miss them, Harry. The Patent Authority wants these properly registered and I'm sure you want to do the right thing.",
+ "#MUD4\\MUD4_015#In spite of Harry Mudd... ",
+ "#MUD4\\MUD4_016#In such a hurry? And Stella said she was dropping everything to meet you here.",
+ "#MUD4\\MUD4_017#Just like you were kidding about this ship registered as a worthless derelict. You are going to change that, aren't you? Matter of fact, I think it would be just the thing for you to turn it over lock stock and barrel to the Kornephorous University.",
+ "#MUD4\\MUD4_018#Kirk to Enterprise ... Kirk to Enterprise.", // TYPO: used in MUD4 and LOVE mission; the text was different in LOVE, not matching with audio.
+ "#MUD4\\MUD4_019#Later, Mr. Scott.",
+ "#MUD4\\MUD4_020#New developments, Mr. Scott?",
+ "#MUD4\\MUD4_021#No, Harry, we're going to let you keep them to sell to the Elasi at incredible profits, so they can use them against Federation authorites.",
+ "#MUD4\\MUD4_022#No, I need to have a word with Harry Mudd before we go.",
+ "#MUD4\\MUD4_023#No, I need to have a word with Harry Mudd before we go.",
+ "#MUD4\\MUD4_024#No, we want to look around some more. We'll call you on this channel when we're ready.",
+ "#MUD4\\MUD4_025#Scotty! Report!",
+ "#MUD4\\MUD4_026#Tell me why I shouldn't arrest you on the spot, just on general principles?",
+ "#MUD4\\MUD4_027#The local star seems to be acting up. Will there be a problem with the transporter? I want you to beam up the landing party, and I also want you to lock onto and beam aboard an alien mechanism we came across.",
+ "#MUD4\\MUD4_028#The local star seems to be acting up. Will there be a problem with the transporter?",
+ "#MUD4\\MUD4_029#I would suggest, Captain, we take him up on his offer.",
+ "#MUD4\\MUD4_030#Very well, Harry. You're off scot free... this time. But if you don't upload that data immediately, your measly little scoutship will be experiencing some difficulties maintaining flight capabilities.",
+ "#MUD4\\MUD4_031#What else can you determine at this stage, Mr. Spock?",
+ "#MUD4\\MUD4_032#When we meet, Harry, it always means trouble.",
+ "#MUD4\\MUD4_033#Yes, bring us home, Mr. Scott.",
+ "#MUD4\\MUD4_034#You destroyed the only known records of a lost race. That's a punishable offense.",
+ "#MUD4\\MUD4_035#You have no idea what a great bargain it is, Mudd.",
+ "#MUD4\\MUD4_036#You made a backup?",
+ "#MUD4\\MUD4_037#You were selling high-technology weapons to terrorists and known criminals.",
+ "#MUD4\\MUD4_038#<<Sensors>>",
+ "#MUD4\\MUD4_039#<<Navigation>>",
+ "#MUD4\\MUD4_040#<<Engineering>>",
+ "#MUD4\\MUD4_041#<<Done>>",
+ "#MUD4\\MUD4_042#Evidently the aliens' bridge, their centralized control. A closer look may provide more information.",
+ "#MUD4\\MUD4_043#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#MUD4\\MUD4_045#I can't make anything of these controls.",
+ "#MUD4\\MUD4_046#To boldly go, where no man has gone before... we're here, Jim. ",
+ "#MUD4\\MUD4_047#Speak of the devil, where is that little angel? ",
+ "#MUD4\\MUD4_048#This shouldn't be surprising -- after all, there are two stations.",
+ "#MUD4\\MUD4_049#I think this is the secondary station.",
+ "#MUD4\\MUD4_050#It appears to be a view screen much like the one on board the Enterprise.",
+ "#MUD4\\MUD4_051#It is a multi-bit, compact doover with its own dracktar traction unit and clamp kit.",
+ "#MUD4\\MUD4_052#Thanks to the library computer data, limited though it is, these primary controls give me access to...",
+ "#MUD4\\MUD4_053#The Enterprise is in combat with a number of Elasi pirate ships half a parsec toward the neutron star sector. I read debris identifiable with the pirates, but they continue to harass the Enterprise.",
+ "#MUD4\\MUD4_054#The Enterprise is out of range for this equipment, under the conditions of static created by the neutron star.",
+ "#MUD4\\MUD4_055#The computer reports this ship is incapable of navigating anywhere at all without major repairs. We are definitely dead in space until the Enterprise returns, Captain.",
+ "#MUD4\\MUD4_056#The engine pods are damaged but still generating power, Captain.",
+ "#MUD4\\MUD4_057#This appears to be the primary control panel. Perhaps you would be better equipped to man this station, Captain.",
+ "#MUD4\\MUD4_058#This is the secondary station. With the limited understanding we now have of the library computer data, these controls can now be activated. Available are... ",
+ "#MUD4\\MUD4_059#That may be, Doctor, but if you will recall, all the Enterprise's different stations link into the same computer network bank and...",
+ "#MUD4\\MUD4_060#These people have a fixation for the number six, and even divisors and multiplicands thereof: threes and twelves in particular. I believe this may be the necessary first clue to understanding the aliens.",
+ "#MUD4\\MUD4_061#This is clearly the control center for the ship, Captain. I cannot deduce much information, but I do observe two things.",
+ "#MUD4\\MUD4_062#This station definitely is configured differently from the one beside me.",
+ "#MUD4\\MUD4_063#We have done quite well so far, Captain. ",
+ "#MUD4\\MUD4_064#Because I am going to turn over a selection of samples to the Kornephorous Life Sciences University?",
+ "#MUD4\\MUD4_065#Captain Kirk! I seem to be missing a Miracle De-Grimer! Surely you're not stooping to thievery, are you, Captain?",
+ "#MUD4\\MUD4_066#Captain Kirk! I was hoping to see you. I'm leaving soon and wanted to say thanks for the escort. Ta-ta, and I hope we never have to cross paths again, Captain.",
+ "#MUD4\\MUD4_067#Captain!! Two.",
+ "#MUD4\\MUD4_068#Consider it done. You have my word, Captain. Now I'm going to pick up just a few things. Insignificant things, really! Then I'll be gone. Farewell, Captain! May your path be always trouble-free, until we meet again.",
+ "#MUD4\\MUD4_069#I understand. No problem. Adieu, Captain!",
+ "#MUD4\\MUD4_070#Uh... of course. One of everything I've found here.",
+ "#MUD4\\MUD4_071#Well, Captain, I did manage to take a download of the computer before I accidentally damaged it. If you'll just let me go back to my ship, I can upload it to the Enterprise's computers from there.",
+ "#MUD4\\MUD4_072#What! Where's the profit in that, Captain?",
+ "#MUD4\\MUD4_073#You drive a hard bargain, Captain. It's a deal.",
+ "#MUD4\\MUD4_074#You're. Kidding. Are you kidding, Captain?",
+ "#MUD4\\MUD4_075#I don't believe this is the weapons center, Captain. There appears to be one, but it's evidently located elsewhere on the ship. I can't make anything more of these controls.",
+ "#MUD4\\MUD4_076#This may have been their bridge, but this sure doesn't look like the Enterprise. ",
+ "#MUD4\\MUD4_A29#Very well, bring us home, Mr. Scott.",
+ "#MUD4\\MUD4_S02#The Elasi pirates have been driven off, Captain. We have damage, and injuries among the crew. We just arrived back here a few minutes ago, and we've been trying to raise you on the communicators.",
+ "#MUD4\\MUD4_S03#The neutron star is causing more and more problems, Captain. I would recommend beaming over at your earliest possible convenience.",
+ "#MUD4\\MUD4_S04#We can do it, Captain, no problem. At least right now, but the situation is only going to get worse. Are you ready to beam over now?",
+ "#MUD4\\MUD4N000#A control console from which operators run the ship.",
+ "#MUD4\\MUD4N001#Dr. McCoy is still frowning. ",
+ "#MUD4\\MUD4N002#Dust and grease lifts off the surface, leaving this item clean as new.",
+ "#MUD4\\MUD4N003#James T. Kirk, Captain of the USS Enterprise. ",
+ "#MUD4\\MUD4N004#Lieutenant Buchert looks intensely at these controls, and suppresses a childlike impulse to touch them. ",
+ "#MUD4\\MUD4N005#Life support fails completely and you fall unconscious.",
+ "#MUD4\\MUD4N006#Mr. Spock, Vulcan's finest contribution to Starfleet. ",
+ "#MUD4\\MUD4N007#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
+ "#MUD4\\MUD4N008#The starfield is the same one you saw from the bridge of the Enterprise, with the binary stars swinging majestically past each other.",
+ "#MUD4\\MUD4N009#These two things fit together like they were made for each other.",
+ "#MUD4\\MUD4N011#This appears to be some sort of engineering instrument. ",
+ "#MUD4\\MUD4N012#You already have a doover.",
+ "#MUD4\\MUD4N013#You see a plain grey screen.",
"#SIN3\\SIN3_012#Can't say I like the decor.",
Commit: 296bad07b8dcd8de3fd5316d70cf66ed646fcb42
https://github.com/scummvm/scummvm/commit/296bad07b8dcd8de3fd5316d70cf66ed646fcb42
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Missing null-terminator with animations
Changed paths:
engines/startrek/startrek.cpp
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 48f8879..d829dd9 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -607,9 +607,10 @@ void StarTrekEngine::drawActorToScreen(Actor *actor, const Common::String &_anim
actor->animFile->seek(16, SEEK_SET);
actor->frameToStartNextAnim = actor->animFile->readUint16() + _frameIndex;
- char firstFrameFilename[10];
+ char firstFrameFilename[11];
actor->animFile->seek(0, SEEK_SET);
actor->animFile->read(firstFrameFilename, 10);
+ firstFrameFilename[10] = '\0';
Sprite *sprite = &actor->sprite;
if (addSprite)
Commit: b3c317410232a6b5896237018874f8c5ecc3b5eb
https://github.com/scummvm/scummvm/commit/b3c317410232a6b5896237018874f8c5ecc3b5eb
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: MUDD5
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/mudd0.cpp
engines/startrek/rooms/mudd5.cpp
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 0ba73e8..e11cae9 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -41,7 +41,7 @@ void StarTrekEngine::initAwayMission() {
_roomIndexToLoad = -1;
// Load crew positions for beaming in
- initAwayCrewPositions(2);
+ initAwayCrewPositions(0);
}
void StarTrekEngine::runAwayMission() {
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 7097f44..25a5c1f 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -203,14 +203,17 @@ struct AwayMission {
// True if you've combined the lense + degrimer and fired it off, discovering
// it's a weapon
bool discoveredLenseAndDegrimerFunction; // 0x3c
+
int16 torpedoStatus; // 0x3d
- bool muddCurrentlyInsane; // 0x3f
+ bool muddCurrentlyInsane; // 0x3f (TODO: rename)
bool muddVisitedDatabaseRoom; // 0x40
bool accessedAlienDatabase; // 0x41
bool tookRepairTool; // 0x42
bool gotPointsForDownloadingData; // 0x43
bool contactedEnterpriseFirstTime; // 0x44
bool viewScreenEnabled; // 0x45
+ bool lifeSupportMalfunctioning; // 0x46
+ byte numTimesEnteredRoom5; // 0x47
bool gotMemoryDisk; // 0x48
bool gotLense; // 0x49
bool gotDegrimer; // 0x4a
@@ -224,7 +227,7 @@ struct AwayMission {
bool gotPointsForPressingRedButton; // 0x56
bool gotPointsForEnablingViewscreen; // 0x57
bool enteredRoom1ForFirstTime; // 0x58
- bool field58; // 0x58
+ bool repairedLifeSupportGenerator; // 0x59
int16 missionScore; // 0x5a
} mudd;
};
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 81f9832..849fb50 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1344,6 +1344,38 @@ public:
// MUDD5
void mudd5Tick1();
+ void mudd5Timer1Expired();
+ void mudd5Timer2Expired();
+ void mudd5UseCommunicator();
+ void mudd5UseSTricorderAnywhere();
+ void mudd5UseSTricorderOnEngine();
+ void mudd5UseSTricorderOnCrane();
+ void mudd5UseSTricorderOnHatch();
+ void mudd5UseSTricorderOnLifeSupportGenerator();
+ void mudd5UseStunPhaserOnHatch();
+ void mudd5UseKillPhaserOnHatch();
+ void mudd5UseAnythingOnLifeSupportGenerator();
+ void mudd5UseDooverOnLifeSupportGenerator();
+ void mudd5KirkReachedLifeSupportGenerator();
+ void mudd5KirkTimer4Expired();
+ void mudd5KirkRepairedLifeSupportGenerator();
+ void mudd5KirkTimer3Expired();
+ void mudd5LookAtHatch();
+ void mudd5LookAtLifeSupportGenerator();
+ void mudd5TouchedHotspot0();
+ void mudd5WalkToDoor();
+ void mudd5LookAtKirk();
+ void mudd5LookAtSpock();
+ void mudd5LookAtMccoy();
+ void mudd5LookAtRedshirt();
+ void mudd5LookAtDoor();
+ void mudd5LookAtCrane();
+ void mudd5LookAtEngine();
+ void mudd5TalkToKirk();
+ void mudd5TalkToSpock();
+ void mudd5TalkToMccoy();
+ void mudd5TalkToRedshirt();
+ void mudd5UseMedkit();
// MUDDA
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 2f729b5..a6930ea 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1414,7 +1414,7 @@ RoomAction mudd0ActionList[] = {
{ Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::mudd0UseSTricorderOnDegrimerBox },
{ Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::mudd0UseMTricorderOnLense },
- // TODO: move these to common code
+ // Common code (next 4 lines)
{ Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
{ Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
{ Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
@@ -1459,7 +1459,7 @@ RoomAction mudd1ActionList[] = {
{ Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::mudd1SpockReachedRedButton },
{ Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::mudd1SpockPressedRedButton },
- // Common code
+ // Common code (next 4 lines)
{ Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
{ Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
{ Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
@@ -1517,7 +1517,7 @@ RoomAction mudd2ActionList[] = {
{ Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::mudd2MccoyPickedUpCapsules },
{ Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd2UseCommunicator },
- // Common code
+ // Common code (next 4 lines)
{ Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
{ Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
{ Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
@@ -1585,7 +1585,7 @@ RoomAction mudd3ActionList[] = {
{ Action(ACTION_TIMER_EXPIRED, 4, 0, 0), &Room::mudd3Timer4Expired },
{ Action(ACTION_USE, OBJECT_IDISKS, 0x21, 0), &Room::mudd3UseMemoryDiskOnSphere },
- // Common code
+ // Common code (next 4 lines)
{ Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
{ Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
{ Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
@@ -1655,7 +1655,7 @@ RoomAction mudd4ActionList[] = {
// ENHANCEMENT: Allow scanning the viewscreen when it's on, not just when off
{ Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::mudd4UseSTricorderOnViewscreen },
- // Common code
+ // Common code (next 4 lines)
{ Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
{ Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
{ Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
@@ -1692,6 +1692,45 @@ RoomAction mudd4ActionList[] = {
RoomAction mudd5ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd5Tick1 },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd5Timer1Expired },
+ { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::mudd5Timer2Expired },
+ { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd5UseCommunicator },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::mudd5UseSTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::mudd5UseSTricorderOnEngine },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::mudd5UseSTricorderOnCrane },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::mudd5UseSTricorderOnHatch },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 9, 0), &Room::mudd5UseSTricorderOnLifeSupportGenerator },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 0x20, 0), &Room::mudd5UseStunPhaserOnHatch },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 0x20, 0), &Room::mudd5UseKillPhaserOnHatch },
+ { Action(ACTION_USE, -1, 9, 0), &Room::mudd5UseAnythingOnLifeSupportGenerator },
+ { Action(ACTION_USE, OBJECT_IDOOVER, 9, 0), &Room::mudd5UseDooverOnLifeSupportGenerator },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::mudd5KirkReachedLifeSupportGenerator },
+ { Action(ACTION_TIMER_EXPIRED, 4, 0, 0), &Room::mudd5KirkTimer4Expired },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::mudd5KirkRepairedLifeSupportGenerator },
+ { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::mudd5KirkTimer3Expired },
+
+ // Common code (next 4 lines)
+ { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
+ { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
+ { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
+
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd5LookAtHatch },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::mudd5LookAtLifeSupportGenerator },
+ { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd5TouchedHotspot0 },
+ { Action(ACTION_WALK, 0x22, 0, 0), &Room::mudd5WalkToDoor },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd5LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd5LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd5LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd5LookAtRedshirt },
+ { Action(ACTION_LOOK, 0x22, 0, 0), &Room::mudd5LookAtDoor },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::mudd5LookAtCrane },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::mudd5LookAtEngine },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd5TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd5TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd5TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd5TalkToRedshirt },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd5UseMedkit },
};
}
diff --git a/engines/startrek/rooms/mudd0.cpp b/engines/startrek/rooms/mudd0.cpp
index dbb1c99..c496031 100644
--- a/engines/startrek/rooms/mudd0.cpp
+++ b/engines/startrek/rooms/mudd0.cpp
@@ -166,7 +166,7 @@ void Room::mudd0UseLenseOnDegrimer() {
_vm->_awayMission.mudd.missionScore++;
showText(TX_MUD0N011);
// TODO: Identical (?) audio files: TX_MUD0N011, TX_MUD1N013, TX_MUD2N010, TX_MUD3N016,
- // TX_MUD4009
+ // TX_MUD4009, TX_MUD5N009
}
@@ -177,6 +177,7 @@ void Room::mudd0UseAlienDevice() {
11, // MUDD2
11, // MUDD3
9, // MUDD4
+ 11 // MUDD5
};
_vm->_awayMission.disableInput = true;
@@ -192,7 +193,7 @@ void Room::mudd0FiredAlienDevice() {
_vm->_awayMission.disableInput = false;
if (!_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction) {
_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction = true;
- _vm->_awayMission.mudd.missionScore += 5;
+ _vm->_awayMission.mudd.missionScore += 5; // BUGFIX: didn't happen if done in MUDD5
showText(TX_SPEAKER_KIRK, TX_MUD0_002);
// TODO: Identical (?) audio files: TX_MUD0_002, TX_MUD1_002, TX_MUD2_002
}
@@ -201,7 +202,7 @@ void Room::mudd0FiredAlienDevice() {
void Room::mudd0UseDegrimer() {
// TODO: Identical (?) audio files: TX_MUD0N002, TX_MUD1N004, TX_MUD2N001,
- // TX_MUD3N001, TX_MUD4N002
+ // TX_MUD3N001, TX_MUD4N002, TX_MUD5_001
showText(TX_MUD0N002);
}
diff --git a/engines/startrek/rooms/mudd5.cpp b/engines/startrek/rooms/mudd5.cpp
index 30ddc98..f5b6bf9 100644
--- a/engines/startrek/rooms/mudd5.cpp
+++ b/engines/startrek/rooms/mudd5.cpp
@@ -22,13 +22,236 @@
#include "startrek/room.h"
-#define OBJECT_DOOR1 8
+#define OBJECT_MUDD 8
+#define OBJECT_LIFE_SUPPORT_GENERATOR 9
+#define OBJECT_DOOR 10
+#define OBJECT_ALIENDV 11
-#define HOTSPOT_CONSOLE 0x20
+#define HOTSPOT_HATCH 0x20
+#define HOTSPOT_ENGINE 0x21
+#define HOTSPOT_DOOR 0x22
+#define HOTSPOT_CRANE 0x23
+
+const int16 GENERATOR_X = 0x54;
+const int16 GENERATOR_Y = 0xb0;
namespace StarTrek {
void Room::mudd5Tick1() {
+ playVoc("MUD5LOOP");
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
+ if (_vm->_awayMission.mudd.lifeSupportMalfunctioning) {
+ playMidiMusicTracks(19);
+ loadActorAnim(OBJECT_LIFE_SUPPORT_GENERATOR, "s4epls", GENERATOR_X, GENERATOR_Y);
+ } else {
+ loadActorAnim(OBJECT_LIFE_SUPPORT_GENERATOR, "s4eplo", GENERATOR_X, GENERATOR_Y);
+ _vm->_awayMission.mudd.numTimesEnteredRoom5++;
+ // BUG: this event can become permanently unavailable? (test)
+ if (_vm->_awayMission.mudd.numTimesEnteredRoom5 == 2 && !_vm->_awayMission.mudd.muddCurrentlyInsane && !_vm->_awayMission.mudd.repairedLifeSupportGenerator) {
+ _vm->_awayMission.mudd.muddCurrentlyInsane = true;
+ _vm->_awayMission.mudd.numTimesEnteredRoom5 = 1;
+ _vm->_awayMission.disableInput = 2;
+ playMidiMusicTracks(3);
+ loadActorAnim(OBJECT_MUDD, "s4ephh", 0x0e, 0xa7);
+ _vm->_awayMission.timers[1] = 112;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ }
+ }
+}
+
+void Room::mudd5Timer1Expired() { // Mudd enters room through hatch
+ const int choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_MUD5_006,
+ TX_MUD5_010,
+ TX_BLANK
+ };
+
+ showText(TX_SPEAKER_MUDD, TX_MUD5_034);
+ showText(choices);
+ showText(TX_SPEAKER_MUDD, TX_MUD5_037);
+
+ loadActorAnim2(OBJECT_MUDD, "s4ephc");
+ _vm->_awayMission.timers[2] = 140;
+}
+
+void Room::mudd5Timer2Expired() { // Life-support generator starts acting up
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.mudd.lifeSupportMalfunctioning = true;
+ playMidiMusicTracks(19);
+ loadActorAnim(OBJECT_LIFE_SUPPORT_GENERATOR, "s4epls", GENERATOR_X, GENERATOR_Y);
+}
+
+void Room::mudd5UseCommunicator() {
+ showText(TX_SPEAKER_KIRK, TX_MUD5_003);
+ showText(TX_SPEAKER_UHURA, TX_STATICU1);
+}
+
+void Room::mudd5UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_MUD5_022, false);
+}
+
+void Room::mudd5UseSTricorderOnEngine() {
+ spockScan(DIR_E, TX_MUD5_011, false);
+}
+
+void Room::mudd5UseSTricorderOnCrane() {
+ spockScan(DIR_S, TX_MUD5_023, false);
+}
+
+void Room::mudd5UseSTricorderOnHatch() {
+ spockScan(DIR_W, TX_MUD5_024, false);
+ showText(TX_SPEAKER_KIRK, TX_MUD5_001);
+}
+
+void Room::mudd5UseSTricorderOnLifeSupportGenerator() {
+ if (_vm->_awayMission.mudd.lifeSupportMalfunctioning)
+ spockScan(DIR_W, TX_MUD5_019, false);
+ else
+ spockScan(DIR_W, TX_MUD5_021, false);
+}
+
+void Room::mudd5UseStunPhaserOnHatch() {
+ showText(TX_SPEAKER_SPOCK, TX_MUD5_025);
+ showText(TX_SPEAKER_MCCOY, TX_MUD5_015);
+ showText(TX_SPEAKER_SPOCK, TX_MUD5_030);
+}
+
+void Room::mudd5UseKillPhaserOnHatch() {
+ showText(TX_SPEAKER_BUCHERT, TX_MUD5_039);
+ showText(TX_SPEAKER_SPOCK, TX_MUD5_027);
+}
+
+void Room::mudd5UseAnythingOnLifeSupportGenerator() {
+ showText(TX_SPEAKER_MCCOY, TX_MUD5_014); // BUGFIX: speaker is McCoy, not none
+}
+
+
+void Room::mudd5UseDooverOnLifeSupportGenerator() {
+ if (_vm->_awayMission.mudd.lifeSupportMalfunctioning) {
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ walkCrewmanC(OBJECT_KIRK, 0x57, 0xb4, &Room::mudd5KirkReachedLifeSupportGenerator);
+ } else
+ showText(TX_SPEAKER_MCCOY, TX_MUD5_014); // BUGFIX: speaker is McCoy, not none
+}
+
+void Room::mudd5KirkReachedLifeSupportGenerator() {
+ loadActorAnimC(OBJECT_KIRK, "kuseln", -1, -1, &Room::mudd5KirkRepairedLifeSupportGenerator);
+ _vm->_awayMission.timers[4] = 20;
+}
+
+void Room::mudd5KirkTimer4Expired() {
+ playMidiMusicTracks(-1);
+ loadActorAnim2(OBJECT_LIFE_SUPPORT_GENERATOR, "s4eplo");
+ _vm->_awayMission.mudd.repairedLifeSupportGenerator = true;
+ _vm->_awayMission.mudd.missionScore += 2;
+}
+
+void Room::mudd5KirkRepairedLifeSupportGenerator() {
+ showText(TX_SPEAKER_KIRK, TX_MUD5_007);
+ showText(TX_SPEAKER_SPOCK, TX_MUD5_028);
+
+ _vm->_awayMission.mudd.lifeSupportMalfunctioning = false;
+ _vm->_awayMission.mudd.muddCurrentlyInsane = false;
+ playMidiMusicTracks(3);
+ loadActorAnim(OBJECT_MUDD, "s4ephh", 0x0e, 0xa7);
+ _vm->_awayMission.disableInput = true;
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ loadActorStandAnim(OBJECT_KIRK);
+
+ _vm->_awayMission.timers[3] = 110;
+}
+
+void Room::mudd5KirkTimer3Expired() { // Mudd popped back in after repairing generator
+ showText(TX_SPEAKER_MUDD, TX_MUD5_035);
+ showText(TX_SPEAKER_KIRK, TX_MUD5_005);
+ showText(TX_SPEAKER_MUDD, TX_MUD5_036);
+
+ loadActorAnim2(OBJECT_MUDD, "s4ephc");
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::mudd5LookAtHatch() {
+ showText(TX_MUD5N011);
+ showText(TX_SPEAKER_SPOCK, TX_MUD5_031);
+ showText(TX_SPEAKER_KIRK, TX_MUD5_009);
+}
+
+void Room::mudd5LookAtLifeSupportGenerator() {
+ if (_vm->_awayMission.mudd.lifeSupportMalfunctioning)
+ showText(TX_MUD5N008);
+ else {
+ showText(TX_MUD5N012);
+ showText(TX_SPEAKER_SPOCK, TX_MUD5_026);
+ }
+}
+
+void Room::mudd5TouchedHotspot0() { // Triggers door
+ if (_roomVar.mudd.walkingToDoor) {
+ playVoc("SMADOOR3");
+ loadActorAnim(OBJECT_DOOR, "s4epdo", 0x85, 0x74);
+ }
+}
+
+void Room::mudd5WalkToDoor() {
+ _roomVar.mudd.walkingToDoor = true;
+ _vm->_awayMission.disableInput = true;
+ walkCrewman(OBJECT_KIRK, 0x85, 0x74);
+}
+
+void Room::mudd5LookAtKirk() {
+ showText(TX_MUD5N002);
+}
+
+void Room::mudd5LookAtSpock() {
+ showText(TX_MUD5N005);
+}
+
+void Room::mudd5LookAtMccoy() {
+ showText(TX_MUD5N004);
+}
+
+void Room::mudd5LookAtRedshirt() {
+ showText(TX_MUD5N003);
+}
+
+void Room::mudd5LookAtDoor() {
+ showText(TX_MUD5N010);
+}
+
+void Room::mudd5LookAtCrane() {
+ showText(TX_MUD5N000);
+}
+
+void Room::mudd5LookAtEngine() {
+ showText(TX_MUD5N006);
+}
+
+void Room::mudd5TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_MUD5_002);
+ showText(TX_SPEAKER_SPOCK, TX_MUD5_032);
+}
+
+void Room::mudd5TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_MUD5_033);
+ showText(TX_SPEAKER_MCCOY, TX_MUD5_016);
+}
+
+void Room::mudd5TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_MUD5_017);
+ showText(TX_SPEAKER_KIRK, TX_MUD5_004);
+}
+
+void Room::mudd5TalkToRedshirt() {
+ showText(TX_SPEAKER_BUCHERT, TX_MUD5_040);
+ showText(TX_SPEAKER_MCCOY, TX_MUD5_018);
+}
+
+void Room::mudd5UseMedkit() {
+ showText(TX_SPEAKER_MCCOY, TX_MUD5_012);
}
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index d829dd9..44c7aea 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -84,7 +84,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxHasMultipleChoices = false;
_missionToLoad = "MUDD";
- _roomIndexToLoad = 4;
+ _roomIndexToLoad = 5;
for (int i = 0; i < NUM_OBJECTS; i++)
_itemList[i] = g_itemList[i];
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 0ecac51..4811da9 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -1530,6 +1530,62 @@ enum GameStringIDs {
TX_MUD4N013,
+ TX_MUD5_001,
+ TX_MUD5_002,
+ TX_MUD5_003,
+ TX_MUD5_004,
+ TX_MUD5_005,
+ TX_MUD5_006,
+ TX_MUD5_007,
+ // UNUSED
+ TX_MUD5_009,
+ TX_MUD5_010,
+ TX_MUD5_011,
+ TX_MUD5_012,
+ TX_MUD5_013,
+ TX_MUD5_014,
+ TX_MUD5_015,
+ TX_MUD5_016,
+ TX_MUD5_017,
+ TX_MUD5_018,
+ TX_MUD5_019,
+ TX_MUD5_020,
+ TX_MUD5_021,
+ TX_MUD5_022,
+ TX_MUD5_023,
+ TX_MUD5_024,
+ TX_MUD5_025,
+ TX_MUD5_026,
+ TX_MUD5_027,
+ TX_MUD5_028,
+ // MISSING
+ TX_MUD5_030,
+ TX_MUD5_031,
+ TX_MUD5_032,
+ TX_MUD5_033,
+ TX_MUD5_034,
+ TX_MUD5_035,
+ TX_MUD5_036,
+ TX_MUD5_037,
+ TX_MUD5_038,
+ TX_MUD5_039,
+ TX_MUD5_040,
+ TX_MUD5N000,
+ TX_MUD5N001,
+ TX_MUD5N002,
+ TX_MUD5N003,
+ TX_MUD5N004,
+ TX_MUD5N005,
+ TX_MUD5N006,
+ TX_MUD5N007,
+ TX_MUD5N008,
+ TX_MUD5N009,
+ TX_MUD5N010,
+ TX_MUD5N011,
+ TX_MUD5N012,
+ TX_MUD5N105,
+
+
TX_SIN3_012,
@@ -3005,6 +3061,60 @@ const char * const g_gameStrings[] = {
"#MUD4\\MUD4N013#You see a plain grey screen.",
+ "#MUD5\\MUD5_001#I suspect that's a blessing in disguise, Mr. Spock!",
+ "#MUD5\\MUD5_002#Just think of it, Spock. An advanced civilization, with powerful technology and nearly unlimited knowledge, and yet all of that didn't save them. ",
+ "#MUD5\\MUD5_003#Kirk to Enterprise...",
+ "#MUD5\\MUD5_004#Let's hope there isn't too much for you to do back at the Enterprise. ",
+ "#MUD5\\MUD5_005#Mudd! I oughta...",
+ "#MUD5\\MUD5_006#No, Harry, but I figure it's probably where you'll find your lost marbles.",
+ "#MUD5\\MUD5_007#That was a close one. Too close! If I ever get my hands on that no good Mudd I'll...",
+ "#MUD5\\MUD5_009#Will wonders never cease.",
+ "#MUD5\\MUD5_010#Yes, I've got it but you can't have it.",
+ "#MUD5\\MUD5_011#An unusual matter-anti-matter engine, reminiscent of the designs created by the hoopooin of Seginus IV.",
+ "#MUD5\\MUD5_012#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#MUD5\\MUD5_013#Our lives won't be worth a plugged nickel if we don't get that makeshift life support generator back in working order!",
+ "#MUD5\\MUD5_014#This life support generator is an unreliable model at the best of times. Tinkering with it is a gamble with your life!",
+ "#MUD5\\MUD5_015#Do you really think there's anything on Mudd's ship we need, Captain? I don't.",
+ "#MUD5\\MUD5_016#Spock! Meaningless conversation is one of life's great pleasures. ",
+ "#MUD5\\MUD5_017#Well Jim, as long as we don't strangle Harry Mudd, I can't see very much for me to do on this mission. ",
+ "#MUD5\\MUD5_018#You know, lieutenant, they say if you can't say anything good about a person, you shouldn't say anything at all. In that case, I've got a lot I shouldn't say about Harry Mudd. ",
+ "#MUD5\\MUD5_019#The life support generator is malfunctioning. Repairs must be made soon or the atmosphere will fall below the level required to sustain us, Captain.",
+ "#MUD5\\MUD5_020#The life support system must be repaired soon. Readings indicate the environment is dropping quickly.",
+ "#MUD5\\MUD5_021#This \"Sav-a-Ship\" life support generator has seen a great deal of use. It was never a reliable model, being prone to breakdown without warning. It is, however, properly connected, with warning alarms for temperature, atmosphere, and radiation.",
+ "#MUD5\\MUD5_022#This room appears to have been the alien ship's engine pod. A ship-to-ship access hatch and a temporary life support generator are evidently recent additions.",
+ "#MUD5\\MUD5_023#This seems to be a crane of some sort, Captain. Currently, no power is running to it.",
+ "#MUD5\\MUD5_024#As one would expect, Mr. Mudd has sealed the hatch with his personal code. We cannot enter his ship, Captain.",
+ "#MUD5\\MUD5_025#Captain, the Gomuchi-Grindrod Salvage Hatch is designed to withstand low power phaser blasts. However, I would not trust the integrity of the ship's hull were we to increase phaser power to open this hatch.",
+ "#MUD5\\MUD5_026#Evidently Mr. Mudd was unwilling to pay the price for a reliable salvage model.",
+ "#MUD5\\MUD5_027#I doubt there's anything on Mudd's ship we require, Captain.",
+ "#MUD5\\MUD5_028#I would not suggest we take the time to seek him. This emergency could occur again. I would suggest we hasten our departure.", // TYPO
+ "#MUD5\\MUD5_030#In this case, I agree with the good doctor.",
+ "#MUD5\\MUD5_031#It appears that Harry Mudd managed to emplace this access hatch without significantly damaging the alien ship.",
+ "#MUD5\\MUD5_032#It is a sobering thought, Captain. ",
+ "#MUD5\\MUD5_033#Unlike humans, I do not decrease my efficiency with meaningless dialogue. ",
+ "#MUD5\\MUD5_034#Captain, you wouldn't have seen my Multipurpose Doover anywhere? I need to, uh, fix something.",
+ "#MUD5\\MUD5_035#Oh! Was there a problem?",
+ "#MUD5\\MUD5_036#Sorry, no time to chat. I'm a busy man you know.",
+ "#MUD5\\MUD5_037#You really can be a headache, Captain. Maybe I can find a spare somewhere else. Good lu...I mean goodbye.",
+ "#MUD5\\MUD5_038#Captain, I'm not feeling well. Without life support, we can't remain here much longer.",
+ "#MUD5\\MUD5_039#Captain, I don't think we can open this hatch with phasers, and still depend on the integrity of the ship's hull to hold atmosphere.",
+ "#MUD5\\MUD5_040#When we get back to the Enterprise, you're going to have to tell me everything you know about this Mudd guy. ",
+ "#MUD5\\MUD5N000#A large claw-like device hangs from the ceiling.",
+ "#MUD5\\MUD5N001#Dust and grease lifts off the surface, leaving this item clean as new.",
+ "#MUD5\\MUD5N002#James T. Kirk. Exploring the unknown is one of the few pleasures that the burden of command allows him. ",
+ "#MUD5\\MUD5N003#Lieutenant Buchert watches and says nothing. He's the strong, silent type. ",
+ "#MUD5\\MUD5N004#McCoy glances back and forth, looking for a sign of Harry Mudd. ",
+ "#MUD5\\MUD5N005#Spock continues to examine the equipment with a scientist's eye. ",
+ "#MUD5\\MUD5N006#Tall, transparent columns run through the ceiling. Energy crackles in between the duo-decahedrons inside them.",
+ "#MUD5\\MUD5N007#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
+ "#MUD5\\MUD5N008#There seems to be something wrong with the life support generator.",
+ "#MUD5\\MUD5N009#These two things fit together like they were made for each other.",
+ "#MUD5\\MUD5N010#This door leads back to the main cargo bay.",
+ "#MUD5\\MUD5N011#A salvage lock hatch, a common type used to link a derelict to the ship doing the salvaging.",
+ "#MUD5\\MUD5N012#A \"Sav-a-Ship\" emergency life support generator, generally used for temporary life support during evacuation of small damaged ships.",
+ "#MUD5\\MUD5N105#Life support fails completely and you fall unconscious.",
+
+
"#SIN3\\SIN3_012#Can't say I like the decor.",
Commit: f85c296dc37ca257c4c605b27e3c886542bf57ab
https://github.com/scummvm/scummvm/commit/f85c296dc37ca257c4c605b27e3c886542bf57ab
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Move common MUDD functions to mudda.cpp
Changed paths:
A engines/startrek/rooms/mudda.cpp
engines/startrek/module.mk
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/mudd0.cpp
engines/startrek/rooms/mudd5.cpp
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 4271aef..460e110 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -43,6 +43,7 @@ MODULE_OBJS = \
rooms/mudd3.o \
rooms/mudd4.o \
rooms/mudd5.o \
+ rooms/mudda.o \
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 849fb50..f791728 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1138,10 +1138,6 @@ public:
void mudd0UseSTricorderOnMemoryDiskBox();
void mudd0UseSTricorderOnDegrimerBox();
void mudd0UseMTricorderOnLense();
- void mudd0UseLenseOnDegrimer();
- void mudd0UseAlienDevice();
- void mudd0FiredAlienDevice();
- void mudd0UseDegrimer();
void mudd0GetLense();
void mudd0GetMemoryDisk();
void mudd0GetDegrimer();
@@ -1378,6 +1374,10 @@ public:
void mudd5UseMedkit();
// MUDDA
+ void muddaUseLenseOnDegrimer();
+ void muddaUseAlienDevice();
+ void muddaFiredAlienDevice();
+ void muddaUseDegrimer();
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index a6930ea..456767f 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1415,10 +1415,10 @@ RoomAction mudd0ActionList[] = {
{ Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::mudd0UseMTricorderOnLense },
// Common code (next 4 lines)
- { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
- { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
- { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
- { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
+ { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::muddaUseLenseOnDegrimer },
+ { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::muddaUseAlienDevice },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::muddaFiredAlienDevice },
+ { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::muddaUseDegrimer },
{ Action(ACTION_GET, 0x21, 0, 0), &Room::mudd0GetLense },
{ Action(ACTION_GET, 0x20, 0, 0), &Room::mudd0GetMemoryDisk },
@@ -1460,10 +1460,10 @@ RoomAction mudd1ActionList[] = {
{ Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::mudd1SpockPressedRedButton },
// Common code (next 4 lines)
- { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
- { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
- { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
- { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
+ { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::muddaUseDegrimer },
+ { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::muddaUseLenseOnDegrimer },
+ { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::muddaUseAlienDevice },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::muddaFiredAlienDevice },
{ Action(ACTION_GET, 9, 0, 0), &Room::mudd1GetTorpedo },
{ Action(ACTION_GET, 0x21, 0, 0), &Room::mudd1GetTorpedo },
@@ -1518,10 +1518,10 @@ RoomAction mudd2ActionList[] = {
{ Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd2UseCommunicator },
// Common code (next 4 lines)
- { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
- { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
- { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
- { Action(ACTION_FINISHED_ANIMATION, 18, 0, 0), &Room::mudd0FiredAlienDevice },
+ { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::muddaUseDegrimer },
+ { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::muddaUseLenseOnDegrimer },
+ { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::muddaUseAlienDevice },
+ { Action(ACTION_FINISHED_ANIMATION, 18, 0, 0), &Room::muddaFiredAlienDevice },
{ Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd2LookAtCapsules },
{ Action(ACTION_USE, OBJECT_IMTRICOR, 0x20, 0), &Room::mudd2UseMTricorderOnCapsules },
@@ -1586,10 +1586,10 @@ RoomAction mudd3ActionList[] = {
{ Action(ACTION_USE, OBJECT_IDISKS, 0x21, 0), &Room::mudd3UseMemoryDiskOnSphere },
// Common code (next 4 lines)
- { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
- { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
- { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
- { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
+ { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::muddaUseDegrimer },
+ { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::muddaUseLenseOnDegrimer },
+ { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::muddaUseAlienDevice },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::muddaFiredAlienDevice },
{ Action(ACTION_GET, 13, 0, 0), &Room::mudd3GetRepairTool },
{ Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::mudd3ReachedRepairTool },
@@ -1656,10 +1656,10 @@ RoomAction mudd4ActionList[] = {
{ Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::mudd4UseSTricorderOnViewscreen },
// Common code (next 4 lines)
- { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
- { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
- { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
- { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
+ { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::muddaUseLenseOnDegrimer },
+ { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::muddaUseAlienDevice },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::muddaFiredAlienDevice },
+ { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::muddaUseDegrimer },
{ Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd4UseMedkit },
{ Action(ACTION_GET, 10, 0, 0), &Room::mudd4GetRepairTool },
@@ -1710,10 +1710,10 @@ RoomAction mudd5ActionList[] = {
{ Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::mudd5KirkTimer3Expired },
// Common code (next 4 lines)
- { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
- { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
- { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
- { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
+ { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::muddaUseLenseOnDegrimer },
+ { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::muddaUseAlienDevice },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::muddaFiredAlienDevice },
+ { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::muddaUseDegrimer },
{ Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd5LookAtHatch },
{ Action(ACTION_LOOK, 9, 0, 0), &Room::mudd5LookAtLifeSupportGenerator },
diff --git a/engines/startrek/rooms/mudd0.cpp b/engines/startrek/rooms/mudd0.cpp
index c496031..3506ed8 100644
--- a/engines/startrek/rooms/mudd0.cpp
+++ b/engines/startrek/rooms/mudd0.cpp
@@ -158,55 +158,6 @@ void Room::mudd0UseMTricorderOnLense() {
mccoyScan(DIR_E, TX_MUD0_013, true);
}
-void Room::mudd0UseLenseOnDegrimer() {
- giveItem(OBJECT_IALIENDV);
- loseItem(OBJECT_IDEGRIME);
- loseItem(OBJECT_ILENSES);
-
- _vm->_awayMission.mudd.missionScore++;
- showText(TX_MUD0N011);
- // TODO: Identical (?) audio files: TX_MUD0N011, TX_MUD1N013, TX_MUD2N010, TX_MUD3N016,
- // TX_MUD4009, TX_MUD5N009
-}
-
-
-void Room::mudd0UseAlienDevice() {
- const int deviceObjectIndices[] = {
- 9, // MUDD0
- 13, // MUDD1
- 11, // MUDD2
- 11, // MUDD3
- 9, // MUDD4
- 11 // MUDD5
- };
-
- _vm->_awayMission.disableInput = true;
-
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
- loadActorStandAnim(OBJECT_KIRK);
- Common::Point pos = getActorPos(OBJECT_KIRK);
- loadActorAnimC(deviceObjectIndices[_roomIndex], "s4cbxp", pos.x, 10, &Room::mudd0FiredAlienDevice);
- playVoc("EXPLO3");
-}
-
-void Room::mudd0FiredAlienDevice() {
- _vm->_awayMission.disableInput = false;
- if (!_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction) {
- _vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction = true;
- _vm->_awayMission.mudd.missionScore += 5; // BUGFIX: didn't happen if done in MUDD5
- showText(TX_SPEAKER_KIRK, TX_MUD0_002);
- // TODO: Identical (?) audio files: TX_MUD0_002, TX_MUD1_002, TX_MUD2_002
- }
-}
-
-
-void Room::mudd0UseDegrimer() {
- // TODO: Identical (?) audio files: TX_MUD0N002, TX_MUD1N004, TX_MUD2N001,
- // TX_MUD3N001, TX_MUD4N002, TX_MUD5_001
- showText(TX_MUD0N002);
-}
-
-
void Room::mudd0GetLense() {
if (_vm->_awayMission.mudd.gotLense)
showText(TX_MUD0N016);
diff --git a/engines/startrek/rooms/mudd5.cpp b/engines/startrek/rooms/mudd5.cpp
index f5b6bf9..c8e7500 100644
--- a/engines/startrek/rooms/mudd5.cpp
+++ b/engines/startrek/rooms/mudd5.cpp
@@ -61,7 +61,7 @@ void Room::mudd5Tick1() {
}
void Room::mudd5Timer1Expired() { // Mudd enters room through hatch
- const int choices[] = {
+ const TextRef choices[] = {
TX_SPEAKER_KIRK,
TX_MUD5_006,
TX_MUD5_010,
diff --git a/engines/startrek/rooms/mudda.cpp b/engines/startrek/rooms/mudda.cpp
new file mode 100644
index 0000000..ed2a488
--- /dev/null
+++ b/engines/startrek/rooms/mudda.cpp
@@ -0,0 +1,110 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+// The functions here used to be independently implemented in each room of the MUDD
+// mission, despite being mostly the same.
+
+void Room::muddaUseLenseOnDegrimer() {
+ assert(_roomIndex >= 0 && _roomIndex <= 5);
+
+ const TextRef text[] = {
+ TX_MUD0N011, // All of these audio files are identical, but there's one for each room.
+ TX_MUD1N013,
+ TX_MUD2N010,
+ TX_MUD3N016,
+ TX_MUD4N009,
+ TX_MUD5N009,
+ };
+
+ giveItem(OBJECT_IALIENDV);
+ loseItem(OBJECT_IDEGRIME);
+ loseItem(OBJECT_ILENSES);
+
+ _vm->_awayMission.mudd.missionScore++;
+ showText(text[_roomIndex]);
+ // TODO: Identical (?) audio files: TX_MUD0N011, TX_MUD1N013, TX_MUD2N010, TX_MUD3N016,
+ // TX_MUD4009, TX_MUD5N009
+}
+
+
+void Room::muddaUseAlienDevice() {
+ assert(_roomIndex >= 0 && _roomIndex <= 5);
+
+ const int deviceObjectIndices[] = { // Each room's object index for the explosion is different
+ 9, // MUDD0
+ 13, // MUDD1
+ 11, // MUDD2
+ 11, // MUDD3
+ 9, // MUDD4
+ 11 // MUDD5
+ };
+
+ _vm->_awayMission.disableInput = true;
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ loadActorStandAnim(OBJECT_KIRK);
+ Common::Point pos = getActorPos(OBJECT_KIRK);
+ loadActorAnimC(deviceObjectIndices[_roomIndex], "s4cbxp", pos.x, 10, &Room::muddaFiredAlienDevice);
+ playVoc("EXPLO3");
+}
+
+void Room::muddaFiredAlienDevice() {
+ assert(_roomIndex >= 0 && _roomIndex <= 5);
+
+ const TextRef text[] = {
+ TX_MUD0_002, // These audio files aren't identical, but the text is mostly the same.
+ TX_MUD1_002,
+ TX_MUD2_002,
+ TX_MUD2_002, // Rooms 3-5 reuse MUD2
+ TX_MUD2_002,
+ TX_MUD2_002,
+ };
+
+ _vm->_awayMission.disableInput = false;
+ if (!_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction) {
+ _vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction = true;
+ _vm->_awayMission.mudd.missionScore += 5; // BUGFIX: didn't happen if done in MUDD5
+ showText(TX_SPEAKER_KIRK, text[_roomIndex]);
+ }
+}
+
+
+void Room::muddaUseDegrimer() {
+ assert(_roomIndex >= 0 && _roomIndex <= 5);
+
+ const TextRef text[] = {
+ TX_MUD0N002, // All of these audio files are identical, but there's one for each room.
+ TX_MUD1N004,
+ TX_MUD2N001,
+ TX_MUD3N001,
+ TX_MUD4N002,
+ TX_MUD5N001,
+ };
+
+ showText(text[_roomIndex]);
+}
+
+}
Commit: 933ab32b0e42a4c4a30901ea5605ef3e0096c2be
https://github.com/scummvm/scummvm/commit/933ab32b0e42a4c4a30901ea5605ef3e0096c2be
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Start on MUDD's life-support-loss code
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/mudd5.cpp
engines/startrek/rooms/mudda.cpp
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index e11cae9..3c007e6 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -635,6 +635,10 @@ void StarTrekEngine::handleAwayMissionAction() {
initAwayCrewPositions(warpIndex ^ 1);
}
break;
+
+ default:
+ _room->handleActionWithBitmask(action);
+ break;
}
}
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 25a5c1f..788727d 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -221,7 +221,8 @@ struct AwayMission {
bool muddUnconscious; // 0x4d
byte muddState; // 0x4e
bool muddInhaledGas; // 0x4f
-
+ int16 lifeSupportTimer; // 0x50
+ bool startedLifeSupportTimer; // 0x52
bool enteredRoom0ForFirstTime; // 0x54
bool gotPointsForLoadingTorpedo; // 0x55
bool gotPointsForPressingRedButton; // 0x56
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index b727c2d..6237cdd 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -475,9 +475,9 @@ void Room::endMission(int16 score, int16 arg1, int16 arg2) {
// TODO: game mode switch
}
-void Room::showGameOverMenu() {
+void Room::showGameOverMenu() { // TODO: takes an optional parameter?
_vm->showGameOverMenu();
- // TODO: shouldn't do this within a room
+ // TODO: finish. Shouldn't do this within a room due to deletion of current room?
}
void Room::playVoc(Common::String filename) {
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index f791728..22483df 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1378,6 +1378,11 @@ public:
void muddaUseAlienDevice();
void muddaFiredAlienDevice();
void muddaUseDegrimer();
+ void muddaTick();
+ void muddaKirkReachedDeathPosition();
+ void muddaSpockReachedDeathPosition();
+ void muddaMccoyReachedDeathPosition();
+ void muddaRedshirtReachedDeathPosition();
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 456767f..8c1a887 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1731,6 +1731,13 @@ RoomAction mudd5ActionList[] = {
{ Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd5TalkToMccoy },
{ Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd5TalkToRedshirt },
{ Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd5UseMedkit },
+
+ // Common code (countdown for losing atmosphere when life support malfunctioning)
+ { Action(ACTION_TICK, -1, -1, -1), &Room::muddaTick },
+ { Action(ACTION_FINISHED_WALKING, 9, 0, 0), &Room::muddaKirkReachedDeathPosition },
+ { Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::muddaSpockReachedDeathPosition },
+ { Action(ACTION_FINISHED_WALKING, 11, 0, 0), &Room::muddaMccoyReachedDeathPosition },
+ { Action(ACTION_FINISHED_WALKING, 12, 0, 0), &Room::muddaRedshirtReachedDeathPosition },
};
}
diff --git a/engines/startrek/rooms/mudd5.cpp b/engines/startrek/rooms/mudd5.cpp
index c8e7500..4a1d3d1 100644
--- a/engines/startrek/rooms/mudd5.cpp
+++ b/engines/startrek/rooms/mudd5.cpp
@@ -48,7 +48,7 @@ void Room::mudd5Tick1() {
loadActorAnim(OBJECT_LIFE_SUPPORT_GENERATOR, "s4eplo", GENERATOR_X, GENERATOR_Y);
_vm->_awayMission.mudd.numTimesEnteredRoom5++;
// BUG: this event can become permanently unavailable? (test)
- if (_vm->_awayMission.mudd.numTimesEnteredRoom5 == 2 && !_vm->_awayMission.mudd.muddCurrentlyInsane && !_vm->_awayMission.mudd.repairedLifeSupportGenerator) {
+ if (true || _vm->_awayMission.mudd.numTimesEnteredRoom5 == 2 && !_vm->_awayMission.mudd.muddCurrentlyInsane && !_vm->_awayMission.mudd.repairedLifeSupportGenerator) { // FIXME
_vm->_awayMission.mudd.muddCurrentlyInsane = true;
_vm->_awayMission.mudd.numTimesEnteredRoom5 = 1;
_vm->_awayMission.disableInput = 2;
diff --git a/engines/startrek/rooms/mudda.cpp b/engines/startrek/rooms/mudda.cpp
index ed2a488..2f1834a 100644
--- a/engines/startrek/rooms/mudda.cpp
+++ b/engines/startrek/rooms/mudda.cpp
@@ -107,4 +107,69 @@ void Room::muddaUseDegrimer() {
showText(text[_roomIndex]);
}
+void Room::muddaTick() {
+ assert(_roomIndex >= 0 && _roomIndex <= 5);
+
+ const Common::Point deathPositions[][4] = {
+ { Common::Point(0xbb, 0x8d), Common::Point(0xd0, 0x89), Common::Point(0xaa, 0x85), Common::Point(0xbf, 0x83) },
+ { Common::Point(-1, -1), Common::Point(-1, -1), Common::Point(-1, -1), Common::Point(-1, -1) },
+ { Common::Point(-1, -1), Common::Point(-1, -1), Common::Point(-1, -1), Common::Point(-1, -1) },
+ { Common::Point(-1, -1), Common::Point(-1, -1), Common::Point(-1, -1), Common::Point(-1, -1) },
+ { Common::Point(-1, -1), Common::Point(-1, -1), Common::Point(-1, -1), Common::Point(-1, -1) },
+ { Common::Point(0x8b, 0xac), Common::Point(0x6f, 0x99), Common::Point(-1, -1), Common::Point(-1, -1) },
+ };
+
+ const TextRef deathText[] = {
+ TX_MUD0N006, 0, 0, 0, TX_MUD5N105
+ };
+
+ // This is implemented somewhat differently in each room.
+ // MUDD0:
+
+ //const int TIMER_LENGTH = 27000;
+ const int TIMER_LENGTH = 60; // FIXME
+
+ if (_vm->_awayMission.mudd.lifeSupportMalfunctioning) {
+ if (!_vm->_awayMission.mudd.startedLifeSupportTimer) {
+ _vm->_awayMission.mudd.startedLifeSupportTimer = true;
+ _vm->_awayMission.mudd.lifeSupportTimer = TIMER_LENGTH;
+ }
+ _vm->_awayMission.mudd.lifeSupportTimer--;
+
+ if (_vm->_awayMission.mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.25)) {
+ showText(TX_SPEAKER_SPOCK, TX_MUD0_018);
+ } else if (_vm->_awayMission.mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.5)) {
+ showText(TX_SPEAKER_SPOCK, TX_MUD0_019);
+ } else if (_vm->_awayMission.mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.75)) {
+ showText(TX_SPEAKER_SPOCK, TX_MUD0_020);
+ } else if (_vm->_awayMission.mudd.lifeSupportTimer == 1) {
+ _vm->_awayMission.disableInput = true;
+ for (int i = OBJECT_KIRK; i <= OBJECT_REDSHIRT; i++) {
+ if (deathPositions[_roomIndex][i].x != -1)
+ walkCrewman(i, deathPositions[_roomIndex][i].x, deathPositions[_roomIndex][i].y, 9 + i);
+ }
+ showText(deathText[_roomIndex]);
+ showGameOverMenu();
+ }
+ }
+}
+
+void Room::muddaKirkReachedDeathPosition() {
+ loadActorAnim2(OBJECT_KIRK, "kgetdw");
+}
+
+void Room::muddaSpockReachedDeathPosition() {
+ loadActorAnim2(OBJECT_SPOCK, "sgetds");
+}
+
+void Room::muddaMccoyReachedDeathPosition() {
+ loadActorAnim2(OBJECT_MCCOY, "sgetdn");
+}
+
+void Room::muddaRedshirtReachedDeathPosition() {
+ loadActorAnim2(OBJECT_REDSHIRT, "rgetde");
+ // NOTE: there's code to check if he's the last one down... not really implemented
+ // properly
+}
+
}
Commit: bfb312a3196c6a46c5048599ea3000608f5d01ce
https://github.com/scummvm/scummvm/commit/bfb312a3196c6a46c5048599ea3000608f5d01ce
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Done with atmosphere loss event
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/mudd0.cpp
engines/startrek/rooms/mudd5.cpp
engines/startrek/rooms/mudda.cpp
engines/startrek/startrek.cpp
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 3c007e6..daf2895 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -41,7 +41,7 @@ void StarTrekEngine::initAwayMission() {
_roomIndexToLoad = -1;
// Load crew positions for beaming in
- initAwayCrewPositions(0);
+ initAwayCrewPositions(4);
}
void StarTrekEngine::runAwayMission() {
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 22483df..d51442e 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1379,10 +1379,6 @@ public:
void muddaFiredAlienDevice();
void muddaUseDegrimer();
void muddaTick();
- void muddaKirkReachedDeathPosition();
- void muddaSpockReachedDeathPosition();
- void muddaMccoyReachedDeathPosition();
- void muddaRedshirtReachedDeathPosition();
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 8c1a887..e529f8b 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1393,6 +1393,9 @@ RoomAction love5ActionList[] = {
{ Action(ACTION_USE, OBJECT_IN2O, -1, 0), &Room::loveaUseHumanLaughingGas },
{ Action(ACTION_USE, OBJECT_INH3, -1, 0), &Room::loveaUseAmmonia },
{ Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::loveaUseCommunicator },
+
+ // Common code (countdown for losing atmosphere when life support malfunctioning)
+ { Action(ACTION_TICK, -1, -1, -1), &Room::muddaTick },
};
RoomAction mudd0ActionList[] = {
@@ -1440,7 +1443,9 @@ RoomAction mudd0ActionList[] = {
{ Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd0TalkToMccoy },
{ Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd0TalkToRedshirt },
{ Action(ACTION_TALK, 8, 0, 0), &Room::mudd0TalkToMudd },
- // TODO: remainder? something about losing atmosphere?
+
+ // Common code (countdown for losing atmosphere when life support malfunctioning)
+ { Action(ACTION_TICK, -1, -1, -1), &Room::muddaTick },
};
RoomAction mudd1ActionList[] = {
@@ -1500,7 +1505,9 @@ RoomAction mudd1ActionList[] = {
{ Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::mudd1TouchedHotspot1 },
{ Action(ACTION_WALK, 0x26, 0, 0), &Room::mudd1WalkToWestDoor },
{ Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd1TouchedHotspot0 },
- // TODO: remainder? something about losing atmosphere?
+
+ // Common code (countdown for losing atmosphere when life support malfunctioning)
+ { Action(ACTION_TICK, -1, -1, -1), &Room::muddaTick },
};
RoomAction mudd2ActionList[] = {
@@ -1564,7 +1571,9 @@ RoomAction mudd2ActionList[] = {
{ Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd2TalkToMccoy },
{ Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd2TalkToRedshirt },
{ Action(ACTION_TALK, 8, 0, 0), &Room::mudd2TalkToMudd },
- // TODO: remainder? something about losing atmosphere?
+
+ // Common code (countdown for losing atmosphere when life support malfunctioning)
+ { Action(ACTION_TICK, -1, -1, -1), &Room::muddaTick },
};
RoomAction mudd3ActionList[] = {
@@ -1610,7 +1619,9 @@ RoomAction mudd3ActionList[] = {
{ Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd3TalkToRedshirt },
{ Action(ACTION_TALK, 8, 0, 0), &Room::mudd3TalkToMudd },
{ Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd3UseMedkit },
- // TODO: remainder? something about losing atmosphere?
+
+ // Common code (countdown for losing atmosphere when life support malfunctioning)
+ { Action(ACTION_TICK, -1, -1, -1), &Room::muddaTick },
};
RoomAction mudd4ActionList[] = {
@@ -1687,7 +1698,9 @@ RoomAction mudd4ActionList[] = {
{ Action(ACTION_WALK, 0x24, 0, 0), &Room::mudd4WalkToEastDoor },
{ Action(ACTION_WALK, 0x25, 0, 0), &Room::mudd4WalkToWestDoor },
{ Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd4TouchedHotspot0 },
- // TODO: remainder? something about losing atmosphere?
+
+ // Common code (countdown for losing atmosphere when life support malfunctioning)
+ { Action(ACTION_TICK, -1, -1, -1), &Room::muddaTick },
};
RoomAction mudd5ActionList[] = {
@@ -1734,10 +1747,6 @@ RoomAction mudd5ActionList[] = {
// Common code (countdown for losing atmosphere when life support malfunctioning)
{ Action(ACTION_TICK, -1, -1, -1), &Room::muddaTick },
- { Action(ACTION_FINISHED_WALKING, 9, 0, 0), &Room::muddaKirkReachedDeathPosition },
- { Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::muddaSpockReachedDeathPosition },
- { Action(ACTION_FINISHED_WALKING, 11, 0, 0), &Room::muddaMccoyReachedDeathPosition },
- { Action(ACTION_FINISHED_WALKING, 12, 0, 0), &Room::muddaRedshirtReachedDeathPosition },
};
}
diff --git a/engines/startrek/rooms/mudd0.cpp b/engines/startrek/rooms/mudd0.cpp
index 3506ed8..bb26440 100644
--- a/engines/startrek/rooms/mudd0.cpp
+++ b/engines/startrek/rooms/mudd0.cpp
@@ -41,7 +41,11 @@ namespace StarTrek {
void Room::mudd0Tick1() {
playVoc("MUD0LOOP");
- _vm->_awayMission.disableInput = 2;
+ // ENHANCEMENT: Only disable input when Mudd showing Mudd cutscene (avoids a long,
+ // pointless delay when entering the room otherwise)
+ if (!_vm->_awayMission.mudd.enteredRoom0ForFirstTime)
+ _vm->_awayMission.disableInput = 2;
+
loadActorAnim(OBJECT_MUDD, "s4cbhr", 0xa2, 0xa9, 0);
// Floppy version's code.
@@ -63,9 +67,10 @@ void Room::mudd0Tick50() {
}
void Room::mudd0Tick60() {
- _vm->_awayMission.disableInput = false;
-
if (_vm->_awayMission.mudd.field29 == 0) {
+ // ENHANCEMENT: Move this into if statement (related to above enhancement)
+ _vm->_awayMission.disableInput = false;
+
_vm->_awayMission.mudd.field29++;
showText(TX_SPEAKER_MUDD, TX_MUD0_037);
diff --git a/engines/startrek/rooms/mudd5.cpp b/engines/startrek/rooms/mudd5.cpp
index 4a1d3d1..c8e7500 100644
--- a/engines/startrek/rooms/mudd5.cpp
+++ b/engines/startrek/rooms/mudd5.cpp
@@ -48,7 +48,7 @@ void Room::mudd5Tick1() {
loadActorAnim(OBJECT_LIFE_SUPPORT_GENERATOR, "s4eplo", GENERATOR_X, GENERATOR_Y);
_vm->_awayMission.mudd.numTimesEnteredRoom5++;
// BUG: this event can become permanently unavailable? (test)
- if (true || _vm->_awayMission.mudd.numTimesEnteredRoom5 == 2 && !_vm->_awayMission.mudd.muddCurrentlyInsane && !_vm->_awayMission.mudd.repairedLifeSupportGenerator) { // FIXME
+ if (_vm->_awayMission.mudd.numTimesEnteredRoom5 == 2 && !_vm->_awayMission.mudd.muddCurrentlyInsane && !_vm->_awayMission.mudd.repairedLifeSupportGenerator) {
_vm->_awayMission.mudd.muddCurrentlyInsane = true;
_vm->_awayMission.mudd.numTimesEnteredRoom5 = 1;
_vm->_awayMission.disableInput = 2;
diff --git a/engines/startrek/rooms/mudda.cpp b/engines/startrek/rooms/mudda.cpp
index 2f1834a..03f71f9 100644
--- a/engines/startrek/rooms/mudda.cpp
+++ b/engines/startrek/rooms/mudda.cpp
@@ -45,8 +45,6 @@ void Room::muddaUseLenseOnDegrimer() {
_vm->_awayMission.mudd.missionScore++;
showText(text[_roomIndex]);
- // TODO: Identical (?) audio files: TX_MUD0N011, TX_MUD1N013, TX_MUD2N010, TX_MUD3N016,
- // TX_MUD4009, TX_MUD5N009
}
@@ -108,26 +106,40 @@ void Room::muddaUseDegrimer() {
}
void Room::muddaTick() {
+ // This function deals with the atmosphere running out when the life support generator
+ // is malfunctioning.
+ // NOTE: This has been changed a bit; in the original, they would just walk to
+ // a position and stay standing, though the code indicates they were supposed to
+ // collapse after walking.
+ // To simplify things, and since it makes more sense, now they'll just collapse on the
+ // spot instead.
+
assert(_roomIndex >= 0 && _roomIndex <= 5);
+ /*
+ // Unused: The positions to they originally walked to before collapsing.
const Common::Point deathPositions[][4] = {
{ Common::Point(0xbb, 0x8d), Common::Point(0xd0, 0x89), Common::Point(0xaa, 0x85), Common::Point(0xbf, 0x83) },
- { Common::Point(-1, -1), Common::Point(-1, -1), Common::Point(-1, -1), Common::Point(-1, -1) },
- { Common::Point(-1, -1), Common::Point(-1, -1), Common::Point(-1, -1), Common::Point(-1, -1) },
- { Common::Point(-1, -1), Common::Point(-1, -1), Common::Point(-1, -1), Common::Point(-1, -1) },
- { Common::Point(-1, -1), Common::Point(-1, -1), Common::Point(-1, -1), Common::Point(-1, -1) },
+ { Common::Point(0xaa, 0xa5), Common::Point(0x83, 0xac), Common::Point(-1, -1), Common::Point(-1, -1) },
+ { Common::Point(0x108, 0xbb), Common::Point(0x118, 0xc4), Common::Point(0xfe, 0xb2), Common::Point(0x117, 0xae) },
+ { Common::Point(0xf1, 0x95), Common::Point(0xcd, 0x87), Common::Point(0xec, 0x84), Common::Point(0x110, 0xa6) },
+ { Common::Point(0x8b, 0xb6), Common::Point(0x69, 0xb7), Common::Point(-1, -1), Common::Point(-1, -1) },
{ Common::Point(0x8b, 0xac), Common::Point(0x6f, 0x99), Common::Point(-1, -1), Common::Point(-1, -1) },
};
+ */
- const TextRef deathText[] = {
- TX_MUD0N006, 0, 0, 0, TX_MUD5N105
+ const TextRef deathText[] = { // All of these audio files are identical, but there's one for each room.
+ TX_MUD0N006, TX_MUD1N007, TX_MUD2N005, TX_MUD3N008, TX_MUD4N005, TX_MUD5N105
};
- // This is implemented somewhat differently in each room.
- // MUDD0:
+ // UNUSED: something similar to "deathText" which would also fit in this situation.
+ /*
+ const TextRef deathText2[] = { // All of these audio files are identical, but there's one for each room.
+ TX_MUD0N009, TX_MUD1N010, TX_MUD2N009, TX_MUD3N013, TX_MUD4N007, TX_MUD5N007
+ };
+ */
- //const int TIMER_LENGTH = 27000;
- const int TIMER_LENGTH = 60; // FIXME
+ const int TIMER_LENGTH = 27000;
if (_vm->_awayMission.mudd.lifeSupportMalfunctioning) {
if (!_vm->_awayMission.mudd.startedLifeSupportTimer) {
@@ -136,17 +148,32 @@ void Room::muddaTick() {
}
_vm->_awayMission.mudd.lifeSupportTimer--;
- if (_vm->_awayMission.mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.25)) {
+ // BUGFIX: the warnings at 75%, 50%, and 25% were only voiced in MUDD0.
+ if (_vm->_awayMission.mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.25))
showText(TX_SPEAKER_SPOCK, TX_MUD0_018);
- } else if (_vm->_awayMission.mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.5)) {
+ else if (_vm->_awayMission.mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.5))
showText(TX_SPEAKER_SPOCK, TX_MUD0_019);
- } else if (_vm->_awayMission.mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.75)) {
+ else if (_vm->_awayMission.mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.75))
showText(TX_SPEAKER_SPOCK, TX_MUD0_020);
- } else if (_vm->_awayMission.mudd.lifeSupportTimer == 1) {
+ else if (_vm->_awayMission.mudd.lifeSupportTimer == 1) {
_vm->_awayMission.disableInput = true;
+
+ // In each room, the crewmen collapse in a different directions.
+ // NOTE: "kgetdn" (kirk, north) doesn't work properly; files in the animation
+ // are missing. It's replaced with 'e' (east) in MUDD1, MUDD3, MUDD5. Only
+ // applies to Kirk, others seem fine...
+ // TODO: check if this is the case across all versions...
+ const char *directions[] = {
+ "weseee", // KIRK
+ "sewene", // SPOCK
+ "nsesss", // MCCOY
+ "ewesww", // REDSHIRT
+ };
+
for (int i = OBJECT_KIRK; i <= OBJECT_REDSHIRT; i++) {
- if (deathPositions[_roomIndex][i].x != -1)
- walkCrewman(i, deathPositions[_roomIndex][i].x, deathPositions[_roomIndex][i].y, 9 + i);
+ Common::String anim = _vm->getCrewmanAnimFilename(i, "getd");
+ anim += directions[i][_roomIndex];
+ loadActorAnim2(i, anim);
}
showText(deathText[_roomIndex]);
showGameOverMenu();
@@ -154,22 +181,4 @@ void Room::muddaTick() {
}
}
-void Room::muddaKirkReachedDeathPosition() {
- loadActorAnim2(OBJECT_KIRK, "kgetdw");
-}
-
-void Room::muddaSpockReachedDeathPosition() {
- loadActorAnim2(OBJECT_SPOCK, "sgetds");
-}
-
-void Room::muddaMccoyReachedDeathPosition() {
- loadActorAnim2(OBJECT_MCCOY, "sgetdn");
-}
-
-void Room::muddaRedshirtReachedDeathPosition() {
- loadActorAnim2(OBJECT_REDSHIRT, "rgetde");
- // NOTE: there's code to check if he's the last one down... not really implemented
- // properly
-}
-
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 44c7aea..cec83ab 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -84,7 +84,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxHasMultipleChoices = false;
_missionToLoad = "MUDD";
- _roomIndexToLoad = 5;
+ _roomIndexToLoad = 0;
for (int i = 0; i < NUM_OBJECTS; i++)
_itemList[i] = g_itemList[i];
Commit: f583e307df83f67d56a541375afdfeac11bd36b9
https://github.com/scummvm/scummvm/commit/f583e307df83f67d56a541375afdfeac11bd36b9
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Minor fixes to MUDD mission
Also make better names for variables.
Changed paths:
engines/startrek/awaymission.h
engines/startrek/rooms/function_map.h
engines/startrek/rooms/mudd0.cpp
engines/startrek/rooms/mudd2.cpp
engines/startrek/rooms/mudd3.cpp
engines/startrek/rooms/mudd4.cpp
engines/startrek/rooms/mudd5.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 788727d..21b75f9 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -189,23 +189,27 @@ struct AwayMission {
} love;
struct {
- byte field29; // 0x29
+ // 0: Haven't entered first room yet
+ // 1: Have entered first room once
+ // 2: Mudd is gone from first room
+ byte muddFirstRoomState; // 0x29
+
bool torpedoLoaded; // 0x33
bool knowAboutTorpedo; // 0x34
bool discoveredBase3System; // 0x35
bool translatedAlienLanguage; // 0x36
bool databaseDestroyed; // 0x37
bool muddInDatabaseRoom; // 0x38
- bool muddDroppedCapsule; // 0x39
- bool computerDataErased; // 0x3a
- bool gaveMuddDatabaseAccess; // 0x3b
+ bool muddCurrentlyInsane; // 0x39
+ bool computerDataErasedOrDestroyed; // 0x3a
+ bool muddErasedDatabase; // 0x3b
// True if you've combined the lense + degrimer and fired it off, discovering
// it's a weapon
bool discoveredLenseAndDegrimerFunction; // 0x3c
int16 torpedoStatus; // 0x3d
- bool muddCurrentlyInsane; // 0x3f (TODO: rename)
+ bool muddUnavailable; // 0x3f
bool muddVisitedDatabaseRoom; // 0x40
bool accessedAlienDatabase; // 0x41
bool tookRepairTool; // 0x42
@@ -219,8 +223,14 @@ struct AwayMission {
bool gotDegrimer; // 0x4a
bool putCapsuleInMedicalMachine; // 0x4c
bool muddUnconscious; // 0x4d
- byte muddState; // 0x4e
- bool muddInhaledGas; // 0x4f
+
+ // 0: haven't entered room yet
+ // 1: will go insane next time room is entered (if he's available)
+ // 2: currently insane (or unconscious)
+ // 3: cured
+ byte muddInsanityState; // 0x4e
+
+ bool muddInhaledGas; // 0x4f (mostly the same as "muddCurrentlyInsane"?)
int16 lifeSupportTimer; // 0x50
bool startedLifeSupportTimer; // 0x52
bool enteredRoom0ForFirstTime; // 0x54
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index e529f8b..b2ecf1f 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1091,7 +1091,6 @@ RoomAction love2ActionList[] = {
{ Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::love2ReachedSynthesizerOutput },
{ Action(ACTION_FINISHED_ANIMATION, 23, 0, 0), &Room::love2GotSynthesizerOutput },
- // TODO: test these
{ Action(ACTION_GET, 19, 0, 0), &Room::love2GetCure },
{ Action(ACTION_FINISHED_WALKING, 11, 0, 0), &Room::love2ReachedCure },
{ Action(ACTION_FINISHED_ANIMATION, 24, 0, 0), &Room::love2GotCure },
diff --git a/engines/startrek/rooms/mudd0.cpp b/engines/startrek/rooms/mudd0.cpp
index bb26440..9105c01 100644
--- a/engines/startrek/rooms/mudd0.cpp
+++ b/engines/startrek/rooms/mudd0.cpp
@@ -34,29 +34,24 @@
#define HOTSPOT_DOOR 0x25
#define HOTSPOT_BOTTOM_OF_ROOM 0x26
-// BUG: Mudd is sometimes present when he shouldn't be.
+// BUG-ish: Sometimes when looking at Mudd, Kirk walks toward him, but not always. Does
+// this happen in original?
namespace StarTrek {
void Room::mudd0Tick1() {
playVoc("MUD0LOOP");
- // ENHANCEMENT: Only disable input when Mudd showing Mudd cutscene (avoids a long,
- // pointless delay when entering the room otherwise)
- if (!_vm->_awayMission.mudd.enteredRoom0ForFirstTime)
- _vm->_awayMission.disableInput = 2;
-
- loadActorAnim(OBJECT_MUDD, "s4cbhr", 0xa2, 0xa9, 0);
-
- // Floppy version's code.
- /*
- if (_vm->_awayMission.mudd.field29 == 0)
- _vm->_awayMission.mudd.field29 = 2;
+ // NOTE: Using the floppy version's code here; Mudd disappears from this room after
+ // the first meeting. Fixes an issue where Mudd appears in the first room when he's
+ // supposed to be in the medbay.
+ // TODO: verify this matches with floppy version's code
+ if (_vm->_awayMission.mudd.muddFirstRoomState != 0)
+ _vm->_awayMission.mudd.muddFirstRoomState = 2;
else {
- _vm->_awayMission.mudd.field1d = 2;
+ _vm->_awayMission.disableInput = 2;
loadActorAnim(OBJECT_MUDD, "s4cbhr", 0xa2, 0xa9, 0);
}
- */
}
void Room::mudd0Tick50() {
@@ -67,11 +62,11 @@ void Room::mudd0Tick50() {
}
void Room::mudd0Tick60() {
- if (_vm->_awayMission.mudd.field29 == 0) {
+ if (_vm->_awayMission.mudd.muddFirstRoomState == 0) {
// ENHANCEMENT: Move this into if statement (related to above enhancement)
_vm->_awayMission.disableInput = false;
- _vm->_awayMission.mudd.field29++;
+ _vm->_awayMission.mudd.muddFirstRoomState++;
showText(TX_SPEAKER_MUDD, TX_MUD0_037);
showText(TX_SPEAKER_KIRK, TX_MUD0_009);
@@ -261,7 +256,7 @@ void Room::mudd0LookAtMudd() {
}
void Room::mudd0TalkToKirk() {
- if (_vm->_awayMission.mudd.field29 == 2)
+ if (_vm->_awayMission.mudd.muddFirstRoomState == 2)
showText(TX_SPEAKER_KIRK, TX_MUD0_010);
else {
showText(TX_SPEAKER_KIRK, TX_MUD0_010);
@@ -271,7 +266,7 @@ void Room::mudd0TalkToKirk() {
}
void Room::mudd0TalkToSpock() {
- if (_vm->_awayMission.mudd.field29 == 2)
+ if (_vm->_awayMission.mudd.muddFirstRoomState == 2)
showText(TX_SPEAKER_SPOCK, TX_MUD0_022);
else {
showText(TX_SPEAKER_SPOCK, TX_MUD0_022);
@@ -283,7 +278,7 @@ void Room::mudd0TalkToSpock() {
}
void Room::mudd0TalkToMccoy() {
- if (_vm->_awayMission.mudd.field29 == 2)
+ if (_vm->_awayMission.mudd.muddFirstRoomState == 2)
showText(TX_SPEAKER_MCCOY, TX_MUD0_016);
else {
showText(TX_SPEAKER_MCCOY, TX_MUD0_016);
@@ -294,15 +289,15 @@ void Room::mudd0TalkToMccoy() {
}
void Room::mudd0TalkToRedshirt() {
- if (_vm->_awayMission.mudd.field29 == 2)
- showText(TX_SPEAKER_BUCHERT, TX_MUD0_016);
+ if (_vm->_awayMission.mudd.muddFirstRoomState == 2) {
+ showText(TX_SPEAKER_BUCHERT, TX_MUD0_039);
+ showText(TX_SPEAKER_KIRK, TX_MUD0_008);
+ }
else {
showText(TX_SPEAKER_BUCHERT, TX_MUD0_040);
showText(TX_SPEAKER_MUDD, TX_MUD0_030);
showText(TX_SPEAKER_BUCHERT, TX_MUD0_041);
showText(TX_SPEAKER_MUDD, TX_MUD0_036);
- showText(TX_SPEAKER_BUCHERT, TX_MUD0_039);
- showText(TX_SPEAKER_KIRK, TX_MUD0_008);
}
}
diff --git a/engines/startrek/rooms/mudd2.cpp b/engines/startrek/rooms/mudd2.cpp
index d2a420d..3a3ba81 100644
--- a/engines/startrek/rooms/mudd2.cpp
+++ b/engines/startrek/rooms/mudd2.cpp
@@ -67,12 +67,12 @@ void Room::mudd2Tick1() {
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
- _vm->_awayMission.mudd.muddDroppedCapsule = false;
+ _vm->_awayMission.mudd.muddCurrentlyInsane = false;
- if (_vm->_awayMission.mudd.muddState == 0) {
- _vm->_awayMission.mudd.muddState = 0;
- } else if (_vm->_awayMission.mudd.muddState == 2) {
- _vm->_awayMission.mudd.muddDroppedCapsule = true;
+ if (_vm->_awayMission.mudd.muddInsanityState == 0) { // First time entering room
+ _vm->_awayMission.mudd.muddInsanityState = 1;
+ } else if (_vm->_awayMission.mudd.muddInsanityState == 2) { // Currently insane
+ _vm->_awayMission.mudd.muddCurrentlyInsane = true;
if (!_vm->_awayMission.mudd.muddUnconscious) {
_vm->_awayMission.mudd.muddUnconscious = false;
loadActorAnim2(OBJECT_MUDD, "s4sbhn", 0x9f, 0xbf);
@@ -80,16 +80,16 @@ void Room::mudd2Tick1() {
} else {
loadActorAnim2(OBJECT_MUDD, "s4sbob", 0x9f, 0xba);
}
- } else if (_vm->_awayMission.mudd.muddCurrentlyInsane) {
- _vm->_awayMission.mudd.muddState = 0;
- } else if (_vm->_awayMission.mudd.muddState == 1) {
+ } else if (_vm->_awayMission.mudd.muddUnavailable) {
+ _vm->_awayMission.mudd.muddInsanityState = 1;
+ } else if (_vm->_awayMission.mudd.muddInsanityState == 1) { // Second time entering room, start cutscene
playMidiMusicTracks(3);
loadActorAnim2(OBJECT_MUDD, "s4sbhw", 0x99, 0xbf);
_vm->_awayMission.disableInput = 2;
_vm->_awayMission.mudd.muddInhaledGas = true;
_vm->_awayMission.timers[1] = 70;
- _vm->_awayMission.mudd.muddState = 2;
- _vm->_awayMission.mudd.muddCurrentlyInsane = true;
+ _vm->_awayMission.mudd.muddInsanityState = 2;
+ _vm->_awayMission.mudd.muddUnavailable = true;
}
}
@@ -150,9 +150,9 @@ void Room::mudd2UseCapsuleOnControlPanel() {
void Room::mudd2MccoyReachedControlPanel() {
if (_vm->_awayMission.mudd.translatedAlienLanguage)
- showText(TX_SPEAKER_MCCOY, TX_MUD2_014);
- else
loadActorAnimC(OBJECT_MCCOY, "musehn", -1, -1, &Room::mudd2MccoyPutCapsuleInControlPanel);
+ else // NOTE: Unused, since you can't get capsules without translating the language first
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_014);
}
void Room::mudd2MccoyPutCapsuleInControlPanel() {
@@ -195,7 +195,7 @@ void Room::mudd2MuddNoticedKirk() {
void Room::mudd2MuddDroppedCapsule() {
loadActorAnim2(OBJECT_MUDD, "s4sbhn", 0x9f, 0xbf, 3); // NOTE: no callback from this
loadActorAnim2(OBJECT_CAPSULE, "s4sbvp", 0x93, 0xc3);
- _vm->_awayMission.mudd.muddDroppedCapsule = true;
+ _vm->_awayMission.mudd.muddCurrentlyInsane = true;
showText(TX_SPEAKER_MCCOY, TX_MUD2_032);
showText(TX_SPEAKER_MUDD, TX_MUD2_049);
@@ -312,9 +312,9 @@ void Room::mudd2MccoyReachedMudd() {
}
void Room::mudd2MccoyCuredMudd() {
+ _vm->_awayMission.mudd.muddUnavailable = false;
+ _vm->_awayMission.mudd.muddInsanityState = 3;
_vm->_awayMission.mudd.muddCurrentlyInsane = false;
- _vm->_awayMission.mudd.muddState = 3;
- _vm->_awayMission.mudd.muddDroppedCapsule = false;
_vm->_awayMission.mudd.muddInhaledGas = false;
showText(TX_SPEAKER_MCCOY, TX_MUD2_033);
@@ -352,9 +352,10 @@ void Room::mudd2LookAtBed() {
showText(TX_MUD2N007);
}
-// FIXME: The conditions in the below functions seem wrong.
void Room::mudd2TalkToKirk() {
- if (!_vm->_awayMission.mudd.muddDroppedCapsule || _vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious)
+ // BUGFIX: second condition in if statement changed to "must be false" instead of
+ // "must be true". (Same applies to below talk functions.)
+ if (!_vm->_awayMission.mudd.muddCurrentlyInsane || !_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious)
showText(TX_SPEAKER_KIRK, TX_MUD2_010);
else {
showText(TX_SPEAKER_KIRK, TX_MUD2_005);
@@ -364,7 +365,7 @@ void Room::mudd2TalkToKirk() {
}
void Room::mudd2TalkToSpock() {
- if (!_vm->_awayMission.mudd.muddDroppedCapsule || _vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
+ if (!_vm->_awayMission.mudd.muddCurrentlyInsane || !_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
showText(TX_SPEAKER_SPOCK, TX_MUD2_040);
showText(TX_SPEAKER_KIRK, TX_MUD2_011);
} else {
@@ -373,7 +374,7 @@ void Room::mudd2TalkToSpock() {
}
void Room::mudd2TalkToMccoy() {
- if (!_vm->_awayMission.mudd.muddDroppedCapsule || _vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
+ if (!_vm->_awayMission.mudd.muddCurrentlyInsane || !_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
showText(TX_SPEAKER_MCCOY, TX_MUD2_025);
showText(TX_SPEAKER_KIRK, TX_MUD2_007);
} else {
@@ -382,23 +383,23 @@ void Room::mudd2TalkToMccoy() {
}
void Room::mudd2TalkToRedshirt() {
- if (!_vm->_awayMission.mudd.muddDroppedCapsule || _vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
+ if (!_vm->_awayMission.mudd.muddCurrentlyInsane || !_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
showText(TX_SPEAKER_BUCHERT, TX_MUD2_054);
showText(TX_SPEAKER_KIRK, TX_MUD2_008);
} else {
showText(TX_SPEAKER_BUCHERT, TX_MUD2_055);
showText(TX_SPEAKER_KIRK, TX_MUD2_003);
- showText(TX_SPEAKER_MCCOY, TX_MUD2_048);
+ showText(TX_SPEAKER_MCCOY, TX_MUD2_036);
}
}
void Room::mudd2TalkToMudd() {
- if (!_vm->_awayMission.mudd.muddDroppedCapsule || _vm->_awayMission.mudd.muddUnconscious)
+ if (!_vm->_awayMission.mudd.muddCurrentlyInsane || !_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious)
return;
else if (_vm->_awayMission.mudd.muddInhaledGas) {
showText(TX_SPEAKER_MUDD, TX_MUD2_048);
showText(TX_SPEAKER_MCCOY, TX_MUD2_028);
- } else {
+ } else { // NOTE: Unused (assumes harry is in a normal state, which doesn't happen here)
showText(TX_SPEAKER_MUDD, TX_MUD2_047);
showText(TX_SPEAKER_KIRK, TX_MUD2_006);
}
diff --git a/engines/startrek/rooms/mudd3.cpp b/engines/startrek/rooms/mudd3.cpp
index b0bc5a3..792e749 100644
--- a/engines/startrek/rooms/mudd3.cpp
+++ b/engines/startrek/rooms/mudd3.cpp
@@ -54,7 +54,7 @@ void Room::mudd3Tick1() {
_vm->_awayMission.mudd.muddInDatabaseRoom = false;
- if (!_vm->_awayMission.mudd.muddVisitedDatabaseRoom && _vm->_awayMission.mudd.translatedAlienLanguage && !_vm->_awayMission.mudd.muddCurrentlyInsane) {
+ if (!_vm->_awayMission.mudd.muddVisitedDatabaseRoom && _vm->_awayMission.mudd.translatedAlienLanguage && !_vm->_awayMission.mudd.muddUnavailable) {
_vm->_awayMission.mudd.muddVisitedDatabaseRoom = true;
loadActorAnim(OBJECT_MUDD, "s4lbhs", 0xa2, 0x9f);
playMidiMusicTracks(3);
@@ -69,10 +69,12 @@ void Room::mudd3UseCommunicator() {
}
void Room::mudd3LookAtScreen() {
- if (_vm->_awayMission.mudd.translatedAlienLanguage) // FIXME: flipped conditions?
- showText(TX_MUD3N017);
- else
+ // BUGFIX: the condition was flipped in the original; the more "vague" description
+ // should be shown before the alien language is understood.
+ if (_vm->_awayMission.mudd.translatedAlienLanguage)
showText(TX_SPEAKER_SPOCK, TX_MUD3_038);
+ else
+ showText(TX_MUD3N017);
}
void Room::mudd3UseSTricorderOnScreen() {
@@ -94,7 +96,7 @@ void Room::mudd3UseSpockOnSphere() {
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
loadActorStandAnim(OBJECT_SPOCK);
- if (_vm->_awayMission.mudd.computerDataErased) {
+ if (_vm->_awayMission.mudd.computerDataErasedOrDestroyed) {
if (!_vm->_awayMission.mudd.databaseDestroyed) {
showText(TX_MUD3N000);
showText(TX_SPEAKER_SPOCK, TX_MUD3_052);
@@ -254,14 +256,22 @@ void Room::mudd3Timer2Expired() {
TX_BLANK
};
- _vm->_awayMission.mudd.computerDataErased = true;
+ _vm->_awayMission.mudd.computerDataErasedOrDestroyed = true;
showText(TX_SPEAKER_MUDD, TX_MUD3_065);
int choice = showText(choices);
- if (choice == 0) { // Allow him to access the database
+ if (choice == 0) { // Allow him to access the database (he ends up erasing it)
showText(TX_SPEAKER_MUDD, TX_MUD3_066);
- _vm->_awayMission.mudd.gaveMuddDatabaseAccess = true;
+ _vm->_awayMission.mudd.muddErasedDatabase = true;
+
+ // ENHANCEMENT: Add a few lines to make it clear that Mudd erased the databanks.
+ // Otherwise, the end of the mission when you confront Mudd doesn't make sense
+ // unless the player happened to try accessing the database again. Also, if you
+ // talk to the crew, they berate him for no apparent reason if this isn't clear.
+ showText(TX_MUD3N000);
+ showText(TX_SPEAKER_MCCOY, TX_MUD3_031);
+
} else { // Don't allow it (he destroys it by accident)
showText(TX_SPEAKER_MUDD, TX_MUD3_064);
_vm->_awayMission.timers[4] = 98;
@@ -281,9 +291,13 @@ void Room::mudd3Timer4Expired() {
}
void Room::mudd3UseMemoryDiskOnSphere() {
+ // ENHANCEMENT: Turn to face south
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ loadActorStandAnim(OBJECT_KIRK);
+
if (_vm->_awayMission.mudd.databaseDestroyed)
showText(TX_MUD3N014);
- else if (_vm->_awayMission.mudd.translatedAlienLanguage && !_vm->_awayMission.mudd.gaveMuddDatabaseAccess) {
+ else if (_vm->_awayMission.mudd.translatedAlienLanguage && !_vm->_awayMission.mudd.muddErasedDatabase) {
showText(TX_MUD3N020);
if (!_vm->_awayMission.mudd.gotPointsForDownloadingData) {
_vm->_awayMission.mudd.missionScore += 3;
@@ -419,7 +433,9 @@ void Room::mudd3TalkToRedshirt() {
}
void Room::mudd3TalkToMudd() {
- if (_vm->_awayMission.mudd.databaseDestroyed) {
+ // ENHANCEMENT: the 2nd part of the if condition is new; whether he physically
+ // destroys the database or does through software, he should give this reaction.
+ if (_vm->_awayMission.mudd.databaseDestroyed || _vm->_awayMission.mudd.muddErasedDatabase) {
showText(TX_SPEAKER_MUDD, TX_MUD3_060);
showText(TX_SPEAKER_MCCOY, TX_MUD3_029);
showText(TX_SPEAKER_MUDD, TX_MUD3_061);
diff --git a/engines/startrek/rooms/mudd4.cpp b/engines/startrek/rooms/mudd4.cpp
index 502a650..2905fb3 100644
--- a/engines/startrek/rooms/mudd4.cpp
+++ b/engines/startrek/rooms/mudd4.cpp
@@ -51,11 +51,11 @@ void Room::mudd4UseCommunicator() {
showText(TX_SPEAKER_UHURA, TX_STATICU1);
}
-void Room::mudd4Timer2Expired() { // TODO: better name
+void Room::mudd4Timer2Expired() {
playSoundEffectIndex(SND_07);
}
-void Room::mudd4Timer3Expired() { // TODO: better name
+void Room::mudd4Timer3Expired() {
playSoundEffectIndex(SND_TRANSENE);
}
@@ -331,7 +331,7 @@ void Room::mudd4KirkUsedCommunications() {
}
void Room::mudd4TalkWithMuddAtMissionEnd() {
- if (_vm->_awayMission.mudd.muddCurrentlyInsane)
+ if (_vm->_awayMission.mudd.muddUnavailable)
return;
else {
_vm->_awayMission.disableInput = true;
@@ -356,7 +356,7 @@ void Room::mudd4KirkReachedPositionToTalkToMudd() {
_vm->_awayMission.disableInput = false;
if (_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction
- || _vm->_awayMission.mudd.gaveMuddDatabaseAccess
+ || _vm->_awayMission.mudd.muddErasedDatabase
|| _vm->_awayMission.mudd.databaseDestroyed
|| !_vm->_awayMission.mudd.accessedAlienDatabase) { // NOTE: why this last line? Test this...
const int choices[] = {
@@ -381,18 +381,20 @@ void Room::mudd4KirkReachedPositionToTalkToMudd() {
endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
} else {
// Threaten to arrest Mudd.
- if (_vm->_awayMission.mudd.gaveMuddDatabaseAccess || _vm->_awayMission.mudd.databaseDestroyed)
+ if (_vm->_awayMission.mudd.muddErasedDatabase || _vm->_awayMission.mudd.databaseDestroyed)
showText(TX_SPEAKER_KIRK, TX_MUD4_034);
if (_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction)
showText(TX_SPEAKER_KIRK, TX_MUD4_037);
showText(TX_SPEAKER_KIRK, TX_MUD4_026);
- if (_vm->_awayMission.mudd.gaveMuddDatabaseAccess && _vm->_awayMission.mudd.databaseDestroyed) {
+ if (_vm->_awayMission.mudd.muddErasedDatabase && _vm->_awayMission.mudd.databaseDestroyed) {
+ // Mudd offers to copy the lost data to the enterprise computer. You don't
+ // get any points for this outcome.
+
// NOTE: This combination is probably impossible, making this unused?
// (Either you give Mudd access to the database, or he destroys it.)
- // Mudd offers to copy the lost data to the enterprise computer.
showText(TX_SPEAKER_MUDD, TX_MUD4_071);
showText(TX_SPEAKER_KIRK, TX_MUD4_036);
showText(TX_SPEAKER_SPOCK, TX_MUD4_029);
diff --git a/engines/startrek/rooms/mudd5.cpp b/engines/startrek/rooms/mudd5.cpp
index c8e7500..c7e63f3 100644
--- a/engines/startrek/rooms/mudd5.cpp
+++ b/engines/startrek/rooms/mudd5.cpp
@@ -48,8 +48,8 @@ void Room::mudd5Tick1() {
loadActorAnim(OBJECT_LIFE_SUPPORT_GENERATOR, "s4eplo", GENERATOR_X, GENERATOR_Y);
_vm->_awayMission.mudd.numTimesEnteredRoom5++;
// BUG: this event can become permanently unavailable? (test)
- if (_vm->_awayMission.mudd.numTimesEnteredRoom5 == 2 && !_vm->_awayMission.mudd.muddCurrentlyInsane && !_vm->_awayMission.mudd.repairedLifeSupportGenerator) {
- _vm->_awayMission.mudd.muddCurrentlyInsane = true;
+ if (_vm->_awayMission.mudd.numTimesEnteredRoom5 == 2 && !_vm->_awayMission.mudd.muddUnavailable && !_vm->_awayMission.mudd.repairedLifeSupportGenerator) {
+ _vm->_awayMission.mudd.muddUnavailable = true;
_vm->_awayMission.mudd.numTimesEnteredRoom5 = 1;
_vm->_awayMission.disableInput = 2;
playMidiMusicTracks(3);
@@ -154,7 +154,7 @@ void Room::mudd5KirkRepairedLifeSupportGenerator() {
showText(TX_SPEAKER_SPOCK, TX_MUD5_028);
_vm->_awayMission.mudd.lifeSupportMalfunctioning = false;
- _vm->_awayMission.mudd.muddCurrentlyInsane = false;
+ _vm->_awayMission.mudd.muddUnavailable = false;
playMidiMusicTracks(3);
loadActorAnim(OBJECT_MUDD, "s4ephh", 0x0e, 0xa7);
_vm->_awayMission.disableInput = true;
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 4811da9..cc257d2 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -1342,8 +1342,10 @@ enum GameStringIDs {
TX_MUD2N011,
+ // MISSING
TX_MUD3_002,
TX_MUD3_003,
+ // MISSING
TX_MUD3_005,
TX_MUD3_006,
TX_MUD3_007,
@@ -2334,7 +2336,7 @@ const char * const g_gameStrings[] = {
"#LOV0\\LOV0_050#This is how I want to feel all the time!",
"#LOV0\\LOV0_101#Fascinating. I am experiencing an urge to laugh.",
"#LOV0\\LOV0_102#I am a Vulcan. I must resist these unchecked emotions.",
- "#LOV0\\LOV0_103#Logic...What happened to my logic?",
+ "#LOV0\\LOV0_103#Logic... What happened to my logic?", // TYPO
"#LOV0\\LOV0_104#Jim, is this how you feel on shore leave?",
"#LOV0\\LOV0_105#I remember my mother trying to tell me jokes when I was a child. Now, I finally understand them.",
"#LOV0\\LOV0_106#Romulan laughing gas. My father would never approve.",
@@ -2821,7 +2823,7 @@ const char * const g_gameStrings[] = {
"#MUD2\\MUD2_011#Sorry if I was bothering you. I was just silently cursing the day I met Harry Mudd. ",
"#MUD2\\MUD2_012#All yours now, Doctor McCoy.",
"#MUD2\\MUD2_013#He's showing definite signs of hallucination and a marked increase in adrenalin. I would recommend extreme caution in handling him.",
- "#MUD2\\MUD2_014#I feel sure that these would have been used here, but I don't understand enough of how the aliens thought, to make it work.",
+ "#MUD2\\MUD2_014#I feel sure that these would have been used here, but I don't understand enough of the alien's thinking to make it work.", // TYPO
"#MUD2\\MUD2_015#I need to understand more about the aliens before I can make this bed and its instrumentation function.",
"#MUD2\\MUD2_016#I'm not fast enough to get him with a tranquilizer hypo, Jim!",
"#MUD2\\MUD2_018#Jim, these look like the capsules we might use in a hypo. I wouldn't recommend experimenting with them, though. Alien physiology or not, you can never be sure what unusual chemicals will do to the human body.",
@@ -2883,18 +2885,18 @@ const char * const g_gameStrings[] = {
"#MUD3\\MUD3_008#But their essence, their souls -- are gone, Spock.",
"#MUD3\\MUD3_009#Get away from that this instant, Harry, or I'll shoot you where you stand.",
"#MUD3\\MUD3_010#Help yourself, Harry. Knowledge is for everyone.",
- "#MUD3\\MUD3_011#It would be nice to think after all the stunts that Harry has pulled that he would do something right for a change. ",
+ "#MUD3\\MUD3_011#It would be nice to think that after all the stunts that Harry has pulled, that he would do something right for a change. ", // TYPO
"#MUD3\\MUD3_012#Spock, we're talking about Harry Mudd. He was probably trying to download it so he could sell it to the highest bidder.",
"#MUD3\\MUD3_013#Teeny bit clumsy? Mudd, you're a disgrace to the entire human race! ",
"#MUD3\\MUD3_014#This technology is unbelievable, Mr. Spock. I've never seen anything like it. ",
- "#MUD3\\MUD3_015#With the Enterprise out of range, that's not an option, Mr. Spock.What else can you do?",
+ "#MUD3\\MUD3_015#With the Enterprise out of range, that's not an option, Mr. Spock. What else can you do?", // TYPO
"#MUD3\\MUD3_016#You better believe it, lieutenant. ",
"#MUD3\\MUD3_017#Apparently an information data screen, something like the display readers on the Enterprise.",
"#MUD3\\MUD3_018#Both our tricorders are now working on basic processing of the aliens' computer data system. The tricorders are not the equal of the Universal Translator, but we should be able to retrieve basic information and get an insight into their culture and lifesystems. I don't believe we could have gotten even this far, had we not deduced their fixation on base-6 mathematics and esthetics.",
"#MUD3\\MUD3_019#Captain, it was not logical to allow Harry Mudd to get within one hundred meters of this room. ",
"#MUD3\\MUD3_020#Everyone is healthy, Jim, there's no need for the medical kit here.",
"#MUD3\\MUD3_021#Not my area of expertise, I'm afraid.",
- "#MUD3\\MUD3_022#That would be quite a find, Jim. This is an alien race unknown to us, and they were certain to have knowledge new to us.",
+ "#MUD3\\MUD3_022#That would be quite a find, Jim. This is an alien race unknown to us, and they are certain to have knowledge new to us.", // TYPO
"#MUD3\\MUD3_023#This equipment's way out of my league, Jim. ",
"#MUD3\\MUD3_024#And instead, he wiped the memory. That knowledge was priceless!",
"#MUD3\\MUD3_025#If you're incapable of emotion, how do you know what \"awe\" is, Spock? ",
@@ -2921,7 +2923,7 @@ const char * const g_gameStrings[] = {
"#MUD3\\MUD3_047#I believe if Dr. McCoy and I conjoin our two tricorders, we may be able to process enough sample data to get a basic understanding of the aliens' computer system. This will completely tie up both our tricorders for an extended amount of time, however.",
"#MUD3\\MUD3_048#I believe, Captain, that the basic functions of the ship remain, even now. This is the library module -- the art, history, and cultural memory of the aliens are gone, but the mechanical necessities of sick bay, engineering, and sensors continue to work.",
"#MUD3\\MUD3_049#I have found an entry on an experimental long-range weapon booster, recently installed, named the Whyos weapon. It does not alter the power of the primary weapons systems, but it does increase the range at which those weapons are effective.",
- "#MUD3\\MUD3_050#I'm recieving data now, Captain. Most internal and external functions are controlled from the bridge. These include Engineering, Navigation, Communications, and Sensors. Weapons functions are controlled from the weapons room.",
+ "#MUD3\\MUD3_050#I'm receiving data now, Captain. Most internal and external functions are controlled from the bridge. These include Engineering, Navigation, Communications, and Sensors. Weapons functions are controlled from the weapons room.", // TYPO
"#MUD3\\MUD3_051#Illogical, Captain. This race has been extinct for millenia.",
"#MUD3\\MUD3_052#It appears our good friend Harry Mudd has crashed the main computers. I doubt if it was a very easy thing to manage.",
"#MUD3\\MUD3_053#It should be no surprise that physiology affects mind and behavior. I would say a six-fingered, six-eyed people would naturally develop their sciences and arts around base-six numerical systems, just as I observed on the bridge.",
Commit: 51e2c85a25a19ce7cdc1b942947f4ca6fbe86d6c
https://github.com/scummvm/scummvm/commit/51e2c85a25a19ce7cdc1b942947f4ca6fbe86d6c
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: FEATHER0
Changed paths:
A engines/startrek/rooms/feather0.cpp
A engines/startrek/rooms/feather1.cpp
A engines/startrek/rooms/feather2.cpp
A engines/startrek/rooms/feather3.cpp
A engines/startrek/rooms/feather4.cpp
A engines/startrek/rooms/feather5.cpp
A engines/startrek/rooms/feather6.cpp
A engines/startrek/rooms/feather7.cpp
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 460e110..5022abe 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -44,6 +44,14 @@ MODULE_OBJS = \
rooms/mudd4.o \
rooms/mudd5.o \
rooms/mudda.o \
+ rooms/feather0.o \
+ rooms/feather1.o \
+ rooms/feather2.o \
+ rooms/feather3.o \
+ rooms/feather4.o \
+ rooms/feather5.o \
+ rooms/feather6.o \
+ rooms/feather7.o \
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 6237cdd..1c467d3 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -131,6 +131,38 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_roomActionList = mudd5ActionList;
_numRoomActions = sizeof(mudd5ActionList) / sizeof(RoomAction);
}
+ else if (name == "FEATHER0") {
+ _roomActionList = feather0ActionList;
+ _numRoomActions = sizeof(feather0ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "FEATHER1") {
+ _roomActionList = feather1ActionList;
+ _numRoomActions = sizeof(feather1ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "FEATHER2") {
+ _roomActionList = feather2ActionList;
+ _numRoomActions = sizeof(feather2ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "FEATHER3") {
+ _roomActionList = feather3ActionList;
+ _numRoomActions = sizeof(feather3ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "FEATHER4") {
+ _roomActionList = feather4ActionList;
+ _numRoomActions = sizeof(feather4ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "FEATHER5") {
+ _roomActionList = feather5ActionList;
+ _numRoomActions = sizeof(feather5ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "FEATHER6") {
+ _roomActionList = feather6ActionList;
+ _numRoomActions = sizeof(feather6ActionList) / sizeof(RoomAction);
+ }
+ else if (name == "FEATHER7") {
+ _roomActionList = feather7ActionList;
+ _numRoomActions = sizeof(feather7ActionList) / sizeof(RoomAction);
+ }
else {
warning("Room \"%s\" unimplemented", name.c_str());
_numRoomActions = 0;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index d51442e..2b5f95c 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1380,6 +1380,53 @@ public:
void muddaUseDegrimer();
void muddaTick();
+ // FEATHER0
+ void feather0Tick1();
+ void feather0Tick60();
+ void feather0TalkToQuetzecoatl();
+ void feather0Timer0Expired();
+ void feather0Timer1Expired();
+ void feather0UsePhaserOnQuetzecoatl();
+ void feather0UsePhaserOnMccoy();
+ void feather0UseMedkit();
+ void feather0LookAtQuetzecoatl();
+ void feather0LookAtMoon();
+ void feather0LookAtLog();
+ void feather0LookAtHut();
+ void feather0LookAnywhere();
+ void feather0LookAtEyes();
+ void feather0LookAtTree();
+ void feather0LookAtMccoy();
+ void feather0LookAtSpock();
+ void feather0LookAtRedshirt();
+ void feather0TalkToMccoy();
+ void feather0TalkToSpock();
+ void feather0TalkToRedshirt();
+ void feather0UseSTricorderOnQuetzecoatl();
+ void feather0UseSTricorderAnywhere();
+ void feather0UseMTricorderOnQuetzecoatl();
+
+ // FEATHER1
+ void feather1Tick1();
+
+ // FEATHER2
+ void feather2Tick1();
+
+ // FEATHER3
+ void feather3Tick1();
+
+ // FEATHER4
+ void feather4Tick1();
+
+ // FEATHER5
+ void feather5Tick1();
+
+ // FEATHER6
+ void feather6Tick1();
+
+ // FEATHER7
+ void feather7Tick1();
+
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
diff --git a/engines/startrek/rooms/feather0.cpp b/engines/startrek/rooms/feather0.cpp
new file mode 100644
index 0000000..a533af0
--- /dev/null
+++ b/engines/startrek/rooms/feather0.cpp
@@ -0,0 +1,224 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_QUETZECOATL 8
+
+#define HOTSPOT_MOON 0x20
+#define HOTSPOT_LOG 0x21
+#define HOTSPOT_HUT 0x22
+#define HOTSPOT_EYES_1 0x23
+#define HOTSPOT_EYES_2 0x24
+#define HOTSPOT_EYES_3 0x25
+#define HOTSPOT_EYES_4 0x26
+#define HOTSPOT_EYES_5 0x27
+#define HOTSPOT_EYES_6 0x28
+#define HOTSPOT_EYES_7 0x29
+#define HOTSPOT_EYES_8 0x2a
+#define HOTSPOT_EYES_9 0x2b
+#define HOTSPOT_TREE 0x2c
+
+namespace StarTrek {
+
+void Room::feather0Tick1() {
+ playVoc("FEA0LOOP");
+ loadActorAnim(OBJECT_QUETZECOATL, "s5r0qb", 0xbe, 0xa6);
+}
+
+void Room::feather0Tick60() {
+ playMidiMusicTracks(33);
+}
+
+void Room::feather0TalkToQuetzecoatl() {
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_FEA0_006,
+ TX_FEA0_007,
+ TX_FEA0_011,
+ TX_BLANK
+ };
+
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA0_028);
+ int choice = showText(choices);
+ bool alreadyAngered = false;
+
+ if (choice == 0) {
+ const TextRef choices0[] = {
+ TX_SPEAKER_KIRK,
+ TX_FEA0_009,
+ TX_FEA0_004,
+ TX_BLANK
+ };
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA0_032);
+ choice = showText(choices0);
+ } else if (choice == 1) {
+ const TextRef choices0[] = {
+ TX_SPEAKER_KIRK,
+ TX_FEA0_002,
+ TX_FEA0_012,
+ TX_BLANK
+ };
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA0_031);
+ choice = showText(choices0);
+ } else if (choice == 2) {
+ const TextRef choices0[] = {
+ TX_SPEAKER_KIRK,
+ TX_FEA0_014,
+ TX_FEA0_008,
+ TX_BLANK
+ };
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA0_033);
+ choice = showText(choices0);
+
+ if (choice == 0) {
+ alreadyAngered = true;
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA0_024);
+ }
+ } else
+ showText(TX_DIALOG_ERROR);
+
+ if (!alreadyAngered) {
+ if (choice == 0)
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA0_030);
+ else // choice == 1
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA0_101);
+ showText(TX_SPEAKER_KIRK, TX_FEA0_010);
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA0_026);
+
+ const TextRef choices1[] = {
+ TX_SPEAKER_KIRK,
+ TX_FEA0_013,
+ TX_FEA0_005,
+ TX_BLANK
+ };
+ choice = showText(choices1);
+
+ if (choice == 0) {
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA0_029);
+ showText(TX_SPEAKER_KIRK, TX_FEA0_003);
+ }
+
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA0_027);
+ }
+
+ // Quetzecoatl ultimately warps the crew away no matter what
+ _vm->_awayMission.disableInput = true;
+ loadActorAnim(OBJECT_QUETZECOATL, "s5r0qt");
+ playMidiMusicTracks(1);
+ _vm->_awayMission.timers[0] = 50;
+ _vm->_awayMission.timers[1] = 64;
+}
+
+void Room::feather0Timer0Expired() {
+ playVoc("SE2BIGEN");
+
+ loadActorAnim2(OBJECT_KIRK, "ktele");
+ loadActorAnim2(OBJECT_SPOCK, "stele");
+ loadActorAnim2(OBJECT_MCCOY, "mtele");
+ loadActorAnim2(OBJECT_REDSHIRT, "rtele");
+}
+
+void Room::feather0Timer1Expired() {
+ _vm->_awayMission.disableInput = false;
+ loadRoomIndex(1, 5);
+}
+
+void Room::feather0UsePhaserOnQuetzecoatl() {
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA0_025);
+}
+
+void Room::feather0UsePhaserOnMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA0_016);
+}
+
+void Room::feather0UseMedkit() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA0_108);
+}
+
+void Room::feather0LookAtQuetzecoatl() {
+ showText(TX_FEA0N008);
+}
+
+void Room::feather0LookAtMoon() {
+ showText(TX_FEA0N007);
+}
+
+void Room::feather0LookAtLog() {
+ showText(TX_FEA0N006);
+}
+
+void Room::feather0LookAtHut() {
+ showText(TX_FEA0N001);
+}
+
+void Room::feather0LookAnywhere() {
+ showText(TX_FEA0N009);
+}
+
+void Room::feather0LookAtEyes() {
+ showText(TX_FEA0N000);
+}
+
+void Room::feather0LookAtTree() {
+ showText(TX_FEA0N003);
+}
+
+void Room::feather0LookAtMccoy() {
+ showText(TX_FEA0N004);
+}
+
+void Room::feather0LookAtSpock() {
+ showText(TX_FEA0N005);
+}
+
+void Room::feather0LookAtRedshirt() {
+ showText(TX_FEA0N002);
+}
+
+void Room::feather0TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA0_017);
+ showText(TX_SPEAKER_SPOCK, TX_FEA0_021);
+}
+
+void Room::feather0TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA0_022);
+ showText(TX_SPEAKER_MCCOY, TX_FEA0_018);
+}
+
+void Room::feather0TalkToRedshirt() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA0_023);
+}
+
+void Room::feather0UseSTricorderOnQuetzecoatl() {
+ spockScan(DIR_S, TX_FEA0_020, false);
+}
+
+void Room::feather0UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_FEA0_019, false);
+}
+
+void Room::feather0UseMTricorderOnQuetzecoatl() {
+ mccoyScan(DIR_S, TX_FEA0_015, false);
+}
+
+}
diff --git a/engines/startrek/rooms/feather1.cpp b/engines/startrek/rooms/feather1.cpp
new file mode 100644
index 0000000..ac4f147
--- /dev/null
+++ b/engines/startrek/rooms/feather1.cpp
@@ -0,0 +1,35 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_8 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+void Room::feather1Tick1() {
+
+}
+
+}
diff --git a/engines/startrek/rooms/feather2.cpp b/engines/startrek/rooms/feather2.cpp
new file mode 100644
index 0000000..d28e26c
--- /dev/null
+++ b/engines/startrek/rooms/feather2.cpp
@@ -0,0 +1,35 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_8 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+void Room::feather2Tick1() {
+
+}
+
+}
diff --git a/engines/startrek/rooms/feather3.cpp b/engines/startrek/rooms/feather3.cpp
new file mode 100644
index 0000000..0f5f3b3
--- /dev/null
+++ b/engines/startrek/rooms/feather3.cpp
@@ -0,0 +1,35 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_8 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+void Room::feather3Tick1() {
+
+}
+
+}
diff --git a/engines/startrek/rooms/feather4.cpp b/engines/startrek/rooms/feather4.cpp
new file mode 100644
index 0000000..b2e92df
--- /dev/null
+++ b/engines/startrek/rooms/feather4.cpp
@@ -0,0 +1,35 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_8 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+void Room::feather4Tick1() {
+
+}
+
+}
diff --git a/engines/startrek/rooms/feather5.cpp b/engines/startrek/rooms/feather5.cpp
new file mode 100644
index 0000000..f7a2cd1
--- /dev/null
+++ b/engines/startrek/rooms/feather5.cpp
@@ -0,0 +1,35 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_8 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+void Room::feather5Tick1() {
+
+}
+
+}
diff --git a/engines/startrek/rooms/feather6.cpp b/engines/startrek/rooms/feather6.cpp
new file mode 100644
index 0000000..227007a
--- /dev/null
+++ b/engines/startrek/rooms/feather6.cpp
@@ -0,0 +1,35 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_8 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+void Room::feather6Tick1() {
+
+}
+
+}
diff --git a/engines/startrek/rooms/feather7.cpp b/engines/startrek/rooms/feather7.cpp
new file mode 100644
index 0000000..a932404
--- /dev/null
+++ b/engines/startrek/rooms/feather7.cpp
@@ -0,0 +1,35 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_8 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+void Room::feather7Tick1() {
+
+}
+
+}
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index b2ecf1f..c79b81e 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1748,6 +1748,71 @@ RoomAction mudd5ActionList[] = {
{ Action(ACTION_TICK, -1, -1, -1), &Room::muddaTick },
};
+RoomAction feather0ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::feather0Tick1 },
+ { Action(ACTION_TICK, 60, 0, 0), &Room::feather0Tick60 },
+ { Action(ACTION_TALK, 8, 0, 0), &Room::feather0TalkToQuetzecoatl },
+ { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::feather0Timer0Expired },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::feather0Timer1Expired },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::feather0UsePhaserOnQuetzecoatl },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::feather0UsePhaserOnQuetzecoatl },
+ { Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_MCCOY, 0), &Room::feather0UsePhaserOnMccoy },
+ { Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_MCCOY, 0), &Room::feather0UsePhaserOnMccoy },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::feather0UseMedkit },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::feather0LookAtQuetzecoatl },
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::feather0LookAtMoon },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::feather0LookAtLog },
+ { Action(ACTION_LOOK, 0x22, 0, 0), &Room::feather0LookAtHut },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::feather0LookAnywhere },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::feather0LookAtEyes },
+ { Action(ACTION_LOOK, 0x24, 0, 0), &Room::feather0LookAtEyes },
+ { Action(ACTION_LOOK, 0x25, 0, 0), &Room::feather0LookAtEyes },
+ { Action(ACTION_LOOK, 0x26, 0, 0), &Room::feather0LookAtEyes },
+ { Action(ACTION_LOOK, 0x27, 0, 0), &Room::feather0LookAtEyes },
+ { Action(ACTION_LOOK, 0x28, 0, 0), &Room::feather0LookAtEyes },
+ { Action(ACTION_LOOK, 0x29, 0, 0), &Room::feather0LookAtEyes },
+ { Action(ACTION_LOOK, 0x2a, 0, 0), &Room::feather0LookAtEyes },
+ { Action(ACTION_LOOK, 0x2b, 0, 0), &Room::feather0LookAtEyes },
+ { Action(ACTION_LOOK, 0x2c, 0, 0), &Room::feather0LookAtTree },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::feather0LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::feather0LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::feather0LookAtRedshirt },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::feather0TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::feather0TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::feather0TalkToRedshirt },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::feather0UseSTricorderOnQuetzecoatl },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::feather0UseSTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::feather0UseMTricorderOnQuetzecoatl },
+};
+
+RoomAction feather1ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::feather1Tick1 },
+};
+
+RoomAction feather2ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::feather2Tick1 },
+};
+
+RoomAction feather3ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::feather3Tick1 },
+};
+
+RoomAction feather4ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::feather4Tick1 },
+};
+
+RoomAction feather5ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::feather5Tick1 },
+};
+
+RoomAction feather6ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::feather6Tick1 },
+};
+
+RoomAction feather7ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::feather7Tick1 },
+};
+
}
#endif
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index cec83ab..db66401 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -83,7 +83,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxVar6 = 0;
_textboxHasMultipleChoices = false;
- _missionToLoad = "MUDD";
+ _missionToLoad = "FEATHER";
_roomIndexToLoad = 0;
for (int i = 0; i < NUM_OBJECTS; i++)
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index cc257d2..f083187 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -103,6 +103,9 @@ enum GameStringIDs {
TX_SPEAKER_BUCHERT,
TX_SPEAKER_MUDD,
+ TX_SPEAKER_STRAGEY,
+ TX_SPEAKER_QUETZECOATL,
+
TX_BRIDU146,
TX_G_024,
@@ -1588,6 +1591,53 @@ enum GameStringIDs {
TX_MUD5N105,
+ // MISSING
+ TX_FEA0_002,
+ TX_FEA0_003,
+ TX_FEA0_004,
+ TX_FEA0_005,
+ TX_FEA0_006,
+ TX_FEA0_007,
+ TX_FEA0_008,
+ TX_FEA0_009,
+ TX_FEA0_010,
+ TX_FEA0_011,
+ TX_FEA0_012,
+ TX_FEA0_013,
+ TX_FEA0_014,
+ TX_FEA0_015,
+ TX_FEA0_016,
+ TX_FEA0_017,
+ TX_FEA0_018,
+ TX_FEA0_019,
+ TX_FEA0_020,
+ TX_FEA0_021,
+ TX_FEA0_022,
+ TX_FEA0_023,
+ TX_FEA0_024,
+ TX_FEA0_025,
+ TX_FEA0_026,
+ TX_FEA0_027,
+ TX_FEA0_028,
+ TX_FEA0_029,
+ TX_FEA0_030,
+ TX_FEA0_031,
+ TX_FEA0_032,
+ TX_FEA0_033,
+ TX_FEA0_101,
+ TX_FEA0_108,
+ TX_FEA0N000,
+ TX_FEA0N001,
+ TX_FEA0N002,
+ TX_FEA0N003,
+ TX_FEA0N004,
+ TX_FEA0N005,
+ TX_FEA0N006,
+ TX_FEA0N007,
+ TX_FEA0N008,
+ TX_FEA0N009,
+
+
TX_SIN3_012,
@@ -1642,6 +1692,9 @@ const char * const g_gameStrings[] = {
"Lt. Buchert",
"Harry Mudd",
+ "Lt. Stragey",
+ "Quetzecoatl",
+
"#BRID\\BRIDU146#Nothing to report, Captain.",
"#GENE\\G_024#Fascinating.",
@@ -3117,6 +3170,52 @@ const char * const g_gameStrings[] = {
"#MUD5\\MUD5N105#Life support fails completely and you fall unconscious.",
+ "#FEA0\\FEA0_002#And exactly what would you have done with them? Entering Klingon space for anything puts the peace in peril.",
+ "#FEA0\\FEA0_003#And then your followers were destroyed because when white men arrived on that continent, they were believed to be you in your promised return. Your people perverted your teachings, then were destroyed by it.",
+ "#FEA0\\FEA0_004#Damned right the results were swift. The Klingons have been raiding colonies looking for you.",
+ "#FEA0\\FEA0_005#Ha! You mean your followers love pieces! They slaughtered other believers hoping you'd return.",
+ "#FEA0\\FEA0_006#I am Captain James T. Kirk of the Starship Enterprise. Did you know the Klingons are looking for you?",
+ "#FEA0\\FEA0_007#I am Captain James T. Kirk of the Starship Enterprise. What did you do to get the Klingons so upset?",
+ "#FEA0\\FEA0_008#Listen, the Klingons are ripping colonies apart to find you, so stop this nonsense. This is serious.",
+ "#FEA0\\FEA0_009#Listen, Mister, any missions conducted within Klingon space fully jeopardize the peace.",
+ "#FEA0\\FEA0_010#Quetzecoatl? How fitting you would name yourself after one of the most bloody-handed gods in Earth's history.",
+ "#FEA0\\FEA0_011#We're not your children and we don't appreciate this wild goose chase you've forced us into.",
+ "#FEA0\\FEA0_012#Whatever you did has them very upset. They're raiding worlds looking for you.",
+ "#FEA0\\FEA0_013#Your followers regularly sacrificed other believers to you after you left, offering you their still-beating hearts.",
+ "#FEA0\\FEA0_014#Your people? We represent all of the Earth's people and we certainly do not recognize you.",
+ "#FEA0\\FEA0_015#He appears human... All life signs are normal, but I'm getting strange energy readings near the base of his pituitary gland.",
+ "#FEA0\\FEA0_016#Ouch!",
+ "#FEA0\\FEA0_017#Jim, that man is dressed in ancient Aztec clothing.",
+ "#FEA0\\FEA0_018#What do you know about Earth culture? He looks like an ancient Aztec!",
+ "#FEA0\\FEA0_019#I am picking up multiple life forms in the surrounding region, Captain.",
+ "#FEA0\\FEA0_020#I am picking up strange energy readings from the alien. Perhaps Doctor McCoy could provide better data.",
+ "#FEA0\\FEA0_021#I believe you are mistaken, doctor. His clothing bears a distinct resemblance to fashions of a much later period.",
+ "#FEA0\\FEA0_022#The humanoid's adornments appear similar to those worn by leaders of Earth's early 20th century inhabitants of the South American continent.",
+ "#FEA0\\FEA0_023#I'm just a security officer, sir.",
+ "#FEA0\\FEA0_024#I am Quetzecoatl. I elevated a civilization on your world from barbarism to sentience. You are a perversion of that process. Be gone!",
+ "#FEA0\\FEA0_025#You dare fire at a god?",
+ "#FEA0\\FEA0_026#Bloody-handed? My people love peace!",
+ "#FEA0\\FEA0_027#Foul lying creatures, my gift was wasted upon you! Begone.",
+ "#FEA0\\FEA0_028#Greetings, my children. I can barely imagine that you have come so far.",
+ "#FEA0\\FEA0_029#Impossible! You must be lying!",
+ "#FEA0\\FEA0_030#Jeopardize the peace? Hardly. Peace is what I preach. I am Quetzecoatl, as you well know from the proud history of your world.",
+ "#FEA0\\FEA0_031#Quaint expression. I have done nothing to anger them. I did with them what I have done with everyone.",
+ "#FEA0\\FEA0_032#The Klingons? Amazing! This is the first time one of my missions has produced results so swiftly.",
+ "#FEA0\\FEA0_033#Who are you? I know you come from Terrasol, but you are not of my people. What goes on here?",
+ "#FEA0\\FEA0_101#No, you must be lying. They could not be raiding if they are looking for me. Violence was not the message of any of my missions. I, Quetzecoatl, preach universal brotherhood and peace.",
+ "#FEA0\\FEA0_108#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#FEA0\\FEA0N000#Feral red eyes glare out of the dark at you.",
+ "#FEA0\\FEA0N001#It looks like the jungle has grown up into a small hut.",
+ "#FEA0\\FEA0N002#Lt. Stragey is carefully eyeing the humanoid.",
+ "#FEA0\\FEA0N003#Luminescent insects swarm near a large tree.",
+ "#FEA0\\FEA0N004#McCoy is fidgeting around.",
+ "#FEA0\\FEA0N005#Spock is analyzing the surroundings.",
+ "#FEA0\\FEA0N006#The log appears sturdy enough to cross.",
+ "#FEA0\\FEA0N007#The moon of Digifal. Legend says that the gods of good and evil fortune live there and will glance back at those who look at them, and either a miracle or a catastrophe will soon befall those who gaze upon it.",
+ "#FEA0\\FEA0N008#There is a tall, slender, dark haired man looking intently at you.",
+ "#FEA0\\FEA0N009#You see dense vegetation in all directions.",
+
+
"#SIN3\\SIN3_012#Can't say I like the decor.",
Commit: 051ea8c238510db03505cd146025c1db441ace84
https://github.com/scummvm/scummvm/commit/051ea8c238510db03505cd146025c1db441ace84
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: FEATHER1
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/feather1.cpp
engines/startrek/rooms/function_map.h
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index daf2895..8ae11d4 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -120,7 +120,7 @@ void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) {
memset(_awayMission.crewDirectionsAfterWalk, 0xff, 4);
switch (warpEntryIndex) {
- case 0: // 0-3: Read warp positions from RDF file
+ case 0: // 0-3: Crew spawns in a spot and walks to a spot.
case 1:
case 2:
case 3:
@@ -155,9 +155,19 @@ void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) {
playSoundEffectIndex(0x09);
_warpHotspotsActive = false;
break;
- case 5:
+ case 5: // Crew spawns in directly at a position.
+ for (int i = 0; i < (_awayMission.redshirtDead ? 3 : 4); i++) {
+ Common::String animFilename = getCrewmanAnimFilename(i, "stnds");
+ Common::Point warpPos = _room->getSpawnPosition(i);
+ loadActorAnimWithRoomScaling(i, animFilename, warpPos.x, warpPos.y);
+ }
+ _warpHotspotsActive = true;
break;
case 6:
+ error("initAwayCrewPositions(6) unimplemented");
+ break;
+ default:
+ warning("Invalid parameter (%d) to initAwayCrewPositions", warpEntryIndex);
break;
}
}
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 21b75f9..4c4d0bc 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -241,6 +241,18 @@ struct AwayMission {
bool repairedLifeSupportGenerator; // 0x59
int16 missionScore; // 0x5a
} mudd;
+
+ struct {
+ // 0: initial state
+ // 1: one rock thrown at it
+ // 2: two rocks thrown at it (low enough to climb up)
+ byte vineState; // 0x2a
+
+ bool gotRock; // 0x2b
+ bool gotSnake; // 0x2c
+ bool holeBlocked; // 0x31
+ int16 missionScore; // 0x36
+ } feather;
};
};
// Size: 0x129 bytes
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 1c467d3..0ce807b 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -137,7 +137,7 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
}
else if (name == "FEATHER1") {
_roomActionList = feather1ActionList;
- _numRoomActions = sizeof(feather1ActionList) / sizeof(RoomAction);
+ _numRoomActions = feather1NumActions;
}
else if (name == "FEATHER2") {
_roomActionList = feather2ActionList;
@@ -180,7 +180,7 @@ uint16 Room::readRdfWord(int offset) {
}
bool Room::actionHasCode(const Action &action) {
- RoomAction *roomActionPtr = _roomActionList;
+ const RoomAction *roomActionPtr = _roomActionList;
int n = _numRoomActions;
while (n-- > 0) {
@@ -192,7 +192,7 @@ bool Room::actionHasCode(const Action &action) {
}
bool Room::handleAction(const Action &action) {
- RoomAction *roomActionPtr = _roomActionList;
+ const RoomAction *roomActionPtr = _roomActionList;
int n = _numRoomActions;
while (n-- > 0) {
@@ -208,7 +208,7 @@ bool Room::handleAction(const Action &action) {
}
bool Room::handleActionWithBitmask(const Action &action) {
- RoomAction *roomActionPtr = _roomActionList;
+ const RoomAction *roomActionPtr = _roomActionList;
int n = _numRoomActions;
while (n-- > 0) {
@@ -225,10 +225,14 @@ bool Room::handleActionWithBitmask(const Action &action) {
}
Common::Point Room::getBeamInPosition(int crewmanIndex) {
- int base = 0xaa + crewmanIndex * 4;
+ int base = RDF_BEAM_IN_POSITIONS + crewmanIndex * 4;
return Common::Point(readRdfWord(base), readRdfWord(base + 2));
}
+Common::Point Room::getSpawnPosition(int crewmanIndex) {
+ int base = RDF_SPAWN_POSITIONS + crewmanIndex * 4;
+ return Common::Point(readRdfWord(base), readRdfWord(base + 2));
+}
// For actions of type ACTION_FINISHED_ANIMATION or ACTION_FINISHED_WALKING, this takes
// a function pointer and returns the index corresponding to that callback.
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 2b5f95c..bd6d7d9 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -49,6 +49,7 @@ struct RoomAction {
const int RDF_WARP_ROOM_INDICES = 0x22;
const int RDF_ROOM_ENTRY_POSITIONS = 0x2a;
const int RDF_BEAM_IN_POSITIONS = 0xaa;
+const int RDF_SPAWN_POSITIONS = 0xba;
class Room {
@@ -85,6 +86,10 @@ public:
uint16 getDoorPolygonEndOffset() { return readRdfWord(0x1c); }
Common::Point getBeamInPosition(int crewmanIndex);
+ // This is analagous to above, but instead of beaming in, they just appear in a spot.
+ // Used sparingly, ie. in feather's serpent when appearing in cave after Quetzecoatl
+ // warps the crew.
+ Common::Point getSpawnPosition(int crewmanIndex);
public:
byte *_rdfData;
@@ -92,7 +97,7 @@ public:
private:
StarTrekEngine *_vm;
- RoomAction *_roomActionList;
+ const RoomAction *_roomActionList;
int _numRoomActions;
int _roomIndex; // ie. for DEMON2, this is 2
@@ -131,8 +136,8 @@ private:
// If "changeDirection" is true, they remain facing that direction even after their
// animation is finished. The game is inconsistent about doing this.
- void spockScan(int direction, TextRef text, bool changeDirection);
- void mccoyScan(int direction, TextRef text, bool changeDirection);
+ void spockScan(int direction, TextRef text, bool changeDirection = false);
+ void mccoyScan(int direction, TextRef text, bool changeDirection = false);
// Room-specific code
public:
@@ -1408,6 +1413,88 @@ public:
// FEATHER1
void feather1Tick1();
+ void feather1Tick45();
+ void feather1Tick85();
+ void feather1Tick95();
+ void feather1QuetzecoatlDisappeared();
+ void feather1GetRightVine();
+ void feather1GetLeftVine();
+ void feather1GetRocks();
+ void feather1ReachedRocks();
+ void feather1PickedUpRocks();
+ void feather1GetSnake();
+ void feather1ReachedSnake();
+ void feather1Timer1Expired();
+ void feather1Timer2Expired();
+ void feather1PickedUpSnake();
+ void feather1Timer0Expired();
+ void feather1UseCommunicator();
+ void feather1UseRockOnHole();
+ void feather1ReachedHole();
+ void feather1Timer3Expired();
+ void feather1PutRockInHole();
+ void feather1UseSnakeOnLeftVine();
+ void feather1UseSnakeOnSpock();
+ void feather1UseSnakeOnKirk();
+ void feather1UseSnakeOnMccoy();
+ void feather1UseSnakeOnRedshirt();
+ void feather1UseRockOnSnake();
+ void feather1UseSpockOnSnake();
+ void feather1UseMccoyOnSnake();
+ void feather1UseRedshirtOnSnake();
+ void feather1UseSpockOnHole();
+ void feather1UseMccoyOnHole();
+ void feather1UseRedshirtOnHole();
+ void feather1UseRockOnMoss();
+ void feather1UseRockOnSpock();
+ void feather1UseRockOnMccoy();
+ void feather1UseRockOnRedshirt();
+ void feather1UseSpockOnMoss();
+ void feather1UseMccoyOnMoss();
+ void feather1UseRedshirtOnMoss();
+ void feather1UseRockOnLeftVine();
+ void feather1ReadyToThrowRock1();
+ void feather1ThrewRock1();
+ void feather1ReadyToThrowRock2();
+ void feather1ThrewRock2();
+ void feather1UseSpockOnVine();
+ void feather1UseMccoyOnVine();
+ void feather1UseRedshirtOnVine();
+ void feather1UseKirkOnVine();
+ void feather1CrewmanClimbVine();
+ void feather1ReachedVineToClimbUp();
+ void feather1ClimbedUpVine();
+ void feather1ReachedVineToClimbDown();
+ void feather1ClimbedDownVine();
+ void feather1UsePhaser();
+ void feather1UseSTricorderOnRightVine();
+ void feather1UseSTricorderOnSnake();
+ void feather1UseSTricorderOnMoss();
+ void feather1UseSTricorderOnHole();
+ void feather1UseSTricorderAnywhere();
+ void feather1UseSTricorderOnRocks();
+ void feather1UseMTricorderOnVine();
+ void feather1UseMTricorderOnMoss();
+ void feather1UseMTricorderOnHole();
+ void feather1UseMTricorderOnSnake();
+ void feather1UseMedkit();
+ void feather1TalkToMccoy();
+ void feather1TalkToSpock();
+ void feather1TalkToRedshirt();
+ void feather1WalkToExit();
+ void feather1LookAnywhere();
+ void feather1LookAtSnake();
+ void feather1LookAtRightVine();
+ void feather1LookAtHole();
+ void feather1LookAtMoss();
+ void feather1LookAtRocks();
+ void feather1LookAtLight();
+ void feather1LookAtEyes();
+ void feather1LookAtKirk();
+ void feather1LookAtSpock();
+ void feather1LookAtMccoy();
+ void feather1LookAtRedshirt();
+ void feather1LookAtLeftVine();
// FEATHER2
void feather2Tick1();
@@ -1546,6 +1633,18 @@ private:
byte walkingToDoor;
} mudd;
+ struct {
+ // feather1
+ byte snakeInHole; // 0xca
+ bool scannedSnake; // 0xcb
+ bool crewEscaped[4]; // 0xcc
+ byte kirkEscaped; // 0xcc
+ byte spockEscaped; // 0xcd
+ byte mccoyEscaped; // 0xce
+ byte cf; // 0xcf
+ byte crewmanClimbingVine;
+ } feather;
+
} _roomVar;
};
diff --git a/engines/startrek/rooms/feather1.cpp b/engines/startrek/rooms/feather1.cpp
index ac4f147..488244e 100644
--- a/engines/startrek/rooms/feather1.cpp
+++ b/engines/startrek/rooms/feather1.cpp
@@ -22,14 +22,655 @@
#include "startrek/room.h"
-#define OBJECT_8 8
+#define OBJECT_QUETZECOATL 8
+#define OBJECT_LEFT_VINE 9
+#define OBJECT_SNAKE 10
+#define OBJECT_THROWN_ROCK 11
+#define OBJECT_ROCK_IN_HOLE 12
-#define HOTSPOT_20 0x20
+#define HOTSPOT_ROCKS 0x20
+#define HOTSPOT_HOLE 0x21
+#define HOTSPOT_MOSS 0x22
+#define HOTSPOT_RIGHT_VINE 0x23
+#define HOTSPOT_LIGHT 0x24
+#define HOTSPOT_EYES_1 0x25
+#define HOTSPOT_EYES_2 0x26
+#define HOTSPOT_EYES_3 0x27
+#define HOTSPOT_EXIT 0x28
+
+// Positions where crewmen walk to when climbing up or down the vine
+#define VINE_TOP_X 0xcc
+#define VINE_TOP_Y 0x30
+#define VINE_BOT_X 0xc3
+#define VINE_BOT_Y 0xc7
namespace StarTrek {
+extern const RoomAction feather1ActionList[] = {
+ { Action(ACTION_TICK, 1, 0, 0), &Room::feather1Tick1 },
+ { Action(ACTION_TICK, 45, 0, 0), &Room::feather1Tick45 },
+ { Action(ACTION_TICK, 85, 0, 0), &Room::feather1Tick85 },
+ { Action(ACTION_TICK, 95, 0, 0), &Room::feather1Tick95 },
+ { Action(ACTION_FINISHED_ANIMATION, 18, 0, 0), &Room::feather1QuetzecoatlDisappeared },
+ { Action(ACTION_GET, HOTSPOT_RIGHT_VINE, 0, 0), &Room::feather1GetRightVine },
+ { Action(ACTION_GET, OBJECT_LEFT_VINE, 0, 0), &Room::feather1GetLeftVine },
+ { Action(ACTION_GET, HOTSPOT_ROCKS, 0, 0), &Room::feather1GetRocks },
+ { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::feather1ReachedRocks },
+ { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::feather1PickedUpRocks },
+ { Action(ACTION_GET, OBJECT_SNAKE, 0, 0), &Room::feather1GetSnake },
+ { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::feather1ReachedSnake },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::feather1Timer1Expired },
+ { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::feather1Timer2Expired },
+ { Action(ACTION_FINISHED_ANIMATION, 8, 0, 0), &Room::feather1PickedUpSnake },
+ { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::feather1Timer0Expired },
+ { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::feather1UseCommunicator },
+ { Action(ACTION_USE, OBJECT_IROCK, HOTSPOT_HOLE, 0), &Room::feather1UseRockOnHole },
+ { Action(ACTION_FINISHED_WALKING, 9, 0, 0), &Room::feather1ReachedHole },
+ { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::feather1Timer3Expired },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::feather1PutRockInHole },
+ { Action(ACTION_USE, OBJECT_ISNAKE, OBJECT_LEFT_VINE, 0), &Room::feather1UseSnakeOnLeftVine },
+ { Action(ACTION_USE, OBJECT_ISNAKE, OBJECT_SPOCK, 0), &Room::feather1UseSnakeOnSpock },
+ { Action(ACTION_USE, OBJECT_ISNAKE, OBJECT_KIRK, 0), &Room::feather1UseSnakeOnKirk },
+ { Action(ACTION_USE, OBJECT_ISNAKE, OBJECT_MCCOY, 0), &Room::feather1UseSnakeOnMccoy },
+ { Action(ACTION_USE, OBJECT_ISNAKE, OBJECT_REDSHIRT, 0), &Room::feather1UseSnakeOnRedshirt },
+ { Action(ACTION_USE, OBJECT_IROCK, OBJECT_SNAKE, 0), &Room::feather1UseRockOnSnake },
+ { Action(ACTION_USE, OBJECT_SPOCK, OBJECT_SNAKE, 0), &Room::feather1UseSpockOnSnake },
+ { Action(ACTION_USE, OBJECT_MCCOY, OBJECT_SNAKE, 0), &Room::feather1UseMccoyOnSnake },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, OBJECT_SNAKE, 0), &Room::feather1UseRedshirtOnSnake },
+ { Action(ACTION_USE, OBJECT_SPOCK, HOTSPOT_HOLE, 0), &Room::feather1UseSpockOnHole },
+ { Action(ACTION_USE, OBJECT_MCCOY, HOTSPOT_HOLE, 0), &Room::feather1UseMccoyOnHole },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_HOLE, 0), &Room::feather1UseRedshirtOnHole },
+ { Action(ACTION_USE, OBJECT_IROCK, HOTSPOT_MOSS, 0), &Room::feather1UseRockOnMoss },
+ { Action(ACTION_USE, OBJECT_IROCK, OBJECT_SPOCK, 0), &Room::feather1UseRockOnSpock },
+ { Action(ACTION_USE, OBJECT_IROCK, OBJECT_MCCOY, 0), &Room::feather1UseRockOnMccoy },
+ { Action(ACTION_USE, OBJECT_IROCK, OBJECT_REDSHIRT, 0), &Room::feather1UseRockOnRedshirt },
+ { Action(ACTION_USE, OBJECT_SPOCK, HOTSPOT_MOSS, 0), &Room::feather1UseSpockOnMoss },
+ { Action(ACTION_USE, OBJECT_MCCOY, HOTSPOT_MOSS, 0), &Room::feather1UseMccoyOnMoss },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_MOSS, 0), &Room::feather1UseRedshirtOnMoss },
+ { Action(ACTION_USE, OBJECT_IROCK, OBJECT_LEFT_VINE, 0), &Room::feather1UseRockOnLeftVine },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::feather1ReadyToThrowRock1 },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::feather1ThrewRock1 },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::feather1ReadyToThrowRock2 },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::feather1ThrewRock2 },
+
+ { Action(ACTION_USE, OBJECT_SPOCK, OBJECT_LEFT_VINE, 0), &Room::feather1UseSpockOnVine },
+ { Action(ACTION_USE, OBJECT_SPOCK, HOTSPOT_RIGHT_VINE, 0), &Room::feather1UseSpockOnVine },
+ { Action(ACTION_USE, OBJECT_MCCOY, OBJECT_LEFT_VINE, 0), &Room::feather1UseMccoyOnVine },
+ { Action(ACTION_USE, OBJECT_MCCOY, HOTSPOT_RIGHT_VINE, 0), &Room::feather1UseMccoyOnVine },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, OBJECT_LEFT_VINE, 0), &Room::feather1UseRedshirtOnVine },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_RIGHT_VINE, 0), &Room::feather1UseRedshirtOnVine },
+ { Action(ACTION_USE, OBJECT_KIRK, OBJECT_LEFT_VINE, 0), &Room::feather1UseKirkOnVine },
+ { Action(ACTION_USE, OBJECT_KIRK, HOTSPOT_RIGHT_VINE, 0), &Room::feather1UseKirkOnVine },
+ { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::feather1ReachedVineToClimbUp },
+ { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::feather1ClimbedUpVine },
+ { Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::feather1ReachedVineToClimbDown },
+ { Action(ACTION_FINISHED_ANIMATION, 10, 0, 0), &Room::feather1ClimbedDownVine },
+
+ { Action(ACTION_USE, OBJECT_IPHASERS, -1, 0), &Room::feather1UsePhaser },
+ { Action(ACTION_USE, OBJECT_IPHASERK, -1, 0), &Room::feather1UsePhaser },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_RIGHT_VINE, 0), &Room::feather1UseSTricorderOnRightVine },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, OBJECT_SNAKE, 0), &Room::feather1UseSTricorderOnSnake },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MOSS, 0), &Room::feather1UseSTricorderOnMoss },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_HOLE, 0), &Room::feather1UseSTricorderOnHole },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::feather1UseSTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_ROCKS, 0), &Room::feather1UseSTricorderOnRocks },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_LEFT_VINE, 0), &Room::feather1UseMTricorderOnVine },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_RIGHT_VINE, 0), &Room::feather1UseMTricorderOnVine },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_MOSS, 0), &Room::feather1UseMTricorderOnMoss },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_HOLE, 0), &Room::feather1UseMTricorderOnHole },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_SNAKE, 0), &Room::feather1UseMTricorderOnSnake },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::feather1UseMedkit },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::feather1TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::feather1TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::feather1TalkToRedshirt },
+ { Action(ACTION_WALK, HOTSPOT_EXIT, 0, 0), &Room::feather1WalkToExit },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::feather1LookAnywhere },
+ { Action(ACTION_LOOK, OBJECT_SNAKE, 0, 0), &Room::feather1LookAtSnake },
+ { Action(ACTION_LOOK, HOTSPOT_RIGHT_VINE, 0, 0), &Room::feather1LookAtRightVine },
+ { Action(ACTION_LOOK, HOTSPOT_HOLE, 0, 0), &Room::feather1LookAtHole },
+ { Action(ACTION_LOOK, HOTSPOT_MOSS, 0, 0), &Room::feather1LookAtMoss },
+ { Action(ACTION_LOOK, HOTSPOT_ROCKS, 0, 0), &Room::feather1LookAtRocks },
+ { Action(ACTION_LOOK, HOTSPOT_LIGHT, 0, 0), &Room::feather1LookAtLight },
+ { Action(ACTION_LOOK, HOTSPOT_EYES_1, 0, 0), &Room::feather1LookAtEyes },
+ { Action(ACTION_LOOK, HOTSPOT_EYES_2, 0, 0), &Room::feather1LookAtEyes },
+ { Action(ACTION_LOOK, HOTSPOT_EYES_3, 0, 0), &Room::feather1LookAtEyes },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::feather1LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::feather1LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::feather1LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::feather1LookAtRedshirt },
+ { Action(ACTION_LOOK, OBJECT_LEFT_VINE, 0, 0), &Room::feather1LookAtLeftVine },
+};
+
+extern const int feather1NumActions = sizeof(feather1ActionList) / sizeof(RoomAction);
+
+
void Room::feather1Tick1() {
+ playVoc("FEA1LOOP");
+ playMidiMusicTracks(27);
+
+ if (_vm->_awayMission.feather.vineState == 0)
+ _vm->_awayMission.disableInput = true;
+
+ if (!_vm->_awayMission.feather.gotSnake)
+ loadActorAnim(OBJECT_SNAKE, "s5r1so", 0x9c, 0xc1);
+ if (_vm->_awayMission.feather.vineState == 0)
+ loadActorAnim(OBJECT_LEFT_VINE, "s5r1v0", 0xa0, 0x23);
+ else {
+ _roomVar.feather.crewEscaped[OBJECT_KIRK] = true;
+ _roomVar.feather.crewEscaped[OBJECT_SPOCK] = true;
+ _roomVar.feather.crewEscaped[OBJECT_MCCOY] = true;
+ _roomVar.feather.crewEscaped[OBJECT_REDSHIRT] = true;
+ loadActorAnim(OBJECT_LEFT_VINE, "s5r1v4", 0xa0, 0x23);
+ }
+}
+
+void Room::feather1Tick45() {
+ if (_vm->_awayMission.feather.vineState == 0) {
+ playVoc("LD3MAGAP");
+ loadActorAnim(OBJECT_QUETZECOATL, "s5r1qa", 0xb4, 0x32);
+ }
+}
+
+void Room::feather1Tick85() {
+ if (_vm->_awayMission.feather.vineState == 0)
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA1_057);
+}
+
+void Room::feather1Tick95() {
+ if (_vm->_awayMission.feather.vineState == 0) {
+ playVoc("LD3MAGDI");
+ loadActorAnimC(OBJECT_QUETZECOATL, "s5r1qd", -1, -1, &Room::feather1QuetzecoatlDisappeared);
+ }
+}
+
+void Room::feather1QuetzecoatlDisappeared() {
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::feather1GetRightVine() {
+ showText(TX_FEA1N008);
+}
+
+void Room::feather1GetLeftVine() {
+ if (_vm->_awayMission.feather.vineState == 0)
+ showText(TX_FEA1N009);
+ else
+ showText(TX_FEA1N008);
+}
+
+void Room::feather1GetRocks() {
+ if (_roomVar.feather.crewEscaped[OBJECT_KIRK])
+ showText(TX_FEA1N021);
+ else if (_vm->_awayMission.feather.gotRock)
+ showText(TX_FEA1N019);
+ else {
+ walkCrewmanC(OBJECT_KIRK, 0x90, 0xb6, &Room::feather1ReachedRocks);
+ _vm->_awayMission.disableInput = true;
+ }
+}
+
+void Room::feather1ReachedRocks() {
+ loadActorAnimC(OBJECT_KIRK, "s5r1kg", -1, -1, &Room::feather1PickedUpRocks);
+}
+
+void Room::feather1PickedUpRocks() {
+ _vm->_awayMission.disableInput = false;
+ loadActorStandAnim(OBJECT_KIRK);
+ giveItem(OBJECT_IROCK);
+ showText(TX_FEA1N022);
+ _vm->_awayMission.feather.gotRock = true;
+}
+
+void Room::feather1GetSnake() {
+ // BUG: Infinite score mechanism. Just keep trying and failing to get the snake.
+ _vm->_awayMission.feather.missionScore++;
+
+ if (!_roomVar.feather.crewEscaped[OBJECT_KIRK]) {
+ walkCrewmanC(OBJECT_KIRK, 0x90, 0xbe, &Room::feather1ReachedSnake);
+ _vm->_awayMission.disableInput = true;
+ } else
+ showText(TX_FEA1N021);
+}
+
+void Room::feather1ReachedSnake() {
+ // NOTE: There are two pieces of unused text that could fit here.
+ // TX_FEA1N007: "The snake darts back into its hole"
+ // TX_FEA1N018: "With nowhere for the snake to go, you capture it"
+
+ loadActorAnimC(OBJECT_KIRK, "s5r1kg", -1, -1, &Room::feather1PickedUpSnake);
+ if (_vm->_awayMission.feather.holeBlocked)
+ _vm->_awayMission.timers[1] = 20;
+ else
+ _vm->_awayMission.timers[2] = 6;
+}
+
+void Room::feather1Timer1Expired() {
+ giveItem(OBJECT_ISNAKE);
+ loadActorStandAnim(OBJECT_SNAKE);
+ _vm->_awayMission.feather.gotSnake = true;
+}
+
+void Room::feather1Timer2Expired() { // Snake retreats into hole
+ loadActorAnim2(OBJECT_SNAKE, "s5r1si");
+ _vm->_awayMission.timers[0] = 80;
+ _roomVar.feather.snakeInHole = true;
+}
+
+void Room::feather1PickedUpSnake() {
+ _vm->_awayMission.disableInput = false;
+ loadActorStandAnim(OBJECT_KIRK);
+}
+
+void Room::feather1Timer0Expired() { // Snake comes back out of hole
+ loadActorAnim2(OBJECT_SNAKE, "s5r1so");
+ _roomVar.feather.snakeInHole = false;
+}
+
+void Room::feather1UseCommunicator() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA1_023);
+}
+
+void Room::feather1UseRockOnHole() {
+ if (_roomVar.feather.crewEscaped[OBJECT_KIRK])
+ showText(TX_FEA1N021);
+ else if (_vm->_awayMission.feather.holeBlocked)
+ showText(TX_FEA1N005);
+ else {
+ _vm->_awayMission.feather.missionScore++;
+ walkCrewmanC(OBJECT_KIRK, 0xa3, 0xb6, &Room::feather1ReachedHole);
+ _vm->_awayMission.disableInput = true;
+ if (_roomVar.feather.snakeInHole)
+ _vm->_awayMission.timers[0] = 12;
+ }
+}
+
+void Room::feather1ReachedHole() {
+ loadActorAnimC(OBJECT_KIRK, "s5r1kg", -1, -1, &Room::feather1PutRockInHole);
+ _vm->_awayMission.timers[3] = 18;
+}
+
+void Room::feather1Timer3Expired() {
+ loadActorAnim(OBJECT_ROCK_IN_HOLE, "s5r1rk", 0xad, 0xba);
+ _vm->_awayMission.feather.holeBlocked = true;
+}
+
+void Room::feather1PutRockInHole() {
+ _vm->_awayMission.disableInput = false;
+ loadActorStandAnim(OBJECT_KIRK);
+}
+
+void Room::feather1UseSnakeOnLeftVine() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA1_037);
+}
+
+void Room::feather1UseSnakeOnSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA1_041);
+ showText(TX_SPEAKER_KIRK, TX_FEA1_001);
+ showText(TX_SPEAKER_MCCOY, TX_FEA1_018);
+}
+
+void Room::feather1UseSnakeOnKirk() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA1_026);
+}
+
+void Room::feather1UseSnakeOnMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA1_F25);
+}
+
+void Room::feather1UseSnakeOnRedshirt() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA1_050);
+}
+
+void Room::feather1UseRockOnSnake() {
+ if (!_vm->_awayMission.feather.gotSnake) {
+ loadActorAnim2(OBJECT_SNAKE, "s5r1si");
+ _vm->_awayMission.timers[0] = 80;
+ _roomVar.feather.snakeInHole = true;
+ showText(TX_SPEAKER_SPOCK, TX_FEA1_034); // BUGFIX: speaker is Spock, not Stragey
+ }
+}
+
+void Room::feather1UseSpockOnSnake() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA1_035);
+}
+
+void Room::feather1UseMccoyOnSnake() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA1_005);
+}
+
+void Room::feather1UseRedshirtOnSnake() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA1_046);
+}
+
+void Room::feather1UseSpockOnHole() {
+ if (_roomVar.feather.snakeInHole)
+ showText(TX_SPEAKER_SPOCK, TX_FEA1_025);
+ else
+ showText(TX_SPEAKER_SPOCK, TX_FEA1_027);
+}
+
+void Room::feather1UseMccoyOnHole() {
+ if (_roomVar.feather.snakeInHole)
+ showText(TX_SPEAKER_MCCOY, TX_FEA1_004);
+ else
+ showText(TX_SPEAKER_MCCOY, TX_FEA1_010);
+}
+
+void Room::feather1UseRedshirtOnHole() {
+ if (_roomVar.feather.snakeInHole)
+ showText(TX_SPEAKER_STRAGEY, TX_FEA1_047);
+ else
+ showText(TX_SPEAKER_STRAGEY, TX_FEA1_051);
+}
+
+void Room::feather1UseRockOnMoss() {
+ showText(TX_FEA1N006);
+}
+
+void Room::feather1UseRockOnSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA1_032);
+}
+
+void Room::feather1UseRockOnMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA1_009);
+}
+
+void Room::feather1UseRockOnRedshirt() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA1_045);
+}
+
+void Room::feather1UseSpockOnMoss() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA1_033);
+}
+
+void Room::feather1UseMccoyOnMoss() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA1_015);
+}
+
+void Room::feather1UseRedshirtOnMoss() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA1_049);
+}
+
+void Room::feather1UseRockOnLeftVine() {
+ if (_vm->_awayMission.feather.vineState == 0) {
+ _vm->_awayMission.feather.vineState++;
+ _vm->_awayMission.disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x7a, 0xb6, &Room::feather1ReadyToThrowRock1);
+ } else if (_vm->_awayMission.feather.vineState == 1) {
+ _vm->_awayMission.feather.vineState++;
+ _vm->_awayMission.disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0xa2, 0xb9, &Room::feather1ReadyToThrowRock2);
+ }
+}
+
+void Room::feather1ReadyToThrowRock1() {
+ loadActorAnimC(OBJECT_KIRK, "s5r1kt", -1, -1, &Room::feather1ThrewRock1);
+ loadActorAnim2(OBJECT_LEFT_VINE, "s5r1v2");
+ loadActorAnim(OBJECT_THROWN_ROCK, "s5r1ru", 0x81, 0x6d);
+ playVoc("THROWROC");
+}
+
+void Room::feather1ThrewRock1() {
+ _vm->_awayMission.disableInput = false;
+ loadActorStandAnim(OBJECT_KIRK);
+
+ showText(TX_SPEAKER_SPOCK, TX_FEA1_042);
+ showText(TX_SPEAKER_MCCOY, TX_FEA1_017);
+ showText(TX_SPEAKER_STRAGEY, TX_FEA1_054);
+}
+
+void Room::feather1ReadyToThrowRock2() {
+ loadActorAnimC(OBJECT_KIRK, "s5r1kt", -1, -1, &Room::feather1ThrewRock2);
+ loadActorAnim2(OBJECT_LEFT_VINE, "s5r1v3");
+ loadActorAnim(OBJECT_THROWN_ROCK, "s5r1ru", 0xa3, 0x70);
+ playVoc("THROWROC");
+}
+
+void Room::feather1ThrewRock2() {
+ _vm->_awayMission.feather.missionScore += 6;
+ loadActorStandAnim(OBJECT_KIRK);
+ _vm->_awayMission.disableInput = false;
+
+ showText(TX_SPEAKER_SPOCK, TX_FEA1_043);
+ showText(TX_SPEAKER_MCCOY, TX_FEA1_021);
+ showText(TX_SPEAKER_STRAGEY, TX_FEA1_053);
+}
+
+
+void Room::feather1UseSpockOnVine() {
+ if (_vm->_awayMission.feather.vineState == 2) {
+ _roomVar.feather.crewmanClimbingVine = OBJECT_SPOCK;
+ feather1CrewmanClimbVine();
+ } else
+ showText(TX_SPEAKER_SPOCK, TX_FEA1_A46);
+}
+
+void Room::feather1UseMccoyOnVine() {
+ if (_vm->_awayMission.feather.vineState == 2) {
+ _roomVar.feather.crewmanClimbingVine = OBJECT_MCCOY;
+ feather1CrewmanClimbVine();
+ } else
+ showText(TX_SPEAKER_MCCOY, TX_FEA1_013);
+}
+
+void Room::feather1UseRedshirtOnVine() {
+ if (_vm->_awayMission.feather.vineState == 2) {
+ _roomVar.feather.crewmanClimbingVine = OBJECT_REDSHIRT;
+ feather1CrewmanClimbVine();
+ } else
+ showText(TX_SPEAKER_STRAGEY, TX_FEA1_052);
+}
+
+void Room::feather1UseKirkOnVine() {
+ if (_vm->_awayMission.feather.vineState == 2) {
+ _roomVar.feather.crewmanClimbingVine = OBJECT_KIRK;
+ feather1CrewmanClimbVine();
+ } else
+ showText(TX_FEA1N010);
+}
+
+// This was refactored, due to the similarity of the code for each crewman. Originally, the
+// following 5 vine-climbing functions were repeated for each crewman.
+void Room::feather1CrewmanClimbVine() {
+ _vm->_awayMission.disableInput = true;
+ if (_roomVar.feather.crewEscaped[_roomVar.feather.crewmanClimbingVine])
+ walkCrewmanC(_roomVar.feather.crewmanClimbingVine, VINE_TOP_X, VINE_TOP_Y,
+ &Room::feather1ReachedVineToClimbDown);
+ else
+ walkCrewmanC(_roomVar.feather.crewmanClimbingVine, VINE_BOT_X, VINE_BOT_Y,
+ &Room::feather1ReachedVineToClimbUp);
+}
+
+void Room::feather1ReachedVineToClimbUp() {
+ const char *crew = "ksmr";
+ Common::String anim = "s5r1_c";
+ anim.setChar(crew[_roomVar.feather.crewmanClimbingVine], 4);
+ loadActorAnimC(_roomVar.feather.crewmanClimbingVine, anim, -1, -1, &Room::feather1ClimbedUpVine);
+}
+
+void Room::feather1ClimbedUpVine() {
+ _vm->_awayMission.disableInput = false;
+ _roomVar.feather.crewEscaped[_roomVar.feather.crewmanClimbingVine] = true;
+
+ Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.feather.crewmanClimbingVine, "stndw");
+ loadActorAnim2(_roomVar.feather.crewmanClimbingVine, anim, VINE_TOP_X, VINE_TOP_Y);
+
+ switch (_roomVar.feather.crewmanClimbingVine) {
+ case OBJECT_SPOCK:
+ walkCrewman(OBJECT_SPOCK, 0xaf, 0x30);
+ break;
+ case OBJECT_MCCOY:
+ walkCrewman(OBJECT_MCCOY, 0xbe, 0x30);
+ break;
+ case OBJECT_REDSHIRT:
+ walkCrewman(OBJECT_REDSHIRT, 0xca, 0x30);
+ break;
+ case OBJECT_KIRK:
+ walkCrewman(OBJECT_KIRK, 0xa0, 0x30);
+ break;
+ }
+}
+
+void Room::feather1ReachedVineToClimbDown() {
+ const char *crew = "ksmr";
+ Common::String anim = "s5r1_d";
+ anim.setChar(crew[_roomVar.feather.crewmanClimbingVine], 4);
+ loadActorAnimC(_roomVar.feather.crewmanClimbingVine, anim, VINE_BOT_X, VINE_BOT_Y, &Room::feather1ClimbedDownVine);
+}
+
+void Room::feather1ClimbedDownVine() {
+ _vm->_awayMission.disableInput = false;
+ _roomVar.feather.crewEscaped[_roomVar.feather.crewmanClimbingVine] = false;
+
+ Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.feather.crewmanClimbingVine, "stndw");
+ loadActorAnim2(_roomVar.feather.crewmanClimbingVine, anim, VINE_BOT_X, VINE_BOT_Y);
+
+ switch (_roomVar.feather.crewmanClimbingVine) {
+ case OBJECT_SPOCK:
+ walkCrewman(OBJECT_SPOCK, 0x68, 0xbe);
+ break;
+ case OBJECT_MCCOY:
+ walkCrewman(OBJECT_MCCOY, 0x55, 0xb4);
+ break;
+ case OBJECT_REDSHIRT:
+ walkCrewman(OBJECT_REDSHIRT, 0xdc, 0xc6);
+ break;
+ case OBJECT_KIRK:
+ walkCrewman(OBJECT_KIRK, 0x87, 0xba);
+ break;
+ }
+}
+
+void Room::feather1UsePhaser() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA1_028);
+}
+
+void Room::feather1UseSTricorderOnRightVine() {
+ spockScan(DIR_N, TX_FEA1_039);
+}
+
+void Room::feather1UseSTricorderOnSnake() {
+ spockScan(DIR_S, TX_FEA1_029);
+}
+
+void Room::feather1UseSTricorderOnMoss() {
+ spockScan(DIR_E, TX_FEA1_038);
+}
+
+void Room::feather1UseSTricorderOnHole() {
+ if (_roomVar.feather.snakeInHole)
+ spockScan(DIR_E, TX_FEA1_030);
+ else
+ spockScan(DIR_E, TX_FEA1_031);
+}
+
+void Room::feather1UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_FEA1_024);
+}
+
+void Room::feather1UseSTricorderOnRocks() {
+ spockScan(DIR_E, TX_FEA1_003);
+}
+
+void Room::feather1UseMTricorderOnVine() {
+ // ENHANCEMENT: Original didn't play tricorder sound, etc
+ mccoyScan(DIR_E, TX_FEA1_007);
+}
+
+void Room::feather1UseMTricorderOnMoss() {
+ mccoyScan(DIR_E, TX_FEA1_014);
+}
+
+void Room::feather1UseMTricorderOnHole() {
+ if (_roomVar.feather.snakeInHole)
+ mccoyScan(DIR_E, TX_FEA1_011);
+ else
+ mccoyScan(DIR_E, TX_FEA1_012);
+}
+
+void Room::feather1UseMTricorderOnSnake() {
+ mccoyScan(DIR_S, TX_FEA1_019);
+ if (!_roomVar.feather.scannedSnake) {
+ showText(TX_SPEAKER_SPOCK, TX_FEA1_044);
+ showText(TX_SPEAKER_STRAGEY, TX_FEA1_055);
+ showText(TX_SPEAKER_KIRK, TX_FEA1_002);
+ _roomVar.feather.scannedSnake = true;
+ }
+}
+
+void Room::feather1UseMedkit() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA1_008);
+}
+
+void Room::feather1TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA1_006);
+}
+
+void Room::feather1TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA1_040);
+}
+
+void Room::feather1TalkToRedshirt() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA1_048);
+}
+
+void Room::feather1WalkToExit() {
+ walkCrewman(OBJECT_KIRK, 0x0a, 0x30);
+}
+
+void Room::feather1LookAnywhere() {
+ showText(TX_FEA1N020);
+}
+
+void Room::feather1LookAtSnake() {
+ showText(TX_FEA1N017);
+}
+
+void Room::feather1LookAtRightVine() {
+ showText(TX_FEA1N015);
+}
+
+void Room::feather1LookAtHole() {
+ showText(TX_FEA1N014);
+}
+
+void Room::feather1LookAtMoss() {
+ showText(TX_FEA1N016);
+}
+
+void Room::feather1LookAtRocks() {
+ showText(TX_FEA1N011);
+}
+
+void Room::feather1LookAtLight() {
+ showText(TX_FEA1N013);
+}
+
+void Room::feather1LookAtEyes() {
+ showText(TX_FEA1N000);
+}
+
+void Room::feather1LookAtKirk() {
+ showText(TX_FEA1N001);
+}
+
+void Room::feather1LookAtSpock() {
+ showText(TX_FEA1N004);
+}
+
+void Room::feather1LookAtMccoy() {
+ showText(TX_FEA1N003);
+}
+
+void Room::feather1LookAtRedshirt() {
+ showText(TX_FEA1N002);
+}
+void Room::feather1LookAtLeftVine() {
+ if (_vm->_awayMission.feather.vineState == 0)
+ showText(TX_FEA1N012);
+ else
+ showText(TX_FEA1N015);
}
}
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index c79b81e..cec0eae 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1785,9 +1785,8 @@ RoomAction feather0ActionList[] = {
{ Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::feather0UseMTricorderOnQuetzecoatl },
};
-RoomAction feather1ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::feather1Tick1 },
-};
+extern const RoomAction feather1ActionList[];
+extern const int feather1NumActions;
RoomAction feather2ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::feather2Tick1 },
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index f083187..4bc5f67 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -109,6 +109,7 @@ enum GameStringIDs {
TX_BRIDU146,
TX_G_024,
+ TX_G_043,
TX_GENER004,
@@ -1638,6 +1639,90 @@ enum GameStringIDs {
TX_FEA0N009,
+ TX_FEA1_001,
+ TX_FEA1_002,
+ TX_FEA1_003,
+ TX_FEA1_004,
+ TX_FEA1_005,
+ TX_FEA1_006,
+ TX_FEA1_007,
+ TX_FEA1_008,
+ TX_FEA1_009,
+ TX_FEA1_010,
+ TX_FEA1_011,
+ TX_FEA1_012,
+ TX_FEA1_013,
+ TX_FEA1_014,
+ TX_FEA1_015,
+ // MISSING
+ TX_FEA1_017,
+ TX_FEA1_018,
+ TX_FEA1_019,
+ TX_FEA1_020, // UNUSED
+ TX_FEA1_021,
+ TX_FEA1_022, // UNUSED
+ TX_FEA1_023,
+ TX_FEA1_024,
+ TX_FEA1_025,
+ TX_FEA1_026,
+ TX_FEA1_027,
+ TX_FEA1_028,
+ TX_FEA1_029,
+ TX_FEA1_030,
+ TX_FEA1_031,
+ TX_FEA1_032,
+ TX_FEA1_033,
+ TX_FEA1_034,
+ TX_FEA1_035,
+ // MISSING
+ TX_FEA1_037,
+ TX_FEA1_038,
+ TX_FEA1_039,
+ TX_FEA1_040,
+ TX_FEA1_041,
+ TX_FEA1_042,
+ TX_FEA1_043,
+ TX_FEA1_044,
+ TX_FEA1_045,
+ TX_FEA1_046,
+ TX_FEA1_047,
+ TX_FEA1_048,
+ TX_FEA1_049,
+ TX_FEA1_050,
+ TX_FEA1_051,
+ TX_FEA1_052,
+ TX_FEA1_053,
+ TX_FEA1_054,
+ TX_FEA1_055,
+ TX_FEA1_056, // UNUSED
+ TX_FEA1_057,
+ TX_FEA1_A46,
+ TX_FEA1_F25,
+ TX_FEA1N000,
+ TX_FEA1N001,
+ TX_FEA1N002,
+ TX_FEA1N003,
+ TX_FEA1N004,
+ TX_FEA1N005,
+ TX_FEA1N006,
+ TX_FEA1N007, // UNUSED
+ TX_FEA1N008,
+ TX_FEA1N009,
+ TX_FEA1N010,
+ TX_FEA1N011,
+ TX_FEA1N012,
+ TX_FEA1N013,
+ TX_FEA1N014,
+ TX_FEA1N015,
+ TX_FEA1N016,
+ TX_FEA1N017,
+ TX_FEA1N018, // UNUSED
+ TX_FEA1N019,
+ TX_FEA1N020,
+ TX_FEA1N021,
+ TX_FEA1N022,
+
+
TX_SIN3_012,
@@ -1698,6 +1783,7 @@ const char * const g_gameStrings[] = {
"#BRID\\BRIDU146#Nothing to report, Captain.",
"#GENE\\G_024#Fascinating.",
+ "#GENE\\G_043#Ouch! Watch it with that thing!",
"#GENE\\GENER004#Game Over",
@@ -3216,6 +3302,88 @@ const char * const g_gameStrings[] = {
"#FEA0\\FEA0N009#You see dense vegetation in all directions.",
+ "#FEA1\\FEA1_001#We wouldn't want to bleed all over Dr. McCoy now, would we?",
+ "#FEA1\\FEA1_002#Well, yes.",
+ "#FEA1\\FEA1_003#A pile of small igneous rocks, Captain.",
+ "#FEA1\\FEA1_004#And get my fingers taken off by some alien reptile? You've got to be joking.",
+ "#FEA1\\FEA1_005#Are you nuts? There's no way I'm touching any damned snake!",
+ "#FEA1\\FEA1_006#Do I look like Houdini to you? I'm afraid you're going to have to pull the rabbit out of the hat on this one.",
+ "#FEA1\\FEA1_007#Does it look sick to you, Captain?",
+ "#FEA1\\FEA1_008#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#FEA1\\FEA1_009#Hey! What was that for?",
+ "#FEA1\\FEA1_010#I'm not putting my fingers in there, Jim.",
+ "#FEA1\\FEA1_011#It's a damned hole with a snake in it.",
+ "#FEA1\\FEA1_012#It's a damned hole.",
+ "#FEA1\\FEA1_013#It's bad enough that you put me in the damn transporter, now you want me to break my neck climbing that?!",
+ "#FEA1\\FEA1_014#It's moss. Anyone got any rolling stones?",
+ "#FEA1\\FEA1_015#No toxic reaction. It appears to be ordinary, except for this resin.",
+ "#FEA1\\FEA1_017#Didn't they have baseball on Vulcan? Show us your fastball, Jim.",
+ "#FEA1\\FEA1_018#Especially that green Vulcan blood. The last thing I need is a pint of T-Negative blood all over my uniform.",
+ "#FEA1\\FEA1_019#It's a damned snake! Do you know what snakebite does? It can ruin your whole day.",
+ "#FEA1\\FEA1_020#It's bad enough being around pointy-eared Vulcans, now I have to listen to ensigns who think they can do my job!",
+ "#FEA1\\FEA1_021#Probability? That was a perfect pitch if I ever saw one.",
+ "#FEA1\\FEA1_022#The bite wasn't serious Captain. He'll be fine, but I would like to get him to sickbay in case there's some alien infection.",
+ "#FEA1\\FEA1_023#Fascinating. Our communicators have apparently been rendered ineffective.",
+ "#FEA1\\FEA1_024#I am picking up residual energy readings from the area where the alien's projection was.",
+ "#FEA1\\FEA1_025#I can not reach the snake, Captain.",
+ "#FEA1\\FEA1_026#I realize that humans form emotional bonds with pets, but I recommend tribbles.",
+ "#FEA1\\FEA1_027#I see no logic in searching an empty hole, Captain.",
+ "#FEA1\\FEA1_028#It is logical that an entity that professes to teach peace would render our phasers inoperative.",
+ "#FEA1\\FEA1_029#It looks like a Zamphorian pit snake. A rather common species in this region, noted by galactic herpatologists for their quickness. It is not venomous or dangerous to humans. ",
+ "#FEA1\\FEA1_030#It would appear that this is where the snake lives, Captain. It is currently inside.",
+ "#FEA1\\FEA1_031#It would appear that this is where the snake lives, Captain.",
+ "#FEA1\\FEA1_032#Thank you, Captain, but I assure you that I was giving this situation my fullest attention.",
+ "#FEA1\\FEA1_033#The resin does not seem to have any unusual properties.",
+ "#FEA1\\FEA1_034#The snake has gone back into the hole, Captain.",
+ "#FEA1\\FEA1_035#The snake is too quick to be easily grabbed before it retreats, Captain.", // TYPO
+ "#FEA1\\FEA1_037#This isn't very logical, but as you are human, it is quite understandable.", // TYPO
+ "#FEA1\\FEA1_038#This variety of moss seems to leave a very sticky resin behind. Perhaps to trap the large amounts of pollen from the plants on the surface, and use it as a secondary food source.",
+ "#FEA1\\FEA1_039#This vine is not likely to support our weight by itself, Captain. You would have to find some way to reinforce it.",
+ "#FEA1\\FEA1_040#Those vines would be useful to escape, if we could reach them.",
+ "#FEA1\\FEA1_041#A fascinating specimen, Captain, but I would be careful handling it. From the looks of it, it may have a nasty bite.", // TYPO
+ "#FEA1\\FEA1_042#Fascinating. It did appear to knock the vine down near to the point where one of us can reach it.",
+ "#FEA1\\FEA1_043#The probability of getting the vine on the second try was only 36.53%. Well done, Captain.",
+ "#FEA1\\FEA1_044#We are not likely to find a way out of this pit with humor, doctor. I suggest you concentrate your efforts to the problem at hand.",
+ "#FEA1\\FEA1_045#I'm glad I was taught pain-nullification techniques.",
+ "#FEA1\\FEA1_046#It doesn't seem to want to be grabbed, sir. It just slithers back to its hole.",
+ "#FEA1\\FEA1_047#It's coming out again, sir.",
+ "#FEA1\\FEA1_048#No enemies in sight, but supplies could be a problem if we don't get out.",
+ "#FEA1\\FEA1_049#Sure is sticky sir. I can't see much use in it.",
+ "#FEA1\\FEA1_050#That's something of a runt, Captain. You should've seen this Rigilian python that Cadet Tyrli put in the shower at the Academy. Twenty meters long!",
+ "#FEA1\\FEA1_051#The hole is empty, sir.",
+ "#FEA1\\FEA1_052#There's no way that we're getting up that way, Captain. The vine is too weak.",
+ "#FEA1\\FEA1_053#All Right! We're on our way!",
+ "#FEA1\\FEA1_054#Baseball? No one plays that anymore. Good try though, sir.",
+ "#FEA1\\FEA1_055#Do they always argue like this, Captain?",
+ "#FEA1\\FEA1_056#Doctors! It'll take more than a couple of scratches to put me out action, sir.",
+ "#FEA1\\FEA1_057#You clearly are not the inheritors of the noble Aztec world. What you have said has greatly disturbed me. You should not lie so. You shall remain here until you have learned the error of angering Quetzecoatl!",
+ "#FEA1\\FEA1_A46#There is not enough support, Captain.",
+ "#FEA1\\FEA1_F25#What on Earth are you doing with that slithering thing!",
+ "#FEA1\\FEA1N000#Feral red eyes glare out of the dark at you.",
+ "#FEA1\\FEA1N001#James T. Kirk does not seem very happy with his current predicament.",
+ "#FEA1\\FEA1N002#Lt. Stragey is carefully examining the pit.",
+ "#FEA1\\FEA1N003#McCoy is examining the floor of the pit.",
+ "#FEA1\\FEA1N004#Spock is carefully examining the pit.",
+ "#FEA1\\FEA1N005#The hole is already blocked.",
+ "#FEA1\\FEA1N006#The rock is a bit stickier.",
+ "#FEA1\\FEA1N007#The snake darts back into its hole before you can catch it.",
+ "#FEA1\\FEA1N008#The vine is attached to a tree above you.",
+ "#FEA1\\FEA1N009#The vine is not within reach.",
+ "#FEA1\\FEA1N010#The vine will not support you.",
+ "#FEA1\\FEA1N011#There are rocks here, quite suitable for picking up and throwing.",
+ "#FEA1\\FEA1N012#There are several loose vines hanging over the side of the pit, out of reach. This is one of them.",
+ "#FEA1\\FEA1N013#There is a light suspended from above by a chain.",
+ "#FEA1\\FEA1N014#There is a tiny hole in the wall at this point. Certainly no human could crawl through here.",
+ "#FEA1\\FEA1N015#There is a vine hanging down into the pit.",
+ "#FEA1\\FEA1N016#This moss is covered with a very sticky substance.",
+ "#FEA1\\FEA1N017#This particular snake doesn't seem to like your company, and moves whenever you get near it.",
+ "#FEA1\\FEA1N018#With no where for the snake to go, you easliy capture it.",
+ "#FEA1\\FEA1N019#You already have rocks.",
+ "#FEA1\\FEA1N020#You are in a deep pit. It is a long, hard climb to the top.",
+ "#FEA1\\FEA1N021#You cannot reach it from where you are.",
+ "#FEA1\\FEA1N022#You pick up some rocks from the pile.",
+
+
"#SIN3\\SIN3_012#Can't say I like the decor.",
Commit: 8c71f2db84b06862b4fefbe3e79fb042e7a60666
https://github.com/scummvm/scummvm/commit/8c71f2db84b06862b4fefbe3e79fb042e7a60666
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Make Action struct POD again
Changed paths:
engines/startrek/action.h
engines/startrek/awaymission.cpp
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/feather1.cpp
engines/startrek/rooms/function_map.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
index 55a08da..f6178d8 100644
--- a/engines/startrek/action.h
+++ b/engines/startrek/action.h
@@ -29,7 +29,7 @@ namespace StarTrek {
class Room;
-enum Acton {
+enum Acton { // TODO: rename
ACTION_TICK = 0,
ACTION_WALK = 1, // Actions 1-5 are directly usable on away missions.
@@ -46,20 +46,12 @@ enum Acton {
ACTION_OPTIONS = 13 // Not really an action, but selectable from action menu
};
-struct Action : Common::Serializable {
+struct Action {
byte type;
byte b1;
byte b2;
byte b3;
- Action() {}
- Action(int _type, int _b1, int _b2, int _b3)
- : type((byte)_type),
- b1((byte)_b1),
- b2((byte)_b2),
- b3((byte)_b3) {}
-
-
// ACTION_USE, ACTION_GET, ACTION_LOOK, ACTION_TALK
byte activeObject() { return b1; }
byte passiveObject() { return b2; }
@@ -85,7 +77,7 @@ struct Action : Common::Serializable {
return (type << 24) | (b1 << 16) | (b2 << 8) | (b3 << 0);
}
- virtual void saveLoadWithSerializer(Common::Serializer &ser) {
+ void saveLoadWithSerializer(Common::Serializer &ser) {
ser.syncAsByte(type);
ser.syncAsByte(b1);
ser.syncAsByte(b2);
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 8ae11d4..8c7f8db 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -189,7 +189,7 @@ void StarTrekEngine::handleAwayMissionEvents() {
updateAwayMissionTimers();
_frameIndex++;
_roomFrameCounter++;
- addAction(Action(ACTION_TICK, _roomFrameCounter & 0xff, (_roomFrameCounter >> 8) & 0xff, 0));
+ addAction(ACTION_TICK, _roomFrameCounter & 0xff, (_roomFrameCounter >> 8) & 0xff, 0);
if (_roomFrameCounter >= 2)
_gfx->incPaletteFadeLevel();
break;
@@ -258,16 +258,16 @@ useInventory:
if (clickedObject == -2)
goto checkAddAction;
- if (_room->actionHasCode(Action(ACTION_USE, _awayMission.activeObject, _awayMission.passiveObject, 0)))
+ if (_room->actionHasCode(ACTION_USE, _awayMission.activeObject, _awayMission.passiveObject, 0))
goto checkAddAction;
if (_awayMission.activeObject == OBJECT_MCCOY) {
- if (_room->actionHasCode(Action(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0)))
+ if (_room->actionHasCode(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0))
goto checkAddAction;
- if (_room->actionHasCode(Action(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0)))
+ if (_room->actionHasCode(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0))
goto checkAddAction;
}
else if (_awayMission.activeObject == OBJECT_SPOCK) {
- if (_room->actionHasCode(Action(ACTION_USE, OBJECT_ISTRICOR, _awayMission.passiveObject, 0)))
+ if (_room->actionHasCode(ACTION_USE, OBJECT_ISTRICOR, _awayMission.passiveObject, 0))
goto checkAddAction;
}
@@ -277,7 +277,7 @@ useInventory:
if (_awayMission.passiveObject == OBJECT_ICOMM) {
if (walkActiveObjectToHotspot())
break;
- addAction(Action(ACTION_USE, OBJECT_ICOMM, 0, 0));
+ addAction(ACTION_USE, OBJECT_ICOMM, 0, 0);
_sound->playVoc("commun30");
if (_awayMission.activeObject <= OBJECT_REDSHIRT) {
goto checkShowInventory;
@@ -296,7 +296,7 @@ checkAddAction:
if (!walkActiveObjectToHotspot())
{
if (clickedObject != -2)
- addAction(Action(_awayMission.activeAction, _awayMission.activeObject, _awayMission.passiveObject, 0));
+ addAction(_awayMission.activeAction, _awayMission.activeObject, _awayMission.passiveObject, 0);
checkShowInventory:
if (!(_awayMission.crewDownBitset & (1 << OBJECT_KIRK)))
@@ -325,7 +325,7 @@ lookInventory:
break;
if (clickedObject != -2)
- addAction(Action(_awayMission.activeAction, _awayMission.activeObject, 0, 0));
+ addAction(_awayMission.activeAction, _awayMission.activeObject, 0, 0);
if (_awayMission.activeAction == ACTION_LOOK && !(_awayMission.crewDownBitset & (1 << OBJECT_KIRK)))
showInventoryIcons(false);
@@ -358,7 +358,7 @@ checkSelectedAction:
if (_awayMission.activeAction == ACTION_USE
&& _awayMission.activeObject == OBJECT_ICOMM && (_awayMission.crewDownBitset & (1 << OBJECT_KIRK)) == 0) {
if (!walkActiveObjectToHotspot()) {
- addAction(Action(_awayMission.activeAction, _awayMission.activeObject, 0, 0));
+ addAction(_awayMission.activeAction, _awayMission.activeObject, 0, 0);
_sound->playVoc("communic");
_awayMission.activeAction = ACTION_WALK;
}
@@ -473,6 +473,11 @@ void StarTrekEngine::addAction(const Action &action) {
_actionQueue.push(action);
}
+void StarTrekEngine::addAction(byte type, byte b1, byte b2, byte b3) {
+ const Action a = {type, b1, b2, b3};
+ addAction(a);
+}
+
void StarTrekEngine::handleAwayMissionAction() {
Action action = _actionQueue.pop();
@@ -689,7 +694,7 @@ void StarTrekEngine::checkTouchedLoadingZone(int16 x, int16 y) {
uint16 var = _room->readRdfWord(offset);
if (_activeDoorWarpHotspot != var) {
_activeDoorWarpHotspot = var;
- addAction(Action(ACTION_TOUCHED_HOTSPOT, var & 0xff, 0, 0));
+ addAction(ACTION_TOUCHED_HOTSPOT, var & 0xff, 0, 0);
}
return;
}
@@ -707,7 +712,7 @@ void StarTrekEngine::checkTouchedLoadingZone(int16 x, int16 y) {
uint16 var = _room->readRdfWord(offset);
if (_activeWarpHotspot != var) {
_activeWarpHotspot = var;
- addAction(Action(ACTION_TOUCHED_WARP, var & 0xff, 0, 0));
+ addAction(ACTION_TOUCHED_WARP, var & 0xff, 0, 0);
}
return;
}
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 0ce807b..0430d34 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -191,6 +191,11 @@ bool Room::actionHasCode(const Action &action) {
return false;
}
+bool Room::actionHasCode(byte type, byte b1, byte b2, byte b3) {
+ const Action a = {type, b1, b2, b3};
+ return actionHasCode(a);
+}
+
bool Room::handleAction(const Action &action) {
const RoomAction *roomActionPtr = _roomActionList;
int n = _numRoomActions;
@@ -207,6 +212,11 @@ bool Room::handleAction(const Action &action) {
return false;
}
+bool Room::handleAction(byte type, byte b1, byte b2, byte b3) {
+ const Action a = {type, b1, b2, b3};
+ return handleAction(a);
+}
+
bool Room::handleActionWithBitmask(const Action &action) {
const RoomAction *roomActionPtr = _roomActionList;
int n = _numRoomActions;
@@ -224,6 +234,11 @@ bool Room::handleActionWithBitmask(const Action &action) {
return false;
}
+bool Room::handleActionWithBitmask(byte type, byte b1, byte b2, byte b3) {
+ Action a = {type, b1, b2, b3};
+ return handleActionWithBitmask(a);
+}
+
Common::Point Room::getBeamInPosition(int crewmanIndex) {
int base = RDF_BEAM_IN_POSITIONS + crewmanIndex * 4;
return Common::Point(readRdfWord(base), readRdfWord(base + 2));
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index bd6d7d9..f4e7f30 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -69,12 +69,14 @@ public:
// words 0x0e and 0x10 in RDF file are pointers to start and end of event code.
// That code is instead rewritten on a per-room basis.
bool actionHasCode(const Action &action);
+ bool actionHasCode(byte type, byte b1, byte b2, byte b3);
+
bool handleAction(const Action &action);
- bool handleAction(byte type, byte b1, byte b2, byte b3) { return handleAction(Action(type, b1, b2, b3)); };
+ bool handleAction(byte type, byte b1, byte b2, byte b3);
// Same as above, but if any byte in the action is -1 (0xff), it matches any value.
bool handleActionWithBitmask(const Action &action);
- bool handleActionWithBitmask(byte type, byte b1, byte b2, byte b3) { return handleActionWithBitmask(Action(type, b1, b2, b3)); };
+ bool handleActionWithBitmask(byte type, byte b1, byte b2, byte b3);
uint16 getFirstHotspot() { return readRdfWord(0x12); }
uint16 getHotspotEnd() { return readRdfWord(0x14); }
diff --git a/engines/startrek/rooms/feather1.cpp b/engines/startrek/rooms/feather1.cpp
index 488244e..7a23121 100644
--- a/engines/startrek/rooms/feather1.cpp
+++ b/engines/startrek/rooms/feather1.cpp
@@ -47,98 +47,98 @@
namespace StarTrek {
extern const RoomAction feather1ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::feather1Tick1 },
- { Action(ACTION_TICK, 45, 0, 0), &Room::feather1Tick45 },
- { Action(ACTION_TICK, 85, 0, 0), &Room::feather1Tick85 },
- { Action(ACTION_TICK, 95, 0, 0), &Room::feather1Tick95 },
- { Action(ACTION_FINISHED_ANIMATION, 18, 0, 0), &Room::feather1QuetzecoatlDisappeared },
- { Action(ACTION_GET, HOTSPOT_RIGHT_VINE, 0, 0), &Room::feather1GetRightVine },
- { Action(ACTION_GET, OBJECT_LEFT_VINE, 0, 0), &Room::feather1GetLeftVine },
- { Action(ACTION_GET, HOTSPOT_ROCKS, 0, 0), &Room::feather1GetRocks },
- { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::feather1ReachedRocks },
- { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::feather1PickedUpRocks },
- { Action(ACTION_GET, OBJECT_SNAKE, 0, 0), &Room::feather1GetSnake },
- { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::feather1ReachedSnake },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::feather1Timer1Expired },
- { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::feather1Timer2Expired },
- { Action(ACTION_FINISHED_ANIMATION, 8, 0, 0), &Room::feather1PickedUpSnake },
- { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::feather1Timer0Expired },
- { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::feather1UseCommunicator },
- { Action(ACTION_USE, OBJECT_IROCK, HOTSPOT_HOLE, 0), &Room::feather1UseRockOnHole },
- { Action(ACTION_FINISHED_WALKING, 9, 0, 0), &Room::feather1ReachedHole },
- { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::feather1Timer3Expired },
- { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::feather1PutRockInHole },
- { Action(ACTION_USE, OBJECT_ISNAKE, OBJECT_LEFT_VINE, 0), &Room::feather1UseSnakeOnLeftVine },
- { Action(ACTION_USE, OBJECT_ISNAKE, OBJECT_SPOCK, 0), &Room::feather1UseSnakeOnSpock },
- { Action(ACTION_USE, OBJECT_ISNAKE, OBJECT_KIRK, 0), &Room::feather1UseSnakeOnKirk },
- { Action(ACTION_USE, OBJECT_ISNAKE, OBJECT_MCCOY, 0), &Room::feather1UseSnakeOnMccoy },
- { Action(ACTION_USE, OBJECT_ISNAKE, OBJECT_REDSHIRT, 0), &Room::feather1UseSnakeOnRedshirt },
- { Action(ACTION_USE, OBJECT_IROCK, OBJECT_SNAKE, 0), &Room::feather1UseRockOnSnake },
- { Action(ACTION_USE, OBJECT_SPOCK, OBJECT_SNAKE, 0), &Room::feather1UseSpockOnSnake },
- { Action(ACTION_USE, OBJECT_MCCOY, OBJECT_SNAKE, 0), &Room::feather1UseMccoyOnSnake },
- { Action(ACTION_USE, OBJECT_REDSHIRT, OBJECT_SNAKE, 0), &Room::feather1UseRedshirtOnSnake },
- { Action(ACTION_USE, OBJECT_SPOCK, HOTSPOT_HOLE, 0), &Room::feather1UseSpockOnHole },
- { Action(ACTION_USE, OBJECT_MCCOY, HOTSPOT_HOLE, 0), &Room::feather1UseMccoyOnHole },
- { Action(ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_HOLE, 0), &Room::feather1UseRedshirtOnHole },
- { Action(ACTION_USE, OBJECT_IROCK, HOTSPOT_MOSS, 0), &Room::feather1UseRockOnMoss },
- { Action(ACTION_USE, OBJECT_IROCK, OBJECT_SPOCK, 0), &Room::feather1UseRockOnSpock },
- { Action(ACTION_USE, OBJECT_IROCK, OBJECT_MCCOY, 0), &Room::feather1UseRockOnMccoy },
- { Action(ACTION_USE, OBJECT_IROCK, OBJECT_REDSHIRT, 0), &Room::feather1UseRockOnRedshirt },
- { Action(ACTION_USE, OBJECT_SPOCK, HOTSPOT_MOSS, 0), &Room::feather1UseSpockOnMoss },
- { Action(ACTION_USE, OBJECT_MCCOY, HOTSPOT_MOSS, 0), &Room::feather1UseMccoyOnMoss },
- { Action(ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_MOSS, 0), &Room::feather1UseRedshirtOnMoss },
- { Action(ACTION_USE, OBJECT_IROCK, OBJECT_LEFT_VINE, 0), &Room::feather1UseRockOnLeftVine },
- { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::feather1ReadyToThrowRock1 },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::feather1ThrewRock1 },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::feather1ReadyToThrowRock2 },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::feather1ThrewRock2 },
-
- { Action(ACTION_USE, OBJECT_SPOCK, OBJECT_LEFT_VINE, 0), &Room::feather1UseSpockOnVine },
- { Action(ACTION_USE, OBJECT_SPOCK, HOTSPOT_RIGHT_VINE, 0), &Room::feather1UseSpockOnVine },
- { Action(ACTION_USE, OBJECT_MCCOY, OBJECT_LEFT_VINE, 0), &Room::feather1UseMccoyOnVine },
- { Action(ACTION_USE, OBJECT_MCCOY, HOTSPOT_RIGHT_VINE, 0), &Room::feather1UseMccoyOnVine },
- { Action(ACTION_USE, OBJECT_REDSHIRT, OBJECT_LEFT_VINE, 0), &Room::feather1UseRedshirtOnVine },
- { Action(ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_RIGHT_VINE, 0), &Room::feather1UseRedshirtOnVine },
- { Action(ACTION_USE, OBJECT_KIRK, OBJECT_LEFT_VINE, 0), &Room::feather1UseKirkOnVine },
- { Action(ACTION_USE, OBJECT_KIRK, HOTSPOT_RIGHT_VINE, 0), &Room::feather1UseKirkOnVine },
- { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::feather1ReachedVineToClimbUp },
- { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::feather1ClimbedUpVine },
- { Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::feather1ReachedVineToClimbDown },
- { Action(ACTION_FINISHED_ANIMATION, 10, 0, 0), &Room::feather1ClimbedDownVine },
-
- { Action(ACTION_USE, OBJECT_IPHASERS, -1, 0), &Room::feather1UsePhaser },
- { Action(ACTION_USE, OBJECT_IPHASERK, -1, 0), &Room::feather1UsePhaser },
- { Action(ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_RIGHT_VINE, 0), &Room::feather1UseSTricorderOnRightVine },
- { Action(ACTION_USE, OBJECT_ISTRICOR, OBJECT_SNAKE, 0), &Room::feather1UseSTricorderOnSnake },
- { Action(ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MOSS, 0), &Room::feather1UseSTricorderOnMoss },
- { Action(ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_HOLE, 0), &Room::feather1UseSTricorderOnHole },
- { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::feather1UseSTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_ROCKS, 0), &Room::feather1UseSTricorderOnRocks },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_LEFT_VINE, 0), &Room::feather1UseMTricorderOnVine },
- { Action(ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_RIGHT_VINE, 0), &Room::feather1UseMTricorderOnVine },
- { Action(ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_MOSS, 0), &Room::feather1UseMTricorderOnMoss },
- { Action(ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_HOLE, 0), &Room::feather1UseMTricorderOnHole },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_SNAKE, 0), &Room::feather1UseMTricorderOnSnake },
- { Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::feather1UseMedkit },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::feather1TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::feather1TalkToSpock },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::feather1TalkToRedshirt },
- { Action(ACTION_WALK, HOTSPOT_EXIT, 0, 0), &Room::feather1WalkToExit },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::feather1LookAnywhere },
- { Action(ACTION_LOOK, OBJECT_SNAKE, 0, 0), &Room::feather1LookAtSnake },
- { Action(ACTION_LOOK, HOTSPOT_RIGHT_VINE, 0, 0), &Room::feather1LookAtRightVine },
- { Action(ACTION_LOOK, HOTSPOT_HOLE, 0, 0), &Room::feather1LookAtHole },
- { Action(ACTION_LOOK, HOTSPOT_MOSS, 0, 0), &Room::feather1LookAtMoss },
- { Action(ACTION_LOOK, HOTSPOT_ROCKS, 0, 0), &Room::feather1LookAtRocks },
- { Action(ACTION_LOOK, HOTSPOT_LIGHT, 0, 0), &Room::feather1LookAtLight },
- { Action(ACTION_LOOK, HOTSPOT_EYES_1, 0, 0), &Room::feather1LookAtEyes },
- { Action(ACTION_LOOK, HOTSPOT_EYES_2, 0, 0), &Room::feather1LookAtEyes },
- { Action(ACTION_LOOK, HOTSPOT_EYES_3, 0, 0), &Room::feather1LookAtEyes },
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::feather1LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::feather1LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::feather1LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::feather1LookAtRedshirt },
- { Action(ACTION_LOOK, OBJECT_LEFT_VINE, 0, 0), &Room::feather1LookAtLeftVine },
+ { {ACTION_TICK, 1, 0, 0}, &Room::feather1Tick1 },
+ { {ACTION_TICK, 45, 0, 0}, &Room::feather1Tick45 },
+ { {ACTION_TICK, 85, 0, 0}, &Room::feather1Tick85 },
+ { {ACTION_TICK, 95, 0, 0}, &Room::feather1Tick95 },
+ { {ACTION_FINISHED_ANIMATION, 18, 0, 0}, &Room::feather1QuetzecoatlDisappeared },
+ { {ACTION_GET, HOTSPOT_RIGHT_VINE, 0, 0}, &Room::feather1GetRightVine },
+ { {ACTION_GET, OBJECT_LEFT_VINE, 0, 0}, &Room::feather1GetLeftVine },
+ { {ACTION_GET, HOTSPOT_ROCKS, 0, 0}, &Room::feather1GetRocks },
+ { {ACTION_FINISHED_WALKING, 6, 0, 0}, &Room::feather1ReachedRocks },
+ { {ACTION_FINISHED_ANIMATION, 6, 0, 0}, &Room::feather1PickedUpRocks },
+ { {ACTION_GET, OBJECT_SNAKE, 0, 0}, &Room::feather1GetSnake },
+ { {ACTION_FINISHED_WALKING, 8, 0, 0}, &Room::feather1ReachedSnake },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::feather1Timer1Expired },
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::feather1Timer2Expired },
+ { {ACTION_FINISHED_ANIMATION, 8, 0, 0}, &Room::feather1PickedUpSnake },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::feather1Timer0Expired },
+ { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::feather1UseCommunicator },
+ { {ACTION_USE, OBJECT_IROCK, HOTSPOT_HOLE, 0}, &Room::feather1UseRockOnHole },
+ { {ACTION_FINISHED_WALKING, 9, 0, 0}, &Room::feather1ReachedHole },
+ { {ACTION_TIMER_EXPIRED, 3, 0, 0}, &Room::feather1Timer3Expired },
+ { {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::feather1PutRockInHole },
+ { {ACTION_USE, OBJECT_ISNAKE, OBJECT_LEFT_VINE, 0}, &Room::feather1UseSnakeOnLeftVine },
+ { {ACTION_USE, OBJECT_ISNAKE, OBJECT_SPOCK, 0}, &Room::feather1UseSnakeOnSpock },
+ { {ACTION_USE, OBJECT_ISNAKE, OBJECT_KIRK, 0}, &Room::feather1UseSnakeOnKirk },
+ { {ACTION_USE, OBJECT_ISNAKE, OBJECT_MCCOY, 0}, &Room::feather1UseSnakeOnMccoy },
+ { {ACTION_USE, OBJECT_ISNAKE, OBJECT_REDSHIRT, 0}, &Room::feather1UseSnakeOnRedshirt },
+ { {ACTION_USE, OBJECT_IROCK, OBJECT_SNAKE, 0}, &Room::feather1UseRockOnSnake },
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_SNAKE, 0}, &Room::feather1UseSpockOnSnake },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_SNAKE, 0}, &Room::feather1UseMccoyOnSnake },
+ { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_SNAKE, 0}, &Room::feather1UseRedshirtOnSnake },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_HOLE, 0}, &Room::feather1UseSpockOnHole },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_HOLE, 0}, &Room::feather1UseMccoyOnHole },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_HOLE, 0}, &Room::feather1UseRedshirtOnHole },
+ { {ACTION_USE, OBJECT_IROCK, HOTSPOT_MOSS, 0}, &Room::feather1UseRockOnMoss },
+ { {ACTION_USE, OBJECT_IROCK, OBJECT_SPOCK, 0}, &Room::feather1UseRockOnSpock },
+ { {ACTION_USE, OBJECT_IROCK, OBJECT_MCCOY, 0}, &Room::feather1UseRockOnMccoy },
+ { {ACTION_USE, OBJECT_IROCK, OBJECT_REDSHIRT, 0}, &Room::feather1UseRockOnRedshirt },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_MOSS, 0}, &Room::feather1UseSpockOnMoss },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_MOSS, 0}, &Room::feather1UseMccoyOnMoss },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_MOSS, 0}, &Room::feather1UseRedshirtOnMoss },
+ { {ACTION_USE, OBJECT_IROCK, OBJECT_LEFT_VINE, 0}, &Room::feather1UseRockOnLeftVine },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::feather1ReadyToThrowRock1 },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::feather1ThrewRock1 },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::feather1ReadyToThrowRock2 },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::feather1ThrewRock2 },
+
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_LEFT_VINE, 0}, &Room::feather1UseSpockOnVine },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_RIGHT_VINE, 0}, &Room::feather1UseSpockOnVine },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_LEFT_VINE, 0}, &Room::feather1UseMccoyOnVine },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_RIGHT_VINE, 0}, &Room::feather1UseMccoyOnVine },
+ { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_LEFT_VINE, 0}, &Room::feather1UseRedshirtOnVine },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_RIGHT_VINE, 0}, &Room::feather1UseRedshirtOnVine },
+ { {ACTION_USE, OBJECT_KIRK, OBJECT_LEFT_VINE, 0}, &Room::feather1UseKirkOnVine },
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_RIGHT_VINE, 0}, &Room::feather1UseKirkOnVine },
+ { {ACTION_FINISHED_WALKING, 3, 0, 0}, &Room::feather1ReachedVineToClimbUp },
+ { {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::feather1ClimbedUpVine },
+ { {ACTION_FINISHED_WALKING, 10, 0, 0}, &Room::feather1ReachedVineToClimbDown },
+ { {ACTION_FINISHED_ANIMATION, 10, 0, 0}, &Room::feather1ClimbedDownVine },
+
+ { {ACTION_USE, OBJECT_IPHASERS, -1, 0}, &Room::feather1UsePhaser },
+ { {ACTION_USE, OBJECT_IPHASERK, -1, 0}, &Room::feather1UsePhaser },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_RIGHT_VINE, 0}, &Room::feather1UseSTricorderOnRightVine },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_SNAKE, 0}, &Room::feather1UseSTricorderOnSnake },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MOSS, 0}, &Room::feather1UseSTricorderOnMoss },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_HOLE, 0}, &Room::feather1UseSTricorderOnHole },
+ { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::feather1UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_ROCKS, 0}, &Room::feather1UseSTricorderOnRocks },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_LEFT_VINE, 0}, &Room::feather1UseMTricorderOnVine },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_RIGHT_VINE, 0}, &Room::feather1UseMTricorderOnVine },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_MOSS, 0}, &Room::feather1UseMTricorderOnMoss },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_HOLE, 0}, &Room::feather1UseMTricorderOnHole },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SNAKE, 0}, &Room::feather1UseMTricorderOnSnake },
+ { {ACTION_USE, OBJECT_IMEDKIT, -1, 0}, &Room::feather1UseMedkit },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::feather1TalkToMccoy },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::feather1TalkToSpock },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::feather1TalkToRedshirt },
+ { {ACTION_WALK, HOTSPOT_EXIT, 0, 0}, &Room::feather1WalkToExit },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::feather1LookAnywhere },
+ { {ACTION_LOOK, OBJECT_SNAKE, 0, 0}, &Room::feather1LookAtSnake },
+ { {ACTION_LOOK, HOTSPOT_RIGHT_VINE, 0, 0}, &Room::feather1LookAtRightVine },
+ { {ACTION_LOOK, HOTSPOT_HOLE, 0, 0}, &Room::feather1LookAtHole },
+ { {ACTION_LOOK, HOTSPOT_MOSS, 0, 0}, &Room::feather1LookAtMoss },
+ { {ACTION_LOOK, HOTSPOT_ROCKS, 0, 0}, &Room::feather1LookAtRocks },
+ { {ACTION_LOOK, HOTSPOT_LIGHT, 0, 0}, &Room::feather1LookAtLight },
+ { {ACTION_LOOK, HOTSPOT_EYES_1, 0, 0}, &Room::feather1LookAtEyes },
+ { {ACTION_LOOK, HOTSPOT_EYES_2, 0, 0}, &Room::feather1LookAtEyes },
+ { {ACTION_LOOK, HOTSPOT_EYES_3, 0, 0}, &Room::feather1LookAtEyes },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::feather1LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::feather1LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::feather1LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::feather1LookAtRedshirt },
+ { {ACTION_LOOK, OBJECT_LEFT_VINE, 0, 0}, &Room::feather1LookAtLeftVine },
};
extern const int feather1NumActions = sizeof(feather1ActionList) / sizeof(RoomAction);
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index cec0eae..67b19d9 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -31,1785 +31,1785 @@ namespace StarTrek {
// FIXME: calling a constructor in global scope not allowed in scummvm?
RoomAction demon0ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::demon0Tick1 },
- { Action(ACTION_TICK, 2, 0, 0), &Room::demon0Tick2 },
- { Action(ACTION_TICK, 60, 0, 0), &Room::demon0Tick60 },
- { Action(ACTION_TICK, 100, 0, 0), &Room::demon0Tick100 },
- { Action(ACTION_TICK, 140, 0, 0), &Room::demon0Tick140 },
-
- { Action(ACTION_TOUCHED_WARP, 0, 0, 0), &Room::demon0TouchedWarp0 },
-
- { Action(ACTION_WALK, 0x27, 0, 0), &Room::demon0WalkToBottomDoor },
- { Action(ACTION_WALK, 9, 0, 0), &Room::demon0WalkToBottomDoor },
- { Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::demon0TouchedHotspot1 },
- { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::demon0ReachedBottomDoor },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::demon0ReachedBottomDoor },
-
- { Action(ACTION_WALK, 0x26, 0, 0), &Room::demon0WalkToTopDoor },
- { Action(ACTION_WALK, 10, 0, 0), &Room::demon0WalkToTopDoor },
- { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::demon0TouchedHotspot0 },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::demon0ReachedTopDoor },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::demon0ReachedTopDoor },
-
- { Action(ACTION_TALK, 8, 0, 0), &Room::demon0TalkToPrelate },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::demon0LookAtPrelate },
-
- { Action(ACTION_USE, OBJECT_IPHASERS, 0x23, 0), &Room::demon0UsePhaserOnSnow },
- { Action(ACTION_USE, OBJECT_IPHASERK, 0x23, 0), &Room::demon0UsePhaserOnSnow },
- { Action(ACTION_USE, OBJECT_IPHASERS, 0x25, 0), &Room::demon0UsePhaserOnSign },
- { Action(ACTION_USE, OBJECT_IPHASERK, 0x25, 0), &Room::demon0UsePhaserOnSign },
- { Action(ACTION_USE, OBJECT_IPHASERK, 0x20, 0), &Room::demon0UsePhaserOnShelter },
- { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::demon0UsePhaserOnPrelate },
-
- { Action(ACTION_LOOK, 0x25, 0, 0), &Room::demon0LookAtSign },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::demon0LookAtTrees },
- { Action(ACTION_LOOK, 0x22, 0, 0), &Room::demon0LookAtTrees },
- { Action(ACTION_LOOK, 0x23, 0, 0), &Room::demon0LookAtSnow },
- { Action(ACTION_LOOK, 0xff, 0, 0), &Room::demon0LookAnywhere },
- { Action(ACTION_LOOK, 0x24, 0, 0), &Room::demon0LookAtBushes },
-
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::demon0LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::demon0LookAtMcCoy },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::demon0LookAtRedShirt },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::demon0LookAtSpock },
-
- { Action(ACTION_LOOK, 9, 0, 0), &Room::demon0LookAtShelter }, // Door 1
- { Action(ACTION_LOOK, 10, 0, 0), &Room::demon0LookAtShelter }, // Door 2
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon0LookAtShelter }, // Shelter itself
-
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::demon0TalkToKirk },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::demon0TalkToRedshirt },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::demon0TalkToMcCoy },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::demon0TalkToSpock },
-
- { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::demon0UseSTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::demon0UseMTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::demon0UseMTricorderOnPrelate },
+ { {ACTION_TICK, 1, 0, 0}, &Room::demon0Tick1 },
+ { {ACTION_TICK, 2, 0, 0}, &Room::demon0Tick2 },
+ { {ACTION_TICK, 60, 0, 0}, &Room::demon0Tick60 },
+ { {ACTION_TICK, 100, 0, 0}, &Room::demon0Tick100 },
+ { {ACTION_TICK, 140, 0, 0}, &Room::demon0Tick140 },
+
+ { {ACTION_TOUCHED_WARP, 0, 0, 0}, &Room::demon0TouchedWarp0 },
+
+ { {ACTION_WALK, 0x27, 0, 0}, &Room::demon0WalkToBottomDoor },
+ { {ACTION_WALK, 9, 0, 0}, &Room::demon0WalkToBottomDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 1, 0, 0}, &Room::demon0TouchedHotspot1 },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::demon0ReachedBottomDoor },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::demon0ReachedBottomDoor },
+
+ { {ACTION_WALK, 0x26, 0, 0}, &Room::demon0WalkToTopDoor },
+ { {ACTION_WALK, 10, 0, 0}, &Room::demon0WalkToTopDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::demon0TouchedHotspot0 },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::demon0ReachedTopDoor },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::demon0ReachedTopDoor },
+
+ { {ACTION_TALK, 8, 0, 0}, &Room::demon0TalkToPrelate },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::demon0LookAtPrelate },
+
+ { {ACTION_USE, OBJECT_IPHASERS, 0x23, 0}, &Room::demon0UsePhaserOnSnow },
+ { {ACTION_USE, OBJECT_IPHASERK, 0x23, 0}, &Room::demon0UsePhaserOnSnow },
+ { {ACTION_USE, OBJECT_IPHASERS, 0x25, 0}, &Room::demon0UsePhaserOnSign },
+ { {ACTION_USE, OBJECT_IPHASERK, 0x25, 0}, &Room::demon0UsePhaserOnSign },
+ { {ACTION_USE, OBJECT_IPHASERK, 0x20, 0}, &Room::demon0UsePhaserOnShelter },
+ { {ACTION_USE, OBJECT_IPHASERK, 8, 0}, &Room::demon0UsePhaserOnPrelate },
+
+ { {ACTION_LOOK, 0x25, 0, 0}, &Room::demon0LookAtSign },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::demon0LookAtTrees },
+ { {ACTION_LOOK, 0x22, 0, 0}, &Room::demon0LookAtTrees },
+ { {ACTION_LOOK, 0x23, 0, 0}, &Room::demon0LookAtSnow },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::demon0LookAnywhere },
+ { {ACTION_LOOK, 0x24, 0, 0}, &Room::demon0LookAtBushes },
+
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::demon0LookAtKirk },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::demon0LookAtMcCoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::demon0LookAtRedShirt },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::demon0LookAtSpock },
+
+ { {ACTION_LOOK, 9, 0, 0}, &Room::demon0LookAtShelter }, // Door 1
+ { {ACTION_LOOK, 10, 0, 0}, &Room::demon0LookAtShelter }, // Door 2
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::demon0LookAtShelter }, // Shelter itself
+
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::demon0TalkToKirk },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::demon0TalkToRedshirt },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::demon0TalkToMcCoy },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::demon0TalkToSpock },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::demon0UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::demon0UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, 8, 0}, &Room::demon0UseMTricorderOnPrelate },
};
RoomAction demon1ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::demon1Tick1 },
-
- { Action(ACTION_WALK, 0x25, 0, 0), &Room::demon1WalkToCave },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::demon1TouchedTopWarp },
- { Action(ACTION_TOUCHED_WARP, 0, 0, 0), &Room::demon1TouchedTopWarp },
- { Action(ACTION_TOUCHED_WARP, 1, 0, 0), &Room::demon1TouchedBottomWarp },
-
- { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::demon1Timer2Expired },
- { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::demon1Timer0Expired },
- { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::demon1Timer3Expired },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::demon1Timer1Expired },
-
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::demon1KlingonFinishedAimingWeapon },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::demon1KirkShot },
-
- { Action(ACTION_USE, OBJECT_IPHASERK, -1, 0), &Room::demon1UsePhaserOnAnything },
- { Action(ACTION_USE, OBJECT_IPHASERS, -1, 0), &Room::demon1UsePhaserOnAnything },
-
- { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::demon1UsePhaserOnKlingon1 },
- { Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::demon1UsePhaserOnKlingon1 },
- { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::demon1ShootKlingon1 },
- { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::demon1KlingonDropsHand },
-
- { Action(ACTION_USE, OBJECT_IPHASERK, 9, 0), &Room::demon1UsePhaserOnKlingon2 },
- { Action(ACTION_USE, OBJECT_IPHASERS, 9, 0), &Room::demon1UsePhaserOnKlingon2 },
- { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::demon1ShootKlingon2 },
-
- { Action(ACTION_USE, OBJECT_IPHASERK, 10, 0), &Room::demon1UsePhaserOnKlingon3 },
- { Action(ACTION_USE, OBJECT_IPHASERS, 10, 0), &Room::demon1UsePhaserOnKlingon3 },
- { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::demon1ShootKlingon3 },
-
- { Action(ACTION_TIMER_EXPIRED, 6, 0, 0), &Room::demon1AllKlingonsDead },
- { Action(ACTION_TIMER_EXPIRED, 5, 0, 0), &Room::demon1Timer5Expired },
-
- { Action(ACTION_USE, OBJECT_IMTRICOR, 13, 0), &Room::demon1UseMTricorderOnKlingon },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::demon1UseSTricorderOnTulips },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::demon1UseSTricorderOnPods },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::demon1UseSTricorderOnCattails },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::demon1UseSTricorderOnFerns },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 13, 0), &Room::demon1UseSTricorderOnHand },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::demon1UseSTricorderOnKlingon1 },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 10, 0), &Room::demon1UseSTricorderOnKlingon2Or3 },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 9, 0), &Room::demon1UseSTricorderOnKlingon2Or3 },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 8, 0), &Room::demon1UseMTricorderOnKlingon },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::demon1UseMTricorderOnKlingon },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 10, 0), &Room::demon1UseMTricorderOnKlingon },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 9, 0), &Room::demon1UseMTricorderOnKlingon },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 10, 0), &Room::demon1UseMTricorderOnKlingon },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 9, 0), &Room::demon1UseMTricorderOnKlingon },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::demon1UseSTricorderOnKlingon2Or3 }, // This is redundant
-
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0), &Room::demon1UseMTricorderOnKirk },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0), &Room::demon1UseMTricorderOnSpock },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0), &Room::demon1UseMTricorderOnRedshirt },
-
- { Action(ACTION_GET, 13, 0, 0), &Room::demon1GetHand },
- { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::demon1ReachedHand },
- { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::demon1PickedUpHand },
- { Action(ACTION_TIMER_EXPIRED, 4, 0, 0), &Room::demon1FinishedGettingHand },
-
- { Action(ACTION_LOOK, 8, 0, 0), &Room::demon1LookAtKlingon },
- { Action(ACTION_LOOK, 9, 0, 0), &Room::demon1LookAtKlingon },
- { Action(ACTION_LOOK, 10, 0, 0), &Room::demon1LookAtKlingon },
-
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon1LookAtCattails },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::demon1LookAtTulips },
- { Action(ACTION_LOOK, 0x22, 0, 0), &Room::demon1LookAtPods },
- { Action(ACTION_LOOK, 0x23, 0, 0), &Room::demon1LookAtFerns },
- { Action(ACTION_LOOK, 0x24, 0, 0), &Room::demon1LookAtStream },
- { Action(ACTION_LOOK, 0x25, 0, 0), &Room::demon1LookAtMine },
- { Action(ACTION_LOOK, 0x26, 0, 0), &Room::demon1LookAtMountain },
- { Action(ACTION_LOOK, 13, 0, 0), &Room::demon1LookAtHand },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::demon1LookAnywhere },
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::demon1LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::demon1LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::demon1LookAtMcCoy },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::demon1LookAtRedshirt },
-
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::demon1TalkToKirk },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::demon1TalkToSpock },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::demon1TalkToMcCoy },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::demon1TalkToRedshirt },
+ { {ACTION_TICK, 1, 0, 0}, &Room::demon1Tick1 },
+
+ { {ACTION_WALK, 0x25, 0, 0}, &Room::demon1WalkToCave },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::demon1TouchedTopWarp },
+ { {ACTION_TOUCHED_WARP, 0, 0, 0}, &Room::demon1TouchedTopWarp },
+ { {ACTION_TOUCHED_WARP, 1, 0, 0}, &Room::demon1TouchedBottomWarp },
+
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::demon1Timer2Expired },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::demon1Timer0Expired },
+ { {ACTION_TIMER_EXPIRED, 3, 0, 0}, &Room::demon1Timer3Expired },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::demon1Timer1Expired },
+
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::demon1KlingonFinishedAimingWeapon },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::demon1KirkShot },
+
+ { {ACTION_USE, OBJECT_IPHASERK, -1, 0}, &Room::demon1UsePhaserOnAnything },
+ { {ACTION_USE, OBJECT_IPHASERS, -1, 0}, &Room::demon1UsePhaserOnAnything },
+
+ { {ACTION_USE, OBJECT_IPHASERK, 8, 0}, &Room::demon1UsePhaserOnKlingon1 },
+ { {ACTION_USE, OBJECT_IPHASERS, 8, 0}, &Room::demon1UsePhaserOnKlingon1 },
+ { {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::demon1ShootKlingon1 },
+ { {ACTION_FINISHED_ANIMATION, 7, 0, 0}, &Room::demon1KlingonDropsHand },
+
+ { {ACTION_USE, OBJECT_IPHASERK, 9, 0}, &Room::demon1UsePhaserOnKlingon2 },
+ { {ACTION_USE, OBJECT_IPHASERS, 9, 0}, &Room::demon1UsePhaserOnKlingon2 },
+ { {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::demon1ShootKlingon2 },
+
+ { {ACTION_USE, OBJECT_IPHASERK, 10, 0}, &Room::demon1UsePhaserOnKlingon3 },
+ { {ACTION_USE, OBJECT_IPHASERS, 10, 0}, &Room::demon1UsePhaserOnKlingon3 },
+ { {ACTION_FINISHED_ANIMATION, 5, 0, 0}, &Room::demon1ShootKlingon3 },
+
+ { {ACTION_TIMER_EXPIRED, 6, 0, 0}, &Room::demon1AllKlingonsDead },
+ { {ACTION_TIMER_EXPIRED, 5, 0, 0}, &Room::demon1Timer5Expired },
+
+ { {ACTION_USE, OBJECT_IMTRICOR, 13, 0}, &Room::demon1UseMTricorderOnKlingon },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::demon1UseSTricorderOnTulips },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x22, 0}, &Room::demon1UseSTricorderOnPods },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::demon1UseSTricorderOnCattails },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x23, 0}, &Room::demon1UseSTricorderOnFerns },
+ { {ACTION_USE, OBJECT_ISTRICOR, 13, 0}, &Room::demon1UseSTricorderOnHand },
+ { {ACTION_USE, OBJECT_ISTRICOR, 8, 0}, &Room::demon1UseSTricorderOnKlingon1 },
+ { {ACTION_USE, OBJECT_ISTRICOR, 10, 0}, &Room::demon1UseSTricorderOnKlingon2Or3 },
+ { {ACTION_USE, OBJECT_ISTRICOR, 9, 0}, &Room::demon1UseSTricorderOnKlingon2Or3 },
+ { {ACTION_USE, OBJECT_IMEDKIT, 8, 0}, &Room::demon1UseMTricorderOnKlingon },
+ { {ACTION_USE, OBJECT_IMTRICOR, 8, 0}, &Room::demon1UseMTricorderOnKlingon },
+ { {ACTION_USE, OBJECT_IMEDKIT, 10, 0}, &Room::demon1UseMTricorderOnKlingon },
+ { {ACTION_USE, OBJECT_IMEDKIT, 9, 0}, &Room::demon1UseMTricorderOnKlingon },
+ { {ACTION_USE, OBJECT_IMTRICOR, 10, 0}, &Room::demon1UseMTricorderOnKlingon },
+ { {ACTION_USE, OBJECT_IMTRICOR, 9, 0}, &Room::demon1UseMTricorderOnKlingon },
+ { {ACTION_USE, OBJECT_ISTRICOR, 8, 0}, &Room::demon1UseSTricorderOnKlingon2Or3 }, // This is redundant
+
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::demon1UseMTricorderOnKirk },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::demon1UseMTricorderOnSpock },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::demon1UseMTricorderOnRedshirt },
+
+ { {ACTION_GET, 13, 0, 0}, &Room::demon1GetHand },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::demon1ReachedHand },
+ { {ACTION_FINISHED_ANIMATION, 6, 0, 0}, &Room::demon1PickedUpHand },
+ { {ACTION_TIMER_EXPIRED, 4, 0, 0}, &Room::demon1FinishedGettingHand },
+
+ { {ACTION_LOOK, 8, 0, 0}, &Room::demon1LookAtKlingon },
+ { {ACTION_LOOK, 9, 0, 0}, &Room::demon1LookAtKlingon },
+ { {ACTION_LOOK, 10, 0, 0}, &Room::demon1LookAtKlingon },
+
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::demon1LookAtCattails },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::demon1LookAtTulips },
+ { {ACTION_LOOK, 0x22, 0, 0}, &Room::demon1LookAtPods },
+ { {ACTION_LOOK, 0x23, 0, 0}, &Room::demon1LookAtFerns },
+ { {ACTION_LOOK, 0x24, 0, 0}, &Room::demon1LookAtStream },
+ { {ACTION_LOOK, 0x25, 0, 0}, &Room::demon1LookAtMine },
+ { {ACTION_LOOK, 0x26, 0, 0}, &Room::demon1LookAtMountain },
+ { {ACTION_LOOK, 13, 0, 0}, &Room::demon1LookAtHand },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::demon1LookAnywhere },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::demon1LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::demon1LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::demon1LookAtMcCoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::demon1LookAtRedshirt },
+
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::demon1TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::demon1TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::demon1TalkToMcCoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::demon1TalkToRedshirt },
};
RoomAction demon2ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::demon2Tick1 },
- { Action(ACTION_WALK, 0x27, 0, 0), &Room::demon2WalkToCave },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::demon2ReachedCave },
- { Action(ACTION_TOUCHED_WARP, 1, 0, 0), &Room::demon2TouchedWarp1 },
-
- { Action(ACTION_LOOK, 0x27, 0, 0), &Room::demon2LookAtCave },
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon2LookAtCave },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::demon2LookAtMountain },
- { Action(ACTION_LOOK, 0x22, 0, 0), &Room::demon2LookAtMountain },
- { Action(ACTION_LOOK, 0x23, 0, 0), &Room::demon2LookAtBerries },
- { Action(ACTION_LOOK, 0x24, 0, 0), &Room::demon2LookAtFern },
- { Action(ACTION_LOOK, 0x25, 0, 0), &Room::demon2LookAtMoss },
- { Action(ACTION_LOOK, 0x26, 0, 0), &Room::demon2LookAtLights },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::demon2LookAtAnything },
-
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::demon2LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::demon2LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::demon2LookAtMcCoy },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::demon2LookAtRedshirt },
-
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::demon2TalkToKirk },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::demon2TalkToSpock },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::demon2TalkToMcCoy },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::demon2TalkToRedshirt },
-
- { Action(ACTION_USE, OBJECT_IPHASERK, 0x23, 0), &Room::demon2UsePhaserOnBerries },
- { Action(ACTION_USE, OBJECT_IPHASERS, 0x23, 0), &Room::demon2UsePhaserOnBerries },
-
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::demon2UseSTricorderOnBerries },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x25, 0), &Room::demon2UseSTricorderOnMoss },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x24, 0), &Room::demon2UseSTricorderOnFern },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::demon2UseSTricorderOnCave },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::demon2UseSTricorderOnCave },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::demon2UseSTricorderOnCave },
-
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0x23, 0), &Room::demon2UseMTricorderOnBerries },
- { Action(ACTION_GET, 0x23, 0, 0), &Room::demon2GetBerries },
- { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::demon2ReachedBerries },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::demon2PickedUpBerries },
+ { {ACTION_TICK, 1, 0, 0}, &Room::demon2Tick1 },
+ { {ACTION_WALK, 0x27, 0, 0}, &Room::demon2WalkToCave },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::demon2ReachedCave },
+ { {ACTION_TOUCHED_WARP, 1, 0, 0}, &Room::demon2TouchedWarp1 },
+
+ { {ACTION_LOOK, 0x27, 0, 0}, &Room::demon2LookAtCave },
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::demon2LookAtCave },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::demon2LookAtMountain },
+ { {ACTION_LOOK, 0x22, 0, 0}, &Room::demon2LookAtMountain },
+ { {ACTION_LOOK, 0x23, 0, 0}, &Room::demon2LookAtBerries },
+ { {ACTION_LOOK, 0x24, 0, 0}, &Room::demon2LookAtFern },
+ { {ACTION_LOOK, 0x25, 0, 0}, &Room::demon2LookAtMoss },
+ { {ACTION_LOOK, 0x26, 0, 0}, &Room::demon2LookAtLights },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::demon2LookAtAnything },
+
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::demon2LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::demon2LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::demon2LookAtMcCoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::demon2LookAtRedshirt },
+
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::demon2TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::demon2TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::demon2TalkToMcCoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::demon2TalkToRedshirt },
+
+ { {ACTION_USE, OBJECT_IPHASERK, 0x23, 0}, &Room::demon2UsePhaserOnBerries },
+ { {ACTION_USE, OBJECT_IPHASERS, 0x23, 0}, &Room::demon2UsePhaserOnBerries },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x23, 0}, &Room::demon2UseSTricorderOnBerries },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x25, 0}, &Room::demon2UseSTricorderOnMoss },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x24, 0}, &Room::demon2UseSTricorderOnFern },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::demon2UseSTricorderOnCave },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::demon2UseSTricorderOnCave },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x22, 0}, &Room::demon2UseSTricorderOnCave },
+
+ { {ACTION_USE, OBJECT_IMTRICOR, 0x23, 0}, &Room::demon2UseMTricorderOnBerries },
+ { {ACTION_GET, 0x23, 0, 0}, &Room::demon2GetBerries },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::demon2ReachedBerries },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::demon2PickedUpBerries },
};
RoomAction demon3ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::demon3Tick1 },
- { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::demon3Timer0Expired },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::demon3Timer1Expired },
- { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::demon3Timer3Expired },
-
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::demon3FinishedAnimation1 },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::demon3FinishedAnimation2 },
- { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::demon3FinishedWalking5 },
-
- { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::demon3McCoyInFiringPosition },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::demon3SpockInFiringPosition },
- { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::demon3RedShirtInFiringPosition },
- { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::demon3KirkInFiringPosition },
-
- { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::demon3FireAtBoulder },
-
- { Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_REDSHIRT, 0), &Room::demon3UsePhaserOnRedshirt },
- { Action(ACTION_USE, OBJECT_IPHASERK, OBJECT_REDSHIRT, 0), &Room::demon3UsePhaserOnRedshirt },
-
- { Action(ACTION_USE, OBJECT_IPHASERS, 9, 0), &Room::demon3UseStunPhaserOnBoulder },
- { Action(ACTION_USE, OBJECT_IPHASERS, 10, 0), &Room::demon3UseStunPhaserOnBoulder },
- { Action(ACTION_USE, OBJECT_IPHASERS, 11, 0), &Room::demon3UseStunPhaserOnBoulder },
- { Action(ACTION_USE, OBJECT_IPHASERS, 12, 0), &Room::demon3UseStunPhaserOnBoulder },
-
- { Action(ACTION_USE, OBJECT_IPHASERK, 9, 0), &Room::demon3UsePhaserOnBoulder1 },
- { Action(ACTION_USE, OBJECT_IPHASERK, 10, 0), &Room::demon3UsePhaserOnBoulder2 },
- { Action(ACTION_USE, OBJECT_IPHASERK, 11, 0), &Room::demon3UsePhaserOnBoulder3 },
- { Action(ACTION_USE, OBJECT_IPHASERK, 12, 0), &Room::demon3UsePhaserOnBoulder4 },
-
- { Action(ACTION_USE, OBJECT_ISTRICOR, 13, 0), &Room::demon3UseSTricorderOnMiner },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::demon3UseSTricorderOnPanel },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 9, 0), &Room::demon3UseSTricorderOnBoulder },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 10, 0), &Room::demon3UseSTricorderOnBoulder },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 11, 0), &Room::demon3UseSTricorderOnBoulder },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 12, 0), &Room::demon3UseSTricorderOnBoulder },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 9, 0), &Room::demon3UseMTricorderOnBoulder },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 10, 0), &Room::demon3UseMTricorderOnBoulder },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 11, 0), &Room::demon3UseMTricorderOnBoulder },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 12, 0), &Room::demon3UseMTricorderOnBoulder },
-
- { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::demon3UseCrewmanOnPanel },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::demon3UseCrewmanOnPanel },
- { Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::demon3UseCrewmanOnPanel },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::demon3UseRedshirtOnPanel },
- { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::demon3RedshirtReachedPanel },
- { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::demon3RedshirtUsedPanel },
- { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::demon3RedshirtElectrocuted },
-
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::demon3UseSTricorderOnDoor },
- { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::demon3UseSTricorderOnAnything },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 14, 0), &Room::demon3UseMTricorderOnDoor },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::demon3UseMTricorderOnDoor },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0x22, 0), &Room::demon3UseMTricorderOnDoor },
- { Action(ACTION_USE, OBJECT_IPHASERS, 14, 0), &Room::demon3UsePhaserOnDoor },
- { Action(ACTION_USE, OBJECT_IPHASERK, 14, 0), &Room::demon3UsePhaserOnDoor },
- { Action(ACTION_USE, OBJECT_IPHASERS, 0x21, 0), &Room::demon3UsePhaserOnDoor },
- { Action(ACTION_USE, OBJECT_IPHASERK, 0x21, 0), &Room::demon3UsePhaserOnDoor },
-
- { Action(ACTION_USE, OBJECT_IHAND, 0x20, 0), &Room::demon3UseHandOnPanel },
- { Action(ACTION_FINISHED_WALKING, 7, 0, 0), &Room::demon3KirkReachedHandPanel },
- { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::demon3KirkUsedHandPanel },
-
- { Action(ACTION_USE, OBJECT_IMTRICOR, 13, 0), &Room::demon3UseMTricorderOnMiner },
- { Action(ACTION_USE, OBJECT_MCCOY, 13, 0), &Room::demon3UseMedkitOnMiner },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 13, 0), &Room::demon3UseMedkitOnMiner },
- { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::demon3McCoyReachedMiner },
- { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::demon3McCoyFinishedHealingMiner },
-
- { Action(ACTION_GET, 13, 0, 0), &Room::demon3GetMiner },
- { Action(ACTION_TALK, 13, 0, 0), &Room::demon3TalkToMiner },
-
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::demon3TalkToKirk },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::demon3TalkToSpock },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::demon3TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::demon3TalkToRedshirt },
-
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::demon3LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::demon3LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::demon3LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::demon3LookAtRedshirt },
-
- { Action(ACTION_LOOK, -1, 0, 0), &Room::demon3LookAnywhere },
- { Action(ACTION_LOOK, 13, 0, 0), &Room::demon3LookAtMiner },
- { Action(ACTION_LOOK, 9, 0, 0), &Room::demon3LookAtBoulder1 },
- { Action(ACTION_LOOK, 10, 0, 0), &Room::demon3LookAtBoulder2 },
- { Action(ACTION_LOOK, 11, 0, 0), &Room::demon3LookAtBoulder3 },
- { Action(ACTION_LOOK, 12, 0, 0), &Room::demon3LookAtBoulder4 },
- { Action(ACTION_LOOK, 0x22, 0, 0), &Room::demon3LookAtStructure },
- { Action(ACTION_LOOK, 14, 0, 0), &Room::demon3LookAtDoor },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::demon3LookAtDoor },
- { Action(ACTION_LOOK, 15, 0, 0), &Room::demon3LookAtPanel },
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon3LookAtPanel },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::demon3LookAtLight },
+ { {ACTION_TICK, 1, 0, 0}, &Room::demon3Tick1 },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::demon3Timer0Expired },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::demon3Timer1Expired },
+ { {ACTION_TIMER_EXPIRED, 3, 0, 0}, &Room::demon3Timer3Expired },
+
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::demon3FinishedAnimation1 },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::demon3FinishedAnimation2 },
+ { {ACTION_FINISHED_WALKING, 5, 0, 0}, &Room::demon3FinishedWalking5 },
+
+ { {ACTION_FINISHED_WALKING, 3, 0, 0}, &Room::demon3McCoyInFiringPosition },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::demon3SpockInFiringPosition },
+ { {ACTION_FINISHED_WALKING, 4, 0, 0}, &Room::demon3RedShirtInFiringPosition },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::demon3KirkInFiringPosition },
+
+ { {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::demon3FireAtBoulder },
+
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_REDSHIRT, 0}, &Room::demon3UsePhaserOnRedshirt },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_REDSHIRT, 0}, &Room::demon3UsePhaserOnRedshirt },
+
+ { {ACTION_USE, OBJECT_IPHASERS, 9, 0}, &Room::demon3UseStunPhaserOnBoulder },
+ { {ACTION_USE, OBJECT_IPHASERS, 10, 0}, &Room::demon3UseStunPhaserOnBoulder },
+ { {ACTION_USE, OBJECT_IPHASERS, 11, 0}, &Room::demon3UseStunPhaserOnBoulder },
+ { {ACTION_USE, OBJECT_IPHASERS, 12, 0}, &Room::demon3UseStunPhaserOnBoulder },
+
+ { {ACTION_USE, OBJECT_IPHASERK, 9, 0}, &Room::demon3UsePhaserOnBoulder1 },
+ { {ACTION_USE, OBJECT_IPHASERK, 10, 0}, &Room::demon3UsePhaserOnBoulder2 },
+ { {ACTION_USE, OBJECT_IPHASERK, 11, 0}, &Room::demon3UsePhaserOnBoulder3 },
+ { {ACTION_USE, OBJECT_IPHASERK, 12, 0}, &Room::demon3UsePhaserOnBoulder4 },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, 13, 0}, &Room::demon3UseSTricorderOnMiner },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::demon3UseSTricorderOnPanel },
+ { {ACTION_USE, OBJECT_ISTRICOR, 9, 0}, &Room::demon3UseSTricorderOnBoulder },
+ { {ACTION_USE, OBJECT_ISTRICOR, 10, 0}, &Room::demon3UseSTricorderOnBoulder },
+ { {ACTION_USE, OBJECT_ISTRICOR, 11, 0}, &Room::demon3UseSTricorderOnBoulder },
+ { {ACTION_USE, OBJECT_ISTRICOR, 12, 0}, &Room::demon3UseSTricorderOnBoulder },
+ { {ACTION_USE, OBJECT_IMTRICOR, 9, 0}, &Room::demon3UseMTricorderOnBoulder },
+ { {ACTION_USE, OBJECT_IMTRICOR, 10, 0}, &Room::demon3UseMTricorderOnBoulder },
+ { {ACTION_USE, OBJECT_IMTRICOR, 11, 0}, &Room::demon3UseMTricorderOnBoulder },
+ { {ACTION_USE, OBJECT_IMTRICOR, 12, 0}, &Room::demon3UseMTricorderOnBoulder },
+
+ { {ACTION_USE, OBJECT_KIRK, 0x20, 0}, &Room::demon3UseCrewmanOnPanel },
+ { {ACTION_USE, OBJECT_SPOCK, 0x20, 0}, &Room::demon3UseCrewmanOnPanel },
+ { {ACTION_USE, OBJECT_MCCOY, 0x20, 0}, &Room::demon3UseCrewmanOnPanel },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x20, 0}, &Room::demon3UseRedshirtOnPanel },
+ { {ACTION_FINISHED_WALKING, 8, 0, 0}, &Room::demon3RedshirtReachedPanel },
+ { {ACTION_FINISHED_ANIMATION, 5, 0, 0}, &Room::demon3RedshirtUsedPanel },
+ { {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::demon3RedshirtElectrocuted },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::demon3UseSTricorderOnDoor },
+ { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::demon3UseSTricorderOnAnything },
+ { {ACTION_USE, OBJECT_IMTRICOR, 14, 0}, &Room::demon3UseMTricorderOnDoor },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0x21, 0}, &Room::demon3UseMTricorderOnDoor },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0x22, 0}, &Room::demon3UseMTricorderOnDoor },
+ { {ACTION_USE, OBJECT_IPHASERS, 14, 0}, &Room::demon3UsePhaserOnDoor },
+ { {ACTION_USE, OBJECT_IPHASERK, 14, 0}, &Room::demon3UsePhaserOnDoor },
+ { {ACTION_USE, OBJECT_IPHASERS, 0x21, 0}, &Room::demon3UsePhaserOnDoor },
+ { {ACTION_USE, OBJECT_IPHASERK, 0x21, 0}, &Room::demon3UsePhaserOnDoor },
+
+ { {ACTION_USE, OBJECT_IHAND, 0x20, 0}, &Room::demon3UseHandOnPanel },
+ { {ACTION_FINISHED_WALKING, 7, 0, 0}, &Room::demon3KirkReachedHandPanel },
+ { {ACTION_FINISHED_ANIMATION, 6, 0, 0}, &Room::demon3KirkUsedHandPanel },
+
+ { {ACTION_USE, OBJECT_IMTRICOR, 13, 0}, &Room::demon3UseMTricorderOnMiner },
+ { {ACTION_USE, OBJECT_MCCOY, 13, 0}, &Room::demon3UseMedkitOnMiner },
+ { {ACTION_USE, OBJECT_IMEDKIT, 13, 0}, &Room::demon3UseMedkitOnMiner },
+ { {ACTION_FINISHED_WALKING, 6, 0, 0}, &Room::demon3McCoyReachedMiner },
+ { {ACTION_FINISHED_ANIMATION, 7, 0, 0}, &Room::demon3McCoyFinishedHealingMiner },
+
+ { {ACTION_GET, 13, 0, 0}, &Room::demon3GetMiner },
+ { {ACTION_TALK, 13, 0, 0}, &Room::demon3TalkToMiner },
+
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::demon3TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::demon3TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::demon3TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::demon3TalkToRedshirt },
+
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::demon3LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::demon3LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::demon3LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::demon3LookAtRedshirt },
+
+ { {ACTION_LOOK, -1, 0, 0}, &Room::demon3LookAnywhere },
+ { {ACTION_LOOK, 13, 0, 0}, &Room::demon3LookAtMiner },
+ { {ACTION_LOOK, 9, 0, 0}, &Room::demon3LookAtBoulder1 },
+ { {ACTION_LOOK, 10, 0, 0}, &Room::demon3LookAtBoulder2 },
+ { {ACTION_LOOK, 11, 0, 0}, &Room::demon3LookAtBoulder3 },
+ { {ACTION_LOOK, 12, 0, 0}, &Room::demon3LookAtBoulder4 },
+ { {ACTION_LOOK, 0x22, 0, 0}, &Room::demon3LookAtStructure },
+ { {ACTION_LOOK, 14, 0, 0}, &Room::demon3LookAtDoor },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::demon3LookAtDoor },
+ { {ACTION_LOOK, 15, 0, 0}, &Room::demon3LookAtPanel },
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::demon3LookAtPanel },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::demon3LookAtLight },
};
RoomAction demon4ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::demon4Tick1 },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::demon4FinishedAnimation1 },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::demon4FinishedAnimation2 },
- { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::demon4FinishedAnimation3 },
- { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::demon4Timer0Expired },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::demon4Timer1Expired },
- { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::demon4CrewmanReachedBeamoutPosition },
- { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::demon4Timer2Expired },
- { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::demon4Timer3Expired },
- { Action(ACTION_TIMER_EXPIRED, 4, 0, 0), &Room::demon4Timer4Expired },
- { Action(ACTION_TIMER_EXPIRED, 5, 0, 0), &Room::demon4Timer5Expired },
- { Action(ACTION_TIMER_EXPIRED, 6, 0, 0), &Room::demon4Timer6Expired },
-
- { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::demon4UsePhaserOnNauian },
- { Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::demon4UsePhaserOnNauian },
- { Action(ACTION_USE, OBJECT_IMETAL, 0x22, 0), &Room::demon4UseMetalOnSecurityEquipment },
- { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::demon4KirkReachedSecurityEquipment },
- { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::demon4KirkFinishedUsingSecurityEquipment },
- { Action(ACTION_USE, OBJECT_IMETAL, 8, 0), &Room::demon4UseMetalOnNauian },
- { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::demon4KirkReachedNauian },
- { Action(ACTION_USE, OBJECT_ISKULL, 8, 0), &Room::demon4UseSkullOnNauian },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::demon4KirkReachedNauianWithSkull },
-
- { Action(ACTION_USE, OBJECT_IPHASERS, 0x21, 0), &Room::demon4UsePhaserOnPanel },
- { Action(ACTION_USE, OBJECT_IPHASERS, 0x20, 0), &Room::demon4UsePhaserOnPattern },
- { Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_MCCOY, 0), &Room::demon4UsePhaserOnMccoy },
-
- { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::demon4TalkToNauian },
- { Action(ACTION_TALK, 8, 0, 0), &Room::demon4TalkToNauian },
-
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon4LookAtPattern },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::demon4LookAtAlien },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::demon4LookAnywhere },
- { Action(ACTION_LOOK, 0x22, 0, 0), &Room::demon4LookAtSecurityEquipment },
- { Action(ACTION_LOOK, 0x23, 0, 0), &Room::demon4LookAtFloor },
-
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::demon4LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::demon4LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::demon4LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::demon4LookAtRedshirt },
-
- { Action(ACTION_LOOK, 10, 0, 0), &Room::demon4LookAtChamber },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::demon4LookAtPanel },
-
- { Action(ACTION_USE, OBJECT_KIRK, 0x21, 0), &Room::demon4UseKirkOnPanel },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x21, 0), &Room::demon4UseSpockOnPanel },
- { Action(ACTION_USE, OBJECT_MCCOY, 0x21, 0), &Room::demon4UseMccoyOnPanel },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x21, 0), &Room::demon4UseRedshirtOnPanel },
- { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::demon4CrewmanReachedPanel },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::demon4TalkToKirk },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::demon4TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::demon4TalkToSpock },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::demon4TalkToRedshirt },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 10, 0), &Room::demon4UseSTricorderOnChamber },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::demon4UseSTricorderOnPattern },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0x20, 0), &Room::demon4UseMTricorderOnPattern },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::demon4UseSTricorderOnPanel },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::demon4UseMTricorderOnPanel },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::demon4UseSTricorderOnAnything },
- { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::demon4UseSTricorderOnAnything },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0x23, 0), &Room::demon4UseMTricorderOnAnything },
- { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::demon4UseMTricorderOnAnything },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::demon4UseSTricorderOnNauian },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::demon4UseMTricorderOnNauian },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::demon4UseSTricorderOnSecurityEquipment },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0x22, 0), &Room::demon4UseMTricorderOnSecurityEquipment },
+ { {ACTION_TICK, 1, 0, 0}, &Room::demon4Tick1 },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::demon4FinishedAnimation1 },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::demon4FinishedAnimation2 },
+ { {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::demon4FinishedAnimation3 },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::demon4Timer0Expired },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::demon4Timer1Expired },
+ { {ACTION_FINISHED_WALKING, 4, 0, 0}, &Room::demon4CrewmanReachedBeamoutPosition },
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::demon4Timer2Expired },
+ { {ACTION_TIMER_EXPIRED, 3, 0, 0}, &Room::demon4Timer3Expired },
+ { {ACTION_TIMER_EXPIRED, 4, 0, 0}, &Room::demon4Timer4Expired },
+ { {ACTION_TIMER_EXPIRED, 5, 0, 0}, &Room::demon4Timer5Expired },
+ { {ACTION_TIMER_EXPIRED, 6, 0, 0}, &Room::demon4Timer6Expired },
+
+ { {ACTION_USE, OBJECT_IPHASERK, 8, 0}, &Room::demon4UsePhaserOnNauian },
+ { {ACTION_USE, OBJECT_IPHASERS, 8, 0}, &Room::demon4UsePhaserOnNauian },
+ { {ACTION_USE, OBJECT_IMETAL, 0x22, 0}, &Room::demon4UseMetalOnSecurityEquipment },
+ { {ACTION_FINISHED_WALKING, 5, 0, 0}, &Room::demon4KirkReachedSecurityEquipment },
+ { {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::demon4KirkFinishedUsingSecurityEquipment },
+ { {ACTION_USE, OBJECT_IMETAL, 8, 0}, &Room::demon4UseMetalOnNauian },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::demon4KirkReachedNauian },
+ { {ACTION_USE, OBJECT_ISKULL, 8, 0}, &Room::demon4UseSkullOnNauian },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::demon4KirkReachedNauianWithSkull },
+
+ { {ACTION_USE, OBJECT_IPHASERS, 0x21, 0}, &Room::demon4UsePhaserOnPanel },
+ { {ACTION_USE, OBJECT_IPHASERS, 0x20, 0}, &Room::demon4UsePhaserOnPattern },
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_MCCOY, 0}, &Room::demon4UsePhaserOnMccoy },
+
+ { {ACTION_FINISHED_ANIMATION, 5, 0, 0}, &Room::demon4TalkToNauian },
+ { {ACTION_TALK, 8, 0, 0}, &Room::demon4TalkToNauian },
+
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::demon4LookAtPattern },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::demon4LookAtAlien },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::demon4LookAnywhere },
+ { {ACTION_LOOK, 0x22, 0, 0}, &Room::demon4LookAtSecurityEquipment },
+ { {ACTION_LOOK, 0x23, 0, 0}, &Room::demon4LookAtFloor },
+
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::demon4LookAtKirk },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::demon4LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::demon4LookAtSpock },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::demon4LookAtRedshirt },
+
+ { {ACTION_LOOK, 10, 0, 0}, &Room::demon4LookAtChamber },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::demon4LookAtPanel },
+
+ { {ACTION_USE, OBJECT_KIRK, 0x21, 0}, &Room::demon4UseKirkOnPanel },
+ { {ACTION_USE, OBJECT_SPOCK, 0x21, 0}, &Room::demon4UseSpockOnPanel },
+ { {ACTION_USE, OBJECT_MCCOY, 0x21, 0}, &Room::demon4UseMccoyOnPanel },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x21, 0}, &Room::demon4UseRedshirtOnPanel },
+ { {ACTION_FINISHED_WALKING, 3, 0, 0}, &Room::demon4CrewmanReachedPanel },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::demon4TalkToKirk },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::demon4TalkToMccoy },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::demon4TalkToSpock },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::demon4TalkToRedshirt },
+ { {ACTION_USE, OBJECT_ISTRICOR, 10, 0}, &Room::demon4UseSTricorderOnChamber },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::demon4UseSTricorderOnPattern },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0x20, 0}, &Room::demon4UseMTricorderOnPattern },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::demon4UseSTricorderOnPanel },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0x21, 0}, &Room::demon4UseMTricorderOnPanel },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x23, 0}, &Room::demon4UseSTricorderOnAnything },
+ { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::demon4UseSTricorderOnAnything },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0x23, 0}, &Room::demon4UseMTricorderOnAnything },
+ { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::demon4UseMTricorderOnAnything },
+ { {ACTION_USE, OBJECT_ISTRICOR, 8, 0}, &Room::demon4UseSTricorderOnNauian },
+ { {ACTION_USE, OBJECT_IMTRICOR, 8, 0}, &Room::demon4UseMTricorderOnNauian },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x22, 0}, &Room::demon4UseSTricorderOnSecurityEquipment },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0x22, 0}, &Room::demon4UseMTricorderOnSecurityEquipment },
};
RoomAction demon5ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::demon5Tick1 },
- { Action(ACTION_WALK, 0x22, 0, 0), &Room::demon5WalkToDoor },
- { Action(ACTION_WALK, 12, 0, 0), &Room::demon5WalkToDoor },
- { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::demon5TouchedDoorOpenTrigger },
- { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::demon5DoorOpenedOrReachedDoor },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::demon5DoorOpenedOrReachedDoor },
-
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::demon5UseSTricorderOnCrate },
- { Action(ACTION_USE, OBJECT_IPHASERK, -1, 0), &Room::demon5UsePhaserOnAnything },
- { Action(ACTION_USE, OBJECT_IPHASERS, -1, 0), &Room::demon5UsePhaserOnAnything },
-
- { Action(ACTION_USE, OBJECT_IHAND, 11, 0), &Room::demon5UseHandOnStephen },
- { Action(ACTION_USE, OBJECT_IBERRY, 11, 0), &Room::demon5UseBerryOnStephen },
- { Action(ACTION_USE, OBJECT_IDETOXIN, 9, 0), &Room::demon5UseHypoDytoxinOnChub },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::demon5MccoyReachedChub },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::demon5MccoyHealedChub },
-
- { Action(ACTION_USE, OBJECT_IDETOXIN, -1, 0), &Room::demon5UseHypoDytoxinOnAnything },
- { Action(ACTION_USE, OBJECT_IBERRY, 9, 0), &Room::demon5UseBerryOnChub },
-
- { Action(ACTION_LOOK, 8, 0, 0), &Room::demon5LookAtRoberts },
- { Action(ACTION_LOOK, 10, 0, 0), &Room::demon5LookAtGrisnash },
- { Action(ACTION_LOOK, 11, 0, 0), &Room::demon5LookAtStephen },
-
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::demon5LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::demon5LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::demon5LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::demon5LookAtRedshirt },
-
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon5LookAtMountain },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::demon5LookAtCrate },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::demon5LookAnywhere },
- { Action(ACTION_LOOK, 9, 0, 0), &Room::demon5LookAtChub },
-
- { Action(ACTION_TALK, 8, 0, 0), &Room::demon5TalkToRoberts },
- { Action(ACTION_TALK, 9, 0, 0), &Room::demon5TalkToChub },
- { Action(ACTION_TALK, 10, 0, 0), &Room::demon5TalkToGrisnash },
- { Action(ACTION_TALK, 11, 0, 0), &Room::demon5TalkToStephen },
-
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::demon5TalkToKirk },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::demon5TalkToSpock },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::demon5TalkToRedshirt },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::demon5TalkToMccoy },
-
- { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::demon5UseMTricorderOnRoberts },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 9, 0), &Room::demon5UseMTricorderOnChub },
- { Action(ACTION_USE, OBJECT_MCCOY, 9, 0), &Room::demon5UseMTricorderOnChub },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 9, 0), &Room::demon5UseMTricorderOnChub },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 10, 0), &Room::demon5UseMTricorderOnGrisnash },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 11, 0), &Room::demon5UseMTricorderOnStephen },
-
- { Action(ACTION_GET, 0x21, 0, 0), &Room::demon5GetCrate },
+ { {ACTION_TICK, 1, 0, 0}, &Room::demon5Tick1 },
+ { {ACTION_WALK, 0x22, 0, 0}, &Room::demon5WalkToDoor },
+ { {ACTION_WALK, 12, 0, 0}, &Room::demon5WalkToDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::demon5TouchedDoorOpenTrigger },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::demon5DoorOpenedOrReachedDoor },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::demon5DoorOpenedOrReachedDoor },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::demon5UseSTricorderOnCrate },
+ { {ACTION_USE, OBJECT_IPHASERK, -1, 0}, &Room::demon5UsePhaserOnAnything },
+ { {ACTION_USE, OBJECT_IPHASERS, -1, 0}, &Room::demon5UsePhaserOnAnything },
+
+ { {ACTION_USE, OBJECT_IHAND, 11, 0}, &Room::demon5UseHandOnStephen },
+ { {ACTION_USE, OBJECT_IBERRY, 11, 0}, &Room::demon5UseBerryOnStephen },
+ { {ACTION_USE, OBJECT_IDETOXIN, 9, 0}, &Room::demon5UseHypoDytoxinOnChub },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::demon5MccoyReachedChub },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::demon5MccoyHealedChub },
+
+ { {ACTION_USE, OBJECT_IDETOXIN, -1, 0}, &Room::demon5UseHypoDytoxinOnAnything },
+ { {ACTION_USE, OBJECT_IBERRY, 9, 0}, &Room::demon5UseBerryOnChub },
+
+ { {ACTION_LOOK, 8, 0, 0}, &Room::demon5LookAtRoberts },
+ { {ACTION_LOOK, 10, 0, 0}, &Room::demon5LookAtGrisnash },
+ { {ACTION_LOOK, 11, 0, 0}, &Room::demon5LookAtStephen },
+
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::demon5LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::demon5LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::demon5LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::demon5LookAtRedshirt },
+
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::demon5LookAtMountain },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::demon5LookAtCrate },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::demon5LookAnywhere },
+ { {ACTION_LOOK, 9, 0, 0}, &Room::demon5LookAtChub },
+
+ { {ACTION_TALK, 8, 0, 0}, &Room::demon5TalkToRoberts },
+ { {ACTION_TALK, 9, 0, 0}, &Room::demon5TalkToChub },
+ { {ACTION_TALK, 10, 0, 0}, &Room::demon5TalkToGrisnash },
+ { {ACTION_TALK, 11, 0, 0}, &Room::demon5TalkToStephen },
+
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::demon5TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::demon5TalkToSpock },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::demon5TalkToRedshirt },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::demon5TalkToMccoy },
+
+ { {ACTION_USE, OBJECT_IMTRICOR, 8, 0}, &Room::demon5UseMTricorderOnRoberts },
+ { {ACTION_USE, OBJECT_IMEDKIT, 9, 0}, &Room::demon5UseMTricorderOnChub },
+ { {ACTION_USE, OBJECT_MCCOY, 9, 0}, &Room::demon5UseMTricorderOnChub },
+ { {ACTION_USE, OBJECT_IMTRICOR, 9, 0}, &Room::demon5UseMTricorderOnChub },
+ { {ACTION_USE, OBJECT_IMTRICOR, 10, 0}, &Room::demon5UseMTricorderOnGrisnash },
+ { {ACTION_USE, OBJECT_IMTRICOR, 11, 0}, &Room::demon5UseMTricorderOnStephen },
+
+ { {ACTION_GET, 0x21, 0, 0}, &Room::demon5GetCrate },
};
RoomAction demon6ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::demon6Tick1 },
- { Action(ACTION_TICK, 30, 0, 0), &Room::demon6Tick30 },
- { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::demon6SpockReachedComputer },
-
- { Action(ACTION_WALK, 0x26, 0, 0), &Room::demon6WalkToDoor },
- { Action(ACTION_WALK, 10, 0, 0), &Room::demon6WalkToDoor },
- { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::demon6TouchedDoorOpenTrigger },
- { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::demon6DoorOpenedOrReachedDoor },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::demon6DoorOpenedOrReachedDoor },
- { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::demon6UsePhaserOnStephen },
- { Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::demon6UsePhaserOnStephen },
- { Action(ACTION_USE, OBJECT_IPHASERK, 0x20, 0), &Room::demon6UsePhaserOnCase },
- { Action(ACTION_USE, OBJECT_IPHASERS, 0x20, 0), &Room::demon6UsePhaserOnCase },
- { Action(ACTION_LOOK, 0x22, 0, 0), &Room::demon6LookAtWorkspace },
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon6LookAtCase },
- { Action(ACTION_LOOK, 0x25, 0, 0), &Room::demon6LookAtTable },
- { Action(ACTION_LOOK, OBJECT_IMINERAL, 0, 0), &Room::demon6LookAtMineral },
- { Action(ACTION_LOOK, OBJECT_ISHELLS, 0, 0), &Room::demon6LookAtShells },
- { Action(ACTION_LOOK, OBJECT_ISKULL, 0, 0), &Room::demon6LookAtSkull },
- { Action(ACTION_LOOK, OBJECT_IMETAL, 0, 0), &Room::demon6LookAtMetal },
- { Action(ACTION_LOOK, OBJECT_IMETEOR, 0, 0), &Room::demon6LookAtMeteor },
- { Action(ACTION_LOOK, 0x24, 0, 0), &Room::demon6LookAtMountain },
- { Action(ACTION_LOOK, 0x23, 0, 0), &Room::demon6LookAtSynthesizer },
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::demon6LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::demon6LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::demon6LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::demon6LookAtRedshirt },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::demon6LookAtComputer },
- { Action(ACTION_LOOK, 9, 0, 0), &Room::demon6LookAtComputer },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::demon6LookAnywhere },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::demon6LookAtStephen },
-
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::demon6TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::demon6TalkToSpock },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::demon6TalkToKirk },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::demon6TalkToRedshirt },
- { Action(ACTION_TALK, 8, 0, 0), &Room::demon6TalkToStephen },
- { Action(ACTION_USE, OBJECT_IBERRY, 8, 0), &Room::demon6UseBerryOnStephen },
- { Action(ACTION_USE, OBJECT_IBERRY, 0x23, 0), &Room::demon6UseBerryOnSynthesizer },
- { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::demon6MccoyReachedSynthesizer },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::demon6FinishedMakingHypoDytoxin },
- { Action(ACTION_USE, OBJECT_IHAND, 0x22, 0), &Room::demon6UseHandOnWorkspace },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::demon6SpockReachedWorkspace },
- { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::demon6SpockFinishedRepairingHand },
- { Action(ACTION_USE, -1, 0x22, 0), &Room::demon6UseAnythingOnWorkspace },
- { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::demon6UseCrewmanOnCase },
- { Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::demon6UseCrewmanOnCase },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::demon6UseCrewmanOnCase },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::demon6UseCrewmanOnCase },
-
- { Action(ACTION_USE, OBJECT_KIRK, 0x21, 0), &Room::demon6UseKirkOnComputer },
- { Action(ACTION_USE, OBJECT_KIRK, 9, 0), &Room::demon6UseKirkOnComputer },
- { Action(ACTION_USE, OBJECT_MCCOY, 0x21, 0), &Room::demon6UseMccoyOnComputer },
- { Action(ACTION_USE, OBJECT_MCCOY, 9, 0), &Room::demon6UseMccoyOnComputer },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x21, 0), &Room::demon6UseRedshirtOnComputer },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 9, 0), &Room::demon6UseRedshirtOnComputer },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x21, 0), &Room::demon6UseSpockOnComputer },
- { Action(ACTION_USE, OBJECT_SPOCK, 9, 0), &Room::demon6UseSpockOnComputer },
- { Action(ACTION_USE, OBJECT_IMINERAL, 8, 0), &Room::demon6UseMineralOnStephen },
- { Action(ACTION_USE, OBJECT_ISHELLS, 8, 0), &Room::demon6UseShellsOnStephen },
- { Action(ACTION_USE, OBJECT_IMETEOR, 8, 0), &Room::demon6UseMeteorOnStephen },
- { Action(ACTION_USE, OBJECT_ISKULL, 8, 0), &Room::demon6UseSkullOnStephen },
- { Action(ACTION_USE, OBJECT_IMETAL, 8, 0), &Room::demon6UseMetalOnStephen },
- { Action(ACTION_USE, OBJECT_IHAND, 8, 0), &Room::demon6UseHandOnStephen },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::demon6UseMTricoderOnStephen },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x25, 0), &Room::demon6UseSTricoderOnTable },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 9, 0), &Room::demon6UseSTricoderOnComputer },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::demon6UseSTricoderOnComputer },
- { Action(ACTION_USE, OBJECT_ISTRICOR, OBJECT_IMINERAL, 0), &Room::demon6UseSTricoderOnMineral },
- { Action(ACTION_USE, OBJECT_ISTRICOR, OBJECT_ISHELLS, 0), &Room::demon6UseSTricoderOnShells },
- { Action(ACTION_USE, OBJECT_ISTRICOR, OBJECT_ISKULL, 0), &Room::demon6UseSTricoderOnSkull },
- { Action(ACTION_USE, OBJECT_ISTRICOR, OBJECT_IMETAL, 0), &Room::demon6UseSTricoderOnMetal },
- { Action(ACTION_USE, OBJECT_ISTRICOR, OBJECT_IMETEOR, 0), &Room::demon6UseSTricoderOnMeteor },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::demon6UseSTricoderOnCase },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::demon6UseSTricoderOnSynthesizer },
- { Action(ACTION_GET, 0x20, 0, 0), &Room::demon6GetCase },
- { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::demon6KirkReachedCase },
+ { {ACTION_TICK, 1, 0, 0}, &Room::demon6Tick1 },
+ { {ACTION_TICK, 30, 0, 0}, &Room::demon6Tick30 },
+ { {ACTION_FINISHED_WALKING, 3, 0, 0}, &Room::demon6SpockReachedComputer },
+
+ { {ACTION_WALK, 0x26, 0, 0}, &Room::demon6WalkToDoor },
+ { {ACTION_WALK, 10, 0, 0}, &Room::demon6WalkToDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::demon6TouchedDoorOpenTrigger },
+ { {ACTION_FINISHED_WALKING, 4, 0, 0}, &Room::demon6DoorOpenedOrReachedDoor },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::demon6DoorOpenedOrReachedDoor },
+ { {ACTION_USE, OBJECT_IPHASERK, 8, 0}, &Room::demon6UsePhaserOnStephen },
+ { {ACTION_USE, OBJECT_IPHASERS, 8, 0}, &Room::demon6UsePhaserOnStephen },
+ { {ACTION_USE, OBJECT_IPHASERK, 0x20, 0}, &Room::demon6UsePhaserOnCase },
+ { {ACTION_USE, OBJECT_IPHASERS, 0x20, 0}, &Room::demon6UsePhaserOnCase },
+ { {ACTION_LOOK, 0x22, 0, 0}, &Room::demon6LookAtWorkspace },
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::demon6LookAtCase },
+ { {ACTION_LOOK, 0x25, 0, 0}, &Room::demon6LookAtTable },
+ { {ACTION_LOOK, OBJECT_IMINERAL, 0, 0}, &Room::demon6LookAtMineral },
+ { {ACTION_LOOK, OBJECT_ISHELLS, 0, 0}, &Room::demon6LookAtShells },
+ { {ACTION_LOOK, OBJECT_ISKULL, 0, 0}, &Room::demon6LookAtSkull },
+ { {ACTION_LOOK, OBJECT_IMETAL, 0, 0}, &Room::demon6LookAtMetal },
+ { {ACTION_LOOK, OBJECT_IMETEOR, 0, 0}, &Room::demon6LookAtMeteor },
+ { {ACTION_LOOK, 0x24, 0, 0}, &Room::demon6LookAtMountain },
+ { {ACTION_LOOK, 0x23, 0, 0}, &Room::demon6LookAtSynthesizer },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::demon6LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::demon6LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::demon6LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::demon6LookAtRedshirt },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::demon6LookAtComputer },
+ { {ACTION_LOOK, 9, 0, 0}, &Room::demon6LookAtComputer },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::demon6LookAnywhere },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::demon6LookAtStephen },
+
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::demon6TalkToMccoy },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::demon6TalkToSpock },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::demon6TalkToKirk },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::demon6TalkToRedshirt },
+ { {ACTION_TALK, 8, 0, 0}, &Room::demon6TalkToStephen },
+ { {ACTION_USE, OBJECT_IBERRY, 8, 0}, &Room::demon6UseBerryOnStephen },
+ { {ACTION_USE, OBJECT_IBERRY, 0x23, 0}, &Room::demon6UseBerryOnSynthesizer },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::demon6MccoyReachedSynthesizer },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::demon6FinishedMakingHypoDytoxin },
+ { {ACTION_USE, OBJECT_IHAND, 0x22, 0}, &Room::demon6UseHandOnWorkspace },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::demon6SpockReachedWorkspace },
+ { {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::demon6SpockFinishedRepairingHand },
+ { {ACTION_USE, -1, 0x22, 0}, &Room::demon6UseAnythingOnWorkspace },
+ { {ACTION_USE, OBJECT_KIRK, 0x20, 0}, &Room::demon6UseCrewmanOnCase },
+ { {ACTION_USE, OBJECT_MCCOY, 0x20, 0}, &Room::demon6UseCrewmanOnCase },
+ { {ACTION_USE, OBJECT_SPOCK, 0x20, 0}, &Room::demon6UseCrewmanOnCase },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x20, 0}, &Room::demon6UseCrewmanOnCase },
+
+ { {ACTION_USE, OBJECT_KIRK, 0x21, 0}, &Room::demon6UseKirkOnComputer },
+ { {ACTION_USE, OBJECT_KIRK, 9, 0}, &Room::demon6UseKirkOnComputer },
+ { {ACTION_USE, OBJECT_MCCOY, 0x21, 0}, &Room::demon6UseMccoyOnComputer },
+ { {ACTION_USE, OBJECT_MCCOY, 9, 0}, &Room::demon6UseMccoyOnComputer },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x21, 0}, &Room::demon6UseRedshirtOnComputer },
+ { {ACTION_USE, OBJECT_REDSHIRT, 9, 0}, &Room::demon6UseRedshirtOnComputer },
+ { {ACTION_USE, OBJECT_SPOCK, 0x21, 0}, &Room::demon6UseSpockOnComputer },
+ { {ACTION_USE, OBJECT_SPOCK, 9, 0}, &Room::demon6UseSpockOnComputer },
+ { {ACTION_USE, OBJECT_IMINERAL, 8, 0}, &Room::demon6UseMineralOnStephen },
+ { {ACTION_USE, OBJECT_ISHELLS, 8, 0}, &Room::demon6UseShellsOnStephen },
+ { {ACTION_USE, OBJECT_IMETEOR, 8, 0}, &Room::demon6UseMeteorOnStephen },
+ { {ACTION_USE, OBJECT_ISKULL, 8, 0}, &Room::demon6UseSkullOnStephen },
+ { {ACTION_USE, OBJECT_IMETAL, 8, 0}, &Room::demon6UseMetalOnStephen },
+ { {ACTION_USE, OBJECT_IHAND, 8, 0}, &Room::demon6UseHandOnStephen },
+ { {ACTION_USE, OBJECT_IMTRICOR, 8, 0}, &Room::demon6UseMTricoderOnStephen },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x25, 0}, &Room::demon6UseSTricoderOnTable },
+ { {ACTION_USE, OBJECT_ISTRICOR, 9, 0}, &Room::demon6UseSTricoderOnComputer },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::demon6UseSTricoderOnComputer },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_IMINERAL, 0}, &Room::demon6UseSTricoderOnMineral },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_ISHELLS, 0}, &Room::demon6UseSTricoderOnShells },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_ISKULL, 0}, &Room::demon6UseSTricoderOnSkull },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_IMETAL, 0}, &Room::demon6UseSTricoderOnMetal },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_IMETEOR, 0}, &Room::demon6UseSTricoderOnMeteor },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::demon6UseSTricoderOnCase },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x23, 0}, &Room::demon6UseSTricoderOnSynthesizer },
+ { {ACTION_GET, 0x20, 0, 0}, &Room::demon6GetCase },
+ { {ACTION_FINISHED_WALKING, 5, 0, 0}, &Room::demon6KirkReachedCase },
};
RoomAction tug0ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::tug0Tick1 },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::tug0LookAtEngineer },
- { Action(ACTION_GET, 8, 0, 0), &Room::tug0GetEngineer },
-
- { Action(ACTION_LOOK, 11, 0, 0), &Room::tug0LookAtControls },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::tug0LookAtControls },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x21, 0), &Room::tug0UseSpockOnControls },
- { Action(ACTION_FINISHED_WALKING, 16, 0, 0), &Room::tug0SpockReachedControlsToExamine },
- { Action(ACTION_FINISHED_ANIMATION, 17, 0, 0), &Room::tug0SpockExaminedControls },
- { Action(ACTION_USE, OBJECT_IRT, 0x21, 0), &Room::tug0UseTransmogrifierWithoutBitOnControls },
- { Action(ACTION_USE, OBJECT_IRTWB, 0x21, 0), &Room::tug0UseTransmogrifierWithBitOnControls },
- { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::tug0SpockReachedControlsWithTransmogrifier },
- { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::tug0SpockFinishedUsingTransmogrifier },
- { Action(ACTION_FINISHED_ANIMATION, 22, 0, 0), &Room::tug0TransporterScreenFullyLit },
- { Action(ACTION_USE, OBJECT_IWIRSCRP, 0x21, 0), &Room::tug0UseWireScrapsOnControls },
- { Action(ACTION_USE, OBJECT_IWIRING, 0x21, 0), &Room::tug0UseWireOnControls },
- { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::tug0SpockReachedControlsWithWire },
- { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::tug0SpockFinishedUsingWire },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 8, 0), &Room::tug0UseMedkitOnEngineer },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::tug0MccoyReachedEngineer },
- { Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::tug0MccoyHealedEngineer },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::tug0EngineerGotUp },
- { Action(ACTION_GET, 9, 0, 0), &Room::tug0GetTransmogrifier },
- { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::tug0KirkReachedToolbox },
- { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::tug0KirkGotTransmogrifier },
- { Action(ACTION_LOOK, 9, 0, 0), &Room::tug0LookAtToolbox },
-
- { Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_IPWE, 0), &Room::tug0UsePhaserOnWelder },
- { Action(ACTION_USE, OBJECT_IPHASERK, OBJECT_IPWE, 0), &Room::tug0UsePhaserOnWelder },
- { Action(ACTION_USE, OBJECT_IPWF, OBJECT_IWIRSCRP, 0), &Room::tug0UseWelderOnWireScraps },
- { Action(ACTION_USE, OBJECT_IPWF, OBJECT_IJNKMETL, 0), &Room::tug0UseWelderOnMetalScraps },
- { Action(ACTION_USE, OBJECT_ICOMBBIT, OBJECT_IRT, 0), &Room::tug0UseCombBitOnTransmogrifier },
-
- { Action(ACTION_USE, OBJECT_SPOCK, 11, 0), &Room::tug0UseTransporter },
- { Action(ACTION_USE, OBJECT_KIRK, 0x22, 0), &Room::tug0UseTransporter },
- { Action(ACTION_FINISHED_WALKING, 14, 0, 0), &Room::tug0SpockReachedControlsToTransport },
- { Action(ACTION_FINISHED_ANIMATION, 18, 0, 0), &Room::tug0SpockPreparedTransporter },
- { Action(ACTION_FINISHED_WALKING, 20, 0, 0), &Room::tug0SpockReachedTransporter },
- { Action(ACTION_FINISHED_ANIMATION, 21, 0, 0), &Room::tug0FinishedTransporting },
-
- { Action(ACTION_USE, OBJECT_IBOMB, 0x22, 0), &Room::tug0UseBombOnTransporter },
- { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::tug0KirkReachedTransporter },
- { Action(ACTION_FINISHED_ANIMATION, 10, 0, 0), &Room::tug0KirkPlacedBomb },
- { Action(ACTION_FINISHED_WALKING, 15, 0, 0), &Room::tug0SpockReachedControlsForBomb },
- { Action(ACTION_FINISHED_ANIMATION, 19, 0, 0), &Room::tug0SpockBeginsBeamingBomb },
- { Action(ACTION_FINISHED_ANIMATION, 12, 0, 0), &Room::tug0SpockFinishesBeamingBomb },
- { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::tug0BombExploded },
-
- { Action(ACTION_USE, OBJECT_MCCOY, 0x21, 0), &Room::tug0UseMTricorderOnControls },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::tug0UseMTricorderOnControls },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::tug0UseSTricorderOnControls },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::tug0UseMTricorderOnEngineer },
- { Action(ACTION_FINISHED_WALKING, 24, 0, 0), &Room::tug0MccoyReachedEngineerToScan },
- { Action(ACTION_FINISHED_ANIMATION, 25, 0, 0), &Room::tug0MccoyFinishedScanningEngineer },
- { Action(ACTION_USE, OBJECT_SPOCK, 8, 0), &Room::tug0UseSTricorderOnEngineer },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::tug0UseSTricorderOnEngineer },
- { Action(ACTION_WALK, 0x23, 0, 0), &Room::tug0WalkToDoor },
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::tug0LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::tug0LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::tug0LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::tug0LookAtRedshirt },
- { Action(ACTION_LOOK, 0x22, 0, 0), &Room::tug0LookAtTransporter },
- { Action(ACTION_LOOK, 0x23, 0, 0), &Room::tug0LookAtDoor },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::tug0TalkToKirk },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::tug0TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::tug0TalkToSpock },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::tug0TalkToRedshirt },
- { Action(ACTION_TALK, 8, 0, 0), &Room::tug0TalkToEngineer },
- { Action(ACTION_USE, OBJECT_ICOMM, 0, 0), &Room::tug0UseCommunicator },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::tug0LookAnywhere },
- { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::tug0UseSTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::tug0UseMTricorderAnywhere },
+ { {ACTION_TICK, 1, 0, 0}, &Room::tug0Tick1 },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::tug0LookAtEngineer },
+ { {ACTION_GET, 8, 0, 0}, &Room::tug0GetEngineer },
+
+ { {ACTION_LOOK, 11, 0, 0}, &Room::tug0LookAtControls },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::tug0LookAtControls },
+ { {ACTION_USE, OBJECT_SPOCK, 0x21, 0}, &Room::tug0UseSpockOnControls },
+ { {ACTION_FINISHED_WALKING, 16, 0, 0}, &Room::tug0SpockReachedControlsToExamine },
+ { {ACTION_FINISHED_ANIMATION, 17, 0, 0}, &Room::tug0SpockExaminedControls },
+ { {ACTION_USE, OBJECT_IRT, 0x21, 0}, &Room::tug0UseTransmogrifierWithoutBitOnControls },
+ { {ACTION_USE, OBJECT_IRTWB, 0x21, 0}, &Room::tug0UseTransmogrifierWithBitOnControls },
+ { {ACTION_FINISHED_WALKING, 6, 0, 0}, &Room::tug0SpockReachedControlsWithTransmogrifier },
+ { {ACTION_FINISHED_ANIMATION, 7, 0, 0}, &Room::tug0SpockFinishedUsingTransmogrifier },
+ { {ACTION_FINISHED_ANIMATION, 22, 0, 0}, &Room::tug0TransporterScreenFullyLit },
+ { {ACTION_USE, OBJECT_IWIRSCRP, 0x21, 0}, &Room::tug0UseWireScrapsOnControls },
+ { {ACTION_USE, OBJECT_IWIRING, 0x21, 0}, &Room::tug0UseWireOnControls },
+ { {ACTION_FINISHED_WALKING, 8, 0, 0}, &Room::tug0SpockReachedControlsWithWire },
+ { {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::tug0SpockFinishedUsingWire },
+ { {ACTION_USE, OBJECT_IMEDKIT, 8, 0}, &Room::tug0UseMedkitOnEngineer },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::tug0MccoyReachedEngineer },
+ { {ACTION_FINISHED_ANIMATION, 13, 0, 0}, &Room::tug0MccoyHealedEngineer },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::tug0EngineerGotUp },
+ { {ACTION_GET, 9, 0, 0}, &Room::tug0GetTransmogrifier },
+ { {ACTION_FINISHED_WALKING, 3, 0, 0}, &Room::tug0KirkReachedToolbox },
+ { {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::tug0KirkGotTransmogrifier },
+ { {ACTION_LOOK, 9, 0, 0}, &Room::tug0LookAtToolbox },
+
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_IPWE, 0}, &Room::tug0UsePhaserOnWelder },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_IPWE, 0}, &Room::tug0UsePhaserOnWelder },
+ { {ACTION_USE, OBJECT_IPWF, OBJECT_IWIRSCRP, 0}, &Room::tug0UseWelderOnWireScraps },
+ { {ACTION_USE, OBJECT_IPWF, OBJECT_IJNKMETL, 0}, &Room::tug0UseWelderOnMetalScraps },
+ { {ACTION_USE, OBJECT_ICOMBBIT, OBJECT_IRT, 0}, &Room::tug0UseCombBitOnTransmogrifier },
+
+ { {ACTION_USE, OBJECT_SPOCK, 11, 0}, &Room::tug0UseTransporter },
+ { {ACTION_USE, OBJECT_KIRK, 0x22, 0}, &Room::tug0UseTransporter },
+ { {ACTION_FINISHED_WALKING, 14, 0, 0}, &Room::tug0SpockReachedControlsToTransport },
+ { {ACTION_FINISHED_ANIMATION, 18, 0, 0}, &Room::tug0SpockPreparedTransporter },
+ { {ACTION_FINISHED_WALKING, 20, 0, 0}, &Room::tug0SpockReachedTransporter },
+ { {ACTION_FINISHED_ANIMATION, 21, 0, 0}, &Room::tug0FinishedTransporting },
+
+ { {ACTION_USE, OBJECT_IBOMB, 0x22, 0}, &Room::tug0UseBombOnTransporter },
+ { {ACTION_FINISHED_WALKING, 5, 0, 0}, &Room::tug0KirkReachedTransporter },
+ { {ACTION_FINISHED_ANIMATION, 10, 0, 0}, &Room::tug0KirkPlacedBomb },
+ { {ACTION_FINISHED_WALKING, 15, 0, 0}, &Room::tug0SpockReachedControlsForBomb },
+ { {ACTION_FINISHED_ANIMATION, 19, 0, 0}, &Room::tug0SpockBeginsBeamingBomb },
+ { {ACTION_FINISHED_ANIMATION, 12, 0, 0}, &Room::tug0SpockFinishesBeamingBomb },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::tug0BombExploded },
+
+ { {ACTION_USE, OBJECT_MCCOY, 0x21, 0}, &Room::tug0UseMTricorderOnControls },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0x21, 0}, &Room::tug0UseMTricorderOnControls },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::tug0UseSTricorderOnControls },
+ { {ACTION_USE, OBJECT_IMTRICOR, 8, 0}, &Room::tug0UseMTricorderOnEngineer },
+ { {ACTION_FINISHED_WALKING, 24, 0, 0}, &Room::tug0MccoyReachedEngineerToScan },
+ { {ACTION_FINISHED_ANIMATION, 25, 0, 0}, &Room::tug0MccoyFinishedScanningEngineer },
+ { {ACTION_USE, OBJECT_SPOCK, 8, 0}, &Room::tug0UseSTricorderOnEngineer },
+ { {ACTION_USE, OBJECT_ISTRICOR, 8, 0}, &Room::tug0UseSTricorderOnEngineer },
+ { {ACTION_WALK, 0x23, 0, 0}, &Room::tug0WalkToDoor },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::tug0LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::tug0LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::tug0LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::tug0LookAtRedshirt },
+ { {ACTION_LOOK, 0x22, 0, 0}, &Room::tug0LookAtTransporter },
+ { {ACTION_LOOK, 0x23, 0, 0}, &Room::tug0LookAtDoor },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::tug0TalkToKirk },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::tug0TalkToMccoy },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::tug0TalkToSpock },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::tug0TalkToRedshirt },
+ { {ACTION_TALK, 8, 0, 0}, &Room::tug0TalkToEngineer },
+ { {ACTION_USE, OBJECT_ICOMM, 0, 0}, &Room::tug0UseCommunicator },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::tug0LookAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::tug0UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::tug0UseMTricorderAnywhere },
};
RoomAction tug1ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::tug1Tick1 },
- { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::tug1UseSTricorderOnAnything },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::tug1LookAtBridgeDoor },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::tug1UseSTricorderOnBridgeDoor },
- { Action(ACTION_USE, OBJECT_IPHASERS, 0x21, 0), &Room::tug1UsePhaserOnBridgeDoor },
- { Action(ACTION_USE, OBJECT_IPHASERK, 0x21, 0), &Room::tug1UsePhaserOnBridgeDoor },
- { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::tug1KirkReachedFiringPosition },
- { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::tug1KirkPulledOutPhaser },
- { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::tug1KirkFinishedFiringPhaser },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::tug1TalkToSpock },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::tug1UseSTricorderOnJunkPile },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::tug1LookAtJunkPile },
- { Action(ACTION_GET, 8, 0, 0), &Room::tug1GetJunkPile },
- { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::tug1KirkReachedJunkPile },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::tug1KirkFinishedTakingJunkPile },
-
- { Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_IPWE, 0), &Room::tug1UsePhaserOnWelder },
- { Action(ACTION_USE, OBJECT_IPHASERK, OBJECT_IPWE, 0), &Room::tug1UsePhaserOnWelder },
- { Action(ACTION_USE, OBJECT_IPWF, OBJECT_IWIRSCRP, 0), &Room::tug1UseWelderOnWireScraps },
- { Action(ACTION_USE, OBJECT_IPWF, OBJECT_IJNKMETL, 0), &Room::tug1UseWelderOnMetalScraps },
- { Action(ACTION_USE, OBJECT_ICOMBBIT, OBJECT_IRT, 0), &Room::tug1UseCombBitOnTransmogrifier },
-
- { Action(ACTION_USE, OBJECT_IPWF, 0x22, 0), &Room::tug1UsePhaserWelderOnBridgeDoor },
- { Action(ACTION_USE, OBJECT_IPWF, 0x21, 0), &Room::tug1UsePhaserWelderOnBridgeDoor },
- { Action(ACTION_USE, OBJECT_IPWF, 0x20, 0), &Room::tug1UsePhaserWelderOnBridgeDoorInLeftSpot },
- { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::tug1KirkReachedBridgeDoorWithWelder },
- { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::tug1KirkFinishedUsingWelder },
- { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::tug1KirkReachedBridgeDoorWithWelderInLeftSpot },
- { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::tug1KirkFinishedUsingWelderInLeftSpot },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::tug1LookAnywhere },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::tug1LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::tug1LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::tug1LookAtRedshirt },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::tug1TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::tug1TalkToRedshirt },
- { Action(ACTION_LOOK, 0x23, 0, 0), &Room::tug1LookAtTerminal },
- { Action(ACTION_LOOK, 0x24, 0, 0), &Room::tug1LookAtDebris },
- { Action(ACTION_LOOK, 0x25, 0, 0), &Room::tug1LookAtBrigDoor },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x25, 0), &Room::tug1UseSTricorderOnBrigDoor },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::tug1TalkToKirk },
- { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::tug1UseCommunicator },
- { Action(ACTION_WALK, 0x21, 0, 0), &Room::tug1WalkToBridgeDoor },
- { Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::tug1KirkReachedBridgeDoor },
- { Action(ACTION_FINISHED_ANIMATION, 11, 0, 0), &Room::tug1BridgeDoorOpened },
- { Action(ACTION_WALK, 0x25, 0, 0), &Room::tug1WalkToBrigDoor },
- { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::tug1UseMTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::tug1UseMTricorderOnBridgeDoor },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0x20, 0), &Room::tug1UseMTricorderOnBridgeDoor },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0x22, 0), &Room::tug1UseMTricorderOnBridgeDoor },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0x25, 0), &Room::tug1UseMTricorderOnBrigDoor },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::tug1UseSpockOnBridgeDoor },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x21, 0), &Room::tug1UseSpockOnBridgeDoor },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x22, 0), &Room::tug1UseSpockOnBridgeDoor },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::tug1UseRedshirtOnBridgeDoor },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x21, 0), &Room::tug1UseRedshirtOnBridgeDoor },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x22, 0), &Room::tug1UseRedshirtOnBridgeDoor },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 0x20, 0), &Room::tug1UseMedkitOnBridgeDoor },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 0x21, 0), &Room::tug1UseMedkitOnBridgeDoor },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 0x22, 0), &Room::tug1UseMedkitOnBridgeDoor },
+ { {ACTION_TICK, 1, 0, 0}, &Room::tug1Tick1 },
+ { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::tug1UseSTricorderOnAnything },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::tug1LookAtBridgeDoor },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::tug1UseSTricorderOnBridgeDoor },
+ { {ACTION_USE, OBJECT_IPHASERS, 0x21, 0}, &Room::tug1UsePhaserOnBridgeDoor },
+ { {ACTION_USE, OBJECT_IPHASERK, 0x21, 0}, &Room::tug1UsePhaserOnBridgeDoor },
+ { {ACTION_FINISHED_WALKING, 3, 0, 0}, &Room::tug1KirkReachedFiringPosition },
+ { {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::tug1KirkPulledOutPhaser },
+ { {ACTION_FINISHED_ANIMATION, 5, 0, 0}, &Room::tug1KirkFinishedFiringPhaser },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::tug1TalkToSpock },
+ { {ACTION_USE, OBJECT_ISTRICOR, 8, 0}, &Room::tug1UseSTricorderOnJunkPile },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::tug1LookAtJunkPile },
+ { {ACTION_GET, 8, 0, 0}, &Room::tug1GetJunkPile },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::tug1KirkReachedJunkPile },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::tug1KirkFinishedTakingJunkPile },
+
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_IPWE, 0}, &Room::tug1UsePhaserOnWelder },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_IPWE, 0}, &Room::tug1UsePhaserOnWelder },
+ { {ACTION_USE, OBJECT_IPWF, OBJECT_IWIRSCRP, 0}, &Room::tug1UseWelderOnWireScraps },
+ { {ACTION_USE, OBJECT_IPWF, OBJECT_IJNKMETL, 0}, &Room::tug1UseWelderOnMetalScraps },
+ { {ACTION_USE, OBJECT_ICOMBBIT, OBJECT_IRT, 0}, &Room::tug1UseCombBitOnTransmogrifier },
+
+ { {ACTION_USE, OBJECT_IPWF, 0x22, 0}, &Room::tug1UsePhaserWelderOnBridgeDoor },
+ { {ACTION_USE, OBJECT_IPWF, 0x21, 0}, &Room::tug1UsePhaserWelderOnBridgeDoor },
+ { {ACTION_USE, OBJECT_IPWF, 0x20, 0}, &Room::tug1UsePhaserWelderOnBridgeDoorInLeftSpot },
+ { {ACTION_FINISHED_WALKING, 6, 0, 0}, &Room::tug1KirkReachedBridgeDoorWithWelder },
+ { {ACTION_FINISHED_ANIMATION, 7, 0, 0}, &Room::tug1KirkFinishedUsingWelder },
+ { {ACTION_FINISHED_WALKING, 8, 0, 0}, &Room::tug1KirkReachedBridgeDoorWithWelderInLeftSpot },
+ { {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::tug1KirkFinishedUsingWelderInLeftSpot },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::tug1LookAnywhere },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::tug1LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::tug1LookAtSpock },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::tug1LookAtRedshirt },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::tug1TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::tug1TalkToRedshirt },
+ { {ACTION_LOOK, 0x23, 0, 0}, &Room::tug1LookAtTerminal },
+ { {ACTION_LOOK, 0x24, 0, 0}, &Room::tug1LookAtDebris },
+ { {ACTION_LOOK, 0x25, 0, 0}, &Room::tug1LookAtBrigDoor },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x25, 0}, &Room::tug1UseSTricorderOnBrigDoor },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::tug1TalkToKirk },
+ { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::tug1UseCommunicator },
+ { {ACTION_WALK, 0x21, 0, 0}, &Room::tug1WalkToBridgeDoor },
+ { {ACTION_FINISHED_WALKING, 10, 0, 0}, &Room::tug1KirkReachedBridgeDoor },
+ { {ACTION_FINISHED_ANIMATION, 11, 0, 0}, &Room::tug1BridgeDoorOpened },
+ { {ACTION_WALK, 0x25, 0, 0}, &Room::tug1WalkToBrigDoor },
+ { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::tug1UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0x21, 0}, &Room::tug1UseMTricorderOnBridgeDoor },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0x20, 0}, &Room::tug1UseMTricorderOnBridgeDoor },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0x22, 0}, &Room::tug1UseMTricorderOnBridgeDoor },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0x25, 0}, &Room::tug1UseMTricorderOnBrigDoor },
+ { {ACTION_USE, OBJECT_SPOCK, 0x20, 0}, &Room::tug1UseSpockOnBridgeDoor },
+ { {ACTION_USE, OBJECT_SPOCK, 0x21, 0}, &Room::tug1UseSpockOnBridgeDoor },
+ { {ACTION_USE, OBJECT_SPOCK, 0x22, 0}, &Room::tug1UseSpockOnBridgeDoor },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x20, 0}, &Room::tug1UseRedshirtOnBridgeDoor },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x21, 0}, &Room::tug1UseRedshirtOnBridgeDoor },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x22, 0}, &Room::tug1UseRedshirtOnBridgeDoor },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0x20, 0}, &Room::tug1UseMedkitOnBridgeDoor },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0x21, 0}, &Room::tug1UseMedkitOnBridgeDoor },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0x22, 0}, &Room::tug1UseMedkitOnBridgeDoor },
};
RoomAction tug2ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::tug2Tick1 },
- { Action(ACTION_TICK, 60, 0, 0), &Room::tug2Tick60 },
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::tug2LookAtButton },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::tug2LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::tug2LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::tug2LookAtRedshirt },
- { Action(ACTION_GET, 11, 0, 0), &Room::tug2GetBomb },
- { Action(ACTION_FINISHED_WALKING, 12, 0, 0), &Room::tug2KirkReachedBomb },
- { Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::tug2KirkGotBomb },
- { Action(ACTION_LOOK, 11, 0, 0), &Room::tug2LookAtBomb },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::tug2LookAtGuard1 },
- { Action(ACTION_LOOK, 9, 0, 0), &Room::tug2LookAtGuard2 },
- { Action(ACTION_LOOK, 12, 0, 0), &Room::tug2LookAtWires },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 12, 0), &Room::tug2UseSTricorderOnButton },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::tug2UseSTricorderOnButton },
- { Action(ACTION_USE, OBJECT_MCCOY, 12, 0), &Room::tug2UseMccoyOnWires },
- { Action(ACTION_USE, OBJECT_MCCOY, 11, 0), &Room::tug2UseMccoyOnBomb },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 12, 0), &Room::tug2UseRedshirtOnWires },
- { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::tug2RedshirtReachedWires },
- { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::tug2RedshirtDefusedBomb },
- { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::tug2RedshirtReturnedToPosition },
- { Action(ACTION_USE, OBJECT_KIRK, 12, 0), &Room::tug2UseKirkOnWires },
- { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::tug2KirkReachedWires },
- { Action(ACTION_USE, OBJECT_SPOCK, 12, 0), &Room::tug2UseSpockOnWires },
- { Action(ACTION_FINISHED_WALKING, 9, 0, 0), &Room::tug2SpockReachedWires },
- { Action(ACTION_FINISHED_WALKING, 11, 0, 0), &Room::tug2SpockReturnedToPosition },
- { Action(ACTION_GET, 12, 0, 0), &Room::tug2GetWires },
- { Action(ACTION_FINISHED_WALKING, 28, 0, 0), &Room::tug2KirkReachedWiresToGet },
- { Action(ACTION_FINISHED_ANIMATION, 29, 0, 0), &Room::tug2KirkGotWires },
- { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::tug2UseKirkOnButton },
- { Action(ACTION_FINISHED_WALKING, 14, 0, 0), &Room::tug2KirkReachedButton },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::tug2UseSpockOnButton },
- { Action(ACTION_FINISHED_WALKING, 16, 0, 0), &Room::tug2SpockReachedButton },
- { Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::tug2UseMccoyOnButton },
- { Action(ACTION_FINISHED_WALKING, 18, 0, 0), &Room::tug2MccoyReachedButton },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::tug2UseRedshirtOnButton },
- { Action(ACTION_FINISHED_WALKING, 20, 0, 0), &Room::tug2RedshirtReachedButton },
- { Action(ACTION_FINISHED_ANIMATION, 15, 0, 0), &Room::tug2TurnedOffForceField },
- { Action(ACTION_FINISHED_ANIMATION, 17, 0, 0), &Room::tug2TurnedOffForceField },
- { Action(ACTION_FINISHED_ANIMATION, 19, 0, 0), &Room::tug2TurnedOffForceField },
- { Action(ACTION_FINISHED_ANIMATION, 21, 0, 0), &Room::tug2TurnedOffForceField },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::tug2PrisonersDead },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::tug2PrisonersReleased },
- { Action(ACTION_USE, OBJECT_IPHASERS, 10, 0), &Room::tug2UsePhaserOnBrig },
- { Action(ACTION_USE, OBJECT_IPHASERK, 10, 0), &Room::tug2UsePhaserOnBrig },
- { Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::tug2UseStunPhaserOnGuard1 },
- { Action(ACTION_FINISHED_ANIMATION, 22, 0, 0), &Room::tug2KirkShootGuard1 },
- { Action(ACTION_USE, OBJECT_IPHASERS, 9, 0), &Room::tug2UseStunPhaserOnGuard2 },
- { Action(ACTION_FINISHED_ANIMATION, 23, 0, 0), &Room::tug2KirkShootGuard2 },
- { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::tug2UseKillPhaserOnGuard1 },
- { Action(ACTION_FINISHED_ANIMATION, 24, 0, 0), &Room::tug2KirkKillGuard1 },
- { Action(ACTION_USE, OBJECT_IPHASERK, 9, 0), &Room::tug2UseKillPhaserOnGuard2 },
- { Action(ACTION_FINISHED_ANIMATION, 25, 0, 0), &Room::tug2KirkKillGuard2 },
-
- { Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_IPWE, 0), &Room::tug2UsePhaserOnWelder },
- { Action(ACTION_USE, OBJECT_IPHASERK, OBJECT_IPWE, 0), &Room::tug2UsePhaserOnWelder },
- { Action(ACTION_USE, OBJECT_IPWF, OBJECT_IWIRSCRP, 0), &Room::tug2UseWelderOnWireScraps },
- { Action(ACTION_USE, OBJECT_IPWF, OBJECT_IJNKMETL, 0), &Room::tug2UseWelderOnMetalScraps },
- { Action(ACTION_USE, OBJECT_ICOMBBIT, OBJECT_IRT, 0), &Room::tug2UseCombBitOnTransmogrifier },
-
- { Action(ACTION_FINISHED_ANIMATION, 26, 0, 0), &Room::tug2ShotByElasi },
- { Action(ACTION_FINISHED_ANIMATION, 27, 0, 0), &Room::tug2ShotByElasi },
- { Action(ACTION_WALK, 0x21, 0, 0), &Room::tug2WalkToDoor },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::tug2LookAtDoor },
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::tug2LookAtKirk },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::tug2TalkToKirk },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::tug2TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::tug2TalkToRedshirt },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::tug2TalkToSpock },
- { Action(ACTION_USE, OBJECT_ICOMM, 0, 0), &Room::tug2UseCommunicator },
- { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::tug2Timer0Expired },
- { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::tug2Timer2Expired },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 11, 0), &Room::tug2UseSTricorderOnBomb },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::tug2UseMTricorderOnGuard1 },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 9, 0), &Room::tug2UseMTricorderOnGuard2 },
- { Action(ACTION_TALK, 8, 0, 0), &Room::tug2TalkToGuard1 },
- { Action(ACTION_TALK, 9, 0, 0), &Room::tug2TalkToGuard2 },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 11, 0), &Room::tug2UseMedkitOnBomb },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 8, 0), &Room::tug2UseMedkitOnGuard1 },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 9, 0), &Room::tug2UseMedkitOnGuard2 },
- { Action(ACTION_LOOK, 10, 0, 0), &Room::tug2LookAnywhere },
- { Action(ACTION_LOOK, 0x22, 0, 0), &Room::tug2LookAnywhere },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::tug2LookAnywhere },
- { Action(ACTION_TALK, 10, 0, 0), &Room::tug2TalkToBrig },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 10, 0), &Room::tug2UseMTricorderOnBrig },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0x22, 0), &Room::tug2UseMTricorderOnOpenBrig },
- { Action(ACTION_USE, OBJECT_IPHASERS, -1, 0), &Room::tug2UsePhaserAnywhere },
- { Action(ACTION_USE, OBJECT_IPHASERK, -1, 0), &Room::tug2UsePhaserAnywhere },
+ { {ACTION_TICK, 1, 0, 0}, &Room::tug2Tick1 },
+ { {ACTION_TICK, 60, 0, 0}, &Room::tug2Tick60 },
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::tug2LookAtButton },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::tug2LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::tug2LookAtSpock },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::tug2LookAtRedshirt },
+ { {ACTION_GET, 11, 0, 0}, &Room::tug2GetBomb },
+ { {ACTION_FINISHED_WALKING, 12, 0, 0}, &Room::tug2KirkReachedBomb },
+ { {ACTION_FINISHED_ANIMATION, 13, 0, 0}, &Room::tug2KirkGotBomb },
+ { {ACTION_LOOK, 11, 0, 0}, &Room::tug2LookAtBomb },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::tug2LookAtGuard1 },
+ { {ACTION_LOOK, 9, 0, 0}, &Room::tug2LookAtGuard2 },
+ { {ACTION_LOOK, 12, 0, 0}, &Room::tug2LookAtWires },
+ { {ACTION_USE, OBJECT_ISTRICOR, 12, 0}, &Room::tug2UseSTricorderOnButton },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::tug2UseSTricorderOnButton },
+ { {ACTION_USE, OBJECT_MCCOY, 12, 0}, &Room::tug2UseMccoyOnWires },
+ { {ACTION_USE, OBJECT_MCCOY, 11, 0}, &Room::tug2UseMccoyOnBomb },
+ { {ACTION_USE, OBJECT_REDSHIRT, 12, 0}, &Room::tug2UseRedshirtOnWires },
+ { {ACTION_FINISHED_WALKING, 6, 0, 0}, &Room::tug2RedshirtReachedWires },
+ { {ACTION_FINISHED_ANIMATION, 7, 0, 0}, &Room::tug2RedshirtDefusedBomb },
+ { {ACTION_FINISHED_WALKING, 8, 0, 0}, &Room::tug2RedshirtReturnedToPosition },
+ { {ACTION_USE, OBJECT_KIRK, 12, 0}, &Room::tug2UseKirkOnWires },
+ { {ACTION_FINISHED_WALKING, 5, 0, 0}, &Room::tug2KirkReachedWires },
+ { {ACTION_USE, OBJECT_SPOCK, 12, 0}, &Room::tug2UseSpockOnWires },
+ { {ACTION_FINISHED_WALKING, 9, 0, 0}, &Room::tug2SpockReachedWires },
+ { {ACTION_FINISHED_WALKING, 11, 0, 0}, &Room::tug2SpockReturnedToPosition },
+ { {ACTION_GET, 12, 0, 0}, &Room::tug2GetWires },
+ { {ACTION_FINISHED_WALKING, 28, 0, 0}, &Room::tug2KirkReachedWiresToGet },
+ { {ACTION_FINISHED_ANIMATION, 29, 0, 0}, &Room::tug2KirkGotWires },
+ { {ACTION_USE, OBJECT_KIRK, 0x20, 0}, &Room::tug2UseKirkOnButton },
+ { {ACTION_FINISHED_WALKING, 14, 0, 0}, &Room::tug2KirkReachedButton },
+ { {ACTION_USE, OBJECT_SPOCK, 0x20, 0}, &Room::tug2UseSpockOnButton },
+ { {ACTION_FINISHED_WALKING, 16, 0, 0}, &Room::tug2SpockReachedButton },
+ { {ACTION_USE, OBJECT_MCCOY, 0x20, 0}, &Room::tug2UseMccoyOnButton },
+ { {ACTION_FINISHED_WALKING, 18, 0, 0}, &Room::tug2MccoyReachedButton },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x20, 0}, &Room::tug2UseRedshirtOnButton },
+ { {ACTION_FINISHED_WALKING, 20, 0, 0}, &Room::tug2RedshirtReachedButton },
+ { {ACTION_FINISHED_ANIMATION, 15, 0, 0}, &Room::tug2TurnedOffForceField },
+ { {ACTION_FINISHED_ANIMATION, 17, 0, 0}, &Room::tug2TurnedOffForceField },
+ { {ACTION_FINISHED_ANIMATION, 19, 0, 0}, &Room::tug2TurnedOffForceField },
+ { {ACTION_FINISHED_ANIMATION, 21, 0, 0}, &Room::tug2TurnedOffForceField },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::tug2PrisonersDead },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::tug2PrisonersReleased },
+ { {ACTION_USE, OBJECT_IPHASERS, 10, 0}, &Room::tug2UsePhaserOnBrig },
+ { {ACTION_USE, OBJECT_IPHASERK, 10, 0}, &Room::tug2UsePhaserOnBrig },
+ { {ACTION_USE, OBJECT_IPHASERS, 8, 0}, &Room::tug2UseStunPhaserOnGuard1 },
+ { {ACTION_FINISHED_ANIMATION, 22, 0, 0}, &Room::tug2KirkShootGuard1 },
+ { {ACTION_USE, OBJECT_IPHASERS, 9, 0}, &Room::tug2UseStunPhaserOnGuard2 },
+ { {ACTION_FINISHED_ANIMATION, 23, 0, 0}, &Room::tug2KirkShootGuard2 },
+ { {ACTION_USE, OBJECT_IPHASERK, 8, 0}, &Room::tug2UseKillPhaserOnGuard1 },
+ { {ACTION_FINISHED_ANIMATION, 24, 0, 0}, &Room::tug2KirkKillGuard1 },
+ { {ACTION_USE, OBJECT_IPHASERK, 9, 0}, &Room::tug2UseKillPhaserOnGuard2 },
+ { {ACTION_FINISHED_ANIMATION, 25, 0, 0}, &Room::tug2KirkKillGuard2 },
+
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_IPWE, 0}, &Room::tug2UsePhaserOnWelder },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_IPWE, 0}, &Room::tug2UsePhaserOnWelder },
+ { {ACTION_USE, OBJECT_IPWF, OBJECT_IWIRSCRP, 0}, &Room::tug2UseWelderOnWireScraps },
+ { {ACTION_USE, OBJECT_IPWF, OBJECT_IJNKMETL, 0}, &Room::tug2UseWelderOnMetalScraps },
+ { {ACTION_USE, OBJECT_ICOMBBIT, OBJECT_IRT, 0}, &Room::tug2UseCombBitOnTransmogrifier },
+
+ { {ACTION_FINISHED_ANIMATION, 26, 0, 0}, &Room::tug2ShotByElasi },
+ { {ACTION_FINISHED_ANIMATION, 27, 0, 0}, &Room::tug2ShotByElasi },
+ { {ACTION_WALK, 0x21, 0, 0}, &Room::tug2WalkToDoor },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::tug2LookAtDoor },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::tug2LookAtKirk },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::tug2TalkToKirk },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::tug2TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::tug2TalkToRedshirt },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::tug2TalkToSpock },
+ { {ACTION_USE, OBJECT_ICOMM, 0, 0}, &Room::tug2UseCommunicator },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::tug2Timer0Expired },
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::tug2Timer2Expired },
+ { {ACTION_USE, OBJECT_ISTRICOR, 11, 0}, &Room::tug2UseSTricorderOnBomb },
+ { {ACTION_USE, OBJECT_IMTRICOR, 8, 0}, &Room::tug2UseMTricorderOnGuard1 },
+ { {ACTION_USE, OBJECT_IMTRICOR, 9, 0}, &Room::tug2UseMTricorderOnGuard2 },
+ { {ACTION_TALK, 8, 0, 0}, &Room::tug2TalkToGuard1 },
+ { {ACTION_TALK, 9, 0, 0}, &Room::tug2TalkToGuard2 },
+ { {ACTION_USE, OBJECT_IMEDKIT, 11, 0}, &Room::tug2UseMedkitOnBomb },
+ { {ACTION_USE, OBJECT_IMEDKIT, 8, 0}, &Room::tug2UseMedkitOnGuard1 },
+ { {ACTION_USE, OBJECT_IMEDKIT, 9, 0}, &Room::tug2UseMedkitOnGuard2 },
+ { {ACTION_LOOK, 10, 0, 0}, &Room::tug2LookAnywhere },
+ { {ACTION_LOOK, 0x22, 0, 0}, &Room::tug2LookAnywhere },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::tug2LookAnywhere },
+ { {ACTION_TALK, 10, 0, 0}, &Room::tug2TalkToBrig },
+ { {ACTION_USE, OBJECT_IMTRICOR, 10, 0}, &Room::tug2UseMTricorderOnBrig },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0x22, 0}, &Room::tug2UseMTricorderOnOpenBrig },
+ { {ACTION_USE, OBJECT_IPHASERS, -1, 0}, &Room::tug2UsePhaserAnywhere },
+ { {ACTION_USE, OBJECT_IPHASERK, -1, 0}, &Room::tug2UsePhaserAnywhere },
};
RoomAction tug3ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::tug3Tick1 },
- { Action(ACTION_TICK, 40, 0, 0), &Room::tug3Tick40 },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::tug3LookAnywhere },
- { Action(ACTION_USE, OBJECT_IPHASERS, -1, 0), &Room::tug3UsePhaserAnywhere },
- { Action(ACTION_USE, OBJECT_IPHASERK, -1, 0), &Room::tug3UsePhaserAnywhere },
- { Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::tug3UseStunPhaserOnElasi1 },
- { Action(ACTION_USE, OBJECT_IPHASERS, 9, 0), &Room::tug3UseStunPhaserOnElasi2 },
- { Action(ACTION_USE, OBJECT_IPHASERS, 10, 0), &Room::tug3UseStunPhaserOnElasi3 },
- { Action(ACTION_USE, OBJECT_IPHASERS, 11, 0), &Room::tug3UseStunPhaserOnElasi4 },
- { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::tug3UseKillPhaserOnElasi1 },
- { Action(ACTION_USE, OBJECT_IPHASERK, 9, 0), &Room::tug3UseKillPhaserOnElasi2 },
- { Action(ACTION_USE, OBJECT_IPHASERK, 10, 0), &Room::tug3UseKillPhaserOnElasi3 },
- { Action(ACTION_USE, OBJECT_IPHASERK, 11, 0), &Room::tug3UseKillPhaserOnElasi4 },
- { Action(ACTION_FINISHED_ANIMATION, 12, 0, 0), &Room::tug3ElasiStunnedOrKilled },
- { Action(ACTION_TALK, 8, 0, 0), &Room::tug3TalkToElasi1 },
- { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::tug3Elasi1DrewPhaser },
- { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::tug3Elasi1ShotConsole },
- { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::tug3Elasi1DrewPhaser2 },
- { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::tug3Elasi1ShotConsoleAndSurrenders },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::tug3LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::tug3LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::tug3LookAtRedshirt },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::tug3LookAtElasi1 },
- { Action(ACTION_LOOK, 9, 0, 0), &Room::tug3LookAtElasi2 },
- { Action(ACTION_LOOK, 10, 0, 0), &Room::tug3LookAtElasi3 },
- { Action(ACTION_LOOK, 11, 0, 0), &Room::tug3LookAtElasi4 },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::tug3TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::tug3TalkToSpock },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::tug3TalkToRedshirt },
- { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::tug3UseCommunicator },
- { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::tug3Timer0Expired },
- { Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::tug3AllCrewmenDead },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::tug3Timer1Expired },
- { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::tug3SecurityTeamBeamedIn },
+ { {ACTION_TICK, 1, 0, 0}, &Room::tug3Tick1 },
+ { {ACTION_TICK, 40, 0, 0}, &Room::tug3Tick40 },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::tug3LookAnywhere },
+ { {ACTION_USE, OBJECT_IPHASERS, -1, 0}, &Room::tug3UsePhaserAnywhere },
+ { {ACTION_USE, OBJECT_IPHASERK, -1, 0}, &Room::tug3UsePhaserAnywhere },
+ { {ACTION_USE, OBJECT_IPHASERS, 8, 0}, &Room::tug3UseStunPhaserOnElasi1 },
+ { {ACTION_USE, OBJECT_IPHASERS, 9, 0}, &Room::tug3UseStunPhaserOnElasi2 },
+ { {ACTION_USE, OBJECT_IPHASERS, 10, 0}, &Room::tug3UseStunPhaserOnElasi3 },
+ { {ACTION_USE, OBJECT_IPHASERS, 11, 0}, &Room::tug3UseStunPhaserOnElasi4 },
+ { {ACTION_USE, OBJECT_IPHASERK, 8, 0}, &Room::tug3UseKillPhaserOnElasi1 },
+ { {ACTION_USE, OBJECT_IPHASERK, 9, 0}, &Room::tug3UseKillPhaserOnElasi2 },
+ { {ACTION_USE, OBJECT_IPHASERK, 10, 0}, &Room::tug3UseKillPhaserOnElasi3 },
+ { {ACTION_USE, OBJECT_IPHASERK, 11, 0}, &Room::tug3UseKillPhaserOnElasi4 },
+ { {ACTION_FINISHED_ANIMATION, 12, 0, 0}, &Room::tug3ElasiStunnedOrKilled },
+ { {ACTION_TALK, 8, 0, 0}, &Room::tug3TalkToElasi1 },
+ { {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::tug3Elasi1DrewPhaser },
+ { {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::tug3Elasi1ShotConsole },
+ { {ACTION_FINISHED_ANIMATION, 5, 0, 0}, &Room::tug3Elasi1DrewPhaser2 },
+ { {ACTION_FINISHED_ANIMATION, 6, 0, 0}, &Room::tug3Elasi1ShotConsoleAndSurrenders },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::tug3LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::tug3LookAtSpock },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::tug3LookAtRedshirt },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::tug3LookAtElasi1 },
+ { {ACTION_LOOK, 9, 0, 0}, &Room::tug3LookAtElasi2 },
+ { {ACTION_LOOK, 10, 0, 0}, &Room::tug3LookAtElasi3 },
+ { {ACTION_LOOK, 11, 0, 0}, &Room::tug3LookAtElasi4 },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::tug3TalkToMccoy },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::tug3TalkToSpock },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::tug3TalkToRedshirt },
+ { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::tug3UseCommunicator },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::tug3Timer0Expired },
+ { {ACTION_FINISHED_ANIMATION, 13, 0, 0}, &Room::tug3AllCrewmenDead },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::tug3Timer1Expired },
+ { {ACTION_FINISHED_ANIMATION, 7, 0, 0}, &Room::tug3SecurityTeamBeamedIn },
};
RoomAction love0ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::love0Tick1 },
- { Action(ACTION_TICK, 10, 0, 0), &Room::love0Tick10 },
- { Action(ACTION_WALK, 0x21, 0, 0), &Room::love0WalkToDoor2 },
- { Action(ACTION_WALK, 9, 0, 0), &Room::love0WalkToDoor2 },
- { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::love0OpenDoor2 },
- { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::love0ReachedDoor2 },
- { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love0ReachedDoor2 },
- { Action(ACTION_WALK, 0x22, 0, 0), &Room::love0WalkToDoor1 },
- { Action(ACTION_WALK, 8, 0, 0), &Room::love0WalkToDoor1 },
- { Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::love0OpenDoor1 },
- { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::love0ReachedDoor1 },
- { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love0ReachedDoor1 },
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::love0LookAtConsole },
- { Action(ACTION_LOOK, 0x23, 0, 0), &Room::love0LookAtViewscreen },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::love0LookAnywhere },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::love0LookAtDoor1 },
- { Action(ACTION_LOOK, 9, 0, 0), &Room::love0LookAtDoor2 },
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::love0LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::love0LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::love0LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::love0LookAtRedshirt },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::love0TalkToKirk },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::love0TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::love0TalkToSpock },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::love0TalkToRedshirt },
- { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::love0UseMTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::love0UseSTricorderOnConsole },
- { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::love0UseSTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::love0UseKirkOnConsole },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::love0UseRedshirtOnConsole },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::love0UseSpockOnConsole },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::love0SpockReachedConsole },
- { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::love0SpockAccessedConsole },
- { Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::love0UseMccoyOnConsole },
- { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::love0MccoyReachedConsole },
- { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love0MccoyAccessedConsole },
- { Action(ACTION_GET, 8, 0, 0), &Room::love0GetDoorOrConsole },
- { Action(ACTION_GET, 9, 0, 0), &Room::love0GetDoorOrConsole },
- { Action(ACTION_GET, 0x20, 0, 0), &Room::love0GetDoorOrConsole },
+ { {ACTION_TICK, 1, 0, 0}, &Room::love0Tick1 },
+ { {ACTION_TICK, 10, 0, 0}, &Room::love0Tick10 },
+ { {ACTION_WALK, 0x21, 0, 0}, &Room::love0WalkToDoor2 },
+ { {ACTION_WALK, 9, 0, 0}, &Room::love0WalkToDoor2 },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::love0OpenDoor2 },
+ { {ACTION_FINISHED_WALKING, 4, 0, 0}, &Room::love0ReachedDoor2 },
+ { {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::love0ReachedDoor2 },
+ { {ACTION_WALK, 0x22, 0, 0}, &Room::love0WalkToDoor1 },
+ { {ACTION_WALK, 8, 0, 0}, &Room::love0WalkToDoor1 },
+ { {ACTION_TOUCHED_HOTSPOT, 1, 0, 0}, &Room::love0OpenDoor1 },
+ { {ACTION_FINISHED_WALKING, 5, 0, 0}, &Room::love0ReachedDoor1 },
+ { {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::love0ReachedDoor1 },
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::love0LookAtConsole },
+ { {ACTION_LOOK, 0x23, 0, 0}, &Room::love0LookAtViewscreen },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::love0LookAnywhere },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::love0LookAtDoor1 },
+ { {ACTION_LOOK, 9, 0, 0}, &Room::love0LookAtDoor2 },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::love0LookAtKirk },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::love0LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::love0LookAtSpock },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::love0LookAtRedshirt },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::love0TalkToKirk },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::love0TalkToMccoy },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::love0TalkToSpock },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::love0TalkToRedshirt },
+ { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::love0UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::love0UseSTricorderOnConsole },
+ { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::love0UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_KIRK, 0x20, 0}, &Room::love0UseKirkOnConsole },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x20, 0}, &Room::love0UseRedshirtOnConsole },
+ { {ACTION_USE, OBJECT_SPOCK, 0x20, 0}, &Room::love0UseSpockOnConsole },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::love0SpockReachedConsole },
+ { {ACTION_FINISHED_ANIMATION, 5, 0, 0}, &Room::love0SpockAccessedConsole },
+ { {ACTION_USE, OBJECT_MCCOY, 0x20, 0}, &Room::love0UseMccoyOnConsole },
+ { {ACTION_FINISHED_WALKING, 3, 0, 0}, &Room::love0MccoyReachedConsole },
+ { {ACTION_FINISHED_ANIMATION, 6, 0, 0}, &Room::love0MccoyAccessedConsole },
+ { {ACTION_GET, 8, 0, 0}, &Room::love0GetDoorOrConsole },
+ { {ACTION_GET, 9, 0, 0}, &Room::love0GetDoorOrConsole },
+ { {ACTION_GET, 0x20, 0, 0}, &Room::love0GetDoorOrConsole },
// Common code
- { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::loveaTimer0Expired },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::loveaTimer1Expired },
- { Action(ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0), &Room::loveaUseMedkitOnSpock },
- { Action(ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0), &Room::loveaUseCureSampleOnSpock },
- { Action(ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0), &Room::loveaUseCureOnSpock },
- { Action(ACTION_FINISHED_WALKING, 99, 0, 0), &Room::loveaSpockOrMccoyInPositionToUseCure },
- { Action(ACTION_FINISHED_ANIMATION, 99, 0, 0), &Room::loveaFinishedCuringSpock },
- { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::loveaTimer2Expired },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0), &Room::loveaUseMTricorderOnSpock },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IRLG, -1, 0), &Room::loveaUseRomulanLaughingGas },
- { Action(ACTION_USE, OBJECT_IN2O, -1, 0), &Room::loveaUseHumanLaughingGas },
- { Action(ACTION_USE, OBJECT_INH3, -1, 0), &Room::loveaUseAmmonia },
- { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::loveaUseCommunicator },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::loveaTimer0Expired },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::loveaTimer1Expired },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0}, &Room::loveaUseMedkitOnSpock },
+ { {ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0}, &Room::loveaUseCureSampleOnSpock },
+ { {ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0}, &Room::loveaUseCureOnSpock },
+ { {ACTION_FINISHED_WALKING, 99, 0, 0}, &Room::loveaSpockOrMccoyInPositionToUseCure },
+ { {ACTION_FINISHED_ANIMATION, 99, 0, 0}, &Room::loveaFinishedCuringSpock },
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::loveaTimer2Expired },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::loveaUseMTricorderOnSpock },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IRLG, -1, 0}, &Room::loveaUseRomulanLaughingGas },
+ { {ACTION_USE, OBJECT_IN2O, -1, 0}, &Room::loveaUseHumanLaughingGas },
+ { {ACTION_USE, OBJECT_INH3, -1, 0}, &Room::loveaUseAmmonia },
+ { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::loveaUseCommunicator },
};
RoomAction love1ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::love1Tick1 },
-
- { Action(ACTION_WALK, 10, 0, 0), &Room::love1WalkToDoor3 },
- { Action(ACTION_WALK, 0x26, 0, 0), &Room::love1WalkToDoor3 },
- { Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::love1OpenDoor3 },
- { Action(ACTION_FINISHED_WALKING, 15, 0, 0), &Room::love1ReachedDoor3 },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::love1ReachedDoor3 },
-
- { Action(ACTION_WALK, 8, 0, 0), &Room::love1WalkToDoor1 },
- { Action(ACTION_WALK, 0x27, 0, 0), &Room::love1WalkToDoor1 },
- { Action(ACTION_TOUCHED_HOTSPOT, 2, 0, 0), &Room::love1OpenDoor1 },
- { Action(ACTION_FINISHED_WALKING, 16, 0, 0), &Room::love1ReachedDoor1 },
- { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love1ReachedDoor1 },
-
- { Action(ACTION_WALK, 9, 0, 0), &Room::love1WalkToDoor2 },
- { Action(ACTION_WALK, 0x28, 0, 0), &Room::love1WalkToDoor2 },
- { Action(ACTION_TOUCHED_HOTSPOT, 3, 0, 0), &Room::love1OpenDoor2 },
- { Action(ACTION_FINISHED_WALKING, 17, 0, 0), &Room::love1ReachedDoor2 },
- { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love1ReachedDoor2 },
-
- { Action(ACTION_LOOK, 0x25, 0, 0), &Room::love1LookAtLaser },
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::love1LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::love1LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::love1LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::love1LookAtRedshirt },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::love1LookAnywhere },
- { Action(ACTION_LOOK, 15, 0, 0), &Room::love1LookAtNozzle },
- { Action(ACTION_LOOK, 0x24, 0, 0), &Room::love1LookAtNozzle },
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::love1LookAtLadder },
- { Action(ACTION_LOOK, 9, 0, 0), &Room::love1LookAtDoor1Or2 },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::love1LookAtDoor1Or2 },
- { Action(ACTION_LOOK, 10, 0, 0), &Room::love1LookAtDoor3 },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::love1LookAtDistillator },
- { Action(ACTION_LOOK, 14, 0, 0), &Room::love1LookAtChamber },
- { Action(ACTION_LOOK, 12, 0, 0), &Room::love1LookAtChamber },
- { Action(ACTION_LOOK, 0x23, 0, 0), &Room::love1LookAtReplicator },
- { Action(ACTION_LOOK, 11, 0, 0), &Room::love1LookAtFreezer },
- { Action(ACTION_LOOK, 0x22, 0, 0), &Room::love1LookAtFreezer },
- { Action(ACTION_LOOK, OBJECT_IDISHES, 0, 0), &Room::love1LookAtDishes },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::love1TalkToKirk },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::love1TalkToSpock },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::love1TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::love1TalkToRedshirt },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_IDISHES, 0), &Room::love1UseMTricorderOnDishes },
- { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::love1UseMTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::love1UseSTricorderOnReplicator },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 12, 0), &Room::love1UseSTricorderOnReplicator },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x25, 0), &Room::love1UseSTricorderOnLaser },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x25, 0), &Room::love1UseSTricorderOnLaser },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::love1UseSTricorderOnFreezer },
- { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::love1UseSTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_ISTRICOR, OBJECT_IDISHES, 0), &Room::love1UseSTricorderOnDishes },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::love1UseSTricorderOnDistillator },
- { Action(ACTION_GET, 11, 0, 0), &Room::love1GetFreezer },
- { Action(ACTION_GET, 0x22, 0, 0), &Room::love1GetFreezer },
- { Action(ACTION_FINISHED_WALKING, 14, 0, 0), &Room::love1KirkReachedFreezer },
- { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::love1KirkGotVirusCulture },
- { Action(ACTION_GET, 14, 0, 0), &Room::love1GetFromChamber },
- { Action(ACTION_GET, 12, 0, 0), &Room::love1GetFromChamber },
- { Action(ACTION_GET, 0x23, 0, 0), &Room::love1GetFromChamber },
- { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::love1KirkReachedChamber },
- { Action(ACTION_FINISHED_ANIMATION, 10, 0, 0), &Room::love1KirkGotCureSample },
- { Action(ACTION_GET, 15, 0, 0), &Room::love1GetFromNozzle },
- { Action(ACTION_GET, 0x24, 0, 0), &Room::love1GetFromNozzle },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::love1KirkReachedNozzleToGet },
- { Action(ACTION_FINISHED_ANIMATION, 11, 0, 0), &Room::love1KirkGotBottleFromNozzle },
- { Action(ACTION_USE, OBJECT_IN2O, 0x24, 0), &Room::love1UseN2OOnNozzle },
- { Action(ACTION_USE, OBJECT_IH2O, 0x24, 0), &Room::love1UseH2OOnNozzle },
- { Action(ACTION_USE, OBJECT_INH3, 0x24, 0), &Room::love1UseNH3OnNozzle },
- { Action(ACTION_USE, OBJECT_IRLG, 0x24, 0), &Room::love1UseRLGOnNozzle },
- { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::love1KirkReachedNozzleToPut },
- { Action(ACTION_FINISHED_ANIMATION, 12, 0, 0), &Room::love1KirkPutBottleInNozzle },
- { Action(ACTION_USE, -1, 0x24, 0), &Room::love1UseAnthingOnNozzle },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x23, 0), &Room::love1UseSpockOnReplicator },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x23, 0), &Room::love1UseRedshirtOnReplicator },
- { Action(ACTION_USE, OBJECT_MCCOY, 14, 0), &Room::love1UseMccoyOnReplicator },
- { Action(ACTION_USE, OBJECT_MCCOY, 15, 0), &Room::love1UseMccoyOnReplicator },
- { Action(ACTION_USE, OBJECT_MCCOY, 0x23, 0), &Room::love1UseMccoyOnReplicator },
- { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::love1MccoyReachedReplicator },
- { Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::love1MccoyUsedReplicator },
- { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::love1ChamberClosed },
- { Action(ACTION_FINISHED_ANIMATION, 8, 0, 0), &Room::love1ChamberOpened },
- { Action(ACTION_USE, -1, 12, 0), &Room::love1UseAnythingOnChamber },
- { Action(ACTION_USE, OBJECT_IDISHES, 12, 0), &Room::love1UseDishesOnChamber },
- { Action(ACTION_USE, OBJECT_IDISHES, 0x23, 0), &Room::love1UseDishesOnChamber },
- { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::love1KirkReachedChamberToPut },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::love1ChamberOpenedForDish },
- { Action(ACTION_FINISHED_ANIMATION, 14, 0, 0), &Room::love1KirkPutDishInChamber },
- { Action(ACTION_USE, OBJECT_IINSULAT, 0x21, 0), &Room::love1UseInsulationOnDistillator },
- { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::love1KirkReachedDistillator },
- { Action(ACTION_FINISHED_ANIMATION, 15, 0, 0), &Room::love1KirkGotPolyberylcarbonate },
- { Action(ACTION_USE, OBJECT_KIRK, 0x22, 0), &Room::love1UseKirkOnFreezer },
- { Action(ACTION_USE, OBJECT_KIRK, 11, 0), &Room::love1UseKirkOnFreezer },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x22, 0), &Room::love1UseRedshirtOnFreezer },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 11, 0), &Room::love1UseRedshirtOnFreezer },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x22, 0), &Room::love1UseSpockOnFreezer },
- { Action(ACTION_USE, OBJECT_SPOCK, 11, 0), &Room::love1UseSpockOnFreezer },
- { Action(ACTION_USE, OBJECT_MCCOY, 0x22, 0), &Room::love1UseMccoyOnFreezer },
- { Action(ACTION_USE, OBJECT_MCCOY, 11, 0), &Room::love1UseMccoyOnFreezer },
- { Action(ACTION_FINISHED_WALKING, 7, 0, 0), &Room::love1CrewmanReachedFreezer },
- { Action(ACTION_FINISHED_ANIMATION, 16, 0, 0), &Room::love1CrewmanOpenedOrClosedFreezer },
- { Action(ACTION_USE, -1, 0x22, 0), &Room::love1UseAnythingOnFreezer },
- { Action(ACTION_FINISHED_WALKING, 11, 0, 0), &Room::love1ReachedFreezerWithArbitraryItem },
- { Action(ACTION_FINISHED_ANIMATION, 17, 0, 0), &Room::love1FinishedUsingArbitraryItemOnFreezer },
- { Action(ACTION_USE, -1, 0x23, 0), &Room::love1UseAnythingOnReplicator },
- { Action(ACTION_FINISHED_WALKING, 12, 0, 0), &Room::love1ReachedReplicatorWithArbitraryItem },
- { Action(ACTION_FINISHED_ANIMATION, 18, 0, 0), &Room::love1FinishedUsingArbitraryItemOnReplicator },
- { Action(ACTION_USE, -1, 0x21, 0), &Room::love1UseAnythingOnDistillator },
- { Action(ACTION_FINISHED_WALKING, 13, 0, 0), &Room::love1ReachedDistillatorWithArbitraryItem },
- { Action(ACTION_FINISHED_ANIMATION, 19, 0, 0), &Room::love1FinishedUsingArbitraryItemOnDistillator },
- { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::love1UseKirkOnLadder },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::love1UseSpockOnLadder },
- { Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::love1UseMccoyOnLadder },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::love1UseRedshirtOnLadder },
- { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::love1CrewmanReachedLadder },
- { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love1CrewmanDiedFromPhaser },
- { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::love1TouchedHotspot0 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::love1Tick1 },
+
+ { {ACTION_WALK, 10, 0, 0}, &Room::love1WalkToDoor3 },
+ { {ACTION_WALK, 0x26, 0, 0}, &Room::love1WalkToDoor3 },
+ { {ACTION_TOUCHED_HOTSPOT, 1, 0, 0}, &Room::love1OpenDoor3 },
+ { {ACTION_FINISHED_WALKING, 15, 0, 0}, &Room::love1ReachedDoor3 },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::love1ReachedDoor3 },
+
+ { {ACTION_WALK, 8, 0, 0}, &Room::love1WalkToDoor1 },
+ { {ACTION_WALK, 0x27, 0, 0}, &Room::love1WalkToDoor1 },
+ { {ACTION_TOUCHED_HOTSPOT, 2, 0, 0}, &Room::love1OpenDoor1 },
+ { {ACTION_FINISHED_WALKING, 16, 0, 0}, &Room::love1ReachedDoor1 },
+ { {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::love1ReachedDoor1 },
+
+ { {ACTION_WALK, 9, 0, 0}, &Room::love1WalkToDoor2 },
+ { {ACTION_WALK, 0x28, 0, 0}, &Room::love1WalkToDoor2 },
+ { {ACTION_TOUCHED_HOTSPOT, 3, 0, 0}, &Room::love1OpenDoor2 },
+ { {ACTION_FINISHED_WALKING, 17, 0, 0}, &Room::love1ReachedDoor2 },
+ { {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::love1ReachedDoor2 },
+
+ { {ACTION_LOOK, 0x25, 0, 0}, &Room::love1LookAtLaser },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::love1LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::love1LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::love1LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::love1LookAtRedshirt },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::love1LookAnywhere },
+ { {ACTION_LOOK, 15, 0, 0}, &Room::love1LookAtNozzle },
+ { {ACTION_LOOK, 0x24, 0, 0}, &Room::love1LookAtNozzle },
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::love1LookAtLadder },
+ { {ACTION_LOOK, 9, 0, 0}, &Room::love1LookAtDoor1Or2 },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::love1LookAtDoor1Or2 },
+ { {ACTION_LOOK, 10, 0, 0}, &Room::love1LookAtDoor3 },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::love1LookAtDistillator },
+ { {ACTION_LOOK, 14, 0, 0}, &Room::love1LookAtChamber },
+ { {ACTION_LOOK, 12, 0, 0}, &Room::love1LookAtChamber },
+ { {ACTION_LOOK, 0x23, 0, 0}, &Room::love1LookAtReplicator },
+ { {ACTION_LOOK, 11, 0, 0}, &Room::love1LookAtFreezer },
+ { {ACTION_LOOK, 0x22, 0, 0}, &Room::love1LookAtFreezer },
+ { {ACTION_LOOK, OBJECT_IDISHES, 0, 0}, &Room::love1LookAtDishes },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::love1TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::love1TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::love1TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::love1TalkToRedshirt },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_IDISHES, 0}, &Room::love1UseMTricorderOnDishes },
+ { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::love1UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x23, 0}, &Room::love1UseSTricorderOnReplicator },
+ { {ACTION_USE, OBJECT_ISTRICOR, 12, 0}, &Room::love1UseSTricorderOnReplicator },
+ { {ACTION_USE, OBJECT_SPOCK, 0x25, 0}, &Room::love1UseSTricorderOnLaser },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x25, 0}, &Room::love1UseSTricorderOnLaser },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x22, 0}, &Room::love1UseSTricorderOnFreezer },
+ { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::love1UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_IDISHES, 0}, &Room::love1UseSTricorderOnDishes },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::love1UseSTricorderOnDistillator },
+ { {ACTION_GET, 11, 0, 0}, &Room::love1GetFreezer },
+ { {ACTION_GET, 0x22, 0, 0}, &Room::love1GetFreezer },
+ { {ACTION_FINISHED_WALKING, 14, 0, 0}, &Room::love1KirkReachedFreezer },
+ { {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::love1KirkGotVirusCulture },
+ { {ACTION_GET, 14, 0, 0}, &Room::love1GetFromChamber },
+ { {ACTION_GET, 12, 0, 0}, &Room::love1GetFromChamber },
+ { {ACTION_GET, 0x23, 0, 0}, &Room::love1GetFromChamber },
+ { {ACTION_FINISHED_WALKING, 8, 0, 0}, &Room::love1KirkReachedChamber },
+ { {ACTION_FINISHED_ANIMATION, 10, 0, 0}, &Room::love1KirkGotCureSample },
+ { {ACTION_GET, 15, 0, 0}, &Room::love1GetFromNozzle },
+ { {ACTION_GET, 0x24, 0, 0}, &Room::love1GetFromNozzle },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::love1KirkReachedNozzleToGet },
+ { {ACTION_FINISHED_ANIMATION, 11, 0, 0}, &Room::love1KirkGotBottleFromNozzle },
+ { {ACTION_USE, OBJECT_IN2O, 0x24, 0}, &Room::love1UseN2OOnNozzle },
+ { {ACTION_USE, OBJECT_IH2O, 0x24, 0}, &Room::love1UseH2OOnNozzle },
+ { {ACTION_USE, OBJECT_INH3, 0x24, 0}, &Room::love1UseNH3OnNozzle },
+ { {ACTION_USE, OBJECT_IRLG, 0x24, 0}, &Room::love1UseRLGOnNozzle },
+ { {ACTION_FINISHED_WALKING, 3, 0, 0}, &Room::love1KirkReachedNozzleToPut },
+ { {ACTION_FINISHED_ANIMATION, 12, 0, 0}, &Room::love1KirkPutBottleInNozzle },
+ { {ACTION_USE, -1, 0x24, 0}, &Room::love1UseAnthingOnNozzle },
+ { {ACTION_USE, OBJECT_SPOCK, 0x23, 0}, &Room::love1UseSpockOnReplicator },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x23, 0}, &Room::love1UseRedshirtOnReplicator },
+ { {ACTION_USE, OBJECT_MCCOY, 14, 0}, &Room::love1UseMccoyOnReplicator },
+ { {ACTION_USE, OBJECT_MCCOY, 15, 0}, &Room::love1UseMccoyOnReplicator },
+ { {ACTION_USE, OBJECT_MCCOY, 0x23, 0}, &Room::love1UseMccoyOnReplicator },
+ { {ACTION_FINISHED_WALKING, 4, 0, 0}, &Room::love1MccoyReachedReplicator },
+ { {ACTION_FINISHED_ANIMATION, 13, 0, 0}, &Room::love1MccoyUsedReplicator },
+ { {ACTION_FINISHED_ANIMATION, 7, 0, 0}, &Room::love1ChamberClosed },
+ { {ACTION_FINISHED_ANIMATION, 8, 0, 0}, &Room::love1ChamberOpened },
+ { {ACTION_USE, -1, 12, 0}, &Room::love1UseAnythingOnChamber },
+ { {ACTION_USE, OBJECT_IDISHES, 12, 0}, &Room::love1UseDishesOnChamber },
+ { {ACTION_USE, OBJECT_IDISHES, 0x23, 0}, &Room::love1UseDishesOnChamber },
+ { {ACTION_FINISHED_WALKING, 5, 0, 0}, &Room::love1KirkReachedChamberToPut },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::love1ChamberOpenedForDish },
+ { {ACTION_FINISHED_ANIMATION, 14, 0, 0}, &Room::love1KirkPutDishInChamber },
+ { {ACTION_USE, OBJECT_IINSULAT, 0x21, 0}, &Room::love1UseInsulationOnDistillator },
+ { {ACTION_FINISHED_WALKING, 6, 0, 0}, &Room::love1KirkReachedDistillator },
+ { {ACTION_FINISHED_ANIMATION, 15, 0, 0}, &Room::love1KirkGotPolyberylcarbonate },
+ { {ACTION_USE, OBJECT_KIRK, 0x22, 0}, &Room::love1UseKirkOnFreezer },
+ { {ACTION_USE, OBJECT_KIRK, 11, 0}, &Room::love1UseKirkOnFreezer },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x22, 0}, &Room::love1UseRedshirtOnFreezer },
+ { {ACTION_USE, OBJECT_REDSHIRT, 11, 0}, &Room::love1UseRedshirtOnFreezer },
+ { {ACTION_USE, OBJECT_SPOCK, 0x22, 0}, &Room::love1UseSpockOnFreezer },
+ { {ACTION_USE, OBJECT_SPOCK, 11, 0}, &Room::love1UseSpockOnFreezer },
+ { {ACTION_USE, OBJECT_MCCOY, 0x22, 0}, &Room::love1UseMccoyOnFreezer },
+ { {ACTION_USE, OBJECT_MCCOY, 11, 0}, &Room::love1UseMccoyOnFreezer },
+ { {ACTION_FINISHED_WALKING, 7, 0, 0}, &Room::love1CrewmanReachedFreezer },
+ { {ACTION_FINISHED_ANIMATION, 16, 0, 0}, &Room::love1CrewmanOpenedOrClosedFreezer },
+ { {ACTION_USE, -1, 0x22, 0}, &Room::love1UseAnythingOnFreezer },
+ { {ACTION_FINISHED_WALKING, 11, 0, 0}, &Room::love1ReachedFreezerWithArbitraryItem },
+ { {ACTION_FINISHED_ANIMATION, 17, 0, 0}, &Room::love1FinishedUsingArbitraryItemOnFreezer },
+ { {ACTION_USE, -1, 0x23, 0}, &Room::love1UseAnythingOnReplicator },
+ { {ACTION_FINISHED_WALKING, 12, 0, 0}, &Room::love1ReachedReplicatorWithArbitraryItem },
+ { {ACTION_FINISHED_ANIMATION, 18, 0, 0}, &Room::love1FinishedUsingArbitraryItemOnReplicator },
+ { {ACTION_USE, -1, 0x21, 0}, &Room::love1UseAnythingOnDistillator },
+ { {ACTION_FINISHED_WALKING, 13, 0, 0}, &Room::love1ReachedDistillatorWithArbitraryItem },
+ { {ACTION_FINISHED_ANIMATION, 19, 0, 0}, &Room::love1FinishedUsingArbitraryItemOnDistillator },
+ { {ACTION_USE, OBJECT_KIRK, 0x20, 0}, &Room::love1UseKirkOnLadder },
+ { {ACTION_USE, OBJECT_SPOCK, 0x20, 0}, &Room::love1UseSpockOnLadder },
+ { {ACTION_USE, OBJECT_MCCOY, 0x20, 0}, &Room::love1UseMccoyOnLadder },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x20, 0}, &Room::love1UseRedshirtOnLadder },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::love1CrewmanReachedLadder },
+ { {ACTION_FINISHED_ANIMATION, 6, 0, 0}, &Room::love1CrewmanDiedFromPhaser },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::love1TouchedHotspot0 },
// Common code
- { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::loveaTimer0Expired },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::loveaTimer1Expired },
- { Action(ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0), &Room::loveaUseMedkitOnSpock },
- { Action(ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0), &Room::loveaUseCureSampleOnSpock },
- { Action(ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0), &Room::loveaUseCureOnSpock },
- { Action(ACTION_FINISHED_WALKING, 99, 0, 0), &Room::loveaSpockOrMccoyInPositionToUseCure },
- { Action(ACTION_FINISHED_ANIMATION, 99, 0, 0), &Room::loveaFinishedCuringSpock },
- { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::loveaTimer2Expired },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0), &Room::loveaUseMTricorderOnSpock },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IRLG, -1, 0), &Room::loveaUseRomulanLaughingGas },
- { Action(ACTION_USE, OBJECT_IN2O, -1, 0), &Room::loveaUseHumanLaughingGas },
- { Action(ACTION_USE, OBJECT_INH3, -1, 0), &Room::loveaUseAmmonia },
- { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::loveaUseCommunicator },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::loveaTimer0Expired },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::loveaTimer1Expired },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0}, &Room::loveaUseMedkitOnSpock },
+ { {ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0}, &Room::loveaUseCureSampleOnSpock },
+ { {ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0}, &Room::loveaUseCureOnSpock },
+ { {ACTION_FINISHED_WALKING, 99, 0, 0}, &Room::loveaSpockOrMccoyInPositionToUseCure },
+ { {ACTION_FINISHED_ANIMATION, 99, 0, 0}, &Room::loveaFinishedCuringSpock },
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::loveaTimer2Expired },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::loveaUseMTricorderOnSpock },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IRLG, -1, 0}, &Room::loveaUseRomulanLaughingGas },
+ { {ACTION_USE, OBJECT_IN2O, -1, 0}, &Room::loveaUseHumanLaughingGas },
+ { {ACTION_USE, OBJECT_INH3, -1, 0}, &Room::loveaUseAmmonia },
+ { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::loveaUseCommunicator },
};
RoomAction love2ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::love2Tick1 },
- { Action(ACTION_TOUCHED_WARP, 1, 0, 0), &Room::love2TouchedWarp1 },
- { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::love2Timer3Expired },
- { Action(ACTION_WALK, 10, 0, 0), &Room::love2WalkToDoor },
- { Action(ACTION_WALK, 0x22, 0, 0), &Room::love2WalkToDoor },
- { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::love2TouchedHotspot0 },
- { Action(ACTION_FINISHED_WALKING, 14, 0, 0), &Room::love2DoorReachedOrOpened },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::love2DoorReachedOrOpened },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::love2LookAtCabinet },
- { Action(ACTION_LOOK, 10, 0, 0), &Room::love2LookAtDoor },
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::love2LookAtSynthesizer },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::love2LookAtAnywhere },
- { Action(ACTION_LOOK, 14, 0, 0), &Room::love2LookAtAntigrav },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::love2LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::love2LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::love2LookAtRedshirt },
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::love2LookAtKirk },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::love2LookAtArdak },
- { Action(ACTION_LOOK, 15, 0, 0), &Room::love2LookAtChamber },
- { Action(ACTION_LOOK, 16, 0, 0), &Room::love2LookAtChamber },
- { Action(ACTION_LOOK, 18, 0, 0), &Room::love2LookAtChamber },
- { Action(ACTION_LOOK, 19, 0, 0), &Room::love2LookAtChamber },
- { Action(ACTION_LOOK, 17, 0, 0), &Room::love2LookAtChamber },
- { Action(ACTION_LOOK, 9, 0, 0), &Room::love2LookAtChamber },
- { Action(ACTION_LOOK, 12, 0, 0), &Room::love2LookAtCan1 },
- { Action(ACTION_LOOK, 13, 0, 0), &Room::love2LookAtCan2 },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::love2TalkToKirk },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::love2TalkToSpock },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::love2TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::love2TalkToRedshirt },
- { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::love2UseMTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::love2UseSTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_KIRK, 8, 0), &Room::love2UseKirkOnCabinet },
- { Action(ACTION_USE, OBJECT_SPOCK, 8, 0), &Room::love2UseSpockOnCabinet },
- { Action(ACTION_USE, OBJECT_MCCOY, 8, 0), &Room::love2UseMccoyOnCabinet },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 8, 0), &Room::love2UseRedshirtOnCabinet },
- { Action(ACTION_FINISHED_WALKING, 12, 0, 0), &Room::love2CrewmanReachedCabinet },
- { Action(ACTION_FINISHED_ANIMATION, 11, 0, 0), &Room::love2CrewmanAccessedCabinet },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::love2CrewmanOpenedOrClosedCabinet },
- { Action(ACTION_USE, OBJECT_IWRENCH, 11, 0), &Room::love2UseWrenchOnGasFeed },
- { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::love2ReachedGasFeed },
- { Action(ACTION_FINISHED_ANIMATION, 12, 0, 0), &Room::love2ChangedGasFeed },
- { Action(ACTION_USE, OBJECT_IO2GAS, 0x23, 0), &Room::love2UseO2GasOnCanisterSlot },
- { Action(ACTION_USE, OBJECT_IH2GAS, 0x23, 0), &Room::love2UseH2GasOnCanisterSlot },
- { Action(ACTION_USE, OBJECT_IN2GAS, 0x23, 0), &Room::love2UseN2GasOnCanisterSlot },
- { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::love2ReachedCanisterSlot },
- { Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::love2PutCanisterInSlot1 },
- { Action(ACTION_FINISHED_ANIMATION, 14, 0, 0), &Room::love2PutCanisterInSlot2 },
- { Action(ACTION_USE, OBJECT_IANTIGRA, 12, 0), &Room::love2UseAntigravOnCanister1 },
- { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::love2ReachedCanisterSlot1ToGet },
- { Action(ACTION_FINISHED_ANIMATION, 15, 0, 0), &Room::love2TookCanister1 },
- { Action(ACTION_USE, OBJECT_IANTIGRA, 13, 0), &Room::love2UseAntigravOnCanister2 },
- { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::love2ReachedCanisterSlot2ToGet },
- { Action(ACTION_FINISHED_ANIMATION, 16, 0, 0), &Room::love2TookCanister2 },
- { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::love2UseKirkOnSynthesizer },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::love2UseSpockOnSynthesizer },
- { Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::love2UseMccoyOnSynthesizer },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::love2UseRedshirtOnSynthesizer },
- { Action(ACTION_FINISHED_WALKING, 13, 0, 0), &Room::love2CrewmanReachedSynthesizer },
- { Action(ACTION_FINISHED_ANIMATION, 17, 0, 0), &Room::love2CrewmanUsedSynthesizer },
- { Action(ACTION_FINISHED_WALKING, 16, 0, 0), &Room::love2SpockReachedGasFeeds },
- { Action(ACTION_FINISHED_ANIMATION, 18, 0, 0), &Room::love2SpockEnabledGasFeeds },
- { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love2SynthesizerDoorClosed },
- { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love2SynthesizerFinished },
- { Action(ACTION_FINISHED_ANIMATION, 27, 0, 0), &Room::love2ClosedSynthesizerDoorMakingRLG },
- { Action(ACTION_FINISHED_ANIMATION, 8, 0, 0), &Room::love2ClosedSynthesizerDoorMakingCure },
- { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::love2CureStartedSynthesizing },
- { Action(ACTION_FINISHED_ANIMATION, 10, 0, 0), &Room::love2CureSynthesized },
- { Action(ACTION_USE, OBJECT_IPBC, 9, 0), &Room::love2UsePolyberylcarbonateOnSynthesizerDoor },
- { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::love2KirkReachedSynthesizerWithPolyberylcarbonate },
- { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::love2SynthesizerDoorOpenedWithPolyberylcarbonate },
- { Action(ACTION_FINISHED_ANIMATION, 19, 0, 0), &Room::love2PutPolyberylcarbonateInSynthesizer },
-
- { Action(ACTION_USE, OBJECT_IDISHES, 9, 0), &Room::love2UseVirusSampleOnSynthesizerDoor },
- { Action(ACTION_FINISHED_WALKING, 7, 0, 0), &Room::love2KirkReachedSynthesizerWithVirusSample },
- { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love2SynthesizerDoorOpenedWithVirusSample },
- { Action(ACTION_FINISHED_ANIMATION, 20, 0, 0), &Room::love2PutVirusSampleInSynthesizer },
-
- { Action(ACTION_USE, OBJECT_ISAMPLE, 9, 0), &Room::love2UseCureSampleOnSynthesizerDoor },
- { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::love2KirkReachedSynthesizerWithCureSample },
- { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::love2SynthesizerDoorOpenedWithCureSample },
- { Action(ACTION_FINISHED_ANIMATION, 21, 0, 0), &Room::love2PutCureSampleInSynthesizer },
-
- { Action(ACTION_USE, -1, 9, 0), &Room::love2UseAnythingOnSynthesizerDoor },
- { Action(ACTION_USE, -1, 0x20, 0), &Room::love2UseAnythingOnSynthesizer },
- { Action(ACTION_GET, 13, 0, 0), &Room::love2GetCanister },
- { Action(ACTION_GET, 12, 0, 0), &Room::love2GetCanister },
-
- { Action(ACTION_GET, 14, 0, 0), &Room::love2GetAntigrav },
- { Action(ACTION_FINISHED_WALKING, 9, 0, 0), &Room::love2ReachedAntigrav },
- { Action(ACTION_FINISHED_ANIMATION, 22, 0, 0), &Room::love2GotAntigrav },
-
- { Action(ACTION_GET, 16, 0, 0), &Room::love2GetPolyberylcarbonate },
- { Action(ACTION_FINISHED_WALKING, 18, 0, 0), &Room::love2ReachedPolyberylcarbonate },
- { Action(ACTION_FINISHED_ANIMATION, 26, 0, 0), &Room::love2GotPolyberylcarbonate },
-
- { Action(ACTION_GET, 17, 0, 0), &Room::love2GetDishes },
- { Action(ACTION_FINISHED_WALKING, 17, 0, 0), &Room::love2ReachedDishes },
- { Action(ACTION_FINISHED_ANIMATION, 25, 0, 0), &Room::love2GotDishes },
-
- { Action(ACTION_GET, 18, 0, 0), &Room::love2GetSample },
- { Action(ACTION_FINISHED_WALKING, 19, 0, 0), &Room::love2ReachedSample },
- { Action(ACTION_FINISHED_ANIMATION, 28, 0, 0), &Room::love2GotSample },
-
- { Action(ACTION_GET, 15, 0, 0), &Room::love2GetSynthesizerOutput },
- { Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::love2ReachedSynthesizerOutput },
- { Action(ACTION_FINISHED_ANIMATION, 23, 0, 0), &Room::love2GotSynthesizerOutput },
-
- { Action(ACTION_GET, 19, 0, 0), &Room::love2GetCure },
- { Action(ACTION_FINISHED_WALKING, 11, 0, 0), &Room::love2ReachedCure },
- { Action(ACTION_FINISHED_ANIMATION, 24, 0, 0), &Room::love2GotCure },
+ { {ACTION_TICK, 1, 0, 0}, &Room::love2Tick1 },
+ { {ACTION_TOUCHED_WARP, 1, 0, 0}, &Room::love2TouchedWarp1 },
+ { {ACTION_TIMER_EXPIRED, 3, 0, 0}, &Room::love2Timer3Expired },
+ { {ACTION_WALK, 10, 0, 0}, &Room::love2WalkToDoor },
+ { {ACTION_WALK, 0x22, 0, 0}, &Room::love2WalkToDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::love2TouchedHotspot0 },
+ { {ACTION_FINISHED_WALKING, 14, 0, 0}, &Room::love2DoorReachedOrOpened },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::love2DoorReachedOrOpened },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::love2LookAtCabinet },
+ { {ACTION_LOOK, 10, 0, 0}, &Room::love2LookAtDoor },
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::love2LookAtSynthesizer },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::love2LookAtAnywhere },
+ { {ACTION_LOOK, 14, 0, 0}, &Room::love2LookAtAntigrav },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::love2LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::love2LookAtSpock },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::love2LookAtRedshirt },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::love2LookAtKirk },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::love2LookAtArdak },
+ { {ACTION_LOOK, 15, 0, 0}, &Room::love2LookAtChamber },
+ { {ACTION_LOOK, 16, 0, 0}, &Room::love2LookAtChamber },
+ { {ACTION_LOOK, 18, 0, 0}, &Room::love2LookAtChamber },
+ { {ACTION_LOOK, 19, 0, 0}, &Room::love2LookAtChamber },
+ { {ACTION_LOOK, 17, 0, 0}, &Room::love2LookAtChamber },
+ { {ACTION_LOOK, 9, 0, 0}, &Room::love2LookAtChamber },
+ { {ACTION_LOOK, 12, 0, 0}, &Room::love2LookAtCan1 },
+ { {ACTION_LOOK, 13, 0, 0}, &Room::love2LookAtCan2 },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::love2TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::love2TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::love2TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::love2TalkToRedshirt },
+ { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::love2UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::love2UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_KIRK, 8, 0}, &Room::love2UseKirkOnCabinet },
+ { {ACTION_USE, OBJECT_SPOCK, 8, 0}, &Room::love2UseSpockOnCabinet },
+ { {ACTION_USE, OBJECT_MCCOY, 8, 0}, &Room::love2UseMccoyOnCabinet },
+ { {ACTION_USE, OBJECT_REDSHIRT, 8, 0}, &Room::love2UseRedshirtOnCabinet },
+ { {ACTION_FINISHED_WALKING, 12, 0, 0}, &Room::love2CrewmanReachedCabinet },
+ { {ACTION_FINISHED_ANIMATION, 11, 0, 0}, &Room::love2CrewmanAccessedCabinet },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::love2CrewmanOpenedOrClosedCabinet },
+ { {ACTION_USE, OBJECT_IWRENCH, 11, 0}, &Room::love2UseWrenchOnGasFeed },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::love2ReachedGasFeed },
+ { {ACTION_FINISHED_ANIMATION, 12, 0, 0}, &Room::love2ChangedGasFeed },
+ { {ACTION_USE, OBJECT_IO2GAS, 0x23, 0}, &Room::love2UseO2GasOnCanisterSlot },
+ { {ACTION_USE, OBJECT_IH2GAS, 0x23, 0}, &Room::love2UseH2GasOnCanisterSlot },
+ { {ACTION_USE, OBJECT_IN2GAS, 0x23, 0}, &Room::love2UseN2GasOnCanisterSlot },
+ { {ACTION_FINISHED_WALKING, 3, 0, 0}, &Room::love2ReachedCanisterSlot },
+ { {ACTION_FINISHED_ANIMATION, 13, 0, 0}, &Room::love2PutCanisterInSlot1 },
+ { {ACTION_FINISHED_ANIMATION, 14, 0, 0}, &Room::love2PutCanisterInSlot2 },
+ { {ACTION_USE, OBJECT_IANTIGRA, 12, 0}, &Room::love2UseAntigravOnCanister1 },
+ { {ACTION_FINISHED_WALKING, 4, 0, 0}, &Room::love2ReachedCanisterSlot1ToGet },
+ { {ACTION_FINISHED_ANIMATION, 15, 0, 0}, &Room::love2TookCanister1 },
+ { {ACTION_USE, OBJECT_IANTIGRA, 13, 0}, &Room::love2UseAntigravOnCanister2 },
+ { {ACTION_FINISHED_WALKING, 5, 0, 0}, &Room::love2ReachedCanisterSlot2ToGet },
+ { {ACTION_FINISHED_ANIMATION, 16, 0, 0}, &Room::love2TookCanister2 },
+ { {ACTION_USE, OBJECT_KIRK, 0x20, 0}, &Room::love2UseKirkOnSynthesizer },
+ { {ACTION_USE, OBJECT_SPOCK, 0x20, 0}, &Room::love2UseSpockOnSynthesizer },
+ { {ACTION_USE, OBJECT_MCCOY, 0x20, 0}, &Room::love2UseMccoyOnSynthesizer },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x20, 0}, &Room::love2UseRedshirtOnSynthesizer },
+ { {ACTION_FINISHED_WALKING, 13, 0, 0}, &Room::love2CrewmanReachedSynthesizer },
+ { {ACTION_FINISHED_ANIMATION, 17, 0, 0}, &Room::love2CrewmanUsedSynthesizer },
+ { {ACTION_FINISHED_WALKING, 16, 0, 0}, &Room::love2SpockReachedGasFeeds },
+ { {ACTION_FINISHED_ANIMATION, 18, 0, 0}, &Room::love2SpockEnabledGasFeeds },
+ { {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::love2SynthesizerDoorClosed },
+ { {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::love2SynthesizerFinished },
+ { {ACTION_FINISHED_ANIMATION, 27, 0, 0}, &Room::love2ClosedSynthesizerDoorMakingRLG },
+ { {ACTION_FINISHED_ANIMATION, 8, 0, 0}, &Room::love2ClosedSynthesizerDoorMakingCure },
+ { {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::love2CureStartedSynthesizing },
+ { {ACTION_FINISHED_ANIMATION, 10, 0, 0}, &Room::love2CureSynthesized },
+ { {ACTION_USE, OBJECT_IPBC, 9, 0}, &Room::love2UsePolyberylcarbonateOnSynthesizerDoor },
+ { {ACTION_FINISHED_WALKING, 6, 0, 0}, &Room::love2KirkReachedSynthesizerWithPolyberylcarbonate },
+ { {ACTION_FINISHED_ANIMATION, 5, 0, 0}, &Room::love2SynthesizerDoorOpenedWithPolyberylcarbonate },
+ { {ACTION_FINISHED_ANIMATION, 19, 0, 0}, &Room::love2PutPolyberylcarbonateInSynthesizer },
+
+ { {ACTION_USE, OBJECT_IDISHES, 9, 0}, &Room::love2UseVirusSampleOnSynthesizerDoor },
+ { {ACTION_FINISHED_WALKING, 7, 0, 0}, &Room::love2KirkReachedSynthesizerWithVirusSample },
+ { {ACTION_FINISHED_ANIMATION, 6, 0, 0}, &Room::love2SynthesizerDoorOpenedWithVirusSample },
+ { {ACTION_FINISHED_ANIMATION, 20, 0, 0}, &Room::love2PutVirusSampleInSynthesizer },
+
+ { {ACTION_USE, OBJECT_ISAMPLE, 9, 0}, &Room::love2UseCureSampleOnSynthesizerDoor },
+ { {ACTION_FINISHED_WALKING, 8, 0, 0}, &Room::love2KirkReachedSynthesizerWithCureSample },
+ { {ACTION_FINISHED_ANIMATION, 7, 0, 0}, &Room::love2SynthesizerDoorOpenedWithCureSample },
+ { {ACTION_FINISHED_ANIMATION, 21, 0, 0}, &Room::love2PutCureSampleInSynthesizer },
+
+ { {ACTION_USE, -1, 9, 0}, &Room::love2UseAnythingOnSynthesizerDoor },
+ { {ACTION_USE, -1, 0x20, 0}, &Room::love2UseAnythingOnSynthesizer },
+ { {ACTION_GET, 13, 0, 0}, &Room::love2GetCanister },
+ { {ACTION_GET, 12, 0, 0}, &Room::love2GetCanister },
+
+ { {ACTION_GET, 14, 0, 0}, &Room::love2GetAntigrav },
+ { {ACTION_FINISHED_WALKING, 9, 0, 0}, &Room::love2ReachedAntigrav },
+ { {ACTION_FINISHED_ANIMATION, 22, 0, 0}, &Room::love2GotAntigrav },
+
+ { {ACTION_GET, 16, 0, 0}, &Room::love2GetPolyberylcarbonate },
+ { {ACTION_FINISHED_WALKING, 18, 0, 0}, &Room::love2ReachedPolyberylcarbonate },
+ { {ACTION_FINISHED_ANIMATION, 26, 0, 0}, &Room::love2GotPolyberylcarbonate },
+
+ { {ACTION_GET, 17, 0, 0}, &Room::love2GetDishes },
+ { {ACTION_FINISHED_WALKING, 17, 0, 0}, &Room::love2ReachedDishes },
+ { {ACTION_FINISHED_ANIMATION, 25, 0, 0}, &Room::love2GotDishes },
+
+ { {ACTION_GET, 18, 0, 0}, &Room::love2GetSample },
+ { {ACTION_FINISHED_WALKING, 19, 0, 0}, &Room::love2ReachedSample },
+ { {ACTION_FINISHED_ANIMATION, 28, 0, 0}, &Room::love2GotSample },
+
+ { {ACTION_GET, 15, 0, 0}, &Room::love2GetSynthesizerOutput },
+ { {ACTION_FINISHED_WALKING, 10, 0, 0}, &Room::love2ReachedSynthesizerOutput },
+ { {ACTION_FINISHED_ANIMATION, 23, 0, 0}, &Room::love2GotSynthesizerOutput },
+
+ { {ACTION_GET, 19, 0, 0}, &Room::love2GetCure },
+ { {ACTION_FINISHED_WALKING, 11, 0, 0}, &Room::love2ReachedCure },
+ { {ACTION_FINISHED_ANIMATION, 24, 0, 0}, &Room::love2GotCure },
// Common code
- { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::loveaTimer0Expired },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::loveaTimer1Expired },
- { Action(ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0), &Room::loveaUseMedkitOnSpock },
- { Action(ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0), &Room::loveaUseCureSampleOnSpock },
- { Action(ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0), &Room::loveaUseCureOnSpock },
- { Action(ACTION_FINISHED_WALKING, 99, 0, 0), &Room::loveaSpockOrMccoyInPositionToUseCure },
- { Action(ACTION_FINISHED_ANIMATION, 99, 0, 0), &Room::loveaFinishedCuringSpock },
- { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::loveaTimer2Expired },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0), &Room::loveaUseMTricorderOnSpock },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IRLG, -1, 0), &Room::loveaUseRomulanLaughingGas },
- { Action(ACTION_USE, OBJECT_IN2O, -1, 0), &Room::loveaUseHumanLaughingGas },
- { Action(ACTION_USE, OBJECT_INH3, -1, 0), &Room::loveaUseAmmonia },
- { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::loveaUseCommunicator },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::loveaTimer0Expired },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::loveaTimer1Expired },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0}, &Room::loveaUseMedkitOnSpock },
+ { {ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0}, &Room::loveaUseCureSampleOnSpock },
+ { {ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0}, &Room::loveaUseCureOnSpock },
+ { {ACTION_FINISHED_WALKING, 99, 0, 0}, &Room::loveaSpockOrMccoyInPositionToUseCure },
+ { {ACTION_FINISHED_ANIMATION, 99, 0, 0}, &Room::loveaFinishedCuringSpock },
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::loveaTimer2Expired },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::loveaUseMTricorderOnSpock },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IRLG, -1, 0}, &Room::loveaUseRomulanLaughingGas },
+ { {ACTION_USE, OBJECT_IN2O, -1, 0}, &Room::loveaUseHumanLaughingGas },
+ { {ACTION_USE, OBJECT_INH3, -1, 0}, &Room::loveaUseAmmonia },
+ { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::loveaUseCommunicator },
};
RoomAction love3ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::love3Tick1 },
- { Action(ACTION_TICK, 80, 0, 0), &Room::love3Tick80 },
- { Action(ACTION_TOUCHED_WARP, 1, 0, 0), &Room::love3TouchedWarp1 },
- { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::love3Timer3Expired },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::love3LookAtServicePanel },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::love3LookAtMonitor },
- { Action(ACTION_LOOK, 10, 0, 0), &Room::love3LookAtWrench },
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::love3LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::love3LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::love3LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::love3LookAtRedshirt },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::love3LookAnywhere },
- { Action(ACTION_LOOK, 0x22, 0, 0), &Room::love3LookAtShaft },
- { Action(ACTION_LOOK, 11, 0, 0), &Room::love3LookAtGrate },
- { Action(ACTION_LOOK, 9, 0, 0), &Room::love3LookAtPanel },
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::love3LookAtPanel },
- { Action(ACTION_LOOK, 12, 0, 0), &Room::love3LookAtGasTank },
- { Action(ACTION_LOOK, 0x23, 0, 0), &Room::love3LookAtTurbines },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::love3TalkToKirk },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::love3TalkToSpock },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::love3TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::love3TalkToRedshirt },
- { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::love3UseMTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::love3UseSTricorderOnTurbines },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 9, 0), &Room::love3UseSTricorderOnInsulation },
- { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::love3UseSTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_KIRK, 8, 0), &Room::love3UseKirkOnServicePanel },
- { Action(ACTION_USE, OBJECT_SPOCK, 8, 0), &Room::love3UseSpockOnServicePanel },
- { Action(ACTION_USE, OBJECT_MCCOY, 8, 0), &Room::love3UseMccoyOnServicePanel },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 8, 0), &Room::love3UseRedshirtOnServicePanel },
- { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::love3CrewmanReachedServicePanel },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::love3OpenedOrClosedServicePanel },
-
- { Action(ACTION_USE, OBJECT_IWRENCH, 12, 0), &Room::love3UseWrenchOnGasTank },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::love3ReachedGasTankToUnscrew },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::love3ScrewedOrUnscrewedGasTank },
-
- { Action(ACTION_USE, OBJECT_IWRENCH, OBJECT_IO2GAS, 0), &Room::love3UseWrenchOnO2OrH2Gas },
- { Action(ACTION_USE, OBJECT_IWRENCH, OBJECT_IH2GAS, 0), &Room::love3UseWrenchOnO2OrH2Gas },
-
- { Action(ACTION_USE, OBJECT_IWRENCH, OBJECT_IN2GAS, 0), &Room::love3UseWrenchOnN2Gas },
- { Action(ACTION_FINISHED_WALKING, 15, 0, 0), &Room::love3ReachedGasTankToPutDown },
- { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love3PutN2TankBack },
-
- { Action(ACTION_USE, OBJECT_IWRENCH, 0x20, 0), &Room::love3UseWrenchOnEngineeringPanel },
- { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::love3ReachedEngineeringPanel },
- { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love3OpenedEngineeringPanel },
-
- { Action(ACTION_USE, OBJECT_IWRENCH, 0x21, 0), &Room::love3UseWrenchOnMonitor },
-
- { Action(ACTION_USE, OBJECT_IH2O, 0x21, 0), &Room::love3UseWaterOnMonitor },
- { Action(ACTION_FINISHED_WALKING, 14, 0, 0), &Room::love3ReachedMonitorToUseWater },
- { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love3PouredWaterOnMonitor },
-
- { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
- { Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
- { Action(ACTION_USE, OBJECT_KIRK, 11, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
- { Action(ACTION_USE, OBJECT_SPOCK, 11, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
- { Action(ACTION_USE, OBJECT_MCCOY, 11, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 11, 0), &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
-
- { Action(ACTION_USE, OBJECT_IWRENCH, 11, 0), &Room::love3UseWrenchOnGrate },
- { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::love3ReachedGateWithWrench },
- { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::love3OpenedOrClosedGrate },
-
- { Action(ACTION_USE, OBJECT_KIRK, 0x22, 0), &Room::love3UseCrewmanOnShaft },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x22, 0), &Room::love3UseCrewmanOnShaft },
- { Action(ACTION_USE, OBJECT_MCCOY, 0x22, 0), &Room::love3UseCrewmanOnShaft },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x22, 0), &Room::love3UseCrewmanOnShaft },
-
- { Action(ACTION_USE, OBJECT_IH2O, 0x22, 0), &Room::love3UseWaterOnShaft },
- { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::love3ReachedShaftUsingWater },
- { Action(ACTION_FINISHED_ANIMATION, 8, 0, 0), &Room::love3PouredWaterDownShaft },
-
- { Action(ACTION_USE, OBJECT_IN2O, 0x22, 0), &Room::love3UseNitrousOxideOnShaft },
- { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::love3ReachedShaftUsingNitrousOxide },
- { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::love3PouredNitrousOxideDownShaft },
-
- { Action(ACTION_USE, OBJECT_INH3, 0x22, 0), &Room::love3UseAmmoniaOnShaft },
- { Action(ACTION_FINISHED_WALKING, 7, 0, 0), &Room::love3ReachedShaftUsingAmmonia },
- { Action(ACTION_FINISHED_ANIMATION, 10, 0, 0), &Room::love3PouredAmmoniaDownShaft },
-
- { Action(ACTION_USE, OBJECT_IRLG, 0x22, 0), &Room::love3UseRomulanLaughingGasOnShaft },
- { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::love3ReachedShaftUsingRomulanLaughingGas },
- { Action(ACTION_FINISHED_ANIMATION, 11, 0, 0), &Room::love3PouredRomulanLaughingGasDownShaft },
-
- { Action(ACTION_GET, 10, 0, 0), &Room::love3GetWrench },
- { Action(ACTION_FINISHED_WALKING, 9, 0, 0), &Room::love3ReachedWrenchToGet },
- { Action(ACTION_FINISHED_ANIMATION, 12, 0, 0), &Room::love3PickedUpWrench },
-
- { Action(ACTION_GET, 12, 0, 0), &Room::love3GetGasTank },
- { Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::love3ReachedGasTankToGet },
-
- { Action(ACTION_USE, OBJECT_IANTIGRA, 12, 0), &Room::love3UseAntigravOnGasTank },
- { Action(ACTION_FINISHED_WALKING, 11, 0, 0), &Room::love3ReachedGasTankUsingAntigrav },
- { Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::love3PickedUpGasTank },
-
- { Action(ACTION_GET, 9, 0, 0), &Room::love3GetInsulation },
- { Action(ACTION_FINISHED_WALKING, 12, 0, 0), &Room::love3ReachedInsulationToGet },
- { Action(ACTION_FINISHED_ANIMATION, 14, 0, 0), &Room::love3PickedUpInsulation },
+ { {ACTION_TICK, 1, 0, 0}, &Room::love3Tick1 },
+ { {ACTION_TICK, 80, 0, 0}, &Room::love3Tick80 },
+ { {ACTION_TOUCHED_WARP, 1, 0, 0}, &Room::love3TouchedWarp1 },
+ { {ACTION_TIMER_EXPIRED, 3, 0, 0}, &Room::love3Timer3Expired },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::love3LookAtServicePanel },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::love3LookAtMonitor },
+ { {ACTION_LOOK, 10, 0, 0}, &Room::love3LookAtWrench },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::love3LookAtKirk },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::love3LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::love3LookAtSpock },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::love3LookAtRedshirt },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::love3LookAnywhere },
+ { {ACTION_LOOK, 0x22, 0, 0}, &Room::love3LookAtShaft },
+ { {ACTION_LOOK, 11, 0, 0}, &Room::love3LookAtGrate },
+ { {ACTION_LOOK, 9, 0, 0}, &Room::love3LookAtPanel },
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::love3LookAtPanel },
+ { {ACTION_LOOK, 12, 0, 0}, &Room::love3LookAtGasTank },
+ { {ACTION_LOOK, 0x23, 0, 0}, &Room::love3LookAtTurbines },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::love3TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::love3TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::love3TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::love3TalkToRedshirt },
+ { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::love3UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x23, 0}, &Room::love3UseSTricorderOnTurbines },
+ { {ACTION_USE, OBJECT_ISTRICOR, 9, 0}, &Room::love3UseSTricorderOnInsulation },
+ { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::love3UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_KIRK, 8, 0}, &Room::love3UseKirkOnServicePanel },
+ { {ACTION_USE, OBJECT_SPOCK, 8, 0}, &Room::love3UseSpockOnServicePanel },
+ { {ACTION_USE, OBJECT_MCCOY, 8, 0}, &Room::love3UseMccoyOnServicePanel },
+ { {ACTION_USE, OBJECT_REDSHIRT, 8, 0}, &Room::love3UseRedshirtOnServicePanel },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::love3CrewmanReachedServicePanel },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::love3OpenedOrClosedServicePanel },
+
+ { {ACTION_USE, OBJECT_IWRENCH, 12, 0}, &Room::love3UseWrenchOnGasTank },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::love3ReachedGasTankToUnscrew },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::love3ScrewedOrUnscrewedGasTank },
+
+ { {ACTION_USE, OBJECT_IWRENCH, OBJECT_IO2GAS, 0}, &Room::love3UseWrenchOnO2OrH2Gas },
+ { {ACTION_USE, OBJECT_IWRENCH, OBJECT_IH2GAS, 0}, &Room::love3UseWrenchOnO2OrH2Gas },
+
+ { {ACTION_USE, OBJECT_IWRENCH, OBJECT_IN2GAS, 0}, &Room::love3UseWrenchOnN2Gas },
+ { {ACTION_FINISHED_WALKING, 15, 0, 0}, &Room::love3ReachedGasTankToPutDown },
+ { {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::love3PutN2TankBack },
+
+ { {ACTION_USE, OBJECT_IWRENCH, 0x20, 0}, &Room::love3UseWrenchOnEngineeringPanel },
+ { {ACTION_FINISHED_WALKING, 3, 0, 0}, &Room::love3ReachedEngineeringPanel },
+ { {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::love3OpenedEngineeringPanel },
+
+ { {ACTION_USE, OBJECT_IWRENCH, 0x21, 0}, &Room::love3UseWrenchOnMonitor },
+
+ { {ACTION_USE, OBJECT_IH2O, 0x21, 0}, &Room::love3UseWaterOnMonitor },
+ { {ACTION_FINISHED_WALKING, 14, 0, 0}, &Room::love3ReachedMonitorToUseWater },
+ { {ACTION_FINISHED_ANIMATION, 6, 0, 0}, &Room::love3PouredWaterOnMonitor },
+
+ { {ACTION_USE, OBJECT_KIRK, 0x20, 0}, &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
+ { {ACTION_USE, OBJECT_SPOCK, 0x20, 0}, &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
+ { {ACTION_USE, OBJECT_MCCOY, 0x20, 0}, &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x20, 0}, &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
+ { {ACTION_USE, OBJECT_KIRK, 11, 0}, &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
+ { {ACTION_USE, OBJECT_SPOCK, 11, 0}, &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
+ { {ACTION_USE, OBJECT_MCCOY, 11, 0}, &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
+ { {ACTION_USE, OBJECT_REDSHIRT, 11, 0}, &Room::love3UseCrewmanOnEngineeringPanelOrGrate },
+
+ { {ACTION_USE, OBJECT_IWRENCH, 11, 0}, &Room::love3UseWrenchOnGrate },
+ { {ACTION_FINISHED_WALKING, 4, 0, 0}, &Room::love3ReachedGateWithWrench },
+ { {ACTION_FINISHED_ANIMATION, 7, 0, 0}, &Room::love3OpenedOrClosedGrate },
+
+ { {ACTION_USE, OBJECT_KIRK, 0x22, 0}, &Room::love3UseCrewmanOnShaft },
+ { {ACTION_USE, OBJECT_SPOCK, 0x22, 0}, &Room::love3UseCrewmanOnShaft },
+ { {ACTION_USE, OBJECT_MCCOY, 0x22, 0}, &Room::love3UseCrewmanOnShaft },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x22, 0}, &Room::love3UseCrewmanOnShaft },
+
+ { {ACTION_USE, OBJECT_IH2O, 0x22, 0}, &Room::love3UseWaterOnShaft },
+ { {ACTION_FINISHED_WALKING, 5, 0, 0}, &Room::love3ReachedShaftUsingWater },
+ { {ACTION_FINISHED_ANIMATION, 8, 0, 0}, &Room::love3PouredWaterDownShaft },
+
+ { {ACTION_USE, OBJECT_IN2O, 0x22, 0}, &Room::love3UseNitrousOxideOnShaft },
+ { {ACTION_FINISHED_WALKING, 6, 0, 0}, &Room::love3ReachedShaftUsingNitrousOxide },
+ { {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::love3PouredNitrousOxideDownShaft },
+
+ { {ACTION_USE, OBJECT_INH3, 0x22, 0}, &Room::love3UseAmmoniaOnShaft },
+ { {ACTION_FINISHED_WALKING, 7, 0, 0}, &Room::love3ReachedShaftUsingAmmonia },
+ { {ACTION_FINISHED_ANIMATION, 10, 0, 0}, &Room::love3PouredAmmoniaDownShaft },
+
+ { {ACTION_USE, OBJECT_IRLG, 0x22, 0}, &Room::love3UseRomulanLaughingGasOnShaft },
+ { {ACTION_FINISHED_WALKING, 8, 0, 0}, &Room::love3ReachedShaftUsingRomulanLaughingGas },
+ { {ACTION_FINISHED_ANIMATION, 11, 0, 0}, &Room::love3PouredRomulanLaughingGasDownShaft },
+
+ { {ACTION_GET, 10, 0, 0}, &Room::love3GetWrench },
+ { {ACTION_FINISHED_WALKING, 9, 0, 0}, &Room::love3ReachedWrenchToGet },
+ { {ACTION_FINISHED_ANIMATION, 12, 0, 0}, &Room::love3PickedUpWrench },
+
+ { {ACTION_GET, 12, 0, 0}, &Room::love3GetGasTank },
+ { {ACTION_FINISHED_WALKING, 10, 0, 0}, &Room::love3ReachedGasTankToGet },
+
+ { {ACTION_USE, OBJECT_IANTIGRA, 12, 0}, &Room::love3UseAntigravOnGasTank },
+ { {ACTION_FINISHED_WALKING, 11, 0, 0}, &Room::love3ReachedGasTankUsingAntigrav },
+ { {ACTION_FINISHED_ANIMATION, 13, 0, 0}, &Room::love3PickedUpGasTank },
+
+ { {ACTION_GET, 9, 0, 0}, &Room::love3GetInsulation },
+ { {ACTION_FINISHED_WALKING, 12, 0, 0}, &Room::love3ReachedInsulationToGet },
+ { {ACTION_FINISHED_ANIMATION, 14, 0, 0}, &Room::love3PickedUpInsulation },
// Common code
- { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::loveaTimer0Expired },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::loveaTimer1Expired },
- { Action(ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0), &Room::loveaUseMedkitOnSpock },
- { Action(ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0), &Room::loveaUseCureSampleOnSpock },
- { Action(ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0), &Room::loveaUseCureOnSpock },
- { Action(ACTION_FINISHED_WALKING, 99, 0, 0), &Room::loveaSpockOrMccoyInPositionToUseCure },
- { Action(ACTION_FINISHED_ANIMATION, 99, 0, 0), &Room::loveaFinishedCuringSpock },
- { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::loveaTimer2Expired },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0), &Room::loveaUseMTricorderOnSpock },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IRLG, -1, 0), &Room::loveaUseRomulanLaughingGas },
- { Action(ACTION_USE, OBJECT_IN2O, -1, 0), &Room::loveaUseHumanLaughingGas },
- { Action(ACTION_USE, OBJECT_INH3, -1, 0), &Room::loveaUseAmmonia },
- { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::loveaUseCommunicator },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::loveaTimer0Expired },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::loveaTimer1Expired },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0}, &Room::loveaUseMedkitOnSpock },
+ { {ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0}, &Room::loveaUseCureSampleOnSpock },
+ { {ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0}, &Room::loveaUseCureOnSpock },
+ { {ACTION_FINISHED_WALKING, 99, 0, 0}, &Room::loveaSpockOrMccoyInPositionToUseCure },
+ { {ACTION_FINISHED_ANIMATION, 99, 0, 0}, &Room::loveaFinishedCuringSpock },
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::loveaTimer2Expired },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::loveaUseMTricorderOnSpock },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IRLG, -1, 0}, &Room::loveaUseRomulanLaughingGas },
+ { {ACTION_USE, OBJECT_IN2O, -1, 0}, &Room::loveaUseHumanLaughingGas },
+ { {ACTION_USE, OBJECT_INH3, -1, 0}, &Room::loveaUseAmmonia },
+ { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::loveaUseCommunicator },
};
RoomAction love4ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::love4Tick1 },
- { Action(ACTION_TICK, 10, 0, 0), &Room::love4Tick10 },
-
- { Action(ACTION_WALK, 8, 0, 0), &Room::love4WalkToDoor },
- { Action(ACTION_WALK, 0x20, 0, 0), &Room::love4WalkToDoor },
- { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::love4TouchedHotspot0 },
- { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::love4DoorOpenedOrReached },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::love4DoorOpenedOrReached },
-
- { Action(ACTION_USE, OBJECT_KIRK, 0x21, 0), &Room::love4UseKirkOnLadder },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::love4ReachedLadder },
- { Action(ACTION_USE, OBJECT_IPHASERS, 9, 0), &Room::love4UseStunPhaserOnRomulan },
- { Action(ACTION_USE, OBJECT_IPHASERS, 10, 0), &Room::love4UseStunPhaserOnRomulan },
- { Action(ACTION_USE, OBJECT_IPHASERS, 11, 0), &Room::love4UseStunPhaserOnRomulan },
- { Action(ACTION_USE, OBJECT_IPHASERS, 12, 0), &Room::love4UseStunPhaserOnRomulan },
+ { {ACTION_TICK, 1, 0, 0}, &Room::love4Tick1 },
+ { {ACTION_TICK, 10, 0, 0}, &Room::love4Tick10 },
+
+ { {ACTION_WALK, 8, 0, 0}, &Room::love4WalkToDoor },
+ { {ACTION_WALK, 0x20, 0, 0}, &Room::love4WalkToDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::love4TouchedHotspot0 },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::love4DoorOpenedOrReached },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::love4DoorOpenedOrReached },
+
+ { {ACTION_USE, OBJECT_KIRK, 0x21, 0}, &Room::love4UseKirkOnLadder },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::love4ReachedLadder },
+ { {ACTION_USE, OBJECT_IPHASERS, 9, 0}, &Room::love4UseStunPhaserOnRomulan },
+ { {ACTION_USE, OBJECT_IPHASERS, 10, 0}, &Room::love4UseStunPhaserOnRomulan },
+ { {ACTION_USE, OBJECT_IPHASERS, 11, 0}, &Room::love4UseStunPhaserOnRomulan },
+ { {ACTION_USE, OBJECT_IPHASERS, 12, 0}, &Room::love4UseStunPhaserOnRomulan },
// NOTE: nothing for OBJECT_IPHASERK. There's an unused audio file which might fit.
- { Action(ACTION_LOOK, -1, 0, 0), &Room::love4LookAnywhere },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::love4LookAtLadder },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::love4LookAtDoor },
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::love4LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::love4LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::love4LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::love4LookAtRedshirt },
- { Action(ACTION_LOOK, 9, 0, 0), &Room::love4LookAtRomulan },
- { Action(ACTION_LOOK, 10, 0, 0), &Room::love4LookAtRomulan },
- { Action(ACTION_LOOK, 11, 0, 0), &Room::love4LookAtRomulan },
- { Action(ACTION_LOOK, 12, 0, 0), &Room::love4LookAtRomulan },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::love4TalkToKirk },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::love4TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::love4TalkToRedshirt },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::love4TalkToSpock },
- { Action(ACTION_TALK, 9, 0, 0), &Room::love4TalkToRomulan },
- { Action(ACTION_TALK, 10, 0, 0), &Room::love4TalkToRomulan },
- { Action(ACTION_TALK, 11, 0, 0), &Room::love4TalkToRomulan },
- { Action(ACTION_TALK, 12, 0, 0), &Room::love4TalkToRomulan },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 9, 0), &Room::love4UseMTricorderOnRomulan },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 10, 0), &Room::love4UseMTricorderOnRomulan },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 11, 0), &Room::love4UseMTricorderOnRomulan },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 12, 0), &Room::love4UseMTricorderOnRomulan },
- { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::love4UseMTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::love4UseSTricorderAnywhere },
-
- { Action(ACTION_USE, OBJECT_ICURE, 9, 0), &Room::love4UseCureOnRomulan },
- { Action(ACTION_USE, OBJECT_ICURE, 10, 0), &Room::love4UseCureOnRomulan },
- { Action(ACTION_USE, OBJECT_ICURE, 11, 0), &Room::love4UseCureOnRomulan },
- { Action(ACTION_USE, OBJECT_ICURE, 12, 0), &Room::love4UseCureOnRomulan },
- { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::love4MccoyReachedRomulan4 },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::love4MccoyCuredRomulan4 },
- { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::love4MccoyReachedRomulan3 },
- { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love4MccoyCuredRomulan3 },
- { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::love4MccoyReachedRomulan2 },
- { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love4MccoyCuredRomulan2 },
- { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::love4MccoyReachedRomulan1 },
- { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::love4MccoyCuredRomulan1 },
-
- { Action(ACTION_USE, OBJECT_IH2O, 9, 0), &Room::love4UseWaterOnRomulan },
- { Action(ACTION_USE, OBJECT_IH2O, 10, 0), &Room::love4UseWaterOnRomulan },
- { Action(ACTION_USE, OBJECT_IH2O, 11, 0), &Room::love4UseWaterOnRomulan },
- { Action(ACTION_USE, OBJECT_IH2O, 12, 0), &Room::love4UseWaterOnRomulan },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 9, 0), &Room::love4UseMedkitOnRomulan },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 10, 0), &Room::love4UseMedkitOnRomulan },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 11, 0), &Room::love4UseMedkitOnRomulan },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 12, 0), &Room::love4UseMedkitOnRomulan },
- { Action(ACTION_USE, OBJECT_ISAMPLE, 9, 0), &Room::love4UseCureSampleOnRomulan },
- { Action(ACTION_USE, OBJECT_ISAMPLE, 10, 0), &Room::love4UseCureSampleOnRomulan },
- { Action(ACTION_USE, OBJECT_ISAMPLE, 11, 0), &Room::love4UseCureSampleOnRomulan },
- { Action(ACTION_USE, OBJECT_ISAMPLE, 12, 0), &Room::love4UseCureSampleOnRomulan },
- { Action(ACTION_USE, -1, 9, 0), &Room::love4UseAnythingOnRomulan },
- { Action(ACTION_USE, -1, 10, 0), &Room::love4UseAnythingOnRomulan },
- { Action(ACTION_USE, -1, 11, 0), &Room::love4UseAnythingOnRomulan },
- { Action(ACTION_USE, -1, 12, 0), &Room::love4UseAnythingOnRomulan },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::love4LookAnywhere },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::love4LookAtLadder },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::love4LookAtDoor },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::love4LookAtKirk },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::love4LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::love4LookAtSpock },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::love4LookAtRedshirt },
+ { {ACTION_LOOK, 9, 0, 0}, &Room::love4LookAtRomulan },
+ { {ACTION_LOOK, 10, 0, 0}, &Room::love4LookAtRomulan },
+ { {ACTION_LOOK, 11, 0, 0}, &Room::love4LookAtRomulan },
+ { {ACTION_LOOK, 12, 0, 0}, &Room::love4LookAtRomulan },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::love4TalkToKirk },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::love4TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::love4TalkToRedshirt },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::love4TalkToSpock },
+ { {ACTION_TALK, 9, 0, 0}, &Room::love4TalkToRomulan },
+ { {ACTION_TALK, 10, 0, 0}, &Room::love4TalkToRomulan },
+ { {ACTION_TALK, 11, 0, 0}, &Room::love4TalkToRomulan },
+ { {ACTION_TALK, 12, 0, 0}, &Room::love4TalkToRomulan },
+ { {ACTION_USE, OBJECT_IMTRICOR, 9, 0}, &Room::love4UseMTricorderOnRomulan },
+ { {ACTION_USE, OBJECT_IMTRICOR, 10, 0}, &Room::love4UseMTricorderOnRomulan },
+ { {ACTION_USE, OBJECT_IMTRICOR, 11, 0}, &Room::love4UseMTricorderOnRomulan },
+ { {ACTION_USE, OBJECT_IMTRICOR, 12, 0}, &Room::love4UseMTricorderOnRomulan },
+ { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::love4UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::love4UseSTricorderAnywhere },
+
+ { {ACTION_USE, OBJECT_ICURE, 9, 0}, &Room::love4UseCureOnRomulan },
+ { {ACTION_USE, OBJECT_ICURE, 10, 0}, &Room::love4UseCureOnRomulan },
+ { {ACTION_USE, OBJECT_ICURE, 11, 0}, &Room::love4UseCureOnRomulan },
+ { {ACTION_USE, OBJECT_ICURE, 12, 0}, &Room::love4UseCureOnRomulan },
+ { {ACTION_FINISHED_WALKING, 3, 0, 0}, &Room::love4MccoyReachedRomulan4 },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::love4MccoyCuredRomulan4 },
+ { {ACTION_FINISHED_WALKING, 4, 0, 0}, &Room::love4MccoyReachedRomulan3 },
+ { {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::love4MccoyCuredRomulan3 },
+ { {ACTION_FINISHED_WALKING, 5, 0, 0}, &Room::love4MccoyReachedRomulan2 },
+ { {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::love4MccoyCuredRomulan2 },
+ { {ACTION_FINISHED_WALKING, 6, 0, 0}, &Room::love4MccoyReachedRomulan1 },
+ { {ACTION_FINISHED_ANIMATION, 5, 0, 0}, &Room::love4MccoyCuredRomulan1 },
+
+ { {ACTION_USE, OBJECT_IH2O, 9, 0}, &Room::love4UseWaterOnRomulan },
+ { {ACTION_USE, OBJECT_IH2O, 10, 0}, &Room::love4UseWaterOnRomulan },
+ { {ACTION_USE, OBJECT_IH2O, 11, 0}, &Room::love4UseWaterOnRomulan },
+ { {ACTION_USE, OBJECT_IH2O, 12, 0}, &Room::love4UseWaterOnRomulan },
+ { {ACTION_USE, OBJECT_IMEDKIT, 9, 0}, &Room::love4UseMedkitOnRomulan },
+ { {ACTION_USE, OBJECT_IMEDKIT, 10, 0}, &Room::love4UseMedkitOnRomulan },
+ { {ACTION_USE, OBJECT_IMEDKIT, 11, 0}, &Room::love4UseMedkitOnRomulan },
+ { {ACTION_USE, OBJECT_IMEDKIT, 12, 0}, &Room::love4UseMedkitOnRomulan },
+ { {ACTION_USE, OBJECT_ISAMPLE, 9, 0}, &Room::love4UseCureSampleOnRomulan },
+ { {ACTION_USE, OBJECT_ISAMPLE, 10, 0}, &Room::love4UseCureSampleOnRomulan },
+ { {ACTION_USE, OBJECT_ISAMPLE, 11, 0}, &Room::love4UseCureSampleOnRomulan },
+ { {ACTION_USE, OBJECT_ISAMPLE, 12, 0}, &Room::love4UseCureSampleOnRomulan },
+ { {ACTION_USE, -1, 9, 0}, &Room::love4UseAnythingOnRomulan },
+ { {ACTION_USE, -1, 10, 0}, &Room::love4UseAnythingOnRomulan },
+ { {ACTION_USE, -1, 11, 0}, &Room::love4UseAnythingOnRomulan },
+ { {ACTION_USE, -1, 12, 0}, &Room::love4UseAnythingOnRomulan },
// Common code
- { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::loveaTimer0Expired },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::loveaTimer1Expired },
- { Action(ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0), &Room::loveaUseMedkitOnSpock },
- { Action(ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0), &Room::loveaUseCureSampleOnSpock },
- { Action(ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0), &Room::loveaUseCureOnSpock },
- { Action(ACTION_FINISHED_WALKING, 99, 0, 0), &Room::loveaSpockOrMccoyInPositionToUseCure },
- { Action(ACTION_FINISHED_ANIMATION, 99, 0, 0), &Room::loveaFinishedCuringSpock },
- { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::loveaTimer2Expired },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0), &Room::loveaUseMTricorderOnSpock },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IRLG, -1, 0), &Room::loveaUseRomulanLaughingGas },
- { Action(ACTION_USE, OBJECT_IN2O, -1, 0), &Room::loveaUseHumanLaughingGas },
- { Action(ACTION_USE, OBJECT_INH3, -1, 0), &Room::loveaUseAmmonia },
- { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::loveaUseCommunicator },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::loveaTimer0Expired },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::loveaTimer1Expired },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0}, &Room::loveaUseMedkitOnSpock },
+ { {ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0}, &Room::loveaUseCureSampleOnSpock },
+ { {ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0}, &Room::loveaUseCureOnSpock },
+ { {ACTION_FINISHED_WALKING, 99, 0, 0}, &Room::loveaSpockOrMccoyInPositionToUseCure },
+ { {ACTION_FINISHED_ANIMATION, 99, 0, 0}, &Room::loveaFinishedCuringSpock },
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::loveaTimer2Expired },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::loveaUseMTricorderOnSpock },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IRLG, -1, 0}, &Room::loveaUseRomulanLaughingGas },
+ { {ACTION_USE, OBJECT_IN2O, -1, 0}, &Room::loveaUseHumanLaughingGas },
+ { {ACTION_USE, OBJECT_INH3, -1, 0}, &Room::loveaUseAmmonia },
+ { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::loveaUseCommunicator },
};
RoomAction love5ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::love5Tick1 },
- { Action(ACTION_TOUCHED_WARP, 1, 0, 0), &Room::love5TouchedWarp1 },
- { Action(ACTION_TIMER_EXPIRED, 4, 0, 0), &Room::love5Timer4Expired },
- { Action(ACTION_USE, OBJECT_IPHASERS, 9, 0), &Room::love5UseStunPhaserOnPreax },
+ { {ACTION_TICK, 1, 0, 0}, &Room::love5Tick1 },
+ { {ACTION_TOUCHED_WARP, 1, 0, 0}, &Room::love5TouchedWarp1 },
+ { {ACTION_TIMER_EXPIRED, 4, 0, 0}, &Room::love5Timer4Expired },
+ { {ACTION_USE, OBJECT_IPHASERS, 9, 0}, &Room::love5UseStunPhaserOnPreax },
// NOTE: nothing for OBJECT_IPHASERK. There's an unused audio file which might fit.
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::love5LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::love5LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::love5LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::love5LookAtRedshirt },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::love5LookAnywhere },
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::love5LookAtDevice },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::love5LookAtConsole },
- { Action(ACTION_LOOK, 10, 0, 0), &Room::love5LookAtDrMarcus },
- { Action(ACTION_LOOK, 11, 0, 0), &Room::love5LookAtDrCheever },
- { Action(ACTION_LOOK, 9, 0, 0), &Room::love5LookAtPreax },
- { Action(ACTION_TALK, 9, 0, 0), &Room::love5TalkToPreax },
- { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::love5MccoyReachedSpockToCure },
- { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love5MccoyCuredSpock },
- { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::love5CrewmanReachedBeamoutPosition },
- { Action(ACTION_TALK, 10, 0, 0), &Room::love5TalkToDrMarcus },
- { Action(ACTION_TALK, 11, 0, 0), &Room::love5TalkToDrCheever },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::love5TalkToKirk },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::love5TalkToSpock },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::love5TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::love5TalkToRedshirt },
- { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::love5UseSTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::love5UseSTricorderOnDevice },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 10, 0), &Room::love5UseMTricorderOnMarcusOrCheever },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 11, 0), &Room::love5UseMTricorderOnMarcusOrCheever },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 9, 0), &Room::love5UseMTricorderOnPreax },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 9, 0), &Room::love5UseMedkitOnPreax },
- { Action(ACTION_USE, OBJECT_IH2O, 9, 0), &Room::love5UseWaterOnPreax },
- { Action(ACTION_USE, OBJECT_ISAMPLE, 9, 0), &Room::love5UseCureSampleOnPreax },
- { Action(ACTION_USE, OBJECT_ICURE, 9, 0), &Room::love5UseCureOnPreax },
- { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::love5ReachedPreaxUsingCure },
- { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::love5CuredPreax },
- { Action(ACTION_USE, -1, 9, 0), &Room::love5UseAnythingOnPreax },
- { Action(ACTION_USE, OBJECT_KIRK, 10, 0), &Room::love5UseKirkOnMarcusOrCheever },
- { Action(ACTION_USE, OBJECT_KIRK, 11, 0), &Room::love5UseKirkOnMarcusOrCheever },
- { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::love5KirkReachedCheever },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::love5KirkUntiedCheever },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::love5KirkReachedMarcus },
- { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love5KirkUntiedMarcus },
- { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love5MarcusStoodUp },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::love5LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::love5LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::love5LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::love5LookAtRedshirt },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::love5LookAnywhere },
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::love5LookAtDevice },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::love5LookAtConsole },
+ { {ACTION_LOOK, 10, 0, 0}, &Room::love5LookAtDrMarcus },
+ { {ACTION_LOOK, 11, 0, 0}, &Room::love5LookAtDrCheever },
+ { {ACTION_LOOK, 9, 0, 0}, &Room::love5LookAtPreax },
+ { {ACTION_TALK, 9, 0, 0}, &Room::love5TalkToPreax },
+ { {ACTION_FINISHED_WALKING, 5, 0, 0}, &Room::love5MccoyReachedSpockToCure },
+ { {ACTION_FINISHED_ANIMATION, 6, 0, 0}, &Room::love5MccoyCuredSpock },
+ { {ACTION_FINISHED_WALKING, 6, 0, 0}, &Room::love5CrewmanReachedBeamoutPosition },
+ { {ACTION_TALK, 10, 0, 0}, &Room::love5TalkToDrMarcus },
+ { {ACTION_TALK, 11, 0, 0}, &Room::love5TalkToDrCheever },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::love5TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::love5TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::love5TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::love5TalkToRedshirt },
+ { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::love5UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::love5UseSTricorderOnDevice },
+ { {ACTION_USE, OBJECT_IMTRICOR, 10, 0}, &Room::love5UseMTricorderOnMarcusOrCheever },
+ { {ACTION_USE, OBJECT_IMTRICOR, 11, 0}, &Room::love5UseMTricorderOnMarcusOrCheever },
+ { {ACTION_USE, OBJECT_IMTRICOR, 9, 0}, &Room::love5UseMTricorderOnPreax },
+ { {ACTION_USE, OBJECT_IMEDKIT, 9, 0}, &Room::love5UseMedkitOnPreax },
+ { {ACTION_USE, OBJECT_IH2O, 9, 0}, &Room::love5UseWaterOnPreax },
+ { {ACTION_USE, OBJECT_ISAMPLE, 9, 0}, &Room::love5UseCureSampleOnPreax },
+ { {ACTION_USE, OBJECT_ICURE, 9, 0}, &Room::love5UseCureOnPreax },
+ { {ACTION_FINISHED_WALKING, 4, 0, 0}, &Room::love5ReachedPreaxUsingCure },
+ { {ACTION_FINISHED_ANIMATION, 5, 0, 0}, &Room::love5CuredPreax },
+ { {ACTION_USE, -1, 9, 0}, &Room::love5UseAnythingOnPreax },
+ { {ACTION_USE, OBJECT_KIRK, 10, 0}, &Room::love5UseKirkOnMarcusOrCheever },
+ { {ACTION_USE, OBJECT_KIRK, 11, 0}, &Room::love5UseKirkOnMarcusOrCheever },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::love5KirkReachedCheever },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::love5KirkUntiedCheever },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::love5KirkReachedMarcus },
+ { {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::love5KirkUntiedMarcus },
+ { {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::love5MarcusStoodUp },
// Common code
- { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::loveaTimer0Expired },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::loveaTimer1Expired },
- { Action(ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0), &Room::loveaUseMedkitOnSpock },
- { Action(ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0), &Room::loveaUseCureSampleOnSpock },
- { Action(ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0), &Room::loveaUseCureOnSpock },
- { Action(ACTION_FINISHED_WALKING, 99, 0, 0), &Room::loveaSpockOrMccoyInPositionToUseCure },
- { Action(ACTION_FINISHED_ANIMATION, 99, 0, 0), &Room::loveaFinishedCuringSpock },
- { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::loveaTimer2Expired },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0), &Room::loveaUseMTricorderOnSpock },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0), &Room::loveaUseMTricorderOnHuman },
- { Action(ACTION_USE, OBJECT_IRLG, -1, 0), &Room::loveaUseRomulanLaughingGas },
- { Action(ACTION_USE, OBJECT_IN2O, -1, 0), &Room::loveaUseHumanLaughingGas },
- { Action(ACTION_USE, OBJECT_INH3, -1, 0), &Room::loveaUseAmmonia },
- { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::loveaUseCommunicator },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::loveaTimer0Expired },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::loveaTimer1Expired },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0}, &Room::loveaUseMedkitOnSpock },
+ { {ACTION_USE, OBJECT_ISAMPLE, OBJECT_SPOCK, 0}, &Room::loveaUseCureSampleOnSpock },
+ { {ACTION_USE, OBJECT_ICURE, OBJECT_SPOCK, 0}, &Room::loveaUseCureOnSpock },
+ { {ACTION_FINISHED_WALKING, 99, 0, 0}, &Room::loveaSpockOrMccoyInPositionToUseCure },
+ { {ACTION_FINISHED_ANIMATION, 99, 0, 0}, &Room::loveaFinishedCuringSpock },
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::loveaTimer2Expired },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::loveaUseMTricorderOnSpock },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::loveaUseMTricorderOnHuman },
+ { {ACTION_USE, OBJECT_IRLG, -1, 0}, &Room::loveaUseRomulanLaughingGas },
+ { {ACTION_USE, OBJECT_IN2O, -1, 0}, &Room::loveaUseHumanLaughingGas },
+ { {ACTION_USE, OBJECT_INH3, -1, 0}, &Room::loveaUseAmmonia },
+ { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::loveaUseCommunicator },
// Common code (countdown for losing atmosphere when life support malfunctioning)
- { Action(ACTION_TICK, -1, -1, -1), &Room::muddaTick },
+ { {ACTION_TICK, -1, -1, -1}, &Room::muddaTick },
};
RoomAction mudd0ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::mudd0Tick1 },
- { Action(ACTION_TICK, 50, 0, 0), &Room::mudd0Tick50 },
- { Action(ACTION_TICK, 60, 0, 0), &Room::mudd0Tick60 },
- { Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::mudd0UsePhaserOnMudd },
- { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::mudd0UsePhaserOnMudd },
- { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd0UseCommunicator },
- { Action(ACTION_LOOK, 0x23, 0, 0), &Room::mudd0LookAtFoodBox },
- { Action(ACTION_LOOK, 0x24, 0, 0), &Room::mudd0LookAtComponentBox },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::mudd0LookAnywhere },
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd0LookAtMemoryDiskBox },
- { Action(ACTION_LOOK, 0x22, 0, 0), &Room::mudd0LookAtDegrimerBox },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::mudd0LookAtLense },
- { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::mudd0UseSTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::mudd0UseMTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::mudd0UseSTricorderOnMemoryDiskBox },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::mudd0UseSTricorderOnDegrimerBox },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::mudd0UseMTricorderOnLense },
+ { {ACTION_TICK, 1, 0, 0}, &Room::mudd0Tick1 },
+ { {ACTION_TICK, 50, 0, 0}, &Room::mudd0Tick50 },
+ { {ACTION_TICK, 60, 0, 0}, &Room::mudd0Tick60 },
+ { {ACTION_USE, OBJECT_IPHASERS, 8, 0}, &Room::mudd0UsePhaserOnMudd },
+ { {ACTION_USE, OBJECT_IPHASERK, 8, 0}, &Room::mudd0UsePhaserOnMudd },
+ { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::mudd0UseCommunicator },
+ { {ACTION_LOOK, 0x23, 0, 0}, &Room::mudd0LookAtFoodBox },
+ { {ACTION_LOOK, 0x24, 0, 0}, &Room::mudd0LookAtComponentBox },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::mudd0LookAnywhere },
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::mudd0LookAtMemoryDiskBox },
+ { {ACTION_LOOK, 0x22, 0, 0}, &Room::mudd0LookAtDegrimerBox },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::mudd0LookAtLense },
+ { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::mudd0UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::mudd0UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::mudd0UseSTricorderOnMemoryDiskBox },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x22, 0}, &Room::mudd0UseSTricorderOnDegrimerBox },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0x21, 0}, &Room::mudd0UseMTricorderOnLense },
// Common code (next 4 lines)
- { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::muddaUseLenseOnDegrimer },
- { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::muddaUseAlienDevice },
- { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::muddaFiredAlienDevice },
- { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::muddaUseDegrimer },
-
- { Action(ACTION_GET, 0x21, 0, 0), &Room::mudd0GetLense },
- { Action(ACTION_GET, 0x20, 0, 0), &Room::mudd0GetMemoryDisk },
- { Action(ACTION_GET, 0x22, 0, 0), &Room::mudd0GetDegrimer },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd0PickedUpLense },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::mudd0PickedUpItem },
- { Action(ACTION_WALK, 0x26, 0, 0), &Room::mudd0WalkToSouthDoor },
- { Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::mudd0TouchedHotspot1 },
- { Action(ACTION_WALK, 0x25, 0, 0), &Room::mudd0WalkToNorthDoor },
- { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd0TouchedHotspot0 },
- { Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd0UseMedkit },
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd0LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd0LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd0LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd0LookAtRedshirt },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::mudd0LookAtMudd },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd0TalkToKirk },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd0TalkToSpock },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd0TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd0TalkToRedshirt },
- { Action(ACTION_TALK, 8, 0, 0), &Room::mudd0TalkToMudd },
+ { {ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0}, &Room::muddaUseLenseOnDegrimer },
+ { {ACTION_USE, OBJECT_IALIENDV, -1, 0}, &Room::muddaUseAlienDevice },
+ { {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::muddaFiredAlienDevice },
+ { {ACTION_USE, OBJECT_IDEGRIME, -1, 0}, &Room::muddaUseDegrimer },
+
+ { {ACTION_GET, 0x21, 0, 0}, &Room::mudd0GetLense },
+ { {ACTION_GET, 0x20, 0, 0}, &Room::mudd0GetMemoryDisk },
+ { {ACTION_GET, 0x22, 0, 0}, &Room::mudd0GetDegrimer },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::mudd0PickedUpLense },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::mudd0PickedUpItem },
+ { {ACTION_WALK, 0x26, 0, 0}, &Room::mudd0WalkToSouthDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 1, 0, 0}, &Room::mudd0TouchedHotspot1 },
+ { {ACTION_WALK, 0x25, 0, 0}, &Room::mudd0WalkToNorthDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::mudd0TouchedHotspot0 },
+ { {ACTION_USE, OBJECT_IMEDKIT, -1, 0}, &Room::mudd0UseMedkit },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::mudd0LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::mudd0LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::mudd0LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::mudd0LookAtRedshirt },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::mudd0LookAtMudd },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::mudd0TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::mudd0TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::mudd0TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::mudd0TalkToRedshirt },
+ { {ACTION_TALK, 8, 0, 0}, &Room::mudd0TalkToMudd },
// Common code (countdown for losing atmosphere when life support malfunctioning)
- { Action(ACTION_TICK, -1, -1, -1), &Room::muddaTick },
+ { {ACTION_TICK, -1, -1, -1}, &Room::muddaTick },
};
RoomAction mudd1ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::mudd1Tick1 },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd1Timer1Expired },
-
- { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd1UseCommunicator },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x23, 0), &Room::mudd1UseSpockOnBlueButton },
- { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::mudd1SpockReachedBlueButton },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::mudd1SpockPressedBlueButton },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::mudd1CraneFinishedMoving },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x24, 0), &Room::mudd1UseSpockOnYellowButton },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::mudd1SpockReachedYellowButton },
- { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::mudd1SpockPressedYellowButton },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x25, 0), &Room::mudd1UseSpockOnRedButton },
- { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::mudd1SpockReachedRedButton },
- { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::mudd1SpockPressedRedButton },
+ { {ACTION_TICK, 1, 0, 0}, &Room::mudd1Tick1 },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::mudd1Timer1Expired },
+
+ { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::mudd1UseCommunicator },
+ { {ACTION_USE, OBJECT_SPOCK, 0x23, 0}, &Room::mudd1UseSpockOnBlueButton },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::mudd1SpockReachedBlueButton },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::mudd1SpockPressedBlueButton },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::mudd1CraneFinishedMoving },
+ { {ACTION_USE, OBJECT_SPOCK, 0x24, 0}, &Room::mudd1UseSpockOnYellowButton },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::mudd1SpockReachedYellowButton },
+ { {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::mudd1SpockPressedYellowButton },
+ { {ACTION_USE, OBJECT_SPOCK, 0x25, 0}, &Room::mudd1UseSpockOnRedButton },
+ { {ACTION_FINISHED_WALKING, 3, 0, 0}, &Room::mudd1SpockReachedRedButton },
+ { {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::mudd1SpockPressedRedButton },
// Common code (next 4 lines)
- { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::muddaUseDegrimer },
- { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::muddaUseLenseOnDegrimer },
- { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::muddaUseAlienDevice },
- { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::muddaFiredAlienDevice },
-
- { Action(ACTION_GET, 9, 0, 0), &Room::mudd1GetTorpedo },
- { Action(ACTION_GET, 0x21, 0, 0), &Room::mudd1GetTorpedo },
- { Action(ACTION_GET, 0x20, 0, 0), &Room::mudd1GetTorpedo },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::mudd1UseSTricorderOnTorpedo },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 9, 0), &Room::mudd1UseSTricorderOnTorpedo },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::mudd1UseSTricorderOnTorpedo },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::mudd1UseSTricorderOnTorpedoLauncher },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x25, 0), &Room::mudd1UseSTricorderOnButton },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::mudd1UseSTricorderOnButton },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x24, 0), &Room::mudd1UseSTricorderOnButton },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::mudd1UseSTricorderOnCrane },
- { Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd1UseMedkitAnywhere },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::mudd1LookAnywhere },
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd1LookAtTorpedo },
- { Action(ACTION_LOOK, 9, 0, 0), &Room::mudd1LookAtTorpedo },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::mudd1LookAtFallenTorpedo },
- { Action(ACTION_LOOK, 0x22, 0, 0), &Room::mudd1LookAtTorpedoLauncher },
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd1LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd1LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd1LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd1LookAtRedshirt },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::mudd1LookAtCrane },
- { Action(ACTION_LOOK, 0x25, 0, 0), &Room::mudd1LookAtRedButton },
- { Action(ACTION_LOOK, 0x23, 0, 0), &Room::mudd1LookAtBlueButton },
- { Action(ACTION_LOOK, 0x24, 0, 0), &Room::mudd1LookAtYellowButton },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd1TalkToKirk },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd1TalkToSpock },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd1TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd1TalkToRedshirt },
- { Action(ACTION_WALK, 0x28, 0, 0), &Room::mudd1WalkToSouthDoor },
- { Action(ACTION_TOUCHED_HOTSPOT, 2, 0, 0), &Room::mudd1TouchedHotspot2 },
- { Action(ACTION_WALK, 0x27, 0, 0), &Room::mudd1WalkToNorthDoor },
- { Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::mudd1TouchedHotspot1 },
- { Action(ACTION_WALK, 0x26, 0, 0), &Room::mudd1WalkToWestDoor },
- { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd1TouchedHotspot0 },
+ { {ACTION_USE, OBJECT_IDEGRIME, -1, 0}, &Room::muddaUseDegrimer },
+ { {ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0}, &Room::muddaUseLenseOnDegrimer },
+ { {ACTION_USE, OBJECT_IALIENDV, -1, 0}, &Room::muddaUseAlienDevice },
+ { {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::muddaFiredAlienDevice },
+
+ { {ACTION_GET, 9, 0, 0}, &Room::mudd1GetTorpedo },
+ { {ACTION_GET, 0x21, 0, 0}, &Room::mudd1GetTorpedo },
+ { {ACTION_GET, 0x20, 0, 0}, &Room::mudd1GetTorpedo },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::mudd1UseSTricorderOnTorpedo },
+ { {ACTION_USE, OBJECT_ISTRICOR, 9, 0}, &Room::mudd1UseSTricorderOnTorpedo },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::mudd1UseSTricorderOnTorpedo },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x22, 0}, &Room::mudd1UseSTricorderOnTorpedoLauncher },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x25, 0}, &Room::mudd1UseSTricorderOnButton },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x23, 0}, &Room::mudd1UseSTricorderOnButton },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x24, 0}, &Room::mudd1UseSTricorderOnButton },
+ { {ACTION_USE, OBJECT_ISTRICOR, 8, 0}, &Room::mudd1UseSTricorderOnCrane },
+ { {ACTION_USE, OBJECT_IMEDKIT, -1, 0}, &Room::mudd1UseMedkitAnywhere },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::mudd1LookAnywhere },
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::mudd1LookAtTorpedo },
+ { {ACTION_LOOK, 9, 0, 0}, &Room::mudd1LookAtTorpedo },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::mudd1LookAtFallenTorpedo },
+ { {ACTION_LOOK, 0x22, 0, 0}, &Room::mudd1LookAtTorpedoLauncher },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::mudd1LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::mudd1LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::mudd1LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::mudd1LookAtRedshirt },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::mudd1LookAtCrane },
+ { {ACTION_LOOK, 0x25, 0, 0}, &Room::mudd1LookAtRedButton },
+ { {ACTION_LOOK, 0x23, 0, 0}, &Room::mudd1LookAtBlueButton },
+ { {ACTION_LOOK, 0x24, 0, 0}, &Room::mudd1LookAtYellowButton },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::mudd1TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::mudd1TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::mudd1TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::mudd1TalkToRedshirt },
+ { {ACTION_WALK, 0x28, 0, 0}, &Room::mudd1WalkToSouthDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 2, 0, 0}, &Room::mudd1TouchedHotspot2 },
+ { {ACTION_WALK, 0x27, 0, 0}, &Room::mudd1WalkToNorthDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 1, 0, 0}, &Room::mudd1TouchedHotspot1 },
+ { {ACTION_WALK, 0x26, 0, 0}, &Room::mudd1WalkToWestDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::mudd1TouchedHotspot0 },
// Common code (countdown for losing atmosphere when life support malfunctioning)
- { Action(ACTION_TICK, -1, -1, -1), &Room::muddaTick },
+ { {ACTION_TICK, -1, -1, -1}, &Room::muddaTick },
};
RoomAction mudd2ActionList[] = {
- { Action(ACTION_WALK, 0x21, 0, 0), &Room::mudd2WalkToNorthDoor },
- { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd2TouchedHotspot0 },
- { Action(ACTION_WALK, 0x22, 0, 0), &Room::mudd2WalkToSouthDoor },
- { Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::mudd2TouchedHotspot1 },
- { Action(ACTION_TICK, 1, 0, 0), &Room::mudd2Tick1 },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd2Timer1Expired },
- { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::mudd2UseSTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::mudd2UseSpockOnCapsules },
- { Action(ACTION_GET, 0x20, 0, 0), &Room::mudd2GetCapsules },
- { Action(ACTION_FINISHED_WALKING, 12, 0, 0), &Room::mudd2MccoyReachedCapsules },
- { Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::mudd2MccoyPickedUpCapsules },
- { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd2UseCommunicator },
+ { {ACTION_WALK, 0x21, 0, 0}, &Room::mudd2WalkToNorthDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::mudd2TouchedHotspot0 },
+ { {ACTION_WALK, 0x22, 0, 0}, &Room::mudd2WalkToSouthDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 1, 0, 0}, &Room::mudd2TouchedHotspot1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::mudd2Tick1 },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::mudd2Timer1Expired },
+ { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::mudd2UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_SPOCK, 0x20, 0}, &Room::mudd2UseSpockOnCapsules },
+ { {ACTION_GET, 0x20, 0, 0}, &Room::mudd2GetCapsules },
+ { {ACTION_FINISHED_WALKING, 12, 0, 0}, &Room::mudd2MccoyReachedCapsules },
+ { {ACTION_FINISHED_ANIMATION, 13, 0, 0}, &Room::mudd2MccoyPickedUpCapsules },
+ { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::mudd2UseCommunicator },
// Common code (next 4 lines)
- { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::muddaUseDegrimer },
- { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::muddaUseLenseOnDegrimer },
- { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::muddaUseAlienDevice },
- { Action(ACTION_FINISHED_ANIMATION, 18, 0, 0), &Room::muddaFiredAlienDevice },
-
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd2LookAtCapsules },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0x20, 0), &Room::mudd2UseMTricorderOnCapsules },
- { Action(ACTION_USE, OBJECT_ICAPSULE, 0x23, 0), &Room::mudd2UseCapsuleOnControlPanel },
- { Action(ACTION_FINISHED_WALKING, 15, 0, 0), &Room::mudd2MccoyReachedControlPanel },
- { Action(ACTION_FINISHED_ANIMATION, 15, 0, 0), &Room::mudd2MccoyPutCapsuleInControlPanel },
- { Action(ACTION_USE, OBJECT_KIRK, 0x24, 0), &Room::mudd2UseKirkOnBed },
- { Action(ACTION_USE, OBJECT_KIRK, 0x25, 0), &Room::mudd2UseKirkOnBed },
- { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::mudd2KirkReachedBed },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::mudd2MuddNoticedKirk },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::mudd2MuddDroppedCapsule },
- { Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::mudd2UsePhaserOnMudd },
- { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::mudd2UsePhaserOnMudd },
-
- { Action(ACTION_USE, OBJECT_SPOCK, 8, 0), &Room::mudd2UseSpockOnMudd },
- { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::mudd2SpockReachedMudd },
- { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::mudd2SpockPinchedMudd },
- { Action(ACTION_USE, OBJECT_KIRK, 8, 0), &Room::mudd2UseKirkOnMudd },
-
- { Action(ACTION_USE, OBJECT_REDSHIRT, 8, 0), &Room::mudd2UseRedshirtOnMudd },
- { Action(ACTION_FINISHED_WALKING, 16, 0, 0), &Room::mudd2RedshirtReachedMudd },
- { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::mudd2Timer2Expired },
- { Action(ACTION_FINISHED_ANIMATION, 17, 0, 0), &Room::mudd2MuddFinishedPushingRedshirt },
- { Action(ACTION_FINISHED_ANIMATION, 16, 0, 0), &Room::mudd2RedshirtPushedAway },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::mudd2UseMTricorderOnMudd },
- { Action(ACTION_USE, OBJECT_IMEDKIT, 8, 0), &Room::mudd2UseMedkitOnMudd },
- { Action(ACTION_USE, OBJECT_MCCOY, 8, 0), &Room::mudd2UseMedkitOnMudd },
- { Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::mudd2MccoyReachedMudd },
- { Action(ACTION_FINISHED_ANIMATION, 11, 0, 0), &Room::mudd2MccoyCuredMudd },
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd2LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd2LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd2LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd2LookAtRedshirt },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::mudd2LookAtMudd },
- { Action(ACTION_LOOK, 0x23, 0, 0), &Room::mudd2LookAtControlPanel },
- { Action(ACTION_LOOK, 0x25, 0, 0), &Room::mudd2LookAtBed },
- { Action(ACTION_LOOK, 0x24, 0, 0), &Room::mudd2LookAtBed },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd2TalkToKirk },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd2TalkToSpock },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd2TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd2TalkToRedshirt },
- { Action(ACTION_TALK, 8, 0, 0), &Room::mudd2TalkToMudd },
+ { {ACTION_USE, OBJECT_IDEGRIME, -1, 0}, &Room::muddaUseDegrimer },
+ { {ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0}, &Room::muddaUseLenseOnDegrimer },
+ { {ACTION_USE, OBJECT_IALIENDV, -1, 0}, &Room::muddaUseAlienDevice },
+ { {ACTION_FINISHED_ANIMATION, 18, 0, 0}, &Room::muddaFiredAlienDevice },
+
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::mudd2LookAtCapsules },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0x20, 0}, &Room::mudd2UseMTricorderOnCapsules },
+ { {ACTION_USE, OBJECT_ICAPSULE, 0x23, 0}, &Room::mudd2UseCapsuleOnControlPanel },
+ { {ACTION_FINISHED_WALKING, 15, 0, 0}, &Room::mudd2MccoyReachedControlPanel },
+ { {ACTION_FINISHED_ANIMATION, 15, 0, 0}, &Room::mudd2MccoyPutCapsuleInControlPanel },
+ { {ACTION_USE, OBJECT_KIRK, 0x24, 0}, &Room::mudd2UseKirkOnBed },
+ { {ACTION_USE, OBJECT_KIRK, 0x25, 0}, &Room::mudd2UseKirkOnBed },
+ { {ACTION_FINISHED_WALKING, 6, 0, 0}, &Room::mudd2KirkReachedBed },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::mudd2MuddNoticedKirk },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::mudd2MuddDroppedCapsule },
+ { {ACTION_USE, OBJECT_IPHASERS, 8, 0}, &Room::mudd2UsePhaserOnMudd },
+ { {ACTION_USE, OBJECT_IPHASERK, 8, 0}, &Room::mudd2UsePhaserOnMudd },
+
+ { {ACTION_USE, OBJECT_SPOCK, 8, 0}, &Room::mudd2UseSpockOnMudd },
+ { {ACTION_FINISHED_WALKING, 4, 0, 0}, &Room::mudd2SpockReachedMudd },
+ { {ACTION_FINISHED_ANIMATION, 5, 0, 0}, &Room::mudd2SpockPinchedMudd },
+ { {ACTION_USE, OBJECT_KIRK, 8, 0}, &Room::mudd2UseKirkOnMudd },
+
+ { {ACTION_USE, OBJECT_REDSHIRT, 8, 0}, &Room::mudd2UseRedshirtOnMudd },
+ { {ACTION_FINISHED_WALKING, 16, 0, 0}, &Room::mudd2RedshirtReachedMudd },
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::mudd2Timer2Expired },
+ { {ACTION_FINISHED_ANIMATION, 17, 0, 0}, &Room::mudd2MuddFinishedPushingRedshirt },
+ { {ACTION_FINISHED_ANIMATION, 16, 0, 0}, &Room::mudd2RedshirtPushedAway },
+ { {ACTION_USE, OBJECT_IMTRICOR, 8, 0}, &Room::mudd2UseMTricorderOnMudd },
+ { {ACTION_USE, OBJECT_IMEDKIT, 8, 0}, &Room::mudd2UseMedkitOnMudd },
+ { {ACTION_USE, OBJECT_MCCOY, 8, 0}, &Room::mudd2UseMedkitOnMudd },
+ { {ACTION_FINISHED_WALKING, 10, 0, 0}, &Room::mudd2MccoyReachedMudd },
+ { {ACTION_FINISHED_ANIMATION, 11, 0, 0}, &Room::mudd2MccoyCuredMudd },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::mudd2LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::mudd2LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::mudd2LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::mudd2LookAtRedshirt },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::mudd2LookAtMudd },
+ { {ACTION_LOOK, 0x23, 0, 0}, &Room::mudd2LookAtControlPanel },
+ { {ACTION_LOOK, 0x25, 0, 0}, &Room::mudd2LookAtBed },
+ { {ACTION_LOOK, 0x24, 0, 0}, &Room::mudd2LookAtBed },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::mudd2TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::mudd2TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::mudd2TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::mudd2TalkToRedshirt },
+ { {ACTION_TALK, 8, 0, 0}, &Room::mudd2TalkToMudd },
// Common code (countdown for losing atmosphere when life support malfunctioning)
- { Action(ACTION_TICK, -1, -1, -1), &Room::muddaTick },
+ { {ACTION_TICK, -1, -1, -1}, &Room::muddaTick },
};
RoomAction mudd3ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::mudd3Tick1 },
- { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd3UseCommunicator },
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd3LookAtScreen },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::mudd3UseSTricorderOnScreen },
- { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::mudd3UseKirkOnScreen },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x21, 0), &Room::mudd3UseSpockOnSphere },
- { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::mudd3Timer3Expired },
- { Action(ACTION_USE, OBJECT_MCCOY, 0x21, 0), &Room::mudd3UseMccoyOnSphere },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x21, 0), &Room::mudd3UseRedshirtOnSphere },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::mudd3UseMTricorderOnSphere },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::mudd3UseSTricorderOnSphere },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::mudd3ReadyToHookUpTricorders },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd3Timer1Expired },
- { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::mudd3Timer2Expired },
- { Action(ACTION_TIMER_EXPIRED, 4, 0, 0), &Room::mudd3Timer4Expired },
- { Action(ACTION_USE, OBJECT_IDISKS, 0x21, 0), &Room::mudd3UseMemoryDiskOnSphere },
+ { {ACTION_TICK, 1, 0, 0}, &Room::mudd3Tick1 },
+ { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::mudd3UseCommunicator },
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::mudd3LookAtScreen },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::mudd3UseSTricorderOnScreen },
+ { {ACTION_USE, OBJECT_KIRK, 0x20, 0}, &Room::mudd3UseKirkOnScreen },
+ { {ACTION_USE, OBJECT_SPOCK, 0x21, 0}, &Room::mudd3UseSpockOnSphere },
+ { {ACTION_TIMER_EXPIRED, 3, 0, 0}, &Room::mudd3Timer3Expired },
+ { {ACTION_USE, OBJECT_MCCOY, 0x21, 0}, &Room::mudd3UseMccoyOnSphere },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x21, 0}, &Room::mudd3UseRedshirtOnSphere },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0x21, 0}, &Room::mudd3UseMTricorderOnSphere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::mudd3UseSTricorderOnSphere },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::mudd3ReadyToHookUpTricorders },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::mudd3Timer1Expired },
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::mudd3Timer2Expired },
+ { {ACTION_TIMER_EXPIRED, 4, 0, 0}, &Room::mudd3Timer4Expired },
+ { {ACTION_USE, OBJECT_IDISKS, 0x21, 0}, &Room::mudd3UseMemoryDiskOnSphere },
// Common code (next 4 lines)
- { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::muddaUseDegrimer },
- { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::muddaUseLenseOnDegrimer },
- { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::muddaUseAlienDevice },
- { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::muddaFiredAlienDevice },
-
- { Action(ACTION_GET, 13, 0, 0), &Room::mudd3GetRepairTool },
- { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::mudd3ReachedRepairTool },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::mudd3PickedUpRepairTool },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::mudd3LookAtSphere },
- { Action(ACTION_WALK, 0x22, 0, 0), &Room::mudd3WalkToNorthDoor },
- { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd3TouchedHotspot0 },
- { Action(ACTION_WALK, 0x23, 0, 0), &Room::mudd3WalkToEastDoor },
- { Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::mudd3TouchedHotspot1 },
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd3LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd3LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd3LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd3LookAtRedshirt },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::mudd3LookAtMudd },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd3TalkToKirk },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd3TalkToSpock },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd3TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd3TalkToRedshirt },
- { Action(ACTION_TALK, 8, 0, 0), &Room::mudd3TalkToMudd },
- { Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd3UseMedkit },
+ { {ACTION_USE, OBJECT_IDEGRIME, -1, 0}, &Room::muddaUseDegrimer },
+ { {ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0}, &Room::muddaUseLenseOnDegrimer },
+ { {ACTION_USE, OBJECT_IALIENDV, -1, 0}, &Room::muddaUseAlienDevice },
+ { {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::muddaFiredAlienDevice },
+
+ { {ACTION_GET, 13, 0, 0}, &Room::mudd3GetRepairTool },
+ { {ACTION_FINISHED_WALKING, 3, 0, 0}, &Room::mudd3ReachedRepairTool },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::mudd3PickedUpRepairTool },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::mudd3LookAtSphere },
+ { {ACTION_WALK, 0x22, 0, 0}, &Room::mudd3WalkToNorthDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::mudd3TouchedHotspot0 },
+ { {ACTION_WALK, 0x23, 0, 0}, &Room::mudd3WalkToEastDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 1, 0, 0}, &Room::mudd3TouchedHotspot1 },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::mudd3LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::mudd3LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::mudd3LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::mudd3LookAtRedshirt },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::mudd3LookAtMudd },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::mudd3TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::mudd3TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::mudd3TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::mudd3TalkToRedshirt },
+ { {ACTION_TALK, 8, 0, 0}, &Room::mudd3TalkToMudd },
+ { {ACTION_USE, OBJECT_IMEDKIT, -1, 0}, &Room::mudd3UseMedkit },
// Common code (countdown for losing atmosphere when life support malfunctioning)
- { Action(ACTION_TICK, -1, -1, -1), &Room::muddaTick },
+ { {ACTION_TICK, -1, -1, -1}, &Room::muddaTick },
};
RoomAction mudd4ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::mudd4Tick1 },
- { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd4UseCommunicator },
- { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::mudd4Timer2Expired },
- { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::mudd4Timer3Expired },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x21, 0), &Room::mudd4UseSpockOnLeftConsole },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x22, 0), &Room::mudd4UseSpockOnLeftConsole },
- { Action(ACTION_USE, OBJECT_SPOCK, 0x23, 0), &Room::mudd4UseSpockOnRightConsole },
- { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::mudd4SpockReachedChair },
- { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::mudd4SpockSatInChair },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::mudd4SpockUsedSensors },
- { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::mudd4SpockUsedEngineering },
- { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::mudd4SpockUsedNavigation },
- { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::mudd4FinishedWalking3 },
- { Action(ACTION_USE, OBJECT_KIRK, 0x21, 0), &Room::mudd4UseKirkOnRightConsole },
- { Action(ACTION_USE, OBJECT_KIRK, 0x23, 0), &Room::mudd4UseKirkOnRightConsole },
- { Action(ACTION_USE, OBJECT_KIRK, 0x22, 0), &Room::mudd4UseKirkOnLeftConsole },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::mudd4KirkReachedRightConsole },
- { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::mudd4KirkSatInChair },
- { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::mudd4KirkUsedViewScreen },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd4Timer1Expired },
- { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::mudd4KirkUsedCommunications },
- { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::mudd4KirkReachedPositionToTalkToMudd },
- { Action(ACTION_USE, OBJECT_MCCOY, 0x21, 0), &Room::mudd4UseMccoyOnConsole },
- { Action(ACTION_USE, OBJECT_MCCOY, 0x22, 0), &Room::mudd4UseMccoyOnConsole },
- { Action(ACTION_USE, OBJECT_MCCOY, 0x23, 0), &Room::mudd4UseMccoyOnConsole },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x21, 0), &Room::mudd4UseRedshirtOnConsole },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x22, 0), &Room::mudd4UseRedshirtOnConsole },
- { Action(ACTION_USE, OBJECT_REDSHIRT, 0x23, 0), &Room::mudd4UseRedshirtOnConsole },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 10, 0), &Room::mudd4UseSTricorderOnRepairTool },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::mudd4UseSTricorderOnConsole },
+ { {ACTION_TICK, 1, 0, 0}, &Room::mudd4Tick1 },
+ { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::mudd4UseCommunicator },
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::mudd4Timer2Expired },
+ { {ACTION_TIMER_EXPIRED, 3, 0, 0}, &Room::mudd4Timer3Expired },
+ { {ACTION_USE, OBJECT_SPOCK, 0x21, 0}, &Room::mudd4UseSpockOnLeftConsole },
+ { {ACTION_USE, OBJECT_SPOCK, 0x22, 0}, &Room::mudd4UseSpockOnLeftConsole },
+ { {ACTION_USE, OBJECT_SPOCK, 0x23, 0}, &Room::mudd4UseSpockOnRightConsole },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::mudd4SpockReachedChair },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::mudd4SpockSatInChair },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::mudd4SpockUsedSensors },
+ { {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::mudd4SpockUsedEngineering },
+ { {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::mudd4SpockUsedNavigation },
+ { {ACTION_FINISHED_WALKING, 3, 0, 0}, &Room::mudd4FinishedWalking3 },
+ { {ACTION_USE, OBJECT_KIRK, 0x21, 0}, &Room::mudd4UseKirkOnRightConsole },
+ { {ACTION_USE, OBJECT_KIRK, 0x23, 0}, &Room::mudd4UseKirkOnRightConsole },
+ { {ACTION_USE, OBJECT_KIRK, 0x22, 0}, &Room::mudd4UseKirkOnLeftConsole },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::mudd4KirkReachedRightConsole },
+ { {ACTION_FINISHED_ANIMATION, 5, 0, 0}, &Room::mudd4KirkSatInChair },
+ { {ACTION_FINISHED_ANIMATION, 6, 0, 0}, &Room::mudd4KirkUsedViewScreen },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::mudd4Timer1Expired },
+ { {ACTION_FINISHED_ANIMATION, 7, 0, 0}, &Room::mudd4KirkUsedCommunications },
+ { {ACTION_FINISHED_WALKING, 4, 0, 0}, &Room::mudd4KirkReachedPositionToTalkToMudd },
+ { {ACTION_USE, OBJECT_MCCOY, 0x21, 0}, &Room::mudd4UseMccoyOnConsole },
+ { {ACTION_USE, OBJECT_MCCOY, 0x22, 0}, &Room::mudd4UseMccoyOnConsole },
+ { {ACTION_USE, OBJECT_MCCOY, 0x23, 0}, &Room::mudd4UseMccoyOnConsole },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x21, 0}, &Room::mudd4UseRedshirtOnConsole },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x22, 0}, &Room::mudd4UseRedshirtOnConsole },
+ { {ACTION_USE, OBJECT_REDSHIRT, 0x23, 0}, &Room::mudd4UseRedshirtOnConsole },
+ { {ACTION_USE, OBJECT_ISTRICOR, 10, 0}, &Room::mudd4UseSTricorderOnRepairTool },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::mudd4UseSTricorderOnConsole },
// ENHANCEMENT: Allow scanning the console to work when scanning the specific stations
// as well
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::mudd4UseSTricorderOnConsole },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::mudd4UseSTricorderOnConsole },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x22, 0}, &Room::mudd4UseSTricorderOnConsole },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x23, 0}, &Room::mudd4UseSTricorderOnConsole },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::mudd4UseSTricorderOnViewscreen },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::mudd4UseSTricorderOnViewscreen },
// ENHANCEMENT: Allow scanning the viewscreen when it's on, not just when off
- { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::mudd4UseSTricorderOnViewscreen },
+ { {ACTION_USE, OBJECT_ISTRICOR, 8, 0}, &Room::mudd4UseSTricorderOnViewscreen },
// Common code (next 4 lines)
- { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::muddaUseLenseOnDegrimer },
- { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::muddaUseAlienDevice },
- { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::muddaFiredAlienDevice },
- { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::muddaUseDegrimer },
+ { {ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0}, &Room::muddaUseLenseOnDegrimer },
+ { {ACTION_USE, OBJECT_IALIENDV, -1, 0}, &Room::muddaUseAlienDevice },
+ { {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::muddaFiredAlienDevice },
+ { {ACTION_USE, OBJECT_IDEGRIME, -1, 0}, &Room::muddaUseDegrimer },
- { Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd4UseMedkit },
- { Action(ACTION_GET, 10, 0, 0), &Room::mudd4GetRepairTool },
- { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::mudd4ReachedRepairTool },
- { Action(ACTION_FINISHED_ANIMATION, 10, 0, 0), &Room::mudd4PickedUpRepairTool },
+ { {ACTION_USE, OBJECT_IMEDKIT, -1, 0}, &Room::mudd4UseMedkit },
+ { {ACTION_GET, 10, 0, 0}, &Room::mudd4GetRepairTool },
+ { {ACTION_FINISHED_WALKING, 5, 0, 0}, &Room::mudd4ReachedRepairTool },
+ { {ACTION_FINISHED_ANIMATION, 10, 0, 0}, &Room::mudd4PickedUpRepairTool },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::mudd4LookAtConsole },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::mudd4LookAtConsole },
// ENHANCEMENT: Allow look action work with the specific stations as well
- { Action(ACTION_LOOK, 0x22, 0, 0), &Room::mudd4LookAtConsole },
- { Action(ACTION_LOOK, 0x23, 0, 0), &Room::mudd4LookAtConsole },
+ { {ACTION_LOOK, 0x22, 0, 0}, &Room::mudd4LookAtConsole },
+ { {ACTION_LOOK, 0x23, 0, 0}, &Room::mudd4LookAtConsole },
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd4LookAtViewscreen },
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::mudd4LookAtViewscreen },
// ENHANCEMENT: Allow look action work when viewscreen is on, not just when off
- { Action(ACTION_LOOK, 8, 0, 0), &Room::mudd4LookAtViewscreen },
-
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd4LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd4LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd4LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd4LookAtRedshirt },
- { Action(ACTION_LOOK, 10, 0, 0), &Room::mudd4LookAtRepairTool },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd4TalkToKirk },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd4TalkToSpock },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd4TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd4TalkToRedshirt },
- { Action(ACTION_WALK, 0x24, 0, 0), &Room::mudd4WalkToEastDoor },
- { Action(ACTION_WALK, 0x25, 0, 0), &Room::mudd4WalkToWestDoor },
- { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd4TouchedHotspot0 },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::mudd4LookAtViewscreen },
+
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::mudd4LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::mudd4LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::mudd4LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::mudd4LookAtRedshirt },
+ { {ACTION_LOOK, 10, 0, 0}, &Room::mudd4LookAtRepairTool },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::mudd4TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::mudd4TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::mudd4TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::mudd4TalkToRedshirt },
+ { {ACTION_WALK, 0x24, 0, 0}, &Room::mudd4WalkToEastDoor },
+ { {ACTION_WALK, 0x25, 0, 0}, &Room::mudd4WalkToWestDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::mudd4TouchedHotspot0 },
// Common code (countdown for losing atmosphere when life support malfunctioning)
- { Action(ACTION_TICK, -1, -1, -1), &Room::muddaTick },
+ { {ACTION_TICK, -1, -1, -1}, &Room::muddaTick },
};
RoomAction mudd5ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::mudd5Tick1 },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd5Timer1Expired },
- { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::mudd5Timer2Expired },
- { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd5UseCommunicator },
- { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::mudd5UseSTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::mudd5UseSTricorderOnEngine },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::mudd5UseSTricorderOnCrane },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::mudd5UseSTricorderOnHatch },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 9, 0), &Room::mudd5UseSTricorderOnLifeSupportGenerator },
- { Action(ACTION_USE, OBJECT_IPHASERS, 0x20, 0), &Room::mudd5UseStunPhaserOnHatch },
- { Action(ACTION_USE, OBJECT_IPHASERK, 0x20, 0), &Room::mudd5UseKillPhaserOnHatch },
- { Action(ACTION_USE, -1, 9, 0), &Room::mudd5UseAnythingOnLifeSupportGenerator },
- { Action(ACTION_USE, OBJECT_IDOOVER, 9, 0), &Room::mudd5UseDooverOnLifeSupportGenerator },
- { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::mudd5KirkReachedLifeSupportGenerator },
- { Action(ACTION_TIMER_EXPIRED, 4, 0, 0), &Room::mudd5KirkTimer4Expired },
- { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::mudd5KirkRepairedLifeSupportGenerator },
- { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::mudd5KirkTimer3Expired },
+ { {ACTION_TICK, 1, 0, 0}, &Room::mudd5Tick1 },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::mudd5Timer1Expired },
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::mudd5Timer2Expired },
+ { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::mudd5UseCommunicator },
+ { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::mudd5UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::mudd5UseSTricorderOnEngine },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x22, 0}, &Room::mudd5UseSTricorderOnCrane },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::mudd5UseSTricorderOnHatch },
+ { {ACTION_USE, OBJECT_ISTRICOR, 9, 0}, &Room::mudd5UseSTricorderOnLifeSupportGenerator },
+ { {ACTION_USE, OBJECT_IPHASERS, 0x20, 0}, &Room::mudd5UseStunPhaserOnHatch },
+ { {ACTION_USE, OBJECT_IPHASERK, 0x20, 0}, &Room::mudd5UseKillPhaserOnHatch },
+ { {ACTION_USE, -1, 9, 0}, &Room::mudd5UseAnythingOnLifeSupportGenerator },
+ { {ACTION_USE, OBJECT_IDOOVER, 9, 0}, &Room::mudd5UseDooverOnLifeSupportGenerator },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::mudd5KirkReachedLifeSupportGenerator },
+ { {ACTION_TIMER_EXPIRED, 4, 0, 0}, &Room::mudd5KirkTimer4Expired },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::mudd5KirkRepairedLifeSupportGenerator },
+ { {ACTION_TIMER_EXPIRED, 3, 0, 0}, &Room::mudd5KirkTimer3Expired },
// Common code (next 4 lines)
- { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::muddaUseLenseOnDegrimer },
- { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::muddaUseAlienDevice },
- { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::muddaFiredAlienDevice },
- { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::muddaUseDegrimer },
-
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd5LookAtHatch },
- { Action(ACTION_LOOK, 9, 0, 0), &Room::mudd5LookAtLifeSupportGenerator },
- { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd5TouchedHotspot0 },
- { Action(ACTION_WALK, 0x22, 0, 0), &Room::mudd5WalkToDoor },
- { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd5LookAtKirk },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd5LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd5LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd5LookAtRedshirt },
- { Action(ACTION_LOOK, 0x22, 0, 0), &Room::mudd5LookAtDoor },
- { Action(ACTION_LOOK, 0x23, 0, 0), &Room::mudd5LookAtCrane },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::mudd5LookAtEngine },
- { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd5TalkToKirk },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd5TalkToSpock },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd5TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd5TalkToRedshirt },
- { Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd5UseMedkit },
+ { {ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0}, &Room::muddaUseLenseOnDegrimer },
+ { {ACTION_USE, OBJECT_IALIENDV, -1, 0}, &Room::muddaUseAlienDevice },
+ { {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::muddaFiredAlienDevice },
+ { {ACTION_USE, OBJECT_IDEGRIME, -1, 0}, &Room::muddaUseDegrimer },
+
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::mudd5LookAtHatch },
+ { {ACTION_LOOK, 9, 0, 0}, &Room::mudd5LookAtLifeSupportGenerator },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::mudd5TouchedHotspot0 },
+ { {ACTION_WALK, 0x22, 0, 0}, &Room::mudd5WalkToDoor },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::mudd5LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::mudd5LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::mudd5LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::mudd5LookAtRedshirt },
+ { {ACTION_LOOK, 0x22, 0, 0}, &Room::mudd5LookAtDoor },
+ { {ACTION_LOOK, 0x23, 0, 0}, &Room::mudd5LookAtCrane },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::mudd5LookAtEngine },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::mudd5TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::mudd5TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::mudd5TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::mudd5TalkToRedshirt },
+ { {ACTION_USE, OBJECT_IMEDKIT, -1, 0}, &Room::mudd5UseMedkit },
// Common code (countdown for losing atmosphere when life support malfunctioning)
- { Action(ACTION_TICK, -1, -1, -1), &Room::muddaTick },
+ { {ACTION_TICK, -1, -1, -1}, &Room::muddaTick },
};
RoomAction feather0ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::feather0Tick1 },
- { Action(ACTION_TICK, 60, 0, 0), &Room::feather0Tick60 },
- { Action(ACTION_TALK, 8, 0, 0), &Room::feather0TalkToQuetzecoatl },
- { Action(ACTION_TIMER_EXPIRED, 0, 0, 0), &Room::feather0Timer0Expired },
- { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::feather0Timer1Expired },
- { Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::feather0UsePhaserOnQuetzecoatl },
- { Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::feather0UsePhaserOnQuetzecoatl },
- { Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_MCCOY, 0), &Room::feather0UsePhaserOnMccoy },
- { Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_MCCOY, 0), &Room::feather0UsePhaserOnMccoy },
- { Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::feather0UseMedkit },
- { Action(ACTION_LOOK, 8, 0, 0), &Room::feather0LookAtQuetzecoatl },
- { Action(ACTION_LOOK, 0x20, 0, 0), &Room::feather0LookAtMoon },
- { Action(ACTION_LOOK, 0x21, 0, 0), &Room::feather0LookAtLog },
- { Action(ACTION_LOOK, 0x22, 0, 0), &Room::feather0LookAtHut },
- { Action(ACTION_LOOK, -1, 0, 0), &Room::feather0LookAnywhere },
- { Action(ACTION_LOOK, 0x23, 0, 0), &Room::feather0LookAtEyes },
- { Action(ACTION_LOOK, 0x24, 0, 0), &Room::feather0LookAtEyes },
- { Action(ACTION_LOOK, 0x25, 0, 0), &Room::feather0LookAtEyes },
- { Action(ACTION_LOOK, 0x26, 0, 0), &Room::feather0LookAtEyes },
- { Action(ACTION_LOOK, 0x27, 0, 0), &Room::feather0LookAtEyes },
- { Action(ACTION_LOOK, 0x28, 0, 0), &Room::feather0LookAtEyes },
- { Action(ACTION_LOOK, 0x29, 0, 0), &Room::feather0LookAtEyes },
- { Action(ACTION_LOOK, 0x2a, 0, 0), &Room::feather0LookAtEyes },
- { Action(ACTION_LOOK, 0x2b, 0, 0), &Room::feather0LookAtEyes },
- { Action(ACTION_LOOK, 0x2c, 0, 0), &Room::feather0LookAtTree },
- { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::feather0LookAtMccoy },
- { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::feather0LookAtSpock },
- { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::feather0LookAtRedshirt },
- { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::feather0TalkToMccoy },
- { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::feather0TalkToSpock },
- { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::feather0TalkToRedshirt },
- { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::feather0UseSTricorderOnQuetzecoatl },
- { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::feather0UseSTricorderAnywhere },
- { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::feather0UseMTricorderOnQuetzecoatl },
+ { {ACTION_TICK, 1, 0, 0}, &Room::feather0Tick1 },
+ { {ACTION_TICK, 60, 0, 0}, &Room::feather0Tick60 },
+ { {ACTION_TALK, 8, 0, 0}, &Room::feather0TalkToQuetzecoatl },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::feather0Timer0Expired },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::feather0Timer1Expired },
+ { {ACTION_USE, OBJECT_IPHASERS, 8, 0}, &Room::feather0UsePhaserOnQuetzecoatl },
+ { {ACTION_USE, OBJECT_IPHASERK, 8, 0}, &Room::feather0UsePhaserOnQuetzecoatl },
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_MCCOY, 0}, &Room::feather0UsePhaserOnMccoy },
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_MCCOY, 0}, &Room::feather0UsePhaserOnMccoy },
+ { {ACTION_USE, OBJECT_IMEDKIT, -1, 0}, &Room::feather0UseMedkit },
+ { {ACTION_LOOK, 8, 0, 0}, &Room::feather0LookAtQuetzecoatl },
+ { {ACTION_LOOK, 0x20, 0, 0}, &Room::feather0LookAtMoon },
+ { {ACTION_LOOK, 0x21, 0, 0}, &Room::feather0LookAtLog },
+ { {ACTION_LOOK, 0x22, 0, 0}, &Room::feather0LookAtHut },
+ { {ACTION_LOOK, -1, 0, 0}, &Room::feather0LookAnywhere },
+ { {ACTION_LOOK, 0x23, 0, 0}, &Room::feather0LookAtEyes },
+ { {ACTION_LOOK, 0x24, 0, 0}, &Room::feather0LookAtEyes },
+ { {ACTION_LOOK, 0x25, 0, 0}, &Room::feather0LookAtEyes },
+ { {ACTION_LOOK, 0x26, 0, 0}, &Room::feather0LookAtEyes },
+ { {ACTION_LOOK, 0x27, 0, 0}, &Room::feather0LookAtEyes },
+ { {ACTION_LOOK, 0x28, 0, 0}, &Room::feather0LookAtEyes },
+ { {ACTION_LOOK, 0x29, 0, 0}, &Room::feather0LookAtEyes },
+ { {ACTION_LOOK, 0x2a, 0, 0}, &Room::feather0LookAtEyes },
+ { {ACTION_LOOK, 0x2b, 0, 0}, &Room::feather0LookAtEyes },
+ { {ACTION_LOOK, 0x2c, 0, 0}, &Room::feather0LookAtTree },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::feather0LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::feather0LookAtSpock },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::feather0LookAtRedshirt },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::feather0TalkToMccoy },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::feather0TalkToSpock },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::feather0TalkToRedshirt },
+ { {ACTION_USE, OBJECT_ISTRICOR, 8, 0}, &Room::feather0UseSTricorderOnQuetzecoatl },
+ { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::feather0UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, 8, 0}, &Room::feather0UseMTricorderOnQuetzecoatl },
};
extern const RoomAction feather1ActionList[];
extern const int feather1NumActions;
RoomAction feather2ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::feather2Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::feather2Tick1 },
};
RoomAction feather3ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::feather3Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::feather3Tick1 },
};
RoomAction feather4ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::feather4Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::feather4Tick1 },
};
RoomAction feather5ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::feather5Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::feather5Tick1 },
};
RoomAction feather6ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::feather6Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::feather6Tick1 },
};
RoomAction feather7ActionList[] = {
- { Action(ACTION_TICK, 1, 0, 0), &Room::feather7Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::feather7Tick1 },
};
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index db66401..876c1f6 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -459,7 +459,7 @@ void StarTrekEngine::updateActorAnimations() {
if (nextAnimFrame == actor->numAnimFrames - 1) {
actor->field62++;
if (actor->triggerActionWhenAnimFinished) {
- addAction(Action(ACTION_FINISHED_ANIMATION, actor->finishedAnimActionParam, 0, 0));
+ addAction(ACTION_FINISHED_ANIMATION, actor->finishedAnimActionParam, 0, 0);
}
}
}
@@ -530,7 +530,7 @@ void StarTrekEngine::updateActorAnimations() {
if (actor->iwSrcPosition == -1) {
if (actor->triggerActionWhenAnimFinished) {
actor->triggerActionWhenAnimFinished = false;
- addAction(Action(ACTION_FINISHED_WALKING, actor->finishedAnimActionParam & 0xff, 0, 0));
+ addAction(ACTION_FINISHED_WALKING, actor->finishedAnimActionParam & 0xff, 0, 0);
}
actor->sprite.bitmap.reset();
@@ -1056,15 +1056,15 @@ int StarTrekEngine::selectObjectForUseAction() {
return clickedObject;
else if (isObjectUnusable(OBJECT_KIRK, ACTION_USE))
continue;
- else if (_room->actionHasCode(Action(ACTION_USE, OBJECT_KIRK, clickedObject, 0))
- || _room->actionHasCode(Action(ACTION_GET, clickedObject, 0, 0))
- || _room->actionHasCode(Action(ACTION_WALK, clickedObject, 0, 0))) {
+ else if (_room->actionHasCode(ACTION_USE, OBJECT_KIRK, clickedObject, 0)
+ || _room->actionHasCode(ACTION_GET, clickedObject, 0, 0)
+ || _room->actionHasCode(ACTION_WALK, clickedObject, 0, 0)) {
_awayMission.activeObject = OBJECT_KIRK;
_awayMission.passiveObject = clickedObject;
_awayMission.activeAction = ACTION_USE;
clickedObject = OBJECT_KIRK;
if (!walkActiveObjectToHotspot())
- addAction(Action(_awayMission.activeAction, _awayMission.activeObject, _awayMission.passiveObject, 0));
+ addAction(_awayMission.activeAction, _awayMission.activeObject, _awayMission.passiveObject, 0);
return clickedObject;
}
else
@@ -1160,7 +1160,7 @@ bool StarTrekEngine::walkActiveObjectToHotspot() {
else {
// If this action has code defined for it in this room, buffer the action to be
// done after the object finished walking there.
- Action action(_awayMission.activeAction, _awayMission.activeObject, 0, 0);
+ Action action = {_awayMission.activeAction, _awayMission.activeObject, 0, 0};
if (_awayMission.activeAction == ACTION_USE)
action.b2 = _awayMission.passiveObject;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 8f17a0f..cacb8c3 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -223,7 +223,7 @@ public:
int loadActorAnimWithRoomScaling(int actorIndex, const Common::String &animName, int16 x, int16 y);
uint16 getActorScaleAtPosition(int16 y);
void addAction(const Action &action);
- void addAction(byte b1, byte b2, byte b3, byte b4) { addAction(Action(b1, b2, b3, b4)); }
+ void addAction(byte type, byte b1, byte b2, byte b3);
bool checkItemInteractionExists(int action, int activeItem, int passiveItem, int16 arg6);
void handleAwayMissionAction();
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 071dc6d..87ecdb2 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -161,7 +161,7 @@ void StarTrekEngine::showTextbox(String headerText, const String &mainText, int
showText(&StarTrekEngine::readTextFromArray, (uintptr)strings, xoffset, yoffset, textColor, false, maxTextLines, false);
if (actionParam != 0)
- addAction(Action(ACTION_TALK, actionParam, 0, 0));
+ addAction(ACTION_TALK, actionParam, 0, 0);
}
String StarTrekEngine::skipTextAudioPrompt(const String &str) {
Commit: d486051a6cd8c81c0c7a07a90e30420a6f2171d3
https://github.com/scummvm/scummvm/commit/d486051a6cd8c81c0c7a07a90e30420a6f2171d3
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fix initializer list warnings
Changed paths:
engines/startrek/rooms/feather1.cpp
engines/startrek/rooms/function_map.h
diff --git a/engines/startrek/rooms/feather1.cpp b/engines/startrek/rooms/feather1.cpp
index 7a23121..c5f7307 100644
--- a/engines/startrek/rooms/feather1.cpp
+++ b/engines/startrek/rooms/feather1.cpp
@@ -63,7 +63,7 @@ extern const RoomAction feather1ActionList[] = {
{ {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::feather1Timer2Expired },
{ {ACTION_FINISHED_ANIMATION, 8, 0, 0}, &Room::feather1PickedUpSnake },
{ {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::feather1Timer0Expired },
- { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::feather1UseCommunicator },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::feather1UseCommunicator },
{ {ACTION_USE, OBJECT_IROCK, HOTSPOT_HOLE, 0}, &Room::feather1UseRockOnHole },
{ {ACTION_FINISHED_WALKING, 9, 0, 0}, &Room::feather1ReachedHole },
{ {ACTION_TIMER_EXPIRED, 3, 0, 0}, &Room::feather1Timer3Expired },
@@ -106,25 +106,25 @@ extern const RoomAction feather1ActionList[] = {
{ {ACTION_FINISHED_WALKING, 10, 0, 0}, &Room::feather1ReachedVineToClimbDown },
{ {ACTION_FINISHED_ANIMATION, 10, 0, 0}, &Room::feather1ClimbedDownVine },
- { {ACTION_USE, OBJECT_IPHASERS, -1, 0}, &Room::feather1UsePhaser },
- { {ACTION_USE, OBJECT_IPHASERK, -1, 0}, &Room::feather1UsePhaser },
+ { {ACTION_USE, OBJECT_IPHASERS, 0xff, 0}, &Room::feather1UsePhaser },
+ { {ACTION_USE, OBJECT_IPHASERK, 0xff, 0}, &Room::feather1UsePhaser },
{ {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_RIGHT_VINE, 0}, &Room::feather1UseSTricorderOnRightVine },
{ {ACTION_USE, OBJECT_ISTRICOR, OBJECT_SNAKE, 0}, &Room::feather1UseSTricorderOnSnake },
{ {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MOSS, 0}, &Room::feather1UseSTricorderOnMoss },
{ {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_HOLE, 0}, &Room::feather1UseSTricorderOnHole },
- { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::feather1UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::feather1UseSTricorderAnywhere },
{ {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_ROCKS, 0}, &Room::feather1UseSTricorderOnRocks },
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_LEFT_VINE, 0}, &Room::feather1UseMTricorderOnVine },
{ {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_RIGHT_VINE, 0}, &Room::feather1UseMTricorderOnVine },
{ {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_MOSS, 0}, &Room::feather1UseMTricorderOnMoss },
{ {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_HOLE, 0}, &Room::feather1UseMTricorderOnHole },
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SNAKE, 0}, &Room::feather1UseMTricorderOnSnake },
- { {ACTION_USE, OBJECT_IMEDKIT, -1, 0}, &Room::feather1UseMedkit },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::feather1UseMedkit },
{ {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::feather1TalkToMccoy },
{ {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::feather1TalkToSpock },
{ {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::feather1TalkToRedshirt },
{ {ACTION_WALK, HOTSPOT_EXIT, 0, 0}, &Room::feather1WalkToExit },
- { {ACTION_LOOK, -1, 0, 0}, &Room::feather1LookAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::feather1LookAnywhere },
{ {ACTION_LOOK, OBJECT_SNAKE, 0, 0}, &Room::feather1LookAtSnake },
{ {ACTION_LOOK, HOTSPOT_RIGHT_VINE, 0, 0}, &Room::feather1LookAtRightVine },
{ {ACTION_LOOK, HOTSPOT_HOLE, 0, 0}, &Room::feather1LookAtHole },
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 67b19d9..5342207 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -82,8 +82,8 @@ RoomAction demon0ActionList[] = {
{ {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::demon0TalkToMcCoy },
{ {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::demon0TalkToSpock },
- { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::demon0UseSTricorderAnywhere },
- { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::demon0UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::demon0UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::demon0UseMTricorderAnywhere },
{ {ACTION_USE, OBJECT_IMTRICOR, 8, 0}, &Room::demon0UseMTricorderOnPrelate },
};
@@ -103,8 +103,8 @@ RoomAction demon1ActionList[] = {
{ {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::demon1KlingonFinishedAimingWeapon },
{ {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::demon1KirkShot },
- { {ACTION_USE, OBJECT_IPHASERK, -1, 0}, &Room::demon1UsePhaserOnAnything },
- { {ACTION_USE, OBJECT_IPHASERS, -1, 0}, &Room::demon1UsePhaserOnAnything },
+ { {ACTION_USE, OBJECT_IPHASERK, 0xff, 0}, &Room::demon1UsePhaserOnAnything },
+ { {ACTION_USE, OBJECT_IPHASERS, 0xff, 0}, &Room::demon1UsePhaserOnAnything },
{ {ACTION_USE, OBJECT_IPHASERK, 8, 0}, &Room::demon1UsePhaserOnKlingon1 },
{ {ACTION_USE, OBJECT_IPHASERS, 8, 0}, &Room::demon1UsePhaserOnKlingon1 },
@@ -160,7 +160,7 @@ RoomAction demon1ActionList[] = {
{ {ACTION_LOOK, 0x25, 0, 0}, &Room::demon1LookAtMine },
{ {ACTION_LOOK, 0x26, 0, 0}, &Room::demon1LookAtMountain },
{ {ACTION_LOOK, 13, 0, 0}, &Room::demon1LookAtHand },
- { {ACTION_LOOK, -1, 0, 0}, &Room::demon1LookAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::demon1LookAnywhere },
{ {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::demon1LookAtKirk },
{ {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::demon1LookAtSpock },
{ {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::demon1LookAtMcCoy },
@@ -186,7 +186,7 @@ RoomAction demon2ActionList[] = {
{ {ACTION_LOOK, 0x24, 0, 0}, &Room::demon2LookAtFern },
{ {ACTION_LOOK, 0x25, 0, 0}, &Room::demon2LookAtMoss },
{ {ACTION_LOOK, 0x26, 0, 0}, &Room::demon2LookAtLights },
- { {ACTION_LOOK, -1, 0, 0}, &Room::demon2LookAtAnything },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::demon2LookAtAnything },
{ {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::demon2LookAtKirk },
{ {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::demon2LookAtSpock },
@@ -264,7 +264,7 @@ RoomAction demon3ActionList[] = {
{ {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::demon3RedshirtElectrocuted },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::demon3UseSTricorderOnDoor },
- { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::demon3UseSTricorderOnAnything },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::demon3UseSTricorderOnAnything },
{ {ACTION_USE, OBJECT_IMTRICOR, 14, 0}, &Room::demon3UseMTricorderOnDoor },
{ {ACTION_USE, OBJECT_IMTRICOR, 0x21, 0}, &Room::demon3UseMTricorderOnDoor },
{ {ACTION_USE, OBJECT_IMTRICOR, 0x22, 0}, &Room::demon3UseMTricorderOnDoor },
@@ -296,7 +296,7 @@ RoomAction demon3ActionList[] = {
{ {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::demon3LookAtMccoy },
{ {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::demon3LookAtRedshirt },
- { {ACTION_LOOK, -1, 0, 0}, &Room::demon3LookAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::demon3LookAnywhere },
{ {ACTION_LOOK, 13, 0, 0}, &Room::demon3LookAtMiner },
{ {ACTION_LOOK, 9, 0, 0}, &Room::demon3LookAtBoulder1 },
{ {ACTION_LOOK, 10, 0, 0}, &Room::demon3LookAtBoulder2 },
@@ -344,7 +344,7 @@ RoomAction demon4ActionList[] = {
{ {ACTION_LOOK, 0x20, 0, 0}, &Room::demon4LookAtPattern },
{ {ACTION_LOOK, 8, 0, 0}, &Room::demon4LookAtAlien },
- { {ACTION_LOOK, -1, 0, 0}, &Room::demon4LookAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::demon4LookAnywhere },
{ {ACTION_LOOK, 0x22, 0, 0}, &Room::demon4LookAtSecurityEquipment },
{ {ACTION_LOOK, 0x23, 0, 0}, &Room::demon4LookAtFloor },
@@ -371,9 +371,9 @@ RoomAction demon4ActionList[] = {
{ {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::demon4UseSTricorderOnPanel },
{ {ACTION_USE, OBJECT_IMTRICOR, 0x21, 0}, &Room::demon4UseMTricorderOnPanel },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x23, 0}, &Room::demon4UseSTricorderOnAnything },
- { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::demon4UseSTricorderOnAnything },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::demon4UseSTricorderOnAnything },
{ {ACTION_USE, OBJECT_IMTRICOR, 0x23, 0}, &Room::demon4UseMTricorderOnAnything },
- { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::demon4UseMTricorderOnAnything },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::demon4UseMTricorderOnAnything },
{ {ACTION_USE, OBJECT_ISTRICOR, 8, 0}, &Room::demon4UseSTricorderOnNauian },
{ {ACTION_USE, OBJECT_IMTRICOR, 8, 0}, &Room::demon4UseMTricorderOnNauian },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x22, 0}, &Room::demon4UseSTricorderOnSecurityEquipment },
@@ -389,8 +389,8 @@ RoomAction demon5ActionList[] = {
{ {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::demon5DoorOpenedOrReachedDoor },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::demon5UseSTricorderOnCrate },
- { {ACTION_USE, OBJECT_IPHASERK, -1, 0}, &Room::demon5UsePhaserOnAnything },
- { {ACTION_USE, OBJECT_IPHASERS, -1, 0}, &Room::demon5UsePhaserOnAnything },
+ { {ACTION_USE, OBJECT_IPHASERK, 0xff, 0}, &Room::demon5UsePhaserOnAnything },
+ { {ACTION_USE, OBJECT_IPHASERS, 0xff, 0}, &Room::demon5UsePhaserOnAnything },
{ {ACTION_USE, OBJECT_IHAND, 11, 0}, &Room::demon5UseHandOnStephen },
{ {ACTION_USE, OBJECT_IBERRY, 11, 0}, &Room::demon5UseBerryOnStephen },
@@ -398,7 +398,7 @@ RoomAction demon5ActionList[] = {
{ {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::demon5MccoyReachedChub },
{ {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::demon5MccoyHealedChub },
- { {ACTION_USE, OBJECT_IDETOXIN, -1, 0}, &Room::demon5UseHypoDytoxinOnAnything },
+ { {ACTION_USE, OBJECT_IDETOXIN, 0xff, 0}, &Room::demon5UseHypoDytoxinOnAnything },
{ {ACTION_USE, OBJECT_IBERRY, 9, 0}, &Room::demon5UseBerryOnChub },
{ {ACTION_LOOK, 8, 0, 0}, &Room::demon5LookAtRoberts },
@@ -412,7 +412,7 @@ RoomAction demon5ActionList[] = {
{ {ACTION_LOOK, 0x20, 0, 0}, &Room::demon5LookAtMountain },
{ {ACTION_LOOK, 0x21, 0, 0}, &Room::demon5LookAtCrate },
- { {ACTION_LOOK, -1, 0, 0}, &Room::demon5LookAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::demon5LookAnywhere },
{ {ACTION_LOOK, 9, 0, 0}, &Room::demon5LookAtChub },
{ {ACTION_TALK, 8, 0, 0}, &Room::demon5TalkToRoberts },
@@ -465,7 +465,7 @@ RoomAction demon6ActionList[] = {
{ {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::demon6LookAtRedshirt },
{ {ACTION_LOOK, 0x21, 0, 0}, &Room::demon6LookAtComputer },
{ {ACTION_LOOK, 9, 0, 0}, &Room::demon6LookAtComputer },
- { {ACTION_LOOK, -1, 0, 0}, &Room::demon6LookAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::demon6LookAnywhere },
{ {ACTION_LOOK, 8, 0, 0}, &Room::demon6LookAtStephen },
{ {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::demon6TalkToMccoy },
@@ -480,7 +480,7 @@ RoomAction demon6ActionList[] = {
{ {ACTION_USE, OBJECT_IHAND, 0x22, 0}, &Room::demon6UseHandOnWorkspace },
{ {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::demon6SpockReachedWorkspace },
{ {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::demon6SpockFinishedRepairingHand },
- { {ACTION_USE, -1, 0x22, 0}, &Room::demon6UseAnythingOnWorkspace },
+ { {ACTION_USE, 0xff, 0x22, 0}, &Room::demon6UseAnythingOnWorkspace },
{ {ACTION_USE, OBJECT_KIRK, 0x20, 0}, &Room::demon6UseCrewmanOnCase },
{ {ACTION_USE, OBJECT_MCCOY, 0x20, 0}, &Room::demon6UseCrewmanOnCase },
{ {ACTION_USE, OBJECT_SPOCK, 0x20, 0}, &Room::demon6UseCrewmanOnCase },
@@ -586,15 +586,15 @@ RoomAction tug0ActionList[] = {
{ {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::tug0TalkToRedshirt },
{ {ACTION_TALK, 8, 0, 0}, &Room::tug0TalkToEngineer },
{ {ACTION_USE, OBJECT_ICOMM, 0, 0}, &Room::tug0UseCommunicator },
- { {ACTION_LOOK, -1, 0, 0}, &Room::tug0LookAnywhere },
- { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::tug0UseSTricorderAnywhere },
- { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::tug0UseMTricorderAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::tug0LookAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::tug0UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::tug0UseMTricorderAnywhere },
};
RoomAction tug1ActionList[] = {
{ {ACTION_TICK, 1, 0, 0}, &Room::tug1Tick1 },
- { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::tug1UseSTricorderOnAnything },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::tug1UseSTricorderOnAnything },
{ {ACTION_LOOK, 0x21, 0, 0}, &Room::tug1LookAtBridgeDoor },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::tug1UseSTricorderOnBridgeDoor },
{ {ACTION_USE, OBJECT_IPHASERS, 0x21, 0}, &Room::tug1UsePhaserOnBridgeDoor },
@@ -622,7 +622,7 @@ RoomAction tug1ActionList[] = {
{ {ACTION_FINISHED_ANIMATION, 7, 0, 0}, &Room::tug1KirkFinishedUsingWelder },
{ {ACTION_FINISHED_WALKING, 8, 0, 0}, &Room::tug1KirkReachedBridgeDoorWithWelderInLeftSpot },
{ {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::tug1KirkFinishedUsingWelderInLeftSpot },
- { {ACTION_LOOK, -1, 0, 0}, &Room::tug1LookAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::tug1LookAnywhere },
{ {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::tug1LookAtMccoy },
{ {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::tug1LookAtSpock },
{ {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::tug1LookAtRedshirt },
@@ -633,12 +633,12 @@ RoomAction tug1ActionList[] = {
{ {ACTION_LOOK, 0x25, 0, 0}, &Room::tug1LookAtBrigDoor },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x25, 0}, &Room::tug1UseSTricorderOnBrigDoor },
{ {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::tug1TalkToKirk },
- { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::tug1UseCommunicator },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::tug1UseCommunicator },
{ {ACTION_WALK, 0x21, 0, 0}, &Room::tug1WalkToBridgeDoor },
{ {ACTION_FINISHED_WALKING, 10, 0, 0}, &Room::tug1KirkReachedBridgeDoor },
{ {ACTION_FINISHED_ANIMATION, 11, 0, 0}, &Room::tug1BridgeDoorOpened },
{ {ACTION_WALK, 0x25, 0, 0}, &Room::tug1WalkToBrigDoor },
- { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::tug1UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::tug1UseMTricorderAnywhere },
{ {ACTION_USE, OBJECT_IMTRICOR, 0x21, 0}, &Room::tug1UseMTricorderOnBridgeDoor },
{ {ACTION_USE, OBJECT_IMTRICOR, 0x20, 0}, &Room::tug1UseMTricorderOnBridgeDoor },
{ {ACTION_USE, OBJECT_IMTRICOR, 0x22, 0}, &Room::tug1UseMTricorderOnBridgeDoor },
@@ -738,20 +738,20 @@ RoomAction tug2ActionList[] = {
{ {ACTION_USE, OBJECT_IMEDKIT, 9, 0}, &Room::tug2UseMedkitOnGuard2 },
{ {ACTION_LOOK, 10, 0, 0}, &Room::tug2LookAnywhere },
{ {ACTION_LOOK, 0x22, 0, 0}, &Room::tug2LookAnywhere },
- { {ACTION_LOOK, -1, 0, 0}, &Room::tug2LookAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::tug2LookAnywhere },
{ {ACTION_TALK, 10, 0, 0}, &Room::tug2TalkToBrig },
{ {ACTION_USE, OBJECT_IMTRICOR, 10, 0}, &Room::tug2UseMTricorderOnBrig },
{ {ACTION_USE, OBJECT_IMTRICOR, 0x22, 0}, &Room::tug2UseMTricorderOnOpenBrig },
- { {ACTION_USE, OBJECT_IPHASERS, -1, 0}, &Room::tug2UsePhaserAnywhere },
- { {ACTION_USE, OBJECT_IPHASERK, -1, 0}, &Room::tug2UsePhaserAnywhere },
+ { {ACTION_USE, OBJECT_IPHASERS, 0xff, 0}, &Room::tug2UsePhaserAnywhere },
+ { {ACTION_USE, OBJECT_IPHASERK, 0xff, 0}, &Room::tug2UsePhaserAnywhere },
};
RoomAction tug3ActionList[] = {
{ {ACTION_TICK, 1, 0, 0}, &Room::tug3Tick1 },
{ {ACTION_TICK, 40, 0, 0}, &Room::tug3Tick40 },
- { {ACTION_LOOK, -1, 0, 0}, &Room::tug3LookAnywhere },
- { {ACTION_USE, OBJECT_IPHASERS, -1, 0}, &Room::tug3UsePhaserAnywhere },
- { {ACTION_USE, OBJECT_IPHASERK, -1, 0}, &Room::tug3UsePhaserAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::tug3LookAnywhere },
+ { {ACTION_USE, OBJECT_IPHASERS, 0xff, 0}, &Room::tug3UsePhaserAnywhere },
+ { {ACTION_USE, OBJECT_IPHASERK, 0xff, 0}, &Room::tug3UsePhaserAnywhere },
{ {ACTION_USE, OBJECT_IPHASERS, 8, 0}, &Room::tug3UseStunPhaserOnElasi1 },
{ {ACTION_USE, OBJECT_IPHASERS, 9, 0}, &Room::tug3UseStunPhaserOnElasi2 },
{ {ACTION_USE, OBJECT_IPHASERS, 10, 0}, &Room::tug3UseStunPhaserOnElasi3 },
@@ -776,7 +776,7 @@ RoomAction tug3ActionList[] = {
{ {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::tug3TalkToMccoy },
{ {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::tug3TalkToSpock },
{ {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::tug3TalkToRedshirt },
- { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::tug3UseCommunicator },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::tug3UseCommunicator },
{ {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::tug3Timer0Expired },
{ {ACTION_FINISHED_ANIMATION, 13, 0, 0}, &Room::tug3AllCrewmenDead },
{ {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::tug3Timer1Expired },
@@ -799,7 +799,7 @@ RoomAction love0ActionList[] = {
{ {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::love0ReachedDoor1 },
{ {ACTION_LOOK, 0x20, 0, 0}, &Room::love0LookAtConsole },
{ {ACTION_LOOK, 0x23, 0, 0}, &Room::love0LookAtViewscreen },
- { {ACTION_LOOK, -1, 0, 0}, &Room::love0LookAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::love0LookAnywhere },
{ {ACTION_LOOK, 8, 0, 0}, &Room::love0LookAtDoor1 },
{ {ACTION_LOOK, 9, 0, 0}, &Room::love0LookAtDoor2 },
{ {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::love0LookAtKirk },
@@ -810,9 +810,9 @@ RoomAction love0ActionList[] = {
{ {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::love0TalkToMccoy },
{ {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::love0TalkToSpock },
{ {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::love0TalkToRedshirt },
- { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::love0UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::love0UseMTricorderAnywhere },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::love0UseSTricorderOnConsole },
- { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::love0UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::love0UseSTricorderAnywhere },
{ {ACTION_USE, OBJECT_KIRK, 0x20, 0}, &Room::love0UseKirkOnConsole },
{ {ACTION_USE, OBJECT_REDSHIRT, 0x20, 0}, &Room::love0UseRedshirtOnConsole },
{ {ACTION_USE, OBJECT_SPOCK, 0x20, 0}, &Room::love0UseSpockOnConsole },
@@ -838,10 +838,10 @@ RoomAction love0ActionList[] = {
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::loveaUseMTricorderOnHuman },
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::loveaUseMTricorderOnHuman },
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::loveaUseMTricorderOnHuman },
- { {ACTION_USE, OBJECT_IRLG, -1, 0}, &Room::loveaUseRomulanLaughingGas },
- { {ACTION_USE, OBJECT_IN2O, -1, 0}, &Room::loveaUseHumanLaughingGas },
- { {ACTION_USE, OBJECT_INH3, -1, 0}, &Room::loveaUseAmmonia },
- { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::loveaUseCommunicator },
+ { {ACTION_USE, OBJECT_IRLG, 0xff, 0}, &Room::loveaUseRomulanLaughingGas },
+ { {ACTION_USE, OBJECT_IN2O, 0xff, 0}, &Room::loveaUseHumanLaughingGas },
+ { {ACTION_USE, OBJECT_INH3, 0xff, 0}, &Room::loveaUseAmmonia },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::loveaUseCommunicator },
};
RoomAction love1ActionList[] = {
@@ -870,7 +870,7 @@ RoomAction love1ActionList[] = {
{ {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::love1LookAtSpock },
{ {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::love1LookAtMccoy },
{ {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::love1LookAtRedshirt },
- { {ACTION_LOOK, -1, 0, 0}, &Room::love1LookAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::love1LookAnywhere },
{ {ACTION_LOOK, 15, 0, 0}, &Room::love1LookAtNozzle },
{ {ACTION_LOOK, 0x24, 0, 0}, &Room::love1LookAtNozzle },
{ {ACTION_LOOK, 0x20, 0, 0}, &Room::love1LookAtLadder },
@@ -889,13 +889,13 @@ RoomAction love1ActionList[] = {
{ {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::love1TalkToMccoy },
{ {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::love1TalkToRedshirt },
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_IDISHES, 0}, &Room::love1UseMTricorderOnDishes },
- { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::love1UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::love1UseMTricorderAnywhere },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x23, 0}, &Room::love1UseSTricorderOnReplicator },
{ {ACTION_USE, OBJECT_ISTRICOR, 12, 0}, &Room::love1UseSTricorderOnReplicator },
{ {ACTION_USE, OBJECT_SPOCK, 0x25, 0}, &Room::love1UseSTricorderOnLaser },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x25, 0}, &Room::love1UseSTricorderOnLaser },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x22, 0}, &Room::love1UseSTricorderOnFreezer },
- { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::love1UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::love1UseSTricorderAnywhere },
{ {ACTION_USE, OBJECT_ISTRICOR, OBJECT_IDISHES, 0}, &Room::love1UseSTricorderOnDishes },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::love1UseSTricorderOnDistillator },
{ {ACTION_GET, 11, 0, 0}, &Room::love1GetFreezer },
@@ -917,7 +917,7 @@ RoomAction love1ActionList[] = {
{ {ACTION_USE, OBJECT_IRLG, 0x24, 0}, &Room::love1UseRLGOnNozzle },
{ {ACTION_FINISHED_WALKING, 3, 0, 0}, &Room::love1KirkReachedNozzleToPut },
{ {ACTION_FINISHED_ANIMATION, 12, 0, 0}, &Room::love1KirkPutBottleInNozzle },
- { {ACTION_USE, -1, 0x24, 0}, &Room::love1UseAnthingOnNozzle },
+ { {ACTION_USE, 0xff, 0x24, 0}, &Room::love1UseAnthingOnNozzle },
{ {ACTION_USE, OBJECT_SPOCK, 0x23, 0}, &Room::love1UseSpockOnReplicator },
{ {ACTION_USE, OBJECT_REDSHIRT, 0x23, 0}, &Room::love1UseRedshirtOnReplicator },
{ {ACTION_USE, OBJECT_MCCOY, 14, 0}, &Room::love1UseMccoyOnReplicator },
@@ -927,7 +927,7 @@ RoomAction love1ActionList[] = {
{ {ACTION_FINISHED_ANIMATION, 13, 0, 0}, &Room::love1MccoyUsedReplicator },
{ {ACTION_FINISHED_ANIMATION, 7, 0, 0}, &Room::love1ChamberClosed },
{ {ACTION_FINISHED_ANIMATION, 8, 0, 0}, &Room::love1ChamberOpened },
- { {ACTION_USE, -1, 12, 0}, &Room::love1UseAnythingOnChamber },
+ { {ACTION_USE, 0xff, 12, 0}, &Room::love1UseAnythingOnChamber },
{ {ACTION_USE, OBJECT_IDISHES, 12, 0}, &Room::love1UseDishesOnChamber },
{ {ACTION_USE, OBJECT_IDISHES, 0x23, 0}, &Room::love1UseDishesOnChamber },
{ {ACTION_FINISHED_WALKING, 5, 0, 0}, &Room::love1KirkReachedChamberToPut },
@@ -946,13 +946,13 @@ RoomAction love1ActionList[] = {
{ {ACTION_USE, OBJECT_MCCOY, 11, 0}, &Room::love1UseMccoyOnFreezer },
{ {ACTION_FINISHED_WALKING, 7, 0, 0}, &Room::love1CrewmanReachedFreezer },
{ {ACTION_FINISHED_ANIMATION, 16, 0, 0}, &Room::love1CrewmanOpenedOrClosedFreezer },
- { {ACTION_USE, -1, 0x22, 0}, &Room::love1UseAnythingOnFreezer },
+ { {ACTION_USE, 0xff, 0x22, 0}, &Room::love1UseAnythingOnFreezer },
{ {ACTION_FINISHED_WALKING, 11, 0, 0}, &Room::love1ReachedFreezerWithArbitraryItem },
{ {ACTION_FINISHED_ANIMATION, 17, 0, 0}, &Room::love1FinishedUsingArbitraryItemOnFreezer },
- { {ACTION_USE, -1, 0x23, 0}, &Room::love1UseAnythingOnReplicator },
+ { {ACTION_USE, 0xff, 0x23, 0}, &Room::love1UseAnythingOnReplicator },
{ {ACTION_FINISHED_WALKING, 12, 0, 0}, &Room::love1ReachedReplicatorWithArbitraryItem },
{ {ACTION_FINISHED_ANIMATION, 18, 0, 0}, &Room::love1FinishedUsingArbitraryItemOnReplicator },
- { {ACTION_USE, -1, 0x21, 0}, &Room::love1UseAnythingOnDistillator },
+ { {ACTION_USE, 0xff, 0x21, 0}, &Room::love1UseAnythingOnDistillator },
{ {ACTION_FINISHED_WALKING, 13, 0, 0}, &Room::love1ReachedDistillatorWithArbitraryItem },
{ {ACTION_FINISHED_ANIMATION, 19, 0, 0}, &Room::love1FinishedUsingArbitraryItemOnDistillator },
{ {ACTION_USE, OBJECT_KIRK, 0x20, 0}, &Room::love1UseKirkOnLadder },
@@ -976,10 +976,10 @@ RoomAction love1ActionList[] = {
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::loveaUseMTricorderOnHuman },
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::loveaUseMTricorderOnHuman },
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::loveaUseMTricorderOnHuman },
- { {ACTION_USE, OBJECT_IRLG, -1, 0}, &Room::loveaUseRomulanLaughingGas },
- { {ACTION_USE, OBJECT_IN2O, -1, 0}, &Room::loveaUseHumanLaughingGas },
- { {ACTION_USE, OBJECT_INH3, -1, 0}, &Room::loveaUseAmmonia },
- { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::loveaUseCommunicator },
+ { {ACTION_USE, OBJECT_IRLG, 0xff, 0}, &Room::loveaUseRomulanLaughingGas },
+ { {ACTION_USE, OBJECT_IN2O, 0xff, 0}, &Room::loveaUseHumanLaughingGas },
+ { {ACTION_USE, OBJECT_INH3, 0xff, 0}, &Room::loveaUseAmmonia },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::loveaUseCommunicator },
};
RoomAction love2ActionList[] = {
@@ -994,7 +994,7 @@ RoomAction love2ActionList[] = {
{ {ACTION_LOOK, 8, 0, 0}, &Room::love2LookAtCabinet },
{ {ACTION_LOOK, 10, 0, 0}, &Room::love2LookAtDoor },
{ {ACTION_LOOK, 0x20, 0, 0}, &Room::love2LookAtSynthesizer },
- { {ACTION_LOOK, -1, 0, 0}, &Room::love2LookAtAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::love2LookAtAnywhere },
{ {ACTION_LOOK, 14, 0, 0}, &Room::love2LookAtAntigrav },
{ {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::love2LookAtMccoy },
{ {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::love2LookAtSpock },
@@ -1013,8 +1013,8 @@ RoomAction love2ActionList[] = {
{ {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::love2TalkToSpock },
{ {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::love2TalkToMccoy },
{ {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::love2TalkToRedshirt },
- { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::love2UseMTricorderAnywhere },
- { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::love2UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::love2UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::love2UseSTricorderAnywhere },
{ {ACTION_USE, OBJECT_KIRK, 8, 0}, &Room::love2UseKirkOnCabinet },
{ {ACTION_USE, OBJECT_SPOCK, 8, 0}, &Room::love2UseSpockOnCabinet },
{ {ACTION_USE, OBJECT_MCCOY, 8, 0}, &Room::love2UseMccoyOnCabinet },
@@ -1066,8 +1066,8 @@ RoomAction love2ActionList[] = {
{ {ACTION_FINISHED_ANIMATION, 7, 0, 0}, &Room::love2SynthesizerDoorOpenedWithCureSample },
{ {ACTION_FINISHED_ANIMATION, 21, 0, 0}, &Room::love2PutCureSampleInSynthesizer },
- { {ACTION_USE, -1, 9, 0}, &Room::love2UseAnythingOnSynthesizerDoor },
- { {ACTION_USE, -1, 0x20, 0}, &Room::love2UseAnythingOnSynthesizer },
+ { {ACTION_USE, 0xff, 9, 0}, &Room::love2UseAnythingOnSynthesizerDoor },
+ { {ACTION_USE, 0xff, 0x20, 0}, &Room::love2UseAnythingOnSynthesizer },
{ {ACTION_GET, 13, 0, 0}, &Room::love2GetCanister },
{ {ACTION_GET, 12, 0, 0}, &Room::love2GetCanister },
@@ -1108,10 +1108,10 @@ RoomAction love2ActionList[] = {
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::loveaUseMTricorderOnHuman },
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::loveaUseMTricorderOnHuman },
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::loveaUseMTricorderOnHuman },
- { {ACTION_USE, OBJECT_IRLG, -1, 0}, &Room::loveaUseRomulanLaughingGas },
- { {ACTION_USE, OBJECT_IN2O, -1, 0}, &Room::loveaUseHumanLaughingGas },
- { {ACTION_USE, OBJECT_INH3, -1, 0}, &Room::loveaUseAmmonia },
- { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::loveaUseCommunicator },
+ { {ACTION_USE, OBJECT_IRLG, 0xff, 0}, &Room::loveaUseRomulanLaughingGas },
+ { {ACTION_USE, OBJECT_IN2O, 0xff, 0}, &Room::loveaUseHumanLaughingGas },
+ { {ACTION_USE, OBJECT_INH3, 0xff, 0}, &Room::loveaUseAmmonia },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::loveaUseCommunicator },
};
RoomAction love3ActionList[] = {
@@ -1126,7 +1126,7 @@ RoomAction love3ActionList[] = {
{ {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::love3LookAtMccoy },
{ {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::love3LookAtSpock },
{ {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::love3LookAtRedshirt },
- { {ACTION_LOOK, -1, 0, 0}, &Room::love3LookAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::love3LookAnywhere },
{ {ACTION_LOOK, 0x22, 0, 0}, &Room::love3LookAtShaft },
{ {ACTION_LOOK, 11, 0, 0}, &Room::love3LookAtGrate },
{ {ACTION_LOOK, 9, 0, 0}, &Room::love3LookAtPanel },
@@ -1137,10 +1137,10 @@ RoomAction love3ActionList[] = {
{ {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::love3TalkToSpock },
{ {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::love3TalkToMccoy },
{ {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::love3TalkToRedshirt },
- { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::love3UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::love3UseMTricorderAnywhere },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x23, 0}, &Room::love3UseSTricorderOnTurbines },
{ {ACTION_USE, OBJECT_ISTRICOR, 9, 0}, &Room::love3UseSTricorderOnInsulation },
- { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::love3UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::love3UseSTricorderAnywhere },
{ {ACTION_USE, OBJECT_KIRK, 8, 0}, &Room::love3UseKirkOnServicePanel },
{ {ACTION_USE, OBJECT_SPOCK, 8, 0}, &Room::love3UseSpockOnServicePanel },
{ {ACTION_USE, OBJECT_MCCOY, 8, 0}, &Room::love3UseMccoyOnServicePanel },
@@ -1231,10 +1231,10 @@ RoomAction love3ActionList[] = {
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::loveaUseMTricorderOnHuman },
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::loveaUseMTricorderOnHuman },
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::loveaUseMTricorderOnHuman },
- { {ACTION_USE, OBJECT_IRLG, -1, 0}, &Room::loveaUseRomulanLaughingGas },
- { {ACTION_USE, OBJECT_IN2O, -1, 0}, &Room::loveaUseHumanLaughingGas },
- { {ACTION_USE, OBJECT_INH3, -1, 0}, &Room::loveaUseAmmonia },
- { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::loveaUseCommunicator },
+ { {ACTION_USE, OBJECT_IRLG, 0xff, 0}, &Room::loveaUseRomulanLaughingGas },
+ { {ACTION_USE, OBJECT_IN2O, 0xff, 0}, &Room::loveaUseHumanLaughingGas },
+ { {ACTION_USE, OBJECT_INH3, 0xff, 0}, &Room::loveaUseAmmonia },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::loveaUseCommunicator },
};
RoomAction love4ActionList[] = {
@@ -1254,7 +1254,7 @@ RoomAction love4ActionList[] = {
{ {ACTION_USE, OBJECT_IPHASERS, 11, 0}, &Room::love4UseStunPhaserOnRomulan },
{ {ACTION_USE, OBJECT_IPHASERS, 12, 0}, &Room::love4UseStunPhaserOnRomulan },
// NOTE: nothing for OBJECT_IPHASERK. There's an unused audio file which might fit.
- { {ACTION_LOOK, -1, 0, 0}, &Room::love4LookAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::love4LookAnywhere },
{ {ACTION_LOOK, 0x21, 0, 0}, &Room::love4LookAtLadder },
{ {ACTION_LOOK, 8, 0, 0}, &Room::love4LookAtDoor },
{ {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::love4LookAtKirk },
@@ -1277,8 +1277,8 @@ RoomAction love4ActionList[] = {
{ {ACTION_USE, OBJECT_IMTRICOR, 10, 0}, &Room::love4UseMTricorderOnRomulan },
{ {ACTION_USE, OBJECT_IMTRICOR, 11, 0}, &Room::love4UseMTricorderOnRomulan },
{ {ACTION_USE, OBJECT_IMTRICOR, 12, 0}, &Room::love4UseMTricorderOnRomulan },
- { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::love4UseMTricorderAnywhere },
- { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::love4UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::love4UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::love4UseSTricorderAnywhere },
{ {ACTION_USE, OBJECT_ICURE, 9, 0}, &Room::love4UseCureOnRomulan },
{ {ACTION_USE, OBJECT_ICURE, 10, 0}, &Room::love4UseCureOnRomulan },
@@ -1305,10 +1305,10 @@ RoomAction love4ActionList[] = {
{ {ACTION_USE, OBJECT_ISAMPLE, 10, 0}, &Room::love4UseCureSampleOnRomulan },
{ {ACTION_USE, OBJECT_ISAMPLE, 11, 0}, &Room::love4UseCureSampleOnRomulan },
{ {ACTION_USE, OBJECT_ISAMPLE, 12, 0}, &Room::love4UseCureSampleOnRomulan },
- { {ACTION_USE, -1, 9, 0}, &Room::love4UseAnythingOnRomulan },
- { {ACTION_USE, -1, 10, 0}, &Room::love4UseAnythingOnRomulan },
- { {ACTION_USE, -1, 11, 0}, &Room::love4UseAnythingOnRomulan },
- { {ACTION_USE, -1, 12, 0}, &Room::love4UseAnythingOnRomulan },
+ { {ACTION_USE, 0xff, 9, 0}, &Room::love4UseAnythingOnRomulan },
+ { {ACTION_USE, 0xff, 10, 0}, &Room::love4UseAnythingOnRomulan },
+ { {ACTION_USE, 0xff, 11, 0}, &Room::love4UseAnythingOnRomulan },
+ { {ACTION_USE, 0xff, 12, 0}, &Room::love4UseAnythingOnRomulan },
// Common code
{ {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::loveaTimer0Expired },
@@ -1323,10 +1323,10 @@ RoomAction love4ActionList[] = {
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::loveaUseMTricorderOnHuman },
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::loveaUseMTricorderOnHuman },
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::loveaUseMTricorderOnHuman },
- { {ACTION_USE, OBJECT_IRLG, -1, 0}, &Room::loveaUseRomulanLaughingGas },
- { {ACTION_USE, OBJECT_IN2O, -1, 0}, &Room::loveaUseHumanLaughingGas },
- { {ACTION_USE, OBJECT_INH3, -1, 0}, &Room::loveaUseAmmonia },
- { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::loveaUseCommunicator },
+ { {ACTION_USE, OBJECT_IRLG, 0xff, 0}, &Room::loveaUseRomulanLaughingGas },
+ { {ACTION_USE, OBJECT_IN2O, 0xff, 0}, &Room::loveaUseHumanLaughingGas },
+ { {ACTION_USE, OBJECT_INH3, 0xff, 0}, &Room::loveaUseAmmonia },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::loveaUseCommunicator },
};
RoomAction love5ActionList[] = {
@@ -1339,7 +1339,7 @@ RoomAction love5ActionList[] = {
{ {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::love5LookAtSpock },
{ {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::love5LookAtMccoy },
{ {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::love5LookAtRedshirt },
- { {ACTION_LOOK, -1, 0, 0}, &Room::love5LookAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::love5LookAnywhere },
{ {ACTION_LOOK, 0x20, 0, 0}, &Room::love5LookAtDevice },
{ {ACTION_LOOK, 0x21, 0, 0}, &Room::love5LookAtConsole },
{ {ACTION_LOOK, 10, 0, 0}, &Room::love5LookAtDrMarcus },
@@ -1355,7 +1355,7 @@ RoomAction love5ActionList[] = {
{ {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::love5TalkToSpock },
{ {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::love5TalkToMccoy },
{ {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::love5TalkToRedshirt },
- { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::love5UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::love5UseSTricorderAnywhere },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::love5UseSTricorderOnDevice },
{ {ACTION_USE, OBJECT_IMTRICOR, 10, 0}, &Room::love5UseMTricorderOnMarcusOrCheever },
{ {ACTION_USE, OBJECT_IMTRICOR, 11, 0}, &Room::love5UseMTricorderOnMarcusOrCheever },
@@ -1366,7 +1366,7 @@ RoomAction love5ActionList[] = {
{ {ACTION_USE, OBJECT_ICURE, 9, 0}, &Room::love5UseCureOnPreax },
{ {ACTION_FINISHED_WALKING, 4, 0, 0}, &Room::love5ReachedPreaxUsingCure },
{ {ACTION_FINISHED_ANIMATION, 5, 0, 0}, &Room::love5CuredPreax },
- { {ACTION_USE, -1, 9, 0}, &Room::love5UseAnythingOnPreax },
+ { {ACTION_USE, 0xff, 9, 0}, &Room::love5UseAnythingOnPreax },
{ {ACTION_USE, OBJECT_KIRK, 10, 0}, &Room::love5UseKirkOnMarcusOrCheever },
{ {ACTION_USE, OBJECT_KIRK, 11, 0}, &Room::love5UseKirkOnMarcusOrCheever },
{ {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::love5KirkReachedCheever },
@@ -1388,13 +1388,13 @@ RoomAction love5ActionList[] = {
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::loveaUseMTricorderOnHuman },
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::loveaUseMTricorderOnHuman },
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::loveaUseMTricorderOnHuman },
- { {ACTION_USE, OBJECT_IRLG, -1, 0}, &Room::loveaUseRomulanLaughingGas },
- { {ACTION_USE, OBJECT_IN2O, -1, 0}, &Room::loveaUseHumanLaughingGas },
- { {ACTION_USE, OBJECT_INH3, -1, 0}, &Room::loveaUseAmmonia },
- { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::loveaUseCommunicator },
+ { {ACTION_USE, OBJECT_IRLG, 0xff, 0}, &Room::loveaUseRomulanLaughingGas },
+ { {ACTION_USE, OBJECT_IN2O, 0xff, 0}, &Room::loveaUseHumanLaughingGas },
+ { {ACTION_USE, OBJECT_INH3, 0xff, 0}, &Room::loveaUseAmmonia },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::loveaUseCommunicator },
// Common code (countdown for losing atmosphere when life support malfunctioning)
- { {ACTION_TICK, -1, -1, -1}, &Room::muddaTick },
+ { {ACTION_TICK, 0xff, 0xff, 0xff}, &Room::muddaTick },
};
RoomAction mudd0ActionList[] = {
@@ -1403,24 +1403,24 @@ RoomAction mudd0ActionList[] = {
{ {ACTION_TICK, 60, 0, 0}, &Room::mudd0Tick60 },
{ {ACTION_USE, OBJECT_IPHASERS, 8, 0}, &Room::mudd0UsePhaserOnMudd },
{ {ACTION_USE, OBJECT_IPHASERK, 8, 0}, &Room::mudd0UsePhaserOnMudd },
- { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::mudd0UseCommunicator },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::mudd0UseCommunicator },
{ {ACTION_LOOK, 0x23, 0, 0}, &Room::mudd0LookAtFoodBox },
{ {ACTION_LOOK, 0x24, 0, 0}, &Room::mudd0LookAtComponentBox },
- { {ACTION_LOOK, -1, 0, 0}, &Room::mudd0LookAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::mudd0LookAnywhere },
{ {ACTION_LOOK, 0x20, 0, 0}, &Room::mudd0LookAtMemoryDiskBox },
{ {ACTION_LOOK, 0x22, 0, 0}, &Room::mudd0LookAtDegrimerBox },
{ {ACTION_LOOK, 0x21, 0, 0}, &Room::mudd0LookAtLense },
- { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::mudd0UseSTricorderAnywhere },
- { {ACTION_USE, OBJECT_IMTRICOR, -1, 0}, &Room::mudd0UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::mudd0UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::mudd0UseMTricorderAnywhere },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::mudd0UseSTricorderOnMemoryDiskBox },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x22, 0}, &Room::mudd0UseSTricorderOnDegrimerBox },
{ {ACTION_USE, OBJECT_IMTRICOR, 0x21, 0}, &Room::mudd0UseMTricorderOnLense },
// Common code (next 4 lines)
{ {ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0}, &Room::muddaUseLenseOnDegrimer },
- { {ACTION_USE, OBJECT_IALIENDV, -1, 0}, &Room::muddaUseAlienDevice },
+ { {ACTION_USE, OBJECT_IALIENDV, 0xff, 0}, &Room::muddaUseAlienDevice },
{ {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::muddaFiredAlienDevice },
- { {ACTION_USE, OBJECT_IDEGRIME, -1, 0}, &Room::muddaUseDegrimer },
+ { {ACTION_USE, OBJECT_IDEGRIME, 0xff, 0}, &Room::muddaUseDegrimer },
{ {ACTION_GET, 0x21, 0, 0}, &Room::mudd0GetLense },
{ {ACTION_GET, 0x20, 0, 0}, &Room::mudd0GetMemoryDisk },
@@ -1431,7 +1431,7 @@ RoomAction mudd0ActionList[] = {
{ {ACTION_TOUCHED_HOTSPOT, 1, 0, 0}, &Room::mudd0TouchedHotspot1 },
{ {ACTION_WALK, 0x25, 0, 0}, &Room::mudd0WalkToNorthDoor },
{ {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::mudd0TouchedHotspot0 },
- { {ACTION_USE, OBJECT_IMEDKIT, -1, 0}, &Room::mudd0UseMedkit },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::mudd0UseMedkit },
{ {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::mudd0LookAtKirk },
{ {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::mudd0LookAtSpock },
{ {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::mudd0LookAtMccoy },
@@ -1444,14 +1444,14 @@ RoomAction mudd0ActionList[] = {
{ {ACTION_TALK, 8, 0, 0}, &Room::mudd0TalkToMudd },
// Common code (countdown for losing atmosphere when life support malfunctioning)
- { {ACTION_TICK, -1, -1, -1}, &Room::muddaTick },
+ { {ACTION_TICK, 0xff, 0xff, 0xff}, &Room::muddaTick },
};
RoomAction mudd1ActionList[] = {
{ {ACTION_TICK, 1, 0, 0}, &Room::mudd1Tick1 },
{ {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::mudd1Timer1Expired },
- { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::mudd1UseCommunicator },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::mudd1UseCommunicator },
{ {ACTION_USE, OBJECT_SPOCK, 0x23, 0}, &Room::mudd1UseSpockOnBlueButton },
{ {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::mudd1SpockReachedBlueButton },
{ {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::mudd1SpockPressedBlueButton },
@@ -1464,9 +1464,9 @@ RoomAction mudd1ActionList[] = {
{ {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::mudd1SpockPressedRedButton },
// Common code (next 4 lines)
- { {ACTION_USE, OBJECT_IDEGRIME, -1, 0}, &Room::muddaUseDegrimer },
+ { {ACTION_USE, OBJECT_IDEGRIME, 0xff, 0}, &Room::muddaUseDegrimer },
{ {ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0}, &Room::muddaUseLenseOnDegrimer },
- { {ACTION_USE, OBJECT_IALIENDV, -1, 0}, &Room::muddaUseAlienDevice },
+ { {ACTION_USE, OBJECT_IALIENDV, 0xff, 0}, &Room::muddaUseAlienDevice },
{ {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::muddaFiredAlienDevice },
{ {ACTION_GET, 9, 0, 0}, &Room::mudd1GetTorpedo },
@@ -1480,8 +1480,8 @@ RoomAction mudd1ActionList[] = {
{ {ACTION_USE, OBJECT_ISTRICOR, 0x23, 0}, &Room::mudd1UseSTricorderOnButton },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x24, 0}, &Room::mudd1UseSTricorderOnButton },
{ {ACTION_USE, OBJECT_ISTRICOR, 8, 0}, &Room::mudd1UseSTricorderOnCrane },
- { {ACTION_USE, OBJECT_IMEDKIT, -1, 0}, &Room::mudd1UseMedkitAnywhere },
- { {ACTION_LOOK, -1, 0, 0}, &Room::mudd1LookAnywhere },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::mudd1UseMedkitAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::mudd1LookAnywhere },
{ {ACTION_LOOK, 0x20, 0, 0}, &Room::mudd1LookAtTorpedo },
{ {ACTION_LOOK, 9, 0, 0}, &Room::mudd1LookAtTorpedo },
{ {ACTION_LOOK, 0x21, 0, 0}, &Room::mudd1LookAtFallenTorpedo },
@@ -1506,7 +1506,7 @@ RoomAction mudd1ActionList[] = {
{ {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::mudd1TouchedHotspot0 },
// Common code (countdown for losing atmosphere when life support malfunctioning)
- { {ACTION_TICK, -1, -1, -1}, &Room::muddaTick },
+ { {ACTION_TICK, 0xff, 0xff, 0xff}, &Room::muddaTick },
};
RoomAction mudd2ActionList[] = {
@@ -1516,17 +1516,17 @@ RoomAction mudd2ActionList[] = {
{ {ACTION_TOUCHED_HOTSPOT, 1, 0, 0}, &Room::mudd2TouchedHotspot1 },
{ {ACTION_TICK, 1, 0, 0}, &Room::mudd2Tick1 },
{ {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::mudd2Timer1Expired },
- { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::mudd2UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::mudd2UseSTricorderAnywhere },
{ {ACTION_USE, OBJECT_SPOCK, 0x20, 0}, &Room::mudd2UseSpockOnCapsules },
{ {ACTION_GET, 0x20, 0, 0}, &Room::mudd2GetCapsules },
{ {ACTION_FINISHED_WALKING, 12, 0, 0}, &Room::mudd2MccoyReachedCapsules },
{ {ACTION_FINISHED_ANIMATION, 13, 0, 0}, &Room::mudd2MccoyPickedUpCapsules },
- { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::mudd2UseCommunicator },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::mudd2UseCommunicator },
// Common code (next 4 lines)
- { {ACTION_USE, OBJECT_IDEGRIME, -1, 0}, &Room::muddaUseDegrimer },
+ { {ACTION_USE, OBJECT_IDEGRIME, 0xff, 0}, &Room::muddaUseDegrimer },
{ {ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0}, &Room::muddaUseLenseOnDegrimer },
- { {ACTION_USE, OBJECT_IALIENDV, -1, 0}, &Room::muddaUseAlienDevice },
+ { {ACTION_USE, OBJECT_IALIENDV, 0xff, 0}, &Room::muddaUseAlienDevice },
{ {ACTION_FINISHED_ANIMATION, 18, 0, 0}, &Room::muddaFiredAlienDevice },
{ {ACTION_LOOK, 0x20, 0, 0}, &Room::mudd2LookAtCapsules },
@@ -1572,12 +1572,12 @@ RoomAction mudd2ActionList[] = {
{ {ACTION_TALK, 8, 0, 0}, &Room::mudd2TalkToMudd },
// Common code (countdown for losing atmosphere when life support malfunctioning)
- { {ACTION_TICK, -1, -1, -1}, &Room::muddaTick },
+ { {ACTION_TICK, 0xff, 0xff, 0xff}, &Room::muddaTick },
};
RoomAction mudd3ActionList[] = {
{ {ACTION_TICK, 1, 0, 0}, &Room::mudd3Tick1 },
- { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::mudd3UseCommunicator },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::mudd3UseCommunicator },
{ {ACTION_LOOK, 0x20, 0, 0}, &Room::mudd3LookAtScreen },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::mudd3UseSTricorderOnScreen },
{ {ACTION_USE, OBJECT_KIRK, 0x20, 0}, &Room::mudd3UseKirkOnScreen },
@@ -1594,9 +1594,9 @@ RoomAction mudd3ActionList[] = {
{ {ACTION_USE, OBJECT_IDISKS, 0x21, 0}, &Room::mudd3UseMemoryDiskOnSphere },
// Common code (next 4 lines)
- { {ACTION_USE, OBJECT_IDEGRIME, -1, 0}, &Room::muddaUseDegrimer },
+ { {ACTION_USE, OBJECT_IDEGRIME, 0xff, 0}, &Room::muddaUseDegrimer },
{ {ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0}, &Room::muddaUseLenseOnDegrimer },
- { {ACTION_USE, OBJECT_IALIENDV, -1, 0}, &Room::muddaUseAlienDevice },
+ { {ACTION_USE, OBJECT_IALIENDV, 0xff, 0}, &Room::muddaUseAlienDevice },
{ {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::muddaFiredAlienDevice },
{ {ACTION_GET, 13, 0, 0}, &Room::mudd3GetRepairTool },
@@ -1617,15 +1617,15 @@ RoomAction mudd3ActionList[] = {
{ {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::mudd3TalkToMccoy },
{ {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::mudd3TalkToRedshirt },
{ {ACTION_TALK, 8, 0, 0}, &Room::mudd3TalkToMudd },
- { {ACTION_USE, OBJECT_IMEDKIT, -1, 0}, &Room::mudd3UseMedkit },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::mudd3UseMedkit },
// Common code (countdown for losing atmosphere when life support malfunctioning)
- { {ACTION_TICK, -1, -1, -1}, &Room::muddaTick },
+ { {ACTION_TICK, 0xff, 0xff, 0xff}, &Room::muddaTick },
};
RoomAction mudd4ActionList[] = {
{ {ACTION_TICK, 1, 0, 0}, &Room::mudd4Tick1 },
- { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::mudd4UseCommunicator },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::mudd4UseCommunicator },
{ {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::mudd4Timer2Expired },
{ {ACTION_TIMER_EXPIRED, 3, 0, 0}, &Room::mudd4Timer3Expired },
{ {ACTION_USE, OBJECT_SPOCK, 0x21, 0}, &Room::mudd4UseSpockOnLeftConsole },
@@ -1667,11 +1667,11 @@ RoomAction mudd4ActionList[] = {
// Common code (next 4 lines)
{ {ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0}, &Room::muddaUseLenseOnDegrimer },
- { {ACTION_USE, OBJECT_IALIENDV, -1, 0}, &Room::muddaUseAlienDevice },
+ { {ACTION_USE, OBJECT_IALIENDV, 0xff, 0}, &Room::muddaUseAlienDevice },
{ {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::muddaFiredAlienDevice },
- { {ACTION_USE, OBJECT_IDEGRIME, -1, 0}, &Room::muddaUseDegrimer },
+ { {ACTION_USE, OBJECT_IDEGRIME, 0xff, 0}, &Room::muddaUseDegrimer },
- { {ACTION_USE, OBJECT_IMEDKIT, -1, 0}, &Room::mudd4UseMedkit },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::mudd4UseMedkit },
{ {ACTION_GET, 10, 0, 0}, &Room::mudd4GetRepairTool },
{ {ACTION_FINISHED_WALKING, 5, 0, 0}, &Room::mudd4ReachedRepairTool },
{ {ACTION_FINISHED_ANIMATION, 10, 0, 0}, &Room::mudd4PickedUpRepairTool },
@@ -1699,22 +1699,22 @@ RoomAction mudd4ActionList[] = {
{ {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::mudd4TouchedHotspot0 },
// Common code (countdown for losing atmosphere when life support malfunctioning)
- { {ACTION_TICK, -1, -1, -1}, &Room::muddaTick },
+ { {ACTION_TICK, 0xff, 0xff, 0xff}, &Room::muddaTick },
};
RoomAction mudd5ActionList[] = {
{ {ACTION_TICK, 1, 0, 0}, &Room::mudd5Tick1 },
{ {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::mudd5Timer1Expired },
{ {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::mudd5Timer2Expired },
- { {ACTION_USE, OBJECT_ICOMM, -1, 0}, &Room::mudd5UseCommunicator },
- { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::mudd5UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::mudd5UseCommunicator },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::mudd5UseSTricorderAnywhere },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::mudd5UseSTricorderOnEngine },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x22, 0}, &Room::mudd5UseSTricorderOnCrane },
{ {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::mudd5UseSTricorderOnHatch },
{ {ACTION_USE, OBJECT_ISTRICOR, 9, 0}, &Room::mudd5UseSTricorderOnLifeSupportGenerator },
{ {ACTION_USE, OBJECT_IPHASERS, 0x20, 0}, &Room::mudd5UseStunPhaserOnHatch },
{ {ACTION_USE, OBJECT_IPHASERK, 0x20, 0}, &Room::mudd5UseKillPhaserOnHatch },
- { {ACTION_USE, -1, 9, 0}, &Room::mudd5UseAnythingOnLifeSupportGenerator },
+ { {ACTION_USE, 0xff, 9, 0}, &Room::mudd5UseAnythingOnLifeSupportGenerator },
{ {ACTION_USE, OBJECT_IDOOVER, 9, 0}, &Room::mudd5UseDooverOnLifeSupportGenerator },
{ {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::mudd5KirkReachedLifeSupportGenerator },
{ {ACTION_TIMER_EXPIRED, 4, 0, 0}, &Room::mudd5KirkTimer4Expired },
@@ -1723,9 +1723,9 @@ RoomAction mudd5ActionList[] = {
// Common code (next 4 lines)
{ {ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0}, &Room::muddaUseLenseOnDegrimer },
- { {ACTION_USE, OBJECT_IALIENDV, -1, 0}, &Room::muddaUseAlienDevice },
+ { {ACTION_USE, OBJECT_IALIENDV, 0xff, 0}, &Room::muddaUseAlienDevice },
{ {ACTION_FINISHED_ANIMATION, 9, 0, 0}, &Room::muddaFiredAlienDevice },
- { {ACTION_USE, OBJECT_IDEGRIME, -1, 0}, &Room::muddaUseDegrimer },
+ { {ACTION_USE, OBJECT_IDEGRIME, 0xff, 0}, &Room::muddaUseDegrimer },
{ {ACTION_LOOK, 0x20, 0, 0}, &Room::mudd5LookAtHatch },
{ {ACTION_LOOK, 9, 0, 0}, &Room::mudd5LookAtLifeSupportGenerator },
@@ -1742,10 +1742,10 @@ RoomAction mudd5ActionList[] = {
{ {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::mudd5TalkToSpock },
{ {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::mudd5TalkToMccoy },
{ {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::mudd5TalkToRedshirt },
- { {ACTION_USE, OBJECT_IMEDKIT, -1, 0}, &Room::mudd5UseMedkit },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::mudd5UseMedkit },
// Common code (countdown for losing atmosphere when life support malfunctioning)
- { {ACTION_TICK, -1, -1, -1}, &Room::muddaTick },
+ { {ACTION_TICK, 0xff, 0xff, 0xff}, &Room::muddaTick },
};
RoomAction feather0ActionList[] = {
@@ -1758,12 +1758,12 @@ RoomAction feather0ActionList[] = {
{ {ACTION_USE, OBJECT_IPHASERK, 8, 0}, &Room::feather0UsePhaserOnQuetzecoatl },
{ {ACTION_USE, OBJECT_IPHASERS, OBJECT_MCCOY, 0}, &Room::feather0UsePhaserOnMccoy },
{ {ACTION_USE, OBJECT_IPHASERS, OBJECT_MCCOY, 0}, &Room::feather0UsePhaserOnMccoy },
- { {ACTION_USE, OBJECT_IMEDKIT, -1, 0}, &Room::feather0UseMedkit },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::feather0UseMedkit },
{ {ACTION_LOOK, 8, 0, 0}, &Room::feather0LookAtQuetzecoatl },
{ {ACTION_LOOK, 0x20, 0, 0}, &Room::feather0LookAtMoon },
{ {ACTION_LOOK, 0x21, 0, 0}, &Room::feather0LookAtLog },
{ {ACTION_LOOK, 0x22, 0, 0}, &Room::feather0LookAtHut },
- { {ACTION_LOOK, -1, 0, 0}, &Room::feather0LookAnywhere },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::feather0LookAnywhere },
{ {ACTION_LOOK, 0x23, 0, 0}, &Room::feather0LookAtEyes },
{ {ACTION_LOOK, 0x24, 0, 0}, &Room::feather0LookAtEyes },
{ {ACTION_LOOK, 0x25, 0, 0}, &Room::feather0LookAtEyes },
@@ -1781,7 +1781,7 @@ RoomAction feather0ActionList[] = {
{ {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::feather0TalkToSpock },
{ {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::feather0TalkToRedshirt },
{ {ACTION_USE, OBJECT_ISTRICOR, 8, 0}, &Room::feather0UseSTricorderOnQuetzecoatl },
- { {ACTION_USE, OBJECT_ISTRICOR, -1, 0}, &Room::feather0UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::feather0UseSTricorderAnywhere },
{ {ACTION_USE, OBJECT_IMTRICOR, 8, 0}, &Room::feather0UseMTricorderOnQuetzecoatl },
};
Commit: 007960e85eeaeb0f1ab45914936a917cb40af808
https://github.com/scummvm/scummvm/commit/007960e85eeaeb0f1ab45914936a917cb40af808
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Remove MUDD code from LOVE mission
Changed paths:
engines/startrek/rooms/function_map.h
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 5342207..203043b 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1392,9 +1392,6 @@ RoomAction love5ActionList[] = {
{ {ACTION_USE, OBJECT_IN2O, 0xff, 0}, &Room::loveaUseHumanLaughingGas },
{ {ACTION_USE, OBJECT_INH3, 0xff, 0}, &Room::loveaUseAmmonia },
{ {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::loveaUseCommunicator },
-
- // Common code (countdown for losing atmosphere when life support malfunctioning)
- { {ACTION_TICK, 0xff, 0xff, 0xff}, &Room::muddaTick },
};
RoomAction mudd0ActionList[] = {
Commit: ae3be7b40730387707bf4c104ea4f2ff8b588523
https://github.com/scummvm/scummvm/commit/ae3be7b40730387707bf4c104ea4f2ff8b588523
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: FEATHER2
Changed paths:
engines/startrek/action.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/feather2.cpp
engines/startrek/rooms/function_map.h
engines/startrek/text.h
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
index f6178d8..ab50def 100644
--- a/engines/startrek/action.h
+++ b/engines/startrek/action.h
@@ -29,7 +29,7 @@ namespace StarTrek {
class Room;
-enum Acton { // TODO: rename
+enum ActionTypes {
ACTION_TICK = 0,
ACTION_WALK = 1, // Actions 1-5 are directly usable on away missions.
@@ -41,8 +41,16 @@ enum Acton { // TODO: rename
ACTION_TOUCHED_WARP = 6,
ACTION_TOUCHED_HOTSPOT = 7, // Second kind of "hotspot" only relevant when an object touches them
ACTION_TIMER_EXPIRED = 8,
+
+ ACTION_DONE_ANIM = 10,
+ ACTION_DONE_WALK = 12,
+
+ // TODO: Remove these two as redundant.
+ // They're only here because I don't want to mess up the spacing in function_map.h by
+ // find/replacing the old name.
ACTION_FINISHED_ANIMATION = 10,
ACTION_FINISHED_WALKING = 12,
+
ACTION_OPTIONS = 13 // Not really an action, but selectable from action menu
};
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 0430d34..a2e5ff3 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -141,7 +141,7 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
}
else if (name == "FEATHER2") {
_roomActionList = feather2ActionList;
- _numRoomActions = sizeof(feather2ActionList) / sizeof(RoomAction);
+ _numRoomActions = feather2NumActions;
}
else if (name == "FEATHER3") {
_roomActionList = feather3ActionList;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index f4e7f30..2a37c7f 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1500,6 +1500,24 @@ public:
// FEATHER2
void feather2Tick1();
+ void feather2UseCommunicator();
+ void feather2UsePhaser();
+ void feather2UseSTricorderAnywhere();
+ void feather2UseMTricorderAnywhere();
+ void feather2TalkToMccoy();
+ void feather2TalkToSpock();
+ void feather2TalkToRedshirt();
+ void feather2LookAtVines();
+ void feather2UseMedkit();
+ void feather2WalkToLeftExit();
+ void feather2LookAtEyes();
+ void feather2LookAtBigTree();
+ void feather2LookAtTrees();
+ void feather2LookAnywhere();
+ void feather2LookAtKirk();
+ void feather2LookAtSpock();
+ void feather2LookAtMccoy();
+ void feather2LookAtRedshirt();
// FEATHER3
void feather3Tick1();
diff --git a/engines/startrek/rooms/feather2.cpp b/engines/startrek/rooms/feather2.cpp
index d28e26c..160302f 100644
--- a/engines/startrek/rooms/feather2.cpp
+++ b/engines/startrek/rooms/feather2.cpp
@@ -22,14 +22,124 @@
#include "startrek/room.h"
-#define OBJECT_8 8
-
-#define HOTSPOT_20 0x20
+#define HOTSPOT_EYES_1 0x20
+#define HOTSPOT_EYES_2 0x21
+#define HOTSPOT_EYES_3 0x22
+#define HOTSPOT_BIG_TREE 0x23
+#define HOTSPOT_TREES 0x24
+#define HOTSPOT_VINES 0x25
+#define HOTSPOT_LEFT_EXIT 0x26
namespace StarTrek {
+extern const RoomAction feather2ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::feather2Tick1 },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::feather2UseCommunicator },
+ { {ACTION_USE, OBJECT_IPHASERS, 0xff, 0}, &Room::feather2UsePhaser },
+ { {ACTION_USE, OBJECT_IPHASERK, 0xff, 0}, &Room::feather2UsePhaser },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::feather2UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::feather2UseMTricorderAnywhere },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::feather2TalkToMccoy },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::feather2TalkToSpock },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::feather2TalkToRedshirt },
+ { {ACTION_LOOK, HOTSPOT_VINES, 0, 0}, &Room::feather2LookAtVines },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::feather2UseMedkit },
+ { {ACTION_WALK, HOTSPOT_LEFT_EXIT, 0, 0}, &Room::feather2WalkToLeftExit },
+ { {ACTION_LOOK, HOTSPOT_EYES_1, 0, 0}, &Room::feather2LookAtEyes },
+ { {ACTION_LOOK, HOTSPOT_EYES_2, 0, 0}, &Room::feather2LookAtEyes },
+ { {ACTION_LOOK, HOTSPOT_EYES_3, 0, 0}, &Room::feather2LookAtEyes },
+ { {ACTION_LOOK, HOTSPOT_BIG_TREE, 0, 0}, &Room::feather2LookAtBigTree },
+ { {ACTION_LOOK, HOTSPOT_TREES, 0, 0}, &Room::feather2LookAtTrees },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::feather2LookAnywhere },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::feather2LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::feather2LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::feather2LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::feather2LookAtRedshirt },
+};
+
+extern const int feather2NumActions = sizeof(feather2ActionList) / sizeof(RoomAction);
+
+
void Room::feather2Tick1() {
+ playVoc("FEA2LOOP");
+ playMidiMusicTracks(27);
+}
+
+void Room::feather2UseCommunicator() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA2_006);
+}
+
+void Room::feather2UsePhaser() {
+ // FIXME: Why does McCoy say "They're dead, Jim"?
+ showText(TX_SPEAKER_MCCOY, TX_FEA2_003);
+}
+
+void Room::feather2UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_FEA2_007);
+}
+
+void Room::feather2UseMTricorderAnywhere() {
+ // ENHANCEMENT: Original didn't play tricorder sound, etc
+ mccoyScan(DIR_S, TX_FEA2_002);
+}
+
+void Room::feather2TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA2_004);
+}
+
+void Room::feather2TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA2_008);
+}
+
+void Room::feather2TalkToRedshirt() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA2_009);
+}
+
+void Room::feather2LookAtVines() {
+ // NOTE: This might be unused? I can't find where HOTSPOT_VINES is supposed to be.
+ showText(TX_FEA2N000);
+ showText(TX_SPEAKER_STRAGEY, TX_FEA2_010);
+ showText(TX_SPEAKER_MCCOY, TX_FEA2_005);
+}
+
+void Room::feather2UseMedkit() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA2_001);
+}
+
+void Room::feather2WalkToLeftExit() {
+ walkCrewman(OBJECT_KIRK, 0x14, 0x96);
+}
+
+void Room::feather2LookAtEyes() {
+ showText(TX_FEA2N001);
+}
+
+void Room::feather2LookAtBigTree() {
+ showText(TX_FEA2N006);
+}
+
+void Room::feather2LookAtTrees() {
+ showText(TX_FEA2N007);
+}
+
+void Room::feather2LookAnywhere() {
+ showText(TX_FEA2N008);
+}
+
+void Room::feather2LookAtKirk() {
+ showText(TX_FEA2N002);
+}
+
+void Room::feather2LookAtSpock() {
+ showText(TX_FEA2N005);
+}
+
+void Room::feather2LookAtMccoy() {
+ showText(TX_FEA2N004);
+}
+void Room::feather2LookAtRedshirt() {
+ showText(TX_FEA2N003);
}
}
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 203043b..cca19c4 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1782,12 +1782,8 @@ RoomAction feather0ActionList[] = {
{ {ACTION_USE, OBJECT_IMTRICOR, 8, 0}, &Room::feather0UseMTricorderOnQuetzecoatl },
};
-extern const RoomAction feather1ActionList[];
-extern const int feather1NumActions;
-
-RoomAction feather2ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::feather2Tick1 },
-};
+extern const RoomAction feather1ActionList[], feather2ActionList[];
+extern const int feather1NumActions, feather2NumActions;
RoomAction feather3ActionList[] = {
{ {ACTION_TICK, 1, 0, 0}, &Room::feather3Tick1 },
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 4bc5f67..4dab29d 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -1723,6 +1723,27 @@ enum GameStringIDs {
TX_FEA1N022,
+ TX_FEA2_001,
+ TX_FEA2_002,
+ TX_FEA2_003,
+ TX_FEA2_004,
+ TX_FEA2_005,
+ TX_FEA2_006,
+ TX_FEA2_007,
+ TX_FEA2_008,
+ TX_FEA2_009,
+ TX_FEA2_010,
+ TX_FEA2N000,
+ TX_FEA2N001,
+ TX_FEA2N002,
+ TX_FEA2N003,
+ TX_FEA2N004,
+ TX_FEA2N005,
+ TX_FEA2N006,
+ TX_FEA2N007,
+ TX_FEA2N008,
+
+
TX_SIN3_012,
@@ -3384,6 +3405,28 @@ const char * const g_gameStrings[] = {
"#FEA1\\FEA1N022#You pick up some rocks from the pile.",
+ "#FEA2\\FEA2_001#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#FEA2\\FEA2_002#Nothing interesting in this neck of the woods, Jim.",
+ "#FEA2\\FEA2_003#They're dead, Jim.",
+ "#FEA2\\FEA2_004#This jungle is sure lush, Jim. Speaking of lush, I could use a nice saurian brandy about now.",
+ "#FEA2\\FEA2_005#Really? Tell me more about your childhood Lieutenant...",
+ "#FEA2\\FEA2_006#Fascinating. Our communicators have apparently been rendered ineffective.",
+ "#FEA2\\FEA2_007#I am reading a life form to the west. It appears to be humanoid.",
+ "#FEA2\\FEA2_008#Staying in this overgrown region could prove quite dangerous. I suggest we continue, Captain.",
+ "#FEA2\\FEA2_009#I feel like someone is watching us, Captain.",
+ "#FEA2\\FEA2_010#You know, I always wanted to go swinging on a vine through a jungle. Just like in some old books I read when I was a kid.",
+ "#FEA2\\FEA2N000#A vine hangs from the trees.",
+ "#FEA2\\FEA2N001#Feral red eyes glare out of the dark at you.",
+ "#FEA2\\FEA2N002#Kirk is wondering what he said that made Quetzecoatl so angry...",
+ "#FEA2\\FEA2N003#Lt. Stragey appears fascinated by the vines hanging from the trees.",
+ "#FEA2\\FEA2N004#McCoy is filled with premonitions of injury and death. Why else would they have brought him along?",
+ "#FEA2\\FEA2N005#Spock is examining the surrounding terrain for signs of danger. Anything else would be illogical.",
+ "#FEA2\\FEA2N006#This great tree has been in this jungle for centuries.",
+ "#FEA2\\FEA2N007#Trees to the left of you! Trees to the right of you! Into the valley of trees raced the landing party!",
+ "#FEA2\\FEA2N008#You are in a densely vegetated area. The overgrowth blocks your view in all directions.",
+
+
+
"#SIN3\\SIN3_012#Can't say I like the decor.",
Commit: 1e60b6f96bd2733544b1340c6db1e4c550e2ab1e
https://github.com/scummvm/scummvm/commit/1e60b6f96bd2733544b1340c6db1e4c550e2ab1e
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: FEATHER3
Changed paths:
engines/startrek/action.h
engines/startrek/awaymission.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/feather3.cpp
engines/startrek/rooms/function_map.h
engines/startrek/text.h
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
index ab50def..1416736 100644
--- a/engines/startrek/action.h
+++ b/engines/startrek/action.h
@@ -42,12 +42,6 @@ enum ActionTypes {
ACTION_TOUCHED_HOTSPOT = 7, // Second kind of "hotspot" only relevant when an object touches them
ACTION_TIMER_EXPIRED = 8,
- ACTION_DONE_ANIM = 10,
- ACTION_DONE_WALK = 12,
-
- // TODO: Remove these two as redundant.
- // They're only here because I don't want to mess up the spacing in function_map.h by
- // find/replacing the old name.
ACTION_FINISHED_ANIMATION = 10,
ACTION_FINISHED_WALKING = 12,
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 4c4d0bc..8202ddb 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -250,7 +250,13 @@ struct AwayMission {
bool gotRock; // 0x2b
bool gotSnake; // 0x2c
+ bool tookKnife; // 0x2d
+ bool field2e; // 0x2e
+ byte numRocksThrownAtTlaoxac; // 0x2f
bool holeBlocked; // 0x31
+ bool tlaoxacTestPassed; // 0x32
+ bool knockedOutTlaoxac; // 0x33
+ bool showedSnakeToTlaoxac; // 0x35
int16 missionScore; // 0x36
} feather;
};
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index a2e5ff3..4dc1595 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -145,7 +145,7 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
}
else if (name == "FEATHER3") {
_roomActionList = feather3ActionList;
- _numRoomActions = sizeof(feather3ActionList) / sizeof(RoomAction);
+ _numRoomActions = feather3NumActions;
}
else if (name == "FEATHER4") {
_roomActionList = feather4ActionList;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 2a37c7f..e5a630d 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1521,6 +1521,51 @@ public:
// FEATHER3
void feather3Tick1();
+ void feather3Tick40();
+ void feather3TouchedHotspot0();
+ void feather3UseSpockOnTlaoxac();
+ void feather3UseMccoyOnTlaoxac();
+ void feather3UseRedshirtOnTlaoxac();
+ void feather3UseCrewmanOnLeftExit();
+ void feather3UseCommunicator();
+ void feather3UseSnakeOnKirk();
+ void feather3UseSnakeOnSpock();
+ void feather3UseSnakeOnRedshirt();
+ void feather3KirkReachedRedshirtWithSnake();
+ void feather3UseSnakeOnMccoy();
+ void feather3UseSnakeOnTlaoxac();
+ void feather3UseKnifeOnSpock();
+ void feather3UseKnifeOnMccoy();
+ void feather3UseKnifeOnRedshirt();
+ void feather3UseRockOnTlaoxac();
+ void feather3KirkReachedPositionToThrowRock();
+ void feather3Timer4Expired();
+ void feather3Timer2Expired();
+ void feather3Timer3Expired();
+ void feather3TlaoxacKnockedOutFromRockThrow();
+ void feather3UsePhaser();
+ void feather3TalkToMccoy();
+ void feather3TalkToSpock();
+ void feather3TalkToRedshirt();
+ void feather3TalkToTlaoxac();
+ void feather3TlaoxacKilledRedshirt();
+ void feather3UseMTricorderOnTlaoxac();
+ void feather3UseMedkitOnTlaoxac();
+ void feather3UseMedkitOnRedshirt();
+ void feather3UseMedkitAnywhere();
+ void feather3UseMTricorderOnLight();
+ void feather3UseSTricorderOnLight();
+ void feather3UseSTricorderAnywhere();
+ void feather3GetKnife();
+ void feather3ReachedKnife();
+ void feather3Timer1Expired();
+ void feather3PickedUpKnife();
+ void feather3LookAtSpock();
+ void feather3LookAtRedshirt();
+ void feather3LookAtTlaoxac();
+ void feather3LookAtLight();
+ void feather3LookAtMccoy();
+ void feather3LookAtKnife();
// FEATHER4
void feather4Tick1();
@@ -1658,11 +1703,11 @@ private:
byte snakeInHole; // 0xca
bool scannedSnake; // 0xcb
bool crewEscaped[4]; // 0xcc
- byte kirkEscaped; // 0xcc
- byte spockEscaped; // 0xcd
- byte mccoyEscaped; // 0xce
- byte cf; // 0xcf
byte crewmanClimbingVine;
+
+ // feather2
+ bool showedSnakeToTlaoxac; // 0xca
+ bool tlaoxacUnconscious; // 0xcb
} feather;
diff --git a/engines/startrek/rooms/feather3.cpp b/engines/startrek/rooms/feather3.cpp
index 0f5f3b3..fd87c81 100644
--- a/engines/startrek/rooms/feather3.cpp
+++ b/engines/startrek/rooms/feather3.cpp
@@ -22,14 +22,395 @@
#include "startrek/room.h"
-#define OBJECT_8 8
+#define OBJECT_TLAOXAC 8
+#define OBJECT_KNIFE 9
+#define OBJECT_ROCK 10
-#define HOTSPOT_20 0x20
+#define HOTSPOT_LEFT_EXIT 0x20
+#define HOTSPOT_LIGHT_1 0x21
+#define HOTSPOT_LIGHT_2 0x22
+
+#define KNIFE_X 0x64
+#define KNIFE_Y 0xb4
namespace StarTrek {
+extern const RoomAction feather3ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::feather3Tick1 },
+ { {ACTION_TICK, 40, 0, 0}, &Room::feather3Tick40 },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::feather3TouchedHotspot0 },
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_TLAOXAC, 0}, &Room::feather3UseSpockOnTlaoxac },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_TLAOXAC, 0}, &Room::feather3UseMccoyOnTlaoxac },
+ { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_TLAOXAC, 0}, &Room::feather3UseRedshirtOnTlaoxac },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_LEFT_EXIT, 0}, &Room::feather3UseCrewmanOnLeftExit },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_LEFT_EXIT, 0}, &Room::feather3UseCrewmanOnLeftExit },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_LEFT_EXIT, 0}, &Room::feather3UseCrewmanOnLeftExit },
+ { {ACTION_USE, OBJECT_ICOMM, 0, 0}, &Room::feather3UseCommunicator },
+ { {ACTION_USE, OBJECT_ISNAKE, OBJECT_KIRK, 0}, &Room::feather3UseSnakeOnKirk },
+ { {ACTION_USE, OBJECT_ISNAKE, OBJECT_SPOCK, 0}, &Room::feather3UseSnakeOnSpock },
+ { {ACTION_USE, OBJECT_ISNAKE, OBJECT_REDSHIRT, 0}, &Room::feather3UseSnakeOnRedshirt },
+ { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::feather3KirkReachedRedshirtWithSnake },
+ { {ACTION_USE, OBJECT_ISNAKE, OBJECT_MCCOY, 0}, &Room::feather3UseSnakeOnMccoy },
+ { {ACTION_USE, OBJECT_ISNAKE, OBJECT_TLAOXAC, 0}, &Room::feather3UseSnakeOnTlaoxac },
+ { {ACTION_USE, OBJECT_IKNIFE, OBJECT_SPOCK, 0}, &Room::feather3UseKnifeOnSpock },
+ { {ACTION_USE, OBJECT_IKNIFE, OBJECT_MCCOY, 0}, &Room::feather3UseKnifeOnMccoy },
+ { {ACTION_USE, OBJECT_IKNIFE, OBJECT_REDSHIRT, 0}, &Room::feather3UseKnifeOnRedshirt },
+ { {ACTION_USE, OBJECT_IROCK, OBJECT_TLAOXAC, 0}, &Room::feather3UseRockOnTlaoxac },
+ { {ACTION_FINISHED_WALKING, 3, 0, 0}, &Room::feather3KirkReachedPositionToThrowRock },
+ { {ACTION_TIMER_EXPIRED, 4, 0, 0}, &Room::feather3Timer4Expired },
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::feather3Timer2Expired },
+ { {ACTION_TIMER_EXPIRED, 3, 0, 0}, &Room::feather3Timer3Expired },
+ { {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::feather3TlaoxacKnockedOutFromRockThrow },
+ { {ACTION_USE, OBJECT_IPHASERS, 0xff, 0}, &Room::feather3UsePhaser },
+ { {ACTION_USE, OBJECT_IPHASERK, 0xff, 0}, &Room::feather3UsePhaser },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::feather3TalkToMccoy },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::feather3TalkToSpock },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::feather3TalkToRedshirt },
+ { {ACTION_TALK, OBJECT_TLAOXAC, 0, 0}, &Room::feather3TalkToTlaoxac },
+ { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::feather3TlaoxacKilledRedshirt },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_TLAOXAC, 0},&Room::feather3UseMTricorderOnTlaoxac },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_TLAOXAC, 0}, &Room::feather3UseMedkitOnTlaoxac },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_REDSHIRT, 0},&Room::feather3UseMedkitOnRedshirt },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::feather3UseMedkitAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_LIGHT_1, 0}, &Room::feather3UseMTricorderOnLight },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_LIGHT_2, 0}, &Room::feather3UseMTricorderOnLight },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_LIGHT_1, 0}, &Room::feather3UseSTricorderOnLight },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_LIGHT_2, 0}, &Room::feather3UseSTricorderOnLight },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::feather3UseSTricorderAnywhere },
+ { {ACTION_GET, OBJECT_KNIFE, 0, 0}, &Room::feather3GetKnife },
+ { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::feather3ReachedKnife },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::feather3Timer1Expired },
+ { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::feather3PickedUpKnife },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::feather3LookAtSpock },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::feather3LookAtRedshirt },
+ { {ACTION_LOOK, OBJECT_TLAOXAC, 0, 0}, &Room::feather3LookAtTlaoxac },
+ { {ACTION_LOOK, HOTSPOT_LIGHT_1, 0, 0}, &Room::feather3LookAtLight },
+ { {ACTION_LOOK, HOTSPOT_LIGHT_2, 0, 0}, &Room::feather3LookAtLight },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::feather3LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_KNIFE, 0, 0}, &Room::feather3LookAtKnife },
+};
+
+extern const int feather3NumActions = sizeof(feather3ActionList) / sizeof(RoomAction);
+
+
void Room::feather3Tick1() {
+ playVoc("FEA3LOOP");
+ playMidiMusicTracks(27);
+
+ if (!_vm->_awayMission.feather.tlaoxacTestPassed) {
+ loadActorAnim(OBJECT_TLAOXAC, "s5r3as", 0x2e, 0xab);
+ loadMapFile("feath3b");
+ } else if (!_vm->_awayMission.feather.tookKnife)
+ loadActorAnim(OBJECT_KNIFE, "s5r3nf", 0x64, 0xb4);
+}
+
+void Room::feather3Tick40() {
+ if (!_vm->_awayMission.feather.tlaoxacTestPassed)
+ showText(TX_SPEAKER_TLAOXAC, TX_FEA3_036);
+}
+
+void Room::feather3TouchedHotspot0() { // Tlaoxac prevents you from passing this point
+ if (!_vm->_awayMission.feather.tlaoxacTestPassed)
+ showText(TX_SPEAKER_TLAOXAC, TX_FEA3_035);
+}
+
+void Room::feather3UseSpockOnTlaoxac() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA3_026);
+ showText(TX_SPEAKER_MCCOY, TX_FEA3_018);
+ showText(TX_SPEAKER_SPOCK, TX_FEA3_028);
+ showText(TX_SPEAKER_MCCOY, TX_FEA3_015);
+}
+
+void Room::feather3UseMccoyOnTlaoxac() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA3_016);
+ showText(TX_SPEAKER_SPOCK, TX_FEA3_027);
+ showText(TX_SPEAKER_MCCOY, TX_FEA3_017);
+}
+
+void Room::feather3UseRedshirtOnTlaoxac() {
+ if (!_vm->_awayMission.redshirtDead)
+ showText(TX_SPEAKER_STRAGEY, TX_FEA3_029);
+}
+
+void Room::feather3UseCrewmanOnLeftExit() {
+ if (!_vm->_awayMission.feather.tlaoxacTestPassed)
+ showText(TX_SPEAKER_TLAOXAC, TX_FEA3_041);
+}
+
+void Room::feather3UseCommunicator() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA3_024);
+}
+
+void Room::feather3UseSnakeOnKirk() {
+ if (!_vm->_awayMission.feather.tlaoxacTestPassed && !_vm->_awayMission.redshirtDead) {
+ if (_roomVar.feather.showedSnakeToTlaoxac && _vm->_awayMission.feather.numRocksThrownAtTlaoxac == 0) {
+ showText(TX_SPEAKER_TLAOXAC, TX_FEA3_043);
+ _vm->_awayMission.feather.tlaoxacTestPassed = true;
+ _vm->_awayMission.feather.missionScore += 2;
+ loadMapFile("feather3");
+ loadActorAnim(OBJECT_KNIFE, "s5r3nf", KNIFE_X, KNIFE_Y);
+ _vm->_awayMission.feather.field2e = true;
+ } else
+ showText(TX_FEA3N004);
+ }
+}
+
+void Room::feather3UseSnakeOnSpock() {
+ if (_roomVar.feather.showedSnakeToTlaoxac)
+ showText(TX_SPEAKER_SPOCK, TX_FEA3_004);
+ else
+ showText(TX_SPEAKER_SPOCK, TX_FEA3_020);
+}
+
+void Room::feather3UseSnakeOnRedshirt() {
+ if (!_vm->_awayMission.feather.tlaoxacTestPassed && !_vm->_awayMission.redshirtDead) {
+ if (_roomVar.feather.showedSnakeToTlaoxac && _vm->_awayMission.feather.numRocksThrownAtTlaoxac == 0) {
+ walkCrewmanC(OBJECT_KIRK, 0x7c, 0xbc, &Room::feather3KirkReachedRedshirtWithSnake);
+ _vm->_awayMission.disableInput = true;
+ } else
+ showText(TX_SPEAKER_STRAGEY, TX_FEA3_031);
+ }
+}
+
+void Room::feather3KirkReachedRedshirtWithSnake() {
+ _vm->_awayMission.disableInput = false;
+
+ showText(TX_SPEAKER_STRAGEY, TX_FEA3_034);
+ showText(TX_SPEAKER_TLAOXAC, TX_FEA3_044);
+
+ _vm->_awayMission.feather.tlaoxacTestPassed = true;
+ _vm->_awayMission.feather.missionScore += 1;
+ loadMapFile("feather3");
+ loadActorAnim(OBJECT_KNIFE, "s5r3nf", KNIFE_X, KNIFE_Y);
+ _vm->_awayMission.feather.field2e = true;
+}
+
+void Room::feather3UseSnakeOnMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA3_007);
+}
+
+void Room::feather3UseSnakeOnTlaoxac() {
+ if (!_vm->_awayMission.feather.tlaoxacTestPassed && _vm->_awayMission.feather.numRocksThrownAtTlaoxac == 0) {
+ showText(TX_SPEAKER_TLAOXAC, TX_FEA3_039);
+ _roomVar.feather.showedSnakeToTlaoxac = true;
+ if (!_vm->_awayMission.feather.showedSnakeToTlaoxac) {
+ _vm->_awayMission.feather.showedSnakeToTlaoxac = true;
+ _vm->_awayMission.feather.missionScore += 1;
+ }
+ }
+}
+
+void Room::feather3UseKnifeOnSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA3_025);
+}
+
+void Room::feather3UseKnifeOnMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA3_011); // BUGFIX: Speaker is Mccoy, not Spock.
+}
+
+void Room::feather3UseKnifeOnRedshirt() {
+ if (!_vm->_awayMission.redshirtDead)
+ showText(TX_SPEAKER_STRAGEY, TX_FEA3_033); // BUGFIX: Speaker is Stragey, not Spock.
+}
+
+void Room::feather3UseRockOnTlaoxac() {
+ if (_roomVar.feather.tlaoxacUnconscious)
+ showText(TX_SPEAKER_MCCOY, TX_FEA3_009);
+ else {
+ _vm->_awayMission.feather.numRocksThrownAtTlaoxac++;
+ _vm->_awayMission.disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0xac, 0xb4, &Room::feather3KirkReachedPositionToThrowRock);
+ }
+}
+
+void Room::feather3KirkReachedPositionToThrowRock() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ loadActorAnim2(OBJECT_KIRK, "s5r3kt");
+ loadActorAnim(OBJECT_ROCK, "s5r3rt", 0x80, 0x7e);
+ _vm->_awayMission.timers[4] = 21;
+
+ if (_vm->_awayMission.feather.numRocksThrownAtTlaoxac == 2) {
+ _vm->_awayMission.feather.knockedOutTlaoxac = true;
+ _vm->_awayMission.feather.missionScore -= 2;
+ loadActorAnimC(OBJECT_TLAOXAC, "s5r3ad", -1, -1, &Room::feather3TlaoxacKnockedOutFromRockThrow);
+ playVoc("ROCKFACE");
+ _vm->_awayMission.timers[2] = 24;
+ } else {
+ loadActorAnim2(OBJECT_TLAOXAC, "s5r3ah");
+ playVoc("ROCKFACE");
+ _vm->_awayMission.timers[3] = 97;
+ }
+}
+
+void Room::feather3Timer4Expired() {
+ playSoundEffectIndex(SND_BLANK_0b);
+}
+
+void Room::feather3Timer2Expired() {
+ if (!_vm->_awayMission.feather.tookKnife)
+ loadActorAnim(OBJECT_KNIFE, "s5r3nf", KNIFE_X, KNIFE_Y);
+}
+
+void Room::feather3Timer3Expired() {
+ _vm->_awayMission.disableInput = false;
+ loadActorStandAnim(OBJECT_KIRK);
+}
+
+void Room::feather3TlaoxacKnockedOutFromRockThrow() {
+ _vm->_awayMission.disableInput = false;
+ loadActorStandAnim(OBJECT_KIRK);
+ showText(TX_FEA3N006);
+
+ if (!_vm->_awayMission.feather.tookKnife && !_vm->_awayMission.feather.field2e)
+ showText(TX_SPEAKER_MCCOY, TX_FEA3_008);
+
+ _vm->_awayMission.feather.tlaoxacTestPassed = true;
+ _roomVar.feather.tlaoxacUnconscious = true;
+ loadMapFile("feather3");
+}
+
+void Room::feather3UsePhaser() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA3_023);
+}
+
+void Room::feather3TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA3_005);
+}
+
+void Room::feather3TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA3_022);
+}
+
+void Room::feather3TalkToRedshirt() {
+ if (!_vm->_awayMission.redshirtDead)
+ showText(TX_SPEAKER_STRAGEY, TX_FEA3_032);
+}
+
+void Room::feather3TalkToTlaoxac() {
+ if (!_vm->_awayMission.feather.tlaoxacTestPassed && !_vm->_awayMission.redshirtDead && !_roomVar.feather.tlaoxacUnconscious) {
+ if (!_roomVar.feather.showedSnakeToTlaoxac)
+ showText(TX_SPEAKER_TLAOXAC, TX_FEA3_038);
+ else if (_vm->_awayMission.feather.numRocksThrownAtTlaoxac != 0)
+ showText(TX_SPEAKER_TLAOXAC, TX_FEA3_038);
+ else {
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_FEA3_001, TX_FEA3_002, TX_FEA3_003,
+ TX_BLANK
+ };
+ int choice = showText(choices);
+
+ if (choice == 0)
+ showText(TX_SPEAKER_TLAOXAC, TX_FEA3_037);
+ else if (choice == 1)
+ showText(TX_SPEAKER_TLAOXAC, TX_FEA3_042);
+ else if (choice == 2) { // Accidentally insulted Quetzecoatl
+ showText(TX_SPEAKER_TLAOXAC, TX_FEA3_040);
+ _vm->_awayMission.disableInput = true;
+ loadActorAnimC(OBJECT_TLAOXAC, "s5r3aj", -1, -1, &Room::feather3TlaoxacKilledRedshirt);
+ playMidiMusicTracks(2);
+ loadActorAnim(OBJECT_REDSHIRT, "s5r3rd");
+ _vm->_awayMission.redshirtDead = true;
+ } else
+ showText(TX_DIALOG_ERROR);
+ }
+ }
+}
+
+void Room::feather3TlaoxacKilledRedshirt() {
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::feather3UseMTricorderOnTlaoxac() {
+ if (_roomVar.feather.tlaoxacUnconscious)
+ mccoyScan(DIR_W, TX_FEA3_010);
+ else
+ mccoyScan(DIR_W, TX_FEA3_014);
+}
+
+void Room::feather3UseMedkitOnTlaoxac() {
+ if (_vm->_awayMission.feather.knockedOutTlaoxac)
+ showText(TX_SPEAKER_MCCOY, TX_FEA3_012);
+}
+
+void Room::feather3UseMedkitOnRedshirt() {
+ if (_vm->_awayMission.redshirtDead) {
+ // BUGFIX: Original voice clip (TX_FEA3_030) is someone who's clearly not Kelley
+ // saying "he's dead, Jim". He recorded the line a few other times, so use one of
+ // those instead.
+ mccoyScan(DIR_N, TX_LOVA_100);
+ }
+}
+
+void Room::feather3UseMedkitAnywhere() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA3_006);
+}
+
+void Room::feather3UseMTricorderOnLight() {
+ mccoyScan(DIR_W, TX_FEA3_013);
+}
+
+void Room::feather3UseSTricorderOnLight() {
+ spockScan(DIR_W, TX_FEA3_019);
+}
+
+void Room::feather3UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_FEA3_021);
+}
+
+void Room::feather3GetKnife() {
+ _vm->_awayMission.feather.missionScore += 1;
+ walkCrewmanC(OBJECT_KIRK, 0x57, 0xb4, &Room::feather3ReachedKnife);
+ _vm->_awayMission.disableInput = true;
+}
+
+void Room::feather3ReachedKnife() {
+ loadActorAnimC(OBJECT_KIRK, "s5r1kg", -1, -1, &Room::feather3PickedUpKnife);
+ _vm->_awayMission.timers[1] = 20;
+}
+
+void Room::feather3Timer1Expired() {
+ giveItem(OBJECT_IKNIFE);
+ loadActorStandAnim(OBJECT_KNIFE);
+}
+
+void Room::feather3PickedUpKnife() {
+ _vm->_awayMission.disableInput = false;
+ loadActorStandAnim(OBJECT_KIRK);
+ showText(TX_FEA3N010);
+}
+
+void Room::feather3LookAtSpock() {
+ if (!_vm->_awayMission.feather.knockedOutTlaoxac && !_vm->_awayMission.feather.tlaoxacTestPassed)
+ showText(TX_FEA3N002);
+ else // ENHANCEMENT: Originally did nothing here. Fall back to default behaviour in the engine.
+ _vm->_awayMission.rdfStillDoDefaultAction = true;
+}
+
+void Room::feather3LookAtRedshirt() {
+ if (_vm->_awayMission.redshirtDead)
+ showText(TX_FEA3N005);
+ else
+ showText(TX_FEA3N012);
+}
+
+void Room::feather3LookAtTlaoxac() {
+ if (_vm->_awayMission.feather.knockedOutTlaoxac)
+ showText(TX_FEA3N003);
+ else
+ showText(TX_FEA3N007);
+}
+
+void Room::feather3LookAtLight() {
+ showText(TX_FEA3N001);
+}
+
+void Room::feather3LookAtMccoy() {
+ showText(TX_FEA3N000);
+}
+void Room::feather3LookAtKnife() {
+ showText(TX_FEA3N011);
}
}
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index cca19c4..95f343c 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1782,12 +1782,8 @@ RoomAction feather0ActionList[] = {
{ {ACTION_USE, OBJECT_IMTRICOR, 8, 0}, &Room::feather0UseMTricorderOnQuetzecoatl },
};
-extern const RoomAction feather1ActionList[], feather2ActionList[];
-extern const int feather1NumActions, feather2NumActions;
-
-RoomAction feather3ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::feather3Tick1 },
-};
+extern const RoomAction feather1ActionList[], feather2ActionList[], feather3ActionList[];
+extern const int feather1NumActions, feather2NumActions, feather3NumActions;
RoomAction feather4ActionList[] = {
{ {ACTION_TICK, 1, 0, 0}, &Room::feather4Tick1 },
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 4dab29d..15d20ae 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -105,6 +105,7 @@ enum GameStringIDs {
TX_SPEAKER_STRAGEY,
TX_SPEAKER_QUETZECOATL,
+ TX_SPEAKER_TLAOXAC,
TX_BRIDU146,
@@ -1744,6 +1745,64 @@ enum GameStringIDs {
TX_FEA2N008,
+ TX_FEA3_001,
+ TX_FEA3_002,
+ TX_FEA3_003,
+ TX_FEA3_004,
+ TX_FEA3_005,
+ TX_FEA3_006,
+ TX_FEA3_007,
+ TX_FEA3_008,
+ TX_FEA3_009,
+ TX_FEA3_010,
+ TX_FEA3_011,
+ TX_FEA3_012,
+ TX_FEA3_013,
+ TX_FEA3_014,
+ TX_FEA3_015,
+ TX_FEA3_016,
+ TX_FEA3_017,
+ TX_FEA3_018,
+ TX_FEA3_019,
+ TX_FEA3_020,
+ TX_FEA3_021,
+ TX_FEA3_022,
+ TX_FEA3_023,
+ TX_FEA3_024,
+ TX_FEA3_025,
+ TX_FEA3_026,
+ TX_FEA3_027,
+ TX_FEA3_028,
+ TX_FEA3_029,
+ TX_FEA3_030,
+ TX_FEA3_031,
+ TX_FEA3_032,
+ TX_FEA3_033,
+ TX_FEA3_034,
+ TX_FEA3_035,
+ TX_FEA3_036,
+ TX_FEA3_037,
+ TX_FEA3_038,
+ TX_FEA3_039,
+ TX_FEA3_040,
+ TX_FEA3_041,
+ TX_FEA3_042,
+ TX_FEA3_043,
+ TX_FEA3_044,
+ TX_FEA3N000,
+ TX_FEA3N001,
+ TX_FEA3N002,
+ TX_FEA3N003,
+ TX_FEA3N004,
+ TX_FEA3N005,
+ TX_FEA3N006,
+ TX_FEA3N007,
+ // MISSING
+ TX_FEA3N010,
+ TX_FEA3N011,
+ TX_FEA3N012,
+
+
TX_SIN3_012,
@@ -1800,6 +1859,7 @@ const char * const g_gameStrings[] = {
"Lt. Stragey",
"Quetzecoatl",
+ "Tlaoxac",
"#BRID\\BRIDU146#Nothing to report, Captain.",
@@ -3426,6 +3486,63 @@ const char * const g_gameStrings[] = {
"#FEA2\\FEA2N008#You are in a densely vegetated area. The overgrowth blocks your view in all directions.",
+ "#FEA3\\FEA3_001#Well, does anyone have any suggestions?",
+ "#FEA3\\FEA3_002#Great Tlaoxac, I do not understand. Quetzecoatl says that his is the way of peace, yet you wish blood to be shed?",
+ "#FEA3\\FEA3_003#It is urgent that we speak to Quetzecoatl. His life may depend on it. Please stand aside and let us pass?",
+ "#FEA3\\FEA3_004#An intriguing solution Captain, but it is unlikely that he will accept green blood as a proper sacrifice.",
+ "#FEA3\\FEA3_005#Did you ever get the feeling that people don't like you?",
+ "#FEA3\\FEA3_006#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#FEA3\\FEA3_007#Get that thing away from me!",
+ "#FEA3\\FEA3_008#He dropped a knife, Jim!",
+ "#FEA3\\FEA3_009#He's out cold, Jim.I don't think we'll have any more trouble from him.",
+ "#FEA3\\FEA3_010#He's unconscious, Jim.",
+ "#FEA3\\FEA3_011#Hey! What do you think you're doing?",
+ "#FEA3\\FEA3_012#Jim, he'll be up in about a half hour. If I wake him now he's liable to retalliate for your thoughtless actions.", // TYPO
+ "#FEA3\\FEA3_013#These lamps are made up of insects much like fireflies, Jim.",
+ "#FEA3\\FEA3_014#Well, either this Aztec is a real flesh and blood human being, or I'm going to be retired as soon as I get back to the Enterprise.",
+ "#FEA3\\FEA3_015#Damn. He noticed.",
+ "#FEA3\\FEA3_016#Isn't that what they said to David before he fought Goliath?",
+ "#FEA3\\FEA3_017#Well, then send in David!",
+ "#FEA3\\FEA3_018#What about your famous nerve pinch?",
+ "#FEA3\\FEA3_019#Fascinating. These lights are actually swarms of bio-luminescent insects. I wonder how they are controlled.",
+ "#FEA3\\FEA3_020#Interesting. From the angle of its fangs and the shape of its mouth, it might have had the ability to inject its prey with venom at one time.", // TYPO
+ "#FEA3\\FEA3_021#Nothing unusual here, Captain.",
+ "#FEA3\\FEA3_022#Perhaps our host will be more reasonable now. I recommend trying to locate him, Captain.",
+ "#FEA3\\FEA3_023#Still inoperative, Captain.",
+ "#FEA3\\FEA3_024#Still inoperative, Captain.",
+ "#FEA3\\FEA3_025#That is not a logical act, Captain.",
+ "#FEA3\\FEA3_026#Captain, I do not think that I can defeat him in personal combat.",
+ "#FEA3\\FEA3_027#Doctor, may I remind you that David defeated Goliath?",
+ "#FEA3\\FEA3_028#It is unlikely to work on a man of that size, doctor.",
+ "#FEA3\\FEA3_029#All right! Time for some action. Let me show you how we did it at the Acad... uh, Captain, do you realize how BIG this guy is?",
+ "#FEA3\\FEA3_030#sHe's dead, Jim!", // TYPO
+ "#FEA3\\FEA3_031#I'm really not that anxious to get a good look at it, sir.",
+ "#FEA3\\FEA3_032#Nice planet. I kinda like it.",
+ "#FEA3\\FEA3_033#Ouch, sir.",
+ "#FEA3\\FEA3_034#Well, there is a doctor here, so I guess it's all right. They never told me I'd be doing this at the Academy.",
+ "#FEA3\\FEA3_035#Get back! You may not pass until you prove your worthiness.",
+ "#FEA3\\FEA3_036#I am Tlaoxac, priest of Quetzecoatl. Only one who knows his ways may approach his holy ground.",
+ "#FEA3\\FEA3_037#I do not understand your words, but it does not matter. You may not pass until blood is shed.",
+ "#FEA3\\FEA3_038#I will not listen to your deceitful ways.",
+ "#FEA3\\FEA3_039#Indeed you know the ways of Quetzecoatl But only a man of courage, one who will shed blood will pass.",
+ "#FEA3\\FEA3_040#None can threaten the great Quetzecoatl! You lie! Truly you do not serve the serpent-god. You may not pass!",
+ "#FEA3\\FEA3_041#None shall pass until blood is shed.", // TYPO
+ "#FEA3\\FEA3_042#Nonetheless, that is what must be done. Only men of courage are allowed into his presence.",
+ "#FEA3\\FEA3_043#Self-sacrifice is the noblest quality of humanity. You may go. Beware the monster in the water. You may have my knife to defend yourself.",
+ "#FEA3\\FEA3_044#You are truly a noble man, unlike the coward who was not capable of shedding his own blood. You may pass, but beware the man in the golden robe. He may lead you to your death. Use this knife to defend yourself.",
+ "#FEA3\\FEA3N000#McCoy seems rather nervous.",
+ "#FEA3\\FEA3N001#Primitive lights illuminate this savage scene.",
+ "#FEA3\\FEA3N002#Spock looks small compared to the great warrior.",
+ "#FEA3\\FEA3N003#The aztec warrior lies on the ground unconcious.",
+ "#FEA3\\FEA3N004#The snake enjoys snacking on you.",
+ "#FEA3\\FEA3N005#This was once a living member of your crew.",
+ "#FEA3\\FEA3N006#Tloaxac falls to the ground unconscious.",
+ "#FEA3\\FEA3N007#Towering over your security officer, holding a great spear in his huge hands, the great warrior Tlaoxac will let no one pass him.",
+ "#FEA3\\FEA3N010#You pick up the beautifully crafted knife.",
+ "#FEA3\\FEA3N011#You see a jewel encrusted, gold colored knife.",
+ "#FEA3\\FEA3N012#Your security officer looks at you for orders and, perhaps, inspiration.",
+
+
"#SIN3\\SIN3_012#Can't say I like the decor.",
Commit: 8aef8c453918a583e1d804bf371437fef3b08e8c
https://github.com/scummvm/scummvm/commit/8aef8c453918a583e1d804bf371437fef3b08e8c
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: FEATHER4
Changed paths:
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/feather4.cpp
engines/startrek/rooms/function_map.h
engines/startrek/text.h
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 4dc1595..52f2c05 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -149,7 +149,7 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
}
else if (name == "FEATHER4") {
_roomActionList = feather4ActionList;
- _numRoomActions = sizeof(feather4ActionList) / sizeof(RoomAction);
+ _numRoomActions = feather4NumActions;
}
else if (name == "FEATHER5") {
_roomActionList = feather5ActionList;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index e5a630d..434ac81 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1569,6 +1569,28 @@ public:
// FEATHER4
void feather4Tick1();
+ void feather4UseCommunicator();
+ void feather4UsePhaser();
+ void feather4UseSTricorderOnLight();
+ void feather4UseSTricorderOnMushroom();
+ void feather4UseSTricorderOnBush();
+ void feather4UseSTricorderAnywhere();
+ void feather4UseMTricorderOnLight();
+ void feather4UseMTricorderOnMushroom();
+ void feather4UseMTricorderAnywhere();
+ void feather4UseMedkitAnywhere();
+ void feather4TalkToMccoy();
+ void feather4TalkToSpock();
+ void feather4TalkToRedshirt();
+ void feather4LookAtEyes();
+ void feather4LookAnywhere();
+ void feather4LookAtMushroom();
+ void feather4LookAtBush();
+ void feather4LookAtLight();
+ void feather4LookAtKirk();
+ void feather4LookAtSpock();
+ void feather4LookAtMccoy();
+ void feather4LookAtRedshirt();
// FEATHER5
void feather5Tick1();
diff --git a/engines/startrek/rooms/feather4.cpp b/engines/startrek/rooms/feather4.cpp
index b2e92df..7629353 100644
--- a/engines/startrek/rooms/feather4.cpp
+++ b/engines/startrek/rooms/feather4.cpp
@@ -22,14 +22,142 @@
#include "startrek/room.h"
-#define OBJECT_8 8
-
-#define HOTSPOT_20 0x20
+#define HOTSPOT_EYES 0x20
+#define HOTSPOT_MUSHROOM 0x21
+#define HOTSPOT_BUSH 0x22
+#define HOTSPOT_LIGHT_1 0x23
+#define HOTSPOT_LIGHT_2 0x24
+#define HOTSPOT_LIGHT_3 0x25
namespace StarTrek {
+extern const RoomAction feather4ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::feather4Tick1 },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::feather4UseCommunicator },
+ { {ACTION_USE, OBJECT_IPHASERS, 0xff, 0}, &Room::feather4UsePhaser },
+ { {ACTION_USE, OBJECT_IPHASERK, 0xff, 0}, &Room::feather4UsePhaser },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_LIGHT_1, 0}, &Room::feather4UseSTricorderOnLight },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_LIGHT_2, 0}, &Room::feather4UseSTricorderOnLight },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_LIGHT_3, 0}, &Room::feather4UseSTricorderOnLight },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MUSHROOM, 0},&Room::feather4UseSTricorderOnMushroom },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_BUSH, 0}, &Room::feather4UseSTricorderOnBush },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::feather4UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_LIGHT_1, 0}, &Room::feather4UseMTricorderOnLight },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_LIGHT_2, 0}, &Room::feather4UseMTricorderOnLight },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_LIGHT_3, 0}, &Room::feather4UseMTricorderOnLight },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_MUSHROOM, 0},&Room::feather4UseMTricorderOnMushroom },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::feather4UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::feather4UseMedkitAnywhere },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::feather4TalkToMccoy },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::feather4TalkToSpock },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::feather4TalkToRedshirt },
+ { {ACTION_LOOK, HOTSPOT_EYES, 0, 0}, &Room::feather4LookAtEyes },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::feather4LookAnywhere },
+ { {ACTION_LOOK, HOTSPOT_MUSHROOM, 0, 0}, &Room::feather4LookAtMushroom },
+ { {ACTION_LOOK, HOTSPOT_BUSH, 0, 0}, &Room::feather4LookAtBush },
+ { {ACTION_LOOK, HOTSPOT_LIGHT_1, 0, 0}, &Room::feather4LookAtLight },
+ { {ACTION_LOOK, HOTSPOT_LIGHT_2, 0, 0}, &Room::feather4LookAtLight },
+ { {ACTION_LOOK, HOTSPOT_LIGHT_3, 0, 0}, &Room::feather4LookAtLight },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::feather4LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::feather4LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::feather4LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::feather4LookAtRedshirt },
+};
+
+extern const int feather4NumActions = sizeof(feather4ActionList) / sizeof(RoomAction);
+
+
void Room::feather4Tick1() {
+ playVoc("FEA4LOOP");
+ playMidiMusicTracks(27);
+}
+
+void Room::feather4UseCommunicator() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA4_005); // BUGFIX: Original played wrong audio file (TX_FEA4N008)
+}
+
+void Room::feather4UsePhaser() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA4_011);
+}
+
+void Room::feather4UseSTricorderOnLight() {
+ spockScan(DIR_W, TX_FEA4_010);
+}
+
+void Room::feather4UseSTricorderOnMushroom() {
+ spockScan(DIR_W, TX_FEA4_012);
+}
+
+void Room::feather4UseSTricorderOnBush() {
+ spockScan(DIR_W, TX_FEA4_009);
+}
+
+void Room::feather4UseSTricorderAnywhere() {
+ spockScan(DIR_W, TX_FEA4_008);
+}
+
+void Room::feather4UseMTricorderOnLight() {
+ mccoyScan(DIR_W, TX_FEA4_001);
+}
+
+void Room::feather4UseMTricorderOnMushroom() {
+ mccoyScan(DIR_W, TX_FEA4_003);
+}
+
+void Room::feather4UseMTricorderAnywhere() {
+ mccoyScan(DIR_W, TX_FEA4_006);
+}
+
+void Room::feather4UseMedkitAnywhere() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA4_002);
+}
+
+void Room::feather4TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA4_004);
+}
+
+void Room::feather4TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA4_007);
+}
+
+void Room::feather4TalkToRedshirt() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA4_013);
+}
+
+void Room::feather4LookAtEyes() {
+ showText(TX_FEA4N003);
+}
+
+void Room::feather4LookAnywhere() {
+ showText(TX_FEA4N008);
+}
+
+void Room::feather4LookAtMushroom() {
+ showText(TX_FEA4N001);
+}
+
+void Room::feather4LookAtBush() {
+ showText(TX_FEA4N000);
+}
+
+void Room::feather4LookAtLight() {
+ showText(TX_FEA4N002);
+}
+
+void Room::feather4LookAtKirk() {
+ showText(TX_FEA4N004);
+}
+
+void Room::feather4LookAtSpock() {
+ showText(TX_FEA4N007);
+}
+
+void Room::feather4LookAtMccoy() {
+ showText(TX_FEA4N006);
+}
+void Room::feather4LookAtRedshirt() {
+ showText(TX_FEA4N005);
}
}
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 95f343c..e0996f3 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -28,8 +28,6 @@
namespace StarTrek {
-// FIXME: calling a constructor in global scope not allowed in scummvm?
-
RoomAction demon0ActionList[] = {
{ {ACTION_TICK, 1, 0, 0}, &Room::demon0Tick1 },
{ {ACTION_TICK, 2, 0, 0}, &Room::demon0Tick2 },
@@ -1782,12 +1780,8 @@ RoomAction feather0ActionList[] = {
{ {ACTION_USE, OBJECT_IMTRICOR, 8, 0}, &Room::feather0UseMTricorderOnQuetzecoatl },
};
-extern const RoomAction feather1ActionList[], feather2ActionList[], feather3ActionList[];
-extern const int feather1NumActions, feather2NumActions, feather3NumActions;
-
-RoomAction feather4ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::feather4Tick1 },
-};
+extern const RoomAction feather1ActionList[], feather2ActionList[], feather3ActionList[], feather4ActionList[];
+extern const int feather1NumActions, feather2NumActions, feather3NumActions, feather4NumActions;
RoomAction feather5ActionList[] = {
{ {ACTION_TICK, 1, 0, 0}, &Room::feather5Tick1 },
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 15d20ae..f47fa5c 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -1803,6 +1803,30 @@ enum GameStringIDs {
TX_FEA3N012,
+ TX_FEA4_001,
+ TX_FEA4_002,
+ TX_FEA4_003,
+ TX_FEA4_004,
+ TX_FEA4_005,
+ TX_FEA4_006,
+ TX_FEA4_007,
+ TX_FEA4_008,
+ TX_FEA4_009,
+ TX_FEA4_010,
+ TX_FEA4_011,
+ TX_FEA4_012,
+ TX_FEA4_013,
+ TX_FEA4N000,
+ TX_FEA4N001,
+ TX_FEA4N002,
+ TX_FEA4N003,
+ TX_FEA4N004,
+ TX_FEA4N005,
+ TX_FEA4N006,
+ TX_FEA4N007,
+ TX_FEA4N008,
+
+
TX_SIN3_012,
@@ -3543,6 +3567,29 @@ const char * const g_gameStrings[] = {
"#FEA3\\FEA3N012#Your security officer looks at you for orders and, perhaps, inspiration.",
+ "#FEA4\\FEA4_001#A swarm of fireflies, Jim.",
+ "#FEA4\\FEA4_002#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#FEA4\\FEA4_003#I would strongly recommend against touching these, Jim. They are highly toxic.",
+ "#FEA4\\FEA4_004#It's getting a little cool out here. Keep warm. I don't want a bunch of sick crewmen when we get back to the ship. If we ever do get back to the ship.",
+ "#FEA4\\FEA4_005#Still out, Jim.",
+ "#FEA4\\FEA4_006#You're looking a little pale, Jim.",
+ "#FEA4\\FEA4_007#Fascinating. The trees are able to grow very close together in this forest, Captain.",
+ "#FEA4\\FEA4_008#I am reading a life form to the west, Captain.",
+ "#FEA4\\FEA4_009#It vaguely resembles the Terran Spanish Bayonette. The edges of the leaf are razor sharp and secrete a poisonous resin.",
+ "#FEA4\\FEA4_010#Small colonies of bio-luminescent insects, Captain.",
+ "#FEA4\\FEA4_011#They are not currently operational, Captain.",
+ "#FEA4\\FEA4_012#Tralxacian mushrooms. Their spores are highly toxic and are released if they are disturbed.",
+ "#FEA4\\FEA4_013#Does every planetside mission have this much adventure, Captain? Mind you, I can't say Mr. Quetzecoatl is making a very good impression on me...",
+ "#FEA4\\FEA4N000#A large fern fans the pathway.",
+ "#FEA4\\FEA4N001#Below this rock is a large growth of mushrooms.",
+ "#FEA4\\FEA4N002#Familiar glowing spheres light the path.",
+ "#FEA4\\FEA4N003#Feral red eyes glare out of the dark at you.",
+ "#FEA4\\FEA4N004#James T. Kirk realizes that every step increases their danger.",
+ "#FEA4\\FEA4N005#Lt. Stragey smiles as he strolls down the path.",
+ "#FEA4\\FEA4N006#McCoy doesn't want to be bothered right now.",
+ "#FEA4\\FEA4N007#Mr. Spock analyzes the surroundings.",
+ "#FEA4\\FEA4N008#You are in a dark forest. You can hear the flow of water to the northwest.",
+
"#SIN3\\SIN3_012#Can't say I like the decor.",
Commit: 5863f515f72904ab17f976a55264fc5a342fc90c
https://github.com/scummvm/scummvm/commit/5863f515f72904ab17f976a55264fc5a342fc90c
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: FEATHER5
Changed paths:
engines/startrek/action.h
engines/startrek/awaymission.cpp
engines/startrek/awaymission.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/feather4.cpp
engines/startrek/rooms/feather5.cpp
engines/startrek/rooms/function_map.h
engines/startrek/text.h
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
index 1416736..de20863 100644
--- a/engines/startrek/action.h
+++ b/engines/startrek/action.h
@@ -42,6 +42,11 @@ enum ActionTypes {
ACTION_TOUCHED_HOTSPOT = 7, // Second kind of "hotspot" only relevant when an object touches them
ACTION_TIMER_EXPIRED = 8,
+ ACTION_DONE_ANIM = 10,
+ ACTION_DONE_WALK = 12,
+
+ // TODO: remove these as redundant. They only still exist so I don't need to redo the
+ // manual spacing in the room action lists.
ACTION_FINISHED_ANIMATION = 10,
ACTION_FINISHED_WALKING = 12,
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 8c7f8db..819319e 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -613,16 +613,14 @@ void StarTrekEngine::handleAwayMissionAction() {
showTextbox("", getLoadedText(GROUNDTX_LOOK_SPOCK), 20, 20, TEXTCOLOR_YELLOW, 0);
else if (action.activeObject() == OBJECT_MCCOY)
showTextbox("", getLoadedText(GROUNDTX_LOOK_MCCOY), 20, 20, TEXTCOLOR_YELLOW, 0);
- else {
- if (action.activeObject() == OBJECT_REDSHIRT)
- showTextbox("", getLoadedText(GROUNDTX_LOOK_REDSHIRT), 20, 20, TEXTCOLOR_YELLOW, 0);
-
+ else if (action.activeObject() == OBJECT_REDSHIRT)
+ showTextbox("", getLoadedText(GROUNDTX_LOOK_REDSHIRT), 20, 20, TEXTCOLOR_YELLOW, 0);
+ else
// Show generic "nothing of note" text.
- // BUG? This text is also shown after looking at the redshirt. However, his
- // text is normally overridden on a per-mission basis, so perhaps this bug
- // never manifests itself?
+ // BUGFIX: originally this was shown after the redshirt's text as well.
+ // Though, the original game may not have used this default implementation
+ // anywhere...
showTextbox("", getLoadedText(GROUNDTX_LOOK_ANYWHERE), 20, 20, TEXTCOLOR_YELLOW, 0);
- }
break;
case ACTION_TALK:
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 8202ddb..06c8923 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -253,9 +253,11 @@ struct AwayMission {
bool tookKnife; // 0x2d
bool field2e; // 0x2e
byte numRocksThrownAtTlaoxac; // 0x2f
+ bool gotFern; // 0x30
bool holeBlocked; // 0x31
bool tlaoxacTestPassed; // 0x32
bool knockedOutTlaoxac; // 0x33
+ bool waterMonsterRetreated; // 0x34
bool showedSnakeToTlaoxac; // 0x35
int16 missionScore; // 0x36
} feather;
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 52f2c05..342bba9 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -153,7 +153,7 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
}
else if (name == "FEATHER5") {
_roomActionList = feather5ActionList;
- _numRoomActions = sizeof(feather5ActionList) / sizeof(RoomAction);
+ _numRoomActions = feather5NumActions;
}
else if (name == "FEATHER6") {
_roomActionList = feather6ActionList;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 434ac81..0e536b7 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1573,7 +1573,7 @@ public:
void feather4UsePhaser();
void feather4UseSTricorderOnLight();
void feather4UseSTricorderOnMushroom();
- void feather4UseSTricorderOnBush();
+ void feather4UseSTricorderOnFern();
void feather4UseSTricorderAnywhere();
void feather4UseMTricorderOnLight();
void feather4UseMTricorderOnMushroom();
@@ -1585,7 +1585,7 @@ public:
void feather4LookAtEyes();
void feather4LookAnywhere();
void feather4LookAtMushroom();
- void feather4LookAtBush();
+ void feather4LookAtFern();
void feather4LookAtLight();
void feather4LookAtKirk();
void feather4LookAtSpock();
@@ -1594,6 +1594,64 @@ public:
// FEATHER5
void feather5Tick1();
+ void feather5TouchedHotspot0();
+ void feather5UseSpockOnFern();
+ void feather5UseMccoyOnFern();
+ void feather5UseRedshirtOnFern();
+ void feather5UseRedshirtOnLeftExit();
+ void feather5RedshirtReachedLog();
+ void feather5RedshirtDeathFinished();
+ void feather5UseSpockOnLeftExit();
+ void feather5UseMccoyOnLeftExit();
+ void feather5UseSnakeOnKirk();
+ void feather5UseSnakeOnSpock();
+ void feather5UseSnakeOnMccoy();
+ void feather5UseSnakeOnRedshirt();
+ void feather5UseSnakeOnWater();
+ void feather5UseKnifeOnKirk();
+ void feather5UseKnifeOnSpock();
+ void feather5UseKnifeOnMccoy();
+ void feather5UseKnifeOnRedshirt();
+ void feather5UseKnifeOnWater();
+ void feather5UseKnifeOnMonster();
+ void feather5GetFern();
+ void feather5UseKnifeOnFern();
+ void feather5ReachedFern();
+ void feather5PickedUpFern();
+ void feather5UseFernOnMonster();
+ void feather5ReachedPositionToUseFern();
+ void feather5DoneThrowingFern();
+ void feather5FernFellIntoWater();
+ void feather5Timer1Expired();
+ void feather5UseRockOnSpock();
+ void feather5UseRockOnMccoy();
+ void feather5UseRockOnRedshirt();
+ void feather5UseCrewmanOnThrownFern();
+ void feather5UseSpockOnMonster();
+ void feather5UseMccoyOnMonster();
+ void feather5UseRedshirtOnMonster();
+ void feather5UsePhaser();
+ void feather5LookAnywhere();
+ void feather5LookAtLog();
+ void feather5LookAtWater();
+ void feather5LookAtFern();
+ void feather5LookAtInsects();
+ void feather5LookAtCave();
+ void feather5LookAtMonster();
+ void feather5LookAtSpock();
+ void feather5LookAtKirk();
+ void feather5LookAtMccoy();
+ void feather5LookAtRedshirt();
+ void feather5TalkToMccoy();
+ void feather5TalkToSpock();
+ void feather5TalkToRedshirt();
+ void feather5UseMTricorderOnWater();
+ void feather5UseMTricorderOnMonster();
+ void feather5UseSTricorderOnMonster();
+ void feather5UseSTricorderAnywhere();
+ void feather5UseSTricorderOnWater();
+ void feather5UseSTricorderOnFern();
+ void feather5UseMedkitAnywhere();
// FEATHER6
void feather6Tick1();
diff --git a/engines/startrek/rooms/feather4.cpp b/engines/startrek/rooms/feather4.cpp
index 7629353..69d3f37 100644
--- a/engines/startrek/rooms/feather4.cpp
+++ b/engines/startrek/rooms/feather4.cpp
@@ -24,7 +24,7 @@
#define HOTSPOT_EYES 0x20
#define HOTSPOT_MUSHROOM 0x21
-#define HOTSPOT_BUSH 0x22
+#define HOTSPOT_FERN 0x22
#define HOTSPOT_LIGHT_1 0x23
#define HOTSPOT_LIGHT_2 0x24
#define HOTSPOT_LIGHT_3 0x25
@@ -40,7 +40,7 @@ extern const RoomAction feather4ActionList[] = {
{ {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_LIGHT_2, 0}, &Room::feather4UseSTricorderOnLight },
{ {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_LIGHT_3, 0}, &Room::feather4UseSTricorderOnLight },
{ {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MUSHROOM, 0},&Room::feather4UseSTricorderOnMushroom },
- { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_BUSH, 0}, &Room::feather4UseSTricorderOnBush },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_FERN, 0}, &Room::feather4UseSTricorderOnFern },
{ {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::feather4UseSTricorderAnywhere },
{ {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_LIGHT_1, 0}, &Room::feather4UseMTricorderOnLight },
{ {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_LIGHT_2, 0}, &Room::feather4UseMTricorderOnLight },
@@ -54,7 +54,7 @@ extern const RoomAction feather4ActionList[] = {
{ {ACTION_LOOK, HOTSPOT_EYES, 0, 0}, &Room::feather4LookAtEyes },
{ {ACTION_LOOK, 0xff, 0, 0}, &Room::feather4LookAnywhere },
{ {ACTION_LOOK, HOTSPOT_MUSHROOM, 0, 0}, &Room::feather4LookAtMushroom },
- { {ACTION_LOOK, HOTSPOT_BUSH, 0, 0}, &Room::feather4LookAtBush },
+ { {ACTION_LOOK, HOTSPOT_FERN, 0, 0}, &Room::feather4LookAtFern },
{ {ACTION_LOOK, HOTSPOT_LIGHT_1, 0, 0}, &Room::feather4LookAtLight },
{ {ACTION_LOOK, HOTSPOT_LIGHT_2, 0, 0}, &Room::feather4LookAtLight },
{ {ACTION_LOOK, HOTSPOT_LIGHT_3, 0, 0}, &Room::feather4LookAtLight },
@@ -88,7 +88,7 @@ void Room::feather4UseSTricorderOnMushroom() {
spockScan(DIR_W, TX_FEA4_012);
}
-void Room::feather4UseSTricorderOnBush() {
+void Room::feather4UseSTricorderOnFern() {
spockScan(DIR_W, TX_FEA4_009);
}
@@ -136,7 +136,7 @@ void Room::feather4LookAtMushroom() {
showText(TX_FEA4N001);
}
-void Room::feather4LookAtBush() {
+void Room::feather4LookAtFern() {
showText(TX_FEA4N000);
}
diff --git a/engines/startrek/rooms/feather5.cpp b/engines/startrek/rooms/feather5.cpp
index f7a2cd1..843604d 100644
--- a/engines/startrek/rooms/feather5.cpp
+++ b/engines/startrek/rooms/feather5.cpp
@@ -22,14 +22,399 @@
#include "startrek/room.h"
-#define OBJECT_8 8
+#define OBJECT_MONSTER 8
+#define OBJECT_THROWN_FERN 10
-#define HOTSPOT_20 0x20
+// The log in the middle of this room has odd "hitboxes". The top half is hotspot 0x20,
+// while the bottom half is hotspot 0x22. You need to use the redshirt on the top half to
+// cross over. Not sure why this is.
+
+#define HOTSPOT_LEFT_EXIT 0x20
+#define HOTSPOT_FERN 0x21
+#define HOTSPOT_LOG 0x22
+#define HOTSPOT_WATER 0x23
+#define HOTSPOT_INSECTS_1 0x24
+#define HOTSPOT_INSECTS_2 0x25
+#define HOTSPOT_CAVE 0x26
namespace StarTrek {
+extern const RoomAction feather5ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::feather5Tick1 },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::feather5TouchedHotspot0 },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_FERN, 0}, &Room::feather5UseSpockOnFern },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_FERN, 0}, &Room::feather5UseMccoyOnFern },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_FERN, 0}, &Room::feather5UseRedshirtOnFern },
+
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_LEFT_EXIT, 0}, &Room::feather5UseRedshirtOnLeftExit },
+ { {ACTION_DONE_WALK, 8, 0, 0}, &Room::feather5RedshirtReachedLog },
+ { {ACTION_DONE_ANIM, 8, 0, 0}, &Room::feather5RedshirtDeathFinished },
+
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_LEFT_EXIT, 0}, &Room::feather5UseSpockOnLeftExit },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_LEFT_EXIT, 0}, &Room::feather5UseMccoyOnLeftExit },
+ { {ACTION_USE, OBJECT_ISNAKE, OBJECT_KIRK, 0}, &Room::feather5UseSnakeOnKirk },
+ { {ACTION_USE, OBJECT_ISNAKE, OBJECT_SPOCK, 0}, &Room::feather5UseSnakeOnSpock },
+ { {ACTION_USE, OBJECT_ISNAKE, OBJECT_MCCOY, 0}, &Room::feather5UseSnakeOnMccoy },
+ { {ACTION_USE, OBJECT_ISNAKE, OBJECT_REDSHIRT, 0}, &Room::feather5UseSnakeOnRedshirt },
+ { {ACTION_USE, OBJECT_ISNAKE, HOTSPOT_WATER, 0}, &Room::feather5UseSnakeOnWater },
+ { {ACTION_USE, OBJECT_IKNIFE, OBJECT_KIRK, 0}, &Room::feather5UseKnifeOnKirk },
+ { {ACTION_USE, OBJECT_IKNIFE, OBJECT_SPOCK, 0}, &Room::feather5UseKnifeOnSpock },
+ { {ACTION_USE, OBJECT_IKNIFE, OBJECT_MCCOY, 0}, &Room::feather5UseKnifeOnMccoy },
+ { {ACTION_USE, OBJECT_IKNIFE, OBJECT_REDSHIRT, 0}, &Room::feather5UseKnifeOnRedshirt },
+ { {ACTION_USE, OBJECT_IKNIFE, HOTSPOT_WATER, 0}, &Room::feather5UseKnifeOnWater },
+ { {ACTION_USE, OBJECT_IKNIFE, OBJECT_MONSTER, 0}, &Room::feather5UseKnifeOnMonster },
+ { {ACTION_GET, HOTSPOT_FERN, 0, 0}, &Room::feather5GetFern },
+
+ { {ACTION_USE, OBJECT_IKNIFE, HOTSPOT_FERN, 0}, &Room::feather5UseKnifeOnFern },
+ { {ACTION_DONE_WALK, 1, 0, 0}, &Room::feather5ReachedFern },
+ { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::feather5PickedUpFern },
+
+ { {ACTION_USE, OBJECT_IFERN, OBJECT_MONSTER, 0}, &Room::feather5UseFernOnMonster },
+ { {ACTION_USE, OBJECT_IFERN, HOTSPOT_WATER, 0}, &Room::feather5UseFernOnMonster },
+ { {ACTION_DONE_WALK, 2, 0, 0}, &Room::feather5ReachedPositionToUseFern },
+ { {ACTION_DONE_ANIM, 2, 0, 0}, &Room::feather5DoneThrowingFern },
+ { {ACTION_DONE_ANIM, 3, 0, 0}, &Room::feather5FernFellIntoWater },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::feather5Timer1Expired },
+
+ { {ACTION_USE, OBJECT_IROCK, OBJECT_SPOCK, 0}, &Room::feather5UseRockOnSpock },
+ { {ACTION_USE, OBJECT_IROCK, OBJECT_MCCOY, 0}, &Room::feather5UseRockOnMccoy },
+ { {ACTION_USE, OBJECT_IROCK, OBJECT_REDSHIRT, 0}, &Room::feather5UseRockOnRedshirt },
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_THROWN_FERN, 0}, &Room::feather5UseCrewmanOnThrownFern },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_THROWN_FERN, 0}, &Room::feather5UseCrewmanOnThrownFern },
+ { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_THROWN_FERN, 0},&Room::feather5UseCrewmanOnThrownFern },
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_MONSTER, 0}, &Room::feather5UseSpockOnMonster },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_MONSTER, 0}, &Room::feather5UseMccoyOnMonster },
+ { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_MONSTER, 0}, &Room::feather5UseRedshirtOnMonster },
+ { {ACTION_USE, OBJECT_IPHASERS, 0xff, 0}, &Room::feather5UsePhaser },
+ { {ACTION_USE, OBJECT_IPHASERK, 0xff, 0}, &Room::feather5UsePhaser },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::feather5LookAnywhere },
+ { {ACTION_LOOK, HOTSPOT_LOG, 0, 0}, &Room::feather5LookAtLog },
+ { {ACTION_LOOK, HOTSPOT_WATER, 0, 0}, &Room::feather5LookAtWater },
+ { {ACTION_LOOK, HOTSPOT_FERN, 0, 0}, &Room::feather5LookAtFern },
+ { {ACTION_LOOK, HOTSPOT_INSECTS_1, 0, 0}, &Room::feather5LookAtInsects },
+ { {ACTION_LOOK, HOTSPOT_INSECTS_2, 0, 0}, &Room::feather5LookAtInsects },
+ { {ACTION_LOOK, HOTSPOT_CAVE, 0, 0}, &Room::feather5LookAtCave },
+ { {ACTION_LOOK, OBJECT_MONSTER, 0, 0}, &Room::feather5LookAtMonster },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::feather5LookAtSpock },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::feather5LookAtKirk },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::feather5LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::feather5LookAtRedshirt },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::feather5TalkToMccoy },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::feather5TalkToSpock },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::feather5TalkToRedshirt },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_WATER, 0}, &Room::feather5UseMTricorderOnWater },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MONSTER, 0}, &Room::feather5UseMTricorderOnMonster },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_MONSTER, 0}, &Room::feather5UseSTricorderOnMonster },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::feather5UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_WATER, 0}, &Room::feather5UseSTricorderOnWater },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_FERN, 0}, &Room::feather5UseSTricorderOnFern },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::feather5UseMedkitAnywhere },
+};
+
+extern const int feather5NumActions = sizeof(feather5ActionList) / sizeof(RoomAction);
+
+
void Room::feather5Tick1() {
+ playVoc("FEA5LOOP");
+ playMidiMusicTracks(29);
+
+ if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ loadActorAnim(OBJECT_MONSTER, "s5r5os", 0x4e, 0xa4);
+ else
+ loadMapFile("feath5b");
+}
+
+void Room::feather5TouchedHotspot0() { // Approached the log
+ if (!_vm->_awayMission.feather.waterMonsterRetreated) {
+ showText(TX_SPEAKER_SPOCK, TX_FEA5_005);
+ if (!_vm->_awayMission.redshirtDead)
+ showText(TX_SPEAKER_STRAGEY, TX_FEA5_033);
+ }
+}
+
+void Room::feather5UseSpockOnFern() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA5_004);
+}
+
+void Room::feather5UseMccoyOnFern() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA5_009);
+}
+
+void Room::feather5UseRedshirtOnFern() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA5_035);
+}
+
+void Room::feather5UseRedshirtOnLeftExit() {
+ if (!_vm->_awayMission.feather.waterMonsterRetreated) {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA5_034);
+ _vm->_awayMission.disableInput = true;
+ loadMapFile("feath5b");
+ walkCrewmanC(OBJECT_REDSHIRT, 0x8f, 0x64, &Room::feather5RedshirtReachedLog);
+ }
+}
+
+void Room::feather5RedshirtReachedLog() {
+ playMidiMusicTracks(2);
+ playVoc("TENTICL2");
+ loadActorAnim(OBJECT_MONSTER, "s5r5oh", 0x4e, 0xa4);
+ loadActorAnimC(OBJECT_REDSHIRT, "s5r5ol", 0x8f, 0x64, &Room::feather5RedshirtDeathFinished);
+ _vm->_awayMission.feather.waterMonsterRetreated = true;
+ _vm->_awayMission.redshirtDead = true;
+}
+
+void Room::feather5RedshirtDeathFinished() {
+ loadActorStandAnim(OBJECT_REDSHIRT);
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::feather5UseSpockOnLeftExit() {
+ if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ showText(TX_SPEAKER_SPOCK, TX_FEA5_002);
+}
+
+void Room::feather5UseMccoyOnLeftExit() {
+ if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ showText(TX_SPEAKER_MCCOY, TX_FEA5_015);
+}
+
+void Room::feather5UseSnakeOnKirk() {
+ showText(TX_SPEAKER_KIRK, TX_FEA5N010);
+}
+
+void Room::feather5UseSnakeOnSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA5_032);
+}
+
+void Room::feather5UseSnakeOnMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA5_020);
+}
+
+void Room::feather5UseSnakeOnRedshirt() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA5_040);
+}
+
+void Room::feather5UseSnakeOnWater() {
+ showText(TX_FEA5N011);
+ loseItem(OBJECT_ISNAKE);
+}
+
+void Room::feather5UseKnifeOnKirk() {
+ // ENHANCEMENT: Originally showed TX_DEM0_020 here ("Jim, are you out of your mind?")
+ // However, there is an unused audio file for text that otherwise only appears in the
+ // mac version. (DOS floppy version has yet another variation for this text.)
+ // We'll use that unused audio file here...
+ showText(TX_SPEAKER_KIRK, TX_FEA5_001);
+}
+
+void Room::feather5UseKnifeOnSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA5_029);
+}
+
+void Room::feather5UseKnifeOnMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA5_008);
+}
+
+void Room::feather5UseKnifeOnRedshirt() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA5_039);
+}
+
+void Room::feather5UseKnifeOnWater() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA5_018);
+}
+
+void Room::feather5UseKnifeOnMonster() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA5_006);
+}
+
+void Room::feather5GetFern() {
+ showText(TX_FEA5N008);
+}
+
+void Room::feather5UseKnifeOnFern() {
+ if (_vm->_awayMission.feather.gotFern)
+ showText(TX_FEA5N015);
+ else {
+ walkCrewmanC(OBJECT_KIRK, 0x106, 0x8a, &Room::feather5ReachedFern);
+ _vm->_awayMission.disableInput = true;
+ }
+}
+
+void Room::feather5ReachedFern() {
+ loadActorAnimC(OBJECT_KIRK, "s5r5kf", -1, -1, &Room::feather5PickedUpFern);
+}
+
+void Room::feather5PickedUpFern() {
+ _vm->_awayMission.disableInput = false;
+ loadActorStandAnim(OBJECT_KIRK);
+ giveItem(OBJECT_IFERN);
+ _vm->_awayMission.feather.gotFern = true;
+}
+
+
+void Room::feather5UseFernOnMonster() {
+ // BUG: Infinite score mechanism. Just keep throwing ferns into the water.
+ _vm->_awayMission.feather.missionScore += 2;
+ walkCrewmanC(OBJECT_KIRK, 0x106, 0x8a, &Room::feather5ReachedPositionToUseFern);
+ _vm->_awayMission.disableInput = true;
+}
+
+void Room::feather5ReachedPositionToUseFern() {
+ loadActorAnimC(OBJECT_KIRK, "s5r5kt", -1, -1, &Room::feather5DoneThrowingFern);
+ loadActorAnimC(OBJECT_THROWN_FERN, "s5r5pt", 0xe6, 0x52, &Room::feather5FernFellIntoWater);
+}
+
+void Room::feather5DoneThrowingFern() {
+ _vm->_awayMission.disableInput = false;
+ loadActorStandAnim(OBJECT_KIRK);
+ loseItem(OBJECT_IFERN);
+ _vm->_awayMission.feather.gotFern = false;
+}
+
+void Room::feather5FernFellIntoWater() {
+ if (!_vm->_awayMission.feather.waterMonsterRetreated) {
+ _vm->_awayMission.feather.waterMonsterRetreated = true;
+ _vm->_awayMission.timers[1] = 20;
+ loadActorStandAnim(OBJECT_MONSTER);
+ loadMapFile("feath5b");
+ }
+}
+
+void Room::feather5Timer1Expired() { // Spock explains that the creature retreated
+ showText(TX_SPEAKER_SPOCK, TX_FEA5_025);
+}
+
+
+void Room::feather5UseRockOnSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA5_027);
+}
+
+void Room::feather5UseRockOnMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA5_019);
+}
+
+void Room::feather5UseRockOnRedshirt() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA5_038);
+}
+
+void Room::feather5UseCrewmanOnThrownFern() {
+ // This might be unused? The object in question (OBJECT_THROWN_FERN) shouldn't be
+ // visible while player control is active.
+ showText(TX_FEA5N003);
+}
+
+void Room::feather5UseSpockOnMonster() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA5_003);
+}
+
+void Room::feather5UseMccoyOnMonster() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA5_016);
+}
+
+void Room::feather5UseRedshirtOnMonster() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA5_037);
+}
+
+void Room::feather5UsePhaser() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA5_028);
+}
+
+void Room::feather5LookAnywhere() {
+ showText(TX_FEA5N012);
+}
+
+void Room::feather5LookAtLog() {
+ showText(TX_FEA5N007);
+}
+
+void Room::feather5LookAtWater() {
+ showText(TX_FEA5N009);
+}
+
+void Room::feather5LookAtFern() {
+ showText(TX_FEA5N014);
+}
+
+void Room::feather5LookAtInsects() {
+ showText(TX_FEA5N005);
+}
+
+void Room::feather5LookAtCave() {
+ showText(TX_FEA5N013);
+}
+
+void Room::feather5LookAtMonster() {
+ showText(TX_FEA5N000);
+}
+
+void Room::feather5LookAtSpock() {
+ showText(TX_FEA5N006);
+}
+
+void Room::feather5LookAtKirk() {
+ if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ showText(TX_FEA5N001);
+ else // ENHANCEMENT: Fall back to default behaviour instead of doing nothing
+ _vm->_awayMission.rdfStillDoDefaultAction = true;
+}
+
+void Room::feather5LookAtMccoy() {
+ if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ showText(TX_FEA5N002);
+ else // ENHANCEMENT: Fall back to default behaviour instead of doing nothing
+ _vm->_awayMission.rdfStillDoDefaultAction = true;
+}
+
+void Room::feather5LookAtRedshirt() {
+ if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ showText(TX_FEA5N004);
+ else // ENHANCEMENT: Fall back to default behaviour instead of doing nothing
+ _vm->_awayMission.rdfStillDoDefaultAction = true;
+}
+
+void Room::feather5TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA5_007);
+}
+
+void Room::feather5TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA5_022);
+}
+
+void Room::feather5TalkToRedshirt() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA5_036);
+}
+
+void Room::feather5UseMTricorderOnWater() {
+ if (_vm->_awayMission.feather.waterMonsterRetreated)
+ mccoyScan(DIR_W, TX_FEA5_011);
+ else
+ mccoyScan(DIR_W, TX_FEA5_014);
+}
+
+void Room::feather5UseMTricorderOnMonster() {
+ mccoyScan(DIR_W, TX_FEA5_013);
+}
+
+void Room::feather5UseSTricorderOnMonster() {
+ spockScan(DIR_W, TX_FEA5_024);
+}
+
+void Room::feather5UseSTricorderAnywhere() {
+ spockScan(DIR_W, TX_FEA5_026);
+}
+
+void Room::feather5UseSTricorderOnWater() {
+ if (_vm->_awayMission.feather.waterMonsterRetreated)
+ spockScan(DIR_W, TX_FEA5_031);
+ else
+ spockScan(DIR_W, TX_FEA5_030);
+}
+
+void Room::feather5UseSTricorderOnFern() {
+ spockScan(DIR_N, TX_FEA5_023);
+}
+void Room::feather5UseMedkitAnywhere() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA5_010);
}
}
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index e0996f3..ab53a11 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1782,10 +1782,8 @@ RoomAction feather0ActionList[] = {
extern const RoomAction feather1ActionList[], feather2ActionList[], feather3ActionList[], feather4ActionList[];
extern const int feather1NumActions, feather2NumActions, feather3NumActions, feather4NumActions;
-
-RoomAction feather5ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::feather5Tick1 },
-};
+extern const RoomAction feather5ActionList[];
+extern const int feather5NumActions;
RoomAction feather6ActionList[] = {
{ {ACTION_TICK, 1, 0, 0}, &Room::feather6Tick1 },
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index f47fa5c..efa4abb 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -1827,6 +1827,64 @@ enum GameStringIDs {
TX_FEA4N008,
+ TX_FEA5_001,
+ TX_FEA5_002,
+ TX_FEA5_003,
+ TX_FEA5_004,
+ TX_FEA5_005,
+ TX_FEA5_006,
+ TX_FEA5_007,
+ TX_FEA5_008,
+ TX_FEA5_009,
+ TX_FEA5_010,
+ TX_FEA5_011,
+ // MISSING
+ TX_FEA5_013,
+ TX_FEA5_014,
+ TX_FEA5_015,
+ TX_FEA5_016,
+ // MISSING
+ TX_FEA5_018,
+ TX_FEA5_019,
+ TX_FEA5_020,
+ TX_FEA5_021, // UNUSED
+ TX_FEA5_022,
+ TX_FEA5_023,
+ TX_FEA5_024,
+ TX_FEA5_025,
+ TX_FEA5_026,
+ TX_FEA5_027,
+ TX_FEA5_028,
+ TX_FEA5_029,
+ TX_FEA5_030,
+ TX_FEA5_031,
+ TX_FEA5_032,
+ TX_FEA5_033,
+ TX_FEA5_034,
+ TX_FEA5_035,
+ TX_FEA5_036,
+ TX_FEA5_037,
+ TX_FEA5_038,
+ TX_FEA5_039,
+ TX_FEA5_040,
+ TX_FEA5N000,
+ TX_FEA5N001,
+ TX_FEA5N002,
+ TX_FEA5N003,
+ TX_FEA5N004,
+ TX_FEA5N005,
+ TX_FEA5N006,
+ TX_FEA5N007,
+ TX_FEA5N008,
+ TX_FEA5N009,
+ TX_FEA5N010,
+ TX_FEA5N011,
+ TX_FEA5N012,
+ TX_FEA5N013,
+ TX_FEA5N014,
+ TX_FEA5N015,
+
+
TX_SIN3_012,
@@ -3591,6 +3649,62 @@ const char * const g_gameStrings[] = {
"#FEA4\\FEA4N008#You are in a dark forest. You can hear the flow of water to the northwest.",
+ "#FEA5\\FEA5_001#This is a very finely crafted knife.",
+ "#FEA5\\FEA5_002#Captain, I believe it would be suicide to try crossing the log while the creature is near.",
+ "#FEA5\\FEA5_003#Captain, I do not believe that my service to Starfleet includes, as humans say, 'throwing my life away'.",
+ "#FEA5\\FEA5_004#Captain, I would recommend using something to cut the plant. There are numerous small thorns along the stem.",
+ "#FEA5\\FEA5_005#Captain, it would not be wise to cross while the creature is near.",
+ "#FEA5\\FEA5_006#Due to the small size of the knife, I doubt it would harm such a large creature.",
+ "#FEA5\\FEA5_007#Anyone for a campfire?",
+ "#FEA5\\FEA5_008#Captain, I'll declare you unfit to command if you keep this up!",
+ "#FEA5\\FEA5_009#Damn! That's gonna hurt Jim. Take a look at those thorns. You might try cutting that with something.", // TYPO
+ "#FEA5\\FEA5_010#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#FEA5\\FEA5_011#I'm not reading that creature anymore, Jim.",
+ "#FEA5\\FEA5_013#It's some kind of squid, and it doesn't look very friendly.",
+ "#FEA5\\FEA5_014#Jim! There's some kind of an aquatic creature down there.",
+ "#FEA5\\FEA5_015#Jim, that's ludicrous!",
+ "#FEA5\\FEA5_016#Jim, we've been friends a long time, but... I mean... you're not serious?",
+ "#FEA5\\FEA5_018#Jim, with our phasers not working, we may need that knife to protect ourselves!", // TYPO
+ "#FEA5\\FEA5_019#This planet is starting to get to me. I'm sure something just hit me.",
+ "#FEA5\\FEA5_020#You weren't a snake handler in your previous life were you? I don't like snakes.", // TYPO
+ "#FEA5\\FEA5_021#Good throw, Captain. However, I think the creature was merely startled. It may return in a little while.",
+ "#FEA5\\FEA5_022#I recommend caution here, Captain.",
+ "#FEA5\\FEA5_023#It appears that the leaves are slightly toxic. I would not recommend touching it for an extended amount of time, Captain.",
+ "#FEA5\\FEA5_024#It is some kind of mollusk; the river seems to be its home, and it is carnivorous, eating land and river based forms of life.",
+ "#FEA5\\FEA5_025#It would appear that the plant secretes a chemical that is a natural repellent to the creature. It has retreated far down stream, Captain.",
+ "#FEA5\\FEA5_026#Nothing unusual here, Captain.",
+ "#FEA5\\FEA5_027#Please stop that Captain. I have enough distractions from Dr. McCoy.",
+ "#FEA5\\FEA5_028#Still inoperative, Captain.",
+ "#FEA5\\FEA5_029#Thank you Captain, but Vulcans do not use knives.",
+ "#FEA5\\FEA5_030#The tricorder registers a lifeform, a large marine creature, lurking just below the surface of the water.",
+ "#FEA5\\FEA5_031#The tricorder shows nothing unusual, Captain. The creature is still down stream.",
+ "#FEA5\\FEA5_032#Was there a reason for that, Captain?",
+ "#FEA5\\FEA5_033#Captain, perhaps I should try to cross first.",
+ "#FEA5\\FEA5_034#I'll give it a try, Captain.",
+ "#FEA5\\FEA5_035#It looks like that plant fights back sir. You might want to use something to cut it loose.",
+ "#FEA5\\FEA5_036#Reminds me of a planet I was stationed on once. The native girls were real friendly. Ensign Shou had his bachelor party there, great time. You ever been to Omicron Draconis, Captain?",
+ "#FEA5\\FEA5_037#Sir, I finished second in my weight class in wrestling at the Academy, but I don't think that thing's in my weight class.",
+ "#FEA5\\FEA5_038#Sir, you dropped your rock.",
+ "#FEA5\\FEA5_039#Thanks Captain, but I can take care of myself. I finished second in my weight class in wrestling at the Academy. You keep the knife.",
+ "#FEA5\\FEA5_040#You're weird, sir.",
+ "#FEA5\\FEA5N000#A pair of eyes are all that you can see of the rest of this creature. Most of it is hidden beneath the murky water.",
+ "#FEA5\\FEA5N001#Captain Kirk is looking at the big creature in the water.",
+ "#FEA5\\FEA5N002#Dr. McCoy is looking at the big creature in the water.",
+ "#FEA5\\FEA5N003#He will not do that.",
+ "#FEA5\\FEA5N004#Lt. Stragey is looking at the big creature in the water.",
+ "#FEA5\\FEA5N005#Luminescent insects swarm near a large tree.",
+ "#FEA5\\FEA5N006#Mr. Spock is looking ahead to a cave opening on the other side of the log.",
+ "#FEA5\\FEA5N007#The log looks quite old but sturdy.",
+ "#FEA5\\FEA5N008#The plant is tough. You will need something sharp to cut it.",
+ "#FEA5\\FEA5N009#The river water is too muddy to get an idea of its depth or what may be beneath the surface.",
+ "#FEA5\\FEA5N010#The snake bites you.",
+ "#FEA5\\FEA5N011#The snake disapears beneath the surface of the water.",
+ "#FEA5\\FEA5N012#There is a slow muddy river blocking your path. A strong thick log serves as a footbridge. The river is unmoving, and the heat and stillness are oppressive.",
+ "#FEA5\\FEA5N013#There seems to be a lit cave beyond the log.",
+ "#FEA5\\FEA5N014#This plant has a rather thick stem and prickly leaves.", // TYPO
+ "#FEA5\\FEA5N015#You already have a piece of the plant.",
+
+
"#SIN3\\SIN3_012#Can't say I like the decor.",
Commit: 6486579e6a594e93521d4a359265377989cfc5f2
https://github.com/scummvm/scummvm/commit/6486579e6a594e93521d4a359265377989cfc5f2
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fixes to sprites when off-screen
There was a problem implementing FEATHER6 where a thrown rock goes
off-screen, which breaks an assertion that "rect.height() != 0" when
drawing it.
Changed paths:
engines/startrek/graphics.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 9dc484f..753605a 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -517,7 +517,7 @@ void Graphics::drawAllSprites(bool updateScreen) {
for (int j = 0; j < numDirtyRects; j++) {
Common::Rect rect1 = spr->drawRect.findIntersectingRect(dirtyRects[j]);
- if (!rect1.isEmpty()) {
+ if (rect1.width() != 0 && rect1.height() != 0) {
if (mustRedrawSprite)
rect2 = getRectEncompassing(rect1, rect2);
else
@@ -538,6 +538,9 @@ void Graphics::drawAllSprites(bool updateScreen) {
// Copy dirty rects to screen
for (int j = 0; j < numDirtyRects; j++) {
Common::Rect &r = dirtyRects[j];
+ if (r.width() == 0 || r.height() == 0)
+ continue;
+
int offset = r.left + r.top * SCREEN_WIDTH;
_vm->_system->copyRectToScreen((byte *)surface.getPixels() + offset, SCREEN_WIDTH, r.left, r.top, r.width(), r.height());
}
Commit: b02124b5eeea60a0a8dde14318cb53d416912e79
https://github.com/scummvm/scummvm/commit/b02124b5eeea60a0a8dde14318cb53d416912e79
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: FEATHER6
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/feather6.cpp
engines/startrek/rooms/function_map.h
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 06c8923..d38fde4 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -243,6 +243,7 @@ struct AwayMission {
} mudd;
struct {
+ bool diedFromStalactites; // 0x29
// 0: initial state
// 1: one rock thrown at it
// 2: two rocks thrown at it (low enough to climb up)
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 342bba9..c1d7216 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -157,7 +157,7 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
}
else if (name == "FEATHER6") {
_roomActionList = feather6ActionList;
- _numRoomActions = sizeof(feather6ActionList) / sizeof(RoomAction);
+ _numRoomActions = feather6NumActions;
}
else if (name == "FEATHER7") {
_roomActionList = feather7ActionList;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 0e536b7..a307cf4 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1655,6 +1655,56 @@ public:
// FEATHER6
void feather6Tick1();
+ void feather6TouchedHotspot0();
+ void feather6UseSpockOnCrystals();
+ void feather6UseMccoyOnCrystals();
+ void feather6UseRedshirtOnCrystals();
+ void feather6UseRockOnStalactites();
+ void feather6ReachedPositionToThrowRock();
+ void feather6DoneThrowingRock();
+ void feather6KirkDiedFromStalactites();
+ void feather6UseRockOnCrystals();
+ void feather6ReachedCrystalsWithRock();
+ void feather6Tick();
+ void feather6HitCrystalsWithRockFirstTime();
+ void feather6HitCrystalsWithRockSecondTime();
+ void feather6UseRockOnStalagmites();
+ void feather6UseRockAnywhere();
+ void feather6UseKnifeOnStalagmites();
+ void feather6UseKnifeAnywhere();
+ void feather6UseKnifeOnMccoy();
+ void feather6UseKnifeOnSpock();
+ void feather6UseKnifeOnRedshirt();
+ void feather6UseCrystalAnywhere();
+ void feather6UseSnakeAnywhere();
+ void feather6UseMedkitAnywhere();
+ void feather6UsePhaser();
+ void feather6LookAtEastExit();
+ void feather6LookAnywhere();
+ void feather6LookAtRocks();
+ void feather6LookAtStalagmites();
+ void feather6LookAtCrystals();
+ void feather6LookAtKirk();
+ void feather6LookAtSpock();
+ void feather6LookAtMccoy();
+ void feather6LookAtRedshirt();
+ void feather6LookAtStalactites();
+ void feather6TalkToMccoy();
+ void feather6TalkToRedshirt();
+ void feather6TalkToSpock();
+ void feather6UseMTricorderOnEastExit();
+ void feather6UseMTricorderOnRocks();
+ void feather6UseSTricorderOnEastExit();
+ void feather6UseSTricorderAnywhere();
+ void feather6UseSTricorderOnRocks();
+ void feather6UseSTricorderOnCrystals();
+ void feather6UseSTricorderOnStalactites();
+ void feather6UseSTricorderOnStalagmites();
+ void feather6GetCrystals();
+ void feather6UseKnifeOnCrystals();
+ void feather6ReachedCrystalsWithKnife();
+ void feather6DoneCuttingCrystals();
+ void feather6Timer4Expired();
// FEATHER7
void feather7Tick1();
@@ -1788,6 +1838,9 @@ private:
// feather2
bool showedSnakeToTlaoxac; // 0xca
bool tlaoxacUnconscious; // 0xcb
+
+ // feather6
+ bool usedRockOnCrystalsOnce;
} feather;
diff --git a/engines/startrek/rooms/feather6.cpp b/engines/startrek/rooms/feather6.cpp
index 227007a..c757814 100644
--- a/engines/startrek/rooms/feather6.cpp
+++ b/engines/startrek/rooms/feather6.cpp
@@ -22,14 +22,363 @@
#include "startrek/room.h"
-#define OBJECT_8 8
+#define OBJECT_CRYSTALS 8
+#define OBJECT_STALACTITES 9
+#define OBJECT_THROWN_STONE 10
-#define HOTSPOT_20 0x20
+#define HOTSPOT_EAST_EXIT 0x20
+#define HOTSPOT_ROCKS 0x21
+#define HOTSPOT_STALACTITES 0x22
+#define HOTSPOT_STALAGMITES 0x23
namespace StarTrek {
+extern const RoomAction feather6ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::feather6Tick1 },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::feather6TouchedHotspot0 },
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_CRYSTALS, 0}, &Room::feather6UseSpockOnCrystals },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_CRYSTALS, 0}, &Room::feather6UseMccoyOnCrystals },
+ { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_CRYSTALS, 0}, &Room::feather6UseRedshirtOnCrystals },
+
+ { {ACTION_USE, OBJECT_IROCK, OBJECT_STALACTITES, 0}, &Room::feather6UseRockOnStalactites },
+ { {ACTION_USE, OBJECT_IROCK, HOTSPOT_STALACTITES, 0}, &Room::feather6UseRockOnStalactites },
+ { {ACTION_DONE_WALK, 1, 0, 0}, &Room::feather6ReachedPositionToThrowRock },
+ { {ACTION_DONE_ANIM, 7, 0, 0}, &Room::feather6DoneThrowingRock },
+ { {ACTION_DONE_ANIM, 2, 0, 0}, &Room::feather6KirkDiedFromStalactites },
+
+ { {ACTION_USE, OBJECT_IROCK, OBJECT_CRYSTALS, 0}, &Room::feather6UseRockOnCrystals },
+ { {ACTION_DONE_WALK, 4, 0, 0}, &Room::feather6ReachedCrystalsWithRock },
+ { {ACTION_TICK, 0xff, 0xff, 0xff}, &Room::feather6Tick },
+ { {ACTION_DONE_ANIM, 10, 0, 0}, &Room::feather6HitCrystalsWithRockFirstTime },
+ { {ACTION_DONE_ANIM, 9, 0, 0}, &Room::feather6HitCrystalsWithRockSecondTime },
+
+ { {ACTION_USE, OBJECT_IROCK, HOTSPOT_STALAGMITES, 0}, &Room::feather6UseRockOnStalagmites },
+ { {ACTION_USE, OBJECT_IROCK, HOTSPOT_EAST_EXIT, 0}, &Room::feather6UseRockOnStalagmites },
+ { {ACTION_USE, OBJECT_IROCK, 0xff, 0}, &Room::feather6UseRockAnywhere },
+ { {ACTION_USE, OBJECT_IKNIFE, HOTSPOT_STALAGMITES, 0},&Room::feather6UseKnifeOnStalagmites },
+ { {ACTION_USE, OBJECT_IKNIFE, 0xff, 0}, &Room::feather6UseKnifeAnywhere },
+ { {ACTION_USE, OBJECT_IKNIFE, OBJECT_MCCOY, 0}, &Room::feather6UseKnifeOnMccoy },
+ { {ACTION_USE, OBJECT_IKNIFE, OBJECT_SPOCK, 0}, &Room::feather6UseKnifeOnSpock },
+ { {ACTION_USE, OBJECT_IKNIFE, OBJECT_REDSHIRT, 0}, &Room::feather6UseKnifeOnRedshirt },
+ { {ACTION_USE, OBJECT_ICRYSTAL, 0xff, 0}, &Room::feather6UseCrystalAnywhere },
+ { {ACTION_USE, OBJECT_ISNAKE, 0xff, 0}, &Room::feather6UseSnakeAnywhere },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::feather6UseMedkitAnywhere },
+ { {ACTION_USE, OBJECT_IPHASERS, 0xff, 0}, &Room::feather6UsePhaser },
+ { {ACTION_USE, OBJECT_IPHASERK, 0xff, 0}, &Room::feather6UsePhaser },
+ { {ACTION_LOOK, HOTSPOT_EAST_EXIT, 0, 0}, &Room::feather6LookAtEastExit },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::feather6LookAnywhere },
+ { {ACTION_LOOK, HOTSPOT_ROCKS, 0, 0}, &Room::feather6LookAtRocks },
+ { {ACTION_LOOK, HOTSPOT_STALAGMITES, 0, 0}, &Room::feather6LookAtStalagmites },
+ { {ACTION_LOOK, OBJECT_CRYSTALS, 0, 0}, &Room::feather6LookAtCrystals },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::feather6LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::feather6LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::feather6LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::feather6LookAtRedshirt },
+ { {ACTION_LOOK, HOTSPOT_STALACTITES, 0, 0}, &Room::feather6LookAtStalactites },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::feather6TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::feather6TalkToRedshirt },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::feather6TalkToSpock },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_EAST_EXIT, 0},&Room::feather6UseMTricorderOnEastExit },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_ROCKS, 0}, &Room::feather6UseMTricorderOnRocks },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_EAST_EXIT, 0},&Room::feather6UseSTricorderOnEastExit },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::feather6UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_ROCKS, 0}, &Room::feather6UseSTricorderOnRocks },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_CRYSTALS, 0}, &Room::feather6UseSTricorderOnCrystals },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_STALACTITES, 0},&Room::feather6UseSTricorderOnStalactites },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_STALAGMITES, 0},&Room::feather6UseSTricorderOnStalagmites },
+ { {ACTION_GET, OBJECT_CRYSTALS, 0, 0}, &Room::feather6GetCrystals },
+
+ { {ACTION_USE, OBJECT_IKNIFE, OBJECT_CRYSTALS, 0}, &Room::feather6UseKnifeOnCrystals },
+ { {ACTION_DONE_WALK, 2, 0, 0}, &Room::feather6ReachedCrystalsWithKnife },
+ { {ACTION_DONE_ANIM, 3, 0, 0}, &Room::feather6DoneCuttingCrystals },
+ { {ACTION_TIMER_EXPIRED, 4, 0, 0}, &Room::feather6Timer4Expired },
+
+ // ENHANCEMENTs: Also add entries for OBJECT_STALACTITES, not just HOTSPOT_STALACTITES
+ { {ACTION_LOOK, OBJECT_STALACTITES, 0, 0}, &Room::feather6LookAtStalactites },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_STALACTITES, 0}, &Room::feather6UseSTricorderOnStalactites },
+};
+
+extern const int feather6NumActions = sizeof(feather6ActionList) / sizeof(RoomAction);
+
+
void Room::feather6Tick1() {
+ playVoc("FEA6LOOP");
+ playMidiMusicTracks(27);
+ loadActorAnim(OBJECT_CRYSTALS, "s5r6cx", 0x8a, 0x91);
+ loadActorAnim(OBJECT_STALACTITES, "s5r6ts", 0x90, 0x25);
+}
+
+void Room::feather6TouchedHotspot0() { // McCoy warns you not to go back to the river
+ showText(TX_SPEAKER_MCCOY, TX_FEA6_014);
+}
+
+void Room::feather6UseSpockOnCrystals() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA6_020);
+}
+
+void Room::feather6UseMccoyOnCrystals() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA6_009);
+}
+
+void Room::feather6UseRedshirtOnCrystals() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA6_040);
+}
+
+
+void Room::feather6UseRockOnStalactites() {
+ _vm->_awayMission.disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x94, 0x97, &Room::feather6ReachedPositionToThrowRock);
+}
+
+void Room::feather6ReachedPositionToThrowRock() {
+ loadActorAnim2(OBJECT_KIRK, "s5r1kt");
+ loadActorAnimC(OBJECT_THROWN_STONE, "s5r1ru", 0x96, 0x4e, &Room::feather6DoneThrowingRock);
+}
+
+void Room::feather6DoneThrowingRock() {
+ playSoundEffectIndex(SND_BLANK_0b);
+ loadActorAnim2(OBJECT_STALACTITES, "s5r6tf");
+ loadActorAnimC(OBJECT_KIRK, "s5r6kd", -1, -1, &Room::feather6KirkDiedFromStalactites);
+ playMidiMusicTracks(1);
+}
+
+void Room::feather6KirkDiedFromStalactites() {
+ _vm->_awayMission.feather.missionScore -= 3;
+ _vm->_awayMission.feather.diedFromStalactites = true;
+ _vm->_awayMission.disableInput = false;
+ showText(TX_FEA6N000);
+ showText(TX_FEA6N004);
+ loadRoomIndex(7, 5);
+}
+
+void Room::feather6UseRockOnCrystals() {
+ _vm->_awayMission.disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x9a, 0x97, &Room::feather6ReachedCrystalsWithRock);
+}
+
+void Room::feather6ReachedCrystalsWithRock() {
+ _vm->_awayMission.timers[2] = 174;
+ loadActorAnim2(OBJECT_STALACTITES, "s5r6tm");
+ if (!_roomVar.feather.usedRockOnCrystalsOnce) {
+ _roomVar.feather.usedRockOnCrystalsOnce = true;
+ loadActorAnimC(OBJECT_KIRK, "s5r6kr", -1, -1, &Room::feather6HitCrystalsWithRockFirstTime);
+ } else
+ loadActorAnimC(OBJECT_KIRK, "s5r6kr", -1, -1, &Room::feather6HitCrystalsWithRockSecondTime);
+}
+
+void Room::feather6Tick() {
+ if (_vm->_awayMission.timers[2] == 55 || _vm->_awayMission.timers[2] == 89 || _vm->_awayMission.timers[2] == 119)
+ playSoundEffectIndex(SND_BLANK_0b);
+}
+
+void Room::feather6HitCrystalsWithRockFirstTime() {
+ _vm->_awayMission.disableInput = false;
+ loadActorStandAnim(OBJECT_KIRK);
+ showText(TX_SPEAKER_KIRK, TX_FEA6_001);
+}
+
+void Room::feather6HitCrystalsWithRockSecondTime() {
+ loadActorAnimC(OBJECT_KIRK, "s5r6kd", -1, -1, &Room::feather6KirkDiedFromStalactites);
+ loadActorAnim2(OBJECT_STALACTITES, "s5r6tf");
+ playMidiMusicTracks(0);
+}
+
+void Room::feather6UseRockOnStalagmites() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA6_019);
+}
+
+void Room::feather6UseRockAnywhere() {
+ // ENHANCEMENT: There were two implementations of this function. The first (which took
+ // precedence) showed TX_FEA6N009, a generic "nothing happens" text. The second is
+ // Spock advising you not to use rocks, which is more interesting.
+ showText(TX_SPEAKER_SPOCK, TX_FEA6_021);
+}
+
+void Room::feather6UseKnifeOnStalagmites() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA6_028);
+}
+
+void Room::feather6UseKnifeAnywhere() {
+ showText(TX_FEA6N010);
+}
+
+void Room::feather6UseKnifeOnMccoy() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA6_039); // BUGFIX: Speaker is Stragey (not Spock)
+}
+
+void Room::feather6UseKnifeOnSpock() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA6_039); // BUGFIX: Speaker is Stragey (not Spock)
+}
+
+void Room::feather6UseKnifeOnRedshirt() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA6_039); // BUGFIX: Speaker is Stragey (not Spock)
+}
+
+void Room::feather6UseCrystalAnywhere() {
+ showText(TX_FEA6N015);
+}
+
+void Room::feather6UseSnakeAnywhere() {
+ showText(TX_FEA6N001);
+}
+
+void Room::feather6UseMedkitAnywhere() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA6_011);
+}
+
+void Room::feather6UsePhaser() {
+ showText(TX_SPEAKER_SPOCK, TX_FEA6_023);
+}
+
+void Room::feather6LookAtEastExit() {
+ showText(TX_FEA6N016);
+}
+
+void Room::feather6LookAnywhere() {
+ showText(TX_FEA6N003);
+}
+
+void Room::feather6LookAtRocks() {
+ showText(TX_FEA6N014);
+}
+
+void Room::feather6LookAtStalagmites() {
+ showText(TX_FEA6N013);
+}
+
+void Room::feather6LookAtCrystals() {
+ showText(TX_FEA6N005);
+}
+
+void Room::feather6LookAtKirk() {
+ showText(TX_FEA6N007);
+}
+
+void Room::feather6LookAtSpock() {
+ showText(TX_FEA6N011);
+}
+
+void Room::feather6LookAtMccoy() {
+ showText(TX_FEA6N002);
+}
+
+void Room::feather6LookAtRedshirt() {
+ showText(TX_FEA6N008);
+}
+
+void Room::feather6LookAtStalactites() {
+ showText(TX_FEA6N012);
+ showText(TX_SPEAKER_SPOCK, TX_FEA6_034);
+ showText(TX_SPEAKER_MCCOY, TX_FEA6_017);
+ showText(TX_SPEAKER_SPOCK, TX_FEA6_033);
+
+ // BUG: Choice 2 (TX_FEA6_004) doesn't match with audio at all.
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_FEA6_008, TX_FEA6_006, TX_FEA6_004,
+ TX_BLANK
+ };
+ int choice = showText(choices);
+
+ if (choice == 0)
+ showText(TX_SPEAKER_SPOCK, TX_FEA6_032);
+ else if (choice == 1)
+ showText(TX_SPEAKER_SPOCK, TX_FEA6_036);
+ else
+ showText(TX_SPEAKER_SPOCK, TX_FEA6_037);
+}
+
+void Room::feather6TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_FEA6_013);
+}
+
+void Room::feather6TalkToRedshirt() {
+ showText(TX_SPEAKER_STRAGEY, TX_FEA6_042);
+ showText(TX_SPEAKER_KIRK, TX_FEA6_002);
+ showText(TX_SPEAKER_STRAGEY, TX_FEA6_041);
+ showText(TX_SPEAKER_MCCOY, TX_FEA6_016);
+ showText(TX_SPEAKER_STRAGEY, TX_FEA6_043);
+}
+
+void Room::feather6TalkToSpock() {
+ if (!_vm->_awayMission.redshirtDead)
+ showText(TX_SPEAKER_SPOCK, TX_FEA6_035);
+ else {
+ showText(TX_SPEAKER_SPOCK, TX_FEA6_038);
+
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_FEA6_003, TX_FEA6_005, TX_FEA6_007,
+ TX_BLANK
+ };
+ int choice = showText(choices);
+
+ if (choice == 0)
+ showText(TX_SPEAKER_SPOCK, TX_FEA6_029);
+ else if (choice == 1)
+ showText(TX_SPEAKER_SPOCK, TX_FEA6_030);
+ else
+ showText(TX_SPEAKER_SPOCK, TX_FEA6_031);
+ }
+}
+
+void Room::feather6UseMTricorderOnEastExit() {
+ mccoyScan(DIR_E, TX_FEA6_012);
+}
+
+void Room::feather6UseMTricorderOnRocks() {
+ // ENHANCEMENT: Original didn't play tricorder noise, etc
+ mccoyScan(DIR_E, TX_FEA6_015);
+}
+
+void Room::feather6UseSTricorderOnEastExit() {
+ spockScan(DIR_E, TX_FEA6_024);
+}
+
+void Room::feather6UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_FEA6_022);
+}
+
+void Room::feather6UseSTricorderOnRocks() {
+ spockScan(DIR_N, TX_FEA6_018);
+}
+
+void Room::feather6UseSTricorderOnCrystals() {
+ spockScan(DIR_N, TX_FEA6_027);
+}
+
+void Room::feather6UseSTricorderOnStalactites() {
+ spockScan(DIR_N, TX_FEA6_025);
+}
+
+void Room::feather6UseSTricorderOnStalagmites() {
+ spockScan(DIR_N, TX_FEA6_026);
+}
+
+void Room::feather6GetCrystals() {
+ showText(TX_FEA6N020);
+}
+
+void Room::feather6UseKnifeOnCrystals() {
+ _vm->_awayMission.disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x9a, 0x97, &Room::feather6ReachedCrystalsWithKnife);
+}
+
+void Room::feather6ReachedCrystalsWithKnife() {
+ loadActorAnimC(OBJECT_KIRK, "s5r6kp", -1, -1, &Room::feather6DoneCuttingCrystals);
+ _vm->_awayMission.timers[4] = 122;
+}
+
+void Room::feather6DoneCuttingCrystals() {
+ _vm->_awayMission.disableInput = false;
+ loadActorStandAnim(OBJECT_KIRK);
+ _vm->_awayMission.feather.missionScore += 1;
+ giveItem(OBJECT_ICRYSTAL);
+ showText(TX_FEA6N017);
+}
+void Room::feather6Timer4Expired() { // Crystal disappears when timer 4 expires
+ loadActorStandAnim(OBJECT_CRYSTALS);
}
}
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index ab53a11..1bc32ff 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1782,12 +1782,8 @@ RoomAction feather0ActionList[] = {
extern const RoomAction feather1ActionList[], feather2ActionList[], feather3ActionList[], feather4ActionList[];
extern const int feather1NumActions, feather2NumActions, feather3NumActions, feather4NumActions;
-extern const RoomAction feather5ActionList[];
-extern const int feather5NumActions;
-
-RoomAction feather6ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::feather6Tick1 },
-};
+extern const RoomAction feather5ActionList[], feather6ActionList[];
+extern const int feather5NumActions, feather6NumActions;
RoomAction feather7ActionList[] = {
{ {ACTION_TICK, 1, 0, 0}, &Room::feather7Tick1 },
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index efa4abb..0cc26b5 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -1885,6 +1885,71 @@ enum GameStringIDs {
TX_FEA5N015,
+ TX_FEA6_001,
+ TX_FEA6_002,
+ TX_FEA6_003,
+ TX_FEA6_004,
+ TX_FEA6_005,
+ TX_FEA6_006,
+ TX_FEA6_007,
+ TX_FEA6_008,
+ TX_FEA6_009,
+ TX_FEA6_011,
+ TX_FEA6_012,
+ TX_FEA6_013,
+ TX_FEA6_014,
+ TX_FEA6_015,
+ TX_FEA6_016,
+ TX_FEA6_017,
+ TX_FEA6_018,
+ TX_FEA6_019,
+ TX_FEA6_020,
+ TX_FEA6_021,
+ TX_FEA6_022,
+ TX_FEA6_023,
+ TX_FEA6_024,
+ TX_FEA6_025,
+ TX_FEA6_026,
+ TX_FEA6_027,
+ TX_FEA6_028,
+ TX_FEA6_029,
+ TX_FEA6_030,
+ TX_FEA6_031,
+ TX_FEA6_032,
+ TX_FEA6_033,
+ TX_FEA6_034,
+ TX_FEA6_035,
+ TX_FEA6_036,
+ TX_FEA6_037,
+ TX_FEA6_038,
+ TX_FEA6_039,
+ TX_FEA6_040,
+ TX_FEA6_041,
+ TX_FEA6_042,
+ TX_FEA6_043,
+ TX_FEA6N000,
+ TX_FEA6N001,
+ TX_FEA6N002,
+ TX_FEA6N003,
+ TX_FEA6N004,
+ TX_FEA6N005,
+ TX_FEA6N006,
+ TX_FEA6N007,
+ TX_FEA6N008,
+ TX_FEA6N009,
+ TX_FEA6N010,
+ TX_FEA6N011,
+ TX_FEA6N012,
+ TX_FEA6N013,
+ TX_FEA6N014,
+ TX_FEA6N015,
+ TX_FEA6N016,
+ TX_FEA6N017,
+ TX_FEA6N020,
+ TX_FEA6N028,
+ TX_FEA6N029,
+
+
TX_SIN3_012,
@@ -3705,6 +3770,71 @@ const char * const g_gameStrings[] = {
"#FEA5\\FEA5N015#You already have a piece of the plant.",
+ "#FEA6\\FEA6_001#I think I can get it with a few more blows.",
+ "#FEA6\\FEA6_002#Have you ever made it up the face of Half Dome, Lieutenant?",
+ "#FEA6\\FEA6_003#Perhaps we should hold onto that hope, Mr. Spock, that a civilised being will not kill for trivial motives.",
+ "#FEA6\\FEA6_004#Sometimes I feel like I'm the Captain of a nursery school.",
+ "#FEA6\\FEA6_005#That creature was quite real Mr. Spock. We will discuss this with our host, when we see him.",
+ "#FEA6\\FEA6_006#Then, gentlemen, I would advise you to stop arguing.",
+ "#FEA6\\FEA6_007#Unfortunately, human history is full of people who did not practice what they preached. Quetzecoatl is just one in a long line of them.",
+ "#FEA6\\FEA6_008#Will you two morons stop arguing just once!",
+ "#FEA6\\FEA6_009#Damn it Jim, I'm a surgeon not a geologist.",
+ "#FEA6\\FEA6_011#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#FEA6\\FEA6_012#It would appear that our tentacled friend wants dessert. You can't go back that way, unless you enjoy being eaten.",
+ "#FEA6\\FEA6_013#I've lost any appetite I may have had for squid, Jim",
+ "#FEA6\\FEA6_014#Jim! Going back across that river would be insane.",
+ "#FEA6\\FEA6_015#Well, they're not organic. What did you think they were, calcified tribbles?",
+ "#FEA6\\FEA6_016#Captains and security officers. They don't realize how fragile the human body can be.",
+ "#FEA6\\FEA6_017#Well isn't that just great!",
+ "#FEA6\\FEA6_018#Fascinating. These rocks are limestone, but contain an unusually high content of heavy metals. There are dilithium crystals here, but in a very raw form.",
+ "#FEA6\\FEA6_019#I fail to see any logic in that action, Captain It may also cause stalactites to fall.",
+ "#FEA6\\FEA6_020#I would suggest using something to pry that loose, Captain.",
+ "#FEA6\\FEA6_021#It is unwise to use a rock here, Captain.",
+ "#FEA6\\FEA6_022#My tricorder indicates unusual energy patterns in this direction, Captain.",
+ "#FEA6\\FEA6_023#Still inoperative, Captain.",
+ "#FEA6\\FEA6_024#The creature is still there, Captain.",
+ "#FEA6\\FEA6_025#These stalactites were made from limestone deposits. They took millennia to form.",
+ "#FEA6\\FEA6_026#These stalagmites were made from limestone deposits. They took millennia to form.",
+ "#FEA6\\FEA6_027#This appears to be a formation of raw dilithium crystals, Captain.",
+ "#FEA6\\FEA6_028#This illogical action would only dull the knife.",
+ "#FEA6\\FEA6_029#Agreed, Captain.",
+ "#FEA6\\FEA6_030#This whole experience feels like a test. The equivalent of 20th Century earth lab rats running through a maze.",
+ "#FEA6\\FEA6_031#I would wait until we meet him before judging him, Captain.",
+ "#FEA6\\FEA6_032#Captain, I cannot speak for Dr. McCoy, but my intelligence quotient is far higher than humans...",
+ "#FEA6\\FEA6_033#Doctor, I would point out that your voice could also trigger such a collapse.",
+ "#FEA6\\FEA6_034#I should warn you that the stalactites could collapse quite easily. Any sudden motion could cause large quantities of stalactites to fall on us.",
+ "#FEA6\\FEA6_035#I would suggest we continue on, Captain. It would not be logical to endanger ourselves by remaining here.",
+ "#FEA6\\FEA6_036#It would seem to be a prudent course of action Captain, if Doctor McCoy would agree.",
+ "#FEA6\\FEA6_037#Really? That's fascinating Captain.",
+ "#FEA6\\FEA6_038#There is a contradiction, Captain. If Quetzecoatl is really an entity of peace, then Lt. Stragey should not have died.",
+ "#FEA6\\FEA6_039#Captain, have we done something wrong?",
+ "#FEA6\\FEA6_040#I don't think I'll be able to get a good grip sir. You might try prying it loose.",
+ "#FEA6\\FEA6_041#If we ever get back to Earth, one hundred credits says I'll beat you.",
+ "#FEA6\\FEA6_042#Reminds me of some spelunking I did on Hades IV. Ever do any climbing, Captain?",
+ "#FEA6\\FEA6_043#Sure we do. That's the challenge.",
+ "#FEA6\\FEA6N000#A stalagtite breaks loose and falls. You are mortally injured and die.",
+ "#FEA6\\FEA6N001#An interesting, but useless, manuever.",
+ "#FEA6\\FEA6N002#As usual, Dr. McCoy looks annoyed by the mission. ",
+ "#FEA6\\FEA6N003#Darkness, leading into the unknown.",
+ "#FEA6\\FEA6N004#However, a strange force envelopes your body...",
+ "#FEA6\\FEA6N005#It is a large cluster of crystals.",
+ "#FEA6\\FEA6N006#It's Game Over man...",
+ "#FEA6\\FEA6N007#James Kirk remembers the last time he was in a cave, and is glad that this one seems more peaceful.",
+ "#FEA6\\FEA6N008#Lieutenant Stragey looks nervously at the stalactites hovering precariously above you.",
+ "#FEA6\\FEA6N009#Nothing happens.",
+ "#FEA6\\FEA6N010#Nothing happens.",
+ "#FEA6\\FEA6N011#Spock is his usual stoic self.",
+ "#FEA6\\FEA6N012#Stalactites descend from the ceiling.",
+ "#FEA6\\FEA6N013#Stalagmites rise from the floor of the cave.",
+ "#FEA6\\FEA6N014#They appear to be ordinary rocks. Spock's tricorder might say otherwise.",
+ "#FEA6\\FEA6N015#This is one place where dilithium crystals don't seem to be very useful.",
+ "#FEA6\\FEA6N016#This is the way that you entered the cave. If you leave this way, the tentacled creature that attack you will probably try to get a second course for its dinner.",
+ "#FEA6\\FEA6N017#You have one dilithium crystal, in raw form.",
+ "#FEA6\\FEA6N020#You will need something to pry it loose.",
+ "#FEA6\\FEA6N028#You manage to pry loose one dilithium crystal.",
+ "#FEA6\\FEA6N029#You scratch your initials. No dilithium crystals were found.",
+
+
"#SIN3\\SIN3_012#Can't say I like the decor.",
Commit: 0c41f30f58b1e4c072b8ae695acc09ebcc3ae26b
https://github.com/scummvm/scummvm/commit/0c41f30f58b1e4c072b8ae695acc09ebcc3ae26b
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: FEATHER6 Typos
Changed paths:
engines/startrek/text.h
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 0cc26b5..e58e750 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -1894,6 +1894,7 @@ enum GameStringIDs {
TX_FEA6_007,
TX_FEA6_008,
TX_FEA6_009,
+ // MISSING
TX_FEA6_011,
TX_FEA6_012,
TX_FEA6_013,
@@ -1933,7 +1934,7 @@ enum GameStringIDs {
TX_FEA6N003,
TX_FEA6N004,
TX_FEA6N005,
- TX_FEA6N006,
+ TX_FEA6N006, // UNUSED
TX_FEA6N007,
TX_FEA6N008,
TX_FEA6N009,
@@ -1945,9 +1946,10 @@ enum GameStringIDs {
TX_FEA6N015,
TX_FEA6N016,
TX_FEA6N017,
+ // MISSING
TX_FEA6N020,
- TX_FEA6N028,
- TX_FEA6N029,
+ TX_FEA6N028, // UNUSED
+ TX_FEA6N029, // UNUSED
TX_SIN3_012,
@@ -3781,13 +3783,13 @@ const char * const g_gameStrings[] = {
"#FEA6\\FEA6_009#Damn it Jim, I'm a surgeon not a geologist.",
"#FEA6\\FEA6_011#Everyone is healthy, Jim, there's no need for the medical kit here.",
"#FEA6\\FEA6_012#It would appear that our tentacled friend wants dessert. You can't go back that way, unless you enjoy being eaten.",
- "#FEA6\\FEA6_013#I've lost any appetite I may have had for squid, Jim",
+ "#FEA6\\FEA6_013#I've lost any appetite I may have had for squid, Jim.", // TYPO
"#FEA6\\FEA6_014#Jim! Going back across that river would be insane.",
"#FEA6\\FEA6_015#Well, they're not organic. What did you think they were, calcified tribbles?",
"#FEA6\\FEA6_016#Captains and security officers. They don't realize how fragile the human body can be.",
- "#FEA6\\FEA6_017#Well isn't that just great!",
+ "#FEA6\\FEA6_017#Well isn't this just great!", // TYPO
"#FEA6\\FEA6_018#Fascinating. These rocks are limestone, but contain an unusually high content of heavy metals. There are dilithium crystals here, but in a very raw form.",
- "#FEA6\\FEA6_019#I fail to see any logic in that action, Captain It may also cause stalactites to fall.",
+ "#FEA6\\FEA6_019#I fail to see any logic in that action, Captain. It may also cause stalactites to fall.", // TYPO
"#FEA6\\FEA6_020#I would suggest using something to pry that loose, Captain.",
"#FEA6\\FEA6_021#It is unwise to use a rock here, Captain.",
"#FEA6\\FEA6_022#My tricorder indicates unusual energy patterns in this direction, Captain.",
@@ -3812,7 +3814,7 @@ const char * const g_gameStrings[] = {
"#FEA6\\FEA6_041#If we ever get back to Earth, one hundred credits says I'll beat you.",
"#FEA6\\FEA6_042#Reminds me of some spelunking I did on Hades IV. Ever do any climbing, Captain?",
"#FEA6\\FEA6_043#Sure we do. That's the challenge.",
- "#FEA6\\FEA6N000#A stalagtite breaks loose and falls. You are mortally injured and die.",
+ "#FEA6\\FEA6N000#A stalagtite breaks through and falls. You are mortally injured and die.", // TYPO
"#FEA6\\FEA6N001#An interesting, but useless, manuever.",
"#FEA6\\FEA6N002#As usual, Dr. McCoy looks annoyed by the mission. ",
"#FEA6\\FEA6N003#Darkness, leading into the unknown.",
@@ -3828,7 +3830,7 @@ const char * const g_gameStrings[] = {
"#FEA6\\FEA6N013#Stalagmites rise from the floor of the cave.",
"#FEA6\\FEA6N014#They appear to be ordinary rocks. Spock's tricorder might say otherwise.",
"#FEA6\\FEA6N015#This is one place where dilithium crystals don't seem to be very useful.",
- "#FEA6\\FEA6N016#This is the way that you entered the cave. If you leave this way, the tentacled creature that attack you will probably try to get a second course for its dinner.",
+ "#FEA6\\FEA6N016#This is the way that you entered the cave. If you leave this way, the tentacled creature that attacked you will probably try to get a second course for its dinner.", // TYPO
"#FEA6\\FEA6N017#You have one dilithium crystal, in raw form.",
"#FEA6\\FEA6N020#You will need something to pry it loose.",
"#FEA6\\FEA6N028#You manage to pry loose one dilithium crystal.",
Commit: 092cf422cab8aaf21adf742bf4f0b8154f82b113
https://github.com/scummvm/scummvm/commit/092cf422cab8aaf21adf742bf4f0b8154f82b113
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: FEATHER7
Changed paths:
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/feather7.cpp
engines/startrek/rooms/function_map.h
engines/startrek/text.h
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index c1d7216..9964fc6 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -161,7 +161,7 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
}
else if (name == "FEATHER7") {
_roomActionList = feather7ActionList;
- _numRoomActions = sizeof(feather7ActionList) / sizeof(RoomAction);
+ _numRoomActions = feather7NumActions;
}
else {
warning("Room \"%s\" unimplemented", name.c_str());
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index a307cf4..58cd6f4 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1708,6 +1708,13 @@ public:
// FEATHER7
void feather7Tick1();
+ void feather7Tick40();
+ void feather7KirkReachedSeat();
+ void feather7SpockReachedSeat();
+ void feather7MccoyReachedSeat();
+ void feather7QuetzecoatlReachedSeat();
+ void feather7KirkSatDown();
+ void feather7ReadyToBeamOut();
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
@@ -1841,6 +1848,9 @@ private:
// feather6
bool usedRockOnCrystalsOnce;
+
+ // feather7
+ bool insultedQuetzecoatl;
} feather;
diff --git a/engines/startrek/rooms/feather7.cpp b/engines/startrek/rooms/feather7.cpp
index a932404..3527014 100644
--- a/engines/startrek/rooms/feather7.cpp
+++ b/engines/startrek/rooms/feather7.cpp
@@ -22,14 +22,143 @@
#include "startrek/room.h"
-#define OBJECT_8 8
-
-#define HOTSPOT_20 0x20
+#define OBJECT_QUETZECOATL 8
namespace StarTrek {
+extern const RoomAction feather7ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::feather7Tick1 },
+ { {ACTION_TICK, 40, 0, 0}, &Room::feather7Tick40 },
+ { {ACTION_DONE_WALK, 1, 0, 0}, &Room::feather7KirkReachedSeat },
+ { {ACTION_DONE_WALK, 2, 0, 0}, &Room::feather7SpockReachedSeat },
+ { {ACTION_DONE_WALK, 3, 0, 0}, &Room::feather7MccoyReachedSeat },
+ { {ACTION_DONE_ANIM, 4, 0, 0}, &Room::feather7QuetzecoatlReachedSeat },
+ { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::feather7KirkSatDown },
+ { {ACTION_DONE_ANIM, 2, 0, 0}, &Room::feather7ReadyToBeamOut },
+};
+
+extern const int feather7NumActions = sizeof(feather7ActionList) / sizeof(RoomAction);
+
+
void Room::feather7Tick1() {
+ playVoc("FEA7LOOP");
+ playMidiMusicTracks(33);
+ _vm->_awayMission.disableInput = 2;
+ loadActorAnim(OBJECT_QUETZECOATL, "s5r7qn", 0x106, 0x98);
+}
+
+void Room::feather7Tick40() {
+ if (_vm->_awayMission.feather.diedFromStalactites)
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_017);
+
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_022);
+
+ if (_vm->_awayMission.redshirtDead)
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_021);
+
+ // BUGFIX: Show this even if redshirt isn't dead (he wishes you wouldn't have knocked
+ // out Tlaoxac)
+ if (_vm->_awayMission.feather.knockedOutTlaoxac)
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_023);
+
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_027);
+
+ walkCrewmanC(OBJECT_KIRK, 0x6c, 0x93, &Room::feather7KirkReachedSeat);
+ walkCrewmanC(OBJECT_SPOCK, 0xbb, 0x8c, &Room::feather7SpockReachedSeat);
+ walkCrewmanC(OBJECT_MCCOY, 0x8d, 0x8c, &Room::feather7MccoyReachedSeat);
+ loadActorAnimC(OBJECT_QUETZECOATL, "s5r7qw", -1, -1, &Room::feather7QuetzecoatlReachedSeat);
+}
+
+void Room::feather7KirkReachedSeat() {
+ loadActorAnimC(OBJECT_KIRK, "s5r7ks", -1, -1, &Room::feather7KirkSatDown);
+}
+
+void Room::feather7SpockReachedSeat() {
+ loadActorAnim2(OBJECT_SPOCK, "s5r7ss");
+}
+
+void Room::feather7MccoyReachedSeat() {
+ loadActorAnim2(OBJECT_MCCOY, "s5r7ms");
+}
+
+void Room::feather7QuetzecoatlReachedSeat() {
+ loadActorAnim2(OBJECT_QUETZECOATL, "s5r7qn", 0x97, 0x98);
+}
+
+void Room::feather7KirkSatDown() {
+ const TextRef choices1[] = {
+ TX_SPEAKER_KIRK,
+ TX_FEA7_005, TX_FEA7_006, TX_FEA7_010,
+ TX_BLANK
+ };
+ int choice = showText(choices1);
+
+ if (choice == 0) {
+ _roomVar.feather.insultedQuetzecoatl = true;
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_020);
+ } else if (choice == 1)
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_019);
+ else
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_016);
+
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_029);
+
+ const TextRef choices2[] = {
+ TX_SPEAKER_KIRK,
+ TX_FEA7_007, TX_FEA7_004, TX_FEA7_012,
+ TX_BLANK
+ };
+ choice = showText(choices2);
+
+ if (choice == 0) {
+ _roomVar.feather.insultedQuetzecoatl = true;
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_030);
+ } else if (choice == 1)
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_018);
+ else {
+ _roomVar.feather.insultedQuetzecoatl = true;
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_026);
+ }
+
+ showText(TX_SPEAKER_SPOCK, TX_FEA7_014);
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_024);
+
+ const TextRef choices3[] = {
+ TX_SPEAKER_KIRK,
+ TX_FEA7_008, TX_FEA7_009, TX_FEA7_011,
+ TX_BLANK
+ };
+ choice = showText(choices3);
+
+ if (choice == 0) {
+ _roomVar.feather.insultedQuetzecoatl = true;
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_025);
+ } else if (choice == 1)
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_028);
+
+ showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_015);
+ showText(TX_SPEAKER_MCCOY, TX_FEA7_013);
+ showText(TX_SPEAKER_KIRK, TX_FEA7_003);
+
+ loadActorAnimC(OBJECT_KIRK, "s5r7ku", -1, -1, &Room::feather7ReadyToBeamOut);
+ loadActorAnim2(OBJECT_SPOCK, "s5r7su");
+ loadActorAnim2(OBJECT_MCCOY, "s5r7mu");
+}
+
+void Room::feather7ReadyToBeamOut() {
+ if (_vm->_awayMission.redshirtDead)
+ showText(TX_SPEAKER_KIRK, TX_FEA7_002);
+ else {
+ _vm->_awayMission.feather.missionScore += 1;
+ showText(TX_SPEAKER_KIRK, TX_FEA7_001);
+ }
+
+ if (!_roomVar.feather.insultedQuetzecoatl)
+ _vm->_awayMission.feather.missionScore += 2;
+ _vm->_awayMission.feather.missionScore += 4;
+ loadActorAnim2(OBJECT_QUETZECOATL, "s5r7qt");
+ endMission(_vm->_awayMission.feather.missionScore, 0x13, 0);
}
}
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 1bc32ff..a00aa56 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1782,12 +1782,8 @@ RoomAction feather0ActionList[] = {
extern const RoomAction feather1ActionList[], feather2ActionList[], feather3ActionList[], feather4ActionList[];
extern const int feather1NumActions, feather2NumActions, feather3NumActions, feather4NumActions;
-extern const RoomAction feather5ActionList[], feather6ActionList[];
-extern const int feather5NumActions, feather6NumActions;
-
-RoomAction feather7ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::feather7Tick1 },
-};
+extern const RoomAction feather5ActionList[], feather6ActionList[], feather7ActionList[];
+extern const int feather5NumActions, feather6NumActions, feather7NumActions;
}
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index e58e750..f669819 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -1952,6 +1952,38 @@ enum GameStringIDs {
TX_FEA6N029, // UNUSED
+ TX_FEA7_001,
+ TX_FEA7_002,
+ TX_FEA7_003,
+ TX_FEA7_004,
+ TX_FEA7_005,
+ TX_FEA7_006,
+ TX_FEA7_007,
+ TX_FEA7_008,
+ TX_FEA7_009,
+ TX_FEA7_010,
+ TX_FEA7_011,
+ TX_FEA7_012,
+ TX_FEA7_013,
+ TX_FEA7_014,
+ TX_FEA7_015,
+ TX_FEA7_016,
+ TX_FEA7_017,
+ TX_FEA7_018,
+ TX_FEA7_019,
+ TX_FEA7_020,
+ TX_FEA7_021,
+ TX_FEA7_022,
+ TX_FEA7_023,
+ TX_FEA7_024,
+ TX_FEA7_025,
+ TX_FEA7_026,
+ TX_FEA7_027,
+ TX_FEA7_028,
+ TX_FEA7_029,
+ TX_FEA7_030,
+
+
TX_SIN3_012,
@@ -3837,6 +3869,38 @@ const char * const g_gameStrings[] = {
"#FEA6\\FEA6N029#You scratch your initials. No dilithium crystals were found.",
+ "#FEA7\\FEA7_001#Scotty, five to beam up.",
+ "#FEA7\\FEA7_002#Scotty, four to beam up.",
+ "#FEA7\\FEA7_003#You've got to do it, Bones! If the Klingons realize he's no longer a threat to them, perhaps we can avoid a war!",
+ "#FEA7\\FEA7_004#Absolutely. Your best intentions were changed by the imperfect humans that you left in charge after you departed. Such is the way of our race, I'm afraid.",
+ "#FEA7\\FEA7_005#I've had it up to here with so-called superior beings terrorizing my crew because we're so 'primitive'. Maybe you should see how primitive you are before you go around testing others.",
+ "#FEA7\\FEA7_006#One thing first. If you're so peaceful, how come the Aztecs were so violent and agressive?",
+ "#FEA7\\FEA7_007#The Federation is not in the business of lying, mister.",
+ "#FEA7\\FEA7_008#We're a technologically advanced starfaring race, what do you think? That we wouldn't have made progress in medicine?",
+ "#FEA7\\FEA7_009#With Dr. McCoy, I sometimes wonder, but yes, I would say we have made considerable advances.",
+ "#FEA7\\FEA7_010#Yes, I guess we do. Go on.",
+ "#FEA7\\FEA7_011#Yes, why do you ask?",
+ "#FEA7\\FEA7_012#You messed up in a big way. Perhaps you should try following the Prime Directive. It changed our lives.",
+ "#FEA7\\FEA7_013#Jim, I'll try, but the physiology is completely alien...",
+ "#FEA7\\FEA7_014#You show great wisdom, sir. But your statement implies that you wish to change your condition.",
+ "#FEA7\\FEA7_015#At the top of my spine is a gland not found in your species. This is the seat of my power. I wish you to remove it, thereby making me a mortal.",
+ "#FEA7\\FEA7_016#First, I have one question...",
+ "#FEA7\\FEA7_017#I am sorry you had to go through this ordeal. It was not meant for you to die.",
+ "#FEA7\\FEA7_018#I sense truth in this. Perhaps this is what happened to my children on the Klingon world of Hrakkour, which would explain why they are searching for me. I have clearly abused the power that was given me long ago.",
+ "#FEA7\\FEA7_019#I tried to teach them the concept of self-sacrifice. It would appear they did not completely understand my teachings.",
+ "#FEA7\\FEA7_020#I was not aware you had been tested before. My apologies.",
+ "#FEA7\\FEA7_021#I was particularly impressed by the sacrifice made by Lt. Stragey. Of course, I gave him back his life. He is now safely aboard your vessel.",
+ "#FEA7\\FEA7_022#I watched as you worked through the problems I set in your path. you are a valiant, intelligent species.",
+ "#FEA7\\FEA7_023#I would have been more impressed had you found a less violent solution. My children are dear to me. Even so, few choices remain to me.",
+ "#FEA7\\FEA7_024#Indeed. If my mission of peace was overthrown, then I am no longer worthy of my power. Tell me, has your species made progress in the medical arts?",
+ "#FEA7\\FEA7_025#Of course, how foolish of me. Still, there are cultures where medical knowledge is considered a sign of weakness. Warrior cultures, where nothing matters but physical strength. Survival of the foolish.",
+ "#FEA7\\FEA7_026#Ours is an intensely curious race, Captain. My brothers and I have raised children on a thousand worlds, loved them, watched them grow, only to see them become separated from us by the passage of time. It is sad and lonely process, one which I shall not repeat again. I am no longer worthy of my gift.",
+ "#FEA7\\FEA7_027#Please sit down. We have much to discuss.",
+ "#FEA7\\FEA7_028#Then I shall ask to make use of your advances.",
+ "#FEA7\\FEA7_029#You are clearly not the liars I thought you to be. Were you telling me the truth about my disciples? That they became ruthless savages?",
+ "#FEA7\\FEA7_030#Your harshness is unwarranted, but I sense truth in this. Perhaps this is what happened to my children on the Klingon world of Hrakkour, which would explain why they are searching for me. I have clearly abused the power that was given me long ago.",
+
+
"#SIN3\\SIN3_012#Can't say I like the decor.",
Commit: 6fa0efa4ed131117d5d76039ccc7d5245d0f64a9
https://github.com/scummvm/scummvm/commit/6fa0efa4ed131117d5d76039ccc7d5245d0f64a9
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Make a macro to simplify room detection
Changed paths:
engines/startrek/room.cpp
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 9964fc6..e3717ab 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -27,6 +27,22 @@
#include "rooms/function_map.h"
+// TODO: Delete this macro, replacing it with the next one.
+// New "[roomName]NumActions" variables need to be made before that.
+#define ADD_ROOM_OLD(ROOM) {\
+ if (name.equalsIgnoreCase(#ROOM)) {\
+ _roomActionList = ROOM##ActionList;\
+ _numRoomActions = sizeof(ROOM##ActionList) / sizeof(RoomAction);\
+ }\
+}
+
+#define ADD_ROOM(ROOM) {\
+ if (name.equalsIgnoreCase(#ROOM)) {\
+ _roomActionList = ROOM##ActionList;\
+ _numRoomActions = ROOM##NumActions;\
+ }\
+}
+
namespace StarTrek {
Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
@@ -38,132 +54,41 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_roomIndex = name.lastChar() - '0';
- // Find room-specific code table
- if (name == "DEMON0") {
- _roomActionList = demon0ActionList;
- _numRoomActions = sizeof(demon0ActionList) / sizeof(RoomAction);
- }
- else if (name == "DEMON1") {
- _roomActionList = demon1ActionList;
- _numRoomActions = sizeof(demon1ActionList) / sizeof(RoomAction);
- }
- else if (name == "DEMON2") {
- _roomActionList = demon2ActionList;
- _numRoomActions = sizeof(demon2ActionList) / sizeof(RoomAction);
- }
- else if (name == "DEMON3") {
- _roomActionList = demon3ActionList;
- _numRoomActions = sizeof(demon3ActionList) / sizeof(RoomAction);
- }
- else if (name == "DEMON4") {
- _roomActionList = demon4ActionList;
- _numRoomActions = sizeof(demon4ActionList) / sizeof(RoomAction);
- }
- else if (name == "DEMON5") {
- _roomActionList = demon5ActionList;
- _numRoomActions = sizeof(demon5ActionList) / sizeof(RoomAction);
- }
- else if (name == "DEMON6") {
- _roomActionList = demon6ActionList;
- _numRoomActions = sizeof(demon6ActionList) / sizeof(RoomAction);
- }
- else if (name == "TUG0") {
- _roomActionList = tug0ActionList;
- _numRoomActions = sizeof(tug0ActionList) / sizeof(RoomAction);
- }
- else if (name == "TUG1") {
- _roomActionList = tug1ActionList;
- _numRoomActions = sizeof(tug1ActionList) / sizeof(RoomAction);
- }
- else if (name == "TUG2") {
- _roomActionList = tug2ActionList;
- _numRoomActions = sizeof(tug2ActionList) / sizeof(RoomAction);
- }
- else if (name == "TUG3") {
- _roomActionList = tug3ActionList;
- _numRoomActions = sizeof(tug3ActionList) / sizeof(RoomAction);
- }
- else if (name == "LOVE0") {
- _roomActionList = love0ActionList;
- _numRoomActions = sizeof(love0ActionList) / sizeof(RoomAction);
- }
- else if (name == "LOVE1") {
- _roomActionList = love1ActionList;
- _numRoomActions = sizeof(love1ActionList) / sizeof(RoomAction);
- }
- else if (name == "LOVE2") {
- _roomActionList = love2ActionList;
- _numRoomActions = sizeof(love2ActionList) / sizeof(RoomAction);
- }
- else if (name == "LOVE3") {
- _roomActionList = love3ActionList;
- _numRoomActions = sizeof(love3ActionList) / sizeof(RoomAction);
- }
- else if (name == "LOVE4") {
- _roomActionList = love4ActionList;
- _numRoomActions = sizeof(love4ActionList) / sizeof(RoomAction);
- }
- else if (name == "LOVE5") {
- _roomActionList = love5ActionList;
- _numRoomActions = sizeof(love5ActionList) / sizeof(RoomAction);
- }
- else if (name == "MUDD0") {
- _roomActionList = mudd0ActionList;
- _numRoomActions = sizeof(mudd0ActionList) / sizeof(RoomAction);
- }
- else if (name == "MUDD1") {
- _roomActionList = mudd1ActionList;
- _numRoomActions = sizeof(mudd1ActionList) / sizeof(RoomAction);
- }
- else if (name == "MUDD2") {
- _roomActionList = mudd2ActionList;
- _numRoomActions = sizeof(mudd2ActionList) / sizeof(RoomAction);
- }
- else if (name == "MUDD3") {
- _roomActionList = mudd3ActionList;
- _numRoomActions = sizeof(mudd3ActionList) / sizeof(RoomAction);
- }
- else if (name == "MUDD4") {
- _roomActionList = mudd4ActionList;
- _numRoomActions = sizeof(mudd4ActionList) / sizeof(RoomAction);
- }
- else if (name == "MUDD5") {
- _roomActionList = mudd5ActionList;
- _numRoomActions = sizeof(mudd5ActionList) / sizeof(RoomAction);
- }
- else if (name == "FEATHER0") {
- _roomActionList = feather0ActionList;
- _numRoomActions = sizeof(feather0ActionList) / sizeof(RoomAction);
- }
- else if (name == "FEATHER1") {
- _roomActionList = feather1ActionList;
- _numRoomActions = feather1NumActions;
- }
- else if (name == "FEATHER2") {
- _roomActionList = feather2ActionList;
- _numRoomActions = feather2NumActions;
- }
- else if (name == "FEATHER3") {
- _roomActionList = feather3ActionList;
- _numRoomActions = feather3NumActions;
- }
- else if (name == "FEATHER4") {
- _roomActionList = feather4ActionList;
- _numRoomActions = feather4NumActions;
- }
- else if (name == "FEATHER5") {
- _roomActionList = feather5ActionList;
- _numRoomActions = feather5NumActions;
- }
- else if (name == "FEATHER6") {
- _roomActionList = feather6ActionList;
- _numRoomActions = feather6NumActions;
- }
- else if (name == "FEATHER7") {
- _roomActionList = feather7ActionList;
- _numRoomActions = feather7NumActions;
- }
- else {
+ _roomActionList = nullptr;
+
+ ADD_ROOM_OLD(demon0);
+ ADD_ROOM_OLD(demon1);
+ ADD_ROOM_OLD(demon2);
+ ADD_ROOM_OLD(demon3);
+ ADD_ROOM_OLD(demon4);
+ ADD_ROOM_OLD(demon5);
+ ADD_ROOM_OLD(demon6);
+ ADD_ROOM_OLD(tug0);
+ ADD_ROOM_OLD(tug1);
+ ADD_ROOM_OLD(tug2);
+ ADD_ROOM_OLD(tug3);
+ ADD_ROOM_OLD(love0);
+ ADD_ROOM_OLD(love1);
+ ADD_ROOM_OLD(love2);
+ ADD_ROOM_OLD(love3);
+ ADD_ROOM_OLD(love4);
+ ADD_ROOM_OLD(love5);
+ ADD_ROOM_OLD(mudd0);
+ ADD_ROOM_OLD(mudd1);
+ ADD_ROOM_OLD(mudd2);
+ ADD_ROOM_OLD(mudd3);
+ ADD_ROOM_OLD(mudd4);
+ ADD_ROOM_OLD(mudd5);
+ ADD_ROOM_OLD(feather0);
+ ADD_ROOM(feather1);
+ ADD_ROOM(feather2);
+ ADD_ROOM(feather3);
+ ADD_ROOM(feather4);
+ ADD_ROOM(feather5);
+ ADD_ROOM(feather6);
+ ADD_ROOM(feather7);
+
+ if (_roomActionList == nullptr) {
warning("Room \"%s\" unimplemented", name.c_str());
_numRoomActions = 0;
}
Commit: 0f3efc0e55d07fe77f5defb5b40053c1b403694f
https://github.com/scummvm/scummvm/commit/0f3efc0e55d07fe77f5defb5b40053c1b403694f
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: TRIAL0
Changed paths:
A engines/startrek/rooms/trial0.cpp
A engines/startrek/rooms/trial1.cpp
A engines/startrek/rooms/trial2.cpp
A engines/startrek/rooms/trial3.cpp
A engines/startrek/rooms/trial4.cpp
A engines/startrek/rooms/trial5.cpp
engines/startrek/awaymission.h
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/feather6.cpp
engines/startrek/rooms/function_map.h
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index d38fde4..4af0270 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -262,6 +262,12 @@ struct AwayMission {
bool showedSnakeToTlaoxac; // 0x35
int16 missionScore; // 0x36
} feather;
+
+ struct {
+ int16 field29; // 0x29
+ int16 field2b; // 0x2b
+ int16 missionScore; // 0x5f
+ } trial;
};
};
// Size: 0x129 bytes
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 5022abe..b0f1034 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -52,6 +52,12 @@ MODULE_OBJS = \
rooms/feather5.o \
rooms/feather6.o \
rooms/feather7.o \
+ rooms/trial0.o \
+ rooms/trial1.o \
+ rooms/trial2.o \
+ rooms/trial3.o \
+ rooms/trial4.o \
+ rooms/trial5.o \
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index e3717ab..dd53b47 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -87,6 +87,12 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
ADD_ROOM(feather5);
ADD_ROOM(feather6);
ADD_ROOM(feather7);
+ ADD_ROOM(trial0);
+ ADD_ROOM(trial1);
+ ADD_ROOM(trial2);
+ ADD_ROOM(trial3);
+ ADD_ROOM(trial4);
+ ADD_ROOM(trial5);
if (_roomActionList == nullptr) {
warning("Room \"%s\" unimplemented", name.c_str());
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 58cd6f4..94a1ea6 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1716,6 +1716,58 @@ public:
void feather7KirkSatDown();
void feather7ReadyToBeamOut();
+
+ // TRIAL0
+ void trial0Tick1();
+ void trial0Tick40();
+ void trial0Timer0Expired();
+ void trial0WalkToRoomCenter();
+ void trial0ReachedRoomCenter();
+ void trial0LookAtWindow();
+ void trial0LookAtVlict();
+ void trial0LookAtGuard();
+ void trial0LookAtBench();
+ void trial0LookAtSeal();
+ void trial0LookAtKirk();
+ void trial0LookAtSpock();
+ void trial0LookAtMccoy();
+ void trial0LookAtRedshirt();
+ void trial0LookAtQuetzecoatl();
+ void trial0TalkToVlict();
+ void trial0TalkToGuard();
+ void trial0TalkToQuetzecoatl();
+ void trial0TalkToMccoy();
+ void trial0TalkToSpock();
+ void trial0TalkToRedshirt();
+ void trial0UsePhaserOrRock();
+ void trial0UseSnakeOnVlict();
+ void trial0UseSnakeOnGuard();
+ void trial0UseMTricorderOnQuetzecoatl();
+ void trial0UseMTricorderOnVlict();
+ void trial0UseMTricorderAnywhere();
+ void trial0UseSTricorderOnWindow();
+ void trial0UseSTricorderAnywhere();
+ void trial0UseCommunicator();
+ void trial0UseCrewmanOnKlingon();
+ void trial0UseMccoyOnVlict();
+ void trial0UseMccoyOnGuard();
+ void trial0UseMedkitAnywhere();
+
+ // TRIAL1
+ void trial1Tick1();
+
+ // TRIAL2
+ void trial2Tick1();
+
+ // TRIAL3
+ void trial3Tick1();
+
+ // TRIAL4
+ void trial4Tick1();
+
+ // TRIAL5
+ void trial5Tick1();
+
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
diff --git a/engines/startrek/rooms/feather6.cpp b/engines/startrek/rooms/feather6.cpp
index c757814..5b86a14 100644
--- a/engines/startrek/rooms/feather6.cpp
+++ b/engines/startrek/rooms/feather6.cpp
@@ -203,6 +203,7 @@ void Room::feather6UseKnifeAnywhere() {
}
void Room::feather6UseKnifeOnMccoy() {
+ // BUG: Stragey could be dead...
showText(TX_SPEAKER_STRAGEY, TX_FEA6_039); // BUGFIX: Speaker is Stragey (not Spock)
}
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index a00aa56..c83dc99 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1785,6 +1785,11 @@ extern const int feather1NumActions, feather2NumActions, feather3NumA
extern const RoomAction feather5ActionList[], feather6ActionList[], feather7ActionList[];
extern const int feather5NumActions, feather6NumActions, feather7NumActions;
+extern const RoomAction trial0ActionList[], trial1ActionList[], trial2ActionList[], trial3ActionList[];
+extern const int trial0NumActions, trial1NumActions, trial2NumActions, trial3NumActions;
+extern const RoomAction trial4ActionList[], trial5ActionList[];
+extern const int trial4NumActions, trial5NumActions;
+
}
#endif
diff --git a/engines/startrek/rooms/trial0.cpp b/engines/startrek/rooms/trial0.cpp
new file mode 100644
index 0000000..a6a2741
--- /dev/null
+++ b/engines/startrek/rooms/trial0.cpp
@@ -0,0 +1,330 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_VLICT 8
+#define OBJECT_GUARD 9
+#define OBJECT_QUETZECOATL 10
+
+#define HOTSPOT_BENCH 0x23
+#define HOTSPOT_WINDOW 0x25
+#define HOTSPOT_CENTER 0x26
+
+namespace StarTrek {
+
+extern const RoomAction trial0ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::trial0Tick1 },
+ { {ACTION_TICK, 40, 0, 0}, &Room::trial0Tick40 },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::trial0Timer0Expired },
+
+ { {ACTION_WALK, HOTSPOT_CENTER, 0, 0}, &Room::trial0WalkToRoomCenter },
+ { {ACTION_DONE_WALK, 1, 0, 0}, &Room::trial0ReachedRoomCenter },
+
+ { {ACTION_LOOK, HOTSPOT_WINDOW, 0, 0}, &Room::trial0LookAtWindow },
+ { {ACTION_LOOK, OBJECT_VLICT, 0, 0}, &Room::trial0LookAtVlict },
+ { {ACTION_LOOK, OBJECT_GUARD, 0, 0}, &Room::trial0LookAtGuard },
+ { {ACTION_LOOK, HOTSPOT_BENCH, 0, 0}, &Room::trial0LookAtBench },
+ { {ACTION_LOOK, HOTSPOT_CENTER, 0, 0}, &Room::trial0LookAtSeal },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::trial0LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::trial0LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::trial0LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::trial0LookAtRedshirt },
+ { {ACTION_LOOK, OBJECT_QUETZECOATL, 0, 0}, &Room::trial0LookAtQuetzecoatl },
+ { {ACTION_TALK, OBJECT_VLICT, 0, 0}, &Room::trial0TalkToVlict },
+ { {ACTION_TALK, OBJECT_GUARD, 0, 0}, &Room::trial0TalkToGuard },
+ { {ACTION_TALK, OBJECT_QUETZECOATL, 0, 0}, &Room::trial0TalkToQuetzecoatl },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::trial0TalkToMccoy },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::trial0TalkToSpock },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::trial0TalkToRedshirt },
+
+ { {ACTION_USE, OBJECT_IPHASERS, 0xff, 0}, &Room::trial0UsePhaserOrRock },
+ { {ACTION_USE, OBJECT_IPHASERK, 0xff, 0}, &Room::trial0UsePhaserOrRock },
+ { {ACTION_USE, OBJECT_IROCK, 0xff, 0}, &Room::trial0UsePhaserOrRock },
+ { {ACTION_USE, OBJECT_ISNAKE, OBJECT_VLICT, 0}, &Room::trial0UseSnakeOnVlict },
+ { {ACTION_USE, OBJECT_ISNAKE, OBJECT_GUARD, 0}, &Room::trial0UseSnakeOnGuard },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_QUETZECOATL, 0}, &Room::trial0UseMTricorderOnQuetzecoatl },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_VLICT, 0}, &Room::trial0UseMTricorderOnVlict },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::trial0UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_WINDOW, 0}, &Room::trial0UseSTricorderOnWindow },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::trial0UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::trial0UseCommunicator },
+
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_GUARD, 0}, &Room::trial0UseCrewmanOnKlingon },
+ { {ACTION_USE, OBJECT_KIRK, OBJECT_GUARD, 0}, &Room::trial0UseCrewmanOnKlingon },
+ { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_GUARD, 0}, &Room::trial0UseCrewmanOnKlingon },
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_VLICT, 0}, &Room::trial0UseCrewmanOnKlingon },
+ { {ACTION_USE, OBJECT_KIRK, OBJECT_VLICT, 0}, &Room::trial0UseCrewmanOnKlingon },
+ { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_VLICT, 0}, &Room::trial0UseCrewmanOnKlingon },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_VLICT, 0}, &Room::trial0UseMccoyOnVlict },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_GUARD, 0}, &Room::trial0UseMccoyOnGuard },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::trial0UseMedkitAnywhere },
+};
+
+extern const int trial0NumActions = sizeof(trial0ActionList) / sizeof(RoomAction);
+
+
+void Room::trial0Tick1() {
+ playVoc("TRI0LOOP");
+ _vm->_awayMission.timers[0] = getRandomWordInRange(180, 600);
+ _vm->_awayMission.trial.field2b = 0x1d;
+ loadActorAnim2(OBJECT_VLICT, "vlict1", 0x9f, 0x48);
+ loadActorAnim2(OBJECT_GUARD, "kgstnd", 0xdc, 0x6a);
+ loadActorAnim2(OBJECT_QUETZECOATL, "qteleg", 0x10e, 0xaa);
+}
+
+void Room::trial0Tick40() {
+ showText(TX_SPEAKER_VLICT, TX_TRI0_058);
+}
+
+void Room::trial0Timer0Expired() { // Doesn't do anything?
+ _vm->_awayMission.timers[0] = getRandomWordInRange(180, 600);
+}
+
+void Room::trial0WalkToRoomCenter() {
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ walkCrewmanC(OBJECT_KIRK, 0xa0, 0xaa, &Room::trial0ReachedRoomCenter);
+}
+
+void Room::trial0ReachedRoomCenter() {
+ bool gaveUp = false;
+
+ _vm->_awayMission.disableInput = false;
+ showText(TX_SPEAKER_VLICT, TX_TRI0_053);
+
+ const TextRef choices1[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI0_019, TX_TRI0_016, TX_TRI0_021,
+ TX_BLANK
+ };
+ showText(choices1);
+
+ showText(TX_SPEAKER_VLICT, TX_TRI0_054);
+ showText(TX_SPEAKER_KIRK, TX_TRI0_004);
+ showText(TX_SPEAKER_VLICT, TX_TRI0_047);
+
+ const TextRef choices2[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI0_011, TX_TRI0_018, TX_TRI0_015,
+ TX_BLANK
+ };
+ int choice = showText(choices2);
+
+ if (choice == 0) { // Kirk intervenes as a warrior
+ showText(TX_SPEAKER_VLICT, TX_TRI0_043);
+ showText(TX_SPEAKER_KIRK, TX_TRI0_002);
+ showText(TX_SPEAKER_VLICT, TX_TRI0_056);
+ showText(TX_SPEAKER_VLICT, TX_TRI0_061);
+ showText(TX_SPEAKER_KIRK, TX_TRI0_001);
+ showText(TX_SPEAKER_VLICT, TX_TRI0_060);
+ _vm->_awayMission.disableInput = true;
+ loadRoomIndex(1, 4);
+ } else if (choice == 1) { // "This trial is a mockery"
+ showText(TX_SPEAKER_VLICT, TX_TRI0_048);
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI0_041);
+ showText(TX_SPEAKER_VLICT, TX_TRI0_050);
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI0_039);
+ showText(TX_SPEAKER_VLICT, TX_TRI0_059);
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI0_040);
+ showText(TX_SPEAKER_VLICT, TX_TRI0_046);
+
+ const TextRef choices3[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI0_023, TX_TRI0_006, TX_TRI0_010,
+ TX_BLANK
+ };
+ choice = showText(choices3);
+
+ if (choice == 0 || choice == 1) {
+ showText(TX_SPEAKER_VLICT, TX_TRI0_052);
+
+ const TextRef choices4[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI0_017, TX_TRI0_020, TX_TRI0_008,
+ TX_BLANK
+ };
+ choice = showText(choices4);
+
+ if (choice == 0 || choice == 1) {
+ showText(TX_SPEAKER_VLICT, TX_TRI0_057);
+ showText(TX_SPEAKER_KIRK, TX_TRI0_003);
+ showText(TX_SPEAKER_VLICT, TX_TRI0_051);
+
+ const TextRef choices5[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI0_009, TX_TRI0_014, TX_TRI0_013,
+ TX_BLANK
+ };
+ choice = showText(choices5);
+
+ if (choice == 0 || choice == 1) {
+ showText(TX_SPEAKER_VLICT, TX_TRI0_055);
+ _vm->_awayMission.disableInput = true;
+ loadRoomIndex(1, 4);
+ } else { // choice == 2
+ showText(TX_SPEAKER_VLICT, TX_TRI0_045);
+ _vm->_awayMission.disableInput = true;
+ loadRoomIndex(1, 4);
+ }
+ } else // choice == 2
+ gaveUp = true;
+ } else // choice == 2
+ gaveUp = true;
+ } else // choice == 2
+ gaveUp = true;
+
+ if (gaveUp) {
+ playMidiMusicTracks(2, -1);
+ showText(TX_SPEAKER_VLICT, TX_TRI0_049);
+ showText(TX_SPEAKER_VLICT, TX_TRI0_044);
+ _vm->_awayMission.trial.missionScore = 0;
+
+ // FIXME: Are these parameters in the right order?
+ endMission(_vm->_awayMission.trial.field29, _vm->_awayMission.trial.field2b, 0);
+ }
+}
+
+void Room::trial0LookAtWindow() {
+ showText(TX_TRI0N007);
+}
+
+void Room::trial0LookAtVlict() {
+ showText(TX_TRI0N001);
+}
+
+void Room::trial0LookAtGuard() {
+ showText(TX_TRI0N000);
+}
+
+void Room::trial0LookAtBench() {
+ showText(TX_TRI0N006);
+}
+
+void Room::trial0LookAtSeal() {
+ showText(TX_TRI0N008);
+}
+
+void Room::trial0LookAtKirk() {
+ showText(TX_TRI0N004);
+}
+
+void Room::trial0LookAtSpock() {
+ showText(TX_TRI0N005);
+}
+
+void Room::trial0LookAtMccoy() {
+ showText(TX_TRI0N002);
+}
+
+void Room::trial0LookAtRedshirt() {
+ showText(TX_TRI0N003);
+}
+
+void Room::trial0LookAtQuetzecoatl() {
+ showText(TX_TRI0N009);
+}
+
+void Room::trial0TalkToVlict() {
+ showText(TX_SPEAKER_VLICT, TX_TRI0_062);
+}
+
+void Room::trial0TalkToGuard() {
+ showText(TX_SPEAKER_KLINGON_GUARD, TX_TRI0_F24);
+ showText(TX_SPEAKER_BENNIE, TX_TRI0_065);
+ showText(TX_SPEAKER_KIRK, TX_TRI0_007);
+ showText(TX_SPEAKER_BENNIE, TX_TRI0_064);
+ showText(TX_SPEAKER_KIRK, TX_TRI0_022);
+ showText(TX_SPEAKER_BENNIE, TX_TRI0_066);
+}
+
+void Room::trial0TalkToQuetzecoatl() {
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI0_042);
+}
+
+void Room::trial0TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI0_031);
+}
+
+void Room::trial0TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_TRI0_025);
+}
+
+void Room::trial0TalkToRedshirt() {
+ showText(TX_SPEAKER_BENNIE, TX_TRI0_063);
+}
+
+void Room::trial0UsePhaserOrRock() {
+ showText(TX_SPEAKER_SPOCK, TX_TRI0_026);
+ showText(TX_SPEAKER_MCCOY, TX_TRI0_036);
+}
+
+void Room::trial0UseSnakeOnVlict() {
+ showText(TX_SPEAKER_VLICT, TX_TRI4_076);
+}
+
+void Room::trial0UseSnakeOnGuard() {
+ showText(TX_SPEAKER_KLINGON_GUARD, TX_TRI0_F24);
+}
+
+void Room::trial0UseMTricorderOnQuetzecoatl() {
+ mccoyScan(DIR_S, TX_TRI0_029, true);
+}
+
+void Room::trial0UseMTricorderOnVlict() {
+ mccoyScan(DIR_S, TX_TRI0_030, true);
+}
+
+void Room::trial0UseMTricorderAnywhere() {
+ mccoyScan(DIR_S, TX_TRI0_035, true);
+}
+
+void Room::trial0UseSTricorderOnWindow() {
+ spockScan(DIR_S, TX_TRI0_037, true);
+}
+
+void Room::trial0UseSTricorderAnywhere() {
+ // ENHANCEMENT: Originally didn't play tricorder sound, etc
+ spockScan(DIR_S, TX_TRI0_038, true);
+}
+
+void Room::trial0UseCommunicator() {
+ showText(TX_SPEAKER_UHURA, TX_TRI0U075);
+}
+
+void Room::trial0UseCrewmanOnKlingon() {
+ showText(TX_SPEAKER_SPOCK, TX_TRI0_024);
+}
+
+void Room::trial0UseMccoyOnVlict() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI0_027);
+}
+
+void Room::trial0UseMccoyOnGuard() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI0_028);
+}
+
+void Room::trial0UseMedkitAnywhere() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI0_034);
+}
+
+}
diff --git a/engines/startrek/rooms/trial1.cpp b/engines/startrek/rooms/trial1.cpp
new file mode 100644
index 0000000..2df16b8
--- /dev/null
+++ b/engines/startrek/rooms/trial1.cpp
@@ -0,0 +1,37 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+extern const RoomAction trial1ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::trial1Tick1 },
+};
+
+extern const int trial1NumActions = sizeof(trial1ActionList) / sizeof(RoomAction);
+
+
+void Room::trial1Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/trial2.cpp b/engines/startrek/rooms/trial2.cpp
new file mode 100644
index 0000000..1bcec41
--- /dev/null
+++ b/engines/startrek/rooms/trial2.cpp
@@ -0,0 +1,37 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+extern const RoomAction trial2ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::trial2Tick1 },
+};
+
+extern const int trial2NumActions = sizeof(trial2ActionList) / sizeof(RoomAction);
+
+
+void Room::trial2Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/trial3.cpp b/engines/startrek/rooms/trial3.cpp
new file mode 100644
index 0000000..afbb1ee
--- /dev/null
+++ b/engines/startrek/rooms/trial3.cpp
@@ -0,0 +1,37 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+extern const RoomAction trial3ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::trial3Tick1 },
+};
+
+extern const int trial3NumActions = sizeof(trial3ActionList) / sizeof(RoomAction);
+
+
+void Room::trial3Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/trial4.cpp b/engines/startrek/rooms/trial4.cpp
new file mode 100644
index 0000000..39869aa
--- /dev/null
+++ b/engines/startrek/rooms/trial4.cpp
@@ -0,0 +1,37 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+extern const RoomAction trial4ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::trial4Tick1 },
+};
+
+extern const int trial4NumActions = sizeof(trial4ActionList) / sizeof(RoomAction);
+
+
+void Room::trial4Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/trial5.cpp b/engines/startrek/rooms/trial5.cpp
new file mode 100644
index 0000000..c2f7298
--- /dev/null
+++ b/engines/startrek/rooms/trial5.cpp
@@ -0,0 +1,37 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+extern const RoomAction trial5ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::trial5Tick1 },
+};
+
+extern const int trial5NumActions = sizeof(trial5ActionList) / sizeof(RoomAction);
+
+
+void Room::trial5Tick1() {
+}
+
+}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 876c1f6..fe496d2 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -83,7 +83,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxVar6 = 0;
_textboxHasMultipleChoices = false;
- _missionToLoad = "FEATHER";
+ _missionToLoad = "TRIAL";
_roomIndexToLoad = 0;
for (int i = 0; i < NUM_OBJECTS; i++)
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index f669819..3570863 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -107,6 +107,10 @@ enum GameStringIDs {
TX_SPEAKER_QUETZECOATL,
TX_SPEAKER_TLAOXAC,
+ TX_SPEAKER_BENNIE,
+ TX_SPEAKER_VLICT,
+ TX_SPEAKER_KLINGON_GUARD,
+
TX_BRIDU146,
TX_G_024,
@@ -1984,6 +1988,89 @@ enum GameStringIDs {
TX_FEA7_030,
+ TX_TRI0_001,
+ TX_TRI0_002,
+ TX_TRI0_003,
+ TX_TRI0_004,
+ // MISSING
+ TX_TRI0_006,
+ TX_TRI0_007,
+ TX_TRI0_008,
+ TX_TRI0_009,
+ TX_TRI0_010,
+ TX_TRI0_011,
+ // UNUSED
+ TX_TRI0_013,
+ TX_TRI0_014,
+ TX_TRI0_015,
+ TX_TRI0_016,
+ TX_TRI0_017,
+ TX_TRI0_018,
+ TX_TRI0_019,
+ TX_TRI0_020,
+ TX_TRI0_021,
+ TX_TRI0_022,
+ TX_TRI0_023,
+ TX_TRI0_024,
+ TX_TRI0_025,
+ TX_TRI0_026,
+ TX_TRI0_027,
+ TX_TRI0_028,
+ TX_TRI0_029,
+ TX_TRI0_030,
+ TX_TRI0_031,
+ // UNUSED
+ TX_TRI0_034,
+ TX_TRI0_035,
+ TX_TRI0_036,
+ TX_TRI0_037,
+ TX_TRI0_038,
+ TX_TRI0_039,
+ TX_TRI0_040,
+ TX_TRI0_041,
+ TX_TRI0_042,
+ TX_TRI0_043,
+ TX_TRI0_044,
+ TX_TRI0_045,
+ TX_TRI0_046,
+ TX_TRI0_047,
+ TX_TRI0_048,
+ TX_TRI0_049,
+ TX_TRI0_050,
+ TX_TRI0_051,
+ TX_TRI0_052,
+ TX_TRI0_053,
+ TX_TRI0_054,
+ TX_TRI0_055,
+ TX_TRI0_056,
+ TX_TRI0_057,
+ TX_TRI0_058,
+ TX_TRI0_059,
+ TX_TRI0_060,
+ TX_TRI0_061,
+ TX_TRI0_062,
+ TX_TRI0_063,
+ TX_TRI0_064,
+ TX_TRI0_065,
+ TX_TRI0_066,
+ // UNUSED (067)
+ TX_TRI0_F24,
+ TX_TRI0N000,
+ TX_TRI0N001,
+ TX_TRI0N002,
+ TX_TRI0N003,
+ TX_TRI0N004,
+ TX_TRI0N005,
+ TX_TRI0N006,
+ TX_TRI0N007,
+ TX_TRI0N008,
+ TX_TRI0N009,
+ TX_TRI0U075,
+
+
+ TX_TRI4_076,
+
+
TX_SIN3_012,
@@ -1997,6 +2084,7 @@ enum GameStringIDs {
TX_END
};
+// TODO: Move this out of the header file. It's inflating the executable size.
const char * const g_gameStrings[] = {
nullptr,
"",
@@ -2042,6 +2130,10 @@ const char * const g_gameStrings[] = {
"Quetzecoatl",
"Tlaoxac",
+ "Ensign Bennie",
+ "Vlict",
+ "Klingon Guard",
+
"#BRID\\BRIDU146#Nothing to report, Captain.",
"#GENE\\G_024#Fascinating.",
@@ -3901,6 +3993,85 @@ const char * const g_gameStrings[] = {
"#FEA7\\FEA7_030#Your harshness is unwarranted, but I sense truth in this. Perhaps this is what happened to my children on the Klingon world of Hrakkour, which would explain why they are searching for me. I have clearly abused the power that was given me long ago.",
+ "#TRI0\\TRI0_001#I want your word of honor, Vlict, that Quetzecoatl will not be harmed while we take these tests.",
+ "#TRI0\\TRI0_002#I've faced Klingons, both in personal and ship-to-ship combat. Your own records will confirm this. If I'm not worthy of their honors, why didn't they kill me?",
+ "#TRI0\\TRI0_003#Then the Klingon Empire is wrong.",
+ "#TRI0\\TRI0_004#Those are serious charges, Vlict. Should he not be tried by a Klingon High Court?",
+ "#TRI0\\TRI0_006#By our standards, he would rank among the greatest heroes of the Federation: Gandhi, Surak, M'lelto-jhi, Shanarda. We will not abandon him.",
+ "#TRI0\\TRI0_007#Ensign!",
+ "#TRI0\\TRI0_008#Fine. Can we get this over with? I've got shore leave scheduled on Ryza next week.",
+ "#TRI0\\TRI0_009#Give me an opportunity. If I succeed, Quetzecoatl goes free.",
+ "#TRI0\\TRI0_010#Guess I can't argue with you. Pleasant conquests, admiral.",
+ "#TRI0\\TRI0_011#I'm a warrior, Vlict! I hereby intervene for him and demand the honors and responsibilities of a warrior's trial!",
+ "#TRI0\\TRI0_013#I'm James T. Kirk. I'm more worthy than you'll ever be, and I have girlfriends on fifty planets who will vouch for that!",
+ "#TRI0\\TRI0_014#If it means that I can prevent you from murdering an ancient and blameless creature, yes. And I'm prepared to back it up.",
+ "#TRI0\\TRI0_015#Oh well. I'm afraid you're on your own, Quetzecoatl.",
+ "#TRI0\\TRI0_016#Stick around, Vlict. There are more surprises awaiting you.",
+ "#TRI0\\TRI0_017#Then a Klingon can thrive on the conflict between his inner nature and his philosophy. Clearly, the people of Hrakkour did that.",
+ "#TRI0\\TRI0_018#Then this trial is a mockery for the entire galaxy to see!",
+ "#TRI0\\TRI0_019#There's nothing less appealing than a gloating Klingon, Vlict. Let's get this trial under way.",
+ "#TRI0\\TRI0_020#This is a matter for a philosophical debate, not a trial! The state has no right to interfere in a person's conscience.",
+ "#TRI0\\TRI0_021#Why does every Klingon tell me they expected to meet me in battle? You really have a one-track mind!",
+ "#TRI0\\TRI0_022#You will act with the discipline of a Federation officer, Ensign, or you will return to the Enterprise. Do I make myself clear?",
+ "#TRI0\\TRI0_023#You're going to kill this old man because he encouraged non-violence? The Federation cannot accept this.",
+ "#TRI0\\TRI0_024#Any hostile action here may result in the destruction of the Enterprise.",
+ "#TRI0\\TRI0_025#Captain, I estimate the odds of this court acquitting Quetzecoatl at 0.086 percent.",
+ "#TRI0\\TRI0_026#Captain, may I remind you that we are deep in Klingon space? If we attack them here, they may respond by destroying the Enterprise.",
+ "#TRI0\\TRI0_027#Damn it Jim, I'm a doctor not a arbitrator.",
+ "#TRI0\\TRI0_028#Damn it, Jim! I use my hands to save lives not take them.",
+ "#TRI0\\TRI0_029#He's still weak from the operation.",
+ "#TRI0\\TRI0_030#One healthy adult klingon male.",
+ "#TRI0\\TRI0_031#I've got nothing to say to you, Jim.",
+ "#TRI0\\TRI0_034#Nobody needs healing, Jim, but you will if they harm my patient.",
+ "#TRI0\\TRI0_035#Nothing of interest.",
+ "#TRI0\\TRI0_036#Don't be a fool, Jim! We can't risk the Enterprise! We've already signed one person's death warrant!", // TYPO
+ "#TRI0\\TRI0_037#Low level radiation, within safety limits. But you wouldn't want to spend more than a few days here.",
+ "#TRI0\\TRI0_038#Nothing of interest.",
+ "#TRI0\\TRI0_039#Children should not even play at war. To prepare them to kill is barbaric.",
+ "#TRI0\\TRI0_040#I have failed. Death is what I deserve.",
+ "#TRI0\\TRI0_041#I offered them insights into the philosophy of peace and cooperation. They chose to follow it of their own free will.",
+ "#TRI0\\TRI0_042#I'm frightened, Captain, but if I am to die, then I shall die well.",
+ "#TRI0\\TRI0_043#A Federation officer, claiming the rights of a Klingon warrior? How dare you insult me, Kirk!",
+ "#TRI0\\TRI0_044#As for you Kirk, I expected a more forceful response. I had heard you were a worthy opponent. Instead, I see a cringing coward. Leave this place, Kirk. You dishonor it.",
+ "#TRI0\\TRI0_045#Ha! Ha! You have never encountered Klingon women, Captain. But that was the response of a true warrior. You have earned my respect. I shall give you and your companions a chance to defend the traitor.",
+ "#TRI0\\TRI0_046#He has admitted guilt. You have surrendered him to Klingon law. Can you deny that this was a fair trial?",
+ "#TRI0\\TRI0_047#He has not demonstrated honor, Kirk! Only a proven warrior may be tried in High Court! Principles of honor are not applicable to his defense!",
+ "#TRI0\\TRI0_048#How typical of the Federation, to judge every other species as morally inferior. Your rhetoric is not welcome here!",
+ "#TRI0\\TRI0_049#I hereby sentence K'etz'coatl to a coward's death.",
+ "#TRI0\\TRI0_050#K'etz'koatl, you encouraged the colony to destroy its weapons. You even encouraged them to hold their children from our traditional military ceremonies.",
+ "#TRI0\\TRI0_051#Only the greatest warriors of old could say such a thing and expect to live! Do you think yourself worthy enough to walk in their footsteps?",
+ "#TRI0\\TRI0_052#Pacifism is utterly alien to our people. It would be as though he preached a doctrine of suicide in direct contradiction of the will to live. Honorable men thrive in war and conflict -- cowards seek to avoid conflict.",
+ "#TRI0\\TRI0_053#So Kirk, we finally meet. I had thought it would be in battle, but the universe holds many surprises.",
+ "#TRI0\\TRI0_054#So be it. This begins the trial of the entity K'etz'koatl, who is charged with impersonating a klingon, stirring dissent, encouraging cowardice, and treason in the highest degree.",
+ "#TRI0\\TRI0_055#Stories of your impudence are not exaggerated. You shall have your chance. It is a pity we will not meet again, Captain.",
+ "#TRI0\\TRI0_056#That oversight, Kirk, is easily rectified.",
+ "#TRI0\\TRI0_057#The Klingon Empire will not tolerate dissent.",
+ "#TRI0\\TRI0_058#The prisoner and his witnesses will stand forth, so the trial may begin!",
+ "#TRI0\\TRI0_059#To counsel it is to counsel cowardice. To counsel it is to abandon all honor! This is treason, for all to see! The penalty for treason in this system is death! Do you accept your sentence?",
+ "#TRI0\\TRI0_060#Very well. You have my word. Captain Kallarax, transport them to the Test of Life.",
+ "#TRI0\\TRI0_061#You and your three companions may face the tests that we set for the defender. Then we shall see if you are as worthy as a Klingon!",
+ "#TRI0\\TRI0_062#You will not speak unless the court requests it, Kirk!",
+ "#TRI0\\TRI0_063#Awaiting your orders, sir!",
+ "#TRI0\\TRI0_064#But I did, sir. Lieutenant Hildebrandt is a third dan in karate. Toughest fighter I've ever known...",
+ "#TRI0\\TRI0_065#Who are you calling a weakling? I've had tougher girlfriends than you, pal!",
+ "#TRI0\\TRI0_066#Yes sir.",
+ "#TRI0\\TRI0_F24#How amusing. Federation weaklings.",
+ "#TRI0\\TRI0N000#A Klingon guard. A big Klingon guard. A big Klingon guard with his disruptor ready to fire on anyone who gives him trouble.",
+ "#TRI0\\TRI0N001#Admiral Vlict, commander of the Klingon flagship K'lirta.",
+ "#TRI0\\TRI0N002#Dr. McCoy glares angrily at Kirk. It is obvious he does not like seeing his patient handed over to the Klingons.",
+ "#TRI0\\TRI0N003#Ensign Bennie stares around the Klingon court, distrusting everything he sees.",
+ "#TRI0\\TRI0N004#James T. Kirk, trapped in a situation he cannot win, forced to watch a travesty of justice... or is he?",
+ "#TRI0\\TRI0N005#Mr. Spock looks stoically at the klingon bench. Expecting to win this case would be illogical.",
+ "#TRI0\\TRI0N006#This bench is marked with the symbol of the Klingon Court of High Justice, the two Triangles of Words and Blood, linked together.",
+ "#TRI0\\TRI0N007#This city was destroyed by heavy bombardment and intense doses of neutrino rays that killed all known forms of life on this planet.",
+ "#TRI0\\TRI0N008#This is the famous seal of the Klingon Empire.",
+ "#TRI0\\TRI0N009#Your new found friend looks rather frightened right now, and you don't blame him.",
+ "#TRI0\\TRI0U075#Uhura here. Captain, there's a force field over the planet. We will not be able to beam you aboard.",
+
+
+ "#TRI4\\TRI4_076#You humans have an excellent imagination, but a poor grasp of reality.",
+
+
"#SIN3\\SIN3_012#Can't say I like the decor.",
Commit: 3cccf651791fee66e7ad1d6fd1f9927d73d26b06
https://github.com/scummvm/scummvm/commit/3cccf651791fee66e7ad1d6fd1f9927d73d26b06
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: TRIAL1
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/trial0.cpp
engines/startrek/rooms/trial1.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 4af0270..d64de68 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -264,9 +264,22 @@ struct AwayMission {
} feather;
struct {
- int16 field29; // 0x29
+ int16 missionScore; // 0x29
int16 field2b; // 0x2b
- int16 missionScore; // 0x5f
+ bool entityDefeated; // 0x31: Used iron rod on the energy being
+ bool doorOpen; // 0x32
+ bool scannedLock; // 0x33
+
+ // 0: Don't know the door code yet
+ // 2: Will just open the door when the keypad is used
+ // 5: Will activate the unknown program when the keypad is used
+ byte doorCodeBehaviour; // 0x34
+
+ bool forceFieldDown; // 0x5d
+ bool uhuraAnalyzedCode; // 0x5e
+ int16 field5f; // 0x5f
+ bool gotPointsForGettingRod; // 0x61
+ bool gotPointsForCoatingRodWithIron; // 0x62
} trial;
};
};
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index dd53b47..ebd3074 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -466,6 +466,10 @@ void Room::playVoc(Common::String filename) {
_vm->_sound->playVoc(filename);
}
+void Room::stopAllVocSounds() {
+ _vm->_sound->stopAllVocSounds();
+}
+
void Room::spockScan(int direction, TextRef text, bool changeDirection) {
const char *dirs = "nsew";
Common::String anim = "sscan_";
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 94a1ea6..e3c0a96 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -133,6 +133,7 @@ private:
void endMission(int16 score, int16 arg2, int16 arg3); // Cmd 0x11
void showGameOverMenu(); // Cmd 0x12
void playVoc(Common::String filename); // Cmd 0x15
+ void stopAllVocSounds(); // Cmd 0x17
// Helper functions for repetitive stuff.
@@ -1755,6 +1756,89 @@ public:
// TRIAL1
void trial1Tick1();
+ void trial1Tick50();
+ void trial1DoorOpened();
+ void trial1TouchedHotspot0();
+ void trial1KirkDied();
+ void trial1TouchedHotspot1();
+ void trial1GetRod();
+ void trial1ReachedRod();
+ void trial1PickedUpRod();
+ void trial1LookAtKirk();
+ void trial1LookAtSpock();
+ void trial1LookAtMccoy();
+ void trial1LookAtRedshirt();
+ void trial1LookAtWall();
+ void trial1LookAtFloor();
+ void trial1LookAtRods();
+ void trial1LookAtDoor();
+ void trial1LookAtLock();
+ void trial1LookAtEntity();
+ void trial1LookAtMoltenRock();
+ void trial1TalkToKirk();
+ void trial1TalkToSpock();
+ void trial1TalkToMccoy();
+ void trial1TalkToRedshirt();
+ void trial1TalkToEntity();
+ void trial1UsePhaserOnCrewman();
+ void trial1UsePhaserOnEntity();
+ void trial1UsePhaserOnWall();
+ void trial1UseStunPhaserOnFloor();
+ void trial1ReachedFloorToUseStunPhaser();
+ void trial1DoneShootingFloorWithStunPhaser();
+ void trial1UseKillPhaserOnFloor();
+ void trial1ReachedFloorToUseKillPhaser();
+ void trial1DoneShootingFloorWithKillPhaser();
+ void trial1UsePhaserOnRod();
+ void trial1UsePhaserOnDoor();
+ void trial1UsePhaserOnLock();
+ void trial1UseMTricorderOnKirk();
+ void trial1UseMTricorderOnSpock();
+ void trial1UseMTricorderOnMccoy();
+ void trial1UseMTricorderOnRedshirt();
+ void trial1UseMTricorderOnEntity();
+ void trial1UseSTricorderOnWall();
+ void trial1UseSTricorderOnEntity();
+ void trial1UseSTricorderOnRods();
+ void trial1UseSTricorderOnFloor();
+ void trial1UseSTricorderOnDoor();
+ void trial1UseSTricorderOnLock();
+ void trial1UseCommunicator();
+ void trial1UseMccoyOnEntity();
+ void trial1UseMccoyOnLock();
+ void trial1UseMccoyOnFloor();
+ void trial1UseSpockOnEntity();
+ void trial1UseSpockOnLock();
+ void trial1SpockReachedKeypad();
+ void trial1SpockUsedKeypad();
+ void trial1SpockReachedKeypadWithExtraProgram();
+ void trial1SpockUsedKeypadWithExtraProgram();
+ void trial1UseSpockOnFloor();
+ void trial1UseRedshirtOnEntity();
+ void trial1UseRedshirtOnLock();
+ void trial1RedshirtReachedKeypad();
+ void trial1RedshirtUsedKeypad();
+ void trial1RedshirtReachedKeypadWithExtraProgram();
+ void trial1RedshirtUsedKeypadWithExtraProgram();
+ void trial1UseRedshirtOnFloor();
+ void trial1UseRodOnMccoy();
+ void trial1UseRodOnSpock();
+ void trial1UseRodOnRedshirt();
+ void trial1UseRodOnFloorOrWall();
+ void trial1UseWoodRodOnEntity();
+ void trial1ReachedPositionToThrowWoodRod();
+ void trial1DoneThrowingWoodRod();
+ void trial1UseWoodRodOnLock();
+ void trial1UseWoodRodOnMoltenRock();
+ void trial1ReachedMoltenRock();
+ void trial1DoneCoatingWoodRod();
+ void trial1UseIronRodOnEntity();
+ void trial1ReachedPositionToThrowIronRod();
+ void trial1DoneThrowingIronRod();
+ void trial1UseIronRodOnLock();
+ void trial1GetThrownIronRod();
+ void trial1WalkToDoor();
+ void trial1UseMedkit();
// TRIAL2
void trial2Tick1();
diff --git a/engines/startrek/rooms/trial0.cpp b/engines/startrek/rooms/trial0.cpp
index a6a2741..6d042bd 100644
--- a/engines/startrek/rooms/trial0.cpp
+++ b/engines/startrek/rooms/trial0.cpp
@@ -197,10 +197,10 @@ void Room::trial0ReachedRoomCenter() {
playMidiMusicTracks(2, -1);
showText(TX_SPEAKER_VLICT, TX_TRI0_049);
showText(TX_SPEAKER_VLICT, TX_TRI0_044);
- _vm->_awayMission.trial.missionScore = 0;
+ _vm->_awayMission.trial.field5f = 0;
// FIXME: Are these parameters in the right order?
- endMission(_vm->_awayMission.trial.field29, _vm->_awayMission.trial.field2b, 0);
+ endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 0);
}
}
@@ -279,10 +279,12 @@ void Room::trial0UsePhaserOrRock() {
}
void Room::trial0UseSnakeOnVlict() {
+ // Unused, since the snake item doesn't carry over to the courtroom
showText(TX_SPEAKER_VLICT, TX_TRI4_076);
}
void Room::trial0UseSnakeOnGuard() {
+ // Unused, since the snake item doesn't carry over to the courtroom
showText(TX_SPEAKER_KLINGON_GUARD, TX_TRI0_F24);
}
diff --git a/engines/startrek/rooms/trial1.cpp b/engines/startrek/rooms/trial1.cpp
index 2df16b8..e33c54d 100644
--- a/engines/startrek/rooms/trial1.cpp
+++ b/engines/startrek/rooms/trial1.cpp
@@ -22,16 +22,697 @@
#include "startrek/room.h"
+#define OBJECT_ENTITY 8
+#define OBJECT_MOLTEN_ROCK 9
+#define OBJECT_DOOR 10
+#define OBJECT_THROWN_IRON_ROD 11
+
+#define HOTSPOT_DOOR 0x20
+#define HOTSPOT_LOCK 0x21
+#define HOTSPOT_RODS 0x22
+#define HOTSPOT_WALL 0x23
+#define HOTSPOT_FLOOR 0x24
+
namespace StarTrek {
extern const RoomAction trial1ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::trial1Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::trial1Tick1 },
+ { {ACTION_TICK, 50, 0, 0}, &Room::trial1Tick50 },
+ { {ACTION_DONE_ANIM, 9, 0, 0}, &Room::trial1DoorOpened },
+
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::trial1TouchedHotspot0 },
+ { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::trial1KirkDied },
+
+ { {ACTION_TOUCHED_HOTSPOT, 1, 0, 0}, &Room::trial1TouchedHotspot1 },
+
+ { {ACTION_GET, HOTSPOT_RODS, 0, 0}, &Room::trial1GetRod },
+ { {ACTION_DONE_WALK, 4, 0, 0}, &Room::trial1ReachedRod },
+ { {ACTION_DONE_ANIM, 5, 0, 0}, &Room::trial1PickedUpRod },
+
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::trial1LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::trial1LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::trial1LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::trial1LookAtRedshirt },
+ { {ACTION_LOOK, HOTSPOT_WALL, 0, 0}, &Room::trial1LookAtWall },
+ { {ACTION_LOOK, HOTSPOT_FLOOR, 0, 0}, &Room::trial1LookAtFloor },
+ { {ACTION_LOOK, HOTSPOT_RODS, 0, 0}, &Room::trial1LookAtRods },
+ { {ACTION_LOOK, HOTSPOT_DOOR, 0, 0}, &Room::trial1LookAtDoor },
+ { {ACTION_LOOK, HOTSPOT_LOCK, 0, 0}, &Room::trial1LookAtLock },
+ { {ACTION_LOOK, OBJECT_ENTITY, 0, 0}, &Room::trial1LookAtEntity },
+ { {ACTION_LOOK, OBJECT_MOLTEN_ROCK, 0, 0}, &Room::trial1LookAtMoltenRock },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::trial1TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::trial1TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::trial1TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::trial1TalkToRedshirt },
+ { {ACTION_TALK, OBJECT_ENTITY, 0, 0}, &Room::trial1TalkToEntity },
+
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_KIRK, 0}, &Room::trial1UsePhaserOnCrewman },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_KIRK, 0}, &Room::trial1UsePhaserOnCrewman },
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_SPOCK, 0}, &Room::trial1UsePhaserOnCrewman },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_SPOCK, 0}, &Room::trial1UsePhaserOnCrewman },
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_MCCOY, 0}, &Room::trial1UsePhaserOnCrewman },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_MCCOY, 0}, &Room::trial1UsePhaserOnCrewman },
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_REDSHIRT, 0}, &Room::trial1UsePhaserOnCrewman },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_REDSHIRT, 0}, &Room::trial1UsePhaserOnCrewman },
+
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_ENTITY, 0}, &Room::trial1UsePhaserOnEntity },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_ENTITY, 0}, &Room::trial1UsePhaserOnEntity },
+ { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_WALL, 0}, &Room::trial1UsePhaserOnWall },
+ { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_WALL, 0}, &Room::trial1UsePhaserOnWall },
+
+ { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_FLOOR, 0}, &Room::trial1UseStunPhaserOnFloor },
+ { {ACTION_DONE_WALK, 12, 0, 0}, &Room::trial1ReachedFloorToUseStunPhaser },
+ { {ACTION_DONE_ANIM, 13, 0, 0}, &Room::trial1DoneShootingFloorWithStunPhaser },
+
+ { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_FLOOR, 0}, &Room::trial1UseKillPhaserOnFloor },
+ { {ACTION_DONE_WALK, 14, 0, 0}, &Room::trial1ReachedFloorToUseKillPhaser },
+ { {ACTION_DONE_ANIM, 15, 0, 0}, &Room::trial1DoneShootingFloorWithKillPhaser },
+
+ { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_RODS, 0}, &Room::trial1UsePhaserOnRod },
+ { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_RODS, 0}, &Room::trial1UsePhaserOnRod },
+ { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_DOOR, 0}, &Room::trial1UsePhaserOnDoor },
+ { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_DOOR, 0}, &Room::trial1UsePhaserOnDoor },
+ { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_LOCK, 0}, &Room::trial1UsePhaserOnLock },
+ { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_LOCK, 0}, &Room::trial1UsePhaserOnLock },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::trial1UseMTricorderOnKirk },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::trial1UseMTricorderOnSpock },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::trial1UseMTricorderOnMccoy },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::trial1UseMTricorderOnRedshirt },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_ENTITY, 0}, &Room::trial1UseMTricorderOnEntity },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_WALL, 0}, &Room::trial1UseSTricorderOnWall },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_ENTITY, 0}, &Room::trial1UseSTricorderOnEntity },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_RODS, 0}, &Room::trial1UseSTricorderOnRods },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_FLOOR, 0}, &Room::trial1UseSTricorderOnFloor },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_DOOR, 0}, &Room::trial1UseSTricorderOnDoor },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_LOCK, 0}, &Room::trial1UseSTricorderOnLock },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::trial1UseCommunicator },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_ENTITY, 0}, &Room::trial1UseMccoyOnEntity },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_LOCK, 0}, &Room::trial1UseMccoyOnLock },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_FLOOR, 0}, &Room::trial1UseMccoyOnFloor },
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_ENTITY, 0}, &Room::trial1UseSpockOnEntity },
+
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_LOCK, 0}, &Room::trial1UseSpockOnLock },
+ { {ACTION_DONE_WALK, 18, 0, 0}, &Room::trial1SpockReachedKeypad },
+ { {ACTION_DONE_ANIM, 19, 0, 0}, &Room::trial1SpockUsedKeypad },
+ { {ACTION_DONE_WALK, 20, 0, 0}, &Room::trial1SpockReachedKeypadWithExtraProgram },
+ { {ACTION_DONE_ANIM, 21, 0, 0}, &Room::trial1SpockUsedKeypadWithExtraProgram },
+
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_FLOOR, 0}, &Room::trial1UseSpockOnFloor },
+ { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_ENTITY, 0}, &Room::trial1UseRedshirtOnEntity },
+
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_LOCK, 0}, &Room::trial1UseRedshirtOnLock },
+ { {ACTION_DONE_WALK, 24, 0, 0}, &Room::trial1RedshirtReachedKeypad },
+ { {ACTION_DONE_ANIM, 25, 0, 0}, &Room::trial1RedshirtUsedKeypad },
+ { {ACTION_DONE_WALK, 26, 0, 0}, &Room::trial1RedshirtReachedKeypadWithExtraProgram },
+ { {ACTION_DONE_ANIM, 27, 0, 0}, &Room::trial1RedshirtUsedKeypadWithExtraProgram },
+
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_FLOOR, 0}, &Room::trial1UseRedshirtOnFloor },
+ { {ACTION_USE, OBJECT_IWROD, OBJECT_MCCOY, 0}, &Room::trial1UseRodOnMccoy },
+ { {ACTION_USE, OBJECT_IWROD, OBJECT_SPOCK, 0}, &Room::trial1UseRodOnSpock },
+ { {ACTION_USE, OBJECT_IWROD, OBJECT_REDSHIRT, 0}, &Room::trial1UseRodOnRedshirt },
+ { {ACTION_USE, OBJECT_IWROD, HOTSPOT_FLOOR, 0}, &Room::trial1UseRodOnFloorOrWall },
+ { {ACTION_USE, OBJECT_IWROD, HOTSPOT_WALL, 0}, &Room::trial1UseRodOnFloorOrWall },
+
+ { {ACTION_USE, OBJECT_IWROD, OBJECT_ENTITY, 0}, &Room::trial1UseWoodRodOnEntity },
+ { {ACTION_DONE_WALK, 10, 0, 0}, &Room::trial1ReachedPositionToThrowWoodRod },
+ { {ACTION_DONE_ANIM, 6, 0, 0}, &Room::trial1DoneThrowingWoodRod },
+
+ { {ACTION_USE, OBJECT_IWROD, HOTSPOT_LOCK, 0}, &Room::trial1UseWoodRodOnLock },
+
+ { {ACTION_USE, OBJECT_IWROD, OBJECT_MOLTEN_ROCK, 0}, &Room::trial1UseWoodRodOnMoltenRock },
+ { {ACTION_DONE_WALK, 16, 0, 0}, &Room::trial1ReachedMoltenRock },
+ { {ACTION_DONE_ANIM, 17, 0, 0}, &Room::trial1DoneCoatingWoodRod },
+
+ { {ACTION_USE, OBJECT_IIROD, OBJECT_MCCOY, 0}, &Room::trial1UseRodOnMccoy },
+ { {ACTION_USE, OBJECT_IIROD, OBJECT_SPOCK, 0}, &Room::trial1UseRodOnSpock },
+ { {ACTION_USE, OBJECT_IIROD, OBJECT_REDSHIRT, 0}, &Room::trial1UseRodOnRedshirt },
+ { {ACTION_USE, OBJECT_IIROD, HOTSPOT_FLOOR, 0}, &Room::trial1UseRodOnFloorOrWall },
+ { {ACTION_USE, OBJECT_IIROD, HOTSPOT_WALL, 0}, &Room::trial1UseRodOnFloorOrWall },
+
+ { {ACTION_USE, OBJECT_IIROD, OBJECT_ENTITY, 0}, &Room::trial1UseIronRodOnEntity },
+ { {ACTION_DONE_WALK, 11, 0, 0}, &Room::trial1ReachedPositionToThrowIronRod },
+ { {ACTION_DONE_ANIM, 7, 0, 0}, &Room::trial1DoneThrowingIronRod },
+
+ { {ACTION_USE, OBJECT_IIROD, HOTSPOT_LOCK, 0}, &Room::trial1UseIronRodOnLock },
+ { {ACTION_GET, OBJECT_THROWN_IRON_ROD, 0, 0}, &Room::trial1GetThrownIronRod },
+ { {ACTION_WALK, HOTSPOT_DOOR, 0, 0}, &Room::trial1WalkToDoor },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::trial1UseMedkit },
+
+ // ENHANCEMENT: Implement actions for the door object, not just the hotspot
+ { {ACTION_LOOK, OBJECT_DOOR, 0, 0}, &Room::trial1LookAtDoor },
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_DOOR, 0}, &Room::trial1UsePhaserOnDoor },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_DOOR, 0}, &Room::trial1UsePhaserOnDoor },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_DOOR, 0}, &Room::trial1UseSTricorderOnDoor },
+ { {ACTION_WALK, OBJECT_DOOR, 0, 0}, &Room::trial1WalkToDoor },
};
extern const int trial1NumActions = sizeof(trial1ActionList) / sizeof(RoomAction);
void Room::trial1Tick1() {
+ if (!_vm->_awayMission.trial.doorOpen) {
+ _vm->_awayMission.disableInput = 2;
+ loadActorAnim2(OBJECT_DOOR, "t1drc");
+ }
+ if (!_vm->_awayMission.trial.entityDefeated) {
+ loadActorAnim2(OBJECT_ENTITY, "ec", 0x5f, 0xb1, 3); // No callback defined
+ playVoc("TRI1LOOP");
+ }
+}
+
+void Room::trial1Tick50() {
+ if (!_vm->_awayMission.trial.doorOpen)
+ _vm->_awayMission.disableInput = false;
+ if (!_vm->_awayMission.trial.entityDefeated) {
+ showText(TX_SPEAKER_BENNIE, TX_TRI1_056);
+ showText(TX_SPEAKER_SPOCK, TX_TRI1_047);
+ showText(TX_SPEAKER_MCCOY, TX_TRI1_032);
+ showText(TX_SPEAKER_KIRK, TX_TRI1_007);
+ showText(TX_SPEAKER_BENNIE, TX_TRI1_057);
+ showText(TX_SPEAKER_KIRK, TX_TRI1_010);
+ showText(TX_SPEAKER_BENNIE, TX_TRI1_055);
+ }
+}
+
+void Room::trial1DoorOpened() { // Called after Spock opens the door
+ _vm->_awayMission.trial.doorOpen = true;
+ loadActorStandAnim(OBJECT_DOOR);
+}
+
+void Room::trial1TouchedHotspot0() { // Kirk touched the energy thing
+ if (!_vm->_awayMission.trial.entityDefeated) {
+ // BUGFIX: Disable input, otherwise you can cancel the death
+ _vm->_awayMission.disableInput = true;
+ loadActorAnimC(OBJECT_KIRK, "kkills", -1, -1, &Room::trial1KirkDied);
+ }
+}
+
+void Room::trial1KirkDied() {
+ showGameOverMenu();
+}
+
+void Room::trial1TouchedHotspot1() { // Entered the door
+ if (_vm->_awayMission.trial.doorOpen) {
+ _vm->_awayMission.disableInput = true;
+ loadRoomIndex(2, 2);
+ }
+}
+
+
+void Room::trial1GetRod() {
+ _vm->_awayMission.disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0xe9, 0xa9, &Room::trial1ReachedRod);
+}
+
+void Room::trial1ReachedRod() {
+ loadActorAnimC(OBJECT_KIRK, "t1pkup", 0xe9, 0xa9, &Room::trial1PickedUpRod);
+ giveItem(OBJECT_IWROD);
+ if (!_vm->_awayMission.trial.gotPointsForGettingRod) {
+ _vm->_awayMission.trial.gotPointsForGettingRod = true;
+ _vm->_awayMission.trial.missionScore += 1;
+ }
+}
+
+void Room::trial1PickedUpRod() {
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::trial1LookAtKirk() {
+ showText(TX_TRI1N003);
+}
+
+void Room::trial1LookAtSpock() {
+ showText(TX_TRI1N017);
+}
+
+void Room::trial1LookAtMccoy() {
+ showText(TX_TRI1N016);
+}
+
+void Room::trial1LookAtRedshirt() {
+ showText(TX_TRI1N015);
+}
+
+void Room::trial1LookAtWall() {
+ showText(TX_TRI1N011);
+}
+
+void Room::trial1LookAtFloor() {
+ showText(TX_TRI1N006);
+}
+
+void Room::trial1LookAtRods() {
+ showText(TX_TRI1N009);
+}
+
+void Room::trial1LookAtDoor() {
+ showText(TX_TRI1N001);
+}
+
+void Room::trial1LookAtLock() {
+ showText(TX_TRI1N002);
+}
+
+void Room::trial1LookAtEntity() {
+ showText(TX_TRI1N000);
+}
+
+void Room::trial1LookAtMoltenRock() {
+ showText(TX_TRI1N007);
+}
+
+void Room::trial1TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_TRI1_J00);
+}
+
+void Room::trial1TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_TRI1_046);
+ showText(TX_SPEAKER_MCCOY, TX_TRI1_034);
+}
+
+void Room::trial1TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI1_019);
+}
+
+void Room::trial1TalkToRedshirt() {
+ showText(TX_SPEAKER_BENNIE, TX_TRI1_053);
+}
+
+void Room::trial1TalkToEntity() {
+ showText(TX_SPEAKER_ENTITY, TX_TRI1C001);
+}
+
+void Room::trial1UsePhaserOnCrewman() {
+ showText(TX_SPEAKER_BENNIE, TX_TRI1_048);
+}
+
+void Room::trial1UsePhaserOnEntity() {
+ showText(TX_TRI1N004);
+}
+
+void Room::trial1UsePhaserOnWall() {
+ showText(TX_TRI1N008);
+}
+
+
+void Room::trial1UseStunPhaserOnFloor() {
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ walkCrewmanC(OBJECT_KIRK, 0xca, 0xbc, &Room::trial1ReachedFloorToUseStunPhaser);
+}
+
+void Room::trial1ReachedFloorToUseStunPhaser() {
+ playSoundEffectIndex(SND_PHASSHOT);
+ loadActorAnimC(OBJECT_KIRK, "t1mlts", 0xca, 0xbc, &Room::trial1DoneShootingFloorWithStunPhaser);
+}
+
+void Room::trial1DoneShootingFloorWithStunPhaser() {
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ loadActorStandAnim(OBJECT_KIRK);
+}
+
+
+void Room::trial1UseKillPhaserOnFloor() {
+ _vm->_awayMission.disableInput = true;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ walkCrewmanC(OBJECT_KIRK, 0xca, 0xbc, &Room::trial1ReachedFloorToUseKillPhaser);
+}
+
+void Room::trial1ReachedFloorToUseKillPhaser() {
+ playSoundEffectIndex(SND_PHASSHOT);
+ loadActorAnimC(OBJECT_KIRK, "t1mltk", 0xca, 0xbc, &Room::trial1DoneShootingFloorWithKillPhaser);
+}
+
+void Room::trial1DoneShootingFloorWithKillPhaser() {
+ showText(TX_TRI1N014);
+ loadActorAnim2(OBJECT_MOLTEN_ROCK, "t1mltd", 0xca, 0xbc);
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ loadActorStandAnim(OBJECT_KIRK);
+
+ // BUG: Infinite score mechanism
+ _vm->_awayMission.trial.missionScore += 1;
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::trial1UsePhaserOnRod() {
+ showText(TX_TRI1N012);
+}
+
+void Room::trial1UsePhaserOnDoor() {
+ showText(TX_SPEAKER_SPOCK, TX_TRI1_040);
+}
+
+void Room::trial1UsePhaserOnLock() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI1_021);
+}
+
+void Room::trial1UseMTricorderOnKirk() {
+ mccoyScan(DIR_S, TX_TRI1_024, true);
+}
+
+void Room::trial1UseMTricorderOnSpock() {
+ // ENHANCEMENT: Original didn't play tricorder sound, etc
+ mccoyScan(DIR_S, TX_TRI1_025, true);
+}
+
+void Room::trial1UseMTricorderOnMccoy() {
+ mccoyScan(DIR_S, TX_TRI1_022, true);
+}
+
+void Room::trial1UseMTricorderOnRedshirt() {
+ mccoyScan(DIR_S, TX_TRI1_023, true);
+}
+
+void Room::trial1UseMTricorderOnEntity() {
+ mccoyScan(DIR_S, TX_TRI1_017, true);
+}
+
+void Room::trial1UseSTricorderOnWall() {
+ spockScan(DIR_S, TX_TRI1_043, true);
+}
+
+void Room::trial1UseSTricorderOnEntity() {
+ spockScan(DIR_S, TX_TRI1_012, true);
+
+ // BUG: infinite score mechanism
+ _vm->_awayMission.trial.missionScore += 1;
+}
+
+void Room::trial1UseSTricorderOnRods() {
+ spockScan(DIR_S, TX_TRI1_041, true);
+}
+
+void Room::trial1UseSTricorderOnFloor() {
+ spockScan(DIR_S, TX_TRI1_042, true);
+
+ // BUG: infinite score mechanism
+ _vm->_awayMission.trial.missionScore += 1;
+}
+
+void Room::trial1UseSTricorderOnDoor() {
+ spockScan(DIR_S, TX_TRI1_013, true);
+}
+
+void Room::trial1UseSTricorderOnLock() {
+ spockScan(DIR_S, TX_TRI1_014, true);
+
+ if (!_vm->_awayMission.trial.scannedLock) {
+ _vm->_awayMission.trial.scannedLock = true;
+ // BUGFIX: Moved this into the if statement (used to be an infinite score mechanism)
+ _vm->_awayMission.trial.missionScore += 1;
+ }
+}
+
+void Room::trial1UseCommunicator() {
+ if (_vm->_awayMission.trial.forceFieldDown) {
+ showText(TX_SPEAKER_UHURA, TX_TRI1U090);
+
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI1_005, TX_TRI1_004, TX_TRI1_009,
+ TX_BLANK
+ };
+ int choice = showText(choices);
+
+ if (choice == 0) { // "Beam us back to the enterprise"
+ _vm->_awayMission.trial.field5f = 1;
+ endMission(1, 1, 1);
+ } else if (choice == 1) { // "Beam us to Vlict's position"
+ showText(TX_SPEAKER_UHURA, TX_TRI1U080);
+ _vm->_awayMission.disableInput = true;
+ loadRoomIndex(4, 4);
+ } // Else don't transport anywhere
+ } else { // Force field still up
+ if (_vm->_awayMission.trial.uhuraAnalyzedCode)
+ showText(TX_SPEAKER_UHURA, TX_TRI1U068);
+ else {
+ showText(TX_SPEAKER_UHURA, TX_TRI1U086);
+ showText(TX_SPEAKER_UHURA, TX_TRI1U106);
+ showText(TX_SPEAKER_UHURA, TX_TRI1U098);
+
+ if (_vm->_awayMission.trial.scannedLock) {
+ showText(TX_SPEAKER_KIRK, TX_TRI1_011);
+ showText(TX_SPEAKER_UHURA, TX_TRI1U101);
+
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI1_006, TX_TRI1_002,
+ TX_BLANK
+ };
+ int choice = showText(choices);
+
+ if (choice == 0) { // Don't analyze the anomolous program
+ showText(TX_SPEAKER_UHURA, TX_TRI1U079);
+ _vm->_awayMission.trial.doorCodeBehaviour = 2;
+ _vm->_awayMission.trial.uhuraAnalyzedCode = true;
+ _vm->_awayMission.trial.missionScore += 1;
+ } else { // Analyze the anomolous program
+ showText(TX_SPEAKER_UHURA, TX_TRI1U102);
+
+ const TextRef choices2[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI1_003, TX_TRI1_008,
+ TX_BLANK
+ };
+ choice = showText(choices2);
+
+ if (choice == 0) { // Activate the program
+ showText(TX_SPEAKER_UHURA, TX_TRI1U095);
+ _vm->_awayMission.trial.doorCodeBehaviour = 5;
+ _vm->_awayMission.trial.uhuraAnalyzedCode = true;
+ _vm->_awayMission.trial.missionScore += 3;
+ } else { // Don't activate, only open the door
+ showText(TX_SPEAKER_UHURA, TX_TRI1U079);
+ _vm->_awayMission.trial.doorCodeBehaviour = 2;
+ _vm->_awayMission.trial.uhuraAnalyzedCode = true;
+ _vm->_awayMission.trial.missionScore += 1;
+ }
+ }
+ }
+ }
+ }
+}
+
+void Room::trial1UseMccoyOnEntity() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI1_016);
+}
+
+void Room::trial1UseMccoyOnLock() {
+ if (!_vm->_awayMission.trial.entityDefeated)
+ showText(TX_SPEAKER_MCCOY, TX_TRI1_018);
+ else if (_vm->_awayMission.trial.doorCodeBehaviour == 0)
+ showText(TX_SPEAKER_MCCOY, TX_TRI1_020);
+ else
+ showText(TX_SPEAKER_MCCOY, TX_TRI1_029);
+}
+
+void Room::trial1UseMccoyOnFloor() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI1_031);
+}
+
+void Room::trial1UseSpockOnEntity() {
+ showText(TX_SPEAKER_SPOCK, TX_TRI1_039);
+}
+
+
+void Room::trial1UseSpockOnLock() {
+ if (_vm->_awayMission.trial.doorOpen)
+ showText(TX_SPEAKER_SPOCK, TX_TRI1_038);
+ else if (!_vm->_awayMission.trial.entityDefeated)
+ showText(TX_SPEAKER_SPOCK, TX_TRI1_036);
+ else if (_vm->_awayMission.trial.doorCodeBehaviour == 0)
+ showText(TX_SPEAKER_SPOCK, TX_TRI1_044);
+ else if (_vm->_awayMission.trial.doorCodeBehaviour == 2)
+ walkCrewmanC(OBJECT_SPOCK, 0x1f, 0xb8, &Room::trial1SpockReachedKeypad);
+ else
+ walkCrewmanC(OBJECT_SPOCK, 0x1f, 0xb8, &Room::trial1SpockReachedKeypadWithExtraProgram);
+}
+
+void Room::trial1SpockReachedKeypad() { // Spock opens the door
+ playSoundEffectIndex(SND_07);
+ loadActorAnimC(OBJECT_SPOCK, "susemw", -1, -1, &Room::trial1SpockUsedKeypad);
+}
+
+void Room::trial1SpockUsedKeypad() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ loadActorStandAnim(OBJECT_SPOCK);
+ playSoundEffectIndex(SND_DOOR1);
+ loadActorAnimC(OBJECT_DOOR, "t1drco", -1, -1, &Room::trial1DoorOpened);
+ _vm->_awayMission.trial.doorOpen = true;
+}
+
+void Room::trial1SpockReachedKeypadWithExtraProgram() { // Spock activates the unknown program
+ playSoundEffectIndex(SND_07);
+ loadActorAnimC(OBJECT_SPOCK, "susemw", -1, -1, &Room::trial1SpockUsedKeypadWithExtraProgram);
+}
+
+void Room::trial1SpockUsedKeypadWithExtraProgram() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ loadActorStandAnim(OBJECT_SPOCK);
+
+ _vm->_awayMission.disableInput = true;
+ loadRoomIndex(5, 5);
+}
+
+
+void Room::trial1UseSpockOnFloor() {
+ showText(TX_SPEAKER_SPOCK, TX_TRI1_035);
+}
+
+void Room::trial1UseRedshirtOnEntity() {
+ showText(TX_SPEAKER_BENNIE, TX_TRI1_050);
+}
+
+
+void Room::trial1UseRedshirtOnLock() {
+ if (_vm->_awayMission.trial.doorOpen)
+ return;
+ else if (!_vm->_awayMission.trial.entityDefeated)
+ showText(TX_SPEAKER_BENNIE, TX_TRI1_051);
+ else if (_vm->_awayMission.trial.doorCodeBehaviour == 0)
+ showText(TX_SPEAKER_BENNIE, TX_TRI1_054);
+ else if (_vm->_awayMission.trial.doorCodeBehaviour == 2)
+ walkCrewmanC(OBJECT_REDSHIRT, 0x1f, 0xb8, &Room::trial1RedshirtReachedKeypad);
+ else
+ walkCrewmanC(OBJECT_REDSHIRT, 0x1f, 0xb8, &Room::trial1RedshirtReachedKeypadWithExtraProgram);
+}
+
+void Room::trial1RedshirtReachedKeypad() { // Redshirt opens the lock
+ playSoundEffectIndex(SND_07);
+ loadActorAnimC(OBJECT_REDSHIRT, "rusemw", -1, -1, &Room::trial1RedshirtUsedKeypad);
+}
+
+void Room::trial1RedshirtUsedKeypad() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ loadActorStandAnim(OBJECT_REDSHIRT);
+ playSoundEffectIndex(SND_DOOR1);
+ loadActorAnimC(OBJECT_DOOR, "t1drco", -1, -1, &Room::trial1DoorOpened);
+ _vm->_awayMission.trial.doorOpen = true;
+}
+
+void Room::trial1RedshirtReachedKeypadWithExtraProgram() {
+ playSoundEffectIndex(SND_07);
+ loadActorAnimC(OBJECT_REDSHIRT, "rusemw", -1, -1, &Room::trial1RedshirtUsedKeypadWithExtraProgram);
+}
+
+void Room::trial1RedshirtUsedKeypadWithExtraProgram() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ loadActorStandAnim(OBJECT_REDSHIRT);
+
+ _vm->_awayMission.disableInput = true;
+ loadRoomIndex(5, 5);
+}
+
+
+void Room::trial1UseRedshirtOnFloor() {
+ showText(TX_SPEAKER_BENNIE, TX_TRI1_049);
+}
+
+void Room::trial1UseRodOnMccoy() {
+ // ENHANCEMENT: This was originally only voiced with the wooden rod, not the iron rod.
+ // (This applies to the Spock and Redshirt functions below, too.)
+ showText(TX_SPEAKER_MCCOY, TX_TRI1_027);
+}
+
+void Room::trial1UseRodOnSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_TRI1_037);
+}
+
+void Room::trial1UseRodOnRedshirt() {
+ showText(TX_SPEAKER_BENNIE, TX_TRI1_052);
+}
+
+void Room::trial1UseRodOnFloorOrWall() {
+ showText(TX_TRI1C002);
+}
+
+
+void Room::trial1UseWoodRodOnEntity() {
+ _vm->_awayMission.disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0xe9, 0xad, &Room::trial1ReachedPositionToThrowWoodRod);
+ loseItem(OBJECT_IWROD);
+}
+
+void Room::trial1ReachedPositionToThrowWoodRod() {
+ loadActorAnimC(OBJECT_KIRK, "kthrwr", 0xe9, 0xad, &Room::trial1DoneThrowingWoodRod);
+}
+
+void Room::trial1DoneThrowingWoodRod() {
+ _vm->_awayMission.disableInput = false;
+}
+
+
+void Room::trial1UseWoodRodOnLock() {
+ showText(TX_TRI1N005);
+}
+
+
+void Room::trial1UseWoodRodOnMoltenRock() {
+ _vm->_awayMission.disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0xe4, 0xc4, &Room::trial1ReachedMoltenRock);
+}
+
+void Room::trial1ReachedMoltenRock() {
+ loadActorAnimC(OBJECT_KIRK, "t1dip", 0xe4, 0xc4, &Room::trial1DoneCoatingWoodRod);
+}
+
+void Room::trial1DoneCoatingWoodRod() {
+ _vm->_awayMission.disableInput = false;
+ showText(TX_TRI1N013);
+ loseItem(OBJECT_IWROD);
+ giveItem(OBJECT_IIROD);
+
+ if (!_vm->_awayMission.trial.gotPointsForCoatingRodWithIron) {
+ _vm->_awayMission.trial.gotPointsForCoatingRodWithIron = true;
+ _vm->_awayMission.trial.missionScore += 1;
+ }
+}
+
+
+void Room::trial1UseIronRodOnEntity() {
+ _vm->_awayMission.disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0xe9, 0xac, &Room::trial1ReachedPositionToThrowIronRod);
+ _vm->_awayMission.trial.entityDefeated = true;
+ loseItem(OBJECT_IIROD);
+}
+
+void Room::trial1ReachedPositionToThrowIronRod() {
+ loadActorAnimC(OBJECT_KIRK, "kthri", 0xe9, 0xac, &Room::trial1DoneThrowingIronRod);
+ loadActorStandAnim(OBJECT_ENTITY);
+}
+
+void Room::trial1DoneThrowingIronRod() {
+ loadActorAnim(OBJECT_THROWN_IRON_ROD, "t1irod", 0xe9, 0xac, 8); // No callback defined
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ loadActorStandAnim(OBJECT_KIRK);
+
+ _vm->_awayMission.disableInput = false;
+ stopAllVocSounds();
+ showText(TX_SPEAKER_SPOCK, TX_TRI1_045);
+ showText(TX_SPEAKER_MCCOY, TX_TRI1_033);
+
+ _vm->_awayMission.trial.missionScore += 1;
+}
+
+
+void Room::trial1UseIronRodOnLock() {
+ showText(TX_TRI1N004);
+}
+
+void Room::trial1GetThrownIronRod() {
+ showText(TX_SPEAKER_SPOCK, TX_TRI1_015);
+}
+
+void Room::trial1WalkToDoor() {
+ if (_vm->_awayMission.trial.doorOpen)
+ walkCrewman(OBJECT_KIRK, 0x1a, 0xac, 28);
+}
+
+void Room::trial1UseMedkit() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI1_026);
}
}
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 3570863..766e6e6 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -110,6 +110,7 @@ enum GameStringIDs {
TX_SPEAKER_BENNIE,
TX_SPEAKER_VLICT,
TX_SPEAKER_KLINGON_GUARD,
+ TX_SPEAKER_ENTITY,
TX_BRIDU146,
@@ -2068,6 +2069,101 @@ enum GameStringIDs {
TX_TRI0U075,
+ // UNUSED (001)
+ TX_TRI1_002,
+ TX_TRI1_003,
+ TX_TRI1_004,
+ TX_TRI1_005,
+ TX_TRI1_006,
+ TX_TRI1_007,
+ TX_TRI1_008,
+ TX_TRI1_009,
+ TX_TRI1_010,
+ TX_TRI1_011,
+ TX_TRI1_012,
+ TX_TRI1_013,
+ TX_TRI1_014,
+ TX_TRI1_015,
+ TX_TRI1_016,
+ TX_TRI1_017,
+ TX_TRI1_018,
+ TX_TRI1_019,
+ TX_TRI1_020,
+ TX_TRI1_021,
+ TX_TRI1_022,
+ TX_TRI1_023,
+ TX_TRI1_024,
+ TX_TRI1_025,
+ TX_TRI1_026,
+ TX_TRI1_027,
+ // UNUSED
+ TX_TRI1_029,
+ TX_TRI1_030,
+ TX_TRI1_031,
+ TX_TRI1_032,
+ TX_TRI1_033,
+ TX_TRI1_034,
+ TX_TRI1_035,
+ TX_TRI1_036,
+ TX_TRI1_037,
+ TX_TRI1_038,
+ TX_TRI1_039,
+ TX_TRI1_040,
+ TX_TRI1_041,
+ TX_TRI1_042,
+ TX_TRI1_043,
+ TX_TRI1_044,
+ TX_TRI1_045,
+ TX_TRI1_046,
+ TX_TRI1_047,
+ TX_TRI1_048,
+ TX_TRI1_049,
+ TX_TRI1_050,
+ TX_TRI1_051,
+ TX_TRI1_052,
+ TX_TRI1_053,
+ TX_TRI1_054,
+ TX_TRI1_055,
+ TX_TRI1_056,
+ TX_TRI1_057,
+ // UNUSED (058 -> 066)
+ TX_TRI1_J00,
+ TX_TRI1N000,
+ TX_TRI1N001,
+ TX_TRI1N002,
+ TX_TRI1N003,
+ TX_TRI1N004,
+ TX_TRI1N005,
+ TX_TRI1N006,
+ TX_TRI1N007,
+ TX_TRI1N008,
+ TX_TRI1N009,
+ // UNUSED
+ TX_TRI1N011,
+ TX_TRI1N012,
+ TX_TRI1N013,
+ TX_TRI1N014,
+ TX_TRI1N015,
+ TX_TRI1N016,
+ TX_TRI1N017,
+ // UNUSED (018 -> 019)
+ TX_TRI1U068,
+ TX_TRI1U079,
+ TX_TRI1U080,
+ TX_TRI1U086,
+ TX_TRI1U090,
+ TX_TRI1U095,
+ TX_TRI1U098,
+ TX_TRI1U101,
+ TX_TRI1U102,
+ TX_TRI1U106,
+ // UNUSED: TRI1UO68 (that's 'O', not '0'); same as TRI1U068 but before the voice
+ // filter on the communicator is applied?
+ // There are also TRI3 audio files in the TRI1 folder?
+ TX_TRI1C001, // Custom
+ TX_TRI1C002,
+
+
TX_TRI4_076,
@@ -2133,6 +2229,7 @@ const char * const g_gameStrings[] = {
"Ensign Bennie",
"Vlict",
"Klingon Guard",
+ "Entity",
"#BRID\\BRIDU146#Nothing to report, Captain.",
@@ -4069,6 +4166,93 @@ const char * const g_gameStrings[] = {
"#TRI0\\TRI0U075#Uhura here. Captain, there's a force field over the planet. We will not be able to beam you aboard.",
+ "#TRI1\\TRI1_002#Affirmative, Uhura.",
+ "#TRI1\\TRI1_003#Affirmative.",
+ "#TRI1\\TRI1_004#Beam us to Vlict's position.",
+ "#TRI1\\TRI1_005#Beam us back to the Enterprise. Kirk out.",
+ "#TRI1\\TRI1_006#I want that door open.",
+ "#TRI1\\TRI1_007#I somehow doubt that Vlict intends for us to survive this, whatever the outcome. We're the only thing that stands between him and the killing of Quetzecoatl that he can justify.",
+ "#TRI1\\TRI1_008#Negative. Transmit the door entry code only.",
+ "#TRI1\\TRI1_009#Negative.",
+ "#TRI1\\TRI1_010#That's not true, Ensign. However, I suspect that Vlict's attack on Hrakkour exceeded his orders. He needs Quetzecoatl as a scapegoat, and he needs a fair trial to avoid an inquiry of his own actions.",
+ "#TRI1\\TRI1_011#Uhura, prepare to receive a tricorder message. There is a door with an entry coder here; try to analyze the circuits and let the main computer crack the code.",
+ "#TRI1\\TRI1_012#This creature is composed of electrical fields. I would not recommend approaching it. A metal projectile might disrupt its fields and render it harmless.",
+ "#TRI1\\TRI1_013#A Klingon entry door, slightly antiquated.",
+ "#TRI1\\TRI1_014#An entry coder for the door, keyed to a number sequence. The tricorder is unable to determine the code, but can scan the mechanism.",
+ "#TRI1\\TRI1_015#Captain, I would strongly recommend against disturbing the rod. It could result in awakening the creature or possibly electrocuting you.",
+ "#TRI1\\TRI1_016#Do you know what ten million volts can do to a man? It can ruin his whole damn day.",
+ "#TRI1\\TRI1_017#Does not register as a known life form.",
+ "#TRI1\\TRI1_018#Find someone else to be a volunteer. I've retired.",
+ "#TRI1\\TRI1_019#How could you do it, Jim? I spent hours trying to save his life, and you just gave him away in seconds to the Klingons!",
+ "#TRI1\\TRI1_020#I don't know the code.",
+ "#TRI1\\TRI1_021#Jim! Are you mad? that's our only way out!",
+ "#TRI1\\TRI1_022#One Male Human, average physical condition.",
+ "#TRI1\\TRI1_023#He's a Male Human, excellent physical condition.",
+ "#TRI1\\TRI1_024#Male Human, good physical condition.",
+ "#TRI1\\TRI1_025#Male Human-Vulcan hybrid. Excellent physical condition.",
+ "#TRI1\\TRI1_026#Nobody needs healing, Jim, but you will if they harm my patient.",
+ "#TRI1\\TRI1_027#Ouch!",
+ "#TRI1\\TRI1_029#This is not in my field of expertise.",
+ "#TRI1\\TRI1_030#This is not in my field of expertise.",
+ "#TRI1\\TRI1_031#What the blazes do you want me to do on a rock?",
+ "#TRI1\\TRI1_032#A test of courage? That is the Klingon way.",
+ "#TRI1\\TRI1_033#I'll bet it'll be mad.",
+ "#TRI1\\TRI1_034#Shut up Spock!",
+ "#TRI1\\TRI1_035#I do not understand the desired course of action.",
+ "#TRI1\\TRI1_036#If you will observe the position of the creature, Captain, I think that you will find that it prevents access to the keypad.",
+ "#TRI1\\TRI1_037#Ouch!",
+ "#TRI1\\TRI1_038#The door is already open Captain.",
+ "#TRI1\\TRI1_039#The odds of surviving contact with the creature are too small to calculate.",
+ "#TRI1\\TRI1_040#There is a high probability that shooting the door would be hasardous to our wellbeing.",
+ "#TRI1\\TRI1_041#These wooden rods are support beams that were not placed.",
+ "#TRI1\\TRI1_042#This rock has a high iron content.",
+ "#TRI1\\TRI1_043#This wall was carved from the natural rock.",
+ "#TRI1\\TRI1_044#We do not know the code, Captain.",
+ "#TRI1\\TRI1_045#As I suspected, Captain. The creature is in stasis. It should awaken in 3.48 days.",
+ "#TRI1\\TRI1_046#Captain, I have calculated the odds of surviving this at...",
+ "#TRI1\\TRI1_047#Not much is known about Hrakkour, Ensign. This would appear to be some sort of a mining installation; that creature might be a native lifeform.",
+ "#TRI1\\TRI1_048#Captain, my instructor at the Academy always told me that if you don't know what you're going to do with a phaser, you shouldn't draw it.",
+ "#TRI1\\TRI1_049#Do you want me to arrest it, interrogate it, or beat it up, Captain?",
+ "#TRI1\\TRI1_050#I refuse, Captain, on the grounds that it might eliminate me.",
+ "#TRI1\\TRI1_051#I refuse, Captain, on the grounds that it might eliminate me.",
+ "#TRI1\\TRI1_052#Ouch!",
+ "#TRI1\\TRI1_053#You handled those Klingons well, sir. We've got them on the run now.",
+ "#TRI1\\TRI1_054#You want me to smash it? But that's our only way out of here.",
+ "#TRI1\\TRI1_055#And our deaths will be the only way he can get it. Great.",
+ "#TRI1\\TRI1_056#What is this place?",
+ "#TRI1\\TRI1_057#Why should he worry about justification, Captain? He's a Klingon. Murder is as natural to them as breathing!",
+ "#TRI1\\TRI1_J00#Why do I have the feeling that I'm about to have a bad day?",
+ "#TRI1\\TRI1N000#A field of static lightning. It seems to be moving in a purposeful manner.",
+ "#TRI1\\TRI1N001#A slightly antiquated Klingon door, opened by a keycode entry.",
+ "#TRI1\\TRI1N002#A slightly antiquated Klingon lock-mechanism.",
+ "#TRI1\\TRI1N003#James T. Kirk, hero of the galaxy!",
+ "#TRI1\\TRI1N004#No effect.",
+ "#TRI1\\TRI1N005#No effect.",
+ "#TRI1\\TRI1N006#The floor is incomplete, made of unrefined, natural rock.",
+ "#TRI1\\TRI1N007#The melted rock is cooling, but still remains in a molten state.",
+ "#TRI1\\TRI1N008#The wall is resistant to phaser fire.",
+ "#TRI1\\TRI1N009#These wooden rods are support beams that were not placed.",
+ "#TRI1\\TRI1N011#This section of wall was carved by some sort of plasma field.",
+ "#TRI1\\TRI1N012#You burn one of the rods.",
+ "#TRI1\\TRI1N013#You coat the rod with molten iron. It hardens quickly.",
+ "#TRI1\\TRI1N014#You melt some of the rock.",
+ "#TRI1\\TRI1N015#Your ever dependable crewman, Ensign Bennie.",
+ "#TRI1\\TRI1N016#Your ever emotional friend, Dr. McCoy.",
+ "#TRI1\\TRI1N017#Your ever logical friend, Spock.",
+ "#TRI1\\TRI1U068#Nothing else to report Captain.",
+ "#TRI1\\TRI1U079#Affirmative sir. We will transmit code when you activate the keycode. Uhura out.",
+ "#TRI1\\TRI1U080#Affirmative, sir.",
+ "#TRI1\\TRI1U086#Captain, there is a force field between us and the planet.",
+ "#TRI1\\TRI1U090#Do you wish to be beamed up now Captain?",
+ "#TRI1\\TRI1U095#Good luck, Captain.",
+ "#TRI1\\TRI1U098#Keep us informed, we'll help you all we can. We can analyze any data you gather through the main computer.",
+ "#TRI1\\TRI1U101#Scan complete. Main computer has the code. We also read an anomaly. Something else has tapped into the keycode. Shall I analyze?",
+ "#TRI1\\TRI1U102#Sir, we have a secondary code that is nested in the Klingon program. Computer is unable to analyze its function. Shall we broadcast it to you when you activate the keypad?",
+ "#TRI1\\TRI1U106#We have your position at approximately thirty meters beneath the surface of Hrakkour, in what appears to be the ruins of an archeological dig.",
+ "Zzzt! Sptttz! Zzzt! Tttt!",
+ "Clunk.",
+
+
"#TRI4\\TRI4_076#You humans have an excellent imagination, but a poor grasp of reality.",
Commit: 0786bd314bb7c1f6d9b5728128a3c1a1ad17f649
https://github.com/scummvm/scummvm/commit/0786bd314bb7c1f6d9b5728128a3c1a1ad17f649
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: TRIAL1 typos
Changed paths:
engines/startrek/text.h
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 766e6e6..a19bf20 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -2098,7 +2098,7 @@ enum GameStringIDs {
TX_TRI1_027,
// UNUSED
TX_TRI1_029,
- TX_TRI1_030,
+ TX_TRI1_030, // UNUSED
TX_TRI1_031,
TX_TRI1_032,
TX_TRI1_033,
@@ -4189,7 +4189,7 @@ const char * const g_gameStrings[] = {
"#TRI1\\TRI1_022#One Male Human, average physical condition.",
"#TRI1\\TRI1_023#He's a Male Human, excellent physical condition.",
"#TRI1\\TRI1_024#Male Human, good physical condition.",
- "#TRI1\\TRI1_025#Male Human-Vulcan hybrid. Excellent physical condition.",
+ "#TRI1\\TRI1_025#One male Human-Vulcan hybrid. Excellent physical condition.", // TYPO
"#TRI1\\TRI1_026#Nobody needs healing, Jim, but you will if they harm my patient.",
"#TRI1\\TRI1_027#Ouch!",
"#TRI1\\TRI1_029#This is not in my field of expertise.",
@@ -4211,7 +4211,7 @@ const char * const g_gameStrings[] = {
"#TRI1\\TRI1_045#As I suspected, Captain. The creature is in stasis. It should awaken in 3.48 days.",
"#TRI1\\TRI1_046#Captain, I have calculated the odds of surviving this at...",
"#TRI1\\TRI1_047#Not much is known about Hrakkour, Ensign. This would appear to be some sort of a mining installation; that creature might be a native lifeform.",
- "#TRI1\\TRI1_048#Captain, my instructor at the Academy always told me that if you don't know what you're going to do with a phaser, you shouldn't draw it.",
+ "#TRI1\\TRI1_048#Captain, my instructor at the Academy always told me that if you don't know what you're going to do with your phaser, you shouldn't draw it.", // TYPO
"#TRI1\\TRI1_049#Do you want me to arrest it, interrogate it, or beat it up, Captain?",
"#TRI1\\TRI1_050#I refuse, Captain, on the grounds that it might eliminate me.",
"#TRI1\\TRI1_051#I refuse, Captain, on the grounds that it might eliminate me.",
Commit: 2f3c4b90d756504daa45cb88ef3fd899a87fe51f
https://github.com/scummvm/scummvm/commit/2f3c4b90d756504daa45cb88ef3fd899a87fe51f
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: TRIAL2
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/trial2.cpp
engines/startrek/sound.h
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index d64de68..984ee55 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -275,11 +275,16 @@ struct AwayMission {
// 5: Will activate the unknown program when the keypad is used
byte doorCodeBehaviour; // 0x34
+ bool globSplitInTwo; // 0x35
+ bool globDefeated; // 0x36
+ byte globEnergyLevels[3]; // 0x37
+ bool enteredGlobRoom; // 0x5c
bool forceFieldDown; // 0x5d
bool uhuraAnalyzedCode; // 0x5e
int16 field5f; // 0x5f
bool gotPointsForGettingRod; // 0x61
bool gotPointsForCoatingRodWithIron; // 0x62
+ bool gotPointsForScanningGlob; // 0x64
} trial;
};
};
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index e3c0a96..288c01f 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1842,6 +1842,54 @@ public:
// TRIAL2
void trial2Tick1();
+ void trial2Tick60();
+ void trial2TouchedHotspot0();
+ void trial2LookAtKirk();
+ void trial2LookAtSpock();
+ void trial2LookAtMccoy();
+ void trial2LookAtRedshirt();
+ void trial2LookAtInsignia();
+ void trial2LookAtGlob();
+ void trial2LookAtWall();
+ void trial2LookAtDoor();
+ void trial2TalkToKirk();
+ void trial2TalkToSpock();
+ void trial2TalkToMccoy();
+ void trial2TalkToRedshirt();
+ void trial2TalkToGlob();
+ void trial2UsePhaserOnWall();
+
+ void trial2UsePhaserOnGlob(int object, bool phaserOnKill);
+ void trial2ReachedPositionToShootGlob();
+ void trial2DrewPhaserToShootGlob();
+ void trial2GlobDoneExploding();
+ void trial2GlobDoneSplitting();
+ void trial2KirkDied();
+
+ void trial2UseStunPhaserOnGlob();
+ void trial2UseKillPhaserOnGlob();
+ void trial2UseStunPhaserOnSplitGlob1();
+ void trial2UseKillPhaserOnSplitGlob1();
+ void trial2UseStunPhaserOnSplitGlob2();
+ void trial2UseKillPhaserOnSplitGlob2();
+
+ void trial2UseMTricorderOnKirk();
+ void trial2UseMTricorderOnSpock();
+ void trial2UseMTricorderOnMccoy();
+ void trial2UseMTricorderOnRedshirt();
+ void trial2UseMTricorderOnGlob();
+ void trial2UseSTricorderOnWall();
+ void trial2UseSTricorderAnywhere();
+ void trial2UseSTricorderOnGlob();
+ void trial2UseCommunicator();
+ void trial2UseMccoyOnGlob();
+ void trial2UseMccoyOnWall();
+ void trial2UseSpockOnGlob();
+ void trial2UseSpockOnWall();
+ void trial2UseRedshirtOnGlob();
+ void trial2UseRedshirtOnWall();
+ void trial2WalkToDoor();
+ void trial2UseMedkitAnywhere();
// TRIAL3
void trial3Tick1();
@@ -1989,6 +2037,11 @@ private:
bool insultedQuetzecoatl;
} feather;
+ struct {
+ // trial2
+ byte globBeingShot;
+ bool phaserOnKill;
+ } trial;
} _roomVar;
};
diff --git a/engines/startrek/rooms/trial2.cpp b/engines/startrek/rooms/trial2.cpp
index 1bcec41..e428618 100644
--- a/engines/startrek/rooms/trial2.cpp
+++ b/engines/startrek/rooms/trial2.cpp
@@ -22,16 +22,447 @@
#include "startrek/room.h"
+#define OBJECT_GLOB 8
+#define OBJECT_SPLIT_GLOB_1 9
+#define OBJECT_SPLIT_GLOB_2 10
+#define OBJECT_11 11
+
+#define HOTSPOT_INSIGNIA 0x20 // This doesn't seem to be visible anywhere
+#define HOTSPOT_WALL 0x21 // Same here
+#define HOTSPOT_DOOR 0x22
+
+
+#define GLOB_X 0x46
+#define GLOB_Y 0xaf
+
+#define SPLIT_GLOB_1_X 0x20
+#define SPLIT_GLOB_1_Y 0xaf
+
+#define SPLIT_GLOB_2_X 0x69
+#define SPLIT_GLOB_2_Y 0xaf
+
namespace StarTrek {
+// This room has a good deal of unused code, relating to the "split" globs (automatons).
+// Apparently, it would originally have been possible to interact with the split globs,
+// instead of having them kill the crew right away. This doesn't seem to have quite been
+// finished, though.
+
extern const RoomAction trial2ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::trial2Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::trial2Tick1 },
+ { {ACTION_TICK, 60, 0, 0}, &Room::trial2Tick60 },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::trial2TouchedHotspot0 },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::trial2LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::trial2LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::trial2LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::trial2LookAtRedshirt },
+ { {ACTION_LOOK, HOTSPOT_INSIGNIA, 0, 0}, &Room::trial2LookAtInsignia },
+ { {ACTION_LOOK, OBJECT_GLOB, 0, 0}, &Room::trial2LookAtGlob },
+ { {ACTION_LOOK, OBJECT_SPLIT_GLOB_1, 0, 0}, &Room::trial2LookAtGlob },
+ { {ACTION_LOOK, OBJECT_SPLIT_GLOB_2, 0, 0}, &Room::trial2LookAtGlob },
+ { {ACTION_LOOK, HOTSPOT_WALL, 0, 0}, &Room::trial2LookAtWall },
+ { {ACTION_LOOK, HOTSPOT_DOOR, 0, 0}, &Room::trial2LookAtDoor },
+
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::trial2TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::trial2TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::trial2TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::trial2TalkToRedshirt },
+ { {ACTION_TALK, OBJECT_GLOB, 0, 0}, &Room::trial2TalkToGlob },
+ { {ACTION_TALK, OBJECT_SPLIT_GLOB_1, 0, 0}, &Room::trial2TalkToGlob },
+ { {ACTION_TALK, OBJECT_SPLIT_GLOB_2, 0, 0}, &Room::trial2TalkToGlob },
+
+ { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_WALL, 0}, &Room::trial2UsePhaserOnWall },
+ { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_WALL, 0}, &Room::trial2UsePhaserOnWall },
+
+ { {ACTION_DONE_WALK, 7, 0, 0}, &Room::trial2ReachedPositionToShootGlob },
+ { {ACTION_DONE_ANIM, 10, 0, 0}, &Room::trial2DrewPhaserToShootGlob },
+ { {ACTION_DONE_ANIM, 4, 0, 0}, &Room::trial2GlobDoneExploding },
+ { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::trial2GlobDoneSplitting },
+ { {ACTION_DONE_ANIM, 19, 0, 0}, &Room::trial2KirkDied },
+
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_GLOB, 0}, &Room::trial2UseStunPhaserOnGlob },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_GLOB, 0}, &Room::trial2UseKillPhaserOnGlob },
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_SPLIT_GLOB_1, 0}, &Room::trial2UseStunPhaserOnSplitGlob1 },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_SPLIT_GLOB_1, 0}, &Room::trial2UseKillPhaserOnSplitGlob1 },
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_SPLIT_GLOB_2, 0}, &Room::trial2UseStunPhaserOnSplitGlob2 },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_SPLIT_GLOB_2, 0}, &Room::trial2UseKillPhaserOnSplitGlob2 },
+
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::trial2UseMTricorderOnKirk },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::trial2UseMTricorderOnSpock },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::trial2UseMTricorderOnMccoy },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::trial2UseMTricorderOnRedshirt },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_GLOB, 0}, &Room::trial2UseMTricorderOnGlob },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPLIT_GLOB_1, 0}, &Room::trial2UseMTricorderOnGlob },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPLIT_GLOB_2, 0}, &Room::trial2UseMTricorderOnGlob },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_WALL, 0}, &Room::trial2UseSTricorderOnWall },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::trial2UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_GLOB, 0}, &Room::trial2UseSTricorderOnGlob },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_SPLIT_GLOB_1, 0}, &Room::trial2UseSTricorderOnGlob },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_SPLIT_GLOB_2, 0}, &Room::trial2UseSTricorderOnGlob },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::trial2UseCommunicator },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_SPLIT_GLOB_1, 0}, &Room::trial2UseMccoyOnGlob },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_SPLIT_GLOB_2, 0}, &Room::trial2UseMccoyOnGlob },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_WALL, 0}, &Room::trial2UseMccoyOnWall },
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_SPLIT_GLOB_1, 0}, &Room::trial2UseSpockOnGlob },
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_SPLIT_GLOB_2, 0}, &Room::trial2UseSpockOnGlob },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_WALL, 0}, &Room::trial2UseSpockOnWall },
+ { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_SPLIT_GLOB_1, 0}, &Room::trial2UseRedshirtOnGlob },
+ { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_SPLIT_GLOB_2, 0}, &Room::trial2UseRedshirtOnGlob },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_WALL, 0}, &Room::trial2UseRedshirtOnWall },
+
+ { {ACTION_WALK, HOTSPOT_DOOR, 0, 0}, &Room::trial2WalkToDoor },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::trial2UseMedkitAnywhere },
+
+ // ENHANCEMENT: Define these actions for the main glob, not just the (unused) split
+ // globs
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_GLOB, 0}, &Room::trial2UseMccoyOnGlob },
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_GLOB, 0}, &Room::trial2UseSpockOnGlob },
+ { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_GLOB, 0}, &Room::trial2UseRedshirtOnGlob },
};
extern const int trial2NumActions = sizeof(trial2ActionList) / sizeof(RoomAction);
void Room::trial2Tick1() {
+ playVoc("NOOOLOOP");
+
+ if (!_vm->_awayMission.trial.enteredGlobRoom)
+ _vm->_awayMission.disableInput = 2;
+
+ if (!_vm->_awayMission.trial.globDefeated) {
+ playMidiMusicTracks(MIDITRACK_24, -1);
+ loadMapFile("trial22");
+
+ if (!_vm->_awayMission.trial.globSplitInTwo) {
+ playVoc("TRI2LOOP");
+ loadActorAnim2(OBJECT_GLOB, "sglob", 0x46, 0xaf);
+ _vm->_awayMission.trial.globEnergyLevels[0] = 1;
+ } else {
+ playVoc("TRI2LOOP");
+ loadActorAnim2(OBJECT_SPLIT_GLOB_1, "sglob", 0x20, 0xaf);
+ loadActorAnim2(OBJECT_SPLIT_GLOB_2, "sglob", 0x69, 0xaf);
+ _vm->_awayMission.trial.globEnergyLevels[1] = 1;
+ _vm->_awayMission.trial.globEnergyLevels[2] = 1;
+ }
+ }
+}
+
+void Room::trial2Tick60() {
+ if (!_vm->_awayMission.trial.enteredGlobRoom) {
+ _vm->_awayMission.disableInput = false;
+ showText(TX_SPEAKER_BENNIE, TX_TRI2_034);
+ showText(TX_SPEAKER_KIRK, TX_TRI2_005);
+ showText(TX_SPEAKER_SPOCK, TX_TRI2_030);
+ showText(TX_SPEAKER_KIRK, TX_TRI2_008);
+ _vm->_awayMission.trial.enteredGlobRoom = true;
+ }
+}
+
+void Room::trial2TouchedHotspot0() { // This is unused
+ if (_vm->_awayMission.trial.globEnergyLevels[1] != 0 || _vm->_awayMission.trial.globEnergyLevels[2] != 0)
+ showText(TX_SPEAKER_SPOCK, TX_TRI2_024);
+}
+
+void Room::trial2LookAtKirk() {
+ showText(TX_TRI2N003);
+}
+
+void Room::trial2LookAtSpock() {
+ showText(TX_TRI2N001);
+}
+
+void Room::trial2LookAtMccoy() {
+ showText(TX_TRI2N006);
+}
+
+void Room::trial2LookAtRedshirt() {
+ showText(TX_TRI2N002);
+}
+
+void Room::trial2LookAtInsignia() {
+ showText(TX_TRI2N004);
+}
+
+void Room::trial2LookAtGlob() {
+ showText(TX_TRI2N000);
+}
+
+void Room::trial2LookAtWall() {
+ showText(TX_TRI2N007);
+}
+
+void Room::trial2LookAtDoor() {
+ showText(TX_TRI2N005);
+}
+
+void Room::trial2TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_TRI2_001);
+}
+
+void Room::trial2TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_TRI2_019);
+}
+
+void Room::trial2TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI2_013);
+}
+
+void Room::trial2TalkToRedshirt() {
+ showText(TX_SPEAKER_BENNIE, TX_TRI2_033);
+}
+
+void Room::trial2TalkToGlob() {
+ showText(TX_QUIET);
+}
+
+void Room::trial2UsePhaserOnWall() {
+ showText(TX_TRI2N008);
+}
+
+
+void Room::trial2UsePhaserOnGlob(int object, bool phaserOnKill) {
+ _roomVar.trial.globBeingShot = object;
+ _roomVar.trial.phaserOnKill = phaserOnKill;
+
+ _vm->_awayMission.disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0xcd, 0xc5, &Room::trial2ReachedPositionToShootGlob);
+}
+
+void Room::trial2ReachedPositionToShootGlob() {
+ loadActorAnimC(OBJECT_KIRK, "kdraww", -1, -1, &Room::trial2DrewPhaserToShootGlob);
+}
+
+void Room::trial2DrewPhaserToShootGlob() {
+ const char *stunPhaserAnims[] = {
+ "t2kp00",
+ "t2kp01",
+ "t2kp02",
+ };
+ const char *killPhaserAnims[] = {
+ "t2kp03",
+ "t2kp04",
+ "t2kp05",
+ };
+
+ int index = _roomVar.trial.globBeingShot - OBJECT_GLOB;
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ playSoundEffectIndex(SND_PHASSHOT);
+ if (_roomVar.trial.phaserOnKill)
+ showBitmapFor5Ticks(killPhaserAnims[index], 5);
+ else
+ showBitmapFor5Ticks(stunPhaserAnims[index], 5);
+ loadActorStandAnim(OBJECT_KIRK);
+
+ _vm->_awayMission.disableInput = false;
+
+ if (_roomVar.trial.phaserOnKill)
+ _vm->_awayMission.trial.globEnergyLevels[index] += 2;
+ else
+ _vm->_awayMission.trial.globEnergyLevels[index] += 1;
+
+ if (!(_roomVar.trial.globBeingShot == OBJECT_GLOB && _roomVar.trial.phaserOnKill == true)) {
+ if (_roomVar.trial.phaserOnKill)
+ showText(TX_SPEAKER_SPOCK, TX_TRI2_023);
+ else
+ showText(TX_SPEAKER_SPOCK, TX_TRI2_025);
+ }
+
+
+ const Common::Point globPositions[] = {
+ Common::Point(GLOB_X, GLOB_Y),
+ Common::Point(SPLIT_GLOB_1_X, SPLIT_GLOB_1_Y),
+ Common::Point(SPLIT_GLOB_2_X, SPLIT_GLOB_2_Y)
+ };
+
+ if (_vm->_awayMission.trial.globEnergyLevels[index] == 3) {
+ playVoc("GLOBEDIV");
+ loadActorAnimC(_roomVar.trial.globBeingShot, "globsp", globPositions[index].x, globPositions[index].y, &Room::trial2GlobDoneSplitting);
+ } else if (_vm->_awayMission.trial.globEnergyLevels[index] >= 4) {
+ playSoundEffectIndex(SND_BLANK_14);
+ playVoc("REDBALL");
+ loadActorAnimC(_roomVar.trial.globBeingShot, "globex", globPositions[index].x, globPositions[index].y, &Room::trial2GlobDoneExploding);
+ }
+}
+
+void Room::trial2GlobDoneExploding() {
+ stopAllVocSounds();
+ playVoc("Noooloop");
+ showText(TX_SPEAKER_SPOCK, TX_TRI2_020);
+ _vm->_awayMission.trial.globDefeated = true;
+ playMidiMusicTracks(MIDITRACK_28, -1);
+ _vm->_awayMission.trial.missionScore += 1;
+ loadMapFile("trial2");
+}
+
+void Room::trial2GlobDoneSplitting() {
+ if (_roomVar.trial.globBeingShot == OBJECT_GLOB) {
+ if (true)
+ showText(TX_SPEAKER_SPOCK, TX_TRI2_009);
+ else {
+ // Unused code block: instead of killing the crew right away, the crew can
+ // interact with the split globs.
+ _vm->_awayMission.trial.globEnergyLevels[0] = 0;
+ _vm->_awayMission.trial.globEnergyLevels[1] = 1;
+ _vm->_awayMission.trial.globEnergyLevels[2] = 1;
+ _vm->_awayMission.trial.globSplitInTwo = true;
+ loadActorAnim2(OBJECT_SPLIT_GLOB_1, "sglob", SPLIT_GLOB_1_X, SPLIT_GLOB_1_Y);
+ loadActorAnim2(OBJECT_SPLIT_GLOB_2, "sglob", SPLIT_GLOB_2_X, SPLIT_GLOB_2_Y);
+ loadActorStandAnim(OBJECT_GLOB);
+ showText(TX_SPEAKER_SPOCK, TX_TRI2_021);
+ return;
+ }
+ } else if (_roomVar.trial.globBeingShot == OBJECT_SPLIT_GLOB_1) {
+ loadActorAnim2(OBJECT_11, "sglob", 0x43, 0xaf);
+ loadActorAnim2(OBJECT_SPLIT_GLOB_1, "sglob", 0, 0xaf);
+ } else if (_roomVar.trial.globBeingShot == OBJECT_SPLIT_GLOB_2) {
+ loadActorAnim2(OBJECT_11, "sglob", 0x8c, 0xaf);
+ loadActorAnim2(OBJECT_SPLIT_GLOB_2, "sglob", 0x46, 0xaf);
+ }
+
+ // Everyone gets vaporized
+ playVoc("V7ALLGET");
+ _vm->_awayMission.disableInput = true;
+ playMidiMusicTracks(MIDITRACK_26, -1);
+ loadActorAnimC(OBJECT_KIRK, "kkills", -1, -1, &Room::trial2KirkDied);
+ loadActorAnim2(OBJECT_SPOCK, "skills");
+ loadActorAnim2(OBJECT_MCCOY, "mkills");
+ loadActorAnim2(OBJECT_REDSHIRT, "rkills");
+}
+
+void Room::trial2KirkDied() {
+ _vm->_awayMission.disableInput = false;
+ showGameOverMenu();
+}
+
+void Room::trial2UseStunPhaserOnGlob() {
+ trial2UsePhaserOnGlob(OBJECT_GLOB, false);
+}
+
+void Room::trial2UseKillPhaserOnGlob() {
+ trial2UsePhaserOnGlob(OBJECT_GLOB, true);
+}
+
+void Room::trial2UseStunPhaserOnSplitGlob1() {
+ trial2UsePhaserOnGlob(OBJECT_SPLIT_GLOB_1, false);
+}
+
+void Room::trial2UseKillPhaserOnSplitGlob1() {
+ trial2UsePhaserOnGlob(OBJECT_SPLIT_GLOB_1, true);
+}
+
+void Room::trial2UseStunPhaserOnSplitGlob2() {
+ trial2UsePhaserOnGlob(OBJECT_SPLIT_GLOB_2, false);
+}
+
+void Room::trial2UseKillPhaserOnSplitGlob2() {
+ trial2UsePhaserOnGlob(OBJECT_SPLIT_GLOB_2, true);
+}
+
+void Room::trial2UseMTricorderOnKirk() {
+ mccoyScan(DIR_S, TX_TRI2_016, true);
+}
+
+void Room::trial2UseMTricorderOnSpock() {
+ mccoyScan(DIR_S, TX_TRI2_017, true);
+}
+
+void Room::trial2UseMTricorderOnMccoy() {
+ mccoyScan(DIR_S, TX_TRI2_014, true);
+}
+
+void Room::trial2UseMTricorderOnRedshirt() {
+ mccoyScan(DIR_S, TX_TRI2_015, true);
+}
+
+void Room::trial2UseMTricorderOnGlob() {
+ mccoyScan(DIR_S, TX_TRI2_011, true);
+
+ if (!_vm->_awayMission.trial.gotPointsForScanningGlob) {
+ _vm->_awayMission.trial.gotPointsForScanningGlob = true;
+ _vm->_awayMission.trial.missionScore += 1;
+ }
+}
+
+void Room::trial2UseSTricorderOnWall() {
+ spockScan(DIR_S, TX_TRI2_029, true);
+}
+
+void Room::trial2UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_TRI2_027, true);
+}
+
+void Room::trial2UseSTricorderOnGlob() {
+ spockScan(DIR_S, TX_TRI2_026, true);
+
+ if (!_vm->_awayMission.trial.gotPointsForScanningGlob) {
+ _vm->_awayMission.trial.gotPointsForScanningGlob = true;
+ _vm->_awayMission.trial.missionScore += 1;
+ }
+}
+
+void Room::trial2UseCommunicator() {
+ if (_vm->_awayMission.trial.forceFieldDown) { // TODO: Refactor this between rooms?
+ showText(TX_SPEAKER_UHURA, TX_TRI2U091);
+
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI2_003, TX_TRI2_004, TX_TRI2_007,
+ TX_BLANK
+ };
+ int choice = showText(choices);
+
+ if (choice == 0) { // "Beam us back to the enterprise"
+ _vm->_awayMission.trial.field5f = 1;
+ endMission(_vm->_awayMission.trial.missionScore, 1, 1); // FIXME: Inconsistent with TRIAL1
+ } else if (choice == 1) { // "Beam us to Vlict's position"
+ showText(TX_SPEAKER_UHURA, TX_TRI1U080); // NOTE: Original didn't show text here
+ _vm->_awayMission.disableInput = true;
+ loadRoomIndex(4, 4);
+ } // Else don't transport anywhere
+ } else { // Force field still up
+ showText(TX_SPEAKER_UHURA, TX_TRI2U087);
+ showText(TX_SPEAKER_KIRK, TX_TRI2_006);
+ showText(TX_SPEAKER_UHURA, TX_TRI2U104);
+ if (!_vm->_awayMission.trial.globDefeated) {
+ showText(TX_SPEAKER_UHURA, TX_TRI2U081);
+ showText(TX_SPEAKER_KIRK, TX_TRI2_002);
+ }
+ showText(TX_SPEAKER_UHURA, TX_TRI2U074);
+ }
+}
+
+void Room::trial2UseMccoyOnGlob() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI2_012);
+}
+
+void Room::trial2UseMccoyOnWall() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI2_010);
+}
+
+void Room::trial2UseSpockOnGlob() {
+ // NOTE: Two possible audio files to use, TRI2_028 and TRI2_F11
+ showText(TX_SPEAKER_SPOCK, TX_TRI2_028);
+}
+
+void Room::trial2UseSpockOnWall() {
+ showText(TX_SPEAKER_SPOCK, TX_TRI2_022);
+}
+
+void Room::trial2UseRedshirtOnGlob() {
+ showText(TX_SPEAKER_BENNIE, TX_TRI2_031);
+}
+
+void Room::trial2UseRedshirtOnWall() {
+ showText(TX_SPEAKER_BENNIE, TX_TRI2_032);
+}
+
+void Room::trial2WalkToDoor() {
+ walkCrewman(OBJECT_KIRK, 0x117, 0xb5);
+}
+
+void Room::trial2UseMedkitAnywhere() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI2_018);
}
}
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
index 9c7f16a..6e14eff 100644
--- a/engines/startrek/sound.h
+++ b/engines/startrek/sound.h
@@ -60,6 +60,39 @@ enum SoundEffects {
SND_WARP = 0x29
};
+
+enum MidiTracks {
+ MIDITRACK_0,
+ MIDITRACK_1,
+ MIDITRACK_2,
+ MIDITRACK_3,
+ MIDITRACK_4,
+ MIDITRACK_5,
+ MIDITRACK_6,
+ MIDITRACK_7,
+ MIDITRACK_8,
+ MIDITRACK_9,
+ MIDITRACK_10,
+ MIDITRACK_11,
+ MIDITRACK_12,
+ MIDITRACK_13,
+ MIDITRACK_14,
+ MIDITRACK_15,
+ MIDITRACK_16,
+ MIDITRACK_17,
+ MIDITRACK_18,
+ MIDITRACK_19,
+ MIDITRACK_20,
+ MIDITRACK_21,
+ MIDITRACK_22,
+ MIDITRACK_23,
+ MIDITRACK_24,
+ MIDITRACK_25,
+ MIDITRACK_26,
+ MIDITRACK_27,
+ MIDITRACK_28
+};
+
// Max # of VOC files that can play at once
const int MAX_SFX_PLAYING = 4;
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index a19bf20..1fe7876 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -2164,6 +2164,59 @@ enum GameStringIDs {
TX_TRI1C002,
+ TX_QUIET,
+ TX_TRI2_001,
+ TX_TRI2_002,
+ TX_TRI2_003,
+ TX_TRI2_004,
+ TX_TRI2_005,
+ TX_TRI2_006,
+ TX_TRI2_007,
+ TX_TRI2_008,
+ TX_TRI2_009,
+ TX_TRI2_010,
+ TX_TRI2_011,
+ TX_TRI2_012,
+ TX_TRI2_013,
+ TX_TRI2_014,
+ TX_TRI2_015,
+ TX_TRI2_016,
+ TX_TRI2_017,
+ TX_TRI2_018,
+ TX_TRI2_019,
+ TX_TRI2_020,
+ TX_TRI2_021,
+ TX_TRI2_022,
+ TX_TRI2_023,
+ TX_TRI2_024,
+ TX_TRI2_025,
+ TX_TRI2_026,
+ TX_TRI2_027,
+ TX_TRI2_028,
+ TX_TRI2_029,
+ TX_TRI2_030,
+ TX_TRI2_031,
+ TX_TRI2_032,
+ TX_TRI2_033,
+ TX_TRI2_034,
+ // UNUSED (035 -> 039; voice substitute for Uhura)
+ TX_TRI2_F11, // UNUSED
+ TX_TRI2N000,
+ TX_TRI2N001,
+ TX_TRI2N002,
+ TX_TRI2N003,
+ TX_TRI2N004,
+ TX_TRI2N005,
+ TX_TRI2N006,
+ TX_TRI2N007,
+ TX_TRI2N008,
+ TX_TRI2U074,
+ TX_TRI2U081,
+ TX_TRI2U087,
+ TX_TRI2U091,
+ TX_TRI2U104,
+
+
TX_TRI4_076,
@@ -4253,6 +4306,58 @@ const char * const g_gameStrings[] = {
"Clunk.",
+ "#SFX\\QUIET#Zzzzzzzzzzzmmmm.",
+ "#TRI2\\TRI2_001#This reminds me of an old practical joke that Finnegan played on me back at the Academy.",
+ "#TRI2\\TRI2_002#...some kind of energy source a few meters from our position. We know.",
+ "#TRI2\\TRI2_003#Beam us back to the Enterprise. Kirk out.",
+ "#TRI2\\TRI2_004#Beam us to Vlict's position.",
+ "#TRI2\\TRI2_005#I don't know, Ensign.",
+ "#TRI2\\TRI2_006#Keep working on it, but don't try to beam us up unless I give the signal.",
+ "#TRI2\\TRI2_007#Negative.",
+ "#TRI2\\TRI2_008#Whatever it is, we have to find a way to get by it.",
+ "#TRI2\\TRI2_009#Extreme increase in energy level, Captain. It absorbed the phaser fire. An unexpected reaction is occuring, high levels of lethal radiation are being produced.",
+ "#TRI2\\TRI2_010#Do you want me to hit my head against it?",
+ "#TRI2\\TRI2_011#It does not register as a life form.",
+ "#TRI2\\TRI2_012#I'm not touching some damned ball of energy!",
+ "#TRI2\\TRI2_013#If you hadn't been so damned anxious to give my patient to the Klingons, we wouldn't be in this mess.",
+ "#TRI2\\TRI2_014#One Male Human, average physical condition.",
+ "#TRI2\\TRI2_015#He's a male Human, excellent physical condition.", // TYPO
+ "#TRI2\\TRI2_016#Male Human, good physical condition.",
+ "#TRI2\\TRI2_017#One male Human-Vulcan hybrid. Excellent physical condition.", // TYPO
+ "#TRI2\\TRI2_018#Nobody needs healing, Jim, but you will if they harm my patient.",
+ "#TRI2\\TRI2_019#Fascinating. It would appear that Vlict sent us into this place in the hope that we would be killed.",
+ "#TRI2\\TRI2_020#Fascinating. These automatons are not stable.",
+ "#TRI2\\TRI2_021#Fascinating. These automatons are not stable.",
+ "#TRI2\\TRI2_022#I do not understand the desired course of action.",
+ "#TRI2\\TRI2_023#Marked increase in energy level, Captain. It absorbed the phaser fire. No appreciable increase in mass.",
+ "#TRI2\\TRI2_024#The automaton is emitting a protective force field, Captain. We cannot proceed further without rendering it inoperative.",
+ "#TRI2\\TRI2_025#The automaton's energy level has increased slightly. It absorbed the phaser fire. No appreciable increase in mass.",
+ "#TRI2\\TRI2_026#The ball of energy is an automaton, Captain. It is an artificial construct, programmed to block any movements; I can detect no other function or intelligence.",
+ "#TRI2\\TRI2_027#These walls were carved from the natural rock of the cavern.",
+ "#TRI2\\TRI2_028#This automaton is generating a force field, Captain. I am physically incapable of touching it.",
+ "#TRI2\\TRI2_029#This wall was carved from the natural rock of a cavern.",
+ "#TRI2\\TRI2_030#I believe Ensign, that this energy sphere is some sort of automaton, programmed to block our movements.",
+ "#TRI2\\TRI2_031#I refuse, Captain, on the grounds that it might incinerate me.",
+ "#TRI2\\TRI2_032#Uh, pardon sir?",
+ "#TRI2\\TRI2_033#We're not going to get out of this alive, are we Captain?",
+ "#TRI2\\TRI2_034#Captain, what is that thing?",
+ "#TRI2\\TRI2_F11#This automaton is generating a force field, Captain. I am physically incapable of touching it.",
+ "#TRI2\\TRI2N000#A pulsing globe of energy.",
+ "#TRI2\\TRI2N001#Commander Spock, a patient and thoughtful Federation first officer.",
+ "#TRI2\\TRI2N002#Ensign Bennie, faithful and true security officer.",
+ "#TRI2\\TRI2N003#James T. Kirk, a rather frustated Federation starship captain.",
+ "#TRI2\\TRI2N004#Klingon insignia.",
+ "#TRI2\\TRI2N005#Leads back to the room where the Electrical creature was.",
+ "#TRI2\\TRI2N006#Leonard McCoy, a crusty country doctor, and Starfleet's finest surgeon.",
+ "#TRI2\\TRI2N007#Rock wall. Looks like it was carved from stone by Klingon heavy mining equipment.",
+ "#TRI2\\TRI2N008#The walls are resistant to phaser fire.",
+ "#TRI2\\TRI2U074#Please keep in contact with us. We'll keep you informed if further developments occur. Uhura out.",
+ "#TRI2\\TRI2U081#By the way, sensors indicate...",
+ "#TRI2\\TRI2U087#Captain, there is still a barrier between us and the planet. Mr. Scott thinks there might be a way to break through it, and he's working on it now, but the Klingons won't like it.",
+ "#TRI2\\TRI2U091#Do you wish to be beamed up now Captain?",
+ "#TRI2\\TRI2U104#Understood, Captain.",
+
+
"#TRI4\\TRI4_076#You humans have an excellent imagination, but a poor grasp of reality.",
Commit: 2771797eb0cb93b6a7672904dd81f9deeecdba0d
https://github.com/scummvm/scummvm/commit/2771797eb0cb93b6a7672904dd81f9deeecdba0d
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: "Use" action was bypassing "disableWalk"
When objects could be walked to by "using" them, this bypassed the
"disableWalk" variable.
Changed paths:
engines/startrek/awaymission.cpp
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 819319e..e086bca 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -515,7 +515,8 @@ void StarTrekEngine::handleAwayMissionAction() {
if (action.activeObject() != action.passiveObject()) {
switch (action.activeObject()) {
case OBJECT_KIRK:
- if (!_room->handleAction(ACTION_WALK, action.passiveObject(), 0, 0)
+ // BUGFIX: Don't allow the "use" action to bypass the "disableWalking" variable
+ if (!(!_awayMission.disableWalking && _room->handleAction(ACTION_WALK, action.passiveObject(), 0, 0))
&& !_room->handleAction(ACTION_GET, action.passiveObject(), 0, 0)) {
showTextbox("Capt. Kirk", getLoadedText(GROUNDTX_KIRK_USE), 20, 20, TEXTCOLOR_YELLOW, 0);
}
Commit: 00445f0cfafdb97865f3e4c82632d8702fb5cb6e
https://github.com/scummvm/scummvm/commit/00445f0cfafdb97865f3e4c82632d8702fb5cb6e
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: TRIAL3
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/trial3.cpp
engines/startrek/sound.h
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 984ee55..93d0fd2 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -278,6 +278,16 @@ struct AwayMission {
bool globSplitInTwo; // 0x35
bool globDefeated; // 0x36
byte globEnergyLevels[3]; // 0x37
+ bool enteredTrial3FirstTime; // 0x3a
+ byte klingonShootIndex; // 0x3b
+ byte shotKlingons; // 0x3c
+
+ // 0: Hasn't appeared yet
+ // 21: Is conscious
+ // 22: Is stunned
+ // 23: Is dead
+ int16 shotKlingonState; // 0x3d
+
bool enteredGlobRoom; // 0x5c
bool forceFieldDown; // 0x5d
bool uhuraAnalyzedCode; // 0x5e
@@ -285,6 +295,8 @@ struct AwayMission {
bool gotPointsForGettingRod; // 0x61
bool gotPointsForCoatingRodWithIron; // 0x62
bool gotPointsForScanningGlob; // 0x64
+
+ bool gotPointsForBeamingOut;
} trial;
};
};
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 288c01f..236f24c 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1893,6 +1893,59 @@ public:
// TRIAL3
void trial3Tick1();
+ void trial3Tick30();
+ void trial3Klingon1BeamedIn();
+ void trial3Klingon2BeamedIn();
+ void trial3Klingon3BeamedIn();
+ void trial3KlingonShootsSomeone1();
+ void trial3Klingon1DoneShooting();
+ void trial3Klingon2DoneShooting();
+ void trial3Klingon3DoneShooting();
+ void trial3KlingonShootsSomeone2();
+ void trial3RedshirtDoneDying();
+ void trial3KirkDoneDying();
+ void trial3Klingon1Shot();
+ void trial3Klingon2Shot();
+ void trial3Klingon3Shot();
+ void trial3CheckShowUhuraText();
+ void trial3CrewmanBeamedOut();
+ void trial3Tick90();
+ void trial3TouchedHotspot3();
+ void trial3KirkExploded();
+ void trial3LookAtKirk();
+ void trial3LookAtSpock();
+ void trial3LookAtMccoy();
+ void trial3LookAtRedshirt();
+ void trial3LookAtExit();
+ void trial3LookAtWall();
+ void trial3TalkToKirk();
+ void trial3TalkToSpock();
+ void trial3TalkToMccoy();
+ void trial3TalkToRedshirt();
+ void trial3UsePhaserOnWall();
+ void trial3UseStunPhaserOnKlingon1();
+ void trial3ReadyToShootKlingon1OnStun();
+ void trial3UseKillPhaserOnKlingon1();
+ void trial3ReadyToShootKlingon1OnKill();
+ void trial3UsePhaserAnywhere();
+ void trial3UseMTricorderOnKirk();
+ void trial3UseMTricorderOnSpock();
+ void trial3UseMTricorderOnMccoy();
+ void trial3UseMTricorderOnRedshirt();
+ void trial3UseMTricorderOnExit();
+ void trial3UseSTricorderOnWall();
+ void trial3UseSTricorderOnExit();
+ void trial3UseMTricorderOnKlingon();
+ void trial3UseCommunicator();
+ void trial3BeamToVlict();
+ void trial3UseMccoyOnWall();
+ void trial3UseMccoyOnExit();
+ void trial3UseSpockOnWall();
+ void trial3UseSpockOnExit();
+ void trial3UseRedshirtOnExit();
+ void trial3UseRedshirtOnWall();
+ void trial3WalkToExit();
+ void trial3UseMedkitAnywhere();
// TRIAL4
void trial4Tick1();
diff --git a/engines/startrek/rooms/trial3.cpp b/engines/startrek/rooms/trial3.cpp
index afbb1ee..2e382bc 100644
--- a/engines/startrek/rooms/trial3.cpp
+++ b/engines/startrek/rooms/trial3.cpp
@@ -22,16 +22,437 @@
#include "startrek/room.h"
+#define OBJECT_KLINGON_1 8
+#define OBJECT_KLINGON_2 9 // Unused
+#define OBJECT_KLINGON_3 10 // Unused
+#define OBJECT_EXPLOSION 11
+
+#define HOTSPOT_EXIT 0x20
+#define HOTSPOT_WALL 0x21
+
namespace StarTrek {
extern const RoomAction trial3ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::trial3Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::trial3Tick1 },
+ { {ACTION_TICK, 30, 0, 0}, &Room::trial3Tick30 },
+ { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::trial3Klingon1BeamedIn },
+ { {ACTION_DONE_ANIM, 2, 0, 0}, &Room::trial3Klingon2BeamedIn },
+ { {ACTION_DONE_ANIM, 3, 0, 0}, &Room::trial3Klingon3BeamedIn },
+ { {ACTION_DONE_ANIM, 4, 0, 0}, &Room::trial3Klingon1DoneShooting },
+ { {ACTION_DONE_ANIM, 5, 0, 0}, &Room::trial3Klingon2DoneShooting },
+ { {ACTION_DONE_ANIM, 6, 0, 0}, &Room::trial3Klingon3DoneShooting },
+ { {ACTION_DONE_ANIM, 15, 0, 0}, &Room::trial3RedshirtDoneDying },
+ { {ACTION_DONE_ANIM, 16, 0, 0}, &Room::trial3KirkDoneDying },
+ { {ACTION_DONE_ANIM, 11, 0, 0}, &Room::trial3Klingon1Shot },
+ { {ACTION_DONE_ANIM, 12, 0, 0}, &Room::trial3Klingon2Shot },
+ { {ACTION_DONE_ANIM, 13, 0, 0}, &Room::trial3Klingon3Shot },
+ { {ACTION_DONE_ANIM, 19, 0, 0}, &Room::trial3CrewmanBeamedOut },
+ { {ACTION_TICK, 90, 0, 0}, &Room::trial3Tick90 },
+ { {ACTION_TOUCHED_HOTSPOT, 3, 0, 0}, &Room::trial3TouchedHotspot3 },
+ { {ACTION_DONE_ANIM, 14, 0, 0}, &Room::trial3KirkExploded },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::trial3LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::trial3LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::trial3LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::trial3LookAtRedshirt },
+ { {ACTION_LOOK, HOTSPOT_EXIT, 0, 0}, &Room::trial3LookAtExit },
+ { {ACTION_LOOK, HOTSPOT_WALL, 0, 0}, &Room::trial3LookAtWall },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::trial3TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::trial3TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::trial3TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::trial3TalkToRedshirt },
+ { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_WALL, 0}, &Room::trial3UsePhaserOnWall },
+ { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_WALL, 0}, &Room::trial3UsePhaserOnWall },
+
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_KLINGON_1, 0}, &Room::trial3UseStunPhaserOnKlingon1 },
+ { {ACTION_DONE_ANIM, 17, 0, 0}, &Room::trial3ReadyToShootKlingon1OnStun },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_KLINGON_1, 0}, &Room::trial3UseKillPhaserOnKlingon1 },
+ { {ACTION_DONE_ANIM, 18, 0, 0}, &Room::trial3ReadyToShootKlingon1OnKill },
+ // OMITTED: Similar code for unused klingons 2 and 3
+
+ { {ACTION_USE, OBJECT_IPHASERS, 0xff, 0}, &Room::trial3UsePhaserAnywhere },
+ { {ACTION_USE, OBJECT_IPHASERK, 0xff, 0}, &Room::trial3UsePhaserAnywhere },
+
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::trial3UseMTricorderOnKirk },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::trial3UseMTricorderOnSpock },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::trial3UseMTricorderOnMccoy },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::trial3UseMTricorderOnRedshirt },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_EXIT, 0}, &Room::trial3UseMTricorderOnExit },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_WALL, 0}, &Room::trial3UseSTricorderOnWall },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_EXIT, 0}, &Room::trial3UseSTricorderOnExit },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KLINGON_1, 0}, &Room::trial3UseMTricorderOnKlingon },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::trial3UseCommunicator },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_WALL, 0}, &Room::trial3UseMccoyOnWall },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_EXIT, 0}, &Room::trial3UseMccoyOnExit },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_WALL, 0}, &Room::trial3UseSpockOnWall },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_EXIT, 0}, &Room::trial3UseSpockOnExit },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_EXIT, 0}, &Room::trial3UseRedshirtOnExit },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_WALL, 0}, &Room::trial3UseRedshirtOnWall },
+ { {ACTION_WALK, HOTSPOT_EXIT, 0, 0}, &Room::trial3WalkToExit },
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::trial3UseMedkitAnywhere },
};
extern const int trial3NumActions = sizeof(trial3ActionList) / sizeof(RoomAction);
void Room::trial3Tick1() {
+ playVoc("TRI3LOOP");
+
+ if (!_vm->_awayMission.trial.enteredTrial3FirstTime) {
+ _vm->_awayMission.disableWalking = true;
+ _vm->_awayMission.disableInput = 2;
+ }
+ playMidiMusicTracks(MIDITRACK_33, -1);
+}
+
+void Room::trial3Tick30() {
+ if (!_vm->_awayMission.trial.enteredTrial3FirstTime) {
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.trial.enteredTrial3FirstTime = true;
+
+ showText(TX_SPEAKER_BENNIE, TX_TRI3_030);
+ showText(TX_SPEAKER_KIRK, TX_TRI3_005);
+ showText(TX_SPEAKER_MCCOY, TX_TRI3_019);
+ showText(TX_SPEAKER_SPOCK, TX_TRI3_025);
+ showText(TX_SPEAKER_MCCOY, TX_TRI3_020);
+ showText(TX_SPEAKER_KIRK, TX_TRI3_004);
+ }
+}
+
+void Room::trial3Klingon1BeamedIn() {
+ loadActorAnimC(OBJECT_KLINGON_1, "t3kfir", -1, -1, &Room::trial3Klingon1DoneShooting);
+ trial3KlingonShootsSomeone1();
+}
+
+void Room::trial3Klingon2BeamedIn() {
+ loadActorAnimC(OBJECT_KLINGON_2, "t3kfir", -1, -1, &Room::trial3Klingon2DoneShooting);
+ trial3KlingonShootsSomeone1();
+}
+
+void Room::trial3Klingon3BeamedIn() {
+ loadActorAnimC(OBJECT_KLINGON_3, "t3kfir", -1, -1, &Room::trial3Klingon3DoneShooting);
+ trial3KlingonShootsSomeone1();
+}
+
+void Room::trial3KlingonShootsSomeone1() {
+ _vm->_awayMission.trial.klingonShootIndex++;
+ if (_vm->_awayMission.trial.klingonShootIndex == 1) {
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t3phas04", 5);
+ loadActorAnimC(OBJECT_REDSHIRT, "rkillw", -1, -1, &Room::trial3RedshirtDoneDying);
+ _vm->_awayMission.redshirtDead = true;
+ } else if (_vm->_awayMission.trial.klingonShootIndex == 2) {
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t3phas05", 5);
+ playMidiMusicTracks(MIDITRACK_2, -1);
+ loadActorAnimC(OBJECT_KIRK, "kkillw", -1, -1, &Room::trial3KirkDoneDying);
+ }
+}
+
+void Room::trial3Klingon1DoneShooting() {
+ loadActorAnimC(OBJECT_KLINGON_1, "t3kfir", -1, -1, &Room::trial3Klingon1DoneShooting);
+ trial3KlingonShootsSomeone2();
+}
+
+void Room::trial3Klingon2DoneShooting() {
+ loadActorAnimC(OBJECT_KLINGON_2, "t3kfir", -1, -1, &Room::trial3Klingon2DoneShooting);
+ trial3KlingonShootsSomeone2();
+}
+
+void Room::trial3Klingon3DoneShooting() {
+ loadActorAnimC(OBJECT_KLINGON_3, "t3kfir", -1, -1, &Room::trial3Klingon3DoneShooting);
+ trial3KlingonShootsSomeone2();
+}
+
+void Room::trial3KlingonShootsSomeone2() {
+ // This function is almost exactly identical to "trial3KlingonShootsSomeone1(), just
+ // one line differs...
+ _vm->_awayMission.trial.klingonShootIndex++;
+ if (_vm->_awayMission.trial.klingonShootIndex == 1) {
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t3phas04", 5);
+ loadActorAnimC(OBJECT_REDSHIRT, "rkillw", -1, -1, &Room::trial3RedshirtDoneDying);
+ _vm->_awayMission.redshirtDead = true;
+ } else if (_vm->_awayMission.trial.klingonShootIndex == 2) {
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t3phas05", 5);
+ // NOTE: Only difference to "trial3KlingonShootsSomeone1" is this doesn't play a midi track?
+ loadActorAnimC(OBJECT_KIRK, "kkillw", -1, -1, &Room::trial3KirkDoneDying);
+ }
+}
+
+void Room::trial3RedshirtDoneDying() {
+ _vm->_awayMission.redshirtDead = true;
+}
+
+void Room::trial3KirkDoneDying() {
+ showGameOverMenu();
+}
+
+void Room::trial3Klingon1Shot() {
+ _vm->_awayMission.trial.shotKlingons |= 1;
+ trial3CheckShowUhuraText();
+}
+
+void Room::trial3Klingon2Shot() {
+ _vm->_awayMission.trial.shotKlingons |= 2;
+ trial3CheckShowUhuraText();
+}
+
+void Room::trial3Klingon3Shot() {
+ _vm->_awayMission.trial.shotKlingons |= 4;
+ trial3CheckShowUhuraText();
+}
+
+void Room::trial3CheckShowUhuraText() {
+ if (_vm->_awayMission.trial.shotKlingons == 1) {
+ _vm->_awayMission.trial.shotKlingons |= 8;
+ _vm->_awayMission.disableWalking = false;
+ loadActorStandAnim(OBJECT_KIRK);
+
+ showText(TX_SPEAKER_UHURA, TX_TRI3U084);
+ showText(TX_SPEAKER_KIRK, TX_TRI3_007);
+ showText(TX_SPEAKER_UHURA, TX_TRI3U099);
+
+ _vm->_awayMission.trial.forceFieldDown = true;
+
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI3_006, TX_TRI3_002, TX_TRI3_003,
+ TX_BLANK
+ };
+ int choice = showText(choices);
+
+ if (choice == 0) { // Don't beam out
+ } else if (choice == 1) { // Beam to enterprise
+ endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 1); // FIXME: inconsistent
+ } else if (choice == 2) { // Beam to Vlict
+ trial3BeamToVlict();
+ }
+ }
+}
+
+void Room::trial3CrewmanBeamedOut() {
+ if (!_vm->_awayMission.trial.gotPointsForBeamingOut) {
+ _vm->_awayMission.trial.gotPointsForBeamingOut = true;
+ _vm->_awayMission.trial.missionScore += 2; // BUG: Doesn't happen when done in other rooms
+ }
+ loadRoomIndex(4, 4);
+}
+
+void Room::trial3Tick90() {
+ if ((!(_vm->_awayMission.trial.shotKlingons & 8) && _vm->_awayMission.trial.shotKlingonState != 20)) {
+ playSoundEffectIndex(SND_TRANSMAT);
+ playMidiMusicTracks(MIDITRACK_32, -1);
+ loadActorAnimC(OBJECT_KLINGON_1, "t3ktel", 0x57, 0xb1, &Room::trial3Klingon1BeamedIn);
+ _vm->_awayMission.trial.shotKlingonState = 21;
+ }
+}
+
+void Room::trial3TouchedHotspot3() { // Activated the explosive
+ playSoundEffectIndex(SND_BLANK_14);
+ playMidiMusicTracks(MIDITRACK_2, -1);
+ playVoc("BITOKIRK");
+ loadActorAnimC(OBJECT_EXPLOSION, "t3expl", 0, 0xc7, &Room::trial3KirkExploded);
+}
+
+void Room::trial3KirkExploded() {
+ showGameOverMenu();
+}
+
+void Room::trial3LookAtKirk() {
+ showText(TX_TRI3N000);
+}
+
+void Room::trial3LookAtSpock() {
+ showText(TX_TRI3N004);
+}
+
+void Room::trial3LookAtMccoy() {
+ showText(TX_TRI3N001);
+}
+
+void Room::trial3LookAtRedshirt() {
+ showText(TX_TRI3N002);
+}
+
+void Room::trial3LookAtExit() {
+ showText(TX_TRI3N005);
+}
+
+void Room::trial3LookAtWall() {
+ showText(TX_TRI3N007);
+}
+
+void Room::trial3TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_TRI3_001);
+}
+
+void Room::trial3TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_TRI3_022);
+}
+
+void Room::trial3TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI3_018);
+}
+
+void Room::trial3TalkToRedshirt() {
+ showText(TX_SPEAKER_BENNIE, TX_TRI3_029);
+}
+
+void Room::trial3UsePhaserOnWall() {
+ showText(TX_TRI3N006);
+}
+
+void Room::trial3UseStunPhaserOnKlingon1() {
+ // BUGFIX: Instead of checking that the klingon isn't unconscious, (22), check that
+ // he's conscious (21).
+ // There's also the "dead" state (23) to consider. This prevents a softlock if
+ // a phaser is used on him just as he's being vaporized.
+ if (_vm->_awayMission.trial.shotKlingonState == 21) {
+ _vm->_awayMission.disableInput = true;
+ loadActorAnimC(OBJECT_KIRK, "kdraww", -1, -1, &Room::trial3ReadyToShootKlingon1OnStun);
+ }
+}
+
+void Room::trial3ReadyToShootKlingon1OnStun() {
+ if (_vm->_awayMission.trial.shotKlingonState == 21) {
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t3phas00", 5);
+ loadActorAnimC(OBJECT_KLINGON_1, "t3kstn", -1, -1, &Room::trial3Klingon1Shot);
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.trial.shotKlingonState = 22;
+ }
+}
+
+void Room::trial3UseKillPhaserOnKlingon1() {
+ // BUGFIX: Prevent softlock by checking that he's conscious (shotKlingonState == 21)
+ // In addition to preventing the softlock mentioned above, this also prevents
+ // a softlock where a kill phaser is used on the unconscious klingon.
+ if (_vm->_awayMission.trial.shotKlingonState == 21) {
+ _vm->_awayMission.disableInput = true;
+ loadActorAnimC(OBJECT_KIRK, "kdraww", -1, -1, &Room::trial3ReadyToShootKlingon1OnKill);
+ }
+}
+
+void Room::trial3ReadyToShootKlingon1OnKill() {
+ if (_vm->_awayMission.trial.shotKlingonState == 21) {
+ playSoundEffectIndex(SND_PHASSHOT);
+ showBitmapFor5Ticks("t3phas02", 5);
+ loadActorAnimC(OBJECT_KLINGON_1, "t3kdie", -1, -1, &Room::trial3Klingon1Shot);
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.trial.shotKlingonState = 23;
+ _vm->_awayMission.trial.missionScore -= 3; // Penalty for killing klingon
+ }
+}
+
+void Room::trial3UsePhaserAnywhere() {
+ showText(TX_TRI3N003);
+}
+
+void Room::trial3UseMTricorderOnKirk() {
+ // BUGFIX: Original animated Spock instead of Mccoy (same for below mccoy-scan functions)
+ mccoyScan(DIR_S, TX_TRI3_015, true);
+}
+
+void Room::trial3UseMTricorderOnSpock() {
+ mccoyScan(DIR_S, TX_TRI3_016, true);
+}
+
+void Room::trial3UseMTricorderOnMccoy() {
+ mccoyScan(DIR_S, TX_TRI3_013, true);
+}
+
+void Room::trial3UseMTricorderOnRedshirt() {
+ mccoyScan(DIR_S, TX_TRI3_014, true);
+}
+
+void Room::trial3UseMTricorderOnExit() {
+ mccoyScan(DIR_S, TX_TRI3_009, true);
+}
+
+void Room::trial3UseSTricorderOnWall() {
+ spockScan(DIR_S, TX_TRI3_024, true);
+}
+
+void Room::trial3UseSTricorderOnExit() {
+ spockScan(DIR_S, TX_TRI3_023, true);
+}
+
+void Room::trial3UseMTricorderOnKlingon() {
+ if (_vm->_awayMission.trial.shotKlingonState == 22) { // Unconscious
+ mccoyScan(DIR_S, TX_TRI3_011);
+ showText(TX_SPEAKER_BENNIE, TX_TRI3_028);
+ }
+}
+
+void Room::trial3UseCommunicator() {
+ if (_vm->_awayMission.trial.forceFieldDown) {
+ showText(TX_SPEAKER_UHURA, TX_TRI3U089);
+
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI3_103, TX_TRI3_104, TX_TRI3_107,
+ TX_BLANK
+ };
+ int choice = showText(choices);
+
+ if (choice == 0) { // "Beam us back to the enterprise"
+ _vm->_awayMission.trial.field5f = 1;
+ endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 1); // FIXME: inconsistent
+ } else if (choice == 1) { // "Beam us to Vlict's position"
+ trial3BeamToVlict();
+ } // Else don't transport anywhere
+ } else { // Force field still up
+ showText(TX_SPEAKER_UHURA, TX_TRI3U067);
+ }
+}
+
+void Room::trial3BeamToVlict() {
+ // ENHANCEMENT: The audio that should play here (TX_TRI3U080) doesn't seem to have the
+ // normal "filter" applied over it, making it sound jarring. So, use the equivalent
+ // text from TRIAL1 instead.
+ showText(TX_SPEAKER_UHURA, TX_TRI1U080);
+
+ _vm->_awayMission.disableInput = true;
+ playSoundEffectIndex(SND_TRANSDEM);
+
+ loadActorAnimC(OBJECT_KIRK, "kteled", -1, -1, &Room::trial3CrewmanBeamedOut);
+ loadActorAnimC(OBJECT_SPOCK, "steled", -1, -1, &Room::trial3CrewmanBeamedOut);
+ loadActorAnimC(OBJECT_MCCOY, "mteled", -1, -1, &Room::trial3CrewmanBeamedOut);
+ if (!_vm->_awayMission.redshirtDead)
+ loadActorAnimC(OBJECT_REDSHIRT, "rteled", -1, -1, &Room::trial3CrewmanBeamedOut);
+}
+
+void Room::trial3UseMccoyOnWall() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI3_010);
+}
+
+void Room::trial3UseMccoyOnExit() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI3_012);
+}
+
+void Room::trial3UseSpockOnWall() {
+ showText(TX_SPEAKER_SPOCK, TX_TRI3_021);
+}
+
+void Room::trial3UseSpockOnExit() {
+ showText(TX_SPEAKER_SPOCK, TX_TRI3_008);
+}
+
+void Room::trial3UseRedshirtOnExit() {
+ showText(TX_SPEAKER_BENNIE, TX_TRI3_027);
+}
+
+void Room::trial3UseRedshirtOnWall() {
+ showText(TX_SPEAKER_BENNIE, TX_TRI3_026);
+}
+
+void Room::trial3WalkToExit() {
+ walkCrewman(OBJECT_KIRK, 0x26, 0x9d);
+}
+
+void Room::trial3UseMedkitAnywhere() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI3_017);
}
}
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
index 6e14eff..d5d2323 100644
--- a/engines/startrek/sound.h
+++ b/engines/startrek/sound.h
@@ -90,7 +90,12 @@ enum MidiTracks {
MIDITRACK_25,
MIDITRACK_26,
MIDITRACK_27,
- MIDITRACK_28
+ MIDITRACK_28,
+ MIDITRACK_29,
+ MIDITRACK_30,
+ MIDITRACK_31,
+ MIDITRACK_32,
+ MIDITRACK_33
};
// Max # of VOC files that can play at once
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 1fe7876..82191d0 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -2217,6 +2217,54 @@ enum GameStringIDs {
TX_TRI2U104,
+ TX_TRI3_001,
+ TX_TRI3_002,
+ TX_TRI3_003,
+ TX_TRI3_004,
+ TX_TRI3_005,
+ TX_TRI3_006,
+ TX_TRI3_007,
+ TX_TRI3_008,
+ TX_TRI3_009,
+ TX_TRI3_010,
+ TX_TRI3_011,
+ TX_TRI3_012,
+ TX_TRI3_013,
+ TX_TRI3_014,
+ TX_TRI3_015,
+ TX_TRI3_016,
+ TX_TRI3_017,
+ TX_TRI3_018,
+ TX_TRI3_019,
+ TX_TRI3_020,
+ TX_TRI3_021,
+ TX_TRI3_022,
+ TX_TRI3_023,
+ TX_TRI3_024,
+ TX_TRI3_025,
+ TX_TRI3_026,
+ TX_TRI3_027,
+ TX_TRI3_028,
+ TX_TRI3_029,
+ TX_TRI3_030,
+ TX_TRI3_103,
+ TX_TRI3_104,
+ TX_TRI3_107,
+ TX_TRI3N000,
+ TX_TRI3N001,
+ TX_TRI3N002,
+ TX_TRI3N003,
+ TX_TRI3N004,
+ TX_TRI3N005,
+ TX_TRI3N006,
+ TX_TRI3N007,
+ TX_TRI3U067,
+ TX_TRI3U080,
+ TX_TRI3U084,
+ TX_TRI3U089,
+ TX_TRI3U099,
+
+
TX_TRI4_076,
@@ -4358,6 +4406,54 @@ const char * const g_gameStrings[] = {
"#TRI2\\TRI2U104#Understood, Captain.",
+ "#TRI3\\TRI3_001#This is too easy. I don't like it.",
+ "#TRI3\\TRI3_002#Beam us directly to the Enterprise.",
+ "#TRI3\\TRI3_003#Beam us directly to Vlict's position.",
+ "#TRI3\\TRI3_004#Deaths, Bones. Our deaths.",
+ "#TRI3\\TRI3_005#I don't like it. This was too easy.",
+ "#TRI3\\TRI3_006#We'll call you if we want to transport. Kirk out.",
+ "#TRI3\\TRI3_007#We're fine, lieutenant.",
+ "#TRI3\\TRI3_008#Captain, Starfleet protocol requires that the commanding officer lead in hazardous situations.",
+ "#TRI3\\TRI3_009#Approximately thirty Klingons, within 500 meters of the opening, no closer than 200 meters.",
+ "#TRI3\\TRI3_010#Damn it Jim, I'm a Doctor, not a structural Engineer!",
+ "#TRI3\\TRI3_011#He's out like a light, Jim. There are hibernating Arcturian sloth-tigers that will get up more quickly than this guy.",
+ "#TRI3\\TRI3_012#I believe that you have seniority, Jim.",
+ "#TRI3\\TRI3_013#He's a Male Human, average physical condition.",
+ "#TRI3\\TRI3_014#Male Human, excellent physical condition.",
+ "#TRI3\\TRI3_015#Male Human, good physical condition.",
+ "#TRI3\\TRI3_016#Male Human-Vulcan hybrid. Excellent physical condition.",
+ "#TRI3\\TRI3_017#Nobody needs healing, Jim, but you will if they harm my patient.",
+ "#TRI3\\TRI3_018#Well, maybe I've been too hard on you, Jim. I'm sorry.",
+ "#TRI3\\TRI3_019#Easy! Are you out of your mind?",
+ "#TRI3\\TRI3_020#Electrical monsters, things that explode when you phaser them, what else does he want?",
+ "#TRI3\\TRI3_021#I do not understand the desired course of action.",
+ "#TRI3\\TRI3_022#I recommend caution, Captain.",
+ "#TRI3\\TRI3_023#Reading a high energy build-up; there is a Klingon explosive device present five point three meters outside the cavern! It could be detonated at any moment!",
+ "#TRI3\\TRI3_024#This wall was carved from the natural rock of a cavern.",
+ "#TRI3\\TRI3_025#Admiral Vlict has a reputation for thoroughness, Doctor. If he means to kill us, we can expect more than we've encountered.",
+ "#TRI3\\TRI3_026#How hard do you want me to hit it, sir.",
+ "#TRI3\\TRI3_027#No sir. I insist that you have the honor of leading us to victory.",
+ "#TRI3\\TRI3_028#What are waiting for, sir? Shouldn't we just get out of here?",
+ "#TRI3\\TRI3_029#When I get out of this, I am going to have the best shore leave in Starfleet history!",
+ "#TRI3\\TRI3_030#Daylight! We're almost there! We've beaten them!",
+ "#TRI3\\TRI3_103#Beam us back to the Enterprise. Kirk out.",
+ "#TRI3\\TRI3_104#Beam us to Vlict's position.",
+ "#TRI3\\TRI3_107#Negative.",
+ "#TRI3\\TRI3N000#Captain James Tiberius Kirk, deep in thought.",
+ "#TRI3\\TRI3N001#Doctor Leonard McCoy, a rather disgruntled surgeon.",
+ "#TRI3\\TRI3N002#Ensign Bennie, who wishes that he was back at the Academy right now...",
+ "#TRI3\\TRI3N003#No gunslinging allowed, space cowboy.",
+ "#TRI3\\TRI3N004#Spock, one of the foremost science officers in Starfleet.",
+ "#TRI3\\TRI3N005#The exit to this particular complex. You hope.",
+ "#TRI3\\TRI3N006#The wall is resistant to phaser fire.",
+ "#TRI3\\TRI3N007#The wall of this corridor.",
+ "#TRI3\\TRI3U067#Captain, we're still working on breaching the force field. We will let you know when we're ready to beam you out.",
+ "#TRI3\\TRI3U080#Affirmative, sir.",
+ "#TRI3\\TRI3U084#Captain, our sensors have picked up phaser fire! Are you all right? Captain, come in please!",
+ "#TRI3\\TRI3U089#Do you wish to be beamed up now Captain?",
+ "#TRI3\\TRI3U099#Mr. Scott has found a way to breach the force field!",
+
+
"#TRI4\\TRI4_076#You humans have an excellent imagination, but a poor grasp of reality.",
Commit: a1bc22f62a4df11dcebfc8b0ccb712a0426c194f
https://github.com/scummvm/scummvm/commit/a1bc22f62a4df11dcebfc8b0ccb712a0426c194f
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: TRIAL3 text changes
Changed paths:
engines/startrek/text.h
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 82191d0..d777403 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -2247,6 +2247,7 @@ enum GameStringIDs {
TX_TRI3_028,
TX_TRI3_029,
TX_TRI3_030,
+ // UNUSED (031 -> 036; voice substitute for Uhura)
TX_TRI3_103,
TX_TRI3_104,
TX_TRI3_107,
@@ -2260,8 +2261,10 @@ enum GameStringIDs {
TX_TRI3N007,
TX_TRI3U067,
TX_TRI3U080,
+ // UNUSED (U081)
TX_TRI3U084,
TX_TRI3U089,
+ // UNUSED (U090)
TX_TRI3U099,
@@ -4418,10 +4421,10 @@ const char * const g_gameStrings[] = {
"#TRI3\\TRI3_010#Damn it Jim, I'm a Doctor, not a structural Engineer!",
"#TRI3\\TRI3_011#He's out like a light, Jim. There are hibernating Arcturian sloth-tigers that will get up more quickly than this guy.",
"#TRI3\\TRI3_012#I believe that you have seniority, Jim.",
- "#TRI3\\TRI3_013#He's a Male Human, average physical condition.",
- "#TRI3\\TRI3_014#Male Human, excellent physical condition.",
- "#TRI3\\TRI3_015#Male Human, good physical condition.",
- "#TRI3\\TRI3_016#Male Human-Vulcan hybrid. Excellent physical condition.",
+ "#TRI3\\TRI3_013#One Male Human, average physical condition.", // TYPO
+ "#TRI3\\TRI3_014#He's a Male Human, excellent physical condition.", // TYPO
+ "#TRI3\\TRI3_015#Male Human, good physical condition.", // TYPO
+ "#TRI3\\TRI3_016#One Male Human-Vulcan hybrid. Excellent physical condition.", // TYPO
"#TRI3\\TRI3_017#Nobody needs healing, Jim, but you will if they harm my patient.",
"#TRI3\\TRI3_018#Well, maybe I've been too hard on you, Jim. I'm sorry.",
"#TRI3\\TRI3_019#Easy! Are you out of your mind?",
@@ -4449,7 +4452,7 @@ const char * const g_gameStrings[] = {
"#TRI3\\TRI3N007#The wall of this corridor.",
"#TRI3\\TRI3U067#Captain, we're still working on breaching the force field. We will let you know when we're ready to beam you out.",
"#TRI3\\TRI3U080#Affirmative, sir.",
- "#TRI3\\TRI3U084#Captain, our sensors have picked up phaser fire! Are you all right? Captain, come in please!",
+ "#TRI3\\TRI3U084#Captain, our sensors have picked up phaser fire! Are you all right? Captain, please come in!", // TYPO
"#TRI3\\TRI3U089#Do you wish to be beamed up now Captain?",
"#TRI3\\TRI3U099#Mr. Scott has found a way to breach the force field!",
Commit: 4375614528534a01628f6ba0c92d1c1b369d7b94
https://github.com/scummvm/scummvm/commit/4375614528534a01628f6ba0c92d1c1b369d7b94
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: TRIAL4
Changed paths:
engines/startrek/room.h
engines/startrek/rooms/trial4.cpp
engines/startrek/text.h
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 236f24c..ca47f44 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1949,6 +1949,7 @@ public:
// TRIAL4
void trial4Tick1();
+ void trial4Tick60();
// TRIAL5
void trial5Tick1();
diff --git a/engines/startrek/rooms/trial4.cpp b/engines/startrek/rooms/trial4.cpp
index 39869aa..1a55e92 100644
--- a/engines/startrek/rooms/trial4.cpp
+++ b/engines/startrek/rooms/trial4.cpp
@@ -22,16 +22,166 @@
#include "startrek/room.h"
+#define OBJECT_VLICT 8
+#define OBJECT_GUARD 9
+#define OBJECT_QUETZECOATL 10
+
namespace StarTrek {
extern const RoomAction trial4ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::trial4Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::trial4Tick1 },
+ { {ACTION_TICK, 60, 0, 0}, &Room::trial4Tick60 },
};
extern const int trial4NumActions = sizeof(trial4ActionList) / sizeof(RoomAction);
void Room::trial4Tick1() {
+ playVoc("TRI4LOOP");
+
+ loadActorAnim2(OBJECT_VLICT, "vlict1", 0x9f, 0x48);
+ loadActorAnim2(OBJECT_GUARD, "kgstnd", 0xdc, 0x6a);
+ loadActorAnim2(OBJECT_QUETZECOATL, "qstand", 0x10e, 0xaa);
+
+ playMidiMusicTracks(MIDITRACK_32, -1);
+}
+
+void Room::trial4Tick60() {
+ showText(TX_SPEAKER_VLICT, TX_TRI4_061);
+
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI4_022, TX_TRI4_039, TX_TRI4_032,
+ TX_BLANK
+ };
+ int choice = showText(choices);
+
+ if (choice == 0) { // "You were trying to kill us"
+ showText(TX_SPEAKER_VLICT, TX_TRI4_064);
+
+ const TextRef choices2[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI4_033, TX_TRI4_009, TX_TRI4_002,
+ TX_BLANK
+ };
+ showText(choices2); // choice doesn't matter
+
+ showText(TX_SPEAKER_VLICT, TX_TRI4_062);
+ showText(TX_SPEAKER_KIRK, TX_TRI4_014);
+ showText(TX_SPEAKER_VLICT, TX_TRI4_066);
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI4_043);
+
+ const TextRef choices3[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI4_029, TX_TRI4_020, TX_TRI4_030,
+ TX_BLANK
+ };
+ choice = showText(choices3);
+
+ if (choice == 0) { // "Then you have my deepest respect"
+ // Nothing more
+ } else if (choice == 1) { // "Make it a painless death"
+ showText(TX_SPEAKER_VLICT, TX_TRI4_063);
+ } else if (choice == 2) { // "I hope you chose the right time"
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI4_040);
+ }
+ } else if (choice == 1) { // "Use of guile is honorable?"
+ showText(TX_SPEAKER_VLICT, TX_TRI4_060);
+ showText(TX_SPEAKER_KIRK, TX_TRI4_013);
+ showText(TX_SPEAKER_VLICT, TX_TRI4_072);
+ showText(TX_SPEAKER_KIRK, TX_TRI4_015);
+ showText(TX_SPEAKER_VLICT, TX_TRI4_071);
+ showText(TX_SPEAKER_KIRK, TX_TRI4_005);
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI4_052);
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI4_041);
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI4_051);
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI4_053);
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI4_050);
+ showText(TX_SPEAKER_VLICT, TX_TRI4_070);
+
+ const TextRef choices2[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI4_019, TX_TRI4_025, TX_TRI4_008,
+ TX_BLANK
+ };
+ choice = showText(choices2);
+
+ if (choice == 1) { // Threatened Vlict
+ showText(TX_SPEAKER_VLICT, TX_TRI4_069);
+ showText(TX_SPEAKER_KIRK, TX_TRI4_004);
+ } // else, nothing more
+ } else if (choice == 2) { // "You didn't say I couldn't use my ship"
+ showText(TX_SPEAKER_VLICT, TX_TRI4_058);
+
+ const TextRef choices2[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI4_027, TX_TRI4_034, TX_TRI4_018,
+ TX_BLANK
+ };
+ choice = showText(choices2);
+
+ if (choice == 0) { // "Let's stop playing games"
+ showText(TX_SPEAKER_VLICT, TX_TRI4_075);
+ showText(TX_SPEAKER_KIRK, TX_TRI4_017);
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI4_042);
+ showText(TX_SPEAKER_VLICT, TX_TRI4_054);
+
+ const TextRef choices3[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI4_028, TX_TRI4_021, TX_TRI4_031,
+ TX_BLANK
+ };
+ choice = showText(choices3);
+
+ if (choice == 0 || choice == 1) {
+ showText(TX_SPEAKER_VLICT, TX_TRI4_068);
+ showText(TX_SPEAKER_MCCOY, TX_TRI4_036);
+ } else if (choice == 2) {
+ showText(TX_SPEAKER_VLICT, TX_TRI4_056);
+ showText(TX_SPEAKER_KIRK, TX_TRI4_001);
+ }
+ } else if (choice == 1) { // "You lost, release Quetzecoatl"
+ showText(TX_SPEAKER_VLICT, TX_TRI4_076);
+ showText(TX_SPEAKER_MCCOY, TX_TRI4_037);
+ showText(TX_SPEAKER_VLICT, TX_TRI4_073);
+ showText(TX_SPEAKER_KIRK, TX_TRI4_011);
+ showText(TX_SPEAKER_VLICT, TX_TRI4_059);
+ } else if (choice == 2) { // "Nature beat me to it"
+ showText(TX_SPEAKER_VLICT, TX_TRI4_065);
+ showText(TX_SPEAKER_KIRK, TX_TRI4_016);
+ showText(TX_SPEAKER_VLICT, TX_TRI4_074);
+
+ const TextRef choices3[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI4_026, TX_TRI4_024, TX_TRI4_023,
+ TX_BLANK
+ };
+ choice = showText(choices3);
+
+ if (choice == 0) { // "The empire will learn you betrayed them"
+ showText(TX_SPEAKER_VLICT, TX_TRI4_057);
+ showText(TX_SPEAKER_SPOCK, TX_TRI4_038);
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI4_044);
+ showText(TX_SPEAKER_KIRK, TX_TRI4_006);
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI4_048);
+ } else if (choice == 1) { // "You didn't give him a fair trial"
+ showText(TX_SPEAKER_VLICT, TX_TRI4_055);
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI4_045);
+ showText(TX_SPEAKER_KIRK, TX_TRI4_003);
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI4_047);
+ showText(TX_SPEAKER_KIRK, TX_TRI4_010);
+ } else if (choice == 2) { // "How can a liar like you say 'honor'"
+ showText(TX_SPEAKER_VLICT, TX_TRI4_067);
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI4_046);
+ showText(TX_SPEAKER_KIRK, TX_TRI4_007);
+ showText(TX_SPEAKER_QUETZECOATL, TX_TRI4_049);
+ }
+ }
+ }
+
+ showText(TX_SPEAKER_KIRK, TX_TRI4_012);
+ _vm->_awayMission.trial.field5f = 2;
+ endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 2);
}
}
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index d777403..88fbca0 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -2268,6 +2268,80 @@ enum GameStringIDs {
TX_TRI3U099,
+ TX_TRI4_001,
+ TX_TRI4_002,
+ TX_TRI4_003,
+ TX_TRI4_004,
+ TX_TRI4_005,
+ TX_TRI4_006,
+ TX_TRI4_007,
+ TX_TRI4_008,
+ TX_TRI4_009,
+ TX_TRI4_010,
+ TX_TRI4_011,
+ TX_TRI4_012,
+ TX_TRI4_013,
+ TX_TRI4_014,
+ TX_TRI4_015,
+ TX_TRI4_016,
+ TX_TRI4_017,
+ TX_TRI4_018,
+ TX_TRI4_019,
+ TX_TRI4_020,
+ TX_TRI4_021,
+ TX_TRI4_022,
+ TX_TRI4_023,
+ TX_TRI4_024,
+ TX_TRI4_025,
+ TX_TRI4_026,
+ TX_TRI4_027,
+ TX_TRI4_028,
+ TX_TRI4_029,
+ TX_TRI4_030,
+ TX_TRI4_031,
+ TX_TRI4_032,
+ TX_TRI4_033,
+ TX_TRI4_034,
+ TX_TRI4_036,
+ TX_TRI4_037,
+ TX_TRI4_038,
+ TX_TRI4_039,
+ TX_TRI4_040,
+ TX_TRI4_041,
+ TX_TRI4_042,
+ TX_TRI4_043,
+ TX_TRI4_044,
+ TX_TRI4_045,
+ TX_TRI4_046,
+ TX_TRI4_047,
+ TX_TRI4_048,
+ TX_TRI4_049,
+ TX_TRI4_050,
+ TX_TRI4_051,
+ TX_TRI4_052,
+ TX_TRI4_053,
+ TX_TRI4_054,
+ TX_TRI4_055,
+ TX_TRI4_056,
+ TX_TRI4_057,
+ TX_TRI4_058,
+ TX_TRI4_059,
+ TX_TRI4_060,
+ TX_TRI4_061,
+ TX_TRI4_062,
+ TX_TRI4_063,
+ TX_TRI4_064,
+ TX_TRI4_065,
+ TX_TRI4_066,
+ TX_TRI4_067,
+ TX_TRI4_068,
+ TX_TRI4_069,
+ TX_TRI4_070,
+ TX_TRI4_071,
+ TX_TRI4_072,
+ TX_TRI4_073,
+ TX_TRI4_074,
+ TX_TRI4_075,
TX_TRI4_076,
@@ -4457,6 +4531,80 @@ const char * const g_gameStrings[] = {
"#TRI3\\TRI3U099#Mr. Scott has found a way to breach the force field!",
+ "#TRI4\\TRI4_001#Admiral, one day the weaklings are going to surprise the Hell out of you.",
+ "#TRI4\\TRI4_002#Do Klingons believe in ghosts?",
+ "#TRI4\\TRI4_003#I didn't want it to end like this.",
+ "#TRI4\\TRI4_004#I don't really give a damn.",
+ "#TRI4\\TRI4_005#I won't let you. I chal...",
+ "#TRI4\\TRI4_006#I'm sorry we couldn't do more.",
+ "#TRI4\\TRI4_007#I'm sorry we couldn't do more.",
+ "#TRI4\\TRI4_008#Justice?",
+ "#TRI4\\TRI4_009#Maybe you aren't as good as you think you are.",
+ "#TRI4\\TRI4_010#No it isn't.",
+ "#TRI4\\TRI4_011#Nothing you have done has been honorable, Vlict! One day, everyone in the Klingon empire will know it too. Perhaps one day even you will realize it.",
+ "#TRI4\\TRI4_012#Scotty, beam us up.",
+ "#TRI4\\TRI4_013#Then you admit that it was you, and not Quetzecoatl who was responsible for the death of Hrakkour.",
+ "#TRI4\\TRI4_014#Then you admit this trial is a sham! A charade!",
+ "#TRI4\\TRI4_015#Then you will not object to presenting the orders from the Klingon Council authorizing mass murder on Hrakkour.",
+ "#TRI4\\TRI4_016#We beat you, Vlict. Unless you free Quetzecoatl, you will lose your honor!",
+ "#TRI4\\TRI4_017#What!",
+ "#TRI4\\TRI4_018#As we say on Earth, Vlict, nature beat me to it.",
+ "#TRI4\\TRI4_019#Did you listen to anything he said? One day, in spite of people like you, the Klingons will know peace. I hope I live to see that day.",
+ "#TRI4\\TRI4_020#Farewell my friend. Vlict, if you respect honor, you will make it a quick, painless death.",
+ "#TRI4\\TRI4_021#He knows more about courage than you or your Empire will ever know.",
+ "#TRI4\\TRI4_022#Honor? Give me a break, Vlict! You were trying to kill us!",
+ "#TRI4\\TRI4_023#How can a liar like you even say the word \"honor\" without blushing?",
+ "#TRI4\\TRI4_024#How can you call him a traitor without giving him a fair trail!",
+ "#TRI4\\TRI4_025#I do not know if you are a praying man, Vlict. If I were you, I would not want to meet me again.",
+ "#TRI4\\TRI4_026#If you kill him, the Empire will learn that you betrayed them by destroying Hrakkour.",
+ "#TRI4\\TRI4_027#Isn't it time that we stopped playing games, Vlict?",
+ "#TRI4\\TRI4_028#Shut up Vlict.",
+ "#TRI4\\TRI4_029#Then you have my deepest respect. I am sorry I cannot do more for you.",
+ "#TRI4\\TRI4_030#There's a time to fight for what you believe, and a time to die for it. I hope you chose the right time, Quetzecoatl.",
+ "#TRI4\\TRI4_031#Vlict is right, Quetzecoatl. This is suicide. It is a cowardly action.",
+ "#TRI4\\TRI4_032#You didn't say I wasn't allowed to use my ship's computer. If you didn't explain the rules clearly, whose fault is that?",
+ "#TRI4\\TRI4_033#You don't lie very well, do you?",
+ "#TRI4\\TRI4_034#You lost, Vlict. I beat your test. Release Quetzecoatl and let us go!",
+ "#TRI4\\TRI4_036#Jim! You can't let him do this!",
+ "#TRI4\\TRI4_037#You never had any intention of letting Quetzecoatl live!",
+ "#TRI4\\TRI4_038#He is correct, Captain.",
+ "#TRI4\\TRI4_039#I believe that the use of guile, to do what an enemy does not expect, is considered very honorable by the Klingons.",
+ "#TRI4\\TRI4_040#As do I. My only regret is that I did not get to know you better. If only a part of what you are is because you learned from the mistakes of my acolytes, my work was not in vain.",
+ "#TRI4\\TRI4_041#But before I die, I believe that Klingon law allows me to make a public statement.",
+ "#TRI4\\TRI4_042#Captain, I do not see any successful resolution to this, except with my death. Dying to prevent conflict would give it meaning.",
+ "#TRI4\\TRI4_043#Captain, I taught others self-sacrifice. Now I must practice what I preached. It is the only way to atone for my crimes.",
+ "#TRI4\\TRI4_044#Captain, I thank you for your efforts on my behalf, but it is over.",
+ "#TRI4\\TRI4_045#Captain, I thank you for your efforts on my behalf, but it is over.",
+ "#TRI4\\TRI4_046#Captain, I thank you for your efforts on my behalf, but it is over.",
+ "#TRI4\\TRI4_047#I know Captain. But it's better this way.",
+ "#TRI4\\TRI4_048#I know Captain.",
+ "#TRI4\\TRI4_049#I know, Captain.",
+ "#TRI4\\TRI4_050#I, who was once immortal, know that truth is the only true immortal. You can kill people, cultures, even gods, but the truth will always survive.",
+ "#TRI4\\TRI4_051#Intelligent beings are not meant to be caged, either by tyranny, or barbarism. Those who try doom themselves to failure.",
+ "#TRI4\\TRI4_052#No captain. Let there be an end to this violence. I will not allow any more blood to be shed, save my own. I taught the doctrine of self-sacrifice, and I shall die of it.",
+ "#TRI4\\TRI4_053#Once a culture has tasted peace, it will not desire anything else, because peace is better than war, love is better than hate, and creation is better than destruction. This is Truth.",
+ "#TRI4\\TRI4_054#A coward's attitude. He shames this soil.",
+ "#TRI4\\TRI4_055#As judge, I determine what is fair and what is unfair, Kirk! The trial is at an end. The verdict is guilty.",
+ "#TRI4\\TRI4_056#As long as the Federation continues to foster such weaklings, the triumph of the Klingon Empire is assured.",
+ "#TRI4\\TRI4_057#Do not threaten me, Kirk! If you expect the Empire will believe you instead of me, you are greatly mistaken.",
+ "#TRI4\\TRI4_058#Do you think that you can make a fool of me, Kirk!",
+ "#TRI4\\TRI4_059#Go back to your Federation, Kirk!",
+ "#TRI4\\TRI4_060#How dare you lecture me on points of honor! I, the most decorated warrior in the entire empire! I, who took the dishonored trash of my homeworld and destroyed it with a fist of steel!",
+ "#TRI4\\TRI4_061#How dare you! The test was supposed to take place without interference from your ship. You have shown all lack of honor.",
+ "#TRI4\\TRI4_062#I am tired of this posturing, Kirk. You know what the verdict is. Go back to your ship.",
+ "#TRI4\\TRI4_063#I shall agree to it, Captain. Until we meet again.",
+ "#TRI4\\TRI4_064#If I had been trying to murder you, Kirk, you would have surely died.",
+ "#TRI4\\TRI4_065#If I was not bound by the Organian treaty, you would be a dead man now, Kirk! Perhaps one day, I shall not be bound by it.",
+ "#TRI4\\TRI4_066#Of course it was, you fool! Did you honestly expect us to act with kindness to traitors? You fought a battle that you could not win, and fought it very well. Go home, Kirk.",
+ "#TRI4\\TRI4_067#Perhaps because Klingons do not blush. You've lost, Kirk. Go home.",
+ "#TRI4\\TRI4_068#Return to your ship, Kirk. The trial is over.",
+ "#TRI4\\TRI4_069#Such threats, Kirk, will only increase my longing for the experience.",
+ "#TRI4\\TRI4_070#The death ceremony shall take place aboard the K'lirta. I trust you are satisfied that justice has been done.",
+ "#TRI4\\TRI4_071#The trial is over! He is guilty. Durn, carry out the sentence!",
+ "#TRI4\\TRI4_072#Those who lose honor lose life, Kirk! It is the Klingon way!",
+ "#TRI4\\TRI4_073#To allow a traitor to live would dishonor me. I will not live with such a stain on my honor.",
+ "#TRI4\\TRI4_074#To free a traitor is to lose all honor, Kirk! He is sentenced to die!",
+ "#TRI4\\TRI4_075#Very well. The trial is over. K'etz'koatl is sentenced to death.",
"#TRI4\\TRI4_076#You humans have an excellent imagination, but a poor grasp of reality.",
Commit: 160bd9ad510d335649acc45e42ca923b0382277f
https://github.com/scummvm/scummvm/commit/160bd9ad510d335649acc45e42ca923b0382277f
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: TRIAL4 text changes
Changed paths:
engines/startrek/text.h
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 88fbca0..a098aa0 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -2302,6 +2302,7 @@ enum GameStringIDs {
TX_TRI4_032,
TX_TRI4_033,
TX_TRI4_034,
+ // UNUSED (035)
TX_TRI4_036,
TX_TRI4_037,
TX_TRI4_038,
@@ -4533,7 +4534,7 @@ const char * const g_gameStrings[] = {
"#TRI4\\TRI4_001#Admiral, one day the weaklings are going to surprise the Hell out of you.",
"#TRI4\\TRI4_002#Do Klingons believe in ghosts?",
- "#TRI4\\TRI4_003#I didn't want it to end like this.",
+ "#TRI4\\TRI4_003#I don't want it to end like this.", // TYPO
"#TRI4\\TRI4_004#I don't really give a damn.",
"#TRI4\\TRI4_005#I won't let you. I chal...",
"#TRI4\\TRI4_006#I'm sorry we couldn't do more.",
@@ -4550,11 +4551,11 @@ const char * const g_gameStrings[] = {
"#TRI4\\TRI4_017#What!",
"#TRI4\\TRI4_018#As we say on Earth, Vlict, nature beat me to it.",
"#TRI4\\TRI4_019#Did you listen to anything he said? One day, in spite of people like you, the Klingons will know peace. I hope I live to see that day.",
- "#TRI4\\TRI4_020#Farewell my friend. Vlict, if you respect honor, you will make it a quick, painless death.",
+ "#TRI4\\TRI4_020#Farewell my friend. Vlict, if you respect honor, you will make it quick and painless.", // TYPO
"#TRI4\\TRI4_021#He knows more about courage than you or your Empire will ever know.",
"#TRI4\\TRI4_022#Honor? Give me a break, Vlict! You were trying to kill us!",
"#TRI4\\TRI4_023#How can a liar like you even say the word \"honor\" without blushing?",
- "#TRI4\\TRI4_024#How can you call him a traitor without giving him a fair trail!",
+ "#TRI4\\TRI4_024#How can you call him a traitor without giving him a fair trial!", // TYPO
"#TRI4\\TRI4_025#I do not know if you are a praying man, Vlict. If I were you, I would not want to meet me again.",
"#TRI4\\TRI4_026#If you kill him, the Empire will learn that you betrayed them by destroying Hrakkour.",
"#TRI4\\TRI4_027#Isn't it time that we stopped playing games, Vlict?",
@@ -4568,7 +4569,7 @@ const char * const g_gameStrings[] = {
"#TRI4\\TRI4_036#Jim! You can't let him do this!",
"#TRI4\\TRI4_037#You never had any intention of letting Quetzecoatl live!",
"#TRI4\\TRI4_038#He is correct, Captain.",
- "#TRI4\\TRI4_039#I believe that the use of guile, to do what an enemy does not expect, is considered very honorable by the Klingons.",
+ "#TRI4\\TRI4_039#I believe that the use of guile, to do what the enemy does not expect, is considered very honorable by the Klingons.", // TYPO
"#TRI4\\TRI4_040#As do I. My only regret is that I did not get to know you better. If only a part of what you are is because you learned from the mistakes of my acolytes, my work was not in vain.",
"#TRI4\\TRI4_041#But before I die, I believe that Klingon law allows me to make a public statement.",
"#TRI4\\TRI4_042#Captain, I do not see any successful resolution to this, except with my death. Dying to prevent conflict would give it meaning.",
@@ -4586,7 +4587,7 @@ const char * const g_gameStrings[] = {
"#TRI4\\TRI4_054#A coward's attitude. He shames this soil.",
"#TRI4\\TRI4_055#As judge, I determine what is fair and what is unfair, Kirk! The trial is at an end. The verdict is guilty.",
"#TRI4\\TRI4_056#As long as the Federation continues to foster such weaklings, the triumph of the Klingon Empire is assured.",
- "#TRI4\\TRI4_057#Do not threaten me, Kirk! If you expect the Empire will believe you instead of me, you are greatly mistaken.",
+ "#TRI4\\TRI4_057#Do not threaten me, Kirk! If you expect the Empire to believe you instead of me, you are greatly mistaken.", // TYPO
"#TRI4\\TRI4_058#Do you think that you can make a fool of me, Kirk!",
"#TRI4\\TRI4_059#Go back to your Federation, Kirk!",
"#TRI4\\TRI4_060#How dare you lecture me on points of honor! I, the most decorated warrior in the entire empire! I, who took the dishonored trash of my homeworld and destroyed it with a fist of steel!",
Commit: 793a5b602006f7cfbf967de83647f67f161ce70a
https://github.com/scummvm/scummvm/commit/793a5b602006f7cfbf967de83647f67f161ce70a
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: TRIAL5
Changed paths:
engines/startrek/awaymission.h
engines/startrek/items.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/trial0.cpp
engines/startrek/rooms/trial1.cpp
engines/startrek/rooms/trial2.cpp
engines/startrek/rooms/trial3.cpp
engines/startrek/rooms/trial4.cpp
engines/startrek/rooms/trial5.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 93d0fd2..6f31256 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -288,12 +288,23 @@ struct AwayMission {
// 23: Is dead
int16 shotKlingonState; // 0x3d
+ bool neuralInterfaceActive; // 0x43
+ int16 holeContents[3]; // 0x44 (Holes to put gems in for TRIAL5)
+
bool enteredGlobRoom; // 0x5c
bool forceFieldDown; // 0x5d
bool uhuraAnalyzedCode; // 0x5e
- int16 field5f; // 0x5f
+
+ // 0: Gave up in court, letting Quetzecoatl die
+ // 1: Beamed to enterprise after calling Uhura
+ // 2: Lost the court battle after beaming back to the courtroom
+ // 3: Quetzecoatl goes free and Vlict doesn't die
+ // 4: Quetzecoatl goes free and Vlict dies
+ int16 missionEndMethod; // 0x5f
+
bool gotPointsForGettingRod; // 0x61
bool gotPointsForCoatingRodWithIron; // 0x62
+ bool gotPointsForActivatingInterface; // 0x63
bool gotPointsForScanningGlob; // 0x64
bool gotPointsForBeamingOut;
diff --git a/engines/startrek/items.h b/engines/startrek/items.h
index 2bf89f6..fdf1825 100644
--- a/engines/startrek/items.h
+++ b/engines/startrek/items.h
@@ -68,15 +68,15 @@ enum Items {
OBJECT_IH2O,
OBJECT_IWROD,
OBJECT_IIROD,
- OBJECT_IREDGEM_A, // FIXME: repeated items? (applies to all names with _A, _B, or _C)
- OBJECT_IREDGEM_B,
- OBJECT_IREDGEM_C,
- OBJECT_IGRNGEM_A,
- OBJECT_IGRNGEM_B,
- OBJECT_IGRNGEM_C,
- OBJECT_IBLUGEM_A,
- OBJECT_IBLUGEM_B,
- OBJECT_IBLUGEM_C,
+ OBJECT_IREDGEM1,
+ OBJECT_IREDGEM2,
+ OBJECT_IREDGEM3,
+ OBJECT_IGRNGEM1,
+ OBJECT_IGRNGEM2,
+ OBJECT_IGRNGEM3,
+ OBJECT_IBLUGEM1,
+ OBJECT_IBLUGEM2,
+ OBJECT_IBLUGEM3,
OBJECT_ICONECT,
OBJECT_IS8ROCKS,
OBJECT_IIDCARD,
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index ebd3074..4ec703f 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -480,7 +480,9 @@ void Room::spockScan(int direction, TextRef text, bool changeDirection) {
loadActorAnim2(OBJECT_SPOCK, anim, -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
- showText(TX_SPEAKER_SPOCK, text);
+
+ if (text != -1)
+ showText(TX_SPEAKER_SPOCK, text);
}
void Room::mccoyScan(int direction, TextRef text, bool changeDirection) {
@@ -493,7 +495,9 @@ void Room::mccoyScan(int direction, TextRef text, bool changeDirection) {
loadActorAnim2(OBJECT_MCCOY, anim, -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
- showText(TX_SPEAKER_MCCOY, text);
+
+ if (text != -1)
+ showText(TX_SPEAKER_MCCOY, text);
}
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index ca47f44..1442e90 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -1953,6 +1953,85 @@ public:
// TRIAL5
void trial5Tick1();
+ void trial5Tick60();
+ void trial5VlictAppeared();
+ void trial5WalkToInterface();
+ void trial5ReachedInterface();
+ void trial5GetGem(int16 item, int16 object);
+ void trial5ReachedGem();
+ void trial5PickedUpGem();
+ void trial5GetRedGem1();
+ void trial5GetRedGem2();
+ void trial5GetRedGem3();
+ void trial5GetGreenGem1();
+ void trial5GetGreenGem2();
+ void trial5GetGreenGem3();
+ void trial5GetBlueGem1();
+ void trial5GetBlueGem2();
+ void trial5GetBlueGem3();
+ void trial5LookAtKirk();
+ void trial5LookAtSpock();
+ void trial5LookAtMccoy();
+ void trial5LookAtRedshirt();
+ void trial5LookAtBeam();
+ void trial5LookAtInterface();
+ void trial5UseSTricorderOnInterface();
+ void trial5UseMTricorderOnInterface();
+ void trial5LookAtRedGem1();
+ void trial5LookAtRedGem2();
+ void trial5LookAtRedGem3();
+ void trial5LookAtGreenGem1();
+ void trial5LookAtGreenGem2();
+ void trial5LookAtGreenGem3();
+ void trial5LookAtBlueGem1();
+ void trial5LookAtBlueGem2();
+ void trial5LookAtBlueGem3();
+ void trial5LookAtHole();
+ void trial5TalkToKirk();
+ void trial5TalkToSpock();
+ void trial5TalkToMccoy();
+ void trial5TalkToRedshirt();
+ void trial5UsePhaser();
+ void trial5UseMTricorderAnywhere();
+ void trial5UseSTricorderAnywhere();
+ void trial5UseCommunicator();
+ void trial5UseGemOnHole(int16 item, int16 object, int16 hole);
+ void trial5ReachedHoleToPutGem();
+ void trial5ActivateLightOfWar();
+ void trial5ActivateLightOfKnowledge();
+ void trial5ActivateLightOfTravel();
+ void trial5RestrictedCombination1();
+ void trial5RestrictedCombination2();
+ void trial5DestinationNoLongerExists();
+ void trial5CrewmanBeamedOut();
+ void trial5UseRedGem1OnHole1();
+ void trial5UseRedGem2OnHole1();
+ void trial5UseRedGem3OnHole1();
+ void trial5UseGreenGem1OnHole1();
+ void trial5UseGreenGem2OnHole1();
+ void trial5UseGreenGem3OnHole1();
+ void trial5UseBlueGem1OnHole1();
+ void trial5UseBlueGem2OnHole1();
+ void trial5UseBlueGem3OnHole1();
+ void trial5UseRedGem1OnHole2();
+ void trial5UseRedGem2OnHole2();
+ void trial5UseRedGem3OnHole2();
+ void trial5UseGreenGem1OnHole2();
+ void trial5UseGreenGem2OnHole2();
+ void trial5UseGreenGem3OnHole2();
+ void trial5UseBlueGem1OnHole2();
+ void trial5UseBlueGem2OnHole2();
+ void trial5UseBlueGem3OnHole2();
+ void trial5UseRedGem1OnHole3();
+ void trial5UseRedGem2OnHole3();
+ void trial5UseRedGem3OnHole3();
+ void trial5UseGreenGem1OnHole3();
+ void trial5UseGreenGem2OnHole3();
+ void trial5UseGreenGem3OnHole3();
+ void trial5UseBlueGem1OnHole3();
+ void trial5UseBlueGem2OnHole3();
+ void trial5UseBlueGem3OnHole3();
+ void trial5UseMedkitAnywhere();
private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
@@ -2095,6 +2174,11 @@ private:
// trial2
byte globBeingShot;
bool phaserOnKill;
+
+ // trial5
+ int16 itemToUse; // 0x1386
+ int16 objectToUse; // 0x1388
+ int16 hole;
} trial;
} _roomVar;
diff --git a/engines/startrek/rooms/trial0.cpp b/engines/startrek/rooms/trial0.cpp
index 6d042bd..b1ee211 100644
--- a/engines/startrek/rooms/trial0.cpp
+++ b/engines/startrek/rooms/trial0.cpp
@@ -197,7 +197,7 @@ void Room::trial0ReachedRoomCenter() {
playMidiMusicTracks(2, -1);
showText(TX_SPEAKER_VLICT, TX_TRI0_049);
showText(TX_SPEAKER_VLICT, TX_TRI0_044);
- _vm->_awayMission.trial.field5f = 0;
+ _vm->_awayMission.trial.missionEndMethod = 0;
// FIXME: Are these parameters in the right order?
endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 0);
diff --git a/engines/startrek/rooms/trial1.cpp b/engines/startrek/rooms/trial1.cpp
index e33c54d..3fccb3b 100644
--- a/engines/startrek/rooms/trial1.cpp
+++ b/engines/startrek/rooms/trial1.cpp
@@ -437,7 +437,7 @@ void Room::trial1UseCommunicator() {
int choice = showText(choices);
if (choice == 0) { // "Beam us back to the enterprise"
- _vm->_awayMission.trial.field5f = 1;
+ _vm->_awayMission.trial.missionEndMethod = 1;
endMission(1, 1, 1);
} else if (choice == 1) { // "Beam us to Vlict's position"
showText(TX_SPEAKER_UHURA, TX_TRI1U080);
diff --git a/engines/startrek/rooms/trial2.cpp b/engines/startrek/rooms/trial2.cpp
index e428618..a23be95 100644
--- a/engines/startrek/rooms/trial2.cpp
+++ b/engines/startrek/rooms/trial2.cpp
@@ -413,7 +413,7 @@ void Room::trial2UseCommunicator() {
int choice = showText(choices);
if (choice == 0) { // "Beam us back to the enterprise"
- _vm->_awayMission.trial.field5f = 1;
+ _vm->_awayMission.trial.missionEndMethod = 1;
endMission(_vm->_awayMission.trial.missionScore, 1, 1); // FIXME: Inconsistent with TRIAL1
} else if (choice == 1) { // "Beam us to Vlict's position"
showText(TX_SPEAKER_UHURA, TX_TRI1U080); // NOTE: Original didn't show text here
diff --git a/engines/startrek/rooms/trial3.cpp b/engines/startrek/rooms/trial3.cpp
index 2e382bc..a37bd62 100644
--- a/engines/startrek/rooms/trial3.cpp
+++ b/engines/startrek/rooms/trial3.cpp
@@ -381,7 +381,8 @@ void Room::trial3UseSTricorderOnExit() {
void Room::trial3UseMTricorderOnKlingon() {
if (_vm->_awayMission.trial.shotKlingonState == 22) { // Unconscious
mccoyScan(DIR_S, TX_TRI3_011);
- showText(TX_SPEAKER_BENNIE, TX_TRI3_028);
+ if (!_vm->_awayMission.redshirtDead) // BUGFIX: Check if redshirt is dead
+ showText(TX_SPEAKER_BENNIE, TX_TRI3_028);
}
}
@@ -397,7 +398,7 @@ void Room::trial3UseCommunicator() {
int choice = showText(choices);
if (choice == 0) { // "Beam us back to the enterprise"
- _vm->_awayMission.trial.field5f = 1;
+ _vm->_awayMission.trial.missionEndMethod = 1;
endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 1); // FIXME: inconsistent
} else if (choice == 1) { // "Beam us to Vlict's position"
trial3BeamToVlict();
diff --git a/engines/startrek/rooms/trial4.cpp b/engines/startrek/rooms/trial4.cpp
index 1a55e92..29e4fcf 100644
--- a/engines/startrek/rooms/trial4.cpp
+++ b/engines/startrek/rooms/trial4.cpp
@@ -180,7 +180,7 @@ void Room::trial4Tick60() {
}
showText(TX_SPEAKER_KIRK, TX_TRI4_012);
- _vm->_awayMission.trial.field5f = 2;
+ _vm->_awayMission.trial.missionEndMethod = 2;
endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 2);
}
diff --git a/engines/startrek/rooms/trial5.cpp b/engines/startrek/rooms/trial5.cpp
index c2f7298..a71d413 100644
--- a/engines/startrek/rooms/trial5.cpp
+++ b/engines/startrek/rooms/trial5.cpp
@@ -22,16 +22,731 @@
#include "startrek/room.h"
+#define OBJECT_8 8
+#define OBJECT_BEAM 9
+#define OBJECT_10 10
+#define OBJECT_11 11
+#define OBJECT_12 12
+#define OBJECT_13 13
+#define OBJECT_REDGEM1 14
+#define OBJECT_REDGEM2 15
+#define OBJECT_REDGEM3 16
+#define OBJECT_GRNGEM1 17
+#define OBJECT_GRNGEM2 18
+#define OBJECT_GRNGEM3 19
+#define OBJECT_BLUGEM1 20
+#define OBJECT_BLUGEM2 21
+#define OBJECT_BLUGEM3 22
+#define OBJECT_VLICT 23
+
+#define HOTSPOT_HOLE1 0x21
+#define HOTSPOT_HOLE2 0x22
+#define HOTSPOT_HOLE3 0x23
+#define HOTSPOT_INTERFACE 0x24 // Yellow light
+
+#define REDGEM1_X 0x82
+#define REDGEM1_Y 0x98
+#define REDGEM2_X 0x81
+#define REDGEM2_Y 0x9e
+#define REDGEM3_X 0x80
+#define REDGEM3_Y 0xa5
+
+#define GRNGEM1_X 0x97
+#define GRNGEM1_Y 0x98
+#define GRNGEM2_X 0x97
+#define GRNGEM2_Y 0x9e
+#define GRNGEM3_X 0x97
+#define GRNGEM3_Y 0xa5
+
+#define BLUGEM1_X 0xab
+#define BLUGEM1_Y 0x98
+#define BLUGEM2_X 0xac
+#define BLUGEM2_Y 0x9e
+#define BLUGEM3_X 0xad
+#define BLUGEM3_Y 0xa5
+
+#define COMBO(a,b,c) (holes[0] == a && holes[1] == b && holes[2] == c)
+
namespace StarTrek {
extern const RoomAction trial5ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::trial5Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::trial5Tick1 },
+ { {ACTION_TICK, 60, 0, 0}, &Room::trial5Tick60 },
+ { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::trial5VlictAppeared },
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_INTERFACE, 0}, &Room::trial5WalkToInterface },
+ { {ACTION_WALK, HOTSPOT_INTERFACE, 0, 0}, &Room::trial5WalkToInterface },
+ { {ACTION_DONE_WALK, 2, 0, 0}, &Room::trial5ReachedInterface },
+ { {ACTION_DONE_WALK, 30, 0, 0}, &Room::trial5ReachedGem },
+ { {ACTION_DONE_ANIM, 31, 0, 0}, &Room::trial5PickedUpGem },
+
+ { {ACTION_GET, OBJECT_REDGEM1, 0, 0}, &Room::trial5GetRedGem1 },
+ { {ACTION_GET, OBJECT_REDGEM2, 0, 0}, &Room::trial5GetRedGem2 },
+ { {ACTION_GET, OBJECT_REDGEM3, 0, 0}, &Room::trial5GetRedGem3 },
+ { {ACTION_GET, OBJECT_GRNGEM1, 0, 0}, &Room::trial5GetGreenGem1 },
+ { {ACTION_GET, OBJECT_GRNGEM2, 0, 0}, &Room::trial5GetGreenGem2 },
+ { {ACTION_GET, OBJECT_GRNGEM3, 0, 0}, &Room::trial5GetGreenGem3 },
+ { {ACTION_GET, OBJECT_BLUGEM1, 0, 0}, &Room::trial5GetBlueGem1 },
+ { {ACTION_GET, OBJECT_BLUGEM2, 0, 0}, &Room::trial5GetBlueGem2 },
+ { {ACTION_GET, OBJECT_BLUGEM3, 0, 0}, &Room::trial5GetBlueGem3 },
+
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::trial5LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::trial5LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::trial5LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::trial5LookAtRedshirt },
+ { {ACTION_LOOK, OBJECT_BEAM, 0, 0}, &Room::trial5LookAtBeam },
+ { {ACTION_LOOK, HOTSPOT_INTERFACE, 0, 0}, &Room::trial5LookAtInterface },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_INTERFACE, 0}, &Room::trial5UseSTricorderOnInterface },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_INTERFACE, 0}, &Room::trial5UseMTricorderOnInterface },
+
+ { {ACTION_LOOK, OBJECT_REDGEM1, 0, 0}, &Room::trial5LookAtRedGem1 },
+ { {ACTION_LOOK, OBJECT_REDGEM2, 0, 0}, &Room::trial5LookAtRedGem2 },
+ { {ACTION_LOOK, OBJECT_REDGEM3, 0, 0}, &Room::trial5LookAtRedGem3 },
+ { {ACTION_LOOK, OBJECT_GRNGEM1, 0, 0}, &Room::trial5LookAtGreenGem1 },
+ { {ACTION_LOOK, OBJECT_GRNGEM2, 0, 0}, &Room::trial5LookAtGreenGem2 },
+ { {ACTION_LOOK, OBJECT_GRNGEM3, 0, 0}, &Room::trial5LookAtGreenGem3 },
+ { {ACTION_LOOK, OBJECT_BLUGEM1, 0, 0}, &Room::trial5LookAtBlueGem1 },
+ { {ACTION_LOOK, OBJECT_BLUGEM2, 0, 0}, &Room::trial5LookAtBlueGem2 },
+ { {ACTION_LOOK, OBJECT_BLUGEM3, 0, 0}, &Room::trial5LookAtBlueGem3 },
+
+ { {ACTION_LOOK, HOTSPOT_HOLE1, 0, 0}, &Room::trial5LookAtHole },
+ { {ACTION_LOOK, HOTSPOT_HOLE2, 0, 0}, &Room::trial5LookAtHole },
+ { {ACTION_LOOK, HOTSPOT_HOLE3, 0, 0}, &Room::trial5LookAtHole },
+
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::trial5TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::trial5TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::trial5TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::trial5TalkToRedshirt },
+
+ { {ACTION_USE, OBJECT_IPHASERS, 0xff, 0}, &Room::trial5UsePhaser },
+ { {ACTION_USE, OBJECT_IPHASERK, 0xff, 0}, &Room::trial5UsePhaser },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::trial5UseMTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::trial5UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::trial5UseCommunicator },
+
+ { {ACTION_DONE_WALK, 3, 0, 0}, &Room::trial5ReachedHoleToPutGem },
+ { {ACTION_DONE_ANIM, 32, 0, 0}, &Room::trial5CrewmanBeamedOut },
+
+ { {ACTION_USE, OBJECT_IREDGEM1, HOTSPOT_HOLE1, 0}, &Room::trial5UseRedGem1OnHole1 },
+ { {ACTION_USE, OBJECT_IREDGEM2, HOTSPOT_HOLE1, 0}, &Room::trial5UseRedGem2OnHole1 },
+ { {ACTION_USE, OBJECT_IREDGEM3, HOTSPOT_HOLE1, 0}, &Room::trial5UseRedGem3OnHole1 },
+ { {ACTION_USE, OBJECT_IGRNGEM1, HOTSPOT_HOLE1, 0}, &Room::trial5UseGreenGem1OnHole1 },
+ { {ACTION_USE, OBJECT_IGRNGEM2, HOTSPOT_HOLE1, 0}, &Room::trial5UseGreenGem2OnHole1 },
+ { {ACTION_USE, OBJECT_IGRNGEM3, HOTSPOT_HOLE1, 0}, &Room::trial5UseGreenGem3OnHole1 },
+ { {ACTION_USE, OBJECT_IBLUGEM1, HOTSPOT_HOLE1, 0}, &Room::trial5UseBlueGem1OnHole1 },
+ { {ACTION_USE, OBJECT_IBLUGEM2, HOTSPOT_HOLE1, 0}, &Room::trial5UseBlueGem2OnHole1 },
+ { {ACTION_USE, OBJECT_IBLUGEM3, HOTSPOT_HOLE1, 0}, &Room::trial5UseBlueGem3OnHole1 },
+
+ { {ACTION_USE, OBJECT_IREDGEM1, HOTSPOT_HOLE2, 0}, &Room::trial5UseRedGem1OnHole2 },
+ { {ACTION_USE, OBJECT_IREDGEM2, HOTSPOT_HOLE2, 0}, &Room::trial5UseRedGem2OnHole2 },
+ { {ACTION_USE, OBJECT_IREDGEM3, HOTSPOT_HOLE2, 0}, &Room::trial5UseRedGem3OnHole2 },
+ { {ACTION_USE, OBJECT_IGRNGEM1, HOTSPOT_HOLE2, 0}, &Room::trial5UseGreenGem1OnHole2 },
+ { {ACTION_USE, OBJECT_IGRNGEM2, HOTSPOT_HOLE2, 0}, &Room::trial5UseGreenGem2OnHole2 },
+ { {ACTION_USE, OBJECT_IGRNGEM3, HOTSPOT_HOLE2, 0}, &Room::trial5UseGreenGem3OnHole2 },
+ { {ACTION_USE, OBJECT_IBLUGEM1, HOTSPOT_HOLE2, 0}, &Room::trial5UseBlueGem1OnHole2 },
+ { {ACTION_USE, OBJECT_IBLUGEM2, HOTSPOT_HOLE2, 0}, &Room::trial5UseBlueGem2OnHole2 },
+ { {ACTION_USE, OBJECT_IBLUGEM3, HOTSPOT_HOLE2, 0}, &Room::trial5UseBlueGem3OnHole2 },
+
+ { {ACTION_USE, OBJECT_IREDGEM1, HOTSPOT_HOLE3, 0}, &Room::trial5UseRedGem1OnHole3 },
+ { {ACTION_USE, OBJECT_IREDGEM2, HOTSPOT_HOLE3, 0}, &Room::trial5UseRedGem2OnHole3 },
+ { {ACTION_USE, OBJECT_IREDGEM3, HOTSPOT_HOLE3, 0}, &Room::trial5UseRedGem3OnHole3 },
+ { {ACTION_USE, OBJECT_IGRNGEM1, HOTSPOT_HOLE3, 0}, &Room::trial5UseGreenGem1OnHole3 },
+ { {ACTION_USE, OBJECT_IGRNGEM2, HOTSPOT_HOLE3, 0}, &Room::trial5UseGreenGem2OnHole3 },
+ { {ACTION_USE, OBJECT_IGRNGEM3, HOTSPOT_HOLE3, 0}, &Room::trial5UseGreenGem3OnHole3 },
+ { {ACTION_USE, OBJECT_IBLUGEM1, HOTSPOT_HOLE3, 0}, &Room::trial5UseBlueGem1OnHole3 },
+ { {ACTION_USE, OBJECT_IBLUGEM2, HOTSPOT_HOLE3, 0}, &Room::trial5UseBlueGem2OnHole3 },
+ { {ACTION_USE, OBJECT_IBLUGEM3, HOTSPOT_HOLE3, 0}, &Room::trial5UseBlueGem3OnHole3 },
+
+ { {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::trial5UseMedkitAnywhere },
};
extern const int trial5NumActions = sizeof(trial5ActionList) / sizeof(RoomAction);
void Room::trial5Tick1() {
+ playVoc("TRI5LOOP");
+ playMidiMusicTracks(MIDITRACK_31, -1);
+
+ loadActorAnim2(OBJECT_REDGEM1, "redgem", REDGEM1_X, REDGEM1_Y);
+ loadActorAnim2(OBJECT_REDGEM2, "redgem", REDGEM2_X, REDGEM2_Y);
+ loadActorAnim2(OBJECT_REDGEM3, "redgem", REDGEM3_X, REDGEM3_Y);
+ loadActorAnim2(OBJECT_GRNGEM1, "grngem", GRNGEM1_X, GRNGEM1_Y);
+ loadActorAnim2(OBJECT_GRNGEM2, "grngem", GRNGEM2_X, GRNGEM2_Y);
+ loadActorAnim2(OBJECT_GRNGEM3, "grngem", GRNGEM3_X, GRNGEM3_Y);
+ loadActorAnim2(OBJECT_BLUGEM1, "blugem", BLUGEM1_X, BLUGEM1_Y);
+ loadActorAnim2(OBJECT_BLUGEM2, "blugem", BLUGEM2_X, BLUGEM2_Y);
+ loadActorAnim2(OBJECT_BLUGEM3, "blugem", BLUGEM3_X, BLUGEM3_Y);
+}
+
+void Room::trial5Tick60() {
+ showText(TX_SPEAKER_BENNIE, TX_TRI5_052);
+ showText(TX_SPEAKER_SPOCK, TX_TRI5_017);
+ showText(TX_SPEAKER_MCCOY, TX_TRI5_014);
+ showText(TX_SPEAKER_KIRK, TX_TRI5_002);
+}
+
+void Room::trial5VlictAppeared() {
+ showText(TX_SPEAKER_BIALBI, TX_TRI5_027);
+ showText(TX_SPEAKER_VLICT, TX_TRI5_020);
+ showText(TX_SPEAKER_BIALBI, TX_TRI5_031);
+ showText(TX_SPEAKER_VLICT, TX_TRI5_022);
+ showText(TX_SPEAKER_BIALBI, TX_TRI5_029);
+ showText(TX_SPEAKER_VLICT, TX_TRI5_018);
+
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI5_003, TX_TRI5_008, TX_TRI5_006,
+ TX_BLANK
+ };
+ int choice = showText(choices);
+
+ if (choice == 0) { // "Do you want me to help you?"
+ showText(TX_SPEAKER_VLICT, TX_TRI5_023);
+ showText(TX_SPEAKER_MCCOY, TX_TRI5_015);
+
+ const TextRef choices2[] = {
+ TX_SPEAKER_KIRK,
+ TX_TRI5_009, TX_TRI5_007,
+ TX_BLANK
+ };
+ choice = showText(choices2);
+
+ if (choice == 0)
+ choice = 1;
+ else if (choice == 1)
+ choice = 2;
+ }
+
+ if (choice == 1) { // "Now you can rot as you deserve"
+ showText(TX_SPEAKER_BIALBI, TX_TRI5_034);
+
+ _vm->_awayMission.trial.missionEndMethod = 4;
+ endMission(_vm->_awayMission.trial.missionScore, 1, 4);
+ } else if (choice == 2) { // "I'll intervene if Quetzecoatl goes free"
+ showText(TX_SPEAKER_VLICT, TX_TRI5_019);
+ playMidiMusicTracks(MIDITRACK_28, -1);
+
+ showText(TX_SPEAKER_BIALBI, TX_TRI5_025);
+ _vm->_awayMission.trial.missionScore += 4;
+ showText(TX_SPEAKER_KIRK, TX_TRI5_004);
+ showText(TX_SPEAKER_BIALBI, TX_TRI5_030);
+ showText(TX_SPEAKER_BIALBI, TX_TRI5_026);
+ showText(TX_SPEAKER_VLICT, TX_TRI5_021);
+ showText(TX_SPEAKER_BIALBI, TX_TRI5_028);
+ showText(TX_SPEAKER_KIRK, TX_TRI5_005);
+ showText(TX_SPEAKER_BIALBI, TX_TRI5_033);
+ showText(TX_SPEAKER_BIALBI, TX_TRI5_032);
+
+ _vm->_awayMission.trial.missionEndMethod = 3;
+ endMission(1, 1, 3); // FIXME: Are these parameters correct?
+ }
+}
+
+void Room::trial5WalkToInterface() {
+ walkCrewmanC(OBJECT_KIRK, 0x106, 0x96, &Room::trial5ReachedInterface);
+}
+
+void Room::trial5ReachedInterface() {
+ if (!_vm->_awayMission.trial.neuralInterfaceActive)
+ showText(TX_SPEAKER_VOICE, TX_TRI5_035);
+ else {
+ showText(TX_SPEAKER_BIALBI, TX_TRI5_024);
+ loadActorAnimC(OBJECT_VLICT, "vlict1", 0xbe, 0x91, &Room::trial5VlictAppeared);
+ _vm->_awayMission.trial.missionScore += 5;
+ playMidiMusicTracks(MIDITRACK_1, -1);
+ }
+}
+
+void Room::trial5GetGem(int16 item, int16 object) {
+ _roomVar.trial.itemToUse = item;
+ _roomVar.trial.objectToUse = object;
+
+ _vm->_awayMission.disableInput = true;
+ if (object == _vm->_awayMission.trial.holeContents[0]) {
+ _vm->_awayMission.trial.holeContents[0] = 0;
+ _vm->_awayMission.trial.neuralInterfaceActive = false;
+ loadActorStandAnim(OBJECT_BEAM);
+ walkCrewmanC(OBJECT_KIRK, 0x2c, 0x9f, &Room::trial5ReachedGem);
+ } else if (object == _vm->_awayMission.trial.holeContents[1]) {
+ _vm->_awayMission.trial.holeContents[1] = 0;
+ _vm->_awayMission.trial.neuralInterfaceActive = false;
+ loadActorStandAnim(OBJECT_BEAM);
+ walkCrewmanC(OBJECT_KIRK, 0x22, 0x9f, &Room::trial5ReachedGem);
+ } else if (object == _vm->_awayMission.trial.holeContents[2]) {
+ _vm->_awayMission.trial.holeContents[2] = 0;
+ _vm->_awayMission.trial.neuralInterfaceActive = false;
+ loadActorStandAnim(OBJECT_BEAM);
+ walkCrewmanC(OBJECT_KIRK, 0x3c, 0x9f, &Room::trial5ReachedGem);
+ } else if (object == OBJECT_REDGEM1 || object == OBJECT_REDGEM2 || object == OBJECT_REDGEM3)
+ walkCrewmanC(OBJECT_KIRK, 0x80, 0xaa, &Room::trial5ReachedGem);
+ else if (object == OBJECT_GRNGEM1 || object == OBJECT_GRNGEM2 || object == OBJECT_GRNGEM3)
+ walkCrewmanC(OBJECT_KIRK, 0x95, 0xaa, &Room::trial5ReachedGem);
+ else if (object == OBJECT_BLUGEM1 || object == OBJECT_BLUGEM2 || object == OBJECT_BLUGEM3)
+ walkCrewmanC(OBJECT_KIRK, 0xad, 0xaa, &Room::trial5ReachedGem);
+}
+
+void Room::trial5ReachedGem() {
+ loadActorAnimC(OBJECT_KIRK, "kusemn", -1, -1, &Room::trial5PickedUpGem);
+}
+
+void Room::trial5PickedUpGem() {
+ giveItem(_roomVar.trial.itemToUse);
+ loadActorStandAnim(_roomVar.trial.objectToUse);
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::trial5GetRedGem1() {
+ trial5GetGem(OBJECT_IREDGEM1, OBJECT_REDGEM1);
+}
+
+void Room::trial5GetRedGem2() {
+ trial5GetGem(OBJECT_IREDGEM2, OBJECT_REDGEM2);
+}
+
+void Room::trial5GetRedGem3() {
+ trial5GetGem(OBJECT_IREDGEM3, OBJECT_REDGEM3);
+}
+
+void Room::trial5GetGreenGem1() {
+ trial5GetGem(OBJECT_IGRNGEM1, OBJECT_GRNGEM1);
+}
+
+void Room::trial5GetGreenGem2() {
+ trial5GetGem(OBJECT_IGRNGEM2, OBJECT_GRNGEM2);
+}
+
+void Room::trial5GetGreenGem3() {
+ trial5GetGem(OBJECT_IGRNGEM3, OBJECT_GRNGEM3);
+}
+
+void Room::trial5GetBlueGem1() {
+ trial5GetGem(OBJECT_IBLUGEM1, OBJECT_BLUGEM1);
+}
+
+void Room::trial5GetBlueGem2() {
+ trial5GetGem(OBJECT_IBLUGEM2, OBJECT_BLUGEM2);
+}
+
+void Room::trial5GetBlueGem3() {
+ trial5GetGem(OBJECT_IBLUGEM3, OBJECT_BLUGEM3);
+}
+
+void Room::trial5LookAtKirk() {
+ showText(TX_TRI5N005);
+}
+
+void Room::trial5LookAtSpock() {
+ showText(TX_TRI5N009);
+}
+
+void Room::trial5LookAtMccoy() {
+ showText(TX_TRI5N008);
+}
+
+void Room::trial5LookAtRedshirt() {
+ showText(TX_TRI5N010);
+}
+
+void Room::trial5LookAtBeam() {
+ showText(TX_TRI5N002);
+}
+
+void Room::trial5LookAtInterface() {
+ showText(TX_TRI5N004);
+}
+
+void Room::trial5UseSTricorderOnInterface() {
+ spockScan(DIR_E, TX_TRI5_010, true);
+}
+
+void Room::trial5UseMTricorderOnInterface() {
+ mccoyScan(DIR_E, TX_TRI5_011, true);
+}
+
+void Room::trial5LookAtRedGem1() {
+ showText(TX_TRI5N013);
+}
+
+void Room::trial5LookAtRedGem2() {
+ showText(TX_TRI5N014);
+}
+
+void Room::trial5LookAtRedGem3() {
+ showText(TX_TRI5N015);
+}
+
+void Room::trial5LookAtGreenGem1() {
+ showText(TX_TRI5N019);
+}
+
+void Room::trial5LookAtGreenGem2() {
+ showText(TX_TRI5N020);
+}
+
+void Room::trial5LookAtGreenGem3() {
+ showText(TX_TRI5N021);
+}
+
+void Room::trial5LookAtBlueGem1() {
+ showText(TX_TRI5N016);
+}
+
+void Room::trial5LookAtBlueGem2() {
+ showText(TX_TRI5N017);
+}
+
+void Room::trial5LookAtBlueGem3() {
+ showText(TX_TRI5N018);
+}
+
+void Room::trial5LookAtHole() {
+ showText(TX_TRI5N006);
+}
+
+void Room::trial5TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_TRI5_001);
+}
+
+void Room::trial5TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_TRI5_016);
+}
+
+void Room::trial5TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI5_013);
+}
+
+void Room::trial5TalkToRedshirt() {
+ showText(TX_SPEAKER_BENNIE, TX_TRI5_051);
+}
+
+void Room::trial5UsePhaser() {
+ showText(TX_TRI5N011);
+}
+
+void Room::trial5UseMTricorderAnywhere() {
+ // BUGFIX: Original had Spock doing the animation, not Mccoy
+ mccoyScan(DIR_S, -1, true);
+ showText(TX_TRI5N012);
+}
+
+void Room::trial5UseSTricorderAnywhere() {
+ spockScan(DIR_S, -1, true);
+ showText(TX_TRI5N012);
+}
+
+void Room::trial5UseCommunicator() {
+ showText(TX_TRI5N007);
+}
+
+void Room::trial5UseGemOnHole(int16 item, int16 object, int16 hole) {
+ const Common::Point positions[] = {
+ Common::Point(0x2c, 0x9f),
+ Common::Point(0x22, 0x9f),
+ Common::Point(0x3c, 0x9f),
+ };
+
+ hole -= 1;
+
+ _roomVar.trial.itemToUse = item;
+ _roomVar.trial.objectToUse = object;
+ _roomVar.trial.hole = hole;
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ walkCrewmanC(OBJECT_KIRK, positions[hole].x, positions[hole].y, &Room::trial5ReachedHoleToPutGem);
+}
+
+void Room::trial5ReachedHoleToPutGem() {
+ const Common::Point holePositions[] = {
+ Common::Point(0x2e, 0x8e),
+ Common::Point(0x22, 0x95),
+ Common::Point(0x3c, 0x95),
+ };
+ const char * const gemAnims[] = {
+ "RedGem1", "RedGem2", "RedGem3",
+ "GrnGem1", "GrnGem2", "GrnGem3",
+ "BluGem1", "BluGem2", "BluGem3",
+ };
+
+ const int16 hole = _roomVar.trial.hole;
+ const Common::Point &pos = holePositions[hole];
+ const char *anim = gemAnims[_roomVar.trial.objectToUse - OBJECT_REDGEM1];
+
+ loadActorAnim2(OBJECT_KIRK, "kusehn");
+
+ if (_vm->_awayMission.trial.holeContents[hole] == 0) {
+ _vm->_awayMission.trial.holeContents[hole] = _roomVar.trial.objectToUse;
+ loadActorAnim2(_roomVar.trial.objectToUse, anim, pos.x, pos.y);
+ loseItem(_roomVar.trial.itemToUse);
+
+ // Look at the contents of the holes, decide what to do
+
+ const int16 RED = 1;
+ const int16 GREEN = 2;
+ const int16 BLUE = 3;
+
+ int16 holes[3];
+ holes[0] = 0;
+ holes[1] = 0;
+ holes[2] = 0;
+
+ for (int i = 0; i < 3; i++) {
+ int16 c = _vm->_awayMission.trial.holeContents[i];
+ if (c >= OBJECT_REDGEM1 && c <= OBJECT_REDGEM3)
+ holes[i] = RED;
+ else if (c >= OBJECT_GRNGEM1 && c <= OBJECT_GRNGEM3)
+ holes[i] = GREEN;
+ else if (c >= OBJECT_BLUGEM1 && c <= OBJECT_BLUGEM3)
+ holes[i] = BLUE;
+ }
+
+ if COMBO(RED, RED, RED) {
+ trial5ActivateLightOfWar();
+ playMidiMusicTracks(MIDITRACK_1, -1);
+ showText(TX_SPEAKER_LIGHT_OF_WAR, TX_TRI5_050); // All ships in orbit destroyed
+ showGameOverMenu();
+ } else if COMBO(RED, RED, GREEN) {
+ trial5RestrictedCombination1();
+ } else if COMBO(RED, RED, BLUE) {
+ trial5RestrictedCombination1();
+ } else if COMBO(RED, GREEN, RED) {
+ trial5RestrictedCombination1();
+ } else if COMBO(RED, GREEN, GREEN) {
+ trial5ActivateLightOfWar();
+ showText(TX_SPEAKER_LIGHT_OF_WAR, TX_TRI5_036);
+ } else if COMBO(RED, GREEN, BLUE) {
+ trial5ActivateLightOfWar();
+ showText(TX_SPEAKER_LIGHT_OF_WAR, TX_TRI5_048);
+ } else if COMBO(RED, BLUE, RED) {
+ trial5RestrictedCombination1();
+ } else if COMBO(RED, BLUE, GREEN) {
+ trial5RestrictedCombination1();
+ } else if COMBO(RED, BLUE, BLUE) {
+ trial5ActivateLightOfWar();
+ showText(TX_SPEAKER_LIGHT_OF_WAR, TX_TRI5_049);
+ } else if COMBO(GREEN, RED, RED) {
+ trial5ActivateLightOfKnowledge();
+ showText(TX_SPEAKER_LIGHT_OF_KNOWLEDGE, TX_TRI5_047);
+ } else if COMBO(GREEN, RED, GREEN) {
+ trial5RestrictedCombination2();
+ } else if COMBO(GREEN, RED, BLUE) {
+ trial5RestrictedCombination2();
+ } else if COMBO(GREEN, GREEN, RED) {
+ trial5RestrictedCombination1();
+ } else if COMBO(GREEN, GREEN, GREEN) {
+ trial5ActivateLightOfKnowledge();
+ playVoc("EFX12B");
+ showText(TX_SPEAKER_LIGHT_OF_KNOWLEDGE, TX_TRI5_040);
+ showText(TX_SPEAKER_LIGHT_OF_KNOWLEDGE, TX_TRI5_037);
+ _vm->_awayMission.trial.neuralInterfaceActive = true;
+
+ if (!_vm->_awayMission.trial.gotPointsForActivatingInterface) {
+ _vm->_awayMission.trial.gotPointsForActivatingInterface = true;
+ _vm->_awayMission.trial.missionScore += 3;
+ }
+ } else if COMBO(GREEN, GREEN, BLUE) {
+ trial5RestrictedCombination1();
+ } else if COMBO(GREEN, BLUE, RED) {
+ trial5ActivateLightOfKnowledge();
+ showText(TX_SPEAKER_LIGHT_OF_KNOWLEDGE, TX_TRI5_041);
+ } else if COMBO(GREEN, BLUE, GREEN) {
+ trial5RestrictedCombination2();
+ } else if COMBO(GREEN, BLUE, BLUE) {
+ trial5ActivateLightOfKnowledge();
+ showText(TX_SPEAKER_LIGHT_OF_KNOWLEDGE, TX_TRI5_038);
+ } else if COMBO(BLUE, RED, RED) {
+ trial5ActivateLightOfTravel();
+ showText(TX_SPEAKER_LIGHT_OF_TRAVEL, TX_TRI5_045);
+ } else if COMBO(BLUE, RED, GREEN) {
+ trial5DestinationNoLongerExists();
+ } else if COMBO(BLUE, RED, BLUE) {
+ trial5DestinationNoLongerExists();
+ } else if COMBO(BLUE, GREEN, RED) {
+ trial5ActivateLightOfTravel();
+ showText(TX_SPEAKER_LIGHT_OF_TRAVEL, TX_TRI5_042);
+ } else if COMBO(BLUE, GREEN, GREEN) {
+ trial5ActivateLightOfTravel();
+ showText(TX_SPEAKER_LIGHT_OF_TRAVEL, TX_TRI5_044);
+ } else if COMBO(BLUE, GREEN, BLUE) {
+ trial5DestinationNoLongerExists();
+ } else if COMBO(BLUE, BLUE, RED) {
+ trial5RestrictedCombination1();
+ } else if COMBO(BLUE, BLUE, GREEN) {
+ trial5RestrictedCombination1();
+ } else if COMBO(BLUE, BLUE, BLUE) {
+ trial5ActivateLightOfTravel();
+ showText(TX_SPEAKER_LIGHT_OF_TRAVEL, TX_TRI5_046);
+
+ _vm->_awayMission.disableInput = true;
+ playSoundEffectIndex(SND_TRANSDEM);
+
+ loadActorAnimC(OBJECT_KIRK, "kteled", -1, -1, &Room::trial5CrewmanBeamedOut);
+ loadActorAnimC(OBJECT_SPOCK, "steled", -1, -1, &Room::trial5CrewmanBeamedOut);
+ loadActorAnimC(OBJECT_MCCOY, "mteled", -1, -1, &Room::trial5CrewmanBeamedOut);
+ if (!_vm->_awayMission.redshirtDead)
+ loadActorAnimC(OBJECT_REDSHIRT, "rteled", -1, -1, &Room::trial5CrewmanBeamedOut);
+ } else {
+ // Some holes are empty
+ loadActorStandAnim(OBJECT_BEAM);
+ }
+ }
+}
+
+void Room::trial5ActivateLightOfWar() {
+ playSoundEffectIndex(SND_TRANSENE);
+ loadActorAnim2(OBJECT_BEAM, "redlit", 0, 0);
+}
+
+void Room::trial5ActivateLightOfKnowledge() {
+ playSoundEffectIndex(SND_TRANSENE);
+ loadActorAnim2(OBJECT_BEAM, "grnlit", 0, 0);
+}
+
+void Room::trial5ActivateLightOfTravel() {
+ playSoundEffectIndex(SND_TRANSENE);
+ loadActorAnim2(OBJECT_BEAM, "blulit", 0, 0);
+}
+
+void Room::trial5RestrictedCombination1() {
+ // NOTE: The only difference between "trial5RestrictedCombination1" and
+ // "trial5RestrictedCombination2" is that this one doesn't show the light of
+ // knowledge.
+ // It's inconsistent, but I guess we can chalk it up to the aliens being mysterious...
+ playSoundEffectIndex(SND_TRANSENE);
+ showText(TX_SPEAKER_LIGHT_OF_KNOWLEDGE, TX_TRI5_039);
+}
+
+void Room::trial5RestrictedCombination2() {
+ trial5ActivateLightOfKnowledge();
+ showText(TX_SPEAKER_LIGHT_OF_KNOWLEDGE, TX_TRI5_039);
+}
+
+void Room::trial5DestinationNoLongerExists() {
+ trial5ActivateLightOfTravel();
+ showText(TX_SPEAKER_LIGHT_OF_TRAVEL, TX_TRI5_043);
+}
+
+void Room::trial5CrewmanBeamedOut() {
+ if (!_vm->_awayMission.trial.gotPointsForBeamingOut) {
+ _vm->_awayMission.trial.gotPointsForBeamingOut = true;
+ _vm->_awayMission.trial.missionScore += 1;
+ }
+ loadRoomIndex(4, 4);
+}
+
+
+void Room::trial5UseRedGem1OnHole1() {
+ trial5UseGemOnHole(OBJECT_IREDGEM1, OBJECT_REDGEM1, 1);
+}
+
+void Room::trial5UseRedGem2OnHole1() {
+ trial5UseGemOnHole(OBJECT_IREDGEM2, OBJECT_REDGEM2, 1);
+}
+
+void Room::trial5UseRedGem3OnHole1() {
+ trial5UseGemOnHole(OBJECT_IREDGEM3, OBJECT_REDGEM3, 1);
+}
+
+void Room::trial5UseGreenGem1OnHole1() {
+ trial5UseGemOnHole(OBJECT_IGRNGEM1, OBJECT_GRNGEM1, 1);
+}
+
+void Room::trial5UseGreenGem2OnHole1() {
+ trial5UseGemOnHole(OBJECT_IGRNGEM2, OBJECT_GRNGEM2, 1);
+}
+
+void Room::trial5UseGreenGem3OnHole1() {
+ trial5UseGemOnHole(OBJECT_IGRNGEM3, OBJECT_GRNGEM3, 1);
+}
+
+void Room::trial5UseBlueGem1OnHole1() {
+ trial5UseGemOnHole(OBJECT_IBLUGEM1, OBJECT_BLUGEM1, 1);
+}
+
+void Room::trial5UseBlueGem2OnHole1() {
+ trial5UseGemOnHole(OBJECT_IBLUGEM2, OBJECT_BLUGEM2, 1);
+}
+
+void Room::trial5UseBlueGem3OnHole1() {
+ trial5UseGemOnHole(OBJECT_IBLUGEM3, OBJECT_BLUGEM3, 1);
+}
+
+
+void Room::trial5UseRedGem1OnHole2() {
+ trial5UseGemOnHole(OBJECT_IREDGEM1, OBJECT_REDGEM1, 2);
+}
+
+void Room::trial5UseRedGem2OnHole2() {
+ trial5UseGemOnHole(OBJECT_IREDGEM2, OBJECT_REDGEM2, 2);
+}
+
+void Room::trial5UseRedGem3OnHole2() {
+ trial5UseGemOnHole(OBJECT_IREDGEM3, OBJECT_REDGEM3, 2);
+}
+
+void Room::trial5UseGreenGem1OnHole2() {
+ trial5UseGemOnHole(OBJECT_IGRNGEM1, OBJECT_GRNGEM1, 2);
+}
+
+void Room::trial5UseGreenGem2OnHole2() {
+ trial5UseGemOnHole(OBJECT_IGRNGEM2, OBJECT_GRNGEM2, 2);
+}
+
+void Room::trial5UseGreenGem3OnHole2() {
+ trial5UseGemOnHole(OBJECT_IGRNGEM3, OBJECT_GRNGEM3, 2);
+}
+
+void Room::trial5UseBlueGem1OnHole2() {
+ trial5UseGemOnHole(OBJECT_IBLUGEM1, OBJECT_BLUGEM1, 2);
+}
+
+void Room::trial5UseBlueGem2OnHole2() {
+ trial5UseGemOnHole(OBJECT_IBLUGEM2, OBJECT_BLUGEM2, 2);
+}
+
+void Room::trial5UseBlueGem3OnHole2() {
+ trial5UseGemOnHole(OBJECT_IBLUGEM3, OBJECT_BLUGEM3, 2);
+}
+
+
+void Room::trial5UseRedGem1OnHole3() {
+ trial5UseGemOnHole(OBJECT_IREDGEM1, OBJECT_REDGEM1, 3);
+}
+
+void Room::trial5UseRedGem2OnHole3() {
+ trial5UseGemOnHole(OBJECT_IREDGEM2, OBJECT_REDGEM2, 3);
+}
+
+void Room::trial5UseRedGem3OnHole3() {
+ trial5UseGemOnHole(OBJECT_IREDGEM3, OBJECT_REDGEM3, 3);
+}
+
+void Room::trial5UseGreenGem1OnHole3() {
+ trial5UseGemOnHole(OBJECT_IGRNGEM1, OBJECT_GRNGEM1, 3);
+}
+
+void Room::trial5UseGreenGem2OnHole3() {
+ trial5UseGemOnHole(OBJECT_IGRNGEM2, OBJECT_GRNGEM2, 3);
+}
+
+void Room::trial5UseGreenGem3OnHole3() {
+ trial5UseGemOnHole(OBJECT_IGRNGEM3, OBJECT_GRNGEM3, 3);
+}
+
+void Room::trial5UseBlueGem1OnHole3() {
+ trial5UseGemOnHole(OBJECT_IBLUGEM1, OBJECT_BLUGEM1, 3);
+}
+
+void Room::trial5UseBlueGem2OnHole3() {
+ trial5UseGemOnHole(OBJECT_IBLUGEM2, OBJECT_BLUGEM2, 3);
+}
+
+void Room::trial5UseBlueGem3OnHole3() {
+ trial5UseGemOnHole(OBJECT_IBLUGEM3, OBJECT_BLUGEM3, 3);
+}
+
+
+void Room::trial5UseMedkitAnywhere() {
+ showText(TX_SPEAKER_MCCOY, TX_TRI5_012);
}
}
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index a098aa0..e8c22a3 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -111,6 +111,11 @@ enum GameStringIDs {
TX_SPEAKER_VLICT,
TX_SPEAKER_KLINGON_GUARD,
TX_SPEAKER_ENTITY,
+ TX_SPEAKER_BIALBI,
+ TX_SPEAKER_VOICE,
+ TX_SPEAKER_LIGHT_OF_WAR,
+ TX_SPEAKER_LIGHT_OF_KNOWLEDGE,
+ TX_SPEAKER_LIGHT_OF_TRAVEL,
TX_BRIDU146,
@@ -2346,6 +2351,81 @@ enum GameStringIDs {
TX_TRI4_076,
+ TX_TRI5_001,
+ TX_TRI5_002,
+ TX_TRI5_003,
+ TX_TRI5_004,
+ TX_TRI5_005,
+ TX_TRI5_006,
+ TX_TRI5_007,
+ TX_TRI5_008,
+ TX_TRI5_009,
+ TX_TRI5_010,
+ TX_TRI5_011,
+ TX_TRI5_012,
+ TX_TRI5_013,
+ TX_TRI5_014,
+ TX_TRI5_015,
+ TX_TRI5_016,
+ TX_TRI5_017,
+ TX_TRI5_018,
+ TX_TRI5_019,
+ TX_TRI5_020,
+ TX_TRI5_021,
+ TX_TRI5_022,
+ TX_TRI5_023,
+ TX_TRI5_024,
+ TX_TRI5_025,
+ TX_TRI5_026,
+ TX_TRI5_027,
+ TX_TRI5_028,
+ TX_TRI5_029,
+ TX_TRI5_030,
+ TX_TRI5_031,
+ TX_TRI5_032,
+ TX_TRI5_033,
+ TX_TRI5_034,
+ TX_TRI5_035,
+ TX_TRI5_036,
+ TX_TRI5_037,
+ TX_TRI5_038,
+ TX_TRI5_039,
+ TX_TRI5_040,
+ TX_TRI5_041,
+ TX_TRI5_042,
+ TX_TRI5_043,
+ TX_TRI5_044,
+ TX_TRI5_045,
+ TX_TRI5_046,
+ TX_TRI5_047,
+ TX_TRI5_048,
+ TX_TRI5_049,
+ TX_TRI5_050,
+ TX_TRI5_051,
+ TX_TRI5_052,
+ // UNUSED (000 -> 001)
+ TX_TRI5N002,
+ // UNUSED (003)
+ TX_TRI5N004,
+ TX_TRI5N005,
+ TX_TRI5N006,
+ TX_TRI5N007,
+ TX_TRI5N008,
+ TX_TRI5N009,
+ TX_TRI5N010,
+ TX_TRI5N011,
+ TX_TRI5N012,
+ TX_TRI5N013,
+ TX_TRI5N014,
+ TX_TRI5N015,
+ TX_TRI5N016,
+ TX_TRI5N017,
+ TX_TRI5N018,
+ TX_TRI5N019,
+ TX_TRI5N020,
+ TX_TRI5N021,
+
+
TX_SIN3_012,
@@ -2409,6 +2489,11 @@ const char * const g_gameStrings[] = {
"Vlict",
"Klingon Guard",
"Entity",
+ "Bialbi",
+ "A Voice Speaks",
+ "Light of War",
+ "Light of Knowledge",
+ "Light of Travel",
"#BRID\\BRIDU146#Nothing to report, Captain.",
@@ -4609,6 +4694,79 @@ const char * const g_gameStrings[] = {
"#TRI4\\TRI4_076#You humans have an excellent imagination, but a poor grasp of reality.",
+ "#TRI5\\TRI5_001#Obviously, they want us to place the gems in the holes, but which one...",
+ "#TRI5\\TRI5_002#Gentlemen, I suggest we start trying to find out what this is. I have a feeling we've come some place Vlict wasn't expecting us to go.",
+ "#TRI5\\TRI5_003#Hoist on your own petard, eh, Vlict? Do you want me to help you?",
+ "#TRI5\\TRI5_004#I do not see what can be served by more killing.",
+ "#TRI5\\TRI5_005#I fear that politics will make it impossible. Your planet is in Klingon space. But I don't understand why the Klingons never detected you.",
+ "#TRI5\\TRI5_006#If I have your word that Quetzecoatl goes free, I'm willing to intervene to save you.",
+ "#TRI5\\TRI5_007#If I have your word that Quetzecoatl goes free, I'm willing to intervene to save you.",
+ "#TRI5\\TRI5_008#You tried to send me to my death. Now you can rot as you get what you deserve.",
+ "#TRI5\\TRI5_009#You tried to eliminate me. Now you can rot as you get what you deserve.",
+ "#TRI5\\TRI5_010#Captain, it seems to be some sort of interface device, but I do not know how to activate it.",
+ "#TRI5\\TRI5_011#Jim, I have no idea what it is. Why don't you try asking Spock.",
+ "#TRI5\\TRI5_012#Nobody needs healing, Jim, but you will if they harm my patient.",
+ "#TRI5\\TRI5_013#We've got to get out of here, Jim!",
+ "#TRI5\\TRI5_014#Even I can see that, you pointy-eared freak!",
+ "#TRI5\\TRI5_015#He really doesn't have a likable personality, does he?",
+ "#TRI5\\TRI5_016#I suspect Captain, that the machinery is activated by placing the gems in the proper slots. We should determine a system for this.",
+ "#TRI5\\TRI5_017#This is not Klingon technology, Captain.",
+ "#TRI5\\TRI5_018#Kirk!",
+ "#TRI5\\TRI5_019#Agreed!",
+ "#TRI5\\TRI5_020#Kirk! This is your doing!",
+ "#TRI5\\TRI5_021#Rrrrr. Very well. I agree to your terms.",
+ "#TRI5\\TRI5_022#You have no right to try me!",
+ "#TRI5\\TRI5_023#You want me to beg like a weakling child cowering before his betters!",
+ "#TRI5\\TRI5_024#This is Bialbi, the most advanced lifeform on this world. Thank you for informing us of the situation. It shall be resolved.",
+ "#TRI5\\TRI5_025#A life for a life is a just bargain. But his crimes are beyond count.",
+ "#TRI5\\TRI5_026#Admiral Vlict, the entity Quetzecoatl shall be set free. If you ever return to this sector, the sentence shall be carried out. No Klingon vessel may ever return to this world.",
+ "#TRI5\\TRI5_027#Admiral Vlict, this is the defensive system of Hrakkour. You have engaged in genocidal activities on this world. Have you anything to say before your sentence is passed?",
+ "#TRI5\\TRI5_028#As for you, Captain, you may return. I find your social development most pleasing.",
+ "#TRI5\\TRI5_029#I have as much right as you to conduct trials on this planet. You showed no justice to your victim. The penalty for injustice is death.",
+ "#TRI5\\TRI5_030#Idealism! An advanced concept! Naive, perhaps, but charming in its simplicity.",
+ "#TRI5\\TRI5_031#No, Admiral, it is not, but that will suffice as a final public statement. The sentence is banishment, to you and all members of your crew who were involved in this action.",
+ "#TRI5\\TRI5_032#Now, you may go. Heed my warning Vlict. I shall not be merciful a second time.",
+ "#TRI5\\TRI5_033#Their archeological digs did come close, Captain, but I am very elusive. I waited and monitored the situation and chose to reveal myself to you.",
+ "#TRI5\\TRI5_034#You will be returned to your ship, Captain. As will the creature who was unfairly punished. You need not witness the Klingon's punishment.",
+ "#TRI5\\TRI5_035#Not primed for neural interlink.",
+ "#TRI5\\TRI5_036#Alien vessels scanned.",
+ "#TRI5\\TRI5_037#Integrator now active",
+ "#TRI5\\TRI5_038#Telepathic entry codes required for greater than level One functions. Neural interlink at the integrator, and use the main index code of my light",
+ "#TRI5\\TRI5_039#That combination is restricted to higher order functions. Neural interlink required.",
+ "#TRI5\\TRI5_040#This is Bialbi, High Mentalic of Hrakkour. For defense, use the light of war. For information, use my light. For transportation, use the light of travel. Sequences are keyed by combinations of crystals.",
+ "#TRI5\\TRI5_041#To use any light, the first crystal must correspond to the color of the light.",
+ "#TRI5\\TRI5_042#Force field blocks trans-system transport. Transport aborted. Use defense systems to eliminate alien vessels.",
+ "#TRI5\\TRI5_043#That destination no longer exists. Transport abandoned.",
+ "#TRI5\\TRI5_044#There is damage in the archive section due to a recent neutrino burst. Transport aborted.",
+ "#TRI5\\TRI5_045#There is no battle site at present at which to transport you.",
+ "#TRI5\\TRI5_046#We can transport you only in proximity of nearest humanoid life. Transport imminent.",
+ "#TRI5\\TRI5_047#Alien vessels scanned.",
+ "#TRI5\\TRI5_048#Breach of protocol. Alien invasion imminent. Internal security activated.",
+ "#TRI5\\TRI5_049#Internal defenses off line. Failsafes cancelled.",
+ "#TRI5\\TRI5_050#Planetary defenses revived. All alien vessels in orbit destroyed.",
+ "#TRI5\\TRI5_051#I guess I should've taken a few more science courses at the Academy.",
+ "#TRI5\\TRI5_052#What is this place?",
+ "#TRI5\\TRI5N002#A platform emitting a beam light.",
+ "#TRI5\\TRI5N004#A strange yellow light.",
+ "#TRI5\\TRI5N005#James T. Kirk, hero of the galaxy!",
+ "#TRI5\\TRI5N006#Openings on the platform. Place something in these holes?",
+ "#TRI5\\TRI5N007#Your communicator is not working.",
+ "#TRI5\\TRI5N008#Your ever emotional friend, Dr. McCoy.",
+ "#TRI5\\TRI5N009#Your ever logical friend, Spock.",
+ "#TRI5\\TRI5N010#Your ever nervous crewman, Ensign Bennie.",
+ "#TRI5\\TRI5N011#Your phaser is not working.",
+ "#TRI5\\TRI5N012#Your tricorder's recording functions are working, but it does not seem to be able to analyze.",
+ "#TRI5\\TRI5N013#This large gem appears to be a ruby of unusual size. This is obviously artificial.",
+ "#TRI5\\TRI5N014#This large gem appears to be a ruby of unusual size. This is obviously artificial.",
+ "#TRI5\\TRI5N015#This large gem appears to be a ruby of unusual size. This is obviously artificial.",
+ "#TRI5\\TRI5N016#This large gem appears to be a saphire of unusual size. This is obviously artificial.",
+ "#TRI5\\TRI5N017#This large gem appears to be a saphire of unusual size. This is obviously artificial.",
+ "#TRI5\\TRI5N018#This large gem appears to be a saphire of unusual size. This is obviously artificial.",
+ "#TRI5\\TRI5N019#This large gem appears to be a emerald of unusual size. This is obviously artificial.",
+ "#TRI5\\TRI5N020#This large gem appears to be a emerald of unusual size. This is obviously artificial.",
+ "#TRI5\\TRI5N021#This large gem appears to be a emerald of unusual size. This is obviously artificial.",
+
+
"#SIN3\\SIN3_012#Can't say I like the decor.",
Commit: b9eca08db639299cfa13385db45b84b0b01cda28
https://github.com/scummvm/scummvm/commit/b9eca08db639299cfa13385db45b84b0b01cda28
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: TRIAL5 text changes
Changed paths:
engines/startrek/text.h
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index e8c22a3..a5d38bd 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -4731,14 +4731,14 @@ const char * const g_gameStrings[] = {
"#TRI5\\TRI5_035#Not primed for neural interlink.",
"#TRI5\\TRI5_036#Alien vessels scanned.",
"#TRI5\\TRI5_037#Integrator now active",
- "#TRI5\\TRI5_038#Telepathic entry codes required for greater than level One functions. Neural interlink at the integrator, and use the main index code of my light",
+ "#TRI5\\TRI5_038#Telepathic entry codes required for greater than level One functions. Neural interlink at the integrator, and use the main index code of my light.", // TYPO
"#TRI5\\TRI5_039#That combination is restricted to higher order functions. Neural interlink required.",
"#TRI5\\TRI5_040#This is Bialbi, High Mentalic of Hrakkour. For defense, use the light of war. For information, use my light. For transportation, use the light of travel. Sequences are keyed by combinations of crystals.",
"#TRI5\\TRI5_041#To use any light, the first crystal must correspond to the color of the light.",
"#TRI5\\TRI5_042#Force field blocks trans-system transport. Transport aborted. Use defense systems to eliminate alien vessels.",
"#TRI5\\TRI5_043#That destination no longer exists. Transport abandoned.",
"#TRI5\\TRI5_044#There is damage in the archive section due to a recent neutrino burst. Transport aborted.",
- "#TRI5\\TRI5_045#There is no battle site at present at which to transport you.",
+ "#TRI5\\TRI5_045#There is no battle site at present to which to transport you.", // TYPO
"#TRI5\\TRI5_046#We can transport you only in proximity of nearest humanoid life. Transport imminent.",
"#TRI5\\TRI5_047#Alien vessels scanned.",
"#TRI5\\TRI5_048#Breach of protocol. Alien invasion imminent. Internal security activated.",
@@ -4746,7 +4746,7 @@ const char * const g_gameStrings[] = {
"#TRI5\\TRI5_050#Planetary defenses revived. All alien vessels in orbit destroyed.",
"#TRI5\\TRI5_051#I guess I should've taken a few more science courses at the Academy.",
"#TRI5\\TRI5_052#What is this place?",
- "#TRI5\\TRI5N002#A platform emitting a beam light.",
+ "#TRI5\\TRI5N002#A platform emitting a beam of light.", // TYPO
"#TRI5\\TRI5N004#A strange yellow light.",
"#TRI5\\TRI5N005#James T. Kirk, hero of the galaxy!",
"#TRI5\\TRI5N006#Openings on the platform. Place something in these holes?",
@@ -4759,12 +4759,12 @@ const char * const g_gameStrings[] = {
"#TRI5\\TRI5N013#This large gem appears to be a ruby of unusual size. This is obviously artificial.",
"#TRI5\\TRI5N014#This large gem appears to be a ruby of unusual size. This is obviously artificial.",
"#TRI5\\TRI5N015#This large gem appears to be a ruby of unusual size. This is obviously artificial.",
- "#TRI5\\TRI5N016#This large gem appears to be a saphire of unusual size. This is obviously artificial.",
- "#TRI5\\TRI5N017#This large gem appears to be a saphire of unusual size. This is obviously artificial.",
- "#TRI5\\TRI5N018#This large gem appears to be a saphire of unusual size. This is obviously artificial.",
- "#TRI5\\TRI5N019#This large gem appears to be a emerald of unusual size. This is obviously artificial.",
- "#TRI5\\TRI5N020#This large gem appears to be a emerald of unusual size. This is obviously artificial.",
- "#TRI5\\TRI5N021#This large gem appears to be a emerald of unusual size. This is obviously artificial.",
+ "#TRI5\\TRI5N016#This large gem appears to be a sapphire of unusual size. This is obviously artificial.", // TYPO
+ "#TRI5\\TRI5N017#This large gem appears to be a sapphire of unusual size. This is obviously artificial.", // TYPO
+ "#TRI5\\TRI5N018#This large gem appears to be a sapphire of unusual size. This is obviously artificial.", // TYPO
+ "#TRI5\\TRI5N019#This large gem appears to be an emerald of unusual size. This is obviously artificial.", // TYPO
+ "#TRI5\\TRI5N020#This large gem appears to be an emerald of unusual size. This is obviously artificial.", // TYPO
+ "#TRI5\\TRI5N021#This large gem appears to be an emerald of unusual size. This is obviously artificial.", // TYPO
"#SIN3\\SIN3_012#Can't say I like the decor.",
Commit: 52cfe602712ad39174379d56e1b45b7121fefda6
https://github.com/scummvm/scummvm/commit/52cfe602712ad39174379d56e1b45b7121fefda6
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Get starfields working for the intro
Changed paths:
engines/startrek/bitmap.cpp
engines/startrek/bitmap.h
engines/startrek/events.cpp
engines/startrek/filestream.cpp
engines/startrek/filestream.h
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/sound.cpp
engines/startrek/sound.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/bitmap.cpp b/engines/startrek/bitmap.cpp
index 19f1434..2e6eb78 100644
--- a/engines/startrek/bitmap.cpp
+++ b/engines/startrek/bitmap.cpp
@@ -30,8 +30,19 @@ Bitmap::Bitmap(SharedPtr<FileStream> stream) {
width = stream->readUint16();
height = stream->readUint16();
- pixels = new byte[width*height];
- stream->read(pixels, width*height);
+ pixelsArraySize = width * height;
+ pixels = new byte[pixelsArraySize];
+ stream->read(pixels, width * height);
+}
+
+Bitmap::Bitmap(const Bitmap &bitmap) {
+ xoffset = bitmap.xoffset;
+ yoffset = bitmap.yoffset;
+ width = bitmap.width;
+ height = bitmap.height;
+ pixelsArraySize = bitmap.pixelsArraySize;
+ pixels = new byte[pixelsArraySize];
+ memcpy(pixels, bitmap.pixels, pixelsArraySize);
}
Bitmap::Bitmap(int w, int h) : width(w), height(h), xoffset(0), yoffset(0) {
@@ -39,7 +50,8 @@ Bitmap::Bitmap(int w, int h) : width(w), height(h), xoffset(0), yoffset(0) {
}
Bitmap::~Bitmap() {
- delete[] pixels;
+ if (pixels != nullptr)
+ delete[] pixels;
}
@@ -49,7 +61,14 @@ TextBitmap::TextBitmap(int w, int h) {
// Width and Height are the total dimensions. Since each character takes 8 pixels in
// each dimension, the "pixels" array (which actually stores character indices) must
// be smaller.
- pixels = new byte[width/8*height/8];
+ pixelsArraySize = width / 8 * height / 8;
+ pixels = new byte[pixelsArraySize];
+}
+
+StubBitmap::StubBitmap(int w, int h) {
+ width = w;
+ height = h;
+ pixelsArraySize = 0;
}
}
diff --git a/engines/startrek/bitmap.h b/engines/startrek/bitmap.h
index b4c7a87..8bc9cd2 100644
--- a/engines/startrek/bitmap.h
+++ b/engines/startrek/bitmap.h
@@ -16,11 +16,13 @@ struct Bitmap {
byte *pixels;
Bitmap(Common::SharedPtr<FileStream> stream);
+ Bitmap(const Bitmap &bitmap);
Bitmap(int w, int h);
~Bitmap();
protected:
- Bitmap() : xoffset(0),yoffset(0),width(0),height(0),pixels(nullptr) {}
+ int32 pixelsArraySize;
+ Bitmap() : xoffset(0),yoffset(0),width(0),height(0),pixels(nullptr),pixelsArraySize(0) {}
};
@@ -32,6 +34,15 @@ struct TextBitmap : Bitmap {
TextBitmap(int w, int h);
};
+
+// StubBitmap is a bitmap without any actual pixel data. Used as a stub for the
+// "starfield" sprite, which is always in draw mode 1 (invisible), so it never gets drawn;
+// however, it does trigger refreshes on the background in that area, so the game can draw
+// on the background layer manually.
+struct StubBitmap : Bitmap {
+ StubBitmap(int w, int h);
+};
+
}
#endif
diff --git a/engines/startrek/events.cpp b/engines/startrek/events.cpp
index 88bca9d..4685fde 100644
--- a/engines/startrek/events.cpp
+++ b/engines/startrek/events.cpp
@@ -26,11 +26,11 @@ namespace StarTrek {
/**
* Doesn't return until an event occurs.
*/
-void StarTrekEngine::pollSystemEvents() {
+void StarTrekEngine::pollSystemEvents(bool queueEvents) {
Common::Event event;
TrekEvent trekEvent;
- while (_eventQueue.empty()) {
+ while (!queueEvents || _eventQueue.empty()) {
while (_eventMan->pollEvent(event)) {
trekEvent.mouse = event.mouse;
trekEvent.kbd = event.kbd;
@@ -41,26 +41,34 @@ void StarTrekEngine::pollSystemEvents() {
break;
case Common::EVENT_MOUSEMOVE:
- trekEvent.type = TREKEVENT_MOUSEMOVE;
- addEventToQueue(trekEvent);
+ if (queueEvents) {
+ trekEvent.type = TREKEVENT_MOUSEMOVE;
+ addEventToQueue(trekEvent);
+ }
// WORKAROUND: this improves the responsiveness of the mouse.
_system->updateScreen();
break;
case Common::EVENT_LBUTTONDOWN:
- trekEvent.type = TREKEVENT_LBUTTONDOWN;
- addEventToQueue(trekEvent);
+ if (queueEvents) {
+ trekEvent.type = TREKEVENT_LBUTTONDOWN;
+ addEventToQueue(trekEvent);
+ }
break;
case Common::EVENT_RBUTTONDOWN:
- trekEvent.type = TREKEVENT_RBUTTONDOWN;
- addEventToQueue(trekEvent);
+ if (queueEvents) {
+ trekEvent.type = TREKEVENT_RBUTTONDOWN;
+ addEventToQueue(trekEvent);
+ }
break;
case Common::EVENT_KEYDOWN:
- trekEvent.type = TREKEVENT_KEYDOWN;
- addEventToQueue(trekEvent);
+ if (queueEvents) {
+ trekEvent.type = TREKEVENT_KEYDOWN;
+ addEventToQueue(trekEvent);
+ }
break;
default:
@@ -70,27 +78,34 @@ void StarTrekEngine::pollSystemEvents() {
// Check for tick event
uint nextFrame = _frameStartMillis + 1000 / 18.206;
+ uint millis = _system->getMillis();
- if (_system->getMillis() >= nextFrame) {
+ if (millis >= nextFrame) {
_clockTicks++;
- _frameStartMillis = _system->getMillis();
+ _frameStartMillis = millis;
- TrekEvent tickEvent;
- tickEvent.type = TREKEVENT_TICK;
- tickEvent.tick = _clockTicks;
- addEventToQueue(tickEvent);
+ if (queueEvents) {
+ TrekEvent tickEvent;
+ tickEvent.type = TREKEVENT_TICK;
+ tickEvent.tick = _clockTicks;
+ addEventToQueue(tickEvent);
+ }
}
- if (!_eventQueue.empty())
+ if (queueEvents && !_eventQueue.empty())
break;
// Wait a 60th of a second before checking for events again
- uint delay = 1000 / 60;
- if (_system->getMillis() + delay > nextFrame)
- delay = nextFrame - _system->getMillis();
+ int delay = 1000 / 60;
+ millis = _system->getMillis();
+ if (millis + delay > nextFrame)
+ delay = nextFrame - millis;
if (delay > 0)
_system->delayMillis(delay);
+
+ if (!queueEvents)
+ break;
}
}
diff --git a/engines/startrek/filestream.cpp b/engines/startrek/filestream.cpp
index 31cb789..ed54744 100644
--- a/engines/startrek/filestream.cpp
+++ b/engines/startrek/filestream.cpp
@@ -42,6 +42,17 @@ uint16 FileStream::readUint16() {
return w;
}
+uint32 FileStream::readUint32() {
+ assert(_pos + 4 <= size());
+ uint32 w;
+ if (_bigEndian)
+ w = _data[_pos + 3] | (_data[_pos + 2] << 8) | (_data[_pos + 1] << 16) | (_data[_pos] << 24);
+ else
+ w = _data[_pos] | (_data[_pos + 1] << 8) | (_data[_pos + 2] << 16) | (_data[_pos + 3] << 24);
+ _pos += 4;
+ return w;
+}
+
// SeekableReadStream functions
int32 FileStream::pos() const {
diff --git a/engines/startrek/filestream.h b/engines/startrek/filestream.h
index 79a919a..a3d9381 100644
--- a/engines/startrek/filestream.h
+++ b/engines/startrek/filestream.h
@@ -46,6 +46,7 @@ public:
byte readByte();
uint16 readUint16();
+ uint32 readUint32();
// SeekableReadStream functions
int32 pos() const;
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 753605a..9b1801b 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -73,7 +73,45 @@ Graphics::~Graphics() {
void Graphics::setBackgroundImage(SharedPtr<Bitmap> bitmap) {
- _backgroundImage = bitmap;
+ _backgroundImage = SharedPtr<Bitmap>(new Bitmap(*bitmap));
+}
+
+void Graphics::drawBitmapToBackground(const Common::Rect &origRect, const Common::Rect &drawRect, SharedPtr<Bitmap> bitmap) {
+ byte *dest = _backgroundImage->pixels + drawRect.top * SCREEN_WIDTH + drawRect.left;
+ byte *src = bitmap->pixels + (drawRect.left - origRect.left)
+ + (drawRect.top - origRect.top) * bitmap->width;
+
+ for (int y = drawRect.top; y < drawRect.bottom; y++) {
+ for (int x = drawRect.left; x < drawRect.right; x++) {
+ byte b = *src;
+
+ if (b != 0)
+ *dest = b;
+
+ src++;
+ dest++;
+ }
+
+ src += bitmap->width - drawRect.width();
+ dest += SCREEN_WIDTH - drawRect.width();
+ }
+}
+
+void Graphics::fillBackgroundRect(const Common::Rect &rect, byte color) {
+ byte *dest = _backgroundImage->pixels + rect.top * SCREEN_WIDTH + rect.left;
+ for (int y = rect.top; y < rect.bottom; y++) {
+ memset(dest, color, rect.width());
+ dest += SCREEN_WIDTH;
+ }
+}
+
+void Graphics::clearScreenAndPriBuffer() {
+ Common::fill(_priData, _priData + sizeof(_priData), 0);
+
+ ::Graphics::Surface *surface = _vm->_system->lockScreen();
+ surface->fillRect(_screenRect, 0);
+ _vm->_system->unlockScreen();
+ _vm->_system->updateScreen();
}
/**
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 37ac7da..a40e1fa 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -52,7 +52,15 @@ public:
~Graphics();
void setBackgroundImage(SharedPtr<Bitmap> bitmap);
-
+ /**
+ * @param origRect The rectangle containing the original bitmap (must contain the
+ * whole bitmap, even if some is outside the drawable space)
+ * @param drawRect The clipped rectangle to draw at (must be within the drawable space)
+ */
+ void drawBitmapToBackground(const Common::Rect &origRect, const Common::Rect &drawRect, SharedPtr<Bitmap> bitmap);
+ void fillBackgroundRect(const Common::Rect &rect, byte color);
+
+ void clearScreenAndPriBuffer();
void loadPalette(const String &paletteFile);
void fadeinScreen();
void fadeoutScreen();
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 4686796..b07fc68 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -41,7 +41,7 @@ Sound::Sound(StarTrekEngine *vm) : _vm(vm) {
_midiDriver->open();
_midiDriver->setTimerCallback(this, Sound::midiDriverCallback);
- for (int i=0; i<8; i++) {
+ for (int i = 0; i < NUM_MIDI_SLOTS; i++) {
_midiSlots[i].slot = i;
_midiSlots[i].track = -1;
@@ -59,7 +59,7 @@ Sound::Sound(StarTrekEngine *vm) : _vm(vm) {
_soundHandle = new Audio::SoundHandle();
loadedSoundData = nullptr;
- for (int i=1; i<8; i++) {
+ for (int i = 1; i < NUM_MIDI_SLOTS; i++) {
_midiSlotList.push_back(&_midiSlots[i]);
}
@@ -71,7 +71,7 @@ Sound::Sound(StarTrekEngine *vm) : _vm(vm) {
}
Sound::~Sound() {
- for (int i=0; i<8; i++)
+ for (int i = 0; i < NUM_MIDI_SLOTS; i++)
delete _midiSlots[i].midiParser;
delete _midiDriver;
delete _soundHandle;
@@ -80,7 +80,7 @@ Sound::~Sound() {
void Sound::clearAllMidiSlots() {
- for (int i=0; i<8; i++) {
+ for (int i=0; i < NUM_MIDI_SLOTS; i++) {
clearMidiSlot(i);
}
}
@@ -95,7 +95,7 @@ void Sound::playMidiTrack(int track) {
assert(loadedSoundData != nullptr);
// Check if a midi slot for this track exists already
- for (int i=1; i<8; i++) {
+ for (int i = 1; i < NUM_MIDI_SLOTS; i++) {
if (_midiSlots[i].track == track) {
debugC(6, kDebugSound, "Playing MIDI track %d (slot %d)", track, i);
_midiSlots[i].midiParser->loadMusic(loadedSoundData, sizeof(loadedSoundData));
@@ -128,6 +128,18 @@ void Sound::playMidiTrackInSlot(int slot, int track) {
}
}
+bool Sound::isMidiPlaying() {
+ if (!_vm->_musicWorking)
+ return false;
+
+ for (int i = 0; i < NUM_MIDI_SLOTS; i++) {
+ if (_midiSlots[i].midiParser->isPlaying())
+ return true;
+ }
+
+ return false;
+}
+
void Sound::loadMusicFile(const Common::String &baseSoundName) {
clearAllMidiSlots();
@@ -239,7 +251,7 @@ void Sound::playSpeech(const Common::String &basename) {
audioQueue->queueAudioStream(audioStream, DisposeAfterUse::YES);
}
- name.erase(0,i+1);
+ name.erase(0, i + 1);
}
if (audioQueue != nullptr) {
@@ -288,7 +300,7 @@ void Sound::setSfxEnabled(bool enable) {
_vm->_sfxEnabled = enable;
if (!enable) {
- for (int i = 1; i < 8; i++)
+ for (int i = 1; i < NUM_MIDI_SLOTS; i++)
clearMidiSlot(i);
}
@@ -354,7 +366,7 @@ void Sound::clearMidiSlot(int slot) {
// Static callback method
void Sound::midiDriverCallback(void *data) {
Sound *s = (Sound*)data;
- for (int i=0; i<8; i++)
+ for (int i = NUM_MIDI_SLOTS; i < NUM_MIDI_SLOTS; i++)
s->_midiSlots[i].midiParser->onTimer();
// TODO: put this somewhere other than the midi callback...
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
index d5d2323..f708456 100644
--- a/engines/startrek/sound.h
+++ b/engines/startrek/sound.h
@@ -101,6 +101,8 @@ enum MidiTracks {
// Max # of VOC files that can play at once
const int MAX_SFX_PLAYING = 4;
+const int NUM_MIDI_SLOTS = 8;
+
struct MidiPlaybackSlot {
int slot;
int track;
@@ -116,6 +118,7 @@ public:
void clearAllMidiSlots();
void playMidiTrack(int track);
void playMidiTrackInSlot(int slot, int track);
+ bool isMidiPlaying();
void loadMusicFile(const Common::String &baseSoundName);
void playMidiMusicTracks(int startTrack, int loopTrack);
void playVoc(const Common::String &baseSoundName);
@@ -135,7 +138,7 @@ private:
// MIDI-Related Variables
MidiDriver *_midiDriver;
- MidiPlaybackSlot _midiSlots[8]; // 0 is for music; 1-7 are for sfx
+ MidiPlaybackSlot _midiSlots[NUM_MIDI_SLOTS]; // 0 is for music; 1-7 are for sfx
Common::List<MidiPlaybackSlot*> _midiSlotList; // Sorts midi slots by most recently used
byte *loadedSoundData;
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index fe496d2..f53ba17 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -20,6 +20,7 @@
*
*/
+
#include "base/plugins.h"
#include "base/version.h"
#include "common/archive.h"
@@ -83,9 +84,11 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_textboxVar6 = 0;
_textboxHasMultipleChoices = false;
- _missionToLoad = "TRIAL";
+ _missionToLoad = "DEMON";
_roomIndexToLoad = 0;
+ _showSubtitles = false; // TODO: test
+
for (int i = 0; i < NUM_OBJECTS; i++)
_itemList[i] = g_itemList[i];
}
@@ -112,11 +115,14 @@ Common::Error StarTrekEngine::run() {
initializeEventsAndMouse();
_frameIndex = 0;
+ playIntro();
+
+ _frameIndex = 0;
_gameMode = -1;
_lastGameMode = -1;
- runGameMode(GAMEMODE_AWAYMISSION);
+ runGameMode(GAMEMODE_START);
return Common::kNoError;
}
@@ -200,6 +206,274 @@ Common::Error StarTrekEngine::runGameMode(int mode) {
return Common::kNoError;
}
+void StarTrekEngine::playIntro() {
+ // TODO: .MT audio file
+
+ initStarfieldPosition();
+ initStarfield(10, 20, 309, 169, 128);
+
+ SharedPtr<Bitmap> fakeStarfieldBitmap(new StubBitmap(0, 0));
+ _starfieldSprite.bitmap = fakeStarfieldBitmap;
+ initStarfieldSprite(&_starfieldSprite, fakeStarfieldBitmap, _starfieldRect);
+
+ // TODO: remainder of starfield initialization
+
+ _gfx->clearScreenAndPriBuffer();
+ _gfx->fadeoutScreen();
+ _gfx->loadPalette("gold");
+ _gfx->setBackgroundImage(_gfx->loadBitmap("goldlogo"));
+ _sound->playVoc("logo");
+ _gfx->copyBackgroundScreen();
+ _system->updateScreen();
+ _gfx->fadeinScreen();
+
+ uint32 clockTicks = _clockTicks;
+
+ Sprite sprite;
+ _gfx->addSprite(&sprite);
+ sprite.setXYAndPriority(0, 0, 12);
+ sprite.bitmap = _gfx->loadBitmap("blank");
+ sprite.drawPriority2 = 16;
+
+ int index = 12;
+ while (index >= 0) {
+ Common::String file = Common::String::format("credit%02d.shp", index);
+ // TODO: This loads the file, but does not do anything with the resulting data, so
+ // this is just for caching it?
+ // Remember to deal with similar commented function calls below, too.
+ //loadFileWithParams(file, false, true, false);
+ index -= 1;
+ }
+
+ //loadFileWithParams("legal.bmp", false, true, false);
+
+ index = 6;
+ while (index >= 0) {
+ Common::String file = Common::String::format("tittxt%02d.bmp", index);
+ //loadFileWithParams(file, false, true, false);
+ index -= 1;
+ }
+
+ //loadFileWithParams("planet.shp", false, true, false);
+
+ index = 6;
+ while (index >= 0) {
+ Common::String file = Common::String::format("ent%d3.r3s", index);
+ //loadFileWithParams(file, false, true, false);
+ index -= 1;
+ }
+
+ // TODO: kirkintr
+
+ clockTicks += 540;
+
+ while (_clockTicks < clockTicks && _sound->isMidiPlaying()) {
+ pollSystemEvents(false);
+ }
+
+ // TODO: MT audio file
+
+ _gfx->fadeoutScreen();
+ _gfx->loadPalette("bridge");
+ _gfx->clearScreenAndPriBuffer();
+ _sound->loadMusicFile("title");
+ clockTicks = _clockTicks;
+
+ int32 starfieldZoomSpeed;
+ int16 frame = 0;
+ bool buttonPressed = 0;
+
+ while (frame != 0x180 || (_sound->isMidiPlaying() && !buttonPressed)) {
+ TrekEvent event;
+ while (popNextEvent(&event)) {
+ if (event.type == TREKEVENT_KEYDOWN) {
+ _gfx->fadeoutScreen();
+ buttonPressed = true;
+ } else if (event.type == TREKEVENT_TICK)
+ break;
+ }
+
+ switch (frame) {
+ case 0:
+ starfieldZoomSpeed = 10;
+ playMidiMusicTracks(MIDITRACK_0, -1);
+ _byte_45b3c = 0;
+ break;
+
+ case 30:
+ _sound->playVoc("kirkintr");
+ loadSubtitleSprite(0, &sprite);
+ break;
+
+ case 36:
+ loadSubtitleSprite(1, &sprite);
+ break;
+
+ case 42:
+ loadSubtitleSprite(-1, &sprite);
+ break;
+ }
+
+ if (!buttonPressed) {
+ updateStarfieldAndShips(false);
+ _gfx->drawAllSprites();
+ _gfx->incPaletteFadeLevel();
+ clockTicks += 3;
+
+ while (_clockTicks < clockTicks)
+ pollSystemEvents(false);
+ }
+
+ _starfieldPosition.z += starfieldZoomSpeed;
+
+ frame++;
+ if (frame >= 0x186)
+ frame = 0x186;
+ }
+
+ _gfx->fadeoutScreen();
+ _gfx->delSprite(&_starfieldSprite);
+ // TODO: the rest
+}
+
+void StarTrekEngine::loadSubtitleSprite(int index, Sprite *sprite) {
+ if (_showSubtitles) {
+ if (index == -1)
+ sprite->setBitmap(_gfx->loadBitmap("blank"));
+ else {
+ Common::String file = Common::String::format("tittxt%02d", index);
+ sprite->setBitmap(_gfx->loadBitmap(file));
+ }
+ }
+}
+
+void StarTrekEngine::initStarfieldPosition() {
+ memset(&_starfieldPosition, 0, sizeof(_starfieldPosition));
+ // TODO: matrix initialization
+}
+
+void StarTrekEngine::initStarfield(int16 x, int16 y, int16 width, int16 height, int16 arg8) {
+ _starfieldXVar1 = (x + width) / 2;
+ _starfieldYVar1 = (y + height) / 2;
+ _starfieldXVar2 = (width - x + 1) / 2;
+ _starfieldYVar2 = (height - y + 1) / 2;
+
+ _starfieldRect.left = _starfieldXVar1 - _starfieldXVar2;
+ _starfieldRect.right = _starfieldXVar1 + _starfieldXVar2;
+ _starfieldRect.top = _starfieldYVar1 - _starfieldYVar2;
+ _starfieldRect.bottom = _starfieldYVar1 + _starfieldYVar2;
+
+ memset(_starList, 0, sizeof(_starList));
+ _starfieldPointDivisor = 150;
+}
+
+void StarTrekEngine::clearStarfieldPixels() {
+ _gfx->fillBackgroundRect(_starfieldRect, 0);
+}
+
+void StarTrekEngine::drawStarfield() {
+ // TODO: make these class variables
+ Point3W starPositionWeightings[] = {{0x4000, 0, 0}, {0, 0x4000, 0}, {0, 0, 0x4000}};
+ float flt_50898 = 50.0; // ?
+
+ int16 var28 = ((_starfieldXVar2 * 3) >> 1);
+ int16 xvar = var28 / 2;
+ int16 var2a = ((_starfieldYVar2 * 3) >> 1);
+ int16 yvar = var2a / 2;
+ int16 var8 = _starfieldPointDivisor << 3;
+
+ SharedPtr<FileStream> file = loadFile("stars.shp");
+
+ for (int i = 0; i < NUM_STARS; i++) {
+ Star *star = &_starList[i];
+ if ((i & 0xf) == 0) {
+ file->seek(0, SEEK_SET);
+ }
+
+ if (!star->active) {
+ int16 var4 = getRandomWord() / var28 - xvar;
+ int16 var6 = getRandomWord() / var2a - yvar;
+ Point3 point = constructPoint3ForStarfield(var4, var6, var8);
+ star->pos = applyPointWeightings(starPositionWeightings, point) + _starfieldPosition;
+ star->active = true;
+ }
+
+ Point3 p = star->pos - _starfieldPosition;
+ Point3 point2 = applyPointWeightings2(p, starPositionWeightings);
+
+ if (point2.z > flt_50898 && point2.z < 0x3fff
+ && abs(point2.x) < point2.z && abs(point2.y) < point2.z) {
+
+ int16 x = _starfieldXVar1 + (point2.x * _starfieldPointDivisor / point2.z);
+ int16 y = _starfieldYVar1 - (point2.y * _starfieldPointDivisor / point2.z);
+
+ int fileOffset = file->pos();
+ file->readUint32();
+ int16 width = file->readUint16();
+ int16 height = file->readUint16();
+
+ Common::Rect starRect(x, y, x + width, y + height);
+ Common::Rect drawRect = _starfieldRect.findIntersectingRect(starRect);
+
+ file->seek(fileOffset, SEEK_SET);
+ SharedPtr<Bitmap> bitmap = SharedPtr<Bitmap>(new Bitmap(file));
+
+ if (!drawRect.isEmpty()) {
+ _gfx->drawBitmapToBackground(starRect, drawRect, bitmap);
+ bitmap.reset();
+ }
+ } else {
+ star->active = false;
+
+ file->readUint32();
+ int16 offset2 = file->readUint16() * file->readUint16();
+ file->seek(file->pos() + offset2, SEEK_SET);
+ }
+ }
+}
+
+void StarTrekEngine::updateStarfieldAndShips(bool arg0) {
+ _starfieldSprite.bitmapChanged = true;
+ // sub_24b74(...);
+ clearStarfieldPixels();
+ drawStarfield();
+
+ // TODO
+}
+
+Point3 StarTrekEngine::constructPoint3ForStarfield(int16 x, int16 y, int16 z) {
+ Point3 point;
+ point.z = z;
+ point.y = y * z / _starfieldPointDivisor;
+ point.x = x * z / _starfieldPointDivisor;
+
+ return point;
+}
+
+Point3 StarTrekEngine::applyPointWeightings(Point3W *weight, const Point3 &point) {
+ int32 ret[3];
+ for (int i = 0; i < 3; i++) {
+ ret[i] = weight[i].x * (point.x & 0xffff) + weight[i].y * (point.y & 0xffff) + weight[i].z * (point.z & 0xffff);
+ ret[i] <<= 2;
+ }
+ Point3 p;
+ p.x = ret[0] >> 16;
+ p.y = ret[1] >> 16;
+ p.z = ret[2] >> 16;
+ return p;
+}
+
+Point3 StarTrekEngine::applyPointWeightings2(const Point3 &point, Point3W *weight) {
+ Point3 p = Point3();
+ p.x = (weight[0].x * (point.x & 0xffff) + weight[1].x * (point.y & 0xffff) + weight[2].x * (point.z & 0xffff)) << 2;
+ p.y = (weight[0].y * (point.x & 0xffff) + weight[1].y * (point.y & 0xffff) + weight[2].y * (point.z & 0xffff)) << 2;
+ p.z = (weight[0].z * (point.x & 0xffff) + weight[1].z * (point.y & 0xffff) + weight[2].z * (point.z & 0xffff)) << 2;
+ p.x >>= 16;
+ p.y >>= 16;
+ p.z >>= 16;
+ return p;
+}
+
void StarTrekEngine::runTransportSequence(const Common::String &name) {
const uint16 crewmanTransportPositions[][2] = {
{ 0x8e, 0x7c },
@@ -1486,6 +1760,17 @@ exitWithoutSelection:
return lastItemIndex;
}
+void StarTrekEngine::initStarfieldSprite(Sprite *sprite, SharedPtr<Bitmap> bitmap, const Common::Rect &rect) {
+ sprite->setXYAndPriority(rect.left, rect.top, 0);
+ sprite->setBitmap(bitmap);
+ bitmap->xoffset = 0;
+ bitmap->yoffset = 0;
+ bitmap->width = rect.width();
+ bitmap->height = rect.height();
+ _gfx->addSprite(sprite);
+ sprite->drawMode = 1;
+}
+
/**
* A scale of 256 is the baseline.
*/
@@ -1801,6 +2086,10 @@ SharedPtr<FileStream> StarTrekEngine::loadFile(Common::String filename, int file
return SharedPtr<FileStream>();
}
+SharedPtr<FileStream> StarTrekEngine::loadFileWithParams(Common::String filename, bool unk1, bool unk2, bool unk3) {
+ return loadFile(filename);
+}
+
void StarTrekEngine::playMovie(Common::String filename) {
if (getPlatform() == Common::kPlatformMacintosh)
playMovieMac(filename);
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index cacb8c3..21981e2 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -199,6 +199,43 @@ struct TrekEvent {
};
+// Pseudo-3D structs
+
+struct Point3 {
+ int32 x;
+ int32 y;
+ int32 z;
+
+ Point3 operator+(const Point3 &p) const {
+ Point3 p2;
+ p2.x = x + p.x;
+ p2.y = y + p.y;
+ p2.z = z + p.z;
+ return p2;
+ }
+ Point3 operator-(const Point3 &p) const {
+ Point3 p2;
+ p2.x = x - p.x;
+ p2.y = y - p.y;
+ p2.z = z - p.z;
+ return p2;
+ }
+};
+
+struct Point3W {
+ int16 x;
+ int16 y;
+ int16 z;
+};
+
+struct Star {
+ bool active;
+ Point3 pos;
+};
+
+#define NUM_STARS 16
+
+
struct StarTrekGameDescription;
class Graphics;
class IWFile;
@@ -237,6 +274,21 @@ public:
SharedPtr<Room> getRoom();
private:
+ // Intro
+ void playIntro();
+ void loadSubtitleSprite(int index, Sprite *sprite);
+
+ // Space, pseudo-3D
+ void initStarfieldPosition();
+ void initStarfield(int16 x, int16 y, int16 width, int16 height, int16 arg8);
+ void clearStarfieldPixels();
+ void drawStarfield();
+ void updateStarfieldAndShips(bool arg0);
+
+ Point3 constructPoint3ForStarfield(int16 x, int16 y, int16 z);
+ Point3 applyPointWeightings(Point3W *weight, const Point3 &point);
+ Point3 applyPointWeightings2(const Point3 &point, Point3W *weight);
+
// Transporter room
void runTransportSequence(const Common::String &name);
@@ -281,12 +333,13 @@ public:
void showInventoryIcons(bool showItem);
void hideInventoryIcons();
int showInventoryMenu(int x, int y, bool restoreMouse);
+ void initStarfieldSprite(Sprite *sprite, SharedPtr<Bitmap> bitmap, const Common::Rect &rect);
SharedPtr<Bitmap> scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed16 scale);
void scaleBitmapRow(byte *src, byte *dest, uint16 origWidth, uint16 scaledWidth);
// Events
public:
- void pollSystemEvents();
+ void pollSystemEvents(bool queueEvents = true);
void initializeEventsAndMouse();
bool getNextEvent(TrekEvent *e);
void removeNextEvent();
@@ -391,6 +444,10 @@ public:
// Resource related functions
SharedPtr<FileStream> loadFile(Common::String filename, int fileIndex=0);
+ /**
+ * TODO: Figure out what the extra parameters are, and if they're important.
+ */
+ SharedPtr<FileStream> loadFileWithParams(Common::String filename, bool unk1, bool unk2, bool unk3);
// Movie related functions
void playMovie(Common::String filename);
@@ -477,7 +534,18 @@ public:
bool _keyboardControlsMouse;
bool _inQuitGameMenu;
-
+ bool _showSubtitles;
+
+ byte _byte_45b3c;
+
+ // Pseudo-3D / starfield stuff
+ Sprite _starfieldSprite;
+ Star _starList[NUM_STARS];
+ Point3 _starfieldPosition;
+ int32 _starfieldPointDivisor;
+ int16 _starfieldXVar1, _starfieldYVar1;
+ int16 _starfieldXVar2, _starfieldYVar2;
+ Common::Rect _starfieldRect;
Graphics *_gfx;
Sound *_sound;
Commit: 639c02b76f591fe17ee78b6a72da46c4782fd4d5
https://github.com/scummvm/scummvm/commit/639c02b76f591fe17ee78b6a72da46c4782fd4d5
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fix sound, support MT32.
Also jump to the first mission after the intro.
Changed paths:
engines/startrek/events.cpp
engines/startrek/graphics.cpp
engines/startrek/sound.cpp
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/events.cpp b/engines/startrek/events.cpp
index 4685fde..6315899 100644
--- a/engines/startrek/events.cpp
+++ b/engines/startrek/events.cpp
@@ -23,89 +23,72 @@
namespace StarTrek {
-/**
- * Doesn't return until an event occurs.
- */
-void StarTrekEngine::pollSystemEvents(bool queueEvents) {
+void StarTrekEngine::pollEvents(bool queueEvents) {
Common::Event event;
TrekEvent trekEvent;
+ while (_eventMan->pollEvent(event)) {
+ trekEvent.mouse = event.mouse;
+ trekEvent.kbd = event.kbd;
+
+ switch (event.type) {
+ case Common::EVENT_QUIT:
+ _system->quit();
+ break;
- while (!queueEvents || _eventQueue.empty()) {
- while (_eventMan->pollEvent(event)) {
- trekEvent.mouse = event.mouse;
- trekEvent.kbd = event.kbd;
-
- switch (event.type) {
- case Common::EVENT_QUIT:
- _system->quit();
- break;
-
- case Common::EVENT_MOUSEMOVE:
- if (queueEvents) {
- trekEvent.type = TREKEVENT_MOUSEMOVE;
- addEventToQueue(trekEvent);
- }
-
- // WORKAROUND: this improves the responsiveness of the mouse.
- _system->updateScreen();
- break;
-
- case Common::EVENT_LBUTTONDOWN:
- if (queueEvents) {
- trekEvent.type = TREKEVENT_LBUTTONDOWN;
- addEventToQueue(trekEvent);
- }
- break;
-
- case Common::EVENT_RBUTTONDOWN:
- if (queueEvents) {
- trekEvent.type = TREKEVENT_RBUTTONDOWN;
- addEventToQueue(trekEvent);
- }
- break;
-
- case Common::EVENT_KEYDOWN:
- if (queueEvents) {
- trekEvent.type = TREKEVENT_KEYDOWN;
- addEventToQueue(trekEvent);
- }
- break;
-
- default:
- break;
+ case Common::EVENT_MOUSEMOVE:
+ if (queueEvents) {
+ trekEvent.type = TREKEVENT_MOUSEMOVE;
+ addEventToQueue(trekEvent);
}
- }
- // Check for tick event
- uint nextFrame = _frameStartMillis + 1000 / 18.206;
- uint millis = _system->getMillis();
+ // WORKAROUND: this improves the responsiveness of the mouse.
+ _system->updateScreen();
+ break;
- if (millis >= nextFrame) {
- _clockTicks++;
+ case Common::EVENT_LBUTTONDOWN:
+ if (queueEvents) {
+ trekEvent.type = TREKEVENT_LBUTTONDOWN;
+ addEventToQueue(trekEvent);
+ }
+ break;
- _frameStartMillis = millis;
+ case Common::EVENT_RBUTTONDOWN:
+ if (queueEvents) {
+ trekEvent.type = TREKEVENT_RBUTTONDOWN;
+ addEventToQueue(trekEvent);
+ }
+ break;
+ case Common::EVENT_KEYDOWN:
if (queueEvents) {
- TrekEvent tickEvent;
- tickEvent.type = TREKEVENT_TICK;
- tickEvent.tick = _clockTicks;
- addEventToQueue(tickEvent);
+ trekEvent.type = TREKEVENT_KEYDOWN;
+ addEventToQueue(trekEvent);
}
- }
+ break;
- if (queueEvents && !_eventQueue.empty())
+ default:
break;
+ }
+ }
+}
- // Wait a 60th of a second before checking for events again
- int delay = 1000 / 60;
- millis = _system->getMillis();
- if (millis + delay > nextFrame)
- delay = nextFrame - millis;
- if (delay > 0)
- _system->delayMillis(delay);
+void StarTrekEngine::waitForNextTick(bool queueEvents) {
+ pollEvents(queueEvents);
- if (!queueEvents)
- break;
+ uint nextFrame = _frameStartMillis + 1000 / 18.206;
+ uint millis = _system->getMillis();
+
+ if (millis < nextFrame)
+ _system->delayMillis(nextFrame - millis);
+
+ _clockTicks++;
+ _frameStartMillis = nextFrame;
+
+ if (queueEvents) {
+ TrekEvent tickEvent;
+ tickEvent.type = TREKEVENT_TICK;
+ tickEvent.tick = _clockTicks;
+ addEventToQueue(tickEvent);
}
}
@@ -117,11 +100,35 @@ void StarTrekEngine::initializeEventsAndMouse() {
// TODO: mouse
}
-/**
- * Returns false if there is no event waiting.
- */
-bool StarTrekEngine::getNextEvent(TrekEvent *e) {
- pollSystemEvents(); // TODO: put this somewhere else?
+bool StarTrekEngine::getNextEvent(TrekEvent *e, bool poll) {
+ while (poll && _eventQueue.empty()) {
+ pollEvents(true);
+
+ // Check for tick event
+ uint nextFrame = _frameStartMillis + 1000 / 18.206;
+ uint millis = _system->getMillis();
+
+ if (millis >= nextFrame) {
+ _clockTicks++;
+ _frameStartMillis = millis;
+
+ TrekEvent tickEvent;
+ tickEvent.type = TREKEVENT_TICK;
+ tickEvent.tick = _clockTicks;
+ addEventToQueue(tickEvent);
+ }
+
+ if (!_eventQueue.empty())
+ break;
+
+ // Still no events; wait a 60th of a second before checking for events again
+ int delay = 1000 / 60;
+ millis = _system->getMillis();
+ if (millis + delay > nextFrame)
+ delay = nextFrame - millis;
+ if (delay > 0)
+ _system->delayMillis(delay);
+ }
if (_eventQueue.empty())
return false;
@@ -143,8 +150,8 @@ void StarTrekEngine::removeNextEvent() {
_eventQueue.pop_front();
}
-bool StarTrekEngine::popNextEvent(TrekEvent *e) {
- if (!getNextEvent(e))
+bool StarTrekEngine::popNextEvent(TrekEvent *e, bool poll) {
+ if (!getNextEvent(e, poll))
return false;
removeNextEvent();
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 9b1801b..6fe1c8f 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -134,11 +134,7 @@ void Graphics::loadPalette(const Common::String &paletteName) {
void Graphics::fadeinScreen() {
while (_paletteFadeLevel <= 100) {
TrekEvent event;
- do {
- if (!_vm->popNextEvent(&event))
- continue;
- }
- while (event.type != TREKEVENT_TICK);
+ _vm->waitForNextTick();
setPaletteFadeLevel(_palData, _paletteFadeLevel);
_paletteFadeLevel += 10;
@@ -150,11 +146,7 @@ void Graphics::fadeinScreen() {
void Graphics::fadeoutScreen() {
while (_paletteFadeLevel >= 0) {
TrekEvent event;
- do {
- if (!_vm->popNextEvent(&event))
- continue;
- }
- while (event.type != TREKEVENT_TICK);
+ _vm->waitForNextTick();
setPaletteFadeLevel(_palData, _paletteFadeLevel);
_paletteFadeLevel -= 10;
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index b07fc68..3d14149 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -36,7 +36,7 @@ namespace StarTrek {
Sound::Sound(StarTrekEngine *vm) : _vm(vm) {
if (_vm->getPlatform() == Common::kPlatformDOS || _vm->getPlatform() == Common::kPlatformMacintosh) {
- _midiDevice = MidiDriver::detectDevice(MDT_PCSPK|MDT_ADLIB|MDT_MIDI);
+ _midiDevice = MidiDriver::detectDevice(MDT_PCSPK | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32);
_midiDriver = MidiDriver::createMidi(_midiDevice);
_midiDriver->open();
_midiDriver->setTimerCallback(this, Sound::midiDriverCallback);
@@ -366,7 +366,7 @@ void Sound::clearMidiSlot(int slot) {
// Static callback method
void Sound::midiDriverCallback(void *data) {
Sound *s = (Sound*)data;
- for (int i = NUM_MIDI_SLOTS; i < NUM_MIDI_SLOTS; i++)
+ for (int i = 0; i < NUM_MIDI_SLOTS; i++)
s->_midiSlots[i].midiParser->onTimer();
// TODO: put this somewhere other than the midi callback...
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index f53ba17..a6addb7 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -87,7 +87,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_missionToLoad = "DEMON";
_roomIndexToLoad = 0;
- _showSubtitles = false; // TODO: test
+ _showSubtitles = true; // TODO: test
for (int i = 0; i < NUM_OBJECTS; i++)
_itemList[i] = g_itemList[i];
@@ -116,13 +116,14 @@ Common::Error StarTrekEngine::run() {
_frameIndex = 0;
playIntro();
+ debug("DONE");
_frameIndex = 0;
_gameMode = -1;
_lastGameMode = -1;
- runGameMode(GAMEMODE_START);
+ runGameMode(GAMEMODE_AWAYMISSION);
return Common::kNoError;
}
@@ -229,11 +230,11 @@ void StarTrekEngine::playIntro() {
uint32 clockTicks = _clockTicks;
- Sprite sprite;
- _gfx->addSprite(&sprite);
- sprite.setXYAndPriority(0, 0, 12);
- sprite.bitmap = _gfx->loadBitmap("blank");
- sprite.drawPriority2 = 16;
+ Sprite subtitleSprite;
+ _gfx->addSprite(&subtitleSprite);
+ subtitleSprite.setXYAndPriority(0, 0, 12);
+ subtitleSprite.bitmap = _gfx->loadBitmap("blank");
+ subtitleSprite.drawPriority2 = 16;
int index = 12;
while (index >= 0) {
@@ -268,7 +269,7 @@ void StarTrekEngine::playIntro() {
clockTicks += 540;
while (_clockTicks < clockTicks && _sound->isMidiPlaying()) {
- pollSystemEvents(false);
+ waitForNextTick(true);
}
// TODO: MT audio file
@@ -281,16 +282,18 @@ void StarTrekEngine::playIntro() {
int32 starfieldZoomSpeed;
int16 frame = 0;
- bool buttonPressed = 0;
+ bool buttonPressed = false;
while (frame != 0x180 || (_sound->isMidiPlaying() && !buttonPressed)) {
- TrekEvent event;
- while (popNextEvent(&event)) {
- if (event.type == TREKEVENT_KEYDOWN) {
- _gfx->fadeoutScreen();
- buttonPressed = true;
- } else if (event.type == TREKEVENT_TICK)
- break;
+ if (!buttonPressed) {
+ TrekEvent event;
+ while (popNextEvent(&event, false)) {
+ if (event.type == TREKEVENT_KEYDOWN) {
+ _gfx->fadeoutScreen();
+ buttonPressed = true;
+ } else if (event.type == TREKEVENT_TICK)
+ break;
+ }
}
switch (frame) {
@@ -302,15 +305,20 @@ void StarTrekEngine::playIntro() {
case 30:
_sound->playVoc("kirkintr");
- loadSubtitleSprite(0, &sprite);
+ loadSubtitleSprite(0, &subtitleSprite);
break;
case 36:
- loadSubtitleSprite(1, &sprite);
+ loadSubtitleSprite(1, &subtitleSprite);
break;
case 42:
- loadSubtitleSprite(-1, &sprite);
+ loadSubtitleSprite(-1, &subtitleSprite);
+ break;
+
+ case 378:
+ _gfx->delSprite(&subtitleSprite);
+ _byte_45b3c = 1;
break;
}
@@ -321,7 +329,7 @@ void StarTrekEngine::playIntro() {
clockTicks += 3;
while (_clockTicks < clockTicks)
- pollSystemEvents(false);
+ waitForNextTick();
}
_starfieldPosition.z += starfieldZoomSpeed;
@@ -418,10 +426,9 @@ void StarTrekEngine::drawStarfield() {
file->seek(fileOffset, SEEK_SET);
SharedPtr<Bitmap> bitmap = SharedPtr<Bitmap>(new Bitmap(file));
- if (!drawRect.isEmpty()) {
+ if (!drawRect.isEmpty())
_gfx->drawBitmapToBackground(starRect, drawRect, bitmap);
- bitmap.reset();
- }
+ bitmap.reset();
} else {
star->active = false;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 21981e2..d5000f7 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -339,11 +339,20 @@ public:
// Events
public:
- void pollSystemEvents(bool queueEvents = true);
+ /**
+ * Checks for all events, and updates Star Trek's event queue if queueEvents is set.
+ * This does not account for "tick" events (getNextEvent/popNextEvent handle that).
+ */
+ void pollEvents(bool queueEvents = true);
+ void waitForNextTick(bool queueEvents = true);
void initializeEventsAndMouse();
- bool getNextEvent(TrekEvent *e);
+ /**
+ * Returns false if there is no event waiting. If "poll" is true, this always returns
+ * something (waits until an event occurs if necessary).
+ */
+ bool getNextEvent(TrekEvent *e, bool poll = true);
void removeNextEvent();
- bool popNextEvent(TrekEvent *e);
+ bool popNextEvent(TrekEvent *e, bool poll = true);
void addEventToQueue(const TrekEvent &e);
void clearEventBuffer();
void updateEvents();
Commit: a024a3fd4501a0ab41ffdd62f65914f2307bdf22
https://github.com/scummvm/scummvm/commit/a024a3fd4501a0ab41ffdd62f65914f2307bdf22
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Move space functions into separate file
Changed paths:
A engines/startrek/space.cpp
A engines/startrek/space.h
engines/startrek/module.mk
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index b0f1034..bef2c8d 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -16,6 +16,7 @@ MODULE_OBJS = \
room.o \
saveload.o \
sound.o \
+ space.o \
sprite.o \
startrek.o \
text.o \
diff --git a/engines/startrek/space.cpp b/engines/startrek/space.cpp
new file mode 100644
index 0000000..1171952
--- /dev/null
+++ b/engines/startrek/space.cpp
@@ -0,0 +1,154 @@
+/* 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 "startrek/startrek.h"
+
+namespace StarTrek {
+
+void StarTrekEngine::initStarfieldPosition() {
+ memset(&_starfieldPosition, 0, sizeof(_starfieldPosition));
+ // TODO: matrix initialization
+}
+
+void StarTrekEngine::initStarfield(int16 x, int16 y, int16 width, int16 height, int16 arg8) {
+ _starfieldXVar1 = (x + width) / 2;
+ _starfieldYVar1 = (y + height) / 2;
+ _starfieldXVar2 = (width - x + 1) / 2;
+ _starfieldYVar2 = (height - y + 1) / 2;
+
+ _starfieldRect.left = _starfieldXVar1 - _starfieldXVar2;
+ _starfieldRect.right = _starfieldXVar1 + _starfieldXVar2;
+ _starfieldRect.top = _starfieldYVar1 - _starfieldYVar2;
+ _starfieldRect.bottom = _starfieldYVar1 + _starfieldYVar2;
+
+ memset(_starList, 0, sizeof(_starList));
+ _starfieldPointDivisor = 150;
+}
+
+void StarTrekEngine::clearStarfieldPixels() {
+ _gfx->fillBackgroundRect(_starfieldRect, 0);
+}
+
+void StarTrekEngine::drawStarfield() {
+ // TODO: make these class variables
+ Point3W starPositionWeightings[] = {{0x4000, 0, 0}, {0, 0x4000, 0}, {0, 0, 0x4000}};
+ float flt_50898 = 50.0; // ?
+
+ int16 var28 = ((_starfieldXVar2 * 3) >> 1);
+ int16 xvar = var28 / 2;
+ int16 var2a = ((_starfieldYVar2 * 3) >> 1);
+ int16 yvar = var2a / 2;
+ int16 var8 = _starfieldPointDivisor << 3;
+
+ SharedPtr<FileStream> file = loadFile("stars.shp");
+
+ for (int i = 0; i < NUM_STARS; i++) {
+ Star *star = &_starList[i];
+ if ((i & 0xf) == 0) {
+ file->seek(0, SEEK_SET);
+ }
+
+ if (!star->active) {
+ int16 var4 = getRandomWord() / var28 - xvar;
+ int16 var6 = getRandomWord() / var2a - yvar;
+ Point3 point = constructPoint3ForStarfield(var4, var6, var8);
+ star->pos = applyPointWeightings(starPositionWeightings, point) + _starfieldPosition;
+ star->active = true;
+ }
+
+ Point3 p = star->pos - _starfieldPosition;
+ Point3 point2 = applyPointWeightings2(p, starPositionWeightings);
+
+ if (point2.z > flt_50898 && point2.z < 0x3fff
+ && abs(point2.x) < point2.z && abs(point2.y) < point2.z) {
+
+ int16 x = _starfieldXVar1 + (point2.x * _starfieldPointDivisor / point2.z);
+ int16 y = _starfieldYVar1 - (point2.y * _starfieldPointDivisor / point2.z);
+
+ int fileOffset = file->pos();
+ file->readUint32();
+ int16 width = file->readUint16();
+ int16 height = file->readUint16();
+
+ Common::Rect starRect(x, y, x + width, y + height);
+ Common::Rect drawRect = _starfieldRect.findIntersectingRect(starRect);
+
+ file->seek(fileOffset, SEEK_SET);
+ SharedPtr<Bitmap> bitmap = SharedPtr<Bitmap>(new Bitmap(file));
+
+ if (!drawRect.isEmpty())
+ _gfx->drawBitmapToBackground(starRect, drawRect, bitmap);
+ bitmap.reset();
+ } else {
+ star->active = false;
+
+ file->readUint32();
+ int16 offset2 = file->readUint16() * file->readUint16();
+ file->seek(file->pos() + offset2, SEEK_SET);
+ }
+ }
+}
+
+void StarTrekEngine::updateStarfieldAndShips(bool arg0) {
+ _starfieldSprite.bitmapChanged = true;
+ // sub_24b74(...);
+ clearStarfieldPixels();
+ drawStarfield();
+
+ // TODO
+}
+
+Point3 StarTrekEngine::constructPoint3ForStarfield(int16 x, int16 y, int16 z) {
+ Point3 point;
+ point.z = z;
+ point.y = y * z / _starfieldPointDivisor;
+ point.x = x * z / _starfieldPointDivisor;
+
+ return point;
+}
+
+Point3 StarTrekEngine::applyPointWeightings(Point3W *weight, const Point3 &point) {
+ int32 ret[3];
+ for (int i = 0; i < 3; i++) {
+ ret[i] = weight[i].x * (point.x & 0xffff) + weight[i].y * (point.y & 0xffff) + weight[i].z * (point.z & 0xffff);
+ ret[i] <<= 2;
+ }
+ Point3 p;
+ p.x = ret[0] >> 16;
+ p.y = ret[1] >> 16;
+ p.z = ret[2] >> 16;
+ return p;
+}
+
+Point3 StarTrekEngine::applyPointWeightings2(const Point3 &point, Point3W *weight) {
+ Point3 p = Point3();
+ p.x = (weight[0].x * (point.x & 0xffff) + weight[1].x * (point.y & 0xffff) + weight[2].x * (point.z & 0xffff)) << 2;
+ p.y = (weight[0].y * (point.x & 0xffff) + weight[1].y * (point.y & 0xffff) + weight[2].y * (point.z & 0xffff)) << 2;
+ p.z = (weight[0].z * (point.x & 0xffff) + weight[1].z * (point.y & 0xffff) + weight[2].z * (point.z & 0xffff)) << 2;
+ p.x >>= 16;
+ p.y >>= 16;
+ p.z >>= 16;
+ return p;
+}
+
+}
diff --git a/engines/startrek/space.h b/engines/startrek/space.h
new file mode 100644
index 0000000..f5d08e5
--- /dev/null
+++ b/engines/startrek/space.h
@@ -0,0 +1,46 @@
+// Pseudo-3D structs
+
+struct Point3 {
+ int32 x;
+ int32 y;
+ int32 z;
+
+ Point3 operator+(const Point3 &p) const {
+ Point3 p2;
+ p2.x = x + p.x;
+ p2.y = y + p.y;
+ p2.z = z + p.z;
+ return p2;
+ }
+ Point3 operator-(const Point3 &p) const {
+ Point3 p2;
+ p2.x = x - p.x;
+ p2.y = y - p.y;
+ p2.z = z - p.z;
+ return p2;
+ }
+};
+
+struct Point3W {
+ int16 x;
+ int16 y;
+ int16 z;
+};
+
+struct Star {
+ bool active;
+ Point3 pos;
+};
+
+// Struct for objects in space.
+// TODO: what does this stand for? Maybe rename it.
+struct R3 {
+ Point3 pos; // 0x0
+ int16 field1e; // 0x1e
+};
+
+// Maximum number of stars visible at once in the starfields
+#define NUM_STARS 16
+
+// Maximum number of R3 objects in space at once
+#define NUM_SPACE_OBJECTS 0x30
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index a6addb7..ab1e3c7 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -355,132 +355,6 @@ void StarTrekEngine::loadSubtitleSprite(int index, Sprite *sprite) {
}
}
-void StarTrekEngine::initStarfieldPosition() {
- memset(&_starfieldPosition, 0, sizeof(_starfieldPosition));
- // TODO: matrix initialization
-}
-
-void StarTrekEngine::initStarfield(int16 x, int16 y, int16 width, int16 height, int16 arg8) {
- _starfieldXVar1 = (x + width) / 2;
- _starfieldYVar1 = (y + height) / 2;
- _starfieldXVar2 = (width - x + 1) / 2;
- _starfieldYVar2 = (height - y + 1) / 2;
-
- _starfieldRect.left = _starfieldXVar1 - _starfieldXVar2;
- _starfieldRect.right = _starfieldXVar1 + _starfieldXVar2;
- _starfieldRect.top = _starfieldYVar1 - _starfieldYVar2;
- _starfieldRect.bottom = _starfieldYVar1 + _starfieldYVar2;
-
- memset(_starList, 0, sizeof(_starList));
- _starfieldPointDivisor = 150;
-}
-
-void StarTrekEngine::clearStarfieldPixels() {
- _gfx->fillBackgroundRect(_starfieldRect, 0);
-}
-
-void StarTrekEngine::drawStarfield() {
- // TODO: make these class variables
- Point3W starPositionWeightings[] = {{0x4000, 0, 0}, {0, 0x4000, 0}, {0, 0, 0x4000}};
- float flt_50898 = 50.0; // ?
-
- int16 var28 = ((_starfieldXVar2 * 3) >> 1);
- int16 xvar = var28 / 2;
- int16 var2a = ((_starfieldYVar2 * 3) >> 1);
- int16 yvar = var2a / 2;
- int16 var8 = _starfieldPointDivisor << 3;
-
- SharedPtr<FileStream> file = loadFile("stars.shp");
-
- for (int i = 0; i < NUM_STARS; i++) {
- Star *star = &_starList[i];
- if ((i & 0xf) == 0) {
- file->seek(0, SEEK_SET);
- }
-
- if (!star->active) {
- int16 var4 = getRandomWord() / var28 - xvar;
- int16 var6 = getRandomWord() / var2a - yvar;
- Point3 point = constructPoint3ForStarfield(var4, var6, var8);
- star->pos = applyPointWeightings(starPositionWeightings, point) + _starfieldPosition;
- star->active = true;
- }
-
- Point3 p = star->pos - _starfieldPosition;
- Point3 point2 = applyPointWeightings2(p, starPositionWeightings);
-
- if (point2.z > flt_50898 && point2.z < 0x3fff
- && abs(point2.x) < point2.z && abs(point2.y) < point2.z) {
-
- int16 x = _starfieldXVar1 + (point2.x * _starfieldPointDivisor / point2.z);
- int16 y = _starfieldYVar1 - (point2.y * _starfieldPointDivisor / point2.z);
-
- int fileOffset = file->pos();
- file->readUint32();
- int16 width = file->readUint16();
- int16 height = file->readUint16();
-
- Common::Rect starRect(x, y, x + width, y + height);
- Common::Rect drawRect = _starfieldRect.findIntersectingRect(starRect);
-
- file->seek(fileOffset, SEEK_SET);
- SharedPtr<Bitmap> bitmap = SharedPtr<Bitmap>(new Bitmap(file));
-
- if (!drawRect.isEmpty())
- _gfx->drawBitmapToBackground(starRect, drawRect, bitmap);
- bitmap.reset();
- } else {
- star->active = false;
-
- file->readUint32();
- int16 offset2 = file->readUint16() * file->readUint16();
- file->seek(file->pos() + offset2, SEEK_SET);
- }
- }
-}
-
-void StarTrekEngine::updateStarfieldAndShips(bool arg0) {
- _starfieldSprite.bitmapChanged = true;
- // sub_24b74(...);
- clearStarfieldPixels();
- drawStarfield();
-
- // TODO
-}
-
-Point3 StarTrekEngine::constructPoint3ForStarfield(int16 x, int16 y, int16 z) {
- Point3 point;
- point.z = z;
- point.y = y * z / _starfieldPointDivisor;
- point.x = x * z / _starfieldPointDivisor;
-
- return point;
-}
-
-Point3 StarTrekEngine::applyPointWeightings(Point3W *weight, const Point3 &point) {
- int32 ret[3];
- for (int i = 0; i < 3; i++) {
- ret[i] = weight[i].x * (point.x & 0xffff) + weight[i].y * (point.y & 0xffff) + weight[i].z * (point.z & 0xffff);
- ret[i] <<= 2;
- }
- Point3 p;
- p.x = ret[0] >> 16;
- p.y = ret[1] >> 16;
- p.z = ret[2] >> 16;
- return p;
-}
-
-Point3 StarTrekEngine::applyPointWeightings2(const Point3 &point, Point3W *weight) {
- Point3 p = Point3();
- p.x = (weight[0].x * (point.x & 0xffff) + weight[1].x * (point.y & 0xffff) + weight[2].x * (point.z & 0xffff)) << 2;
- p.y = (weight[0].y * (point.x & 0xffff) + weight[1].y * (point.y & 0xffff) + weight[2].y * (point.z & 0xffff)) << 2;
- p.z = (weight[0].z * (point.x & 0xffff) + weight[1].z * (point.y & 0xffff) + weight[2].z * (point.z & 0xffff)) << 2;
- p.x >>= 16;
- p.y >>= 16;
- p.z >>= 16;
- return p;
-}
-
void StarTrekEngine::runTransportSequence(const Common::String &name) {
const uint16 crewmanTransportPositions[][2] = {
{ 0x8e, 0x7c },
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index d5000f7..3f5636f 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -46,6 +46,7 @@
#include "startrek/items.h"
#include "startrek/object.h"
#include "startrek/sound.h"
+#include "startrek/space.h"
using Common::SharedPtr;
@@ -199,43 +200,6 @@ struct TrekEvent {
};
-// Pseudo-3D structs
-
-struct Point3 {
- int32 x;
- int32 y;
- int32 z;
-
- Point3 operator+(const Point3 &p) const {
- Point3 p2;
- p2.x = x + p.x;
- p2.y = y + p.y;
- p2.z = z + p.z;
- return p2;
- }
- Point3 operator-(const Point3 &p) const {
- Point3 p2;
- p2.x = x - p.x;
- p2.y = y - p.y;
- p2.z = z - p.z;
- return p2;
- }
-};
-
-struct Point3W {
- int16 x;
- int16 y;
- int16 z;
-};
-
-struct Star {
- bool active;
- Point3 pos;
-};
-
-#define NUM_STARS 16
-
-
struct StarTrekGameDescription;
class Graphics;
class IWFile;
@@ -278,7 +242,7 @@ private:
void playIntro();
void loadSubtitleSprite(int index, Sprite *sprite);
- // Space, pseudo-3D
+ // Space, pseudo-3D (space.cpp)
void initStarfieldPosition();
void initStarfield(int16 x, int16 y, int16 width, int16 height, int16 arg8);
void clearStarfieldPixels();
Commit: ac9cd1f00a28b09dd0202c90a2fe023bc8cba525
https://github.com/scummvm/scummvm/commit/ac9cd1f00a28b09dd0202c90a2fe023bc8cba525
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement fixed-point decimal class
Changed paths:
A engines/startrek/fixedint.h
engines/startrek/awaymission.cpp
engines/startrek/common.h
engines/startrek/object.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/saveload.cpp
engines/startrek/space.cpp
engines/startrek/space.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index e086bca..94ee869 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -105,9 +105,9 @@ void StarTrekEngine::loadRoom(const Common::String &missionName, int roomIndex)
actorFunc1();
initActors();
- double num = _room->getVar0c() - _room->getVar0a();
- double den = _room->getVar06() - _room->getVar08() + 1;
- _playerActorScale = (int32)(num * 256 / den);
+ Fixed16 num = _room->getMaxScale() - _room->getMinScale();
+ int16 den = _room->getMaxY() - _room->getMinY() + 1;
+ _playerActorScale = Fixed32(num) / den;
// TODO: RDF vars 1e/1f and 20/21; relates to BAN files?
@@ -446,21 +446,21 @@ void StarTrekEngine::unloadRoom() {
* further up (away) the object is, the smaller it is.
*/
int StarTrekEngine::loadActorAnimWithRoomScaling(int actorIndex, const Common::String &animName, int16 x, int16 y) {
- uint16 scale = getActorScaleAtPosition(y);
+ Fixed16 scale = getActorScaleAtPosition(y);
return loadActorAnim(actorIndex, animName, x, y, scale);
}
-uint16 StarTrekEngine::getActorScaleAtPosition(int16 y) {
- int16 var06 = _room->getVar06();
- int16 var08 = _room->getVar08();
- int16 var0a = _room->getVar0a();
+Fixed16 StarTrekEngine::getActorScaleAtPosition(int16 y) {
+ int16 maxY = _room->getMaxY();
+ int16 minY = _room->getMinY();
+ Fixed16 minScale = _room->getMinScale();
- if (var06 < y)
- y = var06;
- if (var08 > y)
- y = var08;
+ if (y > maxY)
+ y = maxY;
+ if (y < minY)
+ y = minY;
- return ((_playerActorScale * (y - var08)) >> 8) + var0a;
+ return Fixed16(_playerActorScale * (y - minY)) + minScale;
}
SharedPtr<Room> StarTrekEngine::getRoom() {
diff --git a/engines/startrek/common.h b/engines/startrek/common.h
index d76ef66..290772f 100644
--- a/engines/startrek/common.h
+++ b/engines/startrek/common.h
@@ -23,6 +23,7 @@
#define STARTREK_COMMON_H
#include "common/scummsys.h"
+#include "common/textconsole.h"
namespace Common {
struct Rect;
@@ -41,12 +42,6 @@ Common::Rect getRectEncompassing(Common::Rect r1, Common::Rect r2);
void serializeRect(Common::Rect rect, Common::Serializer &ser);
-// Fixed-point (16.16) number
-typedef int32 Fixed32;
-
-// Fixed-point (8.8) number
-typedef int16 Fixed16;
-
}
#endif
diff --git a/engines/startrek/fixedint.h b/engines/startrek/fixedint.h
new file mode 100644
index 0000000..a91e6b3
--- /dev/null
+++ b/engines/startrek/fixedint.h
@@ -0,0 +1,152 @@
+/* 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.
+ *
+ */
+
+#ifndef STARTREK_FIXEDINT_H
+#define STARTREK_FIXEDINT_H
+
+#include "common/serializer.h"
+
+#include "startrek/common.h"
+
+namespace StarTrek {
+
+/**
+ * Signed fixed-point number.
+ */
+template<typename T, uint totalBits, uint decimalBits>
+class TFixedInt : Common::Serializable {
+ const static int max = (1 << (totalBits - decimalBits - 1)) - 1;
+ const static int min = -max - 1;
+
+ T val;
+
+public:
+ static TFixedInt fromRaw(T raw) {
+ TFixedInt ret;
+ ret.val = raw;
+ return ret;
+ }
+
+ TFixedInt() : val(0) {}
+ TFixedInt(double d) {
+ assert(d >= min && d <= max); // FIXME: downgrade this to a warning?
+ val = (T)(d * (1 << decimalBits));
+ }
+
+ /**
+ * Constructor from other fixed-point formats.
+ */
+ template<typename T2, uint otherTB, uint otherDB>
+ TFixedInt<T, totalBits, decimalBits>(const TFixedInt<T2, otherTB, otherDB> &fi) {
+ int diff = otherDB - decimalBits;
+ if (otherDB >= decimalBits)
+ val = fi.raw() >> diff;
+ else
+ val = fi.raw() << (-diff);
+ }
+
+ T raw() const {
+ return val;
+ }
+
+ int16 toInt() const {
+ return val >> decimalBits;
+ }
+
+ double toDouble() const {
+ return ((double)val) / (1 << decimalBits);
+ }
+
+ /**
+ * Multiplication with an int, with the result being an int.
+ */
+ int32 multToInt(int32 i) {
+ return ((val * i) << (totalBits - decimalBits)) >> totalBits;
+ }
+
+ /**
+ * Multiplication with an int, with the result being the same type.
+ */
+ TFixedInt operator*(int32 i) const {
+ return fromRaw(val * i);
+ }
+ /**
+ * Division with an int, with the result being the same type.
+ */
+ TFixedInt operator/(int32 i) const {
+ return fromRaw(val / i);
+ }
+ TFixedInt operator+(const TFixedInt &f) const {
+ return fromRaw(val + f.val);
+ }
+ TFixedInt operator-(const TFixedInt &f) const {
+ return fromRaw(val - f.val);
+ }
+
+ void operator+=(const TFixedInt &f) {
+ val += f.val;
+ }
+ void operator-=(const TFixedInt &f) {
+ val -= f.val;
+ }
+
+ bool operator==(double d) const {
+ return toDouble() == d;
+ }
+ bool operator!=(double d) const {
+ return toDouble() != d;
+ }
+ bool operator<(double d) const {
+ return toDouble() < d;
+ }
+ bool operator<=(double d) const {
+ return toDouble() <= d;
+ }
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ if (totalBits == 16)
+ ser.syncAsSint16LE(val);
+ else if (totalBits == 32)
+ ser.syncAsSint32LE(val);
+ else
+ error("Unsupported bit size for TFixedInt");
+ }
+};
+
+template<typename T, uint totalBits, uint decimalBits>
+int32 operator*(const int16 lhs, const TFixedInt<T, totalBits, decimalBits> &rhs) {
+ return rhs * lhs;
+}
+
+
+// Fixed-point (2.14) number (between -1 and 1)
+typedef TFixedInt<int16, 16, 14> Fixed14;
+
+// Fixed-point (8.8) number
+typedef TFixedInt<int16, 16, 8> Fixed16;
+
+// Fixed-point (16.16) number
+typedef TFixedInt<int32, 32, 16> Fixed32;
+
+}
+
+#endif
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index 3a2dc33..e10a0f6 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -24,6 +24,7 @@
#define STARTREK_OBJECT_H
#include "startrek/common.h"
+#include "startrek/fixedint.h"
#include "startrek/items.h"
#include "startrek/sprite.h"
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 4ec703f..a9f8311 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -210,7 +210,7 @@ void Room::loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y,
if (actorIndex >= 0 && actorIndex < SCALED_ACTORS_END)
_vm->loadActorAnimWithRoomScaling(actorIndex, anim, x, y);
else
- _vm->loadActorAnim(actorIndex, anim, x, y, 256);
+ _vm->loadActorAnim(actorIndex, anim, x, y, 1.0);
if (finishedAnimActionParam != 0) {
actor->triggerActionWhenAnimFinished = true;
@@ -231,7 +231,7 @@ void Room::loadActorAnimC(int actorIndex, Common::String anim, int16 x, int16 y,
if (actorIndex >= 0 && actorIndex < SCALED_ACTORS_END)
_vm->loadActorAnimWithRoomScaling(actorIndex, anim, x, y);
else
- _vm->loadActorAnim(actorIndex, anim, x, y, 256);
+ _vm->loadActorAnim(actorIndex, anim, x, y, 1.0);
if (funcPtr != nullptr) {
actor->triggerActionWhenAnimFinished = true;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 1442e90..434ff76 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -27,6 +27,7 @@
#include "common/ptr.h"
#include "common/str.h"
+#include "startrek/fixedint.h"
#include "startrek/startrek.h"
#include "startrek/text.h"
@@ -60,11 +61,13 @@ public:
// Helper stuff for RDF access
uint16 readRdfWord(int offset);
- // Scale-related stuff (rename these later)
- uint16 getVar06() { return readRdfWord(0x06); }
- uint16 getVar08() { return readRdfWord(0x08); }
- uint16 getVar0a() { return readRdfWord(0x0a); }
- uint16 getVar0c() { return readRdfWord(0x0c); }
+ // Scale-related stuff; at the "min Y" position or below, the crewmembers have
+ // "minimum" scale; that value rises to the "max scale" value by the time they reach
+ // the "max Y" value.
+ uint16 getMaxY() { return readRdfWord(0x06); }
+ uint16 getMinY() { return readRdfWord(0x08); }
+ Fixed16 getMinScale() { return Fixed16::fromRaw(readRdfWord(0x0a)); }
+ Fixed16 getMaxScale() { return Fixed16::fromRaw(readRdfWord(0x0c)); }
// words 0x0e and 0x10 in RDF file are pointers to start and end of event code.
// That code is instead rewritten on a per-room basis.
diff --git a/engines/startrek/saveload.cpp b/engines/startrek/saveload.cpp
index 443d4a5..3d1a1aa 100644
--- a/engines/startrek/saveload.cpp
+++ b/engines/startrek/saveload.cpp
@@ -256,7 +256,7 @@ bool StarTrekEngine::saveOrLoadGameData(Common::SeekableReadStream *in, Common::
a->sprite.saveLoadWithSerializer(ser);
ser.syncBytes((byte *)a->bitmapFilename, 10);
- ser.syncAsUint16LE(a->scale);
+ a->scale.saveLoadWithSerializer(ser);
// Can't save "animFile" (will be reloaded)
ser.syncAsUint16LE(a->numAnimFrames);
ser.syncAsUint16LE(a->animFrame);
@@ -274,10 +274,10 @@ bool StarTrekEngine::saveOrLoadGameData(Common::SeekableReadStream *in, Common::
ser.syncAsUint16LE(a->field76);
ser.syncAsSint16LE(a->iwSrcPosition);
ser.syncAsSint16LE(a->iwDestPosition);
- ser.syncAsSint32LE(a->granularPosX);
- ser.syncAsSint32LE(a->granularPosY);
- ser.syncAsSint32LE(a->speedX);
- ser.syncAsSint32LE(a->speedY);
+ a->granularPosX.saveLoadWithSerializer(ser);
+ a->granularPosY.saveLoadWithSerializer(ser);
+ a->speedX.saveLoadWithSerializer(ser);
+ a->speedY.saveLoadWithSerializer(ser);
ser.syncAsSint16LE(a->dest.x);
ser.syncAsSint16LE(a->dest.y);
ser.syncAsUint16LE(a->field90);
diff --git a/engines/startrek/space.cpp b/engines/startrek/space.cpp
index 1171952..a4d0969 100644
--- a/engines/startrek/space.cpp
+++ b/engines/startrek/space.cpp
@@ -26,8 +26,8 @@
namespace StarTrek {
void StarTrekEngine::initStarfieldPosition() {
- memset(&_starfieldPosition, 0, sizeof(_starfieldPosition));
- // TODO: matrix initialization
+ _starfieldPosition = Point3(0, 0, 0);
+ _someMatrix = initMatrix();
}
void StarTrekEngine::initStarfield(int16 x, int16 y, int16 width, int16 height, int16 arg8) {
@@ -45,13 +45,35 @@ void StarTrekEngine::initStarfield(int16 x, int16 y, int16 width, int16 height,
_starfieldPointDivisor = 150;
}
+void StarTrekEngine::addR3(R3 *r3) {
+ for (int i = 0; i < NUM_SPACE_OBJECTS; i++) {
+ if (_r3List[i] == nullptr) {
+ _r3List[i] = r3;
+ return;
+ }
+ }
+
+ error("addR3: out of shapes.");
+}
+
+void StarTrekEngine::delR3(R3 *r3) {
+ for (int i = 0; i < NUM_SPACE_OBJECTS; i++) {
+ if (_r3List[i] == r3) {
+ _r3List[i] = nullptr;
+ r3->field1e = 0;
+ return;
+ }
+ }
+
+ error("delR3: shape not found.");
+}
+
void StarTrekEngine::clearStarfieldPixels() {
_gfx->fillBackgroundRect(_starfieldRect, 0);
}
void StarTrekEngine::drawStarfield() {
// TODO: make these class variables
- Point3W starPositionWeightings[] = {{0x4000, 0, 0}, {0, 0x4000, 0}, {0, 0, 0x4000}};
float flt_50898 = 50.0; // ?
int16 var28 = ((_starfieldXVar2 * 3) >> 1);
@@ -72,12 +94,12 @@ void StarTrekEngine::drawStarfield() {
int16 var4 = getRandomWord() / var28 - xvar;
int16 var6 = getRandomWord() / var2a - yvar;
Point3 point = constructPoint3ForStarfield(var4, var6, var8);
- star->pos = applyPointWeightings(starPositionWeightings, point) + _starfieldPosition;
+ star->pos = matrixMult(_starPositionMatrix, point) + _starfieldPosition;
star->active = true;
}
Point3 p = star->pos - _starfieldPosition;
- Point3 point2 = applyPointWeightings2(p, starPositionWeightings);
+ Point3 point2 = matrixMult(p, _starPositionMatrix);
if (point2.z > flt_50898 && point2.z < 0x3fff
&& abs(point2.x) < point2.z && abs(point2.y) < point2.z) {
@@ -111,7 +133,7 @@ void StarTrekEngine::drawStarfield() {
void StarTrekEngine::updateStarfieldAndShips(bool arg0) {
_starfieldSprite.bitmapChanged = true;
- // sub_24b74(...);
+ _starPositionMatrix = _someMatrix.invert();
clearStarfieldPixels();
drawStarfield();
@@ -127,28 +149,32 @@ Point3 StarTrekEngine::constructPoint3ForStarfield(int16 x, int16 y, int16 z) {
return point;
}
-Point3 StarTrekEngine::applyPointWeightings(Point3W *weight, const Point3 &point) {
+Point3 StarTrekEngine::matrixMult(const Matrix &weight, const Point3 &point) {
int32 ret[3];
for (int i = 0; i < 3; i++) {
- ret[i] = weight[i].x * (point.x & 0xffff) + weight[i].y * (point.y & 0xffff) + weight[i].z * (point.z & 0xffff);
- ret[i] <<= 2;
+ ret[i] = weight[i][0].multToInt(point.x & 0xffff) + weight[i][1].multToInt(point.y & 0xffff) + weight[i][2].multToInt(point.z & 0xffff);
}
Point3 p;
- p.x = ret[0] >> 16;
- p.y = ret[1] >> 16;
- p.z = ret[2] >> 16;
+ p.x = ret[0];
+ p.y = ret[1];
+ p.z = ret[2];
return p;
}
-Point3 StarTrekEngine::applyPointWeightings2(const Point3 &point, Point3W *weight) {
+Point3 StarTrekEngine::matrixMult(const Point3 &point, const Matrix &weight) {
Point3 p = Point3();
- p.x = (weight[0].x * (point.x & 0xffff) + weight[1].x * (point.y & 0xffff) + weight[2].x * (point.z & 0xffff)) << 2;
- p.y = (weight[0].y * (point.x & 0xffff) + weight[1].y * (point.y & 0xffff) + weight[2].y * (point.z & 0xffff)) << 2;
- p.z = (weight[0].z * (point.x & 0xffff) + weight[1].z * (point.y & 0xffff) + weight[2].z * (point.z & 0xffff)) << 2;
- p.x >>= 16;
- p.y >>= 16;
- p.z >>= 16;
+ p.x = (weight[0][0].multToInt(point.x & 0xffff) + weight[1][0].multToInt(point.y & 0xffff) + weight[2][0].multToInt(point.z & 0xffff));
+ p.y = (weight[0][1].multToInt(point.x & 0xffff) + weight[1][1].multToInt(point.y & 0xffff) + weight[2][1].multToInt(point.z & 0xffff));
+ p.z = (weight[0][2].multToInt(point.x & 0xffff) + weight[1][2].multToInt(point.y & 0xffff) + weight[2][2].multToInt(point.z & 0xffff));
return p;
}
+Matrix StarTrekEngine::initMatrix() {
+ Matrix mat;
+ mat[0][0] = 1;
+ mat[1][1] = 1;
+ mat[2][2] = 1;
+ return mat;
+}
+
}
diff --git a/engines/startrek/space.h b/engines/startrek/space.h
index f5d08e5..a9c6bde 100644
--- a/engines/startrek/space.h
+++ b/engines/startrek/space.h
@@ -1,32 +1,113 @@
-// Pseudo-3D structs
+/* 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.
-struct Point3 {
- int32 x;
- int32 y;
- int32 z;
+ * 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.
- Point3 operator+(const Point3 &p) const {
- Point3 p2;
+ * 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.
+ *
+ */
+
+#ifndef STARTREK_SPACE_H
+#define STARTREK_SPACE_H
+
+#include "fixedint.h"
+
+namespace StarTrek {
+
+class FileStream;
+
+template<typename T>
+struct TPoint {
+ T x;
+ T y;
+ T z;
+
+ TPoint() : x(0), y(0), z(0) {}
+ TPoint(T _x, T _y, T _z) : x(_x), y(_y), z(_z) {}
+
+ TPoint<T> operator+(const TPoint<T> &p) const {
+ TPoint<T> p2;
p2.x = x + p.x;
p2.y = y + p.y;
p2.z = z + p.z;
return p2;
}
- Point3 operator-(const Point3 &p) const {
- Point3 p2;
+ TPoint<T> operator-(const TPoint<T> &p) const {
+ TPoint<T> p2;
p2.x = x - p.x;
p2.y = y - p.y;
p2.z = z - p.z;
return p2;
}
+ T &operator[](int i) {
+ if (i == 0)
+ return x;
+ else if (i == 1)
+ return y;
+ else if (i == 2)
+ return z;
+ assert(false);
+ }
+ T operator[](int i) const {
+ if (i == 0)
+ return x;
+ else if (i == 1)
+ return y;
+ else if (i == 2)
+ return z;
+ assert(false);
+ }
};
-struct Point3W {
- int16 x;
- int16 y;
- int16 z;
+typedef TPoint<int32> Point3;
+typedef TPoint<Fixed14> Point3W;
+
+
+template<typename T>
+struct TMatrix {
+private:
+ T m[3];
+
+public:
+ TMatrix() {}
+ TMatrix(const TMatrix<T> &mat) {
+ m[0] = mat.m[0];
+ m[1] = mat.m[1];
+ m[2] = mat.m[2];
+ }
+ T &operator[](int i) {
+ return m[i];
+ };
+ T operator[](int i) const {
+ return m[i];
+ };
+
+ TMatrix<T> invert() {
+ TMatrix<T> ret;
+ for (int i = 0; i < 3; i++) {
+ for (int j = 0; j < 3; j++) {
+ ret[i][j] = m[j][i];
+ }
+ }
+ return ret;
+ }
};
+typedef TMatrix<Point3W> Matrix;
+
struct Star {
bool active;
Point3 pos;
@@ -37,6 +118,10 @@ struct Star {
struct R3 {
Point3 pos; // 0x0
int16 field1e; // 0x1e
+ int16 field20; // 0x20
+ int16 field22; // 0x22
+ int16 field24; // 0x24
+ SharedPtr<FileStream> shpFile; // 0x68
};
// Maximum number of stars visible at once in the starfields
@@ -44,3 +129,7 @@ struct R3 {
// Maximum number of R3 objects in space at once
#define NUM_SPACE_OBJECTS 0x30
+
+}
+
+#endif
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index ab1e3c7..9adba5f 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -217,6 +217,10 @@ void StarTrekEngine::playIntro() {
_starfieldSprite.bitmap = fakeStarfieldBitmap;
initStarfieldSprite(&_starfieldSprite, fakeStarfieldBitmap, _starfieldRect);
+ //delR3(&_enterpriseR3); // TODO: uncomment
+
+ R3 planetR3 = R3();
+
// TODO: remainder of starfield initialization
_gfx->clearScreenAndPriBuffer();
@@ -312,8 +316,26 @@ void StarTrekEngine::playIntro() {
loadSubtitleSprite(1, &subtitleSprite);
break;
- case 42:
+ case 42: // Enterprise moves toward camera
loadSubtitleSprite(-1, &subtitleSprite);
+ addR3(&_enterpriseR3);
+ _enterpriseR3.field1e = 2;
+ initIntroR3ObjectToMove(&_enterpriseR3, 330, 5000, 0, 0, 18);
+ break;
+
+ case 60: // Enterprise moves away from camera
+ initIntroR3ObjectToMove(&_enterpriseR3, 0, 0, 30, 5000, 6);
+ break;
+
+ case 66: // Cut to scene with planet
+ loadSubtitleSprite(2, &subtitleSprite);
+ planetR3.field22 = 2000;
+ planetR3.field24 = 10000 / _starfieldPointDivisor;
+ planetR3.shpFile = loadFile("planet.shp");
+ initIntroR3ObjectToMove(&planetR3, 6, 10000, 6, 10000, 0);
+ addR3(&planetR3);
+ initIntroR3ObjectToMove(&_enterpriseR3, -15, 250, 15, 500, 18);
+ starfieldZoomSpeed = 0;
break;
case 378:
@@ -344,6 +366,11 @@ void StarTrekEngine::playIntro() {
// TODO: the rest
}
+void StarTrekEngine::initIntroR3ObjectToMove(R3 *r3, int16 srcAngle, int16 srcDepth, int16 destAngle, int16 destDepth, int16 ticks) {
+ srcAngle = (srcAngle << 9) / 180;
+ destAngle = (destAngle << 9) / 180;
+}
+
void StarTrekEngine::loadSubtitleSprite(int index, Sprite *sprite) {
if (_showSubtitles) {
if (index == -1)
@@ -379,25 +406,25 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
Common::String filename = getCrewmanAnimFilename(i, name);
int x = crewmanTransportPositions[i][0];
int y = crewmanTransportPositions[i][1];
- loadActorAnim(i, filename, x, y, 256);
+ loadActorAnim(i, filename, x, y, 1.0);
_actorList[i].animationString[0] = '\0';
}
if (_missionToLoad.equalsIgnoreCase("feather") && name[4] == 'b') {
- loadActorAnim(9, "qteleb", 0x61, 0x79, 0x100);
+ loadActorAnim(9, "qteleb", 0x61, 0x79, 1.0);
}
else if (_missionToLoad.equalsIgnoreCase("trial")) {
if (name[4] == 'd') {
- loadActorAnim(9, "qteled", 0x61, 0x79, 0x100);
+ loadActorAnim(9, "qteled", 0x61, 0x79, 1.0);
}
/* TODO
else if (word_51156 >= 3) {
- loadActorAnim(9, "qteleb", 0x61, 0x79, 0x100);
+ loadActorAnim(9, "qteleb", 0x61, 0x79, 1.0);
}
*/
}
- loadActorAnim(8, "transc", 0, 0, 0x100);
+ loadActorAnim(8, "transc", 0, 0, 1.0);
// TODO: redraw mouse and sprite_52c4e?
@@ -570,7 +597,7 @@ bool StarTrekEngine::actorWalkToPosition(int actorIndex, const Common::String &a
if (directPathExists(srcX, srcY, destX, destY)) {
chooseActorDirectionForWalking(actor, srcX, srcY, destX, destY);
- updateActorPositionWhileWalking(actor, (actor->granularPosX + 0x8000) >> 16, (actor->granularPosY + 0x8000) >> 16);
+ updateActorPositionWhileWalking(actor, (actor->granularPosX + 0.5).toInt(), (actor->granularPosY + 0.5).toInt());
return true;
}
else {
@@ -590,7 +617,7 @@ bool StarTrekEngine::actorWalkToPosition(int actorIndex, const Common::String &a
else {
Common::Point iwSrc = _iwFile->_keyPositions[actor->iwSrcPosition];
chooseActorDirectionForWalking(actor, srcX, srcY, iwSrc.x, iwSrc.y);
- updateActorPositionWhileWalking(actor, (actor->granularPosX + 0x8000) >> 16, (actor->granularPosY + 0x8000) >> 16);
+ updateActorPositionWhileWalking(actor, (actor->granularPosX + 0.5).toInt(), (actor->granularPosY + 0.5).toInt());
return true;
}
}
@@ -660,7 +687,7 @@ void StarTrekEngine::updateActorAnimations() {
if (actor->field90 != 0) {
Sprite *sprite = &actor->sprite;
int loops;
- if (getActorScaleAtPosition((actor->granularPosY + 0x8000) >> 16) < 0xa0)
+ if (getActorScaleAtPosition((actor->granularPosY + 0.5).toInt()) < 0.625)
loops = 1;
else
loops = 2;
@@ -668,11 +695,11 @@ void StarTrekEngine::updateActorAnimations() {
if (actor->field90 == 0)
break;
actor->field90--;
- uint32 newX = actor->granularPosX + actor->speedX;
- uint32 newY = actor->granularPosY + actor->speedY;
+ Fixed32 newX = actor->granularPosX + actor->speedX;
+ Fixed32 newY = actor->granularPosY + actor->speedY;
if ((actor->field90 & 3) == 0) {
sprite->bitmap.reset();
- updateActorPositionWhileWalking(actor, (newX + 0x8000) >> 16, (newY + 0x8000) >> 16);
+ updateActorPositionWhileWalking(actor, (newX + 0.5).toInt(), (newY + 0.5).toInt());
actor->field92++;
}
@@ -689,7 +716,7 @@ void StarTrekEngine::updateActorAnimations() {
}
actor->sprite.bitmap.reset();
- updateActorPositionWhileWalking(actor, (actor->granularPosX + 0x8000) >> 16, (actor->granularPosY + 0x8000) >> 16);
+ updateActorPositionWhileWalking(actor, (actor->granularPosX + 0.5).toInt(), (actor->granularPosY + 0.5).toInt());
initStandAnim(i);
}
else { // actor->iwSrcPosition != -1
@@ -834,7 +861,7 @@ void StarTrekEngine::initStandAnim(int actorIndex) {
else // Default to facing south
animName = Common::String(actor->animationString) + 's';
- uint16 scale = getActorScaleAtPosition(actor->pos.y);
+ Fixed16 scale = getActorScaleAtPosition(actor->pos.y);
loadActorAnim(actorIndex, animName, actor->pos.x, actor->pos.y, scale);
actor->animType = 0;
}
@@ -863,8 +890,8 @@ void StarTrekEngine::updateActorPositionWhileWalking(Actor *actor, int16 x, int1
* a destination position it's walking to.
*/
void StarTrekEngine::chooseActorDirectionForWalking(Actor *actor, int16 srcX, int16 srcY, int16 destX, int16 destY) {
- actor->granularPosX = srcX << 16;
- actor->granularPosY = srcY << 16;
+ actor->granularPosX = srcX;
+ actor->granularPosY = srcY;
int16 distX = destX - srcX;
int16 distY = destY - srcY;
@@ -887,11 +914,11 @@ void StarTrekEngine::chooseActorDirectionForWalking(Actor *actor, int16 srcX, in
if (distX != 0) {
if (distX > 0)
- actor->speedX = 1 << 16;
+ actor->speedX = 1.0;
else
- actor->speedX = -1 << 16; // 0xffff0000
+ actor->speedX = -1.0;
- actor->speedY = (distY << 16) / absDistX;
+ actor->speedY = Fixed32(distY) / absDistX;
}
}
else {
@@ -910,11 +937,11 @@ void StarTrekEngine::chooseActorDirectionForWalking(Actor *actor, int16 srcX, in
if (distY != 0) {
if (distY > 0)
- actor->speedY = 1 << 16;
+ actor->speedY = 1.0;
else
- actor->speedY = -1 << 16; // 0xffff0000
+ actor->speedY = -1.0;
- actor->speedX = (distX << 16) / absDistY;
+ actor->speedX = Fixed32(distX) / absDistY;
}
}
}
@@ -939,12 +966,12 @@ bool StarTrekEngine::directPathExists(int16 srcX, int16 srcY, int16 destX, int16
if (distCounter == 0)
return true;
- speedY = (distY << 16) / absDistX;
+ speedY = Fixed32(distY) / absDistX;
if (distX > 0)
- speedX = 1 << 16;
+ speedX = 1.0;
else
- speedX = -1 << 16;
+ speedX = -1.0;
}
else { // absDistX <= absDistY
distCounter = absDistY;
@@ -952,25 +979,25 @@ bool StarTrekEngine::directPathExists(int16 srcX, int16 srcY, int16 destX, int16
if (distCounter == 0)
return true;
- speedX = (distX << 16) / absDistY;
+ speedX = Fixed32(distX) / absDistY;
if (distY > 0)
- speedY = 1 << 16;
+ speedY = 1.0;
else
- speedY = -1 << 16;
+ speedY = -1.0;
}
- Fixed32 fixedX = srcX << 16;
- Fixed32 fixedY = srcY << 16;
+ Fixed32 fixedX = srcX;
+ Fixed32 fixedY = srcY;
- if (isPositionSolid((fixedX + 0x8000) >> 16, (fixedY + 0x8000) >> 16))
+ if (isPositionSolid((fixedX + 0.5).toInt(), (fixedY + 0.5).toInt()))
return false;
while (distCounter-- > 0) {
fixedX += speedX;
fixedY += speedY;
- if (isPositionSolid((fixedX + 0x8000) >> 16, (fixedY + 0x8000) >> 16))
+ if (isPositionSolid((fixedX + 0.5).toInt(), (fixedY + 0.5).toInt()))
return false;
}
@@ -1119,7 +1146,7 @@ SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filen
bitmapToReturn = _gfx->loadBitmap(filename);
}
- if (scale != 256) {
+ if (scale != 1.0) {
bitmapToReturn = scaleBitmap(bitmapToReturn, scale);
}
@@ -1454,7 +1481,7 @@ void StarTrekEngine::updateCrewmanGetupTimers() {
}
else {
const char *dirs = "nsew";
- uint16 scale = getActorScaleAtPosition(actor->sprite.pos.y);
+ Fixed16 scale = getActorScaleAtPosition(actor->sprite.pos.y);
d = dirs[dir];
int16 xOffset = 0, yOffset = 0;
@@ -1466,8 +1493,8 @@ void StarTrekEngine::updateCrewmanGetupTimers() {
xOffset = -35;
yOffset = -12;
}
- actor->sprite.pos.x += (scale * xOffset) >> 8;
- actor->sprite.pos.y += (scale * yOffset) >> 8;
+ actor->sprite.pos.x += scale.multToInt(xOffset);
+ actor->sprite.pos.y += scale.multToInt(yOffset);
}
anim += (char)d;
@@ -1652,12 +1679,9 @@ void StarTrekEngine::initStarfieldSprite(Sprite *sprite, SharedPtr<Bitmap> bitma
sprite->drawMode = 1;
}
-/**
- * A scale of 256 is the baseline.
- */
SharedPtr<Bitmap> StarTrekEngine::scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed16 scale) {
- int scaledWidth = (bitmap->width * scale) >> 8;
- int scaledHeight = (bitmap->height * scale) >> 8;
+ int scaledWidth = scale.multToInt(bitmap->width);
+ int scaledHeight = scale.multToInt(bitmap->height);
int origWidth = bitmap->width;
int origHeight = bitmap->height;
@@ -1667,8 +1691,8 @@ SharedPtr<Bitmap> StarTrekEngine::scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed16
scaledHeight = 1;
SharedPtr<Bitmap> scaledBitmap(new Bitmap(scaledWidth, scaledHeight));
- scaledBitmap->xoffset = (bitmap->xoffset * scale) >> 8;
- scaledBitmap->yoffset = (bitmap->yoffset * scale) >> 8;
+ scaledBitmap->xoffset = scale.multToInt(bitmap->xoffset);
+ scaledBitmap->yoffset = scale.multToInt(bitmap->yoffset);
// sub_344a5(scaledWidth, origWidth);
@@ -1678,7 +1702,7 @@ SharedPtr<Bitmap> StarTrekEngine::scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed16
byte *src = bitmap->pixels;
byte *dest = scaledBitmap->pixels;
- if (scale <= 256) {
+ if (scale <= 1.0) {
int16 var2e = 0;
uint16 var30 = scaledHeight << 1;
uint16 var32 = (scaledHeight - origHeight) << 1;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 3f5636f..1ec54f1 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -222,7 +222,7 @@ public:
void handleAwayMissionEvents();
void unloadRoom();
int loadActorAnimWithRoomScaling(int actorIndex, const Common::String &animName, int16 x, int16 y);
- uint16 getActorScaleAtPosition(int16 y);
+ Fixed16 getActorScaleAtPosition(int16 y);
void addAction(const Action &action);
void addAction(byte type, byte b1, byte b2, byte b3);
bool checkItemInteractionExists(int action, int activeItem, int passiveItem, int16 arg6);
@@ -240,18 +240,30 @@ public:
private:
// Intro
void playIntro();
+ /**
+ * Initializes an object to spawn at one position and move toward another position.
+ * @param ticks The number of ticks it should take for the object to reach the destination
+ */
+ void initIntroR3ObjectToMove(R3 *r3, int16 srcAngle, int16 srcDepth, int16 destAngle, int16 destDepth, int16 ticks);
void loadSubtitleSprite(int index, Sprite *sprite);
// Space, pseudo-3D (space.cpp)
void initStarfieldPosition();
void initStarfield(int16 x, int16 y, int16 width, int16 height, int16 arg8);
+ void addR3(R3 *r3);
+ void delR3(R3 *r3);
void clearStarfieldPixels();
void drawStarfield();
void updateStarfieldAndShips(bool arg0);
Point3 constructPoint3ForStarfield(int16 x, int16 y, int16 z);
- Point3 applyPointWeightings(Point3W *weight, const Point3 &point);
- Point3 applyPointWeightings2(const Point3 &point, Point3W *weight);
+ Point3 matrixMult(const Matrix &weight, const Point3 &point);
+ Point3 matrixMult(const Point3 &point, const Matrix &weight);
+
+ /**
+ * Creates something like an "identity" matrix? (Value 0x4000 along the diagonal)
+ */
+ Matrix initMatrix();
// Transporter room
void runTransportSequence(const Common::String &name);
@@ -447,7 +459,7 @@ public:
Common::String _screenName; // _screenName = _missionName + _roomIndex
Common::String _mapFilename; // Similar to _screenName, but used for .map files?
SharedPtr<FileStream> _mapFile;
- int32 _playerActorScale;
+ Fixed32 _playerActorScale;
Common::String _txtFilename;
Common::String _loadedText; // TODO: might be OK to delete this
@@ -519,6 +531,10 @@ public:
int16 _starfieldXVar1, _starfieldYVar1;
int16 _starfieldXVar2, _starfieldYVar2;
Common::Rect _starfieldRect;
+ R3 _enterpriseR3;
+ R3 *_r3List[NUM_SPACE_OBJECTS];
+ Matrix _starPositionMatrix;
+ Matrix _someMatrix;
Graphics *_gfx;
Sound *_sound;
Commit: 710b9db0fd2e724dde746aa9b2319933fe21cbe0
https://github.com/scummvm/scummvm/commit/710b9db0fd2e724dde746aa9b2319933fe21cbe0
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Rename fixed-point types
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/fixedint.h
engines/startrek/object.h
engines/startrek/room.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 94ee869..911c760 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -105,9 +105,9 @@ void StarTrekEngine::loadRoom(const Common::String &missionName, int roomIndex)
actorFunc1();
initActors();
- Fixed16 num = _room->getMaxScale() - _room->getMinScale();
+ Fixed8 num = _room->getMaxScale() - _room->getMinScale();
int16 den = _room->getMaxY() - _room->getMinY() + 1;
- _playerActorScale = Fixed32(num) / den;
+ _playerActorScale = Fixed16(num) / den;
// TODO: RDF vars 1e/1f and 20/21; relates to BAN files?
@@ -446,21 +446,21 @@ void StarTrekEngine::unloadRoom() {
* further up (away) the object is, the smaller it is.
*/
int StarTrekEngine::loadActorAnimWithRoomScaling(int actorIndex, const Common::String &animName, int16 x, int16 y) {
- Fixed16 scale = getActorScaleAtPosition(y);
+ Fixed8 scale = getActorScaleAtPosition(y);
return loadActorAnim(actorIndex, animName, x, y, scale);
}
-Fixed16 StarTrekEngine::getActorScaleAtPosition(int16 y) {
+Fixed8 StarTrekEngine::getActorScaleAtPosition(int16 y) {
int16 maxY = _room->getMaxY();
int16 minY = _room->getMinY();
- Fixed16 minScale = _room->getMinScale();
+ Fixed8 minScale = _room->getMinScale();
if (y > maxY)
y = maxY;
if (y < minY)
y = minY;
- return Fixed16(_playerActorScale * (y - minY)) + minScale;
+ return Fixed8(_playerActorScale * (y - minY)) + minScale;
}
SharedPtr<Room> StarTrekEngine::getRoom() {
diff --git a/engines/startrek/fixedint.h b/engines/startrek/fixedint.h
index a91e6b3..88e9c31 100644
--- a/engines/startrek/fixedint.h
+++ b/engines/startrek/fixedint.h
@@ -142,10 +142,10 @@ int32 operator*(const int16 lhs, const TFixedInt<T, totalBits, decimalBits> &rhs
typedef TFixedInt<int16, 16, 14> Fixed14;
// Fixed-point (8.8) number
-typedef TFixedInt<int16, 16, 8> Fixed16;
+typedef TFixedInt<int16, 16, 8> Fixed8;
// Fixed-point (16.16) number
-typedef TFixedInt<int32, 32, 16> Fixed32;
+typedef TFixedInt<int32, 32, 16> Fixed16;
}
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index e10a0f6..4d3b270 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -81,7 +81,7 @@ struct Actor {
uint16 animType;
Sprite sprite;
char bitmapFilename[10];
- Fixed16 scale;
+ Fixed8 scale;
SharedPtr<FileStream> animFile;
uint16 numAnimFrames;
uint16 animFrame;
@@ -106,12 +106,12 @@ struct Actor {
int16 iwDestPosition;
// Fixed-point position values (16.16) used while walking.
- Fixed32 granularPosX;
- Fixed32 granularPosY;
+ Fixed16 granularPosX;
+ Fixed16 granularPosY;
// Fixed-point speed values (16.16).
- Fixed32 speedX;
- Fixed32 speedY;
+ Fixed16 speedX;
+ Fixed16 speedY;
Common::Point dest; // Position object is walking toward
uint16 field90;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 434ff76..937d0ff 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -66,8 +66,8 @@ public:
// the "max Y" value.
uint16 getMaxY() { return readRdfWord(0x06); }
uint16 getMinY() { return readRdfWord(0x08); }
- Fixed16 getMinScale() { return Fixed16::fromRaw(readRdfWord(0x0a)); }
- Fixed16 getMaxScale() { return Fixed16::fromRaw(readRdfWord(0x0c)); }
+ Fixed8 getMinScale() { return Fixed8::fromRaw(readRdfWord(0x0a)); }
+ Fixed8 getMaxScale() { return Fixed8::fromRaw(readRdfWord(0x0c)); }
// words 0x0e and 0x10 in RDF file are pointers to start and end of event code.
// That code is instead rewritten on a per-room basis.
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 9adba5f..e836e3b 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -538,7 +538,7 @@ void StarTrekEngine::initActors() {
/**
* Set an actor's animation, position, and scale.
*/
-int StarTrekEngine::loadActorAnim(int actorIndex, const Common::String &animName, int16 x, int16 y, Fixed16 scale) {
+int StarTrekEngine::loadActorAnim(int actorIndex, const Common::String &animName, int16 x, int16 y, Fixed8 scale) {
debugC(6, kDebugGraphics, "Load animation '%s' on actor %d", animName.c_str(), actorIndex);
Actor *actor;
@@ -695,8 +695,8 @@ void StarTrekEngine::updateActorAnimations() {
if (actor->field90 == 0)
break;
actor->field90--;
- Fixed32 newX = actor->granularPosX + actor->speedX;
- Fixed32 newY = actor->granularPosY + actor->speedY;
+ Fixed16 newX = actor->granularPosX + actor->speedX;
+ Fixed16 newY = actor->granularPosY + actor->speedY;
if ((actor->field90 & 3) == 0) {
sprite->bitmap.reset();
updateActorPositionWhileWalking(actor, (newX + 0.5).toInt(), (newY + 0.5).toInt());
@@ -771,7 +771,7 @@ void StarTrekEngine::actorFunc1() {
}
}
-void StarTrekEngine::drawActorToScreen(Actor *actor, const Common::String &_animName, int16 x, int16 y, Fixed16 scale, bool addSprite) {
+void StarTrekEngine::drawActorToScreen(Actor *actor, const Common::String &_animName, int16 x, int16 y, Fixed8 scale, bool addSprite) {
Common::String animFilename = _animName;
if (_animName.hasPrefixIgnoreCase("stnd") /* && word_45d20 == -1 */) // TODO
animFilename += 'j';
@@ -861,7 +861,7 @@ void StarTrekEngine::initStandAnim(int actorIndex) {
else // Default to facing south
animName = Common::String(actor->animationString) + 's';
- Fixed16 scale = getActorScaleAtPosition(actor->pos.y);
+ Fixed8 scale = getActorScaleAtPosition(actor->pos.y);
loadActorAnim(actorIndex, animName, actor->pos.x, actor->pos.y, scale);
actor->animType = 0;
}
@@ -918,7 +918,7 @@ void StarTrekEngine::chooseActorDirectionForWalking(Actor *actor, int16 srcX, in
else
actor->speedX = -1.0;
- actor->speedY = Fixed32(distY) / absDistX;
+ actor->speedY = Fixed16(distY) / absDistX;
}
}
else {
@@ -941,7 +941,7 @@ void StarTrekEngine::chooseActorDirectionForWalking(Actor *actor, int16 srcX, in
else
actor->speedY = -1.0;
- actor->speedX = Fixed32(distX) / absDistY;
+ actor->speedX = Fixed16(distX) / absDistY;
}
}
}
@@ -958,7 +958,7 @@ bool StarTrekEngine::directPathExists(int16 srcX, int16 srcY, int16 destX, int16
int32 absDistY = abs(distY);
int32 distCounter;
- Fixed32 speedX, speedY;
+ Fixed16 speedX, speedY;
if (absDistX > absDistY) {
distCounter = absDistX;
@@ -966,7 +966,7 @@ bool StarTrekEngine::directPathExists(int16 srcX, int16 srcY, int16 destX, int16
if (distCounter == 0)
return true;
- speedY = Fixed32(distY) / absDistX;
+ speedY = Fixed16(distY) / absDistX;
if (distX > 0)
speedX = 1.0;
@@ -979,7 +979,7 @@ bool StarTrekEngine::directPathExists(int16 srcX, int16 srcY, int16 destX, int16
if (distCounter == 0)
return true;
- speedX = Fixed32(distX) / absDistY;
+ speedX = Fixed16(distX) / absDistY;
if (distY > 0)
speedY = 1.0;
@@ -987,8 +987,8 @@ bool StarTrekEngine::directPathExists(int16 srcX, int16 srcY, int16 destX, int16
speedY = -1.0;
}
- Fixed32 fixedX = srcX;
- Fixed32 fixedY = srcY;
+ Fixed16 fixedX = srcX;
+ Fixed16 fixedY = srcY;
if (isPositionSolid((fixedX + 0.5).toInt(), (fixedY + 0.5).toInt()))
return false;
@@ -1057,7 +1057,7 @@ int StarTrekEngine::findObjectAt(int x, int y) {
/**
* Loads a bitmap for the animation frame with the given scale.
*/
-SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filename, Fixed16 scale) {
+SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filename, Fixed8 scale) {
SharedPtr<Bitmap> bitmapToReturn;
char basename[5];
@@ -1481,7 +1481,7 @@ void StarTrekEngine::updateCrewmanGetupTimers() {
}
else {
const char *dirs = "nsew";
- Fixed16 scale = getActorScaleAtPosition(actor->sprite.pos.y);
+ Fixed8 scale = getActorScaleAtPosition(actor->sprite.pos.y);
d = dirs[dir];
int16 xOffset = 0, yOffset = 0;
@@ -1679,7 +1679,7 @@ void StarTrekEngine::initStarfieldSprite(Sprite *sprite, SharedPtr<Bitmap> bitma
sprite->drawMode = 1;
}
-SharedPtr<Bitmap> StarTrekEngine::scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed16 scale) {
+SharedPtr<Bitmap> StarTrekEngine::scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed8 scale) {
int scaledWidth = scale.multToInt(bitmap->width);
int scaledHeight = scale.multToInt(bitmap->height);
int origWidth = bitmap->width;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 1ec54f1..aab4f3a 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -222,7 +222,7 @@ public:
void handleAwayMissionEvents();
void unloadRoom();
int loadActorAnimWithRoomScaling(int actorIndex, const Common::String &animName, int16 x, int16 y);
- Fixed16 getActorScaleAtPosition(int16 y);
+ Fixed8 getActorScaleAtPosition(int16 y);
void addAction(const Action &action);
void addAction(byte type, byte b1, byte b2, byte b3);
bool checkItemInteractionExists(int action, int activeItem, int passiveItem, int16 arg6);
@@ -284,12 +284,12 @@ public:
// Actors
void initActors();
- int loadActorAnim(int actorIndex, const Common::String &animName, int16 x, int16 y, Fixed16 scale);
+ int loadActorAnim(int actorIndex, const Common::String &animName, int16 x, int16 y, Fixed8 scale);
bool actorWalkToPosition(int actorIndex, const Common::String &animFile, int16 srcX, int16 srcY, int16 destX, int16 destY);
void updateActorAnimations();
void removeActorFromScreen(int actorIndex);
void actorFunc1();
- void drawActorToScreen(Actor *actor, const Common::String &animName, int16 x, int16 y, Fixed16 scale, bool addSprite);
+ void drawActorToScreen(Actor *actor, const Common::String &animName, int16 x, int16 y, Fixed8 scale, bool addSprite);
void releaseAnim(Actor *actor);
void initStandAnim(int actorIndex);
void updateActorPositionWhileWalking(Actor *actor, int16 x, int16 y);
@@ -298,7 +298,7 @@ public:
int findObjectAt(int x, int y);
int findObjectAt(Common::Point p) { return findObjectAt(p.x, p.y); }
- SharedPtr<Bitmap> loadAnimationFrame(const Common::String &filename, Fixed16 scale);
+ SharedPtr<Bitmap> loadAnimationFrame(const Common::String &filename, Fixed8 scale);
int selectObjectForUseAction();
Common::String getCrewmanAnimFilename(int actorIndex, const Common::String &basename);
@@ -310,7 +310,7 @@ public:
void hideInventoryIcons();
int showInventoryMenu(int x, int y, bool restoreMouse);
void initStarfieldSprite(Sprite *sprite, SharedPtr<Bitmap> bitmap, const Common::Rect &rect);
- SharedPtr<Bitmap> scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed16 scale);
+ SharedPtr<Bitmap> scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed8 scale);
void scaleBitmapRow(byte *src, byte *dest, uint16 origWidth, uint16 scaledWidth);
// Events
@@ -459,7 +459,7 @@ public:
Common::String _screenName; // _screenName = _missionName + _roomIndex
Common::String _mapFilename; // Similar to _screenName, but used for .map files?
SharedPtr<FileStream> _mapFile;
- Fixed32 _playerActorScale;
+ Fixed16 _playerActorScale;
Common::String _txtFilename;
Common::String _loadedText; // TODO: might be OK to delete this
Commit: 2b09f698ed47942d84e6c7f503901941116db328
https://github.com/scummvm/scummvm/commit/2b09f698ed47942d84e6c7f503901941116db328
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: sine & cosine
Changed paths:
engines/startrek/fixedint.h
engines/startrek/module.mk
engines/startrek/space.cpp
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/fixedint.h b/engines/startrek/fixedint.h
index 88e9c31..cae9efd 100644
--- a/engines/startrek/fixedint.h
+++ b/engines/startrek/fixedint.h
@@ -77,10 +77,11 @@ public:
}
/**
- * Multiplication with an int, with the result being an int.
+ * Multiplication with an int, with the result being an int. Use this if the result
+ * might exceed the capacity of this type.
*/
- int32 multToInt(int32 i) {
- return ((val * i) << (totalBits - decimalBits)) >> totalBits;
+ int16 multToInt(int32 i) {
+ return (val * i) >> decimalBits;
}
/**
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index bef2c8d..85250e0 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -11,6 +11,7 @@ MODULE_OBJS = \
graphics.o \
iwfile.o \
lzss.o \
+ math.o \
menu.o \
object.o \
room.o \
diff --git a/engines/startrek/space.cpp b/engines/startrek/space.cpp
index a4d0969..aeb2615 100644
--- a/engines/startrek/space.cpp
+++ b/engines/startrek/space.cpp
@@ -150,30 +150,32 @@ Point3 StarTrekEngine::constructPoint3ForStarfield(int16 x, int16 y, int16 z) {
}
Point3 StarTrekEngine::matrixMult(const Matrix &weight, const Point3 &point) {
- int32 ret[3];
+ Point3 p;
for (int i = 0; i < 3; i++) {
- ret[i] = weight[i][0].multToInt(point.x & 0xffff) + weight[i][1].multToInt(point.y & 0xffff) + weight[i][2].multToInt(point.z & 0xffff);
+ p[i] = 0;
+ for (int j = 0; j < 3; j++) { // FIXME: what is this weird multiplication?
+ p[i] += (weight[i][j].raw() * (point[j] & 0xffff) << 2) >> 16;
+ }
}
- Point3 p;
- p.x = ret[0];
- p.y = ret[1];
- p.z = ret[2];
return p;
}
Point3 StarTrekEngine::matrixMult(const Point3 &point, const Matrix &weight) {
Point3 p = Point3();
- p.x = (weight[0][0].multToInt(point.x & 0xffff) + weight[1][0].multToInt(point.y & 0xffff) + weight[2][0].multToInt(point.z & 0xffff));
- p.y = (weight[0][1].multToInt(point.x & 0xffff) + weight[1][1].multToInt(point.y & 0xffff) + weight[2][1].multToInt(point.z & 0xffff));
- p.z = (weight[0][2].multToInt(point.x & 0xffff) + weight[1][2].multToInt(point.y & 0xffff) + weight[2][2].multToInt(point.z & 0xffff));
+ for (int i = 0; i < 3; i++) {
+ p[i] = 0;
+ for (int j = 0; j < 3; j++) {
+ p[i] += (weight[j][i].raw() * (point[j] & 0xffff) << 2) >> 16;
+ }
+ }
return p;
}
Matrix StarTrekEngine::initMatrix() {
Matrix mat;
- mat[0][0] = 1;
- mat[1][1] = 1;
- mat[2][2] = 1;
+ mat[0][0] = 1.0;
+ mat[1][1] = 1.0;
+ mat[2][2] = 1.0;
return mat;
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index e836e3b..c8bad8d 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -52,7 +52,8 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_kirkActor(&_actorList[0]),
_spockActor(&_actorList[1]),
_mccoyActor(&_actorList[2]),
- _redshirtActor(&_actorList[3]) {
+ _redshirtActor(&_actorList[3]),
+ _sineTable(10) {
DebugMan.addDebugChannel(kDebugSound, "sound", "Sound");
DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics");
@@ -367,8 +368,10 @@ void StarTrekEngine::playIntro() {
}
void StarTrekEngine::initIntroR3ObjectToMove(R3 *r3, int16 srcAngle, int16 srcDepth, int16 destAngle, int16 destDepth, int16 ticks) {
- srcAngle = (srcAngle << 9) / 180;
- destAngle = (destAngle << 9) / 180;
+ Fixed8 a1 = Fixed8::fromRaw((srcAngle << 8) / 90);
+ Fixed8 a2 = Fixed8::fromRaw((destAngle << 8) / 90);
+
+ //r3->pos.x = sin(a1).multToFixed16(srcDepth) + _starfieldPosition.x;
}
void StarTrekEngine::loadSubtitleSprite(int index, Sprite *sprite) {
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index aab4f3a..7ebc47d 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -30,6 +30,7 @@
#include "common/rect.h"
#include "common/scummsys.h"
#include "common/serializer.h"
+#include "common/sinetables.h"
#include "common/str.h"
#include "common/stream.h"
#include "common/system.h"
@@ -210,6 +211,13 @@ protected:
Common::Error run();
public:
+ // math.cpp
+ /**
+ * Unit of the angle is "quadrants" (90 degrees = 1.0)
+ */
+ Fixed14 sin(Fixed8 angle);
+ Fixed14 cos(Fixed8 angle);
+
// Game modes
Common::Error runGameMode(int mode);
@@ -542,6 +550,7 @@ public:
private:
Common::RandomSource _randomSource;
+ Common::SineTable _sineTable;
Common::MacResManager *_macResFork;
SharedPtr<Room> _room;
Commit: 565bf0e96750588e8a7f6816e79683e97896f8de
https://github.com/scummvm/scummvm/commit/565bf0e96750588e8a7f6816e79683e97896f8de
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: atan2 function
Changed paths:
A engines/startrek/math.cpp
engines/startrek/fixedint.h
engines/startrek/space.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/fixedint.h b/engines/startrek/fixedint.h
index cae9efd..2ea6400 100644
--- a/engines/startrek/fixedint.h
+++ b/engines/startrek/fixedint.h
@@ -122,6 +122,31 @@ public:
bool operator<=(double d) const {
return toDouble() <= d;
}
+ bool operator>(double d) const {
+ return toDouble() > d;
+ }
+ bool operator>=(double d) const {
+ return toDouble() >= d;
+ }
+
+ bool operator==(const TFixedInt &f) const {
+ return val == f.val;
+ }
+ bool operator!=(const TFixedInt &f) const {
+ return val != f.val;
+ }
+ bool operator<(const TFixedInt &f) const {
+ return val < f.val;
+ }
+ bool operator<=(const TFixedInt &f) const {
+ return val <= f.val;
+ }
+ bool operator>(const TFixedInt &f) const {
+ return val > f.val;
+ }
+ bool operator>=(const TFixedInt &f) const {
+ return val >= f.val;
+ }
void saveLoadWithSerializer(Common::Serializer &ser) {
if (totalBits == 16)
diff --git a/engines/startrek/math.cpp b/engines/startrek/math.cpp
new file mode 100644
index 0000000..80aa39e
--- /dev/null
+++ b/engines/startrek/math.cpp
@@ -0,0 +1,129 @@
+/* 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 "startrek/startrek.h"
+
+namespace StarTrek {
+
+Fixed14 StarTrekEngine::sin(Fixed8 angle) {
+ int16 i = angle.raw();
+ if (angle < 0) {
+ i %= 0x400;
+ i += 0x400;
+ }
+ i &= 0x3ff;
+
+ if (i == 0x100)
+ return 1.0;
+ else if (i == 0x300)
+ return -1.0;
+
+ float f;
+ if (i < 0x100)
+ f = _sineTable.getTable()[i & 0xff];
+ else if (i < 0x200)
+ f = _sineTable.getTable()[256 - (i & 0xff)];
+ else if (i < 0x300)
+ f = -_sineTable.getTable()[i & 0xff];
+ else if (i < 0x400)
+ f = -_sineTable.getTable()[256 - (i & 0xff)];
+ return Fixed16(f);
+}
+
+Fixed14 StarTrekEngine::cos(Fixed8 angle) {
+ return sin(angle + 1.0);
+}
+
+Fixed8 StarTrekEngine::atan2(int32 deltaX, int32 deltaY) {
+ const int16 atanTable[] = {
+ 0x0000, 0x0064, 0x00c9, 0x012d, 0x0192, 0x01f6, 0x025b, 0x02c0,
+ 0x0324, 0x0389, 0x03ee, 0x0453, 0x04b8, 0x051d, 0x0582, 0x05e8,
+ 0x064d, 0x06b3, 0x0718, 0x077e, 0x07e4, 0x084a, 0x08b1, 0x0917,
+ 0x097e, 0x09e5, 0x0a4c, 0x0ab3, 0x0b1a, 0x0b82, 0x0bea, 0x0c52,
+ 0x0cba, 0x0d23, 0x0d8c, 0x0df5, 0x0e5f, 0x0ec8, 0x0f32, 0x0f9d,
+ 0x1007, 0x1072, 0x10de, 0x114a, 0x11b6, 0x1222, 0x128f, 0x12fc,
+ 0x136a, 0x13d8, 0x1446, 0x14b5, 0x1524, 0x1594, 0x1604, 0x1675,
+ 0x16e6, 0x1757, 0x17ca, 0x183c, 0x18b0, 0x1923, 0x1998, 0x1a0c,
+ 0x1a82, 0x1af8, 0x1b6f, 0x1be6, 0x1c5e, 0x1cd7, 0x1d50, 0x1dca,
+ 0x1e45, 0x1ec0, 0x1f3c, 0x1fb9, 0x2037, 0x20b5, 0x2134, 0x21b4,
+ 0x2235, 0x22b7, 0x2339, 0x23bd, 0x2441, 0x24c6, 0x254c, 0x25d4,
+ 0x265c, 0x26e5, 0x276f, 0x27fa, 0x2887, 0x2914, 0x29a2, 0x2a32,
+ 0x2ac3, 0x2b55, 0x2be8, 0x2c7d, 0x2d12, 0x2da9, 0x2e42, 0x2edc,
+ 0x2f77, 0x3013, 0x30b1, 0x3151, 0x31f2, 0x3294, 0x3338, 0x33de,
+ 0x3486, 0x352f, 0x35d9, 0x3686, 0x3734, 0x37e5, 0x3897, 0x394b,
+ 0x3a01, 0x3ab9, 0x3b73, 0x3c30, 0x3cee, 0x3daf, 0x3e72, 0x3f38,
+ 0x4000
+ };
+
+ if (deltaX == 0 && deltaY == 0)
+ return 0.0;
+
+ bool deltaYNegative = deltaY <= 0;
+ bool deltaXNegative = deltaX <= 0;
+
+ deltaY = abs(deltaY);
+ deltaX = abs(deltaX);
+
+ Fixed14 ratio;
+ if (deltaY > deltaX)
+ ratio = Fixed14::fromRaw(((deltaX & 0xffff0000) >> 2) / (deltaY >> 16));
+ else
+ ratio = Fixed14::fromRaw(((deltaY & 0xffff0000) >> 2) / (deltaX >> 16));
+
+ int16 endIndex = 128;
+ int16 index = 0;
+ int16 angle;
+ while (index <= endIndex) {
+ angle = (index + endIndex) / 2;
+ Fixed14 tableValue = Fixed14::fromRaw(atanTable[angle]);
+ if (tableValue > ratio)
+ endIndex = angle - 1;
+ else if (tableValue < ratio)
+ index = angle + 1;
+ else
+ break;
+ }
+
+ if (deltaY > deltaX) {
+ if (!deltaYNegative && !deltaXNegative)
+ angle = angle;
+ else if (!deltaYNegative && deltaXNegative)
+ angle = -angle;
+ else if (deltaYNegative && !deltaXNegative)
+ angle = 512 - angle;
+ else
+ angle = angle - 512;
+ } else {
+ if (!deltaYNegative && !deltaXNegative)
+ angle = 256 - angle;
+ else if (deltaYNegative && !deltaXNegative)
+ angle = 256 + angle;
+ else if (deltaYNegative && deltaXNegative)
+ angle = -256 - angle;
+ else
+ angle = -256 + angle;
+ }
+
+ return Fixed8::fromRaw(angle);
+}
+
+}
diff --git a/engines/startrek/space.h b/engines/startrek/space.h
index a9c6bde..f4b53d1 100644
--- a/engines/startrek/space.h
+++ b/engines/startrek/space.h
@@ -73,7 +73,8 @@ struct TPoint {
};
typedef TPoint<int32> Point3;
-typedef TPoint<Fixed14> Point3W;
+typedef TPoint<int16> Point3_Short;
+typedef TPoint<Fixed14> Point_Fixed14;
template<typename T>
@@ -106,7 +107,7 @@ public:
}
};
-typedef TMatrix<Point3W> Matrix;
+typedef TMatrix<Point_Fixed14> Matrix;
struct Star {
bool active;
@@ -117,10 +118,12 @@ struct Star {
// TODO: what does this stand for? Maybe rename it.
struct R3 {
Point3 pos; // 0x0
+ Matrix matrix; // 0xc
int16 field1e; // 0x1e
int16 field20; // 0x20
int16 field22; // 0x22
int16 field24; // 0x24
+ Point3_Short speed; // 0x26
SharedPtr<FileStream> shpFile; // 0x68
};
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index c8bad8d..22d89db 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -371,7 +371,27 @@ void StarTrekEngine::initIntroR3ObjectToMove(R3 *r3, int16 srcAngle, int16 srcDe
Fixed8 a1 = Fixed8::fromRaw((srcAngle << 8) / 90);
Fixed8 a2 = Fixed8::fromRaw((destAngle << 8) / 90);
- //r3->pos.x = sin(a1).multToFixed16(srcDepth) + _starfieldPosition.x;
+ r3->pos.x = (sin(a1).multToInt(srcDepth) << 16) + _starfieldPosition.x;
+ r3->pos.z = (cos(a1).multToInt(srcDepth) << 16) + _starfieldPosition.z;
+ r3->pos.y = 0;
+
+ int32 deltaX = (sin(a2).multToInt(destDepth) << 16) + _starfieldPosition.x - r3->pos.x;
+ int32 deltaZ = (cos(a2).multToInt(destDepth) << 16) + _starfieldPosition.z - r3->pos.z;
+
+ Fixed16 angle = atan2(deltaX, deltaZ);
+ r3->matrix = initMatrix();
+
+ // sub_248cc(angle, r3->matrix);
+
+ if (ticks != 0) {
+ r3->speed.x = deltaX / ticks;
+ r3->speed.z = deltaZ / ticks;
+ r3->speed.y = 0;
+ } else {
+ r3->speed.x = 0;
+ r3->speed.z = 0;
+ r3->speed.y = 0;
+ }
}
void StarTrekEngine::loadSubtitleSprite(int index, Sprite *sprite) {
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 7ebc47d..4f5e62d 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -217,6 +217,7 @@ public:
*/
Fixed14 sin(Fixed8 angle);
Fixed14 cos(Fixed8 angle);
+ Fixed8 atan2(int32 deltaX, int32 deltaZ);
// Game modes
Common::Error runGameMode(int mode);
Commit: eff87179da0554446837a732bb6855f6c7f8a890
https://github.com/scummvm/scummvm/commit/eff87179da0554446837a732bb6855f6c7f8a890
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Half-done implementation of drawR3Shape
Handles drawing, scaling, probably rotating objects in space.
Changed paths:
engines/startrek/fixedint.h
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/math.cpp
engines/startrek/space.cpp
engines/startrek/space.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/fixedint.h b/engines/startrek/fixedint.h
index 2ea6400..65b4812 100644
--- a/engines/startrek/fixedint.h
+++ b/engines/startrek/fixedint.h
@@ -56,7 +56,7 @@ public:
* Constructor from other fixed-point formats.
*/
template<typename T2, uint otherTB, uint otherDB>
- TFixedInt<T, totalBits, decimalBits>(const TFixedInt<T2, otherTB, otherDB> &fi) {
+ explicit TFixedInt<T, totalBits, decimalBits>(const TFixedInt<T2, otherTB, otherDB> &fi) {
int diff = otherDB - decimalBits;
if (otherDB >= decimalBits)
val = fi.raw() >> diff;
@@ -76,12 +76,16 @@ public:
return ((double)val) / (1 << decimalBits);
}
+ TFixedInt operator-() const {
+ return fromRaw(-val);
+ }
+
/**
* Multiplication with an int, with the result being an int. Use this if the result
* might exceed the capacity of this type.
*/
int16 multToInt(int32 i) {
- return (val * i) >> decimalBits;
+ return ((int32)(val * i)) >> decimalBits;
}
/**
@@ -91,6 +95,12 @@ public:
return fromRaw(val * i);
}
/**
+ * Multiplication with a FixedInt, with the result being the same type.
+ */
+ TFixedInt operator*(const TFixedInt &f) const {
+ return fromRaw(((int32)(val * f.val)) >> decimalBits);
+ }
+ /**
* Division with an int, with the result being the same type.
*/
TFixedInt operator/(int32 i) const {
@@ -173,6 +183,8 @@ typedef TFixedInt<int16, 16, 8> Fixed8;
// Fixed-point (16.16) number
typedef TFixedInt<int32, 32, 16> Fixed16;
+typedef Fixed8 Angle;
+
}
#endif
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 6fe1c8f..1612dc0 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -105,6 +105,10 @@ void Graphics::fillBackgroundRect(const Common::Rect &rect, byte color) {
}
}
+byte *Graphics::getBackgroundPixels() {
+ return _backgroundImage->pixels;
+}
+
void Graphics::clearScreenAndPriBuffer() {
Common::fill(_priData, _priData + sizeof(_priData), 0);
@@ -131,6 +135,17 @@ void Graphics::loadPalette(const Common::String &paletteName) {
lutStream->read(_lutData, 256);
}
+void Graphics::copyRectBetweenBitmaps(Bitmap *destBitmap, int destX, int destY, Bitmap *srcBitmap, int srcX, int srcY, int width, int height) {
+ byte *src = srcBitmap->pixels + srcX + srcY * srcBitmap->width;
+ byte *dest = destBitmap->pixels + destX + destY * destBitmap->width;
+
+ for (int y = 0; y < height; y++) {
+ memcpy(dest, src, width);
+ src += srcBitmap->width;
+ dest += destBitmap->width;
+ }
+}
+
void Graphics::fadeinScreen() {
while (_paletteFadeLevel <= 100) {
TrekEvent event;
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index a40e1fa..7d48c03 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -58,10 +58,13 @@ public:
* @param drawRect The clipped rectangle to draw at (must be within the drawable space)
*/
void drawBitmapToBackground(const Common::Rect &origRect, const Common::Rect &drawRect, SharedPtr<Bitmap> bitmap);
+
void fillBackgroundRect(const Common::Rect &rect, byte color);
+ byte *getBackgroundPixels();
void clearScreenAndPriBuffer();
void loadPalette(const String &paletteFile);
+ void copyRectBetweenBitmaps(Bitmap *destBitmap, int destX, int destY, Bitmap *srcBitmap, int srcX, int srcY, int width, int height);
void fadeinScreen();
void fadeoutScreen();
void setPaletteFadeLevel(byte *palData, int fadeLevel);
diff --git a/engines/startrek/math.cpp b/engines/startrek/math.cpp
index 80aa39e..da81b1f 100644
--- a/engines/startrek/math.cpp
+++ b/engines/startrek/math.cpp
@@ -24,7 +24,7 @@
namespace StarTrek {
-Fixed14 StarTrekEngine::sin(Fixed8 angle) {
+Fixed14 StarTrekEngine::sin(Angle angle) {
int16 i = angle.raw();
if (angle < 0) {
i %= 0x400;
@@ -46,14 +46,14 @@ Fixed14 StarTrekEngine::sin(Fixed8 angle) {
f = -_sineTable.getTable()[i & 0xff];
else if (i < 0x400)
f = -_sineTable.getTable()[256 - (i & 0xff)];
- return Fixed16(f);
+ return Fixed14(f);
}
-Fixed14 StarTrekEngine::cos(Fixed8 angle) {
+Fixed14 StarTrekEngine::cos(Angle angle) {
return sin(angle + 1.0);
}
-Fixed8 StarTrekEngine::atan2(int32 deltaX, int32 deltaY) {
+Angle StarTrekEngine::atan2(int32 deltaX, int32 deltaY) {
const int16 atanTable[] = {
0x0000, 0x0064, 0x00c9, 0x012d, 0x0192, 0x01f6, 0x025b, 0x02c0,
0x0324, 0x0389, 0x03ee, 0x0453, 0x04b8, 0x051d, 0x0582, 0x05e8,
@@ -85,9 +85,9 @@ Fixed8 StarTrekEngine::atan2(int32 deltaX, int32 deltaY) {
Fixed14 ratio;
if (deltaY > deltaX)
- ratio = Fixed14::fromRaw(((deltaX & 0xffff0000) >> 2) / (deltaY >> 16));
+ ratio = Fixed14::fromRaw(((deltaX & 0xffff0000) >> 2) / deltaY);
else
- ratio = Fixed14::fromRaw(((deltaY & 0xffff0000) >> 2) / (deltaX >> 16));
+ ratio = Fixed14::fromRaw(((deltaY & 0xffff0000) >> 2) / deltaX);
int16 endIndex = 128;
int16 index = 0;
@@ -123,7 +123,7 @@ Fixed8 StarTrekEngine::atan2(int32 deltaX, int32 deltaY) {
angle = -256 + angle;
}
- return Fixed8::fromRaw(angle);
+ return Angle::fromRaw(angle);
}
}
diff --git a/engines/startrek/space.cpp b/engines/startrek/space.cpp
index aeb2615..965290d 100644
--- a/engines/startrek/space.cpp
+++ b/engines/startrek/space.cpp
@@ -31,6 +31,7 @@ void StarTrekEngine::initStarfieldPosition() {
}
void StarTrekEngine::initStarfield(int16 x, int16 y, int16 width, int16 height, int16 arg8) {
+ // TODO: finish
_starfieldXVar1 = (x + width) / 2;
_starfieldYVar1 = (y + height) / 2;
_starfieldXVar2 = (width - x + 1) / 2;
@@ -43,6 +44,7 @@ void StarTrekEngine::initStarfield(int16 x, int16 y, int16 width, int16 height,
memset(_starList, 0, sizeof(_starList));
_starfieldPointDivisor = 150;
+ _flt_50898 = 50.0;
}
void StarTrekEngine::addR3(R3 *r3) {
@@ -73,9 +75,6 @@ void StarTrekEngine::clearStarfieldPixels() {
}
void StarTrekEngine::drawStarfield() {
- // TODO: make these class variables
- float flt_50898 = 50.0; // ?
-
int16 var28 = ((_starfieldXVar2 * 3) >> 1);
int16 xvar = var28 / 2;
int16 var2a = ((_starfieldYVar2 * 3) >> 1);
@@ -101,11 +100,11 @@ void StarTrekEngine::drawStarfield() {
Point3 p = star->pos - _starfieldPosition;
Point3 point2 = matrixMult(p, _starPositionMatrix);
- if (point2.z > flt_50898 && point2.z < 0x3fff
+ if (point2.z > _flt_50898 && point2.z < 0x3fff
&& abs(point2.x) < point2.z && abs(point2.y) < point2.z) {
- int16 x = _starfieldXVar1 + (point2.x * _starfieldPointDivisor / point2.z);
- int16 y = _starfieldYVar1 - (point2.y * _starfieldPointDivisor / point2.z);
+ int16 x = _starfieldXVar1 + scaleSpacePosition(point2.x, point2.z);
+ int16 y = _starfieldYVar1 - scaleSpacePosition(point2.y, point2.z);
int fileOffset = file->pos();
file->readUint32();
@@ -131,13 +130,371 @@ void StarTrekEngine::drawStarfield() {
}
}
+/**
+ * Compare 2 r3 objects for the purpose of sorting them by layer before drawing.
+ * FIXME: Original returned an int, not a bool. This may affect the stability of the sort...
+ */
+bool compareR3Objects(R3 *obj1, R3 *obj2) {
+ int32 diff = obj1->field54 - obj2->field54;
+ if (diff < 0)
+ return true;
+ else if (diff == 0)
+ return false; // original would have a distinct value for this
+ else
+ return false;
+}
+
void StarTrekEngine::updateStarfieldAndShips(bool arg0) {
+ bool enterpriseDestroyed = false;
+
_starfieldSprite.bitmapChanged = true;
_starPositionMatrix = _someMatrix.invert();
clearStarfieldPixels();
drawStarfield();
- // TODO
+ int numObjects = 0;
+ for (int i = 0; i < NUM_SPACE_OBJECTS; i++) {
+ R3 *r3 = _r3List[i];
+ if (r3 == nullptr)
+ continue;
+ r3->field34 = 0;
+
+ switch (r3->field1e) { // TODO
+ case 1:
+ r3 = sub_19f24(r3);
+ break;
+ case 2: // TODO (specifically for the enterprise?)
+ break;
+ case 3:
+ r3 = sub_19f24(r3);
+ break;
+ }
+
+ if (r3 != nullptr)
+ _orderedR3List[numObjects++] = r3;
+ }
+
+ if (numObjects != 0) {
+ Common::sort(_orderedR3List, _orderedR3List + numObjects, &compareR3Objects);
+
+ for (int i = 0; i < numObjects; i++) {
+ R3 *r3 = _orderedR3List[i];
+ r3->field34 = 1;
+
+ switch (r3->field1e) { // TODO
+ case 1:
+ break;
+ case 2:
+ break;
+ case 3:
+ if (r3->field20 == 1) {
+ // TODO
+ } else
+ drawR3Shape(r3);
+ break;
+ }
+ }
+ }
+
+ if (enterpriseDestroyed) {
+ showTextbox("", "GENE\\SPACE000#The Enterprise has been destroyed!", 20, 20, TEXTCOLOR_YELLOW, 0);
+ showGameOverMenu();
+ // FIXME: original game manipulates stack to jump somewhere...
+ return;
+ }
+
+ // TODO: static on enterprise viewscreen?
+}
+
+R3 *StarTrekEngine::sub_19f24(R3 *r3) {
+ r3->matrix2 = r3->matrix;
+ r3->field36 = r3->pos;
+ r3->field36 -= _starfieldPosition;
+ r3->field54 = r3->field36.getDiagonal();
+ Point3 point = matrixMult(r3->field36, _starPositionMatrix);
+ r3->field36 = point;
+
+ if (sub_1c022(r3)) {
+ if (r3->field1e >= 1 && r3->field1e <= 3)
+ r3->matrix2 *= _starPositionMatrix;
+ r3->field58 = _starfieldXVar1 + scaleSpacePosition(r3->field36.x, r3->field36.z);
+ r3->field5a = _starfieldYVar1 - scaleSpacePosition(r3->field36.y, r3->field36.z);
+ return r3;
+ } else
+ return nullptr;
+}
+
+void StarTrekEngine::drawR3Shape(R3 *r3) {
+ if (r3->field1e != 3) // TODO: remove this
+ return;
+
+ if (r3->funcPtr1 != nullptr) {
+ // TODO: call it
+ }
+
+ if (r3->shpFile != nullptr) {
+ r3->shpFile->seek(r3->bitmapOffset, SEEK_SET);
+ SharedPtr<Bitmap> bitmap(new Bitmap(r3->shpFile));
+ double dbl68 = ((double)r3->field24 * _starfieldPointDivisor) / r3->field36.z;
+ double dbl70 = 1.0 / dbl68;
+
+ double dbl30;
+ double dbl28;
+ double dbl20;
+ double dbl18;
+ double dbl60;
+ double dbl58;
+ double dbl50;
+ double dbl48;
+
+ switch (r3->field1e) {
+ case 1: // TODO
+ break;
+ case 3:
+ dbl30 = dbl68;
+ dbl28 = 0.0;
+ dbl20 = 0.0;
+ dbl18 = dbl68;
+ dbl60 = dbl70;
+ dbl58 = 0.0;
+ dbl50 = 0.0;
+ dbl48 = dbl70;
+ break;
+ case 4: // TODO
+ break;
+ default: // TODO
+ break;
+ }
+
+ r3->field80 = dbl60;
+ r3->field88 = dbl58;
+ r3->field90 = dbl50;
+ r3->field98 = dbl48;
+
+ // dbl30, (bitmap->xoffset + 2), r3->field58,
+ double tmp = r3->field58 - (double)(bitmap->xoffset + 2) * dbl30;
+ // dbl20, (bitmap->yoffset + 2), tmp
+ double dbl10 = tmp - (double)(bitmap->yoffset + 2) * dbl20;
+
+ // dbl28, (bitmap->xoffset + 2), r3->field5a
+ tmp = r3->field5a - (double)(bitmap->xoffset + 2) * dbl28;
+ // dbl18, (bitmap->yoffset + 2), tmp
+ double dbl8 = tmp - (double)(bitmap->yoffset + 2) * dbl18;
+
+ // dbl60, r3->field58, bitmap->xoffset + 2
+ tmp = (bitmap->xoffset + 2) - dbl60 * r3->field58;
+ double dbl40 = tmp - dbl50 * r3->field5a;
+
+ tmp = (bitmap->yoffset + 2) - dbl58 * r3->field58;
+ double dbl38 = tmp - dbl48 * r3->field5a;
+
+ double dbl3e4 = bitmap->width + 2;
+ double dbl3ec = bitmap->height + 2;
+
+ double thing[8];
+ tmp = 1.0 * dbl30;
+ thing[0] = 1.0 * dbl20 + tmp + dbl10;
+
+ tmp = 1.0 * dbl28;
+ thing[1] = 1.0 * dbl18 + tmp + dbl8;
+
+ tmp = 1.0 * dbl30;
+ thing[2] = dbl3ec * dbl20 + tmp + dbl10;
+
+ tmp = 1.0 * dbl28;
+ thing[3] = dbl3ec * dbl18 + tmp + dbl8;
+
+ thing[4] = dbl3ec * dbl20 + dbl3e4 * dbl30 + dbl10;
+ thing[5] = dbl3ec * dbl18 + dbl3e4 * dbl28 + dbl8;
+
+ thing[6] = 1.0 * dbl20 + dbl3e4 * dbl30 + dbl10;
+ thing[7] = 1.0 * dbl18 + dbl3e4 * dbl28 + dbl8;
+
+
+ int16 rightBounds[SCREEN_HEIGHT];
+ int16 leftBounds[SCREEN_HEIGHT];
+
+ for (int y = _starfieldRect.top; y < _starfieldRect.bottom; y++) {
+ leftBounds[y] = _starfieldRect.right;
+ rightBounds[y] = _starfieldRect.left - 1;
+ }
+
+ int16 shpImageTop = _starfieldRect.bottom - 1;
+ int16 shpImageBottom = _starfieldRect.top;
+
+ for (int i = 0; i < 4; i++) {
+ int16 index1 = i;
+ int16 index2 = (i + 1) & 3;
+
+ if (thing[index1 + 1] > thing[index2 + 1]) {
+ index1 = index2;
+ index2 = i;
+ }
+
+ int16 top = ceil(thing[index1 + 1]);
+ int16 bottom = floor(thing[index2 + 1]);
+
+ if (top > bottom)
+ continue;
+ if (top > _starfieldRect.bottom - 1) // FIXME
+ continue;
+ if (bottom < _starfieldRect.top)
+ continue;
+ if (top < _starfieldRect.top)
+ top = _starfieldRect.top;
+ if (bottom > _starfieldRect.bottom - 1)
+ bottom = _starfieldRect.bottom - 1;
+
+ if (top < shpImageTop)
+ shpImageTop = top;
+ if (bottom > shpImageBottom)
+ shpImageBottom = bottom;
+
+ double dbl3f4;
+ if (thing[index2 + 1] == thing[index1 + 1])
+ dbl3f4 = 0.0;
+ else
+ dbl3f4 = (thing[index2] - thing[index1]) / (thing[index2 + 1] - thing[index1 + 1]);
+
+ int32 var3ec = (int32)(0x10000 * dbl3f4);
+ int32 var3e8 = (int32)(((top - thing[index1 + 1]) * dbl3f4 + thing[index1]) * 0x10000);
+
+ for (int y = top; y <= bottom; y++) {
+ int16 var3f6 = var3e8 >> 16;
+ int16 var3f8 = (var3e8 + 0xffff) >> 16;
+
+ if (var3f8 < _starfieldRect.left)
+ var3f8 = _starfieldRect.left;
+ if (var3f8 < leftBounds[y])
+ leftBounds[y] = var3f8;
+
+ if (var3f6 > _starfieldRect.right - 1)
+ var3f6 = _starfieldRect.right - 1;
+ if (var3f6 > rightBounds[y])
+ rightBounds[y] = var3f6;
+
+ var3e8 += var3ec;
+ }
+ }
+
+ while (shpImageTop <= shpImageBottom) {
+ if (leftBounds[shpImageTop] > rightBounds[shpImageTop])
+ shpImageTop++;
+ else
+ break;
+ }
+ while (shpImageTop <= shpImageBottom) {
+ if (leftBounds[shpImageBottom] > rightBounds[shpImageBottom])
+ shpImageBottom--;
+ else
+ break;
+ }
+
+ debug("Top: %d, Bot: %d", shpImageTop, shpImageBottom);
+ if (shpImageTop <= shpImageBottom) {
+ bool var3fa;
+ if (r3->field1e == 2) {
+ // TODO
+ } else
+ var3fa = (((r3->field24 * _starfieldPointDivisor) << 1) / 3 <= r3->field36.z);
+
+ if (!var3fa) {
+ if (r3->field1e == 3) {
+ // FIXME: is this used anywhere?
+ uint16 var3fc = (_frameIndex << 3) ^ _frameIndex;
+ } else {
+ // TODO
+ }
+ }
+
+ int16 xDiff = (int16)(dbl60 * 256);
+ int16 yDiff = (int16)(dbl58 * 256);
+ int16 var3f2 = (int16)(dbl50 * 256);
+ int16 var3f4 = (int16)(dbl48 * 256);
+
+ int16 var3f6 = var3f2 * shpImageTop + (int16)(dbl40 * 256);
+ int16 var3f8 = var3f4 * shpImageTop + (int16)(dbl38 * 256);
+
+ Bitmap tmpBitmap(256, 249);
+ byte otherBuffer[256 * 256];
+
+ int16 bitmapWidth = bitmap->width;
+ int16 bitmapHeight = bitmap->height;
+
+ if (bitmapHeight > 245)
+ error("Shape height too big in drawR3Shape!");
+ if (bitmapWidth > 252)
+ error("Shape width too big in drawR3Shape!");
+
+ for (int i = 0; i < 2; i++)
+ memset(otherBuffer + i * 256, 0, bitmapWidth + 4);
+ for (int i = 0; i < 2; i++)
+ memset(otherBuffer + (bitmapHeight + 2 + i) * 256, 0, bitmapWidth + 4);
+
+ for (int i = 0; i < bitmapHeight; i++) {
+ otherBuffer[512 + i * 256 + 0] = 0;
+ otherBuffer[512 + i * 256 + 1] = 0;
+ otherBuffer[512 + i * 256 + bitmapWidth + 2] = 0;
+ otherBuffer[512 + i * 256 + bitmapWidth + 3] = 0;
+ }
+
+ if (r3->field1e == 2) {
+ // TODO
+ } else
+ _gfx->copyRectBetweenBitmaps(&tmpBitmap, 2, 2, bitmap.get(), 0, 0, bitmapWidth, bitmapHeight);
+
+ byte *bgPixels = _gfx->getBackgroundPixels() + shpImageTop * SCREEN_WIDTH;
+
+ for (int y = shpImageTop; y <= shpImageBottom; y++) {
+ int16 leftBound = leftBounds[y];
+ int16 rowWidth = rightBounds[y] - leftBound;
+ int16 srcX = leftBound * xDiff + var3f6;
+ int16 srcY = leftBound * yDiff + var3f8;
+ var3f6 += var3f2;
+ var3f8 += var3f4;
+
+ byte *bgPixels2 = bgPixels + leftBound;
+ bgPixels += SCREEN_WIDTH;
+
+ if (rowWidth == 0)
+ continue;
+
+ debug("Width: %d", rowWidth);
+
+ if (var3fa) {
+ srcX += 0x80;
+ srcY += 0x80;
+
+ int16 cx = srcX;
+ int16 bx = srcY;
+ byte *di = bgPixels2;
+
+ for (int a = 0; a < rowWidth; a++) {
+ byte b = tmpBitmap.pixels[(bx & 0xff00) + (cx >> 8)];
+ cx += xDiff;
+ bx += yDiff;
+ if (b == 0)
+ *(di++) = 8; // FIXME: shouldn't assign anything, fix after done testing
+ else
+ *(di++) = b;
+ }
+ } else {
+ warning("Unimplemented branch in \"drawR3Shape\"");
+ }
+ }
+ }
+ }
+
+ if (r3->funcPtr2 != nullptr) {
+ // TODO: call it
+ }
+}
+
+bool StarTrekEngine::sub_1c022(R3 *r3) {
+ Point3 point = r3->field36;
+ if (point.z < _flt_50898)
+ return false;
+ return true; // TODO: finish this properly
}
Point3 StarTrekEngine::constructPoint3ForStarfield(int16 x, int16 y, int16 z) {
@@ -153,9 +510,8 @@ Point3 StarTrekEngine::matrixMult(const Matrix &weight, const Point3 &point) {
Point3 p;
for (int i = 0; i < 3; i++) {
p[i] = 0;
- for (int j = 0; j < 3; j++) { // FIXME: what is this weird multiplication?
- p[i] += (weight[i][j].raw() * (point[j] & 0xffff) << 2) >> 16;
- }
+ for (int j = 0; j < 3; j++)
+ p[i] += (int16)weight[i][j].multToInt(point[j]);
}
return p;
}
@@ -164,13 +520,16 @@ Point3 StarTrekEngine::matrixMult(const Point3 &point, const Matrix &weight) {
Point3 p = Point3();
for (int i = 0; i < 3; i++) {
p[i] = 0;
- for (int j = 0; j < 3; j++) {
- p[i] += (weight[j][i].raw() * (point[j] & 0xffff) << 2) >> 16;
- }
+ for (int j = 0; j < 3; j++)
+ p[i] += (int16)weight[j][i].multToInt(point[j]);
}
return p;
}
+int32 StarTrekEngine::scaleSpacePosition(int32 x, int32 z) {
+ return (x * _starfieldPointDivisor) / z;
+}
+
Matrix StarTrekEngine::initMatrix() {
Matrix mat;
mat[0][0] = 1.0;
@@ -179,4 +538,17 @@ Matrix StarTrekEngine::initMatrix() {
return mat;
}
+Matrix StarTrekEngine::initSpeedMatrixForXZMovement(Angle angle, const Matrix &matrix) {
+ Fixed14 sinVal = sin(angle);
+ Fixed14 cosVal = cos(angle);
+
+ Matrix matrix1 = initMatrix();
+ matrix1[0].x = cosVal;
+ matrix1[0].z = -sinVal;
+ matrix1[2].x = sinVal;
+ matrix1[2].z = cosVal;
+
+ return matrix * matrix1;
+}
+
}
diff --git a/engines/startrek/space.h b/engines/startrek/space.h
index f4b53d1..0d113cf 100644
--- a/engines/startrek/space.h
+++ b/engines/startrek/space.h
@@ -38,6 +38,10 @@ struct TPoint {
TPoint() : x(0), y(0), z(0) {}
TPoint(T _x, T _y, T _z) : x(_x), y(_y), z(_z) {}
+ int32 getDiagonal() {
+ return sqrt(x * x + y * y + z * z);
+ }
+
TPoint<T> operator+(const TPoint<T> &p) const {
TPoint<T> p2;
p2.x = x + p.x;
@@ -52,6 +56,16 @@ struct TPoint {
p2.z = z - p.z;
return p2;
}
+ void operator+=(const TPoint &p) {
+ x += p.x;
+ y += p.y;
+ z += p.z;
+ }
+ void operator-=(const TPoint &p) {
+ x -= p.x;
+ y -= p.y;
+ z -= p.z;
+ }
T &operator[](int i) {
if (i == 0)
return x;
@@ -83,7 +97,11 @@ private:
T m[3];
public:
- TMatrix() {}
+ TMatrix() {
+ for (int i = 0; i < 3; i++)
+ for (int j = 0; j < 3; j++)
+ m[i][j] = 0;
+ }
TMatrix(const TMatrix<T> &mat) {
m[0] = mat.m[0];
m[1] = mat.m[1];
@@ -96,6 +114,22 @@ public:
return m[i];
};
+ TMatrix operator*(const TMatrix &m2) const {
+ TMatrix ret;
+ for (int i = 0; i < 3; i++) {
+ for (int j = 0; j < 3; j++) {
+ ret[i][j] = 0;
+ for (int a = 0; a < 3; a++)
+ ret[i][j] += m[i][a] * m2[a][j];
+ }
+ }
+ return ret;
+ }
+
+ void operator*=(const TMatrix &m2) {
+ *this = *this * m2;
+ }
+
TMatrix<T> invert() {
TMatrix<T> ret;
for (int i = 0; i < 3; i++) {
@@ -124,7 +158,20 @@ struct R3 {
int16 field22; // 0x22
int16 field24; // 0x24
Point3_Short speed; // 0x26
+ int32 funcPtr1; // 0x2c
+ int32 funcPtr2; // 0x30
+ int16 field34; // 0x34
+ Point3 field36; // 0x36
+ Matrix matrix2; // 0x42
+ int32 field54; // 0x54 (used for sorting by draw priority?)
+ int16 field58; // 0x58
+ int16 field5a; // 0x5a
SharedPtr<FileStream> shpFile; // 0x68
+ int16 bitmapOffset; // 0x6a
+ double field80; // 0x80
+ double field88; // 0x88
+ double field90; // 0x90
+ double field98; // 0x98
};
// Maximum number of stars visible at once in the starfields
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 22d89db..fbbf535 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -58,6 +58,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
DebugMan.addDebugChannel(kDebugSound, "sound", "Sound");
DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics");
DebugMan.addDebugChannel(kDebugSavegame, "savegame", "Savegames");
+ DebugMan.addDebugChannel(kDebugSpace, "space", "Space and Pseudo-3D");
_gfx = nullptr;
_sound = nullptr;
@@ -89,6 +90,8 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_roomIndexToLoad = 0;
_showSubtitles = true; // TODO: test
+ Common::fill(_r3List, _r3List + NUM_SPACE_OBJECTS, (R3 *)nullptr);
+ Common::fill(_orderedR3List, _orderedR3List + NUM_SPACE_OBJECTS, (R3 *)nullptr);
for (int i = 0; i < NUM_OBJECTS; i++)
_itemList[i] = g_itemList[i];
@@ -221,8 +224,11 @@ void StarTrekEngine::playIntro() {
//delR3(&_enterpriseR3); // TODO: uncomment
R3 planetR3 = R3();
-
- // TODO: remainder of starfield initialization
+ planetR3.matrix = initMatrix();
+ planetR3.field1e = 3;
+ planetR3.funcPtr1 = nullptr;
+ planetR3.funcPtr2 = nullptr;
+ planetR3.bitmapOffset = 0;
_gfx->clearScreenAndPriBuffer();
_gfx->fadeoutScreen();
@@ -339,6 +345,16 @@ void StarTrekEngine::playIntro() {
starfieldZoomSpeed = 0;
break;
+ case 186:
+ delR3(&_enterpriseR3);
+ // TODO: the rest
+ break;
+
+ case 366:
+ planetR3.shpFile.reset();
+ delR3(&planetR3);
+ break;
+
case 378:
_gfx->delSprite(&subtitleSprite);
_byte_45b3c = 1;
@@ -371,23 +387,26 @@ void StarTrekEngine::initIntroR3ObjectToMove(R3 *r3, int16 srcAngle, int16 srcDe
Fixed8 a1 = Fixed8::fromRaw((srcAngle << 8) / 90);
Fixed8 a2 = Fixed8::fromRaw((destAngle << 8) / 90);
- r3->pos.x = (sin(a1).multToInt(srcDepth) << 16) + _starfieldPosition.x;
- r3->pos.z = (cos(a1).multToInt(srcDepth) << 16) + _starfieldPosition.z;
+ r3->pos.x = sin(a1).multToInt(srcDepth) + _starfieldPosition.x;
+ r3->pos.z = cos(a1).multToInt(srcDepth) + _starfieldPosition.z;
r3->pos.y = 0;
- int32 deltaX = (sin(a2).multToInt(destDepth) << 16) + _starfieldPosition.x - r3->pos.x;
- int32 deltaZ = (cos(a2).multToInt(destDepth) << 16) + _starfieldPosition.z - r3->pos.z;
+ int32 deltaX = sin(a2).multToInt(destDepth) + _starfieldPosition.x - r3->pos.x;
+ int32 deltaZ = cos(a2).multToInt(destDepth) + _starfieldPosition.z - r3->pos.z;
+ debug("Z: %d, %d", r3->pos.z - _starfieldPosition.z, cos(a2).multToInt(destDepth));
- Fixed16 angle = atan2(deltaX, deltaZ);
- r3->matrix = initMatrix();
+ Angle angle = atan2(deltaX, deltaZ);
+ r3->matrix = initSpeedMatrixForXZMovement(angle, initMatrix());
- // sub_248cc(angle, r3->matrix);
+ debugCN(5, kDebugSpace, "initIntroR3ObjectToMove: pos %x,%x,%x; ", r3->pos.x, r3->pos.y, r3->pos.z);
if (ticks != 0) {
+ debugC(5, kDebugSpace, "speed %x,%x,%x\n", r3->speed.x, r3->speed.y, r3->speed.z);
r3->speed.x = deltaX / ticks;
r3->speed.z = deltaZ / ticks;
r3->speed.y = 0;
} else {
+ debugC(5, kDebugSpace, "speed 0\n");
r3->speed.x = 0;
r3->speed.z = 0;
r3->speed.y = 0;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 4f5e62d..f95897d 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -112,7 +112,8 @@ enum StarTrekGameFeatures {
enum kDebugLevels {
kDebugSound = 1 << 0,
kDebugGraphics = 1 << 1,
- kDebugSavegame = 2 << 1
+ kDebugSavegame = 1 << 2,
+ kDebugSpace = 2 << 3
};
enum GameMode {
@@ -215,9 +216,9 @@ public:
/**
* Unit of the angle is "quadrants" (90 degrees = 1.0)
*/
- Fixed14 sin(Fixed8 angle);
- Fixed14 cos(Fixed8 angle);
- Fixed8 atan2(int32 deltaX, int32 deltaZ);
+ Fixed14 sin(Angle angle);
+ Fixed14 cos(Angle angle);
+ Angle atan2(int32 deltaX, int32 deltaZ);
// Game modes
Common::Error runGameMode(int mode);
@@ -264,15 +265,20 @@ private:
void clearStarfieldPixels();
void drawStarfield();
void updateStarfieldAndShips(bool arg0);
+ R3 *sub_19f24(R3 *r3);
+ void drawR3Shape(R3 *r3);
+ bool sub_1c022(R3 *r3);
Point3 constructPoint3ForStarfield(int16 x, int16 y, int16 z);
Point3 matrixMult(const Matrix &weight, const Point3 &point);
Point3 matrixMult(const Point3 &point, const Matrix &weight);
+ int32 scaleSpacePosition(int32 x, int32 z);
/**
* Creates something like an "identity" matrix? (Value 0x4000 along the diagonal)
*/
Matrix initMatrix();
+ Matrix initSpeedMatrixForXZMovement(Angle angle, const Matrix &matrix);
// Transporter room
void runTransportSequence(const Common::String &name);
@@ -542,8 +548,10 @@ public:
Common::Rect _starfieldRect;
R3 _enterpriseR3;
R3 *_r3List[NUM_SPACE_OBJECTS];
+ R3 *_orderedR3List[NUM_SPACE_OBJECTS];
Matrix _starPositionMatrix;
Matrix _someMatrix;
+ float _flt_50898;
Graphics *_gfx;
Sound *_sound;
Commit: c2dd39a6c2f1f9356110dcfe0cb36607373b19e3
https://github.com/scummvm/scummvm/commit/c2dd39a6c2f1f9356110dcfe0cb36607373b19e3
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Remove some gotos
Changed paths:
engines/startrek/action.h
engines/startrek/awaymission.cpp
engines/startrek/space.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
index de20863..3ae507e 100644
--- a/engines/startrek/action.h
+++ b/engines/startrek/action.h
@@ -60,8 +60,8 @@ struct Action {
byte b3;
// ACTION_USE, ACTION_GET, ACTION_LOOK, ACTION_TALK
- byte activeObject() { return b1; }
- byte passiveObject() { return b2; }
+ byte activeObject() const { return b1; }
+ byte passiveObject() const { return b2; }
bool operator==(const Action &a) const {
return type == a.type && b1 == a.b1 && b2 == a.b2 && b3 == a.b3;
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 911c760..c422f80 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -195,178 +195,14 @@ void StarTrekEngine::handleAwayMissionEvents() {
break;
case TREKEVENT_LBUTTONDOWN:
-lclick:
- if (_awayMission.disableInput)
- break;
-
- switch (_awayMission.activeAction) {
- case ACTION_WALK: {
- if (_awayMission.disableWalking)
- break;
- _kirkActor->sprite.drawMode = 1; // Hide these objects for function call below?
- _spockActor->sprite.drawMode = 1;
- _mccoyActor->sprite.drawMode = 1;
- _redshirtActor->sprite.drawMode = 1;
-
- clickedObject = findObjectAt(_gfx->getMousePos());
-
- _kirkActor->sprite.drawMode = 0;
- _spockActor->sprite.drawMode = 0;
- _mccoyActor->sprite.drawMode = 0;
- _redshirtActor->sprite.drawMode = 0;
-
- if (walkActiveObjectToHotspot())
- break;
-
- if (clickedObject > OBJECT_KIRK && clickedObject < ITEMS_START)
- addAction(ACTION_WALK, clickedObject, 0, 0);
- else {
- Common::String animFilename = getCrewmanAnimFilename(OBJECT_KIRK, "walk");
- Common::Point mousePos = _gfx->getMousePos();
- actorWalkToPosition(OBJECT_KIRK, animFilename, _kirkActor->pos.x, _kirkActor->pos.y, mousePos.x, mousePos.y);
- }
- break;
- }
-
- case ACTION_USE: {
- if (_awayMission.activeObject == OBJECT_REDSHIRT && (_awayMission.redshirtDead || (_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT)))) {
- hideInventoryIcons();
- _awayMission.activeAction = ACTION_WALK;
- break;
- }
-
- clickedObject = findObjectAt(_gfx->getMousePos());
- hideInventoryIcons();
-
- if (clickedObject == OBJECT_INVENTORY_ICON) {
- clickedObject = showInventoryMenu(50, 50, false);
-
-useInventory:
- // -1 means "clicked on something unknown"; -2 means "clicked on
- // nothing". In the case of the inventory, either one clicks on an
- // inventory item, or no action is performed.
- if (clickedObject == -1)
- clickedObject = -2;
- }
-
- _awayMission.passiveObject = clickedObject;
-
- bool activeIsCrewman = _awayMission.activeObject <= OBJECT_REDSHIRT;
- bool activeIsItem = _awayMission.activeObject >= ITEMS_START && _awayMission.activeObject < ITEMS_END;
- bool passiveIsCrewman = _awayMission.passiveObject <= OBJECT_REDSHIRT;
- bool passiveIsItem = _awayMission.passiveObject >= ITEMS_START && _awayMission.passiveObject <= ITEMS_END; // FIXME: "<= ITEMS_END" doesn't make sense?
-
- if (clickedObject == -2)
- goto checkAddAction;
- if (_room->actionHasCode(ACTION_USE, _awayMission.activeObject, _awayMission.passiveObject, 0))
- goto checkAddAction;
- if (_awayMission.activeObject == OBJECT_MCCOY) {
- if (_room->actionHasCode(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0))
- goto checkAddAction;
- if (_room->actionHasCode(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0))
- goto checkAddAction;
- }
- else if (_awayMission.activeObject == OBJECT_SPOCK) {
- if (_room->actionHasCode(ACTION_USE, OBJECT_ISTRICOR, _awayMission.passiveObject, 0))
- goto checkAddAction;
- }
-
- if ((activeIsCrewman && passiveIsCrewman)
- || (activeIsCrewman && passiveIsItem)
- || (activeIsItem && passiveIsItem)) {
- if (_awayMission.passiveObject == OBJECT_ICOMM) {
- if (walkActiveObjectToHotspot())
- break;
- addAction(ACTION_USE, OBJECT_ICOMM, 0, 0);
- _sound->playVoc("commun30");
- if (_awayMission.activeObject <= OBJECT_REDSHIRT) {
- goto checkShowInventory;
- }
- else {
- _awayMission.activeAction = ACTION_WALK;
- break;
- }
- }
-
- _awayMission.activeObject = _awayMission.passiveObject;
- goto checkShowInventory;
- }
-
-checkAddAction:
- if (!walkActiveObjectToHotspot())
- {
- if (clickedObject != -2)
- addAction(_awayMission.activeAction, _awayMission.activeObject, _awayMission.passiveObject, 0);
-
-checkShowInventory:
- if (!(_awayMission.crewDownBitset & (1 << OBJECT_KIRK)))
- showInventoryIcons(true);
- }
- break;
- }
-
- case ACTION_GET:
- case ACTION_LOOK:
- case ACTION_TALK: {
- clickedObject = findObjectAt(_gfx->getMousePos());
- if (!isObjectUnusable(clickedObject, _awayMission.activeAction)) {
- hideInventoryIcons();
-
- if (clickedObject == OBJECT_INVENTORY_ICON) {
- clickedObject = showInventoryMenu(50, 50, false);
-lookInventory:
- if (clickedObject == -1)
- clickedObject = -2;
- }
-
- _awayMission.activeObject = clickedObject;
-
- if (walkActiveObjectToHotspot())
- break;
-
- if (clickedObject != -2)
- addAction(_awayMission.activeAction, _awayMission.activeObject, 0, 0);
-
- if (_awayMission.activeAction == ACTION_LOOK && !(_awayMission.crewDownBitset & (1 << OBJECT_KIRK)))
- showInventoryIcons(false);
- }
- break;
- }
-
- }
+ awayMissionLeftClick();
break; // End of TREKEVENT_LBUTTONDOWN
case TREKEVENT_MOUSEMOVE:
break;
case TREKEVENT_RBUTTONDOWN:
-rclick:
- if (_awayMission.disableInput)
- break;
- hideInventoryIcons();
- playSoundEffectIndex(0x07);
- _awayMission.activeAction = showActionMenu();
-
-checkSelectedAction:
- if (_awayMission.activeAction == ACTION_USE) {
- clickedObject = selectObjectForUseAction();
- if (clickedObject == -1)
- break;
- else
- _awayMission.activeObject = clickedObject;
- }
- if (_awayMission.activeAction == ACTION_USE
- && _awayMission.activeObject == OBJECT_ICOMM && (_awayMission.crewDownBitset & (1 << OBJECT_KIRK)) == 0) {
- if (!walkActiveObjectToHotspot()) {
- addAction(_awayMission.activeAction, _awayMission.activeObject, 0, 0);
- _sound->playVoc("communic");
- _awayMission.activeAction = ACTION_WALK;
- }
- }
- else if (_awayMission.activeAction == ACTION_LOOK)
- showInventoryIcons(false);
- else if (_awayMission.activeAction == ACTION_USE && (_awayMission.crewDownBitset & (1 << OBJECT_KIRK)) == 0)
- showInventoryIcons(true);
+ awayMissionSelectAction(true);
break;
case TREKEVENT_KEYDOWN:
@@ -377,7 +213,8 @@ checkSelectedAction:
case Common::KEYCODE_ESCAPE:
case Common::KEYCODE_SPACE:
case Common::KEYCODE_F2:
- goto rclick;
+ awayMissionSelectAction(true);
+ break;
case Common::KEYCODE_w:
hideInventoryIcons();
@@ -387,40 +224,48 @@ checkSelectedAction:
case Common::KEYCODE_t:
hideInventoryIcons();
_awayMission.activeAction = ACTION_TALK;
- goto checkSelectedAction;
+ awayMissionSelectAction(false);
+ break;
case Common::KEYCODE_u:
hideInventoryIcons();
_awayMission.activeAction = ACTION_USE;
- goto checkSelectedAction;
+ awayMissionSelectAction(false);
+ break;
case Common::KEYCODE_i:
if (_awayMission.activeAction == ACTION_USE) {
hideInventoryIcons();
clickedObject = showInventoryMenu(50, 50, true);
- goto useInventory;
- }
- else if (_awayMission.activeAction == ACTION_LOOK) {
+ if (clickedObject == -1)
+ clickedObject = -2;
+ awayMissionUseObject(clickedObject);
+ } else if (_awayMission.activeAction == ACTION_LOOK) {
hideInventoryIcons();
clickedObject = showInventoryMenu(50, 50, true);
- goto lookInventory;
+ if (clickedObject == -1)
+ clickedObject = -2;
+ awayMissionGetLookOrTalk(clickedObject);
}
break;
case Common::KEYCODE_RETURN:
case Common::KEYCODE_KP_ENTER:
case Common::KEYCODE_F1:
- goto lclick;
+ awayMissionLeftClick();
+ break;
case Common::KEYCODE_g:
hideInventoryIcons();
_awayMission.activeAction = ACTION_GET;
- goto checkSelectedAction;
+ awayMissionSelectAction(false);
+ break;
case Common::KEYCODE_l:
hideInventoryIcons();
_awayMission.activeAction = ACTION_LOOK;
- goto checkSelectedAction;
+ awayMissionSelectAction(false);
+ break;
default:
break;
@@ -433,6 +278,183 @@ checkSelectedAction:
}
}
+void StarTrekEngine::awayMissionLeftClick() {
+ if (_awayMission.disableInput)
+ return;
+
+ switch (_awayMission.activeAction) {
+ case ACTION_WALK: {
+ if (_awayMission.disableWalking)
+ break;
+ _kirkActor->sprite.drawMode = 1; // Hide these objects for function call below?
+ _spockActor->sprite.drawMode = 1;
+ _mccoyActor->sprite.drawMode = 1;
+ _redshirtActor->sprite.drawMode = 1;
+
+ int16 clickedObject = findObjectAt(_gfx->getMousePos());
+
+ _kirkActor->sprite.drawMode = 0;
+ _spockActor->sprite.drawMode = 0;
+ _mccoyActor->sprite.drawMode = 0;
+ _redshirtActor->sprite.drawMode = 0;
+
+ if (walkActiveObjectToHotspot())
+ break;
+
+ if (clickedObject > OBJECT_KIRK && clickedObject < ITEMS_START)
+ addAction(ACTION_WALK, clickedObject, 0, 0);
+ else {
+ Common::String animFilename = getCrewmanAnimFilename(OBJECT_KIRK, "walk");
+ Common::Point mousePos = _gfx->getMousePos();
+ actorWalkToPosition(OBJECT_KIRK, animFilename, _kirkActor->pos.x, _kirkActor->pos.y, mousePos.x, mousePos.y);
+ }
+ break;
+ }
+
+ case ACTION_USE: {
+ if (_awayMission.activeObject == OBJECT_REDSHIRT && (_awayMission.redshirtDead || (_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT)))) {
+ hideInventoryIcons();
+ _awayMission.activeAction = ACTION_WALK;
+ break;
+ }
+
+ int16 clickedObject = findObjectAt(_gfx->getMousePos());
+ hideInventoryIcons();
+
+ if (clickedObject == OBJECT_INVENTORY_ICON) {
+ clickedObject = showInventoryMenu(50, 50, false);
+
+ // -1 means "clicked on something unknown"; -2 means "clicked on
+ // nothing". In the case of the inventory, either one clicks on an
+ // inventory item, or no action is performed.
+ if (clickedObject == -1)
+ clickedObject = -2;
+ }
+
+ awayMissionUseObject(clickedObject);
+ break;
+ }
+
+ case ACTION_GET:
+ case ACTION_LOOK:
+ case ACTION_TALK: {
+ int16 clickedObject = findObjectAt(_gfx->getMousePos());
+ if (!isObjectUnusable(clickedObject, _awayMission.activeAction)) {
+ hideInventoryIcons();
+
+ if (clickedObject == OBJECT_INVENTORY_ICON) {
+ clickedObject = showInventoryMenu(50, 50, false);
+ if (clickedObject == -1)
+ clickedObject = -2;
+ }
+
+ awayMissionGetLookOrTalk(clickedObject);
+ }
+ break;
+ }
+
+ }
+}
+
+void StarTrekEngine::awayMissionSelectAction(bool openActionMenu) {
+ if (openActionMenu) {
+ if (_awayMission.disableInput)
+ return;
+ hideInventoryIcons();
+ playSoundEffectIndex(SND_07);
+ _awayMission.activeAction = showActionMenu();
+ }
+
+ if (_awayMission.activeAction == ACTION_USE) {
+ int16 clickedObject = selectObjectForUseAction();
+ if (clickedObject == -1)
+ return;
+ else
+ _awayMission.activeObject = clickedObject;
+ }
+ if (_awayMission.activeAction == ACTION_USE
+ && _awayMission.activeObject == OBJECT_ICOMM && (_awayMission.crewDownBitset & (1 << OBJECT_KIRK)) == 0) {
+ if (!walkActiveObjectToHotspot()) {
+ addAction(_awayMission.activeAction, _awayMission.activeObject, 0, 0);
+ _sound->playVoc("communic");
+ _awayMission.activeAction = ACTION_WALK;
+ }
+ } else if (_awayMission.activeAction == ACTION_LOOK)
+ showInventoryIcons(false);
+ else if (_awayMission.activeAction == ACTION_USE && (_awayMission.crewDownBitset & (1 << OBJECT_KIRK)) == 0)
+ showInventoryIcons(true);
+}
+
+void StarTrekEngine::awayMissionUseObject(int16 clickedObject) {
+ _awayMission.passiveObject = clickedObject;
+
+ bool activeIsCrewman = _awayMission.activeObject <= OBJECT_REDSHIRT;
+ bool activeIsItem = _awayMission.activeObject >= ITEMS_START && _awayMission.activeObject < ITEMS_END;
+ bool passiveIsCrewman = _awayMission.passiveObject <= OBJECT_REDSHIRT;
+ bool passiveIsItem = _awayMission.passiveObject >= ITEMS_START && _awayMission.passiveObject <= ITEMS_END; // FIXME: "<= ITEMS_END" doesn't make sense?
+
+ bool tryWalkToHotspot = false;
+ bool showInventory = false;
+
+ if (clickedObject == -2)
+ tryWalkToHotspot = true;
+ else if (_room->actionHasCode(ACTION_USE, _awayMission.activeObject, _awayMission.passiveObject, 0))
+ tryWalkToHotspot = true;
+ else if (_awayMission.activeObject == OBJECT_MCCOY && _room->actionHasCode(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0))
+ tryWalkToHotspot = true;
+ else if (_awayMission.activeObject == OBJECT_MCCOY && _room->actionHasCode(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0))
+ tryWalkToHotspot = true;
+ else if (_awayMission.activeObject == OBJECT_SPOCK &&_room->actionHasCode(ACTION_USE, OBJECT_ISTRICOR, _awayMission.passiveObject, 0))
+ tryWalkToHotspot = true;
+
+ if (!tryWalkToHotspot) {
+ if ((activeIsCrewman && passiveIsCrewman)
+ || (activeIsCrewman && passiveIsItem)
+ || (activeIsItem && passiveIsItem)) {
+ if (_awayMission.passiveObject == OBJECT_ICOMM) {
+ if (walkActiveObjectToHotspot())
+ return;
+ addAction(ACTION_USE, OBJECT_ICOMM, 0, 0);
+ _sound->playVoc("commun30");
+ if (_awayMission.activeObject <= OBJECT_REDSHIRT) {
+ showInventory = true;
+ } else {
+ _awayMission.activeAction = ACTION_WALK;
+ return;
+ }
+ }
+
+ _awayMission.activeObject = _awayMission.passiveObject;
+ showInventory = true;
+ } else
+ tryWalkToHotspot = true;
+ }
+
+ if (tryWalkToHotspot) {
+ if (!walkActiveObjectToHotspot()) {
+ if (clickedObject != -2)
+ addAction(_awayMission.activeAction, _awayMission.activeObject, _awayMission.passiveObject, 0);
+ showInventory = true;
+ }
+ }
+
+ if (showInventory && !(_awayMission.crewDownBitset & (1 << OBJECT_KIRK)))
+ showInventoryIcons(true);
+}
+
+void StarTrekEngine::awayMissionGetLookOrTalk(int16 clickedObject) {
+ _awayMission.activeObject = clickedObject;
+
+ if (walkActiveObjectToHotspot())
+ return;
+
+ if (clickedObject != -2)
+ addAction(_awayMission.activeAction, _awayMission.activeObject, 0, 0);
+
+ if (_awayMission.activeAction == ACTION_LOOK && !(_awayMission.crewDownBitset & (1 << OBJECT_KIRK)))
+ showInventoryIcons(false);
+}
+
void StarTrekEngine::unloadRoom() {
_gfx->fadeoutScreen();
// sub_2394b(); // TODO
@@ -487,8 +509,7 @@ void StarTrekEngine::handleAwayMissionAction() {
_awayMission.disableInput = false;
_warpHotspotsActive = true;
return;
- }
- else if (action.type == ACTION_FINISHED_WALKING && action.b1 >= 0xe0) {
+ } else if (action.type == ACTION_FINISHED_WALKING && action.b1 >= 0xe0) {
// Finished walking to a position; perform the action that was input back when
// they started walking over there.
int index = action.b1 - 0xe0;
@@ -548,12 +569,10 @@ void StarTrekEngine::handleAwayMissionAction() {
if (action.passiveObject() == OBJECT_SPOCK) {
int text = GROUNDTX_PHASER_ON_SPOCK + getRandomWord() % 8;
showTextbox("Mr. Spock", getLoadedText(text), 20, 20, TEXTCOLOR_BLUE, 0);
- }
- else if (action.passiveObject() == OBJECT_MCCOY) {
+ } else if (action.passiveObject() == OBJECT_MCCOY) {
int text = GROUNDTX_PHASER_ON_MCCOY + getRandomWord() % 8;
showTextbox("Dr. McCoy", getLoadedText(text), 20, 20, TEXTCOLOR_BLUE, 0);
- }
- else if (action.passiveObject() == OBJECT_REDSHIRT) {
+ } else if (action.passiveObject() == OBJECT_REDSHIRT) {
Common::String text = getLoadedText(GROUNDTX_PHASER_ON_REDSHIRT + getRandomWord() % 8);
// Replace audio filename with start of mission name (to load the
// audio for the crewman specific to the mission))
@@ -563,8 +582,7 @@ void StarTrekEngine::handleAwayMissionAction() {
showTextbox("Security Officer", text, 20, 20, TEXTCOLOR_RED, 0);
// TODO: replace "Security Officer" string with their actual name as
// an enhancement?
- }
- else if (!_room->handleActionWithBitmask(action)) {
+ } else if (!_room->handleActionWithBitmask(action)) {
int index = getRandomWord() % 7;
if (index & 1)
showTextbox("Dr. McCoy", getLoadedText(GROUNDTX_PHASER_ANYWHERE + index), 20, 20, TEXTCOLOR_BLUE, 0);
@@ -607,8 +625,7 @@ void StarTrekEngine::handleAwayMissionAction() {
int i = action.activeObject() - ITEMS_START;
Common::String text = getLoadedText(_itemList[i].textIndex);
showTextbox("", text, 20, 20, TEXTCOLOR_YELLOW, 0);
- }
- else if (action.activeObject() == OBJECT_KIRK)
+ } else if (action.activeObject() == OBJECT_KIRK)
showTextbox("", getLoadedText(GROUNDTX_LOOK_KIRK), 20, 20, TEXTCOLOR_YELLOW, 0);
else if (action.activeObject() == OBJECT_SPOCK)
showTextbox("", getLoadedText(GROUNDTX_LOOK_SPOCK), 20, 20, TEXTCOLOR_YELLOW, 0);
diff --git a/engines/startrek/space.cpp b/engines/startrek/space.cpp
index 965290d..2f5981a 100644
--- a/engines/startrek/space.cpp
+++ b/engines/startrek/space.cpp
@@ -336,7 +336,7 @@ void StarTrekEngine::drawR3Shape(R3 *r3) {
if (top > bottom)
continue;
- if (top > _starfieldRect.bottom - 1) // FIXME
+ if (top > _starfieldRect.bottom - 1)
continue;
if (bottom < _starfieldRect.top)
continue;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index f95897d..7ab582b 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -230,6 +230,14 @@ public:
void loadRoom(const Common::String &missionName, int roomIndex);
void initAwayCrewPositions(int warpEntryIndex);
void handleAwayMissionEvents();
+ void awayMissionLeftClick();
+ /**
+ * Called on right-click (select action), or when certain actions are otherwise
+ * selected (checks whether to show inventory icon, etc)
+ */
+ void awayMissionSelectAction(bool openActionMenu);
+ void awayMissionUseObject(int16 clickedObject);
+ void awayMissionGetLookOrTalk(int16 clickedObject);
void unloadRoom();
int loadActorAnimWithRoomScaling(int actorIndex, const Common::String &animName, int16 x, int16 y);
Fixed8 getActorScaleAtPosition(int16 y);
Commit: 0e85e19ee7530b4d41668982e0b10f04d6f29741
https://github.com/scummvm/scummvm/commit/0e85e19ee7530b4d41668982e0b10f04d6f29741
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Move function descriptions to headers
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/bitmap.h
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/iwfile.cpp
engines/startrek/iwfile.h
engines/startrek/menu.cpp
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/saveload.cpp
engines/startrek/sound.cpp
engines/startrek/sound.h
engines/startrek/sprite.cpp
engines/startrek/sprite.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index c422f80..63a0458 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -463,10 +463,6 @@ void StarTrekEngine::unloadRoom() {
_mapFile.reset();
}
-/**
- * Similar to loadActorAnim, but scale is determined by the y-position in the room. The
- * further up (away) the object is, the smaller it is.
- */
int StarTrekEngine::loadActorAnimWithRoomScaling(int actorIndex, const Common::String &animName, int16 x, int16 y) {
Fixed8 scale = getActorScaleAtPosition(y);
return loadActorAnim(actorIndex, animName, x, y, scale);
@@ -673,14 +669,6 @@ void StarTrekEngine::handleAwayMissionAction() {
}
}
-/**
- * Returns true if the given position is contained in a polygon?
- *
- * The data passed contains the following words in this order:
- * * Index of polygon (unused here)
- * * Number of vertices in polygon
- * * For each vertex: x and y coordinates.
- */
bool StarTrekEngine::isPointInPolygon(int16 *data, int16 x, int16 y) {
int16 numVertices = data[1];
int16 *vertData = &data[2];
@@ -740,10 +728,6 @@ void StarTrekEngine::checkTouchedLoadingZone(int16 x, int16 y) {
_activeWarpHotspot = -1;
}
-/**
- * Updates any nonzero away mission timers, and invokes ACTION_TIMER_EXPIRED when any one
- * reaches 0.
- */
void StarTrekEngine::updateAwayMissionTimers() {
for (int i = 0; i < 8; i++) {
if (_awayMission.timers[i] == 0)
@@ -754,11 +738,6 @@ void StarTrekEngine::updateAwayMissionTimers() {
}
}
-/**
- * Returns true if the given position in the room is solid (not walkable).
- * Reads from a ".map" file which has a bit for each position in the room, which is true
- * when that position is solid.
- */
bool StarTrekEngine::isPositionSolid(int16 x, int16 y) {
assert(x >= 0 && x < SCREEN_WIDTH && y >= 0 && y < SCREEN_HEIGHT);
diff --git a/engines/startrek/bitmap.h b/engines/startrek/bitmap.h
index 8bc9cd2..4ff285c 100644
--- a/engines/startrek/bitmap.h
+++ b/engines/startrek/bitmap.h
@@ -22,23 +22,27 @@ struct Bitmap {
protected:
int32 pixelsArraySize;
- Bitmap() : xoffset(0),yoffset(0),width(0),height(0),pixels(nullptr),pixelsArraySize(0) {}
+ Bitmap() : xoffset(0), yoffset(0), width(0), height(0), pixels(nullptr), pixelsArraySize(0) {}
};
-// TextBitmap is the same as Bitmap, except it stores character indices in its "pixels"
-// array instead of actual pixels.
-// A consequence of this is that the pixels array is smaller than otherwise expected
-// (since width/height still reflect the actual size when drawn).
+/**
+ * TextBitmap is the same as Bitmap, except it stores character indices in its "pixels"
+ * array instead of actual pixels.
+ * A consequence of this is that the pixels array is smaller than otherwise expected
+ * (since width/height still reflect the actual size when drawn).
+ */
struct TextBitmap : Bitmap {
TextBitmap(int w, int h);
};
-// StubBitmap is a bitmap without any actual pixel data. Used as a stub for the
-// "starfield" sprite, which is always in draw mode 1 (invisible), so it never gets drawn;
-// however, it does trigger refreshes on the background in that area, so the game can draw
-// on the background layer manually.
+/**
+ * StubBitmap is a bitmap without any actual pixel data. Used as a stub for the
+ * "starfield" sprite, which is always in draw mode 1 (invisible), so it never gets drawn;
+ * however, it does trigger refreshes on the background in that area, so the game can draw
+ * on the background layer manually.
+ */
struct StubBitmap : Bitmap {
StubBitmap(int w, int h);
};
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 1612dc0..5cbb528 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -118,9 +118,6 @@ void Graphics::clearScreenAndPriBuffer() {
_vm->_system->updateScreen();
}
-/**
- * Note: this doesn't flush the palette to the screen (must call "setPaletteFadeLevel")
- */
void Graphics::loadPalette(const Common::String &paletteName) {
// Set the palette from a PAL file
Common::String palFile = paletteName + ".PAL";
@@ -170,9 +167,6 @@ void Graphics::fadeoutScreen() {
_paletteFadeLevel = 0;
}
-/**
- * This flushes the palette to the screen. fadeLevel ranges from 0-100.
- */
void Graphics::setPaletteFadeLevel(byte *palData, int fadeLevel) {
byte palBuffer[256 * 3];
@@ -239,10 +233,6 @@ Common::Point Graphics::getMousePos() {
return _vm->_system->getEventManager()->getMousePos();
}
-/**
- * The change to the mouse's bitmap won't take effect until drawAllSprites is called
- * again.
- */
void Graphics::setMouseBitmap(SharedPtr<Bitmap> bitmap) {
_mouseBitmap = bitmap;
@@ -250,13 +240,6 @@ void Graphics::setMouseBitmap(SharedPtr<Bitmap> bitmap) {
_lockedMouseSprite.setBitmap(_mouseBitmap);
}
-/**
- * This function is a workaround for when the mouse position needs to be locked in a set
- * position (used in the action menu). This only affects the position it is drawn at; the
- * sprite's "real" position is still updated normally.
- *
- * This does not call updateScreen.
- */
void Graphics::lockMousePosition(int16 x, int16 y) {
if (_mouseLocked) {
if (x != _lockedMouseSprite.pos.x || y != _lockedMouseSprite.pos.y) {
@@ -617,18 +600,12 @@ void Graphics::drawAllSprites(bool updateScreen) {
}
}
-/**
- * Sets "bitmapChanged" to true on all sprites before calling drawAllSprites.
- */
void Graphics::forceDrawAllSprites(bool updateScreen) {
for (int i = 0; i < _numSprites; i++)
_sprites[i]->bitmapChanged = true;
drawAllSprites(updateScreen);
}
-/**
- * Returns the sprite at the given position (ignores mouse).
- */
Sprite *Graphics::getSpriteAt(int16 x, int16 y) {
for (int i = _numSprites - 1; i >= 0; i--) {
Sprite *sprite = _sprites[i];
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 7d48c03..bea8b89 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -63,10 +63,16 @@ public:
byte *getBackgroundPixels();
void clearScreenAndPriBuffer();
+ /**
+ * Note: this doesn't flush the palette to the screen (must call "setPaletteFadeLevel")
+ */
void loadPalette(const String &paletteFile);
void copyRectBetweenBitmaps(Bitmap *destBitmap, int destX, int destY, Bitmap *srcBitmap, int srcX, int srcY, int width, int height);
void fadeinScreen();
void fadeoutScreen();
+ /**
+ * This flushes the palette to the screen. fadeLevel ranges from 0-100.
+ */
void setPaletteFadeLevel(byte *palData, int fadeLevel);
void incPaletteFadeLevel();
void decPaletteFadeLevel();
@@ -78,7 +84,18 @@ public:
SharedPtr<Bitmap> loadBitmap(String basename);
Common::Point getMousePos();
+ /**
+ * Changes the mouse bitmap. The change won't take effect until drawAllSprites is
+ * called again.
+ */
void setMouseBitmap(SharedPtr<Bitmap> bitmap);
+ /**
+ * This function is a workaround for when the mouse position needs to be locked in a set
+ * position (used in the action menu). This only affects the position it is drawn at; the
+ * sprite's "real" position is still updated normally.
+ *
+ * This does not call updateScreen.
+ */
void lockMousePosition(int16 x, int16 y);
void unlockMousePosition();
SharedPtr<Bitmap> getMouseBitmap();
@@ -88,7 +105,13 @@ public:
void drawSprite(const Sprite &sprite, ::Graphics::Surface *surface);
void drawSprite(const Sprite &sprite, ::Graphics::Surface *surface, const Common::Rect &rect);
void drawAllSprites(bool updateScreen=true);
+ /**
+ * Sets "bitmapChanged" to true on all sprites before calling drawAllSprites.
+ */
void forceDrawAllSprites(bool updateScreen=true);
+ /**
+ * Returns the sprite at the given position (ignores mouse).
+ */
Sprite *getSpriteAt(int16 x, int16 y);
Sprite *getSpriteAt(Common::Point p) { return getSpriteAt(p.x, p.y); }
diff --git a/engines/startrek/iwfile.cpp b/engines/startrek/iwfile.cpp
index d97c20e..9e9131f 100644
--- a/engines/startrek/iwfile.cpp
+++ b/engines/startrek/iwfile.cpp
@@ -51,10 +51,6 @@ bool iwSorter(const Common::Point &p1, const Common::Point &p2) {
return p1.y < p2.y;
}
-/**
- * Returns the index of the nearest "key position" in the room that an object can walk to
- * (in a straight line) from a given position.
- */
int IWFile::getClosestKeyPosition(int16 x, int16 y) {
// This is a sorted list of indices from 0 to _numEntries-1.
// The index is stored in Point.x, and the "cost" (distance from position) is stored
diff --git a/engines/startrek/iwfile.h b/engines/startrek/iwfile.h
index ffc5467..16291ad 100644
--- a/engines/startrek/iwfile.h
+++ b/engines/startrek/iwfile.h
@@ -39,6 +39,10 @@ public:
IWFile(StarTrekEngine *vm, const Common::String &filename);
int getNumEntries() { return _numEntries; }
+ /**
+ * Returns the index of the nearest "key position" in the room that an object can walk to
+ * (in a straight line) from a given position.
+ */
int getClosestKeyPosition(int16 x, int16 y);
///< List of "key positions" used for pathing.
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index 39f4c5a..e7d0b9a 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -28,9 +28,6 @@
namespace StarTrek {
-/**
- * Returns the index of the button at the given position, or -1 if none.
- */
int StarTrekEngine::getMenuButtonAt(Sprite *sprites, int numSprites, int x, int y) {
for (int i = 0; i < numSprites; i++) {
const Sprite &spr = sprites[i];
@@ -52,14 +49,6 @@ int StarTrekEngine::getMenuButtonAt(Sprite *sprites, int numSprites, int x, int
return -1;
}
-/**
- * This chooses a sprite from the list to place the mouse cursor at. The sprite it chooses
- * may be, for example, the top-leftmost one in the list. Exact behaviour is determined by
- * the "mode" parameter.
- *
- * If "containMouseSprite" is a valid index, it's ensured that the mouse is contained
- * within it. "mode" should be -1 in this case.
- */
void StarTrekEngine::chooseMousePositionFromSprites(Sprite *sprites, int numSprites, int containMouseSprite, int mode) {
uint16 mouseX1 = 0x7fff; // Candidate positions to warp mouse to
uint16 mouseY1 = 0x7fff;
@@ -167,10 +156,6 @@ void StarTrekEngine::chooseMousePositionFromSprites(Sprite *sprites, int numSpri
}
-/**
- * Draws or removes the outline on menu buttons when the cursor hovers on them, or leaves
- * them.
- */
void StarTrekEngine::drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color) {
int lineWidth = bitmap->width-2;
int offsetToBottom = (bitmap->height-3)*bitmap->width;
@@ -266,9 +251,6 @@ void StarTrekEngine::showOptionsMenu(int x, int y) {
}
}
-/**
- * Show the "action selection" menu, ie. look, talk, etc.
- */
int StarTrekEngine::showActionMenu() {
const int actionMappingUp[] = { // Actions to jump to when up is pressed
ACTION_TALK, // <- ACTION_WALK
@@ -513,9 +495,6 @@ lookupNextAction:
return action;
}
-/**
- * Loads a .MNU file, which is a list of buttons to display.
- */
void StarTrekEngine::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
if (_activeMenu == nullptr)
_keyboardControlsMouseOutsideMenu = _keyboardControlsMouse;
@@ -563,9 +542,6 @@ void StarTrekEngine::loadMenuButtons(String mnuFilename, int xpos, int ypos) {
_keyboardControlsMouse = false;
}
-/**
- * Sets which buttons are visible based on the given bitmask.
- */
void StarTrekEngine::setVisibleMenuButtons(uint32 bits) {
for (int i = 0; i < _activeMenu->numButtons; i++) {
Sprite *sprite = &_activeMenu->sprites[i];
@@ -608,9 +584,6 @@ void StarTrekEngine::setVisibleMenuButtons(uint32 bits) {
}
}
-/**
- * Disables the given bitmask of buttons.
- */
void StarTrekEngine::disableMenuButtons(uint32 bits) {
_activeMenu->disabledButtons |= bits;
if (_activeMenu->selectedButton != -1
@@ -627,10 +600,6 @@ void StarTrekEngine::enableMenuButtons(uint32 bits) {
_activeMenu->disabledButtons &= ~bits;
}
-/**
- * This returns either a special menu event (negative number) or the retval of the button
- * clicked (usually an index, always positive).
- */
int StarTrekEngine::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool inTextbox) {
uint32 tickWhenClickingEnabled = _clockTicks + ticksUntilClickingEnabled;
@@ -886,9 +855,6 @@ void StarTrekEngine::unloadMenuButtons() {
_keyboardControlsMouse = _keyboardControlsMouseOutsideMenu;
}
-/**
- * Sets the mouse bitmap based on which action is selected.
- */
void StarTrekEngine::chooseMouseBitmapForAction(int action, bool withRedOutline) {
const char *lookActionBitmaps[] = {
"lookh0", // The "look" action randomly animates with these images
@@ -1005,10 +971,6 @@ void StarTrekEngine::showGameOverMenu() {
}
}
-/**
- * This can be called from startup or from the options menu.
- * On startup, this tries to load the setting without user input.
- */
void StarTrekEngine::showTextConfigurationMenu(bool fromOptionMenu) {
const char *options[] = { // TODO: languages...
"Text display",
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index a9f8311..9806fed 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -251,9 +251,6 @@ void Room::loadActorStandAnim(int actorIndex) {
}
}
-/**
- * This is exactly the same as "loadActorAnim", but the game calls it at different times?
- */
void Room::loadActorAnim2(int actorIndex, Common::String anim, int16 x, int16 y, uint16 finishedAnimActionParam) {
loadActorAnim(actorIndex, anim, x, y, finishedAnimActionParam);
}
@@ -373,9 +370,6 @@ void Room::walkCrewmanC(int actorIndex, int16 destX, int16 destY, void (Room::*f
}
}
-/**
- * Loads a pair of .map and .iw files to change the room's collisions and pathfinding.
- */
void Room::loadMapFile(const Common::String &name) {
_vm->_mapFilename = name;
_vm->_iwFile.reset();
@@ -418,9 +412,6 @@ Common::Point Room::getActorPos(int actorIndex) {
return _vm->_actorList[actorIndex].pos;
}
-/**
- * Returns a word in range [start, end] (that's inclusive).
- */
int16 Room::getRandomWordInRange(int start, int end) {
return _vm->getRandomWord() % (end - start + 1) + start;
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 937d0ff..19585c3 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -58,26 +58,33 @@ public:
Room(StarTrekEngine *vm, const Common::String &name);
~Room();
- // Helper stuff for RDF access
uint16 readRdfWord(int offset);
- // Scale-related stuff; at the "min Y" position or below, the crewmembers have
- // "minimum" scale; that value rises to the "max scale" value by the time they reach
- // the "max Y" value.
+ /**
+ * Scale-related stuff; at the "min Y" position or below, the crewmembers have
+ * "minimum" scale; that value rises to the "max scale" value by the time they reach
+ * the "max Y" value.
+ */
uint16 getMaxY() { return readRdfWord(0x06); }
uint16 getMinY() { return readRdfWord(0x08); }
Fixed8 getMinScale() { return Fixed8::fromRaw(readRdfWord(0x0a)); }
Fixed8 getMaxScale() { return Fixed8::fromRaw(readRdfWord(0x0c)); }
- // words 0x0e and 0x10 in RDF file are pointers to start and end of event code.
- // That code is instead rewritten on a per-room basis.
+ /**
+ * Check if a particular action is defined for this room.
+ */
bool actionHasCode(const Action &action);
bool actionHasCode(byte type, byte b1, byte b2, byte b3);
+ /**
+ * Execute a particular action for this room, if defined.
+ */
bool handleAction(const Action &action);
bool handleAction(byte type, byte b1, byte b2, byte b3);
- // Same as above, but if any byte in the action is -1 (0xff), it matches any value.
+ /**
+ * Same as above, but if any byte in the action is -1 (0xff), it matches any value.
+ */
bool handleActionWithBitmask(const Action &action);
bool handleActionWithBitmask(byte type, byte b1, byte b2, byte b3);
@@ -90,10 +97,16 @@ public:
uint16 getFirstDoorPolygonOffset() { return readRdfWord(0x1a); }
uint16 getDoorPolygonEndOffset() { return readRdfWord(0x1c); }
+ /**
+ * Get the point at which a crewman beams in to this room (not properly defined for
+ * all rooms).
+ */
Common::Point getBeamInPosition(int crewmanIndex);
- // This is analagous to above, but instead of beaming in, they just appear in a spot.
- // Used sparingly, ie. in feather's serpent when appearing in cave after Quetzecoatl
- // warps the crew.
+ /**
+ * This is analagous to above, but instead of beaming in, they just appear in a spot.
+ * Used sparingly, ie. in feather's serpent when appearing in cave after Quetzecoatl
+ * warps the crew.
+ */
Common::Point getSpawnPosition(int crewmanIndex);
public:
@@ -110,38 +123,106 @@ private:
int findFunctionPointer(int action, void (Room::*funcPtr)());
+
// Interface for room-specific code
- void loadActorAnim(int actorIndex, Common::String anim, int16 x = -1, int16 y = -1, uint16 field66 = 0); // Cmd 0x00
- void loadActorAnimC(int actorIndex, Common::String anim, int16 x, int16 y, void (Room::*funcPtr)());// Cmd 0x00
- void loadActorStandAnim(int actorIndex); // Cmd 0x01
- void loadActorAnim2(int actorIndex, Common::String anim, int16 x = -1, int16 y = -1, uint16 field66 = 0);// Cmd 0x02
- int showRoomSpecificText(const char **textAddr); // (Deprecated, use function below) // Cmd 0x03
- int showText(const TextRef *text); // Cmd 0x03
- int showText(TextRef speaker, TextRef text); // Cmd 0x03
- int showText(TextRef text); // Cmd 0x03
- void giveItem(int item); // Cmd 0x04
+ /**
+ * Cmd 0x00
+ */
+ void loadActorAnim(int actorIndex, Common::String anim, int16 x = -1, int16 y = -1, uint16 field66 = 0);
+ /**
+ * Cmd 0x00
+ */
+ void loadActorAnimC(int actorIndex, Common::String anim, int16 x, int16 y, void (Room::*funcPtr)());
+ /**
+ * Cmd 0x01
+ */
+ void loadActorStandAnim(int actorIndex);
+ /**
+ * Cmd 0x02
+ * This is exactly the same as "loadActorAnim", but the game calls it at different times?
+ */
+ void loadActorAnim2(int actorIndex, Common::String anim, int16 x = -1, int16 y = -1, uint16 field66 = 0);
+ /**
+ * Cmd 0x03
+ */
+ int showRoomSpecificText(const char **textAddr);
+ int showText(const TextRef *text);
+ int showText(TextRef speaker, TextRef text);
+ int showText(TextRef text);
+ /**
+ * Cmd 0x04
+ */
+ void giveItem(int item);
+
// Command 0x05: "demon4ShowSunPuzzle"
- void loadRoomIndex(int roomIndex, int spawnIndex); // Cmd 0x06
- void loseItem(int item); // Cmd 0x07
- void walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam = 0);// Cmd 0x08
+
+ /**
+ * Cmd 0x06
+ */
+ void loadRoomIndex(int roomIndex, int spawnIndex);
+ /**
+ * Cmd 0x07
+ */
+ void loseItem(int item);
+ /**
+ * Cmd 0x08
+ */
+ void walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam = 0);
void walkCrewmanC(int actorIndex, int16 destX, int16 destY, void (Room::*funcPtr)()); // Cmd 0x08
- void loadMapFile(const Common::String &name); // Cmd 0x09
- void showBitmapFor5Ticks(const Common::String &bmpName, int priority); // Cmd 0x0a
+ /**
+ * Cmd 0x09: Loads a pair of .map and .iw files to change the room's collisions and pathfinding.
+ */
+ void loadMapFile(const Common::String &name);
+ /**
+ * Cmd 0x0a
+ */
+ void showBitmapFor5Ticks(const Common::String &bmpName, int priority);
+ /**
+ * Cmd 0x0b
+ */
+ bool haveItem(int item);
+
// Command 0x0c: "demon6ShowCase"
- bool haveItem(int item); // Cmd 0x0b
- Common::Point getActorPos(int actorIndex); // Cmd 0x0d
- int16 getRandomWordInRange(int start, int end); // Cmd 0x0e
- void playSoundEffectIndex(int soundEffect); // Cmd 0x0f
- void playMidiMusicTracks(int startTrack, int loopTrack = -1); // Cmd 0x10
- void endMission(int16 score, int16 arg2, int16 arg3); // Cmd 0x11
- void showGameOverMenu(); // Cmd 0x12
- void playVoc(Common::String filename); // Cmd 0x15
- void stopAllVocSounds(); // Cmd 0x17
+
+ /**
+ * Cmd 0x0d
+ */
+ Common::Point getActorPos(int actorIndex);
+ /**
+ * Cmd 0x0e: Returns a word in range [start, end] (that's inclusive).
+ */
+ int16 getRandomWordInRange(int start, int end);
+ /**
+ * Cmd 0x0f
+ */
+ void playSoundEffectIndex(int soundEffect);
+ /**
+ * Cmd 0x10
+ */
+ void playMidiMusicTracks(int startTrack, int loopTrack = -1);
+ /**
+ * Cmd 0x11
+ */
+ void endMission(int16 score, int16 arg2, int16 arg3);
+ /**
+ * Cmd 0x12
+ */
+ void showGameOverMenu();
+ /**
+ * Cmd 0x15
+ */
+ void playVoc(Common::String filename);
+ /**
+ * Cmd 0x17
+ */
+ void stopAllVocSounds();
// Helper functions for repetitive stuff.
- // If "changeDirection" is true, they remain facing that direction even after their
- // animation is finished. The game is inconsistent about doing this.
+ /**
+ * If "changeDirection" is true, they remain facing that direction even after their
+ * animation is finished. The game is inconsistent about doing this.
+ */
void spockScan(int direction, TextRef text, bool changeDirection = false);
void mccoyScan(int direction, TextRef text, bool changeDirection = false);
diff --git a/engines/startrek/saveload.cpp b/engines/startrek/saveload.cpp
index 3d1a1aa..87f5a8a 100644
--- a/engines/startrek/saveload.cpp
+++ b/engines/startrek/saveload.cpp
@@ -172,10 +172,6 @@ bool StarTrekEngine::loadGame(int slot) {
return true;
}
-/**
- * Call this after loading "saveOrLoadMetadata" to load all the data pertaining to game
- * execution.
- */
bool StarTrekEngine::saveOrLoadGameData(Common::SeekableReadStream *in, Common::WriteStream *out, SavegameMetadata *meta) {
Common::Serializer ser(in, out);
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 3d14149..9db92f8 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -85,9 +85,6 @@ void Sound::clearAllMidiSlots() {
}
}
-/**
- * Plays a midi track as a sound effect (one of midi slots 1-7)
- */
void Sound::playMidiTrack(int track) {
if (!_vm->_musicEnabled || !_vm->_musicWorking)
return;
@@ -261,9 +258,6 @@ void Sound::playSpeech(const Common::String &basename) {
}
}
-/**
- * Called when disabling sfx.
- */
void Sound::stopAllVocSounds() {
stopPlayingSpeech();
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
index f708456..37100b4 100644
--- a/engines/startrek/sound.h
+++ b/engines/startrek/sound.h
@@ -116,6 +116,9 @@ public:
~Sound();
void clearAllMidiSlots();
+ /**
+ * Plays a midi track as a sound effect (one of midi slots 1-7)
+ */
void playMidiTrack(int track);
void playMidiTrackInSlot(int slot, int track);
bool isMidiPlaying();
diff --git a/engines/startrek/sprite.cpp b/engines/startrek/sprite.cpp
index 8961f9c..2d5d4f8 100644
--- a/engines/startrek/sprite.cpp
+++ b/engines/startrek/sprite.cpp
@@ -60,9 +60,7 @@ void Sprite::dontDrawNextFrame() {
field16 = true;
bitmapChanged = true;
}
-/**
- * Returns a rect containing the sprite's bitmap on the screen.
- */
+
Common::Rect Sprite::getRect() {
Common::Rect rect(bitmap->width, bitmap->height);
rect.translate(pos.x - bitmap->xoffset, pos.y - bitmap->yoffset);
diff --git a/engines/startrek/sprite.h b/engines/startrek/sprite.h
index 9b052a1..d498c18 100644
--- a/engines/startrek/sprite.h
+++ b/engines/startrek/sprite.h
@@ -65,6 +65,9 @@ struct Sprite : Common::Serializable {
void setXYAndPriority(int16 x, int16 y, int16 priority);
void dontDrawNextFrame();
+ /**
+ * Returns a rect containing the sprite's bitmap on the screen.
+ */
Common::Rect getRect();
/// NOTE: even after calling this, "bitmap" must be reloaded by the caller.
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index fbbf535..9a553d1 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -577,9 +577,6 @@ void StarTrekEngine::initActors() {
strcpy(_redshirtActor->animationString, "rstnd");
}
-/**
- * Set an actor's animation, position, and scale.
- */
int StarTrekEngine::loadActorAnim(int actorIndex, const Common::String &animName, int16 x, int16 y, Fixed8 scale) {
debugC(6, kDebugGraphics, "Load animation '%s' on actor %d", animName.c_str(), actorIndex);
@@ -606,10 +603,6 @@ int StarTrekEngine::loadActorAnim(int actorIndex, const Common::String &animName
return actorIndex;
}
-/**
- * Tries to make an actor walk to a position.
- * Returns true if successful in initiating the walk.
- */
bool StarTrekEngine::actorWalkToPosition(int actorIndex, const Common::String &animFile, int16 srcX, int16 srcY, int16 destX, int16 destY) {
debugC(6, "Obj %d: walk from (%d,%d) to (%d,%d)", actorIndex, srcX, srcY, destX, destY);
@@ -927,10 +920,6 @@ void StarTrekEngine::updateActorPositionWhileWalking(Actor *actor, int16 x, int1
actor->pos.y = y;
}
-/**
- * Chooses a value for the actor's speed and direction, based on a source position and
- * a destination position it's walking to.
- */
void StarTrekEngine::chooseActorDirectionForWalking(Actor *actor, int16 srcX, int16 srcY, int16 destX, int16 destY) {
actor->granularPosX = srcX;
actor->granularPosY = srcY;
@@ -988,10 +977,6 @@ void StarTrekEngine::chooseActorDirectionForWalking(Actor *actor, int16 srcX, in
}
}
-/**
- * Returns true if an actor can walk directly from a source position to a destination
- * position without running into unwalkable terrain.
- */
bool StarTrekEngine::directPathExists(int16 srcX, int16 srcY, int16 destX, int16 destY) {
int32 distX = destX - srcX;
int32 distY = destY - srcY;
@@ -1096,9 +1081,6 @@ int StarTrekEngine::findObjectAt(int x, int y) {
return -1;
}
-/**
- * Loads a bitmap for the animation frame with the given scale.
- */
SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filename, Fixed8 scale) {
SharedPtr<Bitmap> bitmapToReturn;
@@ -1196,11 +1178,6 @@ SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filen
}
-/**
- * Called when the "get" action is first selected. Returns a selected object.
- * This behaves like other menus in that it holds game execution, but no actual menu pops
- * up; it just waits for the player to select something on the screen.
- */
int StarTrekEngine::selectObjectForUseAction() {
while (true) {
if (!(_awayMission.crewDownBitset & (1 << OBJECT_KIRK)))
@@ -1307,9 +1284,6 @@ Common::String StarTrekEngine::getCrewmanAnimFilename(int actorIndex, const Comm
return crewmanChars[actorIndex] + basename;
}
-/**
- * Checks whether to change the mouse bitmap to have the red outline.
- */
void StarTrekEngine::updateMouseBitmap() {
const bool worksOnCrewmen[] = { // True if the action reacts with crewmen
false, // ACTION_WALK
@@ -1352,10 +1326,6 @@ void StarTrekEngine::updateMouseBitmap() {
chooseMouseBitmapForAction(action, withRedOutline);
}
-/**
- * Checks whether to walk a crewman to a hotspot (the last one obtained from
- * a "findObjectAt" call).
- */
bool StarTrekEngine::walkActiveObjectToHotspot() {
if (!_objectHasWalkPosition)
return false;
@@ -1462,9 +1432,6 @@ void StarTrekEngine::showInventoryIcons(bool showItem) {
_inventoryIconSprite.setBitmap(_gfx->loadBitmap("inv00"));
}
-/**
- * Return true if an object is unselectable with the given action?
- */
bool StarTrekEngine::isObjectUnusable(int object, int action) {
if (action == ACTION_LOOK)
return false;
@@ -1501,9 +1468,6 @@ void StarTrekEngine::hideInventoryIcons() {
}
}
-/**
- * When a crewman is collapsed, they get once a timer reaches 0.
- */
void StarTrekEngine::updateCrewmanGetupTimers() {
if (_awayMission.crewDownBitset == 0)
return;
@@ -1798,11 +1762,6 @@ SharedPtr<Bitmap> StarTrekEngine::scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed8 s
return scaledBitmap;
}
-/**
- * This takes a row of an unscaled bitmap, and copies it to a row of a scaled bitmap.
- * This was heavily optimized in the original game (manually constructed an unrolled
- * loop).
- */
void StarTrekEngine::scaleBitmapRow(byte *src, byte *dest, uint16 origWidth, uint16 scaledWidth) {
if (origWidth >= scaledWidth) {
int16 var2 = (scaledWidth << 1) - origWidth;
@@ -2088,10 +2047,6 @@ uint16 StarTrekEngine::getRandomWord() {
return _randomSource.getRandomNumber(0xffff);
}
-/**
- * ".txt" files are just lists of strings. This traverses the file to get a particular
- * string index.
- */
Common::String StarTrekEngine::getLoadedText(int textIndex) {
SharedPtr<FileStream> txtFile = loadFile(_txtFilename + ".txt");
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 7ab582b..312942a 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -239,6 +239,10 @@ public:
void awayMissionUseObject(int16 clickedObject);
void awayMissionGetLookOrTalk(int16 clickedObject);
void unloadRoom();
+ /**
+ * Similar to loadActorAnim, but scale is determined by the y-position in the room. The
+ * further up (away) the object is, the smaller it is.
+ */
int loadActorAnimWithRoomScaling(int actorIndex, const Common::String &animName, int16 x, int16 y);
Fixed8 getActorScaleAtPosition(int16 y);
void addAction(const Action &action);
@@ -246,9 +250,26 @@ public:
bool checkItemInteractionExists(int action, int activeItem, int passiveItem, int16 arg6);
void handleAwayMissionAction();
+ /**
+ * Returns true if the given position is contained in a polygon.
+ *
+ * The data passed contains the following words in this order:
+ * * Index of polygon (unused here)
+ * * Number of vertices in polygon
+ * * For each vertex: x and y coordinates.
+ */
bool isPointInPolygon(int16 *data, int16 x, int16 y);
void checkTouchedLoadingZone(int16 x, int16 y);
+ /**
+ * Updates any nonzero away mission timers, and invokes ACTION_TIMER_EXPIRED when any one
+ * reaches 0.
+ */
void updateAwayMissionTimers();
+ /**
+ * Returns true if the given position in the room is solid (not walkable).
+ * Reads from a ".map" file which has a bit for each position in the room, which is true
+ * when that position is solid.
+ */
bool isPositionSolid(int16 x, int16 y);
void loadRoomIndex(int roomIndex, int spawnIndex);
@@ -307,7 +328,14 @@ public:
// Actors
void initActors();
+ /**
+ * Set an actor's animation, position, and scale.
+ */
int loadActorAnim(int actorIndex, const Common::String &animName, int16 x, int16 y, Fixed8 scale);
+ /**
+ * Tries to make an actor walk to a position.
+ * Returns true if successful in initiating the walk.
+ */
bool actorWalkToPosition(int actorIndex, const Common::String &animFile, int16 srcX, int16 srcY, int16 destX, int16 destY);
void updateActorAnimations();
void removeActorFromScreen(int actorIndex);
@@ -316,24 +344,58 @@ public:
void releaseAnim(Actor *actor);
void initStandAnim(int actorIndex);
void updateActorPositionWhileWalking(Actor *actor, int16 x, int16 y);
+ /**
+ * Chooses a value for the actor's speed and direction, based on a source position and
+ * a destination position it's walking to.
+ */
void chooseActorDirectionForWalking(Actor *actor, int16 srcX, int16 srcY, int16 destX, int16 destY);
+ /**
+ * Returns true if an actor can walk directly from a source position to a destination
+ * position without running into unwalkable terrain.
+ */
bool directPathExists(int16 srcX, int16 srcY, int16 destX, int16 destY);
int findObjectAt(int x, int y);
int findObjectAt(Common::Point p) { return findObjectAt(p.x, p.y); }
+ /**
+ * Loads a bitmap for the animation frame with the given scale.
+ */
SharedPtr<Bitmap> loadAnimationFrame(const Common::String &filename, Fixed8 scale);
+ /**
+ * Called when the "get" action is first selected. Returns a selected object.
+ * This behaves like other menus in that it holds game execution, but no actual menu pops
+ * up; it just waits for the player to select something on the screen.
+ */
int selectObjectForUseAction();
Common::String getCrewmanAnimFilename(int actorIndex, const Common::String &basename);
+ /**
+ * Checks whether to change the mouse bitmap to have the red outline.
+ */
void updateMouseBitmap();
+ /**
+ * Checks whether to walk a crewman to a hotspot (the last one obtained from
+ * a "findObjectAt" call).
+ */
bool walkActiveObjectToHotspot();
+ /**
+ * Return true if an object is unselectable with the given action?
+ */
bool isObjectUnusable(int objectIndex, int action);
+ /**
+ * When a crewman is collapsed, they get once a timer reaches 0.
+ */
void updateCrewmanGetupTimers();
void showInventoryIcons(bool showItem);
void hideInventoryIcons();
int showInventoryMenu(int x, int y, bool restoreMouse);
void initStarfieldSprite(Sprite *sprite, SharedPtr<Bitmap> bitmap, const Common::Rect &rect);
SharedPtr<Bitmap> scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed8 scale);
+ /**
+ * This takes a row of an unscaled bitmap, and copies it to a row of a scaled bitmap.
+ * This was heavily optimized in the original game (manually constructed an unrolled
+ * loop).
+ */
void scaleBitmapRow(byte *src, byte *dest, uint16 origWidth, uint16 scaledWidth);
// Events
@@ -372,48 +434,123 @@ private:
// text.cpp
public:
+ /**
+ * Gets one line of text (does not include words that won't fit).
+ * Returns position of text to continue from, or nullptr if done.
+ */
const char *getNextTextLine(const char *text, char *line, int lineWidth);
String centerTextboxHeader(String headerText);
void getTextboxHeader(String *headerTextOutput, String speakerText, int choiceIndex);
+ /**
+ * Text getter for showText which reads from an rdf file.
+ * Not really used, since it would require hardcoding text locations in RDF files.
+ * "readTextFromArrayWithChoices" replaces this.
+ */
String readTextFromRdf(int choiceIndex, uintptr data, String *headerTextOutput);
String readTextFromBuffer(int choiceIndex, uintptr data, String *headerTextOutput);
+ /**
+ * Shows text with the given header and main text.
+ */
void showTextbox(String headerText, const String &mainText, int xoffset, int yoffset, byte textColor, int maxTextLines); // TODO: better name. (return type?)
String skipTextAudioPrompt(const String &str);
+ /**
+ * Plays an audio prompt, if it exists, and returns the string starting at the end of the
+ * prompt.
+ */
String playTextAudio(const String &str);
+ /**
+ * @param rclickCancelsChoice If true, right-clicks return "-1" as choice instead of
+ * whatever was selected.
+ */
int showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, bool rclickCancelsChoice);
+ /**
+ * Returns the number of lines this string will take up in a textbox.
+ */
int getNumTextboxLines(const String &str);
String putTextIntoLines(const String &text);
+ /**
+ * Creates a blank textbox in a TextBitmap, and initializes a sprite to use it.
+ */
SharedPtr<TextBitmap> initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite);
+ /**
+ * Draws the "main" text (everything but the header at the top) to a TextBitmap.
+ */
void drawMainText(SharedPtr<TextBitmap> bitmap, int numTextLines, int numTextboxLines, const String &text, bool withHeader);
String readLineFormattedText(TextGetterFunc textGetter, uintptr var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numLines);
+ /**
+ * Text getter for showText which reads choices from an array of pointers.
+ * Last element in the array must be an empty string.
+ */
String readTextFromArray(int choiceIndex, uintptr data, String *headerTextOutput);
+ /**
+ * Similar to above, but shows the choice index when multiple choices are present.
+ * Effectively replaces the "readTextFromRdf" function.
+ */
String readTextFromArrayWithChoices(int choiceIndex, uintptr data, String *headerTextOutput);
// menu.cpp
public:
+ /**
+ * Returns the index of the button at the given position, or -1 if none.
+ */
int getMenuButtonAt(Sprite *sprites, int numSprites, int x, int y);
+ /**
+ * This chooses a sprite from the list to place the mouse cursor at. The sprite it chooses
+ * may be, for example, the top-leftmost one in the list. Exact behaviour is determined by
+ * the "mode" parameter.
+ *
+ * If "containMouseSprite" is a valid index, it's ensured that the mouse is contained
+ * within it. "mode" should be -1 in this case.
+ */
void chooseMousePositionFromSprites(Sprite *sprites, int numSprites, int spriteIndex, int mode);
+ /**
+ * Draws or removes the outline on menu buttons when the cursor hovers on them, or leaves
+ * them.
+ */
void drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color);
void showOptionsMenu(int x, int y);
+ /**
+ * Show the "action selection" menu, ie. look, talk, etc.
+ */
int showActionMenu();
+ /**
+ * Loads a .MNU file, which is a list of buttons to display.
+ */
void loadMenuButtons(String mnuFilename, int xpos, int ypos);
+ /**
+ * Sets which buttons are visible based on the given bitmask.
+ */
void setVisibleMenuButtons(uint32 bits);
+ /**
+ * Disables the given bitmask of buttons.
+ */
void disableMenuButtons(uint32 bits);
void enableMenuButtons(uint32 bits);
+ /**
+ * This returns either a special menu event (negative number) or the retval of the button
+ * clicked (usually an index, always positive).
+ */
int handleMenuEvents(uint32 ticksUntilClickingEnabled, bool inTextbox);
void unloadMenuButtons();
+ /**
+ * Sets the mouse bitmap based on which action is selected.
+ */
void chooseMouseBitmapForAction(int action, bool withRedOutline);
void showQuitGamePrompt(int x, int y);
void showGameOverMenu();
+ /**
+ * This can be called from startup or from the options menu.
+ * On startup, this tries to load the setting without user input.
+ */
void showTextConfigurationMenu(bool fromOptionMenu);
int loadTextDisplayMode();
@@ -437,6 +574,10 @@ public:
bool saveGame(int slot, Common::String desc);
bool loadGame(int slot);
+ /**
+ * Call this after loading "saveOrLoadMetadata" to load all the data pertaining to game
+ * execution.
+ */
bool saveOrLoadGameData(Common::SeekableReadStream *in, Common::WriteStream *out, SavegameMetadata *meta);
Common::String getSavegameFilename(int slotId) const;
@@ -463,6 +604,10 @@ public:
// Misc
uint16 getRandomWord();
+ /**
+ * ".txt" files are just lists of strings. This traverses the file to get a particular
+ * string index.
+ */
Common::String getLoadedText(int textIndex);
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 87ecdb2..0d6d469 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -30,10 +30,6 @@
namespace StarTrek {
-/**
- * Gets one line of text (does not include words that won't fit).
- * Returns position of text to continue from, or nullptr if done.
- */
const char *StarTrekEngine::getNextTextLine(const char *text, char *lineOutput, int lineWidth) {
*lineOutput = '\0';
if (*text == '\0')
@@ -106,11 +102,6 @@ void StarTrekEngine::getTextboxHeader(String *headerTextOutput, String speakerTe
*headerTextOutput = centerTextboxHeader(header);
}
-/**
- * Text getter for showText which reads from an rdf file.
- * Not really used, since it would require hardcoding text locations in RDF files.
- * "readTextFromArrayWithChoices" replaces this.
- */
String StarTrekEngine::readTextFromRdf(int choiceIndex, uintptr data, String *headerTextOutput) {
SharedPtr<Room> room = getRoom();
@@ -137,9 +128,6 @@ String StarTrekEngine::readTextFromRdf(int choiceIndex, uintptr data, String *he
return (char*)&room->_rdfData[textOffset];
}
-/**
- * Shows text with the given header and main text.
- */
void StarTrekEngine::showTextbox(String headerText, const String &mainText, int xoffset, int yoffset, byte textColor, int maxTextLines) {
if (!headerText.empty())
headerText = centerTextboxHeader(headerText);
@@ -180,10 +168,6 @@ String StarTrekEngine::skipTextAudioPrompt(const String &str) {
return String(text+1);
}
-/**
- * Plays an audio prompt, if it exists, and returns the string starting at the end of the
- * prompt.
- */
String StarTrekEngine::playTextAudio(const String &str) {
const char *text = str.c_str();
char soundFile[0x100];
@@ -205,10 +189,6 @@ String StarTrekEngine::playTextAudio(const String &str) {
return String(text+1);
}
-/**
- * @param rclickCancelsChoice If true, right-clicks return "-1" as choice instead of
- * whatever was selected.
- */
int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, bool rclickCancelsChoice) {
int16 tmpTextDisplayMode = _textDisplayMode;
@@ -437,9 +417,6 @@ reloadText:
return choiceIndex;
}
-/**
- * Returns the number of lines this string will take up in a textbox.
- */
int StarTrekEngine::getNumTextboxLines(const String &str) {
const char *text = str.c_str();
char line[TEXTBOX_WIDTH];
@@ -475,9 +452,6 @@ String StarTrekEngine::putTextIntoLines(const String &_text) {
return output;
}
-/**
- * Creates a blank textbox in a TextBitmap, and initializes a sprite to use it.
- */
SharedPtr<TextBitmap> StarTrekEngine::initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite) {
int linesBeforeTextStart = 2;
if (withHeader)
@@ -552,10 +526,6 @@ SharedPtr<TextBitmap> StarTrekEngine::initTextSprite(int *xoffsetPtr, int *yoffs
return bitmap;
}
-/**
- * Draws the "main" text (everything but the header which includes the speaker) to
- * a TextBitmap.
- */
void StarTrekEngine::drawMainText(SharedPtr<TextBitmap> bitmap, int numTextLines, int numTextboxLines, const String &_text, bool withHeader) {
byte *dest = bitmap->pixels + TEXTBOX_WIDTH + 1; // Start of 2nd row
const char *text = _text.c_str();
@@ -631,10 +601,6 @@ String StarTrekEngine::readLineFormattedText(TextGetterFunc textGetter, uintptr
*/
}
-/**
- * Text getter for showText which reads choices from an array of pointers.
- * Last element in the array must be an empty string.
- */
String StarTrekEngine::readTextFromArray(int choiceIndex, uintptr data, String *headerTextOutput) {
const char **textArray = (const char **)data;
@@ -651,10 +617,6 @@ String StarTrekEngine::readTextFromArray(int choiceIndex, uintptr data, String *
return String(mainText);
}
-/**
- * Similar to above, but shows the choice index when multiple choices are present.
- * Effectively replaces the "readTextFromRdf" function.
- */
String StarTrekEngine::readTextFromArrayWithChoices(int choiceIndex, uintptr data, String *headerTextOutput) {
const char **textArray = (const char **)data;
Commit: aa68655742c94026c701dafc1ef6efb032774434
https://github.com/scummvm/scummvm/commit/aa68655742c94026c701dafc1ef6efb032774434
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Formatting corrections
Changed paths:
engines/startrek/filestream.h
engines/startrek/graphics.cpp
engines/startrek/menu.cpp
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/sprite.cpp
engines/startrek/startrek.cpp
engines/startrek/text.cpp
diff --git a/engines/startrek/filestream.h b/engines/startrek/filestream.h
index a3d9381..c5f5ef3 100644
--- a/engines/startrek/filestream.h
+++ b/engines/startrek/filestream.h
@@ -27,7 +27,6 @@
namespace StarTrek {
class FileStream {
-
public:
FileStream(Common::SeekableReadStream *stream, bool bigEndian);
~FileStream();
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 5cbb528..c58f16f 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -298,7 +298,7 @@ void Graphics::drawSprite(const Sprite &sprite, ::Graphics::Surface *surface) {
// sprite's actual, full rectangle.
void Graphics::drawSprite(const Sprite &sprite, ::Graphics::Surface *surface, const Common::Rect &rect) {
Common::Rect spriteRect = Common::Rect(sprite.drawX, sprite.drawY,
- sprite.drawX+sprite.bitmap->width, sprite.drawY+sprite.bitmap->height);
+ sprite.drawX + sprite.bitmap->width, sprite.drawY + sprite.bitmap->height);
assert(_screenRect.contains(rect));
assert(spriteRect.contains(rect));
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index e7d0b9a..e9cebca 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -157,14 +157,14 @@ void StarTrekEngine::chooseMousePositionFromSprites(Sprite *sprites, int numSpri
}
void StarTrekEngine::drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color) {
- int lineWidth = bitmap->width-2;
- int offsetToBottom = (bitmap->height-3)*bitmap->width;
+ int lineWidth = bitmap->width - 2;
+ int offsetToBottom = (bitmap->height - 3) * bitmap->width;
byte *dest = bitmap->pixels + bitmap->width + 1;
while (lineWidth--) {
*dest = color;
- *(dest+offsetToBottom) = color;
+ *(dest + offsetToBottom) = color;
dest++;
}
@@ -175,7 +175,7 @@ void StarTrekEngine::drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color)
while (lineHeight--) {
*dest = color;
- *(dest+offsetToRight) = color;
+ *(dest + offsetToRight) = color;
dest += bitmap->width;
}
}
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 9806fed..fae5250 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -107,7 +107,7 @@ Room::~Room() {
}
uint16 Room::readRdfWord(int offset) {
- return _rdfData[offset] | (_rdfData[offset+1]<<8);
+ return _rdfData[offset] | (_rdfData[offset + 1] << 8);
}
bool Room::actionHasCode(const Action &action) {
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 19585c3..b8d5145 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -53,7 +53,6 @@ const int RDF_BEAM_IN_POSITIONS = 0xaa;
const int RDF_SPAWN_POSITIONS = 0xba;
class Room {
-
public:
Room(StarTrekEngine *vm, const Common::String &name);
~Room();
diff --git a/engines/startrek/sprite.cpp b/engines/startrek/sprite.cpp
index 2d5d4f8..61ff6a5 100644
--- a/engines/startrek/sprite.cpp
+++ b/engines/startrek/sprite.cpp
@@ -26,22 +26,10 @@
namespace StarTrek {
Sprite::Sprite() :
- pos(),
- drawPriority(),
- drawPriority2(),
- field8(),
- bitmap(),
- drawMode(),
- textColor(),
- bitmapChanged(),
- rect2Valid(),
- isOnScreen(),
- field16(),
- lastDrawRect(),
- drawRect(),
- rectangle2(),
- drawX(),
- drawY()
+ pos(), drawPriority(0), drawPriority2(0), field8(0),
+ bitmap(), drawMode(0), textColor(0), bitmapChanged(false),
+ rect2Valid(false), isOnScreen(false), field16(false), lastDrawRect(),
+ drawRect(), rectangle2(), drawX(0), drawY(0)
{}
void Sprite::setBitmap(SharedPtr<Bitmap> b) {
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 9a553d1..f678d21 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -1085,7 +1085,7 @@ SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filen
SharedPtr<Bitmap> bitmapToReturn;
char basename[5];
- strncpy(basename, filename.c_str()+1, 4);
+ strncpy(basename, filename.c_str() + 1, 4);
basename[4] = '\0';
char c = filename[0];
@@ -1841,7 +1841,7 @@ SharedPtr<FileStream> StarTrekEngine::loadFile(Common::String filename, int file
basename = filename;
extension = filename;
basename.replace(i, filename.size()-i, "");
- extension.replace(0, i+1, "");
+ extension.replace(0, i + 1, "");
break;
}
}
@@ -1927,8 +1927,8 @@ SharedPtr<FileStream> StarTrekEngine::loadFile(Common::String filename, int file
// the last character being incremented by one.
if ((basename.lastChar() >= '1' && basename.lastChar() <= '9') ||
(basename.lastChar() >= 'B' && basename.lastChar() <= 'Z')) {
- basename.setChar(basename.lastChar()-1, basename.size()-1);
- return loadFile(basename + "." + extension, fileIndex+1);
+ basename.setChar(basename.lastChar() - 1, basename.size() - 1);
+ return loadFile(basename + "." + extension, fileIndex + 1);
} else
error("Could not find file \'%s\'", filename.c_str());
}
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 0d6d469..b53b0b9 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -68,7 +68,7 @@ const char *StarTrekEngine::getNextTextLine(const char *text, char *lineOutput,
}
if (*text == ' ') {
*lineOutput = '\0';
- return text+1;
+ return text + 1;
}
if (lastSpaceOutput == nullptr) { // Long word couldn't fit on line
*lineOutput = '\0';
@@ -165,7 +165,7 @@ String StarTrekEngine::skipTextAudioPrompt(const String &str) {
text++;
}
- return String(text+1);
+ return String(text + 1);
}
String StarTrekEngine::playTextAudio(const String &str) {
@@ -186,7 +186,7 @@ String StarTrekEngine::playTextAudio(const String &str) {
soundFile[len] = '\0';
playSpeech(soundFile);
- return String(text+1);
+ return String(text + 1);
}
int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, bool rclickCancelsChoice) {
Commit: fe98dbb69d1f8222eeb391111f59670658b0daad
https://github.com/scummvm/scummvm/commit/fe98dbb69d1f8222eeb391111f59670658b0daad
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Reformat with artistic style
Changed paths:
engines/startrek/action.h
engines/startrek/awaymission.cpp
engines/startrek/bitmap.cpp
engines/startrek/common.cpp
engines/startrek/common.h
engines/startrek/detection.cpp
engines/startrek/events.cpp
engines/startrek/filestream.cpp
engines/startrek/font.h
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/iwfile.h
engines/startrek/lzss.cpp
engines/startrek/lzss.h
engines/startrek/menu.cpp
engines/startrek/object.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/demon0.cpp
engines/startrek/rooms/demon1.cpp
engines/startrek/rooms/demon3.cpp
engines/startrek/rooms/demon4.cpp
engines/startrek/rooms/demon5.cpp
engines/startrek/rooms/demon6.cpp
engines/startrek/rooms/feather1.cpp
engines/startrek/rooms/feather3.cpp
engines/startrek/rooms/feather4.cpp
engines/startrek/rooms/feather5.cpp
engines/startrek/rooms/feather6.cpp
engines/startrek/rooms/love1.cpp
engines/startrek/rooms/love3.cpp
engines/startrek/rooms/love4.cpp
engines/startrek/rooms/love5.cpp
engines/startrek/rooms/lovea.cpp
engines/startrek/rooms/mudd0.cpp
engines/startrek/rooms/mudd1.cpp
engines/startrek/rooms/mudd2.cpp
engines/startrek/rooms/mudd4.cpp
engines/startrek/rooms/mudda.cpp
engines/startrek/rooms/trial5.cpp
engines/startrek/rooms/tug2.cpp
engines/startrek/rooms/tug3.cpp
engines/startrek/saveload.cpp
engines/startrek/sound.cpp
engines/startrek/sound.h
engines/startrek/space.cpp
engines/startrek/sprite.cpp
engines/startrek/sprite.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
engines/startrek/text.cpp
engines/startrek/text.h
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
index 3ae507e..4b8409e 100644
--- a/engines/startrek/action.h
+++ b/engines/startrek/action.h
@@ -60,8 +60,12 @@ struct Action {
byte b3;
// ACTION_USE, ACTION_GET, ACTION_LOOK, ACTION_TALK
- byte activeObject() const { return b1; }
- byte passiveObject() const { return b2; }
+ byte activeObject() const {
+ return b1;
+ }
+ byte passiveObject() const {
+ return b2;
+ }
bool operator==(const Action &a) const {
return type == a.type && b1 == a.b1 && b2 == a.b2 && b3 == a.b3;
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 63a0458..41533d7 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -404,7 +404,7 @@ void StarTrekEngine::awayMissionUseObject(int16 clickedObject) {
tryWalkToHotspot = true;
else if (_awayMission.activeObject == OBJECT_MCCOY && _room->actionHasCode(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0))
tryWalkToHotspot = true;
- else if (_awayMission.activeObject == OBJECT_SPOCK &&_room->actionHasCode(ACTION_USE, OBJECT_ISTRICOR, _awayMission.passiveObject, 0))
+ else if (_awayMission.activeObject == OBJECT_SPOCK && _room->actionHasCode(ACTION_USE, OBJECT_ISTRICOR, _awayMission.passiveObject, 0))
tryWalkToHotspot = true;
if (!tryWalkToHotspot) {
@@ -694,7 +694,7 @@ void StarTrekEngine::checkTouchedLoadingZone(int16 x, int16 y) {
int16 offset = _room->getFirstDoorPolygonOffset();
while (offset != _room->getDoorPolygonEndOffset()) {
- if (isPointInPolygon((int16*)(_room->_rdfData + offset), x, y)) {
+ if (isPointInPolygon((int16 *)(_room->_rdfData + offset), x, y)) {
uint16 var = _room->readRdfWord(offset);
if (_activeDoorWarpHotspot != var) {
_activeDoorWarpHotspot = var;
@@ -712,7 +712,7 @@ void StarTrekEngine::checkTouchedLoadingZone(int16 x, int16 y) {
offset = _room->getFirstWarpPolygonOffset();
while (offset != _room->getWarpPolygonEndOffset()) {
- if (isPointInPolygon((int16*)(_room->_rdfData + offset), x, y)) {
+ if (isPointInPolygon((int16 *)(_room->_rdfData + offset), x, y)) {
uint16 var = _room->readRdfWord(offset);
if (_activeWarpHotspot != var) {
_activeWarpHotspot = var;
diff --git a/engines/startrek/bitmap.cpp b/engines/startrek/bitmap.cpp
index 2e6eb78..812b61a 100644
--- a/engines/startrek/bitmap.cpp
+++ b/engines/startrek/bitmap.cpp
@@ -46,7 +46,7 @@ Bitmap::Bitmap(const Bitmap &bitmap) {
}
Bitmap::Bitmap(int w, int h) : width(w), height(h), xoffset(0), yoffset(0) {
- pixels = new byte[width*height];
+ pixels = new byte[width * height];
}
Bitmap::~Bitmap() {
diff --git a/engines/startrek/common.cpp b/engines/startrek/common.cpp
index a742860..211a2f7 100644
--- a/engines/startrek/common.cpp
+++ b/engines/startrek/common.cpp
@@ -32,7 +32,7 @@ Common::Rect getRectEncompassing(Common::Rect r1, Common::Rect r2) {
uint16 r = max(r1.right, r2.right);
uint16 b = max(r1.bottom, r2.bottom);
- return Common::Rect(l,t,r,b);
+ return Common::Rect(l, t, r, b);
}
void serializeRect(Common::Rect rect, Common::Serializer &ser) {
diff --git a/engines/startrek/common.h b/engines/startrek/common.h
index 290772f..1267364 100644
--- a/engines/startrek/common.h
+++ b/engines/startrek/common.h
@@ -33,10 +33,14 @@ class Serializer;
namespace StarTrek {
template<class T>
-T min(T a, T b) { return a < b ? a : b; }
+T min(T a, T b) {
+ return a < b ? a : b;
+}
template<class T>
-T max(T a, T b) { return a > b ? a : b; }
+T max(T a, T b) {
+ return a > b ? a : b;
+}
Common::Rect getRectEncompassing(Common::Rect r1, Common::Rect r2);
void serializeRect(Common::Rect rect, Common::Serializer &ser);
diff --git a/engines/startrek/detection.cpp b/engines/startrek/detection.cpp
index ebeb30a..0cdc0ef 100644
--- a/engines/startrek/detection.cpp
+++ b/engines/startrek/detection.cpp
@@ -92,7 +92,7 @@ static const StarTrekGameDescription gameDescriptions[] = {
0,
0,
},
-
+
{
{
"st25",
@@ -107,7 +107,7 @@ static const StarTrekGameDescription gameDescriptions[] = {
0,
0,
},
-
+
{
{
"st25",
@@ -122,7 +122,7 @@ static const StarTrekGameDescription gameDescriptions[] = {
0,
0,
},
-
+
{
{
"st25",
@@ -137,7 +137,7 @@ static const StarTrekGameDescription gameDescriptions[] = {
0,
0,
},
-
+
{
{
"st25",
@@ -152,7 +152,7 @@ static const StarTrekGameDescription gameDescriptions[] = {
0,
0,
},
-
+
{
{
"st25",
@@ -167,7 +167,7 @@ static const StarTrekGameDescription gameDescriptions[] = {
0,
0,
},
-
+
{
{
"st25",
@@ -197,7 +197,7 @@ static const StarTrekGameDescription gameDescriptions[] = {
GF_DEMO,
0,
},
-
+
{
{
"stjr",
@@ -211,8 +211,8 @@ static const StarTrekGameDescription gameDescriptions[] = {
GType_STJR,
0,
0,
- },
-
+ },
+
{ AD_TABLE_END_MARKER, 0, 0, 0 }
};
@@ -250,14 +250,14 @@ bool StarTrekMetaEngine::hasFeature(MetaEngineFeature f) const {
(f == kSavesSupportThumbnail) ||
(f == kSavesSupportCreationDate) ||
(f == kSavesSupportPlayTime) ||
- (f == kSimpleSavesNames);
+ (f == kSimpleSavesNames);
}
bool StarTrekMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
const StarTrek::StarTrekGameDescription *gd = (const StarTrek::StarTrekGameDescription *)desc;
-
+
*engine = new StarTrek::StarTrekEngine(syst, gd);
-
+
return (gd != 0);
}
@@ -304,7 +304,9 @@ SaveStateList StarTrekMetaEngine::listSaves(const char *target) const {
}
-int StarTrekMetaEngine::getMaximumSaveSlot() const { return 999; }
+int StarTrekMetaEngine::getMaximumSaveSlot() const {
+ return 999;
+}
void StarTrekMetaEngine::removeSaveState(const char *target, int slot) const {
Common::String fileName = Common::String::format("%s.%03d", target, slot);
@@ -372,8 +374,8 @@ SaveStateDescriptor StarTrekMetaEngine::querySaveMetaInfos(const char *target, i
#if PLUGIN_ENABLED_DYNAMIC(STARTREK)
- REGISTER_PLUGIN_DYNAMIC(STARTREK, PLUGIN_TYPE_ENGINE, StarTrekMetaEngine);
+REGISTER_PLUGIN_DYNAMIC(STARTREK, PLUGIN_TYPE_ENGINE, StarTrekMetaEngine);
#else
- REGISTER_PLUGIN_STATIC(STARTREK, PLUGIN_TYPE_ENGINE, StarTrekMetaEngine);
+REGISTER_PLUGIN_STATIC(STARTREK, PLUGIN_TYPE_ENGINE, StarTrekMetaEngine);
#endif
diff --git a/engines/startrek/events.cpp b/engines/startrek/events.cpp
index 6315899..a78a417 100644
--- a/engines/startrek/events.cpp
+++ b/engines/startrek/events.cpp
@@ -161,7 +161,7 @@ bool StarTrekEngine::popNextEvent(TrekEvent *e, bool poll) {
void StarTrekEngine::addEventToQueue(const TrekEvent &e) {
if (e.type == TREKEVENT_MOUSEMOVE && _mouseMoveEventInQueue) {
// Only allow one mouse move event at once
- for (Common::List<TrekEvent>::iterator i = _eventQueue.begin(); i!=_eventQueue.end(); i++) {
+ for (Common::List<TrekEvent>::iterator i = _eventQueue.begin(); i != _eventQueue.end(); i++) {
if (i->type == TREKEVENT_MOUSEMOVE) {
*i = e;
return;
diff --git a/engines/startrek/filestream.cpp b/engines/startrek/filestream.cpp
index ed54744..faae962 100644
--- a/engines/startrek/filestream.cpp
+++ b/engines/startrek/filestream.cpp
@@ -18,7 +18,7 @@ FileStream::~FileStream() {
// ReadStream functions
-uint32 FileStream::read(void* dataPtr, uint32 dataSize) {
+uint32 FileStream::read(void *dataPtr, uint32 dataSize) {
if (_pos + dataSize > (uint32)size())
dataSize = size() - _pos;
memcpy(dataPtr, _data + _pos, dataSize);
diff --git a/engines/startrek/font.h b/engines/startrek/font.h
index 62a354c..1353acc 100644
--- a/engines/startrek/font.h
+++ b/engines/startrek/font.h
@@ -25,9 +25,9 @@
#ifndef STARTREK_FONT_H
#define STARTREK_FONT_H
-
+
#include "startrek/startrek.h"
-
+
namespace StarTrek {
class StarTrekEngine;
@@ -38,7 +38,7 @@ public:
~Font();
byte *getCharData(int i);
-
+
private:
StarTrekEngine *_vm;
@@ -48,6 +48,6 @@ private:
};
-}
+}
#endif
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index c58f16f..6e8c97f 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -79,7 +79,7 @@ void Graphics::setBackgroundImage(SharedPtr<Bitmap> bitmap) {
void Graphics::drawBitmapToBackground(const Common::Rect &origRect, const Common::Rect &drawRect, SharedPtr<Bitmap> bitmap) {
byte *dest = _backgroundImage->pixels + drawRect.top * SCREEN_WIDTH + drawRect.left;
byte *src = bitmap->pixels + (drawRect.left - origRect.left)
- + (drawRect.top - origRect.top) * bitmap->width;
+ + (drawRect.top - origRect.top) * bitmap->width;
for (int y = drawRect.top; y < drawRect.bottom; y++) {
for (int x = drawRect.left; x < drawRect.right; x++) {
@@ -298,19 +298,19 @@ void Graphics::drawSprite(const Sprite &sprite, ::Graphics::Surface *surface) {
// sprite's actual, full rectangle.
void Graphics::drawSprite(const Sprite &sprite, ::Graphics::Surface *surface, const Common::Rect &rect) {
Common::Rect spriteRect = Common::Rect(sprite.drawX, sprite.drawY,
- sprite.drawX + sprite.bitmap->width, sprite.drawY + sprite.bitmap->height);
+ sprite.drawX + sprite.bitmap->width, sprite.drawY + sprite.bitmap->height);
assert(_screenRect.contains(rect));
assert(spriteRect.contains(rect));
- byte *dest = (byte*)surface->getPixels() + rect.top*SCREEN_WIDTH + rect.left;
+ byte *dest = (byte *)surface->getPixels() + rect.top * SCREEN_WIDTH + rect.left;
- switch(sprite.drawMode) {
+ switch (sprite.drawMode) {
case 0: { // Normal sprite
byte *src = sprite.bitmap->pixels + (rect.left - sprite.drawX)
- + (rect.top - sprite.drawY) * sprite.bitmap->width;
+ + (rect.top - sprite.drawY) * sprite.bitmap->width;
- int priOffset = rect.top*SCREEN_WIDTH + rect.left;
+ int priOffset = rect.top * SCREEN_WIDTH + rect.left;
for (int y = rect.top; y < rect.bottom; y++) {
for (int x = rect.left; x < rect.right; x++) {
@@ -342,7 +342,7 @@ void Graphics::drawSprite(const Sprite &sprite, ::Graphics::Surface *surface, co
case 2: { // Normal sprite with darkened background for "transparent" pixels (and no priority)
byte *src = sprite.bitmap->pixels + (rect.left - sprite.drawX)
- + (rect.top - sprite.drawY) * sprite.bitmap->width;
+ + (rect.top - sprite.drawY) * sprite.bitmap->width;
for (int y = rect.top; y < rect.bottom; y++) {
for (int x = rect.left; x < rect.right; x++) {
@@ -380,13 +380,13 @@ void Graphics::drawSprite(const Sprite &sprite, ::Graphics::Surface *surface, co
int drawWidth = rectangle1.width();
int drawHeight = rectangle1.height();
- dest = (byte*)surface->getPixels() + sprite.drawY*SCREEN_WIDTH + sprite.drawX
- + rectangle1.top*8*SCREEN_WIDTH + rectangle1.left*8;
+ dest = (byte *)surface->getPixels() + sprite.drawY * SCREEN_WIDTH + sprite.drawX
+ + rectangle1.top * 8 * SCREEN_WIDTH + rectangle1.left * 8;
byte *src = sprite.bitmap->pixels + rectangle1.top * sprite.bitmap->width / 8 + rectangle1.left;
- for (int y=0; y < drawHeight; y++) {
- for (int x=0; x < drawWidth; x++) {
+ for (int y = 0; y < drawHeight; y++) {
+ for (int x = 0; x < drawWidth; x++) {
byte c = *src;
int textColor;
@@ -456,7 +456,7 @@ void Graphics::drawAllSprites(bool updateScreen) {
Common::sort(_sprites, _sprites + _numSprites, &compareSpritesByLayer);
// Update sprite rectangles
- for (int i=0; i<_numSprites; i++) {
+ for (int i = 0; i < _numSprites; i++) {
Sprite *spr = _sprites[i];
Common::Rect rect;
@@ -483,15 +483,13 @@ void Graphics::drawAllSprites(bool updateScreen) {
spr->rectangle2 = getRectEncompassing(spr->drawRect, spr->lastDrawRect);
spr->rect2Valid = 1;
}
- }
- else {
+ } else {
spr->rectangle2 = spr->drawRect;
spr->rect2Valid = 1;
}
spr->isOnScreen = 1;
- }
- else { // Off-screen
+ } else { // Off-screen
spr->rect2Valid = 0;
spr->isOnScreen = 0;
}
@@ -508,13 +506,11 @@ void Graphics::drawAllSprites(bool updateScreen) {
if (spr->isOnScreen) {
if (spr->rect2Valid) {
dirtyRects[numDirtyRects++] = spr->rectangle2;
- }
- else {
+ } else {
dirtyRects[numDirtyRects++] = spr->drawRect;
dirtyRects[numDirtyRects++] = spr->lastDrawRect;
}
- }
- else {
+ } else {
dirtyRects[numDirtyRects++] = spr->lastDrawRect;
}
}
@@ -584,8 +580,7 @@ void Graphics::drawAllSprites(bool updateScreen) {
if (_mouseToBeShown) {
CursorMan.showMouse(true);
_mouseToBeShown = false;
- }
- else if (_mouseToBeHidden) {
+ } else if (_mouseToBeHidden) {
CursorMan.showMouse(false);
_mouseToBeHidden = false;
}
@@ -650,7 +645,7 @@ void Graphics::addSprite(Sprite *sprite) {
}
void Graphics::delSprite(Sprite *sprite) {
- for (int i=0; i<_numSprites; i++) {
+ for (int i = 0; i < _numSprites; i++) {
if (sprite != _sprites[i])
continue;
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index bea8b89..ecef5fc 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -50,7 +50,7 @@ class Graphics {
public:
Graphics(StarTrekEngine *vm);
~Graphics();
-
+
void setBackgroundImage(SharedPtr<Bitmap> bitmap);
/**
* @param origRect The rectangle containing the original bitmap (must contain the
@@ -104,20 +104,22 @@ public:
void drawTextChar(::Graphics::Surface *surface, const Sprite &sprite, int x, int y, const Common::Rect &rect);
void drawSprite(const Sprite &sprite, ::Graphics::Surface *surface);
void drawSprite(const Sprite &sprite, ::Graphics::Surface *surface, const Common::Rect &rect);
- void drawAllSprites(bool updateScreen=true);
+ void drawAllSprites(bool updateScreen = true);
/**
* Sets "bitmapChanged" to true on all sprites before calling drawAllSprites.
*/
- void forceDrawAllSprites(bool updateScreen=true);
+ void forceDrawAllSprites(bool updateScreen = true);
/**
* Returns the sprite at the given position (ignores mouse).
*/
Sprite *getSpriteAt(int16 x, int16 y);
- Sprite *getSpriteAt(Common::Point p) { return getSpriteAt(p.x, p.y); }
+ Sprite *getSpriteAt(Common::Point p) {
+ return getSpriteAt(p.x, p.y);
+ }
void addSprite(Sprite *sprite);
void delSprite(Sprite *sprite);
-
+
// Save/load the current state of sprites. Can only push once for now.
void pushSprites();
void popSprites();
@@ -126,11 +128,11 @@ public:
void drawDirectToScreen(SharedPtr<Bitmap> bitmap);
void loadEGAData(const char *egaFile);
void drawBackgroundImage(const char *filename);
-
+
private:
StarTrekEngine *_vm;
Font *_font;
-
+
bool _egaMode;
byte *_egaData;
byte *_palData;
diff --git a/engines/startrek/iwfile.h b/engines/startrek/iwfile.h
index 16291ad..3f230ff 100644
--- a/engines/startrek/iwfile.h
+++ b/engines/startrek/iwfile.h
@@ -38,7 +38,9 @@ class IWFile {
public:
IWFile(StarTrekEngine *vm, const Common::String &filename);
- int getNumEntries() { return _numEntries; }
+ int getNumEntries() {
+ return _numEntries;
+ }
/**
* Returns the index of the nearest "key position" in the room that an object can walk to
* (in a straight line) from a given position.
diff --git a/engines/startrek/lzss.cpp b/engines/startrek/lzss.cpp
index 2e04d08..bc7e889 100644
--- a/engines/startrek/lzss.cpp
+++ b/engines/startrek/lzss.cpp
@@ -73,7 +73,7 @@ Common::SeekableReadStream *decodeLZSS(Common::SeekableReadStream *indata, uint3
}
}
- delete[] histbuff;
+ delete[] histbuff;
if (outstreampos != uncompressedSize)
error("Size mismatch in LZSS decompression; expected %d bytes, got %d bytes", uncompressedSize, outstreampos);
diff --git a/engines/startrek/lzss.h b/engines/startrek/lzss.h
index 293a689..1599812 100644
--- a/engines/startrek/lzss.h
+++ b/engines/startrek/lzss.h
@@ -32,24 +32,24 @@ Common::SeekableReadStream *decodeLZSS(Common::SeekableReadStream *indata, uint3
/*
class LzssReadStream : public Common::SeekableReadStream {
private:
- uint8 *_outLzssBufData;
- uint32 _size;
- uint32 _pos;
+ uint8 *_outLzssBufData;
+ uint32 _size;
+ uint32 _pos;
- uint32 decodeLZSS(Common::ReadStream *in, uint8 lengthmask, uint8 lengthbits);
+ uint32 decodeLZSS(Common::ReadStream *in, uint8 lengthmask, uint8 lengthbits);
public:
- LzssReadStream(Common::ReadStream *indata, uint8 lengthmask, uint8 lengthbits);
- ~LzssReadStream();
-
- bool eos() const;
- uint32 read(void *buf, uint32 length);
- int32 pos() const { return _pos; }
- int32 size() const { return _size; }
- bool seek(int32 offset, int whence) {
- // TODO
- return false;
- }
+ LzssReadStream(Common::ReadStream *indata, uint8 lengthmask, uint8 lengthbits);
+ ~LzssReadStream();
+
+ bool eos() const;
+ uint32 read(void *buf, uint32 length);
+ int32 pos() const { return _pos; }
+ int32 size() const { return _size; }
+ bool seek(int32 offset, int whence) {
+ // TODO
+ return false;
+ }
};
*/
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index e9cebca..2251588 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -62,7 +62,7 @@ void StarTrekEngine::chooseMousePositionFromSprites(Sprite *sprites, int numSpri
Common::Rect rect = sprites[containMouseSprite].getRect();
if (mousePos.x < rect.left || mousePos.x >= rect.right
- || mousePos.y < rect.top || mousePos.y >= rect.bottom) {
+ || mousePos.y < rect.top || mousePos.y >= rect.bottom) {
mousePos.x = (rect.left + rect.right) / 2;
mousePos.y = (rect.top + rect.bottom) / 2;
}
@@ -80,14 +80,14 @@ void StarTrekEngine::chooseMousePositionFromSprites(Sprite *sprites, int numSpri
int vCenter = (rect.top + rect.bottom) / 2;
// Choose which sprite is closest based on certain criteria?
- switch(mode) {
+ switch (mode) {
case 0: // Choose topmost, leftmost sprite that's below the cursor
if (((vCenter == mousePos.y && hCenter > mousePos.x) || vCenter > mousePos.y)
- && (vCenter < mouseY1 || (vCenter == mouseY1 && hCenter < mouseX1))) {
+ && (vCenter < mouseY1 || (vCenter == mouseY1 && hCenter < mouseX1))) {
mouseX1 = hCenter;
mouseY1 = vCenter;
}
- // fall through
+ // fall through
case 4: // Choose topmost, leftmost sprite
if (vCenter < mouseY2 || (vCenter == mouseY2 && hCenter < mouseX2)) {
@@ -98,16 +98,16 @@ void StarTrekEngine::chooseMousePositionFromSprites(Sprite *sprites, int numSpri
case 1: // Choose bottommost, rightmost sprite that's above the cursor
if (((vCenter == mousePos.y && hCenter < mousePos.x) || vCenter < mousePos.y)
- && (mouseY1 == 0x7fff || vCenter > mouseY1
- || (vCenter == mouseY1 && hCenter > mouseX1))) {
+ && (mouseY1 == 0x7fff || vCenter > mouseY1
+ || (vCenter == mouseY1 && hCenter > mouseX1))) {
mouseX1 = hCenter;
mouseY1 = vCenter;
}
- // fall through
+ // fall through
case 5: // Choose bottommost, rightmost sprite
if (mouseY2 == 0x7fff || vCenter > mouseY2
- || (vCenter == mouseY2 && hCenter > mouseX2)) {
+ || (vCenter == mouseY2 && hCenter > mouseX2)) {
mouseX2 = hCenter;
mouseY2 = vCenter;
}
@@ -116,12 +116,12 @@ void StarTrekEngine::chooseMousePositionFromSprites(Sprite *sprites, int numSpri
case 2:
// This seems broken... OR condition on first line has no affect on the logic...
if ((vCenter < mousePos.y || (vCenter == mouseY1 && hCenter == mousePos.x))
- && (mouseX1 == 0x7fff || vCenter >= mouseY1)) {
+ && (mouseX1 == 0x7fff || vCenter >= mouseY1)) {
mouseX1 = hCenter;
mouseY1 = vCenter;
}
if (mouseX2 == 0x7fff || vCenter > mouseY2
- || (hCenter == mouseX2 && vCenter == mouseY2)) {
+ || (hCenter == mouseX2 && vCenter == mouseY2)) {
mouseX2 = hCenter;
mouseY2 = vCenter;
}
@@ -130,12 +130,12 @@ void StarTrekEngine::chooseMousePositionFromSprites(Sprite *sprites, int numSpri
case 3:
// Similar to above...
if ((vCenter > mousePos.y || (vCenter == mouseY1 && hCenter == mousePos.x))
- && (mouseX1 == 0x7fff || vCenter <= mouseY1)) {
+ && (mouseX1 == 0x7fff || vCenter <= mouseY1)) {
mouseX1 = hCenter;
mouseY1 = vCenter;
}
if (mouseX2 == 0x7fff || vCenter < mouseY2
- || (hCenter == mouseX2 && vCenter == mouseY2)) {
+ || (hCenter == mouseX2 && vCenter == mouseY2)) {
mouseX2 = hCenter;
mouseY2 = vCenter;
}
@@ -221,7 +221,7 @@ void StarTrekEngine::showOptionsMenu(int x, int y) {
// Can't use OPTIONBUTTON constants since the button retvals differ from the button
// indices...
- switch(event) {
+ switch (event) {
case 0: // Save
showSaveMenu();
break;
@@ -342,8 +342,7 @@ selectAndExit:
break;
case TREKEVENT_MOUSEMOVE:
-mousePosChanged:
- {
+mousePosChanged: {
Common::Point mouse = _gfx->getMousePos();
Common::Point relMouse(mouse.x - pos.x, mouse.y - pos.y);
@@ -587,7 +586,7 @@ void StarTrekEngine::setVisibleMenuButtons(uint32 bits) {
void StarTrekEngine::disableMenuButtons(uint32 bits) {
_activeMenu->disabledButtons |= bits;
if (_activeMenu->selectedButton != -1
- && (_activeMenu->disabledButtons & (1 << _activeMenu->selectedButton))) {
+ && (_activeMenu->disabledButtons & (1 << _activeMenu->selectedButton))) {
Sprite *sprite = &_activeMenu->sprites[_activeMenu->selectedButton];
drawMenuButtonOutline(sprite->bitmap, 0x00);
@@ -606,13 +605,13 @@ int StarTrekEngine::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool inTe
while (true) {
TrekEvent event;
while (popNextEvent(&event)) {
- switch(event.type) {
+ switch (event.type) {
case TREKEVENT_TICK: {
Common::Point mousePos = _gfx->getMousePos();
int buttonIndex = getMenuButtonAt(_activeMenu->sprites, _activeMenu->numButtons, mousePos.x, mousePos.y);
if (buttonIndex != -1) {
- if (_activeMenu->disabledButtons & (1<<buttonIndex))
+ if (_activeMenu->disabledButtons & (1 << buttonIndex))
buttonIndex = -1;
}
@@ -689,7 +688,7 @@ rclick:
case Common::KEYCODE_SPACE:
if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_NEXTCHOICE))
- && _activeMenu->sprites[TEXTBUTTON_NEXTCHOICE].drawMode == 2) {
+ && _activeMenu->sprites[TEXTBUTTON_NEXTCHOICE].drawMode == 2) {
playSoundEffectIndex(SND_SELECTION);
return TEXTBUTTON_NEXTCHOICE;
}
@@ -698,7 +697,7 @@ rclick:
case Common::KEYCODE_HOME:
case Common::KEYCODE_KP7:
if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_SCROLLUP))
- && _activeMenu->sprites[TEXTBUTTON_SCROLLUP].drawMode == 2) {
+ && _activeMenu->sprites[TEXTBUTTON_SCROLLUP].drawMode == 2) {
playSoundEffectIndex(SND_SELECTION);
return TEXTBUTTON_GOTO_TOP;
}
@@ -707,7 +706,7 @@ rclick:
case Common::KEYCODE_UP:
case Common::KEYCODE_KP8:
if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_SCROLLUP))
- && _activeMenu->sprites[TEXTBUTTON_SCROLLUP].drawMode == 2) {
+ && _activeMenu->sprites[TEXTBUTTON_SCROLLUP].drawMode == 2) {
playSoundEffectIndex(SND_SELECTION);
return TEXTBUTTON_SCROLLUP_ONELINE;
}
@@ -716,7 +715,7 @@ rclick:
case Common::KEYCODE_PAGEUP:
case Common::KEYCODE_KP9:
if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_SCROLLUP))
- && _activeMenu->sprites[TEXTBUTTON_SCROLLUP].drawMode == 2) {
+ && _activeMenu->sprites[TEXTBUTTON_SCROLLUP].drawMode == 2) {
playSoundEffectIndex(SND_SELECTION);
return TEXTBUTTON_SCROLLUP;
}
@@ -725,7 +724,7 @@ rclick:
case Common::KEYCODE_LEFT:
case Common::KEYCODE_KP4:
if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_PREVCHOICE))
- && _activeMenu->sprites[TEXTBUTTON_PREVCHOICE].drawMode == 2) {
+ && _activeMenu->sprites[TEXTBUTTON_PREVCHOICE].drawMode == 2) {
playSoundEffectIndex(SND_SELECTION);
return TEXTBUTTON_PREVCHOICE;
}
@@ -734,7 +733,7 @@ rclick:
case Common::KEYCODE_RIGHT:
case Common::KEYCODE_KP6:
if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_NEXTCHOICE))
- && _activeMenu->sprites[TEXTBUTTON_NEXTCHOICE].drawMode == 2) {
+ && _activeMenu->sprites[TEXTBUTTON_NEXTCHOICE].drawMode == 2) {
playSoundEffectIndex(SND_SELECTION);
return TEXTBUTTON_NEXTCHOICE;
}
@@ -743,7 +742,7 @@ rclick:
case Common::KEYCODE_END:
case Common::KEYCODE_KP1:
if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_SCROLLDOWN))
- && _activeMenu->sprites[TEXTBUTTON_SCROLLDOWN].drawMode == 2) {
+ && _activeMenu->sprites[TEXTBUTTON_SCROLLDOWN].drawMode == 2) {
playSoundEffectIndex(SND_SELECTION);
return TEXTBUTTON_GOTO_BOTTOM;
}
@@ -752,7 +751,7 @@ rclick:
case Common::KEYCODE_DOWN:
case Common::KEYCODE_KP2:
if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_SCROLLDOWN))
- && _activeMenu->sprites[TEXTBUTTON_SCROLLDOWN].drawMode == 2) {
+ && _activeMenu->sprites[TEXTBUTTON_SCROLLDOWN].drawMode == 2) {
playSoundEffectIndex(SND_SELECTION);
return TEXTBUTTON_SCROLLDOWN_ONELINE;
}
@@ -761,7 +760,7 @@ rclick:
case Common::KEYCODE_PAGEDOWN:
case Common::KEYCODE_KP3:
if (!(_activeMenu->disabledButtons & (1 << TEXTBUTTON_SCROLLDOWN))
- && _activeMenu->sprites[TEXTBUTTON_SCROLLDOWN].drawMode == 2) {
+ && _activeMenu->sprites[TEXTBUTTON_SCROLLDOWN].drawMode == 2) {
playSoundEffectIndex(SND_SELECTION);
return TEXTBUTTON_SCROLLDOWN;
}
@@ -986,7 +985,7 @@ void StarTrekEngine::showTextConfigurationMenu(bool fromOptionMenu) {
saveTextDisplayMode(val);
}
- switch(val) {
+ switch (val) {
case 0:
_textDisplayMode = TEXTDISPLAY_SUBTITLES;
break;
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index 4d3b270..d412b8e 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -171,13 +171,12 @@ public:
fielda2(),
fielda4(),
- fielda6()
- {
- memset(animFilename, 0, sizeof(animFilename));
- memset(bitmapFilename, 0, sizeof(bitmapFilename));
- memset(animationString2, 0, sizeof(animationString2));
- memset(animationString, 0, sizeof(animationString));
- }
+ fielda6() {
+ memset(animFilename, 0, sizeof(animFilename));
+ memset(bitmapFilename, 0, sizeof(bitmapFilename));
+ memset(animationString2, 0, sizeof(animationString2));
+ memset(animationString, 0, sizeof(animationString));
+ }
};
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index fae5250..daf8e09 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -30,18 +30,18 @@
// TODO: Delete this macro, replacing it with the next one.
// New "[roomName]NumActions" variables need to be made before that.
#define ADD_ROOM_OLD(ROOM) {\
- if (name.equalsIgnoreCase(#ROOM)) {\
- _roomActionList = ROOM##ActionList;\
- _numRoomActions = sizeof(ROOM##ActionList) / sizeof(RoomAction);\
- }\
-}
+ if (name.equalsIgnoreCase(#ROOM)) {\
+ _roomActionList = ROOM##ActionList;\
+ _numRoomActions = sizeof(ROOM##ActionList) / sizeof(RoomAction);\
+ }\
+ }
#define ADD_ROOM(ROOM) {\
- if (name.equalsIgnoreCase(#ROOM)) {\
- _roomActionList = ROOM##ActionList;\
- _numRoomActions = ROOM##NumActions;\
- }\
-}
+ if (name.equalsIgnoreCase(#ROOM)) {\
+ _roomActionList = ROOM##ActionList;\
+ _numRoomActions = ROOM##NumActions;\
+ }\
+ }
namespace StarTrek {
@@ -277,8 +277,7 @@ int Room::showRoomSpecificText(const char **array) {
textColor = TEXTCOLOR_RED;
else
textColor = TEXTCOLOR_GREY;
- }
- else
+ } else
textColor = TEXTCOLOR_YELLOW;
return _vm->showText(&StarTrekEngine::readTextFromArrayWithChoices, (uintptr)array, 20, 20, textColor, true, false, false);
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index b8d5145..484613a 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -64,10 +64,18 @@ public:
* "minimum" scale; that value rises to the "max scale" value by the time they reach
* the "max Y" value.
*/
- uint16 getMaxY() { return readRdfWord(0x06); }
- uint16 getMinY() { return readRdfWord(0x08); }
- Fixed8 getMinScale() { return Fixed8::fromRaw(readRdfWord(0x0a)); }
- Fixed8 getMaxScale() { return Fixed8::fromRaw(readRdfWord(0x0c)); }
+ uint16 getMaxY() {
+ return readRdfWord(0x06);
+ }
+ uint16 getMinY() {
+ return readRdfWord(0x08);
+ }
+ Fixed8 getMinScale() {
+ return Fixed8::fromRaw(readRdfWord(0x0a));
+ }
+ Fixed8 getMaxScale() {
+ return Fixed8::fromRaw(readRdfWord(0x0c));
+ }
/**
* Check if a particular action is defined for this room.
@@ -87,14 +95,26 @@ public:
bool handleActionWithBitmask(const Action &action);
bool handleActionWithBitmask(byte type, byte b1, byte b2, byte b3);
- uint16 getFirstHotspot() { return readRdfWord(0x12); }
- uint16 getHotspotEnd() { return readRdfWord(0x14); }
+ uint16 getFirstHotspot() {
+ return readRdfWord(0x12);
+ }
+ uint16 getHotspotEnd() {
+ return readRdfWord(0x14);
+ }
// Warp-related stuff
- uint16 getFirstWarpPolygonOffset() { return readRdfWord(0x16); }
- uint16 getWarpPolygonEndOffset() { return readRdfWord(0x18); }
- uint16 getFirstDoorPolygonOffset() { return readRdfWord(0x1a); }
- uint16 getDoorPolygonEndOffset() { return readRdfWord(0x1c); }
+ uint16 getFirstWarpPolygonOffset() {
+ return readRdfWord(0x16);
+ }
+ uint16 getWarpPolygonEndOffset() {
+ return readRdfWord(0x18);
+ }
+ uint16 getFirstDoorPolygonOffset() {
+ return readRdfWord(0x1a);
+ }
+ uint16 getDoorPolygonEndOffset() {
+ return readRdfWord(0x1c);
+ }
/**
* Get the point at which a crewman beams in to this room (not properly defined for
diff --git a/engines/startrek/rooms/demon0.cpp b/engines/startrek/rooms/demon0.cpp
index 9adb2eb..e16e884 100644
--- a/engines/startrek/rooms/demon0.cpp
+++ b/engines/startrek/rooms/demon0.cpp
@@ -280,8 +280,7 @@ void Room::demon0TalkToMcCoy() {
showText(TX_SPEAKER_SPOCK, TX_DEM0_029);
if (!_vm->_awayMission.redshirtDead)
showText(TX_SPEAKER_EVERTS, TX_DEM0_041);
- }
- else {
+ } else {
showText(TX_SPEAKER_MCCOY, TX_DEM0_019);
if (!_vm->_awayMission.demon.askedPrelateAboutSightings) {
demon0AskPrelateAboutSightings();
diff --git a/engines/startrek/rooms/demon1.cpp b/engines/startrek/rooms/demon1.cpp
index 3bd3e7c..a30b5cc 100644
--- a/engines/startrek/rooms/demon1.cpp
+++ b/engines/startrek/rooms/demon1.cpp
@@ -37,8 +37,7 @@ void Room::demon1Tick1() {
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
- }
- else if (_vm->_awayMission.demon.enteredFrom == 2) { // Entered from north?
+ } else if (_vm->_awayMission.demon.enteredFrom == 2) { // Entered from north?
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
@@ -48,8 +47,7 @@ void Room::demon1Tick1() {
if (!_vm->_awayMission.demon.beatKlingons) {
_vm->_awayMission.disableWalking = true;
_vm->_awayMission.timers[2] = 50;
- }
- else {
+ } else {
loadActorAnim(8, "klg1d2", 0x120, 0x82, 0);
if (!_vm->_awayMission.demon.tookKlingonHand)
loadActorAnim(13, "klghnd", 0x10b, 0x8e, 0);
@@ -126,8 +124,7 @@ void Room::demon1Timer1Expired() {
// TODO
return;
}
- }
- else if (_rdfData[0xcb] != 1) {
+ } else if (_rdfData[0xcb] != 1) {
anim = "klg2f";
shooter = 9;
switch (_roomVar.demon1.attackIndex) {
@@ -147,8 +144,7 @@ void Room::demon1Timer1Expired() {
// TODO
return;
}
- }
- else {
+ } else {
anim = "klg3f";
shooter = 10;
switch (_roomVar.demon1.attackIndex) {
@@ -182,16 +178,13 @@ void Room::demon1KlingonFinishedAimingWeapon() {
if (_roomVar.demon1.attackIndex == 1) {
loadActorAnim2(OBJECT_REDSHIRT, "rstunn", -1, -1, 0);
crewman = OBJECT_REDSHIRT;
- }
- else if (_roomVar.demon1.attackIndex == 2) {
+ } else if (_roomVar.demon1.attackIndex == 2) {
loadActorAnim2(OBJECT_SPOCK, "sstunn", -1, -1, 0);
crewman = OBJECT_SPOCK;
- }
- else if (_roomVar.demon1.attackIndex == 3) {
+ } else if (_roomVar.demon1.attackIndex == 3) {
loadActorAnim2(OBJECT_MCCOY, "mstune", -1, -1, 0);
crewman = OBJECT_MCCOY;
- }
- else if (_roomVar.demon1.attackIndex == 4) {
+ } else if (_roomVar.demon1.attackIndex == 4) {
loadActorAnim2(OBJECT_KIRK, "kstunn", -1, -1, 1);
crewman = OBJECT_KIRK;
}
@@ -221,8 +214,7 @@ void Room::demon1UsePhaserOnKlingon1() {
if (_roomVar.demon1.kirkShooting) {
demon1ShootKlingon1();
- }
- else {
+ } else {
loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 3);
_roomVar.demon1.kirkShooting = true;
}
@@ -270,8 +262,7 @@ void Room::demon1UsePhaserOnKlingon2() {
if (_roomVar.demon1.kirkShooting) {
demon1ShootKlingon2();
- }
- else {
+ } else {
loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 4);
_roomVar.demon1.kirkShooting = true;
}
@@ -300,8 +291,7 @@ void Room::demon1UsePhaserOnKlingon3() {
if (_roomVar.demon1.kirkShooting) {
demon1ShootKlingon3();
- }
- else {
+ } else {
loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 5);
_roomVar.demon1.kirkShooting = true;
}
@@ -390,8 +380,7 @@ void Room::demon1UseSTricorderOnKlingon1() {
if (_roomVar.demon1.numKlingonsKilled == 3 && !_vm->_awayMission.demon.tookKlingonHand && _rdfData[0xcf] != 1) {
showText(TX_SPEAKER_SPOCK, TX_DEM1_018);
_rdfData[0xcf] = 1;
- }
- else {
+ } else {
showText(TX_SPEAKER_SPOCK, TX_DEM1_019);
}
}
diff --git a/engines/startrek/rooms/demon3.cpp b/engines/startrek/rooms/demon3.cpp
index 689882d..8584465 100644
--- a/engines/startrek/rooms/demon3.cpp
+++ b/engines/startrek/rooms/demon3.cpp
@@ -45,8 +45,7 @@ void Room::demon3Tick1() {
if (_vm->_awayMission.demon.doorOpened) {
loadActorAnim(14, "door2", 0x82, 0x0c, 0);
- }
- else {
+ } else {
loadMapFile("demon3a");
}
@@ -91,8 +90,7 @@ void Room::demon3Timer3Expired() {
loadMapFile("demon3");
_vm->_awayMission.demon.doorOpened = true;
_vm->_awayMission.demon.missionScore += 2;
- }
- else {
+ } else {
showText(TX_DEM3N007);
}
}
@@ -237,8 +235,7 @@ void Room::demon3UsePhaserOnBoulder3() {
_roomVar.demon3.boulderBeingShot = 3;
strcpy(_roomVar.demon3.boulderAnim, "s0r3s1");
demon3BoulderCommon();
- }
- else {
+ } else {
showText(TX_SPEAKER_SPOCK, TX_DEM3_006);
}
}
@@ -253,8 +250,7 @@ void Room::demon3UsePhaserOnBoulder4() {
strcpy(_roomVar.demon3.boulderAnim, "s0r3s4");
_vm->_awayMission.demon.foundMiner = true;
demon3BoulderCommon();
- }
- else {
+ } else {
// BUGFIX: In the original, the audio didn't play, despite the file existing (and
// despite it being used for the boulder on the left).
showText(TX_SPEAKER_SPOCK, TX_DEM3_006);
@@ -271,8 +267,7 @@ void Room::demon3BoulderCommon() {
if (_roomVar.demon3.inFiringPosition) {
demon3PullOutPhaserAndFireAtBoulder();
- }
- else {
+ } else {
showText(TX_SPEAKER_KIRK, TX_DEM3_001);
walkCrewman(OBJECT_KIRK, 0x79, 0xa0, 1);
@@ -348,8 +343,7 @@ void Room::demon3RedshirtUsedPanel() {
playSoundEffectIndex(0x06);
_vm->_awayMission.redshirtDead = true;
_vm->_awayMission.demon.field45 = true;
- }
- else {
+ } else {
const int textTable[] = {
TX_DEM3N005,
TX_DEM3_033,
@@ -404,8 +398,7 @@ void Room::demon3UseHandOnPanel() {
if (_vm->_awayMission.demon.doorOpened)
return;
walkCrewman(OBJECT_KIRK, 0xd8, 0x70, 7);
- }
- else {
+ } else {
showText(TX_SPEAKER_SPOCK, TX_DEM3_005);
}
}
@@ -428,8 +421,7 @@ void Room::demon3UseMTricorderOnMiner() {
if (_vm->_awayMission.demon.minerDead) {
showText(TX_SPEAKER_MCCOY, TX_DEM3_022);
- }
- else {
+ } else {
showText(TX_SPEAKER_MCCOY, TX_DEM3_023);
}
}
@@ -437,8 +429,7 @@ void Room::demon3UseMTricorderOnMiner() {
void Room::demon3UseMedkitOnMiner() {
if (_vm->_awayMission.demon.healedMiner) {
showText(TX_SPEAKER_MCCOY, TX_DEM3_015);
- }
- else {
+ } else {
walkCrewman(OBJECT_MCCOY, 0xe6, 0x7b, 6);
_roomVar.demon3.inFiringPosition = false;
_roomVar.demon3.kirkPhaserOut = false;
@@ -452,8 +443,7 @@ void Room::demon3McCoyReachedMiner() {
void Room::demon3McCoyFinishedHealingMiner() {
if (_vm->_awayMission.demon.minerDead) {
showText(TX_SPEAKER_MCCOY, TX_DEM3_022);
- }
- else {
+ } else {
showText(TX_SPEAKER_MCCOY, TX_DEM3_021);
_vm->_awayMission.demon.healedMiner = true;
loadActorAnim2(13, "drmine", 0xda, 0x6c, 0);
@@ -485,8 +475,7 @@ void Room::demon3TalkToSpock() {
void Room::demon3TalkToMccoy() {
if (_vm->_awayMission.redshirtDead) {
showText(TX_SPEAKER_MCCOY, TX_DEM3_014);
- }
- else {
+ } else {
showText(TX_SPEAKER_MCCOY, TX_DEM3_025);
showText(TX_SPEAKER_KIRK, TX_DEM3_003);
showText(TX_SPEAKER_MCCOY, TX_DEM3_024);
@@ -517,8 +506,7 @@ void Room::demon3LookAtRedshirt() {
if (_vm->_awayMission.redshirtDead) {
showText(TX_DEM3N017);
// NOTE: there's an alternate string that isn't used? (TX_DEM3N018)
- }
- else {
+ } else {
showText(TX_DEM3N003);
}
}
@@ -530,8 +518,7 @@ void Room::demon3LookAnywhere() {
void Room::demon3LookAtMiner() {
if (_vm->_awayMission.demon.healedMiner) {
showText(TX_DEM3N000);
- }
- else {
+ } else {
showText(TX_DEM3N006);
}
}
@@ -559,8 +546,7 @@ void Room::demon3LookAtStructure() {
void Room::demon3LookAtDoor() {
if (_vm->_awayMission.demon.doorOpened) {
showText(TX_DEM3N014);
- }
- else {
+ } else {
showText(TX_DEM3N012);
}
}
diff --git a/engines/startrek/rooms/demon4.cpp b/engines/startrek/rooms/demon4.cpp
index b42eb80..d70c5fb 100644
--- a/engines/startrek/rooms/demon4.cpp
+++ b/engines/startrek/rooms/demon4.cpp
@@ -140,8 +140,7 @@ void Room::demon4UsePhaserOnNauian() {
if (!_roomVar.demon4.triedToShootNauian) { // Lenient the first time
showText(TX_SPEAKER_NAUIAN, TX_DEM4_033);
_roomVar.demon4.triedToShootNauian = true;
- }
- else { // Murdery the second time
+ } else { // Murdery the second time
showText(TX_SPEAKER_NAUIAN, TX_DEM4_032);
loadActorAnim2(10, "bxfire", 0, 0, 2);
playVoc("V0SPOCKT");
@@ -279,12 +278,10 @@ void Room::demon4TalkToNauian() {
_vm->_awayMission.disableInput = true;
_vm->_awayMission.demon.missionScore += 5;
_vm->_awayMission.timers[1] = 20;
- }
- else {
+ } else {
showText(TX_SPEAKER_NAUIAN, TX_DEM4_038);
}
- }
- else {
+ } else {
showText(TX_SPEAKER_NAUIAN, TX_DEM4_031);
}
}
@@ -367,8 +364,7 @@ void Room::demon4CrewmanReachedPanel() {
loadActorAnim(9, "ctrl", 0, 0, 0);
_vm->_awayMission.demon.missionScore += 3;
_vm->_awayMission.timers[0] = 10;
- }
- else
+ } else
showText(TX_DEM4N013);
walkCrewman(_roomVar.demon4.crewmanUsingPanel, 0xae, 0x93, 0);
diff --git a/engines/startrek/rooms/demon5.cpp b/engines/startrek/rooms/demon5.cpp
index 010b90c..7227dd0 100644
--- a/engines/startrek/rooms/demon5.cpp
+++ b/engines/startrek/rooms/demon5.cpp
@@ -158,8 +158,7 @@ void Room::demon5TalkToRoberts() {
_roomVar.demon5.numTalkedTo++;
demon5CheckCompletedStudy();
}
- }
- else {
+ } else {
showText(TX_DEM5N010);
}
}
@@ -177,8 +176,7 @@ void Room::demon5TalkToChub() {
_roomVar.demon5.numTalkedTo++;
demon5CheckCompletedStudy();
}
- }
- else {
+ } else {
showText(TX_DEM5N013);
}
}
@@ -195,8 +193,7 @@ void Room::demon5TalkToGrisnash() {
_roomVar.demon5.numTalkedTo++;
demon5CheckCompletedStudy();
}
- }
- else {
+ } else {
showText(TX_DEM5N011);
}
}
@@ -214,21 +211,16 @@ void Room::demon5TalkToStephen() {
_roomVar.demon5.numTalkedTo++;
demon5CheckCompletedStudy();
}
- }
- else if (!_vm->_awayMission.demon.knowAboutHypoDytoxin) {
+ } else if (!_vm->_awayMission.demon.knowAboutHypoDytoxin) {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_034);
- }
- else if (_vm->_awayMission.demon.madeHypoDytoxin) {
+ } else if (_vm->_awayMission.demon.madeHypoDytoxin) {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_035);
- }
- else if (_vm->_awayMission.demon.gotBerries) {
+ } else if (_vm->_awayMission.demon.gotBerries) {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_032);
_vm->_awayMission.demon.field3e = false;
- }
- else if (_vm->_awayMission.demon.field3e) {
+ } else if (_vm->_awayMission.demon.field3e) {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_038);
- }
- else {
+ } else {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_034);
}
}
@@ -258,8 +250,7 @@ void Room::demon5TalkToMccoy() {
showText(TX_SPEAKER_SPOCK, TX_DEM5_026);
showText(TX_SPEAKER_MCCOY, TX_DEM5_019);
}
- }
- else {
+ } else {
showText(TX_SPEAKER_MCCOY, TX_DEM5_017);
}
}
@@ -287,8 +278,7 @@ void Room::demon5UseMTricorderOnChub() {
_roomVar.demon5.scannedChub = true;
_roomVar.demon5.numScanned++;
demon5CheckCompletedStudy();
- }
- else {
+ } else {
if (_vm->_awayMission.demon.field3e)
showText(TX_SPEAKER_MCCOY, TX_DEM5_010);
else {
diff --git a/engines/startrek/rooms/demon6.cpp b/engines/startrek/rooms/demon6.cpp
index ca0c1a0..a4cd58e 100644
--- a/engines/startrek/rooms/demon6.cpp
+++ b/engines/startrek/rooms/demon6.cpp
@@ -174,8 +174,7 @@ void Room::demon6TalkToStephen() {
void Room::demon6UseBerryOnStephen() {
if (_vm->_awayMission.demon.knowAboutHypoDytoxin) {
showText(TX_SPEAKER_STEPHEN, TX_DEM6_027);
- }
- else {
+ } else {
showText(TX_SPEAKER_STEPHEN, TX_DEM6_026);
}
}
@@ -209,8 +208,7 @@ void Room::demon6FinishedMakingHypoDytoxin() {
void Room::demon6UseHandOnWorkspace() {
if (_vm->_awayMission.demon.repairedHand) {
showText(TX_SPEAKER_SPOCK, TX_DEM6N018); // FIXME
- }
- else {
+ } else {
_vm->_awayMission.disableInput = true;
showText(TX_SPEAKER_KIRK, TX_DEM6_005);
walkCrewman(OBJECT_SPOCK, 0xb3, 0xbb, 2);
@@ -247,8 +245,7 @@ insult:
showText(TX_SPEAKER_STEPHEN, TX_DEM6_030);
_roomVar.demon6.insultedStephenRecently = true;
_vm->_awayMission.demon.insultedStephen = true;
- }
- else if (choice == 1) {
+ } else if (choice == 1) {
showText(TX_SPEAKER_STEPHEN, TX_DEM6_034);
explain:
while (true) {
@@ -280,8 +277,7 @@ explain:
goto error;
}
}
- }
- else if (choice == 2) {
+ } else if (choice == 2) {
showText(TX_SPEAKER_STEPHEN, TX_DEM6_031);
int choices3[] = {TX_SPEAKER_KIRK, TX_DEM6_001, TX_DEM6_006, TX_BLANK};
choice = showText(choices3);
@@ -292,13 +288,11 @@ explain:
goto explain;
else
goto error;
- }
- else {
+ } else {
error:
showText(TX_DIALOG_ERROR);
}
- }
- else {
+ } else {
showText(TX_DEM6N012);
showText(TX_SPEAKER_MCCOY, TX_DEM6_019);
}
diff --git a/engines/startrek/rooms/feather1.cpp b/engines/startrek/rooms/feather1.cpp
index c5f7307..667608a 100644
--- a/engines/startrek/rooms/feather1.cpp
+++ b/engines/startrek/rooms/feather1.cpp
@@ -475,10 +475,10 @@ void Room::feather1CrewmanClimbVine() {
_vm->_awayMission.disableInput = true;
if (_roomVar.feather.crewEscaped[_roomVar.feather.crewmanClimbingVine])
walkCrewmanC(_roomVar.feather.crewmanClimbingVine, VINE_TOP_X, VINE_TOP_Y,
- &Room::feather1ReachedVineToClimbDown);
+ &Room::feather1ReachedVineToClimbDown);
else
walkCrewmanC(_roomVar.feather.crewmanClimbingVine, VINE_BOT_X, VINE_BOT_Y,
- &Room::feather1ReachedVineToClimbUp);
+ &Room::feather1ReachedVineToClimbUp);
}
void Room::feather1ReachedVineToClimbUp() {
diff --git a/engines/startrek/rooms/feather3.cpp b/engines/startrek/rooms/feather3.cpp
index fd87c81..ebdf48a 100644
--- a/engines/startrek/rooms/feather3.cpp
+++ b/engines/startrek/rooms/feather3.cpp
@@ -68,9 +68,9 @@ extern const RoomAction feather3ActionList[] = {
{ {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::feather3TalkToRedshirt },
{ {ACTION_TALK, OBJECT_TLAOXAC, 0, 0}, &Room::feather3TalkToTlaoxac },
{ {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::feather3TlaoxacKilledRedshirt },
- { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_TLAOXAC, 0},&Room::feather3UseMTricorderOnTlaoxac },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_TLAOXAC, 0}, &Room::feather3UseMTricorderOnTlaoxac },
{ {ACTION_USE, OBJECT_IMEDKIT, OBJECT_TLAOXAC, 0}, &Room::feather3UseMedkitOnTlaoxac },
- { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_REDSHIRT, 0},&Room::feather3UseMedkitOnRedshirt },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_REDSHIRT, 0}, &Room::feather3UseMedkitOnRedshirt },
{ {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::feather3UseMedkitAnywhere },
{ {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_LIGHT_1, 0}, &Room::feather3UseMTricorderOnLight },
{ {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_LIGHT_2, 0}, &Room::feather3UseMTricorderOnLight },
diff --git a/engines/startrek/rooms/feather4.cpp b/engines/startrek/rooms/feather4.cpp
index 69d3f37..2c18155 100644
--- a/engines/startrek/rooms/feather4.cpp
+++ b/engines/startrek/rooms/feather4.cpp
@@ -39,13 +39,13 @@ extern const RoomAction feather4ActionList[] = {
{ {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_LIGHT_1, 0}, &Room::feather4UseSTricorderOnLight },
{ {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_LIGHT_2, 0}, &Room::feather4UseSTricorderOnLight },
{ {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_LIGHT_3, 0}, &Room::feather4UseSTricorderOnLight },
- { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MUSHROOM, 0},&Room::feather4UseSTricorderOnMushroom },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MUSHROOM, 0}, &Room::feather4UseSTricorderOnMushroom },
{ {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_FERN, 0}, &Room::feather4UseSTricorderOnFern },
{ {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::feather4UseSTricorderAnywhere },
{ {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_LIGHT_1, 0}, &Room::feather4UseMTricorderOnLight },
{ {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_LIGHT_2, 0}, &Room::feather4UseMTricorderOnLight },
{ {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_LIGHT_3, 0}, &Room::feather4UseMTricorderOnLight },
- { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_MUSHROOM, 0},&Room::feather4UseMTricorderOnMushroom },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_MUSHROOM, 0}, &Room::feather4UseMTricorderOnMushroom },
{ {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::feather4UseMTricorderAnywhere },
{ {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::feather4UseMedkitAnywhere },
{ {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::feather4TalkToMccoy },
diff --git a/engines/startrek/rooms/feather5.cpp b/engines/startrek/rooms/feather5.cpp
index 843604d..a8ca002 100644
--- a/engines/startrek/rooms/feather5.cpp
+++ b/engines/startrek/rooms/feather5.cpp
@@ -81,7 +81,7 @@ extern const RoomAction feather5ActionList[] = {
{ {ACTION_USE, OBJECT_IROCK, OBJECT_REDSHIRT, 0}, &Room::feather5UseRockOnRedshirt },
{ {ACTION_USE, OBJECT_SPOCK, OBJECT_THROWN_FERN, 0}, &Room::feather5UseCrewmanOnThrownFern },
{ {ACTION_USE, OBJECT_MCCOY, OBJECT_THROWN_FERN, 0}, &Room::feather5UseCrewmanOnThrownFern },
- { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_THROWN_FERN, 0},&Room::feather5UseCrewmanOnThrownFern },
+ { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_THROWN_FERN, 0}, &Room::feather5UseCrewmanOnThrownFern },
{ {ACTION_USE, OBJECT_SPOCK, OBJECT_MONSTER, 0}, &Room::feather5UseSpockOnMonster },
{ {ACTION_USE, OBJECT_MCCOY, OBJECT_MONSTER, 0}, &Room::feather5UseMccoyOnMonster },
{ {ACTION_USE, OBJECT_REDSHIRT, OBJECT_MONSTER, 0}, &Room::feather5UseRedshirtOnMonster },
diff --git a/engines/startrek/rooms/feather6.cpp b/engines/startrek/rooms/feather6.cpp
index 5b86a14..204d349 100644
--- a/engines/startrek/rooms/feather6.cpp
+++ b/engines/startrek/rooms/feather6.cpp
@@ -55,7 +55,7 @@ extern const RoomAction feather6ActionList[] = {
{ {ACTION_USE, OBJECT_IROCK, HOTSPOT_STALAGMITES, 0}, &Room::feather6UseRockOnStalagmites },
{ {ACTION_USE, OBJECT_IROCK, HOTSPOT_EAST_EXIT, 0}, &Room::feather6UseRockOnStalagmites },
{ {ACTION_USE, OBJECT_IROCK, 0xff, 0}, &Room::feather6UseRockAnywhere },
- { {ACTION_USE, OBJECT_IKNIFE, HOTSPOT_STALAGMITES, 0},&Room::feather6UseKnifeOnStalagmites },
+ { {ACTION_USE, OBJECT_IKNIFE, HOTSPOT_STALAGMITES, 0}, &Room::feather6UseKnifeOnStalagmites },
{ {ACTION_USE, OBJECT_IKNIFE, 0xff, 0}, &Room::feather6UseKnifeAnywhere },
{ {ACTION_USE, OBJECT_IKNIFE, OBJECT_MCCOY, 0}, &Room::feather6UseKnifeOnMccoy },
{ {ACTION_USE, OBJECT_IKNIFE, OBJECT_SPOCK, 0}, &Room::feather6UseKnifeOnSpock },
@@ -78,14 +78,14 @@ extern const RoomAction feather6ActionList[] = {
{ {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::feather6TalkToMccoy },
{ {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::feather6TalkToRedshirt },
{ {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::feather6TalkToSpock },
- { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_EAST_EXIT, 0},&Room::feather6UseMTricorderOnEastExit },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_EAST_EXIT, 0}, &Room::feather6UseMTricorderOnEastExit },
{ {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_ROCKS, 0}, &Room::feather6UseMTricorderOnRocks },
- { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_EAST_EXIT, 0},&Room::feather6UseSTricorderOnEastExit },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_EAST_EXIT, 0}, &Room::feather6UseSTricorderOnEastExit },
{ {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::feather6UseSTricorderAnywhere },
{ {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_ROCKS, 0}, &Room::feather6UseSTricorderOnRocks },
{ {ACTION_USE, OBJECT_ISTRICOR, OBJECT_CRYSTALS, 0}, &Room::feather6UseSTricorderOnCrystals },
- { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_STALACTITES, 0},&Room::feather6UseSTricorderOnStalactites },
- { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_STALAGMITES, 0},&Room::feather6UseSTricorderOnStalagmites },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_STALACTITES, 0}, &Room::feather6UseSTricorderOnStalactites },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_STALAGMITES, 0}, &Room::feather6UseSTricorderOnStalagmites },
{ {ACTION_GET, OBJECT_CRYSTALS, 0, 0}, &Room::feather6GetCrystals },
{ {ACTION_USE, OBJECT_IKNIFE, OBJECT_CRYSTALS, 0}, &Room::feather6UseKnifeOnCrystals },
diff --git a/engines/startrek/rooms/love1.cpp b/engines/startrek/rooms/love1.cpp
index 23a6e2a..612cd8c 100644
--- a/engines/startrek/rooms/love1.cpp
+++ b/engines/startrek/rooms/love1.cpp
@@ -77,7 +77,7 @@ void Room::love1Tick1() {
common:
loadActorAnim(OBJECT_BOTTLE, _roomVar.love.bottleAnimation, 0xa3, 0x72, 0);
- // fall through
+ // fall through
case BOTTLETYPE_NONE:
break;
@@ -308,8 +308,8 @@ void Room::love1KirkGotCureSample() {
giveItem(OBJECT_ISAMPLE);
showText(TX_LOV1N035);
- // BUGFIX: after removing the cure, unset this variable.
- // Otherwise, any normal dish inserted afterward automagically becomes a cure.
+ // BUGFIX: after removing the cure, unset this variable.
+ // Otherwise, any normal dish inserted afterward automagically becomes a cure.
_vm->_awayMission.love.chamberHasCure = false;
} else {
giveItem(OBJECT_IDISHES);
diff --git a/engines/startrek/rooms/love3.cpp b/engines/startrek/rooms/love3.cpp
index f7d4af4..03ae584 100644
--- a/engines/startrek/rooms/love3.cpp
+++ b/engines/startrek/rooms/love3.cpp
@@ -225,8 +225,7 @@ void Room::love3OpenedOrClosedServicePanel() {
showText(TX_LOV3N023);
else
showText(TX_LOV3N022);
- }
- else
+ } else
showText(TX_LOV3N020);
}
@@ -246,8 +245,7 @@ void Room::love3ScrewedOrUnscrewedGasTank() {
if (!_vm->_awayMission.redshirtDead)
showText(TX_SPEAKER_FERRIS, TX_LOV3_022);
_vm->_awayMission.love.gasTankUnscrewed = true;
- }
- else {
+ } else {
showText(TX_LOV3N015);
_vm->_awayMission.love.gasTankUnscrewed = false;
}
@@ -351,8 +349,7 @@ void Room::love3OpenedOrClosedGrate() {
_vm->_awayMission.love.gotPointsForOpeningGrate = true;
_vm->_awayMission.love.missionScore++;
}
- }
- else {
+ } else {
loadActorAnim(OBJECT_GRATE, "s3r4g1", 0x116, 0x8f, 0);
_vm->_awayMission.love.grateRemoved = false;
showText(TX_LOV3N032);
@@ -452,8 +449,7 @@ void Room::love3PouredRomulanLaughingGasDownShaft() {
if (_vm->_awayMission.love.romulansUnconsciousFromVirus) {
showText(TX_LOV3NA08);
_vm->_awayMission.love.romulansUnconsciousFromLaughingGas = false;
- }
- else {
+ } else {
showText(TX_LOV3NA09);
playVoc("ROMULANL");
}
@@ -500,8 +496,7 @@ void Room::love3ReachedGasTankUsingAntigrav() {
if (_vm->_awayMission.love.gasTankUnscrewed) {
loadActorAnimC(OBJECT_KIRK, "kusehe", -1, -1, &Room::love3PickedUpGasTank);
playVoc("SE3PLBAT");
- }
- else {
+ } else {
showText(TX_LOV3N010);
showText(TX_SPEAKER_SPOCK, TX_LOV3_015);
}
diff --git a/engines/startrek/rooms/love4.cpp b/engines/startrek/rooms/love4.cpp
index cc05f72..447f763 100644
--- a/engines/startrek/rooms/love4.cpp
+++ b/engines/startrek/rooms/love4.cpp
@@ -41,8 +41,7 @@ void Room::love4Tick1() {
loadActorAnim2(OBJECT_ROMULAN_2, "s3r5r2b", 0xb9, 0xbb, 0);
loadActorAnim2(OBJECT_ROMULAN_3, "s3r5r3b", 0xef, 0xc4, 0);
loadActorAnim2(OBJECT_ROMULAN_4, "s3r5r4b", 0x12a, 0xaa, 0);
- }
- else {
+ } else {
loadActorAnim2(OBJECT_ROMULAN_1, "s3r5r1a", 0x36, 0xb3, 0);
loadActorAnim2(OBJECT_ROMULAN_2, "s3r5r2a", 0xb9, 0xbb, 0);
loadActorAnim2(OBJECT_ROMULAN_3, "s3r5r3a", 0xef, 0xc4, 0);
diff --git a/engines/startrek/rooms/love5.cpp b/engines/startrek/rooms/love5.cpp
index 4bb9cb6..fdad4a3 100644
--- a/engines/startrek/rooms/love5.cpp
+++ b/engines/startrek/rooms/love5.cpp
@@ -40,8 +40,7 @@ void Room::love5Tick1() {
if (_vm->_awayMission.love.freedMarcusAndCheever) {
loadActorAnim(OBJECT_MARCUS, "marcusst", 0x28, 0xa6);
loadActorAnim(OBJECT_CHEEVER, "s3gtupst", 0x49, 0xac);
- }
- else {
+ } else {
loadActorAnim(OBJECT_MARCUS, "marcus2", 0x28, 0xa6);
loadActorAnim(OBJECT_CHEEVER, "s3gtup2", 0x49, 0xac);
}
@@ -172,7 +171,7 @@ void Room::love5TalkToPreax() {
switch (choice) {
case 1:
showText(TX_SPEAKER_MARCUS, TX_LOV5_043);
- // fall through
+ // fall through
case 0:
showText(TX_SPEAKER_PREAX, TX_LOV5_061);
showText(TX_SPEAKER_KIRK, TX_LOV5_010);
@@ -199,8 +198,7 @@ void Room::love5TalkToPreax() {
if (!_vm->_awayMission.love.spockCured) {
showText(TX_SPEAKER_MCCOY, TX_LOV5_021);
walkCrewmanC(OBJECT_MCCOY, 0x87, 0xc3, &Room::love5MccoyReachedSpockToCure);
- }
- else
+ } else
love5EndMission();
}
} else
@@ -326,14 +324,12 @@ void Room::love5UseWaterOnPreax() {
_vm->_awayMission.love.missionScore++;
}
loseItem(OBJECT_IH2O);
- }
- else {
+ } else {
if (_vm->_awayMission.love.romulansUnconsciousFromVirus) {
showText(TX_SPEAKER_MCCOY, TX_LOV5_013);
// BUGFIX: original didn't have correct speaker. Also, you shouldn't lose your
// water since it's not actually used here, so a "loseItem" line was removed.
- }
- else {
+ } else {
showText(TX_LOV5N017);
if (!_vm->_awayMission.redshirtDead) {
showText(TX_SPEAKER_FERRIS, TX_LOV5_053);
diff --git a/engines/startrek/rooms/lovea.cpp b/engines/startrek/rooms/lovea.cpp
index 9805123..e4e9f1c 100644
--- a/engines/startrek/rooms/lovea.cpp
+++ b/engines/startrek/rooms/lovea.cpp
@@ -67,8 +67,7 @@ void Room::loveaTimer0Expired() {
if (randomVal == 0 || _vm->_awayMission.redshirtDead) {
speaker = TX_SPEAKER_MCCOY;
textTable = mccoyText;
- }
- else {
+ } else {
speaker = TX_SPEAKER_FERRIS;
textTable = ferrisText;
}
@@ -122,8 +121,7 @@ void Room::loveaUseCureSampleOnSpock() {
if (_vm->_awayMission.love.spockCured) {
walkCrewman(OBJECT_SPOCK, _roomVar.love.cmnXPosToCureSpock, _roomVar.love.cmnYPosToCureSpock, 99);
walkCrewman(OBJECT_MCCOY, _roomVar.love.cmnXPosToCureSpock, _roomVar.love.cmnYPosToCureSpock + 10, 99);
- }
- else
+ } else
showText(TX_SPEAKER_MCCOY, TX_LOVA_F55);
}
@@ -162,20 +160,16 @@ void Room::loveaTimer2Expired() {
playMidiMusicTracks(2, -1); // FIXME: assembly had no second parameter...?
showText(TX_GENER004);
showGameOverMenu();
- }
- else if (_vm->_awayMission.love.spockInfectionCounter == 15) {
+ } else if (_vm->_awayMission.love.spockInfectionCounter == 15) {
showText(TX_SPEAKER_SPOCK, TX_SPOKCOFF);
_vm->_awayMission.love.spockInfectionCounter++;
- }
- else if (_vm->_awayMission.love.spockInfectionCounter == 30) {
+ } else if (_vm->_awayMission.love.spockInfectionCounter == 30) {
showText(TX_SPEAKER_MCCOY, TX_LOVA_F08);
_vm->_awayMission.love.spockInfectionCounter++;
- }
- else if (_vm->_awayMission.love.spockInfectionCounter == 45) {
+ } else if (_vm->_awayMission.love.spockInfectionCounter == 45) {
showText(TX_SPEAKER_SPOCK, TX_SPOKCOFF);
_vm->_awayMission.love.spockInfectionCounter++;
- }
- else if (_vm->_awayMission.love.spockInfectionCounter == 60) {
+ } else if (_vm->_awayMission.love.spockInfectionCounter == 60) {
showText(TX_SPEAKER_SPOCK, TX_LOVA_F54);
_vm->_awayMission.love.romulansUnconsciousFromVirus = true;
_vm->_awayMission.love.spockInfectionCounter++;
diff --git a/engines/startrek/rooms/mudd0.cpp b/engines/startrek/rooms/mudd0.cpp
index 9105c01..0b450e0 100644
--- a/engines/startrek/rooms/mudd0.cpp
+++ b/engines/startrek/rooms/mudd0.cpp
@@ -42,10 +42,10 @@ namespace StarTrek {
void Room::mudd0Tick1() {
playVoc("MUD0LOOP");
- // NOTE: Using the floppy version's code here; Mudd disappears from this room after
- // the first meeting. Fixes an issue where Mudd appears in the first room when he's
- // supposed to be in the medbay.
- // TODO: verify this matches with floppy version's code
+ // NOTE: Using the floppy version's code here; Mudd disappears from this room after
+ // the first meeting. Fixes an issue where Mudd appears in the first room when he's
+ // supposed to be in the medbay.
+ // TODO: verify this matches with floppy version's code
if (_vm->_awayMission.mudd.muddFirstRoomState != 0)
_vm->_awayMission.mudd.muddFirstRoomState = 2;
else {
@@ -292,8 +292,7 @@ void Room::mudd0TalkToRedshirt() {
if (_vm->_awayMission.mudd.muddFirstRoomState == 2) {
showText(TX_SPEAKER_BUCHERT, TX_MUD0_039);
showText(TX_SPEAKER_KIRK, TX_MUD0_008);
- }
- else {
+ } else {
showText(TX_SPEAKER_BUCHERT, TX_MUD0_040);
showText(TX_SPEAKER_MUDD, TX_MUD0_030);
showText(TX_SPEAKER_BUCHERT, TX_MUD0_041);
diff --git a/engines/startrek/rooms/mudd1.cpp b/engines/startrek/rooms/mudd1.cpp
index a2baf71..d741478 100644
--- a/engines/startrek/rooms/mudd1.cpp
+++ b/engines/startrek/rooms/mudd1.cpp
@@ -174,7 +174,7 @@ void Room::mudd1SpockPressedRedButton() {
case 1:
showText(TX_SPEAKER_KIRK, TX_MUD1_007);
- // fall through
+ // fall through
case 2:
_vm->_awayMission.mudd.torpedoStatus = 1;
diff --git a/engines/startrek/rooms/mudd2.cpp b/engines/startrek/rooms/mudd2.cpp
index 3a3ba81..ef1ec6a 100644
--- a/engines/startrek/rooms/mudd2.cpp
+++ b/engines/startrek/rooms/mudd2.cpp
@@ -301,8 +301,7 @@ void Room::mudd2UseMedkitOnMudd() {
showText(TX_SPEAKER_MCCOY, TX_MUD2_021);
else
walkCrewmanC(OBJECT_MCCOY, 0xde, 0xaf, &Room::mudd2MccoyReachedMudd);
- }
- else // Can't get to him since he's busy being crazy
+ } else // Can't get to him since he's busy being crazy
showText(TX_SPEAKER_MCCOY, TX_MUD2_016);
}
diff --git a/engines/startrek/rooms/mudd4.cpp b/engines/startrek/rooms/mudd4.cpp
index 2905fb3..90bdf1d 100644
--- a/engines/startrek/rooms/mudd4.cpp
+++ b/engines/startrek/rooms/mudd4.cpp
@@ -190,8 +190,7 @@ void Room::mudd4UseKirkOnConsole() {
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
walkCrewmanC(OBJECT_SPOCK, 0x6d, 0x9a, &Room::mudd4FinishedWalking3);
_vm->_awayMission.disableInput = true;
- }
- else {
+ } else {
if (!_roomVar.mudd.kirkUsingRightConsole)
showText(TX_SPEAKER_KIRK, TX_MUD4_049);
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
@@ -257,8 +256,7 @@ void Room::mudd4KirkUsedViewScreen() {
_vm->_awayMission.mudd.gotPointsForEnablingViewscreen = true;
_vm->_awayMission.mudd.missionScore++;
}
- }
- else {
+ } else {
_vm->_awayMission.mudd.viewScreenEnabled = false;
loadActorAnim(OBJECT_VIEWSCREEN, "s4crvf", 0xa5, 0x76);
_vm->_awayMission.timers[3] = 5;
@@ -356,9 +354,9 @@ void Room::mudd4KirkReachedPositionToTalkToMudd() {
_vm->_awayMission.disableInput = false;
if (_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction
- || _vm->_awayMission.mudd.muddErasedDatabase
- || _vm->_awayMission.mudd.databaseDestroyed
- || !_vm->_awayMission.mudd.accessedAlienDatabase) { // NOTE: why this last line? Test this...
+ || _vm->_awayMission.mudd.muddErasedDatabase
+ || _vm->_awayMission.mudd.databaseDestroyed
+ || !_vm->_awayMission.mudd.accessedAlienDatabase) { // NOTE: why this last line? Test this...
const int choices[] = {
TX_SPEAKER_KIRK,
TX_MUD4_009,
@@ -399,8 +397,7 @@ void Room::mudd4KirkReachedPositionToTalkToMudd() {
showText(TX_SPEAKER_KIRK, TX_MUD4_036);
showText(TX_SPEAKER_SPOCK, TX_MUD4_029);
showText(TX_SPEAKER_KIRK, TX_MUD4_030);
- }
- else {
+ } else {
// Mudd is forced to agree to give samples to a university.
showText(TX_SPEAKER_MUDD, TX_MUD4_064);
showText(TX_SPEAKER_KIRK, TX_MUD4_012);
@@ -420,8 +417,7 @@ void Room::mudd4KirkReachedPositionToTalkToMudd() {
endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
}
- }
- else {
+ } else {
const int choices[] = {
TX_SPEAKER_KIRK,
TX_MUD4_014,
diff --git a/engines/startrek/rooms/mudda.cpp b/engines/startrek/rooms/mudda.cpp
index 03f71f9..78c5629 100644
--- a/engines/startrek/rooms/mudda.cpp
+++ b/engines/startrek/rooms/mudda.cpp
@@ -119,12 +119,12 @@ void Room::muddaTick() {
/*
// Unused: The positions to they originally walked to before collapsing.
const Common::Point deathPositions[][4] = {
- { Common::Point(0xbb, 0x8d), Common::Point(0xd0, 0x89), Common::Point(0xaa, 0x85), Common::Point(0xbf, 0x83) },
- { Common::Point(0xaa, 0xa5), Common::Point(0x83, 0xac), Common::Point(-1, -1), Common::Point(-1, -1) },
- { Common::Point(0x108, 0xbb), Common::Point(0x118, 0xc4), Common::Point(0xfe, 0xb2), Common::Point(0x117, 0xae) },
- { Common::Point(0xf1, 0x95), Common::Point(0xcd, 0x87), Common::Point(0xec, 0x84), Common::Point(0x110, 0xa6) },
- { Common::Point(0x8b, 0xb6), Common::Point(0x69, 0xb7), Common::Point(-1, -1), Common::Point(-1, -1) },
- { Common::Point(0x8b, 0xac), Common::Point(0x6f, 0x99), Common::Point(-1, -1), Common::Point(-1, -1) },
+ { Common::Point(0xbb, 0x8d), Common::Point(0xd0, 0x89), Common::Point(0xaa, 0x85), Common::Point(0xbf, 0x83) },
+ { Common::Point(0xaa, 0xa5), Common::Point(0x83, 0xac), Common::Point(-1, -1), Common::Point(-1, -1) },
+ { Common::Point(0x108, 0xbb), Common::Point(0x118, 0xc4), Common::Point(0xfe, 0xb2), Common::Point(0x117, 0xae) },
+ { Common::Point(0xf1, 0x95), Common::Point(0xcd, 0x87), Common::Point(0xec, 0x84), Common::Point(0x110, 0xa6) },
+ { Common::Point(0x8b, 0xb6), Common::Point(0x69, 0xb7), Common::Point(-1, -1), Common::Point(-1, -1) },
+ { Common::Point(0x8b, 0xac), Common::Point(0x6f, 0x99), Common::Point(-1, -1), Common::Point(-1, -1) },
};
*/
diff --git a/engines/startrek/rooms/trial5.cpp b/engines/startrek/rooms/trial5.cpp
index a71d413..ecc3c64 100644
--- a/engines/startrek/rooms/trial5.cpp
+++ b/engines/startrek/rooms/trial5.cpp
@@ -461,7 +461,7 @@ void Room::trial5ReachedHoleToPutGem() {
Common::Point(0x22, 0x95),
Common::Point(0x3c, 0x95),
};
- const char * const gemAnims[] = {
+ const char *const gemAnims[] = {
"RedGem1", "RedGem2", "RedGem3",
"GrnGem1", "GrnGem2", "GrnGem3",
"BluGem1", "BluGem2", "BluGem3",
diff --git a/engines/startrek/rooms/tug2.cpp b/engines/startrek/rooms/tug2.cpp
index 8c24a36..e3229c1 100644
--- a/engines/startrek/rooms/tug2.cpp
+++ b/engines/startrek/rooms/tug2.cpp
@@ -139,8 +139,7 @@ void Room::tug2GetBomb() {
_vm->_awayMission.disableInput = true;
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewman(OBJECT_KIRK, 0xc9, 0xa0, 12);
- }
- else
+ } else
showText(TX_TUG2N024);
}
@@ -297,8 +296,7 @@ void Room::tug2KirkGotWires() {
_vm->_awayMission.tug.gotWires = true;
_vm->_awayMission.disableInput = false;
_vm->_awayMission.tug.missionScore += 3;
- }
- else {
+ } else {
loadActorStandAnim(OBJECT_WIRE);
giveItem(OBJECT_IWIRING);
_vm->_awayMission.tug.gotWires = true;
@@ -368,8 +366,7 @@ void Room::tug2TurnedOffForceField() {
loadActorAnim2(OBJECT_BOMB, "t2bbo", -3, 1, 0);
// FIXME: doesn't play "PHASSHOT" sound effect like when kirk removes wires?
_vm->_awayMission.tug.field35 = 6;
- }
- else if (_vm->_awayMission.tug.field35 == 4 && !_vm->_awayMission.tug.brigForceFieldDown) {
+ } else if (_vm->_awayMission.tug.field35 == 4 && !_vm->_awayMission.tug.brigForceFieldDown) {
_vm->_awayMission.tug.brigForceFieldDown = true;
loadActorAnim2(OBJECT_BRIG, "fld10", 0, 0, 2);
_vm->_awayMission.tug.missionScore += 6;
@@ -459,7 +456,7 @@ void Room::tug2UseStunPhaserOnGuard2() {
}
void Room::tug2KirkShootGuard2() {
- if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_UP){
+ if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_GUARD_2, "p6stun", -1, -1, 0);
_vm->_awayMission.tug.guard2Status = GUARDSTAT_STUNNED;
playSoundEffectIndex(SND_PHASSHOT);
@@ -487,7 +484,7 @@ void Room::tug2UseKillPhaserOnGuard1() {
}
void Room::tug2KirkKillGuard1() {
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_UP){
+ if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_GUARD_1, "p5kill", -1, -1, 0);
_vm->_awayMission.tug.guard1Status = GUARDSTAT_DEAD;
playSoundEffectIndex(SND_PHASSHOT);
@@ -515,7 +512,7 @@ void Room::tug2UseKillPhaserOnGuard2() {
}
void Room::tug2KirkKillGuard2() {
- if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_UP){
+ if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_GUARD_2, "p6kill", -1, -1, 0);
_vm->_awayMission.tug.guard2Status = GUARDSTAT_DEAD;
playSoundEffectIndex(SND_PHASSHOT);
@@ -688,8 +685,7 @@ void Room::tug2Timer0Expired() {
_roomVar.tug2.shootingTarget = OBJECT_SPOCK;
_vm->_awayMission.timers[2] = 40;
tug2GuardShootsCrewman();
- }
- else if (_roomVar.tug2.shootKirkOverride) {
+ } else if (_roomVar.tug2.shootKirkOverride) {
tug2DetermineElasiShooter();
_roomVar.tug2.shootingTarget = OBJECT_KIRK;
_vm->_awayMission.timers[2] = 40; // TODO
@@ -738,8 +734,7 @@ void Room::tug2GuardShootsCrewman() {
bitmapArray = g1ShotsOnKill;
else
bitmapArray = g2ShotsOnKill;
- }
- else {
+ } else {
anim = "_stune";
if (_roomVar.tug2.shootingObject == OBJECT_GUARD_1)
bitmapArray = g1ShotsOnStun;
diff --git a/engines/startrek/rooms/tug3.cpp b/engines/startrek/rooms/tug3.cpp
index 6c1b674..c0a0b97 100644
--- a/engines/startrek/rooms/tug3.cpp
+++ b/engines/startrek/rooms/tug3.cpp
@@ -208,8 +208,8 @@ void Room::tug3ElasiStunnedOrKilled() {
if (_vm->_awayMission.tug.bridgeWinMethod == 1)
return;
if (_vm->_awayMission.tug.bridgeElasi1Status == GUARDSTAT_UP || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_UP
- || _vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_UP || _vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_UP)
- return;
+ || _vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_UP || _vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_UP)
+ return;
// BUGFIX: if the ship is deorbiting, the mission isn't won yet.
if (_vm->_awayMission.tug.orbitalDecayCounter != 0)
@@ -342,15 +342,13 @@ void Room::tug3TalkToMccoy() {
if (_vm->_awayMission.tug.orbitalDecayCounter >= 10) {
if (_vm->_awayMission.tug.orbitalDecayCounter < 16)
showText(TX_SPEAKER_MCCOY, TX_TUG3_011);
- }
- else if (_vm->_awayMission.tug.orbitalDecayCounter != 0) {
+ } else if (_vm->_awayMission.tug.orbitalDecayCounter != 0) {
// BUGFIX: original game displays a blank textbox. An appropriate audio file
// exists, but the corresponding text was written from scratch for ScummVM.
// TODO: check if original floppy version has text for this.
showText(TX_SPEAKER_MCCOY, TX_TUG3_012);
}
- }
- else
+ } else
showText(TX_SPEAKER_MCCOY, TX_TUG3_013);
}
@@ -359,8 +357,7 @@ void Room::tug3TalkToSpock() {
if (_vm->_awayMission.tug.orbitalDecayCounter >= 10) {
if (_vm->_awayMission.tug.orbitalDecayCounter < 16)
showText(TX_SPEAKER_SPOCK, TX_TUG3_008);
- }
- else
+ } else
showText(TX_SPEAKER_SPOCK, TX_TUG3_009);
}
}
@@ -382,15 +379,14 @@ void Room::tug3UseCommunicator() {
// BUGFIX: if still fighting the elasi, the mission isn't done yet.
_vm->_awayMission.tug.orbitalDecayCounter = 0;
if (!_vm->_awayMission.tug.elasiSurrendered &&
- (_vm->_awayMission.tug.bridgeElasi1Status == GUARDSTAT_UP
- || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_UP
- || _vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_UP
- || _vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_UP))
+ (_vm->_awayMission.tug.bridgeElasi1Status == GUARDSTAT_UP
+ || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_UP
+ || _vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_UP
+ || _vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_UP))
return;
tug3EndMission();
- }
- else {
+ } else {
if (_vm->_awayMission.tug.orbitalDecayCounter < 16) {
showText(TX_SPEAKER_KIRK, TX_TUG3_006);
showText(TX_SPEAKER_SCOTT, TX_TUG3_S07);
@@ -429,24 +425,20 @@ void Room::tug3Timer0Expired() {
_vm->_awayMission.redshirtDead = true;
loadActorAnim2(OBJECT_REDSHIRT, "rkills", -1, -1, 0);
elasiTarget = OBJECT_REDSHIRT;
- }
- else if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK]) {
+ } else if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK]) {
_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] = 2;
_vm->_awayMission.disableInput = true;
loadActorAnim2(OBJECT_KIRK, "kkills", -1, -1, 0);
elasiTarget = OBJECT_KIRK;
- }
- else if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_SPOCK]) {
+ } else if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_SPOCK]) {
_vm->_awayMission.tug.crewmanKilled[OBJECT_SPOCK] = 2;
loadActorAnim2(OBJECT_SPOCK, "skills", -1, -1, 0);
elasiTarget = OBJECT_SPOCK;
- }
- else if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY]) {
+ } else if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY]) {
_vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY] = 2;
loadActorAnim2(OBJECT_MCCOY, "mkills", -1, -1, 13);
elasiTarget = OBJECT_MCCOY;
- }
- else
+ } else
return;
playSoundEffectIndex(SND_PHASSHOT);
@@ -465,13 +457,11 @@ void Room::tug3Timer1Expired() {
showText(TX_SPEAKER_SHIPS_COMPUTER, TX_COMPU182);
_vm->_awayMission.timers[1] = 100;
_vm->_awayMission.tug.orbitalDecayCounter++;
- }
- else if (_vm->_awayMission.tug.orbitalDecayCounter < 16) { // Decay now unavoidable
+ } else if (_vm->_awayMission.tug.orbitalDecayCounter < 16) { // Decay now unavoidable
showText(TX_SPEAKER_SHIPS_COMPUTER, TX_COMPU181);
_vm->_awayMission.timers[1] = 100;
_vm->_awayMission.tug.orbitalDecayCounter++;
- }
- else { // Game over
+ } else { // Game over
showText(TX_TUG3N006);
showGameOverMenu();
}
diff --git a/engines/startrek/saveload.cpp b/engines/startrek/saveload.cpp
index 87f5a8a..4c98667 100644
--- a/engines/startrek/saveload.cpp
+++ b/engines/startrek/saveload.cpp
@@ -157,13 +157,11 @@ bool StarTrekEngine::loadGame(int slot) {
a->sprite.setBitmap(loadAnimationFrame(a->bitmapFilename, a->scale));
}
}
- }
- else if (_gameMode == -1) {
+ } else if (_gameMode == -1) {
initBridge(true);
_lastGameMode = GAMEMODE_BRIDGE;
// TODO: mode change
- }
- else {
+ } else {
_txtFilename = _missionToLoad;
initBridge(false);
// TODO: mode change
@@ -300,8 +298,7 @@ bool StarTrekEngine::saveOrLoadGameData(Common::SeekableReadStream *in, Common::
a.saveLoadWithSerializer(ser);
_actionQueue.push(a);
}
- }
- else { // Saving
+ } else { // Saving
int16 n = _actionQueue.size();
ser.syncAsSint16LE(n);
for (int i = 0; i < n; i++) {
@@ -347,8 +344,7 @@ bool saveOrLoadMetadata(Common::SeekableReadStream *in, Common::WriteStream *out
if (ser.isLoading()) {
if (!::Graphics::loadThumbnail(*in, meta->thumbnail))
meta->thumbnail = nullptr;
- }
- else
+ } else
::Graphics::saveThumbnail(*out);
// Creation date/time
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 9db92f8..7ce3e51 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
-
+
#include "startrek/sound.h"
#include "common/file.h"
@@ -80,7 +80,7 @@ Sound::~Sound() {
void Sound::clearAllMidiSlots() {
- for (int i=0; i < NUM_MIDI_SLOTS; i++) {
+ for (int i = 0; i < NUM_MIDI_SLOTS; i++) {
clearMidiSlot(i);
}
}
@@ -235,7 +235,7 @@ void Sound::playSpeech(const Common::String &basename) {
i++;
}
- Common::String filename = "voc/" + Common::String(name.c_str(), name.c_str()+i) + ".voc";
+ Common::String filename = "voc/" + Common::String(name.c_str(), name.c_str() + i) + ".voc";
debugC(5, kDebugSound, "Playing speech '%s'", filename.c_str());
Common::SeekableReadStream *readStream = SearchMan.createReadStreamForMember(filename);
if (readStream == nullptr)
@@ -300,8 +300,7 @@ void Sound::setSfxEnabled(bool enable) {
if (!enable) {
stopAllVocSounds();
- }
- else if (!_loopingAudioName.empty()) {
+ } else if (!_loopingAudioName.empty()) {
playVoc(_loopingAudioName);
}
}
@@ -315,33 +314,33 @@ void Sound::checkLoopMusic() {
// XMIDI or SM sound
void Sound::loadPCMusicFile(const Common::String &baseSoundName) {
Common::String soundName = baseSoundName;
-
+
soundName += '.';
-
+
switch (MidiDriver::getMusicType(_midiDevice)) {
- case MT_MT32:
- if (_vm->getFeatures() & GF_DEMO)
- soundName += "ROL";
- else
- soundName += "MT";
- break;
- case MT_PCSPK:
- if (_vm->getFeatures() & GF_DEMO)
- return; // Not supported...
- else
- soundName += "PC";
- break;
- default:
- if (_vm->getFeatures() & GF_DEMO)
- soundName += "ADL";
- else
- soundName += "AD";
- break;
+ case MT_MT32:
+ if (_vm->getFeatures() & GF_DEMO)
+ soundName += "ROL";
+ else
+ soundName += "MT";
+ break;
+ case MT_PCSPK:
+ if (_vm->getFeatures() & GF_DEMO)
+ return; // Not supported...
+ else
+ soundName += "PC";
+ break;
+ default:
+ if (_vm->getFeatures() & GF_DEMO)
+ soundName += "ADL";
+ else
+ soundName += "AD";
+ break;
}
-
+
debugC(5, kDebugSound, "Loading midi \'%s\'\n", soundName.c_str());
SharedPtr<FileStream> soundStream = _vm->loadFile(soundName.c_str());
-
+
if (loadedSoundData != nullptr)
delete[] loadedSoundData;
loadedSoundData = new byte[soundStream->size()];
@@ -359,7 +358,7 @@ void Sound::clearMidiSlot(int slot) {
// Static callback method
void Sound::midiDriverCallback(void *data) {
- Sound *s = (Sound*)data;
+ Sound *s = (Sound *)data;
for (int i = 0; i < NUM_MIDI_SLOTS; i++)
s->_midiSlots[i].midiParser->onTimer();
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
index 37100b4..5354d92 100644
--- a/engines/startrek/sound.h
+++ b/engines/startrek/sound.h
@@ -30,7 +30,7 @@
#include "audio/mixer.h"
namespace Common {
- class MacResManager;
+class MacResManager;
}
namespace StarTrek {
@@ -114,7 +114,7 @@ class Sound {
public:
Sound(StarTrekEngine *vm);
~Sound();
-
+
void clearAllMidiSlots();
/**
* Plays a midi track as a sound effect (one of midi slots 1-7)
@@ -131,21 +131,21 @@ public:
void setMusicEnabled(bool enable);
void setSfxEnabled(bool enable);
void checkLoopMusic();
-
+
private:
StarTrekEngine *_vm;
Audio::SoundHandle *_soundHandle;
-
+
void loadPCMusicFile(const Common::String &baseSoundName);
void clearMidiSlot(int slot);
-
+
// MIDI-Related Variables
MidiDriver *_midiDriver;
MidiPlaybackSlot _midiSlots[NUM_MIDI_SLOTS]; // 0 is for music; 1-7 are for sfx
- Common::List<MidiPlaybackSlot*> _midiSlotList; // Sorts midi slots by most recently used
+ Common::List<MidiPlaybackSlot *> _midiSlotList; // Sorts midi slots by most recently used
byte *loadedSoundData;
- uint32 _midiDevice;
+ uint32 _midiDevice;
// VOC-related variables
Audio::SoundHandle _sfxHandles[MAX_SFX_PLAYING];
diff --git a/engines/startrek/space.cpp b/engines/startrek/space.cpp
index 2f5981a..f549d4a 100644
--- a/engines/startrek/space.cpp
+++ b/engines/startrek/space.cpp
@@ -101,7 +101,7 @@ void StarTrekEngine::drawStarfield() {
Point3 point2 = matrixMult(p, _starPositionMatrix);
if (point2.z > _flt_50898 && point2.z < 0x3fff
- && abs(point2.x) < point2.z && abs(point2.y) < point2.z) {
+ && abs(point2.x) < point2.z && abs(point2.y) < point2.z) {
int16 x = _starfieldXVar1 + scaleSpacePosition(point2.x, point2.z);
int16 y = _starfieldYVar1 - scaleSpacePosition(point2.y, point2.z);
diff --git a/engines/startrek/sprite.cpp b/engines/startrek/sprite.cpp
index 61ff6a5..821a78e 100644
--- a/engines/startrek/sprite.cpp
+++ b/engines/startrek/sprite.cpp
@@ -30,7 +30,7 @@ Sprite::Sprite() :
bitmap(), drawMode(0), textColor(0), bitmapChanged(false),
rect2Valid(false), isOnScreen(false), field16(false), lastDrawRect(),
drawRect(), rectangle2(), drawX(0), drawY(0)
- {}
+{}
void Sprite::setBitmap(SharedPtr<Bitmap> b) {
bitmap = b;
diff --git a/engines/startrek/sprite.h b/engines/startrek/sprite.h
index d498c18..b91e2f2 100644
--- a/engines/startrek/sprite.h
+++ b/engines/startrek/sprite.h
@@ -57,7 +57,7 @@ struct Sprite : Common::Serializable {
Common::Rect lastDrawRect; // Rect encompassing the sprite last time it was drawn
Common::Rect drawRect; // Rect encompassing the sprite currently
Common::Rect rectangle2;
- int16 drawX,drawY;
+ int16 drawX, drawY;
Sprite();
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index f678d21..a0eada7 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -454,8 +454,7 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
if (_missionToLoad.equalsIgnoreCase("feather") && name[4] == 'b') {
loadActorAnim(9, "qteleb", 0x61, 0x79, 1.0);
- }
- else if (_missionToLoad.equalsIgnoreCase("trial")) {
+ } else if (_missionToLoad.equalsIgnoreCase("trial")) {
if (name[4] == 'd') {
loadActorAnim(9, "qteled", 0x61, 0x79, 1.0);
}
@@ -548,7 +547,7 @@ void StarTrekEngine::playSoundEffectIndex(int index) {
_sound->playVoc("WARP");
break;
default:
- break;
+ break;
}
}
@@ -585,15 +584,13 @@ int StarTrekEngine::loadActorAnim(int actorIndex, const Common::String &animName
if (actorIndex == -1) {
// TODO
warning("loadActorAnim: actor == -1");
- }
- else
+ } else
actor = &_actorList[actorIndex];
if (actor->spriteDrawn) {
releaseAnim(actor);
drawActorToScreen(actor, animName, x, y, scale, false);
- }
- else {
+ } else {
drawActorToScreen(actor, animName, x, y, scale, true);
}
@@ -634,8 +631,7 @@ bool StarTrekEngine::actorWalkToPosition(int actorIndex, const Common::String &a
chooseActorDirectionForWalking(actor, srcX, srcY, destX, destY);
updateActorPositionWhileWalking(actor, (actor->granularPosX + 0.5).toInt(), (actor->granularPosY + 0.5).toInt());
return true;
- }
- else {
+ } else {
actor->iwSrcPosition = _iwFile->getClosestKeyPosition(srcX, srcY);
actor->iwDestPosition = _iwFile->getClosestKeyPosition(destX, destY);
@@ -648,8 +644,7 @@ bool StarTrekEngine::actorWalkToPosition(int actorIndex, const Common::String &a
initStandAnim(actorIndex);
return false;
- }
- else {
+ } else {
Common::Point iwSrc = _iwFile->_keyPositions[actor->iwSrcPosition];
chooseActorDirectionForWalking(actor, srcX, srcY, iwSrc.x, iwSrc.y);
updateActorPositionWhileWalking(actor, (actor->granularPosX + 0.5).toInt(), (actor->granularPosY + 0.5).toInt());
@@ -687,8 +682,7 @@ void StarTrekEngine::updateActorAnimations() {
removeActorFromScreen(i);
else
initStandAnim(i);
- }
- else {
+ } else {
Sprite *sprite = &actor->sprite;
actor->animFile->seek(actor->animFrame * 22, SEEK_SET);
@@ -742,8 +736,7 @@ void StarTrekEngine::updateActorAnimations() {
actor->granularPosY = newY;
actor->frameToStartNextAnim = _frameIndex;
}
- }
- else { // actor->field90 == 0
+ } else { // actor->field90 == 0
if (actor->iwSrcPosition == -1) {
if (actor->triggerActionWhenAnimFinished) {
actor->triggerActionWhenAnimFinished = false;
@@ -753,15 +746,13 @@ void StarTrekEngine::updateActorAnimations() {
actor->sprite.bitmap.reset();
updateActorPositionWhileWalking(actor, (actor->granularPosX + 0.5).toInt(), (actor->granularPosY + 0.5).toInt());
initStandAnim(i);
- }
- else { // actor->iwSrcPosition != -1
+ } else { // actor->iwSrcPosition != -1
if (actor->iwSrcPosition == actor->iwDestPosition) {
actor->animationString2[strlen(actor->animationString2) - 1] = '\0';
actor->iwDestPosition = -1;
actor->iwSrcPosition = -1;
chooseActorDirectionForWalking(actor, actor->pos.x, actor->pos.y, actor->dest.x, actor->dest.y);
- }
- else {
+ } else {
int index = _iwFile->_iwEntries[actor->iwSrcPosition][actor->iwDestPosition];
actor->iwSrcPosition = index;
Common::Point dest = _iwFile->_keyPositions[actor->iwSrcPosition];
@@ -951,8 +942,7 @@ void StarTrekEngine::chooseActorDirectionForWalking(Actor *actor, int16 srcX, in
actor->speedY = Fixed16(distY) / absDistX;
}
- }
- else {
+ } else {
char d;
if (distY > 0)
d = 'S';
@@ -999,8 +989,7 @@ bool StarTrekEngine::directPathExists(int16 srcX, int16 srcY, int16 destX, int16
speedX = 1.0;
else
speedX = -1.0;
- }
- else { // absDistX <= absDistY
+ } else { // absDistX <= absDistY
distCounter = absDistY;
if (distCounter == 0)
@@ -1059,15 +1048,14 @@ int StarTrekEngine::findObjectAt(int x, int y) {
if ((word & actionBit) && isPointInPolygon((int16 *)(_room->_rdfData + offset + 6), x, y)) {
int actorIndex = _room->readRdfWord(offset + 6);
_objectHasWalkPosition = true;
- _objectWalkPosition.x = _room->readRdfWord(offset + 2);
- _objectWalkPosition.y = _room->readRdfWord(offset + 4);
+ _objectWalkPosition.x = _room->readRdfWord(offset + 2);
+ _objectWalkPosition.y = _room->readRdfWord(offset + 4);
return actorIndex;
}
int numVertices = _room->readRdfWord(offset + 8);
offset = offset + 10 + numVertices * 4;
- }
- else {
+ } else {
if (isPointInPolygon((int16 *)(_room->_rdfData + offset), x, y)) {
int actorIndex = _room->readRdfWord(offset);
return actorIndex;
@@ -1090,12 +1078,11 @@ SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filen
char c = filename[0];
if ((strcmp(basename, "stnd") == 0 || strcmp(basename, "tele") == 0)
- && (c == 'm' || c == 's' || c == 'k' || c == 'r')) {
+ && (c == 'm' || c == 's' || c == 'k' || c == 'r')) {
if (c == 'm') {
// Mccoy has the "base" animations for all crewmen
bitmapToReturn = _gfx->loadBitmap(filename);
- }
- else {
+ } else {
// All crewman other than mccoy copy the animation frames from mccoy, change
// the colors of the uniforms, and load an "xor" file to redraw the face.
@@ -1131,8 +1118,7 @@ SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filen
if (colorShift == 0) {
memcpy(bitmapToReturn->pixels, bitmap->pixels, width * height);
- }
- else {
+ } else {
byte *src = bitmap->pixels;
byte *dest = bitmapToReturn->pixels;
byte baseUniformColor = 0xa8;
@@ -1163,8 +1149,7 @@ SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filen
}
}
}
- }
- else {
+ } else {
// TODO: when loading a bitmap, it passes a different argument than is standard to
// the "file loading with cache" function...
bitmapToReturn = _gfx->loadBitmap(filename);
@@ -1193,34 +1178,28 @@ int StarTrekEngine::selectObjectForUseAction() {
updateMouseBitmap();
_gfx->drawAllSprites();
_sound->checkLoopMusic();
- }
- else if (event.type == TREKEVENT_LBUTTONDOWN) {
+ } else if (event.type == TREKEVENT_LBUTTONDOWN) {
removeNextEvent();
break;
- }
- else if (event.type == TREKEVENT_MOUSEMOVE) {
- }
- else if (event.type == TREKEVENT_RBUTTONDOWN) {
+ } else if (event.type == TREKEVENT_MOUSEMOVE) {
+ } else if (event.type == TREKEVENT_RBUTTONDOWN) {
// Allow this to be processed by main away mission loop
break;
- }
- else if (event.type == TREKEVENT_KEYDOWN) {
+ } else if (event.type == TREKEVENT_KEYDOWN) {
if (event.kbd.keycode == Common::KEYCODE_ESCAPE
- || event.kbd.keycode == Common::KEYCODE_w
- || event.kbd.keycode == Common::KEYCODE_t
- || event.kbd.keycode == Common::KEYCODE_u
- || event.kbd.keycode == Common::KEYCODE_g
- || event.kbd.keycode == Common::KEYCODE_l
- || event.kbd.keycode == Common::KEYCODE_SPACE
- || event.kbd.keycode == Common::KEYCODE_F2) {
+ || event.kbd.keycode == Common::KEYCODE_w
+ || event.kbd.keycode == Common::KEYCODE_t
+ || event.kbd.keycode == Common::KEYCODE_u
+ || event.kbd.keycode == Common::KEYCODE_g
+ || event.kbd.keycode == Common::KEYCODE_l
+ || event.kbd.keycode == Common::KEYCODE_SPACE
+ || event.kbd.keycode == Common::KEYCODE_F2) {
// Allow these buttons to be processed by main away mission loop
break;
- }
- else if (event.kbd.keycode == Common::KEYCODE_i) {
+ } else if (event.kbd.keycode == Common::KEYCODE_i) {
removeNextEvent();
break;
- }
- else if (event.kbd.keycode == Common::KEYCODE_RETURN || event.kbd.keycode == Common::KEYCODE_KP_ENTER || event.kbd.keycode == Common::KEYCODE_F1) {
+ } else if (event.kbd.keycode == Common::KEYCODE_RETURN || event.kbd.keycode == Common::KEYCODE_KP_ENTER || event.kbd.keycode == Common::KEYCODE_F1) {
// Simulate left-click
removeNextEvent();
event.type = TREKEVENT_LBUTTONDOWN;
@@ -1237,8 +1216,7 @@ int StarTrekEngine::selectObjectForUseAction() {
if (clickedObject == -1)
continue;
return clickedObject;
- }
- else if (event.type == TREKEVENT_LBUTTONDOWN) {
+ } else if (event.type == TREKEVENT_LBUTTONDOWN) {
int clickedObject = findObjectAt(_gfx->getMousePos());
hideInventoryIcons();
@@ -1252,14 +1230,13 @@ int StarTrekEngine::selectObjectForUseAction() {
continue;
else
return clickedObject;
- }
- else if (clickedObject <= OBJECT_REDSHIRT)
+ } else if (clickedObject <= OBJECT_REDSHIRT)
return clickedObject;
else if (isObjectUnusable(OBJECT_KIRK, ACTION_USE))
continue;
else if (_room->actionHasCode(ACTION_USE, OBJECT_KIRK, clickedObject, 0)
- || _room->actionHasCode(ACTION_GET, clickedObject, 0, 0)
- || _room->actionHasCode(ACTION_WALK, clickedObject, 0, 0)) {
+ || _room->actionHasCode(ACTION_GET, clickedObject, 0, 0)
+ || _room->actionHasCode(ACTION_WALK, clickedObject, 0, 0)) {
_awayMission.activeObject = OBJECT_KIRK;
_awayMission.passiveObject = clickedObject;
_awayMission.activeAction = ACTION_USE;
@@ -1267,11 +1244,9 @@ int StarTrekEngine::selectObjectForUseAction() {
if (!walkActiveObjectToHotspot())
addAction(_awayMission.activeAction, _awayMission.activeObject, _awayMission.passiveObject, 0);
return clickedObject;
- }
- else
+ } else
continue;
- }
- else {
+ } else {
hideInventoryIcons();
return -1;
}
@@ -1342,8 +1317,7 @@ bool StarTrekEngine::walkActiveObjectToHotspot() {
objectIndex = OBJECT_MCCOY;
else
objectIndex = OBJECT_KIRK;
- }
- else // This is the original error message...
+ } else // This is the original error message...
error("Jay didn't think about pmcheck");
byte finishedAnimActionParam = false;
@@ -1381,8 +1355,7 @@ bool StarTrekEngine::walkActiveObjectToHotspot() {
}
_objectHasWalkPosition = false;
return true;
- }
- else {
+ } else {
_objectHasWalkPosition = false;
return false;
}
@@ -1484,8 +1457,7 @@ void StarTrekEngine::updateCrewmanGetupTimers() {
char d;
if (dir == -1) {
d = actor->direction;
- }
- else {
+ } else {
const char *dirs = "nsew";
Fixed8 scale = getActorScaleAtPosition(actor->sprite.pos.y);
d = dirs[dir];
@@ -1494,8 +1466,7 @@ void StarTrekEngine::updateCrewmanGetupTimers() {
if (d == 'n') {
xOffset = -24;
yOffset = -8;
- }
- else if (d == 'w') {
+ } else if (d == 'w') {
xOffset = -35;
yOffset = -12;
}
@@ -1717,8 +1688,7 @@ SharedPtr<Bitmap> StarTrekEngine::scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed8 s
while (origRow <= origHeight) {
if (var2e < 0) {
var2e += var30;
- }
- else {
+ } else {
var2e += var32;
scaleBitmapRow(src, dest, origWidth, scaledWidth);
dest += scaledWidth;
@@ -1727,8 +1697,7 @@ SharedPtr<Bitmap> StarTrekEngine::scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed8 s
src += bitmap->width;
origRow++;
}
- }
- else {
+ } else {
int16 var2e = (origHeight << 1) - scaledHeight;
uint16 var30 = origHeight << 1;
uint16 var32 = (origHeight - scaledHeight) << 1;
@@ -1748,8 +1717,7 @@ SharedPtr<Bitmap> StarTrekEngine::scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed8 s
if (var2e < 0) {
var2e += var30;
- }
- else {
+ } else {
var2e += var32;
src += origWidth;
srcRowChanged = true;
@@ -1775,8 +1743,7 @@ void StarTrekEngine::scaleBitmapRow(byte *src, byte *dest, uint16 origWidth, uin
while (var8-- != 0) {
if (var2 < 0) {
var2 += var4;
- }
- else {
+ } else {
var2 += var6;
if (di != 0) {
if (varE != 0) {
@@ -1794,8 +1761,7 @@ void StarTrekEngine::scaleBitmapRow(byte *src, byte *dest, uint16 origWidth, uin
di++;
varA++;
}
- }
- else {
+ } else {
int16 var2 = ((origWidth - 1) << 1) - (scaledWidth - 1);
uint16 var4 = (origWidth - 1) << 1;
uint16 var6 = ((origWidth - 1) - (scaledWidth - 1)) << 1;
@@ -1836,11 +1802,11 @@ SharedPtr<FileStream> StarTrekEngine::loadFile(Common::String filename, int file
bool bigEndian = getPlatform() == Common::kPlatformAmiga;
- for (int i=filename.size()-1; ; i--) {
+ for (int i = filename.size() - 1; ; i--) {
if (filename[i] == '.') {
basename = filename;
extension = filename;
- basename.replace(i, filename.size()-i, "");
+ basename.replace(i, filename.size() - i, "");
extension.replace(0, i + 1, "");
break;
}
@@ -1876,12 +1842,12 @@ SharedPtr<FileStream> StarTrekEngine::loadFile(Common::String filename, int file
if (!indexFile)
error("Could not open data.dir");
}
-
+
uint32 indexOffset = 0;
bool foundData = false;
uint16 fileCount = 1;
uint16 uncompressedSize = 0;
-
+
while (!indexFile->eos() && !indexFile->err()) {
Common::String testfile;
for (byte i = 0; i < 8; i++) {
@@ -1901,10 +1867,10 @@ SharedPtr<FileStream> StarTrekEngine::loadFile(Common::String filename, int file
uncompressedSize = indexFile->readUint16LE();
} else {
if (getPlatform() == Common::kPlatformAmiga)
- indexOffset = (indexFile->readByte() << 16) + (indexFile->readByte() << 8) + indexFile->readByte();
- else
+ indexOffset = (indexFile->readByte() << 16) + (indexFile->readByte() << 8) + indexFile->readByte();
+ else
indexOffset = indexFile->readByte() + (indexFile->readByte() << 8) + (indexFile->readByte() << 16);
-
+
if (indexOffset & (1 << 23)) {
fileCount = (indexOffset >> 16) & 0x7F;
indexOffset = indexOffset & 0xFFFF;
@@ -1926,7 +1892,7 @@ SharedPtr<FileStream> StarTrekEngine::loadFile(Common::String filename, int file
// Files can be accessed "sequentially" if their filenames are the same except for
// the last character being incremented by one.
if ((basename.lastChar() >= '1' && basename.lastChar() <= '9') ||
- (basename.lastChar() >= 'B' && basename.lastChar() <= 'Z')) {
+ (basename.lastChar() >= 'B' && basename.lastChar() <= 'Z')) {
basename.setChar(basename.lastChar() - 1, basename.size() - 1);
return loadFile(basename + "." + extension, fileIndex + 1);
} else
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 312942a..b6b7215 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -54,7 +54,7 @@ using Common::SharedPtr;
using Common::String;
namespace Common {
- class MacResManager;
+class MacResManager;
}
namespace StarTrek {
@@ -62,7 +62,7 @@ namespace StarTrek {
class StarTrekEngine;
class Room;
-typedef String (StarTrekEngine::*TextGetterFunc)(int, uintptr, String *);
+typedef String(StarTrekEngine::*TextGetterFunc)(int, uintptr, String *);
const int SAVEGAME_DESCRIPTION_LEN = 30;
@@ -84,11 +84,21 @@ struct SavegameMetadata {
saveTimeSecs = time.tm_sec & 0xFF;
}
- int getDay() { return (saveDate >> 24) & 0xFF; }
- int getMonth() { return (saveDate >> 16) & 0xFF; }
- int getYear() { return saveDate & 0xFFFF; }
- int getHour() { return (saveTime >> 8) & 0xFF; }
- int getMinute() { return saveTime & 0xFF; }
+ int getDay() {
+ return (saveDate >> 24) & 0xFF;
+ }
+ int getMonth() {
+ return (saveDate >> 16) & 0xFF;
+ }
+ int getYear() {
+ return saveDate & 0xFFFF;
+ }
+ int getHour() {
+ return (saveTime >> 8) & 0xFF;
+ }
+ int getMinute() {
+ return saveTime & 0xFF;
+ }
};
@@ -106,7 +116,7 @@ enum StarTrekGameType {
};
enum StarTrekGameFeatures {
- GF_DEMO = (1 << 0)
+ GF_DEMO = (1 << 0)
};
enum kDebugLevels {
@@ -356,7 +366,9 @@ public:
bool directPathExists(int16 srcX, int16 srcY, int16 destX, int16 destY);
int findObjectAt(int x, int y);
- int findObjectAt(Common::Point p) { return findObjectAt(p.x, p.y); }
+ int findObjectAt(Common::Point p) {
+ return findObjectAt(p.x, p.y);
+ }
/**
* Loads a bitmap for the animation frame with the given scale.
*/
@@ -423,7 +435,9 @@ public:
void updateClockTicks();
bool checkKeyPressed();
- Common::EventManager *getEventMan() { return _eventMan; }
+ Common::EventManager *getEventMan() {
+ return _eventMan;
+ }
private:
Common::List<TrekEvent> _eventQueue;
@@ -592,7 +606,7 @@ public:
Common::Language getLanguage();
// Resource related functions
- SharedPtr<FileStream> loadFile(Common::String filename, int fileIndex=0);
+ SharedPtr<FileStream> loadFile(Common::String filename, int fileIndex = 0);
/**
* TODO: Figure out what the extra parameters are, and if they're important.
*/
@@ -644,10 +658,10 @@ public:
Item _itemList[NUM_OBJECTS];
Actor _actorList[NUM_ACTORS];
- Actor * const _kirkActor;
- Actor * const _spockActor;
- Actor * const _mccoyActor;
- Actor * const _redshirtActor;
+ Actor *const _kirkActor;
+ Actor *const _spockActor;
+ Actor *const _mccoyActor;
+ Actor *const _redshirtActor;
SharedPtr<FileStream> _actorBanFiles[NUM_ACTORS / 2];
uint16 _actorBanVar2[NUM_ACTORS / 2]; // TODO: initialize?
@@ -705,7 +719,7 @@ public:
Matrix _starPositionMatrix;
Matrix _someMatrix;
float _flt_50898;
-
+
Graphics *_gfx;
Sound *_sound;
SharedPtr<IWFile> _iwFile;
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index b53b0b9..e2f2715 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -117,7 +117,7 @@ String StarTrekEngine::readTextFromRdf(int choiceIndex, uintptr data, String *he
if (speakerOffset == 0 || room->_rdfData[speakerOffset] == '\0')
*headerTextOutput = "";
else {
- char *speakerText = (char*)&room->_rdfData[speakerOffset];
+ char *speakerText = (char *)&room->_rdfData[speakerOffset];
if (room->readRdfWord(rdfVar + 4) != 0) // Check if there's more than one option
getTextboxHeader(headerTextOutput, speakerText, choiceIndex + 1);
else
@@ -125,7 +125,7 @@ String StarTrekEngine::readTextFromRdf(int choiceIndex, uintptr data, String *he
}
}
- return (char*)&room->_rdfData[textOffset];
+ return (char *)&room->_rdfData[textOffset];
}
void StarTrekEngine::showTextbox(String headerText, const String &mainText, int xoffset, int yoffset, byte textColor, int maxTextLines) {
@@ -202,7 +202,7 @@ int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset
int numChoices = 0;
String speakerText;
- while(true) {
+ while (true) {
String choiceText = (this->*textGetter)(numChoices, var, &speakerText);
if (choiceText.empty())
break;
@@ -231,13 +231,13 @@ int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset
int choiceIndex = 0;
int scrollOffset = 0;
if (tmpTextDisplayMode != TEXTDISPLAY_WAIT && tmpTextDisplayMode != TEXTDISPLAY_SUBTITLES
- && numChoices == 1 && _sfxEnabled && !_sfxWorking)
+ && numChoices == 1 && _sfxEnabled && !_sfxWorking)
_textboxHasMultipleChoices = false;
else
_textboxHasMultipleChoices = true;
if (tmpTextDisplayMode >= TEXTDISPLAY_WAIT && tmpTextDisplayMode <= TEXTDISPLAY_NONE
- && _sfxEnabled && !_sfxWorking)
+ && _sfxEnabled && !_sfxWorking)
_textboxVar6 = true;
else
_textboxVar6 = false;
@@ -286,7 +286,7 @@ int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset
if (ticksUntilClickingEnabled != 0)
enableMenuButtons(1 << TEXTBUTTON_CONFIRM);
- switch(textboxReturnCode) {
+ switch (textboxReturnCode) {
case MENUEVENT_RCLICK_OFFBUTTON:
case MENUEVENT_RCLICK_ONBUTTON:
@@ -337,20 +337,20 @@ readjustScrollDown:
enableMenuButtons(1 << TEXTBUTTON_SCROLLUP);
if (scrollOffset >= numTextLines)
scrollOffset -= numTextboxLines;
- if (scrollOffset > numTextLines-1)
- scrollOffset = numTextLines-1;
- if (scrollOffset+numTextboxLines >= numTextLines)
+ if (scrollOffset > numTextLines - 1)
+ scrollOffset = numTextLines - 1;
+ if (scrollOffset + numTextboxLines >= numTextLines)
disableMenuButtons(1 << TEXTBUTTON_SCROLLDOWN);
goto readjustScroll;
readjustScroll:
textboxSprite.bitmapChanged = true;
drawMainText(
- textBitmap,
- numTextLines-scrollOffset,
- numTextboxLines,
- lineFormattedText.c_str() + scrollOffset*(TEXTBOX_WIDTH-2),
- numChoicesWithNames != 0);
+ textBitmap,
+ numTextLines - scrollOffset,
+ numTextboxLines,
+ lineFormattedText.c_str() + scrollOffset * (TEXTBOX_WIDTH - 2),
+ numChoicesWithNames != 0);
break;
case TEXTBUTTON_PREVCHOICE:
@@ -359,7 +359,7 @@ readjustScroll:
disableMenuButtons(1 << TEXTBUTTON_PREVCHOICE);
} else {
if (choiceIndex < 0)
- choiceIndex = numChoices-1;
+ choiceIndex = numChoices - 1;
}
enableMenuButtons(1 << TEXTBUTTON_NEXTCHOICE);
goto reloadText;
@@ -367,7 +367,7 @@ readjustScroll:
case TEXTBUTTON_NEXTCHOICE:
enableMenuButtons(1 << TEXTBUTTON_PREVCHOICE);
choiceIndex++;
- if (!loopChoices && choiceIndex == numChoices-1) {
+ if (!loopChoices && choiceIndex == numChoices - 1) {
disableMenuButtons(1 << TEXTBUTTON_NEXTCHOICE);
} else {
choiceIndex %= numChoices;
@@ -380,7 +380,7 @@ reloadText:
if (numTextLines <= numTextboxLines) {
setVisibleMenuButtons((1 << TEXTBUTTON_CONFIRM) | (1 << TEXTBUTTON_PREVCHOICE) | (1 << TEXTBUTTON_NEXTCHOICE));
} else {
- setVisibleMenuButtons((1 << TEXTBUTTON_CONFIRM) | (1 << TEXTBUTTON_SCROLLUP) | (1 << TEXTBUTTON_SCROLLDOWN)| (1 << TEXTBUTTON_PREVCHOICE) | (1 << TEXTBUTTON_NEXTCHOICE));
+ setVisibleMenuButtons((1 << TEXTBUTTON_CONFIRM) | (1 << TEXTBUTTON_SCROLLUP) | (1 << TEXTBUTTON_SCROLLDOWN) | (1 << TEXTBUTTON_PREVCHOICE) | (1 << TEXTBUTTON_NEXTCHOICE));
}
enableMenuButtons(1 << TEXTBUTTON_SCROLLDOWN);
disableMenuButtons(1 << TEXTBUTTON_SCROLLUP);
@@ -424,10 +424,10 @@ int StarTrekEngine::getNumTextboxLines(const String &str) {
int lines = 0;
while (text != nullptr) {
- text = getNextTextLine(text, line, TEXTBOX_WIDTH-2);
+ text = getNextTextLine(text, line, TEXTBOX_WIDTH - 2);
lines++;
}
- return lines-1;
+ return lines - 1;
}
String StarTrekEngine::putTextIntoLines(const String &_text) {
@@ -436,17 +436,17 @@ String StarTrekEngine::putTextIntoLines(const String &_text) {
const char *text = _text.c_str();
String output;
- text = getNextTextLine(text, line, TEXTBOX_WIDTH-2);
+ text = getNextTextLine(text, line, TEXTBOX_WIDTH - 2);
while (text != nullptr) {
int len = strlen(line);
- while (len != TEXTBOX_WIDTH-2) {
+ while (len != TEXTBOX_WIDTH - 2) {
line[len++] = ' ';
line[len] = '\0';
}
output += line;
- text = getNextTextLine(text, line, TEXTBOX_WIDTH-2);
+ text = getNextTextLine(text, line, TEXTBOX_WIDTH - 2);
}
return output;
@@ -462,7 +462,7 @@ SharedPtr<TextBitmap> StarTrekEngine::initTextSprite(int *xoffsetPtr, int *yoffs
int textHeight = numTextLines + linesBeforeTextStart;
- SharedPtr<TextBitmap> bitmap(new TextBitmap(TEXTBOX_WIDTH*8, textHeight*8));
+ SharedPtr<TextBitmap> bitmap(new TextBitmap(TEXTBOX_WIDTH * 8, textHeight * 8));
*sprite = Sprite();
sprite->drawPriority = 15;
@@ -470,9 +470,9 @@ SharedPtr<TextBitmap> StarTrekEngine::initTextSprite(int *xoffsetPtr, int *yoffs
sprite->bitmap = bitmap;
sprite->textColor = textColor;
- memset(bitmap->pixels, ' ', textHeight*TEXTBOX_WIDTH);
+ memset(bitmap->pixels, ' ', textHeight * TEXTBOX_WIDTH);
- int varC = SCREEN_WIDTH-1 - xoffset - (bitmap->width + 0x1d) / 2;
+ int varC = SCREEN_WIDTH - 1 - xoffset - (bitmap->width + 0x1d) / 2;
if (varC < 0)
xoffset += varC;
@@ -484,35 +484,35 @@ SharedPtr<TextBitmap> StarTrekEngine::initTextSprite(int *xoffsetPtr, int *yoffs
if (varC < 0)
yoffset -= varC;
- xoffset -= (bitmap->width + 0x1d)/2;
+ xoffset -= (bitmap->width + 0x1d) / 2;
yoffset -= bitmap->height;
bitmap->pixels[0] = 0x10;
- memset(&bitmap->pixels[1], 0x11, TEXTBOX_WIDTH-2);
- bitmap->pixels[TEXTBOX_WIDTH-1] = 0x12;
+ memset(&bitmap->pixels[1], 0x11, TEXTBOX_WIDTH - 2);
+ bitmap->pixels[TEXTBOX_WIDTH - 1] = 0x12;
byte *textAddr = bitmap->pixels + TEXTBOX_WIDTH;
if (withHeader) {
textAddr[0] = 0x13;
- textAddr[TEXTBOX_WIDTH-1] = 0x14;
+ textAddr[TEXTBOX_WIDTH - 1] = 0x14;
textAddr += TEXTBOX_WIDTH;
textAddr[0] = 0x13;
- memset(&textAddr[1], 0x19, TEXTBOX_WIDTH-2);
- textAddr[TEXTBOX_WIDTH-1] = 0x14;
+ memset(&textAddr[1], 0x19, TEXTBOX_WIDTH - 2);
+ textAddr[TEXTBOX_WIDTH - 1] = 0x14;
textAddr += TEXTBOX_WIDTH;
}
- for (int line=0; line<numTextLines; line++) {
+ for (int line = 0; line < numTextLines; line++) {
textAddr[0] = 0x13;
- textAddr[TEXTBOX_WIDTH-1] = 0x14;
+ textAddr[TEXTBOX_WIDTH - 1] = 0x14;
textAddr += TEXTBOX_WIDTH;
}
textAddr[0] = 0x15;
- memset(&textAddr[1], 0x16, TEXTBOX_WIDTH-2);
- textAddr[TEXTBOX_WIDTH-1] = 0x17;
+ memset(&textAddr[1], 0x16, TEXTBOX_WIDTH - 2);
+ textAddr[TEXTBOX_WIDTH - 1] = 0x17;
_gfx->addSprite(sprite);
sprite->drawMode = 3;
@@ -562,7 +562,7 @@ String StarTrekEngine::readLineFormattedText(TextGetterFunc textGetter, uintptr
if (oldSize != text.size())
_textboxHasMultipleChoices = true;
} else if ((_textDisplayMode == TEXTDISPLAY_WAIT || _textDisplayMode == TEXTDISPLAY_SUBTITLES)
- && _sfxEnabled && _sfxWorking) {
+ && _sfxEnabled && _sfxWorking) {
text = playTextAudio(text);
} else {
text = skipTextAudioPrompt(text);
@@ -581,24 +581,6 @@ String StarTrekEngine::readLineFormattedText(TextGetterFunc textGetter, uintptr
return lineFormattedText;
} else
return nullptr;
-
- /* Barebones implementation
- *numTextLines = 1;
-
- uint numChars = textBitmap->width*textBitmap->height;
-
- String text = (this->*textGetter)(choiceIndex, var, nullptr);
- while (text.size() < numChars) text += ' ';
-
- byte *dest = textBitmap->pixels + TEXTBOX_WIDTH + 1;
-
- for (int y=0; y<*numTextLines; y++) {
- memcpy(dest, text.c_str(), TEXTBOX_WIDTH-2);
- dest += TEXTBOX_WIDTH;
- }
-
- return text;
- */
}
String StarTrekEngine::readTextFromArray(int choiceIndex, uintptr data, String *headerTextOutput) {
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index a5d38bd..b4a7598 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -2440,7 +2440,7 @@ enum GameStringIDs {
};
// TODO: Move this out of the header file. It's inflating the executable size.
-const char * const g_gameStrings[] = {
+const char *const g_gameStrings[] = {
nullptr,
"",
"Dialog error",
Commit: b8c244da875f676dcc401ecff1e165baeb2d4ab7
https://github.com/scummvm/scummvm/commit/b8c244da875f676dcc401ecff1e165baeb2d4ab7
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Clean up room-specific vars in mission 1
Changed paths:
engines/startrek/room.h
engines/startrek/rooms/demon0.cpp
engines/startrek/rooms/demon1.cpp
engines/startrek/rooms/demon3.cpp
engines/startrek/rooms/demon4.cpp
engines/startrek/rooms/demon5.cpp
engines/startrek/rooms/demon6.cpp
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 484613a..5fd9826 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2140,13 +2140,20 @@ private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
struct {
+ // demon0
+ byte bottomDoorCounter; // 0xca
+ byte topDoorCounter; // 0xcb
+ bool movingToTopDoor; // 0xcc
+ bool movingToBottomDoor; // 0xcd
+
+ // demon1
+ bool klingonShot[3]; // 0xca
int numKlingonsKilled;
byte attackIndex;
bool kirkShooting;
char d6[10];
- } demon1;
- struct {
+ // demon3
bool shootingBoulder; // 0xca
bool boulder1Shot; // 0xcb
byte boulderBeingShot; // 0xcc
@@ -2158,18 +2165,16 @@ private:
bool kirkPhaserOut; // 0xd3
char boulderAnim[10]; // 0xd4
int16 usedPhaserOnDoor; // 0xd6
- } demon3;
- struct {
+ // demon4
bool triedToShootNauian; // 0xca
bool nauianEmerged; // 0xcb
bool disabledSecurity; // 0xcc
bool cd; // 0xcd
byte crewReadyToBeamOut; // 0xce
int16 crewmanUsingPanel; // 0xcf
- } demon4;
- struct {
+ // demon5
bool scannedRoberts; // 0xca
bool scannedChub; // 0xcb
bool scannedGrisnash; // 0xcc
@@ -2180,17 +2185,16 @@ private:
bool talkedToChub; // 0xd1
bool talkedToGrisnash; // 0xd2
bool talkedToStephen; // 0xd3
- byte doorCounter; // 0xd4
- bool movingToDoor; // 0xd5
- } demon5;
- struct {
+ // demon6
bool insultedStephenRecently; // 0xca
bool stephenInRoom; // 0xcb
bool caseOpened; // 0xcd
- byte doorCounter; // 0xce
- bool movingToDoor; // 0xcf
- } demon6;
+
+ // common
+ bool movingToDoor;
+ byte doorCounter;
+ } demon;
struct {
byte shootingObject; // 0x1ec1
@@ -2199,7 +2203,6 @@ private:
byte shootKirkOverride; // 0x1ec4
} tug2;
-
struct {
// love0
bool heardSummaryOfVirus; // 0xda
diff --git a/engines/startrek/rooms/demon0.cpp b/engines/startrek/rooms/demon0.cpp
index e16e884..189509a 100644
--- a/engines/startrek/rooms/demon0.cpp
+++ b/engines/startrek/rooms/demon0.cpp
@@ -65,40 +65,40 @@ void Room::demon0TouchedWarp0() {
void Room::demon0WalkToBottomDoor() {
_vm->_awayMission.disableInput = 1;
- _rdfData[0xcd] = 1; // FIXME
+ _roomVar.demon.movingToBottomDoor = true;
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 243, 158, 1);
}
void Room::demon0TouchedHotspot1() {
- if (_rdfData[0xcd] != 1) // FIXME: not portable to mac/amiga?
+ if (!_roomVar.demon.movingToBottomDoor)
return;
loadActorAnim2(9, "s0r0d1", 254, 153, 1);
playSoundEffectIndex(0x05);
}
void Room::demon0ReachedBottomDoor() {
- if (++_rdfData[0xca] != 2) // FIXME
+ if (++_roomVar.demon.bottomDoorCounter != 2)
return;
loadRoomIndex(5, 0);
}
void Room::demon0WalkToTopDoor() {
_vm->_awayMission.disableInput = 1;
- _rdfData[0xcc] = 1; // FIXME
+ _roomVar.demon.movingToTopDoor = true;
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 157, 134, 2);
}
void Room::demon0TouchedHotspot0() {
- if (_rdfData[0xcc] != 1) // FIXME: not portable to mac/amiga?
+ if (!_roomVar.demon.movingToTopDoor)
return;
loadActorAnim2(10, "s0r0d2", 158, 130, 2);
playSoundEffectIndex(0x05);
}
void Room::demon0ReachedTopDoor() {
- if (++_rdfData[0xcb] != 2) // FIXME
+ if (++_roomVar.demon.topDoorCounter != 2)
return;
loadRoomIndex(6, 3);
}
diff --git a/engines/startrek/rooms/demon1.cpp b/engines/startrek/rooms/demon1.cpp
index a30b5cc..c1519b7 100644
--- a/engines/startrek/rooms/demon1.cpp
+++ b/engines/startrek/rooms/demon1.cpp
@@ -54,15 +54,15 @@ void Room::demon1Tick1() {
loadActorAnim(9, "klg2d2", 0xaa, 0x7c, 0);
loadActorAnim(10, "klg3d2", 0, 0, 0);
- _rdfData[0xca] = 1; // FIXME
- _rdfData[0xcb] = 1;
- _rdfData[0xcc] = 1;
- _roomVar.demon1.numKlingonsKilled = 3;
+ _roomVar.demon.klingonShot[0] = true;
+ _roomVar.demon.klingonShot[1] = true;
+ _roomVar.demon.klingonShot[2] = true;
+ _roomVar.demon.numKlingonsKilled = 3;
}
}
void Room::demon1WalkToCave() {
- if (_roomVar.demon1.numKlingonsKilled != 3)
+ if (_roomVar.demon.numKlingonsKilled != 3)
return;
walkCrewman(OBJECT_KIRK, 0xa3, 0x56, 2);
}
@@ -103,42 +103,42 @@ void Room::demon1Timer1Expired() {
int shooter;
Common::String anim;
- if (_rdfData[0xca] != 1) {
+ if (!_roomVar.demon.klingonShot[0]) {
anim = "klg1f";
shooter = 8;
- switch (_roomVar.demon1.attackIndex) {
+ switch (_roomVar.demon.attackIndex) {
case 0:
- strcpy(_roomVar.demon1.d6, "klg1fr");
+ strcpy(_roomVar.demon.d6, "klg1fr");
break;
case 1:
- strcpy(_roomVar.demon1.d6, "klg1fm");
+ strcpy(_roomVar.demon.d6, "klg1fm");
break;
case 2:
- strcpy(_roomVar.demon1.d6, "klg1fs");
+ strcpy(_roomVar.demon.d6, "klg1fs");
break;
case 3:
- strcpy(_roomVar.demon1.d6, "klg1fk");
+ strcpy(_roomVar.demon.d6, "klg1fk");
break;
default:
// TODO
return;
}
- } else if (_rdfData[0xcb] != 1) {
+ } else if (!_roomVar.demon.klingonShot[1]) {
anim = "klg2f";
shooter = 9;
- switch (_roomVar.demon1.attackIndex) {
+ switch (_roomVar.demon.attackIndex) {
case 0:
- strcpy(_roomVar.demon1.d6, "klg2fr");
+ strcpy(_roomVar.demon.d6, "klg2fr");
break;
case 1:
- strcpy(_roomVar.demon1.d6, "klg2fm");
+ strcpy(_roomVar.demon.d6, "klg2fm");
break;
case 2:
- strcpy(_roomVar.demon1.d6, "klg2fs");
+ strcpy(_roomVar.demon.d6, "klg2fs");
break;
case 3:
- strcpy(_roomVar.demon1.d6, "klg2fk");
+ strcpy(_roomVar.demon.d6, "klg2fk");
break;
default:
// TODO
@@ -147,18 +147,18 @@ void Room::demon1Timer1Expired() {
} else {
anim = "klg3f";
shooter = 10;
- switch (_roomVar.demon1.attackIndex) {
+ switch (_roomVar.demon.attackIndex) {
case 0:
- strcpy(_roomVar.demon1.d6, "klg3fr");
+ strcpy(_roomVar.demon.d6, "klg3fr");
break;
case 1:
- strcpy(_roomVar.demon1.d6, "klg3fm");
+ strcpy(_roomVar.demon.d6, "klg3fm");
break;
case 2:
- strcpy(_roomVar.demon1.d6, "klg3fs");
+ strcpy(_roomVar.demon.d6, "klg3fs");
break;
case 3:
- strcpy(_roomVar.demon1.d6, "klg3fk");
+ strcpy(_roomVar.demon.d6, "klg3fk");
break;
default:
// TODO
@@ -170,21 +170,21 @@ void Room::demon1Timer1Expired() {
}
void Room::demon1KlingonFinishedAimingWeapon() {
- loadActorAnim(11, _roomVar.demon1.d6, 0, 0, 0);
+ loadActorAnim(11, _roomVar.demon.d6, 0, 0, 0);
playSoundEffectIndex(0x06);
- _roomVar.demon1.attackIndex++;
+ _roomVar.demon.attackIndex++;
int crewman;
- if (_roomVar.demon1.attackIndex == 1) {
+ if (_roomVar.demon.attackIndex == 1) {
loadActorAnim2(OBJECT_REDSHIRT, "rstunn", -1, -1, 0);
crewman = OBJECT_REDSHIRT;
- } else if (_roomVar.demon1.attackIndex == 2) {
+ } else if (_roomVar.demon.attackIndex == 2) {
loadActorAnim2(OBJECT_SPOCK, "sstunn", -1, -1, 0);
crewman = OBJECT_SPOCK;
- } else if (_roomVar.demon1.attackIndex == 3) {
+ } else if (_roomVar.demon.attackIndex == 3) {
loadActorAnim2(OBJECT_MCCOY, "mstune", -1, -1, 0);
crewman = OBJECT_MCCOY;
- } else if (_roomVar.demon1.attackIndex == 4) {
+ } else if (_roomVar.demon.attackIndex == 4) {
loadActorAnim2(OBJECT_KIRK, "kstunn", -1, -1, 1);
crewman = OBJECT_KIRK;
}
@@ -202,27 +202,27 @@ void Room::demon1KirkShot() {
}
void Room::demon1UsePhaserOnAnything() {
- if (_roomVar.demon1.numKlingonsKilled == 3)
+ if (_roomVar.demon.numKlingonsKilled == 3)
showText(TX_SPEAKER_MCCOY, TX_DEM1_011);
}
void Room::demon1UsePhaserOnKlingon1() {
- if (_rdfData[0xca] != 0)
+ if (_roomVar.demon.klingonShot[0])
return;
_vm->_awayMission.disableInput = 1;
- _rdfData[0xca] = 1;
+ _roomVar.demon.klingonShot[0] = true;
- if (_roomVar.demon1.kirkShooting) {
+ if (_roomVar.demon.kirkShooting) {
demon1ShootKlingon1();
} else {
loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 3);
- _roomVar.demon1.kirkShooting = true;
+ _roomVar.demon.kirkShooting = true;
}
}
void Room::demon1ShootKlingon1() {
- _roomVar.demon1.numKlingonsKilled++;
- if (_roomVar.demon1.numKlingonsKilled == 3) {
+ _roomVar.demon.numKlingonsKilled++;
+ if (_roomVar.demon.numKlingonsKilled == 3) {
_vm->_awayMission.timers[1] = 0;
_vm->_awayMission.timers[5] = 180;
_vm->_awayMission.timers[6] = 1;
@@ -246,7 +246,7 @@ void Room::demon1KlingonDropsHand() {
showText(TX_SPEAKER_EVERTS, TX_DEM1_025);
- if (_roomVar.demon1.numKlingonsKilled == 3)
+ if (_roomVar.demon.numKlingonsKilled == 3)
return;
showText(TX_SPEAKER_KLINGON, TX_DEM1_F23);
@@ -255,22 +255,22 @@ void Room::demon1KlingonDropsHand() {
}
void Room::demon1UsePhaserOnKlingon2() {
- if (_rdfData[0xcb] != 0)
+ if (_roomVar.demon.klingonShot[1])
return;
_vm->_awayMission.disableInput = 1;
- _rdfData[0xcb] = 1;
+ _roomVar.demon.klingonShot[1] = true;
- if (_roomVar.demon1.kirkShooting) {
+ if (_roomVar.demon.kirkShooting) {
demon1ShootKlingon2();
} else {
loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 4);
- _roomVar.demon1.kirkShooting = true;
+ _roomVar.demon.kirkShooting = true;
}
}
void Room::demon1ShootKlingon2() {
- _roomVar.demon1.numKlingonsKilled++;
- if (_roomVar.demon1.numKlingonsKilled == 3) {
+ _roomVar.demon.numKlingonsKilled++;
+ if (_roomVar.demon.numKlingonsKilled == 3) {
_vm->_awayMission.timers[1] = 0;
_vm->_awayMission.timers[5] = 180;
_vm->_awayMission.timers[6] = 1;
@@ -284,22 +284,22 @@ void Room::demon1ShootKlingon2() {
}
void Room::demon1UsePhaserOnKlingon3() {
- if (_rdfData[0xcc] != 0)
+ if (_roomVar.demon.klingonShot[2])
return;
_vm->_awayMission.disableInput = 1;
- _rdfData[0xcc] = 1;
+ _roomVar.demon.klingonShot[2] = true;
- if (_roomVar.demon1.kirkShooting) {
+ if (_roomVar.demon.kirkShooting) {
demon1ShootKlingon3();
} else {
loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 5);
- _roomVar.demon1.kirkShooting = true;
+ _roomVar.demon.kirkShooting = true;
}
}
void Room::demon1ShootKlingon3() {
- _roomVar.demon1.numKlingonsKilled++;
- if (_roomVar.demon1.numKlingonsKilled == 3) {
+ _roomVar.demon.numKlingonsKilled++;
+ if (_roomVar.demon.numKlingonsKilled == 3) {
_vm->_awayMission.timers[1] = 0;
_vm->_awayMission.timers[5] = 180;
_vm->_awayMission.timers[6] = 1;
@@ -377,7 +377,7 @@ void Room::demon1UseSTricorderOnKlingon1() {
playSoundEffectIndex(0x04);
- if (_roomVar.demon1.numKlingonsKilled == 3 && !_vm->_awayMission.demon.tookKlingonHand && _rdfData[0xcf] != 1) {
+ if (_roomVar.demon.numKlingonsKilled == 3 && !_vm->_awayMission.demon.tookKlingonHand && _rdfData[0xcf] != 1) {
showText(TX_SPEAKER_SPOCK, TX_DEM1_018);
_rdfData[0xcf] = 1;
} else {
@@ -413,7 +413,7 @@ void Room::demon1UseMTricorderOnCrewman() {
}
void Room::demon1GetHand() {
- if (_roomVar.demon1.numKlingonsKilled != 3)
+ if (_roomVar.demon.numKlingonsKilled != 3)
return;
walkCrewman(OBJECT_KIRK, 0x104, 0x8e, 1);
}
@@ -511,7 +511,7 @@ void Room::demon1LookAtRedshirt() {
void Room::demon1TalkToKirk() {
if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_KIRK))
demon1TalkToUnconsciousCrewman();
- else if (_roomVar.demon1.numKlingonsKilled == 3)
+ else if (_roomVar.demon.numKlingonsKilled == 3)
showText(TX_SPEAKER_KIRK, TX_DEM1_001);
}
diff --git a/engines/startrek/rooms/demon3.cpp b/engines/startrek/rooms/demon3.cpp
index 8584465..f862838 100644
--- a/engines/startrek/rooms/demon3.cpp
+++ b/engines/startrek/rooms/demon3.cpp
@@ -28,10 +28,10 @@ void Room::demon3Tick1() {
playVoc("DEM3LOOP");
loadActorAnim(8, "light", 0xab, 0x03, 0);
- _roomVar.demon3.boulder1Shot = true;
+ _roomVar.demon.boulder1Shot = true;
if (!_vm->_awayMission.demon.boulder1Gone) {
loadActorAnim(9, "bldr1", 0x26, 0, 0);
- _roomVar.demon3.boulder1Shot = false;
+ _roomVar.demon.boulder1Shot = false;
}
if (!_vm->_awayMission.demon.boulder2Gone) {
loadActorAnim(10, "bldr2", 0x22, 0, 0);
@@ -65,7 +65,7 @@ void Room::demon3Tick1() {
// Boulder falling over
void Room::demon3Timer0Expired() {
- _roomVar.demon3.boulder1Shot = true;
+ _roomVar.demon.boulder1Shot = true;
loadActorAnim2(9, "drbldr", 0x26, 0, 0);
_vm->_awayMission.timers[1] = 13;
_vm->_awayMission.demon.boulder1Gone = true;
@@ -77,7 +77,7 @@ void Room::demon3Timer0Expired() {
// Redshirt pushing Kirk away
void Room::demon3Timer1Expired() {
- _roomVar.demon3.kirkPhaserOut = false;
+ _roomVar.demon.kirkPhaserOut = false;
loadActorAnim2(OBJECT_REDSHIRT, "redkil", 0x46, 0xa0, 0);
loadActorAnim2(OBJECT_KIRK, "redkil", 0x46, 0xa0, 1);
}
@@ -100,7 +100,7 @@ void Room::demon3FinishedAnimation1() {
loadActorAnim2(OBJECT_REDSHIRT, "deadre", 0x46, 0xa0, 0);
loadActorStandAnim(OBJECT_SPOCK);
walkCrewman(OBJECT_MCCOY, 0x9c, 0xb2, 5);
- _roomVar.demon3.inFiringPosition = false;
+ _roomVar.demon.inFiringPosition = false;
_vm->_awayMission.redshirtDead = true;
}
@@ -119,50 +119,50 @@ void Room::demon3FinishedWalking5() {
void Room::demon3McCoyInFiringPosition() {
loadActorAnim2(OBJECT_MCCOY, "mwaitn", 0xd6, 0xb8, 0);
- _roomVar.demon3.mccoyInPosition = true;
+ _roomVar.demon.mccoyInPosition = true;
demon3CrewmanInFiringPosition();
}
void Room::demon3SpockInFiringPosition() {
loadActorAnim2(OBJECT_SPOCK, "swaitn", 0xae, 0xb4, 0);
- _roomVar.demon3.spockInPosition = true;
+ _roomVar.demon.spockInPosition = true;
demon3CrewmanInFiringPosition();
}
void Room::demon3RedShirtInFiringPosition() {
loadActorAnim2(OBJECT_REDSHIRT, "rwaitn", 0x46, 0xa0, 0);
- _roomVar.demon3.redshirtInPosition = true;
+ _roomVar.demon.redshirtInPosition = true;
demon3CrewmanInFiringPosition();
}
void Room::demon3KirkInFiringPosition() {
loadActorAnim2(OBJECT_KIRK, "kwaitn", 0x79, 0xa0, 0);
- _roomVar.demon3.kirkInPosition = true;
+ _roomVar.demon.kirkInPosition = true;
demon3CrewmanInFiringPosition();
}
void Room::demon3CrewmanInFiringPosition() {
- if (_roomVar.demon3.kirkInPosition && _roomVar.demon3.spockInPosition && _roomVar.demon3.mccoyInPosition && (_vm->_awayMission.redshirtDead || _roomVar.demon3.redshirtInPosition))
+ if (_roomVar.demon.kirkInPosition && _roomVar.demon.spockInPosition && _roomVar.demon.mccoyInPosition && (_vm->_awayMission.redshirtDead || _roomVar.demon.redshirtInPosition))
demon3PullOutPhaserAndFireAtBoulder();
}
void Room::demon3PullOutPhaserAndFireAtBoulder() {
- if (_roomVar.demon3.kirkPhaserOut)
+ if (_roomVar.demon.kirkPhaserOut)
demon3FireAtBoulder();
else {
loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 4);
- _roomVar.demon3.kirkPhaserOut = true;
+ _roomVar.demon.kirkPhaserOut = true;
}
}
void Room::demon3FireAtBoulder() {
- _roomVar.demon3.kirkInPosition = false;
- _roomVar.demon3.spockInPosition = false;
- _roomVar.demon3.mccoyInPosition = false;
- _roomVar.demon3.redshirtInPosition = false;
- _roomVar.demon3.shootingBoulder = false;
+ _roomVar.demon.kirkInPosition = false;
+ _roomVar.demon.spockInPosition = false;
+ _roomVar.demon.mccoyInPosition = false;
+ _roomVar.demon.redshirtInPosition = false;
+ _roomVar.demon.shootingBoulder = false;
- switch (_roomVar.demon3.boulderBeingShot) {
+ switch (_roomVar.demon.boulderBeingShot) {
case 1: // FIXME: animation overlaps on Kirk, probably due to sprite sorting inaccuracy
loadActorAnim2(9, "sbldr1", 0x22, 0, 0);
break;
@@ -188,9 +188,9 @@ void Room::demon3FireAtBoulder() {
}
}
- loadActorAnim(17, _roomVar.demon3.boulderAnim, 0, 0, 0);
+ loadActorAnim(17, _roomVar.demon.boulderAnim, 0, 0, 0);
playSoundEffectIndex(0x06);
- if (!_roomVar.demon3.boulder1Shot)
+ if (!_roomVar.demon.boulder1Shot)
_vm->_awayMission.timers[0] = 1;
_vm->_awayMission.disableInput = false;
}
@@ -206,34 +206,34 @@ void Room::demon3UseStunPhaserOnBoulder() {
}
void Room::demon3UsePhaserOnBoulder1() {
- if (_roomVar.demon3.shootingBoulder || _vm->_awayMission.demon.boulder1Gone)
+ if (_roomVar.demon.shootingBoulder || _vm->_awayMission.demon.boulder1Gone)
return;
_vm->_awayMission.demon.boulder1Gone = true;
_vm->_awayMission.demon.numBouldersGone++;
- _roomVar.demon3.boulderBeingShot = 1;
- _roomVar.demon3.boulder1Shot = true;
- strcpy(_roomVar.demon3.boulderAnim, "s0r3s2");
+ _roomVar.demon.boulderBeingShot = 1;
+ _roomVar.demon.boulder1Shot = true;
+ strcpy(_roomVar.demon.boulderAnim, "s0r3s2");
demon3BoulderCommon();
}
void Room::demon3UsePhaserOnBoulder2() {
- if (_roomVar.demon3.shootingBoulder || _vm->_awayMission.demon.boulder2Gone)
+ if (_roomVar.demon.shootingBoulder || _vm->_awayMission.demon.boulder2Gone)
return;
_vm->_awayMission.demon.boulder2Gone = true;
_vm->_awayMission.demon.numBouldersGone++;
- _roomVar.demon3.boulderBeingShot = 2;
- strcpy(_roomVar.demon3.boulderAnim, "s0r3s3");
+ _roomVar.demon.boulderBeingShot = 2;
+ strcpy(_roomVar.demon.boulderAnim, "s0r3s3");
demon3BoulderCommon();
}
void Room::demon3UsePhaserOnBoulder3() {
if (_vm->_awayMission.demon.boulder1Gone) {
- if (_roomVar.demon3.shootingBoulder || _vm->_awayMission.demon.boulder3Gone)
+ if (_roomVar.demon.shootingBoulder || _vm->_awayMission.demon.boulder3Gone)
return;
_vm->_awayMission.demon.boulder3Gone = true;
_vm->_awayMission.demon.numBouldersGone++;
- _roomVar.demon3.boulderBeingShot = 3;
- strcpy(_roomVar.demon3.boulderAnim, "s0r3s1");
+ _roomVar.demon.boulderBeingShot = 3;
+ strcpy(_roomVar.demon.boulderAnim, "s0r3s1");
demon3BoulderCommon();
} else {
showText(TX_SPEAKER_SPOCK, TX_DEM3_006);
@@ -242,12 +242,12 @@ void Room::demon3UsePhaserOnBoulder3() {
void Room::demon3UsePhaserOnBoulder4() {
if (_vm->_awayMission.demon.boulder2Gone) {
- if (_roomVar.demon3.shootingBoulder || _vm->_awayMission.demon.boulder4Gone)
+ if (_roomVar.demon.shootingBoulder || _vm->_awayMission.demon.boulder4Gone)
return;
_vm->_awayMission.demon.boulder4Gone = true;
_vm->_awayMission.demon.numBouldersGone++;
- _roomVar.demon3.boulderBeingShot = 4;
- strcpy(_roomVar.demon3.boulderAnim, "s0r3s4");
+ _roomVar.demon.boulderBeingShot = 4;
+ strcpy(_roomVar.demon.boulderAnim, "s0r3s4");
_vm->_awayMission.demon.foundMiner = true;
demon3BoulderCommon();
} else {
@@ -261,11 +261,11 @@ void Room::demon3BoulderCommon() {
_vm->_awayMission.disableInput = true;
Common::Point pos = getActorPos(OBJECT_KIRK);
if (!(pos.x == 0x79 && pos.y == 0xa0)) {
- _roomVar.demon3.inFiringPosition = false;
- _roomVar.demon3.kirkPhaserOut = false;
+ _roomVar.demon.inFiringPosition = false;
+ _roomVar.demon.kirkPhaserOut = false;
}
- if (_roomVar.demon3.inFiringPosition) {
+ if (_roomVar.demon.inFiringPosition) {
demon3PullOutPhaserAndFireAtBoulder();
} else {
showText(TX_SPEAKER_KIRK, TX_DEM3_001);
@@ -276,8 +276,8 @@ void Room::demon3BoulderCommon() {
if (!_vm->_awayMission.redshirtDead)
walkCrewman(OBJECT_REDSHIRT, 0x46, 0xa0, 4);
- _roomVar.demon3.shootingBoulder = true;
- _roomVar.demon3.inFiringPosition = true;
+ _roomVar.demon.shootingBoulder = true;
+ _roomVar.demon.inFiringPosition = true;
}
}
@@ -385,11 +385,11 @@ void Room::demon3UseMTricorderOnDoor() {
}
void Room::demon3UsePhaserOnDoor() {
- _roomVar.demon3.usedPhaserOnDoor++;
+ _roomVar.demon.usedPhaserOnDoor++;
- if (_roomVar.demon3.usedPhaserOnDoor == 1)
+ if (_roomVar.demon.usedPhaserOnDoor == 1)
showText(TX_DEM3N009);
- else if (_roomVar.demon3.usedPhaserOnDoor == 2)
+ else if (_roomVar.demon.usedPhaserOnDoor == 2)
showText(TX_SPEAKER_SPOCK, TX_DEM3_011);
}
@@ -431,8 +431,8 @@ void Room::demon3UseMedkitOnMiner() {
showText(TX_SPEAKER_MCCOY, TX_DEM3_015);
} else {
walkCrewman(OBJECT_MCCOY, 0xe6, 0x7b, 6);
- _roomVar.demon3.inFiringPosition = false;
- _roomVar.demon3.kirkPhaserOut = false;
+ _roomVar.demon.inFiringPosition = false;
+ _roomVar.demon.kirkPhaserOut = false;
}
}
diff --git a/engines/startrek/rooms/demon4.cpp b/engines/startrek/rooms/demon4.cpp
index d70c5fb..7a8d95f 100644
--- a/engines/startrek/rooms/demon4.cpp
+++ b/engines/startrek/rooms/demon4.cpp
@@ -36,7 +36,7 @@ void Room::demon4Tick1() {
if (_vm->_awayMission.demon.solvedSunPuzzle) {
loadActorAnim(10, "bxrise2", 0x122, 0x91, 0);
loadActorAnim(8, "stpout2", 0x107, 0x92, 0);
- _roomVar.demon4.nauianEmerged = true;
+ _roomVar.demon.nauianEmerged = true;
if ((_vm->_awayMission.demon.itemsTakenFromCase & 0x10) && !_vm->_awayMission.demon.gaveSkullToNauian)
_vm->_awayMission.timers[6] = 20;
@@ -51,14 +51,14 @@ void Room::demon4Tick1() {
// Alien emerged
void Room::demon4FinishedAnimation1() {
loadActorAnim(8, "stpout", 0x107, 0x92, 5);
- _roomVar.demon4.nauianEmerged = true;
+ _roomVar.demon.nauianEmerged = true;
if (_vm->_awayMission.demon.itemsTakenFromCase & 0x10)
_vm->_awayMission.timers[6] = 45;
}
void Room::demon4FinishedAnimation2() {
- if (!_roomVar.demon4.cd) {
- _roomVar.demon4.cd = true;
+ if (!_roomVar.demon.cd) {
+ _roomVar.demon.cd = true;
showText(TX_DEM4N011);
}
@@ -100,12 +100,12 @@ void Room::demon4Timer1Expired() {
if (!_vm->_awayMission.redshirtDead)
walkCrewman(OBJECT_REDSHIRT, 0xc1, 0x91, 4);
else
- _roomVar.demon4.crewReadyToBeamOut++;
+ _roomVar.demon.crewReadyToBeamOut++;
}
void Room::demon4CrewmanReachedBeamoutPosition() {
- _roomVar.demon4.crewReadyToBeamOut++;
- if (_roomVar.demon4.crewReadyToBeamOut != 4)
+ _roomVar.demon.crewReadyToBeamOut++;
+ if (_roomVar.demon.crewReadyToBeamOut != 4)
return;
if (!_vm->_awayMission.demon.insultedStephen)
@@ -137,9 +137,9 @@ void Room::demon4Timer6Expired() {
}
void Room::demon4UsePhaserOnNauian() {
- if (!_roomVar.demon4.triedToShootNauian) { // Lenient the first time
+ if (!_roomVar.demon.triedToShootNauian) { // Lenient the first time
showText(TX_SPEAKER_NAUIAN, TX_DEM4_033);
- _roomVar.demon4.triedToShootNauian = true;
+ _roomVar.demon.triedToShootNauian = true;
} else { // Murdery the second time
showText(TX_SPEAKER_NAUIAN, TX_DEM4_032);
loadActorAnim2(10, "bxfire", 0, 0, 2);
@@ -266,7 +266,7 @@ void Room::demon4TalkToNauian() {
showText(TX_SPEAKER_NAUIAN, TX_DEM4_040);
- if (_roomVar.demon4.disabledSecurity) { // Impossible condition?
+ if (_roomVar.demon.disabledSecurity) { // Impossible condition?
showText(TX_SPEAKER_NAUIAN, TX_DEM4_037);
// BUGFIX: Originally all of these used no audio, despite the files existing
@@ -331,30 +331,30 @@ void Room::demon4LookAtPanel() {
}
void Room::demon4UseKirkOnPanel() {
- _roomVar.demon4.crewmanUsingPanel = OBJECT_KIRK;
+ _roomVar.demon.crewmanUsingPanel = OBJECT_KIRK;
demon4UseCrewmanOnPanel();
}
void Room::demon4UseSpockOnPanel() {
- _roomVar.demon4.crewmanUsingPanel = OBJECT_SPOCK;
+ _roomVar.demon.crewmanUsingPanel = OBJECT_SPOCK;
demon4UseCrewmanOnPanel();
}
void Room::demon4UseMccoyOnPanel() {
- _roomVar.demon4.crewmanUsingPanel = OBJECT_MCCOY;
+ _roomVar.demon.crewmanUsingPanel = OBJECT_MCCOY;
demon4UseCrewmanOnPanel();
}
void Room::demon4UseRedshirtOnPanel() {
- _roomVar.demon4.crewmanUsingPanel = OBJECT_REDSHIRT;
+ _roomVar.demon.crewmanUsingPanel = OBJECT_REDSHIRT;
demon4UseCrewmanOnPanel();
}
void Room::demon4UseCrewmanOnPanel() {
if (_vm->_awayMission.demon.solvedSunPuzzle)
return;
- walkCrewman(_roomVar.demon4.crewmanUsingPanel, 0xda, 0x83, 3);
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.demon4.crewmanUsingPanel] = DIR_N;
+ walkCrewman(_roomVar.demon.crewmanUsingPanel, 0xda, 0x83, 3);
+ _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.demon.crewmanUsingPanel] = DIR_N;
_vm->_awayMission.disableInput = true;
}
@@ -367,7 +367,7 @@ void Room::demon4CrewmanReachedPanel() {
} else
showText(TX_DEM4N013);
- walkCrewman(_roomVar.demon4.crewmanUsingPanel, 0xae, 0x93, 0);
+ walkCrewman(_roomVar.demon.crewmanUsingPanel, 0xae, 0x93, 0);
_vm->_awayMission.disableInput = false;
}
@@ -539,21 +539,21 @@ void Room::demon4TalkToKirk() {
}
void Room::demon4TalkToMccoy() {
- if (_roomVar.demon4.nauianEmerged)
+ if (_roomVar.demon.nauianEmerged)
showText(TX_SPEAKER_MCCOY, TX_DEM4_019);
else
showText(TX_SPEAKER_MCCOY, TX_DEM4_015);
}
void Room::demon4TalkToSpock() {
- if (_roomVar.demon4.nauianEmerged)
+ if (_roomVar.demon.nauianEmerged)
showText(TX_SPEAKER_SPOCK, TX_DEM4_022);
else
showText(TX_SPEAKER_SPOCK, TX_DEM4_024);
}
void Room::demon4TalkToRedshirt() {
- if (_roomVar.demon4.nauianEmerged)
+ if (_roomVar.demon.nauianEmerged)
showText(TX_SPEAKER_EVERTS, TX_DEM4_047);
else
showText(TX_SPEAKER_EVERTS, TX_DEM4_046);
diff --git a/engines/startrek/rooms/demon5.cpp b/engines/startrek/rooms/demon5.cpp
index 7227dd0..8af51fe 100644
--- a/engines/startrek/rooms/demon5.cpp
+++ b/engines/startrek/rooms/demon5.cpp
@@ -37,12 +37,12 @@ void Room::demon5Tick1() {
void Room::demon5WalkToDoor() {
_vm->_awayMission.disableInput = true;
- _roomVar.demon5.movingToDoor = true;
+ _roomVar.demon.movingToDoor = true;
walkCrewman(OBJECT_KIRK, 0xa0, 0x94, 1);
}
void Room::demon5TouchedDoorOpenTrigger() {
- if (!_roomVar.demon5.movingToDoor)
+ if (!_roomVar.demon.movingToDoor)
return;
loadActorAnim(12, "s0r6d1", 0xa0, 0x92, 1);
playSoundEffectIndex(0x05);
@@ -51,8 +51,8 @@ void Room::demon5TouchedDoorOpenTrigger() {
void Room::demon5DoorOpenedOrReachedDoor() {
// This is invoked when the door opens and when Kirk reaches the door.
// Must wait for both to occur.
- _roomVar.demon5.doorCounter++;
- if (_roomVar.demon5.doorCounter == 2)
+ _roomVar.demon.doorCounter++;
+ if (_roomVar.demon.doorCounter == 2)
loadRoomIndex(0, 1);
}
@@ -153,9 +153,9 @@ void Room::demon5LookAtChub() {
void Room::demon5TalkToRoberts() {
if (_vm->_awayMission.demon.curedChub) {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_030);
- if (!_roomVar.demon5.talkedToRoberts) {
- _roomVar.demon5.talkedToRoberts = true;
- _roomVar.demon5.numTalkedTo++;
+ if (!_roomVar.demon.talkedToRoberts) {
+ _roomVar.demon.talkedToRoberts = true;
+ _roomVar.demon.numTalkedTo++;
demon5CheckCompletedStudy();
}
} else {
@@ -171,9 +171,9 @@ void Room::demon5TalkToChub() {
showText(TX_SPEAKER_KIRK, TX_DEM5_005);
showText(TX_SPEAKER_CHUB, TX_DEM5L031);
- if (!_roomVar.demon5.talkedToChub) {
- _roomVar.demon5.talkedToChub = true;
- _roomVar.demon5.numTalkedTo++;
+ if (!_roomVar.demon.talkedToChub) {
+ _roomVar.demon.talkedToChub = true;
+ _roomVar.demon.numTalkedTo++;
demon5CheckCompletedStudy();
}
} else {
@@ -188,9 +188,9 @@ void Room::demon5TalkToGrisnash() {
showText(TX_SPEAKER_GRISNASH, TX_DEM5_029);
showText(TX_SPEAKER_SPOCK, TX_DEM5_025);
- if (!_roomVar.demon5.talkedToGrisnash) {
- _roomVar.demon5.talkedToGrisnash = true;
- _roomVar.demon5.numTalkedTo++;
+ if (!_roomVar.demon.talkedToGrisnash) {
+ _roomVar.demon.talkedToGrisnash = true;
+ _roomVar.demon.numTalkedTo++;
demon5CheckCompletedStudy();
}
} else {
@@ -206,9 +206,9 @@ void Room::demon5TalkToStephen() {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_031);
showText(TX_SPEAKER_STEPHEN, TX_DEM5_042);
- if (!_roomVar.demon5.talkedToStephen) {
- _roomVar.demon5.talkedToStephen = true;
- _roomVar.demon5.numTalkedTo++;
+ if (!_roomVar.demon.talkedToStephen) {
+ _roomVar.demon.talkedToStephen = true;
+ _roomVar.demon.numTalkedTo++;
demon5CheckCompletedStudy();
}
} else if (!_vm->_awayMission.demon.knowAboutHypoDytoxin) {
@@ -256,14 +256,14 @@ void Room::demon5TalkToMccoy() {
}
void Room::demon5UseMTricorderOnRoberts() {
- if (_roomVar.demon5.scannedRoberts)
+ if (_roomVar.demon.scannedRoberts)
return;
loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0);
playSoundEffectIndex(0x04);
showText(TX_SPEAKER_MCCOY, TX_DEM5_015);
- _roomVar.demon5.scannedRoberts = true;
- _roomVar.demon5.numScanned++;
+ _roomVar.demon.scannedRoberts = true;
+ _roomVar.demon.numScanned++;
demon5CheckCompletedStudy();
}
@@ -272,11 +272,11 @@ void Room::demon5UseMTricorderOnChub() {
playSoundEffectIndex(0x04);
if (_vm->_awayMission.demon.curedChub) {
- if (_roomVar.demon5.scannedChub)
+ if (_roomVar.demon.scannedChub)
return;
showText(TX_SPEAKER_MCCOY, TX_DEM5_016);
- _roomVar.demon5.scannedChub = true;
- _roomVar.demon5.numScanned++;
+ _roomVar.demon.scannedChub = true;
+ _roomVar.demon.numScanned++;
demon5CheckCompletedStudy();
} else {
if (_vm->_awayMission.demon.field3e)
@@ -292,33 +292,33 @@ void Room::demon5UseMTricorderOnChub() {
void Room::demon5UseMTricorderOnGrisnash() {
- if (_roomVar.demon5.scannedGrisnash)
+ if (_roomVar.demon.scannedGrisnash)
return;
loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0);
playSoundEffectIndex(0x04);
showText(TX_SPEAKER_MCCOY, TX_DEM5_013);
- _roomVar.demon5.scannedGrisnash = true;
- _roomVar.demon5.numScanned++;
+ _roomVar.demon.scannedGrisnash = true;
+ _roomVar.demon.numScanned++;
demon5CheckCompletedStudy();
}
void Room::demon5UseMTricorderOnStephen() {
- if (_roomVar.demon5.scannedStephen)
+ if (_roomVar.demon.scannedStephen)
return;
loadActorAnim2(OBJECT_MCCOY, "mscanw", -1, -1, 0);
playSoundEffectIndex(0x04);
showText(TX_SPEAKER_MCCOY, TX_DEM5_014);
- _roomVar.demon5.scannedStephen = true;
- _roomVar.demon5.numScanned++;
+ _roomVar.demon.scannedStephen = true;
+ _roomVar.demon.numScanned++;
demon5CheckCompletedStudy();
}
void Room::demon5CheckCompletedStudy() {
- if (_roomVar.demon5.numScanned == 4 && _roomVar.demon5.numTalkedTo == 4) {
+ if (_roomVar.demon.numScanned == 4 && _roomVar.demon.numTalkedTo == 4) {
showText(TX_SPEAKER_MCCOY, TX_DEM5_011);
- _roomVar.demon5.numTalkedTo = 5;
+ _roomVar.demon.numTalkedTo = 5;
}
}
diff --git a/engines/startrek/rooms/demon6.cpp b/engines/startrek/rooms/demon6.cpp
index a4cd58e..19c6d07 100644
--- a/engines/startrek/rooms/demon6.cpp
+++ b/engines/startrek/rooms/demon6.cpp
@@ -28,7 +28,7 @@ void Room::demon6Tick1() {
playVoc("DEM6LOOP");
if (_vm->_awayMission.demon.gotBerries || (!_vm->_awayMission.demon.field3e && _vm->_awayMission.demon.field37)) {
loadActorAnim(8, "oldman", 0x5f, 0xb1, 0);
- _roomVar.demon6.stephenInRoom = true;
+ _roomVar.demon.stephenInRoom = true;
}
loadActorAnim(10, "s0r6d2", 0xa0, 0x92, 0);
loadActorAnim(9, "scrnan", 0, 0xc7, 0);
@@ -54,20 +54,20 @@ void Room::demon6SpockReachedComputer() {
void Room::demon6WalkToDoor() {
_vm->_awayMission.disableInput = true;
- _roomVar.demon6.movingToDoor = true;
+ _roomVar.demon.movingToDoor = true;
walkCrewman(OBJECT_KIRK, 0xa0, 0x94, 4);
}
void Room::demon6TouchedDoorOpenTrigger() {
- if (!_roomVar.demon6.movingToDoor)
+ if (!_roomVar.demon.movingToDoor)
return;
loadActorAnim(10, "s0r6d1", 0xa0, 0x92, 2);
playSoundEffectIndex(5);
}
void Room::demon6DoorOpenedOrReachedDoor() {
- _roomVar.demon6.doorCounter++;
- if (_roomVar.demon6.doorCounter == 2)
+ _roomVar.demon.doorCounter++;
+ if (_roomVar.demon.doorCounter == 2)
loadRoomIndex(0, 2);
}
@@ -233,8 +233,8 @@ void Room::demon6UseAnythingOnWorkspace() {
}
void Room::demon6UseCrewmanOnCase() {
- if (_roomVar.demon6.stephenInRoom) {
- if (_roomVar.demon6.insultedStephenRecently)
+ if (_roomVar.demon.stephenInRoom) {
+ if (_roomVar.demon.insultedStephenRecently)
return;
showText(TX_SPEAKER_STEPHEN, TX_DEM6_044);
int choices1[] = {TX_SPEAKER_KIRK, TX_DEM6_001, TX_DEM6_006, TX_DEM6_003, TX_BLANK};
@@ -243,7 +243,7 @@ void Room::demon6UseCrewmanOnCase() {
if (choice == 0) {
insult:
showText(TX_SPEAKER_STEPHEN, TX_DEM6_030);
- _roomVar.demon6.insultedStephenRecently = true;
+ _roomVar.demon.insultedStephenRecently = true;
_vm->_awayMission.demon.insultedStephen = true;
} else if (choice == 1) {
showText(TX_SPEAKER_STEPHEN, TX_DEM6_034);
@@ -271,7 +271,7 @@ explain:
break;
case 5:
showText(TX_SPEAKER_STEPHEN, TX_DEM6_041);
- _roomVar.demon6.caseOpened = true;
+ _roomVar.demon.caseOpened = true;
return;
default:
goto error;
@@ -414,7 +414,7 @@ void Room::demon6UseSTricoderOnSynthesizer() {
}
void Room::demon6GetCase() {
- if (!_roomVar.demon6.caseOpened)
+ if (!_roomVar.demon.caseOpened)
showText(TX_DEM6N022);
else
walkCrewman(OBJECT_KIRK, 0xff, 0xba, 5);
Commit: d23965e274497e5c0431c8f8979315f9388da940
https://github.com/scummvm/scummvm/commit/d23965e274497e5c0431c8f8979315f9388da940
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Rename tug2 room-specific vars
Changed paths:
engines/startrek/room.h
engines/startrek/rooms/tug2.cpp
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 5fd9826..0d36e9f 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2197,11 +2197,12 @@ private:
} demon;
struct {
+ // tug2
byte shootingObject; // 0x1ec1
byte shootingTarget;
bool elasiPhaserOnKill;
byte shootKirkOverride; // 0x1ec4
- } tug2;
+ } tug;
struct {
// love0
diff --git a/engines/startrek/rooms/tug2.cpp b/engines/startrek/rooms/tug2.cpp
index e3229c1..a13abb8 100644
--- a/engines/startrek/rooms/tug2.cpp
+++ b/engines/startrek/rooms/tug2.cpp
@@ -610,9 +610,9 @@ void Room::tug2UseCommunicator() {
void Room::tug2DetermineElasiShooter() {
if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_UP)
- _roomVar.tug2.shootingObject = OBJECT_GUARD_2;
+ _roomVar.tug.shootingObject = OBJECT_GUARD_2;
if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_UP)
- _roomVar.tug2.shootingObject = OBJECT_GUARD_1;
+ _roomVar.tug.shootingObject = OBJECT_GUARD_1;
}
// Elasi shoots someone
@@ -620,9 +620,9 @@ void Room::tug2Timer0Expired() {
if (_vm->_awayMission.tug.guard1Status != GUARDSTAT_UP && _vm->_awayMission.tug.guard2Status != GUARDSTAT_UP)
return;
- _roomVar.tug2.elasiPhaserOnKill = 0;
+ _roomVar.tug.elasiPhaserOnKill = 0;
if (_vm->_awayMission.tug.brigElasiPhasersOnKill)
- _roomVar.tug2.elasiPhaserOnKill = 1;
+ _roomVar.tug.elasiPhaserOnKill = 1;
switch (_vm->_awayMission.tug.field4b) {
case 0:
@@ -638,7 +638,7 @@ void Room::tug2Timer0Expired() {
showBitmapFor5Ticks("t2beem00", 5);
playSoundEffectIndex(SND_PHASSHOT);
loadActorAnim2(OBJECT_GUARD_2, "p6fire", -1, -1, 0);
- _vm->_awayMission.tug.field4e = _roomVar.tug2.elasiPhaserOnKill;
+ _vm->_awayMission.tug.field4e = _roomVar.tug.elasiPhaserOnKill;
_vm->_awayMission.timers[0] = 60;
break;
@@ -647,7 +647,7 @@ void Room::tug2Timer0Expired() {
_vm->_awayMission.tug.field4b++;
if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT]) {
tug2DetermineElasiShooter();
- _roomVar.tug2.shootingTarget = OBJECT_REDSHIRT;
+ _roomVar.tug.shootingTarget = OBJECT_REDSHIRT;
_vm->_awayMission.timers[0] = 60;
tug2GuardShootsCrewman();
}
@@ -656,14 +656,14 @@ void Room::tug2Timer0Expired() {
case 2:
// Guard shoots spock (or kirk)
_vm->_awayMission.tug.field4b++;
- _roomVar.tug2.shootKirkOverride = false;
+ _roomVar.tug.shootKirkOverride = false;
if (_vm->_awayMission.tug.brigElasiPhasersOnKill)
- _roomVar.tug2.shootKirkOverride = true;
+ _roomVar.tug.shootKirkOverride = true;
tug2DetermineElasiShooter();
- if (_roomVar.tug2.shootKirkOverride)
- _roomVar.tug2.shootingTarget = OBJECT_KIRK;
+ if (_roomVar.tug.shootKirkOverride)
+ _roomVar.tug.shootingTarget = OBJECT_KIRK;
else
- _roomVar.tug2.shootingTarget = OBJECT_SPOCK;
+ _roomVar.tug.shootingTarget = OBJECT_SPOCK;
_vm->_awayMission.timers[0] = 60;
tug2GuardShootsCrewman();
break;
@@ -672,7 +672,7 @@ void Room::tug2Timer0Expired() {
_vm->_awayMission.tug.field4b++;
if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY]) {
tug2DetermineElasiShooter();
- _roomVar.tug2.shootingTarget = OBJECT_MCCOY;
+ _roomVar.tug.shootingTarget = OBJECT_MCCOY;
_vm->_awayMission.timers[0] = 80;
tug2GuardShootsCrewman();
}
@@ -680,14 +680,14 @@ void Room::tug2Timer0Expired() {
case 4:
_vm->_awayMission.tug.field4b++;
- if (_roomVar.tug2.shootKirkOverride) {
+ if (_roomVar.tug.shootKirkOverride) {
tug2DetermineElasiShooter();
- _roomVar.tug2.shootingTarget = OBJECT_SPOCK;
+ _roomVar.tug.shootingTarget = OBJECT_SPOCK;
_vm->_awayMission.timers[2] = 40;
tug2GuardShootsCrewman();
- } else if (_roomVar.tug2.shootKirkOverride) {
+ } else if (_roomVar.tug.shootKirkOverride) {
tug2DetermineElasiShooter();
- _roomVar.tug2.shootingTarget = OBJECT_KIRK;
+ _roomVar.tug.shootingTarget = OBJECT_KIRK;
_vm->_awayMission.timers[2] = 40; // TODO
tug2GuardShootsCrewman();
}
@@ -723,51 +723,51 @@ void Room::tug2GuardShootsCrewman() {
const char *crewPrefixes = "ksmr";
- if (!_roomVar.tug2.elasiPhaserOnKill)
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.tug2.shootingTarget] = DIR_W;
+ if (!_roomVar.tug.elasiPhaserOnKill)
+ _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.tug.shootingTarget] = DIR_W;
Common::String anim;
const char **bitmapArray;
- if (_roomVar.tug2.elasiPhaserOnKill) {
+ if (_roomVar.tug.elasiPhaserOnKill) {
anim = "_Kille";
- if (_roomVar.tug2.shootingObject == OBJECT_GUARD_1)
+ if (_roomVar.tug.shootingObject == OBJECT_GUARD_1)
bitmapArray = g1ShotsOnKill;
else
bitmapArray = g2ShotsOnKill;
} else {
anim = "_stune";
- if (_roomVar.tug2.shootingObject == OBJECT_GUARD_1)
+ if (_roomVar.tug.shootingObject == OBJECT_GUARD_1)
bitmapArray = g1ShotsOnStun;
else
bitmapArray = g2ShotsOnStun;
}
- anim.setChar(crewPrefixes[_roomVar.tug2.shootingTarget], 0);
+ anim.setChar(crewPrefixes[_roomVar.tug.shootingTarget], 0);
- if (_roomVar.tug2.shootingTarget != OBJECT_KIRK)
- loadActorAnim2(_roomVar.tug2.shootingTarget, anim, -1, -1, 0);
- else if (_roomVar.tug2.elasiPhaserOnKill)
- loadActorAnim2(_roomVar.tug2.shootingTarget, anim, -1, -1, 27);
+ if (_roomVar.tug.shootingTarget != OBJECT_KIRK)
+ loadActorAnim2(_roomVar.tug.shootingTarget, anim, -1, -1, 0);
+ else if (_roomVar.tug.elasiPhaserOnKill)
+ loadActorAnim2(_roomVar.tug.shootingTarget, anim, -1, -1, 27);
else
- loadActorAnim2(_roomVar.tug2.shootingTarget, anim, -1, -1, 26);
+ loadActorAnim2(_roomVar.tug.shootingTarget, anim, -1, -1, 26);
- showBitmapFor5Ticks(bitmapArray[_roomVar.tug2.shootingTarget], 5);
+ showBitmapFor5Ticks(bitmapArray[_roomVar.tug.shootingTarget], 5);
playSoundEffectIndex(SND_PHASSHOT);
- if (_roomVar.tug2.shootingObject == OBJECT_GUARD_1)
+ if (_roomVar.tug.shootingObject == OBJECT_GUARD_1)
loadActorAnim2(OBJECT_GUARD_1, "p5fire", -1, -1, 0);
else
loadActorAnim2(OBJECT_GUARD_2, "p6fire", -1, -1, 0);
- _vm->_awayMission.tug.crewmanKilled[_roomVar.tug2.shootingTarget] = _roomVar.tug2.elasiPhaserOnKill;
+ _vm->_awayMission.tug.crewmanKilled[_roomVar.tug.shootingTarget] = _roomVar.tug.elasiPhaserOnKill;
- if (!_roomVar.tug2.elasiPhaserOnKill) {
+ if (!_roomVar.tug.elasiPhaserOnKill) {
// BUG: crew goes down for 120 frames, but they start to get up before the fight
// is over. Perhaps this number should be increased.
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.tug2.shootingTarget] = DIR_W;
- _vm->_awayMission.crewGetupTimers[_roomVar.tug2.shootingTarget] = 120;
- _vm->_awayMission.crewDownBitset |= (1 << _roomVar.tug2.shootingTarget);
+ _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.tug.shootingTarget] = DIR_W;
+ _vm->_awayMission.crewGetupTimers[_roomVar.tug.shootingTarget] = 120;
+ _vm->_awayMission.crewDownBitset |= (1 << _roomVar.tug.shootingTarget);
}
- if (_roomVar.tug2.elasiPhaserOnKill && _roomVar.tug2.shootingTarget == OBJECT_REDSHIRT)
+ if (_roomVar.tug.elasiPhaserOnKill && _roomVar.tug.shootingTarget == OBJECT_REDSHIRT)
_vm->_awayMission.redshirtDead = true;
}
Commit: 55725257910d69eec219d12bf68474289526faaa
https://github.com/scummvm/scummvm/commit/55725257910d69eec219d12bf68474289526faaa
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Save mission-specific variables
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/saveload.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 6f31256..d912af7 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -24,6 +24,7 @@
#define STARTREK_AWAYMISSION_H
// All variables here get cleared to 0 upon starting an away mission.
+// NOTE: Any added or changed variables here must be mirrored in "saveload.cpp".
struct AwayMission {
// These timers count down automatically when nonzero. When they reach 0,
// ACTION_TIMER_EXPIRED is invoked with the corresponding index (0-7).
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 0d36e9f..da37880 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2136,8 +2136,9 @@ public:
void trial5UseBlueGem3OnHole3();
void trial5UseMedkitAnywhere();
-private:
+public:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
+ // NOTE: Any changes here must be reflected in saveload.cpp.
union {
struct {
// demon0
@@ -2147,8 +2148,8 @@ private:
bool movingToBottomDoor; // 0xcd
// demon1
- bool klingonShot[3]; // 0xca
- int numKlingonsKilled;
+ byte klingonShot[3]; // 0xca
+ int16 numKlingonsKilled;
byte attackIndex;
bool kirkShooting;
char d6[10];
@@ -2263,7 +2264,7 @@ private:
// feather1
byte snakeInHole; // 0xca
bool scannedSnake; // 0xcb
- bool crewEscaped[4]; // 0xcc
+ byte crewEscaped[4]; // 0xcc
byte crewmanClimbingVine;
// feather2
diff --git a/engines/startrek/saveload.cpp b/engines/startrek/saveload.cpp
index 4c98667..a290d14 100644
--- a/engines/startrek/saveload.cpp
+++ b/engines/startrek/saveload.cpp
@@ -29,6 +29,7 @@
#include "common/serializer.h"
#include "common/translation.h"
+#include "startrek/room.h"
#include "startrek/startrek.h"
namespace StarTrek {
@@ -286,7 +287,359 @@ bool StarTrekEngine::saveOrLoadGameData(Common::SeekableReadStream *in, Common::
}
ser.syncString(_mapFilename);
- // TODO: awayMissionStruct
+
+ // Away mission struct
+ for (int i = 0; i < 8; i++)
+ ser.syncAsSint16LE(_awayMission.timers[i]);
+ ser.syncAsSint16LE(_awayMission.mouseX);
+ ser.syncAsSint16LE(_awayMission.mouseY);
+ for (int i = 0; i < 4; i++)
+ ser.syncAsSint16LE(_awayMission.crewGetupTimers[i]);
+ ser.syncAsByte(_awayMission.disableWalking);
+ ser.syncAsByte(_awayMission.disableInput);
+ ser.syncAsByte(_awayMission.redshirtDead);
+ ser.syncAsByte(_awayMission.activeAction);
+ ser.syncAsByte(_awayMission.activeObject);
+ ser.syncAsByte(_awayMission.passiveObject);
+ ser.syncAsByte(_awayMission.rdfStillDoDefaultAction);
+ ser.syncAsByte(_awayMission.crewDownBitset);
+ for (int i = 0; i < 4; i++)
+ ser.syncAsByte(_awayMission.crewDirectionsAfterWalk[i]);
+
+ if (_missionName == "DEMON") {
+ ser.syncAsByte(_awayMission.demon.wasRudeToPrelate);
+ ser.syncAsByte(_awayMission.demon.insultedStephen);
+ ser.syncAsByte(_awayMission.demon.field2d);
+ ser.syncAsByte(_awayMission.demon.beatKlingons);
+ ser.syncAsByte(_awayMission.demon.tookKlingonHand);
+ ser.syncAsByte(_awayMission.demon.talkedToPrelate);
+ ser.syncAsByte(_awayMission.demon.stephenWelcomedToStudy);
+ ser.syncAsByte(_awayMission.demon.prelateWelcomedCrew);
+ ser.syncAsByte(_awayMission.demon.askedPrelateAboutSightings);
+ ser.syncAsByte(_awayMission.demon.field37);
+ ser.syncAsByte(_awayMission.demon.mccoyMentionedFlora);
+ ser.syncAsByte(_awayMission.demon.numBouldersGone);
+ ser.syncAsByte(_awayMission.demon.enteredFrom);
+ ser.syncAsByte(_awayMission.demon.repairedHand);
+ ser.syncAsByte(_awayMission.demon.healedMiner);
+ ser.syncAsByte(_awayMission.demon.curedChub);
+ ser.syncAsByte(_awayMission.demon.field3e);
+ ser.syncAsByte(_awayMission.demon.knowAboutHypoDytoxin);
+ ser.syncAsByte(_awayMission.demon.minerDead);
+ ser.syncAsByte(_awayMission.demon.field41);
+ ser.syncAsByte(_awayMission.demon.foundMiner);
+ ser.syncAsByte(_awayMission.demon.field45);
+ ser.syncAsByte(_awayMission.demon.gaveSkullToNauian);
+ ser.syncAsByte(_awayMission.demon.warpsDisabled);
+ ser.syncAsByte(_awayMission.demon.boulder1Gone);
+ ser.syncAsByte(_awayMission.demon.boulder2Gone);
+ ser.syncAsByte(_awayMission.demon.boulder3Gone);
+ ser.syncAsByte(_awayMission.demon.boulder4Gone);
+ ser.syncAsByte(_awayMission.demon.doorOpened);
+ ser.syncAsByte(_awayMission.demon.solvedSunPuzzle);
+ ser.syncAsByte(_awayMission.demon.itemsTakenFromCase);
+ ser.syncAsByte(_awayMission.demon.gotBerries);
+ ser.syncAsByte(_awayMission.demon.madeHypoDytoxin);
+ ser.syncAsByte(_awayMission.demon.metNauian);
+ ser.syncAsByte(_awayMission.demon.gavePointsForDytoxin);
+ ser.syncAsByte(_awayMission.demon.lookedAtComputer);
+ ser.syncAsByte(_awayMission.demon.field56);
+ ser.syncAsByte(_awayMission.demon.foundAlienRoom);
+ ser.syncAsSint16LE(_awayMission.demon.missionScore);
+
+ // demon0
+ ser.syncAsByte(_room->_roomVar.demon.bottomDoorCounter);
+ ser.syncAsByte(_room->_roomVar.demon.topDoorCounter);
+ ser.syncAsByte(_room->_roomVar.demon.movingToTopDoor);
+ ser.syncAsByte(_room->_roomVar.demon.movingToBottomDoor);
+
+ // demon1
+ ser.syncBytes((byte *)_room->_roomVar.demon.klingonShot, 3);
+ ser.syncAsSint16LE(_room->_roomVar.demon.numKlingonsKilled);
+ ser.syncAsByte(_room->_roomVar.demon.attackIndex);
+ ser.syncAsByte(_room->_roomVar.demon.kirkShooting);
+ ser.syncBytes((byte *)_room->_roomVar.demon.d6, 10);
+
+ // demon3
+ ser.syncAsByte(_room->_roomVar.demon.shootingBoulder);
+ ser.syncAsByte(_room->_roomVar.demon.boulder1Shot);
+ ser.syncAsByte(_room->_roomVar.demon.boulderBeingShot);
+ ser.syncAsByte(_room->_roomVar.demon.kirkInPosition);
+ ser.syncAsByte(_room->_roomVar.demon.redshirtInPosition);
+ ser.syncAsByte(_room->_roomVar.demon.spockInPosition);
+ ser.syncAsByte(_room->_roomVar.demon.mccoyInPosition);
+ ser.syncAsByte(_room->_roomVar.demon.inFiringPosition);
+ ser.syncAsByte(_room->_roomVar.demon.kirkPhaserOut);
+ ser.syncBytes((byte *)_room->_roomVar.demon.boulderAnim, 10);
+ ser.syncAsSint16LE(_room->_roomVar.demon.usedPhaserOnDoor);
+
+ // demon4
+ ser.syncAsByte(_room->_roomVar.demon.triedToShootNauian);
+ ser.syncAsByte(_room->_roomVar.demon.nauianEmerged);
+ ser.syncAsByte(_room->_roomVar.demon.disabledSecurity);
+ ser.syncAsByte(_room->_roomVar.demon.cd);
+ ser.syncAsByte(_room->_roomVar.demon.crewReadyToBeamOut);
+ ser.syncAsSint16LE(_room->_roomVar.demon.crewmanUsingPanel);
+
+ // demon5
+ ser.syncAsByte(_room->_roomVar.demon.scannedRoberts);
+ ser.syncAsByte(_room->_roomVar.demon.scannedChub);
+ ser.syncAsByte(_room->_roomVar.demon.scannedGrisnash);
+ ser.syncAsByte(_room->_roomVar.demon.scannedStephen);
+ ser.syncAsByte(_room->_roomVar.demon.numScanned);
+ ser.syncAsByte(_room->_roomVar.demon.numTalkedTo);
+ ser.syncAsByte(_room->_roomVar.demon.talkedToRoberts);
+ ser.syncAsByte(_room->_roomVar.demon.talkedToChub);
+ ser.syncAsByte(_room->_roomVar.demon.talkedToGrisnash);
+ ser.syncAsByte(_room->_roomVar.demon.talkedToStephen);
+
+ // demon6
+ ser.syncAsByte(_room->_roomVar.demon.insultedStephenRecently);
+ ser.syncAsByte(_room->_roomVar.demon.stephenInRoom);
+ ser.syncAsByte(_room->_roomVar.demon.caseOpened);
+
+ // common
+ ser.syncAsByte(_room->_roomVar.demon.movingToDoor);
+ ser.syncAsByte(_room->_roomVar.demon.doorCounter);
+ } else if (_missionName == "TUG") {
+ ser.syncAsSint16LE(_awayMission.tug.missionScore);
+ ser.syncAsSint16LE(_awayMission.tug.field2b);
+ ser.syncAsSint16LE(_awayMission.tug.field2d);
+ ser.syncAsByte(_awayMission.tug.engineerConscious);
+ ser.syncAsByte(_awayMission.tug.field35);
+ ser.syncAsByte(_awayMission.tug.gotWires);
+ ser.syncAsByte(_awayMission.tug.orbitalDecayCounter);
+ ser.syncAsByte(_awayMission.tug.bridgeElasiDrewPhasers);
+ ser.syncAsByte(_awayMission.tug.talkedToCereth);
+ ser.syncAsByte(_awayMission.tug.gotJunkPile);
+ ser.syncAsByte(_awayMission.tug.gotTransmogrifier);
+ ser.syncAsByte(_awayMission.tug.transporterRepaired);
+ ser.syncAsByte(_awayMission.tug.spockExaminedTransporter);
+ ser.syncAsByte(_awayMission.tug.usedTransmogrifierOnTransporter);
+ ser.syncAsByte(_awayMission.tug.bridgeForceFieldDown);
+ ser.syncAsByte(_awayMission.tug.savedPrisoners);
+ ser.syncAsByte(_awayMission.tug.haveBomb);
+ ser.syncAsByte(_awayMission.tug.brigElasiPhasersOnKill);
+ ser.syncAsByte(_awayMission.tug.field4b);
+ ser.syncAsByte(_awayMission.tug.guard1Status);
+ ser.syncAsByte(_awayMission.tug.guard2Status);
+ ser.syncAsByte(_awayMission.tug.field4e);
+ ser.syncBytes(_awayMission.tug.crewmanKilled, 4);
+ ser.syncAsByte(_awayMission.tug.bridgeElasi1Status);
+ ser.syncAsByte(_awayMission.tug.bridgeElasi2Status);
+ ser.syncAsByte(_awayMission.tug.bridgeElasi3Status);
+ ser.syncAsByte(_awayMission.tug.bridgeElasi4Status);
+ ser.syncAsByte(_awayMission.tug.brigForceFieldDown);
+ ser.syncAsByte(_awayMission.tug.field59);
+ ser.syncAsByte(_awayMission.tug.field5b);
+ ser.syncAsByte(_awayMission.tug.elasiSurrendered);
+ ser.syncAsByte(_awayMission.tug.kirkPhaserDrawn);
+ ser.syncAsByte(_awayMission.tug.bridgeWinMethod);
+ ser.syncAsByte(_awayMission.tug.talkedToBrigCrewman);
+
+ // tug2
+ ser.syncAsByte(_room->_roomVar.tug.shootingObject);
+ ser.syncAsByte(_room->_roomVar.tug.shootingTarget);
+ ser.syncAsByte(_room->_roomVar.tug.elasiPhaserOnKill);
+ ser.syncAsByte(_room->_roomVar.tug.shootKirkOverride);
+ } else if (_missionName == "LOVE") {
+ ser.syncAsByte(_awayMission.love.alreadyStartedMission);
+ ser.syncAsByte(_awayMission.love.knowAboutVirus);
+ ser.syncAsByte(_awayMission.love.romulansUnconsciousFromLaughingGas);
+ ser.syncAsByte(_awayMission.love.releasedHumanLaughingGas);
+ ser.syncAsByte(_awayMission.love.releasedRomulanLaughingGas);
+ ser.syncAsByte(_awayMission.love.chamberHasCure);
+ ser.syncAsByte(_awayMission.love.freezerOpen);
+ ser.syncAsByte(_awayMission.love.chamberHasDish);
+ ser.syncAsByte(_awayMission.love.bottleInNozzle);
+ ser.syncAsByte(_awayMission.love.cabinetOpen);
+ ser.syncAsByte(_awayMission.love.gasFeedOn);
+ ser.syncAsByte(_awayMission.love.synthesizerBottleIndex);
+ ser.syncAsByte(_awayMission.love.synthesizerContents);
+ ser.syncAsByte(_awayMission.love.canister1);
+ ser.syncAsByte(_awayMission.love.canister2);
+ ser.syncAsByte(_awayMission.love.servicePanelOpen);
+ ser.syncAsByte(_awayMission.love.gasTankUnscrewed);
+ ser.syncAsByte(_awayMission.love.wrenchTaken);
+ ser.syncAsByte(_awayMission.love.tookN2TankFromServicePanel);
+ ser.syncAsByte(_awayMission.love.field3c);
+ ser.syncAsByte(_awayMission.love.grateRemoved);
+ ser.syncAsByte(_awayMission.love.insulationOnGround);
+ ser.syncAsByte(_awayMission.love.visitedRoomWithRomulans);
+ ser.syncAsByte(_awayMission.love.romulansCured);
+ ser.syncAsByte(_awayMission.love.romulansUnconsciousFromVirus);
+ ser.syncAsByte(_awayMission.love.freedMarcusAndCheever);
+ ser.syncAsByte(_awayMission.love.preaxCured);
+ ser.syncAsByte(_awayMission.love.spockInfectionCounter);
+ ser.syncAsByte(_awayMission.love.spockCured);
+ ser.syncAsByte(_awayMission.love.contactedEnterpriseBeforeCure);
+ ser.syncAsByte(_awayMission.love.contactedEnterpriseAfterCure);
+ ser.syncAsByte(_awayMission.love.spockAccessedConsole);
+ ser.syncAsByte(_awayMission.love.mccoyAccessedConsole);
+ ser.syncAsByte(_awayMission.love.gotPolyberylcarbonate);
+ ser.syncAsByte(_awayMission.love.gotTLDH);
+ ser.syncAsByte(_awayMission.love.gotPointsForOpeningGrate);
+ ser.syncAsByte(_awayMission.love.gotPointsForGassingRomulans);
+ ser.syncAsByte(_awayMission.love.gotCure);
+ ser.syncAsByte(_awayMission.love.gotPointsForHydratingPreax);
+ ser.syncAsByte(_awayMission.love.gotPointsForHydratingRomulans);
+ ser.syncAsSint16LE(_awayMission.love.missionScore);
+
+ // love0
+ ser.syncAsByte(_room->_roomVar.love.heardSummaryOfVirus);
+ ser.syncAsSint16LE(_room->_roomVar.love.consoleCrewman);
+ ser.syncBytes((byte *)_room->_roomVar.love.consoleAnimation, 10);
+ ser.syncAsSint32LE(_room->_roomVar.love.consoleSpeaker);
+ ser.syncAsSint32LE(_room->_roomVar.love.consoleText);
+
+ // love1
+ ser.syncAsSint32LE(_room->_roomVar.love.dyingSpeaker);
+ ser.syncAsSint16LE(_room->_roomVar.love.crewmanUsingFreezerRetX);
+ ser.syncAsSint16LE(_room->_roomVar.love.crewmanUsingFreezerRetY);
+ ser.syncAsSint16LE(_room->_roomVar.love.crewmanUsingDevice);
+ ser.syncAsSint16LE(_room->_roomVar.love.itemInNozzle);
+ ser.syncBytes((byte *)_room->_roomVar.love.bottleAnimation, 10);
+
+ // love2
+ ser.syncAsByte(_room->_roomVar.love.canisterType);
+ ser.syncAsByte(_room->_roomVar.love.cb);
+ ser.syncAsSint16LE(_room->_roomVar.love.canisterItem);
+ ser.syncBytes((byte *)_room->_roomVar.love.canisterAnim, 10);
+ ser.syncAsSint16LE(_room->_roomVar.love.chamberObject);
+ ser.syncBytes((byte *)_room->_roomVar.love.chamberInputAnim, 10);
+ ser.syncBytes((byte *)_room->_roomVar.love.chamberOutputAnim, 10);
+
+ // love3
+ ser.syncAsByte(_room->_roomVar.love.activeCrewman);
+
+ // love4
+ ser.syncAsByte(_room->_roomVar.love.gaveWaterToRomulans);
+
+ // love5
+ ser.syncAsByte(_room->_roomVar.love.numCrewmenReadyToBeamOut);
+
+ // common
+ ser.syncAsByte(_room->_roomVar.love.walkingToDoor);
+ ser.syncAsByte(_room->_roomVar.love.doorOpenCounter);
+ ser.syncAsByte(_room->_roomVar.love.spockAndMccoyReadyToUseCure);
+ ser.syncAsByte(_room->_roomVar.love.cmnXPosToCureSpock);
+ ser.syncAsByte(_room->_roomVar.love.cmnYPosToCureSpock);
+ } else if (_missionName == "MUDD") {
+ ser.syncAsByte(_awayMission.mudd.muddFirstRoomState);
+ ser.syncAsByte(_awayMission.mudd.torpedoLoaded);
+ ser.syncAsByte(_awayMission.mudd.knowAboutTorpedo);
+ ser.syncAsByte(_awayMission.mudd.discoveredBase3System);
+ ser.syncAsByte(_awayMission.mudd.translatedAlienLanguage);
+ ser.syncAsByte(_awayMission.mudd.databaseDestroyed);
+ ser.syncAsByte(_awayMission.mudd.muddInDatabaseRoom);
+ ser.syncAsByte(_awayMission.mudd.muddCurrentlyInsane);
+ ser.syncAsByte(_awayMission.mudd.computerDataErasedOrDestroyed);
+ ser.syncAsByte(_awayMission.mudd.muddErasedDatabase);
+ ser.syncAsByte(_awayMission.mudd.discoveredLenseAndDegrimerFunction);
+ ser.syncAsSint16LE(_awayMission.mudd.torpedoStatus);
+ ser.syncAsByte(_awayMission.mudd.muddUnavailable);
+ ser.syncAsByte(_awayMission.mudd.muddVisitedDatabaseRoom);
+ ser.syncAsByte(_awayMission.mudd.accessedAlienDatabase);
+ ser.syncAsByte(_awayMission.mudd.tookRepairTool);
+ ser.syncAsByte(_awayMission.mudd.gotPointsForDownloadingData);
+ ser.syncAsByte(_awayMission.mudd.contactedEnterpriseFirstTime);
+ ser.syncAsByte(_awayMission.mudd.viewScreenEnabled);
+ ser.syncAsByte(_awayMission.mudd.lifeSupportMalfunctioning);
+ ser.syncAsByte(_awayMission.mudd.numTimesEnteredRoom5);
+ ser.syncAsByte(_awayMission.mudd.gotMemoryDisk);
+ ser.syncAsByte(_awayMission.mudd.gotLense);
+ ser.syncAsByte(_awayMission.mudd.gotDegrimer);
+ ser.syncAsByte(_awayMission.mudd.putCapsuleInMedicalMachine);
+ ser.syncAsByte(_awayMission.mudd.muddUnconscious);
+ ser.syncAsByte(_awayMission.mudd.muddInsanityState);
+ ser.syncAsByte(_awayMission.mudd.muddInhaledGas);
+ ser.syncAsSint16LE(_awayMission.mudd.lifeSupportTimer);
+ ser.syncAsByte(_awayMission.mudd.startedLifeSupportTimer);
+ ser.syncAsByte(_awayMission.mudd.enteredRoom0ForFirstTime);
+ ser.syncAsByte(_awayMission.mudd.gotPointsForLoadingTorpedo);
+ ser.syncAsByte(_awayMission.mudd.gotPointsForPressingRedButton);
+ ser.syncAsByte(_awayMission.mudd.gotPointsForEnablingViewscreen);
+ ser.syncAsByte(_awayMission.mudd.enteredRoom1ForFirstTime);
+ ser.syncAsByte(_awayMission.mudd.repairedLifeSupportGenerator);
+ ser.syncAsSint16LE(_awayMission.mudd.missionScore);
+
+ // mudd3
+ ser.syncAsByte(_room->_roomVar.mudd.suggestedUsingTricorders);
+ ser.syncAsByte(_room->_roomVar.mudd.tricordersUnavailable);
+
+ // mudd4
+ ser.syncAsByte(_room->_roomVar.mudd.usingLeftConsole);
+ ser.syncAsByte(_room->_roomVar.mudd.kirkUsingRightConsole);
+
+ // common
+ ser.syncAsByte(_room->_roomVar.mudd.walkingToDoor);
+ } else if (_missionName == "FEATHER") {
+ ser.syncAsByte(_awayMission.feather.diedFromStalactites);
+ ser.syncAsByte(_awayMission.feather.vineState);
+ ser.syncAsByte(_awayMission.feather.gotRock);
+ ser.syncAsByte(_awayMission.feather.gotSnake);
+ ser.syncAsByte(_awayMission.feather.tookKnife);
+ ser.syncAsByte(_awayMission.feather.field2e);
+ ser.syncAsByte(_awayMission.feather.numRocksThrownAtTlaoxac);
+ ser.syncAsByte(_awayMission.feather.gotFern);
+ ser.syncAsByte(_awayMission.feather.holeBlocked);
+ ser.syncAsByte(_awayMission.feather.tlaoxacTestPassed);
+ ser.syncAsByte(_awayMission.feather.knockedOutTlaoxac);
+ ser.syncAsByte(_awayMission.feather.waterMonsterRetreated);
+ ser.syncAsByte(_awayMission.feather.showedSnakeToTlaoxac);
+ ser.syncAsSint16LE(_awayMission.feather.missionScore);
+
+ // feather1
+ ser.syncAsByte(_room->_roomVar.feather.snakeInHole);
+ ser.syncAsByte(_room->_roomVar.feather.scannedSnake);
+ ser.syncBytes(_room->_roomVar.feather.crewEscaped, 4);
+ ser.syncAsByte(_room->_roomVar.feather.crewmanClimbingVine);
+
+ // feather2
+ ser.syncAsByte(_room->_roomVar.feather.showedSnakeToTlaoxac);
+ ser.syncAsByte(_room->_roomVar.feather.tlaoxacUnconscious);
+
+ // feather6
+ ser.syncAsByte(_room->_roomVar.feather.usedRockOnCrystalsOnce);
+
+ // feather7
+ ser.syncAsByte(_room->_roomVar.feather.insultedQuetzecoatl);
+ } else if (_missionName == "TRIAL") {
+ ser.syncAsSint16LE(_awayMission.trial.missionScore);
+ ser.syncAsSint16LE(_awayMission.trial.field2b);
+ ser.syncAsByte(_awayMission.trial.entityDefeated);
+ ser.syncAsByte(_awayMission.trial.doorOpen);
+ ser.syncAsByte(_awayMission.trial.scannedLock);
+ ser.syncAsByte(_awayMission.trial.doorCodeBehaviour);
+ ser.syncAsByte(_awayMission.trial.globSplitInTwo);
+ ser.syncAsByte(_awayMission.trial.globDefeated);
+ ser.syncBytes(_awayMission.trial.globEnergyLevels, 3);
+ ser.syncAsByte(_awayMission.trial.enteredTrial3FirstTime);
+ ser.syncAsByte(_awayMission.trial.klingonShootIndex);
+ ser.syncAsByte(_awayMission.trial.shotKlingons);
+ ser.syncAsSint16LE(_awayMission.trial.shotKlingonState);
+ ser.syncAsByte(_awayMission.trial.neuralInterfaceActive);
+ for (int i = 0; i < 3; i++)
+ ser.syncAsSint16LE(_awayMission.trial.holeContents[i]);
+ ser.syncAsByte(_awayMission.trial.enteredGlobRoom);
+ ser.syncAsByte(_awayMission.trial.forceFieldDown);
+ ser.syncAsByte(_awayMission.trial.uhuraAnalyzedCode);
+ ser.syncAsSint16LE(_awayMission.trial.missionEndMethod);
+ ser.syncAsByte(_awayMission.trial.gotPointsForGettingRod);
+ ser.syncAsByte(_awayMission.trial.gotPointsForCoatingRodWithIron);
+ ser.syncAsByte(_awayMission.trial.gotPointsForActivatingInterface);
+ ser.syncAsByte(_awayMission.trial.gotPointsForScanningGlob);
+ ser.syncAsByte(_awayMission.trial.gotPointsForBeamingOut);
+
+ // trial2
+ ser.syncAsByte(_room->_roomVar.trial.globBeingShot);
+ ser.syncAsByte(_room->_roomVar.trial.phaserOnKill);
+
+ // trial5
+ ser.syncAsSint16LE(_room->_roomVar.trial.itemToUse);
+ ser.syncAsSint16LE(_room->_roomVar.trial.objectToUse);
+ ser.syncAsSint16LE(_room->_roomVar.trial.hole);
+ }
// The action queue
if (ser.isLoading()) {
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index b4a7598..e0a0401 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -29,6 +29,9 @@
namespace StarTrek {
+// The type to use for text references (values of "GameStringIDs" enum).
+// NOTE: if this typedef is changed, certain lines in "saveload.cpp" would also need to be
+// changed. Better to leave this as-is.
typedef int32 TextRef;
// Text that's loaded from "GROUND.TXT". First 0x40 pieces of text are for items.
Commit: b1fa6126cc0429aaa378550f28d234e06d35a3aa
https://github.com/scummvm/scummvm/commit/b1fa6126cc0429aaa378550f28d234e06d35a3aa
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Link away missions together, temporarily
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/menu.cpp
engines/startrek/room.cpp
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 41533d7..c3fe9f7 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -45,7 +45,7 @@ void StarTrekEngine::initAwayMission() {
}
void StarTrekEngine::runAwayMission() {
- while (true) {
+ while (_gameMode == GAMEMODE_AWAYMISSION && !_resetGameMode) {
// Original game manipulates the stack when the room changes to return execution
// to this point. Instead of doing that, just check if a variable is set.
if (_roomIndexToLoad != -1 && _spawnIndexToLoad != -1) {
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index 2251588..aa9c3eb 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -227,6 +227,7 @@ void StarTrekEngine::showOptionsMenu(int x, int y) {
break;
case 1: // Load
showLoadMenu();
+ _resetGameMode = true;
break;
case 2: // Enable music
_sound->setMusicEnabled(true);
@@ -955,15 +956,17 @@ void StarTrekEngine::showGameOverMenu() {
case 0: // Load game
_gfx->fadeoutScreen();
showLoadMenu(); // TODO: this probably manipulates the stack to jump out of this function...
- break;
+ _resetGameMode = true;
+ return;
case 1: // Restart
_gfx->fadeoutScreen();
// TODO
- break;
+ _resetGameMode = true;
+ return;
case 2: // Quit
_gfx->fadeoutScreen();
_system->quit();
- break;
+ return;
default:
break;
}
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index daf8e09..08743f7 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -444,7 +444,20 @@ void Room::endMission(int16 score, int16 arg1, int16 arg2) {
_vm->_awayMission.disableInput = false;
- // TODO: game mode switch
+ // TODO: This is a stopgap measure (loading the next away mission immediately).
+ // Replace this with the proper code later.
+ _vm->_gameMode = GAMEMODE_BEAMDOWN;
+ if (_vm->_missionName == "DEMON")
+ _vm->_missionToLoad = "TUG";
+ if (_vm->_missionName == "TUG")
+ _vm->_missionToLoad = "LOVE";
+ if (_vm->_missionName == "LOVE")
+ _vm->_missionToLoad = "MUDD";
+ if (_vm->_missionName == "MUDD")
+ _vm->_missionToLoad = "FEATHER";
+ if (_vm->_missionName == "FEATHER")
+ _vm->_missionToLoad = "TRIAL";
+ _vm->_roomIndexToLoad = 0;
}
void Room::showGameOverMenu() { // TODO: takes an optional parameter?
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index a0eada7..79681a8 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -135,13 +135,17 @@ Common::Error StarTrekEngine::runGameMode(int mode) {
_gameMode = mode;
_sound->stopAllVocSounds();
- if (!_sound->_loopingAudioName.empty())
- _sound->playVoc(_sound->_loopingAudioName);
+ _resetGameMode = true;
if (_gameMode == GAMEMODE_START)
_gameMode = GAMEMODE_BRIDGE;
while (true) {
+ if (_resetGameMode) {
+ if (!_sound->_loopingAudioName.empty())
+ _sound->playVoc(_sound->_loopingAudioName);
+ _resetGameMode = false;
+ }
TrekEvent event;
if (_gameMode != _lastGameMode) {
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index b6b7215..6e17375 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -628,6 +628,7 @@ public:
public:
int _gameMode;
int _lastGameMode;
+ bool _resetGameMode;
// NOTE: this has a different meaning than the original game. When non-empty, a new
// room load is triggered, as opposed to original behaviour where this was only read
Commit: 919db23841c24475257182f6daddea59cefb408a
https://github.com/scummvm/scummvm/commit/919db23841c24475257182f6daddea59cefb408a
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement "BAN" files.
These are background animations in various rooms, purely visual.
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/filestream.cpp
engines/startrek/filestream.h
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/menu.cpp
engines/startrek/room.h
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index c3fe9f7..158d8c6 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -109,7 +109,12 @@ void StarTrekEngine::loadRoom(const Common::String &missionName, int roomIndex)
int16 den = _room->getMaxY() - _room->getMinY() + 1;
_playerActorScale = Fixed16(num) / den;
- // TODO: RDF vars 1e/1f and 20/21; relates to BAN files?
+ int16 addr = _room->getBanDataStart();
+ while (addr != _room->getBanDataEnd()) {
+ Common::String name((char *)&_room->_rdfData[addr]);
+ loadBanFile(name);
+ addr += strlen((char *)&_room->_rdfData[addr]) + 1;
+ }
_actionQueue.clear();
}
@@ -181,10 +186,13 @@ void StarTrekEngine::handleAwayMissionEvents() {
case TREKEVENT_TICK:
updateActorAnimations();
updateCrewmanGetupTimers();
+
updateMouseBitmap();
- // doSomethingWithBanData1();
- _gfx->drawAllSprites();
- // doSomethingWithBanData2();
+ renderBanBelowSprites();
+ _gfx->drawAllSprites(false);
+ renderBanAboveSprites();
+ _gfx->updateScreen();
+
_sound->checkLoopMusic();
updateAwayMissionTimers();
_frameIndex++;
diff --git a/engines/startrek/filestream.cpp b/engines/startrek/filestream.cpp
index faae962..e0916fc 100644
--- a/engines/startrek/filestream.cpp
+++ b/engines/startrek/filestream.cpp
@@ -53,6 +53,14 @@ uint32 FileStream::readUint32() {
return w;
}
+int16 FileStream::readSint16() {
+ return (int16)readUint16();
+}
+
+int32 FileStream::readSint32() {
+ return (int32)readUint32();
+}
+
// SeekableReadStream functions
int32 FileStream::pos() const {
diff --git a/engines/startrek/filestream.h b/engines/startrek/filestream.h
index c5f5ef3..3b52b20 100644
--- a/engines/startrek/filestream.h
+++ b/engines/startrek/filestream.h
@@ -46,6 +46,8 @@ public:
byte readByte();
uint16 readUint16();
uint32 readUint32();
+ int16 readSint16();
+ int32 readSint32();
// SeekableReadStream functions
int32 pos() const;
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 6e8c97f..43358f8 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -109,6 +109,14 @@ byte *Graphics::getBackgroundPixels() {
return _backgroundImage->pixels;
}
+byte *Graphics::lockScreenPixels() {
+ return (byte *)_vm->_system->lockScreen()->getPixels();
+}
+
+void Graphics::unlockScreenPixels() {
+ _vm->_system->unlockScreen();
+}
+
void Graphics::clearScreenAndPriBuffer() {
Common::fill(_priData, _priData + sizeof(_priData), 0);
@@ -571,28 +579,24 @@ void Graphics::drawAllSprites(bool updateScreen) {
surface.free();
- if (updateScreen) {
- // Check if there are any pending updates to the mouse.
- if (_mouseBitmap != _mouseBitmapLastFrame) {
- _mouseBitmapLastFrame = _mouseBitmap;
- _vm->_system->setMouseCursor(_mouseBitmap->pixels, _mouseBitmap->width, _mouseBitmap->height, _mouseBitmap->xoffset, _mouseBitmap->yoffset, 0);
- }
- if (_mouseToBeShown) {
- CursorMan.showMouse(true);
- _mouseToBeShown = false;
- } else if (_mouseToBeHidden) {
- CursorMan.showMouse(false);
- _mouseToBeHidden = false;
- }
+ if (updateScreen)
+ this->updateScreen();
+}
- if (_mouseWarpX != -1) {
- _vm->_system->warpMouse(_mouseWarpX, _mouseWarpY);
- _mouseWarpX = -1;
- _mouseWarpY = -1;
- }
+void Graphics::drawAllSpritesInRect(const Common::Rect &rect) {
+ ::Graphics::Surface *surface = _vm->_system->lockScreen();
+
+ for (int i = 0; i < _numSprites; i++) {
+ Sprite *sprite = _sprites[i];
+ if (!sprite->isOnScreen)
+ continue;
- _vm->_system->updateScreen();
+ Common::Rect intersect = rect.findIntersectingRect(sprite->drawRect);
+ if (!intersect.isEmpty())
+ drawSprite(*sprite, surface, intersect);
}
+
+ _vm->_system->unlockScreen();
}
void Graphics::forceDrawAllSprites(bool updateScreen) {
@@ -601,6 +605,29 @@ void Graphics::forceDrawAllSprites(bool updateScreen) {
drawAllSprites(updateScreen);
}
+void Graphics::updateScreen() {
+ // Check if there are any pending updates to the mouse.
+ if (_mouseBitmap != _mouseBitmapLastFrame) {
+ _mouseBitmapLastFrame = _mouseBitmap;
+ _vm->_system->setMouseCursor(_mouseBitmap->pixels, _mouseBitmap->width, _mouseBitmap->height, _mouseBitmap->xoffset, _mouseBitmap->yoffset, 0);
+ }
+ if (_mouseToBeShown) {
+ CursorMan.showMouse(true);
+ _mouseToBeShown = false;
+ } else if (_mouseToBeHidden) {
+ CursorMan.showMouse(false);
+ _mouseToBeHidden = false;
+ }
+
+ if (_mouseWarpX != -1) {
+ _vm->_system->warpMouse(_mouseWarpX, _mouseWarpY);
+ _mouseWarpX = -1;
+ _mouseWarpY = -1;
+ }
+
+ _vm->_system->updateScreen();
+}
+
Sprite *Graphics::getSpriteAt(int16 x, int16 y) {
for (int i = _numSprites - 1; i >= 0; i--) {
Sprite *sprite = _sprites[i];
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index ecef5fc..1a71aa2 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -61,6 +61,8 @@ public:
void fillBackgroundRect(const Common::Rect &rect, byte color);
byte *getBackgroundPixels();
+ byte *lockScreenPixels();
+ void unlockScreenPixels();
void clearScreenAndPriBuffer();
/**
@@ -106,10 +108,19 @@ public:
void drawSprite(const Sprite &sprite, ::Graphics::Surface *surface, const Common::Rect &rect);
void drawAllSprites(bool updateScreen = true);
/**
+ * This function should only be called after "drawAllSprites" (so that sprite rects
+ * are updated).
+ */
+ void drawAllSpritesInRect(const Common::Rect &rect);
+ /**
* Sets "bitmapChanged" to true on all sprites before calling drawAllSprites.
*/
void forceDrawAllSprites(bool updateScreen = true);
/**
+ * Flushes the screen. Usually called by "drawAllSprites".
+ */
+ void updateScreen();
+ /**
* Returns the sprite at the given position (ignores mouse).
*/
Sprite *getSpriteAt(int16 x, int16 y);
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index aa9c3eb..5fbc8d5 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -631,10 +631,12 @@ int StarTrekEngine::handleMenuEvents(uint32 ticksUntilClickingEnabled, bool inTe
}
// Not added: updating mouse position (scummvm handles that)
- // sub_10492(); // TODO
updateActorAnimations();
- _gfx->drawAllSprites();
- // sub_10BE7(); // TODO
+ renderBanBelowSprites();
+ _gfx->drawAllSprites(false);
+ renderBanAboveSprites();
+ _gfx->updateScreen();
+
_sound->checkLoopMusic();
if (_finishedPlayingSpeech != 0) {
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index da37880..6c623a6 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -47,6 +47,8 @@ struct RoomAction {
// Offsets of data in RDF files
+const int RDF_BAN_DATA_START = 0x1e;
+const int RDF_BAN_DATA_END = 0x20;
const int RDF_WARP_ROOM_INDICES = 0x22;
const int RDF_ROOM_ENTRY_POSITIONS = 0x2a;
const int RDF_BEAM_IN_POSITIONS = 0xaa;
@@ -76,6 +78,12 @@ public:
Fixed8 getMaxScale() {
return Fixed8::fromRaw(readRdfWord(0x0c));
}
+ int16 getBanDataStart() {
+ return readRdfWord(RDF_BAN_DATA_START);
+ }
+ int16 getBanDataEnd() {
+ return readRdfWord(RDF_BAN_DATA_END);
+ }
/**
* Check if a particular action is defined for this room.
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 79681a8..4703bbe 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -59,6 +59,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics");
DebugMan.addDebugChannel(kDebugSavegame, "savegame", "Savegames");
DebugMan.addDebugChannel(kDebugSpace, "space", "Space and Pseudo-3D");
+ DebugMan.addDebugChannel(kDebugGeneral, "general", "General");
_gfx = nullptr;
_sound = nullptr;
@@ -568,11 +569,10 @@ void StarTrekEngine::stopPlayingSpeech() {
}
void StarTrekEngine::initActors() {
- for (int i = 0; i < NUM_ACTORS; i++) {
+ for (int i = 0; i < NUM_ACTORS; i++)
_actorList[i] = Actor();
- }
- for (int i = 0; i < NUM_ACTORS / 2; i++)
- _actorBanFiles[i].reset();
+ for (int i = 0; i < MAX_BAN_FILES; i++)
+ _banFiles[i].reset();
strcpy(_kirkActor->animationString, "kstnd");
strcpy(_spockActor->animationString, "sstnd");
@@ -604,6 +604,19 @@ int StarTrekEngine::loadActorAnim(int actorIndex, const Common::String &animName
return actorIndex;
}
+void StarTrekEngine::loadBanFile(const Common::String &name) {
+ debugC(kDebugGeneral, 7, "Load BAN file: %s.ban", name.c_str());
+ for (int i = 0; i < MAX_BAN_FILES; i++) {
+ if (!_banFiles[i]) {
+ _banFiles[i] = loadFile(name + ".ban");
+ _banFileOffsets[i] = 0;
+ return;
+ }
+ }
+
+ warning("Couldn't load .BAN file \"%s.ban\"", name.c_str());
+}
+
bool StarTrekEngine::actorWalkToPosition(int actorIndex, const Common::String &animFile, int16 srcX, int16 srcY, int16 destX, int16 destY) {
debugC(6, "Obj %d: walk from (%d,%d) to (%d,%d)", actorIndex, srcX, srcY, destX, destY);
@@ -773,6 +786,126 @@ void StarTrekEngine::updateActorAnimations() {
}
}
+void StarTrekEngine::renderBanBelowSprites() {
+ if ((_frameIndex & 3) != 0)
+ return;
+
+ byte *screenPixels = _gfx->lockScreenPixels();
+ byte *bgPixels = _gfx->getBackgroundPixels();
+
+ for (int i = 0; i < MAX_BAN_FILES; i++) {
+ if (!_banFiles[i])
+ continue;
+
+ // TODO: video modes other than VGA
+
+ _banFiles[i]->seek(_banFileOffsets[i], SEEK_SET);
+ uint16 offset = _banFiles[i]->readUint16();
+
+ if (offset == 0xffff) {
+ _banFileOffsets[i] = 0;
+ _banFiles[i]->seek(0, SEEK_SET);
+ offset = _banFiles[i]->readSint16();
+ }
+
+ int16 size = _banFiles[i]->readSint16();
+ if (size != 0) {
+ _banFiles[i]->seek(_banFileOffsets[i], SEEK_SET);
+ renderBan(screenPixels, _banFiles[i]);
+
+ _banFiles[i]->seek(_banFileOffsets[i], SEEK_SET);
+ renderBan(bgPixels, _banFiles[i]);
+ //sub_10e51(_gfx->getBackgroundPixels(), _banFiles[i]);
+ }
+
+ }
+
+ _gfx->unlockScreenPixels();
+}
+
+void StarTrekEngine::renderBan(byte *destPixels, SharedPtr<FileStream> banFile) {
+ uint16 offset = banFile->readUint16();
+ int32 size = banFile->readUint16();
+
+ byte *dest = destPixels + offset;
+
+ // Skip 8 bytes (rectangle encompassing the area being drawn to)
+ banFile->readSint32();
+ banFile->readSint32();
+
+ while (--size >= 0) {
+ assert(dest >= destPixels && dest < destPixels + SCREEN_WIDTH * SCREEN_HEIGHT);
+ int8 b = banFile->readByte();
+
+ if (b == -128) // Add value to destination (usually jumping to next row)
+ dest += banFile->readUint16();
+ else if (b < 0) { // Repeated byte
+ byte c = banFile->readByte();
+ if (c == 0)
+ dest += (-b) + 1;
+ else {
+ for (int j = 0; j < (-b) + 1; j++)
+ (*dest++) = c;
+ }
+ } else { // List of bytes
+ b++;
+ while (b-- != 0) {
+ byte c = banFile->readByte();
+ if (c == 0)
+ dest++;
+ else
+ *(dest++) = c;
+ }
+ }
+ }
+}
+
+void StarTrekEngine::renderBanAboveSprites() {
+ if ((_frameIndex & 3) != 0)
+ return;
+
+ for (int i = 0; i < MAX_BAN_FILES; i++) {
+ if (!_banFiles[i])
+ continue;
+
+ _banFiles[i]->seek(_banFileOffsets[i], SEEK_SET);
+ uint16 offset = _banFiles[i]->readUint16();
+
+ if (offset == 0xffff) {
+ _banFileOffsets[i] = 0;
+ _banFiles[i]->seek(0, SEEK_SET);
+ offset = _banFiles[i]->readSint16();
+ }
+
+ int16 size = _banFiles[i]->readSint16();
+ if (size != 0) {
+ Common::Rect rect;
+ rect.left = _banFiles[i]->readSint16();
+ rect.top = _banFiles[i]->readSint16();
+ rect.right = _banFiles[i]->readSint16() + 1;
+ rect.bottom = _banFiles[i]->readSint16() + 1;
+ _gfx->drawAllSpritesInRect(rect);
+
+ // Just read through the BAN data to get the end address, not doing anything
+ // with it.
+ while (--size >= 0) {
+ int8 b = _banFiles[i]->readByte();
+ if (b == -128)
+ _banFiles[i]->readUint16();
+ else if (b < 0) {
+ _banFiles[i]->readByte();
+ } else {
+ b++;
+ while (b-- != 0)
+ _banFiles[i]->readByte();
+ }
+ }
+
+ _banFileOffsets[i] = _banFiles[i]->pos();
+ }
+ }
+}
+
void StarTrekEngine::removeActorFromScreen(int actorIndex) {
Actor *actor = &_actorList[actorIndex];
@@ -796,8 +929,8 @@ void StarTrekEngine::actorFunc1() {
}
}
- for (int i = 0; i < NUM_ACTORS / 2; i++) {
- _actorBanFiles[i].reset();
+ for (int i = 0; i < MAX_BAN_FILES; i++) {
+ _banFiles[i].reset();
}
}
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 6e17375..6f98db2 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -109,6 +109,8 @@ const int MAX_TEXTBOX_LINES = 12;
const int MAX_BUFFERED_WALK_ACTIONS = 32;
+const int MAX_BAN_FILES = 16;
+
enum StarTrekGameType {
GType_ST25 = 1,
@@ -123,7 +125,8 @@ enum kDebugLevels {
kDebugSound = 1 << 0,
kDebugGraphics = 1 << 1,
kDebugSavegame = 1 << 2,
- kDebugSpace = 2 << 3
+ kDebugSpace = 1 << 3,
+ kDebugGeneral = 1 << 4
};
enum GameMode {
@@ -342,12 +345,22 @@ public:
* Set an actor's animation, position, and scale.
*/
int loadActorAnim(int actorIndex, const Common::String &animName, int16 x, int16 y, Fixed8 scale);
+ void loadBanFile(const Common::String &name);
/**
* Tries to make an actor walk to a position.
* Returns true if successful in initiating the walk.
*/
bool actorWalkToPosition(int actorIndex, const Common::String &animFile, int16 srcX, int16 srcY, int16 destX, int16 destY);
void updateActorAnimations();
+
+ /**
+ * ".BAN" files relate to drawing background animations, ie. flashing computer lights.
+ * "renderBanBelowSprites()" does the work of drawing it, while
+ * "renderBanAboveSprites()" redraws sprites above them if necessary.
+ */
+ void renderBanBelowSprites();
+ void renderBan(byte *pixelDest, SharedPtr<FileStream> file);
+ void renderBanAboveSprites();
void removeActorFromScreen(int actorIndex);
void actorFunc1();
void drawActorToScreen(Actor *actor, const Common::String &animName, int16 x, int16 y, Fixed8 scale, bool addSprite);
@@ -664,8 +677,10 @@ public:
Actor *const _mccoyActor;
Actor *const _redshirtActor;
- SharedPtr<FileStream> _actorBanFiles[NUM_ACTORS / 2];
- uint16 _actorBanVar2[NUM_ACTORS / 2]; // TODO: initialize?
+ // ".BAN" files provide extra miscellaneous animations in the room, ie. flashing
+ // pixels on computer consoles, or fireflies in front of the screen.
+ SharedPtr<FileStream> _banFiles[MAX_BAN_FILES];
+ uint16 _banFileOffsets[MAX_BAN_FILES];
Sprite _inventoryIconSprite;
Sprite _itemIconSprite;
Commit: e3f00320ad76121430714f094dc8e9353eb04f2b
https://github.com/scummvm/scummvm/commit/e3f00320ad76121430714f094dc8e9353eb04f2b
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fix elasi guard not shooting Kirk in TUG
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/tug2.cpp
engines/startrek/saveload.cpp
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index d912af7..0817946 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -121,7 +121,7 @@ struct AwayMission {
bool savedPrisoners; // 0x48
bool haveBomb; // 0x49
bool brigElasiPhasersOnKill; // 0x4a
- byte field4b; // 0x4b
+ byte elasiTargetIndex; // 0x4b
byte guard1Status; // 0x4c
byte guard2Status; // 0x4d
byte field4e; // 0x4e
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 6c623a6..dad620e 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2210,7 +2210,7 @@ public:
byte shootingObject; // 0x1ec1
byte shootingTarget;
bool elasiPhaserOnKill;
- byte shootKirkOverride; // 0x1ec4
+ bool shootKirkOverride; // 0x1ec4
} tug;
struct {
diff --git a/engines/startrek/rooms/tug2.cpp b/engines/startrek/rooms/tug2.cpp
index a13abb8..2e8a9e6 100644
--- a/engines/startrek/rooms/tug2.cpp
+++ b/engines/startrek/rooms/tug2.cpp
@@ -624,9 +624,9 @@ void Room::tug2Timer0Expired() {
if (_vm->_awayMission.tug.brigElasiPhasersOnKill)
_roomVar.tug.elasiPhaserOnKill = 1;
- switch (_vm->_awayMission.tug.field4b) {
+ switch (_vm->_awayMission.tug.elasiTargetIndex) {
case 0:
- _vm->_awayMission.tug.field4b++;
+ _vm->_awayMission.tug.elasiTargetIndex++;
if (_vm->_awayMission.tug.guard2Status != GUARDSTAT_UP) {
// BUGFIX: reset the timer to allow guard 1 to continue if guard 2 is down
_vm->_awayMission.timers[0] = 60;
@@ -644,7 +644,7 @@ void Room::tug2Timer0Expired() {
case 1:
// Guard shoots redshirt
- _vm->_awayMission.tug.field4b++;
+ _vm->_awayMission.tug.elasiTargetIndex++;
if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT]) {
tug2DetermineElasiShooter();
_roomVar.tug.shootingTarget = OBJECT_REDSHIRT;
@@ -655,7 +655,7 @@ void Room::tug2Timer0Expired() {
case 2:
// Guard shoots spock (or kirk)
- _vm->_awayMission.tug.field4b++;
+ _vm->_awayMission.tug.elasiTargetIndex++;
_roomVar.tug.shootKirkOverride = false;
if (_vm->_awayMission.tug.brigElasiPhasersOnKill)
_roomVar.tug.shootKirkOverride = true;
@@ -669,7 +669,8 @@ void Room::tug2Timer0Expired() {
break;
case 3:
- _vm->_awayMission.tug.field4b++;
+ // Guard shoots Mccoy
+ _vm->_awayMission.tug.elasiTargetIndex++;
if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY]) {
tug2DetermineElasiShooter();
_roomVar.tug.shootingTarget = OBJECT_MCCOY;
@@ -679,16 +680,17 @@ void Room::tug2Timer0Expired() {
break;
case 4:
- _vm->_awayMission.tug.field4b++;
+ // Guard shoots kirk (or Spock)
+ _vm->_awayMission.tug.elasiTargetIndex++;
if (_roomVar.tug.shootKirkOverride) {
tug2DetermineElasiShooter();
_roomVar.tug.shootingTarget = OBJECT_SPOCK;
_vm->_awayMission.timers[2] = 40;
tug2GuardShootsCrewman();
- } else if (_roomVar.tug.shootKirkOverride) {
+ } else {
tug2DetermineElasiShooter();
_roomVar.tug.shootingTarget = OBJECT_KIRK;
- _vm->_awayMission.timers[2] = 40; // TODO
+ _vm->_awayMission.timers[2] = 40;
tug2GuardShootsCrewman();
}
break;
diff --git a/engines/startrek/saveload.cpp b/engines/startrek/saveload.cpp
index a290d14..cac8a78 100644
--- a/engines/startrek/saveload.cpp
+++ b/engines/startrek/saveload.cpp
@@ -420,7 +420,7 @@ bool StarTrekEngine::saveOrLoadGameData(Common::SeekableReadStream *in, Common::
ser.syncAsByte(_awayMission.tug.savedPrisoners);
ser.syncAsByte(_awayMission.tug.haveBomb);
ser.syncAsByte(_awayMission.tug.brigElasiPhasersOnKill);
- ser.syncAsByte(_awayMission.tug.field4b);
+ ser.syncAsByte(_awayMission.tug.elasiTargetIndex);
ser.syncAsByte(_awayMission.tug.guard1Status);
ser.syncAsByte(_awayMission.tug.guard2Status);
ser.syncAsByte(_awayMission.tug.field4e);
Commit: 20904176129e7ad6f9435e9563e1fa0bca5cb0f6
https://github.com/scummvm/scummvm/commit/20904176129e7ad6f9435e9563e1fa0bca5cb0f6
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Move save/load code for rooms to structs
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/saveload.cpp
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 0817946..a123c09 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -24,7 +24,7 @@
#define STARTREK_AWAYMISSION_H
// All variables here get cleared to 0 upon starting an away mission.
-// NOTE: Any added or changed variables here must be mirrored in "saveload.cpp".
+// NOTE: Any changes here must be reflected in the corresponding serializer functions.
struct AwayMission {
// These timers count down automatically when nonzero. When they reach 0,
// ACTION_TIMER_EXPIRED is invoked with the corresponding index (0-7).
@@ -99,6 +99,48 @@ struct AwayMission {
byte field56; // 0x56
bool foundAlienRoom; // 0x57
int16 missionScore; // 0x58
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ ser.syncAsByte(wasRudeToPrelate);
+ ser.syncAsByte(insultedStephen);
+ ser.syncAsByte(field2d);
+ ser.syncAsByte(beatKlingons);
+ ser.syncAsByte(tookKlingonHand);
+ ser.syncAsByte(talkedToPrelate);
+ ser.syncAsByte(stephenWelcomedToStudy);
+ ser.syncAsByte(prelateWelcomedCrew);
+ ser.syncAsByte(askedPrelateAboutSightings);
+ ser.syncAsByte(field37);
+ ser.syncAsByte(mccoyMentionedFlora);
+ ser.syncAsByte(numBouldersGone);
+ ser.syncAsByte(enteredFrom);
+ ser.syncAsByte(repairedHand);
+ ser.syncAsByte(healedMiner);
+ ser.syncAsByte(curedChub);
+ ser.syncAsByte(field3e);
+ ser.syncAsByte(knowAboutHypoDytoxin);
+ ser.syncAsByte(minerDead);
+ ser.syncAsByte(field41);
+ ser.syncAsByte(foundMiner);
+ ser.syncAsByte(field45);
+ ser.syncAsByte(gaveSkullToNauian);
+ ser.syncAsByte(warpsDisabled);
+ ser.syncAsByte(boulder1Gone);
+ ser.syncAsByte(boulder2Gone);
+ ser.syncAsByte(boulder3Gone);
+ ser.syncAsByte(boulder4Gone);
+ ser.syncAsByte(doorOpened);
+ ser.syncAsByte(solvedSunPuzzle);
+ ser.syncAsByte(itemsTakenFromCase);
+ ser.syncAsByte(gotBerries);
+ ser.syncAsByte(madeHypoDytoxin);
+ ser.syncAsByte(metNauian);
+ ser.syncAsByte(gavePointsForDytoxin);
+ ser.syncAsByte(lookedAtComputer);
+ ser.syncAsByte(field56);
+ ser.syncAsByte(foundAlienRoom);
+ ser.syncAsSint16LE(missionScore);
+ }
} demon;
// Hijacked
@@ -142,6 +184,43 @@ struct AwayMission {
byte bridgeWinMethod; // 0x5e
bool talkedToBrigCrewman; // 0x5f
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ ser.syncAsSint16LE(missionScore);
+ ser.syncAsSint16LE(field2b);
+ ser.syncAsSint16LE(field2d);
+ ser.syncAsByte(engineerConscious);
+ ser.syncAsByte(field35);
+ ser.syncAsByte(gotWires);
+ ser.syncAsByte(orbitalDecayCounter);
+ ser.syncAsByte(bridgeElasiDrewPhasers);
+ ser.syncAsByte(talkedToCereth);
+ ser.syncAsByte(gotJunkPile);
+ ser.syncAsByte(gotTransmogrifier);
+ ser.syncAsByte(transporterRepaired);
+ ser.syncAsByte(spockExaminedTransporter);
+ ser.syncAsByte(usedTransmogrifierOnTransporter);
+ ser.syncAsByte(bridgeForceFieldDown);
+ ser.syncAsByte(savedPrisoners);
+ ser.syncAsByte(haveBomb);
+ ser.syncAsByte(brigElasiPhasersOnKill);
+ ser.syncAsByte(elasiTargetIndex);
+ ser.syncAsByte(guard1Status);
+ ser.syncAsByte(guard2Status);
+ ser.syncAsByte(field4e);
+ ser.syncBytes(crewmanKilled, 4);
+ ser.syncAsByte(bridgeElasi1Status);
+ ser.syncAsByte(bridgeElasi2Status);
+ ser.syncAsByte(bridgeElasi3Status);
+ ser.syncAsByte(bridgeElasi4Status);
+ ser.syncAsByte(brigForceFieldDown);
+ ser.syncAsByte(field59);
+ ser.syncAsByte(field5b);
+ ser.syncAsByte(elasiSurrendered);
+ ser.syncAsByte(kirkPhaserDrawn);
+ ser.syncAsByte(bridgeWinMethod);
+ ser.syncAsByte(talkedToBrigCrewman);
+ }
} tug;
// Love's Labor Jeopardized
@@ -187,6 +266,50 @@ struct AwayMission {
bool gotPointsForHydratingPreax; // 0x50
bool gotPointsForHydratingRomulans; // 0x51
int16 missionScore; // 0x52
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ ser.syncAsByte(alreadyStartedMission);
+ ser.syncAsByte(knowAboutVirus);
+ ser.syncAsByte(romulansUnconsciousFromLaughingGas);
+ ser.syncAsByte(releasedHumanLaughingGas);
+ ser.syncAsByte(releasedRomulanLaughingGas);
+ ser.syncAsByte(chamberHasCure);
+ ser.syncAsByte(freezerOpen);
+ ser.syncAsByte(chamberHasDish);
+ ser.syncAsByte(bottleInNozzle);
+ ser.syncAsByte(cabinetOpen);
+ ser.syncAsByte(gasFeedOn);
+ ser.syncAsByte(synthesizerBottleIndex);
+ ser.syncAsByte(synthesizerContents);
+ ser.syncAsByte(canister1);
+ ser.syncAsByte(canister2);
+ ser.syncAsByte(servicePanelOpen);
+ ser.syncAsByte(gasTankUnscrewed);
+ ser.syncAsByte(wrenchTaken);
+ ser.syncAsByte(tookN2TankFromServicePanel);
+ ser.syncAsByte(field3c);
+ ser.syncAsByte(grateRemoved);
+ ser.syncAsByte(insulationOnGround);
+ ser.syncAsByte(visitedRoomWithRomulans);
+ ser.syncAsByte(romulansCured);
+ ser.syncAsByte(romulansUnconsciousFromVirus);
+ ser.syncAsByte(freedMarcusAndCheever);
+ ser.syncAsByte(preaxCured);
+ ser.syncAsByte(spockInfectionCounter);
+ ser.syncAsByte(spockCured);
+ ser.syncAsByte(contactedEnterpriseBeforeCure);
+ ser.syncAsByte(contactedEnterpriseAfterCure);
+ ser.syncAsByte(spockAccessedConsole);
+ ser.syncAsByte(mccoyAccessedConsole);
+ ser.syncAsByte(gotPolyberylcarbonate);
+ ser.syncAsByte(gotTLDH);
+ ser.syncAsByte(gotPointsForOpeningGrate);
+ ser.syncAsByte(gotPointsForGassingRomulans);
+ ser.syncAsByte(gotCure);
+ ser.syncAsByte(gotPointsForHydratingPreax);
+ ser.syncAsByte(gotPointsForHydratingRomulans);
+ ser.syncAsSint16LE(missionScore);
+ }
} love;
struct {
@@ -241,6 +364,46 @@ struct AwayMission {
bool enteredRoom1ForFirstTime; // 0x58
bool repairedLifeSupportGenerator; // 0x59
int16 missionScore; // 0x5a
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ ser.syncAsByte(muddFirstRoomState);
+ ser.syncAsByte(torpedoLoaded);
+ ser.syncAsByte(knowAboutTorpedo);
+ ser.syncAsByte(discoveredBase3System);
+ ser.syncAsByte(translatedAlienLanguage);
+ ser.syncAsByte(databaseDestroyed);
+ ser.syncAsByte(muddInDatabaseRoom);
+ ser.syncAsByte(muddCurrentlyInsane);
+ ser.syncAsByte(computerDataErasedOrDestroyed);
+ ser.syncAsByte(muddErasedDatabase);
+ ser.syncAsByte(discoveredLenseAndDegrimerFunction);
+ ser.syncAsSint16LE(torpedoStatus);
+ ser.syncAsByte(muddUnavailable);
+ ser.syncAsByte(muddVisitedDatabaseRoom);
+ ser.syncAsByte(accessedAlienDatabase);
+ ser.syncAsByte(tookRepairTool);
+ ser.syncAsByte(gotPointsForDownloadingData);
+ ser.syncAsByte(contactedEnterpriseFirstTime);
+ ser.syncAsByte(viewScreenEnabled);
+ ser.syncAsByte(lifeSupportMalfunctioning);
+ ser.syncAsByte(numTimesEnteredRoom5);
+ ser.syncAsByte(gotMemoryDisk);
+ ser.syncAsByte(gotLense);
+ ser.syncAsByte(gotDegrimer);
+ ser.syncAsByte(putCapsuleInMedicalMachine);
+ ser.syncAsByte(muddUnconscious);
+ ser.syncAsByte(muddInsanityState);
+ ser.syncAsByte(muddInhaledGas);
+ ser.syncAsSint16LE(lifeSupportTimer);
+ ser.syncAsByte(startedLifeSupportTimer);
+ ser.syncAsByte(enteredRoom0ForFirstTime);
+ ser.syncAsByte(gotPointsForLoadingTorpedo);
+ ser.syncAsByte(gotPointsForPressingRedButton);
+ ser.syncAsByte(gotPointsForEnablingViewscreen);
+ ser.syncAsByte(enteredRoom1ForFirstTime);
+ ser.syncAsByte(repairedLifeSupportGenerator);
+ ser.syncAsSint16LE(missionScore);
+ }
} mudd;
struct {
@@ -262,6 +425,23 @@ struct AwayMission {
bool waterMonsterRetreated; // 0x34
bool showedSnakeToTlaoxac; // 0x35
int16 missionScore; // 0x36
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ ser.syncAsByte(diedFromStalactites);
+ ser.syncAsByte(vineState);
+ ser.syncAsByte(gotRock);
+ ser.syncAsByte(gotSnake);
+ ser.syncAsByte(tookKnife);
+ ser.syncAsByte(field2e);
+ ser.syncAsByte(numRocksThrownAtTlaoxac);
+ ser.syncAsByte(gotFern);
+ ser.syncAsByte(holeBlocked);
+ ser.syncAsByte(tlaoxacTestPassed);
+ ser.syncAsByte(knockedOutTlaoxac);
+ ser.syncAsByte(waterMonsterRetreated);
+ ser.syncAsByte(showedSnakeToTlaoxac);
+ ser.syncAsSint16LE(missionScore);
+ }
} feather;
struct {
@@ -309,6 +489,34 @@ struct AwayMission {
bool gotPointsForScanningGlob; // 0x64
bool gotPointsForBeamingOut;
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ ser.syncAsSint16LE(missionScore);
+ ser.syncAsSint16LE(field2b);
+ ser.syncAsByte(entityDefeated);
+ ser.syncAsByte(doorOpen);
+ ser.syncAsByte(scannedLock);
+ ser.syncAsByte(doorCodeBehaviour);
+ ser.syncAsByte(globSplitInTwo);
+ ser.syncAsByte(globDefeated);
+ ser.syncBytes(globEnergyLevels, 3);
+ ser.syncAsByte(enteredTrial3FirstTime);
+ ser.syncAsByte(klingonShootIndex);
+ ser.syncAsByte(shotKlingons);
+ ser.syncAsSint16LE(shotKlingonState);
+ ser.syncAsByte(neuralInterfaceActive);
+ for (int i = 0; i < 3; i++)
+ ser.syncAsSint16LE(holeContents[i]);
+ ser.syncAsByte(enteredGlobRoom);
+ ser.syncAsByte(forceFieldDown);
+ ser.syncAsByte(uhuraAnalyzedCode);
+ ser.syncAsSint16LE(missionEndMethod);
+ ser.syncAsByte(gotPointsForGettingRod);
+ ser.syncAsByte(gotPointsForCoatingRodWithIron);
+ ser.syncAsByte(gotPointsForActivatingInterface);
+ ser.syncAsByte(gotPointsForScanningGlob);
+ ser.syncAsByte(gotPointsForBeamingOut);
+ }
} trial;
};
};
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index dad620e..9f88f04 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2146,7 +2146,7 @@ public:
public:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
- // NOTE: Any changes here must be reflected in saveload.cpp.
+ // NOTE: Any changes here must be reflected in the corresponding serializer functions.
union {
struct {
// demon0
@@ -2203,6 +2203,63 @@ public:
// common
bool movingToDoor;
byte doorCounter;
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ // demon0
+ ser.syncAsByte(bottomDoorCounter);
+ ser.syncAsByte(topDoorCounter);
+ ser.syncAsByte(movingToTopDoor);
+ ser.syncAsByte(movingToBottomDoor);
+
+ // demon1
+ ser.syncBytes((byte *)klingonShot, 3);
+ ser.syncAsSint16LE(numKlingonsKilled);
+ ser.syncAsByte(attackIndex);
+ ser.syncAsByte(kirkShooting);
+ ser.syncBytes((byte *)d6, 10);
+
+ // demon3
+ ser.syncAsByte(shootingBoulder);
+ ser.syncAsByte(boulder1Shot);
+ ser.syncAsByte(boulderBeingShot);
+ ser.syncAsByte(kirkInPosition);
+ ser.syncAsByte(redshirtInPosition);
+ ser.syncAsByte(spockInPosition);
+ ser.syncAsByte(mccoyInPosition);
+ ser.syncAsByte(inFiringPosition);
+ ser.syncAsByte(kirkPhaserOut);
+ ser.syncBytes((byte *)boulderAnim, 10);
+ ser.syncAsSint16LE(usedPhaserOnDoor);
+
+ // demon4
+ ser.syncAsByte(triedToShootNauian);
+ ser.syncAsByte(nauianEmerged);
+ ser.syncAsByte(disabledSecurity);
+ ser.syncAsByte(cd);
+ ser.syncAsByte(crewReadyToBeamOut);
+ ser.syncAsSint16LE(crewmanUsingPanel);
+
+ // demon5
+ ser.syncAsByte(scannedRoberts);
+ ser.syncAsByte(scannedChub);
+ ser.syncAsByte(scannedGrisnash);
+ ser.syncAsByte(scannedStephen);
+ ser.syncAsByte(numScanned);
+ ser.syncAsByte(numTalkedTo);
+ ser.syncAsByte(talkedToRoberts);
+ ser.syncAsByte(talkedToChub);
+ ser.syncAsByte(talkedToGrisnash);
+ ser.syncAsByte(talkedToStephen);
+
+ // demon6
+ ser.syncAsByte(insultedStephenRecently);
+ ser.syncAsByte(stephenInRoom);
+ ser.syncAsByte(caseOpened);
+
+ // common
+ ser.syncAsByte(movingToDoor);
+ ser.syncAsByte(doorCounter);
+ }
} demon;
struct {
@@ -2211,6 +2268,14 @@ public:
byte shootingTarget;
bool elasiPhaserOnKill;
bool shootKirkOverride; // 0x1ec4
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ // tug2
+ ser.syncAsByte(shootingObject);
+ ser.syncAsByte(shootingTarget);
+ ser.syncAsByte(elasiPhaserOnKill);
+ ser.syncAsByte(shootKirkOverride);
+ }
} tug;
struct {
@@ -2253,6 +2318,48 @@ public:
byte spockAndMccoyReadyToUseCure;
byte cmnXPosToCureSpock;
byte cmnYPosToCureSpock;
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ // love0
+ ser.syncAsByte(heardSummaryOfVirus);
+ ser.syncAsSint16LE(consoleCrewman);
+ ser.syncBytes((byte *)consoleAnimation, 10);
+ ser.syncAsSint32LE(consoleSpeaker);
+ ser.syncAsSint32LE(consoleText);
+
+ // love1
+ ser.syncAsSint32LE(dyingSpeaker);
+ ser.syncAsSint16LE(crewmanUsingFreezerRetX);
+ ser.syncAsSint16LE(crewmanUsingFreezerRetY);
+ ser.syncAsSint16LE(crewmanUsingDevice);
+ ser.syncAsSint16LE(itemInNozzle);
+ ser.syncBytes((byte *)bottleAnimation, 10);
+
+ // love2
+ ser.syncAsByte(canisterType);
+ ser.syncAsByte(cb);
+ ser.syncAsSint16LE(canisterItem);
+ ser.syncBytes((byte *)canisterAnim, 10);
+ ser.syncAsSint16LE(chamberObject);
+ ser.syncBytes((byte *)chamberInputAnim, 10);
+ ser.syncBytes((byte *)chamberOutputAnim, 10);
+
+ // love3
+ ser.syncAsByte(activeCrewman);
+
+ // love4
+ ser.syncAsByte(gaveWaterToRomulans);
+
+ // love5
+ ser.syncAsByte(numCrewmenReadyToBeamOut);
+
+ // common
+ ser.syncAsByte(walkingToDoor);
+ ser.syncAsByte(doorOpenCounter);
+ ser.syncAsByte(spockAndMccoyReadyToUseCure);
+ ser.syncAsByte(cmnXPosToCureSpock);
+ ser.syncAsByte(cmnYPosToCureSpock);
+ }
} love;
struct {
@@ -2266,6 +2373,19 @@ public:
// common
byte walkingToDoor;
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ // mudd3
+ ser.syncAsByte(suggestedUsingTricorders);
+ ser.syncAsByte(tricordersUnavailable);
+
+ // mudd4
+ ser.syncAsByte(usingLeftConsole);
+ ser.syncAsByte(kirkUsingRightConsole);
+
+ // common
+ ser.syncAsByte(walkingToDoor);
+ }
} mudd;
struct {
@@ -2284,6 +2404,24 @@ public:
// feather7
bool insultedQuetzecoatl;
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ // feather1
+ ser.syncAsByte(snakeInHole);
+ ser.syncAsByte(scannedSnake);
+ ser.syncBytes(crewEscaped, 4);
+ ser.syncAsByte(crewmanClimbingVine);
+
+ // feather2
+ ser.syncAsByte(showedSnakeToTlaoxac);
+ ser.syncAsByte(tlaoxacUnconscious);
+
+ // feather6
+ ser.syncAsByte(usedRockOnCrystalsOnce);
+
+ // feather7
+ ser.syncAsByte(insultedQuetzecoatl);
+ }
} feather;
struct {
@@ -2295,6 +2433,17 @@ public:
int16 itemToUse; // 0x1386
int16 objectToUse; // 0x1388
int16 hole;
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ // trial2
+ ser.syncAsByte(globBeingShot);
+ ser.syncAsByte(phaserOnKill);
+
+ // trial5
+ ser.syncAsSint16LE(itemToUse);
+ ser.syncAsSint16LE(objectToUse);
+ ser.syncAsSint16LE(hole);
+ }
} trial;
} _roomVar;
diff --git a/engines/startrek/saveload.cpp b/engines/startrek/saveload.cpp
index cac8a78..f42d2f1 100644
--- a/engines/startrek/saveload.cpp
+++ b/engines/startrek/saveload.cpp
@@ -307,338 +307,23 @@ bool StarTrekEngine::saveOrLoadGameData(Common::SeekableReadStream *in, Common::
ser.syncAsByte(_awayMission.crewDirectionsAfterWalk[i]);
if (_missionName == "DEMON") {
- ser.syncAsByte(_awayMission.demon.wasRudeToPrelate);
- ser.syncAsByte(_awayMission.demon.insultedStephen);
- ser.syncAsByte(_awayMission.demon.field2d);
- ser.syncAsByte(_awayMission.demon.beatKlingons);
- ser.syncAsByte(_awayMission.demon.tookKlingonHand);
- ser.syncAsByte(_awayMission.demon.talkedToPrelate);
- ser.syncAsByte(_awayMission.demon.stephenWelcomedToStudy);
- ser.syncAsByte(_awayMission.demon.prelateWelcomedCrew);
- ser.syncAsByte(_awayMission.demon.askedPrelateAboutSightings);
- ser.syncAsByte(_awayMission.demon.field37);
- ser.syncAsByte(_awayMission.demon.mccoyMentionedFlora);
- ser.syncAsByte(_awayMission.demon.numBouldersGone);
- ser.syncAsByte(_awayMission.demon.enteredFrom);
- ser.syncAsByte(_awayMission.demon.repairedHand);
- ser.syncAsByte(_awayMission.demon.healedMiner);
- ser.syncAsByte(_awayMission.demon.curedChub);
- ser.syncAsByte(_awayMission.demon.field3e);
- ser.syncAsByte(_awayMission.demon.knowAboutHypoDytoxin);
- ser.syncAsByte(_awayMission.demon.minerDead);
- ser.syncAsByte(_awayMission.demon.field41);
- ser.syncAsByte(_awayMission.demon.foundMiner);
- ser.syncAsByte(_awayMission.demon.field45);
- ser.syncAsByte(_awayMission.demon.gaveSkullToNauian);
- ser.syncAsByte(_awayMission.demon.warpsDisabled);
- ser.syncAsByte(_awayMission.demon.boulder1Gone);
- ser.syncAsByte(_awayMission.demon.boulder2Gone);
- ser.syncAsByte(_awayMission.demon.boulder3Gone);
- ser.syncAsByte(_awayMission.demon.boulder4Gone);
- ser.syncAsByte(_awayMission.demon.doorOpened);
- ser.syncAsByte(_awayMission.demon.solvedSunPuzzle);
- ser.syncAsByte(_awayMission.demon.itemsTakenFromCase);
- ser.syncAsByte(_awayMission.demon.gotBerries);
- ser.syncAsByte(_awayMission.demon.madeHypoDytoxin);
- ser.syncAsByte(_awayMission.demon.metNauian);
- ser.syncAsByte(_awayMission.demon.gavePointsForDytoxin);
- ser.syncAsByte(_awayMission.demon.lookedAtComputer);
- ser.syncAsByte(_awayMission.demon.field56);
- ser.syncAsByte(_awayMission.demon.foundAlienRoom);
- ser.syncAsSint16LE(_awayMission.demon.missionScore);
-
- // demon0
- ser.syncAsByte(_room->_roomVar.demon.bottomDoorCounter);
- ser.syncAsByte(_room->_roomVar.demon.topDoorCounter);
- ser.syncAsByte(_room->_roomVar.demon.movingToTopDoor);
- ser.syncAsByte(_room->_roomVar.demon.movingToBottomDoor);
-
- // demon1
- ser.syncBytes((byte *)_room->_roomVar.demon.klingonShot, 3);
- ser.syncAsSint16LE(_room->_roomVar.demon.numKlingonsKilled);
- ser.syncAsByte(_room->_roomVar.demon.attackIndex);
- ser.syncAsByte(_room->_roomVar.demon.kirkShooting);
- ser.syncBytes((byte *)_room->_roomVar.demon.d6, 10);
-
- // demon3
- ser.syncAsByte(_room->_roomVar.demon.shootingBoulder);
- ser.syncAsByte(_room->_roomVar.demon.boulder1Shot);
- ser.syncAsByte(_room->_roomVar.demon.boulderBeingShot);
- ser.syncAsByte(_room->_roomVar.demon.kirkInPosition);
- ser.syncAsByte(_room->_roomVar.demon.redshirtInPosition);
- ser.syncAsByte(_room->_roomVar.demon.spockInPosition);
- ser.syncAsByte(_room->_roomVar.demon.mccoyInPosition);
- ser.syncAsByte(_room->_roomVar.demon.inFiringPosition);
- ser.syncAsByte(_room->_roomVar.demon.kirkPhaserOut);
- ser.syncBytes((byte *)_room->_roomVar.demon.boulderAnim, 10);
- ser.syncAsSint16LE(_room->_roomVar.demon.usedPhaserOnDoor);
-
- // demon4
- ser.syncAsByte(_room->_roomVar.demon.triedToShootNauian);
- ser.syncAsByte(_room->_roomVar.demon.nauianEmerged);
- ser.syncAsByte(_room->_roomVar.demon.disabledSecurity);
- ser.syncAsByte(_room->_roomVar.demon.cd);
- ser.syncAsByte(_room->_roomVar.demon.crewReadyToBeamOut);
- ser.syncAsSint16LE(_room->_roomVar.demon.crewmanUsingPanel);
-
- // demon5
- ser.syncAsByte(_room->_roomVar.demon.scannedRoberts);
- ser.syncAsByte(_room->_roomVar.demon.scannedChub);
- ser.syncAsByte(_room->_roomVar.demon.scannedGrisnash);
- ser.syncAsByte(_room->_roomVar.demon.scannedStephen);
- ser.syncAsByte(_room->_roomVar.demon.numScanned);
- ser.syncAsByte(_room->_roomVar.demon.numTalkedTo);
- ser.syncAsByte(_room->_roomVar.demon.talkedToRoberts);
- ser.syncAsByte(_room->_roomVar.demon.talkedToChub);
- ser.syncAsByte(_room->_roomVar.demon.talkedToGrisnash);
- ser.syncAsByte(_room->_roomVar.demon.talkedToStephen);
-
- // demon6
- ser.syncAsByte(_room->_roomVar.demon.insultedStephenRecently);
- ser.syncAsByte(_room->_roomVar.demon.stephenInRoom);
- ser.syncAsByte(_room->_roomVar.demon.caseOpened);
-
- // common
- ser.syncAsByte(_room->_roomVar.demon.movingToDoor);
- ser.syncAsByte(_room->_roomVar.demon.doorCounter);
+ _awayMission.demon.saveLoadWithSerializer(ser);
+ _room->_roomVar.demon.saveLoadWithSerializer(ser);
} else if (_missionName == "TUG") {
- ser.syncAsSint16LE(_awayMission.tug.missionScore);
- ser.syncAsSint16LE(_awayMission.tug.field2b);
- ser.syncAsSint16LE(_awayMission.tug.field2d);
- ser.syncAsByte(_awayMission.tug.engineerConscious);
- ser.syncAsByte(_awayMission.tug.field35);
- ser.syncAsByte(_awayMission.tug.gotWires);
- ser.syncAsByte(_awayMission.tug.orbitalDecayCounter);
- ser.syncAsByte(_awayMission.tug.bridgeElasiDrewPhasers);
- ser.syncAsByte(_awayMission.tug.talkedToCereth);
- ser.syncAsByte(_awayMission.tug.gotJunkPile);
- ser.syncAsByte(_awayMission.tug.gotTransmogrifier);
- ser.syncAsByte(_awayMission.tug.transporterRepaired);
- ser.syncAsByte(_awayMission.tug.spockExaminedTransporter);
- ser.syncAsByte(_awayMission.tug.usedTransmogrifierOnTransporter);
- ser.syncAsByte(_awayMission.tug.bridgeForceFieldDown);
- ser.syncAsByte(_awayMission.tug.savedPrisoners);
- ser.syncAsByte(_awayMission.tug.haveBomb);
- ser.syncAsByte(_awayMission.tug.brigElasiPhasersOnKill);
- ser.syncAsByte(_awayMission.tug.elasiTargetIndex);
- ser.syncAsByte(_awayMission.tug.guard1Status);
- ser.syncAsByte(_awayMission.tug.guard2Status);
- ser.syncAsByte(_awayMission.tug.field4e);
- ser.syncBytes(_awayMission.tug.crewmanKilled, 4);
- ser.syncAsByte(_awayMission.tug.bridgeElasi1Status);
- ser.syncAsByte(_awayMission.tug.bridgeElasi2Status);
- ser.syncAsByte(_awayMission.tug.bridgeElasi3Status);
- ser.syncAsByte(_awayMission.tug.bridgeElasi4Status);
- ser.syncAsByte(_awayMission.tug.brigForceFieldDown);
- ser.syncAsByte(_awayMission.tug.field59);
- ser.syncAsByte(_awayMission.tug.field5b);
- ser.syncAsByte(_awayMission.tug.elasiSurrendered);
- ser.syncAsByte(_awayMission.tug.kirkPhaserDrawn);
- ser.syncAsByte(_awayMission.tug.bridgeWinMethod);
- ser.syncAsByte(_awayMission.tug.talkedToBrigCrewman);
-
- // tug2
- ser.syncAsByte(_room->_roomVar.tug.shootingObject);
- ser.syncAsByte(_room->_roomVar.tug.shootingTarget);
- ser.syncAsByte(_room->_roomVar.tug.elasiPhaserOnKill);
- ser.syncAsByte(_room->_roomVar.tug.shootKirkOverride);
+ _awayMission.tug.saveLoadWithSerializer(ser);
+ _room->_roomVar.tug.saveLoadWithSerializer(ser);
} else if (_missionName == "LOVE") {
- ser.syncAsByte(_awayMission.love.alreadyStartedMission);
- ser.syncAsByte(_awayMission.love.knowAboutVirus);
- ser.syncAsByte(_awayMission.love.romulansUnconsciousFromLaughingGas);
- ser.syncAsByte(_awayMission.love.releasedHumanLaughingGas);
- ser.syncAsByte(_awayMission.love.releasedRomulanLaughingGas);
- ser.syncAsByte(_awayMission.love.chamberHasCure);
- ser.syncAsByte(_awayMission.love.freezerOpen);
- ser.syncAsByte(_awayMission.love.chamberHasDish);
- ser.syncAsByte(_awayMission.love.bottleInNozzle);
- ser.syncAsByte(_awayMission.love.cabinetOpen);
- ser.syncAsByte(_awayMission.love.gasFeedOn);
- ser.syncAsByte(_awayMission.love.synthesizerBottleIndex);
- ser.syncAsByte(_awayMission.love.synthesizerContents);
- ser.syncAsByte(_awayMission.love.canister1);
- ser.syncAsByte(_awayMission.love.canister2);
- ser.syncAsByte(_awayMission.love.servicePanelOpen);
- ser.syncAsByte(_awayMission.love.gasTankUnscrewed);
- ser.syncAsByte(_awayMission.love.wrenchTaken);
- ser.syncAsByte(_awayMission.love.tookN2TankFromServicePanel);
- ser.syncAsByte(_awayMission.love.field3c);
- ser.syncAsByte(_awayMission.love.grateRemoved);
- ser.syncAsByte(_awayMission.love.insulationOnGround);
- ser.syncAsByte(_awayMission.love.visitedRoomWithRomulans);
- ser.syncAsByte(_awayMission.love.romulansCured);
- ser.syncAsByte(_awayMission.love.romulansUnconsciousFromVirus);
- ser.syncAsByte(_awayMission.love.freedMarcusAndCheever);
- ser.syncAsByte(_awayMission.love.preaxCured);
- ser.syncAsByte(_awayMission.love.spockInfectionCounter);
- ser.syncAsByte(_awayMission.love.spockCured);
- ser.syncAsByte(_awayMission.love.contactedEnterpriseBeforeCure);
- ser.syncAsByte(_awayMission.love.contactedEnterpriseAfterCure);
- ser.syncAsByte(_awayMission.love.spockAccessedConsole);
- ser.syncAsByte(_awayMission.love.mccoyAccessedConsole);
- ser.syncAsByte(_awayMission.love.gotPolyberylcarbonate);
- ser.syncAsByte(_awayMission.love.gotTLDH);
- ser.syncAsByte(_awayMission.love.gotPointsForOpeningGrate);
- ser.syncAsByte(_awayMission.love.gotPointsForGassingRomulans);
- ser.syncAsByte(_awayMission.love.gotCure);
- ser.syncAsByte(_awayMission.love.gotPointsForHydratingPreax);
- ser.syncAsByte(_awayMission.love.gotPointsForHydratingRomulans);
- ser.syncAsSint16LE(_awayMission.love.missionScore);
-
- // love0
- ser.syncAsByte(_room->_roomVar.love.heardSummaryOfVirus);
- ser.syncAsSint16LE(_room->_roomVar.love.consoleCrewman);
- ser.syncBytes((byte *)_room->_roomVar.love.consoleAnimation, 10);
- ser.syncAsSint32LE(_room->_roomVar.love.consoleSpeaker);
- ser.syncAsSint32LE(_room->_roomVar.love.consoleText);
-
- // love1
- ser.syncAsSint32LE(_room->_roomVar.love.dyingSpeaker);
- ser.syncAsSint16LE(_room->_roomVar.love.crewmanUsingFreezerRetX);
- ser.syncAsSint16LE(_room->_roomVar.love.crewmanUsingFreezerRetY);
- ser.syncAsSint16LE(_room->_roomVar.love.crewmanUsingDevice);
- ser.syncAsSint16LE(_room->_roomVar.love.itemInNozzle);
- ser.syncBytes((byte *)_room->_roomVar.love.bottleAnimation, 10);
-
- // love2
- ser.syncAsByte(_room->_roomVar.love.canisterType);
- ser.syncAsByte(_room->_roomVar.love.cb);
- ser.syncAsSint16LE(_room->_roomVar.love.canisterItem);
- ser.syncBytes((byte *)_room->_roomVar.love.canisterAnim, 10);
- ser.syncAsSint16LE(_room->_roomVar.love.chamberObject);
- ser.syncBytes((byte *)_room->_roomVar.love.chamberInputAnim, 10);
- ser.syncBytes((byte *)_room->_roomVar.love.chamberOutputAnim, 10);
-
- // love3
- ser.syncAsByte(_room->_roomVar.love.activeCrewman);
-
- // love4
- ser.syncAsByte(_room->_roomVar.love.gaveWaterToRomulans);
-
- // love5
- ser.syncAsByte(_room->_roomVar.love.numCrewmenReadyToBeamOut);
-
- // common
- ser.syncAsByte(_room->_roomVar.love.walkingToDoor);
- ser.syncAsByte(_room->_roomVar.love.doorOpenCounter);
- ser.syncAsByte(_room->_roomVar.love.spockAndMccoyReadyToUseCure);
- ser.syncAsByte(_room->_roomVar.love.cmnXPosToCureSpock);
- ser.syncAsByte(_room->_roomVar.love.cmnYPosToCureSpock);
+ _awayMission.love.saveLoadWithSerializer(ser);
+ _room->_roomVar.love.saveLoadWithSerializer(ser);
} else if (_missionName == "MUDD") {
- ser.syncAsByte(_awayMission.mudd.muddFirstRoomState);
- ser.syncAsByte(_awayMission.mudd.torpedoLoaded);
- ser.syncAsByte(_awayMission.mudd.knowAboutTorpedo);
- ser.syncAsByte(_awayMission.mudd.discoveredBase3System);
- ser.syncAsByte(_awayMission.mudd.translatedAlienLanguage);
- ser.syncAsByte(_awayMission.mudd.databaseDestroyed);
- ser.syncAsByte(_awayMission.mudd.muddInDatabaseRoom);
- ser.syncAsByte(_awayMission.mudd.muddCurrentlyInsane);
- ser.syncAsByte(_awayMission.mudd.computerDataErasedOrDestroyed);
- ser.syncAsByte(_awayMission.mudd.muddErasedDatabase);
- ser.syncAsByte(_awayMission.mudd.discoveredLenseAndDegrimerFunction);
- ser.syncAsSint16LE(_awayMission.mudd.torpedoStatus);
- ser.syncAsByte(_awayMission.mudd.muddUnavailable);
- ser.syncAsByte(_awayMission.mudd.muddVisitedDatabaseRoom);
- ser.syncAsByte(_awayMission.mudd.accessedAlienDatabase);
- ser.syncAsByte(_awayMission.mudd.tookRepairTool);
- ser.syncAsByte(_awayMission.mudd.gotPointsForDownloadingData);
- ser.syncAsByte(_awayMission.mudd.contactedEnterpriseFirstTime);
- ser.syncAsByte(_awayMission.mudd.viewScreenEnabled);
- ser.syncAsByte(_awayMission.mudd.lifeSupportMalfunctioning);
- ser.syncAsByte(_awayMission.mudd.numTimesEnteredRoom5);
- ser.syncAsByte(_awayMission.mudd.gotMemoryDisk);
- ser.syncAsByte(_awayMission.mudd.gotLense);
- ser.syncAsByte(_awayMission.mudd.gotDegrimer);
- ser.syncAsByte(_awayMission.mudd.putCapsuleInMedicalMachine);
- ser.syncAsByte(_awayMission.mudd.muddUnconscious);
- ser.syncAsByte(_awayMission.mudd.muddInsanityState);
- ser.syncAsByte(_awayMission.mudd.muddInhaledGas);
- ser.syncAsSint16LE(_awayMission.mudd.lifeSupportTimer);
- ser.syncAsByte(_awayMission.mudd.startedLifeSupportTimer);
- ser.syncAsByte(_awayMission.mudd.enteredRoom0ForFirstTime);
- ser.syncAsByte(_awayMission.mudd.gotPointsForLoadingTorpedo);
- ser.syncAsByte(_awayMission.mudd.gotPointsForPressingRedButton);
- ser.syncAsByte(_awayMission.mudd.gotPointsForEnablingViewscreen);
- ser.syncAsByte(_awayMission.mudd.enteredRoom1ForFirstTime);
- ser.syncAsByte(_awayMission.mudd.repairedLifeSupportGenerator);
- ser.syncAsSint16LE(_awayMission.mudd.missionScore);
-
- // mudd3
- ser.syncAsByte(_room->_roomVar.mudd.suggestedUsingTricorders);
- ser.syncAsByte(_room->_roomVar.mudd.tricordersUnavailable);
-
- // mudd4
- ser.syncAsByte(_room->_roomVar.mudd.usingLeftConsole);
- ser.syncAsByte(_room->_roomVar.mudd.kirkUsingRightConsole);
-
- // common
- ser.syncAsByte(_room->_roomVar.mudd.walkingToDoor);
+ _awayMission.mudd.saveLoadWithSerializer(ser);
+ _room->_roomVar.mudd.saveLoadWithSerializer(ser);
} else if (_missionName == "FEATHER") {
- ser.syncAsByte(_awayMission.feather.diedFromStalactites);
- ser.syncAsByte(_awayMission.feather.vineState);
- ser.syncAsByte(_awayMission.feather.gotRock);
- ser.syncAsByte(_awayMission.feather.gotSnake);
- ser.syncAsByte(_awayMission.feather.tookKnife);
- ser.syncAsByte(_awayMission.feather.field2e);
- ser.syncAsByte(_awayMission.feather.numRocksThrownAtTlaoxac);
- ser.syncAsByte(_awayMission.feather.gotFern);
- ser.syncAsByte(_awayMission.feather.holeBlocked);
- ser.syncAsByte(_awayMission.feather.tlaoxacTestPassed);
- ser.syncAsByte(_awayMission.feather.knockedOutTlaoxac);
- ser.syncAsByte(_awayMission.feather.waterMonsterRetreated);
- ser.syncAsByte(_awayMission.feather.showedSnakeToTlaoxac);
- ser.syncAsSint16LE(_awayMission.feather.missionScore);
-
- // feather1
- ser.syncAsByte(_room->_roomVar.feather.snakeInHole);
- ser.syncAsByte(_room->_roomVar.feather.scannedSnake);
- ser.syncBytes(_room->_roomVar.feather.crewEscaped, 4);
- ser.syncAsByte(_room->_roomVar.feather.crewmanClimbingVine);
-
- // feather2
- ser.syncAsByte(_room->_roomVar.feather.showedSnakeToTlaoxac);
- ser.syncAsByte(_room->_roomVar.feather.tlaoxacUnconscious);
-
- // feather6
- ser.syncAsByte(_room->_roomVar.feather.usedRockOnCrystalsOnce);
-
- // feather7
- ser.syncAsByte(_room->_roomVar.feather.insultedQuetzecoatl);
+ _awayMission.feather.saveLoadWithSerializer(ser);
+ _room->_roomVar.feather.saveLoadWithSerializer(ser);
} else if (_missionName == "TRIAL") {
- ser.syncAsSint16LE(_awayMission.trial.missionScore);
- ser.syncAsSint16LE(_awayMission.trial.field2b);
- ser.syncAsByte(_awayMission.trial.entityDefeated);
- ser.syncAsByte(_awayMission.trial.doorOpen);
- ser.syncAsByte(_awayMission.trial.scannedLock);
- ser.syncAsByte(_awayMission.trial.doorCodeBehaviour);
- ser.syncAsByte(_awayMission.trial.globSplitInTwo);
- ser.syncAsByte(_awayMission.trial.globDefeated);
- ser.syncBytes(_awayMission.trial.globEnergyLevels, 3);
- ser.syncAsByte(_awayMission.trial.enteredTrial3FirstTime);
- ser.syncAsByte(_awayMission.trial.klingonShootIndex);
- ser.syncAsByte(_awayMission.trial.shotKlingons);
- ser.syncAsSint16LE(_awayMission.trial.shotKlingonState);
- ser.syncAsByte(_awayMission.trial.neuralInterfaceActive);
- for (int i = 0; i < 3; i++)
- ser.syncAsSint16LE(_awayMission.trial.holeContents[i]);
- ser.syncAsByte(_awayMission.trial.enteredGlobRoom);
- ser.syncAsByte(_awayMission.trial.forceFieldDown);
- ser.syncAsByte(_awayMission.trial.uhuraAnalyzedCode);
- ser.syncAsSint16LE(_awayMission.trial.missionEndMethod);
- ser.syncAsByte(_awayMission.trial.gotPointsForGettingRod);
- ser.syncAsByte(_awayMission.trial.gotPointsForCoatingRodWithIron);
- ser.syncAsByte(_awayMission.trial.gotPointsForActivatingInterface);
- ser.syncAsByte(_awayMission.trial.gotPointsForScanningGlob);
- ser.syncAsByte(_awayMission.trial.gotPointsForBeamingOut);
-
- // trial2
- ser.syncAsByte(_room->_roomVar.trial.globBeingShot);
- ser.syncAsByte(_room->_roomVar.trial.phaserOnKill);
-
- // trial5
- ser.syncAsSint16LE(_room->_roomVar.trial.itemToUse);
- ser.syncAsSint16LE(_room->_roomVar.trial.objectToUse);
- ser.syncAsSint16LE(_room->_roomVar.trial.hole);
+ _awayMission.trial.saveLoadWithSerializer(ser);
+ _room->_roomVar.trial.saveLoadWithSerializer(ser);
}
// The action queue
Commit: 5660ce81340a013c0c653a55b7430737213783a4
https://github.com/scummvm/scummvm/commit/5660ce81340a013c0c653a55b7430737213783a4
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fix .BAN file rendering behind textboxes
Changed paths:
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/startrek.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 43358f8..cce9861 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -304,14 +304,14 @@ void Graphics::drawSprite(const Sprite &sprite, ::Graphics::Surface *surface) {
// rect is the portion of the sprite to update. It must be entirely contained within the
// sprite's actual, full rectangle.
-void Graphics::drawSprite(const Sprite &sprite, ::Graphics::Surface *surface, const Common::Rect &rect) {
+void Graphics::drawSprite(const Sprite &sprite, ::Graphics::Surface *surface, const Common::Rect &rect, int rectLeft, int rectTop) {
Common::Rect spriteRect = Common::Rect(sprite.drawX, sprite.drawY,
sprite.drawX + sprite.bitmap->width, sprite.drawY + sprite.bitmap->height);
assert(_screenRect.contains(rect));
assert(spriteRect.contains(rect));
- byte *dest = (byte *)surface->getPixels() + rect.top * SCREEN_WIDTH + rect.left;
+ byte *dest = (byte *)surface->getPixels() + (rect.top - rectTop) * SCREEN_WIDTH + (rect.left - rectLeft);
switch (sprite.drawMode) {
case 0: { // Normal sprite
@@ -583,8 +583,9 @@ void Graphics::drawAllSprites(bool updateScreen) {
this->updateScreen();
}
-void Graphics::drawAllSpritesInRect(const Common::Rect &rect) {
- ::Graphics::Surface *surface = _vm->_system->lockScreen();
+void Graphics::drawAllSpritesInRectToSurface(const Common::Rect &rect, ::Graphics::Surface *surface) {
+ surface->copyFrom(*_vm->_system->lockScreen());
+ _vm->_system->unlockScreen();
for (int i = 0; i < _numSprites; i++) {
Sprite *sprite = _sprites[i];
@@ -595,8 +596,6 @@ void Graphics::drawAllSpritesInRect(const Common::Rect &rect) {
if (!intersect.isEmpty())
drawSprite(*sprite, surface, intersect);
}
-
- _vm->_system->unlockScreen();
}
void Graphics::forceDrawAllSprites(bool updateScreen) {
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 1a71aa2..bd5784e 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -105,13 +105,21 @@ public:
void drawTextChar(::Graphics::Surface *surface, const Sprite &sprite, int x, int y, const Common::Rect &rect);
void drawSprite(const Sprite &sprite, ::Graphics::Surface *surface);
- void drawSprite(const Sprite &sprite, ::Graphics::Surface *surface, const Common::Rect &rect);
+ /**
+ * @param sprite The sprite to draw
+ * @param surface The surface to draw to
+ * @param rect The part of the sprite to draw (only draw the part of the sprite that
+ * intersects with it)
+ @ @param rectLeft X-offset to subtract before drawing to surface.
+ @ @param rectTop Y-offset to subtract before drawing to surface.
+ */
+ void drawSprite(const Sprite &sprite, ::Graphics::Surface *surface, const Common::Rect &rect, int rectLeft = 0, int rectTop = 0);
void drawAllSprites(bool updateScreen = true);
/**
* This function should only be called after "drawAllSprites" (so that sprite rects
* are updated).
*/
- void drawAllSpritesInRect(const Common::Rect &rect);
+ void drawAllSpritesInRectToSurface(const Common::Rect &rect, ::Graphics::Surface *surface);
/**
* Sets "bitmapChanged" to true on all sprites before calling drawAllSprites.
*/
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 4703bbe..9623ccc 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -884,23 +884,63 @@ void StarTrekEngine::renderBanAboveSprites() {
rect.top = _banFiles[i]->readSint16();
rect.right = _banFiles[i]->readSint16() + 1;
rect.bottom = _banFiles[i]->readSint16() + 1;
- _gfx->drawAllSpritesInRect(rect);
- // Just read through the BAN data to get the end address, not doing anything
- // with it.
+ // Draw all sprites in this rectangle to a custom surface, and only update the
+ // specific pixels that were updated by the BAN file this frame.
+ // Rationale behind this is that, since the background may not have been
+ // redrawn, the transparent sprites (ie. textboxes) would further darken any
+ // pixels behind them that haven't been updated this frame. So, we can't just
+ // update everything in this rectangle.
+ // FIXME: This copies the entire screen surface for temporary drawing, which
+ // is somewhat wasteful. Original game had one more graphics layer it drew to
+ // before the screen was updated...
+ ::Graphics::Surface surface;
+ _gfx->drawAllSpritesInRectToSurface(rect, &surface);
+
+ byte *destPixels = _gfx->lockScreenPixels();
+ byte *src = (byte *)surface.getPixels() + offset;
+ byte *dest = destPixels + offset;
+
+ /*
+ _banFiles[i]->seek(_banFileOffsets[i], SEEK_SET);
+ renderBan(destPixels, _banFiles[i]);
+ */
+ // This is similar to renderBan(), except it copies pixels from the surface
+ // above instead of drawing directly to it. (Important since sprites may be
+ // drawn on top.)
while (--size >= 0) {
+ assert(dest >= destPixels && dest < destPixels + SCREEN_WIDTH * SCREEN_HEIGHT);
int8 b = _banFiles[i]->readByte();
- if (b == -128)
- _banFiles[i]->readUint16();
- else if (b < 0) {
- _banFiles[i]->readByte();
+ if (b == -128) {
+ uint16 skip = _banFiles[i]->readUint16();
+ dest += skip;
+ src += skip;
+ } else if (b < 0) {
+ byte c = _banFiles[i]->readByte();
+ if (c == 0) {
+ dest += (-b) + 1;
+ src += (-b) + 1;
+ }
+ else {
+ for (int j = 0; j < (-b) + 1; j++)
+ *(dest++) = *(src++);
+ }
} else {
b++;
- while (b-- != 0)
- _banFiles[i]->readByte();
+ while (b-- != 0) {
+ byte c = _banFiles[i]->readByte();
+ if (c == 0) {
+ dest++;
+ src++;
+ } else
+ *(dest++) = *(src++);
+ }
}
}
+ _gfx->unlockScreenPixels();
+ surface.free();
+
_banFileOffsets[i] = _banFiles[i]->pos();
}
}
Commit: 23b3782b5217e3d08b84c6abce0821e01071c3f7
https://github.com/scummvm/scummvm/commit/23b3782b5217e3d08b84c6abce0821e01071c3f7
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: SINS0
Changed paths:
A engines/startrek/rooms/sins0.cpp
A engines/startrek/rooms/sins1.cpp
A engines/startrek/rooms/sins2.cpp
A engines/startrek/rooms/sins3.cpp
A engines/startrek/rooms/sins4.cpp
A engines/startrek/rooms/sins5.cpp
engines/startrek/awaymission.h
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/startrek.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index a123c09..8f3e83b 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -518,6 +518,16 @@ struct AwayMission {
ser.syncAsByte(gotPointsForBeamingOut);
}
} trial;
+
+ struct {
+ byte field39; // 0x39
+ bool field3d; // 0x3d
+ bool field3e; // 0x3e
+ bool enteredRoom0FirstTime; // 0x42
+ bool field43; // 0x43
+ bool gotPointsForScanningStatue; // 0x48
+ int16 missionScore; // 0x52
+ } sins;
};
};
// Size: 0x129 bytes
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 85250e0..384e07b 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -60,6 +60,12 @@ MODULE_OBJS = \
rooms/trial3.o \
rooms/trial4.o \
rooms/trial5.o \
+ rooms/sins0.o \
+ rooms/sins1.o \
+ rooms/sins2.o \
+ rooms/sins3.o \
+ rooms/sins4.o \
+ rooms/sins5.o \
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 08743f7..bc2015f 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -93,6 +93,12 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
ADD_ROOM(trial3);
ADD_ROOM(trial4);
ADD_ROOM(trial5);
+ ADD_ROOM(sins0);
+ ADD_ROOM(sins1);
+ ADD_ROOM(sins2);
+ ADD_ROOM(sins3);
+ ADD_ROOM(sins4);
+ ADD_ROOM(sins5);
if (_roomActionList == nullptr) {
warning("Room \"%s\" unimplemented", name.c_str());
@@ -457,6 +463,10 @@ void Room::endMission(int16 score, int16 arg1, int16 arg2) {
_vm->_missionToLoad = "FEATHER";
if (_vm->_missionName == "FEATHER")
_vm->_missionToLoad = "TRIAL";
+ if (_vm->_missionName == "TRIAL")
+ _vm->_missionToLoad = "SINS";
+ if (_vm->_missionName == "SINS")
+ _vm->_missionToLoad = "VENG";
_vm->_roomIndexToLoad = 0;
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 9f88f04..bcccf8f 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2144,6 +2144,51 @@ public:
void trial5UseBlueGem3OnHole3();
void trial5UseMedkitAnywhere();
+
+ // SINS0
+ void sins0Tick1();
+ void sins0LookAnywhere();
+ void sins0LookAtOpenDoor();
+ void sins0LookAtClosedDoor();
+ void sins0TalkToSpock();
+ void sins0TalkToMccoy();
+ void sins0TalkToRedshirt();
+ void sins0LookAtGround();
+ void sins0GetRock();
+ void sins0PickedUpRock();
+ void sins0UseSTricorderAnywhere();
+ void sins0UseSTricorderOnGround();
+ void sins0UseSTricorderOnPlanet();
+ void sins0Tick40();
+ void sins0LookAtStatue();
+ void sins0LookAtPlanet();
+ void sins0LookAtSky();
+ void sins0LookAtKirk();
+ void sins0LookAtSpock();
+ void sins0LookAtMccoy();
+ void sins0LookAtRedshirt();
+ void sins0UseSTricorderOnClosedDoor();
+ void sins0UseSTricorderOnStatue();
+ void sins0UseMedkitOnCrewman();
+ void sins0UseMTricorderOnCrewman();
+ void sins0UseCommunicator();
+ void sins0WalkToDoor();
+
+ // SINS1
+ void sins1Tick1();
+
+ // SINS2
+ void sins2Tick1();
+
+ // SINS3
+ void sins3Tick1();
+
+ // SINS4
+ void sins4Tick1();
+
+ // SINS5
+ void sins5Tick1();
+
public:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
// NOTE: Any changes here must be reflected in the corresponding serializer functions.
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index c83dc99..b44fbf1 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1790,6 +1790,11 @@ extern const int trial0NumActions, trial1NumActions, trial2NumActions
extern const RoomAction trial4ActionList[], trial5ActionList[];
extern const int trial4NumActions, trial5NumActions;
+extern const RoomAction sins0ActionList[], sins1ActionList[], sins2ActionList[], sins3ActionList[];
+extern const int sins0NumActions, sins1NumActions, sins2NumActions, sins3NumActions;
+extern const RoomAction sins4ActionList[], sins5ActionList[];
+extern const int sins4NumActions, sins5NumActions;
+
}
#endif
diff --git a/engines/startrek/rooms/sins0.cpp b/engines/startrek/rooms/sins0.cpp
new file mode 100644
index 0000000..bd93f25
--- /dev/null
+++ b/engines/startrek/rooms/sins0.cpp
@@ -0,0 +1,246 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR 8
+
+#define HOTSPOT_DOOR 0x20
+#define HOTSPOT_GROUND 0x21
+#define HOTSPOT_STATUE 0x22
+#define HOTSPOT_PLANET 0x23
+#define HOTSPOT_SKY 0x24 // Not mapped anywhere?
+
+namespace StarTrek {
+
+extern const RoomAction sins0ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::sins0Tick1 },
+
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::sins0LookAnywhere },
+ { {ACTION_LOOK, OBJECT_DOOR, 0, 0}, &Room::sins0LookAtOpenDoor },
+ { {ACTION_LOOK, HOTSPOT_DOOR, 0, 0}, &Room::sins0LookAtClosedDoor },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::sins0TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::sins0TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::sins0TalkToRedshirt },
+ { {ACTION_LOOK, HOTSPOT_GROUND, 0, 0}, &Room::sins0LookAtGround },
+ { {ACTION_GET, HOTSPOT_GROUND, 0, 0}, &Room::sins0GetRock },
+ { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::sins0PickedUpRock },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::sins0UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_GROUND, 0}, &Room::sins0UseSTricorderOnGround },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_PLANET, 0}, &Room::sins0UseSTricorderOnPlanet },
+
+ { {ACTION_TICK, 40, 0, 0}, &Room::sins0Tick40 },
+ { {ACTION_LOOK, HOTSPOT_STATUE, 0, 0}, &Room::sins0LookAtStatue },
+ { {ACTION_LOOK, HOTSPOT_PLANET, 0, 0}, &Room::sins0LookAtPlanet },
+ { {ACTION_LOOK, HOTSPOT_SKY, 0, 0}, &Room::sins0LookAtSky },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::sins0LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::sins0LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::sins0LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::sins0LookAtRedshirt },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_DOOR, 0}, &Room::sins0UseSTricorderOnClosedDoor },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_STATUE, 0}, &Room::sins0UseSTricorderOnStatue },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_KIRK, 0}, &Room::sins0UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0}, &Room::sins0UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_MCCOY, 0}, &Room::sins0UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_REDSHIRT, 0}, &Room::sins0UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::sins0UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::sins0UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::sins0UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::sins0UseMTricorderOnCrewman },
+
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::sins0UseCommunicator },
+ { {ACTION_WALK, HOTSPOT_DOOR, 0, 0}, &Room::sins0WalkToDoor },
+ { {ACTION_WALK, OBJECT_DOOR, 0, 0}, &Room::sins0WalkToDoor },
+};
+
+
+extern const int sins0NumActions = sizeof(sins0ActionList) / sizeof(RoomAction);
+
+
+void Room::sins0Tick1() {
+ playVoc("SIN0LOOP");
+
+ if (!_vm->_awayMission.sins.enteredRoom0FirstTime)
+ _vm->_awayMission.disableInput = 2;
+
+ if (_vm->_awayMission.sins.field3e)
+ loadActorAnim2(OBJECT_DOOR, "s0dr2", 0, 0);
+ if (_vm->_awayMission.sins.field3d)
+ loadActorAnim2(OBJECT_DOOR, "s0dr1", 0, 0);
+
+ playMidiMusicTracks(MIDITRACK_27, -3);
+}
+
+void Room::sins0LookAnywhere() {
+ showText(TX_SIN0N009);
+}
+
+void Room::sins0LookAtOpenDoor() {
+ showText(TX_SIN0N005);
+}
+
+void Room::sins0LookAtClosedDoor() {
+ showText(TX_SIN0N008);
+}
+
+void Room::sins0TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN0_009);
+}
+
+void Room::sins0TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN0_011);
+}
+
+void Room::sins0TalkToRedshirt() {
+ // ENHANCEMENT: This function had two implementations. The first (the originally used
+ // one) is a generic "area is secure" text. In the second (which was unused), he
+ // comments on how the small moon could have an atmosphere. This is more interesting
+ // and relevant, so that implementation is used instead.
+ if (false)
+ showText(TX_SPEAKER_MOSHER, TX_SIN0_024);
+ else {
+ showText(TX_SPEAKER_MOSHER, TX_SIN0_026);
+ showText(TX_SPEAKER_SPOCK, TX_SIN0_022);
+ showText(TX_SPEAKER_KIRK, TX_SIN0_006);
+ }
+}
+
+void Room::sins0LookAtGround() {
+ showText(TX_SIN0N006);
+}
+
+void Room::sins0GetRock() {
+ _vm->_awayMission.disableInput = true;
+ loadActorAnimC(OBJECT_KIRK, "kpickw", -1, -1, &Room::sins0PickedUpRock);
+ _vm->_awayMission.sins.field39 |= 1;
+}
+
+void Room::sins0PickedUpRock() {
+ _vm->_awayMission.disableInput = false;
+ loadActorStandAnim(OBJECT_KIRK);
+ showText(TX_SIN0N010);
+ giveItem(OBJECT_IS8ROCKS);
+}
+
+void Room::sins0UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_SIN0_018);
+}
+
+void Room::sins0UseSTricorderOnGround() {
+ spockScan(DIR_S, TX_SIN0_017);
+ _vm->_awayMission.sins.field39 |= 1;
+}
+
+void Room::sins0UseSTricorderOnPlanet() {
+ spockScan(DIR_S, TX_SIN0_016);
+}
+
+void Room::sins0Tick40() {
+ if (!_vm->_awayMission.sins.enteredRoom0FirstTime) {
+ _vm->_awayMission.disableInput = false;
+ showText(TX_SPEAKER_UHURA, TX_SIN0U082);
+ showText(TX_SPEAKER_KIRK, TX_SIN0_003);
+ showText(TX_SPEAKER_SCOTT, TX_SIN0_S48);
+ showText(TX_SPEAKER_KIRK, TX_SIN0_007);
+ showText(TX_SPEAKER_SCOTT, TX_SIN0_S50);
+ showText(TX_SPEAKER_KIRK, TX_SIN0_005);
+ showText(TX_SPEAKER_SCOTT, TX_SIN0_S49);
+ showText(TX_SPEAKER_KIRK, TX_SIN0_001);
+ _vm->_awayMission.sins.enteredRoom0FirstTime = true;
+ }
+}
+
+void Room::sins0LookAtStatue() {
+ showText(TX_SIN0N011);
+ showText(TX_SPEAKER_MCCOY, TX_SIN0_015);
+ showText(TX_SPEAKER_SPOCK, TX_SIN0_021);
+ showText(TX_SPEAKER_MOSHER, TX_SIN0_027);
+ showText(TX_SPEAKER_MCCOY, TX_SIN0_014);
+}
+
+void Room::sins0LookAtPlanet() {
+ showText(TX_SIN0N007);
+}
+
+void Room::sins0LookAtSky() {
+ // This seems unused, due to HOTSPOT_SKY not being mapped anywhere?
+ showText(TX_SIN0N004);
+}
+
+void Room::sins0LookAtKirk() {
+ showText(TX_SIN0N002);
+}
+
+void Room::sins0LookAtSpock() {
+ showText(TX_SIN0N003);
+}
+
+void Room::sins0LookAtMccoy() {
+ showText(TX_SIN0N000);
+}
+
+void Room::sins0LookAtRedshirt() {
+ showText(TX_SIN0N001);
+}
+
+void Room::sins0UseSTricorderOnClosedDoor() {
+ spockScan(DIR_S, TX_SIN0_019);
+ showText(TX_SPEAKER_MOSHER, TX_SIN0_025);
+ showText(TX_SPEAKER_MCCOY, TX_SIN0_013);
+ showText(TX_SPEAKER_MOSHER, TX_SIN0_028);
+}
+
+void Room::sins0UseSTricorderOnStatue() {
+ spockScan(DIR_S, TX_SIN0_020);
+ showText(TX_SPEAKER_KIRK, TX_SIN0_008);
+ showText(TX_SPEAKER_SPOCK, TX_SIN0_023);
+
+ if (!_vm->_awayMission.sins.gotPointsForScanningStatue) {
+ _vm->_awayMission.sins.gotPointsForScanningStatue = true;
+ _vm->_awayMission.sins.missionScore += 1;
+ }
+}
+
+void Room::sins0UseMedkitOnCrewman() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN0_012);
+}
+
+void Room::sins0UseMTricorderOnCrewman() {
+ mccoyScan(DIR_S, TX_SIN0_010);
+}
+
+void Room::sins0UseCommunicator() {
+ if (!_vm->_awayMission.sins.field43) {
+ showText(TX_SPEAKER_KIRK, TX_SIN0_004);
+ showText(TX_SPEAKER_SCOTT, TX_SIN0_S01);
+ showText(TX_SPEAKER_KIRK, TX_SIN0_002);
+ } else
+ showText(TX_SPEAKER_UHURA, TX_SIN0U069);
+}
+
+void Room::sins0WalkToDoor() {
+ walkCrewman(OBJECT_KIRK, 0x5f, 0x8c);
+}
+
+}
diff --git a/engines/startrek/rooms/sins1.cpp b/engines/startrek/rooms/sins1.cpp
new file mode 100644
index 0000000..fc7827a
--- /dev/null
+++ b/engines/startrek/rooms/sins1.cpp
@@ -0,0 +1,41 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_8 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+extern const RoomAction sins1ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::sins1Tick1 },
+};
+
+extern const int sins1NumActions = sizeof(sins1ActionList) / sizeof(RoomAction);
+
+
+void Room::sins1Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/sins2.cpp b/engines/startrek/rooms/sins2.cpp
new file mode 100644
index 0000000..976814a
--- /dev/null
+++ b/engines/startrek/rooms/sins2.cpp
@@ -0,0 +1,41 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_8 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+extern const RoomAction sins2ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::sins2Tick1 },
+};
+
+extern const int sins2NumActions = sizeof(sins2ActionList) / sizeof(RoomAction);
+
+
+void Room::sins2Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/sins3.cpp b/engines/startrek/rooms/sins3.cpp
new file mode 100644
index 0000000..81795e4
--- /dev/null
+++ b/engines/startrek/rooms/sins3.cpp
@@ -0,0 +1,41 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_8 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+extern const RoomAction sins3ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::sins3Tick1 },
+};
+
+extern const int sins3NumActions = sizeof(sins3ActionList) / sizeof(RoomAction);
+
+
+void Room::sins3Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/sins4.cpp b/engines/startrek/rooms/sins4.cpp
new file mode 100644
index 0000000..05c5820
--- /dev/null
+++ b/engines/startrek/rooms/sins4.cpp
@@ -0,0 +1,41 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_8 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+extern const RoomAction sins4ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::sins4Tick1 },
+};
+
+extern const int sins4NumActions = sizeof(sins4ActionList) / sizeof(RoomAction);
+
+
+void Room::sins4Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/sins5.cpp b/engines/startrek/rooms/sins5.cpp
new file mode 100644
index 0000000..49f9784
--- /dev/null
+++ b/engines/startrek/rooms/sins5.cpp
@@ -0,0 +1,41 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_8 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+extern const RoomAction sins5ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::sins5Tick1 },
+};
+
+extern const int sins5NumActions = sizeof(sins5ActionList) / sizeof(RoomAction);
+
+
+void Room::sins5Tick1() {
+}
+
+}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 9623ccc..f5835d2 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -90,7 +90,7 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_missionToLoad = "DEMON";
_roomIndexToLoad = 0;
- _showSubtitles = true; // TODO: test
+ _showSubtitles = true;
Common::fill(_r3List, _r3List + NUM_SPACE_OBJECTS, (R3 *)nullptr);
Common::fill(_orderedR3List, _orderedR3List + NUM_SPACE_OBJECTS, (R3 *)nullptr);
@@ -901,10 +901,6 @@ void StarTrekEngine::renderBanAboveSprites() {
byte *src = (byte *)surface.getPixels() + offset;
byte *dest = destPixels + offset;
- /*
- _banFiles[i]->seek(_banFileOffsets[i], SEEK_SET);
- renderBan(destPixels, _banFiles[i]);
- */
// This is similar to renderBan(), except it copies pixels from the surface
// above instead of drawing directly to it. (Important since sprites may be
// drawn on top.)
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index e0a0401..a7e398f 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -120,6 +120,8 @@ enum GameStringIDs {
TX_SPEAKER_LIGHT_OF_KNOWLEDGE,
TX_SPEAKER_LIGHT_OF_TRAVEL,
+ TX_SPEAKER_MOSHER,
+
TX_BRIDU146,
TX_G_024,
@@ -2429,6 +2431,55 @@ enum GameStringIDs {
TX_TRI5N021,
+ TX_SIN0_001,
+ TX_SIN0_002,
+ TX_SIN0_003,
+ TX_SIN0_004,
+ TX_SIN0_005,
+ TX_SIN0_006,
+ TX_SIN0_007,
+ TX_SIN0_008,
+ TX_SIN0_009,
+ TX_SIN0_010,
+ TX_SIN0_011,
+ TX_SIN0_012,
+ TX_SIN0_013,
+ TX_SIN0_014,
+ TX_SIN0_015,
+ TX_SIN0_016,
+ TX_SIN0_017,
+ TX_SIN0_018,
+ TX_SIN0_019,
+ TX_SIN0_020,
+ TX_SIN0_021,
+ TX_SIN0_022,
+ TX_SIN0_023,
+ TX_SIN0_024,
+ TX_SIN0_025,
+ TX_SIN0_026,
+ TX_SIN0_027,
+ TX_SIN0_028,
+ // UNUSED: 029 -> 030
+ TX_SIN0_S01,
+ TX_SIN0_S48,
+ TX_SIN0_S49,
+ TX_SIN0_S50,
+ TX_SIN0N000,
+ TX_SIN0N001,
+ TX_SIN0N002,
+ TX_SIN0N003,
+ TX_SIN0N004,
+ TX_SIN0N005,
+ TX_SIN0N006,
+ TX_SIN0N007,
+ TX_SIN0N008,
+ TX_SIN0N009,
+ TX_SIN0N010,
+ TX_SIN0N011,
+ TX_SIN0U069,
+ TX_SIN0U082,
+
+
TX_SIN3_012,
@@ -2498,6 +2549,8 @@ const char *const g_gameStrings[] = {
"Light of Knowledge",
"Light of Travel",
+ "Ensign Mosher",
+
"#BRID\\BRIDU146#Nothing to report, Captain.",
"#GENE\\G_024#Fascinating.",
@@ -4770,6 +4823,54 @@ const char *const g_gameStrings[] = {
"#TRI5\\TRI5N021#This large gem appears to be an emerald of unusual size. This is obviously artificial.", // TYPO
+ "#SIN0\\SIN0_001#Good Mr. Scott. I'll keep you posted. Kirk out.",
+ "#SIN0\\SIN0_002#Let me know if things change. Kirk out.",
+ "#SIN0\\SIN0_003#Mr. Scott?",
+ "#SIN0\\SIN0_004#Scotty, report on the transporter problem.",
+ "#SIN0\\SIN0_005#That will still give us plenty of time, Scotty.",
+ "#SIN0\\SIN0_006#That's what we're here to find out. The unknown.",
+ "#SIN0\\SIN0_007#We didn't notice anything beaming down.",
+ "#SIN0\\SIN0_008#Which means that this moon might still be inhabited, Mr. Spock.",
+ "#SIN0\\SIN0_009#Aside from the security door on what should be a lifeless planetoid, this place is unremarkable.",
+ "#SIN0\\SIN0_010#It's what I was afraid of, Jim. The thin atmosphere of this moon doesn't provide enough protection from cosmic rays. We shouldn't stay here any more than a few hours.",
+ "#SIN0\\SIN0_011#The atmosphere is breathable, Jim, but hardly nourishing. We should either get inside or go back to the ship.",
+ "#SIN0\\SIN0_012#There's not much I can do for cosmic radiation. It's best if we find some cover indoors.",
+ "#SIN0\\SIN0_013#Do you have Vulcan blood ensign?",
+ "#SIN0\\SIN0_014#I never realized the Orions ever got past decadence... They hadn't the last time I was there.",
+ "#SIN0\\SIN0_015#These stones resemble those on Earth, on Easter Island.",
+ "#SIN0\\SIN0_016#I cannot get readings from this range, Captain. But if we do not hurry there will be nothing left to get a reading on.",
+ "#SIN0\\SIN0_017#The rocks have a high quantity of Tri-Phosphorate Silver in them.",
+ "#SIN0\\SIN0_018#Unremarkable except for low grade power emanations from the door area.",
+ "#SIN0\\SIN0_019#As expected Captain. The source of power emanations lies beyond that door.",
+ "#SIN0\\SIN0_020#Large quantities of atmosphere are being circulated through these rocks. I would guess there are storage units within this satellite which are constantly replacing the atmosphere that is lost because of this moon's weak gravity.",
+ "#SIN0\\SIN0_021#Stone monoliths of faces are a common artistic expression in evolving cultures...",
+ "#SIN0\\SIN0_022#Unknown, ensign.",
+ "#SIN0\\SIN0_023#We have detected no signs of life, Captain, but the possibility does exist.",
+ "#SIN0\\SIN0_024#Area secure, Captain.",
+ "#SIN0\\SIN0_025#A power source that has lasted millenia and endured major catastrophes. That's fascinating, Mr. Spock.",
+ "#SIN0\\SIN0_026#How can there be an atmosphere on a moon of this size?",
+ "#SIN0\\SIN0_027#Like the faces on Vandu II. Even the animal face art of the Orion Post-Decadence Movement is similar.",
+ "#SIN0\\SIN0_028#No, sir.",
+ "#SIN0\\SIN0_S01#No change Captain. Although why it happened is about as clear as a foggy night in Glasgow.",
+ "#SIN0\\SIN0_S48#Aye. We've had some slight problems with the transporters.",
+ "#SIN0\\SIN0_S49#I know. I have the lads in Engineering doing a complete overhaul of the ship's systems.",
+ "#SIN0\\SIN0_S50#Just a glitch in the main transporter program. Mr. Kyle is loading a back-up, and we're performing tests. The transporters will be down for about an hour.",
+ "#SIN0\\SIN0N000#Dr. Leonard McCoy, knowing that they aren't likely to encounter any medical problems, is rather annoyed about being dragged yet again into the transporter.",
+ "#SIN0\\SIN0N001#Ensign Mosher seems to be rather curious about the planet's technology.",
+ "#SIN0\\SIN0N002#James T. Kirk, worried about the safety of the people of Proxtrey.",
+ "#SIN0\\SIN0N003#Mr. Spock looks forward to examining the technology of this ancient culture.",
+ "#SIN0\\SIN0N004#Ten thousand points of light are visible to the naked eye through the thin atmosphere of this moon.",
+ "#SIN0\\SIN0N005#The heavy-duty security door is now open.",
+ "#SIN0\\SIN0N006#There are many rocks here.",
+ "#SIN0\\SIN0N007#This is the planet Proxtrey, currently six hundred thousand kilometers from this moon.",
+ "#SIN0\\SIN0N008#This looks like a heavy-duty security door built into the side of a hill on this moon.",
+ "#SIN0\\SIN0N009#This moon has a thin but breathable atmosphere.",
+ "#SIN0\\SIN0N010#You retrieve a rock.",
+ "#SIN0\\SIN0N011#These stones look like faces.",
+ "#SIN0\\SIN0U069#Nothing new to report Captain.",
+ "#SIN0\\SIN0U082#Captain, Mr. Scott wishes to speak with you.",
+
+
"#SIN3\\SIN3_012#Can't say I like the decor.",
Commit: ae6c86bc7a9c1d493208227dfa744b866cda10da
https://github.com/scummvm/scummvm/commit/ae6c86bc7a9c1d493208227dfa744b866cda10da
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement save loading from launcher
Changed paths:
engines/startrek/saveload.cpp
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/saveload.cpp b/engines/startrek/saveload.cpp
index f42d2f1..bb24587 100644
--- a/engines/startrek/saveload.cpp
+++ b/engines/startrek/saveload.cpp
@@ -184,14 +184,15 @@ bool StarTrekEngine::saveOrLoadGameData(Common::SeekableReadStream *in, Common::
ser.syncAsUint16LE(_gameMode);
// TODO: sub_1d8eb (save) / sub_1d958 (load) (probably bridge / space combat state)
- ser.syncString(_sound->_loadedMidiFilename);
+ Common::String midiFilename = _sound->_loadedMidiFilename;
+ ser.syncString(midiFilename);
ser.syncAsSint16LE(_sound->_loopingMidiTrack);
if (ser.isLoading()) {
- if (_sound->_loadedMidiFilename.empty())
+ if (midiFilename.empty())
_sound->clearAllMidiSlots();
else {
- _sound->loadMusicFile(_sound->_loadedMidiFilename);
+ _sound->loadMusicFile(midiFilename);
_sound->playMidiMusicTracks(_sound->_loopingMidiTrack, _sound->_loopingMidiTrack);
}
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index f5835d2..2086b36 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -119,27 +119,46 @@ Common::Error StarTrekEngine::run() {
initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT, &format);
initializeEventsAndMouse();
- _frameIndex = 0;
- playIntro();
- debug("DONE");
+ bool shouldPlayIntro = false;
+ bool loadedSave = false;
+
+ if (ConfMan.hasKey("save_slot")) {
+ if (!loadGame(ConfMan.getInt("save_slot")))
+ error("Failed to load savegame %d", ConfMan.getInt("save_slot"));
+ shouldPlayIntro = false;
+ loadedSave = true;
+ _roomIndexToLoad = -1;
+ }
+
+ if (!loadedSave) {
+ if (shouldPlayIntro) {
+ _frameIndex = 0;
+ playIntro();
+ }
- _frameIndex = 0;
+ _frameIndex = 0;
- _gameMode = -1;
- _lastGameMode = -1;
+ _gameMode = -1;
+ _lastGameMode = -1;
+ }
- runGameMode(GAMEMODE_AWAYMISSION);
+ if (loadedSave)
+ runGameMode(_gameMode, true);
+ else
+ runGameMode(GAMEMODE_AWAYMISSION, false);
return Common::kNoError;
}
-Common::Error StarTrekEngine::runGameMode(int mode) {
- _gameMode = mode;
+Common::Error StarTrekEngine::runGameMode(int mode, bool resume) {
+ if (!resume) { // Only run this if not just resuming from a savefile
+ _gameMode = mode;
- _sound->stopAllVocSounds();
+ _sound->stopAllVocSounds();
- _resetGameMode = true;
- if (_gameMode == GAMEMODE_START)
- _gameMode = GAMEMODE_BRIDGE;
+ _resetGameMode = true;
+ if (_gameMode == GAMEMODE_START)
+ _gameMode = GAMEMODE_BRIDGE;
+ }
while (true) {
if (_resetGameMode) {
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 6f98db2..ef2ddf1 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -234,7 +234,7 @@ public:
Angle atan2(int32 deltaX, int32 deltaZ);
// Game modes
- Common::Error runGameMode(int mode);
+ Common::Error runGameMode(int mode, bool resume);
// Away missions
void initAwayMission();
Commit: b2213cac9b2766b62e29368394837fbe261233d3
https://github.com/scummvm/scummvm/commit/b2213cac9b2766b62e29368394837fbe261233d3
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: SINS1
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/sins0.cpp
engines/startrek/rooms/sins1.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 8f3e83b..e1ecc1f 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -520,12 +520,18 @@ struct AwayMission {
} trial;
struct {
+ byte field31; // 0x31
+ byte field32; // 0x32
+ bool field33; // 0x33
+ bool doorLaserFiredOnce; // 0x34
byte field39; // 0x39
- bool field3d; // 0x3d
+ bool openedDoor; // 0x3d
bool field3e; // 0x3e
bool enteredRoom0FirstTime; // 0x42
- bool field43; // 0x43
+ bool scottyInformedKirkAboutVirus; // 0x43
+ bool field44; // 0x44
bool gotPointsForScanningStatue; // 0x48
+ bool enteredRoom1FirstTime; // 0x50
int16 missionScore; // 0x52
} sins;
};
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index bc2015f..b5149b5 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -475,6 +475,11 @@ void Room::showGameOverMenu() { // TODO: takes an optional parameter?
// TODO: finish. Shouldn't do this within a room due to deletion of current room?
}
+int Room::showKeypad(const Common::String &code) {
+ // TODO
+ return 3;
+}
+
void Room::playVoc(Common::String filename) {
_vm->_sound->playVoc(filename);
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index bcccf8f..bb1c8f1 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -236,6 +236,10 @@ private:
*/
void showGameOverMenu();
/**
+ * Cmd 0x13: Keypad used in "Than Old Devil Moon" (SINS mission)
+ */
+ int showKeypad(const Common::String &code);
+ /**
* Cmd 0x15
*/
void playVoc(Common::String filename);
@@ -2176,6 +2180,43 @@ public:
// SINS1
void sins1Tick1();
+ void sins1LookAnywhere();
+ void sins1LookAtLock();
+ void sins1LookAtDoor();
+ void sins1LookAtPanel();
+ void sins1LookAtKeypad();
+ void sins1UseSTricorderOnPanel();
+ void sins1UseSTricorderOnKeypad();
+ void sins1UseSTricorderOnLock();
+ void sins1UseSTricorderOnDoor();
+ void sins1UseSTricorderAnywhere();
+ void sins1UseSTricorderOnLens();
+ void sins1UseRockOnDoor();
+ void sins1UseRedshirtOnKeypad();
+ void sins1UseMccoyOnKeypad();
+ void sins1UseKirkOnKeypad();
+ void sins1UseSpockOnKeypad();
+ void sins1SpockReachedKeypad();
+ void sins1EnteredCorrectCode();
+ void sins1DoorDoneOpening();
+ void sins1EnteredIncorrectCode();
+ void sins1EnteredSacredSofNumber();
+ void sins1UsePhaserOnDoor();
+ void sins1DoorUsedLaser();
+ void sins1Tick40();
+ void sins1TalkToKirk();
+ void sins1TalkToSpock();
+ void sins1TalkToMccoy();
+ void sins1TalkToRedshirt();
+ void sins1LookAtKirk();
+ void sins1LookAtSpock();
+ void sins1LookAtMccoy();
+ void sins1LookAtRedshirt();
+ void sins1LookAtLens();
+ void sins1UseCommunicator();
+ void sins1UseMedkitOnCrewman();
+ void sins1UseMTricorderOnCrewman();
+ void sins1WalkToDoor();
// SINS2
void sins2Tick1();
diff --git a/engines/startrek/rooms/sins0.cpp b/engines/startrek/rooms/sins0.cpp
index bd93f25..8dfabdc 100644
--- a/engines/startrek/rooms/sins0.cpp
+++ b/engines/startrek/rooms/sins0.cpp
@@ -86,7 +86,7 @@ void Room::sins0Tick1() {
if (_vm->_awayMission.sins.field3e)
loadActorAnim2(OBJECT_DOOR, "s0dr2", 0, 0);
- if (_vm->_awayMission.sins.field3d)
+ if (_vm->_awayMission.sins.openedDoor)
loadActorAnim2(OBJECT_DOOR, "s0dr1", 0, 0);
playMidiMusicTracks(MIDITRACK_27, -3);
@@ -231,7 +231,7 @@ void Room::sins0UseMTricorderOnCrewman() {
}
void Room::sins0UseCommunicator() {
- if (!_vm->_awayMission.sins.field43) {
+ if (!_vm->_awayMission.sins.scottyInformedKirkAboutVirus) {
showText(TX_SPEAKER_KIRK, TX_SIN0_004);
showText(TX_SPEAKER_SCOTT, TX_SIN0_S01);
showText(TX_SPEAKER_KIRK, TX_SIN0_002);
diff --git a/engines/startrek/rooms/sins1.cpp b/engines/startrek/rooms/sins1.cpp
index fc7827a..8d94b4a 100644
--- a/engines/startrek/rooms/sins1.cpp
+++ b/engines/startrek/rooms/sins1.cpp
@@ -22,20 +22,316 @@
#include "startrek/room.h"
-#define OBJECT_8 8
+#define OBJECT_DOOR 8
+#define OBJECT_9 9
-#define HOTSPOT_20 0x20
+#define HOTSPOT_DOOR 0x20
+#define HOTSPOT_KEYPAD 0x21
+#define HOTSPOT_PANEL 0x22
+#define HOTSPOT_LENS 0x23
+#define HOTSPOT_24 0x24 // Unused hotspot; just a sliver on the right side of the door?
namespace StarTrek {
extern const RoomAction sins1ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::sins1Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::sins1Tick1 },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::sins1LookAnywhere },
+ { {ACTION_LOOK, OBJECT_DOOR, 0, 0}, &Room::sins1LookAtLock },
+ { {ACTION_LOOK, HOTSPOT_DOOR, 0, 0}, &Room::sins1LookAtDoor },
+ { {ACTION_LOOK, HOTSPOT_PANEL, 0, 0}, &Room::sins1LookAtPanel },
+ { {ACTION_LOOK, HOTSPOT_KEYPAD, 0, 0}, &Room::sins1LookAtKeypad },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_PANEL, 0}, &Room::sins1UseSTricorderOnPanel },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_KEYPAD, 0}, &Room::sins1UseSTricorderOnKeypad },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_DOOR, 0}, &Room::sins1UseSTricorderOnLock },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_DOOR, 0}, &Room::sins1UseSTricorderOnDoor },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::sins1UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_LENS, 0}, &Room::sins1UseSTricorderOnLens },
+ { {ACTION_USE, OBJECT_IS8ROCKS, HOTSPOT_DOOR, 0}, &Room::sins1UseRockOnDoor },
+
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_KEYPAD, 0}, &Room::sins1UseRedshirtOnKeypad },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_KEYPAD, 0}, &Room::sins1UseMccoyOnKeypad },
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_KEYPAD, 0}, &Room::sins1UseKirkOnKeypad },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_KEYPAD, 0}, &Room::sins1UseSpockOnKeypad },
+ { {ACTION_DONE_WALK, 6, 0, 0}, &Room::sins1SpockReachedKeypad },
+ { {ACTION_DONE_ANIM, 8, 0, 0}, &Room::sins1EnteredCorrectCode },
+ { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::sins1DoorDoneOpening },
+ { {ACTION_DONE_ANIM, 7, 0, 0}, &Room::sins1EnteredIncorrectCode },
+ { {ACTION_DONE_ANIM, 9, 0, 0}, &Room::sins1EnteredSacredSofNumber },
+ { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_DOOR, 0}, &Room::sins1UsePhaserOnDoor },
+ { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_DOOR, 0}, &Room::sins1UsePhaserOnDoor },
+ { {ACTION_DONE_ANIM, 2, 0, 0}, &Room::sins1DoorUsedLaser },
+
+ { {ACTION_TICK, 40, 0, 0}, &Room::sins1Tick40 },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::sins1TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::sins1TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::sins1TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::sins1TalkToRedshirt },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::sins1LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::sins1LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::sins1LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::sins1LookAtRedshirt },
+ { {ACTION_LOOK, HOTSPOT_LENS, 0, 0}, &Room::sins1LookAtLens },
+
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::sins1UseCommunicator },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_KIRK, 0}, &Room::sins1UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0}, &Room::sins1UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_MCCOY, 0}, &Room::sins1UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_REDSHIRT, 0}, &Room::sins1UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::sins1UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::sins1UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::sins1UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::sins1UseMTricorderOnCrewman },
+
+ { {ACTION_WALK, HOTSPOT_DOOR, 0, 0}, &Room::sins1WalkToDoor },
+ { {ACTION_WALK, OBJECT_DOOR, 0, 0}, &Room::sins1WalkToDoor },
};
extern const int sins1NumActions = sizeof(sins1ActionList) / sizeof(RoomAction);
void Room::sins1Tick1() {
+ playVoc("SIN1LOOP");
+
+ if (!_vm->_awayMission.sins.scottyInformedKirkAboutVirus)
+ // BUGFIX: Set this to 2, not 1 (disable input even after walking animation is done)
+ _vm->_awayMission.disableInput = 2;
+
+ if (_vm->_awayMission.sins.openedDoor) {
+ loadActorAnim2(OBJECT_DOOR, "s1dro", 0, 0);
+ loadMapFile("sins12");
+ } else
+ loadMapFile("sins1");
+
+ if (_vm->_awayMission.sins.field3e)
+ loadActorAnim2(OBJECT_DOOR, "s1ndro", 0, 0);
+
+ _vm->_awayMission.sins.field32 = 1;
+ _vm->_awayMission.sins.field31 = 1;
+
+ playMidiMusicTracks(MIDITRACK_27, -3);
+
+ if (!_vm->_awayMission.sins.enteredRoom1FirstTime) {
+ playMidiMusicTracks(MIDITRACK_1, -2);
+ _vm->_awayMission.sins.enteredRoom1FirstTime = true;
+ }
+}
+
+void Room::sins1LookAnywhere() {
+ showText(TX_SIN1N001);
+}
+
+void Room::sins1LookAtLock() {
+ showText(TX_SIN1N009);
+}
+
+void Room::sins1LookAtDoor() {
+ // NOTE: This function had two implementations (one unused).
+ if (true)
+ showText(TX_SIN1N010);
+ else
+ showText(TX_SIN1N008);
+}
+
+void Room::sins1LookAtPanel() {
+ showText(TX_SIN1N003);
+}
+
+void Room::sins1LookAtKeypad() {
+ showText(TX_SIN1N011);
+}
+
+void Room::sins1UseSTricorderOnPanel() {
+ spockScan(DIR_N, TX_SIN1_010);
+}
+
+void Room::sins1UseSTricorderOnKeypad() {
+ spockScan(DIR_N, TX_SIN1_021);
+}
+
+void Room::sins1UseSTricorderOnLock() {
+ spockScan(DIR_N, TX_SIN1_009);
+}
+
+void Room::sins1UseSTricorderOnDoor() {
+ if (!_vm->_awayMission.sins.openedDoor)
+ spockScan(DIR_N, TX_SIN1_019);
+}
+
+void Room::sins1UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_SIN1_024);
+}
+
+void Room::sins1UseSTricorderOnLens() {
+ if (!_vm->_awayMission.sins.doorLaserFiredOnce)
+ spockScan(DIR_N, TX_SIN1_022);
+ else // BUGFIX: Original didn't do the tricorder animation, etc. in this case
+ spockScan(DIR_N, TX_SIN1_023);
+}
+
+void Room::sins1UseRockOnDoor() {
+ showText(TX_SIN1N007);
+}
+
+void Room::sins1UseRedshirtOnKeypad() {
+ if (!_vm->_awayMission.sins.openedDoor)
+ showText(TX_SPEAKER_MOSHER, TX_SIN1_028);
+}
+
+void Room::sins1UseMccoyOnKeypad() {
+ if (!_vm->_awayMission.sins.openedDoor)
+ showText(TX_SPEAKER_MCCOY, TX_SIN1_012);
+}
+
+void Room::sins1UseKirkOnKeypad() {
+ if (!_vm->_awayMission.sins.openedDoor) {
+ showText(TX_SPEAKER_KIRK, TX_SIN1_001);
+ sins1UseSpockOnKeypad();
+ }
+}
+
+void Room::sins1UseSpockOnKeypad() {
+ if (!_vm->_awayMission.sins.openedDoor) {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ walkCrewmanC(OBJECT_SPOCK, 0xfd, 0xad, &Room::sins1SpockReachedKeypad);
+ }
+}
+
+void Room::sins1SpockReachedKeypad() {
+ int ans = showKeypad("01210");
+
+ if (ans == 1 || ans == 2) {
+ playVoc("EFX14S");
+ loadActorAnimC(OBJECT_SPOCK, "susehn", -1, -1, &Room::sins1EnteredSacredSofNumber);
+ } else if (ans == 3) {
+ playVoc("EFX14S");
+ loadActorAnimC(OBJECT_SPOCK, "susehn", -1, -1, &Room::sins1EnteredCorrectCode);
+ } else {
+ playVoc("EFX14S");
+ loadActorAnimC(OBJECT_SPOCK, "susehn", -1, -1, &Room::sins1EnteredIncorrectCode);
+ }
+}
+
+void Room::sins1EnteredCorrectCode() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ walkCrewman(OBJECT_SPOCK, 0xf3, 0xad);
+ _vm->_awayMission.sins.openedDoor = true;
+ loadMapFile("sins12");
+ loadActorAnimC(OBJECT_DOOR, "s1door", 0, 0, &Room::sins1DoorDoneOpening);
+ playVoc("HUGEDOO2");
+}
+
+void Room::sins1DoorDoneOpening() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN1_011);
+}
+
+void Room::sins1EnteredIncorrectCode() {
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ walkCrewman(OBJECT_SPOCK, 0xf3, 0xad);
+ showText(TX_SPEAKER_SPOCK, TX_SIN1_017);
+}
+
+void Room::sins1EnteredSacredSofNumber() {
+ // Entered a sacred Sof number, which is wrong since this is a Lucr base
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ walkCrewman(OBJECT_SPOCK, 0xf3, 0xad);
+ loadActorAnimC(OBJECT_9, "s1ph1", 0, 0, &Room::sins1DoorUsedLaser);
+ playSoundEffectIndex(SND_PHASSHOT);
+}
+
+void Room::sins1UsePhaserOnDoor() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN1_016);
+}
+
+void Room::sins1DoorUsedLaser() {
+ loadActorStandAnim(OBJECT_9);
+ showText(TX_SPEAKER_SPOCK, TX_SIN1_018);
+
+ _vm->_awayMission.sins.field33 = true;
+ _vm->_awayMission.sins.doorLaserFiredOnce = true;
+}
+
+void Room::sins1Tick40() {
+ if (!_vm->_awayMission.sins.scottyInformedKirkAboutVirus) {
+ showText(TX_SPEAKER_SCOTT, TX_SIN1_S10);
+ showText(TX_SPEAKER_KIRK, TX_SIN1_007);
+ showText(TX_SPEAKER_SCOTT, TX_SIN1_S18);
+ showText(TX_SPEAKER_KIRK, TX_SIN1_005);
+ showText(TX_SPEAKER_SCOTT, TX_SIN1_S85);
+ showText(TX_SPEAKER_KIRK, TX_SIN1_003);
+ showText(TX_SPEAKER_SCOTT, TX_SIN1_S17);
+
+ _vm->_awayMission.sins.scottyInformedKirkAboutVirus = true;
+ _vm->_awayMission.disableInput = false;
+ }
+}
+
+void Room::sins1TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_SIN1_006);
+ showText(TX_SPEAKER_SPOCK, TX_SIN1_027);
+}
+
+void Room::sins1TalkToSpock() {
+ // NOTE: This function has two implementations. The first (used) one talks about where
+ // the energy source is coming from. The second (unused) one says to "carefully
+ // consider what we know about this culture".
+ if (true)
+ showText(TX_SPEAKER_SPOCK, TX_SIN1_020);
+ else
+ showText(TX_SPEAKER_SPOCK, TX_SIN1_025);
+}
+
+void Room::sins1TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN1_015);
+}
+
+void Room::sins1TalkToRedshirt() {
+ showText(TX_SPEAKER_MOSHER, TX_SIN1_030);
+ showText(TX_SPEAKER_SPOCK, TX_SIN1_026);
+ showText(TX_SPEAKER_MOSHER, TX_SIN1_029);
+}
+
+void Room::sins1LookAtKirk() {
+ showText(TX_SIN1N005);
+}
+
+void Room::sins1LookAtSpock() {
+ showText(TX_SIN1N004);
+}
+
+void Room::sins1LookAtMccoy() {
+ showText(TX_SIN1N006);
+}
+
+void Room::sins1LookAtRedshirt() {
+ showText(TX_SIN1N002);
+}
+
+void Room::sins1LookAtLens() {
+ showText(TX_SIN1N000);
+}
+
+void Room::sins1UseCommunicator() {
+ if (!_vm->_awayMission.sins.field44) {
+ showText(TX_SPEAKER_KIRK, TX_SIN1_008);
+ showText(TX_SPEAKER_SCOTT, TX_SIN1_S51);
+ showText(TX_SPEAKER_KIRK, TX_SIN1_002);
+ showText(TX_SPEAKER_SCOTT, TX_SIN1_S20);
+ showText(TX_SPEAKER_KIRK, TX_SIN1_004);
+ } else
+ showText(TX_SPEAKER_UHURA, TX_SIN1U070);
+}
+
+void Room::sins1UseMedkitOnCrewman() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN1_014);
+}
+
+void Room::sins1UseMTricorderOnCrewman() {
+ mccoyScan(DIR_S, TX_SIN1_013);
+}
+
+void Room::sins1WalkToDoor() {
+ if (_vm->_awayMission.sins.openedDoor)
+ walkCrewman(OBJECT_KIRK, 0x98, 0x9e, 5); // NOTE: Callback 5 not defined
}
}
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index a7e398f..03073ef 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -2480,6 +2480,58 @@ enum GameStringIDs {
TX_SIN0U082,
+ TX_SIN1_001,
+ TX_SIN1_002,
+ TX_SIN1_003,
+ TX_SIN1_004,
+ TX_SIN1_005,
+ TX_SIN1_006,
+ TX_SIN1_007,
+ TX_SIN1_008,
+ TX_SIN1_009,
+ TX_SIN1_010,
+ TX_SIN1_011,
+ TX_SIN1_012,
+ TX_SIN1_013,
+ TX_SIN1_014,
+ TX_SIN1_015,
+ TX_SIN1_016,
+ TX_SIN1_017,
+ TX_SIN1_018,
+ TX_SIN1_019,
+ TX_SIN1_020,
+ TX_SIN1_021,
+ TX_SIN1_022,
+ TX_SIN1_023,
+ TX_SIN1_024,
+ TX_SIN1_025,
+ TX_SIN1_026,
+ TX_SIN1_027,
+ TX_SIN1_028,
+ TX_SIN1_029,
+ TX_SIN1_030,
+ // UNUSED: 031
+ TX_SIN1_S10,
+ TX_SIN1_S17,
+ TX_SIN1_S18,
+ TX_SIN1_S20,
+ TX_SIN1_S51,
+ TX_SIN1_S85,
+ TX_SIN1N000,
+ TX_SIN1N001,
+ TX_SIN1N002,
+ TX_SIN1N003,
+ TX_SIN1N004,
+ TX_SIN1N005,
+ TX_SIN1N006,
+ TX_SIN1N007,
+ TX_SIN1N008,
+ TX_SIN1N009,
+ TX_SIN1N010,
+ TX_SIN1N011,
+ TX_SIN1U070,
+
+
TX_SIN3_012,
@@ -4871,6 +4923,57 @@ const char *const g_gameStrings[] = {
"#SIN0\\SIN0U082#Captain, Mr. Scott wishes to speak with you.",
+ "#SIN1\\SIN1_001#Spock, see what you can do with that lock.",
+ "#SIN1\\SIN1_002#Check her record, Mr. Scott. She was in the top ten percent of her class in computer systems analysis.",
+ "#SIN1\\SIN1_003#Isolate that virus. That's your number one priority.",
+ "#SIN1\\SIN1_004#Just do your best, Scotty. Kirk out.",
+ "#SIN1\\SIN1_005#There goes our back-up plan. Do what you can, Mr. Scott.",
+ "#SIN1\\SIN1_006#Well, we won't be able to phaser any outbound missiles.",
+ "#SIN1\\SIN1_007#What is it, Scotty?",
+ "#SIN1\\SIN1_008#Your situation, Mr. Scott?",
+ "#SIN1\\SIN1_009#A security lock, Captain.",
+ "#SIN1\\SIN1_010#A working display panel, Captain.",
+ "#SIN1\\SIN1_011#Ah, that worked. I see you deduced that 10200, in the Lucrs base three was equal to their sacred number 99.",
+ "#SIN1\\SIN1_012#Damn it, Jim. I'm a doctor, not a locksmith!",
+ "#SIN1\\SIN1_013#No appreciable cosmic radiation damage. Yet.",
+ "#SIN1\\SIN1_014#There's not much I can do for cosmic radiation. It's best if we find some cover indoors.",
+ "#SIN1\\SIN1_015#We should stay inside as much as possible. We must try to protect ourselves from the cosmic radiation.",
+ "#SIN1\\SIN1_016#It would be useless Captain. The door could easily withstand our phaser fire.",
+ "#SIN1\\SIN1_017#That did not seem to work, Captain. Perhaps we should try a number that had some significance to them. Remember they were very superstitious.",
+ "#SIN1\\SIN1_018#That prompted a response, Captain. 01210 is 100 in base four, a number the Sofs regarded as sacred.",
+ "#SIN1\\SIN1_019#The door still appears to be in operating condition.",
+ "#SIN1\\SIN1_020#The origin point for the broadcast Uhura monitored was approximately fifty meters beyond this door.",
+ "#SIN1\\SIN1_021#There is power running to the keypad.",
+ "#SIN1\\SIN1_022#This appears to be a dust-covered lens of some sort.",
+ "#SIN1\\SIN1_023#This is the focal lense for an anti-intruder laser.",
+ "#SIN1\\SIN1_024#Unremarkable.",
+ "#SIN1\\SIN1_025#We should carefully consider everything we know about this culture before taking action.",
+ "#SIN1\\SIN1_026#From what we know about the Lucrs, they had an affinity for size. Their machines weren't just equipment; they were also monuments.",
+ "#SIN1\\SIN1_027#It appears that our mission has increased in importance.",
+ "#SIN1\\SIN1_028#I'm just a security officer, Sir.",
+ "#SIN1\\SIN1_029#I can believe that.",
+ "#SIN1\\SIN1_030#This door is huge. If they were humanoid, they could have been giants...",
+ "#SIN1\\SIN1_S10#Captain, I'm afraid we've got a wee problem here.",
+ "#SIN1\\SIN1_S17#That it is, Captain. We'll keep you informed. Scott out.",
+ "#SIN1\\SIN1_S18#There is some sort of virus in the main computer. Our phasers and tractor beams have been disabled, and there's no way we're getting them back in three hours.",
+ "#SIN1\\SIN1_S20#We'll find that virus soon Captain, or I'm an Englishman.",
+ "#SIN1\\SIN1_S51#We're still looking for the virus, Captain. I even have Lieutenant Uhura looking through the computer system. I never realized the lass was so good with them.",
+ "#SIN1\\SIN1_S85#Aye, I will Captain. I may yet have a trick or two that I can pull, but don't count on any miracles.",
+ "#SIN1\\SIN1N000#A lens sits above the doorway, but is it mere decoration?",
+ "#SIN1\\SIN1N001#Built into the rock is a very large door.",
+ "#SIN1\\SIN1N002#Ensign Mosher is glad to be a member of this landing party, at least for now.",
+ "#SIN1\\SIN1N003#It looks like some sort of display panel.",
+ "#SIN1\\SIN1N004#It never ceases to amaze you how passive Spock can be, even in the presence of extraordinary wonders.",
+ "#SIN1\\SIN1N005#James T. Kirk, A man with a problem. A big problem that is getting bigger.",
+ "#SIN1\\SIN1N006#McCoy is examining himself for cosmic radiation sickness symptoms.",
+ "#SIN1\\SIN1N007#Meteorites have hit this door and left it undamaged. What are you going to do with a rock?",
+ "#SIN1\\SIN1N008#The doorway into the complex is huge.",
+ "#SIN1\\SIN1N009#This appears to be some sort of security lock.",
+ "#SIN1\\SIN1N010#This heavy-duty door has taken numerous micrometeorite strikes but still appears solid.",
+ "#SIN1\\SIN1N011#This is a keypad that looks functional.",
+ "#SIN1\\SIN1U070#Nothing new to report Captain.",
+
+
"#SIN3\\SIN3_012#Can't say I like the decor.",
Commit: f412328181baaac3ec6726de3bd9b914731cc551
https://github.com/scummvm/scummvm/commit/f412328181baaac3ec6726de3bd9b914731cc551
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement text input boxes
Needed for SINS mission with the keypads
Changed paths:
engines/startrek/font.cpp
engines/startrek/font.h
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/sins1.cpp
engines/startrek/sprite.cpp
engines/startrek/sprite.h
engines/startrek/startrek.h
engines/startrek/text.cpp
diff --git a/engines/startrek/font.cpp b/engines/startrek/font.cpp
index 7cba711..6cd3f1b 100644
--- a/engines/startrek/font.cpp
+++ b/engines/startrek/font.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/font.cpp $
- * $Id: font.cpp 2 2009-09-12 20:13:40Z clone2727 $
- *
*/
#include "startrek/font.h"
@@ -47,4 +44,38 @@ byte *Font::getCharData(int i) {
return _characters[i].data;
}
+bool Font::isDisplayableCharacter(char c) {
+ // True if lowercase, uppercase, a digit, punctuation, or space
+ return _fontProperties[c & 0xff] & 0x57;
+}
+
+
+// Bit 0 set for lowercase characters;
+// Bit 1 set for uppercase characters;
+// Bit 2 set for digits;
+// Bit 3 set for certain control characters (nl, tab, cr?);
+// Bit 4 set for punctuation, also &, @, etc;
+// Bit 5 set for "undrawable" characters (?);
+// Bit 6 set for space only (?);
+// Bit 7 set for hexadecimal characters.
+// NOTE: May need to update this for French, German languages?
+const byte Font::_fontProperties[] = {
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x28, 0x28, 0x28, 0x28, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x48, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0x10, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0x10, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
+ 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x10, 0x10, 0x10, 0x10, 0x20,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+
}
diff --git a/engines/startrek/font.h b/engines/startrek/font.h
index 1353acc..184d5ab 100644
--- a/engines/startrek/font.h
+++ b/engines/startrek/font.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/font.h $
- * $Id: font.h 2 2009-09-12 20:13:40Z clone2727 $
- *
*/
#ifndef STARTREK_FONT_H
@@ -38,6 +35,7 @@ public:
~Font();
byte *getCharData(int i);
+ bool isDisplayableCharacter(char c);
private:
StarTrekEngine *_vm;
@@ -45,6 +43,8 @@ private:
struct Character {
byte data[0x40];
} *_characters;
+
+ const static byte _fontProperties[256];
};
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index cce9861..5d484ed 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -658,7 +658,7 @@ void Graphics::addSprite(Sprite *sprite) {
// Initialize some fields
sprite->drawMode = 0;
- sprite->field8 = 0;
+ sprite->field8 = "";
sprite->field16 = false;
sprite->bitmapChanged = true; // FIXME (delete this later?)
@@ -701,6 +701,10 @@ void Graphics::popSprites() {
_pushedNumSprites = -1;
}
+byte *Graphics::getFontGfx(char c) {
+ return _font->getCharData(c & 0xff);
+}
+
void Graphics::copyBackgroundScreen() {
drawDirectToScreen(_backgroundImage);
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index bd5784e..627b5be 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -143,14 +143,18 @@ public:
void pushSprites();
void popSprites();
+ byte *getFontGfx(char c);
+
void copyBackgroundScreen();
void drawDirectToScreen(SharedPtr<Bitmap> bitmap);
void loadEGAData(const char *egaFile);
void drawBackgroundImage(const char *filename);
+public:
+ Font *_font;
+
private:
StarTrekEngine *_vm;
- Font *_font;
bool _egaMode;
byte *_egaData;
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index b5149b5..a8a4b49 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -475,9 +475,23 @@ void Room::showGameOverMenu() { // TODO: takes an optional parameter?
// TODO: finish. Shouldn't do this within a room due to deletion of current room?
}
-int Room::showKeypad(const Common::String &code) {
- // TODO
- return 3;
+int Room::showCodeInputBox(const char * const *codes) {
+ Common::String inputString = _vm->showCodeInputBox();
+
+ // ENHANCEMENT: Extra condition for "nothing entered"
+ if (inputString.empty())
+ return -1;
+
+ int retval = 0;
+ int code = 0;
+
+ while (codes[code] != nullptr) {
+ if (strcmp(codes[code], inputString.c_str()) == 0)
+ retval = code + 1;
+ code++;
+ }
+
+ return retval;
}
void Room::playVoc(Common::String filename) {
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index bb1c8f1..dff0bca 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -236,9 +236,11 @@ private:
*/
void showGameOverMenu();
/**
- * Cmd 0x13: Keypad used in "Than Old Devil Moon" (SINS mission)
+ * Cmd 0x13: Text input used in "Than Old Devil Moon" (SINS mission)
+ * Takes a list of codes (ending with nullptr) and returns the index of the matched
+ * code (plus one), or 0 if no code was matched.
*/
- int showKeypad(const Common::String &code);
+ int showCodeInputBox(const char * const *codes);
/**
* Cmd 0x15
*/
diff --git a/engines/startrek/rooms/sins1.cpp b/engines/startrek/rooms/sins1.cpp
index 8d94b4a..8f44840 100644
--- a/engines/startrek/rooms/sins1.cpp
+++ b/engines/startrek/rooms/sins1.cpp
@@ -197,9 +197,16 @@ void Room::sins1UseSpockOnKeypad() {
}
void Room::sins1SpockReachedKeypad() {
- int ans = showKeypad("01210");
-
- if (ans == 1 || ans == 2) {
+ const char * const codes[] = {
+ "01210", "1210", "10200", nullptr
+ };
+ int ans = showCodeInputBox(codes);
+
+ if (ans == -1) {
+ // ENHANCEMENT: Do nothing if no code was entered.
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ walkCrewman(OBJECT_SPOCK, 0xf3, 0xad);
+ } else if (ans == 1 || ans == 2) {
playVoc("EFX14S");
loadActorAnimC(OBJECT_SPOCK, "susehn", -1, -1, &Room::sins1EnteredSacredSofNumber);
} else if (ans == 3) {
diff --git a/engines/startrek/sprite.cpp b/engines/startrek/sprite.cpp
index 821a78e..dc01a91 100644
--- a/engines/startrek/sprite.cpp
+++ b/engines/startrek/sprite.cpp
@@ -26,7 +26,7 @@
namespace StarTrek {
Sprite::Sprite() :
- pos(), drawPriority(0), drawPriority2(0), field8(0),
+ pos(), drawPriority(0), drawPriority2(0), field8(""),
bitmap(), drawMode(0), textColor(0), bitmapChanged(false),
rect2Valid(false), isOnScreen(false), field16(false), lastDrawRect(),
drawRect(), rectangle2(), drawX(0), drawY(0)
@@ -60,7 +60,7 @@ void Sprite::saveLoadWithSerializer(Common::Serializer &ser) {
ser.syncAsSint16LE(pos.y);
ser.syncAsUint16LE(drawPriority);
ser.syncAsUint16LE(drawPriority2);
- ser.syncAsUint16LE(field8);
+ ser.syncString(field8);
// Note: bitmap must be reloaded
ser.syncAsUint16LE(drawMode);
ser.syncAsUint16LE(textColor);
diff --git a/engines/startrek/sprite.h b/engines/startrek/sprite.h
index b91e2f2..d8cfc0b 100644
--- a/engines/startrek/sprite.h
+++ b/engines/startrek/sprite.h
@@ -46,7 +46,7 @@ struct Sprite : Common::Serializable {
Common::Point pos;
uint16 drawPriority;
uint16 drawPriority2; // If two sprites' drawPriorities are equal, this is checked.
- uint16 field8;
+ Common::String field8;
SharedPtr<Bitmap> bitmap;
uint16 drawMode;
uint16 textColor;
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index ef2ddf1..386abd1 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -107,6 +107,9 @@ const int TEXTBOX_WIDTH = 26;
const int TEXT_CHARS_PER_LINE = TEXTBOX_WIDTH - 2;
const int MAX_TEXTBOX_LINES = 12;
+const int TEXT_INPUT_BUFFER_SIZE = 134;
+const int MAX_TEXT_INPUT_LEN = 20;
+
const int MAX_BUFFERED_WALK_ACTIONS = 32;
const int MAX_BAN_FILES = 16;
@@ -466,6 +469,11 @@ public:
* Returns position of text to continue from, or nullptr if done.
*/
const char *getNextTextLine(const char *text, char *line, int lineWidth);
+ /**
+ * Draw a line of text to a standard bitmap (NOT a "TextBitmap", whose pixel array is
+ * an array of characters, but an actual standard bitmap).
+ */
+ void drawTextLineToBitmap(const char *text, int textLen, int x, int y, SharedPtr<Bitmap> bitmap);
String centerTextboxHeader(String headerText);
void getTextboxHeader(String *headerTextOutput, String speakerText, int choiceIndex);
@@ -523,6 +531,24 @@ public:
*/
String readTextFromArrayWithChoices(int choiceIndex, uintptr data, String *headerTextOutput);
+ Common::String showCodeInputBox();
+ void redrawTextInput();
+ void addCharToTextInputBuffer(char c);
+ /**
+ * Shows a textbox that the player can type a string into.
+ */
+ Common::String showTextInputBox(int16 arg0, int16 arg2, const Common::String &headerText);
+ void initTextInputSprite(int16 arg0, int16 arg2, const Common::String &headerText);
+ void cleanupTextInputSprite();
+
+private:
+ char _textInputBuffer[TEXT_INPUT_BUFFER_SIZE];
+ int16 _textInputCursorPos;
+ char _textInputCursorChar;
+ SharedPtr<Bitmap> _textInputBitmapSkeleton;
+ SharedPtr<Bitmap> _textInputBitmap;
+ Sprite _textInputSprite;
+
// menu.cpp
public:
/**
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index e2f2715..1a05ecc 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -80,6 +80,62 @@ const char *StarTrekEngine::getNextTextLine(const char *text, char *lineOutput,
return lastSpaceInput + 1;
}
+void StarTrekEngine::drawTextLineToBitmap(const char *text, int textLen, int x, int y, SharedPtr<Bitmap> bitmap) {
+ const int charWidth = 8;
+
+ int textOffset = 0;
+
+ while (textOffset < textLen) {
+ Common::Rect destRect(x, y, x + 8, y + 8);
+ Common::Rect bitmapRect(bitmap->width, bitmap->height);
+
+ if (destRect.intersects(bitmapRect)) {
+ // drawRect = the rectangle within the 8x8 font character that will be drawn
+ // (part of it may be clipped)
+ Common::Rect drawRect;
+ drawRect.left = bitmapRect.left - destRect.left;
+ if (drawRect.left < destRect.left - destRect.left)
+ drawRect.left = destRect.left - destRect.left;
+
+ drawRect.right = bitmapRect.right - destRect.left;
+ if (drawRect.right > destRect.right - destRect.left)
+ drawRect.right = destRect.right - destRect.left;
+
+ drawRect.top = bitmapRect.top - destRect.top;
+ if (drawRect.top < destRect.top - destRect.top)
+ drawRect.top = destRect.top - destRect.top;
+
+ drawRect.bottom = bitmapRect.bottom - destRect.top;
+ if (drawRect.bottom > destRect.bottom - destRect.top)
+ drawRect.bottom = destRect.bottom - destRect.top;
+
+
+ int16 destX = destRect.left - bitmapRect.left;
+ if (destX < bitmapRect.right - bitmapRect.right)
+ destX = bitmapRect.right - bitmapRect.right;
+
+ int16 destY = destRect.top - bitmapRect.top;
+ if (destY < bitmapRect.top - bitmapRect.top)
+ destY = bitmapRect.top - bitmapRect.top;
+
+ int16 srcRowDiff = charWidth - drawRect.width();
+ int16 destRowDiff = bitmapRect.width() - drawRect.width();
+
+ byte *srcPixels = _gfx->getFontGfx(text[textOffset]) + drawRect.top * charWidth + drawRect.left;
+ byte *destPixels = bitmap->pixels + destY * bitmapRect.width() + destX;
+
+ for (int i = 0; i < drawRect.height(); i++) {
+ memcpy(destPixels, srcPixels, drawRect.width());
+ destPixels += destRowDiff + drawRect.width();
+ srcPixels += srcRowDiff + drawRect.width();
+ }
+ }
+
+ x += charWidth;
+ textOffset++;
+ }
+}
+
String StarTrekEngine::centerTextboxHeader(String headerText) {
char text[TEXT_CHARS_PER_LINE + 1];
memset(text, ' ', sizeof(text));
@@ -621,4 +677,257 @@ String StarTrekEngine::readTextFromArrayWithChoices(int choiceIndex, uintptr dat
return String(mainText);
}
+Common::String StarTrekEngine::showCodeInputBox() {
+ memset(_textInputBuffer, 0, TEXT_INPUT_BUFFER_SIZE - 1);
+ return showTextInputBox(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, "Code:\n ");
+}
+
+void StarTrekEngine::redrawTextInput() {
+ char buf[MAX_TEXT_INPUT_LEN * 2 + 2];
+ memset(buf, 0, MAX_TEXT_INPUT_LEN * 2);
+ strcpy(buf, _textInputBuffer);
+
+ if (_textInputCursorChar != 0)
+ buf[_textInputCursorPos] = _textInputCursorChar;
+
+ memcpy(_textInputBitmap->pixels, _textInputBitmapSkeleton->pixels, _textInputBitmapSkeleton->width * _textInputBitmapSkeleton->height);
+
+ drawTextLineToBitmap(buf, MAX_TEXT_INPUT_LEN, 4, 12, _textInputBitmap);
+ _textInputSprite.bitmapChanged = true;
+ _gfx->drawAllSprites();
+}
+
+void StarTrekEngine::addCharToTextInputBuffer(char c) {
+ Common::String str(_textInputBuffer);
+ while ((int)str.size() < _textInputCursorPos) {
+ str += " ";
+ }
+
+ str.insertChar(c, _textInputCursorPos);
+
+ strncpy(_textInputBuffer, str.c_str(), MAX_TEXT_INPUT_LEN);
+ _textInputBuffer[MAX_TEXT_INPUT_LEN] = '\0';
+}
+
+Common::String StarTrekEngine::showTextInputBox(int16 x, int16 y, const Common::String &headerText) {
+ bool validInput = false;
+
+ _keyboardControlsMouse = false;
+ _textInputCursorPos = 0;
+
+ initTextInputSprite(x, y, headerText);
+
+ bool loop = true;
+
+ while (loop) {
+ TrekEvent event;
+ if (!popNextEvent(&event))
+ continue;
+
+ switch (event.type) {
+ case TREKEVENT_TICK:
+ _gfx->incPaletteFadeLevel();
+ _frameIndex++;
+ _textInputCursorChar = (_frameIndex & 2 ? 1 : 0);
+ redrawTextInput();
+ break;
+
+ case TREKEVENT_LBUTTONDOWN:
+ redrawTextInput();
+ validInput = true;
+ loop = false;
+ break;
+
+ case TREKEVENT_RBUTTONDOWN:
+ loop = false;
+ break;
+
+ case TREKEVENT_KEYDOWN:
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_BACKSPACE:
+ if (_textInputCursorPos > 0) {
+ _textInputCursorPos--;
+ Common::String str(_textInputBuffer);
+ str.deleteChar(_textInputCursorPos);
+ strcpy(_textInputBuffer, str.c_str());
+ }
+ redrawTextInput();
+ break;
+
+ case Common::KEYCODE_DELETE: { // ENHANCEMENT: Support delete key
+ Common::String str(_textInputBuffer);
+ if (_textInputCursorPos < (int)str.size()) {
+ str.deleteChar(_textInputCursorPos);
+ strcpy(_textInputBuffer, str.c_str());
+ redrawTextInput();
+ }
+ break;
+ }
+
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ case Common::KEYCODE_F1:
+ redrawTextInput();
+ loop = false;
+ validInput = true;
+ break;
+
+ case Common::KEYCODE_ESCAPE:
+ case Common::KEYCODE_F2:
+ loop = false;
+ break;
+
+ case Common::KEYCODE_HOME:
+ case Common::KEYCODE_KP7:
+ _textInputCursorPos = 0;
+ break;
+
+ case Common::KEYCODE_LEFT:
+ case Common::KEYCODE_KP4:
+ if (_textInputCursorPos > 0)
+ _textInputCursorPos--;
+ redrawTextInput();
+ break;
+
+ case Common::KEYCODE_RIGHT:
+ case Common::KEYCODE_KP6:
+ if (_textInputCursorPos < MAX_TEXT_INPUT_LEN - 1)
+ _textInputCursorPos++;
+ redrawTextInput();
+ break;
+
+ case Common::KEYCODE_END:
+ case Common::KEYCODE_KP1:
+ _textInputCursorPos = strlen(_textInputBuffer);
+ // BUGFIX: Check that it doesn't exceed the buffer length.
+ // Original game had a bug where you could crash the game by pressing
+ // "end", writing a character, pressing "end" again, etc.
+ if (_textInputCursorPos >= MAX_TEXT_INPUT_LEN)
+ _textInputCursorPos = MAX_TEXT_INPUT_LEN - 1;
+ break;
+
+ default: // Typed any other character
+ if (_gfx->_font->isDisplayableCharacter(event.kbd.ascii)) {
+ addCharToTextInputBuffer(event.kbd.ascii);
+ if (_textInputCursorPos < MAX_TEXT_INPUT_LEN - 1)
+ _textInputCursorPos++;
+ redrawTextInput();
+ }
+ break;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ cleanupTextInputSprite();
+ _keyboardControlsMouse = true;
+
+ if (validInput)
+ return _textInputBuffer;
+ else
+ return "";
+}
+
+void StarTrekEngine::initTextInputSprite(int16 textboxX, int16 textboxY, const Common::String &headerText) {
+ int headerLen = headerText.size();
+
+ if (headerLen > 25)
+ headerLen = 25;
+
+ char textBuf[TEXTBOX_WIDTH * 11 + 1];
+ const char *headerPos = headerText.c_str();
+ int row = 0;
+
+ /*
+ // TODO: investigate this (might be unused...)
+ if (word_53100 != 0) {
+ // ...
+ }
+ */
+
+ do {
+ headerPos = getNextTextLine(headerPos, textBuf + row * TEXTBOX_WIDTH, headerLen);
+ row++;
+ } while (headerPos != 0 && row < 11);
+
+ int16 width = headerLen * 8 + 8;
+ int16 height = row * 8 + 8;
+
+ _textInputBitmapSkeleton = SharedPtr<Bitmap>(new Bitmap(width, height));
+ _textInputBitmap = SharedPtr<Bitmap>(new Bitmap(width, height));
+
+ _textInputBitmapSkeleton->xoffset = width / 2;
+ if (textboxX + width / 2 >= SCREEN_WIDTH)
+ _textInputBitmapSkeleton->xoffset += width / 2 + textboxX - (SCREEN_WIDTH - 1);
+ if (textboxX - width / 2 < 0)
+ _textInputBitmapSkeleton->xoffset -= 0 - (textboxX - width / 2);
+
+ _textInputBitmapSkeleton->yoffset = height + 20;
+ memset(_textInputBitmapSkeleton->pixels, 0, width * height);
+
+ // Top border
+ int16 xPos = 1;
+ int16 yPos = 1;
+ while (xPos < width - 1) {
+ _textInputBitmapSkeleton->pixels[yPos * width + xPos] = 0x78;
+ xPos++;
+ }
+
+ // Bottom border
+ xPos = 1;
+ yPos = height - 2;
+ while (xPos < width - 1) {
+ _textInputBitmapSkeleton->pixels[yPos * width + xPos] = 0x78;
+ xPos++;
+ }
+
+ // Left border
+ xPos = 1;
+ yPos = 1;
+ while (yPos < height - 1) {
+ _textInputBitmapSkeleton->pixels[yPos * width + xPos] = 0x78;
+ yPos++;
+ }
+
+ // Right border
+ xPos = width - 2;
+ yPos = 1;
+ while (yPos < height - 1) {
+ _textInputBitmapSkeleton->pixels[yPos * width + xPos] = 0x78;
+ yPos++;
+ }
+
+ // Draw header text
+ for (int r = 0; r < row; r++) {
+ char *text = textBuf + r * TEXTBOX_WIDTH;
+ drawTextLineToBitmap(text, strlen(text), 4, r * 8 + 4, _textInputBitmapSkeleton);
+ }
+
+ // Copy skeleton bitmap to actual used bitmap
+ _textInputBitmap->xoffset = _textInputBitmapSkeleton->xoffset;
+ _textInputBitmap->yoffset = _textInputBitmapSkeleton->yoffset;
+ memcpy(_textInputBitmap->pixels, _textInputBitmapSkeleton->pixels, width * height);
+
+ _gfx->addSprite(&_textInputSprite);
+ _textInputSprite.drawMode = 2;
+ _textInputSprite.field8 = "System";
+ _textInputSprite.bitmap = _textInputBitmap;
+ _textInputSprite.setXYAndPriority(textboxX, textboxY, 15);
+ _textInputSprite.drawPriority2 = 8;
+ _gfx->drawAllSprites();
+}
+
+void StarTrekEngine::cleanupTextInputSprite() {
+ _textInputSprite.dontDrawNextFrame();
+ _gfx->drawAllSprites();
+ _gfx->delSprite(&_textInputSprite);
+
+ _textInputSprite.bitmap.reset();
+ _textInputBitmapSkeleton.reset();
+ _textInputBitmap.reset();
+}
+
}
Commit: 42b228144ad5f19c412e24a8c98e536908748f95
https://github.com/scummvm/scummvm/commit/42b228144ad5f19c412e24a8c98e536908748f95
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Allow engine to run without voc files
Changed paths:
engines/startrek/awaymission.cpp
engines/startrek/sound.cpp
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 158d8c6..4fb62cd 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -495,7 +495,7 @@ SharedPtr<Room> StarTrekEngine::getRoom() {
void StarTrekEngine::addAction(const Action &action) {
if (action.type != ACTION_TICK)
- debug("Action %d: %x, %x, %x", action.type, action.b1, action.b2, action.b3);
+ debugC(kDebugGeneral, 4, "Action %d: %x, %x, %x", action.type, action.b1, action.b2, action.b3);
_actionQueue.push(action);
}
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 7ce3e51..24a9758 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -64,7 +64,8 @@ Sound::Sound(StarTrekEngine *vm) : _vm(vm) {
}
if (!SearchMan.hasFile("voc/speech.mrk")) {
- error("Couldn't find 'voc/speech.mrk'. The 'trekcd/voc/' directory must be dumped from the CD");
+ warning("Couldn't find 'voc/speech.mrk'. The 'trekcd/voc/' directory should be dumped from the CD. Continuing without CD audio");
+ _vm->_sfxWorking = false;
}
_playingSpeech = false;
Commit: 8970909318c158b18eb5612f26db1d4db941160f
https://github.com/scummvm/scummvm/commit/8970909318c158b18eb5612f26db1d4db941160f
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Reorganize includes in room.h
This should avoid the costly rebuild of everything in the 'rooms/'
folder, at least sometimes...
Changed paths:
A engines/startrek/soundeffects.h
engines/startrek/awaymission.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/demon0.cpp
engines/startrek/rooms/demon1.cpp
engines/startrek/rooms/demon2.cpp
engines/startrek/rooms/demon3.cpp
engines/startrek/rooms/demon4.cpp
engines/startrek/rooms/demon5.cpp
engines/startrek/rooms/demon6.cpp
engines/startrek/rooms/feather0.cpp
engines/startrek/rooms/feather1.cpp
engines/startrek/rooms/feather3.cpp
engines/startrek/rooms/feather5.cpp
engines/startrek/rooms/feather6.cpp
engines/startrek/rooms/feather7.cpp
engines/startrek/rooms/love0.cpp
engines/startrek/rooms/love1.cpp
engines/startrek/rooms/love2.cpp
engines/startrek/rooms/love3.cpp
engines/startrek/rooms/love4.cpp
engines/startrek/rooms/love5.cpp
engines/startrek/rooms/lovea.cpp
engines/startrek/rooms/mudd0.cpp
engines/startrek/rooms/mudd1.cpp
engines/startrek/rooms/mudd2.cpp
engines/startrek/rooms/mudd3.cpp
engines/startrek/rooms/mudd4.cpp
engines/startrek/rooms/mudd5.cpp
engines/startrek/rooms/mudda.cpp
engines/startrek/rooms/sins0.cpp
engines/startrek/rooms/sins1.cpp
engines/startrek/rooms/trial0.cpp
engines/startrek/rooms/trial1.cpp
engines/startrek/rooms/trial2.cpp
engines/startrek/rooms/trial3.cpp
engines/startrek/rooms/trial4.cpp
engines/startrek/rooms/trial5.cpp
engines/startrek/rooms/tug0.cpp
engines/startrek/rooms/tug1.cpp
engines/startrek/rooms/tug2.cpp
engines/startrek/rooms/tug3.cpp
engines/startrek/sound.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index e1ecc1f..ad3206f 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -180,7 +180,7 @@ struct AwayMission {
// 1: Decided to shoot them
// 2: Talked, and they surrendered immediately
- // 3: They deorbited the ship (and perhps surrendered after)
+ // 3: They deorbited the ship (and perhaps surrendered after)
byte bridgeWinMethod; // 0x5e
bool talkedToBrigCrewman; // 0x5f
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index a8a4b49..59ed8fb 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -45,7 +45,7 @@
namespace StarTrek {
-Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
+Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm), _awayMission(&vm->_awayMission) {
SharedPtr<FileStream> rdfFile = _vm->loadFile(name + ".RDF");
int size = rdfFile->size();
@@ -502,6 +502,10 @@ void Room::stopAllVocSounds() {
_vm->_sound->stopAllVocSounds();
}
+Common::String Room::getCrewmanAnimFilename(int object, const Common::String &str) {
+ return _vm->getCrewmanAnimFilename(object, str);
+}
+
void Room::spockScan(int direction, TextRef text, bool changeDirection) {
const char *dirs = "nsew";
Common::String anim = "sscan_";
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index dff0bca..53c0b07 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -27,8 +27,11 @@
#include "common/ptr.h"
#include "common/str.h"
+#include "startrek/action.h"
+#include "startrek/awaymission.h"
#include "startrek/fixedint.h"
-#include "startrek/startrek.h"
+#include "startrek/object.h"
+#include "startrek/soundeffects.h"
#include "startrek/text.h"
using Common::SharedPtr;
@@ -141,6 +144,7 @@ public:
private:
StarTrekEngine *_vm;
+ AwayMission *_awayMission;
const RoomAction *_roomActionList;
int _numRoomActions;
@@ -252,6 +256,8 @@ private:
// Helper functions for repetitive stuff.
+ Common::String getCrewmanAnimFilename(int object, const Common::String &str);
+
/**
* If "changeDirection" is true, they remain facing that direction even after their
* animation is finished. The game is inconsistent about doing this.
diff --git a/engines/startrek/rooms/demon0.cpp b/engines/startrek/rooms/demon0.cpp
index 189509a..6dd3315 100644
--- a/engines/startrek/rooms/demon0.cpp
+++ b/engines/startrek/rooms/demon0.cpp
@@ -31,42 +31,42 @@ void Room::demon0Tick1() {
}
void Room::demon0Tick2() {
- if (_vm->_awayMission.demon.talkedToPrelate)
+ if (_awayMission->demon.talkedToPrelate)
return;
loadActorAnim(8, "prel", 120, 190, 0);
}
void Room::demon0Tick60() {
- if (_vm->_awayMission.demon.talkedToPrelate)
+ if (_awayMission->demon.talkedToPrelate)
return;
loadActorAnim2(8, "prelclap", 120, 190, 0);
}
void Room::demon0Tick100() {
- if (_vm->_awayMission.demon.talkedToPrelate || _vm->_awayMission.demon.prelateWelcomedCrew)
+ if (_awayMission->demon.talkedToPrelate || _awayMission->demon.prelateWelcomedCrew)
return;
- _vm->_awayMission.demon.prelateWelcomedCrew = true;
+ _awayMission->demon.prelateWelcomedCrew = true;
showText(TX_SPEAKER_ANGIVEN, TX_DEM0_036);
}
void Room::demon0Tick140() {
- if (_vm->_awayMission.demon.mccoyMentionedFlora)
+ if (_awayMission->demon.mccoyMentionedFlora)
return;
showText(TX_SPEAKER_MCCOY, TX_DEM0_016);
- _vm->_awayMission.demon.mccoyMentionedFlora = true;
+ _awayMission->demon.mccoyMentionedFlora = true;
}
void Room::demon0TouchedWarp0() {
- _vm->_awayMission.demon.enteredFrom = 1;
- _vm->_awayMission.rdfStillDoDefaultAction = true;
+ _awayMission->demon.enteredFrom = 1;
+ _awayMission->rdfStillDoDefaultAction = true;
}
void Room::demon0WalkToBottomDoor() {
- _vm->_awayMission.disableInput = 1;
+ _awayMission->disableInput = 1;
_roomVar.demon.movingToBottomDoor = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 243, 158, 1);
}
@@ -84,9 +84,9 @@ void Room::demon0ReachedBottomDoor() {
}
void Room::demon0WalkToTopDoor() {
- _vm->_awayMission.disableInput = 1;
+ _awayMission->disableInput = 1;
_roomVar.demon.movingToTopDoor = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 157, 134, 2);
}
@@ -154,11 +154,11 @@ void Room::demon0TalkToPrelate() {
TX_BLANK
};
- if (_vm->_awayMission.demon.talkedToPrelate)
+ if (_awayMission->demon.talkedToPrelate)
return;
- _vm->_awayMission.demon.missionScore += 3;
- _vm->_awayMission.demon.talkedToPrelate = true;
+ _awayMission->demon.missionScore += 3;
+ _awayMission->demon.talkedToPrelate = true;
const int *response = nullptr;
@@ -187,7 +187,7 @@ void Room::demon0TalkToPrelate() {
showText(thirdResponse);
- if (_vm->_awayMission.demon.wasRudeToPrelate)
+ if (_awayMission->demon.wasRudeToPrelate)
showText(badConclusion);
else
showText(goodConclusion);
@@ -209,7 +209,7 @@ void Room::demon0UsePhaserOnSign() {
void Room::demon0UsePhaserOnShelter() {
showText(TX_SPEAKER_MCCOY, TX_DEM0_015);
showText(TX_SPEAKER_SPOCK, TX_DEM0_013);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_EVERTS, TX_DEM0_040);
}
@@ -274,15 +274,15 @@ void Room::demon0TalkToRedshirt() {
}
void Room::demon0TalkToMcCoy() {
- if (_vm->_awayMission.demon.talkedToPrelate) {
+ if (_awayMission->demon.talkedToPrelate) {
showText(TX_SPEAKER_KIRK, TX_DEM0_011);
showText(TX_SPEAKER_MCCOY, TX_DEM0_023);
showText(TX_SPEAKER_SPOCK, TX_DEM0_029);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_EVERTS, TX_DEM0_041);
} else {
showText(TX_SPEAKER_MCCOY, TX_DEM0_019);
- if (!_vm->_awayMission.demon.askedPrelateAboutSightings) {
+ if (!_awayMission->demon.askedPrelateAboutSightings) {
demon0AskPrelateAboutSightings();
}
}
@@ -291,7 +291,7 @@ void Room::demon0TalkToMcCoy() {
void Room::demon0TalkToSpock() {
showText(TX_SPEAKER_SPOCK, TX_DEM0_014);
- if (!_vm->_awayMission.demon.talkedToPrelate && !_vm->_awayMission.demon.askedPrelateAboutSightings)
+ if (!_awayMission->demon.talkedToPrelate && !_awayMission->demon.askedPrelateAboutSightings)
demon0AskPrelateAboutSightings();
}
@@ -299,7 +299,7 @@ void Room::demon0AskPrelateAboutSightings() {
showText(TX_SPEAKER_KIRK, TX_DEM0_001);
showText(TX_SPEAKER_ANGIVEN, TX_DEM0_030);
- _vm->_awayMission.demon.askedPrelateAboutSightings = true;
+ _awayMission->demon.askedPrelateAboutSightings = true;
}
void Room::demon0UseSTricorderAnywhere() {
@@ -318,7 +318,7 @@ void Room::demon0UseMTricorderOnPrelate() {
loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
playSoundEffectIndex(0x04);
- if (_vm->_awayMission.demon.talkedToPrelate)
+ if (_awayMission->demon.talkedToPrelate)
showText(TX_SPEAKER_MCCOY, TX_DEM0_018);
else
showText(TX_SPEAKER_MCCOY, TX_DEM0_022);
@@ -326,11 +326,11 @@ void Room::demon0UseMTricorderOnPrelate() {
// Helper functions
void Room::demon0BadResponse() {
- if (_vm->_awayMission.demon.wasRudeToPrelate)
+ if (_awayMission->demon.wasRudeToPrelate)
return;
- _vm->_awayMission.demon.missionScore -= 3;
- _vm->_awayMission.demon.wasRudeToPrelate = true;
+ _awayMission->demon.missionScore -= 3;
+ _awayMission->demon.wasRudeToPrelate = true;
showText(TX_SPEAKER_ANGIVEN, TX_DEM0_033);
}
diff --git a/engines/startrek/rooms/demon1.cpp b/engines/startrek/rooms/demon1.cpp
index c1519b7..92882ab 100644
--- a/engines/startrek/rooms/demon1.cpp
+++ b/engines/startrek/rooms/demon1.cpp
@@ -29,27 +29,27 @@ namespace StarTrek {
void Room::demon1Tick1() {
playVoc("DEM1LOOP");
- if (!_vm->_awayMission.demon.beatKlingons)
+ if (!_awayMission->demon.beatKlingons)
playMidiMusicTracks(1, -1);
- if (_vm->_awayMission.demon.enteredFrom == 1) { // Entered from south
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
- } else if (_vm->_awayMission.demon.enteredFrom == 2) { // Entered from north?
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
+ if (_awayMission->demon.enteredFrom == 1) { // Entered from south
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
+ } else if (_awayMission->demon.enteredFrom == 2) { // Entered from north?
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
}
- if (!_vm->_awayMission.demon.beatKlingons) {
- _vm->_awayMission.disableWalking = true;
- _vm->_awayMission.timers[2] = 50;
+ if (!_awayMission->demon.beatKlingons) {
+ _awayMission->disableWalking = true;
+ _awayMission->timers[2] = 50;
} else {
loadActorAnim(8, "klg1d2", 0x120, 0x82, 0);
- if (!_vm->_awayMission.demon.tookKlingonHand)
+ if (!_awayMission->demon.tookKlingonHand)
loadActorAnim(13, "klghnd", 0x10b, 0x8e, 0);
loadActorAnim(9, "klg2d2", 0xaa, 0x7c, 0);
loadActorAnim(10, "klg3d2", 0, 0, 0);
@@ -68,26 +68,26 @@ void Room::demon1WalkToCave() {
}
void Room::demon1TouchedTopWarp() {
- if (_vm->_awayMission.demon.warpsDisabled)
+ if (_awayMission->demon.warpsDisabled)
return;
loadRoomIndex(2, 1);
}
void Room::demon1TouchedBottomWarp() {
- if (_vm->_awayMission.demon.warpsDisabled)
+ if (_awayMission->demon.warpsDisabled)
return;
loadRoomIndex(0, 0);
}
void Room::demon1Timer2Expired() {
- if (_vm->_awayMission.demon.beatKlingons)
+ if (_awayMission->demon.beatKlingons)
return;
- _vm->_awayMission.demon.field37 = 1;
- _vm->_awayMission.demon.beatKlingons = true;
- _vm->_awayMission.demon.warpsDisabled = true;
- _vm->_awayMission.timers[0] = 5;
- _vm->_awayMission.timers[3] = 2;
- _vm->_awayMission.timers[1] = 100;
+ _awayMission->demon.field37 = 1;
+ _awayMission->demon.beatKlingons = true;
+ _awayMission->demon.warpsDisabled = true;
+ _awayMission->timers[0] = 5;
+ _awayMission->timers[3] = 2;
+ _awayMission->timers[1] = 100;
loadActorAnim(8, "klg1u", 0x120, 0x82, 0);
}
@@ -189,11 +189,11 @@ void Room::demon1KlingonFinishedAimingWeapon() {
crewman = OBJECT_KIRK;
}
- _vm->_awayMission.crewDirectionsAfterWalk[crewman] = DIR_N;
- _vm->_awayMission.crewGetupTimers[crewman] = 650;
- _vm->_awayMission.crewDownBitset |= (1 << crewman);
+ _awayMission->crewDirectionsAfterWalk[crewman] = DIR_N;
+ _awayMission->crewGetupTimers[crewman] = 650;
+ _awayMission->crewDownBitset |= (1 << crewman);
- _vm->_awayMission.timers[1] = 100;
+ _awayMission->timers[1] = 100;
}
void Room::demon1KirkShot() {
@@ -209,7 +209,7 @@ void Room::demon1UsePhaserOnAnything() {
void Room::demon1UsePhaserOnKlingon1() {
if (_roomVar.demon.klingonShot[0])
return;
- _vm->_awayMission.disableInput = 1;
+ _awayMission->disableInput = 1;
_roomVar.demon.klingonShot[0] = true;
if (_roomVar.demon.kirkShooting) {
@@ -223,11 +223,11 @@ void Room::demon1UsePhaserOnKlingon1() {
void Room::demon1ShootKlingon1() {
_roomVar.demon.numKlingonsKilled++;
if (_roomVar.demon.numKlingonsKilled == 3) {
- _vm->_awayMission.timers[1] = 0;
- _vm->_awayMission.timers[5] = 180;
- _vm->_awayMission.timers[6] = 1;
- _vm->_awayMission.demon.warpsDisabled = false;
- _vm->_awayMission.disableWalking = false;
+ _awayMission->timers[1] = 0;
+ _awayMission->timers[5] = 180;
+ _awayMission->timers[6] = 1;
+ _awayMission->demon.warpsDisabled = false;
+ _awayMission->disableWalking = false;
}
loadActorAnim(12, "s0ks1", 0, 0, 0);
playSoundEffectIndex(0x06);
@@ -237,11 +237,11 @@ void Room::demon1ShootKlingon1() {
void Room::demon1KlingonDropsHand() {
loadActorAnim(13, "klghnd", 0x10b, 0x8e, 0);
- _vm->_awayMission.disableInput = 0;
- _vm->_awayMission.timers[1] = 0;
+ _awayMission->disableInput = 0;
+ _awayMission->timers[1] = 0;
showText(TX_DEM1N020);
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_REDSHIRT))
return;
showText(TX_SPEAKER_EVERTS, TX_DEM1_025);
@@ -251,13 +251,13 @@ void Room::demon1KlingonDropsHand() {
showText(TX_SPEAKER_KLINGON, TX_DEM1_F23);
- _vm->_awayMission.timers[1] = 1;
+ _awayMission->timers[1] = 1;
}
void Room::demon1UsePhaserOnKlingon2() {
if (_roomVar.demon.klingonShot[1])
return;
- _vm->_awayMission.disableInput = 1;
+ _awayMission->disableInput = 1;
_roomVar.demon.klingonShot[1] = true;
if (_roomVar.demon.kirkShooting) {
@@ -271,22 +271,22 @@ void Room::demon1UsePhaserOnKlingon2() {
void Room::demon1ShootKlingon2() {
_roomVar.demon.numKlingonsKilled++;
if (_roomVar.demon.numKlingonsKilled == 3) {
- _vm->_awayMission.timers[1] = 0;
- _vm->_awayMission.timers[5] = 180;
- _vm->_awayMission.timers[6] = 1;
- _vm->_awayMission.demon.warpsDisabled = false;
- _vm->_awayMission.disableWalking = false;
+ _awayMission->timers[1] = 0;
+ _awayMission->timers[5] = 180;
+ _awayMission->timers[6] = 1;
+ _awayMission->demon.warpsDisabled = false;
+ _awayMission->disableWalking = false;
}
loadActorAnim(12, "s0ks2", 0, 0, 0);
playSoundEffectIndex(0x06);
loadActorAnim2(9, "klg2d", 0xaa, 0x7c, 0);
- _vm->_awayMission.disableInput = 0;
+ _awayMission->disableInput = 0;
}
void Room::demon1UsePhaserOnKlingon3() {
if (_roomVar.demon.klingonShot[2])
return;
- _vm->_awayMission.disableInput = 1;
+ _awayMission->disableInput = 1;
_roomVar.demon.klingonShot[2] = true;
if (_roomVar.demon.kirkShooting) {
@@ -300,28 +300,28 @@ void Room::demon1UsePhaserOnKlingon3() {
void Room::demon1ShootKlingon3() {
_roomVar.demon.numKlingonsKilled++;
if (_roomVar.demon.numKlingonsKilled == 3) {
- _vm->_awayMission.timers[1] = 0;
- _vm->_awayMission.timers[5] = 180;
- _vm->_awayMission.timers[6] = 1;
- _vm->_awayMission.demon.warpsDisabled = false;
- _vm->_awayMission.disableWalking = false;
+ _awayMission->timers[1] = 0;
+ _awayMission->timers[5] = 180;
+ _awayMission->timers[6] = 1;
+ _awayMission->demon.warpsDisabled = false;
+ _awayMission->disableWalking = false;
}
loadActorAnim(12, "s0ks3", 0, 0, 0);
playSoundEffectIndex(0x06);
loadActorAnim2(10, "klg3d", 0, 0, 0);
- _vm->_awayMission.disableInput = 0;
+ _awayMission->disableInput = 0;
}
// Timer 6 expired
void Room::demon1AllKlingonsDead() {
- _vm->_awayMission.crewGetupTimers[OBJECT_KIRK] = 45;
- _vm->_awayMission.crewGetupTimers[OBJECT_SPOCK] = 45;
- _vm->_awayMission.crewGetupTimers[OBJECT_MCCOY] = 45;
- _vm->_awayMission.crewGetupTimers[OBJECT_REDSHIRT] = 45;
+ _awayMission->crewGetupTimers[OBJECT_KIRK] = 45;
+ _awayMission->crewGetupTimers[OBJECT_SPOCK] = 45;
+ _awayMission->crewGetupTimers[OBJECT_MCCOY] = 45;
+ _awayMission->crewGetupTimers[OBJECT_REDSHIRT] = 45;
}
void Room::demon1Timer5Expired() {
- if (_vm->_awayMission.crewDownBitset != 0)
+ if (_awayMission->crewDownBitset != 0)
return;
showText(TX_SPEAKER_UHURA, TX_DEM1U077);
@@ -377,7 +377,7 @@ void Room::demon1UseSTricorderOnKlingon1() {
playSoundEffectIndex(0x04);
- if (_roomVar.demon.numKlingonsKilled == 3 && !_vm->_awayMission.demon.tookKlingonHand && _rdfData[0xcf] != 1) {
+ if (_roomVar.demon.numKlingonsKilled == 3 && !_awayMission->demon.tookKlingonHand && _rdfData[0xcf] != 1) {
showText(TX_SPEAKER_SPOCK, TX_DEM1_018);
_rdfData[0xcf] = 1;
} else {
@@ -392,17 +392,17 @@ void Room::demon1UseSTricorderOnKlingon2Or3() {
}
void Room::demon1UseMTricorderOnKirk() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_KIRK))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_KIRK))
demon1UseMTricorderOnCrewman();
}
void Room::demon1UseMTricorderOnSpock() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_SPOCK))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_SPOCK))
demon1UseMTricorderOnCrewman();
}
void Room::demon1UseMTricorderOnRedshirt() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_REDSHIRT))
demon1UseMTricorderOnCrewman();
}
@@ -424,18 +424,18 @@ void Room::demon1ReachedHand() {
void Room::demon1PickedUpHand() {
loadActorStandAnim(13);
- _vm->_awayMission.demon.missionScore += 3;
+ _awayMission->demon.missionScore += 3;
loadActorStandAnim(OBJECT_KIRK);
- _vm->_awayMission.timers[4] = 2;
+ _awayMission->timers[4] = 2;
}
// Timer 4 expired
void Room::demon1FinishedGettingHand() {
- if (_vm->_awayMission.demon.tookKlingonHand)
+ if (_awayMission->demon.tookKlingonHand)
showText(TX_DEM1N005);
else {
- _vm->_awayMission.demon.tookKlingonHand = true;
+ _awayMission->demon.tookKlingonHand = true;
giveItem(OBJECT_IHAND);
showText(TX_DEM1N007);
}
@@ -481,42 +481,42 @@ void Room::demon1LookAnywhere() {
}
void Room::demon1LookAtKirk() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_KIRK))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_KIRK))
showText(TX_DEM1N012);
else
showText(TX_DEM1N003);
}
void Room::demon1LookAtSpock() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_SPOCK))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_SPOCK))
showText(TX_DEM1N015);
else
showText(TX_DEM1N008);
}
void Room::demon1LookAtMcCoy() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_MCCOY))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_MCCOY))
showText(TX_DEM1N013);
else
showText(TX_DEM1N001);
}
void Room::demon1LookAtRedshirt() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_REDSHIRT))
showText(TX_DEM1N014);
else
showText(TX_DEM1N002);
}
void Room::demon1TalkToKirk() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_KIRK))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_KIRK))
demon1TalkToUnconsciousCrewman();
else if (_roomVar.demon.numKlingonsKilled == 3)
showText(TX_SPEAKER_KIRK, TX_DEM1_001);
}
void Room::demon1TalkToSpock() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_SPOCK))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_SPOCK))
demon1TalkToUnconsciousCrewman();
else {
showText(TX_SPEAKER_SPOCK, TX_DEM1_022);
@@ -527,7 +527,7 @@ void Room::demon1TalkToSpock() {
}
void Room::demon1TalkToMcCoy() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_MCCOY))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_MCCOY))
demon1TalkToUnconsciousCrewman();
else {
showText(TX_SPEAKER_MCCOY, TX_DEM1_015);
@@ -536,7 +536,7 @@ void Room::demon1TalkToMcCoy() {
}
void Room::demon1TalkToRedshirt() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_REDSHIRT))
demon1TalkToUnconsciousCrewman();
else
showText(TX_SPEAKER_EVERTS, TX_DEM1_026);
diff --git a/engines/startrek/rooms/demon2.cpp b/engines/startrek/rooms/demon2.cpp
index 4e8f8b2..d31f417 100644
--- a/engines/startrek/rooms/demon2.cpp
+++ b/engines/startrek/rooms/demon2.cpp
@@ -37,8 +37,8 @@ void Room::demon2ReachedCave() {
}
void Room::demon2TouchedWarp1() {
- _vm->_awayMission.demon.enteredFrom = 2;
- _vm->_awayMission.rdfStillDoDefaultAction = true;
+ _awayMission->demon.enteredFrom = 2;
+ _awayMission->rdfStillDoDefaultAction = true;
}
void Room::demon2LookAtCave() {
@@ -141,18 +141,18 @@ void Room::demon2UseMTricorderOnBerries() {
loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0);
playSoundEffectIndex(0x04);
- if (_vm->_awayMission.demon.curedChub)
+ if (_awayMission->demon.curedChub)
showText(TX_SPEAKER_MCCOY, TX_DEM2_013);
- else if (_vm->_awayMission.demon.madeHypoDytoxin)
+ else if (_awayMission->demon.madeHypoDytoxin)
showText(TX_SPEAKER_MCCOY, TX_DEM2_009);
- else if (_vm->_awayMission.demon.knowAboutHypoDytoxin)
+ else if (_awayMission->demon.knowAboutHypoDytoxin)
showText(TX_SPEAKER_MCCOY, TX_DEM2_010);
else
showText(TX_SPEAKER_MCCOY, TX_DEM2_012);
}
void Room::demon2GetBerries() {
- if (_vm->_awayMission.demon.gotBerries)
+ if (_awayMission->demon.gotBerries)
showText(TX_SPEAKER_MCCOY, TX_DEM2_014);
else
walkCrewman(OBJECT_KIRK, 0xe8, 0x97, 1);
@@ -166,8 +166,8 @@ void Room::demon2ReachedBerries() {
void Room::demon2PickedUpBerries() {
showText(TX_DEM2N013);
giveItem(OBJECT_IBERRY);
- _vm->_awayMission.demon.gotBerries = true;
- _vm->_awayMission.demon.missionScore += 1;
+ _awayMission->demon.gotBerries = true;
+ _awayMission->demon.missionScore += 1;
}
}
diff --git a/engines/startrek/rooms/demon3.cpp b/engines/startrek/rooms/demon3.cpp
index f862838..e30a5fc 100644
--- a/engines/startrek/rooms/demon3.cpp
+++ b/engines/startrek/rooms/demon3.cpp
@@ -29,36 +29,36 @@ void Room::demon3Tick1() {
loadActorAnim(8, "light", 0xab, 0x03, 0);
_roomVar.demon.boulder1Shot = true;
- if (!_vm->_awayMission.demon.boulder1Gone) {
+ if (!_awayMission->demon.boulder1Gone) {
loadActorAnim(9, "bldr1", 0x26, 0, 0);
_roomVar.demon.boulder1Shot = false;
}
- if (!_vm->_awayMission.demon.boulder2Gone) {
+ if (!_awayMission->demon.boulder2Gone) {
loadActorAnim(10, "bldr2", 0x22, 0, 0);
}
- if (!_vm->_awayMission.demon.boulder3Gone) {
+ if (!_awayMission->demon.boulder3Gone) {
loadActorAnim(11, "bldr3", 0x22, 0, 0);
}
- if (!_vm->_awayMission.demon.boulder4Gone) {
+ if (!_awayMission->demon.boulder4Gone) {
loadActorAnim(12, "bldr4", 0x22, 0, 0);
}
- if (_vm->_awayMission.demon.doorOpened) {
+ if (_awayMission->demon.doorOpened) {
loadActorAnim(14, "door2", 0x82, 0x0c, 0);
} else {
loadMapFile("demon3a");
}
- if (!_vm->_awayMission.demon.healedMiner && _vm->_awayMission.demon.boulder4Gone)
+ if (!_awayMission->demon.healedMiner && _awayMission->demon.boulder4Gone)
loadActorAnim(13, "miner", 0xda, 0x6c, 0);
- if (_vm->_awayMission.redshirtDead && !_vm->_awayMission.demon.field45)
+ if (_awayMission->redshirtDead && !_awayMission->demon.field45)
loadActorAnim(OBJECT_REDSHIRT, "deadre", 0x46, 0xa0, 0);
- if (_vm->_awayMission.demon.field41 == 0)
- _vm->_awayMission.demon.field41++;
+ if (_awayMission->demon.field41 == 0)
+ _awayMission->demon.field41++;
- if (!_vm->_awayMission.demon.field56) {
- _vm->_awayMission.demon.field56 = true;
+ if (!_awayMission->demon.field56) {
+ _awayMission->demon.field56 = true;
playMidiMusicTracks(0, -1);
}
}
@@ -67,10 +67,10 @@ void Room::demon3Tick1() {
void Room::demon3Timer0Expired() {
_roomVar.demon.boulder1Shot = true;
loadActorAnim2(9, "drbldr", 0x26, 0, 0);
- _vm->_awayMission.timers[1] = 13;
- _vm->_awayMission.demon.boulder1Gone = true;
- _vm->_awayMission.demon.numBouldersGone++;
- _vm->_awayMission.disableInput = true;
+ _awayMission->timers[1] = 13;
+ _awayMission->demon.boulder1Gone = true;
+ _awayMission->demon.numBouldersGone++;
+ _awayMission->disableInput = true;
playMidiMusicTracks(2, -1);
playVoc("BOULDERK");
}
@@ -84,12 +84,12 @@ void Room::demon3Timer1Expired() {
// Door just opened
void Room::demon3Timer3Expired() {
- if (_vm->_awayMission.demon.repairedHand) {
+ if (_awayMission->demon.repairedHand) {
showText(TX_DEM3N008);
loadActorAnim(14, "door", 0x82, 0xc, 0);
loadMapFile("demon3");
- _vm->_awayMission.demon.doorOpened = true;
- _vm->_awayMission.demon.missionScore += 2;
+ _awayMission->demon.doorOpened = true;
+ _awayMission->demon.missionScore += 2;
} else {
showText(TX_DEM3N007);
}
@@ -101,7 +101,7 @@ void Room::demon3FinishedAnimation1() {
loadActorStandAnim(OBJECT_SPOCK);
walkCrewman(OBJECT_MCCOY, 0x9c, 0xb2, 5);
_roomVar.demon.inFiringPosition = false;
- _vm->_awayMission.redshirtDead = true;
+ _awayMission->redshirtDead = true;
}
// Just destroyed boulder 4 (revealing the miner)
@@ -114,7 +114,7 @@ void Room::demon3FinishedWalking5() {
playSoundEffectIndex(0x04);
showText(TX_SPEAKER_MCCOY, TX_DEM3_019);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::demon3McCoyInFiringPosition() {
@@ -142,7 +142,7 @@ void Room::demon3KirkInFiringPosition() {
}
void Room::demon3CrewmanInFiringPosition() {
- if (_roomVar.demon.kirkInPosition && _roomVar.demon.spockInPosition && _roomVar.demon.mccoyInPosition && (_vm->_awayMission.redshirtDead || _roomVar.demon.redshirtInPosition))
+ if (_roomVar.demon.kirkInPosition && _roomVar.demon.spockInPosition && _roomVar.demon.mccoyInPosition && (_awayMission->redshirtDead || _roomVar.demon.redshirtInPosition))
demon3PullOutPhaserAndFireAtBoulder();
}
@@ -191,12 +191,12 @@ void Room::demon3FireAtBoulder() {
loadActorAnim(17, _roomVar.demon.boulderAnim, 0, 0, 0);
playSoundEffectIndex(0x06);
if (!_roomVar.demon.boulder1Shot)
- _vm->_awayMission.timers[0] = 1;
- _vm->_awayMission.disableInput = false;
+ _awayMission->timers[0] = 1;
+ _awayMission->disableInput = false;
}
void Room::demon3UsePhaserOnRedshirt() {
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
return;
showText(TX_SPEAKER_MCCOY, TX_DEM3_013);
}
@@ -206,10 +206,10 @@ void Room::demon3UseStunPhaserOnBoulder() {
}
void Room::demon3UsePhaserOnBoulder1() {
- if (_roomVar.demon.shootingBoulder || _vm->_awayMission.demon.boulder1Gone)
+ if (_roomVar.demon.shootingBoulder || _awayMission->demon.boulder1Gone)
return;
- _vm->_awayMission.demon.boulder1Gone = true;
- _vm->_awayMission.demon.numBouldersGone++;
+ _awayMission->demon.boulder1Gone = true;
+ _awayMission->demon.numBouldersGone++;
_roomVar.demon.boulderBeingShot = 1;
_roomVar.demon.boulder1Shot = true;
strcpy(_roomVar.demon.boulderAnim, "s0r3s2");
@@ -217,21 +217,21 @@ void Room::demon3UsePhaserOnBoulder1() {
}
void Room::demon3UsePhaserOnBoulder2() {
- if (_roomVar.demon.shootingBoulder || _vm->_awayMission.demon.boulder2Gone)
+ if (_roomVar.demon.shootingBoulder || _awayMission->demon.boulder2Gone)
return;
- _vm->_awayMission.demon.boulder2Gone = true;
- _vm->_awayMission.demon.numBouldersGone++;
+ _awayMission->demon.boulder2Gone = true;
+ _awayMission->demon.numBouldersGone++;
_roomVar.demon.boulderBeingShot = 2;
strcpy(_roomVar.demon.boulderAnim, "s0r3s3");
demon3BoulderCommon();
}
void Room::demon3UsePhaserOnBoulder3() {
- if (_vm->_awayMission.demon.boulder1Gone) {
- if (_roomVar.demon.shootingBoulder || _vm->_awayMission.demon.boulder3Gone)
+ if (_awayMission->demon.boulder1Gone) {
+ if (_roomVar.demon.shootingBoulder || _awayMission->demon.boulder3Gone)
return;
- _vm->_awayMission.demon.boulder3Gone = true;
- _vm->_awayMission.demon.numBouldersGone++;
+ _awayMission->demon.boulder3Gone = true;
+ _awayMission->demon.numBouldersGone++;
_roomVar.demon.boulderBeingShot = 3;
strcpy(_roomVar.demon.boulderAnim, "s0r3s1");
demon3BoulderCommon();
@@ -241,14 +241,14 @@ void Room::demon3UsePhaserOnBoulder3() {
}
void Room::demon3UsePhaserOnBoulder4() {
- if (_vm->_awayMission.demon.boulder2Gone) {
- if (_roomVar.demon.shootingBoulder || _vm->_awayMission.demon.boulder4Gone)
+ if (_awayMission->demon.boulder2Gone) {
+ if (_roomVar.demon.shootingBoulder || _awayMission->demon.boulder4Gone)
return;
- _vm->_awayMission.demon.boulder4Gone = true;
- _vm->_awayMission.demon.numBouldersGone++;
+ _awayMission->demon.boulder4Gone = true;
+ _awayMission->demon.numBouldersGone++;
_roomVar.demon.boulderBeingShot = 4;
strcpy(_roomVar.demon.boulderAnim, "s0r3s4");
- _vm->_awayMission.demon.foundMiner = true;
+ _awayMission->demon.foundMiner = true;
demon3BoulderCommon();
} else {
// BUGFIX: In the original, the audio didn't play, despite the file existing (and
@@ -258,7 +258,7 @@ void Room::demon3UsePhaserOnBoulder4() {
}
void Room::demon3BoulderCommon() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
Common::Point pos = getActorPos(OBJECT_KIRK);
if (!(pos.x == 0x79 && pos.y == 0xa0)) {
_roomVar.demon.inFiringPosition = false;
@@ -273,7 +273,7 @@ void Room::demon3BoulderCommon() {
walkCrewman(OBJECT_KIRK, 0x79, 0xa0, 1);
walkCrewman(OBJECT_SPOCK, 0xae, 0xb4, 2);
walkCrewman(OBJECT_MCCOY, 0xd6, 0xb8, 3);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
walkCrewman(OBJECT_REDSHIRT, 0x46, 0xa0, 4);
_roomVar.demon.shootingBoulder = true;
@@ -294,7 +294,7 @@ void Room::demon3UseSTricorderOnPanel() {
}
void Room::demon3UseSTricorderOnBoulder() {
- if (_vm->_awayMission.demon.foundMiner)
+ if (_awayMission->demon.foundMiner)
return;
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(0x04);
@@ -302,7 +302,7 @@ void Room::demon3UseSTricorderOnBoulder() {
}
void Room::demon3UseMTricorderOnBoulder() {
- if (_vm->_awayMission.demon.foundMiner)
+ if (_awayMission->demon.foundMiner)
return;
loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
playSoundEffectIndex(0x04);
@@ -310,17 +310,17 @@ void Room::demon3UseMTricorderOnBoulder() {
}
void Room::demon3UseCrewmanOnPanel() {
- if (_vm->_awayMission.demon.numBouldersGone != 4 || _vm->_awayMission.redshirtDead)
+ if (_awayMission->demon.numBouldersGone != 4 || _awayMission->redshirtDead)
return;
showText(TX_SPEAKER_EVERTS, TX_DEM3_031);
demon3UseRedshirtOnPanel();
}
void Room::demon3UseRedshirtOnPanel() {
- if (_vm->_awayMission.redshirtDead)
+ if (_awayMission->redshirtDead)
return;
- if (_vm->_awayMission.demon.numBouldersGone != 4)
+ if (_awayMission->demon.numBouldersGone != 4)
showText(TX_SPEAKER_EVERTS, TX_DEM3_030);
else
walkCrewman(OBJECT_REDSHIRT, 0xd8, 0x70, 8);
@@ -331,18 +331,18 @@ void Room::demon3RedshirtReachedPanel() {
}
void Room::demon3RedshirtUsedPanel() {
- if (!_vm->_awayMission.demon.foundMiner)
+ if (!_awayMission->demon.foundMiner)
return;
- _vm->_awayMission.demon.field41++;
- if (_vm->_awayMission.demon.field41 == 5) {
+ _awayMission->demon.field41++;
+ if (_awayMission->demon.field41 == 5) {
playVoc("EFX3");
showText(TX_SPEAKER_EVERTS, TX_DEM3_A32);
loadActorAnim2(OBJECT_REDSHIRT, "rkille", -1, -1, 3);
playSoundEffectIndex(0x06);
- _vm->_awayMission.redshirtDead = true;
- _vm->_awayMission.demon.field45 = true;
+ _awayMission->redshirtDead = true;
+ _awayMission->demon.field45 = true;
} else {
const int textTable[] = {
TX_DEM3N005,
@@ -356,7 +356,7 @@ void Room::demon3RedshirtUsedPanel() {
TX_NULL,
TX_BLANK
};
- text[1] = textTable[_vm->_awayMission.demon.field41 - 1];
+ text[1] = textTable[_awayMission->demon.field41 - 1];
showText(text);
walkCrewman(OBJECT_REDSHIRT, 0xbe, 0x9b, 0);
}
@@ -394,8 +394,8 @@ void Room::demon3UsePhaserOnDoor() {
}
void Room::demon3UseHandOnPanel() {
- if (_vm->_awayMission.demon.numBouldersGone == 4) {
- if (_vm->_awayMission.demon.doorOpened)
+ if (_awayMission->demon.numBouldersGone == 4) {
+ if (_awayMission->demon.doorOpened)
return;
walkCrewman(OBJECT_KIRK, 0xd8, 0x70, 7);
} else {
@@ -405,13 +405,13 @@ void Room::demon3UseHandOnPanel() {
void Room::demon3KirkReachedHandPanel() {
loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 6);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
playVoc("MUR4E1");
}
void Room::demon3KirkUsedHandPanel() {
loadActorAnim(15, "panel", 0xd6, 0x3d, 0);
- _vm->_awayMission.timers[3] = 10;
+ _awayMission->timers[3] = 10;
playVoc("SE0FORCE");
}
@@ -419,7 +419,7 @@ void Room::demon3UseMTricorderOnMiner() {
loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
playSoundEffectIndex(0x04);
- if (_vm->_awayMission.demon.minerDead) {
+ if (_awayMission->demon.minerDead) {
showText(TX_SPEAKER_MCCOY, TX_DEM3_022);
} else {
showText(TX_SPEAKER_MCCOY, TX_DEM3_023);
@@ -427,7 +427,7 @@ void Room::demon3UseMTricorderOnMiner() {
}
void Room::demon3UseMedkitOnMiner() {
- if (_vm->_awayMission.demon.healedMiner) {
+ if (_awayMission->demon.healedMiner) {
showText(TX_SPEAKER_MCCOY, TX_DEM3_015);
} else {
walkCrewman(OBJECT_MCCOY, 0xe6, 0x7b, 6);
@@ -441,13 +441,13 @@ void Room::demon3McCoyReachedMiner() {
}
void Room::demon3McCoyFinishedHealingMiner() {
- if (_vm->_awayMission.demon.minerDead) {
+ if (_awayMission->demon.minerDead) {
showText(TX_SPEAKER_MCCOY, TX_DEM3_022);
} else {
showText(TX_SPEAKER_MCCOY, TX_DEM3_021);
- _vm->_awayMission.demon.healedMiner = true;
+ _awayMission->demon.healedMiner = true;
loadActorAnim2(13, "drmine", 0xda, 0x6c, 0);
- _vm->_awayMission.demon.missionScore += 2;
+ _awayMission->demon.missionScore += 2;
walkCrewman(OBJECT_MCCOY, 0x104, 0x96, 0);
}
}
@@ -457,7 +457,7 @@ void Room::demon3GetMiner() {
}
void Room::demon3TalkToMiner() {
- if (!_vm->_awayMission.demon.healedMiner)
+ if (!_awayMission->demon.healedMiner)
return;
showText(TX_SPEAKER_KANDREY, TX_DEM3_F21);
}
@@ -473,7 +473,7 @@ void Room::demon3TalkToSpock() {
}
void Room::demon3TalkToMccoy() {
- if (_vm->_awayMission.redshirtDead) {
+ if (_awayMission->redshirtDead) {
showText(TX_SPEAKER_MCCOY, TX_DEM3_014);
} else {
showText(TX_SPEAKER_MCCOY, TX_DEM3_025);
@@ -503,7 +503,7 @@ void Room::demon3LookAtMccoy() {
}
void Room::demon3LookAtRedshirt() {
- if (_vm->_awayMission.redshirtDead) {
+ if (_awayMission->redshirtDead) {
showText(TX_DEM3N017);
// NOTE: there's an alternate string that isn't used? (TX_DEM3N018)
} else {
@@ -516,7 +516,7 @@ void Room::demon3LookAnywhere() {
}
void Room::demon3LookAtMiner() {
- if (_vm->_awayMission.demon.healedMiner) {
+ if (_awayMission->demon.healedMiner) {
showText(TX_DEM3N000);
} else {
showText(TX_DEM3N006);
@@ -544,7 +544,7 @@ void Room::demon3LookAtStructure() {
}
void Room::demon3LookAtDoor() {
- if (_vm->_awayMission.demon.doorOpened) {
+ if (_awayMission->demon.doorOpened) {
showText(TX_DEM3N014);
} else {
showText(TX_DEM3N012);
diff --git a/engines/startrek/rooms/demon4.cpp b/engines/startrek/rooms/demon4.cpp
index 7a8d95f..615a19a 100644
--- a/engines/startrek/rooms/demon4.cpp
+++ b/engines/startrek/rooms/demon4.cpp
@@ -21,6 +21,7 @@
*/
#include "startrek/room.h"
+#include "startrek/startrek.h"
namespace StarTrek {
@@ -30,20 +31,20 @@ namespace StarTrek {
void Room::demon4Tick1() {
playVoc("DEM4LOOP");
- if (!_vm->_awayMission.demon.healedMiner)
- _vm->_awayMission.demon.minerDead = true;
+ if (!_awayMission->demon.healedMiner)
+ _awayMission->demon.minerDead = true;
- if (_vm->_awayMission.demon.solvedSunPuzzle) {
+ if (_awayMission->demon.solvedSunPuzzle) {
loadActorAnim(10, "bxrise2", 0x122, 0x91, 0);
loadActorAnim(8, "stpout2", 0x107, 0x92, 0);
_roomVar.demon.nauianEmerged = true;
- if ((_vm->_awayMission.demon.itemsTakenFromCase & 0x10) && !_vm->_awayMission.demon.gaveSkullToNauian)
- _vm->_awayMission.timers[6] = 20;
+ if ((_awayMission->demon.itemsTakenFromCase & 0x10) && !_awayMission->demon.gaveSkullToNauian)
+ _awayMission->timers[6] = 20;
}
- if (!_vm->_awayMission.demon.foundAlienRoom) {
- _vm->_awayMission.demon.foundAlienRoom = true;
+ if (!_awayMission->demon.foundAlienRoom) {
+ _awayMission->demon.foundAlienRoom = true;
playMidiMusicTracks(1, -1);
}
}
@@ -52,8 +53,8 @@ void Room::demon4Tick1() {
void Room::demon4FinishedAnimation1() {
loadActorAnim(8, "stpout", 0x107, 0x92, 5);
_roomVar.demon.nauianEmerged = true;
- if (_vm->_awayMission.demon.itemsTakenFromCase & 0x10)
- _vm->_awayMission.timers[6] = 45;
+ if (_awayMission->demon.itemsTakenFromCase & 0x10)
+ _awayMission->timers[6] = 45;
}
void Room::demon4FinishedAnimation2() {
@@ -67,7 +68,7 @@ void Room::demon4FinishedAnimation2() {
// WORKAROUND: original game has the below line; however, it's never executed anyway
// since the game over menu manipulates the stack. Here, the menu could delete this
// room object, so it should be the last statement...
- //_vm->_awayMission.disableInput = false;
+ //_awayMission->disableInput = false;
}
void Room::demon4FinishedAnimation3() {
@@ -76,15 +77,15 @@ void Room::demon4FinishedAnimation3() {
showText(TX_SPEAKER_NAUIAN, TX_DEM4_035);
showText(TX_SPEAKER_SPOCK, TX_DEM4_030);
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.demon.missionScore += 5;
- _vm->_awayMission.timers[1] = 20;
+ _awayMission->disableInput = true;
+ _awayMission->demon.missionScore += 5;
+ _awayMission->timers[1] = 20;
}
// Just solved sun puzzle
void Room::demon4Timer0Expired() {
loadActorAnim(10, "bxrise", 0x122, 0x91, 1);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
loadActorStandAnim(OBJECT_KIRK);
playVoc("SE2POWER");
}
@@ -97,7 +98,7 @@ void Room::demon4Timer1Expired() {
walkCrewman(OBJECT_SPOCK, 0xb4, 0x9b, 4);
walkCrewman(OBJECT_MCCOY, 0xc8, 0x9b, 4);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
walkCrewman(OBJECT_REDSHIRT, 0xc1, 0x91, 4);
else
_roomVar.demon.crewReadyToBeamOut++;
@@ -108,12 +109,12 @@ void Room::demon4CrewmanReachedBeamoutPosition() {
if (_roomVar.demon.crewReadyToBeamOut != 4)
return;
- if (!_vm->_awayMission.demon.insultedStephen)
- _vm->_awayMission.demon.missionScore += 3;
- if (!_vm->_awayMission.redshirtDead)
- _vm->_awayMission.demon.missionScore += 2;
+ if (!_awayMission->demon.insultedStephen)
+ _awayMission->demon.missionScore += 3;
+ if (!_awayMission->redshirtDead)
+ _awayMission->demon.missionScore += 2;
- endMission(_vm->_awayMission.demon.missionScore, 0x24, 0);
+ endMission(_awayMission->demon.missionScore, 0x24, 0);
}
void Room::demon4Timer2Expired() {
@@ -144,16 +145,16 @@ void Room::demon4UsePhaserOnNauian() {
showText(TX_SPEAKER_NAUIAN, TX_DEM4_032);
loadActorAnim2(10, "bxfire", 0, 0, 2);
playVoc("V0SPOCKT");
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.timers[2] = 7;
- _vm->_awayMission.timers[3] = 8;
- _vm->_awayMission.timers[4] = 7;
- _vm->_awayMission.timers[5] = 8;
+ _awayMission->disableInput = true;
+ _awayMission->timers[2] = 7;
+ _awayMission->timers[3] = 8;
+ _awayMission->timers[4] = 7;
+ _awayMission->timers[5] = 8;
}
}
void Room::demon4UseMetalOnSecurityEquipment() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0xf5, 0x90, 5);
}
@@ -162,20 +163,20 @@ void Room::demon4KirkReachedSecurityEquipment() {
}
void Room::demon4KirkFinishedUsingSecurityEquipment() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_DEM4N014);
}
void Room::demon4UseMetalOnNauian() {
walkCrewman(OBJECT_KIRK, 0xe9, 0x90, 1);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
}
void Room::demon4KirkReachedNauian() {
loadActorAnim2(8, "usekey", 0x107, 0x8e, 3);
loseItem(OBJECT_IMETAL);
- _vm->_awayMission.demon.missionScore += 2;
- _vm->_awayMission.demon.itemsTakenFromCase &= ~1;
+ _awayMission->demon.missionScore += 2;
+ _awayMission->demon.itemsTakenFromCase &= ~1;
}
void Room::demon4UseSkullOnNauian() {
@@ -190,11 +191,11 @@ void Room::demon4KirkReachedNauianWithSkull() {
switch (choice) {
case 0:
- _vm->_awayMission.demon.missionScore++;
+ _awayMission->demon.missionScore++;
loadActorAnim2(8, "takesk", 0x107, 0x8e, 0);
loseItem(OBJECT_ISKULL);
- _vm->_awayMission.demon.itemsTakenFromCase &= ~16; // BUG: skull reappears in case? Can abuse for infinite ponits?
- _vm->_awayMission.demon.gaveSkullToNauian = true;
+ _awayMission->demon.itemsTakenFromCase &= ~16; // BUG: skull reappears in case? Can abuse for infinite ponits?
+ _awayMission->demon.gaveSkullToNauian = true;
break;
case 1:
@@ -220,10 +221,10 @@ void Room::demon4UsePhaserOnMccoy() {
}
void Room::demon4TalkToNauian() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
- if (!_vm->_awayMission.demon.metNauian) {
- _vm->_awayMission.demon.metNauian = true;
+ if (!_awayMission->demon.metNauian) {
+ _awayMission->demon.metNauian = true;
showText(TX_SPEAKER_NAUIAN, TX_DEM4_044);
const int choices[] = { TX_SPEAKER_KIRK, TX_DEM4_002, TX_DEM4_004, TX_DEM4_009, TX_BLANK };
@@ -231,7 +232,7 @@ void Room::demon4TalkToNauian() {
switch (choice) {
case 0:
- _vm->_awayMission.demon.field2d = true;
+ _awayMission->demon.field2d = true;
showText(TX_SPEAKER_NAUIAN, TX_DEM4_042);
break;
@@ -254,7 +255,7 @@ void Room::demon4TalkToNauian() {
switch (choice) {
case 0:
- _vm->_awayMission.demon.field2d = true;
+ _awayMission->demon.field2d = true;
showText(TX_SPEAKER_NAUIAN, TX_DEM4_041);
break;
case 1:
@@ -275,9 +276,9 @@ void Room::demon4TalkToNauian() {
showText(TX_SPEAKER_NAUIAN, TX_DEM4_035);
showText(TX_SPEAKER_SPOCK, TX_DEM4_030);
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.demon.missionScore += 5;
- _vm->_awayMission.timers[1] = 20;
+ _awayMission->disableInput = true;
+ _awayMission->demon.missionScore += 5;
+ _awayMission->timers[1] = 20;
} else {
showText(TX_SPEAKER_NAUIAN, TX_DEM4_038);
}
@@ -351,24 +352,24 @@ void Room::demon4UseRedshirtOnPanel() {
}
void Room::demon4UseCrewmanOnPanel() {
- if (_vm->_awayMission.demon.solvedSunPuzzle)
+ if (_awayMission->demon.solvedSunPuzzle)
return;
walkCrewman(_roomVar.demon.crewmanUsingPanel, 0xda, 0x83, 3);
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.demon.crewmanUsingPanel] = DIR_N;
- _vm->_awayMission.disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[_roomVar.demon.crewmanUsingPanel] = DIR_N;
+ _awayMission->disableInput = true;
}
void Room::demon4CrewmanReachedPanel() {
if (demon4ShowSunPuzzle()) {
- _vm->_awayMission.demon.solvedSunPuzzle = true;
+ _awayMission->demon.solvedSunPuzzle = true;
loadActorAnim(9, "ctrl", 0, 0, 0);
- _vm->_awayMission.demon.missionScore += 3;
- _vm->_awayMission.timers[0] = 10;
+ _awayMission->demon.missionScore += 3;
+ _awayMission->timers[0] = 10;
} else
showText(TX_DEM4N013);
walkCrewman(_roomVar.demon.crewmanUsingPanel, 0xae, 0x93, 0);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
bool Room::demon4ShowSunPuzzle() {
diff --git a/engines/startrek/rooms/demon5.cpp b/engines/startrek/rooms/demon5.cpp
index 8af51fe..5a3738c 100644
--- a/engines/startrek/rooms/demon5.cpp
+++ b/engines/startrek/rooms/demon5.cpp
@@ -27,7 +27,7 @@ namespace StarTrek {
void Room::demon5Tick1() {
playVoc("DEM5LOOP");
- if (!_vm->_awayMission.demon.curedChub || _vm->_awayMission.demon.field37 != 1)
+ if (!_awayMission->demon.curedChub || _awayMission->demon.field37 != 1)
loadActorAnim(11, "oldman", 0x7a, 0xb0, 0);
loadActorAnim(8, "brorob", 0xc9, 0xa8, 0);
loadActorAnim(9, "crip", 0xe3, 0xa8, 0);
@@ -36,7 +36,7 @@ void Room::demon5Tick1() {
}
void Room::demon5WalkToDoor() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.demon.movingToDoor = true;
walkCrewman(OBJECT_KIRK, 0xa0, 0x94, 1);
}
@@ -68,14 +68,14 @@ void Room::demon5UsePhaserOnAnything() {
}
void Room::demon5UseHandOnStephen() {
- if (_vm->_awayMission.demon.repairedHand)
+ if (_awayMission->demon.repairedHand)
showText(TX_SPEAKER_STEPHEN, TX_DEM5_036);
else
showText(TX_SPEAKER_STEPHEN, TX_DEM5_039);
}
void Room::demon5UseBerryOnStephen() {
- if (_vm->_awayMission.demon.knowAboutHypoDytoxin)
+ if (_awayMission->demon.knowAboutHypoDytoxin)
showText(TX_SPEAKER_STEPHEN, TX_DEM5_033);
else
showText(TX_SPEAKER_STEPHEN, TX_DEM5_037);
@@ -91,11 +91,11 @@ void Room::demon5MccoyReachedChub() {
void Room::demon5MccoyHealedChub() {
walkCrewman(OBJECT_MCCOY, 0xc8, 0xba, 0);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
showText(TX_SPEAKER_CHUB, TX_DEM5L027);
loseItem(OBJECT_IDETOXIN);
- _vm->_awayMission.demon.curedChub = true;
- _vm->_awayMission.demon.missionScore += 2;
+ _awayMission->demon.curedChub = true;
+ _awayMission->demon.missionScore += 2;
}
void Room::demon5UseHypoDytoxinOnAnything() {
@@ -151,7 +151,7 @@ void Room::demon5LookAtChub() {
}
void Room::demon5TalkToRoberts() {
- if (_vm->_awayMission.demon.curedChub) {
+ if (_awayMission->demon.curedChub) {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_030);
if (!_roomVar.demon.talkedToRoberts) {
_roomVar.demon.talkedToRoberts = true;
@@ -164,7 +164,7 @@ void Room::demon5TalkToRoberts() {
}
void Room::demon5TalkToChub() {
- if (_vm->_awayMission.demon.curedChub) {
+ if (_awayMission->demon.curedChub) {
showText(TX_SPEAKER_CHUB, TX_DEM5L029);
showText(TX_SPEAKER_KIRK, TX_DEM5_002);
showText(TX_SPEAKER_CHUB, TX_DEM5L030);
@@ -182,7 +182,7 @@ void Room::demon5TalkToChub() {
}
void Room::demon5TalkToGrisnash() {
- if (_vm->_awayMission.demon.curedChub) {
+ if (_awayMission->demon.curedChub) {
showText(TX_SPEAKER_GRISNASH, TX_DEM5_028);
showText(TX_SPEAKER_SPOCK, TX_DEM5_024);
showText(TX_SPEAKER_GRISNASH, TX_DEM5_029);
@@ -199,7 +199,7 @@ void Room::demon5TalkToGrisnash() {
}
void Room::demon5TalkToStephen() {
- if (_vm->_awayMission.demon.curedChub) {
+ if (_awayMission->demon.curedChub) {
showText(TX_SPEAKER_STEPHEN, TX_DEM5_041);
showText(TX_SPEAKER_MCCOY, TX_DEM5_022);
showText(TX_SPEAKER_STEPHEN, TX_DEM5_043);
@@ -211,14 +211,14 @@ void Room::demon5TalkToStephen() {
_roomVar.demon.numTalkedTo++;
demon5CheckCompletedStudy();
}
- } else if (!_vm->_awayMission.demon.knowAboutHypoDytoxin) {
+ } else if (!_awayMission->demon.knowAboutHypoDytoxin) {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_034);
- } else if (_vm->_awayMission.demon.madeHypoDytoxin) {
+ } else if (_awayMission->demon.madeHypoDytoxin) {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_035);
- } else if (_vm->_awayMission.demon.gotBerries) {
+ } else if (_awayMission->demon.gotBerries) {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_032);
- _vm->_awayMission.demon.field3e = false;
- } else if (_vm->_awayMission.demon.field3e) {
+ _awayMission->demon.field3e = false;
+ } else if (_awayMission->demon.field3e) {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_038);
} else {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_034);
@@ -241,10 +241,10 @@ void Room::demon5TalkToRedshirt() {
}
void Room::demon5TalkToMccoy() {
- if (_vm->_awayMission.demon.curedChub) {
+ if (_awayMission->demon.curedChub) {
showText(TX_SPEAKER_MCCOY, TX_DEM5_023);
showText(TX_SPEAKER_KIRK, TX_DEM5_004);
- if (!_vm->_awayMission.redshirtDead) {
+ if (!_awayMission->redshirtDead) {
showText(TX_SPEAKER_EVERTS, TX_DEM5_044);
showText(TX_SPEAKER_MCCOY, TX_DEM5_020);
showText(TX_SPEAKER_SPOCK, TX_DEM5_026);
@@ -271,7 +271,7 @@ void Room::demon5UseMTricorderOnChub() {
loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0);
playSoundEffectIndex(0x04);
- if (_vm->_awayMission.demon.curedChub) {
+ if (_awayMission->demon.curedChub) {
if (_roomVar.demon.scannedChub)
return;
showText(TX_SPEAKER_MCCOY, TX_DEM5_016);
@@ -279,13 +279,13 @@ void Room::demon5UseMTricorderOnChub() {
_roomVar.demon.numScanned++;
demon5CheckCompletedStudy();
} else {
- if (_vm->_awayMission.demon.field3e)
+ if (_awayMission->demon.field3e)
showText(TX_SPEAKER_MCCOY, TX_DEM5_010);
else {
showText(TX_SPEAKER_MCCOY, TX_DEM5_012);
showText(TX_SPEAKER_STEPHEN, TX_DEM5_040);
- _vm->_awayMission.demon.knowAboutHypoDytoxin = true;
- _vm->_awayMission.demon.field3e = true;
+ _awayMission->demon.knowAboutHypoDytoxin = true;
+ _awayMission->demon.field3e = true;
}
}
}
diff --git a/engines/startrek/rooms/demon6.cpp b/engines/startrek/rooms/demon6.cpp
index 19c6d07..488683e 100644
--- a/engines/startrek/rooms/demon6.cpp
+++ b/engines/startrek/rooms/demon6.cpp
@@ -21,12 +21,13 @@
*/
#include "startrek/room.h"
+#include "startrek/startrek.h"
namespace StarTrek {
void Room::demon6Tick1() {
playVoc("DEM6LOOP");
- if (_vm->_awayMission.demon.gotBerries || (!_vm->_awayMission.demon.field3e && _vm->_awayMission.demon.field37)) {
+ if (_awayMission->demon.gotBerries || (!_awayMission->demon.field3e && _awayMission->demon.field37)) {
loadActorAnim(8, "oldman", 0x5f, 0xb1, 0);
_roomVar.demon.stephenInRoom = true;
}
@@ -35,17 +36,17 @@ void Room::demon6Tick1() {
}
void Room::demon6Tick30() {
- if (!_vm->_awayMission.demon.gotBerries)
+ if (!_awayMission->demon.gotBerries)
return;
- if (_vm->_awayMission.demon.field3e)
+ if (_awayMission->demon.field3e)
return;
- if (!_vm->_awayMission.demon.field37)
+ if (!_awayMission->demon.field37)
return;
- if (_vm->_awayMission.demon.stephenWelcomedToStudy)
+ if (_awayMission->demon.stephenWelcomedToStudy)
return;
showText(TX_SPEAKER_STEPHEN, TX_DEM6_042);
- _vm->_awayMission.demon.stephenWelcomedToStudy = true;
+ _awayMission->demon.stephenWelcomedToStudy = true;
}
void Room::demon6SpockReachedComputer() {
@@ -53,7 +54,7 @@ void Room::demon6SpockReachedComputer() {
}
void Room::demon6WalkToDoor() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.demon.movingToDoor = true;
walkCrewman(OBJECT_KIRK, 0xa0, 0x94, 4);
}
@@ -137,9 +138,9 @@ void Room::demon6LookAtRedshirt() {
void Room::demon6LookAtComputer() {
showText(TX_DEM6N006);
- if (!_vm->_awayMission.demon.lookedAtComputer) {
- _vm->_awayMission.demon.lookedAtComputer = true;
- _vm->_awayMission.demon.missionScore++;
+ if (!_awayMission->demon.lookedAtComputer) {
+ _awayMission->demon.lookedAtComputer = true;
+ _awayMission->demon.missionScore++;
}
}
@@ -172,7 +173,7 @@ void Room::demon6TalkToStephen() {
}
void Room::demon6UseBerryOnStephen() {
- if (_vm->_awayMission.demon.knowAboutHypoDytoxin) {
+ if (_awayMission->demon.knowAboutHypoDytoxin) {
showText(TX_SPEAKER_STEPHEN, TX_DEM6_027);
} else {
showText(TX_SPEAKER_STEPHEN, TX_DEM6_026);
@@ -180,7 +181,7 @@ void Room::demon6UseBerryOnStephen() {
}
void Room::demon6UseBerryOnSynthesizer() {
- if (!_vm->_awayMission.demon.knowAboutHypoDytoxin)
+ if (!_awayMission->demon.knowAboutHypoDytoxin)
return;
walkCrewman(OBJECT_MCCOY, 0x104, 0xa5, 1);
}
@@ -196,20 +197,20 @@ void Room::demon6FinishedMakingHypoDytoxin() {
showText(TX_SPEAKER_MCCOY, TX_DEM6_018);
giveItem(OBJECT_IDETOXIN);
- _vm->_awayMission.demon.madeHypoDytoxin = true;
+ _awayMission->demon.madeHypoDytoxin = true;
loseItem(OBJECT_IBERRY);
- if (!_vm->_awayMission.demon.gavePointsForDytoxin) {
- _vm->_awayMission.demon.gavePointsForDytoxin = true;
- _vm->_awayMission.demon.missionScore++;
+ if (!_awayMission->demon.gavePointsForDytoxin) {
+ _awayMission->demon.gavePointsForDytoxin = true;
+ _awayMission->demon.missionScore++;
}
}
void Room::demon6UseHandOnWorkspace() {
- if (_vm->_awayMission.demon.repairedHand) {
+ if (_awayMission->demon.repairedHand) {
showText(TX_SPEAKER_SPOCK, TX_DEM6N018); // FIXME
} else {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
showText(TX_SPEAKER_KIRK, TX_DEM6_005);
walkCrewman(OBJECT_SPOCK, 0xb3, 0xbb, 2);
}
@@ -221,10 +222,10 @@ void Room::demon6SpockReachedWorkspace() {
void Room::demon6SpockFinishedRepairingHand() {
showText(TX_SPEAKER_SPOCK, TX_DEM6_024);
- _vm->_awayMission.demon.repairedHand = true;
- _vm->_awayMission.demon.missionScore += 2;
+ _awayMission->demon.repairedHand = true;
+ _awayMission->demon.missionScore += 2;
loadActorStandAnim(OBJECT_SPOCK);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
// FIXME: doesn't work
@@ -244,7 +245,7 @@ void Room::demon6UseCrewmanOnCase() {
insult:
showText(TX_SPEAKER_STEPHEN, TX_DEM6_030);
_roomVar.demon.insultedStephenRecently = true;
- _vm->_awayMission.demon.insultedStephen = true;
+ _awayMission->demon.insultedStephen = true;
} else if (choice == 1) {
showText(TX_SPEAKER_STEPHEN, TX_DEM6_034);
explain:
@@ -316,27 +317,27 @@ void Room::demon6UseSpockOnComputer() {
}
void Room::demon6UseMineralOnStephen() {
- _vm->_awayMission.demon.itemsTakenFromCase &= ~8;
+ _awayMission->demon.itemsTakenFromCase &= ~8;
demon6ReturnItemToStephen(OBJECT_IMINERAL);
}
void Room::demon6UseShellsOnStephen() {
- _vm->_awayMission.demon.itemsTakenFromCase &= ~2;
+ _awayMission->demon.itemsTakenFromCase &= ~2;
demon6ReturnItemToStephen(OBJECT_ISHELLS);
}
void Room::demon6UseMeteorOnStephen() {
- _vm->_awayMission.demon.itemsTakenFromCase &= ~4;
+ _awayMission->demon.itemsTakenFromCase &= ~4;
demon6ReturnItemToStephen(OBJECT_IMETEOR);
}
void Room::demon6UseSkullOnStephen() {
- _vm->_awayMission.demon.itemsTakenFromCase &= ~16;
+ _awayMission->demon.itemsTakenFromCase &= ~16;
demon6ReturnItemToStephen(OBJECT_ISKULL);
}
void Room::demon6UseMetalOnStephen() {
- _vm->_awayMission.demon.itemsTakenFromCase &= ~1;
+ _awayMission->demon.itemsTakenFromCase &= ~1;
demon6ReturnItemToStephen(OBJECT_IMETAL);
}
@@ -347,7 +348,7 @@ void Room::demon6ReturnItemToStephen(int item) {
}
void Room::demon6UseHandOnStephen() {
- if (_vm->_awayMission.demon.repairedHand)
+ if (_awayMission->demon.repairedHand)
showText(TX_SPEAKER_STEPHEN, TX_DEM6_037);
else
showText(TX_SPEAKER_STEPHEN, TX_DEM6_043);
@@ -422,8 +423,8 @@ void Room::demon6GetCase() {
void Room::demon6KirkReachedCase() {
const int items[] = { OBJECT_IMETAL, OBJECT_ISHELLS, OBJECT_IMETEOR, OBJECT_IMINERAL, OBJECT_ISKULL };
- byte ret = 0x1f ^ demon6ShowCase(_vm->_awayMission.demon.itemsTakenFromCase ^ 0x1f);
- _vm->_awayMission.demon.itemsTakenFromCase = ret;
+ byte ret = 0x1f ^ demon6ShowCase(_awayMission->demon.itemsTakenFromCase ^ 0x1f);
+ _awayMission->demon.itemsTakenFromCase = ret;
const int *i = items;
while (ret != 0) {
diff --git a/engines/startrek/rooms/feather0.cpp b/engines/startrek/rooms/feather0.cpp
index a533af0..820614b 100644
--- a/engines/startrek/rooms/feather0.cpp
+++ b/engines/startrek/rooms/feather0.cpp
@@ -122,11 +122,11 @@ void Room::feather0TalkToQuetzecoatl() {
}
// Quetzecoatl ultimately warps the crew away no matter what
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadActorAnim(OBJECT_QUETZECOATL, "s5r0qt");
playMidiMusicTracks(1);
- _vm->_awayMission.timers[0] = 50;
- _vm->_awayMission.timers[1] = 64;
+ _awayMission->timers[0] = 50;
+ _awayMission->timers[1] = 64;
}
void Room::feather0Timer0Expired() {
@@ -139,7 +139,7 @@ void Room::feather0Timer0Expired() {
}
void Room::feather0Timer1Expired() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadRoomIndex(1, 5);
}
diff --git a/engines/startrek/rooms/feather1.cpp b/engines/startrek/rooms/feather1.cpp
index 667608a..1621eca 100644
--- a/engines/startrek/rooms/feather1.cpp
+++ b/engines/startrek/rooms/feather1.cpp
@@ -148,12 +148,12 @@ void Room::feather1Tick1() {
playVoc("FEA1LOOP");
playMidiMusicTracks(27);
- if (_vm->_awayMission.feather.vineState == 0)
- _vm->_awayMission.disableInput = true;
+ if (_awayMission->feather.vineState == 0)
+ _awayMission->disableInput = true;
- if (!_vm->_awayMission.feather.gotSnake)
+ if (!_awayMission->feather.gotSnake)
loadActorAnim(OBJECT_SNAKE, "s5r1so", 0x9c, 0xc1);
- if (_vm->_awayMission.feather.vineState == 0)
+ if (_awayMission->feather.vineState == 0)
loadActorAnim(OBJECT_LEFT_VINE, "s5r1v0", 0xa0, 0x23);
else {
_roomVar.feather.crewEscaped[OBJECT_KIRK] = true;
@@ -165,26 +165,26 @@ void Room::feather1Tick1() {
}
void Room::feather1Tick45() {
- if (_vm->_awayMission.feather.vineState == 0) {
+ if (_awayMission->feather.vineState == 0) {
playVoc("LD3MAGAP");
loadActorAnim(OBJECT_QUETZECOATL, "s5r1qa", 0xb4, 0x32);
}
}
void Room::feather1Tick85() {
- if (_vm->_awayMission.feather.vineState == 0)
+ if (_awayMission->feather.vineState == 0)
showText(TX_SPEAKER_QUETZECOATL, TX_FEA1_057);
}
void Room::feather1Tick95() {
- if (_vm->_awayMission.feather.vineState == 0) {
+ if (_awayMission->feather.vineState == 0) {
playVoc("LD3MAGDI");
loadActorAnimC(OBJECT_QUETZECOATL, "s5r1qd", -1, -1, &Room::feather1QuetzecoatlDisappeared);
}
}
void Room::feather1QuetzecoatlDisappeared() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::feather1GetRightVine() {
@@ -192,7 +192,7 @@ void Room::feather1GetRightVine() {
}
void Room::feather1GetLeftVine() {
- if (_vm->_awayMission.feather.vineState == 0)
+ if (_awayMission->feather.vineState == 0)
showText(TX_FEA1N009);
else
showText(TX_FEA1N008);
@@ -201,11 +201,11 @@ void Room::feather1GetLeftVine() {
void Room::feather1GetRocks() {
if (_roomVar.feather.crewEscaped[OBJECT_KIRK])
showText(TX_FEA1N021);
- else if (_vm->_awayMission.feather.gotRock)
+ else if (_awayMission->feather.gotRock)
showText(TX_FEA1N019);
else {
walkCrewmanC(OBJECT_KIRK, 0x90, 0xb6, &Room::feather1ReachedRocks);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
}
@@ -214,20 +214,20 @@ void Room::feather1ReachedRocks() {
}
void Room::feather1PickedUpRocks() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
giveItem(OBJECT_IROCK);
showText(TX_FEA1N022);
- _vm->_awayMission.feather.gotRock = true;
+ _awayMission->feather.gotRock = true;
}
void Room::feather1GetSnake() {
// BUG: Infinite score mechanism. Just keep trying and failing to get the snake.
- _vm->_awayMission.feather.missionScore++;
+ _awayMission->feather.missionScore++;
if (!_roomVar.feather.crewEscaped[OBJECT_KIRK]) {
walkCrewmanC(OBJECT_KIRK, 0x90, 0xbe, &Room::feather1ReachedSnake);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
} else
showText(TX_FEA1N021);
}
@@ -238,26 +238,26 @@ void Room::feather1ReachedSnake() {
// TX_FEA1N018: "With nowhere for the snake to go, you capture it"
loadActorAnimC(OBJECT_KIRK, "s5r1kg", -1, -1, &Room::feather1PickedUpSnake);
- if (_vm->_awayMission.feather.holeBlocked)
- _vm->_awayMission.timers[1] = 20;
+ if (_awayMission->feather.holeBlocked)
+ _awayMission->timers[1] = 20;
else
- _vm->_awayMission.timers[2] = 6;
+ _awayMission->timers[2] = 6;
}
void Room::feather1Timer1Expired() {
giveItem(OBJECT_ISNAKE);
loadActorStandAnim(OBJECT_SNAKE);
- _vm->_awayMission.feather.gotSnake = true;
+ _awayMission->feather.gotSnake = true;
}
void Room::feather1Timer2Expired() { // Snake retreats into hole
loadActorAnim2(OBJECT_SNAKE, "s5r1si");
- _vm->_awayMission.timers[0] = 80;
+ _awayMission->timers[0] = 80;
_roomVar.feather.snakeInHole = true;
}
void Room::feather1PickedUpSnake() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
}
@@ -273,29 +273,29 @@ void Room::feather1UseCommunicator() {
void Room::feather1UseRockOnHole() {
if (_roomVar.feather.crewEscaped[OBJECT_KIRK])
showText(TX_FEA1N021);
- else if (_vm->_awayMission.feather.holeBlocked)
+ else if (_awayMission->feather.holeBlocked)
showText(TX_FEA1N005);
else {
- _vm->_awayMission.feather.missionScore++;
+ _awayMission->feather.missionScore++;
walkCrewmanC(OBJECT_KIRK, 0xa3, 0xb6, &Room::feather1ReachedHole);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
if (_roomVar.feather.snakeInHole)
- _vm->_awayMission.timers[0] = 12;
+ _awayMission->timers[0] = 12;
}
}
void Room::feather1ReachedHole() {
loadActorAnimC(OBJECT_KIRK, "s5r1kg", -1, -1, &Room::feather1PutRockInHole);
- _vm->_awayMission.timers[3] = 18;
+ _awayMission->timers[3] = 18;
}
void Room::feather1Timer3Expired() {
loadActorAnim(OBJECT_ROCK_IN_HOLE, "s5r1rk", 0xad, 0xba);
- _vm->_awayMission.feather.holeBlocked = true;
+ _awayMission->feather.holeBlocked = true;
}
void Room::feather1PutRockInHole() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
}
@@ -322,9 +322,9 @@ void Room::feather1UseSnakeOnRedshirt() {
}
void Room::feather1UseRockOnSnake() {
- if (!_vm->_awayMission.feather.gotSnake) {
+ if (!_awayMission->feather.gotSnake) {
loadActorAnim2(OBJECT_SNAKE, "s5r1si");
- _vm->_awayMission.timers[0] = 80;
+ _awayMission->timers[0] = 80;
_roomVar.feather.snakeInHole = true;
showText(TX_SPEAKER_SPOCK, TX_FEA1_034); // BUGFIX: speaker is Spock, not Stragey
}
@@ -392,13 +392,13 @@ void Room::feather1UseRedshirtOnMoss() {
}
void Room::feather1UseRockOnLeftVine() {
- if (_vm->_awayMission.feather.vineState == 0) {
- _vm->_awayMission.feather.vineState++;
- _vm->_awayMission.disableInput = true;
+ if (_awayMission->feather.vineState == 0) {
+ _awayMission->feather.vineState++;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0x7a, 0xb6, &Room::feather1ReadyToThrowRock1);
- } else if (_vm->_awayMission.feather.vineState == 1) {
- _vm->_awayMission.feather.vineState++;
- _vm->_awayMission.disableInput = true;
+ } else if (_awayMission->feather.vineState == 1) {
+ _awayMission->feather.vineState++;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0xa2, 0xb9, &Room::feather1ReadyToThrowRock2);
}
}
@@ -411,7 +411,7 @@ void Room::feather1ReadyToThrowRock1() {
}
void Room::feather1ThrewRock1() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_SPEAKER_SPOCK, TX_FEA1_042);
@@ -427,9 +427,9 @@ void Room::feather1ReadyToThrowRock2() {
}
void Room::feather1ThrewRock2() {
- _vm->_awayMission.feather.missionScore += 6;
+ _awayMission->feather.missionScore += 6;
loadActorStandAnim(OBJECT_KIRK);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_SPOCK, TX_FEA1_043);
showText(TX_SPEAKER_MCCOY, TX_FEA1_021);
@@ -438,7 +438,7 @@ void Room::feather1ThrewRock2() {
void Room::feather1UseSpockOnVine() {
- if (_vm->_awayMission.feather.vineState == 2) {
+ if (_awayMission->feather.vineState == 2) {
_roomVar.feather.crewmanClimbingVine = OBJECT_SPOCK;
feather1CrewmanClimbVine();
} else
@@ -446,7 +446,7 @@ void Room::feather1UseSpockOnVine() {
}
void Room::feather1UseMccoyOnVine() {
- if (_vm->_awayMission.feather.vineState == 2) {
+ if (_awayMission->feather.vineState == 2) {
_roomVar.feather.crewmanClimbingVine = OBJECT_MCCOY;
feather1CrewmanClimbVine();
} else
@@ -454,7 +454,7 @@ void Room::feather1UseMccoyOnVine() {
}
void Room::feather1UseRedshirtOnVine() {
- if (_vm->_awayMission.feather.vineState == 2) {
+ if (_awayMission->feather.vineState == 2) {
_roomVar.feather.crewmanClimbingVine = OBJECT_REDSHIRT;
feather1CrewmanClimbVine();
} else
@@ -462,7 +462,7 @@ void Room::feather1UseRedshirtOnVine() {
}
void Room::feather1UseKirkOnVine() {
- if (_vm->_awayMission.feather.vineState == 2) {
+ if (_awayMission->feather.vineState == 2) {
_roomVar.feather.crewmanClimbingVine = OBJECT_KIRK;
feather1CrewmanClimbVine();
} else
@@ -472,7 +472,7 @@ void Room::feather1UseKirkOnVine() {
// This was refactored, due to the similarity of the code for each crewman. Originally, the
// following 5 vine-climbing functions were repeated for each crewman.
void Room::feather1CrewmanClimbVine() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
if (_roomVar.feather.crewEscaped[_roomVar.feather.crewmanClimbingVine])
walkCrewmanC(_roomVar.feather.crewmanClimbingVine, VINE_TOP_X, VINE_TOP_Y,
&Room::feather1ReachedVineToClimbDown);
@@ -489,10 +489,10 @@ void Room::feather1ReachedVineToClimbUp() {
}
void Room::feather1ClimbedUpVine() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
_roomVar.feather.crewEscaped[_roomVar.feather.crewmanClimbingVine] = true;
- Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.feather.crewmanClimbingVine, "stndw");
+ Common::String anim = getCrewmanAnimFilename(_roomVar.feather.crewmanClimbingVine, "stndw");
loadActorAnim2(_roomVar.feather.crewmanClimbingVine, anim, VINE_TOP_X, VINE_TOP_Y);
switch (_roomVar.feather.crewmanClimbingVine) {
@@ -519,10 +519,10 @@ void Room::feather1ReachedVineToClimbDown() {
}
void Room::feather1ClimbedDownVine() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
_roomVar.feather.crewEscaped[_roomVar.feather.crewmanClimbingVine] = false;
- Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.feather.crewmanClimbingVine, "stndw");
+ Common::String anim = getCrewmanAnimFilename(_roomVar.feather.crewmanClimbingVine, "stndw");
loadActorAnim2(_roomVar.feather.crewmanClimbingVine, anim, VINE_BOT_X, VINE_BOT_Y);
switch (_roomVar.feather.crewmanClimbingVine) {
@@ -667,7 +667,7 @@ void Room::feather1LookAtRedshirt() {
}
void Room::feather1LookAtLeftVine() {
- if (_vm->_awayMission.feather.vineState == 0)
+ if (_awayMission->feather.vineState == 0)
showText(TX_FEA1N012);
else
showText(TX_FEA1N015);
diff --git a/engines/startrek/rooms/feather3.cpp b/engines/startrek/rooms/feather3.cpp
index ebdf48a..0b3a1ce 100644
--- a/engines/startrek/rooms/feather3.cpp
+++ b/engines/startrek/rooms/feather3.cpp
@@ -97,20 +97,20 @@ void Room::feather3Tick1() {
playVoc("FEA3LOOP");
playMidiMusicTracks(27);
- if (!_vm->_awayMission.feather.tlaoxacTestPassed) {
+ if (!_awayMission->feather.tlaoxacTestPassed) {
loadActorAnim(OBJECT_TLAOXAC, "s5r3as", 0x2e, 0xab);
loadMapFile("feath3b");
- } else if (!_vm->_awayMission.feather.tookKnife)
+ } else if (!_awayMission->feather.tookKnife)
loadActorAnim(OBJECT_KNIFE, "s5r3nf", 0x64, 0xb4);
}
void Room::feather3Tick40() {
- if (!_vm->_awayMission.feather.tlaoxacTestPassed)
+ if (!_awayMission->feather.tlaoxacTestPassed)
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_036);
}
void Room::feather3TouchedHotspot0() { // Tlaoxac prevents you from passing this point
- if (!_vm->_awayMission.feather.tlaoxacTestPassed)
+ if (!_awayMission->feather.tlaoxacTestPassed)
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_035);
}
@@ -128,12 +128,12 @@ void Room::feather3UseMccoyOnTlaoxac() {
}
void Room::feather3UseRedshirtOnTlaoxac() {
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_STRAGEY, TX_FEA3_029);
}
void Room::feather3UseCrewmanOnLeftExit() {
- if (!_vm->_awayMission.feather.tlaoxacTestPassed)
+ if (!_awayMission->feather.tlaoxacTestPassed)
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_041);
}
@@ -142,14 +142,14 @@ void Room::feather3UseCommunicator() {
}
void Room::feather3UseSnakeOnKirk() {
- if (!_vm->_awayMission.feather.tlaoxacTestPassed && !_vm->_awayMission.redshirtDead) {
- if (_roomVar.feather.showedSnakeToTlaoxac && _vm->_awayMission.feather.numRocksThrownAtTlaoxac == 0) {
+ if (!_awayMission->feather.tlaoxacTestPassed && !_awayMission->redshirtDead) {
+ if (_roomVar.feather.showedSnakeToTlaoxac && _awayMission->feather.numRocksThrownAtTlaoxac == 0) {
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_043);
- _vm->_awayMission.feather.tlaoxacTestPassed = true;
- _vm->_awayMission.feather.missionScore += 2;
+ _awayMission->feather.tlaoxacTestPassed = true;
+ _awayMission->feather.missionScore += 2;
loadMapFile("feather3");
loadActorAnim(OBJECT_KNIFE, "s5r3nf", KNIFE_X, KNIFE_Y);
- _vm->_awayMission.feather.field2e = true;
+ _awayMission->feather.field2e = true;
} else
showText(TX_FEA3N004);
}
@@ -163,26 +163,26 @@ void Room::feather3UseSnakeOnSpock() {
}
void Room::feather3UseSnakeOnRedshirt() {
- if (!_vm->_awayMission.feather.tlaoxacTestPassed && !_vm->_awayMission.redshirtDead) {
- if (_roomVar.feather.showedSnakeToTlaoxac && _vm->_awayMission.feather.numRocksThrownAtTlaoxac == 0) {
+ if (!_awayMission->feather.tlaoxacTestPassed && !_awayMission->redshirtDead) {
+ if (_roomVar.feather.showedSnakeToTlaoxac && _awayMission->feather.numRocksThrownAtTlaoxac == 0) {
walkCrewmanC(OBJECT_KIRK, 0x7c, 0xbc, &Room::feather3KirkReachedRedshirtWithSnake);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
} else
showText(TX_SPEAKER_STRAGEY, TX_FEA3_031);
}
}
void Room::feather3KirkReachedRedshirtWithSnake() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_STRAGEY, TX_FEA3_034);
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_044);
- _vm->_awayMission.feather.tlaoxacTestPassed = true;
- _vm->_awayMission.feather.missionScore += 1;
+ _awayMission->feather.tlaoxacTestPassed = true;
+ _awayMission->feather.missionScore += 1;
loadMapFile("feather3");
loadActorAnim(OBJECT_KNIFE, "s5r3nf", KNIFE_X, KNIFE_Y);
- _vm->_awayMission.feather.field2e = true;
+ _awayMission->feather.field2e = true;
}
void Room::feather3UseSnakeOnMccoy() {
@@ -190,12 +190,12 @@ void Room::feather3UseSnakeOnMccoy() {
}
void Room::feather3UseSnakeOnTlaoxac() {
- if (!_vm->_awayMission.feather.tlaoxacTestPassed && _vm->_awayMission.feather.numRocksThrownAtTlaoxac == 0) {
+ if (!_awayMission->feather.tlaoxacTestPassed && _awayMission->feather.numRocksThrownAtTlaoxac == 0) {
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_039);
_roomVar.feather.showedSnakeToTlaoxac = true;
- if (!_vm->_awayMission.feather.showedSnakeToTlaoxac) {
- _vm->_awayMission.feather.showedSnakeToTlaoxac = true;
- _vm->_awayMission.feather.missionScore += 1;
+ if (!_awayMission->feather.showedSnakeToTlaoxac) {
+ _awayMission->feather.showedSnakeToTlaoxac = true;
+ _awayMission->feather.missionScore += 1;
}
}
}
@@ -209,7 +209,7 @@ void Room::feather3UseKnifeOnMccoy() {
}
void Room::feather3UseKnifeOnRedshirt() {
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_STRAGEY, TX_FEA3_033); // BUGFIX: Speaker is Stragey, not Spock.
}
@@ -217,28 +217,28 @@ void Room::feather3UseRockOnTlaoxac() {
if (_roomVar.feather.tlaoxacUnconscious)
showText(TX_SPEAKER_MCCOY, TX_FEA3_009);
else {
- _vm->_awayMission.feather.numRocksThrownAtTlaoxac++;
- _vm->_awayMission.disableInput = true;
+ _awayMission->feather.numRocksThrownAtTlaoxac++;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0xac, 0xb4, &Room::feather3KirkReachedPositionToThrowRock);
}
}
void Room::feather3KirkReachedPositionToThrowRock() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
loadActorAnim2(OBJECT_KIRK, "s5r3kt");
loadActorAnim(OBJECT_ROCK, "s5r3rt", 0x80, 0x7e);
- _vm->_awayMission.timers[4] = 21;
+ _awayMission->timers[4] = 21;
- if (_vm->_awayMission.feather.numRocksThrownAtTlaoxac == 2) {
- _vm->_awayMission.feather.knockedOutTlaoxac = true;
- _vm->_awayMission.feather.missionScore -= 2;
+ if (_awayMission->feather.numRocksThrownAtTlaoxac == 2) {
+ _awayMission->feather.knockedOutTlaoxac = true;
+ _awayMission->feather.missionScore -= 2;
loadActorAnimC(OBJECT_TLAOXAC, "s5r3ad", -1, -1, &Room::feather3TlaoxacKnockedOutFromRockThrow);
playVoc("ROCKFACE");
- _vm->_awayMission.timers[2] = 24;
+ _awayMission->timers[2] = 24;
} else {
loadActorAnim2(OBJECT_TLAOXAC, "s5r3ah");
playVoc("ROCKFACE");
- _vm->_awayMission.timers[3] = 97;
+ _awayMission->timers[3] = 97;
}
}
@@ -247,24 +247,24 @@ void Room::feather3Timer4Expired() {
}
void Room::feather3Timer2Expired() {
- if (!_vm->_awayMission.feather.tookKnife)
+ if (!_awayMission->feather.tookKnife)
loadActorAnim(OBJECT_KNIFE, "s5r3nf", KNIFE_X, KNIFE_Y);
}
void Room::feather3Timer3Expired() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
}
void Room::feather3TlaoxacKnockedOutFromRockThrow() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_FEA3N006);
- if (!_vm->_awayMission.feather.tookKnife && !_vm->_awayMission.feather.field2e)
+ if (!_awayMission->feather.tookKnife && !_awayMission->feather.field2e)
showText(TX_SPEAKER_MCCOY, TX_FEA3_008);
- _vm->_awayMission.feather.tlaoxacTestPassed = true;
+ _awayMission->feather.tlaoxacTestPassed = true;
_roomVar.feather.tlaoxacUnconscious = true;
loadMapFile("feather3");
}
@@ -282,15 +282,15 @@ void Room::feather3TalkToSpock() {
}
void Room::feather3TalkToRedshirt() {
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_STRAGEY, TX_FEA3_032);
}
void Room::feather3TalkToTlaoxac() {
- if (!_vm->_awayMission.feather.tlaoxacTestPassed && !_vm->_awayMission.redshirtDead && !_roomVar.feather.tlaoxacUnconscious) {
+ if (!_awayMission->feather.tlaoxacTestPassed && !_awayMission->redshirtDead && !_roomVar.feather.tlaoxacUnconscious) {
if (!_roomVar.feather.showedSnakeToTlaoxac)
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_038);
- else if (_vm->_awayMission.feather.numRocksThrownAtTlaoxac != 0)
+ else if (_awayMission->feather.numRocksThrownAtTlaoxac != 0)
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_038);
else {
const TextRef choices[] = {
@@ -306,11 +306,11 @@ void Room::feather3TalkToTlaoxac() {
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_042);
else if (choice == 2) { // Accidentally insulted Quetzecoatl
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_040);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadActorAnimC(OBJECT_TLAOXAC, "s5r3aj", -1, -1, &Room::feather3TlaoxacKilledRedshirt);
playMidiMusicTracks(2);
loadActorAnim(OBJECT_REDSHIRT, "s5r3rd");
- _vm->_awayMission.redshirtDead = true;
+ _awayMission->redshirtDead = true;
} else
showText(TX_DIALOG_ERROR);
}
@@ -318,7 +318,7 @@ void Room::feather3TalkToTlaoxac() {
}
void Room::feather3TlaoxacKilledRedshirt() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::feather3UseMTricorderOnTlaoxac() {
@@ -329,12 +329,12 @@ void Room::feather3UseMTricorderOnTlaoxac() {
}
void Room::feather3UseMedkitOnTlaoxac() {
- if (_vm->_awayMission.feather.knockedOutTlaoxac)
+ if (_awayMission->feather.knockedOutTlaoxac)
showText(TX_SPEAKER_MCCOY, TX_FEA3_012);
}
void Room::feather3UseMedkitOnRedshirt() {
- if (_vm->_awayMission.redshirtDead) {
+ if (_awayMission->redshirtDead) {
// BUGFIX: Original voice clip (TX_FEA3_030) is someone who's clearly not Kelley
// saying "he's dead, Jim". He recorded the line a few other times, so use one of
// those instead.
@@ -359,14 +359,14 @@ void Room::feather3UseSTricorderAnywhere() {
}
void Room::feather3GetKnife() {
- _vm->_awayMission.feather.missionScore += 1;
+ _awayMission->feather.missionScore += 1;
walkCrewmanC(OBJECT_KIRK, 0x57, 0xb4, &Room::feather3ReachedKnife);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::feather3ReachedKnife() {
loadActorAnimC(OBJECT_KIRK, "s5r1kg", -1, -1, &Room::feather3PickedUpKnife);
- _vm->_awayMission.timers[1] = 20;
+ _awayMission->timers[1] = 20;
}
void Room::feather3Timer1Expired() {
@@ -375,27 +375,27 @@ void Room::feather3Timer1Expired() {
}
void Room::feather3PickedUpKnife() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_FEA3N010);
}
void Room::feather3LookAtSpock() {
- if (!_vm->_awayMission.feather.knockedOutTlaoxac && !_vm->_awayMission.feather.tlaoxacTestPassed)
+ if (!_awayMission->feather.knockedOutTlaoxac && !_awayMission->feather.tlaoxacTestPassed)
showText(TX_FEA3N002);
else // ENHANCEMENT: Originally did nothing here. Fall back to default behaviour in the engine.
- _vm->_awayMission.rdfStillDoDefaultAction = true;
+ _awayMission->rdfStillDoDefaultAction = true;
}
void Room::feather3LookAtRedshirt() {
- if (_vm->_awayMission.redshirtDead)
+ if (_awayMission->redshirtDead)
showText(TX_FEA3N005);
else
showText(TX_FEA3N012);
}
void Room::feather3LookAtTlaoxac() {
- if (_vm->_awayMission.feather.knockedOutTlaoxac)
+ if (_awayMission->feather.knockedOutTlaoxac)
showText(TX_FEA3N003);
else
showText(TX_FEA3N007);
diff --git a/engines/startrek/rooms/feather5.cpp b/engines/startrek/rooms/feather5.cpp
index a8ca002..f1da463 100644
--- a/engines/startrek/rooms/feather5.cpp
+++ b/engines/startrek/rooms/feather5.cpp
@@ -118,16 +118,16 @@ void Room::feather5Tick1() {
playVoc("FEA5LOOP");
playMidiMusicTracks(29);
- if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ if (!_awayMission->feather.waterMonsterRetreated)
loadActorAnim(OBJECT_MONSTER, "s5r5os", 0x4e, 0xa4);
else
loadMapFile("feath5b");
}
void Room::feather5TouchedHotspot0() { // Approached the log
- if (!_vm->_awayMission.feather.waterMonsterRetreated) {
+ if (!_awayMission->feather.waterMonsterRetreated) {
showText(TX_SPEAKER_SPOCK, TX_FEA5_005);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_STRAGEY, TX_FEA5_033);
}
}
@@ -145,9 +145,9 @@ void Room::feather5UseRedshirtOnFern() {
}
void Room::feather5UseRedshirtOnLeftExit() {
- if (!_vm->_awayMission.feather.waterMonsterRetreated) {
+ if (!_awayMission->feather.waterMonsterRetreated) {
showText(TX_SPEAKER_STRAGEY, TX_FEA5_034);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadMapFile("feath5b");
walkCrewmanC(OBJECT_REDSHIRT, 0x8f, 0x64, &Room::feather5RedshirtReachedLog);
}
@@ -158,22 +158,22 @@ void Room::feather5RedshirtReachedLog() {
playVoc("TENTICL2");
loadActorAnim(OBJECT_MONSTER, "s5r5oh", 0x4e, 0xa4);
loadActorAnimC(OBJECT_REDSHIRT, "s5r5ol", 0x8f, 0x64, &Room::feather5RedshirtDeathFinished);
- _vm->_awayMission.feather.waterMonsterRetreated = true;
- _vm->_awayMission.redshirtDead = true;
+ _awayMission->feather.waterMonsterRetreated = true;
+ _awayMission->redshirtDead = true;
}
void Room::feather5RedshirtDeathFinished() {
loadActorStandAnim(OBJECT_REDSHIRT);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::feather5UseSpockOnLeftExit() {
- if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ if (!_awayMission->feather.waterMonsterRetreated)
showText(TX_SPEAKER_SPOCK, TX_FEA5_002);
}
void Room::feather5UseMccoyOnLeftExit() {
- if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ if (!_awayMission->feather.waterMonsterRetreated)
showText(TX_SPEAKER_MCCOY, TX_FEA5_015);
}
@@ -231,11 +231,11 @@ void Room::feather5GetFern() {
}
void Room::feather5UseKnifeOnFern() {
- if (_vm->_awayMission.feather.gotFern)
+ if (_awayMission->feather.gotFern)
showText(TX_FEA5N015);
else {
walkCrewmanC(OBJECT_KIRK, 0x106, 0x8a, &Room::feather5ReachedFern);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
}
@@ -244,18 +244,18 @@ void Room::feather5ReachedFern() {
}
void Room::feather5PickedUpFern() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
giveItem(OBJECT_IFERN);
- _vm->_awayMission.feather.gotFern = true;
+ _awayMission->feather.gotFern = true;
}
void Room::feather5UseFernOnMonster() {
// BUG: Infinite score mechanism. Just keep throwing ferns into the water.
- _vm->_awayMission.feather.missionScore += 2;
+ _awayMission->feather.missionScore += 2;
walkCrewmanC(OBJECT_KIRK, 0x106, 0x8a, &Room::feather5ReachedPositionToUseFern);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::feather5ReachedPositionToUseFern() {
@@ -264,16 +264,16 @@ void Room::feather5ReachedPositionToUseFern() {
}
void Room::feather5DoneThrowingFern() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
loseItem(OBJECT_IFERN);
- _vm->_awayMission.feather.gotFern = false;
+ _awayMission->feather.gotFern = false;
}
void Room::feather5FernFellIntoWater() {
- if (!_vm->_awayMission.feather.waterMonsterRetreated) {
- _vm->_awayMission.feather.waterMonsterRetreated = true;
- _vm->_awayMission.timers[1] = 20;
+ if (!_awayMission->feather.waterMonsterRetreated) {
+ _awayMission->feather.waterMonsterRetreated = true;
+ _awayMission->timers[1] = 20;
loadActorStandAnim(OBJECT_MONSTER);
loadMapFile("feath5b");
}
@@ -351,24 +351,24 @@ void Room::feather5LookAtSpock() {
}
void Room::feather5LookAtKirk() {
- if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ if (!_awayMission->feather.waterMonsterRetreated)
showText(TX_FEA5N001);
else // ENHANCEMENT: Fall back to default behaviour instead of doing nothing
- _vm->_awayMission.rdfStillDoDefaultAction = true;
+ _awayMission->rdfStillDoDefaultAction = true;
}
void Room::feather5LookAtMccoy() {
- if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ if (!_awayMission->feather.waterMonsterRetreated)
showText(TX_FEA5N002);
else // ENHANCEMENT: Fall back to default behaviour instead of doing nothing
- _vm->_awayMission.rdfStillDoDefaultAction = true;
+ _awayMission->rdfStillDoDefaultAction = true;
}
void Room::feather5LookAtRedshirt() {
- if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ if (!_awayMission->feather.waterMonsterRetreated)
showText(TX_FEA5N004);
else // ENHANCEMENT: Fall back to default behaviour instead of doing nothing
- _vm->_awayMission.rdfStillDoDefaultAction = true;
+ _awayMission->rdfStillDoDefaultAction = true;
}
void Room::feather5TalkToMccoy() {
@@ -384,7 +384,7 @@ void Room::feather5TalkToRedshirt() {
}
void Room::feather5UseMTricorderOnWater() {
- if (_vm->_awayMission.feather.waterMonsterRetreated)
+ if (_awayMission->feather.waterMonsterRetreated)
mccoyScan(DIR_W, TX_FEA5_011);
else
mccoyScan(DIR_W, TX_FEA5_014);
@@ -403,7 +403,7 @@ void Room::feather5UseSTricorderAnywhere() {
}
void Room::feather5UseSTricorderOnWater() {
- if (_vm->_awayMission.feather.waterMonsterRetreated)
+ if (_awayMission->feather.waterMonsterRetreated)
spockScan(DIR_W, TX_FEA5_031);
else
spockScan(DIR_W, TX_FEA5_030);
diff --git a/engines/startrek/rooms/feather6.cpp b/engines/startrek/rooms/feather6.cpp
index 204d349..8ae54d1 100644
--- a/engines/startrek/rooms/feather6.cpp
+++ b/engines/startrek/rooms/feather6.cpp
@@ -126,7 +126,7 @@ void Room::feather6UseRedshirtOnCrystals() {
void Room::feather6UseRockOnStalactites() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0x94, 0x97, &Room::feather6ReachedPositionToThrowRock);
}
@@ -143,21 +143,21 @@ void Room::feather6DoneThrowingRock() {
}
void Room::feather6KirkDiedFromStalactites() {
- _vm->_awayMission.feather.missionScore -= 3;
- _vm->_awayMission.feather.diedFromStalactites = true;
- _vm->_awayMission.disableInput = false;
+ _awayMission->feather.missionScore -= 3;
+ _awayMission->feather.diedFromStalactites = true;
+ _awayMission->disableInput = false;
showText(TX_FEA6N000);
showText(TX_FEA6N004);
loadRoomIndex(7, 5);
}
void Room::feather6UseRockOnCrystals() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0x9a, 0x97, &Room::feather6ReachedCrystalsWithRock);
}
void Room::feather6ReachedCrystalsWithRock() {
- _vm->_awayMission.timers[2] = 174;
+ _awayMission->timers[2] = 174;
loadActorAnim2(OBJECT_STALACTITES, "s5r6tm");
if (!_roomVar.feather.usedRockOnCrystalsOnce) {
_roomVar.feather.usedRockOnCrystalsOnce = true;
@@ -167,12 +167,12 @@ void Room::feather6ReachedCrystalsWithRock() {
}
void Room::feather6Tick() {
- if (_vm->_awayMission.timers[2] == 55 || _vm->_awayMission.timers[2] == 89 || _vm->_awayMission.timers[2] == 119)
+ if (_awayMission->timers[2] == 55 || _awayMission->timers[2] == 89 || _awayMission->timers[2] == 119)
playSoundEffectIndex(SND_BLANK_0b);
}
void Room::feather6HitCrystalsWithRockFirstTime() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_SPEAKER_KIRK, TX_FEA6_001);
}
@@ -302,7 +302,7 @@ void Room::feather6TalkToRedshirt() {
}
void Room::feather6TalkToSpock() {
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_SPOCK, TX_FEA6_035);
else {
showText(TX_SPEAKER_SPOCK, TX_FEA6_038);
@@ -361,19 +361,19 @@ void Room::feather6GetCrystals() {
}
void Room::feather6UseKnifeOnCrystals() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0x9a, 0x97, &Room::feather6ReachedCrystalsWithKnife);
}
void Room::feather6ReachedCrystalsWithKnife() {
loadActorAnimC(OBJECT_KIRK, "s5r6kp", -1, -1, &Room::feather6DoneCuttingCrystals);
- _vm->_awayMission.timers[4] = 122;
+ _awayMission->timers[4] = 122;
}
void Room::feather6DoneCuttingCrystals() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
- _vm->_awayMission.feather.missionScore += 1;
+ _awayMission->feather.missionScore += 1;
giveItem(OBJECT_ICRYSTAL);
showText(TX_FEA6N017);
}
diff --git a/engines/startrek/rooms/feather7.cpp b/engines/startrek/rooms/feather7.cpp
index 3527014..1641ddf 100644
--- a/engines/startrek/rooms/feather7.cpp
+++ b/engines/startrek/rooms/feather7.cpp
@@ -43,22 +43,22 @@ extern const int feather7NumActions = sizeof(feather7ActionList) / sizeof(RoomAc
void Room::feather7Tick1() {
playVoc("FEA7LOOP");
playMidiMusicTracks(33);
- _vm->_awayMission.disableInput = 2;
+ _awayMission->disableInput = 2;
loadActorAnim(OBJECT_QUETZECOATL, "s5r7qn", 0x106, 0x98);
}
void Room::feather7Tick40() {
- if (_vm->_awayMission.feather.diedFromStalactites)
+ if (_awayMission->feather.diedFromStalactites)
showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_017);
showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_022);
- if (_vm->_awayMission.redshirtDead)
+ if (_awayMission->redshirtDead)
showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_021);
// BUGFIX: Show this even if redshirt isn't dead (he wishes you wouldn't have knocked
// out Tlaoxac)
- if (_vm->_awayMission.feather.knockedOutTlaoxac)
+ if (_awayMission->feather.knockedOutTlaoxac)
showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_023);
showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_027);
@@ -146,19 +146,19 @@ void Room::feather7KirkSatDown() {
}
void Room::feather7ReadyToBeamOut() {
- if (_vm->_awayMission.redshirtDead)
+ if (_awayMission->redshirtDead)
showText(TX_SPEAKER_KIRK, TX_FEA7_002);
else {
- _vm->_awayMission.feather.missionScore += 1;
+ _awayMission->feather.missionScore += 1;
showText(TX_SPEAKER_KIRK, TX_FEA7_001);
}
if (!_roomVar.feather.insultedQuetzecoatl)
- _vm->_awayMission.feather.missionScore += 2;
- _vm->_awayMission.feather.missionScore += 4;
+ _awayMission->feather.missionScore += 2;
+ _awayMission->feather.missionScore += 4;
loadActorAnim2(OBJECT_QUETZECOATL, "s5r7qt");
- endMission(_vm->_awayMission.feather.missionScore, 0x13, 0);
+ endMission(_awayMission->feather.missionScore, 0x13, 0);
}
}
diff --git a/engines/startrek/rooms/love0.cpp b/engines/startrek/rooms/love0.cpp
index 49ba136..1ad949b 100644
--- a/engines/startrek/rooms/love0.cpp
+++ b/engines/startrek/rooms/love0.cpp
@@ -36,17 +36,17 @@ void Room::love0Tick1() {
// BUGFIX: moved this out of the if statement below.
playVoc("LOV0LOOP");
- if (!_vm->_awayMission.love.alreadyStartedMission) {
- _vm->_awayMission.love.canister1 = CANTYPE_O2;
- _vm->_awayMission.love.canister2 = CANTYPE_H2;
- _vm->_awayMission.love.alreadyStartedMission = true;
+ if (!_awayMission->love.alreadyStartedMission) {
+ _awayMission->love.canister1 = CANTYPE_O2;
+ _awayMission->love.canister2 = CANTYPE_H2;
+ _awayMission->love.alreadyStartedMission = true;
}
- if (_vm->_awayMission.love.releasedHumanLaughingGas)
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.releasedRomulanLaughingGas)
- _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
- _vm->_awayMission.timers[2] = 200;
+ if (_awayMission->love.releasedHumanLaughingGas)
+ _awayMission->timers[0] = getRandomWordInRange(200, 400);
+ if (_awayMission->love.releasedRomulanLaughingGas)
+ _awayMission->timers[1] = getRandomWordInRange(200, 400);
+ _awayMission->timers[2] = 200;
loadActorAnim(OBJECT_DOOR2, "s3r0d2a", 0xe6, 0x80, 0);
loadActorAnim(OBJECT_DOOR1, "s3r0d1a", 0x123, 0x8d, 0);
@@ -59,10 +59,10 @@ void Room::love0Tick10() {
}
void Room::love0WalkToDoor2() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.love.walkingToDoor = 2;
walkCrewman(OBJECT_KIRK, 0xe6, 0x81, 4);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love0OpenDoor2() {
@@ -79,7 +79,7 @@ void Room::love0ReachedDoor2() {
}
void Room::love0WalkToDoor1() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.love.walkingToDoor = 1;
walkCrewman(OBJECT_KIRK, 0x125, 0x8d, 5);
}
@@ -150,7 +150,7 @@ void Room::love0TalkToRedshirt() {
}
void Room::love0UseMTricorderAnywhere() {
- if (_vm->_awayMission.love.knowAboutVirus)
+ if (_awayMission->love.knowAboutVirus)
mccoyScan(DIR_N, TX_LOV0_008, false);
else
mccoyScan(DIR_N, TX_LOV0_006, false);
@@ -180,9 +180,9 @@ void Room::love0UseSpockOnConsole() {
strcpy(_roomVar.love.consoleAnimation, "susemn");
walkCrewman(_roomVar.love.consoleCrewman, 0x9a, 0x9a, 2);
- if (!_vm->_awayMission.love.spockAccessedConsole) {
- _vm->_awayMission.love.spockAccessedConsole = true;
- _vm->_awayMission.love.missionScore += 4;
+ if (!_awayMission->love.spockAccessedConsole) {
+ _awayMission->love.spockAccessedConsole = true;
+ _awayMission->love.missionScore += 4;
}
}
@@ -192,7 +192,7 @@ void Room::love0SpockReachedConsole() {
void Room::love0SpockAccessedConsole() {
playVoc("V6KIRKTY");
- if (_vm->_awayMission.love.knowAboutVirus)
+ if (_awayMission->love.knowAboutVirus)
love0InteractWithConsole();
else {
showText(TX_SPEAKER_COMPUTER, TX_COMPU188);
@@ -211,12 +211,12 @@ void Room::love0MccoyReachedConsole() {
void Room::love0MccoyAccessedConsole() {
playVoc("V6KIRKTY");
- if (!_vm->_awayMission.love.mccoyAccessedConsole) {
- _vm->_awayMission.love.mccoyAccessedConsole = true;
- _vm->_awayMission.love.missionScore += 2;
+ if (!_awayMission->love.mccoyAccessedConsole) {
+ _awayMission->love.mccoyAccessedConsole = true;
+ _awayMission->love.missionScore += 2;
}
- if (_vm->_awayMission.love.knowAboutVirus)
+ if (_awayMission->love.knowAboutVirus)
love0InteractWithConsole();
else {
if (!_roomVar.love.heardSummaryOfVirus) {
@@ -228,7 +228,7 @@ void Room::love0MccoyAccessedConsole() {
showText(TX_SPEAKER_MCCOY, TX_LOV0_023);
showText(TX_SPEAKER_KIRK, TX_LOV0_004);
showText(TX_SPEAKER_MCCOY, TX_LOV0_009);
- _vm->_awayMission.love.knowAboutVirus = true;
+ _awayMission->love.knowAboutVirus = true;
}
}
diff --git a/engines/startrek/rooms/love1.cpp b/engines/startrek/rooms/love1.cpp
index 612cd8c..be7ffc9 100644
--- a/engines/startrek/rooms/love1.cpp
+++ b/engines/startrek/rooms/love1.cpp
@@ -46,18 +46,18 @@ namespace StarTrek {
void Room::love1Tick1() {
playVoc("LOV1LOOP");
- if (_vm->_awayMission.love.freezerOpen)
+ if (_awayMission->love.freezerOpen)
loadActorAnim(OBJECT_FREEZER, "s3r2d4o", 0x67, 0x8d, 0);
- if (_vm->_awayMission.love.chamberHasDish)
+ if (_awayMission->love.chamberHasDish)
loadActorAnim(OBJECT_CHAMBER, "s3r2d5o", 0xb4, 0x75, 0);
else
loadActorAnim(OBJECT_CHAMBER, "s3r2d5c", 0xb4, 0x75, 0);
- if (_vm->_awayMission.love.chamberHasDish)
+ if (_awayMission->love.chamberHasDish)
loadActorAnim(OBJECT_DISH_IN_CHAMBER, "dishes", 0xb4, 0x71, 0);
- switch (_vm->_awayMission.love.bottleInNozzle) {
+ switch (_awayMission->love.bottleInNozzle) {
case BOTTLETYPE_N2O:
strcpy(_roomVar.love.bottleAnimation, "btle1");
_roomVar.love.itemInNozzle = OBJECT_IN2O;
@@ -83,11 +83,11 @@ common:
break;
}
- if (_vm->_awayMission.love.releasedHumanLaughingGas)
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.releasedRomulanLaughingGas)
- _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
- _vm->_awayMission.timers[2] = 200;
+ if (_awayMission->love.releasedHumanLaughingGas)
+ _awayMission->timers[0] = getRandomWordInRange(200, 400);
+ if (_awayMission->love.releasedRomulanLaughingGas)
+ _awayMission->timers[1] = getRandomWordInRange(200, 400);
+ _awayMission->timers[2] = 200;
loadActorAnim(OBJECT_DOOR3, "s3r2d3a", 0xdb, 0x7e, 0);
loadActorAnim(OBJECT_DOOR1, "s3r2d1a", 0, 0, 0);
@@ -98,7 +98,7 @@ common:
}
void Room::love1WalkToDoor3() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.love.walkingToDoor = true;
walkCrewman(OBJECT_KIRK, 0xd9, 0x81, 15);
}
@@ -118,7 +118,7 @@ void Room::love1ReachedDoor3() {
}
void Room::love1WalkToDoor1() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.love.walkingToDoor = true;
walkCrewman(OBJECT_KIRK, 0x42, 0x97, 16);
}
@@ -138,7 +138,7 @@ void Room::love1ReachedDoor1() {
}
void Room::love1WalkToDoor2() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.love.walkingToDoor = true;
walkCrewman(OBJECT_KIRK, 0x79, 0x85, 17);
}
@@ -202,7 +202,7 @@ void Room::love1LookAtDistillator() {
}
void Room::love1LookAtChamber() {
- if (_vm->_awayMission.love.chamberHasCure)
+ if (_awayMission->love.chamberHasCure)
showText(TX_LOV1N013);
else
showText(TX_LOV1N014);
@@ -213,7 +213,7 @@ void Room::love1LookAtReplicator() {
}
void Room::love1LookAtFreezer() {
- if (_vm->_awayMission.love.freezerOpen)
+ if (_awayMission->love.freezerOpen)
showText(TX_LOV1N023);
else
showText(TX_LOV1N018);
@@ -245,7 +245,7 @@ void Room::love1UseMTricorderOnDishes() {
}
void Room::love1UseMTricorderAnywhere() {
- if (_vm->_awayMission.love.knowAboutVirus)
+ if (_awayMission->love.knowAboutVirus)
mccoyScan(DIR_S, TX_LOV1_009, false);
else
mccoyScan(DIR_S, TX_LOV1_010, false);
@@ -281,7 +281,7 @@ void Room::love1GetFreezer() {
}
void Room::love1KirkReachedFreezer() {
- if (_vm->_awayMission.love.freezerOpen)
+ if (_awayMission->love.freezerOpen)
loadActorAnim2(OBJECT_KIRK, "kusehw", -1, -1, 9);
else
showText(TX_LOV1N010);
@@ -293,7 +293,7 @@ void Room::love1KirkGotVirusCulture() {
}
void Room::love1GetFromChamber() {
- if (!_vm->_awayMission.love.chamberHasDish)
+ if (!_awayMission->love.chamberHasDish)
showText(TX_LOV1N009);
else
walkCrewman(OBJECT_KIRK, 0xb5, 0x8c, 8);
@@ -304,13 +304,13 @@ void Room::love1KirkReachedChamber() {
}
void Room::love1KirkGotCureSample() {
- if (_vm->_awayMission.love.chamberHasCure) {
+ if (_awayMission->love.chamberHasCure) {
giveItem(OBJECT_ISAMPLE);
showText(TX_LOV1N035);
// BUGFIX: after removing the cure, unset this variable.
// Otherwise, any normal dish inserted afterward automagically becomes a cure.
- _vm->_awayMission.love.chamberHasCure = false;
+ _awayMission->love.chamberHasCure = false;
} else {
giveItem(OBJECT_IDISHES);
showText(TX_LOV1N006);
@@ -319,7 +319,7 @@ void Room::love1KirkGotCureSample() {
loadActorStandAnim(OBJECT_DISH_IN_CHAMBER);
loadActorAnim2(OBJECT_CHAMBER, "s3r2d6", 0xb4, 0x75, 0);
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.love.chamberHasDish = false;
+ _awayMission->love.chamberHasDish = false;
}
void Room::love1GetFromNozzle() {
@@ -327,14 +327,14 @@ void Room::love1GetFromNozzle() {
}
void Room::love1KirkReachedNozzleToGet() {
- if (_vm->_awayMission.love.bottleInNozzle == 0)
+ if (_awayMission->love.bottleInNozzle == 0)
showText(TX_LOV1N011);
else
loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 11);
}
void Room::love1KirkGotBottleFromNozzle() {
- switch (_vm->_awayMission.love.bottleInNozzle) {
+ switch (_awayMission->love.bottleInNozzle) {
case BOTTLETYPE_N2O:
giveItem(OBJECT_IN2O);
break;
@@ -352,44 +352,44 @@ void Room::love1KirkGotBottleFromNozzle() {
break;
}
- _vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_NONE;
+ _awayMission->love.bottleInNozzle = BOTTLETYPE_NONE;
loadActorStandAnim(OBJECT_BOTTLE);
showText(TX_LOV1N007);
_roomVar.love.itemInNozzle = 0;
}
void Room::love1UseN2OOnNozzle() {
- if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
+ if (_awayMission->love.bottleInNozzle == BOTTLETYPE_NONE) {
_roomVar.love.itemInNozzle = OBJECT_IN2O;
strcpy(_roomVar.love.bottleAnimation, "btle1");
- _vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_N2O;
+ _awayMission->love.bottleInNozzle = BOTTLETYPE_N2O;
walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 3);
}
}
void Room::love1UseH2OOnNozzle() {
- if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
+ if (_awayMission->love.bottleInNozzle == BOTTLETYPE_NONE) {
_roomVar.love.itemInNozzle = OBJECT_IH2O;
strcpy(_roomVar.love.bottleAnimation, "btle3");
- _vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_H2O;
+ _awayMission->love.bottleInNozzle = BOTTLETYPE_H2O;
walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 3);
}
}
void Room::love1UseNH3OnNozzle() {
- if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
+ if (_awayMission->love.bottleInNozzle == BOTTLETYPE_NONE) {
_roomVar.love.itemInNozzle = OBJECT_INH3;
strcpy(_roomVar.love.bottleAnimation, "btle2");
- _vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_NH3;
+ _awayMission->love.bottleInNozzle = BOTTLETYPE_NH3;
walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 3);
}
}
void Room::love1UseRLGOnNozzle() {
- if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
+ if (_awayMission->love.bottleInNozzle == BOTTLETYPE_NONE) {
_roomVar.love.itemInNozzle = OBJECT_IRLG;
strcpy(_roomVar.love.bottleAnimation, "btle4");
- _vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_RLG;
+ _awayMission->love.bottleInNozzle = BOTTLETYPE_RLG;
walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 3);
}
}
@@ -420,10 +420,10 @@ void Room::love1UseMccoyOnReplicator() {
}
void Room::love1MccoyReachedReplicator() {
- if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
+ if (_awayMission->love.bottleInNozzle == BOTTLETYPE_NONE) {
showText(TX_SPEAKER_MCCOY, TX_LOV1_021);
walkCrewman(OBJECT_MCCOY, 0xbf, 0x98, 0);
- } else if (!_vm->_awayMission.love.chamberHasDish) {
+ } else if (!_awayMission->love.chamberHasDish) {
showText(TX_SPEAKER_MCCOY, TX_LOV1_015);
walkCrewman(OBJECT_MCCOY, 0xbf, 0x98, 0);
} else
@@ -450,7 +450,7 @@ void Room::love1ChamberClosed() {
void Room::love1ChamberOpened() {
loadActorAnim(OBJECT_DISH_IN_CHAMBER, "dishes", 0xb4, 0x71, 0);
showText(TX_SPEAKER_MCCOY, TX_LOV1_018);
- _vm->_awayMission.love.chamberHasCure = true;
+ _awayMission->love.chamberHasCure = true;
}
void Room::love1UseAnythingOnChamber() {
@@ -462,7 +462,7 @@ void Room::love1UseDishesOnChamber() {
}
void Room::love1KirkReachedChamberToPut() {
- if (_vm->_awayMission.love.chamberHasDish)
+ if (_awayMission->love.chamberHasDish)
showText(TX_SPEAKER_MCCOY, TX_LOV1_014); // TODO: test
else {
loadActorAnim(OBJECT_CHAMBER, "s3r2d5", 0xb4, 0x75, 1);
@@ -477,7 +477,7 @@ void Room::love1ChamberOpenedForDish() {
void Room::love1KirkPutDishInChamber() {
loadActorAnim(OBJECT_DISH_IN_CHAMBER, "dishes", 0xb4, 0x71, 0);
loseItem(OBJECT_IDISHES);
- _vm->_awayMission.love.chamberHasDish = true;
+ _awayMission->love.chamberHasDish = true;
}
void Room::love1UseInsulationOnDistillator() {
@@ -492,9 +492,9 @@ void Room::love1KirkReachedDistillator() {
void Room::love1KirkGotPolyberylcarbonate() {
// Result of using insulation on distillator
showText(TX_LOV1N034);
- if (!_vm->_awayMission.love.gotPolyberylcarbonate) {
- _vm->_awayMission.love.gotPolyberylcarbonate = true;
- _vm->_awayMission.love.missionScore++;
+ if (!_awayMission->love.gotPolyberylcarbonate) {
+ _awayMission->love.gotPolyberylcarbonate = true;
+ _awayMission->love.missionScore++;
}
giveItem(OBJECT_IPBC);
@@ -506,7 +506,7 @@ void Room::love1UseKirkOnFreezer() {
_roomVar.love.crewmanUsingFreezerRetX = 0x96;
_roomVar.love.crewmanUsingDevice = OBJECT_KIRK;
walkCrewman(_roomVar.love.crewmanUsingDevice, 0x71, 0x8e, 7);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love1UseRedshirtOnFreezer() {
@@ -514,7 +514,7 @@ void Room::love1UseRedshirtOnFreezer() {
_roomVar.love.crewmanUsingFreezerRetX = 0x95;
_roomVar.love.crewmanUsingDevice = OBJECT_REDSHIRT;
walkCrewman(_roomVar.love.crewmanUsingDevice, 0x71, 0x8e, 7);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love1UseSpockOnFreezer() {
@@ -522,7 +522,7 @@ void Room::love1UseSpockOnFreezer() {
_roomVar.love.crewmanUsingFreezerRetX = 0x61;
_roomVar.love.crewmanUsingDevice = OBJECT_SPOCK;
walkCrewman(_roomVar.love.crewmanUsingDevice, 0x71, 0x8e, 7);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love1UseMccoyOnFreezer() {
@@ -530,26 +530,26 @@ void Room::love1UseMccoyOnFreezer() {
_roomVar.love.crewmanUsingFreezerRetX = 0xbf;
_roomVar.love.crewmanUsingDevice = OBJECT_MCCOY;
walkCrewman(_roomVar.love.crewmanUsingDevice, 0x71, 0x8e, 7);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love1CrewmanReachedFreezer() {
- Common::String useAnim = _vm->getCrewmanAnimFilename(_roomVar.love.crewmanUsingDevice, "usehw");
+ Common::String useAnim = getCrewmanAnimFilename(_roomVar.love.crewmanUsingDevice, "usehw");
loadActorAnim2(_roomVar.love.crewmanUsingDevice, useAnim, -1, -1, 16);
}
void Room::love1CrewmanOpenedOrClosedFreezer() {
- if (_vm->_awayMission.love.freezerOpen)
+ if (_awayMission->love.freezerOpen)
loadActorAnim(OBJECT_FREEZER, "s3r2d4a", 0x67, 0x8d, 0);
else
loadActorAnim(OBJECT_FREEZER, "s3r2d4", 0x67, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.love.freezerOpen = !_vm->_awayMission.love.freezerOpen;
+ _awayMission->love.freezerOpen = !_awayMission->love.freezerOpen;
walkCrewman(_roomVar.love.crewmanUsingDevice, _roomVar.love.crewmanUsingFreezerRetX, _roomVar.love.crewmanUsingFreezerRetY, 0);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::love1UseAnythingOnFreezer() {
@@ -590,30 +590,30 @@ void Room::love1FinishedUsingArbitraryItemOnDistillator() {
void Room::love1UseKirkOnLadder() {
_roomVar.love.crewmanUsingDevice = OBJECT_KIRK;
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
walkCrewman(_roomVar.love.crewmanUsingDevice, 0x102, 0x89, 1);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love1UseSpockOnLadder() {
_roomVar.love.crewmanUsingDevice = OBJECT_SPOCK;
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
walkCrewman(_roomVar.love.crewmanUsingDevice, 0x102, 0x89, 1);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love1UseMccoyOnLadder() {
_roomVar.love.crewmanUsingDevice = OBJECT_MCCOY;
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
walkCrewman(_roomVar.love.crewmanUsingDevice, 0x102, 0x89, 1);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love1UseRedshirtOnLadder() {
_roomVar.love.crewmanUsingDevice = OBJECT_REDSHIRT;
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
walkCrewman(_roomVar.love.crewmanUsingDevice, 0x102, 0x89, 1);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love1CrewmanReachedLadder() {
@@ -624,13 +624,13 @@ void Room::love1CrewmanReachedLadder() {
TX_SPEAKER_FERRIS
};
- if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas || _vm->_awayMission.love.romulansUnconsciousFromVirus) // Romulans unconscious
+ if (_awayMission->love.romulansUnconsciousFromLaughingGas || _awayMission->love.romulansUnconsciousFromVirus) // Romulans unconscious
loadRoomIndex(4, 3);
else { // Romulans still conscious, they shoot you
loadActorAnim(OBJECT_PHASERSHOT, "s3r2s2", 0xf3, 0x89, 0);
playSoundEffectIndex(SND_PHASSHOT);
- Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love.crewmanUsingDevice, "killw");
+ Common::String anim = getCrewmanAnimFilename(_roomVar.love.crewmanUsingDevice, "killw");
loadActorAnim(_roomVar.love.crewmanUsingDevice, anim, 0x102, 0x89, 6);
_roomVar.love.dyingSpeaker = speakers[_roomVar.love.crewmanUsingDevice];
}
@@ -638,9 +638,9 @@ void Room::love1CrewmanReachedLadder() {
void Room::love1CrewmanDiedFromPhaser() {
if (_roomVar.love.crewmanUsingDevice == OBJECT_REDSHIRT) {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_FERRIS, TX_LOV1_024);
- _vm->_awayMission.redshirtDead = true;
+ _awayMission->redshirtDead = true;
} else {
showText(_roomVar.love.dyingSpeaker, TX_LOV1_025);
showGameOverMenu();
@@ -649,11 +649,11 @@ void Room::love1CrewmanDiedFromPhaser() {
// Romulans fire a "warning shot" when you go to the right part of the room.
void Room::love1TouchedHotspot0() {
- if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas || _vm->_awayMission.love.romulansUnconsciousFromVirus)
+ if (_awayMission->love.romulansUnconsciousFromLaughingGas || _awayMission->love.romulansUnconsciousFromVirus)
return;
loadActorAnim(OBJECT_PHASERSHOT, "s3r2s1", 0xf3, 0x89, 0);
playSoundEffectIndex(SND_PHASSHOT);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_FERRIS, TX_LOV1_028);
}
diff --git a/engines/startrek/rooms/love2.cpp b/engines/startrek/rooms/love2.cpp
index 61feac9..5a0d802 100644
--- a/engines/startrek/rooms/love2.cpp
+++ b/engines/startrek/rooms/love2.cpp
@@ -49,7 +49,7 @@ void Room::love2Tick1() {
char canName[10];
- switch (_vm->_awayMission.love.canister1) {
+ switch (_awayMission->love.canister1) {
case CANTYPE_O2:
strcpy(canName, "o2can");
break;
@@ -63,10 +63,10 @@ void Room::love2Tick1() {
break;
}
- if (_vm->_awayMission.love.canister1 >= 1 && _vm->_awayMission.love.canister1 <= 3)
+ if (_awayMission->love.canister1 >= 1 && _awayMission->love.canister1 <= 3)
loadActorAnim(OBJECT_CAN1, canName, 0xa7, 0xae, 0);
- switch (_vm->_awayMission.love.canister2) {
+ switch (_awayMission->love.canister2) {
case CANTYPE_O2:
strcpy(canName, "o2can");
break;
@@ -80,30 +80,30 @@ void Room::love2Tick1() {
break;
}
- if (_vm->_awayMission.love.canister2 >= 1 && _vm->_awayMission.love.canister2 <= 3)
+ if (_awayMission->love.canister2 >= 1 && _awayMission->love.canister2 <= 3)
loadActorAnim(OBJECT_CAN2, canName, 0xb1, 0xaf, 0);
- if (_vm->_awayMission.love.gasFeedOn)
+ if (_awayMission->love.gasFeedOn)
loadActorAnim(OBJECT_GAS_FEED, "s3r3vo", 0xac, 0x75, 0);
else
loadActorAnim(OBJECT_GAS_FEED, "s3r3vc", 0xac, 0x75, 0);
- if (_vm->_awayMission.love.cabinetOpen)
+ if (_awayMission->love.cabinetOpen)
loadActorAnim(OBJECT_CABINET, "s3r3d1o", 0x1e, 0xaf, 0);
else
loadActorAnim(OBJECT_CABINET, "s3r3d1c", 0x1e, 0xaf, 0);
- if (_vm->_awayMission.love.cabinetOpen && !haveItem(OBJECT_IANTIGRA))
+ if (_awayMission->love.cabinetOpen && !haveItem(OBJECT_IANTIGRA))
loadActorAnim(OBJECT_ANTIGRAV, "antigr", 0x1f, 0xa7, 0);
- if (_vm->_awayMission.love.synthesizerContents != 0)
+ if (_awayMission->love.synthesizerContents != 0)
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2o", 0x8a, 0x8d, 0);
else
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2c", 0x8a, 0x8d, 0);
bool valid = true;
- switch (_vm->_awayMission.love.synthesizerContents) {
+ switch (_awayMission->love.synthesizerContents) {
case SYNTHITEM_PBC:
strcpy(_roomVar.love.chamberInputAnim, "pbcanm");
_roomVar.love.chamberObject = OBJECT_POLYBERYLCARBONATE;
@@ -117,7 +117,7 @@ void Room::love2Tick1() {
_roomVar.love.chamberObject = OBJECT_CURESAMPLE;
break;
case SYNTHITEM_BOTTLE:
- switch (_vm->_awayMission.love.synthesizerBottleIndex) {
+ switch (_awayMission->love.synthesizerBottleIndex) {
case 1:
strcpy(_roomVar.love.chamberOutputAnim, "btle1");
_roomVar.love.chamberObject = OBJECT_SYNTHESIZER_OUTPUT;
@@ -146,17 +146,17 @@ void Room::love2Tick1() {
}
if (valid) {
- if (_vm->_awayMission.love.synthesizerContents == 9)
+ if (_awayMission->love.synthesizerContents == 9)
loadActorAnim2(_roomVar.love.chamberObject, _roomVar.love.chamberOutputAnim, 0x8a, 0x8b, 0);
else
loadActorAnim2(_roomVar.love.chamberObject, _roomVar.love.chamberInputAnim, 0x8a, 0x8b, 0);
}
- if (_vm->_awayMission.love.releasedHumanLaughingGas)
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.releasedRomulanLaughingGas)
- _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
- _vm->_awayMission.timers[2] = 200;
+ if (_awayMission->love.releasedHumanLaughingGas)
+ _awayMission->timers[0] = getRandomWordInRange(200, 400);
+ if (_awayMission->love.releasedRomulanLaughingGas)
+ _awayMission->timers[1] = getRandomWordInRange(200, 400);
+ _awayMission->timers[2] = 200;
loadActorAnim(OBJECT_DOOR, "s3r3d3a", 0x12a, 0xb5, 0);
@@ -165,9 +165,9 @@ void Room::love2Tick1() {
}
void Room::love2TouchedWarp1() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.timers[3] = 10;
+ _awayMission->timers[3] = 10;
}
void Room::love2Timer3Expired() {
@@ -175,7 +175,7 @@ void Room::love2Timer3Expired() {
}
void Room::love2WalkToDoor() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.love.walkingToDoor = true;
walkCrewman(OBJECT_KIRK, 0x127, 0xba, 14);
}
@@ -244,7 +244,7 @@ void Room::love2LookAtChamber() {
}
void Room::love2LookAtCan1() {
- switch (_vm->_awayMission.love.canister1) {
+ switch (_awayMission->love.canister1) {
case CANTYPE_O2:
showText(TX_LOV2N004);
break;
@@ -259,7 +259,7 @@ void Room::love2LookAtCan1() {
}
void Room::love2LookAtCan2() {
- switch (_vm->_awayMission.love.canister2) {
+ switch (_awayMission->love.canister2) {
case CANTYPE_O2:
showText(TX_LOV2N004);
break;
@@ -290,7 +290,7 @@ void Room::love2TalkToRedshirt() {
}
void Room::love2UseMTricorderAnywhere() {
- if (_vm->_awayMission.love.knowAboutVirus)
+ if (_awayMission->love.knowAboutVirus)
mccoyScan(DIR_S, TX_LOV2_008, false);
else
// BUGFIX: should be TX_LOV2_012, but the audio file is missing. Using equivalent
@@ -323,26 +323,26 @@ void Room::love2UseRedshirtOnCabinet() {
}
void Room::love2CrewmanReachedCabinet() {
- Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love.chamberObject, "usehw");
+ Common::String anim = getCrewmanAnimFilename(_roomVar.love.chamberObject, "usehw");
loadActorAnim2(_roomVar.love.chamberObject, anim, -1, -1, 11);
}
void Room::love2CrewmanAccessedCabinet() {
- if (_vm->_awayMission.love.cabinetOpen)
+ if (_awayMission->love.cabinetOpen)
loadActorAnim2(OBJECT_CABINET, "s3r3d4", 0x1e, 0xaf, 2);
else
loadActorAnim2(OBJECT_CABINET, "s3r3d1", 0x1e, 0xaf, 2);
playSoundEffectIndex(SND_DOOR1);
- if (_vm->_awayMission.love.cabinetOpen)
+ if (_awayMission->love.cabinetOpen)
loadActorStandAnim(OBJECT_ANTIGRAV);
- _vm->_awayMission.love.cabinetOpen = !_vm->_awayMission.love.cabinetOpen;
+ _awayMission->love.cabinetOpen = !_awayMission->love.cabinetOpen;
}
void Room::love2CrewmanOpenedOrClosedCabinet() {
- if (_vm->_awayMission.love.cabinetOpen && !haveItem(OBJECT_IANTIGRA))
+ if (_awayMission->love.cabinetOpen && !haveItem(OBJECT_IANTIGRA))
loadActorAnim(OBJECT_ANTIGRAV, "antigr", 0x1f, 0xa7, 0);
}
@@ -356,12 +356,12 @@ void Room::love2ReachedGasFeed() {
}
void Room::love2ChangedGasFeed() {
- if (_vm->_awayMission.love.gasFeedOn) {
- _vm->_awayMission.love.gasFeedOn = false;
+ if (_awayMission->love.gasFeedOn) {
+ _awayMission->love.gasFeedOn = false;
loadActorAnim2(OBJECT_GAS_FEED, "s3r3v2", 0xac, 0x75, 0);
showText(TX_LOV2N007);
} else {
- _vm->_awayMission.love.gasFeedOn = true;
+ _awayMission->love.gasFeedOn = true;
loadActorAnim2(OBJECT_GAS_FEED, "s3r3v1", 0xac, 0x75, 0);
showText(TX_LOV2N008);
}
@@ -389,12 +389,12 @@ void Room::love2UseN2GasOnCanisterSlot() {
}
void Room::love2ReachedCanisterSlot() {
- if (_vm->_awayMission.love.gasFeedOn)
+ if (_awayMission->love.gasFeedOn)
showText(TX_SPEAKER_SPOCK, TX_LOV2_026);
else {
- if (_vm->_awayMission.love.canister1 == CANTYPE_NONE)
+ if (_awayMission->love.canister1 == CANTYPE_NONE)
loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 13);
- else if (_vm->_awayMission.love.canister2 == CANTYPE_NONE)
+ else if (_awayMission->love.canister2 == CANTYPE_NONE)
loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 14);
else
showText(TX_LOV2N024);
@@ -404,7 +404,7 @@ void Room::love2ReachedCanisterSlot() {
void Room::love2PutCanisterInSlot1() {
playVoc("SE6FOOD");
loadActorAnim(OBJECT_CAN1, _roomVar.love.canisterAnim, 0xa7, 0xae, 0);
- _vm->_awayMission.love.canister1 = _roomVar.love.canisterType;
+ _awayMission->love.canister1 = _roomVar.love.canisterType;
showText(TX_LOV2N034);
loseItem(_roomVar.love.canisterItem);
}
@@ -412,7 +412,7 @@ void Room::love2PutCanisterInSlot1() {
void Room::love2PutCanisterInSlot2() {
playVoc("SE6FOOD");
loadActorAnim(OBJECT_CAN2, _roomVar.love.canisterAnim, 0xb1, 0xaf, 0);
- _vm->_awayMission.love.canister2 = _roomVar.love.canisterType;
+ _awayMission->love.canister2 = _roomVar.love.canisterType;
showText(TX_LOV2N035);
loseItem(_roomVar.love.canisterItem);
}
@@ -422,7 +422,7 @@ void Room::love2UseAntigravOnCanister1() {
}
void Room::love2ReachedCanisterSlot1ToGet() {
- if (_vm->_awayMission.love.gasFeedOn)
+ if (_awayMission->love.gasFeedOn)
showText(TX_SPEAKER_SPOCK, TX_LOV2_025);
else {
loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 15);
@@ -435,7 +435,7 @@ void Room::love2TookCanister1() {
showText(TX_LOV2N030);
loadActorStandAnim(OBJECT_CAN1);
- switch (_vm->_awayMission.love.canister1) {
+ switch (_awayMission->love.canister1) {
case CANTYPE_O2:
giveItem(OBJECT_IO2GAS);
break;
@@ -448,7 +448,7 @@ void Room::love2TookCanister1() {
break;
}
- _vm->_awayMission.love.canister1 = CANTYPE_NONE;
+ _awayMission->love.canister1 = CANTYPE_NONE;
}
void Room::love2UseAntigravOnCanister2() {
@@ -456,7 +456,7 @@ void Room::love2UseAntigravOnCanister2() {
}
void Room::love2ReachedCanisterSlot2ToGet() {
- if (_vm->_awayMission.love.gasFeedOn)
+ if (_awayMission->love.gasFeedOn)
showText(TX_SPEAKER_SPOCK, TX_LOV2_025);
else {
loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 16);
@@ -468,7 +468,7 @@ void Room::love2TookCanister2() {
showText(TX_LOV2N031);
loadActorStandAnim(OBJECT_CAN2);
- switch (_vm->_awayMission.love.canister2) {
+ switch (_awayMission->love.canister2) {
case CANTYPE_O2:
giveItem(OBJECT_IO2GAS);
break;
@@ -481,7 +481,7 @@ void Room::love2TookCanister2() {
break;
}
- _vm->_awayMission.love.canister2 = CANTYPE_NONE;
+ _awayMission->love.canister2 = CANTYPE_NONE;
}
void Room::love2UseKirkOnSynthesizer() {
@@ -505,12 +505,12 @@ void Room::love2UseRedshirtOnSynthesizer() {
}
void Room::love2CrewmanReachedSynthesizer() {
- Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love.chamberObject, "usemn");
+ Common::String anim = getCrewmanAnimFilename(_roomVar.love.chamberObject, "usemn");
loadActorAnim2(_roomVar.love.chamberObject, anim, -1, -1, 17);
}
void Room::love2CrewmanUsedSynthesizer() {
- if (_vm->_awayMission.love.gasFeedOn) {
+ if (_awayMission->love.gasFeedOn) {
love2UseSynthesizer();
} else {
if (_roomVar.love.cb == 3) {
@@ -532,7 +532,7 @@ void Room::love2SpockReachedGasFeeds() {
}
void Room::love2SpockEnabledGasFeeds() {
- _vm->_awayMission.love.gasFeedOn = true;
+ _awayMission->love.gasFeedOn = true;
loadActorAnim2(OBJECT_GAS_FEED, "s3r3v1", 0xac, 0x75, 0);
showText(TX_LOV2N008);
@@ -543,10 +543,10 @@ void Room::love2SpockEnabledGasFeeds() {
// Synthesizer takes the input and produces some output
void Room::love2UseSynthesizer() {
- if (_vm->_awayMission.love.canister1 != 0) {
- if (_vm->_awayMission.love.canister2 != 0) {
- int c1 = _vm->_awayMission.love.canister1;
- int c2 = _vm->_awayMission.love.canister2;
+ if (_awayMission->love.canister1 != 0) {
+ if (_awayMission->love.canister2 != 0) {
+ int c1 = _awayMission->love.canister1;
+ int c2 = _awayMission->love.canister2;
if (c1 > c2) {
int tmp = c1;
c1 = c2;
@@ -554,7 +554,7 @@ void Room::love2UseSynthesizer() {
}
if (c1 == CANTYPE_O2 && c2 == CANTYPE_H2) {
- switch (_vm->_awayMission.love.synthesizerContents) {
+ switch (_awayMission->love.synthesizerContents) {
case SYNTHITEM_PBC: // Romulan Laughing Gas
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", -1, -1, 27); // -> love2ClosedSynthesizerDoorMakingRLG
playSoundEffectIndex(SND_DOOR1);
@@ -581,7 +581,7 @@ bottleFailure:
case SYNTHITEM_NONE: // Water
default:
- _vm->_awayMission.love.synthesizerBottleIndex = BOTTLETYPE_H2O;
+ _awayMission->love.synthesizerBottleIndex = BOTTLETYPE_H2O;
strcpy(_roomVar.love.chamberOutputAnim, "btle3");
produceBottle:
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 3); // -> love2SynthesizerDoorClosed
@@ -591,11 +591,11 @@ produceBottle:
closeSynthesizerDoor:
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.love.synthesizerContents = 0;
+ _awayMission->love.synthesizerContents = 0;
break;
}
} else if (c1 == CANTYPE_H2 && c2 == CANTYPE_N2) {
- switch (_vm->_awayMission.love.synthesizerContents) {
+ switch (_awayMission->love.synthesizerContents) {
case SYNTHITEM_PBC: // Inert matter
inertMatterFailure:
showText(TX_LOV2N049);
@@ -621,12 +621,12 @@ inertMatterFailure:
case SYNTHITEM_NONE: // Ammonia
default:
- _vm->_awayMission.love.synthesizerBottleIndex = BOTTLETYPE_NH3;
+ _awayMission->love.synthesizerBottleIndex = BOTTLETYPE_NH3;
strcpy(_roomVar.love.chamberOutputAnim, "btle2");
goto produceBottle;
}
} else if (c1 == CANTYPE_O2 && c2 == CANTYPE_N2) {
- switch (_vm->_awayMission.love.synthesizerContents) {
+ switch (_awayMission->love.synthesizerContents) {
case SYNTHITEM_PBC: // Inert matter
goto inertMatterFailure;
@@ -644,7 +644,7 @@ inertMatterFailure:
case SYNTHITEM_NONE: // Laughing gas
default:
- _vm->_awayMission.love.synthesizerBottleIndex = BOTTLETYPE_N2O;
+ _awayMission->love.synthesizerBottleIndex = BOTTLETYPE_N2O;
strcpy(_roomVar.love.chamberOutputAnim, "btle1");
goto produceBottle;
}
@@ -664,12 +664,12 @@ inertMatterFailure:
void Room::love2SynthesizerDoorClosed() {
playVoc("LD1SCAN");
loadActorAnim(OBJECT_SYNTHESIZER_OUTPUT, _roomVar.love.chamberOutputAnim, 0x8a, 0x8d, 4); // -> love2SynthesizerFinished
- _vm->_awayMission.love.synthesizerContents = SYNTHITEM_BOTTLE;
+ _awayMission->love.synthesizerContents = SYNTHITEM_BOTTLE;
}
// Final product of synthesizer is produced
void Room::love2SynthesizerFinished() {
- switch (_vm->_awayMission.love.synthesizerBottleIndex) {
+ switch (_awayMission->love.synthesizerBottleIndex) {
case BOTTLETYPE_N2O:
showText(TX_LOV2N017);
showText(TX_SPEAKER_SPOCK, TX_LOV2_032);
@@ -679,7 +679,7 @@ void Room::love2SynthesizerFinished() {
case BOTTLETYPE_NH3:
showText(TX_LOV2N016);
- if (!_vm->_awayMission.redshirtDead) {
+ if (!_awayMission->redshirtDead) {
showText(TX_SPEAKER_FERRIS, TX_LOV2_043);
showText(TX_SPEAKER_KIRK, TX_LOV2_003);
}
@@ -703,7 +703,7 @@ void Room::love2SynthesizerFinished() {
}
void Room::love2ClosedSynthesizerDoorMakingRLG() {
- _vm->_awayMission.love.synthesizerBottleIndex = BOTTLETYPE_RLG;
+ _awayMission->love.synthesizerBottleIndex = BOTTLETYPE_RLG;
strcpy(_roomVar.love.chamberOutputAnim, "btle4");
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 3); // -> love2SynthesizerDoorClosed
playSoundEffectIndex(SND_DOOR1);
@@ -727,11 +727,11 @@ void Room::love2CureSynthesized() {
// Put polycarbonate in synthesizer
void Room::love2UsePolyberylcarbonateOnSynthesizerDoor() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 6);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love2KirkReachedSynthesizerWithPolyberylcarbonate() {
- if (_vm->_awayMission.love.synthesizerContents != 0)
+ if (_awayMission->love.synthesizerContents != 0)
showText(TX_LOV2N025);
else {
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 5);
@@ -746,18 +746,18 @@ void Room::love2SynthesizerDoorOpenedWithPolyberylcarbonate() {
void Room::love2PutPolyberylcarbonateInSynthesizer() {
loadActorAnim(OBJECT_POLYBERYLCARBONATE, "pbcanm", 0x8a, 0x8b, 0);
loseItem(OBJECT_IPBC);
- _vm->_awayMission.love.synthesizerContents = SYNTHITEM_PBC;
+ _awayMission->love.synthesizerContents = SYNTHITEM_PBC;
}
// Put dish (virus sample) in synthesizer
void Room::love2UseVirusSampleOnSynthesizerDoor() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 7);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love2KirkReachedSynthesizerWithVirusSample() {
- if (_vm->_awayMission.love.synthesizerContents != 0)
+ if (_awayMission->love.synthesizerContents != 0)
showText(TX_LOV2N025);
else {
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 6);
@@ -772,18 +772,18 @@ void Room::love2SynthesizerDoorOpenedWithVirusSample() {
void Room::love2PutVirusSampleInSynthesizer() {
loadActorAnim(OBJECT_VIRUSSAMPLE, "dishes", 0x8a, 0x8b, 0);
loseItem(OBJECT_IDISHES);
- _vm->_awayMission.love.synthesizerContents = SYNTHITEM_VIRUS_SAMPLE;
+ _awayMission->love.synthesizerContents = SYNTHITEM_VIRUS_SAMPLE;
}
// Put cure sample in synthesizer
void Room::love2UseCureSampleOnSynthesizerDoor() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 8);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love2KirkReachedSynthesizerWithCureSample() {
- if (_vm->_awayMission.love.synthesizerContents != 0)
+ if (_awayMission->love.synthesizerContents != 0)
showText(TX_LOV2N025); // BUGFIX: original didn't play audio
else {
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 7);
@@ -798,7 +798,7 @@ void Room::love2SynthesizerDoorOpenedWithCureSample() {
void Room::love2PutCureSampleInSynthesizer() {
loadActorAnim(OBJECT_CURESAMPLE, "dishes", 0x8a, 0x8b, 0);
loseItem(OBJECT_ISAMPLE);
- _vm->_awayMission.love.synthesizerContents = SYNTHITEM_CURE_SAMPLE;
+ _awayMission->love.synthesizerContents = SYNTHITEM_CURE_SAMPLE;
}
@@ -812,7 +812,7 @@ void Room::love2UseAnythingOnSynthesizer() {
}
void Room::love2GetCanister() {
- if (_vm->_awayMission.redshirtDead)
+ if (_awayMission->redshirtDead)
showText(TX_SPEAKER_MCCOY, TX_LOV2_011);
else
showText(TX_SPEAKER_FERRIS, TX_LOV2_040);
@@ -838,7 +838,7 @@ void Room::love2GotAntigrav() {
// Get polyberylcarbonate from synthesizer
void Room::love2GetPolyberylcarbonate() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 18);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love2ReachedPolyberylcarbonate() {
@@ -849,7 +849,7 @@ void Room::love2GotPolyberylcarbonate() {
loadActorStandAnim(OBJECT_POLYBERYLCARBONATE);
showText(TX_LOV2N044);
giveItem(OBJECT_IPBC);
- _vm->_awayMission.love.synthesizerContents = 0;
+ _awayMission->love.synthesizerContents = 0;
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
}
@@ -858,7 +858,7 @@ void Room::love2GotPolyberylcarbonate() {
// Get virus sample from synthesizer
void Room::love2GetDishes() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 17);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love2ReachedDishes() {
@@ -869,7 +869,7 @@ void Room::love2GotDishes() {
loadActorStandAnim(OBJECT_VIRUSSAMPLE);
showText(TX_LOV2N036); // FIXME: text doesn't match audio
giveItem(OBJECT_IDISHES);
- _vm->_awayMission.love.synthesizerContents = 0;
+ _awayMission->love.synthesizerContents = 0;
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
}
@@ -878,7 +878,7 @@ void Room::love2GotDishes() {
// Get cure sample from synthesizer
void Room::love2GetSample() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 19);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love2ReachedSample() {
@@ -889,7 +889,7 @@ void Room::love2GotSample() {
loadActorStandAnim(OBJECT_CURESAMPLE);
showText(TX_LOV2N037);
giveItem(OBJECT_ISAMPLE);
- _vm->_awayMission.love.synthesizerContents = 0;
+ _awayMission->love.synthesizerContents = 0;
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
}
@@ -898,7 +898,7 @@ void Room::love2GotSample() {
// Get synthesizer output
void Room::love2GetSynthesizerOutput() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 10);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love2ReachedSynthesizerOutput() {
@@ -906,7 +906,7 @@ void Room::love2ReachedSynthesizerOutput() {
}
void Room::love2GotSynthesizerOutput() {
- switch (_vm->_awayMission.love.synthesizerBottleIndex) {
+ switch (_awayMission->love.synthesizerBottleIndex) {
case BOTTLETYPE_N2O:
showText(TX_LOV2N040);
giveItem(OBJECT_IN2O);
@@ -925,9 +925,9 @@ void Room::love2GotSynthesizerOutput() {
case BOTTLETYPE_RLG:
default:
showText(TX_LOV2N038);
- if (!_vm->_awayMission.love.gotTLDH) {
- _vm->_awayMission.love.gotTLDH = true;
- _vm->_awayMission.love.missionScore += 4;
+ if (!_awayMission->love.gotTLDH) {
+ _awayMission->love.gotTLDH = true;
+ _awayMission->love.missionScore += 4;
}
giveItem(OBJECT_IRLG);
break;
@@ -937,14 +937,14 @@ void Room::love2GotSynthesizerOutput() {
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.love.synthesizerContents = 0;
- _vm->_awayMission.love.synthesizerBottleIndex = 0;
+ _awayMission->love.synthesizerContents = 0;
+ _awayMission->love.synthesizerBottleIndex = 0;
}
// Get the cure
void Room::love2GetCure() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 11);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love2ReachedCure() {
@@ -952,9 +952,9 @@ void Room::love2ReachedCure() {
}
void Room::love2GotCure() {
- if (!_vm->_awayMission.love.gotCure) {
- _vm->_awayMission.love.gotCure = true;
- _vm->_awayMission.love.missionScore += 5;
+ if (!_awayMission->love.gotCure) {
+ _awayMission->love.gotCure = true;
+ _awayMission->love.missionScore += 5;
}
giveItem(OBJECT_ICURE);
@@ -963,7 +963,7 @@ void Room::love2GotCure() {
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.love.synthesizerContents = 0;
+ _awayMission->love.synthesizerContents = 0;
}
}
diff --git a/engines/startrek/rooms/love3.cpp b/engines/startrek/rooms/love3.cpp
index 03ae584..48d93f2 100644
--- a/engines/startrek/rooms/love3.cpp
+++ b/engines/startrek/rooms/love3.cpp
@@ -38,46 +38,46 @@ namespace StarTrek {
void Room::love3Tick1() {
playVoc("LOV3LOOP");
- if (!_vm->_awayMission.love.wrenchTaken)
+ if (!_awayMission->love.wrenchTaken)
loadActorAnim(OBJECT_WRENCH, "wrench", 0x10a, 0xb6, 0);
- if (_vm->_awayMission.love.grateRemoved)
+ if (_awayMission->love.grateRemoved)
loadActorAnim(OBJECT_GRATE, "s3r4g3", 0, 0, 0);
else
loadActorAnim(OBJECT_GRATE, "s3r4g1", 0x116, 0x8f, 0);
- if (_vm->_awayMission.love.insulationOnGround)
+ if (_awayMission->love.insulationOnGround)
loadActorAnim(OBJECT_INSULATION, "s3r4p2", 0, 0, 0);
- if (!_vm->_awayMission.love.tookN2TankFromServicePanel)
+ if (!_awayMission->love.tookN2TankFromServicePanel)
loadActorAnim(OBJECT_GAS_TANK, "r4n2", 0, 0, 0);
- if (_vm->_awayMission.love.servicePanelOpen)
+ if (_awayMission->love.servicePanelOpen)
loadActorAnim(OBJECT_SERVICE_PANEL, "s3r4d1a", 1, 0, 0);
else
loadActorAnim(OBJECT_SERVICE_PANEL, "s3r4d2", 1, 0, 0);
- if (_vm->_awayMission.love.releasedHumanLaughingGas)
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.releasedRomulanLaughingGas)
- _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
- _vm->_awayMission.timers[2] = 200;
+ if (_awayMission->love.releasedHumanLaughingGas)
+ _awayMission->timers[0] = getRandomWordInRange(200, 400);
+ if (_awayMission->love.releasedRomulanLaughingGas)
+ _awayMission->timers[1] = getRandomWordInRange(200, 400);
+ _awayMission->timers[2] = 200;
_roomVar.love.cmnXPosToCureSpock = 0xb4;
_roomVar.love.cmnYPosToCureSpock = 0xb7;
}
void Room::love3Tick80() {
- if (!_vm->_awayMission.love.visitedRoomWithRomulans && haveItem(OBJECT_IRLG)) {
+ if (!_awayMission->love.visitedRoomWithRomulans && haveItem(OBJECT_IRLG)) {
showText(TX_SPEAKER_MCCOY, TX_LOV3_010);
showText(TX_SPEAKER_SPOCK, TX_LOV3_020);
}
}
void Room::love3TouchedWarp1() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.timers[3] = 10;
+ _awayMission->timers[3] = 10;
}
void Room::love3Timer3Expired() {
@@ -125,7 +125,7 @@ void Room::love3LookAtGrate() {
}
void Room::love3LookAtPanel() {
- if (_vm->_awayMission.love.insulationOnGround)
+ if (_awayMission->love.insulationOnGround)
showText(TX_LOV3N017);
else
showText(TX_LOV3NA22);
@@ -139,7 +139,7 @@ void Room::love3LookAtTurbines() {
showText(TX_LOV3N026);
showText(TX_SPEAKER_MCCOY, TX_LOV3_009);
showText(TX_SPEAKER_SPOCK, TX_LOV3_019);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_FERRIS, TX_LOV3_026);
}
@@ -148,9 +148,9 @@ void Room::love3TalkToKirk() {
}
void Room::love3TalkToSpock() {
- if (_vm->_awayMission.love.visitedRoomWithRomulans)
+ if (_awayMission->love.visitedRoomWithRomulans)
showText(TX_SPEAKER_SPOCK, TX_LOV3_003);
- else if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas)
+ else if (_awayMission->love.romulansUnconsciousFromLaughingGas)
showText(TX_SPEAKER_SPOCK, TX_LOV3_017);
else if (haveItem(OBJECT_IRLG))
showText(TX_SPEAKER_SPOCK, TX_LOV3_004);
@@ -167,7 +167,7 @@ void Room::love3TalkToRedshirt() {
}
void Room::love3UseMTricorderAnywhere() {
- if (_vm->_awayMission.love.knowAboutVirus)
+ if (_awayMission->love.knowAboutVirus)
mccoyScan(DIR_S, TX_LOV3_005, false);
else
mccoyScan(DIR_S, TX_LOV3_006, false);
@@ -178,7 +178,7 @@ void Room::love3UseSTricorderOnTurbines() {
}
void Room::love3UseSTricorderOnInsulation() {
- if (_vm->_awayMission.love.insulationOnGround)
+ if (_awayMission->love.insulationOnGround)
spockScan(DIR_W, TX_LOV3_002, false);
}
@@ -207,21 +207,21 @@ void Room::love3UseRedshirtOnServicePanel() {
}
void Room::love3CrewmanReachedServicePanel() {
- Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love.activeCrewman, "usehe");
+ Common::String anim = getCrewmanAnimFilename(_roomVar.love.activeCrewman, "usehe");
loadActorAnim2(_roomVar.love.activeCrewman, anim, -1, -1, 1);
}
void Room::love3OpenedOrClosedServicePanel() {
- if (_vm->_awayMission.love.servicePanelOpen)
+ if (_awayMission->love.servicePanelOpen)
loadActorAnim2(OBJECT_SERVICE_PANEL, "s3r4d1b", 1, 0, 0);
else
loadActorAnim2(OBJECT_SERVICE_PANEL, "s3r4d1", 1, 0, 0);
playVoc("SMADOOR1");
- _vm->_awayMission.love.servicePanelOpen = !_vm->_awayMission.love.servicePanelOpen;
+ _awayMission->love.servicePanelOpen = !_awayMission->love.servicePanelOpen;
- if (_vm->_awayMission.love.servicePanelOpen) {
- if (_vm->_awayMission.love.tookN2TankFromServicePanel)
+ if (_awayMission->love.servicePanelOpen) {
+ if (_awayMission->love.tookN2TankFromServicePanel)
showText(TX_LOV3N023);
else
showText(TX_LOV3N022);
@@ -240,14 +240,14 @@ void Room::love3ReachedGasTankToUnscrew() {
}
void Room::love3ScrewedOrUnscrewedGasTank() {
- if (!_vm->_awayMission.love.gasTankUnscrewed) {
+ if (!_awayMission->love.gasTankUnscrewed) {
showText(TX_LOV3N012);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_FERRIS, TX_LOV3_022);
- _vm->_awayMission.love.gasTankUnscrewed = true;
+ _awayMission->love.gasTankUnscrewed = true;
} else {
showText(TX_LOV3N015);
- _vm->_awayMission.love.gasTankUnscrewed = false;
+ _awayMission->love.gasTankUnscrewed = false;
}
}
@@ -269,7 +269,7 @@ void Room::love3ReachedGasTankToPutDown() {
void Room::love3PutN2TankBack() {
showText(TX_LOV3N013);
- _vm->_awayMission.love.tookN2TankFromServicePanel = false;
+ _awayMission->love.tookN2TankFromServicePanel = false;
loseItem(OBJECT_IN2GAS);
loadActorAnim(OBJECT_GAS_TANK, "r4n2", 0, 0, 0);
}
@@ -286,10 +286,10 @@ void Room::love3ReachedEngineeringPanel() {
}
void Room::love3OpenedEngineeringPanel() {
- if (!_vm->_awayMission.love.insulationOnGround) {
+ if (!_awayMission->love.insulationOnGround) {
playVoc("MADR4E4A");
loadActorAnim(OBJECT_INSULATION, "s3r4p1", 0, 0, 0);
- _vm->_awayMission.love.insulationOnGround = true;
+ _awayMission->love.insulationOnGround = true;
}
showText(TX_LOV3N021);
}
@@ -325,11 +325,11 @@ void Room::love3UseCrewmanOnEngineeringPanelOrGrate() {
void Room::love3UseWrenchOnGrate() {
walkCrewmanC(OBJECT_KIRK, 0xf6, 0xaa, &Room::love3ReachedGateWithWrench);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love3ReachedGateWithWrench() {
- if (_vm->_awayMission.love.grateRemoved)
+ if (_awayMission->love.grateRemoved)
loadActorAnimC(OBJECT_KIRK, "s3r4g2a", -1, -1, &Room::love3OpenedOrClosedGrate);
else
loadActorAnimC(OBJECT_KIRK, "s3r4g2", -1, -1, &Room::love3OpenedOrClosedGrate);
@@ -338,20 +338,20 @@ void Room::love3ReachedGateWithWrench() {
}
void Room::love3OpenedOrClosedGrate() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
- if (!_vm->_awayMission.love.grateRemoved) {
- _vm->_awayMission.love.grateRemoved = true;
+ if (!_awayMission->love.grateRemoved) {
+ _awayMission->love.grateRemoved = true;
loadActorAnim(OBJECT_GRATE, "s3r4g3", 0, 0, 0);
showText(TX_LOV3N016);
- if (!_vm->_awayMission.love.gotPointsForOpeningGrate) {
- _vm->_awayMission.love.gotPointsForOpeningGrate = true;
- _vm->_awayMission.love.missionScore++;
+ if (!_awayMission->love.gotPointsForOpeningGrate) {
+ _awayMission->love.gotPointsForOpeningGrate = true;
+ _awayMission->love.missionScore++;
}
} else {
loadActorAnim(OBJECT_GRATE, "s3r4g1", 0x116, 0x8f, 0);
- _vm->_awayMission.love.grateRemoved = false;
+ _awayMission->love.grateRemoved = false;
showText(TX_LOV3N032);
}
}
@@ -367,7 +367,7 @@ void Room::love3UseWaterOnShaft() {
}
void Room::love3ReachedShaftUsingWater() {
- if (!_vm->_awayMission.love.grateRemoved)
+ if (!_awayMission->love.grateRemoved)
showText(TX_LOV3N025);
else
loadActorAnimC(OBJECT_KIRK, "kuseme", -1, -1, &Room::love3PouredWaterDownShaft);
@@ -384,7 +384,7 @@ void Room::love3UseNitrousOxideOnShaft() {
}
void Room::love3ReachedShaftUsingNitrousOxide() {
- if (!_vm->_awayMission.love.grateRemoved)
+ if (!_awayMission->love.grateRemoved)
showText(TX_LOV3N025);
else
loadActorAnimC(OBJECT_KIRK, "kuseme", -1, -1, &Room::love3PouredNitrousOxideDownShaft);
@@ -402,16 +402,16 @@ void Room::love3UseAmmoniaOnShaft() {
}
void Room::love3ReachedShaftUsingAmmonia() {
- if (!_vm->_awayMission.love.grateRemoved)
+ if (!_awayMission->love.grateRemoved)
showText(TX_LOV3N025);
else
loadActorAnimC(OBJECT_KIRK, "kuseme", -1, -1, &Room::love3PouredAmmoniaDownShaft);
}
void Room::love3PouredAmmoniaDownShaft() {
- if (!_vm->_awayMission.love.romulansUnconsciousFromVirus) {
+ if (!_awayMission->love.romulansUnconsciousFromVirus) {
showText(TX_LOV3N001);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_FERRIS, TX_LOV3_023);
}
@@ -420,13 +420,13 @@ void Room::love3PouredAmmoniaDownShaft() {
void Room::love3UseRomulanLaughingGasOnShaft() {
- if (_vm->_awayMission.love.gotPointsForGassingRomulans) {
+ if (_awayMission->love.gotPointsForGassingRomulans) {
// BUG-ish: you could get the points for this by starting the action, then
// canceling it before Kirk reaches the shaft.
- _vm->_awayMission.love.gotPointsForGassingRomulans = true;
- _vm->_awayMission.love.missionScore += 6;
+ _awayMission->love.gotPointsForGassingRomulans = true;
+ _awayMission->love.missionScore += 6;
}
- if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas)
+ if (_awayMission->love.romulansUnconsciousFromLaughingGas)
showText(TX_SPEAKER_SPOCK, TX_LOV3_011);
else {
walkCrewmanC(OBJECT_KIRK, 0xf6, 0xa4, &Room::love3ReachedShaftUsingRomulanLaughingGas);
@@ -434,7 +434,7 @@ void Room::love3UseRomulanLaughingGasOnShaft() {
}
void Room::love3ReachedShaftUsingRomulanLaughingGas() {
- if (!_vm->_awayMission.love.grateRemoved)
+ if (!_awayMission->love.grateRemoved)
showText(TX_LOV3N025);
else {
loadActorAnimC(OBJECT_KIRK, "kuseme", -1, -1, &Room::love3PouredRomulanLaughingGasDownShaft);
@@ -444,11 +444,11 @@ void Room::love3ReachedShaftUsingRomulanLaughingGas() {
void Room::love3PouredRomulanLaughingGasDownShaft() {
loseItem(OBJECT_IRLG);
- _vm->_awayMission.love.romulansUnconsciousFromLaughingGas = true;
+ _awayMission->love.romulansUnconsciousFromLaughingGas = true;
- if (_vm->_awayMission.love.romulansUnconsciousFromVirus) {
+ if (_awayMission->love.romulansUnconsciousFromVirus) {
showText(TX_LOV3NA08);
- _vm->_awayMission.love.romulansUnconsciousFromLaughingGas = false;
+ _awayMission->love.romulansUnconsciousFromLaughingGas = false;
} else {
showText(TX_LOV3NA09);
playVoc("ROMULANL");
@@ -469,7 +469,7 @@ void Room::love3PickedUpWrench() {
loadActorStandAnim(OBJECT_KIRK);
giveItem(OBJECT_IWRENCH);
loadActorStandAnim(OBJECT_WRENCH);
- _vm->_awayMission.love.wrenchTaken = true;
+ _awayMission->love.wrenchTaken = true;
showText(TX_LOV3N031);
}
@@ -480,7 +480,7 @@ void Room::love3GetGasTank() {
}
void Room::love3ReachedGasTankToGet() {
- if (_vm->_awayMission.love.gasTankUnscrewed)
+ if (_awayMission->love.gasTankUnscrewed)
showText(TX_LOV3N007);
else
showText(TX_LOV3N014);
@@ -493,7 +493,7 @@ void Room::love3UseAntigravOnGasTank() {
}
void Room::love3ReachedGasTankUsingAntigrav() {
- if (_vm->_awayMission.love.gasTankUnscrewed) {
+ if (_awayMission->love.gasTankUnscrewed) {
loadActorAnimC(OBJECT_KIRK, "kusehe", -1, -1, &Room::love3PickedUpGasTank);
playVoc("SE3PLBAT");
} else {
@@ -505,10 +505,10 @@ void Room::love3ReachedGasTankUsingAntigrav() {
void Room::love3PickedUpGasTank() {
giveItem(OBJECT_IN2GAS);
loadActorStandAnim(OBJECT_GAS_TANK);
- _vm->_awayMission.love.tookN2TankFromServicePanel = true;
+ _awayMission->love.tookN2TankFromServicePanel = true;
showText(TX_LOV3NJ32);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_FERRIS, TX_LOV3_025);
}
@@ -517,7 +517,7 @@ void Room::love3GetInsulation() {
}
void Room::love3ReachedInsulationToGet() {
- if (!_vm->_awayMission.love.field3c)
+ if (!_awayMission->love.field3c)
loadActorAnimC(OBJECT_KIRK, "s5r1kg", -1, -1, &Room::love3PickedUpInsulation);
}
diff --git a/engines/startrek/rooms/love4.cpp b/engines/startrek/rooms/love4.cpp
index 447f763..6eeef10 100644
--- a/engines/startrek/rooms/love4.cpp
+++ b/engines/startrek/rooms/love4.cpp
@@ -36,7 +36,7 @@ namespace StarTrek {
void Room::love4Tick1() {
playVoc("LOV4LOOP");
- if (_vm->_awayMission.love.romulansCured) {
+ if (_awayMission->love.romulansCured) {
loadActorAnim2(OBJECT_ROMULAN_1, "s3r5r1b", 0x36, 0xb3, 0);
loadActorAnim2(OBJECT_ROMULAN_2, "s3r5r2b", 0xb9, 0xbb, 0);
loadActorAnim2(OBJECT_ROMULAN_3, "s3r5r3b", 0xef, 0xc4, 0);
@@ -48,11 +48,11 @@ void Room::love4Tick1() {
loadActorAnim2(OBJECT_ROMULAN_4, "s3r5r4a", 0x12a, 0xaa, 0);
}
- if (_vm->_awayMission.love.releasedHumanLaughingGas)
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.releasedRomulanLaughingGas)
- _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
- _vm->_awayMission.timers[2] = 200;
+ if (_awayMission->love.releasedHumanLaughingGas)
+ _awayMission->timers[0] = getRandomWordInRange(200, 400);
+ if (_awayMission->love.releasedRomulanLaughingGas)
+ _awayMission->timers[1] = getRandomWordInRange(200, 400);
+ _awayMission->timers[2] = 200;
loadActorAnim(OBJECT_DOOR, "s3r5d1a", 0x90, 0x99, 0);
@@ -61,14 +61,14 @@ void Room::love4Tick1() {
}
void Room::love4Tick10() {
- if (!_vm->_awayMission.love.visitedRoomWithRomulans) {
+ if (!_awayMission->love.visitedRoomWithRomulans) {
playMidiMusicTracks(1, -1);
- _vm->_awayMission.love.visitedRoomWithRomulans = true;
+ _awayMission->love.visitedRoomWithRomulans = true;
}
}
void Room::love4WalkToDoor() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.love.walkingToDoor = true;
walkCrewmanC(OBJECT_KIRK, 0x91, 0x9c, &Room::love4DoorOpenedOrReached);
}
@@ -133,7 +133,7 @@ void Room::love4LookAtRedshirt() {
}
void Room::love4LookAtRomulan() {
- if (!_vm->_awayMission.love.romulansCured)
+ if (!_awayMission->love.romulansCured)
showText(TX_LOV4N006);
else
showText(TX_LOV4N011);
@@ -146,7 +146,7 @@ void Room::love4TalkToKirk() {
}
void Room::love4TalkToMccoy() {
- if (_vm->_awayMission.love.romulansCured)
+ if (_awayMission->love.romulansCured)
showText(TX_SPEAKER_MCCOY, TX_LOV4_022);
else
showText(TX_SPEAKER_MCCOY, TX_LOV4_010);
@@ -162,21 +162,21 @@ void Room::love4TalkToSpock() {
}
void Room::love4TalkToRomulan() {
- if (_vm->_awayMission.love.romulansCured)
+ if (_awayMission->love.romulansCured)
showText(TX_LOV4N007); // BUGFIX: original didn't play audio
}
void Room::love4UseMTricorderOnRomulan() {
- if (_vm->_awayMission.love.romulansCured)
+ if (_awayMission->love.romulansCured)
mccoyScan(DIR_S, TX_LOV4_018, false);
else
mccoyScan(DIR_S, TX_LOV4_015, false);
}
void Room::love4UseMTricorderAnywhere() {
- if (_vm->_awayMission.love.romulansCured)
+ if (_awayMission->love.romulansCured)
mccoyScan(DIR_S, TX_LOV4_019, false);
- else if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas)
+ else if (_awayMission->love.romulansUnconsciousFromLaughingGas)
mccoyScan(DIR_S, TX_LOV4_020, false);
else
mccoyScan(DIR_S, TX_LOV4_021, false);
@@ -189,12 +189,12 @@ void Room::love4UseSTricorderAnywhere() {
// Mccoy walks around to all romulans, giving each the cure
void Room::love4UseCureOnRomulan() {
- if (_vm->_awayMission.love.romulansCured)
+ if (_awayMission->love.romulansCured)
showText(TX_SPEAKER_MCCOY, TX_LOV4_013);
else {
- _vm->_awayMission.love.missionScore += 2;
- _vm->_awayMission.love.romulansCured = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->love.missionScore += 2;
+ _awayMission->love.romulansCured = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_MCCOY, 0x10e, 0xb1, &Room::love4MccoyReachedRomulan4);
}
}
@@ -237,7 +237,7 @@ void Room::love4MccoyCuredRomulan1() {
if (!_roomVar.love.gaveWaterToRomulans)
showText(TX_SPEAKER_MCCOY, TX_LOV4_023);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
@@ -245,17 +245,17 @@ void Room::love4UseWaterOnRomulan() {
// BUGFIX: If the romulans are unconscious, you can't use water on them.
// In the original, you could use water on them, but there would be no corresponding
// narration, you'd get no points for it, and you'd lose the water anyway.
- if (!_vm->_awayMission.love.romulansCured)
+ if (!_awayMission->love.romulansCured)
showText(TX_SPEAKER_MCCOY, TX_LOV4_009);
else {
_roomVar.love.gaveWaterToRomulans = true;
- if (_vm->_awayMission.love.romulansCured) {
+ if (_awayMission->love.romulansCured) {
showText(TX_LOV4N013);
showText(TX_SPEAKER_MCCOY, TX_LOV4_026);
showText(TX_SPEAKER_KIRK, TX_LOV4_001);
- if (!_vm->_awayMission.love.gotPointsForHydratingRomulans) {
- _vm->_awayMission.love.gotPointsForHydratingRomulans = true;
- _vm->_awayMission.love.missionScore += 2;
+ if (!_awayMission->love.gotPointsForHydratingRomulans) {
+ _awayMission->love.gotPointsForHydratingRomulans = true;
+ _awayMission->love.missionScore += 2;
}
}
@@ -270,11 +270,11 @@ void Room::love4UseWaterOnRomulan() {
// These events don't make too much sense, probably cut in the original release, but
// they did get voice acted anyway.
if (false) {
- if (_vm->_awayMission.love.romulansUnconsciousFromVirus)
+ if (_awayMission->love.romulansUnconsciousFromVirus)
showText(TX_SPEAKER_MCCOY, TX_LOV4_009);
else {
showText(TX_LOV4N004);
- if (!_vm->_awayMission.redshirtDead) {
+ if (!_awayMission->redshirtDead) {
showText(TX_SPEAKER_FERRIS, TX_LOV4_029);
showText(TX_SPEAKER_KIRK, TX_LOV4_004);
}
diff --git a/engines/startrek/rooms/love5.cpp b/engines/startrek/rooms/love5.cpp
index fdad4a3..370f063 100644
--- a/engines/startrek/rooms/love5.cpp
+++ b/engines/startrek/rooms/love5.cpp
@@ -37,7 +37,7 @@ void Room::love5Tick1() {
loadActorAnim(OBJECT_8, "s3r6c1", 0x27, 0xa9);
- if (_vm->_awayMission.love.freedMarcusAndCheever) {
+ if (_awayMission->love.freedMarcusAndCheever) {
loadActorAnim(OBJECT_MARCUS, "marcusst", 0x28, 0xa6);
loadActorAnim(OBJECT_CHEEVER, "s3gtupst", 0x49, 0xac);
} else {
@@ -45,25 +45,25 @@ void Room::love5Tick1() {
loadActorAnim(OBJECT_CHEEVER, "s3gtup2", 0x49, 0xac);
}
- if (_vm->_awayMission.love.preaxCured)
+ if (_awayMission->love.preaxCured)
loadActorAnim(OBJECT_PREAX, "s3r6r3", 0x116, 0xba);
else
loadActorAnim(OBJECT_PREAX, "s3r6r2", 0x116, 0xba);
- if (_vm->_awayMission.love.releasedHumanLaughingGas)
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.releasedRomulanLaughingGas)
- _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
- _vm->_awayMission.timers[2] = 200;
+ if (_awayMission->love.releasedHumanLaughingGas)
+ _awayMission->timers[0] = getRandomWordInRange(200, 400);
+ if (_awayMission->love.releasedRomulanLaughingGas)
+ _awayMission->timers[1] = getRandomWordInRange(200, 400);
+ _awayMission->timers[2] = 200;
_roomVar.love.cmnXPosToCureSpock = 0x89;
_roomVar.love.cmnXPosToCureSpock = 0xb9;
}
void Room::love5TouchedWarp1() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.timers[4] = 10;
+ _awayMission->timers[4] = 10;
}
void Room::love5Timer4Expired() {
@@ -121,7 +121,7 @@ void Room::love5LookAtConsole() {
}
void Room::love5LookAtDrMarcus() {
- if (_vm->_awayMission.love.freedMarcusAndCheever)
+ if (_awayMission->love.freedMarcusAndCheever)
showText(TX_LOV5N001);
else {
// BUGFIX: originally played audio "LOV5N001", which is only the first sentence of
@@ -133,12 +133,12 @@ void Room::love5LookAtDrMarcus() {
}
void Room::love5LookAtDrCheever() {
- if (_vm->_awayMission.love.freedMarcusAndCheever)
+ if (_awayMission->love.freedMarcusAndCheever)
showText(TX_LOV5N000);
else {
showText(TX_LOV5N014);
showText(TX_SPEAKER_CHEEVER, TX_LOV5_057);
- if (!_vm->_awayMission.redshirtDead) {
+ if (!_awayMission->redshirtDead) {
showText(TX_SPEAKER_FERRIS, TX_LOV5_054);
showText(TX_SPEAKER_CHEEVER, TX_LOV5_058);
}
@@ -146,15 +146,15 @@ void Room::love5LookAtDrCheever() {
}
void Room::love5LookAtPreax() {
- if (_vm->_awayMission.love.preaxCured)
+ if (_awayMission->love.preaxCured)
showText(TX_LOV5N011);
else
showText(TX_LOV5N012);
}
void Room::love5TalkToPreax() {
- if (_vm->_awayMission.love.preaxCured) {
- if (!_vm->_awayMission.love.freedMarcusAndCheever)
+ if (_awayMission->love.preaxCured) {
+ if (!_awayMission->love.freedMarcusAndCheever)
showText(TX_LOV5N006);
else {
const int choices[] = {
@@ -193,9 +193,9 @@ void Room::love5TalkToPreax() {
showText(TX_SPEAKER_KIRK, TX_LOV5_002);
showText(TX_SPEAKER_MARCUS, TX_LOV5_045);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
- if (!_vm->_awayMission.love.spockCured) {
+ if (!_awayMission->love.spockCured) {
showText(TX_SPEAKER_MCCOY, TX_LOV5_021);
walkCrewmanC(OBJECT_MCCOY, 0x87, 0xc3, &Room::love5MccoyReachedSpockToCure);
} else
@@ -221,17 +221,17 @@ void Room::love5MccoyCuredSpock() {
void Room::love5EndMission() {
showText(TX_SPEAKER_KIRK, TX_LOV5_001);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
walkCrewmanC(OBJECT_KIRK, 0x64, 0xc2, &Room::love5CrewmanReachedBeamoutPosition);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
walkCrewmanC(OBJECT_SPOCK, 0x5a, 0xb8, &Room::love5CrewmanReachedBeamoutPosition);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
walkCrewmanC(OBJECT_MCCOY, 0x6e, 0xb8, &Room::love5CrewmanReachedBeamoutPosition);
- if (!_vm->_awayMission.redshirtDead) {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
+ if (!_awayMission->redshirtDead) {
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
walkCrewmanC(OBJECT_REDSHIRT, 0x69, 0xae, &Room::love5CrewmanReachedBeamoutPosition);
_roomVar.love.numCrewmenReadyToBeamOut--;
}
@@ -240,13 +240,13 @@ void Room::love5EndMission() {
void Room::love5CrewmanReachedBeamoutPosition() {
_roomVar.love.numCrewmenReadyToBeamOut++;
if (_roomVar.love.numCrewmenReadyToBeamOut == 3) {
- _vm->_awayMission.love.missionScore += 17;
- endMission(_vm->_awayMission.love.missionScore, 0x2c, 0);
+ _awayMission->love.missionScore += 17;
+ endMission(_awayMission->love.missionScore, 0x2c, 0);
}
}
void Room::love5TalkToDrMarcus() {
- if (!_vm->_awayMission.love.freedMarcusAndCheever)
+ if (!_awayMission->love.freedMarcusAndCheever)
showText(TX_SPEAKER_MARCUS, TX_LOV5_040);
else {
if (!haveItem(OBJECT_ICURE))
@@ -257,7 +257,7 @@ void Room::love5TalkToDrMarcus() {
}
void Room::love5TalkToDrCheever() {
- if (!_vm->_awayMission.love.freedMarcusAndCheever)
+ if (!_awayMission->love.freedMarcusAndCheever)
showText(TX_SPEAKER_CHEEVER, TX_LOV5_055);
else
showText(TX_SPEAKER_CHEEVER, TX_LOV5_056);
@@ -277,7 +277,7 @@ void Room::love5TalkToSpock() {
}
void Room::love5TalkToMccoy() {
- if (!_vm->_awayMission.love.preaxCured)
+ if (!_awayMission->love.preaxCured)
showText(TX_SPEAKER_MCCOY, TX_LOV5_014);
}
@@ -299,8 +299,8 @@ void Room::love5UseMTricorderOnMarcusOrCheever() {
}
void Room::love5UseMTricorderOnPreax() {
- if (!_vm->_awayMission.love.preaxCured) {
- if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas)
+ if (!_awayMission->love.preaxCured) {
+ if (_awayMission->love.romulansUnconsciousFromLaughingGas)
mccoyScan(DIR_E, TX_LOV5_024, false);
else
mccoyScan(DIR_E, TX_LOV5_016, false);
@@ -308,30 +308,30 @@ void Room::love5UseMTricorderOnPreax() {
}
void Room::love5UseMedkitOnPreax() {
- if (_vm->_awayMission.love.preaxCured)
+ if (_awayMission->love.preaxCured)
showText(TX_SPEAKER_MCCOY, TX_LOV5_015);
else
showText(TX_SPEAKER_MCCOY, TX_LOV5_019);
}
void Room::love5UseWaterOnPreax() {
- if (_vm->_awayMission.love.preaxCured) {
+ if (_awayMission->love.preaxCured) {
showText(TX_LOV5N018);
showText(TX_SPEAKER_MCCOY, TX_LOV5_029);
showText(TX_SPEAKER_KIRK, TX_LOV5_007);
- if (!_vm->_awayMission.love.gotPointsForHydratingPreax) {
- _vm->_awayMission.love.gotPointsForHydratingPreax = true;
- _vm->_awayMission.love.missionScore++;
+ if (!_awayMission->love.gotPointsForHydratingPreax) {
+ _awayMission->love.gotPointsForHydratingPreax = true;
+ _awayMission->love.missionScore++;
}
loseItem(OBJECT_IH2O);
} else {
- if (_vm->_awayMission.love.romulansUnconsciousFromVirus) {
+ if (_awayMission->love.romulansUnconsciousFromVirus) {
showText(TX_SPEAKER_MCCOY, TX_LOV5_013);
// BUGFIX: original didn't have correct speaker. Also, you shouldn't lose your
// water since it's not actually used here, so a "loseItem" line was removed.
} else {
showText(TX_LOV5N017);
- if (!_vm->_awayMission.redshirtDead) {
+ if (!_awayMission->redshirtDead) {
showText(TX_SPEAKER_FERRIS, TX_LOV5_053);
showText(TX_SPEAKER_KIRK, TX_LOV5_005);
}
@@ -340,9 +340,9 @@ void Room::love5UseWaterOnPreax() {
// BUGFIX: give a point for hydrating the Preax. It's inconsistent to only
// give points if he's already cured.
- if (!_vm->_awayMission.love.gotPointsForHydratingPreax) {
- _vm->_awayMission.love.gotPointsForHydratingPreax = true;
- _vm->_awayMission.love.missionScore++;
+ if (!_awayMission->love.gotPointsForHydratingPreax) {
+ _awayMission->love.gotPointsForHydratingPreax = true;
+ _awayMission->love.missionScore++;
}
}
}
@@ -354,7 +354,7 @@ void Room::love5UseCureSampleOnPreax() {
void Room::love5UseCureOnPreax() {
- if (!_vm->_awayMission.love.preaxCured)
+ if (!_awayMission->love.preaxCured)
walkCrewmanC(OBJECT_MCCOY, 0x116, 0xbf, &Room::love5ReachedPreaxUsingCure);
}
@@ -364,7 +364,7 @@ void Room::love5ReachedPreaxUsingCure() {
void Room::love5CuredPreax() {
walkCrewman(OBJECT_MCCOY, 0xdc, 0xc3);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
showText(TX_LOV5N007);
@@ -375,7 +375,7 @@ void Room::love5CuredPreax() {
showText(TX_SPEAKER_MCCOY, TX_LOV5_017);
loadActorAnim2(OBJECT_PREAX, "s3r6r1", 0x116, 0xba);
- _vm->_awayMission.love.preaxCured = true;
+ _awayMission->love.preaxCured = true;
}
@@ -386,10 +386,10 @@ void Room::love5UseAnythingOnPreax() {
// Kirk walks to Cheever, unties him, then walks to Marcus, unties her.
void Room::love5UseKirkOnMarcusOrCheever() {
- if (!_vm->_awayMission.love.freedMarcusAndCheever) {
- _vm->_awayMission.disableInput = true;
+ if (!_awayMission->love.freedMarcusAndCheever) {
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0x49, 0xb1, &Room::love5KirkReachedCheever);
- _vm->_awayMission.love.freedMarcusAndCheever = true;
+ _awayMission->love.freedMarcusAndCheever = true;
}
}
@@ -410,11 +410,11 @@ void Room::love5KirkUntiedMarcus() {
loadActorStandAnim(OBJECT_KIRK);
loadActorAnimC(OBJECT_MARCUS, "marcus", 0x28, 0xa6, &Room::love5MarcusStoodUp);
walkCrewman(OBJECT_KIRK, 0x35, 0xb9);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love5MarcusStoodUp() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_MARCUS, TX_LOV5_041);
}
diff --git a/engines/startrek/rooms/lovea.cpp b/engines/startrek/rooms/lovea.cpp
index e4e9f1c..2f0bf77 100644
--- a/engines/startrek/rooms/lovea.cpp
+++ b/engines/startrek/rooms/lovea.cpp
@@ -64,7 +64,7 @@ void Room::loveaTimer0Expired() {
const TextRef *textTable;
- if (randomVal == 0 || _vm->_awayMission.redshirtDead) {
+ if (randomVal == 0 || _awayMission->redshirtDead) {
speaker = TX_SPEAKER_MCCOY;
textTable = mccoyText;
} else {
@@ -76,7 +76,7 @@ void Room::loveaTimer0Expired() {
showText(speaker, textTable[randomVal]);
- if (!_vm->_awayMission.love.releasedRomulanLaughingGas) {
+ if (!_awayMission->love.releasedRomulanLaughingGas) {
const int spockText[] = {
TX_LOV0_029,
TX_LOV0_033,
@@ -88,7 +88,7 @@ void Room::loveaTimer0Expired() {
// BUG(?): This is in an if statement, meaning the human crewmen stop talking from
// laughing gas if Spock is under laughing gas effects. Might be intentional, to
// reduce "spamming" of text?
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
+ _awayMission->timers[0] = getRandomWordInRange(200, 400);
}
}
@@ -107,18 +107,18 @@ void Room::loveaTimer1Expired() {
showText(TX_SPEAKER_SPOCK, spockText[getRandomWordInRange(0, 7)]);
- _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
+ _awayMission->timers[1] = getRandomWordInRange(200, 400);
}
void Room::loveaUseMedkitOnSpock() {
- if (_vm->_awayMission.love.spockCured)
+ if (_awayMission->love.spockCured)
showText(TX_SPEAKER_MCCOY, TX_LOV5_015);
else
showText(TX_SPEAKER_MCCOY, TX_LOV5_019);
}
void Room::loveaUseCureSampleOnSpock() {
- if (_vm->_awayMission.love.spockCured) {
+ if (_awayMission->love.spockCured) {
walkCrewman(OBJECT_SPOCK, _roomVar.love.cmnXPosToCureSpock, _roomVar.love.cmnYPosToCureSpock, 99);
walkCrewman(OBJECT_MCCOY, _roomVar.love.cmnXPosToCureSpock, _roomVar.love.cmnYPosToCureSpock + 10, 99);
} else
@@ -127,7 +127,7 @@ void Room::loveaUseCureSampleOnSpock() {
void Room::loveaUseCureOnSpock() {
- if (_vm->_awayMission.love.spockCured)
+ if (_awayMission->love.spockCured)
showText(TX_SPEAKER_MCCOY, TX_LOV5_015);
else {
walkCrewman(OBJECT_SPOCK, _roomVar.love.cmnXPosToCureSpock, _roomVar.love.cmnYPosToCureSpock, 99);
@@ -146,37 +146,37 @@ void Room::loveaFinishedCuringSpock() {
showText(TX_SPEAKER_SPOCK, TX_LOV5_038);
showText(TX_SPEAKER_MCCOY, TX_LOV5_027);
showText(TX_SPEAKER_SPOCK, TX_LOV5C001);
- _vm->_awayMission.love.spockCured = true;
+ _awayMission->love.spockCured = true;
}
// Timer 2 counts down the time until Spock and the Romulans succumb to the virus.
// BUG(-ish): once Spock is cured, the romulans will never succumb to the virus.
void Room::loveaTimer2Expired() {
- if (!_vm->_awayMission.love.spockCured) {
- _vm->_awayMission.love.spockInfectionCounter++;
- if (_vm->_awayMission.love.spockInfectionCounter >= 100) { // Spock succumbs, game over
+ if (!_awayMission->love.spockCured) {
+ _awayMission->love.spockInfectionCounter++;
+ if (_awayMission->love.spockInfectionCounter >= 100) { // Spock succumbs, game over
loadActorAnim(OBJECT_SPOCK, "sgetdn", -1, -1, 0);
playMidiMusicTracks(2, -1); // FIXME: assembly had no second parameter...?
showText(TX_GENER004);
showGameOverMenu();
- } else if (_vm->_awayMission.love.spockInfectionCounter == 15) {
+ } else if (_awayMission->love.spockInfectionCounter == 15) {
showText(TX_SPEAKER_SPOCK, TX_SPOKCOFF);
- _vm->_awayMission.love.spockInfectionCounter++;
- } else if (_vm->_awayMission.love.spockInfectionCounter == 30) {
+ _awayMission->love.spockInfectionCounter++;
+ } else if (_awayMission->love.spockInfectionCounter == 30) {
showText(TX_SPEAKER_MCCOY, TX_LOVA_F08);
- _vm->_awayMission.love.spockInfectionCounter++;
- } else if (_vm->_awayMission.love.spockInfectionCounter == 45) {
+ _awayMission->love.spockInfectionCounter++;
+ } else if (_awayMission->love.spockInfectionCounter == 45) {
showText(TX_SPEAKER_SPOCK, TX_SPOKCOFF);
- _vm->_awayMission.love.spockInfectionCounter++;
- } else if (_vm->_awayMission.love.spockInfectionCounter == 60) {
+ _awayMission->love.spockInfectionCounter++;
+ } else if (_awayMission->love.spockInfectionCounter == 60) {
showText(TX_SPEAKER_SPOCK, TX_LOVA_F54);
- _vm->_awayMission.love.romulansUnconsciousFromVirus = true;
- _vm->_awayMission.love.spockInfectionCounter++;
+ _awayMission->love.romulansUnconsciousFromVirus = true;
+ _awayMission->love.spockInfectionCounter++;
}
}
- _vm->_awayMission.timers[2] = 200;
+ _awayMission->timers[2] = 200;
}
void Room::loveaUseMTricorderOnSpock() {
@@ -184,19 +184,19 @@ void Room::loveaUseMTricorderOnSpock() {
// (possible future enhancement?)
playSoundEffectIndex(SND_TRICORDER);
- if (_vm->_awayMission.love.spockCured)
+ if (_awayMission->love.spockCured)
showText(TX_SPEAKER_MCCOY, TX_LOVA_F01);
- else if (!_vm->_awayMission.love.knowAboutVirus)
+ else if (!_awayMission->love.knowAboutVirus)
showText(TX_SPEAKER_MCCOY, TX_LOVA_F02);
- else if (_vm->_awayMission.love.spockInfectionCounter < 10)
+ else if (_awayMission->love.spockInfectionCounter < 10)
showText(TX_SPEAKER_MCCOY, TX_LOVA_F04);
- else if (_vm->_awayMission.love.spockInfectionCounter < 30)
+ else if (_awayMission->love.spockInfectionCounter < 30)
showText(TX_SPEAKER_MCCOY, TX_LOVA_F03);
- else if (_vm->_awayMission.love.spockInfectionCounter < 50)
+ else if (_awayMission->love.spockInfectionCounter < 50)
showText(TX_SPEAKER_MCCOY, TX_LOVA_F08);
- else if (_vm->_awayMission.love.spockInfectionCounter < 70) // BUGFIX: < 70 instead of == 70
+ else if (_awayMission->love.spockInfectionCounter < 70) // BUGFIX: < 70 instead of == 70
showText(TX_SPEAKER_MCCOY, TX_TUG2_010);
- else if (_vm->_awayMission.love.spockInfectionCounter < 100)
+ else if (_awayMission->love.spockInfectionCounter < 100)
showText(TX_SPEAKER_MCCOY, TX_LOVA_F10);
else
showText(TX_SPEAKER_MCCOY, TX_LOVA_100);
@@ -209,22 +209,22 @@ void Room::loveaUseMTricorderOnHuman() {
void Room::loveaUseRomulanLaughingGas() {
showText(TX_LOV2N005);
- _vm->_awayMission.love.releasedRomulanLaughingGas = true;
+ _awayMission->love.releasedRomulanLaughingGas = true;
loseItem(OBJECT_IRLG);
// BUGFIX: start the effects immediately
- _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
+ _awayMission->timers[1] = getRandomWordInRange(200, 400);
}
void Room::loveaUseHumanLaughingGas() {
showText(TX_LOV2N005);
showText(TX_SPEAKER_SPOCK, TX_MUD2_040);
- _vm->_awayMission.love.releasedHumanLaughingGas = true;
+ _awayMission->love.releasedHumanLaughingGas = true;
loseItem(OBJECT_IN2O);
playMidiMusicTracks(3, -1); // FIXME: assembly had no second parameter...?
// BUGFIX: start the effects immediately
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
+ _awayMission->timers[0] = getRandomWordInRange(200, 400);
}
void Room::loveaUseAmmonia() {
@@ -242,7 +242,7 @@ void Room::loveaUseCommunicator() {
showText(TX_SPEAKER_KIRK, TX_MUD4_018);
showText(TX_SPEAKER_UHURA, TX_BRIDU146);
showText(TX_SPEAKER_KIRK, TX_VENA_F41);
- _vm->_awayMission.love.contactedEnterpriseBeforeCure = true;
+ _awayMission->love.contactedEnterpriseBeforeCure = true;
}
}
diff --git a/engines/startrek/rooms/mudd0.cpp b/engines/startrek/rooms/mudd0.cpp
index 0b450e0..ae9d682 100644
--- a/engines/startrek/rooms/mudd0.cpp
+++ b/engines/startrek/rooms/mudd0.cpp
@@ -46,27 +46,27 @@ void Room::mudd0Tick1() {
// the first meeting. Fixes an issue where Mudd appears in the first room when he's
// supposed to be in the medbay.
// TODO: verify this matches with floppy version's code
- if (_vm->_awayMission.mudd.muddFirstRoomState != 0)
- _vm->_awayMission.mudd.muddFirstRoomState = 2;
+ if (_awayMission->mudd.muddFirstRoomState != 0)
+ _awayMission->mudd.muddFirstRoomState = 2;
else {
- _vm->_awayMission.disableInput = 2;
+ _awayMission->disableInput = 2;
loadActorAnim(OBJECT_MUDD, "s4cbhr", 0xa2, 0xa9, 0);
}
}
void Room::mudd0Tick50() {
- if (!_vm->_awayMission.mudd.enteredRoom0ForFirstTime) {
+ if (!_awayMission->mudd.enteredRoom0ForFirstTime) {
playMidiMusicTracks(3);
- _vm->_awayMission.mudd.enteredRoom0ForFirstTime = true;
+ _awayMission->mudd.enteredRoom0ForFirstTime = true;
}
}
void Room::mudd0Tick60() {
- if (_vm->_awayMission.mudd.muddFirstRoomState == 0) {
+ if (_awayMission->mudd.muddFirstRoomState == 0) {
// ENHANCEMENT: Move this into if statement (related to above enhancement)
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
- _vm->_awayMission.mudd.muddFirstRoomState++;
+ _awayMission->mudd.muddFirstRoomState++;
showText(TX_SPEAKER_MUDD, TX_MUD0_037);
showText(TX_SPEAKER_KIRK, TX_MUD0_009);
@@ -90,13 +90,13 @@ void Room::mudd0UseCommunicator() {
}
void Room::mudd0LookAtFoodBox() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_MUD0N012);
}
void Room::mudd0LookAtComponentBox() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_MUD0N013);
}
@@ -106,19 +106,19 @@ void Room::mudd0LookAnywhere() {
}
void Room::mudd0LookAtMemoryDiskBox() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_MUD0N010);
}
void Room::mudd0LookAtDegrimerBox() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_MUD0N008);
}
void Room::mudd0LookAtLense() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_MUD0N014);
}
@@ -145,52 +145,52 @@ void Room::mudd0UseSTricorderOnMemoryDiskBox() {
void Room::mudd0UseSTricorderOnDegrimerBox() {
// Narrator says something, not Spock (so we don't use "spockScan" function)
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
loadActorAnim2(OBJECT_SPOCK, "sscanw", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_MUD0N000);
}
void Room::mudd0UseMTricorderOnLense() {
- if (_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction)
+ if (_awayMission->mudd.discoveredLenseAndDegrimerFunction)
mccoyScan(DIR_E, TX_MUD0_012, true);
else
mccoyScan(DIR_E, TX_MUD0_013, true);
}
void Room::mudd0GetLense() {
- if (_vm->_awayMission.mudd.gotLense)
+ if (_awayMission->mudd.gotLense)
showText(TX_MUD0N016);
else {
- _vm->_awayMission.mudd.gotLense = true;
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->mudd.gotLense = true;
+ _awayMission->mudd.missionScore++;
giveItem(OBJECT_ILENSES);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
loadActorAnim2(OBJECT_KIRK, "s5r1kg", -1, -1);
- _vm->_awayMission.timers[1] = 27;
+ _awayMission->timers[1] = 27;
}
}
void Room::mudd0GetMemoryDisk() {
- if (_vm->_awayMission.mudd.gotMemoryDisk)
+ if (_awayMission->mudd.gotMemoryDisk)
showText(TX_MUD0N016);
else {
- _vm->_awayMission.mudd.gotMemoryDisk = true;
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->mudd.gotMemoryDisk = true;
+ _awayMission->mudd.missionScore++;
giveItem(OBJECT_IDISKS);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
loadActorAnimC(OBJECT_KIRK, "kuseln", -1, -1, &Room::mudd0PickedUpItem);
}
}
void Room::mudd0GetDegrimer() {
- if (_vm->_awayMission.mudd.gotDegrimer)
+ if (_awayMission->mudd.gotDegrimer)
showText(TX_MUD0N016);
else {
- _vm->_awayMission.mudd.gotDegrimer = true;
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->mudd.gotDegrimer = true;
+ _awayMission->mudd.missionScore++;
giveItem(OBJECT_IDEGRIME);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
loadActorAnimC(OBJECT_KIRK, "kusemw", -1, -1, &Room::mudd0PickedUpItem);
}
}
@@ -202,14 +202,14 @@ void Room::mudd0PickedUpLense() {
}
void Room::mudd0PickedUpItem() {
- _vm->_awayMission.disableInput = false; // NOTE: this was never set to true
+ _awayMission->disableInput = false; // NOTE: this was never set to true
showText(TX_LOV1N007);
}
void Room::mudd0WalkToSouthDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0x5a, 0xc7);
}
@@ -220,7 +220,7 @@ void Room::mudd0TouchedHotspot1() { // Trigger bottom door opening
void Room::mudd0WalkToNorthDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0xa0, 0x68);
}
@@ -256,7 +256,7 @@ void Room::mudd0LookAtMudd() {
}
void Room::mudd0TalkToKirk() {
- if (_vm->_awayMission.mudd.muddFirstRoomState == 2)
+ if (_awayMission->mudd.muddFirstRoomState == 2)
showText(TX_SPEAKER_KIRK, TX_MUD0_010);
else {
showText(TX_SPEAKER_KIRK, TX_MUD0_010);
@@ -266,7 +266,7 @@ void Room::mudd0TalkToKirk() {
}
void Room::mudd0TalkToSpock() {
- if (_vm->_awayMission.mudd.muddFirstRoomState == 2)
+ if (_awayMission->mudd.muddFirstRoomState == 2)
showText(TX_SPEAKER_SPOCK, TX_MUD0_022);
else {
showText(TX_SPEAKER_SPOCK, TX_MUD0_022);
@@ -278,7 +278,7 @@ void Room::mudd0TalkToSpock() {
}
void Room::mudd0TalkToMccoy() {
- if (_vm->_awayMission.mudd.muddFirstRoomState == 2)
+ if (_awayMission->mudd.muddFirstRoomState == 2)
showText(TX_SPEAKER_MCCOY, TX_MUD0_016);
else {
showText(TX_SPEAKER_MCCOY, TX_MUD0_016);
@@ -289,7 +289,7 @@ void Room::mudd0TalkToMccoy() {
}
void Room::mudd0TalkToRedshirt() {
- if (_vm->_awayMission.mudd.muddFirstRoomState == 2) {
+ if (_awayMission->mudd.muddFirstRoomState == 2) {
showText(TX_SPEAKER_BUCHERT, TX_MUD0_039);
showText(TX_SPEAKER_KIRK, TX_MUD0_008);
} else {
diff --git a/engines/startrek/rooms/mudd1.cpp b/engines/startrek/rooms/mudd1.cpp
index d741478..f3da753 100644
--- a/engines/startrek/rooms/mudd1.cpp
+++ b/engines/startrek/rooms/mudd1.cpp
@@ -48,14 +48,14 @@ namespace StarTrek {
void Room::mudd1Tick1() {
playVoc("MUD1LOOP"); // BUGFIX: moved this out of below if statement
- if (!_vm->_awayMission.mudd.enteredRoom1ForFirstTime) {
+ if (!_awayMission->mudd.enteredRoom1ForFirstTime) {
playMidiMusicTracks(0);
- _vm->_awayMission.mudd.enteredRoom1ForFirstTime = true;
+ _awayMission->mudd.enteredRoom1ForFirstTime = true;
}
loadActorAnim2(OBJECT_CRANE, "s4wbhs", 0x9b, 0x31);
- if (!_vm->_awayMission.mudd.torpedoLoaded)
+ if (!_awayMission->mudd.torpedoLoaded)
loadActorAnim(OBJECT_TORPEDO, "s4wbcs", 0x32, 0x65);
}
@@ -70,20 +70,20 @@ void Room::mudd1UseCommunicator() {
void Room::mudd1UseSpockOnBlueButton() { // Loads up the torpedo
- if (!_vm->_awayMission.mudd.torpedoLoaded) {
+ if (!_awayMission->mudd.torpedoLoaded) {
walkCrewmanC(OBJECT_SPOCK, 0x2f, 0x9f, &Room::mudd1SpockReachedBlueButton);
- _vm->_awayMission.disableInput = true;
- if (!_vm->_awayMission.mudd.gotPointsForLoadingTorpedo) {
- _vm->_awayMission.mudd.gotPointsForLoadingTorpedo = true;
- _vm->_awayMission.mudd.missionScore += 2;
+ _awayMission->disableInput = true;
+ if (!_awayMission->mudd.gotPointsForLoadingTorpedo) {
+ _awayMission->mudd.gotPointsForLoadingTorpedo = true;
+ _awayMission->mudd.missionScore += 2;
}
}
}
void Room::mudd1SpockReachedBlueButton() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
loadActorAnimC(OBJECT_SPOCK, "susemn", -1, -1, &Room::mudd1SpockPressedBlueButton);
- _vm->_awayMission.timers[1] = 5;
+ _awayMission->timers[1] = 5;
}
void Room::mudd1SpockPressedBlueButton() {
@@ -91,14 +91,14 @@ void Room::mudd1SpockPressedBlueButton() {
loadActorAnim(OBJECT_CRANE, "s4wbcr");
loadActorAnim(OBJECT_TORPEDO, "s4wbcn");
loadActorAnimC(OBJECT_CRANE_ANIMATION, "s4wbsl", 0x77, 0x83, &Room::mudd1CraneFinishedMoving);
- _vm->_awayMission.mudd.torpedoLoaded = true;
+ _awayMission->mudd.torpedoLoaded = true;
}
void Room::mudd1CraneFinishedMoving() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
walkCrewman(OBJECT_SPOCK, 0x43, 0x9f);
- if (_vm->_awayMission.mudd.torpedoLoaded)
+ if (_awayMission->mudd.torpedoLoaded)
showText(TX_SPEAKER_SPOCK, TX_MUD1_017);
else
showText(TX_SPEAKER_SPOCK, TX_MUD1_016);
@@ -106,16 +106,16 @@ void Room::mudd1CraneFinishedMoving() {
void Room::mudd1UseSpockOnYellowButton() { // Unloads the torpedo
- if (_vm->_awayMission.mudd.torpedoLoaded) {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ if (_awayMission->mudd.torpedoLoaded) {
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
walkCrewmanC(OBJECT_SPOCK, 0x2f, 0x9f, &Room::mudd1SpockReachedYellowButton);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
}
void Room::mudd1SpockReachedYellowButton() {
loadActorAnim2(OBJECT_SPOCK, "susemn", -1, -1, 3);
- _vm->_awayMission.timers[1] = 5;
+ _awayMission->timers[1] = 5;
}
void Room::mudd1SpockPressedYellowButton() {
@@ -123,24 +123,24 @@ void Room::mudd1SpockPressedYellowButton() {
loadActorAnim2(OBJECT_CRANE, "s4wbhb");
loadActorAnim2(OBJECT_TORPEDO, "s4wbcb", 0x32, 0x65, 0);
loadActorAnimC(OBJECT_CRANE_ANIMATION, "s4wbsb", -1, -1, &Room::mudd1CraneFinishedMoving);
- _vm->_awayMission.mudd.torpedoLoaded = false;
+ _awayMission->mudd.torpedoLoaded = false;
}
void Room::mudd1UseSpockOnRedButton() {
- if (_vm->_awayMission.mudd.torpedoLoaded) {
+ if (_awayMission->mudd.torpedoLoaded) {
walkCrewmanC(OBJECT_SPOCK, 0x2f, 0x9f, &Room::mudd1SpockReachedRedButton);
- _vm->_awayMission.disableInput = true;
- if (!_vm->_awayMission.mudd.gotPointsForPressingRedButton) {
- _vm->_awayMission.mudd.gotPointsForPressingRedButton = true;
- _vm->_awayMission.mudd.missionScore += 3;
+ _awayMission->disableInput = true;
+ if (!_awayMission->mudd.gotPointsForPressingRedButton) {
+ _awayMission->mudd.gotPointsForPressingRedButton = true;
+ _awayMission->mudd.missionScore += 3;
}
}
}
void Room::mudd1SpockReachedRedButton() {
loadActorAnimC(OBJECT_SPOCK, "susemn", -1, -1, &Room::mudd1SpockPressedRedButton);
- _vm->_awayMission.timers[1] = 5;
+ _awayMission->timers[1] = 5;
}
void Room::mudd1SpockPressedRedButton() {
@@ -150,8 +150,8 @@ void Room::mudd1SpockPressedRedButton() {
showText(TX_SPEAKER_SPOCK, TX_MUD1_021);
showText(TX_SPEAKER_SPOCK, TX_MUD1_023);
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.mudd.knowAboutTorpedo = true;
+ _awayMission->disableInput = false;
+ _awayMission->mudd.knowAboutTorpedo = true;
const int choices[] = {
TX_SPEAKER_KIRK,
@@ -165,7 +165,7 @@ void Room::mudd1SpockPressedRedButton() {
switch (choice) {
case 0:
- _vm->_awayMission.mudd.torpedoStatus = 0;
+ _awayMission->mudd.torpedoStatus = 0;
// ENHANCEMENT: Original text was just "(Spock raises eyebrow)" without any audio.
// This changes it to a narration to make it flow better.
@@ -177,7 +177,7 @@ void Room::mudd1SpockPressedRedButton() {
// fall through
case 2:
- _vm->_awayMission.mudd.torpedoStatus = 1;
+ _awayMission->mudd.torpedoStatus = 1;
showText(TX_SPEAKER_UHURA, TX_STATICU1);
break;
}
@@ -284,7 +284,7 @@ void Room::mudd1TalkToRedshirt() {
void Room::mudd1WalkToSouthDoor() {
_roomVar.mudd.walkingToDoor = 1;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0xa0, 0xc7);
}
@@ -296,7 +296,7 @@ void Room::mudd1TouchedHotspot2() { // Trigger door at bottom of room
void Room::mudd1WalkToNorthDoor() {
_roomVar.mudd.walkingToDoor = 1;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0xab, 0x71);
}
@@ -309,7 +309,7 @@ void Room::mudd1TouchedHotspot1() { // Trigger door at top of room
void Room::mudd1WalkToWestDoor() {
_roomVar.mudd.walkingToDoor = 2;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0x35, 0x71);
}
diff --git a/engines/startrek/rooms/mudd2.cpp b/engines/startrek/rooms/mudd2.cpp
index ef1ec6a..43c381a 100644
--- a/engines/startrek/rooms/mudd2.cpp
+++ b/engines/startrek/rooms/mudd2.cpp
@@ -38,7 +38,7 @@ namespace StarTrek {
void Room::mudd2WalkToNorthDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0xbc, 0x6a);
}
@@ -51,7 +51,7 @@ void Room::mudd2TouchedHotspot0() { // Trigger north door
void Room::mudd2WalkToSouthDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0x46, 0x6f);
}
@@ -63,33 +63,33 @@ void Room::mudd2TouchedHotspot1() {
void Room::mudd2Tick1() {
playVoc("MUD2LOOP");
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
- _vm->_awayMission.mudd.muddCurrentlyInsane = false;
-
- if (_vm->_awayMission.mudd.muddInsanityState == 0) { // First time entering room
- _vm->_awayMission.mudd.muddInsanityState = 1;
- } else if (_vm->_awayMission.mudd.muddInsanityState == 2) { // Currently insane
- _vm->_awayMission.mudd.muddCurrentlyInsane = true;
- if (!_vm->_awayMission.mudd.muddUnconscious) {
- _vm->_awayMission.mudd.muddUnconscious = false;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ _awayMission->mudd.muddCurrentlyInsane = false;
+
+ if (_awayMission->mudd.muddInsanityState == 0) { // First time entering room
+ _awayMission->mudd.muddInsanityState = 1;
+ } else if (_awayMission->mudd.muddInsanityState == 2) { // Currently insane
+ _awayMission->mudd.muddCurrentlyInsane = true;
+ if (!_awayMission->mudd.muddUnconscious) {
+ _awayMission->mudd.muddUnconscious = false;
loadActorAnim2(OBJECT_MUDD, "s4sbhn", 0x9f, 0xbf);
loadActorAnim2(OBJECT_CAPSULE, "s4sbvp", 0x93, 0xc3);
} else {
loadActorAnim2(OBJECT_MUDD, "s4sbob", 0x9f, 0xba);
}
- } else if (_vm->_awayMission.mudd.muddUnavailable) {
- _vm->_awayMission.mudd.muddInsanityState = 1;
- } else if (_vm->_awayMission.mudd.muddInsanityState == 1) { // Second time entering room, start cutscene
+ } else if (_awayMission->mudd.muddUnavailable) {
+ _awayMission->mudd.muddInsanityState = 1;
+ } else if (_awayMission->mudd.muddInsanityState == 1) { // Second time entering room, start cutscene
playMidiMusicTracks(3);
loadActorAnim2(OBJECT_MUDD, "s4sbhw", 0x99, 0xbf);
- _vm->_awayMission.disableInput = 2;
- _vm->_awayMission.mudd.muddInhaledGas = true;
- _vm->_awayMission.timers[1] = 70;
- _vm->_awayMission.mudd.muddInsanityState = 2;
- _vm->_awayMission.mudd.muddUnavailable = true;
+ _awayMission->disableInput = 2;
+ _awayMission->mudd.muddInhaledGas = true;
+ _awayMission->timers[1] = 70;
+ _awayMission->mudd.muddInsanityState = 2;
+ _awayMission->mudd.muddUnavailable = true;
}
}
@@ -106,8 +106,8 @@ void Room::mudd2UseSpockOnCapsules() {
}
void Room::mudd2GetCapsules() {
- if (!_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
- if (!_vm->_awayMission.mudd.translatedAlienLanguage)
+ if (!_awayMission->mudd.muddInhaledGas || _awayMission->mudd.muddUnconscious) {
+ if (!_awayMission->mudd.translatedAlienLanguage)
showText(TX_SPEAKER_MCCOY, TX_MUD2_024);
else
walkCrewmanC(OBJECT_MCCOY, 0x9f, 0xbf, &Room::mudd2MccoyReachedCapsules);
@@ -122,7 +122,7 @@ void Room::mudd2MccoyReachedCapsules() {
}
void Room::mudd2MccoyPickedUpCapsules() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
walkCrewman(OBJECT_MCCOY, 0xfe, 0xb2);
}
@@ -142,39 +142,39 @@ void Room::mudd2UseMTricorderOnCapsules() {
}
void Room::mudd2UseCapsuleOnControlPanel() {
- if (!_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious)
+ if (!_awayMission->mudd.muddInhaledGas || _awayMission->mudd.muddUnconscious)
walkCrewmanC(OBJECT_MCCOY, 0x9f, 0xbf, &Room::mudd2MccoyReachedControlPanel);
else
showText(TX_SPEAKER_MCCOY, TX_MUD2_023);
}
void Room::mudd2MccoyReachedControlPanel() {
- if (_vm->_awayMission.mudd.translatedAlienLanguage)
+ if (_awayMission->mudd.translatedAlienLanguage)
loadActorAnimC(OBJECT_MCCOY, "musehn", -1, -1, &Room::mudd2MccoyPutCapsuleInControlPanel);
else // NOTE: Unused, since you can't get capsules without translating the language first
showText(TX_SPEAKER_MCCOY, TX_MUD2_014);
}
void Room::mudd2MccoyPutCapsuleInControlPanel() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
loadActorStandAnim(OBJECT_MCCOY);
showText(TX_SPEAKER_MCCOY, TX_MUD2_020);
showText(TX_SPEAKER_MCCOY, TX_MUD2_029);
showText(TX_SPEAKER_SPOCK, TX_MUD2_039);
- if (_vm->_awayMission.mudd.muddUnconscious)
+ if (_awayMission->mudd.muddUnconscious)
showText(TX_SPEAKER_MCCOY, TX_MUD2_034);
- _vm->_awayMission.mudd.putCapsuleInMedicalMachine = true;
+ _awayMission->mudd.putCapsuleInMedicalMachine = true;
loseItem(OBJECT_ICAPSULE);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
walkCrewman(OBJECT_MCCOY, 0xfe, 0xb2);
}
void Room::mudd2UseKirkOnBed() {
- if (!_vm->_awayMission.mudd.putCapsuleInMedicalMachine && !_vm->_awayMission.mudd.translatedAlienLanguage) {
+ if (!_awayMission->mudd.putCapsuleInMedicalMachine && !_awayMission->mudd.translatedAlienLanguage) {
walkCrewmanC(OBJECT_KIRK, 0xd7, 0xbd, &Room::mudd2KirkReachedBed);
- } else if (_vm->_awayMission.mudd.translatedAlienLanguage) {
+ } else if (_awayMission->mudd.translatedAlienLanguage) {
walkCrewman(OBJECT_KIRK, 0xd7, 0xbd, 7); // BUG(?): no continuation?
}
}
@@ -195,7 +195,7 @@ void Room::mudd2MuddNoticedKirk() {
void Room::mudd2MuddDroppedCapsule() {
loadActorAnim2(OBJECT_MUDD, "s4sbhn", 0x9f, 0xbf, 3); // NOTE: no callback from this
loadActorAnim2(OBJECT_CAPSULE, "s4sbvp", 0x93, 0xc3);
- _vm->_awayMission.mudd.muddCurrentlyInsane = true;
+ _awayMission->mudd.muddCurrentlyInsane = true;
showText(TX_SPEAKER_MCCOY, TX_MUD2_032);
showText(TX_SPEAKER_MUDD, TX_MUD2_049);
@@ -204,12 +204,12 @@ void Room::mudd2MuddDroppedCapsule() {
showText(TX_SPEAKER_MCCOY, TX_MUD2_031);
showText(TX_SPEAKER_MUDD, TX_MUD2_050);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::mudd2UsePhaserOnMudd() {
- if (_vm->_awayMission.mudd.muddInhaledGas && !_vm->_awayMission.mudd.muddUnconscious) {
+ if (_awayMission->mudd.muddInhaledGas && !_awayMission->mudd.muddUnconscious) {
showText(TX_SPEAKER_BUCHERT, TX_MUD2_053);
showText(TX_SPEAKER_MUDD, TX_MUD2_042);
showText(TX_SPEAKER_MUDD, TX_MUD2_043);
@@ -219,8 +219,8 @@ void Room::mudd2UsePhaserOnMudd() {
// Spock neck-pinches Mudd
void Room::mudd2UseSpockOnMudd() {
- if (_vm->_awayMission.mudd.muddInhaledGas && !_vm->_awayMission.mudd.muddUnconscious) {
- _vm->_awayMission.disableInput = true;
+ if (_awayMission->mudd.muddInhaledGas && !_awayMission->mudd.muddUnconscious) {
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_SPOCK, 0x8a, 0xbf, &Room::mudd2SpockReachedMudd);
}
}
@@ -236,14 +236,14 @@ void Room::mudd2SpockPinchedMudd() {
showText(TX_SPEAKER_SPOCK, TX_MUD2_012);
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.mudd.muddUnconscious = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->disableInput = false;
+ _awayMission->mudd.muddUnconscious = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0x118, 0xc4);
}
void Room::mudd2UseKirkOnMudd() {
- if (_vm->_awayMission.mudd.muddInhaledGas && !_vm->_awayMission.mudd.muddUnconscious) {
+ if (_awayMission->mudd.muddInhaledGas && !_awayMission->mudd.muddUnconscious) {
showText(TX_SPEAKER_KIRK, TX_MUD2_001);
mudd2UseSpockOnMudd();
}
@@ -251,14 +251,14 @@ void Room::mudd2UseKirkOnMudd() {
void Room::mudd2UseRedshirtOnMudd() {
- if (_vm->_awayMission.mudd.muddInhaledGas && !_vm->_awayMission.mudd.muddUnconscious) {
- _vm->_awayMission.disableInput = true;
+ if (_awayMission->mudd.muddInhaledGas && !_awayMission->mudd.muddUnconscious) {
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_REDSHIRT, 0xc3, 0xbe, &Room::mudd2RedshirtReachedMudd);
}
}
void Room::mudd2RedshirtReachedMudd() {
- _vm->_awayMission.timers[2] = 8;
+ _awayMission->timers[2] = 8;
loadActorAnimC(OBJECT_REDSHIRT, "s4sbrh", -1, -1, &Room::mudd2RedshirtPushedAway);
playVoc("ROCKFACE");
loadActorAnimC(OBJECT_MUDD, "s4sbhh", 0x9f, 0xbf, &Room::mudd2MuddFinishedPushingRedshirt);
@@ -275,8 +275,8 @@ void Room::mudd2MuddFinishedPushingRedshirt() {
void Room::mudd2RedshirtPushedAway() {
showText(TX_SPEAKER_BUCHERT, TX_MUD2_052);
loadActorAnim(OBJECT_REDSHIRT, "rstnds", 0xd8, 0xc3);
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ _awayMission->disableInput = false;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
walkCrewman(OBJECT_REDSHIRT, 0x117, 0xae);
}
@@ -286,18 +286,18 @@ void Room::mudd2RedshirtPushedAway() {
// OBJECT_IMTRICOR in a USE action.
// The function itself was also modified (ie. condition for showing text was inverted).
void Room::mudd2UseMTricorderOnMudd() {
- if (_vm->_awayMission.mudd.muddInhaledGas && !_vm->_awayMission.mudd.muddUnconscious)
+ if (_awayMission->mudd.muddInhaledGas && !_awayMission->mudd.muddUnconscious)
mccoyScan(DIR_W, TX_MUD2_013, false);
}
void Room::mudd2UseMedkitOnMudd() {
- if (!_vm->_awayMission.mudd.muddInhaledGas)
+ if (!_awayMission->mudd.muddInhaledGas)
return;
- else if (_vm->_awayMission.mudd.muddUnconscious) {
- if (!_vm->_awayMission.mudd.translatedAlienLanguage)
+ else if (_awayMission->mudd.muddUnconscious) {
+ if (!_awayMission->mudd.translatedAlienLanguage)
showText(TX_SPEAKER_MCCOY, TX_MUD2_015);
- else if (!_vm->_awayMission.mudd.putCapsuleInMedicalMachine)
+ else if (!_awayMission->mudd.putCapsuleInMedicalMachine)
showText(TX_SPEAKER_MCCOY, TX_MUD2_021);
else
walkCrewmanC(OBJECT_MCCOY, 0xde, 0xaf, &Room::mudd2MccoyReachedMudd);
@@ -306,20 +306,20 @@ void Room::mudd2UseMedkitOnMudd() {
}
void Room::mudd2MccoyReachedMudd() {
- _vm->_awayMission.mudd.missionScore += 2;
+ _awayMission->mudd.missionScore += 2;
loadActorAnimC(OBJECT_MCCOY, "s4sbms", -1, -1, &Room::mudd2MccoyCuredMudd);
}
void Room::mudd2MccoyCuredMudd() {
- _vm->_awayMission.mudd.muddUnavailable = false;
- _vm->_awayMission.mudd.muddInsanityState = 3;
- _vm->_awayMission.mudd.muddCurrentlyInsane = false;
- _vm->_awayMission.mudd.muddInhaledGas = false;
+ _awayMission->mudd.muddUnavailable = false;
+ _awayMission->mudd.muddInsanityState = 3;
+ _awayMission->mudd.muddCurrentlyInsane = false;
+ _awayMission->mudd.muddInhaledGas = false;
showText(TX_SPEAKER_MCCOY, TX_MUD2_033);
showText(TX_SPEAKER_MUDD, TX_MUD2_045);
- _vm->_awayMission.mudd.muddUnconscious = false;
+ _awayMission->mudd.muddUnconscious = false;
}
@@ -354,7 +354,7 @@ void Room::mudd2LookAtBed() {
void Room::mudd2TalkToKirk() {
// BUGFIX: second condition in if statement changed to "must be false" instead of
// "must be true". (Same applies to below talk functions.)
- if (!_vm->_awayMission.mudd.muddCurrentlyInsane || !_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious)
+ if (!_awayMission->mudd.muddCurrentlyInsane || !_awayMission->mudd.muddInhaledGas || _awayMission->mudd.muddUnconscious)
showText(TX_SPEAKER_KIRK, TX_MUD2_010);
else {
showText(TX_SPEAKER_KIRK, TX_MUD2_005);
@@ -364,7 +364,7 @@ void Room::mudd2TalkToKirk() {
}
void Room::mudd2TalkToSpock() {
- if (!_vm->_awayMission.mudd.muddCurrentlyInsane || !_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
+ if (!_awayMission->mudd.muddCurrentlyInsane || !_awayMission->mudd.muddInhaledGas || _awayMission->mudd.muddUnconscious) {
showText(TX_SPEAKER_SPOCK, TX_MUD2_040);
showText(TX_SPEAKER_KIRK, TX_MUD2_011);
} else {
@@ -373,7 +373,7 @@ void Room::mudd2TalkToSpock() {
}
void Room::mudd2TalkToMccoy() {
- if (!_vm->_awayMission.mudd.muddCurrentlyInsane || !_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
+ if (!_awayMission->mudd.muddCurrentlyInsane || !_awayMission->mudd.muddInhaledGas || _awayMission->mudd.muddUnconscious) {
showText(TX_SPEAKER_MCCOY, TX_MUD2_025);
showText(TX_SPEAKER_KIRK, TX_MUD2_007);
} else {
@@ -382,7 +382,7 @@ void Room::mudd2TalkToMccoy() {
}
void Room::mudd2TalkToRedshirt() {
- if (!_vm->_awayMission.mudd.muddCurrentlyInsane || !_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
+ if (!_awayMission->mudd.muddCurrentlyInsane || !_awayMission->mudd.muddInhaledGas || _awayMission->mudd.muddUnconscious) {
showText(TX_SPEAKER_BUCHERT, TX_MUD2_054);
showText(TX_SPEAKER_KIRK, TX_MUD2_008);
} else {
@@ -393,9 +393,9 @@ void Room::mudd2TalkToRedshirt() {
}
void Room::mudd2TalkToMudd() {
- if (!_vm->_awayMission.mudd.muddCurrentlyInsane || !_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious)
+ if (!_awayMission->mudd.muddCurrentlyInsane || !_awayMission->mudd.muddInhaledGas || _awayMission->mudd.muddUnconscious)
return;
- else if (_vm->_awayMission.mudd.muddInhaledGas) {
+ else if (_awayMission->mudd.muddInhaledGas) {
showText(TX_SPEAKER_MUDD, TX_MUD2_048);
showText(TX_SPEAKER_MCCOY, TX_MUD2_028);
} else { // NOTE: Unused (assumes harry is in a normal state, which doesn't happen here)
diff --git a/engines/startrek/rooms/mudd3.cpp b/engines/startrek/rooms/mudd3.cpp
index 792e749..eb02450 100644
--- a/engines/startrek/rooms/mudd3.cpp
+++ b/engines/startrek/rooms/mudd3.cpp
@@ -42,24 +42,24 @@ namespace StarTrek {
void Room::mudd3Tick1() {
playVoc("MUD3LOOP");
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
- if (_vm->_awayMission.mudd.databaseDestroyed) {
+ if (_awayMission->mudd.databaseDestroyed) {
loadActorAnim(OBJECT_9, "s4lbpb", 0xa2, 0x9f);
// FIXME: is this supposed to be in this if statement?
- if (!_vm->_awayMission.mudd.tookRepairTool)
+ if (!_awayMission->mudd.tookRepairTool)
loadActorAnim(OBJECT_REPAIR_TOOL, "s4lbdv", 0xb7, 0xa8);
}
- _vm->_awayMission.mudd.muddInDatabaseRoom = false;
+ _awayMission->mudd.muddInDatabaseRoom = false;
- if (!_vm->_awayMission.mudd.muddVisitedDatabaseRoom && _vm->_awayMission.mudd.translatedAlienLanguage && !_vm->_awayMission.mudd.muddUnavailable) {
- _vm->_awayMission.mudd.muddVisitedDatabaseRoom = true;
+ if (!_awayMission->mudd.muddVisitedDatabaseRoom && _awayMission->mudd.translatedAlienLanguage && !_awayMission->mudd.muddUnavailable) {
+ _awayMission->mudd.muddVisitedDatabaseRoom = true;
loadActorAnim(OBJECT_MUDD, "s4lbhs", 0xa2, 0x9f);
playMidiMusicTracks(3);
- _vm->_awayMission.mudd.muddInDatabaseRoom = true;
- _vm->_awayMission.timers[2] = 10;
+ _awayMission->mudd.muddInDatabaseRoom = true;
+ _awayMission->timers[2] = 10;
}
}
@@ -71,7 +71,7 @@ void Room::mudd3UseCommunicator() {
void Room::mudd3LookAtScreen() {
// BUGFIX: the condition was flipped in the original; the more "vague" description
// should be shown before the alien language is understood.
- if (_vm->_awayMission.mudd.translatedAlienLanguage)
+ if (_awayMission->mudd.translatedAlienLanguage)
showText(TX_SPEAKER_SPOCK, TX_MUD3_038);
else
showText(TX_MUD3N017);
@@ -86,18 +86,18 @@ void Room::mudd3UseSTricorderOnScreen() {
// BUGFIX: Event was actually "use screen on kirk", which makes no sense.
void Room::mudd3UseKirkOnScreen() {
- if (!_vm->_awayMission.mudd.translatedAlienLanguage) {
+ if (!_awayMission->mudd.translatedAlienLanguage) {
showText(TX_MUD3N011);
showText(TX_SPEAKER_SPOCK, TX_MUD3_037);
}
}
void Room::mudd3UseSpockOnSphere() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
loadActorStandAnim(OBJECT_SPOCK);
- if (_vm->_awayMission.mudd.computerDataErasedOrDestroyed) {
- if (!_vm->_awayMission.mudd.databaseDestroyed) {
+ if (_awayMission->mudd.computerDataErasedOrDestroyed) {
+ if (!_awayMission->mudd.databaseDestroyed) {
showText(TX_MUD3N000);
showText(TX_SPEAKER_SPOCK, TX_MUD3_052);
showText(TX_SPEAKER_KIRK, TX_MUD3_012);
@@ -107,11 +107,11 @@ void Room::mudd3UseSpockOnSphere() {
showText(TX_SPEAKER_SPOCK, TX_MUD3_048);
showText(TX_SPEAKER_KIRK, TX_MUD3_008);
showText(TX_SPEAKER_SPOCK, TX_MUD3_051);
- } else if (_vm->_awayMission.mudd.translatedAlienLanguage) {
- if (_vm->_awayMission.mudd.accessedAlienDatabase)
+ } else if (_awayMission->mudd.translatedAlienLanguage) {
+ if (_awayMission->mudd.accessedAlienDatabase)
showText(TX_SPEAKER_SPOCK, TX_MUD3_035);
else {
- _vm->_awayMission.mudd.accessedAlienDatabase = true;
+ _awayMission->mudd.accessedAlienDatabase = true;
showText(TX_SPEAKER_SPOCK, TX_MUD3_054);
showText(TX_SPEAKER_MCCOY, TX_MUD3_032);
@@ -120,23 +120,23 @@ void Room::mudd3UseSpockOnSphere() {
showText(TX_SPEAKER_SPOCK, TX_MUD3_046);
showText(TX_SPEAKER_KIRK, TX_MUD3_007);
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->mudd.missionScore++;
playVoc("LSHAIANS");
loadActorAnim(OBJECT_ALIEN_IMAGE, "s4lbap", 0x32, 0x64);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
loadActorStandAnim(OBJECT_KIRK);
loadActorStandAnim(OBJECT_SPOCK);
loadActorStandAnim(OBJECT_MCCOY);
loadActorStandAnim(OBJECT_REDSHIRT);
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.timers[3] = 40;
+ _awayMission->disableInput = true;
+ _awayMission->timers[3] = 40;
}
- } else if (_vm->_awayMission.mudd.discoveredBase3System) {
+ } else if (_awayMission->mudd.discoveredBase3System) {
showText(TX_SPEAKER_SPOCK, TX_MUD3_043);
showText(TX_SPEAKER_MCCOY, TX_MUD3_022);
showText(TX_SPEAKER_SPOCK, TX_MUD3_056);
@@ -145,14 +145,14 @@ void Room::mudd3UseSpockOnSphere() {
_roomVar.mudd.suggestedUsingTricorders = true;
} else {
showText(TX_SPEAKER_SPOCK, TX_MUD3_044);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0xcd, 0x87);
}
}
// Finished looking at alien image
void Room::mudd3Timer3Expired() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_MCCOY, TX_MUD3_027);
showText(TX_SPEAKER_SPOCK, TX_MUD3_053);
@@ -162,21 +162,21 @@ void Room::mudd3Timer3Expired() {
void Room::mudd3UseMccoyOnSphere() {
// ENHANCEMENT: Turn to face south
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
loadActorStandAnim(OBJECT_MCCOY);
showText(TX_SPEAKER_MCCOY, TX_MUD3_021);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
walkCrewman(OBJECT_MCCOY, 0xec, 0x84);
}
void Room::mudd3UseRedshirtOnSphere() {
// ENHANCEMENT: Turn to face south
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
loadActorStandAnim(OBJECT_REDSHIRT);
showText(TX_SPEAKER_BUCHERT, TX_MUD3_068); // BUGFIX: original played McCoy's audio by mistake
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
walkCrewman(OBJECT_REDSHIRT, 0xec, 0x84);
}
@@ -184,36 +184,36 @@ void Room::mudd3UseMTricorderOnSphere() {
if (_roomVar.mudd.tricordersUnavailable)
showText(TX_SPEAKER_SPOCK, TX_MUD3_039); // BUGFIX: speaker is Spock
else {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
loadActorStandAnim(OBJECT_MCCOY);
- if (!_vm->_awayMission.mudd.translatedAlienLanguage && _roomVar.mudd.suggestedUsingTricorders && _vm->_awayMission.mudd.discoveredBase3System) {
- _vm->_awayMission.disableInput = true;
+ if (!_awayMission->mudd.translatedAlienLanguage && _roomVar.mudd.suggestedUsingTricorders && _awayMission->mudd.discoveredBase3System) {
+ _awayMission->disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
walkCrewman(OBJECT_MCCOY, 0xac, 0x88);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
walkCrewmanC(OBJECT_SPOCK, 0xa5, 0x8c, &Room::mudd3ReadyToHookUpTricorders);
} else {
showText(TX_SPEAKER_MCCOY, TX_MUD3_021);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
walkCrewman(OBJECT_MCCOY, 0xec, 0x84);
}
}
}
void Room::mudd3UseSTricorderOnSphere() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
loadActorStandAnim(OBJECT_SPOCK);
if (_roomVar.mudd.tricordersUnavailable)
showText(TX_SPEAKER_SPOCK, TX_MUD3_039); // BUGFIX: speaker is Spock
- else if (_vm->_awayMission.mudd.translatedAlienLanguage || (_vm->_awayMission.mudd.discoveredBase3System && !_roomVar.mudd.suggestedUsingTricorders)) {
+ else if (_awayMission->mudd.translatedAlienLanguage || (_awayMission->mudd.discoveredBase3System && !_roomVar.mudd.suggestedUsingTricorders)) {
showText(TX_SPEAKER_SPOCK, TX_MUD3_041);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0xcd, 0x87);
- } else if (_vm->_awayMission.mudd.discoveredBase3System && _roomVar.mudd.suggestedUsingTricorders) { // Hooking up tricorders
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ } else if (_awayMission->mudd.discoveredBase3System && _roomVar.mudd.suggestedUsingTricorders) { // Hooking up tricorders
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
walkCrewmanC(OBJECT_MCCOY, 0xca, 0x88, &Room::mudd3ReadyToHookUpTricorders);
} else { // No idea how to access it
showText(TX_SPEAKER_SPOCK, TX_MUD3_042);
@@ -225,7 +225,7 @@ void Room::mudd3ReadyToHookUpTricorders() {
showText(TX_SPEAKER_SPOCK, TX_MUD3_018);
_roomVar.mudd.tricordersUnavailable = true;
- _vm->_awayMission.timers[1] = 50;
+ _awayMission->timers[1] = 50;
loadActorAnim2(OBJECT_SPOCK, "sscans");
playSoundEffectIndex(SND_TRICORDER);
@@ -235,14 +235,14 @@ void Room::mudd3Timer1Expired() { // Tricorders ready for use again
showText(TX_SPEAKER_SPOCK, TX_MUD3_040);
showText(TX_SPEAKER_SPOCK, TX_MUD3_034);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
_roomVar.mudd.tricordersUnavailable = false;
_roomVar.mudd.suggestedUsingTricorders = false;
- _vm->_awayMission.mudd.translatedAlienLanguage = true;
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->mudd.translatedAlienLanguage = true;
+ _awayMission->mudd.missionScore++;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0xcd, 0x87);
walkCrewman(OBJECT_MCCOY, 0xec, 0x84);
}
@@ -256,14 +256,14 @@ void Room::mudd3Timer2Expired() {
TX_BLANK
};
- _vm->_awayMission.mudd.computerDataErasedOrDestroyed = true;
+ _awayMission->mudd.computerDataErasedOrDestroyed = true;
showText(TX_SPEAKER_MUDD, TX_MUD3_065);
int choice = showText(choices);
if (choice == 0) { // Allow him to access the database (he ends up erasing it)
showText(TX_SPEAKER_MUDD, TX_MUD3_066);
- _vm->_awayMission.mudd.muddErasedDatabase = true;
+ _awayMission->mudd.muddErasedDatabase = true;
// ENHANCEMENT: Add a few lines to make it clear that Mudd erased the databanks.
// Otherwise, the end of the mission when you confront Mudd doesn't make sense
@@ -274,34 +274,34 @@ void Room::mudd3Timer2Expired() {
} else { // Don't allow it (he destroys it by accident)
showText(TX_SPEAKER_MUDD, TX_MUD3_064);
- _vm->_awayMission.timers[4] = 98;
- _vm->_awayMission.disableInput = 2;
+ _awayMission->timers[4] = 98;
+ _awayMission->disableInput = 2;
playMidiMusicTracks(26);
loadActorAnim(OBJECT_MUDD, "s4lbhb", 0xa2, 0x9f);
}
}
void Room::mudd3Timer4Expired() {
- _vm->_awayMission.mudd.databaseDestroyed = true;
+ _awayMission->mudd.databaseDestroyed = true;
showText(TX_SPEAKER_MUDD, TX_MUD3_063);
showText(TX_SPEAKER_MCCOY, TX_MUD3_031);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::mudd3UseMemoryDiskOnSphere() {
// ENHANCEMENT: Turn to face south
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
loadActorStandAnim(OBJECT_KIRK);
- if (_vm->_awayMission.mudd.databaseDestroyed)
+ if (_awayMission->mudd.databaseDestroyed)
showText(TX_MUD3N014);
- else if (_vm->_awayMission.mudd.translatedAlienLanguage && !_vm->_awayMission.mudd.muddErasedDatabase) {
+ else if (_awayMission->mudd.translatedAlienLanguage && !_awayMission->mudd.muddErasedDatabase) {
showText(TX_MUD3N020);
- if (!_vm->_awayMission.mudd.gotPointsForDownloadingData) {
- _vm->_awayMission.mudd.missionScore += 3;
- _vm->_awayMission.mudd.gotPointsForDownloadingData = true;
+ if (!_awayMission->mudd.gotPointsForDownloadingData) {
+ _awayMission->mudd.missionScore += 3;
+ _awayMission->mudd.gotPointsForDownloadingData = true;
}
} else
showText(TX_MUD3N019);
@@ -309,31 +309,31 @@ void Room::mudd3UseMemoryDiskOnSphere() {
void Room::mudd3GetRepairTool() {
- if (_vm->_awayMission.mudd.tookRepairTool)
+ if (_awayMission->mudd.tookRepairTool)
showText(TX_MUD3N018); // NOTE: unused, since the object disappears, can't be selected again
else {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewmanC(OBJECT_KIRK, 0xba, 0xc1, &Room::mudd3ReachedRepairTool);
}
}
void Room::mudd3ReachedRepairTool() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
loadActorAnimC(OBJECT_KIRK, "kusemn", -1, -1, &Room::mudd3PickedUpRepairTool);
}
void Room::mudd3PickedUpRepairTool() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_REPAIR_TOOL);
- _vm->_awayMission.mudd.tookRepairTool = true;
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->mudd.tookRepairTool = true;
+ _awayMission->mudd.missionScore++;
giveItem(OBJECT_IDOOVER);
}
void Room::mudd3LookAtSphere() {
// ENHANCEMENT: Turn to face south
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_MUD3N015);
@@ -341,7 +341,7 @@ void Room::mudd3LookAtSphere() {
void Room::mudd3WalkToNorthDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0xb8, 0x70);
}
@@ -354,7 +354,7 @@ void Room::mudd3TouchedHotspot0() { // Triggers north door
void Room::mudd3WalkToEastDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0x121, 0x81);
}
@@ -365,28 +365,28 @@ void Room::mudd3TouchedHotspot1() {
}
void Room::mudd3LookAtKirk() {
- if (!_vm->_awayMission.mudd.muddInDatabaseRoom)
+ if (!_awayMission->mudd.muddInDatabaseRoom)
showText(TX_MUD3N005);
else
showText(TX_MUD3N004);
}
void Room::mudd3LookAtSpock() {
- if (!_vm->_awayMission.mudd.muddInDatabaseRoom)
+ if (!_awayMission->mudd.muddInDatabaseRoom)
showText(TX_MUD3N012);
else
showText(TX_MUD3N002);
}
void Room::mudd3LookAtMccoy() {
- if (!_vm->_awayMission.mudd.muddInDatabaseRoom)
+ if (!_awayMission->mudd.muddInDatabaseRoom)
showText(TX_MUD3N010);
else
showText(TX_MUD3N009);
}
void Room::mudd3LookAtRedshirt() {
- if (!_vm->_awayMission.mudd.muddInDatabaseRoom)
+ if (!_awayMission->mudd.muddInDatabaseRoom)
showText(TX_MUD3N007);
else
showText(TX_MUD3N006);
@@ -397,7 +397,7 @@ void Room::mudd3LookAtMudd() {
}
void Room::mudd3TalkToKirk() {
- if (!_vm->_awayMission.mudd.muddInDatabaseRoom) {
+ if (!_awayMission->mudd.muddInDatabaseRoom) {
showText(TX_SPEAKER_KIRK, TX_MUD3_014);
showText(TX_SPEAKER_SPOCK, TX_MUD3_057);
showText(TX_SPEAKER_MCCOY, TX_MUD3_025);
@@ -406,7 +406,7 @@ void Room::mudd3TalkToKirk() {
}
void Room::mudd3TalkToSpock() {
- if (!_vm->_awayMission.mudd.muddInDatabaseRoom) {
+ if (!_awayMission->mudd.muddInDatabaseRoom) {
showText(TX_SPEAKER_SPOCK, TX_MUD3_055);
showText(TX_SPEAKER_MCCOY, TX_MUD3_033);
showText(TX_SPEAKER_KIRK, TX_MUD3_011);
@@ -415,7 +415,7 @@ void Room::mudd3TalkToSpock() {
}
void Room::mudd3TalkToMccoy() {
- if (!_vm->_awayMission.mudd.muddInDatabaseRoom)
+ if (!_awayMission->mudd.muddInDatabaseRoom)
showText(TX_SPEAKER_MCCOY, TX_MUD3_023);
else {
showText(TX_SPEAKER_MCCOY, TX_MUD3_030);
@@ -424,7 +424,7 @@ void Room::mudd3TalkToMccoy() {
}
void Room::mudd3TalkToRedshirt() {
- if (!_vm->_awayMission.mudd.muddInDatabaseRoom) {
+ if (!_awayMission->mudd.muddInDatabaseRoom) {
showText(TX_SPEAKER_BUCHERT, TX_MUD3_070);
showText(TX_SPEAKER_KIRK, TX_MUD3_016);
showText(TX_SPEAKER_BUCHERT, TX_MUD3_071);
@@ -435,7 +435,7 @@ void Room::mudd3TalkToRedshirt() {
void Room::mudd3TalkToMudd() {
// ENHANCEMENT: the 2nd part of the if condition is new; whether he physically
// destroys the database or does through software, he should give this reaction.
- if (_vm->_awayMission.mudd.databaseDestroyed || _vm->_awayMission.mudd.muddErasedDatabase) {
+ if (_awayMission->mudd.databaseDestroyed || _awayMission->mudd.muddErasedDatabase) {
showText(TX_SPEAKER_MUDD, TX_MUD3_060);
showText(TX_SPEAKER_MCCOY, TX_MUD3_029);
showText(TX_SPEAKER_MUDD, TX_MUD3_061);
diff --git a/engines/startrek/rooms/mudd4.cpp b/engines/startrek/rooms/mudd4.cpp
index 90bdf1d..4a1a1ee 100644
--- a/engines/startrek/rooms/mudd4.cpp
+++ b/engines/startrek/rooms/mudd4.cpp
@@ -39,10 +39,10 @@ namespace StarTrek {
void Room::mudd4Tick1() {
playVoc("MUD4LOOP");
- if (!_vm->_awayMission.mudd.tookRepairTool)
+ if (!_awayMission->mudd.tookRepairTool)
loadActorAnim(OBJECT_REPAIR_TOOL, "s4crdv", 0xc9, 0x8e);
- if (_vm->_awayMission.mudd.viewScreenEnabled)
+ if (_awayMission->mudd.viewScreenEnabled)
loadActorAnim(OBJECT_VIEWSCREEN, "s4crvo", 0xa5, 0x76);
}
@@ -70,13 +70,13 @@ void Room::mudd4UseSpockOnRightConsole() {
}
void Room::mudd4UseSpockOnConsole() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
loadActorStandAnim(OBJECT_SPOCK);
- if (_vm->_awayMission.mudd.translatedAlienLanguage) {
+ if (_awayMission->mudd.translatedAlienLanguage) {
if (!_roomVar.mudd.usingLeftConsole)
showText(TX_SPEAKER_SPOCK, TX_MUD4_057);
- } else if (_vm->_awayMission.mudd.discoveredBase3System) {
+ } else if (_awayMission->mudd.discoveredBase3System) {
showText(TX_SPEAKER_SPOCK, TX_MUD4_062);
} else {
showText(TX_SPEAKER_SPOCK, TX_MUD4_061);
@@ -87,22 +87,22 @@ void Room::mudd4UseSpockOnConsole() {
showText(TX_SPEAKER_KIRK, TX_MUD4_031);
showText(TX_SPEAKER_SPOCK, TX_MUD4_060);
- if (!_vm->_awayMission.mudd.discoveredBase3System) {
- _vm->_awayMission.mudd.discoveredBase3System = true;
- _vm->_awayMission.mudd.missionScore++;
+ if (!_awayMission->mudd.discoveredBase3System) {
+ _awayMission->mudd.discoveredBase3System = true;
+ _awayMission->mudd.missionScore++;
}
}
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
walkCrewmanC(OBJECT_SPOCK, 0x6d, 0x9a, &Room::mudd4SpockReachedChair);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::mudd4SpockReachedChair() {
- if (_roomVar.mudd.usingLeftConsole && _vm->_awayMission.mudd.translatedAlienLanguage)
+ if (_roomVar.mudd.usingLeftConsole && _awayMission->mudd.translatedAlienLanguage)
loadActorAnimC(OBJECT_SPOCK, "s4crss", -1, -1, &Room::mudd4SpockSatInChair);
else
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::mudd4SpockSatInChair() {
@@ -127,47 +127,47 @@ void Room::mudd4ShowLeftConsoleMenu() {
switch (choice) {
case 0: // Sensors
loadActorAnimC(OBJECT_SPOCK, "s4crsr", 0x55, 0x98, &Room::mudd4SpockUsedSensors);
- _vm->_awayMission.timers[2] = 5;
+ _awayMission->timers[2] = 5;
break;
case 1: // Navigation
loadActorAnimC(OBJECT_SPOCK, "s4crsl", 0x55, 0x98, &Room::mudd4SpockUsedNavigation);
- _vm->_awayMission.timers[2] = 5;
+ _awayMission->timers[2] = 5;
break;
case 2: // Engineering
loadActorAnimC(OBJECT_SPOCK, "s4crsr", 0x55, 0x98, &Room::mudd4SpockUsedEngineering);
- _vm->_awayMission.timers[2] = 5;
+ _awayMission->timers[2] = 5;
break;
case 3: // Done
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->disableInput = false;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
walkCrewman(OBJECT_SPOCK, 0x69, 0xb7);
break;
}
}
void Room::mudd4SpockUsedSensors() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_SPOCK, TX_MUD4_053);
mudd4ShowLeftConsoleMenu();
}
void Room::mudd4SpockUsedEngineering() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_SPOCK, TX_MUD4_056);
mudd4ShowLeftConsoleMenu();
}
void Room::mudd4SpockUsedNavigation() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_SPOCK, TX_MUD4_055);
mudd4ShowLeftConsoleMenu();
}
void Room::mudd4FinishedWalking3() { // Spock reaches console after attempting to use Kirk on one
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
mudd4UseSpockOnLeftConsole();
}
@@ -182,34 +182,34 @@ void Room::mudd4UseKirkOnLeftConsole() {
}
void Room::mudd4UseKirkOnConsole() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
loadActorStandAnim(OBJECT_KIRK);
- if (!_vm->_awayMission.mudd.translatedAlienLanguage) {
+ if (!_awayMission->mudd.translatedAlienLanguage) {
showText(TX_SPEAKER_KIRK, TX_MUD4_006);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
walkCrewmanC(OBJECT_SPOCK, 0x6d, 0x9a, &Room::mudd4FinishedWalking3);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
} else {
if (!_roomVar.mudd.kirkUsingRightConsole)
showText(TX_SPEAKER_KIRK, TX_MUD4_049);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewmanC(OBJECT_KIRK, 0x7e, 0x98, &Room::mudd4KirkReachedRightConsole);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
}
void Room::mudd4KirkReachedRightConsole() {
- if (_roomVar.mudd.kirkUsingRightConsole && _vm->_awayMission.mudd.translatedAlienLanguage)
+ if (_roomVar.mudd.kirkUsingRightConsole && _awayMission->mudd.translatedAlienLanguage)
loadActorAnimC(OBJECT_KIRK, "s4crks", -1, -1, &Room::mudd4KirkSatInChair);
else
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::mudd4KirkSatInChair() {
loadActorAnim2(OBJECT_KIRK, "s4crkl", 0x94, 0x98);
- _vm->_awayMission.timers[2] = 5;
- _vm->_awayMission.disableInput = false;
+ _awayMission->timers[2] = 5;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_SPOCK, TX_MUD4_052); // NOTE: why is Spock talking here?
@@ -229,60 +229,60 @@ void Room::mudd4ShowRightConsoleMenu() {
switch (choice) {
case 0: // Communications
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadActorAnimC(OBJECT_KIRK, "s4crkr", 0x94, 0x98, &Room::mudd4KirkUsedCommunications);
break;
case 1: // View Screen
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadActorAnimC(OBJECT_KIRK, "s4crkl", 0x94, 0x98, &Room::mudd4KirkUsedViewScreen);
break;
case 2: // Done
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewman(OBJECT_KIRK, 0x83, 0xb6);
break;
}
}
void Room::mudd4KirkUsedViewScreen() {
- if (!_vm->_awayMission.mudd.viewScreenEnabled) {
- _vm->_awayMission.mudd.viewScreenEnabled = true;
+ if (!_awayMission->mudd.viewScreenEnabled) {
+ _awayMission->mudd.viewScreenEnabled = true;
playVoc("SE2BIGAS");
loadActorAnim(OBJECT_VIEWSCREEN, "s4crvs", 0xa5, 0x76);
- _vm->_awayMission.timers[3] = 5;
- _vm->_awayMission.timers[1] = 50;
- if (!_vm->_awayMission.mudd.gotPointsForEnablingViewscreen) {
- _vm->_awayMission.mudd.gotPointsForEnablingViewscreen = true;
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->timers[3] = 5;
+ _awayMission->timers[1] = 50;
+ if (!_awayMission->mudd.gotPointsForEnablingViewscreen) {
+ _awayMission->mudd.gotPointsForEnablingViewscreen = true;
+ _awayMission->mudd.missionScore++;
}
} else {
- _vm->_awayMission.mudd.viewScreenEnabled = false;
+ _awayMission->mudd.viewScreenEnabled = false;
loadActorAnim(OBJECT_VIEWSCREEN, "s4crvf", 0xa5, 0x76);
- _vm->_awayMission.timers[3] = 5;
- _vm->_awayMission.timers[1] = 30;
+ _awayMission->timers[3] = 5;
+ _awayMission->timers[1] = 30;
}
}
void Room::mudd4Timer1Expired() {
- _vm->_awayMission.disableInput = false;
- if (_vm->_awayMission.mudd.viewScreenEnabled)
+ _awayMission->disableInput = false;
+ if (_awayMission->mudd.viewScreenEnabled)
showText(TX_SPEAKER_KIRK, TX_MUD4_004);
mudd4ShowRightConsoleMenu();
}
void Room::mudd4KirkUsedCommunications() {
- _vm->_awayMission.disableInput = false;
- if (!_vm->_awayMission.mudd.knowAboutTorpedo) {
+ _awayMission->disableInput = false;
+ if (!_awayMission->mudd.knowAboutTorpedo) {
showText(TX_SPEAKER_SPOCK, TX_MUD4_054);
mudd4ShowRightConsoleMenu();
} else {
- if (!_vm->_awayMission.mudd.contactedEnterpriseFirstTime) {
- _vm->_awayMission.mudd.missionScore++;
+ if (!_awayMission->mudd.contactedEnterpriseFirstTime) {
+ _awayMission->mudd.missionScore++;
showText(TX_SPEAKER_KIRK, TX_MUD4_025);
showText(TX_SPEAKER_SCOTT, TX_MUD4_S02);
- if (_vm->_awayMission.mudd.torpedoStatus == 1)
+ if (_awayMission->mudd.torpedoStatus == 1)
showText(TX_SPEAKER_KIRK, TX_MUD4_027);
else
showText(TX_SPEAKER_KIRK, TX_MUD4_028);
@@ -300,9 +300,9 @@ void Room::mudd4KirkUsedCommunications() {
int choice = showText(choices);
if (choice == 1) {
- endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
+ endMission(_awayMission->mudd.missionScore, 0x1b, _awayMission->mudd.torpedoStatus);
} else if (choice == 0) {
- _vm->_awayMission.mudd.contactedEnterpriseFirstTime = true;
+ _awayMission->mudd.contactedEnterpriseFirstTime = true;
} else { // choice == 2
mudd4TalkWithMuddAtMissionEnd();
}
@@ -320,7 +320,7 @@ void Room::mudd4KirkUsedCommunications() {
int choice = showText(choices);
if (choice == 1) {
- endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
+ endMission(_awayMission->mudd.missionScore, 0x1b, _awayMission->mudd.torpedoStatus);
} else if (choice == 2) {
mudd4TalkWithMuddAtMissionEnd();
}
@@ -329,20 +329,20 @@ void Room::mudd4KirkUsedCommunications() {
}
void Room::mudd4TalkWithMuddAtMissionEnd() {
- if (_vm->_awayMission.mudd.muddUnavailable)
+ if (_awayMission->mudd.muddUnavailable)
return;
else {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewmanC(OBJECT_KIRK, 0x83, 0xb4, &Room::mudd4KirkReachedPositionToTalkToMudd);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
walkCrewman(OBJECT_SPOCK, 0x69, 0xb7);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
loadActorStandAnim(OBJECT_MCCOY);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
loadActorStandAnim(OBJECT_REDSHIRT);
playMidiMusicTracks(3);
@@ -351,12 +351,12 @@ void Room::mudd4TalkWithMuddAtMissionEnd() {
}
void Room::mudd4KirkReachedPositionToTalkToMudd() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
- if (_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction
- || _vm->_awayMission.mudd.muddErasedDatabase
- || _vm->_awayMission.mudd.databaseDestroyed
- || !_vm->_awayMission.mudd.accessedAlienDatabase) { // NOTE: why this last line? Test this...
+ if (_awayMission->mudd.discoveredLenseAndDegrimerFunction
+ || _awayMission->mudd.muddErasedDatabase
+ || _awayMission->mudd.databaseDestroyed
+ || !_awayMission->mudd.accessedAlienDatabase) { // NOTE: why this last line? Test this...
const int choices[] = {
TX_SPEAKER_KIRK,
TX_MUD4_009,
@@ -376,17 +376,17 @@ void Room::mudd4KirkReachedPositionToTalkToMudd() {
showText(TX_SPEAKER_MUDD, TX_MUD4_068);
showText(TX_SPEAKER_KIRK, TX_MUD4_032);
- endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
+ endMission(_awayMission->mudd.missionScore, 0x1b, _awayMission->mudd.torpedoStatus);
} else {
// Threaten to arrest Mudd.
- if (_vm->_awayMission.mudd.muddErasedDatabase || _vm->_awayMission.mudd.databaseDestroyed)
+ if (_awayMission->mudd.muddErasedDatabase || _awayMission->mudd.databaseDestroyed)
showText(TX_SPEAKER_KIRK, TX_MUD4_034);
- if (_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction)
+ if (_awayMission->mudd.discoveredLenseAndDegrimerFunction)
showText(TX_SPEAKER_KIRK, TX_MUD4_037);
showText(TX_SPEAKER_KIRK, TX_MUD4_026);
- if (_vm->_awayMission.mudd.muddErasedDatabase && _vm->_awayMission.mudd.databaseDestroyed) {
+ if (_awayMission->mudd.muddErasedDatabase && _awayMission->mudd.databaseDestroyed) {
// Mudd offers to copy the lost data to the enterprise computer. You don't
// get any points for this outcome.
@@ -406,7 +406,7 @@ void Room::mudd4KirkReachedPositionToTalkToMudd() {
showText(TX_SPEAKER_MUDD, TX_MUD4_067);
showText(TX_SPEAKER_KIRK, TX_MUD4_011);
- _vm->_awayMission.mudd.missionScore += 4;
+ _awayMission->mudd.missionScore += 4;
playMidiMusicTracks(30);
showText(TX_SPEAKER_MUDD, TX_MUD4_073);
@@ -415,7 +415,7 @@ void Room::mudd4KirkReachedPositionToTalkToMudd() {
showText(TX_SPEAKER_MUDD, TX_MUD4_069);
showText(TX_SPEAKER_KIRK, TX_MUD4_001);
- endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
+ endMission(_awayMission->mudd.missionScore, 0x1b, _awayMission->mudd.torpedoStatus);
}
} else {
const int choices[] = {
@@ -437,7 +437,7 @@ void Room::mudd4KirkReachedPositionToTalkToMudd() {
showText(TX_SPEAKER_MUDD, TX_MUD4_068);
showText(TX_SPEAKER_KIRK, TX_MUD4_032);
- endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
+ endMission(_awayMission->mudd.missionScore, 0x1b, _awayMission->mudd.torpedoStatus);
}
}
@@ -445,19 +445,19 @@ void Room::mudd4UseMccoyOnConsole() {
// NOTE: This audio was recorded twice (TX_MUD4_045, and TX_MUD4_044 which is unused)
showText(TX_SPEAKER_MCCOY, TX_MUD4_045);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
walkCrewman(OBJECT_MCCOY, 0x7d, 0xc3);
}
void Room::mudd4UseRedshirtOnConsole() {
// Floppy version shows two different pieces of text here, but in the CD version,
// there's no difference
- if (!_vm->_awayMission.mudd.translatedAlienLanguage)
+ if (!_awayMission->mudd.translatedAlienLanguage)
showText(TX_SPEAKER_BUCHERT, TX_MUD4_075);
else
showText(TX_SPEAKER_BUCHERT, TX_MUD4_075);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
walkCrewman(OBJECT_REDSHIRT, 0x2a, 0xbb);
}
@@ -478,11 +478,11 @@ void Room::mudd4UseMedkit() {
}
void Room::mudd4GetRepairTool() {
- if (_vm->_awayMission.mudd.tookRepairTool)
+ if (_awayMission->mudd.tookRepairTool)
showText(TX_MUD4N012); // NOTE: unused, since the object disappears, can't be selected again
else {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewmanC(OBJECT_KIRK, 0xcb, 0x9e, &Room::mudd4ReachedRepairTool);
}
}
@@ -492,10 +492,10 @@ void Room::mudd4ReachedRepairTool() {
}
void Room::mudd4PickedUpRepairTool() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_REPAIR_TOOL);
- _vm->_awayMission.mudd.tookRepairTool = true;
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->mudd.tookRepairTool = true;
+ _awayMission->mudd.missionScore++;
giveItem(OBJECT_IDOOVER);
}
@@ -504,7 +504,7 @@ void Room::mudd4LookAtConsole() {
}
void Room::mudd4LookAtViewscreen() {
- if (_vm->_awayMission.mudd.viewScreenEnabled)
+ if (_awayMission->mudd.viewScreenEnabled)
showText(TX_MUD4N008);
else
showText(TX_MUD4N013);
@@ -550,13 +550,13 @@ void Room::mudd4TalkToRedshirt() {
void Room::mudd4WalkToEastDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0xf0, 0xc7);
}
void Room::mudd4WalkToWestDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0x50, 0xc7);
}
diff --git a/engines/startrek/rooms/mudd5.cpp b/engines/startrek/rooms/mudd5.cpp
index c7e63f3..caa18f8 100644
--- a/engines/startrek/rooms/mudd5.cpp
+++ b/engines/startrek/rooms/mudd5.cpp
@@ -40,22 +40,22 @@ namespace StarTrek {
void Room::mudd5Tick1() {
playVoc("MUD5LOOP");
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
- if (_vm->_awayMission.mudd.lifeSupportMalfunctioning) {
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
+ if (_awayMission->mudd.lifeSupportMalfunctioning) {
playMidiMusicTracks(19);
loadActorAnim(OBJECT_LIFE_SUPPORT_GENERATOR, "s4epls", GENERATOR_X, GENERATOR_Y);
} else {
loadActorAnim(OBJECT_LIFE_SUPPORT_GENERATOR, "s4eplo", GENERATOR_X, GENERATOR_Y);
- _vm->_awayMission.mudd.numTimesEnteredRoom5++;
+ _awayMission->mudd.numTimesEnteredRoom5++;
// BUG: this event can become permanently unavailable? (test)
- if (_vm->_awayMission.mudd.numTimesEnteredRoom5 == 2 && !_vm->_awayMission.mudd.muddUnavailable && !_vm->_awayMission.mudd.repairedLifeSupportGenerator) {
- _vm->_awayMission.mudd.muddUnavailable = true;
- _vm->_awayMission.mudd.numTimesEnteredRoom5 = 1;
- _vm->_awayMission.disableInput = 2;
+ if (_awayMission->mudd.numTimesEnteredRoom5 == 2 && !_awayMission->mudd.muddUnavailable && !_awayMission->mudd.repairedLifeSupportGenerator) {
+ _awayMission->mudd.muddUnavailable = true;
+ _awayMission->mudd.numTimesEnteredRoom5 = 1;
+ _awayMission->disableInput = 2;
playMidiMusicTracks(3);
loadActorAnim(OBJECT_MUDD, "s4ephh", 0x0e, 0xa7);
- _vm->_awayMission.timers[1] = 112;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->timers[1] = 112;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
}
}
}
@@ -73,12 +73,12 @@ void Room::mudd5Timer1Expired() { // Mudd enters room through hatch
showText(TX_SPEAKER_MUDD, TX_MUD5_037);
loadActorAnim2(OBJECT_MUDD, "s4ephc");
- _vm->_awayMission.timers[2] = 140;
+ _awayMission->timers[2] = 140;
}
void Room::mudd5Timer2Expired() { // Life-support generator starts acting up
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.mudd.lifeSupportMalfunctioning = true;
+ _awayMission->disableInput = false;
+ _awayMission->mudd.lifeSupportMalfunctioning = true;
playMidiMusicTracks(19);
loadActorAnim(OBJECT_LIFE_SUPPORT_GENERATOR, "s4epls", GENERATOR_X, GENERATOR_Y);
}
@@ -106,7 +106,7 @@ void Room::mudd5UseSTricorderOnHatch() {
}
void Room::mudd5UseSTricorderOnLifeSupportGenerator() {
- if (_vm->_awayMission.mudd.lifeSupportMalfunctioning)
+ if (_awayMission->mudd.lifeSupportMalfunctioning)
spockScan(DIR_W, TX_MUD5_019, false);
else
spockScan(DIR_W, TX_MUD5_021, false);
@@ -129,9 +129,9 @@ void Room::mudd5UseAnythingOnLifeSupportGenerator() {
void Room::mudd5UseDooverOnLifeSupportGenerator() {
- if (_vm->_awayMission.mudd.lifeSupportMalfunctioning) {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ if (_awayMission->mudd.lifeSupportMalfunctioning) {
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewmanC(OBJECT_KIRK, 0x57, 0xb4, &Room::mudd5KirkReachedLifeSupportGenerator);
} else
showText(TX_SPEAKER_MCCOY, TX_MUD5_014); // BUGFIX: speaker is McCoy, not none
@@ -139,30 +139,30 @@ void Room::mudd5UseDooverOnLifeSupportGenerator() {
void Room::mudd5KirkReachedLifeSupportGenerator() {
loadActorAnimC(OBJECT_KIRK, "kuseln", -1, -1, &Room::mudd5KirkRepairedLifeSupportGenerator);
- _vm->_awayMission.timers[4] = 20;
+ _awayMission->timers[4] = 20;
}
void Room::mudd5KirkTimer4Expired() {
playMidiMusicTracks(-1);
loadActorAnim2(OBJECT_LIFE_SUPPORT_GENERATOR, "s4eplo");
- _vm->_awayMission.mudd.repairedLifeSupportGenerator = true;
- _vm->_awayMission.mudd.missionScore += 2;
+ _awayMission->mudd.repairedLifeSupportGenerator = true;
+ _awayMission->mudd.missionScore += 2;
}
void Room::mudd5KirkRepairedLifeSupportGenerator() {
showText(TX_SPEAKER_KIRK, TX_MUD5_007);
showText(TX_SPEAKER_SPOCK, TX_MUD5_028);
- _vm->_awayMission.mudd.lifeSupportMalfunctioning = false;
- _vm->_awayMission.mudd.muddUnavailable = false;
+ _awayMission->mudd.lifeSupportMalfunctioning = false;
+ _awayMission->mudd.muddUnavailable = false;
playMidiMusicTracks(3);
loadActorAnim(OBJECT_MUDD, "s4ephh", 0x0e, 0xa7);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
loadActorStandAnim(OBJECT_KIRK);
- _vm->_awayMission.timers[3] = 110;
+ _awayMission->timers[3] = 110;
}
void Room::mudd5KirkTimer3Expired() { // Mudd popped back in after repairing generator
@@ -171,7 +171,7 @@ void Room::mudd5KirkTimer3Expired() { // Mudd popped back in after repairing gen
showText(TX_SPEAKER_MUDD, TX_MUD5_036);
loadActorAnim2(OBJECT_MUDD, "s4ephc");
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::mudd5LookAtHatch() {
@@ -181,7 +181,7 @@ void Room::mudd5LookAtHatch() {
}
void Room::mudd5LookAtLifeSupportGenerator() {
- if (_vm->_awayMission.mudd.lifeSupportMalfunctioning)
+ if (_awayMission->mudd.lifeSupportMalfunctioning)
showText(TX_MUD5N008);
else {
showText(TX_MUD5N012);
@@ -198,7 +198,7 @@ void Room::mudd5TouchedHotspot0() { // Triggers door
void Room::mudd5WalkToDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0x85, 0x74);
}
diff --git a/engines/startrek/rooms/mudda.cpp b/engines/startrek/rooms/mudda.cpp
index 78c5629..4c92ae0 100644
--- a/engines/startrek/rooms/mudda.cpp
+++ b/engines/startrek/rooms/mudda.cpp
@@ -43,7 +43,7 @@ void Room::muddaUseLenseOnDegrimer() {
loseItem(OBJECT_IDEGRIME);
loseItem(OBJECT_ILENSES);
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->mudd.missionScore++;
showText(text[_roomIndex]);
}
@@ -60,9 +60,9 @@ void Room::muddaUseAlienDevice() {
11 // MUDD5
};
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
loadActorStandAnim(OBJECT_KIRK);
Common::Point pos = getActorPos(OBJECT_KIRK);
loadActorAnimC(deviceObjectIndices[_roomIndex], "s4cbxp", pos.x, 10, &Room::muddaFiredAlienDevice);
@@ -81,10 +81,10 @@ void Room::muddaFiredAlienDevice() {
TX_MUD2_002,
};
- _vm->_awayMission.disableInput = false;
- if (!_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction) {
- _vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction = true;
- _vm->_awayMission.mudd.missionScore += 5; // BUGFIX: didn't happen if done in MUDD5
+ _awayMission->disableInput = false;
+ if (!_awayMission->mudd.discoveredLenseAndDegrimerFunction) {
+ _awayMission->mudd.discoveredLenseAndDegrimerFunction = true;
+ _awayMission->mudd.missionScore += 5; // BUGFIX: didn't happen if done in MUDD5
showText(TX_SPEAKER_KIRK, text[_roomIndex]);
}
}
@@ -141,22 +141,22 @@ void Room::muddaTick() {
const int TIMER_LENGTH = 27000;
- if (_vm->_awayMission.mudd.lifeSupportMalfunctioning) {
- if (!_vm->_awayMission.mudd.startedLifeSupportTimer) {
- _vm->_awayMission.mudd.startedLifeSupportTimer = true;
- _vm->_awayMission.mudd.lifeSupportTimer = TIMER_LENGTH;
+ if (_awayMission->mudd.lifeSupportMalfunctioning) {
+ if (!_awayMission->mudd.startedLifeSupportTimer) {
+ _awayMission->mudd.startedLifeSupportTimer = true;
+ _awayMission->mudd.lifeSupportTimer = TIMER_LENGTH;
}
- _vm->_awayMission.mudd.lifeSupportTimer--;
+ _awayMission->mudd.lifeSupportTimer--;
// BUGFIX: the warnings at 75%, 50%, and 25% were only voiced in MUDD0.
- if (_vm->_awayMission.mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.25))
+ if (_awayMission->mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.25))
showText(TX_SPEAKER_SPOCK, TX_MUD0_018);
- else if (_vm->_awayMission.mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.5))
+ else if (_awayMission->mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.5))
showText(TX_SPEAKER_SPOCK, TX_MUD0_019);
- else if (_vm->_awayMission.mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.75))
+ else if (_awayMission->mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.75))
showText(TX_SPEAKER_SPOCK, TX_MUD0_020);
- else if (_vm->_awayMission.mudd.lifeSupportTimer == 1) {
- _vm->_awayMission.disableInput = true;
+ else if (_awayMission->mudd.lifeSupportTimer == 1) {
+ _awayMission->disableInput = true;
// In each room, the crewmen collapse in a different directions.
// NOTE: "kgetdn" (kirk, north) doesn't work properly; files in the animation
@@ -171,7 +171,7 @@ void Room::muddaTick() {
};
for (int i = OBJECT_KIRK; i <= OBJECT_REDSHIRT; i++) {
- Common::String anim = _vm->getCrewmanAnimFilename(i, "getd");
+ Common::String anim = getCrewmanAnimFilename(i, "getd");
anim += directions[i][_roomIndex];
loadActorAnim2(i, anim);
}
diff --git a/engines/startrek/rooms/sins0.cpp b/engines/startrek/rooms/sins0.cpp
index 8dfabdc..7fb4f08 100644
--- a/engines/startrek/rooms/sins0.cpp
+++ b/engines/startrek/rooms/sins0.cpp
@@ -81,12 +81,12 @@ extern const int sins0NumActions = sizeof(sins0ActionList) / sizeof(RoomAction);
void Room::sins0Tick1() {
playVoc("SIN0LOOP");
- if (!_vm->_awayMission.sins.enteredRoom0FirstTime)
- _vm->_awayMission.disableInput = 2;
+ if (!_awayMission->sins.enteredRoom0FirstTime)
+ _awayMission->disableInput = 2;
- if (_vm->_awayMission.sins.field3e)
+ if (_awayMission->sins.field3e)
loadActorAnim2(OBJECT_DOOR, "s0dr2", 0, 0);
- if (_vm->_awayMission.sins.openedDoor)
+ if (_awayMission->sins.openedDoor)
loadActorAnim2(OBJECT_DOOR, "s0dr1", 0, 0);
playMidiMusicTracks(MIDITRACK_27, -3);
@@ -131,13 +131,13 @@ void Room::sins0LookAtGround() {
}
void Room::sins0GetRock() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadActorAnimC(OBJECT_KIRK, "kpickw", -1, -1, &Room::sins0PickedUpRock);
- _vm->_awayMission.sins.field39 |= 1;
+ _awayMission->sins.field39 |= 1;
}
void Room::sins0PickedUpRock() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_SIN0N010);
giveItem(OBJECT_IS8ROCKS);
@@ -149,7 +149,7 @@ void Room::sins0UseSTricorderAnywhere() {
void Room::sins0UseSTricorderOnGround() {
spockScan(DIR_S, TX_SIN0_017);
- _vm->_awayMission.sins.field39 |= 1;
+ _awayMission->sins.field39 |= 1;
}
void Room::sins0UseSTricorderOnPlanet() {
@@ -157,8 +157,8 @@ void Room::sins0UseSTricorderOnPlanet() {
}
void Room::sins0Tick40() {
- if (!_vm->_awayMission.sins.enteredRoom0FirstTime) {
- _vm->_awayMission.disableInput = false;
+ if (!_awayMission->sins.enteredRoom0FirstTime) {
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_UHURA, TX_SIN0U082);
showText(TX_SPEAKER_KIRK, TX_SIN0_003);
showText(TX_SPEAKER_SCOTT, TX_SIN0_S48);
@@ -167,7 +167,7 @@ void Room::sins0Tick40() {
showText(TX_SPEAKER_KIRK, TX_SIN0_005);
showText(TX_SPEAKER_SCOTT, TX_SIN0_S49);
showText(TX_SPEAKER_KIRK, TX_SIN0_001);
- _vm->_awayMission.sins.enteredRoom0FirstTime = true;
+ _awayMission->sins.enteredRoom0FirstTime = true;
}
}
@@ -216,9 +216,9 @@ void Room::sins0UseSTricorderOnStatue() {
showText(TX_SPEAKER_KIRK, TX_SIN0_008);
showText(TX_SPEAKER_SPOCK, TX_SIN0_023);
- if (!_vm->_awayMission.sins.gotPointsForScanningStatue) {
- _vm->_awayMission.sins.gotPointsForScanningStatue = true;
- _vm->_awayMission.sins.missionScore += 1;
+ if (!_awayMission->sins.gotPointsForScanningStatue) {
+ _awayMission->sins.gotPointsForScanningStatue = true;
+ _awayMission->sins.missionScore += 1;
}
}
@@ -231,7 +231,7 @@ void Room::sins0UseMTricorderOnCrewman() {
}
void Room::sins0UseCommunicator() {
- if (!_vm->_awayMission.sins.scottyInformedKirkAboutVirus) {
+ if (!_awayMission->sins.scottyInformedKirkAboutVirus) {
showText(TX_SPEAKER_KIRK, TX_SIN0_004);
showText(TX_SPEAKER_SCOTT, TX_SIN0_S01);
showText(TX_SPEAKER_KIRK, TX_SIN0_002);
diff --git a/engines/startrek/rooms/sins1.cpp b/engines/startrek/rooms/sins1.cpp
index 8f44840..76a959f 100644
--- a/engines/startrek/rooms/sins1.cpp
+++ b/engines/startrek/rooms/sins1.cpp
@@ -92,27 +92,27 @@ extern const int sins1NumActions = sizeof(sins1ActionList) / sizeof(RoomAction);
void Room::sins1Tick1() {
playVoc("SIN1LOOP");
- if (!_vm->_awayMission.sins.scottyInformedKirkAboutVirus)
+ if (!_awayMission->sins.scottyInformedKirkAboutVirus)
// BUGFIX: Set this to 2, not 1 (disable input even after walking animation is done)
- _vm->_awayMission.disableInput = 2;
+ _awayMission->disableInput = 2;
- if (_vm->_awayMission.sins.openedDoor) {
+ if (_awayMission->sins.openedDoor) {
loadActorAnim2(OBJECT_DOOR, "s1dro", 0, 0);
loadMapFile("sins12");
} else
loadMapFile("sins1");
- if (_vm->_awayMission.sins.field3e)
+ if (_awayMission->sins.field3e)
loadActorAnim2(OBJECT_DOOR, "s1ndro", 0, 0);
- _vm->_awayMission.sins.field32 = 1;
- _vm->_awayMission.sins.field31 = 1;
+ _awayMission->sins.field32 = 1;
+ _awayMission->sins.field31 = 1;
playMidiMusicTracks(MIDITRACK_27, -3);
- if (!_vm->_awayMission.sins.enteredRoom1FirstTime) {
+ if (!_awayMission->sins.enteredRoom1FirstTime) {
playMidiMusicTracks(MIDITRACK_1, -2);
- _vm->_awayMission.sins.enteredRoom1FirstTime = true;
+ _awayMission->sins.enteredRoom1FirstTime = true;
}
}
@@ -153,7 +153,7 @@ void Room::sins1UseSTricorderOnLock() {
}
void Room::sins1UseSTricorderOnDoor() {
- if (!_vm->_awayMission.sins.openedDoor)
+ if (!_awayMission->sins.openedDoor)
spockScan(DIR_N, TX_SIN1_019);
}
@@ -162,7 +162,7 @@ void Room::sins1UseSTricorderAnywhere() {
}
void Room::sins1UseSTricorderOnLens() {
- if (!_vm->_awayMission.sins.doorLaserFiredOnce)
+ if (!_awayMission->sins.doorLaserFiredOnce)
spockScan(DIR_N, TX_SIN1_022);
else // BUGFIX: Original didn't do the tricorder animation, etc. in this case
spockScan(DIR_N, TX_SIN1_023);
@@ -173,25 +173,25 @@ void Room::sins1UseRockOnDoor() {
}
void Room::sins1UseRedshirtOnKeypad() {
- if (!_vm->_awayMission.sins.openedDoor)
+ if (!_awayMission->sins.openedDoor)
showText(TX_SPEAKER_MOSHER, TX_SIN1_028);
}
void Room::sins1UseMccoyOnKeypad() {
- if (!_vm->_awayMission.sins.openedDoor)
+ if (!_awayMission->sins.openedDoor)
showText(TX_SPEAKER_MCCOY, TX_SIN1_012);
}
void Room::sins1UseKirkOnKeypad() {
- if (!_vm->_awayMission.sins.openedDoor) {
+ if (!_awayMission->sins.openedDoor) {
showText(TX_SPEAKER_KIRK, TX_SIN1_001);
sins1UseSpockOnKeypad();
}
}
void Room::sins1UseSpockOnKeypad() {
- if (!_vm->_awayMission.sins.openedDoor) {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ if (!_awayMission->sins.openedDoor) {
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
walkCrewmanC(OBJECT_SPOCK, 0xfd, 0xad, &Room::sins1SpockReachedKeypad);
}
}
@@ -204,7 +204,7 @@ void Room::sins1SpockReachedKeypad() {
if (ans == -1) {
// ENHANCEMENT: Do nothing if no code was entered.
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0xf3, 0xad);
} else if (ans == 1 || ans == 2) {
playVoc("EFX14S");
@@ -219,9 +219,9 @@ void Room::sins1SpockReachedKeypad() {
}
void Room::sins1EnteredCorrectCode() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0xf3, 0xad);
- _vm->_awayMission.sins.openedDoor = true;
+ _awayMission->sins.openedDoor = true;
loadMapFile("sins12");
loadActorAnimC(OBJECT_DOOR, "s1door", 0, 0, &Room::sins1DoorDoneOpening);
playVoc("HUGEDOO2");
@@ -232,14 +232,14 @@ void Room::sins1DoorDoneOpening() {
}
void Room::sins1EnteredIncorrectCode() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0xf3, 0xad);
showText(TX_SPEAKER_SPOCK, TX_SIN1_017);
}
void Room::sins1EnteredSacredSofNumber() {
// Entered a sacred Sof number, which is wrong since this is a Lucr base
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0xf3, 0xad);
loadActorAnimC(OBJECT_9, "s1ph1", 0, 0, &Room::sins1DoorUsedLaser);
playSoundEffectIndex(SND_PHASSHOT);
@@ -253,12 +253,12 @@ void Room::sins1DoorUsedLaser() {
loadActorStandAnim(OBJECT_9);
showText(TX_SPEAKER_SPOCK, TX_SIN1_018);
- _vm->_awayMission.sins.field33 = true;
- _vm->_awayMission.sins.doorLaserFiredOnce = true;
+ _awayMission->sins.field33 = true;
+ _awayMission->sins.doorLaserFiredOnce = true;
}
void Room::sins1Tick40() {
- if (!_vm->_awayMission.sins.scottyInformedKirkAboutVirus) {
+ if (!_awayMission->sins.scottyInformedKirkAboutVirus) {
showText(TX_SPEAKER_SCOTT, TX_SIN1_S10);
showText(TX_SPEAKER_KIRK, TX_SIN1_007);
showText(TX_SPEAKER_SCOTT, TX_SIN1_S18);
@@ -267,8 +267,8 @@ void Room::sins1Tick40() {
showText(TX_SPEAKER_KIRK, TX_SIN1_003);
showText(TX_SPEAKER_SCOTT, TX_SIN1_S17);
- _vm->_awayMission.sins.scottyInformedKirkAboutVirus = true;
- _vm->_awayMission.disableInput = false;
+ _awayMission->sins.scottyInformedKirkAboutVirus = true;
+ _awayMission->disableInput = false;
}
}
@@ -318,7 +318,7 @@ void Room::sins1LookAtLens() {
}
void Room::sins1UseCommunicator() {
- if (!_vm->_awayMission.sins.field44) {
+ if (!_awayMission->sins.field44) {
showText(TX_SPEAKER_KIRK, TX_SIN1_008);
showText(TX_SPEAKER_SCOTT, TX_SIN1_S51);
showText(TX_SPEAKER_KIRK, TX_SIN1_002);
@@ -337,7 +337,7 @@ void Room::sins1UseMTricorderOnCrewman() {
}
void Room::sins1WalkToDoor() {
- if (_vm->_awayMission.sins.openedDoor)
+ if (_awayMission->sins.openedDoor)
walkCrewman(OBJECT_KIRK, 0x98, 0x9e, 5); // NOTE: Callback 5 not defined
}
diff --git a/engines/startrek/rooms/trial0.cpp b/engines/startrek/rooms/trial0.cpp
index b1ee211..0508d18 100644
--- a/engines/startrek/rooms/trial0.cpp
+++ b/engines/startrek/rooms/trial0.cpp
@@ -85,8 +85,8 @@ extern const int trial0NumActions = sizeof(trial0ActionList) / sizeof(RoomAction
void Room::trial0Tick1() {
playVoc("TRI0LOOP");
- _vm->_awayMission.timers[0] = getRandomWordInRange(180, 600);
- _vm->_awayMission.trial.field2b = 0x1d;
+ _awayMission->timers[0] = getRandomWordInRange(180, 600);
+ _awayMission->trial.field2b = 0x1d;
loadActorAnim2(OBJECT_VLICT, "vlict1", 0x9f, 0x48);
loadActorAnim2(OBJECT_GUARD, "kgstnd", 0xdc, 0x6a);
loadActorAnim2(OBJECT_QUETZECOATL, "qteleg", 0x10e, 0xaa);
@@ -97,19 +97,19 @@ void Room::trial0Tick40() {
}
void Room::trial0Timer0Expired() { // Doesn't do anything?
- _vm->_awayMission.timers[0] = getRandomWordInRange(180, 600);
+ _awayMission->timers[0] = getRandomWordInRange(180, 600);
}
void Room::trial0WalkToRoomCenter() {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewmanC(OBJECT_KIRK, 0xa0, 0xaa, &Room::trial0ReachedRoomCenter);
}
void Room::trial0ReachedRoomCenter() {
bool gaveUp = false;
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_VLICT, TX_TRI0_053);
const TextRef choices1[] = {
@@ -137,7 +137,7 @@ void Room::trial0ReachedRoomCenter() {
showText(TX_SPEAKER_VLICT, TX_TRI0_061);
showText(TX_SPEAKER_KIRK, TX_TRI0_001);
showText(TX_SPEAKER_VLICT, TX_TRI0_060);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadRoomIndex(1, 4);
} else if (choice == 1) { // "This trial is a mockery"
showText(TX_SPEAKER_VLICT, TX_TRI0_048);
@@ -179,11 +179,11 @@ void Room::trial0ReachedRoomCenter() {
if (choice == 0 || choice == 1) {
showText(TX_SPEAKER_VLICT, TX_TRI0_055);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadRoomIndex(1, 4);
} else { // choice == 2
showText(TX_SPEAKER_VLICT, TX_TRI0_045);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadRoomIndex(1, 4);
}
} else // choice == 2
@@ -197,10 +197,10 @@ void Room::trial0ReachedRoomCenter() {
playMidiMusicTracks(2, -1);
showText(TX_SPEAKER_VLICT, TX_TRI0_049);
showText(TX_SPEAKER_VLICT, TX_TRI0_044);
- _vm->_awayMission.trial.missionEndMethod = 0;
+ _awayMission->trial.missionEndMethod = 0;
// FIXME: Are these parameters in the right order?
- endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 0);
+ endMission(_awayMission->trial.missionScore, _awayMission->trial.field2b, 0);
}
}
diff --git a/engines/startrek/rooms/trial1.cpp b/engines/startrek/rooms/trial1.cpp
index 3fccb3b..8ff3784 100644
--- a/engines/startrek/rooms/trial1.cpp
+++ b/engines/startrek/rooms/trial1.cpp
@@ -170,20 +170,20 @@ extern const int trial1NumActions = sizeof(trial1ActionList) / sizeof(RoomAction
void Room::trial1Tick1() {
- if (!_vm->_awayMission.trial.doorOpen) {
- _vm->_awayMission.disableInput = 2;
+ if (!_awayMission->trial.doorOpen) {
+ _awayMission->disableInput = 2;
loadActorAnim2(OBJECT_DOOR, "t1drc");
}
- if (!_vm->_awayMission.trial.entityDefeated) {
+ if (!_awayMission->trial.entityDefeated) {
loadActorAnim2(OBJECT_ENTITY, "ec", 0x5f, 0xb1, 3); // No callback defined
playVoc("TRI1LOOP");
}
}
void Room::trial1Tick50() {
- if (!_vm->_awayMission.trial.doorOpen)
- _vm->_awayMission.disableInput = false;
- if (!_vm->_awayMission.trial.entityDefeated) {
+ if (!_awayMission->trial.doorOpen)
+ _awayMission->disableInput = false;
+ if (!_awayMission->trial.entityDefeated) {
showText(TX_SPEAKER_BENNIE, TX_TRI1_056);
showText(TX_SPEAKER_SPOCK, TX_TRI1_047);
showText(TX_SPEAKER_MCCOY, TX_TRI1_032);
@@ -195,14 +195,14 @@ void Room::trial1Tick50() {
}
void Room::trial1DoorOpened() { // Called after Spock opens the door
- _vm->_awayMission.trial.doorOpen = true;
+ _awayMission->trial.doorOpen = true;
loadActorStandAnim(OBJECT_DOOR);
}
void Room::trial1TouchedHotspot0() { // Kirk touched the energy thing
- if (!_vm->_awayMission.trial.entityDefeated) {
+ if (!_awayMission->trial.entityDefeated) {
// BUGFIX: Disable input, otherwise you can cancel the death
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadActorAnimC(OBJECT_KIRK, "kkills", -1, -1, &Room::trial1KirkDied);
}
}
@@ -212,29 +212,29 @@ void Room::trial1KirkDied() {
}
void Room::trial1TouchedHotspot1() { // Entered the door
- if (_vm->_awayMission.trial.doorOpen) {
- _vm->_awayMission.disableInput = true;
+ if (_awayMission->trial.doorOpen) {
+ _awayMission->disableInput = true;
loadRoomIndex(2, 2);
}
}
void Room::trial1GetRod() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0xe9, 0xa9, &Room::trial1ReachedRod);
}
void Room::trial1ReachedRod() {
loadActorAnimC(OBJECT_KIRK, "t1pkup", 0xe9, 0xa9, &Room::trial1PickedUpRod);
giveItem(OBJECT_IWROD);
- if (!_vm->_awayMission.trial.gotPointsForGettingRod) {
- _vm->_awayMission.trial.gotPointsForGettingRod = true;
- _vm->_awayMission.trial.missionScore += 1;
+ if (!_awayMission->trial.gotPointsForGettingRod) {
+ _awayMission->trial.gotPointsForGettingRod = true;
+ _awayMission->trial.missionScore += 1;
}
}
void Room::trial1PickedUpRod() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::trial1LookAtKirk() {
@@ -316,8 +316,8 @@ void Room::trial1UsePhaserOnWall() {
void Room::trial1UseStunPhaserOnFloor() {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewmanC(OBJECT_KIRK, 0xca, 0xbc, &Room::trial1ReachedFloorToUseStunPhaser);
}
@@ -327,15 +327,15 @@ void Room::trial1ReachedFloorToUseStunPhaser() {
}
void Room::trial1DoneShootingFloorWithStunPhaser() {
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->disableInput = false;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
loadActorStandAnim(OBJECT_KIRK);
}
void Room::trial1UseKillPhaserOnFloor() {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewmanC(OBJECT_KIRK, 0xca, 0xbc, &Room::trial1ReachedFloorToUseKillPhaser);
}
@@ -348,12 +348,12 @@ void Room::trial1DoneShootingFloorWithKillPhaser() {
showText(TX_TRI1N014);
loadActorAnim2(OBJECT_MOLTEN_ROCK, "t1mltd", 0xca, 0xbc);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
loadActorStandAnim(OBJECT_KIRK);
// BUG: Infinite score mechanism
- _vm->_awayMission.trial.missionScore += 1;
- _vm->_awayMission.disableInput = false;
+ _awayMission->trial.missionScore += 1;
+ _awayMission->disableInput = false;
}
void Room::trial1UsePhaserOnRod() {
@@ -397,7 +397,7 @@ void Room::trial1UseSTricorderOnEntity() {
spockScan(DIR_S, TX_TRI1_012, true);
// BUG: infinite score mechanism
- _vm->_awayMission.trial.missionScore += 1;
+ _awayMission->trial.missionScore += 1;
}
void Room::trial1UseSTricorderOnRods() {
@@ -408,7 +408,7 @@ void Room::trial1UseSTricorderOnFloor() {
spockScan(DIR_S, TX_TRI1_042, true);
// BUG: infinite score mechanism
- _vm->_awayMission.trial.missionScore += 1;
+ _awayMission->trial.missionScore += 1;
}
void Room::trial1UseSTricorderOnDoor() {
@@ -418,15 +418,15 @@ void Room::trial1UseSTricorderOnDoor() {
void Room::trial1UseSTricorderOnLock() {
spockScan(DIR_S, TX_TRI1_014, true);
- if (!_vm->_awayMission.trial.scannedLock) {
- _vm->_awayMission.trial.scannedLock = true;
+ if (!_awayMission->trial.scannedLock) {
+ _awayMission->trial.scannedLock = true;
// BUGFIX: Moved this into the if statement (used to be an infinite score mechanism)
- _vm->_awayMission.trial.missionScore += 1;
+ _awayMission->trial.missionScore += 1;
}
}
void Room::trial1UseCommunicator() {
- if (_vm->_awayMission.trial.forceFieldDown) {
+ if (_awayMission->trial.forceFieldDown) {
showText(TX_SPEAKER_UHURA, TX_TRI1U090);
const TextRef choices[] = {
@@ -437,22 +437,22 @@ void Room::trial1UseCommunicator() {
int choice = showText(choices);
if (choice == 0) { // "Beam us back to the enterprise"
- _vm->_awayMission.trial.missionEndMethod = 1;
+ _awayMission->trial.missionEndMethod = 1;
endMission(1, 1, 1);
} else if (choice == 1) { // "Beam us to Vlict's position"
showText(TX_SPEAKER_UHURA, TX_TRI1U080);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadRoomIndex(4, 4);
} // Else don't transport anywhere
} else { // Force field still up
- if (_vm->_awayMission.trial.uhuraAnalyzedCode)
+ if (_awayMission->trial.uhuraAnalyzedCode)
showText(TX_SPEAKER_UHURA, TX_TRI1U068);
else {
showText(TX_SPEAKER_UHURA, TX_TRI1U086);
showText(TX_SPEAKER_UHURA, TX_TRI1U106);
showText(TX_SPEAKER_UHURA, TX_TRI1U098);
- if (_vm->_awayMission.trial.scannedLock) {
+ if (_awayMission->trial.scannedLock) {
showText(TX_SPEAKER_KIRK, TX_TRI1_011);
showText(TX_SPEAKER_UHURA, TX_TRI1U101);
@@ -465,9 +465,9 @@ void Room::trial1UseCommunicator() {
if (choice == 0) { // Don't analyze the anomolous program
showText(TX_SPEAKER_UHURA, TX_TRI1U079);
- _vm->_awayMission.trial.doorCodeBehaviour = 2;
- _vm->_awayMission.trial.uhuraAnalyzedCode = true;
- _vm->_awayMission.trial.missionScore += 1;
+ _awayMission->trial.doorCodeBehaviour = 2;
+ _awayMission->trial.uhuraAnalyzedCode = true;
+ _awayMission->trial.missionScore += 1;
} else { // Analyze the anomolous program
showText(TX_SPEAKER_UHURA, TX_TRI1U102);
@@ -480,14 +480,14 @@ void Room::trial1UseCommunicator() {
if (choice == 0) { // Activate the program
showText(TX_SPEAKER_UHURA, TX_TRI1U095);
- _vm->_awayMission.trial.doorCodeBehaviour = 5;
- _vm->_awayMission.trial.uhuraAnalyzedCode = true;
- _vm->_awayMission.trial.missionScore += 3;
+ _awayMission->trial.doorCodeBehaviour = 5;
+ _awayMission->trial.uhuraAnalyzedCode = true;
+ _awayMission->trial.missionScore += 3;
} else { // Don't activate, only open the door
showText(TX_SPEAKER_UHURA, TX_TRI1U079);
- _vm->_awayMission.trial.doorCodeBehaviour = 2;
- _vm->_awayMission.trial.uhuraAnalyzedCode = true;
- _vm->_awayMission.trial.missionScore += 1;
+ _awayMission->trial.doorCodeBehaviour = 2;
+ _awayMission->trial.uhuraAnalyzedCode = true;
+ _awayMission->trial.missionScore += 1;
}
}
}
@@ -500,9 +500,9 @@ void Room::trial1UseMccoyOnEntity() {
}
void Room::trial1UseMccoyOnLock() {
- if (!_vm->_awayMission.trial.entityDefeated)
+ if (!_awayMission->trial.entityDefeated)
showText(TX_SPEAKER_MCCOY, TX_TRI1_018);
- else if (_vm->_awayMission.trial.doorCodeBehaviour == 0)
+ else if (_awayMission->trial.doorCodeBehaviour == 0)
showText(TX_SPEAKER_MCCOY, TX_TRI1_020);
else
showText(TX_SPEAKER_MCCOY, TX_TRI1_029);
@@ -518,13 +518,13 @@ void Room::trial1UseSpockOnEntity() {
void Room::trial1UseSpockOnLock() {
- if (_vm->_awayMission.trial.doorOpen)
+ if (_awayMission->trial.doorOpen)
showText(TX_SPEAKER_SPOCK, TX_TRI1_038);
- else if (!_vm->_awayMission.trial.entityDefeated)
+ else if (!_awayMission->trial.entityDefeated)
showText(TX_SPEAKER_SPOCK, TX_TRI1_036);
- else if (_vm->_awayMission.trial.doorCodeBehaviour == 0)
+ else if (_awayMission->trial.doorCodeBehaviour == 0)
showText(TX_SPEAKER_SPOCK, TX_TRI1_044);
- else if (_vm->_awayMission.trial.doorCodeBehaviour == 2)
+ else if (_awayMission->trial.doorCodeBehaviour == 2)
walkCrewmanC(OBJECT_SPOCK, 0x1f, 0xb8, &Room::trial1SpockReachedKeypad);
else
walkCrewmanC(OBJECT_SPOCK, 0x1f, 0xb8, &Room::trial1SpockReachedKeypadWithExtraProgram);
@@ -536,11 +536,11 @@ void Room::trial1SpockReachedKeypad() { // Spock opens the door
}
void Room::trial1SpockUsedKeypad() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
loadActorStandAnim(OBJECT_SPOCK);
playSoundEffectIndex(SND_DOOR1);
loadActorAnimC(OBJECT_DOOR, "t1drco", -1, -1, &Room::trial1DoorOpened);
- _vm->_awayMission.trial.doorOpen = true;
+ _awayMission->trial.doorOpen = true;
}
void Room::trial1SpockReachedKeypadWithExtraProgram() { // Spock activates the unknown program
@@ -549,10 +549,10 @@ void Room::trial1SpockReachedKeypadWithExtraProgram() { // Spock activates the u
}
void Room::trial1SpockUsedKeypadWithExtraProgram() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
loadActorStandAnim(OBJECT_SPOCK);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadRoomIndex(5, 5);
}
@@ -567,13 +567,13 @@ void Room::trial1UseRedshirtOnEntity() {
void Room::trial1UseRedshirtOnLock() {
- if (_vm->_awayMission.trial.doorOpen)
+ if (_awayMission->trial.doorOpen)
return;
- else if (!_vm->_awayMission.trial.entityDefeated)
+ else if (!_awayMission->trial.entityDefeated)
showText(TX_SPEAKER_BENNIE, TX_TRI1_051);
- else if (_vm->_awayMission.trial.doorCodeBehaviour == 0)
+ else if (_awayMission->trial.doorCodeBehaviour == 0)
showText(TX_SPEAKER_BENNIE, TX_TRI1_054);
- else if (_vm->_awayMission.trial.doorCodeBehaviour == 2)
+ else if (_awayMission->trial.doorCodeBehaviour == 2)
walkCrewmanC(OBJECT_REDSHIRT, 0x1f, 0xb8, &Room::trial1RedshirtReachedKeypad);
else
walkCrewmanC(OBJECT_REDSHIRT, 0x1f, 0xb8, &Room::trial1RedshirtReachedKeypadWithExtraProgram);
@@ -585,11 +585,11 @@ void Room::trial1RedshirtReachedKeypad() { // Redshirt opens the lock
}
void Room::trial1RedshirtUsedKeypad() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
loadActorStandAnim(OBJECT_REDSHIRT);
playSoundEffectIndex(SND_DOOR1);
loadActorAnimC(OBJECT_DOOR, "t1drco", -1, -1, &Room::trial1DoorOpened);
- _vm->_awayMission.trial.doorOpen = true;
+ _awayMission->trial.doorOpen = true;
}
void Room::trial1RedshirtReachedKeypadWithExtraProgram() {
@@ -598,10 +598,10 @@ void Room::trial1RedshirtReachedKeypadWithExtraProgram() {
}
void Room::trial1RedshirtUsedKeypadWithExtraProgram() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
loadActorStandAnim(OBJECT_REDSHIRT);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadRoomIndex(5, 5);
}
@@ -630,7 +630,7 @@ void Room::trial1UseRodOnFloorOrWall() {
void Room::trial1UseWoodRodOnEntity() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0xe9, 0xad, &Room::trial1ReachedPositionToThrowWoodRod);
loseItem(OBJECT_IWROD);
}
@@ -640,7 +640,7 @@ void Room::trial1ReachedPositionToThrowWoodRod() {
}
void Room::trial1DoneThrowingWoodRod() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
@@ -650,7 +650,7 @@ void Room::trial1UseWoodRodOnLock() {
void Room::trial1UseWoodRodOnMoltenRock() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0xe4, 0xc4, &Room::trial1ReachedMoltenRock);
}
@@ -659,22 +659,22 @@ void Room::trial1ReachedMoltenRock() {
}
void Room::trial1DoneCoatingWoodRod() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_TRI1N013);
loseItem(OBJECT_IWROD);
giveItem(OBJECT_IIROD);
- if (!_vm->_awayMission.trial.gotPointsForCoatingRodWithIron) {
- _vm->_awayMission.trial.gotPointsForCoatingRodWithIron = true;
- _vm->_awayMission.trial.missionScore += 1;
+ if (!_awayMission->trial.gotPointsForCoatingRodWithIron) {
+ _awayMission->trial.gotPointsForCoatingRodWithIron = true;
+ _awayMission->trial.missionScore += 1;
}
}
void Room::trial1UseIronRodOnEntity() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0xe9, 0xac, &Room::trial1ReachedPositionToThrowIronRod);
- _vm->_awayMission.trial.entityDefeated = true;
+ _awayMission->trial.entityDefeated = true;
loseItem(OBJECT_IIROD);
}
@@ -686,15 +686,15 @@ void Room::trial1ReachedPositionToThrowIronRod() {
void Room::trial1DoneThrowingIronRod() {
loadActorAnim(OBJECT_THROWN_IRON_ROD, "t1irod", 0xe9, 0xac, 8); // No callback defined
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
loadActorStandAnim(OBJECT_KIRK);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
stopAllVocSounds();
showText(TX_SPEAKER_SPOCK, TX_TRI1_045);
showText(TX_SPEAKER_MCCOY, TX_TRI1_033);
- _vm->_awayMission.trial.missionScore += 1;
+ _awayMission->trial.missionScore += 1;
}
@@ -707,7 +707,7 @@ void Room::trial1GetThrownIronRod() {
}
void Room::trial1WalkToDoor() {
- if (_vm->_awayMission.trial.doorOpen)
+ if (_awayMission->trial.doorOpen)
walkCrewman(OBJECT_KIRK, 0x1a, 0xac, 28);
}
diff --git a/engines/startrek/rooms/trial2.cpp b/engines/startrek/rooms/trial2.cpp
index a23be95..d9fc5e2 100644
--- a/engines/startrek/rooms/trial2.cpp
+++ b/engines/startrek/rooms/trial2.cpp
@@ -126,40 +126,40 @@ extern const int trial2NumActions = sizeof(trial2ActionList) / sizeof(RoomAction
void Room::trial2Tick1() {
playVoc("NOOOLOOP");
- if (!_vm->_awayMission.trial.enteredGlobRoom)
- _vm->_awayMission.disableInput = 2;
+ if (!_awayMission->trial.enteredGlobRoom)
+ _awayMission->disableInput = 2;
- if (!_vm->_awayMission.trial.globDefeated) {
+ if (!_awayMission->trial.globDefeated) {
playMidiMusicTracks(MIDITRACK_24, -1);
loadMapFile("trial22");
- if (!_vm->_awayMission.trial.globSplitInTwo) {
+ if (!_awayMission->trial.globSplitInTwo) {
playVoc("TRI2LOOP");
loadActorAnim2(OBJECT_GLOB, "sglob", 0x46, 0xaf);
- _vm->_awayMission.trial.globEnergyLevels[0] = 1;
+ _awayMission->trial.globEnergyLevels[0] = 1;
} else {
playVoc("TRI2LOOP");
loadActorAnim2(OBJECT_SPLIT_GLOB_1, "sglob", 0x20, 0xaf);
loadActorAnim2(OBJECT_SPLIT_GLOB_2, "sglob", 0x69, 0xaf);
- _vm->_awayMission.trial.globEnergyLevels[1] = 1;
- _vm->_awayMission.trial.globEnergyLevels[2] = 1;
+ _awayMission->trial.globEnergyLevels[1] = 1;
+ _awayMission->trial.globEnergyLevels[2] = 1;
}
}
}
void Room::trial2Tick60() {
- if (!_vm->_awayMission.trial.enteredGlobRoom) {
- _vm->_awayMission.disableInput = false;
+ if (!_awayMission->trial.enteredGlobRoom) {
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_BENNIE, TX_TRI2_034);
showText(TX_SPEAKER_KIRK, TX_TRI2_005);
showText(TX_SPEAKER_SPOCK, TX_TRI2_030);
showText(TX_SPEAKER_KIRK, TX_TRI2_008);
- _vm->_awayMission.trial.enteredGlobRoom = true;
+ _awayMission->trial.enteredGlobRoom = true;
}
}
void Room::trial2TouchedHotspot0() { // This is unused
- if (_vm->_awayMission.trial.globEnergyLevels[1] != 0 || _vm->_awayMission.trial.globEnergyLevels[2] != 0)
+ if (_awayMission->trial.globEnergyLevels[1] != 0 || _awayMission->trial.globEnergyLevels[2] != 0)
showText(TX_SPEAKER_SPOCK, TX_TRI2_024);
}
@@ -224,7 +224,7 @@ void Room::trial2UsePhaserOnGlob(int object, bool phaserOnKill) {
_roomVar.trial.globBeingShot = object;
_roomVar.trial.phaserOnKill = phaserOnKill;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0xcd, 0xc5, &Room::trial2ReachedPositionToShootGlob);
}
@@ -246,7 +246,7 @@ void Room::trial2DrewPhaserToShootGlob() {
int index = _roomVar.trial.globBeingShot - OBJECT_GLOB;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
playSoundEffectIndex(SND_PHASSHOT);
if (_roomVar.trial.phaserOnKill)
showBitmapFor5Ticks(killPhaserAnims[index], 5);
@@ -254,12 +254,12 @@ void Room::trial2DrewPhaserToShootGlob() {
showBitmapFor5Ticks(stunPhaserAnims[index], 5);
loadActorStandAnim(OBJECT_KIRK);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
if (_roomVar.trial.phaserOnKill)
- _vm->_awayMission.trial.globEnergyLevels[index] += 2;
+ _awayMission->trial.globEnergyLevels[index] += 2;
else
- _vm->_awayMission.trial.globEnergyLevels[index] += 1;
+ _awayMission->trial.globEnergyLevels[index] += 1;
if (!(_roomVar.trial.globBeingShot == OBJECT_GLOB && _roomVar.trial.phaserOnKill == true)) {
if (_roomVar.trial.phaserOnKill)
@@ -275,10 +275,10 @@ void Room::trial2DrewPhaserToShootGlob() {
Common::Point(SPLIT_GLOB_2_X, SPLIT_GLOB_2_Y)
};
- if (_vm->_awayMission.trial.globEnergyLevels[index] == 3) {
+ if (_awayMission->trial.globEnergyLevels[index] == 3) {
playVoc("GLOBEDIV");
loadActorAnimC(_roomVar.trial.globBeingShot, "globsp", globPositions[index].x, globPositions[index].y, &Room::trial2GlobDoneSplitting);
- } else if (_vm->_awayMission.trial.globEnergyLevels[index] >= 4) {
+ } else if (_awayMission->trial.globEnergyLevels[index] >= 4) {
playSoundEffectIndex(SND_BLANK_14);
playVoc("REDBALL");
loadActorAnimC(_roomVar.trial.globBeingShot, "globex", globPositions[index].x, globPositions[index].y, &Room::trial2GlobDoneExploding);
@@ -289,9 +289,9 @@ void Room::trial2GlobDoneExploding() {
stopAllVocSounds();
playVoc("Noooloop");
showText(TX_SPEAKER_SPOCK, TX_TRI2_020);
- _vm->_awayMission.trial.globDefeated = true;
+ _awayMission->trial.globDefeated = true;
playMidiMusicTracks(MIDITRACK_28, -1);
- _vm->_awayMission.trial.missionScore += 1;
+ _awayMission->trial.missionScore += 1;
loadMapFile("trial2");
}
@@ -302,10 +302,10 @@ void Room::trial2GlobDoneSplitting() {
else {
// Unused code block: instead of killing the crew right away, the crew can
// interact with the split globs.
- _vm->_awayMission.trial.globEnergyLevels[0] = 0;
- _vm->_awayMission.trial.globEnergyLevels[1] = 1;
- _vm->_awayMission.trial.globEnergyLevels[2] = 1;
- _vm->_awayMission.trial.globSplitInTwo = true;
+ _awayMission->trial.globEnergyLevels[0] = 0;
+ _awayMission->trial.globEnergyLevels[1] = 1;
+ _awayMission->trial.globEnergyLevels[2] = 1;
+ _awayMission->trial.globSplitInTwo = true;
loadActorAnim2(OBJECT_SPLIT_GLOB_1, "sglob", SPLIT_GLOB_1_X, SPLIT_GLOB_1_Y);
loadActorAnim2(OBJECT_SPLIT_GLOB_2, "sglob", SPLIT_GLOB_2_X, SPLIT_GLOB_2_Y);
loadActorStandAnim(OBJECT_GLOB);
@@ -322,7 +322,7 @@ void Room::trial2GlobDoneSplitting() {
// Everyone gets vaporized
playVoc("V7ALLGET");
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
playMidiMusicTracks(MIDITRACK_26, -1);
loadActorAnimC(OBJECT_KIRK, "kkills", -1, -1, &Room::trial2KirkDied);
loadActorAnim2(OBJECT_SPOCK, "skills");
@@ -331,7 +331,7 @@ void Room::trial2GlobDoneSplitting() {
}
void Room::trial2KirkDied() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showGameOverMenu();
}
@@ -378,9 +378,9 @@ void Room::trial2UseMTricorderOnRedshirt() {
void Room::trial2UseMTricorderOnGlob() {
mccoyScan(DIR_S, TX_TRI2_011, true);
- if (!_vm->_awayMission.trial.gotPointsForScanningGlob) {
- _vm->_awayMission.trial.gotPointsForScanningGlob = true;
- _vm->_awayMission.trial.missionScore += 1;
+ if (!_awayMission->trial.gotPointsForScanningGlob) {
+ _awayMission->trial.gotPointsForScanningGlob = true;
+ _awayMission->trial.missionScore += 1;
}
}
@@ -395,14 +395,14 @@ void Room::trial2UseSTricorderAnywhere() {
void Room::trial2UseSTricorderOnGlob() {
spockScan(DIR_S, TX_TRI2_026, true);
- if (!_vm->_awayMission.trial.gotPointsForScanningGlob) {
- _vm->_awayMission.trial.gotPointsForScanningGlob = true;
- _vm->_awayMission.trial.missionScore += 1;
+ if (!_awayMission->trial.gotPointsForScanningGlob) {
+ _awayMission->trial.gotPointsForScanningGlob = true;
+ _awayMission->trial.missionScore += 1;
}
}
void Room::trial2UseCommunicator() {
- if (_vm->_awayMission.trial.forceFieldDown) { // TODO: Refactor this between rooms?
+ if (_awayMission->trial.forceFieldDown) { // TODO: Refactor this between rooms?
showText(TX_SPEAKER_UHURA, TX_TRI2U091);
const TextRef choices[] = {
@@ -413,18 +413,18 @@ void Room::trial2UseCommunicator() {
int choice = showText(choices);
if (choice == 0) { // "Beam us back to the enterprise"
- _vm->_awayMission.trial.missionEndMethod = 1;
- endMission(_vm->_awayMission.trial.missionScore, 1, 1); // FIXME: Inconsistent with TRIAL1
+ _awayMission->trial.missionEndMethod = 1;
+ endMission(_awayMission->trial.missionScore, 1, 1); // FIXME: Inconsistent with TRIAL1
} else if (choice == 1) { // "Beam us to Vlict's position"
showText(TX_SPEAKER_UHURA, TX_TRI1U080); // NOTE: Original didn't show text here
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadRoomIndex(4, 4);
} // Else don't transport anywhere
} else { // Force field still up
showText(TX_SPEAKER_UHURA, TX_TRI2U087);
showText(TX_SPEAKER_KIRK, TX_TRI2_006);
showText(TX_SPEAKER_UHURA, TX_TRI2U104);
- if (!_vm->_awayMission.trial.globDefeated) {
+ if (!_awayMission->trial.globDefeated) {
showText(TX_SPEAKER_UHURA, TX_TRI2U081);
showText(TX_SPEAKER_KIRK, TX_TRI2_002);
}
diff --git a/engines/startrek/rooms/trial3.cpp b/engines/startrek/rooms/trial3.cpp
index a37bd62..49ac5bd 100644
--- a/engines/startrek/rooms/trial3.cpp
+++ b/engines/startrek/rooms/trial3.cpp
@@ -97,17 +97,17 @@ extern const int trial3NumActions = sizeof(trial3ActionList) / sizeof(RoomAction
void Room::trial3Tick1() {
playVoc("TRI3LOOP");
- if (!_vm->_awayMission.trial.enteredTrial3FirstTime) {
- _vm->_awayMission.disableWalking = true;
- _vm->_awayMission.disableInput = 2;
+ if (!_awayMission->trial.enteredTrial3FirstTime) {
+ _awayMission->disableWalking = true;
+ _awayMission->disableInput = 2;
}
playMidiMusicTracks(MIDITRACK_33, -1);
}
void Room::trial3Tick30() {
- if (!_vm->_awayMission.trial.enteredTrial3FirstTime) {
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.trial.enteredTrial3FirstTime = true;
+ if (!_awayMission->trial.enteredTrial3FirstTime) {
+ _awayMission->disableInput = false;
+ _awayMission->trial.enteredTrial3FirstTime = true;
showText(TX_SPEAKER_BENNIE, TX_TRI3_030);
showText(TX_SPEAKER_KIRK, TX_TRI3_005);
@@ -134,13 +134,13 @@ void Room::trial3Klingon3BeamedIn() {
}
void Room::trial3KlingonShootsSomeone1() {
- _vm->_awayMission.trial.klingonShootIndex++;
- if (_vm->_awayMission.trial.klingonShootIndex == 1) {
+ _awayMission->trial.klingonShootIndex++;
+ if (_awayMission->trial.klingonShootIndex == 1) {
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3phas04", 5);
loadActorAnimC(OBJECT_REDSHIRT, "rkillw", -1, -1, &Room::trial3RedshirtDoneDying);
- _vm->_awayMission.redshirtDead = true;
- } else if (_vm->_awayMission.trial.klingonShootIndex == 2) {
+ _awayMission->redshirtDead = true;
+ } else if (_awayMission->trial.klingonShootIndex == 2) {
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3phas05", 5);
playMidiMusicTracks(MIDITRACK_2, -1);
@@ -166,13 +166,13 @@ void Room::trial3Klingon3DoneShooting() {
void Room::trial3KlingonShootsSomeone2() {
// This function is almost exactly identical to "trial3KlingonShootsSomeone1(), just
// one line differs...
- _vm->_awayMission.trial.klingonShootIndex++;
- if (_vm->_awayMission.trial.klingonShootIndex == 1) {
+ _awayMission->trial.klingonShootIndex++;
+ if (_awayMission->trial.klingonShootIndex == 1) {
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3phas04", 5);
loadActorAnimC(OBJECT_REDSHIRT, "rkillw", -1, -1, &Room::trial3RedshirtDoneDying);
- _vm->_awayMission.redshirtDead = true;
- } else if (_vm->_awayMission.trial.klingonShootIndex == 2) {
+ _awayMission->redshirtDead = true;
+ } else if (_awayMission->trial.klingonShootIndex == 2) {
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3phas05", 5);
// NOTE: Only difference to "trial3KlingonShootsSomeone1" is this doesn't play a midi track?
@@ -181,7 +181,7 @@ void Room::trial3KlingonShootsSomeone2() {
}
void Room::trial3RedshirtDoneDying() {
- _vm->_awayMission.redshirtDead = true;
+ _awayMission->redshirtDead = true;
}
void Room::trial3KirkDoneDying() {
@@ -189,31 +189,31 @@ void Room::trial3KirkDoneDying() {
}
void Room::trial3Klingon1Shot() {
- _vm->_awayMission.trial.shotKlingons |= 1;
+ _awayMission->trial.shotKlingons |= 1;
trial3CheckShowUhuraText();
}
void Room::trial3Klingon2Shot() {
- _vm->_awayMission.trial.shotKlingons |= 2;
+ _awayMission->trial.shotKlingons |= 2;
trial3CheckShowUhuraText();
}
void Room::trial3Klingon3Shot() {
- _vm->_awayMission.trial.shotKlingons |= 4;
+ _awayMission->trial.shotKlingons |= 4;
trial3CheckShowUhuraText();
}
void Room::trial3CheckShowUhuraText() {
- if (_vm->_awayMission.trial.shotKlingons == 1) {
- _vm->_awayMission.trial.shotKlingons |= 8;
- _vm->_awayMission.disableWalking = false;
+ if (_awayMission->trial.shotKlingons == 1) {
+ _awayMission->trial.shotKlingons |= 8;
+ _awayMission->disableWalking = false;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_SPEAKER_UHURA, TX_TRI3U084);
showText(TX_SPEAKER_KIRK, TX_TRI3_007);
showText(TX_SPEAKER_UHURA, TX_TRI3U099);
- _vm->_awayMission.trial.forceFieldDown = true;
+ _awayMission->trial.forceFieldDown = true;
const TextRef choices[] = {
TX_SPEAKER_KIRK,
@@ -224,7 +224,7 @@ void Room::trial3CheckShowUhuraText() {
if (choice == 0) { // Don't beam out
} else if (choice == 1) { // Beam to enterprise
- endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 1); // FIXME: inconsistent
+ endMission(_awayMission->trial.missionScore, _awayMission->trial.field2b, 1); // FIXME: inconsistent
} else if (choice == 2) { // Beam to Vlict
trial3BeamToVlict();
}
@@ -232,19 +232,19 @@ void Room::trial3CheckShowUhuraText() {
}
void Room::trial3CrewmanBeamedOut() {
- if (!_vm->_awayMission.trial.gotPointsForBeamingOut) {
- _vm->_awayMission.trial.gotPointsForBeamingOut = true;
- _vm->_awayMission.trial.missionScore += 2; // BUG: Doesn't happen when done in other rooms
+ if (!_awayMission->trial.gotPointsForBeamingOut) {
+ _awayMission->trial.gotPointsForBeamingOut = true;
+ _awayMission->trial.missionScore += 2; // BUG: Doesn't happen when done in other rooms
}
loadRoomIndex(4, 4);
}
void Room::trial3Tick90() {
- if ((!(_vm->_awayMission.trial.shotKlingons & 8) && _vm->_awayMission.trial.shotKlingonState != 20)) {
+ if ((!(_awayMission->trial.shotKlingons & 8) && _awayMission->trial.shotKlingonState != 20)) {
playSoundEffectIndex(SND_TRANSMAT);
playMidiMusicTracks(MIDITRACK_32, -1);
loadActorAnimC(OBJECT_KLINGON_1, "t3ktel", 0x57, 0xb1, &Room::trial3Klingon1BeamedIn);
- _vm->_awayMission.trial.shotKlingonState = 21;
+ _awayMission->trial.shotKlingonState = 21;
}
}
@@ -308,19 +308,19 @@ void Room::trial3UseStunPhaserOnKlingon1() {
// he's conscious (21).
// There's also the "dead" state (23) to consider. This prevents a softlock if
// a phaser is used on him just as he's being vaporized.
- if (_vm->_awayMission.trial.shotKlingonState == 21) {
- _vm->_awayMission.disableInput = true;
+ if (_awayMission->trial.shotKlingonState == 21) {
+ _awayMission->disableInput = true;
loadActorAnimC(OBJECT_KIRK, "kdraww", -1, -1, &Room::trial3ReadyToShootKlingon1OnStun);
}
}
void Room::trial3ReadyToShootKlingon1OnStun() {
- if (_vm->_awayMission.trial.shotKlingonState == 21) {
+ if (_awayMission->trial.shotKlingonState == 21) {
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3phas00", 5);
loadActorAnimC(OBJECT_KLINGON_1, "t3kstn", -1, -1, &Room::trial3Klingon1Shot);
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.trial.shotKlingonState = 22;
+ _awayMission->disableInput = false;
+ _awayMission->trial.shotKlingonState = 22;
}
}
@@ -328,20 +328,20 @@ void Room::trial3UseKillPhaserOnKlingon1() {
// BUGFIX: Prevent softlock by checking that he's conscious (shotKlingonState == 21)
// In addition to preventing the softlock mentioned above, this also prevents
// a softlock where a kill phaser is used on the unconscious klingon.
- if (_vm->_awayMission.trial.shotKlingonState == 21) {
- _vm->_awayMission.disableInput = true;
+ if (_awayMission->trial.shotKlingonState == 21) {
+ _awayMission->disableInput = true;
loadActorAnimC(OBJECT_KIRK, "kdraww", -1, -1, &Room::trial3ReadyToShootKlingon1OnKill);
}
}
void Room::trial3ReadyToShootKlingon1OnKill() {
- if (_vm->_awayMission.trial.shotKlingonState == 21) {
+ if (_awayMission->trial.shotKlingonState == 21) {
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3phas02", 5);
loadActorAnimC(OBJECT_KLINGON_1, "t3kdie", -1, -1, &Room::trial3Klingon1Shot);
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.trial.shotKlingonState = 23;
- _vm->_awayMission.trial.missionScore -= 3; // Penalty for killing klingon
+ _awayMission->disableInput = false;
+ _awayMission->trial.shotKlingonState = 23;
+ _awayMission->trial.missionScore -= 3; // Penalty for killing klingon
}
}
@@ -379,15 +379,15 @@ void Room::trial3UseSTricorderOnExit() {
}
void Room::trial3UseMTricorderOnKlingon() {
- if (_vm->_awayMission.trial.shotKlingonState == 22) { // Unconscious
+ if (_awayMission->trial.shotKlingonState == 22) { // Unconscious
mccoyScan(DIR_S, TX_TRI3_011);
- if (!_vm->_awayMission.redshirtDead) // BUGFIX: Check if redshirt is dead
+ if (!_awayMission->redshirtDead) // BUGFIX: Check if redshirt is dead
showText(TX_SPEAKER_BENNIE, TX_TRI3_028);
}
}
void Room::trial3UseCommunicator() {
- if (_vm->_awayMission.trial.forceFieldDown) {
+ if (_awayMission->trial.forceFieldDown) {
showText(TX_SPEAKER_UHURA, TX_TRI3U089);
const TextRef choices[] = {
@@ -398,8 +398,8 @@ void Room::trial3UseCommunicator() {
int choice = showText(choices);
if (choice == 0) { // "Beam us back to the enterprise"
- _vm->_awayMission.trial.missionEndMethod = 1;
- endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 1); // FIXME: inconsistent
+ _awayMission->trial.missionEndMethod = 1;
+ endMission(_awayMission->trial.missionScore, _awayMission->trial.field2b, 1); // FIXME: inconsistent
} else if (choice == 1) { // "Beam us to Vlict's position"
trial3BeamToVlict();
} // Else don't transport anywhere
@@ -414,13 +414,13 @@ void Room::trial3BeamToVlict() {
// text from TRIAL1 instead.
showText(TX_SPEAKER_UHURA, TX_TRI1U080);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
playSoundEffectIndex(SND_TRANSDEM);
loadActorAnimC(OBJECT_KIRK, "kteled", -1, -1, &Room::trial3CrewmanBeamedOut);
loadActorAnimC(OBJECT_SPOCK, "steled", -1, -1, &Room::trial3CrewmanBeamedOut);
loadActorAnimC(OBJECT_MCCOY, "mteled", -1, -1, &Room::trial3CrewmanBeamedOut);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
loadActorAnimC(OBJECT_REDSHIRT, "rteled", -1, -1, &Room::trial3CrewmanBeamedOut);
}
diff --git a/engines/startrek/rooms/trial4.cpp b/engines/startrek/rooms/trial4.cpp
index 29e4fcf..b6de4d7 100644
--- a/engines/startrek/rooms/trial4.cpp
+++ b/engines/startrek/rooms/trial4.cpp
@@ -180,8 +180,8 @@ void Room::trial4Tick60() {
}
showText(TX_SPEAKER_KIRK, TX_TRI4_012);
- _vm->_awayMission.trial.missionEndMethod = 2;
- endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 2);
+ _awayMission->trial.missionEndMethod = 2;
+ endMission(_awayMission->trial.missionScore, _awayMission->trial.field2b, 2);
}
}
diff --git a/engines/startrek/rooms/trial5.cpp b/engines/startrek/rooms/trial5.cpp
index ecc3c64..ec1111d 100644
--- a/engines/startrek/rooms/trial5.cpp
+++ b/engines/startrek/rooms/trial5.cpp
@@ -220,14 +220,14 @@ void Room::trial5VlictAppeared() {
if (choice == 1) { // "Now you can rot as you deserve"
showText(TX_SPEAKER_BIALBI, TX_TRI5_034);
- _vm->_awayMission.trial.missionEndMethod = 4;
- endMission(_vm->_awayMission.trial.missionScore, 1, 4);
+ _awayMission->trial.missionEndMethod = 4;
+ endMission(_awayMission->trial.missionScore, 1, 4);
} else if (choice == 2) { // "I'll intervene if Quetzecoatl goes free"
showText(TX_SPEAKER_VLICT, TX_TRI5_019);
playMidiMusicTracks(MIDITRACK_28, -1);
showText(TX_SPEAKER_BIALBI, TX_TRI5_025);
- _vm->_awayMission.trial.missionScore += 4;
+ _awayMission->trial.missionScore += 4;
showText(TX_SPEAKER_KIRK, TX_TRI5_004);
showText(TX_SPEAKER_BIALBI, TX_TRI5_030);
showText(TX_SPEAKER_BIALBI, TX_TRI5_026);
@@ -237,7 +237,7 @@ void Room::trial5VlictAppeared() {
showText(TX_SPEAKER_BIALBI, TX_TRI5_033);
showText(TX_SPEAKER_BIALBI, TX_TRI5_032);
- _vm->_awayMission.trial.missionEndMethod = 3;
+ _awayMission->trial.missionEndMethod = 3;
endMission(1, 1, 3); // FIXME: Are these parameters correct?
}
}
@@ -247,12 +247,12 @@ void Room::trial5WalkToInterface() {
}
void Room::trial5ReachedInterface() {
- if (!_vm->_awayMission.trial.neuralInterfaceActive)
+ if (!_awayMission->trial.neuralInterfaceActive)
showText(TX_SPEAKER_VOICE, TX_TRI5_035);
else {
showText(TX_SPEAKER_BIALBI, TX_TRI5_024);
loadActorAnimC(OBJECT_VLICT, "vlict1", 0xbe, 0x91, &Room::trial5VlictAppeared);
- _vm->_awayMission.trial.missionScore += 5;
+ _awayMission->trial.missionScore += 5;
playMidiMusicTracks(MIDITRACK_1, -1);
}
}
@@ -261,20 +261,20 @@ void Room::trial5GetGem(int16 item, int16 object) {
_roomVar.trial.itemToUse = item;
_roomVar.trial.objectToUse = object;
- _vm->_awayMission.disableInput = true;
- if (object == _vm->_awayMission.trial.holeContents[0]) {
- _vm->_awayMission.trial.holeContents[0] = 0;
- _vm->_awayMission.trial.neuralInterfaceActive = false;
+ _awayMission->disableInput = true;
+ if (object == _awayMission->trial.holeContents[0]) {
+ _awayMission->trial.holeContents[0] = 0;
+ _awayMission->trial.neuralInterfaceActive = false;
loadActorStandAnim(OBJECT_BEAM);
walkCrewmanC(OBJECT_KIRK, 0x2c, 0x9f, &Room::trial5ReachedGem);
- } else if (object == _vm->_awayMission.trial.holeContents[1]) {
- _vm->_awayMission.trial.holeContents[1] = 0;
- _vm->_awayMission.trial.neuralInterfaceActive = false;
+ } else if (object == _awayMission->trial.holeContents[1]) {
+ _awayMission->trial.holeContents[1] = 0;
+ _awayMission->trial.neuralInterfaceActive = false;
loadActorStandAnim(OBJECT_BEAM);
walkCrewmanC(OBJECT_KIRK, 0x22, 0x9f, &Room::trial5ReachedGem);
- } else if (object == _vm->_awayMission.trial.holeContents[2]) {
- _vm->_awayMission.trial.holeContents[2] = 0;
- _vm->_awayMission.trial.neuralInterfaceActive = false;
+ } else if (object == _awayMission->trial.holeContents[2]) {
+ _awayMission->trial.holeContents[2] = 0;
+ _awayMission->trial.neuralInterfaceActive = false;
loadActorStandAnim(OBJECT_BEAM);
walkCrewmanC(OBJECT_KIRK, 0x3c, 0x9f, &Room::trial5ReachedGem);
} else if (object == OBJECT_REDGEM1 || object == OBJECT_REDGEM2 || object == OBJECT_REDGEM3)
@@ -292,7 +292,7 @@ void Room::trial5ReachedGem() {
void Room::trial5PickedUpGem() {
giveItem(_roomVar.trial.itemToUse);
loadActorStandAnim(_roomVar.trial.objectToUse);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::trial5GetRedGem1() {
@@ -451,7 +451,7 @@ void Room::trial5UseGemOnHole(int16 item, int16 object, int16 hole) {
_roomVar.trial.objectToUse = object;
_roomVar.trial.hole = hole;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewmanC(OBJECT_KIRK, positions[hole].x, positions[hole].y, &Room::trial5ReachedHoleToPutGem);
}
@@ -473,8 +473,8 @@ void Room::trial5ReachedHoleToPutGem() {
loadActorAnim2(OBJECT_KIRK, "kusehn");
- if (_vm->_awayMission.trial.holeContents[hole] == 0) {
- _vm->_awayMission.trial.holeContents[hole] = _roomVar.trial.objectToUse;
+ if (_awayMission->trial.holeContents[hole] == 0) {
+ _awayMission->trial.holeContents[hole] = _roomVar.trial.objectToUse;
loadActorAnim2(_roomVar.trial.objectToUse, anim, pos.x, pos.y);
loseItem(_roomVar.trial.itemToUse);
@@ -490,7 +490,7 @@ void Room::trial5ReachedHoleToPutGem() {
holes[2] = 0;
for (int i = 0; i < 3; i++) {
- int16 c = _vm->_awayMission.trial.holeContents[i];
+ int16 c = _awayMission->trial.holeContents[i];
if (c >= OBJECT_REDGEM1 && c <= OBJECT_REDGEM3)
holes[i] = RED;
else if (c >= OBJECT_GRNGEM1 && c <= OBJECT_GRNGEM3)
@@ -537,11 +537,11 @@ void Room::trial5ReachedHoleToPutGem() {
playVoc("EFX12B");
showText(TX_SPEAKER_LIGHT_OF_KNOWLEDGE, TX_TRI5_040);
showText(TX_SPEAKER_LIGHT_OF_KNOWLEDGE, TX_TRI5_037);
- _vm->_awayMission.trial.neuralInterfaceActive = true;
+ _awayMission->trial.neuralInterfaceActive = true;
- if (!_vm->_awayMission.trial.gotPointsForActivatingInterface) {
- _vm->_awayMission.trial.gotPointsForActivatingInterface = true;
- _vm->_awayMission.trial.missionScore += 3;
+ if (!_awayMission->trial.gotPointsForActivatingInterface) {
+ _awayMission->trial.gotPointsForActivatingInterface = true;
+ _awayMission->trial.missionScore += 3;
}
} else if COMBO(GREEN, GREEN, BLUE) {
trial5RestrictedCombination1();
@@ -576,13 +576,13 @@ void Room::trial5ReachedHoleToPutGem() {
trial5ActivateLightOfTravel();
showText(TX_SPEAKER_LIGHT_OF_TRAVEL, TX_TRI5_046);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
playSoundEffectIndex(SND_TRANSDEM);
loadActorAnimC(OBJECT_KIRK, "kteled", -1, -1, &Room::trial5CrewmanBeamedOut);
loadActorAnimC(OBJECT_SPOCK, "steled", -1, -1, &Room::trial5CrewmanBeamedOut);
loadActorAnimC(OBJECT_MCCOY, "mteled", -1, -1, &Room::trial5CrewmanBeamedOut);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
loadActorAnimC(OBJECT_REDSHIRT, "rteled", -1, -1, &Room::trial5CrewmanBeamedOut);
} else {
// Some holes are empty
@@ -626,9 +626,9 @@ void Room::trial5DestinationNoLongerExists() {
}
void Room::trial5CrewmanBeamedOut() {
- if (!_vm->_awayMission.trial.gotPointsForBeamingOut) {
- _vm->_awayMission.trial.gotPointsForBeamingOut = true;
- _vm->_awayMission.trial.missionScore += 1;
+ if (!_awayMission->trial.gotPointsForBeamingOut) {
+ _awayMission->trial.gotPointsForBeamingOut = true;
+ _awayMission->trial.missionScore += 1;
}
loadRoomIndex(4, 4);
}
diff --git a/engines/startrek/rooms/tug0.cpp b/engines/startrek/rooms/tug0.cpp
index 4461b22..640ecef 100644
--- a/engines/startrek/rooms/tug0.cpp
+++ b/engines/startrek/rooms/tug0.cpp
@@ -28,16 +28,16 @@ void Room::tug0Tick1() {
playVoc("TUG0LOOP");
playMidiMusicTracks(0, -1);
- _vm->_awayMission.tug.field2b = 0x23;
- if (_vm->_awayMission.tug.transporterRepaired)
+ _awayMission->tug.field2b = 0x23;
+ if (_awayMission->tug.transporterRepaired)
loadActorAnim2(11, "t0con2", 0x105, 0xc2, 0);
- if (!_vm->_awayMission.tug.engineerConscious)
+ if (!_awayMission->tug.engineerConscious)
loadActorAnim2(8, "tcdown", 0x27, 0xa8, 0);
else {
loadActorAnim2(8, "tcupd", 0x27, 0xa8, 0);
- if (_vm->_awayMission.tug.gotTransmogrifier)
+ if (_awayMission->tug.gotTransmogrifier)
loadActorAnim2(9, "pempty", 0x27, 0xa9, 0);
else {
loadActorAnim2(9, "popend", 0x27, 0xa9, 0);
@@ -47,7 +47,7 @@ void Room::tug0Tick1() {
}
void Room::tug0LookAtEngineer() {
- if (_vm->_awayMission.tug.engineerConscious)
+ if (_awayMission->tug.engineerConscious)
showText(TX_TUG0N002);
else
showText(TX_TUG0N014);
@@ -58,15 +58,15 @@ void Room::tug0GetEngineer() {
}
void Room::tug0LookAtControls() {
- if (_vm->_awayMission.tug.transporterRepaired)
+ if (_awayMission->tug.transporterRepaired)
showText(TX_TUG0N012);
else
showText(TX_TUG0N001);
}
void Room::tug0UseSpockOnControls() {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
walkCrewman(OBJECT_SPOCK, 0xdb, 0xc5, 16);
}
@@ -82,8 +82,8 @@ void Room::tug0SpockExaminedControls() {
showText(TX_SPEAKER_KIRK, TX_TUG0_013);
showText(TX_SPEAKER_SPOCK, TX_TUG0_038);
showText(TX_SPEAKER_KIRK, TX_TUG0_008);
- _vm->_awayMission.tug.spockExaminedTransporter = true;
- _vm->_awayMission.disableInput = false;
+ _awayMission->tug.spockExaminedTransporter = true;
+ _awayMission->disableInput = false;
}
void Room::tug0UseTransmogrifierWithoutBitOnControls() {
@@ -91,8 +91,8 @@ void Room::tug0UseTransmogrifierWithoutBitOnControls() {
}
void Room::tug0UseTransmogrifierWithBitOnControls() {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
walkCrewman(OBJECT_SPOCK, 0xdb, 0xc5, 6);
}
@@ -104,9 +104,9 @@ void Room::tug0SpockReachedControlsWithTransmogrifier() {
void Room::tug0SpockFinishedUsingTransmogrifier() {
loseItem(OBJECT_IRTWB);
- _vm->_awayMission.tug.usedTransmogrifierOnTransporter = true;
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.missionScore++;
+ _awayMission->tug.usedTransmogrifierOnTransporter = true;
+ _awayMission->disableInput = false;
+ _awayMission->tug.missionScore++;
}
void Room::tug0TransporterScreenFullyLit() {
@@ -114,14 +114,14 @@ void Room::tug0TransporterScreenFullyLit() {
}
void Room::tug0UseWireScrapsOnControls() {
- if (_vm->_awayMission.tug.usedTransmogrifierOnTransporter)
+ if (_awayMission->tug.usedTransmogrifierOnTransporter)
showText(TX_SPEAKER_SPOCK, TX_TUG0_034);
}
void Room::tug0UseWireOnControls() {
- if (_vm->_awayMission.tug.usedTransmogrifierOnTransporter) {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ if (_awayMission->tug.usedTransmogrifierOnTransporter) {
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
walkCrewman(OBJECT_SPOCK, 0xdb, 0xc5, 8);
}
}
@@ -131,26 +131,26 @@ void Room::tug0SpockReachedControlsWithWire() {
}
void Room::tug0SpockFinishedUsingWire() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loseItem(OBJECT_IWIRING);
- _vm->_awayMission.tug.missionScore++;
+ _awayMission->tug.missionScore++;
loadActorAnim2(11, "t0con1", 0x105, 0xc2, 22);
showText(TX_SPEAKER_SPOCK, TX_TUG0_039);
- _vm->_awayMission.tug.transporterRepaired = true;
+ _awayMission->tug.transporterRepaired = true;
showText(TX_SPEAKER_KIRK, TX_TUG0_010);
showText(TX_SPEAKER_MCCOY, TX_TUG0_022);
// BUGFIX: check if the redshirt is dead.
- if (!_vm->_awayMission.redshirtDead) {
+ if (!_awayMission->redshirtDead) {
showText(TX_SPEAKER_KIRK, TX_TUG0_002);
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L009);
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L008);
- if (_vm->_awayMission.tug.haveBomb) {
+ if (_awayMission->tug.haveBomb) {
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L010);
showText(TX_SPEAKER_MCCOY, TX_TUG0_021);
showText(TX_SPEAKER_SPOCK, TX_TUG0_041);
@@ -159,10 +159,10 @@ void Room::tug0SpockFinishedUsingWire() {
}
void Room::tug0UseMedkitOnEngineer() {
- if (_vm->_awayMission.tug.engineerConscious)
+ if (_awayMission->tug.engineerConscious)
return;
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
walkCrewman(OBJECT_MCCOY, 0x2d, 0xaf, 2);
}
@@ -172,24 +172,24 @@ void Room::tug0MccoyReachedEngineer() {
void Room::tug0MccoyHealedEngineer() {
loadActorAnim2(8, "tcup", 0x27, 0xa8, 1);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
walkCrewman(OBJECT_MCCOY, 0x41, 0xaf, 0);
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.missionScore++;
+ _awayMission->disableInput = false;
+ _awayMission->tug.missionScore++;
}
void Room::tug0EngineerGotUp() {
showText(TX_SPEAKER_SIMPSON, TX_TUG0_F31);
- _vm->_awayMission.tug.engineerConscious = true;
+ _awayMission->tug.engineerConscious = true;
loadActorAnim2(8, "tcshow", 0x27, 0xa8, 0);
loadActorAnim2(9, "popen", 0x27, 0xa9, 0);
playVoc("MUR4E6S");
}
void Room::tug0GetTransmogrifier() {
- if (_vm->_awayMission.tug.gotTransmogrifier)
+ if (_awayMission->tug.gotTransmogrifier)
return;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0x1e, 0xb1, 3);
}
@@ -198,16 +198,16 @@ void Room::tug0KirkReachedToolbox() {
}
void Room::tug0KirkGotTransmogrifier() {
- _vm->_awayMission.tug.gotTransmogrifier = true;
+ _awayMission->tug.gotTransmogrifier = true;
giveItem(OBJECT_IRT);
loadActorAnim2(9, "pempty", 0x27, 0xa9, 0);
loadActorStandAnim(OBJECT_KIRK);
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.missionScore++;
+ _awayMission->disableInput = false;
+ _awayMission->tug.missionScore++;
}
void Room::tug0LookAtToolbox() {
- if (_vm->_awayMission.tug.gotTransmogrifier)
+ if (_awayMission->tug.gotTransmogrifier)
showText(TX_TUG0N008);
else
showText(TX_TUG0N000);
@@ -220,7 +220,7 @@ void Room::tug0UsePhaserOnWelder() {
// BUGFIX: this following line didn't exist, despite it existing in TUG1; meaning this
// was supposed to give points, but it only did in a specific room.
- _vm->_awayMission.tug.missionScore += 3;
+ _awayMission->tug.missionScore += 3;
}
void Room::tug0UseWelderOnWireScraps() {
@@ -242,17 +242,17 @@ void Room::tug0UseCombBitOnTransmogrifier() {
}
void Room::tug0UseTransporter() {
- if (!_vm->_awayMission.tug.transporterRepaired)
+ if (!_awayMission->tug.transporterRepaired)
return;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
walkCrewman(OBJECT_KIRK, 0x62, 0x7f, 0);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0x11e, 0xc7, 14);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
walkCrewman(OBJECT_MCCOY, 0x7b, 0x7a, 0);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
walkCrewman(OBJECT_REDSHIRT, 0x4a, 0x7b, 0);
}
@@ -264,7 +264,7 @@ void Room::tug0SpockReachedControlsToTransport() {
void Room::tug0SpockPreparedTransporter() {
showText(TX_SPEAKER_KIRK, TX_TUG0_001);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
walkCrewman(OBJECT_SPOCK, 0x9a, 0x7e, 20);
}
@@ -277,18 +277,18 @@ void Room::tug0SpockReachedTransporter() {
}
void Room::tug0FinishedTransporting() {
- _vm->_awayMission.tug.missionScore += 3;
- _vm->_awayMission.disableInput = true;
+ _awayMission->tug.missionScore += 3;
+ _awayMission->disableInput = true;
loadRoomIndex(3, 4);
}
void Room::tug0UseBombOnTransporter() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0x62, 0x7f, 5);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
walkCrewman(OBJECT_MCCOY, 0x46, 0xbe, 0);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
walkCrewman(OBJECT_REDSHIRT, 0x78, 0xbe, 0);
}
@@ -300,9 +300,9 @@ void Room::tug0KirkPlacedBomb() {
loseItem(OBJECT_IBOMB);
loadActorAnim2(10, "bomb1", 0x5a, 0x7f, 0);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewman(OBJECT_KIRK, 0xc8, 0xbe, 11);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0x11e, 0xc7, 15);
}
@@ -319,8 +319,8 @@ void Room::tug0SpockBeginsBeamingBomb() {
void Room::tug0SpockFinishesBeamingBomb() {
playSoundEffectIndex(SND_BLANK_14);
- _vm->_awayMission.tug.missionScore = 0;
- _vm->_awayMission.timers[0] = 64;
+ _awayMission->tug.missionScore = 0;
+ _awayMission->timers[0] = 64;
}
void Room::tug0BombExploded() {
@@ -333,15 +333,15 @@ void Room::tug0BombExploded() {
showText(TX_SPEAKER_KIRK, TX_TUG0_003);
showText(TX_SPEAKER_SCOTT, TX_TUG0_S06);
- _vm->_awayMission.tug.field2d = 1;
- _vm->_awayMission.disableInput = true;
- if (_vm->_awayMission.tug.missionScore < 0)
- _vm->_awayMission.tug.missionScore = 0;
- endMission(_vm->_awayMission.tug.missionScore, _vm->_awayMission.tug.field2b, _vm->_awayMission.tug.field2d);
+ _awayMission->tug.field2d = 1;
+ _awayMission->disableInput = true;
+ if (_awayMission->tug.missionScore < 0)
+ _awayMission->tug.missionScore = 0;
+ endMission(_awayMission->tug.missionScore, _awayMission->tug.field2b, _awayMission->tug.field2d);
}
void Room::tug0UseMTricorderOnControls() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_MCCOY, TX_TUG0_016);
@@ -354,8 +354,8 @@ void Room::tug0UseSTricorderOnControls() {
}
void Room::tug0UseMTricorderOnEngineer() {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
walkCrewman(OBJECT_MCCOY, 0x2d, 0xaf, 24);
}
@@ -365,18 +365,18 @@ void Room::tug0MccoyReachedEngineerToScan() {
}
void Room::tug0MccoyFinishedScanningEngineer() {
- if (_vm->_awayMission.tug.engineerConscious)
+ if (_awayMission->tug.engineerConscious)
showText(TX_SPEAKER_MCCOY, TX_TUG0_017);
else
showText(TX_SPEAKER_MCCOY, TX_TUG0_018);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
walkCrewman(OBJECT_MCCOY, 0x41, 0xaf, 26);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::tug0UseSTricorderOnEngineer() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_SPOCK, TX_TUG0_030);
@@ -432,7 +432,7 @@ void Room::tug0TalkToRedshirt() {
}
void Room::tug0TalkToEngineer() {
- if (_vm->_awayMission.tug.engineerConscious) {
+ if (_awayMission->tug.engineerConscious) {
showText(TX_SPEAKER_SIMPSON, TX_TUG0_F30);
showText(TX_SPEAKER_MCCOY, TX_TUG0_026);
showText(TX_SPEAKER_KIRK, TX_TUG0_012);
@@ -448,14 +448,14 @@ void Room::tug0LookAnywhere() {
}
void Room::tug0UseSTricorderAnywhere() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_SPOCK, TX_TUG0_028);
}
void Room::tug0UseMTricorderAnywhere() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_MCCOY, TX_TUG0_020); // BUG: typo
diff --git a/engines/startrek/rooms/tug1.cpp b/engines/startrek/rooms/tug1.cpp
index f2b1dae..c91387c 100644
--- a/engines/startrek/rooms/tug1.cpp
+++ b/engines/startrek/rooms/tug1.cpp
@@ -36,12 +36,12 @@ namespace StarTrek {
void Room::tug1Tick1() {
playVoc("TUG1LOOP");
- if (!_vm->_awayMission.tug.gotJunkPile)
+ if (!_awayMission->tug.gotJunkPile)
loadActorAnim2(OBJECT_JUNKPILE, "jnkpil", 0xfd, 0xa0, 0);
}
void Room::tug1UseSTricorderOnAnything() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_SPOCK, TX_TUG1_014);
@@ -51,27 +51,27 @@ void Room::tug1UseSTricorderOnAnything() {
}
void Room::tug1LookAtBridgeDoor() {
- if (_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (_awayMission->tug.bridgeForceFieldDown)
return;
showText(TX_TUG1N005);
}
void Room::tug1UseSTricorderOnBridgeDoor() {
- if (_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (_awayMission->tug.bridgeForceFieldDown)
return;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_SPOCK, TX_TUG1_002);
}
void Room::tug1UsePhaserOnBridgeDoor() {
- if (_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (_awayMission->tug.bridgeForceFieldDown)
showText(TX_TUG1N007);
else {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewman(OBJECT_KIRK, 0xbe, 0x78, 3);
}
}
@@ -86,18 +86,18 @@ void Room::tug1KirkPulledOutPhaser() {
}
void Room::tug1KirkFinishedFiringPhaser() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
loadActorStandAnim(OBJECT_PHASERSHOT);
}
void Room::tug1TalkToSpock() {
- if (!_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (!_awayMission->tug.bridgeForceFieldDown)
showText(TX_SPEAKER_SPOCK, TX_TUG1_010);
}
void Room::tug1UseSTricorderOnJunkPile() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_SPOCK, TX_TUG1_009);
@@ -116,10 +116,10 @@ void Room::tug1KirkReachedJunkPile() {
}
void Room::tug1KirkFinishedTakingJunkPile() {
- _vm->_awayMission.tug.gotJunkPile = true;
+ _awayMission->tug.gotJunkPile = true;
giveItem(OBJECT_IDEADPH);
giveItem(OBJECT_IPWE);
- _vm->_awayMission.tug.missionScore++;
+ _awayMission->tug.missionScore++;
giveItem(OBJECT_IWIRSCRP);
giveItem(OBJECT_IJNKMETL);
@@ -132,7 +132,7 @@ void Room::tug1UsePhaserOnWelder() {
giveItem(OBJECT_IPWF);
showText(TX_TUG1N004);
- _vm->_awayMission.tug.missionScore += 3;
+ _awayMission->tug.missionScore += 3;
}
void Room::tug1UseWelderOnWireScraps() {
@@ -154,21 +154,21 @@ void Room::tug1UseCombBitOnTransmogrifier() {
}
void Room::tug1UsePhaserWelderOnBridgeDoor() {
- if (_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (_awayMission->tug.bridgeForceFieldDown)
showText(TX_TUG1N008);
else {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewman(OBJECT_KIRK, 0xc2, 0x6a, 6);
}
}
void Room::tug1UsePhaserWelderOnBridgeDoorInLeftSpot() {
- if (_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (_awayMission->tug.bridgeForceFieldDown)
showText(TX_TUG1N007);
else {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewman(OBJECT_KIRK, 0xb1, 0x6a, 8);
}
}
@@ -182,7 +182,7 @@ void Room::tug1KirkReachedBridgeDoorWithWelder() {
void Room::tug1KirkFinishedUsingWelder() {
loadActorStandAnim(OBJECT_PHASERSHOT);
showText(TX_SPEAKER_SPOCK, TX_TUG1_016);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::tug1KirkReachedBridgeDoorWithWelderInLeftSpot() {
@@ -194,9 +194,9 @@ void Room::tug1KirkReachedBridgeDoorWithWelderInLeftSpot() {
void Room::tug1KirkFinishedUsingWelderInLeftSpot() {
loadActorStandAnim(OBJECT_PHASERSHOT);
showText(TX_SPEAKER_SPOCK, TX_TUG1_015);
- _vm->_awayMission.tug.bridgeForceFieldDown = true;
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.missionScore++;
+ _awayMission->tug.bridgeForceFieldDown = true;
+ _awayMission->disableInput = false;
+ _awayMission->tug.missionScore++;
}
void Room::tug1LookAnywhere() {
@@ -236,7 +236,7 @@ void Room::tug1LookAtBrigDoor() {
}
void Room::tug1UseSTricorderOnBrigDoor() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_SPOCK, TX_TUG1_018);
@@ -253,14 +253,14 @@ void Room::tug1UseCommunicator() {
}
void Room::tug1WalkToBridgeDoor() {
- if (!_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (!_awayMission->tug.bridgeForceFieldDown)
return;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewman(OBJECT_KIRK, 0xc2, 0x6e, 10);
}
void Room::tug1KirkReachedBridgeDoor() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadActorAnim2(OBJECT_PHASERSHOT, "h1do", 0, 0, 11);
}
@@ -273,38 +273,38 @@ void Room::tug1WalkToBrigDoor() {
}
void Room::tug1UseMTricorderAnywhere() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_MCCOY, TX_TUG1_003);
}
void Room::tug1UseMTricorderOnBridgeDoor() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_MCCOY, TX_TUG1_007);
}
void Room::tug1UseMTricorderOnBrigDoor() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_MCCOY, TX_TUG1_005);
}
void Room::tug1UseSpockOnBridgeDoor() {
- if (!_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (!_awayMission->tug.bridgeForceFieldDown)
showText(TX_SPEAKER_SPOCK, TX_TUG1_013);
}
void Room::tug1UseRedshirtOnBridgeDoor() {
- if (!_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (!_awayMission->tug.bridgeForceFieldDown)
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG1L000);
}
void Room::tug1UseMedkitOnBridgeDoor() {
- if (!_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (!_awayMission->tug.bridgeForceFieldDown)
showText(TX_SPEAKER_MCCOY, TX_TUG1_004);
}
diff --git a/engines/startrek/rooms/tug2.cpp b/engines/startrek/rooms/tug2.cpp
index 2e8a9e6..04b2aae 100644
--- a/engines/startrek/rooms/tug2.cpp
+++ b/engines/startrek/rooms/tug2.cpp
@@ -43,76 +43,76 @@ namespace StarTrek {
void Room::tug2Tick1() {
playVoc("TUG2LOOP");
- if (!_vm->_awayMission.tug.haveBomb)
+ if (!_awayMission->tug.haveBomb)
loadActorAnim2(OBJECT_BOMB, "t2bomb", -3, 1, 0);
- if (!_vm->_awayMission.tug.gotWires)
+ if (!_awayMission->tug.gotWires)
loadActorAnim2(OBJECT_WIRE, "t2wire", 0, 1, 0);
- if (!_vm->_awayMission.tug.brigForceFieldDown)
+ if (!_awayMission->tug.brigForceFieldDown)
loadActorAnim2(OBJECT_BRIG, "fld01", 0, 0, 0);
else
loadActorAnim2(OBJECT_BRIG, "fld10d", 0, 0, 0);
- if (_vm->_awayMission.tug.field35 == 6)
+ if (_awayMission->tug.field35 == 6)
loadActorAnim2(OBJECT_BRIG, "zapdon", 0, 0, 0);
// Security guy 1
- if (_vm->_awayMission.tug.guard1Status == 8)
+ if (_awayMission->tug.guard1Status == 8)
loadActorAnim2(OBJECT_GUARD_1, "p5tied", 0xe0, 0xb1, 0);
- else if (_vm->_awayMission.tug.guard1Status == 1 && _vm->_awayMission.tug.brigForceFieldDown) {
+ else if (_awayMission->tug.guard1Status == 1 && _awayMission->tug.brigForceFieldDown) {
loadActorAnim2(OBJECT_GUARD_1, "p5tied", 0xe0, 0xb1, 0);
- _vm->_awayMission.tug.guard1Status = 8;
+ _awayMission->tug.guard1Status = 8;
}
- if (_vm->_awayMission.tug.guard1Status == 1 && !_vm->_awayMission.tug.brigForceFieldDown) {
- _vm->_awayMission.tug.guard1Status = 0;
- _vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] = false;
- _vm->_awayMission.tug.crewmanKilled[OBJECT_SPOCK] = false;
- _vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY] = false;
- if (!_vm->_awayMission.redshirtDead)
- _vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT] = false;
- _vm->_awayMission.tug.field5b = 0;
+ if (_awayMission->tug.guard1Status == 1 && !_awayMission->tug.brigForceFieldDown) {
+ _awayMission->tug.guard1Status = 0;
+ _awayMission->tug.crewmanKilled[OBJECT_KIRK] = false;
+ _awayMission->tug.crewmanKilled[OBJECT_SPOCK] = false;
+ _awayMission->tug.crewmanKilled[OBJECT_MCCOY] = false;
+ if (!_awayMission->redshirtDead)
+ _awayMission->tug.crewmanKilled[OBJECT_REDSHIRT] = false;
+ _awayMission->tug.field5b = 0;
}
- if (_vm->_awayMission.tug.guard1Status == 0)
+ if (_awayMission->tug.guard1Status == 0)
loadActorAnim2(OBJECT_GUARD_1, "p5redy", 0xe0, 0xb1, 0);
- if (_vm->_awayMission.tug.guard1Status == 2)
+ if (_awayMission->tug.guard1Status == 2)
loadActorAnim2(OBJECT_GUARD_1, "p5hat", 0xe0, 0xb1, 0);
// Security guy 2
- if (_vm->_awayMission.tug.guard2Status == 8)
+ if (_awayMission->tug.guard2Status == 8)
loadActorAnim2(OBJECT_GUARD_2, "p6tied", 0xfb, 0xc5, 0);
- else if (_vm->_awayMission.tug.guard2Status == 1 && _vm->_awayMission.tug.brigForceFieldDown) {
+ else if (_awayMission->tug.guard2Status == 1 && _awayMission->tug.brigForceFieldDown) {
loadActorAnim2(OBJECT_GUARD_2, "p6tied", 0xfb, 0xc5, 0);
- _vm->_awayMission.tug.guard2Status = 8;
+ _awayMission->tug.guard2Status = 8;
}
- if (_vm->_awayMission.tug.guard2Status == 1 && !_vm->_awayMission.tug.brigForceFieldDown) {
- _vm->_awayMission.tug.guard2Status = 0;
- _vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] = false;
- _vm->_awayMission.tug.crewmanKilled[OBJECT_SPOCK] = false;
- _vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY] = false;
- if (!_vm->_awayMission.redshirtDead)
- _vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT] = false;
- _vm->_awayMission.tug.field5b = 0;
+ if (_awayMission->tug.guard2Status == 1 && !_awayMission->tug.brigForceFieldDown) {
+ _awayMission->tug.guard2Status = 0;
+ _awayMission->tug.crewmanKilled[OBJECT_KIRK] = false;
+ _awayMission->tug.crewmanKilled[OBJECT_SPOCK] = false;
+ _awayMission->tug.crewmanKilled[OBJECT_MCCOY] = false;
+ if (!_awayMission->redshirtDead)
+ _awayMission->tug.crewmanKilled[OBJECT_REDSHIRT] = false;
+ _awayMission->tug.field5b = 0;
}
- if (_vm->_awayMission.tug.guard2Status == 0)
+ if (_awayMission->tug.guard2Status == 0)
loadActorAnim2(OBJECT_GUARD_2, "p6draw", 0xfb, 0xc5, 0);
- if (_vm->_awayMission.tug.guard2Status == 2)
+ if (_awayMission->tug.guard2Status == 2)
loadActorAnim2(OBJECT_GUARD_2, "p5hat", 0xfb, 0xc5, 0); // FIXME
- if (_vm->_awayMission.tug.field4e == 0)
+ if (_awayMission->tug.field4e == 0)
loadActorAnim2(OBJECT_13, "wallht", 0, 0, 0);
- if (_vm->_awayMission.tug.field5b == 0) {
- _vm->_awayMission.disableWalking = true;
+ if (_awayMission->tug.field5b == 0) {
+ _awayMission->disableWalking = true;
playMidiMusicTracks(32, -1);
}
- _vm->_awayMission.tug.field5b = 1;
- _vm->_awayMission.tug.kirkPhaserDrawn = 0;
+ _awayMission->tug.field5b = 1;
+ _awayMission->tug.kirkPhaserDrawn = 0;
}
void Room::tug2Tick60() {
- if (!_vm->_awayMission.tug.guard1Status || !_vm->_awayMission.tug.guard2Status) {
- _vm->_awayMission.timers[0] = 60;
+ if (!_awayMission->tug.guard1Status || !_awayMission->tug.guard2Status) {
+ _awayMission->timers[0] = 60;
showText(TX_SPEAKER_ELASI_GUARD, TX_TUG2L085);
tug2ElasiReadyPhaser();
}
@@ -135,9 +135,9 @@ void Room::tug2LookAtRedshirt() {
}
void Room::tug2GetBomb() {
- if (_vm->_awayMission.tug.brigForceFieldDown) {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ if (_awayMission->tug.brigForceFieldDown) {
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewman(OBJECT_KIRK, 0xc9, 0xa0, 12);
} else
showText(TX_TUG2N024);
@@ -150,8 +150,8 @@ void Room::tug2KirkReachedBomb() {
void Room::tug2KirkGotBomb() {
loadActorStandAnim(OBJECT_BOMB);
giveItem(OBJECT_IBOMB);
- _vm->_awayMission.tug.haveBomb = true;
- _vm->_awayMission.disableInput = false;
+ _awayMission->tug.haveBomb = true;
+ _awayMission->disableInput = false;
}
void Room::tug2LookAtBomb() {
@@ -159,24 +159,24 @@ void Room::tug2LookAtBomb() {
}
void Room::tug2LookAtGuard1() {
- if (_vm->_awayMission.tug.guard1Status == 0)
+ if (_awayMission->tug.guard1Status == 0)
showText(TX_TUG2N001);
- else if (_vm->_awayMission.tug.guard1Status == 1)
+ else if (_awayMission->tug.guard1Status == 1)
showText(TX_TUG2N013);
- else if (_vm->_awayMission.tug.guard1Status == 8)
+ else if (_awayMission->tug.guard1Status == 8)
showText(TX_TUG2N015);
- else if (_vm->_awayMission.tug.guard1Status == 2)
+ else if (_awayMission->tug.guard1Status == 2)
showText(TX_TUG2N106);
}
void Room::tug2LookAtGuard2() {
- if (_vm->_awayMission.tug.guard2Status == 0)
+ if (_awayMission->tug.guard2Status == 0)
showText(TX_TUG2N037);
- else if (_vm->_awayMission.tug.guard2Status == 1)
+ else if (_awayMission->tug.guard2Status == 1)
showText(TX_TUG2N014);
- else if (_vm->_awayMission.tug.guard2Status == 8)
+ else if (_awayMission->tug.guard2Status == 8)
showText(TX_TUG2N016);
- else if (_vm->_awayMission.tug.guard2Status == 2)
+ else if (_awayMission->tug.guard2Status == 2)
showText(TX_TUG2N106);
}
@@ -185,13 +185,13 @@ void Room::tug2LookAtWires() {
}
void Room::tug2UseSTricorderOnButton() {
- if (_vm->_awayMission.tug.field35 != 0)
+ if (_awayMission->tug.field35 != 0)
return;
spockScan(DIR_E, TX_TUG2_007, true);
}
void Room::tug2UseMccoyOnWires() {
- if (_vm->_awayMission.tug.field35 != 0)
+ if (_awayMission->tug.field35 != 0)
return;
showText(TX_SPEAKER_MCCOY, TX_TUG2_009);
}
@@ -201,11 +201,11 @@ void Room::tug2UseMccoyOnBomb() {
}
void Room::tug2UseRedshirtOnWires() {
- if (_vm->_awayMission.disableWalking || _vm->_awayMission.tug.field35 != 0)
+ if (_awayMission->disableWalking || _awayMission->tug.field35 != 0)
return;
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG2L007);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
- _vm->_awayMission.disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_REDSHIRT, 0xc9, 0xa0, 6);
}
@@ -216,21 +216,21 @@ void Room::tug2RedshirtReachedWires() {
void Room::tug2RedshirtDefusedBomb() {
showText(TX_TUG2C001);
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG2L011);
- _vm->_awayMission.tug.field35 = 4;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
+ _awayMission->tug.field35 = 4;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
walkCrewman(OBJECT_REDSHIRT, 0x44, 0xc2, 8);
}
void Room::tug2RedshirtReturnedToPosition() {
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.missionScore += 2;
+ _awayMission->disableInput = false;
+ _awayMission->tug.missionScore += 2;
}
void Room::tug2UseKirkOnWires() {
- if (_vm->_awayMission.disableWalking || _vm->_awayMission.tug.field35 != 0)
+ if (_awayMission->disableWalking || _awayMission->tug.field35 != 0)
return;
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 0xc9, 0xa0, 5);
}
@@ -238,17 +238,17 @@ void Room::tug2KirkReachedWires() {
showText(TX_SPEAKER_KIRK, TX_TUG2_003);
showText(TX_SPEAKER_SPOCK, TX_TUG2_023);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 0x66, 0xb8, 0);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
tug2UseSpockOnWires();
}
void Room::tug2UseSpockOnWires() {
- if (_vm->_awayMission.disableWalking || _vm->_awayMission.tug.field35 != 0)
+ if (_awayMission->disableWalking || _awayMission->tug.field35 != 0)
return;
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
walkCrewman(OBJECT_SPOCK, 0xc9, 0xa0, 9);
}
@@ -256,25 +256,25 @@ void Room::tug2SpockReachedWires() {
loadActorAnim2(OBJECT_SPOCK, "suseme", -1, -1, 0);
playVoc("WIRESNIP");
showText(TX_SPEAKER_SPOCK, TX_TUG2_024);
- _vm->_awayMission.tug.field35 = 4;
+ _awayMission->tug.field35 = 4;
- if (_vm->_awayMission.tug.spockExaminedTransporter)
+ if (_awayMission->tug.spockExaminedTransporter)
showText(TX_SPEAKER_SPOCK, TX_TUG2_008);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
walkCrewman(OBJECT_SPOCK, 0x56, 0xa9, 11);
}
void Room::tug2SpockReturnedToPosition() {
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.missionScore += 2;
+ _awayMission->disableInput = false;
+ _awayMission->tug.missionScore += 2;
}
void Room::tug2GetWires() {
- if (_vm->_awayMission.disableWalking)
+ if (_awayMission->disableWalking)
return;
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 0xc9, 0xa0, 28);
}
@@ -283,33 +283,33 @@ void Room::tug2KirkReachedWiresToGet() {
}
void Room::tug2KirkGotWires() {
- if (_vm->_awayMission.tug.field35 == 0) {
+ if (_awayMission->tug.field35 == 0) {
playMidiMusicTracks(2, -1);
loadActorAnim2(OBJECT_BRIG, "zap", 0, 0, 1);
playVoc("NM8EXPLO");
loadActorAnim2(OBJECT_BOMB, "t2bbo", -3, 1, 0);
playSoundEffectIndex(SND_PHASSHOT);
playSoundEffectIndex(SND_BLANK_16);
- _vm->_awayMission.tug.field35 = 6;
+ _awayMission->tug.field35 = 6;
loadActorStandAnim(OBJECT_WIRE);
giveItem(OBJECT_IWIRING);
- _vm->_awayMission.tug.gotWires = true;
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.missionScore += 3;
+ _awayMission->tug.gotWires = true;
+ _awayMission->disableInput = false;
+ _awayMission->tug.missionScore += 3;
} else {
loadActorStandAnim(OBJECT_WIRE);
giveItem(OBJECT_IWIRING);
- _vm->_awayMission.tug.gotWires = true;
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.missionScore += 3;
+ _awayMission->tug.gotWires = true;
+ _awayMission->disableInput = false;
+ _awayMission->tug.missionScore += 3;
}
}
void Room::tug2UseKirkOnButton() {
- if (_vm->_awayMission.disableWalking)
+ if (_awayMission->disableWalking)
return;
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 0xc9, 0xa0, 14);
}
@@ -319,10 +319,10 @@ void Room::tug2KirkReachedButton() {
}
void Room::tug2UseSpockOnButton() {
- if (_vm->_awayMission.disableWalking)
+ if (_awayMission->disableWalking)
return;
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
walkCrewman(OBJECT_SPOCK, 0xc9, 0xa0, 16);
}
@@ -332,10 +332,10 @@ void Room::tug2SpockReachedButton() {
}
void Room::tug2UseMccoyOnButton() {
- if (_vm->_awayMission.disableWalking)
+ if (_awayMission->disableWalking)
return;
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
walkCrewman(OBJECT_MCCOY, 0xc9, 0xa0, 18);
}
@@ -345,10 +345,10 @@ void Room::tug2MccoyReachedButton() {
}
void Room::tug2UseRedshirtOnButton() {
- if (_vm->_awayMission.disableWalking)
+ if (_awayMission->disableWalking)
return;
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
walkCrewman(OBJECT_REDSHIRT, 0xc9, 0xa0, 20);
}
@@ -358,18 +358,18 @@ void Room::tug2RedshirtReachedButton() {
}
void Room::tug2TurnedOffForceField() {
- _vm->_awayMission.disableInput = false;
- if (_vm->_awayMission.tug.field35 == 0) {
+ _awayMission->disableInput = false;
+ if (_awayMission->tug.field35 == 0) {
playMidiMusicTracks(2, -1);
loadActorAnim2(OBJECT_BRIG, "zap", 0, 0, 1);
playVoc("NM8EXPLO");
loadActorAnim2(OBJECT_BOMB, "t2bbo", -3, 1, 0);
// FIXME: doesn't play "PHASSHOT" sound effect like when kirk removes wires?
- _vm->_awayMission.tug.field35 = 6;
- } else if (_vm->_awayMission.tug.field35 == 4 && !_vm->_awayMission.tug.brigForceFieldDown) {
- _vm->_awayMission.tug.brigForceFieldDown = true;
+ _awayMission->tug.field35 = 6;
+ } else if (_awayMission->tug.field35 == 4 && !_awayMission->tug.brigForceFieldDown) {
+ _awayMission->tug.brigForceFieldDown = true;
loadActorAnim2(OBJECT_BRIG, "fld10", 0, 0, 2);
- _vm->_awayMission.tug.missionScore += 6;
+ _awayMission->tug.missionScore += 6;
playVoc("EFX15");
}
}
@@ -384,13 +384,13 @@ void Room::tug2PrisonersReleased() {
showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_029);
showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_030);
showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_028);
- _vm->_awayMission.tug.savedPrisoners = true;
+ _awayMission->tug.savedPrisoners = true;
}
void Room::tug2UsePhaserOnBrig() {
- if (_vm->_awayMission.tug.field35 == 0)
+ if (_awayMission->tug.field35 == 0)
showText(TX_SPEAKER_SPOCK, TX_TUG2_006);
- else if (_vm->_awayMission.tug.brigForceFieldDown) {
+ else if (_awayMission->tug.brigForceFieldDown) {
// BUGFIX: this function had two implementations; one for firing on the brig, and
// one for firing on the masada crewman (who replaces the brig object). The first
// took priority, meaning the latter code never ran. That's fixed here.
@@ -399,128 +399,128 @@ void Room::tug2UsePhaserOnBrig() {
}
void Room::tug2ElasiReadyPhaser() {
- if (_vm->_awayMission.tug.guard1Status == 0 && _vm->_awayMission.tug.field59 == 0) {
+ if (_awayMission->tug.guard1Status == 0 && _awayMission->tug.field59 == 0) {
loadActorAnim2(OBJECT_GUARD_1, "p5draw", -1, -1, 0);
- _vm->_awayMission.tug.field59++;
+ _awayMission->tug.field59++;
}
}
void Room::tug2CheckEndFirefight() {
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_UP || _vm->_awayMission.tug.guard2Status == GUARDSTAT_UP)
+ if (_awayMission->tug.guard1Status == GUARDSTAT_UP || _awayMission->tug.guard2Status == GUARDSTAT_UP)
return;
- _vm->_awayMission.disableWalking = false;
- if (_vm->_awayMission.tug.kirkPhaserDrawn)
+ _awayMission->disableWalking = false;
+ if (_awayMission->tug.kirkPhaserDrawn)
loadActorStandAnim(OBJECT_KIRK);
}
void Room::tug2UseStunPhaserOnGuard1() {
- if (_vm->_awayMission.tug.guard1Status != GUARDSTAT_UP)
+ if (_awayMission->tug.guard1Status != GUARDSTAT_UP)
tug2KirkShootGuard1();
else {
tug2ElasiReadyPhaser();
- _vm->_awayMission.disableInput = true;
- if (_vm->_awayMission.tug.kirkPhaserDrawn)
+ _awayMission->disableInput = true;
+ if (_awayMission->tug.kirkPhaserDrawn)
tug2KirkShootGuard1();
else {
loadActorAnim2(OBJECT_KIRK, "kdrawe", -1, -1, 22);
- _vm->_awayMission.tug.kirkPhaserDrawn = true;
+ _awayMission->tug.kirkPhaserDrawn = true;
}
}
}
void Room::tug2KirkShootGuard1() {
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_UP) {
+ if (_awayMission->tug.guard1Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_GUARD_1, "p5stun", -1, -1, 0);
- _vm->_awayMission.tug.guard1Status = GUARDSTAT_STUNNED;
+ _awayMission->tug.guard1Status = GUARDSTAT_STUNNED;
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t2beem03", 5);
tug2CheckEndFirefight();
}
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::tug2UseStunPhaserOnGuard2() {
- if (_vm->_awayMission.tug.guard2Status != GUARDSTAT_UP)
+ if (_awayMission->tug.guard2Status != GUARDSTAT_UP)
tug2KirkShootGuard2();
else {
tug2ElasiReadyPhaser();
- _vm->_awayMission.disableInput = true;
- if (_vm->_awayMission.tug.kirkPhaserDrawn)
+ _awayMission->disableInput = true;
+ if (_awayMission->tug.kirkPhaserDrawn)
tug2KirkShootGuard2();
else {
loadActorAnim2(OBJECT_KIRK, "kdrawe", -1, -1, 23);
- _vm->_awayMission.tug.kirkPhaserDrawn = true;
+ _awayMission->tug.kirkPhaserDrawn = true;
}
}
}
void Room::tug2KirkShootGuard2() {
- if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_UP) {
+ if (_awayMission->tug.guard2Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_GUARD_2, "p6stun", -1, -1, 0);
- _vm->_awayMission.tug.guard2Status = GUARDSTAT_STUNNED;
+ _awayMission->tug.guard2Status = GUARDSTAT_STUNNED;
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t2beem02", 5);
tug2CheckEndFirefight();
}
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::tug2UseKillPhaserOnGuard1() {
- if (_vm->_awayMission.tug.guard1Status != GUARDSTAT_UP)
+ if (_awayMission->tug.guard1Status != GUARDSTAT_UP)
tug2KirkKillGuard1();
else {
tug2ElasiReadyPhaser();
- _vm->_awayMission.disableInput = true;
- if (_vm->_awayMission.tug.kirkPhaserDrawn)
+ _awayMission->disableInput = true;
+ if (_awayMission->tug.kirkPhaserDrawn)
tug2KirkKillGuard1();
else {
loadActorAnim2(OBJECT_KIRK, "kdrawe", -1, -1, 24);
- _vm->_awayMission.tug.kirkPhaserDrawn = true;
- _vm->_awayMission.tug.brigElasiPhasersOnKill = true;
+ _awayMission->tug.kirkPhaserDrawn = true;
+ _awayMission->tug.brigElasiPhasersOnKill = true;
}
}
}
void Room::tug2KirkKillGuard1() {
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_UP) {
+ if (_awayMission->tug.guard1Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_GUARD_1, "p5kill", -1, -1, 0);
- _vm->_awayMission.tug.guard1Status = GUARDSTAT_DEAD;
+ _awayMission->tug.guard1Status = GUARDSTAT_DEAD;
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t2beem05", 5);
tug2CheckEndFirefight();
}
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::tug2UseKillPhaserOnGuard2() {
- if (_vm->_awayMission.tug.guard2Status != GUARDSTAT_UP)
+ if (_awayMission->tug.guard2Status != GUARDSTAT_UP)
tug2KirkKillGuard2();
else {
tug2ElasiReadyPhaser();
- _vm->_awayMission.disableInput = true;
- if (_vm->_awayMission.tug.kirkPhaserDrawn)
+ _awayMission->disableInput = true;
+ if (_awayMission->tug.kirkPhaserDrawn)
tug2KirkKillGuard2();
else {
loadActorAnim2(OBJECT_KIRK, "kdrawe", -1, -1, 25);
- _vm->_awayMission.tug.kirkPhaserDrawn = true;
- _vm->_awayMission.tug.brigElasiPhasersOnKill = true;
+ _awayMission->tug.kirkPhaserDrawn = true;
+ _awayMission->tug.brigElasiPhasersOnKill = true;
}
}
}
void Room::tug2KirkKillGuard2() {
- if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_UP) {
+ if (_awayMission->tug.guard2Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_GUARD_2, "p6kill", -1, -1, 0);
- _vm->_awayMission.tug.guard2Status = GUARDSTAT_DEAD;
+ _awayMission->tug.guard2Status = GUARDSTAT_DEAD;
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t2beem04", 5);
tug2CheckEndFirefight();
}
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::tug2UsePhaserOnWelder() {
@@ -530,7 +530,7 @@ void Room::tug2UsePhaserOnWelder() {
// BUGFIX: this following line didn't exist, despite it existing in TUG1; meaning this
// was supposed to give points, but it only did in a specific room.
- _vm->_awayMission.tug.missionScore += 3;
+ _awayMission->tug.missionScore += 3;
}
void Room::tug2UseWelderOnWireScraps() {
@@ -571,14 +571,14 @@ void Room::tug2LookAtKirk() {
}
void Room::tug2TalkToKirk() {
- if (_vm->_awayMission.tug.field35 == 6)
+ if (_awayMission->tug.field35 == 6)
showText(TX_SPEAKER_KIRK, TX_TUG2_001);
else
showText(TX_SPEAKER_KIRK, TX_TUG2_002);
}
void Room::tug2TalkToMccoy() {
- if (_vm->_awayMission.tug.field35 == 6)
+ if (_awayMission->tug.field35 == 6)
showText(TX_SPEAKER_MCCOY, TX_TUG2_018);
else
showText(TX_SPEAKER_MCCOY, TX_TUG2_010);
@@ -588,7 +588,7 @@ void Room::tug2TalkToRedshirt() {
// BUGFIX: the original game has two implementations of this function; the first takes
// precedence, however, it's just generic, unhelpful text. The second implementation
// is more interesting, so that one is used instead.
- if (_vm->_awayMission.tug.field35 == 6)
+ if (_awayMission->tug.field35 == 6)
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG2L004);
else
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG2J003);
@@ -598,7 +598,7 @@ void Room::tug2TalkToRedshirt() {
}
void Room::tug2TalkToSpock() {
- if (_vm->_awayMission.tug.field35 == 6)
+ if (_awayMission->tug.field35 == 6)
showText(TX_SPEAKER_SPOCK, TX_TUG2_005);
else
showText(TX_SPEAKER_SPOCK, TX_TUG2_020);
@@ -609,27 +609,27 @@ void Room::tug2UseCommunicator() {
}
void Room::tug2DetermineElasiShooter() {
- if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_UP)
+ if (_awayMission->tug.guard2Status == GUARDSTAT_UP)
_roomVar.tug.shootingObject = OBJECT_GUARD_2;
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_UP)
+ if (_awayMission->tug.guard1Status == GUARDSTAT_UP)
_roomVar.tug.shootingObject = OBJECT_GUARD_1;
}
// Elasi shoots someone
void Room::tug2Timer0Expired() {
- if (_vm->_awayMission.tug.guard1Status != GUARDSTAT_UP && _vm->_awayMission.tug.guard2Status != GUARDSTAT_UP)
+ if (_awayMission->tug.guard1Status != GUARDSTAT_UP && _awayMission->tug.guard2Status != GUARDSTAT_UP)
return;
_roomVar.tug.elasiPhaserOnKill = 0;
- if (_vm->_awayMission.tug.brigElasiPhasersOnKill)
+ if (_awayMission->tug.brigElasiPhasersOnKill)
_roomVar.tug.elasiPhaserOnKill = 1;
- switch (_vm->_awayMission.tug.elasiTargetIndex) {
+ switch (_awayMission->tug.elasiTargetIndex) {
case 0:
- _vm->_awayMission.tug.elasiTargetIndex++;
- if (_vm->_awayMission.tug.guard2Status != GUARDSTAT_UP) {
+ _awayMission->tug.elasiTargetIndex++;
+ if (_awayMission->tug.guard2Status != GUARDSTAT_UP) {
// BUGFIX: reset the timer to allow guard 1 to continue if guard 2 is down
- _vm->_awayMission.timers[0] = 60;
+ _awayMission->timers[0] = 60;
return;
}
@@ -638,59 +638,59 @@ void Room::tug2Timer0Expired() {
showBitmapFor5Ticks("t2beem00", 5);
playSoundEffectIndex(SND_PHASSHOT);
loadActorAnim2(OBJECT_GUARD_2, "p6fire", -1, -1, 0);
- _vm->_awayMission.tug.field4e = _roomVar.tug.elasiPhaserOnKill;
- _vm->_awayMission.timers[0] = 60;
+ _awayMission->tug.field4e = _roomVar.tug.elasiPhaserOnKill;
+ _awayMission->timers[0] = 60;
break;
case 1:
// Guard shoots redshirt
- _vm->_awayMission.tug.elasiTargetIndex++;
- if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT]) {
+ _awayMission->tug.elasiTargetIndex++;
+ if (!_awayMission->tug.crewmanKilled[OBJECT_REDSHIRT]) {
tug2DetermineElasiShooter();
_roomVar.tug.shootingTarget = OBJECT_REDSHIRT;
- _vm->_awayMission.timers[0] = 60;
+ _awayMission->timers[0] = 60;
tug2GuardShootsCrewman();
}
break;
case 2:
// Guard shoots spock (or kirk)
- _vm->_awayMission.tug.elasiTargetIndex++;
+ _awayMission->tug.elasiTargetIndex++;
_roomVar.tug.shootKirkOverride = false;
- if (_vm->_awayMission.tug.brigElasiPhasersOnKill)
+ if (_awayMission->tug.brigElasiPhasersOnKill)
_roomVar.tug.shootKirkOverride = true;
tug2DetermineElasiShooter();
if (_roomVar.tug.shootKirkOverride)
_roomVar.tug.shootingTarget = OBJECT_KIRK;
else
_roomVar.tug.shootingTarget = OBJECT_SPOCK;
- _vm->_awayMission.timers[0] = 60;
+ _awayMission->timers[0] = 60;
tug2GuardShootsCrewman();
break;
case 3:
// Guard shoots Mccoy
- _vm->_awayMission.tug.elasiTargetIndex++;
- if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY]) {
+ _awayMission->tug.elasiTargetIndex++;
+ if (!_awayMission->tug.crewmanKilled[OBJECT_MCCOY]) {
tug2DetermineElasiShooter();
_roomVar.tug.shootingTarget = OBJECT_MCCOY;
- _vm->_awayMission.timers[0] = 80;
+ _awayMission->timers[0] = 80;
tug2GuardShootsCrewman();
}
break;
case 4:
// Guard shoots kirk (or Spock)
- _vm->_awayMission.tug.elasiTargetIndex++;
+ _awayMission->tug.elasiTargetIndex++;
if (_roomVar.tug.shootKirkOverride) {
tug2DetermineElasiShooter();
_roomVar.tug.shootingTarget = OBJECT_SPOCK;
- _vm->_awayMission.timers[2] = 40;
+ _awayMission->timers[2] = 40;
tug2GuardShootsCrewman();
} else {
tug2DetermineElasiShooter();
_roomVar.tug.shootingTarget = OBJECT_KIRK;
- _vm->_awayMission.timers[2] = 40;
+ _awayMission->timers[2] = 40;
tug2GuardShootsCrewman();
}
break;
@@ -726,7 +726,7 @@ void Room::tug2GuardShootsCrewman() {
const char *crewPrefixes = "ksmr";
if (!_roomVar.tug.elasiPhaserOnKill)
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.tug.shootingTarget] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[_roomVar.tug.shootingTarget] = DIR_W;
Common::String anim;
const char **bitmapArray;
@@ -760,17 +760,17 @@ void Room::tug2GuardShootsCrewman() {
else
loadActorAnim2(OBJECT_GUARD_2, "p6fire", -1, -1, 0);
- _vm->_awayMission.tug.crewmanKilled[_roomVar.tug.shootingTarget] = _roomVar.tug.elasiPhaserOnKill;
+ _awayMission->tug.crewmanKilled[_roomVar.tug.shootingTarget] = _roomVar.tug.elasiPhaserOnKill;
if (!_roomVar.tug.elasiPhaserOnKill) {
// BUG: crew goes down for 120 frames, but they start to get up before the fight
// is over. Perhaps this number should be increased.
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.tug.shootingTarget] = DIR_W;
- _vm->_awayMission.crewGetupTimers[_roomVar.tug.shootingTarget] = 120;
- _vm->_awayMission.crewDownBitset |= (1 << _roomVar.tug.shootingTarget);
+ _awayMission->crewDirectionsAfterWalk[_roomVar.tug.shootingTarget] = DIR_W;
+ _awayMission->crewGetupTimers[_roomVar.tug.shootingTarget] = 120;
+ _awayMission->crewDownBitset |= (1 << _roomVar.tug.shootingTarget);
}
if (_roomVar.tug.elasiPhaserOnKill && _roomVar.tug.shootingTarget == OBJECT_REDSHIRT)
- _vm->_awayMission.redshirtDead = true;
+ _awayMission->redshirtDead = true;
}
void Room::tug2Timer2Expired() {
@@ -784,27 +784,27 @@ void Room::tug2UseSTricorderOnBomb() {
}
void Room::tug2UseMTricorderOnGuard1() {
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED)
+ if (_awayMission->tug.guard1Status == GUARDSTAT_STUNNED)
mccoyScan(DIR_E, TX_TUG2_016, true);
}
void Room::tug2UseMTricorderOnGuard2() {
// BUGFIX: original didn't play audio for this (despite being the same as above).
- if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED)
+ if (_awayMission->tug.guard2Status == GUARDSTAT_STUNNED)
mccoyScan(DIR_E, TX_TUG2_016, true);
}
void Room::tug2TalkToGuard1() {
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_TIED)
+ if (_awayMission->tug.guard1Status == GUARDSTAT_TIED)
showText(TX_SPEAKER_ELASI_GUARD, TX_TUG2L086);
- else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED)
+ else if (_awayMission->tug.guard1Status == GUARDSTAT_STUNNED)
showText(TX_SPEAKER_MCCOY, TX_TUG2_012);
}
void Room::tug2TalkToGuard2() {
- if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_TIED)
+ if (_awayMission->tug.guard2Status == GUARDSTAT_TIED)
showText(TX_SPEAKER_ELASI_GUARD, TX_TUG2L086);
- else if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED)
+ else if (_awayMission->tug.guard2Status == GUARDSTAT_STUNNED)
showText(TX_SPEAKER_MCCOY, TX_TUG2_013);
}
@@ -813,27 +813,27 @@ void Room::tug2UseMedkitOnBomb() {
}
void Room::tug2UseMedkitOnGuard1() {
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED)
+ if (_awayMission->tug.guard1Status == GUARDSTAT_STUNNED)
showText(TX_SPEAKER_MCCOY, TX_TUG2_014);
}
void Room::tug2UseMedkitOnGuard2() {
- if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED)
+ if (_awayMission->tug.guard2Status == GUARDSTAT_STUNNED)
showText(TX_SPEAKER_MCCOY, TX_TUG2_014);
}
void Room::tug2LookAnywhere() {
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_DEAD && _vm->_awayMission.tug.guard2Status == GUARDSTAT_DEAD && _vm->_awayMission.tug.field35 == 6)
+ if (_awayMission->tug.guard1Status == GUARDSTAT_DEAD && _awayMission->tug.guard2Status == GUARDSTAT_DEAD && _awayMission->tug.field35 == 6)
showText(TX_TUG2N019);
- else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_DEAD && _vm->_awayMission.tug.guard2Status == GUARDSTAT_DEAD && !_vm->_awayMission.tug.brigForceFieldDown)
+ else if (_awayMission->tug.guard1Status == GUARDSTAT_DEAD && _awayMission->tug.guard2Status == GUARDSTAT_DEAD && !_awayMission->tug.brigForceFieldDown)
showText(TX_TUG2N017);
- else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED && _vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED && _vm->_awayMission.tug.field35 == 6)
+ else if (_awayMission->tug.guard1Status == GUARDSTAT_STUNNED && _awayMission->tug.guard2Status == GUARDSTAT_STUNNED && _awayMission->tug.field35 == 6)
showText(TX_TUG2N020);
- else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED && _vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED && !_vm->_awayMission.tug.brigForceFieldDown)
+ else if (_awayMission->tug.guard1Status == GUARDSTAT_STUNNED && _awayMission->tug.guard2Status == GUARDSTAT_STUNNED && !_awayMission->tug.brigForceFieldDown)
showText(TX_TUG2N018);
- else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED && _vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED && _vm->_awayMission.tug.brigForceFieldDown)
+ else if (_awayMission->tug.guard1Status == GUARDSTAT_STUNNED && _awayMission->tug.guard2Status == GUARDSTAT_STUNNED && _awayMission->tug.brigForceFieldDown)
showText(TX_TUG2N021);
- else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_DEAD && _vm->_awayMission.tug.guard2Status == GUARDSTAT_DEAD && _vm->_awayMission.tug.brigForceFieldDown)
+ else if (_awayMission->tug.guard1Status == GUARDSTAT_DEAD && _awayMission->tug.guard2Status == GUARDSTAT_DEAD && _awayMission->tug.brigForceFieldDown)
showText(TX_TUG2N022);
else
showText(TX_TUG2N023);
@@ -843,27 +843,27 @@ void Room::tug2TalkToBrig() {
// The "brig" can also be a masada crewman, when the force field is down, so there are
// at least two cases here.
- if (_vm->_awayMission.tug.brigForceFieldDown && !_vm->_awayMission.tug.talkedToBrigCrewman) {
+ if (_awayMission->tug.brigForceFieldDown && !_awayMission->tug.talkedToBrigCrewman) {
loadActorAnim2(OBJECT_BRIG, "fld10d", 0, 0, 0);
showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_026);
- _vm->_awayMission.tug.talkedToBrigCrewman = true;
+ _awayMission->tug.talkedToBrigCrewman = true;
}
- if (_vm->_awayMission.tug.brigForceFieldDown && _vm->_awayMission.tug.talkedToBrigCrewman)
+ if (_awayMission->tug.brigForceFieldDown && _awayMission->tug.talkedToBrigCrewman)
showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_027);
- else if (!_vm->_awayMission.tug.brigForceFieldDown)
+ else if (!_awayMission->tug.brigForceFieldDown)
mccoyScan(DIR_E, TX_TUG2_015, true);
}
void Room::tug2UseMTricorderOnBrig() {
- if (_vm->_awayMission.tug.field35 == 6)
+ if (_awayMission->tug.field35 == 6)
mccoyScan(DIR_E, TX_TUG2_019, true);
- else if (!_vm->_awayMission.tug.brigForceFieldDown)
+ else if (!_awayMission->tug.brigForceFieldDown)
mccoyScan(DIR_E, TX_TUG2_015, true);
}
void Room::tug2UseMTricorderOnOpenBrig() {
- if (_vm->_awayMission.tug.brigForceFieldDown)
+ if (_awayMission->tug.brigForceFieldDown)
mccoyScan(DIR_E, TX_TUG2_015, true);
}
diff --git a/engines/startrek/rooms/tug3.cpp b/engines/startrek/rooms/tug3.cpp
index c0a0b97..0d7537c 100644
--- a/engines/startrek/rooms/tug3.cpp
+++ b/engines/startrek/rooms/tug3.cpp
@@ -42,7 +42,7 @@ namespace StarTrek {
void Room::tug3Tick1() {
playVoc("TUG3LOOP");
- _vm->_awayMission.disableWalking = true;
+ _awayMission->disableWalking = true;
loadActorAnim2(OBJECT_ELASI_1, "p1turn", 0xa4, 0x98, 0);
loadActorAnim2(OBJECT_ELASI_2, "p2turn", 0xd1, 0x88, 0);
loadActorAnim2(OBJECT_ELASI_3, "p3turn", 0xfb, 0xc4, 0);
@@ -63,31 +63,31 @@ void Room::tug3ElasiSurrendered() {
// they could shoot Kirk as he's beaming out and the mission is "successful". To
// prevent that, the below condition is removed in ScummVM.
/*
- if (_vm->_awayMission.tug.bridgeElasiDrewPhasers)
+ if (_awayMission->tug.bridgeElasiDrewPhasers)
return;
*/
// Also part of the bugfix (stop shooting)
- _vm->_awayMission.timers[0] = 0;
+ _awayMission->timers[0] = 0;
- _vm->_awayMission.tug.elasiSurrendered = true;
+ _awayMission->tug.elasiSurrendered = true;
loadActorAnim2(OBJECT_ELASI_1, "p1surr", -1, -1, 0);
- _vm->_awayMission.tug.bridgeElasi1Status = GUARDSTAT_SURRENDERED;
+ _awayMission->tug.bridgeElasi1Status = GUARDSTAT_SURRENDERED;
- if (_vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_UP) {
+ if (_awayMission->tug.bridgeElasi2Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_ELASI_2, "p2surr", -1, -1, 0);
- _vm->_awayMission.tug.bridgeElasi2Status = GUARDSTAT_SURRENDERED;
+ _awayMission->tug.bridgeElasi2Status = GUARDSTAT_SURRENDERED;
}
- if (_vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_UP) {
+ if (_awayMission->tug.bridgeElasi3Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_ELASI_3, "p3surr", -1, -1, 0);
- _vm->_awayMission.tug.bridgeElasi3Status = GUARDSTAT_SURRENDERED;
+ _awayMission->tug.bridgeElasi3Status = GUARDSTAT_SURRENDERED;
}
- if (_vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_UP) {
+ if (_awayMission->tug.bridgeElasi4Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_ELASI_4, "p4surr", -1, -1, 0);
- _vm->_awayMission.tug.bridgeElasi4Status = GUARDSTAT_SURRENDERED;
+ _awayMission->tug.bridgeElasi4Status = GUARDSTAT_SURRENDERED;
}
- _vm->_awayMission.tug.missionScore += 4;
+ _awayMission->tug.missionScore += 4;
}
void Room::tug3UsePhaserAnywhere() {
@@ -95,134 +95,134 @@ void Room::tug3UsePhaserAnywhere() {
}
void Room::tug3ElasiDrawPhasers() {
- if (_vm->_awayMission.tug.bridgeElasiDrewPhasers)
+ if (_awayMission->tug.bridgeElasiDrewPhasers)
return;
- _vm->_awayMission.tug.bridgeElasiDrewPhasers = true;
+ _awayMission->tug.bridgeElasiDrewPhasers = true;
// If brig guards are alive & untied, kill the hostages
- if (_vm->_awayMission.tug.guard1Status == 0 || _vm->_awayMission.tug.guard2Status == 0) {
+ if (_awayMission->tug.guard1Status == 0 || _awayMission->tug.guard2Status == 0) {
showText(TX_SPEAKER_ELASI_CLANSMAN, TX_TUG3L081);
- _vm->_awayMission.tug.missionScore = 0;
+ _awayMission->tug.missionScore = 0;
}
- if (_vm->_awayMission.timers[0] == 0)
- _vm->_awayMission.timers[0] = 10;
+ if (_awayMission->timers[0] == 0)
+ _awayMission->timers[0] = 10;
// Make all elasi draw their phasers
- if (_vm->_awayMission.tug.bridgeElasi1Status == 0)
+ if (_awayMission->tug.bridgeElasi1Status == 0)
loadActorAnim2(OBJECT_ELASI_1, "p1draw", -1, -1, 0);
- if (_vm->_awayMission.tug.bridgeElasi2Status == 0)
+ if (_awayMission->tug.bridgeElasi2Status == 0)
loadActorAnim2(OBJECT_ELASI_2, "p2draw", -1, -1, 0);
- if (_vm->_awayMission.tug.bridgeElasi3Status == 0)
+ if (_awayMission->tug.bridgeElasi3Status == 0)
loadActorAnim2(OBJECT_ELASI_3, "p3draw", -1, -1, 0);
- if (_vm->_awayMission.tug.bridgeElasi4Status == 0)
+ if (_awayMission->tug.bridgeElasi4Status == 0)
loadActorAnim2(OBJECT_ELASI_4, "p4draw", -1, -1, 0);
}
void Room::tug3UseStunPhaserOnElasi1() {
- if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi1Status != GUARDSTAT_UP)
+ if (_awayMission->tug.crewmanKilled[OBJECT_KIRK] || _awayMission->tug.bridgeElasi1Status != GUARDSTAT_UP)
return;
loadActorAnim2(OBJECT_ELASI_1, "p1stun", -1, -1, 12);
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3beem05", 5);
- _vm->_awayMission.tug.bridgeElasi1Status = GUARDSTAT_STUNNED;
+ _awayMission->tug.bridgeElasi1Status = GUARDSTAT_STUNNED;
tug3ElasiDrawPhasers();
}
void Room::tug3UseStunPhaserOnElasi2() {
- if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi2Status != GUARDSTAT_UP)
+ if (_awayMission->tug.crewmanKilled[OBJECT_KIRK] || _awayMission->tug.bridgeElasi2Status != GUARDSTAT_UP)
return;
loadActorAnim2(OBJECT_ELASI_2, "p2stun", -1, -1, 12);
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3beem06", 5);
- _vm->_awayMission.tug.bridgeElasi2Status = GUARDSTAT_STUNNED;
+ _awayMission->tug.bridgeElasi2Status = GUARDSTAT_STUNNED;
tug3ElasiDrawPhasers();
}
void Room::tug3UseStunPhaserOnElasi3() {
- if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi3Status != GUARDSTAT_UP)
+ if (_awayMission->tug.crewmanKilled[OBJECT_KIRK] || _awayMission->tug.bridgeElasi3Status != GUARDSTAT_UP)
return;
loadActorAnim2(OBJECT_ELASI_3, "p3stun", -1, -1, 12);
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3beem07", 5);
- _vm->_awayMission.tug.bridgeElasi3Status = GUARDSTAT_STUNNED;
+ _awayMission->tug.bridgeElasi3Status = GUARDSTAT_STUNNED;
tug3ElasiDrawPhasers();
}
void Room::tug3UseStunPhaserOnElasi4() {
- if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi4Status != GUARDSTAT_UP)
+ if (_awayMission->tug.crewmanKilled[OBJECT_KIRK] || _awayMission->tug.bridgeElasi4Status != GUARDSTAT_UP)
return;
loadActorAnim2(OBJECT_ELASI_4, "p4stun", -1, -1, 12);
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3beem04", 5);
- _vm->_awayMission.tug.bridgeElasi4Status = GUARDSTAT_STUNNED;
+ _awayMission->tug.bridgeElasi4Status = GUARDSTAT_STUNNED;
tug3ElasiDrawPhasers();
}
void Room::tug3UseKillPhaserOnElasi1() {
- if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi1Status != GUARDSTAT_UP)
+ if (_awayMission->tug.crewmanKilled[OBJECT_KIRK] || _awayMission->tug.bridgeElasi1Status != GUARDSTAT_UP)
return;
loadActorAnim2(OBJECT_ELASI_1, "p1Kill", -1, -1, 12);
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3beem25", 5);
- _vm->_awayMission.tug.bridgeElasi1Status = GUARDSTAT_DEAD;
- _vm->_awayMission.tug.missionScore -= 2;
+ _awayMission->tug.bridgeElasi1Status = GUARDSTAT_DEAD;
+ _awayMission->tug.missionScore -= 2;
tug3ElasiDrawPhasers();
}
void Room::tug3UseKillPhaserOnElasi2() {
- if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi2Status != GUARDSTAT_UP)
+ if (_awayMission->tug.crewmanKilled[OBJECT_KIRK] || _awayMission->tug.bridgeElasi2Status != GUARDSTAT_UP)
return;
loadActorAnim2(OBJECT_ELASI_2, "p2Kill", -1, -1, 12);
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3beem27", 5);
- _vm->_awayMission.tug.bridgeElasi2Status = GUARDSTAT_DEAD;
- _vm->_awayMission.tug.missionScore -= 2;
+ _awayMission->tug.bridgeElasi2Status = GUARDSTAT_DEAD;
+ _awayMission->tug.missionScore -= 2;
tug3ElasiDrawPhasers();
}
void Room::tug3UseKillPhaserOnElasi3() {
- if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi3Status != GUARDSTAT_UP)
+ if (_awayMission->tug.crewmanKilled[OBJECT_KIRK] || _awayMission->tug.bridgeElasi3Status != GUARDSTAT_UP)
return;
loadActorAnim2(OBJECT_ELASI_3, "p3Kill", -1, -1, 12);
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3beem26", 5);
- _vm->_awayMission.tug.bridgeElasi3Status = GUARDSTAT_DEAD;
- _vm->_awayMission.tug.missionScore -= 2;
+ _awayMission->tug.bridgeElasi3Status = GUARDSTAT_DEAD;
+ _awayMission->tug.missionScore -= 2;
tug3ElasiDrawPhasers();
}
void Room::tug3UseKillPhaserOnElasi4() {
- if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi4Status != GUARDSTAT_UP)
+ if (_awayMission->tug.crewmanKilled[OBJECT_KIRK] || _awayMission->tug.bridgeElasi4Status != GUARDSTAT_UP)
return;
loadActorAnim2(OBJECT_ELASI_4, "p4Kill", -1, -1, 12);
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3beem24", 5);
- _vm->_awayMission.tug.bridgeElasi4Status = GUARDSTAT_DEAD;
- _vm->_awayMission.tug.missionScore -= 2;
+ _awayMission->tug.bridgeElasi4Status = GUARDSTAT_DEAD;
+ _awayMission->tug.missionScore -= 2;
tug3ElasiDrawPhasers();
}
void Room::tug3ElasiStunnedOrKilled() {
- if (_vm->_awayMission.tug.bridgeWinMethod == 1)
+ if (_awayMission->tug.bridgeWinMethod == 1)
return;
- if (_vm->_awayMission.tug.bridgeElasi1Status == GUARDSTAT_UP || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_UP
- || _vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_UP || _vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_UP)
+ if (_awayMission->tug.bridgeElasi1Status == GUARDSTAT_UP || _awayMission->tug.bridgeElasi2Status == GUARDSTAT_UP
+ || _awayMission->tug.bridgeElasi3Status == GUARDSTAT_UP || _awayMission->tug.bridgeElasi4Status == GUARDSTAT_UP)
return;
// BUGFIX: if the ship is deorbiting, the mission isn't won yet.
- if (_vm->_awayMission.tug.orbitalDecayCounter != 0)
+ if (_awayMission->tug.orbitalDecayCounter != 0)
return;
- _vm->_awayMission.tug.bridgeWinMethod = 1;
+ _awayMission->tug.bridgeWinMethod = 1;
tug3EndMission();
}
void Room::tug3TalkToElasi1() {
- if (_vm->_awayMission.tug.bridgeElasi1Status != GUARDSTAT_UP || _vm->_awayMission.tug.talkedToCereth)
+ if (_awayMission->tug.bridgeElasi1Status != GUARDSTAT_UP || _awayMission->tug.talkedToCereth)
return;
- _vm->_awayMission.tug.talkedToCereth = true;
+ _awayMission->tug.talkedToCereth = true;
const int choices[] = {
TX_SPEAKER_KIRK,
@@ -236,27 +236,27 @@ void Room::tug3TalkToElasi1() {
switch (choice) {
case 0: // They surrender
showText(TX_SPEAKER_ELASI_CERETH, TX_TUG3L084);
- _vm->_awayMission.tug.bridgeElasi1Status = GUARDSTAT_SURRENDERED;
+ _awayMission->tug.bridgeElasi1Status = GUARDSTAT_SURRENDERED;
loadActorAnim2(OBJECT_ELASI_1, "p1surr", -1, -1, 0);
tug3ElasiSurrendered();
- _vm->_awayMission.tug.bridgeWinMethod = 2;
- _vm->_awayMission.tug.missionScore += 8;
+ _awayMission->tug.bridgeWinMethod = 2;
+ _awayMission->tug.missionScore += 8;
tug3EndMission();
break;
case 1: // Cereth shoots console, doesn't surrender
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
showText(TX_SPEAKER_ELASI_CERETH, TX_TUG3_F27);
loadActorAnim2(OBJECT_ELASI_1, "p1draw", -1, -1, 3);
break;
case 2: // Cereth shoots console and surrenders
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
showText(TX_SPEAKER_ELASI_CERETH, TX_TUG3L083);
loadActorAnim2(OBJECT_ELASI_1, "p1draw", -1, -1, 5);
// BUGFIX: they're going to surrender, so stop the firefight.
- _vm->_awayMission.timers[0] = 0;
+ _awayMission->timers[0] = 0;
break;
}
}
@@ -270,9 +270,9 @@ void Room::tug3Elasi1DrewPhaser() {
void Room::tug3Elasi1ShotConsole() {
tug3ElasiDrawPhasers();
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.bridgeWinMethod = 3;
- _vm->_awayMission.timers[1] = 10;
+ _awayMission->disableInput = false;
+ _awayMission->tug.bridgeWinMethod = 3;
+ _awayMission->timers[1] = 10;
}
void Room::tug3Elasi1DrewPhaser2() {
@@ -284,9 +284,9 @@ void Room::tug3Elasi1DrewPhaser2() {
void Room::tug3Elasi1ShotConsoleAndSurrenders() {
showText(TX_SPEAKER_ELASI_CERETH, TX_TUG3L080);
tug3ElasiSurrendered();
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.bridgeWinMethod = 3;
- _vm->_awayMission.timers[1] = 10;
+ _awayMission->disableInput = false;
+ _awayMission->tug.bridgeWinMethod = 3;
+ _awayMission->timers[1] = 10;
}
void Room::tug3LookAtMccoy() {
@@ -308,7 +308,7 @@ void Room::tug3LookAtElasi1() {
// The function itself is changed by checking both if he's stunned or if he's dead,
// instead of just checking if he's stunned.
- if (_vm->_awayMission.tug.bridgeElasi1Status == GUARDSTAT_STUNNED || _vm->_awayMission.tug.bridgeElasi1Status == GUARDSTAT_DEAD)
+ if (_awayMission->tug.bridgeElasi1Status == GUARDSTAT_STUNNED || _awayMission->tug.bridgeElasi1Status == GUARDSTAT_DEAD)
showText(TX_TUG3N003);
else
showText(TX_TUG3N008);
@@ -317,32 +317,32 @@ void Room::tug3LookAtElasi1() {
void Room::tug3LookAtElasi2() {
// BUGFIX: also check if stunned. They can't "glare at the crewmembers" if they're
// unconscious. (applies to below functions too.)
- if (_vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_DEAD || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_STUNNED)
+ if (_awayMission->tug.bridgeElasi2Status == GUARDSTAT_DEAD || _awayMission->tug.bridgeElasi2Status == GUARDSTAT_STUNNED)
showText(TX_TUG3N004);
else
showText(TX_TUG3N005);
}
void Room::tug3LookAtElasi3() {
- if (_vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_DEAD || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_STUNNED)
+ if (_awayMission->tug.bridgeElasi3Status == GUARDSTAT_DEAD || _awayMission->tug.bridgeElasi2Status == GUARDSTAT_STUNNED)
showText(TX_TUG3N004);
else
showText(TX_TUG3N005);
}
void Room::tug3LookAtElasi4() {
- if (_vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_DEAD || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_STUNNED)
+ if (_awayMission->tug.bridgeElasi4Status == GUARDSTAT_DEAD || _awayMission->tug.bridgeElasi2Status == GUARDSTAT_STUNNED)
showText(TX_TUG3N004);
else
showText(TX_TUG3N005);
}
void Room::tug3TalkToMccoy() {
- if (_vm->_awayMission.tug.orbitalDecayCounter != 0 || _vm->_awayMission.tug.bridgeElasi1Status != GUARDSTAT_UP) {
- if (_vm->_awayMission.tug.orbitalDecayCounter >= 10) {
- if (_vm->_awayMission.tug.orbitalDecayCounter < 16)
+ if (_awayMission->tug.orbitalDecayCounter != 0 || _awayMission->tug.bridgeElasi1Status != GUARDSTAT_UP) {
+ if (_awayMission->tug.orbitalDecayCounter >= 10) {
+ if (_awayMission->tug.orbitalDecayCounter < 16)
showText(TX_SPEAKER_MCCOY, TX_TUG3_011);
- } else if (_vm->_awayMission.tug.orbitalDecayCounter != 0) {
+ } else if (_awayMission->tug.orbitalDecayCounter != 0) {
// BUGFIX: original game displays a blank textbox. An appropriate audio file
// exists, but the corresponding text was written from scratch for ScummVM.
// TODO: check if original floppy version has text for this.
@@ -353,9 +353,9 @@ void Room::tug3TalkToMccoy() {
}
void Room::tug3TalkToSpock() {
- if (_vm->_awayMission.tug.orbitalDecayCounter != 0) {
- if (_vm->_awayMission.tug.orbitalDecayCounter >= 10) {
- if (_vm->_awayMission.tug.orbitalDecayCounter < 16)
+ if (_awayMission->tug.orbitalDecayCounter != 0) {
+ if (_awayMission->tug.orbitalDecayCounter >= 10) {
+ if (_awayMission->tug.orbitalDecayCounter < 16)
showText(TX_SPEAKER_SPOCK, TX_TUG3_008);
} else
showText(TX_SPEAKER_SPOCK, TX_TUG3_009);
@@ -367,36 +367,36 @@ void Room::tug3TalkToRedshirt() {
}
void Room::tug3UseCommunicator() {
- if (_vm->_awayMission.tug.orbitalDecayCounter == 0)
+ if (_awayMission->tug.orbitalDecayCounter == 0)
return;
- if (_vm->_awayMission.tug.orbitalDecayCounter < 10) {
+ if (_awayMission->tug.orbitalDecayCounter < 10) {
showText(TX_SPEAKER_KIRK, TX_TUG3_007);
showText(TX_SPEAKER_SULU, TX_TUG3_015);
showText(TX_SPEAKER_SHIPS_COMPUTER, TX_COMPA180);
- _vm->_awayMission.timers[1] = 0;
+ _awayMission->timers[1] = 0;
// BUGFIX: if still fighting the elasi, the mission isn't done yet.
- _vm->_awayMission.tug.orbitalDecayCounter = 0;
- if (!_vm->_awayMission.tug.elasiSurrendered &&
- (_vm->_awayMission.tug.bridgeElasi1Status == GUARDSTAT_UP
- || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_UP
- || _vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_UP
- || _vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_UP))
+ _awayMission->tug.orbitalDecayCounter = 0;
+ if (!_awayMission->tug.elasiSurrendered &&
+ (_awayMission->tug.bridgeElasi1Status == GUARDSTAT_UP
+ || _awayMission->tug.bridgeElasi2Status == GUARDSTAT_UP
+ || _awayMission->tug.bridgeElasi3Status == GUARDSTAT_UP
+ || _awayMission->tug.bridgeElasi4Status == GUARDSTAT_UP))
return;
tug3EndMission();
} else {
- if (_vm->_awayMission.tug.orbitalDecayCounter < 16) {
+ if (_awayMission->tug.orbitalDecayCounter < 16) {
showText(TX_SPEAKER_KIRK, TX_TUG3_006);
showText(TX_SPEAKER_SCOTT, TX_TUG3_S07);
playMidiMusicTracks(-1, -1);
- _vm->_awayMission.disableInput = true;
- if (_vm->_awayMission.tug.missionScore < 0)
- _vm->_awayMission.tug.missionScore = 0;
- endMission(_vm->_awayMission.tug.missionScore, _vm->_awayMission.tug.field2b, _vm->_awayMission.tug.field2d);
+ _awayMission->disableInput = true;
+ if (_awayMission->tug.missionScore < 0)
+ _awayMission->tug.missionScore = 0;
+ endMission(_awayMission->tug.missionScore, _awayMission->tug.field2b, _awayMission->tug.field2d);
}
}
}
@@ -411,31 +411,31 @@ void Room::tug3Timer0Expired() {
int elasiShooter, elasiTarget;
- if (_vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_UP)
+ if (_awayMission->tug.bridgeElasi2Status == GUARDSTAT_UP)
elasiShooter = 0;
- else if (_vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_UP)
+ else if (_awayMission->tug.bridgeElasi3Status == GUARDSTAT_UP)
elasiShooter = 1;
- else if (_vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_UP)
+ else if (_awayMission->tug.bridgeElasi4Status == GUARDSTAT_UP)
elasiShooter = 2;
else
return;
- if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT]) {
- _vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT] = 2;
- _vm->_awayMission.redshirtDead = true;
+ if (!_awayMission->tug.crewmanKilled[OBJECT_REDSHIRT]) {
+ _awayMission->tug.crewmanKilled[OBJECT_REDSHIRT] = 2;
+ _awayMission->redshirtDead = true;
loadActorAnim2(OBJECT_REDSHIRT, "rkills", -1, -1, 0);
elasiTarget = OBJECT_REDSHIRT;
- } else if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK]) {
- _vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] = 2;
- _vm->_awayMission.disableInput = true;
+ } else if (!_awayMission->tug.crewmanKilled[OBJECT_KIRK]) {
+ _awayMission->tug.crewmanKilled[OBJECT_KIRK] = 2;
+ _awayMission->disableInput = true;
loadActorAnim2(OBJECT_KIRK, "kkills", -1, -1, 0);
elasiTarget = OBJECT_KIRK;
- } else if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_SPOCK]) {
- _vm->_awayMission.tug.crewmanKilled[OBJECT_SPOCK] = 2;
+ } else if (!_awayMission->tug.crewmanKilled[OBJECT_SPOCK]) {
+ _awayMission->tug.crewmanKilled[OBJECT_SPOCK] = 2;
loadActorAnim2(OBJECT_SPOCK, "skills", -1, -1, 0);
elasiTarget = OBJECT_SPOCK;
- } else if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY]) {
- _vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY] = 2;
+ } else if (!_awayMission->tug.crewmanKilled[OBJECT_MCCOY]) {
+ _awayMission->tug.crewmanKilled[OBJECT_MCCOY] = 2;
loadActorAnim2(OBJECT_MCCOY, "mkills", -1, -1, 13);
elasiTarget = OBJECT_MCCOY;
} else
@@ -443,7 +443,7 @@ void Room::tug3Timer0Expired() {
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks(beamAnims[elasiShooter][elasiTarget], 5);
- _vm->_awayMission.timers[0] = 50;
+ _awayMission->timers[0] = 50;
}
void Room::tug3AllCrewmenDead() {
@@ -453,14 +453,14 @@ void Room::tug3AllCrewmenDead() {
// "Orbital decay" countdown timer
void Room::tug3Timer1Expired() {
- if (_vm->_awayMission.tug.orbitalDecayCounter < 10) { // Decay still preventable
+ if (_awayMission->tug.orbitalDecayCounter < 10) { // Decay still preventable
showText(TX_SPEAKER_SHIPS_COMPUTER, TX_COMPU182);
- _vm->_awayMission.timers[1] = 100;
- _vm->_awayMission.tug.orbitalDecayCounter++;
- } else if (_vm->_awayMission.tug.orbitalDecayCounter < 16) { // Decay now unavoidable
+ _awayMission->timers[1] = 100;
+ _awayMission->tug.orbitalDecayCounter++;
+ } else if (_awayMission->tug.orbitalDecayCounter < 16) { // Decay now unavoidable
showText(TX_SPEAKER_SHIPS_COMPUTER, TX_COMPU181);
- _vm->_awayMission.timers[1] = 100;
- _vm->_awayMission.tug.orbitalDecayCounter++;
+ _awayMission->timers[1] = 100;
+ _awayMission->tug.orbitalDecayCounter++;
} else { // Game over
showText(TX_TUG3N006);
showGameOverMenu();
@@ -485,10 +485,10 @@ void Room::tug3SecurityTeamBeamedIn() {
showText(TX_SPEAKER_SCOTT, TX_TUG3_S08);
playMidiMusicTracks(-1, -1);
- _vm->_awayMission.disableInput = true;
- if (_vm->_awayMission.tug.missionScore < 0)
- _vm->_awayMission.tug.missionScore = 0;
- endMission(_vm->_awayMission.tug.missionScore, _vm->_awayMission.tug.field2b, _vm->_awayMission.tug.field2d);
+ _awayMission->disableInput = true;
+ if (_awayMission->tug.missionScore < 0)
+ _awayMission->tug.missionScore = 0;
+ endMission(_awayMission->tug.missionScore, _awayMission->tug.field2b, _awayMission->tug.field2d);
}
}
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
index 5354d92..1b7021a 100644
--- a/engines/startrek/sound.h
+++ b/engines/startrek/sound.h
@@ -23,6 +23,7 @@
#ifndef STARTREK_SOUND_H
#define STARTREK_SOUND_H
+#include "startrek/soundeffects.h"
#include "startrek/startrek.h"
#include "audio/midiparser.h"
@@ -38,66 +39,6 @@ namespace StarTrek {
class StarTrekEngine;
-// Sound effects for "playSoundEffectIndex" function
-enum SoundEffects {
- SND_TRICORDER = 4,
- SND_DOOR1 = 5,
- SND_PHASSHOT = 6,
- SND_07 = 7,
- SND_TRANSDEM = 8,
- SND_TRANSMAT = 9,
- SND_TRANSENE = 0x0a,
- SND_BLANK_0b = 0x0b,
- SND_SELECTION = 0x10,
- SND_BLANK_14 = 0x14,
- SND_BLANK_16 = 0x16,
- SND_HAILING = 0x22,
- SND_PHASSHOT_2 = 0x24,
- SND_PHOTSHOT = 0x25,
- SND_HITSHIEL = 0x26,
- SND_27 = 0x27,
- SND_REDALERT = 0x28,
- SND_WARP = 0x29
-};
-
-
-enum MidiTracks {
- MIDITRACK_0,
- MIDITRACK_1,
- MIDITRACK_2,
- MIDITRACK_3,
- MIDITRACK_4,
- MIDITRACK_5,
- MIDITRACK_6,
- MIDITRACK_7,
- MIDITRACK_8,
- MIDITRACK_9,
- MIDITRACK_10,
- MIDITRACK_11,
- MIDITRACK_12,
- MIDITRACK_13,
- MIDITRACK_14,
- MIDITRACK_15,
- MIDITRACK_16,
- MIDITRACK_17,
- MIDITRACK_18,
- MIDITRACK_19,
- MIDITRACK_20,
- MIDITRACK_21,
- MIDITRACK_22,
- MIDITRACK_23,
- MIDITRACK_24,
- MIDITRACK_25,
- MIDITRACK_26,
- MIDITRACK_27,
- MIDITRACK_28,
- MIDITRACK_29,
- MIDITRACK_30,
- MIDITRACK_31,
- MIDITRACK_32,
- MIDITRACK_33
-};
-
// Max # of VOC files that can play at once
const int MAX_SFX_PLAYING = 4;
diff --git a/engines/startrek/soundeffects.h b/engines/startrek/soundeffects.h
new file mode 100644
index 0000000..357c36e
--- /dev/null
+++ b/engines/startrek/soundeffects.h
@@ -0,0 +1,87 @@
+/* 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.
+ *
+ */
+
+#ifndef STARTREK_SOUNDEFFECTS_H
+#define STARTREK_SOUNDEFFECTS_H
+
+
+// Sound effects for "playSoundEffectIndex" function
+enum SoundEffects {
+ SND_TRICORDER = 4,
+ SND_DOOR1 = 5,
+ SND_PHASSHOT = 6,
+ SND_07 = 7,
+ SND_TRANSDEM = 8,
+ SND_TRANSMAT = 9,
+ SND_TRANSENE = 0x0a,
+ SND_BLANK_0b = 0x0b,
+ SND_SELECTION = 0x10,
+ SND_BLANK_14 = 0x14,
+ SND_BLANK_16 = 0x16,
+ SND_HAILING = 0x22,
+ SND_PHASSHOT_2 = 0x24,
+ SND_PHOTSHOT = 0x25,
+ SND_HITSHIEL = 0x26,
+ SND_27 = 0x27,
+ SND_REDALERT = 0x28,
+ SND_WARP = 0x29
+};
+
+
+enum MidiTracks {
+ MIDITRACK_0,
+ MIDITRACK_1,
+ MIDITRACK_2,
+ MIDITRACK_3,
+ MIDITRACK_4,
+ MIDITRACK_5,
+ MIDITRACK_6,
+ MIDITRACK_7,
+ MIDITRACK_8,
+ MIDITRACK_9,
+ MIDITRACK_10,
+ MIDITRACK_11,
+ MIDITRACK_12,
+ MIDITRACK_13,
+ MIDITRACK_14,
+ MIDITRACK_15,
+ MIDITRACK_16,
+ MIDITRACK_17,
+ MIDITRACK_18,
+ MIDITRACK_19,
+ MIDITRACK_20,
+ MIDITRACK_21,
+ MIDITRACK_22,
+ MIDITRACK_23,
+ MIDITRACK_24,
+ MIDITRACK_25,
+ MIDITRACK_26,
+ MIDITRACK_27,
+ MIDITRACK_28,
+ MIDITRACK_29,
+ MIDITRACK_30,
+ MIDITRACK_31,
+ MIDITRACK_32,
+ MIDITRACK_33
+};
+
+#endif
Commit: abf711a4d33b01cc5ef7726cdade8a39a8a5a325
https://github.com/scummvm/scummvm/commit/abf711a4d33b01cc5ef7726cdade8a39a8a5a325
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: text.cpp -> textbox.cpp
Changed paths:
A engines/startrek/textbox.cpp
R engines/startrek/text.cpp
engines/startrek/module.mk
engines/startrek/startrek.h
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 384e07b..50aa62d 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -20,7 +20,7 @@ MODULE_OBJS = \
space.o \
sprite.o \
startrek.o \
- text.o \
+ textbox.o \
rooms/demon0.o \
rooms/demon1.o \
rooms/demon2.o \
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 386abd1..e8ea798 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -462,7 +462,7 @@ private:
uint32 _frameStartMillis;
- // text.cpp
+ // textbox.cpp
public:
/**
* Gets one line of text (does not include words that won't fit).
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
deleted file mode 100644
index 1a05ecc..0000000
--- a/engines/startrek/text.cpp
+++ /dev/null
@@ -1,933 +0,0 @@
-/* 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 "common/events.h"
-#include "common/stream.h"
-#include "graphics/cursorman.h"
-
-#include "startrek/graphics.h"
-#include "startrek/room.h"
-
-
-namespace StarTrek {
-
-const char *StarTrekEngine::getNextTextLine(const char *text, char *lineOutput, int lineWidth) {
- *lineOutput = '\0';
- if (*text == '\0')
- return nullptr;
-
- const char *lastSpaceInput = nullptr;
- char *lastSpaceOutput = nullptr;
- int charIndex = 0;
-
- while (charIndex != lineWidth && *text != '\0') {
- char c = *text;
-
- if (c == '\n') {
- *lineOutput = '\0';
- return text + 1;
- }
-
- if (c == ' ') {
- lastSpaceInput = text;
- lastSpaceOutput = lineOutput;
- }
-
- if (c == '\r') {
- text++;
- charIndex--;
- } else {
- text++;
- *(lineOutput++) = c;
- }
- charIndex++;
- }
-
- if (*text == '\0') {
- *lineOutput = '\0';
- return text;
- }
- if (*text == ' ') {
- *lineOutput = '\0';
- return text + 1;
- }
- if (lastSpaceOutput == nullptr) { // Long word couldn't fit on line
- *lineOutput = '\0';
- return text;
- }
-
- // In the middle of a word; must go back to the start of it
- *lastSpaceOutput = '\0';
- return lastSpaceInput + 1;
-}
-
-void StarTrekEngine::drawTextLineToBitmap(const char *text, int textLen, int x, int y, SharedPtr<Bitmap> bitmap) {
- const int charWidth = 8;
-
- int textOffset = 0;
-
- while (textOffset < textLen) {
- Common::Rect destRect(x, y, x + 8, y + 8);
- Common::Rect bitmapRect(bitmap->width, bitmap->height);
-
- if (destRect.intersects(bitmapRect)) {
- // drawRect = the rectangle within the 8x8 font character that will be drawn
- // (part of it may be clipped)
- Common::Rect drawRect;
- drawRect.left = bitmapRect.left - destRect.left;
- if (drawRect.left < destRect.left - destRect.left)
- drawRect.left = destRect.left - destRect.left;
-
- drawRect.right = bitmapRect.right - destRect.left;
- if (drawRect.right > destRect.right - destRect.left)
- drawRect.right = destRect.right - destRect.left;
-
- drawRect.top = bitmapRect.top - destRect.top;
- if (drawRect.top < destRect.top - destRect.top)
- drawRect.top = destRect.top - destRect.top;
-
- drawRect.bottom = bitmapRect.bottom - destRect.top;
- if (drawRect.bottom > destRect.bottom - destRect.top)
- drawRect.bottom = destRect.bottom - destRect.top;
-
-
- int16 destX = destRect.left - bitmapRect.left;
- if (destX < bitmapRect.right - bitmapRect.right)
- destX = bitmapRect.right - bitmapRect.right;
-
- int16 destY = destRect.top - bitmapRect.top;
- if (destY < bitmapRect.top - bitmapRect.top)
- destY = bitmapRect.top - bitmapRect.top;
-
- int16 srcRowDiff = charWidth - drawRect.width();
- int16 destRowDiff = bitmapRect.width() - drawRect.width();
-
- byte *srcPixels = _gfx->getFontGfx(text[textOffset]) + drawRect.top * charWidth + drawRect.left;
- byte *destPixels = bitmap->pixels + destY * bitmapRect.width() + destX;
-
- for (int i = 0; i < drawRect.height(); i++) {
- memcpy(destPixels, srcPixels, drawRect.width());
- destPixels += destRowDiff + drawRect.width();
- srcPixels += srcRowDiff + drawRect.width();
- }
- }
-
- x += charWidth;
- textOffset++;
- }
-}
-
-String StarTrekEngine::centerTextboxHeader(String headerText) {
- char text[TEXT_CHARS_PER_LINE + 1];
- memset(text, ' ', sizeof(text));
- text[TEXT_CHARS_PER_LINE] = '\0';
-
- int strlen = headerText.size();
- strlen = min(strlen, TEXT_CHARS_PER_LINE);
-
- memcpy(text + (TEXT_CHARS_PER_LINE - strlen) / 2, headerText.c_str(), strlen);
-
- return Common::String(text);
-}
-
-void StarTrekEngine::getTextboxHeader(String *headerTextOutput, String speakerText, int choiceIndex) {
- String header = speakerText;
-
- if (choiceIndex != 0)
- header += String::format(" choice %d", choiceIndex);
-
- *headerTextOutput = centerTextboxHeader(header);
-}
-
-String StarTrekEngine::readTextFromRdf(int choiceIndex, uintptr data, String *headerTextOutput) {
- SharedPtr<Room> room = getRoom();
-
- int rdfVar = (size_t)data;
-
- uint16 textOffset = room->readRdfWord(rdfVar + (choiceIndex + 1) * 2);
-
- if (textOffset == 0)
- return "";
-
- if (headerTextOutput != nullptr) {
- uint16 speakerOffset = room->readRdfWord(rdfVar);
- if (speakerOffset == 0 || room->_rdfData[speakerOffset] == '\0')
- *headerTextOutput = "";
- else {
- char *speakerText = (char *)&room->_rdfData[speakerOffset];
- if (room->readRdfWord(rdfVar + 4) != 0) // Check if there's more than one option
- getTextboxHeader(headerTextOutput, speakerText, choiceIndex + 1);
- else
- getTextboxHeader(headerTextOutput, speakerText, 0);
- }
- }
-
- return (char *)&room->_rdfData[textOffset];
-}
-
-void StarTrekEngine::showTextbox(String headerText, const String &mainText, int xoffset, int yoffset, byte textColor, int maxTextLines) {
- if (!headerText.empty())
- headerText = centerTextboxHeader(headerText);
-
- int actionParam = (maxTextLines < 0 ? 0 : maxTextLines);
-
- if (maxTextLines < 0)
- maxTextLines = -maxTextLines;
-
- const char *strings[3];
-
- if (headerText.empty())
- strings[0] = nullptr;
- else
- strings[0] = headerText.c_str();
- strings[1] = mainText.c_str();
- strings[2] = "";
-
- showText(&StarTrekEngine::readTextFromArray, (uintptr)strings, xoffset, yoffset, textColor, false, maxTextLines, false);
-
- if (actionParam != 0)
- addAction(ACTION_TALK, actionParam, 0, 0);
-}
-
-String StarTrekEngine::skipTextAudioPrompt(const String &str) {
- const char *text = str.c_str();
-
- if (*text != '#')
- return str;
-
- text++;
- while (*text != '#') {
- if (*text == '\0')
- return str;
- text++;
- }
-
- return String(text + 1);
-}
-
-String StarTrekEngine::playTextAudio(const String &str) {
- const char *text = str.c_str();
- char soundFile[0x100];
-
- if (*text != '#')
- return str;
-
- int len = 0;
- text++;
- while (*text != '#') {
- if (*text == '\0' || len > 0xfa)
- return str;
- soundFile[len++] = *text++;
- }
-
- soundFile[len] = '\0';
- playSpeech(soundFile);
-
- return String(text + 1);
-}
-
-int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, bool rclickCancelsChoice) {
- int16 tmpTextDisplayMode = _textDisplayMode;
-
- uint32 ticksUntilClickingEnabled = 8;
- if (_frameIndex > _textboxVar2 + 1) {
- ticksUntilClickingEnabled = 0x10;
- }
-
- int numChoicesWithNames = 0;
- int numTextboxLines = 0;
- int numChoices = 0;
- String speakerText;
-
- while (true) {
- String choiceText = (this->*textGetter)(numChoices, var, &speakerText);
- if (choiceText.empty())
- break;
-
- int lines = getNumTextboxLines(skipTextAudioPrompt(choiceText));
- if (lines > numTextboxLines)
- numTextboxLines = lines;
-
- if (!speakerText.empty()) // FIXME: Technically should check for nullptr
- numChoicesWithNames++;
-
- numChoices++;
- }
-
- if (maxTextLines == 0 || maxTextLines > MAX_TEXTBOX_LINES)
- maxTextLines = MAX_TEXTBOX_LINES;
- if (numTextboxLines > maxTextLines)
- numTextboxLines = maxTextLines;
-
- if (numChoicesWithNames != 0 && numChoices != numChoicesWithNames)
- error("showText: Not all choices have titles.");
-
- Sprite textboxSprite;
- SharedPtr<TextBitmap> textBitmap = initTextSprite(&xoffset, &yoffset, textColor, numTextboxLines, numChoicesWithNames, &textboxSprite);
-
- int choiceIndex = 0;
- int scrollOffset = 0;
- if (tmpTextDisplayMode != TEXTDISPLAY_WAIT && tmpTextDisplayMode != TEXTDISPLAY_SUBTITLES
- && numChoices == 1 && _sfxEnabled && !_sfxWorking)
- _textboxHasMultipleChoices = false;
- else
- _textboxHasMultipleChoices = true;
-
- if (tmpTextDisplayMode >= TEXTDISPLAY_WAIT && tmpTextDisplayMode <= TEXTDISPLAY_NONE
- && _sfxEnabled && !_sfxWorking)
- _textboxVar6 = true;
- else
- _textboxVar6 = false;
-
- int numTextLines;
- String lineFormattedText = readLineFormattedText(textGetter, var, choiceIndex, textBitmap, numTextboxLines, &numTextLines);
-
- if (lineFormattedText.empty()) { // Technically should check for nullptr
- _gfx->delSprite(&textboxSprite);
-
- // TODO
- } else {
- loadMenuButtons("textbtns", xoffset + 0x96, yoffset - 0x11);
-
- Common::Point oldMousePos = _gfx->getMousePos();
- SharedPtr<Bitmap> oldMouseBitmap = _gfx->getMouseBitmap();
-
- _gfx->warpMouse(xoffset + 0xde, yoffset - 0x08);
- _gfx->setMouseBitmap(_gfx->loadBitmap("pushbtn"));
-
- bool tmpMouseControllingShip = _mouseControllingShip;
- _mouseControllingShip = false;
-
- // Decide which buttons to show
- uint32 visibleButtons = (1 << TEXTBUTTON_CONFIRM);
- if (numChoices > 1)
- visibleButtons |= (1 << TEXTBUTTON_PREVCHOICE) | (1 << TEXTBUTTON_NEXTCHOICE);
- if (numTextLines > numTextboxLines)
- visibleButtons |= (1 << TEXTBUTTON_SCROLLUP) | (1 << TEXTBUTTON_SCROLLDOWN);
- setVisibleMenuButtons(visibleButtons);
-
- disableMenuButtons(1 << TEXTBUTTON_SCROLLUP); // Disable scroll up
-
- if (ticksUntilClickingEnabled != 0) // Disable done button
- disableMenuButtons(1 << TEXTBUTTON_CONFIRM);
-
- if (!loopChoices) // Disable prev button
- disableMenuButtons(1 << TEXTBUTTON_PREVCHOICE);
-
- bool doneShowingText = false;
-
- // Loop until text is done being displayed
- while (!doneShowingText) {
- int textboxReturnCode = handleMenuEvents(ticksUntilClickingEnabled, true);
-
- if (ticksUntilClickingEnabled != 0)
- enableMenuButtons(1 << TEXTBUTTON_CONFIRM);
-
- switch (textboxReturnCode) {
-
- case MENUEVENT_RCLICK_OFFBUTTON:
- case MENUEVENT_RCLICK_ONBUTTON:
- if (ticksUntilClickingEnabled == 0) {
- doneShowingText = true;
- if (rclickCancelsChoice)
- choiceIndex = -1;
- }
- break;
-
- case TEXTBUTTON_CONFIRM:
- doneShowingText = true;
- break;
-
- case TEXTBUTTON_SCROLLUP:
- scrollOffset -= numTextboxLines;
- goto readjustScrollUp;
-
- case TEXTBUTTON_SCROLLDOWN:
- scrollOffset += numTextboxLines;
- goto readjustScrollDown;
-
- case TEXTBUTTON_SCROLLUP_ONELINE:
- scrollOffset--;
- goto readjustScrollUp;
-
- case TEXTBUTTON_SCROLLDOWN_ONELINE:
- scrollOffset++;
- goto readjustScrollDown;
-
- case TEXTBUTTON_GOTO_TOP:
- scrollOffset = 0;
- goto readjustScrollUp;
-
- case TEXTBUTTON_GOTO_BOTTOM:
- scrollOffset = numTextLines - numTextboxLines;
- goto readjustScrollDown;
-
-readjustScrollUp:
- enableMenuButtons(1 << TEXTBUTTON_SCROLLDOWN);
- if (scrollOffset < 0)
- scrollOffset = 0;
- if (scrollOffset == 0)
- disableMenuButtons(1 << TEXTBUTTON_SCROLLUP);
- goto readjustScroll;
-
-readjustScrollDown:
- enableMenuButtons(1 << TEXTBUTTON_SCROLLUP);
- if (scrollOffset >= numTextLines)
- scrollOffset -= numTextboxLines;
- if (scrollOffset > numTextLines - 1)
- scrollOffset = numTextLines - 1;
- if (scrollOffset + numTextboxLines >= numTextLines)
- disableMenuButtons(1 << TEXTBUTTON_SCROLLDOWN);
- goto readjustScroll;
-
-readjustScroll:
- textboxSprite.bitmapChanged = true;
- drawMainText(
- textBitmap,
- numTextLines - scrollOffset,
- numTextboxLines,
- lineFormattedText.c_str() + scrollOffset * (TEXTBOX_WIDTH - 2),
- numChoicesWithNames != 0);
- break;
-
- case TEXTBUTTON_PREVCHOICE:
- choiceIndex--;
- if (!loopChoices && choiceIndex == 0) {
- disableMenuButtons(1 << TEXTBUTTON_PREVCHOICE);
- } else {
- if (choiceIndex < 0)
- choiceIndex = numChoices - 1;
- }
- enableMenuButtons(1 << TEXTBUTTON_NEXTCHOICE);
- goto reloadText;
-
- case TEXTBUTTON_NEXTCHOICE:
- enableMenuButtons(1 << TEXTBUTTON_PREVCHOICE);
- choiceIndex++;
- if (!loopChoices && choiceIndex == numChoices - 1) {
- disableMenuButtons(1 << TEXTBUTTON_NEXTCHOICE);
- } else {
- choiceIndex %= numChoices;
- }
- goto reloadText;
-
-reloadText:
- scrollOffset = 0;
- lineFormattedText = readLineFormattedText(textGetter, var, choiceIndex, textBitmap, numTextboxLines, &numTextLines);
- if (numTextLines <= numTextboxLines) {
- setVisibleMenuButtons((1 << TEXTBUTTON_CONFIRM) | (1 << TEXTBUTTON_PREVCHOICE) | (1 << TEXTBUTTON_NEXTCHOICE));
- } else {
- setVisibleMenuButtons((1 << TEXTBUTTON_CONFIRM) | (1 << TEXTBUTTON_SCROLLUP) | (1 << TEXTBUTTON_SCROLLDOWN) | (1 << TEXTBUTTON_PREVCHOICE) | (1 << TEXTBUTTON_NEXTCHOICE));
- }
- enableMenuButtons(1 << TEXTBUTTON_SCROLLDOWN);
- disableMenuButtons(1 << TEXTBUTTON_SCROLLUP);
- textboxSprite.bitmapChanged = true;
- break;
-
- case TEXTBUTTON_SPEECH_DONE:
- if (numChoices == 1)
- doneShowingText = true;
- break;
-
- case MENUEVENT_ENABLEINPUT:
- case MENUEVENT_LCLICK_OFFBUTTON:
- default:
- break;
- }
-
- ticksUntilClickingEnabled = 0;
- }
-
- _gfx->setMouseBitmap(oldMouseBitmap);
- _gfx->warpMouse(oldMousePos.x, oldMousePos.y);
-
- _mouseControllingShip = tmpMouseControllingShip;
- unloadMenuButtons();
-
- textboxSprite.dontDrawNextFrame();
- _gfx->drawAllSprites();
- _gfx->delSprite(&textboxSprite);
- }
-
- _textboxVar2 = _frameIndex;
- stopPlayingSpeech();
- return choiceIndex;
-}
-
-int StarTrekEngine::getNumTextboxLines(const String &str) {
- const char *text = str.c_str();
- char line[TEXTBOX_WIDTH];
-
- int lines = 0;
-
- while (text != nullptr) {
- text = getNextTextLine(text, line, TEXTBOX_WIDTH - 2);
- lines++;
- }
- return lines - 1;
-}
-
-String StarTrekEngine::putTextIntoLines(const String &_text) {
- char line[TEXTBOX_WIDTH];
-
- const char *text = _text.c_str();
- String output;
-
- text = getNextTextLine(text, line, TEXTBOX_WIDTH - 2);
-
- while (text != nullptr) {
- int len = strlen(line);
- while (len != TEXTBOX_WIDTH - 2) {
- line[len++] = ' ';
- line[len] = '\0';
- }
- output += line;
-
- text = getNextTextLine(text, line, TEXTBOX_WIDTH - 2);
- }
-
- return output;
-}
-
-SharedPtr<TextBitmap> StarTrekEngine::initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite) {
- int linesBeforeTextStart = 2;
- if (withHeader)
- linesBeforeTextStart = 4;
-
- int xoffset = *xoffsetPtr;
- int yoffset = *yoffsetPtr;
-
- int textHeight = numTextLines + linesBeforeTextStart;
-
- SharedPtr<TextBitmap> bitmap(new TextBitmap(TEXTBOX_WIDTH * 8, textHeight * 8));
-
- *sprite = Sprite();
- sprite->drawPriority = 15;
- sprite->drawPriority2 = 8;
- sprite->bitmap = bitmap;
- sprite->textColor = textColor;
-
- memset(bitmap->pixels, ' ', textHeight * TEXTBOX_WIDTH);
-
- int varC = SCREEN_WIDTH - 1 - xoffset - (bitmap->width + 0x1d) / 2;
- if (varC < 0)
- xoffset += varC;
-
- varC = xoffset - (bitmap->width + 0x1d) / 2;
- if (varC < 1)
- xoffset -= varC - 1;
-
- varC = yoffset - (bitmap->height + 0x11) - 20;
- if (varC < 0)
- yoffset -= varC;
-
- xoffset -= (bitmap->width + 0x1d) / 2;
- yoffset -= bitmap->height;
-
- bitmap->pixels[0] = 0x10;
- memset(&bitmap->pixels[1], 0x11, TEXTBOX_WIDTH - 2);
- bitmap->pixels[TEXTBOX_WIDTH - 1] = 0x12;
-
- byte *textAddr = bitmap->pixels + TEXTBOX_WIDTH;
-
- if (withHeader) {
- textAddr[0] = 0x13;
- textAddr[TEXTBOX_WIDTH - 1] = 0x14;
- textAddr += TEXTBOX_WIDTH;
-
- textAddr[0] = 0x13;
- memset(&textAddr[1], 0x19, TEXTBOX_WIDTH - 2);
- textAddr[TEXTBOX_WIDTH - 1] = 0x14;
- textAddr += TEXTBOX_WIDTH;
- }
-
- for (int line = 0; line < numTextLines; line++) {
- textAddr[0] = 0x13;
- textAddr[TEXTBOX_WIDTH - 1] = 0x14;
- textAddr += TEXTBOX_WIDTH;
- }
-
- textAddr[0] = 0x15;
- memset(&textAddr[1], 0x16, TEXTBOX_WIDTH - 2);
- textAddr[TEXTBOX_WIDTH - 1] = 0x17;
-
- _gfx->addSprite(sprite);
- sprite->drawMode = 3;
- sprite->pos.x = xoffset;
- sprite->pos.y = yoffset;
- sprite->drawPriority = 15;
-
- *xoffsetPtr = xoffset;
- *yoffsetPtr = yoffset;
-
- return bitmap;
-}
-
-void StarTrekEngine::drawMainText(SharedPtr<TextBitmap> bitmap, int numTextLines, int numTextboxLines, const String &_text, bool withHeader) {
- byte *dest = bitmap->pixels + TEXTBOX_WIDTH + 1; // Start of 2nd row
- const char *text = _text.c_str();
-
- if (numTextLines >= numTextboxLines)
- numTextLines = numTextboxLines;
-
- if (withHeader)
- dest += TEXTBOX_WIDTH * 2; // Start of 4th row
-
- int lineIndex = 0;
- while (lineIndex != numTextLines) {
- memcpy(dest, text, TEXTBOX_WIDTH - 2);
- text += TEXTBOX_WIDTH - 2;
- dest += TEXTBOX_WIDTH;
- lineIndex++;
- }
-
- // Fill all remaining blank lines
- while (lineIndex != numTextboxLines) {
- memset(dest, ' ', TEXTBOX_WIDTH - 2);
- dest += TEXTBOX_WIDTH;
- lineIndex++;
- }
-}
-
-String StarTrekEngine::readLineFormattedText(TextGetterFunc textGetter, uintptr var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numTextLines) {
- String headerText;
- String text = (this->*textGetter)(choiceIndex, var, &headerText);
-
- if (_textDisplayMode == TEXTDISPLAY_NONE && _sfxEnabled && _sfxWorking) {
- uint32 oldSize = text.size();
- text = playTextAudio(text);
- if (oldSize != text.size())
- _textboxHasMultipleChoices = true;
- } else if ((_textDisplayMode == TEXTDISPLAY_WAIT || _textDisplayMode == TEXTDISPLAY_SUBTITLES)
- && _sfxEnabled && _sfxWorking) {
- text = playTextAudio(text);
- } else {
- text = skipTextAudioPrompt(text);
- }
-
- if (_textboxHasMultipleChoices) {
- *numTextLines = getNumTextboxLines(text);
-
- bool hasHeader = !headerText.empty();
-
- String lineFormattedText = putTextIntoLines(text);
- drawMainText(textBitmap, *numTextLines, numTextboxLines, lineFormattedText, hasHeader);
-
- memcpy(textBitmap->pixels + TEXTBOX_WIDTH + 1, headerText.c_str(), headerText.size());
-
- return lineFormattedText;
- } else
- return nullptr;
-}
-
-String StarTrekEngine::readTextFromArray(int choiceIndex, uintptr data, String *headerTextOutput) {
- const char **textArray = (const char **)data;
-
- const char *headerText = textArray[0];
- const char *mainText = textArray[choiceIndex + 1];
-
- if (*mainText == '\0')
- return Common::String(); // Technically should be nullptr...
-
- if (headerText == nullptr)
- *headerTextOutput = "";
- else
- *headerTextOutput = centerTextboxHeader(headerText);
- return String(mainText);
-}
-
-String StarTrekEngine::readTextFromArrayWithChoices(int choiceIndex, uintptr data, String *headerTextOutput) {
- const char **textArray = (const char **)data;
-
- const char *headerText = textArray[0];
- const char *mainText = textArray[choiceIndex + 1];
-
- if (*mainText == '\0')
- return Common::String(); // Technically should be nullptr...
-
- if (headerTextOutput != nullptr) {
- if (headerText == nullptr || headerText[0] == '\0')
- *headerTextOutput = "";
- else {
- if (textArray[2] != nullptr && textArray[2][0] != '\0') // More than one choice
- getTextboxHeader(headerTextOutput, headerText, choiceIndex + 1);
- else
- getTextboxHeader(headerTextOutput, headerText, 0);
- }
- }
- return String(mainText);
-}
-
-Common::String StarTrekEngine::showCodeInputBox() {
- memset(_textInputBuffer, 0, TEXT_INPUT_BUFFER_SIZE - 1);
- return showTextInputBox(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, "Code:\n ");
-}
-
-void StarTrekEngine::redrawTextInput() {
- char buf[MAX_TEXT_INPUT_LEN * 2 + 2];
- memset(buf, 0, MAX_TEXT_INPUT_LEN * 2);
- strcpy(buf, _textInputBuffer);
-
- if (_textInputCursorChar != 0)
- buf[_textInputCursorPos] = _textInputCursorChar;
-
- memcpy(_textInputBitmap->pixels, _textInputBitmapSkeleton->pixels, _textInputBitmapSkeleton->width * _textInputBitmapSkeleton->height);
-
- drawTextLineToBitmap(buf, MAX_TEXT_INPUT_LEN, 4, 12, _textInputBitmap);
- _textInputSprite.bitmapChanged = true;
- _gfx->drawAllSprites();
-}
-
-void StarTrekEngine::addCharToTextInputBuffer(char c) {
- Common::String str(_textInputBuffer);
- while ((int)str.size() < _textInputCursorPos) {
- str += " ";
- }
-
- str.insertChar(c, _textInputCursorPos);
-
- strncpy(_textInputBuffer, str.c_str(), MAX_TEXT_INPUT_LEN);
- _textInputBuffer[MAX_TEXT_INPUT_LEN] = '\0';
-}
-
-Common::String StarTrekEngine::showTextInputBox(int16 x, int16 y, const Common::String &headerText) {
- bool validInput = false;
-
- _keyboardControlsMouse = false;
- _textInputCursorPos = 0;
-
- initTextInputSprite(x, y, headerText);
-
- bool loop = true;
-
- while (loop) {
- TrekEvent event;
- if (!popNextEvent(&event))
- continue;
-
- switch (event.type) {
- case TREKEVENT_TICK:
- _gfx->incPaletteFadeLevel();
- _frameIndex++;
- _textInputCursorChar = (_frameIndex & 2 ? 1 : 0);
- redrawTextInput();
- break;
-
- case TREKEVENT_LBUTTONDOWN:
- redrawTextInput();
- validInput = true;
- loop = false;
- break;
-
- case TREKEVENT_RBUTTONDOWN:
- loop = false;
- break;
-
- case TREKEVENT_KEYDOWN:
- switch (event.kbd.keycode) {
- case Common::KEYCODE_BACKSPACE:
- if (_textInputCursorPos > 0) {
- _textInputCursorPos--;
- Common::String str(_textInputBuffer);
- str.deleteChar(_textInputCursorPos);
- strcpy(_textInputBuffer, str.c_str());
- }
- redrawTextInput();
- break;
-
- case Common::KEYCODE_DELETE: { // ENHANCEMENT: Support delete key
- Common::String str(_textInputBuffer);
- if (_textInputCursorPos < (int)str.size()) {
- str.deleteChar(_textInputCursorPos);
- strcpy(_textInputBuffer, str.c_str());
- redrawTextInput();
- }
- break;
- }
-
- case Common::KEYCODE_RETURN:
- case Common::KEYCODE_KP_ENTER:
- case Common::KEYCODE_F1:
- redrawTextInput();
- loop = false;
- validInput = true;
- break;
-
- case Common::KEYCODE_ESCAPE:
- case Common::KEYCODE_F2:
- loop = false;
- break;
-
- case Common::KEYCODE_HOME:
- case Common::KEYCODE_KP7:
- _textInputCursorPos = 0;
- break;
-
- case Common::KEYCODE_LEFT:
- case Common::KEYCODE_KP4:
- if (_textInputCursorPos > 0)
- _textInputCursorPos--;
- redrawTextInput();
- break;
-
- case Common::KEYCODE_RIGHT:
- case Common::KEYCODE_KP6:
- if (_textInputCursorPos < MAX_TEXT_INPUT_LEN - 1)
- _textInputCursorPos++;
- redrawTextInput();
- break;
-
- case Common::KEYCODE_END:
- case Common::KEYCODE_KP1:
- _textInputCursorPos = strlen(_textInputBuffer);
- // BUGFIX: Check that it doesn't exceed the buffer length.
- // Original game had a bug where you could crash the game by pressing
- // "end", writing a character, pressing "end" again, etc.
- if (_textInputCursorPos >= MAX_TEXT_INPUT_LEN)
- _textInputCursorPos = MAX_TEXT_INPUT_LEN - 1;
- break;
-
- default: // Typed any other character
- if (_gfx->_font->isDisplayableCharacter(event.kbd.ascii)) {
- addCharToTextInputBuffer(event.kbd.ascii);
- if (_textInputCursorPos < MAX_TEXT_INPUT_LEN - 1)
- _textInputCursorPos++;
- redrawTextInput();
- }
- break;
- }
- break;
-
- default:
- break;
- }
- }
-
- cleanupTextInputSprite();
- _keyboardControlsMouse = true;
-
- if (validInput)
- return _textInputBuffer;
- else
- return "";
-}
-
-void StarTrekEngine::initTextInputSprite(int16 textboxX, int16 textboxY, const Common::String &headerText) {
- int headerLen = headerText.size();
-
- if (headerLen > 25)
- headerLen = 25;
-
- char textBuf[TEXTBOX_WIDTH * 11 + 1];
- const char *headerPos = headerText.c_str();
- int row = 0;
-
- /*
- // TODO: investigate this (might be unused...)
- if (word_53100 != 0) {
- // ...
- }
- */
-
- do {
- headerPos = getNextTextLine(headerPos, textBuf + row * TEXTBOX_WIDTH, headerLen);
- row++;
- } while (headerPos != 0 && row < 11);
-
- int16 width = headerLen * 8 + 8;
- int16 height = row * 8 + 8;
-
- _textInputBitmapSkeleton = SharedPtr<Bitmap>(new Bitmap(width, height));
- _textInputBitmap = SharedPtr<Bitmap>(new Bitmap(width, height));
-
- _textInputBitmapSkeleton->xoffset = width / 2;
- if (textboxX + width / 2 >= SCREEN_WIDTH)
- _textInputBitmapSkeleton->xoffset += width / 2 + textboxX - (SCREEN_WIDTH - 1);
- if (textboxX - width / 2 < 0)
- _textInputBitmapSkeleton->xoffset -= 0 - (textboxX - width / 2);
-
- _textInputBitmapSkeleton->yoffset = height + 20;
- memset(_textInputBitmapSkeleton->pixels, 0, width * height);
-
- // Top border
- int16 xPos = 1;
- int16 yPos = 1;
- while (xPos < width - 1) {
- _textInputBitmapSkeleton->pixels[yPos * width + xPos] = 0x78;
- xPos++;
- }
-
- // Bottom border
- xPos = 1;
- yPos = height - 2;
- while (xPos < width - 1) {
- _textInputBitmapSkeleton->pixels[yPos * width + xPos] = 0x78;
- xPos++;
- }
-
- // Left border
- xPos = 1;
- yPos = 1;
- while (yPos < height - 1) {
- _textInputBitmapSkeleton->pixels[yPos * width + xPos] = 0x78;
- yPos++;
- }
-
- // Right border
- xPos = width - 2;
- yPos = 1;
- while (yPos < height - 1) {
- _textInputBitmapSkeleton->pixels[yPos * width + xPos] = 0x78;
- yPos++;
- }
-
- // Draw header text
- for (int r = 0; r < row; r++) {
- char *text = textBuf + r * TEXTBOX_WIDTH;
- drawTextLineToBitmap(text, strlen(text), 4, r * 8 + 4, _textInputBitmapSkeleton);
- }
-
- // Copy skeleton bitmap to actual used bitmap
- _textInputBitmap->xoffset = _textInputBitmapSkeleton->xoffset;
- _textInputBitmap->yoffset = _textInputBitmapSkeleton->yoffset;
- memcpy(_textInputBitmap->pixels, _textInputBitmapSkeleton->pixels, width * height);
-
- _gfx->addSprite(&_textInputSprite);
- _textInputSprite.drawMode = 2;
- _textInputSprite.field8 = "System";
- _textInputSprite.bitmap = _textInputBitmap;
- _textInputSprite.setXYAndPriority(textboxX, textboxY, 15);
- _textInputSprite.drawPriority2 = 8;
- _gfx->drawAllSprites();
-}
-
-void StarTrekEngine::cleanupTextInputSprite() {
- _textInputSprite.dontDrawNextFrame();
- _gfx->drawAllSprites();
- _gfx->delSprite(&_textInputSprite);
-
- _textInputSprite.bitmap.reset();
- _textInputBitmapSkeleton.reset();
- _textInputBitmap.reset();
-}
-
-}
diff --git a/engines/startrek/textbox.cpp b/engines/startrek/textbox.cpp
new file mode 100644
index 0000000..1a05ecc
--- /dev/null
+++ b/engines/startrek/textbox.cpp
@@ -0,0 +1,933 @@
+/* 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 "common/events.h"
+#include "common/stream.h"
+#include "graphics/cursorman.h"
+
+#include "startrek/graphics.h"
+#include "startrek/room.h"
+
+
+namespace StarTrek {
+
+const char *StarTrekEngine::getNextTextLine(const char *text, char *lineOutput, int lineWidth) {
+ *lineOutput = '\0';
+ if (*text == '\0')
+ return nullptr;
+
+ const char *lastSpaceInput = nullptr;
+ char *lastSpaceOutput = nullptr;
+ int charIndex = 0;
+
+ while (charIndex != lineWidth && *text != '\0') {
+ char c = *text;
+
+ if (c == '\n') {
+ *lineOutput = '\0';
+ return text + 1;
+ }
+
+ if (c == ' ') {
+ lastSpaceInput = text;
+ lastSpaceOutput = lineOutput;
+ }
+
+ if (c == '\r') {
+ text++;
+ charIndex--;
+ } else {
+ text++;
+ *(lineOutput++) = c;
+ }
+ charIndex++;
+ }
+
+ if (*text == '\0') {
+ *lineOutput = '\0';
+ return text;
+ }
+ if (*text == ' ') {
+ *lineOutput = '\0';
+ return text + 1;
+ }
+ if (lastSpaceOutput == nullptr) { // Long word couldn't fit on line
+ *lineOutput = '\0';
+ return text;
+ }
+
+ // In the middle of a word; must go back to the start of it
+ *lastSpaceOutput = '\0';
+ return lastSpaceInput + 1;
+}
+
+void StarTrekEngine::drawTextLineToBitmap(const char *text, int textLen, int x, int y, SharedPtr<Bitmap> bitmap) {
+ const int charWidth = 8;
+
+ int textOffset = 0;
+
+ while (textOffset < textLen) {
+ Common::Rect destRect(x, y, x + 8, y + 8);
+ Common::Rect bitmapRect(bitmap->width, bitmap->height);
+
+ if (destRect.intersects(bitmapRect)) {
+ // drawRect = the rectangle within the 8x8 font character that will be drawn
+ // (part of it may be clipped)
+ Common::Rect drawRect;
+ drawRect.left = bitmapRect.left - destRect.left;
+ if (drawRect.left < destRect.left - destRect.left)
+ drawRect.left = destRect.left - destRect.left;
+
+ drawRect.right = bitmapRect.right - destRect.left;
+ if (drawRect.right > destRect.right - destRect.left)
+ drawRect.right = destRect.right - destRect.left;
+
+ drawRect.top = bitmapRect.top - destRect.top;
+ if (drawRect.top < destRect.top - destRect.top)
+ drawRect.top = destRect.top - destRect.top;
+
+ drawRect.bottom = bitmapRect.bottom - destRect.top;
+ if (drawRect.bottom > destRect.bottom - destRect.top)
+ drawRect.bottom = destRect.bottom - destRect.top;
+
+
+ int16 destX = destRect.left - bitmapRect.left;
+ if (destX < bitmapRect.right - bitmapRect.right)
+ destX = bitmapRect.right - bitmapRect.right;
+
+ int16 destY = destRect.top - bitmapRect.top;
+ if (destY < bitmapRect.top - bitmapRect.top)
+ destY = bitmapRect.top - bitmapRect.top;
+
+ int16 srcRowDiff = charWidth - drawRect.width();
+ int16 destRowDiff = bitmapRect.width() - drawRect.width();
+
+ byte *srcPixels = _gfx->getFontGfx(text[textOffset]) + drawRect.top * charWidth + drawRect.left;
+ byte *destPixels = bitmap->pixels + destY * bitmapRect.width() + destX;
+
+ for (int i = 0; i < drawRect.height(); i++) {
+ memcpy(destPixels, srcPixels, drawRect.width());
+ destPixels += destRowDiff + drawRect.width();
+ srcPixels += srcRowDiff + drawRect.width();
+ }
+ }
+
+ x += charWidth;
+ textOffset++;
+ }
+}
+
+String StarTrekEngine::centerTextboxHeader(String headerText) {
+ char text[TEXT_CHARS_PER_LINE + 1];
+ memset(text, ' ', sizeof(text));
+ text[TEXT_CHARS_PER_LINE] = '\0';
+
+ int strlen = headerText.size();
+ strlen = min(strlen, TEXT_CHARS_PER_LINE);
+
+ memcpy(text + (TEXT_CHARS_PER_LINE - strlen) / 2, headerText.c_str(), strlen);
+
+ return Common::String(text);
+}
+
+void StarTrekEngine::getTextboxHeader(String *headerTextOutput, String speakerText, int choiceIndex) {
+ String header = speakerText;
+
+ if (choiceIndex != 0)
+ header += String::format(" choice %d", choiceIndex);
+
+ *headerTextOutput = centerTextboxHeader(header);
+}
+
+String StarTrekEngine::readTextFromRdf(int choiceIndex, uintptr data, String *headerTextOutput) {
+ SharedPtr<Room> room = getRoom();
+
+ int rdfVar = (size_t)data;
+
+ uint16 textOffset = room->readRdfWord(rdfVar + (choiceIndex + 1) * 2);
+
+ if (textOffset == 0)
+ return "";
+
+ if (headerTextOutput != nullptr) {
+ uint16 speakerOffset = room->readRdfWord(rdfVar);
+ if (speakerOffset == 0 || room->_rdfData[speakerOffset] == '\0')
+ *headerTextOutput = "";
+ else {
+ char *speakerText = (char *)&room->_rdfData[speakerOffset];
+ if (room->readRdfWord(rdfVar + 4) != 0) // Check if there's more than one option
+ getTextboxHeader(headerTextOutput, speakerText, choiceIndex + 1);
+ else
+ getTextboxHeader(headerTextOutput, speakerText, 0);
+ }
+ }
+
+ return (char *)&room->_rdfData[textOffset];
+}
+
+void StarTrekEngine::showTextbox(String headerText, const String &mainText, int xoffset, int yoffset, byte textColor, int maxTextLines) {
+ if (!headerText.empty())
+ headerText = centerTextboxHeader(headerText);
+
+ int actionParam = (maxTextLines < 0 ? 0 : maxTextLines);
+
+ if (maxTextLines < 0)
+ maxTextLines = -maxTextLines;
+
+ const char *strings[3];
+
+ if (headerText.empty())
+ strings[0] = nullptr;
+ else
+ strings[0] = headerText.c_str();
+ strings[1] = mainText.c_str();
+ strings[2] = "";
+
+ showText(&StarTrekEngine::readTextFromArray, (uintptr)strings, xoffset, yoffset, textColor, false, maxTextLines, false);
+
+ if (actionParam != 0)
+ addAction(ACTION_TALK, actionParam, 0, 0);
+}
+
+String StarTrekEngine::skipTextAudioPrompt(const String &str) {
+ const char *text = str.c_str();
+
+ if (*text != '#')
+ return str;
+
+ text++;
+ while (*text != '#') {
+ if (*text == '\0')
+ return str;
+ text++;
+ }
+
+ return String(text + 1);
+}
+
+String StarTrekEngine::playTextAudio(const String &str) {
+ const char *text = str.c_str();
+ char soundFile[0x100];
+
+ if (*text != '#')
+ return str;
+
+ int len = 0;
+ text++;
+ while (*text != '#') {
+ if (*text == '\0' || len > 0xfa)
+ return str;
+ soundFile[len++] = *text++;
+ }
+
+ soundFile[len] = '\0';
+ playSpeech(soundFile);
+
+ return String(text + 1);
+}
+
+int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, bool rclickCancelsChoice) {
+ int16 tmpTextDisplayMode = _textDisplayMode;
+
+ uint32 ticksUntilClickingEnabled = 8;
+ if (_frameIndex > _textboxVar2 + 1) {
+ ticksUntilClickingEnabled = 0x10;
+ }
+
+ int numChoicesWithNames = 0;
+ int numTextboxLines = 0;
+ int numChoices = 0;
+ String speakerText;
+
+ while (true) {
+ String choiceText = (this->*textGetter)(numChoices, var, &speakerText);
+ if (choiceText.empty())
+ break;
+
+ int lines = getNumTextboxLines(skipTextAudioPrompt(choiceText));
+ if (lines > numTextboxLines)
+ numTextboxLines = lines;
+
+ if (!speakerText.empty()) // FIXME: Technically should check for nullptr
+ numChoicesWithNames++;
+
+ numChoices++;
+ }
+
+ if (maxTextLines == 0 || maxTextLines > MAX_TEXTBOX_LINES)
+ maxTextLines = MAX_TEXTBOX_LINES;
+ if (numTextboxLines > maxTextLines)
+ numTextboxLines = maxTextLines;
+
+ if (numChoicesWithNames != 0 && numChoices != numChoicesWithNames)
+ error("showText: Not all choices have titles.");
+
+ Sprite textboxSprite;
+ SharedPtr<TextBitmap> textBitmap = initTextSprite(&xoffset, &yoffset, textColor, numTextboxLines, numChoicesWithNames, &textboxSprite);
+
+ int choiceIndex = 0;
+ int scrollOffset = 0;
+ if (tmpTextDisplayMode != TEXTDISPLAY_WAIT && tmpTextDisplayMode != TEXTDISPLAY_SUBTITLES
+ && numChoices == 1 && _sfxEnabled && !_sfxWorking)
+ _textboxHasMultipleChoices = false;
+ else
+ _textboxHasMultipleChoices = true;
+
+ if (tmpTextDisplayMode >= TEXTDISPLAY_WAIT && tmpTextDisplayMode <= TEXTDISPLAY_NONE
+ && _sfxEnabled && !_sfxWorking)
+ _textboxVar6 = true;
+ else
+ _textboxVar6 = false;
+
+ int numTextLines;
+ String lineFormattedText = readLineFormattedText(textGetter, var, choiceIndex, textBitmap, numTextboxLines, &numTextLines);
+
+ if (lineFormattedText.empty()) { // Technically should check for nullptr
+ _gfx->delSprite(&textboxSprite);
+
+ // TODO
+ } else {
+ loadMenuButtons("textbtns", xoffset + 0x96, yoffset - 0x11);
+
+ Common::Point oldMousePos = _gfx->getMousePos();
+ SharedPtr<Bitmap> oldMouseBitmap = _gfx->getMouseBitmap();
+
+ _gfx->warpMouse(xoffset + 0xde, yoffset - 0x08);
+ _gfx->setMouseBitmap(_gfx->loadBitmap("pushbtn"));
+
+ bool tmpMouseControllingShip = _mouseControllingShip;
+ _mouseControllingShip = false;
+
+ // Decide which buttons to show
+ uint32 visibleButtons = (1 << TEXTBUTTON_CONFIRM);
+ if (numChoices > 1)
+ visibleButtons |= (1 << TEXTBUTTON_PREVCHOICE) | (1 << TEXTBUTTON_NEXTCHOICE);
+ if (numTextLines > numTextboxLines)
+ visibleButtons |= (1 << TEXTBUTTON_SCROLLUP) | (1 << TEXTBUTTON_SCROLLDOWN);
+ setVisibleMenuButtons(visibleButtons);
+
+ disableMenuButtons(1 << TEXTBUTTON_SCROLLUP); // Disable scroll up
+
+ if (ticksUntilClickingEnabled != 0) // Disable done button
+ disableMenuButtons(1 << TEXTBUTTON_CONFIRM);
+
+ if (!loopChoices) // Disable prev button
+ disableMenuButtons(1 << TEXTBUTTON_PREVCHOICE);
+
+ bool doneShowingText = false;
+
+ // Loop until text is done being displayed
+ while (!doneShowingText) {
+ int textboxReturnCode = handleMenuEvents(ticksUntilClickingEnabled, true);
+
+ if (ticksUntilClickingEnabled != 0)
+ enableMenuButtons(1 << TEXTBUTTON_CONFIRM);
+
+ switch (textboxReturnCode) {
+
+ case MENUEVENT_RCLICK_OFFBUTTON:
+ case MENUEVENT_RCLICK_ONBUTTON:
+ if (ticksUntilClickingEnabled == 0) {
+ doneShowingText = true;
+ if (rclickCancelsChoice)
+ choiceIndex = -1;
+ }
+ break;
+
+ case TEXTBUTTON_CONFIRM:
+ doneShowingText = true;
+ break;
+
+ case TEXTBUTTON_SCROLLUP:
+ scrollOffset -= numTextboxLines;
+ goto readjustScrollUp;
+
+ case TEXTBUTTON_SCROLLDOWN:
+ scrollOffset += numTextboxLines;
+ goto readjustScrollDown;
+
+ case TEXTBUTTON_SCROLLUP_ONELINE:
+ scrollOffset--;
+ goto readjustScrollUp;
+
+ case TEXTBUTTON_SCROLLDOWN_ONELINE:
+ scrollOffset++;
+ goto readjustScrollDown;
+
+ case TEXTBUTTON_GOTO_TOP:
+ scrollOffset = 0;
+ goto readjustScrollUp;
+
+ case TEXTBUTTON_GOTO_BOTTOM:
+ scrollOffset = numTextLines - numTextboxLines;
+ goto readjustScrollDown;
+
+readjustScrollUp:
+ enableMenuButtons(1 << TEXTBUTTON_SCROLLDOWN);
+ if (scrollOffset < 0)
+ scrollOffset = 0;
+ if (scrollOffset == 0)
+ disableMenuButtons(1 << TEXTBUTTON_SCROLLUP);
+ goto readjustScroll;
+
+readjustScrollDown:
+ enableMenuButtons(1 << TEXTBUTTON_SCROLLUP);
+ if (scrollOffset >= numTextLines)
+ scrollOffset -= numTextboxLines;
+ if (scrollOffset > numTextLines - 1)
+ scrollOffset = numTextLines - 1;
+ if (scrollOffset + numTextboxLines >= numTextLines)
+ disableMenuButtons(1 << TEXTBUTTON_SCROLLDOWN);
+ goto readjustScroll;
+
+readjustScroll:
+ textboxSprite.bitmapChanged = true;
+ drawMainText(
+ textBitmap,
+ numTextLines - scrollOffset,
+ numTextboxLines,
+ lineFormattedText.c_str() + scrollOffset * (TEXTBOX_WIDTH - 2),
+ numChoicesWithNames != 0);
+ break;
+
+ case TEXTBUTTON_PREVCHOICE:
+ choiceIndex--;
+ if (!loopChoices && choiceIndex == 0) {
+ disableMenuButtons(1 << TEXTBUTTON_PREVCHOICE);
+ } else {
+ if (choiceIndex < 0)
+ choiceIndex = numChoices - 1;
+ }
+ enableMenuButtons(1 << TEXTBUTTON_NEXTCHOICE);
+ goto reloadText;
+
+ case TEXTBUTTON_NEXTCHOICE:
+ enableMenuButtons(1 << TEXTBUTTON_PREVCHOICE);
+ choiceIndex++;
+ if (!loopChoices && choiceIndex == numChoices - 1) {
+ disableMenuButtons(1 << TEXTBUTTON_NEXTCHOICE);
+ } else {
+ choiceIndex %= numChoices;
+ }
+ goto reloadText;
+
+reloadText:
+ scrollOffset = 0;
+ lineFormattedText = readLineFormattedText(textGetter, var, choiceIndex, textBitmap, numTextboxLines, &numTextLines);
+ if (numTextLines <= numTextboxLines) {
+ setVisibleMenuButtons((1 << TEXTBUTTON_CONFIRM) | (1 << TEXTBUTTON_PREVCHOICE) | (1 << TEXTBUTTON_NEXTCHOICE));
+ } else {
+ setVisibleMenuButtons((1 << TEXTBUTTON_CONFIRM) | (1 << TEXTBUTTON_SCROLLUP) | (1 << TEXTBUTTON_SCROLLDOWN) | (1 << TEXTBUTTON_PREVCHOICE) | (1 << TEXTBUTTON_NEXTCHOICE));
+ }
+ enableMenuButtons(1 << TEXTBUTTON_SCROLLDOWN);
+ disableMenuButtons(1 << TEXTBUTTON_SCROLLUP);
+ textboxSprite.bitmapChanged = true;
+ break;
+
+ case TEXTBUTTON_SPEECH_DONE:
+ if (numChoices == 1)
+ doneShowingText = true;
+ break;
+
+ case MENUEVENT_ENABLEINPUT:
+ case MENUEVENT_LCLICK_OFFBUTTON:
+ default:
+ break;
+ }
+
+ ticksUntilClickingEnabled = 0;
+ }
+
+ _gfx->setMouseBitmap(oldMouseBitmap);
+ _gfx->warpMouse(oldMousePos.x, oldMousePos.y);
+
+ _mouseControllingShip = tmpMouseControllingShip;
+ unloadMenuButtons();
+
+ textboxSprite.dontDrawNextFrame();
+ _gfx->drawAllSprites();
+ _gfx->delSprite(&textboxSprite);
+ }
+
+ _textboxVar2 = _frameIndex;
+ stopPlayingSpeech();
+ return choiceIndex;
+}
+
+int StarTrekEngine::getNumTextboxLines(const String &str) {
+ const char *text = str.c_str();
+ char line[TEXTBOX_WIDTH];
+
+ int lines = 0;
+
+ while (text != nullptr) {
+ text = getNextTextLine(text, line, TEXTBOX_WIDTH - 2);
+ lines++;
+ }
+ return lines - 1;
+}
+
+String StarTrekEngine::putTextIntoLines(const String &_text) {
+ char line[TEXTBOX_WIDTH];
+
+ const char *text = _text.c_str();
+ String output;
+
+ text = getNextTextLine(text, line, TEXTBOX_WIDTH - 2);
+
+ while (text != nullptr) {
+ int len = strlen(line);
+ while (len != TEXTBOX_WIDTH - 2) {
+ line[len++] = ' ';
+ line[len] = '\0';
+ }
+ output += line;
+
+ text = getNextTextLine(text, line, TEXTBOX_WIDTH - 2);
+ }
+
+ return output;
+}
+
+SharedPtr<TextBitmap> StarTrekEngine::initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite) {
+ int linesBeforeTextStart = 2;
+ if (withHeader)
+ linesBeforeTextStart = 4;
+
+ int xoffset = *xoffsetPtr;
+ int yoffset = *yoffsetPtr;
+
+ int textHeight = numTextLines + linesBeforeTextStart;
+
+ SharedPtr<TextBitmap> bitmap(new TextBitmap(TEXTBOX_WIDTH * 8, textHeight * 8));
+
+ *sprite = Sprite();
+ sprite->drawPriority = 15;
+ sprite->drawPriority2 = 8;
+ sprite->bitmap = bitmap;
+ sprite->textColor = textColor;
+
+ memset(bitmap->pixels, ' ', textHeight * TEXTBOX_WIDTH);
+
+ int varC = SCREEN_WIDTH - 1 - xoffset - (bitmap->width + 0x1d) / 2;
+ if (varC < 0)
+ xoffset += varC;
+
+ varC = xoffset - (bitmap->width + 0x1d) / 2;
+ if (varC < 1)
+ xoffset -= varC - 1;
+
+ varC = yoffset - (bitmap->height + 0x11) - 20;
+ if (varC < 0)
+ yoffset -= varC;
+
+ xoffset -= (bitmap->width + 0x1d) / 2;
+ yoffset -= bitmap->height;
+
+ bitmap->pixels[0] = 0x10;
+ memset(&bitmap->pixels[1], 0x11, TEXTBOX_WIDTH - 2);
+ bitmap->pixels[TEXTBOX_WIDTH - 1] = 0x12;
+
+ byte *textAddr = bitmap->pixels + TEXTBOX_WIDTH;
+
+ if (withHeader) {
+ textAddr[0] = 0x13;
+ textAddr[TEXTBOX_WIDTH - 1] = 0x14;
+ textAddr += TEXTBOX_WIDTH;
+
+ textAddr[0] = 0x13;
+ memset(&textAddr[1], 0x19, TEXTBOX_WIDTH - 2);
+ textAddr[TEXTBOX_WIDTH - 1] = 0x14;
+ textAddr += TEXTBOX_WIDTH;
+ }
+
+ for (int line = 0; line < numTextLines; line++) {
+ textAddr[0] = 0x13;
+ textAddr[TEXTBOX_WIDTH - 1] = 0x14;
+ textAddr += TEXTBOX_WIDTH;
+ }
+
+ textAddr[0] = 0x15;
+ memset(&textAddr[1], 0x16, TEXTBOX_WIDTH - 2);
+ textAddr[TEXTBOX_WIDTH - 1] = 0x17;
+
+ _gfx->addSprite(sprite);
+ sprite->drawMode = 3;
+ sprite->pos.x = xoffset;
+ sprite->pos.y = yoffset;
+ sprite->drawPriority = 15;
+
+ *xoffsetPtr = xoffset;
+ *yoffsetPtr = yoffset;
+
+ return bitmap;
+}
+
+void StarTrekEngine::drawMainText(SharedPtr<TextBitmap> bitmap, int numTextLines, int numTextboxLines, const String &_text, bool withHeader) {
+ byte *dest = bitmap->pixels + TEXTBOX_WIDTH + 1; // Start of 2nd row
+ const char *text = _text.c_str();
+
+ if (numTextLines >= numTextboxLines)
+ numTextLines = numTextboxLines;
+
+ if (withHeader)
+ dest += TEXTBOX_WIDTH * 2; // Start of 4th row
+
+ int lineIndex = 0;
+ while (lineIndex != numTextLines) {
+ memcpy(dest, text, TEXTBOX_WIDTH - 2);
+ text += TEXTBOX_WIDTH - 2;
+ dest += TEXTBOX_WIDTH;
+ lineIndex++;
+ }
+
+ // Fill all remaining blank lines
+ while (lineIndex != numTextboxLines) {
+ memset(dest, ' ', TEXTBOX_WIDTH - 2);
+ dest += TEXTBOX_WIDTH;
+ lineIndex++;
+ }
+}
+
+String StarTrekEngine::readLineFormattedText(TextGetterFunc textGetter, uintptr var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numTextLines) {
+ String headerText;
+ String text = (this->*textGetter)(choiceIndex, var, &headerText);
+
+ if (_textDisplayMode == TEXTDISPLAY_NONE && _sfxEnabled && _sfxWorking) {
+ uint32 oldSize = text.size();
+ text = playTextAudio(text);
+ if (oldSize != text.size())
+ _textboxHasMultipleChoices = true;
+ } else if ((_textDisplayMode == TEXTDISPLAY_WAIT || _textDisplayMode == TEXTDISPLAY_SUBTITLES)
+ && _sfxEnabled && _sfxWorking) {
+ text = playTextAudio(text);
+ } else {
+ text = skipTextAudioPrompt(text);
+ }
+
+ if (_textboxHasMultipleChoices) {
+ *numTextLines = getNumTextboxLines(text);
+
+ bool hasHeader = !headerText.empty();
+
+ String lineFormattedText = putTextIntoLines(text);
+ drawMainText(textBitmap, *numTextLines, numTextboxLines, lineFormattedText, hasHeader);
+
+ memcpy(textBitmap->pixels + TEXTBOX_WIDTH + 1, headerText.c_str(), headerText.size());
+
+ return lineFormattedText;
+ } else
+ return nullptr;
+}
+
+String StarTrekEngine::readTextFromArray(int choiceIndex, uintptr data, String *headerTextOutput) {
+ const char **textArray = (const char **)data;
+
+ const char *headerText = textArray[0];
+ const char *mainText = textArray[choiceIndex + 1];
+
+ if (*mainText == '\0')
+ return Common::String(); // Technically should be nullptr...
+
+ if (headerText == nullptr)
+ *headerTextOutput = "";
+ else
+ *headerTextOutput = centerTextboxHeader(headerText);
+ return String(mainText);
+}
+
+String StarTrekEngine::readTextFromArrayWithChoices(int choiceIndex, uintptr data, String *headerTextOutput) {
+ const char **textArray = (const char **)data;
+
+ const char *headerText = textArray[0];
+ const char *mainText = textArray[choiceIndex + 1];
+
+ if (*mainText == '\0')
+ return Common::String(); // Technically should be nullptr...
+
+ if (headerTextOutput != nullptr) {
+ if (headerText == nullptr || headerText[0] == '\0')
+ *headerTextOutput = "";
+ else {
+ if (textArray[2] != nullptr && textArray[2][0] != '\0') // More than one choice
+ getTextboxHeader(headerTextOutput, headerText, choiceIndex + 1);
+ else
+ getTextboxHeader(headerTextOutput, headerText, 0);
+ }
+ }
+ return String(mainText);
+}
+
+Common::String StarTrekEngine::showCodeInputBox() {
+ memset(_textInputBuffer, 0, TEXT_INPUT_BUFFER_SIZE - 1);
+ return showTextInputBox(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, "Code:\n ");
+}
+
+void StarTrekEngine::redrawTextInput() {
+ char buf[MAX_TEXT_INPUT_LEN * 2 + 2];
+ memset(buf, 0, MAX_TEXT_INPUT_LEN * 2);
+ strcpy(buf, _textInputBuffer);
+
+ if (_textInputCursorChar != 0)
+ buf[_textInputCursorPos] = _textInputCursorChar;
+
+ memcpy(_textInputBitmap->pixels, _textInputBitmapSkeleton->pixels, _textInputBitmapSkeleton->width * _textInputBitmapSkeleton->height);
+
+ drawTextLineToBitmap(buf, MAX_TEXT_INPUT_LEN, 4, 12, _textInputBitmap);
+ _textInputSprite.bitmapChanged = true;
+ _gfx->drawAllSprites();
+}
+
+void StarTrekEngine::addCharToTextInputBuffer(char c) {
+ Common::String str(_textInputBuffer);
+ while ((int)str.size() < _textInputCursorPos) {
+ str += " ";
+ }
+
+ str.insertChar(c, _textInputCursorPos);
+
+ strncpy(_textInputBuffer, str.c_str(), MAX_TEXT_INPUT_LEN);
+ _textInputBuffer[MAX_TEXT_INPUT_LEN] = '\0';
+}
+
+Common::String StarTrekEngine::showTextInputBox(int16 x, int16 y, const Common::String &headerText) {
+ bool validInput = false;
+
+ _keyboardControlsMouse = false;
+ _textInputCursorPos = 0;
+
+ initTextInputSprite(x, y, headerText);
+
+ bool loop = true;
+
+ while (loop) {
+ TrekEvent event;
+ if (!popNextEvent(&event))
+ continue;
+
+ switch (event.type) {
+ case TREKEVENT_TICK:
+ _gfx->incPaletteFadeLevel();
+ _frameIndex++;
+ _textInputCursorChar = (_frameIndex & 2 ? 1 : 0);
+ redrawTextInput();
+ break;
+
+ case TREKEVENT_LBUTTONDOWN:
+ redrawTextInput();
+ validInput = true;
+ loop = false;
+ break;
+
+ case TREKEVENT_RBUTTONDOWN:
+ loop = false;
+ break;
+
+ case TREKEVENT_KEYDOWN:
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_BACKSPACE:
+ if (_textInputCursorPos > 0) {
+ _textInputCursorPos--;
+ Common::String str(_textInputBuffer);
+ str.deleteChar(_textInputCursorPos);
+ strcpy(_textInputBuffer, str.c_str());
+ }
+ redrawTextInput();
+ break;
+
+ case Common::KEYCODE_DELETE: { // ENHANCEMENT: Support delete key
+ Common::String str(_textInputBuffer);
+ if (_textInputCursorPos < (int)str.size()) {
+ str.deleteChar(_textInputCursorPos);
+ strcpy(_textInputBuffer, str.c_str());
+ redrawTextInput();
+ }
+ break;
+ }
+
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ case Common::KEYCODE_F1:
+ redrawTextInput();
+ loop = false;
+ validInput = true;
+ break;
+
+ case Common::KEYCODE_ESCAPE:
+ case Common::KEYCODE_F2:
+ loop = false;
+ break;
+
+ case Common::KEYCODE_HOME:
+ case Common::KEYCODE_KP7:
+ _textInputCursorPos = 0;
+ break;
+
+ case Common::KEYCODE_LEFT:
+ case Common::KEYCODE_KP4:
+ if (_textInputCursorPos > 0)
+ _textInputCursorPos--;
+ redrawTextInput();
+ break;
+
+ case Common::KEYCODE_RIGHT:
+ case Common::KEYCODE_KP6:
+ if (_textInputCursorPos < MAX_TEXT_INPUT_LEN - 1)
+ _textInputCursorPos++;
+ redrawTextInput();
+ break;
+
+ case Common::KEYCODE_END:
+ case Common::KEYCODE_KP1:
+ _textInputCursorPos = strlen(_textInputBuffer);
+ // BUGFIX: Check that it doesn't exceed the buffer length.
+ // Original game had a bug where you could crash the game by pressing
+ // "end", writing a character, pressing "end" again, etc.
+ if (_textInputCursorPos >= MAX_TEXT_INPUT_LEN)
+ _textInputCursorPos = MAX_TEXT_INPUT_LEN - 1;
+ break;
+
+ default: // Typed any other character
+ if (_gfx->_font->isDisplayableCharacter(event.kbd.ascii)) {
+ addCharToTextInputBuffer(event.kbd.ascii);
+ if (_textInputCursorPos < MAX_TEXT_INPUT_LEN - 1)
+ _textInputCursorPos++;
+ redrawTextInput();
+ }
+ break;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ cleanupTextInputSprite();
+ _keyboardControlsMouse = true;
+
+ if (validInput)
+ return _textInputBuffer;
+ else
+ return "";
+}
+
+void StarTrekEngine::initTextInputSprite(int16 textboxX, int16 textboxY, const Common::String &headerText) {
+ int headerLen = headerText.size();
+
+ if (headerLen > 25)
+ headerLen = 25;
+
+ char textBuf[TEXTBOX_WIDTH * 11 + 1];
+ const char *headerPos = headerText.c_str();
+ int row = 0;
+
+ /*
+ // TODO: investigate this (might be unused...)
+ if (word_53100 != 0) {
+ // ...
+ }
+ */
+
+ do {
+ headerPos = getNextTextLine(headerPos, textBuf + row * TEXTBOX_WIDTH, headerLen);
+ row++;
+ } while (headerPos != 0 && row < 11);
+
+ int16 width = headerLen * 8 + 8;
+ int16 height = row * 8 + 8;
+
+ _textInputBitmapSkeleton = SharedPtr<Bitmap>(new Bitmap(width, height));
+ _textInputBitmap = SharedPtr<Bitmap>(new Bitmap(width, height));
+
+ _textInputBitmapSkeleton->xoffset = width / 2;
+ if (textboxX + width / 2 >= SCREEN_WIDTH)
+ _textInputBitmapSkeleton->xoffset += width / 2 + textboxX - (SCREEN_WIDTH - 1);
+ if (textboxX - width / 2 < 0)
+ _textInputBitmapSkeleton->xoffset -= 0 - (textboxX - width / 2);
+
+ _textInputBitmapSkeleton->yoffset = height + 20;
+ memset(_textInputBitmapSkeleton->pixels, 0, width * height);
+
+ // Top border
+ int16 xPos = 1;
+ int16 yPos = 1;
+ while (xPos < width - 1) {
+ _textInputBitmapSkeleton->pixels[yPos * width + xPos] = 0x78;
+ xPos++;
+ }
+
+ // Bottom border
+ xPos = 1;
+ yPos = height - 2;
+ while (xPos < width - 1) {
+ _textInputBitmapSkeleton->pixels[yPos * width + xPos] = 0x78;
+ xPos++;
+ }
+
+ // Left border
+ xPos = 1;
+ yPos = 1;
+ while (yPos < height - 1) {
+ _textInputBitmapSkeleton->pixels[yPos * width + xPos] = 0x78;
+ yPos++;
+ }
+
+ // Right border
+ xPos = width - 2;
+ yPos = 1;
+ while (yPos < height - 1) {
+ _textInputBitmapSkeleton->pixels[yPos * width + xPos] = 0x78;
+ yPos++;
+ }
+
+ // Draw header text
+ for (int r = 0; r < row; r++) {
+ char *text = textBuf + r * TEXTBOX_WIDTH;
+ drawTextLineToBitmap(text, strlen(text), 4, r * 8 + 4, _textInputBitmapSkeleton);
+ }
+
+ // Copy skeleton bitmap to actual used bitmap
+ _textInputBitmap->xoffset = _textInputBitmapSkeleton->xoffset;
+ _textInputBitmap->yoffset = _textInputBitmapSkeleton->yoffset;
+ memcpy(_textInputBitmap->pixels, _textInputBitmapSkeleton->pixels, width * height);
+
+ _gfx->addSprite(&_textInputSprite);
+ _textInputSprite.drawMode = 2;
+ _textInputSprite.field8 = "System";
+ _textInputSprite.bitmap = _textInputBitmap;
+ _textInputSprite.setXYAndPriority(textboxX, textboxY, 15);
+ _textInputSprite.drawPriority2 = 8;
+ _gfx->drawAllSprites();
+}
+
+void StarTrekEngine::cleanupTextInputSprite() {
+ _textInputSprite.dontDrawNextFrame();
+ _gfx->drawAllSprites();
+ _gfx->delSprite(&_textInputSprite);
+
+ _textInputSprite.bitmap.reset();
+ _textInputBitmapSkeleton.reset();
+ _textInputBitmap.reset();
+}
+
+}
Commit: dfb3bc586e772115976c5edbae53921f146d7917
https://github.com/scummvm/scummvm/commit/dfb3bc586e772115976c5edbae53921f146d7917
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Move text out of header file
For some reason this was inflating the executable size.
Changed paths:
A engines/startrek/text.cpp
engines/startrek/module.mk
engines/startrek/text.h
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 50aa62d..397b9b3 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -20,6 +20,7 @@ MODULE_OBJS = \
space.o \
sprite.o \
startrek.o \
+ text.o \
textbox.o \
rooms/demon0.o \
rooms/demon1.o \
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
new file mode 100644
index 0000000..6762794
--- /dev/null
+++ b/engines/startrek/text.cpp
@@ -0,0 +1,2446 @@
+#include "common/c++11-compat.h" // nullptr definition
+
+// In this file, the TYPO tag is used when a typo is fixed in a piece of text, or when
+// text is changed to match the audio.
+
+namespace StarTrek {
+
+extern const char *const g_gameStrings[] = {
+ nullptr,
+ "",
+ "Dialog error",
+ "Animation error",
+
+ "Capt. Kirk",
+ "Mr. Spock",
+ "Dr. McCoy",
+ "Lt. Uhura",
+ "Mr. Scott",
+ "Mr. Sulu",
+
+ "Ensign Everts",
+ "Prel. Angiven",
+ "Sign",
+ "Klingon",
+ "Brother Kandrey",
+ "Brother Stephen",
+ "Brother Chub",
+ "Brother Roberts",
+ "Brother Grisnash",
+ "Nauian",
+ "Ship's Computer",
+
+ "Lt. Christensen",
+ "Crewman Simpson",
+ "Elasi Guard",
+ "Elasi Clansman",
+ "Elasi Cereth",
+ "Masada Crewman",
+
+ "Lt. Ferris",
+ "Computer",
+ "Dr. Marcus",
+ "Dr. Cheever",
+ "Preax",
+
+ "Lt. Buchert",
+ "Harry Mudd",
+
+ "Lt. Stragey",
+ "Quetzecoatl",
+ "Tlaoxac",
+
+ "Ensign Bennie",
+ "Vlict",
+ "Klingon Guard",
+ "Entity",
+ "Bialbi",
+ "A Voice Speaks",
+ "Light of War",
+ "Light of Knowledge",
+ "Light of Travel",
+
+ "Ensign Mosher",
+
+ "#BRID\\BRIDU146#Nothing to report, Captain.",
+
+ "#GENE\\G_024#Fascinating.",
+ "#GENE\\G_043#Ouch! Watch it with that thing!",
+
+ "#GENE\\GENER004#Game Over",
+
+ "#COMP\\COMPA180#Orbit Stabilized. Warning Cancelled.",
+ "#COMP\\COMPA186#Ammonia",
+ "#COMP\\COMPA187#Di-hydrogen Oxide",
+ "#COMP\\COMPA189#Nitrous Oxide",
+ "#COMP\\COMPA190#Oroborus Virus",
+ "#COMP\\COMPA191#Exit Database",
+ "#COMP\\COMPA193#TLTDH Gas",
+ "#COMP\\COMPU181#Warning. Orbital Decay is now irreversible. Abandon Ship. Abandon Ship.",
+ "#COMP\\COMPU182#Warning. Orbital decay detected. Warning.",
+ "#COMP\\COMPU186#Ammonia: a colorless pungent compound NH3, a common byproduct of metabolism in carbon-based lifeforms. Liquid or gaseous at 1 atm. Compounds widely used in agricultural, medical and industrial applications.",
+ "#COMP\\COMPU187#Di-hydrogen Oxide: a colorless, tasteless, nonflammable compound HO- water. Liquid, solid, or gaseous at 1 atm. Temperature scales defined in most humanoid cultures by state-shift of pure water.",
+ "#COMP\\COMPU188#Dr. Marcus' Log, Supplemental: Continued testing of the Oroborus Virus confirms its potential harmful effects on Romulan/Vulcan humanoids. As soon as the spill has been cleaned up, we will sterilize both labs and purge the circulation system to make sure no traces of the virus will remain viable. Then all research files must be erased -- we must leave no chance that this terrible accident will ever be repeated.",
+ "#COMP\\COMPU189#Nitrous Oxide: a colorless nonflammable compound NO, gaseous at 1 atm and temperatures within the human norm. Early anesthetic among humans, in whom it produces laughter, feelings of exhiliration, euphoria; sometimes leading to unconsciousness.",
+ "#COMP\\COMPU190#Oroborus virus: Atypical growth patterns for L-Type virus. Opportunistic pneumococcal mimic affecting Romulo-Vulcan genotype. Etiology: contact or airborne vector with alveoli microcollapse involvement immediately upon exposure. Tissue dehydration follows pneumal flooding. Mortality: 0.6 in 1.0 stardates, 1.0 within 2.0 stardates Treatment: none. Named for the mythic worldsnake that swallows its own tail.",
+ "#COMP\\COMPU192#Please select subject file...",
+ "#COMP\\COMPU193#TLTDH gas: The chemical compound tantalum bi-lithium thalo-dihydroxide. Colorless, odorless, nonflammable gaseous at 1 atm and temperatures within the human norm. Early anesthetic among Vulcans and Romulans, in whom it produces laughter, feelings of exhiliration, euphoria; sometimes leading to unconsciousness. In post-industrial/pre-spaceflight era, a social problem evolved when crude TLTDH became popular to \"cook up\" from non-conductive tantalo-lithial compounds commonly used as electrical insulation.",
+
+
+ "#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?",
+ "#DEM0\\DEM0_002#Aside from seeing demons, has any hard data been collected? Any evidence I could see?",
+ "#DEM0\\DEM0_003#Been seeing ghosts and bogeymen eh? I find that a little hard to believe.",
+ "#DEM0\\DEM0_004#C'mon Bones, the cold will improve your circulation.",
+ "#DEM0\\DEM0_005#Demons? Gates of Hell? This is the 23rd Century!",
+ "#DEM0\\DEM0_006#I'm Captain James T. Kirk of the U.S.S. Enterprise. We have received word that alien lifeforms are creating problems at your mining facilities at Idyll Mountain. Tell me more.",
+ "#DEM0\\DEM0_007#Later Ensign. We have work to do.",
+ "#DEM0\\DEM0_008#Most High Prelate Angiven, I am honored to meet you. I consider it my divine duty to assist you in any possible way with the spawn of the devil.",
+ "#DEM0\\DEM0_009#This planet's as beautiful as everyone says it is.",
+ "#DEM0\\DEM0_010#What can you tell me about the mine itself?",
+ "#DEM0\\DEM0_011#You look rather cold, Bones.",
+ "#DEM0\\DEM0_012#You're wasting the time of a starship capable of destroying this planet with campfire stories? No wonder you were dumped out here in the middle of nowhere.",
+ "#DEM0\\DEM0_013#Captain, Doctor McCoy is correct.",
+ "#DEM0\\DEM0_014#Captain, demons and supernatural creatures are, almost by definition, illogical. Yet it is evident these people believe what they have seen. Barring illness or mass hysteria, I agree that a real problem seems to exist.",
+ "#DEM0\\DEM0_015#Burning down their house is not the best way to gain their confidence Jim!",
+ "#DEM0\\DEM0_016#Captain, the flora on this planet is very interesting. I wonder how useful it may be for medicinal purposes.",
+ "#DEM0\\DEM0_017#Quite the vandal aren't we, Jim?",
+ "#DEM0\\DEM0_018#His blood pressure's up a bit, but he believes he's telling the truth.",
+ "#DEM0\\DEM0_019#I don't know if the problem is real, the result of a new illness, or mass hysteria. But at the very least, there's an injured miner who needs my help.",
+ "#DEM0\\DEM0_020#Jim! Are you out of your mind?",
+ "#DEM0\\DEM0_021#Jim, I am not picking up any unusual life here, just native lifeforms and the settlers. The colonists are all human, except for the one Tellarite. If there are demons here, they don't register on my tricorder.",
+ "#DEM0\\DEM0_022#The man's in perfect health.",
+ "#DEM0\\DEM0_023#I'm not cold, I'm freezing! And that damn transporter just had to set me down in the middle of a snow drift!",
+ "#DEM0\\DEM0_024#Some people get too much circulation!",
+ "#DEM0\\DEM0_025#Well...",
+ "#DEM0\\DEM0_026#You mean you've never built a snowman, ensign?",
+ "#DEM0\\DEM0_027#The trees. The fresh air. The freezing cold...",
+ "#DEM0\\DEM0_028#Captain, reading the rocks in this area, I find that this locality may have been disturbed in the distant past. Recent disturbances created by the colonists' construction and mining prevent me from discovering anything further.",
+ "#DEM0\\DEM0_029#A centimeter of snow does not technically constitute a drift, Doctor.",
+ "#DEM0\\DEM0_030#They are already gathered in the chapel, and will cooperate in any way with you. First door on my right.",
+ "#DEM0\\DEM0_031#A skeptic would consider everything merely anecdotal or unproven. My people will gladly tell you their own stories, so you need not hear it secondhand through me.",
+ "#DEM0\\DEM0_032#Captain Kirk. I had no idea we were blessed with one of our order in the ranks of Starfleet. We believe we have located the very Gates of Hell below Idyll Mountain.",
+ "#DEM0\\DEM0_033#Starfleet recognizes our freedom to worship and believe as we see fit, Captain. I am surprised that you do not share that feeling. Rest assured that Starfleet Command will be informed of your rudeness.",
+ "#DEM0\\DEM0_034#Thank you for your courtesy, Kirk. May you receive the guidance and protection of our God as you complete this divine mission.",
+ "#DEM0\\DEM0_035#The area is exceptionally stable tectonically, and easy for our machinery to work in, praise God. We've mined for hafnium and a variety of useful trace elements. The deeper we dig, however, the more anomalous the variety of minerals seems to be. Our Ignaciate, Brother Stephen, has his own theories about why this might be. Either way, the anomalies inspired Brother Kandrey to conduct studies inside the mine. Yesterday, he reported discovering a strange door -- a gate to Hell, surely, for the demons caused a cave-in immediately. Kandrey was trapped, unconscious, and the demons prevent us from rescuing him. We can only hope he is still alive.",
+ "#DEM0\\DEM0_036#This is so much better, gentlefolk. We are honored at your presence and hope you will find peace here in our haven.",
+ "#DEM0\\DEM0_037#We need your help, Kirk. You may have no respect for our beliefs, but I hope you will look beyond that. Godspeed.",
+ "#DEM0\\DEM0_038#Certainly, Captain Kirk. Not aliens, per se -- we have encountered what we believe are demons at Idyll Mountain, creatures surely emerging from the very gates of Hell. Our God would not test us thus without reason, so we believe your might and insight are our God's method to help us discover what is going on.",
+ "#DEM0\\DEM0_039#Aw, Captain, please don't melt the snow. I've never seen it before.",
+ "#DEM0\\DEM0_040#Is he always this trigger happy on ground missions?",
+ "#DEM0\\DEM0_041#And doctors say that patients complain too much!",
+ "#DEM0\\DEM0_042#I've never even thrown a snowball. Do you think anyone would mind?",
+ "#DEM0\\DEM0_043#I've never seen snow like this before. This is great!",
+ "#DEM0\\DEM0_044#Of course, sir.",
+ "#DEM0\\DEM0N000#A beautiful, snow covered scene with a path leading off to Mount Idyll.",
+ "#DEM0\\DEM0N001#A quickly constructed spartan shelter, primarily used by fledgling colonies.",
+ "#DEM0\\DEM0N002#Dr. Leonard McCoy, the finest doctor in Starfleet, wishes that he were on a warmer planet.",
+ "#DEM0\\DEM0N003#Ensign Everts, who has never been this close to snow before in his life, gazes with child-like fascination at the ground.",
+ "#DEM0\\DEM0N004#High Prelate Angiven waits patiently for you to decide what you will do next.",
+ "#DEM0\\DEM0N005#James Tiberius Kirk, Captain of the Enterprise. He's always happy to run an errand of mercy.",
+ "#DEM0\\DEM0N006#On the other side of the trees is Idyll Mountain. A tall, forbidding place. You have a vague feeling of danger.",
+ "#DEM0\\DEM0N007#Remnants of a recent snowfall cover the ground.",
+ "#DEM0\\DEM0N008#Some colonists.",
+ "#DEM0\\DEM0N009#Spock raises an eyebrow.",
+ "#DEM0\\DEM0N010#Various bushes and shrubs grow along the edge of the forest.",
+ "All mining equipment use this road.",
+
+
+ "#DEM1\\DEM1_001#We were caught flat footed there. I don't want any more surprises to catch us off guard.",
+ "#DEM1\\DEM1_002#No just an idea, Kirk out.",
+ "#DEM1\\DEM1_003#We're fine. Did you register any Disruptor fire?",
+ "#DEM1\\DEM1_004#What is it, Spock?",
+ "#DEM1\\DEM1_005#Doctis Cattails are similar to their terran name sake except that they are known to cause hives if in contact with flesh for any amount of time.",
+ "#DEM1\\DEM1_006#Gindorian ferns are regarded as an intergalactic weed, Captain.",
+ "#DEM1\\DEM1_007#Khytellian tulips are a perennial flower that survive in almost any climate.",
+ "#DEM1\\DEM1_008#The Brandzite pod is similar to terran milkweed except that the silk pods are in bright iridecent colors.",
+ "#DEM1\\DEM1_009#He's only stunned. He'll be back up in a few seconds.",
+ "#DEM1\\DEM1_011#The fire fight is over, Jim. I think you can put that away now.",
+ "#DEM1\\DEM1_012#This is definitely not a real klingon Jim.",
+ "#DEM1\\DEM1_013#Demons, Klingons, avalanches... What's next, the Wicked Witch of the West?",
+ "#DEM1\\DEM1_014#It wasn't supposed to be logical, you green blooded Vulcan! Why does everything have to be so damned logical?",
+ "#DEM1\\DEM1_015#Well, we've seen Klingons. Now all we need is a few Romulans...",
+ "#DEM1\\DEM1_016#The circuit was damaged. It appears reparable, but some specialized equipment will be required.",
+ "#DEM1\\DEM1_017#This is a detached hand with some kind of circuitry in the palm, Captain.",
+ "#DEM1\\DEM1_018#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial. There is something different about this particular construct. Come here, Captain, look at the hand.It seems to have been separated from the body. There is a wiring circuit in the middle of the palm.",
+ "#DEM1\\DEM1_019#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial.",
+ "#DEM1\\DEM1_020#Fascinating. I begin to suspect that we have stumbled upon something that the colonists would never have uncovered.",
+ "#DEM1\\DEM1_021#I wish to gather further data before making a definite conclusion, Captain.",
+ "#DEM1\\DEM1_022#Captain, I detect a recent avalanche, approximately 6.2 kilometers away, that occurred within the last three days. The mountain may be quite dangerous.",
+ "#DEM1\\DEM1_023#Control your thoughts, Doctor. There is a high probability that something here is using our own memories against us.",
+ "#DEM1\\DEM1_024#That is not logical, doctor.",
+ "#DEM1\\DEM1_025#I guess they don't make Klingons like they used to, Sir.",
+ "#DEM1\\DEM1_026#I guess this isn't such a great planet after all.",
+ "#DEM1\\DEM1_F23#Federation Scum!",
+ "#DEM1\\DEM1N000#Captain Kirk is fatally shot by a Klingon, game over.",
+ "#DEM1\\DEM1N001#Dr. McCoy, still hoping the cold winds that whip around Mount Idyll will soon die down.",
+ "#DEM1\\DEM1N002#Ensign Everts seems to be rattled by the attack of the Klingons.",
+ "#DEM1\\DEM1N003#James Kirk, filled with a premonition of more dangers yet to come.",
+ "#DEM1\\DEM1N004#They look like Klingons.",
+ "#DEM1\\DEM1N005#You already took the hand from the Klingon.",
+ "#DEM1\\DEM1N006#You find nothing new.",
+ "#DEM1\\DEM1N007#You take the Klingon's detached hand.",
+ "#DEM1\\DEM1N008#Your Vulcan science officer seems to be lost in thought, but remains alert.",
+ "#DEM1\\DEM1N009#A Gindorian Fern.",
+ "#DEM1\\DEM1N010#A large patch of Khytellian Tulips.",
+ "#DEM1\\DEM1N011#A small stream flows down towards the forest.",
+ "#DEM1\\DEM1N012#Captain Kirk is unconscious.",
+ "#DEM1\\DEM1N013#Dr. McCoy is unconscious.",
+ "#DEM1\\DEM1N014#Ensign Everts is unconscious.",
+ "#DEM1\\DEM1N015#Mr. Spock is unconscious.",
+ "#DEM1\\DEM1N016#Mt. Idyll rises above you.",
+ "#DEM1\\DEM1N017#The path is surrounded by some beautiful shrubbery.",
+ "#DEM1\\DEM1N018#These are very beautiful Doctis Cattails.",
+ "#DEM1\\DEM1N019#These Brandzite Pods add a nice touch to the local flora.",
+ "#DEM1\\DEM1N020#You see a small explosion, and the Klingon's hand falls to the ground with a dull thud.",
+ "#DEM1\\DEM1N021#You see the mine entrance ahead.",
+ "#DEM1\\DEM1N023#It's the Klingon's detached hand!",
+ "#DEM1\\DEM1U077#Captain we registered Phaser fire and an unknown energy beam. Is everyone OK?",
+ "#DEM1\\DEM1U078#No, Captain. Why, are Klingons down there?",
+
+
+ "#DEM2\\DEM2_001#The answer to this mystery lies ahead of us, gentlemen.",
+ "#DEM2\\DEM2_002#Just don't make that mistake again, Ensign.",
+ "#DEM2\\DEM2_003#The thought had occurred to me, Mr. Spock, but thank you for mentioning it.",
+ "#DEM2\\DEM2_004#We've all had our share of conflict with Klingons, Ensign. The Organians told me that one day Humans and Klingons will become good friends. I wonder if I'll ever live to see that day.",
+ "#DEM2\\DEM2_005#Captain, I'm having trouble getting reliable readings from inside the mountain. Unusual crystalline structures within the ore may be at fault, though I cannot say for certain.",
+ "#DEM2\\DEM2_006#Gindorian ferns are regarded as an intergalactic weed, Captain.",
+ "#DEM2\\DEM2_007#The Phequedine moss extracts nourishment from hafnium, Captain.",
+ "#DEM2\\DEM2_008#These seem to be Laraxian berries, Captain. They have several medicinal uses, but Dr. McCoy would know more.",
+ "#DEM2\\DEM2_009#Jim, these are Laraxian Berries that we used to make the Hypo-Dytoxin.",
+ "#DEM2\\DEM2_010#Jim, these are the berries we need to synthesize the Hypo-Dytoxin. We must get these to Brother Stephen quickly.",
+ "#DEM2\\DEM2_011#Jim, you usually pick food and then cook it.",
+ "#DEM2\\DEM2_012#These are Laraxian Berries. From what I remember, certain chemical compounds in the berry can be used to treat Nugaireyn infections.",
+ "#DEM2\\DEM2_013#These are the Laraxian Berries we used to cure Brother Chub.",
+ "#DEM2\\DEM2_014#We don't need any more berries, Jim.",
+ "#DEM2\\DEM2_015#Does your tricorder say the cave is warmer, Spock...",
+ "#DEM2\\DEM2_016#Spock, everybody talks about the weather!",
+ "#DEM2\\DEM2_017#It is not logical for me to use my tricorder to determine the cave's temperature, doctor. I do not see what purpose it would serve.",
+ "#DEM2\\DEM2_018#Whoever was trying to stop us may not stop with those Klingons, Captain. I recommend extreme caution.",
+ "#DEM2\\DEM2_019#I'm sorry I let you down with those Klingons back there. I should have been paying more attention.",
+ "#DEM2\\DEM2_020#Those Klingons give me the willies. They always have. My sister was wounded by them in the Chozon ambush.",
+ "#DEM2\\DEM2N000#Ensign Everts. Keeping a sharp eye out for anything dangerous.",
+ "#DEM2\\DEM2N002#James T. Kirk. Always wondering what the next surprise will be.",
+ "#DEM2\\DEM2N003#Leonard McCoy. Hoping that the cave will be warmer than outside.",
+ "#DEM2\\DEM2N004#Spock. Perhaps the most brilliant mind in Starfleet, pondering a most peculiar mystery.",
+ "#DEM2\\DEM2N005#A Gindorian fern.",
+ "#DEM2\\DEM2N006#Feeble lights illuminate the mine tunnel.",
+ "#DEM2\\DEM2N007#Idyll Mountain.",
+ "#DEM2\\DEM2N008#Idyll Mountain.",
+ "#DEM2\\DEM2N009#Mine entrance.",
+ "#DEM2\\DEM2N010#Phequedian moss grows on the cave wall.",
+ "#DEM2\\DEM2N011#The mine entrance goes deep into Mount Idyll.",
+ "#DEM2\\DEM2N012#Various types of berries grow amongst the bushes.",
+ "#DEM2\\DEM2N013#You have retrieved a sample of berries.",
+
+
+ "#DEM3\\DEM3_001#Assume firing positions.",
+ "#DEM3\\DEM3_002#A gateway to an alien race. The wonders of the galaxy are endless, aren't they, Mr. Spock?",
+ "#DEM3\\DEM3_003#Bones..",
+ "#DEM3\\DEM3_004#Don't be too anxious, Ensign. We may want to talk with them.",
+ "#DEM3\\DEM3_005#Captain, I would strongly recommend clearing all the debris first.",
+ "#DEM3\\DEM3_006#Captain, the structure is extremely unstable. I would not recommend disturbing the lower section before the upper sections have been cleared.",
+ "#DEM3\\DEM3_007#Captain, the stun setting would be very ineffective on these boulders.",
+ "#DEM3\\DEM3_008#I think Doctor McCoy would be better suited to deal with this.",
+ "#DEM3\\DEM3_009#It appears to be a security lock designed to open the door when the correct hand print is registered.",
+ "#DEM3\\DEM3_010#Captain, there are several weak points in the cave-in's structure. Careful use of our phasers, from the top down, should be able to clear it.",
+ "#DEM3\\DEM3_011#Captain, this course of action is ineffectual.",
+ "#DEM3\\DEM3_012#Fascinating, Captain. This door is made of an unknown material. It is clearly built by an alien race we have no knowledge of.",
+ "#DEM3\\DEM3_013#He's already dead, Jim. Isn't that good enough for you?",
+ "#DEM3\\DEM3_014#I'm sorry, Jim. Ensign Everts is beyond my help.",
+ "#DEM3\\DEM3_015#I've done all I can. He just needs rest now.",
+ "#DEM3\\DEM3_016#This is incredible, Jim. I'm picking up faint lifesign readings behind this door!",
+ "#DEM3\\DEM3_017#Dammit, Jim, I'm a doctor, not a bellhop. This man's too hurt to be moved.",
+ "#DEM3\\DEM3_018#He's dead Jim.",
+ "#DEM3\\DEM3_019#He's dead, Jim...",
+ "#DEM3\\DEM3_020#I'm picking up weak vital signs. If we don't dig him out soon, we're going to lose him!",
+ "#DEM3\\DEM3_021#It was a near thing, but he'll live.",
+ "#DEM3\\DEM3_022#The miner is dead.",
+ "#DEM3\\DEM3_023#This man is badly hurt, and suffering from shock and exposure as well.",
+ "#DEM3\\DEM3_024#I'll probably end up coming along.",
+ "#DEM3\\DEM3_025#Jim, the next time you need medical help on a snowball...",
+ "#DEM3\\DEM3_026#They can also be damned cold.",
+ "#DEM3\\DEM3_027#Fascinating... I'm registering low-intensity shielding unlike anything we've encountered before. That kept this door -- and whatever is behind it -- hidden from the ship's sensors and earlier tricorder readings.",
+ "#DEM3\\DEM3_028#I recommend as thorough an analysis of this area as possible.",
+ "#DEM3\\DEM3_029#Indeed, Captain.",
+ "#DEM3\\DEM3_030#Sir, I think we should clear the rest of the rocks before we check out the device.",
+ "#DEM3\\DEM3_031#Sir, it may be dangerous. Let me try it.",
+ "#DEM3\\DEM3_033#I think I was shocked, sir.",
+ "#DEM3\\DEM3_034#Ouch, that hurt.",
+ "#DEM3\\DEM3_035#That was definitely a mild shock.",
+ "#DEM3\\DEM3_036#No sign of demons, Klingons, or other hostiles, Captain. I promise I'll let you know the instant something appears.",
+ "#DEM3\\DEM3_A32#Aieeee!",
+ "#DEM3\\DEM3_B32#Aieeeee.",
+ "#DEM3\\DEM3_F21#Oh, thank you, kind souls, for saving my life. Let me rest here for a little before returning to report this miracle to Prelate Angiven.",
+ "#DEM3\\DEM3N000#Brother Kandrey is barely conscious, and is lying still, trying to regain his strength.",
+ "#DEM3\\DEM3N001#Commander Spock; curious about what lies ahead.",
+ "#DEM3\\DEM3N002#Doctor Leonard McCoy, glad that the cave provides some shelter from the breeze.",
+ "#DEM3\\DEM3N003#Ensign Everts, wary of more ambushes.",
+ "#DEM3\\DEM3N004#James T. Kirk. Captain of the Enterprise.",
+ "#DEM3\\DEM3N005#Nothing happens.",
+ "#DEM3\\DEM3N006#One of the Acolytes, who was trapped by the the rockfall.",
+ "#DEM3\\DEM3N007#The fit is perfect, but something seems to be shorting out.",
+ "#DEM3\\DEM3N008#The hand's circuitry triggers a connection, and the door opens.",
+ "#DEM3\\DEM3N009#There is no apparent effect.",
+ "#DEM3\\DEM3N010#A cavern, deep in Mount Idyll.",
+ "#DEM3\\DEM3N011#A huge boulder sits upon a large pile of rubble.",
+ "#DEM3\\DEM3N012#A large metallic door is set in the structure.",
+ "#DEM3\\DEM3N013#A large pile of rubble blocks what appears to be a large metallic structure.",
+ "#DEM3\\DEM3N014#A long tunnel descends into the mountain.",
+ "#DEM3\\DEM3N015#A pulsing red light is set in the structure above the door.",
+ "#DEM3\\DEM3N016#A structure built into the surrounding rock. It must have been buried here for millennia.",
+ "#DEM3\\DEM3N017#Ensign Everts lies dead, crushed by the boulder.",
+ "#DEM3\\DEM3N018#The crushed body of Ensign Everts reminds you of your poor command judgement.",
+ "#DEM3\\DEM3N019#This looks like some of the hand security panels on the Enterprise.",
+ "#DEM3\\DEM3N020#You notice what appears to be a man's arm sticking out from beneath the rubble.",
+
+
+ "#DEM4\\DEM4_001#I think we've found the answer to our mystery.",
+ "#DEM4\\DEM4_002#Stop! You're trespassing on Federation territory.",
+ "#DEM4\\DEM4_003#I think I should return it to where I got it from.",
+ "#DEM4\\DEM4_004#I welcome you on behalf of the United Federation of Planets. Who are you? Where do you come from?",
+ "#DEM4\\DEM4_005#No, I want to keep it as a memento for myself.",
+ "#DEM4\\DEM4_006#Of course. I think you will get along well with the Pollux inhabitants, and I'm sure you will have interesting theological discussions.",
+ "#DEM4\\DEM4_007#Perhaps you can tell us about the demons.",
+ "#DEM4\\DEM4_008#Some advanced civilization!",
+ "#DEM4\\DEM4_009#We did fix your machine. Can we write the repair bill off against rent on this land?",
+ "#DEM4\\DEM4_010#I would be glad to accept your application to the Federation. We shall have a diplomatic envoy sent to make the final arrangements.",
+ "#DEM4\\DEM4_011#Kirk to Enterprise... Beam us up, Mr. Scott.",
+ "#DEM4\\DEM4_012#This seems to be a Cryogenic Suspension chamber, Captain.",
+ "#DEM4\\DEM4_013#Captain, Starfleet would not be pleased.",
+ "#DEM4\\DEM4_014#Fascinating, Captain. It is a diagram of a lunar eclipse of this planet. See how the red ball, the moon, is casting a shadow on the blue ball, Pollux V. This must be a very old piece of work, because this planet's moon was destroyed thousands of years ago.",
+ "#DEM4\\DEM4_015#I wonder who, or what, constructed all this.",
+ "#DEM4\\DEM4_017#Jim, think about that skull we picked up from Brother Stephen. Now look at this alien. See the resemblance?",
+ "#DEM4\\DEM4_018#Ouch!",
+ "#DEM4\\DEM4_019#Perhaps we should try to communicate with the alien.",
+ "#DEM4\\DEM4_020#This is a very old and very complex life-support system. It appears to still be operational.",
+ "#DEM4\\DEM4_021#You should ask Spock, Jim.",
+ "#DEM4\\DEM4_022#Fascinating. this lifeform may represent what would have happened had the dinosaurs of your earth not become extinct.",
+ "#DEM4\\DEM4_023#It is an alien life-support system, Captain, utilizing geothermal energy. It is still functioning, waiting for some sort of signal.",
+ "#DEM4\\DEM4_024#Logically, the machinery is sustaining some type of life in suspended animation. If we can reactivate the machines, then we may be able to meet its creators.",
+ "#DEM4\\DEM4_025#The machinery is waiting for the gravitational pull of another eclipse to activate it, an eclipse that will never come. And one other thing, Captain. This may also be a diagram showing the proper settings on that control panel.",
+ "#DEM4\\DEM4_026#This alien construction takes readings of mental activity. It also activates manufacturing equipment related to security, and includes a short-distance transportation device.",
+ "#DEM4\\DEM4_027#This control panel is a manual override for the alien life-support equipment.",
+ "#DEM4\\DEM4_029#This lifeform appears to be intelligent, a new sentient race. There appear to be resemblances between it and the silotis, although the present forms are quite small and definitely nonsentient.",
+ "#DEM4\\DEM4_030#Live long and prosper.",
+ "#DEM4\\DEM4_031#Have you found the key?",
+ "#DEM4\\DEM4_032#Our patience is exhausted! Now feel our wrath!",
+ "#DEM4\\DEM4_033#There is no need for violence, Captain. We are a peaceful people.",
+ "#DEM4\\DEM4_034#You found the key! I can now turn off the machinery creating our guardians, and no more sentients shall be at risk. Surely the Holy One smiles upon us all. I have no way to thank you, Captain, but please carry this request from my people to yours. We have much ancient knowledge we can share, and we would like to join your Federation. Go in peace.",
+ "#DEM4\\DEM4_035#We look forward to meeting them. We also look forward to having discourse with the colonists. Farewell. May the Holy One bless you.",
+ "#DEM4\\DEM4_036#A child? No, I see many differences. This must be what our people who did not slumber have become. Still, I would like to see these remains properly interred, according to the precepts of our religion. May I keep this?",
+ "#DEM4\\DEM4_037#I see you have already shut off the machinery that creates the guardians. I have no way to thank you, Captain, but please carry this request from my people to yours. We have much ancient knowledge we can share, and we would like to join your Federation. Go in peace.",
+ "#DEM4\\DEM4_038#Oh woe! Alas! The key is missing, I can do nothing! Even we will suffer the attacks of our own guardians unless the key can be found! I implore you, if you can help, please do so.",
+ "#DEM4\\DEM4_039#So the Ferengi are not the only traders in the universe! Yes, Captain Kirk, excusing the settlers' debts is an excellent way of ensuring that our people will be friends.",
+ "#DEM4\\DEM4_040#The demons, as you call them, are created by a machine designed to keep intruders away from our sleep chambers. It pulls from the minds of any approaching creature their most feared enemy and produces replicas to scare them away. For you and your crew it was Klingons, for the Tellarite a wolf-demon, and for the other Humans a demon from their religion. On behalf of my people, thank you for waking us. I will turn off the machinery which creates our guardians, so that they no longer bedevil those with whom we now share our home.",
+ "#DEM4\\DEM4_041#There is no need for disrespect, intruder. Our race is old and powerful, wise in many things. Like our guardians, for example.",
+ "#DEM4\\DEM4_042#Violence is hardly necessary, Captain Kirk. We owe you a debt for your service to us, and are more than willing to peacefully co-exist with your kind.",
+ "#DEM4\\DEM4_043#We call ourselves Nauians. Thousands of years ago, we saw that meteor impacts were going to cause an Ice Age. We created this huge underground shelter to preserve our race, keeping us in suspended animation until the planet had recovered. We programmed the machinery to revive us at the next eclipse, but we did not count on the destruction of our moon.",
+ "#DEM4\\DEM4_044#Welcome to our home. Thank you for repairing our Sonambutron.",
+ "#DEM4\\DEM4_045#I do not think that would be a prudent action, sir.",
+ "#DEM4\\DEM4_046#I'm just a security officer, sir.",
+ "#DEM4\\DEM4_047#What is that?",
+ "#DEM4\\DEM4N000#Dr. McCoy looks back.",
+ "#DEM4\\DEM4N001#Ensign Everts is looking around.",
+ "#DEM4\\DEM4N002#It appears to be an abstract piece of alien art.",
+ "#DEM4\\DEM4N003#James T. Kirk, Captain of the Enterprise.",
+ "#DEM4\\DEM4N004#Many alien machines fill the room.",
+ "#DEM4\\DEM4N005#Spock is analyzing the alien machines.",
+ "#DEM4\\DEM4N006#The alien emerged from this metal chamber.",
+ "#DEM4\\DEM4N007#The alien is humanoid, with green reptilian skin. It appears unarmed.",
+ "#DEM4\\DEM4N008#This appears to control some unusual security equipment.",
+ "#DEM4\\DEM4N009#This floor contains conduits for conducting geothermal energy.",
+ "#DEM4\\DEM4N010#This is where the panel should pop up.",
+ "#DEM4\\DEM4N011#You meet your death at the hands of a race that could have been your ally. What a waste. Better luck next time.",
+ "#DEM4\\DEM4N012#It looks like a control panel with slide switches.",
+ "#DEM4\\DEM4N013#Nothing Happens.",
+ "#DEM4\\DEM4N014#You fit the key into the slot, but you cannot find a way to turn it.",
+
+
+ "#DEM5\\DEM5_001#Just thinking to myself. Don't mind me.",
+ "#DEM5\\DEM5_002#Can you tell us what they looked like?",
+ "#DEM5\\DEM5_003#It will be good to help them for a change.",
+ "#DEM5\\DEM5_004#Not the good ones, that's for sure.",
+ "#DEM5\\DEM5_005#The demons didn't follow you?",
+ "#DEM5\\DEM5_006#I detect various pieces of mining equipment but nothing of note.",
+ "#DEM5\\DEM5_007#May I suggest using a more diplomatic approach to questioning the colonists. Force will gain us little, if anything.",
+ "#DEM5\\DEM5_008#Jim, that wouldn't be wise.",
+ "#DEM5\\DEM5_009#Jim, these need to be processed first!",
+ "#DEM5\\DEM5_010#This man is getting worse. We've got to find those berries before he dies.",
+ "#DEM5\\DEM5_011#Jim, I've completed my study. I find no evidence for physical or mental disturbances among the colonists, causing them to see hallucinations. There must be other reasons for what these people are seeing.",
+ "#DEM5\\DEM5_012#Jim, this man has suffered severe physical injuries to his head and arm. The wounds have been adequately cared for; however, he has developed the Nugaireyn infection. If not treated swiftly, the effects can be fatal. The infection can normally be treated with Hypo-Dytoxin, but there's none on the Enterprise.",
+ "#DEM5\\DEM5_013#The alien's lifesigns seem stress-elevated. Otherwise he appears fundamentally healthy.",
+ "#DEM5\\DEM5_014#The man is suffering moderately from the effects of his age, but seems healthy, alert, and in fine spirits.",
+ "#DEM5\\DEM5_015#The man seems worried and stressed, but all body functions appear within normal limits.",
+ "#DEM5\\DEM5_016#This man has recently suffered a nasty but non-life-threatening wound. The damage has been adequately cared for. The man's vital effects are attributable to shock and stress.",
+ "#DEM5\\DEM5_017#This man needs help, Jim, and I wouldn't want to put it off for too long.",
+ "#DEM5\\DEM5_018#By our standards yes. Here the Acolytes prefer a simpler life style; unfortunately, this is one of the consequences.",
+ "#DEM5\\DEM5_019#Neither were some of my professors.",
+ "#DEM5\\DEM5_020#So did I, but I became one anyway.",
+ "#DEM5\\DEM5_021#The Acolytes did a lot of good work for the needy in this quadrant.",
+ "#DEM5\\DEM5_022#Why, Spock, you two should get along fine, he sounds just like you.",
+ "#DEM5\\DEM5_023#You know Jim, they can take a captain out of a starship, and a science officer out of his lab, but you can never retire a doctor.",
+ "#DEM5\\DEM5_024#Captain, a Krognik-demon has a decidedly wolfish appearance. Brother Grisnash, is this not the traditional shape of the Evil One and his minions among Tellarites?",
+ "#DEM5\\DEM5_025#I believe this may be significant, Captain.",
+ "#DEM5\\DEM5_026#That is not logical, doctor.",
+ "#DEM5\\DEM5_027#The medical methods of these people seem primitive to me, doctor.",
+ "#DEM5\\DEM5_028#I am Brother Grisnash. I went up the mountainside in solitary prayer, seeking to face my fears. Indeed I found them. A bellowing Krognik-demon with sharp teeth and a long snout descended upon me in a rush of wind.",
+ "#DEM5\\DEM5_029#It is.",
+ "#DEM5\\DEM5_030#Brother Kandrey was -- is -- my partner. I was on the communications link when the demons caused the rockfall and silenced him. He said he'd found a strange door with devilish writing. Truly he came upon the Gate of Hell itself.",
+ "#DEM5\\DEM5_031#You tread close to unholy knowledge, Brother Stephen!",
+ "#DEM5\\DEM5_032#Ahh, I see you found the berries. Meet me in my lab.",
+ "#DEM5\\DEM5_033#Good, you have found the berries. Bring them to my lab quickly.",
+ "#DEM5\\DEM5_034#I am worried about Brother Chub. Can you examine him, Doctor?",
+ "#DEM5\\DEM5_035#Please hurry Doctor. Brother Chub is looking worse.",
+ "#DEM5\\DEM5_036#That's very nice, but I'm busy now.",
+ "#DEM5\\DEM5_037#Those are Laraxian berries. They grow wild by the mine entrance.",
+ "#DEM5\\DEM5_038#Time is of the essence, you must hurry and retrieve the berry.",
+ "#DEM5\\DEM5_039#What an interesting artifact. Hmmm... It appears to have been damaged. When you have a chance, take it to my lab and we'll see if it can be repaired.",
+ "#DEM5\\DEM5_040#I may be of some assistance. The Laraxian Berry grows near the mouth of the cave. If I could acquire it, I would be able to synthesize the Hypo-Dytoxin from the berry. Unfortunately, the demons prevent us from approaching the cave entrance. perhaps you could retrieve it for me.",
+ "#DEM5\\DEM5_041#I am Brother Stephen, an Ignaciate, following the holy teachings with mind and soul alike. I believe the anomalous mineral readings, in combination with evidence of ancient disturbances in this otherwise highly stable geologic location indicates previous habitation of the region, eons ago.",
+ "#DEM5\\DEM5_042#I appreciate your prayers, Brother Roberts. Captain, if you and your people go up the mountain, I hope afterward you will visit me in my study, which is next door. I am too old to make the trek myself, but I am eager for knowledge. In return, I will offer you what insights our God grants these old eyes.",
+ "#DEM5\\DEM5_043#I would be equally honored to discuss medicine with you, Doctor, as science with your Vulcan associate. Let me continue. I believe our God made humans, aliens -- and demons all. If I could get a real demon into my study, I would bless our God for the opportunity, as I thank Him for everything in this life.",
+ "#DEM5\\DEM5_044#My mom wanted me to become a doctor. Honest. But I hated my biology classes.",
+ "#DEM5\\DEM5_045#My uncle John lived with the Acolytes a long time ago. He died in their service, helping plague victims on New Ontario VI twenty years ago.",
+ "#DEM5\\DEM5L027#Thank you. You are most kind.",
+ "#DEM5\\DEM5L028#You'll understand if I don't stand up, I hope. I am not well.",
+ "#DEM5\\DEM5L029#I headed up the party that sought to rescue Brother Kandrey. Without warning, the demons appeared and attacked us as we approached the mine!",
+ "#DEM5\\DEM5L030#Like the demons that have plagued devout folk since before our people left the Earth. Huge muscular demons, with ruddy skin. Truly the manifestation of Evil, with batwings, horns and talons, and a pointed tail. God preserve us all. One tore open my arm and I surely would have perished -- but for my companions who bore me back down the mountain.",
+ "#DEM5\\DEM5L031#No.",
+ "#DEM5\\DEM5N000#A chapel typical of the Acolytes of the Stars.",
+ "#DEM5\\DEM5N001#A grim-faced miner-colonist nods curtly at you.",
+ "#DEM5\\DEM5N002#A majestic view of Mt. Idyll can be seen through the skylight.",
+ "#DEM5\\DEM5N003#A sturdy man of advanced years, whose blue eyes meet yours with clarity, curiosity, and directness.",
+ "#DEM5\\DEM5N004#Boxes of supplies and mining equipment litter the floor.",
+ "#DEM5\\DEM5N005#Ensign Everts cannot take his eyes off the sight of Mount Idyll.",
+ "#DEM5\\DEM5N006#James Kirk takes time to rest and ponder the remainder of the mission.",
+ "#DEM5\\DEM5N007#McCoy looks anxiously about the room.",
+ "#DEM5\\DEM5N008#Spock waits for your command, patient as ever.",
+ "#DEM5\\DEM5N009#The Tellarite appears completely at home surrounded by humans, but the wrinkling on his brow indicates a great deal of worry.",
+ "#DEM5\\DEM5N010#He is too busy consoling the wounded man.",
+ "#DEM5\\DEM5N011#He is too busy consoling the wounded man.",
+ "#DEM5\\DEM5N012#They are too heavy to move.",
+ "#DEM5\\DEM5N013#This man is in no condition to talk.",
+
+
+ "#DEM6\\DEM6_001#Looks like a pile of junk if you ask me.",
+ "#DEM6\\DEM6_002#Well, what happens next?",
+ "#DEM6\\DEM6_003#Where did you find all this?",
+ "#DEM6\\DEM6_004#Mr. Spock, See what you can dig up from that old fashioned computer terminal.",
+ "#DEM6\\DEM6_005#Mr. Spock, see what you can do about that hand.",
+ "#DEM6\\DEM6_006#Yes, tell us about these things.",
+ "#DEM6\\DEM6_007#A vintage 801286 of the mid-21st century. It is a fine museum piece.",
+ "#DEM6\\DEM6_008#Fascinating, Captain. It is an Ardak-4 molecular synthesizer. A museum piece in perfect working order.",
+ "#DEM6\\DEM6_009#Residue of several different compounds are in the tubes. None of the compounds would explain the sightings.",
+ "#DEM6\\DEM6_010#A completely ordinary nickel-iron meteorite.",
+ "#DEM6\\DEM6_011#A manufactured vanadium-tungsten alloy of considerable age and indeterminate use.",
+ "#DEM6\\DEM6_012#A sample of a local lifeform called a siloti, the largest animal reported on this planet. About the size of an Earth housecat, the silotis have an insectoid-reptilian genotype with praying mantis like forelimbs.",
+ "#DEM6\\DEM6_013#A variety of rock specimens, including native silver, azurite, crystalline forms of various minerals.",
+ "#DEM6\\DEM6_014#Captain, this appears to be a model of the Earth. Notice how it models the proper situation for a total eclipse?",
+ "#DEM6\\DEM6_015#Do I look like a pointy eared, green blooded, know-it-all alien?",
+ "#DEM6\\DEM6_016#He's in fine physical and mental condition, Jim.",
+ "#DEM6\\DEM6_017#Jim, that would destroy the glass case!",
+ "#DEM6\\DEM6_018#We've got to get this to brother Chub as quickly as possible, Jim!",
+ "#DEM6\\DEM6_019#I think we should wait and talk to the owner when he comes back, Jim.",
+ "#DEM6\\DEM6_020#This place looks real comfortable, a place to combine work and contemplation. The man's got an eye for the beauty of useful things, and the use of beautiful things. I think we could get along fine.",
+ "#DEM6\\DEM6_021#Fossil shells in limestone substrate, compatible with local geologic features.",
+ "#DEM6\\DEM6_022#I feel like this is delicate as surgery, Captain, but I've got it back in working order now.",
+ "#DEM6\\DEM6_023#I read a collection of small items of no evident value. I would characterize this as a small museum display, Captain.",
+ "#DEM6\\DEM6_024#This machinery is delicate but I have managed to repair the circuitry.",
+ "#DEM6\\DEM6_025#This study represents a man with a keen mind, Captain. To judge by what I see, there is little which does not interest him. The equipment is antiquated, but practical.",
+ "#DEM6\\DEM6_026#Fascinating, these berries can be used to synthesize Hypo-Dytoxin.",
+ "#DEM6\\DEM6_027#The settings on the Ardak-4 have already been adjusted. Simply place the berry in the machine and the Hypo-Dytoxin will be synthesized.",
+ "#DEM6\\DEM6_028#There is no need to threaten me if you need to use my study.",
+ "#DEM6\\DEM6_029#Bless you for returning my things.",
+ "#DEM6\\DEM6_030#Everything of this world is secondary to the perfection of the next, Captain.",
+ "#DEM6\\DEM6_031#Here and there. Much of it was brought to me by others exploring widely.",
+ "#DEM6\\DEM6_032#How interesting! Praise God for this opportunity. He brings me through you.",
+ "#DEM6\\DEM6_033#I believe this is evidence of the cataclysm which destroyed the moon of Pollux V eons past. I've constructed a theoretical model based on analysis of the planet's ring of what things might have been like. I think that the moon, like Earth's moon, would have made a total eclipse of the sun possible. I would have liked to have seen that, for conditions making a perfect total eclipse are rare in the Universe. Our God creates great wonders.",
+ "#DEM6\\DEM6_034#I enjoy talking about these treasures.",
+ "#DEM6\\DEM6_035#I never dreamed that Starfleet would be interested in my discoveries, Captain, but our God often surprises us.",
+ "#DEM6\\DEM6_036#One of the oldest forms I've seen on this planet. Our God makes beautiful things, indeed.",
+ "#DEM6\\DEM6_037#See how the fingertips have microsized sensors? I wonder what use they may have.",
+ "#DEM6\\DEM6_038#The skull of a modern siloti, the largest creature native to this planet, about the size of a housecat from Earth. The silotis combine a rather insectoid pattern with four-legged reptilian form including praying mantis-like forelimbs.",
+ "#DEM6\\DEM6_039#This chunk of rock is a greatly weathered example of a vanadium-tungsten alloy -- which doesn't occur naturally. It is my best evidence that the area was previously inhabited.",
+ "#DEM6\\DEM6_040#True curiosities, nothing more. I think they're very pretty, don't you?",
+ "#DEM6\\DEM6_041#Very well. I can't imagine why, but if you have a further interest in any of this, take what you like. But please remember to return my treasures when you are done with them.",
+ "#DEM6\\DEM6_042#Welcome to my study! Feel free to look around. My medical and scientific equipment is surely not so sophisticated as you are accustomed to, but if there is anything you wish to use, please feel free. Also, I would be interested in anything you might have to show me.",
+ "#DEM6\\DEM6_043#What a fascinating piece of equipment! Highly advanced technology. You see here, it seems to have been damaged, however. Take it to my workbench and let's see if it can be repaired. I fear my hands are too shaky to perform such fine work, but perhaps one of you can do it.",
+ "#DEM6\\DEM6_044#You are interested in my little museum of curiosities?",
+ "#DEM6\\DEM6_045#Mineral Specimens,",
+ "#DEM6\\DEM6_046#Meteorite,",
+ "#DEM6\\DEM6_047#Fossil Shells,",
+ "#DEM6\\DEM6_048#Skull of a small alien animal,",
+ "#DEM6\\DEM6_049#Twist of Metal,",
+ "#DEM6\\DEM6_050#or would you rather move on to something else?",
+ "#DEM6\\DEM6_051#Shall I go into...",
+ "#DEM6\\DEM6_052#I believe Mr. Spock would be more helpful with this, sir.",
+ "#DEM6\\DEM6_053#I wonder if any of this stuff might be useful.",
+ "#DEM6\\DEM6N000#A common-looking meteorite, about the size of a fist.",
+ "#DEM6\\DEM6N001#A glass-fronted display of mineral specimens including a meteorite, a few fossil shells, the skull of a cat-sized alien animal, and a very encrusted twist of metal.",
+ "#DEM6\\DEM6N002#A majestic view of Mt. Idyll can be seen through the skylight.",
+ "#DEM6\\DEM6N003#A multi-purpose work space, with fine, well-worn tools and equipment close at hand.",
+ "#DEM6\\DEM6N004#An antiquated molecular synthesizer sits in the corner.",
+ "#DEM6\\DEM6N005#An old corroded twist of metal.",
+ "#DEM6\\DEM6N006#An old-fashioned computer. It appears to have some type of simulation running.",
+ "#DEM6\\DEM6N007#Assorted pieces of glass rest on this table, from ancient beakers, to double burners.",
+ "#DEM6\\DEM6N008#Captain Kirk wonders what is going to happen on this mission.",
+ "#DEM6\\DEM6N009#Dr. McCoy is glad that he is in a warm, heated room.",
+ "#DEM6\\DEM6N010#Ensign Everts finds himself fascinated by the Acolytes and their planet.",
+ "#DEM6\\DEM6N011#Fossil shells of esthetic interest.",
+ "#DEM6\\DEM6N012#It is locked.",
+ "#DEM6\\DEM6N013#It opens.",
+ "#DEM6\\DEM6N014#It opens.",
+ "#DEM6\\DEM6N015#Mr. Spock finds the scientific equipment in this room to be rather primitive.",
+ "#DEM6\\DEM6N016#Pretty rock specimens.",
+ "#DEM6\\DEM6N017#The braincase of a small creature, looking slightly insectoid, somewhat reptilian.",
+ "#DEM6\\DEM6N018#The mechanism in the hand has already been repaired.",
+ "#DEM6\\DEM6N019#The old man carefully returns the items to his cabinet.",
+ "#DEM6\\DEM6N020#You tinker with it but do nothing significant.",
+ "#DEM6\\DEM6N021#Brother Stephen watches patiently as you examine his study.",
+ "#DEM6\\DEM6N022#The glass case is locked.",
+ "#DEM6\\DEM6N023#The machine synthesizes a quantity of Hypo-Dytoxin.",
+ "#DEM6\\DEM6N024#This appears to be a study and lab. The equipment looks very ancient.",
+
+
+ "#TUG0\\TUG0_001#I'm going to have a word for you, Spock, if we appear inside the door!",
+ "#TUG0\\TUG0_002#Analysis, Lt. Christensen",
+ "#TUG0\\TUG0_003#Beam us out of here.",
+ "#TUG0\\TUG0_004#Bones, later. Kirk to Enterprise.",
+ "#TUG0\\TUG0_005#Can they be repaired, Spock?",
+ "#TUG0\\TUG0_006#Get what you can from this area -- let's get moving.",
+ "#TUG0\\TUG0_007#I can't see them winning any popularity contests, Bones.",
+ "#TUG0\\TUG0_008#I've always been a gambler, Spock. Figure out what you'll need.",
+ "#TUG0\\TUG0_009#Let's not look too far ahead, Mr. Spock.",
+ "#TUG0\\TUG0_010#Mr. Spock, you're a genius!",
+ "#TUG0\\TUG0_011#Okay, but let's not stay too long in one place.",
+ "#TUG0\\TUG0_012#Provided the Elasi don't have anything to say about it.",
+ "#TUG0\\TUG0_013#Spock, we don't have two days. If we can repair the transporter, we might be able to transport onto the bridge and capture the Elasi.",
+ "#TUG0\\TUG0_014#Captain, I need to find a bit that will fit into the transmogrifier before I can go further with this.",
+ "#TUG0\\TUG0_015#Even our most efficient Chief Engineer Scott would have trouble repairing this damage in less than two days.",
+ "#TUG0\\TUG0_016#Damn it, Jim. I'm a doctor, not a rocket scientist.",
+ "#TUG0\\TUG0_017#He will be all right, but we shouldn't move him.",
+ "#TUG0\\TUG0_018#He's not hurt badly. I can revive him.",
+ "#TUG0\\TUG0_019#I don't think he should be moved, Jim.",
+ "#TUG0\\TUG0_020#Well, at least I'm not picking up residue of any biological weapons. The Elasi used some restraint if you can call it that.",
+ "#TUG0\\TUG0_021#And any hostages on the bridge will be killed when the bomb goes off! No, Jim, that's inhuman!",
+ "#TUG0\\TUG0_022#I wouldn't go that far, Jim. But I do have to congratulate you, Mr. Spock. Now we can really risk shooting our atoms around the universe. Is this really necessary, Jim?",
+ "#TUG0\\TUG0_023#My God Jim, what have you done! You killed them all. You probably blew up the whole damn bridge.",
+ "#TUG0\\TUG0_024#They can forget about my vote.",
+ "#TUG0\\TUG0_025#Well Jim, there's one thing I can tell you -- I don't like Elasi.",
+ "#TUG0\\TUG0_026#Well, with any luck, you won't have to worry about that for quite some time.",
+ "#TUG0\\TUG0_027#You cold blooded emotionless...",
+ "#TUG0\\TUG0_028#I am registering energy residue from phaser fire and phaser grenade detonations. There are readings of another energy weapon, but the type is unknown.",
+ "#TUG0\\TUG0_029#I attach these here... Now all I need is a spare length of wiring.",
+ "#TUG0\\TUG0_030#I believe this would be in Dr. McCoy's field of expertise.",
+ "#TUG0\\TUG0_031#I strongly recommend that we keep our silence, Captain. The Elasi are quite capable of tracing any communication from within this vessel.",
+ "#TUG0\\TUG0_032#I think that does it -- a Comb Bit for the transmogrifier. Now I can continue repairs on the transporter controls. ",
+ "#TUG0\\TUG0_033#I'll be able to use this later, so I want to keep it -- but I need to get some equipment in here first.",
+ "#TUG0\\TUG0_034#The bits are not long enough, I need a longer piece of wire.",
+ "#TUG0\\TUG0_035#The parts fit together satisfactorily.",
+ "#TUG0\\TUG0_036#Captain, a thorough analysis is required.",
+ "#TUG0\\TUG0_037#Captain, the ship will crash into the planet in 18.32 seconds, I would recommend, leaving the ship immediately.",
+ "#TUG0\\TUG0_038#I can attempt to jury-rig repairs if I can find parts. However, there is only a 67.357 percent probability of success.",
+ "#TUG0\\TUG0_039#The controls are set for just inside the bridge door Captain.",
+ "#TUG0\\TUG0_040#The controls have been virtually destroyed, Captain.",
+ "#TUG0\\TUG0_041#To say nothing of the possible damage to the bridge controls.",
+ "#TUG0\\TUG0_042#When this operation is complete, Captain, we should have Mr. Scott or Transporter Chief Kyle come here to assist with the repairs.",
+ "#TUG0\\TUG0_043#With chief Engineer Scott's assistance, I believe we could get them in perfect working order in two days.",
+ "#TUG0\\TUG0_F30#I suppose I should be grateful to see anyone after that. I thought I was dead.",
+ "#TUG0\\TUG0_F31#Thank you, Doctor. Be careful, Captain, the Elasi like to set boobytraps. if you need any equipment I've got my tools in this workspace.",
+ "#TUG0\\TUG0_S06#Aye Captain.",
+ "#TUG0\\TUG0_S11#Captain, you're alive!",
+ "#TUG0\\TUG0L006#This is just like their raid on Damocles Station, hard, fast, and dirty.",
+ "#TUG0\\TUG0L008#If we could get past the forcefield on the door of the bridge, we should be able to surprise them for sure.",
+ "#TUG0\\TUG0L009#Security analysis, sir: if we transport onto the bridge, we'll have the drop on them -- assuming Mr. Spock has the transporter working porperly.",
+ "#TUG0\\TUG0L010#Since we have a bomb, Captain, we could rearm it, transport it onto the bridge, and perhaps the Elasi will flee into the hallway. Then we could capture them.",
+ "#TUG0\\TUG0N000#A Runcinate Transmogrifier: An engineering tool used in the maintainance of transporters, which can be fitted with bits having a variety of irregularly serrated surfaces.",
+ "#TUG0\\TUG0N001#A small bomb appears to have damaged the transporter controls.",
+ "#TUG0\\TUG0N002#Crewman Simpson.",
+ "#TUG0\\TUG0N003#James T. Kirk cautiously watches the area.",
+ "#TUG0\\TUG0N004#Lieutenant Christensen stands ready.",
+ "#TUG0\\TUG0N005#McCoy wonders how many patients he'll have on this mission.",
+ "#TUG0\\TUG0N006#Phaser Welder is now charged.",
+ "#TUG0\\TUG0N007#Spock quietly analyzes the damaged areas of this transporter room.",
+ "#TUG0\\TUG0N008#The cabinet is empty.",
+ "#TUG0\\TUG0N009#The transporter bay has been damaged in a recent fire fight.",
+ "#TUG0\\TUG0N010#The wire scraps are too small, they melt instead of fusing together, and you're left with nothing. ",
+ "#TUG0\\TUG0N011#These doors have been scarred by phaser fire. There was a battle here.",
+ "#TUG0\\TUG0N012#These transporter controls are now operational. They are set for just inside the bridge door.",
+ "#TUG0\\TUG0N013#This is the main transporter pad of the Masada.",
+ "#TUG0\\TUG0N014#This man was obviously the transporter engineer. He is unconscious, but alive.",
+
+
+ "#TUG1\\TUG1_001#This is a mess now, isn't it?",
+ "#TUG1\\TUG1_002#A forcefield of unusual configurations has been erected in front of the doorway which leads into the bridge. I don't think it would be healthy to approach too closely, Captain.",
+ "#TUG1\\TUG1_003#I'm getting life readings both on the bridge and in the brig, Jim.",
+ "#TUG1\\TUG1_004#Jim, I can only perform medical miracles not engineering ones.",
+ "#TUG1\\TUG1_005#Jim, I'm picking up 11 life forms in the brig. That accounts for over half the crew. I don't like what that indicates.",
+ "#TUG1\\TUG1_006#Nothing unusual is detected.",
+ "#TUG1\\TUG1_007#The force field is interfering too much to get an accurate reading, Jim.", // TYPO
+ "#TUG1\\TUG1_008#My daddy would have sent me to bed without supper if I'd done something like this.",
+ "#TUG1\\TUG1_009#Five phasers without power packs, a drained phaser welder, insulation and bits of wire, and droplets of cooled molten metal.",
+ "#TUG1\\TUG1_010#I don't think we can bring down that forcefield, Captain. If we could, though, it might be less risky than trying to transport onto the bridge.",
+ "#TUG1\\TUG1_011#I strongly recommend that we keep our silence, Captain. The Elasi are quite capable of tracing any communication from within this vessel.",
+ "#TUG1\\TUG1_012#I think that does it -- a Comb Bit for the transmogrifier. Now I can continue repairs on the transporter controls. ",
+ "#TUG1\\TUG1_013#If we could find a point to interrupt the flow of power to the field we could gain access to the bridge, Captain.",
+ "#TUG1\\TUG1_014#Strong electromagnetic readings come from the doorway at the far end of the hallway.",
+ "#TUG1\\TUG1_015#That did it. The field is deactivated, Captain.",
+ "#TUG1\\TUG1_016#The field is absorbing the energy.",
+ "#TUG1\\TUG1_017#he parts fit together satisfactorily.",
+ "#TUG1\\TUG1_018#Tricorder readings indicate an indeterminate number of people in the brig. At least 2 are armed with phasers. I recommend caution when entering.",
+ "#TUG1\\TUG1L000#I doubt that our phasers could get through that, Captain.",
+ "#TUG1\\TUG1L005#This corridor provides access to the transporter room, Captain. It is secure.",
+ "#TUG1\\TUG1N000#A tangle of mangled equipment, reduced to junk. There are the remains of five phasers without power packs, a drained phaser welder, and scraps of wire and uncertain bits of metal junk.",
+ "#TUG1\\TUG1N001#According to the deckplans of this class of Starship, this is the entrance to the ship's brig.",
+ "#TUG1\\TUG1N002#Lt. Christensen is carefully watching the hallway",
+ "#TUG1\\TUG1N003#McCoy is fidgeting around.",
+ "#TUG1\\TUG1N004#Phaser Welder is now charged.",
+ "#TUG1\\TUG1N005#Some kind of forcefield appears to cover the door. ",
+ "#TUG1\\TUG1N006#Spock is analyzing the surroundings.",
+ "#TUG1\\TUG1N007#The field has already been deactivated.",
+ "#TUG1\\TUG1N008#The field has already been deactivated",
+ "#TUG1\\TUG1N009#The wire scraps are too small, they melt instead of fusing together, and you're left with nothing. ",
+ "#TUG1\\TUG1N010#This viewscreen/ communication terminal has been damaged beyond repair.",
+ "#TUG1\\TUG1N011#Twisted debris has been scattered along the side of the corridor.",
+ "#TUG1\\TUG1N013#You are in a typical starship corridor.",
+
+
+ "#TUG2\\TUG2_001#My God, what have we done?",
+ "#TUG2\\TUG2_002#They've turned this freighter into a prison barge.",
+ "#TUG2\\TUG2_003#Spock see if you can disarm this.",
+ "#TUG2\\TUG2_004#A medium strength phaser bomb. The brig force field would contain the explosion but it would kill the crew members within the cell. I recommend that we find a way of disarming it, Captain.",
+ "#TUG2\\TUG2_005#All of the crewmen are dead, Captain.",
+ "#TUG2\\TUG2_006#Captain, if we could manage to overload the forcefield, it would probably detonate the bomb before we could rescue the crewmen.",
+ "#TUG2\\TUG2_007#Captain, the switch has been booby-trapped to detonate a bomb, presumably inside the brig somewhere.",
+ "#TUG2\\TUG2_008#Captain, this wiring may prove useful in repairing the transporter.",
+ "#TUG2\\TUG2_009#Damn it, Jim, I'm a doctor, not an electrical engineer! I'm likely to blow us all up.",
+ "#TUG2\\TUG2_010#I don't like the looks of this, Jim.",
+ "#TUG2\\TUG2_011#I don't operate on bombs, Jim, unless you like big explosions.",
+ "#TUG2\\TUG2_012#I don't think he is in any shape to respond.",
+ "#TUG2\\TUG2_013#I don't think he is in any shape to respond.",
+ "#TUG2\\TUG2_014#I don't think it would be a good idea to wake them up, Jim.",
+ "#TUG2\\TUG2_015#The crew is tired and has elevated signs from extreme stress, but they will survive.",
+ "#TUG2\\TUG2_016#The pirates won't wake for a while, but they are going to be quite unhappy when they do. I recommend that we not be here when they awake.",
+ "#TUG2\\TUG2_017#These aren't the right tools for the right job, Jim.",
+ "#TUG2\\TUG2_018#We came here to save these people, now look what we've done!",
+ "#TUG2\\TUG2_019#They're all dead, Jim. What in God's name were you thinking?",
+ "#TUG2\\TUG2_020#I see that the Elasi live up to their reputation, Captain.",
+ "#TUG2\\TUG2_021#The parts fit together satisfactorily.",
+ "#TUG2\\TUG2_022#I believe that no diety had any bearing on this doctor, but the Captain should have been more careful. Starfleet will not be pleased by their deaths.",
+ "#TUG2\\TUG2_023#I'll do my best, Captain.",
+ "#TUG2\\TUG2_024#There. I believe the bomb is now defused, Captain.",
+ "#TUG2\\TUG2_025#I'm on your side, Sir! There's no need to fire at me.",
+ "#TUG2\\TUG2_026#Thank you for freeing us. You'd better take the bridge before they suspect anything is up.",
+ "#TUG2\\TUG2_027#You'd better hurry up or they'll catch on, Sir!",
+ "#TUG2\\TUG2_028#But if you used a charged Phaser Welder two feet to the left of the door and one foot off the ground, you might be able to shut down the forcefield, and get a jump on the Elasi.",
+ "#TUG2\\TUG2_029#Thank you for freeing us, Captain! We'll secure the area so they don't come up behind you.",
+ "#TUG2\\TUG2_030#We've had electrical problems with our door to our bridge, Captain. The Elasi don't know we put in an electric shutdown device -- you'd never find it by chance.",
+ "#TUG2\\TUG2_112#I think that does it -- a Comb Bit for the transmogrifier. Now I can continue repairs on the transporter controls. ",
+ "#TUG2\\TUG2J000#Ouch! That hurt!",
+ "#TUG2\\TUG2J001#Don't you know any better?",
+ "#TUG2\\TUG2J002#What kind of idiot are you?",
+ "#TUG2\\TUG2J003#I recommend extreme caution, Captain. We must be ready to expect anything.",
+ "#TUG2\\TUG2L002#I'm just a security officer, sir.",
+ "#TUG2\\TUG2L004#It's my fault. They did the same thing on Damocles Station... ",
+ "#TUG2\\TUG2L007#I believe I can disarm this, Captain.",
+ "#TUG2\\TUG2L011#There, It's defused.",
+ "#TUG2\\TUG2L085#Hey, what are you doing here?",
+ "#TUG2\\TUG2L086#You imperialist Federation scum! We will never surrender! Cereth is a great man with a great vision. I spit upon you.",
+ "#TUG2\\TUG2N000#A bomb located just inside the forcefield.",
+ "#TUG2\\TUG2N001#He doesn't look to friendly.",
+ "#TUG2\\TUG2N002#Kirk falls to the floor stunned.",
+ "#TUG2\\TUG2N003#Kirk seems concerned by what he sees in this room.",
+ "#TUG2\\TUG2N004#Lt. Christensen is fumbling for his phaser",
+ "#TUG2\\TUG2N005#McCoy is looking at the guards.",
+ "#TUG2\\TUG2N006#Phaser Welder is now charged.",
+ "#TUG2\\TUG2N007#Spock raises an eyebrow.",
+ "#TUG2\\TUG2N009#The wire scraps are too small, they melt instead of fusing together, and you're left with nothing. ",
+ "#TUG2\\TUG2N010#These wires look like a modification of some sort.",
+ "#TUG2\\TUG2N011#This appears to be the button that turns the brig forcefield on and off.",
+ "#TUG2\\TUG2N012#This door leads back to the main corridor.",
+ "#TUG2\\TUG2N013#This guard is stunned.",
+ "#TUG2\\TUG2N014#This guard is stunned.",
+ "#TUG2\\TUG2N015#This guard is tied up.",
+ "#TUG2\\TUG2N016#This guard is tied up.",
+ "#TUG2\\TUG2N017#You are in the brig of the Masada. Nine of the crew members are held in the cell. The berets of two dead Elasi guards litter the floor.",
+ "#TUG2\\TUG2N018#You are in the brig of the Masada. Nine of the crew members are held in the cell. Two Elasi guards lie on the floor.",
+ "#TUG2\\TUG2N019#You are in the brig of the Masada. The cell contains the smoldering remains of nine crew members. The berets of two dead Elasi guards litter the floor.",
+ "#TUG2\\TUG2N020#You are in the brig of the Masada. The cell contains the smoldering remains of nine crew members. Two Elasi guards lie on the floor.",
+ "#TUG2\\TUG2N021#You are in the brig of the Masada. The cell is open freeing the nine crew members. Two Elasi guards lie on the floor.",
+ "#TUG2\\TUG2N022#You are in the brig of the Masada. The cell is open freeing the nine crew members. The hats of two dead Elasi guards litter the floor.",
+ "#TUG2\\TUG2N023#You are in the brig of the Masada.",
+ "#TUG2\\TUG2N024#You can't. it is located just inside the forcefield.",
+ "#TUG2\\TUG2N025#You have been taken captive by Elasi Cereth, and you know Starfleet does not negotiate with terrorists. As you look forward to a long captivity, you wonder who will take over command of the Enterprise. Better luck next time.",
+ "#TUG2\\TUG2N026#You've set off some type of booby trap. The force field protected you from the blast, but everyone inside the brig is dead.",
+ "#TUG2\\TUG2N037#He doesn't look to friendly.",
+ "#TUG2\\TUG2N106#Only the red beret of the elasi guard remains.",
+ "Snip...snip...snip.",
+
+
+ "#TUG3\\TUG3_001#Scotty, beam down a security team to the bridge. We have regained control.",
+ "#TUG3\\TUG3_002#Check and mate, Elasi. Don't do anything foolish.",
+ "#TUG3\\TUG3_003#Freeze, don't even think about it.",
+ "#TUG3\\TUG3_004#It's over, Cereth. Surrender and I'll guarantee the lives of you and your crew.",
+ "#TUG3\\TUG3_005#Mr. Scott, beam us out of here.",
+ "#TUG3\\TUG3_006#Mr. Scott, get us out of here.",
+ "#TUG3\\TUG3_007#Mr. Sulu, we need some help over here.",
+ "#TUG3\\TUG3_008#Captain, I highly recommend returning to the Enterprise within the next 57.32 seconds.",
+ "#TUG3\\TUG3_009#Captain, I recommend that Mr. Sulu stabilize the Masada's orbit from the Enterprise.",
+ "#TUG3\\TUG3_011#I think we should return to the Enterprise before we burn up, Jim.",
+ "#TUG3\\TUG3_012#I'm a doctor, not a space jockey! Talk to Mr. Sulu about fixing our orbit!",
+ "#TUG3\\TUG3_013#Jim, that man is mad.",
+ "#TUG3\\TUG3_015#Aye, Captain, using prefix code override to stabilize Masada's orbit. Sulu out.",
+ "#TUG3\\TUG3_F27#Foolhardy words, Kirk. You have underestimated me at every turn.",
+ "#TUG3\\TUG3_S07#Aye, Captain.",
+ "#TUG3\\TUG3_S08#Aye, Captain.",
+ "#TUG3\\TUG3L003#I'm just a security officer, sir.",
+ "#TUG3\\TUG3L080#A blow struck for freedom, Captain. Now I surrender.",
+ "#TUG3\\TUG3L081#Bridge to brig, kill the hostages!",
+ "#TUG3\\TUG3L083#I still have a gambit or two left, my friend.",
+ "#TUG3\\TUG3L084#You are an honorable and worthy opponent, Kirk. I accept your offer.",
+ "#TUG3\\TUG3N000#Dr. McCoy appears a bit restless.",
+ "#TUG3\\TUG3N001#Lt. Christensen is carefully observing Elasi.",
+ "#TUG3\\TUG3N002#Spock is analyzing the surroundings.",
+ "#TUG3\\TUG3N003#The body of Elasi Cereth lies on the ground.",
+ "#TUG3\\TUG3N004#The body of the Elasi clanmember lies on the ground here.",
+ "#TUG3\\TUG3N005#The Elasi clanmember glares at the party.",
+ "#TUG3\\TUG3N006#The Masada goes down in a fireball over Beta Myamid, with you on it. Better luck next season.",
+ "#TUG3\\TUG3N007#This is a standard Starfleet bridge, perhaps not as impressive as the one on the Enterprise. There are quite a few pirates here.",
+ "#TUG3\\TUG3N008#You carefully eye the chief lieutenant of the Elasi Clan, Elasi Cereth.",
+
+
+ "#LOV0\\LOV0_001#A medical data file is attached -- your bailiwick, Bones.",
+ "#LOV0\\LOV0_002#Spock, check out the station's computer and see what you can dig up.",
+ "#LOV0\\LOV0_003#Strange that the bridge is empty. Stay sharp everyone. The station's computer system might give us some answers.",
+ "#LOV0\\LOV0_004#Gentlemen, I think we have more pressing problems.",
+ "#LOV0\\LOV0_005#Doctor, you may be interested in the medical data file appended to the log.",
+ "#LOV0\\LOV0_006#I'm picking up some strange, airborne virus. I can't identify it without more information.",
+ "#LOV0\\LOV0_007#Nice view of the Romulan ship. How comforting.",
+ "#LOV0\\LOV0_008#Except for the Oroborus virus, I'm not picking up anything unusual.",
+ "#LOV0\\LOV0_009#Jim, there is an appended medical database online. Also, it would be useful for me to experiment on how the virus grows in the presence of different gases. I'm sure the station has the necessary equipment.",
+ "#LOV0\\LOV0_010#Ouch!",
+ "#LOV0\\LOV0_011#Hee hee hee hee...",
+ "#LOV0\\LOV0_012#I think we're all feeling just woooonderful!",
+ "#LOV0\\LOV0_013#I'm a little teapot short and stout...",
+ "#LOV0\\LOV0_014#I'm floating up and up and up...",
+ "#LOV0\\LOV0_015#I'm so happy, I want to hug the world!",
+ "#LOV0\\LOV0_016#Ooka! Ooka! Ooka!",
+ "#LOV0\\LOV0_017#Row, row, row, your boat. Aww, come on Spock.",
+ "#LOV0\\LOV0_019#Spock, ol' buddy, ol' friend, you look soo funny standing there!",
+ "#LOV0\\LOV0_020#The hills are alive... With the sounds of...",
+ "#LOV0\\LOV0_021#The moon in June's a boon to tunes... er, something like that.",
+ "#LOV0\\LOV0_022#This is how I want to feel all the time!",
+ "#LOV0\\LOV0_023#Now listen here, you pointy-eared...",
+ "#LOV0\\LOV0_024#Now that's interesting -- there's more here. All of Dr. Marcus' research data on the Oroborous virus. Let me see...virus growth patterns, pneumonococcal mimic affecting Romulo-Vulcan genotype ... alveoli involvement in-- Boy, Jim, this bug works fast!",
+ "#LOV0\\LOV0_025#How many Admirals does it take to wire in a logic transmogrifier?",
+ "#LOV0\\LOV0_026#I don't believe you'd behave like this if you could avoid it.",
+ "#LOV0\\LOV0_027#Nothing unusual here, Captain, though the station's computer may be able to tell us something.",
+ "#LOV0\\LOV0_028#Nothing unusual is detected.",
+ "#LOV0\\LOV0_029#Please, gentlemen, try to control yourselves",
+ "#LOV0\\LOV0_030#That is not logical, Captain.",
+ "#LOV0\\LOV0_031#The main computer banks of the Ark7. It looks like someone has recently been rummaging through the main data banks.",
+ "#LOV0\\LOV0_033#Try taking deep breaths to clear your heads.",
+ "#LOV0\\LOV0_035#Is this really the time to catch up on your reading, Doctor?",
+ "#LOV0\\LOV0_036#I think Mr. Spock would be more qualified in examining the station's computer.",
+ "#LOV0\\LOV0_037#A detailed data file is with the log. Do you want to look at it, Doctor McCoy?",
+ "#LOV0\\LOV0_038#This is a very dangerous situation, sir. We should proceed with caution.",
+ "#LOV0\\LOV0_039#Hee hee hee hee...",
+ "#LOV0\\LOV0_040#I think we're all feeling just woooonderful!",
+ "#LOV0\\LOV0_041#I'm a little teapot short and stout...",
+ "#LOV0\\LOV0_042#I'm floating up and up and up...",
+ "#LOV0\\LOV0_043#I'm so happy, I want to hug the world!",
+ "#LOV0\\LOV0_045#Ooka! Ooka! Ooka!",
+ "#LOV0\\LOV0_046#Row, row, row, your boat. Aww, come on Spock.",
+ "#LOV0\\LOV0_047#Spock, ol' buddy, ol' friend, you look soo funny standing there!",
+ "#LOV0\\LOV0_048#The hills are alive... With the sounds of...",
+ "#LOV0\\LOV0_049#The moon in June's a boon to tunes... er, something like that.",
+ "#LOV0\\LOV0_050#This is how I want to feel all the time!",
+ "#LOV0\\LOV0_101#Fascinating. I am experiencing an urge to laugh.",
+ "#LOV0\\LOV0_102#I am a Vulcan. I must resist these unchecked emotions.",
+ "#LOV0\\LOV0_103#Logic... What happened to my logic?", // TYPO
+ "#LOV0\\LOV0_104#Jim, is this how you feel on shore leave?",
+ "#LOV0\\LOV0_105#I remember my mother trying to tell me jokes when I was a child. Now, I finally understand them.",
+ "#LOV0\\LOV0_106#Romulan laughing gas. My father would never approve.",
+ "#LOV0\\LOV0_107#Why do they call you \"Bones\", doctor?",
+ "#LOV0\\LOV0_124#I'm trying to be patient, Captain.",
+ "#LOV0\\LOV0N000#A Romulan bird of prey hovers menacingly on the view screen.",
+ "#LOV0\\LOV0N001#It is bolted down and cannot be moved.",
+ "#LOV0\\LOV0N002#James Kirk watches the Romulan ship with concern.",
+ "#LOV0\\LOV0N003#Lt. Ferris watches the exits carefully.",
+ "#LOV0\\LOV0N004#McCoy is fidgeting around.",
+ "#LOV0\\LOV0N005#Spock is analyzing the surroundings.",
+ "#LOV0\\LOV0N006#This computer terminal is linked into the station's main computer. It is currently running an open file of log programs.",
+ "#LOV0\\LOV0N007#This is a heavily secured door, leading to another section of the station. Its access code has been breached.",
+ "#LOV0\\LOV0N008#This is a standard door, leading to another room on this deck.",
+ "#LOV0\\LOV0N009#You are on the bridge of the ARK7.",
+
+
+ "#LOV1\\LOV1_001#When you are finished admiring all the equipment Bones, maybe you can help us figure out what's going on here.",
+ "#LOV1\\LOV1_002#Captain, I believe Dr. McCoy has the necessary skills to run that equipment.",
+ "#LOV1\\LOV1_003#It is a standard research lab.",
+ "#LOV1\\LOV1_004#The seals on these dishes are intact, but that's all I can determine.",
+ "#LOV1\\LOV1_005#This is a very well-equipped laboratory, Captain. Perhaps Dr. McCoy could be of some use here.",
+ "#LOV1\\LOV1_006#A Hawking Neutrino Accelerator. It is one of the finest in production today.",
+ "#LOV1\\LOV1_007#A Khrygellian II Basic Compound Distillator. Excellent piece of equipment for reducing complex materials to their basic compounds.",
+ "#LOV1\\LOV1_008#Careful, Jim! That's a distillator, not a can-opener.",
+ "#LOV1\\LOV1_009#Except for the Oroborus virus, I'm not picking up anything unusual.",
+ "#LOV1\\LOV1_010#I'm picking up some strange, airborne virus. I can't identify it without more information.",
+ "#LOV1\\LOV1_011#Jim, this lab is incredible! What I wouldn't give to have some of this equipment on the Enterprise.",
+ "#LOV1\\LOV1_012#That nozzle is for anti-agents only, Jim.",
+ "#LOV1\\LOV1_013#That's for Virus Cultures only, Jim.",
+ "#LOV1\\LOV1_014#There is already something in the chamber.",
+ "#LOV1\\LOV1_015#There is no specimen in the chamber.",
+ "#LOV1\\LOV1_016#This isn't a microwave, Jim! This is a delicate piece of equipment!",
+ "#LOV1\\LOV1_017#Jim, these viral cultures are alive. I can use them to work on a cure.",
+ "#LOV1\\LOV1_018#Eureka! This is it, Jim! There's not much, but all I need to do is synthesize some more, and we're in business.",
+ "#LOV1\\LOV1_019#This isn't the result I was hoping for, Jim.",
+ "#LOV1\\LOV1_021#We have to attach something to the nozzle first.",
+ "#LOV1\\LOV1_022#Residue of a viral agent is still within the chamber.",
+ "#LOV1\\LOV1_023#There are multiple culture samples of the virus within the freezer, Captain.",
+ "#LOV1\\LOV1_024#Arrggghhh!",
+ "#LOV1\\LOV1_025#Aieee!!",
+ "#LOV1\\LOV1_026#Sir, I think Dr. McCoy should run it. I may break it.",
+ "#LOV1\\LOV1_027#This level appears to be deserted, sir, but I'm worried about a Romulan counter-attack. They outnumber us.",
+ "#LOV1\\LOV1_028#Watch out, sir! It looks like the Romulans have taken control of the lower decks.",
+ "#LOV1\\LOV1N000#A device to accelerate neutrinos. Not much good for anything else.",
+ "#LOV1\\LOV1N001#Dr. McCoy is thinking about chemical formulas.",
+ "#LOV1\\LOV1N002#Ensign Ferris doesn't know much about chemical formulas.",
+ "#LOV1\\LOV1N003#James Tiberius Kirk.",
+ "#LOV1\\LOV1N004#Mr. Spock is thinking about chemical formulas.",
+ "#LOV1\\LOV1N005#You already have a culture dish.",
+ "#LOV1\\LOV1N006#You take the Oroborus virus culture.",
+ "#LOV1\\LOV1N007#Done.",
+ "#LOV1\\LOV1N008#It gets a little colder, but nothing else happens.",
+ "#LOV1\\LOV1N009#The chamber is empty.",
+ "#LOV1\\LOV1N010#The Freezer unit is too large to take.",
+ "#LOV1\\LOV1N011#The nozzle is empty.",
+ "#LOV1\\LOV1N012#There are many virus culture dishes, all of them labeled, \"Oroborus Virus -- DANGER!!\".",
+ "#LOV1\\LOV1N013#There is a single viral culture dish in here, and it contains a sample of the Oroborus cure.",
+ "#LOV1\\LOV1N014#This chamber is where virus samples are placed.",
+ "#LOV1\\LOV1N015#This device is used for the rapid reproduction of virus cultures in the presence of suspected anti-agents.",
+ "#LOV1\\LOV1N016#This is a distillator, used to isolate specific compounds from raw material.",
+ "#LOV1\\LOV1N017#This is a large engineering safety door with heavy shielding. Its entry codes seem to be breached.",
+ "#LOV1\\LOV1N018#This is a large refrigeration unit.",
+ "#LOV1\\LOV1N019#This is a research lab, with lots of expensive equipment.",
+ "#LOV1\\LOV1N020#This is a standard door, leading to another room on this deck.",
+ "#LOV1\\LOV1N021#This is an access ladder. It appears to lead to the next deck below.",
+ "#LOV1\\LOV1N022#This nozzle is where anti-agents are placed.",
+ "#LOV1\\LOV1N023#This refrigerator has a number of specimen dishes inside.",
+ "#LOV1\\LOV1N034#You have distilled a quantity of Polyberylcarbonate.",
+ "#LOV1\\LOV1N035#You retrieve the Oroborus cure sample.",
+
+
+ "#LOV2\\LOV2_001#Well, gentlemen, I believe this equipment may be of some use.",
+ "#LOV2\\LOV2_002#I think we can call that one a failure, Bones.",
+ "#LOV2\\LOV2_003#I think we can set this aside and not worry about it.",
+ "#LOV2\\LOV2_004#A clean drink of water, but I don't see its application in the context of our difficulties, Captain.",
+ "#LOV2\\LOV2_005#Captain, I see the problem: the gas feeds are turned off. If you'll permit me...",
+ "#LOV2\\LOV2_006#Captain, I see the problem: the gas feeds are turned off.",
+ "#LOV2\\LOV2_007#Fascinating, Captain, but it doesn't appear to get us any closer to our goal.",
+ "#LOV2\\LOV2_008#Except for the Oroborus virus, I'm not picking up anything unusual.",
+ "#LOV2\\LOV2_009#Go bother Spock. This is the kind of place he likes.",
+ "#LOV2\\LOV2_010#I think I'll stick to combining two gases in future experiments. That's how the machine's designed, after all.",
+ "#LOV2\\LOV2_011#I wouldn't try to lift that. You might hurt yourself.",
+ "#LOV2\\LOV2_012#I'm picking up some strange, airborne virus. I can't identify it without more information.", // BUG: audio file missing
+ "#LOV2\\LOV2_014#That's not the right material to put in there, Jim.",
+ "#LOV2\\LOV2_015#Do you mean to say it's undignified, Spock?",
+ "#LOV2\\LOV2_016#I rest my case.",
+ "#LOV2\\LOV2_017#I think I'd have more luck hypergrowing the virus in the presence of a limited quantity of gas.",
+ "#LOV2\\LOV2_018#It doesn't affect Vulcans, of course.",
+ "#LOV2\\LOV2_019#Next he'll tell us the DNA molecule is simple!",
+ "#LOV2\\LOV2_020#That's it, Jim. We've got enough serum here to cure everybody on the station!",
+ "#LOV2\\LOV2_021#We must be doing something wrong, Jim.",
+ "#LOV2\\LOV2_022#Why that's just dandy! Vulcan laughing gas!",
+ "#LOV2\\LOV2_023#You're wrong, Spock. Look... the virus culture has been eliminated. That's why it's clear. It'd be more useful for me to see how the virus might grow in the presence of a limited quantity of ammonia gas.",
+ "#LOV2\\LOV2_024#I recommend we follow the design specifications of the machine. Two gas tanks should always be attached before activating it.",
+ "#LOV2\\LOV2_025#I would not recommend removing the canister without turning off the valve.",
+ "#LOV2\\LOV2_026#It would be very dangerous to place the tanks without first turning off the valve.",
+ "#LOV2\\LOV2_027#Nothing unusual is detected.",
+ "#LOV2\\LOV2_028#The machine does not seem to be able to process that particular item.",
+ "#LOV2\\LOV2_029#This is an outstanding facility, Captain.",
+ "#LOV2\\LOV2_030#Actually, Doctor, both Romulans and Vulcans suffer its effects.",
+ "#LOV2\\LOV2_031#An unusual compound, Captain. It can induce laughter and feelings of exhiliration in some, much the way nitrous oxide affects humans.",
+ "#LOV2\\LOV2_032#Be careful with that canister, Captain. I think you would not care to fall under the effects of laughing gas in these straits.",
+ "#LOV2\\LOV2_033#Compared to many molecular models, it is, Doctor.",
+ "#LOV2\\LOV2_034#I don't think that's useful in your experiment, Doctor.", // TYPO (in audio filename)
+ "#LOV2\\LOV2_035#In principle, Captain, this device is quite simple. When this chamber is empty and gas tanks are attached, it will combine the gases to make new compounds. If chemicals are placed in the chamber, the machine will combine them with the gases to create new materials.",
+ "#LOV2\\LOV2_036#It is, at the least, inappropriate for a starship crew on duty, Doctor.",
+ "#LOV2\\LOV2_037#It would take us several hours to get this machine working, Captain. I do not believe we will need it. The synthesis chamber should be able to give us what we need.",
+ "#LOV2\\LOV2_038#Please, Doctor. This is not a laughing matter.",
+ "#LOV2\\LOV2_039#This does not appear to provide us with anything useful.", // TYPO (in audio filename)
+ "#LOV2\\LOV2_040#The can looks much too heavy to carry, sir.",
+ "#LOV2\\LOV2_041#This room is very defensible, Captain -- if things get nasty, we may want to retreat to here.",
+ "#LOV2\\LOV2_043#I hope you don't want me to swab the deck with that, Captain.",
+ "#LOV2\\LOV2N000#You already have the ?.",
+ "#LOV2\\LOV2N001#A door.",
+ "#LOV2\\LOV2N002#A gas tank marked 'H'.",
+ "#LOV2\\LOV2N003#A gas tank marked 'N',",
+ "#LOV2\\LOV2N004#A gas tank marked 'O'.",
+ "#LOV2\\LOV2N005#A loud hissing fills the room.",
+ "#LOV2\\LOV2N006#A small field-effect anti-gravity unit, useful for moving things too heavy to lift and carry by muscle alone.",
+ "#LOV2\\LOV2N007#Gas feed is off.",
+ "#LOV2\\LOV2N008#Gas feed is on.",
+ "#LOV2\\LOV2N009#James Tiberius Kirk.",
+ "#LOV2\\LOV2N010#Lt. Ferris is carefully watching the hallway.", // TYPO
+ "#LOV2\\LOV2N011#McCoy is fidgeting around.",
+ "#LOV2\\LOV2N012#Nothing Happens.",
+ "#LOV2\\LOV2N013#Nothing happens.",
+ "#LOV2\\LOV2N014#Spock is analyzing the surroundings.",
+ "#LOV2\\LOV2N015#The item is much soggier than it used to be, but otherwise undamaged.",
+ "#LOV2\\LOV2N016#The machine synthesizes a liter of ammonia.",
+ "#LOV2\\LOV2N017#The machine synthesizes a liter of nitrous oxide.",
+ "#LOV2\\LOV2N018#The machine synthesizes a liter of pure water.",
+ "#LOV2\\LOV2N019#The machine synthesizes one liter of TLTDH gas.",
+ "#LOV2\\LOV2N024#There is no room for another canister.",
+ "#LOV2\\LOV2N025#There is something already in the chamber.",
+ "#LOV2\\LOV2N026#This is a science lab.",
+ "#LOV2\\LOV2N027#This is a storage cabinet.",
+ "#LOV2\\LOV2N028#This is a synthesizer, used to combine and replicate chemicals and form new compounds. This particular model has twin gas feeds.",
+ "#LOV2\\LOV2N029#This is the door to the synthesis chamber.",
+ "#LOV2\\LOV2N030#You attach the antigrav unit to the gas tank. It can be moved freely.",
+ "#LOV2\\LOV2N031#You attach the antigrav unit to the gas tank. It can be moved freely.",
+ "#LOV2\\LOV2N033#You have synthesized one liter of Romulan Laughing Gas.",
+ "#LOV2\\LOV2N034#You install the gas tank to the synthesizer's feed lines.",
+ "#LOV2\\LOV2N035#You install the gas tank to the synthesizer's feed lines.",
+ "#LOV2\\LOV2N036#You retrieve the Oroborus virus culture.", // TYPO
+ "#LOV2\\LOV2N037#You retrieve the Oroborus virus cure sample.", // TYPO
+ "#LOV2\\LOV2N038#You take a one litre container of TLTDH gas.",
+ "#LOV2\\LOV2N039#You take a one litre container of Ammonia.",
+ "#LOV2\\LOV2N040#You take a one litre container of Nitrous Oxide.",
+ "#LOV2\\LOV2N041#You take a one litre container of pure water.",
+ "#LOV2\\LOV2N042#You take the antigrav unit.",
+ "#LOV2\\LOV2N043#You take the hypo with Oroborus toxin cure.",
+ "#LOV2\\LOV2N044#You take the Polyberylcarbonate.",
+ "#LOV2\\LOV2N045#An Ardak 1000, the last word in molecular replication, one of the most advanced pieces of scientific equipment ever constructed.",
+ "#LOV2\\LOV2N046#The machine synthesizes a quantity serum in a hypo.",
+ "#LOV2\\LOV2N047#The machine synthesizes a quantity of bubbling grey goo.",
+ "#LOV2\\LOV2N048#The machine synthesizes a quantity of colorless goo.",
+ "#LOV2\\LOV2N049#The machine synthesizes a quantity of inert matter.",
+ "#LOV2\\LOV2N050#The machine synthesizes a quantity of wet grey goo.",
+ "#LOV2\\LOV2N051#The machine synthesizes a quantity of wet grey goo.",
+
+
+ "#LOV3\\LOV3_001#At least all this equipment appears to be operating.",
+ "#LOV3\\LOV3_002#A prime source of raw material for TLDTH gas.",
+ "#LOV3\\LOV3_003#Captain, the fusion reactor doesn't seem to have been tampered with. I suggest we leave the controls as they are.",
+ "#LOV3\\LOV3_004#Captain, we can introduce the Romulan Laughing Gas into the station's ventilation system from here.",
+ "#LOV3\\LOV3_005#Except for the Oroborus virus, I'm not picking up anything unusual.",
+ "#LOV3\\LOV3_006#I'm picking up some strange, airborne virus. I can't identify it without more information.",
+ "#LOV3\\LOV3_007#Ouch!",
+ "#LOV3\\LOV3_008#Ah. The station's fusion reactor. Very nice. What are we going to tour next, the ventilation system?",
+ "#LOV3\\LOV3_009#I didn't realize that they used these old fusion reactors anymore.",
+ "#LOV3\\LOV3_010#I don't suppose you'd enjoy the psychological release of a few good belly laughs, Spock? We could open the canister right here, if you like.",
+ "#LOV3\\LOV3_011#I think one application of gas is sufficient, Captain.",
+ "#LOV3\\LOV3_012#Nitrous oxide affects humans, but not Romulans. However, a similar effect can be produced by the gas TLTDH.",
+ "#LOV3\\LOV3_013#Nothing unusual is detected.",
+ "#LOV3\\LOV3_014#The fusion reactor is functioning at peak efficiency. There is no need to tamper with its current operation.",
+ "#LOV3\\LOV3_015#The unit cannot lift something fastened to the body of the station, Captain. The tank must be detached first.",
+ "#LOV3\\LOV3_016#This is not wise, Captain. I don't believe we can safely substitute a different gas in this location.",
+ "#LOV3\\LOV3_017#We should now be able to proceed safely to the lower level.",
+ "#LOV3\\LOV3_018#Captain, the instruments are far too delicate for such abuse. We may set off a chain reaction that would destroy the entire space station.",
+ "#LOV3\\LOV3_019#Actually, doctor, as Mr. Scott would tell you, the Cochrane-500 is renowned for its reliability and perfectly suited for a station of this size.",
+ "#LOV3\\LOV3_020#I would strongly recommend against it, Doctor.",
+ "#LOV3\\LOV3_021#Good thing the person who designed these stations built in safeguards against an accidental spill!",
+ "#LOV3\\LOV3_022#I guess this made it easier to replace the tank every so often, eh Captain?",
+ "#LOV3\\LOV3_023#It doesn't sound like it subdued them, Captain. If anything, it just made them angry.",
+ "#LOV3\\LOV3_024#Sir, I'll watch the door so we don't get cornered.",
+ "#LOV3\\LOV3_025#It sure beats hauling it around on our backs, sir.",
+ "#LOV3\\LOV3_026#Hey, this thing's real old, isn't it?",
+ "#LOV3\\LOV3N000#All readings are normal.", // TYPO: audio filename was wrong
+ "#LOV3\\LOV3N001#Cursing and coughing echo up the air shaft.",
+ "#LOV3\\LOV3N002#It's a standard adjustable metric socket wrench.",
+ "#LOV3\\LOV3N003#Kirk is looking closely at the equipment.",
+ "#LOV3\\LOV3N004#Lt. Ferris is carefully watching the hallway",
+ "#LOV3\\LOV3N005#McCoy is fidgeting around.",
+ "#LOV3\\LOV3N006#N gas tank.",
+ "#LOV3\\LOV3N007#The tank is too heavy to move by muscle alone.",
+ "#LOV3\\LOV3N008#Spock is analyzing the surroundings.",
+ "#LOV3\\LOV3N009#The air vent becomes wet.",
+ "#LOV3\\LOV3N010#The antigrav unit hums and emits the stink of ozone before it failsafes.",
+ "#LOV3\\LOV3N011#The shaft is too small to crawl through.",
+ "#LOV3\\LOV3N012#The tank detaches easily.",
+ "#LOV3\\LOV3N013#The tank fits into place and is easy to reattach.",
+ "#LOV3\\LOV3N014#The tank is large and heavy, with its feed lines firmly attached.",
+ "#LOV3\\LOV3N015#The tank is now firmly attached to its feed lines.",
+ "#LOV3\\LOV3N016#The vent is now open. It leads to the lower deck.",
+ "#LOV3\\LOV3N017#There is a pile of stripped insulation that fell out of the Engineering access panel.",
+ "#LOV3\\LOV3N018#There seems to be no effect.",
+ "#LOV3\\LOV3N019#This is a screen and filter for the ventilation shaft.",
+ "#LOV3\\LOV3N020#The panel closes.",
+ "#LOV3\\LOV3N021#The panel is open. You see vast quantities of dust and stripped insulation from wiring repairs made to the console in the past.",
+ "#LOV3\\LOV3N022#The panel opens. You see a gas tank labeled N, with its feed lines running deeper into the wall.",
+ "#LOV3\\LOV3N023#The panel opens.",
+ "#LOV3\\LOV3N024#This is the engineering room. All appears normal.",
+ "#LOV3\\LOV3N025#This vent is currently closed.",
+ "#LOV3\\LOV3N026#Turbines of a Cochrane-500 Class Fusion drive, manufactured over a century ago on Alpha Centuri.",
+ "#LOV3\\LOV3N027#You already have some insulation.",
+ "#LOV3\\LOV3N028#You already have the wrench.",
+ "#LOV3\\LOV3N029#You grab a handful of insulation.",
+ "#LOV3\\LOV3N030#You need something to pry this open.",
+ "#LOV3\\LOV3N031#You pick up a large wrench.",
+ "#LOV3\\LOV3N032#You replace the air vent cover.",
+ "#LOV3\\LOV3NA08#With a hiss, the Romulan Laughing Gas billows down the vent. Things are strangely quiet below.",
+ "#LOV3\\LOV3NA09#With a hiss, the Romulan Laughing Gas billows down the vent. You hear the muffled sounds through the vent of hearty Romulan laughter, followed by the dull thud of bodies hitting the deck.",
+ "#LOV3\\LOV3NA20#This is a service access panel, permitting used-up or worn materials to be replaced.",
+ "#LOV3\\LOV3NA21#This is a vent shaft that leads to the lower level.",
+ "#LOV3\\LOV3NA22#This is an engineering access panel, allowing repairs to be made to the interior wiring in the equipment.",
+ "#LOV3\\LOV3NA23#This is the engineering center for the ARK7 space station.",
+ "#LOV3\\LOV3NJ32#You attach the antigrav unit to the gas tank. It can be moved freely.",
+
+
+ "#LOV4\\LOV4_001#We aren't barbarians, in spite of what some people think.",
+ "#LOV4\\LOV4_002#Being surrounded by Romulans and not at gun point.",
+ "#LOV4\\LOV4_003#I know Mr. Spock. But we'll get through this.",
+ "#LOV4\\LOV4_004#Lt. Ferris, collect their weapons.",
+ "#LOV4\\LOV4_005#Well, there's a first time for everything.",
+ "#LOV4\\LOV4_006#Except for the Romulans, I can detect no other lifeforms in this room.",
+ "#LOV4\\LOV4_007#Are you crazy, Jim! That's not going to help in the least!",
+ "#LOV4\\LOV4_009#Careful there! They're suffering from dehydration but it's dangerous to give water to someone while they're unconscious. These men need serum or they're going to die!",
+ "#LOV4\\LOV4_010#Dammit, Jim, I'm a doctor, not a diplomat. I've got to try and save these men.",
+ "#LOV4\\LOV4_011#Dammit, Jim, these men are sick! They need my help!",
+ "#LOV4\\LOV4_012#I don't have the proper medicine to cure them, Jim.",
+ "#LOV4\\LOV4_013#I don't think they need another shot, Jim.",
+ "#LOV4\\LOV4_014#Jim, we need to synthesize more before we can use it.",
+ "#LOV4\\LOV4_015#Jim, we've got to help these men before they die.",
+ "#LOV4\\LOV4_016#Ouch!",
+ "#LOV4\\LOV4_017#That's not working, Jim.",
+ "#LOV4\\LOV4_018#The Romulans have been cured of the Oroborus virus, but they are severely dehydrated and need some rest.",
+ "#LOV4\\LOV4_019#The Romulans have been cured of the Oroborus virus.",
+ "#LOV4\\LOV4_020#The laughing gas did the trick, Jim, but these Romulans are still very, very sick -- they've only got hours left.",
+ "#LOV4\\LOV4_021#These Romulans will die soon if we can't cure them.",
+ "#LOV4\\LOV4_022#They'll be fine now, Jim. They just need some rest.",
+ "#LOV4\\LOV4_023#They're severely dehydrated, but they'll live. We got to them in time.",
+ "#LOV4\\LOV4_024#First time for what?",
+ "#LOV4\\LOV4_025#McCoy thinks to himself: 'Dammit, I'm a doctor, not a diplomat!'",
+ "#LOV4\\LOV4_026#Take it easy now... You'll feel better in a few minutes. Good thing we had the water available, Jim.",
+ "#LOV4\\LOV4_027#I have been in more comfortable situations, Captain.",
+ "#LOV4\\LOV4_028#These Romulans appear to be a negligible threat, sir.",
+ "#LOV4\\LOV4_029#Freeze, Romulans! You're covered!",
+ "#LOV4\\LOV4N000#Door Opens.",
+ "#LOV4\\LOV4N001#Ensign Ferris is looking at the Romulans, in case one of them decides to try something.",
+ "#LOV4\\LOV4N002#James Kirk views the scene with concern.",
+ "#LOV4\\LOV4N003#Mr. Spock is his usual stoic self.",
+ "#LOV4\\LOV4N004#The Romulans come to weakly, reaching for their weapons.",
+ "#LOV4\\LOV4N005#The Romulans stir weakly, then begin to get up... they've all been cured!",
+ "#LOV4\\LOV4N006#These Romulans are totally out of it.",
+ "#LOV4\\LOV4N007#They are in no condition to talk right now.",
+ "#LOV4\\LOV4N008#This door leads into another section of the base.",
+ "#LOV4\\LOV4N009#This is the ARK7's crew quarters. There are only Romulans here.",
+ "#LOV4\\LOV4N010#This ladder leads back to the research lab.",
+ "#LOV4\\LOV4N011#This Romulan is groggy, but conscious.",
+ "#LOV4\\LOV4N012#McCoy thinks to himself: 'Dammit, I'm a doctor, not a diplomat!'",
+ "#LOV4\\LOV4N013#The Romulans drink thirstily and empty the container.",
+
+
+ "#LOV5\\LOV5_001#Well gentlemen, let's go home.",
+ "#LOV5\\LOV5_002#Goodbye Carol.",
+ "#LOV5\\LOV5_003#Hello, Carol. It's good to see you again.",
+ "#LOV5\\LOV5_004#I assure you, the Federation would never undertake such a foul program. It was all an accident, right, Dr. Marcus?",
+ "#LOV5\\LOV5_005#Lt. Ferris, collect his weapon.",
+ "#LOV5\\LOV5_006#Save it for someone who's buying, Preax. Leave Federation space immediately or we'll scatter your atoms across the quadrant.",
+ "#LOV5\\LOV5_007#We aren't barbarians, in spite of what some might think.",
+ "#LOV5\\LOV5_008#You also conducted yourself in the most honorable fashion, Centurion Preax. You may return to Romulan space without Federation interference.",
+ "#LOV5\\LOV5_009#You always could put me in my place, couldn't you?",
+ "#LOV5\\LOV5_010#You are also a worthy opponent, Preax. May you live long and prosper.",
+ "#LOV5\\LOV5_011#Are you crazy, Jim? That's not going to help in the least!",
+ "#LOV5\\LOV5_013#Careful there! He's suffering from dehydration but it's dangerous to give water to someone while they're unconscious. This man needs serum or he's going to die!",
+ "#LOV5\\LOV5_014#Dammit, Jim, I'm a doctor, not a diplomat. These people will be fine. I've got to try and save the Romulans.",
+ "#LOV5\\LOV5_015#He's already cured, Jim.",
+ "#LOV5\\LOV5_016#He's infected with the virus too, Jim.",
+ "#LOV5\\LOV5_017#He's severely dehydrated, but he'll live.",
+ "#LOV5\\LOV5_018#He's too weak to talk, Jim. He needs medical attention.",
+ "#LOV5\\LOV5_019#I don't have the proper medicine to cure him, Jim.",
+ "#LOV5\\LOV5_020#Jim, we need to synthesize more before we can use it.",
+ "#LOV5\\LOV5_021#Oops! Almost forgot about you Spock.",
+ "#LOV5\\LOV5_023#That's not working, Jim.",
+ "#LOV5\\LOV5_024#The hostages are scared, but fine. The laughing gas did the trick, Jim, but the Romulan is still very, very sick -- he's only got hours left.",
+ "#LOV5\\LOV5_025#They've been through a good deal of stress, but they are already starting to recover. Their heart rate is dropping, and their blood pressure is also dropping.",
+ "#LOV5\\LOV5_026#Dammit, Jim, these men are sick! They need my help!",
+ "#LOV5\\LOV5_027#Finally, a human response!",
+ "#LOV5\\LOV5_028#My God, that's some kind of weapon!",
+ "#LOV5\\LOV5_029#Take it easy now... You'll feel better in a few minutes. Good thing we had the water available, Jim.",
+ "#LOV5\\LOV5_030#There. You're now cured.",
+ "#LOV5\\LOV5_031#What does this stuff do? What's going on here?",
+ "#LOV5\\LOV5_032#You'll never cease to amaze me, Jim.",
+ "#LOV5\\LOV5_033#I detect no other lifeforms in the room, Captain.",
+ "#LOV5\\LOV5_034#Fascinating. This device contains over ten million forms of life. Patterns I have never seen before.",
+ "#LOV5\\LOV5_036#Fascinating equipment. I believe I have seen this sort of equipment someplace before.",
+ "#LOV5\\LOV5_038#Thank you, Doctor.",
+ "#LOV5\\LOV5_039#Anthony and I will look after these Romulans, Jim. Dr. McCoy, we could use your expertise on discovering a cure for the virus. All our equipment is at your disposal.",
+ "#LOV5\\LOV5_040#Jim, it's you! Please untie us!",
+ "#LOV5\\LOV5_041#Thank God it's you, Jim. I'm so glad you came.",
+ "#LOV5\\LOV5_042#Thank you for saving our station, Jim.",
+ "#LOV5\\LOV5_043#Absolutely. We've already destroyed all cultures and purged the data files. This will never happen again.",
+ "#LOV5\\LOV5_044#Everyone on this project is an avowed pacifist, doctor. Myself included. We do not make weapons.",
+ "#LOV5\\LOV5_045#Goodbye Jim.",
+ "#LOV5\\LOV5_046#How about someone giving us a hand?",
+ "#LOV5\\LOV5_047#That's the one thing I could never do. Your place was wandering the galaxy, and that's the one thing I could never give you.",
+ "#LOV5\\LOV5_048#There was a time when I wouldn't have agreed with that statement. But I guess some things do get better with age.",
+ "#LOV5\\LOV5_049#We call this the Cradle, Mr. Spock. One day, I hope, something wonderful will be produced here.",
+ "#LOV5\\LOV5_050#We're conducting research into the origins of life in the universe. This is our equipment. We believe that... uh, well, I guess you don't have the time. You can get the background in my doctoral thesis.",
+ "#LOV5\\LOV5_051#We're testing the effect of radiation on combinations of simple and complex molecules. We're trying to see what new forms of life are developed, and how they compare to our own early development.",
+ "#LOV5\\LOV5_052#These Romulans appear to be a negligible threat, sir.",
+ "#LOV5\\LOV5_053#Freeze, Romulan! You're covered!",
+ "#LOV5\\LOV5_054#I do. You just pull on the ropes until they're untied.",
+ "#LOV5\\LOV5_055#Hey! Would you please untie us?",
+ "#LOV5\\LOV5_056#It's about time someone got here.",
+ "#LOV5\\LOV5_057#Hey? Does anyone in Starfleet know how to untie a knot?",
+ "#LOV5\\LOV5_058#I don't care who does it, but could somebody get around to doing it on this Stardate?",
+ "#LOV5\\LOV5_059#I have called off the Romulan attack on this station, Kirk. I believed your virus was some kind of deliberate attack, but your great honor and compassion have convinced me otherwise.",
+ "#LOV5\\LOV5_060#Phah! And I thought you a man of honor... You need not worry, Captain Kirk. Your lack of warrior spirit stinks even across the vacuum of space, and I am eager to be free of it.",
+ "#LOV5\\LOV5_061#You are an honorable adversary, Kirk. Jolan-tru.",
+ "#LOV5\\LOV5N000#Dr. Anthony Cheever, the assistant of Dr. Marcus.",
+ "#LOV5\\LOV5N001#Dr. Carol Marcus, head of this station's research team.",
+ "#LOV5\\LOV5N002#Dr. McCoy is viewing this scene with interest.",
+ "#LOV5\\LOV5N003#Ensign Ferris is wondering when they're going to give him a tough assignment for a change.",
+ "#LOV5\\LOV5N004#James T. Kirk, glad to see Carol Marcus again, yet slightly uncomfortable.",
+ "#LOV5\\LOV5N005#Mr. Spock is fascinated by these machines.",
+ "#LOV5\\LOV5N006#The Preax remains silent, but glances between you and your tied up companions.",
+ "#LOV5\\LOV5N007#The Romulan Preax stirs weakly, then begins to get up... he has been cured!",
+ "#LOV5\\LOV5N008#This is a very advanced research laboratory.",
+ "#LOV5\\LOV5N009#This is Dr. Carol Marcus' quarters. The hostages and four Romulans are here.",
+ "#LOV5\\LOV5N010#This ladder leads back to the main level of the station.",
+ "#LOV5\\LOV5N011#This Romulan commander is cautiously looking at you.",
+ "#LOV5\\LOV5N012#This Romulan commander is unconscious.",
+ "#LOV5\\LOV5N013#An odd looking device, almost like a 20th Century torpedo, fitted with an experimental gear.",
+ "#LOV5\\LOV5N014#Dr. Anthony Cheever, Marcus's assistant. He has been bound by the Romulans.",
+ "#LOV5\\LOV5N015#Dr. Carol Marcus, head of this station's research team. She has been bound by the Romulans.",
+ "#LOV5\\LOV5N016#Some odd looking equipment, connected to the torpedo.",
+ "#LOV5\\LOV5N017#The Romulan Preax weakly regains conscienceness, reaching for his weapon.",
+ "#LOV5\\LOV5N018#The Romulan Preax drinks thirstily and empties the container.",
+ "(Raises an eyebrow)", // NOTE: no corresponding audio
+
+
+ "#LOVA\\LOVA_100#He's dead, Jim.",
+ "#LOVA\\LOVA_F01#He's been cured of the Oroborus virus.",
+ "#LOVA\\LOVA_F02#I'm picking up some kind of virus. I can't identify it without more information.",
+ "#LOVA\\LOVA_F03#He's infected with the virus, Jim.",
+ "#LOVA\\LOVA_F04#The virus affects the Romulan-Vulcan genotype, Jim.",
+ "#LOVA\\LOVA_F07#All lifesigns are normal.",
+ "#LOVA\\LOVA_F08#It's what I was afraid of, Jim. I think Spock is getting worse.", // TYPO
+ "#LOVA\\LOVA_F10#He has weak vital signs.",
+ "#LOVA\\LOVA_F54#The virus has spread to me, Captain. I suggest you concentrate your efforts on the problem.",
+ "#LOVA\\LOVA_F55#Jim, we need to synthesize more to make the serum before we can use it.", // TYPO
+
+
+ "#MUD0\\MUD0_001#Kirk to Enterprise...",
+ "#MUD0\\MUD0_002#Well! Now I think we know why the Elasi pirates were so interested in finding out where Mudd was getting these!",
+ "#MUD0\\MUD0_003#Bones, Federation law is clear on this. Federation law protects everyone, even Harry Mudd. ",
+ "#MUD0\\MUD0_004#Don't push your luck, Harry. ",
+ "#MUD0\\MUD0_005#Harry, as official representatives of the Federation, and of Starfleet, we recognize your rights to legitimate salvage. Need I say more? ",
+ "#MUD0\\MUD0_006#I see, Harry. Well, we'll look around here while the Enterprise remains close by.",
+ "#MUD0\\MUD0_007#It was a rhetorical question, Harry. ",
+ "#MUD0\\MUD0_008#No Lieutenant, that was Horatio Jones, but Harry Mudd is worse.",
+ "#MUD0\\MUD0_009#Well, you're terrible trouble to me, Harry. Tell me what this is all about.",
+ "#MUD0\\MUD0_010#Why do I have the feeling that I am about to have a bad day? ",
+ "#MUD0\\MUD0_011#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#MUD0\\MUD0_012#These lenses were definitely not made to correct the aliens' vision. Mudd might've been able to sell these among humans as magnifiers, but these people must have had another use for them.",
+ "#MUD0\\MUD0_013#These lenses are finely made magnifiers, but I can't help but wonder if that's what the aliens really used them for. ",
+ "#MUD0\\MUD0_014#About as much as the Klingons are devoted to pacifism... ",
+ "#MUD0\\MUD0_015#For once Spock, I couldn't have said it better myself. ",
+ "#MUD0\\MUD0_016#Jim? You can't seriously be thinking of helping Mudd after all he's done. ",
+ "#MUD0\\MUD0_017#Then something went wrong, right?",
+ "#MUD0\\MUD0_018#Life support down to 25%, Captain.",
+ "#MUD0\\MUD0_019#Life support down to 50%, Captain.",
+ "#MUD0\\MUD0_020#Life support down to 75%, Captain.",
+ "#MUD0\\MUD0_021#These are computer memory transfer media, probably designed for use with the alien computer system.",
+ "#MUD0\\MUD0_022#Given the past record of Harry Mudd, Captain, I strongly recommend that you do not trust him. ",
+ "#MUD0\\MUD0_023#I am. Your record is that of a greedy, amoral, sociopathic fraud who preys upon human emotion, most notably, gullibility. ", // TYPO (gullability)
+ "#MUD0\\MUD0_024#There was the time that you tried to commandeer the Enterprise to sell wives to miners, and then there was the time you stole the Enterprise to exchange us for androids who were holding you prisoner... ",
+ "#MUD0\\MUD0_025#Kirk, after all we've been through you wouldn't shoot me would you?",
+ "#MUD0\\MUD0_026#Actually no, Doctor, not then. I'd started offering a few other little items I found -- Mudd's Limited coffee substitute -- a great little specialty item; lenses to a firm packaging BuildYerOwn telescope kits; a collection of novelty paints -- things like that. All of a sudden, the Elasi pirates are asking for me in every quadrant, and wanting to know where I'm getting my goods!",
+ "#MUD0\\MUD0_027#And we all know how devoted I am to Federation law. ",
+ "#MUD0\\MUD0_028#I happened upon this ship not long ago, and dutifully registered it as salvage, mind you! In the hold here, I discovered one of these devices -- in that box over there. When I tried one on a wall, it floated off the grease and dirt -- perfect for cleaning, near as I could see. I peddled a few of these Mudd's Miracle De-Grimers and everything was going perfectly well.",
+ "#MUD0\\MUD0_029#I understand perfectly, Captain -- Carry on, Captain.",
+ "#MUD0\\MUD0_030#It's a system that cost a gambler his life, boy. He crawled up to me and whispered it with his dying breath, and it can be yours for a mere... 200 credits. ",
+ "#MUD0\\MUD0_031#Kirk! Now that we're together... ",
+ "#MUD0\\MUD0_032#Kirk, my friend! When have I ever given you the slightest bit of trouble? ",
+ "#MUD0\\MUD0_033#Look around all you like, Captain, but I'll be keeping an eye on you. I've registered this derelict as my salvage, and I don't want you running off with all my prizes! ",
+ "#MUD0\\MUD0_034#Mr. Spock! Whatever gave you that impression! I thought Vulcans were supposed to be logical. ",
+ "#MUD0\\MUD0_035#Perhaps there have been a few minor misunderstandings... ",
+ "#MUD0\\MUD0_036#Starfleet! You're all the same. No sense of adventure! ",
+ "#MUD0\\MUD0_037#Welcome, Captain Kirk! So glad you're here. The Elasi have been terrible trouble to me.",
+ "#MUD0\\MUD0_038#Why I've never been so insulted in all my life! ",
+ "#MUD0\\MUD0_039#Didn't Mudd bring those tribbles on board the Enterprise?",
+ "#MUD0\\MUD0_040#So you say you know how to break the gambling machines on Curalon IV? ",
+ "#MUD0\\MUD0_041#Sorry Mr. Mudd. My mother didn't raise any fools in her family. ",
+ "#MUD0\\MUD0N000#A small energy device with a flanged opening at the front, about the size of one's thumbnail.",
+ "#MUD0\\MUD0N001#Dr. McCoy looks like he would like to violate the Hippocratic Oath on Harry Mudd, but you know he won't. ",
+ "#MUD0\\MUD0N002#Dust and grease lifts off the surface, leaving this item clean as new.",
+ "#MUD0\\MUD0N003#Harcourt Fenton Mudd. Of course, he's going to be honest and fair with you... ",
+ "#MUD0\\MUD0N004#James T. Kirk looks rather exasperated right now. ",
+ "#MUD0\\MUD0N005#Lieutenant Buchert is standing around, watching everyone else converse with Harry Mudd. ",
+ "#MUD0\\MUD0N006#Life support fails completely and you fall unconscious.",
+ "#MUD0\\MUD0N007#Mr. Spock is as close to annoyed as a Vulcan can get. ",
+ "#MUD0\\MUD0N008#Odd-looking contraptions small enough to hold in one hand.",
+ "#MUD0\\MUD0N009#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
+ "#MUD0\\MUD0N010#There are shiny, multi-sided, spherical objects in this box.",
+ "#MUD0\\MUD0N011#These two things fit together like they were made for each other.",
+ "#MUD0\\MUD0N012#This container holds bricks of what might have been preprocessed food -- a long time ago.",
+ "#MUD0\\MUD0N013#This container holds small mechanical components unfamiliar to you.",
+ "#MUD0\\MUD0N014#This lense, about the size of one's thumbnail, magnifies like a fine optical glass. ",
+ "#MUD0\\MUD0N015#This storage bay is stockpiled with all manner of goods.",
+ "#MUD0\\MUD0N016#You already have that.",
+ "#MUD0\\MUD0N017#You can't take that.",
+ "#MUD0\\MUD0N019#This place is cluttered with stored goods of every sort. It would take an army of workers weeks to examine every container and determine what is inside.",
+
+
+ "#MUD1\\MUD1_001#Kirk to Enterprise...",
+ "#MUD1\\MUD1_002#Well, now! I think we know why the Elasi pirates were so interested in finding out where Mudd was getting these!",
+ "#MUD1\\MUD1_003#I agree that we should take it aboard the Enterprise. ",
+ "#MUD1\\MUD1_004#I don't think we should tinker with technology we don't understand, Spock. And I'm surprised you'd suggest such a thing.",
+ "#MUD1\\MUD1_005#I know, Bones. ",
+ "#MUD1\\MUD1_006#I wonder what's happening on the Enterprise right now. ",
+ "#MUD1\\MUD1_007#I'll try to raise the ship... Kirk to Enterprise, Kirk to Enterprise...",
+ "#MUD1\\MUD1_008#If the Elasi gets hold of this, they'll make Mudd seem like a perfect caretaker by comparison. ",
+ "#MUD1\\MUD1_009#That machinery in the middle of the room, however, is like nothing I recognize -- and I thought I'd seen just about everything.",
+ "#MUD1\\MUD1_010#A weapons-delivery system. It appears to be an accessory tied directly to the alien equivalent of our ship's phasers and photon torpedoes.",
+ "#MUD1\\MUD1_011#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#MUD1\\MUD1_012#I wonder where that Mudd has gone. I wouldn't let him out of my sight... mind you, I'm not too crazy about having him in my sight either. ",
+ "#MUD1\\MUD1_013#Scotty will take good care of it, Jim. He has before. ",
+ "#MUD1\\MUD1_014#It seems to be part of the loading system for the weapon. It is also fully functional.",
+ "#MUD1\\MUD1_015#The control panel has power running to it, Captain.",
+ "#MUD1\\MUD1_016#The device has been unloaded, Captain.",
+ "#MUD1\\MUD1_017#The device has finished loading, Captain.",
+ "#MUD1\\MUD1_019#A most interesting technology, Captain.",
+ "#MUD1\\MUD1_020#Evidently these are more than theoretical, Lt. Buchert. The energy initially released is infinitesimally small but boosts itself until the power finally released is comparable to our photon torpedoes.",
+ "#MUD1\\MUD1_021#However, I've already examined the weapons console and the main weapons battery on this ship was completely destroyed in the action which made her a derelict.",
+ "#MUD1\\MUD1_022#I believe, Captain, that this weapon must be hooked up through the main weapons battery.",
+ "#MUD1\\MUD1_023#Mr. Scott would have to go over this thoroughly, but I would recommend we try to take this weapon with us to the Enterprise.",
+ "#MUD1\\MUD1_024#The machinery to deliver these cartridges would be an engineering feat as well, Captain.",
+ "#MUD1\\MUD1_025#Unique, Captain. I believe these are self-referencing packed-quantum cartridges. ",
+ "#MUD1\\MUD1_026#It looks to me like these people knew how to defend themselves, Captain.",
+ "#MUD1\\MUD1_027#Powerboosters! I've read about those -- but they're just theoretical.",
+ "#MUD1\\MUD1_028#The technical journals discussing the possibilities indicated it would create a weapon of greater range than those we have now, if not a greater punch. ",
+ "#MUD1\\MUD1N000#A large claw-like device hanging from the ceiling.",
+ "#MUD1\\MUD1N001#A red triangular button.",
+ "#MUD1\\MUD1N002#A row of unmarked cylindrical containers.",
+ "#MUD1\\MUD1N003#An elaborate piece of alien-looking machinery.",
+ "#MUD1\\MUD1N004#Dust and grease lifts off the surface, leaving this item clean as new.",
+ "#MUD1\\MUD1N005#James T. Kirk, dwarfed by the technology that surrounds him. ",
+ "#MUD1\\MUD1N006#Lieutenant Buchert, waiting for a chance to perform his duty. ",
+ "#MUD1\\MUD1N007#Life support fails completely and you fall unconscious.",
+ "#MUD1\\MUD1N008#McCoy is scowling, probably from your meeting with Harcourt Fenton Mudd. ",
+ "#MUD1\\MUD1N009#Mr. Spock is looking forward to the moment that he can sit down at the main computer and analyze the findings of this mission. ",
+ "#MUD1\\MUD1N010#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
+ "#MUD1\\MUD1N011#The room reminds you of the weapons-room of some old-style warships from the early days of starfaring.",
+ "#MUD1\\MUD1N012#These cylinders have fallen down from the rest.",
+ "#MUD1\\MUD1N013#These two things fit together like they were made for each other.",
+ "#MUD1\\MUD1N014#This is much too heavy to lift.",
+ "#MUD1\\MUD1N015#Three triangular blue buttons.",
+ "#MUD1\\MUD1N016#Two yellow triangular buttons.",
+
+
+ "#MUD2\\MUD2_001#Spock, see if you can outflank him...",
+ "#MUD2\\MUD2_002#Well, now! I think we know why the Elasi pirates were so interested in finding out where Mudd was getting these!", // TYPO
+ "#MUD2\\MUD2_003#Almost worth a try. Bones? ",
+ "#MUD2\\MUD2_004#Do they pose any threat to us, Doctor?",
+ "#MUD2\\MUD2_005#Harry! Calm down Harry, it's only us! ",
+ "#MUD2\\MUD2_006#Harry, when did you become a comedian? ",
+ "#MUD2\\MUD2_007#I can't think of anything we did that was THAT bad. ",
+ "#MUD2\\MUD2_008#There's not much I wouldn't do to not have to deal with Mudd. ",
+ "#MUD2\\MUD2_009#Kirk to Enterprise ... Kirk to Enterprise.", // TYPO
+ "#MUD2\\MUD2_010#Sometimes I wish I had become an archeology professor instead of a Starfleet Captain. ",
+ "#MUD2\\MUD2_011#Sorry if I was bothering you. I was just silently cursing the day I met Harry Mudd. ",
+ "#MUD2\\MUD2_012#All yours now, Doctor McCoy.",
+ "#MUD2\\MUD2_013#He's showing definite signs of hallucination and a marked increase in adrenalin. I would recommend extreme caution in handling him.",
+ "#MUD2\\MUD2_014#I feel sure that these would have been used here, but I don't understand enough of the alien's thinking to make it work.", // TYPO
+ "#MUD2\\MUD2_015#I need to understand more about the aliens before I can make this bed and its instrumentation function.",
+ "#MUD2\\MUD2_016#I'm not fast enough to get him with a tranquilizer hypo, Jim!",
+ "#MUD2\\MUD2_018#Jim, these look like the capsules we might use in a hypo. I wouldn't recommend experimenting with them, though. Alien physiology or not, you can never be sure what unusual chemicals will do to the human body.",
+ "#MUD2\\MUD2_019#None seems likely to have any effect on human -- or Vulcan -- physiology. To be on the safe side, though, I wouldn't recommend taking a snootful from one of the capsules!",
+ "#MUD2\\MUD2_020#The capsules slide into the machinery on the bed exactly as they're designed to.",
+ "#MUD2\\MUD2_021#The volatile chemicals have evaporated over the time the derelict hung in space. I need to refill the capsule-dispenser for the bed to activate and effect a cure on our friend Harry, here.",
+ "#MUD2\\MUD2_022#This is no time for a nap!", // TYPO
+ "#MUD2\\MUD2_023#We can't get near that equipment with mudd going nuts over there, Jim.",
+ "#MUD2\\MUD2_024#We won't be able to operate any of this equipment unless we can learn more about the aliens, Jim.",
+ "#MUD2\\MUD2_025#Are you religious, Jim? Is Harry Mudd a divine punishment for anything we did wrong? ",
+ "#MUD2\\MUD2_026#Deleterious effects. I guess I don't even need my tricorder to know that.",
+ "#MUD2\\MUD2_027#He's delirious Jim. Actually, it's kinda funny. ",
+ "#MUD2\\MUD2_028#I think I liked him better when he was less delirious. ",
+ "#MUD2\\MUD2_029#I'm telling the program our physiology is not the same as the aliens' physiology. Don't want it to try to cure us of being human!",
+ "#MUD2\\MUD2_030#It would be interesting to analyze them back aboard the Enterprise, but these are probably vaccines, medicines, and research viruses.",
+ "#MUD2\\MUD2_031#If we can get him on one of the beds, and get it active, I think he can be cured. Otherwise, he's likely to become increasingly violent.",
+ "#MUD2\\MUD2_032#Jim, that doesn't look good at all... Harry, let me take a look at you and check whether that had some deleterious effect...",
+ "#MUD2\\MUD2_033#Okay, Harry, you should start to feel better in a few minutes. Just lie there quietly until you feel like moving.",
+ "#MUD2\\MUD2_034#Particularly when we're talking about Harry Mudd...",
+ "#MUD2\\MUD2_035#Well, he got one thing right. ",
+ "#MUD2\\MUD2_036#Who knows what effect a phaser might have on him with all those chemicals in his system? We must find another way to handle this. ",
+ "#MUD2\\MUD2_037#This room closely resembles the Enterprise sickbay. The beds are powered, as is the central post console. ",
+ "#MUD2\\MUD2_038#It would appear that the accident has made Harry Mudd even less logical than before. ",
+ "#MUD2\\MUD2_039#That would be too much to hope for, would it not, Doctor?",
+ "#MUD2\\MUD2_040#You look troubled, Captain.",
+ "#MUD2\\MUD2_042#Ahh, I feel faster -- smarter -- strong enough to take you all on! You're really lizard men wearing human masks -- his is coming off -- Hahahahahah!",
+ "#MUD2\\MUD2_043#I know you for what you really are! I'll tell the whole world, and then where will you be!",
+ "#MUD2\\MUD2_044#Why C-c-Captain!",
+ "#MUD2\\MUD2_045#*Groan.* Give me something for this headache, Doc. A herd of Hamali tree-elephants landed behind my eyeballs and did a mating dance...",
+ "#MUD2\\MUD2_046#Argh! My most dire enemies have found me! ",
+ "#MUD2\\MUD2_047#Kirk, you sound as though you aren't happy to see me! After all we've been through together, I thought we had built a genuine bond of camraderie, two men fighting side by side against impossible odds! ",
+ "#MUD2\\MUD2_048#No! You're going to sell me to space aliens! Use my brain as a weapon to destroy the human race! And here I am, willing to help out in a good cause... ",
+ "#MUD2\\MUD2_049#No! You're all space aliens! You're little grey men from inside the hollow earth! You want to experiment on my body parts! Stay away from me!",
+ "#MUD2\\MUD2_050#Stay away from me!>",
+ "#MUD2\\MUD2_051#You'll mind control me, kidnap my children! Dissect my dog!",
+ "#MUD2\\MUD2_052#He's unnaturally strong, Captain! I can't take him down!",
+ "#MUD2\\MUD2_053#I don't think the phaser will have the usual effect, Captain.... we'll have to think of something else!",
+ "#MUD2\\MUD2_054#Captain, count your blessings! We haven't met any salt vampires, deranged computers, blood-draining clouds, cell imploding sirens, Greek gods, or any of the other things people keep telling me about in security. ",
+ "#MUD2\\MUD2_055#Sir, I can phaser him. A stun setting would just leave him queasy. ",
+ "#MUD2\\MUD2N000#Dr. McCoy, who isn't arguing as much with Spock as usual. ",
+ "#MUD2\\MUD2N001#Dust and grease lifts off the surface, leaving this item clean as new.",
+ "#MUD2\\MUD2N002#Harcourt Fenton Mudd. Three of the most prominent psychologists in the galaxy became famous by publishing case studies in sociopathy about him. ",
+ "#MUD2\\MUD2N003#James Kirk, the paragon of a Starfleet captain, feels nothing like a paragon right now. ",
+ "#MUD2\\MUD2N004#Lieutenant Buchert. His is not to reason why. His is to obey orders and stay alert. ",
+ "#MUD2\\MUD2N005#Life support fails completely and you fall unconscious.",
+ "#MUD2\\MUD2N006#Mr. Spock, your loyal science officer. ",
+ "#MUD2\\MUD2N007#Padded inclines resembling a bed.",
+ "#MUD2\\MUD2N008#Small containers of oddly-colored liquids.",
+ "#MUD2\\MUD2N009#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
+ "#MUD2\\MUD2N010#These two things fit together like they were made for each other.",
+ "#MUD2\\MUD2N011#This seems to be the main monitoring station for the beds. Above it is some sort of dispensary.",
+
+
+ "#MUD3\\MUD3_002#Harry! Look what you've done! ",
+ "#MUD3\\MUD3_003#Kirk to Enterprise...",
+ "#MUD3\\MUD3_005#At ease, lieutenant. He's not worth it. ",
+ "#MUD3\\MUD3_006#At least our life support system isn't dependent on the alien computer.",
+ "#MUD3\\MUD3_007#By all means, Spock.",
+ "#MUD3\\MUD3_008#But their essence, their souls -- are gone, Spock.",
+ "#MUD3\\MUD3_009#Get away from that this instant, Harry, or I'll shoot you where you stand.",
+ "#MUD3\\MUD3_010#Help yourself, Harry. Knowledge is for everyone.",
+ "#MUD3\\MUD3_011#It would be nice to think that after all the stunts that Harry has pulled, that he would do something right for a change. ", // TYPO
+ "#MUD3\\MUD3_012#Spock, we're talking about Harry Mudd. He was probably trying to download it so he could sell it to the highest bidder.",
+ "#MUD3\\MUD3_013#Teeny bit clumsy? Mudd, you're a disgrace to the entire human race! ",
+ "#MUD3\\MUD3_014#This technology is unbelievable, Mr. Spock. I've never seen anything like it. ",
+ "#MUD3\\MUD3_015#With the Enterprise out of range, that's not an option, Mr. Spock. What else can you do?", // TYPO
+ "#MUD3\\MUD3_016#You better believe it, lieutenant. ",
+ "#MUD3\\MUD3_017#Apparently an information data screen, something like the display readers on the Enterprise.",
+ "#MUD3\\MUD3_018#Both our tricorders are now working on basic processing of the aliens' computer data system. The tricorders are not the equal of the Universal Translator, but we should be able to retrieve basic information and get an insight into their culture and lifesystems. I don't believe we could have gotten even this far, had we not deduced their fixation on base-6 mathematics and esthetics.",
+ "#MUD3\\MUD3_019#Captain, it was not logical to allow Harry Mudd to get within one hundred meters of this room. ",
+ "#MUD3\\MUD3_020#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#MUD3\\MUD3_021#Not my area of expertise, I'm afraid.",
+ "#MUD3\\MUD3_022#That would be quite a find, Jim. This is an alien race unknown to us, and they are certain to have knowledge new to us.", // TYPO
+ "#MUD3\\MUD3_023#This equipment's way out of my league, Jim. ",
+ "#MUD3\\MUD3_024#And instead, he wiped the memory. That knowledge was priceless!",
+ "#MUD3\\MUD3_025#If you're incapable of emotion, how do you know what \"awe\" is, Spock? ",
+ "#MUD3\\MUD3_026#Interesting data here about the six-eyed vision processing in the brain. Their eyesight must have been excellent, and almost 300 degrees around.",
+ "#MUD3\\MUD3_027#Look at their physiology, Jim -- I think this explains the L'Shaians' fascination with threes and sixes.",
+ "#MUD3\\MUD3_028#Medical knowledge is comprehensive, and lifespan is extended considerably over archaic expectations, with maintenance of quality of life.",
+ "#MUD3\\MUD3_029#Mudd! Don't you realize what you've done! That knowledge was irreplaceable! You just burned down the galactic equivalent of the Library of Alexandria! Millions of lives might have been saved by the knowledge you destroyed! ",
+ "#MUD3\\MUD3_030#Mudd! If I were to perform an autopsy on you right now, I might be able to find a cure for stupidity! ",
+ "#MUD3\\MUD3_031#Mudd, do you know what you just did!? That knowledge was priceless -- and you've just destroyed it forever!!",
+ "#MUD3\\MUD3_032#To say nothing of fulfilling our mandate to seek out new life and new civilizations...",
+ "#MUD3\\MUD3_033#You can't be serious, Spock! ",
+ "#MUD3\\MUD3_034#I believe I have downloaded enough information to our tricorders to enable operation of most of the ship's controls, Captain.",
+ "#MUD3\\MUD3_035#I believe I have retrieved as much data as I can, Captain.",
+ "#MUD3\\MUD3_036#I believe I've extracted a copy of the main databank, Captain.",
+ "#MUD3\\MUD3_037#I would suggest, Captain, that the controls to this screen are elsewhere in this room.",
+ "#MUD3\\MUD3_038#The data viewscreen is operational. The information selectors are controlled from the console platform.",
+ "#MUD3\\MUD3_039#The tricorder's entire sensor and data processing capabilities are presently occupied with decipherment of the ship's library.",
+ "#MUD3\\MUD3_040#The tricorders are again available for general use. The alien ship's computer data is now accessible from the ship's library.",
+ "#MUD3\\MUD3_041#This platform contains the control console for the ship's computer library. Data may be accessed by using this console.",
+ "#MUD3\\MUD3_042#This platform contains the control console for what appears to be the information center of the ship -- the computer library, if you will. It appears functional, but incomprehensible without some better understanding of the aliens who built it.",
+ "#MUD3\\MUD3_043#This seems to activate the ship's computer bank control node. Given the aliens' predilection for multiples of 3, it may be possible to use our tricorders to decipher the information carried in these data banks.",
+ "#MUD3\\MUD3_044#This seems to activate the ship's computer bank control node. I lack sufficient information to commence data retrieval, however. Simply put, without some understanding of the aliens' mindset, there's no place to start.",
+ "#MUD3\\MUD3_046#I believe I can produce a picture of a member of their race, Captain.",
+ "#MUD3\\MUD3_047#I believe if Dr. McCoy and I conjoin our two tricorders, we may be able to process enough sample data to get a basic understanding of the aliens' computer system. This will completely tie up both our tricorders for an extended amount of time, however.",
+ "#MUD3\\MUD3_048#I believe, Captain, that the basic functions of the ship remain, even now. This is the library module -- the art, history, and cultural memory of the aliens are gone, but the mechanical necessities of sick bay, engineering, and sensors continue to work.",
+ "#MUD3\\MUD3_049#I have found an entry on an experimental long-range weapon booster, recently installed, named the Whyos weapon. It does not alter the power of the primary weapons systems, but it does increase the range at which those weapons are effective.",
+ "#MUD3\\MUD3_050#I'm receiving data now, Captain. Most internal and external functions are controlled from the bridge. These include Engineering, Navigation, Communications, and Sensors. Weapons functions are controlled from the weapons room.", // TYPO
+ "#MUD3\\MUD3_051#Illogical, Captain. This race has been extinct for millenia.",
+ "#MUD3\\MUD3_052#It appears our good friend Harry Mudd has crashed the main computers. I doubt if it was a very easy thing to manage.",
+ "#MUD3\\MUD3_053#It should be no surprise that physiology affects mind and behavior. I would say a six-fingered, six-eyed people would naturally develop their sciences and arts around base-six numerical systems, just as I observed on the bridge.",
+ "#MUD3\\MUD3_054#Not all topics will necessarily be available, Captain. Nor do I believe we can get full details on all data -- the tricorders could only do so much processing. It would be worth our effort to locate the central databanks for delivery to the Kornephoros Life Sciences University, I believe.",
+ "#MUD3\\MUD3_055#This is a major archeological find, Captain. I believe the galaxy may actually have cause to thank Harry Mudd. ",
+ "#MUD3\\MUD3_056#Were the Universal Translator available, this would be simple.",
+ "#MUD3\\MUD3_057#It is indeed impressive Captain. If I were capable of emotion, I would be in awe of this place. ",
+ "#MUD3\\MUD3_058#How dare you, Kirk! I have half a mind to sue for defamation of character... ",
+ "#MUD3\\MUD3_059#Kirk! Get this muscle-bound clod away from me. I'm allergic to violence! ",
+ "#MUD3\\MUD3_060#Kirk, look what you made me do! You and your clumsy Starfleet... ",
+ "#MUD3\\MUD3_061#Now see here, Dr. McCoy! Don't blame me if Kirk's bellowing causes me to be a teeny bit clumsy... ",
+ "#MUD3\\MUD3_062#Now, you aren't... I mean.... Kirk! ",
+ "#MUD3\\MUD3_063#Ooops!",
+ "#MUD3\\MUD3_064#Whatever you say, Captain!",
+ "#MUD3\\MUD3_065#Why, Captain! I see you got this machine to work -- I tried to get it up and running for the longest time.",
+ "#MUD3\\MUD3_066#Why, Kirk, I didn't think you had it in you. Thank you!",
+ "#MUD3\\MUD3_067#Captain, I think I understand why you dislike this Mudd guy so much. ",
+ "#MUD3\\MUD3_068#Not my area of expertise, I'm afraid.",
+ "#MUD3\\MUD3_069#Captain, I think Mr. Mudd looks like he's getting out of control... ",
+ "#MUD3\\MUD3_070#Captain, does this mean that I'm a part of a major archeological discovery? ",
+ "#MUD3\\MUD3_071#I don't see why you're complaining about this Mudd guy. Who knows what advances we could get from all this knowledge? ",
+ "#MUD3\\MUD3N000#Databanks erased.",
+ "#MUD3\\MUD3N001#Dust and grease lifts off the surface, leaving this item clean as new.",
+ "#MUD3\\MUD3N002#Even Spock is visibly disturbed by Mudd's carelessness. ",
+ "#MUD3\\MUD3N003#Harry Mudd hopes he can make it back to his ship and get away in one piece. ",
+ "#MUD3\\MUD3N004#Kirk is dismayed by the destruction he has seen. ",
+ "#MUD3\\MUD3N005#Kirk is silently worried about what is happening back on the Enterprise. ",
+ "#MUD3\\MUD3N006#Lieutenant Buchert is not at all happy with Harcourt Fenton Mudd. ",
+ "#MUD3\\MUD3N007#Lieutenant Buchert seems to have limitless energy. It makes you feel old just watching him. ",
+ "#MUD3\\MUD3N008#Life support fails completely and you fall unconscious.",
+ "#MUD3\\MUD3N009#McCoy is aghast at this turn of events. ",
+ "#MUD3\\MUD3N010#McCoy is his usual crusty old self. ",
+ "#MUD3\\MUD3N011#Nothing happens.",
+ "#MUD3\\MUD3N012#Sometimes you wonder if Spock will ever show emotion. ",
+ "#MUD3\\MUD3N013#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
+ "#MUD3\\MUD3N014#The computer has nothing to write to the spheroid.",
+ "#MUD3\\MUD3N015#The sphere in the middle of this console appears to be some sort of control mechanism.",
+ "#MUD3\\MUD3N016#These two things fit together like they were made for each other.",
+ "#MUD3\\MUD3N017#This might be a data screen of some kind.",
+ "#MUD3\\MUD3N018#You already have a doover.",
+ "#MUD3\\MUD3N019#You can't seem to make this work.",
+ "#MUD3\\MUD3N020#You download major portions of the alien library onto the yellow spheroid.",
+ "(Raises eyebrow)", // Custom
+
+
+ "#MUD4\\MUD4_001#Bring us home, Mr. Scott.",
+ "#MUD4\\MUD4_002#<<Communications>>",
+ "#MUD4\\MUD4_003#<<Done>>",
+ "#MUD4\\MUD4_004#I guess the universe looks about like it did the last time we saw it.",
+ "#MUD4\\MUD4_005#I'm speechless, Mr. Spock. Words cannot adequately describe this place. ",
+ "#MUD4\\MUD4_006#Mr. Spock, come take a look at this. This is evidently the main bridge. What do you make of it?",
+ "#MUD4\\MUD4_007#<<View Screen>>",
+ "#MUD4\\MUD4_008#Did you know Stella's still looking for you? What's it worth to you for me not to tell her where to find you, Harry?", // TYPO
+ "#MUD4\\MUD4_009#Don't rush off, Harry. There's still a few things we need to discuss.",
+ "#MUD4\\MUD4_010#Five of each.",
+ "#MUD4\\MUD4_011#Five. Remember, I could confiscate your entire stock as illegal goods. You might get it back through the courts... in a few years.",
+ "#MUD4\\MUD4_012#For free?",
+ "#MUD4\\MUD4_013#Go on, Mr. Spock.",
+ "#MUD4\\MUD4_014#I was sure you wouldn't miss them, Harry. The Patent Authority wants these properly registered and I'm sure you want to do the right thing.",
+ "#MUD4\\MUD4_015#In spite of Harry Mudd... ",
+ "#MUD4\\MUD4_016#In such a hurry? And Stella said she was dropping everything to meet you here.",
+ "#MUD4\\MUD4_017#Just like you were kidding about this ship registered as a worthless derelict. You are going to change that, aren't you? Matter of fact, I think it would be just the thing for you to turn it over lock stock and barrel to the Kornephorous University.",
+ "#MUD4\\MUD4_018#Kirk to Enterprise ... Kirk to Enterprise.", // TYPO: used in MUD4 and LOVE mission; the text was different in LOVE, not matching with audio.
+ "#MUD4\\MUD4_019#Later, Mr. Scott.",
+ "#MUD4\\MUD4_020#New developments, Mr. Scott?",
+ "#MUD4\\MUD4_021#No, Harry, we're going to let you keep them to sell to the Elasi at incredible profits, so they can use them against Federation authorites.",
+ "#MUD4\\MUD4_022#No, I need to have a word with Harry Mudd before we go.",
+ "#MUD4\\MUD4_023#No, I need to have a word with Harry Mudd before we go.",
+ "#MUD4\\MUD4_024#No, we want to look around some more. We'll call you on this channel when we're ready.",
+ "#MUD4\\MUD4_025#Scotty! Report!",
+ "#MUD4\\MUD4_026#Tell me why I shouldn't arrest you on the spot, just on general principles?",
+ "#MUD4\\MUD4_027#The local star seems to be acting up. Will there be a problem with the transporter? I want you to beam up the landing party, and I also want you to lock onto and beam aboard an alien mechanism we came across.",
+ "#MUD4\\MUD4_028#The local star seems to be acting up. Will there be a problem with the transporter?",
+ "#MUD4\\MUD4_029#I would suggest, Captain, we take him up on his offer.",
+ "#MUD4\\MUD4_030#Very well, Harry. You're off scot free... this time. But if you don't upload that data immediately, your measly little scoutship will be experiencing some difficulties maintaining flight capabilities.",
+ "#MUD4\\MUD4_031#What else can you determine at this stage, Mr. Spock?",
+ "#MUD4\\MUD4_032#When we meet, Harry, it always means trouble.",
+ "#MUD4\\MUD4_033#Yes, bring us home, Mr. Scott.",
+ "#MUD4\\MUD4_034#You destroyed the only known records of a lost race. That's a punishable offense.",
+ "#MUD4\\MUD4_035#You have no idea what a great bargain it is, Mudd.",
+ "#MUD4\\MUD4_036#You made a backup?",
+ "#MUD4\\MUD4_037#You were selling high-technology weapons to terrorists and known criminals.",
+ "#MUD4\\MUD4_038#<<Sensors>>",
+ "#MUD4\\MUD4_039#<<Navigation>>",
+ "#MUD4\\MUD4_040#<<Engineering>>",
+ "#MUD4\\MUD4_041#<<Done>>",
+ "#MUD4\\MUD4_042#Evidently the aliens' bridge, their centralized control. A closer look may provide more information.",
+ "#MUD4\\MUD4_043#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#MUD4\\MUD4_045#I can't make anything of these controls.",
+ "#MUD4\\MUD4_046#To boldly go, where no man has gone before... we're here, Jim. ",
+ "#MUD4\\MUD4_047#Speak of the devil, where is that little angel? ",
+ "#MUD4\\MUD4_048#This shouldn't be surprising -- after all, there are two stations.",
+ "#MUD4\\MUD4_049#I think this is the secondary station.",
+ "#MUD4\\MUD4_050#It appears to be a view screen much like the one on board the Enterprise.",
+ "#MUD4\\MUD4_051#It is a multi-bit, compact doover with its own dracktar traction unit and clamp kit.",
+ "#MUD4\\MUD4_052#Thanks to the library computer data, limited though it is, these primary controls give me access to...",
+ "#MUD4\\MUD4_053#The Enterprise is in combat with a number of Elasi pirate ships half a parsec toward the neutron star sector. I read debris identifiable with the pirates, but they continue to harass the Enterprise.",
+ "#MUD4\\MUD4_054#The Enterprise is out of range for this equipment, under the conditions of static created by the neutron star.",
+ "#MUD4\\MUD4_055#The computer reports this ship is incapable of navigating anywhere at all without major repairs. We are definitely dead in space until the Enterprise returns, Captain.",
+ "#MUD4\\MUD4_056#The engine pods are damaged but still generating power, Captain.",
+ "#MUD4\\MUD4_057#This appears to be the primary control panel. Perhaps you would be better equipped to man this station, Captain.",
+ "#MUD4\\MUD4_058#This is the secondary station. With the limited understanding we now have of the library computer data, these controls can now be activated. Available are... ",
+ "#MUD4\\MUD4_059#That may be, Doctor, but if you will recall, all the Enterprise's different stations link into the same computer network bank and...",
+ "#MUD4\\MUD4_060#These people have a fixation for the number six, and even divisors and multiplicands thereof: threes and twelves in particular. I believe this may be the necessary first clue to understanding the aliens.",
+ "#MUD4\\MUD4_061#This is clearly the control center for the ship, Captain. I cannot deduce much information, but I do observe two things.",
+ "#MUD4\\MUD4_062#This station definitely is configured differently from the one beside me.",
+ "#MUD4\\MUD4_063#We have done quite well so far, Captain. ",
+ "#MUD4\\MUD4_064#Because I am going to turn over a selection of samples to the Kornephorous Life Sciences University?",
+ "#MUD4\\MUD4_065#Captain Kirk! I seem to be missing a Miracle De-Grimer! Surely you're not stooping to thievery, are you, Captain?",
+ "#MUD4\\MUD4_066#Captain Kirk! I was hoping to see you. I'm leaving soon and wanted to say thanks for the escort. Ta-ta, and I hope we never have to cross paths again, Captain.",
+ "#MUD4\\MUD4_067#Captain!! Two.",
+ "#MUD4\\MUD4_068#Consider it done. You have my word, Captain. Now I'm going to pick up just a few things. Insignificant things, really! Then I'll be gone. Farewell, Captain! May your path be always trouble-free, until we meet again.",
+ "#MUD4\\MUD4_069#I understand. No problem. Adieu, Captain!",
+ "#MUD4\\MUD4_070#Uh... of course. One of everything I've found here.",
+ "#MUD4\\MUD4_071#Well, Captain, I did manage to take a download of the computer before I accidentally damaged it. If you'll just let me go back to my ship, I can upload it to the Enterprise's computers from there.",
+ "#MUD4\\MUD4_072#What! Where's the profit in that, Captain?",
+ "#MUD4\\MUD4_073#You drive a hard bargain, Captain. It's a deal.",
+ "#MUD4\\MUD4_074#You're. Kidding. Are you kidding, Captain?",
+ "#MUD4\\MUD4_075#I don't believe this is the weapons center, Captain. There appears to be one, but it's evidently located elsewhere on the ship. I can't make anything more of these controls.",
+ "#MUD4\\MUD4_076#This may have been their bridge, but this sure doesn't look like the Enterprise. ",
+ "#MUD4\\MUD4_A29#Very well, bring us home, Mr. Scott.",
+ "#MUD4\\MUD4_S02#The Elasi pirates have been driven off, Captain. We have damage, and injuries among the crew. We just arrived back here a few minutes ago, and we've been trying to raise you on the communicators.",
+ "#MUD4\\MUD4_S03#The neutron star is causing more and more problems, Captain. I would recommend beaming over at your earliest possible convenience.",
+ "#MUD4\\MUD4_S04#We can do it, Captain, no problem. At least right now, but the situation is only going to get worse. Are you ready to beam over now?",
+ "#MUD4\\MUD4N000#A control console from which operators run the ship.",
+ "#MUD4\\MUD4N001#Dr. McCoy is still frowning. ",
+ "#MUD4\\MUD4N002#Dust and grease lifts off the surface, leaving this item clean as new.",
+ "#MUD4\\MUD4N003#James T. Kirk, Captain of the USS Enterprise. ",
+ "#MUD4\\MUD4N004#Lieutenant Buchert looks intensely at these controls, and suppresses a childlike impulse to touch them. ",
+ "#MUD4\\MUD4N005#Life support fails completely and you fall unconscious.",
+ "#MUD4\\MUD4N006#Mr. Spock, Vulcan's finest contribution to Starfleet. ",
+ "#MUD4\\MUD4N007#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
+ "#MUD4\\MUD4N008#The starfield is the same one you saw from the bridge of the Enterprise, with the binary stars swinging majestically past each other.",
+ "#MUD4\\MUD4N009#These two things fit together like they were made for each other.",
+ "#MUD4\\MUD4N011#This appears to be some sort of engineering instrument. ",
+ "#MUD4\\MUD4N012#You already have a doover.",
+ "#MUD4\\MUD4N013#You see a plain grey screen.",
+
+
+ "#MUD5\\MUD5_001#I suspect that's a blessing in disguise, Mr. Spock!",
+ "#MUD5\\MUD5_002#Just think of it, Spock. An advanced civilization, with powerful technology and nearly unlimited knowledge, and yet all of that didn't save them. ",
+ "#MUD5\\MUD5_003#Kirk to Enterprise...",
+ "#MUD5\\MUD5_004#Let's hope there isn't too much for you to do back at the Enterprise. ",
+ "#MUD5\\MUD5_005#Mudd! I oughta...",
+ "#MUD5\\MUD5_006#No, Harry, but I figure it's probably where you'll find your lost marbles.",
+ "#MUD5\\MUD5_007#That was a close one. Too close! If I ever get my hands on that no good Mudd I'll...",
+ "#MUD5\\MUD5_009#Will wonders never cease.",
+ "#MUD5\\MUD5_010#Yes, I've got it but you can't have it.",
+ "#MUD5\\MUD5_011#An unusual matter-anti-matter engine, reminiscent of the designs created by the hoopooin of Seginus IV.",
+ "#MUD5\\MUD5_012#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#MUD5\\MUD5_013#Our lives won't be worth a plugged nickel if we don't get that makeshift life support generator back in working order!",
+ "#MUD5\\MUD5_014#This life support generator is an unreliable model at the best of times. Tinkering with it is a gamble with your life!",
+ "#MUD5\\MUD5_015#Do you really think there's anything on Mudd's ship we need, Captain? I don't.",
+ "#MUD5\\MUD5_016#Spock! Meaningless conversation is one of life's great pleasures. ",
+ "#MUD5\\MUD5_017#Well Jim, as long as we don't strangle Harry Mudd, I can't see very much for me to do on this mission. ",
+ "#MUD5\\MUD5_018#You know, lieutenant, they say if you can't say anything good about a person, you shouldn't say anything at all. In that case, I've got a lot I shouldn't say about Harry Mudd. ",
+ "#MUD5\\MUD5_019#The life support generator is malfunctioning. Repairs must be made soon or the atmosphere will fall below the level required to sustain us, Captain.",
+ "#MUD5\\MUD5_020#The life support system must be repaired soon. Readings indicate the environment is dropping quickly.",
+ "#MUD5\\MUD5_021#This \"Sav-a-Ship\" life support generator has seen a great deal of use. It was never a reliable model, being prone to breakdown without warning. It is, however, properly connected, with warning alarms for temperature, atmosphere, and radiation.",
+ "#MUD5\\MUD5_022#This room appears to have been the alien ship's engine pod. A ship-to-ship access hatch and a temporary life support generator are evidently recent additions.",
+ "#MUD5\\MUD5_023#This seems to be a crane of some sort, Captain. Currently, no power is running to it.",
+ "#MUD5\\MUD5_024#As one would expect, Mr. Mudd has sealed the hatch with his personal code. We cannot enter his ship, Captain.",
+ "#MUD5\\MUD5_025#Captain, the Gomuchi-Grindrod Salvage Hatch is designed to withstand low power phaser blasts. However, I would not trust the integrity of the ship's hull were we to increase phaser power to open this hatch.",
+ "#MUD5\\MUD5_026#Evidently Mr. Mudd was unwilling to pay the price for a reliable salvage model.",
+ "#MUD5\\MUD5_027#I doubt there's anything on Mudd's ship we require, Captain.",
+ "#MUD5\\MUD5_028#I would not suggest we take the time to seek him. This emergency could occur again. I would suggest we hasten our departure.", // TYPO
+ "#MUD5\\MUD5_030#In this case, I agree with the good doctor.",
+ "#MUD5\\MUD5_031#It appears that Harry Mudd managed to emplace this access hatch without significantly damaging the alien ship.",
+ "#MUD5\\MUD5_032#It is a sobering thought, Captain. ",
+ "#MUD5\\MUD5_033#Unlike humans, I do not decrease my efficiency with meaningless dialogue. ",
+ "#MUD5\\MUD5_034#Captain, you wouldn't have seen my Multipurpose Doover anywhere? I need to, uh, fix something.",
+ "#MUD5\\MUD5_035#Oh! Was there a problem?",
+ "#MUD5\\MUD5_036#Sorry, no time to chat. I'm a busy man you know.",
+ "#MUD5\\MUD5_037#You really can be a headache, Captain. Maybe I can find a spare somewhere else. Good lu...I mean goodbye.",
+ "#MUD5\\MUD5_038#Captain, I'm not feeling well. Without life support, we can't remain here much longer.",
+ "#MUD5\\MUD5_039#Captain, I don't think we can open this hatch with phasers, and still depend on the integrity of the ship's hull to hold atmosphere.",
+ "#MUD5\\MUD5_040#When we get back to the Enterprise, you're going to have to tell me everything you know about this Mudd guy. ",
+ "#MUD5\\MUD5N000#A large claw-like device hangs from the ceiling.",
+ "#MUD5\\MUD5N001#Dust and grease lifts off the surface, leaving this item clean as new.",
+ "#MUD5\\MUD5N002#James T. Kirk. Exploring the unknown is one of the few pleasures that the burden of command allows him. ",
+ "#MUD5\\MUD5N003#Lieutenant Buchert watches and says nothing. He's the strong, silent type. ",
+ "#MUD5\\MUD5N004#McCoy glances back and forth, looking for a sign of Harry Mudd. ",
+ "#MUD5\\MUD5N005#Spock continues to examine the equipment with a scientist's eye. ",
+ "#MUD5\\MUD5N006#Tall, transparent columns run through the ceiling. Energy crackles in between the duo-decahedrons inside them.",
+ "#MUD5\\MUD5N007#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
+ "#MUD5\\MUD5N008#There seems to be something wrong with the life support generator.",
+ "#MUD5\\MUD5N009#These two things fit together like they were made for each other.",
+ "#MUD5\\MUD5N010#This door leads back to the main cargo bay.",
+ "#MUD5\\MUD5N011#A salvage lock hatch, a common type used to link a derelict to the ship doing the salvaging.",
+ "#MUD5\\MUD5N012#A \"Sav-a-Ship\" emergency life support generator, generally used for temporary life support during evacuation of small damaged ships.",
+ "#MUD5\\MUD5N105#Life support fails completely and you fall unconscious.",
+
+
+ "#FEA0\\FEA0_002#And exactly what would you have done with them? Entering Klingon space for anything puts the peace in peril.",
+ "#FEA0\\FEA0_003#And then your followers were destroyed because when white men arrived on that continent, they were believed to be you in your promised return. Your people perverted your teachings, then were destroyed by it.",
+ "#FEA0\\FEA0_004#Damned right the results were swift. The Klingons have been raiding colonies looking for you.",
+ "#FEA0\\FEA0_005#Ha! You mean your followers love pieces! They slaughtered other believers hoping you'd return.",
+ "#FEA0\\FEA0_006#I am Captain James T. Kirk of the Starship Enterprise. Did you know the Klingons are looking for you?",
+ "#FEA0\\FEA0_007#I am Captain James T. Kirk of the Starship Enterprise. What did you do to get the Klingons so upset?",
+ "#FEA0\\FEA0_008#Listen, the Klingons are ripping colonies apart to find you, so stop this nonsense. This is serious.",
+ "#FEA0\\FEA0_009#Listen, Mister, any missions conducted within Klingon space fully jeopardize the peace.",
+ "#FEA0\\FEA0_010#Quetzecoatl? How fitting you would name yourself after one of the most bloody-handed gods in Earth's history.",
+ "#FEA0\\FEA0_011#We're not your children and we don't appreciate this wild goose chase you've forced us into.",
+ "#FEA0\\FEA0_012#Whatever you did has them very upset. They're raiding worlds looking for you.",
+ "#FEA0\\FEA0_013#Your followers regularly sacrificed other believers to you after you left, offering you their still-beating hearts.",
+ "#FEA0\\FEA0_014#Your people? We represent all of the Earth's people and we certainly do not recognize you.",
+ "#FEA0\\FEA0_015#He appears human... All life signs are normal, but I'm getting strange energy readings near the base of his pituitary gland.",
+ "#FEA0\\FEA0_016#Ouch!",
+ "#FEA0\\FEA0_017#Jim, that man is dressed in ancient Aztec clothing.",
+ "#FEA0\\FEA0_018#What do you know about Earth culture? He looks like an ancient Aztec!",
+ "#FEA0\\FEA0_019#I am picking up multiple life forms in the surrounding region, Captain.",
+ "#FEA0\\FEA0_020#I am picking up strange energy readings from the alien. Perhaps Doctor McCoy could provide better data.",
+ "#FEA0\\FEA0_021#I believe you are mistaken, doctor. His clothing bears a distinct resemblance to fashions of a much later period.",
+ "#FEA0\\FEA0_022#The humanoid's adornments appear similar to those worn by leaders of Earth's early 20th century inhabitants of the South American continent.",
+ "#FEA0\\FEA0_023#I'm just a security officer, sir.",
+ "#FEA0\\FEA0_024#I am Quetzecoatl. I elevated a civilization on your world from barbarism to sentience. You are a perversion of that process. Be gone!",
+ "#FEA0\\FEA0_025#You dare fire at a god?",
+ "#FEA0\\FEA0_026#Bloody-handed? My people love peace!",
+ "#FEA0\\FEA0_027#Foul lying creatures, my gift was wasted upon you! Begone.",
+ "#FEA0\\FEA0_028#Greetings, my children. I can barely imagine that you have come so far.",
+ "#FEA0\\FEA0_029#Impossible! You must be lying!",
+ "#FEA0\\FEA0_030#Jeopardize the peace? Hardly. Peace is what I preach. I am Quetzecoatl, as you well know from the proud history of your world.",
+ "#FEA0\\FEA0_031#Quaint expression. I have done nothing to anger them. I did with them what I have done with everyone.",
+ "#FEA0\\FEA0_032#The Klingons? Amazing! This is the first time one of my missions has produced results so swiftly.",
+ "#FEA0\\FEA0_033#Who are you? I know you come from Terrasol, but you are not of my people. What goes on here?",
+ "#FEA0\\FEA0_101#No, you must be lying. They could not be raiding if they are looking for me. Violence was not the message of any of my missions. I, Quetzecoatl, preach universal brotherhood and peace.",
+ "#FEA0\\FEA0_108#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#FEA0\\FEA0N000#Feral red eyes glare out of the dark at you.",
+ "#FEA0\\FEA0N001#It looks like the jungle has grown up into a small hut.",
+ "#FEA0\\FEA0N002#Lt. Stragey is carefully eyeing the humanoid.",
+ "#FEA0\\FEA0N003#Luminescent insects swarm near a large tree.",
+ "#FEA0\\FEA0N004#McCoy is fidgeting around.",
+ "#FEA0\\FEA0N005#Spock is analyzing the surroundings.",
+ "#FEA0\\FEA0N006#The log appears sturdy enough to cross.",
+ "#FEA0\\FEA0N007#The moon of Digifal. Legend says that the gods of good and evil fortune live there and will glance back at those who look at them, and either a miracle or a catastrophe will soon befall those who gaze upon it.",
+ "#FEA0\\FEA0N008#There is a tall, slender, dark haired man looking intently at you.",
+ "#FEA0\\FEA0N009#You see dense vegetation in all directions.",
+
+
+ "#FEA1\\FEA1_001#We wouldn't want to bleed all over Dr. McCoy now, would we?",
+ "#FEA1\\FEA1_002#Well, yes.",
+ "#FEA1\\FEA1_003#A pile of small igneous rocks, Captain.",
+ "#FEA1\\FEA1_004#And get my fingers taken off by some alien reptile? You've got to be joking.",
+ "#FEA1\\FEA1_005#Are you nuts? There's no way I'm touching any damned snake!",
+ "#FEA1\\FEA1_006#Do I look like Houdini to you? I'm afraid you're going to have to pull the rabbit out of the hat on this one.",
+ "#FEA1\\FEA1_007#Does it look sick to you, Captain?",
+ "#FEA1\\FEA1_008#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#FEA1\\FEA1_009#Hey! What was that for?",
+ "#FEA1\\FEA1_010#I'm not putting my fingers in there, Jim.",
+ "#FEA1\\FEA1_011#It's a damned hole with a snake in it.",
+ "#FEA1\\FEA1_012#It's a damned hole.",
+ "#FEA1\\FEA1_013#It's bad enough that you put me in the damn transporter, now you want me to break my neck climbing that?!",
+ "#FEA1\\FEA1_014#It's moss. Anyone got any rolling stones?",
+ "#FEA1\\FEA1_015#No toxic reaction. It appears to be ordinary, except for this resin.",
+ "#FEA1\\FEA1_017#Didn't they have baseball on Vulcan? Show us your fastball, Jim.",
+ "#FEA1\\FEA1_018#Especially that green Vulcan blood. The last thing I need is a pint of T-Negative blood all over my uniform.",
+ "#FEA1\\FEA1_019#It's a damned snake! Do you know what snakebite does? It can ruin your whole day.",
+ "#FEA1\\FEA1_020#It's bad enough being around pointy-eared Vulcans, now I have to listen to ensigns who think they can do my job!",
+ "#FEA1\\FEA1_021#Probability? That was a perfect pitch if I ever saw one.",
+ "#FEA1\\FEA1_022#The bite wasn't serious Captain. He'll be fine, but I would like to get him to sickbay in case there's some alien infection.",
+ "#FEA1\\FEA1_023#Fascinating. Our communicators have apparently been rendered ineffective.",
+ "#FEA1\\FEA1_024#I am picking up residual energy readings from the area where the alien's projection was.",
+ "#FEA1\\FEA1_025#I can not reach the snake, Captain.",
+ "#FEA1\\FEA1_026#I realize that humans form emotional bonds with pets, but I recommend tribbles.",
+ "#FEA1\\FEA1_027#I see no logic in searching an empty hole, Captain.",
+ "#FEA1\\FEA1_028#It is logical that an entity that professes to teach peace would render our phasers inoperative.",
+ "#FEA1\\FEA1_029#It looks like a Zamphorian pit snake. A rather common species in this region, noted by galactic herpatologists for their quickness. It is not venomous or dangerous to humans. ",
+ "#FEA1\\FEA1_030#It would appear that this is where the snake lives, Captain. It is currently inside.",
+ "#FEA1\\FEA1_031#It would appear that this is where the snake lives, Captain.",
+ "#FEA1\\FEA1_032#Thank you, Captain, but I assure you that I was giving this situation my fullest attention.",
+ "#FEA1\\FEA1_033#The resin does not seem to have any unusual properties.",
+ "#FEA1\\FEA1_034#The snake has gone back into the hole, Captain.",
+ "#FEA1\\FEA1_035#The snake is too quick to be easily grabbed before it retreats, Captain.", // TYPO
+ "#FEA1\\FEA1_037#This isn't very logical, but as you are human, it is quite understandable.", // TYPO
+ "#FEA1\\FEA1_038#This variety of moss seems to leave a very sticky resin behind. Perhaps to trap the large amounts of pollen from the plants on the surface, and use it as a secondary food source.",
+ "#FEA1\\FEA1_039#This vine is not likely to support our weight by itself, Captain. You would have to find some way to reinforce it.",
+ "#FEA1\\FEA1_040#Those vines would be useful to escape, if we could reach them.",
+ "#FEA1\\FEA1_041#A fascinating specimen, Captain, but I would be careful handling it. From the looks of it, it may have a nasty bite.", // TYPO
+ "#FEA1\\FEA1_042#Fascinating. It did appear to knock the vine down near to the point where one of us can reach it.",
+ "#FEA1\\FEA1_043#The probability of getting the vine on the second try was only 36.53%. Well done, Captain.",
+ "#FEA1\\FEA1_044#We are not likely to find a way out of this pit with humor, doctor. I suggest you concentrate your efforts to the problem at hand.",
+ "#FEA1\\FEA1_045#I'm glad I was taught pain-nullification techniques.",
+ "#FEA1\\FEA1_046#It doesn't seem to want to be grabbed, sir. It just slithers back to its hole.",
+ "#FEA1\\FEA1_047#It's coming out again, sir.",
+ "#FEA1\\FEA1_048#No enemies in sight, but supplies could be a problem if we don't get out.",
+ "#FEA1\\FEA1_049#Sure is sticky sir. I can't see much use in it.",
+ "#FEA1\\FEA1_050#That's something of a runt, Captain. You should've seen this Rigilian python that Cadet Tyrli put in the shower at the Academy. Twenty meters long!",
+ "#FEA1\\FEA1_051#The hole is empty, sir.",
+ "#FEA1\\FEA1_052#There's no way that we're getting up that way, Captain. The vine is too weak.",
+ "#FEA1\\FEA1_053#All Right! We're on our way!",
+ "#FEA1\\FEA1_054#Baseball? No one plays that anymore. Good try though, sir.",
+ "#FEA1\\FEA1_055#Do they always argue like this, Captain?",
+ "#FEA1\\FEA1_056#Doctors! It'll take more than a couple of scratches to put me out action, sir.",
+ "#FEA1\\FEA1_057#You clearly are not the inheritors of the noble Aztec world. What you have said has greatly disturbed me. You should not lie so. You shall remain here until you have learned the error of angering Quetzecoatl!",
+ "#FEA1\\FEA1_A46#There is not enough support, Captain.",
+ "#FEA1\\FEA1_F25#What on Earth are you doing with that slithering thing!",
+ "#FEA1\\FEA1N000#Feral red eyes glare out of the dark at you.",
+ "#FEA1\\FEA1N001#James T. Kirk does not seem very happy with his current predicament.",
+ "#FEA1\\FEA1N002#Lt. Stragey is carefully examining the pit.",
+ "#FEA1\\FEA1N003#McCoy is examining the floor of the pit.",
+ "#FEA1\\FEA1N004#Spock is carefully examining the pit.",
+ "#FEA1\\FEA1N005#The hole is already blocked.",
+ "#FEA1\\FEA1N006#The rock is a bit stickier.",
+ "#FEA1\\FEA1N007#The snake darts back into its hole before you can catch it.",
+ "#FEA1\\FEA1N008#The vine is attached to a tree above you.",
+ "#FEA1\\FEA1N009#The vine is not within reach.",
+ "#FEA1\\FEA1N010#The vine will not support you.",
+ "#FEA1\\FEA1N011#There are rocks here, quite suitable for picking up and throwing.",
+ "#FEA1\\FEA1N012#There are several loose vines hanging over the side of the pit, out of reach. This is one of them.",
+ "#FEA1\\FEA1N013#There is a light suspended from above by a chain.",
+ "#FEA1\\FEA1N014#There is a tiny hole in the wall at this point. Certainly no human could crawl through here.",
+ "#FEA1\\FEA1N015#There is a vine hanging down into the pit.",
+ "#FEA1\\FEA1N016#This moss is covered with a very sticky substance.",
+ "#FEA1\\FEA1N017#This particular snake doesn't seem to like your company, and moves whenever you get near it.",
+ "#FEA1\\FEA1N018#With no where for the snake to go, you easliy capture it.",
+ "#FEA1\\FEA1N019#You already have rocks.",
+ "#FEA1\\FEA1N020#You are in a deep pit. It is a long, hard climb to the top.",
+ "#FEA1\\FEA1N021#You cannot reach it from where you are.",
+ "#FEA1\\FEA1N022#You pick up some rocks from the pile.",
+
+
+ "#FEA2\\FEA2_001#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#FEA2\\FEA2_002#Nothing interesting in this neck of the woods, Jim.",
+ "#FEA2\\FEA2_003#They're dead, Jim.",
+ "#FEA2\\FEA2_004#This jungle is sure lush, Jim. Speaking of lush, I could use a nice saurian brandy about now.",
+ "#FEA2\\FEA2_005#Really? Tell me more about your childhood Lieutenant...",
+ "#FEA2\\FEA2_006#Fascinating. Our communicators have apparently been rendered ineffective.",
+ "#FEA2\\FEA2_007#I am reading a life form to the west. It appears to be humanoid.",
+ "#FEA2\\FEA2_008#Staying in this overgrown region could prove quite dangerous. I suggest we continue, Captain.",
+ "#FEA2\\FEA2_009#I feel like someone is watching us, Captain.",
+ "#FEA2\\FEA2_010#You know, I always wanted to go swinging on a vine through a jungle. Just like in some old books I read when I was a kid.",
+ "#FEA2\\FEA2N000#A vine hangs from the trees.",
+ "#FEA2\\FEA2N001#Feral red eyes glare out of the dark at you.",
+ "#FEA2\\FEA2N002#Kirk is wondering what he said that made Quetzecoatl so angry...",
+ "#FEA2\\FEA2N003#Lt. Stragey appears fascinated by the vines hanging from the trees.",
+ "#FEA2\\FEA2N004#McCoy is filled with premonitions of injury and death. Why else would they have brought him along?",
+ "#FEA2\\FEA2N005#Spock is examining the surrounding terrain for signs of danger. Anything else would be illogical.",
+ "#FEA2\\FEA2N006#This great tree has been in this jungle for centuries.",
+ "#FEA2\\FEA2N007#Trees to the left of you! Trees to the right of you! Into the valley of trees raced the landing party!",
+ "#FEA2\\FEA2N008#You are in a densely vegetated area. The overgrowth blocks your view in all directions.",
+
+
+ "#FEA3\\FEA3_001#Well, does anyone have any suggestions?",
+ "#FEA3\\FEA3_002#Great Tlaoxac, I do not understand. Quetzecoatl says that his is the way of peace, yet you wish blood to be shed?",
+ "#FEA3\\FEA3_003#It is urgent that we speak to Quetzecoatl. His life may depend on it. Please stand aside and let us pass?",
+ "#FEA3\\FEA3_004#An intriguing solution Captain, but it is unlikely that he will accept green blood as a proper sacrifice.",
+ "#FEA3\\FEA3_005#Did you ever get the feeling that people don't like you?",
+ "#FEA3\\FEA3_006#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#FEA3\\FEA3_007#Get that thing away from me!",
+ "#FEA3\\FEA3_008#He dropped a knife, Jim!",
+ "#FEA3\\FEA3_009#He's out cold, Jim.I don't think we'll have any more trouble from him.",
+ "#FEA3\\FEA3_010#He's unconscious, Jim.",
+ "#FEA3\\FEA3_011#Hey! What do you think you're doing?",
+ "#FEA3\\FEA3_012#Jim, he'll be up in about a half hour. If I wake him now he's liable to retalliate for your thoughtless actions.", // TYPO
+ "#FEA3\\FEA3_013#These lamps are made up of insects much like fireflies, Jim.",
+ "#FEA3\\FEA3_014#Well, either this Aztec is a real flesh and blood human being, or I'm going to be retired as soon as I get back to the Enterprise.",
+ "#FEA3\\FEA3_015#Damn. He noticed.",
+ "#FEA3\\FEA3_016#Isn't that what they said to David before he fought Goliath?",
+ "#FEA3\\FEA3_017#Well, then send in David!",
+ "#FEA3\\FEA3_018#What about your famous nerve pinch?",
+ "#FEA3\\FEA3_019#Fascinating. These lights are actually swarms of bio-luminescent insects. I wonder how they are controlled.",
+ "#FEA3\\FEA3_020#Interesting. From the angle of its fangs and the shape of its mouth, it might have had the ability to inject its prey with venom at one time.", // TYPO
+ "#FEA3\\FEA3_021#Nothing unusual here, Captain.",
+ "#FEA3\\FEA3_022#Perhaps our host will be more reasonable now. I recommend trying to locate him, Captain.",
+ "#FEA3\\FEA3_023#Still inoperative, Captain.",
+ "#FEA3\\FEA3_024#Still inoperative, Captain.",
+ "#FEA3\\FEA3_025#That is not a logical act, Captain.",
+ "#FEA3\\FEA3_026#Captain, I do not think that I can defeat him in personal combat.",
+ "#FEA3\\FEA3_027#Doctor, may I remind you that David defeated Goliath?",
+ "#FEA3\\FEA3_028#It is unlikely to work on a man of that size, doctor.",
+ "#FEA3\\FEA3_029#All right! Time for some action. Let me show you how we did it at the Acad... uh, Captain, do you realize how BIG this guy is?",
+ "#FEA3\\FEA3_030#sHe's dead, Jim!", // TYPO
+ "#FEA3\\FEA3_031#I'm really not that anxious to get a good look at it, sir.",
+ "#FEA3\\FEA3_032#Nice planet. I kinda like it.",
+ "#FEA3\\FEA3_033#Ouch, sir.",
+ "#FEA3\\FEA3_034#Well, there is a doctor here, so I guess it's all right. They never told me I'd be doing this at the Academy.",
+ "#FEA3\\FEA3_035#Get back! You may not pass until you prove your worthiness.",
+ "#FEA3\\FEA3_036#I am Tlaoxac, priest of Quetzecoatl. Only one who knows his ways may approach his holy ground.",
+ "#FEA3\\FEA3_037#I do not understand your words, but it does not matter. You may not pass until blood is shed.",
+ "#FEA3\\FEA3_038#I will not listen to your deceitful ways.",
+ "#FEA3\\FEA3_039#Indeed you know the ways of Quetzecoatl But only a man of courage, one who will shed blood will pass.",
+ "#FEA3\\FEA3_040#None can threaten the great Quetzecoatl! You lie! Truly you do not serve the serpent-god. You may not pass!",
+ "#FEA3\\FEA3_041#None shall pass until blood is shed.", // TYPO
+ "#FEA3\\FEA3_042#Nonetheless, that is what must be done. Only men of courage are allowed into his presence.",
+ "#FEA3\\FEA3_043#Self-sacrifice is the noblest quality of humanity. You may go. Beware the monster in the water. You may have my knife to defend yourself.",
+ "#FEA3\\FEA3_044#You are truly a noble man, unlike the coward who was not capable of shedding his own blood. You may pass, but beware the man in the golden robe. He may lead you to your death. Use this knife to defend yourself.",
+ "#FEA3\\FEA3N000#McCoy seems rather nervous.",
+ "#FEA3\\FEA3N001#Primitive lights illuminate this savage scene.",
+ "#FEA3\\FEA3N002#Spock looks small compared to the great warrior.",
+ "#FEA3\\FEA3N003#The aztec warrior lies on the ground unconcious.",
+ "#FEA3\\FEA3N004#The snake enjoys snacking on you.",
+ "#FEA3\\FEA3N005#This was once a living member of your crew.",
+ "#FEA3\\FEA3N006#Tloaxac falls to the ground unconscious.",
+ "#FEA3\\FEA3N007#Towering over your security officer, holding a great spear in his huge hands, the great warrior Tlaoxac will let no one pass him.",
+ "#FEA3\\FEA3N010#You pick up the beautifully crafted knife.",
+ "#FEA3\\FEA3N011#You see a jewel encrusted, gold colored knife.",
+ "#FEA3\\FEA3N012#Your security officer looks at you for orders and, perhaps, inspiration.",
+
+
+ "#FEA4\\FEA4_001#A swarm of fireflies, Jim.",
+ "#FEA4\\FEA4_002#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#FEA4\\FEA4_003#I would strongly recommend against touching these, Jim. They are highly toxic.",
+ "#FEA4\\FEA4_004#It's getting a little cool out here. Keep warm. I don't want a bunch of sick crewmen when we get back to the ship. If we ever do get back to the ship.",
+ "#FEA4\\FEA4_005#Still out, Jim.",
+ "#FEA4\\FEA4_006#You're looking a little pale, Jim.",
+ "#FEA4\\FEA4_007#Fascinating. The trees are able to grow very close together in this forest, Captain.",
+ "#FEA4\\FEA4_008#I am reading a life form to the west, Captain.",
+ "#FEA4\\FEA4_009#It vaguely resembles the Terran Spanish Bayonette. The edges of the leaf are razor sharp and secrete a poisonous resin.",
+ "#FEA4\\FEA4_010#Small colonies of bio-luminescent insects, Captain.",
+ "#FEA4\\FEA4_011#They are not currently operational, Captain.",
+ "#FEA4\\FEA4_012#Tralxacian mushrooms. Their spores are highly toxic and are released if they are disturbed.",
+ "#FEA4\\FEA4_013#Does every planetside mission have this much adventure, Captain? Mind you, I can't say Mr. Quetzecoatl is making a very good impression on me...",
+ "#FEA4\\FEA4N000#A large fern fans the pathway.",
+ "#FEA4\\FEA4N001#Below this rock is a large growth of mushrooms.",
+ "#FEA4\\FEA4N002#Familiar glowing spheres light the path.",
+ "#FEA4\\FEA4N003#Feral red eyes glare out of the dark at you.",
+ "#FEA4\\FEA4N004#James T. Kirk realizes that every step increases their danger.",
+ "#FEA4\\FEA4N005#Lt. Stragey smiles as he strolls down the path.",
+ "#FEA4\\FEA4N006#McCoy doesn't want to be bothered right now.",
+ "#FEA4\\FEA4N007#Mr. Spock analyzes the surroundings.",
+ "#FEA4\\FEA4N008#You are in a dark forest. You can hear the flow of water to the northwest.",
+
+
+ "#FEA5\\FEA5_001#This is a very finely crafted knife.",
+ "#FEA5\\FEA5_002#Captain, I believe it would be suicide to try crossing the log while the creature is near.",
+ "#FEA5\\FEA5_003#Captain, I do not believe that my service to Starfleet includes, as humans say, 'throwing my life away'.",
+ "#FEA5\\FEA5_004#Captain, I would recommend using something to cut the plant. There are numerous small thorns along the stem.",
+ "#FEA5\\FEA5_005#Captain, it would not be wise to cross while the creature is near.",
+ "#FEA5\\FEA5_006#Due to the small size of the knife, I doubt it would harm such a large creature.",
+ "#FEA5\\FEA5_007#Anyone for a campfire?",
+ "#FEA5\\FEA5_008#Captain, I'll declare you unfit to command if you keep this up!",
+ "#FEA5\\FEA5_009#Damn! That's gonna hurt Jim. Take a look at those thorns. You might try cutting that with something.", // TYPO
+ "#FEA5\\FEA5_010#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#FEA5\\FEA5_011#I'm not reading that creature anymore, Jim.",
+ "#FEA5\\FEA5_013#It's some kind of squid, and it doesn't look very friendly.",
+ "#FEA5\\FEA5_014#Jim! There's some kind of an aquatic creature down there.",
+ "#FEA5\\FEA5_015#Jim, that's ludicrous!",
+ "#FEA5\\FEA5_016#Jim, we've been friends a long time, but... I mean... you're not serious?",
+ "#FEA5\\FEA5_018#Jim, with our phasers not working, we may need that knife to protect ourselves!", // TYPO
+ "#FEA5\\FEA5_019#This planet is starting to get to me. I'm sure something just hit me.",
+ "#FEA5\\FEA5_020#You weren't a snake handler in your previous life were you? I don't like snakes.", // TYPO
+ "#FEA5\\FEA5_021#Good throw, Captain. However, I think the creature was merely startled. It may return in a little while.",
+ "#FEA5\\FEA5_022#I recommend caution here, Captain.",
+ "#FEA5\\FEA5_023#It appears that the leaves are slightly toxic. I would not recommend touching it for an extended amount of time, Captain.",
+ "#FEA5\\FEA5_024#It is some kind of mollusk; the river seems to be its home, and it is carnivorous, eating land and river based forms of life.",
+ "#FEA5\\FEA5_025#It would appear that the plant secretes a chemical that is a natural repellent to the creature. It has retreated far down stream, Captain.",
+ "#FEA5\\FEA5_026#Nothing unusual here, Captain.",
+ "#FEA5\\FEA5_027#Please stop that Captain. I have enough distractions from Dr. McCoy.",
+ "#FEA5\\FEA5_028#Still inoperative, Captain.",
+ "#FEA5\\FEA5_029#Thank you Captain, but Vulcans do not use knives.",
+ "#FEA5\\FEA5_030#The tricorder registers a lifeform, a large marine creature, lurking just below the surface of the water.",
+ "#FEA5\\FEA5_031#The tricorder shows nothing unusual, Captain. The creature is still down stream.",
+ "#FEA5\\FEA5_032#Was there a reason for that, Captain?",
+ "#FEA5\\FEA5_033#Captain, perhaps I should try to cross first.",
+ "#FEA5\\FEA5_034#I'll give it a try, Captain.",
+ "#FEA5\\FEA5_035#It looks like that plant fights back sir. You might want to use something to cut it loose.",
+ "#FEA5\\FEA5_036#Reminds me of a planet I was stationed on once. The native girls were real friendly. Ensign Shou had his bachelor party there, great time. You ever been to Omicron Draconis, Captain?",
+ "#FEA5\\FEA5_037#Sir, I finished second in my weight class in wrestling at the Academy, but I don't think that thing's in my weight class.",
+ "#FEA5\\FEA5_038#Sir, you dropped your rock.",
+ "#FEA5\\FEA5_039#Thanks Captain, but I can take care of myself. I finished second in my weight class in wrestling at the Academy. You keep the knife.",
+ "#FEA5\\FEA5_040#You're weird, sir.",
+ "#FEA5\\FEA5N000#A pair of eyes are all that you can see of the rest of this creature. Most of it is hidden beneath the murky water.",
+ "#FEA5\\FEA5N001#Captain Kirk is looking at the big creature in the water.",
+ "#FEA5\\FEA5N002#Dr. McCoy is looking at the big creature in the water.",
+ "#FEA5\\FEA5N003#He will not do that.",
+ "#FEA5\\FEA5N004#Lt. Stragey is looking at the big creature in the water.",
+ "#FEA5\\FEA5N005#Luminescent insects swarm near a large tree.",
+ "#FEA5\\FEA5N006#Mr. Spock is looking ahead to a cave opening on the other side of the log.",
+ "#FEA5\\FEA5N007#The log looks quite old but sturdy.",
+ "#FEA5\\FEA5N008#The plant is tough. You will need something sharp to cut it.",
+ "#FEA5\\FEA5N009#The river water is too muddy to get an idea of its depth or what may be beneath the surface.",
+ "#FEA5\\FEA5N010#The snake bites you.",
+ "#FEA5\\FEA5N011#The snake disapears beneath the surface of the water.",
+ "#FEA5\\FEA5N012#There is a slow muddy river blocking your path. A strong thick log serves as a footbridge. The river is unmoving, and the heat and stillness are oppressive.",
+ "#FEA5\\FEA5N013#There seems to be a lit cave beyond the log.",
+ "#FEA5\\FEA5N014#This plant has a rather thick stem and prickly leaves.", // TYPO
+ "#FEA5\\FEA5N015#You already have a piece of the plant.",
+
+
+ "#FEA6\\FEA6_001#I think I can get it with a few more blows.",
+ "#FEA6\\FEA6_002#Have you ever made it up the face of Half Dome, Lieutenant?",
+ "#FEA6\\FEA6_003#Perhaps we should hold onto that hope, Mr. Spock, that a civilised being will not kill for trivial motives.",
+ "#FEA6\\FEA6_004#Sometimes I feel like I'm the Captain of a nursery school.",
+ "#FEA6\\FEA6_005#That creature was quite real Mr. Spock. We will discuss this with our host, when we see him.",
+ "#FEA6\\FEA6_006#Then, gentlemen, I would advise you to stop arguing.",
+ "#FEA6\\FEA6_007#Unfortunately, human history is full of people who did not practice what they preached. Quetzecoatl is just one in a long line of them.",
+ "#FEA6\\FEA6_008#Will you two morons stop arguing just once!",
+ "#FEA6\\FEA6_009#Damn it Jim, I'm a surgeon not a geologist.",
+ "#FEA6\\FEA6_011#Everyone is healthy, Jim, there's no need for the medical kit here.",
+ "#FEA6\\FEA6_012#It would appear that our tentacled friend wants dessert. You can't go back that way, unless you enjoy being eaten.",
+ "#FEA6\\FEA6_013#I've lost any appetite I may have had for squid, Jim.", // TYPO
+ "#FEA6\\FEA6_014#Jim! Going back across that river would be insane.",
+ "#FEA6\\FEA6_015#Well, they're not organic. What did you think they were, calcified tribbles?",
+ "#FEA6\\FEA6_016#Captains and security officers. They don't realize how fragile the human body can be.",
+ "#FEA6\\FEA6_017#Well isn't this just great!", // TYPO
+ "#FEA6\\FEA6_018#Fascinating. These rocks are limestone, but contain an unusually high content of heavy metals. There are dilithium crystals here, but in a very raw form.",
+ "#FEA6\\FEA6_019#I fail to see any logic in that action, Captain. It may also cause stalactites to fall.", // TYPO
+ "#FEA6\\FEA6_020#I would suggest using something to pry that loose, Captain.",
+ "#FEA6\\FEA6_021#It is unwise to use a rock here, Captain.",
+ "#FEA6\\FEA6_022#My tricorder indicates unusual energy patterns in this direction, Captain.",
+ "#FEA6\\FEA6_023#Still inoperative, Captain.",
+ "#FEA6\\FEA6_024#The creature is still there, Captain.",
+ "#FEA6\\FEA6_025#These stalactites were made from limestone deposits. They took millennia to form.",
+ "#FEA6\\FEA6_026#These stalagmites were made from limestone deposits. They took millennia to form.",
+ "#FEA6\\FEA6_027#This appears to be a formation of raw dilithium crystals, Captain.",
+ "#FEA6\\FEA6_028#This illogical action would only dull the knife.",
+ "#FEA6\\FEA6_029#Agreed, Captain.",
+ "#FEA6\\FEA6_030#This whole experience feels like a test. The equivalent of 20th Century earth lab rats running through a maze.",
+ "#FEA6\\FEA6_031#I would wait until we meet him before judging him, Captain.",
+ "#FEA6\\FEA6_032#Captain, I cannot speak for Dr. McCoy, but my intelligence quotient is far higher than humans...",
+ "#FEA6\\FEA6_033#Doctor, I would point out that your voice could also trigger such a collapse.",
+ "#FEA6\\FEA6_034#I should warn you that the stalactites could collapse quite easily. Any sudden motion could cause large quantities of stalactites to fall on us.",
+ "#FEA6\\FEA6_035#I would suggest we continue on, Captain. It would not be logical to endanger ourselves by remaining here.",
+ "#FEA6\\FEA6_036#It would seem to be a prudent course of action Captain, if Doctor McCoy would agree.",
+ "#FEA6\\FEA6_037#Really? That's fascinating Captain.",
+ "#FEA6\\FEA6_038#There is a contradiction, Captain. If Quetzecoatl is really an entity of peace, then Lt. Stragey should not have died.",
+ "#FEA6\\FEA6_039#Captain, have we done something wrong?",
+ "#FEA6\\FEA6_040#I don't think I'll be able to get a good grip sir. You might try prying it loose.",
+ "#FEA6\\FEA6_041#If we ever get back to Earth, one hundred credits says I'll beat you.",
+ "#FEA6\\FEA6_042#Reminds me of some spelunking I did on Hades IV. Ever do any climbing, Captain?",
+ "#FEA6\\FEA6_043#Sure we do. That's the challenge.",
+ "#FEA6\\FEA6N000#A stalagtite breaks through and falls. You are mortally injured and die.", // TYPO
+ "#FEA6\\FEA6N001#An interesting, but useless, manuever.",
+ "#FEA6\\FEA6N002#As usual, Dr. McCoy looks annoyed by the mission. ",
+ "#FEA6\\FEA6N003#Darkness, leading into the unknown.",
+ "#FEA6\\FEA6N004#However, a strange force envelopes your body...",
+ "#FEA6\\FEA6N005#It is a large cluster of crystals.",
+ "#FEA6\\FEA6N006#It's Game Over man...",
+ "#FEA6\\FEA6N007#James Kirk remembers the last time he was in a cave, and is glad that this one seems more peaceful.",
+ "#FEA6\\FEA6N008#Lieutenant Stragey looks nervously at the stalactites hovering precariously above you.",
+ "#FEA6\\FEA6N009#Nothing happens.",
+ "#FEA6\\FEA6N010#Nothing happens.",
+ "#FEA6\\FEA6N011#Spock is his usual stoic self.",
+ "#FEA6\\FEA6N012#Stalactites descend from the ceiling.",
+ "#FEA6\\FEA6N013#Stalagmites rise from the floor of the cave.",
+ "#FEA6\\FEA6N014#They appear to be ordinary rocks. Spock's tricorder might say otherwise.",
+ "#FEA6\\FEA6N015#This is one place where dilithium crystals don't seem to be very useful.",
+ "#FEA6\\FEA6N016#This is the way that you entered the cave. If you leave this way, the tentacled creature that attacked you will probably try to get a second course for its dinner.", // TYPO
+ "#FEA6\\FEA6N017#You have one dilithium crystal, in raw form.",
+ "#FEA6\\FEA6N020#You will need something to pry it loose.",
+ "#FEA6\\FEA6N028#You manage to pry loose one dilithium crystal.",
+ "#FEA6\\FEA6N029#You scratch your initials. No dilithium crystals were found.",
+
+
+ "#FEA7\\FEA7_001#Scotty, five to beam up.",
+ "#FEA7\\FEA7_002#Scotty, four to beam up.",
+ "#FEA7\\FEA7_003#You've got to do it, Bones! If the Klingons realize he's no longer a threat to them, perhaps we can avoid a war!",
+ "#FEA7\\FEA7_004#Absolutely. Your best intentions were changed by the imperfect humans that you left in charge after you departed. Such is the way of our race, I'm afraid.",
+ "#FEA7\\FEA7_005#I've had it up to here with so-called superior beings terrorizing my crew because we're so 'primitive'. Maybe you should see how primitive you are before you go around testing others.",
+ "#FEA7\\FEA7_006#One thing first. If you're so peaceful, how come the Aztecs were so violent and agressive?",
+ "#FEA7\\FEA7_007#The Federation is not in the business of lying, mister.",
+ "#FEA7\\FEA7_008#We're a technologically advanced starfaring race, what do you think? That we wouldn't have made progress in medicine?",
+ "#FEA7\\FEA7_009#With Dr. McCoy, I sometimes wonder, but yes, I would say we have made considerable advances.",
+ "#FEA7\\FEA7_010#Yes, I guess we do. Go on.",
+ "#FEA7\\FEA7_011#Yes, why do you ask?",
+ "#FEA7\\FEA7_012#You messed up in a big way. Perhaps you should try following the Prime Directive. It changed our lives.",
+ "#FEA7\\FEA7_013#Jim, I'll try, but the physiology is completely alien...",
+ "#FEA7\\FEA7_014#You show great wisdom, sir. But your statement implies that you wish to change your condition.",
+ "#FEA7\\FEA7_015#At the top of my spine is a gland not found in your species. This is the seat of my power. I wish you to remove it, thereby making me a mortal.",
+ "#FEA7\\FEA7_016#First, I have one question...",
+ "#FEA7\\FEA7_017#I am sorry you had to go through this ordeal. It was not meant for you to die.",
+ "#FEA7\\FEA7_018#I sense truth in this. Perhaps this is what happened to my children on the Klingon world of Hrakkour, which would explain why they are searching for me. I have clearly abused the power that was given me long ago.",
+ "#FEA7\\FEA7_019#I tried to teach them the concept of self-sacrifice. It would appear they did not completely understand my teachings.",
+ "#FEA7\\FEA7_020#I was not aware you had been tested before. My apologies.",
+ "#FEA7\\FEA7_021#I was particularly impressed by the sacrifice made by Lt. Stragey. Of course, I gave him back his life. He is now safely aboard your vessel.",
+ "#FEA7\\FEA7_022#I watched as you worked through the problems I set in your path. you are a valiant, intelligent species.",
+ "#FEA7\\FEA7_023#I would have been more impressed had you found a less violent solution. My children are dear to me. Even so, few choices remain to me.",
+ "#FEA7\\FEA7_024#Indeed. If my mission of peace was overthrown, then I am no longer worthy of my power. Tell me, has your species made progress in the medical arts?",
+ "#FEA7\\FEA7_025#Of course, how foolish of me. Still, there are cultures where medical knowledge is considered a sign of weakness. Warrior cultures, where nothing matters but physical strength. Survival of the foolish.",
+ "#FEA7\\FEA7_026#Ours is an intensely curious race, Captain. My brothers and I have raised children on a thousand worlds, loved them, watched them grow, only to see them become separated from us by the passage of time. It is sad and lonely process, one which I shall not repeat again. I am no longer worthy of my gift.",
+ "#FEA7\\FEA7_027#Please sit down. We have much to discuss.",
+ "#FEA7\\FEA7_028#Then I shall ask to make use of your advances.",
+ "#FEA7\\FEA7_029#You are clearly not the liars I thought you to be. Were you telling me the truth about my disciples? That they became ruthless savages?",
+ "#FEA7\\FEA7_030#Your harshness is unwarranted, but I sense truth in this. Perhaps this is what happened to my children on the Klingon world of Hrakkour, which would explain why they are searching for me. I have clearly abused the power that was given me long ago.",
+
+
+ "#TRI0\\TRI0_001#I want your word of honor, Vlict, that Quetzecoatl will not be harmed while we take these tests.",
+ "#TRI0\\TRI0_002#I've faced Klingons, both in personal and ship-to-ship combat. Your own records will confirm this. If I'm not worthy of their honors, why didn't they kill me?",
+ "#TRI0\\TRI0_003#Then the Klingon Empire is wrong.",
+ "#TRI0\\TRI0_004#Those are serious charges, Vlict. Should he not be tried by a Klingon High Court?",
+ "#TRI0\\TRI0_006#By our standards, he would rank among the greatest heroes of the Federation: Gandhi, Surak, M'lelto-jhi, Shanarda. We will not abandon him.",
+ "#TRI0\\TRI0_007#Ensign!",
+ "#TRI0\\TRI0_008#Fine. Can we get this over with? I've got shore leave scheduled on Ryza next week.",
+ "#TRI0\\TRI0_009#Give me an opportunity. If I succeed, Quetzecoatl goes free.",
+ "#TRI0\\TRI0_010#Guess I can't argue with you. Pleasant conquests, admiral.",
+ "#TRI0\\TRI0_011#I'm a warrior, Vlict! I hereby intervene for him and demand the honors and responsibilities of a warrior's trial!",
+ "#TRI0\\TRI0_013#I'm James T. Kirk. I'm more worthy than you'll ever be, and I have girlfriends on fifty planets who will vouch for that!",
+ "#TRI0\\TRI0_014#If it means that I can prevent you from murdering an ancient and blameless creature, yes. And I'm prepared to back it up.",
+ "#TRI0\\TRI0_015#Oh well. I'm afraid you're on your own, Quetzecoatl.",
+ "#TRI0\\TRI0_016#Stick around, Vlict. There are more surprises awaiting you.",
+ "#TRI0\\TRI0_017#Then a Klingon can thrive on the conflict between his inner nature and his philosophy. Clearly, the people of Hrakkour did that.",
+ "#TRI0\\TRI0_018#Then this trial is a mockery for the entire galaxy to see!",
+ "#TRI0\\TRI0_019#There's nothing less appealing than a gloating Klingon, Vlict. Let's get this trial under way.",
+ "#TRI0\\TRI0_020#This is a matter for a philosophical debate, not a trial! The state has no right to interfere in a person's conscience.",
+ "#TRI0\\TRI0_021#Why does every Klingon tell me they expected to meet me in battle? You really have a one-track mind!",
+ "#TRI0\\TRI0_022#You will act with the discipline of a Federation officer, Ensign, or you will return to the Enterprise. Do I make myself clear?",
+ "#TRI0\\TRI0_023#You're going to kill this old man because he encouraged non-violence? The Federation cannot accept this.",
+ "#TRI0\\TRI0_024#Any hostile action here may result in the destruction of the Enterprise.",
+ "#TRI0\\TRI0_025#Captain, I estimate the odds of this court acquitting Quetzecoatl at 0.086 percent.",
+ "#TRI0\\TRI0_026#Captain, may I remind you that we are deep in Klingon space? If we attack them here, they may respond by destroying the Enterprise.",
+ "#TRI0\\TRI0_027#Damn it Jim, I'm a doctor not a arbitrator.",
+ "#TRI0\\TRI0_028#Damn it, Jim! I use my hands to save lives not take them.",
+ "#TRI0\\TRI0_029#He's still weak from the operation.",
+ "#TRI0\\TRI0_030#One healthy adult klingon male.",
+ "#TRI0\\TRI0_031#I've got nothing to say to you, Jim.",
+ "#TRI0\\TRI0_034#Nobody needs healing, Jim, but you will if they harm my patient.",
+ "#TRI0\\TRI0_035#Nothing of interest.",
+ "#TRI0\\TRI0_036#Don't be a fool, Jim! We can't risk the Enterprise! We've already signed one person's death warrant!", // TYPO
+ "#TRI0\\TRI0_037#Low level radiation, within safety limits. But you wouldn't want to spend more than a few days here.",
+ "#TRI0\\TRI0_038#Nothing of interest.",
+ "#TRI0\\TRI0_039#Children should not even play at war. To prepare them to kill is barbaric.",
+ "#TRI0\\TRI0_040#I have failed. Death is what I deserve.",
+ "#TRI0\\TRI0_041#I offered them insights into the philosophy of peace and cooperation. They chose to follow it of their own free will.",
+ "#TRI0\\TRI0_042#I'm frightened, Captain, but if I am to die, then I shall die well.",
+ "#TRI0\\TRI0_043#A Federation officer, claiming the rights of a Klingon warrior? How dare you insult me, Kirk!",
+ "#TRI0\\TRI0_044#As for you Kirk, I expected a more forceful response. I had heard you were a worthy opponent. Instead, I see a cringing coward. Leave this place, Kirk. You dishonor it.",
+ "#TRI0\\TRI0_045#Ha! Ha! You have never encountered Klingon women, Captain. But that was the response of a true warrior. You have earned my respect. I shall give you and your companions a chance to defend the traitor.",
+ "#TRI0\\TRI0_046#He has admitted guilt. You have surrendered him to Klingon law. Can you deny that this was a fair trial?",
+ "#TRI0\\TRI0_047#He has not demonstrated honor, Kirk! Only a proven warrior may be tried in High Court! Principles of honor are not applicable to his defense!",
+ "#TRI0\\TRI0_048#How typical of the Federation, to judge every other species as morally inferior. Your rhetoric is not welcome here!",
+ "#TRI0\\TRI0_049#I hereby sentence K'etz'coatl to a coward's death.",
+ "#TRI0\\TRI0_050#K'etz'koatl, you encouraged the colony to destroy its weapons. You even encouraged them to hold their children from our traditional military ceremonies.",
+ "#TRI0\\TRI0_051#Only the greatest warriors of old could say such a thing and expect to live! Do you think yourself worthy enough to walk in their footsteps?",
+ "#TRI0\\TRI0_052#Pacifism is utterly alien to our people. It would be as though he preached a doctrine of suicide in direct contradiction of the will to live. Honorable men thrive in war and conflict -- cowards seek to avoid conflict.",
+ "#TRI0\\TRI0_053#So Kirk, we finally meet. I had thought it would be in battle, but the universe holds many surprises.",
+ "#TRI0\\TRI0_054#So be it. This begins the trial of the entity K'etz'koatl, who is charged with impersonating a klingon, stirring dissent, encouraging cowardice, and treason in the highest degree.",
+ "#TRI0\\TRI0_055#Stories of your impudence are not exaggerated. You shall have your chance. It is a pity we will not meet again, Captain.",
+ "#TRI0\\TRI0_056#That oversight, Kirk, is easily rectified.",
+ "#TRI0\\TRI0_057#The Klingon Empire will not tolerate dissent.",
+ "#TRI0\\TRI0_058#The prisoner and his witnesses will stand forth, so the trial may begin!",
+ "#TRI0\\TRI0_059#To counsel it is to counsel cowardice. To counsel it is to abandon all honor! This is treason, for all to see! The penalty for treason in this system is death! Do you accept your sentence?",
+ "#TRI0\\TRI0_060#Very well. You have my word. Captain Kallarax, transport them to the Test of Life.",
+ "#TRI0\\TRI0_061#You and your three companions may face the tests that we set for the defender. Then we shall see if you are as worthy as a Klingon!",
+ "#TRI0\\TRI0_062#You will not speak unless the court requests it, Kirk!",
+ "#TRI0\\TRI0_063#Awaiting your orders, sir!",
+ "#TRI0\\TRI0_064#But I did, sir. Lieutenant Hildebrandt is a third dan in karate. Toughest fighter I've ever known...",
+ "#TRI0\\TRI0_065#Who are you calling a weakling? I've had tougher girlfriends than you, pal!",
+ "#TRI0\\TRI0_066#Yes sir.",
+ "#TRI0\\TRI0_F24#How amusing. Federation weaklings.",
+ "#TRI0\\TRI0N000#A Klingon guard. A big Klingon guard. A big Klingon guard with his disruptor ready to fire on anyone who gives him trouble.",
+ "#TRI0\\TRI0N001#Admiral Vlict, commander of the Klingon flagship K'lirta.",
+ "#TRI0\\TRI0N002#Dr. McCoy glares angrily at Kirk. It is obvious he does not like seeing his patient handed over to the Klingons.",
+ "#TRI0\\TRI0N003#Ensign Bennie stares around the Klingon court, distrusting everything he sees.",
+ "#TRI0\\TRI0N004#James T. Kirk, trapped in a situation he cannot win, forced to watch a travesty of justice... or is he?",
+ "#TRI0\\TRI0N005#Mr. Spock looks stoically at the klingon bench. Expecting to win this case would be illogical.",
+ "#TRI0\\TRI0N006#This bench is marked with the symbol of the Klingon Court of High Justice, the two Triangles of Words and Blood, linked together.",
+ "#TRI0\\TRI0N007#This city was destroyed by heavy bombardment and intense doses of neutrino rays that killed all known forms of life on this planet.",
+ "#TRI0\\TRI0N008#This is the famous seal of the Klingon Empire.",
+ "#TRI0\\TRI0N009#Your new found friend looks rather frightened right now, and you don't blame him.",
+ "#TRI0\\TRI0U075#Uhura here. Captain, there's a force field over the planet. We will not be able to beam you aboard.",
+
+
+ "#TRI1\\TRI1_002#Affirmative, Uhura.",
+ "#TRI1\\TRI1_003#Affirmative.",
+ "#TRI1\\TRI1_004#Beam us to Vlict's position.",
+ "#TRI1\\TRI1_005#Beam us back to the Enterprise. Kirk out.",
+ "#TRI1\\TRI1_006#I want that door open.",
+ "#TRI1\\TRI1_007#I somehow doubt that Vlict intends for us to survive this, whatever the outcome. We're the only thing that stands between him and the killing of Quetzecoatl that he can justify.",
+ "#TRI1\\TRI1_008#Negative. Transmit the door entry code only.",
+ "#TRI1\\TRI1_009#Negative.",
+ "#TRI1\\TRI1_010#That's not true, Ensign. However, I suspect that Vlict's attack on Hrakkour exceeded his orders. He needs Quetzecoatl as a scapegoat, and he needs a fair trial to avoid an inquiry of his own actions.",
+ "#TRI1\\TRI1_011#Uhura, prepare to receive a tricorder message. There is a door with an entry coder here; try to analyze the circuits and let the main computer crack the code.",
+ "#TRI1\\TRI1_012#This creature is composed of electrical fields. I would not recommend approaching it. A metal projectile might disrupt its fields and render it harmless.",
+ "#TRI1\\TRI1_013#A Klingon entry door, slightly antiquated.",
+ "#TRI1\\TRI1_014#An entry coder for the door, keyed to a number sequence. The tricorder is unable to determine the code, but can scan the mechanism.",
+ "#TRI1\\TRI1_015#Captain, I would strongly recommend against disturbing the rod. It could result in awakening the creature or possibly electrocuting you.",
+ "#TRI1\\TRI1_016#Do you know what ten million volts can do to a man? It can ruin his whole damn day.",
+ "#TRI1\\TRI1_017#Does not register as a known life form.",
+ "#TRI1\\TRI1_018#Find someone else to be a volunteer. I've retired.",
+ "#TRI1\\TRI1_019#How could you do it, Jim? I spent hours trying to save his life, and you just gave him away in seconds to the Klingons!",
+ "#TRI1\\TRI1_020#I don't know the code.",
+ "#TRI1\\TRI1_021#Jim! Are you mad? that's our only way out!",
+ "#TRI1\\TRI1_022#One Male Human, average physical condition.",
+ "#TRI1\\TRI1_023#He's a Male Human, excellent physical condition.",
+ "#TRI1\\TRI1_024#Male Human, good physical condition.",
+ "#TRI1\\TRI1_025#One male Human-Vulcan hybrid. Excellent physical condition.", // TYPO
+ "#TRI1\\TRI1_026#Nobody needs healing, Jim, but you will if they harm my patient.",
+ "#TRI1\\TRI1_027#Ouch!",
+ "#TRI1\\TRI1_029#This is not in my field of expertise.",
+ "#TRI1\\TRI1_030#This is not in my field of expertise.",
+ "#TRI1\\TRI1_031#What the blazes do you want me to do on a rock?",
+ "#TRI1\\TRI1_032#A test of courage? That is the Klingon way.",
+ "#TRI1\\TRI1_033#I'll bet it'll be mad.",
+ "#TRI1\\TRI1_034#Shut up Spock!",
+ "#TRI1\\TRI1_035#I do not understand the desired course of action.",
+ "#TRI1\\TRI1_036#If you will observe the position of the creature, Captain, I think that you will find that it prevents access to the keypad.",
+ "#TRI1\\TRI1_037#Ouch!",
+ "#TRI1\\TRI1_038#The door is already open Captain.",
+ "#TRI1\\TRI1_039#The odds of surviving contact with the creature are too small to calculate.",
+ "#TRI1\\TRI1_040#There is a high probability that shooting the door would be hasardous to our wellbeing.",
+ "#TRI1\\TRI1_041#These wooden rods are support beams that were not placed.",
+ "#TRI1\\TRI1_042#This rock has a high iron content.",
+ "#TRI1\\TRI1_043#This wall was carved from the natural rock.",
+ "#TRI1\\TRI1_044#We do not know the code, Captain.",
+ "#TRI1\\TRI1_045#As I suspected, Captain. The creature is in stasis. It should awaken in 3.48 days.",
+ "#TRI1\\TRI1_046#Captain, I have calculated the odds of surviving this at...",
+ "#TRI1\\TRI1_047#Not much is known about Hrakkour, Ensign. This would appear to be some sort of a mining installation; that creature might be a native lifeform.",
+ "#TRI1\\TRI1_048#Captain, my instructor at the Academy always told me that if you don't know what you're going to do with your phaser, you shouldn't draw it.", // TYPO
+ "#TRI1\\TRI1_049#Do you want me to arrest it, interrogate it, or beat it up, Captain?",
+ "#TRI1\\TRI1_050#I refuse, Captain, on the grounds that it might eliminate me.",
+ "#TRI1\\TRI1_051#I refuse, Captain, on the grounds that it might eliminate me.",
+ "#TRI1\\TRI1_052#Ouch!",
+ "#TRI1\\TRI1_053#You handled those Klingons well, sir. We've got them on the run now.",
+ "#TRI1\\TRI1_054#You want me to smash it? But that's our only way out of here.",
+ "#TRI1\\TRI1_055#And our deaths will be the only way he can get it. Great.",
+ "#TRI1\\TRI1_056#What is this place?",
+ "#TRI1\\TRI1_057#Why should he worry about justification, Captain? He's a Klingon. Murder is as natural to them as breathing!",
+ "#TRI1\\TRI1_J00#Why do I have the feeling that I'm about to have a bad day?",
+ "#TRI1\\TRI1N000#A field of static lightning. It seems to be moving in a purposeful manner.",
+ "#TRI1\\TRI1N001#A slightly antiquated Klingon door, opened by a keycode entry.",
+ "#TRI1\\TRI1N002#A slightly antiquated Klingon lock-mechanism.",
+ "#TRI1\\TRI1N003#James T. Kirk, hero of the galaxy!",
+ "#TRI1\\TRI1N004#No effect.",
+ "#TRI1\\TRI1N005#No effect.",
+ "#TRI1\\TRI1N006#The floor is incomplete, made of unrefined, natural rock.",
+ "#TRI1\\TRI1N007#The melted rock is cooling, but still remains in a molten state.",
+ "#TRI1\\TRI1N008#The wall is resistant to phaser fire.",
+ "#TRI1\\TRI1N009#These wooden rods are support beams that were not placed.",
+ "#TRI1\\TRI1N011#This section of wall was carved by some sort of plasma field.",
+ "#TRI1\\TRI1N012#You burn one of the rods.",
+ "#TRI1\\TRI1N013#You coat the rod with molten iron. It hardens quickly.",
+ "#TRI1\\TRI1N014#You melt some of the rock.",
+ "#TRI1\\TRI1N015#Your ever dependable crewman, Ensign Bennie.",
+ "#TRI1\\TRI1N016#Your ever emotional friend, Dr. McCoy.",
+ "#TRI1\\TRI1N017#Your ever logical friend, Spock.",
+ "#TRI1\\TRI1U068#Nothing else to report Captain.",
+ "#TRI1\\TRI1U079#Affirmative sir. We will transmit code when you activate the keycode. Uhura out.",
+ "#TRI1\\TRI1U080#Affirmative, sir.",
+ "#TRI1\\TRI1U086#Captain, there is a force field between us and the planet.",
+ "#TRI1\\TRI1U090#Do you wish to be beamed up now Captain?",
+ "#TRI1\\TRI1U095#Good luck, Captain.",
+ "#TRI1\\TRI1U098#Keep us informed, we'll help you all we can. We can analyze any data you gather through the main computer.",
+ "#TRI1\\TRI1U101#Scan complete. Main computer has the code. We also read an anomaly. Something else has tapped into the keycode. Shall I analyze?",
+ "#TRI1\\TRI1U102#Sir, we have a secondary code that is nested in the Klingon program. Computer is unable to analyze its function. Shall we broadcast it to you when you activate the keypad?",
+ "#TRI1\\TRI1U106#We have your position at approximately thirty meters beneath the surface of Hrakkour, in what appears to be the ruins of an archeological dig.",
+ "Zzzt! Sptttz! Zzzt! Tttt!",
+ "Clunk.",
+
+
+ "#SFX\\QUIET#Zzzzzzzzzzzmmmm.",
+ "#TRI2\\TRI2_001#This reminds me of an old practical joke that Finnegan played on me back at the Academy.",
+ "#TRI2\\TRI2_002#...some kind of energy source a few meters from our position. We know.",
+ "#TRI2\\TRI2_003#Beam us back to the Enterprise. Kirk out.",
+ "#TRI2\\TRI2_004#Beam us to Vlict's position.",
+ "#TRI2\\TRI2_005#I don't know, Ensign.",
+ "#TRI2\\TRI2_006#Keep working on it, but don't try to beam us up unless I give the signal.",
+ "#TRI2\\TRI2_007#Negative.",
+ "#TRI2\\TRI2_008#Whatever it is, we have to find a way to get by it.",
+ "#TRI2\\TRI2_009#Extreme increase in energy level, Captain. It absorbed the phaser fire. An unexpected reaction is occuring, high levels of lethal radiation are being produced.",
+ "#TRI2\\TRI2_010#Do you want me to hit my head against it?",
+ "#TRI2\\TRI2_011#It does not register as a life form.",
+ "#TRI2\\TRI2_012#I'm not touching some damned ball of energy!",
+ "#TRI2\\TRI2_013#If you hadn't been so damned anxious to give my patient to the Klingons, we wouldn't be in this mess.",
+ "#TRI2\\TRI2_014#One Male Human, average physical condition.",
+ "#TRI2\\TRI2_015#He's a male Human, excellent physical condition.", // TYPO
+ "#TRI2\\TRI2_016#Male Human, good physical condition.",
+ "#TRI2\\TRI2_017#One male Human-Vulcan hybrid. Excellent physical condition.", // TYPO
+ "#TRI2\\TRI2_018#Nobody needs healing, Jim, but you will if they harm my patient.",
+ "#TRI2\\TRI2_019#Fascinating. It would appear that Vlict sent us into this place in the hope that we would be killed.",
+ "#TRI2\\TRI2_020#Fascinating. These automatons are not stable.",
+ "#TRI2\\TRI2_021#Fascinating. These automatons are not stable.",
+ "#TRI2\\TRI2_022#I do not understand the desired course of action.",
+ "#TRI2\\TRI2_023#Marked increase in energy level, Captain. It absorbed the phaser fire. No appreciable increase in mass.",
+ "#TRI2\\TRI2_024#The automaton is emitting a protective force field, Captain. We cannot proceed further without rendering it inoperative.",
+ "#TRI2\\TRI2_025#The automaton's energy level has increased slightly. It absorbed the phaser fire. No appreciable increase in mass.",
+ "#TRI2\\TRI2_026#The ball of energy is an automaton, Captain. It is an artificial construct, programmed to block any movements; I can detect no other function or intelligence.",
+ "#TRI2\\TRI2_027#These walls were carved from the natural rock of the cavern.",
+ "#TRI2\\TRI2_028#This automaton is generating a force field, Captain. I am physically incapable of touching it.",
+ "#TRI2\\TRI2_029#This wall was carved from the natural rock of a cavern.",
+ "#TRI2\\TRI2_030#I believe Ensign, that this energy sphere is some sort of automaton, programmed to block our movements.",
+ "#TRI2\\TRI2_031#I refuse, Captain, on the grounds that it might incinerate me.",
+ "#TRI2\\TRI2_032#Uh, pardon sir?",
+ "#TRI2\\TRI2_033#We're not going to get out of this alive, are we Captain?",
+ "#TRI2\\TRI2_034#Captain, what is that thing?",
+ "#TRI2\\TRI2_F11#This automaton is generating a force field, Captain. I am physically incapable of touching it.",
+ "#TRI2\\TRI2N000#A pulsing globe of energy.",
+ "#TRI2\\TRI2N001#Commander Spock, a patient and thoughtful Federation first officer.",
+ "#TRI2\\TRI2N002#Ensign Bennie, faithful and true security officer.",
+ "#TRI2\\TRI2N003#James T. Kirk, a rather frustated Federation starship captain.",
+ "#TRI2\\TRI2N004#Klingon insignia.",
+ "#TRI2\\TRI2N005#Leads back to the room where the Electrical creature was.",
+ "#TRI2\\TRI2N006#Leonard McCoy, a crusty country doctor, and Starfleet's finest surgeon.",
+ "#TRI2\\TRI2N007#Rock wall. Looks like it was carved from stone by Klingon heavy mining equipment.",
+ "#TRI2\\TRI2N008#The walls are resistant to phaser fire.",
+ "#TRI2\\TRI2U074#Please keep in contact with us. We'll keep you informed if further developments occur. Uhura out.",
+ "#TRI2\\TRI2U081#By the way, sensors indicate...",
+ "#TRI2\\TRI2U087#Captain, there is still a barrier between us and the planet. Mr. Scott thinks there might be a way to break through it, and he's working on it now, but the Klingons won't like it.",
+ "#TRI2\\TRI2U091#Do you wish to be beamed up now Captain?",
+ "#TRI2\\TRI2U104#Understood, Captain.",
+
+
+ "#TRI3\\TRI3_001#This is too easy. I don't like it.",
+ "#TRI3\\TRI3_002#Beam us directly to the Enterprise.",
+ "#TRI3\\TRI3_003#Beam us directly to Vlict's position.",
+ "#TRI3\\TRI3_004#Deaths, Bones. Our deaths.",
+ "#TRI3\\TRI3_005#I don't like it. This was too easy.",
+ "#TRI3\\TRI3_006#We'll call you if we want to transport. Kirk out.",
+ "#TRI3\\TRI3_007#We're fine, lieutenant.",
+ "#TRI3\\TRI3_008#Captain, Starfleet protocol requires that the commanding officer lead in hazardous situations.",
+ "#TRI3\\TRI3_009#Approximately thirty Klingons, within 500 meters of the opening, no closer than 200 meters.",
+ "#TRI3\\TRI3_010#Damn it Jim, I'm a Doctor, not a structural Engineer!",
+ "#TRI3\\TRI3_011#He's out like a light, Jim. There are hibernating Arcturian sloth-tigers that will get up more quickly than this guy.",
+ "#TRI3\\TRI3_012#I believe that you have seniority, Jim.",
+ "#TRI3\\TRI3_013#One Male Human, average physical condition.", // TYPO
+ "#TRI3\\TRI3_014#He's a Male Human, excellent physical condition.", // TYPO
+ "#TRI3\\TRI3_015#Male Human, good physical condition.", // TYPO
+ "#TRI3\\TRI3_016#One Male Human-Vulcan hybrid. Excellent physical condition.", // TYPO
+ "#TRI3\\TRI3_017#Nobody needs healing, Jim, but you will if they harm my patient.",
+ "#TRI3\\TRI3_018#Well, maybe I've been too hard on you, Jim. I'm sorry.",
+ "#TRI3\\TRI3_019#Easy! Are you out of your mind?",
+ "#TRI3\\TRI3_020#Electrical monsters, things that explode when you phaser them, what else does he want?",
+ "#TRI3\\TRI3_021#I do not understand the desired course of action.",
+ "#TRI3\\TRI3_022#I recommend caution, Captain.",
+ "#TRI3\\TRI3_023#Reading a high energy build-up; there is a Klingon explosive device present five point three meters outside the cavern! It could be detonated at any moment!",
+ "#TRI3\\TRI3_024#This wall was carved from the natural rock of a cavern.",
+ "#TRI3\\TRI3_025#Admiral Vlict has a reputation for thoroughness, Doctor. If he means to kill us, we can expect more than we've encountered.",
+ "#TRI3\\TRI3_026#How hard do you want me to hit it, sir.",
+ "#TRI3\\TRI3_027#No sir. I insist that you have the honor of leading us to victory.",
+ "#TRI3\\TRI3_028#What are waiting for, sir? Shouldn't we just get out of here?",
+ "#TRI3\\TRI3_029#When I get out of this, I am going to have the best shore leave in Starfleet history!",
+ "#TRI3\\TRI3_030#Daylight! We're almost there! We've beaten them!",
+ "#TRI3\\TRI3_103#Beam us back to the Enterprise. Kirk out.",
+ "#TRI3\\TRI3_104#Beam us to Vlict's position.",
+ "#TRI3\\TRI3_107#Negative.",
+ "#TRI3\\TRI3N000#Captain James Tiberius Kirk, deep in thought.",
+ "#TRI3\\TRI3N001#Doctor Leonard McCoy, a rather disgruntled surgeon.",
+ "#TRI3\\TRI3N002#Ensign Bennie, who wishes that he was back at the Academy right now...",
+ "#TRI3\\TRI3N003#No gunslinging allowed, space cowboy.",
+ "#TRI3\\TRI3N004#Spock, one of the foremost science officers in Starfleet.",
+ "#TRI3\\TRI3N005#The exit to this particular complex. You hope.",
+ "#TRI3\\TRI3N006#The wall is resistant to phaser fire.",
+ "#TRI3\\TRI3N007#The wall of this corridor.",
+ "#TRI3\\TRI3U067#Captain, we're still working on breaching the force field. We will let you know when we're ready to beam you out.",
+ "#TRI3\\TRI3U080#Affirmative, sir.",
+ "#TRI3\\TRI3U084#Captain, our sensors have picked up phaser fire! Are you all right? Captain, please come in!", // TYPO
+ "#TRI3\\TRI3U089#Do you wish to be beamed up now Captain?",
+ "#TRI3\\TRI3U099#Mr. Scott has found a way to breach the force field!",
+
+
+ "#TRI4\\TRI4_001#Admiral, one day the weaklings are going to surprise the Hell out of you.",
+ "#TRI4\\TRI4_002#Do Klingons believe in ghosts?",
+ "#TRI4\\TRI4_003#I don't want it to end like this.", // TYPO
+ "#TRI4\\TRI4_004#I don't really give a damn.",
+ "#TRI4\\TRI4_005#I won't let you. I chal...",
+ "#TRI4\\TRI4_006#I'm sorry we couldn't do more.",
+ "#TRI4\\TRI4_007#I'm sorry we couldn't do more.",
+ "#TRI4\\TRI4_008#Justice?",
+ "#TRI4\\TRI4_009#Maybe you aren't as good as you think you are.",
+ "#TRI4\\TRI4_010#No it isn't.",
+ "#TRI4\\TRI4_011#Nothing you have done has been honorable, Vlict! One day, everyone in the Klingon empire will know it too. Perhaps one day even you will realize it.",
+ "#TRI4\\TRI4_012#Scotty, beam us up.",
+ "#TRI4\\TRI4_013#Then you admit that it was you, and not Quetzecoatl who was responsible for the death of Hrakkour.",
+ "#TRI4\\TRI4_014#Then you admit this trial is a sham! A charade!",
+ "#TRI4\\TRI4_015#Then you will not object to presenting the orders from the Klingon Council authorizing mass murder on Hrakkour.",
+ "#TRI4\\TRI4_016#We beat you, Vlict. Unless you free Quetzecoatl, you will lose your honor!",
+ "#TRI4\\TRI4_017#What!",
+ "#TRI4\\TRI4_018#As we say on Earth, Vlict, nature beat me to it.",
+ "#TRI4\\TRI4_019#Did you listen to anything he said? One day, in spite of people like you, the Klingons will know peace. I hope I live to see that day.",
+ "#TRI4\\TRI4_020#Farewell my friend. Vlict, if you respect honor, you will make it quick and painless.", // TYPO
+ "#TRI4\\TRI4_021#He knows more about courage than you or your Empire will ever know.",
+ "#TRI4\\TRI4_022#Honor? Give me a break, Vlict! You were trying to kill us!",
+ "#TRI4\\TRI4_023#How can a liar like you even say the word \"honor\" without blushing?",
+ "#TRI4\\TRI4_024#How can you call him a traitor without giving him a fair trial!", // TYPO
+ "#TRI4\\TRI4_025#I do not know if you are a praying man, Vlict. If I were you, I would not want to meet me again.",
+ "#TRI4\\TRI4_026#If you kill him, the Empire will learn that you betrayed them by destroying Hrakkour.",
+ "#TRI4\\TRI4_027#Isn't it time that we stopped playing games, Vlict?",
+ "#TRI4\\TRI4_028#Shut up Vlict.",
+ "#TRI4\\TRI4_029#Then you have my deepest respect. I am sorry I cannot do more for you.",
+ "#TRI4\\TRI4_030#There's a time to fight for what you believe, and a time to die for it. I hope you chose the right time, Quetzecoatl.",
+ "#TRI4\\TRI4_031#Vlict is right, Quetzecoatl. This is suicide. It is a cowardly action.",
+ "#TRI4\\TRI4_032#You didn't say I wasn't allowed to use my ship's computer. If you didn't explain the rules clearly, whose fault is that?",
+ "#TRI4\\TRI4_033#You don't lie very well, do you?",
+ "#TRI4\\TRI4_034#You lost, Vlict. I beat your test. Release Quetzecoatl and let us go!",
+ "#TRI4\\TRI4_036#Jim! You can't let him do this!",
+ "#TRI4\\TRI4_037#You never had any intention of letting Quetzecoatl live!",
+ "#TRI4\\TRI4_038#He is correct, Captain.",
+ "#TRI4\\TRI4_039#I believe that the use of guile, to do what the enemy does not expect, is considered very honorable by the Klingons.", // TYPO
+ "#TRI4\\TRI4_040#As do I. My only regret is that I did not get to know you better. If only a part of what you are is because you learned from the mistakes of my acolytes, my work was not in vain.",
+ "#TRI4\\TRI4_041#But before I die, I believe that Klingon law allows me to make a public statement.",
+ "#TRI4\\TRI4_042#Captain, I do not see any successful resolution to this, except with my death. Dying to prevent conflict would give it meaning.",
+ "#TRI4\\TRI4_043#Captain, I taught others self-sacrifice. Now I must practice what I preached. It is the only way to atone for my crimes.",
+ "#TRI4\\TRI4_044#Captain, I thank you for your efforts on my behalf, but it is over.",
+ "#TRI4\\TRI4_045#Captain, I thank you for your efforts on my behalf, but it is over.",
+ "#TRI4\\TRI4_046#Captain, I thank you for your efforts on my behalf, but it is over.",
+ "#TRI4\\TRI4_047#I know Captain. But it's better this way.",
+ "#TRI4\\TRI4_048#I know Captain.",
+ "#TRI4\\TRI4_049#I know, Captain.",
+ "#TRI4\\TRI4_050#I, who was once immortal, know that truth is the only true immortal. You can kill people, cultures, even gods, but the truth will always survive.",
+ "#TRI4\\TRI4_051#Intelligent beings are not meant to be caged, either by tyranny, or barbarism. Those who try doom themselves to failure.",
+ "#TRI4\\TRI4_052#No captain. Let there be an end to this violence. I will not allow any more blood to be shed, save my own. I taught the doctrine of self-sacrifice, and I shall die of it.",
+ "#TRI4\\TRI4_053#Once a culture has tasted peace, it will not desire anything else, because peace is better than war, love is better than hate, and creation is better than destruction. This is Truth.",
+ "#TRI4\\TRI4_054#A coward's attitude. He shames this soil.",
+ "#TRI4\\TRI4_055#As judge, I determine what is fair and what is unfair, Kirk! The trial is at an end. The verdict is guilty.",
+ "#TRI4\\TRI4_056#As long as the Federation continues to foster such weaklings, the triumph of the Klingon Empire is assured.",
+ "#TRI4\\TRI4_057#Do not threaten me, Kirk! If you expect the Empire to believe you instead of me, you are greatly mistaken.", // TYPO
+ "#TRI4\\TRI4_058#Do you think that you can make a fool of me, Kirk!",
+ "#TRI4\\TRI4_059#Go back to your Federation, Kirk!",
+ "#TRI4\\TRI4_060#How dare you lecture me on points of honor! I, the most decorated warrior in the entire empire! I, who took the dishonored trash of my homeworld and destroyed it with a fist of steel!",
+ "#TRI4\\TRI4_061#How dare you! The test was supposed to take place without interference from your ship. You have shown all lack of honor.",
+ "#TRI4\\TRI4_062#I am tired of this posturing, Kirk. You know what the verdict is. Go back to your ship.",
+ "#TRI4\\TRI4_063#I shall agree to it, Captain. Until we meet again.",
+ "#TRI4\\TRI4_064#If I had been trying to murder you, Kirk, you would have surely died.",
+ "#TRI4\\TRI4_065#If I was not bound by the Organian treaty, you would be a dead man now, Kirk! Perhaps one day, I shall not be bound by it.",
+ "#TRI4\\TRI4_066#Of course it was, you fool! Did you honestly expect us to act with kindness to traitors? You fought a battle that you could not win, and fought it very well. Go home, Kirk.",
+ "#TRI4\\TRI4_067#Perhaps because Klingons do not blush. You've lost, Kirk. Go home.",
+ "#TRI4\\TRI4_068#Return to your ship, Kirk. The trial is over.",
+ "#TRI4\\TRI4_069#Such threats, Kirk, will only increase my longing for the experience.",
+ "#TRI4\\TRI4_070#The death ceremony shall take place aboard the K'lirta. I trust you are satisfied that justice has been done.",
+ "#TRI4\\TRI4_071#The trial is over! He is guilty. Durn, carry out the sentence!",
+ "#TRI4\\TRI4_072#Those who lose honor lose life, Kirk! It is the Klingon way!",
+ "#TRI4\\TRI4_073#To allow a traitor to live would dishonor me. I will not live with such a stain on my honor.",
+ "#TRI4\\TRI4_074#To free a traitor is to lose all honor, Kirk! He is sentenced to die!",
+ "#TRI4\\TRI4_075#Very well. The trial is over. K'etz'koatl is sentenced to death.",
+ "#TRI4\\TRI4_076#You humans have an excellent imagination, but a poor grasp of reality.",
+
+
+ "#TRI5\\TRI5_001#Obviously, they want us to place the gems in the holes, but which one...",
+ "#TRI5\\TRI5_002#Gentlemen, I suggest we start trying to find out what this is. I have a feeling we've come some place Vlict wasn't expecting us to go.",
+ "#TRI5\\TRI5_003#Hoist on your own petard, eh, Vlict? Do you want me to help you?",
+ "#TRI5\\TRI5_004#I do not see what can be served by more killing.",
+ "#TRI5\\TRI5_005#I fear that politics will make it impossible. Your planet is in Klingon space. But I don't understand why the Klingons never detected you.",
+ "#TRI5\\TRI5_006#If I have your word that Quetzecoatl goes free, I'm willing to intervene to save you.",
+ "#TRI5\\TRI5_007#If I have your word that Quetzecoatl goes free, I'm willing to intervene to save you.",
+ "#TRI5\\TRI5_008#You tried to send me to my death. Now you can rot as you get what you deserve.",
+ "#TRI5\\TRI5_009#You tried to eliminate me. Now you can rot as you get what you deserve.",
+ "#TRI5\\TRI5_010#Captain, it seems to be some sort of interface device, but I do not know how to activate it.",
+ "#TRI5\\TRI5_011#Jim, I have no idea what it is. Why don't you try asking Spock.",
+ "#TRI5\\TRI5_012#Nobody needs healing, Jim, but you will if they harm my patient.",
+ "#TRI5\\TRI5_013#We've got to get out of here, Jim!",
+ "#TRI5\\TRI5_014#Even I can see that, you pointy-eared freak!",
+ "#TRI5\\TRI5_015#He really doesn't have a likable personality, does he?",
+ "#TRI5\\TRI5_016#I suspect Captain, that the machinery is activated by placing the gems in the proper slots. We should determine a system for this.",
+ "#TRI5\\TRI5_017#This is not Klingon technology, Captain.",
+ "#TRI5\\TRI5_018#Kirk!",
+ "#TRI5\\TRI5_019#Agreed!",
+ "#TRI5\\TRI5_020#Kirk! This is your doing!",
+ "#TRI5\\TRI5_021#Rrrrr. Very well. I agree to your terms.",
+ "#TRI5\\TRI5_022#You have no right to try me!",
+ "#TRI5\\TRI5_023#You want me to beg like a weakling child cowering before his betters!",
+ "#TRI5\\TRI5_024#This is Bialbi, the most advanced lifeform on this world. Thank you for informing us of the situation. It shall be resolved.",
+ "#TRI5\\TRI5_025#A life for a life is a just bargain. But his crimes are beyond count.",
+ "#TRI5\\TRI5_026#Admiral Vlict, the entity Quetzecoatl shall be set free. If you ever return to this sector, the sentence shall be carried out. No Klingon vessel may ever return to this world.",
+ "#TRI5\\TRI5_027#Admiral Vlict, this is the defensive system of Hrakkour. You have engaged in genocidal activities on this world. Have you anything to say before your sentence is passed?",
+ "#TRI5\\TRI5_028#As for you, Captain, you may return. I find your social development most pleasing.",
+ "#TRI5\\TRI5_029#I have as much right as you to conduct trials on this planet. You showed no justice to your victim. The penalty for injustice is death.",
+ "#TRI5\\TRI5_030#Idealism! An advanced concept! Naive, perhaps, but charming in its simplicity.",
+ "#TRI5\\TRI5_031#No, Admiral, it is not, but that will suffice as a final public statement. The sentence is banishment, to you and all members of your crew who were involved in this action.",
+ "#TRI5\\TRI5_032#Now, you may go. Heed my warning Vlict. I shall not be merciful a second time.",
+ "#TRI5\\TRI5_033#Their archeological digs did come close, Captain, but I am very elusive. I waited and monitored the situation and chose to reveal myself to you.",
+ "#TRI5\\TRI5_034#You will be returned to your ship, Captain. As will the creature who was unfairly punished. You need not witness the Klingon's punishment.",
+ "#TRI5\\TRI5_035#Not primed for neural interlink.",
+ "#TRI5\\TRI5_036#Alien vessels scanned.",
+ "#TRI5\\TRI5_037#Integrator now active",
+ "#TRI5\\TRI5_038#Telepathic entry codes required for greater than level One functions. Neural interlink at the integrator, and use the main index code of my light.", // TYPO
+ "#TRI5\\TRI5_039#That combination is restricted to higher order functions. Neural interlink required.",
+ "#TRI5\\TRI5_040#This is Bialbi, High Mentalic of Hrakkour. For defense, use the light of war. For information, use my light. For transportation, use the light of travel. Sequences are keyed by combinations of crystals.",
+ "#TRI5\\TRI5_041#To use any light, the first crystal must correspond to the color of the light.",
+ "#TRI5\\TRI5_042#Force field blocks trans-system transport. Transport aborted. Use defense systems to eliminate alien vessels.",
+ "#TRI5\\TRI5_043#That destination no longer exists. Transport abandoned.",
+ "#TRI5\\TRI5_044#There is damage in the archive section due to a recent neutrino burst. Transport aborted.",
+ "#TRI5\\TRI5_045#There is no battle site at present to which to transport you.", // TYPO
+ "#TRI5\\TRI5_046#We can transport you only in proximity of nearest humanoid life. Transport imminent.",
+ "#TRI5\\TRI5_047#Alien vessels scanned.",
+ "#TRI5\\TRI5_048#Breach of protocol. Alien invasion imminent. Internal security activated.",
+ "#TRI5\\TRI5_049#Internal defenses off line. Failsafes cancelled.",
+ "#TRI5\\TRI5_050#Planetary defenses revived. All alien vessels in orbit destroyed.",
+ "#TRI5\\TRI5_051#I guess I should've taken a few more science courses at the Academy.",
+ "#TRI5\\TRI5_052#What is this place?",
+ "#TRI5\\TRI5N002#A platform emitting a beam of light.", // TYPO
+ "#TRI5\\TRI5N004#A strange yellow light.",
+ "#TRI5\\TRI5N005#James T. Kirk, hero of the galaxy!",
+ "#TRI5\\TRI5N006#Openings on the platform. Place something in these holes?",
+ "#TRI5\\TRI5N007#Your communicator is not working.",
+ "#TRI5\\TRI5N008#Your ever emotional friend, Dr. McCoy.",
+ "#TRI5\\TRI5N009#Your ever logical friend, Spock.",
+ "#TRI5\\TRI5N010#Your ever nervous crewman, Ensign Bennie.",
+ "#TRI5\\TRI5N011#Your phaser is not working.",
+ "#TRI5\\TRI5N012#Your tricorder's recording functions are working, but it does not seem to be able to analyze.",
+ "#TRI5\\TRI5N013#This large gem appears to be a ruby of unusual size. This is obviously artificial.",
+ "#TRI5\\TRI5N014#This large gem appears to be a ruby of unusual size. This is obviously artificial.",
+ "#TRI5\\TRI5N015#This large gem appears to be a ruby of unusual size. This is obviously artificial.",
+ "#TRI5\\TRI5N016#This large gem appears to be a sapphire of unusual size. This is obviously artificial.", // TYPO
+ "#TRI5\\TRI5N017#This large gem appears to be a sapphire of unusual size. This is obviously artificial.", // TYPO
+ "#TRI5\\TRI5N018#This large gem appears to be a sapphire of unusual size. This is obviously artificial.", // TYPO
+ "#TRI5\\TRI5N019#This large gem appears to be an emerald of unusual size. This is obviously artificial.", // TYPO
+ "#TRI5\\TRI5N020#This large gem appears to be an emerald of unusual size. This is obviously artificial.", // TYPO
+ "#TRI5\\TRI5N021#This large gem appears to be an emerald of unusual size. This is obviously artificial.", // TYPO
+
+
+ "#SIN0\\SIN0_001#Good Mr. Scott. I'll keep you posted. Kirk out.",
+ "#SIN0\\SIN0_002#Let me know if things change. Kirk out.",
+ "#SIN0\\SIN0_003#Mr. Scott?",
+ "#SIN0\\SIN0_004#Scotty, report on the transporter problem.",
+ "#SIN0\\SIN0_005#That will still give us plenty of time, Scotty.",
+ "#SIN0\\SIN0_006#That's what we're here to find out. The unknown.",
+ "#SIN0\\SIN0_007#We didn't notice anything beaming down.",
+ "#SIN0\\SIN0_008#Which means that this moon might still be inhabited, Mr. Spock.",
+ "#SIN0\\SIN0_009#Aside from the security door on what should be a lifeless planetoid, this place is unremarkable.",
+ "#SIN0\\SIN0_010#It's what I was afraid of, Jim. The thin atmosphere of this moon doesn't provide enough protection from cosmic rays. We shouldn't stay here any more than a few hours.",
+ "#SIN0\\SIN0_011#The atmosphere is breathable, Jim, but hardly nourishing. We should either get inside or go back to the ship.",
+ "#SIN0\\SIN0_012#There's not much I can do for cosmic radiation. It's best if we find some cover indoors.",
+ "#SIN0\\SIN0_013#Do you have Vulcan blood ensign?",
+ "#SIN0\\SIN0_014#I never realized the Orions ever got past decadence... They hadn't the last time I was there.",
+ "#SIN0\\SIN0_015#These stones resemble those on Earth, on Easter Island.",
+ "#SIN0\\SIN0_016#I cannot get readings from this range, Captain. But if we do not hurry there will be nothing left to get a reading on.",
+ "#SIN0\\SIN0_017#The rocks have a high quantity of Tri-Phosphorate Silver in them.",
+ "#SIN0\\SIN0_018#Unremarkable except for low grade power emanations from the door area.",
+ "#SIN0\\SIN0_019#As expected Captain. The source of power emanations lies beyond that door.",
+ "#SIN0\\SIN0_020#Large quantities of atmosphere are being circulated through these rocks. I would guess there are storage units within this satellite which are constantly replacing the atmosphere that is lost because of this moon's weak gravity.",
+ "#SIN0\\SIN0_021#Stone monoliths of faces are a common artistic expression in evolving cultures...",
+ "#SIN0\\SIN0_022#Unknown, ensign.",
+ "#SIN0\\SIN0_023#We have detected no signs of life, Captain, but the possibility does exist.",
+ "#SIN0\\SIN0_024#Area secure, Captain.",
+ "#SIN0\\SIN0_025#A power source that has lasted millenia and endured major catastrophes. That's fascinating, Mr. Spock.",
+ "#SIN0\\SIN0_026#How can there be an atmosphere on a moon of this size?",
+ "#SIN0\\SIN0_027#Like the faces on Vandu II. Even the animal face art of the Orion Post-Decadence Movement is similar.",
+ "#SIN0\\SIN0_028#No, sir.",
+ "#SIN0\\SIN0_S01#No change Captain. Although why it happened is about as clear as a foggy night in Glasgow.",
+ "#SIN0\\SIN0_S48#Aye. We've had some slight problems with the transporters.",
+ "#SIN0\\SIN0_S49#I know. I have the lads in Engineering doing a complete overhaul of the ship's systems.",
+ "#SIN0\\SIN0_S50#Just a glitch in the main transporter program. Mr. Kyle is loading a back-up, and we're performing tests. The transporters will be down for about an hour.",
+ "#SIN0\\SIN0N000#Dr. Leonard McCoy, knowing that they aren't likely to encounter any medical problems, is rather annoyed about being dragged yet again into the transporter.",
+ "#SIN0\\SIN0N001#Ensign Mosher seems to be rather curious about the planet's technology.",
+ "#SIN0\\SIN0N002#James T. Kirk, worried about the safety of the people of Proxtrey.",
+ "#SIN0\\SIN0N003#Mr. Spock looks forward to examining the technology of this ancient culture.",
+ "#SIN0\\SIN0N004#Ten thousand points of light are visible to the naked eye through the thin atmosphere of this moon.",
+ "#SIN0\\SIN0N005#The heavy-duty security door is now open.",
+ "#SIN0\\SIN0N006#There are many rocks here.",
+ "#SIN0\\SIN0N007#This is the planet Proxtrey, currently six hundred thousand kilometers from this moon.",
+ "#SIN0\\SIN0N008#This looks like a heavy-duty security door built into the side of a hill on this moon.",
+ "#SIN0\\SIN0N009#This moon has a thin but breathable atmosphere.",
+ "#SIN0\\SIN0N010#You retrieve a rock.",
+ "#SIN0\\SIN0N011#These stones look like faces.",
+ "#SIN0\\SIN0U069#Nothing new to report Captain.",
+ "#SIN0\\SIN0U082#Captain, Mr. Scott wishes to speak with you.",
+
+
+ "#SIN1\\SIN1_001#Spock, see what you can do with that lock.",
+ "#SIN1\\SIN1_002#Check her record, Mr. Scott. She was in the top ten percent of her class in computer systems analysis.",
+ "#SIN1\\SIN1_003#Isolate that virus. That's your number one priority.",
+ "#SIN1\\SIN1_004#Just do your best, Scotty. Kirk out.",
+ "#SIN1\\SIN1_005#There goes our back-up plan. Do what you can, Mr. Scott.",
+ "#SIN1\\SIN1_006#Well, we won't be able to phaser any outbound missiles.",
+ "#SIN1\\SIN1_007#What is it, Scotty?",
+ "#SIN1\\SIN1_008#Your situation, Mr. Scott?",
+ "#SIN1\\SIN1_009#A security lock, Captain.",
+ "#SIN1\\SIN1_010#A working display panel, Captain.",
+ "#SIN1\\SIN1_011#Ah, that worked. I see you deduced that 10200, in the Lucrs base three was equal to their sacred number 99.",
+ "#SIN1\\SIN1_012#Damn it, Jim. I'm a doctor, not a locksmith!",
+ "#SIN1\\SIN1_013#No appreciable cosmic radiation damage. Yet.",
+ "#SIN1\\SIN1_014#There's not much I can do for cosmic radiation. It's best if we find some cover indoors.",
+ "#SIN1\\SIN1_015#We should stay inside as much as possible. We must try to protect ourselves from the cosmic radiation.",
+ "#SIN1\\SIN1_016#It would be useless Captain. The door could easily withstand our phaser fire.",
+ "#SIN1\\SIN1_017#That did not seem to work, Captain. Perhaps we should try a number that had some significance to them. Remember they were very superstitious.",
+ "#SIN1\\SIN1_018#That prompted a response, Captain. 01210 is 100 in base four, a number the Sofs regarded as sacred.",
+ "#SIN1\\SIN1_019#The door still appears to be in operating condition.",
+ "#SIN1\\SIN1_020#The origin point for the broadcast Uhura monitored was approximately fifty meters beyond this door.",
+ "#SIN1\\SIN1_021#There is power running to the keypad.",
+ "#SIN1\\SIN1_022#This appears to be a dust-covered lens of some sort.",
+ "#SIN1\\SIN1_023#This is the focal lense for an anti-intruder laser.",
+ "#SIN1\\SIN1_024#Unremarkable.",
+ "#SIN1\\SIN1_025#We should carefully consider everything we know about this culture before taking action.",
+ "#SIN1\\SIN1_026#From what we know about the Lucrs, they had an affinity for size. Their machines weren't just equipment; they were also monuments.",
+ "#SIN1\\SIN1_027#It appears that our mission has increased in importance.",
+ "#SIN1\\SIN1_028#I'm just a security officer, Sir.",
+ "#SIN1\\SIN1_029#I can believe that.",
+ "#SIN1\\SIN1_030#This door is huge. If they were humanoid, they could have been giants...",
+ "#SIN1\\SIN1_S10#Captain, I'm afraid we've got a wee problem here.",
+ "#SIN1\\SIN1_S17#That it is, Captain. We'll keep you informed. Scott out.",
+ "#SIN1\\SIN1_S18#There is some sort of virus in the main computer. Our phasers and tractor beams have been disabled, and there's no way we're getting them back in three hours.",
+ "#SIN1\\SIN1_S20#We'll find that virus soon Captain, or I'm an Englishman.",
+ "#SIN1\\SIN1_S51#We're still looking for the virus, Captain. I even have Lieutenant Uhura looking through the computer system. I never realized the lass was so good with them.",
+ "#SIN1\\SIN1_S85#Aye, I will Captain. I may yet have a trick or two that I can pull, but don't count on any miracles.",
+ "#SIN1\\SIN1N000#A lens sits above the doorway, but is it mere decoration?",
+ "#SIN1\\SIN1N001#Built into the rock is a very large door.",
+ "#SIN1\\SIN1N002#Ensign Mosher is glad to be a member of this landing party, at least for now.",
+ "#SIN1\\SIN1N003#It looks like some sort of display panel.",
+ "#SIN1\\SIN1N004#It never ceases to amaze you how passive Spock can be, even in the presence of extraordinary wonders.",
+ "#SIN1\\SIN1N005#James T. Kirk, A man with a problem. A big problem that is getting bigger.",
+ "#SIN1\\SIN1N006#McCoy is examining himself for cosmic radiation sickness symptoms.",
+ "#SIN1\\SIN1N007#Meteorites have hit this door and left it undamaged. What are you going to do with a rock?",
+ "#SIN1\\SIN1N008#The doorway into the complex is huge.",
+ "#SIN1\\SIN1N009#This appears to be some sort of security lock.",
+ "#SIN1\\SIN1N010#This heavy-duty door has taken numerous micrometeorite strikes but still appears solid.",
+ "#SIN1\\SIN1N011#This is a keypad that looks functional.",
+ "#SIN1\\SIN1U070#Nothing new to report Captain.",
+
+
+ "#SIN3\\SIN3_012#Can't say I like the decor.",
+
+
+ "#VENA\\VENA_F41#Kirk out.",
+
+
+ "#sfx\\spokcoff#cough... cough...",
+ "#SFX\\STATICU1#Ent... neu ... trans...",
+};
+
+}
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 03073ef..558162b 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -24,9 +24,6 @@
#define STARTREK_TEXT_H
-// In this file, the TYPO tag is used when a typo is fixed in a piece of text, or when
-// text is changed to match the audio.
-
namespace StarTrek {
// The type to use for text references (values of "GameStringIDs" enum).
@@ -2545,2444 +2542,8 @@ enum GameStringIDs {
TX_END
};
-// TODO: Move this out of the header file. It's inflating the executable size.
-const char *const g_gameStrings[] = {
- nullptr,
- "",
- "Dialog error",
- "Animation error",
-
- "Capt. Kirk",
- "Mr. Spock",
- "Dr. McCoy",
- "Lt. Uhura",
- "Mr. Scott",
- "Mr. Sulu",
-
- "Ensign Everts",
- "Prel. Angiven",
- "Sign",
- "Klingon",
- "Brother Kandrey",
- "Brother Stephen",
- "Brother Chub",
- "Brother Roberts",
- "Brother Grisnash",
- "Nauian",
- "Ship's Computer",
-
- "Lt. Christensen",
- "Crewman Simpson",
- "Elasi Guard",
- "Elasi Clansman",
- "Elasi Cereth",
- "Masada Crewman",
-
- "Lt. Ferris",
- "Computer",
- "Dr. Marcus",
- "Dr. Cheever",
- "Preax",
-
- "Lt. Buchert",
- "Harry Mudd",
-
- "Lt. Stragey",
- "Quetzecoatl",
- "Tlaoxac",
-
- "Ensign Bennie",
- "Vlict",
- "Klingon Guard",
- "Entity",
- "Bialbi",
- "A Voice Speaks",
- "Light of War",
- "Light of Knowledge",
- "Light of Travel",
-
- "Ensign Mosher",
-
- "#BRID\\BRIDU146#Nothing to report, Captain.",
-
- "#GENE\\G_024#Fascinating.",
- "#GENE\\G_043#Ouch! Watch it with that thing!",
-
- "#GENE\\GENER004#Game Over",
-
- "#COMP\\COMPA180#Orbit Stabilized. Warning Cancelled.",
- "#COMP\\COMPA186#Ammonia",
- "#COMP\\COMPA187#Di-hydrogen Oxide",
- "#COMP\\COMPA189#Nitrous Oxide",
- "#COMP\\COMPA190#Oroborus Virus",
- "#COMP\\COMPA191#Exit Database",
- "#COMP\\COMPA193#TLTDH Gas",
- "#COMP\\COMPU181#Warning. Orbital Decay is now irreversible. Abandon Ship. Abandon Ship.",
- "#COMP\\COMPU182#Warning. Orbital decay detected. Warning.",
- "#COMP\\COMPU186#Ammonia: a colorless pungent compound NH3, a common byproduct of metabolism in carbon-based lifeforms. Liquid or gaseous at 1 atm. Compounds widely used in agricultural, medical and industrial applications.",
- "#COMP\\COMPU187#Di-hydrogen Oxide: a colorless, tasteless, nonflammable compound HO- water. Liquid, solid, or gaseous at 1 atm. Temperature scales defined in most humanoid cultures by state-shift of pure water.",
- "#COMP\\COMPU188#Dr. Marcus' Log, Supplemental: Continued testing of the Oroborus Virus confirms its potential harmful effects on Romulan/Vulcan humanoids. As soon as the spill has been cleaned up, we will sterilize both labs and purge the circulation system to make sure no traces of the virus will remain viable. Then all research files must be erased -- we must leave no chance that this terrible accident will ever be repeated.",
- "#COMP\\COMPU189#Nitrous Oxide: a colorless nonflammable compound NO, gaseous at 1 atm and temperatures within the human norm. Early anesthetic among humans, in whom it produces laughter, feelings of exhiliration, euphoria; sometimes leading to unconsciousness.",
- "#COMP\\COMPU190#Oroborus virus: Atypical growth patterns for L-Type virus. Opportunistic pneumococcal mimic affecting Romulo-Vulcan genotype. Etiology: contact or airborne vector with alveoli microcollapse involvement immediately upon exposure. Tissue dehydration follows pneumal flooding. Mortality: 0.6 in 1.0 stardates, 1.0 within 2.0 stardates Treatment: none. Named for the mythic worldsnake that swallows its own tail.",
- "#COMP\\COMPU192#Please select subject file...",
- "#COMP\\COMPU193#TLTDH gas: The chemical compound tantalum bi-lithium thalo-dihydroxide. Colorless, odorless, nonflammable gaseous at 1 atm and temperatures within the human norm. Early anesthetic among Vulcans and Romulans, in whom it produces laughter, feelings of exhiliration, euphoria; sometimes leading to unconsciousness. In post-industrial/pre-spaceflight era, a social problem evolved when crude TLTDH became popular to \"cook up\" from non-conductive tantalo-lithial compounds commonly used as electrical insulation.",
-
-
- "#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?",
- "#DEM0\\DEM0_002#Aside from seeing demons, has any hard data been collected? Any evidence I could see?",
- "#DEM0\\DEM0_003#Been seeing ghosts and bogeymen eh? I find that a little hard to believe.",
- "#DEM0\\DEM0_004#C'mon Bones, the cold will improve your circulation.",
- "#DEM0\\DEM0_005#Demons? Gates of Hell? This is the 23rd Century!",
- "#DEM0\\DEM0_006#I'm Captain James T. Kirk of the U.S.S. Enterprise. We have received word that alien lifeforms are creating problems at your mining facilities at Idyll Mountain. Tell me more.",
- "#DEM0\\DEM0_007#Later Ensign. We have work to do.",
- "#DEM0\\DEM0_008#Most High Prelate Angiven, I am honored to meet you. I consider it my divine duty to assist you in any possible way with the spawn of the devil.",
- "#DEM0\\DEM0_009#This planet's as beautiful as everyone says it is.",
- "#DEM0\\DEM0_010#What can you tell me about the mine itself?",
- "#DEM0\\DEM0_011#You look rather cold, Bones.",
- "#DEM0\\DEM0_012#You're wasting the time of a starship capable of destroying this planet with campfire stories? No wonder you were dumped out here in the middle of nowhere.",
- "#DEM0\\DEM0_013#Captain, Doctor McCoy is correct.",
- "#DEM0\\DEM0_014#Captain, demons and supernatural creatures are, almost by definition, illogical. Yet it is evident these people believe what they have seen. Barring illness or mass hysteria, I agree that a real problem seems to exist.",
- "#DEM0\\DEM0_015#Burning down their house is not the best way to gain their confidence Jim!",
- "#DEM0\\DEM0_016#Captain, the flora on this planet is very interesting. I wonder how useful it may be for medicinal purposes.",
- "#DEM0\\DEM0_017#Quite the vandal aren't we, Jim?",
- "#DEM0\\DEM0_018#His blood pressure's up a bit, but he believes he's telling the truth.",
- "#DEM0\\DEM0_019#I don't know if the problem is real, the result of a new illness, or mass hysteria. But at the very least, there's an injured miner who needs my help.",
- "#DEM0\\DEM0_020#Jim! Are you out of your mind?",
- "#DEM0\\DEM0_021#Jim, I am not picking up any unusual life here, just native lifeforms and the settlers. The colonists are all human, except for the one Tellarite. If there are demons here, they don't register on my tricorder.",
- "#DEM0\\DEM0_022#The man's in perfect health.",
- "#DEM0\\DEM0_023#I'm not cold, I'm freezing! And that damn transporter just had to set me down in the middle of a snow drift!",
- "#DEM0\\DEM0_024#Some people get too much circulation!",
- "#DEM0\\DEM0_025#Well...",
- "#DEM0\\DEM0_026#You mean you've never built a snowman, ensign?",
- "#DEM0\\DEM0_027#The trees. The fresh air. The freezing cold...",
- "#DEM0\\DEM0_028#Captain, reading the rocks in this area, I find that this locality may have been disturbed in the distant past. Recent disturbances created by the colonists' construction and mining prevent me from discovering anything further.",
- "#DEM0\\DEM0_029#A centimeter of snow does not technically constitute a drift, Doctor.",
- "#DEM0\\DEM0_030#They are already gathered in the chapel, and will cooperate in any way with you. First door on my right.",
- "#DEM0\\DEM0_031#A skeptic would consider everything merely anecdotal or unproven. My people will gladly tell you their own stories, so you need not hear it secondhand through me.",
- "#DEM0\\DEM0_032#Captain Kirk. I had no idea we were blessed with one of our order in the ranks of Starfleet. We believe we have located the very Gates of Hell below Idyll Mountain.",
- "#DEM0\\DEM0_033#Starfleet recognizes our freedom to worship and believe as we see fit, Captain. I am surprised that you do not share that feeling. Rest assured that Starfleet Command will be informed of your rudeness.",
- "#DEM0\\DEM0_034#Thank you for your courtesy, Kirk. May you receive the guidance and protection of our God as you complete this divine mission.",
- "#DEM0\\DEM0_035#The area is exceptionally stable tectonically, and easy for our machinery to work in, praise God. We've mined for hafnium and a variety of useful trace elements. The deeper we dig, however, the more anomalous the variety of minerals seems to be. Our Ignaciate, Brother Stephen, has his own theories about why this might be. Either way, the anomalies inspired Brother Kandrey to conduct studies inside the mine. Yesterday, he reported discovering a strange door -- a gate to Hell, surely, for the demons caused a cave-in immediately. Kandrey was trapped, unconscious, and the demons prevent us from rescuing him. We can only hope he is still alive.",
- "#DEM0\\DEM0_036#This is so much better, gentlefolk. We are honored at your presence and hope you will find peace here in our haven.",
- "#DEM0\\DEM0_037#We need your help, Kirk. You may have no respect for our beliefs, but I hope you will look beyond that. Godspeed.",
- "#DEM0\\DEM0_038#Certainly, Captain Kirk. Not aliens, per se -- we have encountered what we believe are demons at Idyll Mountain, creatures surely emerging from the very gates of Hell. Our God would not test us thus without reason, so we believe your might and insight are our God's method to help us discover what is going on.",
- "#DEM0\\DEM0_039#Aw, Captain, please don't melt the snow. I've never seen it before.",
- "#DEM0\\DEM0_040#Is he always this trigger happy on ground missions?",
- "#DEM0\\DEM0_041#And doctors say that patients complain too much!",
- "#DEM0\\DEM0_042#I've never even thrown a snowball. Do you think anyone would mind?",
- "#DEM0\\DEM0_043#I've never seen snow like this before. This is great!",
- "#DEM0\\DEM0_044#Of course, sir.",
- "#DEM0\\DEM0N000#A beautiful, snow covered scene with a path leading off to Mount Idyll.",
- "#DEM0\\DEM0N001#A quickly constructed spartan shelter, primarily used by fledgling colonies.",
- "#DEM0\\DEM0N002#Dr. Leonard McCoy, the finest doctor in Starfleet, wishes that he were on a warmer planet.",
- "#DEM0\\DEM0N003#Ensign Everts, who has never been this close to snow before in his life, gazes with child-like fascination at the ground.",
- "#DEM0\\DEM0N004#High Prelate Angiven waits patiently for you to decide what you will do next.",
- "#DEM0\\DEM0N005#James Tiberius Kirk, Captain of the Enterprise. He's always happy to run an errand of mercy.",
- "#DEM0\\DEM0N006#On the other side of the trees is Idyll Mountain. A tall, forbidding place. You have a vague feeling of danger.",
- "#DEM0\\DEM0N007#Remnants of a recent snowfall cover the ground.",
- "#DEM0\\DEM0N008#Some colonists.",
- "#DEM0\\DEM0N009#Spock raises an eyebrow.",
- "#DEM0\\DEM0N010#Various bushes and shrubs grow along the edge of the forest.",
- "All mining equipment use this road.",
-
-
- "#DEM1\\DEM1_001#We were caught flat footed there. I don't want any more surprises to catch us off guard.",
- "#DEM1\\DEM1_002#No just an idea, Kirk out.",
- "#DEM1\\DEM1_003#We're fine. Did you register any Disruptor fire?",
- "#DEM1\\DEM1_004#What is it, Spock?",
- "#DEM1\\DEM1_005#Doctis Cattails are similar to their terran name sake except that they are known to cause hives if in contact with flesh for any amount of time.",
- "#DEM1\\DEM1_006#Gindorian ferns are regarded as an intergalactic weed, Captain.",
- "#DEM1\\DEM1_007#Khytellian tulips are a perennial flower that survive in almost any climate.",
- "#DEM1\\DEM1_008#The Brandzite pod is similar to terran milkweed except that the silk pods are in bright iridecent colors.",
- "#DEM1\\DEM1_009#He's only stunned. He'll be back up in a few seconds.",
- "#DEM1\\DEM1_011#The fire fight is over, Jim. I think you can put that away now.",
- "#DEM1\\DEM1_012#This is definitely not a real klingon Jim.",
- "#DEM1\\DEM1_013#Demons, Klingons, avalanches... What's next, the Wicked Witch of the West?",
- "#DEM1\\DEM1_014#It wasn't supposed to be logical, you green blooded Vulcan! Why does everything have to be so damned logical?",
- "#DEM1\\DEM1_015#Well, we've seen Klingons. Now all we need is a few Romulans...",
- "#DEM1\\DEM1_016#The circuit was damaged. It appears reparable, but some specialized equipment will be required.",
- "#DEM1\\DEM1_017#This is a detached hand with some kind of circuitry in the palm, Captain.",
- "#DEM1\\DEM1_018#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial. There is something different about this particular construct. Come here, Captain, look at the hand.It seems to have been separated from the body. There is a wiring circuit in the middle of the palm.",
- "#DEM1\\DEM1_019#This is not a Klingon, Captain, not a real one. It is an organic construct -- an android-like robot. It looks like a Klingon, but the appearance is entirely superficial.",
- "#DEM1\\DEM1_020#Fascinating. I begin to suspect that we have stumbled upon something that the colonists would never have uncovered.",
- "#DEM1\\DEM1_021#I wish to gather further data before making a definite conclusion, Captain.",
- "#DEM1\\DEM1_022#Captain, I detect a recent avalanche, approximately 6.2 kilometers away, that occurred within the last three days. The mountain may be quite dangerous.",
- "#DEM1\\DEM1_023#Control your thoughts, Doctor. There is a high probability that something here is using our own memories against us.",
- "#DEM1\\DEM1_024#That is not logical, doctor.",
- "#DEM1\\DEM1_025#I guess they don't make Klingons like they used to, Sir.",
- "#DEM1\\DEM1_026#I guess this isn't such a great planet after all.",
- "#DEM1\\DEM1_F23#Federation Scum!",
- "#DEM1\\DEM1N000#Captain Kirk is fatally shot by a Klingon, game over.",
- "#DEM1\\DEM1N001#Dr. McCoy, still hoping the cold winds that whip around Mount Idyll will soon die down.",
- "#DEM1\\DEM1N002#Ensign Everts seems to be rattled by the attack of the Klingons.",
- "#DEM1\\DEM1N003#James Kirk, filled with a premonition of more dangers yet to come.",
- "#DEM1\\DEM1N004#They look like Klingons.",
- "#DEM1\\DEM1N005#You already took the hand from the Klingon.",
- "#DEM1\\DEM1N006#You find nothing new.",
- "#DEM1\\DEM1N007#You take the Klingon's detached hand.",
- "#DEM1\\DEM1N008#Your Vulcan science officer seems to be lost in thought, but remains alert.",
- "#DEM1\\DEM1N009#A Gindorian Fern.",
- "#DEM1\\DEM1N010#A large patch of Khytellian Tulips.",
- "#DEM1\\DEM1N011#A small stream flows down towards the forest.",
- "#DEM1\\DEM1N012#Captain Kirk is unconscious.",
- "#DEM1\\DEM1N013#Dr. McCoy is unconscious.",
- "#DEM1\\DEM1N014#Ensign Everts is unconscious.",
- "#DEM1\\DEM1N015#Mr. Spock is unconscious.",
- "#DEM1\\DEM1N016#Mt. Idyll rises above you.",
- "#DEM1\\DEM1N017#The path is surrounded by some beautiful shrubbery.",
- "#DEM1\\DEM1N018#These are very beautiful Doctis Cattails.",
- "#DEM1\\DEM1N019#These Brandzite Pods add a nice touch to the local flora.",
- "#DEM1\\DEM1N020#You see a small explosion, and the Klingon's hand falls to the ground with a dull thud.",
- "#DEM1\\DEM1N021#You see the mine entrance ahead.",
- "#DEM1\\DEM1N023#It's the Klingon's detached hand!",
- "#DEM1\\DEM1U077#Captain we registered Phaser fire and an unknown energy beam. Is everyone OK?",
- "#DEM1\\DEM1U078#No, Captain. Why, are Klingons down there?",
-
-
- "#DEM2\\DEM2_001#The answer to this mystery lies ahead of us, gentlemen.",
- "#DEM2\\DEM2_002#Just don't make that mistake again, Ensign.",
- "#DEM2\\DEM2_003#The thought had occurred to me, Mr. Spock, but thank you for mentioning it.",
- "#DEM2\\DEM2_004#We've all had our share of conflict with Klingons, Ensign. The Organians told me that one day Humans and Klingons will become good friends. I wonder if I'll ever live to see that day.",
- "#DEM2\\DEM2_005#Captain, I'm having trouble getting reliable readings from inside the mountain. Unusual crystalline structures within the ore may be at fault, though I cannot say for certain.",
- "#DEM2\\DEM2_006#Gindorian ferns are regarded as an intergalactic weed, Captain.",
- "#DEM2\\DEM2_007#The Phequedine moss extracts nourishment from hafnium, Captain.",
- "#DEM2\\DEM2_008#These seem to be Laraxian berries, Captain. They have several medicinal uses, but Dr. McCoy would know more.",
- "#DEM2\\DEM2_009#Jim, these are Laraxian Berries that we used to make the Hypo-Dytoxin.",
- "#DEM2\\DEM2_010#Jim, these are the berries we need to synthesize the Hypo-Dytoxin. We must get these to Brother Stephen quickly.",
- "#DEM2\\DEM2_011#Jim, you usually pick food and then cook it.",
- "#DEM2\\DEM2_012#These are Laraxian Berries. From what I remember, certain chemical compounds in the berry can be used to treat Nugaireyn infections.",
- "#DEM2\\DEM2_013#These are the Laraxian Berries we used to cure Brother Chub.",
- "#DEM2\\DEM2_014#We don't need any more berries, Jim.",
- "#DEM2\\DEM2_015#Does your tricorder say the cave is warmer, Spock...",
- "#DEM2\\DEM2_016#Spock, everybody talks about the weather!",
- "#DEM2\\DEM2_017#It is not logical for me to use my tricorder to determine the cave's temperature, doctor. I do not see what purpose it would serve.",
- "#DEM2\\DEM2_018#Whoever was trying to stop us may not stop with those Klingons, Captain. I recommend extreme caution.",
- "#DEM2\\DEM2_019#I'm sorry I let you down with those Klingons back there. I should have been paying more attention.",
- "#DEM2\\DEM2_020#Those Klingons give me the willies. They always have. My sister was wounded by them in the Chozon ambush.",
- "#DEM2\\DEM2N000#Ensign Everts. Keeping a sharp eye out for anything dangerous.",
- "#DEM2\\DEM2N002#James T. Kirk. Always wondering what the next surprise will be.",
- "#DEM2\\DEM2N003#Leonard McCoy. Hoping that the cave will be warmer than outside.",
- "#DEM2\\DEM2N004#Spock. Perhaps the most brilliant mind in Starfleet, pondering a most peculiar mystery.",
- "#DEM2\\DEM2N005#A Gindorian fern.",
- "#DEM2\\DEM2N006#Feeble lights illuminate the mine tunnel.",
- "#DEM2\\DEM2N007#Idyll Mountain.",
- "#DEM2\\DEM2N008#Idyll Mountain.",
- "#DEM2\\DEM2N009#Mine entrance.",
- "#DEM2\\DEM2N010#Phequedian moss grows on the cave wall.",
- "#DEM2\\DEM2N011#The mine entrance goes deep into Mount Idyll.",
- "#DEM2\\DEM2N012#Various types of berries grow amongst the bushes.",
- "#DEM2\\DEM2N013#You have retrieved a sample of berries.",
-
-
- "#DEM3\\DEM3_001#Assume firing positions.",
- "#DEM3\\DEM3_002#A gateway to an alien race. The wonders of the galaxy are endless, aren't they, Mr. Spock?",
- "#DEM3\\DEM3_003#Bones..",
- "#DEM3\\DEM3_004#Don't be too anxious, Ensign. We may want to talk with them.",
- "#DEM3\\DEM3_005#Captain, I would strongly recommend clearing all the debris first.",
- "#DEM3\\DEM3_006#Captain, the structure is extremely unstable. I would not recommend disturbing the lower section before the upper sections have been cleared.",
- "#DEM3\\DEM3_007#Captain, the stun setting would be very ineffective on these boulders.",
- "#DEM3\\DEM3_008#I think Doctor McCoy would be better suited to deal with this.",
- "#DEM3\\DEM3_009#It appears to be a security lock designed to open the door when the correct hand print is registered.",
- "#DEM3\\DEM3_010#Captain, there are several weak points in the cave-in's structure. Careful use of our phasers, from the top down, should be able to clear it.",
- "#DEM3\\DEM3_011#Captain, this course of action is ineffectual.",
- "#DEM3\\DEM3_012#Fascinating, Captain. This door is made of an unknown material. It is clearly built by an alien race we have no knowledge of.",
- "#DEM3\\DEM3_013#He's already dead, Jim. Isn't that good enough for you?",
- "#DEM3\\DEM3_014#I'm sorry, Jim. Ensign Everts is beyond my help.",
- "#DEM3\\DEM3_015#I've done all I can. He just needs rest now.",
- "#DEM3\\DEM3_016#This is incredible, Jim. I'm picking up faint lifesign readings behind this door!",
- "#DEM3\\DEM3_017#Dammit, Jim, I'm a doctor, not a bellhop. This man's too hurt to be moved.",
- "#DEM3\\DEM3_018#He's dead Jim.",
- "#DEM3\\DEM3_019#He's dead, Jim...",
- "#DEM3\\DEM3_020#I'm picking up weak vital signs. If we don't dig him out soon, we're going to lose him!",
- "#DEM3\\DEM3_021#It was a near thing, but he'll live.",
- "#DEM3\\DEM3_022#The miner is dead.",
- "#DEM3\\DEM3_023#This man is badly hurt, and suffering from shock and exposure as well.",
- "#DEM3\\DEM3_024#I'll probably end up coming along.",
- "#DEM3\\DEM3_025#Jim, the next time you need medical help on a snowball...",
- "#DEM3\\DEM3_026#They can also be damned cold.",
- "#DEM3\\DEM3_027#Fascinating... I'm registering low-intensity shielding unlike anything we've encountered before. That kept this door -- and whatever is behind it -- hidden from the ship's sensors and earlier tricorder readings.",
- "#DEM3\\DEM3_028#I recommend as thorough an analysis of this area as possible.",
- "#DEM3\\DEM3_029#Indeed, Captain.",
- "#DEM3\\DEM3_030#Sir, I think we should clear the rest of the rocks before we check out the device.",
- "#DEM3\\DEM3_031#Sir, it may be dangerous. Let me try it.",
- "#DEM3\\DEM3_033#I think I was shocked, sir.",
- "#DEM3\\DEM3_034#Ouch, that hurt.",
- "#DEM3\\DEM3_035#That was definitely a mild shock.",
- "#DEM3\\DEM3_036#No sign of demons, Klingons, or other hostiles, Captain. I promise I'll let you know the instant something appears.",
- "#DEM3\\DEM3_A32#Aieeee!",
- "#DEM3\\DEM3_B32#Aieeeee.",
- "#DEM3\\DEM3_F21#Oh, thank you, kind souls, for saving my life. Let me rest here for a little before returning to report this miracle to Prelate Angiven.",
- "#DEM3\\DEM3N000#Brother Kandrey is barely conscious, and is lying still, trying to regain his strength.",
- "#DEM3\\DEM3N001#Commander Spock; curious about what lies ahead.",
- "#DEM3\\DEM3N002#Doctor Leonard McCoy, glad that the cave provides some shelter from the breeze.",
- "#DEM3\\DEM3N003#Ensign Everts, wary of more ambushes.",
- "#DEM3\\DEM3N004#James T. Kirk. Captain of the Enterprise.",
- "#DEM3\\DEM3N005#Nothing happens.",
- "#DEM3\\DEM3N006#One of the Acolytes, who was trapped by the the rockfall.",
- "#DEM3\\DEM3N007#The fit is perfect, but something seems to be shorting out.",
- "#DEM3\\DEM3N008#The hand's circuitry triggers a connection, and the door opens.",
- "#DEM3\\DEM3N009#There is no apparent effect.",
- "#DEM3\\DEM3N010#A cavern, deep in Mount Idyll.",
- "#DEM3\\DEM3N011#A huge boulder sits upon a large pile of rubble.",
- "#DEM3\\DEM3N012#A large metallic door is set in the structure.",
- "#DEM3\\DEM3N013#A large pile of rubble blocks what appears to be a large metallic structure.",
- "#DEM3\\DEM3N014#A long tunnel descends into the mountain.",
- "#DEM3\\DEM3N015#A pulsing red light is set in the structure above the door.",
- "#DEM3\\DEM3N016#A structure built into the surrounding rock. It must have been buried here for millennia.",
- "#DEM3\\DEM3N017#Ensign Everts lies dead, crushed by the boulder.",
- "#DEM3\\DEM3N018#The crushed body of Ensign Everts reminds you of your poor command judgement.",
- "#DEM3\\DEM3N019#This looks like some of the hand security panels on the Enterprise.",
- "#DEM3\\DEM3N020#You notice what appears to be a man's arm sticking out from beneath the rubble.",
-
-
- "#DEM4\\DEM4_001#I think we've found the answer to our mystery.",
- "#DEM4\\DEM4_002#Stop! You're trespassing on Federation territory.",
- "#DEM4\\DEM4_003#I think I should return it to where I got it from.",
- "#DEM4\\DEM4_004#I welcome you on behalf of the United Federation of Planets. Who are you? Where do you come from?",
- "#DEM4\\DEM4_005#No, I want to keep it as a memento for myself.",
- "#DEM4\\DEM4_006#Of course. I think you will get along well with the Pollux inhabitants, and I'm sure you will have interesting theological discussions.",
- "#DEM4\\DEM4_007#Perhaps you can tell us about the demons.",
- "#DEM4\\DEM4_008#Some advanced civilization!",
- "#DEM4\\DEM4_009#We did fix your machine. Can we write the repair bill off against rent on this land?",
- "#DEM4\\DEM4_010#I would be glad to accept your application to the Federation. We shall have a diplomatic envoy sent to make the final arrangements.",
- "#DEM4\\DEM4_011#Kirk to Enterprise... Beam us up, Mr. Scott.",
- "#DEM4\\DEM4_012#This seems to be a Cryogenic Suspension chamber, Captain.",
- "#DEM4\\DEM4_013#Captain, Starfleet would not be pleased.",
- "#DEM4\\DEM4_014#Fascinating, Captain. It is a diagram of a lunar eclipse of this planet. See how the red ball, the moon, is casting a shadow on the blue ball, Pollux V. This must be a very old piece of work, because this planet's moon was destroyed thousands of years ago.",
- "#DEM4\\DEM4_015#I wonder who, or what, constructed all this.",
- "#DEM4\\DEM4_017#Jim, think about that skull we picked up from Brother Stephen. Now look at this alien. See the resemblance?",
- "#DEM4\\DEM4_018#Ouch!",
- "#DEM4\\DEM4_019#Perhaps we should try to communicate with the alien.",
- "#DEM4\\DEM4_020#This is a very old and very complex life-support system. It appears to still be operational.",
- "#DEM4\\DEM4_021#You should ask Spock, Jim.",
- "#DEM4\\DEM4_022#Fascinating. this lifeform may represent what would have happened had the dinosaurs of your earth not become extinct.",
- "#DEM4\\DEM4_023#It is an alien life-support system, Captain, utilizing geothermal energy. It is still functioning, waiting for some sort of signal.",
- "#DEM4\\DEM4_024#Logically, the machinery is sustaining some type of life in suspended animation. If we can reactivate the machines, then we may be able to meet its creators.",
- "#DEM4\\DEM4_025#The machinery is waiting for the gravitational pull of another eclipse to activate it, an eclipse that will never come. And one other thing, Captain. This may also be a diagram showing the proper settings on that control panel.",
- "#DEM4\\DEM4_026#This alien construction takes readings of mental activity. It also activates manufacturing equipment related to security, and includes a short-distance transportation device.",
- "#DEM4\\DEM4_027#This control panel is a manual override for the alien life-support equipment.",
- "#DEM4\\DEM4_029#This lifeform appears to be intelligent, a new sentient race. There appear to be resemblances between it and the silotis, although the present forms are quite small and definitely nonsentient.",
- "#DEM4\\DEM4_030#Live long and prosper.",
- "#DEM4\\DEM4_031#Have you found the key?",
- "#DEM4\\DEM4_032#Our patience is exhausted! Now feel our wrath!",
- "#DEM4\\DEM4_033#There is no need for violence, Captain. We are a peaceful people.",
- "#DEM4\\DEM4_034#You found the key! I can now turn off the machinery creating our guardians, and no more sentients shall be at risk. Surely the Holy One smiles upon us all. I have no way to thank you, Captain, but please carry this request from my people to yours. We have much ancient knowledge we can share, and we would like to join your Federation. Go in peace.",
- "#DEM4\\DEM4_035#We look forward to meeting them. We also look forward to having discourse with the colonists. Farewell. May the Holy One bless you.",
- "#DEM4\\DEM4_036#A child? No, I see many differences. This must be what our people who did not slumber have become. Still, I would like to see these remains properly interred, according to the precepts of our religion. May I keep this?",
- "#DEM4\\DEM4_037#I see you have already shut off the machinery that creates the guardians. I have no way to thank you, Captain, but please carry this request from my people to yours. We have much ancient knowledge we can share, and we would like to join your Federation. Go in peace.",
- "#DEM4\\DEM4_038#Oh woe! Alas! The key is missing, I can do nothing! Even we will suffer the attacks of our own guardians unless the key can be found! I implore you, if you can help, please do so.",
- "#DEM4\\DEM4_039#So the Ferengi are not the only traders in the universe! Yes, Captain Kirk, excusing the settlers' debts is an excellent way of ensuring that our people will be friends.",
- "#DEM4\\DEM4_040#The demons, as you call them, are created by a machine designed to keep intruders away from our sleep chambers. It pulls from the minds of any approaching creature their most feared enemy and produces replicas to scare them away. For you and your crew it was Klingons, for the Tellarite a wolf-demon, and for the other Humans a demon from their religion. On behalf of my people, thank you for waking us. I will turn off the machinery which creates our guardians, so that they no longer bedevil those with whom we now share our home.",
- "#DEM4\\DEM4_041#There is no need for disrespect, intruder. Our race is old and powerful, wise in many things. Like our guardians, for example.",
- "#DEM4\\DEM4_042#Violence is hardly necessary, Captain Kirk. We owe you a debt for your service to us, and are more than willing to peacefully co-exist with your kind.",
- "#DEM4\\DEM4_043#We call ourselves Nauians. Thousands of years ago, we saw that meteor impacts were going to cause an Ice Age. We created this huge underground shelter to preserve our race, keeping us in suspended animation until the planet had recovered. We programmed the machinery to revive us at the next eclipse, but we did not count on the destruction of our moon.",
- "#DEM4\\DEM4_044#Welcome to our home. Thank you for repairing our Sonambutron.",
- "#DEM4\\DEM4_045#I do not think that would be a prudent action, sir.",
- "#DEM4\\DEM4_046#I'm just a security officer, sir.",
- "#DEM4\\DEM4_047#What is that?",
- "#DEM4\\DEM4N000#Dr. McCoy looks back.",
- "#DEM4\\DEM4N001#Ensign Everts is looking around.",
- "#DEM4\\DEM4N002#It appears to be an abstract piece of alien art.",
- "#DEM4\\DEM4N003#James T. Kirk, Captain of the Enterprise.",
- "#DEM4\\DEM4N004#Many alien machines fill the room.",
- "#DEM4\\DEM4N005#Spock is analyzing the alien machines.",
- "#DEM4\\DEM4N006#The alien emerged from this metal chamber.",
- "#DEM4\\DEM4N007#The alien is humanoid, with green reptilian skin. It appears unarmed.",
- "#DEM4\\DEM4N008#This appears to control some unusual security equipment.",
- "#DEM4\\DEM4N009#This floor contains conduits for conducting geothermal energy.",
- "#DEM4\\DEM4N010#This is where the panel should pop up.",
- "#DEM4\\DEM4N011#You meet your death at the hands of a race that could have been your ally. What a waste. Better luck next time.",
- "#DEM4\\DEM4N012#It looks like a control panel with slide switches.",
- "#DEM4\\DEM4N013#Nothing Happens.",
- "#DEM4\\DEM4N014#You fit the key into the slot, but you cannot find a way to turn it.",
-
-
- "#DEM5\\DEM5_001#Just thinking to myself. Don't mind me.",
- "#DEM5\\DEM5_002#Can you tell us what they looked like?",
- "#DEM5\\DEM5_003#It will be good to help them for a change.",
- "#DEM5\\DEM5_004#Not the good ones, that's for sure.",
- "#DEM5\\DEM5_005#The demons didn't follow you?",
- "#DEM5\\DEM5_006#I detect various pieces of mining equipment but nothing of note.",
- "#DEM5\\DEM5_007#May I suggest using a more diplomatic approach to questioning the colonists. Force will gain us little, if anything.",
- "#DEM5\\DEM5_008#Jim, that wouldn't be wise.",
- "#DEM5\\DEM5_009#Jim, these need to be processed first!",
- "#DEM5\\DEM5_010#This man is getting worse. We've got to find those berries before he dies.",
- "#DEM5\\DEM5_011#Jim, I've completed my study. I find no evidence for physical or mental disturbances among the colonists, causing them to see hallucinations. There must be other reasons for what these people are seeing.",
- "#DEM5\\DEM5_012#Jim, this man has suffered severe physical injuries to his head and arm. The wounds have been adequately cared for; however, he has developed the Nugaireyn infection. If not treated swiftly, the effects can be fatal. The infection can normally be treated with Hypo-Dytoxin, but there's none on the Enterprise.",
- "#DEM5\\DEM5_013#The alien's lifesigns seem stress-elevated. Otherwise he appears fundamentally healthy.",
- "#DEM5\\DEM5_014#The man is suffering moderately from the effects of his age, but seems healthy, alert, and in fine spirits.",
- "#DEM5\\DEM5_015#The man seems worried and stressed, but all body functions appear within normal limits.",
- "#DEM5\\DEM5_016#This man has recently suffered a nasty but non-life-threatening wound. The damage has been adequately cared for. The man's vital effects are attributable to shock and stress.",
- "#DEM5\\DEM5_017#This man needs help, Jim, and I wouldn't want to put it off for too long.",
- "#DEM5\\DEM5_018#By our standards yes. Here the Acolytes prefer a simpler life style; unfortunately, this is one of the consequences.",
- "#DEM5\\DEM5_019#Neither were some of my professors.",
- "#DEM5\\DEM5_020#So did I, but I became one anyway.",
- "#DEM5\\DEM5_021#The Acolytes did a lot of good work for the needy in this quadrant.",
- "#DEM5\\DEM5_022#Why, Spock, you two should get along fine, he sounds just like you.",
- "#DEM5\\DEM5_023#You know Jim, they can take a captain out of a starship, and a science officer out of his lab, but you can never retire a doctor.",
- "#DEM5\\DEM5_024#Captain, a Krognik-demon has a decidedly wolfish appearance. Brother Grisnash, is this not the traditional shape of the Evil One and his minions among Tellarites?",
- "#DEM5\\DEM5_025#I believe this may be significant, Captain.",
- "#DEM5\\DEM5_026#That is not logical, doctor.",
- "#DEM5\\DEM5_027#The medical methods of these people seem primitive to me, doctor.",
- "#DEM5\\DEM5_028#I am Brother Grisnash. I went up the mountainside in solitary prayer, seeking to face my fears. Indeed I found them. A bellowing Krognik-demon with sharp teeth and a long snout descended upon me in a rush of wind.",
- "#DEM5\\DEM5_029#It is.",
- "#DEM5\\DEM5_030#Brother Kandrey was -- is -- my partner. I was on the communications link when the demons caused the rockfall and silenced him. He said he'd found a strange door with devilish writing. Truly he came upon the Gate of Hell itself.",
- "#DEM5\\DEM5_031#You tread close to unholy knowledge, Brother Stephen!",
- "#DEM5\\DEM5_032#Ahh, I see you found the berries. Meet me in my lab.",
- "#DEM5\\DEM5_033#Good, you have found the berries. Bring them to my lab quickly.",
- "#DEM5\\DEM5_034#I am worried about Brother Chub. Can you examine him, Doctor?",
- "#DEM5\\DEM5_035#Please hurry Doctor. Brother Chub is looking worse.",
- "#DEM5\\DEM5_036#That's very nice, but I'm busy now.",
- "#DEM5\\DEM5_037#Those are Laraxian berries. They grow wild by the mine entrance.",
- "#DEM5\\DEM5_038#Time is of the essence, you must hurry and retrieve the berry.",
- "#DEM5\\DEM5_039#What an interesting artifact. Hmmm... It appears to have been damaged. When you have a chance, take it to my lab and we'll see if it can be repaired.",
- "#DEM5\\DEM5_040#I may be of some assistance. The Laraxian Berry grows near the mouth of the cave. If I could acquire it, I would be able to synthesize the Hypo-Dytoxin from the berry. Unfortunately, the demons prevent us from approaching the cave entrance. perhaps you could retrieve it for me.",
- "#DEM5\\DEM5_041#I am Brother Stephen, an Ignaciate, following the holy teachings with mind and soul alike. I believe the anomalous mineral readings, in combination with evidence of ancient disturbances in this otherwise highly stable geologic location indicates previous habitation of the region, eons ago.",
- "#DEM5\\DEM5_042#I appreciate your prayers, Brother Roberts. Captain, if you and your people go up the mountain, I hope afterward you will visit me in my study, which is next door. I am too old to make the trek myself, but I am eager for knowledge. In return, I will offer you what insights our God grants these old eyes.",
- "#DEM5\\DEM5_043#I would be equally honored to discuss medicine with you, Doctor, as science with your Vulcan associate. Let me continue. I believe our God made humans, aliens -- and demons all. If I could get a real demon into my study, I would bless our God for the opportunity, as I thank Him for everything in this life.",
- "#DEM5\\DEM5_044#My mom wanted me to become a doctor. Honest. But I hated my biology classes.",
- "#DEM5\\DEM5_045#My uncle John lived with the Acolytes a long time ago. He died in their service, helping plague victims on New Ontario VI twenty years ago.",
- "#DEM5\\DEM5L027#Thank you. You are most kind.",
- "#DEM5\\DEM5L028#You'll understand if I don't stand up, I hope. I am not well.",
- "#DEM5\\DEM5L029#I headed up the party that sought to rescue Brother Kandrey. Without warning, the demons appeared and attacked us as we approached the mine!",
- "#DEM5\\DEM5L030#Like the demons that have plagued devout folk since before our people left the Earth. Huge muscular demons, with ruddy skin. Truly the manifestation of Evil, with batwings, horns and talons, and a pointed tail. God preserve us all. One tore open my arm and I surely would have perished -- but for my companions who bore me back down the mountain.",
- "#DEM5\\DEM5L031#No.",
- "#DEM5\\DEM5N000#A chapel typical of the Acolytes of the Stars.",
- "#DEM5\\DEM5N001#A grim-faced miner-colonist nods curtly at you.",
- "#DEM5\\DEM5N002#A majestic view of Mt. Idyll can be seen through the skylight.",
- "#DEM5\\DEM5N003#A sturdy man of advanced years, whose blue eyes meet yours with clarity, curiosity, and directness.",
- "#DEM5\\DEM5N004#Boxes of supplies and mining equipment litter the floor.",
- "#DEM5\\DEM5N005#Ensign Everts cannot take his eyes off the sight of Mount Idyll.",
- "#DEM5\\DEM5N006#James Kirk takes time to rest and ponder the remainder of the mission.",
- "#DEM5\\DEM5N007#McCoy looks anxiously about the room.",
- "#DEM5\\DEM5N008#Spock waits for your command, patient as ever.",
- "#DEM5\\DEM5N009#The Tellarite appears completely at home surrounded by humans, but the wrinkling on his brow indicates a great deal of worry.",
- "#DEM5\\DEM5N010#He is too busy consoling the wounded man.",
- "#DEM5\\DEM5N011#He is too busy consoling the wounded man.",
- "#DEM5\\DEM5N012#They are too heavy to move.",
- "#DEM5\\DEM5N013#This man is in no condition to talk.",
-
-
- "#DEM6\\DEM6_001#Looks like a pile of junk if you ask me.",
- "#DEM6\\DEM6_002#Well, what happens next?",
- "#DEM6\\DEM6_003#Where did you find all this?",
- "#DEM6\\DEM6_004#Mr. Spock, See what you can dig up from that old fashioned computer terminal.",
- "#DEM6\\DEM6_005#Mr. Spock, see what you can do about that hand.",
- "#DEM6\\DEM6_006#Yes, tell us about these things.",
- "#DEM6\\DEM6_007#A vintage 801286 of the mid-21st century. It is a fine museum piece.",
- "#DEM6\\DEM6_008#Fascinating, Captain. It is an Ardak-4 molecular synthesizer. A museum piece in perfect working order.",
- "#DEM6\\DEM6_009#Residue of several different compounds are in the tubes. None of the compounds would explain the sightings.",
- "#DEM6\\DEM6_010#A completely ordinary nickel-iron meteorite.",
- "#DEM6\\DEM6_011#A manufactured vanadium-tungsten alloy of considerable age and indeterminate use.",
- "#DEM6\\DEM6_012#A sample of a local lifeform called a siloti, the largest animal reported on this planet. About the size of an Earth housecat, the silotis have an insectoid-reptilian genotype with praying mantis like forelimbs.",
- "#DEM6\\DEM6_013#A variety of rock specimens, including native silver, azurite, crystalline forms of various minerals.",
- "#DEM6\\DEM6_014#Captain, this appears to be a model of the Earth. Notice how it models the proper situation for a total eclipse?",
- "#DEM6\\DEM6_015#Do I look like a pointy eared, green blooded, know-it-all alien?",
- "#DEM6\\DEM6_016#He's in fine physical and mental condition, Jim.",
- "#DEM6\\DEM6_017#Jim, that would destroy the glass case!",
- "#DEM6\\DEM6_018#We've got to get this to brother Chub as quickly as possible, Jim!",
- "#DEM6\\DEM6_019#I think we should wait and talk to the owner when he comes back, Jim.",
- "#DEM6\\DEM6_020#This place looks real comfortable, a place to combine work and contemplation. The man's got an eye for the beauty of useful things, and the use of beautiful things. I think we could get along fine.",
- "#DEM6\\DEM6_021#Fossil shells in limestone substrate, compatible with local geologic features.",
- "#DEM6\\DEM6_022#I feel like this is delicate as surgery, Captain, but I've got it back in working order now.",
- "#DEM6\\DEM6_023#I read a collection of small items of no evident value. I would characterize this as a small museum display, Captain.",
- "#DEM6\\DEM6_024#This machinery is delicate but I have managed to repair the circuitry.",
- "#DEM6\\DEM6_025#This study represents a man with a keen mind, Captain. To judge by what I see, there is little which does not interest him. The equipment is antiquated, but practical.",
- "#DEM6\\DEM6_026#Fascinating, these berries can be used to synthesize Hypo-Dytoxin.",
- "#DEM6\\DEM6_027#The settings on the Ardak-4 have already been adjusted. Simply place the berry in the machine and the Hypo-Dytoxin will be synthesized.",
- "#DEM6\\DEM6_028#There is no need to threaten me if you need to use my study.",
- "#DEM6\\DEM6_029#Bless you for returning my things.",
- "#DEM6\\DEM6_030#Everything of this world is secondary to the perfection of the next, Captain.",
- "#DEM6\\DEM6_031#Here and there. Much of it was brought to me by others exploring widely.",
- "#DEM6\\DEM6_032#How interesting! Praise God for this opportunity. He brings me through you.",
- "#DEM6\\DEM6_033#I believe this is evidence of the cataclysm which destroyed the moon of Pollux V eons past. I've constructed a theoretical model based on analysis of the planet's ring of what things might have been like. I think that the moon, like Earth's moon, would have made a total eclipse of the sun possible. I would have liked to have seen that, for conditions making a perfect total eclipse are rare in the Universe. Our God creates great wonders.",
- "#DEM6\\DEM6_034#I enjoy talking about these treasures.",
- "#DEM6\\DEM6_035#I never dreamed that Starfleet would be interested in my discoveries, Captain, but our God often surprises us.",
- "#DEM6\\DEM6_036#One of the oldest forms I've seen on this planet. Our God makes beautiful things, indeed.",
- "#DEM6\\DEM6_037#See how the fingertips have microsized sensors? I wonder what use they may have.",
- "#DEM6\\DEM6_038#The skull of a modern siloti, the largest creature native to this planet, about the size of a housecat from Earth. The silotis combine a rather insectoid pattern with four-legged reptilian form including praying mantis-like forelimbs.",
- "#DEM6\\DEM6_039#This chunk of rock is a greatly weathered example of a vanadium-tungsten alloy -- which doesn't occur naturally. It is my best evidence that the area was previously inhabited.",
- "#DEM6\\DEM6_040#True curiosities, nothing more. I think they're very pretty, don't you?",
- "#DEM6\\DEM6_041#Very well. I can't imagine why, but if you have a further interest in any of this, take what you like. But please remember to return my treasures when you are done with them.",
- "#DEM6\\DEM6_042#Welcome to my study! Feel free to look around. My medical and scientific equipment is surely not so sophisticated as you are accustomed to, but if there is anything you wish to use, please feel free. Also, I would be interested in anything you might have to show me.",
- "#DEM6\\DEM6_043#What a fascinating piece of equipment! Highly advanced technology. You see here, it seems to have been damaged, however. Take it to my workbench and let's see if it can be repaired. I fear my hands are too shaky to perform such fine work, but perhaps one of you can do it.",
- "#DEM6\\DEM6_044#You are interested in my little museum of curiosities?",
- "#DEM6\\DEM6_045#Mineral Specimens,",
- "#DEM6\\DEM6_046#Meteorite,",
- "#DEM6\\DEM6_047#Fossil Shells,",
- "#DEM6\\DEM6_048#Skull of a small alien animal,",
- "#DEM6\\DEM6_049#Twist of Metal,",
- "#DEM6\\DEM6_050#or would you rather move on to something else?",
- "#DEM6\\DEM6_051#Shall I go into...",
- "#DEM6\\DEM6_052#I believe Mr. Spock would be more helpful with this, sir.",
- "#DEM6\\DEM6_053#I wonder if any of this stuff might be useful.",
- "#DEM6\\DEM6N000#A common-looking meteorite, about the size of a fist.",
- "#DEM6\\DEM6N001#A glass-fronted display of mineral specimens including a meteorite, a few fossil shells, the skull of a cat-sized alien animal, and a very encrusted twist of metal.",
- "#DEM6\\DEM6N002#A majestic view of Mt. Idyll can be seen through the skylight.",
- "#DEM6\\DEM6N003#A multi-purpose work space, with fine, well-worn tools and equipment close at hand.",
- "#DEM6\\DEM6N004#An antiquated molecular synthesizer sits in the corner.",
- "#DEM6\\DEM6N005#An old corroded twist of metal.",
- "#DEM6\\DEM6N006#An old-fashioned computer. It appears to have some type of simulation running.",
- "#DEM6\\DEM6N007#Assorted pieces of glass rest on this table, from ancient beakers, to double burners.",
- "#DEM6\\DEM6N008#Captain Kirk wonders what is going to happen on this mission.",
- "#DEM6\\DEM6N009#Dr. McCoy is glad that he is in a warm, heated room.",
- "#DEM6\\DEM6N010#Ensign Everts finds himself fascinated by the Acolytes and their planet.",
- "#DEM6\\DEM6N011#Fossil shells of esthetic interest.",
- "#DEM6\\DEM6N012#It is locked.",
- "#DEM6\\DEM6N013#It opens.",
- "#DEM6\\DEM6N014#It opens.",
- "#DEM6\\DEM6N015#Mr. Spock finds the scientific equipment in this room to be rather primitive.",
- "#DEM6\\DEM6N016#Pretty rock specimens.",
- "#DEM6\\DEM6N017#The braincase of a small creature, looking slightly insectoid, somewhat reptilian.",
- "#DEM6\\DEM6N018#The mechanism in the hand has already been repaired.",
- "#DEM6\\DEM6N019#The old man carefully returns the items to his cabinet.",
- "#DEM6\\DEM6N020#You tinker with it but do nothing significant.",
- "#DEM6\\DEM6N021#Brother Stephen watches patiently as you examine his study.",
- "#DEM6\\DEM6N022#The glass case is locked.",
- "#DEM6\\DEM6N023#The machine synthesizes a quantity of Hypo-Dytoxin.",
- "#DEM6\\DEM6N024#This appears to be a study and lab. The equipment looks very ancient.",
-
-
- "#TUG0\\TUG0_001#I'm going to have a word for you, Spock, if we appear inside the door!",
- "#TUG0\\TUG0_002#Analysis, Lt. Christensen",
- "#TUG0\\TUG0_003#Beam us out of here.",
- "#TUG0\\TUG0_004#Bones, later. Kirk to Enterprise.",
- "#TUG0\\TUG0_005#Can they be repaired, Spock?",
- "#TUG0\\TUG0_006#Get what you can from this area -- let's get moving.",
- "#TUG0\\TUG0_007#I can't see them winning any popularity contests, Bones.",
- "#TUG0\\TUG0_008#I've always been a gambler, Spock. Figure out what you'll need.",
- "#TUG0\\TUG0_009#Let's not look too far ahead, Mr. Spock.",
- "#TUG0\\TUG0_010#Mr. Spock, you're a genius!",
- "#TUG0\\TUG0_011#Okay, but let's not stay too long in one place.",
- "#TUG0\\TUG0_012#Provided the Elasi don't have anything to say about it.",
- "#TUG0\\TUG0_013#Spock, we don't have two days. If we can repair the transporter, we might be able to transport onto the bridge and capture the Elasi.",
- "#TUG0\\TUG0_014#Captain, I need to find a bit that will fit into the transmogrifier before I can go further with this.",
- "#TUG0\\TUG0_015#Even our most efficient Chief Engineer Scott would have trouble repairing this damage in less than two days.",
- "#TUG0\\TUG0_016#Damn it, Jim. I'm a doctor, not a rocket scientist.",
- "#TUG0\\TUG0_017#He will be all right, but we shouldn't move him.",
- "#TUG0\\TUG0_018#He's not hurt badly. I can revive him.",
- "#TUG0\\TUG0_019#I don't think he should be moved, Jim.",
- "#TUG0\\TUG0_020#Well, at least I'm not picking up residue of any biological weapons. The Elasi used some restraint if you can call it that.",
- "#TUG0\\TUG0_021#And any hostages on the bridge will be killed when the bomb goes off! No, Jim, that's inhuman!",
- "#TUG0\\TUG0_022#I wouldn't go that far, Jim. But I do have to congratulate you, Mr. Spock. Now we can really risk shooting our atoms around the universe. Is this really necessary, Jim?",
- "#TUG0\\TUG0_023#My God Jim, what have you done! You killed them all. You probably blew up the whole damn bridge.",
- "#TUG0\\TUG0_024#They can forget about my vote.",
- "#TUG0\\TUG0_025#Well Jim, there's one thing I can tell you -- I don't like Elasi.",
- "#TUG0\\TUG0_026#Well, with any luck, you won't have to worry about that for quite some time.",
- "#TUG0\\TUG0_027#You cold blooded emotionless...",
- "#TUG0\\TUG0_028#I am registering energy residue from phaser fire and phaser grenade detonations. There are readings of another energy weapon, but the type is unknown.",
- "#TUG0\\TUG0_029#I attach these here... Now all I need is a spare length of wiring.",
- "#TUG0\\TUG0_030#I believe this would be in Dr. McCoy's field of expertise.",
- "#TUG0\\TUG0_031#I strongly recommend that we keep our silence, Captain. The Elasi are quite capable of tracing any communication from within this vessel.",
- "#TUG0\\TUG0_032#I think that does it -- a Comb Bit for the transmogrifier. Now I can continue repairs on the transporter controls. ",
- "#TUG0\\TUG0_033#I'll be able to use this later, so I want to keep it -- but I need to get some equipment in here first.",
- "#TUG0\\TUG0_034#The bits are not long enough, I need a longer piece of wire.",
- "#TUG0\\TUG0_035#The parts fit together satisfactorily.",
- "#TUG0\\TUG0_036#Captain, a thorough analysis is required.",
- "#TUG0\\TUG0_037#Captain, the ship will crash into the planet in 18.32 seconds, I would recommend, leaving the ship immediately.",
- "#TUG0\\TUG0_038#I can attempt to jury-rig repairs if I can find parts. However, there is only a 67.357 percent probability of success.",
- "#TUG0\\TUG0_039#The controls are set for just inside the bridge door Captain.",
- "#TUG0\\TUG0_040#The controls have been virtually destroyed, Captain.",
- "#TUG0\\TUG0_041#To say nothing of the possible damage to the bridge controls.",
- "#TUG0\\TUG0_042#When this operation is complete, Captain, we should have Mr. Scott or Transporter Chief Kyle come here to assist with the repairs.",
- "#TUG0\\TUG0_043#With chief Engineer Scott's assistance, I believe we could get them in perfect working order in two days.",
- "#TUG0\\TUG0_F30#I suppose I should be grateful to see anyone after that. I thought I was dead.",
- "#TUG0\\TUG0_F31#Thank you, Doctor. Be careful, Captain, the Elasi like to set boobytraps. if you need any equipment I've got my tools in this workspace.",
- "#TUG0\\TUG0_S06#Aye Captain.",
- "#TUG0\\TUG0_S11#Captain, you're alive!",
- "#TUG0\\TUG0L006#This is just like their raid on Damocles Station, hard, fast, and dirty.",
- "#TUG0\\TUG0L008#If we could get past the forcefield on the door of the bridge, we should be able to surprise them for sure.",
- "#TUG0\\TUG0L009#Security analysis, sir: if we transport onto the bridge, we'll have the drop on them -- assuming Mr. Spock has the transporter working porperly.",
- "#TUG0\\TUG0L010#Since we have a bomb, Captain, we could rearm it, transport it onto the bridge, and perhaps the Elasi will flee into the hallway. Then we could capture them.",
- "#TUG0\\TUG0N000#A Runcinate Transmogrifier: An engineering tool used in the maintainance of transporters, which can be fitted with bits having a variety of irregularly serrated surfaces.",
- "#TUG0\\TUG0N001#A small bomb appears to have damaged the transporter controls.",
- "#TUG0\\TUG0N002#Crewman Simpson.",
- "#TUG0\\TUG0N003#James T. Kirk cautiously watches the area.",
- "#TUG0\\TUG0N004#Lieutenant Christensen stands ready.",
- "#TUG0\\TUG0N005#McCoy wonders how many patients he'll have on this mission.",
- "#TUG0\\TUG0N006#Phaser Welder is now charged.",
- "#TUG0\\TUG0N007#Spock quietly analyzes the damaged areas of this transporter room.",
- "#TUG0\\TUG0N008#The cabinet is empty.",
- "#TUG0\\TUG0N009#The transporter bay has been damaged in a recent fire fight.",
- "#TUG0\\TUG0N010#The wire scraps are too small, they melt instead of fusing together, and you're left with nothing. ",
- "#TUG0\\TUG0N011#These doors have been scarred by phaser fire. There was a battle here.",
- "#TUG0\\TUG0N012#These transporter controls are now operational. They are set for just inside the bridge door.",
- "#TUG0\\TUG0N013#This is the main transporter pad of the Masada.",
- "#TUG0\\TUG0N014#This man was obviously the transporter engineer. He is unconscious, but alive.",
-
-
- "#TUG1\\TUG1_001#This is a mess now, isn't it?",
- "#TUG1\\TUG1_002#A forcefield of unusual configurations has been erected in front of the doorway which leads into the bridge. I don't think it would be healthy to approach too closely, Captain.",
- "#TUG1\\TUG1_003#I'm getting life readings both on the bridge and in the brig, Jim.",
- "#TUG1\\TUG1_004#Jim, I can only perform medical miracles not engineering ones.",
- "#TUG1\\TUG1_005#Jim, I'm picking up 11 life forms in the brig. That accounts for over half the crew. I don't like what that indicates.",
- "#TUG1\\TUG1_006#Nothing unusual is detected.",
- "#TUG1\\TUG1_007#The force field is interfering too much to get an accurate reading, Jim.", // TYPO
- "#TUG1\\TUG1_008#My daddy would have sent me to bed without supper if I'd done something like this.",
- "#TUG1\\TUG1_009#Five phasers without power packs, a drained phaser welder, insulation and bits of wire, and droplets of cooled molten metal.",
- "#TUG1\\TUG1_010#I don't think we can bring down that forcefield, Captain. If we could, though, it might be less risky than trying to transport onto the bridge.",
- "#TUG1\\TUG1_011#I strongly recommend that we keep our silence, Captain. The Elasi are quite capable of tracing any communication from within this vessel.",
- "#TUG1\\TUG1_012#I think that does it -- a Comb Bit for the transmogrifier. Now I can continue repairs on the transporter controls. ",
- "#TUG1\\TUG1_013#If we could find a point to interrupt the flow of power to the field we could gain access to the bridge, Captain.",
- "#TUG1\\TUG1_014#Strong electromagnetic readings come from the doorway at the far end of the hallway.",
- "#TUG1\\TUG1_015#That did it. The field is deactivated, Captain.",
- "#TUG1\\TUG1_016#The field is absorbing the energy.",
- "#TUG1\\TUG1_017#he parts fit together satisfactorily.",
- "#TUG1\\TUG1_018#Tricorder readings indicate an indeterminate number of people in the brig. At least 2 are armed with phasers. I recommend caution when entering.",
- "#TUG1\\TUG1L000#I doubt that our phasers could get through that, Captain.",
- "#TUG1\\TUG1L005#This corridor provides access to the transporter room, Captain. It is secure.",
- "#TUG1\\TUG1N000#A tangle of mangled equipment, reduced to junk. There are the remains of five phasers without power packs, a drained phaser welder, and scraps of wire and uncertain bits of metal junk.",
- "#TUG1\\TUG1N001#According to the deckplans of this class of Starship, this is the entrance to the ship's brig.",
- "#TUG1\\TUG1N002#Lt. Christensen is carefully watching the hallway",
- "#TUG1\\TUG1N003#McCoy is fidgeting around.",
- "#TUG1\\TUG1N004#Phaser Welder is now charged.",
- "#TUG1\\TUG1N005#Some kind of forcefield appears to cover the door. ",
- "#TUG1\\TUG1N006#Spock is analyzing the surroundings.",
- "#TUG1\\TUG1N007#The field has already been deactivated.",
- "#TUG1\\TUG1N008#The field has already been deactivated",
- "#TUG1\\TUG1N009#The wire scraps are too small, they melt instead of fusing together, and you're left with nothing. ",
- "#TUG1\\TUG1N010#This viewscreen/ communication terminal has been damaged beyond repair.",
- "#TUG1\\TUG1N011#Twisted debris has been scattered along the side of the corridor.",
- "#TUG1\\TUG1N013#You are in a typical starship corridor.",
-
-
- "#TUG2\\TUG2_001#My God, what have we done?",
- "#TUG2\\TUG2_002#They've turned this freighter into a prison barge.",
- "#TUG2\\TUG2_003#Spock see if you can disarm this.",
- "#TUG2\\TUG2_004#A medium strength phaser bomb. The brig force field would contain the explosion but it would kill the crew members within the cell. I recommend that we find a way of disarming it, Captain.",
- "#TUG2\\TUG2_005#All of the crewmen are dead, Captain.",
- "#TUG2\\TUG2_006#Captain, if we could manage to overload the forcefield, it would probably detonate the bomb before we could rescue the crewmen.",
- "#TUG2\\TUG2_007#Captain, the switch has been booby-trapped to detonate a bomb, presumably inside the brig somewhere.",
- "#TUG2\\TUG2_008#Captain, this wiring may prove useful in repairing the transporter.",
- "#TUG2\\TUG2_009#Damn it, Jim, I'm a doctor, not an electrical engineer! I'm likely to blow us all up.",
- "#TUG2\\TUG2_010#I don't like the looks of this, Jim.",
- "#TUG2\\TUG2_011#I don't operate on bombs, Jim, unless you like big explosions.",
- "#TUG2\\TUG2_012#I don't think he is in any shape to respond.",
- "#TUG2\\TUG2_013#I don't think he is in any shape to respond.",
- "#TUG2\\TUG2_014#I don't think it would be a good idea to wake them up, Jim.",
- "#TUG2\\TUG2_015#The crew is tired and has elevated signs from extreme stress, but they will survive.",
- "#TUG2\\TUG2_016#The pirates won't wake for a while, but they are going to be quite unhappy when they do. I recommend that we not be here when they awake.",
- "#TUG2\\TUG2_017#These aren't the right tools for the right job, Jim.",
- "#TUG2\\TUG2_018#We came here to save these people, now look what we've done!",
- "#TUG2\\TUG2_019#They're all dead, Jim. What in God's name were you thinking?",
- "#TUG2\\TUG2_020#I see that the Elasi live up to their reputation, Captain.",
- "#TUG2\\TUG2_021#The parts fit together satisfactorily.",
- "#TUG2\\TUG2_022#I believe that no diety had any bearing on this doctor, but the Captain should have been more careful. Starfleet will not be pleased by their deaths.",
- "#TUG2\\TUG2_023#I'll do my best, Captain.",
- "#TUG2\\TUG2_024#There. I believe the bomb is now defused, Captain.",
- "#TUG2\\TUG2_025#I'm on your side, Sir! There's no need to fire at me.",
- "#TUG2\\TUG2_026#Thank you for freeing us. You'd better take the bridge before they suspect anything is up.",
- "#TUG2\\TUG2_027#You'd better hurry up or they'll catch on, Sir!",
- "#TUG2\\TUG2_028#But if you used a charged Phaser Welder two feet to the left of the door and one foot off the ground, you might be able to shut down the forcefield, and get a jump on the Elasi.",
- "#TUG2\\TUG2_029#Thank you for freeing us, Captain! We'll secure the area so they don't come up behind you.",
- "#TUG2\\TUG2_030#We've had electrical problems with our door to our bridge, Captain. The Elasi don't know we put in an electric shutdown device -- you'd never find it by chance.",
- "#TUG2\\TUG2_112#I think that does it -- a Comb Bit for the transmogrifier. Now I can continue repairs on the transporter controls. ",
- "#TUG2\\TUG2J000#Ouch! That hurt!",
- "#TUG2\\TUG2J001#Don't you know any better?",
- "#TUG2\\TUG2J002#What kind of idiot are you?",
- "#TUG2\\TUG2J003#I recommend extreme caution, Captain. We must be ready to expect anything.",
- "#TUG2\\TUG2L002#I'm just a security officer, sir.",
- "#TUG2\\TUG2L004#It's my fault. They did the same thing on Damocles Station... ",
- "#TUG2\\TUG2L007#I believe I can disarm this, Captain.",
- "#TUG2\\TUG2L011#There, It's defused.",
- "#TUG2\\TUG2L085#Hey, what are you doing here?",
- "#TUG2\\TUG2L086#You imperialist Federation scum! We will never surrender! Cereth is a great man with a great vision. I spit upon you.",
- "#TUG2\\TUG2N000#A bomb located just inside the forcefield.",
- "#TUG2\\TUG2N001#He doesn't look to friendly.",
- "#TUG2\\TUG2N002#Kirk falls to the floor stunned.",
- "#TUG2\\TUG2N003#Kirk seems concerned by what he sees in this room.",
- "#TUG2\\TUG2N004#Lt. Christensen is fumbling for his phaser",
- "#TUG2\\TUG2N005#McCoy is looking at the guards.",
- "#TUG2\\TUG2N006#Phaser Welder is now charged.",
- "#TUG2\\TUG2N007#Spock raises an eyebrow.",
- "#TUG2\\TUG2N009#The wire scraps are too small, they melt instead of fusing together, and you're left with nothing. ",
- "#TUG2\\TUG2N010#These wires look like a modification of some sort.",
- "#TUG2\\TUG2N011#This appears to be the button that turns the brig forcefield on and off.",
- "#TUG2\\TUG2N012#This door leads back to the main corridor.",
- "#TUG2\\TUG2N013#This guard is stunned.",
- "#TUG2\\TUG2N014#This guard is stunned.",
- "#TUG2\\TUG2N015#This guard is tied up.",
- "#TUG2\\TUG2N016#This guard is tied up.",
- "#TUG2\\TUG2N017#You are in the brig of the Masada. Nine of the crew members are held in the cell. The berets of two dead Elasi guards litter the floor.",
- "#TUG2\\TUG2N018#You are in the brig of the Masada. Nine of the crew members are held in the cell. Two Elasi guards lie on the floor.",
- "#TUG2\\TUG2N019#You are in the brig of the Masada. The cell contains the smoldering remains of nine crew members. The berets of two dead Elasi guards litter the floor.",
- "#TUG2\\TUG2N020#You are in the brig of the Masada. The cell contains the smoldering remains of nine crew members. Two Elasi guards lie on the floor.",
- "#TUG2\\TUG2N021#You are in the brig of the Masada. The cell is open freeing the nine crew members. Two Elasi guards lie on the floor.",
- "#TUG2\\TUG2N022#You are in the brig of the Masada. The cell is open freeing the nine crew members. The hats of two dead Elasi guards litter the floor.",
- "#TUG2\\TUG2N023#You are in the brig of the Masada.",
- "#TUG2\\TUG2N024#You can't. it is located just inside the forcefield.",
- "#TUG2\\TUG2N025#You have been taken captive by Elasi Cereth, and you know Starfleet does not negotiate with terrorists. As you look forward to a long captivity, you wonder who will take over command of the Enterprise. Better luck next time.",
- "#TUG2\\TUG2N026#You've set off some type of booby trap. The force field protected you from the blast, but everyone inside the brig is dead.",
- "#TUG2\\TUG2N037#He doesn't look to friendly.",
- "#TUG2\\TUG2N106#Only the red beret of the elasi guard remains.",
- "Snip...snip...snip.",
-
-
- "#TUG3\\TUG3_001#Scotty, beam down a security team to the bridge. We have regained control.",
- "#TUG3\\TUG3_002#Check and mate, Elasi. Don't do anything foolish.",
- "#TUG3\\TUG3_003#Freeze, don't even think about it.",
- "#TUG3\\TUG3_004#It's over, Cereth. Surrender and I'll guarantee the lives of you and your crew.",
- "#TUG3\\TUG3_005#Mr. Scott, beam us out of here.",
- "#TUG3\\TUG3_006#Mr. Scott, get us out of here.",
- "#TUG3\\TUG3_007#Mr. Sulu, we need some help over here.",
- "#TUG3\\TUG3_008#Captain, I highly recommend returning to the Enterprise within the next 57.32 seconds.",
- "#TUG3\\TUG3_009#Captain, I recommend that Mr. Sulu stabilize the Masada's orbit from the Enterprise.",
- "#TUG3\\TUG3_011#I think we should return to the Enterprise before we burn up, Jim.",
- "#TUG3\\TUG3_012#I'm a doctor, not a space jockey! Talk to Mr. Sulu about fixing our orbit!",
- "#TUG3\\TUG3_013#Jim, that man is mad.",
- "#TUG3\\TUG3_015#Aye, Captain, using prefix code override to stabilize Masada's orbit. Sulu out.",
- "#TUG3\\TUG3_F27#Foolhardy words, Kirk. You have underestimated me at every turn.",
- "#TUG3\\TUG3_S07#Aye, Captain.",
- "#TUG3\\TUG3_S08#Aye, Captain.",
- "#TUG3\\TUG3L003#I'm just a security officer, sir.",
- "#TUG3\\TUG3L080#A blow struck for freedom, Captain. Now I surrender.",
- "#TUG3\\TUG3L081#Bridge to brig, kill the hostages!",
- "#TUG3\\TUG3L083#I still have a gambit or two left, my friend.",
- "#TUG3\\TUG3L084#You are an honorable and worthy opponent, Kirk. I accept your offer.",
- "#TUG3\\TUG3N000#Dr. McCoy appears a bit restless.",
- "#TUG3\\TUG3N001#Lt. Christensen is carefully observing Elasi.",
- "#TUG3\\TUG3N002#Spock is analyzing the surroundings.",
- "#TUG3\\TUG3N003#The body of Elasi Cereth lies on the ground.",
- "#TUG3\\TUG3N004#The body of the Elasi clanmember lies on the ground here.",
- "#TUG3\\TUG3N005#The Elasi clanmember glares at the party.",
- "#TUG3\\TUG3N006#The Masada goes down in a fireball over Beta Myamid, with you on it. Better luck next season.",
- "#TUG3\\TUG3N007#This is a standard Starfleet bridge, perhaps not as impressive as the one on the Enterprise. There are quite a few pirates here.",
- "#TUG3\\TUG3N008#You carefully eye the chief lieutenant of the Elasi Clan, Elasi Cereth.",
-
-
- "#LOV0\\LOV0_001#A medical data file is attached -- your bailiwick, Bones.",
- "#LOV0\\LOV0_002#Spock, check out the station's computer and see what you can dig up.",
- "#LOV0\\LOV0_003#Strange that the bridge is empty. Stay sharp everyone. The station's computer system might give us some answers.",
- "#LOV0\\LOV0_004#Gentlemen, I think we have more pressing problems.",
- "#LOV0\\LOV0_005#Doctor, you may be interested in the medical data file appended to the log.",
- "#LOV0\\LOV0_006#I'm picking up some strange, airborne virus. I can't identify it without more information.",
- "#LOV0\\LOV0_007#Nice view of the Romulan ship. How comforting.",
- "#LOV0\\LOV0_008#Except for the Oroborus virus, I'm not picking up anything unusual.",
- "#LOV0\\LOV0_009#Jim, there is an appended medical database online. Also, it would be useful for me to experiment on how the virus grows in the presence of different gases. I'm sure the station has the necessary equipment.",
- "#LOV0\\LOV0_010#Ouch!",
- "#LOV0\\LOV0_011#Hee hee hee hee...",
- "#LOV0\\LOV0_012#I think we're all feeling just woooonderful!",
- "#LOV0\\LOV0_013#I'm a little teapot short and stout...",
- "#LOV0\\LOV0_014#I'm floating up and up and up...",
- "#LOV0\\LOV0_015#I'm so happy, I want to hug the world!",
- "#LOV0\\LOV0_016#Ooka! Ooka! Ooka!",
- "#LOV0\\LOV0_017#Row, row, row, your boat. Aww, come on Spock.",
- "#LOV0\\LOV0_019#Spock, ol' buddy, ol' friend, you look soo funny standing there!",
- "#LOV0\\LOV0_020#The hills are alive... With the sounds of...",
- "#LOV0\\LOV0_021#The moon in June's a boon to tunes... er, something like that.",
- "#LOV0\\LOV0_022#This is how I want to feel all the time!",
- "#LOV0\\LOV0_023#Now listen here, you pointy-eared...",
- "#LOV0\\LOV0_024#Now that's interesting -- there's more here. All of Dr. Marcus' research data on the Oroborous virus. Let me see...virus growth patterns, pneumonococcal mimic affecting Romulo-Vulcan genotype ... alveoli involvement in-- Boy, Jim, this bug works fast!",
- "#LOV0\\LOV0_025#How many Admirals does it take to wire in a logic transmogrifier?",
- "#LOV0\\LOV0_026#I don't believe you'd behave like this if you could avoid it.",
- "#LOV0\\LOV0_027#Nothing unusual here, Captain, though the station's computer may be able to tell us something.",
- "#LOV0\\LOV0_028#Nothing unusual is detected.",
- "#LOV0\\LOV0_029#Please, gentlemen, try to control yourselves",
- "#LOV0\\LOV0_030#That is not logical, Captain.",
- "#LOV0\\LOV0_031#The main computer banks of the Ark7. It looks like someone has recently been rummaging through the main data banks.",
- "#LOV0\\LOV0_033#Try taking deep breaths to clear your heads.",
- "#LOV0\\LOV0_035#Is this really the time to catch up on your reading, Doctor?",
- "#LOV0\\LOV0_036#I think Mr. Spock would be more qualified in examining the station's computer.",
- "#LOV0\\LOV0_037#A detailed data file is with the log. Do you want to look at it, Doctor McCoy?",
- "#LOV0\\LOV0_038#This is a very dangerous situation, sir. We should proceed with caution.",
- "#LOV0\\LOV0_039#Hee hee hee hee...",
- "#LOV0\\LOV0_040#I think we're all feeling just woooonderful!",
- "#LOV0\\LOV0_041#I'm a little teapot short and stout...",
- "#LOV0\\LOV0_042#I'm floating up and up and up...",
- "#LOV0\\LOV0_043#I'm so happy, I want to hug the world!",
- "#LOV0\\LOV0_045#Ooka! Ooka! Ooka!",
- "#LOV0\\LOV0_046#Row, row, row, your boat. Aww, come on Spock.",
- "#LOV0\\LOV0_047#Spock, ol' buddy, ol' friend, you look soo funny standing there!",
- "#LOV0\\LOV0_048#The hills are alive... With the sounds of...",
- "#LOV0\\LOV0_049#The moon in June's a boon to tunes... er, something like that.",
- "#LOV0\\LOV0_050#This is how I want to feel all the time!",
- "#LOV0\\LOV0_101#Fascinating. I am experiencing an urge to laugh.",
- "#LOV0\\LOV0_102#I am a Vulcan. I must resist these unchecked emotions.",
- "#LOV0\\LOV0_103#Logic... What happened to my logic?", // TYPO
- "#LOV0\\LOV0_104#Jim, is this how you feel on shore leave?",
- "#LOV0\\LOV0_105#I remember my mother trying to tell me jokes when I was a child. Now, I finally understand them.",
- "#LOV0\\LOV0_106#Romulan laughing gas. My father would never approve.",
- "#LOV0\\LOV0_107#Why do they call you \"Bones\", doctor?",
- "#LOV0\\LOV0_124#I'm trying to be patient, Captain.",
- "#LOV0\\LOV0N000#A Romulan bird of prey hovers menacingly on the view screen.",
- "#LOV0\\LOV0N001#It is bolted down and cannot be moved.",
- "#LOV0\\LOV0N002#James Kirk watches the Romulan ship with concern.",
- "#LOV0\\LOV0N003#Lt. Ferris watches the exits carefully.",
- "#LOV0\\LOV0N004#McCoy is fidgeting around.",
- "#LOV0\\LOV0N005#Spock is analyzing the surroundings.",
- "#LOV0\\LOV0N006#This computer terminal is linked into the station's main computer. It is currently running an open file of log programs.",
- "#LOV0\\LOV0N007#This is a heavily secured door, leading to another section of the station. Its access code has been breached.",
- "#LOV0\\LOV0N008#This is a standard door, leading to another room on this deck.",
- "#LOV0\\LOV0N009#You are on the bridge of the ARK7.",
-
-
- "#LOV1\\LOV1_001#When you are finished admiring all the equipment Bones, maybe you can help us figure out what's going on here.",
- "#LOV1\\LOV1_002#Captain, I believe Dr. McCoy has the necessary skills to run that equipment.",
- "#LOV1\\LOV1_003#It is a standard research lab.",
- "#LOV1\\LOV1_004#The seals on these dishes are intact, but that's all I can determine.",
- "#LOV1\\LOV1_005#This is a very well-equipped laboratory, Captain. Perhaps Dr. McCoy could be of some use here.",
- "#LOV1\\LOV1_006#A Hawking Neutrino Accelerator. It is one of the finest in production today.",
- "#LOV1\\LOV1_007#A Khrygellian II Basic Compound Distillator. Excellent piece of equipment for reducing complex materials to their basic compounds.",
- "#LOV1\\LOV1_008#Careful, Jim! That's a distillator, not a can-opener.",
- "#LOV1\\LOV1_009#Except for the Oroborus virus, I'm not picking up anything unusual.",
- "#LOV1\\LOV1_010#I'm picking up some strange, airborne virus. I can't identify it without more information.",
- "#LOV1\\LOV1_011#Jim, this lab is incredible! What I wouldn't give to have some of this equipment on the Enterprise.",
- "#LOV1\\LOV1_012#That nozzle is for anti-agents only, Jim.",
- "#LOV1\\LOV1_013#That's for Virus Cultures only, Jim.",
- "#LOV1\\LOV1_014#There is already something in the chamber.",
- "#LOV1\\LOV1_015#There is no specimen in the chamber.",
- "#LOV1\\LOV1_016#This isn't a microwave, Jim! This is a delicate piece of equipment!",
- "#LOV1\\LOV1_017#Jim, these viral cultures are alive. I can use them to work on a cure.",
- "#LOV1\\LOV1_018#Eureka! This is it, Jim! There's not much, but all I need to do is synthesize some more, and we're in business.",
- "#LOV1\\LOV1_019#This isn't the result I was hoping for, Jim.",
- "#LOV1\\LOV1_021#We have to attach something to the nozzle first.",
- "#LOV1\\LOV1_022#Residue of a viral agent is still within the chamber.",
- "#LOV1\\LOV1_023#There are multiple culture samples of the virus within the freezer, Captain.",
- "#LOV1\\LOV1_024#Arrggghhh!",
- "#LOV1\\LOV1_025#Aieee!!",
- "#LOV1\\LOV1_026#Sir, I think Dr. McCoy should run it. I may break it.",
- "#LOV1\\LOV1_027#This level appears to be deserted, sir, but I'm worried about a Romulan counter-attack. They outnumber us.",
- "#LOV1\\LOV1_028#Watch out, sir! It looks like the Romulans have taken control of the lower decks.",
- "#LOV1\\LOV1N000#A device to accelerate neutrinos. Not much good for anything else.",
- "#LOV1\\LOV1N001#Dr. McCoy is thinking about chemical formulas.",
- "#LOV1\\LOV1N002#Ensign Ferris doesn't know much about chemical formulas.",
- "#LOV1\\LOV1N003#James Tiberius Kirk.",
- "#LOV1\\LOV1N004#Mr. Spock is thinking about chemical formulas.",
- "#LOV1\\LOV1N005#You already have a culture dish.",
- "#LOV1\\LOV1N006#You take the Oroborus virus culture.",
- "#LOV1\\LOV1N007#Done.",
- "#LOV1\\LOV1N008#It gets a little colder, but nothing else happens.",
- "#LOV1\\LOV1N009#The chamber is empty.",
- "#LOV1\\LOV1N010#The Freezer unit is too large to take.",
- "#LOV1\\LOV1N011#The nozzle is empty.",
- "#LOV1\\LOV1N012#There are many virus culture dishes, all of them labeled, \"Oroborus Virus -- DANGER!!\".",
- "#LOV1\\LOV1N013#There is a single viral culture dish in here, and it contains a sample of the Oroborus cure.",
- "#LOV1\\LOV1N014#This chamber is where virus samples are placed.",
- "#LOV1\\LOV1N015#This device is used for the rapid reproduction of virus cultures in the presence of suspected anti-agents.",
- "#LOV1\\LOV1N016#This is a distillator, used to isolate specific compounds from raw material.",
- "#LOV1\\LOV1N017#This is a large engineering safety door with heavy shielding. Its entry codes seem to be breached.",
- "#LOV1\\LOV1N018#This is a large refrigeration unit.",
- "#LOV1\\LOV1N019#This is a research lab, with lots of expensive equipment.",
- "#LOV1\\LOV1N020#This is a standard door, leading to another room on this deck.",
- "#LOV1\\LOV1N021#This is an access ladder. It appears to lead to the next deck below.",
- "#LOV1\\LOV1N022#This nozzle is where anti-agents are placed.",
- "#LOV1\\LOV1N023#This refrigerator has a number of specimen dishes inside.",
- "#LOV1\\LOV1N034#You have distilled a quantity of Polyberylcarbonate.",
- "#LOV1\\LOV1N035#You retrieve the Oroborus cure sample.",
-
-
- "#LOV2\\LOV2_001#Well, gentlemen, I believe this equipment may be of some use.",
- "#LOV2\\LOV2_002#I think we can call that one a failure, Bones.",
- "#LOV2\\LOV2_003#I think we can set this aside and not worry about it.",
- "#LOV2\\LOV2_004#A clean drink of water, but I don't see its application in the context of our difficulties, Captain.",
- "#LOV2\\LOV2_005#Captain, I see the problem: the gas feeds are turned off. If you'll permit me...",
- "#LOV2\\LOV2_006#Captain, I see the problem: the gas feeds are turned off.",
- "#LOV2\\LOV2_007#Fascinating, Captain, but it doesn't appear to get us any closer to our goal.",
- "#LOV2\\LOV2_008#Except for the Oroborus virus, I'm not picking up anything unusual.",
- "#LOV2\\LOV2_009#Go bother Spock. This is the kind of place he likes.",
- "#LOV2\\LOV2_010#I think I'll stick to combining two gases in future experiments. That's how the machine's designed, after all.",
- "#LOV2\\LOV2_011#I wouldn't try to lift that. You might hurt yourself.",
- "#LOV2\\LOV2_012#I'm picking up some strange, airborne virus. I can't identify it without more information.", // BUG: audio file missing
- "#LOV2\\LOV2_014#That's not the right material to put in there, Jim.",
- "#LOV2\\LOV2_015#Do you mean to say it's undignified, Spock?",
- "#LOV2\\LOV2_016#I rest my case.",
- "#LOV2\\LOV2_017#I think I'd have more luck hypergrowing the virus in the presence of a limited quantity of gas.",
- "#LOV2\\LOV2_018#It doesn't affect Vulcans, of course.",
- "#LOV2\\LOV2_019#Next he'll tell us the DNA molecule is simple!",
- "#LOV2\\LOV2_020#That's it, Jim. We've got enough serum here to cure everybody on the station!",
- "#LOV2\\LOV2_021#We must be doing something wrong, Jim.",
- "#LOV2\\LOV2_022#Why that's just dandy! Vulcan laughing gas!",
- "#LOV2\\LOV2_023#You're wrong, Spock. Look... the virus culture has been eliminated. That's why it's clear. It'd be more useful for me to see how the virus might grow in the presence of a limited quantity of ammonia gas.",
- "#LOV2\\LOV2_024#I recommend we follow the design specifications of the machine. Two gas tanks should always be attached before activating it.",
- "#LOV2\\LOV2_025#I would not recommend removing the canister without turning off the valve.",
- "#LOV2\\LOV2_026#It would be very dangerous to place the tanks without first turning off the valve.",
- "#LOV2\\LOV2_027#Nothing unusual is detected.",
- "#LOV2\\LOV2_028#The machine does not seem to be able to process that particular item.",
- "#LOV2\\LOV2_029#This is an outstanding facility, Captain.",
- "#LOV2\\LOV2_030#Actually, Doctor, both Romulans and Vulcans suffer its effects.",
- "#LOV2\\LOV2_031#An unusual compound, Captain. It can induce laughter and feelings of exhiliration in some, much the way nitrous oxide affects humans.",
- "#LOV2\\LOV2_032#Be careful with that canister, Captain. I think you would not care to fall under the effects of laughing gas in these straits.",
- "#LOV2\\LOV2_033#Compared to many molecular models, it is, Doctor.",
- "#LOV2\\LOV2_034#I don't think that's useful in your experiment, Doctor.", // TYPO (in audio filename)
- "#LOV2\\LOV2_035#In principle, Captain, this device is quite simple. When this chamber is empty and gas tanks are attached, it will combine the gases to make new compounds. If chemicals are placed in the chamber, the machine will combine them with the gases to create new materials.",
- "#LOV2\\LOV2_036#It is, at the least, inappropriate for a starship crew on duty, Doctor.",
- "#LOV2\\LOV2_037#It would take us several hours to get this machine working, Captain. I do not believe we will need it. The synthesis chamber should be able to give us what we need.",
- "#LOV2\\LOV2_038#Please, Doctor. This is not a laughing matter.",
- "#LOV2\\LOV2_039#This does not appear to provide us with anything useful.", // TYPO (in audio filename)
- "#LOV2\\LOV2_040#The can looks much too heavy to carry, sir.",
- "#LOV2\\LOV2_041#This room is very defensible, Captain -- if things get nasty, we may want to retreat to here.",
- "#LOV2\\LOV2_043#I hope you don't want me to swab the deck with that, Captain.",
- "#LOV2\\LOV2N000#You already have the ?.",
- "#LOV2\\LOV2N001#A door.",
- "#LOV2\\LOV2N002#A gas tank marked 'H'.",
- "#LOV2\\LOV2N003#A gas tank marked 'N',",
- "#LOV2\\LOV2N004#A gas tank marked 'O'.",
- "#LOV2\\LOV2N005#A loud hissing fills the room.",
- "#LOV2\\LOV2N006#A small field-effect anti-gravity unit, useful for moving things too heavy to lift and carry by muscle alone.",
- "#LOV2\\LOV2N007#Gas feed is off.",
- "#LOV2\\LOV2N008#Gas feed is on.",
- "#LOV2\\LOV2N009#James Tiberius Kirk.",
- "#LOV2\\LOV2N010#Lt. Ferris is carefully watching the hallway.", // TYPO
- "#LOV2\\LOV2N011#McCoy is fidgeting around.",
- "#LOV2\\LOV2N012#Nothing Happens.",
- "#LOV2\\LOV2N013#Nothing happens.",
- "#LOV2\\LOV2N014#Spock is analyzing the surroundings.",
- "#LOV2\\LOV2N015#The item is much soggier than it used to be, but otherwise undamaged.",
- "#LOV2\\LOV2N016#The machine synthesizes a liter of ammonia.",
- "#LOV2\\LOV2N017#The machine synthesizes a liter of nitrous oxide.",
- "#LOV2\\LOV2N018#The machine synthesizes a liter of pure water.",
- "#LOV2\\LOV2N019#The machine synthesizes one liter of TLTDH gas.",
- "#LOV2\\LOV2N024#There is no room for another canister.",
- "#LOV2\\LOV2N025#There is something already in the chamber.",
- "#LOV2\\LOV2N026#This is a science lab.",
- "#LOV2\\LOV2N027#This is a storage cabinet.",
- "#LOV2\\LOV2N028#This is a synthesizer, used to combine and replicate chemicals and form new compounds. This particular model has twin gas feeds.",
- "#LOV2\\LOV2N029#This is the door to the synthesis chamber.",
- "#LOV2\\LOV2N030#You attach the antigrav unit to the gas tank. It can be moved freely.",
- "#LOV2\\LOV2N031#You attach the antigrav unit to the gas tank. It can be moved freely.",
- "#LOV2\\LOV2N033#You have synthesized one liter of Romulan Laughing Gas.",
- "#LOV2\\LOV2N034#You install the gas tank to the synthesizer's feed lines.",
- "#LOV2\\LOV2N035#You install the gas tank to the synthesizer's feed lines.",
- "#LOV2\\LOV2N036#You retrieve the Oroborus virus culture.", // TYPO
- "#LOV2\\LOV2N037#You retrieve the Oroborus virus cure sample.", // TYPO
- "#LOV2\\LOV2N038#You take a one litre container of TLTDH gas.",
- "#LOV2\\LOV2N039#You take a one litre container of Ammonia.",
- "#LOV2\\LOV2N040#You take a one litre container of Nitrous Oxide.",
- "#LOV2\\LOV2N041#You take a one litre container of pure water.",
- "#LOV2\\LOV2N042#You take the antigrav unit.",
- "#LOV2\\LOV2N043#You take the hypo with Oroborus toxin cure.",
- "#LOV2\\LOV2N044#You take the Polyberylcarbonate.",
- "#LOV2\\LOV2N045#An Ardak 1000, the last word in molecular replication, one of the most advanced pieces of scientific equipment ever constructed.",
- "#LOV2\\LOV2N046#The machine synthesizes a quantity serum in a hypo.",
- "#LOV2\\LOV2N047#The machine synthesizes a quantity of bubbling grey goo.",
- "#LOV2\\LOV2N048#The machine synthesizes a quantity of colorless goo.",
- "#LOV2\\LOV2N049#The machine synthesizes a quantity of inert matter.",
- "#LOV2\\LOV2N050#The machine synthesizes a quantity of wet grey goo.",
- "#LOV2\\LOV2N051#The machine synthesizes a quantity of wet grey goo.",
-
-
- "#LOV3\\LOV3_001#At least all this equipment appears to be operating.",
- "#LOV3\\LOV3_002#A prime source of raw material for TLDTH gas.",
- "#LOV3\\LOV3_003#Captain, the fusion reactor doesn't seem to have been tampered with. I suggest we leave the controls as they are.",
- "#LOV3\\LOV3_004#Captain, we can introduce the Romulan Laughing Gas into the station's ventilation system from here.",
- "#LOV3\\LOV3_005#Except for the Oroborus virus, I'm not picking up anything unusual.",
- "#LOV3\\LOV3_006#I'm picking up some strange, airborne virus. I can't identify it without more information.",
- "#LOV3\\LOV3_007#Ouch!",
- "#LOV3\\LOV3_008#Ah. The station's fusion reactor. Very nice. What are we going to tour next, the ventilation system?",
- "#LOV3\\LOV3_009#I didn't realize that they used these old fusion reactors anymore.",
- "#LOV3\\LOV3_010#I don't suppose you'd enjoy the psychological release of a few good belly laughs, Spock? We could open the canister right here, if you like.",
- "#LOV3\\LOV3_011#I think one application of gas is sufficient, Captain.",
- "#LOV3\\LOV3_012#Nitrous oxide affects humans, but not Romulans. However, a similar effect can be produced by the gas TLTDH.",
- "#LOV3\\LOV3_013#Nothing unusual is detected.",
- "#LOV3\\LOV3_014#The fusion reactor is functioning at peak efficiency. There is no need to tamper with its current operation.",
- "#LOV3\\LOV3_015#The unit cannot lift something fastened to the body of the station, Captain. The tank must be detached first.",
- "#LOV3\\LOV3_016#This is not wise, Captain. I don't believe we can safely substitute a different gas in this location.",
- "#LOV3\\LOV3_017#We should now be able to proceed safely to the lower level.",
- "#LOV3\\LOV3_018#Captain, the instruments are far too delicate for such abuse. We may set off a chain reaction that would destroy the entire space station.",
- "#LOV3\\LOV3_019#Actually, doctor, as Mr. Scott would tell you, the Cochrane-500 is renowned for its reliability and perfectly suited for a station of this size.",
- "#LOV3\\LOV3_020#I would strongly recommend against it, Doctor.",
- "#LOV3\\LOV3_021#Good thing the person who designed these stations built in safeguards against an accidental spill!",
- "#LOV3\\LOV3_022#I guess this made it easier to replace the tank every so often, eh Captain?",
- "#LOV3\\LOV3_023#It doesn't sound like it subdued them, Captain. If anything, it just made them angry.",
- "#LOV3\\LOV3_024#Sir, I'll watch the door so we don't get cornered.",
- "#LOV3\\LOV3_025#It sure beats hauling it around on our backs, sir.",
- "#LOV3\\LOV3_026#Hey, this thing's real old, isn't it?",
- "#LOV3\\LOV3N000#All readings are normal.", // TYPO: audio filename was wrong
- "#LOV3\\LOV3N001#Cursing and coughing echo up the air shaft.",
- "#LOV3\\LOV3N002#It's a standard adjustable metric socket wrench.",
- "#LOV3\\LOV3N003#Kirk is looking closely at the equipment.",
- "#LOV3\\LOV3N004#Lt. Ferris is carefully watching the hallway",
- "#LOV3\\LOV3N005#McCoy is fidgeting around.",
- "#LOV3\\LOV3N006#N gas tank.",
- "#LOV3\\LOV3N007#The tank is too heavy to move by muscle alone.",
- "#LOV3\\LOV3N008#Spock is analyzing the surroundings.",
- "#LOV3\\LOV3N009#The air vent becomes wet.",
- "#LOV3\\LOV3N010#The antigrav unit hums and emits the stink of ozone before it failsafes.",
- "#LOV3\\LOV3N011#The shaft is too small to crawl through.",
- "#LOV3\\LOV3N012#The tank detaches easily.",
- "#LOV3\\LOV3N013#The tank fits into place and is easy to reattach.",
- "#LOV3\\LOV3N014#The tank is large and heavy, with its feed lines firmly attached.",
- "#LOV3\\LOV3N015#The tank is now firmly attached to its feed lines.",
- "#LOV3\\LOV3N016#The vent is now open. It leads to the lower deck.",
- "#LOV3\\LOV3N017#There is a pile of stripped insulation that fell out of the Engineering access panel.",
- "#LOV3\\LOV3N018#There seems to be no effect.",
- "#LOV3\\LOV3N019#This is a screen and filter for the ventilation shaft.",
- "#LOV3\\LOV3N020#The panel closes.",
- "#LOV3\\LOV3N021#The panel is open. You see vast quantities of dust and stripped insulation from wiring repairs made to the console in the past.",
- "#LOV3\\LOV3N022#The panel opens. You see a gas tank labeled N, with its feed lines running deeper into the wall.",
- "#LOV3\\LOV3N023#The panel opens.",
- "#LOV3\\LOV3N024#This is the engineering room. All appears normal.",
- "#LOV3\\LOV3N025#This vent is currently closed.",
- "#LOV3\\LOV3N026#Turbines of a Cochrane-500 Class Fusion drive, manufactured over a century ago on Alpha Centuri.",
- "#LOV3\\LOV3N027#You already have some insulation.",
- "#LOV3\\LOV3N028#You already have the wrench.",
- "#LOV3\\LOV3N029#You grab a handful of insulation.",
- "#LOV3\\LOV3N030#You need something to pry this open.",
- "#LOV3\\LOV3N031#You pick up a large wrench.",
- "#LOV3\\LOV3N032#You replace the air vent cover.",
- "#LOV3\\LOV3NA08#With a hiss, the Romulan Laughing Gas billows down the vent. Things are strangely quiet below.",
- "#LOV3\\LOV3NA09#With a hiss, the Romulan Laughing Gas billows down the vent. You hear the muffled sounds through the vent of hearty Romulan laughter, followed by the dull thud of bodies hitting the deck.",
- "#LOV3\\LOV3NA20#This is a service access panel, permitting used-up or worn materials to be replaced.",
- "#LOV3\\LOV3NA21#This is a vent shaft that leads to the lower level.",
- "#LOV3\\LOV3NA22#This is an engineering access panel, allowing repairs to be made to the interior wiring in the equipment.",
- "#LOV3\\LOV3NA23#This is the engineering center for the ARK7 space station.",
- "#LOV3\\LOV3NJ32#You attach the antigrav unit to the gas tank. It can be moved freely.",
-
-
- "#LOV4\\LOV4_001#We aren't barbarians, in spite of what some people think.",
- "#LOV4\\LOV4_002#Being surrounded by Romulans and not at gun point.",
- "#LOV4\\LOV4_003#I know Mr. Spock. But we'll get through this.",
- "#LOV4\\LOV4_004#Lt. Ferris, collect their weapons.",
- "#LOV4\\LOV4_005#Well, there's a first time for everything.",
- "#LOV4\\LOV4_006#Except for the Romulans, I can detect no other lifeforms in this room.",
- "#LOV4\\LOV4_007#Are you crazy, Jim! That's not going to help in the least!",
- "#LOV4\\LOV4_009#Careful there! They're suffering from dehydration but it's dangerous to give water to someone while they're unconscious. These men need serum or they're going to die!",
- "#LOV4\\LOV4_010#Dammit, Jim, I'm a doctor, not a diplomat. I've got to try and save these men.",
- "#LOV4\\LOV4_011#Dammit, Jim, these men are sick! They need my help!",
- "#LOV4\\LOV4_012#I don't have the proper medicine to cure them, Jim.",
- "#LOV4\\LOV4_013#I don't think they need another shot, Jim.",
- "#LOV4\\LOV4_014#Jim, we need to synthesize more before we can use it.",
- "#LOV4\\LOV4_015#Jim, we've got to help these men before they die.",
- "#LOV4\\LOV4_016#Ouch!",
- "#LOV4\\LOV4_017#That's not working, Jim.",
- "#LOV4\\LOV4_018#The Romulans have been cured of the Oroborus virus, but they are severely dehydrated and need some rest.",
- "#LOV4\\LOV4_019#The Romulans have been cured of the Oroborus virus.",
- "#LOV4\\LOV4_020#The laughing gas did the trick, Jim, but these Romulans are still very, very sick -- they've only got hours left.",
- "#LOV4\\LOV4_021#These Romulans will die soon if we can't cure them.",
- "#LOV4\\LOV4_022#They'll be fine now, Jim. They just need some rest.",
- "#LOV4\\LOV4_023#They're severely dehydrated, but they'll live. We got to them in time.",
- "#LOV4\\LOV4_024#First time for what?",
- "#LOV4\\LOV4_025#McCoy thinks to himself: 'Dammit, I'm a doctor, not a diplomat!'",
- "#LOV4\\LOV4_026#Take it easy now... You'll feel better in a few minutes. Good thing we had the water available, Jim.",
- "#LOV4\\LOV4_027#I have been in more comfortable situations, Captain.",
- "#LOV4\\LOV4_028#These Romulans appear to be a negligible threat, sir.",
- "#LOV4\\LOV4_029#Freeze, Romulans! You're covered!",
- "#LOV4\\LOV4N000#Door Opens.",
- "#LOV4\\LOV4N001#Ensign Ferris is looking at the Romulans, in case one of them decides to try something.",
- "#LOV4\\LOV4N002#James Kirk views the scene with concern.",
- "#LOV4\\LOV4N003#Mr. Spock is his usual stoic self.",
- "#LOV4\\LOV4N004#The Romulans come to weakly, reaching for their weapons.",
- "#LOV4\\LOV4N005#The Romulans stir weakly, then begin to get up... they've all been cured!",
- "#LOV4\\LOV4N006#These Romulans are totally out of it.",
- "#LOV4\\LOV4N007#They are in no condition to talk right now.",
- "#LOV4\\LOV4N008#This door leads into another section of the base.",
- "#LOV4\\LOV4N009#This is the ARK7's crew quarters. There are only Romulans here.",
- "#LOV4\\LOV4N010#This ladder leads back to the research lab.",
- "#LOV4\\LOV4N011#This Romulan is groggy, but conscious.",
- "#LOV4\\LOV4N012#McCoy thinks to himself: 'Dammit, I'm a doctor, not a diplomat!'",
- "#LOV4\\LOV4N013#The Romulans drink thirstily and empty the container.",
-
-
- "#LOV5\\LOV5_001#Well gentlemen, let's go home.",
- "#LOV5\\LOV5_002#Goodbye Carol.",
- "#LOV5\\LOV5_003#Hello, Carol. It's good to see you again.",
- "#LOV5\\LOV5_004#I assure you, the Federation would never undertake such a foul program. It was all an accident, right, Dr. Marcus?",
- "#LOV5\\LOV5_005#Lt. Ferris, collect his weapon.",
- "#LOV5\\LOV5_006#Save it for someone who's buying, Preax. Leave Federation space immediately or we'll scatter your atoms across the quadrant.",
- "#LOV5\\LOV5_007#We aren't barbarians, in spite of what some might think.",
- "#LOV5\\LOV5_008#You also conducted yourself in the most honorable fashion, Centurion Preax. You may return to Romulan space without Federation interference.",
- "#LOV5\\LOV5_009#You always could put me in my place, couldn't you?",
- "#LOV5\\LOV5_010#You are also a worthy opponent, Preax. May you live long and prosper.",
- "#LOV5\\LOV5_011#Are you crazy, Jim? That's not going to help in the least!",
- "#LOV5\\LOV5_013#Careful there! He's suffering from dehydration but it's dangerous to give water to someone while they're unconscious. This man needs serum or he's going to die!",
- "#LOV5\\LOV5_014#Dammit, Jim, I'm a doctor, not a diplomat. These people will be fine. I've got to try and save the Romulans.",
- "#LOV5\\LOV5_015#He's already cured, Jim.",
- "#LOV5\\LOV5_016#He's infected with the virus too, Jim.",
- "#LOV5\\LOV5_017#He's severely dehydrated, but he'll live.",
- "#LOV5\\LOV5_018#He's too weak to talk, Jim. He needs medical attention.",
- "#LOV5\\LOV5_019#I don't have the proper medicine to cure him, Jim.",
- "#LOV5\\LOV5_020#Jim, we need to synthesize more before we can use it.",
- "#LOV5\\LOV5_021#Oops! Almost forgot about you Spock.",
- "#LOV5\\LOV5_023#That's not working, Jim.",
- "#LOV5\\LOV5_024#The hostages are scared, but fine. The laughing gas did the trick, Jim, but the Romulan is still very, very sick -- he's only got hours left.",
- "#LOV5\\LOV5_025#They've been through a good deal of stress, but they are already starting to recover. Their heart rate is dropping, and their blood pressure is also dropping.",
- "#LOV5\\LOV5_026#Dammit, Jim, these men are sick! They need my help!",
- "#LOV5\\LOV5_027#Finally, a human response!",
- "#LOV5\\LOV5_028#My God, that's some kind of weapon!",
- "#LOV5\\LOV5_029#Take it easy now... You'll feel better in a few minutes. Good thing we had the water available, Jim.",
- "#LOV5\\LOV5_030#There. You're now cured.",
- "#LOV5\\LOV5_031#What does this stuff do? What's going on here?",
- "#LOV5\\LOV5_032#You'll never cease to amaze me, Jim.",
- "#LOV5\\LOV5_033#I detect no other lifeforms in the room, Captain.",
- "#LOV5\\LOV5_034#Fascinating. This device contains over ten million forms of life. Patterns I have never seen before.",
- "#LOV5\\LOV5_036#Fascinating equipment. I believe I have seen this sort of equipment someplace before.",
- "#LOV5\\LOV5_038#Thank you, Doctor.",
- "#LOV5\\LOV5_039#Anthony and I will look after these Romulans, Jim. Dr. McCoy, we could use your expertise on discovering a cure for the virus. All our equipment is at your disposal.",
- "#LOV5\\LOV5_040#Jim, it's you! Please untie us!",
- "#LOV5\\LOV5_041#Thank God it's you, Jim. I'm so glad you came.",
- "#LOV5\\LOV5_042#Thank you for saving our station, Jim.",
- "#LOV5\\LOV5_043#Absolutely. We've already destroyed all cultures and purged the data files. This will never happen again.",
- "#LOV5\\LOV5_044#Everyone on this project is an avowed pacifist, doctor. Myself included. We do not make weapons.",
- "#LOV5\\LOV5_045#Goodbye Jim.",
- "#LOV5\\LOV5_046#How about someone giving us a hand?",
- "#LOV5\\LOV5_047#That's the one thing I could never do. Your place was wandering the galaxy, and that's the one thing I could never give you.",
- "#LOV5\\LOV5_048#There was a time when I wouldn't have agreed with that statement. But I guess some things do get better with age.",
- "#LOV5\\LOV5_049#We call this the Cradle, Mr. Spock. One day, I hope, something wonderful will be produced here.",
- "#LOV5\\LOV5_050#We're conducting research into the origins of life in the universe. This is our equipment. We believe that... uh, well, I guess you don't have the time. You can get the background in my doctoral thesis.",
- "#LOV5\\LOV5_051#We're testing the effect of radiation on combinations of simple and complex molecules. We're trying to see what new forms of life are developed, and how they compare to our own early development.",
- "#LOV5\\LOV5_052#These Romulans appear to be a negligible threat, sir.",
- "#LOV5\\LOV5_053#Freeze, Romulan! You're covered!",
- "#LOV5\\LOV5_054#I do. You just pull on the ropes until they're untied.",
- "#LOV5\\LOV5_055#Hey! Would you please untie us?",
- "#LOV5\\LOV5_056#It's about time someone got here.",
- "#LOV5\\LOV5_057#Hey? Does anyone in Starfleet know how to untie a knot?",
- "#LOV5\\LOV5_058#I don't care who does it, but could somebody get around to doing it on this Stardate?",
- "#LOV5\\LOV5_059#I have called off the Romulan attack on this station, Kirk. I believed your virus was some kind of deliberate attack, but your great honor and compassion have convinced me otherwise.",
- "#LOV5\\LOV5_060#Phah! And I thought you a man of honor... You need not worry, Captain Kirk. Your lack of warrior spirit stinks even across the vacuum of space, and I am eager to be free of it.",
- "#LOV5\\LOV5_061#You are an honorable adversary, Kirk. Jolan-tru.",
- "#LOV5\\LOV5N000#Dr. Anthony Cheever, the assistant of Dr. Marcus.",
- "#LOV5\\LOV5N001#Dr. Carol Marcus, head of this station's research team.",
- "#LOV5\\LOV5N002#Dr. McCoy is viewing this scene with interest.",
- "#LOV5\\LOV5N003#Ensign Ferris is wondering when they're going to give him a tough assignment for a change.",
- "#LOV5\\LOV5N004#James T. Kirk, glad to see Carol Marcus again, yet slightly uncomfortable.",
- "#LOV5\\LOV5N005#Mr. Spock is fascinated by these machines.",
- "#LOV5\\LOV5N006#The Preax remains silent, but glances between you and your tied up companions.",
- "#LOV5\\LOV5N007#The Romulan Preax stirs weakly, then begins to get up... he has been cured!",
- "#LOV5\\LOV5N008#This is a very advanced research laboratory.",
- "#LOV5\\LOV5N009#This is Dr. Carol Marcus' quarters. The hostages and four Romulans are here.",
- "#LOV5\\LOV5N010#This ladder leads back to the main level of the station.",
- "#LOV5\\LOV5N011#This Romulan commander is cautiously looking at you.",
- "#LOV5\\LOV5N012#This Romulan commander is unconscious.",
- "#LOV5\\LOV5N013#An odd looking device, almost like a 20th Century torpedo, fitted with an experimental gear.",
- "#LOV5\\LOV5N014#Dr. Anthony Cheever, Marcus's assistant. He has been bound by the Romulans.",
- "#LOV5\\LOV5N015#Dr. Carol Marcus, head of this station's research team. She has been bound by the Romulans.",
- "#LOV5\\LOV5N016#Some odd looking equipment, connected to the torpedo.",
- "#LOV5\\LOV5N017#The Romulan Preax weakly regains conscienceness, reaching for his weapon.",
- "#LOV5\\LOV5N018#The Romulan Preax drinks thirstily and empties the container.",
- "(Raises an eyebrow)", // NOTE: no corresponding audio
-
-
- "#LOVA\\LOVA_100#He's dead, Jim.",
- "#LOVA\\LOVA_F01#He's been cured of the Oroborus virus.",
- "#LOVA\\LOVA_F02#I'm picking up some kind of virus. I can't identify it without more information.",
- "#LOVA\\LOVA_F03#He's infected with the virus, Jim.",
- "#LOVA\\LOVA_F04#The virus affects the Romulan-Vulcan genotype, Jim.",
- "#LOVA\\LOVA_F07#All lifesigns are normal.",
- "#LOVA\\LOVA_F08#It's what I was afraid of, Jim. I think Spock is getting worse.", // TYPO
- "#LOVA\\LOVA_F10#He has weak vital signs.",
- "#LOVA\\LOVA_F54#The virus has spread to me, Captain. I suggest you concentrate your efforts on the problem.",
- "#LOVA\\LOVA_F55#Jim, we need to synthesize more to make the serum before we can use it.", // TYPO
-
-
- "#MUD0\\MUD0_001#Kirk to Enterprise...",
- "#MUD0\\MUD0_002#Well! Now I think we know why the Elasi pirates were so interested in finding out where Mudd was getting these!",
- "#MUD0\\MUD0_003#Bones, Federation law is clear on this. Federation law protects everyone, even Harry Mudd. ",
- "#MUD0\\MUD0_004#Don't push your luck, Harry. ",
- "#MUD0\\MUD0_005#Harry, as official representatives of the Federation, and of Starfleet, we recognize your rights to legitimate salvage. Need I say more? ",
- "#MUD0\\MUD0_006#I see, Harry. Well, we'll look around here while the Enterprise remains close by.",
- "#MUD0\\MUD0_007#It was a rhetorical question, Harry. ",
- "#MUD0\\MUD0_008#No Lieutenant, that was Horatio Jones, but Harry Mudd is worse.",
- "#MUD0\\MUD0_009#Well, you're terrible trouble to me, Harry. Tell me what this is all about.",
- "#MUD0\\MUD0_010#Why do I have the feeling that I am about to have a bad day? ",
- "#MUD0\\MUD0_011#Everyone is healthy, Jim, there's no need for the medical kit here.",
- "#MUD0\\MUD0_012#These lenses were definitely not made to correct the aliens' vision. Mudd might've been able to sell these among humans as magnifiers, but these people must have had another use for them.",
- "#MUD0\\MUD0_013#These lenses are finely made magnifiers, but I can't help but wonder if that's what the aliens really used them for. ",
- "#MUD0\\MUD0_014#About as much as the Klingons are devoted to pacifism... ",
- "#MUD0\\MUD0_015#For once Spock, I couldn't have said it better myself. ",
- "#MUD0\\MUD0_016#Jim? You can't seriously be thinking of helping Mudd after all he's done. ",
- "#MUD0\\MUD0_017#Then something went wrong, right?",
- "#MUD0\\MUD0_018#Life support down to 25%, Captain.",
- "#MUD0\\MUD0_019#Life support down to 50%, Captain.",
- "#MUD0\\MUD0_020#Life support down to 75%, Captain.",
- "#MUD0\\MUD0_021#These are computer memory transfer media, probably designed for use with the alien computer system.",
- "#MUD0\\MUD0_022#Given the past record of Harry Mudd, Captain, I strongly recommend that you do not trust him. ",
- "#MUD0\\MUD0_023#I am. Your record is that of a greedy, amoral, sociopathic fraud who preys upon human emotion, most notably, gullibility. ", // TYPO (gullability)
- "#MUD0\\MUD0_024#There was the time that you tried to commandeer the Enterprise to sell wives to miners, and then there was the time you stole the Enterprise to exchange us for androids who were holding you prisoner... ",
- "#MUD0\\MUD0_025#Kirk, after all we've been through you wouldn't shoot me would you?",
- "#MUD0\\MUD0_026#Actually no, Doctor, not then. I'd started offering a few other little items I found -- Mudd's Limited coffee substitute -- a great little specialty item; lenses to a firm packaging BuildYerOwn telescope kits; a collection of novelty paints -- things like that. All of a sudden, the Elasi pirates are asking for me in every quadrant, and wanting to know where I'm getting my goods!",
- "#MUD0\\MUD0_027#And we all know how devoted I am to Federation law. ",
- "#MUD0\\MUD0_028#I happened upon this ship not long ago, and dutifully registered it as salvage, mind you! In the hold here, I discovered one of these devices -- in that box over there. When I tried one on a wall, it floated off the grease and dirt -- perfect for cleaning, near as I could see. I peddled a few of these Mudd's Miracle De-Grimers and everything was going perfectly well.",
- "#MUD0\\MUD0_029#I understand perfectly, Captain -- Carry on, Captain.",
- "#MUD0\\MUD0_030#It's a system that cost a gambler his life, boy. He crawled up to me and whispered it with his dying breath, and it can be yours for a mere... 200 credits. ",
- "#MUD0\\MUD0_031#Kirk! Now that we're together... ",
- "#MUD0\\MUD0_032#Kirk, my friend! When have I ever given you the slightest bit of trouble? ",
- "#MUD0\\MUD0_033#Look around all you like, Captain, but I'll be keeping an eye on you. I've registered this derelict as my salvage, and I don't want you running off with all my prizes! ",
- "#MUD0\\MUD0_034#Mr. Spock! Whatever gave you that impression! I thought Vulcans were supposed to be logical. ",
- "#MUD0\\MUD0_035#Perhaps there have been a few minor misunderstandings... ",
- "#MUD0\\MUD0_036#Starfleet! You're all the same. No sense of adventure! ",
- "#MUD0\\MUD0_037#Welcome, Captain Kirk! So glad you're here. The Elasi have been terrible trouble to me.",
- "#MUD0\\MUD0_038#Why I've never been so insulted in all my life! ",
- "#MUD0\\MUD0_039#Didn't Mudd bring those tribbles on board the Enterprise?",
- "#MUD0\\MUD0_040#So you say you know how to break the gambling machines on Curalon IV? ",
- "#MUD0\\MUD0_041#Sorry Mr. Mudd. My mother didn't raise any fools in her family. ",
- "#MUD0\\MUD0N000#A small energy device with a flanged opening at the front, about the size of one's thumbnail.",
- "#MUD0\\MUD0N001#Dr. McCoy looks like he would like to violate the Hippocratic Oath on Harry Mudd, but you know he won't. ",
- "#MUD0\\MUD0N002#Dust and grease lifts off the surface, leaving this item clean as new.",
- "#MUD0\\MUD0N003#Harcourt Fenton Mudd. Of course, he's going to be honest and fair with you... ",
- "#MUD0\\MUD0N004#James T. Kirk looks rather exasperated right now. ",
- "#MUD0\\MUD0N005#Lieutenant Buchert is standing around, watching everyone else converse with Harry Mudd. ",
- "#MUD0\\MUD0N006#Life support fails completely and you fall unconscious.",
- "#MUD0\\MUD0N007#Mr. Spock is as close to annoyed as a Vulcan can get. ",
- "#MUD0\\MUD0N008#Odd-looking contraptions small enough to hold in one hand.",
- "#MUD0\\MUD0N009#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
- "#MUD0\\MUD0N010#There are shiny, multi-sided, spherical objects in this box.",
- "#MUD0\\MUD0N011#These two things fit together like they were made for each other.",
- "#MUD0\\MUD0N012#This container holds bricks of what might have been preprocessed food -- a long time ago.",
- "#MUD0\\MUD0N013#This container holds small mechanical components unfamiliar to you.",
- "#MUD0\\MUD0N014#This lense, about the size of one's thumbnail, magnifies like a fine optical glass. ",
- "#MUD0\\MUD0N015#This storage bay is stockpiled with all manner of goods.",
- "#MUD0\\MUD0N016#You already have that.",
- "#MUD0\\MUD0N017#You can't take that.",
- "#MUD0\\MUD0N019#This place is cluttered with stored goods of every sort. It would take an army of workers weeks to examine every container and determine what is inside.",
-
-
- "#MUD1\\MUD1_001#Kirk to Enterprise...",
- "#MUD1\\MUD1_002#Well, now! I think we know why the Elasi pirates were so interested in finding out where Mudd was getting these!",
- "#MUD1\\MUD1_003#I agree that we should take it aboard the Enterprise. ",
- "#MUD1\\MUD1_004#I don't think we should tinker with technology we don't understand, Spock. And I'm surprised you'd suggest such a thing.",
- "#MUD1\\MUD1_005#I know, Bones. ",
- "#MUD1\\MUD1_006#I wonder what's happening on the Enterprise right now. ",
- "#MUD1\\MUD1_007#I'll try to raise the ship... Kirk to Enterprise, Kirk to Enterprise...",
- "#MUD1\\MUD1_008#If the Elasi gets hold of this, they'll make Mudd seem like a perfect caretaker by comparison. ",
- "#MUD1\\MUD1_009#That machinery in the middle of the room, however, is like nothing I recognize -- and I thought I'd seen just about everything.",
- "#MUD1\\MUD1_010#A weapons-delivery system. It appears to be an accessory tied directly to the alien equivalent of our ship's phasers and photon torpedoes.",
- "#MUD1\\MUD1_011#Everyone is healthy, Jim, there's no need for the medical kit here.",
- "#MUD1\\MUD1_012#I wonder where that Mudd has gone. I wouldn't let him out of my sight... mind you, I'm not too crazy about having him in my sight either. ",
- "#MUD1\\MUD1_013#Scotty will take good care of it, Jim. He has before. ",
- "#MUD1\\MUD1_014#It seems to be part of the loading system for the weapon. It is also fully functional.",
- "#MUD1\\MUD1_015#The control panel has power running to it, Captain.",
- "#MUD1\\MUD1_016#The device has been unloaded, Captain.",
- "#MUD1\\MUD1_017#The device has finished loading, Captain.",
- "#MUD1\\MUD1_019#A most interesting technology, Captain.",
- "#MUD1\\MUD1_020#Evidently these are more than theoretical, Lt. Buchert. The energy initially released is infinitesimally small but boosts itself until the power finally released is comparable to our photon torpedoes.",
- "#MUD1\\MUD1_021#However, I've already examined the weapons console and the main weapons battery on this ship was completely destroyed in the action which made her a derelict.",
- "#MUD1\\MUD1_022#I believe, Captain, that this weapon must be hooked up through the main weapons battery.",
- "#MUD1\\MUD1_023#Mr. Scott would have to go over this thoroughly, but I would recommend we try to take this weapon with us to the Enterprise.",
- "#MUD1\\MUD1_024#The machinery to deliver these cartridges would be an engineering feat as well, Captain.",
- "#MUD1\\MUD1_025#Unique, Captain. I believe these are self-referencing packed-quantum cartridges. ",
- "#MUD1\\MUD1_026#It looks to me like these people knew how to defend themselves, Captain.",
- "#MUD1\\MUD1_027#Powerboosters! I've read about those -- but they're just theoretical.",
- "#MUD1\\MUD1_028#The technical journals discussing the possibilities indicated it would create a weapon of greater range than those we have now, if not a greater punch. ",
- "#MUD1\\MUD1N000#A large claw-like device hanging from the ceiling.",
- "#MUD1\\MUD1N001#A red triangular button.",
- "#MUD1\\MUD1N002#A row of unmarked cylindrical containers.",
- "#MUD1\\MUD1N003#An elaborate piece of alien-looking machinery.",
- "#MUD1\\MUD1N004#Dust and grease lifts off the surface, leaving this item clean as new.",
- "#MUD1\\MUD1N005#James T. Kirk, dwarfed by the technology that surrounds him. ",
- "#MUD1\\MUD1N006#Lieutenant Buchert, waiting for a chance to perform his duty. ",
- "#MUD1\\MUD1N007#Life support fails completely and you fall unconscious.",
- "#MUD1\\MUD1N008#McCoy is scowling, probably from your meeting with Harcourt Fenton Mudd. ",
- "#MUD1\\MUD1N009#Mr. Spock is looking forward to the moment that he can sit down at the main computer and analyze the findings of this mission. ",
- "#MUD1\\MUD1N010#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
- "#MUD1\\MUD1N011#The room reminds you of the weapons-room of some old-style warships from the early days of starfaring.",
- "#MUD1\\MUD1N012#These cylinders have fallen down from the rest.",
- "#MUD1\\MUD1N013#These two things fit together like they were made for each other.",
- "#MUD1\\MUD1N014#This is much too heavy to lift.",
- "#MUD1\\MUD1N015#Three triangular blue buttons.",
- "#MUD1\\MUD1N016#Two yellow triangular buttons.",
-
-
- "#MUD2\\MUD2_001#Spock, see if you can outflank him...",
- "#MUD2\\MUD2_002#Well, now! I think we know why the Elasi pirates were so interested in finding out where Mudd was getting these!", // TYPO
- "#MUD2\\MUD2_003#Almost worth a try. Bones? ",
- "#MUD2\\MUD2_004#Do they pose any threat to us, Doctor?",
- "#MUD2\\MUD2_005#Harry! Calm down Harry, it's only us! ",
- "#MUD2\\MUD2_006#Harry, when did you become a comedian? ",
- "#MUD2\\MUD2_007#I can't think of anything we did that was THAT bad. ",
- "#MUD2\\MUD2_008#There's not much I wouldn't do to not have to deal with Mudd. ",
- "#MUD2\\MUD2_009#Kirk to Enterprise ... Kirk to Enterprise.", // TYPO
- "#MUD2\\MUD2_010#Sometimes I wish I had become an archeology professor instead of a Starfleet Captain. ",
- "#MUD2\\MUD2_011#Sorry if I was bothering you. I was just silently cursing the day I met Harry Mudd. ",
- "#MUD2\\MUD2_012#All yours now, Doctor McCoy.",
- "#MUD2\\MUD2_013#He's showing definite signs of hallucination and a marked increase in adrenalin. I would recommend extreme caution in handling him.",
- "#MUD2\\MUD2_014#I feel sure that these would have been used here, but I don't understand enough of the alien's thinking to make it work.", // TYPO
- "#MUD2\\MUD2_015#I need to understand more about the aliens before I can make this bed and its instrumentation function.",
- "#MUD2\\MUD2_016#I'm not fast enough to get him with a tranquilizer hypo, Jim!",
- "#MUD2\\MUD2_018#Jim, these look like the capsules we might use in a hypo. I wouldn't recommend experimenting with them, though. Alien physiology or not, you can never be sure what unusual chemicals will do to the human body.",
- "#MUD2\\MUD2_019#None seems likely to have any effect on human -- or Vulcan -- physiology. To be on the safe side, though, I wouldn't recommend taking a snootful from one of the capsules!",
- "#MUD2\\MUD2_020#The capsules slide into the machinery on the bed exactly as they're designed to.",
- "#MUD2\\MUD2_021#The volatile chemicals have evaporated over the time the derelict hung in space. I need to refill the capsule-dispenser for the bed to activate and effect a cure on our friend Harry, here.",
- "#MUD2\\MUD2_022#This is no time for a nap!", // TYPO
- "#MUD2\\MUD2_023#We can't get near that equipment with mudd going nuts over there, Jim.",
- "#MUD2\\MUD2_024#We won't be able to operate any of this equipment unless we can learn more about the aliens, Jim.",
- "#MUD2\\MUD2_025#Are you religious, Jim? Is Harry Mudd a divine punishment for anything we did wrong? ",
- "#MUD2\\MUD2_026#Deleterious effects. I guess I don't even need my tricorder to know that.",
- "#MUD2\\MUD2_027#He's delirious Jim. Actually, it's kinda funny. ",
- "#MUD2\\MUD2_028#I think I liked him better when he was less delirious. ",
- "#MUD2\\MUD2_029#I'm telling the program our physiology is not the same as the aliens' physiology. Don't want it to try to cure us of being human!",
- "#MUD2\\MUD2_030#It would be interesting to analyze them back aboard the Enterprise, but these are probably vaccines, medicines, and research viruses.",
- "#MUD2\\MUD2_031#If we can get him on one of the beds, and get it active, I think he can be cured. Otherwise, he's likely to become increasingly violent.",
- "#MUD2\\MUD2_032#Jim, that doesn't look good at all... Harry, let me take a look at you and check whether that had some deleterious effect...",
- "#MUD2\\MUD2_033#Okay, Harry, you should start to feel better in a few minutes. Just lie there quietly until you feel like moving.",
- "#MUD2\\MUD2_034#Particularly when we're talking about Harry Mudd...",
- "#MUD2\\MUD2_035#Well, he got one thing right. ",
- "#MUD2\\MUD2_036#Who knows what effect a phaser might have on him with all those chemicals in his system? We must find another way to handle this. ",
- "#MUD2\\MUD2_037#This room closely resembles the Enterprise sickbay. The beds are powered, as is the central post console. ",
- "#MUD2\\MUD2_038#It would appear that the accident has made Harry Mudd even less logical than before. ",
- "#MUD2\\MUD2_039#That would be too much to hope for, would it not, Doctor?",
- "#MUD2\\MUD2_040#You look troubled, Captain.",
- "#MUD2\\MUD2_042#Ahh, I feel faster -- smarter -- strong enough to take you all on! You're really lizard men wearing human masks -- his is coming off -- Hahahahahah!",
- "#MUD2\\MUD2_043#I know you for what you really are! I'll tell the whole world, and then where will you be!",
- "#MUD2\\MUD2_044#Why C-c-Captain!",
- "#MUD2\\MUD2_045#*Groan.* Give me something for this headache, Doc. A herd of Hamali tree-elephants landed behind my eyeballs and did a mating dance...",
- "#MUD2\\MUD2_046#Argh! My most dire enemies have found me! ",
- "#MUD2\\MUD2_047#Kirk, you sound as though you aren't happy to see me! After all we've been through together, I thought we had built a genuine bond of camraderie, two men fighting side by side against impossible odds! ",
- "#MUD2\\MUD2_048#No! You're going to sell me to space aliens! Use my brain as a weapon to destroy the human race! And here I am, willing to help out in a good cause... ",
- "#MUD2\\MUD2_049#No! You're all space aliens! You're little grey men from inside the hollow earth! You want to experiment on my body parts! Stay away from me!",
- "#MUD2\\MUD2_050#Stay away from me!>",
- "#MUD2\\MUD2_051#You'll mind control me, kidnap my children! Dissect my dog!",
- "#MUD2\\MUD2_052#He's unnaturally strong, Captain! I can't take him down!",
- "#MUD2\\MUD2_053#I don't think the phaser will have the usual effect, Captain.... we'll have to think of something else!",
- "#MUD2\\MUD2_054#Captain, count your blessings! We haven't met any salt vampires, deranged computers, blood-draining clouds, cell imploding sirens, Greek gods, or any of the other things people keep telling me about in security. ",
- "#MUD2\\MUD2_055#Sir, I can phaser him. A stun setting would just leave him queasy. ",
- "#MUD2\\MUD2N000#Dr. McCoy, who isn't arguing as much with Spock as usual. ",
- "#MUD2\\MUD2N001#Dust and grease lifts off the surface, leaving this item clean as new.",
- "#MUD2\\MUD2N002#Harcourt Fenton Mudd. Three of the most prominent psychologists in the galaxy became famous by publishing case studies in sociopathy about him. ",
- "#MUD2\\MUD2N003#James Kirk, the paragon of a Starfleet captain, feels nothing like a paragon right now. ",
- "#MUD2\\MUD2N004#Lieutenant Buchert. His is not to reason why. His is to obey orders and stay alert. ",
- "#MUD2\\MUD2N005#Life support fails completely and you fall unconscious.",
- "#MUD2\\MUD2N006#Mr. Spock, your loyal science officer. ",
- "#MUD2\\MUD2N007#Padded inclines resembling a bed.",
- "#MUD2\\MUD2N008#Small containers of oddly-colored liquids.",
- "#MUD2\\MUD2N009#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
- "#MUD2\\MUD2N010#These two things fit together like they were made for each other.",
- "#MUD2\\MUD2N011#This seems to be the main monitoring station for the beds. Above it is some sort of dispensary.",
-
-
- "#MUD3\\MUD3_002#Harry! Look what you've done! ",
- "#MUD3\\MUD3_003#Kirk to Enterprise...",
- "#MUD3\\MUD3_005#At ease, lieutenant. He's not worth it. ",
- "#MUD3\\MUD3_006#At least our life support system isn't dependent on the alien computer.",
- "#MUD3\\MUD3_007#By all means, Spock.",
- "#MUD3\\MUD3_008#But their essence, their souls -- are gone, Spock.",
- "#MUD3\\MUD3_009#Get away from that this instant, Harry, or I'll shoot you where you stand.",
- "#MUD3\\MUD3_010#Help yourself, Harry. Knowledge is for everyone.",
- "#MUD3\\MUD3_011#It would be nice to think that after all the stunts that Harry has pulled, that he would do something right for a change. ", // TYPO
- "#MUD3\\MUD3_012#Spock, we're talking about Harry Mudd. He was probably trying to download it so he could sell it to the highest bidder.",
- "#MUD3\\MUD3_013#Teeny bit clumsy? Mudd, you're a disgrace to the entire human race! ",
- "#MUD3\\MUD3_014#This technology is unbelievable, Mr. Spock. I've never seen anything like it. ",
- "#MUD3\\MUD3_015#With the Enterprise out of range, that's not an option, Mr. Spock. What else can you do?", // TYPO
- "#MUD3\\MUD3_016#You better believe it, lieutenant. ",
- "#MUD3\\MUD3_017#Apparently an information data screen, something like the display readers on the Enterprise.",
- "#MUD3\\MUD3_018#Both our tricorders are now working on basic processing of the aliens' computer data system. The tricorders are not the equal of the Universal Translator, but we should be able to retrieve basic information and get an insight into their culture and lifesystems. I don't believe we could have gotten even this far, had we not deduced their fixation on base-6 mathematics and esthetics.",
- "#MUD3\\MUD3_019#Captain, it was not logical to allow Harry Mudd to get within one hundred meters of this room. ",
- "#MUD3\\MUD3_020#Everyone is healthy, Jim, there's no need for the medical kit here.",
- "#MUD3\\MUD3_021#Not my area of expertise, I'm afraid.",
- "#MUD3\\MUD3_022#That would be quite a find, Jim. This is an alien race unknown to us, and they are certain to have knowledge new to us.", // TYPO
- "#MUD3\\MUD3_023#This equipment's way out of my league, Jim. ",
- "#MUD3\\MUD3_024#And instead, he wiped the memory. That knowledge was priceless!",
- "#MUD3\\MUD3_025#If you're incapable of emotion, how do you know what \"awe\" is, Spock? ",
- "#MUD3\\MUD3_026#Interesting data here about the six-eyed vision processing in the brain. Their eyesight must have been excellent, and almost 300 degrees around.",
- "#MUD3\\MUD3_027#Look at their physiology, Jim -- I think this explains the L'Shaians' fascination with threes and sixes.",
- "#MUD3\\MUD3_028#Medical knowledge is comprehensive, and lifespan is extended considerably over archaic expectations, with maintenance of quality of life.",
- "#MUD3\\MUD3_029#Mudd! Don't you realize what you've done! That knowledge was irreplaceable! You just burned down the galactic equivalent of the Library of Alexandria! Millions of lives might have been saved by the knowledge you destroyed! ",
- "#MUD3\\MUD3_030#Mudd! If I were to perform an autopsy on you right now, I might be able to find a cure for stupidity! ",
- "#MUD3\\MUD3_031#Mudd, do you know what you just did!? That knowledge was priceless -- and you've just destroyed it forever!!",
- "#MUD3\\MUD3_032#To say nothing of fulfilling our mandate to seek out new life and new civilizations...",
- "#MUD3\\MUD3_033#You can't be serious, Spock! ",
- "#MUD3\\MUD3_034#I believe I have downloaded enough information to our tricorders to enable operation of most of the ship's controls, Captain.",
- "#MUD3\\MUD3_035#I believe I have retrieved as much data as I can, Captain.",
- "#MUD3\\MUD3_036#I believe I've extracted a copy of the main databank, Captain.",
- "#MUD3\\MUD3_037#I would suggest, Captain, that the controls to this screen are elsewhere in this room.",
- "#MUD3\\MUD3_038#The data viewscreen is operational. The information selectors are controlled from the console platform.",
- "#MUD3\\MUD3_039#The tricorder's entire sensor and data processing capabilities are presently occupied with decipherment of the ship's library.",
- "#MUD3\\MUD3_040#The tricorders are again available for general use. The alien ship's computer data is now accessible from the ship's library.",
- "#MUD3\\MUD3_041#This platform contains the control console for the ship's computer library. Data may be accessed by using this console.",
- "#MUD3\\MUD3_042#This platform contains the control console for what appears to be the information center of the ship -- the computer library, if you will. It appears functional, but incomprehensible without some better understanding of the aliens who built it.",
- "#MUD3\\MUD3_043#This seems to activate the ship's computer bank control node. Given the aliens' predilection for multiples of 3, it may be possible to use our tricorders to decipher the information carried in these data banks.",
- "#MUD3\\MUD3_044#This seems to activate the ship's computer bank control node. I lack sufficient information to commence data retrieval, however. Simply put, without some understanding of the aliens' mindset, there's no place to start.",
- "#MUD3\\MUD3_046#I believe I can produce a picture of a member of their race, Captain.",
- "#MUD3\\MUD3_047#I believe if Dr. McCoy and I conjoin our two tricorders, we may be able to process enough sample data to get a basic understanding of the aliens' computer system. This will completely tie up both our tricorders for an extended amount of time, however.",
- "#MUD3\\MUD3_048#I believe, Captain, that the basic functions of the ship remain, even now. This is the library module -- the art, history, and cultural memory of the aliens are gone, but the mechanical necessities of sick bay, engineering, and sensors continue to work.",
- "#MUD3\\MUD3_049#I have found an entry on an experimental long-range weapon booster, recently installed, named the Whyos weapon. It does not alter the power of the primary weapons systems, but it does increase the range at which those weapons are effective.",
- "#MUD3\\MUD3_050#I'm receiving data now, Captain. Most internal and external functions are controlled from the bridge. These include Engineering, Navigation, Communications, and Sensors. Weapons functions are controlled from the weapons room.", // TYPO
- "#MUD3\\MUD3_051#Illogical, Captain. This race has been extinct for millenia.",
- "#MUD3\\MUD3_052#It appears our good friend Harry Mudd has crashed the main computers. I doubt if it was a very easy thing to manage.",
- "#MUD3\\MUD3_053#It should be no surprise that physiology affects mind and behavior. I would say a six-fingered, six-eyed people would naturally develop their sciences and arts around base-six numerical systems, just as I observed on the bridge.",
- "#MUD3\\MUD3_054#Not all topics will necessarily be available, Captain. Nor do I believe we can get full details on all data -- the tricorders could only do so much processing. It would be worth our effort to locate the central databanks for delivery to the Kornephoros Life Sciences University, I believe.",
- "#MUD3\\MUD3_055#This is a major archeological find, Captain. I believe the galaxy may actually have cause to thank Harry Mudd. ",
- "#MUD3\\MUD3_056#Were the Universal Translator available, this would be simple.",
- "#MUD3\\MUD3_057#It is indeed impressive Captain. If I were capable of emotion, I would be in awe of this place. ",
- "#MUD3\\MUD3_058#How dare you, Kirk! I have half a mind to sue for defamation of character... ",
- "#MUD3\\MUD3_059#Kirk! Get this muscle-bound clod away from me. I'm allergic to violence! ",
- "#MUD3\\MUD3_060#Kirk, look what you made me do! You and your clumsy Starfleet... ",
- "#MUD3\\MUD3_061#Now see here, Dr. McCoy! Don't blame me if Kirk's bellowing causes me to be a teeny bit clumsy... ",
- "#MUD3\\MUD3_062#Now, you aren't... I mean.... Kirk! ",
- "#MUD3\\MUD3_063#Ooops!",
- "#MUD3\\MUD3_064#Whatever you say, Captain!",
- "#MUD3\\MUD3_065#Why, Captain! I see you got this machine to work -- I tried to get it up and running for the longest time.",
- "#MUD3\\MUD3_066#Why, Kirk, I didn't think you had it in you. Thank you!",
- "#MUD3\\MUD3_067#Captain, I think I understand why you dislike this Mudd guy so much. ",
- "#MUD3\\MUD3_068#Not my area of expertise, I'm afraid.",
- "#MUD3\\MUD3_069#Captain, I think Mr. Mudd looks like he's getting out of control... ",
- "#MUD3\\MUD3_070#Captain, does this mean that I'm a part of a major archeological discovery? ",
- "#MUD3\\MUD3_071#I don't see why you're complaining about this Mudd guy. Who knows what advances we could get from all this knowledge? ",
- "#MUD3\\MUD3N000#Databanks erased.",
- "#MUD3\\MUD3N001#Dust and grease lifts off the surface, leaving this item clean as new.",
- "#MUD3\\MUD3N002#Even Spock is visibly disturbed by Mudd's carelessness. ",
- "#MUD3\\MUD3N003#Harry Mudd hopes he can make it back to his ship and get away in one piece. ",
- "#MUD3\\MUD3N004#Kirk is dismayed by the destruction he has seen. ",
- "#MUD3\\MUD3N005#Kirk is silently worried about what is happening back on the Enterprise. ",
- "#MUD3\\MUD3N006#Lieutenant Buchert is not at all happy with Harcourt Fenton Mudd. ",
- "#MUD3\\MUD3N007#Lieutenant Buchert seems to have limitless energy. It makes you feel old just watching him. ",
- "#MUD3\\MUD3N008#Life support fails completely and you fall unconscious.",
- "#MUD3\\MUD3N009#McCoy is aghast at this turn of events. ",
- "#MUD3\\MUD3N010#McCoy is his usual crusty old self. ",
- "#MUD3\\MUD3N011#Nothing happens.",
- "#MUD3\\MUD3N012#Sometimes you wonder if Spock will ever show emotion. ",
- "#MUD3\\MUD3N013#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
- "#MUD3\\MUD3N014#The computer has nothing to write to the spheroid.",
- "#MUD3\\MUD3N015#The sphere in the middle of this console appears to be some sort of control mechanism.",
- "#MUD3\\MUD3N016#These two things fit together like they were made for each other.",
- "#MUD3\\MUD3N017#This might be a data screen of some kind.",
- "#MUD3\\MUD3N018#You already have a doover.",
- "#MUD3\\MUD3N019#You can't seem to make this work.",
- "#MUD3\\MUD3N020#You download major portions of the alien library onto the yellow spheroid.",
- "(Raises eyebrow)", // Custom
-
-
- "#MUD4\\MUD4_001#Bring us home, Mr. Scott.",
- "#MUD4\\MUD4_002#<<Communications>>",
- "#MUD4\\MUD4_003#<<Done>>",
- "#MUD4\\MUD4_004#I guess the universe looks about like it did the last time we saw it.",
- "#MUD4\\MUD4_005#I'm speechless, Mr. Spock. Words cannot adequately describe this place. ",
- "#MUD4\\MUD4_006#Mr. Spock, come take a look at this. This is evidently the main bridge. What do you make of it?",
- "#MUD4\\MUD4_007#<<View Screen>>",
- "#MUD4\\MUD4_008#Did you know Stella's still looking for you? What's it worth to you for me not to tell her where to find you, Harry?", // TYPO
- "#MUD4\\MUD4_009#Don't rush off, Harry. There's still a few things we need to discuss.",
- "#MUD4\\MUD4_010#Five of each.",
- "#MUD4\\MUD4_011#Five. Remember, I could confiscate your entire stock as illegal goods. You might get it back through the courts... in a few years.",
- "#MUD4\\MUD4_012#For free?",
- "#MUD4\\MUD4_013#Go on, Mr. Spock.",
- "#MUD4\\MUD4_014#I was sure you wouldn't miss them, Harry. The Patent Authority wants these properly registered and I'm sure you want to do the right thing.",
- "#MUD4\\MUD4_015#In spite of Harry Mudd... ",
- "#MUD4\\MUD4_016#In such a hurry? And Stella said she was dropping everything to meet you here.",
- "#MUD4\\MUD4_017#Just like you were kidding about this ship registered as a worthless derelict. You are going to change that, aren't you? Matter of fact, I think it would be just the thing for you to turn it over lock stock and barrel to the Kornephorous University.",
- "#MUD4\\MUD4_018#Kirk to Enterprise ... Kirk to Enterprise.", // TYPO: used in MUD4 and LOVE mission; the text was different in LOVE, not matching with audio.
- "#MUD4\\MUD4_019#Later, Mr. Scott.",
- "#MUD4\\MUD4_020#New developments, Mr. Scott?",
- "#MUD4\\MUD4_021#No, Harry, we're going to let you keep them to sell to the Elasi at incredible profits, so they can use them against Federation authorites.",
- "#MUD4\\MUD4_022#No, I need to have a word with Harry Mudd before we go.",
- "#MUD4\\MUD4_023#No, I need to have a word with Harry Mudd before we go.",
- "#MUD4\\MUD4_024#No, we want to look around some more. We'll call you on this channel when we're ready.",
- "#MUD4\\MUD4_025#Scotty! Report!",
- "#MUD4\\MUD4_026#Tell me why I shouldn't arrest you on the spot, just on general principles?",
- "#MUD4\\MUD4_027#The local star seems to be acting up. Will there be a problem with the transporter? I want you to beam up the landing party, and I also want you to lock onto and beam aboard an alien mechanism we came across.",
- "#MUD4\\MUD4_028#The local star seems to be acting up. Will there be a problem with the transporter?",
- "#MUD4\\MUD4_029#I would suggest, Captain, we take him up on his offer.",
- "#MUD4\\MUD4_030#Very well, Harry. You're off scot free... this time. But if you don't upload that data immediately, your measly little scoutship will be experiencing some difficulties maintaining flight capabilities.",
- "#MUD4\\MUD4_031#What else can you determine at this stage, Mr. Spock?",
- "#MUD4\\MUD4_032#When we meet, Harry, it always means trouble.",
- "#MUD4\\MUD4_033#Yes, bring us home, Mr. Scott.",
- "#MUD4\\MUD4_034#You destroyed the only known records of a lost race. That's a punishable offense.",
- "#MUD4\\MUD4_035#You have no idea what a great bargain it is, Mudd.",
- "#MUD4\\MUD4_036#You made a backup?",
- "#MUD4\\MUD4_037#You were selling high-technology weapons to terrorists and known criminals.",
- "#MUD4\\MUD4_038#<<Sensors>>",
- "#MUD4\\MUD4_039#<<Navigation>>",
- "#MUD4\\MUD4_040#<<Engineering>>",
- "#MUD4\\MUD4_041#<<Done>>",
- "#MUD4\\MUD4_042#Evidently the aliens' bridge, their centralized control. A closer look may provide more information.",
- "#MUD4\\MUD4_043#Everyone is healthy, Jim, there's no need for the medical kit here.",
- "#MUD4\\MUD4_045#I can't make anything of these controls.",
- "#MUD4\\MUD4_046#To boldly go, where no man has gone before... we're here, Jim. ",
- "#MUD4\\MUD4_047#Speak of the devil, where is that little angel? ",
- "#MUD4\\MUD4_048#This shouldn't be surprising -- after all, there are two stations.",
- "#MUD4\\MUD4_049#I think this is the secondary station.",
- "#MUD4\\MUD4_050#It appears to be a view screen much like the one on board the Enterprise.",
- "#MUD4\\MUD4_051#It is a multi-bit, compact doover with its own dracktar traction unit and clamp kit.",
- "#MUD4\\MUD4_052#Thanks to the library computer data, limited though it is, these primary controls give me access to...",
- "#MUD4\\MUD4_053#The Enterprise is in combat with a number of Elasi pirate ships half a parsec toward the neutron star sector. I read debris identifiable with the pirates, but they continue to harass the Enterprise.",
- "#MUD4\\MUD4_054#The Enterprise is out of range for this equipment, under the conditions of static created by the neutron star.",
- "#MUD4\\MUD4_055#The computer reports this ship is incapable of navigating anywhere at all without major repairs. We are definitely dead in space until the Enterprise returns, Captain.",
- "#MUD4\\MUD4_056#The engine pods are damaged but still generating power, Captain.",
- "#MUD4\\MUD4_057#This appears to be the primary control panel. Perhaps you would be better equipped to man this station, Captain.",
- "#MUD4\\MUD4_058#This is the secondary station. With the limited understanding we now have of the library computer data, these controls can now be activated. Available are... ",
- "#MUD4\\MUD4_059#That may be, Doctor, but if you will recall, all the Enterprise's different stations link into the same computer network bank and...",
- "#MUD4\\MUD4_060#These people have a fixation for the number six, and even divisors and multiplicands thereof: threes and twelves in particular. I believe this may be the necessary first clue to understanding the aliens.",
- "#MUD4\\MUD4_061#This is clearly the control center for the ship, Captain. I cannot deduce much information, but I do observe two things.",
- "#MUD4\\MUD4_062#This station definitely is configured differently from the one beside me.",
- "#MUD4\\MUD4_063#We have done quite well so far, Captain. ",
- "#MUD4\\MUD4_064#Because I am going to turn over a selection of samples to the Kornephorous Life Sciences University?",
- "#MUD4\\MUD4_065#Captain Kirk! I seem to be missing a Miracle De-Grimer! Surely you're not stooping to thievery, are you, Captain?",
- "#MUD4\\MUD4_066#Captain Kirk! I was hoping to see you. I'm leaving soon and wanted to say thanks for the escort. Ta-ta, and I hope we never have to cross paths again, Captain.",
- "#MUD4\\MUD4_067#Captain!! Two.",
- "#MUD4\\MUD4_068#Consider it done. You have my word, Captain. Now I'm going to pick up just a few things. Insignificant things, really! Then I'll be gone. Farewell, Captain! May your path be always trouble-free, until we meet again.",
- "#MUD4\\MUD4_069#I understand. No problem. Adieu, Captain!",
- "#MUD4\\MUD4_070#Uh... of course. One of everything I've found here.",
- "#MUD4\\MUD4_071#Well, Captain, I did manage to take a download of the computer before I accidentally damaged it. If you'll just let me go back to my ship, I can upload it to the Enterprise's computers from there.",
- "#MUD4\\MUD4_072#What! Where's the profit in that, Captain?",
- "#MUD4\\MUD4_073#You drive a hard bargain, Captain. It's a deal.",
- "#MUD4\\MUD4_074#You're. Kidding. Are you kidding, Captain?",
- "#MUD4\\MUD4_075#I don't believe this is the weapons center, Captain. There appears to be one, but it's evidently located elsewhere on the ship. I can't make anything more of these controls.",
- "#MUD4\\MUD4_076#This may have been their bridge, but this sure doesn't look like the Enterprise. ",
- "#MUD4\\MUD4_A29#Very well, bring us home, Mr. Scott.",
- "#MUD4\\MUD4_S02#The Elasi pirates have been driven off, Captain. We have damage, and injuries among the crew. We just arrived back here a few minutes ago, and we've been trying to raise you on the communicators.",
- "#MUD4\\MUD4_S03#The neutron star is causing more and more problems, Captain. I would recommend beaming over at your earliest possible convenience.",
- "#MUD4\\MUD4_S04#We can do it, Captain, no problem. At least right now, but the situation is only going to get worse. Are you ready to beam over now?",
- "#MUD4\\MUD4N000#A control console from which operators run the ship.",
- "#MUD4\\MUD4N001#Dr. McCoy is still frowning. ",
- "#MUD4\\MUD4N002#Dust and grease lifts off the surface, leaving this item clean as new.",
- "#MUD4\\MUD4N003#James T. Kirk, Captain of the USS Enterprise. ",
- "#MUD4\\MUD4N004#Lieutenant Buchert looks intensely at these controls, and suppresses a childlike impulse to touch them. ",
- "#MUD4\\MUD4N005#Life support fails completely and you fall unconscious.",
- "#MUD4\\MUD4N006#Mr. Spock, Vulcan's finest contribution to Starfleet. ",
- "#MUD4\\MUD4N007#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
- "#MUD4\\MUD4N008#The starfield is the same one you saw from the bridge of the Enterprise, with the binary stars swinging majestically past each other.",
- "#MUD4\\MUD4N009#These two things fit together like they were made for each other.",
- "#MUD4\\MUD4N011#This appears to be some sort of engineering instrument. ",
- "#MUD4\\MUD4N012#You already have a doover.",
- "#MUD4\\MUD4N013#You see a plain grey screen.",
-
-
- "#MUD5\\MUD5_001#I suspect that's a blessing in disguise, Mr. Spock!",
- "#MUD5\\MUD5_002#Just think of it, Spock. An advanced civilization, with powerful technology and nearly unlimited knowledge, and yet all of that didn't save them. ",
- "#MUD5\\MUD5_003#Kirk to Enterprise...",
- "#MUD5\\MUD5_004#Let's hope there isn't too much for you to do back at the Enterprise. ",
- "#MUD5\\MUD5_005#Mudd! I oughta...",
- "#MUD5\\MUD5_006#No, Harry, but I figure it's probably where you'll find your lost marbles.",
- "#MUD5\\MUD5_007#That was a close one. Too close! If I ever get my hands on that no good Mudd I'll...",
- "#MUD5\\MUD5_009#Will wonders never cease.",
- "#MUD5\\MUD5_010#Yes, I've got it but you can't have it.",
- "#MUD5\\MUD5_011#An unusual matter-anti-matter engine, reminiscent of the designs created by the hoopooin of Seginus IV.",
- "#MUD5\\MUD5_012#Everyone is healthy, Jim, there's no need for the medical kit here.",
- "#MUD5\\MUD5_013#Our lives won't be worth a plugged nickel if we don't get that makeshift life support generator back in working order!",
- "#MUD5\\MUD5_014#This life support generator is an unreliable model at the best of times. Tinkering with it is a gamble with your life!",
- "#MUD5\\MUD5_015#Do you really think there's anything on Mudd's ship we need, Captain? I don't.",
- "#MUD5\\MUD5_016#Spock! Meaningless conversation is one of life's great pleasures. ",
- "#MUD5\\MUD5_017#Well Jim, as long as we don't strangle Harry Mudd, I can't see very much for me to do on this mission. ",
- "#MUD5\\MUD5_018#You know, lieutenant, they say if you can't say anything good about a person, you shouldn't say anything at all. In that case, I've got a lot I shouldn't say about Harry Mudd. ",
- "#MUD5\\MUD5_019#The life support generator is malfunctioning. Repairs must be made soon or the atmosphere will fall below the level required to sustain us, Captain.",
- "#MUD5\\MUD5_020#The life support system must be repaired soon. Readings indicate the environment is dropping quickly.",
- "#MUD5\\MUD5_021#This \"Sav-a-Ship\" life support generator has seen a great deal of use. It was never a reliable model, being prone to breakdown without warning. It is, however, properly connected, with warning alarms for temperature, atmosphere, and radiation.",
- "#MUD5\\MUD5_022#This room appears to have been the alien ship's engine pod. A ship-to-ship access hatch and a temporary life support generator are evidently recent additions.",
- "#MUD5\\MUD5_023#This seems to be a crane of some sort, Captain. Currently, no power is running to it.",
- "#MUD5\\MUD5_024#As one would expect, Mr. Mudd has sealed the hatch with his personal code. We cannot enter his ship, Captain.",
- "#MUD5\\MUD5_025#Captain, the Gomuchi-Grindrod Salvage Hatch is designed to withstand low power phaser blasts. However, I would not trust the integrity of the ship's hull were we to increase phaser power to open this hatch.",
- "#MUD5\\MUD5_026#Evidently Mr. Mudd was unwilling to pay the price for a reliable salvage model.",
- "#MUD5\\MUD5_027#I doubt there's anything on Mudd's ship we require, Captain.",
- "#MUD5\\MUD5_028#I would not suggest we take the time to seek him. This emergency could occur again. I would suggest we hasten our departure.", // TYPO
- "#MUD5\\MUD5_030#In this case, I agree with the good doctor.",
- "#MUD5\\MUD5_031#It appears that Harry Mudd managed to emplace this access hatch without significantly damaging the alien ship.",
- "#MUD5\\MUD5_032#It is a sobering thought, Captain. ",
- "#MUD5\\MUD5_033#Unlike humans, I do not decrease my efficiency with meaningless dialogue. ",
- "#MUD5\\MUD5_034#Captain, you wouldn't have seen my Multipurpose Doover anywhere? I need to, uh, fix something.",
- "#MUD5\\MUD5_035#Oh! Was there a problem?",
- "#MUD5\\MUD5_036#Sorry, no time to chat. I'm a busy man you know.",
- "#MUD5\\MUD5_037#You really can be a headache, Captain. Maybe I can find a spare somewhere else. Good lu...I mean goodbye.",
- "#MUD5\\MUD5_038#Captain, I'm not feeling well. Without life support, we can't remain here much longer.",
- "#MUD5\\MUD5_039#Captain, I don't think we can open this hatch with phasers, and still depend on the integrity of the ship's hull to hold atmosphere.",
- "#MUD5\\MUD5_040#When we get back to the Enterprise, you're going to have to tell me everything you know about this Mudd guy. ",
- "#MUD5\\MUD5N000#A large claw-like device hangs from the ceiling.",
- "#MUD5\\MUD5N001#Dust and grease lifts off the surface, leaving this item clean as new.",
- "#MUD5\\MUD5N002#James T. Kirk. Exploring the unknown is one of the few pleasures that the burden of command allows him. ",
- "#MUD5\\MUD5N003#Lieutenant Buchert watches and says nothing. He's the strong, silent type. ",
- "#MUD5\\MUD5N004#McCoy glances back and forth, looking for a sign of Harry Mudd. ",
- "#MUD5\\MUD5N005#Spock continues to examine the equipment with a scientist's eye. ",
- "#MUD5\\MUD5N006#Tall, transparent columns run through the ceiling. Energy crackles in between the duo-decahedrons inside them.",
- "#MUD5\\MUD5N007#The atmosphere in the ship has dropped below the level needed to sustain life. You drop to unconsciousness and slowly die.",
- "#MUD5\\MUD5N008#There seems to be something wrong with the life support generator.",
- "#MUD5\\MUD5N009#These two things fit together like they were made for each other.",
- "#MUD5\\MUD5N010#This door leads back to the main cargo bay.",
- "#MUD5\\MUD5N011#A salvage lock hatch, a common type used to link a derelict to the ship doing the salvaging.",
- "#MUD5\\MUD5N012#A \"Sav-a-Ship\" emergency life support generator, generally used for temporary life support during evacuation of small damaged ships.",
- "#MUD5\\MUD5N105#Life support fails completely and you fall unconscious.",
-
-
- "#FEA0\\FEA0_002#And exactly what would you have done with them? Entering Klingon space for anything puts the peace in peril.",
- "#FEA0\\FEA0_003#And then your followers were destroyed because when white men arrived on that continent, they were believed to be you in your promised return. Your people perverted your teachings, then were destroyed by it.",
- "#FEA0\\FEA0_004#Damned right the results were swift. The Klingons have been raiding colonies looking for you.",
- "#FEA0\\FEA0_005#Ha! You mean your followers love pieces! They slaughtered other believers hoping you'd return.",
- "#FEA0\\FEA0_006#I am Captain James T. Kirk of the Starship Enterprise. Did you know the Klingons are looking for you?",
- "#FEA0\\FEA0_007#I am Captain James T. Kirk of the Starship Enterprise. What did you do to get the Klingons so upset?",
- "#FEA0\\FEA0_008#Listen, the Klingons are ripping colonies apart to find you, so stop this nonsense. This is serious.",
- "#FEA0\\FEA0_009#Listen, Mister, any missions conducted within Klingon space fully jeopardize the peace.",
- "#FEA0\\FEA0_010#Quetzecoatl? How fitting you would name yourself after one of the most bloody-handed gods in Earth's history.",
- "#FEA0\\FEA0_011#We're not your children and we don't appreciate this wild goose chase you've forced us into.",
- "#FEA0\\FEA0_012#Whatever you did has them very upset. They're raiding worlds looking for you.",
- "#FEA0\\FEA0_013#Your followers regularly sacrificed other believers to you after you left, offering you their still-beating hearts.",
- "#FEA0\\FEA0_014#Your people? We represent all of the Earth's people and we certainly do not recognize you.",
- "#FEA0\\FEA0_015#He appears human... All life signs are normal, but I'm getting strange energy readings near the base of his pituitary gland.",
- "#FEA0\\FEA0_016#Ouch!",
- "#FEA0\\FEA0_017#Jim, that man is dressed in ancient Aztec clothing.",
- "#FEA0\\FEA0_018#What do you know about Earth culture? He looks like an ancient Aztec!",
- "#FEA0\\FEA0_019#I am picking up multiple life forms in the surrounding region, Captain.",
- "#FEA0\\FEA0_020#I am picking up strange energy readings from the alien. Perhaps Doctor McCoy could provide better data.",
- "#FEA0\\FEA0_021#I believe you are mistaken, doctor. His clothing bears a distinct resemblance to fashions of a much later period.",
- "#FEA0\\FEA0_022#The humanoid's adornments appear similar to those worn by leaders of Earth's early 20th century inhabitants of the South American continent.",
- "#FEA0\\FEA0_023#I'm just a security officer, sir.",
- "#FEA0\\FEA0_024#I am Quetzecoatl. I elevated a civilization on your world from barbarism to sentience. You are a perversion of that process. Be gone!",
- "#FEA0\\FEA0_025#You dare fire at a god?",
- "#FEA0\\FEA0_026#Bloody-handed? My people love peace!",
- "#FEA0\\FEA0_027#Foul lying creatures, my gift was wasted upon you! Begone.",
- "#FEA0\\FEA0_028#Greetings, my children. I can barely imagine that you have come so far.",
- "#FEA0\\FEA0_029#Impossible! You must be lying!",
- "#FEA0\\FEA0_030#Jeopardize the peace? Hardly. Peace is what I preach. I am Quetzecoatl, as you well know from the proud history of your world.",
- "#FEA0\\FEA0_031#Quaint expression. I have done nothing to anger them. I did with them what I have done with everyone.",
- "#FEA0\\FEA0_032#The Klingons? Amazing! This is the first time one of my missions has produced results so swiftly.",
- "#FEA0\\FEA0_033#Who are you? I know you come from Terrasol, but you are not of my people. What goes on here?",
- "#FEA0\\FEA0_101#No, you must be lying. They could not be raiding if they are looking for me. Violence was not the message of any of my missions. I, Quetzecoatl, preach universal brotherhood and peace.",
- "#FEA0\\FEA0_108#Everyone is healthy, Jim, there's no need for the medical kit here.",
- "#FEA0\\FEA0N000#Feral red eyes glare out of the dark at you.",
- "#FEA0\\FEA0N001#It looks like the jungle has grown up into a small hut.",
- "#FEA0\\FEA0N002#Lt. Stragey is carefully eyeing the humanoid.",
- "#FEA0\\FEA0N003#Luminescent insects swarm near a large tree.",
- "#FEA0\\FEA0N004#McCoy is fidgeting around.",
- "#FEA0\\FEA0N005#Spock is analyzing the surroundings.",
- "#FEA0\\FEA0N006#The log appears sturdy enough to cross.",
- "#FEA0\\FEA0N007#The moon of Digifal. Legend says that the gods of good and evil fortune live there and will glance back at those who look at them, and either a miracle or a catastrophe will soon befall those who gaze upon it.",
- "#FEA0\\FEA0N008#There is a tall, slender, dark haired man looking intently at you.",
- "#FEA0\\FEA0N009#You see dense vegetation in all directions.",
-
-
- "#FEA1\\FEA1_001#We wouldn't want to bleed all over Dr. McCoy now, would we?",
- "#FEA1\\FEA1_002#Well, yes.",
- "#FEA1\\FEA1_003#A pile of small igneous rocks, Captain.",
- "#FEA1\\FEA1_004#And get my fingers taken off by some alien reptile? You've got to be joking.",
- "#FEA1\\FEA1_005#Are you nuts? There's no way I'm touching any damned snake!",
- "#FEA1\\FEA1_006#Do I look like Houdini to you? I'm afraid you're going to have to pull the rabbit out of the hat on this one.",
- "#FEA1\\FEA1_007#Does it look sick to you, Captain?",
- "#FEA1\\FEA1_008#Everyone is healthy, Jim, there's no need for the medical kit here.",
- "#FEA1\\FEA1_009#Hey! What was that for?",
- "#FEA1\\FEA1_010#I'm not putting my fingers in there, Jim.",
- "#FEA1\\FEA1_011#It's a damned hole with a snake in it.",
- "#FEA1\\FEA1_012#It's a damned hole.",
- "#FEA1\\FEA1_013#It's bad enough that you put me in the damn transporter, now you want me to break my neck climbing that?!",
- "#FEA1\\FEA1_014#It's moss. Anyone got any rolling stones?",
- "#FEA1\\FEA1_015#No toxic reaction. It appears to be ordinary, except for this resin.",
- "#FEA1\\FEA1_017#Didn't they have baseball on Vulcan? Show us your fastball, Jim.",
- "#FEA1\\FEA1_018#Especially that green Vulcan blood. The last thing I need is a pint of T-Negative blood all over my uniform.",
- "#FEA1\\FEA1_019#It's a damned snake! Do you know what snakebite does? It can ruin your whole day.",
- "#FEA1\\FEA1_020#It's bad enough being around pointy-eared Vulcans, now I have to listen to ensigns who think they can do my job!",
- "#FEA1\\FEA1_021#Probability? That was a perfect pitch if I ever saw one.",
- "#FEA1\\FEA1_022#The bite wasn't serious Captain. He'll be fine, but I would like to get him to sickbay in case there's some alien infection.",
- "#FEA1\\FEA1_023#Fascinating. Our communicators have apparently been rendered ineffective.",
- "#FEA1\\FEA1_024#I am picking up residual energy readings from the area where the alien's projection was.",
- "#FEA1\\FEA1_025#I can not reach the snake, Captain.",
- "#FEA1\\FEA1_026#I realize that humans form emotional bonds with pets, but I recommend tribbles.",
- "#FEA1\\FEA1_027#I see no logic in searching an empty hole, Captain.",
- "#FEA1\\FEA1_028#It is logical that an entity that professes to teach peace would render our phasers inoperative.",
- "#FEA1\\FEA1_029#It looks like a Zamphorian pit snake. A rather common species in this region, noted by galactic herpatologists for their quickness. It is not venomous or dangerous to humans. ",
- "#FEA1\\FEA1_030#It would appear that this is where the snake lives, Captain. It is currently inside.",
- "#FEA1\\FEA1_031#It would appear that this is where the snake lives, Captain.",
- "#FEA1\\FEA1_032#Thank you, Captain, but I assure you that I was giving this situation my fullest attention.",
- "#FEA1\\FEA1_033#The resin does not seem to have any unusual properties.",
- "#FEA1\\FEA1_034#The snake has gone back into the hole, Captain.",
- "#FEA1\\FEA1_035#The snake is too quick to be easily grabbed before it retreats, Captain.", // TYPO
- "#FEA1\\FEA1_037#This isn't very logical, but as you are human, it is quite understandable.", // TYPO
- "#FEA1\\FEA1_038#This variety of moss seems to leave a very sticky resin behind. Perhaps to trap the large amounts of pollen from the plants on the surface, and use it as a secondary food source.",
- "#FEA1\\FEA1_039#This vine is not likely to support our weight by itself, Captain. You would have to find some way to reinforce it.",
- "#FEA1\\FEA1_040#Those vines would be useful to escape, if we could reach them.",
- "#FEA1\\FEA1_041#A fascinating specimen, Captain, but I would be careful handling it. From the looks of it, it may have a nasty bite.", // TYPO
- "#FEA1\\FEA1_042#Fascinating. It did appear to knock the vine down near to the point where one of us can reach it.",
- "#FEA1\\FEA1_043#The probability of getting the vine on the second try was only 36.53%. Well done, Captain.",
- "#FEA1\\FEA1_044#We are not likely to find a way out of this pit with humor, doctor. I suggest you concentrate your efforts to the problem at hand.",
- "#FEA1\\FEA1_045#I'm glad I was taught pain-nullification techniques.",
- "#FEA1\\FEA1_046#It doesn't seem to want to be grabbed, sir. It just slithers back to its hole.",
- "#FEA1\\FEA1_047#It's coming out again, sir.",
- "#FEA1\\FEA1_048#No enemies in sight, but supplies could be a problem if we don't get out.",
- "#FEA1\\FEA1_049#Sure is sticky sir. I can't see much use in it.",
- "#FEA1\\FEA1_050#That's something of a runt, Captain. You should've seen this Rigilian python that Cadet Tyrli put in the shower at the Academy. Twenty meters long!",
- "#FEA1\\FEA1_051#The hole is empty, sir.",
- "#FEA1\\FEA1_052#There's no way that we're getting up that way, Captain. The vine is too weak.",
- "#FEA1\\FEA1_053#All Right! We're on our way!",
- "#FEA1\\FEA1_054#Baseball? No one plays that anymore. Good try though, sir.",
- "#FEA1\\FEA1_055#Do they always argue like this, Captain?",
- "#FEA1\\FEA1_056#Doctors! It'll take more than a couple of scratches to put me out action, sir.",
- "#FEA1\\FEA1_057#You clearly are not the inheritors of the noble Aztec world. What you have said has greatly disturbed me. You should not lie so. You shall remain here until you have learned the error of angering Quetzecoatl!",
- "#FEA1\\FEA1_A46#There is not enough support, Captain.",
- "#FEA1\\FEA1_F25#What on Earth are you doing with that slithering thing!",
- "#FEA1\\FEA1N000#Feral red eyes glare out of the dark at you.",
- "#FEA1\\FEA1N001#James T. Kirk does not seem very happy with his current predicament.",
- "#FEA1\\FEA1N002#Lt. Stragey is carefully examining the pit.",
- "#FEA1\\FEA1N003#McCoy is examining the floor of the pit.",
- "#FEA1\\FEA1N004#Spock is carefully examining the pit.",
- "#FEA1\\FEA1N005#The hole is already blocked.",
- "#FEA1\\FEA1N006#The rock is a bit stickier.",
- "#FEA1\\FEA1N007#The snake darts back into its hole before you can catch it.",
- "#FEA1\\FEA1N008#The vine is attached to a tree above you.",
- "#FEA1\\FEA1N009#The vine is not within reach.",
- "#FEA1\\FEA1N010#The vine will not support you.",
- "#FEA1\\FEA1N011#There are rocks here, quite suitable for picking up and throwing.",
- "#FEA1\\FEA1N012#There are several loose vines hanging over the side of the pit, out of reach. This is one of them.",
- "#FEA1\\FEA1N013#There is a light suspended from above by a chain.",
- "#FEA1\\FEA1N014#There is a tiny hole in the wall at this point. Certainly no human could crawl through here.",
- "#FEA1\\FEA1N015#There is a vine hanging down into the pit.",
- "#FEA1\\FEA1N016#This moss is covered with a very sticky substance.",
- "#FEA1\\FEA1N017#This particular snake doesn't seem to like your company, and moves whenever you get near it.",
- "#FEA1\\FEA1N018#With no where for the snake to go, you easliy capture it.",
- "#FEA1\\FEA1N019#You already have rocks.",
- "#FEA1\\FEA1N020#You are in a deep pit. It is a long, hard climb to the top.",
- "#FEA1\\FEA1N021#You cannot reach it from where you are.",
- "#FEA1\\FEA1N022#You pick up some rocks from the pile.",
-
-
- "#FEA2\\FEA2_001#Everyone is healthy, Jim, there's no need for the medical kit here.",
- "#FEA2\\FEA2_002#Nothing interesting in this neck of the woods, Jim.",
- "#FEA2\\FEA2_003#They're dead, Jim.",
- "#FEA2\\FEA2_004#This jungle is sure lush, Jim. Speaking of lush, I could use a nice saurian brandy about now.",
- "#FEA2\\FEA2_005#Really? Tell me more about your childhood Lieutenant...",
- "#FEA2\\FEA2_006#Fascinating. Our communicators have apparently been rendered ineffective.",
- "#FEA2\\FEA2_007#I am reading a life form to the west. It appears to be humanoid.",
- "#FEA2\\FEA2_008#Staying in this overgrown region could prove quite dangerous. I suggest we continue, Captain.",
- "#FEA2\\FEA2_009#I feel like someone is watching us, Captain.",
- "#FEA2\\FEA2_010#You know, I always wanted to go swinging on a vine through a jungle. Just like in some old books I read when I was a kid.",
- "#FEA2\\FEA2N000#A vine hangs from the trees.",
- "#FEA2\\FEA2N001#Feral red eyes glare out of the dark at you.",
- "#FEA2\\FEA2N002#Kirk is wondering what he said that made Quetzecoatl so angry...",
- "#FEA2\\FEA2N003#Lt. Stragey appears fascinated by the vines hanging from the trees.",
- "#FEA2\\FEA2N004#McCoy is filled with premonitions of injury and death. Why else would they have brought him along?",
- "#FEA2\\FEA2N005#Spock is examining the surrounding terrain for signs of danger. Anything else would be illogical.",
- "#FEA2\\FEA2N006#This great tree has been in this jungle for centuries.",
- "#FEA2\\FEA2N007#Trees to the left of you! Trees to the right of you! Into the valley of trees raced the landing party!",
- "#FEA2\\FEA2N008#You are in a densely vegetated area. The overgrowth blocks your view in all directions.",
-
-
- "#FEA3\\FEA3_001#Well, does anyone have any suggestions?",
- "#FEA3\\FEA3_002#Great Tlaoxac, I do not understand. Quetzecoatl says that his is the way of peace, yet you wish blood to be shed?",
- "#FEA3\\FEA3_003#It is urgent that we speak to Quetzecoatl. His life may depend on it. Please stand aside and let us pass?",
- "#FEA3\\FEA3_004#An intriguing solution Captain, but it is unlikely that he will accept green blood as a proper sacrifice.",
- "#FEA3\\FEA3_005#Did you ever get the feeling that people don't like you?",
- "#FEA3\\FEA3_006#Everyone is healthy, Jim, there's no need for the medical kit here.",
- "#FEA3\\FEA3_007#Get that thing away from me!",
- "#FEA3\\FEA3_008#He dropped a knife, Jim!",
- "#FEA3\\FEA3_009#He's out cold, Jim.I don't think we'll have any more trouble from him.",
- "#FEA3\\FEA3_010#He's unconscious, Jim.",
- "#FEA3\\FEA3_011#Hey! What do you think you're doing?",
- "#FEA3\\FEA3_012#Jim, he'll be up in about a half hour. If I wake him now he's liable to retalliate for your thoughtless actions.", // TYPO
- "#FEA3\\FEA3_013#These lamps are made up of insects much like fireflies, Jim.",
- "#FEA3\\FEA3_014#Well, either this Aztec is a real flesh and blood human being, or I'm going to be retired as soon as I get back to the Enterprise.",
- "#FEA3\\FEA3_015#Damn. He noticed.",
- "#FEA3\\FEA3_016#Isn't that what they said to David before he fought Goliath?",
- "#FEA3\\FEA3_017#Well, then send in David!",
- "#FEA3\\FEA3_018#What about your famous nerve pinch?",
- "#FEA3\\FEA3_019#Fascinating. These lights are actually swarms of bio-luminescent insects. I wonder how they are controlled.",
- "#FEA3\\FEA3_020#Interesting. From the angle of its fangs and the shape of its mouth, it might have had the ability to inject its prey with venom at one time.", // TYPO
- "#FEA3\\FEA3_021#Nothing unusual here, Captain.",
- "#FEA3\\FEA3_022#Perhaps our host will be more reasonable now. I recommend trying to locate him, Captain.",
- "#FEA3\\FEA3_023#Still inoperative, Captain.",
- "#FEA3\\FEA3_024#Still inoperative, Captain.",
- "#FEA3\\FEA3_025#That is not a logical act, Captain.",
- "#FEA3\\FEA3_026#Captain, I do not think that I can defeat him in personal combat.",
- "#FEA3\\FEA3_027#Doctor, may I remind you that David defeated Goliath?",
- "#FEA3\\FEA3_028#It is unlikely to work on a man of that size, doctor.",
- "#FEA3\\FEA3_029#All right! Time for some action. Let me show you how we did it at the Acad... uh, Captain, do you realize how BIG this guy is?",
- "#FEA3\\FEA3_030#sHe's dead, Jim!", // TYPO
- "#FEA3\\FEA3_031#I'm really not that anxious to get a good look at it, sir.",
- "#FEA3\\FEA3_032#Nice planet. I kinda like it.",
- "#FEA3\\FEA3_033#Ouch, sir.",
- "#FEA3\\FEA3_034#Well, there is a doctor here, so I guess it's all right. They never told me I'd be doing this at the Academy.",
- "#FEA3\\FEA3_035#Get back! You may not pass until you prove your worthiness.",
- "#FEA3\\FEA3_036#I am Tlaoxac, priest of Quetzecoatl. Only one who knows his ways may approach his holy ground.",
- "#FEA3\\FEA3_037#I do not understand your words, but it does not matter. You may not pass until blood is shed.",
- "#FEA3\\FEA3_038#I will not listen to your deceitful ways.",
- "#FEA3\\FEA3_039#Indeed you know the ways of Quetzecoatl But only a man of courage, one who will shed blood will pass.",
- "#FEA3\\FEA3_040#None can threaten the great Quetzecoatl! You lie! Truly you do not serve the serpent-god. You may not pass!",
- "#FEA3\\FEA3_041#None shall pass until blood is shed.", // TYPO
- "#FEA3\\FEA3_042#Nonetheless, that is what must be done. Only men of courage are allowed into his presence.",
- "#FEA3\\FEA3_043#Self-sacrifice is the noblest quality of humanity. You may go. Beware the monster in the water. You may have my knife to defend yourself.",
- "#FEA3\\FEA3_044#You are truly a noble man, unlike the coward who was not capable of shedding his own blood. You may pass, but beware the man in the golden robe. He may lead you to your death. Use this knife to defend yourself.",
- "#FEA3\\FEA3N000#McCoy seems rather nervous.",
- "#FEA3\\FEA3N001#Primitive lights illuminate this savage scene.",
- "#FEA3\\FEA3N002#Spock looks small compared to the great warrior.",
- "#FEA3\\FEA3N003#The aztec warrior lies on the ground unconcious.",
- "#FEA3\\FEA3N004#The snake enjoys snacking on you.",
- "#FEA3\\FEA3N005#This was once a living member of your crew.",
- "#FEA3\\FEA3N006#Tloaxac falls to the ground unconscious.",
- "#FEA3\\FEA3N007#Towering over your security officer, holding a great spear in his huge hands, the great warrior Tlaoxac will let no one pass him.",
- "#FEA3\\FEA3N010#You pick up the beautifully crafted knife.",
- "#FEA3\\FEA3N011#You see a jewel encrusted, gold colored knife.",
- "#FEA3\\FEA3N012#Your security officer looks at you for orders and, perhaps, inspiration.",
-
-
- "#FEA4\\FEA4_001#A swarm of fireflies, Jim.",
- "#FEA4\\FEA4_002#Everyone is healthy, Jim, there's no need for the medical kit here.",
- "#FEA4\\FEA4_003#I would strongly recommend against touching these, Jim. They are highly toxic.",
- "#FEA4\\FEA4_004#It's getting a little cool out here. Keep warm. I don't want a bunch of sick crewmen when we get back to the ship. If we ever do get back to the ship.",
- "#FEA4\\FEA4_005#Still out, Jim.",
- "#FEA4\\FEA4_006#You're looking a little pale, Jim.",
- "#FEA4\\FEA4_007#Fascinating. The trees are able to grow very close together in this forest, Captain.",
- "#FEA4\\FEA4_008#I am reading a life form to the west, Captain.",
- "#FEA4\\FEA4_009#It vaguely resembles the Terran Spanish Bayonette. The edges of the leaf are razor sharp and secrete a poisonous resin.",
- "#FEA4\\FEA4_010#Small colonies of bio-luminescent insects, Captain.",
- "#FEA4\\FEA4_011#They are not currently operational, Captain.",
- "#FEA4\\FEA4_012#Tralxacian mushrooms. Their spores are highly toxic and are released if they are disturbed.",
- "#FEA4\\FEA4_013#Does every planetside mission have this much adventure, Captain? Mind you, I can't say Mr. Quetzecoatl is making a very good impression on me...",
- "#FEA4\\FEA4N000#A large fern fans the pathway.",
- "#FEA4\\FEA4N001#Below this rock is a large growth of mushrooms.",
- "#FEA4\\FEA4N002#Familiar glowing spheres light the path.",
- "#FEA4\\FEA4N003#Feral red eyes glare out of the dark at you.",
- "#FEA4\\FEA4N004#James T. Kirk realizes that every step increases their danger.",
- "#FEA4\\FEA4N005#Lt. Stragey smiles as he strolls down the path.",
- "#FEA4\\FEA4N006#McCoy doesn't want to be bothered right now.",
- "#FEA4\\FEA4N007#Mr. Spock analyzes the surroundings.",
- "#FEA4\\FEA4N008#You are in a dark forest. You can hear the flow of water to the northwest.",
-
-
- "#FEA5\\FEA5_001#This is a very finely crafted knife.",
- "#FEA5\\FEA5_002#Captain, I believe it would be suicide to try crossing the log while the creature is near.",
- "#FEA5\\FEA5_003#Captain, I do not believe that my service to Starfleet includes, as humans say, 'throwing my life away'.",
- "#FEA5\\FEA5_004#Captain, I would recommend using something to cut the plant. There are numerous small thorns along the stem.",
- "#FEA5\\FEA5_005#Captain, it would not be wise to cross while the creature is near.",
- "#FEA5\\FEA5_006#Due to the small size of the knife, I doubt it would harm such a large creature.",
- "#FEA5\\FEA5_007#Anyone for a campfire?",
- "#FEA5\\FEA5_008#Captain, I'll declare you unfit to command if you keep this up!",
- "#FEA5\\FEA5_009#Damn! That's gonna hurt Jim. Take a look at those thorns. You might try cutting that with something.", // TYPO
- "#FEA5\\FEA5_010#Everyone is healthy, Jim, there's no need for the medical kit here.",
- "#FEA5\\FEA5_011#I'm not reading that creature anymore, Jim.",
- "#FEA5\\FEA5_013#It's some kind of squid, and it doesn't look very friendly.",
- "#FEA5\\FEA5_014#Jim! There's some kind of an aquatic creature down there.",
- "#FEA5\\FEA5_015#Jim, that's ludicrous!",
- "#FEA5\\FEA5_016#Jim, we've been friends a long time, but... I mean... you're not serious?",
- "#FEA5\\FEA5_018#Jim, with our phasers not working, we may need that knife to protect ourselves!", // TYPO
- "#FEA5\\FEA5_019#This planet is starting to get to me. I'm sure something just hit me.",
- "#FEA5\\FEA5_020#You weren't a snake handler in your previous life were you? I don't like snakes.", // TYPO
- "#FEA5\\FEA5_021#Good throw, Captain. However, I think the creature was merely startled. It may return in a little while.",
- "#FEA5\\FEA5_022#I recommend caution here, Captain.",
- "#FEA5\\FEA5_023#It appears that the leaves are slightly toxic. I would not recommend touching it for an extended amount of time, Captain.",
- "#FEA5\\FEA5_024#It is some kind of mollusk; the river seems to be its home, and it is carnivorous, eating land and river based forms of life.",
- "#FEA5\\FEA5_025#It would appear that the plant secretes a chemical that is a natural repellent to the creature. It has retreated far down stream, Captain.",
- "#FEA5\\FEA5_026#Nothing unusual here, Captain.",
- "#FEA5\\FEA5_027#Please stop that Captain. I have enough distractions from Dr. McCoy.",
- "#FEA5\\FEA5_028#Still inoperative, Captain.",
- "#FEA5\\FEA5_029#Thank you Captain, but Vulcans do not use knives.",
- "#FEA5\\FEA5_030#The tricorder registers a lifeform, a large marine creature, lurking just below the surface of the water.",
- "#FEA5\\FEA5_031#The tricorder shows nothing unusual, Captain. The creature is still down stream.",
- "#FEA5\\FEA5_032#Was there a reason for that, Captain?",
- "#FEA5\\FEA5_033#Captain, perhaps I should try to cross first.",
- "#FEA5\\FEA5_034#I'll give it a try, Captain.",
- "#FEA5\\FEA5_035#It looks like that plant fights back sir. You might want to use something to cut it loose.",
- "#FEA5\\FEA5_036#Reminds me of a planet I was stationed on once. The native girls were real friendly. Ensign Shou had his bachelor party there, great time. You ever been to Omicron Draconis, Captain?",
- "#FEA5\\FEA5_037#Sir, I finished second in my weight class in wrestling at the Academy, but I don't think that thing's in my weight class.",
- "#FEA5\\FEA5_038#Sir, you dropped your rock.",
- "#FEA5\\FEA5_039#Thanks Captain, but I can take care of myself. I finished second in my weight class in wrestling at the Academy. You keep the knife.",
- "#FEA5\\FEA5_040#You're weird, sir.",
- "#FEA5\\FEA5N000#A pair of eyes are all that you can see of the rest of this creature. Most of it is hidden beneath the murky water.",
- "#FEA5\\FEA5N001#Captain Kirk is looking at the big creature in the water.",
- "#FEA5\\FEA5N002#Dr. McCoy is looking at the big creature in the water.",
- "#FEA5\\FEA5N003#He will not do that.",
- "#FEA5\\FEA5N004#Lt. Stragey is looking at the big creature in the water.",
- "#FEA5\\FEA5N005#Luminescent insects swarm near a large tree.",
- "#FEA5\\FEA5N006#Mr. Spock is looking ahead to a cave opening on the other side of the log.",
- "#FEA5\\FEA5N007#The log looks quite old but sturdy.",
- "#FEA5\\FEA5N008#The plant is tough. You will need something sharp to cut it.",
- "#FEA5\\FEA5N009#The river water is too muddy to get an idea of its depth or what may be beneath the surface.",
- "#FEA5\\FEA5N010#The snake bites you.",
- "#FEA5\\FEA5N011#The snake disapears beneath the surface of the water.",
- "#FEA5\\FEA5N012#There is a slow muddy river blocking your path. A strong thick log serves as a footbridge. The river is unmoving, and the heat and stillness are oppressive.",
- "#FEA5\\FEA5N013#There seems to be a lit cave beyond the log.",
- "#FEA5\\FEA5N014#This plant has a rather thick stem and prickly leaves.", // TYPO
- "#FEA5\\FEA5N015#You already have a piece of the plant.",
-
-
- "#FEA6\\FEA6_001#I think I can get it with a few more blows.",
- "#FEA6\\FEA6_002#Have you ever made it up the face of Half Dome, Lieutenant?",
- "#FEA6\\FEA6_003#Perhaps we should hold onto that hope, Mr. Spock, that a civilised being will not kill for trivial motives.",
- "#FEA6\\FEA6_004#Sometimes I feel like I'm the Captain of a nursery school.",
- "#FEA6\\FEA6_005#That creature was quite real Mr. Spock. We will discuss this with our host, when we see him.",
- "#FEA6\\FEA6_006#Then, gentlemen, I would advise you to stop arguing.",
- "#FEA6\\FEA6_007#Unfortunately, human history is full of people who did not practice what they preached. Quetzecoatl is just one in a long line of them.",
- "#FEA6\\FEA6_008#Will you two morons stop arguing just once!",
- "#FEA6\\FEA6_009#Damn it Jim, I'm a surgeon not a geologist.",
- "#FEA6\\FEA6_011#Everyone is healthy, Jim, there's no need for the medical kit here.",
- "#FEA6\\FEA6_012#It would appear that our tentacled friend wants dessert. You can't go back that way, unless you enjoy being eaten.",
- "#FEA6\\FEA6_013#I've lost any appetite I may have had for squid, Jim.", // TYPO
- "#FEA6\\FEA6_014#Jim! Going back across that river would be insane.",
- "#FEA6\\FEA6_015#Well, they're not organic. What did you think they were, calcified tribbles?",
- "#FEA6\\FEA6_016#Captains and security officers. They don't realize how fragile the human body can be.",
- "#FEA6\\FEA6_017#Well isn't this just great!", // TYPO
- "#FEA6\\FEA6_018#Fascinating. These rocks are limestone, but contain an unusually high content of heavy metals. There are dilithium crystals here, but in a very raw form.",
- "#FEA6\\FEA6_019#I fail to see any logic in that action, Captain. It may also cause stalactites to fall.", // TYPO
- "#FEA6\\FEA6_020#I would suggest using something to pry that loose, Captain.",
- "#FEA6\\FEA6_021#It is unwise to use a rock here, Captain.",
- "#FEA6\\FEA6_022#My tricorder indicates unusual energy patterns in this direction, Captain.",
- "#FEA6\\FEA6_023#Still inoperative, Captain.",
- "#FEA6\\FEA6_024#The creature is still there, Captain.",
- "#FEA6\\FEA6_025#These stalactites were made from limestone deposits. They took millennia to form.",
- "#FEA6\\FEA6_026#These stalagmites were made from limestone deposits. They took millennia to form.",
- "#FEA6\\FEA6_027#This appears to be a formation of raw dilithium crystals, Captain.",
- "#FEA6\\FEA6_028#This illogical action would only dull the knife.",
- "#FEA6\\FEA6_029#Agreed, Captain.",
- "#FEA6\\FEA6_030#This whole experience feels like a test. The equivalent of 20th Century earth lab rats running through a maze.",
- "#FEA6\\FEA6_031#I would wait until we meet him before judging him, Captain.",
- "#FEA6\\FEA6_032#Captain, I cannot speak for Dr. McCoy, but my intelligence quotient is far higher than humans...",
- "#FEA6\\FEA6_033#Doctor, I would point out that your voice could also trigger such a collapse.",
- "#FEA6\\FEA6_034#I should warn you that the stalactites could collapse quite easily. Any sudden motion could cause large quantities of stalactites to fall on us.",
- "#FEA6\\FEA6_035#I would suggest we continue on, Captain. It would not be logical to endanger ourselves by remaining here.",
- "#FEA6\\FEA6_036#It would seem to be a prudent course of action Captain, if Doctor McCoy would agree.",
- "#FEA6\\FEA6_037#Really? That's fascinating Captain.",
- "#FEA6\\FEA6_038#There is a contradiction, Captain. If Quetzecoatl is really an entity of peace, then Lt. Stragey should not have died.",
- "#FEA6\\FEA6_039#Captain, have we done something wrong?",
- "#FEA6\\FEA6_040#I don't think I'll be able to get a good grip sir. You might try prying it loose.",
- "#FEA6\\FEA6_041#If we ever get back to Earth, one hundred credits says I'll beat you.",
- "#FEA6\\FEA6_042#Reminds me of some spelunking I did on Hades IV. Ever do any climbing, Captain?",
- "#FEA6\\FEA6_043#Sure we do. That's the challenge.",
- "#FEA6\\FEA6N000#A stalagtite breaks through and falls. You are mortally injured and die.", // TYPO
- "#FEA6\\FEA6N001#An interesting, but useless, manuever.",
- "#FEA6\\FEA6N002#As usual, Dr. McCoy looks annoyed by the mission. ",
- "#FEA6\\FEA6N003#Darkness, leading into the unknown.",
- "#FEA6\\FEA6N004#However, a strange force envelopes your body...",
- "#FEA6\\FEA6N005#It is a large cluster of crystals.",
- "#FEA6\\FEA6N006#It's Game Over man...",
- "#FEA6\\FEA6N007#James Kirk remembers the last time he was in a cave, and is glad that this one seems more peaceful.",
- "#FEA6\\FEA6N008#Lieutenant Stragey looks nervously at the stalactites hovering precariously above you.",
- "#FEA6\\FEA6N009#Nothing happens.",
- "#FEA6\\FEA6N010#Nothing happens.",
- "#FEA6\\FEA6N011#Spock is his usual stoic self.",
- "#FEA6\\FEA6N012#Stalactites descend from the ceiling.",
- "#FEA6\\FEA6N013#Stalagmites rise from the floor of the cave.",
- "#FEA6\\FEA6N014#They appear to be ordinary rocks. Spock's tricorder might say otherwise.",
- "#FEA6\\FEA6N015#This is one place where dilithium crystals don't seem to be very useful.",
- "#FEA6\\FEA6N016#This is the way that you entered the cave. If you leave this way, the tentacled creature that attacked you will probably try to get a second course for its dinner.", // TYPO
- "#FEA6\\FEA6N017#You have one dilithium crystal, in raw form.",
- "#FEA6\\FEA6N020#You will need something to pry it loose.",
- "#FEA6\\FEA6N028#You manage to pry loose one dilithium crystal.",
- "#FEA6\\FEA6N029#You scratch your initials. No dilithium crystals were found.",
-
-
- "#FEA7\\FEA7_001#Scotty, five to beam up.",
- "#FEA7\\FEA7_002#Scotty, four to beam up.",
- "#FEA7\\FEA7_003#You've got to do it, Bones! If the Klingons realize he's no longer a threat to them, perhaps we can avoid a war!",
- "#FEA7\\FEA7_004#Absolutely. Your best intentions were changed by the imperfect humans that you left in charge after you departed. Such is the way of our race, I'm afraid.",
- "#FEA7\\FEA7_005#I've had it up to here with so-called superior beings terrorizing my crew because we're so 'primitive'. Maybe you should see how primitive you are before you go around testing others.",
- "#FEA7\\FEA7_006#One thing first. If you're so peaceful, how come the Aztecs were so violent and agressive?",
- "#FEA7\\FEA7_007#The Federation is not in the business of lying, mister.",
- "#FEA7\\FEA7_008#We're a technologically advanced starfaring race, what do you think? That we wouldn't have made progress in medicine?",
- "#FEA7\\FEA7_009#With Dr. McCoy, I sometimes wonder, but yes, I would say we have made considerable advances.",
- "#FEA7\\FEA7_010#Yes, I guess we do. Go on.",
- "#FEA7\\FEA7_011#Yes, why do you ask?",
- "#FEA7\\FEA7_012#You messed up in a big way. Perhaps you should try following the Prime Directive. It changed our lives.",
- "#FEA7\\FEA7_013#Jim, I'll try, but the physiology is completely alien...",
- "#FEA7\\FEA7_014#You show great wisdom, sir. But your statement implies that you wish to change your condition.",
- "#FEA7\\FEA7_015#At the top of my spine is a gland not found in your species. This is the seat of my power. I wish you to remove it, thereby making me a mortal.",
- "#FEA7\\FEA7_016#First, I have one question...",
- "#FEA7\\FEA7_017#I am sorry you had to go through this ordeal. It was not meant for you to die.",
- "#FEA7\\FEA7_018#I sense truth in this. Perhaps this is what happened to my children on the Klingon world of Hrakkour, which would explain why they are searching for me. I have clearly abused the power that was given me long ago.",
- "#FEA7\\FEA7_019#I tried to teach them the concept of self-sacrifice. It would appear they did not completely understand my teachings.",
- "#FEA7\\FEA7_020#I was not aware you had been tested before. My apologies.",
- "#FEA7\\FEA7_021#I was particularly impressed by the sacrifice made by Lt. Stragey. Of course, I gave him back his life. He is now safely aboard your vessel.",
- "#FEA7\\FEA7_022#I watched as you worked through the problems I set in your path. you are a valiant, intelligent species.",
- "#FEA7\\FEA7_023#I would have been more impressed had you found a less violent solution. My children are dear to me. Even so, few choices remain to me.",
- "#FEA7\\FEA7_024#Indeed. If my mission of peace was overthrown, then I am no longer worthy of my power. Tell me, has your species made progress in the medical arts?",
- "#FEA7\\FEA7_025#Of course, how foolish of me. Still, there are cultures where medical knowledge is considered a sign of weakness. Warrior cultures, where nothing matters but physical strength. Survival of the foolish.",
- "#FEA7\\FEA7_026#Ours is an intensely curious race, Captain. My brothers and I have raised children on a thousand worlds, loved them, watched them grow, only to see them become separated from us by the passage of time. It is sad and lonely process, one which I shall not repeat again. I am no longer worthy of my gift.",
- "#FEA7\\FEA7_027#Please sit down. We have much to discuss.",
- "#FEA7\\FEA7_028#Then I shall ask to make use of your advances.",
- "#FEA7\\FEA7_029#You are clearly not the liars I thought you to be. Were you telling me the truth about my disciples? That they became ruthless savages?",
- "#FEA7\\FEA7_030#Your harshness is unwarranted, but I sense truth in this. Perhaps this is what happened to my children on the Klingon world of Hrakkour, which would explain why they are searching for me. I have clearly abused the power that was given me long ago.",
-
-
- "#TRI0\\TRI0_001#I want your word of honor, Vlict, that Quetzecoatl will not be harmed while we take these tests.",
- "#TRI0\\TRI0_002#I've faced Klingons, both in personal and ship-to-ship combat. Your own records will confirm this. If I'm not worthy of their honors, why didn't they kill me?",
- "#TRI0\\TRI0_003#Then the Klingon Empire is wrong.",
- "#TRI0\\TRI0_004#Those are serious charges, Vlict. Should he not be tried by a Klingon High Court?",
- "#TRI0\\TRI0_006#By our standards, he would rank among the greatest heroes of the Federation: Gandhi, Surak, M'lelto-jhi, Shanarda. We will not abandon him.",
- "#TRI0\\TRI0_007#Ensign!",
- "#TRI0\\TRI0_008#Fine. Can we get this over with? I've got shore leave scheduled on Ryza next week.",
- "#TRI0\\TRI0_009#Give me an opportunity. If I succeed, Quetzecoatl goes free.",
- "#TRI0\\TRI0_010#Guess I can't argue with you. Pleasant conquests, admiral.",
- "#TRI0\\TRI0_011#I'm a warrior, Vlict! I hereby intervene for him and demand the honors and responsibilities of a warrior's trial!",
- "#TRI0\\TRI0_013#I'm James T. Kirk. I'm more worthy than you'll ever be, and I have girlfriends on fifty planets who will vouch for that!",
- "#TRI0\\TRI0_014#If it means that I can prevent you from murdering an ancient and blameless creature, yes. And I'm prepared to back it up.",
- "#TRI0\\TRI0_015#Oh well. I'm afraid you're on your own, Quetzecoatl.",
- "#TRI0\\TRI0_016#Stick around, Vlict. There are more surprises awaiting you.",
- "#TRI0\\TRI0_017#Then a Klingon can thrive on the conflict between his inner nature and his philosophy. Clearly, the people of Hrakkour did that.",
- "#TRI0\\TRI0_018#Then this trial is a mockery for the entire galaxy to see!",
- "#TRI0\\TRI0_019#There's nothing less appealing than a gloating Klingon, Vlict. Let's get this trial under way.",
- "#TRI0\\TRI0_020#This is a matter for a philosophical debate, not a trial! The state has no right to interfere in a person's conscience.",
- "#TRI0\\TRI0_021#Why does every Klingon tell me they expected to meet me in battle? You really have a one-track mind!",
- "#TRI0\\TRI0_022#You will act with the discipline of a Federation officer, Ensign, or you will return to the Enterprise. Do I make myself clear?",
- "#TRI0\\TRI0_023#You're going to kill this old man because he encouraged non-violence? The Federation cannot accept this.",
- "#TRI0\\TRI0_024#Any hostile action here may result in the destruction of the Enterprise.",
- "#TRI0\\TRI0_025#Captain, I estimate the odds of this court acquitting Quetzecoatl at 0.086 percent.",
- "#TRI0\\TRI0_026#Captain, may I remind you that we are deep in Klingon space? If we attack them here, they may respond by destroying the Enterprise.",
- "#TRI0\\TRI0_027#Damn it Jim, I'm a doctor not a arbitrator.",
- "#TRI0\\TRI0_028#Damn it, Jim! I use my hands to save lives not take them.",
- "#TRI0\\TRI0_029#He's still weak from the operation.",
- "#TRI0\\TRI0_030#One healthy adult klingon male.",
- "#TRI0\\TRI0_031#I've got nothing to say to you, Jim.",
- "#TRI0\\TRI0_034#Nobody needs healing, Jim, but you will if they harm my patient.",
- "#TRI0\\TRI0_035#Nothing of interest.",
- "#TRI0\\TRI0_036#Don't be a fool, Jim! We can't risk the Enterprise! We've already signed one person's death warrant!", // TYPO
- "#TRI0\\TRI0_037#Low level radiation, within safety limits. But you wouldn't want to spend more than a few days here.",
- "#TRI0\\TRI0_038#Nothing of interest.",
- "#TRI0\\TRI0_039#Children should not even play at war. To prepare them to kill is barbaric.",
- "#TRI0\\TRI0_040#I have failed. Death is what I deserve.",
- "#TRI0\\TRI0_041#I offered them insights into the philosophy of peace and cooperation. They chose to follow it of their own free will.",
- "#TRI0\\TRI0_042#I'm frightened, Captain, but if I am to die, then I shall die well.",
- "#TRI0\\TRI0_043#A Federation officer, claiming the rights of a Klingon warrior? How dare you insult me, Kirk!",
- "#TRI0\\TRI0_044#As for you Kirk, I expected a more forceful response. I had heard you were a worthy opponent. Instead, I see a cringing coward. Leave this place, Kirk. You dishonor it.",
- "#TRI0\\TRI0_045#Ha! Ha! You have never encountered Klingon women, Captain. But that was the response of a true warrior. You have earned my respect. I shall give you and your companions a chance to defend the traitor.",
- "#TRI0\\TRI0_046#He has admitted guilt. You have surrendered him to Klingon law. Can you deny that this was a fair trial?",
- "#TRI0\\TRI0_047#He has not demonstrated honor, Kirk! Only a proven warrior may be tried in High Court! Principles of honor are not applicable to his defense!",
- "#TRI0\\TRI0_048#How typical of the Federation, to judge every other species as morally inferior. Your rhetoric is not welcome here!",
- "#TRI0\\TRI0_049#I hereby sentence K'etz'coatl to a coward's death.",
- "#TRI0\\TRI0_050#K'etz'koatl, you encouraged the colony to destroy its weapons. You even encouraged them to hold their children from our traditional military ceremonies.",
- "#TRI0\\TRI0_051#Only the greatest warriors of old could say such a thing and expect to live! Do you think yourself worthy enough to walk in their footsteps?",
- "#TRI0\\TRI0_052#Pacifism is utterly alien to our people. It would be as though he preached a doctrine of suicide in direct contradiction of the will to live. Honorable men thrive in war and conflict -- cowards seek to avoid conflict.",
- "#TRI0\\TRI0_053#So Kirk, we finally meet. I had thought it would be in battle, but the universe holds many surprises.",
- "#TRI0\\TRI0_054#So be it. This begins the trial of the entity K'etz'koatl, who is charged with impersonating a klingon, stirring dissent, encouraging cowardice, and treason in the highest degree.",
- "#TRI0\\TRI0_055#Stories of your impudence are not exaggerated. You shall have your chance. It is a pity we will not meet again, Captain.",
- "#TRI0\\TRI0_056#That oversight, Kirk, is easily rectified.",
- "#TRI0\\TRI0_057#The Klingon Empire will not tolerate dissent.",
- "#TRI0\\TRI0_058#The prisoner and his witnesses will stand forth, so the trial may begin!",
- "#TRI0\\TRI0_059#To counsel it is to counsel cowardice. To counsel it is to abandon all honor! This is treason, for all to see! The penalty for treason in this system is death! Do you accept your sentence?",
- "#TRI0\\TRI0_060#Very well. You have my word. Captain Kallarax, transport them to the Test of Life.",
- "#TRI0\\TRI0_061#You and your three companions may face the tests that we set for the defender. Then we shall see if you are as worthy as a Klingon!",
- "#TRI0\\TRI0_062#You will not speak unless the court requests it, Kirk!",
- "#TRI0\\TRI0_063#Awaiting your orders, sir!",
- "#TRI0\\TRI0_064#But I did, sir. Lieutenant Hildebrandt is a third dan in karate. Toughest fighter I've ever known...",
- "#TRI0\\TRI0_065#Who are you calling a weakling? I've had tougher girlfriends than you, pal!",
- "#TRI0\\TRI0_066#Yes sir.",
- "#TRI0\\TRI0_F24#How amusing. Federation weaklings.",
- "#TRI0\\TRI0N000#A Klingon guard. A big Klingon guard. A big Klingon guard with his disruptor ready to fire on anyone who gives him trouble.",
- "#TRI0\\TRI0N001#Admiral Vlict, commander of the Klingon flagship K'lirta.",
- "#TRI0\\TRI0N002#Dr. McCoy glares angrily at Kirk. It is obvious he does not like seeing his patient handed over to the Klingons.",
- "#TRI0\\TRI0N003#Ensign Bennie stares around the Klingon court, distrusting everything he sees.",
- "#TRI0\\TRI0N004#James T. Kirk, trapped in a situation he cannot win, forced to watch a travesty of justice... or is he?",
- "#TRI0\\TRI0N005#Mr. Spock looks stoically at the klingon bench. Expecting to win this case would be illogical.",
- "#TRI0\\TRI0N006#This bench is marked with the symbol of the Klingon Court of High Justice, the two Triangles of Words and Blood, linked together.",
- "#TRI0\\TRI0N007#This city was destroyed by heavy bombardment and intense doses of neutrino rays that killed all known forms of life on this planet.",
- "#TRI0\\TRI0N008#This is the famous seal of the Klingon Empire.",
- "#TRI0\\TRI0N009#Your new found friend looks rather frightened right now, and you don't blame him.",
- "#TRI0\\TRI0U075#Uhura here. Captain, there's a force field over the planet. We will not be able to beam you aboard.",
-
-
- "#TRI1\\TRI1_002#Affirmative, Uhura.",
- "#TRI1\\TRI1_003#Affirmative.",
- "#TRI1\\TRI1_004#Beam us to Vlict's position.",
- "#TRI1\\TRI1_005#Beam us back to the Enterprise. Kirk out.",
- "#TRI1\\TRI1_006#I want that door open.",
- "#TRI1\\TRI1_007#I somehow doubt that Vlict intends for us to survive this, whatever the outcome. We're the only thing that stands between him and the killing of Quetzecoatl that he can justify.",
- "#TRI1\\TRI1_008#Negative. Transmit the door entry code only.",
- "#TRI1\\TRI1_009#Negative.",
- "#TRI1\\TRI1_010#That's not true, Ensign. However, I suspect that Vlict's attack on Hrakkour exceeded his orders. He needs Quetzecoatl as a scapegoat, and he needs a fair trial to avoid an inquiry of his own actions.",
- "#TRI1\\TRI1_011#Uhura, prepare to receive a tricorder message. There is a door with an entry coder here; try to analyze the circuits and let the main computer crack the code.",
- "#TRI1\\TRI1_012#This creature is composed of electrical fields. I would not recommend approaching it. A metal projectile might disrupt its fields and render it harmless.",
- "#TRI1\\TRI1_013#A Klingon entry door, slightly antiquated.",
- "#TRI1\\TRI1_014#An entry coder for the door, keyed to a number sequence. The tricorder is unable to determine the code, but can scan the mechanism.",
- "#TRI1\\TRI1_015#Captain, I would strongly recommend against disturbing the rod. It could result in awakening the creature or possibly electrocuting you.",
- "#TRI1\\TRI1_016#Do you know what ten million volts can do to a man? It can ruin his whole damn day.",
- "#TRI1\\TRI1_017#Does not register as a known life form.",
- "#TRI1\\TRI1_018#Find someone else to be a volunteer. I've retired.",
- "#TRI1\\TRI1_019#How could you do it, Jim? I spent hours trying to save his life, and you just gave him away in seconds to the Klingons!",
- "#TRI1\\TRI1_020#I don't know the code.",
- "#TRI1\\TRI1_021#Jim! Are you mad? that's our only way out!",
- "#TRI1\\TRI1_022#One Male Human, average physical condition.",
- "#TRI1\\TRI1_023#He's a Male Human, excellent physical condition.",
- "#TRI1\\TRI1_024#Male Human, good physical condition.",
- "#TRI1\\TRI1_025#One male Human-Vulcan hybrid. Excellent physical condition.", // TYPO
- "#TRI1\\TRI1_026#Nobody needs healing, Jim, but you will if they harm my patient.",
- "#TRI1\\TRI1_027#Ouch!",
- "#TRI1\\TRI1_029#This is not in my field of expertise.",
- "#TRI1\\TRI1_030#This is not in my field of expertise.",
- "#TRI1\\TRI1_031#What the blazes do you want me to do on a rock?",
- "#TRI1\\TRI1_032#A test of courage? That is the Klingon way.",
- "#TRI1\\TRI1_033#I'll bet it'll be mad.",
- "#TRI1\\TRI1_034#Shut up Spock!",
- "#TRI1\\TRI1_035#I do not understand the desired course of action.",
- "#TRI1\\TRI1_036#If you will observe the position of the creature, Captain, I think that you will find that it prevents access to the keypad.",
- "#TRI1\\TRI1_037#Ouch!",
- "#TRI1\\TRI1_038#The door is already open Captain.",
- "#TRI1\\TRI1_039#The odds of surviving contact with the creature are too small to calculate.",
- "#TRI1\\TRI1_040#There is a high probability that shooting the door would be hasardous to our wellbeing.",
- "#TRI1\\TRI1_041#These wooden rods are support beams that were not placed.",
- "#TRI1\\TRI1_042#This rock has a high iron content.",
- "#TRI1\\TRI1_043#This wall was carved from the natural rock.",
- "#TRI1\\TRI1_044#We do not know the code, Captain.",
- "#TRI1\\TRI1_045#As I suspected, Captain. The creature is in stasis. It should awaken in 3.48 days.",
- "#TRI1\\TRI1_046#Captain, I have calculated the odds of surviving this at...",
- "#TRI1\\TRI1_047#Not much is known about Hrakkour, Ensign. This would appear to be some sort of a mining installation; that creature might be a native lifeform.",
- "#TRI1\\TRI1_048#Captain, my instructor at the Academy always told me that if you don't know what you're going to do with your phaser, you shouldn't draw it.", // TYPO
- "#TRI1\\TRI1_049#Do you want me to arrest it, interrogate it, or beat it up, Captain?",
- "#TRI1\\TRI1_050#I refuse, Captain, on the grounds that it might eliminate me.",
- "#TRI1\\TRI1_051#I refuse, Captain, on the grounds that it might eliminate me.",
- "#TRI1\\TRI1_052#Ouch!",
- "#TRI1\\TRI1_053#You handled those Klingons well, sir. We've got them on the run now.",
- "#TRI1\\TRI1_054#You want me to smash it? But that's our only way out of here.",
- "#TRI1\\TRI1_055#And our deaths will be the only way he can get it. Great.",
- "#TRI1\\TRI1_056#What is this place?",
- "#TRI1\\TRI1_057#Why should he worry about justification, Captain? He's a Klingon. Murder is as natural to them as breathing!",
- "#TRI1\\TRI1_J00#Why do I have the feeling that I'm about to have a bad day?",
- "#TRI1\\TRI1N000#A field of static lightning. It seems to be moving in a purposeful manner.",
- "#TRI1\\TRI1N001#A slightly antiquated Klingon door, opened by a keycode entry.",
- "#TRI1\\TRI1N002#A slightly antiquated Klingon lock-mechanism.",
- "#TRI1\\TRI1N003#James T. Kirk, hero of the galaxy!",
- "#TRI1\\TRI1N004#No effect.",
- "#TRI1\\TRI1N005#No effect.",
- "#TRI1\\TRI1N006#The floor is incomplete, made of unrefined, natural rock.",
- "#TRI1\\TRI1N007#The melted rock is cooling, but still remains in a molten state.",
- "#TRI1\\TRI1N008#The wall is resistant to phaser fire.",
- "#TRI1\\TRI1N009#These wooden rods are support beams that were not placed.",
- "#TRI1\\TRI1N011#This section of wall was carved by some sort of plasma field.",
- "#TRI1\\TRI1N012#You burn one of the rods.",
- "#TRI1\\TRI1N013#You coat the rod with molten iron. It hardens quickly.",
- "#TRI1\\TRI1N014#You melt some of the rock.",
- "#TRI1\\TRI1N015#Your ever dependable crewman, Ensign Bennie.",
- "#TRI1\\TRI1N016#Your ever emotional friend, Dr. McCoy.",
- "#TRI1\\TRI1N017#Your ever logical friend, Spock.",
- "#TRI1\\TRI1U068#Nothing else to report Captain.",
- "#TRI1\\TRI1U079#Affirmative sir. We will transmit code when you activate the keycode. Uhura out.",
- "#TRI1\\TRI1U080#Affirmative, sir.",
- "#TRI1\\TRI1U086#Captain, there is a force field between us and the planet.",
- "#TRI1\\TRI1U090#Do you wish to be beamed up now Captain?",
- "#TRI1\\TRI1U095#Good luck, Captain.",
- "#TRI1\\TRI1U098#Keep us informed, we'll help you all we can. We can analyze any data you gather through the main computer.",
- "#TRI1\\TRI1U101#Scan complete. Main computer has the code. We also read an anomaly. Something else has tapped into the keycode. Shall I analyze?",
- "#TRI1\\TRI1U102#Sir, we have a secondary code that is nested in the Klingon program. Computer is unable to analyze its function. Shall we broadcast it to you when you activate the keypad?",
- "#TRI1\\TRI1U106#We have your position at approximately thirty meters beneath the surface of Hrakkour, in what appears to be the ruins of an archeological dig.",
- "Zzzt! Sptttz! Zzzt! Tttt!",
- "Clunk.",
-
-
- "#SFX\\QUIET#Zzzzzzzzzzzmmmm.",
- "#TRI2\\TRI2_001#This reminds me of an old practical joke that Finnegan played on me back at the Academy.",
- "#TRI2\\TRI2_002#...some kind of energy source a few meters from our position. We know.",
- "#TRI2\\TRI2_003#Beam us back to the Enterprise. Kirk out.",
- "#TRI2\\TRI2_004#Beam us to Vlict's position.",
- "#TRI2\\TRI2_005#I don't know, Ensign.",
- "#TRI2\\TRI2_006#Keep working on it, but don't try to beam us up unless I give the signal.",
- "#TRI2\\TRI2_007#Negative.",
- "#TRI2\\TRI2_008#Whatever it is, we have to find a way to get by it.",
- "#TRI2\\TRI2_009#Extreme increase in energy level, Captain. It absorbed the phaser fire. An unexpected reaction is occuring, high levels of lethal radiation are being produced.",
- "#TRI2\\TRI2_010#Do you want me to hit my head against it?",
- "#TRI2\\TRI2_011#It does not register as a life form.",
- "#TRI2\\TRI2_012#I'm not touching some damned ball of energy!",
- "#TRI2\\TRI2_013#If you hadn't been so damned anxious to give my patient to the Klingons, we wouldn't be in this mess.",
- "#TRI2\\TRI2_014#One Male Human, average physical condition.",
- "#TRI2\\TRI2_015#He's a male Human, excellent physical condition.", // TYPO
- "#TRI2\\TRI2_016#Male Human, good physical condition.",
- "#TRI2\\TRI2_017#One male Human-Vulcan hybrid. Excellent physical condition.", // TYPO
- "#TRI2\\TRI2_018#Nobody needs healing, Jim, but you will if they harm my patient.",
- "#TRI2\\TRI2_019#Fascinating. It would appear that Vlict sent us into this place in the hope that we would be killed.",
- "#TRI2\\TRI2_020#Fascinating. These automatons are not stable.",
- "#TRI2\\TRI2_021#Fascinating. These automatons are not stable.",
- "#TRI2\\TRI2_022#I do not understand the desired course of action.",
- "#TRI2\\TRI2_023#Marked increase in energy level, Captain. It absorbed the phaser fire. No appreciable increase in mass.",
- "#TRI2\\TRI2_024#The automaton is emitting a protective force field, Captain. We cannot proceed further without rendering it inoperative.",
- "#TRI2\\TRI2_025#The automaton's energy level has increased slightly. It absorbed the phaser fire. No appreciable increase in mass.",
- "#TRI2\\TRI2_026#The ball of energy is an automaton, Captain. It is an artificial construct, programmed to block any movements; I can detect no other function or intelligence.",
- "#TRI2\\TRI2_027#These walls were carved from the natural rock of the cavern.",
- "#TRI2\\TRI2_028#This automaton is generating a force field, Captain. I am physically incapable of touching it.",
- "#TRI2\\TRI2_029#This wall was carved from the natural rock of a cavern.",
- "#TRI2\\TRI2_030#I believe Ensign, that this energy sphere is some sort of automaton, programmed to block our movements.",
- "#TRI2\\TRI2_031#I refuse, Captain, on the grounds that it might incinerate me.",
- "#TRI2\\TRI2_032#Uh, pardon sir?",
- "#TRI2\\TRI2_033#We're not going to get out of this alive, are we Captain?",
- "#TRI2\\TRI2_034#Captain, what is that thing?",
- "#TRI2\\TRI2_F11#This automaton is generating a force field, Captain. I am physically incapable of touching it.",
- "#TRI2\\TRI2N000#A pulsing globe of energy.",
- "#TRI2\\TRI2N001#Commander Spock, a patient and thoughtful Federation first officer.",
- "#TRI2\\TRI2N002#Ensign Bennie, faithful and true security officer.",
- "#TRI2\\TRI2N003#James T. Kirk, a rather frustated Federation starship captain.",
- "#TRI2\\TRI2N004#Klingon insignia.",
- "#TRI2\\TRI2N005#Leads back to the room where the Electrical creature was.",
- "#TRI2\\TRI2N006#Leonard McCoy, a crusty country doctor, and Starfleet's finest surgeon.",
- "#TRI2\\TRI2N007#Rock wall. Looks like it was carved from stone by Klingon heavy mining equipment.",
- "#TRI2\\TRI2N008#The walls are resistant to phaser fire.",
- "#TRI2\\TRI2U074#Please keep in contact with us. We'll keep you informed if further developments occur. Uhura out.",
- "#TRI2\\TRI2U081#By the way, sensors indicate...",
- "#TRI2\\TRI2U087#Captain, there is still a barrier between us and the planet. Mr. Scott thinks there might be a way to break through it, and he's working on it now, but the Klingons won't like it.",
- "#TRI2\\TRI2U091#Do you wish to be beamed up now Captain?",
- "#TRI2\\TRI2U104#Understood, Captain.",
-
-
- "#TRI3\\TRI3_001#This is too easy. I don't like it.",
- "#TRI3\\TRI3_002#Beam us directly to the Enterprise.",
- "#TRI3\\TRI3_003#Beam us directly to Vlict's position.",
- "#TRI3\\TRI3_004#Deaths, Bones. Our deaths.",
- "#TRI3\\TRI3_005#I don't like it. This was too easy.",
- "#TRI3\\TRI3_006#We'll call you if we want to transport. Kirk out.",
- "#TRI3\\TRI3_007#We're fine, lieutenant.",
- "#TRI3\\TRI3_008#Captain, Starfleet protocol requires that the commanding officer lead in hazardous situations.",
- "#TRI3\\TRI3_009#Approximately thirty Klingons, within 500 meters of the opening, no closer than 200 meters.",
- "#TRI3\\TRI3_010#Damn it Jim, I'm a Doctor, not a structural Engineer!",
- "#TRI3\\TRI3_011#He's out like a light, Jim. There are hibernating Arcturian sloth-tigers that will get up more quickly than this guy.",
- "#TRI3\\TRI3_012#I believe that you have seniority, Jim.",
- "#TRI3\\TRI3_013#One Male Human, average physical condition.", // TYPO
- "#TRI3\\TRI3_014#He's a Male Human, excellent physical condition.", // TYPO
- "#TRI3\\TRI3_015#Male Human, good physical condition.", // TYPO
- "#TRI3\\TRI3_016#One Male Human-Vulcan hybrid. Excellent physical condition.", // TYPO
- "#TRI3\\TRI3_017#Nobody needs healing, Jim, but you will if they harm my patient.",
- "#TRI3\\TRI3_018#Well, maybe I've been too hard on you, Jim. I'm sorry.",
- "#TRI3\\TRI3_019#Easy! Are you out of your mind?",
- "#TRI3\\TRI3_020#Electrical monsters, things that explode when you phaser them, what else does he want?",
- "#TRI3\\TRI3_021#I do not understand the desired course of action.",
- "#TRI3\\TRI3_022#I recommend caution, Captain.",
- "#TRI3\\TRI3_023#Reading a high energy build-up; there is a Klingon explosive device present five point three meters outside the cavern! It could be detonated at any moment!",
- "#TRI3\\TRI3_024#This wall was carved from the natural rock of a cavern.",
- "#TRI3\\TRI3_025#Admiral Vlict has a reputation for thoroughness, Doctor. If he means to kill us, we can expect more than we've encountered.",
- "#TRI3\\TRI3_026#How hard do you want me to hit it, sir.",
- "#TRI3\\TRI3_027#No sir. I insist that you have the honor of leading us to victory.",
- "#TRI3\\TRI3_028#What are waiting for, sir? Shouldn't we just get out of here?",
- "#TRI3\\TRI3_029#When I get out of this, I am going to have the best shore leave in Starfleet history!",
- "#TRI3\\TRI3_030#Daylight! We're almost there! We've beaten them!",
- "#TRI3\\TRI3_103#Beam us back to the Enterprise. Kirk out.",
- "#TRI3\\TRI3_104#Beam us to Vlict's position.",
- "#TRI3\\TRI3_107#Negative.",
- "#TRI3\\TRI3N000#Captain James Tiberius Kirk, deep in thought.",
- "#TRI3\\TRI3N001#Doctor Leonard McCoy, a rather disgruntled surgeon.",
- "#TRI3\\TRI3N002#Ensign Bennie, who wishes that he was back at the Academy right now...",
- "#TRI3\\TRI3N003#No gunslinging allowed, space cowboy.",
- "#TRI3\\TRI3N004#Spock, one of the foremost science officers in Starfleet.",
- "#TRI3\\TRI3N005#The exit to this particular complex. You hope.",
- "#TRI3\\TRI3N006#The wall is resistant to phaser fire.",
- "#TRI3\\TRI3N007#The wall of this corridor.",
- "#TRI3\\TRI3U067#Captain, we're still working on breaching the force field. We will let you know when we're ready to beam you out.",
- "#TRI3\\TRI3U080#Affirmative, sir.",
- "#TRI3\\TRI3U084#Captain, our sensors have picked up phaser fire! Are you all right? Captain, please come in!", // TYPO
- "#TRI3\\TRI3U089#Do you wish to be beamed up now Captain?",
- "#TRI3\\TRI3U099#Mr. Scott has found a way to breach the force field!",
-
-
- "#TRI4\\TRI4_001#Admiral, one day the weaklings are going to surprise the Hell out of you.",
- "#TRI4\\TRI4_002#Do Klingons believe in ghosts?",
- "#TRI4\\TRI4_003#I don't want it to end like this.", // TYPO
- "#TRI4\\TRI4_004#I don't really give a damn.",
- "#TRI4\\TRI4_005#I won't let you. I chal...",
- "#TRI4\\TRI4_006#I'm sorry we couldn't do more.",
- "#TRI4\\TRI4_007#I'm sorry we couldn't do more.",
- "#TRI4\\TRI4_008#Justice?",
- "#TRI4\\TRI4_009#Maybe you aren't as good as you think you are.",
- "#TRI4\\TRI4_010#No it isn't.",
- "#TRI4\\TRI4_011#Nothing you have done has been honorable, Vlict! One day, everyone in the Klingon empire will know it too. Perhaps one day even you will realize it.",
- "#TRI4\\TRI4_012#Scotty, beam us up.",
- "#TRI4\\TRI4_013#Then you admit that it was you, and not Quetzecoatl who was responsible for the death of Hrakkour.",
- "#TRI4\\TRI4_014#Then you admit this trial is a sham! A charade!",
- "#TRI4\\TRI4_015#Then you will not object to presenting the orders from the Klingon Council authorizing mass murder on Hrakkour.",
- "#TRI4\\TRI4_016#We beat you, Vlict. Unless you free Quetzecoatl, you will lose your honor!",
- "#TRI4\\TRI4_017#What!",
- "#TRI4\\TRI4_018#As we say on Earth, Vlict, nature beat me to it.",
- "#TRI4\\TRI4_019#Did you listen to anything he said? One day, in spite of people like you, the Klingons will know peace. I hope I live to see that day.",
- "#TRI4\\TRI4_020#Farewell my friend. Vlict, if you respect honor, you will make it quick and painless.", // TYPO
- "#TRI4\\TRI4_021#He knows more about courage than you or your Empire will ever know.",
- "#TRI4\\TRI4_022#Honor? Give me a break, Vlict! You were trying to kill us!",
- "#TRI4\\TRI4_023#How can a liar like you even say the word \"honor\" without blushing?",
- "#TRI4\\TRI4_024#How can you call him a traitor without giving him a fair trial!", // TYPO
- "#TRI4\\TRI4_025#I do not know if you are a praying man, Vlict. If I were you, I would not want to meet me again.",
- "#TRI4\\TRI4_026#If you kill him, the Empire will learn that you betrayed them by destroying Hrakkour.",
- "#TRI4\\TRI4_027#Isn't it time that we stopped playing games, Vlict?",
- "#TRI4\\TRI4_028#Shut up Vlict.",
- "#TRI4\\TRI4_029#Then you have my deepest respect. I am sorry I cannot do more for you.",
- "#TRI4\\TRI4_030#There's a time to fight for what you believe, and a time to die for it. I hope you chose the right time, Quetzecoatl.",
- "#TRI4\\TRI4_031#Vlict is right, Quetzecoatl. This is suicide. It is a cowardly action.",
- "#TRI4\\TRI4_032#You didn't say I wasn't allowed to use my ship's computer. If you didn't explain the rules clearly, whose fault is that?",
- "#TRI4\\TRI4_033#You don't lie very well, do you?",
- "#TRI4\\TRI4_034#You lost, Vlict. I beat your test. Release Quetzecoatl and let us go!",
- "#TRI4\\TRI4_036#Jim! You can't let him do this!",
- "#TRI4\\TRI4_037#You never had any intention of letting Quetzecoatl live!",
- "#TRI4\\TRI4_038#He is correct, Captain.",
- "#TRI4\\TRI4_039#I believe that the use of guile, to do what the enemy does not expect, is considered very honorable by the Klingons.", // TYPO
- "#TRI4\\TRI4_040#As do I. My only regret is that I did not get to know you better. If only a part of what you are is because you learned from the mistakes of my acolytes, my work was not in vain.",
- "#TRI4\\TRI4_041#But before I die, I believe that Klingon law allows me to make a public statement.",
- "#TRI4\\TRI4_042#Captain, I do not see any successful resolution to this, except with my death. Dying to prevent conflict would give it meaning.",
- "#TRI4\\TRI4_043#Captain, I taught others self-sacrifice. Now I must practice what I preached. It is the only way to atone for my crimes.",
- "#TRI4\\TRI4_044#Captain, I thank you for your efforts on my behalf, but it is over.",
- "#TRI4\\TRI4_045#Captain, I thank you for your efforts on my behalf, but it is over.",
- "#TRI4\\TRI4_046#Captain, I thank you for your efforts on my behalf, but it is over.",
- "#TRI4\\TRI4_047#I know Captain. But it's better this way.",
- "#TRI4\\TRI4_048#I know Captain.",
- "#TRI4\\TRI4_049#I know, Captain.",
- "#TRI4\\TRI4_050#I, who was once immortal, know that truth is the only true immortal. You can kill people, cultures, even gods, but the truth will always survive.",
- "#TRI4\\TRI4_051#Intelligent beings are not meant to be caged, either by tyranny, or barbarism. Those who try doom themselves to failure.",
- "#TRI4\\TRI4_052#No captain. Let there be an end to this violence. I will not allow any more blood to be shed, save my own. I taught the doctrine of self-sacrifice, and I shall die of it.",
- "#TRI4\\TRI4_053#Once a culture has tasted peace, it will not desire anything else, because peace is better than war, love is better than hate, and creation is better than destruction. This is Truth.",
- "#TRI4\\TRI4_054#A coward's attitude. He shames this soil.",
- "#TRI4\\TRI4_055#As judge, I determine what is fair and what is unfair, Kirk! The trial is at an end. The verdict is guilty.",
- "#TRI4\\TRI4_056#As long as the Federation continues to foster such weaklings, the triumph of the Klingon Empire is assured.",
- "#TRI4\\TRI4_057#Do not threaten me, Kirk! If you expect the Empire to believe you instead of me, you are greatly mistaken.", // TYPO
- "#TRI4\\TRI4_058#Do you think that you can make a fool of me, Kirk!",
- "#TRI4\\TRI4_059#Go back to your Federation, Kirk!",
- "#TRI4\\TRI4_060#How dare you lecture me on points of honor! I, the most decorated warrior in the entire empire! I, who took the dishonored trash of my homeworld and destroyed it with a fist of steel!",
- "#TRI4\\TRI4_061#How dare you! The test was supposed to take place without interference from your ship. You have shown all lack of honor.",
- "#TRI4\\TRI4_062#I am tired of this posturing, Kirk. You know what the verdict is. Go back to your ship.",
- "#TRI4\\TRI4_063#I shall agree to it, Captain. Until we meet again.",
- "#TRI4\\TRI4_064#If I had been trying to murder you, Kirk, you would have surely died.",
- "#TRI4\\TRI4_065#If I was not bound by the Organian treaty, you would be a dead man now, Kirk! Perhaps one day, I shall not be bound by it.",
- "#TRI4\\TRI4_066#Of course it was, you fool! Did you honestly expect us to act with kindness to traitors? You fought a battle that you could not win, and fought it very well. Go home, Kirk.",
- "#TRI4\\TRI4_067#Perhaps because Klingons do not blush. You've lost, Kirk. Go home.",
- "#TRI4\\TRI4_068#Return to your ship, Kirk. The trial is over.",
- "#TRI4\\TRI4_069#Such threats, Kirk, will only increase my longing for the experience.",
- "#TRI4\\TRI4_070#The death ceremony shall take place aboard the K'lirta. I trust you are satisfied that justice has been done.",
- "#TRI4\\TRI4_071#The trial is over! He is guilty. Durn, carry out the sentence!",
- "#TRI4\\TRI4_072#Those who lose honor lose life, Kirk! It is the Klingon way!",
- "#TRI4\\TRI4_073#To allow a traitor to live would dishonor me. I will not live with such a stain on my honor.",
- "#TRI4\\TRI4_074#To free a traitor is to lose all honor, Kirk! He is sentenced to die!",
- "#TRI4\\TRI4_075#Very well. The trial is over. K'etz'koatl is sentenced to death.",
- "#TRI4\\TRI4_076#You humans have an excellent imagination, but a poor grasp of reality.",
-
-
- "#TRI5\\TRI5_001#Obviously, they want us to place the gems in the holes, but which one...",
- "#TRI5\\TRI5_002#Gentlemen, I suggest we start trying to find out what this is. I have a feeling we've come some place Vlict wasn't expecting us to go.",
- "#TRI5\\TRI5_003#Hoist on your own petard, eh, Vlict? Do you want me to help you?",
- "#TRI5\\TRI5_004#I do not see what can be served by more killing.",
- "#TRI5\\TRI5_005#I fear that politics will make it impossible. Your planet is in Klingon space. But I don't understand why the Klingons never detected you.",
- "#TRI5\\TRI5_006#If I have your word that Quetzecoatl goes free, I'm willing to intervene to save you.",
- "#TRI5\\TRI5_007#If I have your word that Quetzecoatl goes free, I'm willing to intervene to save you.",
- "#TRI5\\TRI5_008#You tried to send me to my death. Now you can rot as you get what you deserve.",
- "#TRI5\\TRI5_009#You tried to eliminate me. Now you can rot as you get what you deserve.",
- "#TRI5\\TRI5_010#Captain, it seems to be some sort of interface device, but I do not know how to activate it.",
- "#TRI5\\TRI5_011#Jim, I have no idea what it is. Why don't you try asking Spock.",
- "#TRI5\\TRI5_012#Nobody needs healing, Jim, but you will if they harm my patient.",
- "#TRI5\\TRI5_013#We've got to get out of here, Jim!",
- "#TRI5\\TRI5_014#Even I can see that, you pointy-eared freak!",
- "#TRI5\\TRI5_015#He really doesn't have a likable personality, does he?",
- "#TRI5\\TRI5_016#I suspect Captain, that the machinery is activated by placing the gems in the proper slots. We should determine a system for this.",
- "#TRI5\\TRI5_017#This is not Klingon technology, Captain.",
- "#TRI5\\TRI5_018#Kirk!",
- "#TRI5\\TRI5_019#Agreed!",
- "#TRI5\\TRI5_020#Kirk! This is your doing!",
- "#TRI5\\TRI5_021#Rrrrr. Very well. I agree to your terms.",
- "#TRI5\\TRI5_022#You have no right to try me!",
- "#TRI5\\TRI5_023#You want me to beg like a weakling child cowering before his betters!",
- "#TRI5\\TRI5_024#This is Bialbi, the most advanced lifeform on this world. Thank you for informing us of the situation. It shall be resolved.",
- "#TRI5\\TRI5_025#A life for a life is a just bargain. But his crimes are beyond count.",
- "#TRI5\\TRI5_026#Admiral Vlict, the entity Quetzecoatl shall be set free. If you ever return to this sector, the sentence shall be carried out. No Klingon vessel may ever return to this world.",
- "#TRI5\\TRI5_027#Admiral Vlict, this is the defensive system of Hrakkour. You have engaged in genocidal activities on this world. Have you anything to say before your sentence is passed?",
- "#TRI5\\TRI5_028#As for you, Captain, you may return. I find your social development most pleasing.",
- "#TRI5\\TRI5_029#I have as much right as you to conduct trials on this planet. You showed no justice to your victim. The penalty for injustice is death.",
- "#TRI5\\TRI5_030#Idealism! An advanced concept! Naive, perhaps, but charming in its simplicity.",
- "#TRI5\\TRI5_031#No, Admiral, it is not, but that will suffice as a final public statement. The sentence is banishment, to you and all members of your crew who were involved in this action.",
- "#TRI5\\TRI5_032#Now, you may go. Heed my warning Vlict. I shall not be merciful a second time.",
- "#TRI5\\TRI5_033#Their archeological digs did come close, Captain, but I am very elusive. I waited and monitored the situation and chose to reveal myself to you.",
- "#TRI5\\TRI5_034#You will be returned to your ship, Captain. As will the creature who was unfairly punished. You need not witness the Klingon's punishment.",
- "#TRI5\\TRI5_035#Not primed for neural interlink.",
- "#TRI5\\TRI5_036#Alien vessels scanned.",
- "#TRI5\\TRI5_037#Integrator now active",
- "#TRI5\\TRI5_038#Telepathic entry codes required for greater than level One functions. Neural interlink at the integrator, and use the main index code of my light.", // TYPO
- "#TRI5\\TRI5_039#That combination is restricted to higher order functions. Neural interlink required.",
- "#TRI5\\TRI5_040#This is Bialbi, High Mentalic of Hrakkour. For defense, use the light of war. For information, use my light. For transportation, use the light of travel. Sequences are keyed by combinations of crystals.",
- "#TRI5\\TRI5_041#To use any light, the first crystal must correspond to the color of the light.",
- "#TRI5\\TRI5_042#Force field blocks trans-system transport. Transport aborted. Use defense systems to eliminate alien vessels.",
- "#TRI5\\TRI5_043#That destination no longer exists. Transport abandoned.",
- "#TRI5\\TRI5_044#There is damage in the archive section due to a recent neutrino burst. Transport aborted.",
- "#TRI5\\TRI5_045#There is no battle site at present to which to transport you.", // TYPO
- "#TRI5\\TRI5_046#We can transport you only in proximity of nearest humanoid life. Transport imminent.",
- "#TRI5\\TRI5_047#Alien vessels scanned.",
- "#TRI5\\TRI5_048#Breach of protocol. Alien invasion imminent. Internal security activated.",
- "#TRI5\\TRI5_049#Internal defenses off line. Failsafes cancelled.",
- "#TRI5\\TRI5_050#Planetary defenses revived. All alien vessels in orbit destroyed.",
- "#TRI5\\TRI5_051#I guess I should've taken a few more science courses at the Academy.",
- "#TRI5\\TRI5_052#What is this place?",
- "#TRI5\\TRI5N002#A platform emitting a beam of light.", // TYPO
- "#TRI5\\TRI5N004#A strange yellow light.",
- "#TRI5\\TRI5N005#James T. Kirk, hero of the galaxy!",
- "#TRI5\\TRI5N006#Openings on the platform. Place something in these holes?",
- "#TRI5\\TRI5N007#Your communicator is not working.",
- "#TRI5\\TRI5N008#Your ever emotional friend, Dr. McCoy.",
- "#TRI5\\TRI5N009#Your ever logical friend, Spock.",
- "#TRI5\\TRI5N010#Your ever nervous crewman, Ensign Bennie.",
- "#TRI5\\TRI5N011#Your phaser is not working.",
- "#TRI5\\TRI5N012#Your tricorder's recording functions are working, but it does not seem to be able to analyze.",
- "#TRI5\\TRI5N013#This large gem appears to be a ruby of unusual size. This is obviously artificial.",
- "#TRI5\\TRI5N014#This large gem appears to be a ruby of unusual size. This is obviously artificial.",
- "#TRI5\\TRI5N015#This large gem appears to be a ruby of unusual size. This is obviously artificial.",
- "#TRI5\\TRI5N016#This large gem appears to be a sapphire of unusual size. This is obviously artificial.", // TYPO
- "#TRI5\\TRI5N017#This large gem appears to be a sapphire of unusual size. This is obviously artificial.", // TYPO
- "#TRI5\\TRI5N018#This large gem appears to be a sapphire of unusual size. This is obviously artificial.", // TYPO
- "#TRI5\\TRI5N019#This large gem appears to be an emerald of unusual size. This is obviously artificial.", // TYPO
- "#TRI5\\TRI5N020#This large gem appears to be an emerald of unusual size. This is obviously artificial.", // TYPO
- "#TRI5\\TRI5N021#This large gem appears to be an emerald of unusual size. This is obviously artificial.", // TYPO
-
-
- "#SIN0\\SIN0_001#Good Mr. Scott. I'll keep you posted. Kirk out.",
- "#SIN0\\SIN0_002#Let me know if things change. Kirk out.",
- "#SIN0\\SIN0_003#Mr. Scott?",
- "#SIN0\\SIN0_004#Scotty, report on the transporter problem.",
- "#SIN0\\SIN0_005#That will still give us plenty of time, Scotty.",
- "#SIN0\\SIN0_006#That's what we're here to find out. The unknown.",
- "#SIN0\\SIN0_007#We didn't notice anything beaming down.",
- "#SIN0\\SIN0_008#Which means that this moon might still be inhabited, Mr. Spock.",
- "#SIN0\\SIN0_009#Aside from the security door on what should be a lifeless planetoid, this place is unremarkable.",
- "#SIN0\\SIN0_010#It's what I was afraid of, Jim. The thin atmosphere of this moon doesn't provide enough protection from cosmic rays. We shouldn't stay here any more than a few hours.",
- "#SIN0\\SIN0_011#The atmosphere is breathable, Jim, but hardly nourishing. We should either get inside or go back to the ship.",
- "#SIN0\\SIN0_012#There's not much I can do for cosmic radiation. It's best if we find some cover indoors.",
- "#SIN0\\SIN0_013#Do you have Vulcan blood ensign?",
- "#SIN0\\SIN0_014#I never realized the Orions ever got past decadence... They hadn't the last time I was there.",
- "#SIN0\\SIN0_015#These stones resemble those on Earth, on Easter Island.",
- "#SIN0\\SIN0_016#I cannot get readings from this range, Captain. But if we do not hurry there will be nothing left to get a reading on.",
- "#SIN0\\SIN0_017#The rocks have a high quantity of Tri-Phosphorate Silver in them.",
- "#SIN0\\SIN0_018#Unremarkable except for low grade power emanations from the door area.",
- "#SIN0\\SIN0_019#As expected Captain. The source of power emanations lies beyond that door.",
- "#SIN0\\SIN0_020#Large quantities of atmosphere are being circulated through these rocks. I would guess there are storage units within this satellite which are constantly replacing the atmosphere that is lost because of this moon's weak gravity.",
- "#SIN0\\SIN0_021#Stone monoliths of faces are a common artistic expression in evolving cultures...",
- "#SIN0\\SIN0_022#Unknown, ensign.",
- "#SIN0\\SIN0_023#We have detected no signs of life, Captain, but the possibility does exist.",
- "#SIN0\\SIN0_024#Area secure, Captain.",
- "#SIN0\\SIN0_025#A power source that has lasted millenia and endured major catastrophes. That's fascinating, Mr. Spock.",
- "#SIN0\\SIN0_026#How can there be an atmosphere on a moon of this size?",
- "#SIN0\\SIN0_027#Like the faces on Vandu II. Even the animal face art of the Orion Post-Decadence Movement is similar.",
- "#SIN0\\SIN0_028#No, sir.",
- "#SIN0\\SIN0_S01#No change Captain. Although why it happened is about as clear as a foggy night in Glasgow.",
- "#SIN0\\SIN0_S48#Aye. We've had some slight problems with the transporters.",
- "#SIN0\\SIN0_S49#I know. I have the lads in Engineering doing a complete overhaul of the ship's systems.",
- "#SIN0\\SIN0_S50#Just a glitch in the main transporter program. Mr. Kyle is loading a back-up, and we're performing tests. The transporters will be down for about an hour.",
- "#SIN0\\SIN0N000#Dr. Leonard McCoy, knowing that they aren't likely to encounter any medical problems, is rather annoyed about being dragged yet again into the transporter.",
- "#SIN0\\SIN0N001#Ensign Mosher seems to be rather curious about the planet's technology.",
- "#SIN0\\SIN0N002#James T. Kirk, worried about the safety of the people of Proxtrey.",
- "#SIN0\\SIN0N003#Mr. Spock looks forward to examining the technology of this ancient culture.",
- "#SIN0\\SIN0N004#Ten thousand points of light are visible to the naked eye through the thin atmosphere of this moon.",
- "#SIN0\\SIN0N005#The heavy-duty security door is now open.",
- "#SIN0\\SIN0N006#There are many rocks here.",
- "#SIN0\\SIN0N007#This is the planet Proxtrey, currently six hundred thousand kilometers from this moon.",
- "#SIN0\\SIN0N008#This looks like a heavy-duty security door built into the side of a hill on this moon.",
- "#SIN0\\SIN0N009#This moon has a thin but breathable atmosphere.",
- "#SIN0\\SIN0N010#You retrieve a rock.",
- "#SIN0\\SIN0N011#These stones look like faces.",
- "#SIN0\\SIN0U069#Nothing new to report Captain.",
- "#SIN0\\SIN0U082#Captain, Mr. Scott wishes to speak with you.",
-
-
- "#SIN1\\SIN1_001#Spock, see what you can do with that lock.",
- "#SIN1\\SIN1_002#Check her record, Mr. Scott. She was in the top ten percent of her class in computer systems analysis.",
- "#SIN1\\SIN1_003#Isolate that virus. That's your number one priority.",
- "#SIN1\\SIN1_004#Just do your best, Scotty. Kirk out.",
- "#SIN1\\SIN1_005#There goes our back-up plan. Do what you can, Mr. Scott.",
- "#SIN1\\SIN1_006#Well, we won't be able to phaser any outbound missiles.",
- "#SIN1\\SIN1_007#What is it, Scotty?",
- "#SIN1\\SIN1_008#Your situation, Mr. Scott?",
- "#SIN1\\SIN1_009#A security lock, Captain.",
- "#SIN1\\SIN1_010#A working display panel, Captain.",
- "#SIN1\\SIN1_011#Ah, that worked. I see you deduced that 10200, in the Lucrs base three was equal to their sacred number 99.",
- "#SIN1\\SIN1_012#Damn it, Jim. I'm a doctor, not a locksmith!",
- "#SIN1\\SIN1_013#No appreciable cosmic radiation damage. Yet.",
- "#SIN1\\SIN1_014#There's not much I can do for cosmic radiation. It's best if we find some cover indoors.",
- "#SIN1\\SIN1_015#We should stay inside as much as possible. We must try to protect ourselves from the cosmic radiation.",
- "#SIN1\\SIN1_016#It would be useless Captain. The door could easily withstand our phaser fire.",
- "#SIN1\\SIN1_017#That did not seem to work, Captain. Perhaps we should try a number that had some significance to them. Remember they were very superstitious.",
- "#SIN1\\SIN1_018#That prompted a response, Captain. 01210 is 100 in base four, a number the Sofs regarded as sacred.",
- "#SIN1\\SIN1_019#The door still appears to be in operating condition.",
- "#SIN1\\SIN1_020#The origin point for the broadcast Uhura monitored was approximately fifty meters beyond this door.",
- "#SIN1\\SIN1_021#There is power running to the keypad.",
- "#SIN1\\SIN1_022#This appears to be a dust-covered lens of some sort.",
- "#SIN1\\SIN1_023#This is the focal lense for an anti-intruder laser.",
- "#SIN1\\SIN1_024#Unremarkable.",
- "#SIN1\\SIN1_025#We should carefully consider everything we know about this culture before taking action.",
- "#SIN1\\SIN1_026#From what we know about the Lucrs, they had an affinity for size. Their machines weren't just equipment; they were also monuments.",
- "#SIN1\\SIN1_027#It appears that our mission has increased in importance.",
- "#SIN1\\SIN1_028#I'm just a security officer, Sir.",
- "#SIN1\\SIN1_029#I can believe that.",
- "#SIN1\\SIN1_030#This door is huge. If they were humanoid, they could have been giants...",
- "#SIN1\\SIN1_S10#Captain, I'm afraid we've got a wee problem here.",
- "#SIN1\\SIN1_S17#That it is, Captain. We'll keep you informed. Scott out.",
- "#SIN1\\SIN1_S18#There is some sort of virus in the main computer. Our phasers and tractor beams have been disabled, and there's no way we're getting them back in three hours.",
- "#SIN1\\SIN1_S20#We'll find that virus soon Captain, or I'm an Englishman.",
- "#SIN1\\SIN1_S51#We're still looking for the virus, Captain. I even have Lieutenant Uhura looking through the computer system. I never realized the lass was so good with them.",
- "#SIN1\\SIN1_S85#Aye, I will Captain. I may yet have a trick or two that I can pull, but don't count on any miracles.",
- "#SIN1\\SIN1N000#A lens sits above the doorway, but is it mere decoration?",
- "#SIN1\\SIN1N001#Built into the rock is a very large door.",
- "#SIN1\\SIN1N002#Ensign Mosher is glad to be a member of this landing party, at least for now.",
- "#SIN1\\SIN1N003#It looks like some sort of display panel.",
- "#SIN1\\SIN1N004#It never ceases to amaze you how passive Spock can be, even in the presence of extraordinary wonders.",
- "#SIN1\\SIN1N005#James T. Kirk, A man with a problem. A big problem that is getting bigger.",
- "#SIN1\\SIN1N006#McCoy is examining himself for cosmic radiation sickness symptoms.",
- "#SIN1\\SIN1N007#Meteorites have hit this door and left it undamaged. What are you going to do with a rock?",
- "#SIN1\\SIN1N008#The doorway into the complex is huge.",
- "#SIN1\\SIN1N009#This appears to be some sort of security lock.",
- "#SIN1\\SIN1N010#This heavy-duty door has taken numerous micrometeorite strikes but still appears solid.",
- "#SIN1\\SIN1N011#This is a keypad that looks functional.",
- "#SIN1\\SIN1U070#Nothing new to report Captain.",
-
-
- "#SIN3\\SIN3_012#Can't say I like the decor.",
-
-
- "#VENA\\VENA_F41#Kirk out.",
-
-
- "#sfx\\spokcoff#cough... cough...",
- "#SFX\\STATICU1#Ent... neu ... trans...",
-};
+// defined in text.cpp
+extern const char *const g_gameStrings[];
}
Commit: bf1e125fa3af95027c9504dcc80bbb9e991bcefc
https://github.com/scummvm/scummvm/commit/bf1e125fa3af95027c9504dcc80bbb9e991bcefc
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Remove trailing backslash in module.mk
Changed paths:
engines/startrek/module.mk
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 397b9b3..51f3853 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -66,7 +66,7 @@ MODULE_OBJS = \
rooms/sins2.o \
rooms/sins3.o \
rooms/sins4.o \
- rooms/sins5.o \
+ rooms/sins5.o
Commit: 93ca6a7b489fc1f382f963f09e291497b4aa8ece
https://github.com/scummvm/scummvm/commit/93ca6a7b489fc1f382f963f09e291497b4aa8ece
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: SINS2
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/sins0.cpp
engines/startrek/rooms/sins1.cpp
engines/startrek/rooms/sins2.cpp
engines/startrek/text.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index ad3206f..16473d9 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -524,12 +524,14 @@ struct AwayMission {
byte field32; // 0x32
bool field33; // 0x33
bool doorLaserFiredOnce; // 0x34
+ bool gotPointsForAccessingTerminal; // 0x35
byte field39; // 0x39
- bool openedDoor; // 0x3d
- bool field3e; // 0x3e
+ bool openedOuterDoor; // 0x3d
+ bool openedInnerDoor; // 0x3e
bool enteredRoom0FirstTime; // 0x42
bool scottyInformedKirkAboutVirus; // 0x43
- bool field44; // 0x44
+ bool enteredRoom2FirstTime; // 0x44
+ bool field46; // 0x46
bool gotPointsForScanningStatue; // 0x48
bool enteredRoom1FirstTime; // 0x50
int16 missionScore; // 0x52
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 53c0b07..581f9aa 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2228,6 +2228,44 @@ public:
// SINS2
void sins2Tick1();
+ void sins2UsePhaserOnDoor();
+ void sins2UseSTricorderAnywhere();
+ void sins2UseKirkOnTerminal();
+ void sins2UseSpockOnTerminal();
+ void sins2SpockReachedTerminal();
+ void sins2SpockUsedTerminal();
+ void sins2UseMccoyOnTerminal();
+ void sins2UseRedshirtOnTerminal();
+ void sins2UseSTricorderOnTerminal();
+ void sins2UseSTricorderOnKeypad();
+ void sins2UseSTricorderOnDoor();
+ void sins2UseKirkOnKeypad();
+ void sins2UseSpockOnKeypad();
+ void sins2SpockReachedKeypad();
+ void sins2EnteredCorrectCode();
+ void sins2EnteredIncorrectCode();
+ void sins2DoorFinishedOpening();
+ void sins2Tick40();
+ void sins2LookAnywhere();
+ void sins2LookAtOpenDoor();
+ void sins2LookAtTerminal();
+ void sins2LookAtKeypad();
+ void sins2LookAtKirk();
+ void sins2LookAtSpock();
+ void sins2LookAtMccoy();
+ void sins2LookAtRedshirt();
+ void sins2TalkToKirk();
+ void sins2TalkToSpock();
+ void sins2TalkToMccoy();
+ void sins2TalkToRedshirt();
+ void sins2LookAtDoor();
+ void sins2UseSpockOnDoor();
+ void sins2UseCommunicator();
+ void sins2UseMedkitOnCrewman();
+ void sins2UseMTricorderOnCrewman();
+ void sins2UseMccoyOnKeypad();
+ void sins2UseRedshirtOnKeypad();
+ void sins2WalkToDoor();
// SINS3
void sins3Tick1();
diff --git a/engines/startrek/rooms/sins0.cpp b/engines/startrek/rooms/sins0.cpp
index 7fb4f08..04a931d 100644
--- a/engines/startrek/rooms/sins0.cpp
+++ b/engines/startrek/rooms/sins0.cpp
@@ -84,9 +84,9 @@ void Room::sins0Tick1() {
if (!_awayMission->sins.enteredRoom0FirstTime)
_awayMission->disableInput = 2;
- if (_awayMission->sins.field3e)
+ if (_awayMission->sins.openedInnerDoor)
loadActorAnim2(OBJECT_DOOR, "s0dr2", 0, 0);
- if (_awayMission->sins.openedDoor)
+ else if (_awayMission->sins.openedOuterDoor)
loadActorAnim2(OBJECT_DOOR, "s0dr1", 0, 0);
playMidiMusicTracks(MIDITRACK_27, -3);
diff --git a/engines/startrek/rooms/sins1.cpp b/engines/startrek/rooms/sins1.cpp
index 76a959f..356a99c 100644
--- a/engines/startrek/rooms/sins1.cpp
+++ b/engines/startrek/rooms/sins1.cpp
@@ -96,13 +96,13 @@ void Room::sins1Tick1() {
// BUGFIX: Set this to 2, not 1 (disable input even after walking animation is done)
_awayMission->disableInput = 2;
- if (_awayMission->sins.openedDoor) {
+ if (_awayMission->sins.openedOuterDoor) {
loadActorAnim2(OBJECT_DOOR, "s1dro", 0, 0);
loadMapFile("sins12");
} else
loadMapFile("sins1");
- if (_awayMission->sins.field3e)
+ if (_awayMission->sins.openedInnerDoor)
loadActorAnim2(OBJECT_DOOR, "s1ndro", 0, 0);
_awayMission->sins.field32 = 1;
@@ -153,7 +153,7 @@ void Room::sins1UseSTricorderOnLock() {
}
void Room::sins1UseSTricorderOnDoor() {
- if (!_awayMission->sins.openedDoor)
+ if (!_awayMission->sins.openedOuterDoor)
spockScan(DIR_N, TX_SIN1_019);
}
@@ -173,24 +173,24 @@ void Room::sins1UseRockOnDoor() {
}
void Room::sins1UseRedshirtOnKeypad() {
- if (!_awayMission->sins.openedDoor)
+ if (!_awayMission->sins.openedOuterDoor)
showText(TX_SPEAKER_MOSHER, TX_SIN1_028);
}
void Room::sins1UseMccoyOnKeypad() {
- if (!_awayMission->sins.openedDoor)
+ if (!_awayMission->sins.openedOuterDoor)
showText(TX_SPEAKER_MCCOY, TX_SIN1_012);
}
void Room::sins1UseKirkOnKeypad() {
- if (!_awayMission->sins.openedDoor) {
+ if (!_awayMission->sins.openedOuterDoor) {
showText(TX_SPEAKER_KIRK, TX_SIN1_001);
sins1UseSpockOnKeypad();
}
}
void Room::sins1UseSpockOnKeypad() {
- if (!_awayMission->sins.openedDoor) {
+ if (!_awayMission->sins.openedOuterDoor) {
_awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
walkCrewmanC(OBJECT_SPOCK, 0xfd, 0xad, &Room::sins1SpockReachedKeypad);
}
@@ -221,7 +221,7 @@ void Room::sins1SpockReachedKeypad() {
void Room::sins1EnteredCorrectCode() {
_awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0xf3, 0xad);
- _awayMission->sins.openedDoor = true;
+ _awayMission->sins.openedOuterDoor = true;
loadMapFile("sins12");
loadActorAnimC(OBJECT_DOOR, "s1door", 0, 0, &Room::sins1DoorDoneOpening);
playVoc("HUGEDOO2");
@@ -318,7 +318,7 @@ void Room::sins1LookAtLens() {
}
void Room::sins1UseCommunicator() {
- if (!_awayMission->sins.field44) {
+ if (!_awayMission->sins.enteredRoom2FirstTime) {
showText(TX_SPEAKER_KIRK, TX_SIN1_008);
showText(TX_SPEAKER_SCOTT, TX_SIN1_S51);
showText(TX_SPEAKER_KIRK, TX_SIN1_002);
@@ -337,7 +337,7 @@ void Room::sins1UseMTricorderOnCrewman() {
}
void Room::sins1WalkToDoor() {
- if (_awayMission->sins.openedDoor)
+ if (_awayMission->sins.openedOuterDoor)
walkCrewman(OBJECT_KIRK, 0x98, 0x9e, 5); // NOTE: Callback 5 not defined
}
diff --git a/engines/startrek/rooms/sins2.cpp b/engines/startrek/rooms/sins2.cpp
index 976814a..4210223 100644
--- a/engines/startrek/rooms/sins2.cpp
+++ b/engines/startrek/rooms/sins2.cpp
@@ -22,20 +22,314 @@
#include "startrek/room.h"
-#define OBJECT_8 8
+#define OBJECT_DOOR 8
-#define HOTSPOT_20 0x20
+#define HOTSPOT_TERMINAL 0x20
+#define HOTSPOT_DOOR 0x21
+#define HOTSPOT_KEYPAD 0x22
namespace StarTrek {
extern const RoomAction sins2ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::sins2Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::sins2Tick1 },
+ { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_DOOR, 0}, &Room::sins2UsePhaserOnDoor },
+ { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_DOOR, 0}, &Room::sins2UsePhaserOnDoor },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::sins2UseSTricorderAnywhere },
+
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_TERMINAL, 0}, &Room::sins2UseKirkOnTerminal },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_TERMINAL, 0}, &Room::sins2UseSpockOnTerminal },
+ { {ACTION_DONE_WALK, 5, 0, 0}, &Room::sins2SpockReachedTerminal },
+ { {ACTION_DONE_ANIM, 6, 0, 0}, &Room::sins2SpockUsedTerminal },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_TERMINAL, 0}, &Room::sins2UseMccoyOnTerminal },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_TERMINAL, 0}, &Room::sins2UseRedshirtOnTerminal },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_TERMINAL, 0}, &Room::sins2UseSTricorderOnTerminal },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_KEYPAD, 0}, &Room::sins2UseSTricorderOnKeypad },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_DOOR, 0}, &Room::sins2UseSTricorderOnDoor },
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_KEYPAD, 0}, &Room::sins2UseKirkOnKeypad },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_KEYPAD, 0}, &Room::sins2UseSpockOnKeypad },
+ { {ACTION_DONE_WALK, 2, 0, 0}, &Room::sins2SpockReachedKeypad },
+ { {ACTION_DONE_ANIM, 3, 0, 0}, &Room::sins2EnteredCorrectCode },
+ { {ACTION_DONE_ANIM, 4, 0, 0}, &Room::sins2EnteredIncorrectCode },
+ { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::sins2DoorFinishedOpening },
+
+ { {ACTION_TICK, 40, 0, 0}, &Room::sins2Tick40 },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::sins2LookAnywhere },
+ { {ACTION_LOOK, OBJECT_DOOR, 0, 0}, &Room::sins2LookAtOpenDoor },
+ { {ACTION_LOOK, HOTSPOT_TERMINAL, 0, 0}, &Room::sins2LookAtTerminal },
+ { {ACTION_LOOK, HOTSPOT_KEYPAD, 0, 0}, &Room::sins2LookAtKeypad },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::sins2LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::sins2LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::sins2LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::sins2LookAtRedshirt },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::sins2TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::sins2TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::sins2TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::sins2TalkToRedshirt },
+ { {ACTION_LOOK, HOTSPOT_DOOR, 0, 0}, &Room::sins2LookAtDoor },
+
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_DOOR, 0}, &Room::sins2UseSpockOnDoor },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::sins2UseCommunicator },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_KIRK, 0}, &Room::sins2UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0}, &Room::sins2UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_MCCOY, 0}, &Room::sins2UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_REDSHIRT, 0}, &Room::sins2UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::sins2UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::sins2UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::sins2UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::sins2UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_KEYPAD, 0}, &Room::sins2UseMccoyOnKeypad },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_KEYPAD, 0}, &Room::sins2UseRedshirtOnKeypad },
+
+ { {ACTION_WALK, HOTSPOT_DOOR, 0, 0}, &Room::sins2WalkToDoor },
+ { {ACTION_WALK, OBJECT_DOOR, 0, 0}, &Room::sins2WalkToDoor },
};
extern const int sins2NumActions = sizeof(sins2ActionList) / sizeof(RoomAction);
void Room::sins2Tick1() {
+ playVoc("SIN2LOOP");
+ playMidiMusicTracks(MIDITRACK_27, -3);
+
+ if (!_awayMission->sins.enteredRoom2FirstTime)
+ _awayMission->disableInput = 2;
+
+ if (_awayMission->sins.openedInnerDoor) {
+ // NOTE: callback is never called, since animation never finishes?
+ loadActorAnimC(OBJECT_DOOR, "s2dro", 0, 0, &Room::sins2DoorFinishedOpening);
+ loadMapFile("sins22");
+ } else {
+ loadMapFile("sins2");
+ }
+}
+
+void Room::sins2UsePhaserOnDoor() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_025);
+}
+
+void Room::sins2UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_SIN2_026);
+}
+
+void Room::sins2UseKirkOnTerminal() {
+ showText(TX_SPEAKER_KIRK, TX_SIN2_002);
+ sins2UseSpockOnTerminal();
+}
+
+void Room::sins2UseSpockOnTerminal() {
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ walkCrewmanC(OBJECT_SPOCK, 0x5f, 0xa7, &Room::sins2SpockReachedTerminal);
+}
+
+void Room::sins2SpockReachedTerminal() {
+ playVoc("EFX14S");
+ loadActorAnimC(OBJECT_SPOCK, "susehw", -1, -1, &Room::sins2SpockUsedTerminal);
+}
+
+void Room::sins2SpockUsedTerminal() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_042);
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_044);
+
+ if (!_awayMission->sins.gotPointsForAccessingTerminal) {
+ _awayMission->sins.missionScore += 2;
+ _awayMission->sins.gotPointsForAccessingTerminal = true;
+ }
+
+ showText(TX_SPEAKER_MCCOY, TX_SIN2_015);
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_032);
+ showText(TX_SPEAKER_MOSHER, TX_SIN2_050);
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_035);
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_043);
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_041);
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_040);
+ showText(TX_SPEAKER_MCCOY, TX_SIN2_021);
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_034);
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_031);
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_038);
+ showText(TX_SPEAKER_MCCOY, TX_SIN2_020);
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_033);
+ showText(TX_SPEAKER_KIRK, TX_SIN2_007);
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_037);
+ showText(TX_SPEAKER_MCCOY, TX_SIN2_022);
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_029);
+}
+
+void Room::sins2UseMccoyOnTerminal() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN2_012);
+}
+
+void Room::sins2UseRedshirtOnTerminal() {
+ showText(TX_SPEAKER_MOSHER, TX_SIN2_045);
+}
+
+void Room::sins2UseSTricorderOnTerminal() {
+ spockScan(DIR_W, TX_SIN2_009);
+}
+
+void Room::sins2UseSTricorderOnKeypad() {
+ spockScan(DIR_N, TX_SIN2_028);
+}
+
+void Room::sins2UseSTricorderOnDoor() {
+ spockScan(DIR_N, TX_SIN2_027);
+}
+
+void Room::sins2UseKirkOnKeypad() {
+ if (!_awayMission->sins.openedInnerDoor) {
+ showText(TX_SPEAKER_KIRK, TX_SIN2_001);
+ sins2UseSpockOnKeypad();
+ }
+}
+
+void Room::sins2UseSpockOnKeypad() {
+ if (!_awayMission->sins.openedInnerDoor) {
+ walkCrewmanC(OBJECT_SPOCK, 0xc3, 0x9b, &Room::sins2SpockReachedKeypad);
+ }
+}
+
+void Room::sins2SpockReachedKeypad() {
+ const char *codes[] = {
+ "122", nullptr
+ };
+
+ int ans = showCodeInputBox(codes);
+
+ if (ans == -1) { // ENHANCEMENT: if nothing was entered, do nothing.
+ } else if (ans == 1) {
+ playVoc("EFX28S");
+ loadActorAnimC(OBJECT_SPOCK, "susehe", -1, -1, &Room::sins2EnteredCorrectCode);
+ } else { // Incorrect answer
+ playVoc("EFX28S");
+ loadActorAnimC(OBJECT_SPOCK, "susehe", -1, -1, &Room::sins2EnteredIncorrectCode);
+ }
+}
+
+void Room::sins2EnteredCorrectCode() {
+ _awayMission->sins.openedInnerDoor = true;
+ loadMapFile("sins22");
+ playVoc("BIGDOOR3");
+ loadActorAnimC(OBJECT_DOOR, "s2door", 0, 0, &Room::sins2DoorFinishedOpening);
+}
+
+void Room::sins2EnteredIncorrectCode() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_024); // BUGFIX: Speaker is spock, not "none"
+}
+
+void Room::sins2DoorFinishedOpening() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_010);
+}
+
+void Room::sins2Tick40() {
+ if (!_awayMission->sins.enteredRoom2FirstTime) {
+ _awayMission->disableInput = false;
+
+ showText(TX_SPEAKER_KIRK, TX_SIN2_005);
+ showText(TX_SPEAKER_SCOTT, TX_SIN2_S05);
+ showText(TX_SPEAKER_UHURA, TX_SIN2U085);
+ showText(TX_SPEAKER_KIRK, TX_SIN2_008);
+ showText(TX_SPEAKER_UHURA, TX_SIN2U097);
+ showText(TX_SPEAKER_MCCOY, TX_SIN2_F26);
+ showText(TX_SPEAKER_UHURA, TX_SIN2U096);
+ showText(TX_SPEAKER_MCCOY, TX_SIN2_019);
+ showText(TX_SPEAKER_KIRK, TX_SIN2_004);
+
+ _awayMission->sins.enteredRoom2FirstTime = true;
+ }
+}
+
+void Room::sins2LookAnywhere() {
+ showText(TX_SIN2N006);
+}
+
+void Room::sins2LookAtOpenDoor() {
+ showText(TX_SIN2N007);
+}
+
+void Room::sins2LookAtTerminal() {
+ showText(TX_SIN2N000);
+}
+
+void Room::sins2LookAtKeypad() {
+ showText(TX_SIN2N001);
+}
+
+void Room::sins2LookAtKirk() {
+ showText(TX_SIN2N003);
+}
+
+void Room::sins2LookAtSpock() {
+ showText(TX_SIN2N005);
+}
+
+void Room::sins2LookAtMccoy() {
+ showText(TX_SIN2N004);
+}
+
+void Room::sins2LookAtRedshirt() {
+ showText(TX_SIN2N002);
+}
+
+void Room::sins2TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_SIN2_003);
+}
+
+void Room::sins2TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_039);
+ showText(TX_SPEAKER_MCCOY, TX_SIN2_016);
+}
+
+void Room::sins2TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN2_023);
+ showText(TX_SPEAKER_MOSHER, TX_SIN2_049);
+}
+
+void Room::sins2TalkToRedshirt() {
+ showText(TX_SPEAKER_MOSHER, TX_SIN2_047);
+}
+
+void Room::sins2LookAtDoor() {
+ if (!_awayMission->sins.openedInnerDoor)
+ showText(TX_SIN2N008);
+}
+
+void Room::sins2UseSpockOnDoor() {
+ if (!_awayMission->sins.openedInnerDoor) {
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_F12);
+ showText(TX_SPEAKER_MOSHER, TX_SIN2_048);
+ showText(TX_SPEAKER_SPOCK, TX_SIN2_030);
+ }
+}
+
+void Room::sins2UseCommunicator() {
+ if (!_awayMission->sins.field46) {
+ showText(TX_SPEAKER_KIRK, TX_SIN2_006);
+ showText(TX_SPEAKER_SCOTT, TX_SIN2_S16);
+ showText(TX_SPEAKER_MCCOY, TX_SIN2_017);
+ } else
+ showText(TX_SPEAKER_UHURA, TX_SIN1U070);
+}
+
+void Room::sins2UseMedkitOnCrewman() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN2_014);
+}
+
+void Room::sins2UseMTricorderOnCrewman() {
+ mccoyScan(DIR_S, TX_SIN3_008); // BUGFIX: original game had wrong audio file path
+}
+
+void Room::sins2UseMccoyOnKeypad() {
+ if (!_awayMission->sins.openedInnerDoor)
+ showText(TX_SPEAKER_MCCOY, TX_SIN2_013);
+}
+
+void Room::sins2UseRedshirtOnKeypad() {
+ if (!_awayMission->sins.openedInnerDoor)
+ showText(TX_SPEAKER_MOSHER, TX_SIN2_046);
+}
+
+void Room::sins2WalkToDoor() {
+ if (_awayMission->sins.openedInnerDoor)
+ walkCrewman(OBJECT_KIRK, 0x9c, 0x8b);
}
}
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 6762794..ec1963d 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -2433,6 +2433,72 @@ extern const char *const g_gameStrings[] = {
"#SIN1\\SIN1U070#Nothing new to report Captain.",
+ "#SIN2\\SIN2_001#Spock, see what you can do with that lock.",
+ "#SIN2\\SIN2_002#Spock, see what you can do with this.",
+ "#SIN2\\SIN2_003#The Lucrs did not seem to have a problem with security.",
+ "#SIN2\\SIN2_004#Keep working at it, Uhura. Kirk out.",
+ "#SIN2\\SIN2_005#Report, Scotty. How are things going?",
+ "#SIN2\\SIN2_006#Scotty, any progress on the phasers?",
+ "#SIN2\\SIN2_007#Spock is right, Bones. Spock, what are the chances that we could decode the transmission and send a stop code to the base?",
+ "#SIN2\\SIN2_008#Well done, Uhura.",
+ "#SIN2\\SIN2_009#A computer terminal, Captain. It uses the lucr alphabet. I think I can decipher it.",
+ "#SIN2\\SIN2_010#Fascinating. If the Federation language studies were correct, the ideograph for the word \"Scythe\" in the Lucrs language is the 17th symbol in their alphabet. That corresponds with 122 in base 3.",
+ "#SIN2\\SIN2_012#Damn it Jim, I'm a surgeon not a alien computer science specialist.",
+ "#SIN2\\SIN2_013#I think Spock would have a better chance at cracking that, Jim.",
+ "#SIN2\\SIN2_014#We're safe from the cosmic radiation, Jim.",
+ "#SIN2\\SIN2_015#22%? That's very low -- hardly something to brag about.",
+ "#SIN2\\SIN2_016#At least we won't have to worry about suffocating.",
+ "#SIN2\\SIN2_017#By then, Proxtrey could be a dead planet.",
+ "#SIN2\\SIN2_019#Finally, someone who appreciates me!",
+ "#SIN2\\SIN2_020#Jim, let's return to the ship and blast this place to destroy its weapons.",
+ "#SIN2\\SIN2_021#So why has the base been activated again?",
+ "#SIN2\\SIN2_022#Spock!",
+ "#SIN2\\SIN2_023#This place does seem to provide protection against cosmic rays.",
+ "#SIN2\\SIN2_024#That did not work, Captain. It is probable this lock also uses a number of some significance.",
+ "#SIN2\\SIN2_025#The door will easily withstand our phasers, Captain.",
+ "#SIN2\\SIN2_026#The interior of the security lock is unremarkable and well preserved.",
+ "#SIN2\\SIN2_027#This door is similar to the one on the outside of the securelock except that it has not weathered over the years. Electrical panels indicate the keypad on the right controls the door.",
+ "#SIN2\\SIN2_028#This keypad is fully functional and controls the door. Its entry code is in base three.",
+ "#SIN2\\SIN2_029#1.327 million to one, provided the archaeological studies about Lucrs languages are correct. Our other option is to get into this base and see if we can bring the computers down.",
+ "#SIN2\\SIN2_030#Actually, Ensign, they differ from your culture only in that their language was explicit in their expressions of dominance and submission, rather than implied.",
+ "#SIN2\\SIN2_031#Because it does not recognize them, it assumes the Sofs are still active.",
+ "#SIN2\\SIN2_032#Doctor, in base 3, 22/100 is equivalent to 8 out of 9 or 88%. I would think that quite satisfactory given this base's probable mission of destroying the Sof forces on Proxtrey.",
+ "#SIN2\\SIN2_033#Doctor, this moon is a god to the people down there. If we destroy it we will violate the Prime Directive.",
+ "#SIN2\\SIN2_034#Given the damage to the moon, its slow rotation and orbit, it has never realized the war is over. On this pass, for the first time, it has detected radio-wave transmissions from Proxtrey.",
+ "#SIN2\\SIN2_035#If the Lucrs built this base with a clock that told the time by measuring the moon's rotational speed or the gravitational forces generated by Proxtrey and the sun, the computer may have calculated only a week of time has passed since its first action. I might be able to learn more with another look at the console.",
+ "#SIN2\\SIN2_037#In Trinary or Decimal?",
+ "#SIN2\\SIN2_038#Its transmission to the planet, I would assume, was some sort of a check beacon to see if it should continue its mission.",
+ "#SIN2\\SIN2_039#My tricorder is picking up large supplies of frozen oxygen, nitrogen, and carbon dioxide beneath the surface. Enough to last many centuries.",
+ "#SIN2\\SIN2_040#One Sof strike did, in fact, hit the moon and deflected it from its orbit. It has been dormant since then.",
+ "#SIN2\\SIN2_041#The Sofs managed to infiltrate the base. however, their actions triggered Scythe's auto-attack mechanisms, and initiated a holocaust that nearly annihilated the planet. ",
+ "#SIN2\\SIN2_042#The console reports the following: ",
+ "#SIN2\\SIN2_043#There is a substantial amount of data here, but in summary, Scythe was created by the Lucrs as a launching platform for missiles to keep the Sofs subjugated to their influence.",
+ "#SIN2\\SIN2_044#Welcome to Orbital Missile Base. Codename: Scythe. This base has been operational for the past week. It has completed 1 successful fire mission. Estimation of success is at 22/100.",
+ "#SIN2\\SIN2_045#I think Mr. Spock would have a better idea of how to operate that, Captain.",
+ "#SIN2\\SIN2_046#I'm just a security officer, Sir.",
+ "#SIN2\\SIN2_047#We appear to be in some type of Security Lock. No defensive systems are apparent here, but considering the size of the doors, they probably don't need them!",
+ "#SIN2\\SIN2_048#Dominance seemed to be very important to these people. No wonder the Lucr were so war-like.",
+ "#SIN2\\SIN2_049#I don't see why they bothered putting an atmosphere here, Captain. There hasn't even been bacteria here in centuries, let alone humanoids.",
+ "#SIN2\\SIN2_050#It says the base has been operational for a week, but this has been here for a thousand years.",
+ "#SIN2\\SIN2_F12#This says: \"Dominant People only to dominate things beyond >,<these Submissive Walls\". My guess is that only authorized personnel were allowed beyond this door.",
+ "#SIN2\\SIN2_F26#Computer science sounds more like medicine every day.",
+ "#SIN2\\SIN2_S05#About as badly as a kilt in a blast furnace, Captain. Wait a minute, Lieutenant Uhura has some news for you.",
+ "#SIN2\\SIN2_S16#Sorry Captain, but we cannot do that. We don't have phasers for at least eight more hours.",
+ "#SIN2\\SIN2N000#A computer terminal. Each word in the Lucr language has three aspects, Submissive, Neutral, and Aggressive, to supply connotation to their language.",
+ "#SIN2\\SIN2N001#A keypad, in base three.",
+ "#SIN2\\SIN2N002#Ensign Mosher is scanning the area for potentially hostile lifeforms.",
+ "#SIN2\\SIN2N003#James Kirk. The burden of command is quite heavy at times.",
+ "#SIN2\\SIN2N004#McCoy wishes this place was less... technological.",
+ "#SIN2\\SIN2N005#Spock looks at the equipment and raises an eyebrow.",
+ "#SIN2\\SIN2N006#This looks like some kind of security lock with heavy duty doors on both ends.",
+ "#SIN2\\SIN2N007#You see another chamber.",
+ "#SIN2\\SIN2N008#The door has some strange writing on it.",
+ "#SIN2\\SIN2U085#The virus came from our sensor sweep of the moon's computers. We believe we have analyzed the memory sectors it attacked.",
+ "#SIN2\\SIN2U096#If we had a doctor as good with computers as you are with patients, we would be having a lot fewer problems.",
+ "#SIN2\\SIN2U097#I wish I could take credit for it. It was Mr. Kyle who found the pattern. We are attacking it with anti-virus programs.",
+
+
+ "#SIN2\\SIN3_008#All readings are normal. The structure seems to be protecting us from the cosmic rays.",
"#SIN3\\SIN3_012#Can't say I like the decor.",
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 558162b..46b3c84 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -2529,6 +2529,77 @@ enum GameStringIDs {
TX_SIN1U070,
+ TX_SIN2_001,
+ TX_SIN2_002,
+ TX_SIN2_003,
+ TX_SIN2_004,
+ TX_SIN2_005,
+ TX_SIN2_006,
+ TX_SIN2_007,
+ TX_SIN2_008,
+ TX_SIN2_009,
+ TX_SIN2_010,
+ // MISSING
+ TX_SIN2_012,
+ TX_SIN2_013,
+ TX_SIN2_014,
+ TX_SIN2_015,
+ TX_SIN2_016,
+ TX_SIN2_017,
+ // MISSING
+ TX_SIN2_019,
+ TX_SIN2_020,
+ TX_SIN2_021,
+ TX_SIN2_022,
+ TX_SIN2_023,
+ TX_SIN2_024,
+ TX_SIN2_025,
+ TX_SIN2_026,
+ TX_SIN2_027,
+ TX_SIN2_028,
+ TX_SIN2_029,
+ TX_SIN2_030,
+ TX_SIN2_031,
+ TX_SIN2_032,
+ TX_SIN2_033,
+ TX_SIN2_034,
+ TX_SIN2_035,
+ // UNUSED (036)
+ TX_SIN2_037,
+ TX_SIN2_038,
+ TX_SIN2_039,
+ TX_SIN2_040,
+ TX_SIN2_041,
+ TX_SIN2_042,
+ TX_SIN2_043,
+ TX_SIN2_044,
+ TX_SIN2_045,
+ TX_SIN2_046,
+ TX_SIN2_047,
+ TX_SIN2_048,
+ TX_SIN2_049,
+ TX_SIN2_050,
+ // UNUSED (051 -> 054; uhura voice substitute)
+ TX_SIN2_F12,
+ TX_SIN2_F26,
+ TX_SIN2_S05,
+ TX_SIN2_S16,
+ TX_SIN2N000,
+ TX_SIN2N001,
+ TX_SIN2N002,
+ TX_SIN2N003,
+ TX_SIN2N004,
+ TX_SIN2N005,
+ TX_SIN2N006,
+ TX_SIN2N007,
+ TX_SIN2N008,
+ TX_SIN2U085,
+ TX_SIN2U096,
+ TX_SIN2U097,
+ // UNUSED: sin2_b35.voc (same as 036)
+
+
+ TX_SIN3_008,
TX_SIN3_012,
Commit: b1fde330950db0ffe579906c9d8fceb1c702b55c
https://github.com/scummvm/scummvm/commit/b1fde330950db0ffe579906c9d8fceb1c702b55c
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: SINS2 text changes
Changed paths:
engines/startrek/text.cpp
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index ec1963d..a2881da 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -2443,7 +2443,7 @@ extern const char *const g_gameStrings[] = {
"#SIN2\\SIN2_008#Well done, Uhura.",
"#SIN2\\SIN2_009#A computer terminal, Captain. It uses the lucr alphabet. I think I can decipher it.",
"#SIN2\\SIN2_010#Fascinating. If the Federation language studies were correct, the ideograph for the word \"Scythe\" in the Lucrs language is the 17th symbol in their alphabet. That corresponds with 122 in base 3.",
- "#SIN2\\SIN2_012#Damn it Jim, I'm a surgeon not a alien computer science specialist.",
+ "#SIN2\\SIN2_012#Damn it Jim, I'm a surgeon not an alien computer science specialist.", // TYPO
"#SIN2\\SIN2_013#I think Spock would have a better chance at cracking that, Jim.",
"#SIN2\\SIN2_014#We're safe from the cosmic radiation, Jim.",
"#SIN2\\SIN2_015#22%? That's very low -- hardly something to brag about.",
@@ -2494,11 +2494,11 @@ extern const char *const g_gameStrings[] = {
"#SIN2\\SIN2N007#You see another chamber.",
"#SIN2\\SIN2N008#The door has some strange writing on it.",
"#SIN2\\SIN2U085#The virus came from our sensor sweep of the moon's computers. We believe we have analyzed the memory sectors it attacked.",
- "#SIN2\\SIN2U096#If we had a doctor as good with computers as you are with patients, we would be having a lot fewer problems.",
+ "#SIN2\\SIN2U096#If we had a doctor as good with computers as you are with patients, we'd be having a lot fewer problems.", // TYPO
"#SIN2\\SIN2U097#I wish I could take credit for it. It was Mr. Kyle who found the pattern. We are attacking it with anti-virus programs.",
- "#SIN2\\SIN3_008#All readings are normal. The structure seems to be protecting us from the cosmic rays.",
+ "#SIN3\\SIN3_008#All readings are normal. The structure seems to be protecting us from the cosmic rays.",
"#SIN3\\SIN3_012#Can't say I like the decor.",
Commit: 012b9ec47c3538530ef0127e90d11b1da16b2c40
https://github.com/scummvm/scummvm/commit/012b9ec47c3538530ef0127e90d11b1da16b2c40
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: SINS4
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/sins2.cpp
engines/startrek/rooms/sins4.cpp
engines/startrek/text.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 16473d9..dba20a1 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -525,14 +525,18 @@ struct AwayMission {
bool field33; // 0x33
bool doorLaserFiredOnce; // 0x34
bool gotPointsForAccessingTerminal; // 0x35
+ bool scannedKeycardLock; // 0x36
byte field39; // 0x39
bool openedOuterDoor; // 0x3d
bool openedInnerDoor; // 0x3e
+ bool unlockedIDCardDoor; // 0x3f
bool enteredRoom0FirstTime; // 0x42
bool scottyInformedKirkAboutVirus; // 0x43
bool enteredRoom2FirstTime; // 0x44
- bool field46; // 0x46
+ bool field45; // 0x45
+ bool enteredRoom4FirstTime; // 0x46
bool gotPointsForScanningStatue; // 0x48
+ bool gotPointsForScanningRoom4; // 0x49
bool enteredRoom1FirstTime; // 0x50
int16 missionScore; // 0x52
} sins;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 581f9aa..ab0f500 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2272,6 +2272,46 @@ public:
// SINS4
void sins4Tick1();
+ void sins4UseSTricorderOnPanel();
+ void sins4UseSpockOnPanel();
+ void sins4UsePhaserOnNorthDoor();
+ void sins4UsePhaserOnPanel();
+ void sins4UseIDCardOnPanel();
+ void sins4KirkReachedPanel();
+ void sins4KirkPutCardInPanel();
+ void sins4UseRockOnPanel();
+ void sins4KirkReachedPanelWithRock();
+ void sins4KirkUsedRockOnPanel();
+ void sins4LookAtWestDoor();
+ void sins4LookAtEastDoor();
+ void sins4LookAnywhere();
+ void sins4LookAtPanel();
+ void sins4Tick40();
+ void sins4LookAtKirk();
+ void sins4LookAtSpock();
+ void sins4LookAtMccoy();
+ void sins4LookAtRedshirt();
+ void sins4LookAtLight();
+ void sins4LookAtBeam();
+ void sins4LookAtOpenNorthDoor();
+ void sins4LookAtClosedNorthDoor();
+ void sins4TalkToKirk();
+ void sins4TalkToSpock();
+ void sins4TalkToMccoy();
+ void sins4TalkToRedshirt();
+ void sins4UseSTricorderOnNorthDoor();
+ void sins4UseSTricorderAnywhere();
+ void sins4UseCommunicator();
+ void sins4UseMccoyOnNorthDoor();
+ void sins4UseRedshirtOnNorthDoor();
+ void sins4UseSpockOnNorthDoor();
+ void sins4UseMccoyOnPanel();
+ void sins4UseRedshirtOnPanel();
+ void sins4WalkToNorthDoor();
+ void sins4WalkToWestDoor();
+ void sins4WalkToEastDoor();
+ void sins4UseMedkitOnCrewman();
+ void sins4UseMTricorderOnCrewman();
// SINS5
void sins5Tick1();
diff --git a/engines/startrek/rooms/sins2.cpp b/engines/startrek/rooms/sins2.cpp
index 4210223..f3dc6cd 100644
--- a/engines/startrek/rooms/sins2.cpp
+++ b/engines/startrek/rooms/sins2.cpp
@@ -301,7 +301,7 @@ void Room::sins2UseSpockOnDoor() {
}
void Room::sins2UseCommunicator() {
- if (!_awayMission->sins.field46) {
+ if (!_awayMission->sins.enteredRoom4FirstTime) {
showText(TX_SPEAKER_KIRK, TX_SIN2_006);
showText(TX_SPEAKER_SCOTT, TX_SIN2_S16);
showText(TX_SPEAKER_MCCOY, TX_SIN2_017);
diff --git a/engines/startrek/rooms/sins4.cpp b/engines/startrek/rooms/sins4.cpp
index 05c5820..1400e66 100644
--- a/engines/startrek/rooms/sins4.cpp
+++ b/engines/startrek/rooms/sins4.cpp
@@ -22,20 +22,310 @@
#include "startrek/room.h"
-#define OBJECT_8 8
+#define OBJECT_NORTH_DOOR 8
-#define HOTSPOT_20 0x20
+#define HOTSPOT_NORTH_DOOR 0x20
+#define HOTSPOT_PANEL 0x21
+#define HOTSPOT_BEAM 0x22
+#define HOTSPOT_LIGHT 0x23
+#define HOTSPOT_WEST_DOOR 0x24
+#define HOTSPOT_EAST_DOOR 0x25
namespace StarTrek {
extern const RoomAction sins4ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::sins4Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::sins4Tick1 },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_PANEL, 0}, &Room::sins4UseSTricorderOnPanel },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_PANEL, 0}, &Room::sins4UseSpockOnPanel },
+ { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_NORTH_DOOR, 0}, &Room::sins4UsePhaserOnNorthDoor },
+ { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_NORTH_DOOR, 0}, &Room::sins4UsePhaserOnNorthDoor },
+ { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_PANEL, 0}, &Room::sins4UsePhaserOnPanel },
+ { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_PANEL, 0}, &Room::sins4UsePhaserOnPanel },
+
+ { {ACTION_USE, OBJECT_IIDCARD, HOTSPOT_PANEL, 0}, &Room::sins4UseIDCardOnPanel },
+ { {ACTION_DONE_WALK, 2, 0, 0}, &Room::sins4KirkReachedPanel },
+ { {ACTION_DONE_ANIM, 5, 0, 0}, &Room::sins4KirkPutCardInPanel },
+ { {ACTION_USE, OBJECT_IS8ROCKS, HOTSPOT_PANEL, 0}, &Room::sins4UseRockOnPanel },
+ { {ACTION_DONE_WALK, 3, 0, 0}, &Room::sins4KirkReachedPanelWithRock },
+ { {ACTION_DONE_ANIM, 4, 0, 0}, &Room::sins4KirkUsedRockOnPanel },
+
+ { {ACTION_LOOK, HOTSPOT_WEST_DOOR, 0, 0}, &Room::sins4LookAtWestDoor },
+ { {ACTION_LOOK, HOTSPOT_EAST_DOOR, 0, 0}, &Room::sins4LookAtEastDoor },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::sins4LookAnywhere },
+ { {ACTION_LOOK, HOTSPOT_PANEL, 0, 0}, &Room::sins4LookAtPanel },
+ { {ACTION_TICK, 40, 0, 0}, &Room::sins4Tick40 },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::sins4LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::sins4LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::sins4LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::sins4LookAtRedshirt },
+ { {ACTION_LOOK, HOTSPOT_LIGHT, 0, 0}, &Room::sins4LookAtLight },
+ { {ACTION_LOOK, HOTSPOT_BEAM, 0, 0}, &Room::sins4LookAtBeam },
+ { {ACTION_LOOK, OBJECT_NORTH_DOOR, 0, 0}, &Room::sins4LookAtOpenNorthDoor },
+ { {ACTION_LOOK, HOTSPOT_NORTH_DOOR, 0, 0}, &Room::sins4LookAtClosedNorthDoor },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::sins4TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::sins4TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::sins4TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::sins4TalkToRedshirt },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_NORTH_DOOR, 0}, &Room::sins4UseSTricorderOnNorthDoor },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::sins4UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::sins4UseCommunicator },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_NORTH_DOOR, 0}, &Room::sins4UseMccoyOnNorthDoor },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_NORTH_DOOR, 0}, &Room::sins4UseRedshirtOnNorthDoor },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_NORTH_DOOR, 0}, &Room::sins4UseSpockOnNorthDoor },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_PANEL, 0}, &Room::sins4UseMccoyOnPanel },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_PANEL, 0}, &Room::sins4UseRedshirtOnPanel },
+
+ { {ACTION_WALK, HOTSPOT_NORTH_DOOR, 0, 0}, &Room::sins4WalkToNorthDoor },
+ { {ACTION_WALK, OBJECT_NORTH_DOOR, 0, 0}, &Room::sins4WalkToNorthDoor },
+ { {ACTION_WALK, HOTSPOT_WEST_DOOR, 0, 0}, &Room::sins4WalkToWestDoor },
+ { {ACTION_WALK, HOTSPOT_EAST_DOOR, 0, 0}, &Room::sins4WalkToEastDoor },
+
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_KIRK, 0}, &Room::sins4UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0}, &Room::sins4UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_MCCOY, 0}, &Room::sins4UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_REDSHIRT, 0}, &Room::sins4UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::sins4UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::sins4UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::sins4UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::sins4UseMTricorderOnCrewman },
};
extern const int sins4NumActions = sizeof(sins4ActionList) / sizeof(RoomAction);
void Room::sins4Tick1() {
+ playVoc("SIN4LOOP");
+
+ if (!_awayMission->sins.enteredRoom4FirstTime)
+ _awayMission->disableInput = 2;
+
+ if (_awayMission->sins.unlockedIDCardDoor)
+ loadActorAnim2(OBJECT_NORTH_DOOR, "s4dro", 0, 0);
+
+ playMidiMusicTracks(MIDITRACK_27, -3);
+}
+
+void Room::sins4UseSTricorderOnPanel() {
+ spockScan(DIR_N, TX_SIN4_020);
+ _awayMission->sins.scannedKeycardLock = true;
+ _awayMission->sins.field39 |= 4;
+
+ if (_awayMission->sins.field39 == 7) {
+ showText(TX_SPEAKER_SPOCK, TX_SIN4_010);
+ _awayMission->sins.field39 |= 8;
+ }
+}
+
+void Room::sins4UseSpockOnPanel() {
+ // NOTE: two implementations of this function, one unused
+ if (true)
+ showText(TX_SPEAKER_SPOCK, TX_SIN4_018);
+ else {
+ showText(TX_SPEAKER_SPOCK, TX_SIN4_021);
+
+ if (_awayMission->sins.field39 == 7) {
+ showText(TX_SPEAKER_SPOCK, TX_SIN4_010);
+ _awayMission->sins.field39 |= 8;
+ }
+ }
+}
+
+void Room::sins4UsePhaserOnNorthDoor() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN4_009);
+}
+
+void Room::sins4UsePhaserOnPanel() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN4_008);
+}
+
+void Room::sins4UseIDCardOnPanel() {
+ if (_awayMission->sins.unlockedIDCardDoor)
+ showText(TX_SIN4N006);
+ else
+ walkCrewmanC(OBJECT_KIRK, 0xb8, 0x86, &Room::sins4KirkReachedPanel);
+}
+
+void Room::sins4KirkReachedPanel() {
+ _awayMission->sins.unlockedIDCardDoor = true;
+ loseItem(OBJECT_IIDCARD);
+ loadActorAnimC(OBJECT_KIRK, "kusemn", -1, -1, &Room::sins4KirkPutCardInPanel);
+
+ _awayMission->disableInput = true; // ENHANCEMENT: disable input
+}
+
+void Room::sins4KirkPutCardInPanel() {
+ loadActorAnim2(OBJECT_NORTH_DOOR, "s4door", 0, 0, 1); // Callback "1" doesn't exist
+ playVoc("MUR4E1");
+ _awayMission->disableInput = false;
+}
+
+void Room::sins4UseRockOnPanel() {
+ walkCrewmanC(OBJECT_KIRK, 0xb8, 0x86, &Room::sins4KirkReachedPanelWithRock);
+}
+
+void Room::sins4KirkReachedPanelWithRock() {
+ loadActorAnimC(OBJECT_KIRK, "kusemn", -1, -1, &Room::sins4KirkUsedRockOnPanel);
+}
+
+void Room::sins4KirkUsedRockOnPanel() {
+ showText(TX_SIN4N012);
+ showText(TX_SPEAKER_SPOCK, TX_SIN4_022);
+
+ if (_awayMission->sins.field39 == 7) {
+ showText(TX_SPEAKER_SPOCK, TX_SIN4_010);
+ _awayMission->sins.field39 |= 8;
+ }
+}
+
+void Room::sins4LookAtWestDoor() {
+ showText(TX_SIN4N009);
+}
+
+void Room::sins4LookAtEastDoor() {
+ showText(TX_SIN4N010);
+}
+
+void Room::sins4LookAnywhere() {
+ showText(TX_SIN4N013);
+}
+
+void Room::sins4LookAtPanel() {
+ showText(TX_SIN4N011);
+}
+
+void Room::sins4Tick40() {
+ if (!_awayMission->sins.enteredRoom4FirstTime) {
+ _awayMission->disableInput = false;
+ showText(TX_SPEAKER_UHURA, TX_SIN4U088);
+ showText(TX_SPEAKER_KIRK, TX_SIN4_007);
+ showText(TX_SPEAKER_UHURA, TX_SIN4U103);
+ showText(TX_SPEAKER_SPOCK, TX_SIN4_025);
+ showText(TX_SPEAKER_KIRK, TX_SIN4_003);
+ showText(TX_SPEAKER_UHURA, TX_SIN4U107);
+ showText(TX_SPEAKER_UHURA, TX_SIN4U105);
+ showText(TX_SPEAKER_KIRK, TX_SIN4_005);
+ _awayMission->sins.enteredRoom4FirstTime = true;
+ }
+}
+
+void Room::sins4LookAtKirk() {
+ showText(TX_SIN4N002);
+}
+
+void Room::sins4LookAtSpock() {
+ showText(TX_SIN4N004);
+}
+
+void Room::sins4LookAtMccoy() {
+ showText(TX_SIN4N003);
+}
+
+void Room::sins4LookAtRedshirt() {
+ showText(TX_SIN4N001);
+}
+
+void Room::sins4LookAtLight() {
+ showText(TX_SIN4N000);
+}
+
+void Room::sins4LookAtBeam() {
+ showText(TX_SIN4N005);
+}
+
+void Room::sins4LookAtOpenNorthDoor() {
+ showText(TX_SIN4N008);
+}
+
+void Room::sins4LookAtClosedNorthDoor() {
+ showText(TX_SIN4N007);
+}
+
+void Room::sins4TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_SIN4_001);
+ showText(TX_SPEAKER_SPOCK, TX_SIN4_028);
+ showText(TX_SPEAKER_KIRK, TX_SIN4_004);
+}
+
+void Room::sins4TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN4_019);
+}
+
+void Room::sins4TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN4_015);
+ showText(TX_SPEAKER_SPOCK, TX_SIN4_024);
+ showText(TX_SPEAKER_MCCOY, TX_SIN4_017);
+}
+
+void Room::sins4TalkToRedshirt() {
+ showText(TX_SPEAKER_MOSHER, TX_SIN4_031);
+}
+
+void Room::sins4UseSTricorderOnNorthDoor() {
+ spockScan(DIR_N, TX_SIN4_027);
+ showText(TX_SPEAKER_MOSHER, TX_SIN4_032);
+ showText(TX_SPEAKER_SPOCK, TX_SIN4_026);
+}
+
+void Room::sins4UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_SIN4_011);
+
+ if (!_awayMission->sins.gotPointsForScanningRoom4) {
+ _awayMission->sins.missionScore += 1;
+ _awayMission->sins.gotPointsForScanningRoom4 = true;
+ }
+}
+
+void Room::sins4UseCommunicator() {
+ if (!_awayMission->sins.field45) {
+ showText(TX_SPEAKER_UHURA, TX_SIN4U100);
+ showText(TX_SPEAKER_KIRK, TX_SIN4_006);
+ showText(TX_SPEAKER_UHURA, TX_SIN4U83B);
+ showText(TX_SPEAKER_KIRK, TX_SIN4_002);
+ } else
+ showText(TX_SPEAKER_UHURA, TX_SIN4U073);
+}
+
+void Room::sins4UseMccoyOnNorthDoor() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN4_016);
+}
+
+void Room::sins4UseRedshirtOnNorthDoor() {
+ showText(TX_SPEAKER_MOSHER, TX_SIN4_029);
+}
+
+void Room::sins4UseSpockOnNorthDoor() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN4_023);
+}
+
+void Room::sins4UseMccoyOnPanel() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN4_013);
+}
+
+void Room::sins4UseRedshirtOnPanel() {
+ showText(TX_SPEAKER_MOSHER, TX_SIN4_030);
+}
+
+void Room::sins4WalkToNorthDoor() {
+ if (_awayMission->sins.unlockedIDCardDoor)
+ walkCrewman(OBJECT_KIRK, 0x96, 0x7d);
+}
+
+void Room::sins4WalkToWestDoor() {
+ walkCrewman(OBJECT_KIRK, 0x1b, 0x95);
+}
+
+void Room::sins4WalkToEastDoor() {
+ walkCrewman(OBJECT_KIRK, 0x13c, 0x9b);
+}
+
+void Room::sins4UseMedkitOnCrewman() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN4_014);
+}
+
+void Room::sins4UseMTricorderOnCrewman() {
+ mccoyScan(DIR_S, TX_SIN4_012);
}
}
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index a2881da..ac6dc36 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -2498,8 +2498,104 @@ extern const char *const g_gameStrings[] = {
"#SIN2\\SIN2U097#I wish I could take credit for it. It was Mr. Kyle who found the pattern. We are attacking it with anti-virus programs.",
+ "#SIN3\\SIN3_001#Spock, why don't you check out those laser drill controls.",
+ "#SIN3\\SIN3_002#You're right. This is a mess.",
+ "#SIN3\\SIN3_003#A storage box of some kind. I detect no dangerous substances.",
+ "#SIN3\\SIN3_004#Captain, nothing can be gained by trying to force it around.",
+ "#SIN3\\SIN3_005#Captain, the machine requests the proper coordinates before it may perform this operation.",
+ "#SIN3\\SIN3_006#Captain, the template would be damaged by direct fire from the laser.",
+ "#SIN3\\SIN3_007#Captain, with the 3KAg content of the surface rocks and the Tricorder scan of the pattern inside the lock, I believe the laser drill can be used to fashion the ID card needed to open the sealed door in the other chamber.",
"#SIN3\\SIN3_008#All readings are normal. The structure seems to be protecting us from the cosmic rays.",
+ "#SIN3\\SIN3_009#I'm too attached to my head to stick it in front of the laser that made this cave.",
+ "#SIN3\\SIN3_010#We're safe from the cosmic radiation, Jim.",
+ "#SIN3\\SIN3_011#Why was I even brought down on this mission, Jim? I'm a doctor, not a welder!",
"#SIN3\\SIN3_012#Can't say I like the decor.",
+ "#SIN3\\SIN3_013#I can see why.",
+ "#SIN3\\SIN3_014#This is one heck of a museum, Ensign.",
+ "#SIN3\\SIN3_015#I used the keycard pattern, scanned from the lock, to program the drill. It should now be able to make a template of the keycard in the rock.",
+ "#SIN3\\SIN3_016#The drill is unremarkable except its aiming component is corroded and frozen in place.",
+ "#SIN3\\SIN3_017#The mineshaft was drilled out of the lunar rock by a laser device similar to the one mounted in the ceiling.",
+ "#SIN3\\SIN3_018#These are display panels for the laser drill. They are still functional.",
+ "#SIN3\\SIN3_019#This is the laser drill's control panel. It is functional and power is flowing to it.",
+ "#SIN3\\SIN3_020#This technology is cruder and less efficient than the rest of the complex, Captain.",
+ "#SIN3\\SIN3_021#Too high a setting, Captain. The laser drill vaporized the rock.",
+ "#SIN3\\SIN3_022#Unlike the mineral samples on the surface, the rocks here do not contain any unusual trace elements.",
+ "#SIN3\\SIN3_023#Unlike the surface rocks, the ore here is unremarkable.",
+ "#SIN3\\SIN3_024#The Lucrs did not leave behind many examples of their architecture.",
+ "#SIN3\\SIN3_025#Uh, what do you want me to do with it, Sir?",
+ "#SIN3\\SIN3_026#Looks like a museum piece to me, Captain.",
+ "#SIN3\\SIN3_027#Still a mess, though.",
+ "#SIN3\\SIN3N000#A closed box sits on the floor.",
+ "#SIN3\\SIN3N001#Dr. McCoy again wonders why he even came along.",
+ "#SIN3\\SIN3N002#Ensign Mosher scouts for signs of trouble, as well as glancing at the great-looking laser drill!",
+ "#SIN3\\SIN3N003#James T. Kirk, Captain of the USS Enterprise.",
+ "#SIN3\\SIN3N004#Mr. Spock puzzles over the illogical design of some of these circuits.",
+ "#SIN3\\SIN3N005#The box is empty.",
+ "#SIN3\\SIN3N006#The laser drill has cut a template for the keycard in the stone.",
+ "#SIN3\\SIN3N007#These are display panels for the laser drill.",
+ "#SIN3\\SIN3N008#This box contains old wire and connectors.",
+ "#SIN3\\SIN3N009#This is a high powered item that will cause irrevocable damage if you use it in this manner.",
+ "#SIN3\\SIN3N010#This is a keycard made from the tri-phosphate silver rock.",
+ "#SIN3\\SIN3N011#This is a laser drill control panel.",
+ "#SIN3\\SIN3N012#This is an ancient laser drill.",
+ "#SIN3\\SIN3N013#This room looks like it was once used for some type of mining operation.",
+ "#SIN3\\SIN3N014#You have placed the rocks onto the pattern.",
+ "#SIN3\\SIN3U072#Nothing new to report Captain.",
+
+
+ "#SIN4\\SIN4_001#At least the Enterprise is safe.",
+ "#SIN4\\SIN4_002#Right now, I'll take anything that works. Kirk out.",
+ "#SIN4\\SIN4_003#The Klingons aren't going to be happy to learn that they helped us. How about the phasers and tractor beams?",
+ "#SIN4\\SIN4_004#Then we're just going to have to prevent that.",
+ "#SIN4\\SIN4_005#Understood. The ball is in our court. We'll give it our best shot. Kirk out.",
+ "#SIN4\\SIN4_006#We're making our way through. Keep your fingers crossed, lieutenant.",
+ "#SIN4\\SIN4_007#Well done, Uhura!",
+ "#SIN4\\SIN4_008#Captain, if you destroy the lock, there will be no way to open the door.",
+ "#SIN4\\SIN4_009#Captain, the door is heavily shielded. Our phasers will have a negligible effect.",
+ "#SIN4\\SIN4_010#Captain, with the 3KAg content of the surface rocks and the Tricorder scan of the pattern inside the lock, I believe the laser drill can be used to fashion the ID card needed to open this door.",
+ "#SIN4\\SIN4_011#Circuits and atmosphere pumps are hidden in the walls.",
+ "#SIN4\\SIN4_012#All readings are normal. The structure seems to be protecting us from the cosmic rays.",
+ "#SIN4\\SIN4_013#My fingers don't fit Jim.",
+ "#SIN4\\SIN4_014#We're safe from the cosmic radiation, Jim.",
+ "#SIN4\\SIN4_015#When I retire from Starfleet, I'm going to write one heck of an autobiography.",
+ "#SIN4\\SIN4_016#What do you want me to do, kick it down?",
+ "#SIN4\\SIN4_017#That way I can finally get someone to listen to me!",
+ "#SIN4\\SIN4_018#My fingers are too large to fit into the slot.",
+ "#SIN4\\SIN4_019#Please allow me to concentrate, Captain.",
+ "#SIN4\\SIN4_020#This panel has a slot in it rather than a keypad. The slot bears traces of Tri-Phosphorate Silver, and power is currently running to it. I am recording the pattern of this lock into my tricorder.",
+ "#SIN4\\SIN4_021#This panel requires a coded identification key to get it open.",
+ "#SIN4\\SIN4_022#Very odd, Captain. There was a power surge to the panel just after the rock struck it. Probably 3KAg dust getting into the slot. ",
+ "#SIN4\\SIN4_023#We must find a way to bypass it's lock system.",
+ "#SIN4\\SIN4_024#Fascinating, doctor. I look forward to reading it.",
+ "#SIN4\\SIN4_025#Fascinating, lieutenant.",
+ "#SIN4\\SIN4_026#Indeed, Ensign. And considerably thinner. A remarkable achievement in metallurgical engineering.",
+ "#SIN4\\SIN4_027#This door is made from remarkably dense alloys. Even our most powerful phaser rifle or welder would not be able to penetrate it.",
+ "#SIN4\\SIN4_028#Unless the computers decide to send more powerful viruses to the Enterprise.",
+ "#SIN4\\SIN4_029#I don't think a hand phaser is going to cut through that, Sir.",
+ "#SIN4\\SIN4_030#I don't think my phaser will do a lot of good Sir.",
+ "#SIN4\\SIN4_031#This machinery is incredible. Are all your landing missions this much fun? I might never leave this place!",
+ "#SIN4\\SIN4_032#The thing must be almost as tough as a starship hull!",
+ "#SIN4\\SIN4N000#Although centuries old, these lights still provide illumination for this complex.",
+ "#SIN4\\SIN4N001#As soon as this mission is over, Ensign Mosher is going to write his sister, who serves onboard Pegasus Science Station, and gloat about everything he's seen.",
+ "#SIN4\\SIN4N002#James Kirk seems relieved by the good news from his ship.",
+ "#SIN4\\SIN4N003#So far, this mission has been boring, from a medical standpoint.",
+ "#SIN4\\SIN4N004#Spock, deep in thought, analyzes the Lucr computers.",
+ "#SIN4\\SIN4N005#There are a few stress fractures on this beam, but it still looks to be quite sturdy.",
+ "#SIN4\\SIN4N006#There is already a card in the lock.",
+ "#SIN4\\SIN4N007#This door appears to be very solid.",
+ "#SIN4\\SIN4N008#This door leads to another chamber.",
+ "#SIN4\\SIN4N009#This doorway leads back to the security lock and outside.",
+ "#SIN4\\SIN4N010#This doorway leads to another area of the complex.",
+ "#SIN4\\SIN4N011#This panel is designed to receive an ID card to make the door open.",
+ "#SIN4\\SIN4N012#The Panel is undamaged.",
+ "#SIN4\\SIN4N013#You are in a corridor that connects to three other chambers.",
+ "#SIN4\\SIN4U073#Nothing new to report Captain.",
+ "#SIN4\\SIN4U088#Captain, we have a cure for the computer virus!",
+ "#SIN4\\SIN4U100#No change, Captain. Any progress on the planet?",
+ "#SIN4\\SIN4U103#I modified K'trhra-C to exclusively attack the Lucr virus. They annihilated each other, Captain.",
+ "#SIN4\\SIN4U105#We could destroy some missiles manually, but if this complex decides to launch more than ten missiles at a time...",
+ "#SIN4\\SIN4U107#We may get the tractor beams on-line in time, Captain. I'm afraid even the back-up phaser transmission codes were affected. ",
+ "#SIN4\\SIN4U83B#Captain, we'll help you all we can.",
"#VENA\\VENA_F41#Kirk out.",
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 46b3c84..90eb63f 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -2599,8 +2599,107 @@ enum GameStringIDs {
// UNUSED: sin2_b35.voc (same as 036)
+ TX_SIN3_001,
+ TX_SIN3_002,
+ TX_SIN3_003,
+ TX_SIN3_004,
+ TX_SIN3_005,
+ TX_SIN3_006,
+ TX_SIN3_007,
TX_SIN3_008,
+ TX_SIN3_009,
+ TX_SIN3_010,
+ TX_SIN3_011,
TX_SIN3_012,
+ TX_SIN3_013,
+ TX_SIN3_014,
+ TX_SIN3_015,
+ TX_SIN3_016,
+ TX_SIN3_017,
+ TX_SIN3_018,
+ TX_SIN3_019,
+ TX_SIN3_020,
+ TX_SIN3_021,
+ TX_SIN3_022,
+ TX_SIN3_023,
+ TX_SIN3_024,
+ TX_SIN3_025,
+ TX_SIN3_026,
+ TX_SIN3_027,
+ // UNUSED (028; uhura voice substitute)
+ TX_SIN3N000,
+ TX_SIN3N001,
+ TX_SIN3N002,
+ TX_SIN3N003,
+ TX_SIN3N004,
+ TX_SIN3N005,
+ TX_SIN3N006,
+ TX_SIN3N007,
+ TX_SIN3N008,
+ TX_SIN3N009,
+ TX_SIN3N010,
+ TX_SIN3N011,
+ TX_SIN3N012,
+ TX_SIN3N013,
+ TX_SIN3N014,
+ TX_SIN3U072,
+
+
+ TX_SIN4_001,
+ TX_SIN4_002,
+ TX_SIN4_003,
+ TX_SIN4_004,
+ TX_SIN4_005,
+ TX_SIN4_006,
+ TX_SIN4_007,
+ TX_SIN4_008,
+ TX_SIN4_009,
+ TX_SIN4_010,
+ TX_SIN4_011,
+ TX_SIN4_012,
+ TX_SIN4_013,
+ TX_SIN4_014,
+ TX_SIN4_015,
+ TX_SIN4_016,
+ TX_SIN4_017,
+ TX_SIN4_018,
+ TX_SIN4_019,
+ TX_SIN4_020,
+ TX_SIN4_021,
+ TX_SIN4_022,
+ TX_SIN4_023,
+ TX_SIN4_024,
+ TX_SIN4_025,
+ TX_SIN4_026,
+ TX_SIN4_027,
+ TX_SIN4_028,
+ TX_SIN4_029,
+ TX_SIN4_030,
+ TX_SIN4_031,
+ TX_SIN4_032,
+ // UNUSED (033 -> 039; uhura voice substitute)
+ TX_SIN4N000,
+ TX_SIN4N001,
+ TX_SIN4N002,
+ TX_SIN4N003,
+ TX_SIN4N004,
+ TX_SIN4N005,
+ TX_SIN4N006,
+ TX_SIN4N007,
+ TX_SIN4N008,
+ TX_SIN4N009,
+ TX_SIN4N010,
+ TX_SIN4N011,
+ TX_SIN4N012,
+ TX_SIN4N013,
+ TX_SIN4U073,
+ TX_SIN4U088,
+ TX_SIN4U100,
+ TX_SIN4U103,
+ TX_SIN4U105,
+ TX_SIN4U107,
+ // UNUSED (sin4u83a; alternate version of sin4u83b)
+ TX_SIN4U83B,
TX_VENA_F41,
Commit: 10e22f7480cbca5e78da447613359378fdf2a2ef
https://github.com/scummvm/scummvm/commit/10e22f7480cbca5e78da447613359378fdf2a2ef
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: SINS4 text changes
Changed paths:
engines/startrek/text.cpp
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index ac6dc36..1ec9b83 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -2565,7 +2565,7 @@ extern const char *const g_gameStrings[] = {
"#SIN4\\SIN4_020#This panel has a slot in it rather than a keypad. The slot bears traces of Tri-Phosphorate Silver, and power is currently running to it. I am recording the pattern of this lock into my tricorder.",
"#SIN4\\SIN4_021#This panel requires a coded identification key to get it open.",
"#SIN4\\SIN4_022#Very odd, Captain. There was a power surge to the panel just after the rock struck it. Probably 3KAg dust getting into the slot. ",
- "#SIN4\\SIN4_023#We must find a way to bypass it's lock system.",
+ "#SIN4\\SIN4_023#We must find a way to bypass its lock system.", // TYPO
"#SIN4\\SIN4_024#Fascinating, doctor. I look forward to reading it.",
"#SIN4\\SIN4_025#Fascinating, lieutenant.",
"#SIN4\\SIN4_026#Indeed, Ensign. And considerably thinner. A remarkable achievement in metallurgical engineering.",
Commit: 4424515ccef65d3504fe78ea4c71d9171c0b4e7d
https://github.com/scummvm/scummvm/commit/4424515ccef65d3504fe78ea4c71d9171c0b4e7d
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Silence unused variable warning
Changed paths:
engines/startrek/space.cpp
diff --git a/engines/startrek/space.cpp b/engines/startrek/space.cpp
index f549d4a..1acd47d 100644
--- a/engines/startrek/space.cpp
+++ b/engines/startrek/space.cpp
@@ -400,8 +400,8 @@ void StarTrekEngine::drawR3Shape(R3 *r3) {
if (!var3fa) {
if (r3->field1e == 3) {
- // FIXME: is this used anywhere?
- uint16 var3fc = (_frameIndex << 3) ^ _frameIndex;
+ // Is this used anywhere?
+ //uint16 var3fc = (_frameIndex << 3) ^ _frameIndex;
} else {
// TODO
}
Commit: fe805de2efc393b9b0d249b483bac2425408a670
https://github.com/scummvm/scummvm/commit/fe805de2efc393b9b0d249b483bac2425408a670
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: SINS3
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/sins0.cpp
engines/startrek/rooms/sins3.cpp
engines/startrek/rooms/sins4.cpp
engines/startrek/soundeffects.h
engines/startrek/text.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index dba20a1..3791a24 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -526,14 +526,39 @@ struct AwayMission {
bool doorLaserFiredOnce; // 0x34
bool gotPointsForAccessingTerminal; // 0x35
bool scannedKeycardLock; // 0x36
- byte field39; // 0x39
+ byte laserSetting; // 0x37
+
+ // 0 if the laser hasn't been programmed with the keycard template;
+ // 1 if it has been programmed with the template;
+ // 2 if the rock has been placed on the wall.
+ byte laserPattern; // 0x38
+
+ // bit 0: got a rock, or at least scanned the ground outside
+ // bit 1: entered mineshaft room
+ // bit 2: scanned the ID card panel
+ // bit 3: set after all 3 clues are obtained and Spock explains how to make
+ // the keycard
+ byte gatheredClues; // 0x39
+
bool openedOuterDoor; // 0x3d
bool openedInnerDoor; // 0x3e
bool unlockedIDCardDoor; // 0x3f
+
+ // 0: mold hasn't been created
+ // 2: mold for the keycard has been etched into the rock
+ // 3: rock placed top of the mold
+ // 4: a keycard is there
+ int8 moldState; // 0x40
+
+ // 0: box closed
+ // 1: box open
+ // 2: box empty
+ byte boxState; // 0x41
+
bool enteredRoom0FirstTime; // 0x42
bool scottyInformedKirkAboutVirus; // 0x43
bool enteredRoom2FirstTime; // 0x44
- bool field45; // 0x45
+ bool enteredRoom3FirstTime; // 0x45
bool enteredRoom4FirstTime; // 0x46
bool gotPointsForScanningStatue; // 0x48
bool gotPointsForScanningRoom4; // 0x49
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index ab0f500..272dd61 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2269,6 +2269,64 @@ public:
// SINS3
void sins3Tick1();
+ void sins3UseSTricorderOnBox();
+ void sins3UseSTricorderOnMonitor();
+ void sins3UseSTricorderAnywhere();
+ void sins3UseSTricorderOnDrill();
+ void sins3UseSTricorderOnPanel();
+ void sins3LookAtDrill();
+ void sins3LookAtPanel();
+ void sins3LookAtMonitor();
+ void sins3LookAnywhere();
+ void sins3UseSTricorderOnWall();
+ void sins3LookAtBox();
+ void sins3UseKirkOnBox();
+ void sins3KirkReachedBox();
+ void sins3Timer0Expired();
+ void sins3UseSpockOnBox();
+ void sins3SpockReachedBox();
+ void sins3UseMccoyOnBox();
+ void sins3MccoyReachedBox();
+ void sins3UseRedshirtOnBox();
+ void sins3RedshirtReachedBox();
+ void sins3BoxOpened();
+ void sins3GetBox();
+ void sins3KirkReachedBoxToGet();
+ void sins3KirkGotBoxContents();
+ void sins3Tick30();
+ void sins3Tick60();
+ void sins3UseKirkOnPanel();
+ void sins3UseSpockOnPanel();
+ void sins3SpockReachedPanel();
+ void sins3UseRockOnWall();
+ void sins3KirkReachedWall();
+ void sins3KirkPutRockOnWall();
+ void sins3KirkBackedAwayFromWall();
+ void sins3UsedLowPowerLaserOnRock();
+ void sins3MadeHoleInRock();
+ void sins3CreatedTemplateInRock();
+ void sins3RockTurnedIntoIDCard();
+ void sins3RockVaporized();
+ void sins3UseDrillAnywhere();
+ void sins3GetIDCard();
+ void sins3ReachedIDCard();
+ void sins3PickedUpIDCard();
+ void sins3LookAtItemBeingDrilled();
+ void sins3LookAtKirk();
+ void sins3LookAtSpock();
+ void sins3LookAtMccoy();
+ void sins3LookAtRedshirt();
+ void sins3TalkToKirk();
+ void sins3TalkToSpock();
+ void sins3TalkToMccoy();
+ void sins3TalkToRedshirt();
+ void sins3UseCommunicator();
+ void sins3UseSpockOnDrill();
+ void sins3UseMccoyOnDrill();
+ void sins3UseRedshirtOnDrill();
+ void sins3WalkToDoor();
+ void sins3UseMedkitOnCrewman();
+ void sins3UseMTricorderOnCrewman();
// SINS4
void sins4Tick1();
diff --git a/engines/startrek/rooms/sins0.cpp b/engines/startrek/rooms/sins0.cpp
index 04a931d..fa0c3fa 100644
--- a/engines/startrek/rooms/sins0.cpp
+++ b/engines/startrek/rooms/sins0.cpp
@@ -133,7 +133,7 @@ void Room::sins0LookAtGround() {
void Room::sins0GetRock() {
_awayMission->disableInput = true;
loadActorAnimC(OBJECT_KIRK, "kpickw", -1, -1, &Room::sins0PickedUpRock);
- _awayMission->sins.field39 |= 1;
+ _awayMission->sins.gatheredClues |= 1;
}
void Room::sins0PickedUpRock() {
@@ -149,7 +149,7 @@ void Room::sins0UseSTricorderAnywhere() {
void Room::sins0UseSTricorderOnGround() {
spockScan(DIR_S, TX_SIN0_017);
- _awayMission->sins.field39 |= 1;
+ _awayMission->sins.gatheredClues |= 1;
}
void Room::sins0UseSTricorderOnPlanet() {
diff --git a/engines/startrek/rooms/sins3.cpp b/engines/startrek/rooms/sins3.cpp
index 81795e4..a88838d 100644
--- a/engines/startrek/rooms/sins3.cpp
+++ b/engines/startrek/rooms/sins3.cpp
@@ -22,20 +22,503 @@
#include "startrek/room.h"
-#define OBJECT_8 8
+#define OBJECT_ITEM 8 // The item being "operated" on by the drill
+#define OBJECT_9 9
+#define OBJECT_10 10
+#define OBJECT_BOX 11
-#define HOTSPOT_20 0x20
+#define HOTSPOT_DRILL 0x20
+#define HOTSPOT_PANEL 0x21
+#define HOTSPOT_BOX 0x22
+#define HOTSPOT_WALL 0x23
+#define HOTSPOT_DOOR 0x24
+#define HOTSPOT_LEFT_MONITOR 0x25
+#define HOTSPOT_RIGHT_MONITOR 0x26
namespace StarTrek {
extern const RoomAction sins3ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::sins3Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::sins3Tick1 },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_BOX, 0}, &Room::sins3UseSTricorderOnBox },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_LEFT_MONITOR, 0}, &Room::sins3UseSTricorderOnMonitor },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_RIGHT_MONITOR, 0}, &Room::sins3UseSTricorderOnMonitor },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::sins3UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_DRILL, 0}, &Room::sins3UseSTricorderOnDrill },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_PANEL, 0}, &Room::sins3UseSTricorderOnPanel },
+
+ { {ACTION_LOOK, HOTSPOT_DRILL, 0, 0}, &Room::sins3LookAtDrill },
+ { {ACTION_LOOK, HOTSPOT_PANEL, 0, 0}, &Room::sins3LookAtPanel },
+ { {ACTION_LOOK, HOTSPOT_LEFT_MONITOR, 0, 0}, &Room::sins3LookAtMonitor },
+ { {ACTION_LOOK, HOTSPOT_RIGHT_MONITOR, 0, 0}, &Room::sins3LookAtMonitor },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::sins3LookAnywhere },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_WALL, 0}, &Room::sins3UseSTricorderOnWall },
+
+ { {ACTION_LOOK, OBJECT_BOX, 0, 0}, &Room::sins3LookAtBox },
+ { {ACTION_LOOK, HOTSPOT_BOX, 0, 0}, &Room::sins3LookAtBox },
+
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_BOX, 0}, &Room::sins3UseKirkOnBox },
+ { {ACTION_DONE_WALK, 4, 0, 0}, &Room::sins3KirkReachedBox },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::sins3Timer0Expired },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_BOX, 0}, &Room::sins3UseSpockOnBox },
+ { {ACTION_DONE_WALK, 5, 0, 0}, &Room::sins3SpockReachedBox },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_BOX, 0}, &Room::sins3UseMccoyOnBox },
+ { {ACTION_DONE_WALK, 6, 0, 0}, &Room::sins3MccoyReachedBox },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_BOX, 0}, &Room::sins3UseRedshirtOnBox },
+ { {ACTION_DONE_WALK, 7, 0, 0}, &Room::sins3RedshirtReachedBox },
+ { {ACTION_DONE_ANIM, 8, 0, 0}, &Room::sins3BoxOpened },
+
+ { {ACTION_GET, OBJECT_BOX, 0, 0}, &Room::sins3GetBox },
+ { {ACTION_GET, HOTSPOT_BOX, 0, 0}, &Room::sins3GetBox },
+ { {ACTION_DONE_WALK, 3, 0, 0}, &Room::sins3KirkReachedBoxToGet },
+ { {ACTION_DONE_ANIM, 17, 0, 0}, &Room::sins3KirkGotBoxContents },
+
+ { {ACTION_TICK, 30, 0, 0}, &Room::sins3Tick30 },
+ { {ACTION_TICK, 60, 0, 0}, &Room::sins3Tick60 },
+
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_PANEL, 0}, &Room::sins3UseKirkOnPanel },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_PANEL, 0}, &Room::sins3UseSpockOnPanel },
+ { {ACTION_DONE_WALK, 10, 0, 0}, &Room::sins3SpockReachedPanel },
+ { {ACTION_USE, OBJECT_IS8ROCKS, OBJECT_ITEM, 0}, &Room::sins3UseRockOnWall },
+ { {ACTION_USE, OBJECT_IS8ROCKS, HOTSPOT_WALL, 0}, &Room::sins3UseRockOnWall },
+ { {ACTION_DONE_WALK, 1, 0, 0}, &Room::sins3KirkReachedWall },
+ { {ACTION_DONE_ANIM, 18, 0, 0}, &Room::sins3KirkPutRockOnWall },
+ { {ACTION_DONE_WALK, 2, 0, 0}, &Room::sins3KirkBackedAwayFromWall },
+ { {ACTION_DONE_ANIM, 11, 0, 0}, &Room::sins3UsedLowPowerLaserOnRock },
+ { {ACTION_DONE_ANIM, 12, 0, 0}, &Room::sins3MadeHoleInRock },
+ { {ACTION_DONE_ANIM, 13, 0, 0}, &Room::sins3CreatedTemplateInRock },
+ { {ACTION_DONE_ANIM, 14, 0, 0}, &Room::sins3RockTurnedIntoIDCard },
+ { {ACTION_DONE_ANIM, 19, 0, 0}, &Room::sins3RockVaporized },
+ { {ACTION_USE, HOTSPOT_DRILL, 0xff, 0}, &Room::sins3UseDrillAnywhere },
+
+ { {ACTION_GET, OBJECT_ITEM, 0, 0}, &Room::sins3GetIDCard },
+ { {ACTION_DONE_WALK, 15, 0, 0}, &Room::sins3ReachedIDCard },
+ { {ACTION_DONE_ANIM, 16, 0, 0}, &Room::sins3PickedUpIDCard },
+ { {ACTION_LOOK, OBJECT_ITEM, 0, 0}, &Room::sins3LookAtItemBeingDrilled },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::sins3LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::sins3LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::sins3LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::sins3LookAtRedshirt },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::sins3TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::sins3TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::sins3TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::sins3TalkToRedshirt },
+
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::sins3UseCommunicator },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_DRILL, 0}, &Room::sins3UseSpockOnDrill },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_DRILL, 0}, &Room::sins3UseMccoyOnDrill },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_DRILL, 0}, &Room::sins3UseRedshirtOnDrill },
+
+ { {ACTION_WALK, HOTSPOT_DOOR, 0, 0}, &Room::sins3WalkToDoor },
+
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_KIRK, 0}, &Room::sins3UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0}, &Room::sins3UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_MCCOY, 0}, &Room::sins3UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_REDSHIRT, 0}, &Room::sins3UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::sins3UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::sins3UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::sins3UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::sins3UseMTricorderOnCrewman },
};
extern const int sins3NumActions = sizeof(sins3ActionList) / sizeof(RoomAction);
void Room::sins3Tick1() {
+ playVoc("SIN3LOOP");
+
+ if (!_awayMission->sins.enteredRoom3FirstTime)
+ _awayMission->disableInput = 2;
+
+ if (_awayMission->sins.boxState == 1)
+ loadActorAnim2(OBJECT_BOX, "s3bxo", 0xaf, 0xb8);
+ else if (_awayMission->sins.boxState == 2)
+ loadActorAnim2(OBJECT_BOX, "s3bxe", 0xaf, 0xb8);
+
+ if (_awayMission->sins.moldState == 2)
+ loadActorAnim2(OBJECT_ITEM, "s3mold", 0, 0);
+ if (_awayMission->sins.moldState == 3)
+ loadActorAnim2(OBJECT_ITEM, "s3rock", 0, 0);
+ if (_awayMission->sins.moldState == 4)
+ loadActorAnim2(OBJECT_ITEM, "s3card", 0, 0);
+
+ _awayMission->sins.gatheredClues |= 2;
+ playMidiMusicTracks(MIDITRACK_27, -3);
+}
+
+void Room::sins3UseSTricorderOnBox() {
+ spockScan(DIR_S, TX_SIN3_003);
+}
+
+void Room::sins3UseSTricorderOnMonitor() {
+ spockScan(DIR_N, TX_SIN3_018);
+}
+
+void Room::sins3UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_SIN3_017);
+}
+
+void Room::sins3UseSTricorderOnDrill() {
+ spockScan(DIR_E, TX_SIN3_016);
+}
+
+void Room::sins3UseSTricorderOnPanel() {
+ if (_awayMission->sins.scannedKeycardLock) {
+ spockScan(DIR_E, TX_SIN3_015);
+ _awayMission->sins.laserPattern = 1;
+ } else
+ spockScan(DIR_E, TX_SIN3_019);
+}
+
+void Room::sins3LookAtDrill() {
+ showText(TX_SIN3N012);
+}
+
+void Room::sins3LookAtPanel() {
+ showText(TX_SIN3N011);
+}
+
+void Room::sins3LookAtMonitor() {
+ showText(TX_SIN3N007);
+}
+
+void Room::sins3LookAnywhere() {
+ showText(TX_SIN3N013);
+}
+
+void Room::sins3UseSTricorderOnWall() {
+ // NOTE: this event has two implementations, one unused.
+ if (true)
+ spockScan(DIR_E, TX_SIN3_023);
+ else
+ spockScan(DIR_S, TX_SIN3_022);
+}
+
+void Room::sins3LookAtBox() {
+ if (_awayMission->sins.boxState == 0)
+ showText(TX_SIN3N000);
+ else if (_awayMission->sins.boxState == 1)
+ showText(TX_SIN3N008);
+ else if (_awayMission->sins.boxState == 2)
+ showText(TX_SIN3N005);
+}
+
+void Room::sins3UseKirkOnBox() {
+ if (_awayMission->sins.boxState == 0) {
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ walkCrewmanC(OBJECT_KIRK, 0x8f, 0xa9, &Room::sins3KirkReachedBox);
+ }
+}
+
+void Room::sins3KirkReachedBox() {
+ loadActorAnim2(OBJECT_KIRK, "kusele");
+ loadActorAnimC(OBJECT_BOX, "s3bxop", 0xaf, 0xb8, &Room::sins3BoxOpened);
+ _awayMission->timers[0] = 10; // play sound in 10 ticks
+ _awayMission->sins.boxState = 1;
+}
+
+// Plays a sound effect at a specific time while opening the box
+void Room::sins3Timer0Expired() {
+ playSoundEffectIndex(SND_0c);
+}
+
+void Room::sins3UseSpockOnBox() {
+ if (_awayMission->sins.boxState == 0) {
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ walkCrewmanC(OBJECT_SPOCK, 0x8f, 0xa9, &Room::sins3SpockReachedBox);
+ }
+}
+
+void Room::sins3SpockReachedBox() {
+ loadActorAnim2(OBJECT_SPOCK, "susele");
+ loadActorAnimC(OBJECT_BOX, "s3bxop", 0xaf, 0xb8, &Room::sins3BoxOpened);
+ _awayMission->timers[0] = 10; // ENHANCEMENT (play sound in 10 ticks)
+ _awayMission->sins.boxState = 1;
+}
+
+void Room::sins3UseMccoyOnBox() {
+ if (_awayMission->sins.boxState == 0) {
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
+ walkCrewmanC(OBJECT_MCCOY, 0x8f, 0xa9, &Room::sins3MccoyReachedBox);
+ }
+}
+
+void Room::sins3MccoyReachedBox() {
+ loadActorAnim2(OBJECT_MCCOY, "musele");
+ loadActorAnimC(OBJECT_BOX, "s3bxop", 0xaf, 0xb8, &Room::sins3BoxOpened);
+ _awayMission->timers[0] = 10; // ENHANCEMENT (play sound in 10 ticks)
+ _awayMission->sins.boxState = 1;
+}
+
+void Room::sins3UseRedshirtOnBox() {
+ if (_awayMission->sins.boxState == 0) {
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
+ walkCrewmanC(OBJECT_REDSHIRT, 0x8f, 0xa9, &Room::sins3RedshirtReachedBox);
+ }
+}
+
+void Room::sins3RedshirtReachedBox() {
+ loadActorAnim2(OBJECT_REDSHIRT, "rusele");
+ loadActorAnimC(OBJECT_BOX, "s3bxop", 0xaf, 0xb8, &Room::sins3BoxOpened);
+ _awayMission->timers[0] = 10; // ENHANCEMENT (play sound in 10 ticks)
+ _awayMission->sins.boxState = 1;
+}
+
+void Room::sins3BoxOpened() {
+ loadActorAnim2(OBJECT_BOX, "s3bxo", 0xaf, 0xb8);
+ _awayMission->disableInput = false;
+}
+
+void Room::sins3GetBox() {
+ if (_awayMission->sins.boxState == 1) { // Box is open, not empty
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ walkCrewmanC(OBJECT_KIRK, 0x91, 0xab, &Room::sins3KirkReachedBoxToGet);
+ }
+}
+
+void Room::sins3KirkReachedBoxToGet() {
+ giveItem(OBJECT_ICONECT);
+ loadActorAnimC(OBJECT_KIRK, "kusele", -1, -1, &Room::sins3KirkGotBoxContents);
+}
+
+void Room::sins3KirkGotBoxContents() {
+ loadActorAnim2(OBJECT_BOX, "s3bxe", 0xaf, 0xb8);
+ _awayMission->sins.boxState = 2;
+ _awayMission->disableInput = false;
+}
+
+void Room::sins3Tick30() {
+ if (!_awayMission->sins.enteredRoom3FirstTime) {
+ showText(TX_SPEAKER_MCCOY, TX_SIN3_012);
+ showText(TX_SPEAKER_SPOCK, TX_SIN3_024);
+ showText(TX_SPEAKER_MCCOY, TX_SIN3_013);
+ _awayMission->sins.enteredRoom3FirstTime = true;
+ _awayMission->disableInput = false;
+ }
+}
+
+void Room::sins3Tick60() {
+ if (_awayMission->sins.gatheredClues == 7) {
+ showText(TX_SPEAKER_SPOCK, TX_SIN3_007);
+ _awayMission->sins.gatheredClues |= 8;
+ }
+}
+
+void Room::sins3UseKirkOnPanel() {
+ showText(TX_SPEAKER_KIRK, TX_SIN3_001);
+ sins3UseSpockOnPanel();
+}
+
+void Room::sins3UseSpockOnPanel() {
+ walkCrewmanC(OBJECT_SPOCK, 0x96, 0x78, &Room::sins3SpockReachedPanel);
+}
+
+void Room::sins3SpockReachedPanel() {
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_SIN3_LASERSETTING001, TX_SIN3_LASERSETTING010, TX_SIN3_LASERSETTING100, TX_SIN3_LASERCANCEL,
+ TX_BLANK
+ };
+
+ int choice = showText(choices);
+
+ if (choice == 3) // cancel
+ return;
+ else {
+ _awayMission->sins.laserSetting = choice + 1;
+
+ if (_awayMission->sins.laserPattern == 0 && _awayMission->sins.laserSetting == 3)
+ // High setting can't be used until the template pattern has been uploaded to
+ // the machine
+ showText(TX_SPEAKER_SPOCK, TX_SIN3_005);
+ else if (_awayMission->sins.moldState != -1) {
+ if (_awayMission->sins.moldState == 0) { // Mold not yet created
+ loadActorAnim2(OBJECT_SPOCK, "susemn");
+ playVoc("LAZERD2");
+
+ if (_awayMission->sins.laserPattern == 0 && _awayMission->sins.laserSetting == 3) {
+ // This code is unreachable, as the same condition was checked above
+ loadActorAnimC(OBJECT_ITEM, "s3las2", 0, 0, &Room::sins3MadeHoleInRock);
+ playSoundEffectIndex(SND_PHASSHOT);
+ _awayMission->sins.moldState = -1;
+ } else if (_awayMission->sins.laserPattern == 1 && _awayMission->sins.laserSetting == 3) {
+ // Strong laser creates the needed mold
+ loadActorAnimC(OBJECT_ITEM, "s3las3", 0, 0, &Room::sins3CreatedTemplateInRock);
+ playSoundEffectIndex(SND_PHASSHOT);
+ _awayMission->sins.moldState = 2;
+ } else {
+ // Weak laser does nothing to the rock
+ loadActorAnimC(OBJECT_ITEM, "s3las1", 0, 0, &Room::sins3UsedLowPowerLaserOnRock);
+ playSoundEffectIndex(SND_PHASSHOT);
+ }
+ } else if (_awayMission->sins.moldState == 3) { // There's a rock sitting on the mold
+ loadActorAnim2(OBJECT_SPOCK, "susemn");
+ playVoc("LAZERD2");
+
+ if (_awayMission->sins.laserSetting == 1 || _awayMission->sins.laserSetting == 2) {
+ // Weak-setting lasers create the keycard properly
+ loadActorAnimC(OBJECT_ITEM, "s3las4", 0, 0, &Room::sins3RockTurnedIntoIDCard);
+ playSoundEffectIndex(SND_PHASSHOT);
+ _awayMission->sins.moldState = 4;
+ } else if (_awayMission->sins.laserSetting == 3) {
+ // High-setting laser vaporizes the rocks
+ loadActorAnimC(OBJECT_ITEM, "s3las5", 0, 0, &Room::sins3RockVaporized);
+ playSoundEffectIndex(SND_PHASSHOT);
+ _awayMission->sins.moldState = 2;
+ _awayMission->sins.laserPattern = 1;
+ }
+ } else { // moldState == 2 or 4 (mold created; either keycard is in it, or nothing)
+ // "Template would be damaged from direct fire"
+ showText(TX_SPEAKER_SPOCK, TX_SIN3_006);
+ }
+ }
+ }
+}
+
+void Room::sins3UseRockOnWall() {
+ if (_awayMission->sins.moldState == 2) {
+ _awayMission->sins.moldState = 3;
+ _awayMission->sins.laserPattern = 2;
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x10f, 0xa7, &Room::sins3KirkReachedWall);
+ }
+}
+
+void Room::sins3KirkReachedWall() {
+ loadActorAnimC(OBJECT_KIRK, "kuseme", -1, -1, &Room::sins3KirkPutRockOnWall);
+}
+
+void Room::sins3KirkPutRockOnWall() {
+ loseItem(OBJECT_IS8ROCKS);
+ loadActorAnim2(OBJECT_ITEM, "s3rock", 0, 0);
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ walkCrewmanC(OBJECT_KIRK, 0xfa, 0xaa, &Room::sins3KirkBackedAwayFromWall);
+}
+
+void Room::sins3KirkBackedAwayFromWall() {
+ _awayMission->disableInput = false;
+}
+
+void Room::sins3UsedLowPowerLaserOnRock() {
+ loadActorStandAnim(OBJECT_ITEM);
+}
+
+void Room::sins3MadeHoleInRock() {
+ // Unused
+ loadActorAnim2(OBJECT_ITEM, "s3hole", 0, 0);
+}
+
+void Room::sins3CreatedTemplateInRock() {
+ loadActorAnim2(OBJECT_ITEM, "s3mold", 0, 0);
+}
+
+void Room::sins3RockTurnedIntoIDCard() {
+ loadActorAnim2(OBJECT_ITEM, "s3card", 0, 0);
+}
+
+void Room::sins3RockVaporized() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN3_021);
+}
+
+void Room::sins3UseDrillAnywhere() {
+ // It isn't possible to "use" a hotspot on something else, so this is never called?
+ showText(TX_SIN3N009);
+}
+
+void Room::sins3GetIDCard() {
+ if (_awayMission->sins.moldState == 4) {
+ walkCrewmanC(OBJECT_KIRK, 0x10f, 0xa7, &Room::sins3ReachedIDCard);
+ _awayMission->disableInput = true;
+ }
+}
+
+void Room::sins3ReachedIDCard() {
+ loadActorAnimC(OBJECT_KIRK, "kuseme", -1, -1, &Room::sins3PickedUpIDCard);
+}
+
+void Room::sins3PickedUpIDCard() {
+ giveItem(OBJECT_IIDCARD);
+ loadActorAnim(OBJECT_ITEM, "s3mold", 0, 0);
+ _awayMission->sins.moldState = 2;
+ _awayMission->sins.laserPattern = 1;
+ _awayMission->disableInput = false;
+}
+
+void Room::sins3LookAtItemBeingDrilled() {
+ if (_awayMission->sins.moldState == 2)
+ showText(TX_SIN3N006);
+ else if (_awayMission->sins.moldState == 3)
+ showText(TX_SIN3N014);
+ else if (_awayMission->sins.moldState == 4)
+ showText(TX_SIN3N010);
+}
+
+void Room::sins3LookAtKirk() {
+ showText(TX_SIN3N003);
+}
+
+void Room::sins3LookAtSpock() {
+ showText(TX_SIN3N004);
+}
+
+void Room::sins3LookAtMccoy() {
+ showText(TX_SIN3N001); // BUGFIX: Speaker is "nobody", not Dr. McCoy
+}
+
+void Room::sins3LookAtRedshirt() {
+ showText(TX_SIN3N002);
+}
+
+void Room::sins3TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_SIN3_002);
+}
+
+void Room::sins3TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN3_020);
+}
+
+void Room::sins3TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN3_011);
+}
+
+void Room::sins3TalkToRedshirt() {
+ showText(TX_SPEAKER_MOSHER, TX_SIN3_026);
+ showText(TX_SPEAKER_MCCOY, TX_SIN3_014);
+ showText(TX_SPEAKER_MOSHER, TX_SIN3_027);
+}
+
+void Room::sins3UseCommunicator() {
+ showText(TX_SPEAKER_UHURA, TX_SIN3U072);
+}
+
+void Room::sins3UseSpockOnDrill() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN3_004);
+}
+
+void Room::sins3UseMccoyOnDrill() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN3_009);
+}
+
+void Room::sins3UseRedshirtOnDrill() {
+ showText(TX_SPEAKER_MOSHER, TX_SIN3_025);
+}
+
+void Room::sins3WalkToDoor() {
+ walkCrewman(OBJECT_KIRK, 0x2b, 0x86);
+}
+
+void Room::sins3UseMedkitOnCrewman() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN3_010);
+}
+
+void Room::sins3UseMTricorderOnCrewman() {
+ mccoyScan(DIR_S, TX_SIN3_008);
}
}
diff --git a/engines/startrek/rooms/sins4.cpp b/engines/startrek/rooms/sins4.cpp
index 1400e66..1278e6d 100644
--- a/engines/startrek/rooms/sins4.cpp
+++ b/engines/startrek/rooms/sins4.cpp
@@ -110,11 +110,11 @@ void Room::sins4Tick1() {
void Room::sins4UseSTricorderOnPanel() {
spockScan(DIR_N, TX_SIN4_020);
_awayMission->sins.scannedKeycardLock = true;
- _awayMission->sins.field39 |= 4;
+ _awayMission->sins.gatheredClues |= 4;
- if (_awayMission->sins.field39 == 7) {
+ if (_awayMission->sins.gatheredClues == 7) {
showText(TX_SPEAKER_SPOCK, TX_SIN4_010);
- _awayMission->sins.field39 |= 8;
+ _awayMission->sins.gatheredClues |= 8;
}
}
@@ -125,9 +125,9 @@ void Room::sins4UseSpockOnPanel() {
else {
showText(TX_SPEAKER_SPOCK, TX_SIN4_021);
- if (_awayMission->sins.field39 == 7) {
+ if (_awayMission->sins.gatheredClues == 7) {
showText(TX_SPEAKER_SPOCK, TX_SIN4_010);
- _awayMission->sins.field39 |= 8;
+ _awayMission->sins.gatheredClues |= 8;
}
}
}
@@ -173,9 +173,9 @@ void Room::sins4KirkUsedRockOnPanel() {
showText(TX_SIN4N012);
showText(TX_SPEAKER_SPOCK, TX_SIN4_022);
- if (_awayMission->sins.field39 == 7) {
+ if (_awayMission->sins.gatheredClues == 7) {
showText(TX_SPEAKER_SPOCK, TX_SIN4_010);
- _awayMission->sins.field39 |= 8;
+ _awayMission->sins.gatheredClues |= 8;
}
}
@@ -278,7 +278,7 @@ void Room::sins4UseSTricorderAnywhere() {
}
void Room::sins4UseCommunicator() {
- if (!_awayMission->sins.field45) {
+ if (!_awayMission->sins.enteredRoom3FirstTime) {
showText(TX_SPEAKER_UHURA, TX_SIN4U100);
showText(TX_SPEAKER_KIRK, TX_SIN4_006);
showText(TX_SPEAKER_UHURA, TX_SIN4U83B);
diff --git a/engines/startrek/soundeffects.h b/engines/startrek/soundeffects.h
index 357c36e..adfb4eb 100644
--- a/engines/startrek/soundeffects.h
+++ b/engines/startrek/soundeffects.h
@@ -34,6 +34,7 @@ enum SoundEffects {
SND_TRANSMAT = 9,
SND_TRANSENE = 0x0a,
SND_BLANK_0b = 0x0b,
+ SND_0c = 0x0c,
SND_SELECTION = 0x10,
SND_BLANK_14 = 0x14,
SND_BLANK_16 = 0x16,
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 1ec9b83..cf16466 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -2541,6 +2541,10 @@ extern const char *const g_gameStrings[] = {
"#SIN3\\SIN3N013#This room looks like it was once used for some type of mining operation.",
"#SIN3\\SIN3N014#You have placed the rocks onto the pattern.",
"#SIN3\\SIN3U072#Nothing new to report Captain.",
+ "Laser Setting: 001",
+ "Laser Setting: 010",
+ "Laser Setting: 100",
+ "cancel",
"#SIN4\\SIN4_001#At least the Enterprise is safe.",
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 90eb63f..594eede 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -2643,6 +2643,10 @@ enum GameStringIDs {
TX_SIN3N013,
TX_SIN3N014,
TX_SIN3U072,
+ TX_SIN3_LASERSETTING001, // Custom named text
+ TX_SIN3_LASERSETTING010,
+ TX_SIN3_LASERSETTING100,
+ TX_SIN3_LASERCANCEL,
TX_SIN4_001,
Commit: cba056732725156bebfc0fe0bd952abbdd6cb85b
https://github.com/scummvm/scummvm/commit/cba056732725156bebfc0fe0bd952abbdd6cb85b
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: SINS3 text changes
Changed paths:
engines/startrek/text.cpp
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index cf16466..3e9c6a2 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -2535,7 +2535,7 @@ extern const char *const g_gameStrings[] = {
"#SIN3\\SIN3N007#These are display panels for the laser drill.",
"#SIN3\\SIN3N008#This box contains old wire and connectors.",
"#SIN3\\SIN3N009#This is a high powered item that will cause irrevocable damage if you use it in this manner.",
- "#SIN3\\SIN3N010#This is a keycard made from the tri-phosphate silver rock.",
+ "#SIN3\\SIN3N010#This is a keycard made from the tri-phosphorate silver rock.", // TYPO
"#SIN3\\SIN3N011#This is a laser drill control panel.",
"#SIN3\\SIN3N012#This is an ancient laser drill.",
"#SIN3\\SIN3N013#This room looks like it was once used for some type of mining operation.",
Commit: be4174dc3df84e89dbab95af1b6f4af896c08125
https://github.com/scummvm/scummvm/commit/be4174dc3df84e89dbab95af1b6f4af896c08125
Author: Strangerke (strangerke at scummvm.org)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Janitorial: Add end of namespace comments
Changed paths:
engines/startrek/action.h
engines/startrek/awaymission.cpp
engines/startrek/bitmap.cpp
engines/startrek/bitmap.h
engines/startrek/common.cpp
engines/startrek/common.h
engines/startrek/events.cpp
engines/startrek/filestream.cpp
engines/startrek/filestream.h
engines/startrek/fixedint.h
engines/startrek/font.cpp
engines/startrek/font.h
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/items.h
engines/startrek/iwfile.cpp
engines/startrek/iwfile.h
engines/startrek/lzss.cpp
engines/startrek/lzss.h
engines/startrek/math.cpp
engines/startrek/menu.cpp
engines/startrek/object.cpp
engines/startrek/object.h
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/saveload.cpp
engines/startrek/sound.cpp
engines/startrek/sound.h
engines/startrek/space.cpp
engines/startrek/space.h
engines/startrek/sprite.cpp
engines/startrek/sprite.h
engines/startrek/text.cpp
engines/startrek/text.h
engines/startrek/textbox.cpp
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
index 4b8409e..73e81d9 100644
--- a/engines/startrek/action.h
+++ b/engines/startrek/action.h
@@ -96,6 +96,6 @@ struct Action {
}
};
-}
+} // End of namespace StarTrek
#endif
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp
index 4fb62cd..ce70903 100644
--- a/engines/startrek/awaymission.cpp
+++ b/engines/startrek/awaymission.cpp
@@ -764,4 +764,4 @@ void StarTrekEngine::loadRoomIndex(int roomIndex, int spawnIndex) {
// the top of "runAwayMission". That can't really be done here. But does it matter?
}
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/bitmap.cpp b/engines/startrek/bitmap.cpp
index 812b61a..46d3a3a 100644
--- a/engines/startrek/bitmap.cpp
+++ b/engines/startrek/bitmap.cpp
@@ -71,4 +71,4 @@ StubBitmap::StubBitmap(int w, int h) {
pixelsArraySize = 0;
}
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/bitmap.h b/engines/startrek/bitmap.h
index 4ff285c..53edb09 100644
--- a/engines/startrek/bitmap.h
+++ b/engines/startrek/bitmap.h
@@ -47,6 +47,6 @@ struct StubBitmap : Bitmap {
StubBitmap(int w, int h);
};
-}
+} // End of namespace StarTrek
#endif
diff --git a/engines/startrek/common.cpp b/engines/startrek/common.cpp
index 211a2f7..9fb4112 100644
--- a/engines/startrek/common.cpp
+++ b/engines/startrek/common.cpp
@@ -42,4 +42,4 @@ void serializeRect(Common::Rect rect, Common::Serializer &ser) {
ser.syncAsSint16LE(rect.bottom);
}
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/common.h b/engines/startrek/common.h
index 1267364..c7a512a 100644
--- a/engines/startrek/common.h
+++ b/engines/startrek/common.h
@@ -45,7 +45,6 @@ T max(T a, T b) {
Common::Rect getRectEncompassing(Common::Rect r1, Common::Rect r2);
void serializeRect(Common::Rect rect, Common::Serializer &ser);
-
-}
+} // End of namespace StarTrek
#endif
diff --git a/engines/startrek/events.cpp b/engines/startrek/events.cpp
index a78a417..a8b2552 100644
--- a/engines/startrek/events.cpp
+++ b/engines/startrek/events.cpp
@@ -185,4 +185,4 @@ void StarTrekEngine::addEventToQueue(const TrekEvent &e) {
_eventQueue.push_back(e);
}
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/filestream.cpp b/engines/startrek/filestream.cpp
index e0916fc..f90387c 100644
--- a/engines/startrek/filestream.cpp
+++ b/engines/startrek/filestream.cpp
@@ -77,4 +77,4 @@ bool FileStream::seek(int32 offset, int whence) {
return true;
}
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/filestream.h b/engines/startrek/filestream.h
index 3b52b20..ddef496 100644
--- a/engines/startrek/filestream.h
+++ b/engines/startrek/filestream.h
@@ -56,6 +56,6 @@ public:
};
-}
+} // End of namespace StarTrek
#endif
diff --git a/engines/startrek/fixedint.h b/engines/startrek/fixedint.h
index 65b4812..605f166 100644
--- a/engines/startrek/fixedint.h
+++ b/engines/startrek/fixedint.h
@@ -185,6 +185,6 @@ typedef TFixedInt<int32, 32, 16> Fixed16;
typedef Fixed8 Angle;
-}
+} // End of namespace StarTrek
#endif
diff --git a/engines/startrek/font.cpp b/engines/startrek/font.cpp
index 6cd3f1b..f980234 100644
--- a/engines/startrek/font.cpp
+++ b/engines/startrek/font.cpp
@@ -78,4 +78,4 @@ const byte Font::_fontProperties[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/font.h b/engines/startrek/font.h
index 184d5ab..27f8fa2 100644
--- a/engines/startrek/font.h
+++ b/engines/startrek/font.h
@@ -47,7 +47,6 @@ private:
const static byte _fontProperties[256];
};
-
-}
+} // End of namespace StarTrek
#endif
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 5d484ed..8a67c5b 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -756,4 +756,4 @@ void Graphics::drawBackgroundImage(const char *filename) {
delete[] palette;
}
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 627b5be..46709cd 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -187,10 +187,9 @@ private:
bool _mouseLocked;
Sprite _lockedMouseSprite;
-
public:
};
-}
+} // End of namespace StarTrek
#endif
diff --git a/engines/startrek/items.h b/engines/startrek/items.h
index fdf1825..1d930e7 100644
--- a/engines/startrek/items.h
+++ b/engines/startrek/items.h
@@ -255,6 +255,6 @@ const Item g_itemList[] = {
const int NUM_ITEMS = sizeof(g_itemList) / sizeof(struct Item) - 64; // 0x49
-}
+} // End of namespace StarTrek
#endif
diff --git a/engines/startrek/iwfile.cpp b/engines/startrek/iwfile.cpp
index 9e9131f..e61f6a0 100644
--- a/engines/startrek/iwfile.cpp
+++ b/engines/startrek/iwfile.cpp
@@ -75,4 +75,4 @@ int IWFile::getClosestKeyPosition(int16 x, int16 y) {
return -1;
}
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/iwfile.h b/engines/startrek/iwfile.h
index 3f230ff..dfd59d3 100644
--- a/engines/startrek/iwfile.h
+++ b/engines/startrek/iwfile.h
@@ -60,6 +60,6 @@ private:
uint16 _numEntries;
};
-}
+} // End of namespace StarTrek
#endif
diff --git a/engines/startrek/lzss.cpp b/engines/startrek/lzss.cpp
index bc7e889..66ad43f 100644
--- a/engines/startrek/lzss.cpp
+++ b/engines/startrek/lzss.cpp
@@ -81,5 +81,5 @@ Common::SeekableReadStream *decodeLZSS(Common::SeekableReadStream *indata, uint3
return new Common::MemoryReadStream(outLzssBufData, uncompressedSize, DisposeAfterUse::YES);
}
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/lzss.h b/engines/startrek/lzss.h
index 1599812..29ed1eb 100644
--- a/engines/startrek/lzss.h
+++ b/engines/startrek/lzss.h
@@ -54,4 +54,4 @@ public:
};
*/
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/math.cpp b/engines/startrek/math.cpp
index da81b1f..70b9ddb 100644
--- a/engines/startrek/math.cpp
+++ b/engines/startrek/math.cpp
@@ -126,4 +126,4 @@ Angle StarTrekEngine::atan2(int32 deltaX, int32 deltaY) {
return Angle::fromRaw(angle);
}
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index 5fbc8d5..13ca59b 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -1010,4 +1010,4 @@ void StarTrekEngine::saveTextDisplayMode(int value) {
// TODO;
}
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/object.cpp b/engines/startrek/object.cpp
index aafa138..f0eb6d6 100644
--- a/engines/startrek/object.cpp
+++ b/engines/startrek/object.cpp
@@ -24,4 +24,4 @@
namespace StarTrek {
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index d412b8e..3abcbe9 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -180,7 +180,7 @@ public:
};
-}
+} // End of namespace StarTrek
#endif
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 59ed8fb..3be0783 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -536,4 +536,4 @@ void Room::mccoyScan(int direction, TextRef text, bool changeDirection) {
showText(TX_SPEAKER_MCCOY, text);
}
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 272dd61..8b76a57 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2679,6 +2679,6 @@ public:
} _roomVar;
};
-}
+} // End of namespace StarTrek
#endif
diff --git a/engines/startrek/saveload.cpp b/engines/startrek/saveload.cpp
index bb24587..e7a288c 100644
--- a/engines/startrek/saveload.cpp
+++ b/engines/startrek/saveload.cpp
@@ -398,4 +398,4 @@ bool saveOrLoadMetadata(Common::SeekableReadStream *in, Common::WriteStream *out
return true;
}
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 24a9758..f159e0c 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -370,5 +370,4 @@ void Sound::midiDriverCallback(void *data) {
}
}
-
} // End of namespace StarTrek
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
index 1b7021a..5df02bc 100644
--- a/engines/startrek/sound.h
+++ b/engines/startrek/sound.h
@@ -103,6 +103,6 @@ private:
static void midiDriverCallback(void *data);
};
-}
+} // End of namespace StarTrek
#endif
diff --git a/engines/startrek/space.cpp b/engines/startrek/space.cpp
index 1acd47d..054e78b 100644
--- a/engines/startrek/space.cpp
+++ b/engines/startrek/space.cpp
@@ -551,4 +551,4 @@ Matrix StarTrekEngine::initSpeedMatrixForXZMovement(Angle angle, const Matrix &m
return matrix * matrix1;
}
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/space.h b/engines/startrek/space.h
index 0d113cf..d980d23 100644
--- a/engines/startrek/space.h
+++ b/engines/startrek/space.h
@@ -180,6 +180,6 @@ struct R3 {
// Maximum number of R3 objects in space at once
#define NUM_SPACE_OBJECTS 0x30
-}
+} // End of namespace StarTrek
#endif
diff --git a/engines/startrek/sprite.cpp b/engines/startrek/sprite.cpp
index dc01a91..63e24c2 100644
--- a/engines/startrek/sprite.cpp
+++ b/engines/startrek/sprite.cpp
@@ -75,4 +75,4 @@ void Sprite::saveLoadWithSerializer(Common::Serializer &ser) {
ser.syncAsSint16LE(drawY);
}
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/sprite.h b/engines/startrek/sprite.h
index d8cfc0b..ab66ade 100644
--- a/engines/startrek/sprite.h
+++ b/engines/startrek/sprite.h
@@ -74,6 +74,6 @@ struct Sprite : Common::Serializable {
virtual void saveLoadWithSerializer(Common::Serializer &ser);
};
-}
+} // End of namespace StarTrek
#endif
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 3e9c6a2..0f3b3e6 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -2609,4 +2609,4 @@ extern const char *const g_gameStrings[] = {
"#SFX\\STATICU1#Ent... neu ... trans...",
};
-}
+} // End of namespace StarTrek
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 594eede..80c7113 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -2719,6 +2719,6 @@ enum GameStringIDs {
// defined in text.cpp
extern const char *const g_gameStrings[];
-}
+} // End of namespace StarTrek
#endif
diff --git a/engines/startrek/textbox.cpp b/engines/startrek/textbox.cpp
index 1a05ecc..e32f456 100644
--- a/engines/startrek/textbox.cpp
+++ b/engines/startrek/textbox.cpp
@@ -930,4 +930,4 @@ void StarTrekEngine::cleanupTextInputSprite() {
_textInputBitmap.reset();
}
-}
+} // End of namespace StarTrek
Commit: 982502650f8b6378f30dfbd324cd7881f6e30ab0
https://github.com/scummvm/scummvm/commit/982502650f8b6378f30dfbd324cd7881f6e30ab0
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Replace min & max with MIN & MAX
Changed paths:
engines/startrek/common.cpp
engines/startrek/common.h
engines/startrek/textbox.cpp
diff --git a/engines/startrek/common.cpp b/engines/startrek/common.cpp
index 9fb4112..b88c3f6 100644
--- a/engines/startrek/common.cpp
+++ b/engines/startrek/common.cpp
@@ -27,10 +27,10 @@
namespace StarTrek {
Common::Rect getRectEncompassing(Common::Rect r1, Common::Rect r2) {
- uint16 l = min(r1.left, r2.left);
- uint16 t = min(r1.top, r2.top);
- uint16 r = max(r1.right, r2.right);
- uint16 b = max(r1.bottom, r2.bottom);
+ uint16 l = MIN(r1.left, r2.left);
+ uint16 t = MIN(r1.top, r2.top);
+ uint16 r = MAX(r1.right, r2.right);
+ uint16 b = MAX(r1.bottom, r2.bottom);
return Common::Rect(l, t, r, b);
}
diff --git a/engines/startrek/common.h b/engines/startrek/common.h
index c7a512a..57408b8 100644
--- a/engines/startrek/common.h
+++ b/engines/startrek/common.h
@@ -32,16 +32,6 @@ class Serializer;
namespace StarTrek {
-template<class T>
-T min(T a, T b) {
- return a < b ? a : b;
-}
-
-template<class T>
-T max(T a, T b) {
- return a > b ? a : b;
-}
-
Common::Rect getRectEncompassing(Common::Rect r1, Common::Rect r2);
void serializeRect(Common::Rect rect, Common::Serializer &ser);
diff --git a/engines/startrek/textbox.cpp b/engines/startrek/textbox.cpp
index e32f456..f82369c 100644
--- a/engines/startrek/textbox.cpp
+++ b/engines/startrek/textbox.cpp
@@ -142,7 +142,7 @@ String StarTrekEngine::centerTextboxHeader(String headerText) {
text[TEXT_CHARS_PER_LINE] = '\0';
int strlen = headerText.size();
- strlen = min(strlen, TEXT_CHARS_PER_LINE);
+ strlen = MIN(strlen, TEXT_CHARS_PER_LINE);
memcpy(text + (TEXT_CHARS_PER_LINE - strlen) / 2, headerText.c_str(), strlen);
Commit: a1107f0500e97782a69b6a2d3edac25d67fb75d6
https://github.com/scummvm/scummvm/commit/a1107f0500e97782a69b6a2d3edac25d67fb75d6
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Use AD_ENTRY1s for game detection
Changed paths:
engines/startrek/detection.cpp
engines/startrek/startrek.h
engines/startrek/text.h
diff --git a/engines/startrek/detection.cpp b/engines/startrek/detection.cpp
index 0cdc0ef..88488a6 100644
--- a/engines/startrek/detection.cpp
+++ b/engines/startrek/detection.cpp
@@ -42,7 +42,7 @@ struct StarTrekGameDescription {
uint8 gameType;
uint32 features;
- uint16 version;
+ bool isCDEdition;
};
uint32 StarTrekEngine::getFeatures() const {
@@ -53,15 +53,15 @@ Common::Platform StarTrekEngine::getPlatform() const {
return _gameDescription->desc.platform;
}
-uint16 StarTrekEngine::getVersion() const {
- return _gameDescription->version;
+bool StarTrekEngine::isCDEdition() const {
+ return _gameDescription->isCDEdition;
}
-uint8 StarTrekEngine::getGameType() {
+uint8 StarTrekEngine::getGameType() const {
return _gameDescription->gameType;
}
-Common::Language StarTrekEngine::getLanguage() {
+Common::Language StarTrekEngine::getLanguage() const {
return _gameDescription->desc.language;
}
@@ -78,11 +78,13 @@ static const PlainGameDescriptor starTrekGames[] = {
namespace StarTrek {
static const StarTrekGameDescription gameDescriptions[] = {
- {
+ // TODO: Replace AD_ENTRY1 with AD_ENTRY1s for game versions I don't have yet
+
+ { // ST25 DOS CD-ROM edition (EN)
{
"st25",
- "",
- AD_ENTRY1("data.001", "57040928a0f374281aa86ba4e7db8444"),
+ "CD",
+ AD_ENTRY1s("data.001", "57040928a0f374281aa86ba4e7db8444", 7793814),
Common::EN_ANY,
Common::kPlatformDOS,
ADGF_NO_FLAGS,
@@ -90,13 +92,28 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
+ true,
+ },
+
+ { // ST25 DOS floppy edition (EN)
+ {
+ "st25",
+ "Floppy",
+ AD_ENTRY1s("data.001", "57040928a0f374281aa86ba4e7db8444", 7222630),
+ Common::EN_ANY,
+ Common::kPlatformDOS,
+ ADGF_NO_FLAGS,
+ GUIO0()
+ },
+ GType_ST25,
0,
+ false,
},
- {
+ { // ST25 Amiga ? (EN)
{
"st25",
- "",
+ "Floppy",
AD_ENTRY1("data.000", "f0918b6d096455ce2ae6dd5ef973292e"),
Common::EN_ANY,
Common::kPlatformAmiga,
@@ -105,13 +122,13 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
- 0,
+ false,
},
- {
+ { // ST25 Amiga ? (GER)
{
"st25",
- "",
+ "Floppy",
AD_ENTRY1("data.000", "70d0e374d5fa973e536dba0f42310672"),
Common::DE_DEU,
Common::kPlatformAmiga,
@@ -120,13 +137,13 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
- 0,
+ false,
},
- {
+ { // ST25 Amiga ? (FR)
{
"st25",
- "",
+ "Floppy",
AD_ENTRY1("data.000", "d0299af1385edd7c7612ed453e417dd8"),
Common::FR_FRA,
Common::kPlatformAmiga,
@@ -135,13 +152,13 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
- 0,
+ false,
},
- {
+ { // ST25 Mac ? (EN)
{
"st25",
- "",
+ "Floppy",
AD_ENTRY1("Star Trek Data", "871fa51c7680c0a43df9622128f1569f"),
Common::EN_ANY,
Common::kPlatformMacintosh,
@@ -150,14 +167,14 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
- 0,
+ false,
},
- {
+ { // ST25 Mac floppy edition (EN)
{
"st25",
- "",
- AD_ENTRY1("Star Trek Data", "d95eb00532b7082d53862c906c7ac3dc"),
+ "Floppy",
+ AD_ENTRY1s("Star Trek Data", "d95eb00532b7082d53862c906c7ac3dc", 39032),
Common::EN_ANY,
Common::kPlatformMacintosh,
ADGF_MACRESFORK,
@@ -165,10 +182,10 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
- 0,
+ false,
},
- {
+ { // ST25 DOS demo ? (EN)
{
"st25",
"Demo",
@@ -180,10 +197,10 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
GF_DEMO,
- 0,
+ false,
},
- {
+ { // ST25 MAC demo ? (EN)
{
"st25",
"Demo",
@@ -195,14 +212,14 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
GF_DEMO,
- 0,
+ false,
},
- {
+ { // STJR DOS CD-ROM edition (EN)
{
"stjr",
- "",
- AD_ENTRY1("data.001", "1c8de3c02f69c07c582d59d3c29e4dd9"),
+ "CD",
+ AD_ENTRY1s("data.001", "1c8de3c02f69c07c582d59d3c29e4dd9", 3318644),
Common::EN_ANY,
Common::kPlatformDOS,
ADGF_NO_FLAGS,
@@ -210,7 +227,7 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_STJR,
0,
- 0,
+ true,
},
{ AD_TABLE_END_MARKER, 0, 0, 0 }
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index e8ea798..c1f2cf6 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -639,10 +639,10 @@ public:
public:
const StarTrekGameDescription *_gameDescription;
uint32 getFeatures() const;
- uint16 getVersion() const;
+ bool isCDEdition() const;
Common::Platform getPlatform() const;
- uint8 getGameType();
- Common::Language getLanguage();
+ uint8 getGameType() const;
+ Common::Language getLanguage() const;
// Resource related functions
SharedPtr<FileStream> loadFile(Common::String filename, int fileIndex = 0);
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 80c7113..e56327a 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -32,6 +32,7 @@ namespace StarTrek {
typedef int32 TextRef;
// Text that's loaded from "GROUND.TXT". First 0x40 pieces of text are for items.
+// TODO: Floppy version has different numbers for this.
enum GroundTextIDs {
// Generic "perform undefined action" text (ie. look at nothing, talk to wall)
GROUNDTX_LOOK_KIRK = 0x49,
Commit: 06d7656d42ec5e4ba540dc613b6f6793c9979cfc
https://github.com/scummvm/scummvm/commit/06d7656d42ec5e4ba540dc613b6f6793c9979cfc
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Play midi sounds on floppy version
Changed paths:
engines/startrek/sound.cpp
engines/startrek/startrek.cpp
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index f159e0c..2c4abff 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -63,7 +63,9 @@ Sound::Sound(StarTrekEngine *vm) : _vm(vm) {
_midiSlotList.push_back(&_midiSlots[i]);
}
- if (!SearchMan.hasFile("voc/speech.mrk")) {
+ if (!_vm->isCDEdition())
+ _vm->_sfxWorking = false;
+ else if (!SearchMan.hasFile("voc/speech.mrk")) {
warning("Couldn't find 'voc/speech.mrk'. The 'trekcd/voc/' directory should be dumped from the CD. Continuing without CD audio");
_vm->_sfxWorking = false;
}
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 2086b36..c201e3f 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -55,6 +55,11 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_redshirtActor(&_actorList[3]),
_sineTable(10) {
+ if (getPlatform() != Common::kPlatformDOS)
+ error("Only DOS versions of Star Trek: 25th Anniversary are currently supported");
+ else if (getGameType() == GType_STJR)
+ error("Star Trek: Judgment Rites not yet supported");
+
DebugMan.addDebugChannel(kDebugSound, "sound", "Sound");
DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics");
DebugMan.addDebugChannel(kDebugSavegame, "savegame", "Savegames");
@@ -524,54 +529,58 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
}
void StarTrekEngine::playSoundEffectIndex(int index) {
- switch (index) {
- case 0x04:
- _sound->playVoc("tricorde");
- break;
- case 0x05:
- _sound->playVoc("STDOOR1");
- break;
- case 0x06:
- _sound->playVoc("PHASSHOT");
- break;
- case 0x07:
- _sound->playMidiTrack(index);
- break;
- case 0x08:
- _sound->playVoc("TRANSDEM");
- break;
- case 0x09: // Beaming in?
- _sound->playVoc("TRANSMAT");
- break;
- case 0x0a: // Beaming out?
- _sound->playVoc("TRANSENE");
- break;
- case 0x10: // Menu selection sound
- _sound->playMidiTrack(index);
- break;
- case 0x22:
- _sound->playVoc("HAILING");
- break;
- case 0x24:
- _sound->playVoc("PHASSHOT");
- break;
- case 0x25:
- _sound->playVoc("PHOTSHOT");
- break;
- case 0x26:
- _sound->playVoc("HITSHIEL");
- break;
- case 0x27:
+ if (!isCDEdition())
_sound->playMidiTrack(index);
- break;
- case 0x28:
- _sound->playVoc("REDALERT");
- break;
- case 0x29:
- _sound->playVoc("WARP");
- break;
- default:
- break;
+ else {
+ switch (index) {
+ case 0x04:
+ _sound->playVoc("tricorde");
+ break;
+ case 0x05:
+ _sound->playVoc("STDOOR1");
+ break;
+ case 0x06:
+ _sound->playVoc("PHASSHOT");
+ break;
+ case 0x07:
+ _sound->playMidiTrack(index);
+ break;
+ case 0x08:
+ _sound->playVoc("TRANSDEM");
+ break;
+ case 0x09: // Beaming in?
+ _sound->playVoc("TRANSMAT");
+ break;
+ case 0x0a: // Beaming out?
+ _sound->playVoc("TRANSENE");
+ break;
+ case 0x10: // Menu selection sound
+ _sound->playMidiTrack(index);
+ break;
+ case 0x22:
+ _sound->playVoc("HAILING");
+ break;
+ case 0x24:
+ _sound->playVoc("PHASSHOT");
+ break;
+ case 0x25:
+ _sound->playVoc("PHOTSHOT");
+ break;
+ case 0x26:
+ _sound->playVoc("HITSHIEL");
+ break;
+ case 0x27:
+ _sound->playMidiTrack(index);
+ break;
+ case 0x28:
+ _sound->playVoc("REDALERT");
+ break;
+ case 0x29:
+ _sound->playVoc("WARP");
+ break;
+ default:
+ break;
+ }
}
}
Commit: 1c89c065082d47a56cd972984887d238ea6d03e8
https://github.com/scummvm/scummvm/commit/1c89c065082d47a56cd972984887d238ea6d03e8
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: SINS5
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/sins5.cpp
engines/startrek/text.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 3791a24..0c6f338 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -540,6 +540,14 @@ struct AwayMission {
// the keycard
byte gatheredClues; // 0x39
+ // bit 0: scanned left computer
+ // bit 1: scanned right computer
+ // bit 2: accessed left computer
+ // bit 3: accessed right computer
+ byte scannedAndUsedComputers; // 0x3a
+
+ bool wireConnected1; // 0x3b
+ bool wireConnected2; // 0x3c
bool openedOuterDoor; // 0x3d
bool openedInnerDoor; // 0x3e
bool unlockedIDCardDoor; // 0x3f
@@ -560,9 +568,17 @@ struct AwayMission {
bool enteredRoom2FirstTime; // 0x44
bool enteredRoom3FirstTime; // 0x45
bool enteredRoom4FirstTime; // 0x46
+ bool enteredRoom5FirstTime; // 0x47
bool gotPointsForScanningStatue; // 0x48
bool gotPointsForScanningRoom4; // 0x49
+ bool gotPointsForScanningRoom5; // 0x4a
+ bool gotPointsForScanningRightComputer; // 0x4b
+ bool gotPointsForScanningLeftComputer; // 0x4c
+ bool gotPointsForUsingRightComputer; // 0x4d
+ bool gotPointsForUsingLeftComputer; // 0x4e
+ bool discoveredComputersOutOfSync; // 0x4f
bool enteredRoom1FirstTime; // 0x50
+ bool gotPointsForEnteringRoom5; // 0x51
int16 missionScore; // 0x52
} sins;
};
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 8b76a57..8781dfa 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2373,6 +2373,63 @@ public:
// SINS5
void sins5Tick1();
+ void sins5UseSTricorderAnywhere();
+ void sins5UseSTricorderOnRightComputer();
+ void sins5UseSTricorderOnLeftComputer();
+ void sins5UseSTricorderOnMiddleComputer();
+ void sins5UseKirkOnRightComputer();
+ void sins5UseKirkOnLeftComputer();
+ void sins5UseKirkOnMiddleComputer();
+ void sins5UseMccoyOnComputer();
+ void sins5UseRedshirtOnComputer();
+ void sins5UseSpockOnMiddleComputer();
+ void sins5UseSpockOnRightComputer();
+ void sins5SpockReachedRightComputer();
+ void sins5SpockUsedRightComputer();
+ void sins5UseSpockOnLeftComputer();
+ void sins5SpockReachedLeftComputer();
+ void sins5SpockUsedLeftComputer();
+ void sins5CrewmanReadyToBeamOut();
+ void sins5Tick20();
+ void sins5CheckGatheredAllClues();
+ void sins5UseWireOnComputer();
+ void sins5KirkOrSpockInPositionToUseWire();
+ void sins5WireConnected();
+ void sins5UseStunPhaserOnComputer();
+ void sins5UseKillPhaserOnLeftComputer();
+ void sins5ReachedPositionToShootLeftComputer();
+ void sins5DrewPhaserToShootLeftComputer();
+ void sins5Timer0Expired();
+ void sins5UseKillPhaserOnMiddleComputer();
+ void sins5ReachedPositionToShootMiddleComputer();
+ void sins5DrewPhaserToShootMiddleComputer();
+ void sins5Timer1Expired();
+ void sins5UseKillPhaserOnRightComputer();
+ void sins5ReachedPositionToShootRightComputer();
+ void sins5DrewPhaserToShootRightComputer();
+ void sins5Timer2Expired();
+ void sins5ComputerLaunchesMissiles();
+ void sins5Timer3Expired();
+ void sins5LookAnywhere();
+ void sins5LookAtKirk();
+ void sins5LookAtSpock();
+ void sins5LookAtMccoy();
+ void sins5LookAtRedshirt();
+ void sins5LookAtLight();
+ void sins5LookAtLeftComputer();
+ void sins5LookAtMiddleComputer();
+ void sins5LookAtRightComputer();
+ void sins5LookAtMissile();
+ void sins5LookAtNorthDoor();
+ void sins5UseMedkitOnCrewman();
+ void sins5UseMTricorderAnywhere();
+ void sins5TalkToKirk();
+ void sins5TalkToSpock();
+ void sins5TalkToMccoy();
+ void sins5TalkToRedshirt();
+ void sins5UseSTricorderOnMissile();
+ void sins5UseSTricorderOnNorthDoor();
+ void sins5UseMTricorderOnCrewman();
public:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
@@ -2676,6 +2733,11 @@ public:
}
} trial;
+ struct {
+ byte numCrewmenInPositionForWire; // 0xca
+ byte numCrewmenReadyToBeamOut; // 0xcb
+ } sins;
+
} _roomVar;
};
diff --git a/engines/startrek/rooms/sins5.cpp b/engines/startrek/rooms/sins5.cpp
index 49f9784..f725fa6 100644
--- a/engines/startrek/rooms/sins5.cpp
+++ b/engines/startrek/rooms/sins5.cpp
@@ -22,20 +22,481 @@
#include "startrek/room.h"
-#define OBJECT_8 8
+#define OBJECT_LEFT_COMPUTER_EXPLOSION 8
+#define OBJECT_RIGHT_COMPUTER_EXPLOSION 9
+#define OBJECT_MIDDLE_COMPUTER_EXPLOSION 10
+#define OBJECT_CABLE 11
-#define HOTSPOT_20 0x20
+#define HOTSPOT_RIGHT_COMPUTER 0x20
+#define HOTSPOT_LEFT_COMPUTER 0x21
+#define HOTSPOT_MIDDLE_COMPUTER 0x22
+#define HOTSPOT_NORTH_DOOR 0x23
+#define HOTSPOT_LIGHT 0x24
+#define HOTSPOT_MISSILE_1 0x25
+#define HOTSPOT_MISSILE_2 0x26
+#define HOTSPOT_MISSILE_3 0x27
+#define HOTSPOT_MISSILE_4 0x28
namespace StarTrek {
extern const RoomAction sins5ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::sins5Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::sins5Tick1 },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::sins5UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_RIGHT_COMPUTER, 0}, &Room::sins5UseSTricorderOnRightComputer },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_LEFT_COMPUTER, 0}, &Room::sins5UseSTricorderOnLeftComputer },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MIDDLE_COMPUTER, 0}, &Room::sins5UseSTricorderOnMiddleComputer },
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_RIGHT_COMPUTER, 0}, &Room::sins5UseKirkOnRightComputer },
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_LEFT_COMPUTER, 0}, &Room::sins5UseKirkOnLeftComputer },
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_MIDDLE_COMPUTER, 0}, &Room::sins5UseKirkOnMiddleComputer },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_RIGHT_COMPUTER, 0}, &Room::sins5UseMccoyOnComputer },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_LEFT_COMPUTER, 0}, &Room::sins5UseMccoyOnComputer },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_MIDDLE_COMPUTER, 0}, &Room::sins5UseMccoyOnComputer },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_RIGHT_COMPUTER, 0}, &Room::sins5UseRedshirtOnComputer },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_LEFT_COMPUTER, 0}, &Room::sins5UseRedshirtOnComputer },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_MIDDLE_COMPUTER, 0}, &Room::sins5UseRedshirtOnComputer },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_MIDDLE_COMPUTER, 0}, &Room::sins5UseSpockOnMiddleComputer },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_RIGHT_COMPUTER, 0}, &Room::sins5UseSpockOnRightComputer },
+ { {ACTION_DONE_WALK, 11, 0, 0}, &Room::sins5SpockReachedRightComputer },
+ { {ACTION_DONE_ANIM, 13, 0, 0}, &Room::sins5SpockUsedRightComputer },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_LEFT_COMPUTER, 0}, &Room::sins5UseSpockOnLeftComputer },
+ { {ACTION_DONE_WALK, 10, 0, 0}, &Room::sins5SpockReachedLeftComputer },
+ { {ACTION_DONE_ANIM, 12, 0, 0}, &Room::sins5SpockUsedLeftComputer },
+ { {ACTION_DONE_WALK, 16, 0, 0}, &Room::sins5CrewmanReadyToBeamOut },
+
+ { {ACTION_TICK, 20, 0, 0}, &Room::sins5Tick20 },
+
+ { {ACTION_USE, OBJECT_ICONECT, HOTSPOT_LEFT_COMPUTER, 0}, &Room::sins5UseWireOnComputer },
+ { {ACTION_USE, OBJECT_ICONECT, HOTSPOT_RIGHT_COMPUTER, 0}, &Room::sins5UseWireOnComputer },
+ { {ACTION_DONE_WALK, 14, 0, 0}, &Room::sins5KirkOrSpockInPositionToUseWire },
+ { {ACTION_DONE_ANIM, 15, 0, 0}, &Room::sins5WireConnected },
+ { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_LEFT_COMPUTER, 0}, &Room::sins5UseStunPhaserOnComputer },
+ { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_MIDDLE_COMPUTER, 0}, &Room::sins5UseStunPhaserOnComputer },
+ { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_RIGHT_COMPUTER, 0}, &Room::sins5UseStunPhaserOnComputer },
+
+ { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_LEFT_COMPUTER, 0}, &Room::sins5UseKillPhaserOnLeftComputer },
+ { {ACTION_DONE_WALK, 2, 0, 0}, &Room::sins5ReachedPositionToShootLeftComputer },
+ { {ACTION_DONE_ANIM, 3, 0, 0}, &Room::sins5DrewPhaserToShootLeftComputer },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::sins5Timer0Expired },
+
+ { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_MIDDLE_COMPUTER, 0}, &Room::sins5UseKillPhaserOnMiddleComputer },
+ { {ACTION_DONE_WALK, 6, 0, 0}, &Room::sins5ReachedPositionToShootMiddleComputer },
+ { {ACTION_DONE_ANIM, 7, 0, 0}, &Room::sins5DrewPhaserToShootMiddleComputer },
+ { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::sins5Timer1Expired },
+
+ { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_RIGHT_COMPUTER, 0}, &Room::sins5UseKillPhaserOnRightComputer },
+ { {ACTION_DONE_WALK, 4, 0, 0}, &Room::sins5ReachedPositionToShootRightComputer },
+ { {ACTION_DONE_ANIM, 5, 0, 0}, &Room::sins5DrewPhaserToShootRightComputer },
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::sins5Timer2Expired },
+ { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::sins5ComputerLaunchesMissiles },
+ { {ACTION_TIMER_EXPIRED, 3, 0, 0}, &Room::sins5Timer3Expired },
+
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::sins5LookAnywhere },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::sins5LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::sins5LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::sins5LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::sins5LookAtRedshirt },
+ { {ACTION_LOOK, HOTSPOT_LIGHT, 0, 0}, &Room::sins5LookAtLight },
+ { {ACTION_LOOK, HOTSPOT_LEFT_COMPUTER, 0, 0}, &Room::sins5LookAtLeftComputer },
+ { {ACTION_LOOK, HOTSPOT_MIDDLE_COMPUTER, 0, 0}, &Room::sins5LookAtMiddleComputer },
+ { {ACTION_LOOK, HOTSPOT_RIGHT_COMPUTER, 0, 0}, &Room::sins5LookAtRightComputer },
+ { {ACTION_LOOK, HOTSPOT_MISSILE_1, 0, 0}, &Room::sins5LookAtMissile },
+ { {ACTION_LOOK, HOTSPOT_MISSILE_2, 0, 0}, &Room::sins5LookAtMissile },
+ { {ACTION_LOOK, HOTSPOT_MISSILE_3, 0, 0}, &Room::sins5LookAtMissile },
+ { {ACTION_LOOK, HOTSPOT_MISSILE_4, 0, 0}, &Room::sins5LookAtMissile },
+ { {ACTION_LOOK, HOTSPOT_NORTH_DOOR, 0, 0}, &Room::sins5LookAtNorthDoor },
+
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_KIRK, 0}, &Room::sins5UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0}, &Room::sins5UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_MCCOY, 0}, &Room::sins5UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_REDSHIRT, 0}, &Room::sins5UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::sins5UseMTricorderAnywhere },
+
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::sins5TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::sins5TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::sins5TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::sins5TalkToRedshirt },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MISSILE_1, 0}, &Room::sins5UseSTricorderOnMissile },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MISSILE_2, 0}, &Room::sins5UseSTricorderOnMissile },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MISSILE_3, 0}, &Room::sins5UseSTricorderOnMissile },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MISSILE_4, 0}, &Room::sins5UseSTricorderOnMissile },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_NORTH_DOOR, 0}, &Room::sins5UseSTricorderOnNorthDoor },
+
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::sins5UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::sins5UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::sins5UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::sins5UseMTricorderOnCrewman },
};
extern const int sins5NumActions = sizeof(sins5ActionList) / sizeof(RoomAction);
void Room::sins5Tick1() {
+ playVoc("SIN5LOOP");
+
+ if (!_awayMission->sins.enteredRoom5FirstTime)
+ _awayMission->disableInput = 2;
+
+ if (_awayMission->sins.wireConnected1 && _awayMission->sins.wireConnected2)
+ loadActorAnim2(OBJECT_CABLE, "s5cabl", 0, 0);
+
+ if (!_awayMission->sins.gotPointsForEnteringRoom5) {
+ playMidiMusicTracks(MIDITRACK_0, -1);
+ _awayMission->sins.gotPointsForEnteringRoom5 = true;
+ }
+
+ playMidiMusicTracks(MIDITRACK_27, -3);
+}
+
+void Room::sins5UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_SIN5_013);
+}
+
+void Room::sins5UseSTricorderOnRightComputer() {
+ if (!_awayMission->sins.gotPointsForScanningRightComputer) {
+ _awayMission->sins.missionScore += 1;
+ _awayMission->sins.gotPointsForScanningRightComputer = true; // BUGFIX: add this line to prevent infinite score mechanism
+ }
+ spockScan(DIR_S, TX_SIN5_030);
+ _awayMission->sins.scannedAndUsedComputers |= 2;
+ sins5CheckGatheredAllClues();
+}
+
+void Room::sins5UseSTricorderOnLeftComputer() {
+ if (!_awayMission->sins.gotPointsForScanningLeftComputer) {
+ _awayMission->sins.missionScore += 1;
+ _awayMission->sins.gotPointsForScanningLeftComputer = true; // BUGFIX: add this line to prevent infinite score mechanism
+ }
+ spockScan(DIR_S, TX_SIN5_029);
+ _awayMission->sins.scannedAndUsedComputers |= 1;
+ sins5CheckGatheredAllClues();
+}
+
+void Room::sins5UseSTricorderOnMiddleComputer() {
+ spockScan(DIR_S, TX_SIN5_028);
+}
+
+void Room::sins5UseKirkOnRightComputer() {
+ showText(TX_SPEAKER_KIRK, TX_SIN5_003);
+ sins5UseSpockOnRightComputer();
+}
+
+void Room::sins5UseKirkOnLeftComputer() {
+ showText(TX_SPEAKER_KIRK, TX_SIN5_004);
+ sins5UseSpockOnLeftComputer();
+}
+
+void Room::sins5UseKirkOnMiddleComputer() {
+ showText(TX_SPEAKER_KIRK, TX_SIN5_001);
+}
+
+void Room::sins5UseMccoyOnComputer() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN5_015);
+}
+
+void Room::sins5UseRedshirtOnComputer() {
+ showText(TX_SPEAKER_MOSHER, TX_SIN5_042);
+}
+
+void Room::sins5UseSpockOnMiddleComputer() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN5_027);
+}
+
+void Room::sins5UseSpockOnRightComputer() {
+ if (!_awayMission->sins.gotPointsForUsingRightComputer) {
+ _awayMission->sins.missionScore += 1;
+ _awayMission->sins.gotPointsForUsingRightComputer = true; // BUGFIX: add this line to prevent infinite score mechanism
+ }
+
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_SPOCK, 0xe1, 0xb3, &Room::sins5SpockReachedRightComputer);
+}
+
+void Room::sins5SpockReachedRightComputer() {
+ loadActorAnimC(OBJECT_SPOCK, "susemn", -1, -1, &Room::sins5SpockUsedRightComputer);
+}
+
+void Room::sins5SpockUsedRightComputer() {
+ _awayMission->disableInput = false;
+ showText(TX_SPEAKER_COMPUTER, TX_SIN5_039);
+ _awayMission->sins.scannedAndUsedComputers |= 8;
+ sins5CheckGatheredAllClues();
+}
+
+void Room::sins5UseSpockOnLeftComputer() {
+ if (!_awayMission->sins.gotPointsForUsingLeftComputer) {
+ _awayMission->sins.missionScore += 1;
+ _awayMission->sins.gotPointsForUsingLeftComputer = true; // BUGFIX: add this line to prevent infinite score mechanism
+ }
+
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_SPOCK, 0x40, 0xb3, &Room::sins5SpockReachedLeftComputer);
+}
+
+void Room::sins5SpockReachedLeftComputer() {
+ loadActorAnimC(OBJECT_SPOCK, "susemn", -1, -1, &Room::sins5SpockUsedLeftComputer);
+}
+
+void Room::sins5SpockUsedLeftComputer() {
+ if (_awayMission->sins.wireConnected1 && _awayMission->sins.wireConnected2) {
+ showText(TX_SPEAKER_COMPUTER, TX_SIN5_041);
+ showText(TX_SPEAKER_SPOCK, TX_SIN5_025);
+
+ walkCrewmanC(OBJECT_KIRK, 0x8c, 0xb5, &Room::sins5CrewmanReadyToBeamOut);
+ walkCrewmanC(OBJECT_SPOCK, 0x82, 0xab, &Room::sins5CrewmanReadyToBeamOut);
+ walkCrewmanC(OBJECT_MCCOY, 0x96, 0xab, &Room::sins5CrewmanReadyToBeamOut);
+ walkCrewmanC(OBJECT_REDSHIRT, 0x91, 0xa1, &Room::sins5CrewmanReadyToBeamOut);
+ } else {
+ _awayMission->disableInput = false;
+ showText(TX_SPEAKER_COMPUTER, TX_SIN5_040);
+ _awayMission->sins.scannedAndUsedComputers |= 4;
+ sins5CheckGatheredAllClues();
+ }
+}
+
+void Room::sins5CrewmanReadyToBeamOut() {
+ if (++_roomVar.sins.numCrewmenReadyToBeamOut == 4) {
+ showText(TX_SPEAKER_KIRK, TX_SIN5_008);
+ showText(TX_SPEAKER_SCOTT, TX_SIN5_S19);
+ showText(TX_SPEAKER_KIRK, TX_SIN5_005);
+ _awayMission->sins.missionScore += 19;
+ endMission(_awayMission->sins.missionScore, 28, 0);
+ }
+}
+
+void Room::sins5Tick20() {
+ if (!_awayMission->sins.enteredRoom5FirstTime) {
+ _awayMission->disableInput = false;
+ showText(TX_SPEAKER_SPOCK, TX_SIN5_026);
+ _awayMission->sins.enteredRoom5FirstTime = true;
+ }
+}
+
+// Checks whether both computers have been scanned and interacted with
+void Room::sins5CheckGatheredAllClues() {
+ if (_awayMission->sins.scannedAndUsedComputers == 0xf && !_awayMission->sins.discoveredComputersOutOfSync) {
+ _awayMission->sins.discoveredComputersOutOfSync = true;
+ showText(TX_SPEAKER_MOSHER, TX_SIN5_044);
+ showText(TX_SPEAKER_SPOCK, TX_SIN5_036);
+ showText(TX_SPEAKER_MCCOY, TX_SIN5_020);
+ showText(TX_SPEAKER_SPOCK, TX_SIN5_035);
+ showText(TX_SPEAKER_KIRK, TX_SIN5_006);
+ showText(TX_SPEAKER_SPOCK, TX_SIN5_037);
+ showText(TX_SPEAKER_MCCOY, TX_SIN5_021);
+ showText(TX_SPEAKER_SPOCK, TX_SIN5_032);
+ showText(TX_SPEAKER_KIRK, TX_SIN5_007);
+ }
+}
+
+void Room::sins5UseWireOnComputer() {
+ walkCrewmanC(OBJECT_SPOCK, 0x60, 0xab, &Room::sins5KirkOrSpockInPositionToUseWire);
+ walkCrewmanC(OBJECT_KIRK, 0xbc, 0xab, &Room::sins5KirkOrSpockInPositionToUseWire);
+ _awayMission->disableInput = true;
+}
+
+void Room::sins5KirkOrSpockInPositionToUseWire() {
+ if (++_roomVar.sins.numCrewmenInPositionForWire == 2) {
+ loadActorAnimC(OBJECT_SPOCK, "suselw", -1, -1, &Room::sins5WireConnected);
+ loadActorAnim2(OBJECT_KIRK, "kusele");
+ }
+}
+
+void Room::sins5WireConnected() {
+ if (!_awayMission->sins.wireConnected1) {
+ _awayMission->sins.wireConnected1 = true;
+ _awayMission->sins.wireConnected2 = true;
+ loadActorAnim2(OBJECT_CABLE, "s5cabl", 0, 0);
+ showText(TX_SIN5N004);
+ loseItem(OBJECT_ICONECT);
+ playMidiMusicTracks(MIDITRACK_30, -1);
+ }
+ _awayMission->disableInput = false;
+}
+
+void Room::sins5UseStunPhaserOnComputer() {
+ showText(TX_SPEAKER_MOSHER, TX_SIN5_043);
+}
+
+
+void Room::sins5UseKillPhaserOnLeftComputer() {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x84, 0xbc, &Room::sins5ReachedPositionToShootLeftComputer);
+}
+
+void Room::sins5ReachedPositionToShootLeftComputer() {
+ loadActorAnimC(OBJECT_KIRK, "kdraww", -1, -1, &Room::sins5DrewPhaserToShootLeftComputer);
+}
+
+void Room::sins5DrewPhaserToShootLeftComputer() {
+ loadActorAnimC(OBJECT_LEFT_COMPUTER_EXPLOSION, "s5phal", 0, 0xaf, &Room::sins5ComputerLaunchesMissiles);
+ playSoundEffectIndex(SND_PHASSHOT);
+ _awayMission->timers[3] = 10;
+ _awayMission->timers[0] = 24;
+}
+
+void Room::sins5Timer0Expired() {
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ loadActorStandAnim(OBJECT_KIRK);
+ _awayMission->disableInput = false;
+}
+
+
+void Room::sins5UseKillPhaserOnMiddleComputer() {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x8b, 0xbc, &Room::sins5ReachedPositionToShootMiddleComputer);
+}
+
+void Room::sins5ReachedPositionToShootMiddleComputer() {
+ loadActorAnimC(OBJECT_KIRK, "kfiren", -1, -1, &Room::sins5DrewPhaserToShootMiddleComputer);
+}
+
+void Room::sins5DrewPhaserToShootMiddleComputer() {
+ loadActorAnimC(OBJECT_MIDDLE_COMPUTER_EXPLOSION, "s5phac", 0, 0x8c, &Room::sins5ComputerLaunchesMissiles);
+ playSoundEffectIndex(SND_PHASSHOT);
+ _awayMission->timers[3] = 10;
+ _awayMission->timers[1] = 24;
+}
+
+void Room::sins5Timer1Expired() {
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ loadActorStandAnim(OBJECT_KIRK);
+ _awayMission->disableInput = false;
+}
+
+
+void Room::sins5UseKillPhaserOnRightComputer() {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x9e, 0xbc, &Room::sins5ReachedPositionToShootRightComputer);
+}
+
+void Room::sins5ReachedPositionToShootRightComputer() {
+ loadActorAnimC(OBJECT_KIRK, "kdrawe", -1, -1, &Room::sins5DrewPhaserToShootRightComputer);
+}
+
+void Room::sins5DrewPhaserToShootRightComputer() {
+ loadActorAnimC(OBJECT_RIGHT_COMPUTER_EXPLOSION, "s5phar", 0, 0xaf, &Room::sins5ComputerLaunchesMissiles);
+ playSoundEffectIndex(SND_PHASSHOT);
+ _awayMission->timers[3] = 10;
+ _awayMission->timers[2] = 24;
+}
+
+void Room::sins5Timer2Expired() {
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ loadActorStandAnim(OBJECT_KIRK);
+ _awayMission->disableInput = false;
+}
+
+void Room::sins5ComputerLaunchesMissiles() {
+ playMidiMusicTracks(MIDITRACK_2, -1);
+ showText(TX_SIN5N012);
+ showText(TX_SIN5N013);
+ showGameOverMenu();
+}
+
+void Room::sins5Timer3Expired() {
+ playSoundEffectIndex(SND_BLANK_14);
+}
+
+void Room::sins5LookAnywhere() {
+ showText(TX_SIN5N005);
+}
+
+void Room::sins5LookAtKirk() {
+ showText(TX_SIN5N000);
+}
+
+void Room::sins5LookAtSpock() {
+ showText(TX_SIN5N006);
+}
+
+void Room::sins5LookAtMccoy() {
+ showText(TX_SIN5N001);
+}
+
+void Room::sins5LookAtRedshirt() {
+ showText(TX_SIN5N002);
+}
+
+void Room::sins5LookAtLight() {
+ showText(TX_SIN5N007);
+}
+
+void Room::sins5LookAtLeftComputer() {
+ showText(TX_SIN5N010);
+}
+
+void Room::sins5LookAtMiddleComputer() {
+ showText(TX_SIN5N008);
+}
+
+void Room::sins5LookAtRightComputer() {
+ showText(TX_SIN5N009);
+}
+
+void Room::sins5LookAtMissile() {
+ showText(TX_SIN5N003);
+}
+
+void Room::sins5LookAtNorthDoor() {
+ showText(TX_SIN5N011);
+}
+
+void Room::sins5UseMedkitOnCrewman() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN5_017);
+}
+
+void Room::sins5UseMTricorderAnywhere() {
+ mccoyScan(DIR_S, TX_SIN5_016);
+ if (!_awayMission->sins.gotPointsForScanningRoom5) {
+ _awayMission->sins.missionScore += 1;
+ _awayMission->sins.gotPointsForScanningRoom5 = true; // BUGFIX: add this line to prevent infinite score mechanism
+ }
+}
+
+void Room::sins5TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_SIN5_002);
+}
+
+void Room::sins5TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN5_038);
+ showText(TX_SPEAKER_MCCOY, TX_SIN5_023);
+ showText(TX_SPEAKER_SPOCK, TX_SIN5_033);
+ showText(TX_SPEAKER_MCCOY, TX_SIN5_019);
+}
+
+void Room::sins5TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN5_018);
+ showText(TX_SPEAKER_KIRK, TX_SIN5_010);
+
+ // The following code block is unused. It doesn't belong to any function, but would
+ // fit best as an alternative to this one.
+ if (false) {
+ showText(TX_SPEAKER_MCCOY, TX_SIN5_022);
+ showText(TX_SPEAKER_SPOCK, TX_SIN5_031);
+ showText(TX_SPEAKER_KIRK, TX_SIN5_009);
+ }
+}
+
+void Room::sins5TalkToRedshirt() {
+ showText(TX_SPEAKER_MOSHER, TX_SIN5_046);
+ showText(TX_SPEAKER_SPOCK, TX_SIN5_034);
+ showText(TX_SPEAKER_MOSHER, TX_SIN5_045);
+ showText(TX_SPEAKER_KIRK, TX_SIN5_011);
+}
+
+void Room::sins5UseSTricorderOnMissile() {
+ spockScan(DIR_S, TX_SIN5_012);
+}
+
+void Room::sins5UseSTricorderOnNorthDoor() {
+ spockScan(DIR_S, TX_SIN5_024);
+}
+
+void Room::sins5UseMTricorderOnCrewman() {
+ mccoyScan(DIR_S, TX_SIN5_014);
}
}
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 0f3b3e6..fc188b2 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -2602,6 +2602,69 @@ extern const char *const g_gameStrings[] = {
"#SIN4\\SIN4U83B#Captain, we'll help you all we can.",
+ "#SIN5\\SIN5_001#Hmmmm... This computer doesn't have a keyboard.",
+ "#SIN5\\SIN5_002#I don't have anything to say right now, Bones.",
+ "#SIN5\\SIN5_003#Mr. Spock, why don't you take a look at those computers.",
+ "#SIN5\\SIN5_004#Mr. Spock, why don't you take a look at those computers.",
+ "#SIN5\\SIN5_005#Bring us home.",
+ "#SIN5\\SIN5_006#Can you reprogram the Lucrs computer to give us that time, Mr. Spock?",
+ "#SIN5\\SIN5_007#If we could only bridge them...",
+ "#SIN5\\SIN5_008#Kirk to Enterprise. how are the transporters, Scotty?",
+ "#SIN5\\SIN5_009#Let's just find a way to stop this from happening again.",
+ "#SIN5\\SIN5_010#Sometimes it's useful to confront the dark side of our nature, that which we might become.",
+ "#SIN5\\SIN5_011#Well, gentlemen. Here's one fire we can put out. Let's go to work.",
+ "#SIN5\\SIN5_012#A crude Uranium 235 nuclear device with Lithium - Beryllium shells to increase heavy particle fallout.",
+ "#SIN5\\SIN5_013#All three of the computers in this room are fully operational.",
+ "#SIN5\\SIN5_014#All readings are normal. The structure seems to be protecting us from the cosmic rays.",
+ "#SIN5\\SIN5_015#Jim, I don't know anything about these things! Why don't you ask your science officer.",
+ "#SIN5\\SIN5_016#Thank goodness. I was worried that there might be a radiation leak, but there's no sign of any.",
+ "#SIN5\\SIN5_017#We're safe from the cosmic radiation, Jim.",
+ "#SIN5\\SIN5_018#I wish I hadn't seen any of this.",
+ "#SIN5\\SIN5_019#There's nothing constructive about this place, Spock! It's an obscenity!",
+ "#SIN5\\SIN5_020#They report different optimum launch times. Which is right?",
+ "#SIN5\\SIN5_021#Too bad old Omega here couldn't just take a sick day and miss the firing.",
+ "#SIN5\\SIN5_022#Unbelievable, isn't it? Putting this much time and effort into building devices to kill people.",
+ "#SIN5\\SIN5_023#Who needs efficiency, when the end of the world is everywhere around here!",
+ "#SIN5\\SIN5_024#Readings indicate an extremely high radiation level beyond those doors. It would be fatal to proceed beyond them.",
+ "#SIN5\\SIN5_025#The launched missiles will run out of fuel before they reach Proxtrey. They will drift into the sun and burn up.",
+ "#SIN5\\SIN5_026#This appears to be the brain of Scythe. There are two identical but isolated computers that communicate with a third which controls the launch of missiles.",
+ "#SIN5\\SIN5_027#This computer cannot be accessed directly. It is controlled by the other two computers.",
+ "#SIN5\\SIN5_028#This computer directly controls the missile launch system. There is no way to interface with it directly, but the other two computers are accessible.",
+ "#SIN5\\SIN5_029#This computer is functional and performing an average .75 million operations per second.",
+ "#SIN5\\SIN5_030#This computer is functional and performing an average 1.2 million operations per second.",
+ "#SIN5\\SIN5_031#A great waste, doctor. A technologically advanced society, an advanced culture...",
+ "#SIN5\\SIN5_032#Because the two machines are isolated, the virus did not spread from one to the other.",
+ "#SIN5\\SIN5_033#Curb your emotions, doctor. They serve no constructive purpose here. ",
+ "#SIN5\\SIN5_034#For people with emotions, Ensign, there are many things that can cause hatreds. And each new hatred breeds more hatred, and makes the path of peace harder to find.",
+ "#SIN5\\SIN5_035#Given the elliptical orbit and the range at which they will pass Proxtrey, the Omega unit is correct, but the window is very narrow. A variation of minutes will mean the missiles run out of fuel and fall harmlessly into the sun.",
+ "#SIN5\\SIN5_036#It appears they are out of sync, Captain. I have to assume the Alpha Unit has a virus which is using up an incredible amount of computing time.",
+ "#SIN5\\SIN5_037#Reprogramming an old Alien computer is not simple, Captain. The odds against success are 10221 to 1 against.",
+ "#SIN5\\SIN5_038#These warheads are not a very efficient delivery system, Captain.",
+ "#SIN5\\SIN5_039#Welcome to Scythe Operations Center, Alpha Unit. Estimated time to optimal launch range is 3.21 hours adjusted.",
+ "#SIN5\\SIN5_040#Welcome to Scythe Operations Center, Omega Unit. Estimated time to optimal launch range is 1.31 hours adjusted.",
+ "#SIN5\\SIN5_041#Welcome to Scythe Operations Center, Omega Unit. Estimated time to optimal launch range is 1.54 hours adjusted.",
+ "#SIN5\\SIN5_042#Sir, I don't think I'm qualified for that assignment. Mr. Spock would be a better choice, I think.",
+ "#SIN5\\SIN5_043#The stun setting won't work, Sir!",
+ "#SIN5\\SIN5_044#Captain, something is wrong with the computers. They may be twins, but they are not identical.",
+ "#SIN5\\SIN5_045#It's easy to say when you're not involved personally, Mr. Spock. But when people have treated you like a second class being because you are different, hate can become the only thing they can't take away from you. That is what started most of the firestorms of history.",
+ "#SIN5\\SIN5_046#No intruders, Captain. I think everyone died a long, long time ago. I wonder what caused it.",
+ "#SIN5\\SIN5_S19#They're operational again, Captain. We're ready to bring you back at any time.",
+ "#SIN5\\SIN5N000#Captain James T. Kirk, fingering his communicator, wonders if anything else is happening aboard his ship.",
+ "#SIN5\\SIN5N001#Dr. McCoy takes several deep sighs and closes his eyes.",
+ "#SIN5\\SIN5N002#Ensign Mosher awaits orders.",
+ "#SIN5\\SIN5N003#Missiles of death and destruction. The Lucr believed that you could never have enough of them.",
+ "#SIN5\\SIN5N004#The connector snaps into place.",
+ "#SIN5\\SIN5N005#The control center for the base. Computers and nuclear missiles fill the room.",
+ "#SIN5\\SIN5N006#These instruments of war make Spock uncomfortable, but he says nothing.",
+ "#SIN5\\SIN5N007#These lights are still operational after centuries.",
+ "#SIN5\\SIN5N008#This computer controls the launch of missiles. It is directly controlled by the other computers.",
+ "#SIN5\\SIN5N009#This computer is marked with the first letter of the Lucr alphabet.",
+ "#SIN5\\SIN5N010#This computer is marked with the last letter of the Lucr alphabet.",
+ "#SIN5\\SIN5N011#This door is marked with a radiation hazard symbol.",
+ "#SIN5\\SIN5N012#Computer consoles do not take well to phasering. Sparks explode and, in a defensive maneuver prompted by this attack from within, the base launches a full spread of nuclear missiles at the Enterprise.",
+ "#SIN5\\SIN5N013#History will not be kind to you. Better luck next time.",
+
+
"#VENA\\VENA_F41#Kirk out.",
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index e56327a..fd36114 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -2707,6 +2707,69 @@ enum GameStringIDs {
TX_SIN4U83B,
+ TX_SIN5_001,
+ TX_SIN5_002,
+ TX_SIN5_003,
+ TX_SIN5_004,
+ TX_SIN5_005,
+ TX_SIN5_006,
+ TX_SIN5_007,
+ TX_SIN5_008,
+ TX_SIN5_009,
+ TX_SIN5_010,
+ TX_SIN5_011,
+ TX_SIN5_012,
+ TX_SIN5_013,
+ TX_SIN5_014,
+ TX_SIN5_015,
+ TX_SIN5_016,
+ TX_SIN5_017,
+ TX_SIN5_018,
+ TX_SIN5_019,
+ TX_SIN5_020,
+ TX_SIN5_021,
+ TX_SIN5_022,
+ TX_SIN5_023,
+ TX_SIN5_024,
+ TX_SIN5_025,
+ TX_SIN5_026,
+ TX_SIN5_027,
+ TX_SIN5_028,
+ TX_SIN5_029,
+ TX_SIN5_030,
+ TX_SIN5_031,
+ TX_SIN5_032,
+ TX_SIN5_033,
+ TX_SIN5_034,
+ TX_SIN5_035,
+ TX_SIN5_036,
+ TX_SIN5_037,
+ TX_SIN5_038,
+ TX_SIN5_039,
+ TX_SIN5_040,
+ TX_SIN5_041,
+ TX_SIN5_042,
+ TX_SIN5_043,
+ TX_SIN5_044,
+ TX_SIN5_045,
+ TX_SIN5_046,
+ TX_SIN5_S19,
+ TX_SIN5N000,
+ TX_SIN5N001,
+ TX_SIN5N002,
+ TX_SIN5N003,
+ TX_SIN5N004,
+ TX_SIN5N005,
+ TX_SIN5N006,
+ TX_SIN5N007,
+ TX_SIN5N008,
+ TX_SIN5N009,
+ TX_SIN5N010,
+ TX_SIN5N011,
+ TX_SIN5N012,
+ TX_SIN5N013,
+
+
TX_VENA_F41,
Commit: 1599e57dfea7e819f53758a93440f7dd13f1f73c
https://github.com/scummvm/scummvm/commit/1599e57dfea7e819f53758a93440f7dd13f1f73c
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: SINS5 text changes
Changed paths:
engines/startrek/text.cpp
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index fc188b2..02c3c7a 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -2617,7 +2617,7 @@ extern const char *const g_gameStrings[] = {
"#SIN5\\SIN5_013#All three of the computers in this room are fully operational.",
"#SIN5\\SIN5_014#All readings are normal. The structure seems to be protecting us from the cosmic rays.",
"#SIN5\\SIN5_015#Jim, I don't know anything about these things! Why don't you ask your science officer.",
- "#SIN5\\SIN5_016#Thank goodness. I was worried that there might be a radiation leak, but there's no sign of any.",
+ "#SIN5\\SIN5_016#Thank goodness. I was worried there might be a radiation leak, but there's no sign of any.", // TYPO
"#SIN5\\SIN5_017#We're safe from the cosmic radiation, Jim.",
"#SIN5\\SIN5_018#I wish I hadn't seen any of this.",
"#SIN5\\SIN5_019#There's nothing constructive about this place, Spock! It's an obscenity!",
@@ -2661,7 +2661,7 @@ extern const char *const g_gameStrings[] = {
"#SIN5\\SIN5N009#This computer is marked with the first letter of the Lucr alphabet.",
"#SIN5\\SIN5N010#This computer is marked with the last letter of the Lucr alphabet.",
"#SIN5\\SIN5N011#This door is marked with a radiation hazard symbol.",
- "#SIN5\\SIN5N012#Computer consoles do not take well to phasering. Sparks explode and, in a defensive maneuver prompted by this attack from within, the base launches a full spread of nuclear missiles at the Enterprise.",
+ "#SIN5\\SIN5N012#Computer consoles do not take well to phasering. Sparks fly and, in a defensive maneuver prompted by this attack from within, the base launches a full spread of nuclear missiles at the Enterprise.", // TYPO
"#SIN5\\SIN5N013#History will not be kind to you. Better luck next time.",
Commit: 359b0c23075e216df581a0b89ebba9d3ef4251c9
https://github.com/scummvm/scummvm/commit/359b0c23075e216df581a0b89ebba9d3ef4251c9
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Add german floppy version to detection
Changed paths:
engines/startrek/detection.cpp
diff --git a/engines/startrek/detection.cpp b/engines/startrek/detection.cpp
index 88488a6..287c54b 100644
--- a/engines/startrek/detection.cpp
+++ b/engines/startrek/detection.cpp
@@ -110,6 +110,21 @@ static const StarTrekGameDescription gameDescriptions[] = {
false,
},
+ { // ST25 DOS floppy edition (GER)
+ {
+ "st25",
+ "Floppy",
+ AD_ENTRY1s("data.001", "57040928a0f374281aa86ba4e7db8444", 7181890),
+ Common::DE_DEU,
+ Common::kPlatformDOS,
+ ADGF_NO_FLAGS,
+ GUIO0()
+ },
+ GType_ST25,
+ 0,
+ false,
+ },
+
{ // ST25 Amiga ? (EN)
{
"st25",
Commit: f33f548884db84bfebea1a4edc049959607b000b
https://github.com/scummvm/scummvm/commit/f33f548884db84bfebea1a4edc049959607b000b
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Saving/loading for SINS mission
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/saveload.cpp
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 0c6f338..5771b31 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -580,6 +580,43 @@ struct AwayMission {
bool enteredRoom1FirstTime; // 0x50
bool gotPointsForEnteringRoom5; // 0x51
int16 missionScore; // 0x52
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ ser.syncAsByte(field31);
+ ser.syncAsByte(field32);
+ ser.syncAsByte(field33);
+ ser.syncAsByte(doorLaserFiredOnce);
+ ser.syncAsByte(gotPointsForAccessingTerminal);
+ ser.syncAsByte(scannedKeycardLock);
+ ser.syncAsByte(laserSetting);
+ ser.syncAsByte(laserPattern);
+ ser.syncAsByte(gatheredClues);
+ ser.syncAsByte(scannedAndUsedComputers);
+ ser.syncAsByte(wireConnected1);
+ ser.syncAsByte(wireConnected2);
+ ser.syncAsByte(openedOuterDoor);
+ ser.syncAsByte(openedInnerDoor);
+ ser.syncAsByte(unlockedIDCardDoor);
+ ser.syncAsByte(moldState);
+ ser.syncAsByte(boxState);
+ ser.syncAsByte(enteredRoom0FirstTime);
+ ser.syncAsByte(scottyInformedKirkAboutVirus);
+ ser.syncAsByte(enteredRoom2FirstTime);
+ ser.syncAsByte(enteredRoom3FirstTime);
+ ser.syncAsByte(enteredRoom4FirstTime);
+ ser.syncAsByte(enteredRoom5FirstTime);
+ ser.syncAsByte(gotPointsForScanningStatue);
+ ser.syncAsByte(gotPointsForScanningRoom4);
+ ser.syncAsByte(gotPointsForScanningRoom5);
+ ser.syncAsByte(gotPointsForScanningRightComputer);
+ ser.syncAsByte(gotPointsForScanningLeftComputer);
+ ser.syncAsByte(gotPointsForUsingRightComputer);
+ ser.syncAsByte(gotPointsForUsingLeftComputer);
+ ser.syncAsByte(discoveredComputersOutOfSync);
+ ser.syncAsByte(enteredRoom1FirstTime);
+ ser.syncAsByte(gotPointsForEnteringRoom5);
+ ser.syncAsSint16LE(missionScore);
+ }
} sins;
};
};
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 8781dfa..20615bd 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2734,8 +2734,14 @@ public:
} trial;
struct {
+ // sins5
byte numCrewmenInPositionForWire; // 0xca
byte numCrewmenReadyToBeamOut; // 0xcb
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ ser.syncAsByte(numCrewmenInPositionForWire);
+ ser.syncAsByte(numCrewmenReadyToBeamOut);
+ }
} sins;
} _roomVar;
diff --git a/engines/startrek/saveload.cpp b/engines/startrek/saveload.cpp
index e7a288c..d5d265a 100644
--- a/engines/startrek/saveload.cpp
+++ b/engines/startrek/saveload.cpp
@@ -325,6 +325,9 @@ bool StarTrekEngine::saveOrLoadGameData(Common::SeekableReadStream *in, Common::
} else if (_missionName == "TRIAL") {
_awayMission.trial.saveLoadWithSerializer(ser);
_room->_roomVar.trial.saveLoadWithSerializer(ser);
+ } else if (_missionName == "SINS") {
+ _awayMission.sins.saveLoadWithSerializer(ser);
+ _room->_roomVar.sins.saveLoadWithSerializer(ser);
}
// The action queue
Commit: 91c8320bd96642fc7afe2671c66da285fa996c9c
https://github.com/scummvm/scummvm/commit/91c8320bd96642fc7afe2671c66da285fa996c9c
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Rename SINS5 variable
Changed paths:
engines/startrek/awaymission.h
engines/startrek/rooms/sins5.cpp
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 5771b31..69c055b 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -578,7 +578,7 @@ struct AwayMission {
bool gotPointsForUsingLeftComputer; // 0x4e
bool discoveredComputersOutOfSync; // 0x4f
bool enteredRoom1FirstTime; // 0x50
- bool gotPointsForEnteringRoom5; // 0x51
+ bool playedMusicUponEnteringRoom5FirstTime; // 0x51
int16 missionScore; // 0x52
void saveLoadWithSerializer(Common::Serializer &ser) {
@@ -614,7 +614,7 @@ struct AwayMission {
ser.syncAsByte(gotPointsForUsingLeftComputer);
ser.syncAsByte(discoveredComputersOutOfSync);
ser.syncAsByte(enteredRoom1FirstTime);
- ser.syncAsByte(gotPointsForEnteringRoom5);
+ ser.syncAsByte(playedMusicUponEnteringRoom5FirstTime);
ser.syncAsSint16LE(missionScore);
}
} sins;
diff --git a/engines/startrek/rooms/sins5.cpp b/engines/startrek/rooms/sins5.cpp
index f725fa6..525e6c1 100644
--- a/engines/startrek/rooms/sins5.cpp
+++ b/engines/startrek/rooms/sins5.cpp
@@ -141,9 +141,11 @@ void Room::sins5Tick1() {
if (_awayMission->sins.wireConnected1 && _awayMission->sins.wireConnected2)
loadActorAnim2(OBJECT_CABLE, "s5cabl", 0, 0);
- if (!_awayMission->sins.gotPointsForEnteringRoom5) {
+ if (!_awayMission->sins.playedMusicUponEnteringRoom5FirstTime) {
+ // NOTE: The music gets drowned out due to a different track being played
+ // immediately after.
playMidiMusicTracks(MIDITRACK_0, -1);
- _awayMission->sins.gotPointsForEnteringRoom5 = true;
+ _awayMission->sins.playedMusicUponEnteringRoom5FirstTime = true;
}
playMidiMusicTracks(MIDITRACK_27, -3);
Commit: 57691c4276c065b5810a86a2d38697a1c0f7abcb
https://github.com/scummvm/scummvm/commit/57691c4276c065b5810a86a2d38697a1c0f7abcb
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Add missing license headers
Changed paths:
engines/startrek/bitmap.h
engines/startrek/filestream.cpp
diff --git a/engines/startrek/bitmap.h b/engines/startrek/bitmap.h
index 53edb09..746562d 100644
--- a/engines/startrek/bitmap.h
+++ b/engines/startrek/bitmap.h
@@ -1,3 +1,25 @@
+/* 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.
+ *
+ */
+
#ifndef STARTREK_BITMAP_H
#define STARTREK_BITMAP_H
diff --git a/engines/startrek/filestream.cpp b/engines/startrek/filestream.cpp
index f90387c..1cb83f5 100644
--- a/engines/startrek/filestream.cpp
+++ b/engines/startrek/filestream.cpp
@@ -1,3 +1,25 @@
+/* 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 "startrek/filestream.h"
namespace StarTrek {
Commit: c6834a997c93ab8c9cee0bf39204a716383c29bf
https://github.com/scummvm/scummvm/commit/c6834a997c93ab8c9cee0bf39204a716383c29bf
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Put CD ROM detection into features field
Changed paths:
engines/startrek/detection.cpp
engines/startrek/sound.cpp
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/detection.cpp b/engines/startrek/detection.cpp
index 287c54b..47ddcf0 100644
--- a/engines/startrek/detection.cpp
+++ b/engines/startrek/detection.cpp
@@ -42,7 +42,6 @@ struct StarTrekGameDescription {
uint8 gameType;
uint32 features;
- bool isCDEdition;
};
uint32 StarTrekEngine::getFeatures() const {
@@ -53,10 +52,6 @@ Common::Platform StarTrekEngine::getPlatform() const {
return _gameDescription->desc.platform;
}
-bool StarTrekEngine::isCDEdition() const {
- return _gameDescription->isCDEdition;
-}
-
uint8 StarTrekEngine::getGameType() const {
return _gameDescription->gameType;
}
@@ -91,8 +86,7 @@ static const StarTrekGameDescription gameDescriptions[] = {
GUIO0()
},
GType_ST25,
- 0,
- true,
+ GF_CDROM,
},
{ // ST25 DOS floppy edition (EN)
@@ -107,7 +101,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
- false,
},
{ // ST25 DOS floppy edition (GER)
@@ -122,7 +115,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
- false,
},
{ // ST25 Amiga ? (EN)
@@ -137,7 +129,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
- false,
},
{ // ST25 Amiga ? (GER)
@@ -152,7 +143,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
- false,
},
{ // ST25 Amiga ? (FR)
@@ -167,7 +157,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
- false,
},
{ // ST25 Mac ? (EN)
@@ -182,7 +171,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
- false,
},
{ // ST25 Mac floppy edition (EN)
@@ -197,7 +185,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
- false,
},
{ // ST25 DOS demo ? (EN)
@@ -212,7 +199,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
GF_DEMO,
- false,
},
{ // ST25 MAC demo ? (EN)
@@ -227,7 +213,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
GF_DEMO,
- false,
},
{ // STJR DOS CD-ROM edition (EN)
@@ -241,11 +226,10 @@ static const StarTrekGameDescription gameDescriptions[] = {
GUIO0()
},
GType_STJR,
- 0,
- true,
+ GF_CDROM,
},
- { AD_TABLE_END_MARKER, 0, 0, 0 }
+ { AD_TABLE_END_MARKER, 0, 0 }
};
} // End of namespace StarTrek
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 2c4abff..4696759 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -63,7 +63,7 @@ Sound::Sound(StarTrekEngine *vm) : _vm(vm) {
_midiSlotList.push_back(&_midiSlots[i]);
}
- if (!_vm->isCDEdition())
+ if (!(_vm->getFeatures() & GF_CDROM))
_vm->_sfxWorking = false;
else if (!SearchMan.hasFile("voc/speech.mrk")) {
warning("Couldn't find 'voc/speech.mrk'. The 'trekcd/voc/' directory should be dumped from the CD. Continuing without CD audio");
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index c201e3f..b696074 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -529,7 +529,7 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
}
void StarTrekEngine::playSoundEffectIndex(int index) {
- if (!isCDEdition())
+ if (!(getFeatures() & GF_CDROM))
_sound->playMidiTrack(index);
else {
switch (index) {
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index c1f2cf6..2fcf6a2 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -121,7 +121,8 @@ enum StarTrekGameType {
};
enum StarTrekGameFeatures {
- GF_DEMO = (1 << 0)
+ GF_DEMO = (1 << 0),
+ GF_CDROM = (1 << 1)
};
enum kDebugLevels {
@@ -639,7 +640,6 @@ public:
public:
const StarTrekGameDescription *_gameDescription;
uint32 getFeatures() const;
- bool isCDEdition() const;
Common::Platform getPlatform() const;
uint8 getGameType() const;
Common::Language getLanguage() const;
Commit: c8335cccd3295281362b8a5f2a755fa0965d473d
https://github.com/scummvm/scummvm/commit/c8335cccd3295281362b8a5f2a755fa0965d473d
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Fix memory leak in graphics.cpp
Changed paths:
engines/startrek/graphics.cpp
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 8a67c5b..53bdf38 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -67,6 +67,8 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
Graphics::~Graphics() {
delete[] _egaData;
+ delete[] _palData;
+ delete[] _lutData;
delete _font;
}
@@ -711,10 +713,7 @@ void Graphics::copyBackgroundScreen() {
}
void Graphics::drawDirectToScreen(SharedPtr<Bitmap> bitmap) {
- int xoffset = bitmap->xoffset;
- int yoffset = bitmap->yoffset;
-
- _vm->_system->copyRectToScreen(bitmap->pixels, bitmap->width, xoffset, yoffset, bitmap->width, bitmap->height);
+ _vm->_system->copyRectToScreen(bitmap->pixels, bitmap->width, bitmap->xoffset, bitmap->yoffset, bitmap->width, bitmap->height);
}
Commit: ce42cd940a8fd3706aebc9ba79de6823939ab53b
https://github.com/scummvm/scummvm/commit/ce42cd940a8fd3706aebc9ba79de6823939ab53b
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Use ARRAYSIZE macro
Changed paths:
engines/startrek/detection.cpp
engines/startrek/items.h
engines/startrek/room.cpp
engines/startrek/rooms/feather1.cpp
engines/startrek/rooms/feather2.cpp
engines/startrek/rooms/feather3.cpp
engines/startrek/rooms/feather4.cpp
engines/startrek/rooms/feather5.cpp
engines/startrek/rooms/feather6.cpp
engines/startrek/rooms/feather7.cpp
engines/startrek/rooms/sins0.cpp
engines/startrek/rooms/sins1.cpp
engines/startrek/rooms/sins2.cpp
engines/startrek/rooms/sins3.cpp
engines/startrek/rooms/sins4.cpp
engines/startrek/rooms/sins5.cpp
engines/startrek/rooms/trial0.cpp
engines/startrek/rooms/trial1.cpp
engines/startrek/rooms/trial2.cpp
engines/startrek/rooms/trial3.cpp
engines/startrek/rooms/trial4.cpp
engines/startrek/rooms/trial5.cpp
diff --git a/engines/startrek/detection.cpp b/engines/startrek/detection.cpp
index 47ddcf0..92c90a1 100644
--- a/engines/startrek/detection.cpp
+++ b/engines/startrek/detection.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/detection.cpp $
- * $Id: detection.cpp 15 2010-06-27 06:13:42Z clone2727 $
- *
*/
#include "base/plugins.h"
diff --git a/engines/startrek/items.h b/engines/startrek/items.h
index 1d930e7..d45f601 100644
--- a/engines/startrek/items.h
+++ b/engines/startrek/items.h
@@ -253,7 +253,7 @@ const Item g_itemList[] = {
{ false, 0x00, "", 0x00 }
};
-const int NUM_ITEMS = sizeof(g_itemList) / sizeof(struct Item) - 64; // 0x49
+const int NUM_ITEMS = ARRAYSIZE(g_itemList) - 64; // 0x49
} // End of namespace StarTrek
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 3be0783..7e5c50f 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -32,7 +32,7 @@
#define ADD_ROOM_OLD(ROOM) {\
if (name.equalsIgnoreCase(#ROOM)) {\
_roomActionList = ROOM##ActionList;\
- _numRoomActions = sizeof(ROOM##ActionList) / sizeof(RoomAction);\
+ _numRoomActions = ARRAYSIZE(ROOM##ActionList);\
}\
}
diff --git a/engines/startrek/rooms/feather1.cpp b/engines/startrek/rooms/feather1.cpp
index 1621eca..f01bcd2 100644
--- a/engines/startrek/rooms/feather1.cpp
+++ b/engines/startrek/rooms/feather1.cpp
@@ -141,7 +141,7 @@ extern const RoomAction feather1ActionList[] = {
{ {ACTION_LOOK, OBJECT_LEFT_VINE, 0, 0}, &Room::feather1LookAtLeftVine },
};
-extern const int feather1NumActions = sizeof(feather1ActionList) / sizeof(RoomAction);
+extern const int feather1NumActions = ARRAYSIZE(feather1ActionList);
void Room::feather1Tick1() {
diff --git a/engines/startrek/rooms/feather2.cpp b/engines/startrek/rooms/feather2.cpp
index 160302f..d676490 100644
--- a/engines/startrek/rooms/feather2.cpp
+++ b/engines/startrek/rooms/feather2.cpp
@@ -57,7 +57,7 @@ extern const RoomAction feather2ActionList[] = {
{ {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::feather2LookAtRedshirt },
};
-extern const int feather2NumActions = sizeof(feather2ActionList) / sizeof(RoomAction);
+extern const int feather2NumActions = ARRAYSIZE(feather2ActionList);
void Room::feather2Tick1() {
diff --git a/engines/startrek/rooms/feather3.cpp b/engines/startrek/rooms/feather3.cpp
index 0b3a1ce..7e71090 100644
--- a/engines/startrek/rooms/feather3.cpp
+++ b/engines/startrek/rooms/feather3.cpp
@@ -90,7 +90,7 @@ extern const RoomAction feather3ActionList[] = {
{ {ACTION_LOOK, OBJECT_KNIFE, 0, 0}, &Room::feather3LookAtKnife },
};
-extern const int feather3NumActions = sizeof(feather3ActionList) / sizeof(RoomAction);
+extern const int feather3NumActions = ARRAYSIZE(feather3ActionList);
void Room::feather3Tick1() {
diff --git a/engines/startrek/rooms/feather4.cpp b/engines/startrek/rooms/feather4.cpp
index 2c18155..cd05e93 100644
--- a/engines/startrek/rooms/feather4.cpp
+++ b/engines/startrek/rooms/feather4.cpp
@@ -64,7 +64,7 @@ extern const RoomAction feather4ActionList[] = {
{ {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::feather4LookAtRedshirt },
};
-extern const int feather4NumActions = sizeof(feather4ActionList) / sizeof(RoomAction);
+extern const int feather4NumActions = ARRAYSIZE(feather4ActionList);
void Room::feather4Tick1() {
diff --git a/engines/startrek/rooms/feather5.cpp b/engines/startrek/rooms/feather5.cpp
index f1da463..2adcd43 100644
--- a/engines/startrek/rooms/feather5.cpp
+++ b/engines/startrek/rooms/feather5.cpp
@@ -111,7 +111,7 @@ extern const RoomAction feather5ActionList[] = {
{ {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::feather5UseMedkitAnywhere },
};
-extern const int feather5NumActions = sizeof(feather5ActionList) / sizeof(RoomAction);
+extern const int feather5NumActions = ARRAYSIZE(feather5ActionList);
void Room::feather5Tick1() {
diff --git a/engines/startrek/rooms/feather6.cpp b/engines/startrek/rooms/feather6.cpp
index 8ae54d1..451cef6 100644
--- a/engines/startrek/rooms/feather6.cpp
+++ b/engines/startrek/rooms/feather6.cpp
@@ -98,7 +98,7 @@ extern const RoomAction feather6ActionList[] = {
{ {ACTION_USE, OBJECT_ISTRICOR, OBJECT_STALACTITES, 0}, &Room::feather6UseSTricorderOnStalactites },
};
-extern const int feather6NumActions = sizeof(feather6ActionList) / sizeof(RoomAction);
+extern const int feather6NumActions = ARRAYSIZE(feather6ActionList);
void Room::feather6Tick1() {
diff --git a/engines/startrek/rooms/feather7.cpp b/engines/startrek/rooms/feather7.cpp
index 1641ddf..0bfa2b2 100644
--- a/engines/startrek/rooms/feather7.cpp
+++ b/engines/startrek/rooms/feather7.cpp
@@ -37,7 +37,7 @@ extern const RoomAction feather7ActionList[] = {
{ {ACTION_DONE_ANIM, 2, 0, 0}, &Room::feather7ReadyToBeamOut },
};
-extern const int feather7NumActions = sizeof(feather7ActionList) / sizeof(RoomAction);
+extern const int feather7NumActions = ARRAYSIZE(feather7ActionList);
void Room::feather7Tick1() {
diff --git a/engines/startrek/rooms/sins0.cpp b/engines/startrek/rooms/sins0.cpp
index fa0c3fa..61db8ef 100644
--- a/engines/startrek/rooms/sins0.cpp
+++ b/engines/startrek/rooms/sins0.cpp
@@ -75,7 +75,7 @@ extern const RoomAction sins0ActionList[] = {
};
-extern const int sins0NumActions = sizeof(sins0ActionList) / sizeof(RoomAction);
+extern const int sins0NumActions = ARRAYSIZE(sins0ActionList);
void Room::sins0Tick1() {
diff --git a/engines/startrek/rooms/sins1.cpp b/engines/startrek/rooms/sins1.cpp
index 356a99c..ac81221 100644
--- a/engines/startrek/rooms/sins1.cpp
+++ b/engines/startrek/rooms/sins1.cpp
@@ -86,7 +86,7 @@ extern const RoomAction sins1ActionList[] = {
{ {ACTION_WALK, OBJECT_DOOR, 0, 0}, &Room::sins1WalkToDoor },
};
-extern const int sins1NumActions = sizeof(sins1ActionList) / sizeof(RoomAction);
+extern const int sins1NumActions = ARRAYSIZE(sins1ActionList);
void Room::sins1Tick1() {
diff --git a/engines/startrek/rooms/sins2.cpp b/engines/startrek/rooms/sins2.cpp
index f3dc6cd..37e352f 100644
--- a/engines/startrek/rooms/sins2.cpp
+++ b/engines/startrek/rooms/sins2.cpp
@@ -84,7 +84,7 @@ extern const RoomAction sins2ActionList[] = {
{ {ACTION_WALK, OBJECT_DOOR, 0, 0}, &Room::sins2WalkToDoor },
};
-extern const int sins2NumActions = sizeof(sins2ActionList) / sizeof(RoomAction);
+extern const int sins2NumActions = ARRAYSIZE(sins2ActionList);
void Room::sins2Tick1() {
diff --git a/engines/startrek/rooms/sins3.cpp b/engines/startrek/rooms/sins3.cpp
index a88838d..fd831b1 100644
--- a/engines/startrek/rooms/sins3.cpp
+++ b/engines/startrek/rooms/sins3.cpp
@@ -122,7 +122,7 @@ extern const RoomAction sins3ActionList[] = {
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::sins3UseMTricorderOnCrewman },
};
-extern const int sins3NumActions = sizeof(sins3ActionList) / sizeof(RoomAction);
+extern const int sins3NumActions = ARRAYSIZE(sins3ActionList);
void Room::sins3Tick1() {
diff --git a/engines/startrek/rooms/sins4.cpp b/engines/startrek/rooms/sins4.cpp
index 1278e6d..7426bef 100644
--- a/engines/startrek/rooms/sins4.cpp
+++ b/engines/startrek/rooms/sins4.cpp
@@ -92,7 +92,7 @@ extern const RoomAction sins4ActionList[] = {
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::sins4UseMTricorderOnCrewman },
};
-extern const int sins4NumActions = sizeof(sins4ActionList) / sizeof(RoomAction);
+extern const int sins4NumActions = ARRAYSIZE(sins4ActionList);
void Room::sins4Tick1() {
diff --git a/engines/startrek/rooms/sins5.cpp b/engines/startrek/rooms/sins5.cpp
index 525e6c1..18be050 100644
--- a/engines/startrek/rooms/sins5.cpp
+++ b/engines/startrek/rooms/sins5.cpp
@@ -129,7 +129,7 @@ extern const RoomAction sins5ActionList[] = {
{ {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::sins5UseMTricorderOnCrewman },
};
-extern const int sins5NumActions = sizeof(sins5ActionList) / sizeof(RoomAction);
+extern const int sins5NumActions = ARRAYSIZE(sins5ActionList);
void Room::sins5Tick1() {
diff --git a/engines/startrek/rooms/trial0.cpp b/engines/startrek/rooms/trial0.cpp
index 0508d18..6c6307e 100644
--- a/engines/startrek/rooms/trial0.cpp
+++ b/engines/startrek/rooms/trial0.cpp
@@ -80,7 +80,7 @@ extern const RoomAction trial0ActionList[] = {
{ {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::trial0UseMedkitAnywhere },
};
-extern const int trial0NumActions = sizeof(trial0ActionList) / sizeof(RoomAction);
+extern const int trial0NumActions = ARRAYSIZE(trial0ActionList);
void Room::trial0Tick1() {
diff --git a/engines/startrek/rooms/trial1.cpp b/engines/startrek/rooms/trial1.cpp
index 8ff3784..c6462c9 100644
--- a/engines/startrek/rooms/trial1.cpp
+++ b/engines/startrek/rooms/trial1.cpp
@@ -166,7 +166,7 @@ extern const RoomAction trial1ActionList[] = {
{ {ACTION_WALK, OBJECT_DOOR, 0, 0}, &Room::trial1WalkToDoor },
};
-extern const int trial1NumActions = sizeof(trial1ActionList) / sizeof(RoomAction);
+extern const int trial1NumActions = ARRAYSIZE(trial1ActionList);
void Room::trial1Tick1() {
diff --git a/engines/startrek/rooms/trial2.cpp b/engines/startrek/rooms/trial2.cpp
index d9fc5e2..642778a 100644
--- a/engines/startrek/rooms/trial2.cpp
+++ b/engines/startrek/rooms/trial2.cpp
@@ -120,7 +120,7 @@ extern const RoomAction trial2ActionList[] = {
{ {ACTION_USE, OBJECT_REDSHIRT, OBJECT_GLOB, 0}, &Room::trial2UseRedshirtOnGlob },
};
-extern const int trial2NumActions = sizeof(trial2ActionList) / sizeof(RoomAction);
+extern const int trial2NumActions = ARRAYSIZE(trial2ActionList);
void Room::trial2Tick1() {
diff --git a/engines/startrek/rooms/trial3.cpp b/engines/startrek/rooms/trial3.cpp
index 49ac5bd..47f56cc 100644
--- a/engines/startrek/rooms/trial3.cpp
+++ b/engines/startrek/rooms/trial3.cpp
@@ -91,7 +91,7 @@ extern const RoomAction trial3ActionList[] = {
{ {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::trial3UseMedkitAnywhere },
};
-extern const int trial3NumActions = sizeof(trial3ActionList) / sizeof(RoomAction);
+extern const int trial3NumActions = ARRAYSIZE(trial3ActionList);
void Room::trial3Tick1() {
diff --git a/engines/startrek/rooms/trial4.cpp b/engines/startrek/rooms/trial4.cpp
index b6de4d7..bfbb516 100644
--- a/engines/startrek/rooms/trial4.cpp
+++ b/engines/startrek/rooms/trial4.cpp
@@ -33,7 +33,7 @@ extern const RoomAction trial4ActionList[] = {
{ {ACTION_TICK, 60, 0, 0}, &Room::trial4Tick60 },
};
-extern const int trial4NumActions = sizeof(trial4ActionList) / sizeof(RoomAction);
+extern const int trial4NumActions = ARRAYSIZE(trial4ActionList);
void Room::trial4Tick1() {
diff --git a/engines/startrek/rooms/trial5.cpp b/engines/startrek/rooms/trial5.cpp
index ec1111d..8d522fd 100644
--- a/engines/startrek/rooms/trial5.cpp
+++ b/engines/startrek/rooms/trial5.cpp
@@ -160,7 +160,7 @@ extern const RoomAction trial5ActionList[] = {
{ {ACTION_USE, OBJECT_IMEDKIT, 0xff, 0}, &Room::trial5UseMedkitAnywhere },
};
-extern const int trial5NumActions = sizeof(trial5ActionList) / sizeof(RoomAction);
+extern const int trial5NumActions = ARRAYSIZE(trial5ActionList);
void Room::trial5Tick1() {
Commit: ba05b5539ba458c87cb804a5658b153a48f7338b
https://github.com/scummvm/scummvm/commit/ba05b5539ba458c87cb804a5658b153a48f7338b
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Various code cleanup
Changed paths:
R engines/startrek/object.cpp
engines/startrek/filestream.cpp
engines/startrek/iwfile.cpp
engines/startrek/iwfile.h
engines/startrek/module.mk
engines/startrek/object.h
engines/startrek/room.cpp
diff --git a/engines/startrek/filestream.cpp b/engines/startrek/filestream.cpp
index 1cb83f5..b4fa2d2 100644
--- a/engines/startrek/filestream.cpp
+++ b/engines/startrek/filestream.cpp
@@ -57,9 +57,9 @@ uint16 FileStream::readUint16() {
assert(_pos + 2 <= size());
uint16 w;
if (_bigEndian)
- w = _data[_pos + 1] | (_data[_pos] << 8);
+ w = READ_BE_UINT16(_data + _pos);
else
- w = _data[_pos] | (_data[_pos + 1] << 8);
+ w = READ_LE_UINT16(_data + _pos);
_pos += 2;
return w;
}
@@ -68,9 +68,9 @@ uint32 FileStream::readUint32() {
assert(_pos + 4 <= size());
uint32 w;
if (_bigEndian)
- w = _data[_pos + 3] | (_data[_pos + 2] << 8) | (_data[_pos + 1] << 16) | (_data[_pos] << 24);
+ w = READ_BE_UINT32(_data + _pos);
else
- w = _data[_pos] | (_data[_pos + 1] << 8) | (_data[_pos + 2] << 16) | (_data[_pos + 3] << 24);
+ w = READ_LE_UINT32(_data + _pos);
_pos += 4;
return w;
}
diff --git a/engines/startrek/iwfile.cpp b/engines/startrek/iwfile.cpp
index e61f6a0..d1e7355 100644
--- a/engines/startrek/iwfile.cpp
+++ b/engines/startrek/iwfile.cpp
@@ -1,4 +1,3 @@
-
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
diff --git a/engines/startrek/iwfile.h b/engines/startrek/iwfile.h
index dfd59d3..f514474 100644
--- a/engines/startrek/iwfile.h
+++ b/engines/startrek/iwfile.h
@@ -1,4 +1,3 @@
-
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 51f3853..eebaad5 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -13,7 +13,6 @@ MODULE_OBJS = \
lzss.o \
math.o \
menu.o \
- object.o \
room.o \
saveload.o \
sound.o \
diff --git a/engines/startrek/object.cpp b/engines/startrek/object.cpp
deleted file mode 100644
index f0eb6d6..0000000
--- a/engines/startrek/object.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/* 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 "object.h"
-
-namespace StarTrek {
-
-} // End of namespace StarTrek
diff --git a/engines/startrek/object.h b/engines/startrek/object.h
index 3abcbe9..9c2bf0d 100644
--- a/engines/startrek/object.h
+++ b/engines/startrek/object.h
@@ -133,45 +133,45 @@ struct Actor {
public:
Actor() :
- spriteDrawn(),
+ spriteDrawn(false),
//animFilename[16],
- animType(),
+ animType(0),
sprite(),
//bitmapFilename[10],
- scale(),
+ scale(0),
animFile(),
- numAnimFrames(),
- animFrame(),
- frameToStartNextAnim(),
- pos(),
- field60(),
- field62(),
- triggerActionWhenAnimFinished(),
- finishedAnimActionParam(),
+ numAnimFrames(0),
+ animFrame(0),
+ frameToStartNextAnim(0),
+ pos(Common::Point(0, 0)),
+ field60(0),
+ field62(0),
+ triggerActionWhenAnimFinished(false),
+ finishedAnimActionParam(0),
//animationString2[8](),
- field70(),
- field72(),
- field74(),
- field76(),
- iwSrcPosition(),
- iwDestPosition(),
- granularPosX(),
- granularPosY(),
- speedX(),
- speedY(),
-
- dest(),
- field90(),
- field92(),
-
- direction(),
- field94(),
- field96(),
+ field70(0),
+ field72(0),
+ field74(0),
+ field76(0),
+ iwSrcPosition(0),
+ iwDestPosition(0),
+ granularPosX(0),
+ granularPosY(0),
+ speedX(0),
+ speedY(0),
+
+ dest(Common::Point(0, 0)),
+ field90(0),
+ field92(0),
+
+ direction(0),
+ field94(0),
+ field96(0),
//char animationString[10];
- fielda2(),
- fielda4(),
- fielda6() {
+ fielda2(0),
+ fielda4(0),
+ fielda6(0) {
memset(animFilename, 0, sizeof(animFilename));
memset(bitmapFilename, 0, sizeof(bitmapFilename));
memset(animationString2, 0, sizeof(animationString2));
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 7e5c50f..73776d7 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -113,7 +113,7 @@ Room::~Room() {
}
uint16 Room::readRdfWord(int offset) {
- return _rdfData[offset] | (_rdfData[offset + 1] << 8);
+ return READ_LE_UINT16((_rdfData + offset));
}
bool Room::actionHasCode(const Action &action) {
Commit: a84746bf660f0413a205636edd39b484018e73b7
https://github.com/scummvm/scummvm/commit/a84746bf660f0413a205636edd39b484018e73b7
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Add POTFILES
Changed paths:
A engines/startrek/POTFILES
engines/startrek/saveload.cpp
diff --git a/engines/startrek/POTFILES b/engines/startrek/POTFILES
new file mode 100644
index 0000000..0d82577
--- /dev/null
+++ b/engines/startrek/POTFILES
@@ -0,0 +1 @@
+engines/startrek/saveload.cpp
diff --git a/engines/startrek/saveload.cpp b/engines/startrek/saveload.cpp
index d5d265a..d7c11b7 100644
--- a/engines/startrek/saveload.cpp
+++ b/engines/startrek/saveload.cpp
@@ -52,11 +52,6 @@ bool StarTrekEngine::showSaveMenu() {
if (desc.size() > 28)
desc = Common::String(desc.c_str(), 28);
- /*
- dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
- slot = dialog->runModalWithCurrentTarget();
- */
-
delete dialog;
if (slot < 0)
Commit: e5e54b8a1f937e2df1dfd141de9d4444257f9540
https://github.com/scummvm/scummvm/commit/e5e54b8a1f937e2df1dfd141de9d4444257f9540
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Split up startrek.cpp into more files
Changed paths:
A engines/startrek/actors.cpp
A engines/startrek/intro.cpp
engines/startrek/module.mk
engines/startrek/startrek.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/actors.cpp b/engines/startrek/actors.cpp
new file mode 100644
index 0000000..04c2a17
--- /dev/null
+++ b/engines/startrek/actors.cpp
@@ -0,0 +1,1421 @@
+/* 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 "startrek/iwfile.h"
+#include "startrek/room.h"
+#include "startrek/startrek.h"
+
+namespace StarTrek {
+
+void StarTrekEngine::initActors() {
+ for (int i = 0; i < NUM_ACTORS; i++)
+ _actorList[i] = Actor();
+ for (int i = 0; i < MAX_BAN_FILES; i++)
+ _banFiles[i].reset();
+
+ strcpy(_kirkActor->animationString, "kstnd");
+ strcpy(_spockActor->animationString, "sstnd");
+ strcpy(_mccoyActor->animationString, "mstnd");
+ strcpy(_redshirtActor->animationString, "rstnd");
+}
+
+int StarTrekEngine::loadActorAnim(int actorIndex, const Common::String &animName, int16 x, int16 y, Fixed8 scale) {
+ debugC(6, kDebugGraphics, "Load animation '%s' on actor %d", animName.c_str(), actorIndex);
+
+ Actor *actor;
+
+ if (actorIndex == -1) {
+ // TODO
+ warning("loadActorAnim: actor == -1");
+ } else
+ actor = &_actorList[actorIndex];
+
+ if (actor->spriteDrawn) {
+ releaseAnim(actor);
+ drawActorToScreen(actor, animName, x, y, scale, false);
+ } else {
+ drawActorToScreen(actor, animName, x, y, scale, true);
+ }
+
+ actor->triggerActionWhenAnimFinished = false;
+ actor->finishedAnimActionParam = 0;
+
+ return actorIndex;
+}
+
+void StarTrekEngine::loadBanFile(const Common::String &name) {
+ debugC(kDebugGeneral, 7, "Load BAN file: %s.ban", name.c_str());
+ for (int i = 0; i < MAX_BAN_FILES; i++) {
+ if (!_banFiles[i]) {
+ _banFiles[i] = loadFile(name + ".ban");
+ _banFileOffsets[i] = 0;
+ return;
+ }
+ }
+
+ warning("Couldn't load .BAN file \"%s.ban\"", name.c_str());
+}
+
+bool StarTrekEngine::actorWalkToPosition(int actorIndex, const Common::String &animFile, int16 srcX, int16 srcY, int16 destX, int16 destY) {
+ debugC(6, "Obj %d: walk from (%d,%d) to (%d,%d)", actorIndex, srcX, srcY, destX, destY);
+
+ Actor *actor = &_actorList[actorIndex];
+
+ actor->triggerActionWhenAnimFinished = false;
+ if (isPositionSolid(destX, destY))
+ return false;
+
+ if (actor->spriteDrawn)
+ releaseAnim(actor);
+ else
+ _gfx->addSprite(&actor->sprite);
+
+ actor->spriteDrawn = true;
+ actor->animType = 1;
+ actor->frameToStartNextAnim = _frameIndex + 1;
+ strcpy(actor->animationString2, animFile.c_str());
+
+ actor->dest.x = destX;
+ actor->dest.y = destY;
+ actor->field92 = 0;
+ actor->triggerActionWhenAnimFinished = false;
+
+ actor->iwDestPosition = -1;
+ actor->iwSrcPosition = -1;
+
+ if (directPathExists(srcX, srcY, destX, destY)) {
+ chooseActorDirectionForWalking(actor, srcX, srcY, destX, destY);
+ updateActorPositionWhileWalking(actor, (actor->granularPosX + 0.5).toInt(), (actor->granularPosY + 0.5).toInt());
+ return true;
+ } else {
+ actor->iwSrcPosition = _iwFile->getClosestKeyPosition(srcX, srcY);
+ actor->iwDestPosition = _iwFile->getClosestKeyPosition(destX, destY);
+
+ if (actor->iwSrcPosition == -1 || actor->iwDestPosition == -1) {
+ // No path exists; face south by default.
+ strcat(actor->animationString2, "S");
+ actor->direction = 'S';
+
+ updateActorPositionWhileWalking(actor, srcX, srcY);
+ initStandAnim(actorIndex);
+
+ return false;
+ } else {
+ Common::Point iwSrc = _iwFile->_keyPositions[actor->iwSrcPosition];
+ chooseActorDirectionForWalking(actor, srcX, srcY, iwSrc.x, iwSrc.y);
+ updateActorPositionWhileWalking(actor, (actor->granularPosX + 0.5).toInt(), (actor->granularPosY + 0.5).toInt());
+ return true;
+ }
+ }
+}
+
+void StarTrekEngine::updateActorAnimations() {
+ for (int i = 0; i < NUM_ACTORS; i++) {
+ Actor *actor = &_actorList[i];
+ if (!actor->spriteDrawn)
+ continue;
+
+ switch (actor->animType) {
+ case 0: // Not walking?
+ case 2:
+ if (_frameIndex >= actor->frameToStartNextAnim) {
+ int nextAnimIndex = getRandomWord() & 3;
+ actor->animFile->seek(18 + nextAnimIndex + actor->animFrame * 22, SEEK_SET);
+ byte nextAnimFrame = actor->animFile->readByte();
+
+ if (actor->animFrame != nextAnimFrame) {
+ if (nextAnimFrame == actor->numAnimFrames - 1) {
+ actor->field62++;
+ if (actor->triggerActionWhenAnimFinished) {
+ addAction(ACTION_FINISHED_ANIMATION, actor->finishedAnimActionParam, 0, 0);
+ }
+ }
+ }
+
+ actor->animFrame = nextAnimFrame;
+ if (actor->animFrame >= actor->numAnimFrames) {
+ if (actor->animationString[0] == '\0')
+ removeActorFromScreen(i);
+ else
+ initStandAnim(i);
+ } else {
+ Sprite *sprite = &actor->sprite;
+
+ actor->animFile->seek(actor->animFrame * 22, SEEK_SET);
+ char animFrameFilename[16];
+ actor->animFile->read(animFrameFilename, 16);
+ sprite->setBitmap(loadAnimationFrame(animFrameFilename, actor->scale));
+
+ memset(actor->bitmapFilename, 0, 10);
+ strncpy(actor->bitmapFilename, animFrameFilename, 9);
+
+ actor->animFile->seek(10 + actor->animFrame * 22, SEEK_SET);
+ uint16 xOffset = actor->animFile->readUint16();
+ uint16 yOffset = actor->animFile->readUint16();
+ uint16 basePriority = actor->animFile->readUint16();
+ uint16 frames = actor->animFile->readUint16();
+
+ sprite->pos.x = xOffset + actor->pos.x;
+ sprite->pos.y = yOffset + actor->pos.y;
+ sprite->drawPriority = _gfx->getPriValue(0, yOffset + actor->pos.y) + basePriority;
+ sprite->bitmapChanged = true;
+
+ actor->frameToStartNextAnim = frames + _frameIndex;
+ }
+ }
+ break;
+ case 1: // Walking
+ if (_frameIndex < actor->frameToStartNextAnim)
+ break;
+ if (i == 0) // Kirk only
+ checkTouchedLoadingZone(actor->pos.x, actor->pos.y);
+ if (actor->field90 != 0) {
+ Sprite *sprite = &actor->sprite;
+ int loops;
+ if (getActorScaleAtPosition((actor->granularPosY + 0.5).toInt()) < 0.625)
+ loops = 1;
+ else
+ loops = 2;
+ for (int k = 0; k < loops; k++) {
+ if (actor->field90 == 0)
+ break;
+ actor->field90--;
+ Fixed16 newX = actor->granularPosX + actor->speedX;
+ Fixed16 newY = actor->granularPosY + actor->speedY;
+ if ((actor->field90 & 3) == 0) {
+ sprite->bitmap.reset();
+ updateActorPositionWhileWalking(actor, (newX + 0.5).toInt(), (newY + 0.5).toInt());
+ actor->field92++;
+ }
+
+ actor->granularPosX = newX;
+ actor->granularPosY = newY;
+ actor->frameToStartNextAnim = _frameIndex;
+ }
+ } else { // actor->field90 == 0
+ if (actor->iwSrcPosition == -1) {
+ if (actor->triggerActionWhenAnimFinished) {
+ actor->triggerActionWhenAnimFinished = false;
+ addAction(ACTION_FINISHED_WALKING, actor->finishedAnimActionParam & 0xff, 0, 0);
+ }
+
+ actor->sprite.bitmap.reset();
+ updateActorPositionWhileWalking(actor, (actor->granularPosX + 0.5).toInt(), (actor->granularPosY + 0.5).toInt());
+ initStandAnim(i);
+ } else { // actor->iwSrcPosition != -1
+ if (actor->iwSrcPosition == actor->iwDestPosition) {
+ actor->animationString2[strlen(actor->animationString2) - 1] = '\0';
+ actor->iwDestPosition = -1;
+ actor->iwSrcPosition = -1;
+ chooseActorDirectionForWalking(actor, actor->pos.x, actor->pos.y, actor->dest.x, actor->dest.y);
+ } else {
+ int index = _iwFile->_iwEntries[actor->iwSrcPosition][actor->iwDestPosition];
+ actor->iwSrcPosition = index;
+ Common::Point dest = _iwFile->_keyPositions[actor->iwSrcPosition];
+ actor->animationString2[strlen(actor->animationString2) - 1] = '\0';
+ chooseActorDirectionForWalking(actor, actor->pos.x, actor->pos.y, dest.x, dest.y);
+ }
+ }
+ }
+ break;
+ default:
+ error("Invalid anim type.");
+ break;
+ }
+ }
+}
+
+void StarTrekEngine::renderBanBelowSprites() {
+ if ((_frameIndex & 3) != 0)
+ return;
+
+ byte *screenPixels = _gfx->lockScreenPixels();
+ byte *bgPixels = _gfx->getBackgroundPixels();
+
+ for (int i = 0; i < MAX_BAN_FILES; i++) {
+ if (!_banFiles[i])
+ continue;
+
+ // TODO: video modes other than VGA
+
+ _banFiles[i]->seek(_banFileOffsets[i], SEEK_SET);
+ uint16 offset = _banFiles[i]->readUint16();
+
+ if (offset == 0xffff) {
+ _banFileOffsets[i] = 0;
+ _banFiles[i]->seek(0, SEEK_SET);
+ offset = _banFiles[i]->readSint16();
+ }
+
+ int16 size = _banFiles[i]->readSint16();
+ if (size != 0) {
+ _banFiles[i]->seek(_banFileOffsets[i], SEEK_SET);
+ renderBan(screenPixels, _banFiles[i]);
+
+ _banFiles[i]->seek(_banFileOffsets[i], SEEK_SET);
+ renderBan(bgPixels, _banFiles[i]);
+ }
+
+ }
+
+ _gfx->unlockScreenPixels();
+}
+
+void StarTrekEngine::renderBan(byte *destPixels, SharedPtr<FileStream> banFile) {
+ uint16 offset = banFile->readUint16();
+ int32 size = banFile->readUint16();
+
+ byte *dest = destPixels + offset;
+
+ // Skip 8 bytes (rectangle encompassing the area being drawn to)
+ banFile->readSint32();
+ banFile->readSint32();
+
+ while (--size >= 0) {
+ assert(dest >= destPixels && dest < destPixels + SCREEN_WIDTH * SCREEN_HEIGHT);
+ int8 b = banFile->readByte();
+
+ if (b == -128) // Add value to destination (usually jumping to next row)
+ dest += banFile->readUint16();
+ else if (b < 0) { // Repeated byte
+ byte c = banFile->readByte();
+ if (c == 0)
+ dest += (-b) + 1;
+ else {
+ for (int j = 0; j < (-b) + 1; j++)
+ (*dest++) = c;
+ }
+ } else { // List of bytes
+ b++;
+ while (b-- != 0) {
+ byte c = banFile->readByte();
+ if (c == 0)
+ dest++;
+ else
+ *(dest++) = c;
+ }
+ }
+ }
+}
+
+void StarTrekEngine::renderBanAboveSprites() {
+ if ((_frameIndex & 3) != 0)
+ return;
+
+ for (int i = 0; i < MAX_BAN_FILES; i++) {
+ if (!_banFiles[i])
+ continue;
+
+ _banFiles[i]->seek(_banFileOffsets[i], SEEK_SET);
+ uint16 offset = _banFiles[i]->readUint16();
+
+ if (offset == 0xffff) {
+ _banFileOffsets[i] = 0;
+ _banFiles[i]->seek(0, SEEK_SET);
+ offset = _banFiles[i]->readSint16();
+ }
+
+ int16 size = _banFiles[i]->readSint16();
+ if (size != 0) {
+ Common::Rect rect;
+ rect.left = _banFiles[i]->readSint16();
+ rect.top = _banFiles[i]->readSint16();
+ rect.right = _banFiles[i]->readSint16() + 1;
+ rect.bottom = _banFiles[i]->readSint16() + 1;
+
+ // Draw all sprites in this rectangle to a custom surface, and only update the
+ // specific pixels that were updated by the BAN file this frame.
+ // Rationale behind this is that, since the background may not have been
+ // redrawn, the transparent sprites (ie. textboxes) would further darken any
+ // pixels behind them that haven't been updated this frame. So, we can't just
+ // update everything in this rectangle.
+ // FIXME: This copies the entire screen surface for temporary drawing, which
+ // is somewhat wasteful. Original game had one more graphics layer it drew to
+ // before the screen was updated...
+ ::Graphics::Surface surface;
+ _gfx->drawAllSpritesInRectToSurface(rect, &surface);
+
+ byte *destPixels = _gfx->lockScreenPixels();
+ byte *src = (byte *)surface.getPixels() + offset;
+ byte *dest = destPixels + offset;
+
+ // This is similar to renderBan(), except it copies pixels from the surface
+ // above instead of drawing directly to it. (Important since sprites may be
+ // drawn on top.)
+ while (--size >= 0) {
+ assert(dest >= destPixels && dest < destPixels + SCREEN_WIDTH * SCREEN_HEIGHT);
+ int8 b = _banFiles[i]->readByte();
+ if (b == -128) {
+ uint16 skip = _banFiles[i]->readUint16();
+ dest += skip;
+ src += skip;
+ } else if (b < 0) {
+ byte c = _banFiles[i]->readByte();
+ if (c == 0) {
+ dest += (-b) + 1;
+ src += (-b) + 1;
+ }
+ else {
+ for (int j = 0; j < (-b) + 1; j++)
+ *(dest++) = *(src++);
+ }
+ } else {
+ b++;
+ while (b-- != 0) {
+ byte c = _banFiles[i]->readByte();
+ if (c == 0) {
+ dest++;
+ src++;
+ } else
+ *(dest++) = *(src++);
+ }
+ }
+ }
+
+ _gfx->unlockScreenPixels();
+ surface.free();
+
+ _banFileOffsets[i] = _banFiles[i]->pos();
+ }
+ }
+}
+
+void StarTrekEngine::removeActorFromScreen(int actorIndex) {
+ Actor *actor = &_actorList[actorIndex];
+
+ if (actor->spriteDrawn != 1)
+ return;
+
+ debugC(6, kDebugGraphics, "Stop drawing actor %d", actorIndex);
+
+ Sprite *sprite = &actor->sprite;
+ sprite->field16 = true;
+ sprite->bitmapChanged = true;
+ _gfx->drawAllSprites();
+ _gfx->delSprite(sprite);
+ releaseAnim(actor);
+}
+
+void StarTrekEngine::actorFunc1() {
+ for (int i = 0; i < NUM_ACTORS; i++) {
+ if (_actorList[i].spriteDrawn == 1) {
+ removeActorFromScreen(i);
+ }
+ }
+
+ for (int i = 0; i < MAX_BAN_FILES; i++) {
+ _banFiles[i].reset();
+ }
+}
+
+void StarTrekEngine::drawActorToScreen(Actor *actor, const Common::String &_animName, int16 x, int16 y, Fixed8 scale, bool addSprite) {
+ Common::String animFilename = _animName;
+ if (_animName.hasPrefixIgnoreCase("stnd") /* && word_45d20 == -1 */) // TODO
+ animFilename += 'j';
+ memcpy(actor->animFilename, _animName.c_str(), sizeof(actor->animFilename));
+
+ actor->animType = 2;
+ actor->animFile = loadFile(animFilename + ".anm");
+ actor->numAnimFrames = actor->animFile->size() / 22;
+ actor->animFrame = 0;
+ actor->pos.x = x;
+ actor->pos.y = y;
+ actor->field62 = 0;
+ actor->scale = scale;
+
+ actor->animFile->seek(16, SEEK_SET);
+ actor->frameToStartNextAnim = actor->animFile->readUint16() + _frameIndex;
+
+ char firstFrameFilename[11];
+ actor->animFile->seek(0, SEEK_SET);
+ actor->animFile->read(firstFrameFilename, 10);
+ firstFrameFilename[10] = '\0';
+
+ Sprite *sprite = &actor->sprite;
+ if (addSprite)
+ _gfx->addSprite(sprite);
+
+ sprite->setBitmap(loadAnimationFrame(firstFrameFilename, scale));
+ memset(actor->bitmapFilename, 0, sizeof(char) * 10);
+ strncpy(actor->bitmapFilename, firstFrameFilename, sizeof(char) * 9);
+
+ actor->scale = scale;
+
+ actor->animFile->seek(10, SEEK_SET);
+ uint16 xOffset = actor->animFile->readUint16();
+ uint16 yOffset = actor->animFile->readUint16();
+ uint16 basePriority = actor->animFile->readUint16();
+
+ sprite->pos.x = xOffset + actor->pos.x;
+ sprite->pos.y = yOffset + actor->pos.y;
+ sprite->drawPriority = _gfx->getPriValue(0, yOffset + actor->pos.y) + basePriority;
+ sprite->bitmapChanged = true;
+
+ actor->spriteDrawn = 1;
+}
+
+void StarTrekEngine::releaseAnim(Actor *actor) {
+ switch (actor->animType) {
+ case 0:
+ case 2:
+ actor->sprite.bitmap.reset();
+ actor->animFile.reset();
+ break;
+ case 1:
+ actor->sprite.bitmap.reset();
+ break;
+ default:
+ error("Invalid anim type");
+ break;
+ }
+
+ actor->spriteDrawn = 0;
+}
+
+void StarTrekEngine::initStandAnim(int actorIndex) {
+ Actor *actor = &_actorList[actorIndex];
+
+ if (!actor->spriteDrawn)
+ error("initStandAnim: dead anim");
+
+ ////////////////////
+ // sub_239d2
+ const char *directions = "nsew";
+
+ if (actorIndex >= 0 && actorIndex <= 3) {
+ int8 dir = _awayMission.crewDirectionsAfterWalk[actorIndex];
+ if (dir != -1) {
+ actor->direction = directions[dir];
+ _awayMission.crewDirectionsAfterWalk[actorIndex] = -1;
+ }
+ }
+ // end of sub_239d2
+ ////////////////////
+
+ Common::String animName;
+ if (actor->direction != 0)
+ animName = Common::String(actor->animationString) + (char)actor->direction;
+ else // Default to facing south
+ animName = Common::String(actor->animationString) + 's';
+
+ Fixed8 scale = getActorScaleAtPosition(actor->pos.y);
+ loadActorAnim(actorIndex, animName, actor->pos.x, actor->pos.y, scale);
+ actor->animType = 0;
+}
+
+void StarTrekEngine::updateActorPositionWhileWalking(Actor *actor, int16 x, int16 y) {
+ actor->scale = getActorScaleAtPosition(y);
+ Common::String animName = Common::String::format("%s%02d", actor->animationString2, actor->field92 & 7);
+ actor->sprite.setBitmap(loadAnimationFrame(animName, actor->scale));
+
+ memset(actor->bitmapFilename, 0, 10);
+ strncpy(actor->bitmapFilename, animName.c_str(), 9);
+
+ Sprite *sprite = &actor->sprite;
+ sprite->drawPriority = _gfx->getPriValue(0, y);
+ sprite->pos.x = x;
+ sprite->pos.y = y;
+ sprite->bitmapChanged = true;
+
+ actor->frameToStartNextAnim = _frameIndex;
+ actor->pos.x = x;
+ actor->pos.y = y;
+}
+
+void StarTrekEngine::chooseActorDirectionForWalking(Actor *actor, int16 srcX, int16 srcY, int16 destX, int16 destY) {
+ actor->granularPosX = srcX;
+ actor->granularPosY = srcY;
+
+ int16 distX = destX - srcX;
+ int16 distY = destY - srcY;
+ int16 absDistX = abs(distX);
+ int16 absDistY = abs(distY);
+
+ if (absDistX > absDistY) {
+ char d;
+ if (distX > 0)
+ d = 'E';
+ else
+ d = 'W';
+
+ // Append direction to animation string
+ actor->animationString2[strlen(actor->animationString2) + 1] = '\0';
+ actor->animationString2[strlen(actor->animationString2)] = d;
+
+ actor->direction = d;
+ actor->field90 = absDistX;
+
+ if (distX != 0) {
+ if (distX > 0)
+ actor->speedX = 1.0;
+ else
+ actor->speedX = -1.0;
+
+ actor->speedY = Fixed16(distY) / absDistX;
+ }
+ } else {
+ char d;
+ if (distY > 0)
+ d = 'S';
+ else
+ d = 'N';
+
+ // Append direction to animation string
+ actor->animationString2[strlen(actor->animationString2) + 1] = '\0';
+ actor->animationString2[strlen(actor->animationString2)] = d;
+
+ actor->direction = d;
+ actor->field90 = absDistY;
+
+ if (distY != 0) {
+ if (distY > 0)
+ actor->speedY = 1.0;
+ else
+ actor->speedY = -1.0;
+
+ actor->speedX = Fixed16(distX) / absDistY;
+ }
+ }
+}
+
+bool StarTrekEngine::directPathExists(int16 srcX, int16 srcY, int16 destX, int16 destY) {
+ int32 distX = destX - srcX;
+ int32 distY = destY - srcY;
+
+ int32 absDistX = abs(distX);
+ int32 absDistY = abs(distY);
+
+ int32 distCounter;
+ Fixed16 speedX, speedY;
+
+ if (absDistX > absDistY) {
+ distCounter = absDistX;
+
+ if (distCounter == 0)
+ return true;
+
+ speedY = Fixed16(distY) / absDistX;
+
+ if (distX > 0)
+ speedX = 1.0;
+ else
+ speedX = -1.0;
+ } else { // absDistX <= absDistY
+ distCounter = absDistY;
+
+ if (distCounter == 0)
+ return true;
+
+ speedX = Fixed16(distX) / absDistY;
+
+ if (distY > 0)
+ speedY = 1.0;
+ else
+ speedY = -1.0;
+ }
+
+ Fixed16 fixedX = srcX;
+ Fixed16 fixedY = srcY;
+
+ if (isPositionSolid((fixedX + 0.5).toInt(), (fixedY + 0.5).toInt()))
+ return false;
+
+ while (distCounter-- > 0) {
+ fixedX += speedX;
+ fixedY += speedY;
+
+ if (isPositionSolid((fixedX + 0.5).toInt(), (fixedY + 0.5).toInt()))
+ return false;
+ }
+
+ return true;
+}
+
+int StarTrekEngine::findObjectAt(int x, int y) {
+ Sprite *sprite = _gfx->getSpriteAt(x, y);
+
+ if (sprite != nullptr) {
+ if (sprite == &_inventoryIconSprite)
+ return OBJECT_INVENTORY_ICON;
+ else if (sprite == &_itemIconSprite)
+ return _awayMission.activeObject;
+
+ for (int i = 0; i < NUM_ACTORS; i++) {
+ Actor *actor = &_actorList[i];
+ if (sprite == &actor->sprite)
+ return i;
+ }
+
+ error("findObject: Clicked on an unknown sprite");
+ }
+
+ _objectHasWalkPosition = false;
+ int actionBit = 1 << (_awayMission.activeAction - 1);
+ int offset = _room->getFirstHotspot();
+
+ while (offset != _room->getHotspotEnd()) {
+ uint16 word = _room->readRdfWord(offset);
+ if (word & 0x8000) {
+ if ((word & actionBit) && isPointInPolygon((int16 *)(_room->_rdfData + offset + 6), x, y)) {
+ int actorIndex = _room->readRdfWord(offset + 6);
+ _objectHasWalkPosition = true;
+ _objectWalkPosition.x = _room->readRdfWord(offset + 2);
+ _objectWalkPosition.y = _room->readRdfWord(offset + 4);
+ return actorIndex;
+ }
+
+ int numVertices = _room->readRdfWord(offset + 8);
+ offset = offset + 10 + numVertices * 4;
+ } else {
+ if (isPointInPolygon((int16 *)(_room->_rdfData + offset), x, y)) {
+ int actorIndex = _room->readRdfWord(offset);
+ return actorIndex;
+ }
+
+ int numVertices = _room->readRdfWord(offset + 2);
+ offset = offset + 4 + numVertices * 4;
+ }
+ }
+
+ return -1;
+}
+
+SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filename, Fixed8 scale) {
+ SharedPtr<Bitmap> bitmapToReturn;
+
+ char basename[5];
+ strncpy(basename, filename.c_str() + 1, 4);
+ basename[4] = '\0';
+
+ char c = filename[0];
+ if ((strcmp(basename, "stnd") == 0 || strcmp(basename, "tele") == 0)
+ && (c == 'm' || c == 's' || c == 'k' || c == 'r')) {
+ if (c == 'm') {
+ // Mccoy has the "base" animations for all crewmen
+ bitmapToReturn = _gfx->loadBitmap(filename);
+ } else {
+ // All crewman other than mccoy copy the animation frames from mccoy, change
+ // the colors of the uniforms, and load an "xor" file to redraw the face.
+
+ // TODO: The ".$bm" extension is a "virtual file"? Caches the changes to the
+ // file made here?
+ // bitmapToReturn = _gfx->loadBitmap(filename + ".$bm");
+
+ if (bitmapToReturn == nullptr) {
+ Common::String mccoyFilename = filename;
+ mccoyFilename.setChar('m', 0);
+ SharedPtr<Bitmap> bitmap = _gfx->loadBitmap(mccoyFilename);
+
+ uint16 width = bitmap->width;
+ uint16 height = bitmap->height;
+
+ bitmapToReturn = SharedPtr<Bitmap>(new Bitmap(width, height));
+ bitmapToReturn->xoffset = bitmap->xoffset;
+ bitmapToReturn->yoffset = bitmap->yoffset;
+
+ // Change uniform color
+ int16 colorShift;
+ switch (c) {
+ case 'k': // Kirk
+ colorShift = 8;
+ break;
+ case 'r': // Redshirt
+ colorShift = -8;
+ break;
+ case 's': // Spock
+ colorShift = 0;
+ break;
+ }
+
+ if (colorShift == 0) {
+ memcpy(bitmapToReturn->pixels, bitmap->pixels, width * height);
+ } else {
+ byte *src = bitmap->pixels;
+ byte *dest = bitmapToReturn->pixels;
+ byte baseUniformColor = 0xa8;
+
+ for (int i = 0; i < width * height; i++) {
+ byte b = *src++;
+ if (b >= baseUniformColor && b < baseUniformColor + 8)
+ *dest++ = b + colorShift;
+ else
+ *dest++ = b;
+ }
+ }
+
+ // Redraw face with xor file
+ SharedPtr<FileStream> xorFile = loadFile(filename + ".xor");
+ xorFile->seek(0, SEEK_SET);
+ uint16 xoffset = bitmap->xoffset - xorFile->readUint16();
+ uint16 yoffset = bitmap->yoffset - xorFile->readUint16();
+ uint16 xorWidth = xorFile->readUint16();
+ uint16 xorHeight = xorFile->readUint16();
+
+ byte *dest = bitmapToReturn->pixels + yoffset * bitmap->width + xoffset;
+
+ for (int i = 0; i < xorHeight; i++) {
+ for (int j = 0; j < xorWidth; j++)
+ *dest++ ^= xorFile->readByte();
+ dest += (bitmap->width - xorWidth);
+ }
+ }
+ }
+ } else {
+ // TODO: when loading a bitmap, it passes a different argument than is standard to
+ // the "file loading with cache" function...
+ bitmapToReturn = _gfx->loadBitmap(filename);
+ }
+
+ if (scale != 1.0) {
+ bitmapToReturn = scaleBitmap(bitmapToReturn, scale);
+ }
+
+ return bitmapToReturn;
+}
+
+
+int StarTrekEngine::selectObjectForUseAction() {
+ while (true) {
+ if (!(_awayMission.crewDownBitset & (1 << OBJECT_KIRK)))
+ showInventoryIcons(false);
+
+ TrekEvent event;
+
+ while (true) {
+ if (!getNextEvent(&event))
+ continue;
+
+ if (event.type == TREKEVENT_TICK) {
+ updateMouseBitmap();
+ _gfx->drawAllSprites();
+ _sound->checkLoopMusic();
+ } else if (event.type == TREKEVENT_LBUTTONDOWN) {
+ removeNextEvent();
+ break;
+ } else if (event.type == TREKEVENT_MOUSEMOVE) {
+ } else if (event.type == TREKEVENT_RBUTTONDOWN) {
+ // Allow this to be processed by main away mission loop
+ break;
+ } else if (event.type == TREKEVENT_KEYDOWN) {
+ if (event.kbd.keycode == Common::KEYCODE_ESCAPE
+ || event.kbd.keycode == Common::KEYCODE_w
+ || event.kbd.keycode == Common::KEYCODE_t
+ || event.kbd.keycode == Common::KEYCODE_u
+ || event.kbd.keycode == Common::KEYCODE_g
+ || event.kbd.keycode == Common::KEYCODE_l
+ || event.kbd.keycode == Common::KEYCODE_SPACE
+ || event.kbd.keycode == Common::KEYCODE_F2) {
+ // Allow these buttons to be processed by main away mission loop
+ break;
+ } else if (event.kbd.keycode == Common::KEYCODE_i) {
+ removeNextEvent();
+ break;
+ } else if (event.kbd.keycode == Common::KEYCODE_RETURN || event.kbd.keycode == Common::KEYCODE_KP_ENTER || event.kbd.keycode == Common::KEYCODE_F1) {
+ // Simulate left-click
+ removeNextEvent();
+ event.type = TREKEVENT_LBUTTONDOWN;
+ break;
+ }
+ }
+
+ removeNextEvent();
+ }
+
+ if (event.type == TREKEVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_i) {
+ hideInventoryIcons();
+ int clickedObject = showInventoryMenu(50, 50, true);
+ if (clickedObject == -1)
+ continue;
+ return clickedObject;
+ } else if (event.type == TREKEVENT_LBUTTONDOWN) {
+ int clickedObject = findObjectAt(_gfx->getMousePos());
+ hideInventoryIcons();
+
+ if (clickedObject == -1)
+ continue;
+ else if (isObjectUnusable(clickedObject, ACTION_USE))
+ continue;
+ else if (clickedObject == OBJECT_INVENTORY_ICON) {
+ clickedObject = showInventoryMenu(50, 50, false);
+ if (clickedObject == -1)
+ continue;
+ else
+ return clickedObject;
+ } else if (clickedObject <= OBJECT_REDSHIRT)
+ return clickedObject;
+ else if (isObjectUnusable(OBJECT_KIRK, ACTION_USE))
+ continue;
+ else if (_room->actionHasCode(ACTION_USE, OBJECT_KIRK, clickedObject, 0)
+ || _room->actionHasCode(ACTION_GET, clickedObject, 0, 0)
+ || _room->actionHasCode(ACTION_WALK, clickedObject, 0, 0)) {
+ _awayMission.activeObject = OBJECT_KIRK;
+ _awayMission.passiveObject = clickedObject;
+ _awayMission.activeAction = ACTION_USE;
+ clickedObject = OBJECT_KIRK;
+ if (!walkActiveObjectToHotspot())
+ addAction(_awayMission.activeAction, _awayMission.activeObject, _awayMission.passiveObject, 0);
+ return clickedObject;
+ } else
+ continue;
+ } else {
+ hideInventoryIcons();
+ return -1;
+ }
+ }
+}
+
+Common::String StarTrekEngine::getCrewmanAnimFilename(int actorIndex, const Common::String &basename) {
+ const char *crewmanChars = "ksmr";
+ assert(actorIndex >= 0 && actorIndex < 4);
+ return crewmanChars[actorIndex] + basename;
+}
+
+void StarTrekEngine::updateMouseBitmap() {
+ const bool worksOnCrewmen[] = { // True if the action reacts with crewmen
+ false, // ACTION_WALK
+ true, // ACTION_USE
+ false, // ACTION_GET
+ true, // ACTION_LOOK
+ true // ACTION_TALK
+ };
+ const bool worksOnActors[] = { // True if the action reacts with other objects
+ false, // ACTION_WALK
+ true, // ACTION_USE
+ true, // ACTION_GET
+ true, // ACTION_LOOK
+ true // ACTION_TALK
+ };
+ const bool worksOnHotspots[] = { // True if the action reacts with hotspots
+ false, // ACTION_WALK
+ true, // ACTION_USE
+ true, // ACTION_GET
+ true, // ACTION_LOOK
+ false // ACTION_TALK
+ };
+
+ Common::Point mousePos = _gfx->getMousePos();
+ int selected = findObjectAt(mousePos.x, mousePos.y);
+ int action = _awayMission.activeAction;
+ assert(action >= 1 && action <= 5);
+
+ bool withRedOutline;
+
+ if (selected >= 0 && selected <= 3 && worksOnCrewmen[action - 1])
+ withRedOutline = true;
+ else if (selected > 3 && selected < NUM_ACTORS && worksOnActors[action - 1])
+ withRedOutline = true;
+ else if (selected >= NUM_ACTORS && selected < HOTSPOTS_END && worksOnHotspots[action - 1])
+ withRedOutline = true;
+ else
+ withRedOutline = false;
+
+ chooseMouseBitmapForAction(action, withRedOutline);
+}
+
+bool StarTrekEngine::walkActiveObjectToHotspot() {
+ if (!_objectHasWalkPosition)
+ return false;
+
+ int objectIndex;
+ if (_awayMission.activeAction != ACTION_USE)
+ objectIndex = OBJECT_KIRK;
+ else if (_awayMission.activeObject <= OBJECT_REDSHIRT)
+ objectIndex = _awayMission.activeObject;
+ else if (_awayMission.activeObject >= ITEMS_START && _awayMission.activeObject <= ITEMS_END) { // FIXME: "<= ITEMS_END" doesn't make sense?
+ if (_awayMission.activeObject == OBJECT_ISTRICOR)
+ objectIndex = OBJECT_SPOCK;
+ else if (_awayMission.activeObject == OBJECT_IMTRICOR)
+ objectIndex = OBJECT_MCCOY;
+ else
+ objectIndex = OBJECT_KIRK;
+ } else // This is the original error message...
+ error("Jay didn't think about pmcheck");
+
+ byte finishedAnimActionParam = false;
+ bool walk = false;
+
+ if (_awayMission.activeAction == ACTION_WALK)
+ walk = true;
+ else {
+ // If this action has code defined for it in this room, buffer the action to be
+ // done after the object finished walking there.
+ Action action = {_awayMission.activeAction, _awayMission.activeObject, 0, 0};
+ if (_awayMission.activeAction == ACTION_USE)
+ action.b2 = _awayMission.passiveObject;
+
+ if (_room->actionHasCode(action)) {
+ for (int i = 0; i < MAX_BUFFERED_WALK_ACTIONS; i++) {
+ if (!_actionOnWalkCompletionInUse[i]) {
+ finishedAnimActionParam = i + 0xe0;
+ _actionOnWalkCompletionInUse[i] = true;
+ _actionOnWalkCompletion[i] = action;
+ walk = true;
+ break;
+ }
+ }
+ }
+ }
+
+ if (walk) {
+ Actor *actor = &_actorList[objectIndex];
+ Common::String anim = getCrewmanAnimFilename(objectIndex, "walk");
+ actorWalkToPosition(objectIndex, anim, actor->pos.x, actor->pos.y, _objectWalkPosition.x, _objectWalkPosition.y);
+ if (finishedAnimActionParam != 0) {
+ actor->triggerActionWhenAnimFinished = true;
+ actor->finishedAnimActionParam = finishedAnimActionParam;
+ }
+ _objectHasWalkPosition = false;
+ return true;
+ } else {
+ _objectHasWalkPosition = false;
+ return false;
+ }
+}
+
+void StarTrekEngine::showInventoryIcons(bool showItem) {
+ const char *crewmanFilenames[] = {
+ "ikirk",
+ "ispock",
+ "imccoy",
+ "iredshir"
+ };
+
+ Common::String itemFilename;
+
+ if (showItem) {
+ int i = _awayMission.activeObject;
+ if (i >= OBJECT_KIRK && i <= OBJECT_REDSHIRT)
+ itemFilename = crewmanFilenames[i];
+ else {
+ assert(i >= ITEMS_START && i < ITEMS_END);
+ Item *item = &_itemList[i - ITEMS_START];
+ itemFilename = item->name;
+ }
+ }
+
+ if (itemFilename.empty())
+ _inventoryIconSprite.pos.x = 10;
+ else {
+ _gfx->addSprite(&_itemIconSprite);
+ _itemIconSprite.drawMode = 2;
+ _itemIconSprite.pos.x = 10;
+ _itemIconSprite.pos.y = 10;
+ _itemIconSprite.drawPriority = 15;
+ _itemIconSprite.drawPriority2 = 8;
+ _itemIconSprite.setBitmap(_gfx->loadBitmap(itemFilename));
+
+ _inventoryIconSprite.pos.x = 46;
+ }
+
+ _gfx->addSprite(&_inventoryIconSprite);
+
+ _inventoryIconSprite.pos.y = 10;
+ _inventoryIconSprite.drawMode = 2;
+ _inventoryIconSprite.drawPriority = 15;
+ _inventoryIconSprite.drawPriority2 = 8;
+ _inventoryIconSprite.setBitmap(_gfx->loadBitmap("inv00"));
+}
+
+bool StarTrekEngine::isObjectUnusable(int object, int action) {
+ if (action == ACTION_LOOK)
+ return false;
+ if (object == OBJECT_REDSHIRT && _awayMission.redshirtDead)
+ return true;
+ if (object >= OBJECT_KIRK && object <= OBJECT_REDSHIRT && (_awayMission.crewDownBitset & (1 << object)))
+ return true;
+ if (object == OBJECT_IMTRICOR && (_awayMission.crewDownBitset & (1 << OBJECT_MCCOY)))
+ return true;
+ if (object == OBJECT_ISTRICOR && (_awayMission.crewDownBitset & (1 << OBJECT_SPOCK)))
+ return true;
+ return false;
+}
+
+void StarTrekEngine::hideInventoryIcons() {
+ // Clear these sprites from the screen
+ if (_itemIconSprite.drawMode == 2)
+ _itemIconSprite.dontDrawNextFrame();
+ if (_inventoryIconSprite.drawMode == 2)
+ _inventoryIconSprite.dontDrawNextFrame();
+
+ _gfx->drawAllSprites();
+
+ if (_itemIconSprite.drawMode == 2) {
+ _gfx->delSprite(&_itemIconSprite);
+ _itemIconSprite.drawMode = 0;
+ _itemIconSprite.bitmap.reset();
+ }
+
+ if (_inventoryIconSprite.drawMode == 2) {
+ _gfx->delSprite(&_inventoryIconSprite);
+ _inventoryIconSprite.drawMode = 0;
+ _inventoryIconSprite.bitmap.reset();
+ }
+}
+
+void StarTrekEngine::updateCrewmanGetupTimers() {
+ if (_awayMission.crewDownBitset == 0)
+ return;
+ for (int i = OBJECT_KIRK; i <= OBJECT_REDSHIRT; i++) {
+ Actor *actor = &_actorList[i];
+
+ if (!(_awayMission.crewDownBitset & (1 << i)))
+ continue;
+
+ _awayMission.crewGetupTimers[i]--;
+ if (_awayMission.crewGetupTimers[i] <= 0) {
+ Common::String anim = getCrewmanAnimFilename(i, "getu");
+ int8 dir = _awayMission.crewDirectionsAfterWalk[i];
+ char d;
+ if (dir == -1) {
+ d = actor->direction;
+ } else {
+ const char *dirs = "nsew";
+ Fixed8 scale = getActorScaleAtPosition(actor->sprite.pos.y);
+ d = dirs[dir];
+
+ int16 xOffset = 0, yOffset = 0;
+ if (d == 'n') {
+ xOffset = -24;
+ yOffset = -8;
+ } else if (d == 'w') {
+ xOffset = -35;
+ yOffset = -12;
+ }
+ actor->sprite.pos.x += scale.multToInt(xOffset);
+ actor->sprite.pos.y += scale.multToInt(yOffset);
+ }
+
+ anim += (char)d;
+ loadActorAnimWithRoomScaling(i, anim, actor->sprite.pos.x, actor->sprite.pos.y);
+ _awayMission.crewDownBitset &= ~(1 << i);
+ }
+ }
+}
+
+int StarTrekEngine::showInventoryMenu(int x, int y, bool restoreMouse) {
+ const int ITEMS_PER_ROW = 5;
+
+ Common::Point oldMousePos = _gfx->getMousePos();
+ bool keyboardControlledMouse = _keyboardControlsMouse;
+ _keyboardControlsMouse = false;
+
+ int itemIndex = 0;
+ int numItems = 0;
+
+ char itemNames[NUM_OBJECTS][10];
+ Common::Point itemPositions[NUM_OBJECTS];
+ int16 itemIndices[NUM_OBJECTS];
+
+ while (itemIndex < NUM_OBJECTS) {
+ if (_itemList[itemIndex].have) {
+ strcpy(itemNames[numItems], _itemList[itemIndex].name);
+
+ int16 itemX = (numItems % ITEMS_PER_ROW) * 32 + x;
+ int16 itemY = (numItems / ITEMS_PER_ROW) * 32 + y;
+ itemPositions[numItems] = Common::Point(itemX, itemY);
+ itemIndices[numItems] = _itemList[itemIndex].field2;
+
+ numItems++;
+ }
+ itemIndex++;
+ }
+
+ Sprite itemSprites[NUM_OBJECTS];
+
+ for (int i = 0; i < numItems; i++) {
+ _gfx->addSprite(&itemSprites[i]);
+
+ itemSprites[i].drawMode = 2;
+ itemSprites[i].pos.x = itemPositions[i].x;
+ itemSprites[i].pos.y = itemPositions[i].y;
+ itemSprites[i].drawPriority = 15;
+ itemSprites[i].drawPriority2 = 8;
+ itemSprites[i].setBitmap(_gfx->loadBitmap(itemNames[i]));
+ }
+
+ chooseMousePositionFromSprites(itemSprites, numItems, -1, 4);
+ bool displayMenu = true;
+ int lastItemIndex = -1;
+
+ while (displayMenu) {
+ _sound->checkLoopMusic();
+
+ TrekEvent event;
+ if (!getNextEvent(&event))
+ continue;
+
+ switch (event.type) {
+ case TREKEVENT_TICK: {
+ Common::Point mousePos = _gfx->getMousePos();
+ itemIndex = getMenuButtonAt(itemSprites, numItems, mousePos.x, mousePos.y);
+ if (itemIndex != lastItemIndex) {
+ if (lastItemIndex != -1) {
+ drawMenuButtonOutline(itemSprites[lastItemIndex].bitmap, 0);
+ itemSprites[lastItemIndex].bitmapChanged = true;
+ }
+ if (itemIndex != -1) {
+ drawMenuButtonOutline(itemSprites[itemIndex].bitmap, 15);
+ itemSprites[itemIndex].bitmapChanged = true;
+ }
+ lastItemIndex = itemIndex;
+ }
+ _gfx->drawAllSprites();
+ break;
+ }
+
+ case TREKEVENT_LBUTTONDOWN:
+exitWithSelection:
+ displayMenu = false;
+ break;
+
+ case TREKEVENT_RBUTTONDOWN:
+exitWithoutSelection:
+ displayMenu = false;
+ lastItemIndex = -1;
+ break;
+
+ case TREKEVENT_KEYDOWN:
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_ESCAPE:
+ case Common::KEYCODE_F2:
+ goto exitWithoutSelection;
+
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ case Common::KEYCODE_F1:
+ goto exitWithSelection;
+
+ case Common::KEYCODE_HOME:
+ case Common::KEYCODE_KP7:
+ chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 4);
+ break;
+
+ case Common::KEYCODE_UP:
+ case Common::KEYCODE_KP8:
+ case Common::KEYCODE_PAGEUP:
+ case Common::KEYCODE_KP9:
+ chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 2);
+ break;
+
+ case Common::KEYCODE_LEFT:
+ case Common::KEYCODE_KP4:
+ chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 1);
+ break;
+
+ case Common::KEYCODE_RIGHT:
+ case Common::KEYCODE_KP6:
+ chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 0);
+ break;
+
+ case Common::KEYCODE_END:
+ case Common::KEYCODE_KP1:
+ chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 5);
+ break;
+
+ case Common::KEYCODE_DOWN:
+ case Common::KEYCODE_KP2:
+ case Common::KEYCODE_PAGEDOWN:
+ case Common::KEYCODE_KP3:
+ chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 3);
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ removeNextEvent();
+ }
+
+ playSoundEffectIndex(0x10);
+ if (lastItemIndex >= 0)
+ drawMenuButtonOutline(itemSprites[lastItemIndex].bitmap, 0);
+
+ for (int i = 0; i < numItems; i++)
+ itemSprites[i].dontDrawNextFrame();
+
+ _gfx->drawAllSprites();
+
+ for (int i = 0; i < numItems; i++) {
+ itemSprites[i].bitmap.reset();
+ _gfx->delSprite(&itemSprites[i]);
+ }
+
+ if (lastItemIndex >= 0) {
+ lastItemIndex = itemIndices[lastItemIndex];
+ }
+
+ if (restoreMouse)
+ _gfx->warpMouse(oldMousePos.x, oldMousePos.y);
+
+ _keyboardControlsMouse = keyboardControlledMouse;
+ return lastItemIndex;
+}
+
+void StarTrekEngine::initStarfieldSprite(Sprite *sprite, SharedPtr<Bitmap> bitmap, const Common::Rect &rect) {
+ sprite->setXYAndPriority(rect.left, rect.top, 0);
+ sprite->setBitmap(bitmap);
+ bitmap->xoffset = 0;
+ bitmap->yoffset = 0;
+ bitmap->width = rect.width();
+ bitmap->height = rect.height();
+ _gfx->addSprite(sprite);
+ sprite->drawMode = 1;
+}
+
+SharedPtr<Bitmap> StarTrekEngine::scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed8 scale) {
+ int scaledWidth = scale.multToInt(bitmap->width);
+ int scaledHeight = scale.multToInt(bitmap->height);
+ int origWidth = bitmap->width;
+ int origHeight = bitmap->height;
+
+ if (scaledWidth < 1)
+ scaledWidth = 1;
+ if (scaledHeight < 1)
+ scaledHeight = 1;
+
+ SharedPtr<Bitmap> scaledBitmap(new Bitmap(scaledWidth, scaledHeight));
+ scaledBitmap->xoffset = scale.multToInt(bitmap->xoffset);
+ scaledBitmap->yoffset = scale.multToInt(bitmap->yoffset);
+
+ // sub_344a5(scaledWidth, origWidth);
+
+ origHeight--;
+ scaledHeight--;
+
+ byte *src = bitmap->pixels;
+ byte *dest = scaledBitmap->pixels;
+
+ if (scale <= 1.0) {
+ int16 var2e = 0;
+ uint16 var30 = scaledHeight << 1;
+ uint16 var32 = (scaledHeight - origHeight) << 1;
+ uint16 origRow = 0;
+
+ while (origRow <= origHeight) {
+ if (var2e < 0) {
+ var2e += var30;
+ } else {
+ var2e += var32;
+ scaleBitmapRow(src, dest, origWidth, scaledWidth);
+ dest += scaledWidth;
+ }
+
+ src += bitmap->width;
+ origRow++;
+ }
+ } else {
+ int16 var2e = (origHeight << 1) - scaledHeight;
+ uint16 var30 = origHeight << 1;
+ uint16 var32 = (origHeight - scaledHeight) << 1;
+ uint16 srcRowChanged = true;
+ origWidth = bitmap->width;
+ uint16 scaledRow = 0;
+ byte *rowData = new byte[scaledWidth];
+
+ while (scaledRow++ <= scaledHeight) {
+ if (srcRowChanged) {
+ scaleBitmapRow(src, rowData, origWidth, scaledWidth);
+ srcRowChanged = false;
+ }
+
+ memcpy(dest, rowData, scaledWidth);
+ dest += scaledWidth;
+
+ if (var2e < 0) {
+ var2e += var30;
+ } else {
+ var2e += var32;
+ src += origWidth;
+ srcRowChanged = true;
+ }
+ }
+
+ delete[] rowData;
+ }
+
+ return scaledBitmap;
+}
+
+void StarTrekEngine::scaleBitmapRow(byte *src, byte *dest, uint16 origWidth, uint16 scaledWidth) {
+ if (origWidth >= scaledWidth) {
+ int16 var2 = (scaledWidth << 1) - origWidth;
+ uint16 var4 = scaledWidth << 1;
+ uint16 var6 = (scaledWidth - origWidth) << 1;
+ uint16 varE = 0;
+ uint16 varA = 0;
+ uint16 var8 = origWidth;
+ uint16 di = 0;
+
+ while (var8-- != 0) {
+ if (var2 < 0) {
+ var2 += var4;
+ } else {
+ var2 += var6;
+ if (di != 0) {
+ if (varE != 0) {
+ *(dest - 1) = *src++;
+ varE = 0;
+ di--;
+ }
+ src += di;
+ di = 0;
+ }
+ *dest++ = *src;
+ varE = 1;
+ }
+
+ di++;
+ varA++;
+ }
+ } else {
+ int16 var2 = ((origWidth - 1) << 1) - (scaledWidth - 1);
+ uint16 var4 = (origWidth - 1) << 1;
+ uint16 var6 = ((origWidth - 1) - (scaledWidth - 1)) << 1;
+ uint16 varA = 0;
+ uint16 var8 = scaledWidth;
+ uint16 di = 0;
+
+ while (var8-- != 0) {
+ if (di != 0) {
+ src += di;
+ di = 0;
+ }
+ *dest++ = *src;
+
+ if (var2 < 0)
+ var2 += var4;
+ else {
+ var2 += var6;
+ di++;
+ }
+
+ varA++;
+ }
+ }
+}
+
+} // End of namespace StarTrek
diff --git a/engines/startrek/intro.cpp b/engines/startrek/intro.cpp
new file mode 100644
index 0000000..8d17fc4
--- /dev/null
+++ b/engines/startrek/intro.cpp
@@ -0,0 +1,240 @@
+/* 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 "startrek/startrek.h"
+
+namespace StarTrek {
+
+void StarTrekEngine::playIntro() {
+ // TODO: .MT audio file
+
+ initStarfieldPosition();
+ initStarfield(10, 20, 309, 169, 128);
+
+ SharedPtr<Bitmap> fakeStarfieldBitmap(new StubBitmap(0, 0));
+ _starfieldSprite.bitmap = fakeStarfieldBitmap;
+ initStarfieldSprite(&_starfieldSprite, fakeStarfieldBitmap, _starfieldRect);
+
+ //delR3(&_enterpriseR3); // TODO: uncomment
+
+ R3 planetR3 = R3();
+ planetR3.matrix = initMatrix();
+ planetR3.field1e = 3;
+ planetR3.funcPtr1 = nullptr;
+ planetR3.funcPtr2 = nullptr;
+ planetR3.bitmapOffset = 0;
+
+ _gfx->clearScreenAndPriBuffer();
+ _gfx->fadeoutScreen();
+ _gfx->loadPalette("gold");
+ _gfx->setBackgroundImage(_gfx->loadBitmap("goldlogo"));
+ _sound->playVoc("logo");
+ _gfx->copyBackgroundScreen();
+ _system->updateScreen();
+ _gfx->fadeinScreen();
+
+ uint32 clockTicks = _clockTicks;
+
+ Sprite subtitleSprite;
+ _gfx->addSprite(&subtitleSprite);
+ subtitleSprite.setXYAndPriority(0, 0, 12);
+ subtitleSprite.bitmap = _gfx->loadBitmap("blank");
+ subtitleSprite.drawPriority2 = 16;
+
+ int index = 12;
+ while (index >= 0) {
+ Common::String file = Common::String::format("credit%02d.shp", index);
+ // TODO: This loads the file, but does not do anything with the resulting data, so
+ // this is just for caching it?
+ // Remember to deal with similar commented function calls below, too.
+ //loadFileWithParams(file, false, true, false);
+ index -= 1;
+ }
+
+ //loadFileWithParams("legal.bmp", false, true, false);
+
+ index = 6;
+ while (index >= 0) {
+ Common::String file = Common::String::format("tittxt%02d.bmp", index);
+ //loadFileWithParams(file, false, true, false);
+ index -= 1;
+ }
+
+ //loadFileWithParams("planet.shp", false, true, false);
+
+ index = 6;
+ while (index >= 0) {
+ Common::String file = Common::String::format("ent%d3.r3s", index);
+ //loadFileWithParams(file, false, true, false);
+ index -= 1;
+ }
+
+ // TODO: kirkintr
+
+ clockTicks += 540;
+
+ while (_clockTicks < clockTicks && _sound->isMidiPlaying()) {
+ waitForNextTick(true);
+ }
+
+ // TODO: MT audio file
+
+ _gfx->fadeoutScreen();
+ _gfx->loadPalette("bridge");
+ _gfx->clearScreenAndPriBuffer();
+ _sound->loadMusicFile("title");
+ clockTicks = _clockTicks;
+
+ int32 starfieldZoomSpeed;
+ int16 frame = 0;
+ bool buttonPressed = false;
+
+ while (frame != 0x180 || (_sound->isMidiPlaying() && !buttonPressed)) {
+ if (!buttonPressed) {
+ TrekEvent event;
+ while (popNextEvent(&event, false)) {
+ if (event.type == TREKEVENT_KEYDOWN) {
+ _gfx->fadeoutScreen();
+ buttonPressed = true;
+ } else if (event.type == TREKEVENT_TICK)
+ break;
+ }
+ }
+
+ switch (frame) {
+ case 0:
+ starfieldZoomSpeed = 10;
+ playMidiMusicTracks(MIDITRACK_0, -1);
+ _byte_45b3c = 0;
+ break;
+
+ case 30:
+ _sound->playVoc("kirkintr");
+ loadSubtitleSprite(0, &subtitleSprite);
+ break;
+
+ case 36:
+ loadSubtitleSprite(1, &subtitleSprite);
+ break;
+
+ case 42: // Enterprise moves toward camera
+ loadSubtitleSprite(-1, &subtitleSprite);
+ addR3(&_enterpriseR3);
+ _enterpriseR3.field1e = 2;
+ initIntroR3ObjectToMove(&_enterpriseR3, 330, 5000, 0, 0, 18);
+ break;
+
+ case 60: // Enterprise moves away from camera
+ initIntroR3ObjectToMove(&_enterpriseR3, 0, 0, 30, 5000, 6);
+ break;
+
+ case 66: // Cut to scene with planet
+ loadSubtitleSprite(2, &subtitleSprite);
+ planetR3.field22 = 2000;
+ planetR3.field24 = 10000 / _starfieldPointDivisor;
+ planetR3.shpFile = loadFile("planet.shp");
+ initIntroR3ObjectToMove(&planetR3, 6, 10000, 6, 10000, 0);
+ addR3(&planetR3);
+ initIntroR3ObjectToMove(&_enterpriseR3, -15, 250, 15, 500, 18);
+ starfieldZoomSpeed = 0;
+ break;
+
+ case 186:
+ delR3(&_enterpriseR3);
+ // TODO: the rest
+ break;
+
+ case 366:
+ planetR3.shpFile.reset();
+ delR3(&planetR3);
+ break;
+
+ case 378:
+ _gfx->delSprite(&subtitleSprite);
+ _byte_45b3c = 1;
+ break;
+ }
+
+ if (!buttonPressed) {
+ updateStarfieldAndShips(false);
+ _gfx->drawAllSprites();
+ _gfx->incPaletteFadeLevel();
+ clockTicks += 3;
+
+ while (_clockTicks < clockTicks)
+ waitForNextTick();
+ }
+
+ _starfieldPosition.z += starfieldZoomSpeed;
+
+ frame++;
+ if (frame >= 0x186)
+ frame = 0x186;
+ }
+
+ _gfx->fadeoutScreen();
+ _gfx->delSprite(&_starfieldSprite);
+ // TODO: the rest
+}
+
+void StarTrekEngine::initIntroR3ObjectToMove(R3 *r3, int16 srcAngle, int16 srcDepth, int16 destAngle, int16 destDepth, int16 ticks) {
+ Fixed8 a1 = Fixed8::fromRaw((srcAngle << 8) / 90);
+ Fixed8 a2 = Fixed8::fromRaw((destAngle << 8) / 90);
+
+ r3->pos.x = sin(a1).multToInt(srcDepth) + _starfieldPosition.x;
+ r3->pos.z = cos(a1).multToInt(srcDepth) + _starfieldPosition.z;
+ r3->pos.y = 0;
+
+ int32 deltaX = sin(a2).multToInt(destDepth) + _starfieldPosition.x - r3->pos.x;
+ int32 deltaZ = cos(a2).multToInt(destDepth) + _starfieldPosition.z - r3->pos.z;
+ debug("Z: %d, %d", r3->pos.z - _starfieldPosition.z, cos(a2).multToInt(destDepth));
+
+ Angle angle = atan2(deltaX, deltaZ);
+ r3->matrix = initSpeedMatrixForXZMovement(angle, initMatrix());
+
+ debugCN(5, kDebugSpace, "initIntroR3ObjectToMove: pos %x,%x,%x; ", r3->pos.x, r3->pos.y, r3->pos.z);
+
+ if (ticks != 0) {
+ debugC(5, kDebugSpace, "speed %x,%x,%x\n", r3->speed.x, r3->speed.y, r3->speed.z);
+ r3->speed.x = deltaX / ticks;
+ r3->speed.z = deltaZ / ticks;
+ r3->speed.y = 0;
+ } else {
+ debugC(5, kDebugSpace, "speed 0\n");
+ r3->speed.x = 0;
+ r3->speed.z = 0;
+ r3->speed.y = 0;
+ }
+}
+
+void StarTrekEngine::loadSubtitleSprite(int index, Sprite *sprite) {
+ if (_showSubtitles) {
+ if (index == -1)
+ sprite->setBitmap(_gfx->loadBitmap("blank"));
+ else {
+ Common::String file = Common::String::format("tittxt%02d", index);
+ sprite->setBitmap(_gfx->loadBitmap(file));
+ }
+ }
+}
+
+} // End of namespace StarTrek
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index eebaad5..20529e1 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -1,6 +1,7 @@
MODULE := engines/startrek
MODULE_OBJS = \
+ actors.o \
awaymission.o \
bitmap.o \
common.o \
@@ -9,6 +10,7 @@ MODULE_OBJS = \
filestream.o \
font.o \
graphics.o \
+ intro.o \
iwfile.o \
lzss.o \
math.o \
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index b696074..cea59a4 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -240,219 +240,6 @@ Common::Error StarTrekEngine::runGameMode(int mode, bool resume) {
return Common::kNoError;
}
-void StarTrekEngine::playIntro() {
- // TODO: .MT audio file
-
- initStarfieldPosition();
- initStarfield(10, 20, 309, 169, 128);
-
- SharedPtr<Bitmap> fakeStarfieldBitmap(new StubBitmap(0, 0));
- _starfieldSprite.bitmap = fakeStarfieldBitmap;
- initStarfieldSprite(&_starfieldSprite, fakeStarfieldBitmap, _starfieldRect);
-
- //delR3(&_enterpriseR3); // TODO: uncomment
-
- R3 planetR3 = R3();
- planetR3.matrix = initMatrix();
- planetR3.field1e = 3;
- planetR3.funcPtr1 = nullptr;
- planetR3.funcPtr2 = nullptr;
- planetR3.bitmapOffset = 0;
-
- _gfx->clearScreenAndPriBuffer();
- _gfx->fadeoutScreen();
- _gfx->loadPalette("gold");
- _gfx->setBackgroundImage(_gfx->loadBitmap("goldlogo"));
- _sound->playVoc("logo");
- _gfx->copyBackgroundScreen();
- _system->updateScreen();
- _gfx->fadeinScreen();
-
- uint32 clockTicks = _clockTicks;
-
- Sprite subtitleSprite;
- _gfx->addSprite(&subtitleSprite);
- subtitleSprite.setXYAndPriority(0, 0, 12);
- subtitleSprite.bitmap = _gfx->loadBitmap("blank");
- subtitleSprite.drawPriority2 = 16;
-
- int index = 12;
- while (index >= 0) {
- Common::String file = Common::String::format("credit%02d.shp", index);
- // TODO: This loads the file, but does not do anything with the resulting data, so
- // this is just for caching it?
- // Remember to deal with similar commented function calls below, too.
- //loadFileWithParams(file, false, true, false);
- index -= 1;
- }
-
- //loadFileWithParams("legal.bmp", false, true, false);
-
- index = 6;
- while (index >= 0) {
- Common::String file = Common::String::format("tittxt%02d.bmp", index);
- //loadFileWithParams(file, false, true, false);
- index -= 1;
- }
-
- //loadFileWithParams("planet.shp", false, true, false);
-
- index = 6;
- while (index >= 0) {
- Common::String file = Common::String::format("ent%d3.r3s", index);
- //loadFileWithParams(file, false, true, false);
- index -= 1;
- }
-
- // TODO: kirkintr
-
- clockTicks += 540;
-
- while (_clockTicks < clockTicks && _sound->isMidiPlaying()) {
- waitForNextTick(true);
- }
-
- // TODO: MT audio file
-
- _gfx->fadeoutScreen();
- _gfx->loadPalette("bridge");
- _gfx->clearScreenAndPriBuffer();
- _sound->loadMusicFile("title");
- clockTicks = _clockTicks;
-
- int32 starfieldZoomSpeed;
- int16 frame = 0;
- bool buttonPressed = false;
-
- while (frame != 0x180 || (_sound->isMidiPlaying() && !buttonPressed)) {
- if (!buttonPressed) {
- TrekEvent event;
- while (popNextEvent(&event, false)) {
- if (event.type == TREKEVENT_KEYDOWN) {
- _gfx->fadeoutScreen();
- buttonPressed = true;
- } else if (event.type == TREKEVENT_TICK)
- break;
- }
- }
-
- switch (frame) {
- case 0:
- starfieldZoomSpeed = 10;
- playMidiMusicTracks(MIDITRACK_0, -1);
- _byte_45b3c = 0;
- break;
-
- case 30:
- _sound->playVoc("kirkintr");
- loadSubtitleSprite(0, &subtitleSprite);
- break;
-
- case 36:
- loadSubtitleSprite(1, &subtitleSprite);
- break;
-
- case 42: // Enterprise moves toward camera
- loadSubtitleSprite(-1, &subtitleSprite);
- addR3(&_enterpriseR3);
- _enterpriseR3.field1e = 2;
- initIntroR3ObjectToMove(&_enterpriseR3, 330, 5000, 0, 0, 18);
- break;
-
- case 60: // Enterprise moves away from camera
- initIntroR3ObjectToMove(&_enterpriseR3, 0, 0, 30, 5000, 6);
- break;
-
- case 66: // Cut to scene with planet
- loadSubtitleSprite(2, &subtitleSprite);
- planetR3.field22 = 2000;
- planetR3.field24 = 10000 / _starfieldPointDivisor;
- planetR3.shpFile = loadFile("planet.shp");
- initIntroR3ObjectToMove(&planetR3, 6, 10000, 6, 10000, 0);
- addR3(&planetR3);
- initIntroR3ObjectToMove(&_enterpriseR3, -15, 250, 15, 500, 18);
- starfieldZoomSpeed = 0;
- break;
-
- case 186:
- delR3(&_enterpriseR3);
- // TODO: the rest
- break;
-
- case 366:
- planetR3.shpFile.reset();
- delR3(&planetR3);
- break;
-
- case 378:
- _gfx->delSprite(&subtitleSprite);
- _byte_45b3c = 1;
- break;
- }
-
- if (!buttonPressed) {
- updateStarfieldAndShips(false);
- _gfx->drawAllSprites();
- _gfx->incPaletteFadeLevel();
- clockTicks += 3;
-
- while (_clockTicks < clockTicks)
- waitForNextTick();
- }
-
- _starfieldPosition.z += starfieldZoomSpeed;
-
- frame++;
- if (frame >= 0x186)
- frame = 0x186;
- }
-
- _gfx->fadeoutScreen();
- _gfx->delSprite(&_starfieldSprite);
- // TODO: the rest
-}
-
-void StarTrekEngine::initIntroR3ObjectToMove(R3 *r3, int16 srcAngle, int16 srcDepth, int16 destAngle, int16 destDepth, int16 ticks) {
- Fixed8 a1 = Fixed8::fromRaw((srcAngle << 8) / 90);
- Fixed8 a2 = Fixed8::fromRaw((destAngle << 8) / 90);
-
- r3->pos.x = sin(a1).multToInt(srcDepth) + _starfieldPosition.x;
- r3->pos.z = cos(a1).multToInt(srcDepth) + _starfieldPosition.z;
- r3->pos.y = 0;
-
- int32 deltaX = sin(a2).multToInt(destDepth) + _starfieldPosition.x - r3->pos.x;
- int32 deltaZ = cos(a2).multToInt(destDepth) + _starfieldPosition.z - r3->pos.z;
- debug("Z: %d, %d", r3->pos.z - _starfieldPosition.z, cos(a2).multToInt(destDepth));
-
- Angle angle = atan2(deltaX, deltaZ);
- r3->matrix = initSpeedMatrixForXZMovement(angle, initMatrix());
-
- debugCN(5, kDebugSpace, "initIntroR3ObjectToMove: pos %x,%x,%x; ", r3->pos.x, r3->pos.y, r3->pos.z);
-
- if (ticks != 0) {
- debugC(5, kDebugSpace, "speed %x,%x,%x\n", r3->speed.x, r3->speed.y, r3->speed.z);
- r3->speed.x = deltaX / ticks;
- r3->speed.z = deltaZ / ticks;
- r3->speed.y = 0;
- } else {
- debugC(5, kDebugSpace, "speed 0\n");
- r3->speed.x = 0;
- r3->speed.z = 0;
- r3->speed.y = 0;
- }
-}
-
-void StarTrekEngine::loadSubtitleSprite(int index, Sprite *sprite) {
- if (_showSubtitles) {
- if (index == -1)
- sprite->setBitmap(_gfx->loadBitmap("blank"));
- else {
- Common::String file = Common::String::format("tittxt%02d", index);
- sprite->setBitmap(_gfx->loadBitmap(file));
- }
- }
-}
-
void StarTrekEngine::runTransportSequence(const Common::String &name) {
const uint16 crewmanTransportPositions[][2] = {
{ 0x8e, 0x7c },
@@ -579,6 +366,7 @@ void StarTrekEngine::playSoundEffectIndex(int index) {
_sound->playVoc("WARP");
break;
default:
+ debugC(kDebugSound, 6, "Unmapped sound 0x%x", index);
break;
}
}
@@ -596,1399 +384,6 @@ void StarTrekEngine::stopPlayingSpeech() {
_sound->stopPlayingSpeech();
}
-void StarTrekEngine::initActors() {
- for (int i = 0; i < NUM_ACTORS; i++)
- _actorList[i] = Actor();
- for (int i = 0; i < MAX_BAN_FILES; i++)
- _banFiles[i].reset();
-
- strcpy(_kirkActor->animationString, "kstnd");
- strcpy(_spockActor->animationString, "sstnd");
- strcpy(_mccoyActor->animationString, "mstnd");
- strcpy(_redshirtActor->animationString, "rstnd");
-}
-
-int StarTrekEngine::loadActorAnim(int actorIndex, const Common::String &animName, int16 x, int16 y, Fixed8 scale) {
- debugC(6, kDebugGraphics, "Load animation '%s' on actor %d", animName.c_str(), actorIndex);
-
- Actor *actor;
-
- if (actorIndex == -1) {
- // TODO
- warning("loadActorAnim: actor == -1");
- } else
- actor = &_actorList[actorIndex];
-
- if (actor->spriteDrawn) {
- releaseAnim(actor);
- drawActorToScreen(actor, animName, x, y, scale, false);
- } else {
- drawActorToScreen(actor, animName, x, y, scale, true);
- }
-
- actor->triggerActionWhenAnimFinished = false;
- actor->finishedAnimActionParam = 0;
-
- return actorIndex;
-}
-
-void StarTrekEngine::loadBanFile(const Common::String &name) {
- debugC(kDebugGeneral, 7, "Load BAN file: %s.ban", name.c_str());
- for (int i = 0; i < MAX_BAN_FILES; i++) {
- if (!_banFiles[i]) {
- _banFiles[i] = loadFile(name + ".ban");
- _banFileOffsets[i] = 0;
- return;
- }
- }
-
- warning("Couldn't load .BAN file \"%s.ban\"", name.c_str());
-}
-
-bool StarTrekEngine::actorWalkToPosition(int actorIndex, const Common::String &animFile, int16 srcX, int16 srcY, int16 destX, int16 destY) {
- debugC(6, "Obj %d: walk from (%d,%d) to (%d,%d)", actorIndex, srcX, srcY, destX, destY);
-
- Actor *actor = &_actorList[actorIndex];
-
- actor->triggerActionWhenAnimFinished = false;
- if (isPositionSolid(destX, destY))
- return false;
-
- if (actor->spriteDrawn)
- releaseAnim(actor);
- else
- _gfx->addSprite(&actor->sprite);
-
- actor->spriteDrawn = true;
- actor->animType = 1;
- actor->frameToStartNextAnim = _frameIndex + 1;
- strcpy(actor->animationString2, animFile.c_str());
-
- actor->dest.x = destX;
- actor->dest.y = destY;
- actor->field92 = 0;
- actor->triggerActionWhenAnimFinished = false;
-
- actor->iwDestPosition = -1;
- actor->iwSrcPosition = -1;
-
- if (directPathExists(srcX, srcY, destX, destY)) {
- chooseActorDirectionForWalking(actor, srcX, srcY, destX, destY);
- updateActorPositionWhileWalking(actor, (actor->granularPosX + 0.5).toInt(), (actor->granularPosY + 0.5).toInt());
- return true;
- } else {
- actor->iwSrcPosition = _iwFile->getClosestKeyPosition(srcX, srcY);
- actor->iwDestPosition = _iwFile->getClosestKeyPosition(destX, destY);
-
- if (actor->iwSrcPosition == -1 || actor->iwDestPosition == -1) {
- // No path exists; face south by default.
- strcat(actor->animationString2, "S");
- actor->direction = 'S';
-
- updateActorPositionWhileWalking(actor, srcX, srcY);
- initStandAnim(actorIndex);
-
- return false;
- } else {
- Common::Point iwSrc = _iwFile->_keyPositions[actor->iwSrcPosition];
- chooseActorDirectionForWalking(actor, srcX, srcY, iwSrc.x, iwSrc.y);
- updateActorPositionWhileWalking(actor, (actor->granularPosX + 0.5).toInt(), (actor->granularPosY + 0.5).toInt());
- return true;
- }
- }
-}
-
-void StarTrekEngine::updateActorAnimations() {
- for (int i = 0; i < NUM_ACTORS; i++) {
- Actor *actor = &_actorList[i];
- if (!actor->spriteDrawn)
- continue;
-
- switch (actor->animType) {
- case 0: // Not walking?
- case 2:
- if (_frameIndex >= actor->frameToStartNextAnim) {
- int nextAnimIndex = getRandomWord() & 3;
- actor->animFile->seek(18 + nextAnimIndex + actor->animFrame * 22, SEEK_SET);
- byte nextAnimFrame = actor->animFile->readByte();
-
- if (actor->animFrame != nextAnimFrame) {
- if (nextAnimFrame == actor->numAnimFrames - 1) {
- actor->field62++;
- if (actor->triggerActionWhenAnimFinished) {
- addAction(ACTION_FINISHED_ANIMATION, actor->finishedAnimActionParam, 0, 0);
- }
- }
- }
-
- actor->animFrame = nextAnimFrame;
- if (actor->animFrame >= actor->numAnimFrames) {
- if (actor->animationString[0] == '\0')
- removeActorFromScreen(i);
- else
- initStandAnim(i);
- } else {
- Sprite *sprite = &actor->sprite;
-
- actor->animFile->seek(actor->animFrame * 22, SEEK_SET);
- char animFrameFilename[16];
- actor->animFile->read(animFrameFilename, 16);
- sprite->setBitmap(loadAnimationFrame(animFrameFilename, actor->scale));
-
- memset(actor->bitmapFilename, 0, 10);
- strncpy(actor->bitmapFilename, animFrameFilename, 9);
-
- actor->animFile->seek(10 + actor->animFrame * 22, SEEK_SET);
- uint16 xOffset = actor->animFile->readUint16();
- uint16 yOffset = actor->animFile->readUint16();
- uint16 basePriority = actor->animFile->readUint16();
- uint16 frames = actor->animFile->readUint16();
-
- sprite->pos.x = xOffset + actor->pos.x;
- sprite->pos.y = yOffset + actor->pos.y;
- sprite->drawPriority = _gfx->getPriValue(0, yOffset + actor->pos.y) + basePriority;
- sprite->bitmapChanged = true;
-
- actor->frameToStartNextAnim = frames + _frameIndex;
- }
- }
- break;
- case 1: // Walking
- if (_frameIndex < actor->frameToStartNextAnim)
- break;
- if (i == 0) // Kirk only
- checkTouchedLoadingZone(actor->pos.x, actor->pos.y);
- if (actor->field90 != 0) {
- Sprite *sprite = &actor->sprite;
- int loops;
- if (getActorScaleAtPosition((actor->granularPosY + 0.5).toInt()) < 0.625)
- loops = 1;
- else
- loops = 2;
- for (int k = 0; k < loops; k++) {
- if (actor->field90 == 0)
- break;
- actor->field90--;
- Fixed16 newX = actor->granularPosX + actor->speedX;
- Fixed16 newY = actor->granularPosY + actor->speedY;
- if ((actor->field90 & 3) == 0) {
- sprite->bitmap.reset();
- updateActorPositionWhileWalking(actor, (newX + 0.5).toInt(), (newY + 0.5).toInt());
- actor->field92++;
- }
-
- actor->granularPosX = newX;
- actor->granularPosY = newY;
- actor->frameToStartNextAnim = _frameIndex;
- }
- } else { // actor->field90 == 0
- if (actor->iwSrcPosition == -1) {
- if (actor->triggerActionWhenAnimFinished) {
- actor->triggerActionWhenAnimFinished = false;
- addAction(ACTION_FINISHED_WALKING, actor->finishedAnimActionParam & 0xff, 0, 0);
- }
-
- actor->sprite.bitmap.reset();
- updateActorPositionWhileWalking(actor, (actor->granularPosX + 0.5).toInt(), (actor->granularPosY + 0.5).toInt());
- initStandAnim(i);
- } else { // actor->iwSrcPosition != -1
- if (actor->iwSrcPosition == actor->iwDestPosition) {
- actor->animationString2[strlen(actor->animationString2) - 1] = '\0';
- actor->iwDestPosition = -1;
- actor->iwSrcPosition = -1;
- chooseActorDirectionForWalking(actor, actor->pos.x, actor->pos.y, actor->dest.x, actor->dest.y);
- } else {
- int index = _iwFile->_iwEntries[actor->iwSrcPosition][actor->iwDestPosition];
- actor->iwSrcPosition = index;
- Common::Point dest = _iwFile->_keyPositions[actor->iwSrcPosition];
- actor->animationString2[strlen(actor->animationString2) - 1] = '\0';
- chooseActorDirectionForWalking(actor, actor->pos.x, actor->pos.y, dest.x, dest.y);
- }
- }
- }
- break;
- default:
- error("Invalid anim type.");
- break;
- }
- }
-}
-
-void StarTrekEngine::renderBanBelowSprites() {
- if ((_frameIndex & 3) != 0)
- return;
-
- byte *screenPixels = _gfx->lockScreenPixels();
- byte *bgPixels = _gfx->getBackgroundPixels();
-
- for (int i = 0; i < MAX_BAN_FILES; i++) {
- if (!_banFiles[i])
- continue;
-
- // TODO: video modes other than VGA
-
- _banFiles[i]->seek(_banFileOffsets[i], SEEK_SET);
- uint16 offset = _banFiles[i]->readUint16();
-
- if (offset == 0xffff) {
- _banFileOffsets[i] = 0;
- _banFiles[i]->seek(0, SEEK_SET);
- offset = _banFiles[i]->readSint16();
- }
-
- int16 size = _banFiles[i]->readSint16();
- if (size != 0) {
- _banFiles[i]->seek(_banFileOffsets[i], SEEK_SET);
- renderBan(screenPixels, _banFiles[i]);
-
- _banFiles[i]->seek(_banFileOffsets[i], SEEK_SET);
- renderBan(bgPixels, _banFiles[i]);
- //sub_10e51(_gfx->getBackgroundPixels(), _banFiles[i]);
- }
-
- }
-
- _gfx->unlockScreenPixels();
-}
-
-void StarTrekEngine::renderBan(byte *destPixels, SharedPtr<FileStream> banFile) {
- uint16 offset = banFile->readUint16();
- int32 size = banFile->readUint16();
-
- byte *dest = destPixels + offset;
-
- // Skip 8 bytes (rectangle encompassing the area being drawn to)
- banFile->readSint32();
- banFile->readSint32();
-
- while (--size >= 0) {
- assert(dest >= destPixels && dest < destPixels + SCREEN_WIDTH * SCREEN_HEIGHT);
- int8 b = banFile->readByte();
-
- if (b == -128) // Add value to destination (usually jumping to next row)
- dest += banFile->readUint16();
- else if (b < 0) { // Repeated byte
- byte c = banFile->readByte();
- if (c == 0)
- dest += (-b) + 1;
- else {
- for (int j = 0; j < (-b) + 1; j++)
- (*dest++) = c;
- }
- } else { // List of bytes
- b++;
- while (b-- != 0) {
- byte c = banFile->readByte();
- if (c == 0)
- dest++;
- else
- *(dest++) = c;
- }
- }
- }
-}
-
-void StarTrekEngine::renderBanAboveSprites() {
- if ((_frameIndex & 3) != 0)
- return;
-
- for (int i = 0; i < MAX_BAN_FILES; i++) {
- if (!_banFiles[i])
- continue;
-
- _banFiles[i]->seek(_banFileOffsets[i], SEEK_SET);
- uint16 offset = _banFiles[i]->readUint16();
-
- if (offset == 0xffff) {
- _banFileOffsets[i] = 0;
- _banFiles[i]->seek(0, SEEK_SET);
- offset = _banFiles[i]->readSint16();
- }
-
- int16 size = _banFiles[i]->readSint16();
- if (size != 0) {
- Common::Rect rect;
- rect.left = _banFiles[i]->readSint16();
- rect.top = _banFiles[i]->readSint16();
- rect.right = _banFiles[i]->readSint16() + 1;
- rect.bottom = _banFiles[i]->readSint16() + 1;
-
- // Draw all sprites in this rectangle to a custom surface, and only update the
- // specific pixels that were updated by the BAN file this frame.
- // Rationale behind this is that, since the background may not have been
- // redrawn, the transparent sprites (ie. textboxes) would further darken any
- // pixels behind them that haven't been updated this frame. So, we can't just
- // update everything in this rectangle.
- // FIXME: This copies the entire screen surface for temporary drawing, which
- // is somewhat wasteful. Original game had one more graphics layer it drew to
- // before the screen was updated...
- ::Graphics::Surface surface;
- _gfx->drawAllSpritesInRectToSurface(rect, &surface);
-
- byte *destPixels = _gfx->lockScreenPixels();
- byte *src = (byte *)surface.getPixels() + offset;
- byte *dest = destPixels + offset;
-
- // This is similar to renderBan(), except it copies pixels from the surface
- // above instead of drawing directly to it. (Important since sprites may be
- // drawn on top.)
- while (--size >= 0) {
- assert(dest >= destPixels && dest < destPixels + SCREEN_WIDTH * SCREEN_HEIGHT);
- int8 b = _banFiles[i]->readByte();
- if (b == -128) {
- uint16 skip = _banFiles[i]->readUint16();
- dest += skip;
- src += skip;
- } else if (b < 0) {
- byte c = _banFiles[i]->readByte();
- if (c == 0) {
- dest += (-b) + 1;
- src += (-b) + 1;
- }
- else {
- for (int j = 0; j < (-b) + 1; j++)
- *(dest++) = *(src++);
- }
- } else {
- b++;
- while (b-- != 0) {
- byte c = _banFiles[i]->readByte();
- if (c == 0) {
- dest++;
- src++;
- } else
- *(dest++) = *(src++);
- }
- }
- }
-
- _gfx->unlockScreenPixels();
- surface.free();
-
- _banFileOffsets[i] = _banFiles[i]->pos();
- }
- }
-}
-
-void StarTrekEngine::removeActorFromScreen(int actorIndex) {
- Actor *actor = &_actorList[actorIndex];
-
- if (actor->spriteDrawn != 1)
- return;
-
- debugC(6, kDebugGraphics, "Stop drawing actor %d", actorIndex);
-
- Sprite *sprite = &actor->sprite;
- sprite->field16 = true;
- sprite->bitmapChanged = true;
- _gfx->drawAllSprites();
- _gfx->delSprite(sprite);
- releaseAnim(actor);
-}
-
-void StarTrekEngine::actorFunc1() {
- for (int i = 0; i < NUM_ACTORS; i++) {
- if (_actorList[i].spriteDrawn == 1) {
- removeActorFromScreen(i);
- }
- }
-
- for (int i = 0; i < MAX_BAN_FILES; i++) {
- _banFiles[i].reset();
- }
-}
-
-void StarTrekEngine::drawActorToScreen(Actor *actor, const Common::String &_animName, int16 x, int16 y, Fixed8 scale, bool addSprite) {
- Common::String animFilename = _animName;
- if (_animName.hasPrefixIgnoreCase("stnd") /* && word_45d20 == -1 */) // TODO
- animFilename += 'j';
- memcpy(actor->animFilename, _animName.c_str(), sizeof(actor->animFilename));
-
- actor->animType = 2;
- actor->animFile = loadFile(animFilename + ".anm");
- actor->numAnimFrames = actor->animFile->size() / 22;
- actor->animFrame = 0;
- actor->pos.x = x;
- actor->pos.y = y;
- actor->field62 = 0;
- actor->scale = scale;
-
- actor->animFile->seek(16, SEEK_SET);
- actor->frameToStartNextAnim = actor->animFile->readUint16() + _frameIndex;
-
- char firstFrameFilename[11];
- actor->animFile->seek(0, SEEK_SET);
- actor->animFile->read(firstFrameFilename, 10);
- firstFrameFilename[10] = '\0';
-
- Sprite *sprite = &actor->sprite;
- if (addSprite)
- _gfx->addSprite(sprite);
-
- sprite->setBitmap(loadAnimationFrame(firstFrameFilename, scale));
- memset(actor->bitmapFilename, 0, sizeof(char) * 10);
- strncpy(actor->bitmapFilename, firstFrameFilename, sizeof(char) * 9);
-
- actor->scale = scale;
-
- actor->animFile->seek(10, SEEK_SET);
- uint16 xOffset = actor->animFile->readUint16();
- uint16 yOffset = actor->animFile->readUint16();
- uint16 basePriority = actor->animFile->readUint16();
-
- sprite->pos.x = xOffset + actor->pos.x;
- sprite->pos.y = yOffset + actor->pos.y;
- sprite->drawPriority = _gfx->getPriValue(0, yOffset + actor->pos.y) + basePriority;
- sprite->bitmapChanged = true;
-
- actor->spriteDrawn = 1;
-}
-
-void StarTrekEngine::releaseAnim(Actor *actor) {
- switch (actor->animType) {
- case 0:
- case 2:
- actor->sprite.bitmap.reset();
- actor->animFile.reset();
- break;
- case 1:
- actor->sprite.bitmap.reset();
- break;
- default:
- error("Invalid anim type");
- break;
- }
-
- actor->spriteDrawn = 0;
-}
-
-void StarTrekEngine::initStandAnim(int actorIndex) {
- Actor *actor = &_actorList[actorIndex];
-
- if (!actor->spriteDrawn)
- error("initStandAnim: dead anim");
-
- ////////////////////
- // sub_239d2
- const char *directions = "nsew";
-
- if (actorIndex >= 0 && actorIndex <= 3) {
- int8 dir = _awayMission.crewDirectionsAfterWalk[actorIndex];
- if (dir != -1) {
- actor->direction = directions[dir];
- _awayMission.crewDirectionsAfterWalk[actorIndex] = -1;
- }
- }
- // end of sub_239d2
- ////////////////////
-
- Common::String animName;
- if (actor->direction != 0)
- animName = Common::String(actor->animationString) + (char)actor->direction;
- else // Default to facing south
- animName = Common::String(actor->animationString) + 's';
-
- Fixed8 scale = getActorScaleAtPosition(actor->pos.y);
- loadActorAnim(actorIndex, animName, actor->pos.x, actor->pos.y, scale);
- actor->animType = 0;
-}
-
-void StarTrekEngine::updateActorPositionWhileWalking(Actor *actor, int16 x, int16 y) {
- actor->scale = getActorScaleAtPosition(y);
- Common::String animName = Common::String::format("%s%02d", actor->animationString2, actor->field92 & 7);
- actor->sprite.setBitmap(loadAnimationFrame(animName, actor->scale));
-
- memset(actor->bitmapFilename, 0, 10);
- strncpy(actor->bitmapFilename, animName.c_str(), 9);
-
- Sprite *sprite = &actor->sprite;
- sprite->drawPriority = _gfx->getPriValue(0, y);
- sprite->pos.x = x;
- sprite->pos.y = y;
- sprite->bitmapChanged = true;
-
- actor->frameToStartNextAnim = _frameIndex;
- actor->pos.x = x;
- actor->pos.y = y;
-}
-
-void StarTrekEngine::chooseActorDirectionForWalking(Actor *actor, int16 srcX, int16 srcY, int16 destX, int16 destY) {
- actor->granularPosX = srcX;
- actor->granularPosY = srcY;
-
- int16 distX = destX - srcX;
- int16 distY = destY - srcY;
- int16 absDistX = abs(distX);
- int16 absDistY = abs(distY);
-
- if (absDistX > absDistY) {
- char d;
- if (distX > 0)
- d = 'E';
- else
- d = 'W';
-
- // Append direction to animation string
- actor->animationString2[strlen(actor->animationString2) + 1] = '\0';
- actor->animationString2[strlen(actor->animationString2)] = d;
-
- actor->direction = d;
- actor->field90 = absDistX;
-
- if (distX != 0) {
- if (distX > 0)
- actor->speedX = 1.0;
- else
- actor->speedX = -1.0;
-
- actor->speedY = Fixed16(distY) / absDistX;
- }
- } else {
- char d;
- if (distY > 0)
- d = 'S';
- else
- d = 'N';
-
- // Append direction to animation string
- actor->animationString2[strlen(actor->animationString2) + 1] = '\0';
- actor->animationString2[strlen(actor->animationString2)] = d;
-
- actor->direction = d;
- actor->field90 = absDistY;
-
- if (distY != 0) {
- if (distY > 0)
- actor->speedY = 1.0;
- else
- actor->speedY = -1.0;
-
- actor->speedX = Fixed16(distX) / absDistY;
- }
- }
-}
-
-bool StarTrekEngine::directPathExists(int16 srcX, int16 srcY, int16 destX, int16 destY) {
- int32 distX = destX - srcX;
- int32 distY = destY - srcY;
-
- int32 absDistX = abs(distX);
- int32 absDistY = abs(distY);
-
- int32 distCounter;
- Fixed16 speedX, speedY;
-
- if (absDistX > absDistY) {
- distCounter = absDistX;
-
- if (distCounter == 0)
- return true;
-
- speedY = Fixed16(distY) / absDistX;
-
- if (distX > 0)
- speedX = 1.0;
- else
- speedX = -1.0;
- } else { // absDistX <= absDistY
- distCounter = absDistY;
-
- if (distCounter == 0)
- return true;
-
- speedX = Fixed16(distX) / absDistY;
-
- if (distY > 0)
- speedY = 1.0;
- else
- speedY = -1.0;
- }
-
- Fixed16 fixedX = srcX;
- Fixed16 fixedY = srcY;
-
- if (isPositionSolid((fixedX + 0.5).toInt(), (fixedY + 0.5).toInt()))
- return false;
-
- while (distCounter-- > 0) {
- fixedX += speedX;
- fixedY += speedY;
-
- if (isPositionSolid((fixedX + 0.5).toInt(), (fixedY + 0.5).toInt()))
- return false;
- }
-
- return true;
-}
-
-int StarTrekEngine::findObjectAt(int x, int y) {
- Sprite *sprite = _gfx->getSpriteAt(x, y);
-
- if (sprite != nullptr) {
- if (sprite == &_inventoryIconSprite)
- return OBJECT_INVENTORY_ICON;
- else if (sprite == &_itemIconSprite)
- return _awayMission.activeObject;
-
- for (int i = 0; i < NUM_ACTORS; i++) {
- Actor *actor = &_actorList[i];
- if (sprite == &actor->sprite)
- return i;
- }
-
- error("findObject: Clicked on an unknown sprite");
- }
-
- _objectHasWalkPosition = false;
- int actionBit = 1 << (_awayMission.activeAction - 1);
- int offset = _room->getFirstHotspot();
-
- while (offset != _room->getHotspotEnd()) {
- uint16 word = _room->readRdfWord(offset);
- if (word & 0x8000) {
- if ((word & actionBit) && isPointInPolygon((int16 *)(_room->_rdfData + offset + 6), x, y)) {
- int actorIndex = _room->readRdfWord(offset + 6);
- _objectHasWalkPosition = true;
- _objectWalkPosition.x = _room->readRdfWord(offset + 2);
- _objectWalkPosition.y = _room->readRdfWord(offset + 4);
- return actorIndex;
- }
-
- int numVertices = _room->readRdfWord(offset + 8);
- offset = offset + 10 + numVertices * 4;
- } else {
- if (isPointInPolygon((int16 *)(_room->_rdfData + offset), x, y)) {
- int actorIndex = _room->readRdfWord(offset);
- return actorIndex;
- }
-
- int numVertices = _room->readRdfWord(offset + 2);
- offset = offset + 4 + numVertices * 4;
- }
- }
-
- return -1;
-}
-
-SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filename, Fixed8 scale) {
- SharedPtr<Bitmap> bitmapToReturn;
-
- char basename[5];
- strncpy(basename, filename.c_str() + 1, 4);
- basename[4] = '\0';
-
- char c = filename[0];
- if ((strcmp(basename, "stnd") == 0 || strcmp(basename, "tele") == 0)
- && (c == 'm' || c == 's' || c == 'k' || c == 'r')) {
- if (c == 'm') {
- // Mccoy has the "base" animations for all crewmen
- bitmapToReturn = _gfx->loadBitmap(filename);
- } else {
- // All crewman other than mccoy copy the animation frames from mccoy, change
- // the colors of the uniforms, and load an "xor" file to redraw the face.
-
- // TODO: The ".$bm" extension is a "virtual file"? Caches the changes to the
- // file made here?
- // bitmapToReturn = _gfx->loadBitmap(filename + ".$bm");
-
- if (bitmapToReturn == nullptr) {
- Common::String mccoyFilename = filename;
- mccoyFilename.setChar('m', 0);
- SharedPtr<Bitmap> bitmap = _gfx->loadBitmap(mccoyFilename);
-
- uint16 width = bitmap->width;
- uint16 height = bitmap->height;
-
- bitmapToReturn = SharedPtr<Bitmap>(new Bitmap(width, height));
- bitmapToReturn->xoffset = bitmap->xoffset;
- bitmapToReturn->yoffset = bitmap->yoffset;
-
- // Change uniform color
- int16 colorShift;
- switch (c) {
- case 'k': // Kirk
- colorShift = 8;
- break;
- case 'r': // Redshirt
- colorShift = -8;
- break;
- case 's': // Spock
- colorShift = 0;
- break;
- }
-
- if (colorShift == 0) {
- memcpy(bitmapToReturn->pixels, bitmap->pixels, width * height);
- } else {
- byte *src = bitmap->pixels;
- byte *dest = bitmapToReturn->pixels;
- byte baseUniformColor = 0xa8;
-
- for (int i = 0; i < width * height; i++) {
- byte b = *src++;
- if (b >= baseUniformColor && b < baseUniformColor + 8)
- *dest++ = b + colorShift;
- else
- *dest++ = b;
- }
- }
-
- // Redraw face with xor file
- SharedPtr<FileStream> xorFile = loadFile(filename + ".xor");
- xorFile->seek(0, SEEK_SET);
- uint16 xoffset = bitmap->xoffset - xorFile->readUint16();
- uint16 yoffset = bitmap->yoffset - xorFile->readUint16();
- uint16 xorWidth = xorFile->readUint16();
- uint16 xorHeight = xorFile->readUint16();
-
- byte *dest = bitmapToReturn->pixels + yoffset * bitmap->width + xoffset;
-
- for (int i = 0; i < xorHeight; i++) {
- for (int j = 0; j < xorWidth; j++)
- *dest++ ^= xorFile->readByte();
- dest += (bitmap->width - xorWidth);
- }
- }
- }
- } else {
- // TODO: when loading a bitmap, it passes a different argument than is standard to
- // the "file loading with cache" function...
- bitmapToReturn = _gfx->loadBitmap(filename);
- }
-
- if (scale != 1.0) {
- bitmapToReturn = scaleBitmap(bitmapToReturn, scale);
- }
-
- return bitmapToReturn;
-}
-
-
-int StarTrekEngine::selectObjectForUseAction() {
- while (true) {
- if (!(_awayMission.crewDownBitset & (1 << OBJECT_KIRK)))
- showInventoryIcons(false);
-
- TrekEvent event;
-
- while (true) {
- if (!getNextEvent(&event))
- continue;
-
- if (event.type == TREKEVENT_TICK) {
- updateMouseBitmap();
- _gfx->drawAllSprites();
- _sound->checkLoopMusic();
- } else if (event.type == TREKEVENT_LBUTTONDOWN) {
- removeNextEvent();
- break;
- } else if (event.type == TREKEVENT_MOUSEMOVE) {
- } else if (event.type == TREKEVENT_RBUTTONDOWN) {
- // Allow this to be processed by main away mission loop
- break;
- } else if (event.type == TREKEVENT_KEYDOWN) {
- if (event.kbd.keycode == Common::KEYCODE_ESCAPE
- || event.kbd.keycode == Common::KEYCODE_w
- || event.kbd.keycode == Common::KEYCODE_t
- || event.kbd.keycode == Common::KEYCODE_u
- || event.kbd.keycode == Common::KEYCODE_g
- || event.kbd.keycode == Common::KEYCODE_l
- || event.kbd.keycode == Common::KEYCODE_SPACE
- || event.kbd.keycode == Common::KEYCODE_F2) {
- // Allow these buttons to be processed by main away mission loop
- break;
- } else if (event.kbd.keycode == Common::KEYCODE_i) {
- removeNextEvent();
- break;
- } else if (event.kbd.keycode == Common::KEYCODE_RETURN || event.kbd.keycode == Common::KEYCODE_KP_ENTER || event.kbd.keycode == Common::KEYCODE_F1) {
- // Simulate left-click
- removeNextEvent();
- event.type = TREKEVENT_LBUTTONDOWN;
- break;
- }
- }
-
- removeNextEvent();
- }
-
- if (event.type == TREKEVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_i) {
- hideInventoryIcons();
- int clickedObject = showInventoryMenu(50, 50, true);
- if (clickedObject == -1)
- continue;
- return clickedObject;
- } else if (event.type == TREKEVENT_LBUTTONDOWN) {
- int clickedObject = findObjectAt(_gfx->getMousePos());
- hideInventoryIcons();
-
- if (clickedObject == -1)
- continue;
- else if (isObjectUnusable(clickedObject, ACTION_USE))
- continue;
- else if (clickedObject == OBJECT_INVENTORY_ICON) {
- clickedObject = showInventoryMenu(50, 50, false);
- if (clickedObject == -1)
- continue;
- else
- return clickedObject;
- } else if (clickedObject <= OBJECT_REDSHIRT)
- return clickedObject;
- else if (isObjectUnusable(OBJECT_KIRK, ACTION_USE))
- continue;
- else if (_room->actionHasCode(ACTION_USE, OBJECT_KIRK, clickedObject, 0)
- || _room->actionHasCode(ACTION_GET, clickedObject, 0, 0)
- || _room->actionHasCode(ACTION_WALK, clickedObject, 0, 0)) {
- _awayMission.activeObject = OBJECT_KIRK;
- _awayMission.passiveObject = clickedObject;
- _awayMission.activeAction = ACTION_USE;
- clickedObject = OBJECT_KIRK;
- if (!walkActiveObjectToHotspot())
- addAction(_awayMission.activeAction, _awayMission.activeObject, _awayMission.passiveObject, 0);
- return clickedObject;
- } else
- continue;
- } else {
- hideInventoryIcons();
- return -1;
- }
- }
-}
-
-Common::String StarTrekEngine::getCrewmanAnimFilename(int actorIndex, const Common::String &basename) {
- const char *crewmanChars = "ksmr";
- assert(actorIndex >= 0 && actorIndex < 4);
- return crewmanChars[actorIndex] + basename;
-}
-
-void StarTrekEngine::updateMouseBitmap() {
- const bool worksOnCrewmen[] = { // True if the action reacts with crewmen
- false, // ACTION_WALK
- true, // ACTION_USE
- false, // ACTION_GET
- true, // ACTION_LOOK
- true // ACTION_TALK
- };
- const bool worksOnActors[] = { // True if the action reacts with other objects
- false, // ACTION_WALK
- true, // ACTION_USE
- true, // ACTION_GET
- true, // ACTION_LOOK
- true // ACTION_TALK
- };
- const bool worksOnHotspots[] = { // True if the action reacts with hotspots
- false, // ACTION_WALK
- true, // ACTION_USE
- true, // ACTION_GET
- true, // ACTION_LOOK
- false // ACTION_TALK
- };
-
- Common::Point mousePos = _gfx->getMousePos();
- int selected = findObjectAt(mousePos.x, mousePos.y);
- int action = _awayMission.activeAction;
- assert(action >= 1 && action <= 5);
-
- bool withRedOutline;
-
- if (selected >= 0 && selected <= 3 && worksOnCrewmen[action - 1])
- withRedOutline = true;
- else if (selected > 3 && selected < NUM_ACTORS && worksOnActors[action - 1])
- withRedOutline = true;
- else if (selected >= NUM_ACTORS && selected < HOTSPOTS_END && worksOnHotspots[action - 1])
- withRedOutline = true;
- else
- withRedOutline = false;
-
- chooseMouseBitmapForAction(action, withRedOutline);
-}
-
-bool StarTrekEngine::walkActiveObjectToHotspot() {
- if (!_objectHasWalkPosition)
- return false;
-
- int objectIndex;
- if (_awayMission.activeAction != ACTION_USE)
- objectIndex = OBJECT_KIRK;
- else if (_awayMission.activeObject <= OBJECT_REDSHIRT)
- objectIndex = _awayMission.activeObject;
- else if (_awayMission.activeObject >= ITEMS_START && _awayMission.activeObject <= ITEMS_END) { // FIXME: "<= ITEMS_END" doesn't make sense?
- if (_awayMission.activeObject == OBJECT_ISTRICOR)
- objectIndex = OBJECT_SPOCK;
- else if (_awayMission.activeObject == OBJECT_IMTRICOR)
- objectIndex = OBJECT_MCCOY;
- else
- objectIndex = OBJECT_KIRK;
- } else // This is the original error message...
- error("Jay didn't think about pmcheck");
-
- byte finishedAnimActionParam = false;
- bool walk = false;
-
- if (_awayMission.activeAction == ACTION_WALK)
- walk = true;
- else {
- // If this action has code defined for it in this room, buffer the action to be
- // done after the object finished walking there.
- Action action = {_awayMission.activeAction, _awayMission.activeObject, 0, 0};
- if (_awayMission.activeAction == ACTION_USE)
- action.b2 = _awayMission.passiveObject;
-
- if (_room->actionHasCode(action)) {
- for (int i = 0; i < MAX_BUFFERED_WALK_ACTIONS; i++) {
- if (!_actionOnWalkCompletionInUse[i]) {
- finishedAnimActionParam = i + 0xe0;
- _actionOnWalkCompletionInUse[i] = true;
- _actionOnWalkCompletion[i] = action;
- walk = true;
- break;
- }
- }
- }
- }
-
- if (walk) {
- Actor *actor = &_actorList[objectIndex];
- Common::String anim = getCrewmanAnimFilename(objectIndex, "walk");
- actorWalkToPosition(objectIndex, anim, actor->pos.x, actor->pos.y, _objectWalkPosition.x, _objectWalkPosition.y);
- if (finishedAnimActionParam != 0) {
- actor->triggerActionWhenAnimFinished = true;
- actor->finishedAnimActionParam = finishedAnimActionParam;
- }
- _objectHasWalkPosition = false;
- return true;
- } else {
- _objectHasWalkPosition = false;
- return false;
- }
-}
-
-void StarTrekEngine::showInventoryIcons(bool showItem) {
- const char *crewmanFilenames[] = {
- "ikirk",
- "ispock",
- "imccoy",
- "iredshir"
- };
-
- Common::String itemFilename;
-
- if (showItem) {
- int i = _awayMission.activeObject;
- if (i >= OBJECT_KIRK && i <= OBJECT_REDSHIRT)
- itemFilename = crewmanFilenames[i];
- else {
- assert(i >= ITEMS_START && i < ITEMS_END);
- Item *item = &_itemList[i - ITEMS_START];
- itemFilename = item->name;
- }
- }
-
- if (itemFilename.empty())
- _inventoryIconSprite.pos.x = 10;
- else {
- _gfx->addSprite(&_itemIconSprite);
- _itemIconSprite.drawMode = 2;
- _itemIconSprite.pos.x = 10;
- _itemIconSprite.pos.y = 10;
- _itemIconSprite.drawPriority = 15;
- _itemIconSprite.drawPriority2 = 8;
- _itemIconSprite.setBitmap(_gfx->loadBitmap(itemFilename));
-
- _inventoryIconSprite.pos.x = 46;
- }
-
- _gfx->addSprite(&_inventoryIconSprite);
-
- _inventoryIconSprite.pos.y = 10;
- _inventoryIconSprite.drawMode = 2;
- _inventoryIconSprite.drawPriority = 15;
- _inventoryIconSprite.drawPriority2 = 8;
- _inventoryIconSprite.setBitmap(_gfx->loadBitmap("inv00"));
-}
-
-bool StarTrekEngine::isObjectUnusable(int object, int action) {
- if (action == ACTION_LOOK)
- return false;
- if (object == OBJECT_REDSHIRT && _awayMission.redshirtDead)
- return true;
- if (object >= OBJECT_KIRK && object <= OBJECT_REDSHIRT && (_awayMission.crewDownBitset & (1 << object)))
- return true;
- if (object == OBJECT_IMTRICOR && (_awayMission.crewDownBitset & (1 << OBJECT_MCCOY)))
- return true;
- if (object == OBJECT_ISTRICOR && (_awayMission.crewDownBitset & (1 << OBJECT_SPOCK)))
- return true;
- return false;
-}
-
-void StarTrekEngine::hideInventoryIcons() {
- // Clear these sprites from the screen
- if (_itemIconSprite.drawMode == 2)
- _itemIconSprite.dontDrawNextFrame();
- if (_inventoryIconSprite.drawMode == 2)
- _inventoryIconSprite.dontDrawNextFrame();
-
- _gfx->drawAllSprites();
-
- if (_itemIconSprite.drawMode == 2) {
- _gfx->delSprite(&_itemIconSprite);
- _itemIconSprite.drawMode = 0;
- _itemIconSprite.bitmap.reset();
- }
-
- if (_inventoryIconSprite.drawMode == 2) {
- _gfx->delSprite(&_inventoryIconSprite);
- _inventoryIconSprite.drawMode = 0;
- _inventoryIconSprite.bitmap.reset();
- }
-}
-
-void StarTrekEngine::updateCrewmanGetupTimers() {
- if (_awayMission.crewDownBitset == 0)
- return;
- for (int i = OBJECT_KIRK; i <= OBJECT_REDSHIRT; i++) {
- Actor *actor = &_actorList[i];
-
- if (!(_awayMission.crewDownBitset & (1 << i)))
- continue;
-
- _awayMission.crewGetupTimers[i]--;
- if (_awayMission.crewGetupTimers[i] <= 0) {
- Common::String anim = getCrewmanAnimFilename(i, "getu");
- int8 dir = _awayMission.crewDirectionsAfterWalk[i];
- char d;
- if (dir == -1) {
- d = actor->direction;
- } else {
- const char *dirs = "nsew";
- Fixed8 scale = getActorScaleAtPosition(actor->sprite.pos.y);
- d = dirs[dir];
-
- int16 xOffset = 0, yOffset = 0;
- if (d == 'n') {
- xOffset = -24;
- yOffset = -8;
- } else if (d == 'w') {
- xOffset = -35;
- yOffset = -12;
- }
- actor->sprite.pos.x += scale.multToInt(xOffset);
- actor->sprite.pos.y += scale.multToInt(yOffset);
- }
-
- anim += (char)d;
- loadActorAnimWithRoomScaling(i, anim, actor->sprite.pos.x, actor->sprite.pos.y);
- _awayMission.crewDownBitset &= ~(1 << i);
- }
- }
-}
-
-int StarTrekEngine::showInventoryMenu(int x, int y, bool restoreMouse) {
- const int ITEMS_PER_ROW = 5;
-
- Common::Point oldMousePos = _gfx->getMousePos();
- bool keyboardControlledMouse = _keyboardControlsMouse;
- _keyboardControlsMouse = false;
-
- int itemIndex = 0;
- int numItems = 0;
-
- char itemNames[NUM_OBJECTS][10];
- Common::Point itemPositions[NUM_OBJECTS];
- int16 itemIndices[NUM_OBJECTS];
-
- while (itemIndex < NUM_OBJECTS) {
- if (_itemList[itemIndex].have) {
- strcpy(itemNames[numItems], _itemList[itemIndex].name);
-
- int16 itemX = (numItems % ITEMS_PER_ROW) * 32 + x;
- int16 itemY = (numItems / ITEMS_PER_ROW) * 32 + y;
- itemPositions[numItems] = Common::Point(itemX, itemY);
- itemIndices[numItems] = _itemList[itemIndex].field2;
-
- numItems++;
- }
- itemIndex++;
- }
-
- Sprite itemSprites[NUM_OBJECTS];
-
- for (int i = 0; i < numItems; i++) {
- _gfx->addSprite(&itemSprites[i]);
-
- itemSprites[i].drawMode = 2;
- itemSprites[i].pos.x = itemPositions[i].x;
- itemSprites[i].pos.y = itemPositions[i].y;
- itemSprites[i].drawPriority = 15;
- itemSprites[i].drawPriority2 = 8;
- itemSprites[i].setBitmap(_gfx->loadBitmap(itemNames[i]));
- }
-
- chooseMousePositionFromSprites(itemSprites, numItems, -1, 4);
- bool displayMenu = true;
- int lastItemIndex = -1;
-
- while (displayMenu) {
- _sound->checkLoopMusic();
-
- TrekEvent event;
- if (!getNextEvent(&event))
- continue;
-
- switch (event.type) {
- case TREKEVENT_TICK: {
- Common::Point mousePos = _gfx->getMousePos();
- itemIndex = getMenuButtonAt(itemSprites, numItems, mousePos.x, mousePos.y);
- if (itemIndex != lastItemIndex) {
- if (lastItemIndex != -1) {
- drawMenuButtonOutline(itemSprites[lastItemIndex].bitmap, 0);
- itemSprites[lastItemIndex].bitmapChanged = true;
- }
- if (itemIndex != -1) {
- drawMenuButtonOutline(itemSprites[itemIndex].bitmap, 15);
- itemSprites[itemIndex].bitmapChanged = true;
- }
- lastItemIndex = itemIndex;
- }
- _gfx->drawAllSprites();
- break;
- }
-
- case TREKEVENT_LBUTTONDOWN:
-exitWithSelection:
- displayMenu = false;
- break;
-
- case TREKEVENT_RBUTTONDOWN:
-exitWithoutSelection:
- displayMenu = false;
- lastItemIndex = -1;
- break;
-
- case TREKEVENT_KEYDOWN:
- switch (event.kbd.keycode) {
- case Common::KEYCODE_ESCAPE:
- case Common::KEYCODE_F2:
- goto exitWithoutSelection;
-
- case Common::KEYCODE_RETURN:
- case Common::KEYCODE_KP_ENTER:
- case Common::KEYCODE_F1:
- goto exitWithSelection;
-
- case Common::KEYCODE_HOME:
- case Common::KEYCODE_KP7:
- chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 4);
- break;
-
- case Common::KEYCODE_UP:
- case Common::KEYCODE_KP8:
- case Common::KEYCODE_PAGEUP:
- case Common::KEYCODE_KP9:
- chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 2);
- break;
-
- case Common::KEYCODE_LEFT:
- case Common::KEYCODE_KP4:
- chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 1);
- break;
-
- case Common::KEYCODE_RIGHT:
- case Common::KEYCODE_KP6:
- chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 0);
- break;
-
- case Common::KEYCODE_END:
- case Common::KEYCODE_KP1:
- chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 5);
- break;
-
- case Common::KEYCODE_DOWN:
- case Common::KEYCODE_KP2:
- case Common::KEYCODE_PAGEDOWN:
- case Common::KEYCODE_KP3:
- chooseMousePositionFromSprites(itemSprites, numItems, lastItemIndex, 3);
- break;
-
- default:
- break;
- }
- break;
-
- default:
- break;
- }
-
- removeNextEvent();
- }
-
- playSoundEffectIndex(0x10);
- if (lastItemIndex >= 0)
- drawMenuButtonOutline(itemSprites[lastItemIndex].bitmap, 0);
-
- for (int i = 0; i < numItems; i++)
- itemSprites[i].dontDrawNextFrame();
-
- _gfx->drawAllSprites();
-
- for (int i = 0; i < numItems; i++) {
- itemSprites[i].bitmap.reset();
- _gfx->delSprite(&itemSprites[i]);
- }
-
- if (lastItemIndex >= 0) {
- lastItemIndex = itemIndices[lastItemIndex];
- }
-
- if (restoreMouse)
- _gfx->warpMouse(oldMousePos.x, oldMousePos.y);
-
- _keyboardControlsMouse = keyboardControlledMouse;
- return lastItemIndex;
-}
-
-void StarTrekEngine::initStarfieldSprite(Sprite *sprite, SharedPtr<Bitmap> bitmap, const Common::Rect &rect) {
- sprite->setXYAndPriority(rect.left, rect.top, 0);
- sprite->setBitmap(bitmap);
- bitmap->xoffset = 0;
- bitmap->yoffset = 0;
- bitmap->width = rect.width();
- bitmap->height = rect.height();
- _gfx->addSprite(sprite);
- sprite->drawMode = 1;
-}
-
-SharedPtr<Bitmap> StarTrekEngine::scaleBitmap(SharedPtr<Bitmap> bitmap, Fixed8 scale) {
- int scaledWidth = scale.multToInt(bitmap->width);
- int scaledHeight = scale.multToInt(bitmap->height);
- int origWidth = bitmap->width;
- int origHeight = bitmap->height;
-
- if (scaledWidth < 1)
- scaledWidth = 1;
- if (scaledHeight < 1)
- scaledHeight = 1;
-
- SharedPtr<Bitmap> scaledBitmap(new Bitmap(scaledWidth, scaledHeight));
- scaledBitmap->xoffset = scale.multToInt(bitmap->xoffset);
- scaledBitmap->yoffset = scale.multToInt(bitmap->yoffset);
-
- // sub_344a5(scaledWidth, origWidth);
-
- origHeight--;
- scaledHeight--;
-
- byte *src = bitmap->pixels;
- byte *dest = scaledBitmap->pixels;
-
- if (scale <= 1.0) {
- int16 var2e = 0;
- uint16 var30 = scaledHeight << 1;
- uint16 var32 = (scaledHeight - origHeight) << 1;
- uint16 origRow = 0;
-
- while (origRow <= origHeight) {
- if (var2e < 0) {
- var2e += var30;
- } else {
- var2e += var32;
- scaleBitmapRow(src, dest, origWidth, scaledWidth);
- dest += scaledWidth;
- }
-
- src += bitmap->width;
- origRow++;
- }
- } else {
- int16 var2e = (origHeight << 1) - scaledHeight;
- uint16 var30 = origHeight << 1;
- uint16 var32 = (origHeight - scaledHeight) << 1;
- uint16 srcRowChanged = true;
- origWidth = bitmap->width;
- uint16 scaledRow = 0;
- byte *rowData = new byte[scaledWidth];
-
- while (scaledRow++ <= scaledHeight) {
- if (srcRowChanged) {
- scaleBitmapRow(src, rowData, origWidth, scaledWidth);
- srcRowChanged = false;
- }
-
- memcpy(dest, rowData, scaledWidth);
- dest += scaledWidth;
-
- if (var2e < 0) {
- var2e += var30;
- } else {
- var2e += var32;
- src += origWidth;
- srcRowChanged = true;
- }
- }
-
- delete[] rowData;
- }
-
- return scaledBitmap;
-}
-
-void StarTrekEngine::scaleBitmapRow(byte *src, byte *dest, uint16 origWidth, uint16 scaledWidth) {
- if (origWidth >= scaledWidth) {
- int16 var2 = (scaledWidth << 1) - origWidth;
- uint16 var4 = scaledWidth << 1;
- uint16 var6 = (scaledWidth - origWidth) << 1;
- uint16 varE = 0;
- uint16 varA = 0;
- uint16 var8 = origWidth;
- uint16 di = 0;
-
- while (var8-- != 0) {
- if (var2 < 0) {
- var2 += var4;
- } else {
- var2 += var6;
- if (di != 0) {
- if (varE != 0) {
- *(dest - 1) = *src++;
- varE = 0;
- di--;
- }
- src += di;
- di = 0;
- }
- *dest++ = *src;
- varE = 1;
- }
-
- di++;
- varA++;
- }
- } else {
- int16 var2 = ((origWidth - 1) << 1) - (scaledWidth - 1);
- uint16 var4 = (origWidth - 1) << 1;
- uint16 var6 = ((origWidth - 1) - (scaledWidth - 1)) << 1;
- uint16 varA = 0;
- uint16 var8 = scaledWidth;
- uint16 di = 0;
-
- while (var8-- != 0) {
- if (di != 0) {
- src += di;
- di = 0;
- }
- *dest++ = *src;
-
- if (var2 < 0)
- var2 += var4;
- else {
- var2 += var6;
- di++;
- }
-
- varA++;
- }
- }
-}
-
/**
* TODO:
* - Should return nullptr on failure to open a file?
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 2fcf6a2..f96c7b8 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -226,9 +226,44 @@ class Sound;
class StarTrekEngine : public ::Engine {
protected:
+ // startrek.cpp
+public:
+ StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gamedesc);
+ virtual ~StarTrekEngine();
+
Common::Error run();
+ Common::Error runGameMode(int mode, bool resume);
+
+ // Transporter room
+ void runTransportSequence(const Common::String &name);
+
+ // Bridge
+ void initBridge(bool b) {}; // TODO
+ void cleanupBridge() {}; // TODO
+
+ // Running the game
+ void playSoundEffectIndex(int index);
+ void playMidiMusicTracks(int startTrack, int loopTrack);
+ void playSpeech(const Common::String &filename);
+ void stopPlayingSpeech();
+
+ SharedPtr<FileStream> loadFile(Common::String filename, int fileIndex = 0);
+ /**
+ * TODO: Figure out what the extra parameters are, and if they're important.
+ */
+ SharedPtr<FileStream> loadFileWithParams(Common::String filename, bool unk1, bool unk2, bool unk3);
+
+ void playMovie(Common::String filename);
+ void playMovieMac(Common::String filename);
+
+ uint16 getRandomWord();
+ /**
+ * ".txt" files are just lists of strings. This traverses the file to get a particular
+ * string index.
+ */
+ Common::String getLoadedText(int textIndex);
+
-public:
// math.cpp
/**
* Unit of the angle is "quadrants" (90 degrees = 1.0)
@@ -237,10 +272,7 @@ public:
Fixed14 cos(Angle angle);
Angle atan2(int32 deltaX, int32 deltaZ);
- // Game modes
- Common::Error runGameMode(int mode, bool resume);
-
- // Away missions
+ // awaymission.cpp
void initAwayMission();
void runAwayMission();
void cleanupAwayMission();
@@ -290,11 +322,10 @@ public:
bool isPositionSolid(int16 x, int16 y);
void loadRoomIndex(int roomIndex, int spawnIndex);
-public:
SharedPtr<Room> getRoom();
+ // intro.cpp
private:
- // Intro
void playIntro();
/**
* Initializes an object to spawn at one position and move toward another position.
@@ -303,7 +334,7 @@ private:
void initIntroR3ObjectToMove(R3 *r3, int16 srcAngle, int16 srcDepth, int16 destAngle, int16 destDepth, int16 ticks);
void loadSubtitleSprite(int index, Sprite *sprite);
- // Space, pseudo-3D (space.cpp)
+ // space.cpp (pseudo-3d)
void initStarfieldPosition();
void initStarfield(int16 x, int16 y, int16 width, int16 height, int16 arg8);
void addR3(R3 *r3);
@@ -321,29 +352,14 @@ private:
int32 scaleSpacePosition(int32 x, int32 z);
/**
- * Creates something like an "identity" matrix? (Value 0x4000 along the diagonal)
+ * Creates an identity matrix
*/
Matrix initMatrix();
Matrix initSpeedMatrixForXZMovement(Angle angle, const Matrix &matrix);
- // Transporter room
- void runTransportSequence(const Common::String &name);
-
- // Bridge
- void initBridge(bool b) {}; // TODO
- void cleanupBridge() {}; // TODO
+ // actors.cpp (handles actors and animations)
public:
- StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gamedesc);
- virtual ~StarTrekEngine();
-
- // Running the game
- void playSoundEffectIndex(int index);
- void playMidiMusicTracks(int startTrack, int loopTrack);
- void playSpeech(const Common::String &filename);
- void stopPlayingSpeech();
-
- // Actors
void initActors();
/**
* Set an actor's animation, position, and scale.
@@ -427,7 +443,7 @@ public:
*/
void scaleBitmapRow(byte *src, byte *dest, uint16 origWidth, uint16 scaledWidth);
- // Events
+ // events.cpp
public:
/**
* Checks for all events, and updates Star Trek's event queue if queueEvents is set.
@@ -636,7 +652,7 @@ public:
Common::String getSavegameFilename(int slotId) const;
- // Detection related functions
+ // detection.cpp
public:
const StarTrekGameDescription *_gameDescription;
uint32 getFeatures() const;
@@ -644,26 +660,8 @@ public:
uint8 getGameType() const;
Common::Language getLanguage() const;
- // Resource related functions
- SharedPtr<FileStream> loadFile(Common::String filename, int fileIndex = 0);
- /**
- * TODO: Figure out what the extra parameters are, and if they're important.
- */
- SharedPtr<FileStream> loadFileWithParams(Common::String filename, bool unk1, bool unk2, bool unk3);
-
- // Movie related functions
- void playMovie(Common::String filename);
- void playMovieMac(Common::String filename);
-
- // Misc
- uint16 getRandomWord();
- /**
- * ".txt" files are just lists of strings. This traverses the file to get a particular
- * string index.
- */
- Common::String getLoadedText(int textIndex);
-
+ // Variables
public:
int _gameMode;
int _lastGameMode;
Commit: ad6a2bb0bb02ddbcffeaf2da14919fd9a73a786e
https://github.com/scummvm/scummvm/commit/ad6a2bb0bb02ddbcffeaf2da14919fd9a73a786e
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Make FileStream extend MemoryReadStream
Changed paths:
engines/startrek/filestream.cpp
engines/startrek/filestream.h
engines/startrek/startrek.cpp
diff --git a/engines/startrek/filestream.cpp b/engines/startrek/filestream.cpp
index b4fa2d2..b4b8644 100644
--- a/engines/startrek/filestream.cpp
+++ b/engines/startrek/filestream.cpp
@@ -24,79 +24,12 @@
namespace StarTrek {
-FileStream::FileStream(Common::SeekableReadStream *stream, bool bigEndian) {
- _bigEndian = bigEndian;
-
- _pos = 0;
- _size = stream->size();
- _data = new byte[_size];
- stream->read(_data, _size);
- delete stream;
+FileStream::FileStream(byte *data, uint32 len, bool bigEndian) : Common::MemoryReadStreamEndian(data, len, bigEndian) {
+ _data = data;
}
FileStream::~FileStream() {
- delete[] _data;
-}
-
-// ReadStream functions
-
-uint32 FileStream::read(void *dataPtr, uint32 dataSize) {
- if (_pos + dataSize > (uint32)size())
- dataSize = size() - _pos;
- memcpy(dataPtr, _data + _pos, dataSize);
- _pos += dataSize;
- return dataSize;
-}
-
-byte FileStream::readByte() {
- assert(_pos + 1 <= size());
- return _data[_pos++];
-}
-
-uint16 FileStream::readUint16() {
- assert(_pos + 2 <= size());
- uint16 w;
- if (_bigEndian)
- w = READ_BE_UINT16(_data + _pos);
- else
- w = READ_LE_UINT16(_data + _pos);
- _pos += 2;
- return w;
-}
-
-uint32 FileStream::readUint32() {
- assert(_pos + 4 <= size());
- uint32 w;
- if (_bigEndian)
- w = READ_BE_UINT32(_data + _pos);
- else
- w = READ_LE_UINT32(_data + _pos);
- _pos += 4;
- return w;
-}
-
-int16 FileStream::readSint16() {
- return (int16)readUint16();
-}
-
-int32 FileStream::readSint32() {
- return (int32)readUint32();
-}
-
-// SeekableReadStream functions
-
-int32 FileStream::pos() const {
- return _pos;
-}
-
-int32 FileStream::size() const {
- return _size;
-}
-
-bool FileStream::seek(int32 offset, int whence) {
- assert(whence == SEEK_SET);
- _pos = offset;
- return true;
+ free(_data);
}
} // End of namespace StarTrek
diff --git a/engines/startrek/filestream.h b/engines/startrek/filestream.h
index ddef496..9f69d62 100644
--- a/engines/startrek/filestream.h
+++ b/engines/startrek/filestream.h
@@ -23,37 +23,16 @@
#define STARTREK_FILESTREAM_H
#include "common/stream.h"
+#include "common/memstream.h"
namespace StarTrek {
-class FileStream {
+class FileStream : public Common::MemoryReadStreamEndian {
public:
- FileStream(Common::SeekableReadStream *stream, bool bigEndian);
+ FileStream(byte *data, uint32 len, bool bigEndian);
~FileStream();
byte *_data;
-
-private:
- bool _bigEndian;
- int32 _pos;
- int32 _size;
-
-public:
- // ReadStream functions
- bool eos() const;
- uint32 read(void *dataPtr, uint32 dataSize);
-
- byte readByte();
- uint16 readUint16();
- uint32 readUint32();
- int16 readSint16();
- int32 readSint32();
-
- // SeekableReadStream functions
- int32 pos() const;
- int32 size() const;
- bool seek(int32 offset, int whence);
-
};
} // End of namespace StarTrek
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index cea59a4..e0aef01 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -420,7 +420,9 @@ SharedPtr<FileStream> StarTrekEngine::loadFile(Common::String filename, int file
Common::File *file = new Common::File();
if (!file->open(filename.c_str()))
error("Could not find file \'%s\'", filename.c_str());
- return SharedPtr<FileStream>(new FileStream(file, bigEndian));
+ byte *data = (byte *)malloc(file->size());
+ file->read(data, file->size());
+ return SharedPtr<FileStream>(new FileStream(data, file->size(), bigEndian));
}
Common::SeekableReadStream *indexFile = 0;
@@ -523,7 +525,10 @@ SharedPtr<FileStream> StarTrekEngine::loadFile(Common::String filename, int file
Common::SeekableReadStream *stream = dataFile->readStream(uncompressedSize);
delete dataFile;
delete dataRunFile;
- return SharedPtr<FileStream>(new FileStream(stream, bigEndian));
+
+ byte *data = (byte *)malloc(stream->size());
+ stream->read(data, stream->size());
+ return SharedPtr<FileStream>(new FileStream(data, stream->size(), bigEndian));
} else {
if (fileCount != 1) {
dataRunFile->seek(indexOffset);
@@ -545,7 +550,10 @@ SharedPtr<FileStream> StarTrekEngine::loadFile(Common::String filename, int file
delete dataFile;
delete dataRunFile;
- return SharedPtr<FileStream>(new FileStream(stream, bigEndian));
+
+ byte *data = (byte *)malloc(stream->size());
+ stream->read(data, stream->size());
+ return SharedPtr<FileStream>(new FileStream(data, stream->size(), bigEndian));
}
// We should not get to this point...
Commit: 08ef636a989ba5a9a040b7c2a84f9bda0846a4c4
https://github.com/scummvm/scummvm/commit/08ef636a989ba5a9a040b7c2a84f9bda0846a4c4
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: VENG0
Changed paths:
A engines/startrek/rooms/veng0.cpp
A engines/startrek/rooms/veng1.cpp
A engines/startrek/rooms/veng2.cpp
A engines/startrek/rooms/veng3.cpp
A engines/startrek/rooms/veng4.cpp
A engines/startrek/rooms/veng5.cpp
A engines/startrek/rooms/veng6.cpp
A engines/startrek/rooms/veng7.cpp
A engines/startrek/rooms/veng8.cpp
engines/startrek/awaymission.h
engines/startrek/module.mk
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/function_map.h
engines/startrek/text.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 69c055b..0a19632 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -618,6 +618,24 @@ struct AwayMission {
ser.syncAsSint16LE(missionScore);
}
} sins;
+
+ struct {
+ bool enteredRoom0FirstTime; // 0x2d
+ bool bridgeCrewmanDead; // 0x30
+ bool scannedCaptainsChair; // 0x31
+ bool scannedComputerBank; // 0x32
+ bool field34; // 0x34
+
+ // 0: beam still in place
+ // 1: used saw on beam
+ // 2: beam taken
+ byte beamState; // 0x35
+
+ bool field36; // 0x36
+ bool field68; // 0x68
+ bool field6b; // 0x6b
+ bool field6c; // 0x6c
+ } veng;
};
};
// Size: 0x129 bytes
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 20529e1..99d7791 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -67,7 +67,16 @@ MODULE_OBJS = \
rooms/sins2.o \
rooms/sins3.o \
rooms/sins4.o \
- rooms/sins5.o
+ rooms/sins5.o \
+ rooms/veng0.o \
+ rooms/veng1.o \
+ rooms/veng2.o \
+ rooms/veng3.o \
+ rooms/veng4.o \
+ rooms/veng5.o \
+ rooms/veng6.o \
+ rooms/veng7.o \
+ rooms/veng8.o
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 73776d7..6a72537 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -99,6 +99,15 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm), _awayMissi
ADD_ROOM(sins3);
ADD_ROOM(sins4);
ADD_ROOM(sins5);
+ ADD_ROOM(veng0);
+ ADD_ROOM(veng1);
+ ADD_ROOM(veng2);
+ ADD_ROOM(veng3);
+ ADD_ROOM(veng4);
+ ADD_ROOM(veng5);
+ ADD_ROOM(veng6);
+ ADD_ROOM(veng7);
+ ADD_ROOM(veng8);
if (_roomActionList == nullptr) {
warning("Room \"%s\" unimplemented", name.c_str());
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 20615bd..876ffe1 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2431,6 +2431,73 @@ public:
void sins5UseSTricorderOnNorthDoor();
void sins5UseMTricorderOnCrewman();
+ // VENG0
+ void veng0Tick1();
+ void veng0Tick10();
+ void veng0Tick50();
+ void veng0TouchedDoor();
+ void veng0UseSTricorderOnComputerBank();
+ void veng0UseSTricorderOnChair();
+ void veng0UseSTricorderAnywhere();
+ void veng0UseMccoyOnBeam();
+ void veng0UseSTricorderOnBeam();
+ void veng0UseRedshirtOnBeam();
+ void veng0UseSpockOnConsole();
+ void veng0UseRedshirtOnConsole();
+ void veng0UsePhaserOnBeam();
+ void veng0UseMccoyOnDeadCrewman();
+ void veng0UseSawOnBeam();
+ void veng0KirkReachedSaw();
+ void veng0Timer0Expired();
+ void veng0DoneCuttingBeam();
+ void veng0GetBeam();
+ void veng0TalkToKirk();
+ void veng0TalkToMccoy();
+ void veng0TalkToSpock();
+ void veng0TalkToRedshirt();
+ void veng0LookAtPatterson();
+ void veng0LookAtDeadCrewman2();
+ void veng0LookAtComputerBank();
+ void veng0LookAtChair();
+ void veng0LookAtKirk();
+ void veng0LookAtSpock();
+ void veng0LookAtMccoy();
+ void veng0LookAtRedshirt();
+ void veng0LookAtViewscreen();
+ void veng0LookAtHelmConsole();
+ void veng0LookAtNavConsole();
+ void veng0LookAtBeam();
+ void veng0LookAnywhere();
+ void veng0LookAtDeadCrewman1();
+ void veng0UseMccoyOnLivingCrewman();
+ void veng0MccoyReachedCrewman();
+ void veng0MccoyScannedCrewman();
+ // TODO: common code
+
+ // VENG1
+ void veng1Tick1();
+
+ // VENG2
+ void veng2Tick1();
+
+ // VENG3
+ void veng3Tick1();
+
+ // VENG4
+ void veng4Tick1();
+
+ // VENG5
+ void veng5Tick1();
+
+ // VENG6
+ void veng6Tick1();
+
+ // VENG7
+ void veng7Tick1();
+
+ // VENG8
+ void veng8Tick1();
+
public:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
// NOTE: Any changes here must be reflected in the corresponding serializer functions.
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index b44fbf1..e3507bd 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1795,6 +1795,11 @@ extern const int sins0NumActions, sins1NumActions, sins2NumActions,
extern const RoomAction sins4ActionList[], sins5ActionList[];
extern const int sins4NumActions, sins5NumActions;
+extern const RoomAction veng0ActionList[], veng1ActionList[], veng2ActionList[], veng3ActionList[];
+extern const int veng0NumActions, veng1NumActions, veng2NumActions, veng3NumActions;
+extern const RoomAction veng4ActionList[], veng5ActionList[], veng6ActionList[], veng7ActionList[], veng8ActionList[];
+extern const int veng4NumActions, veng5NumActions, veng6NumActions, veng7NumActions, veng8NumActions;
+
}
#endif
diff --git a/engines/startrek/rooms/veng0.cpp b/engines/startrek/rooms/veng0.cpp
new file mode 100644
index 0000000..76d9603
--- /dev/null
+++ b/engines/startrek/rooms/veng0.cpp
@@ -0,0 +1,354 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_BEAM 8
+#define OBJECT_9 9
+#define OBJECT_10 10
+
+#define HOTSPOT_CREWMAN_1 0x20 // This one lives for a bit
+#define HOTSPOT_CHAIR 0x21
+#define HOTSPOT_CREWMAN_2 0x22
+#define HOTSPOT_COMPUTER_BANK 0x23
+#define HOTSPOT_PATTERSON 0x24
+#define HOTSPOT_NAV_CONSOLE 0x25
+#define HOTSPOT_HELM_CONSOLE 0x26
+#define HOTSPOT_VIEWSCREEN 0x27
+
+namespace StarTrek {
+
+extern const RoomAction veng0ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::veng0Tick1 },
+ { {ACTION_TICK, 10, 0, 0}, &Room::veng0Tick10 },
+ { {ACTION_TICK, 50, 0, 0}, &Room::veng0Tick50 },
+ { {ACTION_TOUCHED_WARP, 1, 0, 0}, &Room::veng0TouchedDoor },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_COMPUTER_BANK, 0}, &Room::veng0UseSTricorderOnComputerBank },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_CHAIR, 0}, &Room::veng0UseSTricorderOnChair },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_VIEWSCREEN, 0}, &Room::veng0UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::veng0UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_BEAM, 0}, &Room::veng0UseMccoyOnBeam },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_BEAM, 0}, &Room::veng0UseSTricorderOnBeam },
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_BEAM, 0}, &Room::veng0UseSTricorderOnBeam },
+ { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_BEAM, 0}, &Room::veng0UseRedshirtOnBeam },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_HELM_CONSOLE, 0}, &Room::veng0UseSpockOnConsole },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_NAV_CONSOLE, 0}, &Room::veng0UseSpockOnConsole },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_HELM_CONSOLE, 0}, &Room::veng0UseSpockOnConsole },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_NAV_CONSOLE, 0}, &Room::veng0UseSpockOnConsole },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_HELM_CONSOLE, 0}, &Room::veng0UseRedshirtOnConsole },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_NAV_CONSOLE, 0}, &Room::veng0UseRedshirtOnConsole },
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_BEAM, 0}, &Room::veng0UsePhaserOnBeam },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_BEAM, 0}, &Room::veng0UsePhaserOnBeam },
+
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_PATTERSON, 0}, &Room::veng0UseMccoyOnDeadCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_PATTERSON, 0}, &Room::veng0UseMccoyOnDeadCrewman },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_CREWMAN_2, 0}, &Room::veng0UseMccoyOnDeadCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, HOTSPOT_CREWMAN_2, 0}, &Room::veng0UseMccoyOnDeadCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, HOTSPOT_PATTERSON, 0}, &Room::veng0UseMccoyOnDeadCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_CREWMAN_2, 0}, &Room::veng0UseMccoyOnDeadCrewman },
+
+ { {ACTION_USE, OBJECT_ILMD, OBJECT_BEAM, 0}, &Room::veng0UseSawOnBeam },
+ { {ACTION_DONE_WALK, 1, 0, 0}, &Room::veng0KirkReachedSaw },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::veng0Timer0Expired },
+ { {ACTION_DONE_ANIM, 2, 0, 0}, &Room::veng0DoneCuttingBeam },
+
+ { {ACTION_GET, OBJECT_BEAM, 0, 0}, &Room::veng0GetBeam },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::veng0TalkToKirk },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::veng0TalkToMccoy },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::veng0TalkToSpock },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::veng0TalkToRedshirt },
+ { {ACTION_LOOK, HOTSPOT_PATTERSON, 0, 0}, &Room::veng0LookAtPatterson },
+ { {ACTION_LOOK, HOTSPOT_CREWMAN_2, 0, 0}, &Room::veng0LookAtDeadCrewman2 },
+ { {ACTION_LOOK, HOTSPOT_COMPUTER_BANK, 0, 0}, &Room::veng0LookAtComputerBank },
+ { {ACTION_LOOK, HOTSPOT_CHAIR, 0, 0}, &Room::veng0LookAtChair },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::veng0LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::veng0LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::veng0LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::veng0LookAtRedshirt },
+ { {ACTION_LOOK, HOTSPOT_VIEWSCREEN, 0, 0}, &Room::veng0LookAtViewscreen },
+ { {ACTION_LOOK, HOTSPOT_HELM_CONSOLE, 0, 0}, &Room::veng0LookAtHelmConsole },
+ { {ACTION_LOOK, HOTSPOT_NAV_CONSOLE, 0, 0}, &Room::veng0LookAtNavConsole },
+ { {ACTION_LOOK, OBJECT_BEAM, 0, 0}, &Room::veng0LookAtBeam },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::veng0LookAnywhere },
+ { {ACTION_LOOK, HOTSPOT_CREWMAN_1, 0, 0}, &Room::veng0LookAtDeadCrewman1 },
+
+ { {ACTION_USE, OBJECT_IMEDKIT, HOTSPOT_CREWMAN_1, 0}, &Room::veng0UseMccoyOnLivingCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_CREWMAN_1, 0}, &Room::veng0UseMccoyOnLivingCrewman },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_CREWMAN_1, 0}, &Room::veng0UseMccoyOnLivingCrewman },
+ { {ACTION_DONE_WALK, 3, 0, 0}, &Room::veng0MccoyReachedCrewman },
+ { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::veng0MccoyScannedCrewman },
+};
+
+extern const int veng0NumActions = ARRAYSIZE(veng0ActionList);
+
+
+void Room::veng0Tick1() {
+ playVoc("VEN0LOOP");
+
+ if (_awayMission->veng.beamState != 2)
+ loadActorAnim2(OBJECT_BEAM, "s7r0bo", 0x28, 0xc6);
+ else
+ loadActorAnim2(OBJECT_BEAM, "s7r0bf", 0x0e, 0x9a);
+
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
+}
+
+void Room::veng0Tick10() {
+ // stub
+}
+
+void Room::veng0Tick50() {
+ if (!_awayMission->veng.enteredRoom0FirstTime) {
+ _awayMission->veng.enteredRoom0FirstTime = true;
+ showText(TX_SPEAKER_MCCOY, TX_VEN0_018);
+ showText(TX_SPEAKER_KIRK, TX_VEN0_006);
+ showText(TX_SPEAKER_SCOTT, TX_VEN0_S12);
+ showText(TX_SPEAKER_KIRK, TX_VEN0_008);
+ showText(TX_SPEAKER_SCOTT, TX_VEN0_S52);
+ showText(TX_SPEAKER_KIRK, TX_VEN0_007);
+ showText(TX_SPEAKER_SPOCK, TX_VEN0_030);
+ showText(TX_SPEAKER_SCOTT, TX_VEN0_S15);
+ showText(TX_SPEAKER_KIRK, TX_VEN0_005);
+ showText(TX_SPEAKER_CHEKOV, TX_VEN0_039);
+ showText(TX_SPEAKER_KIRK, TX_VEN0_009);
+ showText(TX_SPEAKER_SCOTT, TX_VEN0_S54);
+ showText(TX_SPEAKER_KIRK, TX_VEN0_011);
+ showText(TX_SPEAKER_KIRK, TX_VEN0_010);
+ showText(TX_SPEAKER_MCCOY, TX_VEN0_017);
+ _awayMission->veng.field36 = true;
+ }
+}
+
+void Room::veng0TouchedDoor() {
+ playSoundEffectIndex(SND_DOOR1);
+ // TODO
+}
+
+void Room::veng0UseSTricorderOnComputerBank() {
+ if (!_awayMission->veng.scannedComputerBank) {
+ _awayMission->veng.scannedComputerBank = true;
+ _awayMission->veng.field6c = true;
+
+ spockScan(DIR_S, TX_VEN0_028);
+ showText(TX_SPEAKER_KIRK, TX_VEN0_002);
+ showText(TX_SPEAKER_SPOCK, TX_VEN0_029);
+ showText(TX_SPEAKER_MCCOY, TX_VEN0_020);
+ showText(TX_SPEAKER_SPOCK, TX_VEN0_031);
+ } else
+ showText(TX_SPEAKER_SPOCK, TX_VEN0_025);
+}
+
+void Room::veng0UseSTricorderOnChair() {
+ if (!_awayMission->veng.scannedCaptainsChair) {
+ _awayMission->veng.scannedCaptainsChair = true;
+ _awayMission->veng.field6b = true;
+
+ spockScan(DIR_S, TX_VEN0_32);
+ showText(TX_SPEAKER_PATTERSON, TX_VEN0_035);
+ showText(TX_SPEAKER_SPOCK, TX_VEN0_033);
+ showText(TX_SPEAKER_KIRK, TX_VEN0_004);
+ } else
+ showText(TX_SPEAKER_SPOCK, TX_VEN0_026);
+}
+
+void Room::veng0UseSTricorderAnywhere() {
+ if (!_awayMission->veng.field34)
+ spockScan(DIR_S, TX_VEN0_027);
+}
+
+void Room::veng0UseMccoyOnBeam() {
+ showText(TX_SPEAKER_MCCOY, TX_VEN0_015);
+}
+
+void Room::veng0UseSTricorderOnBeam() {
+ spockScan(DIR_W, TX_VEN0_034);
+ showText(TX_SPEAKER_MCCOY, TX_VEN0_021);
+}
+
+void Room::veng0UseRedshirtOnBeam() {
+ showText(TX_SPEAKER_KIJE, TX_VEN0_037);
+}
+
+void Room::veng0UseSpockOnConsole() {
+ showText(TX_SPEAKER_SPOCK, TX_VEN0_024);
+}
+
+void Room::veng0UseRedshirtOnConsole() {
+ showText(TX_SPEAKER_KIJE, TX_VEN0_038);
+}
+
+void Room::veng0UsePhaserOnBeam() {
+ showText(TX_SPEAKER_SPOCK, TX_VEN0_013);
+}
+
+void Room::veng0UseMccoyOnDeadCrewman() {
+ mccoyScan(DIR_S, TX_VEN0_016);
+}
+
+void Room::veng0UseSawOnBeam() {
+ if (_awayMission->veng.beamState == 1 || _awayMission->veng.beamState == 2)
+ showText(TX_VEN0N008);
+ else {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x24, 0xc2, &Room::veng0KirkReachedSaw);
+ }
+}
+
+void Room::veng0KirkReachedSaw() {
+ loadActorAnimC(OBJECT_KIRK, "kcutw", -1, -1, &Room::veng0DoneCuttingBeam);
+ _awayMission->timers[0] = 8;
+}
+
+void Room::veng0Timer0Expired() {
+ playVoc("MUR3E2");
+ loadActorAnim2(OBJECT_9, "s7r0s1", 0, 0xc7);
+ loadActorAnim2(OBJECT_10, "s7r0b1", 0, 0xc7);
+ playSoundEffectIndex(SND_PHASSHOT);
+}
+
+void Room::veng0DoneCuttingBeam() {
+ _awayMission->disableInput = false;
+ loadActorStandAnim(OBJECT_9);
+ loadActorStandAnim(OBJECT_10);
+
+ showText(TX_VEN0N007);
+
+ _awayMission->veng.beamState = 1;
+ veng0GetBeam();
+}
+
+void Room::veng0GetBeam() {
+ if (_awayMission->veng.beamState == 1) {
+ showText(TX_VEN0N019);
+ _awayMission->veng.beamState = 2;
+ giveItem(OBJECT_IBEAM);
+ loadActorAnim2(OBJECT_BEAM, "s7r0bf", 0x0e, 0x9a);
+ } else
+ showText(TX_VEN0N009);
+}
+
+void Room::veng0TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_VEN0_001);
+}
+
+void Room::veng0TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_VEN0_014);
+}
+
+void Room::veng0TalkToSpock() {
+ if (_awayMission->veng.scannedComputerBank && _awayMission->veng.scannedCaptainsChair)
+ showText(TX_SPEAKER_SPOCK, TX_VEN0_012);
+ else
+ showText(TX_SPEAKER_SPOCK, TX_VEN0_023);
+}
+
+void Room::veng0TalkToRedshirt() {
+ showText(TX_SPEAKER_KIJE, TX_VEN0_036);
+}
+
+void Room::veng0LookAtPatterson() {
+ showText(TX_VEN0N004);
+}
+
+void Room::veng0LookAtDeadCrewman2() {
+ showText(TX_VEN0N017);
+}
+
+void Room::veng0LookAtComputerBank() {
+ showText(TX_VEN0N005);
+}
+
+void Room::veng0LookAtChair() {
+ showText(TX_VEN0N015);
+}
+
+void Room::veng0LookAtKirk() {
+ showText(TX_VEN0N001);
+}
+
+void Room::veng0LookAtSpock() {
+ showText(TX_VEN0N006);
+}
+
+void Room::veng0LookAtMccoy() {
+ showText(TX_VEN0N002);
+}
+
+void Room::veng0LookAtRedshirt() {
+ showText(TX_VEN0N003);
+}
+
+void Room::veng0LookAtViewscreen() {
+ showText(TX_VEN0N010);
+}
+
+void Room::veng0LookAtHelmConsole() {
+ showText(TX_VEN0N011);
+}
+
+void Room::veng0LookAtNavConsole() {
+ showText(TX_VEN0N012);
+}
+
+void Room::veng0LookAtBeam() {
+ if (_awayMission->veng.beamState == 1)
+ showText(TX_VEN0N013);
+ else
+ showText(TX_VEN0N000);
+}
+
+void Room::veng0LookAnywhere() {
+ showText(TX_VEN0N018);
+}
+
+void Room::veng0LookAtDeadCrewman1() {
+ showText(TX_VEN0N016);
+}
+
+void Room::veng0UseMccoyOnLivingCrewman() {
+ if (!_awayMission->veng.bridgeCrewmanDead) {
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
+ walkCrewmanC(OBJECT_MCCOY, 0xdc, 0xa0, &Room::veng0MccoyReachedCrewman);
+ } else
+ showText(TX_SPEAKER_MCCOY, TX_VEN0_016);
+}
+
+void Room::veng0MccoyReachedCrewman() {
+ _awayMission->veng.bridgeCrewmanDead = true;
+ _awayMission->veng.field68 = true;
+
+ mccoyScan(DIR_E, TX_VEN0_022);
+ showText(TX_SPEAKER_KIRK, TX_VEN0_003);
+ loadActorAnimC(OBJECT_MCCOY, "mscane", -1, -1, &Room::veng0MccoyScannedCrewman);
+}
+
+void Room::veng0MccoyScannedCrewman() {
+ showText(TX_SPEAKER_MCCOY, TX_VEN0_019);
+ _awayMission->disableInput = false;
+}
+
+}
diff --git a/engines/startrek/rooms/veng1.cpp b/engines/startrek/rooms/veng1.cpp
new file mode 100644
index 0000000..a7e89dd
--- /dev/null
+++ b/engines/startrek/rooms/veng1.cpp
@@ -0,0 +1,41 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+extern const RoomAction veng1ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::veng1Tick1 },
+};
+
+extern const int veng1NumActions = ARRAYSIZE(veng1ActionList);
+
+
+void Room::veng1Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/veng2.cpp b/engines/startrek/rooms/veng2.cpp
new file mode 100644
index 0000000..2e00f0a
--- /dev/null
+++ b/engines/startrek/rooms/veng2.cpp
@@ -0,0 +1,41 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+extern const RoomAction veng2ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::veng2Tick1 },
+};
+
+extern const int veng2NumActions = ARRAYSIZE(veng2ActionList);
+
+
+void Room::veng2Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/veng3.cpp b/engines/startrek/rooms/veng3.cpp
new file mode 100644
index 0000000..5c0e3c8
--- /dev/null
+++ b/engines/startrek/rooms/veng3.cpp
@@ -0,0 +1,41 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+extern const RoomAction veng3ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::veng3Tick1 },
+};
+
+extern const int veng3NumActions = ARRAYSIZE(veng3ActionList);
+
+
+void Room::veng3Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/veng4.cpp b/engines/startrek/rooms/veng4.cpp
new file mode 100644
index 0000000..836fcce
--- /dev/null
+++ b/engines/startrek/rooms/veng4.cpp
@@ -0,0 +1,41 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+extern const RoomAction veng4ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::veng4Tick1 },
+};
+
+extern const int veng4NumActions = ARRAYSIZE(veng4ActionList);
+
+
+void Room::veng4Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/veng5.cpp b/engines/startrek/rooms/veng5.cpp
new file mode 100644
index 0000000..9f5d263
--- /dev/null
+++ b/engines/startrek/rooms/veng5.cpp
@@ -0,0 +1,41 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+extern const RoomAction veng5ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::veng5Tick1 },
+};
+
+extern const int veng5NumActions = ARRAYSIZE(veng5ActionList);
+
+
+void Room::veng5Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/veng6.cpp b/engines/startrek/rooms/veng6.cpp
new file mode 100644
index 0000000..78743d4
--- /dev/null
+++ b/engines/startrek/rooms/veng6.cpp
@@ -0,0 +1,41 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+extern const RoomAction veng6ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::veng6Tick1 },
+};
+
+extern const int veng6NumActions = ARRAYSIZE(veng6ActionList);
+
+
+void Room::veng6Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/veng7.cpp b/engines/startrek/rooms/veng7.cpp
new file mode 100644
index 0000000..5d5e5a9
--- /dev/null
+++ b/engines/startrek/rooms/veng7.cpp
@@ -0,0 +1,41 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+extern const RoomAction veng7ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::veng7Tick1 },
+};
+
+extern const int veng7NumActions = ARRAYSIZE(veng7ActionList);
+
+
+void Room::veng7Tick1() {
+}
+
+}
diff --git a/engines/startrek/rooms/veng8.cpp b/engines/startrek/rooms/veng8.cpp
new file mode 100644
index 0000000..d8ad9e0
--- /dev/null
+++ b/engines/startrek/rooms/veng8.cpp
@@ -0,0 +1,41 @@
+/* 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 "startrek/room.h"
+
+#define OBJECT_DOOR 8
+
+#define HOTSPOT_20 0x20
+
+namespace StarTrek {
+
+extern const RoomAction veng8ActionList[] = {
+ { {ACTION_TICK, 1, 0, 0}, &Room::veng8Tick1 },
+};
+
+extern const int veng8NumActions = ARRAYSIZE(veng8ActionList);
+
+
+void Room::veng8Tick1() {
+}
+
+}
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 02c3c7a..5dfda3b 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -17,6 +17,7 @@ extern const char *const g_gameStrings[] = {
"Lt. Uhura",
"Mr. Scott",
"Mr. Sulu",
+ "Mr. Chekov",
"Ensign Everts",
"Prel. Angiven",
@@ -62,6 +63,9 @@ extern const char *const g_gameStrings[] = {
"Ensign Mosher",
+ "Ensign Kije",
+ "*Capt. Patterson*",
+
"#BRID\\BRIDU146#Nothing to report, Captain.",
"#GENE\\G_024#Fascinating.",
@@ -2665,6 +2669,85 @@ extern const char *const g_gameStrings[] = {
"#SIN5\\SIN5N013#History will not be kind to you. Better luck next time.",
+ "#VEN0\\VEN0_001#Dick Patterson and I weren't exactly friends, but this...",
+ "#VEN0\\VEN0_002#Any idea of which one it was?",
+ "#VEN0\\VEN0_003#Can you bring him back?",
+ "#VEN0\\VEN0_004#Dick Patterson was never one for making long speeches.",
+ "#VEN0\\VEN0_005#Do the sensors read any other ships in the sector?",
+ "#VEN0\\VEN0_006#I don't know, Bones. We're too far from the Klingon and Romulan borders for it to be one of their ships.",
+ "#VEN0\\VEN0_007#It's a mess, Scotty. Life support's functioning, but that's about it.",
+ "#VEN0\\VEN0_008#Kirk Here. What is it, Scotty?",
+ "#VEN0\\VEN0_009#Mr. Scott, we will continue here. Assist the trade ship and return here. If we need assistance, we will contact you.",
+ "#VEN0\\VEN0_010#Well, Gentlemen. Let's see if we can reestablish power.",
+ "#VEN0\\VEN0_011#Yes, Scotty. Just don't take too long. Kirk out.",
+ "#VEN0\\VEN0_012#Captain, I believe we have exhausted all our options concerning data retrieval here on the bridge.",
+ "#VEN0\\VEN0_013#Captain, these phasers are not configured for fine cutting. We could cause extensive damage.",
+ "#VEN0\\VEN0_014#What kind of a butcher would do this sort of thing?",
+ "#VEN0\\VEN0_015#I'm a doctor, not a civil engineer!",
+ "#VEN0\\VEN0_016#They are dead, Jim. All of them.",
+ "#VEN0\\VEN0_017#Jim, don't forget, there's another survivor on board. We've got to find him!",
+ "#VEN0\\VEN0_018#My God, Jim. What kind of butcher would do something like this?",
+ "#VEN0\\VEN0_019#Punctured lung, nerve damage, brain damage, fractured arm and ribs; it's a miracle he lasted as long as he did. He's not coming back, Jim.",
+ "#VEN0\\VEN0_020#Someone must have tampered with the computer records!",
+ "#VEN0\\VEN0_021#Thanks for the dissertation, Spock.",
+ "#VEN0\\VEN0_022#We're too late. This man must have just died a few moments ago.",
+ "#VEN0\\VEN0_023#I recommend checking as many of the logs and sensor records as possible.",
+ "#VEN0\\VEN0_024#The controls have been totally destroyed. Undoubtedly due to circuit overloads caused by the battle.",
+ "#VEN0\\VEN0_025#There are no more computer entries accessible from this station.",
+ "#VEN0\\VEN0_026#There are no more log entries.",
+ "#VEN0\\VEN0_027#Tricorder readings indicate that the ship is running on minimal battery power. Only life support and essential systems are currently running.",
+ "#VEN0\\VEN0_028#Captain, records indicate that this ship was attacked by a Constitution-class Starship.",
+ "#VEN0\\VEN0_029#I am reading a record of the transponder signal. NCC-1701. It's the Enterprise, Captain.",
+ "#VEN0\\VEN0_030#I've done a primary scan of the Republic's systems. Main and auxiliary power is out. Life support is stable. I also read that communications are operable.",
+ "#VEN0\\VEN0_031#May I remind you, Doctor, that the main computer of a Constitution class starship has safeguards against such an intrusion. Furthermore, I do not see any discrepancies in any of the files that I am able to access.",
+ "#VEN0\\VEN0_32#My tricorder has picked up the final entry of the Republic.",
+ "#VEN0\\VEN0_033#That's all there is, Captain.",
+ "#VEN0\\VEN0_034#This is a standard Tritanium/Duranium support beam. Tricorder readings indicate that although it has experienced enough tensile stress to push it from one side of its mooring, it has not elastically deformed beyond its ability to support a compressive load.",
+ "#VEN0\\VEN0_035#We are under attack. Our sensors are inoperative. We're trying to get shields up. Our rear deflector's down. It appears our enemy is a Constitution class starship. We have tried to defend ourselves. We've hailed them, but no response.",
+ "#VEN0\\VEN0_036#I feel sick.",
+ "#VEN0\\VEN0_037#I think I remember seeing a ton of these at spacedock 4.",
+ "#VEN0\\VEN0_038#There is no response, Captain. The controls are completely dead.",
+ "#VEN0\\VEN0_039#Besides the trade wessel, this sector is clear, Sir.",
+ "#VEN0\\VEN0_S12#Enterprise to Captain Kirk.",
+ "#VEN0\\VEN0_S15#Should we beam you back, Captain?",
+ "#VEN0\\VEN0_S52#We've picked up a distress signal. It appears a trading vessel is having a wee bit of trouble with their warp drive. What condition is the Republic in?",
+ "#VEN0\\VEN0_S54#You sure you'll be all right, Captain?",
+ "#VEN0\\VEN0N000#A common Tritanium/Duranium support beam which has snapped away from the hull.",
+ "#VEN0\\VEN0N001#Captain James T. Kirk. This is not one of the best days of his life.",
+ "#VEN0\\VEN0N002#Dr. Leonard McCoy. You have rarely seen him as shaken as he is now.",
+ "#VEN0\\VEN0N003#Ensign Kije, who wishes that Lieutenant Stackpole had drawn this assignment.",
+ "#VEN0\\VEN0N004#Here is the body of Captain Patterson of the Republic. He didn't die without a fight.",
+ "#VEN0\\VEN0N005#Main computer banks. They appear to have been damaged.",
+ "#VEN0\\VEN0N006#Mr. Spock, awaiting orders.",
+ "#VEN0\\VEN0N007#The molecular saw easily cuts through the beam, separating it from the hull.",
+ "#VEN0\\VEN0N008#The support beam has already been detached from the hull.",
+ "#VEN0\\VEN0N009#The support beam is still attached to the hull.",
+ "#VEN0\\VEN0N010#The viewscreen is not functioning.",
+ "#VEN0\\VEN0N011#These are the helm controls for the Republic. They are currently inactive.",
+ "#VEN0\\VEN0N012#These are the navigation controls for the Republic. They are currently inactive.",
+ "#VEN0\\VEN0N013#This beam has been detached from the hull.",
+ "#VEN0\\VEN0N015#This is is the Captain's chair, where the Captain's log is stored.",
+ "#VEN0\\VEN0N016#This man is dead.",
+ "#VEN0\\VEN0N017#This person is dead.",
+ "#VEN0\\VEN0N018#You are in what's left of the bridge of the U.S.S. Republic.",
+ "#VEN0\\VEN0N019#You pick up the beam. It's a little heavy, but you manage it.",
+
+
+ "#VEN2\\VEN2_028#Yes, Uhura. Just wanted a status report. Kirk out.",
+ "#VEN2\\VEN2_066#They are jamming all frequencies, Captain. We will not be able to contact the Enterprise.",
+ "#VEN2\\VEN2_098#What are you stalling for? Lower your shields.",
+ "#VEN2\\VEN2U093#Enterprise here. We're still tracking the distress call. Are you all right, Sir?",
+
+
+ "#VEN4\\VEN4N010#This is an empty hypodermic injector.",
+
+
+ "#VEN6\\VEN6N007#The hypo is now filled with multipurpose oil.",
+
+
+ "#VENA\\VENA_F32#The landing party has been taken captive by the Elasi, and you know Starfleet does not negotiate with terrorists. As you look forward to a long captivity you wonder who will take command of the Enterprise. Better luck next time.",
+ "#VENA\\VENA_F34#Captain, it would be unwise to use your phaser considering the already extensive damage sustained by the Republic.",
+ "#VENA\\VENA_F40#The Elasi fire photon torpedoes. The Republic has been destroyed.",
"#VENA\\VENA_F41#Kirk out.",
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index fd36114..dca9713 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -75,6 +75,7 @@ enum GameStringIDs {
TX_SPEAKER_UHURA,
TX_SPEAKER_SCOTT,
TX_SPEAKER_SULU,
+ TX_SPEAKER_CHEKOV,
TX_SPEAKER_EVERTS,
TX_SPEAKER_ANGIVEN,
@@ -120,6 +121,9 @@ enum GameStringIDs {
TX_SPEAKER_MOSHER,
+ TX_SPEAKER_KIJE,
+ TX_SPEAKER_PATTERSON,
+
TX_BRIDU146,
TX_G_024,
@@ -2770,6 +2774,88 @@ enum GameStringIDs {
TX_SIN5N013,
+ TX_VEN0_001,
+ TX_VEN0_002,
+ TX_VEN0_003,
+ TX_VEN0_004,
+ TX_VEN0_005,
+ TX_VEN0_006,
+ TX_VEN0_007,
+ TX_VEN0_008,
+ TX_VEN0_009,
+ TX_VEN0_010,
+ TX_VEN0_011,
+ TX_VEN0_012,
+ TX_VEN0_013,
+ TX_VEN0_014,
+ TX_VEN0_015,
+ TX_VEN0_016,
+ TX_VEN0_017,
+ TX_VEN0_018,
+ TX_VEN0_019,
+ TX_VEN0_020,
+ TX_VEN0_021,
+ TX_VEN0_022,
+ TX_VEN0_023,
+ TX_VEN0_024,
+ TX_VEN0_025,
+ TX_VEN0_026,
+ TX_VEN0_027,
+ TX_VEN0_028,
+ TX_VEN0_029,
+ TX_VEN0_030,
+ TX_VEN0_031,
+ TX_VEN0_32,
+ TX_VEN0_033,
+ TX_VEN0_034,
+ TX_VEN0_035,
+ TX_VEN0_036,
+ TX_VEN0_037,
+ TX_VEN0_038,
+ TX_VEN0_039,
+ TX_VEN0_S12,
+ // UNUSED: S13 -> S14 (same line S12, multiple recordings)
+ TX_VEN0_S15,
+ TX_VEN0_S52,
+ TX_VEN0_S54,
+ TX_VEN0N000,
+ TX_VEN0N001,
+ TX_VEN0N002,
+ TX_VEN0N003,
+ TX_VEN0N004,
+ TX_VEN0N005,
+ TX_VEN0N006,
+ TX_VEN0N007,
+ TX_VEN0N008,
+ TX_VEN0N009,
+ TX_VEN0N010,
+ TX_VEN0N011,
+ TX_VEN0N012,
+ TX_VEN0N013,
+ // MISSING
+ TX_VEN0N015,
+ TX_VEN0N016,
+ TX_VEN0N017,
+ TX_VEN0N018,
+ TX_VEN0N019,
+ // UNUSED: VEN0_F15
+
+
+ TX_VEN2_028,
+ TX_VEN2_066,
+ TX_VEN2_098,
+ TX_VEN2U093,
+
+
+ TX_VEN4N010,
+
+
+ TX_VEN6N007,
+
+
+ TX_VENA_F32,
+ TX_VENA_F34,
+ TX_VENA_F40,
TX_VENA_F41,
Commit: bd1b9f66cb7073a0548d67bca3f41dbb21606a69
https://github.com/scummvm/scummvm/commit/bd1b9f66cb7073a0548d67bca3f41dbb21606a69
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Implement republic map screen
Changed paths:
engines/startrek/graphics.cpp
engines/startrek/graphics.h
engines/startrek/menu.cpp
engines/startrek/room.cpp
engines/startrek/room.h
engines/startrek/rooms/veng0.cpp
engines/startrek/startrek.h
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 53bdf38..023ca99 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -221,6 +221,10 @@ void Graphics::clearPri() {
memset(_priData, 0, sizeof(_priData));
}
+void Graphics::setPri(byte val) {
+ memset(_priData, val, sizeof(_priData));
+}
+
byte Graphics::getPriValue(int x, int y) {
assert(_screenRect.contains(x, y));
@@ -459,128 +463,127 @@ bool compareSpritesByLayer(Sprite *s1, Sprite *s2) {
void Graphics::drawAllSprites(bool updateScreen) {
// TODO: different video modes?
- if (_numSprites == 0)
- return;
-
- // Sort sprites by layer
- Common::sort(_sprites, _sprites + _numSprites, &compareSpritesByLayer);
-
- // Update sprite rectangles
- for (int i = 0; i < _numSprites; i++) {
- Sprite *spr = _sprites[i];
- Common::Rect rect;
-
- rect.left = spr->pos.x - spr->bitmap->xoffset;
- rect.top = spr->pos.y - spr->bitmap->yoffset;
- rect.right = rect.left + spr->bitmap->width;
- rect.bottom = rect.top + spr->bitmap->height;
-
- spr->drawX = rect.left;
- spr->drawY = rect.top;
-
- spr->drawRect = rect.findIntersectingRect(_screenRect);
-
- if (!spr->drawRect.isEmpty()) { // At least partly on-screen
- if (spr->lastDrawRect.left < spr->lastDrawRect.right) {
- // If the sprite's position is close to where it was last time it was
- // drawn, combine the two rectangles and redraw that whole section.
- // Otherwise, redraw the old position and current position separately.
- rect = spr->drawRect.findIntersectingRect(spr->lastDrawRect);
-
- if (rect.isEmpty())
- spr->rect2Valid = 0;
- else {
- spr->rectangle2 = getRectEncompassing(spr->drawRect, spr->lastDrawRect);
+ if (_numSprites != 0) {
+ // Sort sprites by layer
+ Common::sort(_sprites, _sprites + _numSprites, &compareSpritesByLayer);
+
+ // Update sprite rectangles
+ for (int i = 0; i < _numSprites; i++) {
+ Sprite *spr = _sprites[i];
+ Common::Rect rect;
+
+ rect.left = spr->pos.x - spr->bitmap->xoffset;
+ rect.top = spr->pos.y - spr->bitmap->yoffset;
+ rect.right = rect.left + spr->bitmap->width;
+ rect.bottom = rect.top + spr->bitmap->height;
+
+ spr->drawX = rect.left;
+ spr->drawY = rect.top;
+
+ spr->drawRect = rect.findIntersectingRect(_screenRect);
+
+ if (!spr->drawRect.isEmpty()) { // At least partly on-screen
+ if (spr->lastDrawRect.left < spr->lastDrawRect.right) {
+ // If the sprite's position is close to where it was last time it was
+ // drawn, combine the two rectangles and redraw that whole section.
+ // Otherwise, redraw the old position and current position separately.
+ rect = spr->drawRect.findIntersectingRect(spr->lastDrawRect);
+
+ if (rect.isEmpty())
+ spr->rect2Valid = 0;
+ else {
+ spr->rectangle2 = getRectEncompassing(spr->drawRect, spr->lastDrawRect);
+ spr->rect2Valid = 1;
+ }
+ } else {
+ spr->rectangle2 = spr->drawRect;
spr->rect2Valid = 1;
}
- } else {
- spr->rectangle2 = spr->drawRect;
- spr->rect2Valid = 1;
- }
- spr->isOnScreen = 1;
- } else { // Off-screen
- spr->rect2Valid = 0;
- spr->isOnScreen = 0;
+ spr->isOnScreen = 1;
+ } else { // Off-screen
+ spr->rect2Valid = 0;
+ spr->isOnScreen = 0;
+ }
}
- }
- // Determine what portions of the screen need to be updated
- Common::Rect dirtyRects[MAX_SPRITES * 2];
- int numDirtyRects = 0;
+ // Determine what portions of the screen need to be updated
+ Common::Rect dirtyRects[MAX_SPRITES * 2];
+ int numDirtyRects = 0;
- for (int i = 0; i < _numSprites; i++) {
- Sprite *spr = _sprites[i];
+ for (int i = 0; i < _numSprites; i++) {
+ Sprite *spr = _sprites[i];
- if (spr->bitmapChanged) {
- if (spr->isOnScreen) {
- if (spr->rect2Valid) {
- dirtyRects[numDirtyRects++] = spr->rectangle2;
+ if (spr->bitmapChanged) {
+ if (spr->isOnScreen) {
+ if (spr->rect2Valid) {
+ dirtyRects[numDirtyRects++] = spr->rectangle2;
+ } else {
+ dirtyRects[numDirtyRects++] = spr->drawRect;
+ dirtyRects[numDirtyRects++] = spr->lastDrawRect;
+ }
} else {
- dirtyRects[numDirtyRects++] = spr->drawRect;
dirtyRects[numDirtyRects++] = spr->lastDrawRect;
}
- } else {
- dirtyRects[numDirtyRects++] = spr->lastDrawRect;
}
}
- }
- // Redraw the background on every dirty rectangle
- const ::Graphics::PixelFormat format = ::Graphics::PixelFormat::createFormatCLUT8();
- ::Graphics::Surface surface;
- surface.create(SCREEN_WIDTH, SCREEN_HEIGHT, format);
+ // Redraw the background on every dirty rectangle
+ const ::Graphics::PixelFormat format = ::Graphics::PixelFormat::createFormatCLUT8();
+ ::Graphics::Surface surface;
+ surface.create(SCREEN_WIDTH, SCREEN_HEIGHT, format);
- for (int i = 0; i < numDirtyRects; i++) {
- Common::Rect &r = dirtyRects[i];
- if (r.width() == 0 || r.height() == 0)
- continue;
+ for (int i = 0; i < numDirtyRects; i++) {
+ Common::Rect &r = dirtyRects[i];
+ if (r.width() == 0 || r.height() == 0)
+ continue;
- int offset = r.top * SCREEN_WIDTH + r.left;
- surface.copyRectToSurface(_backgroundImage->pixels + offset, SCREEN_WIDTH, r.left, r.top, r.width(), r.height());
- }
+ int offset = r.top * SCREEN_WIDTH + r.left;
+ surface.copyRectToSurface(_backgroundImage->pixels + offset, SCREEN_WIDTH, r.left, r.top, r.width(), r.height());
+ }
- // For each sprite, merge the rectangles that overlap with it and redraw the sprite.
- for (int i = 0; i < _numSprites; i++) {
- Sprite *spr = _sprites[i];
+ // For each sprite, merge the rectangles that overlap with it and redraw the sprite.
+ for (int i = 0; i < _numSprites; i++) {
+ Sprite *spr = _sprites[i];
- if (!spr->field16 && spr->isOnScreen) {
- bool mustRedrawSprite = false;
- Common::Rect rect2;
+ if (!spr->field16 && spr->isOnScreen) {
+ bool mustRedrawSprite = false;
+ Common::Rect rect2;
- for (int j = 0; j < numDirtyRects; j++) {
- Common::Rect rect1 = spr->drawRect.findIntersectingRect(dirtyRects[j]);
+ for (int j = 0; j < numDirtyRects; j++) {
+ Common::Rect rect1 = spr->drawRect.findIntersectingRect(dirtyRects[j]);
- if (rect1.width() != 0 && rect1.height() != 0) {
- if (mustRedrawSprite)
- rect2 = getRectEncompassing(rect1, rect2);
- else
- rect2 = rect1;
- mustRedrawSprite = true;
+ if (rect1.width() != 0 && rect1.height() != 0) {
+ if (mustRedrawSprite)
+ rect2 = getRectEncompassing(rect1, rect2);
+ else
+ rect2 = rect1;
+ mustRedrawSprite = true;
+ }
}
+
+ if (mustRedrawSprite)
+ drawSprite(*spr, &surface, rect2);
}
- if (mustRedrawSprite)
- drawSprite(*spr, &surface, rect2);
+ spr->field16 = false;
+ spr->bitmapChanged = false;
+ spr->lastDrawRect = spr->drawRect;
}
- spr->field16 = false;
- spr->bitmapChanged = false;
- spr->lastDrawRect = spr->drawRect;
- }
+ // Copy dirty rects to screen
+ for (int j = 0; j < numDirtyRects; j++) {
+ Common::Rect &r = dirtyRects[j];
+ if (r.width() == 0 || r.height() == 0)
+ continue;
- // Copy dirty rects to screen
- for (int j = 0; j < numDirtyRects; j++) {
- Common::Rect &r = dirtyRects[j];
- if (r.width() == 0 || r.height() == 0)
- continue;
+ int offset = r.left + r.top * SCREEN_WIDTH;
+ _vm->_system->copyRectToScreen((byte *)surface.getPixels() + offset, SCREEN_WIDTH, r.left, r.top, r.width(), r.height());
+ }
- int offset = r.left + r.top * SCREEN_WIDTH;
- _vm->_system->copyRectToScreen((byte *)surface.getPixels() + offset, SCREEN_WIDTH, r.left, r.top, r.width(), r.height());
+ surface.free();
}
- surface.free();
-
if (updateScreen)
this->updateScreen();
}
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h
index 46709cd..8ba46f2 100644
--- a/engines/startrek/graphics.h
+++ b/engines/startrek/graphics.h
@@ -81,6 +81,7 @@ public:
void loadPri(const Common::String &priFile);
void clearPri();
+ void setPri(byte val);
byte getPriValue(int x, int y);
SharedPtr<Bitmap> loadBitmap(String basename);
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index 13ca59b..72730fd 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -1010,4 +1010,222 @@ void StarTrekEngine::saveTextDisplayMode(int value) {
// TODO;
}
+void StarTrekEngine::showRepublicMap(int16 arg0, int16 turbolift) {
+ _gfx->fadeoutScreen();
+ _sound->stopAllVocSounds();
+
+ bool spriteLoaded = false;
+ int16 clickedArea = 0;
+
+ actorFunc1();
+ _gfx->pushSprites();
+
+ if (!_awayMission.veng.scannedComputerBank) {
+ _gfx->setBackgroundImage(_gfx->loadBitmap("veng9b"));
+ _gfx->copyBackgroundScreen();
+ _system->updateScreen();
+ _gfx->setPri(15);
+ _gfx->fadeinScreen();
+
+ // TODO: hide mouse sprite?
+
+ bool exitLoop = 0;
+ int16 var54 = 0x2d;
+
+ while (!exitLoop) {
+ TrekEvent event;
+ if (!popNextEvent(&event))
+ continue;
+
+ switch (event.type) {
+ case TREKEVENT_TICK:
+ if (--var54 == 0)
+ exitLoop = true;
+ break;
+
+ case TREKEVENT_LBUTTONDOWN:
+ case TREKEVENT_RBUTTONDOWN:
+ exitLoop = true;
+ break;
+
+ case TREKEVENT_KEYDOWN:
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_ESCAPE:
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ case Common::KEYCODE_SPACE:
+ exitLoop = true;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ _awayMission.veng.scannedComputerBank = true; // FIXME?
+ _gfx->fadeoutScreen();
+ }
+
+ _gfx->setBackgroundImage(_gfx->loadBitmap("veng9"));
+ _gfx->copyBackgroundScreen();
+ _system->updateScreen();
+ _gfx->setPri(15);
+
+ Sprite someSprite;
+ _gfx->drawAllSprites();
+ _gfx->warpMouse(_gfx->getMousePos().x, 96);
+ _gfx->fadeinScreen();
+
+ bool exitLoop = false;
+
+ while (!exitLoop) {
+ TrekEvent event;
+ if (!popNextEvent(&event))
+ continue;
+
+ switch (event.type) {
+ case TREKEVENT_TICK:
+ _frameIndex++;
+ // sub_12fff();
+ _gfx->drawAllSprites();
+ break;
+
+ case TREKEVENT_LBUTTONDOWN: {
+lclick:
+ clickedArea = getRepublicMapAreaOrFailure(turbolift);
+ if (clickedArea == 0) {
+ } else if (clickedArea == 6) {
+ Common::String text = "#GENE\\GENE_F14#Turbolift access is blocked by an extremely high radiation level.";
+ showTextbox("", text, 50, 50, TEXTCOLOR_YELLOW, 0);
+ } else if (clickedArea == 7) {
+ Common::String text = "#GENE\\GENE_F15#This turbolift cannot reach that area of the ship.";
+ showTextbox("", text, 50, 50, TEXTCOLOR_YELLOW, 0);
+ } else
+ exitLoop = true;
+ break;
+ }
+
+ case TREKEVENT_MOUSEMOVE: {
+ if (_gfx->getMousePos().y < 96) // TODO: more elegant solution
+ _gfx->warpMouse(_gfx->getMousePos().x, 96);
+
+ clickedArea = getRepublicMapAreaAtMouse();
+ if (clickedArea != 0) {
+ if (!spriteLoaded) {
+ _gfx->addSprite(&someSprite);
+ someSprite.setXYAndPriority(3, 168, 15);
+ someSprite.bitmap = _gfx->loadBitmap(Common::String::format("turbo%d", clickedArea));
+ spriteLoaded = true;
+ }
+ } else {
+ if (spriteLoaded) {
+ someSprite.dontDrawNextFrame();
+ _gfx->drawAllSprites();
+ _gfx->delSprite(&someSprite);
+ someSprite.bitmap.reset();
+ spriteLoaded = false;
+ }
+ }
+ break;
+ }
+
+ case TREKEVENT_KEYDOWN:
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ case Common::KEYCODE_F1:
+ goto lclick;
+
+ default:
+ break;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ _gfx->fadeoutScreen();
+ someSprite.bitmap.reset();
+ _gfx->popSprites();
+
+ _gfx->loadPri(_screenName);
+ _gfx->setBackgroundImage(_gfx->loadBitmap(_screenName));
+ _gfx->copyBackgroundScreen();
+ _system->updateScreen();
+
+ _gfx->drawAllSprites();
+
+ int16 roomIndex, spawnIndex;
+ if (clickedArea == 1) {
+ roomIndex = 0;
+ spawnIndex = 1;
+ } else if (clickedArea == 2) {
+ roomIndex = 1;
+ spawnIndex = 1;
+ } else if (clickedArea == 3 && turbolift == 0) {
+ roomIndex = 3;
+ spawnIndex = 1;
+ } else if (clickedArea == 3 && turbolift == 1) {
+ roomIndex = 3;
+ spawnIndex = 0;
+ } else if (clickedArea == 4) {
+ roomIndex = 5;
+ spawnIndex = 1;
+ } else if (clickedArea == 5) {
+ roomIndex = 7;
+ spawnIndex = 1;
+ } else {
+ warning("Unknown room selected");
+ roomIndex = 0;
+ spawnIndex = 1;
+ }
+
+ _roomIndexToLoad = roomIndex;
+ _spawnIndexToLoad = spawnIndex;
+}
+
+int StarTrekEngine::getRepublicMapAreaAtMouse() {
+ Common::Point mouse = _gfx->getMousePos();
+
+ if (mouse.x >= 0x7f && mouse.x <= 0x91 && mouse.y >= 0x78 && mouse.y <= 0x7b)
+ return 1;
+ else if (mouse.x >= 0x6e && mouse.x <= 0x7e && mouse.y >= 0x83 && mouse.y <= 0x87)
+ return 2;
+ else if (mouse.x >= 0x95 && mouse.x <= 0xad && mouse.y >= 0x8f && mouse.y <= 0x93)
+ return 3;
+ else if (mouse.x >= 0xef && mouse.x <= 0xfd && mouse.y >= 0x98 && mouse.y <= 0xa0)
+ return 4;
+ else if (mouse.x >= 0x6b && mouse.x <= 0x80 && mouse.y >= 0xa3 && mouse.y <= 0xa7)
+ return 5;
+ else if (mouse.x >= 0x6e && mouse.x <= 0x88 && mouse.y >= 0xab && mouse.y <= 0xaf)
+ return 6;
+ else
+ return 0;
+}
+
+int StarTrekEngine::getRepublicMapAreaOrFailure(int16 turbolift) {
+ Common::Point mouse = _gfx->getMousePos();
+
+ if (mouse.x >= 0x7f && mouse.x <= 0x91 && mouse.y >= 0x78 && mouse.y <= 0x7b)
+ return turbolift == 0 ? 1 : 7;
+ else if (mouse.x >= 0x6e && mouse.x <= 0x7e && mouse.y >= 0x83 && mouse.y <= 0x87)
+ return turbolift == 0 ? 2 : 7;
+ else if (mouse.x >= 0x95 && mouse.x <= 0xad && mouse.y >= 0x8f && mouse.y <= 0x93)
+ return 3;
+ else if (mouse.x >= 0xef && mouse.x <= 0xfd && mouse.y >= 0x98 && mouse.y <= 0xa0)
+ return turbolift == 1 ? 4 : 7;
+ else if (mouse.x >= 0x6b && mouse.x <= 0x80 && mouse.y >= 0xa3 && mouse.y <= 0xa7)
+ return turbolift == 1 ? 5 : 7;
+ else if (mouse.x >= 0x6e && mouse.x <= 0x88 && mouse.y >= 0xab && mouse.y <= 0xaf)
+ return 6;
+ return 0;
+}
+
} // End of namespace StarTrek
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 6a72537..a86d31b 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -503,6 +503,10 @@ int Room::showCodeInputBox(const char * const *codes) {
return retval;
}
+void Room::showRepublicMap(int16 arg0, int16 arg2) {
+ _vm->showRepublicMap(arg0, arg2);
+}
+
void Room::playVoc(Common::String filename) {
_vm->_sound->playVoc(filename);
}
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 876ffe1..9712ee9 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -246,6 +246,10 @@ private:
*/
int showCodeInputBox(const char * const *codes);
/**
+ * Cmd 0x14: Show a map of the republic for mission 7
+ */
+ void showRepublicMap(int16 arg0, int16 arg2);
+ /**
* Cmd 0x15
*/
void playVoc(Common::String filename);
diff --git a/engines/startrek/rooms/veng0.cpp b/engines/startrek/rooms/veng0.cpp
index 76d9603..c290336 100644
--- a/engines/startrek/rooms/veng0.cpp
+++ b/engines/startrek/rooms/veng0.cpp
@@ -144,7 +144,7 @@ void Room::veng0Tick50() {
void Room::veng0TouchedDoor() {
playSoundEffectIndex(SND_DOOR1);
- // TODO
+ showRepublicMap(0, 0);
}
void Room::veng0UseSTricorderOnComputerBank() {
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index f96c7b8..373778e 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -626,6 +626,20 @@ public:
int loadTextDisplayMode();
void saveTextDisplayMode(int value);
+ /**
+ * Show the republic map, only used in mission 7.
+ */
+ void showRepublicMap(int16 arg0, int16 turbolift);
+ /**
+ * Checks the mouse position to return and index for the area selected.
+ */
+ int getRepublicMapAreaAtMouse();
+ /**
+ * Same as above, but returns 6 or 7 as error conditions (can't reach due to radiation
+ * or wrong turbolift).
+ */
+ int getRepublicMapAreaOrFailure(int16 turbolift);
+
private:
int16 _textDisplayMode;
Commit: a5d7b8620652f2ce2c28128996d756ba26296cf5
https://github.com/scummvm/scummvm/commit/a5d7b8620652f2ce2c28128996d756ba26296cf5
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: VENG1
Changed paths:
engines/startrek/awaymission.h
engines/startrek/menu.cpp
engines/startrek/room.h
engines/startrek/rooms/veng1.cpp
engines/startrek/text.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 0a19632..2bf92e1 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -632,6 +632,12 @@ struct AwayMission {
byte beamState; // 0x35
bool field36; // 0x36
+ bool openedPanel; // 0x37
+ bool clearedPanelDebris; // 0x38
+ bool removedPanelDebris; // 0x39
+ bool oilInHypo; // 0x3a
+ bool loosenedDebrisWithOil; // 0x3b
+ bool tookMolecularSaw; // 0x60
bool field68; // 0x68
bool field6b; // 0x6b
bool field6c; // 0x6c
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index 72730fd..0ef1659 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -1091,7 +1091,7 @@ void StarTrekEngine::showRepublicMap(int16 arg0, int16 turbolift) {
switch (event.type) {
case TREKEVENT_TICK:
_frameIndex++;
- // sub_12fff();
+ // sub_12fff(); // TODO
_gfx->drawAllSprites();
break;
@@ -1101,10 +1101,10 @@ lclick:
if (clickedArea == 0) {
} else if (clickedArea == 6) {
Common::String text = "#GENE\\GENE_F14#Turbolift access is blocked by an extremely high radiation level.";
- showTextbox("", text, 50, 50, TEXTCOLOR_YELLOW, 0);
+ showTextbox("Mr. Spock", text, 50, 50, TEXTCOLOR_YELLOW, 0); // ENHANCEMENT: Speaker is Spock
} else if (clickedArea == 7) {
Common::String text = "#GENE\\GENE_F15#This turbolift cannot reach that area of the ship.";
- showTextbox("", text, 50, 50, TEXTCOLOR_YELLOW, 0);
+ showTextbox("Mr. Spock", text, 50, 50, TEXTCOLOR_YELLOW, 0); // ENHANCEMENT: Speaker is Spock
} else
exitLoop = true;
break;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 9712ee9..2ab1f2b 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2480,6 +2480,50 @@ public:
// VENG1
void veng1Tick1();
+ void veng1WalkToDoor();
+ void veng1TouchedHotspot0();
+ void veng1ReachedDoor();
+ void veng1TouchedTurbolift();
+ void veng1LookAtDeadGuy();
+ void veng1UseSTricorderOnVent();
+ void veng1LookAtPanel();
+ void veng1LookAtDoor();
+ void veng1LookAtSaw();
+ void veng1LookAtDebris();
+ void veng1LookAtKirk();
+ void veng1LookAtMccoy();
+ void veng1LookAtSpock();
+ void veng1LookAtRedshirt();
+ void veng1LookAnywhere();
+ void veng1TalkToKirk();
+ void veng1TalkToSpock();
+ void veng1TalkToMccoy();
+ void veng1TalkToRedshirt();
+ void veng1UsePhaserOnDoor();
+ void veng1UsePhaserOnPanel();
+ void veng1UseSTricorderOnSaw();
+ void veng1UseSTricorderOnDoor();
+ void veng1UseSTricorderOnPanel();
+ void veng1GetPanel();
+ void veng1KirkReachedPanel();
+ void veng1KirkAccessedPanel();
+ void veng1UseSawOnPanel();
+ void veng1UseSawOnDoor();
+ void veng1UseDrillOnDebris();
+ void veng1UseSawOnDebris();
+ void veng1UseDrillOnPanel();
+ void veng1KirkReachedPanelToDrill();
+ void veng1KirkDoneDrillingPanel();
+ void veng1UseHypoOnDebris();
+ void veng1KirkReachedDebris();
+ void veng1KirkUsedHypoOnDebris();
+ void veng1GetSaw();
+ void veng1ReachedSaw();
+ void veng1PickedUpSaw();
+ void veng1GetDebris();
+ void veng1ReachedDebrisToGet();
+ void veng1TriedToGetDebris();
+ void veng1UseMccoyOnDeadGuy();
// VENG2
void veng2Tick1();
@@ -2815,6 +2859,12 @@ public:
}
} sins;
+ struct {
+ // veng1
+ byte doorOpenCounter; // 0xca
+ bool walkingToDoor; // 0xcb
+ } veng;
+
} _roomVar;
};
diff --git a/engines/startrek/rooms/veng1.cpp b/engines/startrek/rooms/veng1.cpp
index a7e89dd..994453b 100644
--- a/engines/startrek/rooms/veng1.cpp
+++ b/engines/startrek/rooms/veng1.cpp
@@ -22,20 +22,399 @@
#include "startrek/room.h"
+// OBJECT_DEBRIS, OBJECT_PANEL, and HOTSPOT_PANEL are all just about the same thing, in
+// different contexts. It's OBJECT_PANEL before being opened, OBJECT_DEBRIS after being
+// opened, and OBJECT_PANEL again after clearing the debris. Confusingly, HOTSPOT_PANEL is
+// always selectable if you click the top or right edge of the panel, but one of the other
+// objects always seems to be on top of it.
+
#define OBJECT_DOOR 8
+#define OBJECT_DEBRIS 9
+#define OBJECT_SAW 10
+#define OBJECT_DEAD_GUY 11
+#define OBJECT_PANEL 12 // Closed panel
-#define HOTSPOT_20 0x20
+#define HOTSPOT_DOOR 0x20
+#define HOTSPOT_PANEL 0x21 // Opened panel
+#define HOTSPOT_VENT 0x22
namespace StarTrek {
extern const RoomAction veng1ActionList[] = {
{ {ACTION_TICK, 1, 0, 0}, &Room::veng1Tick1 },
+
+ { {ACTION_WALK, HOTSPOT_DOOR, 0, 0}, &Room::veng1WalkToDoor },
+ { {ACTION_WALK, OBJECT_DOOR, 0, 0}, &Room::veng1WalkToDoor },
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::veng1TouchedHotspot0 },
+ { {ACTION_DONE_WALK, 2, 0, 0}, &Room::veng1ReachedDoor },
+ { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::veng1ReachedDoor },
+ { {ACTION_TOUCHED_WARP, 1, 0, 0}, &Room::veng1TouchedTurbolift },
+
+ { {ACTION_LOOK, OBJECT_DEAD_GUY, 0, 0}, &Room::veng1LookAtDeadGuy },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_VENT, 0}, &Room::veng1UseSTricorderOnVent },
+ { {ACTION_LOOK, HOTSPOT_VENT, 0, 0}, &Room::veng1UseSTricorderOnVent },
+
+ { {ACTION_LOOK, OBJECT_PANEL, 0, 0}, &Room::veng1LookAtPanel },
+ { {ACTION_LOOK, HOTSPOT_PANEL, 0, 0}, &Room::veng1LookAtPanel },
+ { {ACTION_LOOK, OBJECT_DOOR, 0, 0}, &Room::veng1LookAtDoor },
+ { {ACTION_LOOK, HOTSPOT_DOOR, 0, 0}, &Room::veng1LookAtDoor },
+ { {ACTION_LOOK, OBJECT_SAW, 0, 0}, &Room::veng1LookAtSaw },
+ { {ACTION_LOOK, OBJECT_DEBRIS, 0, 0}, &Room::veng1LookAtDebris },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::veng1LookAtKirk },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::veng1LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::veng1LookAtSpock },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::veng1LookAtRedshirt },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::veng1LookAnywhere },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::veng1TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::veng1TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::veng1TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::veng1TalkToRedshirt },
+
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_DOOR, 0}, &Room::veng1UsePhaserOnDoor },
+ { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_DOOR, 0}, &Room::veng1UsePhaserOnDoor },
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_DOOR, 0}, &Room::veng1UsePhaserOnDoor },
+ { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_DOOR, 0}, &Room::veng1UsePhaserOnDoor },
+
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_PANEL, 0}, &Room::veng1UsePhaserOnPanel },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_PANEL, 0}, &Room::veng1UsePhaserOnPanel }, // BUGFIX: IPHASERK, not IPHASERS again
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_DEBRIS, 0}, &Room::veng1UsePhaserOnPanel },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_DEBRIS, 0}, &Room::veng1UsePhaserOnPanel },
+ { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_PANEL, 0}, &Room::veng1UsePhaserOnPanel },
+ { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_PANEL, 0}, &Room::veng1UsePhaserOnPanel },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_SAW, 0}, &Room::veng1UseSTricorderOnSaw },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_DOOR, 0}, &Room::veng1UseSTricorderOnDoor },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_DOOR, 0}, &Room::veng1UseSTricorderOnDoor },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_PANEL, 0}, &Room::veng1UseSTricorderOnPanel },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_DEBRIS, 0}, &Room::veng1UseSTricorderOnPanel },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_PANEL, 0}, &Room::veng1UseSTricorderOnPanel },
+
+ { {ACTION_GET, OBJECT_PANEL, 0, 0}, &Room::veng1GetPanel },
+ { {ACTION_USE, OBJECT_KIRK, OBJECT_PANEL, 0}, &Room::veng1GetPanel },
+ { {ACTION_DONE_WALK, 9, 0, 0}, &Room::veng1KirkReachedPanel },
+ { {ACTION_DONE_ANIM, 10, 0, 0}, &Room::veng1KirkAccessedPanel },
+
+ { {ACTION_USE, OBJECT_ILMD, HOTSPOT_PANEL, 0}, &Room::veng1UseSawOnPanel },
+ { {ACTION_USE, OBJECT_ILMD, OBJECT_DOOR, 0}, &Room::veng1UseSawOnDoor },
+ { {ACTION_USE, OBJECT_ILMD, HOTSPOT_DOOR, 0}, &Room::veng1UseSawOnDoor },
+ { {ACTION_USE, OBJECT_IDRILL, OBJECT_DEBRIS, 0}, &Room::veng1UseDrillOnDebris },
+ { {ACTION_USE, OBJECT_ILMD, OBJECT_DEBRIS, 0}, &Room::veng1UseSawOnDebris },
+
+ { {ACTION_USE, OBJECT_IDRILL, OBJECT_PANEL, 0}, &Room::veng1UseDrillOnPanel },
+ { {ACTION_DONE_WALK, 5, 0, 0}, &Room::veng1KirkReachedPanelToDrill },
+ { {ACTION_DONE_ANIM, 6, 0, 0}, &Room::veng1KirkDoneDrillingPanel },
+ { {ACTION_USE, OBJECT_IHYPO, OBJECT_DEBRIS, 0}, &Room::veng1UseHypoOnDebris },
+ { {ACTION_DONE_WALK, 7, 0, 0}, &Room::veng1KirkReachedDebris },
+ { {ACTION_DONE_ANIM, 8, 0, 0}, &Room::veng1KirkUsedHypoOnDebris },
+
+ { {ACTION_GET, OBJECT_SAW, 0, 0}, &Room::veng1GetSaw },
+ { {ACTION_DONE_WALK, 3, 0, 0}, &Room::veng1ReachedSaw },
+ { {ACTION_DONE_ANIM, 4, 0, 0}, &Room::veng1PickedUpSaw },
+ { {ACTION_GET, OBJECT_DEBRIS, 0, 0}, &Room::veng1GetDebris },
+ { {ACTION_DONE_WALK, 11, 0, 0}, &Room::veng1ReachedDebrisToGet },
+ { {ACTION_DONE_ANIM, 12, 0, 0}, &Room::veng1TriedToGetDebris },
+
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_DEAD_GUY, 0}, &Room::veng1UseMccoyOnDeadGuy },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_DEAD_GUY, 0}, &Room::veng1UseMccoyOnDeadGuy },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_DEAD_GUY, 0}, &Room::veng1UseMccoyOnDeadGuy },
};
extern const int veng1NumActions = ARRAYSIZE(veng1ActionList);
void Room::veng1Tick1() {
+ playVoc("VEN1LOOP");
+ loadActorAnim2(OBJECT_DOOR, "s7r1d1c", 0xa1, 0x7e);
+ loadActorAnim2(OBJECT_DEAD_GUY, "s7r1c1", 0x103, 0xa2);
+
+ if (!_awayMission->veng.tookMolecularSaw)
+ loadActorAnim2(OBJECT_SAW, "s7r1md", 0x3d, 0x9f);
+
+ loadActorAnim2(OBJECT_PANEL, "s7r1p1", 0xd1, 0x6a);
+
+ if (_awayMission->veng.openedPanel) {
+ loadActorAnim2(OBJECT_DEBRIS, "s7r1p2", 0xd1, 0x6a);
+ loadActorStandAnim(OBJECT_PANEL);
+ }
+
+ if (_awayMission->veng.removedPanelDebris) {
+ loadActorAnim2(OBJECT_PANEL, "s7r1p3", 0xd1, 0x6a);
+ loadActorStandAnim(OBJECT_DEBRIS);
+ }
+}
+
+void Room::veng1WalkToDoor() {
+ if (_awayMission->veng.removedPanelDebris) {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0xa0, 0x82, &Room::veng1ReachedDoor);
+ _roomVar.veng.walkingToDoor = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ } else
+ showText(TX_VEN1N007);
+}
+
+void Room::veng1TouchedHotspot0() {
+ if (_roomVar.veng.walkingToDoor) {
+ loadActorAnimC(OBJECT_DOOR, "s7r1d1", 0xa1, 0x7e, &Room::veng1ReachedDoor);
+ loadActorAnim2(OBJECT_PANEL, "s7r1g1", 0xd8, 0x79);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+}
+
+void Room::veng1ReachedDoor() {
+ if (++_roomVar.veng.doorOpenCounter == 2)
+ loadRoomIndex(2, 1);
+}
+
+void Room::veng1TouchedTurbolift() {
+ playSoundEffectIndex(SND_DOOR1);
+ showRepublicMap(1, 0);
+}
+
+void Room::veng1LookAtDeadGuy() {
+ showText(TX_VEN4N014);
+}
+
+void Room::veng1UseSTricorderOnVent() {
+ spockScan(DIR_W, TX_VEN1_011);
+}
+
+void Room::veng1LookAtPanel() {
+ if (!_awayMission->veng.openedPanel)
+ showText(TX_VEN1N022);
+ else if (!_awayMission->veng.removedPanelDebris)
+ showText(TX_VEN1N019);
+ else
+ showText(TX_VEN1N010);
+}
+
+void Room::veng1LookAtDoor() {
+ showText(TX_VEN1N021);
+}
+
+void Room::veng1LookAtSaw() {
+ showText(TX_VEN1N001);
+}
+
+void Room::veng1LookAtDebris() {
+ showText(TX_VEN1N000);
+}
+
+void Room::veng1LookAtKirk() {
+ showText(TX_VEN1N002);
+}
+
+void Room::veng1LookAtMccoy() {
+ showText(TX_VEN1N004);
+}
+
+void Room::veng1LookAtSpock() {
+ showText(TX_VEN1N003);
+}
+
+void Room::veng1LookAtRedshirt() {
+ showText(TX_VEN1N005);
+}
+
+void Room::veng1LookAnywhere() {
+ showText(TX_VEN1N020);
+}
+
+void Room::veng1TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_VEN1_001);
+}
+
+void Room::veng1TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_VEN1_013);
+ showText(TX_SPEAKER_MCCOY, TX_VEN1_005);
+}
+
+void Room::veng1TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_VEN1_004);
+ showText(TX_SPEAKER_KIRK, TX_VEN1_002);
+}
+
+void Room::veng1TalkToRedshirt() {
+ showText(TX_SPEAKER_KIJE, TX_VEN1_016);
+}
+
+void Room::veng1UsePhaserOnDoor() {
+ showText(TX_SPEAKER_KIJE, TX_VEN1_015);
+}
+
+void Room::veng1UsePhaserOnPanel() {
+ showText(TX_SPEAKER_SPOCK, TX_VEN1_008);
+}
+
+void Room::veng1UseSTricorderOnSaw() {
+ spockScan(DIR_W, TX_VEN1_012);
+}
+
+void Room::veng1UseSTricorderOnDoor() {
+ if (_awayMission->veng.removedPanelDebris)
+ spockScan(DIR_N, TX_VEN1_009);
+ else
+ spockScan(DIR_N, TX_VEN1_007);
+}
+
+void Room::veng1UseSTricorderOnPanel() {
+ if (!_awayMission->veng.clearedPanelDebris)
+ spockScan(DIR_E, TX_VEN1_014);
+ else if (!_awayMission->veng.removedPanelDebris)
+ spockScan(DIR_E, TX_VEN1_006);
+ else
+ spockScan(DIR_E, TX_VEN1_010);
+}
+
+void Room::veng1GetPanel() {
+ walkCrewmanC(OBJECT_KIRK, 0xd3, 0x84, &Room::veng1KirkReachedPanel);
+ _awayMission->disableInput = true;
+}
+
+void Room::veng1KirkReachedPanel() {
+ loadActorAnimC(OBJECT_KIRK, "kusemn", -1, -1, &Room::veng1KirkAccessedPanel);
+}
+
+void Room::veng1KirkAccessedPanel() {
+ _awayMission->disableInput = false;
+
+ if (!_awayMission->veng.clearedPanelDebris) {
+ showText(TX_VEN1N016);
+ } else if (!_awayMission->veng.openedPanel) {
+ _awayMission->veng.openedPanel = true;
+ showText(TX_VEN1N017);
+ loadActorAnim2(OBJECT_DEBRIS, "s7r1p2", 0xd1, 0x6a);
+ loadActorStandAnim(OBJECT_PANEL);
+ } else
+ showText(TX_VEN1_F33);
+
+ walkCrewman(OBJECT_KIRK, 0xc9, 0x98);
+}
+
+void Room::veng1UseSawOnPanel() {
+ showText(TX_VEN1N013);
+}
+
+void Room::veng1UseSawOnDoor() {
+ showText(TX_VEN1N014);
+}
+
+void Room::veng1UseDrillOnDebris() {
+ showText(TX_VEN1N009);
+}
+
+void Room::veng1UseSawOnDebris() {
+ showText(TX_VEN1N018);
+}
+
+void Room::veng1UseDrillOnPanel() {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0xd3, 0x84, &Room::veng1KirkReachedPanelToDrill);
+}
+
+void Room::veng1KirkReachedPanelToDrill() {
+ loadActorAnimC(OBJECT_KIRK, "kusemn", -1, -1, &Room::veng1KirkDoneDrillingPanel);
+ playVoc("MADR7E2A");
+}
+
+void Room::veng1KirkDoneDrillingPanel() {
+ walkCrewman(OBJECT_KIRK, 0xc9, 0x98);
+ _awayMission->disableInput = false;
+ if (!_awayMission->veng.clearedPanelDebris) {
+ _awayMission->veng.clearedPanelDebris = true;
+ showText(TX_VEN1N008);
+ }
+}
+
+void Room::veng1UseHypoOnDebris() {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0xd3, 0x84, &Room::veng1KirkReachedDebris);
+}
+
+void Room::veng1KirkReachedDebris() {
+ loadActorAnimC(OBJECT_KIRK, "kusemn", -1, -1, &Room::veng1KirkUsedHypoOnDebris);
+}
+
+void Room::veng1KirkUsedHypoOnDebris() {
+ walkCrewman(OBJECT_KIRK, 0xc9, 0x98);
+ _awayMission->disableInput = false;
+
+ if (!_awayMission->veng.oilInHypo)
+ showText(TX_VEN1N012);
+ else {
+ _awayMission->veng.loosenedDebrisWithOil = true;
+ showText(TX_VEN1N015);
+ }
+}
+
+void Room::veng1GetSaw() {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x32, 0xa4, &Room::veng1ReachedSaw);
+}
+
+void Room::veng1ReachedSaw() {
+ loadActorAnimC(OBJECT_KIRK, "kuseln", -1, -1, &Room::veng1PickedUpSaw);
+}
+
+void Room::veng1PickedUpSaw() {
+ loadActorStandAnim(OBJECT_SAW);
+ showText(TX_VEN1N023);
+ giveItem(OBJECT_ILMD);
+
+ _awayMission->veng.tookMolecularSaw = true;
+ _awayMission->disableInput = false;
+}
+
+void Room::veng1GetDebris() {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0xd3, 0x84, &Room::veng1ReachedDebrisToGet);
+}
+
+void Room::veng1ReachedDebrisToGet() {
+ loadActorAnimC(OBJECT_KIRK, "kusemn", -1, -1, &Room::veng1TriedToGetDebris);
+}
+
+void Room::veng1TriedToGetDebris() {
+ walkCrewman(OBJECT_KIRK, 0xc9, 0x98);
+ _awayMission->disableInput = false;
+
+ if (!_awayMission->veng.loosenedDebrisWithOil)
+ showText(TX_VEN1N006);
+ else {
+ loadActorStandAnim(OBJECT_DEBRIS);
+ loadActorAnim2(OBJECT_PANEL, "s7r1p3", 0xd1, 0x6a);
+ showText(TX_VEN1N011);
+ _awayMission->veng.removedPanelDebris = true;
+ }
+}
+
+void Room::veng1UseMccoyOnDeadGuy() {
+ int val = getRandomWordInRange(0, 5);
+
+ switch (val) {
+ case 0:
+ // NOTE: The exact text differs from the text used in DEM3. But, in order for this
+ // text indexing scheme to work, two rooms can't use the same audio with different
+ // text. Original was "He's dead, jim." instead of "He's dead, Jim...".
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_019);
+ break;
+
+ case 1:
+ showText(TX_SPEAKER_MCCOY, TX_VEN4_016);
+ break;
+
+ case 2:
+ case 3:
+ showText(TX_SPEAKER_MCCOY, TX_G_014);
+ break;
+
+ case 4:
+ case 5:
+ showText(TX_SPEAKER_MCCOY, TX_VEN0_016);
+ break;
+ }
}
}
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 5dfda3b..8282565 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -68,6 +68,7 @@ extern const char *const g_gameStrings[] = {
"#BRID\\BRIDU146#Nothing to report, Captain.",
+ "#GENE\\G_014#This person's dead, Jim.",
"#GENE\\G_024#Fascinating.",
"#GENE\\G_043#Ouch! Watch it with that thing!",
@@ -2684,7 +2685,7 @@ extern const char *const g_gameStrings[] = {
"#VEN0\\VEN0_013#Captain, these phasers are not configured for fine cutting. We could cause extensive damage.",
"#VEN0\\VEN0_014#What kind of a butcher would do this sort of thing?",
"#VEN0\\VEN0_015#I'm a doctor, not a civil engineer!",
- "#VEN0\\VEN0_016#They are dead, Jim. All of them.",
+ "#VEN0\\VEN0_016#They're dead, Jim. All of them.", // TYPO
"#VEN0\\VEN0_017#Jim, don't forget, there's another survivor on board. We've got to find him!",
"#VEN0\\VEN0_018#My God, Jim. What kind of butcher would do something like this?",
"#VEN0\\VEN0_019#Punctured lung, nerve damage, brain damage, fractured arm and ribs; it's a miracle he lasted as long as he did. He's not coming back, Jim.",
@@ -2733,13 +2734,57 @@ extern const char *const g_gameStrings[] = {
"#VEN0\\VEN0N019#You pick up the beam. It's a little heavy, but you manage it.",
+ "#VEN1\\VEN1_001#I wonder if anything will be working in Auxilary Control.",
+ "#VEN1\\VEN1_002#You'll get your chance, Bones. I promise.",
+ "#VEN1\\VEN1_004#I'd like to meet the people responsible for this and give them a piece of my mind.",
+ "#VEN1\\VEN1_005#Too bad you can't say the same for the crew.",
+ "#VEN1\\VEN1_006#Initial scans show that the gear mechanism is currently jammed with metallic debris.",
+ "#VEN1\\VEN1_007#Readings of the door indicate a jam in the gear mechanism.",
+ "#VEN1\\VEN1_008#That may not be wise, Captain. It could damage the entire door assembly in its weakened condition.",
+ "#VEN1\\VEN1_009#The gear mechanism is now cleared.",
+ "#VEN1\\VEN1_010#The gears are moving freely and are completely operative.",
+ "#VEN1\\VEN1_011#The vent is far too small for any one of us to fit through. It is also blocked point three meters inside the duct.",
+ "#VEN1\\VEN1_012#This is a molecular saw, Captain. It is used for precision cutting. My tricorder reads that the power cells are fully charged.",
+ "#VEN1\\VEN1_013#The Starfleet Engineers did their work well Captain. A surprising amount of the ship is intact.",
+ "#VEN1\\VEN1_014#Tricorder indicates that the panel is currently sealed by Federation standard molecular bonding cement.",
+ "#VEN1\\VEN1_015#From my lessons at the Academy, sir, we were told that a standard issue Federation phaser does not have enough power to cut through a security door such as this one.",
+ "#VEN1\\VEN1_016#I'm not in a talking mood right now, sir.",
+ "#VEN1\\VEN1_F33#The panel is open.",
+ "#VEN1\\VEN1N000#A knot of debris is jamming the gear mechanism.",
+ "#VEN1\\VEN1N001#A Molecular Saw. The 23rd century equivalent of a hacksaw.",
+ "#VEN1\\VEN1N002#Captain Kirk hopes that he will never see the day when the Enterprise is this badly battered.",
+ "#VEN1\\VEN1N003#Irritated by the emotions of the humans that are accompanying him, Spock does his best to keep his mind on the problems at hand.",
+ "#VEN1\\VEN1N004#Leonard McCoy wishes he were back on the Enterprise.",
+ "#VEN1\\VEN1N005#Kije wishes that everyone would stop fidgeting. It's making him nervous.",
+ "#VEN1\\VEN1N006#The debris is jammed in too tight.",
+ "#VEN1\\VEN1N007#The door is jammed shut.",
+ "#VEN1\\VEN1N008#The drill easily breaks through the seal of the panel.",
+ "#VEN1\\VEN1N009#The drill is not powerful enough to cut through the debris.",
+ "#VEN1\\VEN1N010#The gear mechanism for the door is now fully functional.",
+ "#VEN1\\VEN1N011#The gears are completely cleared of debris.",
+ "#VEN1\\VEN1N012#The Hypo is empty.",
+ "#VEN1\\VEN1N013#The molecular saw is much too large for the panel.",
+ "#VEN1\\VEN1N014#The molecular saw will not penetrate a security door.",
+ "#VEN1\\VEN1N015#The oil seeps into and loosens the debris.",
+ "#VEN1\\VEN1N016#The panel has been fastened shut with some kind of sealant.",
+ "#VEN1\\VEN1N017#The panel opens easily.",
+ "#VEN1\\VEN1N018#The saw is too bulky to reach the jammed debris.",
+ "#VEN1\\VEN1N019#There appears to be debris jammed in the gear mechanism.",
+ "#VEN1\\VEN1N020#This corridor leads to auxiliary control. It is a real mess.",
+ "#VEN1\\VEN1N021#This door leads to auxiliary control.",
+ "#VEN1\\VEN1N022#This is the maintenance panel for the auxiliary control room door.",
+ "#VEN1\\VEN1N023#You retrieve the molecular saw.",
+
+
"#VEN2\\VEN2_028#Yes, Uhura. Just wanted a status report. Kirk out.",
"#VEN2\\VEN2_066#They are jamming all frequencies, Captain. We will not be able to contact the Enterprise.",
"#VEN2\\VEN2_098#What are you stalling for? Lower your shields.",
"#VEN2\\VEN2U093#Enterprise here. We're still tracking the distress call. Are you all right, Sir?",
+ "#VEN4\\VEN4_016#There's nothing more I can do.", // TYPO
"#VEN4\\VEN4N010#This is an empty hypodermic injector.",
+ "#VEN4\\VEN4N014#Yet another crewman of the Republic whose life was unfairly abbreviated.",
"#VEN6\\VEN6N007#The hypo is now filled with multipurpose oil.",
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index dca9713..682ee5f 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -126,6 +126,7 @@ enum GameStringIDs {
TX_BRIDU146,
+ TX_G_014,
TX_G_024,
TX_G_043,
@@ -2841,13 +2842,59 @@ enum GameStringIDs {
// UNUSED: VEN0_F15
+ TX_VEN1_001,
+ TX_VEN1_002,
+ // UNUSED
+ TX_VEN1_004,
+ TX_VEN1_005,
+ TX_VEN1_006,
+ TX_VEN1_007,
+ TX_VEN1_008,
+ TX_VEN1_009,
+ TX_VEN1_010,
+ TX_VEN1_011,
+ TX_VEN1_012,
+ TX_VEN1_013,
+ TX_VEN1_014,
+ TX_VEN1_015,
+ TX_VEN1_016,
+ TX_VEN1_F33,
+ TX_VEN1N000,
+ TX_VEN1N001,
+ TX_VEN1N002,
+ TX_VEN1N003,
+ TX_VEN1N004,
+ TX_VEN1N005,
+ TX_VEN1N006,
+ TX_VEN1N007,
+ TX_VEN1N008,
+ TX_VEN1N009,
+ TX_VEN1N010,
+ TX_VEN1N011,
+ TX_VEN1N012,
+ TX_VEN1N013,
+ TX_VEN1N014,
+ TX_VEN1N015,
+ TX_VEN1N016,
+ TX_VEN1N017,
+ TX_VEN1N018,
+ TX_VEN1N019,
+ TX_VEN1N020,
+ TX_VEN1N021,
+ TX_VEN1N022,
+ TX_VEN1N023,
+ // UNUSED: VEN1NA18 (variant of VEN1N018)
+
+
TX_VEN2_028,
TX_VEN2_066,
TX_VEN2_098,
TX_VEN2U093,
+ TX_VEN4_016,
TX_VEN4N010,
+ TX_VEN4N014,
TX_VEN6N007,
Commit: 3a83f9b2d915d41ddbc5f9c4d75a37f4aec34012
https://github.com/scummvm/scummvm/commit/3a83f9b2d915d41ddbc5f9c4d75a37f4aec34012
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Comment out incomplete detection entries
Changed paths:
engines/startrek/detection.cpp
diff --git a/engines/startrek/detection.cpp b/engines/startrek/detection.cpp
index 92c90a1..804d5dc 100644
--- a/engines/startrek/detection.cpp
+++ b/engines/startrek/detection.cpp
@@ -70,8 +70,6 @@ static const PlainGameDescriptor starTrekGames[] = {
namespace StarTrek {
static const StarTrekGameDescription gameDescriptions[] = {
- // TODO: Replace AD_ENTRY1 with AD_ENTRY1s for game versions I don't have yet
-
{ // ST25 DOS CD-ROM edition (EN)
{
"st25",
@@ -114,6 +112,24 @@ static const StarTrekGameDescription gameDescriptions[] = {
0,
},
+ { // ST25 Mac floppy edition (EN)
+ {
+ "st25",
+ "Floppy",
+ AD_ENTRY1s("Star Trek Data", "d95eb00532b7082d53862c906c7ac3dc", 39032),
+ Common::EN_ANY,
+ Common::kPlatformMacintosh,
+ ADGF_MACRESFORK,
+ GUIO0()
+ },
+ GType_ST25,
+ 0,
+ },
+
+ // These are commented until future notice because I don't have complete information
+ // on them (the file size for data.000 / data.001). Will be relying on people to
+ // report the missing data.
+ /*
{ // ST25 Amiga ? (EN)
{
"st25",
@@ -170,20 +186,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
0,
},
- { // ST25 Mac floppy edition (EN)
- {
- "st25",
- "Floppy",
- AD_ENTRY1s("Star Trek Data", "d95eb00532b7082d53862c906c7ac3dc", 39032),
- Common::EN_ANY,
- Common::kPlatformMacintosh,
- ADGF_MACRESFORK,
- GUIO0()
- },
- GType_ST25,
- 0,
- },
-
{ // ST25 DOS demo ? (EN)
{
"st25",
@@ -211,6 +213,7 @@ static const StarTrekGameDescription gameDescriptions[] = {
GType_ST25,
GF_DEMO,
},
+ */
{ // STJR DOS CD-ROM edition (EN)
{
Commit: d672fb6a3d1d78284f224cfe4ea1c755168be858
https://github.com/scummvm/scummvm/commit/d672fb6a3d1d78284f224cfe4ea1c755168be858
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Add FR, GER CD versions to detection.cpp
Changed paths:
engines/startrek/detection.cpp
diff --git a/engines/startrek/detection.cpp b/engines/startrek/detection.cpp
index 804d5dc..08f3858 100644
--- a/engines/startrek/detection.cpp
+++ b/engines/startrek/detection.cpp
@@ -84,6 +84,34 @@ static const StarTrekGameDescription gameDescriptions[] = {
GF_CDROM,
},
+ { // ST25 DOS CD-ROM edition (FR)
+ {
+ "st25",
+ "CD",
+ AD_ENTRY1s("data.001", "57040928a0f374281aa86ba4e7db8444", 7815278),
+ Common::FR_FRA,
+ Common::kPlatformDOS,
+ ADGF_NO_FLAGS,
+ GUIO0()
+ },
+ GType_ST25,
+ GF_CDROM,
+ },
+
+ { // ST25 DOS CD-ROM edition (GER)
+ {
+ "st25",
+ "CD",
+ AD_ENTRY1s("data.001", "57040928a0f374281aa86ba4e7db8444", 7805836),
+ Common::DE_DEU,
+ Common::kPlatformDOS,
+ ADGF_NO_FLAGS,
+ GUIO0()
+ },
+ GType_ST25,
+ GF_CDROM,
+ },
+
{ // ST25 DOS floppy edition (EN)
{
"st25",
Commit: a089dc23f7fa76cec77f235efa9262413ea7cd78
https://github.com/scummvm/scummvm/commit/a089dc23f7fa76cec77f235efa9262413ea7cd78
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: VENG2
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/veng0.cpp
engines/startrek/rooms/veng2.cpp
engines/startrek/text.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 2bf92e1..286300d 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -621,10 +621,11 @@ struct AwayMission {
struct {
bool enteredRoom0FirstTime; // 0x2d
+ int16 missionScore; // 0x2e
bool bridgeCrewmanDead; // 0x30
bool scannedCaptainsChair; // 0x31
bool scannedComputerBank; // 0x32
- bool field34; // 0x34
+ bool impulseEnginesOn; // 0x34
// 0: beam still in place
// 1: used saw on beam
@@ -637,8 +638,40 @@ struct AwayMission {
bool removedPanelDebris; // 0x39
bool oilInHypo; // 0x3a
bool loosenedDebrisWithOil; // 0x3b
+
+ // 0: no power allocated
+ // 1: power to weapons
+ // 2: power to shields
+ // 3: power to transporter
+ byte poweredSystem; // 0x3c
+
+ // 0: no tricorders plugged in
+ // 1: med tricorder plugged in
+ // 2: sci tricorder plugged in
+ // 3: both plugged in
+ byte tricordersPluggedIntoComputer; // 0x3d
+
+ byte captainsLogIndex; // 0x3e
+ bool elasiShieldsDown; // 0x40
+ bool torpedoLoaded; // 0x41
+ bool firedTorpedo; // 0x42
+ bool elasiShipDecloaked; // 0x43
+ bool countdownStarted; // 0x44
+ bool toldElasiToBeamOver; // 0x45
+ bool scannedMainComputer; // 0x46
+ bool elasiHailedRepublic; // 0x47
+ bool tookRecordDeckFromAuxilaryControl; // 0x48
+ int16 field49; // 0x49
+ int16 field4b; // 0x4b
+ int16 field4d; // 0x4d
+ int16 field51; // 0x51
+ bool havePowerPack; // 0x5a
bool tookMolecularSaw; // 0x60
+ bool readEngineeringJournal; // 0x61
+ bool examinedTorpedoControl; // 0x66
bool field68; // 0x68
+ bool field69; // 0x69
+ bool readAllLogs; // 0x6a
bool field6b; // 0x6b
bool field6c; // 0x6c
} veng;
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 2ab1f2b..41b7d9b 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2524,9 +2524,74 @@ public:
void veng1ReachedDebrisToGet();
void veng1TriedToGetDebris();
void veng1UseMccoyOnDeadGuy();
+ // TODO: common code
// VENG2
void veng2Tick1();
+ void veng2Timer0Expired();
+ void veng2ElasiShipDecloaked();
+ void veng2Timer2Expired();
+ void veng2TouchedDoor();
+ void veng2LookAtViewscreen();
+ void veng2LookAtMiddleConsole();
+ void veng2LookAtDamageDisplay();
+ void veng2LookAtSTricorder();
+ void veng2LookAtMTricorder();
+ void veng2LookAtTorpedoButton();
+ void veng2LookAtTorpedoControl();
+ void veng2LookAtImpulseConsole();
+ void veng2LookAtMainComputer();
+ void veng2LookAtRecordDeck();
+ void veng2LookAtDeckIOConsole();
+ void veng2LookAtKirk();
+ void veng2LookAtSpock();
+ void veng2LookAtMccoy();
+ void veng2LookAtRedshirt();
+ void veng2LookAnywhere();
+ void veng2TalkToKirk();
+ void veng2TalkToSpock();
+ void veng2TalkToMccoy();
+ void veng2TalkToRedshirt();
+ void veng2UseTechJournalOnDeckIOConsole();
+ void veng2ReachedDeckIOWithTechJournal();
+ void veng2DoneReadingTechJournal();
+ void veng2UseLogOnDeckIOConsole();
+ void veng2ReachedDeckIOWithLog();
+ void veng2LoadedLog();
+ void veng2UseCommunicator();
+ void veng2UseKirkOnTorpedoButton();
+ void veng2UseKirkReachedTorpedoButton();
+ void veng2KirkFiredTorpedo();
+ void veng2TorpedoStruckElasiShip();
+ void veng2ElasiRetreated();
+ void veng2CrewmanInPositionToBeamOut();
+ void veng2UseSTricorderOnTorpedoButton();
+ void veng2UseSTricorderOnMiddleConsole();
+ void veng2UseSTricorderOnTorpedoControl();
+ void veng2UseImpulseConsole();
+ void veng2SpockReachedImpulseConsole();
+ void veng2SpockUsedImpulseConsole();
+ void veng2UseMainComputer();
+ void veng2UseSTricorderOnMainComputer();
+ void veng2SpockReachedMainComputerToPutTricorder();
+ void veng2AttachedSTricorderToComputer();
+ void veng2UseMTricorderOnMainComputer();
+ void veng2MccoyReachedMainComputerToPutTricorder();
+ void veng2AttachedMTricorderToComputer();
+ void veng2BothTricordersPluggedIn();
+ void veng2UseSTricorderOnDeckIOConsole();
+ void veng2UseSTricorderOnImpulseConsole();
+ void veng2UseFusionPackOnMainComputer();
+ void veng2GetLogDeck();
+ void veng2ReachedLogDeck();
+ void veng2PickedUpLogDeck();
+ void veng2GetSTricorder();
+ void veng2ReachedSTricorderToGet();
+ void veng2PickedUpSTricorder();
+ void veng2GetMTricorder();
+ void veng2ReachedMTricorderToGet();
+ void veng2PickedUpMTricorder();
+ // TODO: common code
// VENG3
void veng3Tick1();
@@ -2863,6 +2928,9 @@ public:
// veng1
byte doorOpenCounter; // 0xca
bool walkingToDoor; // 0xcb
+
+ // veng2
+ byte numCrewmenReadyToBeamOut; // 0xca
} veng;
} _roomVar;
diff --git a/engines/startrek/rooms/veng0.cpp b/engines/startrek/rooms/veng0.cpp
index c290336..0e7b544 100644
--- a/engines/startrek/rooms/veng0.cpp
+++ b/engines/startrek/rooms/veng0.cpp
@@ -175,7 +175,7 @@ void Room::veng0UseSTricorderOnChair() {
}
void Room::veng0UseSTricorderAnywhere() {
- if (!_awayMission->veng.field34)
+ if (!_awayMission->veng.impulseEnginesOn)
spockScan(DIR_S, TX_VEN0_027);
}
diff --git a/engines/startrek/rooms/veng2.cpp b/engines/startrek/rooms/veng2.cpp
index 2e00f0a..d473e58 100644
--- a/engines/startrek/rooms/veng2.cpp
+++ b/engines/startrek/rooms/veng2.cpp
@@ -22,20 +22,885 @@
#include "startrek/room.h"
-#define OBJECT_DOOR 8
+// This room is confusing, because it has two hotspots directly adjacent to each other
+// that deal with torpedos, but they act differently.
-#define HOTSPOT_20 0x20
+// BUG: It's possible to swap from having shields up to some other system, by first
+// putting shields up, then swapping to another system in the few seconds before the Elasi
+// hail the ship.
+
+// BUG: Once you have permission to power down the shields, attempting to power on the
+// transporter gives you text along the lines of "the elasi would detect us lowering the
+// shields" (even after lowering the shields).
+
+#define OBJECT_DECK 8
+#define OBJECT_STRICORDER 9
+#define OBJECT_MTRICORDER 10
+#define OBJECT_VIEWSCREEN 11
+#define OBJECT_DAMAGE_DISPLAY_1 12
+#define OBJECT_MAIN_COMPUTER 13
+#define OBJECT_TORPEDO_BUTTON 14
+#define OBJECT_IMPULSE_CONSOLE 15
+#define OBJECT_MIDDLE_CONSOLE 16
+#define OBJECT_RIGHT_COMPUTER_PANEL 17
+#define OBJECT_DECK_IO_CONSOLE 18
+#define OBJECT_CEILING_PANEL 19
+#define OBJECT_LEFT_COMPUTER_PANEL 20
+#define OBJECT_DAMAGE_DISPLAY_2 21
+
+#define HOTSPOT_TORPEDO_BUTTON 0x20
+#define HOTSPOT_TORPEDO_CONTROL 0x21
+#define HOTSPOT_DECK_IO_SLOT 0x22
+#define HOTSPOT_IMPULSE_CONSOLE 0x23
+#define HOTSPOT_MAIN_COMPUTER 0x24
+#define HOTSPOT_DECK_IO_CONSOLE 0x25
+#define HOTSPOT_MIDDLE_CONSOLE 0x26
+#define HOTSPOT_VIEWSCREEN 0x27
+#define HOTSPOT_DAMAGE_DISPLAY 0x28
namespace StarTrek {
extern const RoomAction veng2ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::veng2Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::veng2Tick1 },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::veng2Timer0Expired },
+ { {ACTION_TICK, 40, 0, 0}, &Room::veng2Timer0Expired },
+ { {ACTION_DONE_ANIM, 5, 0, 0}, &Room::veng2ElasiShipDecloaked },
+ { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::veng2Timer2Expired },
+ { {ACTION_TOUCHED_WARP, 1, 0, 0}, &Room::veng2TouchedDoor },
+
+ { {ACTION_LOOK, OBJECT_VIEWSCREEN, 0, 0}, &Room::veng2LookAtViewscreen },
+ { {ACTION_LOOK, HOTSPOT_VIEWSCREEN, 0, 0}, &Room::veng2LookAtViewscreen },
+ { {ACTION_LOOK, OBJECT_MIDDLE_CONSOLE, 0, 0}, &Room::veng2LookAtMiddleConsole },
+ { {ACTION_LOOK, HOTSPOT_MIDDLE_CONSOLE, 0, 0}, &Room::veng2LookAtMiddleConsole },
+ { {ACTION_LOOK, OBJECT_DAMAGE_DISPLAY_1, 0, 0}, &Room::veng2LookAtDamageDisplay },
+ { {ACTION_LOOK, OBJECT_DAMAGE_DISPLAY_2, 0, 0}, &Room::veng2LookAtDamageDisplay },
+ { {ACTION_LOOK, HOTSPOT_DAMAGE_DISPLAY, 0, 0}, &Room::veng2LookAtDamageDisplay },
+ { {ACTION_LOOK, OBJECT_STRICORDER, 0, 0}, &Room::veng2LookAtSTricorder },
+ { {ACTION_LOOK, OBJECT_MTRICORDER, 0, 0}, &Room::veng2LookAtMTricorder },
+ { {ACTION_LOOK, OBJECT_TORPEDO_BUTTON, 0, 0}, &Room::veng2LookAtTorpedoButton },
+ { {ACTION_LOOK, HOTSPOT_TORPEDO_BUTTON, 0, 0}, &Room::veng2LookAtTorpedoButton },
+ { {ACTION_LOOK, HOTSPOT_TORPEDO_CONTROL, 0, 0}, &Room::veng2LookAtTorpedoControl },
+ { {ACTION_LOOK, OBJECT_IMPULSE_CONSOLE, 0, 0}, &Room::veng2LookAtImpulseConsole },
+ { {ACTION_LOOK, HOTSPOT_IMPULSE_CONSOLE, 0, 0}, &Room::veng2LookAtImpulseConsole },
+ { {ACTION_LOOK, OBJECT_MAIN_COMPUTER, 0, 0}, &Room::veng2LookAtMainComputer },
+ { {ACTION_LOOK, HOTSPOT_MAIN_COMPUTER, 0, 0}, &Room::veng2LookAtMainComputer },
+ { {ACTION_LOOK, OBJECT_DECK, 0, 0}, &Room::veng2LookAtRecordDeck },
+ { {ACTION_LOOK, OBJECT_DECK_IO_CONSOLE, 0, 0}, &Room::veng2LookAtDeckIOConsole },
+ { {ACTION_LOOK, HOTSPOT_DECK_IO_CONSOLE, 0, 0}, &Room::veng2LookAtDeckIOConsole },
+ { {ACTION_LOOK, HOTSPOT_DECK_IO_SLOT, 0, 0}, &Room::veng2LookAtDeckIOConsole },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::veng2LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::veng2LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::veng2LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::veng2LookAtRedshirt },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::veng2LookAnywhere },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::veng2TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::veng2TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::veng2TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::veng2TalkToRedshirt },
+
+ { {ACTION_USE, OBJECT_ITECH, OBJECT_DECK_IO_CONSOLE, 0}, &Room::veng2UseTechJournalOnDeckIOConsole },
+ { {ACTION_USE, OBJECT_ITECH, HOTSPOT_DECK_IO_CONSOLE, 0}, &Room::veng2UseTechJournalOnDeckIOConsole },
+ { {ACTION_USE, OBJECT_ITECH, HOTSPOT_DECK_IO_SLOT, 0}, &Room::veng2UseTechJournalOnDeckIOConsole },
+ { {ACTION_DONE_WALK, 22, 0, 0}, &Room::veng2ReachedDeckIOWithTechJournal },
+ { {ACTION_DONE_ANIM, 23, 0, 0}, &Room::veng2DoneReadingTechJournal },
+ { {ACTION_USE, OBJECT_IDECK, OBJECT_DECK_IO_CONSOLE, 0}, &Room::veng2UseLogOnDeckIOConsole },
+ { {ACTION_USE, OBJECT_IDECK, HOTSPOT_DECK_IO_CONSOLE, 0}, &Room::veng2UseLogOnDeckIOConsole },
+ { {ACTION_USE, OBJECT_IDECK, HOTSPOT_DECK_IO_SLOT, 0}, &Room::veng2UseLogOnDeckIOConsole },
+ { {ACTION_DONE_WALK, 24, 0, 0}, &Room::veng2ReachedDeckIOWithLog },
+ { {ACTION_DONE_ANIM, 25, 0, 0}, &Room::veng2LoadedLog },
+ { {ACTION_USE, OBJECT_ICOMM, OBJECT_KIRK, 0}, &Room::veng2UseCommunicator },
+
+ { {ACTION_USE, OBJECT_KIRK, OBJECT_TORPEDO_BUTTON, 0}, &Room::veng2UseKirkOnTorpedoButton },
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_TORPEDO_BUTTON, 0}, &Room::veng2UseKirkOnTorpedoButton },
+ { {ACTION_DONE_WALK, 18, 0, 0}, &Room::veng2UseKirkReachedTorpedoButton },
+ { {ACTION_DONE_ANIM, 19, 0, 0}, &Room::veng2KirkFiredTorpedo },
+ { {ACTION_DONE_ANIM, 7, 0, 0}, &Room::veng2TorpedoStruckElasiShip },
+ { {ACTION_DONE_ANIM, 6, 0, 0}, &Room::veng2ElasiRetreated },
+ { {ACTION_DONE_WALK, 1, 0, 0}, &Room::veng2CrewmanInPositionToBeamOut },
+ { {ACTION_DONE_WALK, 2, 0, 0}, &Room::veng2CrewmanInPositionToBeamOut },
+ { {ACTION_DONE_WALK, 3, 0, 0}, &Room::veng2CrewmanInPositionToBeamOut },
+ { {ACTION_DONE_WALK, 4, 0, 0}, &Room::veng2CrewmanInPositionToBeamOut },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_TORPEDO_BUTTON, 0}, &Room::veng2UseSTricorderOnTorpedoButton }, // FIXME: hotspots?
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_MIDDLE_CONSOLE, 0}, &Room::veng2UseSTricorderOnMiddleConsole },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MIDDLE_CONSOLE, 0}, &Room::veng2UseSTricorderOnMiddleConsole },
+
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_TORPEDO_CONTROL, 0}, &Room::veng2UseSTricorderOnTorpedoControl },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_TORPEDO_CONTROL, 0}, &Room::veng2UseSTricorderOnTorpedoControl },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_TORPEDO_CONTROL, 0}, &Room::veng2UseSTricorderOnTorpedoControl },
+
+ { {ACTION_USE, OBJECT_KIRK, OBJECT_IMPULSE_CONSOLE, 0}, &Room::veng2UseImpulseConsole },
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_IMPULSE_CONSOLE, 0}, &Room::veng2UseImpulseConsole },
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_IMPULSE_CONSOLE, 0}, &Room::veng2UseImpulseConsole },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_IMPULSE_CONSOLE, 0}, &Room::veng2UseImpulseConsole },
+ { {ACTION_DONE_WALK, 20, 0, 0}, &Room::veng2SpockReachedImpulseConsole },
+ { {ACTION_DONE_ANIM, 21, 0, 0}, &Room::veng2SpockUsedImpulseConsole },
+
+ { {ACTION_USE, OBJECT_KIRK, OBJECT_MAIN_COMPUTER, 0}, &Room::veng2UseMainComputer },
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_MAIN_COMPUTER, 0}, &Room::veng2UseMainComputer },
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_MAIN_COMPUTER, 0}, &Room::veng2UseMainComputer },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_MAIN_COMPUTER, 0}, &Room::veng2UseMainComputer },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_MAIN_COMPUTER, 0}, &Room::veng2UseSTricorderOnMainComputer },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MAIN_COMPUTER, 0}, &Room::veng2UseSTricorderOnMainComputer },
+ { {ACTION_DONE_WALK, 10, 0, 0}, &Room::veng2SpockReachedMainComputerToPutTricorder },
+ { {ACTION_DONE_ANIM, 11, 0, 0}, &Room::veng2AttachedSTricorderToComputer },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MAIN_COMPUTER, 0}, &Room::veng2UseMTricorderOnMainComputer },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_MAIN_COMPUTER, 0}, &Room::veng2UseMTricorderOnMainComputer },
+ { {ACTION_DONE_WALK, 12, 0, 0}, &Room::veng2MccoyReachedMainComputerToPutTricorder },
+ { {ACTION_DONE_ANIM, 13, 0, 0}, &Room::veng2AttachedMTricorderToComputer },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_DECK_IO_CONSOLE, 0}, &Room::veng2UseSTricorderOnDeckIOConsole },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_DECK_IO_SLOT, 0}, &Room::veng2UseSTricorderOnDeckIOConsole },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_IMPULSE_CONSOLE, 0}, &Room::veng2UseSTricorderOnImpulseConsole },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_IMPULSE_CONSOLE, 0}, &Room::veng2UseSTricorderOnImpulseConsole },
+ { {ACTION_USE, OBJECT_IFUSION, HOTSPOT_MAIN_COMPUTER, 0}, &Room::veng2UseFusionPackOnMainComputer },
+ { {ACTION_USE, OBJECT_IFUSION, OBJECT_MAIN_COMPUTER, 0}, &Room::veng2UseFusionPackOnMainComputer },
+
+ { {ACTION_GET, OBJECT_DECK, 0, 0}, &Room::veng2GetLogDeck },
+ { {ACTION_DONE_WALK, 8, 0, 0}, &Room::veng2ReachedLogDeck },
+ { {ACTION_DONE_ANIM, 9, 0, 0}, &Room::veng2PickedUpLogDeck },
+
+ { {ACTION_GET, OBJECT_STRICORDER, 0, 0}, &Room::veng2GetSTricorder },
+ { {ACTION_DONE_WALK, 14, 0, 0}, &Room::veng2ReachedSTricorderToGet },
+ { {ACTION_DONE_ANIM, 15, 0, 0}, &Room::veng2PickedUpSTricorder },
+ { {ACTION_GET, OBJECT_MTRICORDER, 0, 0}, &Room::veng2GetMTricorder },
+ { {ACTION_DONE_WALK, 16, 0, 0}, &Room::veng2ReachedMTricorderToGet },
+ { {ACTION_DONE_ANIM, 17, 0, 0}, &Room::veng2PickedUpMTricorder },
+
+ // ENHANCEMENTs
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_TORPEDO_CONTROL, 0}, &Room::veng2UseKirkOnTorpedoButton },
+ // TODO: uncomment
+// { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_DECK_IO_CONSOLE, 0}, &Room::veng2UseSTricorderOnDeckIOConsole },
};
extern const int veng2NumActions = ARRAYSIZE(veng2ActionList);
+#define STRICORDER_POS_X 0x45
+#define STRICORDER_POS_Y 0x71
+
+#define MTRICORDER_POS_X 0x55
+#define MTRICORDER_POS_Y 0x67
+
+#define MAIN_COMPUTER_X 0x4f
+#define MAIN_COMPUTER_Y 0x71
+
+#define VIEWSCREEN_X 0x9e
+#define VIEWSCREEN_Y 0x63
+
+#define DAMAGE_DISPLAY_1_X 0xfa
+#define DAMAGE_DISPLAY_1_Y 0x64
+
+#define TORPEDO_BUTTON_X 0x97
+#define TORPEDO_BUTTON_Y 0x74
+
+
void Room::veng2Tick1() {
+ if (!_awayMission->veng.tookRecordDeckFromAuxilaryControl)
+ loadActorAnim2(OBJECT_DECK, "s7r2d1", 0xee, 0x8c);
+
+ if (!haveItem(OBJECT_ISTRICOR))
+ loadActorAnim2(OBJECT_STRICORDER, "s7r2t1", STRICORDER_POS_X, STRICORDER_POS_Y);
+
+ if (!haveItem(OBJECT_IMTRICOR))
+ loadActorAnim2(OBJECT_MTRICORDER, "s7r2t2", MTRICORDER_POS_X, MTRICORDER_POS_Y);
+
+ if (_awayMission->veng.tricordersPluggedIntoComputer == 3)
+ loadActorAnim2(OBJECT_MAIN_COMPUTER, "s7r2t3", MAIN_COMPUTER_X, MAIN_COMPUTER_Y);
+
+ if (_awayMission->veng.elasiShipDecloaked)
+ loadActorAnim2(OBJECT_VIEWSCREEN, "s7r2u2", VIEWSCREEN_X, VIEWSCREEN_Y);
+
+ if (_awayMission->veng.poweredSystem == 2)
+ loadActorAnim2(OBJECT_DAMAGE_DISPLAY_1, "s7r2sh2", DAMAGE_DISPLAY_1_X, DAMAGE_DISPLAY_1_Y);
+
+ loadActorAnim2(OBJECT_TORPEDO_BUTTON, "s7r2pl", TORPEDO_BUTTON_X, TORPEDO_BUTTON_Y);
+ if (_awayMission->veng.torpedoLoaded)
+ loadActorAnim2(OBJECT_TORPEDO_BUTTON, "s7r2pm", TORPEDO_BUTTON_X, TORPEDO_BUTTON_Y);
+
+ if (!_awayMission->veng.impulseEnginesOn) {
+ loadActorAnim2(OBJECT_IMPULSE_CONSOLE, "s7r2o1", 0x0b, 0x87);
+ loadActorAnim2(OBJECT_LEFT_COMPUTER_PANEL, "s7r2o2", 0x36, 0x63);
+ loadActorAnim2(OBJECT_RIGHT_COMPUTER_PANEL, "s7r2o3", 0x58, 0x5f);
+ loadActorAnim2(OBJECT_MIDDLE_CONSOLE, "s7r2o4", 0x9e, 0x7b);
+ loadActorAnim2(OBJECT_DAMAGE_DISPLAY_2, "s7r2o5", 0x112, 0x66);
+ loadActorAnim2(OBJECT_DECK_IO_CONSOLE, "s7r2o6", 0x131, 0x86);
+ loadActorAnim2(OBJECT_CEILING_PANEL, "s7r2o7", 0x9b, 0x14);
+
+ // FIXME: this doesn't loop
+ playVoc("VEN2LOFF");
+ } else
+ playVoc("VEN2LON");
+}
+
+void Room::veng2Timer0Expired() { // Elasi decloak if they haven't already
+ if (_awayMission->veng.tricordersPluggedIntoComputer == 3 && _awayMission->veng.impulseEnginesOn) {
+ if (!_awayMission->veng.elasiShipDecloaked) {
+ _awayMission->veng.elasiShipDecloaked = true;
+ playVoc("UNCLOAK");
+ loadActorAnimC(OBJECT_VIEWSCREEN, "s7r2u1", VIEWSCREEN_X, VIEWSCREEN_Y, &Room::veng2ElasiShipDecloaked);
+ _awayMission->disableInput = true;
+ } else if (!_awayMission->veng.elasiHailedRepublic && _awayMission->veng.poweredSystem == 2)
+ _awayMission->timers[2] = 45; // Timer until Elasi hail
+ }
+}
+
+void Room::veng2ElasiShipDecloaked() {
+ _awayMission->disableInput = false;
+
+ showText(TX_SPEAKER_KIJE, TX_VEN2_093);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_019);
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_076);
+ showText(TX_SPEAKER_MCCOY, TX_VEN2_042);
+ if (_awayMission->veng.poweredSystem != 2) {
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_032);
+ _awayMission->veng.field49 = 1800;
+ } else
+ veng2Timer2Expired();
+}
+
+void Room::veng2Timer2Expired() { // Elasi hail the Enterprise if they haven't already
+ if (_awayMission->veng.elasiHailedRepublic)
+ return;
+ _awayMission->veng.elasiHailedRepublic = true;
+
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_073);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_016);
+ loadActorAnim2(OBJECT_VIEWSCREEN, "s7r2p1", VIEWSCREEN_X, VIEWSCREEN_Y);
+ showText(TX_SPEAKER_ELASI_CAPTAIN, TX_VEN2_109);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_027);
+ showText(TX_SPEAKER_ELASI_CAPTAIN, TX_VEN2_113);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_010);
+ showText(TX_SPEAKER_ELASI_CAPTAIN, TX_VEN2_103);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_006);
+ showText(TX_SPEAKER_ELASI_CAPTAIN, TX_VEN2_111);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_020);
+ showText(TX_SPEAKER_ELASI_CAPTAIN, TX_VEN2_112);
+
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_VEN2_012, TX_VEN2_011,
+ TX_BLANK
+ };
+
+ int choice = showText(choices);
+
+ if (choice == 0) {
+ showText(TX_SPEAKER_ELASI_CAPTAIN, TX_VEN2_099);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_008);
+ }
+
+ showText(TX_SPEAKER_ELASI_CAPTAIN, TX_VEN2_105);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_021);
+ showText(TX_SPEAKER_ELASI_CAPTAIN, TX_VEN2_102);
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_072);
+ showText(TX_SPEAKER_MCCOY, TX_VEN2_044);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_022);
+
+ loadActorAnim2(OBJECT_VIEWSCREEN, "s7r2u2", VIEWSCREEN_X, VIEWSCREEN_Y);
+ _awayMission->veng.field4b = 27000;
+ _awayMission->veng.countdownStarted = true;
+}
+
+void Room::veng2TouchedDoor() {
+ playSoundEffectIndex(SND_DOOR1);
+ _awayMission->rdfStillDoDefaultAction = true;
+}
+
+void Room::veng2LookAtViewscreen() {
+ if (!_awayMission->veng.elasiShipDecloaked)
+ showText(TX_VEN2N022);
+ else
+ showText(TX_VEN2N002);
+}
+
+void Room::veng2LookAtMiddleConsole() {
+ showText(TX_VEN2N030);
+}
+
+void Room::veng2LookAtDamageDisplay() {
+ if (!_awayMission->veng.impulseEnginesOn)
+ showText(TX_VEN2N035);
+ else
+ showText(TX_VEN2N032);
+
+ // NOTE: There were originally 2 more cases, where "poweredSystem == 2" or otherwise. For
+ // the case where poweredSystem == 2, it played TX_VEN2N032, but with mismatching text.
+}
+
+void Room::veng2LookAtSTricorder() {
+ showText(TX_VEN2N027);
+}
+
+void Room::veng2LookAtMTricorder() {
+ showText(TX_VEN2N024);
+}
+
+void Room::veng2LookAtTorpedoButton() {
+ showText(TX_VEN2N033);
+}
+
+// TODO: Consider merging "veng2LookAtTorpedoButton" with "veng2LookAtTorpedoControl"
+// (and the same for use actions)
+void Room::veng2LookAtTorpedoControl() {
+ showText(TX_VEN2N033);
+
+ if (!_awayMission->veng.impulseEnginesOn)
+ showText(TX_VEN2N001); // Unused, since it can't be selected when impulse is off?
+ else if (!_awayMission->veng.torpedoLoaded) {
+ showText(TX_VEN2N000);
+ if (!_awayMission->veng.elasiShipDecloaked)
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_036);
+ else
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_037);
+ _awayMission->veng.examinedTorpedoControl = true;
+ } else if (!_awayMission->veng.firedTorpedo)
+ showText(TX_VEN2N021);
+ else
+ showText(TX_VEN2N020); // Unused, since after firing the torpedo, the mission ends
+}
+
+void Room::veng2LookAtImpulseConsole() {
+ showText(TX_VEN2N034);
+
+ if (!_awayMission->veng.impulseEnginesOn)
+ showText(TX_VEN2N008);
+ else if (_awayMission->veng.tricordersPluggedIntoComputer != 3)
+ showText(TX_VEN2N009);
+ else if (_awayMission->veng.poweredSystem == 0)
+ showText(TX_VEN2N009);
+ else if (_awayMission->veng.poweredSystem == 1)
+ showText(TX_VEN2N007);
+ else if (_awayMission->veng.poweredSystem == 2)
+ showText(TX_VEN2N005);
+ else
+ showText(TX_VEN2N006);
+}
+
+void Room::veng2LookAtMainComputer() {
+ if (_awayMission->veng.tricordersPluggedIntoComputer == 0)
+ showText(TX_VEN2N003);
+ else if (_awayMission->veng.tricordersPluggedIntoComputer == 1) // Med tricorder plugged in
+ showText(TX_VEN2N023);
+ else if (_awayMission->veng.tricordersPluggedIntoComputer == 2) // Sci tricorder plugged in
+ showText(TX_VEN2N027);
+ else // Both
+ showText(TX_VEN2N025);
+}
+
+void Room::veng2LookAtRecordDeck() {
+ showText(TX_VEN2N029);
+}
+
+void Room::veng2LookAtDeckIOConsole() {
+ showText(TX_VEN2N031);
+}
+
+void Room::veng2LookAtKirk() {
+ showText(TX_VEN2N010);
+}
+
+void Room::veng2LookAtSpock() {
+ showText(TX_VEN2N019);
+}
+
+void Room::veng2LookAtMccoy() {
+ showText(TX_VEN2N012);
+}
+
+void Room::veng2LookAtRedshirt() {
+ showText(TX_VEN2N004);
+}
+
+void Room::veng2LookAnywhere() {
+ showText(TX_VEN2N035);
+}
+
+void Room::veng2TalkToKirk() {
+ if (_awayMission->veng.countdownStarted)
+ showText(TX_SPEAKER_KIRK, TX_VEN2_004);
+ else
+ showText(TX_SPEAKER_KIRK, TX_VEN2_005);
+}
+
+void Room::veng2TalkToSpock() {
+ if (_awayMission->veng.countdownStarted) {
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_075);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_009);
+ } else
+ showText(TX_SPEAKER_SPOCK, TX_VEN4_017);
+}
+
+void Room::veng2TalkToMccoy() {
+ if (_awayMission->veng.countdownStarted) {
+ showText(TX_SPEAKER_MCCOY, TX_VEN2_041);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_007);
+ } else
+ showText(TX_SPEAKER_MCCOY, TX_VEN2_039);
+}
+
+void Room::veng2TalkToRedshirt() {
+ if (_awayMission->veng.countdownStarted) {
+ showText(TX_SPEAKER_KIJE, TX_VEN2_094);
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_078);
+ } else
+ showText(TX_SPEAKER_KIJE, TX_VEN2_086);
+}
+
+void Room::veng2UseTechJournalOnDeckIOConsole() {
+ if (_awayMission->veng.readEngineeringJournal)
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_046);
+ else {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_SPOCK, 0x112, 0x98, &Room::veng2ReachedDeckIOWithTechJournal);
+ }
+}
+
+void Room::veng2ReachedDeckIOWithTechJournal() {
+ loadActorAnimC(OBJECT_SPOCK, "susemn", -1, -1, &Room::veng2DoneReadingTechJournal);
+}
+
+void Room::veng2DoneReadingTechJournal() {
+ _awayMission->disableInput = false;
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_070);
+ showText(TX_SPEAKER_MCCOY, TX_VEN2_043);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_017);
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_081);
+ _awayMission->veng.readEngineeringJournal = true;
+}
+
+void Room::veng2UseLogOnDeckIOConsole() {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x112, 0x98, &Room::veng2ReachedDeckIOWithLog);
+}
+
+void Room::veng2ReachedDeckIOWithLog() {
+ loadActorAnimC(OBJECT_KIRK, "kusemn", -1, -1, &Room::veng2LoadedLog);
+}
+
+void Room::veng2LoadedLog() {
+ playVoc("COMPUTER");
+ _awayMission->disableInput = false;
+ _awayMission->veng.captainsLogIndex++;
+
+ if (_awayMission->veng.captainsLogIndex == 1)
+ showText(TX_SPEAKER_PATTERSON, TX_VEN2_082);
+ else if (_awayMission->veng.captainsLogIndex == 2)
+ showText(TX_SPEAKER_PATTERSON, TX_VEN2_083);
+ else if (_awayMission->veng.captainsLogIndex == 3)
+ showText(TX_SPEAKER_PATTERSON, TX_VEN2_084);
+ else if (_awayMission->veng.captainsLogIndex == 4) {
+ showText(TX_SPEAKER_ANDRADE, TX_VEN2_097);
+ _awayMission->veng.readAllLogs = true;
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_061);
+ } else
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_061);
+}
+
+void Room::veng2UseCommunicator() {
+ if (_awayMission->veng.toldElasiToBeamOver)
+ showText(TX_SPEAKER_ELASI_CAPTAIN, TX_VEN2_098);
+ else if (_awayMission->veng.countdownStarted) {
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_VEN2_HAIL_ELASI, TX_VEN2_HAIL_ENT, TX_VEN2_CANCEL,
+ TX_BLANK
+ };
+ int choice = showText(choices);
+
+ if (choice == 0) { // Hail Elasi
+ if (!_awayMission->veng.torpedoLoaded)
+ showText(TX_SPEAKER_MCCOY, TX_VEN2_040);
+ else {
+ loadActorAnim2(OBJECT_VIEWSCREEN, "s7r2p1", VIEWSCREEN_X, VIEWSCREEN_Y);
+ showText(TX_SPEAKER_ELASI_CAPTAIN, TX_VEN2_108);
+
+ const TextRef choices2[] = {
+ TX_SPEAKER_KIRK,
+ TX_VEN2_015, TX_VEN2_029,
+ TX_BLANK
+ };
+ choice = showText(choices2);
+
+ if (choice == 0) { // "We don't have it yet"
+ showText(TX_SPEAKER_ELASI_CAPTAIN, TX_VEN2_100);
+ loadActorAnim2(OBJECT_VIEWSCREEN, "s7r2u2", VIEWSCREEN_X, VIEWSCREEN_Y);
+ } else { // "You'll have to beam over"
+ showText(TX_SPEAKER_ELASI_CAPTAIN, TX_VEN2_114);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_025);
+ loadActorAnim2(OBJECT_VIEWSCREEN, "s7r2u2", VIEWSCREEN_X, VIEWSCREEN_Y);
+ _awayMission->veng.field4d = 1800;
+ _awayMission->veng.toldElasiToBeamOver = true;
+ }
+ }
+ } else if (choice == 1) // Hail enterprise
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_066);
+ } else if (_awayMission->veng.elasiShipDecloaked) {
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_066);
+ } else {
+ showText(TX_SPEAKER_KIRK, TX_MUD4_018);
+ showText(TX_SPEAKER_UHURA, TX_VEN2U093);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_028);
+ }
+}
+
+void Room::veng2UseKirkOnTorpedoButton() {
+ if (_awayMission->veng.poweredSystem != 1)
+ showText(TX_VEN2N028);
+ else if (!_awayMission->veng.torpedoLoaded)
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_058);
+ else if (!_awayMission->veng.elasiShieldsDown)
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_054); // Probably unused; weapons can't be powered while elasi shields are up?
+ else { // Fire on the defenseless Elasi
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x90, 0x95, &Room::veng2UseKirkReachedTorpedoButton);
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ }
+}
+
+void Room::veng2UseKirkReachedTorpedoButton() {
+ loadActorAnimC(OBJECT_KIRK, "kusemn", -1, -1, &Room::veng2KirkFiredTorpedo);
+}
+
+void Room::veng2KirkFiredTorpedo() {
+ playVoc("DBLWHAM2");
+ loadActorAnimC(OBJECT_VIEWSCREEN, "s7r2ph", 0, 0, &Room::veng2TorpedoStruckElasiShip);
+}
+
+void Room::veng2TorpedoStruckElasiShip() {
+ loadActorAnim2(OBJECT_VIEWSCREEN, "s7r2p1", VIEWSCREEN_X, VIEWSCREEN_Y);
+ showText(TX_SPEAKER_ELASI_CAPTAIN, TX_VEN2_104);
+ showText(TX_SPEAKER_ELASI_WEAPONS_MASTER, TX_VEN2_F29);
+ showText(TX_SPEAKER_ELASI_CREWMAN, TX_VEN2_F28);
+ showText(TX_SPEAKER_ELASI_CAPTAIN, TX_VEN2_101);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_014);
+ showText(TX_SPEAKER_ELASI_CAPTAIN, TX_VEN2_106);
+ loadActorAnimC(OBJECT_VIEWSCREEN, "s7r2rc", 0, 0, &Room::veng2ElasiRetreated);
+}
+
+void Room::veng2ElasiRetreated() {
+ showText(TX_SPEAKER_UHURA, TX_VEN2U094);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_026);
+ showText(TX_SPEAKER_CHEKOV, TX_VEN2_115);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_013);
+ showText(TX_SPEAKER_SCOTT, TX_VEN2_S09);
+ _awayMission->veng.firedTorpedo = true;
+
+ walkCrewmanC(OBJECT_KIRK, 0xec, 0x9d, &Room::veng2CrewmanInPositionToBeamOut);
+ walkCrewmanC(OBJECT_SPOCK, 0xd5, 0x96, &Room::veng2CrewmanInPositionToBeamOut);
+ walkCrewmanC(OBJECT_MCCOY, 0x101, 0x95, &Room::veng2CrewmanInPositionToBeamOut);
+ walkCrewmanC(OBJECT_REDSHIRT, 0xec, 0x8c, &Room::veng2CrewmanInPositionToBeamOut);
+}
+
+void Room::veng2CrewmanInPositionToBeamOut() {
+ if (++_roomVar.veng.numCrewmenReadyToBeamOut == 4) {
+ _awayMission->veng.missionScore = 16;
+ if (_awayMission->veng.field68)
+ _awayMission->veng.missionScore += 1;
+ if (_awayMission->veng.field69)
+ _awayMission->veng.missionScore += 1;
+ if (_awayMission->veng.readAllLogs)
+ _awayMission->veng.missionScore += 1;
+ if (_awayMission->veng.field6b)
+ _awayMission->veng.missionScore += 1;
+ if (_awayMission->veng.field6c)
+ _awayMission->veng.missionScore += 1;
+
+ endMission(_awayMission->veng.missionScore, 21, 0);
+ }
+}
+
+void Room::veng2UseSTricorderOnTorpedoButton() {
+ spockScan(DIR_N, TX_VEN2_F35); // ENHANCEMENT: Use spockScan (don't just show text)
+}
+
+void Room::veng2UseSTricorderOnMiddleConsole() {
+ spockScan(DIR_N, -1);
+ showText(TX_VEN2N030); // This is a narration, not Spock speaking
+}
+
+void Room::veng2UseSTricorderOnTorpedoControl() {
+ showText(TX_SPEAKER_KIRK, TX_VEN2_001);
+ spockScan(DIR_N, -1); // FIXME: delete this since Spock might not have his tricorder?
+
+ if (_awayMission->veng.poweredSystem != 1) { // No power to weapons
+ if (!_awayMission->veng.scannedMainComputer)
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_062);
+ else
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_064);
+ } else if (_awayMission->veng.tricordersPluggedIntoComputer != 3)
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_055);
+ else if (_awayMission->veng.poweredSystem != 1) // Unused, since the same condition was above
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_065);
+ else if (!_awayMission->veng.torpedoLoaded) {
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_068);
+ if (!_awayMission->veng.elasiShipDecloaked)
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_036);
+ else
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_037);
+ _awayMission->veng.examinedTorpedoControl = true;
+ // TODO: consider making it easier to trigger the above flag? (using spock on it
+ // won't work once the elasi are there, since you can't power the system; you need
+ // to look at it instead.)
+ } else
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_050);
+}
+
+void Room::veng2UseImpulseConsole() {
+ if (!_awayMission->veng.impulseEnginesOn) {
+ showText(TX_SPEAKER_KIRK, TX_VEN2_003);
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_063);
+ } else if (_awayMission->veng.tricordersPluggedIntoComputer != 3) {
+ showText(TX_SPEAKER_KIRK, TX_VEN2_003);
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_057);
+ } else {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_SPOCK, 0x22, 0x9b, &Room::veng2SpockReachedImpulseConsole);
+ }
+}
+
+void Room::veng2SpockReachedImpulseConsole() {
+ loadActorAnimC(OBJECT_SPOCK, "susemn", -1, -1, &Room::veng2SpockUsedImpulseConsole);
+}
+
+void Room::veng2SpockUsedImpulseConsole() {
+ _awayMission->disableInput = false;
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_069);
+
+ // Choose where to transfer power
+ const TextRef choices[] = {
+ TX_NULL,
+ TX_VEN2_WEA, TX_VEN2_SHI, TX_VEN2_TRA,
+ TX_BLANK
+ };
+ int choice = showText(choices);
+
+ if (choice == 0) { // Weapons
+ if (_awayMission->veng.toldElasiToBeamOver) {
+powerWeapons:
+ if (_awayMission->veng.poweredSystem == 2) {
+ playVoc("LD6BMOFF");
+ loadActorAnim2(OBJECT_DAMAGE_DISPLAY_1, "s7r2sh3", DAMAGE_DISPLAY_1_X, DAMAGE_DISPLAY_1_Y);
+ }
+ _awayMission->veng.poweredSystem = 1;
+ showText(TX_SPEAKER_KIJE, TX_VEN2_088);
+ if (_awayMission->veng.toldElasiToBeamOver) {
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_052);
+ _awayMission->veng.elasiShieldsDown = true;
+ _awayMission->veng.field51 = 900;
+ }
+ if (_awayMission->veng.elasiShipDecloaked && !_awayMission->veng.elasiHailedRepublic) {
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_033);
+ _awayMission->veng.field49 = 1800;
+ }
+ } else if (_awayMission->veng.countdownStarted)
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_035);
+ else if (_awayMission->veng.poweredSystem == 1) // Weapons already powered
+ showText(TX_SPEAKER_KIJE, TX_VEN2_091);
+ else
+ goto powerWeapons;
+ } else if (choice == 1) { // Shields
+ if (_awayMission->veng.poweredSystem == 2) // Shields already powered
+ showText(TX_SPEAKER_KIJE, TX_VEN2_089);
+ else if (_awayMission->veng.toldElasiToBeamOver)
+ showText(TX_SPEAKER_KIJE, TX_VEN2_085);
+ else {
+ loadActorAnim2(OBJECT_DAMAGE_DISPLAY_1, "s7r2sh", DAMAGE_DISPLAY_1_X, DAMAGE_DISPLAY_1_Y);
+ _awayMission->veng.poweredSystem = 2;
+ if (_awayMission->veng.elasiShipDecloaked)
+ _awayMission->timers[2] = 45; // Timer until the elasi hail the ship
+ showText(TX_SPEAKER_KIJE, TX_VEN2_092);
+ }
+ } else if (choice == 2) { // Transporter
+ if (_awayMission->veng.countdownStarted) {
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_034);
+ if (_awayMission->veng.havePowerPack) {
+ showText(TX_SPEAKER_KIRK, TX_VEN2_018);
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_077);
+ }
+ } else if (_awayMission->veng.poweredSystem == 3) // Transporter already powered
+ showText(TX_SPEAKER_KIJE, TX_VEN2_090); // BUGFIX: audio didn't play properly
+ else {
+ if (_awayMission->veng.poweredSystem == 2) {
+ playVoc("LD6BMOFF"); // ENHANCEMENT: make this consistent with the weapons code
+ loadActorAnim2(OBJECT_DAMAGE_DISPLAY_1, "s7r2sh3", DAMAGE_DISPLAY_1_X, DAMAGE_DISPLAY_1_Y);
+ }
+ _awayMission->veng.poweredSystem = 3;
+ showText(TX_SPEAKER_KIJE, TX_VEN2_087);
+ if (_awayMission->veng.elasiShipDecloaked && !_awayMission->veng.elasiHailedRepublic) {
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_071);
+ _awayMission->veng.field49 = 1800;
+ }
+ }
+ }
+
+}
+
+void Room::veng2UseMainComputer() {
+ showText(TX_SPEAKER_KIRK, TX_VEN2_002);
+ if (_awayMission->veng.tricordersPluggedIntoComputer != 3) {
+ spockScan(DIR_W, TX_VEN2_079);
+ showText(TX_SPEAKER_KIRK, TX_VEN2_024);
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_080);
+ showText(TX_SPEAKER_MCCOY, TX_VEN2_045);
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_074);
+ showText(TX_SPEAKER_KIJE, TX_VEN2_096);
+ _awayMission->veng.scannedMainComputer = true;
+ } else
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_059);
+}
+
+void Room::veng2UseSTricorderOnMainComputer() {
+ if (!_awayMission->veng.scannedMainComputer)
+ veng2UseMainComputer();
+ else if (!_awayMission->veng.impulseEnginesOn)
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_031);
+ else {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_SPOCK, 0x52, 0x84, &Room::veng2SpockReachedMainComputerToPutTricorder);
+ }
+}
+
+void Room::veng2SpockReachedMainComputerToPutTricorder() {
+ loadActorAnimC(OBJECT_SPOCK, "susemn", -1, -1, &Room::veng2AttachedSTricorderToComputer);
+}
+
+void Room::veng2AttachedSTricorderToComputer() {
+ playVoc("MUR4E1");
+ _awayMission->disableInput = false;
+ if (_awayMission->veng.tricordersPluggedIntoComputer != 1) // Mccoy's isn't in yet
+ _awayMission->veng.tricordersPluggedIntoComputer = 2;
+ else {
+ _awayMission->veng.tricordersPluggedIntoComputer = 3;
+ _awayMission->timers[0] = 40; // Timer until Elasi appear
+ }
+
+ loseItem(OBJECT_ISTRICOR);
+ loadActorAnim2(OBJECT_STRICORDER, "s7r2t1", STRICORDER_POS_X, STRICORDER_POS_Y);
+
+ showText(TX_VEN2N017);
+
+ walkCrewman(OBJECT_SPOCK, 0x5f, 0xaa);
+ if (_awayMission->veng.tricordersPluggedIntoComputer == 3) // Both tricorders plugged in
+ veng2BothTricordersPluggedIn();
+}
+
+void Room::veng2UseMTricorderOnMainComputer() {
+ if (!_awayMission->veng.impulseEnginesOn)
+ showText(TX_SPEAKER_MCCOY, TX_VEN2_038);
+ else {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_SPOCK, 0x52, 0x84, &Room::veng2MccoyReachedMainComputerToPutTricorder);
+ }
+}
+
+void Room::veng2MccoyReachedMainComputerToPutTricorder() {
+ loadActorAnimC(OBJECT_SPOCK, "susemn", -1, -1, &Room::veng2AttachedMTricorderToComputer);
+}
+
+void Room::veng2AttachedMTricorderToComputer() {
+ playVoc("MUR4E1");
+ _awayMission->disableInput = false;
+ if (_awayMission->veng.tricordersPluggedIntoComputer != 2) // Spock's isn't in yet
+ _awayMission->veng.tricordersPluggedIntoComputer = 1;
+ else {
+ _awayMission->veng.tricordersPluggedIntoComputer = 3;
+ _awayMission->timers[0] = 40; // Timer until Elasi appear
+ }
+
+ loseItem(OBJECT_IMTRICOR);
+ loadActorAnim2(OBJECT_MTRICORDER, "s7r2t2", MTRICORDER_POS_X, MTRICORDER_POS_Y);
+
+ showText(TX_VEN2N016);
+
+ walkCrewman(OBJECT_SPOCK, 0x5f, 0xaa);
+ if (_awayMission->veng.tricordersPluggedIntoComputer == 3) // Both tricorders plugged in
+ veng2BothTricordersPluggedIn();
+}
+
+void Room::veng2BothTricordersPluggedIn() {
+ loadActorAnim2(OBJECT_MAIN_COMPUTER, "s7r2t3", MAIN_COMPUTER_X, MAIN_COMPUTER_Y);
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_030);
+}
+
+void Room::veng2UseSTricorderOnDeckIOConsole() {
+ spockScan(DIR_E, TX_VEN2_067);
+}
+
+void Room::veng2UseSTricorderOnImpulseConsole() {
+ if (!_awayMission->veng.impulseEnginesOn)
+ spockScan(DIR_W, TX_VEN2_056);
+ else
+ spockScan(DIR_W, TX_VEN2_051);
+}
+
+void Room::veng2UseFusionPackOnMainComputer() {
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_060);
+}
+
+void Room::veng2GetLogDeck() {
+ walkCrewmanC(OBJECT_KIRK, 0xe7, 0x93, &Room::veng2ReachedLogDeck);
+ _awayMission->disableInput = true;
+}
+
+void Room::veng2ReachedLogDeck() {
+ loadActorAnimC(OBJECT_KIRK, "kuseln", -1, -1, &Room::veng2PickedUpLogDeck);
+}
+
+void Room::veng2PickedUpLogDeck() {
+ loadActorStandAnim(OBJECT_DECK);
+ _awayMission->disableInput = false;
+ _awayMission->veng.tookRecordDeckFromAuxilaryControl = true;
+ showText(TX_VEN2N039);
+ giveItem(OBJECT_IDECK);
+}
+
+void Room::veng2GetSTricorder() {
+ if (_awayMission->veng.countdownStarted)
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_047);
+ else {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_SPOCK, 0x52, 0x84, &Room::veng2ReachedSTricorderToGet);
+ }
+}
+
+void Room::veng2ReachedSTricorderToGet() {
+ loadActorAnimC(OBJECT_SPOCK, "susemn", -1, -1, &Room::veng2PickedUpSTricorder);
+}
+
+void Room::veng2PickedUpSTricorder() {
+ _awayMission->disableInput = false;
+ _awayMission->veng.tricordersPluggedIntoComputer &= ~2;
+ giveItem(OBJECT_ISTRICOR);
+ loadActorStandAnim(OBJECT_STRICORDER);
+ loadActorStandAnim(OBJECT_MAIN_COMPUTER);
+ walkCrewman(OBJECT_SPOCK, 0x5f, 0xaa);
+ showText(TX_VEN2N015);
+}
+
+void Room::veng2GetMTricorder() {
+ if (_awayMission->veng.countdownStarted)
+ showText(TX_SPEAKER_SPOCK, TX_VEN2_047);
+ else {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_SPOCK, 0x52, 0x84, &Room::veng2ReachedMTricorderToGet);
+ }
+}
+
+void Room::veng2ReachedMTricorderToGet() {
+ loadActorAnimC(OBJECT_SPOCK, "susemn", -1, -1, &Room::veng2PickedUpMTricorder);
+}
+
+void Room::veng2PickedUpMTricorder() {
+ _awayMission->disableInput = false;
+ _awayMission->veng.tricordersPluggedIntoComputer &= ~1;
+ giveItem(OBJECT_IMTRICOR);
+ loadActorStandAnim(OBJECT_MTRICORDER);
+ loadActorStandAnim(OBJECT_MAIN_COMPUTER);
+ walkCrewman(OBJECT_SPOCK, 0x5f, 0xaa);
+ showText(TX_VEN2N013);
}
}
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 8282565..c5f2e47 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -65,6 +65,10 @@ extern const char *const g_gameStrings[] = {
"Ensign Kije",
"*Capt. Patterson*",
+ "*Commander Andrade*",
+ "Elasi Captain",
+ "Elasi Weapons Master",
+ "Elasi Crewman",
"#BRID\\BRIDU146#Nothing to report, Captain.",
@@ -2776,13 +2780,173 @@ extern const char *const g_gameStrings[] = {
"#VEN1\\VEN1N023#You retrieve the molecular saw.",
- "#VEN2\\VEN2_028#Yes, Uhura. Just wanted a status report. Kirk out.",
+ "#VEN2\\VEN2_001#Mr. Spock, what is the condition of the fire control system?",
+ "#VEN2\\VEN2_002#Mr. Spock, what is the status of the ship's computer?",
+ "#VEN2\\VEN2_003#Spock, what is the situation with the impulse engines?",
+ "#VEN2\\VEN2_004#We don't have much time for talk. The Elasi are known for their punctuality.",
+ "#VEN2\\VEN2_005#What a mess. I wonder what we can do to fix this.",
+ "#VEN2\\VEN2_006#I assume, since you haven't blasted us to bits, you want something.",
+ "#VEN2\\VEN2_007#I don't know, Bones.",
+ "#VEN2\\VEN2_008#I see your point.",
+ "#VEN2\\VEN2_009#I'm not one to overlook strategic implications, Mr. Spock, but we can save that for another time.",
+ "#VEN2\\VEN2_010#It was a setup?!",
+ "#VEN2\\VEN2_011#It will take time. The controls are smashed, and the main computer's badly damaged. It will take hours to get power to the computer banks.",
+ "#VEN2\\VEN2_012#Just try and get it. You can't threaten me!",
+ "#VEN2\\VEN2_013#No, Ensign. It looks like the Elasi have been doing some business with them. Scotty, beam us back. We need to find that ship that attacked the Republic.",
+ "#VEN2\\VEN2_014#Not too soon, I hope.",
+ "#VEN2\\VEN2_015#Not yet. We're having trouble accessing all the data files.",
+ "#VEN2\\VEN2_016#Put it on Screen, Spock.",
+ "#VEN2\\VEN2_017#Spock, just tell me if they will help.",
+ "#VEN2\\VEN2_018#Spock, what about the Fusion Power Pack? Could we use it to power the transporter?",
+ "#VEN2\\VEN2_019#That ship was cloaked!",
+ "#VEN2\\VEN2_020#The Masada, I presume. You want the locations of all your imprisoned comrades?",
+ "#VEN2\\VEN2_021#The Republic will fall apart if you fire on us. Then you'll never get the data.",
+ "#VEN2\\VEN2_022#Thirty minutes, then. Kirk out.",
+ "#VEN2\\VEN2_023#Umm, well...",
+ "#VEN2\\VEN2_024#We don't have several days, Mr. Spock.",
+ "#VEN2\\VEN2_025#We'll comply. Kirk out.",
+ "#VEN2\\VEN2_026#We're fine, lieutenant.",
+ "#VEN2\\VEN2_027#What do you want?",
+ "#VEN2\\VEN2_028#Yes, Uhura, Just wanted a status report. Kirk out.",
+ "#VEN2\\VEN2_029#Yes, we have. You'll have to beam over and get it, though. The computer's subspace transmitter is out.",
+ "#VEN2\\VEN2_030#Both Tricorders are rigged into the main computer's central processing unit. We now have enough computational power to control a single ship's system.",
+ "#VEN2\\VEN2_031#Captain, I recommend we wait until we have restored power before I hook up the tricorders to the main computer. We may need them in engineering first.",
+ "#VEN2\\VEN2_032#Captain, I suggest we try to raise the shields.",
+ "#VEN2\\VEN2_033#Captain, I suggest we try to raise the shields.",
+ "#VEN2\\VEN2_034#Captain, the elasi can surely detect the lowering of our shields. They will undoubtedly try to board us if we lower them.",
+ "#VEN2\\VEN2_035#Captain, the elasi can surely detect the lowering of our shields. They will undoubtedly try to board us if we lower them.",
+ "#VEN2\\VEN2_036#Captain, the torpedo loading system is malfunctioning. To clear it, we will have to physically examine the mechanism. Currently, all turbolift access to the torpedo bay is blocked by a hull breach. Fortunately, it is highly unlikely that we will need this ship's weapons systems.",
+ "#VEN2\\VEN2_037#Captain, the torpedo loading system is malfunctioning. To clear it, we will have to physically examine the mechanism. Currently, all turbolift access to the torpedo bay is blocked by a hull breach. It is imperative that we get the weapons on-line.",
+ "#VEN2\\VEN2_038#I'm a doctor, not a computer scientist!",
+ "#VEN2\\VEN2_039#I'm glad this isn't the Enterprise.",
+ "#VEN2\\VEN2_040#Jim, since we do not have what they want, I don't think it is a good idea to contact them until we are able to defend ourselves.",
+ "#VEN2\\VEN2_041#Cloaked Elasi. I wonder who the old friend they mentioned is?",
+ "#VEN2\\VEN2_042#Is that all you can say?",
+ "#VEN2\\VEN2_043#Jim, do we really need a lesson in starship engineering?",
+ "#VEN2\\VEN2_044#Shut up, Spock!",
+ "#VEN2\\VEN2_045#That's just great, Spock. We don't exactly carry an M-5 computer in our inventory.",
+ "#VEN2\\VEN2_046#I have memorized all pertinent data, Captain. there is no need to reexamine the journals.",
+ "#VEN2\\VEN2_047#It would not be prudent to remove the tricorder at this time, Captain. Doing so will cause the shields to shut down and allow the elasi to beam a boarding party over.",
+ "#VEN2\\VEN2_048#Lowering shields and allocating power to photon torpedo systems. Torpedo is loaded and ready.",
+ "#VEN2\\VEN2_050#Photon torpedoes are loaded and ready to be fired.", // TYPO
+ "#VEN2\\VEN2_051#Power is available, but the main computer is too badly damaged to actively control the power circuits.",
+ "#VEN2\\VEN2_052#Sensors indicate that the Elasi Ship has lowered its shields. I suggest we prepare your surprise soon, Captain. They will beam over any moment.",
+ "#VEN2\\VEN2_053#That would be unwise, Captain. I thought our plan was to surprise the Elasi.",
+ "#VEN2\\VEN2_054#The elasi ship's shield are still raised, captain. A single photon hit will have a negligible effect on the ship.",
+ "#VEN2\\VEN2_055#The impulse engines are back on-line, but we have no way of directing power to the weapons system.",
+ "#VEN2\\VEN2_056#The impulse power allocation controls are functional, but there is no power available, Captain.",
+ "#VEN2\\VEN2_057#The main computer is too badly damaged to actively control the power circuits.",
+ "#VEN2\\VEN2_058#The torpedo warning systems are showing a malfunction in the torpedo loading bay.",
+ "#VEN2\\VEN2_059#The tricorders are currently operating at 12.69 percent less than normal computing efficiency.",
+ "#VEN2\\VEN2_060#The unit doesn't generate enough power to run any of the major systems. Main or Auxiliary power is required for that, Captain.",
+ "#VEN2\\VEN2_061#There are no more log decks, Captain.",
+ "#VEN2\\VEN2_062#There currently is no power being allocated to the weapons system. Even if there were a power source, the damage to the main computer is enough to prevent power allocation to that system.",
+ "#VEN2\\VEN2_063#There is currently no power to be allocated from the engines.",
+ "#VEN2\\VEN2_064#There is no power allocated to the weapons system, Captain.",
+ "#VEN2\\VEN2_065#There is no power allocated to the weapons system.",
"#VEN2\\VEN2_066#They are jamming all frequencies, Captain. We will not be able to contact the Enterprise.",
+ "#VEN2\\VEN2_067#This input/output slot for the record decks is still functional, Captain.",
+ "#VEN2\\VEN2_068#Weapons control is functioning properly, however, there appears to be a jam in the primary loading mechanism.",
+ "#VEN2\\VEN2_069#With impulse power online and the tricorders performing computer control, I can divert power to...",
+ "#VEN2\\VEN2_070#Captain, I have examined the Engineering Journals. According to chapter eighteen, we can run...",
+ "#VEN2\\VEN2_071#Captain, I suggest we try to raise the shields.",
+ "#VEN2\\VEN2_072#Captain, the main computer is far beyond...",
+ "#VEN2\\VEN2_073#Captain, we are being hailed by the Elasi Captain.",
+ "#VEN2\\VEN2_074#Correct, Doctor. However, there may be another alternative. Linked tricorders, along with the circuits in the data reader, should have the processing power necessary to control a single starship system.",
+ "#VEN2\\VEN2_075#Fascinating. A cloaked Elasi.",
+ "#VEN2\\VEN2_076#Fascinating.",
+ "#VEN2\\VEN2_077#I believe so, Captain. It would require a connection to the transporter circuits in the main control console.",
+ "#VEN2\\VEN2_078#That is beyond the Elasi's capabilities, Ensign.",
+ "#VEN2\\VEN2_079#There is extensive damage to the main processing unit of the ship's computer. It will take several days at a starbase to repair.",
+ "#VEN2\\VEN2_080#Unless we can find a suitable computational alternative, there will be no way to control the ship's systems.",
+ "#VEN2\\VEN2_081#Why, yes, Captain.",
+ "#VEN2\\VEN2_082#Captain's log, stardate 6087.6. The Republic is currently approaching the Vardaine system. Sensors have detected unusual energy fluctuations near one of the Vardainian moons. Starfleet has ordered us to investigate.",
+ "#VEN2\\VEN2_083#Captain's log, stardate 6087.8. We are under attack by two unidentified ships. I don't know how they could have approached undetected. They must have some kind of cloaking device, although there are no reports of Romulans in this sector.",
+ "#VEN2\\VEN2_084#Captain's log, stardate 6088.1. We have successfully driven off our assailants. Major damage has been sustained by our warp engines. Communications has reported that U.S.S. Enterprise is in sector. I requested Mr. Scott's assistance in repairing damage to the Republic. With luck, we will be fully operational in a couple of days.",
+ "#VEN2\\VEN2_085#Captain, the Elasi will surely fire upon us if we raise our shields.",
+ "#VEN2\\VEN2_086#If there's anything I can do, sir, just ask.",
+ "#VEN2\\VEN2_087#Power allocated to transporter systems, sir.",
+ "#VEN2\\VEN2_088#Power allocated to weapons systems, Captain.",
+ "#VEN2\\VEN2_089#Power has already been allocated to the shields, sir.",
+ "#VEN2\\VEN2_090#Power has already been allocated to the transporter systems, Captain.",
+ "#VEN2\\VEN2_091#Power has already been allocated to the weapons, Sir.",
+ "#VEN2\\VEN2_092#Shields are up, sir.",
+ "#VEN2\\VEN2_093#Captain, Look! An Elasi ship!",
+ "#VEN2\\VEN2_094#Captain, do you suppose the Elasi might have used cloaking technology to project a false image, of a ship the Republic would trust?",
+ "#VEN2\\VEN2_096#Thank goodness for parallel processing. I don't know what computers could do without it.",
+ "#VEN2\\VEN2_097#Captain's log, stardate 6088.5. First Officer Andrade commanding. The Enterprise has unexplicably opened fire upon us. Captain Patterson has been mortally wounded. We have sustained major damage to all systems. Impulse power is out. We cannot understand why...",
"#VEN2\\VEN2_098#What are you stalling for? Lower your shields.",
+ "#VEN2\\VEN2_099#Can't threaten you?! As you said, I can blow you to bits!",
+ "#VEN2\\VEN2_100#You better step on it, Kirk! You only have a few minutes left!",
+ "#VEN2\\VEN2_101#Activate cloaking device! Kirk, until we meet again.",
+ "#VEN2\\VEN2_102#All right, Kirk. We'll do it your way. I would rather not kill you. Besides, there's an old friend that wants to meet you. I give you thirty minutes. And remember, no tricks.",
+ "#VEN2\\VEN2_103#I can see why they made you Captain!",
+ "#VEN2\\VEN2_104#Kirk! I should have known you'd try something underhanded like this. Weaponsmaster, fire all weapons on the Republic!",
+ "#VEN2\\VEN2_105#Maybe I should just pump a few torpedoes into your shields and check it out for myself.",
+ "#VEN2\\VEN2_106#Watch yourself, Captain. It may be sooner than you realize.",
+ "#VEN2\\VEN2_107#We finally meet in person, Captain Kirk. So where is the data I requested?",
+ "#VEN2\\VEN2_108#Well, Captain Kirk, I trust you and your valiant crew have retrieved the data I requested?",
+ "#VEN2\\VEN2_109#Well, if it isn't Captain Kirk. Fancy meeting you out here all alone in such a shabby starship.",
+ "#VEN2\\VEN2_110#What? You mean you were deliberately wasting my time? Guards, take them back to the ship! I'll think of a suitable punishment for them later.",
+ "#VEN2\\VEN2_111#Why, yes I do. It seems you failed to give one of my associates some rather important information.",
+ "#VEN2\\VEN2_112#Yes, Kirk. The Republic's computers will have the data just as your Enterprise would. I give you one minute to comply.",
+ "#VEN2\\VEN2_113#You should be more civil considering your Enterprise is far away on a mercy mission helping that poor trader.",
+ "#VEN2\\VEN2_114#How convenient, Kirk. We'll beam over, but no tricks. My sensors read that only your shields have power. Lower them now!",
+ "#VEN2\\VEN2_115#Sir, we picked up another ship nearby and we came as fast as we could. It appeared to cloak. Were you attacked by Romulans?",
+ "#VEN2\\VEN2_ELA#Contact Elasi Ship.",
+ "#VEN2\\VEN2_ENT#Contact Enterprise.",
+ "#VEN2\\VEN2_F28#Captain, the Enterprise is coming on high speed approach!",
+ "#VEN2\\VEN2_F29#We can't, Captain. All weapons systems off-line!",
+ "#VEN2\\VEN2_F35#This is the photon torpedo launching control.",
+ "#VEN2\\VEN2_S09#Aye, Captain.",
+ "#VEN2\\VEN2_SHI#Shields",
+ "#VEN2\\VEN2_TRA#Transporter Circuits",
+ "#VEN2\\VEN2_WEA#Weapons",
+ "#VEN2\\VEN2N000#A red flashing light is currently indicating a jam in the torpedo loading mechanism.",
+ "#VEN2\\VEN2N001#All indicators are dead.",
+ "#VEN2\\VEN2N002#An Elasi frigate is visible on the viewscreen. Though silent now, you know it is ready to attack at a moment's notice.",
+ "#VEN2\\VEN2N003#Damage from the battle has disabled the ship's main computer.",
+ "#VEN2\\VEN2N004#Ensign Kije doesn't see the need for a security escort.",
+ "#VEN2\\VEN2N005#Indicators currently show all power diverted to the shields.",
+ "#VEN2\\VEN2N006#Indicators currently show all power diverted to transporter systems.",
+ "#VEN2\\VEN2N007#Indicators currently show all power diverted to weapons control.",
+ "#VEN2\\VEN2N008#Indicators currently show no power output from the impulse engines.",
+ "#VEN2\\VEN2N009#Indicators show impulse power online, but no power allocated to any systems.",
+ "#VEN2\\VEN2N010#Kirk is dismayed by the damage that was done to Auxiliary Control.",
+ "#VEN2\\VEN2N011#McCoy is fidgeting around.",
+ "#VEN2\\VEN2N012#McCoy wishes that Mr. Scott were here.",
+ "#VEN2\\VEN2N013#Medical Tricorder taken.",
+ "#VEN2\\VEN2N015#Science Tricorder taken.",
+ "#VEN2\\VEN2N016#Spock crudely attaches the medical tricorder to the computer console.",
+ "#VEN2\\VEN2N017#Spock crudely attaches the science tricorder to the computer console.",
+ "#VEN2\\VEN2N018#Spock is analyzing the surroundings.",
+ "#VEN2\\VEN2N019#Spock wishes that Mr. Scott were here.",
+ "#VEN2\\VEN2N020#Status indicator show that the torpedo tubes are currently empty.",
+ "#VEN2\\VEN2N021#Status indicators show that photon torpedo number one and is loaded and ready to be fired.",
+ "#VEN2\\VEN2N022#The auxiliary control room viewscreen is still operating. It is displaying a view of empty space.",
+ "#VEN2\\VEN2N023#The medical tricorder is crudely wired into the computer console.",
+ "#VEN2\\VEN2N024#The medical tricorder is currently wired into the computer console.",
+ "#VEN2\\VEN2N025#The science and medical tricorders are jury-rigged to the remains of the Republic computer system.",
+ "#VEN2\\VEN2N027#The science tricorder is currently wired into the computer console.",
+ "#VEN2\\VEN2N028#There is no response.",
+ "#VEN2\\VEN2N029#These are Federation standard record decks.",
+ "#VEN2\\VEN2N030#These are the auxiliary helm and navigation controls for the Republic. Though they are intact, the ship is in no condition to move under her own power.",
+ "#VEN2\\VEN2N031#This is a standard input/output slot for record decks.",
+ "#VEN2\\VEN2N032#This is the auxiliary ship damage display. Red flashing damage indicators dominate its surface.",
+ "#VEN2\\VEN2N033#This is the fire control for the photon torpedoes. ",
+ "#VEN2\\VEN2N034#This is the impulse power allocation control.",
+ "#VEN2\\VEN2N035#This is the Republic's Auxiliary Control Room. It appears to be in better shape than the main bridge.",
+ "#VEN2\\VEN2N038#You are in a typical starship corridor.",
+ "#VEN2\\VEN2N039#You take the record decks.",
"#VEN2\\VEN2U093#Enterprise here. We're still tracking the distress call. Are you all right, Sir?",
+ "#VEN2\\VEN2U094#Enterprise to Captain Kirk. Are you safe, sir?",
+ "Hail Elasi",
+ "Hail Enterprise",
+ "cancel",
"#VEN4\\VEN4_016#There's nothing more I can do.", // TYPO
+ "#VEN4\\VEN4_017#I believe nothing needs to be said, Captain.",
"#VEN4\\VEN4N010#This is an empty hypodermic injector.",
"#VEN4\\VEN4N014#Yet another crewman of the Republic whose life was unfairly abbreviated.",
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 682ee5f..0b26bd0 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -123,6 +123,10 @@ enum GameStringIDs {
TX_SPEAKER_KIJE,
TX_SPEAKER_PATTERSON,
+ TX_SPEAKER_ANDRADE,
+ TX_SPEAKER_ELASI_CAPTAIN,
+ TX_SPEAKER_ELASI_WEAPONS_MASTER,
+ TX_SPEAKER_ELASI_CREWMAN,
TX_BRIDU146,
@@ -2886,13 +2890,183 @@ enum GameStringIDs {
// UNUSED: VEN1NA18 (variant of VEN1N018)
+ TX_VEN2_001,
+ TX_VEN2_002,
+ TX_VEN2_003,
+ TX_VEN2_004,
+ TX_VEN2_005,
+ TX_VEN2_006,
+ TX_VEN2_007,
+ TX_VEN2_008,
+ TX_VEN2_009,
+ TX_VEN2_010,
+ TX_VEN2_011,
+ TX_VEN2_012,
+ TX_VEN2_013,
+ TX_VEN2_014,
+ TX_VEN2_015,
+ TX_VEN2_016,
+ TX_VEN2_017,
+ TX_VEN2_018,
+ TX_VEN2_019,
+ TX_VEN2_020,
+ TX_VEN2_021,
+ TX_VEN2_022,
+ TX_VEN2_023, // UNUSED
+ TX_VEN2_024,
+ TX_VEN2_025,
+ TX_VEN2_026,
+ TX_VEN2_027,
TX_VEN2_028,
+ TX_VEN2_029,
+ TX_VEN2_030,
+ TX_VEN2_031,
+ TX_VEN2_032,
+ TX_VEN2_033,
+ TX_VEN2_034,
+ TX_VEN2_035,
+ TX_VEN2_036,
+ TX_VEN2_037,
+ TX_VEN2_038,
+ TX_VEN2_039,
+ TX_VEN2_040,
+ TX_VEN2_041,
+ TX_VEN2_042,
+ TX_VEN2_043,
+ TX_VEN2_044,
+ TX_VEN2_045,
+ TX_VEN2_046,
+ TX_VEN2_047,
+ TX_VEN2_048, // UNUSED
+ // UNUSED
+ TX_VEN2_050, // UNUSED
+ TX_VEN2_051,
+ TX_VEN2_052,
+ TX_VEN2_053, // UNUSED
+ TX_VEN2_054,
+ TX_VEN2_055,
+ TX_VEN2_056,
+ TX_VEN2_057,
+ TX_VEN2_058,
+ TX_VEN2_059,
+ TX_VEN2_060,
+ TX_VEN2_061,
+ TX_VEN2_062,
+ TX_VEN2_063,
+ TX_VEN2_064,
+ TX_VEN2_065,
TX_VEN2_066,
+ TX_VEN2_067,
+ TX_VEN2_068,
+ TX_VEN2_069,
+ TX_VEN2_070,
+ TX_VEN2_071,
+ TX_VEN2_072,
+ TX_VEN2_073,
+ TX_VEN2_074,
+ TX_VEN2_075,
+ TX_VEN2_076, // UNUSED
+ TX_VEN2_077,
+ TX_VEN2_078,
+ TX_VEN2_079,
+ TX_VEN2_080,
+ TX_VEN2_081,
+ TX_VEN2_082,
+ TX_VEN2_083,
+ TX_VEN2_084,
+ TX_VEN2_085,
+ TX_VEN2_086,
+ TX_VEN2_087,
+ TX_VEN2_088,
+ TX_VEN2_089,
+ TX_VEN2_090,
+ TX_VEN2_091,
+ TX_VEN2_092,
+ TX_VEN2_093,
+ TX_VEN2_094,
+ // UNUSED
+ TX_VEN2_096,
+ TX_VEN2_097,
TX_VEN2_098,
+ TX_VEN2_099,
+ TX_VEN2_100,
+ TX_VEN2_101,
+ TX_VEN2_102,
+ TX_VEN2_103,
+ TX_VEN2_104,
+ TX_VEN2_105,
+ TX_VEN2_106,
+ TX_VEN2_107, // UNUSED
+ TX_VEN2_108,
+ TX_VEN2_109,
+ TX_VEN2_110, // UNUSED
+ TX_VEN2_111,
+ TX_VEN2_112,
+ TX_VEN2_113,
+ TX_VEN2_114,
+ TX_VEN2_115,
+ // UNUSED (116 -> 117; uhura voice substitute)
+ TX_VEN2_ELA, // UNUSED
+ TX_VEN2_ENT, // UNUSED
+ TX_VEN2_F28,
+ TX_VEN2_F29,
+ TX_VEN2_F35,
+ // UNUSED: VEN2L062, VEN2L063 (someone's voice substitute?)
+ TX_VEN2_S09,
+ TX_VEN2_SHI,
+ TX_VEN2_TRA,
+ TX_VEN2_WEA,
+ TX_VEN2N000,
+ TX_VEN2N001,
+ TX_VEN2N002,
+ TX_VEN2N003,
+ TX_VEN2N004,
+ TX_VEN2N005,
+ TX_VEN2N006,
+ TX_VEN2N007,
+ TX_VEN2N008,
+ TX_VEN2N009,
+ TX_VEN2N010,
+ TX_VEN2N011, // UNUSED
+ TX_VEN2N012,
+ TX_VEN2N013,
+ // MISSING
+ TX_VEN2N015,
+ TX_VEN2N016,
+ TX_VEN2N017,
+ TX_VEN2N018, // UNUSED
+ TX_VEN2N019,
+ TX_VEN2N020,
+ TX_VEN2N021,
+ TX_VEN2N022,
+ TX_VEN2N023,
+ TX_VEN2N024,
+ TX_VEN2N025,
+ // UNUSED
+ TX_VEN2N027,
+ TX_VEN2N028,
+ TX_VEN2N029,
+ TX_VEN2N030,
+ TX_VEN2N031,
+ TX_VEN2N032,
+ TX_VEN2N033,
+ TX_VEN2N034,
+ TX_VEN2N035,
+ // UNUSED: 036, 037
+ TX_VEN2N038, // UNUSED
+ TX_VEN2N039,
+ // UNUSED: N040 -> N043 (options for a menu?)
+ // UNUSED: VEN2NA25 (Alternate for VEN2N025)
+ // UNUSED: VEN2S072 (similar to VEN2_027)
TX_VEN2U093,
+ TX_VEN2U094,
+ TX_VEN2_HAIL_ELASI, // Custom named text
+ TX_VEN2_HAIL_ENT,
+ TX_VEN2_CANCEL,
TX_VEN4_016,
+ TX_VEN4_017,
TX_VEN4N010,
TX_VEN4N014,
Commit: ebc6f194c27f23b74df1fb8a8fb8aed43fcdd050
https://github.com/scummvm/scummvm/commit/ebc6f194c27f23b74df1fb8a8fb8aed43fcdd050
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: VENG3
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/veng1.cpp
engines/startrek/rooms/veng3.cpp
engines/startrek/text.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 286300d..835a2b7 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -665,7 +665,12 @@ struct AwayMission {
int16 field4b; // 0x4b
int16 field4d; // 0x4d
int16 field51; // 0x51
+ bool putSupportBeamInSickbayHallway; // 0x53
+ bool clearedDebris; // 0x54
+ bool lookedAtTurbolift2Door; // 0x55
+ bool kirkSuggestedReestablishingPower; // 0x56
bool havePowerPack; // 0x5a
+ bool tookCableFromSickbayHallway; // 0x5f
bool tookMolecularSaw; // 0x60
bool readEngineeringJournal; // 0x61
bool examinedTorpedoControl; // 0x66
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 41b7d9b..78fbe2b 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2595,6 +2595,49 @@ public:
// VENG3
void veng3Tick1();
+ void veng3Tick15();
+ void veng3TouchedTurbolift2();
+ void veng3TouchedTurbolift1();
+ void veng3WalkToDoor();
+ void veng3ReachedTurbolift2();
+ void veng3Turbolift2Opened();
+ void veng3WalkToSickbayDoor();
+ void veng3ReachedSickbayDoor();
+ void veng3SickbayDoorOpened();
+ void veng3LookAtSupportBeam();
+ void veng3LookAtDebris();
+ void veng3LookAtTurbolift2Door();
+ void veng3LookAtSickbayDoor();
+ void veng3LookAtCable();
+ void veng3LookAtDeadGuy();
+ void veng3LookAtKirk();
+ void veng3LookAtMccoy();
+ void veng3LookAtSpock();
+ void veng3LookAtRedshirt();
+ void veng3LookAnywhere();
+ void veng3UseStunPhaserOnDebris();
+ void veng3UseKillPhaserOnDebris();
+ void veng3ReachedPositionToShootDebris();
+ void veng3DrewPhaserToShootDebris();
+ void veng3DebrisVaporized();
+ void veng3DebrisFellAgain();
+ void veng3UseSpockOnDebris();
+ void veng3UseRedshirtOnDebris();
+ void veng3UseMccoyOnDebris();
+ void veng3UseBeamOnDebris();
+ void veng3ReachedPositionToPlaceBeam();
+ void veng3PlacedBeam();
+ void veng3UseSTricorderOnDebris();
+ void veng3UseMolecularSawOnDebris();
+ void veng3TalkToKirk();
+ void veng3TalkToSpock();
+ void veng3TalkToMccoy();
+ void veng3TalkToRedshirt();
+ void veng3GetDebris();
+ void veng3GetCable();
+ void veng3ReachedCable();
+ void veng3PickedUpCable();
+ void veng3UseMccoyOnDeadGuy();
// VENG4
void veng4Tick1();
diff --git a/engines/startrek/rooms/veng1.cpp b/engines/startrek/rooms/veng1.cpp
index 994453b..dc39eb5 100644
--- a/engines/startrek/rooms/veng1.cpp
+++ b/engines/startrek/rooms/veng1.cpp
@@ -390,7 +390,7 @@ void Room::veng1TriedToGetDebris() {
}
}
-void Room::veng1UseMccoyOnDeadGuy() {
+void Room::veng1UseMccoyOnDeadGuy() { // NOTE: Identical to function in VENG3
int val = getRandomWordInRange(0, 5);
switch (val) {
diff --git a/engines/startrek/rooms/veng3.cpp b/engines/startrek/rooms/veng3.cpp
index 5c0e3c8..f4a6a95 100644
--- a/engines/startrek/rooms/veng3.cpp
+++ b/engines/startrek/rooms/veng3.cpp
@@ -23,19 +23,361 @@
#include "startrek/room.h"
#define OBJECT_DOOR 8
+#define OBJECT_SICKBAY_DOOR 9
+#define OBJECT_DEBRIS 10
+#define OBJECT_CABLE 11
+#define OBJECT_DEAD_GUY 12
+#define OBJECT_SUPPORT_BEAM 13
-#define HOTSPOT_20 0x20
+#define HOTSPOT_TURBOLIFT_2_DOOR 0x20
+#define HOTSPOT_SICKBAY_DOOR 0x21
namespace StarTrek {
extern const RoomAction veng3ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::veng3Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::veng3Tick1 },
+ { {ACTION_TICK, 15, 0, 0}, &Room::veng3Tick15 },
+ { {ACTION_TOUCHED_WARP, 0, 0, 0}, &Room::veng3TouchedTurbolift2 },
+ { {ACTION_TOUCHED_WARP, 1, 0, 0}, &Room::veng3TouchedTurbolift1 },
+
+ { {ACTION_WALK, OBJECT_DEBRIS, 0, 0}, &Room::veng3WalkToDoor },
+ { {ACTION_WALK, HOTSPOT_TURBOLIFT_2_DOOR, 0, 0}, &Room::veng3WalkToDoor },
+ { {ACTION_DONE_WALK, 2, 0, 0}, &Room::veng3ReachedTurbolift2 },
+ { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::veng3Turbolift2Opened },
+
+ { {ACTION_WALK, OBJECT_SICKBAY_DOOR, 0, 0}, &Room::veng3WalkToSickbayDoor },
+ { {ACTION_WALK, HOTSPOT_SICKBAY_DOOR, 0, 0}, &Room::veng3WalkToSickbayDoor },
+ { {ACTION_DONE_WALK, 9, 0, 0}, &Room::veng3ReachedSickbayDoor },
+ { {ACTION_DONE_ANIM, 10, 0, 0}, &Room::veng3SickbayDoorOpened },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_SUPPORT_BEAM, 0}, &Room::veng3LookAtSupportBeam },
+ { {ACTION_LOOK, OBJECT_SUPPORT_BEAM, 0, 0}, &Room::veng3LookAtSupportBeam },
+
+ { {ACTION_LOOK, OBJECT_DEBRIS, 0, 0}, &Room::veng3LookAtDebris },
+ { {ACTION_LOOK, HOTSPOT_TURBOLIFT_2_DOOR, 0, 0}, &Room::veng3LookAtTurbolift2Door },
+ { {ACTION_LOOK, OBJECT_SICKBAY_DOOR, 0, 0}, &Room::veng3LookAtSickbayDoor },
+ { {ACTION_LOOK, HOTSPOT_SICKBAY_DOOR, 0, 0}, &Room::veng3LookAtSickbayDoor },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_CABLE, 0}, &Room::veng3LookAtCable },
+ { {ACTION_LOOK, OBJECT_CABLE, 0, 0}, &Room::veng3LookAtCable },
+ { {ACTION_LOOK, OBJECT_DEAD_GUY, 0, 0}, &Room::veng3LookAtDeadGuy },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::veng3LookAtKirk },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::veng3LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::veng3LookAtSpock },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::veng3LookAtRedshirt },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::veng3LookAnywhere },
+
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_DEBRIS, 0}, &Room::veng3UseStunPhaserOnDebris },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_DEBRIS, 0}, &Room::veng3UseKillPhaserOnDebris },
+ { {ACTION_DONE_WALK, 4, 0, 0}, &Room::veng3ReachedPositionToShootDebris },
+ { {ACTION_DONE_ANIM, 5, 0, 0}, &Room::veng3DrewPhaserToShootDebris },
+ { {ACTION_DONE_ANIM, 3, 0, 0}, &Room::veng3DebrisVaporized },
+ { {ACTION_DONE_ANIM, 6, 0, 0}, &Room::veng3DebrisFellAgain },
+
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_DEBRIS, 0}, &Room::veng3UseSpockOnDebris },
+ { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_DEBRIS, 0}, &Room::veng3UseRedshirtOnDebris },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_DEBRIS, 0}, &Room::veng3UseMccoyOnDebris },
+ { {ACTION_USE, OBJECT_IBEAM, OBJECT_DEBRIS, 0}, &Room::veng3UseBeamOnDebris },
+ { {ACTION_DONE_WALK, 7, 0, 0}, &Room::veng3ReachedPositionToPlaceBeam },
+ { {ACTION_DONE_ANIM, 8, 0, 0}, &Room::veng3PlacedBeam },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_DEBRIS, 0}, &Room::veng3UseSTricorderOnDebris },
+ { {ACTION_USE, OBJECT_ILMD, OBJECT_DEBRIS, 0}, &Room::veng3UseMolecularSawOnDebris },
+
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::veng3TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::veng3TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::veng3TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::veng3TalkToRedshirt },
+ { {ACTION_GET, OBJECT_DEBRIS, 0, 0}, &Room::veng3GetDebris },
+ { {ACTION_GET, OBJECT_CABLE, 0, 0}, &Room::veng3GetCable },
+ { {ACTION_DONE_WALK, 11, 0, 0}, &Room::veng3ReachedCable },
+ { {ACTION_DONE_ANIM, 12, 0, 0}, &Room::veng3PickedUpCable },
+
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_DEAD_GUY, 0}, &Room::veng3UseMccoyOnDeadGuy },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_DEAD_GUY, 0}, &Room::veng3UseMccoyOnDeadGuy },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_DEAD_GUY, 0}, &Room::veng3UseMccoyOnDeadGuy },
};
extern const int veng3NumActions = ARRAYSIZE(veng3ActionList);
void Room::veng3Tick1() {
+ playVoc("VEN3LOOP");
+
+ if (_awayMission->veng.putSupportBeamInSickbayHallway)
+ loadActorAnim2(OBJECT_SUPPORT_BEAM, "s7r3bm", 0x8c, 0x61);
+
+ loadMapFile("veng3");
+
+ if (!_awayMission->veng.clearedDebris) {
+ loadActorAnim2(OBJECT_DEBRIS, "s7r3d2", 0xa5, 0x68);
+ loadMapFile("veng3b");
+ }
+
+ loadActorAnim2(OBJECT_DEAD_GUY, "s7r3c1", 0xc5, 0x99);
+
+ if (!_awayMission->veng.tookCableFromSickbayHallway)
+ loadActorAnim2(OBJECT_CABLE, "s7r3ca", 0xb7, 0x84);
+
+ loadActorAnim2(OBJECT_SICKBAY_DOOR, "s7r3dc", 0x5d, 0x80);
+}
+
+void Room::veng3Tick15() {
+ if (_awayMission->veng.kirkSuggestedReestablishingPower && !_awayMission->veng.impulseEnginesOn) {
+ showText(TX_SPEAKER_KIRK, TX_VEN0_010);
+ _awayMission->veng.kirkSuggestedReestablishingPower = true;
+ }
+}
+
+void Room::veng3TouchedTurbolift2() {
+ playSoundEffectIndex(SND_DOOR1);
+ showRepublicMap(3, 1);
+}
+
+void Room::veng3TouchedTurbolift1() {
+ playSoundEffectIndex(SND_DOOR1);
+ showRepublicMap(3, 0);
+}
+
+void Room::veng3WalkToDoor() {
+ if (_awayMission->veng.clearedDebris)
+ walkCrewmanC(OBJECT_KIRK, 0xa6, 0x6e, &Room::veng3ReachedTurbolift2);
+ else
+ showText(TX_VEN3N006);
+}
+
+void Room::veng3ReachedTurbolift2() {
+ _awayMission->disableInput = true;
+ loadActorAnimC(OBJECT_DOOR, "s7r3db", 0xa6, 0x60, &Room::veng3Turbolift2Opened);
+ playSoundEffectIndex(SND_DOOR1);
+}
+
+void Room::veng3Turbolift2Opened() {
+ walkCrewman(OBJECT_KIRK, 0xa6, 0x61);
+}
+
+void Room::veng3WalkToSickbayDoor() {
+ walkCrewmanC(OBJECT_KIRK, 0x68, 0x83, &Room::veng3ReachedSickbayDoor);
+}
+
+void Room::veng3ReachedSickbayDoor() {
+ _awayMission->disableInput = true;
+ loadActorAnimC(OBJECT_SICKBAY_DOOR, "s7r3da", 0x5b, 0x80, &Room::veng3SickbayDoorOpened);
+ playSoundEffectIndex(SND_DOOR1);
+}
+
+void Room::veng3SickbayDoorOpened() {
+ walkCrewman(OBJECT_KIRK, 0x5e, 0x83);
+}
+
+void Room::veng3LookAtSupportBeam() {
+ showText(TX_VEN3N007);
+}
+
+void Room::veng3LookAtDebris() {
+ if (!_awayMission->veng.clearedDebris)
+ showText(TX_VEN3N009);
+ else
+ showText(TX_VEN3N007); // UNUSED (debris is gone)
+}
+
+void Room::veng3LookAtTurbolift2Door() {
+ showText(TX_VEN3N012);
+
+ if (!_awayMission->veng.lookedAtTurbolift2Door) {
+ _awayMission->veng.lookedAtTurbolift2Door = true;
+ if (!_awayMission->veng.clearedDebris) {
+ showText(TX_SPEAKER_SPOCK, TX_VEN3_013);
+ showText(TX_SPEAKER_MCCOY, TX_VEN3_006);
+ }
+ }
+}
+
+void Room::veng3LookAtSickbayDoor() {
+ showText(TX_VEN3N011);
+}
+
+void Room::veng3LookAtCable() {
+ showText(TX_VEN3N013);
+}
+
+void Room::veng3LookAtDeadGuy() {
+ showText(TX_VEN3N005);
+}
+
+void Room::veng3LookAtKirk() {
+ showText(TX_VEN3N001);
+}
+
+void Room::veng3LookAtMccoy() {
+ showText(TX_VEN3N002);
+}
+
+void Room::veng3LookAtSpock() {
+ showText(TX_VEN3N004);
+}
+
+void Room::veng3LookAtRedshirt() {
+ showText(TX_VEN3N000);
+}
+
+void Room::veng3LookAnywhere() {
+ showText(TX_VEN3N003);
+}
+
+void Room::veng3UseStunPhaserOnDebris() {
+ showText(TX_SPEAKER_SPOCK, TX_VEN3_002);
+}
+
+void Room::veng3UseKillPhaserOnDebris() {
+ if (!_awayMission->veng.clearedDebris) {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x96, 0xa8, &Room::veng3ReachedPositionToShootDebris);
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N; // ENHANCEMENT
+ }
+}
+
+void Room::veng3ReachedPositionToShootDebris() {
+ loadActorAnimC(OBJECT_KIRK, "kfiren", -1, -1, &Room::veng3DrewPhaserToShootDebris);
+}
+
+void Room::veng3DrewPhaserToShootDebris() {
+ loadActorAnimC(OBJECT_DEBRIS, "s7r3ph", 0x9c, 0x83, &Room::veng3DebrisVaporized);
+ playSoundEffectIndex(SND_PHASSHOT);
+}
+
+void Room::veng3DebrisVaporized() {
+ if (!_awayMission->veng.putSupportBeamInSickbayHallway) {
+ playVoc("MUR1E4");
+ loadActorAnimC(OBJECT_DEBRIS, "s7r3df", 0xa6, 0x60, &Room::veng3DebrisFellAgain);
+ loadActorStandAnim(OBJECT_KIRK);
+ } else {
+ _awayMission->disableInput = false;
+ loadMapFile("veng3");
+ showText(TX_SPEAKER_SPOCK, TX_VEN3_015);
+ _awayMission->veng.clearedDebris = true;
+ }
+}
+
+void Room::veng3DebrisFellAgain() {
+ loadActorAnim2(OBJECT_DEBRIS, "s7r3d2", 0xa5, 0x68);
+ _awayMission->disableInput = false;
+ showText(TX_SPEAKER_SPOCK, TX_VEN3_014);
+}
+
+void Room::veng3UseSpockOnDebris() {
+ if (!_awayMission->veng.putSupportBeamInSickbayHallway)
+ showText(TX_SPEAKER_SPOCK, TX_VEN3_008);
+ else {
+ showText(TX_SPEAKER_SPOCK, TX_VEN3_011);
+ // BUGFIX: Game would crash here due to jumping to non-code.
+ }
+}
+
+void Room::veng3UseRedshirtOnDebris() {
+ if (!_awayMission->veng.putSupportBeamInSickbayHallway)
+ showText(TX_SPEAKER_KIJE, TX_VEN3_017);
+ else {
+ // BUGFIX: Original had a "jne" opcode with no comparison beforehand, causing it
+ // to jump to some of Spock's code (TX_VEN3_007)? In any case, this makes more sense.
+ showText(TX_SPEAKER_KIJE, TX_VEN3_016);
+ }
+}
+
+void Room::veng3UseMccoyOnDebris() {
+ showText(TX_SPEAKER_MCCOY, TX_VEN3_004);
+}
+
+void Room::veng3UseBeamOnDebris() {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x94, 0x6d, &Room::veng3ReachedPositionToPlaceBeam);
+}
+
+void Room::veng3ReachedPositionToPlaceBeam() {
+ loadActorAnimC(OBJECT_KIRK, "kusemn", -1, -1, &Room::veng3PlacedBeam);
+ playVoc("MUR3E1S");
+}
+
+void Room::veng3PlacedBeam() {
+ loadActorAnim2(OBJECT_SUPPORT_BEAM, "s7r3bm", 0x8c, 0x61);
+ _awayMission->disableInput = false;
+ _awayMission->veng.putSupportBeamInSickbayHallway = true;
+ loseItem(OBJECT_IBEAM);
+}
+
+void Room::veng3UseSTricorderOnDebris() {
+ if (!_awayMission->veng.putSupportBeamInSickbayHallway)
+ spockScan(DIR_N, TX_VEN3_009);
+ else
+ spockScan(DIR_N, TX_VEN3_007);
+}
+
+void Room::veng3UseMolecularSawOnDebris() {
+ showText(TX_SPEAKER_SPOCK, TX_VEN3_010);
+}
+
+void Room::veng3TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_VEN3_001);
+}
+
+void Room::veng3TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_VEN3_012);
+}
+
+void Room::veng3TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_VEN3_003);
+}
+
+void Room::veng3TalkToRedshirt() {
+ showText(TX_SPEAKER_KIJE, TX_VEN3_018);
+ showText(TX_SPEAKER_MCCOY, TX_VEN3_005);
+}
+
+void Room::veng3GetDebris() {
+ showText(TX_VEN3N010);
+}
+
+void Room::veng3GetCable() {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0xb7, 0x85, &Room::veng3ReachedCable);
+}
+
+void Room::veng3ReachedCable() {
+ loadActorAnimC(OBJECT_KIRK, "kusehn", -1, -1, &Room::veng3PickedUpCable);
+ playVoc("MUR4E6");
+}
+
+void Room::veng3PickedUpCable() {
+ _awayMission->disableInput = false;
+ loadActorStandAnim(OBJECT_CABLE);
+ showText(TX_VEN3N014);
+ giveItem(OBJECT_ICABLE2);
+ _awayMission->veng.tookCableFromSickbayHallway = true;
+}
+
+void Room::veng3UseMccoyOnDeadGuy() { // NOTE: Identical to function in VENG1
+ int val = getRandomWordInRange(0, 5);
+
+ switch (val) {
+ case 0:
+ // NOTE: The exact text differs from the text used in DEM3. But, in order for this
+ // text indexing scheme to work, two rooms can't use the same audio with different
+ // text. Original was "He's dead, jim." instead of "He's dead, Jim...".
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_019);
+ break;
+
+ case 1:
+ showText(TX_SPEAKER_MCCOY, TX_VEN4_016);
+ break;
+
+ case 2:
+ case 3:
+ showText(TX_SPEAKER_MCCOY, TX_G_014);
+ break;
+
+ case 4:
+ case 5:
+ showText(TX_SPEAKER_MCCOY, TX_VEN0_016);
+ break;
+ }
}
}
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index c5f2e47..e782270 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -2945,6 +2945,40 @@ extern const char *const g_gameStrings[] = {
"cancel",
+ "#VEN3\\VEN3_001#I wish I were a poet. I wish I had the words to match how this makes me feel. These people were Starfleet officers, giving their lives to explore the cosmos. I wish I knew some eulogy that did them justice.",
+ "#VEN3\\VEN3_002#Captain, using the stun setting is most illogical.",
+ "#VEN3\\VEN3_003#Damn this tricorder. Why couldn't one of them be alive?",
+ "#VEN3\\VEN3_004#I'm a doctor, not a coal miner.",
+ "#VEN3\\VEN3_005#A poor choice of words, Ensign.",
+ "#VEN3\\VEN3_006#I thought you were a science officer, not a tour guide.",
+ "#VEN3\\VEN3_007#The beam is supporting the ceiling, Captain.",
+ "#VEN3\\VEN3_008#The debris appears quite unstable. Any disturbances may trigger an avalanche of debris to fall.",
+ "#VEN3\\VEN3_009#The debris is highly unstable, Captain. I recommend we try to find a support of some kind to secure the ceiling.",
+ "#VEN3\\VEN3_010#The molecular saw is too fine of a cutting tool to be of any use in clearing the debris.",
+ "#VEN3\\VEN3_011#There is too much debris to remove by hand.",
+ "#VEN3\\VEN3_012#Turbolift ahead, Captain.",
+ "#VEN3\\VEN3_013#Captain, it is critical that we gain access to this turbolift. It is our only means of exploring the rest of this ship.",
+ "#VEN3\\VEN3_014#Captain, the support beam for the ceiling is damaged here. There will be no way to safely clear out the debris without a replacement.",
+ "#VEN3\\VEN3_015#The ceiling appears stable. We should now be able to use Turbolift 2, Captain.",
+ "#VEN3\\VEN3_016#It will take us forever to dig through all that, sir.",
+ "#VEN3\\VEN3_017#Sir, I really don't think we should try and mess with that debris. We may bring the whole thing down on us.",
+ "#VEN3\\VEN3_018#Be careful, Captain. This ship is a death trap.",
+ "#VEN3\\VEN3N000#Kije struggles with emotions he never knew he had.",
+ "#VEN3\\VEN3N001#Kirk is increasingly distressed by what he has seen.",
+ "#VEN3\\VEN3N002#McCoy examines his tricorder, knowing that his hopes are not going to be fulfilled.",
+ "#VEN3\\VEN3N003#One of the many battered corridors of the U.S.S. Republic. It has seen better days. Much better days.",
+ "#VEN3\\VEN3N004#Spock says nothing, but this tragedy stirs something in his Vulcan soul.",
+ "#VEN3\\VEN3N005#The crewman's death was pointless. Just like too many deaths in human history.",
+ "#VEN3\\VEN3N006#The debris is blocking the Turbolift doors.",
+ "#VEN3\\VEN3N007#The support beam appears to have stabilized the ceiling.",
+ "#VEN3\\VEN3N009#There is a twisted mess of wire and metal falling from the gaping hole in the ceiling. It is blocking access to turbolift 2.",
+ "#VEN3\\VEN3N010#There is far too much debris to be cleared by hand.",
+ "#VEN3\\VEN3N011#This door leads to Sickbay.",
+ "#VEN3\\VEN3N012#This door leads to TurboLift 2.",
+ "#VEN3\\VEN3N013#This is a length of heavy duty insulated power cable.",
+ "#VEN3\\VEN3N014#You have taken the cable.",
+
+
"#VEN4\\VEN4_016#There's nothing more I can do.", // TYPO
"#VEN4\\VEN4_017#I believe nothing needs to be said, Captain.",
"#VEN4\\VEN4N010#This is an empty hypodermic injector.",
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 0b26bd0..634d000 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -3065,6 +3065,41 @@ enum GameStringIDs {
TX_VEN2_CANCEL,
+ TX_VEN3_001,
+ TX_VEN3_002,
+ TX_VEN3_003,
+ TX_VEN3_004,
+ TX_VEN3_005,
+ TX_VEN3_006,
+ TX_VEN3_007,
+ TX_VEN3_008,
+ TX_VEN3_009,
+ TX_VEN3_010,
+ TX_VEN3_011,
+ TX_VEN3_012,
+ TX_VEN3_013,
+ TX_VEN3_014,
+ TX_VEN3_015,
+ TX_VEN3_016,
+ TX_VEN3_017,
+ TX_VEN3_018,
+ TX_VEN3N000,
+ TX_VEN3N001,
+ TX_VEN3N002,
+ TX_VEN3N003,
+ TX_VEN3N004,
+ TX_VEN3N005,
+ TX_VEN3N006,
+ TX_VEN3N007,
+ // UNUSED
+ TX_VEN3N009,
+ TX_VEN3N010,
+ TX_VEN3N011,
+ TX_VEN3N012,
+ TX_VEN3N013,
+ TX_VEN3N014,
+
+
TX_VEN4_016,
TX_VEN4_017,
TX_VEN4N010,
Commit: 1a12a25b54b2c19225b44892db972707a413c31c
https://github.com/scummvm/scummvm/commit/1a12a25b54b2c19225b44892db972707a413c31c
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: VENG4
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/veng2.cpp
engines/startrek/rooms/veng3.cpp
engines/startrek/rooms/veng4.cpp
engines/startrek/text.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 835a2b7..abfa00f 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -620,6 +620,10 @@ struct AwayMission {
} sins;
struct {
+ bool usedMedkitOnBrittany; // 0x29
+ bool talkedToBrittany; // 0x2a
+ bool brittanyDead; // 0x2b
+ bool lookedAtBrittany; // 0x2c
bool enteredRoom0FirstTime; // 0x2d
int16 missionScore; // 0x2e
bool bridgeCrewmanDead; // 0x30
@@ -668,14 +672,16 @@ struct AwayMission {
bool putSupportBeamInSickbayHallway; // 0x53
bool clearedDebris; // 0x54
bool lookedAtTurbolift2Door; // 0x55
- bool kirkSuggestedReestablishingPower; // 0x56
+ bool kirkShouldSuggestReestablishingPower; // 0x56
+ bool tookHypoFromSickbay; // 0x57
+ bool tookDrillFromSickbay; // 0x58
bool havePowerPack; // 0x5a
bool tookCableFromSickbayHallway; // 0x5f
bool tookMolecularSaw; // 0x60
bool readEngineeringJournal; // 0x61
bool examinedTorpedoControl; // 0x66
bool field68; // 0x68
- bool field69; // 0x69
+ bool getPointsForHealingBrittany; // 0x69
bool readAllLogs; // 0x6a
bool field6b; // 0x6b
bool field6c; // 0x6c
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 78fbe2b..0f85f72 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2638,9 +2638,46 @@ public:
void veng3ReachedCable();
void veng3PickedUpCable();
void veng3UseMccoyOnDeadGuy();
+ // TODO: Common code
// VENG4
void veng4Tick1();
+ void veng4TalkToKirk();
+ void veng4TalkToMccoy();
+ void veng4TalkToSpock();
+ void veng4TalkToRedshirt();
+ void veng4UseMccoyOnDeadGuy();
+ void veng4UseHypoOnBrittany();
+ void veng4UseMedkitOnBrittany();
+ void veng4UseMTricorderOnBrittany();
+ void veng4UseMccoyOnBrittany();
+ void veng4MccoyReachedBrittany();
+ void veng4UsedMedkitOnBrittany();
+ void veng4MccoyScannedBrittany();
+ void veng4TalkToBrittany();
+ void veng4LookAtDeadGuy();
+ void veng4LookAtRightBedReadings();
+ void veng4LookAtDoorHotspot();
+ void veng4LookAtKirk();
+ void veng4LookAtSpock();
+ void veng4LookAtMccoy();
+ void veng4LookAtRedshirt();
+ void veng4LookAtLeftBed();
+ void veng4LookAtLeftBedReadings();
+ void veng4LookAtBrittany();
+ void veng4LookAtDrill();
+ void veng4LookAtHypo();
+ void veng4LookAtDoorObject();
+ void veng4LookAnywhere();
+ void veng4GetHypo();
+ void veng4ReachedHypo();
+ void veng4PickedUpHypo();
+ void veng4GetDrill();
+ void veng4ReachedDrill();
+ void veng4PickedUpDrill();
+ void veng4TouchedHotspot0();
+ void veng4WalkToDoor();
+ // TODO: common code
// VENG5
void veng5Tick1();
@@ -2970,10 +3007,15 @@ public:
struct {
// veng1
byte doorOpenCounter; // 0xca
- bool walkingToDoor; // 0xcb
// veng2
byte numCrewmenReadyToBeamOut; // 0xca
+
+ // veng4
+ bool usingMedkitOnBrittany;
+
+ // venga (common)
+ bool walkingToDoor; // 0xcb (veng1), 0xca (veng4)
} veng;
} _roomVar;
diff --git a/engines/startrek/rooms/veng2.cpp b/engines/startrek/rooms/veng2.cpp
index d473e58..c00c346 100644
--- a/engines/startrek/rooms/veng2.cpp
+++ b/engines/startrek/rooms/veng2.cpp
@@ -599,7 +599,7 @@ void Room::veng2CrewmanInPositionToBeamOut() {
_awayMission->veng.missionScore = 16;
if (_awayMission->veng.field68)
_awayMission->veng.missionScore += 1;
- if (_awayMission->veng.field69)
+ if (_awayMission->veng.getPointsForHealingBrittany)
_awayMission->veng.missionScore += 1;
if (_awayMission->veng.readAllLogs)
_awayMission->veng.missionScore += 1;
diff --git a/engines/startrek/rooms/veng3.cpp b/engines/startrek/rooms/veng3.cpp
index f4a6a95..649288b 100644
--- a/engines/startrek/rooms/veng3.cpp
+++ b/engines/startrek/rooms/veng3.cpp
@@ -121,9 +121,9 @@ void Room::veng3Tick1() {
}
void Room::veng3Tick15() {
- if (_awayMission->veng.kirkSuggestedReestablishingPower && !_awayMission->veng.impulseEnginesOn) {
+ if (_awayMission->veng.kirkShouldSuggestReestablishingPower && !_awayMission->veng.impulseEnginesOn) {
showText(TX_SPEAKER_KIRK, TX_VEN0_010);
- _awayMission->veng.kirkSuggestedReestablishingPower = true;
+ _awayMission->veng.kirkShouldSuggestReestablishingPower = false;
}
}
diff --git a/engines/startrek/rooms/veng4.cpp b/engines/startrek/rooms/veng4.cpp
index 836fcce..2c3f8f2 100644
--- a/engines/startrek/rooms/veng4.cpp
+++ b/engines/startrek/rooms/veng4.cpp
@@ -22,20 +22,331 @@
#include "startrek/room.h"
-#define OBJECT_DOOR 8
+#define OBJECT_BRITTANY 8
+#define OBJECT_DOOR 9
+#define OBJECT_HYPO 10
+#define OBJECT_DRILL 11
+#define OBJECT_LEFT_READINGS 12
-#define HOTSPOT_20 0x20
+#define HOTSPOT_DOOR 0x20
+#define HOTSPOT_LEFT_BED 0x21
+#define HOTSPOT_RIGHT_BED 0x22
+#define HOTSPOT_LEFT_READINGS 0x23
+#define HOTSPOT_RIGHT_READINGS 0x24
namespace StarTrek {
extern const RoomAction veng4ActionList[] = {
{ {ACTION_TICK, 1, 0, 0}, &Room::veng4Tick1 },
+
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::veng4TalkToKirk },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::veng4TalkToMccoy },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::veng4TalkToSpock },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::veng4TalkToRedshirt },
+
+ { {ACTION_USE, OBJECT_IMEDKIT, HOTSPOT_RIGHT_BED, 0}, &Room::veng4UseMccoyOnDeadGuy },
+ { {ACTION_USE, OBJECT_IMTRICOR, HOTSPOT_RIGHT_BED, 0}, &Room::veng4UseMccoyOnDeadGuy },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_RIGHT_BED, 0}, &Room::veng4UseMccoyOnDeadGuy },
+
+ { {ACTION_USE, OBJECT_IHYPO, OBJECT_BRITTANY, 0}, &Room::veng4UseHypoOnBrittany },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_BRITTANY, 0}, &Room::veng4UseMedkitOnBrittany },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_BRITTANY, 0}, &Room::veng4UseMTricorderOnBrittany },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_BRITTANY, 0}, &Room::veng4UseMTricorderOnBrittany },
+ { {ACTION_DONE_WALK, 5, 0, 0}, &Room::veng4MccoyReachedBrittany },
+ { {ACTION_DONE_ANIM, 6, 0, 0}, &Room::veng4UsedMedkitOnBrittany },
+ { {ACTION_DONE_ANIM, 7, 0, 0}, &Room::veng4MccoyScannedBrittany },
+
+ { {ACTION_TALK, OBJECT_BRITTANY, 0, 0}, &Room::veng4TalkToBrittany },
+ { {ACTION_LOOK, HOTSPOT_RIGHT_BED, 0, 0}, &Room::veng4LookAtDeadGuy },
+ { {ACTION_LOOK, HOTSPOT_RIGHT_READINGS, 0, 0}, &Room::veng4LookAtRightBedReadings },
+ { {ACTION_LOOK, HOTSPOT_DOOR, 0, 0}, &Room::veng4LookAtDoorHotspot },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::veng4LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::veng4LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::veng4LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::veng4LookAtRedshirt },
+ { {ACTION_LOOK, HOTSPOT_LEFT_BED, 0, 0}, &Room::veng4LookAtLeftBed },
+ { {ACTION_LOOK, HOTSPOT_LEFT_READINGS, 0, 0}, &Room::veng4LookAtLeftBedReadings },
+ { {ACTION_LOOK, OBJECT_BRITTANY, 0, 0}, &Room::veng4LookAtBrittany },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_DRILL, 0}, &Room::veng4LookAtDrill },
+ { {ACTION_LOOK, OBJECT_DRILL, 0, 0}, &Room::veng4LookAtDrill },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_HYPO, 0}, &Room::veng4LookAtHypo },
+ { {ACTION_LOOK, OBJECT_HYPO, 0, 0}, &Room::veng4LookAtHypo },
+ { {ACTION_LOOK, OBJECT_DOOR, 0, 0}, &Room::veng4LookAtDoorObject },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::veng4LookAnywhere },
+
+ { {ACTION_GET, OBJECT_HYPO, 0, 0}, &Room::veng4GetHypo },
+ { {ACTION_DONE_WALK, 1, 0, 0}, &Room::veng4ReachedHypo },
+ { {ACTION_DONE_ANIM, 2, 0, 0}, &Room::veng4PickedUpHypo },
+
+ { {ACTION_GET, OBJECT_DRILL, 0, 0}, &Room::veng4GetDrill },
+ { {ACTION_DONE_WALK, 3, 0, 0}, &Room::veng4ReachedDrill },
+ { {ACTION_DONE_ANIM, 4, 0, 0}, &Room::veng4PickedUpDrill },
+
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::veng4TouchedHotspot0 },
+ { {ACTION_WALK, OBJECT_DOOR, 0, 0}, &Room::veng4WalkToDoor },
+ { {ACTION_WALK, HOTSPOT_DOOR, 0, 0}, &Room::veng4WalkToDoor },
+
+ // ENHANCEMENT (let object count for the "look" action, not just the hotspot)
+ { {ACTION_LOOK, OBJECT_LEFT_READINGS, 0, 0}, &Room::veng4LookAtLeftBedReadings },
};
extern const int veng4NumActions = ARRAYSIZE(veng4ActionList);
+#define DOOR_X 0x13f
+#define DOOR_Y 0xab
+
+#define BRITTANY_X 0x5a
+#define BRITTANY_Y 0xa5
+
+#define LEFT_READINGS_X 0x5c
+#define LEFT_READINGS_Y 0x75
+
void Room::veng4Tick1() {
+ playMidiMusicTracks(MIDITRACK_31);
+
+ loadActorAnim2(OBJECT_DOOR, "s9r1dc", DOOR_X, DOOR_Y);
+ loadActorAnim2(OBJECT_LEFT_READINGS, "s7r4m2", LEFT_READINGS_X, LEFT_READINGS_Y);
+
+ if (!_awayMission->veng.usedMedkitOnBrittany) {
+ loadActorAnim2(OBJECT_BRITTANY, "s9r1bm", BRITTANY_X, BRITTANY_Y);
+ playVoc("VEN4LOOP");
+ } else {
+ playVoc("VE42LOOP");
+ loadActorAnim2(OBJECT_BRITTANY, "s9r1bh", BRITTANY_X, BRITTANY_Y);
+ }
+
+ if (!_awayMission->veng.tookHypoFromSickbay)
+ loadActorAnim2(OBJECT_HYPO, "s7r4h1", 0xea, 0x8b);
+ if (!_awayMission->veng.tookDrillFromSickbay)
+ loadActorAnim2(OBJECT_DRILL, "s7r4dl", 0xea, 0x87);
+
+ if (_awayMission->veng.brittanyDead) {
+ loadActorAnim2(OBJECT_BRITTANY, "s7r4bd", BRITTANY_X, BRITTANY_Y);
+ loadActorAnim2(OBJECT_LEFT_READINGS, "s7r4m1d", LEFT_READINGS_X, LEFT_READINGS_Y);
+ }
+}
+
+void Room::veng4TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_VEN4_002);
+}
+
+void Room::veng4TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_VEN4_015);
+}
+
+void Room::veng4TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_VEN4_017);
+}
+
+void Room::veng4TalkToRedshirt() {
+ showText(TX_SPEAKER_KIJE, TX_VEN4_022);
+}
+
+void Room::veng4UseMccoyOnDeadGuy() {
+ showText(TX_SPEAKER_MCCOY, TX_VEN4_007);
+}
+
+void Room::veng4UseHypoOnBrittany() {
+ showText(TX_SPEAKER_MCCOY, TX_VEN4_008);
+}
+
+void Room::veng4UseMedkitOnBrittany() {
+ _roomVar.veng.usingMedkitOnBrittany = true;
+ veng4UseMccoyOnBrittany();
+}
+
+void Room::veng4UseMTricorderOnBrittany() {
+ _roomVar.veng.usingMedkitOnBrittany = false;
+ veng4UseMccoyOnBrittany();
+}
+
+void Room::veng4UseMccoyOnBrittany() {
+ if (_awayMission->veng.brittanyDead)
+ showText(TX_SPEAKER_MCCOY, TX_VEN4_013);
+ else if (_awayMission->veng.usedMedkitOnBrittany)
+ showText(TX_SPEAKER_MCCOY, TX_VEN4_009);
+ else {
+ if (!_awayMission->veng.lookedAtBrittany) {
+ _awayMission->veng.lookedAtBrittany = true;
+ showText(TX_SPEAKER_KIRK, TX_VEN4_005);
+ }
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
+ walkCrewmanC(OBJECT_MCCOY, 0x3c, 0xa0, &Room::veng4MccoyReachedBrittany);
+ }
+}
+
+void Room::veng4MccoyReachedBrittany() {
+ if (!_roomVar.veng.usingMedkitOnBrittany) {
+ loadActorAnimC(OBJECT_MCCOY, "mscane", -1, -1, &Room::veng4MccoyScannedBrittany);
+ playSoundEffectIndex(SND_TRICORDER);
+ } else {
+ loadActorAnimC(OBJECT_MCCOY, "museme", -1, -1, &Room::veng4UsedMedkitOnBrittany);
+ }
+}
+
+void Room::veng4UsedMedkitOnBrittany() {
+ loadActorAnim2(OBJECT_BRITTANY, "s9r1bh");
+ _awayMission->veng.getPointsForHealingBrittany = true;
+ _awayMission->veng.usedMedkitOnBrittany = true;
+ _awayMission->veng.kirkShouldSuggestReestablishingPower = true;
+ showText(TX_SPEAKER_MCCOY, TX_VEN4_009);
+}
+
+void Room::veng4MccoyScannedBrittany() {
+ showText(TX_SPEAKER_MCCOY, TX_VEN4_011);
+ showText(TX_SPEAKER_KIRK, TX_VEN4_001);
+
+ _roomVar.veng.usingMedkitOnBrittany = true;
+ veng4UseMccoyOnBrittany();
+}
+
+void Room::veng4TalkToBrittany() {
+ if (_awayMission->veng.talkedToBrittany)
+ showText(TX_SPEAKER_MCCOY, TX_VEN4_012);
+ else if (!_awayMission->veng.usedMedkitOnBrittany)
+ showText(TX_SPEAKER_MCCOY, TX_VEN4_010);
+ else {
+ _awayMission->veng.talkedToBrittany = true;
+ showText(TX_SPEAKER_BRITTANY_MARATA, TX_VEN4_019);
+ showText(TX_SPEAKER_KIRK, TX_VEN4_004);
+ showText(TX_SPEAKER_BRITTANY_MARATA, TX_VEN4_020);
+ showText(TX_SPEAKER_KIRK, TX_VEN4_006);
+ showText(TX_SPEAKER_BRITTANY_MARATA, TX_VEN4_021);
+ showText(TX_SPEAKER_KIRK, TX_VEN4_003);
+
+ loadActorAnim2(OBJECT_BRITTANY, "s9r1bm", BRITTANY_X, BRITTANY_Y);
+ showText(TX_SPEAKER_MCCOY, TX_VEN4_016);
+ loadActorAnim2(OBJECT_LEFT_READINGS, "s7r4m1", LEFT_READINGS_X, LEFT_READINGS_Y);
+ loadActorAnim2(OBJECT_BRITTANY, "s7r4bd", BRITTANY_X, BRITTANY_Y);
+ _awayMission->veng.brittanyDead = true;
+ stopAllVocSounds();
+ playVoc("VE42LOOP");
+ }
+}
+
+void Room::veng4LookAtDeadGuy() {
+ showText(TX_VEN4N014);
+}
+
+void Room::veng4LookAtRightBedReadings() {
+ showText(TX_VEN4N013);
+}
+
+void Room::veng4LookAtDoorHotspot() {
+ showText(TX_VEN4N008);
+}
+
+void Room::veng4LookAtKirk() {
+ showText(TX_VEN4N002);
+}
+
+void Room::veng4LookAtSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_VEN4N003);
+}
+
+void Room::veng4LookAtMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_VEN4N000);
+}
+
+void Room::veng4LookAtRedshirt() {
+ showText(TX_SPEAKER_KIJE, TX_VEN4N001);
+}
+
+void Room::veng4LookAtLeftBed() {
+ if (_awayMission->veng.brittanyDead) {
+ // ENHANCEMENT: Original game showed a string with no corresponding audio ("This
+ // bed contains the body of a recently deceaced crewman." Yes that's a typo.)
+ // Instead, show some appropriate voiced text.
+ showText(TX_VEN4N017);
+ } else
+ showText(TX_VEN4N007);
+}
+
+void Room::veng4LookAtLeftBedReadings() {
+ if (!_awayMission->veng.brittanyDead)
+ showText(TX_VEN4N006);
+ else
+ showText(TX_VEN4N005);
+}
+
+void Room::veng4LookAtBrittany() {
+ if (_awayMission->veng.brittanyDead)
+ showText(TX_VEN4N017);
+ else if (!_awayMission->veng.lookedAtBrittany) {
+ _awayMission->veng.lookedAtBrittany = true;
+ showText(TX_SPEAKER_KIRK, TX_VEN4_005);
+ showText(TX_SPEAKER_MCCOY, TX_VEN4_014);
+ } else if (_awayMission->veng.talkedToBrittany)
+ showText(TX_VEN4N017);
+ else
+ showText(TX_VEN4N004);
+}
+
+void Room::veng4LookAtDrill() {
+ showText(TX_VEN4N012);
+}
+
+void Room::veng4LookAtHypo() {
+ showText(TX_VEN4N010);
+}
+
+void Room::veng4LookAtDoorObject() {
+ showText(TX_VEN4N009);
+}
+
+void Room::veng4LookAnywhere() {
+ showText(TX_VEN4N011);
+}
+
+void Room::veng4GetHypo() {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0xea, 0xae, &Room::veng4ReachedHypo);
+}
+
+void Room::veng4ReachedHypo() {
+ loadActorAnimC(OBJECT_KIRK, "kusemn", -1, -1, &Room::veng4PickedUpHypo);
+}
+
+void Room::veng4PickedUpHypo() {
+ giveItem(OBJECT_IHYPO);
+ _awayMission->veng.tookHypoFromSickbay = true;
+ loadActorStandAnim(OBJECT_HYPO);
+ showText(TX_VEN4N015);
+ walkCrewman(OBJECT_KIRK, 0xcd, 0xc2);
+ _awayMission->disableInput = false;
+}
+
+void Room::veng4GetDrill() {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0xea, 0xae, &Room::veng4ReachedDrill);
+}
+
+void Room::veng4ReachedDrill() {
+ loadActorAnimC(OBJECT_KIRK, "kusemn", -1, -1, &Room::veng4PickedUpDrill);
+}
+
+void Room::veng4PickedUpDrill() {
+ giveItem(OBJECT_IDRILL);
+ _awayMission->veng.tookDrillFromSickbay = true;
+ loadActorStandAnim(OBJECT_DRILL);
+ showText(TX_VEN4N016);
+ walkCrewman(OBJECT_KIRK, 0xcd, 0xc2);
+ _awayMission->disableInput = false;
+}
+
+void Room::veng4TouchedHotspot0() { // Trigger door opening
+ if (_roomVar.veng.walkingToDoor) {
+ playSoundEffectIndex(SND_DOOR1);
+ loadActorAnim(OBJECT_DOOR, "s9r1do", DOOR_X, DOOR_Y);
+ }
+}
+
+void Room::veng4WalkToDoor() {
+ _roomVar.veng.walkingToDoor = true;
+ _awayMission->disableInput = true;
+ walkCrewman(OBJECT_KIRK, 0x12e, 0xab);
}
}
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index e782270..4ad34ee 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -69,6 +69,7 @@ extern const char *const g_gameStrings[] = {
"Elasi Captain",
"Elasi Weapons Master",
"Elasi Crewman",
+ "Brittany Marata",
"#BRID\\BRIDU146#Nothing to report, Captain.",
@@ -2979,10 +2980,48 @@ extern const char *const g_gameStrings[] = {
"#VEN3\\VEN3N014#You have taken the cable.",
- "#VEN4\\VEN4_016#There's nothing more I can do.", // TYPO
+ "#VEN4\\VEN4_001#Do what you can, Bones. I need to find out what happened here.",
+ "#VEN4\\VEN4_002#You always hope the instruments are wrong...that you'll find someone alive.",
+ "#VEN4\\VEN4_003#It wasn't the Enterprise, Marata!",
+ "#VEN4\\VEN4_004#Marata, what happened?",
+ "#VEN4\\VEN4_005#I can't believe it. That's Brittany Marata. I knew her from my Academy days. We studied alien history together.",
+ "#VEN4\\VEN4_006#What about the Enterprise?",
+ "#VEN4\\VEN4_007#He's dead, Jim. I can't bring him back.",
+ "#VEN4\\VEN4_008#That will accomplish nothing, Jim.",
+ "#VEN4\\VEN4_009#She's in bad shape, Jim. I've tried to stabilize her, but it doesn't look good.",
+ "#VEN4\\VEN4_010#She's in no condition to talk right now.",
+ "#VEN4\\VEN4_011#She's suffering from severe trauma and internal bleeding. I'll see what I can do.",
+ "#VEN4\\VEN4_012#That won't bring her back. She's gone.",
+ "#VEN4\\VEN4_013#There's nothing more I can do for her, Jim.",
+ "#VEN4\\VEN4_014#At least she's still alive, although just barely.",
+ "#VEN4\\VEN4_015#Life support must have gone down during the fight. Most of the people died from shock before the back-up systems came on line.",
+ "#VEN4\\VEN4_016#There's nothing more I can do.", // TYPO (in some rooms, this has "Jim..." at the start of the text, though not in VENG4 itself)
"#VEN4\\VEN4_017#I believe nothing needs to be said, Captain.",
+ "#VEN4\\VEN4_018#An interesting hypothesis, doctor. Had Mr. Scott been present, he might have been able to verify it.",
+ "#VEN4\\VEN4_019#No... you won't get us...",
+ "#VEN4\\VEN4_020#They said it was the Enterprise...They had visual confirmation...",
+ "#VEN4\\VEN4_021#You killed us, Jim. We were friends for... I trusted ...",
+ "#VEN4\\VEN4_022#Captain, did I ever mention how much I hate hospitals?",
+ "#VEN4\\VEN4N000#A very concerned Doctor Leonard McCoy.",
+ "#VEN4\\VEN4N001#A very unhappy looking Ensign Kije.",
+ "#VEN4\\VEN4N002#James T. Kirk, in total confusion at the moment.",
+ "#VEN4\\VEN4N003#Mr. Spock, looking pensive as usual.",
+ "#VEN4\\VEN4N004#Seeing Brittany in this condition stirs you on to find the culprits responsible for this injustice.",
+ "#VEN4\\VEN4N005#The medical scanner has registered the death of Brittany Marata.",
+ "#VEN4\\VEN4N006#The medical scanner is monitoring the woman's condition.",
+ "#VEN4\\VEN4N007#The woman in this sickbed is alive, barely.",
+ "#VEN4\\VEN4N008#This door leads back to the corridor and turbolifts.",
+ "#VEN4\\VEN4N009#This door leads back to the corridor, and turbolifts 1 and 2.",
"#VEN4\\VEN4N010#This is an empty hypodermic injector.",
+ "#VEN4\\VEN4N011#This is the Republic's sickbay. Fortunately, power is still functioning here.",
+ "#VEN4\\VEN4N012#This medical drill fires a microscopic phaser beam.",
+ "#VEN4\\VEN4N013#This monitor has recorded the death of a patient.",
"#VEN4\\VEN4N014#Yet another crewman of the Republic whose life was unfairly abbreviated.",
+ "#VEN4\\VEN4N015#You pick up the empty hypodermic injector.",
+ "#VEN4\\VEN4N016#You retrieve the medical drill.",
+ "#VEN4\\VEN4N017#You see the dead body of Brittany. Her life was cut short and you won't stop until you find the persons responsible.",
+
+ "#VEN4\\VEN4_017#I believe nothing needs to be said, Captain.",
"#VEN6\\VEN6N007#The hypo is now filled with multipurpose oil.",
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 634d000..9cd6376 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -127,6 +127,7 @@ enum GameStringIDs {
TX_SPEAKER_ELASI_CAPTAIN,
TX_SPEAKER_ELASI_WEAPONS_MASTER,
TX_SPEAKER_ELASI_CREWMAN,
+ TX_SPEAKER_BRITTANY_MARATA,
TX_BRIDU146,
@@ -3100,10 +3101,46 @@ enum GameStringIDs {
TX_VEN3N014,
+ TX_VEN4_001,
+ TX_VEN4_002,
+ TX_VEN4_003,
+ TX_VEN4_004,
+ TX_VEN4_005,
+ TX_VEN4_006,
+ TX_VEN4_007,
+ TX_VEN4_008,
+ TX_VEN4_009,
+ TX_VEN4_010,
+ TX_VEN4_011,
+ TX_VEN4_012,
+ TX_VEN4_013,
+ TX_VEN4_014,
+ TX_VEN4_015,
TX_VEN4_016,
TX_VEN4_017,
+ TX_VEN4_018, // UNUSED
+ TX_VEN4_019,
+ TX_VEN4_020,
+ TX_VEN4_021,
+ TX_VEN4_022,
+ TX_VEN4N000,
+ TX_VEN4N001,
+ TX_VEN4N002,
+ TX_VEN4N003,
+ TX_VEN4N004,
+ TX_VEN4N005,
+ TX_VEN4N006,
+ TX_VEN4N007,
+ TX_VEN4N008,
+ TX_VEN4N009,
TX_VEN4N010,
+ TX_VEN4N011,
+ TX_VEN4N012,
+ TX_VEN4N013,
TX_VEN4N014,
+ TX_VEN4N015,
+ TX_VEN4N016,
+ TX_VEN4N017,
TX_VEN6N007,
Commit: 6db428f0063b25d112ed5647a3562f89816bafbf
https://github.com/scummvm/scummvm/commit/6db428f0063b25d112ed5647a3562f89816bafbf
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: VENG5
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/veng5.cpp
engines/startrek/text.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index abfa00f..7543674 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -675,7 +675,10 @@ struct AwayMission {
bool kirkShouldSuggestReestablishingPower; // 0x56
bool tookHypoFromSickbay; // 0x57
bool tookDrillFromSickbay; // 0x58
+ bool clearedDebrisInRoom5; // 0x59
bool havePowerPack; // 0x5a
+ bool enteredRoom5FirstTime; // 0x5b
+ bool askedSpockAboutFire; // 0x5c
bool tookCableFromSickbayHallway; // 0x5f
bool tookMolecularSaw; // 0x60
bool readEngineeringJournal; // 0x61
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 0f85f72..b67bd67 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2681,6 +2681,40 @@ public:
// VENG5
void veng5Tick1();
+ void veng5Tick45();
+ void veng5WalkToDoor();
+ void veng5ReachedDoor();
+ void veng5DoorOpened();
+ void veng5TouchedTurboliftDoor();
+ void veng5LookAtDoor();
+ void veng5LookAtLadder();
+ void veng5LookAtDeadGuy();
+ void veng5LookAtPowerPack();
+ void veng5LookAtDebris();
+ void veng5LookAtKirk();
+ void veng5LookAtSpock();
+ void veng5LookAtMccoy();
+ void veng5LookAtRedshirt();
+ void veng5LookAnywhere();
+ void veng5UsePhaserOnPowerPack();
+ void veng5UseStunPhaserOnDebris();
+ void veng5UseKillPhaserOnDebris();
+ void veng5ReachedPositionToShootDebris();
+ void veng5DrewPhaser();
+ void veng5VaporizedDebris();
+ void veng5UseMTricorderOnDebris();
+ void veng5UseSTricorderOnDebris();
+ void veng5UseMTricorderOnPowerPack();
+ void veng5UseSTricorderOnPowerPack();
+ void veng5TalkToKirk();
+ void veng5TalkToMccoy();
+ void veng5TalkToSpock();
+ void veng5TalkToRedshirt();
+ void veng5TouchedHotspot0();
+ void veng5GetPowerPack();
+ void veng5ReachedPowerPack();
+ void veng5PickedUpPowerPack();
+ // TODO: common code (and scanning the dead guy)
// VENG6
void veng6Tick1();
diff --git a/engines/startrek/rooms/veng5.cpp b/engines/startrek/rooms/veng5.cpp
index 9f5d263..c89795f 100644
--- a/engines/startrek/rooms/veng5.cpp
+++ b/engines/startrek/rooms/veng5.cpp
@@ -23,19 +23,236 @@
#include "startrek/room.h"
#define OBJECT_DOOR 8
+#define OBJECT_DEBRIS 9
+#define OBJECT_POWER_PACK 10
+#define OBJECT_DEAD_GUY 11
-#define HOTSPOT_20 0x20
+#define HOTSPOT_DOOR 0x20
+#define HOTSPOT_LADDER 0x21
namespace StarTrek {
extern const RoomAction veng5ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::veng5Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::veng5Tick1 },
+ { {ACTION_TICK, 45, 0, 0}, &Room::veng5Tick45 },
+
+ { {ACTION_WALK, HOTSPOT_DOOR, 0, 0}, &Room::veng5WalkToDoor },
+ { {ACTION_DONE_WALK, 2, 0, 0}, &Room::veng5ReachedDoor },
+ { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::veng5DoorOpened },
+ { {ACTION_TOUCHED_WARP, 1, 0, 0}, &Room::veng5TouchedTurboliftDoor },
+
+ { {ACTION_LOOK, HOTSPOT_DOOR, 0, 0}, &Room::veng5LookAtDoor },
+ { {ACTION_LOOK, OBJECT_DOOR, 0, 0}, &Room::veng5LookAtDoor },
+ { {ACTION_LOOK, HOTSPOT_LADDER, 0, 0}, &Room::veng5LookAtLadder },
+ { {ACTION_LOOK, OBJECT_DEAD_GUY, 0, 0}, &Room::veng5LookAtDeadGuy },
+ { {ACTION_LOOK, OBJECT_POWER_PACK, 0, 0}, &Room::veng5LookAtPowerPack },
+ { {ACTION_LOOK, OBJECT_DEBRIS, 0, 0}, &Room::veng5LookAtDebris },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::veng5LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::veng5LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::veng5LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::veng5LookAtRedshirt },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::veng5LookAnywhere },
+
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_POWER_PACK, 0}, &Room::veng5UsePhaserOnPowerPack },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_POWER_PACK, 0}, &Room::veng5UsePhaserOnPowerPack },
+ { {ACTION_USE, OBJECT_IPHASERS, OBJECT_DEBRIS, 0}, &Room::veng5UseStunPhaserOnDebris },
+ { {ACTION_USE, OBJECT_IPHASERK, OBJECT_DEBRIS, 0}, &Room::veng5UseKillPhaserOnDebris },
+ { {ACTION_DONE_WALK, 4, 0, 0}, &Room::veng5ReachedPositionToShootDebris },
+ { {ACTION_DONE_ANIM, 5, 0, 0}, &Room::veng5DrewPhaser },
+ { {ACTION_DONE_ANIM, 3, 0, 0}, &Room::veng5VaporizedDebris },
+
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_DEBRIS, 0}, &Room::veng5UseMTricorderOnDebris },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_DEBRIS, 0}, &Room::veng5UseSTricorderOnDebris },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_POWER_PACK, 0}, &Room::veng5UseMTricorderOnPowerPack },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_POWER_PACK, 0}, &Room::veng5UseSTricorderOnPowerPack },
+
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::veng5TalkToKirk },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::veng5TalkToMccoy },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::veng5TalkToSpock },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::veng5TalkToRedshirt },
+
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::veng5TouchedHotspot0 },
+
+ { {ACTION_GET, OBJECT_POWER_PACK, 0, 0}, &Room::veng5GetPowerPack },
+ { {ACTION_DONE_WALK, 6, 0, 0}, &Room::veng5ReachedPowerPack },
+ { {ACTION_DONE_ANIM, 7, 0, 0}, &Room::veng5PickedUpPowerPack },
};
extern const int veng5NumActions = ARRAYSIZE(veng5ActionList);
void Room::veng5Tick1() {
+ playVoc("VEN5LOOP");
+
+ if (!_awayMission->veng.clearedDebrisInRoom5)
+ loadActorAnim(OBJECT_DEBRIS, "s7r5de", 0xb1, 0x89);
+ else if (!_awayMission->veng.havePowerPack)
+ loadActorAnim(OBJECT_POWER_PACK, "s7r5fu", 0xb1, 0x89);
+
+ loadActorAnim(OBJECT_DEAD_GUY, "s7r5c1", 0xe2, 0x91);
+}
+
+void Room::veng5Tick45() {
+ if (!_awayMission->veng.enteredRoom5FirstTime) {
+ _awayMission->veng.enteredRoom5FirstTime = true;
+ showText(TX_SPEAKER_SPOCK, TX_VEN5_005); // "I'm picking up on a nearby power source"
+ }
+}
+
+void Room::veng5WalkToDoor() {
+ walkCrewmanC(OBJECT_KIRK, 0x78, 0x8e, &Room::veng5ReachedDoor);
+}
+
+void Room::veng5ReachedDoor() {
+ _awayMission->disableInput = true;
+ playSoundEffectIndex(SND_DOOR1);
+ loadActorAnimC(OBJECT_DOOR, "s7r5d1", 0x6b, 0x8c, &Room::veng5DoorOpened);
+ walkCrewman(OBJECT_KIRK, 0x64, 0x8e);
+}
+
+void Room::veng5DoorOpened() {
+ loadRoomIndex(6, 2);
+}
+
+void Room::veng5TouchedTurboliftDoor() {
+ playSoundEffectIndex(SND_DOOR1);
+ showRepublicMap(5, 1);
+}
+
+void Room::veng5LookAtDoor() {
+ showText(TX_VEN5N007);
+}
+
+void Room::veng5LookAtLadder() {
+ showText(TX_VEN5N008);
+}
+
+void Room::veng5LookAtDeadGuy() {
+ showText(TX_VEN5N000);
+}
+
+void Room::veng5LookAtPowerPack() {
+ showText(TX_VEN5N009);
+}
+
+void Room::veng5LookAtDebris() {
+ showText(TX_VEN5N001);
+}
+
+void Room::veng5LookAtKirk() {
+ showText(TX_VEN5N003);
+}
+
+void Room::veng5LookAtSpock() {
+ showText(TX_VEN5N002);
+}
+
+void Room::veng5LookAtMccoy() {
+ showText(TX_VEN5N004);
+}
+
+void Room::veng5LookAtRedshirt() {
+ showText(TX_VEN5N005);
+}
+
+void Room::veng5LookAnywhere() {
+ showText(TX_VEN5N006);
+}
+
+void Room::veng5UsePhaserOnPowerPack() {
+ showText(TX_SPEAKER_MCCOY, TX_VEN5_007);
+}
+
+void Room::veng5UseStunPhaserOnDebris() {
+ showText(TX_SPEAKER_SPOCK, TX_VEN5_013);
+}
+
+void Room::veng5UseKillPhaserOnDebris() {
+ walkCrewmanC(OBJECT_KIRK, 0xaa, 0xb9, &Room::veng5ReachedPositionToShootDebris);
+ _awayMission->disableInput = true;
+}
+
+void Room::veng5ReachedPositionToShootDebris() {
+ loadActorAnimC(OBJECT_KIRK, "kfiren", -1, -1, &Room::veng5DrewPhaser);
+}
+
+void Room::veng5DrewPhaser() {
+ loadActorAnimC(OBJECT_POWER_PACK, "s7r5p1", 0xb1, 0x89, &Room::veng5VaporizedDebris);
+ playSoundEffectIndex(SND_PHASSHOT);
+ loadActorStandAnim(OBJECT_DEBRIS);
+}
+
+void Room::veng5VaporizedDebris() {
+ loadActorStandAnim(OBJECT_KIRK);
+
+ showText(TX_SPEAKER_MCCOY, TX_VEN5_011);
+ showText(TX_SPEAKER_SPOCK, TX_VEN5_018);
+ showText(TX_SPEAKER_MCCOY, TX_VEN5_010);
+ showText(TX_SPEAKER_SPOCK, TX_VEN5_019);
+ showText(TX_SPEAKER_KIRK, TX_VEN5_003);
+
+ _awayMission->veng.clearedDebrisInRoom5 = true;
+ _awayMission->disableInput = false;
+}
+
+void Room::veng5UseMTricorderOnDebris() {
+ mccoyScan(DIR_W, TX_VEN5_008);
+}
+
+void Room::veng5UseSTricorderOnDebris() {
+ spockScan(DIR_N, TX_VEN5_012);
+}
+
+void Room::veng5UseMTricorderOnPowerPack() {
+ mccoyScan(DIR_W, TX_VEN5_009); // ENHANCEMENT: Use mccoyScan, not showText
+}
+
+void Room::veng5UseSTricorderOnPowerPack() {
+ spockScan(DIR_N, TX_VEN5_004);
+}
+
+void Room::veng5TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_VEN5_001);
+}
+
+void Room::veng5TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_VEN5_006);
+}
+
+void Room::veng5TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_VEN5_017);
+ showText(TX_SPEAKER_KIJE, TX_VEN5_R20);
+}
+
+void Room::veng5TalkToRedshirt() {
+ showText(TX_SPEAKER_KIJE, TX_VEN5_R19);
+}
+
+void Room::veng5TouchedHotspot0() { // Approached too close to fire
+ showText(TX_SPEAKER_SPOCK, TX_VEN5_015);
+
+ if (!_awayMission->veng.askedSpockAboutFire) {
+ _awayMission->veng.askedSpockAboutFire = true;
+ showText(TX_SPEAKER_KIRK, TX_VEN5_002);
+ showText(TX_SPEAKER_SPOCK, TX_VEN5_016);
+ }
+}
+
+void Room::veng5GetPowerPack() {
+ walkCrewmanC(OBJECT_KIRK, 0xb1, 0x8c, &Room::veng5ReachedPowerPack);
+}
+
+void Room::veng5ReachedPowerPack() {
+ loadActorAnimC(OBJECT_KIRK, "kuseln", -1, -1, &Room::veng5PickedUpPowerPack);
+}
+
+void Room::veng5PickedUpPowerPack() {
+ if (!_awayMission->veng.havePowerPack) {
+ loadActorStandAnim(OBJECT_POWER_PACK);
+ showText(TX_VEN5N010);
+ _awayMission->veng.havePowerPack = true;
+ giveItem(OBJECT_IFUSION);
+ }
}
}
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 4ad34ee..091b4cb 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -2690,7 +2690,7 @@ extern const char *const g_gameStrings[] = {
"#VEN0\\VEN0_013#Captain, these phasers are not configured for fine cutting. We could cause extensive damage.",
"#VEN0\\VEN0_014#What kind of a butcher would do this sort of thing?",
"#VEN0\\VEN0_015#I'm a doctor, not a civil engineer!",
- "#VEN0\\VEN0_016#They're dead, Jim. All of them.", // TYPO
+ "#VEN0\\VEN0_016#They're dead, Jim. All of them.", // TYPO (for only some rooms this text appears in)
"#VEN0\\VEN0_017#Jim, don't forget, there's another survivor on board. We've got to find him!",
"#VEN0\\VEN0_018#My God, Jim. What kind of butcher would do something like this?",
"#VEN0\\VEN0_019#Punctured lung, nerve damage, brain damage, fractured arm and ribs; it's a miracle he lasted as long as he did. He's not coming back, Jim.",
@@ -3021,7 +3021,38 @@ extern const char *const g_gameStrings[] = {
"#VEN4\\VEN4N016#You retrieve the medical drill.",
"#VEN4\\VEN4N017#You see the dead body of Brittany. Her life was cut short and you won't stop until you find the persons responsible.",
- "#VEN4\\VEN4_017#I believe nothing needs to be said, Captain.",
+
+ "#VEN5\\VEN5_001#We must complete our mission, gentlemen.",
+ "#VEN5\\VEN5_002#Is the fire in danger of spreading, spock?",
+ "#VEN5\\VEN5_003#Thank you, Spock, I think we get the point.",
+ "#VEN5\\VEN5_004#A standard portable fusion power pack. It is fully functional, Captain.",
+ "#VEN5\\VEN5_005#Captain, I'm picking up a functioning energy source in the immediate vicinity.",
+ "#VEN5\\VEN5_006#I can't say that I'm very talkative right now.",
+ "#VEN5\\VEN5_007#Jim, are you mad? Put that phaser away. You almost killed us once already.",
+ "#VEN5\\VEN5_008#No lifeforms present, Jim. I'm picking up some kind of energy reading, though.",
+ "#VEN5\\VEN5_009#One of those fusion power packs, Jim. What do you want me to do with it?",
+ "#VEN5\\VEN5_010#A few centimeters lower with that phaser and half this section would be history, not to mention us...",
+ "#VEN5\\VEN5_011#Oh, my God, Jim! Is that what I think it is?",
+ "#VEN5\\VEN5_012#I am picking up a high energy power source somewhere under the debris. I recommend caution, Captain.",
+ "#VEN5\\VEN5_013#The stun setting would be ineffective, Captain.",
+ "#VEN5\\VEN5_015#Captain, it is unadvisable to approach too closely. There is an open fire nearby.",
+ "#VEN5\\VEN5_016#No, Captain. There is an inadequate supply of flammable material. It will eventually burn itself out.",
+ "#VEN5\\VEN5_017#This corridor seems to have been particularly damaged. There have been hull breaches on the deck below.",
+ "#VEN5\\VEN5_018#Yes, Doctor. It is a portable fusion power pack.",
+ "#VEN5\\VEN5_019#Actually, Doctor, three point two centimeters. And based on our proximity to the explosion, and the angle of the beam...",
+ "#VEN5\\VEN5_R19#Is there a question, Captain?",
+ "#VEN5\\VEN5_R20#I will monitor the situation, Mr. Spock. I can use the distraction.",
+ "#VEN5\\VEN5N000#A look of terror is still etched on the face of this crewman.",
+ "#VEN5\\VEN5N001#A rather large pile of debris.",
+ "#VEN5\\VEN5N002#A resolute Mr. Spock.",
+ "#VEN5\\VEN5N003#A sad but determined James T. Kirk.",
+ "#VEN5\\VEN5N004#Dr. McCoy avoids the glances of his crewmates.",
+ "#VEN5\\VEN5N005#Ensign Kije, learning that Starfleet isn't always very pleasant.",
+ "#VEN5\\VEN5N006#This corridor leads to the Republic's Engineering section.",
+ "#VEN5\\VEN5N007#This door leads to main engineering.",
+ "#VEN5\\VEN5N008#These ladders are used when turbolifts are unavailable. Unfortunately, it is blocked by debris and a small, smoldering fire.",
+ "#VEN5\\VEN5N009#This is the most powerful portable energy storage device ever developed by man. It is used to provide temporary power to small systems when Main or Auxiliary power is unavailable.",
+ "#VEN5\\VEN5N010#You pick up the portable Fusion power pack.",
"#VEN6\\VEN6N007#The hypo is now filled with multipurpose oil.",
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 9cd6376..a55809a 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -3143,6 +3143,41 @@ enum GameStringIDs {
TX_VEN4N017,
+ TX_VEN5_001,
+ TX_VEN5_002,
+ TX_VEN5_003,
+ TX_VEN5_004,
+ TX_VEN5_005,
+ TX_VEN5_006,
+ TX_VEN5_007,
+ TX_VEN5_008,
+ TX_VEN5_009,
+ TX_VEN5_010,
+ TX_VEN5_011,
+ TX_VEN5_012,
+ TX_VEN5_013,
+ // MISSING
+ TX_VEN5_015,
+ TX_VEN5_016,
+ TX_VEN5_017,
+ TX_VEN5_018,
+ TX_VEN5_019,
+ // UNUSED: 020 (identical to R20)
+ TX_VEN5_R19,
+ TX_VEN5_R20,
+ TX_VEN5N000,
+ TX_VEN5N001,
+ TX_VEN5N002,
+ TX_VEN5N003,
+ TX_VEN5N004,
+ TX_VEN5N005,
+ TX_VEN5N006,
+ TX_VEN5N007,
+ TX_VEN5N008,
+ TX_VEN5N009,
+ TX_VEN5N010,
+
+
TX_VEN6N007,
Commit: 5fae11b871850ffce45499b5b2fa37dbbdb40706
https://github.com/scummvm/scummvm/commit/5fae11b871850ffce45499b5b2fa37dbbdb40706
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: Move VENG function into common code
Changed paths:
A engines/startrek/rooms/venga.cpp
engines/startrek/module.mk
engines/startrek/room.h
engines/startrek/rooms/veng1.cpp
engines/startrek/rooms/veng3.cpp
engines/startrek/rooms/veng5.cpp
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 99d7791..0f82c85 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -76,7 +76,8 @@ MODULE_OBJS = \
rooms/veng5.o \
rooms/veng6.o \
rooms/veng7.o \
- rooms/veng8.o
+ rooms/veng8.o \
+ rooms/venga.o
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index b67bd67..4f0a172 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2523,7 +2523,6 @@ public:
void veng1GetDebris();
void veng1ReachedDebrisToGet();
void veng1TriedToGetDebris();
- void veng1UseMccoyOnDeadGuy();
// TODO: common code
// VENG2
@@ -2637,7 +2636,6 @@ public:
void veng3GetCable();
void veng3ReachedCable();
void veng3PickedUpCable();
- void veng3UseMccoyOnDeadGuy();
// TODO: Common code
// VENG4
@@ -2714,7 +2712,7 @@ public:
void veng5GetPowerPack();
void veng5ReachedPowerPack();
void veng5PickedUpPowerPack();
- // TODO: common code (and scanning the dead guy)
+ // TODO: common code
// VENG6
void veng6Tick1();
@@ -2725,6 +2723,9 @@ public:
// VENG8
void veng8Tick1();
+ // VENGA (common code)
+ void vengaUseMccoyOnDeadGuy();
+
public:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
// NOTE: Any changes here must be reflected in the corresponding serializer functions.
diff --git a/engines/startrek/rooms/veng1.cpp b/engines/startrek/rooms/veng1.cpp
index dc39eb5..e683458 100644
--- a/engines/startrek/rooms/veng1.cpp
+++ b/engines/startrek/rooms/veng1.cpp
@@ -116,9 +116,10 @@ extern const RoomAction veng1ActionList[] = {
{ {ACTION_DONE_WALK, 11, 0, 0}, &Room::veng1ReachedDebrisToGet },
{ {ACTION_DONE_ANIM, 12, 0, 0}, &Room::veng1TriedToGetDebris },
- { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_DEAD_GUY, 0}, &Room::veng1UseMccoyOnDeadGuy },
- { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_DEAD_GUY, 0}, &Room::veng1UseMccoyOnDeadGuy },
- { {ACTION_USE, OBJECT_MCCOY, OBJECT_DEAD_GUY, 0}, &Room::veng1UseMccoyOnDeadGuy },
+ // Common code
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_DEAD_GUY, 0}, &Room::vengaUseMccoyOnDeadGuy },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_DEAD_GUY, 0}, &Room::vengaUseMccoyOnDeadGuy },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_DEAD_GUY, 0}, &Room::vengaUseMccoyOnDeadGuy },
};
extern const int veng1NumActions = ARRAYSIZE(veng1ActionList);
@@ -390,31 +391,4 @@ void Room::veng1TriedToGetDebris() {
}
}
-void Room::veng1UseMccoyOnDeadGuy() { // NOTE: Identical to function in VENG3
- int val = getRandomWordInRange(0, 5);
-
- switch (val) {
- case 0:
- // NOTE: The exact text differs from the text used in DEM3. But, in order for this
- // text indexing scheme to work, two rooms can't use the same audio with different
- // text. Original was "He's dead, jim." instead of "He's dead, Jim...".
- showText(TX_SPEAKER_MCCOY, TX_DEM3_019);
- break;
-
- case 1:
- showText(TX_SPEAKER_MCCOY, TX_VEN4_016);
- break;
-
- case 2:
- case 3:
- showText(TX_SPEAKER_MCCOY, TX_G_014);
- break;
-
- case 4:
- case 5:
- showText(TX_SPEAKER_MCCOY, TX_VEN0_016);
- break;
- }
-}
-
}
diff --git a/engines/startrek/rooms/veng3.cpp b/engines/startrek/rooms/veng3.cpp
index 649288b..969a8a1 100644
--- a/engines/startrek/rooms/veng3.cpp
+++ b/engines/startrek/rooms/veng3.cpp
@@ -91,9 +91,10 @@ extern const RoomAction veng3ActionList[] = {
{ {ACTION_DONE_WALK, 11, 0, 0}, &Room::veng3ReachedCable },
{ {ACTION_DONE_ANIM, 12, 0, 0}, &Room::veng3PickedUpCable },
- { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_DEAD_GUY, 0}, &Room::veng3UseMccoyOnDeadGuy },
- { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_DEAD_GUY, 0}, &Room::veng3UseMccoyOnDeadGuy },
- { {ACTION_USE, OBJECT_MCCOY, OBJECT_DEAD_GUY, 0}, &Room::veng3UseMccoyOnDeadGuy },
+ // Common code
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_DEAD_GUY, 0}, &Room::vengaUseMccoyOnDeadGuy },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_DEAD_GUY, 0}, &Room::vengaUseMccoyOnDeadGuy },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_DEAD_GUY, 0}, &Room::vengaUseMccoyOnDeadGuy },
};
extern const int veng3NumActions = ARRAYSIZE(veng3ActionList);
@@ -353,31 +354,4 @@ void Room::veng3PickedUpCable() {
_awayMission->veng.tookCableFromSickbayHallway = true;
}
-void Room::veng3UseMccoyOnDeadGuy() { // NOTE: Identical to function in VENG1
- int val = getRandomWordInRange(0, 5);
-
- switch (val) {
- case 0:
- // NOTE: The exact text differs from the text used in DEM3. But, in order for this
- // text indexing scheme to work, two rooms can't use the same audio with different
- // text. Original was "He's dead, jim." instead of "He's dead, Jim...".
- showText(TX_SPEAKER_MCCOY, TX_DEM3_019);
- break;
-
- case 1:
- showText(TX_SPEAKER_MCCOY, TX_VEN4_016);
- break;
-
- case 2:
- case 3:
- showText(TX_SPEAKER_MCCOY, TX_G_014);
- break;
-
- case 4:
- case 5:
- showText(TX_SPEAKER_MCCOY, TX_VEN0_016);
- break;
- }
-}
-
}
diff --git a/engines/startrek/rooms/veng5.cpp b/engines/startrek/rooms/veng5.cpp
index c89795f..52bf7ea 100644
--- a/engines/startrek/rooms/veng5.cpp
+++ b/engines/startrek/rooms/veng5.cpp
@@ -76,6 +76,11 @@ extern const RoomAction veng5ActionList[] = {
{ {ACTION_GET, OBJECT_POWER_PACK, 0, 0}, &Room::veng5GetPowerPack },
{ {ACTION_DONE_WALK, 6, 0, 0}, &Room::veng5ReachedPowerPack },
{ {ACTION_DONE_ANIM, 7, 0, 0}, &Room::veng5PickedUpPowerPack },
+
+ // Common code
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_DEAD_GUY, 0}, &Room::vengaUseMccoyOnDeadGuy },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_DEAD_GUY, 0}, &Room::vengaUseMccoyOnDeadGuy },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_DEAD_GUY, 0}, &Room::vengaUseMccoyOnDeadGuy },
};
extern const int veng5NumActions = ARRAYSIZE(veng5ActionList);
diff --git a/engines/startrek/rooms/venga.cpp b/engines/startrek/rooms/venga.cpp
new file mode 100644
index 0000000..0110331
--- /dev/null
+++ b/engines/startrek/rooms/venga.cpp
@@ -0,0 +1,54 @@
+/* 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 "startrek/room.h"
+
+namespace StarTrek {
+
+void Room::vengaUseMccoyOnDeadGuy() {
+ int val = getRandomWordInRange(0, 5);
+
+ switch (val) {
+ case 0:
+ // NOTE: The exact text differs from the text used in DEM3. But, in order for this
+ // text indexing scheme to work, two rooms can't use the same audio with different
+ // text. Original was "He's dead, jim." instead of "He's dead, Jim...".
+ showText(TX_SPEAKER_MCCOY, TX_DEM3_019);
+ break;
+
+ case 1:
+ showText(TX_SPEAKER_MCCOY, TX_VEN4_016);
+ break;
+
+ case 2:
+ case 3:
+ showText(TX_SPEAKER_MCCOY, TX_G_014);
+ break;
+
+ case 4:
+ case 5:
+ showText(TX_SPEAKER_MCCOY, TX_VEN0_016);
+ break;
+ }
+}
+
+}
Commit: 20cc6ae56d294c13086b32a74c3f1c7b79d04318
https://github.com/scummvm/scummvm/commit/20cc6ae56d294c13086b32a74c3f1c7b79d04318
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: VENG6
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/veng6.cpp
engines/startrek/text.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 7543674..02def65 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -679,9 +679,16 @@ struct AwayMission {
bool havePowerPack; // 0x5a
bool enteredRoom5FirstTime; // 0x5b
bool askedSpockAboutFire; // 0x5c
+
+ // bits 0-1 are set for each of the 2 cables that can be connected to the
+ // junction box in engineering.
+ byte junctionCablesConnected; // 0x5d
+
bool tookCableFromSickbayHallway; // 0x5f
bool tookMolecularSaw; // 0x60
bool readEngineeringJournal; // 0x61
+ bool tookEngineeringJournal; // 0x62
+ bool engineeringCabinetOpen; // 0x63
bool examinedTorpedoControl; // 0x66
bool field68; // 0x68
bool getPointsForHealingBrittany; // 0x69
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 4f0a172..0bdaf7c 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2716,6 +2716,59 @@ public:
// VENG6
void veng6Tick1();
+ void veng6WalkToDoor();
+ void veng6ReachedDoor();
+ void veng6DoorOpened();
+ void veng6LookAtLeftPort();
+ void veng6LookAtRightPort();
+ void veng6LookAtDoor();
+ void veng6LookAtOilCanister();
+ void veng6LookAtCabinet();
+ void veng6LookAtCable();
+ void veng6LookAtRightConsole();
+ void veng6LookAtImpulseEngines();
+ void veng6LookAtLeftConsole();
+ void veng6LookAtJunctionBox();
+ void veng6LookAtJournal();
+ void veng6LookAtKirk();
+ void veng6LookAtSpock();
+ void veng6LookAtMccoy();
+ void veng6LookAtRedshirt();
+ void veng6LookAtDeadGuy();
+ void veng6LookAnywhere();
+ void veng6TalkToKirk();
+ void veng6TalkToSpock();
+ void veng6TalkToMccoy();
+ void veng6TalkToRedshirt();
+ void veng6UseCable1OnLeftPort();
+ void veng6UseCable2OnLeftPort();
+ void veng6UseCableOnLeftPort(byte cable);
+ void veng6KirkOrSpockReachedLeftPort();
+ void veng6AttachedLeftCable();
+ void veng6UseCable1OnRightPort();
+ void veng6UseCable2OnRightPort();
+ void veng6UseCableOnRightPort(byte cable);
+ void veng6KirkOrSpockReachedRightPort();
+ void veng6AttachedRightCable();
+ void veng6UseCrewmanOnJunctionBox();
+ void veng6SpockReachedJunctionBox();
+ void veng6SpockAdjustedJunctionBox();
+ void veng6UseHypoOnOilCanister();
+ void veng6ReachedOilCanister();
+ void veng6FilledHypoWithOil();
+ void veng6UseCabinet();
+ void veng6ReachedCabinet();
+ void veng6OpenedOrClosedCabinet();
+ void veng6UseSTricorderOnImpulseEngines();
+ void veng6UseSTricorderOnRightConsole();
+ void veng6UseSTricorderOnJunctionBox();
+ void veng6UsePowerPackOnLeftConsole();
+ void veng6GetJunctionBox();
+ void veng6GetOilCanister();
+ void veng6GetEngineeringJournal();
+ void veng6ReachedEngineeringJournal();
+ void veng6TookEngineeringJournal();
+ // TODO: common code
// VENG7
void veng7Tick1();
@@ -3049,6 +3102,11 @@ public:
// veng4
bool usingMedkitOnBrittany;
+ // veng6
+ byte kirkAndSpockReadyToAttachLeftCable; // 0xca
+ byte kirkAndSpockReadyToAttachRightCable; // 0xcb
+ byte cableInUse; // 0xcc
+
// venga (common)
bool walkingToDoor; // 0xcb (veng1), 0xca (veng4)
} veng;
diff --git a/engines/startrek/rooms/veng6.cpp b/engines/startrek/rooms/veng6.cpp
index 78743d4..e822742 100644
--- a/engines/startrek/rooms/veng6.cpp
+++ b/engines/startrek/rooms/veng6.cpp
@@ -22,20 +22,443 @@
#include "startrek/room.h"
-#define OBJECT_DOOR 8
+#define OBJECT_CABLE_1 8
+#define OBJECT_CABLE_2 9
+#define OBJECT_JUNCTION_BOX 10
+#define OBJECT_JOURNAL 11
+#define OBJECT_DOOR 12
+#define OBJECT_DEAD_GUY 13
+#define OBJECT_IMPULSE_ENGINES 14
+#define OBJECT_CABINET 15
-#define HOTSPOT_20 0x20
+#define HOTSPOT_LEFT_PORT 0x20
+#define HOTSPOT_RIGHT_PORT 0x21
+#define HOTSPOT_OIL_CANISTER 0x22
+#define HOTSPOT_CABINET 0x23
+#define HOTSPOT_RIGHT_CONSOLE 0x24 // Fusion mixture regulator
+#define HOTSPOT_IMPULSE_ENGINES 0x25
+#define HOTSPOT_LEFT_CONSOLE 0x26 // Impulse engine control
+#define HOTSPOT_DOOR 0x27
namespace StarTrek {
extern const RoomAction veng6ActionList[] = {
{ {ACTION_TICK, 1, 0, 0}, &Room::veng6Tick1 },
+
+ { {ACTION_WALK, OBJECT_DOOR, 0, 0}, &Room::veng6WalkToDoor },
+ { {ACTION_WALK, HOTSPOT_DOOR, 0, 0}, &Room::veng6WalkToDoor },
+ { {ACTION_DONE_WALK, 2, 0, 0}, &Room::veng6ReachedDoor },
+ { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::veng6DoorOpened },
+
+ { {ACTION_LOOK, HOTSPOT_LEFT_PORT, 0, 0}, &Room::veng6LookAtLeftPort },
+ { {ACTION_LOOK, HOTSPOT_RIGHT_PORT, 0, 0}, &Room::veng6LookAtRightPort },
+ { {ACTION_LOOK, OBJECT_DOOR, 0, 0}, &Room::veng6LookAtDoor },
+ { {ACTION_LOOK, HOTSPOT_DOOR, 0, 0}, &Room::veng6LookAtDoor },
+ { {ACTION_LOOK, HOTSPOT_OIL_CANISTER, 0, 0}, &Room::veng6LookAtOilCanister },
+ { {ACTION_LOOK, OBJECT_CABINET, 0, 0}, &Room::veng6LookAtCabinet },
+ { {ACTION_LOOK, HOTSPOT_CABINET, 0, 0}, &Room::veng6LookAtCabinet },
+ { {ACTION_LOOK, OBJECT_CABLE_2, 0, 0}, &Room::veng6LookAtCable },
+ { {ACTION_LOOK, OBJECT_CABLE_1, 0, 0}, &Room::veng6LookAtCable },
+ { {ACTION_LOOK, HOTSPOT_RIGHT_CONSOLE, 0, 0}, &Room::veng6LookAtRightConsole },
+ { {ACTION_LOOK, OBJECT_IMPULSE_ENGINES, 0, 0}, &Room::veng6LookAtImpulseEngines },
+ { {ACTION_LOOK, HOTSPOT_IMPULSE_ENGINES, 0, 0}, &Room::veng6LookAtImpulseEngines },
+ { {ACTION_LOOK, HOTSPOT_LEFT_CONSOLE, 0, 0}, &Room::veng6LookAtLeftConsole },
+ { {ACTION_LOOK, OBJECT_JUNCTION_BOX, 0, 0}, &Room::veng6LookAtJunctionBox },
+ { {ACTION_LOOK, OBJECT_JOURNAL, 0, 0}, &Room::veng6LookAtJournal },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::veng6LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::veng6LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::veng6LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::veng6LookAtRedshirt },
+ { {ACTION_LOOK, OBJECT_DEAD_GUY, 0, 0}, &Room::veng6LookAtDeadGuy },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::veng6LookAnywhere },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::veng6TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::veng6TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::veng6TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::veng6TalkToRedshirt },
+
+ { {ACTION_USE, OBJECT_ICABLE1, HOTSPOT_LEFT_PORT, 0}, &Room::veng6UseCable1OnLeftPort },
+ { {ACTION_USE, OBJECT_ICABLE1, HOTSPOT_LEFT_CONSOLE, 0}, &Room::veng6UseCable1OnLeftPort },
+ { {ACTION_USE, OBJECT_ICABLE2, HOTSPOT_LEFT_PORT, 0}, &Room::veng6UseCable2OnLeftPort },
+ { {ACTION_USE, OBJECT_ICABLE2, HOTSPOT_LEFT_CONSOLE, 0}, &Room::veng6UseCable2OnLeftPort },
+ { {ACTION_DONE_WALK, 3, 0, 0}, &Room::veng6KirkOrSpockReachedLeftPort },
+ { {ACTION_DONE_WALK, 4, 0, 0}, &Room::veng6KirkOrSpockReachedLeftPort },
+ { {ACTION_DONE_ANIM, 5, 0, 0}, &Room::veng6AttachedLeftCable },
+
+ { {ACTION_USE, OBJECT_ICABLE1, HOTSPOT_RIGHT_PORT, 0}, &Room::veng6UseCable1OnRightPort },
+ { {ACTION_USE, OBJECT_ICABLE1, HOTSPOT_RIGHT_CONSOLE, 0}, &Room::veng6UseCable1OnRightPort },
+ { {ACTION_USE, OBJECT_ICABLE2, HOTSPOT_RIGHT_PORT, 0}, &Room::veng6UseCable2OnRightPort },
+ { {ACTION_USE, OBJECT_ICABLE2, HOTSPOT_RIGHT_CONSOLE, 0}, &Room::veng6UseCable2OnRightPort },
+ { {ACTION_DONE_WALK, 6, 0, 0}, &Room::veng6KirkOrSpockReachedRightPort },
+ { {ACTION_DONE_WALK, 7, 0, 0}, &Room::veng6KirkOrSpockReachedRightPort },
+ { {ACTION_DONE_ANIM, 8, 0, 0}, &Room::veng6AttachedRightCable },
+
+ { {ACTION_USE, OBJECT_SPOCK, OBJECT_JUNCTION_BOX, 0}, &Room::veng6UseCrewmanOnJunctionBox },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_JUNCTION_BOX, 0}, &Room::veng6UseCrewmanOnJunctionBox },
+ { {ACTION_USE, OBJECT_REDSHIRT, OBJECT_JUNCTION_BOX, 0}, &Room::veng6UseCrewmanOnJunctionBox },
+ { {ACTION_USE, OBJECT_KIRK, OBJECT_JUNCTION_BOX, 0}, &Room::veng6UseCrewmanOnJunctionBox },
+ { {ACTION_DONE_WALK, 9, 0, 0}, &Room::veng6SpockReachedJunctionBox },
+ { {ACTION_DONE_ANIM, 10, 0, 0}, &Room::veng6SpockAdjustedJunctionBox },
+
+ { {ACTION_USE, OBJECT_IHYPO, HOTSPOT_OIL_CANISTER, 0}, &Room::veng6UseHypoOnOilCanister },
+ { {ACTION_DONE_WALK, 13, 0, 0}, &Room::veng6ReachedOilCanister },
+ { {ACTION_DONE_ANIM, 14, 0, 0}, &Room::veng6FilledHypoWithOil },
+
+ { {ACTION_USE, OBJECT_KIRK, OBJECT_CABINET, 0}, &Room::veng6UseCabinet },
+ { {ACTION_DONE_WALK, 15, 0, 0}, &Room::veng6ReachedCabinet },
+ { {ACTION_DONE_ANIM, 16, 0, 0}, &Room::veng6OpenedOrClosedCabinet },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_IMPULSE_ENGINES, 0}, &Room::veng6UseSTricorderOnImpulseEngines },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_RIGHT_CONSOLE, 0}, &Room::veng6UseSTricorderOnRightConsole },
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_JUNCTION_BOX, 0}, &Room::veng6UseSTricorderOnJunctionBox },
+ { {ACTION_USE, OBJECT_IFUSION, HOTSPOT_LEFT_CONSOLE, 0}, &Room::veng6UsePowerPackOnLeftConsole },
+ { {ACTION_GET, OBJECT_JUNCTION_BOX, 0, 0}, &Room::veng6GetJunctionBox },
+ { {ACTION_GET, HOTSPOT_OIL_CANISTER, 0, 0}, &Room::veng6GetOilCanister },
+ { {ACTION_GET, OBJECT_JOURNAL, 0, 0}, &Room::veng6GetEngineeringJournal },
+ { {ACTION_DONE_WALK, 11, 0, 0}, &Room::veng6ReachedEngineeringJournal },
+ { {ACTION_DONE_ANIM, 12, 0, 0}, &Room::veng6TookEngineeringJournal },
+
+ // Common code
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_DEAD_GUY, 0}, &Room::vengaUseMccoyOnDeadGuy },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_DEAD_GUY, 0}, &Room::vengaUseMccoyOnDeadGuy },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_DEAD_GUY, 0}, &Room::vengaUseMccoyOnDeadGuy },
+
+ // ENHANCEMENT
+ { {ACTION_USE, OBJECT_ISTRICOR, OBJECT_IMPULSE_ENGINES, 0}, &Room::veng6UseSTricorderOnImpulseEngines },
};
extern const int veng6NumActions = ARRAYSIZE(veng6ActionList);
+#define DOOR_X 0x13e
+#define DOOR_Y 0xa8
+
+#define CABLE_1_X 0x5d
+#define CABLE_1_Y 0x95
+
+#define CABLE_2_X 0x107
+#define CABLE_2_Y 0x94
+
+#define IMPULSE_ENGINE_X 0x9e
+#define IMPULSE_ENGINE_Y 0x59
+
+#define CABINET_X 0x19
+#define CABINET_Y 0x86
+
void Room::veng6Tick1() {
+ loadActorAnim(OBJECT_DOOR, "s7r6d1c", DOOR_X, DOOR_Y);
+ loadActorAnim(OBJECT_DEAD_GUY, "s7r6c1", 0x82, 0x5c);
+ loadActorAnim(OBJECT_JUNCTION_BOX, "s7r6j1", 0x9a, 0xaf);
+
+ if (_awayMission->veng.junctionCablesConnected & 1)
+ loadActorAnim(OBJECT_CABLE_1, "s7r6cl", CABLE_1_X, CABLE_1_Y);
+ if (_awayMission->veng.junctionCablesConnected & 2)
+ loadActorAnim(OBJECT_CABLE_2, "s7r6cr", CABLE_2_X, CABLE_2_Y);
+
+ if (_awayMission->veng.impulseEnginesOn) {
+ loadActorAnim(OBJECT_IMPULSE_ENGINES, "s7r6i1", IMPULSE_ENGINE_X, IMPULSE_ENGINE_Y);
+ // FIXME: doesn't loop
+ playVoc("VEN6LON");
+ } else
+ playVoc("VEN6LOFF");
+
+ if (!_awayMission->veng.tookEngineeringJournal)
+ loadActorAnim(OBJECT_JOURNAL, "s7r6ej", 0x24, 0x82);
+
+ loadActorAnim(OBJECT_CABINET, "s7r6p1c", CABINET_X, CABINET_Y);
+ if (_awayMission->veng.engineeringCabinetOpen)
+ loadActorAnim(OBJECT_CABINET, "s7r6p1o", CABINET_X, CABINET_Y);
+}
+
+void Room::veng6WalkToDoor() {
+ walkCrewmanC(OBJECT_KIRK, 0x120, 0xad, &Room::veng6ReachedDoor);
+}
+
+void Room::veng6ReachedDoor() {
+ _awayMission->disableInput = true;
+ playSoundEffectIndex(SND_DOOR1);
+ loadActorAnimC(OBJECT_DOOR, "s7r6d1", DOOR_X, DOOR_Y, &Room::veng6DoorOpened);
+}
+
+void Room::veng6DoorOpened() {
+ walkCrewman(OBJECT_KIRK, 0x136, 0xaa);
+}
+
+void Room::veng6LookAtLeftPort() {
+ showText(TX_VEN6N018);
+}
+
+void Room::veng6LookAtRightPort() {
+ showText(TX_VEN6N016);
+}
+
+void Room::veng6LookAtDoor() {
+ showText(TX_VEN5N007);
+}
+
+void Room::veng6LookAtOilCanister() {
+ showText(TX_VEN6N011);
+}
+
+void Room::veng6LookAtCabinet() {
+ showText(TX_VEN6N015);
+}
+
+void Room::veng6LookAtCable() {
+ showText(TX_VEN6N013);
+}
+
+void Room::veng6LookAtRightConsole() {
+ showText(TX_VEN6N017);
+}
+
+void Room::veng6LookAtImpulseEngines() {
+ showText(TX_VEN6N010);
+}
+
+void Room::veng6LookAtLeftConsole() {
+ showText(TX_VEN6N009);
+}
+
+void Room::veng6LookAtJunctionBox() {
+ showText(TX_VEN6N012);
+}
+
+void Room::veng6LookAtJournal() {
+ showText(TX_VEN6N025);
+ showText(TX_SPEAKER_SPOCK, TX_VEN6_021);
+}
+
+void Room::veng6LookAtKirk() {
+ showText(TX_VEN6N001);
+}
+
+void Room::veng6LookAtSpock() {
+ showText(TX_VEN6N003);
+}
+
+void Room::veng6LookAtMccoy() {
+ showText(TX_VEN6N002);
+}
+
+void Room::veng6LookAtRedshirt() {
+ showText(TX_VEN6N000);
+}
+
+void Room::veng6LookAtDeadGuy() {
+ showText(TX_VEN0N016);
+}
+
+void Room::veng6LookAnywhere() {
+ showText(TX_VEN6N019);
+}
+
+void Room::veng6TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_VEN6_005);
+ showText(TX_SPEAKER_MCCOY, TX_VEN6_009);
+}
+
+void Room::veng6TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_VEN6_014);
+}
+
+void Room::veng6TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_VEN6_008);
+ showText(TX_SPEAKER_SPOCK, TX_VEN6_018);
+}
+
+void Room::veng6TalkToRedshirt() {
+ showText(TX_SPEAKER_KIJE, TX_VEN6_023);
+}
+
+void Room::veng6UseCable1OnLeftPort() {
+ veng6UseCableOnLeftPort(OBJECT_ICABLE1);
+}
+
+void Room::veng6UseCable2OnLeftPort() {
+ veng6UseCableOnLeftPort(OBJECT_ICABLE2);
+}
+
+void Room::veng6UseCableOnLeftPort(byte cable) {
+ _roomVar.veng.cableInUse = cable;
+
+ if (!(_awayMission->veng.junctionCablesConnected & 1)) {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_SPOCK, 0x91, 0xb4, &Room::veng6KirkOrSpockReachedLeftPort);
+ walkCrewmanC(OBJECT_KIRK, 0x5c, 0xa0, &Room::veng6KirkOrSpockReachedLeftPort);
+ }
+}
+
+void Room::veng6KirkOrSpockReachedLeftPort() {
+ if (++_roomVar.veng.kirkAndSpockReadyToAttachLeftCable == 2) {
+ loadActorAnimC(OBJECT_KIRK, "kuseln", -1, -1, &Room::veng6AttachedLeftCable);
+ loadActorAnim(OBJECT_SPOCK, "suseln");
+ playVoc("EFX4");
+ }
+}
+
+void Room::veng6AttachedLeftCable() {
+ loadActorAnim(OBJECT_CABLE_1, "s7r6cl", CABLE_1_X, CABLE_1_Y);
+ showText(TX_VEN6N020);
+ _awayMission->veng.junctionCablesConnected |= 1;
+ loseItem(_roomVar.veng.cableInUse);
+ _awayMission->disableInput = false;
+}
+
+void Room::veng6UseCable1OnRightPort() {
+ veng6UseCableOnRightPort(OBJECT_ICABLE1);
+}
+
+void Room::veng6UseCable2OnRightPort() {
+ veng6UseCableOnRightPort(OBJECT_ICABLE2);
+}
+
+void Room::veng6UseCableOnRightPort(byte cable) {
+ _roomVar.veng.cableInUse = cable;
+
+ if (!(_awayMission->veng.junctionCablesConnected & 2)) {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_SPOCK, 0xac, 0xb4, &Room::veng6KirkOrSpockReachedRightPort);
+ walkCrewmanC(OBJECT_KIRK, 0x107, 0xa0, &Room::veng6KirkOrSpockReachedRightPort);
+ }
+}
+
+void Room::veng6KirkOrSpockReachedRightPort() {
+ if (++_roomVar.veng.kirkAndSpockReadyToAttachRightCable == 2) {
+ loadActorAnimC(OBJECT_KIRK, "kuseln", -1, -1, &Room::veng6AttachedRightCable);
+ loadActorAnim(OBJECT_SPOCK, "suseln");
+ playVoc("EFX4");
+ }
+}
+
+void Room::veng6AttachedRightCable() {
+ loadActorAnim(OBJECT_CABLE_2, "s7r6cr", CABLE_2_X, CABLE_2_Y);
+ showText(TX_VEN6N022);
+ _awayMission->veng.junctionCablesConnected |= 2;
+ loseItem(_roomVar.veng.cableInUse);
+ _awayMission->disableInput = false;
+}
+
+void Room::veng6UseCrewmanOnJunctionBox() {
+ if (_awayMission->veng.impulseEnginesOn)
+ showText(TX_SPEAKER_SPOCK, TX_VEN6_012);
+ else if ((_awayMission->veng.junctionCablesConnected & 3) == 3) {
+ showText(TX_SPEAKER_COMPUTER, TX_COMPA185);
+ showText(TX_SPEAKER_KIRK, TX_VEN6_003);
+ if (!_awayMission->veng.readEngineeringJournal)
+ showText(TX_SPEAKER_SPOCK, TX_VEN6_017);
+ else {
+ showText(TX_SPEAKER_SPOCK, TX_VEN6_016);
+ showText(TX_SPEAKER_KIRK, TX_VEN6_002);
+ walkCrewmanC(OBJECT_SPOCK, 0x99, 0xb4, &Room::veng6SpockReachedJunctionBox);
+ }
+ } else
+ showText(TX_SPEAKER_SPOCK, TX_VEN6_011);
+}
+
+void Room::veng6SpockReachedJunctionBox() {
+ loadActorAnimC(OBJECT_SPOCK, "suseln", -1, -1, &Room::veng6SpockAdjustedJunctionBox);
+}
+
+void Room::veng6SpockAdjustedJunctionBox() {
+ showText(TX_SPEAKER_SPOCK, TX_VEN6_019);
+ loadActorAnim(OBJECT_IMPULSE_ENGINES, "s7r6i1", IMPULSE_ENGINE_X, IMPULSE_ENGINE_Y);
+ _awayMission->veng.impulseEnginesOn = true;
+ stopAllVocSounds();
+ playVoc("VEN6LON");
+}
+
+void Room::veng6UseHypoOnOilCanister() {
+ if (_awayMission->veng.oilInHypo)
+ showText(TX_VEN6N006);
+ else {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x3c, 0x9e, &Room::veng6ReachedOilCanister);
+ }
+}
+
+void Room::veng6ReachedOilCanister() {
+ loadActorAnimC(OBJECT_KIRK, "kusehw", -1, -1, &Room::veng6FilledHypoWithOil);
+}
+
+void Room::veng6FilledHypoWithOil() {
+ _awayMission->disableInput = false;
+ showText(TX_VEN6N007);
+ _awayMission->veng.oilInHypo = true;
+}
+
+void Room::veng6UseCabinet() {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x36, 0x9f, &Room::veng6ReachedCabinet);
+}
+
+void Room::veng6ReachedCabinet() {
+ loadActorAnimC(OBJECT_KIRK, "kusehw", -1, -1, &Room::veng6OpenedOrClosedCabinet);
+}
+
+void Room::veng6OpenedOrClosedCabinet() {
+ _awayMission->disableInput = false;
+
+ if (_awayMission->veng.engineeringCabinetOpen) {
+ loadActorAnim(OBJECT_CABINET, "s7r6p2", CABINET_X, CABINET_Y);
+ playSoundEffectIndex(SND_DOOR1);
+ _awayMission->veng.engineeringCabinetOpen = false;
+ } else {
+ loadActorAnim(OBJECT_CABINET, "s7r6p1", CABINET_X, CABINET_Y);
+ playSoundEffectIndex(SND_DOOR1);
+ _awayMission->veng.engineeringCabinetOpen = true;
+ if (!_awayMission->veng.tookEngineeringJournal)
+ showText(TX_VEN6N005);
+ }
+}
+
+void Room::veng6UseSTricorderOnImpulseEngines() {
+ if (_awayMission->veng.impulseEnginesOn)
+ spockScan(DIR_S, TX_VEN6_010);
+ else {
+ spockScan(DIR_S, TX_VEN6_020);
+ showText(TX_SPEAKER_KIRK, TX_VEN6_001);
+ showText(TX_SPEAKER_SPOCK, TX_VEN6_022);
+ }
+}
+
+void Room::veng6UseSTricorderOnRightConsole() {
+ if (_awayMission->veng.impulseEnginesOn)
+ spockScan(DIR_S, TX_VEN6_013);
+ else
+ spockScan(DIR_S, TX_VEN6_007);
+}
+
+void Room::veng6UseSTricorderOnJunctionBox() {
+ spockScan(DIR_S, TX_VEN6_015);
+}
+
+void Room::veng6UsePowerPackOnLeftConsole() {
+ showText(TX_SPEAKER_SPOCK, TX_VEN6_006);
+}
+
+void Room::veng6GetJunctionBox() {
+ showText(TX_MUD1N014);
+}
+
+void Room::veng6GetOilCanister() {
+ showText(TX_VEN6N008);
+}
+
+void Room::veng6GetEngineeringJournal() {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x36, 0x9f, &Room::veng6ReachedEngineeringJournal);
+}
+
+void Room::veng6ReachedEngineeringJournal() {
+ loadActorAnimC(OBJECT_KIRK, "kusemw", -1, -1, &Room::veng6TookEngineeringJournal);
+}
+
+void Room::veng6TookEngineeringJournal() {
+ loadActorStandAnim(OBJECT_JOURNAL);
+ _awayMission->disableInput = false;
+ showText(TX_VEN6N024);
+ _awayMission->veng.tookEngineeringJournal = true;
+ giveItem(OBJECT_ITECH);
}
}
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 091b4cb..c565b1f 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -80,6 +80,7 @@ extern const char *const g_gameStrings[] = {
"#GENE\\GENER004#Game Over",
"#COMP\\COMPA180#Orbit Stabilized. Warning Cancelled.",
+ "#COMP\\COMPA185#Please select an impedence.",
"#COMP\\COMPA186#Ammonia",
"#COMP\\COMPA187#Di-hydrogen Oxide",
"#COMP\\COMPA189#Nitrous Oxide",
@@ -3055,7 +3056,50 @@ extern const char *const g_gameStrings[] = {
"#VEN5\\VEN5N010#You pick up the portable Fusion power pack.",
+ "#VEN6\\VEN6_001#Can we re-route the power lines?",
+ "#VEN6\\VEN6_002#Go ahead and adjust the settings, Spock.",
+ "#VEN6\\VEN6_003#Spock?",
+ "#VEN6\\VEN6_005#This reminds me of a poem I read when I was a child. \"I am Ozymandius, King of Kings, look ><upon my works, ye mighty, and despair.\"",
+ "#VEN6\\VEN6_006#Captain, the energy output of the Fusion Power pack is insufficient to power any of the major ship's systems.",
+ "#VEN6\\VEN6_007#Captain, this is the fusion mixture regulator for the impulse engines. There is currently no power running to it.",
+ "#VEN6\\VEN6_008#Remind me to compliment Mr. Scott on the efficiency of his engineering section.",
+ "#VEN6\\VEN6_009#You have good reason to despair, here, Jim.",
+ "#VEN6\\VEN6_010#Impulse power is functioning, Captain.",
+ "#VEN6\\VEN6_011#It is illogical to use this machine before we have something connected to it.",
+ "#VEN6\\VEN6_012#The impedance is correctly set, Captain. Changing the setting could be dangerous.",
+ "#VEN6\\VEN6_013#The regulator is fully operating from the power tap run from the impulse engines. We can allocate power to ship's systems in Auxiliary Control.",
+ "#VEN6\\VEN6_014#There has been a .0003 degradation in hull integrity in the last hour. There should be no danger, Captain.",
+ "#VEN6\\VEN6_015#This is an engineering circuit junction box. It is used for temporary re-routing of power. Without using one of these devices set to the proper impedance, an overload can occur.",
+ "#VEN6\\VEN6_016#Captain, the information obtained from the engineering journals indicates the correct impedance setting to be nineteen thousand ohms.",
+ "#VEN6\\VEN6_017#Captain, the wrong setting on this particular device may cause the fusion reactors to melt down. We will have to do some research to determine the correct setting.",
+ "#VEN6\\VEN6_018#Given that Mr. Scott has received a Starfleet Citation on five occasions for efficiency, I do not see the logic in your suggestion, Doctor.",
+ "#VEN6\\VEN6_019#Power has now been restored, Captain.",
+ "#VEN6\\VEN6_020#The impulse engines are intact, Captain. We could use the fusion reactors from the impulse engines to restore power, but the lines have been severed to the power regulator.",
+ "#VEN6\\VEN6_021#These journals may prove useful in our attempt to reestablish power. A functioning computer terminal will allow us to examine them.",
+ "#VEN6\\VEN6_022#We should be able to, Captain, if we can find a suitable supply of power cable. We will need to route the power through a junction box so we can set an impedance level. A direct connection to the regulator would cause an overload.",
+ "#VEN6\\VEN6_023#Tragic, Captain. This is one of the greatest disasters in Starfleet history.",
+ "#VEN6\\VEN6N000#Kije fidgets nervously.",
+ "#VEN6\\VEN6N001#Kirk wonders if the landing party has overlooked anything.",
+ "#VEN6\\VEN6N002#McCoy wonders when it will be his turn to die in the line of duty.",
+ "#VEN6\\VEN6N003#Spock glances at his tricorder, making certain the superstructure of the Republic is stable.",
+ "#VEN6\\VEN6N005#The closet opens revealing a library of engineering technical journals.",
+ "#VEN6\\VEN6N006#The hypo is already filled with oil.",
"#VEN6\\VEN6N007#The hypo is now filled with multipurpose oil.",
+ "#VEN6\\VEN6N008#The oil canister is bolted to the hull and can't be taken.",
+ "#VEN6\\VEN6N009#These are the controls to the Republic's impulse engines.",
+ "#VEN6\\VEN6N010#These are the impulse engines for the Republic.",
+ "#VEN6\\VEN6N011#This is a canister of high grade multipurpose oil. Very useful for lubricating machinery.",
+ "#VEN6\\VEN6N012#This is a junction box used for temporary re-routing of engineering circuits.",
+ "#VEN6\\VEN6N013#This is a length of heavy duty insulated power cable.",
+ "#VEN6\\VEN6N015#This is a standard storage closet.",
+ "#VEN6\\VEN6N016#This is the emergency power input port for the fusion mixture regulator.",
+ "#VEN6\\VEN6N017#This is the fusion mixture regulator for the Republic's impulse engines.",
+ "#VEN6\\VEN6N018#This port is used to connect emergency power from the impulse engines to other systems if dedicated lines are damaged.",
+ "#VEN6\\VEN6N019#This was the engineering section of the U.S.S. Republic.",
+ "#VEN6\\VEN6N020#You connect a length of cable between the impulse engine and the junction box.",
+ "#VEN6\\VEN6N022#You connect a length of cable between the regulator circuits and the junction box.",
+ "#VEN6\\VEN6N024#You take the engineering technical journals.",
+ "#VEN6\\VEN6N025#This is a library of engineering technical journals.",
"#VENA\\VENA_F32#The landing party has been taken captive by the Elasi, and you know Starfleet does not negotiate with terrorists. As you look forward to a long captivity you wonder who will take command of the Enterprise. Better luck next time.",
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index a55809a..0db4fd9 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -138,6 +138,7 @@ enum GameStringIDs {
TX_GENER004,
TX_COMPA180,
+ TX_COMPA185,
TX_COMPA186,
TX_COMPA187,
TX_COMPA189,
@@ -3178,7 +3179,55 @@ enum GameStringIDs {
TX_VEN5N010,
+ TX_VEN6_001,
+ TX_VEN6_002,
+ TX_VEN6_003,
+ // UNUSED
+ TX_VEN6_005,
+ TX_VEN6_006,
+ TX_VEN6_007,
+ TX_VEN6_008,
+ TX_VEN6_009,
+ TX_VEN6_010,
+ TX_VEN6_011,
+ TX_VEN6_012,
+ TX_VEN6_013,
+ TX_VEN6_014,
+ TX_VEN6_015,
+ TX_VEN6_016,
+ TX_VEN6_017,
+ TX_VEN6_018,
+ TX_VEN6_019,
+ TX_VEN6_020,
+ TX_VEN6_021,
+ TX_VEN6_022,
+ TX_VEN6_023,
+ TX_VEN6N000,
+ TX_VEN6N001,
+ TX_VEN6N002,
+ TX_VEN6N003,
+ // UNUSED
+ TX_VEN6N005,
+ TX_VEN6N006,
TX_VEN6N007,
+ TX_VEN6N008,
+ TX_VEN6N009,
+ TX_VEN6N010,
+ TX_VEN6N011,
+ TX_VEN6N012,
+ TX_VEN6N013,
+ // MISSING
+ TX_VEN6N015,
+ TX_VEN6N016,
+ TX_VEN6N017,
+ TX_VEN6N018,
+ TX_VEN6N019,
+ TX_VEN6N020,
+ // UNUSED
+ TX_VEN6N022,
+ // UNUSED
+ TX_VEN6N024,
+ TX_VEN6N025,
TX_VENA_F32,
Commit: 4887ba0fd2964301a1bc4d3ea8ba5e398aba8d37
https://github.com/scummvm/scummvm/commit/4887ba0fd2964301a1bc4d3ea8ba5e398aba8d37
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: VENG6 text changes
Changed paths:
engines/startrek/text.cpp
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index c565b1f..3e9395c 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -3059,7 +3059,7 @@ extern const char *const g_gameStrings[] = {
"#VEN6\\VEN6_001#Can we re-route the power lines?",
"#VEN6\\VEN6_002#Go ahead and adjust the settings, Spock.",
"#VEN6\\VEN6_003#Spock?",
- "#VEN6\\VEN6_005#This reminds me of a poem I read when I was a child. \"I am Ozymandius, King of Kings, look ><upon my works, ye mighty, and despair.\"",
+ "#VEN6\\VEN6_005#This reminds me of a poem I read when I was a child. \"I am Ozymandius, King of Kings, look upon my works, ye mighty, and despair.\"", // TYPO
"#VEN6\\VEN6_006#Captain, the energy output of the Fusion Power pack is insufficient to power any of the major ship's systems.",
"#VEN6\\VEN6_007#Captain, this is the fusion mixture regulator for the impulse engines. There is currently no power running to it.",
"#VEN6\\VEN6_008#Remind me to compliment Mr. Scott on the efficiency of his engineering section.",
Commit: 5f1f19be506359350956a4886052060dfabc5f0c
https://github.com/scummvm/scummvm/commit/5f1f19be506359350956a4886052060dfabc5f0c
Author: Matthew Stewart (stewartmatthew6 at gmail.com)
Date: 2018-08-09T08:37:30+02:00
Commit Message:
STARTREK: VENG7
Changed paths:
engines/startrek/awaymission.h
engines/startrek/room.h
engines/startrek/rooms/veng7.cpp
engines/startrek/text.cpp
engines/startrek/text.h
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 02def65..8785979 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -684,6 +684,7 @@ struct AwayMission {
// junction box in engineering.
byte junctionCablesConnected; // 0x5d
+ bool tookCableFromTransporterRoomHallway; // 0x5e
bool tookCableFromSickbayHallway; // 0x5f
bool tookMolecularSaw; // 0x60
bool readEngineeringJournal; // 0x61
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 0bdaf7c..b6a7d5d 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2772,6 +2772,29 @@ public:
// VENG7
void veng7Tick1();
+ void veng7WalkToDoor();
+ void veng7ReachedDoor();
+ void veng7DoorOpened();
+ void veng7TouchedTurboliftDoor();
+ void veng7LookAtCollapsedSection();
+ void veng7LookAtDeadGuy();
+ void veng7LookAtDoor();
+ void veng7LookAtCable();
+ void veng7LookAtKirk();
+ void veng7LookAtSpock();
+ void veng7LookAtMccoy();
+ void veng7LookAtRedshirt();
+ void veng7LookAnywhere();
+ void veng7TalkToKirk();
+ void veng7TalkToSpock();
+ void veng7TalkToMccoy();
+ void veng7TalkToRedshirt();
+ void veng7UseSTricorderOnCollapsedSection();
+ void veng7TouchedHotspot0();
+ void veng7GetCable();
+ void veng7ReachedCable();
+ void veng7PickedUpCable();
+ // TODO: common code
// VENG8
void veng8Tick1();
diff --git a/engines/startrek/rooms/veng7.cpp b/engines/startrek/rooms/veng7.cpp
index 5d5e5a9..3ba673e 100644
--- a/engines/startrek/rooms/veng7.cpp
+++ b/engines/startrek/rooms/veng7.cpp
@@ -22,20 +22,167 @@
#include "startrek/room.h"
-#define OBJECT_DOOR 8
+#define OBJECT_CABLE 8
+#define OBJECT_DEAD_GUY 9
+#define OBJECT_DOOR 10
-#define HOTSPOT_20 0x20
+#define HOTSPOT_DOOR 0x20
+#define HOTSPOT_COLLAPSED_SECTION 0x21
namespace StarTrek {
extern const RoomAction veng7ActionList[] = {
{ {ACTION_TICK, 1, 0, 0}, &Room::veng7Tick1 },
+
+ { {ACTION_WALK, OBJECT_DOOR, 0, 0}, &Room::veng7WalkToDoor },
+ { {ACTION_WALK, HOTSPOT_DOOR, 0, 0}, &Room::veng7WalkToDoor },
+ { {ACTION_DONE_WALK, 2, 0, 0}, &Room::veng7ReachedDoor },
+ { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::veng7DoorOpened },
+ { {ACTION_TOUCHED_WARP, 1, 0, 0}, &Room::veng7TouchedTurboliftDoor },
+
+ { {ACTION_LOOK, HOTSPOT_COLLAPSED_SECTION, 0, 0}, &Room::veng7LookAtCollapsedSection },
+ { {ACTION_LOOK, OBJECT_DEAD_GUY, 0, 0}, &Room::veng7LookAtDeadGuy },
+ { {ACTION_LOOK, OBJECT_DOOR, 0, 0}, &Room::veng7LookAtDoor },
+ { {ACTION_LOOK, HOTSPOT_DOOR, 0, 0}, &Room::veng7LookAtDoor },
+ { {ACTION_LOOK, OBJECT_CABLE, 0, 0}, &Room::veng7LookAtCable },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::veng7LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::veng7LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::veng7LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::veng7LookAtRedshirt },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::veng7LookAnywhere },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::veng7TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::veng7TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::veng7TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::veng7TalkToRedshirt },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_COLLAPSED_SECTION, 0}, &Room::veng7UseSTricorderOnCollapsedSection },
+
+ { {ACTION_TOUCHED_HOTSPOT, 0, 0, 0}, &Room::veng7TouchedHotspot0 },
+ { {ACTION_GET, OBJECT_CABLE, 0, 0}, &Room::veng7GetCable },
+ { {ACTION_DONE_WALK, 3, 0, 0}, &Room::veng7ReachedCable },
+ { {ACTION_DONE_ANIM, 4, 0, 0}, &Room::veng7PickedUpCable },
+
+ // Common code
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_DEAD_GUY, 0}, &Room::vengaUseMccoyOnDeadGuy },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_DEAD_GUY, 0}, &Room::vengaUseMccoyOnDeadGuy },
+ { {ACTION_USE, OBJECT_MCCOY, OBJECT_DEAD_GUY, 0}, &Room::vengaUseMccoyOnDeadGuy },
};
extern const int veng7NumActions = ARRAYSIZE(veng7ActionList);
void Room::veng7Tick1() {
+ playVoc("VEN7LOOP");
+
+ loadActorAnim(OBJECT_DOOR, "s7r7d1c", 0x59, 0x72);
+
+ if (!_awayMission->veng.tookCableFromTransporterRoomHallway)
+ loadActorAnim(OBJECT_CABLE, "s7r7ca", 0xac, 0x8a);
+
+ loadActorAnim(OBJECT_DEAD_GUY, "s7r7c1", 0xa6, 0x49);
+}
+
+void Room::veng7WalkToDoor() {
+ walkCrewmanC(OBJECT_KIRK, 0x66, 0x76, &Room::veng7ReachedDoor);
+}
+
+void Room::veng7ReachedDoor() {
+ _awayMission->disableInput = true;
+ playSoundEffectIndex(SND_DOOR1);
+ loadActorAnimC(OBJECT_DOOR, "s7r7d1", 0x59, 0x72, &Room::veng7DoorOpened);
+}
+
+void Room::veng7DoorOpened() {
+ walkCrewman(OBJECT_KIRK, 0x5b, 0x76);
+}
+
+void Room::veng7TouchedTurboliftDoor() {
+ playSoundEffectIndex(SND_DOOR1);
+ showRepublicMap(7, 1);
+}
+
+void Room::veng7LookAtCollapsedSection() {
+ showText(TX_VEN7N001);
+}
+
+void Room::veng7LookAtDeadGuy() {
+ // ENHANCEMENT: Original played TX_VEN0N016. This is reused and boring, and there is
+ // a more interesting unused audio file, so use that instead.
+ showText(TX_VEN7N000);
+}
+
+void Room::veng7LookAtDoor() {
+ showText(TX_VEN7N007);
+}
+
+void Room::veng7LookAtCable() {
+ showText(TX_VEN7N008);
+}
+
+void Room::veng7LookAtKirk() {
+ showText(TX_VEN7N003);
+}
+
+void Room::veng7LookAtSpock() {
+ showText(TX_VEN7N005);
+}
+
+void Room::veng7LookAtMccoy() {
+ showText(TX_VEN7N004);
+}
+
+void Room::veng7LookAtRedshirt() {
+ showText(TX_VEN7N002);
+}
+
+void Room::veng7LookAnywhere() {
+ showText(TX_VEN7N006);
+}
+
+void Room::veng7TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_VEN7_001);
+}
+
+void Room::veng7TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_VEN7_005);
+}
+
+void Room::veng7TalkToMccoy() {
+ // NOTE: TX_VEN7_007 could also fit here. It might be more fitting since it's not
+ // reused. However, it mentions that McCoy gave up medical practice in Georgia. Maybe
+ // they removed this for continuity reasons or something. I don't want to be
+ // responsible for creating any possible confusion over his backstory.
+ showText(TX_SPEAKER_MCCOY, TX_VEN1_004);
+}
+
+void Room::veng7TalkToRedshirt() {
+ showText(TX_SPEAKER_KIJE, TX_VEN7_007);
+}
+
+void Room::veng7UseSTricorderOnCollapsedSection() {
+ spockScan(DIR_S, TX_VEN7_006);
+}
+
+void Room::veng7TouchedHotspot0() { // Got too close to the collapsed section
+ showText(TX_SPEAKER_SPOCK, TX_VEN7_003);
+}
+
+void Room::veng7GetCable() {
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0xac, 0x8b, &Room::veng7ReachedCable);
+}
+
+void Room::veng7ReachedCable() {
+ loadActorAnimC(OBJECT_KIRK, "kusehn", -1, -1, &Room::veng7PickedUpCable);
+ playVoc("MUR4E6");
+}
+
+void Room::veng7PickedUpCable() {
+ loadActorStandAnim(OBJECT_CABLE);
+ showText(TX_VEN7N009);
+ giveItem(OBJECT_ICABLE1);
+ _awayMission->veng.tookCableFromTransporterRoomHallway = true;
+ _awayMission->disableInput = false;
}
}
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 3e9395c..833b9e4 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -3102,6 +3102,23 @@ extern const char *const g_gameStrings[] = {
"#VEN6\\VEN6N025#This is a library of engineering technical journals.",
+ "#VEN7\\VEN7_001#I haven't seen anything this bad since I was aboard the Farragut, and this vampire cloud...",
+ "#VEN7\\VEN7_003#Captain, please be careful. The floor in that area is very unstable and might collapse from our added weight.",
+ "#VEN7\\VEN7_005#I do not see the need for conversation, Captain. Humans have an irrational enjoyment of endless discourse.",
+ "#VEN7\\VEN7_006#It appears to be a section from a coolant exhaust port. I would not recommend too close of an inspection, Captain. The floor could collapse from our added weight.",
+ "#VEN7\\VEN7_007#It does get better than this, doesn't it Captain?",
+ "#VEN7\\VEN7N000#A corpse is half-buried under the debris.",
+ "#VEN7\\VEN7N001#A large piece of equipment has fallen through the ceiling. The area looks extremely unstable. fortunately, the entry to the transporter room is near.",
+ "#VEN7\\VEN7N002#Ensign Kije.",
+ "#VEN7\\VEN7N003#James T. Kirk.",
+ "#VEN7\\VEN7N004#Leonard McCoy.",
+ "#VEN7\\VEN7N005#Mister Spock.",
+ "#VEN7\\VEN7N006#This corridor leads to the transporter room.",
+ "#VEN7\\VEN7N007#This door leads to the transporter room.",
+ "#VEN7\\VEN7N008#This is a length of heavy duty insulated power cable.",
+ "#VEN7\\VEN7N009#You pick up a length of cable.",
+
+
"#VENA\\VENA_F32#The landing party has been taken captive by the Elasi, and you know Starfleet does not negotiate with terrorists. As you look forward to a long captivity you wonder who will take command of the Enterprise. Better luck next time.",
"#VENA\\VENA_F34#Captain, it would be unwise to use your phaser considering the already extensive damage sustained by the Republic.",
"#VENA\\VENA_F40#The Elasi fire photon torpedoes. The Republic has been destroyed.",
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 0db4fd9..cf0efa0 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -3230,6 +3230,25 @@ enum GameStringIDs {
TX_VEN6N025,
+ TX_VEN7_001,
+ // UNUSED
+ TX_VEN7_003,
+ // UNUSED
+ TX_VEN7_005,
+ TX_VEN7_006,
+ TX_VEN7_007,
+ TX_VEN7N000,
+ TX_VEN7N001,
+ TX_VEN7N002,
+ TX_VEN7N003,
+ TX_VEN7N004,
+ TX_VEN7N005,
+ TX_VEN7N006,
+ TX_VEN7N007,
+ TX_VEN7N008,
+ TX_VEN7N009,
+
+
TX_VENA_F32,
TX_VENA_F34,
TX_VENA_F40,
More information about the Scummvm-git-logs
mailing list