Fix some bugs, improve Skyfall and add Skyfall Teams

This commit is contained in:
xXVevzZXx 2016-10-16 14:30:11 +02:00
parent 0dca2e9d46
commit 3ebe1a837f
13 changed files with 526 additions and 127 deletions

View File

@ -83,6 +83,7 @@ public enum GameDisplay
Valentines("Valentines Vendetta", Material.LEATHER, (byte)0, GameCategory.EXTRA, 61), Valentines("Valentines Vendetta", Material.LEATHER, (byte)0, GameCategory.EXTRA, 61),
Skyfall("Skyfall", Material.DIAMOND_BOOTS, (byte)0, GameCategory.SURVIVAL, 62), Skyfall("Skyfall", Material.DIAMOND_BOOTS, (byte)0, GameCategory.SURVIVAL, 62),
SkyfallTeams("Skyfall Teams", Material.DIAMOND_BOOTS, (byte)0, GameCategory.SURVIVAL, 65),
Basketball("Hoops", Material.SLIME_BALL, (byte)0, GameCategory.EXTRA, 63), Basketball("Hoops", Material.SLIME_BALL, (byte)0, GameCategory.EXTRA, 63),

View File

@ -1,9 +1,12 @@
package nautilus.game.arcade; package nautilus.game.arcade;
import org.bukkit.Material;
import mineplex.core.common.MinecraftVersion; import mineplex.core.common.MinecraftVersion;
import mineplex.core.common.Pair; import mineplex.core.common.Pair;
import mineplex.core.game.GameCategory; import mineplex.core.game.GameCategory;
import mineplex.core.game.GameDisplay; import mineplex.core.game.GameDisplay;
import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.games.baconbrawl.BaconBrawl; import nautilus.game.arcade.game.games.baconbrawl.BaconBrawl;
import nautilus.game.arcade.game.games.barbarians.Barbarians; import nautilus.game.arcade.game.games.barbarians.Barbarians;
@ -70,7 +73,8 @@ import nautilus.game.arcade.game.games.sheep.SheepGame;
import nautilus.game.arcade.game.games.sheep.modes.EweHeroes; import nautilus.game.arcade.game.games.sheep.modes.EweHeroes;
import nautilus.game.arcade.game.games.sheep.modes.OverpoweredSheepQuest; import nautilus.game.arcade.game.games.sheep.modes.OverpoweredSheepQuest;
import nautilus.game.arcade.game.games.sheep.modes.SmashSheep; import nautilus.game.arcade.game.games.sheep.modes.SmashSheep;
import nautilus.game.arcade.game.games.skyfall.Skyfall; import nautilus.game.arcade.game.games.skyfall.SoloSkyfall;
import nautilus.game.arcade.game.games.skyfall.TeamSkyfall;
import nautilus.game.arcade.game.games.skywars.SoloSkywars; import nautilus.game.arcade.game.games.skywars.SoloSkywars;
import nautilus.game.arcade.game.games.skywars.TeamSkywars; import nautilus.game.arcade.game.games.skywars.TeamSkywars;
import nautilus.game.arcade.game.games.skywars.modes.OverpoweredSkywars; import nautilus.game.arcade.game.games.skywars.modes.OverpoweredSkywars;
@ -108,8 +112,6 @@ import nautilus.game.arcade.game.games.wither.WitherGame;
import nautilus.game.arcade.game.games.wizards.Wizards; import nautilus.game.arcade.game.games.wizards.Wizards;
import nautilus.game.arcade.game.games.zombiesurvival.ZombieSurvival; import nautilus.game.arcade.game.games.zombiesurvival.ZombieSurvival;
import org.bukkit.Material;
public enum GameType public enum GameType
{ {
//Mini //Mini
@ -196,7 +198,8 @@ public enum GameType
MonsterMaze(MonsterMaze.class, GameDisplay.MonsterMaze), MonsterMaze(MonsterMaze.class, GameDisplay.MonsterMaze),
MonsterLeague(MonsterLeague.class, GameDisplay.MonsterLeague), MonsterLeague(MonsterLeague.class, GameDisplay.MonsterLeague),
Gladiators(Gladiators.class, GameDisplay.Gladiators), Gladiators(Gladiators.class, GameDisplay.Gladiators),
Skyfall(Skyfall.class, GameDisplay.Skyfall), Skyfall(SoloSkyfall.class, GameDisplay.Skyfall),
SkyfallTeams(TeamSkyfall.class, GameDisplay.SkyfallTeams, new GameType[]{GameType.Skyfall}, false),
BouncyBalls(BouncyBalls.class, GameDisplay.BouncyBalls), BouncyBalls(BouncyBalls.class, GameDisplay.BouncyBalls),

View File

@ -27,6 +27,7 @@ import mineplex.core.common.util.UtilTime;
import mineplex.core.hologram.Hologram; import mineplex.core.hologram.Hologram;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.Game.GameState;
@ -353,7 +354,12 @@ public class BoosterRing extends Crumbleable implements Listener
if (i >= _sortedBorder.size()) if (i >= _sortedBorder.size())
return; return;
_sortedBorder.get(i).getBlock().setTypeIdAndData(_material.getType().getId(), _material.getData().getData(), true); Block block = _sortedBorder.get(i).getBlock();
if (block.getType() == _material.getType() && block.getData() == _material.getData().getData())
continue;
block.setTypeIdAndData(_material.getType().getId(), _material.getData().getData(), true);
} }
} }
@ -469,6 +475,11 @@ public class BoosterRing extends Crumbleable implements Listener
return false; return false;
} }
public Material getType()
{
return _material.getType();
}
@Override @Override
public void crumbledAway() public void crumbledAway()
{ {

View File

@ -69,6 +69,9 @@ public class HomingArrow
if (_shooter == player) if (_shooter == player)
continue; continue;
if (_host.TeamMode && _host.GetTeam(_shooter) == _host.GetTeam(player))
continue;
if (!UtilPlayer.isGliding(player)) if (!UtilPlayer.isGliding(player))
continue; continue;

View File

@ -25,30 +25,30 @@ public class LootTable
new RandomItem(Material.PORK, 30, 1, 4), new RandomItem(Material.PORK, 30, 1, 4),
new RandomItem(Material.ROTTEN_FLESH, 40, 1, 6), new RandomItem(Material.ROTTEN_FLESH, 40, 1, 6),
new RandomItem(Material.WOOD_AXE, 80), new RandomItem(Material.WOOD_AXE, 100),
new RandomItem(Material.WOOD_SWORD, 70), new RandomItem(Material.WOOD_SWORD, 80),
new RandomItem(Material.STONE_AXE, 60), new RandomItem(Material.STONE_AXE, 70),
new RandomItem(Material.STONE_SWORD, 30), new RandomItem(Material.STONE_SWORD, 50),
new RandomItem(Material.IRON_AXE, 40),
new RandomItem(Material.LEATHER_BOOTS, 30), new RandomItem(Material.LEATHER_BOOTS, 40),
new RandomItem(Material.LEATHER_HELMET, 30), new RandomItem(Material.LEATHER_HELMET, 40),
new RandomItem(Material.LEATHER_LEGGINGS, 30), new RandomItem(Material.LEATHER_LEGGINGS, 40),
new RandomItem(Material.GOLD_BOOTS, 25), new RandomItem(Material.GOLD_BOOTS, 35),
new RandomItem(Material.GOLD_HELMET, 25), new RandomItem(Material.GOLD_HELMET, 35),
new RandomItem(Material.GOLD_LEGGINGS, 25), new RandomItem(Material.GOLD_LEGGINGS, 35),
new RandomItem(Material.CHAINMAIL_BOOTS, 20), new RandomItem(Material.CHAINMAIL_BOOTS, 30),
new RandomItem(Material.CHAINMAIL_HELMET, 20), new RandomItem(Material.CHAINMAIL_HELMET, 30),
new RandomItem(Material.CHAINMAIL_LEGGINGS, 20), new RandomItem(Material.CHAINMAIL_LEGGINGS, 30),
new RandomItem(Material.FISHING_ROD, 30), new RandomItem(Material.FISHING_ROD, 30),
new RandomItem(Material.BOW, 20), new RandomItem(Material.BOW, 50),
new RandomItem(Material.ARROW, 20, 1, 3), new RandomItem(Material.ARROW, 50, 1, 3),
new RandomItem(Material.SNOW_BALL, 30, 1, 2), new RandomItem(Material.SNOW_BALL, 30, 1, 2),
new RandomItem(Material.EGG, 30, 1, 2), new RandomItem(Material.EGG, 30, 1, 2),
new RandomItem(Material.COMPASS, 20),
new RandomItem(Material.STICK, 30, 1, 2), new RandomItem(Material.STICK, 30, 1, 2),
new RandomItem(Material.FLINT, 30, 1, 2), new RandomItem(Material.FLINT, 30, 1, 2),
new RandomItem(Material.FEATHER, 30, 1, 2), new RandomItem(Material.FEATHER, 30, 1, 2),
@ -57,33 +57,26 @@ public class LootTable
Material.TNT, (byte) 0, 1, F.item("Throwing TNT")), 15), Material.TNT, (byte) 0, 1, F.item("Throwing TNT")), 15),
new RandomItem(Material.MUSHROOM_SOUP, 15), new RandomItem(Material.MUSHROOM_SOUP, 15),
new RandomItem(Material.BAKED_POTATO, 30, 1, 5), new RandomItem(Material.BAKED_POTATO, 20, 1, 5),
new RandomItem(Material.MUSHROOM_SOUP, 30, 1, 1), new RandomItem(Material.MUSHROOM_SOUP, 20, 1, 1),
new RandomItem(Material.COOKED_BEEF, 30, 1, 3), new RandomItem(Material.COOKED_BEEF, 30, 1, 3),
new RandomItem(Material.COOKED_CHICKEN, 30, 1, 3), new RandomItem(Material.COOKED_CHICKEN, 30, 1, 3),
new RandomItem(Material.COOKED_FISH, 30, 1, 6), new RandomItem(Material.COOKED_FISH, 30, 1, 6),
new RandomItem(Material.GRILLED_PORK, 30, 1, 3), new RandomItem(Material.GRILLED_PORK, 20, 1, 3),
new RandomItem(Material.COOKIE, 30), new RandomItem(Material.COOKIE, 30),
new RandomItem(Material.PUMPKIN_PIE, 30, 1, 3), new RandomItem(Material.PUMPKIN_PIE, 20, 1, 3),
new RandomItem(Material.APPLE, 30, 2, 6), new RandomItem(Material.APPLE, 20, 2, 6),
new RandomItem(Material.STONE_SWORD, 30),
new RandomItem(Material.IRON_AXE, 30),
new RandomItem(Material.IRON_INGOT, 30, 1, 2), new RandomItem(Material.IRON_INGOT, 30, 1, 2),
new RandomItem(Material.DIAMOND, 30) new RandomItem(Material.DIAMOND, 30)
); );
public final static LootTable SUPPLY_DROP = new LootTable( public final static LootTable SUPPLY_DROP = new LootTable(
new RandomItem(Material.DIAMOND_HELMET, 10), new RandomItem(Material.DIAMOND_HELMET, 30),
new RandomItem(Material.DIAMOND_LEGGINGS, 8), new RandomItem(Material.DIAMOND_LEGGINGS, 27),
new RandomItem(Material.DIAMOND_BOOTS, 10), new RandomItem(Material.DIAMOND_BOOTS, 30),
new RandomItem(Material.DIAMOND_SWORD, 16),
new RandomItem(Material.IRON_HELMET, 30), new RandomItem(Material.DIAMOND_AXE, 24)
new RandomItem(Material.IRON_LEGGINGS, 27),
new RandomItem(Material.IRON_BOOTS, 30),
new RandomItem(Material.IRON_SWORD, 24),
new RandomItem(Material.DIAMOND_SWORD, 8),
new RandomItem(Material.DIAMOND_AXE, 16)
// new RandomItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD, 1, Enchantment.DAMAGE_ALL), 8), // new RandomItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD, 1, Enchantment.DAMAGE_ALL), 8),
// new RandomItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD, 1, Enchantment.DAMAGE_ALL), 4), // new RandomItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD, 1, Enchantment.DAMAGE_ALL), 4),
// //

View File

@ -8,11 +8,8 @@ import java.util.Iterator;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.UUID; import java.util.UUID;
import com.mineplex.anticheat.checks.move.Glide; import net.md_5.bungee.api.ChatColor;
import com.mineplex.anticheat.checks.move.HeadRoll;
import com.mineplex.anticheat.checks.move.Speed;
import mineplex.core.Managers;
import mineplex.core.antihack.AntiHack;
import org.bukkit.Color; import org.bukkit.Color;
import org.bukkit.FireworkEffect; import org.bukkit.FireworkEffect;
import org.bukkit.FireworkEffect.Type; import org.bukkit.FireworkEffect.Type;
@ -36,12 +33,21 @@ import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.scoreboard.Scoreboard;
import com.mineplex.anticheat.checks.move.Glide;
import com.mineplex.anticheat.checks.move.HeadRoll;
import com.mineplex.anticheat.checks.move.Speed;
import mineplex.core.Managers;
import mineplex.core.antihack.AntiHack;
import mineplex.core.common.MinecraftVersion; import mineplex.core.common.MinecraftVersion;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilFirework;
@ -59,13 +65,14 @@ import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType; import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.skyfall.kits.KitAeronaught; import nautilus.game.arcade.game.games.skyfall.kits.KitAeronaught;
import nautilus.game.arcade.game.games.skyfall.kits.KitBooster;
import nautilus.game.arcade.game.games.skyfall.kits.KitDeadeye; import nautilus.game.arcade.game.games.skyfall.kits.KitDeadeye;
import nautilus.game.arcade.game.games.skyfall.kits.KitJouster; import nautilus.game.arcade.game.games.skyfall.kits.KitJouster;
import nautilus.game.arcade.game.games.skyfall.kits.KitSpeeder; import nautilus.game.arcade.game.games.skyfall.kits.KitSpeeder;
@ -78,17 +85,17 @@ import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.stats.FirstSupplyDropOpenStatTracker; import nautilus.game.arcade.stats.FirstSupplyDropOpenStatTracker;
import nautilus.game.arcade.stats.KillsWithinTimeLimitStatTracker; import nautilus.game.arcade.stats.KillsWithinTimeLimitStatTracker;
import nautilus.game.arcade.stats.WinWithoutWearingArmorStatTracker; import nautilus.game.arcade.stats.WinWithoutWearingArmorStatTracker;
import net.md_5.bungee.api.ChatColor; import nautilus.game.arcade.world.WorldData;
/** /**
* GameObject of the game Skyfall * GameObject of the game Skyfall
* *
* @author xXVevzZXx * @author xXVevzZXx
*/ */
public class Skyfall extends SoloGame public abstract class Skyfall extends Game
{ {
private static final long MAP_CRUMBLE_DELAY = 1000*30; // 30 Seconds private static final long MAP_CRUMBLE_DELAY = 1000*30; // 30 Seconds
private static final long CHEST_REFILL_TIME = 1000*60*6; // 5 minutes private static final long CHEST_REFILL_TIME = 1000*60*3; // 3 minutes
private static final long CHEST_REFILL_ANNOUNCE_TIME = 1000*60*3; // 3 minutes private static final long CHEST_REFILL_ANNOUNCE_TIME = 1000*60*3; // 3 minutes
private static final int BIG_ISLAND_BOUNDS = 30; private static final int BIG_ISLAND_BOUNDS = 30;
private static final int BIG_ISLAND_HEIGHT = 40; private static final int BIG_ISLAND_HEIGHT = 40;
@ -102,7 +109,7 @@ public class Skyfall extends SoloGame
private static final long BOOSTER_COOLDOWN_TIME = 1000*20; // 20 Seconds private static final long BOOSTER_COOLDOWN_TIME = 1000*20; // 20 Seconds
private static final long SUPPLY_DROP_TIME = 1000*60*4; // 5 Minutes private static final long SUPPLY_DROP_TIME = 1000*60*5; // 5 Minutes
private static final long DEATHMATCH_START_TIME = 1000*30; // 30 Seconds private static final long DEATHMATCH_START_TIME = 1000*30; // 30 Seconds
private static final long DEATHMATCH_WAIT_TIME = 1000*10; // 10 Seconds private static final long DEATHMATCH_WAIT_TIME = 1000*10; // 10 Seconds
@ -136,15 +143,14 @@ public class Skyfall extends SoloGame
private boolean _teleportedDeathmatch; private boolean _teleportedDeathmatch;
private long _deathMatchStartTime; private long _deathMatchStartTime;
private boolean _crumbleRings;
private boolean _refillAnnounced; private boolean _refillAnnounced;
private int _currentCrumble = 300; private int _currentCrumble = 300;
private boolean _supplyOpened; private boolean _supplyOpened;
public Skyfall(ArcadeManager manager) public Skyfall(ArcadeManager manager, GameType type)
{ {
super(manager, GameType.Skyfall, super(manager, type,
new Kit[] new Kit[]
{ {
@ -197,7 +203,6 @@ public class Skyfall extends SoloGame
PrepareFreeze = true; PrepareFreeze = true;
AnnounceStay = false; AnnounceStay = false;
HideTeamSheep = true;
DeathDropItems = true; DeathDropItems = true;
QuitDropItems = true; QuitDropItems = true;
DamageSelf = true; DamageSelf = true;
@ -212,9 +217,9 @@ public class Skyfall extends SoloGame
InventoryOpenChest = true; InventoryOpenChest = true;
DamageFall = false; DamageFall = false;
SoupEnabled = true; SoupEnabled = true;
ReplaceTeamsWithKits = true;
StrictAntiHack = false; StrictAntiHack = false;
CompassEnabled = true; CompassEnabled = true;
CompassGiveItem = false;
SpeedMeasurement = true; SpeedMeasurement = true;
@ -222,63 +227,6 @@ public class Skyfall extends SoloGame
_islandHeight = 15; _islandHeight = 15;
} }
@Override
@EventHandler
public void ScoreboardUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
if (GetTeamList().isEmpty())
return;
Scoreboard.reset();
GameTeam team = GetTeamList().get(0);
if (IsLive())
{
Scoreboard.writeNewLine();
Scoreboard.write(C.cGreen + C.Bold + "Time");
Scoreboard.write(UtilTime.convertString(System.currentTimeMillis() - GetStateTime(), 0, TimeUnit.FIT));
Scoreboard.writeNewLine();
}
Scoreboard.write(C.cYellow + C.Bold + "Players");
if (team.GetPlayers(true).size() > 7)
{
Scoreboard.write("" + team.GetPlayers(true).size());
}
else
{
for (Player player : team.GetPlayers(true))
{
Scoreboard.write(C.cWhite + player.getName());
}
}
if (IsLive() && !_deathmatch)
{
Scoreboard.writeNewLine();
Scoreboard.write(C.cGold + C.Bold + "Chest Refill");
Scoreboard.write(C.cWhite + UtilTime.MakeStr((_chestsRefilled + CHEST_REFILL_TIME) - System.currentTimeMillis()));
}
else if (_deathmatch && !_deathMatchStarted)
{
Scoreboard.writeNewLine();
Scoreboard.write(C.cRed + C.Bold + "Deathmatch");
Scoreboard.write(F.time(UtilTime.MakeStr(_teleportedDeathmatch ? (_deathMatchStartTime + DEATHMATCH_START_TIME + DEATHMATCH_WAIT_TIME) - System.currentTimeMillis() : (_deathMatchStartTime + DEATHMATCH_START_TIME) - System.currentTimeMillis())));
}
else if (_deathMatchStarted)
{
Scoreboard.writeNewLine();
Scoreboard.write(C.cRed + C.Bold + "Game End");
Scoreboard.write(UtilTime.convertString(Math.max(0, (GetStateTime() + GameTimeout) - System.currentTimeMillis()), 0, TimeUnit.FIT));
}
Scoreboard.draw();
}
@EventHandler @EventHandler
public void gameStart(GameStateChangeEvent event) public void gameStart(GameStateChangeEvent event)
{ {
@ -290,6 +238,17 @@ public class Skyfall extends SoloGame
{ {
spawn.clone().subtract(0, 1, 0).getBlock().setType(Material.AIR); spawn.clone().subtract(0, 1, 0).getBlock().setType(Material.AIR);
} }
for (Player player : GetPlayers(true))
{
ItemStack stack = new ItemStack(Material.COMPASS);
ItemMeta itemMeta = stack.getItemMeta();
itemMeta.setDisplayName(C.cGreen + C.Bold + "Tracking Compass");
stack.setItemMeta(itemMeta);
player.getInventory().addItem(stack);
}
} }
} }
@ -364,7 +323,6 @@ public class Skyfall extends SoloGame
{ {
Announce(C.cGreenB + "As time passes, the world begins to rot...", true); Announce(C.cGreenB + "As time passes, the world begins to rot...", true);
_crumbleAnnounced = true; _crumbleAnnounced = true;
_crumbleRings = true;
} }
for (Island island : islandCrumble()) for (Island island : islandCrumble())
@ -519,7 +477,6 @@ public class Skyfall extends SoloGame
Location loc = UtilAlg.getLocationNearPlayers(_deathMatchSpawns, GetPlayers(true), GetPlayers(true)); Location loc = UtilAlg.getLocationNearPlayers(_deathMatchSpawns, GetPlayers(true), GetPlayers(true));
player.teleport(loc); player.teleport(loc);
} }
_crumbleRings = true;
} }
@EventHandler @EventHandler
@ -528,9 +485,6 @@ public class Skyfall extends SoloGame
if (event.getType() != UpdateType.FASTER) if (event.getType() != UpdateType.FASTER)
return; return;
if (!_crumbleRings)
return;
for (BoosterRing ring : _boosterRings) for (BoosterRing ring : _boosterRings)
{ {
if (ring.getMiddle().getBlockY() < _currentCrumble) if (ring.getMiddle().getBlockY() < _currentCrumble)
@ -578,6 +532,7 @@ public class Skyfall extends SoloGame
Announce(C.cYellow + C.Bold + "Supply Drop Incoming"); Announce(C.cYellow + C.Bold + "Supply Drop Incoming");
_supplyEffect = _supplyDrop.clone(); _supplyEffect = _supplyDrop.clone();
_supplyEffect.setY(250); _supplyEffect.setY(250);
_supplyDrop.getBlock().getRelative(BlockFace.DOWN).setType(Material.GLASS);
_supplyDrop.getBlock().getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN).setType(Material.BEACON); _supplyDrop.getBlock().getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN).setType(Material.BEACON);
for (int x = -1; x <= 1; x++) for (int x = -1; x <= 1; x++)
for (int z = -1; z <= 1; z++) for (int z = -1; z <= 1; z++)
@ -909,6 +864,9 @@ public class Skyfall extends SoloGame
if (!IsLive()) if (!IsLive())
UtilPlayer.removeWorldBorder(player); UtilPlayer.removeWorldBorder(player);
if (!IsAlive(player))
UtilPlayer.removeWorldBorder(player);
if (player.getInventory().getChestplate() == null) if (player.getInventory().getChestplate() == null)
continue; continue;
@ -952,6 +910,16 @@ public class Skyfall extends SoloGame
.Factory() .Factory()
.Explosion("Throwing TNT", other, player, 50, 0.1, false, .Explosion("Throwing TNT", other, player, 50, 0.1, false,
false); false);
Location loc = event.getEntity().getLocation();
for (Block block : UtilBlock.getSurrounding(loc.getBlock(), true))
{
if (block.getType() == _boosterRings.get(0).getType())
{
event.setCancelled(true);
return;
}
}
} }
@EventHandler @EventHandler
@ -1062,7 +1030,7 @@ public class Skyfall extends SoloGame
{ {
if (player.getInventory().getChestplate() != null) if (player.getInventory().getChestplate() != null)
{ {
UtilPlayer.message(player, F.main("Game", C.cRed + "You're Elytra is disabled!")); UtilPlayer.message(player, F.main("Game", C.cRed + "Your Elytra is disabled!"));
} }
player.getInventory().setChestplate(null); player.getInventory().setChestplate(null);
} }
@ -1070,6 +1038,46 @@ public class Skyfall extends SoloGame
} }
} }
public boolean isDeathMatch()
{
return _deathmatch;
}
public boolean isDeathMatchStarted()
{
return _deathMatchStarted;
}
public boolean isTeleportedDeathmatch()
{
return _teleportedDeathmatch;
}
public long getDeathmatchStartTime()
{
return _deathMatchStartTime;
}
public long getChestsRefilled()
{
return _chestsRefilled;
}
public long getChestRefillTime()
{
return CHEST_REFILL_TIME;
}
public long getDeathmatchStartingTime()
{
return DEATHMATCH_START_TIME;
}
public long getDeathmatchWaitTime()
{
return DEATHMATCH_WAIT_TIME;
}
private class IslandSorter implements Comparator<Island> private class IslandSorter implements Comparator<Island>
{ {
private HashMap<Island, Integer> _map; private HashMap<Island, Integer> _map;

View File

@ -0,0 +1,178 @@
package nautilus.game.arcade.game.games.skyfall;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilTime.TimeUnit;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.Game.GameState;
/**
* SoloSkyfall
*
* @author xXVevzZXx
*/
public class SoloSkyfall extends Skyfall
{
private GameTeam _players;
public SoloSkyfall(ArcadeManager manager)
{
super(manager, GameType.Skyfall);
this.DamageTeamSelf = true;
}
@EventHandler
public void CustomTeamGeneration(GameStateChangeEvent event)
{
if (event.GetState() != GameState.Recruit)
return;
_players = GetTeamList().get(0);
_players.SetColor(ChatColor.YELLOW);
_players.SetName("Players");
_players.setDisplayName(C.cYellow + C.Bold + "Players");
}
@Override
@EventHandler
public void ScoreboardUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
if (GetTeamList().isEmpty())
return;
Scoreboard.reset();
GameTeam team = GetTeamList().get(0);
if (IsLive())
{
Scoreboard.writeNewLine();
Scoreboard.write(C.cGreen + C.Bold + "Time");
Scoreboard.write(UtilTime.convertString(System.currentTimeMillis() - GetStateTime(), 0, TimeUnit.FIT));
Scoreboard.writeNewLine();
}
Scoreboard.write(C.cYellow + C.Bold + "Players");
if (team.GetPlayers(true).size() > 7)
{
Scoreboard.write("" + team.GetPlayers(true).size());
}
else
{
for (Player player : team.GetPlayers(true))
{
Scoreboard.write(C.cWhite + player.getName());
}
}
if (IsLive() && !isDeathMatch())
{
Scoreboard.writeNewLine();
Scoreboard.write(C.cGold + C.Bold + "Chest Refill");
Scoreboard.write(C.cWhite + UtilTime.MakeStr((getChestsRefilled() + getChestRefillTime()) - System.currentTimeMillis()));
}
else if (isDeathMatch() && !isDeathMatchStarted())
{
Scoreboard.writeNewLine();
Scoreboard.write(C.cRed + C.Bold + "Deathmatch");
Scoreboard.write(F.time(UtilTime.MakeStr(isTeleportedDeathmatch() ? (getDeathmatchStartTime() + getDeathmatchStartingTime() + getDeathmatchWaitTime()) - System.currentTimeMillis() : (getDeathmatchStartTime() + getDeathmatchStartingTime()) - System.currentTimeMillis())));
}
else if (isDeathMatchStarted())
{
Scoreboard.writeNewLine();
Scoreboard.write(C.cRed + C.Bold + "Game End");
Scoreboard.write(UtilTime.convertString(Math.max(0, (GetStateTime() + GameTimeout) - System.currentTimeMillis()), 0, TimeUnit.FIT));
}
Scoreboard.draw();
}
@Override
public void EndCheck()
{
if (!IsLive())
return;
if (GetPlayers(true).size() <= 1)
{
ArrayList<Player> places = GetTeamList().get(0).GetPlacements(true);
//Announce
AnnounceEnd(places);
//Gems
if (places.size() >= 1)
AddGems(places.get(0), 20, "1st Place", false, false);
if (places.size() >= 2)
AddGems(places.get(1), 15, "2nd Place", false, false);
if (places.size() >= 3)
AddGems(places.get(2), 10, "3rd Place", false, false);
for (Player player : GetPlayers(false))
if (player.isOnline())
AddGems(player, 10, "Participation", false, false);
//End
SetState(GameState.End);
}
}
@Override
public List<Player> getWinners()
{
if (GetState().ordinal() >= GameState.End.ordinal())
{
List<Player> places = GetTeamList().get(0).GetPlacements(true);
if (places.isEmpty() || !places.get(0).isOnline())
return Arrays.asList();
else
return Arrays.asList(places.get(0));
}
else
return null;
}
@Override
public List<Player> getLosers()
{
List<Player> winners = getWinners();
if (winners == null)
return null;
List<Player> losers = GetTeamList().get(0).GetPlayers(false);
losers.removeAll(winners);
return losers;
}
@Override
public String GetMode()
{
return "Solo Mode";
}
}

View File

@ -0,0 +1,190 @@
package nautilus.game.arcade.game.games.skyfall;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilTime.TimeUnit;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.modules.TeamModule;
/**
* TeamSkyfall
*
* @author xXVevzZXx
*/
public class TeamSkyfall extends Skyfall
{
public TeamSkyfall(ArcadeManager manager)
{
super(manager, GameType.SkyfallTeams);
PlayersPerTeam = 2;
FillTeamsInOrderToCount = 2;
SpawnNearAllies = true;
SpawnNearEnemies = true;
DamageTeamSelf = false;
DontAllowOverfill = true;
TeamMode = true;
HideTeamSheep = true;
registerModule(new TeamModule());
}
@Override
@EventHandler
public void ScoreboardUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
if (GetTeamList().isEmpty())
return;
Scoreboard.reset();
if (IsLive())
{
Scoreboard.writeNewLine();
Scoreboard.write(C.cGreen + C.Bold + "Time");
Scoreboard.write(UtilTime.convertString(System.currentTimeMillis() - GetStateTime(), 0, TimeUnit.FIT));
Scoreboard.writeNewLine();
}
Scoreboard.write(C.cYellow + C.Bold + "Teams");
ArrayList<GameTeam> alive = new ArrayList<GameTeam>();
for (GameTeam team : GetTeamList())
{
if (team.IsTeamAlive())
alive.add(team);
}
if (GetPlayers(true).size() <= 7)
{
for (GameTeam team : GetTeamList())
{
for (Player player : team.GetPlayers(true))
{
Scoreboard.write(team.GetColor() + player.getName());
}
}
}
else if (alive.size() <= 7)
{
for (GameTeam team : alive)
{
Scoreboard.write(C.cWhite + team.GetPlayers(true).size() + " " + team.GetColor() + team.GetName());
}
}
else
{
Scoreboard.write(C.cWhite + alive.size() + " Alive");
}
if (IsLive() && !isDeathMatch())
{
Scoreboard.writeNewLine();
Scoreboard.write(C.cGold + C.Bold + "Chest Refill");
Scoreboard.write(C.cWhite + UtilTime.MakeStr((getChestsRefilled() + getChestRefillTime()) - System.currentTimeMillis()));
}
else if (isDeathMatch() && !isDeathMatchStarted())
{
Scoreboard.writeNewLine();
Scoreboard.write(C.cRed + C.Bold + "Deathmatch");
Scoreboard.write(F.time(UtilTime.MakeStr(isTeleportedDeathmatch() ? (getDeathmatchStartTime() + getDeathmatchStartingTime() + getDeathmatchWaitTime()) - System.currentTimeMillis() : (getDeathmatchStartTime() + getDeathmatchStartingTime()) - System.currentTimeMillis())));
}
else if (isDeathMatchStarted())
{
Scoreboard.writeNewLine();
Scoreboard.write(C.cRed + C.Bold + "Game End");
Scoreboard.write(UtilTime.convertString(Math.max(0, (GetStateTime() + GameTimeout) - System.currentTimeMillis()), 0, TimeUnit.FIT));
}
Scoreboard.draw();
}
@Override
public void EndCheck()
{
if (!IsLive())
return;
ArrayList<GameTeam> teamsAlive = new ArrayList<GameTeam>();
for (GameTeam team : GetTeamList())
if (team.GetPlayers(true).size() > 0)
teamsAlive.add(team);
if (teamsAlive.size() <= 1)
{
//Announce
if (teamsAlive.size() > 0)
AnnounceEnd(teamsAlive.get(0));
for (GameTeam team : GetTeamList())
{
if (WinnerTeam != null && team.equals(WinnerTeam))
{
for (Player player : team.GetPlayers(false))
AddGems(player, 10, "Winning Team", false, false);
}
for (Player player : team.GetPlayers(false))
if (player.isOnline())
AddGems(player, 10, "Participation", false, false);
}
//End
SetState(GameState.End);
}
}
@Override
public List<Player> getWinners()
{
if (WinnerTeam == null)
return null;
return WinnerTeam.GetPlayers(false);
}
@Override
public List<Player> getLosers()
{
if (WinnerTeam == null)
return null;
List<Player> players = new ArrayList<>();
for (GameTeam team : GetTeamList())
{
if (team != WinnerTeam)
players.addAll(team.GetPlayers(false));
}
return players;
}
@Override
public String GetMode()
{
return "Team Mode";
}
}

