Commit Graph
855 Commits
Author SHA1 Message Date
Cesar Canassa 75756c518f ♻️ Send the monster reference to the monster AI functions (#5113) 2022-07-25 06:59:56 +02:00
Cesar Canassa 07ff79cbdc ♻️ MonsterAttackPlayer receives monster and player as references (#5111) 2022-07-25 00:02:05 +02:00
ephphathaandAnders Jenbo 975eb3674b Add helper to check if a monster belongs to a player
Co-authored-by: Anders Jenbo <[email protected]>
2022-07-24 16:08:09 +02:00
Cesar Canassa f12e636abb ♻️ Remove monsterId from AiPlanPath 2022-07-23 12:43:12 +02:00
Cesar Canassa 800d1665be ♻️ Remove monsterId from RandomWalk2 2022-07-23 08:07:42 +02:00
Cesar Canassa c58e8b0353 ♻️ pass monster by reference on MonsterHitMonster
- Sending the monster by reference instead of id
- Changed the golem check to be equal to StartDeathFromMonster
- Changed the parameters order so that the attacker comes first
2022-07-23 08:06:56 +02:00
Cesar Canassa c79b15df1a ♻️ Remove monsterId from StartDeathFromMonster (#5072) 2022-07-23 02:39:53 +02:00
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
2022-07-21 18:58:27 +02:00
Cesar Canassa 82caea1ca4 ♻️ Remove monsterId from RoundWalk 2022-07-21 17:39:18 +02:00
Cesar Canassa a0cd65e082 ♻️ Remove monsterId from M_SyncStartKill 2022-07-21 17:37:18 +02:00
Cesar Canassa c6561596b5 ♻️ Remove monsterId from CheckReflect (#5071) 2022-07-20 20:31:57 +10:00
Cesar Canassa f4fd4b1644 ♻️ Remove monsterId from AiPlanWalk (#5073) 2022-07-20 20:31:15 +10:00
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