Commit graph

742 commits

Author SHA1 Message Date
staphen
25d3b36c96 Do not send CMD_REMSHIELD when another player runs out of mana 2021-12-19 22:11:03 +01:00
Gleb Mazovetskiy
076b0c0c05 Overhaul tests
1. Adds a `libdevilution_so` target when tests are enabled.
2. Each test file is now a separate binary target linked against `libdevilutionx_so` (can now run tests in parallel).
3. Tests are now defined in a separate `test/CMakeLists.txt` file.
4. Building the tests is now controlled by the standard `BUILD_TESTING` option (defined by CTest).
5. Tests are now built by default.
6. On CI, test errors are now reported.

Also:

* `.clang-format`: Enable SortIncludes in tests
* `path_test.cpp`: Fix -Wsign-compare
2021-12-16 20:26:51 +00:00
Adam Heinermann
1484b4d8cf
Implement Discord rich presence (#3711) 2021-12-15 17:14:17 +01:00
Joerg Wissen
f9bc40e8e0
Optional functionality to auto-pickup potions 2021-12-09 22:45:26 +00:00
qndel
be0b79f9f5
Add IsWallSpell helper 2021-12-07 12:00:52 +01:00
Vladimir Olteanu
861fb99e9d Quick cast 2021-12-04 15:38:58 +01:00
Gleb Mazovetskiy
0e63b3ee0b Update clang-format-check GitHub Workflow
Taking this opportunity as we've just done a global reformat and it's
quite small.
2021-11-24 23:44:12 +01:00
obligaron
635f378722 Add OptionEntry Experience Bar 2021-11-24 09:31:39 +01:00
obligaron
e1f97603ae Add OptionEntry Walking Sound 2021-11-24 09:31:39 +01:00
ephphatha
baa1cd65c5 Make FindGetItem return an index into ActiveItems
This allows the calling code in DeltaLoadLevel to behave the same as every other use of DeleteItem, making it possible to remove the duplicate argument and ensure that the ActiveItems/AvailableItems arrays are treated appropriately.
2021-11-23 19:08:41 +01:00
obligaron
1ed4490497 Remove Player.deathFrame and deathdelay and fix death by object animation 2021-11-22 00:37:19 +01:00
KPhoenix
c52a107eb8 Prevent Spell Targeting Players with Friendly Mode enabled
Prevents players from targeting each other with spells in the same way that players are prevented from targeting each other with weapons when Friendly Mode is enabled
2021-11-21 13:14:26 +01:00
obligaron
677303cba9
Reduce use of view globals in game menu 2021-11-20 21:57:32 +01:00
ThomasChr
cbda2c848d When blocking with staff (only monk) also decrease durability as with a shield 2021-11-20 20:50:48 +01:00
ThomasChr
0f1bd30e65 Change log message to correct function name 2021-11-20 20:50:48 +01:00
Andrew James
8104432db4
Use object reference (and self-id lookup) for BreakBarrel 2021-11-08 00:51:16 +01:00
ephphatha
730f0e65d5 Introduce FindClosestValidPosition function
The pre-calculated crawl table is replaced with partially unrolled loops to handle the special cases covered by the table.

Arbitrary limit of 50 placed to allow using this function for searches where vanilla logic would check up to (±49, ±49).
2021-11-07 20:13:31 +01:00
Andrew James
796e2813cf
Use scoped enums for DungeonFlags/BFLAG (#3135) 2021-11-07 03:11:16 +01:00
Gleb Mazovetskiy
3d308983a8 Migrate to libmpq
libmpq is a much simpler alternative to StormLib for reading MPQ archives.

We use our own fork of libmpq: https://github.com/diasurgical/libmpq

Impact:

* DevilutionX is now a lot more portable. Unlike StormLib, libmpq only
  needs platform-specific code for Windows.
* Locks around file access **removed** (instead we duplicate the file descriptor for streamed audio only).
* RAM usage is **300 KiB** lower than StormLib.
* Stripped release linux_x86_64 binary is **32 KiB** smaller.
* Amiga build now hangs instead of crashing.
2021-11-06 23:51:42 +00:00
Gleb Mazovetskiy
64a88343e8 Refactor: Use item iterators in 7 more places 2021-10-31 13:28:08 +00:00
Anders Jenbo
96e1d5caba Fix spell properties incorrectly being capped at 8
Fixes  #3187
Revert #3021

destParam3 had been typed ad Direction, but is also sometimes used for
other values.
2021-10-25 20:52:56 +02:00
qndel
eba6d827bf
fix typos (#3238) 2021-10-24 18:03:29 +02:00
qndel
0ccdf940f7
fix bounds checks (#3237) 2021-10-24 17:20:04 +02:00
qndel
d81de165d4
code cleanup (#3235) 2021-10-24 16:05:44 +02:00
staphen
2920127f59 Optimize SyncInitPlrPos() 2021-10-22 00:10:42 +02:00
qndel
f8cda02456 apply bounds check function 2021-10-12 01:18:28 +02:00
ephphatha
0f593c17e4 Remove pointless increments of life/mana on level up
fixes #3049
2021-10-07 04:35:47 +02:00
obligaron
6b8b6ba77b
Fix OnSpellTile check (#3021) 2021-10-06 08:35:59 +02:00
staphen
a7e2abeb72 Restore original Warrior death sound 2021-10-01 06:50:57 +02:00
qndel
873e426952
fix light stealing (#2992) 2021-09-30 15:16:41 +02:00
Anders Jenbo
490343ae0c Fix quater damage in Hellfire 2021-09-30 04:15:08 +02:00
obligaron
0818c55b88 Holding mouse when shift is held shouldn't lock to a target (Spells) 2021-09-27 11:58:51 +02:00
obligaron
16d98d48c3 Fix melee friendly fire when sgOptions.Gameplay.bFriendlyFire is set 2021-09-26 16:26:48 +02:00
Gleb Mazovetskiy
ec13c333a9 Refactor: Use item iterators for scroll checks
Refs #2586
2021-09-24 01:56:44 +01:00
obligaron
261403558b Fix SetPlayerGPtrs with RUN_TESTS definied 2021-09-18 14:38:03 +02:00
Gleb Mazovetskiy
4e1ad7ab65 LoadFile: Avoid opening the file twice
Previously we were passing the path to `GetFileSize`, which resulted in
opening and closing the file twice.
2021-09-18 06:44:48 +02:00
obligaron
f9192d2312 Remove debug command line argument -^ (Enable debug tools) and added
scrollview debug command
2021-09-17 21:05:31 +02:00
obligaron
c7dec38b96 Player: rename _pVar4 to spellLevel 2021-09-17 21:03:41 +02:00
obligaron
c3c91f6e28 Remove _pVar5 and most uses of BFLAG_PLAYERLR 2021-09-17 21:03:41 +02:00
obligaron
e62aaa562f Fix missiles don't hit horizontal walking players/monsters 2021-09-17 21:03:41 +02:00
obligaron
f77da8a580 Ensure ScrollInfo is initialized correctly 2021-09-16 19:22:24 +02:00
Juliano Leal Goncalves
9ac324b8e1
🐛 Prevent manipulation of spell type being cast (#2856)
This prevents frame-perfect manipulated of the spell type after the command has already been sent.
2021-09-13 23:45:51 +02:00
Juliano Leal Goncalves
379a27b64a ♻️ Convert 'ItemType' enum to enum class
🎨 Rename 'ItemType' elements to enum class standards
2021-09-13 00:25:49 +02:00
ephphatha
87a33097a0 Rename ScrollDirection enum to follow convention
Pretty sure the backing type can be left to the default as well but I haven't had the time to investigate where it's used fully.
2021-09-12 02:27:47 +02:00
ephphatha
b12de6fe12 Use scoped enum for Direction
Identified and removed an instance of Direction being used as an argument for a bool parameter

Removed a single-use temporary variable being cast from sprite frame to direction to size_t

Co-authored-by: Anders Jenbo <anders@jenbo.dk>

Fix alignment of WalkSettings array
2021-09-12 02:27:47 +02:00
Anders Jenbo
cd79f0204d 🚨 Fix compiler warnings 2021-09-12 01:37:28 +02:00
Anders Jenbo
2d47c12515 Fix charpanel always showing player 0 stats 2021-09-12 01:37:28 +02:00
Juliano Leal Goncalves
32e22a16b3 ♻️ Leverage conversion constructor for 'Direction' to 'Displacement'
This makes code more consistent overall as we use the same pattern for dealing with Sizes.
2021-09-06 12:57:59 +02:00
Juliano Leal Goncalves
a91074d470 🚚 Rename 'LightStruct' struct to 'Light' 2021-09-06 12:49:48 +02:00
Juliano Leal Goncalves
0d3d4c14f6
🚚 Rename 'Dead' concept to 'Corpse' everywhere (#2808) 2021-09-06 12:49:00 +02:00