devilutionX icon indicating copy to clipboard operation
devilutionX copied to clipboard

Expand monster resists

Open DakkJaniels opened this issue 3 years ago • 4 comments

Rewrote monster resistances for expandability by mods in the future:

  1. Monster resist struct has individual int8's for each resistance, allowing any value from 0-127 for magic, fire, and lightning, while acid is restricted to multiplies of 16. This is to maintain save compatibility, which required grabbing two adjacent free spots. If save compatibility doesn't matter, the 4 resistances could fit into a 32-bit space - or alternatively, maybe the monster resistances could be restored from the MonstersData table when loading a save file - let me know what you think).
  2. Added member functions to the monster resist struct to help with the conditional logic checks on resistances/immunities
  3. Expanded out the monster table so you could have different resistances for Normal and Nightmare. For this PR, the normal and nightmare values are the same per the original game.

Note that IMMUNE_NULL_40 was not included as part of this PR since it isn't used anywhere else in the game, as far as I know. I included IMMUNE_ACID since there is a logic check on that with missiles in Hellfire.

DakkJaniels avatar Mar 09 '22 04:03 DakkJaniels

. This also includes switching MonsterAI to an enumerated class because I forgot to making a new branch when I started work on this.

how about no ... lol

qndel avatar Mar 09 '22 07:03 qndel

If that is really a big deal, I will undo it.

DakkJaniels avatar Mar 09 '22 11:03 DakkJaniels

If that is really a big deal, I will undo it.

If you dump multiple things into a single PR like this ,expect it to stay in review forever ;)

qndel avatar Mar 09 '22 11:03 qndel

If you dump multiple things into a single PR like this ,expect it to stay in review forever ;)

No problem, fixed! Thank you for the insight 😄

DakkJaniels avatar Mar 09 '22 12:03 DakkJaniels