diff --git a/src/engine/mbEnums.java b/src/engine/mbEnums.java index 83b9e8c4..2f2d5d98 100644 --- a/src/engine/mbEnums.java +++ b/src/engine/mbEnums.java @@ -831,16 +831,22 @@ public class mbEnums { SPIRES, SNARE, STUN, - BLIND, + BLINDNESS, ROOT, FEAR, CHARM, - POWERBLOCK, + POWERINHIBITOR, DEBUFF, STEAL, DRAIN; public static DamageType getDamageType(String modName) { + if(modName.toLowerCase().equals("blind")) + modName = "BLINDNESS"; + + if(modName.toLowerCase().equals("powerblock")) + modName = "POWERINHIBITOR"; + DamageType damageType; if (modName.isEmpty()) return DamageType.NONE; diff --git a/src/engine/objects/Resists.java b/src/engine/objects/Resists.java index 9842e5e2..1458a8ce 100644 --- a/src/engine/objects/Resists.java +++ b/src/engine/objects/Resists.java @@ -349,13 +349,13 @@ public class Resists { if (rb.getBool(ModType.ImmuneTo, SourceType.Stun)) this.immuneTo.put(mbEnums.DamageType.STUN, true); if (rb.getBool(ModType.ImmuneTo, SourceType.Blind)) - this.immuneTo.put(mbEnums.DamageType.BLIND, true); + this.immuneTo.put(mbEnums.DamageType.BLINDNESS, true); if (rb.getBool(ModType.ImmuneToAttack, SourceType.None)) this.immuneTo.put(mbEnums.DamageType.ATTACK, true); if (rb.getBool(ModType.ImmuneToPowers, SourceType.None)) this.immuneTo.put(mbEnums.DamageType.POWERS, true); if (rb.getBool(ModType.ImmuneTo, SourceType.Powerblock)) - this.immuneTo.put(mbEnums.DamageType.POWERBLOCK, true); + this.immuneTo.put(mbEnums.DamageType.POWERINHIBITOR, true); if (rb.getBool(ModType.ImmuneTo, SourceType.DeBuff)) this.immuneTo.put(mbEnums.DamageType.DEBUFF, true); if (rb.getBool(ModType.ImmuneTo, SourceType.Fear)) diff --git a/src/engine/powers/ActionsBase.java b/src/engine/powers/ActionsBase.java index 44680b44..a2c505db 100644 --- a/src/engine/powers/ActionsBase.java +++ b/src/engine/powers/ActionsBase.java @@ -242,32 +242,22 @@ public class ActionsBase { } //Add blocked types here - public boolean blocked(AbstractWorldObject awo, Boolean vampDrain) { - - if (AbstractWorldObject.IsAbstractCharacter(awo)) { - AbstractCharacter ac = (AbstractCharacter) awo; - PlayerBonuses bonus = ac.getBonuses(); - if (bonus == null) - return false; + public boolean blocked(AbstractWorldObject awo, boolean vampDrain) { + //Check for immunities + if (AbstractCharacter.IsAbstractCharacter(awo)){ + AbstractCharacter pcTarget = (AbstractCharacter) awo; + PlayerBonuses bonus = pcTarget.getBonuses(); if(vampDrain) return bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN); - switch (this.stackType) { - case "Stun": - return bonus.getBool(ModType.ImmuneTo, SourceType.Stun); - case "Snare": - return bonus.getBool(ModType.ImmuneTo, SourceType.Snare); - case "Blindness": - return bonus.getBool(ModType.ImmuneTo, SourceType.Blind); - case "PowerInhibitor": - return bonus.getBool(ModType.ImmuneTo, SourceType.Powerblock); - case "Root": - return bonus.getBool(ModType.ImmuneTo, SourceType.Root); - case "Flight": - return bonus.getBool(ModType.NoMod, SourceType.Fly); - case "Track": - return bonus.getBool(ModType.CannotTrack, SourceType.None); + if (this.stackType.equals("Flight") && bonus.getBool(ModType.NoMod, SourceType.Fly)) { + return true; + }else if (this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None)) { + return true; + }else { + mbEnums.DamageType damageType = mbEnums.DamageType.getDamageType(this.stackType.toUpperCase()); + return pcTarget.getResists().immuneTo(damageType); } } return false;