Anders Jenbo
56915974d6
Minimize passing of player indexes
2022-07-18 11:15:50 +02:00
Anders Jenbo
d1189388f5
Use user by reference
2022-07-17 18:41:05 +02:00
Anders Jenbo
3d08f951d6
Clean up use of miniwin
2022-07-10 21:13:39 +02:00
Anders Jenbo
2d21fc372e
Remove more miniwin code
2022-07-10 21:13:39 +02:00
Anders Jenbo
6a8fd04067
Use player by references ( #4938 )
2022-07-10 11:40:04 +02:00
staphen
cab75ded6b
Check both SPL_NULL and SPL_INVALID to determine spell validity
2022-07-09 04:04:22 +02:00
Gleb Mazovetskiy
17f8cdddc4
Clean up GetSpellLevel
...
Remove the buggy `GetSpellLevel` implementation and use
`Player#GetSpellLevel` throughout instead.
2022-07-03 13:40:53 +01:00
Anders Jenbo
ab55877adc
Take player by reference in UseMana
2022-07-03 08:03:02 +02:00
Anders Jenbo
b00ae287b8
Minimize propegation of global Players index
2022-07-03 06:10:42 +02:00
obligaron
19749420b5
Introduce Player::isOnActiveLevel
2022-06-18 17:05:30 +02:00
Vladimir Olteanu
4d6ff58c22
Reduce reliance on bool done for control flow (part 1 of x) ( #4720 )
2022-06-17 13:13:39 +02:00
staphen
b363d5d962
Fix order of loop conditions when adding spell missiles
2022-06-15 05:54:24 +02:00
Gleb Mazovetskiy
628406a44c
Refactor inventory/belt item presence and removal
...
Introduces new functions to check for presence of and remove player items.
These functions do not rely on or expose item indices.
They're implemented as free functions instead of Player methods due to
complicated include dependencies between `player.h`, `inv.h`, and
`inv_iterators.h`. We should probably look into cleaning this up at some
point.
2022-06-05 13:30:26 +02:00
qndel
354e329644
Players[MyPlayerId] -> MyPlayer
2022-05-31 05:35:52 +02:00
DakkJaniels
313cdb853c
GetManaAmount - fix usage of pMaxManaBase
...
I don't think this ever comes up because no spells have an sManaCost of 255, however _pMaxManaBase is stored as fixed point, so it should be shifted before use.
But to be honest, I'm not even sure what it is trying to do here. Was sManaCost == 255 supposed to indicate that it was going to use all the player's mana? Why was it cast to a BYTE before using it? Did they intend to limit the manage usage to 255 and just screwed up? I originally saw this logic in Devilution, and found it because the Middle Earth mod had a slight change here, where it used pMana (maybe because they thought it was intended to be a spell that used all the player's mana?) Also, I saw that in 1.07, Ghidra saw `ma` as a byte, not an int as written in Devilution - I wonder if that's where the cast came from? In the ME Mod version, it sees `ma` as an int.
2022-04-16 05:06:28 +02:00
staphen
e6182709d1
Allow casting Town Portal, Teleport, and Guardian scrolls from inventory
2022-04-03 23:37:00 +02:00
ephphatha
92fcdda3a7
Refactor OnHealOther to operate on Player references
2022-03-30 00:49:56 +02:00
ephphatha
25c2123849
Change cursor after acknowledging attempt to cast spell
...
This matches the behaviour of other targeted spells, however the mana is wasted because it is spent when readying the spell.
2022-03-30 00:49:56 +02:00
qndel
be0b79f9f5
Add IsWallSpell helper
2021-12-07 12:00:52 +01:00
ephphatha and Anders 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
940a120bf9
♻️ Replace 'ViewX' and 'ViewY' globals with single 'ViewPosition'
2021-09-04 18:06:28 -04:00
Siddharth singh chouhan
18125aac6a
Move documentation from implementations to declarations #2735 ( #2782 )
2021-09-02 10:05:33 +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
Anders Jenbo
d7c6d8b189
Use proper Direction type for AddMissile midir
2021-08-25 20:24:45 +02:00
Anders Jenbo
5be9b1529e
Do not use mana in god mode
2021-08-19 20:36:12 +02:00
qndel
bb4d087d60
fix resurrect ( #2577 )
2021-08-12 08:21:52 +02:00
vladtepesch
0e56e52c75
fixes casting level 0 spell says "not enough mana" ( #2568 )
2021-08-11 19:52:00 +00:00
BC Ko
221718250f
cleanup manual value clamping: spells.cpp GetManaAmount() ( #2556 )
2021-08-10 10:39:26 +02:00
Anders Jenbo
7effa1a931
Merge pull request #2433 from diasurgical/player
2021-07-20 22:59:25 +02:00
Anders Jenbo
de0b3a38b8
Apply code style
2021-07-20 02:51:39 +02:00
Anders Jenbo
e5fc7fd17c
Move remaning symbols in to anonymous namespaces
2021-07-20 02:51:39 +02:00
Anders Jenbo
9c4e34f988
Player by reference
2021-07-20 01:35:56 +02:00
Anders Jenbo
8ba3bbb6a4
Have PosOkPlayer take PlayerStruct as input ( #2430 )
2021-07-20 00:30:35 +01:00
Anders Jenbo
96bf75b502
Rename player globals
2021-07-08 02:01:14 -07:00
Anders Jenbo
7e737cfa96
Merge remote-tracking branch 'refs/remotes/devilution/master'
2021-07-03 01:44:45 +02:00
Juliano Leal Goncalves
cbb84199c2
♻️ Replace Point addition with 'Point + Displacement'
2021-06-28 20:37:44 -07:00
Anders Jenbo
0f2ad469ea
♻️ Clean up variable initialization
2021-06-27 14:58:51 -07:00
ephphatha
357f6f1dc3
Move RNG functions to their own header/source files
2021-06-27 03:09:41 -07:00
Anders Jenbo
35b2aa4947
♻️ Unfold a few functions
2021-06-24 15:11:09 -07:00
Anders Jenbo
ee7b32d8f6
Player by reference part 3
2021-06-24 00:53:09 +02:00
Vladimir Olteanu
95643029e3
Refactor missiles.cpp
...
Use Point wherever possible
Make some functions static (not exhaustive)
Reduce excessive indentation (not exhaustive)
Declare variables as needed (not exhaustive)
2021-06-21 12:10:37 -07:00
Gleb Mazovetskiy
f9f301b054
🚚 engine.h: Extract Point, Direction, clamp
...
`engine.h` is getting quite bloated. Moves this code to their own files.
2021-06-21 01:36:20 -07:00
Vladimir Olteanu
e9a773f487
Make GetSpellBitmask constexpr
2021-05-25 11:41:30 +02:00
Juliano Leal Goncalves
dd9e05222d
♻️ Change 'PosOkPlayer' to take a 'Point' instead of 2 separate ints
2021-05-25 04:09:02 +02:00
Juliano Leal Goncalves
d55cd99dd5
🚚 Rename 'direction' enum to 'Direction'
2021-05-24 04:46:08 +02:00
Anders Jenbo
0c2042fa52
♻️ Player by reference
...
Update Source/items.cpp
Update Source/lighting.cpp
Update Source/pack.cpp
asd
ads
as
2021-05-13 01:47:46 +02:00
thebigMuh
f3d87730ee
Reenabling Elemental spell for Hellfire ( #1901 )
2021-05-09 12:48:40 +02:00
Juliano Leal Goncalves
39736e2538
♻️ Pass 'PlayerStruct' pointer to 'ClrPlrPath'
2021-05-05 00:38:58 +02:00
Anders Jenbo
2bd13451a1
♻️ Apply point positioning to all remaning entities
2021-04-25 01:25:48 +02:00