From b34d652617e6903350df11e373a67ebc2eae446c Mon Sep 17 00:00:00 2001 From: xXVevzZXx Date: Sat, 25 Jun 2016 06:35:08 +0200 Subject: [PATCH] Add Lucky Bridges, CookieFight and OP MB --- .../src/nautilus/game/arcade/GameType.java | 7 +- .../game/games/bridge/modes/LuckyBridges.java | 82 +++++++++++++++++++ .../games/bridge/modes/OverpoweredBridge.java | 12 +-- .../game/arcade/game/games/micro/Micro.java | 25 +++--- .../game/games/micro/modes/CookieFight.java | 55 +++++++++++++ .../micro/modes/OverpoweredMicroBattles.java | 35 ++++++++ .../games/micro/modes/kits/KitOverlord.java | 49 +++++++++++ 7 files changed, 247 insertions(+), 18 deletions(-) create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/modes/LuckyBridges.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/CookieFight.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/OverpoweredMicroBattles.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/kits/KitOverlord.java 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 ec3f1e5bb..8d13aa69b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java @@ -10,6 +10,7 @@ import nautilus.game.arcade.game.games.barbarians.Barbarians; import nautilus.game.arcade.game.games.bossbattles.BossBattles; import nautilus.game.arcade.game.games.bouncyballs.BouncyBalls; import nautilus.game.arcade.game.games.bridge.Bridge; +import nautilus.game.arcade.game.games.bridge.modes.LuckyBridges; import nautilus.game.arcade.game.games.bridge.modes.OverpoweredBridge; import nautilus.game.arcade.game.games.bridge.modes.SpeedBridges ; import nautilus.game.arcade.game.games.build.Build; @@ -41,6 +42,8 @@ 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.CookieFight; +import nautilus.game.arcade.game.games.micro.modes.OverpoweredMicroBattles; import nautilus.game.arcade.game.games.micro.modes.TinyWinners; import nautilus.game.arcade.game.games.milkcow.MilkCow; import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague; @@ -195,19 +198,19 @@ public enum GameType GameType.WitherAssault, GameType.Wizards, GameType.ZombieSurvival}, true), Brawl(null, new GameMode[]{ - new GameMode(OverpoweredBridge.class, GameType.Bridge, "OP Bridges"), new GameMode(SpeedBridges.class, GameType.Bridge, "Speed Bridges"), + new GameMode(OverpoweredBridge.class, GameType.Bridge, "OP Bridges"), new GameMode(SpeedBridges.class, GameType.Bridge, "Speed Bridges"), new GameMode(LuckyBridges.class, GameType.Bridge, "Lucky Bridges"), new GameMode(OverpoweredGladiators.class, GameType.Gladiators, "OP Gladiators"), new GameMode(ChampionsGladiators.class, GameType.Gladiators, "Champions Gladiators"), new GameMode(OverpoweredSkywars.class, GameType.Skywars, "OP Skywars"), new GameMode(UHCSkywars.class, GameType.Skywars, "UHC Skywars"), new GameMode(TeamBuild.class, GameType.Build, "Team Master Builders"), new GameMode(DukesOfDecoration.class, GameType.Build, "Dukes Of Decoration"), new GameMode(CutClean.class, GameType.UHC, "Cut Clean"), new GameMode(GodBattles.class, GameType.UHC, "God Battles"), new GameMode(BloodDiamonds.class, GameType.UHC, "Blood Diamonds"), new GameMode(Assassins.class, GameType.UHC, "Assassins"), new GameMode(OverpoweredSurvival.class, GameType.SurvivalGames, "OP Survival Games"), new GameMode(UHCSurvivalgames.class, GameType.SurvivalGames, "UHC Survivalgames"), + new GameMode(TinyWinners.class, GameType.Micro, "Tiny Winners"), new GameMode(OverpoweredMicroBattles.class, GameType.Micro, "OP Micro Battles"), new GameMode(CookieFight.class, GameType.Micro, "Cookie Fight"), new GameMode(UltraSpleef.class, GameType.Spleef, "Ultra Spleef"), new GameMode(RandomKitSSM.class, GameType.Smash, "Random Kit SSM"), new GameMode(EweHeroes.class, GameType.Sheep, "Heroes Of The Ewe"), new GameMode(FasterThanLight.class, GameType.Runner, "Faster Than Light"), new GameMode(BunnyHop.class, GameType.Quiver, "Bunny Hop"), - new GameMode(TinyWinners.class, GameType.Micro, "Tiny Winners"), new GameMode(Countdown.class, GameType.HideSeek, "Countdown"), }, GameDisplay.Brawl, null, false, null, false, true); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/modes/LuckyBridges.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/modes/LuckyBridges.java new file mode 100644 index 000000000..90e09e02d --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/modes/LuckyBridges.java @@ -0,0 +1,82 @@ +package nautilus.game.arcade.game.games.bridge.modes; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.event.EventHandler; +import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.common.util.UtilMath; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.GameType; +import nautilus.game.arcade.game.games.AbsorptionFix; +import nautilus.game.arcade.game.games.bridge.Bridge; + +/** + * LuckyBridges gamemode for Bridges + * + * @author xXVevzZXx + */ +public class LuckyBridges extends Bridge +{ + + private HashMap> _drops; + + public LuckyBridges(ArcadeManager manager) + { + super(manager, GameType.Brawl); + + _drops = new HashMap<>(); + + _drops.put(Material.DIAMOND_ORE, Arrays.asList( + Material.DIAMOND_HELMET, Material.DIAMOND_CHESTPLATE, Material.DIAMOND_LEGGINGS, Material.DIAMOND_BOOTS, + Material.DIAMOND_PICKAXE, Material.DIAMOND_AXE, Material.DIAMOND_SWORD)); + + + _drops.put(Material.IRON_ORE, Arrays.asList( + Material.IRON_HELMET, Material.IRON_CHESTPLATE, Material.IRON_LEGGINGS, Material.IRON_BOOTS, + Material.IRON_PICKAXE, Material.IRON_AXE, Material.IRON_SWORD)); + + + _drops.put(Material.GOLD_ORE, Arrays.asList( + Material.GOLD_HELMET, Material.GOLD_CHESTPLATE, Material.GOLD_LEGGINGS, Material.GOLD_BOOTS, + Material.GOLD_PICKAXE, Material.GOLD_AXE, Material.GOLD_SWORD, Material.GOLDEN_APPLE)); + + new AbsorptionFix(this); + } + + @EventHandler + public void mine(BlockBreakEvent event) + { + for (Material mat : _drops.keySet()) + { + if (event.getBlock().getType() == mat) + { + event.setCancelled(true); + event.getBlock().setType(Material.AIR); + + Bukkit.getScheduler().runTaskLater(Manager.getPlugin(), new Runnable() + { + @Override + public void run() + { + event.getBlock().getWorld().dropItem( + event.getBlock().getLocation().add(0.5, 0.2, 0.5), + new ItemStack(_drops.get(mat).get(UtilMath.r(_drops.get(mat).size())))); + } + }, 1); + } + } + } + + @Override + public String GetMode() + { + return "Lucky Bridges"; + } + +} 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 a81bdfde5..3f356ea96 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 @@ -50,12 +50,6 @@ public class OverpoweredBridge extends Bridge WorldBoundaryKill = true; new AbsorptionFix(this); - } - - @Override - public void ParseData() - { - _starterChests = new HashMap<>(); _starterItems = new HashMap<>(); _starterItems.put(Material.WOOD, 64); @@ -68,6 +62,12 @@ public class OverpoweredBridge extends Bridge _starterItems.put(Material.EXP_BOTTLE, 64); _starterItems.put(Material.COOKED_BEEF, 64); _starterItems.put(Material.DIAMOND, 300); + } + + @Override + public void ParseData() + { + _starterChests = new HashMap<>(); ParseLavaBridge(); ParseWoodBridge(); 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 9ad6382c3..0b62093a5 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,6 +30,19 @@ public class Micro extends TeamGame private ArrayList _blocks = new ArrayList(); private ArrayList _glass = new ArrayList(); + public Micro(ArcadeManager manager, GameType type) + { + this(manager, + + new Kit[] + { + new KitArcher(manager), + new KitWorker(manager), + new KitFighter(manager) + }, + GameType.Micro); + } + public Micro(ArcadeManager manager, Kit[] kits, GameType type) { super(manager, type, kits, @@ -54,16 +67,8 @@ public class Micro extends TeamGame public Micro(ArcadeManager manager) { - this(manager, - - new Kit[] - { - new KitArcher(manager), - new KitWorker(manager), - new KitFighter(manager) - }, - GameType.Micro); - + this(manager, GameType.Micro); + registerStatTrackers( new KillsWithinGameStatTracker(this, 8, "Annihilation") ); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/CookieFight.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/CookieFight.java new file mode 100644 index 000000000..526797798 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/CookieFight.java @@ -0,0 +1,55 @@ +package nautilus.game.arcade.game.games.micro.modes; + +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilPlayer; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.GameType; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.games.micro.Micro; + +/** + * CookieFight + * + * @author xXVevzZXx + */ +public class CookieFight extends Micro +{ + + private int _enchantmentLevel; + + public CookieFight(ArcadeManager manager) + { + super(manager, GameType.Brawl); + + _enchantmentLevel = 250; + } + + @EventHandler + public void cookie(GameStateChangeEvent event) + { + if (event.GetState() != GameState.Live) + return; + + for (Player player : GetPlayers(true)) + { + ItemStack item = new ItemStack(Material.COOKIE); + item.addUnsafeEnchantment(Enchantment.KNOCKBACK, _enchantmentLevel); + player.getInventory().addItem(item); + + UtilPlayer.message(player, F.main("Game", "Oh look, you got a Cookie!")); + } + } + + @Override + public String GetMode() + { + return "Cookie Fight"; + } + +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/OverpoweredMicroBattles.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/OverpoweredMicroBattles.java new file mode 100644 index 000000000..d02b74d13 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/OverpoweredMicroBattles.java @@ -0,0 +1,35 @@ +package nautilus.game.arcade.game.games.micro.modes; + +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.GameType; +import nautilus.game.arcade.game.games.micro.Micro; +import nautilus.game.arcade.game.games.micro.modes.kits.KitOverlord; +import nautilus.game.arcade.kit.Kit; + +/** + * OPMicroBattles + * + * @author xXVevzZXx + */ +public class OverpoweredMicroBattles extends Micro +{ + + public OverpoweredMicroBattles(ArcadeManager manager) + { + super(manager, + new Kit[] + { + new KitOverlord(manager) + }, + GameType.Brawl); + + TeamArmor = false; + } + + @Override + public String GetMode() + { + return "OP Micro Battles"; + } + +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/kits/KitOverlord.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/kits/KitOverlord.java new file mode 100644 index 000000000..de942c8d7 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/kits/KitOverlord.java @@ -0,0 +1,49 @@ +package nautilus.game.arcade.game.games.micro.modes.kits; + +import org.bukkit.Material; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.itemstack.ItemStackFactory; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.kit.KitAvailability; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.ProgressingKit; +import nautilus.game.arcade.kit.perks.PerkFletcher; + +public class KitOverlord extends ProgressingKit +{ + private static final String[] DESCRIPTION = { + "You tell me I'am OP?!", + }; + + private static final Perk[] PERKS = { + new PerkFletcher(20, 3, true) + }; + + private static final ItemStack IN_HAND = new ItemStack(Material.GOLDEN_APPLE); + + private static final ItemStack[] PLAYER_ITEMS = { + ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD), + ItemStackFactory.Instance.CreateStack(Material.DIAMOND_PICKAXE), + ItemStackFactory.Instance.CreateStack(Material.BOW), + ItemStackFactory.Instance.CreateStack(Material.GOLDEN_APPLE, 5) + }; + + public KitOverlord(ArcadeManager manager) + { + super(manager, "Overlord", "microoverlord", KitAvailability.Free, DESCRIPTION, PERKS, EntityType.ZOMBIE, IN_HAND); + } + + @Override + public void GiveItems(Player player) + { + player.getInventory().addItem(PLAYER_ITEMS); + + player.getInventory().setHelmet(new ItemStack(Material.DIAMOND_HELMET)); + player.getInventory().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE)); + player.getInventory().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS)); + player.getInventory().setBoots(new ItemStack(Material.DIAMOND_BOOTS)); + } +}