Browse Source

Prior claims are released upon a new claim.

master
MagicBot 2 years ago
parent
commit
3ec16d04d6
  1. 13
      src/engine/objects/Mine.java
  2. 4
      src/engine/powers/poweractions/ClaimMinePowerAction.java

13
src/engine/objects/Mine.java

@ -128,6 +128,17 @@ public class Mine extends AbstractGameObject {
} }
public static void releaseMineClaims(PlayerCharacter playerCharacter) {
for (Mine mine : Mine.getMines()) {
if (mine.lastClaimer.equals(playerCharacter)) {
mine.lastClaimer = null;
mine.updateGuildOwner(null);
}
}
}
public static void SendMineAttackMessage(Building mine) { public static void SendMineAttackMessage(Building mine) {
if (mine.getBlueprint() == null) if (mine.getBlueprint() == null)
@ -561,7 +572,6 @@ public class Mine extends AbstractGameObject {
return true; return true;
} }
public boolean depositMineResources() { public boolean depositMineResources() {
if (this.owningGuild.isErrant()) if (this.owningGuild.isErrant())
@ -664,7 +674,6 @@ public class Mine extends AbstractGameObject {
} }
} }
return (int) totalModded; return (int) totalModded;
} }
} }

4
src/engine/powers/poweractions/ClaimMinePowerAction.java

@ -50,6 +50,10 @@ public class ClaimMinePowerAction extends AbstractPowerAction {
if (mine == null) if (mine == null)
return; return;
// Release prior claims
Mine.releaseMineClaims(playerCharacter);
if (mine.claimMine(playerCharacter) == true) if (mine.claimMine(playerCharacter) == true)
ChatManager.sendSystemMessage( (PlayerCharacter) source, "You successfully claimed this mine.."); ChatManager.sendSystemMessage( (PlayerCharacter) source, "You successfully claimed this mine..");
} }

Loading…
Cancel
Save