Back on track a bit, with some good ol' refactoring and solving a hairy problem (literally) that I've had for a while.
Previously, on composable sprites work, I had the following issue. I had no good way of dealing with weird hair (long beard, long hair, mohawk, etc) in combination with helmets that cover part or all the face. Well, I came up with a solution that is stupidly simple and it's so trivial it's embarassing I didn't think about it earlier.
Before, if a layer (e.g. helmet) specified that some previous layers should be covered by it (e.g. hair and beard), I simply did not use them during the sprite composition, which looked bad in cases like a cowl, where some hair would be visible (near the forehead), as it looked like the character suddenly got bald.
Now, if a layer (e.g. helmet) specifies that some previous layers should be covered by it (e.g. hair and beard), then these layers DO get drawn, but purely on the surface of their parent layer (which is the face, for the hair and beard). How does this work and what does it produce?
- If a helmet doesn't cover any layer, we draw everything as normal
- If a helmet covers the hair, then beard gets rendered normally, but the hair only get rendered on the area of the face
- If a helmet covers hair and beard, then both hair and beard only get rendered on the area of the face. A full face helmet completely covers the face, so all beard/hair pixels will get overwritten by the helmet.
This was about 30' work and I don't want to overthink it and find failure cases, so I decided I'm happy and it stays :D
- Hooked key shortcuts to arbitrary console commands, for quick testing, configurable from file. Very useful. E.g. Ctrl + F1 runs "ps rain" which starts a rain particle system, but of course commands can get far more verbose and that's why the keys end up being useful
- Created a ScaledValue object to allow for values to be scaled by level, attribute and skill (either, or multiple at the same time), and that's useful for abilities that have a radius for example that can change with different levels or attributes
- Refactored ability system a little, apparently the design was not as bad as I thought, but still more changes need to be done, especially for supporting arbitrary new spells
- Melee AoE skills do not show the character bump-attacking all AoE entities separately
- Made a simple GUI to dynamically change the player appearance, seen below