Browse Source

Minor cleanup

combat-2
MagicBot 6 months ago
parent
commit
52e0b5be4d
  1. 44
      src/engine/gameManager/GuildManager.java

44
src/engine/gameManager/GuildManager.java

@ -99,6 +99,7 @@ public enum GuildManager {
DispatchMessage.sendToAllInRange(playerCharacter, new GuildInfoMsg(playerCharacter, guild, 2)); DispatchMessage.sendToAllInRange(playerCharacter, new GuildInfoMsg(playerCharacter, guild, 2));
// Send guild join message // Send guild join message
ChatManager.chatGuildInfo(playerCharacter, ChatManager.chatGuildInfo(playerCharacter,
playerCharacter.getFirstName() + " has joined the guild"); playerCharacter.getFirstName() + " has joined the guild");
@ -108,44 +109,44 @@ public enum GuildManager {
// TODO update player to world // TODO update player to world
} }
public static void enterWorldMOTD(PlayerCharacter pc) { public static void enterWorldMOTD(PlayerCharacter playerCharacter) {
Guild guild; Guild guild;
Guild nation; Guild nation;
if (pc == null) { if (playerCharacter == null)
return; return;
}
guild = pc.getGuild(); guild = playerCharacter.getGuild();
if (guild == null || guild.getObjectUUID() == 0) // Don't send to errant if (guild == null || guild.getObjectUUID() == 0) // Don't send to errant
return; return;
// Send Guild MOTD // Send Guild MOTD
String motd = guild.getMOTD(); String motd = guild.getMOTD();
if (motd.length() > 0) {
ChatManager.chatGuildMOTD(pc, motd); if (!motd.isEmpty())
} ChatManager.chatGuildMOTD(playerCharacter, motd);
// Send Nation MOTD // Send Nation MOTD
nation = guild.getNation(); nation = guild.getNation();
if (nation != null) { if (nation != null)
if (nation.getObjectUUID() != 0) { // Don't send to errant nation if (nation.getObjectUUID() != 0) { // Don't send to errant nation
motd = nation.getMOTD(); motd = nation.getMOTD();
if (motd.length() > 0) {
ChatManager.chatNationMOTD(pc, motd); if (!motd.isEmpty())
} ChatManager.chatNationMOTD(playerCharacter, motd);
} }
}
// Send IC MOTD if player is IC // Send IC MOTD if player is IC
if (GuildStatusController.isInnerCouncil(pc.getGuildStatus())) { if (GuildStatusController.isInnerCouncil(playerCharacter.getGuildStatus())) {
motd = guild.getICMOTD(); motd = guild.getICMOTD();
if (motd.length() > 0) {
ChatManager.chatICMOTD(pc, motd); if (!motd.isEmpty())
} ChatManager.chatICMOTD(playerCharacter, motd);
} }
} }
@ -156,12 +157,8 @@ public enum GuildManager {
if (guild == null) if (guild == null)
return; return;
int cityID = (city != null) ? city.getObjectUUID() : 0;
//update binds ingame //update binds ingame
for (PlayerCharacter playerCharacter : Guild.GuildRoster(guild)) { for (PlayerCharacter playerCharacter : Guild.GuildRoster(guild)) {
boolean updateBindBuilding = false; boolean updateBindBuilding = false;
@ -170,7 +167,6 @@ public enum GuildManager {
if (oldBoundBuilding == null || oldBoundBuilding.getBlueprint() == null || oldBoundBuilding.getBlueprint().getBuildingGroup().equals(BuildingGroup.TOL)) if (oldBoundBuilding == null || oldBoundBuilding.getBlueprint() == null || oldBoundBuilding.getBlueprint().getBuildingGroup().equals(BuildingGroup.TOL))
updateBindBuilding = true; updateBindBuilding = true;
if (updateBindBuilding) { if (updateBindBuilding) {
Building bindBuilding = null; Building bindBuilding = null;
if (city != null) if (city != null)
@ -183,7 +179,6 @@ public enum GuildManager {
playerCharacter.setBindBuildingID(bindBuilding != null ? bindBuilding.getObjectUUID() : 0); playerCharacter.setBindBuildingID(bindBuilding != null ? bindBuilding.getObjectUUID() : 0);
} }
} }
} }
@ -193,12 +188,9 @@ public enum GuildManager {
if (guild == null) if (guild == null)
return; return;
for (PlayerCharacter player : SessionManager.getAllActivePlayerCharacters()) { for (PlayerCharacter player : SessionManager.getAllActivePlayerCharacters())
if (player.getGuild().equals(guild)) if (player.getGuild().equals(guild))
DispatchMessage.sendToAllInRange(player, new GuildInfoMsg(player, guild, 2)); DispatchMessage.sendToAllInRange(player, new GuildInfoMsg(player, guild, 2));
}
} }
public static Boolean meetsLoreRequirements(Guild guild, PlayerCharacter player) { public static Boolean meetsLoreRequirements(Guild guild, PlayerCharacter player) {

Loading…
Cancel
Save