Merge branch 'searchanddestroy' of ssh://184.154.0.242:7999/min/mineplex into searchanddestroy

This commit is contained in:
Chiss 2014-12-19 13:59:31 +11:00
commit 9321abdaf5
23 changed files with 73 additions and 72 deletions

View File

@ -108,8 +108,8 @@ public class SearchAndDestroy extends TeamGame
for (int a = 0; a < 2; a++)
{
double angle = ((2 * Math.PI) / 360D) * ((rotAngle + ((360D / 2) * a)) % 360);
double x = Math.cos(angle);
double z = Math.sin(angle);
double x = 0.9 * Math.cos(angle);
double z = 0.9 * Math.sin(angle);
Location l = center.clone().add(x, y, z);
l.getWorld().spigot()
.playEffect(l, newTier == 2 ? Effect.FLAME : Effect.WATERDRIP, 0, 0, 0, 0, 0, 0, 1, 30);
@ -120,8 +120,8 @@ public class SearchAndDestroy extends TeamGame
}
}
}.runTaskTimer(Manager.GetPlugin(), 0, 0);
_kills.put(player.getName(), _kills.get(player.getName()) - 2);
_evolves.put(player.getName(), newTier);
_kills.put(player.getName(), _kills.get(player.getName()) - 2);
}
@EventHandler
@ -201,7 +201,7 @@ public class SearchAndDestroy extends TeamGame
}
DeathMessages = true;
// TODO The code below could be used when a team is defeated.
// TODO The code below could be used when a team is defeated.
/* if (getBombs().size() == 1)
{
GameTeam winning = getBombs().get(0).getTeam();

View File

@ -35,7 +35,7 @@ public class KitBow extends KitHuman
new ItemStack(Material.CHAINMAIL_CHESTPLATE), new ItemStack(Material.CHAINMAIL_HELMET)
});
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD).setUnbreakable(true).build());
inv.addItem(new ItemBuilder(Material.BOW).setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build());
inv.setItem(8,

View File

@ -38,7 +38,7 @@ public class KitPinner extends KitHuman
new ItemStack(Material.CHAINMAIL_BOOTS), new ItemStack(Material.CHAINMAIL_LEGGINGS),
new ItemStack(Material.CHAINMAIL_CHESTPLATE), new ItemStack(Material.CHAINMAIL_HELMET)
});
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD).setUnbreakable(true).build());
inv.addItem(new ItemBuilder(Material.BOW).setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build());
inv.setItem(8,

View File

@ -43,7 +43,7 @@ public class KitPunch extends KitHuman
new ItemStack(Material.CHAINMAIL_BOOTS), new ItemStack(Material.CHAINMAIL_LEGGINGS),
new ItemStack(Material.CHAINMAIL_CHESTPLATE), new ItemStack(Material.CHAINMAIL_HELMET)
});
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD).setUnbreakable(true).build());
inv.addItem(new ItemBuilder(Material.BOW).setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build());
inv.setItem(8,

View File

@ -35,7 +35,7 @@ public class KitQuickshooter extends KitHuman
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD).setUnbreakable(true).build());
inv.addItem(new ItemBuilder(Material.BOW).setTitle(C.cGreen + "Left-Click" + C.cWhite + " - " + C.cYellow + "Quickshot")
.setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build());

View File

@ -40,7 +40,7 @@ public class KitSharpshooter extends KitHuman
new ItemStack(Material.CHAINMAIL_BOOTS), new ItemStack(Material.CHAINMAIL_LEGGINGS),
new ItemStack(Material.CHAINMAIL_CHESTPLATE), new ItemStack(Material.CHAINMAIL_HELMET)
});
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD).setUnbreakable(true).build());
inv.addItem(new ItemBuilder(Material.BOW).setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build());
inv.setItem(8,

View File

@ -49,7 +49,7 @@ public class KitSniper extends KitHuman
new ItemStack(Material.CHAINMAIL_BOOTS), new ItemStack(Material.CHAINMAIL_LEGGINGS),
new ItemStack(Material.CHAINMAIL_CHESTPLATE), new ItemStack(Material.CHAINMAIL_HELMET)
});
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD).setUnbreakable(true).build());
inv.addItem(new ItemBuilder(Material.BOW).setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build());
inv.setItem(8,

View File

@ -36,7 +36,7 @@ public class KitThunderstorm extends KitHuman
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD).setUnbreakable(true).build());
inv.addItem(new ItemBuilder(Material.BOW).setTitle(C.cGreen + "Left-Click" + C.cWhite + " - " + C.cYellow + "Quickshot")
.setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build());

View File

@ -35,7 +35,7 @@ public class KitEvade extends Kit
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD)
.setTitle(C.cGreen + "Hold Block" + C.cWhite + " - " + C.cYellow + "Evade").setUnbreakable(true).build());

View File

@ -35,7 +35,7 @@ public class KitFlash extends Kit
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_AXE)
.setTitle(C.cGreen + "Right-Click" + C.cWhite + " - " + C.cYellow + "Flash").setUnbreakable(true).build());

View File

@ -35,7 +35,7 @@ public class KitMultiFlash extends Kit
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_AXE)
.setTitle(C.cGreen + "Right-Click" + C.cWhite + " - " + C.cYellow + "Flash").setUnbreakable(true).build());

View File

@ -35,7 +35,7 @@ public class KitPhaseBlast extends Kit
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_AXE)
.setTitle(C.cGreen + "Right-Click" + C.cWhite + " - " + C.cYellow + "Flash").setUnbreakable(true).build());

View File

@ -38,7 +38,7 @@ public class KitRewind extends Kit
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD)
.setTitle(C.cGreen + "Hold Block" + C.cWhite + " - " + C.cYellow + "Evade").setUnbreakable(true).build());
inv.addItem(new ItemBuilder(Material.NETHER_STAR)

View File

@ -36,7 +36,7 @@ public class KitRogue extends Kit
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_AXE).setTitle(C.cGray + "No Ability").setUnbreakable(true).build());
inv.setItem(9, new ItemStack(Material.ARROW, 1));

View File

@ -35,7 +35,7 @@ public class KitWraith extends Kit
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD)
.setTitle(C.cGreen + "Hold Block" + C.cWhite + " - " + C.cYellow + "Evade").setUnbreakable(true).build());
inv.setItem(8,

View File

@ -24,7 +24,7 @@ public class KitBeserker extends Kit
{
super(manager, "Beserker", KitAvailability.Hide, new String[]
{
"Leap and takedown your foes!"
"Leap and bullcharge your foes!"
}, new Perk[]
{
new PerkBullsCharge(), new PerkTakedown()
@ -35,7 +35,7 @@ public class KitBeserker extends Kit
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD)
.setTitle(C.cGreen + "Right-Click" + C.cWhite + " - " + C.cYellow + "Takedown").setUnbreakable(true).build());
inv.addItem(new ItemBuilder(Material.IRON_AXE)

View File

@ -33,10 +33,9 @@ public class KitBreaker extends Kit
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD)
.setTitle(C.cGreen + "Right-Click" + C.cWhite + " - " + C.cYellow + "Takedown").setUnbreakable(true).build());
inv.addItem(new ItemBuilder(Material.IRON_AXE).setTitle(C.cGray + "No Ability").setUnbreakable(true).build());
inv.setArmorContents(new ItemStack[]
{

View File

@ -34,8 +34,7 @@ public class KitChampion extends Kit
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD).setTitle(C.cGray + "No Ability").setUnbreakable(true).build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_AXE)
.setTitle(C.cGreen + "Right-Click" + C.cWhite + " - " + C.cYellow + "Bulls Charge").setUnbreakable(true).build());
inv.addItem(new ItemStack(Material.GOLDEN_APPLE, 2));

View File

@ -27,7 +27,7 @@ public class KitJuggernaut extends Kit
"Deals damage in a large area"
}, new Perk[]
{
new PerkHarden(), new PerkSeismicSlamSND()
new PerkHarden(false), new PerkSeismicSlamSND()
}, EntityType.ZOMBIE, new ItemStack(Material.IRON_SWORD));
}
@ -35,7 +35,7 @@ public class KitJuggernaut extends Kit
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD)
.setTitle(C.cGreen + "Right-Click" + C.cWhite + " - " + C.cYellow + "Seismic Slam").setUnbreakable(true).build());
inv.addItem(new ItemBuilder(Material.IRON_AXE)

View File

@ -26,7 +26,7 @@ public class KitTank extends Kit
"Able to absorb a lot of damage!"
}, new Perk[]
{
new PerkHarden()
new PerkHarden(true)
}, EntityType.ZOMBIE, new ItemStack(Material.IRON_SWORD));
}
@ -34,9 +34,8 @@ public class KitTank extends Kit
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD).setTitle(C.cGray + "No Ability").setUnbreakable(true).build());
inv.addItem(new ItemBuilder(Material.IRON_AXE)
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD)
.setTitle(C.cGreen + "Right-Click" + C.cWhite + " - " + C.cYellow + "Harden").setUnbreakable(true).build());
inv.addItem(new ItemStack(Material.GOLDEN_APPLE, 2));

View File

@ -26,7 +26,7 @@ public class KitTitan extends Kit
"Master of survival!"
}, new Perk[]
{
new PerkHarden(), new PerkDefensiveStance()
new PerkHarden(false), new PerkDefensiveStance()
}, EntityType.ZOMBIE, new ItemStack(Material.IRON_SWORD));
}
@ -34,7 +34,7 @@ public class KitTitan extends Kit
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD)
.setTitle(C.cGreen + "Hold Block" + C.cWhite + " - " + C.cYellow + "Defensive Stance").setUnbreakable(true)
.build());

View File

@ -34,7 +34,7 @@ public class KitTrooper extends Kit
new ItemStack(Material.IRON_CHESTPLATE), new ItemStack(Material.IRON_HELMET)
});
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setItem(2, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.IRON_SWORD).setUnbreakable(true).build());
inv.addItem(new ItemStack(Material.GOLDEN_APPLE, 2));
inv.setItem(8, new ItemBuilder(Material.LEATHER_CHESTPLATE).setColor(this.Manager.GetGame().GetTeam(player).GetColorBase()).setTitle(ChatColor.WHITE + "Evolve Kit Menu").addLore("Right click to use").build());

View File

@ -5,6 +5,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
@ -16,46 +17,49 @@ import nautilus.game.arcade.kit.Perk;
public class PerkHarden extends Perk
{
public PerkHarden()
{
super("Harden", new String[]
{
C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Harden"
});
}
@EventHandler
public void skill(PlayerInteractEvent event)
{
if (event.isCancelled())
return;
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
return;
if (UtilBlock.usable(event.getClickedBlock()))
return;
if (!UtilGear.isAxe(event.getPlayer().getItemInHand()))
return;
Player player = event.getPlayer();
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, GetName(), 30000, true, true))
return;
//Action
Manager.GetCondition().Factory().Slow(GetName(), player, player, 8, 1, false, false, false, false);
Manager.GetCondition().Factory().HealthBoost(GetName(), player, player, 8, 3, false, false, false);
private boolean _isSword;
//Inform
UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + "."));
public PerkHarden(boolean isSword)
{
super("Harden", new String[]
{
C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Harden"
});
_isSword = isSword;
}
//Effect
player.getWorld().playSound(player.getLocation(), Sound.HORSE_ARMOR, 1f, 1f);
}
@EventHandler
public void skill(PlayerInteractEvent event)
{
if (event.isCancelled())
return;
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
return;
if (UtilBlock.usable(event.getClickedBlock()))
return;
ItemStack item = event.getPlayer().getItemInHand();
if (_isSword ? !UtilGear.isSword(item) : !UtilGear.isAxe(item))
return;
Player player = event.getPlayer();
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, GetName(), 30000, true, true))
return;
// Action
Manager.GetCondition().Factory().Slow(GetName(), player, player, 8, 1, false, false, false, false);
Manager.GetCondition().Factory().HealthBoost(GetName(), player, player, 8, 3, false, false, false);
// Inform
UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + "."));
// Effect
player.getWorld().playSound(player.getLocation(), Sound.HORSE_ARMOR, 1f, 1f);
}
}