Commit Graph
781 Commits
Author SHA1 Message Date
Gleb Mazovetskiy 3178dd5158 Replace most uses of sprintf with fmt (#4837) 2022-07-01 17:02:56 +02:00
Mikołaj Piróg 405d9d18b6 Monster cleanup (#4832) 2022-07-01 02:07:12 +02:00
Mikołaj Piróg 2e7ff45fbf Monster global constants cleanup (#4827)
* Change #defines to constexpr const, add constexpr where applicable, fix typos
2022-07-01 00:43:03 +02:00
Anders Jenbo bf47c95fe6 Consistant variable comparisons 2022-06-30 02:59:23 +02:00
Anders Jenbo cb63e0c8e8 Better name for function that weakens Na-Krul 2022-06-30 02:59:23 +02:00
Cesar Canassa ddafe87ed3 ♻️ Fix inconsistent monster id variables
The monster id naming convention was inconsistent with several names being used: i, mid, mon, mi, monsterId

This chanage normalises all names to monsterId
2022-06-29 01:08:55 +02:00
Anders Jenbo 1c286b5624 Directly call StartMonsterDeath instead of feeding M_StartKill invalid input 2022-06-28 07:13:55 +02:00
Anders Jenbo d82f2ebc9e Pass players by reference instead of an index 2022-06-28 00:30:00 +02:00
Anders Jenbo f5e7a98fbf Avoid using -1 as a discriminator 2022-06-26 06:33:18 +02:00
k-bar 618c478620 fallen fear absolute dMonster id 2022-06-25 21:42:09 +02:00
Vladimir Olteanu 2588cc12d7 Reduce reliance on bool done for control flow, part 2 of x (#4741) 2022-06-25 18:20:04 +02:00
k-bar 05bcfd4ad6 FallenFear retreat distance based on level 2022-06-25 14:39:01 +02:00
k-bar 6a6f1263dc lazarus minion missile fix 2022-06-25 08:08:42 +02:00
k-bar 4bb6bfbf79 fix fallen retreat direction bug 2022-06-24 17:25:27 +02:00
k-bar 046bd0c356 M_FallenFear refactor 2022-06-24 17:25:27 +02:00
k-bar f685eb2704 Fallen warcry dungeon inbound fix for vanilla bug 2022-06-24 14:04:42 +02:00
k-bar 4934eb465f redundant GoatAi removal 2022-06-24 12:53:01 +02:00
k-bar 62bcd4b393 AiRangedAvoidance rafactor 2022-06-24 12:23:57 +02:00
k-bar 2dfe958fff AiRanged refactors (#4779) 2022-06-24 11:07:14 +02:00
Anders Jenbo 6d56058708 Move level generation to subfolder 2022-06-23 09:21:58 +02:00
Gleb Mazovetskiy 01ad1814ea Make path finding index-based
Reduces the size of the `PathNodes` array from 28 KiB to just 8 KiB.

Also reduces the size of `pnode_tblptr` from `300 * sizeof(void *)` to
`300 * 2` bytes.
2022-06-20 10:49:16 +01:00
Anders Jenbo 860bd1cebf Operate directly on SOL data 2022-06-18 21:27:05 +02:00
obligaron 22010f12a7 Set quest unique monsters location depending on setlevel 2022-06-18 17:05:30 +02:00
obligaron 22a113d3a6 Introduce GetLevelForMultiplayer 2022-06-18 17:05:30 +02:00
obligaron 8637e05650 Remove bLevel from delta_kill_monster_ and delta_monster_hp 2022-06-18 17:05:30 +02:00
obligaron 19749420b5 Introduce Player::isOnActiveLevel 2022-06-18 17:05:30 +02:00
obligaron 0efebc2cc8 Fix PlaceUniqueMonsters off by one monstertype 2022-06-18 09:06:08 +02:00
obligaron 9713441b69 Fix PlaceUniqueMonsters when unique monster type is not active on the level 2022-06-17 21:49:37 +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
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.
2022-06-14 12:46:36 +01:00
Anders Jenbo 1203514383 Clean up use of currlevel 2022-06-07 21:35:01 +02:00
k-bar 3ab94ebdb4 Berserk melee unsquelch fix 2022-06-06 06:38:47 +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
k-bar bc2c13e8ef fix for monster melee hit monster (#4617) 2022-05-30 04:27:53 +02:00
Anders Jenbo c89d28fe47 Remove leftover firemen code 2022-05-23 07:31:50 +02:00
Anders Jenbo d6b258926e Apply type checking on monster type 2022-05-23 07:31:50 +02:00
Anders Jenbo 8c03e4a73b Fix code style in IsPossibleToHit 2022-05-21 21:01:32 +02:00
Anders Jenbo fcfb701ba0 Extract identical MonsterDeath code 2022-05-21 21:01:32 +02:00
Anders Jenbo 5f51092f15 [hellfire] Fix spiderloard not leaving acid when killed by monsters 2022-05-21 21:01:32 +02:00
Anders Jenbo b99521b376 Do not change animation state for petrified monsters during death 2022-05-21 21:01:32 +02:00
k-bar 4a4e3a5404 Unwindle If-Elses around petrify monster 2022-05-21 19:57:02 +02:00
k-bar 5b29eda518 Remove of CheckMonsterHit (aka LiftGargoylesAndIgnoreMages) 2022-05-21 19:57:02 +02:00
k-bar 417c4c9ce2 Extract duplicated code to functions related to monster 2022-05-21 19:57:02 +02:00
Anders Jenbo 457f804f10 [vanilla] Fix missing tource light in Lazarus' chamber 2022-05-12 21:39:00 +02:00
Anders Jenbo 134791af3f Remove pointless math related to finding monsters for levels 2022-05-11 11:28:05 +02:00
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.
2022-05-10 15:16:38 +02:00
qndel 89109dc9f4 HP bar tweaks and fixes (#4525)
* HP bar tweaks and fixes
2022-04-29 08:06:59 +02:00