Added SSM Team Game
This commit is contained in:
parent
aa206d9c91
commit
d695ec72ca
@ -27,6 +27,7 @@ import nautilus.game.arcade.game.games.quiver.Quiver;
|
||||
import nautilus.game.arcade.game.games.runner.Runner;
|
||||
import nautilus.game.arcade.game.games.sheep.SheepGame;
|
||||
import nautilus.game.arcade.game.games.smash.SuperSmash;
|
||||
import nautilus.game.arcade.game.games.smash.SuperSmashTeam;
|
||||
import nautilus.game.arcade.game.games.snake.Snake;
|
||||
import nautilus.game.arcade.game.games.snowfight.SnowFight;
|
||||
import nautilus.game.arcade.game.games.spleef.Spleef;
|
||||
@ -72,6 +73,7 @@ public class GameFactory
|
||||
else if (gameType == GameType.SnowFight) return new SnowFight(_manager);
|
||||
else if (gameType == GameType.Sheep) return new SheepGame(_manager);
|
||||
else if (gameType == GameType.Smash) return new SuperSmash(_manager);
|
||||
else if (gameType == GameType.SmashTeams) return new SuperSmashTeam(_manager);
|
||||
else if (gameType == GameType.Snake) return new Snake(_manager);
|
||||
else if (gameType == GameType.Spleef) return new Spleef(_manager);
|
||||
else if (gameType == GameType.SquidShooter) return new SquidShooter(_manager);
|
||||
|
@ -28,6 +28,7 @@ public enum GameType
|
||||
Runner("Runner"),
|
||||
Sheep("Sheep Quest"),
|
||||
Smash("Super Smash Mobs"),
|
||||
SmashTeams("Super Smash Mobs Teams"),
|
||||
Snake("Snake"),
|
||||
SnowFight("Snow Fight"),
|
||||
Spleef("Super Spleef"),
|
||||
|
@ -149,7 +149,6 @@ public abstract class TeamGame extends Game
|
||||
teamsAlive.add(team);
|
||||
}
|
||||
|
||||
|
||||
if (teamsAlive.size() <= 1)
|
||||
{
|
||||
//Announce
|
||||
|
@ -0,0 +1,386 @@
|
||||
package nautilus.game.arcade.game.games.smash;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.BlockFadeEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.ArcadeFormat;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.Game.GameState;
|
||||
import nautilus.game.arcade.game.GameTeam.PlayerState;
|
||||
import nautilus.game.arcade.game.TeamGame;
|
||||
import nautilus.game.arcade.game.games.smash.kits.*;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
|
||||
public class SuperSmashTeam extends TeamGame
|
||||
{
|
||||
private HashMap<Player, Integer> _lives = new HashMap<Player, Integer>();
|
||||
|
||||
private ArrayList<String> _lastScoreboard = new ArrayList<String>();
|
||||
|
||||
public SuperSmashTeam(ArcadeManager manager)
|
||||
{
|
||||
super(manager, GameType.SmashTeams,
|
||||
|
||||
new Kit[]
|
||||
{
|
||||
|
||||
new KitSkeleton(manager),
|
||||
new KitGolem(manager),
|
||||
new KitSpider(manager),
|
||||
new KitSlime(manager),
|
||||
|
||||
new KitCreeper(manager),
|
||||
new KitEnderman(manager),
|
||||
new KitSnowman(manager),
|
||||
new KitWolf(manager),
|
||||
|
||||
|
||||
new KitBlaze(manager),
|
||||
new KitWitch(manager),
|
||||
new KitChicken(manager),
|
||||
new KitSkeletalHorse(manager),
|
||||
new KitPig(manager),
|
||||
new KitSkySquid(manager),
|
||||
new KitWitherSkeleton(manager),
|
||||
new KitMagmaCube(manager),
|
||||
|
||||
|
||||
},
|
||||
|
||||
new String[]
|
||||
{
|
||||
"Each player has 3 respawns",
|
||||
"Attack to restore hunger!",
|
||||
"Last player alive wins!"
|
||||
|
||||
});
|
||||
|
||||
this.DeathOut = false;
|
||||
|
||||
this.DamageTeamSelf = true;
|
||||
|
||||
this.CompassEnabled = true;
|
||||
|
||||
this.SpawnDistanceRequirement = 16;
|
||||
|
||||
this.InventoryOpen = false;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void GameStateChange(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.Prepare)
|
||||
return;
|
||||
|
||||
for (Player player : GetPlayers(true))
|
||||
_lives.put(player, 4);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void PlayerOut(PlayerDeathEvent event)
|
||||
{
|
||||
if (!LoseLife(event.getEntity()))
|
||||
{
|
||||
this.SetPlayerState(event.getEntity(), PlayerState.OUT);
|
||||
}
|
||||
}
|
||||
|
||||
private int GetLives(Player player)
|
||||
{
|
||||
if (!_lives.containsKey(player))
|
||||
return 0;
|
||||
|
||||
if (!IsAlive(player))
|
||||
return 0;
|
||||
|
||||
return _lives.get(player);
|
||||
}
|
||||
|
||||
private boolean LoseLife(Player player)
|
||||
{
|
||||
int lives = GetLives(player) - 1;
|
||||
|
||||
if (lives > 0)
|
||||
{
|
||||
UtilPlayer.message(player, C.cRed + C.Bold + "You have died!");
|
||||
UtilPlayer.message(player, C.cRed + C.Bold + "You have " + lives + " lives left!");
|
||||
player.playSound(player.getLocation(), Sound.NOTE_BASS_GUITAR, 2f, 0.5f);
|
||||
|
||||
_lives.put(player, lives);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilPlayer.message(player, C.cRed + C.Bold + "You are out of the game!");
|
||||
player.playSound(player.getLocation(), Sound.EXPLODE, 2f, 1f);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler
|
||||
public void ScoreboardUpdate(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
return;
|
||||
|
||||
//Wipe Last
|
||||
for (String string : _lastScoreboard)
|
||||
{
|
||||
GetScoreboard().resetScores(Bukkit.getOfflinePlayer(string));
|
||||
}
|
||||
_lastScoreboard.clear();
|
||||
|
||||
if (GetPlayers(true).size() > 12)
|
||||
{
|
||||
for (GameTeam team : this.GetTeamList())
|
||||
{
|
||||
String out = team.GetPlayers(true).size() + " " + team.GetFormattedName();
|
||||
if (out.length() >= 16)
|
||||
out = out.substring(0, 15);
|
||||
|
||||
_lastScoreboard.add(out);
|
||||
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore(team.GetPlayers(true).size());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Write New
|
||||
for (Player player : GetPlayers(true))
|
||||
{
|
||||
int lives = GetLives(player);
|
||||
|
||||
String out = lives + " " + GetTeam(player).GetColor() + player.getName();
|
||||
if (lives <= 0)
|
||||
continue;
|
||||
|
||||
if (out.length() >= 16)
|
||||
out = out.substring(0, 15);
|
||||
|
||||
_lastScoreboard.add(out);
|
||||
|
||||
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore(lives);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void FallDamage(CustomDamageEvent event)
|
||||
{
|
||||
if (event.IsCancelled())
|
||||
return;
|
||||
|
||||
if (event.GetCause() == DamageCause.FALL)
|
||||
event.SetCancelled("No Fall Damage");
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void Knockback(CustomDamageEvent event)
|
||||
{
|
||||
if (event.IsCancelled())
|
||||
return;
|
||||
|
||||
if (event.GetDamageePlayer() != null)
|
||||
event.AddKnockback("Smash Knockback", 1 + 0.1 * (20 - event.GetDamageePlayer().getHealth()));
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void ArenaWalls(CustomDamageEvent event)
|
||||
{
|
||||
if (event.IsCancelled())
|
||||
return;
|
||||
|
||||
if (event.GetCause() == DamageCause.VOID || event.GetCause() == DamageCause.LAVA)
|
||||
{
|
||||
event.GetDamageeEntity().eject();
|
||||
event.GetDamageeEntity().leaveVehicle();
|
||||
|
||||
if (event.GetDamageePlayer() != null)
|
||||
event.GetDamageeEntity().getWorld().strikeLightningEffect(event.GetDamageeEntity().getLocation());
|
||||
|
||||
event.AddMod("Smash", "Super Smash Mobs", 5000, false);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void HealthChange(EntityRegainHealthEvent event)
|
||||
{
|
||||
if (event.getRegainReason() == RegainReason.SATIATED)
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void EntityDeath(EntityDeathEvent event)
|
||||
{
|
||||
event.getDrops().clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void SetKit(Player player, Kit kit, boolean announce)
|
||||
{
|
||||
GameTeam team = GetTeam(player);
|
||||
if (team != null)
|
||||
{
|
||||
if (!team.KitAllowed(kit))
|
||||
{
|
||||
player.playSound(player.getLocation(), Sound.NOTE_BASS, 2f, 0.5f);
|
||||
UtilPlayer.message(player, F.main("Kit", F.elem(team.GetFormattedName()) + " cannot use " + F.elem(kit.GetFormattedName() + " Kit") + "."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_playerKit.put(player, kit);
|
||||
|
||||
if (announce)
|
||||
{
|
||||
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 2f, 1f);
|
||||
UtilPlayer.message(player, F.main("Kit", "You equipped " + F.elem(kit.GetFormattedName() + " Kit") + "."));
|
||||
kit.ApplyKit(player);
|
||||
UtilInv.Update(player);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void AbilityDescription(PlayerInteractEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (player.getItemInHand() == null)
|
||||
return;
|
||||
|
||||
if (player.getItemInHand().getItemMeta() == null)
|
||||
return;
|
||||
|
||||
if (player.getItemInHand().getItemMeta().getDisplayName() == null)
|
||||
return;
|
||||
|
||||
if (player.getItemInHand().getItemMeta().getLore() == null)
|
||||
return;
|
||||
|
||||
if (Manager.GetGame() == null || Manager.GetGame().GetState() != GameState.Recruit)
|
||||
return;
|
||||
|
||||
for (int i=player.getItemInHand().getItemMeta().getLore().size() ; i<=7 ; i++)
|
||||
UtilPlayer.message(player, " ");
|
||||
|
||||
UtilPlayer.message(player, ArcadeFormat.Line);
|
||||
|
||||
UtilPlayer.message(player, "§aAbility - §f§l" + player.getItemInHand().getItemMeta().getDisplayName());
|
||||
|
||||
//Perk Descs
|
||||
for (String line : player.getItemInHand().getItemMeta().getLore())
|
||||
{
|
||||
UtilPlayer.message(player, line);
|
||||
}
|
||||
|
||||
UtilPlayer.message(player, ArcadeFormat.Line);
|
||||
|
||||
player.playSound(player.getLocation(), Sound.NOTE_PLING, 1f, 2f);
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void ExplosionDamageCancel(EntityDamageEvent event)
|
||||
{
|
||||
if (event.getCause() == DamageCause.ENTITY_EXPLOSION || event.getCause() == DamageCause.BLOCK_EXPLOSION)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public double GetKillsGems(Player killer, Player killed, boolean assist)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void BlockFade(BlockFadeEvent event)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
private int hungerTick = 0;
|
||||
@EventHandler
|
||||
public void Hunger(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SEC)
|
||||
return;
|
||||
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
hungerTick = (hungerTick + 1)%10;
|
||||
|
||||
for (Player player : GetPlayers(true))
|
||||
{
|
||||
player.setSaturation(3f);
|
||||
player.setExhaustion(0f);
|
||||
|
||||
if (player.getFoodLevel() <= 0)
|
||||
{
|
||||
Manager.GetDamage().NewDamageEvent(player, null, null,
|
||||
DamageCause.STARVATION, 1, false, true, false,
|
||||
"Starvation", GetName());
|
||||
|
||||
UtilPlayer.message(player, F.main("Game", "Attack other players to restore hunger!"));
|
||||
}
|
||||
|
||||
if (hungerTick == 0)
|
||||
UtilPlayer.hunger(player, -1);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void HungerRestore(CustomDamageEvent event)
|
||||
{
|
||||
|
||||
if (event.IsCancelled())
|
||||
return;
|
||||
|
||||
if (event.GetDamagerPlayer(true) == null)
|
||||
return;
|
||||
|
||||
Player damager = event.GetDamagerPlayer(true);
|
||||
if (damager == null)
|
||||
return;
|
||||
|
||||
if (!Recharge.Instance.use(damager, "Hunger Restore", 250, false))
|
||||
return;
|
||||
|
||||
int amount = Math.max(1, (int)(event.GetDamage()/2));
|
||||
UtilPlayer.hunger(damager, amount);
|
||||
}
|
||||
}
|
@ -78,7 +78,12 @@ public class KitBlaze extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguiseBlaze disguise = new DisguiseBlaze(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
}
|
||||
|
@ -80,7 +80,12 @@ public class KitChicken extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguiseChicken disguise = new DisguiseChicken(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
}
|
||||
|
@ -61,7 +61,12 @@ public class KitCow extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguiseCow disguise = new DisguiseCow(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
}
|
||||
|
@ -86,7 +86,12 @@ public class KitCreeper extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguiseCreeper disguise = new DisguiseCreeper(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
}
|
||||
|
@ -85,7 +85,12 @@ public class KitEnderman extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguiseEnderman disguise = new DisguiseEnderman(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
disguise.a(false);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
|
@ -66,7 +66,12 @@ public class KitGolem extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguiseIronGolem disguise = new DisguiseIronGolem(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
}
|
||||
|
@ -93,7 +93,12 @@ public class KitKnight extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguiseSkeleton disguise = new DisguiseSkeleton(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
|
||||
|
@ -71,7 +71,12 @@ public class KitMagmaCube extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguiseMagmaCube disguise = new DisguiseMagmaCube(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
|
||||
|
@ -87,7 +87,12 @@ public class KitPig extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguisePig disguise = new DisguisePig(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
}
|
||||
|
@ -91,7 +91,12 @@ public class KitSkeletalHorse extends SmashKit
|
||||
//Disguise
|
||||
DisguiseHorse disguise = new DisguiseHorse(player);
|
||||
disguise.setType(Variant.SKELETON_HORSE);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
}
|
||||
|
@ -83,7 +83,12 @@ public class KitSkeleton extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguiseSkeleton disguise = new DisguiseSkeleton(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
disguise.hideArmor();
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
|
@ -65,7 +65,12 @@ public class KitSkySquid extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguiseSquid disguise = new DisguiseSquid(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
}
|
||||
|
@ -73,7 +73,12 @@ public class KitSlime extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguiseSlime disguise = new DisguiseSlime(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
|
||||
|
@ -85,7 +85,12 @@ public class KitSnowman extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguiseSnowman disguise = new DisguiseSnowman(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
}
|
||||
|
@ -92,7 +92,12 @@ public class KitSpider extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguiseSpider disguise = new DisguiseSpider(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
}
|
||||
|
@ -81,7 +81,12 @@ public class KitWitch extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguiseWitch disguise = new DisguiseWitch(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
}
|
||||
|
@ -71,7 +71,12 @@ public class KitWitherSkeleton extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguiseSkeleton disguise = new DisguiseSkeleton(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
disguise.SetSkeletonType(SkeletonType.WITHER);
|
||||
disguise.hideArmor();
|
||||
|
@ -76,7 +76,12 @@ public class KitWolf extends SmashKit
|
||||
|
||||
//Disguise
|
||||
DisguiseWolf disguise = new DisguiseWolf(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) != null)
|
||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
else
|
||||
disguise.SetName(player.getName());
|
||||
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
}
|
||||
|
@ -68,6 +68,7 @@ import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.combat.CombatLog;
|
||||
@ -87,6 +88,9 @@ public class UHC extends TeamGame
|
||||
private NautHashMap<String, Long> _combatTime = new NautHashMap<String, Long>();
|
||||
|
||||
private int _borders = 1000;
|
||||
|
||||
private boolean _borderShrink = true;
|
||||
private int _borderShrinkSize = 1000;
|
||||
|
||||
private int _gameMinutes = 0;
|
||||
private long _lastMinute = System.currentTimeMillis();
|
||||
@ -251,6 +255,43 @@ public class UHC extends TeamGame
|
||||
{
|
||||
Announce(ChatColor.WHITE + C.Bold + _gameMinutes + " minutes have passed.");
|
||||
}
|
||||
|
||||
//Shrink Borders
|
||||
if (_borderShrink && _gameMinutes >= 90 && _borderShrinkSize > 50)
|
||||
{
|
||||
int time = (_gameMinutes - 90) % 20;
|
||||
|
||||
int newSize = Math.max(50, _borderShrinkSize - 150);
|
||||
|
||||
//Shrink
|
||||
if (_gameMinutes >= 110 && time == 0)
|
||||
{
|
||||
Announce(ChatColor.RED + C.Bold + "Borders have shrunk to " + ChatColor.YELLOW + C.Bold + "+/-" + newSize + ChatColor.RED + C.Bold + "!");
|
||||
_borderShrinkSize = newSize;
|
||||
}
|
||||
|
||||
//Warnings
|
||||
if (time == 0)
|
||||
{
|
||||
//Announce(ChatColor.GOLD + C.Bold + "Borders will shrink to " + ChatColor.YELLOW + C.Bold + "+/-" + newSize + ChatColor.GOLD + C.Bold + " in 20 minutes.");
|
||||
}
|
||||
else if (time == 5)
|
||||
{
|
||||
Announce(ChatColor.GOLD + C.Bold + "Borders will shrink to " + ChatColor.YELLOW + C.Bold + "+/-" + newSize + ChatColor.GOLD + C.Bold + " in 15 minutes.");
|
||||
}
|
||||
else if (time == 10)
|
||||
{
|
||||
Announce(ChatColor.GOLD + C.Bold + "Borders will shrink to " + ChatColor.YELLOW + C.Bold + "+/-" + newSize + ChatColor.GOLD + C.Bold + " in 10 minutes.");
|
||||
}
|
||||
else if (time == 15)
|
||||
{
|
||||
Announce(ChatColor.GOLD + C.Bold + "Borders will shrink to " + ChatColor.YELLOW + C.Bold + "+/-" + newSize + ChatColor.GOLD + C.Bold + " in 5 minutes.");
|
||||
}
|
||||
else if (time == 19)
|
||||
{
|
||||
Announce(ChatColor.GOLD + C.Bold + "Borders will shrink to " + ChatColor.YELLOW + C.Bold + "+/-" + newSize + ChatColor.GOLD + C.Bold + " in 1 minute.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -308,6 +349,28 @@ public class UHC extends TeamGame
|
||||
|
||||
event.getPlayer().playSound(event.getPlayer().getLocation(), Sound.NOTE_BASS, 0.5f, 1f);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void WorldBoundaryShrinkCheck(PlayerMoveEvent event)
|
||||
{
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
//Allowed
|
||||
if (
|
||||
event.getTo().getX() < _borderShrinkSize &&
|
||||
event.getTo().getX() >= -_borderShrinkSize &&
|
||||
event.getTo().getZ() < _borderShrinkSize &&
|
||||
event.getTo().getZ() >= -_borderShrinkSize)
|
||||
return;
|
||||
|
||||
if (Recharge.Instance.use(event.getPlayer(), "Border Shrink", 500, false))
|
||||
{
|
||||
Manager.GetCondition().Factory().Poison("Border", event.getPlayer(), event.getPlayer(), 1.9, 0, false, false, false);
|
||||
Manager.GetCondition().Factory().Speed("Border", event.getPlayer(), event.getPlayer(), 1.9, 1, false, false, false);
|
||||
Manager.GetCondition().Factory().DigFast("Border", event.getPlayer(), event.getPlayer(), 1.9, 1, false, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void WorldBoundarySet(GameStateChangeEvent event)
|
||||
|
Loading…
Reference in New Issue
Block a user