diff --git a/Mineplex.Core/src/mineplex/core/game/GameDisplay.java b/Mineplex.Core/src/mineplex/core/game/GameDisplay.java index 6f7e2de1..fb6f9a41 100644 --- a/Mineplex.Core/src/mineplex/core/game/GameDisplay.java +++ b/Mineplex.Core/src/mineplex/core/game/GameDisplay.java @@ -17,6 +17,7 @@ public enum GameDisplay implements Display CastleAssault("Castle Assault", Material.DIAMOND_CHESTPLATE, (byte)0, GameCategory.NONE, 67, true), CastleAssaultTDM("Castle Assault TDM", Material.DIAMOND_CHESTPLATE, (byte)0, GameCategory.NONE, 68, false), CastleSiege("Castle Siege", Material.DIAMOND_CHESTPLATE, (byte)0, GameCategory.NONE, 4, true), + BetaCastleSiege("Castle Siege", Material.DIAMOND_CHESTPLATE, (byte)0, GameCategory.NONE, 4, true), ChampionsDominate("Champions Domination", "Champions", Material.BEACON, (byte)0, GameCategory.HARDCORE, 6, true), ChampionsTDM("Champions TDM", "Champions", Material.GOLD_SWORD, (byte)0, GameCategory.NONE, 5, true), Christmas("Christmas Chaos", Material.SNOW_BALL, (byte)0, GameCategory.EVENT, 8, false), diff --git a/Mineplex.Core/src/mineplex/core/game/kit/GameKit.java b/Mineplex.Core/src/mineplex/core/game/kit/GameKit.java index b55ce06a..a9dfe5e4 100644 --- a/Mineplex.Core/src/mineplex/core/game/kit/GameKit.java +++ b/Mineplex.Core/src/mineplex/core/game/kit/GameKit.java @@ -748,6 +748,7 @@ public enum GameKit 0 ), + CASTLE_SIEGE_UNDEAD_GHOUL ( 4, @@ -850,6 +851,215 @@ public enum GameKit 0 ), + //Castle Siege Beta + + CASTLE_SIEGE_WOLF_BETA + ( + 0, + GameDisplay.CastleSiege, + "Castle Wolf", + "castlewolf", + new String[] + { + "My bark is as strong as my bite.", + C.blankLine, + C.cGrayB + "THIS KIT IS GIVEN TO DEFENDERS WHEN THEY " + C.cRedB + "DIE" + }, + new KitEntityData<> + ( + Wolf.class, + new ItemStack(Material.BONE) + ) + ), + + CASTLE_SIEGE_HUMAN_MARKSMAN_BETA + ( + 1, + GameDisplay.CastleSiege, + "Castle Marksman", + "castlemarksman", + new String[] + { + "Arms steady; fire at will.", + C.blankLine, + receiveArrow(1, 2, 4), + "Charge your Bow to use " + C.cGreen + "Barrage" + }, + new KitEntityData<> + ( + Zombie.class, + new ItemStack(Material.BOW), + new ItemStack[] + { + new ItemStack(Material.CHAINMAIL_BOOTS), + new ItemStack(Material.CHAINMAIL_LEGGINGS), + new ItemStack(Material.DIAMOND_CHESTPLATE), + new ItemStack(Material.CHAINMAIL_HELMET) + } + ) + ), + + CASTLE_SIEGE_HUMAN_KNIGHT_BETA + ( + 2, + GameDisplay.CastleSiege, + "Castle Knight", + "castleknight", + new String[] + { + "Master fencer at your service; both the sport, and the job..", + C.blankLine, + receiveItem("Fence", 1, 40, 2), + "Take " + C.cGreen + "85%" + C.cGray + " knockback", + "Deal " + C.cGreen + "115%" + C.cGray + " knockback", + }, + new KitEntityData<> + ( + Zombie.class, + new ItemStack(Material.IRON_SWORD), + new ItemStack[] + { + new ItemStack(Material.IRON_BOOTS), + new ItemStack(Material.IRON_LEGGINGS), + new ItemStack(Material.IRON_CHESTPLATE), + new ItemStack(Material.IRON_HELMET) + } + ), + 0 + ), + + CASTLE_SIEGE_HUMAN_PALADIN_BETA + ( + 3, + GameDisplay.CastleSiege, + "Castle Paladin", + "castlepaladin", + new String[] + { + "Stand your ground, we got this!", + C.blankLine, + click(false, "your sword") + " to give buffs to nearby humans and wolves", + "Wolves receive " + C.cGreen + "Speed I" + C.cGray + " and Humans receive " + C.cGreen + "Resistance I", + "Take " + C.cGreen + "10%" + C.cGray + " less damage from attacks", + }, + new KitEntityData<> + ( + Zombie.class, + new ItemStack(Material.STONE_SWORD), + new ItemStack[] + { + new ItemStack(Material.GOLD_BOOTS), + new ItemStack(Material.GOLD_LEGGINGS), + new ItemStack(Material.GOLD_CHESTPLATE), + new ItemStack(Material.GOLD_HELMET) + } + ), +// getAchievementsFor(AchievementCategory.CASTLE_SIEGE) + 0 + ), + + CASTLE_SIEGE_UNDEAD_GHOUL_BETA + ( + 4, + GameDisplay.CastleSiege, + "Undead Ghoul", + "undeadghoul", + new String[] + { + "The walls thought they were too high for me; I proved them wrong.", + C.blankLine, + click(false, "your axe to use " + C.cGreen + "Ghoul Leap"), + }, + new KitEntityData<> + ( + PigZombie.class, + new ItemStack(Material.STONE_AXE) + ) + ), + + CASTLE_SIEGE_UNDEAD_ARCHER_BETA + ( + 5, + GameDisplay.CastleSiege, + "Undead Archer", + "undeadarcher", + new String[] + { + "I've got a bone to pick with you.", + C.blankLine, + "You can pickup arrows shot from Defenders", + "Take " + C.cGreen + "-1" + C.cGray + " damage from attacks", + receiveArrow(1, 8, 2) + }, + new KitEntityData<> + ( + Skeleton.class, + new ItemStack(Material.BOW) + ), + 0 + ), + + CASTLE_SIEGE_UNDEAD_ZOMBIE_BETA + ( + 6, + GameDisplay.CastleSiege, + "Undead Zombie", + "undeadzombie", + new String[] + { + "Keep those arrows coming.", + C.blankLine, + "Receive " + C.cGreen + "Regeneration III" + }, + new KitEntityData<> + ( + Zombie.class, + new ItemStack(Material.STONE_AXE) + ), + 0 + ), + CASTLE_SIEGE_UNDEAD_ZOMBIE_2_BETA + ( + 99, + GameDisplay.CastleSiege, + "Undead Zombie 2", + "undeadzombie2", + new String[] + { + "Keep those arrows coming 2 .", + C.blankLine, + "Receive " + C.cGreen + "Regeneration 255" + }, + new KitEntityData<> + ( + Player.class, + new ItemStack(Material.STONE_AXE) + ), + 0 + ), + + CASTLE_SIEGE_UNDEAD_SUMMONER_BETA + ( + 7, + GameDisplay.CastleSiege, + "Undead Summoner", + "undeadsummoner", + new String[] + { + "Say hello to my little friend.", + C.blankLine, + click(false, "your eggs to spawn undead mobs to help you fight") + }, + new KitEntityData<> + ( + Skeleton.class, + new ItemStack(Material.POTION), + SkeletonType.WITHER.ordinal() + ), +// getAchievementsFor(AchievementCategory.CASTLE_SIEGE) + 0 + ), + // Champions CHAMPIONS_BRUTE diff --git a/Mineplex.Core/target/classes/mineplex/core/game/GameDisplay.class b/Mineplex.Core/target/classes/mineplex/core/game/GameDisplay.class index 3f765646..6a04424f 100644 Binary files a/Mineplex.Core/target/classes/mineplex/core/game/GameDisplay.class and b/Mineplex.Core/target/classes/mineplex/core/game/GameDisplay.class differ diff --git a/Mineplex.Core/target/classes/mineplex/core/game/kit/GameKit$3.class b/Mineplex.Core/target/classes/mineplex/core/game/kit/GameKit$3.class index 3c4d3fe7..3482dff8 100644 Binary files a/Mineplex.Core/target/classes/mineplex/core/game/kit/GameKit$3.class and b/Mineplex.Core/target/classes/mineplex/core/game/kit/GameKit$3.class differ diff --git a/Mineplex.Core/target/classes/mineplex/core/game/kit/GameKit$4.class b/Mineplex.Core/target/classes/mineplex/core/game/kit/GameKit$4.class index 24ada4b1..f6c66c84 100644 Binary files a/Mineplex.Core/target/classes/mineplex/core/game/kit/GameKit$4.class and b/Mineplex.Core/target/classes/mineplex/core/game/kit/GameKit$4.class differ diff --git a/Mineplex.Core/target/classes/mineplex/core/game/kit/GameKit$5.class b/Mineplex.Core/target/classes/mineplex/core/game/kit/GameKit$5.class index 797fcd9a..97ca9c06 100644 Binary files a/Mineplex.Core/target/classes/mineplex/core/game/kit/GameKit$5.class and b/Mineplex.Core/target/classes/mineplex/core/game/kit/GameKit$5.class differ diff --git a/Mineplex.Core/target/classes/mineplex/core/game/kit/GameKit.class b/Mineplex.Core/target/classes/mineplex/core/game/kit/GameKit.class index f9704f58..39260557 100644 Binary files a/Mineplex.Core/target/classes/mineplex/core/game/kit/GameKit.class and b/Mineplex.Core/target/classes/mineplex/core/game/kit/GameKit.class differ diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index a8810db2..7ea7542e 100644 --- a/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -86,6 +86,7 @@ import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.GameServerConfig; import nautilus.game.arcade.game.GameTeam; +import nautilus.game.arcade.game.games.Beta; import nautilus.game.arcade.game.games.event.EventModule; import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague; import nautilus.game.arcade.kit.Kit; @@ -135,6 +136,7 @@ import java.util.*; public class ArcadeManager extends MiniPlugin implements IRelation { + public enum Perm implements Permission { USE_MENU_DURING_GAME, @@ -1358,6 +1360,10 @@ public class ArcadeManager extends MiniPlugin implements IRelation // Confirm custom directory - Testing Purposes // System.out.println("Current Map Directory: " + fileLocation); + if(gameName.equals("Castle Siege Beta")){ + gameName = "Castle Siege"; + } + File folder = new File("update" + "/" + "maps" + "/" + gameName); System.out.println(folder.getAbsolutePath() + " -=-=-=-=-="); if (!folder.exists()) diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java index 25405277..fd0e9cdd 100644 --- a/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java @@ -21,6 +21,7 @@ import nautilus.game.arcade.game.games.cakewars.modes.OPCakeWars; import nautilus.game.arcade.game.games.castleassault.CastleAssault; import nautilus.game.arcade.game.games.castleassault.CastleAssaultTDM; import nautilus.game.arcade.game.games.castlesiegenew.CastleSiegeNew; +import nautilus.game.arcade.game.games.castlesiegebeta.BetaCastleSiege; import nautilus.game.arcade.game.games.champions.ChampionsCTF; import nautilus.game.arcade.game.games.champions.ChampionsDominate; import nautilus.game.arcade.game.games.champions.ChampionsTDM; @@ -96,6 +97,7 @@ public enum GameType implements Voteable CastleAssault(CastleAssault.class, GameDisplay.CastleAssault), CastleAssaultTDM(CastleAssaultTDM.class, GameDisplay.CastleAssaultTDM), CastleSiege(CastleSiegeNew.class, GameDisplay.CastleSiege), + BetaCastleSiege(BetaCastleSiege.class, GameDisplay.BetaCastleSiege), ChampionsCTF(ChampionsCTF.class, GameDisplay.ChampionsCTF), ChampionsDominate(ChampionsDominate.class, GameDisplay.ChampionsDominate), ChampionsTDM(ChampionsTDM.class, GameDisplay.ChampionsTDM), diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java index 6d9ba9c1..98aa92f0 100644 --- a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java @@ -313,7 +313,7 @@ public abstract class Game extends ListenerComponent implements Lifetimed public boolean FirstKill = true; public int FirstKillReward = 10; - public String Winner = "Nobody"; + public String Winner = "The Senate"; public GameTeam WinnerTeam = null; //ELO diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiege.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiege.java new file mode 100644 index 00000000..447b4d12 --- /dev/null +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiege.java @@ -0,0 +1,747 @@ +package nautilus.game.arcade.game.games.castlesiegebeta; + +import mineplex.core.common.util.*; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.preferences.Preference; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.core.combat.CombatComponent; +import mineplex.minecraft.game.core.condition.ConditionFactory; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.GameType; +import nautilus.game.arcade.events.FirstBloodEvent; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.events.PlayerGameRespawnEvent; +import nautilus.game.arcade.game.GameTeam; +import nautilus.game.arcade.game.TeamGame; +import nautilus.game.arcade.game.games.Beta; +import nautilus.game.arcade.game.games.castlesiegebeta.kits.*; +import nautilus.game.arcade.game.modules.SpawnShieldModule; +import nautilus.game.arcade.game.modules.compass.CompassModule; +import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.kit.NullKit; +import nautilus.game.arcade.stats.BloodThirstyStatTracker; +import nautilus.game.arcade.stats.TeamDeathsStatTracker; +import nautilus.game.arcade.stats.TeamKillsStatTracker; +import nautilus.game.arcade.stats.WinAsTeamStatTracker; +import org.bukkit.*; +import org.bukkit.block.Block; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; +import org.bukkit.entity.Arrow; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.ItemSpawnEvent; +import org.bukkit.event.entity.PlayerDeathEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerPickupItemEvent; +import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; + + +//import com.mineplex.anticheat.checks.combat.KillauraTypeD; +//import mineplex.core.antihack.AntiHack; + +public class BetaCastleSiege extends TeamGame +{ + + //tics to seconds + private static final int EIGHT_TICKS = 8 * 20; + + // Game Help + private int _undeadIndex = 0; + private int _defenderIndex = 0; + private int _generalIndex = 0; + private ChatColor defenderTipColor; + private ChatColor undeadTipColor; + private ChatColor generalTipColor; + private boolean showDefTip = true; + private boolean showGenTips = false; + + //announcing defender deaths + private PlayerInfo _playerInfo; + private CombatComponent _killer; + + public static final String[] CSDESCRIPTION = { + C.cAqua + "Defenders" + C.cWhite + " must defend the King.", + C.cAqua + "Defenders" + C.cWhite + " win when the sun rises.", + C.cAqua + "Defenders" + C.cWhite + " respawn as wolves.", + "", + C.cRed + "Undead" + C.cWhite + " must kill the King.", + C.cRed + "Undead" + C.cWhite + " lose when the sun rises." + }; + + // Undead Tips - Colored red + private static final String[] UndeadTips = { + "TNT randomly spawns at 3 different locations outside the undead forest.", + "Right-click TNT to pick it up.", + "TNT will automatically explode 30 seconds after being picked up.", + "Undead respawn instantly.", + " Iron Bars and Cracked Stone Bricks are weak points. Blow them open with TNT!", + "Click while holding TNT to explode.", + "Use your axe to break oak fences! Other fences cannot be broken…", + "Opening multiple pathways are useful for the Undead!", + " Iron bars can only be destroyed with TNT", + "The skeleton kit is useful to kill marksmen", + "Skeletons can only pick up extra arrows shot from knights and paladins!" + }; + // Defender Tips - Colored aqua + private static final String[] DefenderTips = { + "Defenders can right-click a fence to pass through it.", + "Avoid retreating as Defenders.", + "Castle Marksmen are important to defense because of their arrows.", + "Defenders respawn as wolves with no armor or weapons.", + "Wolves must wait 6 seconds in between respawns.", + "Coordination and teamwork are important to winning as Defenders." + }; + + // General Tips - Colored yellow + private static final String[] GeneralTips = { + "Use 1.8.9 for the best gameplay experience!", + "Castle Siege is a challenging game! Work together to succeed.", + "Use Team Chat to coordinate! Message in Team Chat using this format: #(message)" + }; + + private static final int START_TIME = 14000; + private static final int UNDEAD_BURN_TIME = 24000; + private static final int DEFENDER_WIN_TIME = UNDEAD_BURN_TIME + 200; + private static final int WOLF_RESPAWN_TIME = 4; + private static final long FENCE_NO_CLIP_TIME = TimeUnit.SECONDS.toMillis(2); + private static final int MAX_ARROW_TICKS = 30 * 20; + + private final Set _listeners = new HashSet<>(); + + private GameTeam _defenders; + private GameTeam _undead; + private final Set _wolves = new HashSet<>(); + + private nautilus.game.arcade.game.games.castlesiegebeta.BetaCastleSiegeKing _king; + + private List _kitNPCSpawns; + private ArrayList _wolfSpawns; + + private Kit _wolfKit; + + public BetaCastleSiege(ArcadeManager manager) + { + + + super(manager, GameType.BetaCastleSiege, new Kit[] + { + new BetaKitHumanWolf(manager), + new BetaKitHumanMarksman(manager), + new BetaKitHumanKnight(manager), + new BetaKitHumanPaladin(manager), + new NullKit(manager), + new BetaKitUndeadGhoul(manager), + new BetaKitUndeadArcher(manager), + new BetaKitUndeadZombie(manager), + new BetaKitUndeadSummoner(manager) + + }, CSDESCRIPTION); + +// AnticheatDisabled = true; +// StrictAntiHack = true; + HungerSet = 20; + DeathOut = false; + WorldTimeSet = START_TIME; + WorldSoilTrample = true; + BlockBreakAllow.add(Material.FENCE.getId()); + BlockPlaceAllow.add(Material.FENCE.getId()); + InventoryClick = true; + SplitKitXP = true; + + manager.GetCreature().SetDisableCustomDrops(true); + + registerStatTrackers( + new BloodThirstyStatTracker(this, "KingGuard", 5, player -> getDefenders().HasPlayer(player), player -> UtilMath.offsetSquared(player, getKing().getEntity()) < 8 * 8 && WorldTimeSet > UNDEAD_BURN_TIME - 60 * 20), + new BloodThirstyStatTracker(this, "WolfKill", 12, this::isWolf, player -> true), + new BloodThirstyStatTracker(this, "BloodThirsty", 50, player -> true, player -> GetTeam(player).equals(getUndead())), + new TeamKillsStatTracker(this), + new TeamDeathsStatTracker(this) + ); + + registerChatStats( + Kills, + Deaths, + KDRatio, + BlankLine, + Assists, + DamageDealt, + DamageTaken + ); + + _king = new nautilus.game.arcade.game.games.castlesiegebeta.BetaCastleSiegeKing(this); + _listeners.add(_king); + + _listeners.add(new nautilus.game.arcade.game.games.castlesiegebeta.BetaCastleSiegeTNTManager(this)); + _listeners.add(new nautilus.game.arcade.game.games.castlesiegebeta.BetaCastleSiegeHorseManager(this)); + + new CompassModule() + .register(this); + + // Disable specific GWEN checks for this game +// AntiHack antiHack = Managers.get(AntiHack.class); +// antiHack.addIgnoredCheck(KillauraTypeD.class); + } + + @Override + public void ParseData() + { + + _defenders = GetTeam(ChatColor.AQUA); + _defenders.SetName("Defenders"); + _defenders.SetRespawnTime(WOLF_RESPAWN_TIME); + + _undead = GetTeam(ChatColor.RED); + _undead.SetName("Undead"); + + boolean undead = false; + + for (Kit kit : GetKits()) + { + if (kit instanceof NullKit) + { + undead = true; + } + else if (undead) + { + _defenders.GetRestrictedKits().add(kit); + } + else + { + _undead.GetRestrictedKits().add(kit); + } + } + + _kitNPCSpawns = WorldData.GetDataLocs("PINK"); + _wolfSpawns = WorldData.GetDataLocs("GREEN"); + + for (Kit kit : GetKits()) + { + if (kit.GetName().contains("Wolf")) + { + _wolfKit = kit; + break; + } + } + + _listeners.forEach(UtilServer::RegisterEvents); + + new SpawnShieldModule() + .registerShield(_wolves::contains, WorldData.GetCustomLocs("129"), UtilAlg.getAverageLocation(_wolfSpawns)) + .register(this); + } + + @EventHandler + public void DisplayCSTips(UpdateEvent event) + { + + if (showDefTip && !showGenTips) { + if (!inLobby() || event.getType() != UpdateType.SLOWER) { + return; + } + + if (Manager.GetGameHostManager().isCommunityServer()) { + return; + } + + defenderTipColor = defenderTipColor == ChatColor.AQUA ? ChatColor.AQUA : ChatColor.AQUA; + String und = C.cWhiteB + "TIP> " + ChatColor.RESET + defenderTipColor + DefenderTips[_defenderIndex]; + + for (Player player : UtilServer.getPlayersCollection()) { + + if (!Manager.getPreferences().get(player).isActive(Preference.GAME_TIPS)) { + continue; + } + + player.playSound(player.getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1f); + UtilPlayer.message(player, und); + } + + _defenderIndex = (_defenderIndex + 1) % DefenderTips.length; + showDefTip = false; + } + + else if (!showDefTip && !showGenTips) { + if (!inLobby() || event.getType() != UpdateType.SLOWER) { + return; + } + + if (Manager.GetGameHostManager().isCommunityServer()) { + return; + } + + undeadTipColor = undeadTipColor == ChatColor.RED ? ChatColor.RED : ChatColor.RED; + String def = C.cWhiteB + "TIP> " + ChatColor.RESET + undeadTipColor + UndeadTips[_undeadIndex]; + + for (Player player : UtilServer.getPlayersCollection()) { + if (!Manager.getPreferences().get(player).isActive(Preference.GAME_TIPS)) { + continue; + } + + player.playSound(player.getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1f); + UtilPlayer.message(player, def); + + } + + _undeadIndex = (_undeadIndex + 1) % UndeadTips.length; + showGenTips = true; + } + + else { + if (!inLobby() || event.getType() != UpdateType.SLOWER) { + return; + } + + if (Manager.GetGameHostManager().isCommunityServer()) { + return; + } + + generalTipColor = generalTipColor == ChatColor.YELLOW ? ChatColor.YELLOW : ChatColor.YELLOW; + String gen = C.cWhiteB + "TIP> " + ChatColor.RESET + generalTipColor + GeneralTips[_generalIndex]; + + for (Player player : UtilServer.getPlayersCollection()) { + if (!Manager.getPreferences().get(player).isActive(Preference.GAME_TIPS)) { + continue; + } + + player.playSound(player.getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1f); + UtilPlayer.message(player, gen); + + } + + _generalIndex = (_generalIndex + 1) % GeneralTips.length; + showGenTips = false; + showDefTip = true; + } + } + + @EventHandler + @Override + public void ScoreboardUpdate(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST || !InProgress()) + { + return; + } + + Scoreboard.writeNewLine(); + + Scoreboard.write(_defenders.GetFormattedName()); + Scoreboard.write((_defenders.GetPlayers(true).size() - _wolves.size()) + " Players"); + + Scoreboard.writeNewLine(); + + Scoreboard.write(C.cDAquaB + "Wolves"); + Scoreboard.write(_wolves.size() + " Players"); + + Scoreboard.writeNewLine(); + + Scoreboard.write(_undead.GetFormattedName()); + Scoreboard.write(_undead.GetPlayers(true).size() + " Players"); + + Scoreboard.writeNewLine(); + + Scoreboard.write(_king.getEntity().getCustomName()); + Scoreboard.write((int) _king.getEntity().getHealth() + " Health"); + + Scoreboard.writeNewLine(); + + // Convert ticks to milliseconds + int timeLeft = (UNDEAD_BURN_TIME - WorldTimeSet) * 50; + Scoreboard.write(C.cGoldB + "Sunrise"); + + if (timeLeft > 0) + { + Scoreboard.write(UtilTime.MakeStr(timeLeft)); + } + else + { + Scoreboard.write("Undead Burning!"); + } + + Scoreboard.draw(); + } + + @EventHandler + public void prepare(GameStateChangeEvent event) + { + if (event.GetState() != GameState.Prepare) + { + return; + } + + // Register Defender win tracker + registerStatTrackers(new WinAsTeamStatTracker(this, _defenders, "ForTheKing")); + + CreatureAllowOverride = true; + + // Move Kit NPCS + int i = 0; + for (Kit kit : GetKits()) + { + if (kit instanceof NullKit || _undead.GetRestrictedKits().contains(kit) || _kitNPCSpawns.size() <= i) + { + continue; + } + + Location location = _kitNPCSpawns.get(i++); + kit.getGameKit().createNPC(location); + } + + CreatureAllowOverride = false; + } + + @EventHandler + public void advanceTime(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK || !IsLive()) + { + return; + } + + WorldTimeSet++; + } + + @EventHandler + public void burnUndead(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST || !IsLive()) + { + return; + } + + if (WorldTimeSet >= UNDEAD_BURN_TIME) + { + ConditionFactory factory = Manager.GetCondition().Factory(); + + for (Player player : _undead.GetPlayers(true)) + { + factory.Ignite("Sun Damage", player, null, 2, false, false); + } + } + } + + @EventHandler + public void setWolfSpawns(GameStateChangeEvent event) + { + + + if (event.GetState() != GameState.Live) + { + return; + } + + _defenders.SetSpawns(_wolfSpawns); + } + + @EventHandler + public void setWolfKit(GameStateChangeEvent event) + { + if (event.GetState() != GameState.Prepare) + { + return; + } + + for (Player player : GetPlayers(true)) + { + Kit kit = GetKit(player); + + if (kit instanceof BetaKitHumanWolf) + { + SetKit(player, GetKits()[1], false); + } + } + } + + @EventHandler + public void setWolfKit(PlayerGameRespawnEvent event) + { + Player player = event.GetPlayer(); + + if (_defenders.HasPlayer(player) && _wolves.add(player)) + { + SetKit(player, _wolfKit, true); + } + + } + + @EventHandler + public void playerQuit(PlayerQuitEvent event) + { + _wolves.remove(event.getPlayer()); + } + + @Override + public void EndCheck() + { + if (!IsLive()) + { + return; + } + + LivingEntity king = _king.getEntity(); + + if (WorldTimeSet > DEFENDER_WIN_TIME || _undead.GetPlayers(true).isEmpty()) + { + // King at full health + if (king.getHealth() == king.getMaxHealth()) + { + _defenders.GetPlayers(true).forEach(player -> AddStat(player, "KingFull", 1, true, false)); + } + + SetCustomWinLine(king.getCustomName() + C.Reset + " has survived the siege!"); + AnnounceEnd(_defenders); + } + else if (king.isDead() || !king.isValid() || _defenders.GetPlayers(true).isEmpty()) + { + String winLine = king.getCustomName() + " " + C.Reset; + Map damagers = _king.getDamagers(); + + if (damagers.isEmpty()) + { + winLine += "has died!"; + } + else + { + Player mostDamager = null; + int mostDamage = 0; + + for (Entry entry : damagers.entrySet()) + { + if (mostDamager == null || mostDamage < entry.getValue()) + { + mostDamager = entry.getKey(); + mostDamage = entry.getValue(); + } + } + + // Not possible but keeps the IDE happy + if (mostDamager == null) + { + return; + } + + if (mostDamager.equals(_king.getLastDamager())) + { + winLine += "was slaughtered by " + _undead.GetColor() + mostDamager.getName(); + } + else + { + winLine += "was killed by " + _undead.GetColor() + _king.getLastDamager().getName() + C.Reset + " while " + _undead.GetColor() + mostDamager.getName() + C.Reset + " dealt most of the damage!"; + } + + // 50%+ damage to the king + if (mostDamage >= (king.getMaxHealth() - king.getHealth()) * 0.5) + { + AddStat(mostDamager, "Assassin", 1, true, false); + } + + // Player who killed the king + AddStat(_king.getLastDamager(), "KingSlayer", 1, true, false); + } + + if (WorldTimeSet > UNDEAD_BURN_TIME - 60 * 20) + { + _undead.GetPlayers(true).forEach(player -> AddStat(player, "CloseCall", 1, true, false)); + } + + SetCustomWinLine(winLine); + AnnounceEnd(_undead); + } + else + { + return; + } + + for (GameTeam team : GetTeamList()) + { + if (WinnerTeam != null && team.equals(WinnerTeam)) + { + for (Player player : team.GetPlayers(false)) + { + AddGems(player, 10, "Winning", false, false); + } + } + + for (Player player : team.GetPlayers(false)) + { + if (player.isOnline()) + { + AddGems(player, 10, "Participation", false, false); + } + } + } + + SetState(GameState.End); + } + + @Override + public void disable() + { + super.disable(); + _wolves.clear(); + _listeners.forEach(UtilServer::Unregister); + _listeners.clear(); + } + + @EventHandler + public void allowNoClipFences(PlayerInteractEvent event) + { + Block block = event.getClickedBlock(); + + if (event.isCancelled() || block == null || block.getType() != Material.FENCE) + { + return; + } + + Player player = event.getPlayer(); + + if (UtilPlayer.isSpectator(player) || !_defenders.HasPlayer(player) || player.getItemInHand() != null && player.getItemInHand().getType() == Material.FENCE) + { + return; + } + + UtilParticle.PlayParticleToAll(ParticleType.FIREWORKS_SPARK, block.getLocation().add(0.5, 0.5, 0.5), 0.2F, 0.2F, 0.2F, 0.01F, 3, ViewDist.SHORT); + block.getWorld().playSound(block.getLocation(), Sound.NOTE_STICKS, 1, 1); + Manager.GetBlockRestore().add(block, Material.AIR.getId(), (byte) 0, FENCE_NO_CLIP_TIME); + } + + @EventHandler + public void removeFences(ItemSpawnEvent event) + { + if (event.getEntity().getItemStack().getType() == Material.FENCE) + { + event.setCancelled(true); + } + } + + @EventHandler + public void removeOldArrows(UpdateEvent event) + { + if (event.getType() != UpdateType.SEC) + { + return; + } + + for (Entity entity : WorldData.World.getEntities()) + { + if (entity instanceof Arrow && entity.getTicksLived() > MAX_ARROW_TICKS) + { + entity.remove(); + } + } + } + + @EventHandler + public void pickupArrows(PlayerPickupItemEvent event) + { + if (event.getItem().getItemStack().getType() != Material.ARROW) + { + return; + } + + Kit kit = GetKit(event.getPlayer()); + + event.setCancelled(kit == null || !(kit instanceof BetaKitUndeadArcher)); + } + + @EventHandler + public void firstBlood(FirstBloodEvent event) + { + AddStat(event.getPlayer(), "FirstBlood", 1, true, false); + } + + @EventHandler + public void handleResistance(CustomDamageEvent event) + { + Player damagee = event.GetDamageePlayer(); + + if (damagee == null) + { + return; + } + + for (PotionEffect effect : damagee.getActivePotionEffects()) + { + if (effect.getType().toString().equals(PotionEffectType.DAMAGE_RESISTANCE.toString())) + { + event.AddMod("Resistance", (effect.getAmplifier() + 1) * -0.2 * event.GetDamage()); + } + } + } + + public boolean isWolf(Player player) + { + return _wolves.contains(player); + } + + @EventHandler + public void announceDeaths(PlayerDeathEvent event){ + + Player killed = event.getEntity(); + String killedName = "Unknown"; + + if (killed instanceof CraftPlayer) + { + killedName = killed.getName(); + } + else + { + killedName = UtilEnt.getName(killed); + } + + Player killer = killed.getKiller(); + String killerName = "Unknown"; + + if (killer instanceof CraftPlayer) + { + killerName = killer.getName(); + } + else + { + killerName = UtilEnt.getName(killer); + } + + GameTeam murderedDudesTeam = Manager.GetGame().GetTeam(killed); + + if (!(murderedDudesTeam == _defenders)){ + return; + } + + if (_wolves.contains(killed)){ + return; + } + + Bukkit.broadcastMessage(C.cBlue + "Death> " + C.cRed + + killerName + C.cGray + + " got the last chomp on " + C.cAqua + + killedName + C.cGray + "."); + + } + + public nautilus.game.arcade.game.games.castlesiegebeta.BetaCastleSiegeKing getKing() + { + return _king; + } + + public GameTeam getDefenders() + { + return _defenders; + } + + public GameTeam getUndead() + { + return _undead; + } +} diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeHorseManager.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeHorseManager.java new file mode 100644 index 00000000..ab8972ad --- /dev/null +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeHorseManager.java @@ -0,0 +1,136 @@ +package nautilus.game.arcade.game.games.castlesiegebeta; + +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilPlayer; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.Game.GameState; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Horse; +import org.bukkit.entity.Horse.Style; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityDeathEvent; +import org.bukkit.event.entity.PlayerDeathEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; +import org.bukkit.inventory.ItemStack; + +public class BetaCastleSiegeHorseManager implements Listener +{ + + private static final int MAX_HEALTH = 60; + private static final ItemStack SADDLE = new ItemStack(Material.SADDLE); + private static final ItemStack ARMOUR = new ItemStack(Material.IRON_BARDING); + + private final BetaCastleSiege _host; + + BetaCastleSiegeHorseManager(BetaCastleSiege host) + { + _host = host; + } + + @EventHandler + public void horseSpawn(GameStateChangeEvent event) + { + if (event.GetState() != GameState.Prepare) + { + return; + } + + _host.CreatureAllowOverride = true; + + for (Location location : _host.WorldData.GetDataLocs("BROWN")) + { + Horse horse = location.getWorld().spawn(location, Horse.class); + + horse.setColor(Horse.Color.BLACK); + horse.setStyle(Style.BLACK_DOTS); + horse.setMaxDomestication(1); + horse.getInventory().setSaddle(SADDLE); + horse.getInventory().setArmor(ARMOUR); + + horse.setMaxHealth(MAX_HEALTH); + horse.setHealth(MAX_HEALTH); + + horse.setCustomName("War Horse"); + } + + _host.CreatureAllowOverride = false; + } + + @EventHandler + public void horseInteract(PlayerInteractEntityEvent event) + { + if (!(event.getRightClicked() instanceof Horse) || !_host.IsLive()) + { + return; + } + + Player player = event.getPlayer(); + + if (UtilPlayer.isSpectator(player) || !_host.getDefenders().HasPlayer(player)) + { + player.sendMessage(F.main("Game", "You cannot mount horses.")); + event.setCancelled(true); + } + else + { + ((Horse) event.getRightClicked()).setOwner(player); + } + } + + @EventHandler(priority = EventPriority.HIGH) + public void horseDamage(CustomDamageEvent event) + { + if (event.isCancelled()) + { + return; + } + + LivingEntity entity = event.GetDamageeEntity(); + + if (!(entity instanceof Horse)) + { + return; + } + + Player damager = event.GetDamagerPlayer(true); + + if (damager == null || _host.getUndead().HasPlayer(damager)) + { + return; + } + + event.SetCancelled("Horse Team Damage"); + } + + @EventHandler + public void horseDeath(EntityDeathEvent event) + { + Entity entity = event.getEntity(); + + if (entity instanceof Horse) + { + Player killer = ((Horse) entity).getKiller(); + + if (killer != null) + { + _host.AddStat(killer, "HorseKiller", 1, false, false); + } + + event.setDroppedExp(0); + event.getDrops().clear(); + } + } + + @EventHandler + public void playerDeath(PlayerDeathEvent event) + { + event.getEntity().eject(); + } +} diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeKing.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeKing.java new file mode 100644 index 00000000..91523a50 --- /dev/null +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeKing.java @@ -0,0 +1,252 @@ +package nautilus.game.arcade.game.games.castlesiegebeta; + +import mineplex.core.common.util.*; +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.events.GameStateChangeEvent; +import nautilus.game.arcade.game.Game.GameState; +import nautilus.game.arcade.game.games.Beta; +import org.bukkit.*; +import org.bukkit.block.Block; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.entity.Zombie; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.block.BlockPlaceEvent; +import org.bukkit.inventory.EntityEquipment; +import org.bukkit.inventory.ItemStack; + +import java.util.*; + +public class BetaCastleSiegeKing implements Listener { + + private static final int MAX_HEALTH = 40; + private static final int DAMAGE_RATE = 400; + private static final int KING_PROTECTION_RANGE_SQUARED = 4; + private static final int KING_FENCE_RANGE_SQUARED = 25; + private static final int KING_TELEPORT_RANGE_SQUARED = 36; + + + + + private final BetaCastleSiege _host; + private Location _location; + private LivingEntity _entity; + + private final Map _damagers; + private Player _lastDamager; + + BetaCastleSiegeKing(BetaCastleSiege host) { + _host = host; + _damagers = new HashMap<>(); + } + + // initializes the game's preparations + @EventHandler + public void prepare(GameStateChangeEvent event) { + if (event.GetState() != GameState.Prepare) { + return; + } + + _location = _host.WorldData.GetDataLocs("YELLOW").get(0); + spawnEntity(); + } + + // spawns the King NPC and executes it through cleaner code / established functions (called above)) + private void spawnEntity() + { + _host.CreatureAllowOverride = true; + + // testing for these users + boolean moppleOnline = UtilPlayer.searchExact("Moppletop") != null; + boolean daneseOnline = UtilPlayer.searchExact("Danese") != null; + boolean toastOnline = UtilPlayer.searchExact("eToast_") != null; + boolean edgyOnline = UtilPlayer.searchExact("MicrosoftEdgy") != null; + boolean rmotheramOnline = UtilPlayer.searchExact("rmotheram") != null; + HashMap nameMappings = new HashMap(); + nameMappings.put("Danese", C.cGreenB + "Lord Danese"); + nameMappings.put("rmotheram", C.cDBlueB + "Lord rmotheram"); + nameMappings.put("eToast_", C.cRedB + "Ya boi eToast"); + nameMappings.put("MicrosoftEdgy", C.cPurpleB + "Emperor Edgy"); + ArrayList players = new ArrayList(); + if(daneseOnline) + players.add("Danese"); + if(rmotheramOnline) + players.add("rmotheram"); + if(toastOnline) + players.add("eToast_"); + if(edgyOnline) + players.add("MicrosoftEdgy"); + + _entity = _location.getWorld().spawn(_location, Zombie.class); + UtilEnt.vegetate(_entity); + UtilEnt.silence(_entity, true); + + // Random number generator (used for randomizing names for the King) + Random rand = new Random(); + + // handle names (above) + if (moppleOnline) { + // All hail Moppletop, our one true god! + _entity.setCustomName(C.cGreenB + "Queen Moppletop"); + } + else if(players.size() > 0) + { + int index = (int) (Math.random()*players.size()); + _entity.setCustomName(nameMappings.get(players.get(index))); + } + else { + _entity.setCustomName(C.cYellowB + "King Sparklez"); + } + + _entity.setCustomNameVisible(true); + _entity.setRemoveWhenFarAway(false); + _entity.setMaxHealth(MAX_HEALTH); + _entity.setHealth(MAX_HEALTH); + + EntityEquipment equipment = _entity.getEquipment(); + + equipment.setItemInHand(new ItemStack(Material.DIAMOND_SWORD)); + equipment.setHelmet(new ItemStack(Material.DIAMOND_HELMET)); + equipment.setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE)); + equipment.setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS)); + equipment.setBoots(new ItemStack(Material.DIAMOND_BOOTS)); + + reset(); + + _host.CreatureAllowOverride = false; + } + + + + private void reset() + { + _entity.teleport(_location); + + List lookAts = _host.WorldData.GetDataLocs("ORANGE"); + if (!lookAts.isEmpty()) + { + UtilEnt.CreatureLook(_entity, lookAts.get(0)); + } + } + + @EventHandler(priority = EventPriority.HIGH) + public void entityDamage(CustomDamageEvent event) + { + if (event.isCancelled() || _entity == null || !_entity.equals(event.GetDamageeEntity())) + { + return; + } + + event.SetCancelled("King"); + + Player damager = event.GetDamagerPlayer(true); + + if (damager == null) + { + return; + } + + if (_host.getDefenders().HasPlayer(damager) || !Recharge.Instance.use(damager, "Damage King", DAMAGE_RATE, false, false)) + { + return; + } + + // Store the damager + _damagers.putIfAbsent(damager, 0); + _damagers.put(damager, _damagers.get(damager) + 1); + _lastDamager = damager; + + if (Beta.enableBeta){ + + _entity.getWorld().playEffect(_entity.getLocation().add(0, 0.5, 0), Effect.STEP_SOUND, Material.REDSTONE_BLOCK); + _entity.getWorld().playSound(_entity.getLocation().add(0, 0.5, 0), Sound.WITHER_HURT,10,1); + _entity.setHealth(_entity.getHealth() - 1); + } + else { + _entity.getWorld().playEffect(_entity.getLocation().add(0, 0.5, 0), Effect.STEP_SOUND, Material.REDSTONE_BLOCK); + _entity.getWorld().playSound(_entity.getLocation().add(0, 0.5, 0), Sound.ZOMBIE_HURT,10,1); + _entity.setHealth(_entity.getHealth() - 1); + } + + _entity.playEffect(EntityEffect.HURT); + } + + @EventHandler + public void updateMovement(UpdateEvent event) + { + if (event.getType() != UpdateType.SEC || _entity == null) + { + return; + } + + double dist = UtilMath.offsetSquared(_entity.getLocation(), _location); + + if (dist > KING_TELEPORT_RANGE_SQUARED) + { + reset(); + } + else if (dist > KING_PROTECTION_RANGE_SQUARED) + { + UtilEnt.CreatureMove(_entity, _location, 1); + } + } + + @EventHandler(priority = EventPriority.HIGH) + public void blockPlace(BlockPlaceEvent event) + { + if (_entity == null) + { + return; + } + + Player player = event.getPlayer(); + Block block = event.getBlock(); + + if (event.isCancelled()) + { + return; + } + + for (Block nearby : UtilBlock.getSurrounding(block, false)) + { + if (nearby.isLiquid()) + { + event.setCancelled(true); + player.sendMessage(F.main("Game", "You cannot place " + F.elem("Barricade") + " in water.")); + return; + } + else if (nearby.getType() == Material.VINE) + { + event.setCancelled(true); + player.sendMessage(F.main("Game", "You cannot place " + F.elem("Barricade") + " near vines.")); + return; + } + } + + if (UtilMath.offsetSquared(_entity.getLocation(), block.getLocation()) < KING_FENCE_RANGE_SQUARED) + { + event.setCancelled(true); + player.sendMessage(F.main("Game", "You cannot place " + F.elem("Barricade") + " near " + _entity.getCustomName() + C.mBody + ".")); + } + } + + public LivingEntity getEntity() + { + return _entity; + } + + public Map getDamagers() + { + return _damagers; + } + + public Player getLastDamager() + { + return _lastDamager; + } +} diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeTNTManager.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeTNTManager.java new file mode 100644 index 00000000..20f5493a --- /dev/null +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeTNTManager.java @@ -0,0 +1,322 @@ +package nautilus.game.arcade.game.games.castlesiegebeta; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; + +import org.bukkit.Color; +import org.bukkit.Effect; +import org.bukkit.FireworkEffect.Type; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.entity.TNTPrimed; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.entity.PlayerDeathEvent; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.blockrestore.BlockRestore; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.MapUtil; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.common.util.UtilFirework; +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; +import mineplex.core.disguise.disguises.DisguiseBase; +import mineplex.core.disguise.disguises.DisguiseLiving; +import mineplex.core.recharge.Recharge; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.Game.GameState; + +public class BetaCastleSiegeTNTManager implements Listener +{ + + private static final long SPAWN_TIME = TimeUnit.SECONDS.toMillis(25); + private static final ItemStack TNT_HELMET = new ItemStack(Material.TNT); + private static final int TOO_FAR_FROM_CASTLE_SQUARED = 256; + private static final int TNT_WEAKNESS_DISTANCE_SQUARED = 16; + private static final long TNT_MAX_TIME = TimeUnit.SECONDS.toMillis(30); + private static final long REGENERATION_TIME = TimeUnit.SECONDS.toMillis(15); + + private final BetaCastleSiege _host; + + private final Map _tntCarrier; + private List _tntSpawns; + private List _tntWeaknesses; + private long _lastTNT; + + BetaCastleSiegeTNTManager(BetaCastleSiege host) + { + _host = host; + _tntCarrier = new HashMap<>(); + } + + @EventHandler + public void live(GameStateChangeEvent event) + { + if (event.GetState() != GameState.Live) + { + return; + } + + _lastTNT = System.currentTimeMillis(); + _tntSpawns = _host.WorldData.GetDataLocs("RED"); + _tntWeaknesses = _host.WorldData.GetDataLocs("BLACK"); + } + + @EventHandler + public void spawnTnt(UpdateEvent event) + { + if (event.getType() != UpdateType.SEC || !_host.IsLive() || !UtilTime.elapsed(_lastTNT, SPAWN_TIME)) + { + return; + } + + _lastTNT = System.currentTimeMillis(); + + Location location = UtilAlg.Random(_tntSpawns); + + if (location == null || location.getBlock().getType() == Material.TNT) + { + return; + } + + MapUtil.QuickChangeBlockAt(location, Material.TNT); + location.getWorld().playEffect(location.clone().add(0, 0.5, 0), Effect.STEP_SOUND, Material.TNT); + } + + @EventHandler(priority = EventPriority.LOW) + public void tntPickup(PlayerInteractEvent event) + { + if (!UtilEvent.isAction(event, ActionType.R_BLOCK)) + { + return; + } + + Player player = event.getPlayer(); + Block block = event.getClickedBlock(); + + if (block == null || block.getType() != Material.TNT || UtilPlayer.isSpectator(player) || !_host.getUndead().HasPlayer(player) || _tntCarrier.containsKey(player)) + { + return; + } + + event.setCancelled(true); + + DisguiseBase disguise = _host.getArcadeManager().GetDisguise().getActiveDisguise(player); + + if (disguise != null && disguise instanceof DisguiseLiving) + { + DisguiseLiving disguiseLiving = (DisguiseLiving) disguise; + player.getInventory().setHelmet(TNT_HELMET); + disguiseLiving.setHelmet(TNT_HELMET); + _host.getArcadeManager().GetDisguise().updateDisguise(disguiseLiving); + } + + MapUtil.QuickChangeBlockAt(block.getLocation(), Material.AIR); + + player.sendMessage(F.main("Game", "You picked up " + F.skill("TNT") + ".")); + player.sendMessage(F.main("Game", F.elem("Click") + " to " + F.skill("Detonate") + " yourself.")); + _tntCarrier.put(player, System.currentTimeMillis()); + } + + @EventHandler + public void tntDetonate(PlayerInteractEvent event) + { + if (event.isCancelled() || event.getAction() == Action.PHYSICAL) + { + return; + } + + Player player = event.getPlayer(); + + if (!_tntCarrier.containsKey(player)) + { + return; + } + + event.setCancelled(true); + detonate(player, true); + } + + @EventHandler + public void updateExpire(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK || !_host.IsLive()) + { + return; + } + + for (Entry entry : _tntCarrier.entrySet()) + { + long timeLeft = entry.getValue() + TNT_MAX_TIME - System.currentTimeMillis(); + double percentage = (double) (System.currentTimeMillis() - entry.getValue()) / (double) TNT_MAX_TIME; + + if (timeLeft < 0) + { + detonate(entry.getKey(), false); + continue; + } + + UtilTextBottom.displayProgress(C.Bold + "TNT Detonation", percentage, UtilTime.MakeStr(timeLeft), entry.getKey()); + } + } + + @EventHandler + public void updateFireworks(UpdateEvent event) + { + if (event.getType() != UpdateType.SEC) + { + return; + } + + for (Player player : _tntCarrier.keySet()) + { + UtilFirework.playFirework(player.getEyeLocation(), Type.BURST, Color.RED, true, false); + } + } + + @EventHandler + public void playerDeath(PlayerDeathEvent event) + { + Player killed = event.getEntity(); + Player killer = killed.getKiller(); + + if (killer != null && _tntCarrier.containsKey(killed)) + { + _host.AddStat(killer, "TNTKiller", 1, false, false); + } + + detonate(killed, false); + } + + @EventHandler + public void playerQuit(PlayerQuitEvent event) + { + detonate(event.getPlayer(), false); + } + + private void detonate(Player player, boolean triggered) + { + if (!_tntCarrier.containsKey(player) || !Recharge.Instance.use(player, "Prevent Double Detonation", 1000, false, false)) + { + return; + } + + Location playerLocation = player.getLocation(); + + for (Location location : _tntSpawns) + { + if (UtilMath.offsetSquared(location, playerLocation) < TOO_FAR_FROM_CASTLE_SQUARED) + { + if (triggered) + { + player.sendMessage(F.main("Game", "You cannot " + F.skill("Detonate") + " so far from the Castle.")); + } + else + { + _tntCarrier.remove(player); + player.getInventory().setHelmet(null); + } + + return; + } + } + + // Handle Weaknesses + for (Location location : _tntWeaknesses) + { + if (UtilMath.offsetSquared(playerLocation, location) < TNT_WEAKNESS_DISTANCE_SQUARED) + { + for (int i = 0; i < 10; i++) + { + UtilServer.runSyncLater(() -> + { + + TNTPrimed primed = player.getWorld().spawn(UtilAlg.getRandomLocation(location, 2, 2, 2), TNTPrimed.class); + primed.setFuseTicks(0); + primed.setIsIncendiary(true); + + }, i * 3); + } + break; + } + } + + _tntCarrier.remove(player); + + TNTPrimed primed = player.getWorld().spawn(player.getEyeLocation(), TNTPrimed.class); + primed.setFuseTicks(0); + + player.sendMessage(F.main("Game", "You used " + F.skill("Detonate") + ".")); + _host.getArcadeManager().GetDamage().NewDamageEvent(player, null, null, DamageCause.BLOCK_EXPLOSION, 5000, false, true, true, player.getName(), "Explosion"); + } + + @EventHandler(priority = EventPriority.LOWEST) + public void entityExplode(EntityExplodeEvent event) + { + BlockRestore restore = _host.getArcadeManager().GetBlockRestore(); + + int lowestY = Integer.MAX_VALUE; + + for (Block block : event.blockList()) + { + int y = block.getLocation().getBlockY(); + + if (y < lowestY) + { + lowestY = y; + } + } + + for (Block block : event.blockList()) + { + Material material = block.getType(); + byte materialData = block.getData(); + + if ( + material == Material.SMOOTH_BRICK && materialData == 2 || + material == Material.IRON_FENCE || + material == Material.FENCE + ) + { + continue; + } + + restore.add(block, Material.AIR.getId(), (byte) 0, (long) (REGENERATION_TIME + (block.getLocation().getBlockY() - lowestY) * 2000 + Math.random() * 1750)); + } + } + + @EventHandler + public void tntClick(InventoryClickEvent event) + { + Inventory inventory = event.getClickedInventory(); + ItemStack itemStack = event.getCurrentItem(); + + if (inventory != null && itemStack != null && itemStack.getType() == Material.TNT) + { + event.setCancelled(true); + } + } +} diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitCastleSiege.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitCastleSiege.java new file mode 100644 index 00000000..ba5b12ee --- /dev/null +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitCastleSiege.java @@ -0,0 +1,87 @@ +package nautilus.game.arcade.game.games.castlesiegebeta.kits; + +import mineplex.core.disguise.DisguiseManager; +import mineplex.core.disguise.disguises.DisguiseInsentient; +import mineplex.core.disguise.disguises.DisguiseSkeleton; +import mineplex.core.game.kit.GameKit; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.game.GameTeam; +import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.kit.Perk; +import org.bukkit.Material; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.entity.Skeleton; +import org.bukkit.inventory.ItemStack; + +import java.lang.reflect.InvocationTargetException; + +//import mineplex.core.disguise.disguises.DisguiseWither; + + +public abstract class BetaKitCastleSiege extends Kit +{ + + private static final ItemStack AXE = new ItemStack(Material.STONE_AXE); +// private static final ItemStack AXE_5 = new ItemStack(Material.IRON_AXE); + public boolean _witherSkeleton; + + BetaKitCastleSiege(ArcadeManager manager, GameKit gameKit, Perk... perks) + { + super(manager, gameKit, perks); + } + + public void disguise(Player player, Class clazz) + { + DisguiseManager disguiseManager = Manager.GetDisguise(); + + try + { + DisguiseInsentient disguise = clazz.getConstructor(Entity.class).newInstance(player); + GameTeam gameTeam = Manager.GetGame().GetTeam(player); + + if (gameTeam != null) + { + disguise.setName(gameTeam.GetColor() + player.getName()); + } + else + { + disguise.setName(player.getName()); + } + + disguise.showArmor(); + disguise.setCustomNameVisible(true); + + + + if (_witherSkeleton) + { + DisguiseSkeleton disguiseSkeleton = (DisguiseSkeleton) disguise; + disguiseSkeleton.SetSkeletonType(Skeleton.SkeletonType.WITHER); + } + + disguiseManager.disguise(disguise); + } + catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) + { + e.printStackTrace(); + } + } + + protected void giveItems(Player player) + { +// int level = getUpgradeLevel(player.getUniqueId()); +// +// switch (level) +// { +// case 5: +// player.getInventory().addItem(AXE_5); +// break; +// default: +// player.getInventory().addItem(AXE); +// break; +// } + + player.getInventory().addItem(AXE); + } +} diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanKnight.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanKnight.java new file mode 100644 index 00000000..7319e7f1 --- /dev/null +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanKnight.java @@ -0,0 +1,65 @@ +package nautilus.game.arcade.game.games.castlesiegebeta.kits; + +import mineplex.core.disguise.disguises.DisguiseBase; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.common.util.F; +import mineplex.core.game.kit.GameKit; +import mineplex.core.itemstack.ItemStackFactory; + +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.perks.PerkConstructor; +import nautilus.game.arcade.kit.perks.PerkMammoth; + + +public class BetaKitHumanKnight extends nautilus.game.arcade.game.games.castlesiegebeta.kits.BetaKitCastleSiege +{ + + private static final Perk[] PERKS = + { + new PerkMammoth(), + new PerkConstructor("Constructor", 40, 2, Material.FENCE, "Castle Barricade", true) + }; + + private static final ItemStack[] PLAYER_ITEMS = + { + ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD), + ItemStackFactory.Instance.CreateStack(Material.BOW), + ItemStackFactory.Instance.CreateStack(Material.ARROW, 64), + ItemStackFactory.Instance.CreateStack(Material.FENCE, (byte) 0, 2, F.item("Castle Barricade")), + ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP), + ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP), + ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP), + ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP) + }; + + private static final ItemStack[] ARMOR = + { + ItemStackFactory.Instance.CreateStack(Material.IRON_BOOTS), + ItemStackFactory.Instance.CreateStack(Material.IRON_LEGGINGS), + ItemStackFactory.Instance.CreateStack(Material.IRON_CHESTPLATE), + ItemStackFactory.Instance.CreateStack(Material.IRON_HELMET) + }; + + public BetaKitHumanKnight(ArcadeManager manager) + { + super(manager, GameKit.CASTLE_SIEGE_HUMAN_KNIGHT_BETA, PERKS); + } + + @Override + public void GiveItems(Player player) + { + player.getInventory().addItem(PLAYER_ITEMS); + player.getInventory().setArmorContents(ARMOR); + + DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player); + while (disguise != null) + { + Manager.GetDisguise().undisguise(disguise); + disguise = Manager.GetDisguise().getActiveDisguise(player); + } + } +} diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanMarksman.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanMarksman.java new file mode 100644 index 00000000..3e4b842c --- /dev/null +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanMarksman.java @@ -0,0 +1,61 @@ +package nautilus.game.arcade.game.games.castlesiegebeta.kits; + +import mineplex.core.disguise.disguises.DisguiseBase; +import mineplex.core.game.kit.GameKit; +import mineplex.core.itemstack.ItemStackFactory; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.game.games.smash.perks.skeleton.PerkBarrage; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.perks.PerkFletcher; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + + +public class BetaKitHumanMarksman extends BetaKitCastleSiege +{ + + private static final Perk[] PERKS = + { + new PerkBarrage(5, 250, true, false), + new PerkFletcher(2, 4, false), + }; + + private static final ItemStack[] PLAYER_ITEMS = + { + ItemStackFactory.Instance.CreateStack(Material.STONE_SWORD), + ItemStackFactory.Instance.CreateStack(Material.BOW), + ItemStackFactory.Instance.CreateStack(Material.ARROW, 32), + ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP), + ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP) + }; + + private static final ItemStack[] ARMOR = + { + ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS), + ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS), + ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE), + ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET) + }; + + public BetaKitHumanMarksman(ArcadeManager manager) + { + super(manager, GameKit.CASTLE_SIEGE_HUMAN_MARKSMAN_BETA, PERKS); + } + + @Override + public void GiveItems(Player player) + { + player.getInventory().addItem(PLAYER_ITEMS); + player.getInventory().setArmorContents(ARMOR); + player.getInventory().addItem(PLAYER_ITEMS[3], PLAYER_ITEMS[3]); + + DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player); + while (disguise != null) + { + Manager.GetDisguise().undisguise(disguise); + disguise = Manager.GetDisguise().getActiveDisguise(player); + } + + } +} diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanPaladin.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanPaladin.java new file mode 100644 index 00000000..84f71d70 --- /dev/null +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanPaladin.java @@ -0,0 +1,79 @@ +package nautilus.game.arcade.game.games.castlesiegebeta.kits; + +import mineplex.core.disguise.disguises.DisguiseBase; +import mineplex.core.game.kit.GameKit; +import mineplex.core.itemstack.ItemStackFactory; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.game.games.Beta; +import nautilus.game.arcade.game.games.castlesiegebeta.perks.BetaPerkPaladinBoost; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.perks.PerkIronSkin; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + + +import java.util.concurrent.TimeUnit; + +public class BetaKitHumanPaladin extends BetaKitCastleSiege +{ + + private static final int EIGHT_TICKS = 8 * 20; + //beta perk initializers + private static final Perk[] PERKS = + { + new PerkIronSkin(0.1, true), + new BetaPerkPaladinBoost(TimeUnit.SECONDS.toMillis(28), new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, EIGHT_TICKS, 0, false, false), + new PotionEffect(PotionEffectType.REGENERATION, EIGHT_TICKS, 0, false, false)), + }; + + private static final ItemStack[] PLAYER_ITEMS = + { + ItemStackFactory.Instance.CreateStack(Material.STONE_SWORD), + ItemStackFactory.Instance.CreateStack(Material.BOW), + ItemStackFactory.Instance.CreateStack(Material.ARROW, 48), + ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP), + ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP), + ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP), + ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP) + }; + + private static final ItemStack[] ARMOR = + { + ItemStackFactory.Instance.CreateStack(Material.GOLD_BOOTS), + ItemStackFactory.Instance.CreateStack(Material.GOLD_LEGGINGS), + ItemStackFactory.Instance.CreateStack(Material.GOLD_CHESTPLATE), + ItemStackFactory.Instance.CreateStack(Material.GOLD_HELMET) + }; + + public static final ItemStack IN_HAND = new ItemStack(Material.STONE_SWORD); + + @EventHandler + public void UpdatePerksByBeta(){ + if(Beta.enableBeta){ + + } + } + + public BetaKitHumanPaladin(ArcadeManager manager) + { + super(manager, GameKit.CASTLE_SIEGE_HUMAN_PALADIN_BETA, PERKS); + } + + @Override + public void GiveItems(Player player) + { + player.getInventory().addItem(PLAYER_ITEMS); + player.getInventory().setArmorContents(ARMOR); + + DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player); + while (disguise != null) + { + Manager.GetDisguise().undisguise(disguise); + disguise = Manager.GetDisguise().getActiveDisguise(player); + } + } +} diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanWolf.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanWolf.java new file mode 100644 index 00000000..4726f8dd --- /dev/null +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanWolf.java @@ -0,0 +1,84 @@ +package nautilus.game.arcade.game.games.castlesiegebeta.kits; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.disguise.disguises.DisguiseWolf; +import mineplex.core.game.kit.GameKit; +import mineplex.core.itemstack.ItemBuilder; +import mineplex.core.recharge.Recharge; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.perks.PerkKnockbackGive; +import nautilus.game.arcade.kit.perks.PerkStrength; +import org.bukkit.Effect; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.inventory.ItemStack; + +import java.util.concurrent.TimeUnit; + + +public class BetaKitHumanWolf extends BetaKitCastleSiege +{ + + + private static final Perk[] PERKS = + { + new PerkStrength(1), + new PerkKnockbackGive(2) + }; + + private static final long COOLDOWN = TimeUnit.SECONDS.toMillis(80); + private static final String WOLF_BITE = "Wolf Bite"; + private static final ItemStack[] PLAYER_ITEMS = + { + new ItemBuilder(Material.BONE) + .setTitle(C.cYellowB + WOLF_BITE) + .addLore("Hitting any Undead will do 3 Hearts of damage!", "80 second cooldown.") + .build() + }; + + public static final ItemStack IN_HAND = new ItemStack(Material.IRON_HOE); + + public BetaKitHumanWolf(ArcadeManager manager) + { + super(manager, GameKit.CASTLE_SIEGE_WOLF_BETA, PERKS); + } + + @Override + public void GiveItems(Player player) + { + player.setHealth(5); + player.getInventory().addItem(PLAYER_ITEMS); + disguise(player, DisguiseWolf.class); + } + + @EventHandler(priority = EventPriority.HIGHEST) + public void damage(CustomDamageEvent event) + { + if (event.isCancelled() || !Manager.GetGame().IsLive()) + { + return; + } + + LivingEntity damagee = event.GetDamageeEntity(); + Player damager = event.GetDamagerPlayer(false); + + if (damager == null || damager.getItemInHand() == null || damager.getItemInHand().getType() != Material.BONE || !Recharge.Instance.usable(damager, WOLF_BITE)) + { + return; + } + + Recharge.Instance.useForce(damager, WOLF_BITE, COOLDOWN, true); + damager.sendMessage(F.main("Game", "You used " + F.skill(WOLF_BITE) + " on " + F.name(damagee.getName()) + ".")); + damager.getWorld().playSound(damager.getLocation(), Sound.WOLF_BARK, 1, 0.6F); + damagee.getWorld().playEffect(damagee.getLocation().add(0, 0.5, 0), Effect.STEP_SOUND, Material.REDSTONE_BLOCK); + Manager.GetDamage().NewDamageEvent(damagee, damager, null, DamageCause.CUSTOM, 3, true, true, true, damager.getName(), WOLF_BITE); + } +} diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadArcher.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadArcher.java new file mode 100644 index 00000000..b2c96ee9 --- /dev/null +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadArcher.java @@ -0,0 +1,44 @@ +package nautilus.game.arcade.game.games.castlesiegebeta.kits; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.disguise.disguises.DisguiseSkeleton; +import mineplex.core.game.kit.GameKit; + +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.perks.PerkFletcher; +import nautilus.game.arcade.kit.perks.PerkIronSkin; + +public class BetaKitUndeadArcher extends BetaKitCastleSiege +{ + + private static final Perk[] PERKS = + { + new PerkFletcher(8, 2, true), + new PerkIronSkin(1) + }; + + + private static final ItemStack[] PLAYER_ITEMS = + { + new ItemStack(Material.BOW) + }; + + public static final ItemStack IN_HAND = new ItemStack(Material.BOW); + + public BetaKitUndeadArcher(ArcadeManager manager) + { + super(manager, GameKit.CASTLE_SIEGE_UNDEAD_ARCHER_BETA, PERKS); + } + + @Override + public void GiveItems(Player player) + { + giveItems(player); + player.getInventory().addItem(PLAYER_ITEMS); + disguise(player, DisguiseSkeleton.class); + } +} diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadGhoul.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadGhoul.java new file mode 100644 index 00000000..bc38acd5 --- /dev/null +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadGhoul.java @@ -0,0 +1,34 @@ +package nautilus.game.arcade.game.games.castlesiegebeta.kits; + +import org.bukkit.entity.Player; + +import mineplex.core.disguise.disguises.DisguisePigZombie; +import mineplex.core.game.kit.GameKit; + +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.perks.PerkLeap; +import nautilus.game.arcade.kit.perks.PerkSpeed; + +public class BetaKitUndeadGhoul extends BetaKitCastleSiege +{ + + private static final String LEAP = "Ghoul Leap"; + private static final Perk[] PERKS = + { + new PerkLeap(LEAP, 1.2, 0.8, 8000), + new PerkSpeed(0) + }; + + public BetaKitUndeadGhoul(ArcadeManager manager) + { + super(manager, GameKit.CASTLE_SIEGE_UNDEAD_GHOUL_BETA, PERKS); + } + + @Override + public void GiveItems(Player player) + { + giveItems(player); + disguise(player, DisguisePigZombie.class); + } +} diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadSummoner.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadSummoner.java new file mode 100644 index 00000000..f06b1f3f --- /dev/null +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadSummoner.java @@ -0,0 +1,61 @@ +package nautilus.game.arcade.game.games.castlesiegebeta.kits; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.disguise.disguises.DisguiseSkeleton; +import mineplex.core.game.kit.GameKit; +import mineplex.core.itemstack.ItemBuilder; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.game.games.castlesiegebeta.perks.BetaMobPotion; +import nautilus.game.arcade.game.games.castlesiegebeta.perks.BetaPerkMobPotions; +import nautilus.game.arcade.kit.Perk; +import org.bukkit.Material; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; + +import java.util.concurrent.TimeUnit; + + +public class BetaKitUndeadSummoner extends BetaKitCastleSiege +{ + + private static final BetaMobPotion SILVER_FISH = new BetaMobPotion( + new ItemBuilder(Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.SLIME)) + .setTitle(C.cGreen + "Slime Egg") + .build(), EntityType.SLIME, 3); + private static final BetaMobPotion ZOMBIE = new BetaMobPotion( + new ItemBuilder(Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.ZOMBIE)) + .setTitle(C.cGreen + "Zombie Egg") + .build(), EntityType.ZOMBIE, 1); + private static final BetaMobPotion SPIDER = new BetaMobPotion( + new ItemBuilder(Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.SPIDER)) + .setTitle(C.cGreen + "Spider Egg") + .build(), EntityType.SPIDER, 1); + + private static final Perk[] PERKS = + { + new BetaPerkMobPotions(TimeUnit.SECONDS.toMillis(28), SILVER_FISH, ZOMBIE, SPIDER), + }; + + public BetaKitUndeadSummoner(ArcadeManager manager) + { + super(manager, GameKit.CASTLE_SIEGE_UNDEAD_SUMMONER_BETA, PERKS); + } + + @Override + public void GiveItems(Player player) + { + giveItems(player); + _witherSkeleton = true; + disguise(player, DisguiseSkeleton.class); + + + for (Perk perk : GetPerks()) + { + for (BetaMobPotion potion : ((BetaPerkMobPotions) perk).getMobPotions()) + { + player.getInventory().addItem(potion.getItemStack()); + } + } + } +} diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadZombie.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadZombie.java new file mode 100644 index 00000000..853a8416 --- /dev/null +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadZombie.java @@ -0,0 +1,35 @@ +package nautilus.game.arcade.game.games.castlesiegebeta.kits; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.disguise.disguises.DisguiseZombie; +import mineplex.core.game.kit.GameKit; + +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.perks.PerkRegeneration; + +public class BetaKitUndeadZombie extends BetaKitCastleSiege +{ + + private static final Perk[] PERKS = + { + new PerkRegeneration(2) + }; + + public static final ItemStack IN_HAND = new ItemStack(Material.STONE_AXE); + + public BetaKitUndeadZombie(ArcadeManager manager) + { + super(manager, GameKit.CASTLE_SIEGE_UNDEAD_ZOMBIE_BETA, PERKS); + } + + @Override + public void GiveItems(Player player) + { + giveItems(player); + disguise(player, DisguiseZombie.class); + } +} diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaMobPotion.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaMobPotion.java new file mode 100644 index 00000000..fb97fc61 --- /dev/null +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaMobPotion.java @@ -0,0 +1,34 @@ +package nautilus.game.arcade.game.games.castlesiegebeta.perks; + +import org.bukkit.entity.EntityType; +import org.bukkit.inventory.ItemStack; + +public class BetaMobPotion +{ + + private final ItemStack _itemStack; + private final EntityType _entityType; + private final int _amount; + + public BetaMobPotion(ItemStack itemStack, EntityType entityType, int amount) + { + _itemStack = itemStack; + _entityType = entityType; + _amount = amount; + } + + public ItemStack getItemStack() + { + return _itemStack; + } + + public EntityType getEntityType() + { + return _entityType; + } + + public int getAmount() + { + return _amount; + } +} diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaPerkMobPotions.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaPerkMobPotions.java new file mode 100644 index 00000000..12677786 --- /dev/null +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaPerkMobPotions.java @@ -0,0 +1,266 @@ +package nautilus.game.arcade.game.games.castlesiegebeta.perks; + +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.bukkit.ChatColor; +import org.bukkit.Location; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.entity.Slime; +import org.bukkit.event.EventHandler; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.entity.EntityDeathEvent; +import org.bukkit.event.entity.EntityTargetEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilTime; +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.game.GameTeam; +import nautilus.game.arcade.game.games.castlesiegebeta.BetaCastleSiege; +import nautilus.game.arcade.kit.Perk; + +public class BetaPerkMobPotions extends Perk +{ + + private static final long MAX_TIME = TimeUnit.SECONDS.toMillis(16); + private static final long COOLDOWN = TimeUnit.SECONDS.toMillis(2); + private static final int HEALTH = 20; + private static final PotionEffect SPEED = new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 1, false, false); + + private final BetaMobPotion[] _mobPotions; + private final Set _entities = new HashSet<>(); + private final long _cooldown; + + public BetaPerkMobPotions(long cooldown, BetaMobPotion... mobPotions) + { + super("Mob Egg"); + + _cooldown = cooldown; + _mobPotions = mobPotions; + } + + @EventHandler + public void interact(PlayerInteractEvent event) + { + if (event.isCancelled()) + { + return; + } + + Player player = event.getPlayer(); + + if (!hasPerk(player)) + { + return; + } + + BetaMobPotion clickedPotion = null; + ItemStack itemStack = player.getItemInHand(); + + if (itemStack == null) + { + return; + } + + for (BetaMobPotion potion : _mobPotions) + { + if (potion.getItemStack().isSimilar(itemStack)) + { + clickedPotion = potion; + break; + } + } + + if (clickedPotion == null) + { + return; + } + + event.setCancelled(true); + + if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, false) || !Recharge.Instance.use(player, ChatColor.stripColor(clickedPotion.getItemStack().getItemMeta().getDisplayName()), _cooldown, true, true)) + { + return; + } + + Manager.GetGame().CreatureAllowOverride = true; + + Location location = player.getEyeLocation(); + + for (int i = 0; i < clickedPotion.getAmount(); i++) + { + LivingEntity entity = (LivingEntity) player.getWorld().spawnEntity(location, clickedPotion.getEntityType()); + entity.setVelocity(location.getDirection().add(new Vector(Math.random() - 0.5, 0, Math.random() - 0.5))); + entity.addPotionEffect(SPEED); + entity.setCustomName(player.getName() + "'s Minion"); + entity.setCustomNameVisible(true); + entity.setMaxHealth(HEALTH); + entity.setHealth(HEALTH); + + if (entity instanceof Slime) + { + ((Slime) entity).setSize(1); + } + + _entities.add(new SummonedEntity(entity, player)); + } + + Manager.GetGame().CreatureAllowOverride = false; + } + + @EventHandler + public void update(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST) + { + return; + } + + _entities.removeIf(entity -> + { + if (UtilTime.elapsed(entity.SpawnedAt, MAX_TIME)) + { + entity.Summoned.setHealth(0); + return true; + } + + return entity.Summoned.isDead(); + }); + } + + @EventHandler + public void entityTarget(EntityTargetEvent event) + { + for (SummonedEntity entity : _entities) + { + if (!event.getEntity().equals(entity.Summoned)) + { + continue; + } + + LivingEntity target = getNewTarget(entity); + + if (target == null) + { + event.setCancelled(true); + return; + } + + event.setTarget(target); + return; + } + } + + @EventHandler + public void entityDeath(EntityDeathEvent event) + { + for (SummonedEntity entity : _entities) + { + if (!event.getEntity().equals(entity.Summoned)) + { + continue; + } + + event.setDroppedExp(0); + event.getDrops().clear(); + return; + } + } + + @EventHandler + public void entityDamage(CustomDamageEvent event) + { + LivingEntity damagee = event.GetDamageeEntity(); + LivingEntity damager = event.GetDamagerEntity(false); + + for (SummonedEntity entity : _entities) + { + if (entity.Summoned.equals(damagee)) + { + Player damagerPlayer = event.GetDamagerPlayer(true); + BetaCastleSiege game = (BetaCastleSiege) Manager.GetGame(); + + if (damager == null || !game.getUndead().HasPlayer(damagerPlayer)) + { + return; + } + + event.SetCancelled("Team Mob"); + return; + } + else if (entity.Summoned.equals(damager)) + { + event.setDamager(entity.Owner); + return; + } + } + } + + @EventHandler + public void updateDamage(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST) + { + return; + } + + for (SummonedEntity entity : _entities) + { + // Slimes are weird and don't damage players normally. + if (entity.Summoned instanceof Slime) + { + LivingEntity target = entity.Summoned; + + for (Player player : UtilPlayer.getNearby(target.getLocation(), 2)) + { + if (player.equals(entity.Owner)) + { + return; + } + + Manager.GetDamage().NewDamageEvent(player, entity.Owner, null, DamageCause.CUSTOM, 2, true, true, false, entity.Summoned.getCustomName(), "Minion"); + } + } + } + } + + public BetaMobPotion[] getMobPotions() + { + return _mobPotions; + } + + private LivingEntity getNewTarget(SummonedEntity entity) + { + return UtilPlayer.getClosest(entity.Summoned.getLocation(), 10, entity.OwnerTeam.GetPlayers(true)); + } + + private class SummonedEntity + { + + LivingEntity Summoned; + Player Owner; + GameTeam OwnerTeam; + long SpawnedAt; + + SummonedEntity(LivingEntity summoned, Player owner) + { + Summoned = summoned; + Owner = owner; + OwnerTeam = Manager.GetGame().GetTeam(owner); + SpawnedAt = System.currentTimeMillis(); + } + } + + +} diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaPerkPaladinBoost.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaPerkPaladinBoost.java new file mode 100644 index 00000000..d71f9207 --- /dev/null +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaPerkPaladinBoost.java @@ -0,0 +1,84 @@ +package nautilus.game.arcade.game.games.castlesiegebeta.perks; + +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.common.util.UtilItem; +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.recharge.Recharge; +import nautilus.game.arcade.game.GameTeam; +import nautilus.game.arcade.game.games.castlesiegebeta.BetaCastleSiege; +import nautilus.game.arcade.kit.Perk; +import org.bukkit.Sound; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +public class BetaPerkPaladinBoost extends Perk +{ + + private static final int RADIUS = 6; + + private final long _cooldown; + private final PotionEffect[] _effects; + + public BetaPerkPaladinBoost(long cooldown, PotionEffect... effects) + { + super("Morale Royale"); + + _cooldown = cooldown; + _effects = effects; + } + + @EventHandler + public void interact(PlayerInteractEvent event) + { + if (event.isCancelled() || !UtilEvent.isAction(event, ActionType.R)) + { + return; + } + + Player player = event.getPlayer(); + ItemStack itemStack = player.getItemInHand(); + + if (!hasPerk(player) || !UtilItem.isSword(itemStack) || !Recharge.Instance.use(player, GetName(), _cooldown, true, true)) + { + return; + } + + BetaCastleSiege game = (BetaCastleSiege) Manager.GetGame(); + GameTeam team = game.GetTeam(player); + + player.sendMessage(F.main("Game", "You used " + F.skill(GetName()) + ".")); + + for (Player nearby : UtilPlayer.getNearby(player.getLocation(), RADIUS)) + { + if (!team.HasPlayer(nearby)) + { + continue; + } + + UtilParticle.PlayParticleToAll(ParticleType.HEART, nearby.getLocation().add(0, 1.2, 0), 0.5F, 0.5F, 0.5F, 0.01F, 8, ViewDist.LONG); + nearby.playSound(nearby.getLocation(), Sound.ZOMBIE_REMEDY, 1, 0.6F); + nearby.sendMessage(F.main("Game", "Paladin " + F.name(player.getName()) + " has given you buffs!")); + + boolean wolf = game.isWolf(nearby); + + for (PotionEffect effect : _effects) + { + if (effect.getType() == PotionEffectType.DAMAGE_RESISTANCE && wolf) + { + effect = new PotionEffect(PotionEffectType.SPEED, effect.getDuration(), 0, effect.isAmbient(), effect.hasParticles()); + } + + nearby.addPotionEffect(effect); + } + } + } +} diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.java index 6aeba239..2a043437 100644 --- a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.java +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.java @@ -1,6 +1,5 @@ package nautilus.game.arcade.game.games.castlesiegenew; -import mineplex.core.chat.Chat; import mineplex.core.common.util.*; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; @@ -8,16 +7,13 @@ import mineplex.core.preferences.Preference; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.combat.CombatComponent; -import mineplex.minecraft.game.core.combat.DeathMessageType; import mineplex.minecraft.game.core.condition.ConditionFactory; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.FirstBloodEvent; import nautilus.game.arcade.events.GameStateChangeEvent; -import nautilus.game.arcade.events.PlayerDeathOutEvent; import nautilus.game.arcade.events.PlayerGameRespawnEvent; -import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.TeamGame; import nautilus.game.arcade.game.games.Beta; @@ -51,8 +47,6 @@ import java.util.*; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; -import static mineplex.core.updater.UpdateType.SLOWER; - //import com.mineplex.anticheat.checks.combat.KillauraTypeD; //import mineplex.core.antihack.AntiHack; @@ -60,6 +54,9 @@ import static mineplex.core.updater.UpdateType.SLOWER; public class CastleSiegeNew extends TeamGame { + //tics to seconds + private static final int EIGHT_TICKS = 8 * 20; + // Game Help private int _undeadIndex = 0; private int _defenderIndex = 0; @@ -74,7 +71,7 @@ public class CastleSiegeNew extends TeamGame private PlayerInfo _playerInfo; private CombatComponent _killer; - private static final String[] DESCRIPTION = { + public static final String[] CSDESCRIPTION = { C.cAqua + "Defenders" + C.cWhite + " must defend the King.", C.cAqua + "Defenders" + C.cWhite + " win when the sun rises.", C.cAqua + "Defenders" + C.cWhite + " respawn as wolves.", @@ -102,37 +99,6 @@ public class CastleSiegeNew extends TeamGame "Wolves are best suited to target Undead holding TNT." }; - // Undead Tips - Colored red - private static final String[] UndeadTips = { - "TNT randomly spawns at 3 different locations outside the undead forest.", - "Right-click TNT to pick it up.", - "TNT will automatically explode 30 seconds after being picked up.", - "Undead respawn instantly.", - " Iron Bars and Cracked Stone Bricks are weak points. Blow them open with TNT!", - "Click while holding TNT to explode.", - "Use your axe to break oak fences! Other fences cannot be broken…", - "Opening multiple pathways are useful for the Undead!", - " Iron bars can only be destroyed with TNT", - "The skeleton kit is useful to kill marksmen", - "Skeletons can only pick up extra arrows shot from knights and paladins!" - }; - // Defender Tips - Colored aqua - private static final String[] DefenderTips = { - "Defenders can right-click a fence to pass through it.", - "Avoid retreating as Defenders.", - "Castle Marksmen are important to defense because of their arrows.", - "Defenders respawn as wolves with no armor or weapons.", - "Wolves must wait 6 seconds in between respawns.", - "Coordination and teamwork are important to winning as Defenders." - }; - - // General Tips - Colored yellow - private static final String[] GeneralTips = { - "Use 1.8.9 for the best gameplay experience!", - "Castle Siege is a challenging game! Work together to succeed.", - "Use Team Chat to coordinate! Message in Team Chat using this format: #(message)" - }; - private static final int START_TIME = 14000; private static final int UNDEAD_BURN_TIME = 24000; private static final int DEFENDER_WIN_TIME = UNDEAD_BURN_TIME + 200; @@ -155,6 +121,9 @@ public class CastleSiegeNew extends TeamGame public CastleSiegeNew(ArcadeManager manager) { + + + super(manager, GameType.CastleSiege, new Kit[] { new KitHumanWolf(manager), @@ -167,7 +136,9 @@ public class CastleSiegeNew extends TeamGame new KitUndeadZombie(manager), new KitUndeadSummoner(manager) - }, DESCRIPTION); + }, CSDESCRIPTION); + + _help = TIPS; // AnticheatDisabled = true; // StrictAntiHack = true; @@ -217,6 +188,7 @@ public class CastleSiegeNew extends TeamGame @Override public void ParseData() { + _defenders = GetTeam(ChatColor.AQUA); _defenders.SetName("Defenders"); _defenders.SetRespawnTime(WOLF_RESPAWN_TIME); @@ -261,95 +233,6 @@ public class CastleSiegeNew extends TeamGame .register(this); } - @EventHandler - public void DisplayCSTips(UpdateEvent event) - { - if (Beta.enableBeta) { - if (showDefTip && !showGenTips) { - if (!inLobby() || event.getType() != UpdateType.SLOWER) { - return; - } - - if (Manager.GetGameHostManager().isCommunityServer()) { - return; - } - - defenderTipColor = defenderTipColor == ChatColor.AQUA ? ChatColor.AQUA : ChatColor.AQUA; - String und = C.cWhiteB + "TIP> " + ChatColor.RESET + defenderTipColor + DefenderTips[_defenderIndex]; - - for (Player player : UtilServer.getPlayersCollection()) { - - if (!Manager.getPreferences().get(player).isActive(Preference.GAME_TIPS)) { - continue; - } - - player.playSound(player.getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1f); - UtilPlayer.message(player, und); - } - - _defenderIndex = (_defenderIndex + 1) % DefenderTips.length; - showDefTip = false; - } - - else if (!showDefTip && !showGenTips) { - if (!inLobby() || event.getType() != UpdateType.SLOWER) { - return; - } - - if (Manager.GetGameHostManager().isCommunityServer()) { - return; - } - - undeadTipColor = undeadTipColor == ChatColor.RED ? ChatColor.RED : ChatColor.RED; - String def = C.cWhiteB + "TIP> " + ChatColor.RESET + undeadTipColor + UndeadTips[_undeadIndex]; - - for (Player player : UtilServer.getPlayersCollection()) { - if (!Manager.getPreferences().get(player).isActive(Preference.GAME_TIPS)) { - continue; - } - - player.playSound(player.getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1f); - UtilPlayer.message(player, def); - - } - - _undeadIndex = (_undeadIndex + 1) % UndeadTips.length; - showGenTips = true; - } - - else { - if (!inLobby() || event.getType() != UpdateType.SLOWER) { - return; - } - - if (Manager.GetGameHostManager().isCommunityServer()) { - return; - } - - generalTipColor = generalTipColor == ChatColor.YELLOW ? ChatColor.YELLOW : ChatColor.YELLOW; - String gen = C.cWhiteB + "TIP> " + ChatColor.RESET + generalTipColor + GeneralTips[_generalIndex]; - - for (Player player : UtilServer.getPlayersCollection()) { - if (!Manager.getPreferences().get(player).isActive(Preference.GAME_TIPS)) { - continue; - } - - player.playSound(player.getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1f); - UtilPlayer.message(player, gen); - - } - - _generalIndex = (_generalIndex + 1) % GeneralTips.length; - showGenTips = false; - showDefTip = true; - } - _help = null; - } - else{ - _help = TIPS; - } - } - @EventHandler @Override public void ScoreboardUpdate(UpdateEvent event) diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/kits/KitHumanPaladin.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/kits/KitHumanPaladin.java index 76522bf8..14045f54 100644 --- a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/kits/KitHumanPaladin.java +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/kits/KitHumanPaladin.java @@ -4,11 +4,13 @@ import mineplex.core.disguise.disguises.DisguiseBase; import mineplex.core.game.kit.GameKit; import mineplex.core.itemstack.ItemStackFactory; import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.game.games.Beta; import nautilus.game.arcade.game.games.castlesiegenew.perks.PerkPaladinBoost; import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.perks.PerkIronSkin; import org.bukkit.Material; import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; @@ -16,10 +18,11 @@ import org.bukkit.potion.PotionEffectType; import java.util.concurrent.TimeUnit; -public class KitHumanPaladin extends KitCastleSiege +public class KitHumanPaladin extends nautilus.game.arcade.game.games.castlesiegenew.kits.KitCastleSiege { private static final int EIGHT_TICKS = 8 * 20; + //beta perk initializers private static final Perk[] PERKS = { new PerkIronSkin(0.1, true), @@ -47,6 +50,13 @@ public class KitHumanPaladin extends KitCastleSiege public static final ItemStack IN_HAND = new ItemStack(Material.STONE_SWORD); + @EventHandler + public void UpdatePerksByBeta(){ + if(Beta.enableBeta){ + + } + } + public KitHumanPaladin(ArcadeManager manager) { super(manager, GameKit.CASTLE_SIEGE_HUMAN_PALADIN, PERKS); diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/kits/KitUndeadZombie2.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/kits/KitUndeadZombie2.java index a3967d99..0af2b76a 100644 --- a/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/kits/KitUndeadZombie2.java +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/kits/KitUndeadZombie2.java @@ -1,9 +1,6 @@ package nautilus.game.arcade.game.games.castlesiegenew.kits; import mineplex.core.disguise.disguises.DisguiseArmorStand; -import mineplex.core.disguise.disguises.DisguiseHuman; -import mineplex.core.disguise.disguises.DisguisePlayer; -import mineplex.core.disguise.disguises.DisguiseZombie; import mineplex.core.game.kit.GameKit; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.kit.Perk; @@ -12,7 +9,7 @@ import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -public class KitUndeadZombie2 extends KitCastleSiege{ +public class KitUndeadZombie2 extends KitCastleSiege { private static final Perk[] PERKS = { new PerkRegeneration(254) diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/button/BetaButton.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/button/BetaButton.java index 1be5dc41..42676d9d 100644 --- a/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/button/BetaButton.java +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/button/BetaButton.java @@ -1,14 +1,23 @@ package nautilus.game.arcade.gui.privateServer.button; import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilServer; import mineplex.core.shop.item.IButton; import mineplex.core.shop.page.ShopPageBase; import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.games.Beta; +import nautilus.game.arcade.game.games.castlesiegenew.kits.KitHumanPaladin; +import nautilus.game.arcade.game.games.castlesiegenew.perks.PerkPaladinBoost; import nautilus.game.arcade.gui.privateServer.PrivateServerShop; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import java.util.concurrent.TimeUnit; public class BetaButton implements IButton { @@ -43,6 +52,7 @@ public class BetaButton implements IButton { Beta.enableBeta = true; _arcadeManager.GetGame().Announce(C.cAquaB + "Enabled BETA Features. Caution: Highly Experimental!", true); + } } diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/button/ChooseMapButton.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/button/ChooseMapButton.java index 768ffc42..a9fd88c1 100644 --- a/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/button/ChooseMapButton.java +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/button/ChooseMapButton.java @@ -1,5 +1,7 @@ package nautilus.game.arcade.gui.privateServer.button; +import mineplex.core.common.util.C; +import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -20,6 +22,11 @@ public class ChooseMapButton implements IButton _arcadeManager = arcadeManager; _privateServerShop = privateServerShop; _gameType = gameType; + + if(_gameType == GameType.BetaCastleSiege){ + _gameType = GameType.CastleSiege; + } + _map = map; } @@ -31,6 +38,9 @@ public class ChooseMapButton implements IButton { _arcadeManager.GetGameCreationManager().MapSource = _gameType.getMapSource()[0]; } + else{ + Bukkit.broadcastMessage(C.cRed + "Error Loading Maps: None defined for " + _gameType); + } _arcadeManager.GetGameCreationManager().MapPref = _map.replaceAll(" ", ""); _arcadeManager.GetGame().setGame(_gameType, player, true); diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/ChooseMapPage.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/ChooseMapPage.java index 1836ee1a..f7abdc02 100644 --- a/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/ChooseMapPage.java +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/ChooseMapPage.java @@ -1,5 +1,6 @@ package nautilus.game.arcade.gui.privateServer.page; +import nautilus.game.arcade.game.games.Beta; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -18,6 +19,10 @@ public class ChooseMapPage extends BasePage super(plugin, shop, "Choose Map", player); _gameType = gameType; + if(_gameType == GameType.BetaCastleSiege){ + _gameType = GameType.CastleSiege; + } + buildPage(); } @@ -27,10 +32,13 @@ public class ChooseMapPage extends BasePage addBackToSetGamePage(); int slot = 9; + String loadMaps = _gameType.getName(); + if(_gameType.getMapSource() != null) { loadMaps = _gameType.getMapSource()[0].getName(); + } for(String cur : getPlugin().LoadFiles(loadMaps)) { diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/SetGamePage.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/SetGamePage.java index bf6deff3..4765d6ab 100644 --- a/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/SetGamePage.java +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/SetGamePage.java @@ -4,7 +4,9 @@ import mineplex.core.common.util.C; import mineplex.core.shop.item.ShopItem; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; +import nautilus.game.arcade.game.games.Beta; import nautilus.game.arcade.gui.privateServer.PrivateServerShop; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -81,7 +83,15 @@ public class SetGamePage extends BasePage { if (clickType == ClickType.LEFT) { - getPlugin().GetGame().setGame(type, player, true); + if(type == GameType.CastleSiege){ + if(Beta.enableBeta){ + getPlugin().GetGame().setGame(GameType.BetaCastleSiege, player, true); + } + else{ + getPlugin().GetGame().setGame(GameType.CastleSiege, player, true); + } + } + player.closeInventory(); } else if (clickType == ClickType.RIGHT) @@ -91,6 +101,17 @@ public class SetGamePage extends BasePage // { // return; // } + + if(type == GameType.CastleSiege){ + if(Beta.enableBeta){ + getShop().openPageForPlayer(player, new ChooseMapPage(getPlugin(), getShop(), player, GameType.BetaCastleSiege)); + Bukkit.broadcastMessage(C.cAqua + "Selecting Maps for: Castle Siege Beta"); + } + else{ + getShop().openPageForPlayer(player, new ChooseMapPage(getPlugin(), getShop(), player, type)); + } + } + getShop().openPageForPlayer(player, new ChooseMapPage(getPlugin(), getShop(), player, type)); } }); diff --git a/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameHostManager.java b/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameHostManager.java index 7caa5a0d..126f8c5c 100644 --- a/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameHostManager.java +++ b/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameHostManager.java @@ -105,6 +105,7 @@ public class GameHostManager implements Listener _games.add(GameType.Bridge); _games.add(GameType.SurvivalGames); _games.add(GameType.CastleSiege); + _games.add(GameType.BetaCastleSiege); _games.add(GameType.WitherAssault); _games.add(GameType.Wizards); _games.add(GameType.Build); diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/ArcadeManager$1.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/ArcadeManager$1.class index ce8bb3a9..233562ea 100644 Binary files a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/ArcadeManager$1.class and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/ArcadeManager$1.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/ArcadeManager$Perm.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/ArcadeManager$Perm.class index bff540e6..cc3b3d1e 100644 Binary files a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/ArcadeManager$Perm.class and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/ArcadeManager$Perm.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/ArcadeManager.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/ArcadeManager.class index a830ce1d..150ed48d 100644 Binary files a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/ArcadeManager.class and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/ArcadeManager.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/GameType.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/GameType.class index 66069bb4..64b8a092 100644 Binary files a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/GameType.class and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/GameType.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/Game.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/Game.class index 3d5fe223..074d5347 100644 Binary files a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/Game.class and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/Game.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiege.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiege.class new file mode 100644 index 00000000..ef272778 Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiege.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeHorseManager.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeHorseManager.class new file mode 100644 index 00000000..7a841efb Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeHorseManager.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeKing.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeKing.class new file mode 100644 index 00000000..4e03a485 Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeKing.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeTNTManager.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeTNTManager.class new file mode 100644 index 00000000..67f066ed Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/BetaCastleSiegeTNTManager.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitCastleSiege.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitCastleSiege.class new file mode 100644 index 00000000..49a0f81f Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitCastleSiege.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanKnight.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanKnight.class new file mode 100644 index 00000000..7e01ab27 Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanKnight.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanMarksman.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanMarksman.class new file mode 100644 index 00000000..053fc162 Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanMarksman.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanPaladin.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanPaladin.class new file mode 100644 index 00000000..8e05b23f Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanPaladin.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanWolf.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanWolf.class new file mode 100644 index 00000000..267daff1 Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitHumanWolf.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadArcher.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadArcher.class new file mode 100644 index 00000000..e39e5e89 Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadArcher.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadGhoul.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadGhoul.class new file mode 100644 index 00000000..890e9e4d Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadGhoul.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadSummoner.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadSummoner.class new file mode 100644 index 00000000..ad8f23f7 Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadSummoner.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadZombie.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadZombie.class new file mode 100644 index 00000000..523d3335 Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/kits/BetaKitUndeadZombie.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaMobPotion.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaMobPotion.class new file mode 100644 index 00000000..9d98d62d Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaMobPotion.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaPerkMobPotions$SummonedEntity.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaPerkMobPotions$SummonedEntity.class new file mode 100644 index 00000000..4257d596 Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaPerkMobPotions$SummonedEntity.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaPerkMobPotions.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaPerkMobPotions.class new file mode 100644 index 00000000..a010a0a7 Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaPerkMobPotions.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaPerkPaladinBoost.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaPerkPaladinBoost.class new file mode 100644 index 00000000..1324cda0 Binary files /dev/null and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegebeta/perks/BetaPerkPaladinBoost.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.class index 515e5ec8..25717f3f 100644 Binary files a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.class and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegenew/kits/KitHumanPaladin.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegenew/kits/KitHumanPaladin.class index c9fee24c..e8b07b08 100644 Binary files a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegenew/kits/KitHumanPaladin.class and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegenew/kits/KitHumanPaladin.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegenew/kits/KitUndeadZombie2.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegenew/kits/KitUndeadZombie2.class index 0e4ca958..318946f2 100644 Binary files a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegenew/kits/KitUndeadZombie2.class and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/game/games/castlesiegenew/kits/KitUndeadZombie2.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/gui/privateServer/button/BetaButton.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/gui/privateServer/button/BetaButton.class index 695ce8f5..de3c1b5e 100644 Binary files a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/gui/privateServer/button/BetaButton.class and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/gui/privateServer/button/BetaButton.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/gui/privateServer/button/ChooseMapButton.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/gui/privateServer/button/ChooseMapButton.class index 7c9fb786..246db609 100644 Binary files a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/gui/privateServer/button/ChooseMapButton.class and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/gui/privateServer/button/ChooseMapButton.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/gui/privateServer/page/ChooseMapPage.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/gui/privateServer/page/ChooseMapPage.class index 71990db3..4c686fbd 100644 Binary files a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/gui/privateServer/page/ChooseMapPage.class and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/gui/privateServer/page/ChooseMapPage.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/gui/privateServer/page/SetGamePage.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/gui/privateServer/page/SetGamePage.class index 25df46d2..ef9a8bd1 100644 Binary files a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/gui/privateServer/page/SetGamePage.class and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/gui/privateServer/page/SetGamePage.class differ diff --git a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/managers/GameHostManager.class b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/managers/GameHostManager.class index 9a3226d7..35d46ece 100644 Binary files a/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/managers/GameHostManager.class and b/Nautilus.Game.Arcade/target/classes/nautilus/game/arcade/managers/GameHostManager.class differ diff --git a/out/artifacts/nautilus_game_arcade_jar/nautilus-game-arcade.jar b/out/artifacts/nautilus_game_arcade_jar/nautilus-game-arcade.jar index 15077501..0939641b 100644 Binary files a/out/artifacts/nautilus_game_arcade_jar/nautilus-game-arcade.jar and b/out/artifacts/nautilus_game_arcade_jar/nautilus-game-arcade.jar differ