Browse Source

characters that attack city friendly buildings are added to cityOutlaws

combat-2
FatBoy-DOTC 1 year ago
parent
commit
1b92fa76e1
  1. 7
      src/engine/gameManager/CombatManager.java
  2. 9
      src/engine/objects/Building.java

7
src/engine/gameManager/CombatManager.java

@ -605,13 +605,6 @@ public enum CombatManager { @@ -605,13 +605,6 @@ public enum CombatManager {
defense = 0;
Building building = (Building) target;
City playerCity = ZoneManager.getCityAtLocation(building.getLoc());
if(playerCity != null){
if(!playerCity.cityOutlaws.contains(attacker.getObjectUUID()))
playerCity.cityOutlaws.add(attacker.getObjectUUID());
}
} else {
AbstractCharacter tar = (AbstractCharacter) target;
defense = tar.getDefenseRating();

9
src/engine/objects/Building.java

@ -537,6 +537,15 @@ public class Building extends AbstractWorldObject { @@ -537,6 +537,15 @@ public class Building extends AbstractWorldObject {
if (value < 0)
Mine.SendMineAttackMessage(this);
City playerCity = ZoneManager.getCityAtLocation(this.loc);
if(playerCity != null){
if(this.getGuild().getNation().equals(playerCity.getTOL().getGuild().getNation())){
//friendly building has been attacked, add attacker to city outlaw list
if(!playerCity.cityOutlaws.contains(attacker.getObjectUUID()))
playerCity.cityOutlaws.add(attacker.getObjectUUID());
}
}
return newHealth - oldHealth;

Loading…
Cancel
Save