Hub UHC countdown basics
UHC MOTD timer stuff
This commit is contained in:
parent
b5152bd621
commit
5de59b6e0e
@ -36,6 +36,8 @@ public abstract class OutfitGadget extends Gadget
|
||||
{
|
||||
Manager.RemoveMorph(player);
|
||||
|
||||
Manager.RemoveOutfit(player, _slot);
|
||||
|
||||
_active.add(player);
|
||||
|
||||
UtilPlayer.message(player, F.main("Gadget", "You put on " + F.elem(GetName()) + "."));
|
||||
@ -60,7 +62,7 @@ public abstract class OutfitGadget extends Gadget
|
||||
|
||||
UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(GetName()) + "."));
|
||||
|
||||
if (_slot == ArmorSlot.Helmet) player.getInventory().setHelmet(null);
|
||||
if (_slot == ArmorSlot.Helmet) player.getInventory().setHelmet(null);
|
||||
else if (_slot == ArmorSlot.Chest) player.getInventory().setChestplate(null);
|
||||
else if (_slot == ArmorSlot.Legs) player.getInventory().setLeggings(null);
|
||||
else if (_slot == ArmorSlot.Boots) player.getInventory().setBoots(null);
|
||||
|
@ -82,6 +82,7 @@ import mineplex.hub.modules.MapManager;
|
||||
import mineplex.hub.modules.NewsManager;
|
||||
import mineplex.hub.modules.ParkourManager;
|
||||
import mineplex.hub.modules.TextManager;
|
||||
import mineplex.hub.modules.UHCManager;
|
||||
import mineplex.hub.modules.VisibilityManager;
|
||||
import mineplex.hub.modules.WorldManager;
|
||||
import mineplex.hub.party.Party;
|
||||
@ -152,6 +153,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
new MapManager(this);
|
||||
new WorldManager(this);
|
||||
new JumpManager(this);
|
||||
new UHCManager(this);
|
||||
|
||||
_news = new NewsManager(this);
|
||||
|
||||
|
@ -162,14 +162,14 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
|
||||
}
|
||||
else
|
||||
{
|
||||
if (serverInfo.CurrentPlayers >= serverInfo.MaxPlayers && !ownsUltraPackage)
|
||||
{
|
||||
lore.add(MESSAGE_FULL_GET_ULTRA);
|
||||
}
|
||||
else
|
||||
{
|
||||
lore.add(MESSAGE_JOIN);
|
||||
}
|
||||
if (serverInfo.CurrentPlayers >= serverInfo.MaxPlayers && !ownsUltraPackage)
|
||||
{
|
||||
lore.add(MESSAGE_FULL_GET_ULTRA);
|
||||
}
|
||||
else
|
||||
{
|
||||
lore.add(MESSAGE_JOIN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.Game.GameState;
|
||||
import nautilus.game.arcade.game.GameServerConfig;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.games.uhc.UHC;
|
||||
import nautilus.game.arcade.managers.*;
|
||||
import nautilus.game.arcade.shop.ArcadeShop;
|
||||
import nautilus.game.arcade.world.FireworkHandler;
|
||||
@ -468,11 +469,18 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
String extrainformation = "|" + _serverConfig.ServerType + "|" + (_game == null ? "Unknown" : _game.GetName())
|
||||
+ "|" + ((_game == null || _game.WorldData == null) ? "Unknown" : _game.WorldData.MapName);
|
||||
|
||||
//Always Joinable
|
||||
if (_game.JoinInProgress)
|
||||
{
|
||||
event.setMotd(ChatColor.GREEN + "Recruiting" + extrainformation);
|
||||
}
|
||||
if (_game == null || _game.GetState() == GameState.Recruit)
|
||||
//UHC Timed
|
||||
else if (_game != null && _game.GetType() == GameType.UHC)
|
||||
{
|
||||
event.setMotd(((UHC)_game).getMotdStatus() + extrainformation);
|
||||
}
|
||||
//Recruiting
|
||||
else if (_game == null || _game.GetState() == GameState.Recruit)
|
||||
{
|
||||
if (_game != null && _game.GetCountdown() != -1)
|
||||
{
|
||||
@ -483,6 +491,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
event.setMotd(ChatColor.GREEN + "Recruiting" + extrainformation);
|
||||
}
|
||||
}
|
||||
//In Progress
|
||||
else
|
||||
{
|
||||
event.setMotd(ChatColor.YELLOW + "In Progress" + extrainformation);
|
||||
|
@ -385,8 +385,14 @@ public class MineStrike extends TeamGame
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Player other : team.GetPlayers(false))
|
||||
if (!other.equals(player))
|
||||
UtilPlayer.message(other, C.cGold + C.Bold + player.getName() + " picked up the Bomb!");
|
||||
|
||||
UtilPlayer.message(player, C.cGold + C.Bold + "You picked up the Bomb!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
player.playSound(player.getLocation(), Sound.NOTE_PLING, 1f, 2f);
|
||||
_bombHolder = player;
|
||||
|
@ -1090,4 +1090,21 @@ public class UHC extends TeamGame
|
||||
|
||||
return health;
|
||||
}
|
||||
|
||||
public String getMotdStatus()
|
||||
{
|
||||
long hour = 3600000;
|
||||
|
||||
if (InProgress())
|
||||
{
|
||||
return ChatColor.YELLOW + "In Progress";
|
||||
}
|
||||
|
||||
if (System.currentTimeMillis() % hour < 60000)
|
||||
{
|
||||
return ChatColor.GREEN + "Recruiting";
|
||||
}
|
||||
|
||||
return ChatColor.GOLD + "Starting in " + UtilTime.MakeStr(hour - (System.currentTimeMillis() % hour));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user