Browse Source

track chaining for same nations

lakebane-master
FatBoy-DOTC 6 months ago
parent
commit
6e1db9489a
  1. 24
      src/engine/gameManager/PowersManager.java

24
src/engine/gameManager/PowersManager.java

@ -1577,7 +1577,7 @@ public enum PowersManager { @@ -1577,7 +1577,7 @@ public enum PowersManager {
trackChars = new HashSet<>();
HashSet<AbstractWorldObject> allInRange = WorldGrid.getObjectsInRangePartial(playerCharacter.loc,MBServerStatics.CHARACTER_LOAD_RANGE,MBServerStatics.MASK_PLAYER);
ArrayList<Guild> nationsInRange = new ArrayList<>();
//ArrayList<Guild> nationsInRange = new ArrayList<>();
ArrayList<AbstractWorldObject> purgeList = new ArrayList<>();
for(AbstractWorldObject trackChar : allInRange) {
if(trackChar.equals(playerCharacter) || !trackChar.isAlive() || !((PlayerCharacter)trackChar).isActive())
@ -1592,24 +1592,24 @@ public enum PowersManager { @@ -1592,24 +1592,24 @@ public enum PowersManager {
continue;
if(allInRange.contains(trackChar)) {
trackChars.add((AbstractCharacter)trackChar);
Guild nation = ((AbstractCharacter)trackChar).guild.getNation();
if(nationsInRange.contains(nation) == false)
nationsInRange.add(nation);
}
}
//second round add all others in window if they share a nation with a current
for(AbstractWorldObject trackChar : allInRange) {
//track full range for chaining nation members
ArrayList<Guild> nationsInRange = new ArrayList<>();
for(AbstractCharacter pc : trackChars){
if(nationsInRange.contains(pc.guild.getNation()) == false)
nationsInRange.add(pc.guild.getNation());
}
HashSet<AbstractWorldObject> fullRange = WorldGrid.getObjectsInRangePartial(playerCharacter.loc,1024,MBServerStatics.MASK_PLAYER);
for(AbstractWorldObject trackChar : fullRange) {
if(trackChar.equals(playerCharacter) || !trackChar.isAlive() || !((PlayerCharacter)trackChar).isActive())
continue;
Guild nation = ((AbstractCharacter) trackChar).guild.getNation();
if (allInRange.contains(trackChar) == true && nationsInRange.add(nation) == true && trackChars.contains(trackChar) == false)
trackChars.add((AbstractCharacter) trackChar);
else if(((AbstractCharacter) trackChar).guild.getNation().equals(playerCharacter.guild.getNation()))
trackChars.add((AbstractCharacter) trackChar);
if(nationsInRange.contains(((PlayerCharacter) trackChar).guild.getNation()) && trackChars.contains(trackChar) == false)
trackChars.add((AbstractCharacter)trackChar);
}
TrackWindowMsg trackWindowMsg = new TrackWindowMsg(msg);
// send track window

Loading…
Cancel
Save