Commit Graph
694 Commits
Author SHA1 Message Date
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
Andrew James 021c7a652f Add helpers for checking object type (#3357)
* Add helper to test if an object is a trap source
* Add helper to test if an object is a barrel
* Add helper to test if an object is a crucifix
* Add helpers to check if an object is a chest (and statuses)
* Add helpers to check if an object is a (basic) shrine
2021-11-06 18:32:52 +01:00
Andrew James e87b67aa8a Remove no-op assignment (#3362) 2021-11-02 08:50:01 +01:00
Andrew James 7dcc6d15f7 Update some quest object activation functions to use references (#3356)
- rename with a hopefully more descriptive name
2021-11-01 15:48:54 +01:00
ephphatha d2940e8f7f Update GetObjectStr to take a const Object&
Brings it in line with GetItemStr
2021-11-01 12:44:46 +01:00
Gleb Mazovetskiy 64a88343e8 Refactor: Use item iterators in 7 more places 2021-10-31 13:28:08 +00:00
ephphatha 6d545868d2 Move objectIsDisabled to a member function
While it does reference a global configuration option it's mainly concerned with the properties of the object itself, so makes sense to be a member of the object class.
2021-10-31 14:21:57 +01:00
ephphatha e98b80c992 Remove declaration of private/anonymous function
Never used outside objects.cpp so it was rightly moved into the anonymous namespace, but the header was not updated at the time.
2021-10-29 14:16:17 +02:00
Andrew James 76ef0e8128 Dedupe SyncNakrulRoom code (#3325) 2021-10-29 08:34:30 +02:00
obligaron 98ecd0ecc5 Introduce CloseGoldDrop 2021-10-27 00:06:30 +02:00
qndel e567953bc9 Sharing automap exploration in multiplayer 2021-10-25 02:58:41 +02:00
qndel d81de165d4 code cleanup (#3235) 2021-10-24 16:05:44 +02:00
qndel 5193abebcb add objectindex to tiledata 2021-10-20 22:30:18 +02:00