Propagate guardedCity.

This commit is contained in:
2023-08-25 16:44:45 -04:00
parent c39ed6120f
commit e67eff822d
2 changed files with 6 additions and 1 deletions
+3
View File
@@ -84,6 +84,9 @@ public class aiInfoCmd extends AbstractDevCmd {
else else
output += "Current Target: NULL" + newline; output += "Current Target: NULL" + newline;
if (mob.guardedCity != null)
output += mob.guardedCity.getCityName() + newline;
for (int token : mob.mobPowers.keySet()) for (int token : mob.mobPowers.keySet())
output += token + newline; output += token + newline;
+3 -1
View File
@@ -1696,6 +1696,7 @@ public class Mob extends AbstractIntelligenceAgent {
if (NPC.ISGuardCaptain(contract.getContractID())) { if (NPC.ISGuardCaptain(contract.getContractID())) {
this.spawnTime = 60 * 15; this.spawnTime = 60 * 15;
this.isPlayerGuard = true; this.isPlayerGuard = true;
this.guardedCity = ZoneManager.getCityAtLocation(this.building.getLoc());
} }
// Load AI for wall archers // Load AI for wall archers
@@ -1704,6 +1705,7 @@ public class Mob extends AbstractIntelligenceAgent {
this.behaviourType = MobBehaviourType.GuardWallArcher; this.behaviourType = MobBehaviourType.GuardWallArcher;
this.isPlayerGuard = true; this.isPlayerGuard = true;
this.spawnTime = 450; this.spawnTime = 450;
this.guardedCity = ZoneManager.getCityAtLocation(this.building.getLoc());
} }
// Load AI for guard dogs // Load AI for guard dogs
@@ -1712,7 +1714,7 @@ public class Mob extends AbstractIntelligenceAgent {
this.isPlayerGuard = true; this.isPlayerGuard = true;
this.behaviourType = MobBehaviourType.GuardCaptain; this.behaviourType = MobBehaviourType.GuardCaptain;
this.spawnTime = 900; this.spawnTime = 900;
this.guardedCity = ZoneManager.getCityAtLocation(this.bindLoc); this.guardedCity = ZoneManager.getCityAtLocation(this.building.getLoc());
} }
} }