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
420a248e0c
Use FlipCoin for most uses of GenerateRnd with variable frequency
4 years ago
ephphatha
7c54066f31
Use PickRandomlyAmong when choosing between two options
4 years ago
ephphatha
bc0a058350
Invert FlipCoin
4 years ago
burningserenity
b5378f74d5
Apply formatting
4 years ago
burningserenity
69e0c51d8c
Another approach
4 years ago
Anders Jenbo
bd7d5a0143
Deduplicate using spells
4 years ago
staphen
cab75ded6b
Check both SPL_NULL and SPL_INVALID to determine spell validity
4 years ago
Cesar Canassa
bb3fb36ddc
✨ Introduces FlipCoin() ( #4908 )
4 years ago
Mikołaj Piróg
15989609a8
Members' name changes and comments in Monster struct ( #4861 )
4 years ago
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
4 years ago
k-bar
26de74f4a2
AnimationInfo class correct style ( #4870 )
...
* AnimationInfo class correct case-style for private members
clang-tidy warnings:
readability-identifier-naming invalid case style for private member
* AnimationInfo class correct case-style for members
clang-tidy warnings:
readability-identifier-naming invalid case style for member
* AnimationInfo class correct case-style for methods
clang-tidy warnings:
readability-identifier-naming invalid case style for method
* AnimationInfo class use nodiscard
clang-tidy warnings:
modernize-use-nodiscard function should be marked [[nodiscard]]
4 years ago
Gleb Mazovetskiy
6949a6f418
Monster: Remove MType/MData pointers
...
These pointers are redundant, replaces them with methods.
4 years ago
Gleb Mazovetskiy
d152d2c0fb
Add OptionalOwnedCelSprite
4 years ago
Gleb Mazovetskiy
21dc7f553d
Add OptionalCelSprite: smaller than std::optional
...
`CelSprite` data pointer can never be `nullptr`.
We implement a smaller `optional` for it by taking advantage of that.
4 years ago
obligaron
e87aca38bb
Change animation frames and tick per frame to int8_t
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
Gleb Mazovetskiy
3178dd5158
Replace most uses of `sprintf` with `fmt` ( #4837 )
4 years ago
Anders Jenbo
54598e2a8f
CreatePlayer by reference
4 years ago
Anders Jenbo
d82f2ebc9e
Pass players by reference instead of an index
4 years ago
Anders Jenbo
99181fd709
Move more files to the engine folder
4 years ago
ephphatha
c68fcf3cb1
Apply MethodCase config to Rectangle::Contains
...
Also included Circle and VirtualButton classes due to the shared use.
4 years ago
Anders Jenbo
6d56058708
Move level generation to subfolder
4 years ago
Gleb Mazovetskiy
8e9c9e0238
Reduced the size of `OwnedCelSprite*` by 8 bytes
...
`OwnedCelSpriteWithFrameHeight`: 40 -> 32
4 years ago
Andrew James
0add7a8af6
Define sizes using Size type in control.cpp/stash.cpp ( #4737 )
...
* Use appropriate types for size constants in control.cpp
* Declare constexpr value for iterating over the cells in a stash grid
* Use appropriate type for UIRectangle dimensions
4 years ago
Vladimir Olteanu
2cc9d70fa6
Use decimal separators for gold and XP ( #4722 )
4 years ago
Anders Jenbo
d17d7e018d
Use common function for loading .dun tile data
4 years ago
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.
4 years ago
Gleb Mazovetskiy
779ccaca17
Overhaul translation fetching
...
1. Do not modify the map after loading. Instead, return string views
(guaranteed to be null-terminated) from look up functions and return
the key directly if not found.
2. Use an `unorded_map` instead of `map` where available (C++20).
Saves a bit of RAM (~50 KiB) and improves lookup performance.
4 years ago
Anders Jenbo
1203514383
Clean up use of currlevel
4 years ago
staphen
a2fe3a981e
Fix issues with ears due to translation
4 years ago
qndel
354e329644
Players[MyPlayerId] -> MyPlayer
4 years ago
obligaron
70c5cf6cad
Fix item label text with open stash ( #4595 )
...
* Item labels: check if stash is open in IsMouseOverGameArea
* Add IsLeft/RightPanelOpen
4 years ago
ephphatha
4d7c08d5b4
Deduplicate code for setting stat requirements/flag
4 years ago
ephphatha
ca48efc185
Update spell book requirements when refreshing stash items
4 years ago
ephphatha
64a2c41b2c
Set clang-tidy config for MethodCase option
...
Previously this was falling back to FunctionCase, leading to inconsistent casing of class methods throughout the codebase. Applied to Item as an example.
4 years ago
DakkJaniels
dad46e1905
Item special effect enum ( #4129 )
4 years ago
ephphatha
7e7798fd2b
Add function to mark an item as empty
4 years ago
Anders Jenbo
dfd8bdab70
Avoid using HeldItem in CreatePlrItems ( #4308 )
4 years ago
Gleb Mazovetskiy
a66ca44695
Zero-based frame indexing
...
Index frames starting at 0 instead of 1.
4 years ago
Anders Jenbo
b9b7e9698a
Revert IPL_TARGAC description
...
Lets give it a better one later
4 years ago
qndel
e3019b43b0
fix armor pierce on uniques and display affix values
4 years ago
Stephen C. Wills
28e9210812
Update magic requirement for stashed books ( #4376 )
4 years ago
staphen
e6182709d1
Allow casting Town Portal, Teleport, and Guardian scrolls from inventory
4 years ago
Anders Jenbo
7e83aa1429
Improve item hints for gamepads
4 years ago
Gleb Mazovetskiy
2f22d94e0d
Remove `OwnedCelSprite::Unowned` method
...
Conversion is already provided by the `CelSprite(const OwnedCelSprite &)` constructor.
4 years ago
Anders Jenbo
1ba817ca53
Unify gold handling (withdraw any amount from stash)
4 years ago
obligaron
3e9ca60460
Update _iStatFlag for stash items
4 years ago
Anders Jenbo
6d28810dc7
Change infostr from char[128] to std::string
4 years ago