diff options
author | Paul Gilbert | 2015-03-03 23:20:51 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-03-03 23:20:51 -0500 |
commit | 8101f8d03ba755dc9a71d351b10b279276a67999 (patch) | |
tree | da8926b484f0b1627c3f2159cbe5ae7deb60c1ee /engines/xeen | |
parent | 66dc9ac74645da3aec55edc85c59b73d5724ba43 (diff) | |
download | scummvm-rg350-8101f8d03ba755dc9a71d351b10b279276a67999.tar.gz scummvm-rg350-8101f8d03ba755dc9a71d351b10b279276a67999.tar.bz2 scummvm-rg350-8101f8d03ba755dc9a71d351b10b279276a67999.zip |
XEEN: More script opcodes
Diffstat (limited to 'engines/xeen')
-rw-r--r-- | engines/xeen/scripts.cpp | 77 |
1 files changed, 74 insertions, 3 deletions
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp index 7cb487c89d..1474b3ee58 100644 --- a/engines/xeen/scripts.cpp +++ b/engines/xeen/scripts.cpp @@ -1120,10 +1120,67 @@ void Scripts::cmdSelRndChar(Common::Array<byte> ¶ms) { } void Scripts::cmdGiveEnchanted(Common::Array<byte> ¶ms) { - if (params[0] < 35) { + Party &party = *_vm->_party; + bool isDarkCc = _vm->_files->_isDarkCc; + + if (params[0] >= 35) { + if (params[0] < 49) { + for (int idx = 0; idx < MAX_TREASURE_ITEMS; ++idx) { + XeenItem &item = party._treasure._armor[idx]; + if (!item.empty()) { + item._id = params[0] - 35; + item._material = params[1]; + item._bonusFlags = params[2]; + party._treasure._hasItems = true; + break; + } + } + + cmdNoAction(params); + return; + } else if (params[0] < 60) { + for (int idx = 0; idx < MAX_TREASURE_ITEMS; ++idx) { + XeenItem &item = party._treasure._accessories[idx]; + if (!item.empty()) { + item._id = params[0] - 49; + item._material = params[1]; + item._bonusFlags = params[2]; + party._treasure._hasItems = true; + break; + } + } + + cmdNoAction(params); + return; + } else if (params[0] < 82) { + for (int idx = 0; idx < MAX_TREASURE_ITEMS; ++idx) { + XeenItem &item = party._treasure._misc[idx]; + if (!item.empty()) { + item._id = params[0]; + item._material = params[1]; + item._bonusFlags = params[2]; + party._treasure._hasItems = true; + break; + } + } + cmdNoAction(params); + return; + } else { + party._gameFlags[6 + params[0]]++; + } + } + + for (int idx = 0; idx < MAX_TREASURE_ITEMS; ++idx) { + XeenItem &item = party._treasure._weapons[idx]; + if (!item.empty()) { + item._id = params[0]; + item._material = params[1]; + item._bonusFlags = params[2]; + party._treasure._hasItems = true; + break; + } } - error("TODO"); } void Scripts::cmdItemType(Common::Array<byte> ¶ms) { @@ -1161,7 +1218,21 @@ void Scripts::cmdChooseNumeric(Common::Array<byte> ¶ms) { error("TODO"); } -void Scripts::cmdDisplayBottomTwoLines(Common::Array<byte> ¶ms) { error("TODO"); } +void Scripts::cmdDisplayBottomTwoLines(Common::Array<byte> ¶ms) { + Interface &intf = *_vm->_interface; + Map &map = *_vm->_map; + Window &w = _vm->_screen->_windows[12]; + + Common::String msg = Common::String::format("\r\x03c\t000\v007%s\n\n%s", + map._events._text[params[1]].c_str()); + w.close(); + w.open(); + w.writeString(msg); + w.update(); + + YesNo::show(_vm, true); + _lineNum = -1; +} void Scripts::cmdDisplayLarge(Common::Array<byte> ¶ms) { error("TODO: Implement event text loading"); |