From 82abdab69566abb26996bb399d629ec1b0d10de5 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Fri, 14 Apr 2017 00:24:29 -0400 Subject: [PATCH] Major code reorganization This commit only updates the XCode project for the changes. A later commit each will update it for scons and MSVC. A few actual changes are mixed in: - Add a prefix header for a handful of common definitions - Moved current_cursor into the Cursor class as a static member - Removed the make_cursor_sword and make_cursor_watch functions - Include tests in the All target - Remove redundant -l flags for Common and Common-Party (since they're included in the Link phases anyway) --- .gitignore | 2 +- src/BoE.xcodeproj/project.pbxproj | 394 +++--- src/alchemy.hpp | 36 + src/classes/monster.hpp | 178 --- src/classes/simpletypes.hpp | 1133 ----------------- src/classes/special.hpp | 76 -- src/classes/spell.hpp | 53 - src/damage.hpp | 122 ++ src/dialogxml/{ => dialogs}/3choice.cpp | 0 src/dialogxml/{ => dialogs}/3choice.hpp | 0 src/dialogxml/{ => dialogs}/choicedlog.cpp | 0 src/dialogxml/{ => dialogs}/choicedlog.hpp | 0 src/dialogxml/{ => dialogs}/dialog.cpp | 10 +- src/dialogxml/{ => dialogs}/dialog.hpp | 0 src/dialogxml/{ => dialogs}/dialog.keys.hpp | 0 src/dialogxml/{ => dialogs}/dlogevt.hpp | 0 src/dialogxml/{ => dialogs}/pictchoice.cpp | 0 src/dialogxml/{ => dialogs}/pictchoice.hpp | 0 src/dialogxml/{ => dialogs}/strchoice.cpp | 0 src/dialogxml/{ => dialogs}/strchoice.hpp | 0 src/dialogxml/{ => dialogs}/strdlog.cpp | 0 src/dialogxml/{ => dialogs}/strdlog.hpp | 2 +- src/dialogxml/{ => widgets}/basicbtns.cpp | 0 src/dialogxml/{ => widgets}/button.cpp | 2 +- src/dialogxml/{ => widgets}/button.hpp | 0 src/dialogxml/{ => widgets}/control.cpp | 5 +- src/dialogxml/{ => widgets}/control.hpp | 0 src/dialogxml/{ => widgets}/field.cpp | 0 src/dialogxml/{ => widgets}/field.hpp | 0 src/dialogxml/{ => widgets}/message.cpp | 0 src/dialogxml/{ => widgets}/message.hpp | 0 src/dialogxml/{ => widgets}/pict.cpp | 2 +- src/dialogxml/{ => widgets}/pict.hpp | 0 src/dialogxml/{ => widgets}/pictypes.hpp | 0 src/dialogxml/{ => widgets}/scrollbar.cpp | 3 +- src/dialogxml/{ => widgets}/scrollbar.hpp | 0 src/dialogxml/{ => widgets}/scrollpane.cpp | 0 src/dialogxml/{ => widgets}/scrollpane.hpp | 0 src/dialogxml/{ => widgets}/stack.cpp | 0 src/dialogxml/{ => widgets}/stack.hpp | 0 src/fields.hpp | 103 ++ src/{classes => fileio}/estreams.cpp | 29 +- src/{tools => fileio}/fileio.cpp | 18 +- src/{tools => fileio}/fileio.hpp | 2 - src/{tools => fileio}/fileio_party.cpp | 0 src/{tools => fileio}/fileio_scen.cpp | 5 +- src/{tools => fileio}/gzstream/COPYING.LIB | 0 src/{tools => fileio}/gzstream/Makefile | 0 src/{tools => fileio}/gzstream/README | 0 src/{tools => fileio}/gzstream/gzstream.cpp | 0 src/{tools => fileio}/gzstream/gzstream.h | 0 src/{tools => fileio}/gzstream/index.html | 0 .../gzstream/test_gunzip.cpp | 0 src/{tools => fileio}/gzstream/test_gzip.cpp | 0 src/{tools => fileio}/gzstream/version | 0 src/{tools => fileio}/map_parse.cpp | 0 src/{tools => fileio}/map_parse.hpp | 0 .../resmgr/res_cursor.hpp} | 61 +- src/fileio/resmgr/res_font.hpp | 31 + src/fileio/resmgr/res_image.hpp | 31 + src/fileio/resmgr/res_sound.hpp | 31 + src/fileio/resmgr/res_strings.hpp | 41 + src/{tools => fileio}/resmgr/resmgr.hpp | 1 - src/{tools => fileio}/resmgr/restypes.cpp | 6 +- .../special_parse.cpp} | 0 src/{tools => fileio}/special_parse.hpp | 0 src/{tools => fileio}/tarball.cpp | 0 src/{tools => fileio}/tarball.hpp | 0 .../xml-parser/build_instructions.txt | 0 .../xml-parser/changes.txt | 0 src/{dialogxml => fileio}/xml-parser/dox | 0 .../xml-parser/readme.txt | 0 .../xml-parser/ticpp.cpp | 0 src/{dialogxml => fileio}/xml-parser/ticpp.h | 0 .../xml-parser/ticpp.lua | 0 .../xml-parser/ticppapi.h | 0 .../xml-parser/ticpprc.h | 0 .../xml-parser/tinyprint.cpp | 0 .../xml-parser/tinyprint.h | 0 .../xml-parser/tinystr.cpp | 0 .../xml-parser/tinystr.h | 0 .../xml-parser/tinyxml.cpp | 0 .../xml-parser/tinyxml.h | 0 .../xml-parser/tinyxmlerror.cpp | 0 .../xml-parser/tinyxmlparser.cpp | 0 .../xml-parser/tutorial_gettingStarted.txt | 0 .../xml-parser/tutorial_ticpp.txt | 0 src/{ => game}/boe.actions.cpp | 6 +- src/{ => game}/boe.actions.hpp | 1 - src/{ => game}/boe.appleevents.mm | 0 src/{ => game}/boe.combat.cpp | 2 +- src/{ => game}/boe.combat.hpp | 0 src/{ => game}/boe.consts.hpp | 0 src/{ => game}/boe.dlgutil.cpp | 18 +- src/{ => game}/boe.dlgutil.hpp | 1 - src/{ => game}/boe.fileio.cpp | 14 +- src/{ => game}/boe.fileio.hpp | 5 +- src/{ => game}/boe.global.hpp | 0 src/{ => game}/boe.graphics.cpp | 4 +- src/{ => game}/boe.graphics.hpp | 1 - src/{ => game}/boe.graphutil.cpp | 4 +- src/{ => game}/boe.graphutil.hpp | 1 - src/{ => game}/boe.infodlg.cpp | 22 +- src/{ => game}/boe.infodlg.hpp | 1 - src/{ => game}/boe.items.cpp | 20 +- src/{ => game}/boe.items.hpp | 1 - src/{ => game}/boe.locutils.cpp | 0 src/{ => game}/boe.locutils.hpp | 0 src/{ => game}/boe.main.cpp | 13 +- src/{ => game}/boe.main.hpp | 0 src/{ => game}/boe.menus.hpp | 0 src/{ => game}/boe.menus.mac.mm | 0 src/{ => game}/boe.menus.win.cpp | 0 src/{ => game}/boe.monster.cpp | 2 +- src/{ => game}/boe.monster.hpp | 0 src/{ => game}/boe.newgraph.cpp | 4 +- src/{ => game}/boe.newgraph.hpp | 0 src/{ => game}/boe.party.cpp | 17 +- src/{ => game}/boe.party.hpp | 0 src/{ => game}/boe.specials.cpp | 2 +- src/{ => game}/boe.specials.hpp | 0 src/{ => game}/boe.startup.cpp | 9 +- src/{ => game}/boe.text.cpp | 8 +- src/{ => game}/boe.text.hpp | 1 - src/{ => game}/boe.town.cpp | 4 +- src/{ => game}/boe.town.hpp | 0 src/{ => game}/boe.townspec.cpp | 2 +- src/{ => game}/boe.townspec.hpp | 0 src/{tools => gfx}/graphtool.cpp | 5 +- src/{tools => gfx}/graphtool.hpp | 2 - src/{tools => gfx}/mask.frag | 0 src/{tools => gfx}/mask.vert | 0 src/{tools => gfx}/qdpict.mac.cpp | 2 - src/global.hpp | 27 + src/{classes => }/location.cpp | 5 + src/{classes => }/location.hpp | 16 + src/{tools => }/mathutil.cpp | 0 src/{tools => }/mathutil.hpp | 2 +- src/pcedit/pc.action.cpp | 9 +- src/pcedit/pc.editors.cpp | 9 +- src/pcedit/pc.fileio.cpp | 3 +- src/pcedit/pc.graphics.cpp | 9 +- src/pcedit/pc.graphics.hpp | 1 - src/pcedit/pc.main.cpp | 4 +- src/{tools => }/porting.cpp | 0 src/{tools => }/porting.hpp | 0 src/race.hpp | 53 + src/{classes => scenario}/area.hpp | 0 src/{classes => scenario}/item.cpp | 5 +- src/{classes => scenario}/item.hpp | 5 +- src/scenario/item_abilities.hpp | 114 ++ src/scenario/item_variety.hpp | 65 + src/{classes => scenario}/monster.cpp | 0 src/scenario/monster.hpp | 108 ++ src/scenario/monster_abilities.hpp | 129 ++ src/{classes => scenario}/outdoors.cpp | 0 src/{classes => scenario}/outdoors.hpp | 1 - src/scenario/quest.hpp | 25 + src/{classes => scenario}/scenario.cpp | 0 src/{classes => scenario}/scenario.hpp | 14 +- src/{classes => scenario}/shop.cpp | 0 src/{classes => scenario}/shop.hpp | 29 + src/{classes => scenario}/special.cpp | 24 + src/scenario/special.hpp | 140 ++ src/{classes => scenario}/talking.cpp | 0 src/{classes => scenario}/talking.hpp | 32 +- src/{classes => scenario}/terrain.cpp | 1 + src/{classes => scenario}/terrain.hpp | 3 +- src/scenario/terrain_abilities.hpp | 89 ++ src/{classes => scenario}/town.cpp | 0 src/{classes => scenario}/town.hpp | 8 +- src/{classes => scenario}/town_import.tpp | 0 src/{classes => scenario}/vehicle.cpp | 0 src/{classes => scenario}/vehicle.hpp | 0 src/scenedit/scen.actions.cpp | 2 +- src/scenedit/scen.core.cpp | 5 +- src/scenedit/scen.fileio.cpp | 2 +- src/scenedit/scen.graphics.cpp | 5 +- src/scenedit/scen.graphics.hpp | 2 +- src/scenedit/scen.keydlgs.cpp | 6 +- src/scenedit/scen.keydlgs.hpp | 1 - src/scenedit/scen.main.cpp | 4 +- src/skills_traits.hpp | 63 + src/{tools/soundtool.cpp => sounds.cpp} | 4 +- src/{tools/soundtool.hpp => sounds.hpp} | 0 src/{classes => }/spell.cpp | 0 src/spell.hpp | 102 ++ src/tools/cursors.hpp | 9 +- src/tools/cursors.mac.mm | 8 +- src/tools/prefs.win.cpp | 1 - src/tools/winutil.hpp | 2 - src/{classes => universe}/creature.cpp | 0 src/{classes => universe}/creature.hpp | 1 - src/{classes => universe}/living.cpp | 0 src/{classes => universe}/living.hpp | 2 +- src/{classes => universe}/party.cpp | 0 src/{classes => universe}/party.hpp | 9 +- src/{classes => universe}/pc.cpp | 0 src/{classes => universe}/pc.hpp | 4 +- .../creatlist.cpp => universe/population.cpp} | 2 +- .../creatlist.hpp => universe/population.hpp} | 0 src/{classes => universe}/universe.cpp | 0 src/{classes => universe}/universe.hpp | 5 +- src/{tools => }/view_dialogs.cpp | 0 src/{tools => }/view_dialogs.hpp | 0 test/init.cpp | 2 +- test/item_legacy.cpp | 2 + test/scen_read.cpp | 2 +- test/scen_write.cpp | 2 +- test/spec_legacy.cpp | 9 +- test/ter_legacy.cpp | 1 + 211 files changed, 1855 insertions(+), 1881 deletions(-) create mode 100644 src/alchemy.hpp delete mode 100644 src/classes/monster.hpp delete mode 100644 src/classes/simpletypes.hpp delete mode 100644 src/classes/special.hpp delete mode 100644 src/classes/spell.hpp create mode 100644 src/damage.hpp rename src/dialogxml/{ => dialogs}/3choice.cpp (100%) rename src/dialogxml/{ => dialogs}/3choice.hpp (100%) rename src/dialogxml/{ => dialogs}/choicedlog.cpp (100%) rename src/dialogxml/{ => dialogs}/choicedlog.hpp (100%) rename src/dialogxml/{ => dialogs}/dialog.cpp (99%) rename src/dialogxml/{ => dialogs}/dialog.hpp (100%) rename src/dialogxml/{ => dialogs}/dialog.keys.hpp (100%) rename src/dialogxml/{ => dialogs}/dlogevt.hpp (100%) rename src/dialogxml/{ => dialogs}/pictchoice.cpp (100%) rename src/dialogxml/{ => dialogs}/pictchoice.hpp (100%) rename src/dialogxml/{ => dialogs}/strchoice.cpp (100%) rename src/dialogxml/{ => dialogs}/strchoice.hpp (100%) rename src/dialogxml/{ => dialogs}/strdlog.cpp (100%) rename src/dialogxml/{ => dialogs}/strdlog.hpp (98%) rename src/dialogxml/{ => widgets}/basicbtns.cpp (100%) rename src/dialogxml/{ => widgets}/button.cpp (99%) rename src/dialogxml/{ => widgets}/button.hpp (100%) rename src/dialogxml/{ => widgets}/control.cpp (99%) rename src/dialogxml/{ => widgets}/control.hpp (100%) rename src/dialogxml/{ => widgets}/field.cpp (100%) rename src/dialogxml/{ => widgets}/field.hpp (100%) rename src/dialogxml/{ => widgets}/message.cpp (100%) rename src/dialogxml/{ => widgets}/message.hpp (100%) rename src/dialogxml/{ => widgets}/pict.cpp (99%) rename src/dialogxml/{ => widgets}/pict.hpp (100%) rename src/dialogxml/{ => widgets}/pictypes.hpp (100%) rename src/dialogxml/{ => widgets}/scrollbar.cpp (99%) rename src/dialogxml/{ => widgets}/scrollbar.hpp (100%) rename src/dialogxml/{ => widgets}/scrollpane.cpp (100%) rename src/dialogxml/{ => widgets}/scrollpane.hpp (100%) rename src/dialogxml/{ => widgets}/stack.cpp (100%) rename src/dialogxml/{ => widgets}/stack.hpp (100%) create mode 100644 src/fields.hpp rename src/{classes => fileio}/estreams.cpp (96%) rename src/{tools => fileio}/fileio.cpp (93%) rename src/{tools => fileio}/fileio.hpp (97%) rename src/{tools => fileio}/fileio_party.cpp (100%) rename src/{tools => fileio}/fileio_scen.cpp (99%) rename src/{tools => fileio}/gzstream/COPYING.LIB (100%) rename src/{tools => fileio}/gzstream/Makefile (100%) rename src/{tools => fileio}/gzstream/README (100%) rename src/{tools => fileio}/gzstream/gzstream.cpp (100%) rename src/{tools => fileio}/gzstream/gzstream.h (100%) rename src/{tools => fileio}/gzstream/index.html (100%) rename src/{tools => fileio}/gzstream/test_gunzip.cpp (100%) rename src/{tools => fileio}/gzstream/test_gzip.cpp (100%) rename src/{tools => fileio}/gzstream/version (100%) rename src/{tools => fileio}/map_parse.cpp (100%) rename src/{tools => fileio}/map_parse.hpp (100%) rename src/{tools/resmgr/restypes.hpp => fileio/resmgr/res_cursor.hpp} (53%) create mode 100644 src/fileio/resmgr/res_font.hpp create mode 100644 src/fileio/resmgr/res_image.hpp create mode 100644 src/fileio/resmgr/res_sound.hpp create mode 100644 src/fileio/resmgr/res_strings.hpp rename src/{tools => fileio}/resmgr/resmgr.hpp (99%) rename src/{tools => fileio}/resmgr/restypes.cpp (78%) rename src/{tools/specials_parse.cpp => fileio/special_parse.cpp} (100%) rename src/{tools => fileio}/special_parse.hpp (100%) rename src/{tools => fileio}/tarball.cpp (100%) rename src/{tools => fileio}/tarball.hpp (100%) rename src/{dialogxml => fileio}/xml-parser/build_instructions.txt (100%) rename src/{dialogxml => fileio}/xml-parser/changes.txt (100%) rename src/{dialogxml => fileio}/xml-parser/dox (100%) rename src/{dialogxml => fileio}/xml-parser/readme.txt (100%) rename src/{dialogxml => fileio}/xml-parser/ticpp.cpp (100%) rename src/{dialogxml => fileio}/xml-parser/ticpp.h (100%) rename src/{dialogxml => fileio}/xml-parser/ticpp.lua (100%) rename src/{dialogxml => fileio}/xml-parser/ticppapi.h (100%) rename src/{dialogxml => fileio}/xml-parser/ticpprc.h (100%) rename src/{dialogxml => fileio}/xml-parser/tinyprint.cpp (100%) rename src/{dialogxml => fileio}/xml-parser/tinyprint.h (100%) rename src/{dialogxml => fileio}/xml-parser/tinystr.cpp (100%) rename src/{dialogxml => fileio}/xml-parser/tinystr.h (100%) rename src/{dialogxml => fileio}/xml-parser/tinyxml.cpp (100%) rename src/{dialogxml => fileio}/xml-parser/tinyxml.h (100%) rename src/{dialogxml => fileio}/xml-parser/tinyxmlerror.cpp (100%) rename src/{dialogxml => fileio}/xml-parser/tinyxmlparser.cpp (100%) rename src/{dialogxml => fileio}/xml-parser/tutorial_gettingStarted.txt (100%) rename src/{dialogxml => fileio}/xml-parser/tutorial_ticpp.txt (100%) rename src/{ => game}/boe.actions.cpp (99%) rename src/{ => game}/boe.actions.hpp (97%) rename src/{ => game}/boe.appleevents.mm (100%) rename src/{ => game}/boe.combat.cpp (99%) rename src/{ => game}/boe.combat.hpp (100%) rename src/{ => game}/boe.consts.hpp (100%) rename src/{ => game}/boe.dlgutil.cpp (99%) rename src/{ => game}/boe.dlgutil.hpp (97%) rename src/{ => game}/boe.fileio.cpp (98%) rename src/{ => game}/boe.fileio.hpp (87%) rename src/{ => game}/boe.global.hpp (100%) rename src/{ => game}/boe.graphics.cpp (99%) rename src/{ => game}/boe.graphics.hpp (98%) rename src/{ => game}/boe.graphutil.cpp (99%) rename src/{ => game}/boe.graphutil.hpp (97%) rename src/{ => game}/boe.infodlg.cpp (98%) rename src/{ => game}/boe.infodlg.hpp (98%) rename src/{ => game}/boe.items.cpp (99%) rename src/{ => game}/boe.items.hpp (98%) rename src/{ => game}/boe.locutils.cpp (100%) rename src/{ => game}/boe.locutils.hpp (100%) rename src/{ => game}/boe.main.cpp (98%) rename src/{ => game}/boe.main.hpp (100%) rename src/{ => game}/boe.menus.hpp (100%) rename src/{ => game}/boe.menus.mac.mm (100%) rename src/{ => game}/boe.menus.win.cpp (100%) rename src/{ => game}/boe.monster.cpp (99%) rename src/{ => game}/boe.monster.hpp (100%) rename src/{ => game}/boe.newgraph.cpp (99%) rename src/{ => game}/boe.newgraph.hpp (100%) rename src/{ => game}/boe.party.cpp (99%) rename src/{ => game}/boe.party.hpp (100%) rename src/{ => game}/boe.specials.cpp (99%) rename src/{ => game}/boe.specials.hpp (100%) rename src/{ => game}/boe.startup.cpp (97%) rename src/{ => game}/boe.text.cpp (99%) rename src/{ => game}/boe.text.hpp (98%) rename src/{ => game}/boe.town.cpp (99%) rename src/{ => game}/boe.town.hpp (100%) rename src/{ => game}/boe.townspec.cpp (99%) rename src/{ => game}/boe.townspec.hpp (100%) rename src/{tools => gfx}/graphtool.cpp (99%) rename src/{tools => gfx}/graphtool.hpp (99%) rename src/{tools => gfx}/mask.frag (100%) rename src/{tools => gfx}/mask.vert (100%) rename src/{tools => gfx}/qdpict.mac.cpp (99%) create mode 100644 src/global.hpp rename src/{classes => }/location.cpp (97%) rename src/{classes => }/location.hpp (94%) rename src/{tools => }/mathutil.cpp (100%) rename src/{tools => }/mathutil.hpp (95%) rename src/{tools => }/porting.cpp (100%) rename src/{tools => }/porting.hpp (100%) create mode 100644 src/race.hpp rename src/{classes => scenario}/area.hpp (100%) rename src/{classes => scenario}/item.cpp (99%) rename src/{classes => scenario}/item.hpp (94%) create mode 100644 src/scenario/item_abilities.hpp create mode 100644 src/scenario/item_variety.hpp rename src/{classes => scenario}/monster.cpp (100%) create mode 100644 src/scenario/monster.hpp create mode 100644 src/scenario/monster_abilities.hpp rename src/{classes => scenario}/outdoors.cpp (100%) rename src/{classes => scenario}/outdoors.hpp (98%) create mode 100644 src/scenario/quest.hpp rename src/{classes => scenario}/scenario.cpp (100%) rename src/{classes => scenario}/scenario.hpp (86%) rename src/{classes => scenario}/shop.cpp (100%) rename src/{classes => scenario}/shop.hpp (76%) rename src/{classes => scenario}/special.cpp (97%) create mode 100644 src/scenario/special.hpp rename src/{classes => scenario}/talking.cpp (100%) rename src/{classes => scenario}/talking.hpp (69%) rename src/{classes => scenario}/terrain.cpp (99%) rename src/{classes => scenario}/terrain.hpp (96%) create mode 100644 src/scenario/terrain_abilities.hpp rename src/{classes => scenario}/town.cpp (100%) rename src/{classes => scenario}/town.hpp (96%) rename src/{classes => scenario}/town_import.tpp (100%) rename src/{classes => scenario}/vehicle.cpp (100%) rename src/{classes => scenario}/vehicle.hpp (100%) create mode 100644 src/skills_traits.hpp rename src/{tools/soundtool.cpp => sounds.cpp} (97%) rename src/{tools/soundtool.hpp => sounds.hpp} (100%) rename src/{classes => }/spell.cpp (100%) create mode 100644 src/spell.hpp rename src/{classes => universe}/creature.cpp (100%) rename src/{classes => universe}/creature.hpp (98%) rename src/{classes => universe}/living.cpp (100%) rename src/{classes => universe}/living.hpp (98%) rename src/{classes => universe}/party.cpp (100%) rename src/{classes => universe}/party.hpp (98%) rename src/{classes => universe}/pc.cpp (100%) rename src/{classes => universe}/pc.hpp (98%) rename src/{classes/creatlist.cpp => universe/population.cpp} (98%) rename src/{classes/creatlist.hpp => universe/population.hpp} (100%) rename src/{classes => universe}/universe.cpp (100%) rename src/{classes => universe}/universe.hpp (98%) rename src/{tools => }/view_dialogs.cpp (100%) rename src/{tools => }/view_dialogs.hpp (100%) diff --git a/.gitignore b/.gitignore index 490a50b7..0b3c6f94 100644 --- a/.gitignore +++ b/.gitignore @@ -61,7 +61,7 @@ pkg/win/data.nsi # Shader Builder projects # It's an sqlite3 database and not particularly important, so exclude it -src/tools/*.sbproj +*.sbproj # Doxygen stuff src/doxy/html/ diff --git a/src/BoE.xcodeproj/project.pbxproj b/src/BoE.xcodeproj/project.pbxproj index 5425b88a..3314034a 100755 --- a/src/BoE.xcodeproj/project.pbxproj +++ b/src/BoE.xcodeproj/project.pbxproj @@ -31,6 +31,7 @@ 91EBE9DE0F9A33A6002356F2 /* PBXTargetDependency */, 91EBE9E00F9A33A8002356F2 /* PBXTargetDependency */, 91EBE9E20F9A33AC002356F2 /* PBXTargetDependency */, + 9185BDAA1EA06A150027C346 /* PBXTargetDependency */, ); name = All; productName = All; @@ -137,7 +138,7 @@ 919B13A21BBCDF14009905A4 /* monst_legacy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 919B13A11BBCDE18009905A4 /* monst_legacy.cpp */; }; 919B13A41BBD8854009905A4 /* item_legacy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 919B13A31BBD8849009905A4 /* item_legacy.cpp */; }; 919B13A61BBDE986009905A4 /* spec_legacy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 919B13A51BBDE985009905A4 /* spec_legacy.cpp */; }; - 919CC2481B3772F300273FDA /* creatlist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91AC620A0FA2853700EEAE67 /* creatlist.cpp */; }; + 919CC2481B3772F300273FDA /* population.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91AC620A0FA2853700EEAE67 /* population.cpp */; }; 919CC2491B3772FB00273FDA /* creature.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 914698FE1A747C4500F20F5E /* creature.cpp */; }; 919CC24B1B37730300273FDA /* item.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91279D3D0F9D1D6A007B0D52 /* item.cpp */; }; 919CC24C1B37730900273FDA /* living.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 914698FB1A7362D900F20F5E /* living.cpp */; }; @@ -181,8 +182,8 @@ 919CC2781B37741A00273FDA /* porting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 913D005A0F9FEEC200184C18 /* porting.cpp */; }; 919CC2791B37742200273FDA /* prefs.mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 91EC481018FBABB100BB1E86 /* prefs.mac.mm */; }; 919CC27A1B37742800273FDA /* qdpict.mac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91F6F8F518F8DE6300E3EA15 /* qdpict.mac.cpp */; }; - 919CC27B1B37742D00273FDA /* soundtool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B3F10F0F9779D000BF5B67 /* soundtool.cpp */; }; - 919CC27C1B37743200273FDA /* specials_parse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 915325181A2E37EE000A9A1C /* specials_parse.cpp */; }; + 919CC27B1B37742D00273FDA /* sounds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B3F10F0F9779D000BF5B67 /* sounds.cpp */; }; + 919CC27C1B37743200273FDA /* special_parse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 915325181A2E37EE000A9A1C /* special_parse.cpp */; }; 919CC27D1B37743700273FDA /* tarball.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91BFA3D81902AD78001686E4 /* tarball.cpp */; }; 919CC27E1B37743B00273FDA /* undo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 912283C80FD0E16C00B21642 /* undo.cpp */; }; 919CC27F1B37744000273FDA /* winutil.mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 919145FF18E63B70005CF3A4 /* winutil.mac.mm */; }; @@ -354,6 +355,13 @@ remoteGlobalIDString = 919CC22C1B37721400273FDA; remoteInfo = "Common-Party"; }; + 9185BDA91EA06A150027C346 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 2BF04AA10BF51845006C0831 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 91CC172C1B421C0A003D9A69; + remoteInfo = boe_test; + }; 91BC33931B4390E40008882C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 2BF04AA10BF51845006C0831 /* Project object */; @@ -563,7 +571,6 @@ 911F2DA41B98FF2300E3102E /* sounds */ = {isa = PBXFileReference; lastKnownFileType = folder; path = sounds; sourceTree = ""; }; 911F2DA51B98FF2700E3102E /* fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = fonts; sourceTree = ""; }; 912283C80FD0E16C00B21642 /* undo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = undo.cpp; sourceTree = ""; }; - 912287850FD41A2300B21642 /* simpletypes.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = simpletypes.hpp; sourceTree = ""; }; 91279BAD0F9CFCBA007B0D52 /* boescenario.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = boescenario.icns; path = ../rsrc/icons/mac/boescenario.icns; sourceTree = SOURCE_ROOT; }; 91279BB30F9D03B6007B0D52 /* boesave.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = boesave.icns; path = icons/mac/boesave.icns; sourceTree = ""; }; 91279BB40F9D03B7007B0D52 /* boesounds.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = boesounds.icns; path = icons/mac/boesounds.icns; sourceTree = ""; }; @@ -583,7 +590,7 @@ 91279D3C0F9D1D6A007B0D52 /* item.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = item.hpp; sourceTree = ""; }; 91279D3D0F9D1D6A007B0D52 /* item.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = item.cpp; sourceTree = ""; }; 912DFE8918E24B4C00B00D75 /* resmgr.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = resmgr.hpp; sourceTree = ""; }; - 912DFE8A18E24B4C00B00D75 /* restypes.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = restypes.hpp; sourceTree = ""; }; + 912DFE8A18E24B4C00B00D75 /* res_image.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = res_image.hpp; sourceTree = ""; }; 912DFE8E18E2872300B00D75 /* boe.menus.mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = boe.menus.mac.mm; sourceTree = ""; }; 913D00590F9FEEC200184C18 /* porting.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = porting.hpp; sourceTree = ""; }; 913D005A0F9FEEC200184C18 /* porting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = porting.cpp; sourceTree = ""; }; @@ -604,8 +611,8 @@ 914CA45719074D0A00B6ADD1 /* scen.menus.mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = scen.menus.mac.mm; sourceTree = ""; }; 914CA4641909B00100B6ADD1 /* scen.menus.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = scen.menus.hpp; sourceTree = ""; }; 914CA49F190C4E9200B6ADD1 /* scenedit.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = scenedit.xib; path = menus/scenedit.xib; sourceTree = ""; }; - 915325161A2E1DA8000A9A1C /* oldstructs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = oldstructs.cpp; path = ../oldstructs.cpp; sourceTree = ""; }; - 915325181A2E37EE000A9A1C /* specials_parse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = specials_parse.cpp; sourceTree = ""; }; + 915325161A2E1DA8000A9A1C /* oldstructs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = oldstructs.cpp; sourceTree = ""; }; + 915325181A2E37EE000A9A1C /* special_parse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = special_parse.cpp; sourceTree = ""; }; 91597A6C1A3BED2D00BE7BF9 /* spell.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = spell.hpp; sourceTree = ""; }; 91597A6E1A3BEDC700BE7BF9 /* spell.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = spell.cpp; sourceTree = ""; }; 915AF9E91BC04171008AEF49 /* dlogevt.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = dlogevt.hpp; sourceTree = ""; }; @@ -627,6 +634,21 @@ 9179A4631A4867E200FEF872 /* stack.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = stack.hpp; sourceTree = ""; }; 9179A4641A48681800FEF872 /* stack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stack.cpp; sourceTree = ""; }; 917B573F100B956C0096C978 /* undo.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = undo.hpp; sourceTree = ""; }; + 9185BD951EA020B70027C346 /* monster_abilities.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = monster_abilities.hpp; sourceTree = ""; }; + 9185BD961EA0234A0027C346 /* damage.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = damage.hpp; sourceTree = ""; }; + 9185BD971EA025720027C346 /* race.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = race.hpp; sourceTree = ""; }; + 9185BD991EA027B80027C346 /* fields.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = fields.hpp; sourceTree = ""; }; + 9185BD9A1EA02B840027C346 /* skills_traits.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = skills_traits.hpp; sourceTree = ""; }; + 9185BD9B1EA02B8F0027C346 /* alchemy.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = alchemy.hpp; sourceTree = ""; }; + 9185BD9C1EA02BA20027C346 /* terrain_abilities.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = terrain_abilities.hpp; sourceTree = ""; }; + 9185BD9D1EA02C320027C346 /* item_abilities.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = item_abilities.hpp; sourceTree = ""; }; + 9185BD9E1EA02C3D0027C346 /* item_variety.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = item_variety.hpp; sourceTree = ""; }; + 9185BD9F1EA02E5C0027C346 /* quest.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = quest.hpp; sourceTree = ""; }; + 9185BDA01EA02FF80027C346 /* global.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = global.hpp; sourceTree = ""; }; + 9185BDA51EA055180027C346 /* res_cursor.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = res_cursor.hpp; sourceTree = ""; }; + 9185BDA61EA055180027C346 /* res_font.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = res_font.hpp; sourceTree = ""; }; + 9185BDA71EA055180027C346 /* res_sound.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = res_sound.hpp; sourceTree = ""; }; + 9185BDA81EA055180027C346 /* res_strings.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = res_strings.hpp; sourceTree = ""; }; 918D59A718EA513900735B66 /* dialog.keys.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = dialog.keys.hpp; sourceTree = ""; }; 919086DF1A65C8E30071F7A0 /* tinyprint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyprint.cpp; sourceTree = ""; }; 919086E11A65D3250071F7A0 /* tinyprint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tinyprint.h; sourceTree = ""; }; @@ -652,8 +674,8 @@ 91AC607F0FA26A3B00EEAE67 /* town_import.tpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = town_import.tpp; sourceTree = ""; }; 91AC61C40FA2729900EEAE67 /* universe.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = universe.hpp; sourceTree = ""; }; 91AC61C50FA2729900EEAE67 /* universe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = universe.cpp; sourceTree = ""; }; - 91AC62090FA2853700EEAE67 /* creatlist.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = creatlist.hpp; sourceTree = ""; }; - 91AC620A0FA2853700EEAE67 /* creatlist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = creatlist.cpp; sourceTree = ""; }; + 91AC62090FA2853700EEAE67 /* population.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = population.hpp; sourceTree = ""; }; + 91AC620A0FA2853700EEAE67 /* population.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = population.cpp; sourceTree = ""; }; 91ACCE82190032E000FAEF8B /* fix_dylibs.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = fix_dylibs.sh; sourceTree = ""; }; 91B0D5CB1E33E579002BE4DA /* bladbase */ = {isa = PBXFileReference; lastKnownFileType = folder; name = bladbase; path = ../bases/bladbase; sourceTree = ""; }; 91B0D5CC1E3408AB002BE4DA /* busywork */ = {isa = PBXFileReference; lastKnownFileType = folder; path = busywork; sourceTree = ""; }; @@ -694,8 +716,8 @@ 91B3EF130F969BD300BF5B67 /* BoECharEd-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "BoECharEd-Info.plist"; path = "pcedit/BoECharEd-Info.plist"; sourceTree = SOURCE_ROOT; }; 91B3F1090F9779C300BF5B67 /* graphtool.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = graphtool.hpp; sourceTree = ""; }; 91B3F10A0F9779C300BF5B67 /* graphtool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = graphtool.cpp; sourceTree = ""; }; - 91B3F10E0F9779D000BF5B67 /* soundtool.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = soundtool.hpp; sourceTree = ""; }; - 91B3F10F0F9779D000BF5B67 /* soundtool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = soundtool.cpp; sourceTree = ""; }; + 91B3F10E0F9779D000BF5B67 /* sounds.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sounds.hpp; sourceTree = ""; }; + 91B3F10F0F9779D000BF5B67 /* sounds.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sounds.cpp; sourceTree = ""; }; 91B3F11D0F97801F00BF5B67 /* mathutil.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mathutil.hpp; sourceTree = ""; }; 91B3F11E0F97801F00BF5B67 /* mathutil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mathutil.cpp; sourceTree = ""; }; 91BC33971B439BEA0008882C /* files */ = {isa = PBXFileReference; lastKnownFileType = folder; path = files; sourceTree = ""; }; @@ -740,7 +762,7 @@ 91E381451B97671E00F69B81 /* town_write.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = town_write.cpp; sourceTree = ""; }; 91E381471B97675900F69B81 /* talk_write.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = talk_write.cpp; sourceTree = ""; }; 91E381491B97678D00F69B81 /* out_write.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = out_write.cpp; sourceTree = ""; }; - 91E5C5A10F9EACE200C21460 /* oldstructs.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = oldstructs.hpp; path = ../oldstructs.hpp; sourceTree = ""; }; + 91E5C5A10F9EACE200C21460 /* oldstructs.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = oldstructs.hpp; sourceTree = ""; }; 91E5C7970F9F60EC00C21460 /* town.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = town.hpp; sourceTree = ""; }; 91E5C7980F9F60EC00C21460 /* town.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = town.cpp; sourceTree = ""; }; 91E5C79C0F9F60FA00C21460 /* outdoors.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = outdoors.hpp; sourceTree = ""; }; @@ -891,9 +913,8 @@ 2BF04A9F0BF51845006C0831 = { isa = PBXGroup; children = ( - 91279BAB0F9CFB18007B0D52 /* classes */, - 91B3F0FF0F97797200BF5B67 /* tools */, - 91B3EF380F969E4A00BF5B67 /* osx */, + 91279BAB0F9CFB18007B0D52 /* common */, + 91B3EF380F969E4A00BF5B67 /* Game */, 91B3EEF90F969BBD00BF5B67 /* CharEd */, 91B3EECD0F969B7000BF5B67 /* ScenEd */, 91CC17281B421BD5003D9A69 /* test */, @@ -906,57 +927,56 @@ 910BBA130FB8BE66001E34EA /* dialogxml */ = { isa = PBXGroup; children = ( - 910BBA190FB8C43E001E34EA /* xml-parser */, - 910BBA140FB8BE7D001E34EA /* headers */, - 910BBA150FB8BE88001E34EA /* src */, + 910BBA140FB8BE7D001E34EA /* widgets */, + 910BBA150FB8BE88001E34EA /* dialogs */, ); path = dialogxml; sourceTree = SOURCE_ROOT; }; - 910BBA140FB8BE7D001E34EA /* headers */ = { + 910BBA140FB8BE7D001E34EA /* widgets */ = { isa = PBXGroup; children = ( - 91E128F21BC2077600C8BE1D /* 3choice.hpp */, + 91A32BD10FDB797B00C4E957 /* basicbtns.cpp */, + 910BBA890FB8EC57001E34EA /* button.cpp */, + 910BBA3C0FB8DA8E001E34EA /* control.cpp */, + 910BBAB50FB91A26001E34EA /* field.cpp */, + 910BBAB90FB91ADB001E34EA /* message.cpp */, + 910BBAA90FB8F733001E34EA /* pict.cpp */, + 9191460018E63D8E005CF3A4 /* scrollbar.cpp */, + 919B13A81BBE2B54009905A4 /* scrollpane.cpp */, + 9179A4641A48681800FEF872 /* stack.cpp */, 910BBA880FB8EC57001E34EA /* button.hpp */, - 91E128F31BC2077700C8BE1D /* choicedlog.hpp */, 910BBA3B0FB8DA8E001E34EA /* control.hpp */, - 910BBA170FB8BECA001E34EA /* dialog.hpp */, - 918D59A718EA513900735B66 /* dialog.keys.hpp */, - 915AF9E91BC04171008AEF49 /* dlogevt.hpp */, 910BBAB40FB91A26001E34EA /* field.hpp */, 910BBAB80FB91ADB001E34EA /* message.hpp */, 910BBAA80FB8F733001E34EA /* pict.hpp */, - 91E128F41BC2077700C8BE1D /* pictchoice.hpp */, 913FB40A1A5C90840067B9D2 /* pictypes.hpp */, 919145FD18E3C750005CF3A4 /* scrollbar.hpp */, 919B13A71BBE297B009905A4 /* scrollpane.hpp */, 9179A4631A4867E200FEF872 /* stack.hpp */, - 91E128F51BC2077700C8BE1D /* strchoice.hpp */, - 91E128F61BC2077700C8BE1D /* strdlog.hpp */, ); - name = headers; + path = widgets; sourceTree = ""; }; - 910BBA150FB8BE88001E34EA /* src */ = { + 910BBA150FB8BE88001E34EA /* dialogs */ = { isa = PBXGroup; children = ( 91E128E81BC2076B00C8BE1D /* 3choice.cpp */, - 91A32BD10FDB797B00C4E957 /* basicbtns.cpp */, - 910BBA890FB8EC57001E34EA /* button.cpp */, 91E128E91BC2076B00C8BE1D /* choicedlog.cpp */, - 910BBA3C0FB8DA8E001E34EA /* control.cpp */, 910BBA180FB8BECA001E34EA /* dialog.cpp */, - 910BBAB50FB91A26001E34EA /* field.cpp */, - 910BBAB90FB91ADB001E34EA /* message.cpp */, - 910BBAA90FB8F733001E34EA /* pict.cpp */, 91E128EA1BC2076B00C8BE1D /* pictchoice.cpp */, - 9191460018E63D8E005CF3A4 /* scrollbar.cpp */, - 919B13A81BBE2B54009905A4 /* scrollpane.cpp */, - 9179A4641A48681800FEF872 /* stack.cpp */, 91E128EB1BC2076B00C8BE1D /* strchoice.cpp */, 91E128EC1BC2076B00C8BE1D /* strdlog.cpp */, + 91E128F21BC2077600C8BE1D /* 3choice.hpp */, + 91E128F31BC2077700C8BE1D /* choicedlog.hpp */, + 910BBA170FB8BECA001E34EA /* dialog.hpp */, + 918D59A718EA513900735B66 /* dialog.keys.hpp */, + 915AF9E91BC04171008AEF49 /* dlogevt.hpp */, + 91E128F41BC2077700C8BE1D /* pictchoice.hpp */, + 91E128F51BC2077700C8BE1D /* strchoice.hpp */, + 91E128F61BC2077700C8BE1D /* strdlog.hpp */, ); - name = src; + path = dialogs; sourceTree = ""; }; 910BBA190FB8C43E001E34EA /* xml-parser */ = { @@ -990,128 +1010,34 @@ name = Products; sourceTree = BUILT_PRODUCTS_DIR; }; - 91279BAB0F9CFB18007B0D52 /* classes */ = { + 91279BAB0F9CFB18007B0D52 /* common */ = { isa = PBXGroup; children = ( - 913D03330FA0FFE800184C18 /* headers */, - 913D03320FA0FFE700184C18 /* src */, - 91E5C5A10F9EACE200C21460 /* oldstructs.hpp */, - 915325161A2E1DA8000A9A1C /* oldstructs.cpp */, + 910BBA130FB8BE66001E34EA /* dialogxml */, + 9185BDA31EA044790027C346 /* fileio */, + 9185BDA21EA042BE0027C346 /* gfx */, + 9185BDA41EA053E00027C346 /* misc */, + 9185BD941EA01BCC0027C346 /* scenario */, + 9185BDA11EA041570027C346 /* tools */, + 9185BD931EA01BB50027C346 /* universe */, ); - path = classes; + name = common; sourceTree = ""; }; 912DFE8718E24B0B00B00D75 /* resmgr */ = { isa = PBXGroup; children = ( - 912DFE8918E24B4C00B00D75 /* resmgr.hpp */, 91960ED31BB613E5008AF8F4 /* restypes.cpp */, - 912DFE8A18E24B4C00B00D75 /* restypes.hpp */, + 9185BDA51EA055180027C346 /* res_cursor.hpp */, + 9185BDA61EA055180027C346 /* res_font.hpp */, + 912DFE8A18E24B4C00B00D75 /* res_image.hpp */, + 9185BDA71EA055180027C346 /* res_sound.hpp */, + 9185BDA81EA055180027C346 /* res_strings.hpp */, + 912DFE8918E24B4C00B00D75 /* resmgr.hpp */, ); path = resmgr; sourceTree = ""; }; - 913D03320FA0FFE700184C18 /* src */ = { - isa = PBXGroup; - children = ( - 91AC620A0FA2853700EEAE67 /* creatlist.cpp */, - 914698FE1A747C4500F20F5E /* creature.cpp */, - 91E1862B1B2B2AC0006A99EA /* estreams.cpp */, - 91279D3D0F9D1D6A007B0D52 /* item.cpp */, - 914698FB1A7362D900F20F5E /* living.cpp */, - 91279BE10F9D0F73007B0D52 /* location.cpp */, - 91279CC10F9D19DA007B0D52 /* monster.cpp */, - 91E5C79D0F9F60FA00C21460 /* outdoors.cpp */, - 913D05B50FA1E9E300184C18 /* party.cpp */, - 913D05BB0FA1EA0A00184C18 /* pc.cpp */, - 91279C580F9D1253007B0D52 /* scenario.cpp */, - 91FDB5791A4E774E00DE5983 /* shop.cpp */, - 91279CC60F9D1A02007B0D52 /* special.cpp */, - 91597A6E1A3BEDC700BE7BF9 /* spell.cpp */, - 91E5C7B70F9F619D00C21460 /* talking.cpp */, - 91279C660F9D12D6007B0D52 /* terrain.cpp */, - 91E5C7980F9F60EC00C21460 /* town.cpp */, - 91AC607F0FA26A3B00EEAE67 /* town_import.tpp */, - 91AC61C50FA2729900EEAE67 /* universe.cpp */, - 91279C750F9D15E5007B0D52 /* vehicle.cpp */, - ); - name = src; - sourceTree = ""; - }; - 913D03330FA0FFE800184C18 /* headers */ = { - isa = PBXGroup; - children = ( - 91AC607E0FA26A3B00EEAE67 /* area.hpp */, - 91AC62090FA2853700EEAE67 /* creatlist.hpp */, - 914698FD1A747BED00F20F5E /* creature.hpp */, - 91279D3C0F9D1D6A007B0D52 /* item.hpp */, - 914698FA1A7362C200F20F5E /* living.hpp */, - 91279BE00F9D0F73007B0D52 /* location.hpp */, - 91279CC00F9D19DA007B0D52 /* monster.hpp */, - 91E5C79C0F9F60FA00C21460 /* outdoors.hpp */, - 913D05B40FA1E9E200184C18 /* party.hpp */, - 913D05BA0FA1EA0A00184C18 /* pc.hpp */, - 91279C570F9D1253007B0D52 /* scenario.hpp */, - 91FDB5771A4E71A900DE5983 /* shop.hpp */, - 912287850FD41A2300B21642 /* simpletypes.hpp */, - 91279CC50F9D1A02007B0D52 /* special.hpp */, - 91597A6C1A3BED2D00BE7BF9 /* spell.hpp */, - 91E5C7B60F9F619D00C21460 /* talking.hpp */, - 91279C650F9D12D6007B0D52 /* terrain.hpp */, - 91E5C7970F9F60EC00C21460 /* town.hpp */, - 91AC61C40FA2729900EEAE67 /* universe.hpp */, - 91279C740F9D15E4007B0D52 /* vehicle.hpp */, - ); - name = headers; - sourceTree = ""; - }; - 913D03340FA0FFFF00184C18 /* src */ = { - isa = PBXGroup; - children = ( - 91C688E70FD702B9000F6D01 /* cursors.mac.mm */, - 91E30F2D1A7481C20057C54A /* fileio.cpp */, - 91E30F2A1A74819B0057C54A /* fileio_party.cpp */, - 91E5C7A60F9F615400C21460 /* fileio_scen.cpp */, - 91B3F10A0F9779C300BF5B67 /* graphtool.cpp */, - 915E09081A316D89008BDF00 /* map_parse.cpp */, - 91A0B15A1900F73E00EF438F /* mask.frag */, - 91BFA3D61901B024001686E4 /* mask.vert */, - 91B3F11E0F97801F00BF5B67 /* mathutil.cpp */, - 913D005A0F9FEEC200184C18 /* porting.cpp */, - 91EC481018FBABB100BB1E86 /* prefs.mac.mm */, - 91F6F8F518F8DE6300E3EA15 /* qdpict.mac.cpp */, - 91B3F10F0F9779D000BF5B67 /* soundtool.cpp */, - 915325181A2E37EE000A9A1C /* specials_parse.cpp */, - 91BFA3D81902AD78001686E4 /* tarball.cpp */, - 912283C80FD0E16C00B21642 /* undo.cpp */, - 91B0D5D01E34428E002BE4DA /* view_dialogs.cpp */, - 919145FF18E63B70005CF3A4 /* winutil.mac.mm */, - ); - name = src; - sourceTree = ""; - }; - 913D03350FA1000200184C18 /* headers */ = { - isa = PBXGroup; - children = ( - 91C688E60FD702B9000F6D01 /* cursors.hpp */, - 91E5C7A50F9F615400C21460 /* fileio.hpp */, - 91C2A6E21B8244F700346948 /* gitrev.hpp */, - 91B3F1090F9779C300BF5B67 /* graphtool.hpp */, - 915E09071A316D6A008BDF00 /* map_parse.hpp */, - 91B3F11D0F97801F00BF5B67 /* mathutil.hpp */, - 913D00590F9FEEC200184C18 /* porting.hpp */, - 91EC480E18FBAA8700BB1E86 /* prefs.hpp */, - 91B3F10E0F9779D000BF5B67 /* soundtool.hpp */, - 91F06E8F1A2EBEE70038E902 /* special_parse.hpp */, - 91BFA3D91902ADD5001686E4 /* tarball.hpp */, - 917B573F100B956C0096C978 /* undo.hpp */, - 9179A4621A47D4E200FEF872 /* vector2d.hpp */, - 91B0D5D31E3446CF002BE4DA /* view_dialogs.hpp */, - 919145FE18E63B41005CF3A4 /* winutil.hpp */, - ); - name = headers; - sourceTree = ""; - }; 914B2AA018E7E4A3007B6799 /* Linked Frameworks */ = { isa = PBXGroup; children = ( @@ -1137,6 +1063,137 @@ name = "Linked Frameworks"; sourceTree = ""; }; + 9185BD931EA01BB50027C346 /* universe */ = { + isa = PBXGroup; + children = ( + 914698FE1A747C4500F20F5E /* creature.cpp */, + 914698FB1A7362D900F20F5E /* living.cpp */, + 913D05B50FA1E9E300184C18 /* party.cpp */, + 913D05BB0FA1EA0A00184C18 /* pc.cpp */, + 91AC620A0FA2853700EEAE67 /* population.cpp */, + 91AC61C50FA2729900EEAE67 /* universe.cpp */, + 914698FD1A747BED00F20F5E /* creature.hpp */, + 914698FA1A7362C200F20F5E /* living.hpp */, + 913D05B40FA1E9E200184C18 /* party.hpp */, + 913D05BA0FA1EA0A00184C18 /* pc.hpp */, + 91AC62090FA2853700EEAE67 /* population.hpp */, + 91AC61C40FA2729900EEAE67 /* universe.hpp */, + ); + path = universe; + sourceTree = ""; + }; + 9185BD941EA01BCC0027C346 /* scenario */ = { + isa = PBXGroup; + children = ( + 91279D3D0F9D1D6A007B0D52 /* item.cpp */, + 91279CC10F9D19DA007B0D52 /* monster.cpp */, + 91E5C79D0F9F60FA00C21460 /* outdoors.cpp */, + 91279C580F9D1253007B0D52 /* scenario.cpp */, + 91FDB5791A4E774E00DE5983 /* shop.cpp */, + 91279CC60F9D1A02007B0D52 /* special.cpp */, + 91E5C7B70F9F619D00C21460 /* talking.cpp */, + 91279C660F9D12D6007B0D52 /* terrain.cpp */, + 91E5C7980F9F60EC00C21460 /* town.cpp */, + 91279C750F9D15E5007B0D52 /* vehicle.cpp */, + 91AC607E0FA26A3B00EEAE67 /* area.hpp */, + 91279D3C0F9D1D6A007B0D52 /* item.hpp */, + 9185BD9D1EA02C320027C346 /* item_abilities.hpp */, + 9185BD9E1EA02C3D0027C346 /* item_variety.hpp */, + 91279CC00F9D19DA007B0D52 /* monster.hpp */, + 9185BD951EA020B70027C346 /* monster_abilities.hpp */, + 91E5C79C0F9F60FA00C21460 /* outdoors.hpp */, + 9185BD9F1EA02E5C0027C346 /* quest.hpp */, + 91279C570F9D1253007B0D52 /* scenario.hpp */, + 91FDB5771A4E71A900DE5983 /* shop.hpp */, + 91279CC50F9D1A02007B0D52 /* special.hpp */, + 91E5C7B60F9F619D00C21460 /* talking.hpp */, + 91279C650F9D12D6007B0D52 /* terrain.hpp */, + 9185BD9C1EA02BA20027C346 /* terrain_abilities.hpp */, + 91E5C7970F9F60EC00C21460 /* town.hpp */, + 91AC607F0FA26A3B00EEAE67 /* town_import.tpp */, + 91279C740F9D15E4007B0D52 /* vehicle.hpp */, + ); + path = scenario; + sourceTree = ""; + }; + 9185BDA11EA041570027C346 /* tools */ = { + isa = PBXGroup; + children = ( + 91C688E70FD702B9000F6D01 /* cursors.mac.mm */, + 91EC481018FBABB100BB1E86 /* prefs.mac.mm */, + 912283C80FD0E16C00B21642 /* undo.cpp */, + 919145FF18E63B70005CF3A4 /* winutil.mac.mm */, + 91C688E60FD702B9000F6D01 /* cursors.hpp */, + 91C2A6E21B8244F700346948 /* gitrev.hpp */, + 91EC480E18FBAA8700BB1E86 /* prefs.hpp */, + 917B573F100B956C0096C978 /* undo.hpp */, + 9179A4621A47D4E200FEF872 /* vector2d.hpp */, + 919145FE18E63B41005CF3A4 /* winutil.hpp */, + 91C2A6E11B823CCD00346948 /* gitrev.sh */, + ); + path = tools; + sourceTree = ""; + }; + 9185BDA21EA042BE0027C346 /* gfx */ = { + isa = PBXGroup; + children = ( + 91B3F10A0F9779C300BF5B67 /* graphtool.cpp */, + 91F6F8F518F8DE6300E3EA15 /* qdpict.mac.cpp */, + 91B3F1090F9779C300BF5B67 /* graphtool.hpp */, + 91A0B15A1900F73E00EF438F /* mask.frag */, + 91BFA3D61901B024001686E4 /* mask.vert */, + ); + path = gfx; + sourceTree = ""; + }; + 9185BDA31EA044790027C346 /* fileio */ = { + isa = PBXGroup; + children = ( + 91E1862B1B2B2AC0006A99EA /* estreams.cpp */, + 91E30F2D1A7481C20057C54A /* fileio.cpp */, + 91E30F2A1A74819B0057C54A /* fileio_party.cpp */, + 91E5C7A60F9F615400C21460 /* fileio_scen.cpp */, + 915E09081A316D89008BDF00 /* map_parse.cpp */, + 915325181A2E37EE000A9A1C /* special_parse.cpp */, + 91BFA3D81902AD78001686E4 /* tarball.cpp */, + 91E5C7A50F9F615400C21460 /* fileio.hpp */, + 915E09071A316D6A008BDF00 /* map_parse.hpp */, + 91F06E8F1A2EBEE70038E902 /* special_parse.hpp */, + 91BFA3D91902ADD5001686E4 /* tarball.hpp */, + 91BFA3DC19033E00001686E4 /* gzstream */, + 912DFE8718E24B0B00B00D75 /* resmgr */, + 910BBA190FB8C43E001E34EA /* xml-parser */, + ); + path = fileio; + sourceTree = ""; + }; + 9185BDA41EA053E00027C346 /* misc */ = { + isa = PBXGroup; + children = ( + 91279BE10F9D0F73007B0D52 /* location.cpp */, + 91B3F11E0F97801F00BF5B67 /* mathutil.cpp */, + 915325161A2E1DA8000A9A1C /* oldstructs.cpp */, + 913D005A0F9FEEC200184C18 /* porting.cpp */, + 91B3F10F0F9779D000BF5B67 /* sounds.cpp */, + 91597A6E1A3BEDC700BE7BF9 /* spell.cpp */, + 91B0D5D01E34428E002BE4DA /* view_dialogs.cpp */, + 9185BD9B1EA02B8F0027C346 /* alchemy.hpp */, + 9185BD961EA0234A0027C346 /* damage.hpp */, + 9185BD991EA027B80027C346 /* fields.hpp */, + 9185BDA01EA02FF80027C346 /* global.hpp */, + 91279BE00F9D0F73007B0D52 /* location.hpp */, + 91B3F11D0F97801F00BF5B67 /* mathutil.hpp */, + 91E5C5A10F9EACE200C21460 /* oldstructs.hpp */, + 913D00590F9FEEC200184C18 /* porting.hpp */, + 9185BD971EA025720027C346 /* race.hpp */, + 9185BD9A1EA02B840027C346 /* skills_traits.hpp */, + 91B3F10E0F9779D000BF5B67 /* sounds.hpp */, + 91597A6C1A3BED2D00BE7BF9 /* spell.hpp */, + 91B0D5D31E3446CF002BE4DA /* view_dialogs.hpp */, + ); + name = misc; + sourceTree = ""; + }; 91B3EECD0F969B7000BF5B67 /* ScenEd */ = { isa = PBXGroup; children = ( @@ -1258,27 +1315,15 @@ path = ../rsrc; sourceTree = SOURCE_ROOT; }; - 91B3EF380F969E4A00BF5B67 /* osx */ = { + 91B3EF380F969E4A00BF5B67 /* Game */ = { isa = PBXGroup; children = ( 91D62F2C0F8EB7AB00674AB3 /* src */, 91D62F2D0F8EB7BA00674AB3 /* headers */, 91D62F2E0F8EB80200674AB3 /* rsrc */, ); - name = osx; - sourceTree = ""; - }; - 91B3F0FF0F97797200BF5B67 /* tools */ = { - isa = PBXGroup; - children = ( - 91C2A6E11B823CCD00346948 /* gitrev.sh */, - 91BFA3DC19033E00001686E4 /* gzstream */, - 912DFE8718E24B0B00B00D75 /* resmgr */, - 910BBA130FB8BE66001E34EA /* dialogxml */, - 913D03350FA1000200184C18 /* headers */, - 913D03340FA0FFFF00184C18 /* src */, - ); - path = tools; + name = Game; + path = game; sourceTree = ""; }; 91BFA3DC19033E00001686E4 /* gzstream */ = { @@ -1765,7 +1810,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 919CC2481B3772F300273FDA /* creatlist.cpp in Sources */, + 919CC2481B3772F300273FDA /* population.cpp in Sources */, 919CC2491B3772FB00273FDA /* creature.cpp in Sources */, 919CC24C1B37730900273FDA /* living.cpp in Sources */, 919CC2501B37731D00273FDA /* party.cpp in Sources */, @@ -1817,8 +1862,8 @@ 919CC2781B37741A00273FDA /* porting.cpp in Sources */, 919CC2791B37742200273FDA /* prefs.mac.mm in Sources */, 919CC27A1B37742800273FDA /* qdpict.mac.cpp in Sources */, - 919CC27B1B37742D00273FDA /* soundtool.cpp in Sources */, - 919CC27C1B37743200273FDA /* specials_parse.cpp in Sources */, + 919CC27B1B37742D00273FDA /* sounds.cpp in Sources */, + 919CC27C1B37743200273FDA /* special_parse.cpp in Sources */, 919CC27D1B37743700273FDA /* tarball.cpp in Sources */, 919CC27E1B37743B00273FDA /* undo.cpp in Sources */, 919CC27F1B37744000273FDA /* winutil.mac.mm in Sources */, @@ -1944,6 +1989,11 @@ target = 919CC22C1B37721400273FDA /* Common-Party */; targetProxy = 9169C3081B379E8B0041002B /* PBXContainerItemProxy */; }; + 9185BDAA1EA06A150027C346 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 91CC172C1B421C0A003D9A69 /* boe_test */; + targetProxy = 9185BDA91EA06A150027C346 /* PBXContainerItemProxy */; + }; 91BC33941B4390E40008882C /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 919CC23A1B3772B700273FDA /* Common */; @@ -1987,6 +2037,7 @@ GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_INPUT_FILETYPE = automatic; GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREFIX_HEADER = global.hpp; GCC_PREPROCESSOR_DEFINITIONS = TIXML_USE_TICPP; GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; @@ -2049,6 +2100,7 @@ GCC_ENABLE_PASCAL_STRINGS = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_INPUT_FILETYPE = automatic; + GCC_PREFIX_HEADER = global.hpp; GCC_PREPROCESSOR_DEFINITIONS = TIXML_USE_TICPP; GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; @@ -2108,8 +2160,6 @@ "-lboost_system", "-lboost_filesystem", "$(OTHER_LDFLAGS_QUOTED_FOR_PROJECT_1)", - "-lCommon", - "-lCommon-Party", ); PRODUCT_NAME = "Blades of Exile"; WRAPPER_EXTENSION = app; @@ -2132,8 +2182,6 @@ "-lboost_system", "-lboost_filesystem", "$(OTHER_LDFLAGS_QUOTED_FOR_PROJECT_1)", - "-lCommon", - "-lCommon-Party", ); PRODUCT_NAME = "Blades of Exile"; WRAPPER_EXTENSION = app; @@ -2217,8 +2265,6 @@ "-lboost_system", "-lboost_filesystem", "$(OTHER_LDFLAGS_QUOTED_FOR_PROJECT_1)", - "-lCommon-Party", - "-lCommon", ); OTHER_LDFLAGS_QUOTED_FOR_TARGET_1 = "-L\"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/\""; PRODUCT_NAME = "BoE Character Editor"; @@ -2242,8 +2288,6 @@ "-lboost_system", "-lboost_filesystem", "$(OTHER_LDFLAGS_QUOTED_FOR_PROJECT_1)", - "-lCommon-Party", - "-lCommon", ); OTHER_LDFLAGS_QUOTED_FOR_TARGET_1 = "-L\"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/\""; PRODUCT_NAME = "BoE Character Editor"; @@ -2311,8 +2355,6 @@ "-lboost_system", "-lboost_filesystem", "$(OTHER_LDFLAGS_QUOTED_FOR_PROJECT_1)", - "-lCommon", - "-lCommon-Party", ); PRODUCT_NAME = "$(TARGET_NAME)"; }; diff --git a/src/alchemy.hpp b/src/alchemy.hpp new file mode 100644 index 00000000..dd324482 --- /dev/null +++ b/src/alchemy.hpp @@ -0,0 +1,36 @@ +// +// alchemy.hpp +// BoE +// +// Created by Celtic Minstrel on 17-04-13. +// +// + +#ifndef BoE_ALCHEMY_HPP +#define BoE_ALCHEMY_HPP + +enum class eAlchemy { + NONE = -1, + CURE_WEAK = 0, + HEAL_WEAK = 1, + POISON_WEAK = 2, + SPEED_WEAK = 3, + POISON_MED = 4, + HEAL_MED = 5, + CURE_STRONG = 6, + SPEED_MED = 7, + GRAYMOLD = 8, + POWER_WEAK = 9, + CLARITY = 10, + POISON_STRONG = 11, + HEAL_STRONG = 12, + POISON_KILL = 13, + RESURRECT = 14, + POWER_MED = 15, + KNOWLEDGE = 16, + STRENGTH = 17, + BLISS = 18, + POWER_STRONG = 19, +}; + +#endif diff --git a/src/classes/monster.hpp b/src/classes/monster.hpp deleted file mode 100644 index 6d8e82c2..00000000 --- a/src/classes/monster.hpp +++ /dev/null @@ -1,178 +0,0 @@ -/* - * monster.h - * BoE - * - * Created by Celtic Minstrel on 20/04/09. - * - */ - -#ifndef BOE_DATA_MONSTER_H -#define BOE_DATA_MONSTER_H - -#include -#include -#include -#include - -#include "soundtool.hpp" -#include "simpletypes.hpp" -#include "graphtool.hpp" -#include "living.hpp" -#include "spell.hpp" - -namespace legacy { - struct monster_record_type; - struct creature_data_type; - struct creature_start_type; -}; - -class cScenario; -class cUniverse; - -enum class eMonstAbilTemplate { - // Non-magical missiles - THROWS_DARTS, SHOOTS_ARROWS, THROWS_SPEARS, THROWS_ROCKS1, THROWS_ROCKS2, THROWS_ROCKS3, - THROWS_RAZORDISKS, THROWS_KNIVES, GOOD_ARCHER, SHOOTS_SPINES, CROSSBOWMAN, SLINGER, - // Magical missiles - RAY_PETRIFY, RAY_SP_DRAIN, RAY_HEAT, RAY_PARALYSIS, - BREATH_FIRE, BREATH_FROST, BREATH_ELECTRICITY, BREATH_DARKNESS, BREATH_FOUL, BREATH_SLEEP, - SPIT_ACID, SHOOTS_WEB, - // Touch abilities - TOUCH_POISON, TOUCH_ACID, TOUCH_DISEASE, TOUCH_WEB, TOUCH_SLEEP, TOUCH_DUMB, TOUCH_PARALYSIS, - TOUCH_PETRIFY, TOUCH_DEATH, TOUCH_XP_DRAIN, TOUCH_ICY, TOUCH_ICY_DRAINING, TOUCH_STUN, TOUCH_STEAL_FOOD, TOUCH_STEAL_GOLD, - // Misc abilities - SPLITS, MARTYRS_SHIELD, ABSORB_SPELLS, SUMMON_5, SUMMON_20, SUMMON_50, SPECIAL, HIT_TRIGGERS, DEATH_TRIGGERS, - // Radiate abilities - RADIATE_FIRE, RADIATE_ICE, RADIATE_SHOCK, RADIATE_ANTIMAGIC, RADIATE_SLEEP, RADIATE_STINK, RADIATE_BLADE, RADIATE_WEB, - // Advanced abilities - CUSTOM_MISSILE, CUSTOM_DAMAGE, CUSTOM_STATUS, CUSTOM_FIELD, CUSTOM_PETRIFY, CUSTOM_SP_DRAIN, CUSTOM_XP_DRAIN, - CUSTOM_KILL, CUSTOM_STEAL_FOOD, CUSTOM_STEAL_GOLD, CUSTOM_STUN, CUSTOM_STATUS2, CUSTOM_RADIATE, CUSTOM_SUMMON, - CUSTOM_DAMAGE2, -}; - -union uAbility { - bool active; - struct { - bool active; - eMonstMissile type; - miss_num_t pic; - int dice, sides, skill, range, odds; - } missile; - struct { - bool active; - eMonstGen type; - miss_num_t pic; - int strength, range, odds; - union { - eDamageType dmg; - eStatus stat; - eFieldType fld; - }; - } gen; - struct { - bool active; - eMonstSummon type; - mon_num_t what; - int min, max, len, chance; - } summon; - struct { - bool active; - eFieldType type; - int chance; - eSpellPat pat; - } radiate; - struct { - bool active; - int extra1, extra2, extra3; - } special; - std::string to_string(eMonstAbil myKey) const; - int get_ap_cost(eMonstAbil key) const; -}; - -class cMonster { -public: - struct cAttack{ - unsigned short dice = 0, sides = 0; - eMonstMelee type = eMonstMelee::SWING; - }; - unsigned int level; - std::string m_name; - short m_health; - unsigned int armor; - unsigned int skill; - std::array a; - eRace m_type; - unsigned int speed; - unsigned int mu; - unsigned int cl; - unsigned int treasure; - // HACK: This is only really marked mutable so that I can use operator[] from const methods - mutable std::map abil; - item_num_t corpse_item; - short corpse_item_chance; - std::map resist; - bool mindless, invuln, invisible, guard, amorphous; - unsigned int x_width,y_width; - eAttitude default_attitude; - unsigned int summon_type; - pic_num_t default_facial_pic; - pic_num_t picture_num; - snd_num_t ambient_sound; // has a chance of being played every move - spec_num_t see_spec; - - std::map::iterator addAbil(eMonstAbilTemplate what, int param = 0); - int addAttack(unsigned short dice, unsigned short sides, eMonstMelee type = eMonstMelee::SWING); - - void import_legacy(legacy::monster_record_type& old); - cMonster(); - void writeTo(std::ostream& file) const; - void readFrom(std::istream& file); -}; - -class cTownperson { -public: - mon_num_t number; - eAttitude start_attitude; - location start_loc; - unsigned short mobility; - eMonstTime time_flag; - short spec1, spec2; - short spec_enc_code, time_code; - short monster_time, personality; - short special_on_kill, special_on_talk; - pic_num_t facial_pic; - - void import_legacy(legacy::creature_start_type old); - cTownperson(); - cTownperson(location loc, mon_num_t num, const cMonster& monst); -}; - -std::ostream& operator << (std::ostream& out, eStatus e); -std::istream& operator >> (std::istream& in, eStatus& e); -std::ostream& operator << (std::ostream& out, eRace e); -std::istream& operator >> (std::istream& in, eRace& e); -std::ostream& operator << (std::ostream& out, eMonstAbil e); -std::istream& operator >> (std::istream& in, eMonstAbil& e); -std::ostream& operator << (std::ostream& out, eMonstMissile e); -std::istream& operator >> (std::istream& in, eMonstMissile& e); -std::ostream& operator << (std::ostream& out, eMonstSummon e); -std::istream& operator >> (std::istream& in, eMonstSummon& e); -std::ostream& operator << (std::ostream& out, eMonstMelee e); -std::istream& operator >> (std::istream& in, eMonstMelee& e); -std::ostream& operator << (std::ostream& out, eMonstGen e); -std::istream& operator >> (std::istream& in, eMonstGen& e); -std::ostream& operator << (std::ostream& out, eDirection e); -std::istream& operator >> (std::istream& in, eDirection& e); -std::ostream& operator << (std::ostream& out, eDamageType e); -std::istream& operator >> (std::istream& in, eDamageType& e); -std::ostream& operator << (std::ostream& out, eFieldType e); -std::istream& operator >> (std::istream& in, eFieldType& e); -std::ostream& operator << (std::ostream& out, eMonstTime e); -std::istream& operator >> (std::istream& in, eMonstTime& e); -std::ostream& operator<< (std::ostream& out, eAttitude node); -std::istream& operator>> (std::istream& in, eAttitude& node); -std::ostream& operator<<(std::ostream& out, const cMonster::cAttack& att); -std::ostream& operator<< (std::ostream& out, eSpellPat pat); -std::istream& operator>> (std::istream& in, eSpellPat& pat); - -#endif diff --git a/src/classes/simpletypes.hpp b/src/classes/simpletypes.hpp deleted file mode 100644 index c4e82cbf..00000000 --- a/src/classes/simpletypes.hpp +++ /dev/null @@ -1,1133 +0,0 @@ -/* - * simpletypes.h - * BoE - * - * Created by Celtic Minstrel on 01/06/09. - * - */ - -#ifndef BOE_DATA_SIMPLETYPES_H -#define BOE_DATA_SIMPLETYPES_H - -typedef unsigned short mon_num_t; -typedef signed short miss_num_t; -typedef unsigned short ter_num_t; -typedef signed short spec_num_t; -typedef signed short item_num_t; -typedef unsigned short str_num_t; - -// OBoE Current Version -const unsigned long long OBOE_CURRENT_VERSION = 0x020000; // MMmmff; M - major, m - minor, f - bugfix -std::string oboeVersionString(); - -// MARK: Directions! -enum eDirection { - DIR_N = 0, - DIR_NE = 1, - DIR_E = 2, - DIR_SE = 3, - DIR_S = 4, - DIR_SW = 5, - DIR_W = 6, - DIR_NW = 7, - DIR_HERE = 8, -}; - -inline eDirection& operator++ (eDirection& me, int) { - if(me == DIR_HERE) return me = DIR_N; - else return me = (eDirection)(1 + (int)me); -} - -enum eContentRating {G, PG, R, NC17}; - -enum class eQuestStatus {AVAILABLE, STARTED, COMPLETED, FAILED}; - -enum class eMainStatus { - ABSENT = 0, // absent, empty slot - ALIVE = 1, - DEAD = 2, - DUST = 3, - STONE = 4, - FLED = 5, - SURFACE = 6, // fled to surface? - WON = 7, - SPLIT = 10, - SPLIT_ABSENT = SPLIT + ABSENT, - SPLIT_ALIVE = SPLIT + ALIVE, - SPLIT_DEAD = SPLIT + DEAD, - SPLIT_DUST = SPLIT + DUST, - SPLIT_STONE = SPLIT + STONE, - SPLIT_FLED = SPLIT + FLED, - SPLIT_SURFACE = SPLIT + SURFACE, - SPLIT_WON = SPLIT + WON, -}; - -inline eMainStatus exceptSplit(eMainStatus stat) { - if(int(stat) >= 10) - return (eMainStatus) (-10 + (int)stat); - return stat; -} - -inline bool isSplit(eMainStatus stat) { - return int(stat) >= 10; -} - -inline bool isAbsent(eMainStatus stat) { - return stat == eMainStatus::ABSENT || int(stat) > 4; -} - -inline bool isDead(eMainStatus stat) { - int code = (int) stat; - return code > 1 && code < 5; -} - -/* adven[i].race */ //complete -enum class eRace { - UNKNOWN = -1, // for parameters to some functions; not valid in the class - HUMAN = 0, - NEPHIL = 1, - SLITH = 2, - VAHNATAI = 3, // Former value from eMonsterType - REPTILE = 4, // 1 - BEAST = 5, // 2 - IMPORTANT = 6, // 3 - MAGE = 7, // 4 - PRIEST = 8, // 5 - HUMANOID = 9, // 6 - DEMON = 10, // 7 - UNDEAD = 11, // 8 - GIANT = 12, // 9 - SLIME = 13, // 10 - STONE = 14, // 11 - BUG = 15, // 12 - DRAGON = 16, // 13 - MAGICAL = 17, // 14 - PLANT = 18, - BIRD = 19, - SKELETAL = 20, - GOBLIN = 21, -}; - -// Types IMPORTANT, MAGE, and PRIEST are implicitly human -inline bool isHuman(eRace race) { - int code = (int) race; - return code == 0 || (code >= 6 && code <= 8); -} - -// Types NEPHIL, SLITH, and VAHNATAI are implicitly humanoid -inline bool isHumanoid(eRace race) { - int code = (int) race; - return (code >= 0 && code <= 3) || (code >= 6 && code <= 9) || code == 21; -} - -/* adven[i].status*/ //complete - assign a positive value for a help pc effect, a negative for harm pc -enum class eStatus { - MAIN = -1, // For saved games only - POISONED_WEAPON = 0, - BLESS_CURSE = 1, - POISON = 2, - HASTE_SLOW = 3, - INVULNERABLE = 4, - MAGIC_RESISTANCE = 5, - WEBS = 6, - DISEASE = 7, - INVISIBLE = 8, //sanctuary - DUMB = 9, - MARTYRS_SHIELD = 10, - ASLEEP = 11, - PARALYZED = 12, - ACID = 13, - FORCECAGE = 14, - // This one is new - // It's not quite a real status effect since it doesn't expire - CHARM = 15, -}; - -inline bool isStatusNegative(eStatus stat) { - switch(stat) { - case eStatus::MAIN: return false; - case eStatus::POISONED_WEAPON: return false; - case eStatus::BLESS_CURSE: return false; - case eStatus::POISON: return true; - case eStatus::HASTE_SLOW: return false; - case eStatus::INVULNERABLE: return false; - case eStatus::MAGIC_RESISTANCE: return false; - case eStatus::WEBS: return true; - case eStatus::DISEASE: return true; - case eStatus::INVISIBLE: return false; - case eStatus::DUMB: return true; - case eStatus::MARTYRS_SHIELD: return false; - case eStatus::ASLEEP: return true; - case eStatus::PARALYZED: return true; - case eStatus::ACID: return true; - case eStatus::FORCECAGE: return true; - case eStatus::CHARM: return true; - } - return false; -} - -enum class ePartyStatus { - STEALTH, - FLIGHT, - DETECT_LIFE, - FIREWALK, -}; - -enum class eAttitude { - DOCILE, HOSTILE_A, FRIENDLY, HOSTILE_B -}; - -enum class eMonstAbil { - NO_ABIL, - MISSILE, - - DAMAGE, - STATUS, - FIELD, - PETRIFY, - DRAIN_SP, - DRAIN_XP, - KILL, - STEAL_FOOD, - STEAL_GOLD, - STUN, - DAMAGE2, - STATUS2, - - SPLITS, - MARTYRS_SHIELD, - ABSORB_SPELLS, - MISSILE_WEB, - RAY_HEAT, - SPECIAL, - HIT_TRIGGER, - DEATH_TRIGGER, - - RADIATE, - SUMMON, -}; - -enum class eMonstMelee {SWING, CLAW, BITE, SLIME, PUNCH, STING, CLUB, BURN, HARM, STAB}; - -enum class eMonstMissile {DART, ARROW, SPEAR, ROCK, RAZORDISK, SPINE, KNIFE, BOLT, BOULDER, RAPID_ARROW}; - -enum class eMonstGen {RAY, TOUCH, GAZE, BREATH, SPIT}; - -enum class eMonstSummon {TYPE, LEVEL, SPECIES}; - -enum class eMonstAbilCat { - INVALID, MISSILE, GENERAL, SUMMON, RADIATE, SPECIAL -}; - -inline eMonstAbilCat getMonstAbilCategory(eMonstAbil what) { - if(what == eMonstAbil::NO_ABIL) - return eMonstAbilCat::SPECIAL; - if(what == eMonstAbil::MISSILE) - return eMonstAbilCat::MISSILE; - if(what >= eMonstAbil::DAMAGE && what <= eMonstAbil::STATUS2) - return eMonstAbilCat::GENERAL; - if(what >= eMonstAbil::SPLITS && what <= eMonstAbil::DEATH_TRIGGER) - return eMonstAbilCat::SPECIAL; - if(what == eMonstAbil::RADIATE) - return eMonstAbilCat::RADIATE; - if(what == eMonstAbil::SUMMON) - return eMonstAbilCat::SUMMON; - return eMonstAbilCat::INVALID; -} - -enum class eMonstTime { - ALWAYS, - APPEAR_ON_DAY, DISAPPEAR_ON_DAY, - SOMETIMES_C, SOMETIMES_A, SOMETIMES_B, - APPEAR_WHEN_EVENT, DISAPPEAR_WHEN_EVENT, - APPEAR_AFTER_CHOP, -}; - -/* Terrains Special Properties : scenario.ter_types[i].special */ //complete - -enum class eTerSpec { - NONE = 0, - CHANGE_WHEN_STEP_ON = 1, - DAMAGING = 2, // formerly "fire damage" - BRIDGE = 3, // new; formerly "cold damage" - BED = 4, // new; formerly "magic damage" - DANGEROUS = 5, // formerly "poison land" - UNUSED1 = 6, // formerly "disease land" - CRUMBLING = 7, - LOCKABLE = 8, - UNLOCKABLE = 9, - UNUSED2 = 10, // formerly "unlockable + bashable" - IS_A_SIGN = 11, - CALL_SPECIAL = 12, // formerly "call local special" - UNUSED3 = 13, // formerly "call scenario special" - IS_A_CONTAINER = 14, - WILDERNESS_CAVE = 15, - WILDERNESS_SURFACE = 16, // formerly "conveyor north" - WATERFALL_CAVE = 17, // formerly "conveyor east" - WATERFALL_SURFACE = 18, // formerly "conveyor south" - CONVEYOR = 19, // formerly "conveyor west" - BLOCKED_TO_MONSTERS = 20, - TOWN_ENTRANCE = 21, - CHANGE_WHEN_USED = 22, - CALL_SPECIAL_WHEN_USED = 23, - // 1. Change when step on (What to change to, number of sound, Unused) - // 2. Damaging terrain; can't rest here (Amount of damage done, multiplier, damage type) - // 3. Bridge - if the party boats over it, they get the option to land. (Unused, Unused, Unused) - // 4. Bed - change party graphic when they stand on this space - // 5. Dangerous land; can't rest here; percentage chance may be 0 (Strength, Percentage chance, status type) - // 6. Reserved - // 7. Crumbling terrain (Terrain to change to, strength?, destroyed by what - quickfire, shatter/move mountains, or both) - // 8. Lockable terrain (Terrain to change to when locked, Unused, Unused) - // 9. Unlockable terrain (Terrain to change to when locked, Difficulty, can be bashed) - // 10. Reserved - // 11. Sign (Unused, Unused, Unused) - // 12. Call special (Special to call, local or scenario?, Unused) - // 13. Reserved - // 14. Container (Unused, Unused, Unused) - // 15. Waterfall (Direction, Unused, Unused) - // 16. Conveyor Belt (Direction, Unused, Unused) - // 17. Reserved - // 18. Reserved - // 19. Reserved - // 20. Blocked to Monsters (Unused, Unused, Unused) - // 21. Town entrance (Terrain type if hidden, Unused, Unused) - // 22. Change when Used (Terrain to change to when used, Number of sound, Unused) - // 23. Call special when used (Special to call, local or scenario?, Unused) -}; - -enum class eTrimType { - NONE = 0, - WALL = 1, // not a trim, but trims will conform to it as if it's the same ground type (eg stone wall) - S, SE, E, NE, N, NW, W, SW, - NE_INNER, SE_INNER, SW_INNER, NW_INNER, - FRILLS = 14, // like on lava and underground water; no trim_ter required - WALKWAY = 16, // the game will draw walkway corners; trim_ter is base terrain to draw on - WATERFALL = 17, // special case for waterfalls - CITY = 18, // the game will join roads up to this space but not draw roads on the space -}; - -enum class eTerObstruct { - CLEAR = 0, - BLOCK_SIGHT = 1, - BLOCK_MONSTERS = 2, - BLOCK_MOVE = 3, - BLOCK_MOVE_AND_SHOOT = 4, - BLOCK_MOVE_AND_SIGHT = 5, -}; - -inline bool blocksMove(eTerObstruct block) { - int code = (int) block; - return code > 2; -} - -enum class eStepSnd {STEP, SQUISH, CRUNCH, NONE, SPLASH}; - -/* items[i].variety a.k.a item type (in editor) */ -enum class eItemType { - NO_ITEM = 0, - ONE_HANDED = 1, - TWO_HANDED = 2, - GOLD = 3, - BOW = 4, - ARROW = 5, - THROWN_MISSILE = 6, - POTION = 7, // potion/magic item - SCROLL = 8, // scroll/magic item - WAND = 9, - TOOL = 10, - FOOD = 11, - SHIELD = 12, - ARMOR = 13, - HELM = 14, - GLOVES = 15, - SHIELD_2 = 16, - // don't know why a second type of shield is used ; it is actually checked - // in the armor code -- see below - // and you can't equip another (12) shield while wearing it ... I didn't - // find a single item with this property in the bladbase.exs ... - BOOTS = 17, - RING = 18, - NECKLACE = 19, - WEAPON_POISON = 20, - NON_USE_OBJECT = 21, - PANTS = 22, - CROSSBOW = 23, - BOLTS = 24, - MISSILE_NO_AMMO = 25, //e.g slings - SPECIAL = 26, - QUEST = 27, -}; - -inline bool isArmourType(eItemType type) { - int code = (int) type; - return code >= 12 && code <= 17; -} - -inline bool isWeaponType(eItemType type) { - int code = (int) type; - return (code >= 1 && code <= 6 && code != 3) || (code >= 23 && code <= 25); -} - -inline bool isMissileType(eItemType type) { - return type == eItemType::ARROW || type == eItemType::BOLTS || type == eItemType::THROWN_MISSILE || type == eItemType::MISSILE_NO_AMMO; -} - -enum class eItemUse {HELP_ONE, HARM_ONE, HELP_ALL, HARM_ALL}; - -enum class eEnchant {PLUS_ONE, PLUS_TWO, PLUS_THREE, SHOOT_FLAME, FLAMING, PLUS_FIVE, BLESSED}; - -/* items[i].ability */ -enum class eItemAbil { - // Weapon abilities - NONE = 0, - DAMAGING_WEAPON = 1, - SLAYER_WEAPON = 2, - HEALING_WEAPON = 3, - EXPLODING_WEAPON = 4, - RETURNING_MISSILE = 5, - DISTANCE_MISSILE = 6, - SEEKING_MISSILE = 7, - ANTIMAGIC_WEAPON = 8, - STATUS_WEAPON = 9, - SOULSUCKER = 10, - UNUSED = 11, - WEAK_WEAPON = 12, - CAUSES_FEAR = 13, - WEAPON_CALL_SPECIAL = 14, - HP_DAMAGE = 15, - HP_DAMAGE_REVERSE = 16, - SP_DAMAGE = 17, - SP_DAMAGE_REVERSE = 18, - // General abilities - DAMAGE_PROTECTION = 30, - FULL_PROTECTION = 31, - MAGERY = 32, - EVASION = 33, - MARTYRS_SHIELD = 34, - ENCUMBERING = 35, - STATUS_PROTECTION = 36, - SKILL = 37, - BOOST_STAT = 38, - BOOST_WAR = 39, - BOOST_MAGIC = 40, - ACCURACY = 41, - THIEVING = 42, - GIANT_STRENGTH = 43, - LIGHTER_OBJECT = 44, - HEAVIER_OBJECT = 45, - OCCASIONAL_STATUS = 46, - HIT_CALL_SPECIAL = 47, - LIFE_SAVING = 48, - PROTECT_FROM_PETRIFY = 49, - REGENERATE = 50, - POISON_AUGMENT = 51, - RADIANT = 52, - WILL = 53, - FREE_ACTION = 54, - SPEED = 55, - SLOW_WEARER = 56, - PROTECT_FROM_SPECIES = 57, - LOCKPICKS = 58, - DRAIN_MISSILES = 59, - DROP_CALL_SPECIAL = 60, - // Usable - POISON_WEAPON = 70, - AFFECT_STATUS = 71, - CAST_SPELL = 72, - BLISS_DOOM = 73, - AFFECT_EXPERIENCE = 74, - AFFECT_SKILL_POINTS = 75, - AFFECT_HEALTH = 76, - AFFECT_SPELL_POINTS = 77, - LIGHT = 78, - AFFECT_PARTY_STATUS = 79, - HEALTH_POISON = 80, - CALL_SPECIAL = 81, - SUMMONING = 82, - MASS_SUMMONING = 83, - QUICKFIRE = 84, - MESSAGE = 85, - // Reagents - HOLLY = 150, // Holly/Toadstool - COMFREY = 151, // Comfrey Root - NETTLE = 152, // Glowing Nettle - WORMGRASS = 153, // Crypt Shroom/Wormgrass - ASPTONGUE = 154, // Asptongue Mold - EMBERF = 155, // Ember Flower - GRAYMOLD = 156, - MANDRAKE = 157, - SAPPHIRE = 158, - SMOKY_CRYSTAL = 159, - RESURRECTION_BALM = 160, -}; - -enum class eItemAbilCat { - INVALID = -1, - WEAPON, GENERAL, USABLE, REAGENT -}; - -inline eItemAbilCat getItemAbilCategory(eItemAbil abil) { - int code = (int) abil; - if(code >= 0 && code <= 13) - return eItemAbilCat::WEAPON; - if(code >= 30 && code <= 57) - return eItemAbilCat::GENERAL; - if(code >= 70 && code <= 129) - return eItemAbilCat::USABLE; - if(code >= 150 && code <= 161) - return eItemAbilCat::REAGENT; - return eItemAbilCat::INVALID; -} - -/* adven[i].skills */ //complete -enum class eSkill { - INVALID = -1, - STRENGTH = 0, - DEXTERITY = 1, - INTELLIGENCE = 2, - EDGED_WEAPONS = 3, - BASHING_WEAPONS = 4, - POLE_WEAPONS = 5, - THROWN_MISSILES = 6, - ARCHERY = 7, - DEFENSE = 8, - MAGE_SPELLS = 9, - PRIEST_SPELLS = 10, - MAGE_LORE = 11, - ALCHEMY = 12, - ITEM_LORE = 13, - DISARM_TRAPS = 14, - LOCKPICKING = 15, - ASSASSINATION = 16, - POISON = 17, - LUCK = 18, - MAX_HP = 19, - MAX_SP = 20, - // Magic values; only for check_party_stat() - CUR_HP = 100, - CUR_SP = 101, - CUR_XP = 102, - CUR_SKILL = 103, - CUR_LEVEL = 104, -}; - -/* adven[i].traits */ //complete -enum class eTrait { - TOUGHNESS = 0, - MAGICALLY_APT = 1, - AMBIDEXTROUS = 2, - NIMBLE = 3, - CAVE_LORE = 4, - WOODSMAN = 5, - GOOD_CONST = 6, - HIGHLY_ALERT = 7, - STRENGTH = 8, - RECUPERATION = 9, - SLUGGISH = 10, - MAGICALLY_INEPT = 11, - FRAIL = 12, - CHRONIC_DISEASE = 13, - BAD_BACK = 14, - PACIFIST = 15, - ANAMA = 16, -}; - - -/* damage type*/ -/* used as parameter to some functions */ -enum class eDamageType { - WEAPON = 0, - FIRE = 1, - POISON = 2, - MAGIC = 3, - UNBLOCKABLE = 4, - COLD = 5, - UNDEAD = 6, - DEMON = 7, - // Keep these two last - SPECIAL = 8, // Completely unblockable damage from assassination skill - MARKED = 10, -}; - -enum class eSpecCtx { - OUT_MOVE = 0, - TOWN_MOVE = 1, - COMBAT_MOVE = 2, - OUT_LOOK = 3, - TOWN_LOOK = 4, - ENTER_TOWN = 5, - LEAVE_TOWN = 6, - TALK = 7, // Special called during conversation - USE_SPEC_ITEM = 8, - TOWN_TIMER = 9, - SCEN_TIMER = 10, - PARTY_TIMER = 11, - KILL_MONST = 12, - OUTDOOR_ENC = 13, - FLEE_ENCOUNTER = 14, - WIN_ENCOUNTER = 15, - TARGET = 16, - USE_SPACE = 17, - SEE_MONST = 18, - MONST_SPEC_ABIL = 19, - TOWN_HOSTILE = 20, - ATTACKING_MELEE = 21, - ATTACKING_RANGE = 22, - ATTACKED_MELEE = 23, - ATTACKED_RANGE = 24, - HAIL = 25, // Special called by trying to initiate conversation - SHOPPING = 26, - DROP_ITEM = 27, - STARTUP = 28, -}; - -enum class eSpecType { - INVALID = -1, // A magic value used while processing nodes - NONE = 0, - SET_SDF = 1, - INC_SDF = 2, - DISPLAY_MSG = 3, - ENTER_SHOP = 4, - DISPLAY_SM_MSG = 5, - FLIP_SDF = 6, - SDF_RANDOM = 7, - SDF_ADD = 8, - SDF_DIFF = 9, - STORY_DIALOG = 10, - CANT_ENTER = 11, - CHANGE_TIME = 12, - SCEN_TIMER_START = 13, - PLAY_SOUND = 14, - CHANGE_HORSE_OWNER = 15, - CHANGE_BOAT_OWNER = 16, - SET_TOWN_VISIBILITY = 17, - MAJOR_EVENT_OCCURRED = 18, - FORCED_GIVE = 19, - BUY_ITEMS_OF_TYPE = 20, - CALL_GLOBAL = 21, - SET_SDF_ROW = 22, - COPY_SDF = 23, - DISPLAY_PICTURE = 24, - REST = 25, - TITLED_MSG = 26, - END_SCENARIO = 27, // add "win/lose" option - SET_POINTER = 28, - SET_CAMP_FLAG = 29, - PRINT_NUMS = 30, // For debugging - SDF_TIMES = 31, - SDF_DIVIDE = 32, // Computes both quotient and remainder - SDF_POWER = 33, - CHANGE_TER = 34, - SWAP_TER = 35, - TRANS_TER = 36, - CLEAR_BUF = 37, - APPEND_STRING = 38, - APPEND_NUM = 39, - APPEND_MONST = 40, - APPEND_ITEM = 41, - APPEND_TER = 42, - PAUSE = 43, - START_TALK = 44, - UPDATE_QUEST = 45, - SWAP_STR_BUF = 46, - STR_BUF_TO_SIGN = 47, - ONCE_GIVE_ITEM = 50, - ONCE_GIVE_SPEC_ITEM = 51, - ONCE_NULL = 52, - ONCE_SET_SDF = 53, - ONCE_DISPLAY_MSG = 54, - ONCE_DIALOG = 55, - UNUSED13 = 56, - UNUSED14 = 57, - ONCE_GIVE_ITEM_DIALOG = 58, - UNUSED15 = 59, - UNUSED16 = 60, - ONCE_OUT_ENCOUNTER = 61, - ONCE_TOWN_ENCOUNTER = 62, - ONCE_TRAP = 63, - SELECT_TARGET = 80, - DAMAGE = 81, - AFFECT_HP = 82, - AFFECT_SP = 83, - AFFECT_XP = 84, - AFFECT_SKILL_PTS = 85, - AFFECT_DEADNESS = 86, - AFFECT_STATUS = 87, - AFFECT_TRAITS = 88, - AFFECT_AP = 89, - AFFECT_NAME = 90, - AFFECT_LEVEL = 91, - AFFECT_MORALE = 92, - AFFECT_SOUL_CRYSTAL = 93, - GIVE_ITEM = 94, - AFFECT_MONST_TARG = 95, - AFFECT_MONST_ATT = 96, - AFFECT_MONST_STAT = 97, - AFFECT_STAT = 98, - AFFECT_MAGE_SPELL = 99, - AFFECT_PRIEST_SPELL = 100, - AFFECT_GOLD = 101, - AFFECT_FOOD = 102, - AFFECT_ALCHEMY = 103, - AFFECT_PARTY_STATUS = 104, - CREATE_NEW_PC = 105, - STORE_PC = 106, - UNSTORE_PC = 107, - IF_SDF = 130, - IF_TOWN_NUM = 131, - IF_RANDOM = 132, - IF_HAVE_SPECIAL_ITEM = 133, - IF_SDF_COMPARE = 134, - IF_TER_TYPE = 135, - IF_ALIVE = 136, - IF_HAS_GOLD = 137, - IF_HAS_FOOD = 138, - IF_ITEM_CLASS_ON_SPACE = 139, - IF_HAVE_ITEM_CLASS = 140, - IF_EQUIP_ITEM_CLASS = 141, - IF_MAGE_SPELL = 142, - IF_PRIEST_SPELL = 143, - IF_RECIPE = 144, - IF_STATUS = 145, - IF_LOOKING = 146, - IF_DAY_REACHED = 147, - IF_FIELDS = 148, - IF_PARTY_SIZE = 149, - IF_EVENT_OCCURRED = 150, - IF_SPECIES = 151, - IF_TRAIT = 152, - IF_STATISTIC = 153, - IF_TEXT_RESPONSE = 154, - IF_SDF_EQ = 155, - IF_CONTEXT = 156, - IF_NUM_RESPONSE = 157, - IF_IN_BOAT = 158, - IF_ON_HORSE = 159, - IF_QUEST = 160, - MAKE_TOWN_HOSTILE = 170, - TOWN_RUN_MISSILE = 171, - TOWN_MONST_ATTACK = 172, - TOWN_BOOM_SPACE = 173, - TOWN_MOVE_PARTY = 174, - TOWN_HIT_SPACE = 175, - TOWN_EXPLODE_SPACE = 176, - TOWN_LOCK_SPACE = 177, - TOWN_UNLOCK_SPACE = 178, - TOWN_SFX_BURST = 179, - TOWN_CREATE_WANDERING = 180, - TOWN_PLACE_MONST = 181, - TOWN_DESTROY_MONST = 182, - TOWN_NUKE_MONSTS = 183, - TOWN_GENERIC_LEVER = 184, - TOWN_GENERIC_PORTAL = 185, - TOWN_GENERIC_BUTTON = 186, - TOWN_GENERIC_STAIR = 187, - TOWN_LEVER = 188, - TOWN_PORTAL = 189, - TOWN_STAIR = 190, - TOWN_RELOCATE = 191, // Relocate outdoors - TOWN_PLACE_ITEM = 192, - TOWN_SPLIT_PARTY = 193, - TOWN_REUNITE_PARTY = 194, - TOWN_TIMER_START = 195, - TOWN_CHANGE_LIGHTING = 196, - TOWN_SET_ATTITUDE = 197, - TOWN_SET_CENTER = 198, - TOWN_LIFT_FOG = 199, - TOWN_START_TARGETING = 200, - TOWN_SPELL_PAT_FIELD = 201, - TOWN_SPELL_PAT_BOOM = 202, - TOWN_RELOCATE_CREATURE = 203, - TOWN_PLACE_LABEL = 204, - RECT_PLACE_FIELD = 210, - RECT_SET_EXPLORED = 211, - RECT_MOVE_ITEMS = 212, - RECT_DESTROY_ITEMS = 213, - RECT_CHANGE_TER = 214, - RECT_SWAP_TER = 215, - RECT_TRANS_TER = 216, - RECT_LOCK = 217, - RECT_UNLOCK = 218, - OUT_MAKE_WANDER = 225, - OUT_FORCE_TOWN = 226, - OUT_PLACE_ENCOUNTER = 227, - OUT_MOVE_PARTY = 228, // allow change sector -}; - -enum class eSpecCat { - INVALID = -1, - GENERAL, ONCE, AFFECT, IF_THEN, TOWN, RECT, OUTDOOR -}; - -inline eSpecCat getNodeCategory(eSpecType node) { - int code = (int) node; - if(code >= 0 && code <= 47) - return eSpecCat::GENERAL; - if(code >= 50 && code <= 63) - return eSpecCat::ONCE; - if(code >= 80 && code <= 107) - return eSpecCat::AFFECT; - if(code >= 130 && code <= 160) - return eSpecCat::IF_THEN; - if(code >= 170 && code <= 204) - return eSpecCat::TOWN; - if(code >= 210 && code <= 218) - return eSpecCat::RECT; - if(code >= 225 && code <= 228) - return eSpecCat::OUTDOOR; - return eSpecCat::INVALID; -} - -enum class eTalkNode { - REGULAR = 0, - DEP_ON_SDF = 1, - SET_SDF = 2, - INN = 3, - DEP_ON_TIME = 4, - DEP_ON_TIME_AND_EVENT = 5, - DEP_ON_TOWN = 6, - SHOP = 7, - TRAINING = 8, - JOB_BANK = 9, - SELL_WEAPONS = 13, - SELL_ARMOR = 14, - SELL_ITEMS = 15, - IDENTIFY = 16, - ENCHANT = 17, - BUY_INFO = 18, - BUY_SDF = 19, - BUY_SHIP = 20, - BUY_HORSE = 21, - BUY_SPEC_ITEM = 22, - RECEIVE_QUEST = 23, - BUY_TOWN_LOC = 24, - END_FORCE = 25, - END_FIGHT = 26, - END_ALARM = 27, // Town hostile - END_DIE = 28, - CALL_TOWN_SPEC = 29, - CALL_SCEN_SPEC = 30, -}; - -enum class eShopType {NORMAL, ALLOW_DEAD, RANDOM}; - -enum class eShopPrompt {SHOPPING, HEALING, MAGE, PRIEST, SPELLS, ALCHEMY, TRAINING}; - -enum class eShopItemType { - EMPTY, - // These ones must have these numbers in order for old scenarios to be ported correctly - ITEM = 1, - MAGE_SPELL = 2, - PRIEST_SPELL = 3, - ALCHEMY = 4, - SKILL, - TREASURE, - CLASS, - OPT_ITEM, - CALL_SPECIAL, - // All non-healing types must be above here and all healing types below, with HEAL_WOUNDS kept first - HEAL_WOUNDS, - CURE_POISON, - CURE_DISEASE, - CURE_ACID, - CURE_PARALYSIS, - REMOVE_CURSE, - DESTONE, - RAISE_DEAD, - RESURRECT, - CURE_DUMBFOUNDING, -}; - -// MARK: eEncNoteType -enum eEncNoteType { - NOTE_SCEN, - NOTE_OUT, - NOTE_TOWN, -}; - -// MARK: eFieldType -// This is a slight misnomer, as a couple of these are not true fields. -enum eFieldType { - SPECIAL_EXPLORED = 0, - WALL_FORCE = 1, - WALL_FIRE = 2, - FIELD_ANTIMAGIC = 3, - CLOUD_STINK = 4, - WALL_ICE = 5, - WALL_BLADES = 6, - CLOUD_SLEEP = 7, - // Begin fields saved in town setup - OBJECT_BLOCK = 8, - SPECIAL_SPOT = 9, // Space contains a white special spot - FIELD_WEB = 10, - OBJECT_CRATE = 11, - OBJECT_BARREL = 12, - BARRIER_FIRE = 13, - BARRIER_FORCE = 14, - FIELD_QUICKFIRE = 15, - // End fields saved in town setup - SFX_SMALL_BLOOD = 16, - SFX_MEDIUM_BLOOD = 17, - SFX_LARGE_BLOOD = 18, - SFX_SMALL_SLIME = 19, - SFX_LARGE_SLIME = 20, - SFX_ASH = 21, - SFX_BONES = 22, - SFX_RUBBLE = 23, - BARRIER_CAGE = 24, - SPECIAL_ROAD = 25, - // From here on are special values that don't index anything. - // Thus, they start at 32. - FIELD_DISPEL = 32, // Dispel field - FIELD_SMASH = 33, // Move Mountains - // Mustn't have anything >= 50 -}; - -// Field types are used to index bit fields. -// In this case, their values should be taken as a bit index that is set. -inline unsigned long operator&(unsigned long a, eFieldType b) { - return a & (1 << b); -} -inline unsigned long operator&(eFieldType a, unsigned long b) { - return (1 << a) & b; -} -inline unsigned long operator&(eFieldType a, eFieldType b) { - return (1 << a) & (1 << b); -} -inline unsigned long& operator &=(unsigned long& a, eFieldType b) { - a = a & b; - return a; -} -inline unsigned long operator|(unsigned long a, eFieldType b) { - return a | (1 << b); -} -inline unsigned long operator|(eFieldType a, unsigned long b) { - return (1 << a) | b; -} -inline unsigned long operator|(eFieldType a, eFieldType b) { - return (1 << a) | (1 << b); -} -inline unsigned long& operator |=(unsigned long& a, eFieldType b) { - a = a | b; - return a; -} -inline unsigned long operator^(unsigned long a, eFieldType b) { - return a ^ (1 << b); -} -inline unsigned long operator^(eFieldType a, unsigned long b) { - return (1 << a) ^ b; -} -inline unsigned long operator^(eFieldType a, eFieldType b) { - return (1 << a) ^ (1 << b); -} -inline unsigned long& operator ^=(unsigned long& a, eFieldType b) { - a = a ^ b; - return a; -} -inline unsigned long operator>>(eFieldType a, unsigned long b) { - return (1 << a) >> b; -} -inline unsigned long operator<<(eFieldType a, unsigned long b) { - return (1 << a) << b; -} -inline unsigned long operator~(eFieldType f) { - return ~(1 << f); -} - -enum class eSpell { - NONE = -1, - // Mage spells - LIGHT = 0, - SPARK = 1, - HASTE_MINOR = 2, - STRENGTH = 3, - SCARE = 4, - CLOUD_FLAME = 5, - IDENTIFY = 6, - SCRY_MONSTER = 7, - GOO = 8, - TRUE_SIGHT = 9, - POISON_MINOR = 10, - FLAME = 11, - SLOW = 12, - DUMBFOUND = 13, - ENVENOM = 14, - CLOUD_STINK = 15, - SUMMON_BEAST = 16, - CONFLAGRATION = 17, - DISPEL_SQUARE = 18, - CLOUD_SLEEP = 19, - UNLOCK = 20, - HASTE = 21, - FIREBALL = 22, - LIGHT_LONG = 23, - FEAR = 24, - WALL_FORCE = 25, - SUMMON_WEAK = 26, - ARROWS_FLAME = 27, - WEB = 28, - RESIST_MAGIC = 29, - POISON = 30, - ICE_BOLT = 31, - SLOW_GROUP = 32, - MAGIC_MAP = 33, - CAPTURE_SOUL = 34, - SIMULACRUM = 35, - ARROWS_VENOM = 36, - WALL_ICE = 37, - STEALTH = 38, - HASTE_MAJOR = 39, - FIRESTORM = 40, - DISPEL_BARRIER = 41, - BARRIER_FIRE = 42, - SUMMON = 43, - SHOCKSTORM = 44, - SPRAY_FIELDS = 45, - POISON_MAJOR = 46, - FEAR_GROUP = 47, - KILL = 48, - PARALYZE = 49, - DEMON = 50, - ANTIMAGIC = 51, - MINDDUEL = 52, - FLIGHT = 53, - SHOCKWAVE = 54, - BLESS_MAJOR = 55, - PARALYSIS_MASS = 56, - PROTECTION = 57, - SUMMON_MAJOR = 58, - BARRIER_FORCE = 59, - QUICKFIRE = 60, - ARROWS_DEATH = 61, - // Special spells - STRENGTHEN_TARGET = 62, - SUMMON_RAT = 63, - WALL_ICE_BALL = 64, - GOO_BOMB = 65, - FOUL_VAPOR = 66, - CLOUD_SLEEP_LARGE = 67, - ACID_SPRAY = 68, - PARALYZE_BEAM = 69, - SLEEP_MASS = 70, - RAVAGE_ENEMIES = 71, - BLADE_AURA = 72, - ICY_RAIN = 73, - FLAME_AURA = 74, - SUMMON_AID = 75, - SUMMON_AID_MAJOR = 76, - FLASH_STEP = 77, - // Priest spells - BLESS_MINOR = 100, - HEAL_MINOR = 101, - POISON_WEAKEN = 102, - TURN_UNDEAD = 103, - LOCATION = 104, - SANCTUARY = 105, - SYMBIOSIS = 106, - MANNA_MINOR = 107, - RITUAL_SANCTIFY = 108, - STUMBLE = 109, - BLESS = 110, - POISON_CURE = 111, - CURSE = 112, - LIGHT_DIVINE = 113, - WOUND = 114, - SUMMON_SPIRIT = 115, - MOVE_MOUNTAINS = 116, - CHARM_FOE = 117, - DISEASE = 118, - AWAKEN = 119, - HEAL = 120, - HEAL_ALL_LIGHT = 121, - HOLY_SCOURGE = 122, - DETECT_LIFE = 123, - PARALYSIS_CURE = 124, - MANNA = 125, - FORCEFIELD = 126, - DISEASE_CURE = 127, - RESTORE_MIND = 128, - SMITE = 129, - POISON_CURE_ALL = 130, - CURSE_ALL = 131, - DISPEL_UNDEAD = 132, - CURSE_REMOVE = 133, - STICKS_TO_SNAKES = 134, - MARTYRS_SHIELD = 135, - CLEANSE = 136, - FIREWALK = 137, - BLESS_PARTY = 138, - HEAL_MAJOR = 139, - RAISE_DEAD = 140, - FLAMESTRIKE = 141, - SANCTUARY_MASS = 142, - SUMMON_HOST = 143, - SHATTER = 144, - DISPEL_SPHERE = 145, - HEAL_ALL = 146, - REVIVE = 147, - HYPERACTIVITY = 148, - DESTONE = 149, - SUMMON_GUARDIAN = 150, - CHARM_MASS = 151, - PROTECTIVE_CIRCLE = 152, - PESTILENCE = 153, - REVIVE_ALL = 154, - RAVAGE_SPIRIT = 155, - RESURRECT = 156, - DIVINE_THUD = 157, - AVATAR = 158, - WALL_BLADES = 159, - WORD_RECALL = 160, - CLEANSE_MAJOR = 161, - // Special spells - DISPEL_FIELD = 162, - MOVE_MOUNTAINS_MASS = 163, - WRACK = 164, - UNHOLY_RAVAGING = 165, - AUGMENTATION = 166, - NIRVANA = 167, -}; - -inline bool isMage(eSpell spell) { - int code = (int) spell; - return code >= 0 && code < 62; -} - -inline bool isPriest(eSpell spell) { - int code = (int) spell; - return code >= 100 && code < 162; -} - -enum class eAlchemy { - NONE = -1, - CURE_WEAK = 0, - HEAL_WEAK = 1, - POISON_WEAK = 2, - SPEED_WEAK = 3, - POISON_MED = 4, - HEAL_MED = 5, - CURE_STRONG = 6, - SPEED_MED = 7, - GRAYMOLD = 8, - POWER_WEAK = 9, - CLARITY = 10, - POISON_STRONG = 11, - HEAL_STRONG = 12, - POISON_KILL = 13, - RESURRECT = 14, - POWER_MED = 15, - KNOWLEDGE = 16, - STRENGTH = 17, - BLISS = 18, - POWER_STRONG = 19, -}; - -// MARK: eLighting -enum eLighting { - LIGHT_NORMAL = 0, - LIGHT_DARK = 1, - LIGHT_DRAINS = 2, - LIGHT_NONE = 3, -}; - -#endif diff --git a/src/classes/special.hpp b/src/classes/special.hpp deleted file mode 100644 index b3d0e2bc..00000000 --- a/src/classes/special.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * special.h - * BoE - * - * Created by Celtic Minstrel on 20/04/09. - * - */ - -#ifndef BOE_DATA_SPECIAL_H -#define BOE_DATA_SPECIAL_H - -#include -#include -#include -#include "simpletypes.hpp" -#include "location.hpp" - -namespace legacy { struct special_node_type; }; - -class cSpecial { -public: - eSpecType type; - short sd1; - short sd2; - short pic; - short pictype; - short m1; - short m2; - short m3; - short ex1a; - short ex1b; - short ex1c; - short ex2a; - short ex2b; - short ex2c; - short jumpto; - - cSpecial(); - void import_legacy(legacy::special_node_type& old); - void writeTo(std::ostream& file, int n) const; -}; - -class cTimer { -public: - long time = 0; - short node_type = 0; - short node = -1; -}; - -struct pending_special_type { - spec_num_t spec; - eSpecCtx mode; - unsigned short type; // 0 - scen, 1 - out, 2 - town - location where; - long long trigger_time; -}; - -struct node_properties_t { - eSpecType self; - std::string opcode() const; - std::string name() const, descr() const; - std::string sdf1_lbl() const, sdf2_lbl() const, sdf1_hlp() const, sdf2_hlp() const; - std::string msg1_lbl() const, msg2_lbl() const, msg3_lbl() const, msg1_hlp() const, msg2_hlp() const, msg3_hlp() const; - std::string pic_lbl() const, pt_lbl() const, pic_hlp() const, pt_hlp() const; - std::string ex1a_lbl() const, ex1b_lbl() const, ex1c_lbl() const, ex1a_hlp() const, ex1b_hlp() const, ex1c_hlp() const; - std::string ex2a_lbl() const, ex2b_lbl() const, ex2c_lbl() const, ex2a_hlp() const, ex2b_hlp() const, ex2c_hlp() const; - std::string jmp_lbl() const, jmp_hlp() const; - char sd1_btn, sd2_btn, m1_btn, m2_btn, m3_btn, p_btn, pt_btn; - char x1a_btn, x1b_btn, x1c_btn, x2a_btn, x2b_btn, x2c_btn; - node_properties_t() {} - node_properties_t(std::initializer_list>); -}; - -const node_properties_t& operator* (eSpecType t); - -#endif diff --git a/src/classes/spell.hpp b/src/classes/spell.hpp deleted file mode 100644 index b256a3db..00000000 --- a/src/classes/spell.hpp +++ /dev/null @@ -1,53 +0,0 @@ -// -// spell.hpp -// BoE -// -// Created by Celtic Minstrel on 14-12-12. -// -// - -#ifndef BoE_DATA_SPELL_HPP -#define BoE_DATA_SPELL_HPP - -#include -#include "simpletypes.hpp" - -enum eSpellRefer {REFER_YES, REFER_IMMED, REFER_TARGET, REFER_FANCY}; -enum eSpellSelect {SELECT_NO, SELECT_ACTIVE, SELECT_ANY}; -// This one is meant for indexing a bit field -enum eSpellWhen {WHEN_COMBAT = 1, WHEN_TOWN = 2, WHEN_OUTDOORS = 4}; - -enum eSpellPat {PAT_SINGLE, PAT_SQ, PAT_SMSQ, PAT_OPENSQ, PAT_RAD2, PAT_RAD3, PAT_PLUS, PAT_WALL}; - -class cSpell { - static std::map dictionary; - friend const cSpell& operator*(eSpell spell_num); -public: - cSpell() {} // This is just here because the map doesn't work without it - cSpell(eSpell id); - cSpell& withRefer(eSpellRefer r); - cSpell& withCost(int c); - cSpell& withRange(int r); - cSpell& asLevel(int lvl); - cSpell& asType(eSkill type); - cSpell& asPeaceful(); - cSpell& needsSelect(eSpellSelect sel = SELECT_ACTIVE); - cSpell& when(eSpellWhen when); - const cSpell& finish(); - eSpell num; - eSpellRefer refer; - int cost, range, level; - eSpellSelect need_select; - eSkill type; - int when_cast; - bool peaceful = false; - std::string name() const; - bool is_priest() const; - static eSpell fromNum(eSkill type, int num); - static eSpell fromNum(int num); -}; - -// Need to declare this a second time in order for it to be in scope where it's needed -const cSpell& operator*(eSpell spell_num); - -#endif diff --git a/src/damage.hpp b/src/damage.hpp new file mode 100644 index 00000000..49618363 --- /dev/null +++ b/src/damage.hpp @@ -0,0 +1,122 @@ +// +// damage.hpp +// BoE +// +// Created by Celtic Minstrel on 17-04-13. +// +// + +#ifndef BoE_DATA_DAMAGE_HPP +#define BoE_DATA_DAMAGE_HPP + +enum class eDamageType { + WEAPON = 0, + FIRE = 1, + POISON = 2, + MAGIC = 3, + UNBLOCKABLE = 4, + COLD = 5, + UNDEAD = 6, + DEMON = 7, + // Keep these two last + SPECIAL = 8, // Completely unblockable damage from assassination skill + MARKED = 10, +}; + +enum class eStatus { + MAIN = -1, // For saved games only + POISONED_WEAPON = 0, + BLESS_CURSE = 1, + POISON = 2, + HASTE_SLOW = 3, + INVULNERABLE = 4, + MAGIC_RESISTANCE = 5, + WEBS = 6, + DISEASE = 7, + INVISIBLE = 8, //sanctuary + DUMB = 9, + MARTYRS_SHIELD = 10, + ASLEEP = 11, + PARALYZED = 12, + ACID = 13, + FORCECAGE = 14, + // This one is new + // It's not quite a real status effect since it doesn't expire + CHARM = 15, +}; + +inline bool isStatusNegative(eStatus stat) { + switch(stat) { + case eStatus::MAIN: return false; + case eStatus::POISONED_WEAPON: return false; + case eStatus::BLESS_CURSE: return false; + case eStatus::POISON: return true; + case eStatus::HASTE_SLOW: return false; + case eStatus::INVULNERABLE: return false; + case eStatus::MAGIC_RESISTANCE: return false; + case eStatus::WEBS: return true; + case eStatus::DISEASE: return true; + case eStatus::INVISIBLE: return false; + case eStatus::DUMB: return true; + case eStatus::MARTYRS_SHIELD: return false; + case eStatus::ASLEEP: return true; + case eStatus::PARALYZED: return true; + case eStatus::ACID: return true; + case eStatus::FORCECAGE: return true; + case eStatus::CHARM: return true; + } + return false; +} + +enum class ePartyStatus { + STEALTH, + FLIGHT, + DETECT_LIFE, + FIREWALK, +}; + +enum class eMainStatus { + ABSENT = 0, // absent, empty slot + ALIVE = 1, + DEAD = 2, + DUST = 3, + STONE = 4, + FLED = 5, + SURFACE = 6, // fled to surface? + WON = 7, + SPLIT = 10, + SPLIT_ABSENT = SPLIT + ABSENT, + SPLIT_ALIVE = SPLIT + ALIVE, + SPLIT_DEAD = SPLIT + DEAD, + SPLIT_DUST = SPLIT + DUST, + SPLIT_STONE = SPLIT + STONE, + SPLIT_FLED = SPLIT + FLED, + SPLIT_SURFACE = SPLIT + SURFACE, + SPLIT_WON = SPLIT + WON, +}; + +inline eMainStatus exceptSplit(eMainStatus stat) { + if(int(stat) >= 10) + return (eMainStatus) (-10 + (int)stat); + return stat; +} + +inline bool isSplit(eMainStatus stat) { + return int(stat) >= 10; +} + +inline bool isAbsent(eMainStatus stat) { + return stat == eMainStatus::ABSENT || int(stat) > 4; +} + +inline bool isDead(eMainStatus stat) { + int code = (int) stat; + return code > 1 && code < 5; +} + +std::ostream& operator << (std::ostream& out, eStatus e); +std::istream& operator >> (std::istream& in, eStatus& e); +std::ostream& operator << (std::ostream& out, eDamageType e); +std::istream& operator >> (std::istream& in, eDamageType& e); + +#endif diff --git a/src/dialogxml/3choice.cpp b/src/dialogxml/dialogs/3choice.cpp similarity index 100% rename from src/dialogxml/3choice.cpp rename to src/dialogxml/dialogs/3choice.cpp diff --git a/src/dialogxml/3choice.hpp b/src/dialogxml/dialogs/3choice.hpp similarity index 100% rename from src/dialogxml/3choice.hpp rename to src/dialogxml/dialogs/3choice.hpp diff --git a/src/dialogxml/choicedlog.cpp b/src/dialogxml/dialogs/choicedlog.cpp similarity index 100% rename from src/dialogxml/choicedlog.cpp rename to src/dialogxml/dialogs/choicedlog.cpp diff --git a/src/dialogxml/choicedlog.hpp b/src/dialogxml/dialogs/choicedlog.hpp similarity index 100% rename from src/dialogxml/choicedlog.hpp rename to src/dialogxml/dialogs/choicedlog.hpp diff --git a/src/dialogxml/dialog.cpp b/src/dialogxml/dialogs/dialog.cpp similarity index 99% rename from src/dialogxml/dialog.cpp rename to src/dialogxml/dialogs/dialog.cpp index a5cad547..a15db75d 100644 --- a/src/dialogxml/dialog.cpp +++ b/src/dialogxml/dialogs/dialog.cpp @@ -10,9 +10,7 @@ #include #include "dialog.hpp" #include "graphtool.hpp" -#include "soundtool.hpp" -using namespace std; -using namespace ticpp; +#include "sounds.hpp" #include "pict.hpp" #include "button.hpp" #include "field.hpp" @@ -25,9 +23,11 @@ using namespace ticpp; #include "cursors.hpp" #include "prefs.hpp" +using namespace std; +using namespace ticpp; + // TODO: Would be nice if I could avoid depending on mainPtr extern sf::RenderWindow mainPtr; -extern cursor_type current_cursor; extern sf::Texture bg_gworld; const short cDialog::BG_DARK = 5, cDialog::BG_LIGHT = 16; @@ -386,7 +386,7 @@ void cDialog::run(std::function onopen){ cDialog* formerTop = topWindow; // TODO: The introduction of the static topWindow means I may be able to use this instead of parent->win; do I still need parent? sf::RenderWindow* parentWin = &(parent ? parent->win : mainPtr); - cursor_type former_curs = current_cursor; + cursor_type former_curs = Cursor::current; set_cursor(sword_curs); using kb = sf::Keyboard; kb::Key k; diff --git a/src/dialogxml/dialog.hpp b/src/dialogxml/dialogs/dialog.hpp similarity index 100% rename from src/dialogxml/dialog.hpp rename to src/dialogxml/dialogs/dialog.hpp diff --git a/src/dialogxml/dialog.keys.hpp b/src/dialogxml/dialogs/dialog.keys.hpp similarity index 100% rename from src/dialogxml/dialog.keys.hpp rename to src/dialogxml/dialogs/dialog.keys.hpp diff --git a/src/dialogxml/dlogevt.hpp b/src/dialogxml/dialogs/dlogevt.hpp similarity index 100% rename from src/dialogxml/dlogevt.hpp rename to src/dialogxml/dialogs/dlogevt.hpp diff --git a/src/dialogxml/pictchoice.cpp b/src/dialogxml/dialogs/pictchoice.cpp similarity index 100% rename from src/dialogxml/pictchoice.cpp rename to src/dialogxml/dialogs/pictchoice.cpp diff --git a/src/dialogxml/pictchoice.hpp b/src/dialogxml/dialogs/pictchoice.hpp similarity index 100% rename from src/dialogxml/pictchoice.hpp rename to src/dialogxml/dialogs/pictchoice.hpp diff --git a/src/dialogxml/strchoice.cpp b/src/dialogxml/dialogs/strchoice.cpp similarity index 100% rename from src/dialogxml/strchoice.cpp rename to src/dialogxml/dialogs/strchoice.cpp diff --git a/src/dialogxml/strchoice.hpp b/src/dialogxml/dialogs/strchoice.hpp similarity index 100% rename from src/dialogxml/strchoice.hpp rename to src/dialogxml/dialogs/strchoice.hpp diff --git a/src/dialogxml/strdlog.cpp b/src/dialogxml/dialogs/strdlog.cpp similarity index 100% rename from src/dialogxml/strdlog.cpp rename to src/dialogxml/dialogs/strdlog.cpp diff --git a/src/dialogxml/strdlog.hpp b/src/dialogxml/dialogs/strdlog.hpp similarity index 98% rename from src/dialogxml/strdlog.hpp rename to src/dialogxml/dialogs/strdlog.hpp index 5bffd8ce..60ae94d2 100644 --- a/src/dialogxml/strdlog.hpp +++ b/src/dialogxml/dialogs/strdlog.hpp @@ -12,7 +12,7 @@ #include #include #include "pictypes.hpp" -#include "soundtool.hpp" // for snd_num_t +#include "sounds.hpp" // for snd_num_t #include "dialog.hpp" /// The signature of a record handler for cStrDlog. diff --git a/src/dialogxml/basicbtns.cpp b/src/dialogxml/widgets/basicbtns.cpp similarity index 100% rename from src/dialogxml/basicbtns.cpp rename to src/dialogxml/widgets/basicbtns.cpp diff --git a/src/dialogxml/button.cpp b/src/dialogxml/widgets/button.cpp similarity index 99% rename from src/dialogxml/button.cpp rename to src/dialogxml/widgets/button.cpp index c1ea3013..80c06a72 100644 --- a/src/dialogxml/button.cpp +++ b/src/dialogxml/widgets/button.cpp @@ -19,7 +19,7 @@ #include #include -#include "restypes.hpp" +#include "res_image.hpp" extern sf::Texture bg_gworld; diff --git a/src/dialogxml/button.hpp b/src/dialogxml/widgets/button.hpp similarity index 100% rename from src/dialogxml/button.hpp rename to src/dialogxml/widgets/button.hpp diff --git a/src/dialogxml/control.cpp b/src/dialogxml/widgets/control.cpp similarity index 99% rename from src/dialogxml/control.cpp rename to src/dialogxml/widgets/control.cpp index 0cf29b3e..07a94afc 100644 --- a/src/dialogxml/control.cpp +++ b/src/dialogxml/widgets/control.cpp @@ -9,12 +9,13 @@ #include "control.hpp" #include #include "dialog.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "button.hpp" #include "graphtool.hpp" -#include "restypes.hpp" +#include "res_image.hpp" #include "mathutil.hpp" #include "prefs.hpp" +#include "cursors.hpp" void cControl::setText(std::string l){ lbl = l; diff --git a/src/dialogxml/control.hpp b/src/dialogxml/widgets/control.hpp similarity index 100% rename from src/dialogxml/control.hpp rename to src/dialogxml/widgets/control.hpp diff --git a/src/dialogxml/field.cpp b/src/dialogxml/widgets/field.cpp similarity index 100% rename from src/dialogxml/field.cpp rename to src/dialogxml/widgets/field.cpp diff --git a/src/dialogxml/field.hpp b/src/dialogxml/widgets/field.hpp similarity index 100% rename from src/dialogxml/field.hpp rename to src/dialogxml/widgets/field.hpp diff --git a/src/dialogxml/message.cpp b/src/dialogxml/widgets/message.cpp similarity index 100% rename from src/dialogxml/message.cpp rename to src/dialogxml/widgets/message.cpp diff --git a/src/dialogxml/message.hpp b/src/dialogxml/widgets/message.hpp similarity index 100% rename from src/dialogxml/message.hpp rename to src/dialogxml/widgets/message.hpp diff --git a/src/dialogxml/pict.cpp b/src/dialogxml/widgets/pict.cpp similarity index 99% rename from src/dialogxml/pict.cpp rename to src/dialogxml/widgets/pict.cpp index d7394c18..12dfacf1 100644 --- a/src/dialogxml/pict.cpp +++ b/src/dialogxml/widgets/pict.cpp @@ -13,7 +13,7 @@ #include "graphtool.hpp" #include "dialog.hpp" -#include "restypes.hpp" +#include "res_image.hpp" extern sf::Texture bg_gworld; extern cCustomGraphics spec_scen_g; diff --git a/src/dialogxml/pict.hpp b/src/dialogxml/widgets/pict.hpp similarity index 100% rename from src/dialogxml/pict.hpp rename to src/dialogxml/widgets/pict.hpp diff --git a/src/dialogxml/pictypes.hpp b/src/dialogxml/widgets/pictypes.hpp similarity index 100% rename from src/dialogxml/pictypes.hpp rename to src/dialogxml/widgets/pictypes.hpp diff --git a/src/dialogxml/scrollbar.cpp b/src/dialogxml/widgets/scrollbar.cpp similarity index 99% rename from src/dialogxml/scrollbar.cpp rename to src/dialogxml/widgets/scrollbar.cpp index 0ad5d1a3..8551d380 100644 --- a/src/dialogxml/scrollbar.cpp +++ b/src/dialogxml/widgets/scrollbar.cpp @@ -7,9 +7,10 @@ // #include "scrollbar.hpp" -#include "restypes.hpp" +#include "res_image.hpp" #include "graphtool.hpp" #include "mathutil.hpp" +#include "cursors.hpp" std::string cScrollbar::scroll_textures[NUM_STYLES] = { "dlogscrollwh", diff --git a/src/dialogxml/scrollbar.hpp b/src/dialogxml/widgets/scrollbar.hpp similarity index 100% rename from src/dialogxml/scrollbar.hpp rename to src/dialogxml/widgets/scrollbar.hpp diff --git a/src/dialogxml/scrollpane.cpp b/src/dialogxml/widgets/scrollpane.cpp similarity index 100% rename from src/dialogxml/scrollpane.cpp rename to src/dialogxml/widgets/scrollpane.cpp diff --git a/src/dialogxml/scrollpane.hpp b/src/dialogxml/widgets/scrollpane.hpp similarity index 100% rename from src/dialogxml/scrollpane.hpp rename to src/dialogxml/widgets/scrollpane.hpp diff --git a/src/dialogxml/stack.cpp b/src/dialogxml/widgets/stack.cpp similarity index 100% rename from src/dialogxml/stack.cpp rename to src/dialogxml/widgets/stack.cpp diff --git a/src/dialogxml/stack.hpp b/src/dialogxml/widgets/stack.hpp similarity index 100% rename from src/dialogxml/stack.hpp rename to src/dialogxml/widgets/stack.hpp diff --git a/src/fields.hpp b/src/fields.hpp new file mode 100644 index 00000000..f23267cf --- /dev/null +++ b/src/fields.hpp @@ -0,0 +1,103 @@ +// +// fields.hpp +// BoE +// +// Created by Celtic Minstrel on 17-04-13. +// +// + +#ifndef BoE_FIELDS_HPP +#define BoE_FIELDS_HPP + +// This is a slight misnomer, as a couple of these are not true fields. +enum eFieldType { + SPECIAL_EXPLORED = 0, + WALL_FORCE = 1, + WALL_FIRE = 2, + FIELD_ANTIMAGIC = 3, + CLOUD_STINK = 4, + WALL_ICE = 5, + WALL_BLADES = 6, + CLOUD_SLEEP = 7, + // Begin fields saved in town setup + OBJECT_BLOCK = 8, + SPECIAL_SPOT = 9, // Space contains a white special spot + FIELD_WEB = 10, + OBJECT_CRATE = 11, + OBJECT_BARREL = 12, + BARRIER_FIRE = 13, + BARRIER_FORCE = 14, + FIELD_QUICKFIRE = 15, + // End fields saved in town setup + SFX_SMALL_BLOOD = 16, + SFX_MEDIUM_BLOOD = 17, + SFX_LARGE_BLOOD = 18, + SFX_SMALL_SLIME = 19, + SFX_LARGE_SLIME = 20, + SFX_ASH = 21, + SFX_BONES = 22, + SFX_RUBBLE = 23, + BARRIER_CAGE = 24, + SPECIAL_ROAD = 25, + // From here on are special values that don't index anything. + // Thus, they start at 32. + FIELD_DISPEL = 32, // Dispel field + FIELD_SMASH = 33, // Move Mountains + // Mustn't have anything >= 50 +}; + +// Field types are used to index bit fields. +// In this case, their values should be taken as a bit index that is set. +inline unsigned long operator&(unsigned long a, eFieldType b) { + return a & (1 << b); +} +inline unsigned long operator&(eFieldType a, unsigned long b) { + return (1 << a) & b; +} +inline unsigned long operator&(eFieldType a, eFieldType b) { + return (1 << a) & (1 << b); +} +inline unsigned long& operator &=(unsigned long& a, eFieldType b) { + a = a & b; + return a; +} +inline unsigned long operator|(unsigned long a, eFieldType b) { + return a | (1 << b); +} +inline unsigned long operator|(eFieldType a, unsigned long b) { + return (1 << a) | b; +} +inline unsigned long operator|(eFieldType a, eFieldType b) { + return (1 << a) | (1 << b); +} +inline unsigned long& operator |=(unsigned long& a, eFieldType b) { + a = a | b; + return a; +} +inline unsigned long operator^(unsigned long a, eFieldType b) { + return a ^ (1 << b); +} +inline unsigned long operator^(eFieldType a, unsigned long b) { + return (1 << a) ^ b; +} +inline unsigned long operator^(eFieldType a, eFieldType b) { + return (1 << a) ^ (1 << b); +} +inline unsigned long& operator ^=(unsigned long& a, eFieldType b) { + a = a ^ b; + return a; +} +inline unsigned long operator>>(eFieldType a, unsigned long b) { + return (1 << a) >> b; +} +inline unsigned long operator<<(eFieldType a, unsigned long b) { + return (1 << a) << b; +} +inline unsigned long operator~(eFieldType f) { + return ~(1 << f); +} + +std::ostream& operator << (std::ostream& out, eFieldType e); +std::istream& operator >> (std::istream& in, eFieldType& e); + +#endif diff --git a/src/classes/estreams.cpp b/src/fileio/estreams.cpp similarity index 96% rename from src/classes/estreams.cpp rename to src/fileio/estreams.cpp index 3af14e9c..f9225dc0 100644 --- a/src/classes/estreams.cpp +++ b/src/fileio/estreams.cpp @@ -6,6 +6,7 @@ // // +#include #include #include #include @@ -13,17 +14,37 @@ #include #include #include -#include "simpletypes.hpp" -#include "spell.hpp" -std::string oboeVersionString() { +#include "spell.hpp" +#include "item_abilities.hpp" +#include "item_variety.hpp" +#include "damage.hpp" +#include "race.hpp" +#include "location.hpp" +#include "fields.hpp" +#include "quest.hpp" +#include "shop.hpp" +#include "terrain_abilities.hpp" + +#include "monster.hpp" +#include "party.hpp" +#include "town.hpp" +#include "talking.hpp" +#include "scenario.hpp" + +const char* oboeVersionString() { + static std::shared_ptr version; + if(version) return version.get(); unsigned short M, m, f; M = OBOE_CURRENT_VERSION >> 16; m = (OBOE_CURRENT_VERSION & 0xff00) >> 8; f = OBOE_CURRENT_VERSION & 0xff; std::ostringstream sout; sout << M << '.' << m << '.' << f; - return sout.str(); + std::string vers = sout.str(); + version.reset(new char[vers.length()], std::default_delete()); + std::copy(vers.begin(), vers.end(), version.get()); + return version.get(); } // A simple lookup map based on the concept of a trie diff --git a/src/tools/fileio.cpp b/src/fileio/fileio.cpp similarity index 93% rename from src/tools/fileio.cpp rename to src/fileio/fileio.cpp index 2c0cd2a9..64954a0f 100644 --- a/src/tools/fileio.cpp +++ b/src/fileio/fileio.cpp @@ -9,23 +9,21 @@ #include "fileio.hpp" #include +#include #include -#include "restypes.hpp" -#include "cursors.hpp" +#include "res_image.hpp" +#include "res_cursor.hpp" +#include "res_font.hpp" +#include "res_strings.hpp" +#include "res_sound.hpp" bool mac_is_intel; fs::path progDir, tempDir, scenDir; -// Cursors included here so that they needn't be unnecessarily duplicated in platform-specific files -cursor_type current_cursor = sword_curs; -cursor_type arrow_curs[3][3] = { - {NW_curs, N_curs, NE_curs}, - {W_curs, wait_curs, E_curs}, - {SW_curs, S_curs, SE_curs}, -}; +// This is here to avoid unnecessarily duplicating it in platform-specific files. +cursor_type Cursor::current = sword_curs; -#include std::filebuf logfile; void init_directories(const char* exec_path) { diff --git a/src/tools/fileio.hpp b/src/fileio/fileio.hpp similarity index 97% rename from src/tools/fileio.hpp rename to src/fileio/fileio.hpp index 54d854ef..66c40e48 100644 --- a/src/tools/fileio.hpp +++ b/src/fileio/fileio.hpp @@ -18,8 +18,6 @@ class cScenario; class cUniverse; -namespace fs = boost::filesystem; // TODO: Centralize this alias! - fs::path locate_scenario(std::string scen_name); bool load_scenario(fs::path file_to_load, cScenario& scenario, bool only_header = false); diff --git a/src/tools/fileio_party.cpp b/src/fileio/fileio_party.cpp similarity index 100% rename from src/tools/fileio_party.cpp rename to src/fileio/fileio_party.cpp diff --git a/src/tools/fileio_scen.cpp b/src/fileio/fileio_scen.cpp similarity index 99% rename from src/tools/fileio_scen.cpp rename to src/fileio/fileio_scen.cpp index 5b7ea336..e1164b4d 100644 --- a/src/tools/fileio_scen.cpp +++ b/src/fileio/fileio_scen.cpp @@ -24,11 +24,12 @@ #include "tarball.hpp" #include "porting.hpp" -#include "restypes.hpp" +#include "res_image.hpp" +#include "res_sound.hpp" // Because the full template definition needs to be visible in this file // Also, for some reason, it's not found in the include paths, so use a relative path -#include "../classes/town_import.tpp" +#include "../scenario/town_import.tpp" bool cur_scen_is_mac = true; extern cCustomGraphics spec_scen_g; diff --git a/src/tools/gzstream/COPYING.LIB b/src/fileio/gzstream/COPYING.LIB similarity index 100% rename from src/tools/gzstream/COPYING.LIB rename to src/fileio/gzstream/COPYING.LIB diff --git a/src/tools/gzstream/Makefile b/src/fileio/gzstream/Makefile similarity index 100% rename from src/tools/gzstream/Makefile rename to src/fileio/gzstream/Makefile diff --git a/src/tools/gzstream/README b/src/fileio/gzstream/README similarity index 100% rename from src/tools/gzstream/README rename to src/fileio/gzstream/README diff --git a/src/tools/gzstream/gzstream.cpp b/src/fileio/gzstream/gzstream.cpp similarity index 100% rename from src/tools/gzstream/gzstream.cpp rename to src/fileio/gzstream/gzstream.cpp diff --git a/src/tools/gzstream/gzstream.h b/src/fileio/gzstream/gzstream.h similarity index 100% rename from src/tools/gzstream/gzstream.h rename to src/fileio/gzstream/gzstream.h diff --git a/src/tools/gzstream/index.html b/src/fileio/gzstream/index.html similarity index 100% rename from src/tools/gzstream/index.html rename to src/fileio/gzstream/index.html diff --git a/src/tools/gzstream/test_gunzip.cpp b/src/fileio/gzstream/test_gunzip.cpp similarity index 100% rename from src/tools/gzstream/test_gunzip.cpp rename to src/fileio/gzstream/test_gunzip.cpp diff --git a/src/tools/gzstream/test_gzip.cpp b/src/fileio/gzstream/test_gzip.cpp similarity index 100% rename from src/tools/gzstream/test_gzip.cpp rename to src/fileio/gzstream/test_gzip.cpp diff --git a/src/tools/gzstream/version b/src/fileio/gzstream/version similarity index 100% rename from src/tools/gzstream/version rename to src/fileio/gzstream/version diff --git a/src/tools/map_parse.cpp b/src/fileio/map_parse.cpp similarity index 100% rename from src/tools/map_parse.cpp rename to src/fileio/map_parse.cpp diff --git a/src/tools/map_parse.hpp b/src/fileio/map_parse.hpp similarity index 100% rename from src/tools/map_parse.hpp rename to src/fileio/map_parse.hpp diff --git a/src/tools/resmgr/restypes.hpp b/src/fileio/resmgr/res_cursor.hpp similarity index 53% rename from src/tools/resmgr/restypes.hpp rename to src/fileio/resmgr/res_cursor.hpp index cb742f35..045f95f1 100644 --- a/src/tools/resmgr/restypes.hpp +++ b/src/fileio/resmgr/res_cursor.hpp @@ -6,40 +6,21 @@ * */ -#ifndef BOE_RESTYPES_H -#define BOE_RESTYPES_H +#ifndef BOE_RES_CURSOR_HPP +#define BOE_RES_CURSOR_HPP -#include -#include - -#include "resmgr.hpp" -#include -#include #include -#include -#include #include +#include +#include "resmgr.hpp" #include "cursors.hpp" -#include "location.hpp" -using ImageRsrc = sf::Texture; using CursorRsrc = Cursor; -using FontRsrc = sf::Font; -using StringRsrc = std::vector; -using SoundRsrc = sf::SoundBuffer; // Redeclare this instead of including "fileio.h" extern std::ostream& std_fmterr(std::ostream& out); namespace ResMgr { - /// Load an image from a PNG file. - template<> inline ImageRsrc* resLoader::operator() (fs::path fpath) { - ImageRsrc* img = new ImageRsrc(); - if(img->loadFromFile(fpath.string())) return img; - delete img; - throw xResMgrErr("Failed to load PNG image: " + fpath.string()); - } - /// Load a cursor from a GIF file. /// The cursor's hotspot location is stored in a GIF comment, with the following syntax (case-sensitive): /// "Hotspot(x,y)" @@ -86,40 +67,6 @@ namespace ResMgr { CursorRsrc* cur = new Cursor(fpath.string(),x,y); return cur; } - - /// Load a font from a TTF file. - template<> inline FontRsrc* resLoader::operator() (fs::path fpath) { - FontRsrc* theFont = new FontRsrc; - if(theFont->loadFromFile(fpath.string())) return theFont; - delete theFont; - throw xResMgrErr("Failed to find font: " + fpath.string()); - } - - /// Load a list of strings from a TXT file. - /// Each line in the file becomes one string in the resulting list. - /// (Empty lines are included too.) - template<> inline StringRsrc* resLoader::operator() (fs::path fpath) { - std::ifstream fin(fpath.c_str()); - if(fin.fail()) { - std::cerr << std_fmterr << ": Error opening file"; - throw xResMgrErr("Failed to load string list: " + fpath.string()); - } - std::string next; - StringRsrc* strlist = new StringRsrc; - while(!fin.eof()) { - getline(fin,next); - strlist->push_back(next); - } - return strlist; - } - - /// Load a sound from a WAV file. - template<> inline SoundRsrc* resLoader::operator() (fs::path fpath) { - SoundRsrc* snd = new SoundRsrc; - if(snd->loadFromFile(fpath.string())) return snd; - delete snd; - throw xResMgrErr("Failed to load WAV sound: " + fpath.string()); - } } #endif diff --git a/src/fileio/resmgr/res_font.hpp b/src/fileio/resmgr/res_font.hpp new file mode 100644 index 00000000..36457f19 --- /dev/null +++ b/src/fileio/resmgr/res_font.hpp @@ -0,0 +1,31 @@ +/* + * restypes.h + * BoE + * + * Created by Celtic Minstrel on 10-08-25. + * + */ + +#ifndef BOE_RES_FONT_HPP +#define BOE_RES_FONT_HPP + +#include "resmgr.hpp" +#include +#include + +using FontRsrc = sf::Font; + +// Redeclare this instead of including "fileio.h" +extern std::ostream& std_fmterr(std::ostream& out); + +namespace ResMgr { + /// Load a font from a TTF file. + template<> inline FontRsrc* resLoader::operator() (fs::path fpath) { + FontRsrc* theFont = new FontRsrc; + if(theFont->loadFromFile(fpath.string())) return theFont; + delete theFont; + throw xResMgrErr("Failed to find font: " + fpath.string()); + } +} + +#endif diff --git a/src/fileio/resmgr/res_image.hpp b/src/fileio/resmgr/res_image.hpp new file mode 100644 index 00000000..cb9510a4 --- /dev/null +++ b/src/fileio/resmgr/res_image.hpp @@ -0,0 +1,31 @@ +/* + * restypes.h + * BoE + * + * Created by Celtic Minstrel on 10-08-25. + * + */ + +#ifndef BOE_RES_IMAGE_HPP +#define BOE_RES_IMAGE_HPP + +#include +#include +#include "resmgr.hpp" + +using ImageRsrc = sf::Texture; + +// Redeclare this instead of including "fileio.h" +extern std::ostream& std_fmterr(std::ostream& out); + +namespace ResMgr { + /// Load an image from a PNG file. + template<> inline ImageRsrc* resLoader::operator() (fs::path fpath) { + ImageRsrc* img = new ImageRsrc(); + if(img->loadFromFile(fpath.string())) return img; + delete img; + throw xResMgrErr("Failed to load PNG image: " + fpath.string()); + } +} + +#endif diff --git a/src/fileio/resmgr/res_sound.hpp b/src/fileio/resmgr/res_sound.hpp new file mode 100644 index 00000000..4d48bb3a --- /dev/null +++ b/src/fileio/resmgr/res_sound.hpp @@ -0,0 +1,31 @@ +/* + * restypes.h + * BoE + * + * Created by Celtic Minstrel on 10-08-25. + * + */ + +#ifndef BOE_RES_SOUND_HPP +#define BOE_RES_SOUND_HPP + +#include +#include +#include "resmgr.hpp" + +using SoundRsrc = sf::SoundBuffer; + +// Redeclare this instead of including "fileio.h" +extern std::ostream& std_fmterr(std::ostream& out); + +namespace ResMgr { + /// Load a sound from a WAV file. + template<> inline SoundRsrc* resLoader::operator() (fs::path fpath) { + SoundRsrc* snd = new SoundRsrc; + if(snd->loadFromFile(fpath.string())) return snd; + delete snd; + throw xResMgrErr("Failed to load WAV sound: " + fpath.string()); + } +} + +#endif diff --git a/src/fileio/resmgr/res_strings.hpp b/src/fileio/resmgr/res_strings.hpp new file mode 100644 index 00000000..4424c5a6 --- /dev/null +++ b/src/fileio/resmgr/res_strings.hpp @@ -0,0 +1,41 @@ +/* + * restypes.h + * BoE + * + * Created by Celtic Minstrel on 10-08-25. + * + */ + +#ifndef BOE_RES_STRINGS_HPP +#define BOE_RES_STRINGS_HPP + +#include +#include +#include "resmgr.hpp" + +using StringRsrc = std::vector; + +// Redeclare this instead of including "fileio.h" +extern std::ostream& std_fmterr(std::ostream& out); + +namespace ResMgr { + /// Load a list of strings from a TXT file. + /// Each line in the file becomes one string in the resulting list. + /// (Empty lines are included too.) + template<> inline StringRsrc* resLoader::operator() (fs::path fpath) { + std::ifstream fin(fpath.c_str()); + if(fin.fail()) { + std::cerr << std_fmterr << ": Error opening file"; + throw xResMgrErr("Failed to load string list: " + fpath.string()); + } + std::string next; + StringRsrc* strlist = new StringRsrc; + while(!fin.eof()) { + getline(fin,next); + strlist->push_back(next); + } + return strlist; + } +} + +#endif diff --git a/src/tools/resmgr/resmgr.hpp b/src/fileio/resmgr/resmgr.hpp similarity index 99% rename from src/tools/resmgr/resmgr.hpp rename to src/fileio/resmgr/resmgr.hpp index 7f479ad3..82a0c515 100644 --- a/src/tools/resmgr/resmgr.hpp +++ b/src/fileio/resmgr/resmgr.hpp @@ -36,7 +36,6 @@ namespace std { /// for the desired resource type. The operator() receives the /// full file path with the extension already applied. namespace ResMgr { - namespace fs = boost::filesystem; /// The signature of an ID map function. using idMapFn = std::function; diff --git a/src/tools/resmgr/restypes.cpp b/src/fileio/resmgr/restypes.cpp similarity index 78% rename from src/tools/resmgr/restypes.cpp rename to src/fileio/resmgr/restypes.cpp index f984a35e..230b54b6 100644 --- a/src/tools/resmgr/restypes.cpp +++ b/src/fileio/resmgr/restypes.cpp @@ -6,7 +6,11 @@ // // -#include "restypes.hpp" +#include "res_image.hpp" +#include "res_cursor.hpp" +#include "res_font.hpp" +#include "res_strings.hpp" +#include "res_sound.hpp" namespace ResMgr { template<> const std::string resLoader::file_ext = "png"; diff --git a/src/tools/specials_parse.cpp b/src/fileio/special_parse.cpp similarity index 100% rename from src/tools/specials_parse.cpp rename to src/fileio/special_parse.cpp diff --git a/src/tools/special_parse.hpp b/src/fileio/special_parse.hpp similarity index 100% rename from src/tools/special_parse.hpp rename to src/fileio/special_parse.hpp diff --git a/src/tools/tarball.cpp b/src/fileio/tarball.cpp similarity index 100% rename from src/tools/tarball.cpp rename to src/fileio/tarball.cpp diff --git a/src/tools/tarball.hpp b/src/fileio/tarball.hpp similarity index 100% rename from src/tools/tarball.hpp rename to src/fileio/tarball.hpp diff --git a/src/dialogxml/xml-parser/build_instructions.txt b/src/fileio/xml-parser/build_instructions.txt similarity index 100% rename from src/dialogxml/xml-parser/build_instructions.txt rename to src/fileio/xml-parser/build_instructions.txt diff --git a/src/dialogxml/xml-parser/changes.txt b/src/fileio/xml-parser/changes.txt similarity index 100% rename from src/dialogxml/xml-parser/changes.txt rename to src/fileio/xml-parser/changes.txt diff --git a/src/dialogxml/xml-parser/dox b/src/fileio/xml-parser/dox similarity index 100% rename from src/dialogxml/xml-parser/dox rename to src/fileio/xml-parser/dox diff --git a/src/dialogxml/xml-parser/readme.txt b/src/fileio/xml-parser/readme.txt similarity index 100% rename from src/dialogxml/xml-parser/readme.txt rename to src/fileio/xml-parser/readme.txt diff --git a/src/dialogxml/xml-parser/ticpp.cpp b/src/fileio/xml-parser/ticpp.cpp similarity index 100% rename from src/dialogxml/xml-parser/ticpp.cpp rename to src/fileio/xml-parser/ticpp.cpp diff --git a/src/dialogxml/xml-parser/ticpp.h b/src/fileio/xml-parser/ticpp.h similarity index 100% rename from src/dialogxml/xml-parser/ticpp.h rename to src/fileio/xml-parser/ticpp.h diff --git a/src/dialogxml/xml-parser/ticpp.lua b/src/fileio/xml-parser/ticpp.lua similarity index 100% rename from src/dialogxml/xml-parser/ticpp.lua rename to src/fileio/xml-parser/ticpp.lua diff --git a/src/dialogxml/xml-parser/ticppapi.h b/src/fileio/xml-parser/ticppapi.h similarity index 100% rename from src/dialogxml/xml-parser/ticppapi.h rename to src/fileio/xml-parser/ticppapi.h diff --git a/src/dialogxml/xml-parser/ticpprc.h b/src/fileio/xml-parser/ticpprc.h similarity index 100% rename from src/dialogxml/xml-parser/ticpprc.h rename to src/fileio/xml-parser/ticpprc.h diff --git a/src/dialogxml/xml-parser/tinyprint.cpp b/src/fileio/xml-parser/tinyprint.cpp similarity index 100% rename from src/dialogxml/xml-parser/tinyprint.cpp rename to src/fileio/xml-parser/tinyprint.cpp diff --git a/src/dialogxml/xml-parser/tinyprint.h b/src/fileio/xml-parser/tinyprint.h similarity index 100% rename from src/dialogxml/xml-parser/tinyprint.h rename to src/fileio/xml-parser/tinyprint.h diff --git a/src/dialogxml/xml-parser/tinystr.cpp b/src/fileio/xml-parser/tinystr.cpp similarity index 100% rename from src/dialogxml/xml-parser/tinystr.cpp rename to src/fileio/xml-parser/tinystr.cpp diff --git a/src/dialogxml/xml-parser/tinystr.h b/src/fileio/xml-parser/tinystr.h similarity index 100% rename from src/dialogxml/xml-parser/tinystr.h rename to src/fileio/xml-parser/tinystr.h diff --git a/src/dialogxml/xml-parser/tinyxml.cpp b/src/fileio/xml-parser/tinyxml.cpp similarity index 100% rename from src/dialogxml/xml-parser/tinyxml.cpp rename to src/fileio/xml-parser/tinyxml.cpp diff --git a/src/dialogxml/xml-parser/tinyxml.h b/src/fileio/xml-parser/tinyxml.h similarity index 100% rename from src/dialogxml/xml-parser/tinyxml.h rename to src/fileio/xml-parser/tinyxml.h diff --git a/src/dialogxml/xml-parser/tinyxmlerror.cpp b/src/fileio/xml-parser/tinyxmlerror.cpp similarity index 100% rename from src/dialogxml/xml-parser/tinyxmlerror.cpp rename to src/fileio/xml-parser/tinyxmlerror.cpp diff --git a/src/dialogxml/xml-parser/tinyxmlparser.cpp b/src/fileio/xml-parser/tinyxmlparser.cpp similarity index 100% rename from src/dialogxml/xml-parser/tinyxmlparser.cpp rename to src/fileio/xml-parser/tinyxmlparser.cpp diff --git a/src/dialogxml/xml-parser/tutorial_gettingStarted.txt b/src/fileio/xml-parser/tutorial_gettingStarted.txt similarity index 100% rename from src/dialogxml/xml-parser/tutorial_gettingStarted.txt rename to src/fileio/xml-parser/tutorial_gettingStarted.txt diff --git a/src/dialogxml/xml-parser/tutorial_ticpp.txt b/src/fileio/xml-parser/tutorial_ticpp.txt similarity index 100% rename from src/dialogxml/xml-parser/tutorial_ticpp.txt rename to src/fileio/xml-parser/tutorial_ticpp.txt diff --git a/src/boe.actions.cpp b/src/game/boe.actions.cpp similarity index 99% rename from src/boe.actions.cpp rename to src/game/boe.actions.cpp index 473b2e6a..dacb8c93 100644 --- a/src/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -20,7 +20,7 @@ #include "boe.newgraph.hpp" #include "boe.combat.hpp" #include "boe.items.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "boe.infodlg.hpp" #include "boe.main.hpp" #include "mathutil.hpp" @@ -1072,7 +1072,7 @@ bool handle_action(sf::Event event) { if(overall_mode == MODE_OUTDOORS) { give_help(62,0); display_map(); - make_cursor_sword(); + set_cursor(sword_curs); } else if(overall_mode == MODE_TOWN || overall_mode == MODE_COMBAT) handle_get_items(did_something, need_redraw, need_reprint); break; @@ -1106,7 +1106,7 @@ bool handle_action(sf::Event event) { else if(overall_mode == MODE_TOWN) { give_help(62,0); display_map(); - make_cursor_sword(); + set_cursor(sword_curs); } else handle_missile(need_redraw, need_reprint); break; diff --git a/src/boe.actions.hpp b/src/game/boe.actions.hpp similarity index 97% rename from src/boe.actions.hpp rename to src/game/boe.actions.hpp index 6e3ad468..144a1e89 100644 --- a/src/boe.actions.hpp +++ b/src/game/boe.actions.hpp @@ -4,7 +4,6 @@ #include #include "location.hpp" -#include "simpletypes.hpp" void init_screen_locs(); bool prime_time(); diff --git a/src/boe.appleevents.mm b/src/game/boe.appleevents.mm similarity index 100% rename from src/boe.appleevents.mm rename to src/game/boe.appleevents.mm diff --git a/src/boe.combat.cpp b/src/game/boe.combat.cpp similarity index 99% rename from src/boe.combat.cpp rename to src/game/boe.combat.cpp index b3462d55..4a28dc7f 100644 --- a/src/boe.combat.cpp +++ b/src/game/boe.combat.cpp @@ -13,7 +13,7 @@ #include "boe.items.hpp" #include "boe.party.hpp" #include "boe.combat.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "boe.town.hpp" #include "boe.specials.hpp" #include "boe.graphutil.hpp" diff --git a/src/boe.combat.hpp b/src/game/boe.combat.hpp similarity index 100% rename from src/boe.combat.hpp rename to src/game/boe.combat.hpp diff --git a/src/boe.consts.hpp b/src/game/boe.consts.hpp similarity index 100% rename from src/boe.consts.hpp rename to src/game/boe.consts.hpp diff --git a/src/boe.dlgutil.cpp b/src/game/boe.dlgutil.cpp similarity index 99% rename from src/boe.dlgutil.cpp rename to src/game/boe.dlgutil.cpp index 3e2b77d3..05bcd715 100644 --- a/src/boe.dlgutil.cpp +++ b/src/game/boe.dlgutil.cpp @@ -16,7 +16,7 @@ #include "boe.townspec.hpp" #include "boe.main.hpp" #include "boe.items.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include #include "boe.newgraph.hpp" #include "boe.infodlg.hpp" @@ -26,14 +26,14 @@ #include "choicedlog.hpp" #include "winutil.hpp" #include "fileio.hpp" -#include "restypes.hpp" +#include "res_strings.hpp" #include "scrollbar.hpp" #include "button.hpp" #include "pict.hpp" #include #include "prefs.hpp" #include "shop.hpp" -#include "restypes.hpp" +#include "cursors.hpp" extern short stat_window; extern eGameMode overall_mode; @@ -1065,7 +1065,7 @@ void handle_talk_event(location p) { void do_sign(short town_num, short which_sign, short sign_type) { std::string sign_text; - make_cursor_sword(); + set_cursor(sword_curs); cChoiceDlog sign("view-sign"); cPict& pict = dynamic_cast(sign->getControl("ter")); @@ -1153,7 +1153,7 @@ static bool prefs_event_filter (cDialog& me, std::string id, eKeyMod) { } void pick_preferences() { - make_cursor_sword(); + set_cursor(sword_curs); cDialog prefsDlog("preferences"); prefsDlog.attachClickHandlers(&prefs_event_filter, {"okay", "cancel"}); @@ -1288,7 +1288,7 @@ static bool edit_party_event_filter(cDialog& me, std::string item_hit, eKeyMod) } void edit_party() { - make_cursor_sword(); + set_cursor(sword_curs); cDialog pcDialog("edit-party"); std::vector buttons = {"done", "help"}; @@ -1334,7 +1334,7 @@ void tip_of_day() { short page = get_ran(1,0,ResMgr::get("tips")->size() - 51); - make_cursor_sword(); + set_cursor(sword_curs); cDialog tips("tip-of-day"); tips.attachClickHandlers(std::bind(tip_of_day_event_filter, _1, _2, std::ref(page)),{"done","next"}); @@ -1416,7 +1416,7 @@ short pick_a_scen() { err.show(); return -1; } - make_cursor_sword(); + set_cursor(sword_curs); cDialog pickScen("pick-scenario"); short page = 0; @@ -1435,7 +1435,7 @@ short pick_a_scen() { short pick_prefab_scen() { - make_cursor_sword(); + set_cursor(sword_curs); cChoiceDlog pickScenario("pick-prefab-scen", {"cancel", "scen1", "scen2", "scen3"}); diff --git a/src/boe.dlgutil.hpp b/src/game/boe.dlgutil.hpp similarity index 97% rename from src/boe.dlgutil.hpp rename to src/game/boe.dlgutil.hpp index cec7a409..7eedb392 100644 --- a/src/boe.dlgutil.hpp +++ b/src/game/boe.dlgutil.hpp @@ -3,7 +3,6 @@ #include #include "dialog.hpp" -#include "simpletypes.hpp" #include "shop.hpp" void start_shop_mode(short which,short cost_adj,std::string store_name); diff --git a/src/boe.fileio.cpp b/src/game/boe.fileio.cpp similarity index 98% rename from src/boe.fileio.cpp rename to src/game/boe.fileio.cpp index 641316c5..20f53347 100644 --- a/src/boe.fileio.cpp +++ b/src/game/boe.fileio.cpp @@ -15,12 +15,12 @@ #include "boe.infodlg.hpp" #include "boe.graphutil.hpp" #include "graphtool.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "mathutil.hpp" #include "strdlog.hpp" #include "fileio.hpp" +#include "cursors.hpp" #include -#include "restypes.hpp" #define DONE_BUTTON_ITEM 1 @@ -129,7 +129,7 @@ void finish_load_party(){ } void shift_universe_left() { - make_cursor_watch(); + set_cursor(watch_curs); save_outdoor_maps(); univ.party.outdoor_corner.x--; @@ -157,7 +157,7 @@ void shift_universe_left() { } void shift_universe_right() { - make_cursor_watch(); + set_cursor(watch_curs); save_outdoor_maps(); univ.party.outdoor_corner.x++; univ.party.i_w_c.x--; @@ -182,7 +182,7 @@ void shift_universe_right() { } void shift_universe_up() { - make_cursor_watch(); + set_cursor(watch_curs); save_outdoor_maps(); univ.party.outdoor_corner.y--; univ.party.i_w_c.y++; @@ -208,7 +208,7 @@ void shift_universe_up() { } void shift_universe_down() { - make_cursor_watch(); + set_cursor(watch_curs); save_outdoor_maps(); univ.party.outdoor_corner.y++; @@ -348,7 +348,7 @@ void build_scen_headers() { std::cout << progDir << '\n' << scenDir << std::endl; scen_headers.clear(); fs::recursive_directory_iterator iter(scenDir); - make_cursor_watch(); + set_cursor(watch_curs); while(iter != fs::recursive_directory_iterator()) { fs::file_status stat = iter->status(); diff --git a/src/boe.fileio.hpp b/src/game/boe.fileio.hpp similarity index 87% rename from src/boe.fileio.hpp rename to src/game/boe.fileio.hpp index b3845153..9955d533 100644 --- a/src/boe.fileio.hpp +++ b/src/game/boe.fileio.hpp @@ -4,9 +4,6 @@ #include #include "location.hpp" -#include "simpletypes.hpp" - -namespace fs = boost::filesystem; // TODO: Centralize this alias! void finish_load_party(); void change_rect_terrain(rectangle r,ter_num_t terrain_type,short probability,bool hollow); @@ -30,6 +27,6 @@ void build_scen_headers(); bool load_scenario_header(fs::path filename/*,short header_entry*/); fs::path locate_scenario(std::string scen_name); - void alter_rect(rectangle *r); +void alter_rect(rectangle *r); #endif diff --git a/src/boe.global.hpp b/src/game/boe.global.hpp similarity index 100% rename from src/boe.global.hpp rename to src/game/boe.global.hpp diff --git a/src/boe.graphics.cpp b/src/game/boe.graphics.cpp similarity index 99% rename from src/boe.graphics.cpp rename to src/game/boe.graphics.cpp index 88425d28..34bd1ffb 100644 --- a/src/boe.graphics.cpp +++ b/src/game/boe.graphics.cpp @@ -13,7 +13,7 @@ #include "boe.locutils.hpp" #include "boe.text.hpp" #include "graphtool.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "mathutil.hpp" #include "button.hpp" @@ -25,7 +25,7 @@ #include "scrollbar.hpp" -#include "restypes.hpp" +#include "res_image.hpp" #include "boe.menus.hpp" #include "winutil.hpp" #include "prefs.hpp" diff --git a/src/boe.graphics.hpp b/src/game/boe.graphics.hpp similarity index 98% rename from src/boe.graphics.hpp rename to src/game/boe.graphics.hpp index 3118047e..bcbe278f 100644 --- a/src/boe.graphics.hpp +++ b/src/game/boe.graphics.hpp @@ -4,7 +4,6 @@ #include #include "location.hpp" -#include "simpletypes.hpp" enum { REFRESH_NONE = 0, diff --git a/src/boe.graphutil.cpp b/src/game/boe.graphutil.cpp similarity index 99% rename from src/boe.graphutil.cpp rename to src/game/boe.graphutil.cpp index 795d9bdc..ffaaf92c 100644 --- a/src/boe.graphutil.cpp +++ b/src/game/boe.graphutil.cpp @@ -14,11 +14,11 @@ #include "boe.infodlg.hpp" #include "boe.monster.hpp" #include "boe.specials.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "graphtool.hpp" #include "mathutil.hpp" #include "strdlog.hpp" -#include "restypes.hpp" +#include "res_image.hpp" extern sf::RenderWindow mainPtr; extern rectangle windRect; diff --git a/src/boe.graphutil.hpp b/src/game/boe.graphutil.hpp similarity index 97% rename from src/boe.graphutil.hpp rename to src/game/boe.graphutil.hpp index 09c27b8e..21708fd6 100644 --- a/src/boe.graphutil.hpp +++ b/src/game/boe.graphutil.hpp @@ -4,7 +4,6 @@ #include "pict.hpp" #include "location.hpp" -#include "simpletypes.hpp" #include "graphtool.hpp" void draw_one_terrain_spot (short i,short j,short terrain_to_draw); diff --git a/src/boe.infodlg.cpp b/src/game/boe.infodlg.cpp similarity index 98% rename from src/boe.infodlg.cpp rename to src/game/boe.infodlg.cpp index 2fadf3d1..140b16e1 100644 --- a/src/boe.infodlg.cpp +++ b/src/game/boe.infodlg.cpp @@ -14,7 +14,7 @@ #include "boe.party.hpp" #include "boe.locutils.hpp" #include "boe.text.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "boe.infodlg.hpp" #include "boe.fileio.hpp" #include "boe.main.hpp" @@ -22,11 +22,11 @@ #include "strdlog.hpp" #include "button.hpp" #include "fileio.hpp" -#include "restypes.hpp" #include #include "prefs.hpp" #include "spell.hpp" #include "view_dialogs.hpp" +#include "cursors.hpp" short mage_spell_pos = 0,priest_spell_pos = 0,skill_pos = 0; @@ -116,7 +116,7 @@ void display_spells(eSkill mode,short force_spell,cDialog* parent) { else priest_spell_pos = force_spell; } - make_cursor_sword(); + set_cursor(sword_curs); cDialog spellInfo("spell-info", parent); spellInfo.attachClickHandlers(std::bind(display_spells_event_filter,_1,_2,mode), {"done","left","right"}); @@ -172,7 +172,7 @@ void display_skills(eSkill force_skill,cDialog* parent) { if(skill_pos > 18) skill_pos = 18; - make_cursor_sword(); + set_cursor(sword_curs); cDialog skillDlog("skill-info", parent); skillDlog.attachClickHandlers(display_skills_event_filter,{"done", "left", "right"}); @@ -208,7 +208,7 @@ void display_pc_item(short pc_num,short item,cItem si,cDialog* parent) { if(pc_num == 6) store_i = si; else store_i = univ.party[pc_num].items[item]; - make_cursor_sword(); + set_cursor(sword_curs); cDialog itemInfo("item-info",parent); // By attaching the click handler to "id" and "magic", we suppress normal LED behaviour @@ -264,7 +264,7 @@ void display_monst(short array_pos,cCreature *which_m,short mode) { if(mode == 1) full_roster = true; else store_m = *which_m; - make_cursor_sword(); + set_cursor(sword_curs); cDialog monstInfo("monster-info"); auto event_filter = std::bind(display_monst_event_filter, _1, _2,std::ref(store_m)); @@ -307,7 +307,7 @@ void display_alchemy() { cur_entry = 3; - make_cursor_sword(); + set_cursor(sword_curs); cDialog alchemy("many-str"); alchemy.attachClickHandlers(display_alchemy_event_filter, {"done", "left", "right"}); @@ -441,7 +441,7 @@ void give_pc_info(short pc_num) { using namespace std::placeholders; std::string str; - make_cursor_sword(); + set_cursor(sword_curs); cDialog pcInfo("pc-info"); pcInfo.attachClickHandlers(std::bind(give_pc_info_event_filter, _1, _2, std::ref(pc_num)), {"done", "left", "right"}); @@ -507,7 +507,7 @@ void adventure_notes() { return; } - make_cursor_sword(); + set_cursor(sword_curs); cDialog encNotes("adventure-notes"); encNotes.attachClickHandlers(adventure_notes_event_filter, {"done", "left", "right", "del1", "del2", "del3"}); @@ -567,7 +567,7 @@ void talk_notes() { return; } - make_cursor_sword(); + set_cursor(sword_curs); cDialog talkNotes("talk-notes"); talkNotes.attachClickHandlers(talk_notes_event_filter, {"done", "left", "right", "del"}); @@ -620,7 +620,7 @@ void journal() { store_num_i = univ.party.journal.size(); store_page_on = 0; - make_cursor_sword(); + set_cursor(sword_curs); cDialog journal("event-journal"); journal.attachClickHandlers(journal_event_filter, {"done", "left", "right"}); diff --git a/src/boe.infodlg.hpp b/src/game/boe.infodlg.hpp similarity index 98% rename from src/boe.infodlg.hpp rename to src/game/boe.infodlg.hpp index f8cab0a2..509c82de 100644 --- a/src/boe.infodlg.hpp +++ b/src/game/boe.infodlg.hpp @@ -2,7 +2,6 @@ #ifndef BOE_GAME_INFODLG_H #define BOE_GAME_INFODLG_H -#include "simpletypes.hpp" #include "item.hpp" #include "monster.hpp" #include "pc.hpp" diff --git a/src/boe.items.cpp b/src/game/boe.items.cpp similarity index 99% rename from src/boe.items.cpp rename to src/game/boe.items.cpp index 71f7b091..39a31834 100644 --- a/src/boe.items.cpp +++ b/src/game/boe.items.cpp @@ -14,18 +14,18 @@ #include "boe.locutils.hpp" #include "boe.newgraph.hpp" #include "boe.infodlg.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "boe.monster.hpp" #include "boe.main.hpp" #include "graphtool.hpp" #include "mathutil.hpp" #include "strdlog.hpp" #include "3choice.hpp" -#include "restypes.hpp" #include "message.hpp" #include #include #include "winutil.hpp" +#include "cursors.hpp" extern short stat_window,which_combat_type; extern eGameMode overall_mode; @@ -528,7 +528,7 @@ bool display_item(location from_loc,short /*pc_num*/,short mode, bool check_cont // short item_array[130]; std::vector item_array; - make_cursor_sword(); + set_cursor(sword_curs); short current_getting_pc = univ.cur_pc; @@ -589,7 +589,7 @@ bool show_get_items(std::string titleText, std::vector& itemRefs, short } short custom_choice_dialog(std::array& strs,short pic_num,ePicType pic_type,std::array& buttons) { - make_cursor_sword(); + set_cursor(sword_curs); std::vector vec(strs.begin(), strs.end()); // Strip off trailing empty strings @@ -664,7 +664,7 @@ static bool get_num_of_items_event_filter(cDialog& me, std::string, eKeyMod) { //town_num; // Will be 0 - 200 for town, 200 - 290 for outdoors //short sign_type; // terrain type short get_num_of_items(short max_num) { - make_cursor_sword(); + set_cursor(sword_curs); cDialog numPanel("get-num"); numPanel.attachClickHandlers(get_num_of_items_event_filter, {"okay"}); @@ -692,10 +692,6 @@ void init_mini_map() { } } -void make_cursor_watch() { - set_cursor(watch_curs); -} - void place_glands(location where,mon_num_t m_type) { cItem store_i; cMonster monst; @@ -848,7 +844,7 @@ static bool get_text_response_event_filter(cDialog& me, std::string, eKeyMod) { } std::string get_text_response(std::string prompt, pic_num_t pic) { - make_cursor_sword(); + set_cursor(sword_curs); cDialog strPanel("get-response"); strPanel.attachClickHandlers(get_text_response_event_filter, {"okay"}); @@ -868,7 +864,7 @@ short get_num_response(short min, short max, std::string prompt) { std::ostringstream sout; sout << prompt; - make_cursor_sword(); + set_cursor(sword_curs); cDialog numPanel("get-num"); numPanel.attachClickHandlers(get_num_of_items_event_filter, {"okay"}); @@ -905,7 +901,7 @@ static bool select_pc_event_filter (cDialog& me, std::string item_hit, eKeyMod) short char_select_pc(short mode,const char *title) { short item_hit; - make_cursor_sword(); + set_cursor(sword_curs); cDialog selectPc("select-pc"); selectPc.attachClickHandlers(select_pc_event_filter, {"cancel", "pick1", "pick2", "pick3", "pick4", "pick5", "pick6"}); diff --git a/src/boe.items.hpp b/src/game/boe.items.hpp similarity index 98% rename from src/boe.items.hpp rename to src/game/boe.items.hpp index bfcff871..969e4ee4 100644 --- a/src/boe.items.hpp +++ b/src/game/boe.items.hpp @@ -27,7 +27,6 @@ short get_num_of_items(short max_num); void init_mini_map(); void draw_help_dialog_item_buttons(cDialog& dialog,short item); void draw_help_dialog_forcefields(cDialog& dialog,short item); -void make_cursor_watch() ; void place_glands(location where,mon_num_t m_type); void reset_item_max(); short item_val(cItem item); diff --git a/src/boe.locutils.cpp b/src/game/boe.locutils.cpp similarity index 100% rename from src/boe.locutils.cpp rename to src/game/boe.locutils.cpp diff --git a/src/boe.locutils.hpp b/src/game/boe.locutils.hpp similarity index 100% rename from src/boe.locutils.hpp rename to src/game/boe.locutils.hpp diff --git a/src/boe.main.cpp b/src/game/boe.main.cpp similarity index 98% rename from src/boe.main.cpp rename to src/game/boe.main.cpp index 7d7e6d08..336a5750 100644 --- a/src/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -18,7 +18,7 @@ #include "boe.infodlg.hpp" #include "boe.main.hpp" #include "winutil.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "graphtool.hpp" #include "mathutil.hpp" #include "fileio.hpp" @@ -30,9 +30,6 @@ #include "prefs.hpp" #include "button.hpp" -extern cursor_type arrow_curs[3][3]; -extern cursor_type current_cursor; - bool All_Done = false; sf::Event event; sf::RenderWindow mainPtr; @@ -170,7 +167,7 @@ void init_boe(int argc, char* argv[]) { mainPtr.clear(sf::Color::Black); mainPtr.display(); - make_cursor_watch(); + set_cursor(watch_curs); boost::thread init_thread([]() { init_buf(); check_for_intel(); @@ -244,7 +241,7 @@ void Handle_One_Event() { case sf::Event::MouseLeft: // Make sure we don't have an arrow cursor when it's outside the window - make_cursor_sword(); + set_cursor(sword_curs); break; case sf::Event::GainedFocus: @@ -568,7 +565,7 @@ void handle_menu_choice(eMenu item_hit) { give_help(62,0); display_map(); } - make_cursor_sword(); + set_cursor(sword_curs); break; case eMenu::HELP_TOC: if(fs::is_directory(progDir/"doc")) @@ -640,7 +637,7 @@ void change_cursor(location where_curs) { cursor_needed = arrow_curs[cursor_direction.y + 1][cursor_direction.x + 1]; } - if(cursor_needed != current_cursor) + if(cursor_needed != Cursor::current) set_cursor(cursor_needed); } diff --git a/src/boe.main.hpp b/src/game/boe.main.hpp similarity index 100% rename from src/boe.main.hpp rename to src/game/boe.main.hpp diff --git a/src/boe.menus.hpp b/src/game/boe.menus.hpp similarity index 100% rename from src/boe.menus.hpp rename to src/game/boe.menus.hpp diff --git a/src/boe.menus.mac.mm b/src/game/boe.menus.mac.mm similarity index 100% rename from src/boe.menus.mac.mm rename to src/game/boe.menus.mac.mm diff --git a/src/boe.menus.win.cpp b/src/game/boe.menus.win.cpp similarity index 100% rename from src/boe.menus.win.cpp rename to src/game/boe.menus.win.cpp diff --git a/src/boe.monster.cpp b/src/game/boe.monster.cpp similarity index 99% rename from src/boe.monster.cpp rename to src/game/boe.monster.cpp index f1a636c0..3ee59ec6 100644 --- a/src/boe.monster.cpp +++ b/src/game/boe.monster.cpp @@ -10,7 +10,7 @@ #include "boe.text.hpp" #include "boe.specials.hpp" #include "boe.items.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "boe.graphics.hpp" #include "boe.newgraph.hpp" #include "boe.main.hpp" diff --git a/src/boe.monster.hpp b/src/game/boe.monster.hpp similarity index 100% rename from src/boe.monster.hpp rename to src/game/boe.monster.hpp diff --git a/src/boe.newgraph.cpp b/src/game/boe.newgraph.cpp similarity index 99% rename from src/boe.newgraph.cpp rename to src/game/boe.newgraph.cpp index f942a2cc..9c16ae04 100644 --- a/src/boe.newgraph.cpp +++ b/src/game/boe.newgraph.cpp @@ -13,7 +13,7 @@ #include "boe.fileio.hpp" #include "boe.locutils.hpp" #include "boe.text.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "mathutil.hpp" #include "graphtool.hpp" #include "scrollbar.hpp" @@ -22,7 +22,7 @@ #include "shop.hpp" #include "spell.hpp" #include "button.hpp" -#include "restypes.hpp" +#include "res_image.hpp" #include "prefs.hpp" short monsters_faces[190] = { diff --git a/src/boe.newgraph.hpp b/src/game/boe.newgraph.hpp similarity index 100% rename from src/boe.newgraph.hpp rename to src/game/boe.newgraph.hpp diff --git a/src/boe.party.cpp b/src/game/boe.party.cpp similarity index 99% rename from src/boe.party.cpp rename to src/game/boe.party.cpp index 9a976b95..4be0442d 100644 --- a/src/boe.party.cpp +++ b/src/game/boe.party.cpp @@ -24,7 +24,7 @@ #include "boe.locutils.hpp" #include "boe.combat.hpp" #include "boe.text.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "boe.main.hpp" #include "graphtool.hpp" #include "mathutil.hpp" @@ -34,10 +34,10 @@ #include "winutil.hpp" #include "fileio.hpp" #include "boe.menus.hpp" -#include "restypes.hpp" #include #include "button.hpp" #include "spell.hpp" +#include "cursors.hpp" extern short skill_bonus[21]; @@ -146,7 +146,7 @@ void put_party_in_scen(std::string scen_name) { showError("Could not find scenario!"); return; } - make_cursor_watch(); + set_cursor(watch_curs); if(!load_scenario(path, univ.scenario)) return; @@ -1969,8 +1969,7 @@ eSpell pick_spell(short pc_num,eSkill type) { // 70 - no spell OW spell num if(former_spell >= 38) on_which_spell_page = 1; else on_which_spell_page = 0; - - make_cursor_sword(); + set_cursor(sword_curs); cDialog castSpell("cast-spell"); @@ -2129,7 +2128,7 @@ eAlchemy alch_choice(short pc_num) { short difficulty[20] = {1,1,1,3,3, 4,5,5,7,9, 9,10,12,12,9, 14,19,10,16,20}; short store_alchemy_pc; - make_cursor_sword(); + set_cursor(sword_curs); store_alchemy_pc = pc_num; @@ -2158,7 +2157,7 @@ bool pick_pc_graphic(short pc_num,short mode,cDialog* parent) { store_graphic_pc_num = pc_num; store_graphic_mode = mode; - make_cursor_sword(); + set_cursor(sword_curs); cPictChoice pcPic(0,36,PIC_PC,parent); // Customize it for this special case of choosing a PC graphic @@ -2191,7 +2190,7 @@ static bool pc_name_event_filter(cDialog& me, short store_train_pc) { bool pick_pc_name(short pc_num,cDialog* parent) { using namespace std::placeholders; - make_cursor_sword(); + set_cursor(sword_curs); cDialog pcPickName("pick-pc-name", parent); pcPickName["name"].setText(univ.party[pc_num].name); @@ -2207,7 +2206,7 @@ mon_num_t pick_trapped_monst() { std::string sp; cMonster get_monst; - make_cursor_sword(); + set_cursor(sword_curs); cChoiceDlog soulCrystal("soul-crystal",{"cancel","pick1","pick2","pick3","pick4"}); diff --git a/src/boe.party.hpp b/src/game/boe.party.hpp similarity index 100% rename from src/boe.party.hpp rename to src/game/boe.party.hpp diff --git a/src/boe.specials.cpp b/src/game/boe.specials.cpp similarity index 99% rename from src/boe.specials.cpp rename to src/game/boe.specials.cpp index 628e77fb..cfbb373f 100644 --- a/src/boe.specials.cpp +++ b/src/game/boe.specials.cpp @@ -16,7 +16,7 @@ #include "boe.monster.hpp" #include "boe.locutils.hpp" #include "boe.actions.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "boe.townspec.hpp" #include "boe.graphics.hpp" #include "boe.fileio.hpp" diff --git a/src/boe.specials.hpp b/src/game/boe.specials.hpp similarity index 100% rename from src/boe.specials.hpp rename to src/game/boe.specials.hpp diff --git a/src/boe.startup.cpp b/src/game/boe.startup.cpp similarity index 97% rename from src/boe.startup.cpp rename to src/game/boe.startup.cpp index f1232121..ac3d36f2 100644 --- a/src/boe.startup.cpp +++ b/src/game/boe.startup.cpp @@ -12,14 +12,15 @@ #include "boe.items.hpp" #include "boe.party.hpp" #include "boe.main.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "fileio.hpp" #include "choicedlog.hpp" #include "winutil.hpp" #include "boe.menus.hpp" #include "mathutil.hpp" -#include "restypes.hpp" +#include "res_image.hpp" #include "prefs.hpp" +#include "cursors.hpp" #include using std::vector; @@ -57,7 +58,7 @@ bool handle_startup_press(location the_point) { case STARTBTN_NEW: draw_startup(0); start_new_game(); - make_cursor_sword(); + set_cursor(sword_curs); draw_startup(0); break; @@ -129,7 +130,7 @@ void handle_splash_events() { extern sf::Event event; if(!mainPtr.pollEvent(event)) return; if(event.type == sf::Event::GainedFocus || event.type == sf::Event::MouseMoved) - make_cursor_watch(); + set_cursor(sword_curs); } void show_logo() { diff --git a/src/boe.text.cpp b/src/game/boe.text.cpp similarity index 99% rename from src/boe.text.cpp rename to src/game/boe.text.cpp index 936eb860..661056ca 100644 --- a/src/boe.text.cpp +++ b/src/game/boe.text.cpp @@ -13,7 +13,8 @@ const int TEXT_BUF_LEN = 70; #include "mathutil.hpp" #include "graphtool.hpp" #include "scrollbar.hpp" -#include "restypes.hpp" +#include "res_image.hpp" +#include "res_font.hpp" #include "spell.hpp" typedef struct { @@ -1200,11 +1201,6 @@ rectangle coord_to_rect(short i,short j) { return to_return; } - -void make_cursor_sword() { - set_cursor(sword_curs); -} - // which_day is day event should happen // which_event is the univ.party.key_times value to cross reference with. // if the key_time is reached before which_day, event won't happen diff --git a/src/boe.text.hpp b/src/game/boe.text.hpp similarity index 98% rename from src/boe.text.hpp rename to src/game/boe.text.hpp index 0db1bc5f..0aeed8ce 100644 --- a/src/boe.text.hpp +++ b/src/game/boe.text.hpp @@ -34,7 +34,6 @@ void restart_printing(); void restore_mode(); void through_sending(); rectangle coord_to_rect(short i,short j); -void make_cursor_sword() ; bool day_reached(unsigned short which_day, unsigned short which_event); void Draw_Some_Item (sf::Texture& src_gworld, rectangle src_rect, sf::RenderTarget& targ_gworld, location target, char masked, short main_win); rectangle get_stat_effect_rect(int which_effect); diff --git a/src/boe.town.cpp b/src/game/boe.town.cpp similarity index 99% rename from src/boe.town.cpp rename to src/game/boe.town.cpp index c7523ae9..72515acf 100644 --- a/src/boe.town.cpp +++ b/src/game/boe.town.cpp @@ -16,7 +16,7 @@ #include "boe.combat.hpp" #include "boe.party.hpp" #include "boe.text.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "boe.locutils.hpp" #include "boe.specials.hpp" #include "boe.infodlg.hpp" @@ -26,7 +26,7 @@ #include "strdlog.hpp" #include "fileio.hpp" #include "winutil.hpp" -#include "restypes.hpp" +#include "res_image.hpp" extern short stat_window,store_spell_target,which_combat_type,combat_active_pc; extern eGameMode overall_mode; diff --git a/src/boe.town.hpp b/src/game/boe.town.hpp similarity index 100% rename from src/boe.town.hpp rename to src/game/boe.town.hpp diff --git a/src/boe.townspec.cpp b/src/game/boe.townspec.cpp similarity index 99% rename from src/boe.townspec.cpp rename to src/game/boe.townspec.cpp index e9da4d59..65bc7960 100644 --- a/src/boe.townspec.cpp +++ b/src/game/boe.townspec.cpp @@ -11,7 +11,7 @@ #include "boe.locutils.hpp" #include "boe.text.hpp" #include "boe.townspec.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "mathutil.hpp" #include "strdlog.hpp" #include "choicedlog.hpp" diff --git a/src/boe.townspec.hpp b/src/game/boe.townspec.hpp similarity index 100% rename from src/boe.townspec.hpp rename to src/game/boe.townspec.hpp diff --git a/src/tools/graphtool.cpp b/src/gfx/graphtool.cpp similarity index 99% rename from src/tools/graphtool.cpp rename to src/gfx/graphtool.cpp index ec6c8bd5..4a66260b 100644 --- a/src/tools/graphtool.cpp +++ b/src/gfx/graphtool.cpp @@ -19,12 +19,15 @@ #endif #include +#include #include #include #include #include -#include "restypes.hpp" +#include "res_image.hpp" +#include "res_font.hpp" +#include "res_strings.hpp" #include "mathutil.hpp" #include "fileio.hpp" diff --git a/src/tools/graphtool.hpp b/src/gfx/graphtool.hpp similarity index 99% rename from src/tools/graphtool.hpp rename to src/gfx/graphtool.hpp index d8495b00..ec21f717 100644 --- a/src/tools/graphtool.hpp +++ b/src/gfx/graphtool.hpp @@ -18,8 +18,6 @@ #include "location.hpp" #include "pictypes.hpp" -namespace fs = boost::filesystem; - struct m_pic_index_t { unsigned char i, x, y; }; diff --git a/src/tools/mask.frag b/src/gfx/mask.frag similarity index 100% rename from src/tools/mask.frag rename to src/gfx/mask.frag diff --git a/src/tools/mask.vert b/src/gfx/mask.vert similarity index 100% rename from src/tools/mask.vert rename to src/gfx/mask.vert diff --git a/src/tools/qdpict.mac.cpp b/src/gfx/qdpict.mac.cpp similarity index 99% rename from src/tools/qdpict.mac.cpp rename to src/gfx/qdpict.mac.cpp index f474da6d..35b793f6 100644 --- a/src/tools/qdpict.mac.cpp +++ b/src/gfx/qdpict.mac.cpp @@ -21,8 +21,6 @@ #include "porting.hpp" #include "location.hpp" -namespace fs = boost::filesystem; - static int16_t extract_word(char* ptr) { int16_t s = *(int16_t*) ptr; flip_short(&s); diff --git a/src/global.hpp b/src/global.hpp new file mode 100644 index 00000000..c53f9a61 --- /dev/null +++ b/src/global.hpp @@ -0,0 +1,27 @@ +/* + * global.hpp + * BoE + * + * Created by Celtic Minstrel on 17-04-13. + * + */ + +#ifndef BOE_PCH +#define BOE_PCH + +typedef unsigned short mon_num_t; +typedef signed short miss_num_t; +typedef unsigned short ter_num_t; +typedef signed short spec_num_t; +typedef signed short item_num_t; +typedef unsigned short str_num_t; + +// OBoE Current Version +const unsigned long long OBOE_CURRENT_VERSION = 0x020000; // MMmmff; M - major, m - minor, f - bugfix +const char* oboeVersionString(); + +// A convenient alias +namespace boost { namespace filesystem {}} +namespace fs = boost::filesystem; + +#endif diff --git a/src/classes/location.cpp b/src/location.cpp similarity index 97% rename from src/classes/location.cpp rename to src/location.cpp index 6e2aebfc..ef1dd8b0 100644 --- a/src/classes/location.cpp +++ b/src/location.cpp @@ -10,6 +10,11 @@ #include "mathutil.hpp" #include +eDirection& operator++ (eDirection& me, int) { + if(me == DIR_HERE) return me = DIR_N; + else return me = (eDirection)(1 + (int)me); +} + bool operator == (location p1,location p2){ if((p1.x == p2.x) & (p1.y == p2.y)) return true; diff --git a/src/classes/location.hpp b/src/location.hpp similarity index 94% rename from src/classes/location.hpp rename to src/location.hpp index ef0ba3e1..97d94990 100644 --- a/src/classes/location.hpp +++ b/src/location.hpp @@ -13,6 +13,18 @@ #include #include +enum eDirection { + DIR_N = 0, + DIR_NE = 1, + DIR_E = 2, + DIR_SE = 3, + DIR_S = 4, + DIR_SW = 5, + DIR_W = 6, + DIR_NW = 7, + DIR_HERE = 8, +}; + struct rectangle; struct location { @@ -128,6 +140,8 @@ struct spec_loc_t : public location { spec_loc_t& operator=(const spec_loc_t& other) = default; }; +eDirection& operator++ (eDirection& me, int); + bool operator == (location p1,location p2); bool operator != (location p1,location p2); bool operator == (rectangle r1, rectangle r2); @@ -144,6 +158,8 @@ rectangle rect(); rectangle rect(location tl, location br); rectangle rect(int top, int left, int bottom, int right); +std::ostream& operator << (std::ostream& out, eDirection e); +std::istream& operator >> (std::istream& in, eDirection& e); std::ostream& operator<< (std::ostream& out, location l); std::ostream& operator<< (std::ostream& out, spec_loc_t l); std::ostream& operator<< (std::ostream& out, sign_loc_t l); diff --git a/src/tools/mathutil.cpp b/src/mathutil.cpp similarity index 100% rename from src/tools/mathutil.cpp rename to src/mathutil.cpp diff --git a/src/tools/mathutil.hpp b/src/mathutil.hpp similarity index 95% rename from src/tools/mathutil.hpp rename to src/mathutil.hpp index bc2a81b4..a3af00e3 100644 --- a/src/tools/mathutil.hpp +++ b/src/mathutil.hpp @@ -10,7 +10,7 @@ #include using std::abs; -short get_ran (short times,short min,short max); +short get_ran(short times, short min, short max); short max(short a,short b); short min(short a,short b); short minmax(short min,short max,short k); diff --git a/src/pcedit/pc.action.cpp b/src/pcedit/pc.action.cpp index 8e31dea2..219495d8 100644 --- a/src/pcedit/pc.action.cpp +++ b/src/pcedit/pc.action.cpp @@ -7,10 +7,11 @@ #include "pc.fileio.hpp" #include "pc.action.hpp" #include "graphtool.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "mathutil.hpp" #include "dialog.hpp" #include "control.hpp" +#include "cursors.hpp" #include extern cUniverse univ; @@ -105,7 +106,7 @@ void edit_gold_or_food(short which_to_edit) { store_which_to_edit = which_to_edit; - make_cursor_sword(); + set_cursor(sword_curs); cDialog dlog("get-num"); dlog["okay"].attachClickHandler(get_num_event_filter); if(which_to_edit == 0) @@ -126,7 +127,7 @@ void edit_day() { location view_loc; - make_cursor_sword(); + set_cursor(sword_curs); cDialog dlog("edit-day"); dlog["okay"].attachClickHandler(get_num_event_filter); @@ -154,7 +155,7 @@ bool take_gold(short amount,bool /*print_result*/) { void edit_xp(cPlayer *pc) { location view_loc; - make_cursor_sword(); + set_cursor(sword_curs); cDialog dlog("edit-xp"); dlog["okay"].attachClickHandler(get_num_event_filter); diff --git a/src/pcedit/pc.editors.cpp b/src/pcedit/pc.editors.cpp index a9cde3d3..4c9ce07e 100644 --- a/src/pcedit/pc.editors.cpp +++ b/src/pcedit/pc.editors.cpp @@ -10,6 +10,7 @@ #include "strdlog.hpp" #include "choicedlog.hpp" #include "winutil.hpp" +#include "cursors.hpp" #include /* @@ -98,7 +99,7 @@ void display_pc(short pc_num,short mode, cDialog* parent) { } which_pc_displayed = pc_num; - make_cursor_sword(); + set_cursor(sword_curs); cDialog pcInfo("pc-spell-info", parent); pcInfo.attachClickHandlers(std::bind(display_pc_event_filter, _1, _2, mode),{"done","left","right"}); @@ -194,7 +195,7 @@ void pick_race_abil(cPlayer *pc,short mode,cDialog* parent) { static const char*const start_str2 = "Click on advantage button to add/remove."; store_pc = pc; - make_cursor_sword(); + set_cursor(sword_curs); cDialog pickAbil("pick-race-abil",parent); pickAbil["done"].attachClickHandler(std::bind(&cDialog::toast, &pickAbil, true)); @@ -231,7 +232,7 @@ extern const eItemAbil alch_ingred2[20] = { }; void display_alchemy(bool allowEdit,cDialog* parent) { - make_cursor_sword(); + set_cursor(sword_curs); cChoiceDlog showAlch("pc-alchemy-info", {"done"}, parent); @@ -539,7 +540,7 @@ static bool spend_xp_event_filter(cDialog& me, std::string item_hit, eKeyMod mod bool spend_xp(short pc_num, short mode, cDialog* parent) { using namespace std::placeholders; - make_cursor_sword(); + set_cursor(sword_curs); xp_dlog_state save; save.who = pc_num; diff --git a/src/pcedit/pc.fileio.cpp b/src/pcedit/pc.fileio.cpp index e4441817..816c5dbe 100644 --- a/src/pcedit/pc.fileio.cpp +++ b/src/pcedit/pc.fileio.cpp @@ -6,10 +6,9 @@ #include "pc.fileio.hpp" #include "pc.graphics.hpp" #include "graphtool.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "pc.editors.hpp" #include "mathutil.hpp" -#include "restypes.hpp" #include "fileio.hpp" extern cUniverse univ; diff --git a/src/pcedit/pc.graphics.cpp b/src/pcedit/pc.graphics.cpp index f5e1671a..7b71ff66 100644 --- a/src/pcedit/pc.graphics.cpp +++ b/src/pcedit/pc.graphics.cpp @@ -4,9 +4,9 @@ #include "pc.graphics.hpp" #include "pc.editors.hpp" #include "pc.action.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "graphtool.hpp" -#include "restypes.hpp" +#include "res_image.hpp" #include "message.hpp" #include "mathutil.hpp" #include "gitrev.hpp" @@ -788,8 +788,3 @@ void display_party() { win_draw_string(mainPtr,dest_rect,to_draw.str(),eTextMode::WRAP,style); } } - -void make_cursor_sword() { - set_cursor(sword_curs); -} - diff --git a/src/pcedit/pc.graphics.hpp b/src/pcedit/pc.graphics.hpp index 748281d0..1e0ce1fa 100644 --- a/src/pcedit/pc.graphics.hpp +++ b/src/pcedit/pc.graphics.hpp @@ -3,4 +3,3 @@ void init_main_buttons(); void Set_up_win (); void redraw_screen(); void do_button_action(short which_pc,short which_button); -void make_cursor_sword(); \ No newline at end of file diff --git a/src/pcedit/pc.main.cpp b/src/pcedit/pc.main.cpp index f951460f..540cbd05 100644 --- a/src/pcedit/pc.main.cpp +++ b/src/pcedit/pc.main.cpp @@ -7,7 +7,7 @@ #include "pc.editors.hpp" #include "pc.action.hpp" #include "pc.fileio.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "graphtool.hpp" #include "boe.consts.hpp" #include "dialog.hpp" @@ -18,7 +18,7 @@ #include "pc.menus.hpp" #include "winutil.hpp" #include "cursors.hpp" -#include "restypes.hpp" +#include "res_image.hpp" cUniverse univ; diff --git a/src/tools/porting.cpp b/src/porting.cpp similarity index 100% rename from src/tools/porting.cpp rename to src/porting.cpp diff --git a/src/tools/porting.hpp b/src/porting.hpp similarity index 100% rename from src/tools/porting.hpp rename to src/porting.hpp diff --git a/src/race.hpp b/src/race.hpp new file mode 100644 index 00000000..f3747623 --- /dev/null +++ b/src/race.hpp @@ -0,0 +1,53 @@ +// +// race.hpp +// BoE +// +// Created by Celtic Minstrel on 17-04-13. +// +// + +#ifndef BoE_RACE_HPP +#define BoE_RACE_HPP + +enum class eRace { + UNKNOWN = -1, // for parameters to some functions; not valid in the class + HUMAN = 0, + NEPHIL = 1, + SLITH = 2, + VAHNATAI = 3, // Former value from eMonsterType + REPTILE = 4, // 1 + BEAST = 5, // 2 + IMPORTANT = 6, // 3 + MAGE = 7, // 4 + PRIEST = 8, // 5 + HUMANOID = 9, // 6 + DEMON = 10, // 7 + UNDEAD = 11, // 8 + GIANT = 12, // 9 + SLIME = 13, // 10 + STONE = 14, // 11 + BUG = 15, // 12 + DRAGON = 16, // 13 + MAGICAL = 17, // 14 + PLANT = 18, + BIRD = 19, + SKELETAL = 20, + GOBLIN = 21, +}; + +// Types IMPORTANT, MAGE, and PRIEST are implicitly human +inline bool isHuman(eRace race) { + int code = (int) race; + return code == 0 || (code >= 6 && code <= 8); +} + +// Types NEPHIL, SLITH, and VAHNATAI are implicitly humanoid +inline bool isHumanoid(eRace race) { + int code = (int) race; + return (code >= 0 && code <= 3) || (code >= 6 && code <= 9) || code == 21; +} + +std::ostream& operator << (std::ostream& out, eRace e); +std::istream& operator >> (std::istream& in, eRace& e); + +#endif diff --git a/src/classes/area.hpp b/src/scenario/area.hpp similarity index 100% rename from src/classes/area.hpp rename to src/scenario/area.hpp diff --git a/src/classes/item.cpp b/src/scenario/item.cpp similarity index 99% rename from src/classes/item.cpp rename to src/scenario/item.cpp index a3a9aa4a..bae9c169 100644 --- a/src/classes/item.cpp +++ b/src/scenario/item.cpp @@ -17,10 +17,13 @@ #include "boe.consts.hpp" // TODO: If this is needed here, maybe it shouldn't be in the "boe" namespace #include "oldstructs.hpp" -#include "spell.hpp" #include "graphtool.hpp" // for get_str() #include "fileio.hpp" +#include "damage.hpp" +#include "spell.hpp" +#include "race.hpp" + extern const std::multiset equippable = { eItemType::ONE_HANDED, eItemType::TWO_HANDED, eItemType::BOW, eItemType::ARROW, eItemType::THROWN_MISSILE, eItemType::TOOL, eItemType::SHIELD, eItemType::ARMOR, eItemType::HELM, eItemType::GLOVES, diff --git a/src/classes/item.hpp b/src/scenario/item.hpp similarity index 94% rename from src/classes/item.hpp rename to src/scenario/item.hpp index 82c21737..2121d5cd 100644 --- a/src/classes/item.hpp +++ b/src/scenario/item.hpp @@ -13,7 +13,10 @@ #include #include "location.hpp" -#include "simpletypes.hpp" +#include "item_abilities.hpp" +#include "item_variety.hpp" +#include "skills_traits.hpp" +#include "alchemy.hpp" namespace legacy { struct item_record_type; }; diff --git a/src/scenario/item_abilities.hpp b/src/scenario/item_abilities.hpp new file mode 100644 index 00000000..791f2ad4 --- /dev/null +++ b/src/scenario/item_abilities.hpp @@ -0,0 +1,114 @@ +// +// item_abilities.hpp +// BoE +// +// Created by Celtic Minstrel on 17-04-13. +// +// + +#ifndef BoE_ITEM_ABILITIES_HPP +#define BoE_ITEM_ABILITIES_HPP + +enum class eItemAbil { + // Weapon abilities + NONE = 0, + DAMAGING_WEAPON = 1, + SLAYER_WEAPON = 2, + HEALING_WEAPON = 3, + EXPLODING_WEAPON = 4, + RETURNING_MISSILE = 5, + DISTANCE_MISSILE = 6, + SEEKING_MISSILE = 7, + ANTIMAGIC_WEAPON = 8, + STATUS_WEAPON = 9, + SOULSUCKER = 10, + UNUSED = 11, + WEAK_WEAPON = 12, + CAUSES_FEAR = 13, + WEAPON_CALL_SPECIAL = 14, + HP_DAMAGE = 15, + HP_DAMAGE_REVERSE = 16, + SP_DAMAGE = 17, + SP_DAMAGE_REVERSE = 18, + // General abilities + DAMAGE_PROTECTION = 30, + FULL_PROTECTION = 31, + MAGERY = 32, + EVASION = 33, + MARTYRS_SHIELD = 34, + ENCUMBERING = 35, + STATUS_PROTECTION = 36, + SKILL = 37, + BOOST_STAT = 38, + BOOST_WAR = 39, + BOOST_MAGIC = 40, + ACCURACY = 41, + THIEVING = 42, + GIANT_STRENGTH = 43, + LIGHTER_OBJECT = 44, + HEAVIER_OBJECT = 45, + OCCASIONAL_STATUS = 46, + HIT_CALL_SPECIAL = 47, + LIFE_SAVING = 48, + PROTECT_FROM_PETRIFY = 49, + REGENERATE = 50, + POISON_AUGMENT = 51, + RADIANT = 52, + WILL = 53, + FREE_ACTION = 54, + SPEED = 55, + SLOW_WEARER = 56, + PROTECT_FROM_SPECIES = 57, + LOCKPICKS = 58, + DRAIN_MISSILES = 59, + DROP_CALL_SPECIAL = 60, + // Usable + POISON_WEAPON = 70, + AFFECT_STATUS = 71, + CAST_SPELL = 72, + BLISS_DOOM = 73, + AFFECT_EXPERIENCE = 74, + AFFECT_SKILL_POINTS = 75, + AFFECT_HEALTH = 76, + AFFECT_SPELL_POINTS = 77, + LIGHT = 78, + AFFECT_PARTY_STATUS = 79, + HEALTH_POISON = 80, + CALL_SPECIAL = 81, + SUMMONING = 82, + MASS_SUMMONING = 83, + QUICKFIRE = 84, + MESSAGE = 85, + // Reagents + HOLLY = 150, // Holly/Toadstool + COMFREY = 151, // Comfrey Root + NETTLE = 152, // Glowing Nettle + WORMGRASS = 153, // Crypt Shroom/Wormgrass + ASPTONGUE = 154, // Asptongue Mold + EMBERF = 155, // Ember Flower + GRAYMOLD = 156, + MANDRAKE = 157, + SAPPHIRE = 158, + SMOKY_CRYSTAL = 159, + RESURRECTION_BALM = 160, +}; + +enum class eItemAbilCat { + INVALID = -1, + WEAPON, GENERAL, USABLE, REAGENT +}; + +inline eItemAbilCat getItemAbilCategory(eItemAbil abil) { + int code = (int) abil; + if(code >= 0 && code <= 13) + return eItemAbilCat::WEAPON; + if(code >= 30 && code <= 57) + return eItemAbilCat::GENERAL; + if(code >= 70 && code <= 129) + return eItemAbilCat::USABLE; + if(code >= 150 && code <= 161) + return eItemAbilCat::REAGENT; + return eItemAbilCat::INVALID; +} + +#endif diff --git a/src/scenario/item_variety.hpp b/src/scenario/item_variety.hpp new file mode 100644 index 00000000..e253dea5 --- /dev/null +++ b/src/scenario/item_variety.hpp @@ -0,0 +1,65 @@ +// +// item_variety.hpp +// BoE +// +// Created by Celtic Minstrel on 17-04-13. +// +// + +#ifndef BoE_ITEM_VARIETY_HPP +#define BoE_ITEM_VARIETY_HPP + +enum class eItemType { + NO_ITEM = 0, + ONE_HANDED = 1, + TWO_HANDED = 2, + GOLD = 3, + BOW = 4, + ARROW = 5, + THROWN_MISSILE = 6, + POTION = 7, // potion/magic item + SCROLL = 8, // scroll/magic item + WAND = 9, + TOOL = 10, + FOOD = 11, + SHIELD = 12, + ARMOR = 13, + HELM = 14, + GLOVES = 15, + SHIELD_2 = 16, + // don't know why a second type of shield is used ; it is actually checked + // in the armor code -- see below + // and you can't equip another (12) shield while wearing it ... I didn't + // find a single item with this property in the bladbase.exs ... + BOOTS = 17, + RING = 18, + NECKLACE = 19, + WEAPON_POISON = 20, + NON_USE_OBJECT = 21, + PANTS = 22, + CROSSBOW = 23, + BOLTS = 24, + MISSILE_NO_AMMO = 25, //e.g slings + SPECIAL = 26, + QUEST = 27, +}; + +inline bool isArmourType(eItemType type) { + int code = (int) type; + return code >= 12 && code <= 17; +} + +inline bool isWeaponType(eItemType type) { + int code = (int) type; + return (code >= 1 && code <= 6 && code != 3) || (code >= 23 && code <= 25); +} + +inline bool isMissileType(eItemType type) { + return type == eItemType::ARROW || type == eItemType::BOLTS || type == eItemType::THROWN_MISSILE || type == eItemType::MISSILE_NO_AMMO; +} + +enum class eItemUse {HELP_ONE, HARM_ONE, HELP_ALL, HARM_ALL}; + +enum class eEnchant {PLUS_ONE, PLUS_TWO, PLUS_THREE, SHOOT_FLAME, FLAMING, PLUS_FIVE, BLESSED}; + +#endif diff --git a/src/classes/monster.cpp b/src/scenario/monster.cpp similarity index 100% rename from src/classes/monster.cpp rename to src/scenario/monster.cpp diff --git a/src/scenario/monster.hpp b/src/scenario/monster.hpp new file mode 100644 index 00000000..9cba0340 --- /dev/null +++ b/src/scenario/monster.hpp @@ -0,0 +1,108 @@ +/* + * monster.h + * BoE + * + * Created by Celtic Minstrel on 20/04/09. + * + */ + +#ifndef BOE_DATA_MONSTER_H +#define BOE_DATA_MONSTER_H + +#include +#include +#include +#include + +#include "sounds.hpp" +#include "graphtool.hpp" +#include "living.hpp" +#include "monster_abilities.hpp" +#include "race.hpp" + +namespace legacy { + struct monster_record_type; + struct creature_data_type; + struct creature_start_type; +}; + +class cScenario; +class cUniverse; + +enum class eAttitude { + DOCILE, HOSTILE_A, FRIENDLY, HOSTILE_B +}; + +enum class eMonstTime { + ALWAYS, + APPEAR_ON_DAY, DISAPPEAR_ON_DAY, + SOMETIMES_C, SOMETIMES_A, SOMETIMES_B, + APPEAR_WHEN_EVENT, DISAPPEAR_WHEN_EVENT, + APPEAR_AFTER_CHOP, +}; + +class cMonster { +public: + struct cAttack{ + unsigned short dice = 0, sides = 0; + eMonstMelee type = eMonstMelee::SWING; + }; + unsigned int level; + std::string m_name; + short m_health; + unsigned int armor; + unsigned int skill; + std::array a; + eRace m_type; + unsigned int speed; + unsigned int mu; + unsigned int cl; + unsigned int treasure; + // HACK: This is only really marked mutable so that I can use operator[] from const methods + mutable std::map abil; + item_num_t corpse_item; + short corpse_item_chance; + std::map resist; + bool mindless, invuln, invisible, guard, amorphous; + unsigned int x_width,y_width; + eAttitude default_attitude; + unsigned int summon_type; + pic_num_t default_facial_pic; + pic_num_t picture_num; + snd_num_t ambient_sound; // has a chance of being played every move + spec_num_t see_spec; + + std::map::iterator addAbil(eMonstAbilTemplate what, int param = 0); + int addAttack(unsigned short dice, unsigned short sides, eMonstMelee type = eMonstMelee::SWING); + + void import_legacy(legacy::monster_record_type& old); + cMonster(); + void writeTo(std::ostream& file) const; + void readFrom(std::istream& file); +}; + +class cTownperson { +public: + mon_num_t number; + eAttitude start_attitude; + location start_loc; + unsigned short mobility; + eMonstTime time_flag; + short spec1, spec2; + short spec_enc_code, time_code; + short monster_time, personality; + short special_on_kill, special_on_talk; + pic_num_t facial_pic; + + void import_legacy(legacy::creature_start_type old); + cTownperson(); + cTownperson(location loc, mon_num_t num, const cMonster& monst); +}; + +std::ostream& operator << (std::ostream& out, eMonstTime e); +std::istream& operator >> (std::istream& in, eMonstTime& e); +std::ostream& operator<< (std::ostream& out, eAttitude node); +std::istream& operator>> (std::istream& in, eAttitude& node); +std::ostream& operator<<(std::ostream& out, const cMonster::cAttack& att); + +#endif diff --git a/src/scenario/monster_abilities.hpp b/src/scenario/monster_abilities.hpp new file mode 100644 index 00000000..bd2fbf9d --- /dev/null +++ b/src/scenario/monster_abilities.hpp @@ -0,0 +1,129 @@ +// +// monster_abilities.hpp +// BoE +// +// Created by Celtic Minstrel on 17-04-13. +// +// + +#ifndef BoE_DATA_MONSTER_ABILITIES_HPP +#define BoE_DATA_MONSTER_ABILITIES_HPP + +#include "damage.hpp" +#include "fields.hpp" +#include "spell.hpp" + +enum class eMonstAbil { + NO_ABIL, + MISSILE, + + DAMAGE, STATUS, FIELD, PETRIFY, DRAIN_SP, + DRAIN_XP, KILL, STEAL_FOOD, STEAL_GOLD, STUN, + DAMAGE2, STATUS2, + + SPLITS, MARTYRS_SHIELD, ABSORB_SPELLS, MISSILE_WEB, + RAY_HEAT, SPECIAL, HIT_TRIGGER, DEATH_TRIGGER, + + RADIATE, SUMMON, +}; + +enum class eMonstMelee {SWING, CLAW, BITE, SLIME, PUNCH, STING, CLUB, BURN, HARM, STAB}; + +enum class eMonstMissile {DART, ARROW, SPEAR, ROCK, RAZORDISK, SPINE, KNIFE, BOLT, BOULDER, RAPID_ARROW}; + +enum class eMonstGen {RAY, TOUCH, GAZE, BREATH, SPIT}; + +enum class eMonstSummon {TYPE, LEVEL, SPECIES}; + +enum class eMonstAbilCat { + INVALID, MISSILE, GENERAL, SUMMON, RADIATE, SPECIAL +}; + +inline eMonstAbilCat getMonstAbilCategory(eMonstAbil what) { + if(what == eMonstAbil::NO_ABIL) + return eMonstAbilCat::SPECIAL; + if(what == eMonstAbil::MISSILE) + return eMonstAbilCat::MISSILE; + if(what >= eMonstAbil::DAMAGE && what <= eMonstAbil::STATUS2) + return eMonstAbilCat::GENERAL; + if(what >= eMonstAbil::SPLITS && what <= eMonstAbil::DEATH_TRIGGER) + return eMonstAbilCat::SPECIAL; + if(what == eMonstAbil::RADIATE) + return eMonstAbilCat::RADIATE; + if(what == eMonstAbil::SUMMON) + return eMonstAbilCat::SUMMON; + return eMonstAbilCat::INVALID; +} + +enum class eMonstAbilTemplate { + // Non-magical missiles + THROWS_DARTS, SHOOTS_ARROWS, THROWS_SPEARS, THROWS_ROCKS1, THROWS_ROCKS2, THROWS_ROCKS3, + THROWS_RAZORDISKS, THROWS_KNIVES, GOOD_ARCHER, SHOOTS_SPINES, CROSSBOWMAN, SLINGER, + // Magical missiles + RAY_PETRIFY, RAY_SP_DRAIN, RAY_HEAT, RAY_PARALYSIS, + BREATH_FIRE, BREATH_FROST, BREATH_ELECTRICITY, BREATH_DARKNESS, BREATH_FOUL, BREATH_SLEEP, + SPIT_ACID, SHOOTS_WEB, + // Touch abilities + TOUCH_POISON, TOUCH_ACID, TOUCH_DISEASE, TOUCH_WEB, TOUCH_SLEEP, TOUCH_DUMB, TOUCH_PARALYSIS, + TOUCH_PETRIFY, TOUCH_DEATH, TOUCH_XP_DRAIN, TOUCH_ICY, TOUCH_ICY_DRAINING, TOUCH_STUN, TOUCH_STEAL_FOOD, TOUCH_STEAL_GOLD, + // Misc abilities + SPLITS, MARTYRS_SHIELD, ABSORB_SPELLS, SUMMON_5, SUMMON_20, SUMMON_50, SPECIAL, HIT_TRIGGERS, DEATH_TRIGGERS, + // Radiate abilities + RADIATE_FIRE, RADIATE_ICE, RADIATE_SHOCK, RADIATE_ANTIMAGIC, RADIATE_SLEEP, RADIATE_STINK, RADIATE_BLADE, RADIATE_WEB, + // Advanced abilities + CUSTOM_MISSILE, CUSTOM_DAMAGE, CUSTOM_STATUS, CUSTOM_FIELD, CUSTOM_PETRIFY, CUSTOM_SP_DRAIN, CUSTOM_XP_DRAIN, + CUSTOM_KILL, CUSTOM_STEAL_FOOD, CUSTOM_STEAL_GOLD, CUSTOM_STUN, CUSTOM_STATUS2, CUSTOM_RADIATE, CUSTOM_SUMMON, + CUSTOM_DAMAGE2, +}; + +union uAbility { + bool active; + struct { + bool active; + eMonstMissile type; + miss_num_t pic; + int dice, sides, skill, range, odds; + } missile; + struct { + bool active; + eMonstGen type; + miss_num_t pic; + int strength, range, odds; + union { + eDamageType dmg; + eStatus stat; + eFieldType fld; + }; + } gen; + struct { + bool active; + eMonstSummon type; + mon_num_t what; + int min, max, len, chance; + } summon; + struct { + bool active; + eFieldType type; + int chance; + eSpellPat pat; + } radiate; + struct { + bool active; + int extra1, extra2, extra3; + } special; + std::string to_string(eMonstAbil myKey) const; + int get_ap_cost(eMonstAbil key) const; +}; + +std::ostream& operator << (std::ostream& out, eMonstAbil e); +std::istream& operator >> (std::istream& in, eMonstAbil& e); +std::ostream& operator << (std::ostream& out, eMonstMissile e); +std::istream& operator >> (std::istream& in, eMonstMissile& e); +std::ostream& operator << (std::ostream& out, eMonstSummon e); +std::istream& operator >> (std::istream& in, eMonstSummon& e); +std::ostream& operator << (std::ostream& out, eMonstMelee e); +std::istream& operator >> (std::istream& in, eMonstMelee& e); +std::ostream& operator << (std::ostream& out, eMonstGen e); +std::istream& operator >> (std::istream& in, eMonstGen& e); + +#endif diff --git a/src/classes/outdoors.cpp b/src/scenario/outdoors.cpp similarity index 100% rename from src/classes/outdoors.cpp rename to src/scenario/outdoors.cpp diff --git a/src/classes/outdoors.hpp b/src/scenario/outdoors.hpp similarity index 98% rename from src/classes/outdoors.hpp rename to src/scenario/outdoors.hpp index a545bf85..cbc060ac 100644 --- a/src/classes/outdoors.hpp +++ b/src/scenario/outdoors.hpp @@ -15,7 +15,6 @@ #include "location.hpp" #include "special.hpp" -#include "simpletypes.hpp" #include "monster.hpp" #include "area.hpp" diff --git a/src/scenario/quest.hpp b/src/scenario/quest.hpp new file mode 100644 index 00000000..3bab2b26 --- /dev/null +++ b/src/scenario/quest.hpp @@ -0,0 +1,25 @@ +// +// quest.hpp +// BoE +// +// Created by Celtic Minstrel on 17-04-13. +// +// + +#ifndef BoE_QUEST_HPP +#define BoE_QUEST_HPP + +enum class eQuestStatus {AVAILABLE, STARTED, COMPLETED, FAILED}; + +class cQuest { +public: + short flags = 0; // 0 - absolute deadline, 1 - relative to when quest started, +10 - start quest when scenario starts + short deadline = -1; + short event = -1; // if this event occurs before the deadline, then the deadline is waived + short xp = 0, gold = 0; // automatically award this much XP and gold to the party when the quest is marked complete + short bank1 = -1, bank2 = -1; // which job bank(s) this quest is in; -1 for none + std::string name; + std::string descr; +}; + +#endif diff --git a/src/classes/scenario.cpp b/src/scenario/scenario.cpp similarity index 100% rename from src/classes/scenario.cpp rename to src/scenario/scenario.cpp diff --git a/src/classes/scenario.hpp b/src/scenario/scenario.hpp similarity index 86% rename from src/classes/scenario.hpp rename to src/scenario/scenario.hpp index 88bab8bf..c0d6e38d 100644 --- a/src/classes/scenario.hpp +++ b/src/scenario/scenario.hpp @@ -21,8 +21,7 @@ #include "town.hpp" #include "vector2d.hpp" #include "shop.hpp" - -namespace fs = boost::filesystem; // TODO: Centralize this namespace alias? +#include "quest.hpp" namespace legacy{ struct scenario_data_type; @@ -35,16 +34,7 @@ struct scenario_header_flags { unsigned char ver[3],min_run_ver,prog_make_ver[3],num_towns; }; -class cQuest { -public: - short flags = 0; // 0 - absolute deadline, 1 - relative to when quest started, +10 - start quest when scenario starts - short deadline = -1; - short event = -1; // if this event occurs before the deadline, then the deadline is waived - short xp = 0, gold = 0; // automatically award this much XP and gold to the party when the quest is marked complete - short bank1 = -1, bank2 = -1; // which job bank(s) this quest is in; -1 for none - std::string name; - std::string descr; -}; +enum eContentRating {G, PG, R, NC17}; class cScenario { public: diff --git a/src/classes/shop.cpp b/src/scenario/shop.cpp similarity index 100% rename from src/classes/shop.cpp rename to src/scenario/shop.cpp diff --git a/src/classes/shop.hpp b/src/scenario/shop.hpp similarity index 76% rename from src/classes/shop.hpp rename to src/scenario/shop.hpp index eb0a718f..17be1cd7 100644 --- a/src/classes/shop.hpp +++ b/src/scenario/shop.hpp @@ -20,6 +20,35 @@ #undef INFINITE #endif +enum class eShopType {NORMAL, ALLOW_DEAD, RANDOM}; + +enum class eShopPrompt {SHOPPING, HEALING, MAGE, PRIEST, SPELLS, ALCHEMY, TRAINING}; + +enum class eShopItemType { + EMPTY, + // These ones must have these numbers in order for old scenarios to be ported correctly + ITEM = 1, + MAGE_SPELL = 2, + PRIEST_SPELL = 3, + ALCHEMY = 4, + SKILL, + TREASURE, + CLASS, + OPT_ITEM, + CALL_SPECIAL, + // All non-healing types must be above here and all healing types below, with HEAL_WOUNDS kept first + HEAL_WOUNDS, + CURE_POISON, + CURE_DISEASE, + CURE_ACID, + CURE_PARALYSIS, + REMOVE_CURSE, + DESTONE, + RAISE_DEAD, + RESURRECT, + CURE_DUMBFOUNDING, +}; + struct cShopItem { eShopItemType type = eShopItemType::EMPTY; size_t quantity, index; diff --git a/src/classes/special.cpp b/src/scenario/special.cpp similarity index 97% rename from src/classes/special.cpp rename to src/scenario/special.cpp index d72a68d3..1c0d328c 100644 --- a/src/classes/special.cpp +++ b/src/scenario/special.cpp @@ -17,6 +17,11 @@ #include "oldstructs.hpp" #include "graphtool.hpp" +#include "spell.hpp" +#include "skills_traits.hpp" +#include "damage.hpp" +#include "fields.hpp" + cSpecial::cSpecial(){ type = eSpecType::NONE; sd1 = -1; @@ -651,6 +656,25 @@ static int offsets[] = { int(eSpecType::OUT_MAKE_WANDER), }; +eSpecCat getNodeCategory(eSpecType node) { + int code = (int) node; + if(code >= 0 && code <= 47) + return eSpecCat::GENERAL; + if(code >= 50 && code <= 63) + return eSpecCat::ONCE; + if(code >= 80 && code <= 107) + return eSpecCat::AFFECT; + if(code >= 130 && code <= 160) + return eSpecCat::IF_THEN; + if(code >= 170 && code <= 204) + return eSpecCat::TOWN; + if(code >= 210 && code <= 218) + return eSpecCat::RECT; + if(code >= 225 && code <= 228) + return eSpecCat::OUTDOOR; + return eSpecCat::INVALID; +} + static std::map loadProps() { std::map allNodeProps; // There's really no need to check all the way to the max of the underlying type. diff --git a/src/scenario/special.hpp b/src/scenario/special.hpp new file mode 100644 index 00000000..31510987 --- /dev/null +++ b/src/scenario/special.hpp @@ -0,0 +1,140 @@ +/* + * special.h + * BoE + * + * Created by Celtic Minstrel on 20/04/09. + * + */ + +#ifndef BOE_DATA_SPECIAL_H +#define BOE_DATA_SPECIAL_H + +#include +#include +#include +#include "location.hpp" + +namespace legacy { struct special_node_type; }; + +// TODO: Add win/lose option to END_SCENARIO +// TODO: Allow OUT_MOVE_PARTY to change the current sector +enum class eSpecType { + INVALID = -1, // A magic value used while processing nodes + NONE = 0, SET_SDF = 1, INC_SDF = 2, DISPLAY_MSG = 3, ENTER_SHOP = 4, + DISPLAY_SM_MSG = 5, FLIP_SDF = 6, SDF_RANDOM = 7, SDF_ADD = 8, SDF_DIFF = 9, + STORY_DIALOG = 10, CANT_ENTER = 11, CHANGE_TIME = 12, SCEN_TIMER_START = 13, PLAY_SOUND = 14, + CHANGE_HORSE_OWNER = 15, CHANGE_BOAT_OWNER = 16, SET_TOWN_VISIBILITY = 17, MAJOR_EVENT_OCCURRED = 18, FORCED_GIVE = 19, + BUY_ITEMS_OF_TYPE = 20, CALL_GLOBAL = 21, SET_SDF_ROW = 22, COPY_SDF = 23, DISPLAY_PICTURE = 24, + REST = 25, TITLED_MSG = 26, END_SCENARIO = 27, SET_POINTER = 28, SET_CAMP_FLAG = 29, + PRINT_NUMS = 30, SDF_TIMES = 31, SDF_DIVIDE = 32, SDF_POWER = 33, CHANGE_TER = 34, + SWAP_TER = 35, TRANS_TER = 36, CLEAR_BUF = 37, APPEND_STRING = 38, APPEND_NUM = 39, + APPEND_MONST = 40, APPEND_ITEM = 41, APPEND_TER = 42, PAUSE = 43, START_TALK = 44, + UPDATE_QUEST = 45, SWAP_STR_BUF = 46, STR_BUF_TO_SIGN = 47, + + ONCE_GIVE_ITEM = 50, ONCE_GIVE_SPEC_ITEM = 51, ONCE_NULL = 52, ONCE_SET_SDF = 53, ONCE_DISPLAY_MSG = 54, + ONCE_DIALOG = 55, UNUSED13 = 56, UNUSED14 = 57, ONCE_GIVE_ITEM_DIALOG = 58, UNUSED15 = 59, + UNUSED16 = 60, ONCE_OUT_ENCOUNTER = 61, ONCE_TOWN_ENCOUNTER = 62, ONCE_TRAP = 63, + + SELECT_TARGET = 80, DAMAGE = 81, AFFECT_HP = 82, AFFECT_SP = 83, AFFECT_XP = 84, + AFFECT_SKILL_PTS = 85, AFFECT_DEADNESS = 86, AFFECT_STATUS = 87, AFFECT_TRAITS = 88, AFFECT_AP = 89, + AFFECT_NAME = 90, AFFECT_LEVEL = 91, AFFECT_MORALE = 92, AFFECT_SOUL_CRYSTAL = 93, GIVE_ITEM = 94, + AFFECT_MONST_TARG = 95, AFFECT_MONST_ATT = 96, AFFECT_MONST_STAT = 97, AFFECT_STAT = 98, AFFECT_MAGE_SPELL = 99, + AFFECT_PRIEST_SPELL = 100, AFFECT_GOLD = 101, AFFECT_FOOD = 102, AFFECT_ALCHEMY = 103, AFFECT_PARTY_STATUS = 104, + CREATE_NEW_PC = 105, STORE_PC = 106, UNSTORE_PC = 107, + + IF_SDF = 130, IF_TOWN_NUM = 131, IF_RANDOM = 132, IF_HAVE_SPECIAL_ITEM = 133, IF_SDF_COMPARE = 134, + IF_TER_TYPE = 135, IF_ALIVE = 136, IF_HAS_GOLD = 137, IF_HAS_FOOD = 138, IF_ITEM_CLASS_ON_SPACE = 139, + IF_HAVE_ITEM_CLASS = 140, IF_EQUIP_ITEM_CLASS = 141, IF_MAGE_SPELL = 142, IF_PRIEST_SPELL = 143, IF_RECIPE = 144, + IF_STATUS = 145, IF_LOOKING = 146, IF_DAY_REACHED = 147, IF_FIELDS = 148, IF_PARTY_SIZE = 149, + IF_EVENT_OCCURRED = 150, IF_SPECIES = 151, IF_TRAIT = 152, IF_STATISTIC = 153, IF_TEXT_RESPONSE = 154, + IF_SDF_EQ = 155, IF_CONTEXT = 156, IF_NUM_RESPONSE = 157, IF_IN_BOAT = 158, IF_ON_HORSE = 159, + IF_QUEST = 160, + + MAKE_TOWN_HOSTILE = 170, TOWN_RUN_MISSILE = 171, TOWN_MONST_ATTACK = 172, TOWN_BOOM_SPACE = 173, TOWN_MOVE_PARTY = 174, + TOWN_HIT_SPACE = 175, TOWN_EXPLODE_SPACE = 176, TOWN_LOCK_SPACE = 177, TOWN_UNLOCK_SPACE = 178, TOWN_SFX_BURST = 179, + TOWN_CREATE_WANDERING = 180, TOWN_PLACE_MONST = 181, TOWN_DESTROY_MONST = 182, TOWN_NUKE_MONSTS = 183, TOWN_GENERIC_LEVER = 184, + TOWN_GENERIC_PORTAL = 185, TOWN_GENERIC_BUTTON = 186, TOWN_GENERIC_STAIR = 187, TOWN_LEVER = 188, TOWN_PORTAL = 189, + TOWN_STAIR = 190, TOWN_RELOCATE = 191, TOWN_PLACE_ITEM = 192, TOWN_SPLIT_PARTY = 193, TOWN_REUNITE_PARTY = 194, + TOWN_TIMER_START = 195, TOWN_CHANGE_LIGHTING = 196, TOWN_SET_ATTITUDE = 197, TOWN_SET_CENTER = 198, TOWN_LIFT_FOG = 199, + TOWN_START_TARGETING = 200, TOWN_SPELL_PAT_FIELD = 201, TOWN_SPELL_PAT_BOOM = 202, TOWN_RELOCATE_CREATURE = 203, TOWN_PLACE_LABEL = 204, + + RECT_PLACE_FIELD = 210, RECT_SET_EXPLORED = 211, RECT_MOVE_ITEMS = 212, RECT_DESTROY_ITEMS = 213, RECT_CHANGE_TER = 214, + RECT_SWAP_TER = 215, RECT_TRANS_TER = 216, RECT_LOCK = 217, RECT_UNLOCK = 218, + + OUT_MAKE_WANDER = 225, OUT_FORCE_TOWN = 226, OUT_PLACE_ENCOUNTER = 227, OUT_MOVE_PARTY = 228, +}; + +class cSpecial { +public: + eSpecType type; + short sd1; + short sd2; + short pic; + short pictype; + short m1; + short m2; + short m3; + short ex1a; + short ex1b; + short ex1c; + short ex2a; + short ex2b; + short ex2c; + short jumpto; + + cSpecial(); + void import_legacy(legacy::special_node_type& old); + void writeTo(std::ostream& file, int n) const; +}; + +class cTimer { +public: + long time = 0; + short node_type = 0; + short node = -1; +}; + +// HAIL means called when initiating conversation. +// TALK means called during conversation. +enum class eSpecCtx { + OUT_MOVE, TOWN_MOVE, COMBAT_MOVE, OUT_LOOK, TOWN_LOOK, + ENTER_TOWN, LEAVE_TOWN, TALK, USE_SPEC_ITEM, TOWN_TIMER, + SCEN_TIMER, PARTY_TIMER, KILL_MONST, OUTDOOR_ENC, FLEE_ENCOUNTER, + WIN_ENCOUNTER, TARGET, USE_SPACE, SEE_MONST, MONST_SPEC_ABIL, + TOWN_HOSTILE, ATTACKING_MELEE, ATTACKING_RANGE, ATTACKED_MELEE, ATTACKED_RANGE, + HAIL, SHOPPING, DROP_ITEM, STARTUP, +}; + +struct pending_special_type { + spec_num_t spec; + eSpecCtx mode; + unsigned short type; // 0 - scen, 1 - out, 2 - town + location where; + long long trigger_time; +}; + +enum class eSpecCat { + INVALID = -1, + GENERAL, ONCE, AFFECT, IF_THEN, TOWN, RECT, OUTDOOR +}; + +struct node_properties_t { + eSpecType self; + std::string opcode() const; + std::string name() const, descr() const; + std::string sdf1_lbl() const, sdf2_lbl() const, sdf1_hlp() const, sdf2_hlp() const; + std::string msg1_lbl() const, msg2_lbl() const, msg3_lbl() const, msg1_hlp() const, msg2_hlp() const, msg3_hlp() const; + std::string pic_lbl() const, pt_lbl() const, pic_hlp() const, pt_hlp() const; + std::string ex1a_lbl() const, ex1b_lbl() const, ex1c_lbl() const, ex1a_hlp() const, ex1b_hlp() const, ex1c_hlp() const; + std::string ex2a_lbl() const, ex2b_lbl() const, ex2c_lbl() const, ex2a_hlp() const, ex2b_hlp() const, ex2c_hlp() const; + std::string jmp_lbl() const, jmp_hlp() const; + char sd1_btn, sd2_btn, m1_btn, m2_btn, m3_btn, p_btn, pt_btn; + char x1a_btn, x1b_btn, x1c_btn, x2a_btn, x2b_btn, x2c_btn; + node_properties_t() {} + node_properties_t(std::initializer_list>); +}; + +const node_properties_t& operator* (eSpecType t); +eSpecCat getNodeCategory(eSpecType node); + +#endif diff --git a/src/classes/talking.cpp b/src/scenario/talking.cpp similarity index 100% rename from src/classes/talking.cpp rename to src/scenario/talking.cpp diff --git a/src/classes/talking.hpp b/src/scenario/talking.hpp similarity index 69% rename from src/classes/talking.hpp rename to src/scenario/talking.hpp index 6749981c..fc7f314b 100644 --- a/src/classes/talking.hpp +++ b/src/scenario/talking.hpp @@ -11,7 +11,6 @@ #include #include -#include "simpletypes.hpp" #include "shop.hpp" namespace legacy { @@ -32,6 +31,37 @@ struct shop_info_t { std::string name; }; +enum class eTalkNode { + REGULAR = 0, + DEP_ON_SDF = 1, + SET_SDF = 2, + INN = 3, + DEP_ON_TIME = 4, + DEP_ON_TIME_AND_EVENT = 5, + DEP_ON_TOWN = 6, + SHOP = 7, + TRAINING = 8, + JOB_BANK = 9, + SELL_WEAPONS = 13, + SELL_ARMOR = 14, + SELL_ITEMS = 15, + IDENTIFY = 16, + ENCHANT = 17, + BUY_INFO = 18, + BUY_SDF = 19, + BUY_SHIP = 20, + BUY_HORSE = 21, + BUY_SPEC_ITEM = 22, + RECEIVE_QUEST = 23, + BUY_TOWN_LOC = 24, + END_FORCE = 25, + END_FIGHT = 26, + END_ALARM = 27, // Town hostile + END_DIE = 28, + CALL_TOWN_SPEC = 29, + CALL_SCEN_SPEC = 30, +}; + class cSpeech { // formerly talking_record_type public: class cNode { // formerly talking_node_type diff --git a/src/classes/terrain.cpp b/src/scenario/terrain.cpp similarity index 99% rename from src/classes/terrain.cpp rename to src/scenario/terrain.cpp index c3f12115..c745d417 100644 --- a/src/classes/terrain.cpp +++ b/src/scenario/terrain.cpp @@ -16,6 +16,7 @@ #include "oldstructs.hpp" #include "graphtool.hpp" // for NO_PIC #include "boe.consts.hpp" // TODO: Put these constants in a global file +#include "damage.hpp" void cTerrain::import_legacy(legacy::terrain_type_type& old){ static const std::set archetypes = { diff --git a/src/classes/terrain.hpp b/src/scenario/terrain.hpp similarity index 96% rename from src/classes/terrain.hpp rename to src/scenario/terrain.hpp index 231ded22..ff3c3cf3 100644 --- a/src/classes/terrain.hpp +++ b/src/scenario/terrain.hpp @@ -12,10 +12,9 @@ #include #include -#include "simpletypes.hpp" #include "pictypes.hpp" #include "location.hpp" -#include "soundtool.hpp" // for snd_num_t +#include "terrain_abilities.hpp" namespace legacy { struct terrain_type_type; }; diff --git a/src/scenario/terrain_abilities.hpp b/src/scenario/terrain_abilities.hpp new file mode 100644 index 00000000..a6c4ae03 --- /dev/null +++ b/src/scenario/terrain_abilities.hpp @@ -0,0 +1,89 @@ +// +// terrain_abilities.hpp +// BoE +// +// Created by Celtic Minstrel on 17-04-13. +// +// + +#ifndef BoE_TERRAIN_ABILITIES_HPP +#define BoE_TERRAIN_ABILITIES_HPP + +enum class eTerSpec { + NONE = 0, + CHANGE_WHEN_STEP_ON = 1, + DAMAGING = 2, // formerly "fire damage" + BRIDGE = 3, // new; formerly "cold damage" + BED = 4, // new; formerly "magic damage" + DANGEROUS = 5, // formerly "poison land" + UNUSED1 = 6, // formerly "disease land" + CRUMBLING = 7, + LOCKABLE = 8, + UNLOCKABLE = 9, + UNUSED2 = 10, // formerly "unlockable + bashable" + IS_A_SIGN = 11, + CALL_SPECIAL = 12, // formerly "call local special" + UNUSED3 = 13, // formerly "call scenario special" + IS_A_CONTAINER = 14, + WILDERNESS_CAVE = 15, + WILDERNESS_SURFACE = 16, // formerly "conveyor north" + WATERFALL_CAVE = 17, // formerly "conveyor east" + WATERFALL_SURFACE = 18, // formerly "conveyor south" + CONVEYOR = 19, // formerly "conveyor west" + BLOCKED_TO_MONSTERS = 20, + TOWN_ENTRANCE = 21, + CHANGE_WHEN_USED = 22, + CALL_SPECIAL_WHEN_USED = 23, + // 1. Change when step on (What to change to, number of sound, Unused) + // 2. Damaging terrain; can't rest here (Amount of damage done, multiplier, damage type) + // 3. Bridge - if the party boats over it, they get the option to land. (Unused, Unused, Unused) + // 4. Bed - change party graphic when they stand on this space + // 5. Dangerous land; can't rest here; percentage chance may be 0 (Strength, Percentage chance, status type) + // 6. Reserved + // 7. Crumbling terrain (Terrain to change to, strength?, destroyed by what - quickfire, shatter/move mountains, or both) + // 8. Lockable terrain (Terrain to change to when locked, Unused, Unused) + // 9. Unlockable terrain (Terrain to change to when locked, Difficulty, can be bashed) + // 10. Reserved + // 11. Sign (Unused, Unused, Unused) + // 12. Call special (Special to call, local or scenario?, Unused) + // 13. Reserved + // 14. Container (Unused, Unused, Unused) + // 15. Waterfall (Direction, Unused, Unused) + // 16. Conveyor Belt (Direction, Unused, Unused) + // 17. Reserved + // 18. Reserved + // 19. Reserved + // 20. Blocked to Monsters (Unused, Unused, Unused) + // 21. Town entrance (Terrain type if hidden, Unused, Unused) + // 22. Change when Used (Terrain to change to when used, Number of sound, Unused) + // 23. Call special when used (Special to call, local or scenario?, Unused) +}; + +enum class eTrimType { + NONE = 0, + WALL = 1, // not a trim, but trims will conform to it as if it's the same ground type (eg stone wall) + S, SE, E, NE, N, NW, W, SW, + NE_INNER, SE_INNER, SW_INNER, NW_INNER, + FRILLS = 14, // like on lava and underground water; no trim_ter required + WALKWAY = 16, // the game will draw walkway corners; trim_ter is base terrain to draw on + WATERFALL = 17, // special case for waterfalls + CITY = 18, // the game will join roads up to this space but not draw roads on the space +}; + +enum class eTerObstruct { + CLEAR = 0, + BLOCK_SIGHT = 1, + BLOCK_MONSTERS = 2, + BLOCK_MOVE = 3, + BLOCK_MOVE_AND_SHOOT = 4, + BLOCK_MOVE_AND_SIGHT = 5, +}; + +inline bool blocksMove(eTerObstruct block) { + int code = (int) block; + return code > 2; +} + +enum class eStepSnd {STEP, SQUISH, CRUNCH, NONE, SPLASH}; + +#endif diff --git a/src/classes/town.cpp b/src/scenario/town.cpp similarity index 100% rename from src/classes/town.cpp rename to src/scenario/town.cpp diff --git a/src/classes/town.hpp b/src/scenario/town.hpp similarity index 96% rename from src/classes/town.hpp rename to src/scenario/town.hpp index fafbf254..640f2ad9 100644 --- a/src/classes/town.hpp +++ b/src/scenario/town.hpp @@ -13,7 +13,6 @@ #include #include #include -#include "simpletypes.hpp" #include "location.hpp" #include "special.hpp" #include "monster.hpp" @@ -32,6 +31,13 @@ namespace legacy { struct preset_field_type; }; +enum eLighting { + LIGHT_NORMAL = 0, + LIGHT_DARK = 1, + LIGHT_DRAINS = 2, + LIGHT_NONE = 3, +}; + class cScenario; class cTown : public cArea { // formerly town_record_type diff --git a/src/classes/town_import.tpp b/src/scenario/town_import.tpp similarity index 100% rename from src/classes/town_import.tpp rename to src/scenario/town_import.tpp diff --git a/src/classes/vehicle.cpp b/src/scenario/vehicle.cpp similarity index 100% rename from src/classes/vehicle.cpp rename to src/scenario/vehicle.cpp diff --git a/src/classes/vehicle.hpp b/src/scenario/vehicle.hpp similarity index 100% rename from src/classes/vehicle.hpp rename to src/scenario/vehicle.hpp diff --git a/src/scenedit/scen.actions.cpp b/src/scenedit/scen.actions.cpp index 386c36b9..aa43ae38 100644 --- a/src/scenedit/scen.actions.cpp +++ b/src/scenedit/scen.actions.cpp @@ -10,7 +10,7 @@ #include "graphtool.hpp" #include "scen.graphics.hpp" #include "scen.actions.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "scen.core.hpp" #include "scen.fileio.hpp" #include "scen.keydlgs.hpp" diff --git a/src/scenedit/scen.core.cpp b/src/scenedit/scen.core.cpp index 6c0dca2e..8ba2685b 100644 --- a/src/scenedit/scen.core.cpp +++ b/src/scenedit/scen.core.cpp @@ -25,7 +25,10 @@ #include "strchoice.hpp" #include "fileio.hpp" #include "field.hpp" -#include "restypes.hpp" +#include "res_strings.hpp" +#include "res_image.hpp" +#include "res_sound.hpp" +#include "cursors.hpp" #include "stack.hpp" #include "spell.hpp" #include "mathutil.hpp" diff --git a/src/scenedit/scen.fileio.cpp b/src/scenedit/scen.fileio.cpp index 43240d9a..1d3b0452 100644 --- a/src/scenedit/scen.fileio.cpp +++ b/src/scenedit/scen.fileio.cpp @@ -10,7 +10,7 @@ #include "scen.keydlgs.hpp" #include "graphtool.hpp" #include "scen.core.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "mathutil.hpp" #include "oldstructs.hpp" #include "fileio.hpp" diff --git a/src/scenedit/scen.graphics.cpp b/src/scenedit/scen.graphics.cpp index fe943840..38127d34 100644 --- a/src/scenedit/scen.graphics.cpp +++ b/src/scenedit/scen.graphics.cpp @@ -8,16 +8,17 @@ #include "scen.graphics.hpp" #include #include "scen.keydlgs.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "mathutil.hpp" #include "boe.consts.hpp" // TODO: Put these constants in a global file +#include "cursors.hpp" #include "dialog.hpp" #include "scen.core.hpp" #include "scen.townout.hpp" #include "scrollbar.hpp" -#include "restypes.hpp" +#include "res_image.hpp" #include "scen.btnmg.hpp" diff --git a/src/scenedit/scen.graphics.hpp b/src/scenedit/scen.graphics.hpp index 52c6b480..5cf74beb 100644 --- a/src/scenedit/scen.graphics.hpp +++ b/src/scenedit/scen.graphics.hpp @@ -1,5 +1,5 @@ -#include "simpletypes.hpp" +#include "fields.hpp" void Set_up_win (); void run_startup_g(); diff --git a/src/scenedit/scen.keydlgs.cpp b/src/scenedit/scen.keydlgs.cpp index 871777c4..ad6b0dd6 100644 --- a/src/scenedit/scen.keydlgs.cpp +++ b/src/scenedit/scen.keydlgs.cpp @@ -17,7 +17,7 @@ #include "3choice.hpp" #include "strchoice.hpp" #include "pictchoice.hpp" -#include "restypes.hpp" +#include "res_strings.hpp" #include "spell.hpp" extern short cen_x, cen_y; @@ -1209,7 +1209,3 @@ void edit_scen_intro() { edit.run(); } - -void make_cursor_sword() { - set_cursor(wand_curs); -} diff --git a/src/scenedit/scen.keydlgs.hpp b/src/scenedit/scen.keydlgs.hpp index 319c1743..e83ce739 100644 --- a/src/scenedit/scen.keydlgs.hpp +++ b/src/scenedit/scen.keydlgs.hpp @@ -32,7 +32,6 @@ void edit_dialog_text(eStrMode mode,short *str1,cDialog* parent); short edit_special_num(short mode,short what_start); void edit_scen_intro(); bool edit_area_rect_str(info_rect_t& r); -void make_cursor_sword() ; size_t num_strs(eStrMode str_mode); pic_num_t choose_damage_type(short cur, cDialog* parent, bool allow_spec); diff --git a/src/scenedit/scen.main.cpp b/src/scenedit/scen.main.cpp index d2a23bc0..74d8e196 100644 --- a/src/scenedit/scen.main.cpp +++ b/src/scenedit/scen.main.cpp @@ -11,7 +11,7 @@ #include "scen.actions.hpp" #include "scen.fileio.hpp" #include "scen.btnmg.hpp" -#include "soundtool.hpp" +#include "sounds.hpp" #include "scen.townout.hpp" #include "scen.core.hpp" #include "scen.keydlgs.hpp" @@ -23,7 +23,7 @@ #include "strdlog.hpp" #include "choicedlog.hpp" #include "scen.menus.hpp" -#include "restypes.hpp" +#include "res_image.hpp" /* Globals */ bool All_Done = false; diff --git a/src/skills_traits.hpp b/src/skills_traits.hpp new file mode 100644 index 00000000..4c5108ea --- /dev/null +++ b/src/skills_traits.hpp @@ -0,0 +1,63 @@ +// +// skills_traits.hpp +// BoE +// +// Created by Celtic Minstrel on 17-04-13. +// +// + +#ifndef BoE_SKILLS_TRAITS_HPP +#define BoE_SKILLS_TRAITS_HPP + +enum class eSkill { + INVALID = -1, + STRENGTH = 0, + DEXTERITY = 1, + INTELLIGENCE = 2, + EDGED_WEAPONS = 3, + BASHING_WEAPONS = 4, + POLE_WEAPONS = 5, + THROWN_MISSILES = 6, + ARCHERY = 7, + DEFENSE = 8, + MAGE_SPELLS = 9, + PRIEST_SPELLS = 10, + MAGE_LORE = 11, + ALCHEMY = 12, + ITEM_LORE = 13, + DISARM_TRAPS = 14, + LOCKPICKING = 15, + ASSASSINATION = 16, + POISON = 17, + LUCK = 18, + MAX_HP = 19, + MAX_SP = 20, + // Magic values; only for check_party_stat() + CUR_HP = 100, + CUR_SP = 101, + CUR_XP = 102, + CUR_SKILL = 103, + CUR_LEVEL = 104, +}; + +enum class eTrait { + TOUGHNESS = 0, + MAGICALLY_APT = 1, + AMBIDEXTROUS = 2, + NIMBLE = 3, + CAVE_LORE = 4, + WOODSMAN = 5, + GOOD_CONST = 6, + HIGHLY_ALERT = 7, + STRENGTH = 8, + RECUPERATION = 9, + SLUGGISH = 10, + MAGICALLY_INEPT = 11, + FRAIL = 12, + CHRONIC_DISEASE = 13, + BAD_BACK = 14, + PACIFIST = 15, + ANAMA = 16, +}; + +#endif diff --git a/src/tools/soundtool.cpp b/src/sounds.cpp similarity index 97% rename from src/tools/soundtool.cpp rename to src/sounds.cpp index 6f150b95..a199c7b3 100644 --- a/src/tools/soundtool.cpp +++ b/src/sounds.cpp @@ -5,7 +5,7 @@ * Created by Celtic Minstrel on 16/04/09. * */ -#include "soundtool.hpp" +#include "sounds.hpp" #include #include @@ -14,7 +14,7 @@ #include #include -#include "restypes.hpp" +#include "res_sound.hpp" #include "mathutil.hpp" #include "prefs.hpp" diff --git a/src/tools/soundtool.hpp b/src/sounds.hpp similarity index 100% rename from src/tools/soundtool.hpp rename to src/sounds.hpp diff --git a/src/classes/spell.cpp b/src/spell.cpp similarity index 100% rename from src/classes/spell.cpp rename to src/spell.cpp diff --git a/src/spell.hpp b/src/spell.hpp new file mode 100644 index 00000000..1af64896 --- /dev/null +++ b/src/spell.hpp @@ -0,0 +1,102 @@ +// +// spell.hpp +// BoE +// +// Created by Celtic Minstrel on 14-12-12. +// +// + +#ifndef BoE_DATA_SPELL_HPP +#define BoE_DATA_SPELL_HPP + +#include +#include "skills_traits.hpp" + +enum eSpellRefer {REFER_YES, REFER_IMMED, REFER_TARGET, REFER_FANCY}; +enum eSpellSelect {SELECT_NO, SELECT_ACTIVE, SELECT_ANY}; +// This one is meant for indexing a bit field +enum eSpellWhen {WHEN_COMBAT = 1, WHEN_TOWN = 2, WHEN_OUTDOORS = 4}; + +enum eSpellPat {PAT_SINGLE, PAT_SQ, PAT_SMSQ, PAT_OPENSQ, PAT_RAD2, PAT_RAD3, PAT_PLUS, PAT_WALL}; + +enum class eSpell { + NONE = -1, + // Mage spells + LIGHT = 0, SPARK = 1, HASTE_MINOR = 2, STRENGTH = 3, SCARE = 4, + CLOUD_FLAME = 5, IDENTIFY = 6, SCRY_MONSTER = 7, GOO = 8, TRUE_SIGHT = 9, + POISON_MINOR = 10, FLAME = 11, SLOW = 12, DUMBFOUND = 13, ENVENOM = 14, + CLOUD_STINK = 15, SUMMON_BEAST = 16, CONFLAGRATION = 17, DISPEL_SQUARE = 18, CLOUD_SLEEP = 19, + UNLOCK = 20, HASTE = 21, FIREBALL = 22, LIGHT_LONG = 23, FEAR = 24, + WALL_FORCE = 25, SUMMON_WEAK = 26, ARROWS_FLAME = 27, WEB = 28, RESIST_MAGIC = 29, + POISON = 30, ICE_BOLT = 31, SLOW_GROUP = 32, MAGIC_MAP = 33, CAPTURE_SOUL = 34, + SIMULACRUM = 35, ARROWS_VENOM = 36, WALL_ICE = 37, STEALTH = 38, HASTE_MAJOR = 39, + FIRESTORM = 40, DISPEL_BARRIER = 41, BARRIER_FIRE = 42, SUMMON = 43, SHOCKSTORM = 44, + SPRAY_FIELDS = 45, POISON_MAJOR = 46, FEAR_GROUP = 47, KILL = 48, PARALYZE = 49, + DEMON = 50, ANTIMAGIC = 51, MINDDUEL = 52, FLIGHT = 53, SHOCKWAVE = 54, + BLESS_MAJOR = 55, PARALYSIS_MASS = 56, PROTECTION = 57, SUMMON_MAJOR = 58, BARRIER_FORCE = 59, + QUICKFIRE = 60, ARROWS_DEATH = 61, /* Special spells */ STRENGTHEN_TARGET = 62, SUMMON_RAT = 63, WALL_ICE_BALL = 64, + GOO_BOMB = 65, FOUL_VAPOR = 66, CLOUD_SLEEP_LARGE = 67, ACID_SPRAY = 68, PARALYZE_BEAM = 69, + SLEEP_MASS = 70, RAVAGE_ENEMIES = 71, BLADE_AURA = 72, ICY_RAIN = 73, FLAME_AURA = 74, + SUMMON_AID = 75, SUMMON_AID_MAJOR = 76, FLASH_STEP = 77, + // Priest spells + BLESS_MINOR = 100, HEAL_MINOR = 101, POISON_WEAKEN = 102, TURN_UNDEAD = 103, LOCATION = 104, + SANCTUARY = 105, SYMBIOSIS = 106, MANNA_MINOR = 107, RITUAL_SANCTIFY = 108, STUMBLE = 109, + BLESS = 110, POISON_CURE = 111, CURSE = 112, LIGHT_DIVINE = 113, WOUND = 114, + SUMMON_SPIRIT = 115, MOVE_MOUNTAINS = 116, CHARM_FOE = 117, DISEASE = 118, AWAKEN = 119, + HEAL = 120, HEAL_ALL_LIGHT = 121, HOLY_SCOURGE = 122, DETECT_LIFE = 123, PARALYSIS_CURE = 124, + MANNA = 125, FORCEFIELD = 126, DISEASE_CURE = 127, RESTORE_MIND = 128, SMITE = 129, + POISON_CURE_ALL = 130, CURSE_ALL = 131, DISPEL_UNDEAD = 132, CURSE_REMOVE = 133, STICKS_TO_SNAKES = 134, + MARTYRS_SHIELD = 135, CLEANSE = 136, FIREWALK = 137, BLESS_PARTY = 138, HEAL_MAJOR = 139, + RAISE_DEAD = 140, FLAMESTRIKE = 141, SANCTUARY_MASS = 142, SUMMON_HOST = 143, SHATTER = 144, + DISPEL_SPHERE = 145, HEAL_ALL = 146, REVIVE = 147, HYPERACTIVITY = 148, DESTONE = 149, + SUMMON_GUARDIAN = 150, CHARM_MASS = 151, PROTECTIVE_CIRCLE = 152, PESTILENCE = 153, REVIVE_ALL = 154, + RAVAGE_SPIRIT = 155, RESURRECT = 156, DIVINE_THUD = 157, AVATAR = 158, WALL_BLADES = 159, + WORD_RECALL = 160, CLEANSE_MAJOR = 161, /* Special spells */ DISPEL_FIELD = 162, MOVE_MOUNTAINS_MASS = 163, WRACK = 164, + UNHOLY_RAVAGING = 165, AUGMENTATION = 166, NIRVANA = 167, +}; + +inline bool isMage(eSpell spell) { + int code = (int) spell; + return code >= 0 && code < 62; +} + +inline bool isPriest(eSpell spell) { + int code = (int) spell; + return code >= 100 && code < 162; +} + +class cSpell { + static std::map dictionary; + friend const cSpell& operator*(eSpell spell_num); +public: + cSpell() {} // This is just here because the map doesn't work without it + cSpell(eSpell id); + cSpell& withRefer(eSpellRefer r); + cSpell& withCost(int c); + cSpell& withRange(int r); + cSpell& asLevel(int lvl); + cSpell& asType(eSkill type); + cSpell& asPeaceful(); + cSpell& needsSelect(eSpellSelect sel = SELECT_ACTIVE); + cSpell& when(eSpellWhen when); + const cSpell& finish(); + eSpell num; + eSpellRefer refer; + int cost, range, level; + eSpellSelect need_select; + eSkill type; + int when_cast; + bool peaceful = false; + std::string name() const; + bool is_priest() const; + static eSpell fromNum(eSkill type, int num); + static eSpell fromNum(int num); +}; + +// Need to declare this a second time in order for it to be in scope where it's needed +const cSpell& operator*(eSpell spell_num); + +std::ostream& operator<< (std::ostream& out, eSpellPat pat); +std::istream& operator>> (std::istream& in, eSpellPat& pat); + +#endif diff --git a/src/tools/cursors.hpp b/src/tools/cursors.hpp index 6599b8bb..27077958 100644 --- a/src/tools/cursors.hpp +++ b/src/tools/cursors.hpp @@ -12,8 +12,6 @@ #include #include -namespace fs = boost::filesystem; - enum cursor_type { wand_curs = 0, eyedropper_curs = 1, @@ -47,6 +45,7 @@ enum cursor_type { class Cursor { void* ptr; public: + static cursor_type current; Cursor(fs::path imgPath, float hotSpotX, float hotSpotY); ~Cursor(); void apply(); @@ -69,4 +68,10 @@ static const char*const cursors[26] = { "talk", "key", "look", "bucket", "watch", }; +static const cursor_type arrow_curs[3][3] = { + {NW_curs, N_curs, NE_curs}, + {W_curs, wait_curs, E_curs}, + {SW_curs, S_curs, SE_curs}, +}; + #endif diff --git a/src/tools/cursors.mac.mm b/src/tools/cursors.mac.mm index c03936c0..dd6318f2 100644 --- a/src/tools/cursors.mac.mm +++ b/src/tools/cursors.mac.mm @@ -9,9 +9,7 @@ #include "cursors.hpp" #include #include -#include "restypes.hpp" - -extern cursor_type current_cursor; +#include "res_cursor.hpp" static NSImage* imageFromURL(CFURLRef url){ CGImageSourceRef imageSource = CGImageSourceCreateWithURL(url, nullptr); @@ -68,7 +66,7 @@ void obscureCursor() { void set_cursor(cursor_type which_c) { if(which_c != watch_curs) - current_cursor = which_c; + Cursor::current = which_c; if(which_c == text_curs) { [[NSCursor IBeamCursor] set]; } else { @@ -78,5 +76,5 @@ void set_cursor(cursor_type which_c) { } void restore_cursor(){ - set_cursor(current_cursor); + set_cursor(Cursor::current); } diff --git a/src/tools/prefs.win.cpp b/src/tools/prefs.win.cpp index 8e4a45b3..c39897f0 100644 --- a/src/tools/prefs.win.cpp +++ b/src/tools/prefs.win.cpp @@ -9,7 +9,6 @@ #include #include -namespace fs = boost::filesystem; std::map prefs; using iarray = std::vector; static bool prefsLoaded = false, prefsDirty = false; diff --git a/src/tools/winutil.hpp b/src/tools/winutil.hpp index 9682d2aa..9c6b7d56 100644 --- a/src/tools/winutil.hpp +++ b/src/tools/winutil.hpp @@ -13,8 +13,6 @@ #include #include -namespace fs = boost::filesystem; // TODO: Centralize this alias - char keyToChar(sf::Keyboard::Key key, bool isShift); void makeFrontWindow(sf::Window& win); diff --git a/src/classes/creature.cpp b/src/universe/creature.cpp similarity index 100% rename from src/classes/creature.cpp rename to src/universe/creature.cpp diff --git a/src/classes/creature.hpp b/src/universe/creature.hpp similarity index 98% rename from src/classes/creature.hpp rename to src/universe/creature.hpp index a361e1df..6bba86a0 100644 --- a/src/classes/creature.hpp +++ b/src/universe/creature.hpp @@ -13,7 +13,6 @@ #include "location.hpp" #include "monster.hpp" #include "living.hpp" -#include "simpletypes.hpp" class cCreature : public cMonster, public cTownperson, public iLiving { public: diff --git a/src/classes/living.cpp b/src/universe/living.cpp similarity index 100% rename from src/classes/living.cpp rename to src/universe/living.cpp diff --git a/src/classes/living.hpp b/src/universe/living.hpp similarity index 98% rename from src/classes/living.hpp rename to src/universe/living.hpp index 4994b4c6..8cfc80da 100644 --- a/src/classes/living.hpp +++ b/src/universe/living.hpp @@ -13,7 +13,7 @@ #include #include "location.hpp" -#include "simpletypes.hpp" +#include "damage.hpp" class iLiving { public: diff --git a/src/classes/party.cpp b/src/universe/party.cpp similarity index 100% rename from src/classes/party.cpp rename to src/universe/party.cpp diff --git a/src/classes/party.hpp b/src/universe/party.hpp similarity index 98% rename from src/classes/party.hpp rename to src/universe/party.hpp index 9ec058d2..9cef9cab 100644 --- a/src/classes/party.hpp +++ b/src/universe/party.hpp @@ -18,12 +18,13 @@ #include #include "vehicle.hpp" -#include "creatlist.hpp" +#include "population.hpp" #include "item.hpp" #include "pc.hpp" #include "outdoors.hpp" #include "monster.hpp" #include "living.hpp" +#include "quest.hpp" namespace legacy { struct party_record_type; @@ -45,6 +46,12 @@ struct job_bank_t { bool inited = false; }; +enum eEncNoteType { + NOTE_SCEN, + NOTE_OUT, + NOTE_TOWN, +}; + class cUniverse; class cItem; diff --git a/src/classes/pc.cpp b/src/universe/pc.cpp similarity index 100% rename from src/classes/pc.cpp rename to src/universe/pc.cpp diff --git a/src/classes/pc.hpp b/src/universe/pc.hpp similarity index 98% rename from src/classes/pc.hpp rename to src/universe/pc.hpp index 281ec351..c417fc0c 100644 --- a/src/classes/pc.hpp +++ b/src/universe/pc.hpp @@ -15,10 +15,12 @@ #include #include -#include "simpletypes.hpp" #include "item.hpp" #include "pictypes.hpp" #include "living.hpp" +#include "skills_traits.hpp" +#include "race.hpp" +#include "spell.hpp" namespace legacy { struct pc_record_type; }; diff --git a/src/classes/creatlist.cpp b/src/universe/population.cpp similarity index 98% rename from src/classes/creatlist.cpp rename to src/universe/population.cpp index 585ccc85..7017c6d8 100644 --- a/src/classes/creatlist.cpp +++ b/src/universe/population.cpp @@ -6,7 +6,7 @@ * */ -#include "creatlist.hpp" +#include "population.hpp" #include #include diff --git a/src/classes/creatlist.hpp b/src/universe/population.hpp similarity index 100% rename from src/classes/creatlist.hpp rename to src/universe/population.hpp diff --git a/src/classes/universe.cpp b/src/universe/universe.cpp similarity index 100% rename from src/classes/universe.cpp rename to src/universe/universe.cpp diff --git a/src/classes/universe.hpp b/src/universe/universe.hpp similarity index 98% rename from src/classes/universe.hpp rename to src/universe/universe.hpp index b3729ea8..96c16dac 100644 --- a/src/classes/universe.hpp +++ b/src/universe/universe.hpp @@ -15,16 +15,13 @@ #include #include #include "party.hpp" -#include "creatlist.hpp" +#include "population.hpp" #include "item.hpp" #include "town.hpp" #include "talking.hpp" -#include "simpletypes.hpp" #include "scenario.hpp" #include "pictypes.hpp" -namespace fs = boost::filesystem; // TODO: Centralize this namespace alias? - namespace legacy { struct out_info_type; struct current_town_type; diff --git a/src/tools/view_dialogs.cpp b/src/view_dialogs.cpp similarity index 100% rename from src/tools/view_dialogs.cpp rename to src/view_dialogs.cpp diff --git a/src/tools/view_dialogs.hpp b/src/view_dialogs.hpp similarity index 100% rename from src/tools/view_dialogs.hpp rename to src/view_dialogs.hpp diff --git a/test/init.cpp b/test/init.cpp index c6c09685..a76ca88d 100644 --- a/test/init.cpp +++ b/test/init.cpp @@ -9,7 +9,7 @@ #include "catch.hpp" #include "scenario.hpp" #include "creature.hpp" -#include "creatlist.hpp" +#include "population.hpp" #include "pc.hpp" #include "party.hpp" diff --git a/test/item_legacy.cpp b/test/item_legacy.cpp index fad8ba29..0611de28 100644 --- a/test/item_legacy.cpp +++ b/test/item_legacy.cpp @@ -10,6 +10,8 @@ #include "item.hpp" #include "oldstructs.hpp" #include "spell.hpp" +#include "damage.hpp" +#include "race.hpp" static void set_item_name(legacy::item_record_type& item, const std::string& full, const std::string& name) { std::copy_n(full.begin(), std::min(25, 1 + full.size()), item.full_name); diff --git a/test/scen_read.cpp b/test/scen_read.cpp index 6fd04198..8bbabf2a 100644 --- a/test/scen_read.cpp +++ b/test/scen_read.cpp @@ -5,7 +5,7 @@ #include "dialog.hpp" #include "catch.hpp" #include "scenario.hpp" -#include "restypes.hpp" +#include "res_strings.hpp" using namespace std; using namespace ticpp; diff --git a/test/scen_write.cpp b/test/scen_write.cpp index 9cb7d115..efa05673 100644 --- a/test/scen_write.cpp +++ b/test/scen_write.cpp @@ -6,7 +6,7 @@ #include "catch.hpp" #include "scenario.hpp" #include "town.hpp" -#include "restypes.hpp" +#include "res_strings.hpp" using namespace std; using namespace ticpp; diff --git a/test/spec_legacy.cpp b/test/spec_legacy.cpp index 0553a38d..d53981f5 100644 --- a/test/spec_legacy.cpp +++ b/test/spec_legacy.cpp @@ -9,8 +9,15 @@ #include "catch.hpp" #include "oldstructs.hpp" #include "special.hpp" -#include "restypes.hpp" +#include "res_strings.hpp" #include "pictypes.hpp" +#include "spell.hpp" +#include "damage.hpp" +#include "skills_traits.hpp" +#include "fields.hpp" +#include "race.hpp" +#include "monster.hpp" // for eAttitude +#include "town.hpp" // for lighting constants using namespace std; diff --git a/test/ter_legacy.cpp b/test/ter_legacy.cpp index 28b952c7..838a59ae 100644 --- a/test/ter_legacy.cpp +++ b/test/ter_legacy.cpp @@ -9,6 +9,7 @@ #include "catch.hpp" #include "terrain.hpp" #include "oldstructs.hpp" +#include "damage.hpp" TEST_CASE("Converting terrain types from legacy scenarios") { cTerrain new_ter;