Commit Graph
212 Commits
Author SHA1 Message Date
Gleb Mazovetskiy d152d2c0fb Add OptionalOwnedCelSprite 2022-07-03 12:26:39 +01:00
Mikołaj Piróg 7cab074aa5 Correct members' names in monster.h (#4850)
* Fix case in AnimStruct
* Rename CMonster members
2022-07-01 23:34:32 +02:00
Gleb Mazovetskiy 3178dd5158 Replace most uses of sprintf with fmt (#4837) 2022-07-01 17:02:56 +02:00
Vladimir Olteanu 5a5111f1d8 Refactor CrawlTable (#4833) 2022-07-01 06:19:33 +02:00
Mikołaj Piróg 2e7ff45fbf Monster global constants cleanup (#4827)
* Change #defines to constexpr const, add constexpr where applicable, fix typos
2022-07-01 00:43:03 +02:00
obligaron 3cb55c95a4 DebugCmdLoadQuestMap: Don't load entry quest lvl if the hero is already on this level 2022-06-25 13:02:48 +02:00
Anders Jenbo 6d56058708 Move level generation to subfolder 2022-06-23 09:21:58 +02:00
Gleb Mazovetskiy de3c9874c7 Migrate large bool arrays to std::bitset
E.g. `dRendered` size is reduced by 10 KiB
2022-06-21 01:59:13 +02:00
Anders Jenbo 860bd1cebf Operate directly on SOL data 2022-06-18 21:27:05 +02:00
obligaron 9ac04314f4 Introduce Player::isOnLevel 2022-06-18 17:05:30 +02:00
Andrew James 4bd1e06336 Point mega <-> world conversion helpers 2022-06-13 00:27:57 +02:00
Anders Jenbo afec954c9a Convert dflags to boolean 2022-06-09 09:30:46 +02:00
Anders Jenbo 1203514383 Clean up use of currlevel 2022-06-07 21:35:01 +02:00
Anders Jenbo 6d2311931f [debug] Export levels as dun maps 2022-06-03 08:37:37 +02:00
qndel 354e329644 Players[MyPlayerId] -> MyPlayer 2022-05-31 05:35:52 +02:00
Anders Jenbo 6c6999235f Add debug command for testing custom levels 2022-05-14 09:11:42 +02:00
DakkJaniels dad46e1905 Item special effect enum (#4129) 2022-04-19 15:44:46 +02:00
Anders Jenbo dc706e8ed5 Use HoldItem for determining if an item is held
This cleans up a bit of code and solves a few edge cases where an item
could be lost, the game be unresponsive, or miss fire an event during
lag cause of the cursor not reflecting the currently held item.
2022-04-18 11:27:07 +02:00
Anders Jenbo 1ba817ca53 Unify gold handling (withdraw any amount from stash) 2022-03-22 21:38:51 +01:00
Andrew James f64d17bfa9 Initial clean up of code related to creating items (#2943)
* Move declaration of dItems to items.cpp

This array is never used in dungeon generation, it's closely related to Items so should be kept together. Ideally managing dItems can become responsibility of a container for Items, which will handle adding/removing items from the list and keeping the positions in sync.

* Rename SetPlrHandItem to match purpose/use

* Give more descriptive name to GetPlrHandSeed

This function sets a new seed on a given item struct, not just the held item.

* Don't use HoldItem as a temporary for the players initial inventory

* Take Item by reference in RespawnItem

* Don't use holdItem as a temporary when dropping gold on death

* Update DeadItem to take item by reference, and refer to it consistently

Move code which invalidates the source of dropped items to the caller

Most call sites use a temporary item instance or remove the item from the container, so there's no real point invalidating the item after it's been copied to the drop list.

Update DeadItem to take position instead of player references
2022-03-06 14:53:29 +11:00
Gleb Mazovetskiy 7fede6c4cb Clean up owned/unowned CelSprite ambiguity
Makes `CelSprite` unowned and adds a new `OwnedCelSprite` class for
owned sprites.

This clarifies ownership and makes the code cleaner in a number of
places.

Additionally, because the `CelSprite` class is now tiny (1 less
pointer), we can pass it by-value instead of by-reference, removing a
pointer indirection in the rendering functions.
2022-03-06 04:49:13 +01:00
qndel d3995736b9 fix spawning unique monsters 2022-02-23 22:37:12 +01:00
Stephen C. Wills e2a9dbca91 Fix format strings in PrintDebugMonster() (#4087) 2022-02-22 18:50:29 +01:00
qndel 73a5f4861e changemp/hp commands 2022-01-25 20:49:13 +01:00
qndel c2b2d0c0e6 use RestoreFullHP/Mana functions 2022-01-25 20:13:50 +01:00
ephphatha 903b661307 Use ObjectAtPosition for debug object type display
The other use of dObject is displaying the contents of that array so makes sense to leave as is. We're also able to remove the map since we can reference the current object type value directly on the returned object.
2021-12-28 16:01:37 +01:00
KPhoenixandAnders Jenbo a08026097a Chat Interface Revision (#3840)
Co-authored-by: Anders Jenbo <[email protected]>
2021-12-25 10:11:42 +00:00
Gleb Mazovetskiy c57644970f Move UiFlags and UiPanels into their own files
The first breaks circular dependency between `DiabloUI` and `text_render`.
The latter one moves `UiPanels` to a more appropriate place.
2021-11-25 12:22:27 +01:00
Gleb MazovetskiyandAnders Jenbo 7e1fea6f76 clang-format all files in {Source,test}/
Also includes a few manual tweaks to comments and newlines for better results.

Co-authored-by: Anders Jenbo <[email protected]>
2021-11-24 23:44:12 +01:00
Gleb Mazovetskiy 213abdda71 debug.cpp Fix -Wswitch 2021-11-17 07:09:26 +00:00
Anders Jenbo 56170b3372 Clean up id normalization 2021-11-07 23:15:10 +01:00
qndel 53f89fb9d9 debug fps command (#3418) 2021-11-07 11:23:31 +00:00
Andrew James 796e2813cf Use scoped enums for DungeonFlags/BFLAG (#3135) 2021-11-07 03:11:16 +01:00
qndel 46ed79ad42 add megatiles to tiledata (#3211) 2021-11-06 18:53:53 +01:00
qndel 7250aeae66 tweak automap colors 2021-10-25 16:57:16 +02:00
qndel e567953bc9 Sharing automap exploration in multiplayer 2021-10-25 02:58:41 +02:00
qndel 5193abebcb add objectindex to tiledata 2021-10-20 22:30:18 +02:00
qndel 00307c7dad add more stuff to tiledata 2021-10-20 22:30:18 +02:00
Anders Jenbo c6468522c8 Fix buffer overflow when sending game messages as chat 2021-09-25 09:06:25 +02:00
qndel c44ae7b0d4 Faster and better debug unique drop
Drop unique debug command tweak
2021-09-24 16:03:19 +02:00
Anders Jenbo 4f791948ff Fix missing switch cases 2021-09-23 16:55:13 +02:00
obligaron a99a824647 Introduce playerinfo debug command and remove d hotkey 2021-09-17 21:05:31 +02:00
obligaron ccbdf3bf55 Introduce questinfo debug command and remove PrintDebugQuest Keybinding 2021-09-17 21:05:31 +02:00
obligaron 3368ff5a3b Introduce iteminfo debug command and remove ItemInfo Keybinding 2021-09-17 21:05:31 +02:00
obligaron f9192d2312 Remove debug command line argument -^ (Enable debug tools) and added
scrollview debug command
2021-09-17 21:05:31 +02:00
obligaron 5d315b46b0 Merge coords and cursorcoords in tiledata debug command 2021-09-16 19:18:06 +02:00
obligaron 9678d002d3 Reduce exported functions in debug.h 2021-09-16 19:18:06 +02:00
Juliano Leal Goncalves 379a27b64a ♻️ Convert 'ItemType' enum to enum class
🎨 Rename 'ItemType' elements to enum class standards
2021-09-13 00:25:49 +02:00
qndel a0461bd1c0 stop displaying 0's in tiledata debug command 2021-09-12 18:15:45 +02:00
qndel d05316c67d tiledata debug command 2021-09-12 15:20:27 +02:00