More work done on SnD

This commit is contained in:
libraryaddict 2014-12-08 22:07:40 +13:00
parent f5d9d8dcf0
commit 0026127647
11 changed files with 58 additions and 63 deletions

View File

@ -74,7 +74,7 @@ public class KitEvolvePage extends ShopPageBase<KitEvolve, KitEvolveShop>
ItemStack item = getItem(k.kitSlot);
if (item == null || item.getType() == Material.AIR)
{
AddItem(k.kitSlot, makeItem(new ItemBuilder(Material.STONE).setTitle(C.cRed + "Locked").build()));
AddItem(k.kitSlot, makeItem(new ItemBuilder(Material.COAL).setTitle(C.cRed + "Locked").build()));
}
}
for (int slot = 0; slot < this.getSize(); slot++)
@ -82,7 +82,7 @@ public class KitEvolvePage extends ShopPageBase<KitEvolve, KitEvolveShop>
ItemStack item = getItem(slot);
if (item == null || item.getType() == Material.AIR)
{
AddItem(slot, makeItem(new ItemBuilder(Material.STAINED_GLASS_PANE, 1, (short) 7).setTitle(" ").build()));
AddItem(slot, makeItem(new ItemBuilder(Material.STAINED_GLASS_PANE, 1, (short) 12).setTitle(" ").build()));
}
}
}

View File

@ -51,6 +51,7 @@ public class SearchAndDestroy extends TeamGame
private KitEvolve _evolve;
private HashMap<String, Integer> _kills = new HashMap<String, Integer>();
private HashMap<String, Integer> _evolves = new HashMap<String, Integer>();
private KitManager _kitManager = new KitManager(this);
private IPacketHandler _teamBombPackets = new IPacketHandler()
{
@ -120,12 +121,14 @@ public class SearchAndDestroy extends TeamGame
public boolean canEvolve(Player player)
{
return _kills.containsKey(player.getName()) && _kills.get(player.getName()) >= 2;
return _kills.containsKey(player.getName()) && _kills.get(player.getName()) >= 2
&& (!_evolves.containsKey(player.getName()) || _evolves.get(player.getName()) < 2);
}
public void onEvolve(Player player)
{
_kills.put(player.getName(), _kills.get(player.getName()) - 2);
_evolves.put(player.getName(), (_evolves.containsKey(player.getName()) ? _evolves.get(player.getName()) : 0) + 1);
}
@EventHandler
@ -163,10 +166,15 @@ public class SearchAndDestroy extends TeamGame
}
if (event.getType() == UpdateType.SEC)
{
Iterator<TeamBomb> itel = getBombs().iterator();
while (itel.hasNext())
for (int a = 0; a < getBombs().size(); a++)
{
TeamBomb bomb = itel.next();
TeamBomb bomb = getBombs().get(a);
if (!bomb.getTeam().IsTeamAlive())
{
bomb.removeBomb();
getBombs().remove(a--);
continue;
}
bomb.checkArmers();
bomb.tickBomb();
GameTeam bombOwner = bomb.getTeam();
@ -185,7 +193,7 @@ public class SearchAndDestroy extends TeamGame
else if (timeLeft == 0)
{
// It exploded
itel.remove();
getBombs().remove(a--);
bomb.getBlockLocation().getWorld().playSound(bomb.getBlockLocation(), Sound.EXPLODE, 1000, 0);
bomb.getBlockLocation().getWorld().playEffect(bomb.getBomb().getLocation(), Effect.EXPLOSION_HUGE, 0);
bomb.removeBomb();
@ -213,8 +221,8 @@ public class SearchAndDestroy extends TeamGame
}
if (timeLeft > 0)
{
int a = timeLeft % 3;
if (a == 1)
int b = timeLeft % 3;
if (b == 1)
{
try
{
@ -308,7 +316,7 @@ public class SearchAndDestroy extends TeamGame
if (slot >= 0)
{
ItemStack item = player.getInventory().getItem(slot);
String message = C.Bold + "Ready to evolve kits!";
String message = C.Bold + "Ready to Evolve Kit Menus!";
_flickerOn = !_flickerOn;
if (_flickerOn)
{
@ -356,7 +364,7 @@ public class SearchAndDestroy extends TeamGame
for (TeamBomb bomb : bombs)
{
if (bomb.getTeam() == team)
if (bomb.getTeam() == team && bomb.isArmed())
{
bombsArmed++;
}
@ -367,7 +375,7 @@ public class SearchAndDestroy extends TeamGame
}
else
{
GetScoreboard().Write(C.cYellow + "Bombs Safe");
GetScoreboard().Write(C.cYellow + "Bombs are safe");
}
if (itel.hasNext())

View File

@ -120,8 +120,8 @@ class TeamBomb implements Comparable<TeamBomb>
_bombEntity = (TNTPrimed) entity.getBukkitEntity();
_timeUntilExplode = 60;
Bukkit.broadcastMessage(ChatColor.GOLD + "" + ChatColor.MAGIC + "ab " + gameTeam.GetColor() + gameTeam.GetName()
+ ChatColor.RESET + ChatColor.GOLD + " just armed " + getTeam().GetColor() + getTeam().GetName() + " Team's"
+ ChatColor.RESET + ChatColor.GOLD + " bomb! " + ChatColor.MAGIC + "ab");
+ " Team" + ChatColor.RESET + ChatColor.GOLD + " just armed " + getTeam().GetColor() + getTeam().GetName()
+ " Team's" + ChatColor.RESET + ChatColor.GOLD + " bomb! " + ChatColor.MAGIC + "ab");
for (Player player : Bukkit.getOnlinePlayers())
{
GameTeam hisTeam = _game.GetTeam(player);

View File

@ -1,7 +1,6 @@
package nautilus.game.arcade.game.games.searchanddestroy.kits.bow;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.castlesiege.kits.KitHuman;
import nautilus.game.arcade.kit.KitAvailability;
@ -30,14 +29,16 @@ public class KitBow extends KitHuman
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.setItem(4, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.setArmorContents(new ItemStack[]
{
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.addItem(new ItemBuilder(Material.BOW).setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build());
inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve Kit Menu").addLore("Right click to use")
.build());
inv.setItem(9, new ItemStack(Material.ARROW, 1));
player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET));
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE));
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS));
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS));
}
}

