Commit Graph

177 Commits

Author SHA1 Message Date
cb73719af3 Make item abil_data a bit more readable
A two-element array is an ugly thing to behold
2023-01-06 02:13:46 -05:00
81bea5a01a Add use flag assertions for every ability in the unit test 2023-01-06 01:23:48 -05:00
baf8bfd5c7 Make flight ability usable outdoors 2023-01-06 00:55:11 -05:00
ae9ea960f1 tests: Make sure this is initialized 2023-01-05 19:52:30 -05:00
4b336d06fb add Catch2 to scons build 2023-01-05 02:10:20 -05:00
b469b3aeea Add a new class to encapsulate the file format used by save files
The class is not yet used in the wild, but does have a unit test
2023-01-04 19:57:12 -05:00
f6f7cd59dc Make catch a submodule so it can be updated more easily 2022-07-12 20:35:45 -04:00
df631f6c3c fix unit tests 2022-07-12 20:35:45 -04:00
5b2561d034 Disable header maps in Xcode 12 2022-07-12 20:35:41 -04:00
7b93726383 Replace 4-character constants with enums
This covers only the places where they were used to indicate
a preset selection in constructors.

The usage in qdpict where they're actually passed to the Resource Manager,
as well as the 4-character constants representing file types and creator
codes, are still present.
2020-02-21 00:16:58 -05:00
511b1858a3 Fix Windows build and tests 2020-02-02 22:32:33 -05:00
542c037342 Integrate a new resource manager which should have better performance 2020-01-26 11:53:19 -05:00
9691470611 Fix the legacy special tests 2020-01-19 16:26:24 -05:00
699e66a69c Remove obsolete failing test 2019-12-29 13:26:00 -05:00
Michael Bonfils
d940f2c39d Merge branch 'linux' into merge_linux 2018-02-08 20:36:46 +01:00
db6132bb03 Fix MSVC warning in catch.hpp 2017-09-16 12:56:56 -04:00
9127e4a03f Enable building tests in MSVC 2013 2017-09-16 12:46:31 -04:00
c2ce2a2cd1 Split up the graphtool files 2017-04-14 15:43:07 -04:00
82abdab695 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)
2017-04-14 00:24:29 -04:00
766853d7a4 Fix unit tests 2017-04-11 20:42:25 -04:00
73cfe2bd24 Merge branch 'master' into linux 2017-01-30 14:02:41 -05:00
ultra
dde0212dc4 renamed sounds to match filenames in source (lowercase .wav), fixed up scenario and character editors 2017-01-26 17:17:33 -05:00
8edc156496 Finish tests for converting legacy special nodes 2016-09-29 22:23:17 -04:00
5c095fb284 More tests for importing legacy special nodes
Errors fixed:
- If Cave Lore / Woodsman not converted correctly
- If Have Item Class Equipped erroneously converted to its +take variant
  (...probably)
- Text Response didn't correctly convert the alternate answer
2016-09-26 20:01:05 -04:00
b18605a8ad More tests for converting legacy special nodes
Errors fixed:
- Affect Party Status nodes were erroneously converted to Affect Status instead
2016-09-26 01:53:22 -04:00
1e084fa5af Add more tests for converting legacy specials
Errors fixed:
- Picture forced to 19 for stairway nodes.

(The game actually did this, and also forced to 22 for portals,
but I decided that wasn't necessary to preserve.)
2016-09-25 20:16:24 -04:00
522b51b5a3 More tests for importing legacy specials
Errors fixed:
- One-Time Do Nothing no longer transformed to One-Time And Set
- Give Item dialogs no longer change item type 20 to 9
2016-09-24 23:36:22 -04:00
863ac053c4 Add tests for reading player data from a saved game
- Changed cPlayer::equip to a bitset
- Use a static constant instead of a loop to initialized player starting spells
- Only save spell points if the player has any (current if different from max)
- Symbolic forms for trait enum (and save symbolic forms also for skills)
- When loading a player, clear data which is not always present in the file
- Also add an init test for cPlayer
2016-09-15 17:25:43 -04:00
17eb856771 Add more tests for legacy special node conversion 2016-09-13 19:51:13 -04:00
67fdeb3a16 Add test for loading legacy dialogue
Also a minor enhancement to the Set Flag dialogue node.
2016-09-09 18:09:46 -04:00
bd412a70c8 Add test for importing legacy town data 2016-09-03 15:43:14 -04:00
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