- cleaned everything up

- renamed game
This commit is contained in:
AlexTheCoder 2016-04-16 20:32:14 -04:00
parent d8f5ac66fc
commit b0d30a4ff4
12 changed files with 118 additions and 110 deletions

View File

@ -164,24 +164,24 @@ public enum Achievement
new int[]{10}, new int[]{10},
AchievementCategory.UHC), AchievementCategory.UHC),
//Minecraft League //MC League
MINECRAFT_LEAGUE_STRIKE("First Strike", 600, MC_LEAGUE_STRIKE("First Strike", 600,
new String[] {"Minecraft League.FirstStrike"}, new String[] {"MC League.FirstStrike"},
new String[] {"Earn 30 First Bloods"}, new String[] {"Earn 30 First Bloods"},
new int[] {30}, new int[] {30},
AchievementCategory.MINECRAFT_LEAGUE), AchievementCategory.MC_LEAGUE),
MINECRAFT_LEAGUE_HEAD("Head Hunter", 600, MC_LEAGUE_HEAD("Head Hunter", 600,
new String[] {"Minecraft League.HeadHunter"}, new String[] {"MC League.HeadHunter"},
new String[] {"Grab 25 Wither Skulls"}, new String[] {"Grab 25 Wither Skulls"},
new int[] {25}, new int[] {25},
AchievementCategory.MINECRAFT_LEAGUE), AchievementCategory.MC_LEAGUE),
MINECRAFT_LEAGUE_ALTAR("Altar Builder", 600, MC_LEAGUE_ALTAR("Altar Builder", 600,
new String[] {"Minecraft League.AltarBuilder"}, new String[] {"MC League.AltarBuilder"},
new String[] {"Place 50 Wither Skulls", "on your Altar"}, new String[] {"Place 50 Wither Skulls", "on your Altar"},
new int[] {50}, new int[] {50},
AchievementCategory.MINECRAFT_LEAGUE), AchievementCategory.MC_LEAGUE),
//UHC //UHC
WIZARDS_WINS("Supreme Wizard", 600, WIZARDS_WINS("Supreme Wizard", 600,

View File

@ -50,7 +50,7 @@ public enum AchievementCategory
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED }, new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
Material.GOLDEN_APPLE, 0, GameCategory.SURVIVAL, "None"), Material.GOLDEN_APPLE, 0, GameCategory.SURVIVAL, "None"),
MINECRAFT_LEAGUE("Minecraft League", null, MC_LEAGUE("MC League", null,
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED }, new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
Material.IRON_CHESTPLATE, 0, GameCategory.SURVIVAL, "None"), Material.IRON_CHESTPLATE, 0, GameCategory.SURVIVAL, "None"),

View File

@ -68,7 +68,7 @@ public enum GameDisplay
Lobbers("Bomb Lobbers", Material.FIREBALL, (byte) 0, GameCategory.ARCADE, 54), Lobbers("Bomb Lobbers", Material.FIREBALL, (byte) 0, GameCategory.ARCADE, 54),
Minecraft_League("Minecraft League", Material.DIAMOND_SWORD, (byte)0, GameCategory.SURVIVAL, 62), Minecraft_League("MC League", Material.DIAMOND_SWORD, (byte)0, GameCategory.SURVIVAL, 62),
ChampionsCTF("Champions CTF", "Champions", Material.BANNER, DyeColor.RED.getDyeData(), GameCategory.CHAMPIONS, 56), ChampionsCTF("Champions CTF", "Champions", Material.BANNER, DyeColor.RED.getDyeData(), GameCategory.CHAMPIONS, 56),

View File

