diff options
author | Paul Gilbert | 2015-01-24 00:00:20 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-01-24 00:00:20 -0500 |
commit | 3ec43ce1cc118f1d0168f25d3d9d0c252758b629 (patch) | |
tree | ea4858ff66ae825f2191c45aa639920490112bfe | |
parent | 06b7eb220e6f7a98007f6eb011a23b04812506b1 (diff) | |
download | scummvm-rg350-3ec43ce1cc118f1d0168f25d3d9d0c252758b629.tar.gz scummvm-rg350-3ec43ce1cc118f1d0168f25d3d9d0c252758b629.tar.bz2 scummvm-rg350-3ec43ce1cc118f1d0168f25d3d9d0c252758b629.zip |
XEEN: Implement the cmdRemove and cmdMakeNothingHere script opcodes
-rw-r--r-- | engines/xeen/interface_map.h | 2 | ||||
-rw-r--r-- | engines/xeen/scripts.cpp | 34 |
2 files changed, 33 insertions, 3 deletions
diff --git a/engines/xeen/interface_map.h b/engines/xeen/interface_map.h index 914120fb2c..3ae73b76e8 100644 --- a/engines/xeen/interface_map.h +++ b/engines/xeen/interface_map.h @@ -111,7 +111,6 @@ protected: bool _flipDefaultGround; bool _isShooting; bool _charsShooting; - int _objNumber; bool _thinWall; bool _isAnimReset; int _batUIFrame; @@ -147,6 +146,7 @@ public: int _face1State; int _face2State; byte _tillMove; + int _objNumber; public: InterfaceMap(XeenEngine *vm); diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp index d59346ef7e..ffe5441b2c 100644 --- a/engines/xeen/scripts.cpp +++ b/engines/xeen/scripts.cpp @@ -315,7 +315,18 @@ void Scripts::cmdNoAction(Common::Array<byte> ¶ms) { _lineNum = _vm->_party->_partyDead ? -1 : _lineNum + 1; } -void Scripts::cmdRemove(Common::Array<byte> ¶ms) { error("TODO"); } +void Scripts::cmdRemove(Common::Array<byte> ¶ms) { + Interface &intf = *_vm->_interface; + Map &map = *_vm->_map; + + if (intf._objNumber) { + // Give the active object a completely way out of bounds position + MazeObject &obj = map._mobData._objects[intf._objNumber - 1]; + obj._position = Common::Point(128, 128); + } + + cmdMakeNothingHere(params); +} /** * Set the currently active character for other script operations @@ -545,7 +556,26 @@ void Scripts::cmdIfMapFlag(Common::Array<byte> ¶ms) { error("TODO"); } void Scripts::cmdSelRndChar(Common::Array<byte> ¶ms) { error("TODO"); } void Scripts::cmdGiveEnchanted(Common::Array<byte> ¶ms) { error("TODO"); } void Scripts::cmdItemType(Common::Array<byte> ¶ms) { error("TODO"); } -void Scripts::cmdMakeNothingHere(Common::Array<byte> ¶ms) { error("TODO"); } + +/** + * Disable all the scripts at the party's current position + */ +void Scripts::cmdMakeNothingHere(Common::Array<byte> ¶ms) { + Map &map = *_vm->_map; + Party &party = *_vm->_party; + + // Scan through the event list and mark the opcodes for all the lines of any scripts + // on the party's current cell as having no operation, effectively disabling them + for (int idx = 0; idx < map._events.size(); ++idx) { + MazeEvent &evt = map._events[idx]; + if (evt._position == party._mazePosition) + evt._opcode = OP_None; + } + + _var4F = true; + cmdExit(params); +} + void Scripts::cmdNoAction2(Common::Array<byte> ¶ms) { error("TODO"); } void Scripts::cmdChooseNumeric(Common::Array<byte> ¶ms) { error("TODO"); } void Scripts::cmdDisplayBottomTwoLines(Common::Array<byte> ¶ms) { error("TODO"); } |