41 Commits
Author SHA1 Message Date
Gleb Mazovetskiy f566359e4f Migrate item data to txtdata/ 2023-11-14 00:20:17 +00:00
ephphatha d13bed2a78 Fix broken test case 2023-09-20 05:49:54 +02:00
ephphatha 6a8f4b12da Get base block bonus from data struct instead of storing a copy 2023-09-20 05:49:54 +02:00
ephphathaandGleb Mazovetskiy 32c3316743 Load experience data from file
Also added an iterator based API, though it's not useful for this use-case. Might be nice in the future?

The field/record iterators is single-pass input iterators with shared state.
To avoid rescanning fields unnecessarily parseInt currently can only be called once, it would be possible to make these iterators bidirectional with a bit of extra state (holding onto the start pointer)

Co-authored-by: Gleb Mazovetskiy <[email protected]>
2023-08-24 05:46:44 +02:00
ephphatha 14639cd096 Replace _pNextExper with getter method
No real need to persist this value
2023-08-24 05:46:44 +02:00
ephphatha da76e131e4 Add getter/setter for character levels to ensure _pNextExper stays synced 2023-08-24 05:46:44 +02:00
Anders Jenbo 8e7c29ecd3 Remove unused player property _pISplDur 2023-06-28 23:50:50 +02:00
Anders Jenbo 63277a842d Clean up player packing 2023-06-24 04:18:14 +02:00
obligaron 7985a9211d Change Player::_pSplLvl to uint8_t 2023-04-24 18:19:27 +02:00
obligaron b87711bc08 Reintroduce Player::spellFrom to seperate teleport cursor from queued spell 2023-04-17 03:22:50 +02:00
KPhoenix d813f13700 enum spell_id -> enum class SpellID 2023-02-05 10:24:58 +00:00
ikonomov d05992da75 Remove "Zen" hit recovery (#5724)
The description of Harmony says "Fastest", clearly implying that this is the fastest recovery bonus that is attainable for a given character and also an indication that the bonus is not cumulative with other items.
2023-01-30 19:15:47 +01:00
Eric Robinson ef3a57b7d9 enum spell_type -> enum class SpellType (#5674) 2023-01-28 22:25:37 +01: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
Anders Jenbo d1189388f5 Use user by reference 2022-07-17 18:41:05 +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
Anders Jenbo 54598e2a8f CreatePlayer by reference 2022-06-28 16:51:45 +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 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
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
ephphathaandAnders Jenbo 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 <[email protected]>

Fix alignment of WalkSettings array
2021-09-12 02:27:47 +02:00
Juliano Leal Goncalves bbf529c65a 🚚 Rename 'PlayerStruct' to 'Player' 2021-08-30 06:44:18 +02:00
qndel 045921813b some useless code removal 2021-08-12 21:40:33 +02:00
Anders Jenbo 9217e8c7f0 Test CreatePlayer 2021-08-12 21:15:48 +02:00
Anders Jenbo 069249f318 🚚 Move local function to anonymous namespace i-p 2021-07-19 05:44:20 +02:00
Anders Jenbo 96bf75b502 Rename player globals 2021-07-08 02:01:14 -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 d97131349e Unify player_graphic memory handling 2021-05-24 20:12:43 +02:00
Juliano Leal Goncalves d55cd99dd5 🚚 Rename 'direction' enum to 'Direction' 2021-05-24 04:46:08 +02:00
obligaron b94e599f5e ADL: Advance skipped Frames in SetNewAnimation and remove logic from PM_XYZ 2021-05-09 09:53:53 +02:00
Anders Jenbo c11945e62b 🎨 Fix line endings 2021-05-07 23:22: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
obligaron 08233cc31b player_test - Fix wrong extern definition for PM_DoGotHit 2021-04-25 13:15:35 +02:00
Anders Jenbo 275404029e ♻️Cleanup player temp variables 2021-04-24 17:07:07 +02:00
Anders Jenbo 997c1dba55 🚚 Split up all.h in to proper header relations 2021-04-16 01:04:54 +02:00
Anders Jenbo 53a3657b29 🚚 Move tests to a standard folder 2021-04-10 19:59:50 +02:00