@ -396,9 +396,9 @@ public class MinecraftLeague extends TeamGame
return ids; return ids;
} }
//public TeamTowerBase getActiveTower(GameTeam team) public TeamTowerBase getActiveTower(GameTeam team)
{ {
//return _tower.getVulnerable(team); return _tower.getVulnerable(team);
} }
public TowerManager getTowerManager() public TowerManager getTowerManager()
@ -538,12 +538,6 @@ public class MinecraftLeague extends TeamGame
Scoreboard.Reset(); Scoreboard.Reset();
Scoreboard.WriteBlank();
Scoreboard.Write(C.cYellowB + "Time Elapsed");
Scoreboard.Write(UtilTime.MakeStr(_liveTime));
if (OverTime)
Scoreboard.Write(C.cDRedB + "Overtime");
Scoreboard.WriteBlank(); Scoreboard.WriteBlank();
Scoreboard.Write(C.cRedB + "Red Team"); Scoreboard.Write(C.cRedB + "Red Team");
Scoreboard.Write("Towers: " + reds); Scoreboard.Write("Towers: " + reds);
@ -570,6 +564,12 @@ public class MinecraftLeague extends TeamGame
i++; i++;
} }
Scoreboard.WriteBlank();
Scoreboard.Write(C.cYellowB + "Time Elapsed");
Scoreboard.Write(UtilTime.MakeStr(_liveTime));
if (OverTime)
Scoreboard.Write(C.cDRedB + "Overtime");
Scoreboard.Draw(); Scoreboard.Draw();
} }
@ -797,7 +797,7 @@ public class MinecraftLeague extends TeamGame
if (UtilTime.elapsed(GetStateTime(), UtilTime.convert(15, TimeUnit.MINUTES, TimeUnit.MILLISECONDS))) if (UtilTime.elapsed(GetStateTime(), UtilTime.convert(15, TimeUnit.MINUTES, TimeUnit.MILLISECONDS)))
{ {
OverTime = true; OverTime = true;
UtilTextMiddle.display(C.cGold + "Overtime", C.cGold + "Dying will now cause your crystal to lose 20 health!"); UtilTextMiddle.display(C.cGold + "Overtime", C.cGold + "Dying will now cause your crystal to lose 50 health!");
} }
} }
@ -956,7 +956,7 @@ public class MinecraftLeague extends TeamGame
{ {
if (!tower.damage(1, player)) if (!tower.damage(1, player))
{ {
player.playSound(tower.getLocation(), Sound.ZOMBIE_WOODBREAK, 1, 0); player.getWorld().playSound(tower.getLocation(), Sound.ZOMBIE_METAL, 1, 1.5f);
Alert.alert(tower.getTeam(), tower); Alert.alert(tower.getTeam(), tower);
} }
return; return;
@ -968,7 +968,7 @@ public class MinecraftLeague extends TeamGame
if (!tower.damage(damage, player)) if (!tower.damage(damage, player))
{ {
player.playSound(tower.getLocation(), Sound.ZOMBIE_WOODBREAK, 1, 0); player.getWorld().playSound(tower.getLocation(), Sound.ZOMBIE_METAL, 1, 1.5f);
Alert.alert(tower.getTeam(), tower); Alert.alert(tower.getTeam(), tower);
} }
@ -1325,7 +1325,7 @@ public class MinecraftLeague extends TeamGame
} }
if (event.getInventory().getResult().getType() == Material.ARROW) if (event.getInventory().getResult().getType() == Material.ARROW)
{ {
event.getInventory().setResult(new ItemStack(Material.ARROW, (event.getInventory().getResult().getAmount() * 4))); event.getInventory().setResult(new ItemStack(Material.ARROW, ((event.getInventory().getResult().getAmount() / 4) * 6)));
} }
if (event.getInventory().getResult().getType() == Material.FLINT_AND_STEEL) if (event.getInventory().getResult().getType() == Material.FLINT_AND_STEEL)
{ {
@ -1507,7 +1507,7 @@ public class MinecraftLeague extends TeamGame
} }
} }
if (UtilInv.getAmount(player, Material.FISHING_ROD) >= 1) /*if (UtilInv.getAmount(player, Material.FISHING_ROD) >= 1)
{ {
for (ItemStack poss : UtilInv.getItems(player)) for (ItemStack poss : UtilInv.getItems(player))
{ {
@ -1517,16 +1517,16 @@ public class MinecraftLeague extends TeamGame
break; break;
} }
} }
} }*/
//int arrowsToAdd = UtilInv.getAmount(player, Material.ARROW) / 2; int arrowsToAdd = UtilInv.getAmount(player, Material.ARROW) / 2;
//while (arrowsToAdd >= 1) while (arrowsToAdd >= 1)
//{ {
//int subtract = Math.min(64, arrowsToAdd); int subtract = Math.min(64, arrowsToAdd);
//gear.add(new ItemStack(Material.ARROW, subtract)); gear.add(new ItemStack(Material.ARROW, subtract));
//arrowsToAdd -= subtract; arrowsToAdd -= subtract;
//} }
if (UtilInv.getAmount(player, Material.ARROW) >= 1) /*if (UtilInv.getAmount(player, Material.ARROW) >= 1)
{ {
for (ItemStack arrow : UtilInv.getItems(player)) for (ItemStack arrow : UtilInv.getItems(player))
{ {
@ -1535,7 +1535,7 @@ public class MinecraftLeague extends TeamGame
gear.add(arrow); gear.add(arrow);
} }
} }
} }*/
_gear.put(player, gear); _gear.put(player, gear);
} }
@ -1638,13 +1638,14 @@ public class MinecraftLeague extends TeamGame
{ {
if (tb.Alive) if (tb.Alive)
{ {
tb.damage(20, null); tb.damage(50, null);
break; break;
} }
} }
if (_tower.getAmountAlive(GetTeam(event.GetPlayer())) >= 1) if (_tower.getAmountAlive(GetTeam(event.GetPlayer())) >= 1)
{ {
event.setCancelled(true); event.setCancelled(true);
UtilPlayer.message(event.GetPlayer(), F.main("Game", "Your Tower lost 50 HP on your Respawn!"));
} }
} }
else else

