|
|
@ -326,8 +326,6 @@ public class Mine extends AbstractGameObject { |
|
|
|
// all the requirements to claim; landed
|
|
|
|
// all the requirements to claim; landed
|
|
|
|
// guild with a warehouse, etc.
|
|
|
|
// guild with a warehouse, etc.
|
|
|
|
|
|
|
|
|
|
|
|
Guild playerGuild; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//verify the player exists
|
|
|
|
//verify the player exists
|
|
|
|
|
|
|
|
|
|
|
|
if (playerCharacter == null) |
|
|
|
if (playerCharacter == null) |
|
|
@ -335,7 +333,7 @@ public class Mine extends AbstractGameObject { |
|
|
|
|
|
|
|
|
|
|
|
//verify the player is in valid guild
|
|
|
|
//verify the player is in valid guild
|
|
|
|
|
|
|
|
|
|
|
|
playerGuild = playerCharacter.getGuild(); |
|
|
|
Guild playerGuild = playerCharacter.getGuild(); |
|
|
|
|
|
|
|
|
|
|
|
// Can't claim something if you don't have a guild!
|
|
|
|
// Can't claim something if you don't have a guild!
|
|
|
|
|
|
|
|
|
|
|
@ -357,40 +355,9 @@ public class Mine extends AbstractGameObject { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Number of mines is based on the rank of the nation's tree.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
City nationCapitol = playerGuild.getNation().getOwnedCity(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Building nationCapitolTOL = nationCapitol.getTOL(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (nationCapitolTOL == null) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//int treeRank = nationCapitolTOL.getRank();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if (treeRank < 1)
|
|
|
|
|
|
|
|
// return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if (guildUnderMineLimit(playerGuild.getNation(), treeRank) == false) {
|
|
|
|
|
|
|
|
// ErrorPopupMsg.sendErrorMsg(playerCharacter, "Your nation cannot support another mine.");
|
|
|
|
|
|
|
|
// return false;
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static boolean guildUnderMineLimit(Guild playerGuild, int tolRank) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int mineCnt = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mineCnt += Mine.getMinesForGuild(playerGuild.getObjectUUID()).size(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Guild guild : playerGuild.getSubGuildList()) |
|
|
|
|
|
|
|
mineCnt += Mine.getMinesForGuild(guild.getObjectUUID()).size(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return mineCnt <= tolRank; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean changeProductionType(Resource resource) { |
|
|
|
public boolean changeProductionType(Resource resource) { |
|
|
|
//if (!this.validForMine(resource))
|
|
|
|
//if (!this.validForMine(resource))
|
|
|
|
// return false;
|
|
|
|
// return false;
|
|
|
|