Commit Graph

96 Commits

Author SHA1 Message Date
5cce71df26 Fix several bugs introduced by refactoring 2016-09-03 12:40:48 -04:00
88d6afce27 Merge all the town classes and remove the unimplemented templated towns
This also adds a common superclass shared by towns and outdoor sectors, and
enables towns of arbitrary sizes.
2016-09-03 02:50:29 -04:00
ecdad3f2df Misc minor code cleanup 2016-08-15 12:32:34 -04:00
1330d10b86 Add test for legacy outdoor sector conversion 2016-08-09 13:05:53 -04:00
b5facb5bfe Add test case for loading legacy scenario header data 2016-08-05 15:12:37 -04:00
Ben Scott
a44b298012 fixed some catch.hpp includes in the tests, fixed a deprecated event cast in appleevents.mm 2015-12-22 00:05:52 -05:00
ba984279b0 Some item ability stuff
- Two new item abilities that increase damage as sp/hp is lost
- Two new item abilities that reduce damage as sp/hp is lost
- Support for using sp/hp as a weapon's key skill to determine hit chance
2015-10-12 14:11:27 -04:00
7f00d0c775 Change image resource type from sf::Image to sf::Texture
This includes an added optimization to the resource manager - it now uses unordered (hash) maps instead of ordered (tree) maps to keep track of loaded resources and paths, for the average constant lookup time.
2015-10-05 23:57:42 -04:00
96229d1f40 Lot more tests!
- Tests for converting legacy terrain types
- Tests for initialization to sane values

Fixes:
- cCreature no longer initializes spec1 and spec2 to 0. This probably didn't cause bugs, but who knows...
- In fact, cCreature no longer explicitly initializes anything in its cTownperson superclass. That's what the superclass constructor is for after all.
- Relatedly, cTownperson now defaults to a facial graphic of -1. Also a docile attitude.
- iLiving defaults to ap 0, direction here.
- Fix Change When Step terrains to properly support not having a sound while still allowing an arbitrary number of custom sounds.
- Add support for a lack of sound to Change When Used terrains, including at conversion time (original game supported it but OBoE was forcing the sound to a door sound).
- Fix conversion of crumbling terrain types (old conversion was allowing quickfire to destroy them)

