From d7270ffb846e6ee946484f9ca053335d76293bd2 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 29 Aug 2024 20:12:48 -0500 Subject: [PATCH] group teleport restricted to active banes and active mines --- src/engine/gameManager/PowersManager.java | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/engine/gameManager/PowersManager.java b/src/engine/gameManager/PowersManager.java index 8ded28ec..984c2a2b 100644 --- a/src/engine/gameManager/PowersManager.java +++ b/src/engine/gameManager/PowersManager.java @@ -205,6 +205,41 @@ public enum PowersManager { boolean CSRCast = false; + if(msg.getPowerUsedID() == 430628895) { + + boolean failed = false;// group teleport + City city = ZoneManager.getCityAtLocation(playerCharacter.loc); + if (city == null) { + failed = true; + }else{ + Bane bane = city.getBane(); + if (bane == null) { + failed = true; + }else{ + if(!bane.getSiegePhase().equals(SiegePhase.WAR)){ + failed = true; + } + } + } + if(failed){ + //check to see if we are at an active mine + Zone zone = ZoneManager.findSmallestZone(playerCharacter.loc); + if(zone != null){ + Mine mine = null; + for(Building building : zone.zoneBuildingSet){ + if(building.getBlueprint().getBuildingGroup().equals(BuildingGroup.MINE)){ + mine = Mine.getMineFromTower(building.getObjectUUID()); + } + } + if(mine != null){ + failed = !mine.isActive; + } + } + } + + if(failed) + return false; + } if (MBServerStatics.POWERS_DEBUG) { ChatManager.chatSayInfo(