275 Commits
Author SHA1 Message Date
obligaron f3831deeb1 Fix a MSVC warning in towners.cpp 2023-11-26 17:39:50 +01:00
Gleb Mazovetskiy a2b94cc03c Lua: Migrate and organize the rest of debug cmds
Fully migrates debug commands to Lua and organizes them into logical
groups.

The CLI `+` syntax now runs Lua, e.g.:

```bash
build/devilutionx '+dev.player.trn.plr("infra")'
```

Chat hotkeys run Lua code if they start with `/lua`, e.g.:

```ini
[NetMsg]
QuickMessage1=/lua message(dev.player.info())
```
2023-11-07 22:27:48 +00:00
Anders Jenbo bb2e189327 Convert _sfx_id in to class enum 2023-11-02 14:34:24 +01:00
ephphatha c1f3dcb705 Use safer versions of random number functions instead of GenerateRnd 2023-09-19 16:52:40 +02:00
Gleb Mazovetskiy 9701101634 Switch to C++20
glibc compatibility remains the same.

We now use Clang 18 and static libc++ for the Aarch64 build.
Linux x86 and x86_64 builds now use GCC 13.
2023-09-01 21:56:59 +01:00
ephphatha da76e131e4 Add getter/setter for character levels to ensure _pNextExper stays synced 2023-08-24 05:46:44 +02:00
Gleb Mazovetskiy 1167b92692 Remove uses of std::tolower
`std::tolower` relies on the C locale, which we try to avoid.
2023-06-18 04:55:47 +01:00
Anders Jenbo 13e3217578 Only play the dialogs for the initating player (#6173)
* Only play the The Chamber of Bone lore for the reader

* Only play dialog for the player who is having the conversation

* Allow rock quest when skipping to level 5
2023-06-03 01:37:37 +02:00
obligaron 571e770e68 In multiplayer randomly drop unique quest reward or magic item of same type 2023-05-31 22:55:38 +02:00
obligaron 805c323063 Sync Jersey's Jersey Quest 2023-05-28 01:51:56 +02:00
obligaron bac8535564 Sync Little Girl Quest 2023-05-28 01:51:56 +02:00
obligaron c29f7a1fbf Sync Grave Matters Quest 2023-05-28 01:51:56 +02:00
obligaron 31fe55a161 Prevent hellfire quests from disapearing from quest log 2023-05-28 01:51:56 +02:00
ephphatha 143b6a40f1 apply clang-format 2023-05-22 13:49:53 +02:00
Andrew James 1b7608ea3b Map from _talker_id to towner pointer when using gossip option (#6136) 2023-05-22 13:25:53 +02:00
qndel 3500dc1861 code cleanup 2023-05-11 20:03:31 +02:00
Gleb Mazovetskiy 5bf0b8bc96 Add more missing <cstdint> includes
https://github.com/diasurgical/devilutionX/pull/6095 only added includes
for `uint32_t`, this PR also adds the includes for the remaining
integral types.
2023-05-10 16:29:27 +01:00
ephphatha b7b9996290 Remove global gossip variables and Towner::seed
Replace this with a direct reference to the chosen gossip topic when towners are init.
2023-05-06 18:01:38 +02:00
ephphatha 61e90a592e Play Pepin's quest intro dialog if the player skips the intro
If the player discovers and enters the poison water set level before talking to Pepin the poison water quest does not appear in the quest log and his first set of dialog doesn't play. Handle this case specifically to ensure the player gets the message and can see progress.
2023-05-02 10:03:11 +02:00
obligaron 8b64546b21 Move spectral elixir special logic from Player::CanUseItem to Item::isUsable 2023-02-10 22:28:52 +01:00
obligaron 0cea02aa5f Black Mushroom: Add missing TEXT_MUSH12 quest text 2023-02-10 22:28:52 +01:00
KPhoenix 8955700e67 Refactor enums 2023-02-09 13:04:01 +01:00
KPhoenix a1fbf5253f enum talk_id -> enum class TalkID 2023-02-09 13:04:01 +01:00
obligaron 2d4e84c561 Multiplayer: Enable Black Mushroom Quest 2023-02-07 08:02:38 +01:00
obligaron 6edae7cf6c Ensure Spectral Elixir is only usable after black mushroom quest is finished 2023-02-07 08:02:38 +01:00
obligaron a45ba2895e Multiplayer: Enable Anvil of Fury Quest 2022-11-27 07:19:40 +01:00
obligaron 0aa3831e32 Multiplayer: Enable Ogden's Sign Quest 2022-11-22 15:29:04 +01:00
obligaron 2db1830c7e Let ogden talk about sign quest if player visited level 4 2022-11-22 15:29:04 +01:00
obligaron d912babc91 Multiplayer: Enable Magic Rock Quest 2022-11-15 23:51:30 +01:00
obligaron c95d7617c8 Gillian: play grave quest text only once 2022-11-15 19:33:24 +01:00
obligaron 0711e6af4d Sync SpawnQuestItem (multiplayer quest items) 2022-11-12 19:27:36 +01:00
obligaron d0978672e9 Make Poisoned Water Supply quest multiplayer compatible 2022-11-11 03:27:37 +01:00
obligaron 5fe20e3d32 Make Lazarus quest map multiplayer compatible 2022-11-11 03:27:37 +01:00
Gleb Mazovetskiy 41f43ea3f5 Support unpacked MPQs from devilutionx-mpq-tools
https://github.com/diasurgical/devilutionx-mpq-tools produces an unpacked MPQ
with all the graphics converted to CLX and the unused files removed.
This is primarily useful on RAM-constrained platforms, such as PS2,
because it eliminates the MPQ overhead.

Adds a build option to load from such unpacked directories instead of the MPQ.

These directories are searched for in the same locations
where the MPQs would be searched for otherwise.

Example directory layout:

* /usr/local/share/diasurgical/devilutionx/diabdat/ -- unpacked and converted diabdat.mpq
* /usr/local/share/diasurgical/devilutionx/hellfire/ -- unpacked and converted hellfire MPQs (all of them merged into 1 directory)
* /usr/local/share/diasurgical/devilutionx/fonts/ -- unpacked fonts.mpq
* /usr/local/share/diasurgical/devilutionx/pl/ -- unpacked pl.mpq

These directory structure is produced by calling `unpack_and_minify_mpq`
2022-10-11 18:00:57 +01:00
Gleb Mazovetskiy 188dc79f6e Make Players a vector 2022-08-26 13:22:04 +09:00
Gleb Mazovetskiy 6327e713e0 Lowercase all file paths
We want to be able to use unpacked MPQs on low-end platforms
(PS2/rg99/etc).

This is tricky on case-sensitive filesystems. Avoids case issues by
lowercasing all paths in the code (then we'll just need lowercased
listfiles).
2022-08-20 23:49:23 +01:00
Gleb Mazovetskiy 961866e1c4 CLX: A new graphics format
The format is almost identical to CL2, except it uses the frame header
to store frame width and height instead of 5 32-line offsets.

This means we always have access to frame dimensions, so we can use it
as an on-disk format for our graphics as well.

Additionally, we may be able to optimize the rendering even more
in the future now that we have guaranteed knowledge of frame dimensions.
2022-08-03 02:38:55 +02:00
Gleb Mazovetskiy 8ca71272b8 Load all CEL as CL2
Convert CEL files to CL2 at load time. CL2 format is more efficient and is about as fast to render.

CEL vs CL2 sizes, on dLvl 5: https://gist.github.com/glebm/9bbdd76962abcd4fd2405ecd3379af97

Memory:

* Peak memory (while loading): -300 KiB
* Memory in-game (dLvl5): -700 KiB
* RG99 binary size: -15 KiB (1333096 -> 1317192)

Performance on rg99:

* On average, -1 FPS in town.
* Same FPS in dungeon (20 FPS on dLvl 1).
2022-07-19 10:59:35 +02:00
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