/zerg command
This commit is contained in:
@@ -89,6 +89,11 @@ public enum ChatManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(msg.getMessage().equalsIgnoreCase("/zerg")){
|
||||||
|
ZergManager.PrintDetailsToClient(pc);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (protocolMsg) {
|
switch (protocolMsg) {
|
||||||
case CHATSAY:
|
case CHATSAY:
|
||||||
ChatManager.chatSay(pc, msg.getMessage(), isFlood);
|
ChatManager.chatSay(pc, msg.getMessage(), isFlood);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package engine.gameManager;
|
package engine.gameManager;
|
||||||
import engine.objects.Building;
|
import engine.InterestManagement.WorldGrid;
|
||||||
import engine.objects.Guild;
|
import engine.objects.*;
|
||||||
import engine.objects.Mine;
|
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
|
|
||||||
public class ZergManager {
|
public class ZergManager {
|
||||||
@@ -209,4 +208,42 @@ public class ZergManager {
|
|||||||
mine.zergTracker.processLeaveQue();
|
mine.zergTracker.processLeaveQue();
|
||||||
mine.zergTracker.applyMultiplier(mine.capSize);
|
mine.zergTracker.applyMultiplier(mine.capSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void PrintDetailsToClient(PlayerCharacter pc){
|
||||||
|
String outstring = "ZERG MANAGER DETAILS FOR: " + pc.getFirstName();
|
||||||
|
String newline = "\r\n ";
|
||||||
|
Mine attended = null;
|
||||||
|
for(Mine mine : Mine.getMines()){
|
||||||
|
Building tower = BuildingManager.getBuilding(mine.getBuildingID());
|
||||||
|
if(tower == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
float rangeSquared = (MBServerStatics.CHARACTER_LOAD_RANGE * 3) * (MBServerStatics.CHARACTER_LOAD_RANGE * 3);
|
||||||
|
|
||||||
|
if(pc.loc.distanceSquared(tower.loc) < rangeSquared){
|
||||||
|
attended = mine;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(attended != null){
|
||||||
|
outstring += "Mine Cap: " + attended.capSize;
|
||||||
|
Building tower = BuildingManager.getBuilding(attended.getBuildingID());
|
||||||
|
if(tower == null)
|
||||||
|
return;
|
||||||
|
int count = 1;
|
||||||
|
for(AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(tower.loc,MBServerStatics.CHARACTER_LOAD_RANGE * 3,MBServerStatics.MASK_PLAYER)){
|
||||||
|
PlayerCharacter player = (PlayerCharacter)awo;
|
||||||
|
if(player.equals(pc))
|
||||||
|
continue;
|
||||||
|
if(player.guild.getNation().equals(pc.guild.getNation()))
|
||||||
|
count ++;
|
||||||
|
}
|
||||||
|
outstring += "Nation Members Present " + count;
|
||||||
|
}else{
|
||||||
|
outstring += "Mine: Not Within Mine Distance";
|
||||||
|
}
|
||||||
|
|
||||||
|
outstring += "Zerg Multiplier: " + pc.ZergMultiplier;
|
||||||
|
|
||||||
|
ChatManager.chatSystemInfo(pc, outstring);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user