856 Commits
Author SHA1 Message Date
Anders Jenbo 98e4310cad Index Minis by tile instead of by coordinate 2022-06-19 09:02:42 +02:00
Anders Jenbo 860bd1cebf Operate directly on SOL data 2022-06-18 21:27:05 +02:00
obligaron 19749420b5 Introduce Player::isOnActiveLevel 2022-06-18 17:05:30 +02:00
Vladimir Olteanu 6f4fe8a142 Fix typo in CanPlaceRandomObject 2022-06-17 17:00:28 +02:00
Vladimir Olteanu 5d3274de45 Consolidate random object placement 2022-06-17 16:00:21 +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
Anders Jenbo d17d7e018d Use common function for loading .dun tile data 2022-06-15 14:18:06 +02:00
Gleb Mazovetskiy 1fc8ecb6f6 Add fmt::runtime annotations for C++20 support
`fmt` requires non-contexpr format string arguments to be wrapped in
`fmt::runtime` in C++20.
2022-06-14 12:46:36 +01:00
Anders Jenbo 98a10d262e Unify PlaceMiniSet 2022-06-13 00:16:00 +02:00
qndel fc5b7b3462 [diablo] Fix shrine rng (#4529)
This bug was less sever in Diablo then Hellfire as it didn't fully initialize the object leading to them sometimes getting garbage as the RNG seed, but it was never working correctly.
2022-06-09 10:55:29 +02:00
Anders Jenbo 1203514383 Clean up use of currlevel 2022-06-07 21:35:01 +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
obligaron 2f629b6315 Unify cost of wisdom shrines (Fascinating, Sacred and Ornate) 2022-05-29 19:44:21 +02:00
Anders Jenbo 6c6999235f Add debug command for testing custom levels 2022-05-14 09:11:42 +02:00
staphen 7c28029d1a Fix condition for set pieces in AddL2Torches() 2022-05-14 04:08:18 +02:00
Anders Jenbo 17f3f3930b Correct typo 2022-05-12 21:39:00 +02:00
Anders Jenbo 457f804f10 [vanilla] Fix missing tource light in Lazarus' chamber 2022-05-12 21:39:00 +02:00
Anders Jenbo e32dd690ae Clean up object update code 2022-05-12 21:39:00 +02:00
staphen f2e5f62909 Pass object by reference to AddBarrel() 2022-05-11 06:42:35 +02:00
Anders Jenbo 9872c7be05 Only load relevant object graphics
Some object graphics where loaded despite not being used on the given
levels
2022-05-11 00:51:02 +02:00
Anders Jenbo 0645d9b2a1 Correct missing hellfire level mapping in leveltype
Hellfire never added the 2 new dungion types, instead it makes
additional checks on currlevel. This is confusing and mess, so cleaned
it up.
2022-05-10 15:16:38 +02:00
Gleb Mazovetskiy ade8aba822 Fix some more warnings 2022-04-14 01:26:29 +02:00
ephphatha 6bfe5fd564 set statflag after recreating potion 2022-04-03 04:26:27 +02:00
Anders Jenbo 2d2362d035 Avoid using HoldItem in OperateShrineEldritch 2022-04-03 04:17:20 +02:00
Anders Jenbo 1ba817ca53 Unify gold handling (withdraw any amount from stash) 2022-03-22 21:38:51 +01:00
Anders Jenbo 6d28810dc7 Change infostr from char[128] to std::string 2022-03-20 14:23:30 +01:00
Anders Jenbo 1409e604f5 Reduce string conversions 2022-03-20 11:04:15 +01:00
Anders Jenbo be57d62684 Use UTF8 aware string copying 2022-03-19 06:03:19 +01:00
Anders Jenbo 718c46e7fe Remove use of tempstr 2022-03-19 06:03:19 +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
galaxyhaxz 13175df53d Add vanilla trap bugfix 2022-02-09 22:52:44 +01:00
staphen 30a9595020 Fix Hork Demon and Nakrul drops in multiplayer 2022-02-04 18:44:26 +01:00
ephphatha 4eec1bd40c Refactor trap target loop to use range iterator 2022-01-19 03:05:27 +01:00
staphen 597cde8ff2 Fix item cursor graphic used when generating Rogue's reward from the Slain Hero quest 2022-01-13 10:20:28 +01:00
ephphatha 13c54102e0 Combine Add*Door functions
There's a bit of common code, but most of the initialisation logic relies on globals or other functions defined in objects.cpp so it's not really appropriate to move these wholesale into a member of the Object class.
2021-12-30 10:26:46 +01:00
ephphatha 939df1b9c3 Remove duplicate arguments to Add*Door functions 2021-12-30 10:26:46 +01:00
ephphatha eebea35280 Pass object by reference 2021-12-30 10:26:46 +01:00
ephphatha 099fad5cb9 Use ObjectAtPosition helper for remaining references in objects.cpp
There are a bunch of direct references to dObject related to testing if an area contains the interactable part of an object, this needs further cleanup.
2021-12-28 16:01:37 +01:00
ephphatha 77a783098d Use ObjectAtPosition when checking if an item can be dropped
This extracts some of the common object logic from ItemSpaceOk and CanPut, these functions are almost identical except for the way players and monsters are checked...
2021-12-28 16:01:37 +01:00
ephphathaandAnders Jenbo a0019d289d Use Point based object lookups in themes.cpp
Move bookstand lookup inside coinflip if statement, minimises the scope of that pointer.

Co-authored-by: Anders Jenbo <[email protected]>
2021-12-28 16:01:37 +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
ephphatha 379d6e87b3 Move ObjectAtPosition to objects.cpp and make it return a pointer
All set maps initialise objects as expected so dObject has the correct ID already, no need to iterate over all active objects. Also by returning a pointer we can use this function to test if an object exists at the target position.

While on msvc int8_t is typedefed to signed char we might as well match the expected data type for the dObject array
2021-12-28 16:01:37 +01:00
obligaron ff5de056fa Add all (boolean) Game Settings to Settingsmenu (#3616) 2021-11-26 23:43:46 +01: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
obligaron 635f378722 Add OptionEntry Experience Bar 2021-11-24 09:31:39 +01:00
Andrew James 8104432db4 Use object reference (and self-id lookup) for BreakBarrel 2021-11-08 00:51:16 +01:00
Andrew James 796e2813cf Use scoped enums for DungeonFlags/BFLAG (#3135) 2021-11-07 03:11:16 +01:00
staphen d669f8ce19 Remove call to SetRndSeed() from OperateFountains() 2021-11-06 18:34:07 +01:00