Electroblob's Wizardry

Electroblob's Wizardry

18M Downloads

isMagicDamage returns false for Indirect magic damage?

Ghostrider231 opened this issue ยท 2 comments

commented

Minecraft version: 1.12.2
Wizardry version: 4.2.11

Question details:

This practically applies to any other mobs (modded ones too) that make use of the isMagicDamage() Function in their damage code.

I've noticed that when using indirect magic spells (e.g. magic missile, firebolt, lightning disk, darkness orb and any other spell that shoots a projectile) on a mob like a witch takes the same amount of damage compared to a creeper/spider despite witches having an 85% resistance to magic.

(Unarmored zombies/husk have a natural 2 armor points, so I cannot compare that)

Another example is from a mod called Dungeon Mobs Reborn, which adds a ghost mob that can only be damaged by magic attacks. This mob also has isMagicDamage() in their damage code. All of the ray type spells work on the ghost, but not projectile spells.

Ghost mob code from Dungeon mobs reborn:
https://github.com/Sunconure11/dungeon-mobs/blob/master/src/main/java/com/gw/dm/entity/EntityGhost.java


https://github.com/Electroblob77/Wizardry/blob/27d53b4e93f65303277da4c525d3feef9afff77c/src/main/java/electroblob/wizardry/util/MagicDamage.java

I was looking at your Magic Damage code and saw you mentioned about witches resisting 85% magic damage. Both Direct Damage and Indirect Damage.

Ok, I just noticed that Indirect Magic Damage has it's own class file, is it normal for mobs that make use of IsMagicDamage() return false for indirect magic attacks?


commented

Looks to me like the constructor in https://github.com/Electroblob77/Wizardry/blob/1.12.2/src/main/java/electroblob/wizardry/util/IndirectMagicDamage.java needs to duplicate a few more lines from

this.setMagicDamage();
if(type == DamageType.FIRE) this.setFireDamage();
if(type == DamageType.BLAST) this.setExplosion();

This probably explains some of the weird type/damage issues people have been complaining about in compatibility with other mods.

commented

That is indeed the problem, it was reported in #396 and is now fixed in my dev branch.