Commit Graph
843 Commits
Author SHA1 Message Date
Anders Jenbo d1189388f5 Use user by reference 2022-07-17 18:41:05 +02:00
Gleb Mazovetskiy 04c3d85179 Remove MAX_PATH
Rather than using the Windows-like `MAX_PATH`, what we really want is 2
things:

1. Maximum path of a file in an MPQ. This is now `MaxMpqPathSize`.
2. Max size for the known monster paths. This is now 64 for sounds and
   TRNs, which is more than enough (picked arbitrarily).
2022-07-16 11:14:16 +01:00
Anders Jenbo 16b65120ea Clean up LevelMonsterTypes related code 2022-07-15 19:36:47 +02:00
Gleb Mazovetskiy 7ad0ec925f Reduce sizes of Monster (goal)Vars
sizeof(Monster): 168 -> 144
2022-07-15 17:15:50 +01:00
Mikołaj Piróg 262fa9ac2d Rename MonsterData members (#5000) 2022-07-15 16:20:13 +02:00
Mikołaj Piróg c38db60d0b Remove monster name member from monster struct (#4986) 2022-07-14 10:16:19 +02:00
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
Gleb Mazovetskiy 304c62d943 Fix a HeadlessMode typo in monster.cpp
Fixes #4990
2022-07-13 21:21:39 +02:00
Anders Jenbo ac2bf9aaac Limit what gets called in headless mode 2022-07-13 18:54:36 +02:00
Cesar Canassa ce349789cf ♻️ Refactor M_StartKill to receive a Monster reference (#4943) 2022-07-13 15:57:58 +02:00
Cesar Canassa f0d1d58499 ♻️ Remove monsterId from delta_kill_monster 2022-07-13 14:48:31 +02:00
Cesar Canassa 2c558a7aa0 ♻️ Adds distanceToEnemy method 2022-07-13 14:03:21 +02:00
Cesar Canassa fcd5928846 ♻️ Refactor RandomWalk to receive a Monster reference (#4905) 2022-07-13 21:51:27 +10:00
Andrew James d9d1385f6c Take const reference in DirOK (#4985) 2022-07-13 12:56:52 +02:00
ephphatha fe62359dbd Add helper to map unique types to monster types 2022-07-13 07:13:34 +02:00
ephphatha 1337ff6ea2 Add check if a monster potentially has leashed minions 2022-07-13 07:13:34 +02:00
ephphatha ff1e67ae73 Rework PlaceGroup to not use UniqueMonsterPack enum 2022-07-13 07:13:34 +02:00
ephphatha b60bdf8b9b Unset leader of minions when the leader dies 2022-07-13 07:13:34 +02:00
ephphathaandAnders Jenbo 4fef842b0b Remove use of ID/index from PlaceGroup
use getId helper for leader id

Co-authored-by: Anders Jenbo <[email protected]>
2022-07-13 07:13:34 +02:00
ephphatha 1e0f2c149c Add getLeader helper for monsters in a pack 2022-07-13 07:13:34 +02:00
Gleb Mazovetskiy 33ac2cca8e ♻️ Make Monster counters size_t 2022-07-12 03:04:53 +01:00
Anders Jenbo 38113c0ad8 Convert monster_goal in to a scoped enum 2022-07-11 01:46:24 +02:00
Anders Jenbo 3d08f951d6 Clean up use of miniwin 2022-07-10 21:13:39 +02:00
Cesar Canassa e2ebac0b56 ♻️ Remove monsterId from HitMonster and MonsterHitMonster 2022-07-10 20:54:35 +02:00
Gleb Mazovetskiy 9928d691e4 Remove MonsterData#has_trans
1. Removes the field because it is redundant, checks for
   `TransFile != nullptr` instead.
2. Fixes the missing TRN on Bone Demon, a stronger variant of Skullwing.
2022-07-10 20:08:11 +02:00
staphen d7b5edb8d0 Fix monster goal variable references 2022-07-10 19:55:29 +02:00
Anders Jenbo 6a8fd04067 Use player by references (#4938) 2022-07-10 11:40:04 +02:00
Gleb Mazovetskiy 53975d9264 monstdat: Simplify paths
1. Remove `Monsters\` from `sndfile` and `TransFile`.
2. Where `sndfile` is the same as `GraphicType`, set `sndfile` to
   `nullptr`.
2022-07-10 06:14:58 +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 1fb45a7f25 Take Player reference in FixPlrWalkTags 2022-07-10 06:03:10 +02:00
ephphatha 420a248e0c Use FlipCoin for most uses of GenerateRnd with variable frequency 2022-07-10 02:37:33 +02:00
ephphatha 7c54066f31 Use PickRandomlyAmong when choosing between two options 2022-07-10 02:37:33 +02:00
ephphatha bc0a058350 Invert FlipCoin 2022-07-10 02:37:33 +02:00
Anders Jenbo 8351aac2c8 Clean up monster mode 2022-07-10 00:01:10 +02:00
Cesar Canassa 4d5aa90d77 ♻️ Refactor M_WalkDir
- 🔥 Removed DumbWalk
- 🚚 Renames M_WalkDir to Walk

This integrates the DirOK check into M_WalkDir itself, that makes the DumbWalk function useless and most places that were calling DirOK before M_WalkDir can now be simplified.
2022-07-09 19:32:14 +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
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
obligaron 3c571bf64b Avoid overflow of tickCounterOfCurrentFrame (#4893)
* When MFLAG_ALLOW_SPECIAL is set, don't call processAnimation (avoid overflow of tickCounterOfCurrentFrame)
2022-07-05 19:23:32 +02:00
Cesar Canassa 0d106beaf3 ♻️ Refactor M_StartHit to receive a Monster reference 2022-07-05 17:37:53 +02:00
Cesar Canassa b1275d0163 Renamed m variable into monsterId 2022-07-05 17:37:53 +02:00
Cesar Canassa dab0517f21 ♻️ Refactor ActivateSpawn to receive a Monster reference (#4889) 2022-07-04 19:20:25 +02:00
Cesar Canassa 423a2ed614 ♻️ Refactor MonsterRangedAttack to receive a Monster reference (#4891) 2022-07-04 19:08:20 +02:00
Cesar Canassa 27f8951a94 ♻️ Refactor MonsterWalk to receive a Monster reference (#4888) 2022-07-04 17:47:57 +02:00
Cesar Canassa 4bb2f30657 ♻️ Refactor MonsterDeath to receive a Monster reference (#4887) 2022-07-04 17:31:14 +02:00
Cesar Canassa 76da2d14c9 Remove monsterId from M_GetKnockback (#4882) 2022-07-04 11:54:53 +02:00
Cesar Canassa c126839b9f ♻️ Refactor StartMonsterGotHit to receive a Monster reference (#4880) 2022-07-03 21:59:34 +02:00
Cesar Canassa bbb78542df ♻️ Refactor Teleport to receive a Monster reference instead of monsterId (#4879) 2022-07-03 21:44:20 +02:00