Gleb Mazovetskiy
759ca7f055
`WorldTileRectangle/Size`
...
Adds a custom sized type for the world tile rectagle.
This allows us to better express intent.
It also allows us to make certain globals smaller, e.g. `THEME_LOC`.
3 years ago
ephphatha
22adb0a93f
Use counter to track number of candidates considered in TFit_Obj5
4 years ago
obligaron
9ee325e537
TFit_Obj5: Fix theme room generation when only last skipped candidate was valid
4 years ago
ephphatha
29f65a92bb
Return direct from switch in all cases of CheckThemeReqs
4 years ago
ephphatha
9c245f8ec4
Expand anonymous namespace in themes.cpp
4 years ago
ephphatha
08acd4aac0
Tidy up T_FitObj5
4 years ago
ephphatha
6656c74842
Use 0 as a default for non-random object placement tests
4 years ago
ephphatha
cdcccef47a
Return pointer from AddObject
...
This allows removing the immediate lookup for call sites which need further initialisation.
4 years ago
Andrew James
2786a65e7b
Tidy up ActivateSkeleton and take monster by reference ( #5080 )
...
* Take reference in OperateSarcophagus
* Use monster reference instead of pointer in ActivateSkeleton
* Clean up ActivateSkeleton
4 years ago
Gleb Mazovetskiy
33ac2cca8e
♻️ Make Monster counters `size_t`
4 years ago
ephphatha
7df7b6fa54
Address warning for comparing signed and unsigned values
4 years ago
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`.
4 years ago
ephphatha
7bda8dcc9a
Include coin flips from room gen cleanup
4 years ago
ephphatha
420a248e0c
Use FlipCoin for most uses of GenerateRnd with variable frequency
4 years ago
Cesar Canassa
de971c6a8b
♻️ Refactor AddMonster to return a monster pointer ( #4894 )
4 years ago
Gleb Mazovetskiy
72660d9189
Migrate snprintf to fmt ( #4845 )
...
* Migrate `app_fatal` from printf to libfmt
* Migrate snprintf to fmt
4 years ago
Mikołaj Piróg
7cab074aa5
Correct members' names in monster.h ( #4850 )
...
* Fix case in AnimStruct
* Rename CMonster members
4 years ago
Anders Jenbo
72656b3011
Move path and palette to the engine folder
4 years ago
Anders Jenbo
6d56058708
Move level generation to subfolder
4 years ago
Anders Jenbo
860bd1cebf
Operate directly on SOL data
4 years ago
Anders Jenbo
f64fe57fbe
Do not process theme rooms for Nest and Crypt
...
This causes Objects, Items and Monstesr to have different positions from
the original, but this is acceptable since they are stored in the save
game and so do not break compatability.
4 years ago
Anders Jenbo
52b8221460
[vanilla] Correct number of monster in libraries
4 years ago
Anders Jenbo
0645d9b2a1
Correct missing hellfire level mapping in leveltype
...
Hellfire never added the 2 new dungion types, instead it makes
additional checks on currlevel. This is confusing and mess, so cleaned
it up.
4 years ago
ephphatha
8a0f81ec12
Pass regionId to TFit_Obj3 to extract reference to themes global
4 years ago
ephphatha
3e991fc9a8
Use Point/range iterator in CheckThemeObj3
...
This does introduce a slight behaviour difference for some callers. It was possible to read out of bounds due to the bounds check only guarding against negative indexes (e.g. Theme_Library uses 1, MAXDUN - 1 as the bounds, but Theme_ArmorStand includes boundary tiles so could read off the right/bottom edge). Given the way vanilla levels are generated with a border this has no impact in practice.
4 years ago
ephphatha
a0019d289d
Use Point based object lookups in themes.cpp
...
Move bookstand lookup inside coinflip if statement, minimises the scope of that pointer.
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
4 years ago
Andrew James
796e2813cf
Use scoped enums for DungeonFlags/BFLAG ( #3135 )
4 years ago
Anders Jenbo
294b583dbe
Clean up Theme_Treasure
4 years ago
qndel
5656714ea9
fix 0 gold piles
4 years ago
Juliano Leal Goncalves
379a27b64a
♻️ Convert 'ItemType' enum to enum class
...
🎨 Rename 'ItemType' elements to enum class standards
5 years ago
ephphatha
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 <anders@jenbo.dk>
Fix alignment of WalkSettings array
5 years ago
Robin Eklind
82133085fc
themes: add BUGFIX for Theme_Treasure
5 years ago
Siddharth singh chouhan
6a8812c468
Move documentation from themes.cpp to themes.h
5 years ago
BC Ko
40c804c0ba
Replace QuestStatus() with IsAvailable() in QuestStruct
5 years ago
Anders Jenbo
9264ad4b89
Use IsTileNotSolid() in place of !nSolidTable[dPiece[][]]
5 years ago
ephphatha
19ae61811f
Refactor AddObject to take Point instead of int x/y
5 years ago
Anders Jenbo
903d4bd2e1
Scope all for loops
...
This caused 7 of the loops to be rewriteen using range by clang-tidy
5 years ago
Anders Jenbo
467b74dc06
Rename object globals
5 years ago
Anders Jenbo
c8870dbd1f
Rename item globals
5 years ago
Anders Jenbo
07ad083fda
Rename monster globals
5 years ago
Anders Jenbo
bc59218d0d
More clang-tidy/Android Studio cleanups
5 years ago
Anders Jenbo
0f2ad469ea
♻️ Clean up variable initialization
5 years ago
ephphatha
357f6f1dc3
Move RNG functions to their own header/source files
5 years ago
Anders Jenbo
d8fa29c972
Clean up more implicit bool conversion
5 years ago
Juliano Leal Goncalves
4668a526eb
♻️ Leverage 'Point' struct on monster functions ( #2056 )
5 years ago
Juliano Leal Goncalves
d55cd99dd5
🚚 Rename 'direction' enum to 'Direction'
5 years ago
Anders Jenbo
9e2206a673
Format code
5 years ago
Vladimir Olteanu
0c7c71d579
Cleanup of items.cpp ( #1967 )
...
- Apply Point where applicable
- Deduplicate vendor logic
- Add comment about unhanded edge case in GetSuperItemLoc
- Initialize some variables at deceleration
5 years ago
Anders Jenbo
34744c068f
♻️ Consitantly use %i and not %d
5 years ago
Anders Jenbo
2bd13451a1
♻️ Apply point positioning to all remaning entities
5 years ago