Other:
- New addAttack method in cMonster.
- Change snd_num_t to signed, because it's been getting annoying that I can't easily use -1 to mean "no sound".
2015-10-04 18:44:58 -04:00
f6183cad63 Separate "Splits When Hit" from "Immune to Assassinate" 2015-10-01 22:53:32 -04:00
25e0bc83d0 Start on test cases for conversion of legacy special nodes 2015-10-01 21:37:13 -04:00
f0d200b13b Tests for conversion of legacy items 2015-10-01 18:21:29 -04:00
0dbe0b8325 More tests for conversion of legacy monsters 2015-10-01 09:58:37 -04:00
f218cd94f3 Tests for conversion of legacy monsters
Fixes:
- Throw Rocks always produced weakest version
- The following abilities had a strength of 0:
-- Paralysis Touch
-- Petrification Touch
-- Experience Draining Touch (including as a component of Icy and Draining Touch)
- Summon ability chances were off by a factor of 10
2015-10-01 03:17:06 -04:00
56c533f419 Fix scons build and tests 2015-09-30 18:57:52 -04:00
5c37fa199e Some final scenario read tests 2015-09-30 17:57:48 -04:00
43e82281af More read/write tests for town and outdoors, including maps/dialogue
Fixes:
- For towns, the "has tavern" flag was not saved or loaded
- Outdoor roads were not saved or loaded
- For outdoor encounters, the "can't flee" and "forced" flags were not loaded, and "forced" was not saved
--> These two flags have also been separated in the code
2015-09-30 17:00:05 -04:00
18bb16df9c More read/write test cases for monsters, especially monster abilities
Fixes:
- For radiate abilities, the pattern was not saved and defaulted to single instead of square on load
- For summon abilities, what to summon was not saved and chance was incorrectly saved
2015-09-27 01:20:33 -04:00
ab232bb31a Generalize the editor's terrain frills mechanism 2015-09-26 15:05:49 -04:00
d57954a897 scons: Run test cases as part of the build 2015-09-22 16:11:47 -04:00
2a609adf04 Another items read/write test 2015-09-15 12:34:07 -04:00
354091035c scons: Fix for test cases requiring stringlists 2015-09-13 00:30:34 -04:00
853c270146 scons: Get working on Windows with MSVC 2015-09-13 00:15:28 -04:00
832b8b5f91 Set up scons build system
- In its current state, it produces a valid, launchable Mac application package, though one that's not redistributable (relies on system-installed libraries)
- Partial support is already in-place for a Windows build
2015-09-11 23:10:37 -04:00
44b75b732b Another terrain read/write test 2015-09-10 12:50:35 -04:00
8bc8e10075 Several more map read/write test cases 2015-09-04 04:26:58 -04:00
9fd65cd597 Vehicles fixes
- Fix boats being saved as horses
- Fix first boat/horse not saving property status in scenario map data
- Game finally supports boats that start outdoors... probably
2015-09-03 12:22:13 -04:00
d3b0b26deb More scenario record read tests 2015-09-03 12:22:12 -04:00
8f4d5453cd Basic write tests for towns, dialogue, and outdoors sectors
Also:
- Additional read test for dialogue
- Don't save empty outdoor encounters
- Don't save town timers without an assigned node
2015-09-02 19:46:22 -04:00
bbd47088e1 Basic test cases for reading town, dialogue, and outdoor records 2015-08-28 13:38:08 -04:00
f4e7eea724 Basic tests for writing item, monster, and terrain definitions 2015-08-01 14:52:10 -04:00
7719d62773 Test cases for reading terrain, monster, and item definitions
- For monster attacks, 'd4' now means '1d4' instead of '0d4', and simple numbers without a 'd' are not accepted
- Pop string path after pushing it in the shop test cases
2015-07-29 15:25:19 -04:00
c957987b45 Tests for reading and writing map data
- Fix saving and loading boat/horse positions and property flag
2015-07-09 15:53:34 -04:00
f435be2125 More tests for saving shops 2015-07-07 22:29:14 -04:00
59f60710c5 More test cases for reading shops 2015-07-07 22:22:10 -04:00
93f9860624 Tests for saving and loading shops
- Fix shop name not being loaded from the file
- Fix skills in shops not storing the skill ID
2015-07-07 22:04:11 -04:00
fd42f00e41 Test for saving quests 2015-07-07 21:10:17 -04:00
3c7569a068 Test cases for reading quests 2015-07-07 21:00:55 -04:00
ea17fe364b More scenario reading test cases 2015-07-07 20:41:53 -04:00
137a3aa5d4 A few more scenario read tests
- Introduce enum for scenario content rating
2015-07-07 18:58:35 -04:00
2218513aa5 Several more tests for scenario loading 2015-07-07 17:10:09 -04:00
42734c8599 Test cases to ensure the integrity of the enum stream operators 2015-07-07 14:48:49 -04:00
fecd268d5a Preserve spaces in scenario strings (and other longer strings) by using CDATA
- Involves a hack-mod of ticpp::Text to support it (for some reason, the support was there in TinyXML but not exposed by ticpp)
- Don't save all the intro strings if most are empty
- Don't save the init special if there isn't one
- Fix not saving the "I don't know" response for dialogue personalities

Strings that now preserve spaces:
- Descriptions of items, special items, and quests
- Descriptions of special shop items that call a special node when purchased
- Scenario, town, and outdoor strings
- Sign strings
- Journal strings
- All dialogue strings (both in personalities and in talk nodes)
2015-07-02 12:08:38 -04:00
1f5a1118f8 Some test cases for saving scenarios, and fix some bugs they revealed
- Fix variable town entry and saved item rects not being saved if they referenced an invalid town
- Fix "blank" scenario timers being saved
- Fix junk data appearing in timers
- Output operators for location and rectangle types
- Set timer node_type to 2 when loading from town record
2015-07-01 18:05:42 -04:00
cf51efffe4 Add a hack to the Catch header to shorten test case output filenames 2015-07-01 16:10:58 -04:00
d8b4ee9c56 Start building some unit tests using Catch test library
- Current version of Catch is included in the repo at test/catch.hpp
2015-07-01 16:10:36 -04:00