Added some things and stuff

This commit is contained in:
Mysticate 2015-07-12 18:15:33 -04:00
parent 0a09ae29f3
commit 616c444c16
3 changed files with 45 additions and 14 deletions

View File

@ -56,11 +56,16 @@ public class BombLobbers extends TeamGame
new KitWaller(manager)
}, new String[]
{
"Throw TNT to blow up your enemies!",
"Click with TNT to throw"
"Fight against your enemies using",
"the power of explosives!",
"",
"Left click TNT to throw at your enemy.",
"Last team alive wins!",
"Kaboom!"
});
DamageSelf = false;
DamageTeamSelf = false;
WorldWaterDamage = 5;
@ -174,7 +179,7 @@ public class BombLobbers extends TeamGame
_throwers.remove(tnt);
_teams.remove(tnt);
for (Player other : UtilPlayer.getNearby(event.getEntity().getLocation(), 5))
for (Player other : UtilPlayer.getNearby(event.getEntity().getLocation(), 14))
{
Manager.GetCondition().Factory().Explosion("Throwing TNT", other, thrower, 50, 0.1, false, false);
}

View File

@ -1,6 +1,7 @@
package nautilus.game.arcade.game.games.lobbers.kits;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilInv;
import mineplex.core.itemstack.ItemBuilder;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.lobbers.kits.perks.PerkCraftman;
@ -31,14 +32,23 @@ public class KitArmorer extends Kit
}, EntityType.ZOMBIE,
new ItemStack(Material.AIR));
}
@Override
public void GiveItems(Player player)
public void ApplyKit(Player player)
{
UtilInv.Clear(player);
for (Perk perk : GetPerks())
perk.Apply(player);
GiveItemsCall(player);
player.getInventory().setHelmet(new ItemBuilder(Material.GOLD_HELMET).setUnbreakable(true).build());
player.getInventory().setChestplate(new ItemBuilder(Material.GOLD_CHESTPLATE).setUnbreakable(true).build());
player.getInventory().setLeggings(new ItemBuilder(Material.GOLD_LEGGINGS).setUnbreakable(true).build());
player.getInventory().setBoots(new ItemBuilder(Material.GOLD_BOOTS).setUnbreakable(true).build());
UtilInv.Update(player);
}
@Override
@ -50,4 +60,10 @@ public class KitArmorer extends Kit
ent.getEquipment().setBoots(new ItemBuilder(Material.GOLD_BOOTS).build());
}
@Override
public void GiveItems(Player player)
{
}
}

View File

@ -1,6 +1,7 @@
package nautilus.game.arcade.game.games.lobbers.kits.perks;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import mineplex.core.common.util.C;
@ -75,7 +76,9 @@ public class PerkWaller extends Perk
if (!UtilInv.IsItem(event.getItem(), Material.STONE_SPADE, (byte) 0))
return;
_wallBlocks.addAll(buildWall(event.getClickedBlock().getLocation(), event.getPlayer().getLocation().getYaw(), getFace(event.getPlayer().getLocation().getYaw())));
UtilInv.remove(event.getPlayer(), Material.STONE_SPADE, (byte) 0, 1);
_wallBlocks.addAll(buildWall(event.getClickedBlock().getLocation(), event.getPlayer().getLocation().getYaw()));
}
@SuppressWarnings("deprecation")
@ -85,13 +88,18 @@ public class PerkWaller extends Perk
if (!Manager.GetGame().IsLive())
return;
for (Block block : event.GetBlocks())
Iterator<Block> iterator = event.GetBlocks().iterator();
while (iterator.hasNext())
{
Block block = iterator.next();
if (_wallBlocks.contains(block.getLocation()))
{
if (block.getData() != 2)
{
block.setData((byte) 2);
iterator.remove();
}
}
}
@ -108,7 +116,7 @@ public class PerkWaller extends Perk
for (TNTPrimed tnt : _tnt)
{
for (Block near : UtilBlock.getInRadius(tnt.getLocation(), 1.5F).keySet())
for (Block near : UtilBlock.getInRadius(tnt.getLocation(), 2.0F).keySet())
{
if (_wallBlocks.contains(near.getLocation()))
{
@ -118,8 +126,11 @@ public class PerkWaller extends Perk
}
}
private Set<Location> buildWall(final Location source, final float playerYaw, final BlockFace facing)
@SuppressWarnings("deprecation")
private Set<Location> buildWall(final Location source, final float playerYaw)
{
BlockFace facing = getFace(playerYaw + 180F);
Set<Location> allWallBlocks = new HashSet<Location>();
Set<Location> baseWallBlocks = new HashSet<Location>();
@ -147,16 +158,15 @@ public class PerkWaller extends Perk
for (Location block : allWallBlocks)
{
block.getBlock().setType(Material.SMOOTH_BRICK);
block.getWorld().playEffect(block, Effect.STEP_SOUND, 1.0F);
block.getBlock().setData((byte) 0);
block.getWorld().playEffect(block, Effect.STEP_SOUND, block.getBlock().getType());
}
return allWallBlocks;
}
private BlockFace getFace(float yaw)
{
if (yaw < 0)
yaw = yaw * (-1);
return axis[Math.round(yaw / 90F) & 0x3];
return axis[Math.round(yaw / 90f) & 0x3];
}
}