856 Commits
Author SHA1 Message Date
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
obligaron c6b214ecd3 Fix opening Diablos chamber with only one lever 2021-09-19 20:19:10 +02:00
obligaron 9e788d8134 Introduce AreAllLeversActivated 2021-09-19 20:19:10 +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
Juliano Leal Goncalves 5607c58daa 🏷️ Add 'PickRandomlyAmong' function that picks one value from a set of values randomly
This will be used in a few places where we previously used a raw integer random to index into a local array for selection, simplifying that type of logic to a single statement.
2021-09-13 00:25:49 +02:00
Juliano Leal Goncalves 5a69380074 ♻️ Leverage 'ItemType' enum 2021-09-13 00:25:49 +02:00
ephphatha dda9a5dda0 Remove redundant else statements in L1*OperateDoor functions 2021-09-12 02:27:47 +02:00
ephphathaandAnders Jenbo 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 <[email protected]>

Fix alignment of WalkSettings array
2021-09-12 02:27:47 +02:00
Juliano Leal Goncalves 0d3d4c14f6 🚚 Rename 'Dead' concept to 'Corpse' everywhere (#2808) 2021-09-06 12:49:00 +02:00
Juliano Leal Goncalves ef74b6f92d 🚚 Rename 'ObjectStruct' to 'Object' 2021-09-02 05:45:44 +02:00
Juliano Leal Goncalves 20db8d1a11 🚚 Rename 'MonsterStruct' to 'Monster' 2021-09-01 22:26:37 +02:00
Juliano Leal Goncalves 1cd62bbc64 🚚 Rename 'MonsterMode' members for semantic and consistency 2021-09-01 19:15:08 +02:00
Juliano Leal Goncalves 69a7cb66d4 ♻️ Convert 'MON_MODE' enum to 'MonsterMode' enum class 2021-09-01 19:15:08 +02:00
Juliano Leal Goncalves bb2dfdfb73 🚚 Rename 'ItemStruct' to 'Item' 2021-08-30 13:40:08 +02:00
Anders Jenbo 4044fadeb5 Clean up some players references 2021-08-30 03:26:17 +02:00
Gleb Mazovetskiy 032eaf7491 External iterators for player items
Implements external iterators for player items.
2021-08-29 07:28:21 +02:00
Anders Jenbo bf706f2fbb 🐛 Fix Phasing not working in Lazarus' camber
Previously an improper check was being done to see if the player was
located on the 3 teleporting pads in the level. Even if fixng this the
spell would not work correctly if the layer was standing on the pads
when casting the spell.

Simply use TARGET_BOTH to indicate that it should not be random and send
the player to the given destination
2021-08-28 03:43:59 +02:00
Anders Jenbo 4fd2e2dc97 🐛 Fix Phasing teleporting to invalid locations
Phasing could end up attempting to teleport to hunreds of random
location and still fail to find a valid target and send the player in to
a wall or outside the map.

This is fixed by first finding all valid locations within range and then
picking one of them at random.

Valid targets is a 13x13 area around the player minus the inner 7x7

In total there can be no more then 120 valid tiles and on average there
should be 75 avalible.
2021-08-28 03:43:59 +02:00
Robin 62a33c61d9 objects: deduplicate logic in OperateShrineGloomy using ForEachItem function 2021-08-27 11:41:45 +02:00
BC Ko 4df798808e 2435 refactor global variable Items part 2 (#2673) 2021-08-26 08:06:48 +02:00
Anders Jenbo 96b19ca8d5 Set _micaster type to mienemy_type
Rino never made use of the player id, so no reason to abuse _micaster
2021-08-23 10:51:06 +02:00
Anders Jenbo 3df8af0e9d Apply missile_id to _mitype 2021-08-21 09:10:53 +02:00
BC Ko 40c804c0ba Replace QuestStatus() with IsAvailable() in QuestStruct 2021-08-19 02:12:20 +02:00
ephphatha 96e3ce6ea4 ensure std::min call uses correct types, cast result explicitly
No idea why template deduction was failing on 3ds builds only... It was using the context of the return type to deduce what the template arguments should be? Hopefully specifying the template explicitly works.
2021-08-12 13:38:05 +02:00
ephphatha 8f2e94ae4d Use unsigned types for player experience and related values 2021-08-12 13:38:05 +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 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)
2021-07-25 03:57:42 +00:00
Anders Jenbo 9c4e34f988 Player by reference 2021-07-20 01:35:56 +02:00
Anders Jenbo f0a7a5c989 🎨 Apply code style 2021-07-19 05:44:20 +02:00
Anders Jenbo 069249f318 🚚 Move local function to anonymous namespace i-p 2021-07-19 05:44:20 +02:00
Anders Jenbo 0889780923 Remove more usage of miniwin types 2021-07-18 02:11:58 +02:00
Anders Jenbo b591824182 💚 Fix NOSOUND build 2021-07-17 16:44:32 +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 4cdcff90db 🐛 Fix Zhar state not being set when triggered
Instead the first players golem was reset
2021-07-15 19:48:55 +02:00
Anders Jenbo 77b72da276 ♻️Use monster by reference when possible 2021-07-14 20:22:35 -07:00
ephphatha a842d07dab Combine duplicated initialisation logic for quest book objects 2021-07-11 05:09:13 -07:00
ephphatha cc3572af81 Update BookLever related functions to use Rectangle.
This is mainly to help isolate functionality in the hopes of adding a specialised object class for this type of object as suggested by @julealgon in https://github.com/diasurgical/devilutionX/pull/2344#discussion_r667415019

For example, AddSCambBook performs almost the same logic but uses var6 instead of var8 for the trigger condition/identifier.
2021-07-11 05:09:13 -07:00