aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2018-03-28 20:47:25 -0400
committerPaul Gilbert2018-03-28 20:49:44 -0400
commit8c4f90893d3ab43e2b01441921a138688f8696a3 (patch)
tree9288a61d3e5641183797123e24a73d9ff288db11
parentfc8915bce04d9ce2251aafa2089dcfe3d2ad7b81 (diff)
downloadscummvm-rg350-8c4f90893d3ab43e2b01441921a138688f8696a3.tar.gz
scummvm-rg350-8c4f90893d3ab43e2b01441921a138688f8696a3.tar.bz2
scummvm-rg350-8c4f90893d3ab43e2b01441921a138688f8696a3.zip
XEEN: Add data for Swords of Xeen to create_xeen
-rw-r--r--devtools/create_xeen/cc.h4
-rw-r--r--devtools/create_xeen/constants.cpp27
-rw-r--r--devtools/create_xeen/create_xeen.cpp13
-rw-r--r--devtools/create_xeen/module.mk3
-rw-r--r--devtools/create_xeen/swords.cpp53
-rw-r--r--devtools/create_xeen/swords.h31
-rw-r--r--dists/engine-data/xeen.ccsbin43748 -> 53765 bytes
-rw-r--r--engines/xeen/debugger.cpp1
-rw-r--r--engines/xeen/map.cpp2
-rw-r--r--engines/xeen/resources.cpp4
-rw-r--r--engines/xeen/resources.h2
11 files changed, 131 insertions, 9 deletions
diff --git a/devtools/create_xeen/cc.h b/devtools/create_xeen/cc.h
index 47a5112573..3220abb89e 100644
--- a/devtools/create_xeen/cc.h
+++ b/devtools/create_xeen/cc.h
@@ -81,6 +81,10 @@ public:
loadIndex();
}
+ ~CCArchive() {
+ _file.close();
+ }
+
/**
* In write mode, finishes the CC file, writing out the resulting content
*/
diff --git a/devtools/create_xeen/constants.cpp b/devtools/create_xeen/constants.cpp
index d888886aee..084b26188a 100644
--- a/devtools/create_xeen/constants.cpp
+++ b/devtools/create_xeen/constants.cpp
@@ -1288,13 +1288,15 @@ const char *const BONUS_NAMES[7] = {
"Bug Zapper", "Monster Masher", "Beast Bopper"
};
-const char *const WEAPON_NAMES[35] = {
+const char *const WEAPON_NAMES[41] = {
nullptr, "long sword ", "short sword ", "broad sword ", "scimitar ",
"cutlass ", "sabre ", "club ", "hand axe ", "katana ", "nunchakas ",
"wakazashi ", "dagger ", "mace ", "flail ", "cudgel ", "maul ", "spear ",
"bardiche ", "glaive ", "halberd ", "pike ", "flamberge ", "trident ",
"staff ", "hammer ", "naginata ", "battle axe ", "grand axe ", "great axe ",
- "short bow ", "long bow ", "crossbow ", "sling ", "Xeen Slayer Sword"
+ "short bow ", "long bow ", "crossbow ", "sling ", "Xeen Slayer Sword",
+ "Elder LongSword", "Elder Dagger ", "Elder Mace ", "Elder Spear ",
+ "Elder Staff ", "Elder LongBow "
};
const char *const ARMOR_NAMES[14] = {
@@ -1415,6 +1417,21 @@ const char *const QUEST_ITEM_NAMES[85] = {
"Energy Disk"
};
+const char *QUEST_ITEM_NAMES_SWORDS[51] = {
+ "Pass to Hart", "Pass to Impery", "Pass to town3", "Pass to town4", "Pass to town5",
+ "Key to Hart Sewers", "Key to Rettig's Pyramid", "Key to the Old Temple",
+ "Key to Canegtut's Pyramid", "Key to Ascihep's Pyramid", "Key to Dragon Tower",
+ "Key to Darkstone Tower", "Key to Temple of Bark", "Key to Dungeon of Lost Souls",
+ "Key to Ancient Pyramid", "Key to Dungeon of Death", "Red Magic Hammer",
+ "Green Magic Hammer", "Golden Magic Wand", "Silver Magic Hammer", "Magic Coin",
+ "Ruby", "Diamond Mineral", "Emerald", "Sapphire", "Treasure Map (Goto E1 x1, y11)",
+ "NOTUSED", "Melon", "Princess Crown", "Emerald Wand", "Druid Carving", "High Sign",
+ "Holy Wheel", "Double Cross", "Sky Hook", "Sacred Cow", "Staff of the Mountain",
+ "Hard Rock", "Soft Rock", "Rock Candy", "Ivy Plant", "Spirit Gem", "Temple of Sun holy lamp oil",
+ "Noams Hammer", "Positive Orb", "Negative Orb", "FireBane Staff", "Diamond Edged Pick",
+ "Monga Melon", "Energy Disk", "Old XEEN Quest Item"
+};
+
const int WEAPON_BASE_COSTS[35] = {
0, 50, 15, 100, 80, 40, 60, 1, 10, 150, 30, 60, 8, 50,
100, 15, 30, 15, 200, 80, 250, 150, 400, 100, 40, 120,
@@ -1617,6 +1634,8 @@ const char *const SOME_CHARS_MAY_DIE = "Some Chars may die. Rest anyway?";
const char *const CANT_DISMISS_LAST_CHAR = "You cannot dismiss your last character!";
+const char *const DELETE_CHAR_WITH_ELDER_WEAPON = "\v000\t000This character has an Elder Weapon and cannot be deleted!";
+
const char *const REMOVE_DELETE[2] = { "Remove", "Delete" };
const char *const REMOVE_OR_DELETE_WHICH = "\x3l\t010\v005%s which character?";
@@ -2078,7 +2097,7 @@ void writeConstants(CCArchive &cc) {
file.syncString(ITEM_BROKEN);
file.syncString(ITEM_CURSED);
file.syncStrings(BONUS_NAMES, 7);
- file.syncStrings(WEAPON_NAMES, 35);
+ file.syncStrings(WEAPON_NAMES, 41);
file.syncStrings(ARMOR_NAMES, 14);
file.syncStrings(ACCESSORY_NAMES, 11);
file.syncStrings(MISC_NAMES, 22);
@@ -2086,6 +2105,7 @@ void writeConstants(CCArchive &cc) {
file.syncStrings(ATTRIBUTE_NAMES, 10);
file.syncStrings(EFFECTIVENESS_NAMES, 7);
file.syncStrings(QUEST_ITEM_NAMES, 85);
+ file.syncStrings(QUEST_ITEM_NAMES_SWORDS, 51);
file.syncNumbers((const int *)WEAPON_BASE_COSTS, 35);
file.syncNumbers((const int *)ARMOR_BASE_COSTS, 14);
file.syncNumbers((const int *)ACCESSORY_BASE_COSTS, 11);
@@ -2152,6 +2172,7 @@ void writeConstants(CCArchive &cc) {
file.syncString(TOO_DANGEROUS_TO_REST);
file.syncString(SOME_CHARS_MAY_DIE);
file.syncString(CANT_DISMISS_LAST_CHAR);
+ file.syncString(DELETE_CHAR_WITH_ELDER_WEAPON);
file.syncStrings(REMOVE_DELETE, 2);
file.syncString(REMOVE_OR_DELETE_WHICH);
file.syncString(YOUR_PARTY_IS_FULL);
diff --git a/devtools/create_xeen/create_xeen.cpp b/devtools/create_xeen/create_xeen.cpp
index 5b66870be4..d579fc2665 100644
--- a/devtools/create_xeen/create_xeen.cpp
+++ b/devtools/create_xeen/create_xeen.cpp
@@ -35,6 +35,7 @@
#include "cc.h"
#include "file.h"
#include "clouds.h"
+#include "swords.h"
#include "constants.h"
#include "map.h"
@@ -54,7 +55,12 @@ void writeVersion(CCArchive &cc) {
}
int main(int argc, char *argv[]) {
- if (!outputFile.open(argc == 1 ? "xeen.ccs" : argv[1], Common::kFileWriteMode)) {
+ if (argc != 3) {
+ printf("Format: %s dark.cc \"swords xeen.dat\"\n", argv[0]);
+ exit(0);
+ }
+
+ if (!outputFile.open("xeen.ccs", Common::kFileWriteMode)) {
error("Could not open input file");
}
@@ -63,9 +69,12 @@ int main(int argc, char *argv[]) {
writeConstants(cc);
writeMap(cc);
- const char *darkName = argc > 2 ? argv[2] : "dark.cc";
+ const char *darkName = argv[1];
writeCloudsData(cc, darkName);
+ const char *swordsDatName = argv[2];
+ writeSwordsData(cc, swordsDatName);
+
cc.close();
return 0;
}
diff --git a/devtools/create_xeen/module.mk b/devtools/create_xeen/module.mk
index 29f2f3027f..eabd739b4f 100644
--- a/devtools/create_xeen/module.mk
+++ b/devtools/create_xeen/module.mk
@@ -8,7 +8,8 @@ MODULE_OBJS := \
hashmap.o \
map.o \
memorypool.o \
- str.o
+ str.o \
+ swords.o
# Set the name of the executable
TOOL_EXECUTABLE := create_xeen
diff --git a/devtools/create_xeen/swords.cpp b/devtools/create_xeen/swords.cpp
new file mode 100644
index 0000000000..838bfc87e6
--- /dev/null
+++ b/devtools/create_xeen/swords.cpp
@@ -0,0 +1,53 @@
+/* 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.
+ *
+ */
+
+ // Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+// HACK to allow building with the SDL backend on MinGW
+// see bug #1800764 "TOOLS: MinGW tools building broken"
+#ifdef main
+#undef main
+#endif // main
+
+#include "file.h"
+#include "swords.h"
+
+#define MONSTERS_COUNT 150
+
+void writeSwordsData(CCArchive &cc, const char *swordsDatName) {
+ Common::File f;
+ Common::MemFile monsters;
+ byte buffer[MONSTERS_COUNT * 60];
+
+ if (!f.open(swordsDatName, Common::kFileReadMode))
+ error("Could not open Swords xeen.dat");
+
+ f.seek(0x44200);
+ f.read(buffer, MONSTERS_COUNT * 60);
+
+ if (strcmp((const char *)buffer + 0x33, "Slime"))
+ error("Invalid Swords xeen.dat");
+
+ monsters.write(buffer, MONSTERS_COUNT * 60);
+ cc.add("monsters.swd", monsters);
+}
diff --git a/devtools/create_xeen/swords.h b/devtools/create_xeen/swords.h
new file mode 100644
index 0000000000..105b30b44e
--- /dev/null
+++ b/devtools/create_xeen/swords.h
@@ -0,0 +1,31 @@
+/* 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 SWORDS_H
+#define SWORDS_H
+
+#include "common/scummsys.h"
+#include "cc.h"
+
+extern void writeSwordsData(CCArchive &cc, const char *swordsDatName);
+
+#endif
diff --git a/dists/engine-data/xeen.ccs b/dists/engine-data/xeen.ccs
index 767b7ed5ed..124b45df55 100644
--- a/dists/engine-data/xeen.ccs
+++ b/dists/engine-data/xeen.ccs
Binary files differ
diff --git a/engines/xeen/debugger.cpp b/engines/xeen/debugger.cpp
index 4fbef4fa15..fed030780c 100644
--- a/engines/xeen/debugger.cpp
+++ b/engines/xeen/debugger.cpp
@@ -160,7 +160,6 @@ bool Debugger::cmdGems(int argc, const char **argv) {
}
bool Debugger::cmdMap(int argc, const char **argv) {
- FileManager &files = *g_vm->_files;
Map &map = *g_vm->_map;
Party &party = *g_vm->_party;
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index ca17ba04aa..06c1592ed3 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -653,7 +653,7 @@ void Map::load(int mapId) {
if (_vm->getGameID() == GType_Swords || _vm->getGameID() == GType_DarkSide) {
_animationInfo.load("dark.dat");
- _monsterData.load("dark.mon");
+ _monsterData.load((_vm->getGameID() == GType_Swords) ? "monsters.swd" : "dark.mon");
_wallPicSprites.load("darkpic.dat");
} else if (_vm->getGameID() == GType_Clouds) {
_animationInfo.load("animinfo.cld");
diff --git a/engines/xeen/resources.cpp b/engines/xeen/resources.cpp
index e23920183f..df7545976e 100644
--- a/engines/xeen/resources.cpp
+++ b/engines/xeen/resources.cpp
@@ -250,7 +250,7 @@ void Resources::loadData() {
file.syncString(ITEM_BROKEN);
file.syncString(ITEM_CURSED);
file.syncStrings(BONUS_NAMES, 7);
- file.syncStrings(WEAPON_NAMES, 35);
+ file.syncStrings(WEAPON_NAMES, 41);
file.syncStrings(ARMOR_NAMES, 14);
file.syncStrings(ACCESSORY_NAMES, 11);
file.syncStrings(MISC_NAMES, 22);
@@ -258,6 +258,7 @@ void Resources::loadData() {
file.syncStrings(ATTRIBUTE_NAMES, 10);
file.syncStrings(EFFECTIVENESS_NAMES, 7);
file.syncStrings(QUEST_ITEM_NAMES, 85);
+ file.syncStrings(QUEST_ITEM_NAMES_SWORDS, 51);
file.syncNumbers((int *)WEAPON_BASE_COSTS, 35);
file.syncNumbers((int *)ARMOR_BASE_COSTS, 14);
file.syncNumbers((int *)ACCESSORY_BASE_COSTS, 11);
@@ -324,6 +325,7 @@ void Resources::loadData() {
file.syncString(TOO_DANGEROUS_TO_REST);
file.syncString(SOME_CHARS_MAY_DIE);
file.syncString(CANT_DISMISS_LAST_CHAR);
+ file.syncString(DELETE_CHAR_WITH_ELDER_WEAPON);
file.syncStrings(REMOVE_DELETE, 2);
file.syncString(REMOVE_OR_DELETE_WHICH);
file.syncString(YOUR_PARTY_IS_FULL);
diff --git a/engines/xeen/resources.h b/engines/xeen/resources.h
index 782dc3bd05..d47bc4da45 100644
--- a/engines/xeen/resources.h
+++ b/engines/xeen/resources.h
@@ -313,6 +313,7 @@ public:
const char *ATTRIBUTE_NAMES[10];
const char *EFFECTIVENESS_NAMES[7];
const char *QUEST_ITEM_NAMES[85];
+ const char *QUEST_ITEM_NAMES_SWORDS[51];
int WEAPON_BASE_COSTS[35];
int ARMOR_BASE_COSTS[14];
int ACCESSORY_BASE_COSTS[11];
@@ -379,6 +380,7 @@ public:
const char *TOO_DANGEROUS_TO_REST;
const char *SOME_CHARS_MAY_DIE;
const char *CANT_DISMISS_LAST_CHAR;
+ const char *DELETE_CHAR_WITH_ELDER_WEAPON;
const char *REMOVE_DELETE[2];
const char *REMOVE_OR_DELETE_WHICH;
const char *YOUR_PARTY_IS_FULL;