From df5c628c35a6692ad39d4ee202cd54cedb230e4d Mon Sep 17 00:00:00 2001 From: xXVevzZXx Date: Fri, 13 May 2016 20:23:04 +0200 Subject: [PATCH] add new gamemodes Tiny Winners, Random Kit SSM, UHC SW, UHC SG and improve OP SG, OP SW, OP Bridges, Dukes of decoration, OP Gladiators, Faster than Light, Bunny Hopper and Countdown --- .../core/itemstack/ItemStackFactory.java | 27 ++- .../personalServer/PersonalServerManager.java | 2 +- .../src/nautilus/game/arcade/GameType.java | 12 +- .../game/arcade/game/games/bridge/Bridge.java | 5 + .../games/bridge/modes/OverpoweredBridge.java | 225 +++++++++++++++--- .../game/arcade/game/games/build/Build.java | 98 ++++---- .../games/build/modes/DukesOfDecoration.java | 143 +++++++++-- .../modes/OverpoweredGladiators.java | 14 +- .../arcade/game/games/hideseek/HideSeek.java | 22 +- .../game/games/hideseek/modes/Countdown.java | 34 ++- .../game/arcade/game/games/micro/Micro.java | 24 +- .../game/games/micro/modes/TinnyWinners.java | 79 ++++++ .../game/games/quiver/modes/BunnyHop.java | 69 ++++++ .../game/arcade/game/games/runner/Runner.java | 5 + .../games/runner/modes/FasterThanLight.java | 73 ++++++ .../skywars/modes/OverpoweredSkywars.java | 3 +- .../game/games/skywars/modes/UHCSkywars.java | 63 +++++ .../game/games/smash/SoloSuperSmash.java | 25 ++ .../arcade/game/games/smash/SuperSmash.java | 14 +- .../game/games/smash/modes/RandomKitSSM.java | 157 ++++++++++++ .../games/smash/modes/kits/KitPlayer.java | 47 ++++ .../modes/OverpoweredSurvival.java | 27 ++- .../survivalgames/modes/UHCSurvivalgames.java | 62 +++++ 23 files changed, 1091 insertions(+), 139 deletions(-) create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/TinnyWinners.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/modes/UHCSkywars.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/modes/RandomKitSSM.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/modes/kits/KitPlayer.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/UHCSurvivalgames.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/itemstack/ItemStackFactory.java b/Plugins/Mineplex.Core/src/mineplex/core/itemstack/ItemStackFactory.java index b598e19c3..732b6c742 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/itemstack/ItemStackFactory.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/itemstack/ItemStackFactory.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Map.Entry; import mineplex.core.MiniPlugin; @@ -770,7 +771,7 @@ public class ItemStackFactory extends MiniPlugin public ItemStack CreateStack(Material type, byte data, int amount, String name, String[] lore, String owner, boolean unbreakable) { - return CreateStack(type.getId(), data, amount, (short)0, name, ArrayToList(lore), owner, unbreakable); + return CreateStack(type.getId(), data, amount, (short)0, name, ArrayToList(lore), owner, unbreakable, 0, null); } public ItemStack CreateStack(int id, byte data, int amount, String name, String[] lore, String owner) @@ -790,7 +791,7 @@ public class ItemStackFactory extends MiniPlugin public ItemStack CreateStack(int id, byte data, int amount, short damage, String name, String[] lore, String owner, boolean unbreakable) { - return CreateStack(id, data, amount, damage, name, ArrayToList(lore), owner, unbreakable); + return CreateStack(id, data, amount, damage, name, ArrayToList(lore), owner, unbreakable, 0, null); } @@ -801,14 +802,20 @@ public class ItemStackFactory extends MiniPlugin public ItemStack CreateStack(int id, byte data, int amount, short damage, String name, List lore, String owner) { - return CreateStack(id, data, amount, damage, name, lore, owner, true); + return CreateStack(id, data, amount, damage, name, lore, owner, true, 0, null); } - //XXX Owner Variant End - @SuppressWarnings("deprecation") public ItemStack CreateStack(int id, byte data, int amount, short damage, String name, List lore, String owner, boolean unbreakable) { + return CreateStack(id, data, amount, damage, name, lore, owner, unbreakable, 0, null); + } + + //XXX Owner Variant End + + @SuppressWarnings("deprecation") + public ItemStack CreateStack(int id, byte data, int amount, short damage, String name, List lore, String owner, boolean unbreakable, Integer enchLevel, Enchantment... enchantments) + { ItemStack stack; if (data == 0) stack = new ItemStack(id, amount, damage); @@ -874,7 +881,15 @@ public class ItemStackFactory extends MiniPlugin if (setMeta) stack.setItemMeta(itemMeta); - + + if(enchantments != null) + { + for(Enchantment enchantment : enchantments) + { + stack.addEnchantment(enchantment, enchLevel); + } + } + //Unbreakable if (unbreakable) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/personalServer/PersonalServerManager.java b/Plugins/Mineplex.Core/src/mineplex/core/personalServer/PersonalServerManager.java index ee40a0e6f..551a82d76 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/personalServer/PersonalServerManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/personalServer/PersonalServerManager.java @@ -160,7 +160,7 @@ public class PersonalServerManager extends MiniPlugin } final ServerGroup serverGroup = new ServerGroup(serverName, serverName, host.getName(), ram, cpu, 1, 0, UtilMath.random.nextInt(250) + 19999, true, "arcade.zip", "Arcade.jar", "plugins/Arcade/", minPlayers, maxPlayers, - true, false, false, games, "Player", true, event, false, true, false, true, true, false, false, false, false, true, true, true, false, false, "", _us ? Region.US : Region.EU, "", "", "", ""); + true, false, false, games, "", "Player", true, event, false, true, false, true, true, false, false, false, false, true, true, true, false, false, "", _us ? Region.US : Region.EU, "", "", "", ""); getPlugin().getServer().getScheduler().runTaskAsynchronously(getPlugin(), new Runnable() { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java index 4f5ca052b..0cd9a9d93 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java @@ -42,6 +42,7 @@ import nautilus.game.arcade.game.games.holeinwall.HoleInTheWall; import nautilus.game.arcade.game.games.horsecharge.Horse; import nautilus.game.arcade.game.games.lobbers.BombLobbers; import nautilus.game.arcade.game.games.micro.Micro; +import nautilus.game.arcade.game.games.micro.modes.TinnyWinners; import nautilus.game.arcade.game.games.milkcow.MilkCow; import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague; import nautilus.game.arcade.game.games.minestrike.MineStrike; @@ -63,9 +64,11 @@ import nautilus.game.arcade.game.games.sheep.modes.EweHeroes; import nautilus.game.arcade.game.games.skywars.SoloSkywars; import nautilus.game.arcade.game.games.skywars.TeamSkywars; import nautilus.game.arcade.game.games.skywars.modes.OverpoweredSkywars; +import nautilus.game.arcade.game.games.skywars.modes.UHCSkywars; import nautilus.game.arcade.game.games.smash.SoloSuperSmash; import nautilus.game.arcade.game.games.smash.SuperSmashDominate; import nautilus.game.arcade.game.games.smash.TeamSuperSmash; +import nautilus.game.arcade.game.games.smash.modes.RandomKitSSM; import nautilus.game.arcade.game.games.snake.Snake; import nautilus.game.arcade.game.games.sneakyassassins.SneakyAssassins; import nautilus.game.arcade.game.games.snowfight.SnowFight; @@ -78,6 +81,7 @@ import nautilus.game.arcade.game.games.stacker.Stacker; import nautilus.game.arcade.game.games.survivalgames.SoloSurvivalGames; import nautilus.game.arcade.game.games.survivalgames.TeamSurvivalGames; import nautilus.game.arcade.game.games.survivalgames.modes.OverpoweredSurvival; +import nautilus.game.arcade.game.games.survivalgames.modes.UHCSurvivalgames; import nautilus.game.arcade.game.games.tug.Tug; import nautilus.game.arcade.game.games.turfforts.TurfForts; import nautilus.game.arcade.game.games.typewars.TypeWars; @@ -127,7 +131,7 @@ public enum GameType HoleInTheWall(HoleInTheWall.class, GameDisplay.HoleInTheWall), Horse(Horse.class, GameDisplay.Horse), Lobbers(BombLobbers.class, GameDisplay.Lobbers), - Micro(Micro.class, GameDisplay.Micro), + Micro(Micro.class, new GameMode[]{new GameMode(TinnyWinners.class, "Tinny Winners")}, GameDisplay.Micro), MilkCow(MilkCow.class, GameDisplay.MilkCow), MineStrike(MineStrike.class, GameDisplay.MineStrike, new Pair[] { @@ -145,7 +149,7 @@ public enum GameType Sheep(SheepGame.class, new GameMode[]{new GameMode(EweHeroes.class, "Heroes Of The Ewe")}, GameDisplay.Sheep), TypeWars(TypeWars.class, GameDisplay.TypeWars), - Smash(SoloSuperSmash.class, GameDisplay.Smash), + Smash(SoloSuperSmash.class, new GameMode[]{new GameMode(RandomKitSSM.class, "Random Kit SSM")}, GameDisplay.Smash), SmashDomination(SuperSmashDominate.class, GameDisplay.SmashDomination), SmashTeams(TeamSuperSmash.class, GameDisplay.SmashTeams, new GameType[]{GameType.Smash}, false), Snake(Snake.class, GameDisplay.Snake), @@ -156,7 +160,7 @@ public enum GameType SpleefTeams(SpleefTeams.class, GameDisplay.SpleefTeams), SquidShooter(SquidShooter.class, GameDisplay.SquidShooter), Stacker(Stacker.class, GameDisplay.Stacker), - SurvivalGames(SoloSurvivalGames.class, new GameMode[]{new GameMode(OverpoweredSurvival.class, "OP Survival Games")}, GameDisplay.SurvivalGames), + SurvivalGames(SoloSurvivalGames.class, new GameMode[]{new GameMode(OverpoweredSurvival.class, "OP Survival Games"), new GameMode(UHCSurvivalgames.class, "UHC Survivalgames ")}, GameDisplay.SurvivalGames), SurvivalGamesTeams(TeamSurvivalGames.class, GameDisplay.SurvivalGamesTeams, new GameType[]{GameType.SurvivalGames}, false), Tug(Tug.class, GameDisplay.Tug), TurfWars(TurfForts.class, GameDisplay.TurfWars), @@ -169,7 +173,7 @@ public enum GameType ZombieSurvival(ZombieSurvival.class, GameDisplay.ZombieSurvival), Build(Build.class, new GameMode[]{new GameMode(TeamBuild.class, "Team Master Builders"), new GameMode(DukesOfDecoration.class, "Dukes Of Decoration")}, GameDisplay.Build), Cards(Cards.class, GameDisplay.Cards), - Skywars(SoloSkywars.class, GameDisplay.Skywars), + Skywars(SoloSkywars.class, new GameMode[]{new GameMode(UHCSkywars.class, "UHC Skywars")}, GameDisplay.Skywars), SkywarsTeams(TeamSkywars.class, new GameMode[]{new GameMode(OverpoweredSkywars.class, "OP Skywars")}, GameDisplay.SkywarsTeams, new GameType[]{GameType.Skywars}, false), MonsterMaze(MonsterMaze.class, GameDisplay.MonsterMaze), MonsterLeague(MonsterLeague.class, GameDisplay.MonsterLeague), diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java index 5a9bc8076..4c6a771ff 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java @@ -1965,5 +1965,10 @@ public class Bridge extends TeamGame implements OreObsfucation { return _chestLoot; } + + public boolean bridgesDown() + { + return _bridgesDown; + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/modes/OverpoweredBridge.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/modes/OverpoweredBridge.java index d2f9c21a5..a591f4a71 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/modes/OverpoweredBridge.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/modes/OverpoweredBridge.java @@ -1,23 +1,30 @@ package nautilus.game.arcade.game.games.bridge.modes; -import java.util.ArrayList ; +import java.util.ArrayList; +import java.util.HashMap; -import org.bukkit.Location ; -import org.bukkit.Material ; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; import org.bukkit.block.Chest; +import org.bukkit.block.Sign; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.block.Action; +import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.PotionMeta; -import org.bukkit.material.MaterialData; -import org.bukkit.potion.Potion; -import org.bukkit.potion.Potion.Tier; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.potion.PotionType; +import org.bukkit.inventory.meta.EnchantmentStorageMeta; -import mineplex.core.common.util.UtilMath ; -import mineplex.core.itemstack.ItemStackFactory; -import nautilus.game.arcade.ArcadeManager ; -import nautilus.game.arcade.game.games.bridge.Bridge ; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.events.PlayerPrepareTeleportEvent; +import nautilus.game.arcade.game.games.bridge.Bridge; +import net.md_5.bungee.api.ChatColor; /** * OverpoweredBridge @@ -27,6 +34,9 @@ import nautilus.game.arcade.game.games.bridge.Bridge ; public class OverpoweredBridge extends Bridge { + private HashMap _starterChests; + private HashMap _starterItems; + public OverpoweredBridge(ArcadeManager manager) { super(manager); @@ -35,6 +45,20 @@ public class OverpoweredBridge extends Bridge @Override public void ParseData() { + _starterChests = new HashMap<>(); + _starterItems = new HashMap<>(); + + _starterItems.put(Material.WOOD, 64); + _starterItems.put(Material.GOLDEN_APPLE, 10); + _starterItems.put(Material.DIAMOND_PICKAXE, 1); + _starterItems.put(Material.ENCHANTMENT_TABLE, 1); + _starterItems.put(Material.ANVIL, 1); + _starterItems.put(Material.BOOKSHELF, 64); + _starterItems.put(Material.BOOK, 64); + _starterItems.put(Material.EXP_BOTTLE, 64); + _starterItems.put(Material.COOKED_BEEF, 64); + _starterItems.put(Material.DIAMOND, 300); + ParseLavaBridge(); ParseWoodBridge(); ParseIceBridge(); @@ -58,15 +82,123 @@ public class OverpoweredBridge extends Bridge if (!WorldData.GetCustomLocs("86").isEmpty()) ParseOre(WorldData.GetCustomLocs("86")); if (!WorldData.GetCustomLocs("103").isEmpty()) ParseOre(WorldData.GetCustomLocs("103")); if (!WorldData.GetCustomLocs("22").isEmpty()) ParseOre(WorldData.GetCustomLocs("22")); - - ParseEnchantTables(); } - - private void ParseEnchantTables() + + @EventHandler + public void informChest(GameStateChangeEvent event) { - for(Location loc : WorldData.GetDataLocs("PINK")) + if (event.GetState() != GameState.Live) + return; + + for (Player player : GetPlayers(true)) { - loc.getBlock().setType(Material.ENCHANTMENT_TABLE); + UtilPlayer.message(player, F.main("Game", ChatColor.AQUA + "A supply chest spawned near you. You should take a look into it")); + } + } + + @EventHandler + public void supplyChest(PlayerPrepareTeleportEvent event) + { + Location chestLoc = event.GetPlayer().getLocation().clone().add(0, 0, 1); + _starterChests.put(event.GetPlayer(), chestLoc); + + Block block = chestLoc.getBlock(); + block.setType(Material.CHEST); + chestLoc.clone().add(0, 1, 0).getBlock().setType(Material.AIR); + + Chest chest = (Chest) block.getState(); + + event.GetPlayer().getLocation().getBlock().setType(Material.WALL_SIGN); + Sign sign = (Sign) event.GetPlayer().getLocation().getBlock().getState(); + sign.setLine(0, "§b============="); + sign.setLine(1, "§4§l" + event.GetPlayer().getName() + ChatColor.RESET + "§4's"); + sign.setLine(2, "§4Supply Chest"); + sign.setLine(3, "§b============="); + sign.update(); + + + ArrayList slots = new ArrayList<>(); + + for (int i = 0; i <= 27; i++) + slots.add(new Integer(i)); + + for (Material mat : _starterItems.keySet()) + { + ItemStack stack = new ItemStack(mat); + int amount = _starterItems.get(mat); + + if (amount > stack.getMaxStackSize()) + { + while (amount > 0) + { + ItemStack item = new ItemStack(mat); + + if (amount > stack.getMaxStackSize()) + item.setAmount(stack.getMaxStackSize()); + else + item.setAmount(amount); + + int slot = slots.get(UtilMath.r(slots.size())); + slots.remove(new Integer(slot)); + + chest.getInventory().setItem(slot, item); + + amount -= stack.getMaxStackSize(); + } + } + else + { + ItemStack item = new ItemStack(mat, amount); + int slot = slots.get(UtilMath.r(slots.size())); + slots.remove(new Integer(slot)); + + chest.getInventory().setItem(slot, item); + } + } + + } + + @EventHandler + public void openChest(PlayerInteractEvent event) + { + if (event.getAction() == Action.RIGHT_CLICK_BLOCK) + { + if (event.getClickedBlock().getType() != Material.CHEST) + return; + + for (Player player : _starterChests.keySet()) + { + if (player == event.getPlayer()) + continue; + + if (_starterChests.get(player).getBlock().getLocation().equals(event.getClickedBlock().getLocation())) + { + event.setCancelled(true); + break; + } + } + } + } + + @EventHandler + public void CheatChestBreak(BlockBreakEvent event) + { + if (event.getBlock().getType() != Material.CHEST) + return; + + if (!IsAlive(event.getPlayer())) + return; + + for (Player player : _starterChests.keySet()) + { + if (player == event.getPlayer()) + continue; + + if (_starterChests.get(player).getBlock().getLocation().equals(event.getBlock().getLocation())) + { + event.setCancelled(true); + break; + } } } @@ -76,7 +208,7 @@ public class OverpoweredBridge extends Bridge int coal = (int) ((teamOre.size() / 32d) * getOreDensity()); int iron = (int) ((teamOre.size() / 24d) * getOreDensity()); int gold = (int) ((teamOre.size() / 64d) * getOreDensity()); - int diamond = 100 + (int) ((teamOre.size() / 32d) * getOreDensity()); + int diamond = 500 + (int) ((teamOre.size() / 32d) * getOreDensity()); int gravel = (int) ((teamOre.size() / 64d) * getOreDensity()); @@ -221,7 +353,7 @@ public class OverpoweredBridge extends Bridge break; } - CreateOre(teamOre.remove(id), Material.DIAMOND_ORE, 2); + CreateOre(teamOre.remove(id), Material.DIAMOND_ORE, 5); } } @@ -237,7 +369,7 @@ public class OverpoweredBridge extends Bridge chest.getBlockInventory().clear(); - int count = 12 + UtilMath.r(10); + int count = 22 + UtilMath.r(4); for (int i = 0; i < count; i++) { chest.getBlockInventory().addItem(GetChestItem()); @@ -250,23 +382,51 @@ public class OverpoweredBridge extends Bridge { if (getChestLoot().isEmpty()) { - for (int i = 0; i < 5; i++) + for (int i = 0; i < 2; i++) getChestLoot().add(new ItemStack(Material.DIAMOND_HELMET)); - for (int i = 0; i < 5; i++) + for (int i = 0; i < 2; i++) getChestLoot().add(new ItemStack(Material.DIAMOND_CHESTPLATE)); - for (int i = 0; i < 5; i++) + for (int i = 0; i < 2; i++) getChestLoot().add(new ItemStack(Material.DIAMOND_LEGGINGS)); - for (int i = 0; i < 5; i++) + for (int i = 0; i < 2; i++) getChestLoot().add(new ItemStack(Material.DIAMOND_BOOTS)); - for (int i = 0; i < 5; i++) + for (int i = 0; i < 2; i++) getChestLoot().add(new ItemStack(Material.DIAMOND_SWORD)); - for (int i = 0; i < 5; i++) + for (int i = 0; i < 2; i++) getChestLoot().add(new ItemStack(Material.DIAMOND_AXE)); - for (int i = 0; i < 5; i++) + for (int i = 0; i < 2; i++) getChestLoot().add(new ItemStack(Material.DIAMOND_PICKAXE)); for (int i = 0; i < 13; i++) + { getChestLoot().add(new ItemStack(Material.GOLDEN_APPLE)); + getChestLoot().add(new ItemStack(Material.ANVIL)); + } + + for (int i = 0; i < 5; i++) + { + + ItemStack sharpness = new ItemStack(Material.ENCHANTED_BOOK); + EnchantmentStorageMeta sharpnessMeta = (EnchantmentStorageMeta) sharpness.getItemMeta(); + sharpnessMeta.addStoredEnchant(Enchantment.DAMAGE_ALL, 1 + UtilMath.r(5), true); + sharpness.setItemMeta(sharpnessMeta); + getChestLoot().add(sharpness); + + ItemStack protection = new ItemStack(Material.ENCHANTED_BOOK); + EnchantmentStorageMeta protectionMeta = (EnchantmentStorageMeta) protection.getItemMeta(); + protectionMeta.addStoredEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1 + UtilMath.r(4), true); + protection.setItemMeta(protectionMeta); + getChestLoot().add(protection); + + ItemStack power = new ItemStack(Material.ENCHANTED_BOOK); + EnchantmentStorageMeta powerMeta = (EnchantmentStorageMeta) power.getItemMeta(); + powerMeta.addStoredEnchant(Enchantment.ARROW_DAMAGE, 1 + UtilMath.r(5), true); + power.setItemMeta(powerMeta); + getChestLoot().add(power); + } + + for (int i = 0; i < 10; i++) + getChestLoot().add(new ItemStack(Material.EXP_BOTTLE, 10)); for (int i = 0; i < 6; i++) getChestLoot().add(new ItemStack(Material.BOW)); @@ -286,7 +446,10 @@ public class OverpoweredBridge extends Bridge if (stack.getType().getMaxStackSize() > 1) amount = stack.getAmount() + UtilMath.r(stack.getAmount()); - return ItemStackFactory.Instance.CreateStack(stack.getTypeId(), amount); + ItemStack item = stack.clone(); + item.setAmount(amount); + + return item; } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java index 447ed261f..dec4b1615 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java @@ -5,44 +5,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map.Entry; - -import mineplex.core.common.util.C; -import mineplex.core.common.util.F; -import mineplex.core.common.util.NautHashMap; -import mineplex.core.common.util.UtilAction; -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilEvent; -import mineplex.core.common.util.UtilEvent.ActionType; -import mineplex.core.common.util.UtilGear; -import mineplex.core.common.util.UtilInv; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilParticle; -import mineplex.core.common.util.UtilParticle.ParticleType; -import mineplex.core.common.util.UtilParticle.ViewDist; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilTextBottom; -import mineplex.core.common.util.UtilTextMiddle; -import mineplex.core.common.util.UtilTime; -import mineplex.core.explosion.ExplosionEvent; -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.damage.CustomDamageEvent; -import nautilus.game.arcade.ArcadeManager; -import nautilus.game.arcade.GameType; -import nautilus.game.arcade.events.GameStateChangeEvent; -import nautilus.game.arcade.events.PlayerPrepareTeleportEvent; -import nautilus.game.arcade.game.Game ; -import nautilus.game.arcade.game.SoloGame; -import nautilus.game.arcade.game.games.build.gui.MobShop; -import nautilus.game.arcade.game.games.build.gui.OptionsShop; -import nautilus.game.arcade.game.games.build.kits.KitBuilder; -import nautilus.game.arcade.kit.Kit; -import nautilus.game.arcade.managers.chat.ChatStatData; -import nautilus.game.arcade.stats.BlockBreakStatTracker; -import nautilus.game.arcade.stats.BlockPlaceStatTracker; import java.util.UUID; import org.bukkit.ChatColor; @@ -107,6 +69,44 @@ import org.bukkit.event.vehicle.VehicleCreateEvent; import org.bukkit.event.vehicle.VehicleDamageEvent; import org.bukkit.inventory.ItemStack; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.NautHashMap; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.common.util.UtilGear; +import mineplex.core.common.util.UtilInv; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTextBottom; +import mineplex.core.common.util.UtilTextMiddle; +import mineplex.core.common.util.UtilTime; +import mineplex.core.explosion.ExplosionEvent; +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.damage.CustomDamageEvent; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.GameType; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.events.PlayerPrepareTeleportEvent; +import nautilus.game.arcade.game.Game ; +import nautilus.game.arcade.game.GameTeam; +import nautilus.game.arcade.game.games.build.gui.MobShop; +import nautilus.game.arcade.game.games.build.gui.OptionsShop; +import nautilus.game.arcade.game.games.build.kits.KitBuilder; +import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.managers.chat.ChatStatData; +import nautilus.game.arcade.stats.BlockBreakStatTracker; +import nautilus.game.arcade.stats.BlockPlaceStatTracker; + public class Build extends Game { private NautHashMap _data = new NautHashMap(); @@ -245,6 +245,17 @@ public class Build extends Game event.GetPlayer().setFlySpeed(0.04f); } + @EventHandler + public void CustomTeamGeneration(GameStateChangeEvent event) + { + if (event.GetState() != GameState.Recruit) + return; + + GameTeam players = GetTeamList().get(0); + players.SetColor(ChatColor.YELLOW); + players.SetName("Players"); + } + @EventHandler public void prepare(GameStateChangeEvent event) { @@ -1103,11 +1114,13 @@ public class Build extends Game if (data == null) return; + + event.getItem().remove(); + if(data.Player == null) { if (data.Team.HasPlayer(event.getPlayer())) { - event.getItem().remove(); UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, event.getItem().getLocation().add(0, 0.5, 0), 0, 0, 0, 0, 1, ViewDist.LONG, UtilServer.getPlayers()); } @@ -1664,7 +1677,12 @@ public class Build extends Game { return _voteTime; } - + + public ItemStack getShop() + { + return _shopItem; + } + @Override public void EndCheck() { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/modes/DukesOfDecoration.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/modes/DukesOfDecoration.java index 23050818a..177cbc6cc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/modes/DukesOfDecoration.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/modes/DukesOfDecoration.java @@ -1,22 +1,37 @@ package nautilus.game.arcade.game.games.build.modes; import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.bukkit.Bukkit; +import org.bukkit.Effect; +import org.bukkit.GameMode; import org.bukkit.Material; +import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.event.block.BlockDamageEvent; import org.bukkit.event.block.BlockPlaceEvent; +import org.bukkit.event.inventory.InventoryAction; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryCreativeEvent; +import org.bukkit.event.inventory.InventoryDragEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.recharge.Recharge; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.events.PlayerPrepareTeleportEvent; import nautilus.game.arcade.game.games.build.Build; +import net.md_5.bungee.api.ChatColor; /** * DukesOfDecoration @@ -32,27 +47,110 @@ public class DukesOfDecoration extends Build { super(manager); + List notAllowed = Arrays.asList(new Material[]{ + Material.COMMAND, + Material.COMMAND_MINECART, + Material.BARRIER, + Material.BURNING_FURNACE, + Material.MOB_SPAWNER, + Material.FURNACE, + Material.DRAGON_EGG, + Material.ENDER_PORTAL, + Material.ENDER_PORTAL_FRAME, + Material.SOIL, + Material.PORTAL, + Material.GLOWING_REDSTONE_ORE, + Material.SUGAR_CANE_BLOCK, + Material.IRON_DOOR_BLOCK, + Material.DOUBLE_STEP, + Material.DOUBLE_PLANT, + Material.DOUBLE_STONE_SLAB2, + Material.WOOD_DOUBLE_STEP, + Material.BREWING_STAND, + Material.WALL_SIGN, + Material.YELLOW_FLOWER, + Material.RED_ROSE, + Material.SAPLING, + Material.RED_MUSHROOM, + Material.BROWN_MUSHROOM, + Material.DIODE_BLOCK_ON, + Material.DIODE_BLOCK_OFF, + Material.WATER, + Material.STATIONARY_WATER, + Material.LAVA, + Material.STATIONARY_WATER, + Material.SIGN_POST, + Material.REDSTONE_LAMP_ON, + Material.PISTON_EXTENSION, + Material.MELON_STEM, + Material.BED_BLOCK, + Material.POTATO, + Material.CARROT, + Material.COCOA, + Material.REDSTONE_WIRE, + Material.SKULL, + Material.CROPS, + Material.FLOWER_POT, + Material.HUGE_MUSHROOM_1, + Material.HUGE_MUSHROOM_2, + Material.FIRE + }); _blocks = new ArrayList<>(); - for (int i = 0; i < 22; i++) + for (int i = 0; i < 8; i++) { Material mat = Material.values()[1 + UtilMath.r(174)]; - while (_blocks.contains(mat) - || mat == Material.COMMAND - || mat == Material.COMMAND_MINECART - || mat == Material.BARRIER - || mat == Material.BURNING_FURNACE - || mat == Material.MOB_SPAWNER - || mat == Material.FURNACE - || mat == Material.DRAGON_EGG - || mat == Material.ENDER_PORTAL - || mat == Material.ENDER_PORTAL_FRAME) + while (_blocks.contains(mat) || notAllowed.contains(mat)) { mat = Material.values()[1 + UtilMath.r(174)]; } + System.out.println(mat.toString()); _blocks.add(mat); } } + + @Override + @EventHandler + public void prepare(PlayerPrepareTeleportEvent event) + { + event.GetPlayer().setGameMode(GameMode.SURVIVAL); + event.GetPlayer().setAllowFlight(true); + event.GetPlayer().setFlying(true); + event.GetPlayer().setFlySpeed(0.04f); + } + + @EventHandler + public void blockDamage(BlockDamageEvent event) + { + if (!IsLive()) + return; + + if(!Recharge.Instance.usable(event.getPlayer(), "Block Break")) + return; + + Block block = event.getBlock(); + BlockBreakEvent breakEvent = new BlockBreakEvent(block, event.getPlayer()); + Bukkit.getPluginManager().callEvent(breakEvent); + + if (breakEvent.isCancelled()) + return; + + block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getTypeId()); + block.setTypeId(0); + + Recharge.Instance.use(event.getPlayer(), "Block Break", 100, false, false); + } + + @EventHandler + public void keepBlocks(BlockPlaceEvent event) + { + if (!IsLive()) + return; + + ItemStack item = event.getPlayer().getItemInHand().clone(); + int slot = event.getPlayer().getInventory().getHeldItemSlot(); + event.getPlayer().getInventory().setItem(slot, item); + } @EventHandler public void giveBlocks(GameStateChangeEvent event) @@ -94,7 +192,7 @@ public class DukesOfDecoration extends Build { for (Material mat : _blocks) { - UtilInv.insert(player, new ItemStack(mat)); + UtilInv.insert(player, buildingBlock(new ItemStack(mat))); } UtilPlayer.message(player, F.main("Game", "You have been given your building blocks. If you want to get them once again type " + F.game("/giveblocks"))); @@ -107,15 +205,28 @@ public class DukesOfDecoration extends Build public void placeBlock(BlockPlaceEvent event) { if (!_blocks.contains(event.getBlockPlaced().getType()) - || (event.getBlockPlaced().getType() == Material.WOOL - || event.getBlockPlaced().getType() == Material.STAINED_CLAY - || event.getBlockPlaced().getType() == Material.STAINED_GLASS + || (event.getBlockPlaced().getType() == Material.WOOL && event.getBlock().getData() != 0 + || event.getBlockPlaced().getType() == Material.STAINED_CLAY && event.getBlock().getData() != 0 + || event.getBlockPlaced().getType() == Material.STAINED_GLASS && event.getBlock().getData() != 0 || event.getBlockPlaced().getType() == Material.STAINED_GLASS_PANE && event.getBlock().getData() != 0)) { event.setCancelled(true); UtilPlayer.message(event.getPlayer(), F.main("Game", "You can not place this Block")); } } + + private ItemStack buildingBlock(ItemStack item) + { + ItemMeta meta = item.getItemMeta(); + ChatColor color = ChatColor.values()[UtilMath.r(14)]; + + if(color == ChatColor.BLACK || color == ChatColor.GRAY || color == ChatColor.DARK_GRAY || color == ChatColor.WHITE) + color = ChatColor.RED; + + meta.setLore(Arrays.asList(new String[]{color + "" + ChatColor.BOLD + "Building block"})); + item.setItemMeta(meta); + return item; + } @Override public String GetMode() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/modes/OverpoweredGladiators.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/modes/OverpoweredGladiators.java index 79b6d963b..97bc6bd32 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/modes/OverpoweredGladiators.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/modes/OverpoweredGladiators.java @@ -54,11 +54,12 @@ public class OverpoweredGladiators extends Gladiators p.getInventory().setArmorContents(null); p.getInventory().setItem(layout.getRod(), UtilItem.makeUnbreakable(type.getLoadout().getRod())); - p.getInventory().setItem(layout.getBow(), type.getLoadout().getBow()); p.getInventory().setItem(layout.getArrows(), new ItemStack(Material.ARROW, round * 5)); ItemStack sword = new ItemStack(Material.DIAMOND_SWORD); + ItemStack bow = new ItemStack(Material.BOW); + ItemStack helmet = new ItemStack(Material.DIAMOND_HELMET); ItemStack chest = new ItemStack(Material.DIAMOND_CHESTPLATE); ItemStack leggings = new ItemStack(Material.DIAMOND_LEGGINGS); @@ -68,6 +69,7 @@ public class OverpoweredGladiators extends Gladiators if (round != 0) { sword.addEnchantment(Enchantment.DAMAGE_ALL, round); + bow.addEnchantment(Enchantment.ARROW_DAMAGE, round); helmet.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, round); chest.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, round); leggings.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, round); @@ -75,11 +77,13 @@ public class OverpoweredGladiators extends Gladiators } p.getInventory().setItem(layout.getSword(), UtilItem.makeUnbreakable(sword)); + + p.getInventory().setItem(layout.getBow(), UtilItem.makeUnbreakable(bow)); - p.getInventory().setHelmet(helmet); - p.getInventory().setChestplate(chest); - p.getInventory().setLeggings(leggings); - p.getInventory().setBoots(boots); + p.getInventory().setHelmet(UtilItem.makeUnbreakable(helmet)); + p.getInventory().setChestplate(UtilItem.makeUnbreakable(chest)); + p.getInventory().setLeggings(UtilItem.makeUnbreakable(leggings)); + p.getInventory().setBoots(UtilItem.makeUnbreakable(boots)); if (round >= 4) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java index 990304b25..04778d2fb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java @@ -285,16 +285,20 @@ public class HideSeek extends TeamGame } }; - public HideSeek(ArcadeManager manager) + public HideSeek(ArcadeManager manager) { - super(manager, GameType.HideSeek, - - new Kit[] - { - new KitHiderSwapper(manager), new KitHiderQuick(manager), new KitHiderShocker(manager), - new KitHiderTeleporter(manager), new NullKit(manager), new KitSeekerLeaper(manager), - new KitSeekerTNT(manager), new KitSeekerRadar(manager), - }, + this(manager, + new Kit[] + { + new KitHiderSwapper(manager), new KitHiderQuick(manager), new KitHiderShocker(manager), + new KitHiderTeleporter(manager), new NullKit(manager), new KitSeekerLeaper(manager), + new KitSeekerTNT(manager), new KitSeekerRadar(manager), + }); + } + + public HideSeek(ArcadeManager manager, Kit[] kits) + { + super(manager, GameType.HideSeek, kits, new String[] { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/modes/Countdown.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/modes/Countdown.java index 6cc08e3fa..2b8d0270b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/modes/Countdown.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/modes/Countdown.java @@ -1,15 +1,14 @@ package nautilus.game.arcade.game.games.hideseek.modes; -import java.util.ArrayList; - import org.bukkit.Bukkit; import org.bukkit.Material; +import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; -import org.bukkit.inventory.ItemStack; -import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.F; import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTextBottom; import mineplex.core.common.util.UtilTime; @@ -20,6 +19,12 @@ import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.games.hideseek.HideSeek; import nautilus.game.arcade.game.games.hideseek.forms.BlockForm; import nautilus.game.arcade.game.games.hideseek.forms.Form; +import nautilus.game.arcade.game.games.hideseek.kits.KitHiderSwapper; +import nautilus.game.arcade.game.games.hideseek.kits.KitSeekerLeaper; +import nautilus.game.arcade.game.games.hideseek.kits.KitSeekerRadar; +import nautilus.game.arcade.game.games.hideseek.kits.KitSeekerTNT; +import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.kit.NullKit; /** * Countdown @@ -35,7 +40,12 @@ public class Countdown extends HideSeek public Countdown(ArcadeManager manager) { - super(manager); + super(manager, + new Kit[] + { + new KitHiderSwapper(manager), new NullKit(manager), new KitSeekerLeaper(manager), + new KitSeekerTNT(manager), new KitSeekerRadar(manager), + }); _changeInterval = 30; } @@ -55,6 +65,17 @@ public class Countdown extends HideSeek if(!IsLive()) return; + if (event.getType() == UpdateType.SEC) + { + if(System.currentTimeMillis() > _lastChanged + 25000) + { + for (Player player : UtilServer.getPlayers()) + { + player.playSound(player.getLocation(), Sound.NOTE_PLING, 2F, 2F); + } + } + } + if (event.getType() != UpdateType.TICK) return; @@ -85,7 +106,10 @@ public class Countdown extends HideSeek for (Player player : GetPlayers(true)) { if(!getForms().containsKey(player)) + { + UtilPlayer.message(player, F.main("Game", "Hiders have changed forms!")); continue; + } getForms().get(player).Remove(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java index 3fea362b0..8c3c71f95 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java @@ -30,17 +30,9 @@ public class Micro extends TeamGame private ArrayList _blocks = new ArrayList(); private ArrayList _glass = new ArrayList(); - public Micro(ArcadeManager manager) + public Micro(ArcadeManager manager, Kit[] kits) { - super(manager, GameType.Micro, - - new Kit[] - { - new KitArcher(manager), - new KitWorker(manager), - new KitFighter(manager) - }, - + super(manager, GameType.Micro, kits, new String[] { "Small game, big strategy!", @@ -72,6 +64,18 @@ public class Micro extends TeamGame ); } + public Micro(ArcadeManager manager) + { + this(manager, + + new Kit[] + { + new KitArcher(manager), + new KitWorker(manager), + new KitFighter(manager) + }); + } + @Override public void ParseData() { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/TinnyWinners.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/TinnyWinners.java new file mode 100644 index 000000000..fbfb8e756 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/TinnyWinners.java @@ -0,0 +1,79 @@ +package nautilus.game.arcade.game.games.micro.modes; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; + +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.games.champions.ChampionsFixes; +import nautilus.game.arcade.game.games.champions.kits.KitAssassin; +import nautilus.game.arcade.game.games.champions.kits.KitBrute; +import nautilus.game.arcade.game.games.champions.kits.KitKnight; +import nautilus.game.arcade.game.games.champions.kits.KitMage; +import nautilus.game.arcade.game.games.champions.kits.KitRanger; +import nautilus.game.arcade.game.games.micro.Micro; +import nautilus.game.arcade.kit.Kit; + +/** + * TinnyWinners + * + * @author xXVevzZXx + */ +public class TinnyWinners extends Micro +{ + + public TinnyWinners(ArcadeManager manager) + { + super(manager, + + new Kit[] + { + new KitBrute(manager), + new KitRanger(manager), + new KitKnight(manager), + new KitMage(manager), + new KitAssassin(manager), + }); + + Manager.GetDamage().UseSimpleWeaponDamage = false; + Manager.getCosmeticManager().setHideParticles(true); + + Manager.getClassManager().GetItemFactory().getProximityManager().setProxyLimit(6); + + StrictAntiHack = true; + TeamArmor = false; + + new ChampionsFixes(this); + + manager.enableChampionsModules(); + } + + @EventHandler + public void end(GameStateChangeEvent event) + { + if (event.GetState() != GameState.End) + return; + + Manager.disableChampionsModules(); + } + + @Override + @EventHandler + public void FoodUpdate(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK) + return; + + for (Player player : GetPlayers(true)) + player.setFoodLevel(20); + } + + @Override + public String GetMode() + { + return "Tinny Winners"; + } + +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/modes/BunnyHop.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/modes/BunnyHop.java index 01d2920a2..28a31f3e9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/modes/BunnyHop.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/modes/BunnyHop.java @@ -1,7 +1,19 @@ package nautilus.game.arcade.game.games.quiver.modes; +import org.bukkit.Sound; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; + +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; +import mineplex.minecraft.game.core.condition.Condition.ConditionType; import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.games.quiver.Quiver; +import nautilus.game.arcade.game.games.quiver.kits.KitSlamShot; import nautilus.game.arcade.game.games.quiver.modes.kits.KitModedLeaper; import nautilus.game.arcade.kit.Kit; @@ -12,6 +24,8 @@ import nautilus.game.arcade.kit.Kit; */ public class BunnyHop extends Quiver { + + private int _arrowAmount; public BunnyHop(ArcadeManager manager) { @@ -19,6 +33,61 @@ public class BunnyHop extends Quiver { new KitModedLeaper(manager) }); + + _arrowAmount = 2; + } + + @Override + @EventHandler(priority = EventPriority.HIGH) + public void GameStateChange(GameStateChangeEvent event) + { + if (event.GetState() != GameState.Live) + return; + + for (Player player : GetPlayers(true)) + { + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(262, (byte)0, 2, F.item("Super Arrow"))); + player.playSound(player.getLocation(), Sound.PISTON_EXTEND, 3f, 2f); + } + } + + @Override + @EventHandler + public void Death(CombatDeathEvent event) + { + if (event.GetEvent().getEntity() instanceof Player) + { + getDeathTime().put((Player) event.GetEvent().getEntity(), System.currentTimeMillis()); + } + + if (event.GetLog().GetKiller() == null) + return; + + if (!event.GetLog().GetKiller().IsPlayer()) + return; + + Player player = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName()); + if (player == null) + return; + + int amount = _arrowAmount; + + if (GetKit(player) instanceof KitSlamShot) + { + if (Manager.GetCondition().HasCondition(event.GetEvent().getEntity(), + ConditionType.FALLING, null)) + { + amount = _arrowAmount * 2; + } + } + + //New Arrow + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(262, (byte) 0, amount, + F.item("Super Arrow"))); + player.playSound(player.getLocation(), Sound.PISTON_EXTEND, 3f, 2f); + + //Score + AddKill(player); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java index 10f901cd1..39f6dd050 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java @@ -323,6 +323,11 @@ public class Runner extends SoloGame implements IThrown BlockSmash(data.GetThrown()); } + + public HashMap getBlocks() + { + return _blocks; + } @Override public void Idle(ProjectileUser data) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/modes/FasterThanLight.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/modes/FasterThanLight.java index 87fae177a..70aaad6a0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/modes/FasterThanLight.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/modes/FasterThanLight.java @@ -1,10 +1,18 @@ package nautilus.game.arcade.game.games.runner.modes; +import java.util.HashSet; +import java.util.Iterator; + +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.FallingBlock; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import mineplex.core.common.util.MapUtil; +import mineplex.core.common.util.UtilTime; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.ArcadeManager; @@ -37,6 +45,71 @@ public class FasterThanLight extends Runner player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 40, 2, true, true), true); } } + + @Override + @EventHandler + public void BlockBreak(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK) + return; + + if (!IsLive()) + return; + + //Add Blocks + for (Player player : GetPlayers(true)) + { + //Side Standing + double xMod = player.getLocation().getX() % 1; + if (player.getLocation().getX() < 0) + xMod += 1; + + double zMod = player.getLocation().getZ() % 1; + if (player.getLocation().getZ() < 0) + zMod += 1; + + int xMin = 0; + int xMax = 0; + int zMin = 0; + int zMax = 0; + + if (xMod < 0.3) xMin = -1; + if (xMod > 0.7) xMax = 1; + + if (zMod < 0.3) zMin = -1; + if (zMod > 0.7) zMax = 1; + + for (int x=xMin ; x<=xMax ; x++) + { + for (int z=zMin ; z<=zMax ; z++) + { + AddBlock(player.getLocation().add(x, -0.5, z).getBlock()); + } + } + } + + //Decay + HashSet readd = new HashSet(); + + Iterator blockIterator = getBlocks().keySet().iterator(); + + while (blockIterator.hasNext()) + { + Block block = blockIterator.next(); + + if (!UtilTime.elapsed(getBlocks().get(block), 250)) + continue; + + //Fall + int id = block.getTypeId(); + byte data = block.getData(); + MapUtil.QuickChangeBlockAt(block.getLocation(), Material.AIR); + FallingBlock ent = block.getWorld().spawnFallingBlock(block.getLocation(), id, data); + Manager.GetProjectile().AddThrow(ent, null, this, -1, true, false, false, false, 0.3f); + + blockIterator.remove(); + } + } @Override public String GetMode() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/modes/OverpoweredSkywars.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/modes/OverpoweredSkywars.java index 489fab11c..92509ebfa 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/modes/OverpoweredSkywars.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/modes/OverpoweredSkywars.java @@ -58,7 +58,6 @@ public class OverpoweredSkywars extends TeamSkywars for (int i=0 ; i<1 + UtilMath.r(2) ; i++) { ItemStack item = _playerArmor.getLoot(); - item.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1 + UtilMath.r(3)); chest.getBlockInventory().setItem(getIndex(used), item); } //Food @@ -155,6 +154,8 @@ public class OverpoweredSkywars extends TeamSkywars _playerProjectile.addLoot(new RandomItem(Material.ARROW, 18, 2, 8)); _playerProjectile.addLoot(new RandomItem(Material.SNOW_BALL, 60, 2, 5)); _playerProjectile.addLoot(new RandomItem(Material.EGG, 60, 2, 5)); + _playerProjectile.addLoot(new RandomItem(Material.ENDER_PEARL, 20, 2, 5)); + _playerProjectile.addLoot(new RandomItem(Material.LAVA_BUCKET, 20, 1, 1)); //Block _playerBlock.addLoot(new RandomItem(Material.COBBLESTONE, 30, 8, 16)); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/modes/UHCSkywars.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/modes/UHCSkywars.java new file mode 100644 index 000000000..34bf40a1d --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/modes/UHCSkywars.java @@ -0,0 +1,63 @@ +package nautilus.game.arcade.game.games.skywars.modes; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.entity.EntityDeathEvent; +import org.bukkit.event.entity.EntityRegainHealthEvent; +import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; +import org.bukkit.inventory.ItemStack; +import org.bukkit.scoreboard.DisplaySlot; +import org.bukkit.scoreboard.Objective; + +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.Game.GameState; +import nautilus.game.arcade.game.games.skywars.SoloSkywars; + +/** + * UHCSkywars + * + * @author xXVevzZXx + */ +public class UHCSkywars extends SoloSkywars +{ + + public UHCSkywars(ArcadeManager manager) + { + super(manager); + } + + @EventHandler + public void registerObj(GameStateChangeEvent event) + { + if(event.GetState() != GameState.Prepare) + return; + + Objective objective = Scoreboard.GetScoreboard().registerNewObjective("Health", "health"); + objective.setDisplaySlot(DisplaySlot.PLAYER_LIST); + } + + @EventHandler + public void regenHealth(EntityRegainHealthEvent event) + { + if(event.getRegainReason() == RegainReason.SATIATED) + event.setCancelled(true); + } + + @EventHandler + public void gappleDrop(EntityDeathEvent event) + { + if(event.getEntity() instanceof Player) + { + event.getDrops().add(new ItemStack(Material.GOLDEN_APPLE)); + } + } + + @Override + public String GetMode() + { + return "UHC Skywars"; + } + +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SoloSuperSmash.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SoloSuperSmash.java index c8c1a5082..721291a07 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SoloSuperSmash.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SoloSuperSmash.java @@ -15,6 +15,7 @@ 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.kit.Kit; import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.managers.chat.ChatStatData; @@ -47,6 +48,30 @@ public class SoloSuperSmash extends SuperSmash ); } + public SoloSuperSmash(ArcadeManager manager, Kit[] kits) + { + super(manager, kits, GameType.Smash, new String[] + { + "Each player has 3 respawns", + "Attack to restore hunger!", + "Last player alive wins!" + }); + + this.DamageTeamSelf = true; + + registerChatStats( + Kills, + Deaths, + KDRatio, + BlankLine, + Assists, + DamageTaken, + DamageDealt, + BlankLine, + new ChatStatData("kit", "Kit", true) + ); + } + @EventHandler public void CustomTeamGeneration(GameStateChangeEvent event) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmash.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmash.java index 23c7ff8a7..f8681f097 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmash.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmash.java @@ -85,7 +85,7 @@ public abstract class SuperSmash extends Game public SuperSmash(ArcadeManager manager, GameType type, String[] description) { - super(manager, type, + this(manager, new Kit[] { @@ -114,7 +114,12 @@ public abstract class SuperSmash extends Game new KitSheep(manager) - },description); + }, type, description); + } + + public SuperSmash(ArcadeManager manager, Kit[] kits, GameType type, String[] description) + { + super(manager, type, kits, description); this.DeathOut = false; @@ -493,4 +498,9 @@ public abstract class SuperSmash extends Game int amount = Math.max(1, (int)(event.GetDamage()/2)); UtilPlayer.hunger(damager, amount); } + + public HashMap getLiveMap() + { + return _lives; + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/modes/RandomKitSSM.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/modes/RandomKitSSM.java new file mode 100644 index 000000000..5d7e8dec3 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/modes/RandomKitSSM.java @@ -0,0 +1,157 @@ +package nautilus.game.arcade.game.games.smash.modes; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityDeathEvent; + +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilServer; +import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.games.smash.SoloSuperSmash; +import nautilus.game.arcade.game.games.smash.kits.KitBlaze; +import nautilus.game.arcade.game.games.smash.kits.KitChicken; +import nautilus.game.arcade.game.games.smash.kits.KitCow; +import nautilus.game.arcade.game.games.smash.kits.KitCreeper; +import nautilus.game.arcade.game.games.smash.kits.KitEnderman; +import nautilus.game.arcade.game.games.smash.kits.KitGolem; +import nautilus.game.arcade.game.games.smash.kits.KitMagmaCube; +import nautilus.game.arcade.game.games.smash.kits.KitPig; +import nautilus.game.arcade.game.games.smash.kits.KitSheep; +import nautilus.game.arcade.game.games.smash.kits.KitSkeletalHorse; +import nautilus.game.arcade.game.games.smash.kits.KitSkeleton; +import nautilus.game.arcade.game.games.smash.kits.KitSkySquid; +import nautilus.game.arcade.game.games.smash.kits.KitSlime; +import nautilus.game.arcade.game.games.smash.kits.KitSnowman; +import nautilus.game.arcade.game.games.smash.kits.KitSpider; +import nautilus.game.arcade.game.games.smash.kits.KitWitch; +import nautilus.game.arcade.game.games.smash.kits.KitWitherSkeleton; +import nautilus.game.arcade.game.games.smash.kits.KitWolf; +import nautilus.game.arcade.game.games.smash.kits.KitZombie; +import nautilus.game.arcade.game.games.smash.modes.kits.KitPlayer; +import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.SmashKit; + +/** + * RandomKitSSM + * + * @author xXVevzZXx + */ +public class RandomKitSSM extends SoloSuperSmash +{ + + private Kit[] _kits; + + private int _maxLives; + + public RandomKitSSM(ArcadeManager manager) + { + super(manager, new Kit[]{new KitPlayer(manager)}); + + _maxLives = 10; + + _kits = 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 KitZombie(manager), + new KitCow(manager), + + new KitSheep(manager) + + }; + } + + @Override + @EventHandler(priority = EventPriority.HIGH) + public void GameStateChange(GameStateChangeEvent event) + { + super.GameStateChange(event); + + if (event.GetState() != GameState.Prepare) + return; + + for (Player player : GetPlayers(true)) + { + getLiveMap().put(player, _maxLives); + + Kit kit = _kits[UtilMath.r(_kits.length)]; + SetKit(player, kit, true); + } + } + + @EventHandler + public void KitRegister(GameStateChangeEvent event) + { + if (event.GetState() != event.GetGame().KitRegisterState) + return; + + for (Kit kit : _kits) + { + UtilServer.getServer().getPluginManager().registerEvents(kit, Manager.getPlugin()); + + for (Perk perk : kit.GetPerks()) + { + UtilServer.getServer().getPluginManager().registerEvents(perk, Manager.getPlugin()); + perk.registeredEvents(); + } + } + } + + @EventHandler + public void end(GameStateChangeEvent event) + { + if (event.GetState() != GameState.Dead) + return; + + for (Kit kit : _kits) + { + HandlerList.unregisterAll(kit); + + for (Perk perk : kit.GetPerks()) + { + HandlerList.unregisterAll(perk); + perk.unregisteredEvents(); + } + } + } + + @EventHandler + public void kitSwitch(EntityDeathEvent event) + { + if (!(event.getEntity() instanceof Player)) + return; + + Kit kit = _kits[UtilMath.r(_kits.length)]; + SetKit((Player) event.getEntity(), kit, true); + } + + @Override + public String GetMode() + { + return "Random Kit SSM"; + } + +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/modes/kits/KitPlayer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/modes/kits/KitPlayer.java new file mode 100644 index 000000000..bce3ac6e4 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/modes/kits/KitPlayer.java @@ -0,0 +1,47 @@ +package nautilus.game.arcade.game.games.smash.modes.kits; + +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.kit.KitAvailability; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.SmashKit; + +/** + * KitPlayer + * + * @author xXVevzZXx + */ +public class KitPlayer extends SmashKit +{ + + public KitPlayer(ArcadeManager manager) + { + super(manager, "Hipster", KitAvailability.Free, 0, + new String[]{"Always get another kit!"}, new Perk[]{}, EntityType.ZOMBIE, new ItemStack(Material.RECORD_10), "Super", + 1, Sound.BURP); + } + + @Override + public void giveCoreItems(Player player) + { + + } + + @Override + public void giveSuperItems(Player player) + { + + } + + @Override + public void GiveItems(Player player) + { + + } + +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/OverpoweredSurvival.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/OverpoweredSurvival.java index 81f36de90..4f613dcbb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/OverpoweredSurvival.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/OverpoweredSurvival.java @@ -1,8 +1,13 @@ package nautilus.game.arcade.game.games.survivalgames.modes; +import java.util.Arrays; + import org.bukkit.Material ; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.ItemStack; import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilMath; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.loot.RandomItem; import nautilus.game.arcade.ArcadeManager; @@ -44,7 +49,7 @@ public class OverpoweredSurvival extends SoloSurvivalGames // Throwable getBaseLoot().addLoot(new RandomItem(Material.FISHING_ROD, 30)); getBaseLoot().addLoot(new RandomItem(Material.BOW, 20)); - getBaseLoot().addLoot(new RandomItem(Material.ARROW, 20, 1, 3)); + getBaseLoot().addLoot(new RandomItem(Material.ARROW, 40, 4, 12)); // Misc getBaseLoot().addLoot(new RandomItem(Material.EXP_BOTTLE, 40, 5, 20)); @@ -79,15 +84,19 @@ public class OverpoweredSurvival extends SoloSurvivalGames // Supply crate loot // Diamond gear - getCrateLoot().addLoot(new RandomItem(Material.DIAMOND_HELMET, 30)); - getCrateLoot().addLoot(new RandomItem(Material.DIAMOND_CHESTPLATE, 30)); - getCrateLoot().addLoot(new RandomItem(Material.DIAMOND_LEGGINGS, 30)); - getCrateLoot().addLoot(new RandomItem(Material.DIAMOND_BOOTS, 30)); - - // Weapons - getCrateLoot().addLoot(new RandomItem(Material.DIAMOND_SWORD, 24)); - getCrateLoot().addLoot(new RandomItem(Material.DIAMOND_AXE, 16)); + int e = 4; + for (int i = 1; i < 4; i++) + { + getCrateLoot().addLoot(new RandomItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_HELMET.getId(), (byte )0, 1, (short) 0, null, Arrays.asList(new String[]{}), null, false, i, Enchantment.PROTECTION_ENVIRONMENTAL), e*10)); + getCrateLoot().addLoot(new RandomItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_CHESTPLATE.getId(), (byte )0, 1, (short) 0, null, Arrays.asList(new String[]{}), null, false, i, Enchantment.PROTECTION_ENVIRONMENTAL), e*10)); + getCrateLoot().addLoot(new RandomItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_LEGGINGS.getId(), (byte )0, 1, (short) 0, null, Arrays.asList(new String[]{}), null, false, i, Enchantment.PROTECTION_ENVIRONMENTAL), e*10)); + getCrateLoot().addLoot(new RandomItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BOOTS.getId(), (byte )0, 1, (short) 0, null, Arrays.asList(new String[]{}), null, false, i, Enchantment.PROTECTION_ENVIRONMENTAL), e*10)); + // Weapons + getCrateLoot().addLoot(new RandomItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD.getId(), (byte )0, 1, (short) 0, null, Arrays.asList(new String[]{}), null, false, i, Enchantment.DAMAGE_ALL), e*10)); + getCrateLoot().addLoot(new RandomItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_AXE.getId(), (byte )0, 1, (short) 0, null, Arrays.asList(new String[]{}), null, false, i, Enchantment.DAMAGE_ALL), e*10)); + e--; + } // Cooked furnace getFurnace().addLoot(new RandomItem(Material.COOKED_BEEF, 3, 1, 2)); getFurnace() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/UHCSurvivalgames.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/UHCSurvivalgames.java new file mode 100644 index 000000000..4f5e69e3f --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/UHCSurvivalgames.java @@ -0,0 +1,62 @@ +package nautilus.game.arcade.game.games.survivalgames.modes; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.entity.EntityDeathEvent; +import org.bukkit.event.entity.EntityRegainHealthEvent; +import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; +import org.bukkit.inventory.ItemStack; +import org.bukkit.scoreboard.DisplaySlot; +import org.bukkit.scoreboard.Objective; + +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.games.survivalgames.SoloSurvivalGames; + +/** + * UHCSurvivalgames + * + * @author xXVevzZXx + */ +public class UHCSurvivalgames extends SoloSurvivalGames +{ + + public UHCSurvivalgames(ArcadeManager manager) + { + super(manager); + } + + @EventHandler + public void registerObj(GameStateChangeEvent event) + { + if(event.GetState() != GameState.Prepare) + return; + + Objective objective = Scoreboard.GetScoreboard().registerNewObjective("Health", "health"); + objective.setDisplaySlot(DisplaySlot.PLAYER_LIST); + } + + @EventHandler + public void regenHealth(EntityRegainHealthEvent event) + { + if(event.getRegainReason() == RegainReason.SATIATED) + event.setCancelled(true); + } + + @EventHandler + public void gappleDrop(EntityDeathEvent event) + { + if(event.getEntity() instanceof Player) + { + event.getDrops().add(new ItemStack(Material.GOLDEN_APPLE)); + } + } + + @Override + public String GetMode() + { + return "UHC Survivalagmes"; + } + +}