91 Commits
Author SHA1 Message Date
Gleb Mazovetskiy 7fdf19da3a FixedPoint: Implement comparison with int 2026-10-11 21:55:08 +01:00
Gleb MazovetskiyandClaude Sonnet 5 92927ca913 Migrate ClassAttributes, player HP/mana, item HP/mana bonuses, and monster HP to Fixed10_6/Fixed26_6
Replaces ParseFixed6/parseFixed6/readFixed6/readDecimal's raw-int
plumbing with the new FixedPoint type, then propagates strongly-typed
fixed-point fields through everywhere that consumed them: player
_pHitPoints/_pMana (and their base/max variants), ClassAttributes'
percentage/multiplier fields, Item::_iPLHP/_iPLMana, and
Monster::hitPoints/maxHitPoints. Eliminates manual <<6/>>6 bit-shifting
at nearly every call site in favor of fromInt/fromRaw/whole() and the
new fixed-point arithmetic operators, while preserving raw() only at
genuine serialization/network wire-format boundaries.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-10-11 21:55:08 +01:00
livinskyov 81c9ab4533 Logging: use "%.*s" instead of "%s" for strings of known length 2026-09-27 16:44:36 +01:00
Gleb MazovetskiyandClaude Fable 5 ac2d7fc731 Replace libfmt with std::format
- `fmt::format` with literal format strings -> `std::format`.
- `fmt::format(fmt::runtime(...))` -> `FormatRuntime` in the new
  `utils/format.hpp`, a std::vformat wrapper that is also safe under the
  P2905 lvalue requirement of `std::make_format_args`.
- `fmt::dynamic_format_arg_store` (Lua logging) -> a small hand-rolled
  per-field formatter over `std::variant`, returning `std::expected`.
- `fmt::format_int` -> `std::to_chars`.
- `fmt::join` -> manual joins at the two call sites.
- SDL_audiolib: new patch that rewrites aulib_log.h to use std::format
  and drops the fmt dependency from its CMakeLists.
- The `-static-libstdc++` guard now keys off
  `DEVILUTIONX_STATIC_SDL_AUDIOLIB` instead of `DEVILUTIONX_STATIC_LIBFMT`.
- libfmt removed from CMake, vcpkg, Brewfile, CI workflows,
  Dockerfiles, packaging scripts, UWP project, and docs.
- macOS bumped to 13.3+, iOS to 16.3+ (required for `<format>`)
- Amiga m68k: provide `__cmpdf2`, which is missing from the hard-float
  libgcc multilib but referenced via libstdc++'s long double paths.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-22 00:00:04 +02:00
Gleb MazovetskiyandClaude Fable 5 63e85d9b1b Replace tl::expected with std::expected
Now that the project targets C++23, use the standard library's
std::expected instead of the vendored tl::expected polyfill:

