|
|
|
@ -11,13 +11,11 @@ package engine.powers;
@@ -11,13 +11,11 @@ package engine.powers;
|
|
|
|
|
|
|
|
|
|
import engine.gameManager.DbManager; |
|
|
|
|
import engine.gameManager.PowersManager; |
|
|
|
|
import engine.mbEnums; |
|
|
|
|
import engine.mbEnums.ModType; |
|
|
|
|
import engine.mbEnums.SourceType; |
|
|
|
|
import engine.mbEnums.StackType; |
|
|
|
|
import engine.objects.AbstractCharacter; |
|
|
|
|
import engine.objects.AbstractWorldObject; |
|
|
|
|
import engine.objects.PlayerBonuses; |
|
|
|
|
import engine.objects.Runegate; |
|
|
|
|
import engine.objects.*; |
|
|
|
|
import engine.powers.poweractions.AbstractPowerAction; |
|
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
|
|
|
|
|
@ -244,32 +242,20 @@ public class ActionsBase {
@@ -244,32 +242,20 @@ public class ActionsBase {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//Add blocked types here
|
|
|
|
|
public boolean blocked(AbstractWorldObject awo, PowersBase pb, int trains) { |
|
|
|
|
if (AbstractWorldObject.IsAbstractCharacter(awo)) { |
|
|
|
|
AbstractCharacter ac = (AbstractCharacter) awo; |
|
|
|
|
PlayerBonuses bonus = ac.getBonuses(); |
|
|
|
|
if (bonus == null) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
//TODO make this more efficient then testing strings
|
|
|
|
|
if (this.stackType.equals("Stun") && bonus.getBool(ModType.ImmuneTo, SourceType.STUN)) |
|
|
|
|
return true; //Currently stun immune. Skip stun
|
|
|
|
|
else if (this.stackType.equals("Snare") && bonus.getBool(ModType.ImmuneTo, SourceType.Snare)) |
|
|
|
|
return true; //Currently snare immune. Skip snare
|
|
|
|
|
else if (this.stackType.equals("Blindness") && bonus.getBool(ModType.ImmuneTo, SourceType.Blind)) |
|
|
|
|
return true; //Currently blind immune. Skip blind
|
|
|
|
|
else if (this.stackType.equals("PowerInhibitor") && bonus.getBool(ModType.ImmuneTo, SourceType.Powerblock)) |
|
|
|
|
return true; //Currently power block immune. Skip power block
|
|
|
|
|
else if (this.stackType.equals("Root") && bonus.getBool(ModType.ImmuneTo, SourceType.Root)) |
|
|
|
|
return true; |
|
|
|
|
// else if (pb.isHeal() && (bonus.getByte("immuneTo.Heal")) >= trains)
|
|
|
|
|
// return true; //Currently shadowmantled. Skip heals
|
|
|
|
|
else 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)) |
|
|
|
|
public boolean blocked(AbstractWorldObject awo) { |
|
|
|
|
//Check for immunities
|
|
|
|
|
if (AbstractCharacter.IsAbstractCharacter(awo)){//awo.getObjectType() == mbEnums.GameObjectType.PlayerCharacter) {
|
|
|
|
|
AbstractCharacter pcTarget = (AbstractCharacter) awo; |
|
|
|
|
PlayerBonuses tarBonus = pcTarget.getBonuses(); |
|
|
|
|
SourceType source = SourceType.GetSourceType(this.stackType); |
|
|
|
|
boolean immune = tarBonus.getBool(ModType.ImmuneTo, source); |
|
|
|
|
if(!immune){ |
|
|
|
|
mbEnums.DamageType damageType = mbEnums.DamageType.getDamageType(this.stackType); |
|
|
|
|
immune = pcTarget.getResists().immuneTo(damageType); |
|
|
|
|
} |
|
|
|
|
if(immune){ |
|
|
|
|
return true; |
|
|
|
|
else |
|
|
|
|
return pb.vampDrain() && bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|