Commit graph

729 commits

Author SHA1 Message Date
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
Juliano Leal Goncalves
940a120bf9 ♻️ Replace 'ViewX' and 'ViewY' globals with single 'ViewPosition' 2021-09-04 18:06:28 -04:00
Juliano Leal Goncalves
d225202c34 🚚 Rename 'MonsterClass' members for consistency 2021-09-04 23:37:19 +02:00
Juliano Leal Goncalves
21b481bb46 ♻️ Convert 'MonsterClass' enum to enum class 2021-09-04 23:37:19 +02:00
Juliano Leal Goncalves
ef74b6f92d 🚚 Rename 'ObjectStruct' to 'Object' 2021-09-02 05:45:44 +02:00
Juliano Leal Goncalves
20db8d1a11 🚚 Rename 'MonsterStruct' to 'Monster' 2021-09-01 22:26:37 +02:00
Juliano Leal Goncalves
1cd62bbc64 🚚 Rename 'MonsterMode' members for semantic and consistency 2021-09-01 19:15:08 +02:00
Juliano Leal Goncalves
69a7cb66d4 ♻️ Convert 'MON_MODE' enum to 'MonsterMode' enum class 2021-09-01 19:15:08 +02:00
qndel
a737d72dd9
Dynamic char panel 2021-08-30 20:33:55 +02:00
Juliano Leal Goncalves
bb2dfdfb73 🚚 Rename 'ItemStruct' to 'Item' 2021-08-30 13:40:08 +02:00
Juliano Leal Goncalves
01823e1324 ♻️ Replace 'cursmx' and 'cursmy' globals with single 'cursPosition' 2021-08-30 06:45:51 +02:00
Juliano Leal Goncalves
bbf529c65a 🚚 Rename 'PlayerStruct' to 'Player' 2021-08-30 06:44:18 +02:00
Anders Jenbo
4044fadeb5 Clean up some players references 2021-08-30 03:26:17 +02:00
qndel
a9fbf91524 CalcStatDiff cleanup 2021-08-29 17:53:13 +02:00