So! It may be ugly, it may depend on tons of technically nonfunctioning shims, and it may disable every technique and melee special effect currently in the game, but Iâve gotten players and monsters to use the same base class in melee combat! This is just the first step we need to take in order to unify everything together into one class hierarchy (which is itself just the first step to writing functioning NPCs), and it probably sucks, but hey, progress is progress.
Feast your eyes upon it here: https://github.com/swwu/Cataclysm-DDA/tree/creature-rework
Or donât, because itâs ugly as hell.
Stuff:
[ul][li]The new base class is called âcreatureâ (as discussed here and on dev IRC), in creature.cpp/h.[/li]
[li]Combat refers to creature instead of player/monster, cutting the melee combat loc in two.[/li]
[li]It compiles! In fact, it might even not segfault![/li]
[li]Thereâs tons of non-functioning function stubs all over the place to make the damn thing compile.[/li]
[li]As mentioned, basically every single technique and melee special effect is disabled in that code, because they rely on diseases or effects depending on player or monster, so weâll need to merge diseases and effects into a single system before those can be made to work again.[/li]
[li]Also, the playerâs armor is always set to 0 for melee attacks, because lazy stub function.[/li][/ul]