View File

@ -0,0 +1,23 @@
package nautilus.game.arcade.game.games.minecraftleague.commands;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import nautilus.game.arcade.ArcadeManager;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
public class DebugCommand extends CommandBase<ArcadeManager>
{
public DebugCommand(ArcadeManager plugin)
{
super(plugin, Rank.DEVELOPER, new Rank[] {Rank.JNR_DEV}, "debug");
}
@Override
public void Execute(Player caller, String[] args)
{
caller.getWorld().spawnEntity(caller.getLocation(), EntityType.ENDER_CRYSTAL);
}
}

View File

@ -21,6 +21,7 @@ public class MinecraftLeagueCommand extends MultiCommandBase<ArcadeManager>
AddCommand(new GUICommand(plugin, host)); AddCommand(new GUICommand(plugin, host));
AddCommand(new FreezeCommand(plugin, host)); AddCommand(new FreezeCommand(plugin, host));
AddCommand(new StatusCommand(plugin, host)); AddCommand(new StatusCommand(plugin, host));
AddCommand(new DebugCommand(plugin));
_host = host; _host = host;
} }
@ -31,5 +32,6 @@ public class MinecraftLeagueCommand extends MultiCommandBase<ArcadeManager>
UtilPlayer.message(caller, F.help("/mcLeague gui", "Opens a GUI for controlling Respawn Crystals", Rank.ADMIN)); UtilPlayer.message(caller, F.help("/mcLeague gui", "Opens a GUI for controlling Respawn Crystals", Rank.ADMIN));
UtilPlayer.message(caller, F.help("/mcLeague freeze <player>", "Freezes or unfreezes a player [for cheaters]", Rank.ADMIN)); UtilPlayer.message(caller, F.help("/mcLeague freeze <player>", "Freezes or unfreezes a player [for cheaters]", Rank.ADMIN));
UtilPlayer.message(caller, F.help("/mcLeague status", "Gets statistics about both Respawn Crystals", Rank.DEVELOPER)); UtilPlayer.message(caller, F.help("/mcLeague status", "Gets statistics about both Respawn Crystals", Rank.DEVELOPER));
UtilPlayer.message(caller, F.help("/mcLeague debug", "Spawns a Tower Mob at your position", Rank.DEVELOPER));
} }
} }

View File