View File

@ -6,6 +6,7 @@ import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
/** /**

View File

@ -45,6 +45,9 @@ public class PerkElytraKnockback extends Perk
if (!UtilPlayer.isGliding(player)) if (!UtilPlayer.isGliding(player))
return; return;
if (Manager.GetGame().TeamMode && Manager.GetGame().GetTeam(player) == Manager.GetGame().GetTeam(event.GetDamageePlayer()))
return;
event.AddKnockback("Kit Effect", event.getKnockbackValue()*2); event.AddKnockback("Kit Effect", event.getKnockbackValue()*2);
} }

View File

@ -4,6 +4,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import nautilus.game.arcade.game.games.skyfall.BoosterRing; import nautilus.game.arcade.game.games.skyfall.BoosterRing;
import nautilus.game.arcade.game.games.skyfall.PlayerBoostRingEvent; import nautilus.game.arcade.game.games.skyfall.PlayerBoostRingEvent;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
@ -36,6 +37,8 @@ public class PerkIncreaseBoosters extends Perk
if (!hasPerk(player)) if (!hasPerk(player))
return; return;
// Bukkit.broadcastMessage("Increasing strength of booster ring to " + _strength + " for " + player.getName());
event.multiplyStrength(_strength); event.multiplyStrength(_strength);
} }
} }

View File

@ -15,6 +15,7 @@ import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
/** /**
@ -59,7 +60,10 @@ public class PerkRemoveElytra extends Perk
if (!hasPerk(player)) if (!hasPerk(player))
return; return;
Recharge.Instance.useForce(player, "Elytra Removal", _duration, true); if (Manager.GetGame().TeamMode && Manager.GetGame().GetTeam(player) == Manager.GetGame().GetTeam(event.GetDamageePlayer()))
return;
Recharge.Instance.useForce(event.GetDamageePlayer(), "Elytra Removal", _duration, true);
_disabled.put(event.GetDamageePlayer().getUniqueId(), System.currentTimeMillis() + _duration); _disabled.put(event.GetDamageePlayer().getUniqueId(), System.currentTimeMillis() + _duration);
} }
@ -84,7 +88,7 @@ public class PerkRemoveElytra extends Perk
{ {
if (player.getInventory().getChestplate() != null) if (player.getInventory().getChestplate() != null)
{ {
UtilPlayer.message(player, F.main("Game", C.cRed + "You're Elytra is disabled!")); UtilPlayer.message(player, F.main("Game", C.cRed + "Your Elytra is disabled!"));
} }
player.getInventory().setChestplate(null); player.getInventory().setChestplate(null);
} }

View File

@ -4,17 +4,18 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;
public class WinWithoutWearingArmorStatTracker extends StatTracker<Game> public class WinWithoutWearingArmorStatTracker extends StatTracker<Game>
{ {
private final Set<String> _wearing = new HashSet<String>(); private final Set<String> _wearing = new HashSet<String>();
@ -41,7 +42,7 @@ public class WinWithoutWearingArmorStatTracker extends StatTracker<Game>
for (ItemStack armor : player.getInventory().getArmorContents()) for (ItemStack armor : player.getInventory().getArmorContents())
{ {
if (armor != null && armor.getType() != Material.AIR) if (armor != null && armor.getType() != Material.AIR && armor.getType() != Material.ELYTRA)
{ {
_wearing.add(player.getUniqueId().toString()); _wearing.add(player.getUniqueId().toString());
break; break;