Commit Graph
256 Commits
Author SHA1 Message Date
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
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