View File

@ -1,13 +1,11 @@
package nautilus.game.arcade.game.games.searchanddestroy.kits.bow;
import mineplex.core.common.util.C;
import mineplex.core.itemstack.ItemBuilder;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.castlesiege.kits.KitHuman;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkPinned;
import nautilus.game.arcade.kit.perks.PerkQuickshot;
import org.bukkit.ChatColor;
import org.bukkit.Material;
@ -27,7 +25,7 @@ public class KitPinner extends KitHuman
"Your arrows enchanted with gravity magic.", "Victims find it hard to lift", "Their bodies are sluggish"
}, new Perk[]
{
new PerkQuickshot("Quickshot", 2, 8000), new PerkPinned()
new PerkPinned()
}, EntityType.SKELETON, new ItemStack(Material.OBSIDIAN));
}
@ -41,9 +39,8 @@ public class KitPinner 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.addItem(new ItemBuilder(Material.BOW).setTitle(C.cGreen + "Left-Click" + C.cWhite + " - " + C.cYellow + "Quickshot")
.setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build());
inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve kit").addLore("Right click to use")
inv.addItem(new ItemBuilder(Material.BOW).setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build());
inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve Kit Menu").addLore("Right click to use")
.build());
inv.setItem(9, new ItemStack(Material.ARROW, 1));
}

View File

@ -49,7 +49,7 @@ public class KitPunch extends KitHuman
});
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.BOW).setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build());
inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve kit").addLore("Right click to use")
inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve Kit Menu").addLore("Right click to use")
.build());
inv.setItem(9, new ItemStack(Material.ARROW, 1));
}

View File

