Commit Graph
237 Commits
Author SHA1 Message Date
Gleb Mazovetskiy 129e6fae14 Check for the mushroom quest elixir in the belt
Fixes #4583
2022-06-05 13:30:26 +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
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
Gleb Mazovetskiy a66ca44695 Zero-based frame indexing
Index frames starting at 0 instead of 1.
2022-04-14 04:39:26 +01:00
Anders Jenbo 3c54925a84 Fix cow quest getting stuck in multiplayer 2022-03-29 11:25:33 +02:00
Anders Jenbo 55a0b71b1c Only spawn loot once 2022-03-20 11:12:08 +01:00
staphen 30a9595020 Fix Hork Demon and Nakrul drops in multiplayer 2022-02-04 18:44:26 +01:00
ephphatha 8b07f27bde Remove CowOffsets, always treat cows as 4 tile sprites 2021-12-14 08:17:19 +01:00
Anders Jenbo f13e66ad04 Mark all names as translatable 2021-09-20 15:48:39 +02:00
ephphatha b62ee6a66e Remove use of direction for towners with a single facing 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 8940ede1ab 🚚 Rename 'TownerStruct' struct to 'Towner' (#2813) 2021-09-06 17:49:56 +02:00
Juliano Leal Goncalves bbf529c65a 🚚 Rename 'PlayerStruct' to 'Player' 2021-08-30 06:44:18 +02:00
Anders Jenbo 7ff4261252 Correct hellfire towners being loaded in diablo
Fixes #2723
2021-08-28 20:39:26 +02:00
Anders Jenbo 21963add95 Clean up hellfire differences 2021-08-27 05:20:56 +02:00
Anders Jenbo 0034ddd5b1 Clean up IsTownerPresent 2021-08-23 10:51:06 +02:00
qndel e9c711dc9a add IsTownerPresent 2021-08-22 14:25:19 +02:00
qndel e75ea30ece fix hellfire/cows crash 2021-08-22 14:25:19 +02:00
obligaron 9a6895352c Remember last frame when animation is changed for towners (girl & cow farmer) 2021-08-22 11:37:57 +02:00
qndel 58367c7e32 talkto debug command (#2666) 2021-08-22 02:32:51 +02:00
Anders Jenbo 5ddcd90ff9 Make NetSendCmdQuest() take a quest structure as input 2021-08-20 12:13:17 +02:00
Anders Jenbo 17f1991b45 Clean up towners.cpp 2021-08-16 05:27:33 +02:00
Anders Jenbo 6ba7895956 Fix farmer not leaving town after finishing his quest 2021-08-16 05:27:33 +02:00
Anders Jenbo fcbf2802cb Fix Celia's dialog when reciving Theodor 2021-08-16 05:27:33 +02:00
Anders Jenbo 3878c06bd0 Fix Complete Nut's dialog when reciving the gray suit 2021-08-16 05:27:33 +02:00
Anders Jenbo a8a16d6083 Make Celia go home after stating so
When reciving Theodor Celia stats that she will be going home.
This makes her not spawn after the quest is done, same as the farmer.
2021-08-16 05:27:33 +02:00
Anders Jenbo a3527b5f54 Update towner graphics when compleating quests
Previously Celia and the Complete Nut would not update there graphics
before your next visit to down, despite reciving there descried item.
2021-08-16 05:27:33 +02:00
vladtepesch 54b60101f5 No More Tears (#2589) 2021-08-15 18:09:02 +02:00
vladtepesch 7b33e8e856 Make farmer not wondering about explosion forever (#2592) 2021-08-15 17:02:31 +02:00
Anders Jenbo d523fc1e81 Cleanups 2021-08-02 10:12:40 +02:00
Anders Jenbo 9b8bf92575 Rename quest globals 2021-07-08 02:01:14 -07:00
Anders Jenbo 96bf75b502 Rename player globals 2021-07-08 02:01:14 -07:00
Anders Jenbo bc59218d0d More clang-tidy/Android Studio cleanups 2021-07-04 19:34:37 +02:00
Anders Jenbo 7e737cfa96 Merge remote-tracking branch 'refs/remotes/devilution/master' 2021-07-03 01:44:45 +02:00
Anders Jenbo d9e0658643 Clang-tidy: basic naming 2021-07-02 22:55:01 +02:00
Juliano Leal Goncalves cbb84199c2 ♻️ Replace Point addition with 'Point + Displacement' 2021-06-28 20:37:44 -07:00
ephphatha 357f6f1dc3 Move RNG functions to their own header/source files 2021-06-27 03:09:41 -07:00
Andrew James 20190ee687 Update random number functions to avoid IB (#2226)
* Update random number functions to avoid IB

Most calls to set seed were using uint32_t already, there were a few variables which were better served by having their type changed from signed to unsigned. The one exception is ItemStruct::_iSeed. This is an identifier that also happens to be used as a seed occasionally so a comment was added documenting this exception.

Includes suggested style changes for Source/towners.h; Source/towners.cpp; Source/msg.h; Source/multi.h
2021-06-27 10:37:09 +02:00
ephphatha f4f6a8a51e Refactor PlaySfxLoc to take a Point instead of x/y params
Because of the heavy usage of this function in objects.cpp and the mixed use of aliases and direct references to the active object in Operate*Door functions I've done some refactoring of those areas beyond what is strictly necessary. Hopefully this makes sense and is reasonable to include in this change.
2021-06-26 10:12:28 -07:00
Anders Jenbo 22b632f04a ♻️Clean up implicit bool conversions 2021-06-26 08:57:59 -07:00
Gleb Mazovetskiy 8a9618aea2 ♻️ Clean up cel_header.hpp
1. Rename `CelGetFrameStart` to `CelGetFrame`, in line with the other 2
   functions with the same name and load the `uint32_t` safely.
2. Remove redundant `FrameHeader`, simply use `LoadLE16`.
3. Document all the functions.
2021-06-23 11:27:56 +01:00
Gleb Mazovetskiy 14218080b6 🚚 engine.h: Extract CelGetFrame and friends 2021-06-21 02:34:28 -07:00
Gleb Mazovetskiy e40b1963f9 🚚 engine.h: Extract CelSprite and file loading 2021-06-21 01:36:20 -07:00
qndel 816b244689 HasItem/RemoveInvItem combo refactor 2021-06-13 05:18:08 +02:00
qndel 8aec2faed0 Fix clang format in towners.cpp 2021-06-13 05:18:08 +02:00
Vladimir Olteanu cc9783b8d9 Use WalkingDistance in TalkToTowner 2021-06-02 13:36:17 +02:00
Juliano Leal Goncalves b04047ba4d ♻️ Leverage 'Point' struct on 'SpawnUnique' 2021-05-31 06:05:35 +02:00
Juliano Leal Goncalves d55cd99dd5 🚚 Rename 'direction' enum to 'Direction' 2021-05-24 04:46:08 +02:00
Juliano Leal Goncalves 07e6a98fc4 ✏️ Fix typos and spelling mistakes on 'HeroSpeech' members 2021-05-24 02:16:34 +02:00