forked from MagicBane/Server
fix immunities
This commit is contained in:
@@ -244,25 +244,30 @@ public class ActionsBase {
|
||||
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))
|
||||
SourceType sourceType = SourceType.GetSourceType(this.stackType);
|
||||
|
||||
if(sourceType != null && (bonus.getBool(ModType.ImmuneTo,sourceType) || bonus.getBool(ModType.NoMod,sourceType)))
|
||||
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))
|
||||
|
||||
if(pb.vampDrain() && bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN))
|
||||
return true;
|
||||
else if (this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None))
|
||||
|
||||
if (this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None))
|
||||
return true;
|
||||
else
|
||||
return pb.vampDrain() && bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN);
|
||||
|
||||
if (this.stackType.equals("PowerInhibitor") && bonus.getBool(ModType.ImmuneTo, SourceType.Powerblock))
|
||||
return true;
|
||||
|
||||
if(ac.effects.containsKey(this.stackType)) {
|
||||
Effect eff = ac.effects.get(this.stackType);
|
||||
if(eff != null) {
|
||||
if (this.greaterThan && trains <= eff.getTrains())
|
||||
return true;
|
||||
|
||||
if (this.greaterThanEqual && trains < eff.getTrains())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user