|
|
@ -9,6 +9,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
package engine.powers; |
|
|
|
package engine.powers; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import engine.Enum; |
|
|
|
import engine.Enum.ModType; |
|
|
|
import engine.Enum.ModType; |
|
|
|
import engine.Enum.SourceType; |
|
|
|
import engine.Enum.SourceType; |
|
|
|
import engine.Enum.StackType; |
|
|
|
import engine.Enum.StackType; |
|
|
@ -237,32 +238,72 @@ public class ActionsBase { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//Add blocked types here
|
|
|
|
//Add blocked types here
|
|
|
|
public boolean blocked(AbstractWorldObject awo, PowersBase pb, int trains) { |
|
|
|
public boolean blocked(AbstractWorldObject awo, PowersBase pb, int trains, AbstractCharacter source) { |
|
|
|
|
|
|
|
if(!pb.getName().contains("Summon")) { |
|
|
|
|
|
|
|
if (AbstractWorldObject.IsAbstractCharacter(awo)) { |
|
|
|
|
|
|
|
AbstractCharacter target = (AbstractCharacter) awo; |
|
|
|
|
|
|
|
if (source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) { |
|
|
|
|
|
|
|
PlayerCharacter pc = (PlayerCharacter) source; |
|
|
|
|
|
|
|
if (target.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) { |
|
|
|
|
|
|
|
if (pc.isBoxed && pc.getObjectUUID() != target.getObjectUUID()) { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(pb.isChant) |
|
|
|
|
|
|
|
return false; |
|
|
|
if (AbstractWorldObject.IsAbstractCharacter(awo)) { |
|
|
|
if (AbstractWorldObject.IsAbstractCharacter(awo)) { |
|
|
|
AbstractCharacter ac = (AbstractCharacter) awo; |
|
|
|
AbstractCharacter ac = (AbstractCharacter) awo; |
|
|
|
|
|
|
|
if(ac.effects.containsKey(this.stackType)) { |
|
|
|
|
|
|
|
Boolean sameRank = false; |
|
|
|
|
|
|
|
Effect eff = ac.effects.get(this.stackType); |
|
|
|
|
|
|
|
String currentEffect = eff.getEffectsBase().getIDString(); |
|
|
|
|
|
|
|
String newEffect = this.effectID; |
|
|
|
|
|
|
|
if (currentEffect.equals(newEffect) && !this.stackType.equals("Stun")) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
if (eff != null) { |
|
|
|
|
|
|
|
for (ActionsBase action : eff.getPower().getActions()) { |
|
|
|
|
|
|
|
if (this.stackType.equals(action.stackType) && this.stackOrder == action.stackOrder) { |
|
|
|
|
|
|
|
if (this.stackType.equals("NoStun")) { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (sameRank) { |
|
|
|
|
|
|
|
if (this.greaterThan && trains <= eff.getTrains()) |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
if (this.greaterThanEqual && trains < eff.getTrains()) |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
PlayerBonuses bonus = ac.getBonuses(); |
|
|
|
PlayerBonuses bonus = ac.getBonuses(); |
|
|
|
if (bonus == null) |
|
|
|
if (bonus == null) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
SourceType sourceType = null; |
|
|
|
//TODO make this more efficient then testing strings
|
|
|
|
try { |
|
|
|
if (this.stackType.equals("Stun") && bonus.getBool(ModType.ImmuneTo, SourceType.Stun)) |
|
|
|
sourceType = SourceType.GetSourceType(this.stackType); |
|
|
|
return true; //Currently stun immune. Skip stun
|
|
|
|
}catch(Exception ignored){ |
|
|
|
else if (this.stackType.equals("Snare") && bonus.getBool(ModType.ImmuneTo, SourceType.Snare)) |
|
|
|
} |
|
|
|
return true; //Currently snare immune. Skip snare
|
|
|
|
if(sourceType != null && (bonus.getBool(ModType.ImmuneTo,sourceType) || bonus.getBool(ModType.NoMod,sourceType))) |
|
|
|
else if (this.stackType.equals("Blindness") && bonus.getBool(ModType.ImmuneTo, SourceType.Blind)) |
|
|
|
return true; |
|
|
|
return true; //Currently blind immune. Skip blind
|
|
|
|
if(ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){ |
|
|
|
else if (this.stackType.equals("PowerInhibitor") && bonus.getBool(ModType.ImmuneTo, SourceType.Powerblock)) |
|
|
|
PlayerCharacter pc = (PlayerCharacter)ac; |
|
|
|
return true; //Currently power block immune. Skip power block
|
|
|
|
if(this.stackType.equals("Blindness") && pc.getRace().getName().contains("Shade")) |
|
|
|
else if (this.stackType.equals("Root") && bonus.getBool(ModType.ImmuneTo, SourceType.Root)) |
|
|
|
return true; |
|
|
|
|
|
|
|
if(this.stackType.equals("Stun") && pc.getRace().getName().contains("Minotaur")) |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(this.stackType.equals("Stun") && bonus.getBool(ModType.ImmuneTo,SourceType.Stun)) |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
if(pb.vampDrain() && bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN)) |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
// else if (pb.isHeal() && (bonus.getByte("immuneTo.Heal")) >= trains)
|
|
|
|
if (this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None)) |
|
|
|
// return true; //Currently shadowmantled. Skip heals
|
|
|
|
|
|
|
|
else if (this.stackType.equals("Flight") && bonus.getBool(ModType.NoMod, SourceType.Fly)) |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
else if (this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None)) |
|
|
|
if (this.stackType.equals("PowerInhibitor") && bonus.getBool(ModType.ImmuneTo, SourceType.Powerblock)) |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
else |
|
|
|
|
|
|
|
return pb.vampDrain() && bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|