Merge branch 'master' of ssh://184.154.0.242:7999/min/mineplex

Conflicts:
	Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java
This commit is contained in:
libraryaddict 2015-03-20 19:33:27 +13:00
commit 83b18129f2
3 changed files with 50 additions and 80 deletions

View File

@ -178,7 +178,10 @@ public class HideSeek extends TeamGame
private long _hideTime = 20000;
private long _gameTime = 360000;
private boolean _bowGiven = false;
private long _bowGiveTime = 0;
private boolean _started = false;
private HashMap<Player, Integer> _arrowHits = new HashMap<Player, Integer>();
@ -370,40 +373,47 @@ public class HideSeek extends TeamGame
}
}
public void GiveItems()
public void GiveItems(boolean bowOnly)
{
for (Player player : _hiders.GetPlayers(true))
{
// Axe
player.getInventory().setItem(0,
ItemStackFactory.Instance.CreateStack(Material.WOOD_AXE, (byte) 0, 1, C.cGreen + "Speed Axe"));
if (bowOnly)
{
// Bow
ItemStack bow = ItemStackFactory.Instance.CreateStack(Material.BOW, (byte) 0, 1, C.cYellow + C.Bold + "Shoot Hunters"
+ C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Upgrades Axe");
bow.addEnchantment(Enchantment.ARROW_INFINITE, 1);
player.getInventory().setItem(1, bow);
player.getInventory().setItem(28, ItemStackFactory.Instance.CreateStack(Material.ARROW));
}
else
{
// Axe
player.getInventory().setItem(0,
ItemStackFactory.Instance.CreateStack(Material.WOOD_AXE, (byte) 0, 1, C.cGreen + "Speed Axe"));
// Bow
ItemStack bow = ItemStackFactory.Instance.CreateStack(Material.BOW, (byte) 0, 1, C.cYellow + C.Bold + "Shoot Hunters"
+ C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Upgrades Axe");
bow.addEnchantment(Enchantment.ARROW_INFINITE, 1);
player.getInventory().setItem(1, bow);
player.getInventory().setItem(28, ItemStackFactory.Instance.CreateStack(Material.ARROW));
// Meower
player.getInventory().setItem(
4,
ItemStackFactory.Instance.CreateStack(Material.SUGAR, (byte) 0, 1, C.cYellow + C.Bold + "Meow" + C.cWhite
+ C.Bold + " - " + C.cGreen + C.Bold + "+0.25 Gems"));
// Meower
player.getInventory().setItem(
4,
ItemStackFactory.Instance.CreateStack(Material.SUGAR, (byte) 0, 1, C.cYellow + C.Bold + "Meow" + C.cWhite
+ C.Bold + " - " + C.cGreen + C.Bold + "+0.25 Gems"));
// Firework
ItemStack firework = ItemStackFactory.Instance.CreateStack(Material.FIREWORK, (byte) 0, 5, C.cYellow + C.Bold
+ "Firework" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "+2 Gems");
FireworkMeta metaData = (FireworkMeta) firework.getItemMeta();
metaData.setPower(1);
metaData.addEffect(FireworkEffect.builder().flicker(true).withColor(Color.AQUA).with(Type.BALL_LARGE).trail(true)
.build());
firework.setItemMeta(metaData);
player.getInventory().setItem(5, firework);
// Firework
ItemStack firework = ItemStackFactory.Instance.CreateStack(Material.FIREWORK, (byte) 0, 5, C.cYellow + C.Bold
+ "Firework" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "+2 Gems");
FireworkMeta metaData = (FireworkMeta) firework.getItemMeta();
metaData.setPower(1);
metaData.addEffect(FireworkEffect.builder().flicker(true).withColor(Color.AQUA).with(Type.BALL_LARGE).trail(true)
.build());
firework.setItemMeta(metaData);
player.getInventory().setItem(5, firework);
// Recharges
Recharge.Instance.useForce(player, "Meow", 15000);
Recharge.Instance.useForce(player, "Firework", 15000);
// Recharges
Recharge.Instance.useForce(player, "Meow", 15000);
Recharge.Instance.useForce(player, "Firework", 15000);
}
player.playSound(player.getLocation(), Sound.HORSE_ARMOR, 1f, 1f);
}
}
@ -1128,6 +1138,8 @@ public class HideSeek extends TeamGame
if (event.getType() != UpdateType.TICK)
return;
// Hide Time
if (!_started)
{
@ -1138,7 +1150,8 @@ public class HideSeek extends TeamGame
_started = true;
// Hider Items
GiveItems();
GiveItems(false);
_bowGiveTime = System.currentTimeMillis();
// Remove Barrier
for (Location loc : WorldData.GetDataLocs("BLACK"))
@ -1150,6 +1163,13 @@ public class HideSeek extends TeamGame
// Seek Time
else
{
//Give Bow
if (!_bowGiven && UtilTime.elapsed(_bowGiveTime, 10000))
{
GiveItems(true);
_bowGiven = true;
}
long timeLeft = _gameTime - (System.currentTimeMillis() - GetStateTime() - _hideTime);
if (timeLeft <= 0)

View File

@ -148,7 +148,6 @@ public class SurvivalGames extends SoloGame
private Field _packetTeam;
private IPacketHandler _useEntityPacketHandler;
private int _deadBodyCount;
private NautHashMap<Location, Kit> _deadBodyLocations = new NautHashMap<Location, Kit>();
private int _chestRefillTime = 60 * 7;
private NautHashMap<TileEntityChest, Integer> _openedChests = new NautHashMap<TileEntityChest, Integer>();
@ -898,10 +897,6 @@ public class SurvivalGames extends SoloGame
ex.printStackTrace();
}
// Store Kit
if (GetKit(player) != null && !(GetKit(player) instanceof KitStealer))
_deadBodyLocations.put(player.getLocation(), GetKit(player));
GameProfile newProfile = new GameProfile(UUID.randomUUID(), name);
newProfile.getProperties().putAll(((CraftPlayer) player).getHandle().getProfile().getProperties());

View File

@ -1,45 +0,0 @@
package nautilus.game.arcade.game.games.survivalgames.kit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
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.*;
public class KitStealer extends Kit
{
public KitStealer(ArcadeManager manager)
{
super(manager, "Necromancer", KitAvailability.Gem, 5000,
new String[]
{
"Steal kits from dead bodies"
},
new Perk[]
{
new PerkSkeletons(true)
},
EntityType.ZOMBIE,
new ItemStack(Material.SKULL_ITEM));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().setItem(7, ItemStackFactory.Instance.CreateStack(Material.INK_SACK, (byte)1, 1,
C.cGreen + "Click" +
C.cWhite + C.Bold + " - " +
C.cYellow + "Absorb Kit"));
}
}