Commit Graph
891 Commits
Author SHA1 Message Date
Gleb Mazovetskiy 38e37e0d53 Fix warnings/errors with -funsigned-char 2022-12-05 07:52:13 +01:00
KPhoenix e7ffa882e6 Minor cleanup for MonsterAttackPlayer() (#5444) 2022-11-23 03:26:42 +01:00
obligaron 0aa3831e32 Multiplayer: Enable Ogden's Sign Quest 2022-11-22 15:29:04 +01:00
obligaron d2d96f988c Make TalktoMonster multiplayer compatible 2022-11-22 15:29:04 +01:00
obligaron f8705c51a2 Make skeleton king's lair multiplayer compatible 2022-11-14 06:58:56 +01:00
obligaron 5fe20e3d32 Make Lazarus quest map multiplayer compatible 2022-11-11 03:27:37 +01:00
obligaron 5f63060c28 Add FindUniqueMonster 2022-11-11 03:27:37 +01:00
Gleb Mazovetskiy 6dca019de2 Use function_ref instead of function
`function_ref` is a lightweight function pointer,
whereas `std::function` always involves a heap allocation.
2022-11-02 11:46:15 +00:00
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`.
2022-10-16 03:53:26 +01:00
Gleb Mazovetskiy 41f43ea3f5 Support unpacked MPQs from devilutionx-mpq-tools
https://github.com/diasurgical/devilutionx-mpq-tools produces an unpacked MPQ
with all the graphics converted to CLX and the unused files removed.
This is primarily useful on RAM-constrained platforms, such as PS2,
because it eliminates the MPQ overhead.

Adds a build option to load from such unpacked directories instead of the MPQ.

These directories are searched for in the same locations
where the MPQs would be searched for otherwise.

Example directory layout:

* /usr/local/share/diasurgical/devilutionx/diabdat/ -- unpacked and converted diabdat.mpq
* /usr/local/share/diasurgical/devilutionx/hellfire/ -- unpacked and converted hellfire MPQs (all of them merged into 1 directory)
* /usr/local/share/diasurgical/devilutionx/fonts/ -- unpacked fonts.mpq
* /usr/local/share/diasurgical/devilutionx/pl/ -- unpacked pl.mpq

These directory structure is produced by calling `unpack_and_minify_mpq`
2022-10-11 18:00:57 +01:00
Gleb Mazovetskiy d1e9f51c68 monster.{h,cpp}: Minor refactor
1. Extract some common code into functions.
2. Avoid some overly long lines.
2022-10-03 06:46:16 +02:00
Mikołaj Piróg 4cff046ba9 Replace toHitSpecial member with a function & fix wrong arguments being passed (#5337) 2022-09-18 17:26:23 +02:00
Mikołaj Piróg 5e340d3261 Replace level member with a member function in monster (#5336) 2022-09-17 11:39:44 +02:00
qndel 21f67eaadd use array size instead of sizeof math 2022-09-13 19:59:29 +02:00
qndel f132d4a13a fix golem detection (#5342) 2022-09-13 18:45:52 +02:00
obligaron a2ec22667f Use AnimationInfo::isLastFrame in more places 2022-09-04 18:00:16 +02:00
zaid-ismail031 b0c9a8024e Refactor missiles.cpp to use Direction enum instead of magic Point/Displacement constants. 2022-08-30 21:25:44 +02:00
Mikołaj Piróg 32b3333bfb Exp overflow fix (#5070) 2022-08-28 17:35:58 +02:00
Anders Jenbo f8dca40427 Merge branch 'master' of https://github.com/diasurgical/devilution 2022-08-27 02:41:28 +02:00
Gleb Mazovetskiy 188dc79f6e Make Players a vector 2022-08-26 13:22:04 +09:00
Gleb Mazovetskiy 6327e713e0 Lowercase all file paths
We want to be able to use unpacked MPQs on low-end platforms
(PS2/rg99/etc).

This is tricky on case-sensitive filesystems. Avoids case issues by
lowercasing all paths in the code (then we'll just need lowercased
listfiles).
2022-08-20 23:49:23 +01:00
qndel aa65d27e5c break hidden invis on death 2022-08-18 20:33:14 +02:00
qndel 2c6bd410c2 increase pDiabloKillLevel variable in singleplayer on diablo kill 2022-08-08 20:14:19 +02:00
qndel ef5a4de227 typos + code cleanup 2022-08-07 20:28:43 +02:00
staphen f9e01f25c4 Consistently send network messages when monsters are damaged 2022-08-07 03:34:57 +02:00
obligaron 2493f06116 ActorPosition: Remove offset, offset2 and velocity 2022-08-03 21:25:21 +02:00
obligaron 5913783826 Add walking offset calculation to ActorPosition (and validate it) 2022-08-03 21:25:21 +02:00
obligaron 49c7ea71af Simplify SyncLightPosition 2022-08-03 21:25:21 +02:00
Gleb Mazovetskiy 961866e1c4 CLX: A new graphics format
The format is almost identical to CL2, except it uses the frame header
to store frame width and height instead of 5 32-line offsets.

This means we always have access to frame dimensions, so we can use it
as an on-disk format for our graphics as well.

Additionally, we may be able to optimize the rendering even more
in the future now that we have guaranteed knowledge of frame dimensions.
2022-08-03 02:38:55 +02:00
Cesar Canassa 1bdee4523b ✨ Adds ignoreMovingMonsters to MonsterAtPosition (#5118) 2022-08-01 01:20:47 +02:00
ephphatha 9309f2fe4f Add enum to represent monster sound effects 2022-07-31 07:26:33 +02:00
Stephen C. Wills e364b7488c HitMonster() cleanup (#5147) 2022-07-30 14:39:24 +02:00
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