Browse Source

track range changes

lakebane-master
FatBoy-DOTC 10 months ago
parent
commit
a32ba5e262
  1. 21
      src/engine/gameManager/PowersManager.java

21
src/engine/gameManager/PowersManager.java

@ -1461,6 +1461,27 @@ public enum PowersManager { @@ -1461,6 +1461,27 @@ public enum PowersManager {
HashSet<AbstractCharacter> trackChars = RangeBasedAwo.getTrackList(
allTargets, playerCharacter, maxTargets);
trackChars = new HashSet<>();
HashSet<AbstractWorldObject> allInRange = WorldGrid.getObjectsInRangePartial(playerCharacter.loc,MBServerStatics.CHARACTER_LOAD_RANGE,MBServerStatics.MASK_PLAYER);
ArrayList<Guild> nationsInRange = new ArrayList<>();
//first round to add players in range
for(AbstractWorldObject trackChar : allInRange){
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) {
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);
}
TrackWindowMsg trackWindowMsg = new TrackWindowMsg(msg);
// send track window

Loading…
Cancel
Save