@ -169,7 +169,7 @@ public class DefenderAI
private void drawBeam() private void drawBeam()
{ {
Location base = _base.clone().add(0, 10, 0); Location base = _base.clone().add(0, 10, 0);
Location target = _manager.getTeamTowers(_tower.getTeam()).getLast().getLocation().clone().add(0, 10, 0);//_manager.getTeamTowers(_tower.getTeam()).get(_number).getLocation().clone().add(0, 10, 0); Location target = _manager.getTeamTowers(_tower.getTeam()).get(_number).getLocation().clone().add(0, 10, 0);
Location display = base.clone(); Location display = base.clone();
while (UtilMath.offset(base, target) > UtilMath.offset(base, display)) while (UtilMath.offset(base, target) > UtilMath.offset(base, display))
{ {

View File

@ -35,16 +35,16 @@ public class TeamBeacon
return false; return false;
}*/ }*/
/*public void setBlock(Block block)
{
_block = block;
}*/
public Block getBlock() public Block getBlock()
{ {
return _block; return _block;
} }
/*public void setBlock(Block block)
{
_block = block;
}*/
public void update() public void update()
{ {
if (_block.getType() != Material.BEACON) if (_block.getType() != Material.BEACON)

View File

@ -48,7 +48,7 @@ public abstract class TeamTowerBase
{ {
_host = host; _host = host;
_manager = manager; _manager = manager;
_spawn = spawn.clone().add(-0.5, 1.2, -0.5); _spawn = spawn.clone().add(-0.5, 3.2, -0.5);
_team = team; _team = team;
_maxHealth = 11111D; _maxHealth = 11111D;
_health = 11111D; _health = 11111D;
@ -74,9 +74,9 @@ public abstract class TeamTowerBase
{ {
String message = ""; String message = "";
if (player != null) if (player != null)
message = _host.GetTeam(player).GetColor() + player.getName() + _team.GetColor() + " has destroyed " + _team.getDisplayName() + "'s " + C.cDPurpleB + _type + _team.GetColor() + "!"; message = _host.GetTeam(player).GetColor() + player.getName() + _team.GetColor() + " has destroyed " + _team.getDisplayName() + "'s " + _type + "!";
else else
message = _team.GetColor() + _team.getDisplayName() + "'s " + C.cDPurpleB + _type + _team.GetColor() + " has been destroyed!"; message = _team.GetColor() + _team.getDisplayName() + "'s " + _type + " has been destroyed!";
//Bukkit.broadcastMessage(message); //Bukkit.broadcastMessage(message);
UtilTextMiddle.display("", message); UtilTextMiddle.display("", message);
@ -131,7 +131,7 @@ public abstract class TeamTowerBase
{ {
UtilParticle.PlayParticleToAll(ParticleType.LARGE_EXPLODE, _spawn, null, 0, 2, ViewDist.NORMAL); UtilParticle.PlayParticleToAll(ParticleType.LARGE_EXPLODE, _spawn, null, 0, 2, ViewDist.NORMAL);
_spawn.getWorld().playSound(_spawn, Sound.EXPLODE, 10, 0); _spawn.getWorld().playSound(_spawn, Sound.EXPLODE, 10, 0);
for (Block b : UtilBlock.getExplosionBlocks(_spawn, 2, false)) for (Block b : UtilBlock.getExplosionBlocks(_spawn, 5, false))
{ {
b.setType(Material.AIR); b.setType(Material.AIR);
} }

View File

@ -18,17 +18,15 @@ import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
public class TowerManager implements Listener public class TowerManager implements Listener
{ {
public MinecraftLeague Host; public MinecraftLeague Host;
private ConcurrentHashMap<TeamTowerBase, GameTeam> _towers = new ConcurrentHashMap<TeamTowerBase, GameTeam>(); private ConcurrentHashMap<TeamTowerBase, GameTeam> _towers = new ConcurrentHashMap<TeamTowerBase, GameTeam>();
//private ConcurrentHashMap<GameTeam, Integer> _vulnerableTower = new ConcurrentHashMap<GameTeam, Integer>(); private ConcurrentHashMap<GameTeam, Integer> _vulnerableTower = new ConcurrentHashMap<GameTeam, Integer>();
private ConcurrentHashMap<TeamTowerBase, DefenderAI> _def = new ConcurrentHashMap<TeamTowerBase, DefenderAI>(); private ConcurrentHashMap<TeamTowerBase, DefenderAI> _def = new ConcurrentHashMap<TeamTowerBase, DefenderAI>();
//private ConcurrentHashMap<TeamTowerBase, MapZone> _mapZone = new ConcurrentHashMap<TeamTowerBase, MapZone>(); //private ConcurrentHashMap<TeamTowerBase, MapZone> _mapZone = new ConcurrentHashMap<TeamTowerBase, MapZone>();
private ConcurrentHashMap<GameTeam, List<TeamBeacon>> _beacons = new ConcurrentHashMap<GameTeam, List<TeamBeacon>>(); //private ConcurrentHashMap<TeamTowerBase, TeamBeacon> _beacons = new ConcurrentHashMap<TeamTowerBase, TeamBeacon>();
private OreGenerator _ore; private OreGenerator _ore;
public boolean Attack = false; public boolean Attack = false;
@ -38,49 +36,22 @@ public class TowerManager implements Listener
_ore = new OreGenerator(); _ore = new OreGenerator();
} }
private void makeVulnerable(/*TeamTowerBase base*/GameTeam team, boolean core) private void makeVulnerable(TeamTowerBase base)
{
/*if (base instanceof TeamTower)
_vulnerableTower.put(base.getTeam(), ((TeamTower)base).Number);
else
_vulnerableTower.put(base.getTeam(), 3);*/
List<TeamBeacon> beacon = new ArrayList<TeamBeacon>();
if (core)
{
for (TeamBeacon tb : _beacons.get(team))
Host.Beacons.remove(tb.getBlock());
_beacons.remove(team);
}
for (TeamTowerBase base : getTeamTowers(team))
{ {
if (base instanceof TeamTower) if (base instanceof TeamTower)
{ _vulnerableTower.put(base.getTeam(), ((TeamTower)base).Number);
base.setVulnerable(!core); else
if (!core) _vulnerableTower.put(base.getTeam(), 3);
{
beacon.add(new TeamBeacon(team, base.getBeacon().getBlock())); base.Vulnerable = true;
} //_beacons.get(base.getTeam()).setBlock(getVulnerable(base.getTeam()).getBeacon().getBlock());
}
}
if (core)
{
getTeamTowers(team).getLast().setVulnerable(true);
beacon.add(new TeamBeacon(team, getTeamTowers(team).getLast().getBeacon().getBlock()));
}
_beacons.put(team, beacon);
for (TeamBeacon tb : beacon)
{
Host.Beacons.put(tb.getBlock(), tb);
}
} }
public void ironOreGen(GameTeam team, boolean start) public void ironOreGen(GameTeam team, boolean start)
{ {
int amount = 20; int amount = 20;
if (start) if (start)
amount = 40; amount = 80;
for (Location loc : Host.WorldData.GetCustomLocs(DataLoc.DIAMOND_ORE.getKey())) for (Location loc : Host.WorldData.GetCustomLocs(DataLoc.DIAMOND_ORE.getKey()))
{ {
@ -169,10 +140,10 @@ public class TowerManager implements Listener
return i; return i;
} }
/*public TeamTowerBase getVulnerable(GameTeam team) public TeamTowerBase getVulnerable(GameTeam team)
{ {
return getTeamTowers(team).get(_vulnerableTower.get(team) - 1); return getTeamTowers(team).get(_vulnerableTower.get(team) - 1);
}*/ }
public void parseTowers(WorldData data) public void parseTowers(WorldData data)
{ {
@ -203,12 +174,13 @@ public class TowerManager implements Listener
_mapZone.put(tower, zone);*/ _mapZone.put(tower, zone);*/
} }
makeVulnerable(red, false); makeVulnerable(getTeamTowers(red).getFirst());
makeVulnerable(blue, false); makeVulnerable(getTeamTowers(blue).getFirst());
/*_beacons.put(red, new TeamBeacon(red, getTeamTowers(red).getFirst().getBeacon().getBlock())); for (TeamTowerBase tb : _towers.keySet())
_beacons.put(blue, new TeamBeacon(blue, getTeamTowers(blue).getFirst().getBeacon().getBlock())); {
Host.Beacons.put(red, _beacons.get(red)); TeamBeacon b = new TeamBeacon(tb.getTeam(), tb.getBeacon().getBlock());
Host.Beacons.put(blue, _beacons.get(blue));*/ Host.Beacons.put(b.getBlock(), b);
}
ironOreGen(red, true); ironOreGen(red, true);
ironOreGen(blue, true); ironOreGen(blue, true);
} }
@ -231,12 +203,12 @@ public class TowerManager implements Listener
public void handleTowerDeath(TeamTowerBase towerBase) public void handleTowerDeath(TeamTowerBase towerBase)
{ {
//towerBase.setVulnerable(false); towerBase.setVulnerable(false);
//ironOreGen(towerBase.getTeam()); //ironOreGen(towerBase.getTeam());
for (Player player : towerBase.getTeam().GetPlayers(true)) /*for (Player player : towerBase.getTeam().GetPlayers(true))
{ {
player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 20 * 60, 1)); player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 20 * 60, 1));
} }*/
/*Bukkit.getScheduler().runTaskLater(Host.Manager.getPlugin(), new Runnable() /*Bukkit.getScheduler().runTaskLater(Host.Manager.getPlugin(), new Runnable()
{ {
public void run() public void run()
@ -277,9 +249,7 @@ public class TowerManager implements Listener
return; return;
} }
if (getTeamTowers(towerBase.getTeam()).getFirst().Alive || getTeamTowers(towerBase.getTeam()).get(1).Alive) makeVulnerable(getTeamTowers(towerBase.getTeam()).get(_vulnerableTower.get(towerBase.getTeam())));
return;
makeVulnerable(towerBase.getTeam(), true);
} }
public void toggleAttack() public void toggleAttack()

View File

@ -80,7 +80,7 @@ public class WitherVariation extends GameVariation
@Override @Override
public String[] getTeamScoreboardAdditions(GameTeam team) public String[] getTeamScoreboardAdditions(GameTeam team)
{ {
String skulls = "☠ ☠ ☠"; String skulls = "";
for (int i = 1; i < 4; i++) for (int i = 1; i < 4; i++)
{ {
if (!skulls.equalsIgnoreCase("")) if (!skulls.equalsIgnoreCase(""))
@ -92,7 +92,7 @@ public class WitherVariation extends GameVariation
skulls = skulls + ChatColor.GRAY + ""; skulls = skulls + ChatColor.GRAY + "";
} }
return new String[] {"Altar Skulls: " + skulls}; return new String[] {"Skulls: " + skulls};
} }
private Location getNearest(Location to, ConcurrentHashMap<Location, Double> options) private Location getNearest(Location to, ConcurrentHashMap<Location, Double> options)

View File

@ -29,7 +29,6 @@ import nautilus.game.arcade.game.games.minecraftleague.variation.wither.WitherVa
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Color;
import org.bukkit.FireworkEffect.Type; import org.bukkit.FireworkEffect.Type;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
@ -37,6 +36,7 @@ import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSkeleton; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSkeleton;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.Skeleton; import org.bukkit.entity.Skeleton;
import org.bukkit.entity.Skeleton.SkeletonType; import org.bukkit.entity.Skeleton.SkeletonType;
@ -47,6 +47,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityChangeBlockEvent; import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerDropItemEvent;
@ -246,18 +247,11 @@ public class WitherMinionManager implements Listener
{ {
if (UtilInv.contains(player, Material.SKULL_ITEM, (byte) 1, 1)) if (UtilInv.contains(player, Material.SKULL_ITEM, (byte) 1, 1))
{ {
for (Location loc : UtilShapes.getSphereBlocks(player.getLocation(), 3, 3, true)) UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, player.getLocation(), new Random().nextFloat(), new Random().nextFloat(), new Random().nextFloat(), 0, 1, ViewDist.MAX);
{
UtilParticle.PlayParticleToAll(ParticleType.PORTAL, loc, null, 0, 2, ViewDist.MAX);
}
for (Location loc : UtilShapes.getCircle(player.getLocation(), true, 1))
{
UtilParticle.PlayParticleToAll(ParticleType.DRIP_LAVA, loc, null, 0, 1, ViewDist.MAX);
}
if (Recharge.Instance.usable(player, "FIREWORK_ALERT", false)) if (Recharge.Instance.usable(player, "FIREWORK_ALERT", false))
{ {
Recharge.Instance.use(player, "FIREWORK_ALERT", UtilTime.convert(5, TimeUnit.SECONDS, TimeUnit.MILLISECONDS), false, false); Recharge.Instance.use(player, "FIREWORK_ALERT", UtilTime.convert(2, TimeUnit.SECONDS, TimeUnit.MILLISECONDS), false, false);
UtilFirework.playFirework(player.getEyeLocation().add(0, 3, 0), Type.BALL_LARGE, Color.PURPLE, false, true); UtilFirework.playFirework(player.getEyeLocation().add(0, 3, 0), Type.BURST, _host.Host.GetTeam(player).GetColorBase(), false, true);
} }
} }
else else
@ -469,4 +463,22 @@ public class WitherMinionManager implements Listener
event.setCancelled(true); event.setCancelled(true);
} }
} }
@EventHandler
public void fixDamage(EntityDamageEvent event)
{
if (!_host.Host.IsLive())
return;
if (_entity == null)
return;
if (event.getEntity().getEntityId() != _entity.getEntityId())
return;
event.setCancelled(true);
LivingEntity e = (LivingEntity)event.getEntity();
double newHealth = Math.max(0, e.getHealth() - event.getDamage());
newHealth = Math.min(e.getMaxHealth(), newHealth);
e.setHealth(newHealth);
}
} }