Commit graph

743 commits

Author SHA1 Message Date
ephphatha
956dcc7fc9 Add helper for selecting animation sprites from Direction
The use on PlayerAnimationData could be further simplified by adding a helper to PlayerStruct but that'd be introducing another changed file to the PR... Something for later.

The monster version is only used once thanks to the helpers added in previous commits. This was mainly to highlight the similarity between PlayerAnimationData and AnimStruct, AnimStruct could inherit/extend PlayerAnimationData without much trouble.
2021-09-12 02:27:47 +02:00
ephphatha
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 <anders@jenbo.dk>

Fix alignment of WalkSettings array
2021-09-12 02:27:47 +02:00
Anders Jenbo
b74feb01dc 🐛 Correctly check if item name will fit in the info panel 2021-09-12 01:37:28 +02:00
Anders Jenbo
7169882b1f Implement new font rendering 2021-09-12 01:37:28 +02:00
qndel
197d3edd1b fix loot 2021-09-07 01:33:46 +02:00
Juliano Leal Goncalves
4431e3a823
🚚 Rename 'UItemStruct' struct to 'UniqueItem' (#2806)
* 🚚 Rename 'UItemStruct' struct to 'UniqueItem'
* 🚚 Rename 'UniqueItemList' global array to 'UniqueItems'
New name is more concise and follows the standard of pluralizing the base name for collections.
2021-09-06 12:51:23 +02:00
qndel
927e773696 small debug cleanup 2021-09-02 21:58:49 +02:00
Juliano Leal Goncalves
6146b828e9 🚚 Rename 'MonsterData' global to 'MonstersData'
This avoids conflicts with the struct name as we'll be renaming that next.
2021-09-02 21:57:50 +02:00
Juliano Leal Goncalves
20db8d1a11 🚚 Rename 'MonsterStruct' to 'Monster' 2021-09-01 22:26:37 +02:00
qndel
3d17bfdc7d upgrade debug item drop generation 2021-09-01 08:05:22 +02:00
BC Ko
589abe65d1 documentation cleanup: items 2021-08-30 13:56:11 +02:00
Juliano Leal Goncalves
7841c4731e 🚚 Rename 'PkItemStruct' to 'ItemPack' 2021-08-30 13:40:08 +02:00
Juliano Leal Goncalves
bb2dfdfb73 🚚 Rename 'ItemStruct' to 'Item' 2021-08-30 13:40:08 +02:00
Anders Jenbo
bee8388c20 Fix inaccurate gameplay with NOSOUND 2021-08-30 10:57:59 +02:00
Juliano Leal Goncalves
01823e1324 ♻️ Replace 'cursmx' and 'cursmy' globals with single 'cursPosition' 2021-08-30 06:45:51 +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
BC Ko
4df798808e
2435 refactor global variable Items part 2 (#2673) 2021-08-26 08:06:48 +02:00
qndel
d8a0211da8 Remove redundant condition 2021-08-25 19:32:10 +02:00
Robin
f7f9786658
items: add BUGFIX, reset item get records when resetting items (#2691)
* items: add BUGFIX, reset item get records when resetting items

The item get record array tracks items being recently looted in an
effort to prevent the same item from being looted more than once.
Prior to this commit, the item get record array (and corresponding
item get record array length) variables were not cleared when
creating a new game. Therefore, the item get record array of a
previous game could remain in between games and prevent an item
from being looted (if it was looted in a previous), even if it was
never looted in the current game. In practice this almost never
shows up, since each item get record is valid for a total of 6
seconds before being cleared. So, you would either have to save
a game, quickly loot an item, when load the game and try to loot
the same item before 6 seconds pass. OR, you could use the demo
replay functionality to run test cases, and speed up execution to
run e.g. 10'000'000 logic ticks per second. Both would exhibit the
bug and prevent the item from being looted.

This commit fixes such issues by explicitly clearing the item get
record array and item get record array length variables whenever
items are initialized.
2021-08-24 11:08:24 +00:00
qndel
6fca66ad8a debug commands: dropitem/dropunique 2021-08-21 20:42:07 +02:00
qndel
0530fcb969 apply enums to mTreasure 2021-08-21 19:23:11 +02:00
BC Ko
1b91194f0f
refactor Items[ii] (#2655) 2021-08-21 03:30:39 +02:00
Anders Jenbo
f931778b90 Remove debug_mode_key_w
Replaced by debug commands
2021-08-19 20:36:12 +02:00
BC Ko
40c804c0ba Replace QuestStatus() with IsAvailable() in QuestStruct 2021-08-19 02:12:20 +02:00
qndel
230c9a8d4e
Fix shop items morphing
Reverts ab0478319c
Except for the fix to SpawnQuestItem
2021-08-15 15:39:05 +02:00
qndel
644d9dfc5c
fix armor piercing affix range (#2535) 2021-08-08 11:53:54 +00:00
Anders Jenbo
8df8b940c4
Handle some clang-tidy issues 2021-08-07 16:30:14 +02:00
Aaron Sun
3ee90ca629 Add options for sub-panel alignment 2021-08-07 16:09:32 +02:00
Anders Jenbo
90960f0c14 Remove dead code 2021-08-07 00:36:38 +02:00
4aron5un
4c8210df21
Center the sub-panels (Quest, Character, Spell and Inventory) (#2498) 2021-08-05 21:27:07 +02:00
Anders Jenbo
d523fc1e81 Cleanups 2021-08-02 10:12:40 +02:00
ephphatha
0575716eac Rename UiFlags members to group related options 2021-07-31 20:22:40 +02:00
ephphatha
4ad53232a0 Convert the UiFlags enum to a scoped enum type
Replace operator&& with named function
2021-07-31 20:22:40 +02:00
Anders Jenbo
1703901c2d Explicitly mark strings as not c-formatted 2021-07-31 17:05:21 +02:00
obligaron
551645060b Fix item swapping and AnimationInfo::ChangeAnimationData 2021-07-26 22:46:16 +02:00
Anders Jenbo
a19e7b2a3b Remove some more use of miniwin 2021-07-17 23:54:13 +02:00
obligaron
70db8456ba Remove _pwtype and replace it with UsesRangedWeapon 2021-07-17 17:38:28 +02:00
obligaron
d1d61fcd0f Convert anim_weapon_id and anim_armor_id to enum class 2021-07-17 17:38:28 +02:00
Anders Jenbo
9264ad4b89 Use IsTileNotSolid() in place of !nSolidTable[dPiece[][]] 2021-07-17 03:57:26 +02:00
FluffyQuack
ba60907853
Hold mouse button to keep attacking (Diablo 2-style) (#2349) 2021-07-16 15:01:01 +01:00
Anders Jenbo
77b72da276 ♻️Use monster by reference when possible 2021-07-14 20:22:35 -07:00
Anders Jenbo
996cadf972 ♻️Unique powers cleanup
- Mark unused unique item powers as invalid
- Split to hit and value calculations from SaveItemPowers
2021-07-11 15:07:24 -07:00
Anders Jenbo
65d7b3c1eb Use AdvanceRndSeed() when changing RNG with out use 2021-07-10 17:30:15 -07:00
Anders Jenbo
35ccc8eb1c Apply clang-tidy to code 2021-07-10 17:30:15 -07:00
Anders Jenbo
74b57558c9 🚚 Move local code to anonymous namespace 2021-07-10 17:30:15 -07:00
matheusgomes28
42e2c174ac
Refactored parameters of "StartItemPower(...)" and code around calls to it. (#2345)
Co-authored-by: Matheus Gomes <mgomes1@jaguarlandrover.com>
2021-07-10 18:04:42 +02:00
Anders Jenbo
903d4bd2e1 Scope all for loops
This caused 7 of the loops to be rewriteen using range by clang-tidy
2021-07-08 08:14:03 -07:00
Anders Jenbo
9ebdb6db69 General clean up 2021-07-08 03:30:25 -07:00
Anders Jenbo
467b74dc06 Rename object globals 2021-07-08 02:01:14 -07:00