PvE flagged system
This commit is contained in:
@@ -101,6 +101,10 @@ public enum CombatManager {
|
|||||||
|
|
||||||
public static void AttackTarget(PlayerCharacter playerCharacter, AbstractWorldObject target) {
|
public static void AttackTarget(PlayerCharacter playerCharacter, AbstractWorldObject target) {
|
||||||
|
|
||||||
|
if(playerCharacter != null && playerCharacter.isBoxed)
|
||||||
|
if(target.getObjectType().equals(GameObjectType.PlayerCharacter))
|
||||||
|
return;
|
||||||
|
|
||||||
boolean swingOffhand = false;
|
boolean swingOffhand = false;
|
||||||
|
|
||||||
//check my weapon can I do an offhand attack
|
//check my weapon can I do an offhand attack
|
||||||
|
|||||||
@@ -173,8 +173,7 @@ public enum PowersManager {
|
|||||||
if(!pc.isFlying() && powersBaseByToken.get(msg.getPowerUsedID()) != null && powersBaseByToken.get(msg.getPowerUsedID()).isSpell) //cant be sitting if flying
|
if(!pc.isFlying() && powersBaseByToken.get(msg.getPowerUsedID()) != null && powersBaseByToken.get(msg.getPowerUsedID()).isSpell) //cant be sitting if flying
|
||||||
CombatManager.toggleSit(false,origin);
|
CombatManager.toggleSit(false,origin);
|
||||||
|
|
||||||
if(pc.isMoving())
|
|
||||||
pc.stopMovement(pc.getMovementLoc());
|
|
||||||
if(msg.getPowerUsedID() != 421084024 && origin.getPlayerCharacter().getPromotionClassID() != 2513) {
|
if(msg.getPowerUsedID() != 421084024 && origin.getPlayerCharacter().getPromotionClassID() != 2513) {
|
||||||
if (!origin.getPlayerCharacter().getPowers().containsKey(msg.getPowerUsedID())) {
|
if (!origin.getPlayerCharacter().getPowers().containsKey(msg.getPowerUsedID())) {
|
||||||
Logger.error(origin.getPlayerCharacter().getFirstName() + " attempted to cast a power they do not have");
|
Logger.error(origin.getPlayerCharacter().getFirstName() + " attempted to cast a power they do not have");
|
||||||
@@ -1094,7 +1093,7 @@ public enum PowersManager {
|
|||||||
continue;
|
continue;
|
||||||
// If something blocks the action, then stop
|
// If something blocks the action, then stop
|
||||||
|
|
||||||
if (ab.blocked(target, pb, trains)) {
|
if (ab.blocked(target, pb, trains,playerCharacter)) {
|
||||||
|
|
||||||
PowersManager.sendEffectMsg(playerCharacter, 5, ab, pb);
|
PowersManager.sendEffectMsg(playerCharacter, 5, ab, pb);
|
||||||
continue;
|
continue;
|
||||||
@@ -1281,7 +1280,7 @@ public enum PowersManager {
|
|||||||
continue;
|
continue;
|
||||||
// If something blocks the action, then stop
|
// If something blocks the action, then stop
|
||||||
|
|
||||||
if (ab.blocked(target, pb, trains))
|
if (ab.blocked(target, pb, trains,caster))
|
||||||
continue;
|
continue;
|
||||||
// TODO handle overwrite stack order here
|
// TODO handle overwrite stack order here
|
||||||
String stackType = ab.getStackType();
|
String stackType = ab.getStackType();
|
||||||
@@ -1900,7 +1899,7 @@ public enum PowersManager {
|
|||||||
if (trains < ab.getMinTrains() || trains > ab.getMaxTrains())
|
if (trains < ab.getMinTrains() || trains > ab.getMaxTrains())
|
||||||
continue;
|
continue;
|
||||||
// If something blocks the action, then stop
|
// If something blocks the action, then stop
|
||||||
if (ab.blocked(target, pb, trains))
|
if (ab.blocked(target, pb, trains,ac))
|
||||||
// sendPowerMsg(pc, 5, msg);
|
// sendPowerMsg(pc, 5, msg);
|
||||||
continue;
|
continue;
|
||||||
// TODO handle overwrite stack order here
|
// TODO handle overwrite stack order here
|
||||||
|
|||||||
@@ -5145,9 +5145,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
@Override
|
@Override
|
||||||
public void update(Boolean newSystem) {
|
public void update(Boolean newSystem) {
|
||||||
|
|
||||||
if(!newSystem)
|
this.updateLocation();
|
||||||
this.updateLocation();
|
|
||||||
|
|
||||||
this.updateMovementState();
|
this.updateMovementState();
|
||||||
|
|
||||||
if(!newSystem)
|
if(!newSystem)
|
||||||
@@ -5198,8 +5196,11 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isBoxed && !this.containsEffect(1672601862)) {
|
if (this.isBoxed && !this.containsEffect(-654906771)) {
|
||||||
PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false);
|
PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, -935138707, 40, false);
|
||||||
|
}else if(!this.isBoxed && this.containsEffect(-654906771)){
|
||||||
|
this.effects.remove("PvE-Flagged");
|
||||||
|
this.effects.remove("1258");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.isFlying()) {
|
if (this.isFlying()) {
|
||||||
|
|||||||
@@ -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; //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;
|
return true;
|
||||||
// else if (pb.isHeal() && (bonus.getByte("immuneTo.Heal")) >= trains)
|
if(ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){
|
||||||
// return true; //Currently shadowmantled. Skip heals
|
PlayerCharacter pc = (PlayerCharacter)ac;
|
||||||
else if (this.stackType.equals("Flight") && bonus.getBool(ModType.NoMod, SourceType.Fly))
|
if(this.stackType.equals("Blindness") && pc.getRace().getName().contains("Shade"))
|
||||||
|
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;
|
return true;
|
||||||
else if (this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None))
|
if(pb.vampDrain() && bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN))
|
||||||
|
return true;
|
||||||
|
if (this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None))
|
||||||
|
return true;
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user