@ -42,7 +42,7 @@ public class KitSharpshooter extends KitHuman
});
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.BOW).setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build());
inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve kit").addLore("Right click to use")
inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve Kit Menu").addLore("Right click to use")
.build());
inv.setItem(9, new ItemStack(Material.ARROW, 1));

View File

@ -51,7 +51,7 @@ public class KitSniper extends KitHuman
});
inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build());
inv.addItem(new ItemBuilder(Material.BOW).setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build());
inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve kit").addLore("Right click to use")
inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve Kit Menu").addLore("Right click to use")
.build());
inv.setItem(9, new ItemStack(Material.ARROW, 1));

View File

@ -45,7 +45,7 @@ public class KitThunderstorm extends KitHuman
new ItemStack(Material.CHAINMAIL_CHESTPLATE), new ItemStack(Material.CHAINMAIL_HELMET)
});
inv.addItem(new ItemBuilder(Material.BOW).setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build());
inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve kit").addLore("Right click to use")
inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve Kit Menu").addLore("Right click to use")
.build());
inv.setItem(9, new ItemStack(Material.ARROW, 1));
}

View File

@ -7,44 +7,36 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import mineplex.core.common.util.C;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkBullsCharge;
public class KitAssault extends Kit
{
public KitAssault(ArcadeManager manager)
{
super(manager, "Assault", KitAvailability.Free, new String[]
super(manager, "Assault", KitAvailability.Hide, new String[]
{
"Charge at enemies and cripple them!"
},
new Perk[]
{
new PerkBullsCharge()
},
EntityType.ZOMBIE, new ItemStack(Material.IRON_SWORD));
"Bulls Charge ability.", "Temperary speed boost when activated.", "When attacking with the boost on",
"The victim is stunned and slows down"
}, new Perk[0], EntityType.ZOMBIE, new ItemStack(Material.IRON_SWORD));
}
@Override
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.setItem(4, 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).setTitle(C.cGreen + "Right-Click" + C.cWhite + " - " + C.cYellow + "Bulls Charge").setUnbreakable(true).build());
inv.addItem(new ItemStack(Material.GOLDEN_APPLE, 2));
player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.IRON_HELMET));
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.IRON_CHESTPLATE));
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.IRON_LEGGINGS));
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.IRON_BOOTS));
inv.setArmorContents(new ItemStack[]
{
new ItemStack(Material.IRON_BOOTS), new ItemStack(Material.IRON_LEGGINGS),
new ItemStack(Material.IRON_CHESTPLATE), new ItemStack(Material.IRON_HELMET)
});
inv.addItem(new ItemStack(Material.IRON_SWORD));
inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve Kit Menu").addLore("Right click to use")
.build());
}
}

View File

@ -8,7 +8,6 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
@ -22,24 +21,22 @@ public class KitTrooper extends Kit
super(manager, "Trooper", KitAvailability.Free, new String[]
{
"Full iron armor and 2 golden apples"
},
new Perk[0],
EntityType.ZOMBIE, new ItemStack(Material.IRON_SWORD));
}, new Perk[0], EntityType.ZOMBIE, new ItemStack(Material.IRON_SWORD));
}
@Override
public void GiveItems(Player player)
{
PlayerInventory inv = player.getInventory();
inv.setItem(4, 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.IRON_AXE).setUnbreakable(true).build());
inv.setArmorContents(new ItemStack[]
{
new ItemStack(Material.IRON_BOOTS), new ItemStack(Material.IRON_LEGGINGS),
new ItemStack(Material.IRON_CHESTPLATE), new ItemStack(Material.IRON_HELMET)
});
inv.addItem(new ItemStack(Material.IRON_SWORD));
inv.addItem(new ItemStack(Material.GOLDEN_APPLE, 2));
player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.IRON_HELMET));
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.IRON_CHESTPLATE));
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.IRON_LEGGINGS));
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.IRON_BOOTS));
inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve Kit Menu").addLore("Right click to use")
.build());
}
}