Commit graph

762 commits

Author SHA1 Message Date
KPhoenix
32d39c6524
Fix Stat Adjustment (#3898)
This fixes a problem related to shrines. When a player with a base Magic or Vitality stat of 0 has their respective stat reduced below 0, they lose Mana/Life, and their stat is corrected to 0 without refunding them the lost Mana/Life. This will prevent stats from being modified to a value less than 0 in the first place.
2022-02-07 10:14:54 +01:00
obligaron
c6abd7401b Preview Frame: Disable for towncast 2022-01-28 21:42:31 +01:00
ephphatha
db1d776539 Deduplicate PItem and DItem 2022-01-24 21:12:13 +01:00
obligaron
234a053863 Change Missiles Array to std::list 2022-01-20 23:12:48 +01:00
KPhoenix
707d8a1379 Mana Shield 1.07 bugfix revision
This is a bugfix for the vanilla 1.06 and earlier Mana Shield logic. In 1.07 Blizzard North "fixed" the Mana Shield logic since the damage reduction would decrease in effectiveness with increased spell level instead of increase. As a fix, they set the damage reduction to a flat value regardless of spell level. Originally, damage reduction started at 1/3 and capped at 1/21 at spell level 7. This fix reverses the order and gives 1/21 damage reduction at spell level 1, and caps at 1/3 damage reduction at spell level 7.
2022-01-20 11:37:54 +01:00
obligaron
6d7334886d Fix preview frame when player can't walk to desired location 2022-01-16 21:12:50 +01:00
KPhoenix
e0cd19c011
Fix death animation frames for Warrior/Barbarian (#3954) 2022-01-15 22:36:09 +01:00
KPhoenix
34266ff4c7
Show correct death animation (#3953)
Shows death animation based on what armor you are wearing while dying. Dropping items on death results in showing light armor animation.
2022-01-15 20:24:19 +01:00
obligaron
2843d99485 Fix walk stuttering with Preview Frame 2022-01-15 14:40:35 +01:00
obligaron
75760382ef Regard preview frame in AnimationInfo 2022-01-12 12:26:39 +01:00
obligaron
35dc64312e Show preview CelSprite for player actions (Introduce PlayerStruct.pPreviewCelSprite and UpdatePreviewFrame) 2022-01-12 12:26:39 +01:00
obligaron
7b535d886e Make LoadPlrGFX check if graphics are already loaded 2022-01-12 12:26:39 +01:00
obligaron
5b9f0f4aaa Introduce GetPlayerGraphicForSpell 2022-01-12 12:26:39 +01:00
ephphatha
8bf05571a1 Dedupe code which determines how much life/mana to restore for potions
This is very similar to the code used when casting heal other, except for how the amount to heal is chosen. Could potentially reuse it there as well with a bit of work.
2022-01-08 09:29:26 +01:00
KPhoenix
8e6433f400
Enable Dungeon Messages in Multiplayer (#3872)
* Enable Dungeon Messages in Multiplayer
2022-01-06 11:09:52 +11:00
Anders Jenbo
b0252b3339 Make Gamepad cursor independant of hardware mouse
The gamepad cursor (inventory, spells etc) no longer relies on warping a
real mouse cursor. This should make things work better on platforms that
do not support this, like Wayland.
2022-01-02 11:37:38 +01:00
Anders Jenbo
6b2481a76c Touch support on all SDL2 platforms 2022-01-02 11:37:38 +01:00
KPhoenix
2881f13b6d
Bugfix: Level 16 Dungeon Message (#3871)
* Bugfix: Level 16 Dungeon Message

Applies the commented bugfix to allow the game to play the level 16 audio message when the player enters the level for the first time.
2021-12-31 17:53:20 +11:00
ephphatha
abe4075a5a Deduplicate code checking if the player is next to a two-tile object
Used to activate sarcophagi from the top/right tile, probably other objects too.
2021-12-29 04:57:57 +01:00
ephphatha
e65959e6fc Use helper when checking if a player hit an object on attack 2021-12-29 04:57:57 +01:00
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