Commit Graph
51 Commits
Author SHA1 Message Date
DakkJaniels 24bb409086 Remove extra entry in experience level table and cap experience at level 50 requirement (#5782) 2023-04-18 03:10:14 +02:00
obligaron b87711bc08 Reintroduce Player::spellFrom to seperate teleport cursor from queued spell 2023-04-17 03:22:50 +02:00
Gleb Mazovetskiy 1a1a282d9a Use C FILE instead of C++ streams throughout
Reduces binary size by ~2 KiB and may improve compatibility with oddball
systems (e.g. PS2).
2023-02-15 18:15:07 +00:00
KPhoenix d813f13700 enum spell_id -> enum class SpellID 2023-02-05 10:24:58 +00:00
Eric Robinson ef3a57b7d9 enum spell_type -> enum class SpellType (#5674) 2023-01-28 22:25:37 +01:00
Gleb Mazovetskiy eb45753c4d Fix writehero_test on big-endian
`PlayerPack` struct should be little-endian even on big-endian systems.
2022-12-09 11:12:25 +00:00
Gleb Mazovetskiy 188dc79f6e Make Players a vector 2022-08-26 13:22:04 +09:00
obligaron 1cfd1ca99d Fix double casting bug - use separated info for casted and queued spells 2022-08-02 03:05:46 +02:00
Mikołaj Piróg dda0b96ea5 Remove #defines in player.h and add constexpr where applicable (#4896)
* Change defines to constexpr int in player.h

* Add const or constexpr to player.h/cpp where applicable

* Update tests with changed names of player constatns

* remove unecessary variable
2022-07-05 17:25:23 +02:00
k-bar 26de74f4a2 AnimationInfo class correct style (#4870)
* AnimationInfo class correct case-style for private members

clang-tidy warnings:
readability-identifier-naming    invalid case style for private member

* AnimationInfo class correct case-style for members

clang-tidy warnings:
readability-identifier-naming    invalid case style for member

* AnimationInfo class correct case-style for methods

clang-tidy warnings:
readability-identifier-naming    invalid case style for method

* AnimationInfo class use nodiscard

clang-tidy warnings:
modernize-use-nodiscard    function  should be marked [[nodiscard]]
2022-07-03 16:55:37 +02:00
Gleb Mazovetskiy 01ad1814ea Make path finding index-based
Reduces the size of the `PathNodes` array from 28 KiB to just 8 KiB.

Also reduces the size of `pnode_tblptr` from `300 * sizeof(void *)` to
`300 * 2` bytes.
2022-06-20 10:49:16 +01:00
qndel d5744ba421 fix multiplayer 2022-06-01 18:41:27 +02:00
qndel 354e329644 Players[MyPlayerId] -> MyPlayer 2022-05-31 05:35:52 +02:00
DakkJaniels dad46e1905 Item special effect enum (#4129) 2022-04-19 15:44:46 +02:00
Gleb Mazovetskiy a66ca44695 Zero-based frame indexing
Index frames starting at 0 instead of 1.
2022-04-14 04:39:26 +01:00
ephphatha caf60daa00 Fix tests expecting unclean HoldItem uses.
These test cases were asserting side-effects of the call to CreatePlayer leaving an initialised gold item in the held item slot.
2022-03-06 05:52:40 +01:00
DakkJaniels 7bc19ee91a add enum for the spell flags. Adjust code to use them. 2022-03-06 02:09:19 +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
Anders Jenbo b77686213a 🐛 Correctly wipe temp data from saves
Fixes #3167
2021-10-26 16:51:56 +02:00
Anders Jenbo eb3012cc0d Reset player object before unpacking hero data 2021-10-12 04:56:30 +02:00
Anders Jenbo b4f699f0a3 Validate item network messages 2021-10-12 04:56:30 +02:00
Anders Jenbo 2d47c12515 Fix charpanel always showing player 0 stats 2021-09-12 01:37:28 +02:00
Juliano Leal Goncalves 7841c4731e 🚚 Rename 'PkItemStruct' to 'ItemPack' 2021-08-30 13:40:08 +02:00
Juliano Leal Goncalves 28134d099c 🚚 Rename 'PkPlayerStruct' to 'PlayerPack' 2021-08-30 08:01:53 +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 3dbc120320 optimized packing/unpacking inventory items (#2610) 2021-08-18 20:56:07 +02:00
Anders Jenbo 9217e8c7f0 Test CreatePlayer 2021-08-12 21:15:48 +02:00
obligaron 70db8456ba Remove _pwtype and replace it with UsesRangedWeapon 2021-07-17 17:38:28 +02:00
Anders Jenbo 96bf75b502 Rename player globals 2021-07-08 02:01:14 -07:00
Anders Jenbo ee2e7518c4 Clang-tidy: FunctionCase part 2 2021-07-03 12:36:04 -07:00
obligaron 3a9cc631c7 Rename DelayLen -> TicksPerFrame
Rename DelayCounter -> TickCounterOfCurrentFrame
2021-06-27 01:26:49 -07:00
obligaron 3ba4bac5e2 Harmonize DelayLen for Player and Monster (was 1-based on monseter (>= DelayLen) and 0-based on player (> DelayLen). Now both are 1-based (>= DelayLen) 2021-06-27 01:26:49 -07:00
Anders Jenbo 8a7ec56d3a Player by reference part 2
This mostly change player to be by reference instead of by index.
But additionally it does stript checks for gold in the belt, move some
value types to the initialization and short circute a few functiongs.
2021-05-24 21:00:32 +02:00
obligaron 61ba5009ac Convert to CelSprite 2021-05-24 20:12:43 +02:00
obligaron 3067aeacb8 Remove PlayerStruct._pXYZWidth and replace it with calls to GetAnimationWidth 2021-05-24 20:12:43 +02:00
obligaron 16b3b38908 Move NewPlrAnim logic to AnimationInfo
Adjust SetNewAnimation-Parameter Names to Class Member

Adjust NewPlrAnim-Parameter Names to SetNewAnimation-Parameter Names
2021-04-29 04:33:51 +02:00
obligaron 1de46a8495 Rename member variables 2021-04-29 04:33:51 +02:00
obligaron 0b5183f63e Introduce AnimationInfo
Update AnimationInfo.DelayLen comment
2021-04-29 04:33:51 +02:00
JmgrandGleb Mazovetskiy d4f62870b8 Remove globals from paths.h
Fix for Vita

Update to use free functions

Use std::optional to allow setting empty paths

Change header inclusion order

Co-authored-by: Gleb Mazovetskiy <[email protected]>

Use std::optional to allow setting empty paths

Apply clang-format

Temporary commit
2021-04-25 22:26:37 +02:00
obligaron 239a43cc1c Remove "AnimWidth2" expect for missiles (#1680) 2021-04-25 13:32:33 +02:00
Jmgr c33182d6de Modernize deprecated headers 2021-04-25 02:50:31 +02:00
Anders Jenbo 2bd13451a1 ♻️Apply point positioning to all remaning entities 2021-04-25 01:25:48 +02:00
Anders Jenbo 7912e510f0 🎨 Clean up overuse of SDL types 2021-04-24 17:07:07 +02:00
Anders Jenbo e4cfad3196 ♻️Use points instead of individual fileds for player structure 2021-04-24 04:46:08 +02:00
Anders Jenbo 97d7171123 🔥 Get rid of _ptargx/y 2021-04-21 03:55:27 +02:00
Anders Jenbo 8c821e98d3 🚚 Restructure files 2021-04-16 03:57:22 +02:00
Anders Jenbo 997c1dba55 🚚 Split up all.h in to proper header relations 2021-04-16 01:04:54 +02:00
Juliano Leal Goncalves 28ad9d43c5 🎨 Rename 'plr_class' enum to 'HeroClass'
Members were renamed as well for readability.
2021-04-12 20:00:53 +02:00
Juliano Leal Goncalves 7d95bfed39 ♻️ Convert 'plr_class' to a scoped enumeration 2021-04-12 20:00:53 +02:00