qndel
770f3a2f20
unify ranged and melee pierce
5 years ago
ephphatha
8f2e94ae4d
Use unsigned types for player experience and related values
5 years ago
Juliano Leal Goncalves
022502660d
♻️ Extract logic to ready spell from staff to player function
5 years ago
qndel
0a70a8cece
unify block formula
5 years ago
qndel
169f980038
ranged/magic formulas
5 years ago
qndel
bd5e30db52
replace armor formula
5 years ago
Anders Jenbo
ab8afa7cd7
Fix edge cases in mouse action tracking code ( #2452 )
...
Fixes #2431
Also:
- Track spell targets
- Merge repeat walk in to the new repeat action code
- Avoid time based repeats (use action frame instead)
5 years ago
Anders Jenbo
8ba3bbb6a4
Have PosOkPlayer take PlayerStruct as input ( #2430 )
5 years ago
Anders Jenbo
069249f318
🚚 Move local function to anonymous namespace i-p
5 years ago
obligaron
70db8456ba
Remove _pwtype and replace it with UsesRangedWeapon
5 years ago
obligaron
d1d61fcd0f
Convert anim_weapon_id and anim_armor_id to enum class
5 years ago
Anders Jenbo
2d4da488f0
Split path test functions
5 years ago
FluffyQuack
ba60907853
Hold mouse button to keep attacking (Diablo 2-style) ( #2349 )
5 years ago
Anders Jenbo
96bf75b502
Rename player globals
5 years ago
Anders Jenbo
ee2e7518c4
Clang-tidy: FunctionCase part 2
5 years ago
Andrew James
3508aa6d3d
Align Life/Mana flask drawing routines ( #2291 )
...
* Clamp hpPer as a sanity check
* Refactor update mana routines in control.cpp to use PlayerStruct::UpdateManaPercentage
* Remove unnecessary calls to UpdateHP/ManaPercentage
* Unify logic that draws the flasks into a single internal function
* Fix style violations
* Remove unnecessary save/loads of hp/manaPer
The way this variable is used expects a value in this range and it gets clamped again anyway, but this makes the code more similar to the manaPer logic for future refactoring
Identical logic in use, the checks to see if the values are negative can be accomplished using clamp and the same divide by zero guard. I'll combine the two attributes in a near future commit.
control_update_life_mana is called during the game loop before any of the drawing functions so hpPer/manaPer are calculated based on the latest current/max of their respective attributes every frame.
There's no need to do the calculation again in the draw routines. (There's also no need to calculate this every frame but that's going to take a bit to untangle.)
5 years ago
ephphatha
58f3ca9ba3
Refactor player hp percentage calculation to avoid C4244 warnings
5 years ago
Anders Jenbo
79c9078fa1
♻️ Clean up type sizes
5 years ago
Anders Jenbo
ee7b32d8f6
Player by reference part 3
5 years ago
Gleb Mazovetskiy
e40b1963f9
🚚 engine.h: Extract `CelSprite` and file loading
5 years ago
Gleb Mazovetskiy
dcf3397139
🚚 engine.h: Extract `ActorPosition`
5 years ago
Gleb Mazovetskiy
f9f301b054
🚚 engine.h: Extract `Point`, `Direction`, `clamp`
...
`engine.h` is getting quite bloated. Moves this code to their own files.
5 years ago
qndel
816b244689
HasItem/RemoveInvItem combo refactor
5 years ago
Juliano Leal Goncalves
dd9e05222d
♻️ Change 'PosOkPlayer' to take a 'Point' instead of 2 separate ints
5 years ago
Juliano Leal Goncalves
c6fafbf64b
♻️ Change 'SolicLoc' to take a 'Point' instead of 2 separate ints
5 years ago
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.
5 years ago
obligaron
da7ded3170
Integrate GetAnimationWidth in LoadPlrGFX (only callside)
5 years ago
obligaron
d97131349e
Unify player_graphic memory handling
5 years ago
obligaron
61ba5009ac
Convert to CelSprite
5 years ago
obligaron
3067aeacb8
Remove PlayerStruct._pXYZWidth and replace it with calls to GetAnimationWidth
5 years ago
obligaron
d11ed50585
NewPlrAnim now also loads the graphics if needed
5 years ago
obligaron
c424f601ec
Change LoadPlrGFX from pnum to PlayerStruct
5 years ago
obligaron
3a6e631261
Remove memset for PlayerStruct
5 years ago
obligaron
a1e24b33fc
Default values for PlayerStruct
5 years ago
Juliano Leal Goncalves
b3ec79af4f
Leverage 'Point' in Lighting and Player functions ( #2048 )
5 years ago
Anders Jenbo
6ce8f13751
Apply clang-tidy to more code and do some related cleanups
5 years ago
Juliano Leal Goncalves
d55cd99dd5
🚚 Rename 'direction' enum to 'Direction'
5 years ago
Juliano Leal Goncalves
5350250a76
🚚 Rename speech functions to 'Say' variations
5 years ago
Juliano Leal Goncalves
8c620ce29e
♻️ Extract 'HeroSpeech' enum class for hero sounds instead of using raw `int`s
5 years ago
obligaron
4de25cd2ea
Introduce PlayerStruct.IsWalking()
5 years ago
Anders Jenbo
0c2042fa52
♻️ Player by reference
...
Update Source/items.cpp
Update Source/lighting.cpp
Update Source/pack.cpp
asd
ads
as
5 years ago
obligaron
7ed009ecb7
Remove PlayerStruct.actionFrame and enable ADL for Walking/Run ( #1939 )
...
- Remove (unused) actionFrame for PM_DEATH
- Remove actionFrame for PM_SPELL
- Remove actionFrame for PM_WALK
- Remove actionFrame
5 years ago
obligaron
e3e3d02da7
Correct Doxygen comments
5 years ago
Anders Jenbo
6321bf04d5
♻️ Pass player to towner by reference instead of index
5 years ago
Anders Jenbo
f579b2f287
Handle cel/cl2 files as byte arrays
5 years ago
obligaron
b5954eb34b
Change AnimationDistributionParams to AnimationDistributionFlags
5 years ago
Juliano Goncalves
6e3c33ad23
✨ Add key to stop walking and cancel pending actions
5 years ago
Juliano Leal Goncalves
39736e2538
♻️ Pass 'PlayerStruct' pointer to 'ClrPlrPath'
5 years ago
obligaron
ff995adc2b
Move ProcessPlayerAnimation to AnimationInfo
5 years ago
obligaron
16b3b38908
Move NewPlrAnim logic to AnimationInfo
...
Adjust SetNewAnimation-Parameter Names to Class Member
Adjust NewPlrAnim-Parameter Names to SetNewAnimation-Parameter Names
5 years ago