- tl::expected -> std::expected, tl::unexpected/tl::make_unexpected -> std::unexpected
- .map()/.map_error() -> .transform()/.transform_error()
- #include <expected.hpp> -> #include <expected>, grouped with std headers
- Remove 3rdParty/tl/expected.hpp (the tl target remains for function_ref.hpp)

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-22 00:00:04 +02:00
Stephen C. Wills e2a9dbd6ee Open Track integrity of assets that modify game engine logic 2026-06-22 00:02:05 +02:00
Yuri Pourre 3afccc256d Add Lua towner API and dynamic dialog options (prework for multi-town PR) (#8539)
* Add Lua towner API and dynamic dialog options

Expose TownerShortNames to Lua (devilutionx.towners), per-towner position
helpers, and RegisterTownerDialogOption for mod-driven store dialog lines.
Includes stores integration and tests.
2026-04-11 00:47:07 +00:00
Anders Jenbo 005e7dcc23 chore: clang-tidy cleanup part 1 2026-04-03 22:57:48 +02:00
Trihedraf 7ea938e212 allow for return from new func CallLuaEventReturn 2026-03-04 17:50:04 -05:00
Trihedraf 04cc99cbde LuaEvent > lua:: named functions. +lua_event.cpp 2026-03-04 17:50:04 -05:00
Trihedraf 105f6017b6 LuaEvent overload for 1 string arg to template 2026-01-31 03:20:34 +01:00
Yuri Pourre b684fd143c Adria refill mana as mod 2026-01-12 11:46:11 +00:00
Trihedraf 844cca4cba Fully expose UiFlags enum class to lua table 2026-01-12 11:14:34 +00:00
Trihedraf b540d0911e Extract lua functions from floatingnumbers to system and render modules (#8416) 2026-01-11 13:37:18 +00:00
Trihedraf 32a0666201 move floating damage nums to lua mod & add xp mod 2026-01-11 12:21:27 +01:00
Eric Robinson 5937734b85 Move *dat files to tables dir 2026-01-05 20:14:23 +01:00
Yuri Pourre 1b1c399a9b Update all the files that do not have CRLF as line break 2025-12-23 13:08:46 +00:00
Yuri Pourre 1c0987115d Expose lua methods for items and restore life and mana (#8369) 2025-12-21 12:04:40 +01:00
staphen c55e7a4107 Reload sfx when reloading active mods 2025-12-05 23:30:27 +01:00
LP 16b96e2c31 Fix broken catacombs wall tile (#8296)
* Fix broken catacombs wall tile

When tile 15 is followed by tile 1 below, change tile 1 to tile 8
(left corner) to fix a visual glitch in the catacombs.

* Silence fmt catch warnings and guard SaveHelper copy
2025-11-30 11:51:25 +01:00
Yuri Pourre d8b1f00cb5 Load towners via tsv 2025-11-29 17:29:21 +01:00
obligaron 2c4e69c5c9 Fix MSVC warnings 2025-11-16 15:53:37 +01:00
Gleb Mazovetskiy 88f706e0d1 SDL3: Add some backports / compat helpers 2025-10-10 00:49:44 +01:00
Andrettin 76feb78b4e Parse Text/Speech Data from TSV (#8138) 2025-08-25 21:32:23 +02:00
Andrettin 0c3fe1345c Parse Quest Data from TSV 2025-08-21 22:52:34 +02:00
Andrettin 7d1aebd91b Added support for mapping IDs for item types 2025-08-21 03:03:19 +02:00
Andrettin ae4264b202 Added Lua binding for defining new item types 2025-08-21 03:03:19 +02:00
Andrettin 528c1ad0e6 Use the size of the AllItemsList vector instead of IDI_LAST for getting how many items are there 2025-08-21 03:03:19 +02:00
Andrettin e2e8446be1 Added Lua Bindings for Adding Unique Items 2025-08-18 23:11:46 +02:00
Anders Jenbo 62d2ff607c Only resize monster data vectors when needed 2025-08-17 16:04:19 +02:00
Andrettin 5d21bfae37 Reworked the unique monster Lua bindings to load from a TSV file 2025-08-17 00:03:59 +02:00
Andrettin be956f0608 Added Lua Bindings for Adding New Monster Types 2025-08-16 19:57:22 +02:00
Anders Jenbo 1c76897f2c Apply simple const rules using clang-tidy 2025-08-16 01:21:36 +02:00
Andrettin cfb52ee239 Added support for mods to add unique monsters without replacing any data (#8092) 2025-08-10 23:03:27 +02:00
Anders Jenbo 7b2de562c2 Extract more Hellfire into data 2025-07-21 00:42:33 +02:00
Gleb Mazovetskiy 6fe417216e Lua console: Trigger autocomplete less often
Filter out more cases where autocomplete just gets in the way.
2025-07-20 17:46:35 +02:00
Gleb Mazovetskiy 7ff65351cb Lua: Add dev.items.get() command 2025-07-20 17:46:35 +02:00
Gleb Mazovetskiy 17e6da40f8 Lua: Improve function/property handling
1. Follows advice from
   https://sol2.readthedocs.io/en/latest/functions.html to use
   `set_function` when binding functions.
2. Adds autocomplete support for userdata methods.
3. Simplifies property bindings and improves string handling.
2025-07-20 17:46:35 +02:00
Gleb Mazovetskiy 740868af3f Update sol2 and lua
Also renames lua/lua.hpp to lua/lua_global.hpp.

The previous name broke version auto-detection in sol2, which involves
calling `__has_include(<lua/lua.hpp>)`.
2025-07-20 17:46:35 +02:00
Anders JenboandGleb Mazovetskiy 3b18dd35d9 Move some Hellfire differences to data files (#7943)
Co-authored-by: Gleb Mazovetskiy <[email protected]>
2025-04-25 22:56:59 +02:00
Anders Jenbo 3fb8be385b Add support for MPQ packed mods and turn Hellfire into one 2025-04-21 00:01:25 +02:00
staphen ceec9900f3 [Debug] Keep trying when unique item fails to generate 2025-04-20 01:19:50 +02:00
Eric Robinson 477389de3b Lua: Add an item usertype 2025-03-25 06:21:38 +01:00
Gleb Mazovetskiy 92e6d36b46 Lua: Add a player usertype 2025-03-20 06:01:47 +01:00
staphen 390d7600a3 Fix debug command for talking to towners 2025-03-10 01:11:32 +01:00
obligaron ee42d2ab66 Add missiles to tile data debug command 2025-02-03 08:10:14 +01:00
Gleb Mazovetskiy 32f9cc9ad9 Lua: Add basic APIs for walking to a towner
This may not be how we'll eventually expose towners
but it's good enough for now.
2025-01-26 21:05:09 +00:00
Gleb Mazovetskiy ee16071761 Untangle pathfinding dependencies
1. Makes `path.cpp` concerned solely with the pathfinding algorithm.
2. Turns `path_test` into a standalone test.
2025-01-25 08:14:34 +00:00
Gleb Mazovetskiy 88a9a0656d Move option change handlers out of options.cpp
Fixes #7638
2025-01-13 11:57:25 +00:00
Gleb Mazovetskiy d94bc424df sgOptions -> GetOptions()
In C++, globals initialization order accross translation units is not
defined. Accessing a global via a function ensures that it is initialized.

This will be needed for #7638, which will statically initialize change
handlers after the Options object has been initialized.
2025-01-13 11:57:25 +00:00