Commit graph

610 commits

Author SHA1 Message Date
Anders Jenbo
2bdb6caa07
Cleanup majority of remaning implicit bool conversions (#2234) 2021-06-26 21:05:45 +02:00
ephphatha
2fa4178aff Refactor Operate*Door functions with meaningful variable names 2021-06-26 10:12:28 -07:00
ephphatha
f4f6a8a51e Refactor PlaySfxLoc to take a Point instead of x/y params
Because of the heavy usage of this function in objects.cpp and the mixed use of aliases and direct references to the active object in Operate*Door functions I've done some refactoring of those areas beyond what is strictly necessary. Hopefully this makes sense and is reasonable to include in this change.
2021-06-26 10:12:28 -07:00
Anders Jenbo
22b632f04a ♻️Clean up implicit bool conversions 2021-06-26 08:57:59 -07:00
Anders Jenbo
f2e24fee3d 🐛 Fix trap direction 2021-06-25 13:22:08 +02:00
Vladimir Olteanu
95643029e3 Refactor missiles.cpp
Use Point wherever possible
Make some functions static (not exhaustive)
Reduce excessive indentation (not exhaustive)
Declare variables as needed (not exhaustive)
2021-06-21 12:10:37 -07:00
Gleb Mazovetskiy
e40b1963f9 🚚 engine.h: Extract CelSprite and file loading 2021-06-21 01:36:20 -07:00
qndel
70bf808512 change 1 to bool 2021-06-13 16:50:06 +02:00
ephphatha
0c99ae0206 Add descriptive name and comments for the Na-Krul spell tome check function 2021-06-13 13:54:30 +02:00
qndel
816b244689 HasItem/RemoveInvItem combo refactor 2021-06-13 05:18:08 +02:00
qndel
a8075697d7 fix thaumaturgic 2021-06-06 01:49:11 +02:00
Juliano Leal Goncalves
b04047ba4d ♻️ Leverage 'Point' struct on 'SpawnUnique' 2021-05-31 06:05:35 +02:00
Juliano Leal Goncalves
4668a526eb ♻️ Leverage 'Point' struct on monster functions (#2056) 2021-05-28 20:46:11 +02:00
Anders Jenbo
8a7ec56d3a Player by reference part 2
This mostly change player to be by reference instead of by index.
But additionally it does stript checks for gold in the belt, move some
value types to the initialization and short circute a few functiongs.
2021-05-24 21:00:32 +02:00
Juliano Leal Goncalves
b3ec79af4f
Leverage 'Point' in Lighting and Player functions (#2048) 2021-05-24 17:28:52 +02:00
Juliano Leal Goncalves
d55cd99dd5 🚚 Rename 'direction' enum to 'Direction' 2021-05-24 04:46:08 +02:00
Juliano Leal Goncalves
15c46b9eb0 💬 Rename HeroSpeech members to improve discoverability 2021-05-23 22:01:47 +02:00
Juliano Leal Goncalves
5350250a76 🚚 Rename speech functions to 'Say' variations 2021-05-23 05:32:34 +02:00
Juliano Leal Goncalves
8c620ce29e ♻️ Extract 'HeroSpeech' enum class for hero sounds instead of using raw ints 2021-05-23 05:32:34 +02:00
Jmgr
bbd39aa513 Replace sprintfs with strcpy for translatable strings 2021-05-21 01:02:45 +02:00
Jmgr
6e85cde978 Update format strings 2021-05-21 01:02:45 +02:00
Jmgr
0c27e756f7 Add fmt::format 2021-05-21 01:02:45 +02:00
Vladimir Olteanu
0c7c71d579
Cleanup of items.cpp (#1967)
- Apply Point where applicable
- Deduplicate vendor logic
- Add comment about unhanded edge case in GetSuperItemLoc
- Initialize some variables at deceleration
2021-05-17 00:12:53 +02:00
arcas
6502a3ca4d
Adding resources for translation (#1973) 2021-05-15 14:12:28 +02:00
Anders Jenbo
0c2042fa52 ♻️ Player by reference
Update Source/items.cpp
Update Source/lighting.cpp
Update Source/pack.cpp
asd


ads


as
2021-05-13 01:47:46 +02:00
Anders Jenbo
68e73c0dfe 🐛 Fix infopanel text color 2021-05-12 11:40:31 +02:00
Anders Jenbo
ad97ebe980 🔥 Remove redundant code from towners.cpp
This changes one bavious. Previously walking away from the dead guy
would interupt the "Your death shall be reveanged", the interuption
seamed un natural and the code didn't seam to have been specifically
made for this case (TownCtrlMsg).

Fix several edge cases in quests where the incorrect state could be reached
2021-05-10 23:17:43 +02:00
Anders Jenbo
4b577329f4 ♻️Refactor towner initialization 2021-05-07 00:30:23 +02:00
Anders Jenbo
6321bf04d5 ♻️Pass player to towner by reference instead of index 2021-05-07 00:29:46 +02:00
Anders Jenbo
f579b2f287 Handle cel/cl2 files as byte arrays 2021-05-06 13:17:54 +02:00
Anders Jenbo
3746723f52 ♻️Add type to MIN-files and TRN-files 2021-05-05 04:03:23 +02:00
Juliano Leal Goncalves
39736e2538 ♻️ Pass 'PlayerStruct' pointer to 'ClrPlrPath' 2021-05-05 00:38:58 +02:00
Anders Jenbo
fa0b286693 ♻️Typed file loading
Tthis gives us the option to specify what type a file should be loaded
as, avoidng the need to case it and does some automatic checks on the
fitness of the data, while making the process simpler.

If no type is given then the type will be set to std::byte which limit
what operations can be performed on the data.
2021-05-04 19:08:37 +02:00
Anders Jenbo
654a2b8834 ♻️Clean up automap code
Use Point for x,y pairs. Make helpers for drawing door and squares
2021-05-02 15:27:38 +02:00
Gleb Mazovetskiy
052b4c12f5 ♻️ LoadFileInMem: Remove nullptr at call sites
This is now the default argument, no need to provide it explicitly.
2021-05-01 20:51:55 +02:00
Gleb Mazovetskiy
1b8b62a8c2 ♻️ Store CEL width with the sprite itself
Instead of passing the CEL sprite width when drawing, store the CEL
width at load time in the new `CelSprite` struct.

Implemented for most sprites except towners, missiles, or monsters.
2021-05-01 20:51:55 +02:00
Anders Jenbo
f884ba5340 🔥 Remove more miniwin dependencies 2021-04-29 23:04:56 +02:00
Anders Jenbo
3b04f67194 🔥 Remove a chunk of miniwin types 2021-04-29 23:04:56 +02:00
thebigMuh
f41fdedbc7
🐛 [hellfire] Fix missing braziers in crypt (causing instability)
- Crypt candles (braziers) around the storybook were occasionally missing
- Marked OFILE_CANDLE2 to load for all levels 1 through 12, so it is always loaded for crypt as well
- Made search for object graphics a bit more secure, as in the bugged case it would run off past the end of an array
2021-04-29 01:59:00 +02:00
Anders Jenbo
48dbb47d70 🌐 Apply static translations 2021-04-29 01:21:28 +02:00
John Törnblom
e0dddf508a
Add automatically translated string literals (#1694) 2021-04-25 18:14:58 +02:00
obligaron
239a43cc1c
Remove "AnimWidth2" expect for missiles (#1680) 2021-04-25 13:32:33 +02:00
Anders Jenbo
f77c52941a ♻️Make GetDirection take Points instead of ints 2021-04-25 02:25:52 +02:00
Anders Jenbo
2bd13451a1 ♻️Apply point positioning to all remaning entities 2021-04-25 01:25:48 +02:00
Anders Jenbo
efbe8a8338 ♻️ add possition points to monsters 2021-04-24 20:29:52 +02:00
Anders Jenbo
7912e510f0 🎨 Clean up overuse of SDL types 2021-04-24 17:07:07 +02:00
Anders Jenbo
e4cfad3196 ♻️Use points instead of individual fileds for player structure 2021-04-24 04:46:08 +02:00
Anders Jenbo
d99522b9a5 ♻️ Clean up direction related code 2021-04-23 17:39:18 +02:00
Anders Jenbo
a32ac83090 🎨 cleanup trivial trype comparisons 2021-04-23 02:48:25 +02:00
Anders Jenbo
1e3ed903be 🎨 strip redundant else 2021-04-22 00:39:48 +02:00