Commit Graph
740 Commits
Author SHA1 Message Date
Gleb Mazovetskiy f460405818 Fix warnings
Note that in test/utf8_test.cpp, the first comparison was redundant.
For a signed char, this iterates from -128 to -1, unsigned from 0 to 128.
2022-07-14 00:19:21 +01:00
Anders Jenbo ac2bf9aaac Limit what gets called in headless mode 2022-07-13 18:54:36 +02:00
ephphatha 073b62549c Cleanup AddTrap 2022-07-13 11:44:07 +02:00
ephphatha 16b8530375 Object reference in AddObjectLight 2022-07-13 11:44:07 +02:00
ephphatha 90c8f41e52 Object reference in AddChest 2022-07-13 11:44:07 +02:00
ephphatha 1337ff6ea2 Add check if a monster potentially has leashed minions 2022-07-13 07:13:34 +02:00
Gleb Mazovetskiy ae6a3dbe5e Add missing <ctime> includes for std::tm 2022-07-12 01:31:17 +01:00
Anders Jenbo 38113c0ad8 Convert monster_goal in to a scoped enum 2022-07-11 01:46:24 +02:00
Anders Jenbo 6a8fd04067 Use player by references (#4938) 2022-07-10 11:40:04 +02:00
Gleb Mazovetskiy 197e1180b2 Add StrCat and StrAppend
Adds simple string / integer concatenation functions.

Many of the uses of `fmt::format` are simply concatenation
of a few strings and integers.

`StrCat` is an easier-to-read alternative to such uses of `fmt`.
2022-07-10 06:14:58 +02:00
ephphatha 420a248e0c Use FlipCoin for most uses of GenerateRnd with variable frequency 2022-07-10 02:37:33 +02:00
ephphatha bc0a058350 Invert FlipCoin 2022-07-10 02:37:33 +02:00
Anders Jenbo ce4595b440 Split Crypt from Cathedral 2022-07-09 11:07:47 +02:00
Cesar Canassa bb3fb36ddc ✨ Introduces FlipCoin() (#4908) 2022-07-07 20:57:03 +02:00
Cesar Canassa e538acb248 📝 Fixes Doxygen warnings (#4904) 2022-07-07 12:51:24 +02:00
Gleb Mazovetskiy d07ac14440 Handle nullptr localtime
`localtime` can return `nullptr` on some platforms (e.g. NXDK)

Improve portability by handling the `nullptr` result.
2022-07-06 13:25:51 +01:00
Mikołaj Piróg 15989609a8 Members' name changes and comments in Monster struct (#4861) 2022-07-06 10:21:22 +02:00
Cesar Canassa de971c6a8b ♻️ Refactor AddMonster to return a monster pointer (#4894) 2022-07-06 02:36:02 +02:00
Mikołaj Piróg dda0b96ea5 Remove #defines in player.h and add constexpr where applicable (#4896)
* Change defines to constexpr int in player.h

* Add const or constexpr to player.h/cpp where applicable

* Update tests with changed names of player constatns

* remove unecessary variable
2022-07-05 17:25:23 +02:00
Gleb Mazovetskiy 495448c460 Fix extra bracket in (disabled) translation 2022-07-03 14:13:53 +02:00
Anders Jenbo b00ae287b8 Minimize propegation of global Players index 2022-07-03 06:10:42 +02:00
Gleb Mazovetskiy 3178dd5158 Replace most uses of sprintf with fmt (#4837) 2022-07-01 17:02:56 +02:00
Anders Jenbo b68fd1ff5e Use player by reference in OperateShrine 2022-06-28 13:18:37 +02:00
Anders Jenbo 488a052ce6 Clean up OperateShrine 2022-06-28 13:18:37 +02:00
Anders Jenbo ba4ee58c9f Pass along bools instead of player index 2022-06-28 09:55:10 +02:00
Anders Jenbo d82f2ebc9e Pass players by reference instead of an index 2022-06-28 00:30:00 +02:00
Anders Jenbo e47599c45f Clean up BreakBarrel 2022-06-27 20:21:10 +02:00
Anders Jenbo 0d27761ac2 Make _oAnimFlag a boolean 2022-06-27 20:21:10 +02:00
Anders Jenbo 4c62905381 Deduplicate OperateLever 2022-06-27 10:17:22 +02:00
Anders Jenbo 21fd0fb686 Split delta sync from realtime sync 2022-06-27 10:17:22 +02:00
Anders Jenbo 9d167e22c1 Clean up Operate Door 2022-06-26 22:19:29 +02:00
Anders Jenbo 6d56058708 Move level generation to subfolder 2022-06-23 09:21:58 +02:00
ephphatha 3354c57ca8 Rename SkipThemeRoom/invert logic to match use 2022-06-22 16:35:39 +02:00
Anders Jenbo 4cc3a5264c Make dPiece zero-indexed 2022-06-19 09:57:30 +02:00
Anders Jenbo 98e4310cad Index Minis by tile instead of by coordinate 2022-06-19 09:02:42 +02:00
Anders Jenbo 860bd1cebf Operate directly on SOL data 2022-06-18 21:27:05 +02:00
obligaron 19749420b5 Introduce Player::isOnActiveLevel 2022-06-18 17:05:30 +02:00
Vladimir Olteanu 6f4fe8a142 Fix typo in CanPlaceRandomObject 2022-06-17 17:00:28 +02:00
Vladimir Olteanu 5d3274de45 Consolidate random object placement 2022-06-17 16:00:21 +02:00
Vladimir Olteanu 4d6ff58c22 Reduce reliance on bool done for control flow (part 1 of x) (#4720) 2022-06-17 13:13:39 +02:00
Anders Jenbo d17d7e018d Use common function for loading .dun tile data 2022-06-15 14:18:06 +02:00
Gleb Mazovetskiy 1fc8ecb6f6 Add fmt::runtime annotations for C++20 support
`fmt` requires non-contexpr format string arguments to be wrapped in
`fmt::runtime` in C++20.
2022-06-14 12:46:36 +01:00
Anders Jenbo 98a10d262e Unify PlaceMiniSet 2022-06-13 00:16:00 +02:00
qndel fc5b7b3462 [diablo] Fix shrine rng (#4529)
This bug was less sever in Diablo then Hellfire as it didn't fully initialize the object leading to them sometimes getting garbage as the RNG seed, but it was never working correctly.
2022-06-09 10:55:29 +02:00
Anders Jenbo 1203514383 Clean up use of currlevel 2022-06-07 21:35:01 +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
obligaron 2f629b6315 Unify cost of wisdom shrines (Fascinating, Sacred and Ornate) 2022-05-29 19:44:21 +02:00
Anders Jenbo 6c6999235f Add debug command for testing custom levels 2022-05-14 09:11:42 +02:00
staphen 7c28029d1a Fix condition for set pieces in AddL2Torches() 2022-05-14 04:08:18 +02:00