Update player death handling, add aggressive chicken behavior, minor changes and refactoring.

This commit is contained in:
Thanos paravantis 2016-02-26 18:17:03 +02:00
parent 0e697e279b
commit 1e08e1a5db
50 changed files with 1151 additions and 944 deletions

View File

@ -46,7 +46,7 @@ public class AchievementMainPage extends ShopPageBase<AchievementManager, Achiev
protected void buildPage()
{
ArrayList<Integer> pageLayout = new ItemLayout(
"OXOXOXOXO",
"XXXXOXXXO",
"OXOXOXOXO",
"OXOXOXOXO",
"OXOXOXOXO").getItemSlots();

View File

@ -18,6 +18,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Chicken;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -25,29 +26,35 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.HandlerList;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.scheduler.BukkitRunnable;
import mineplex.core.account.CoreClient;
import mineplex.core.blood.BloodEvent;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTextTop;
import mineplex.core.common.util.UtilTime;
@ -93,6 +100,7 @@ import nautilus.game.arcade.game.games.mineware.challenges.ChallengePickASide;
import nautilus.game.arcade.game.games.mineware.challenges.ChallengePunchThePig;
import nautilus.game.arcade.game.games.mineware.challenges.ChallengeRedLightGreenLight;
import nautilus.game.arcade.game.games.mineware.challenges.ChallengeReverseTag;
import nautilus.game.arcade.game.games.mineware.challenges.ChallengeRunner;
import nautilus.game.arcade.game.games.mineware.challenges.ChallengeRushPush;
import nautilus.game.arcade.game.games.mineware.challenges.ChallengeShootChickens;
import nautilus.game.arcade.game.games.mineware.challenges.ChallengeSmashOff;
@ -222,6 +230,7 @@ public class BawkBawkBattles extends TeamGame implements IThrown
_challenges.add(ChallengePunchThePig.class);
_challenges.add(ChallengeRedLightGreenLight.class);
_challenges.add(ChallengeReverseTag.class);
_challenges.add(ChallengeRunner.class); // TODO: To be tested.
_challenges.add(ChallengeRushPush.class);
_challenges.add(ChallengeShootChickens.class);
_challenges.add(ChallengeSmashOff.class);
@ -657,7 +666,7 @@ public class BawkBawkBattles extends TeamGame implements IThrown
Scoreboard.Reset();
if (GetPlayers(true).size() > 14)
if (super.GetPlayers(true).size() > 14)
{
int alive = 0;
@ -761,19 +770,20 @@ public class BawkBawkBattles extends TeamGame implements IThrown
List<String> messages = Arrays.asList(challenge.getGameMessages());
for (Player player : UtilServer.getPlayers())
for (Player player : GetPlayers(true))
{
UtilPlayer.message(player, F.count(ArcadeFormat.Line));
UtilPlayer.message(player, "");
// UtilPlayer.message(player, F.count(ArcadeFormat.Line));
UtilPlayer.message(player, " " + C.cYellow + challenge.getName());
UtilPlayer.message(player, " " + C.cYellow + challenge.getName() + C.Reset + " " + C.cGray + challenge.getType().toString());
UtilPlayer.message(player, "");
for (String currentMessage : messages)
if (messages.get(messages.size() - 1) != currentMessage)
UtilPlayer.message(player, C.cGray + " - " + C.cWhite + currentMessage);
UtilPlayer.message(player, "");
UtilPlayer.message(player, F.count(ArcadeFormat.Line));
// UtilPlayer.message(player, "");
// UtilPlayer.message(player, F.count(ArcadeFormat.Line));
}
while (true)
@ -781,7 +791,7 @@ public class BawkBawkBattles extends TeamGame implements IThrown
if (!IsLive())
break;
for (Player player : UtilServer.getPlayers())
for (Player player : GetPlayers(true))
{
String message = C.cYellow + messages.get(looped);
UtilTextMiddle.display(challenge.getName(), message, 0, 60, 20);
@ -870,7 +880,12 @@ public class BawkBawkBattles extends TeamGame implements IThrown
if (!IsLive())
return;
if (!IsAlive(event.getPlayer()))
Player player = event.getPlayer();
if (!IsAlive(player))
return;
if (!getChallengers().contains(player))
return;
if (!PrepareFreeze)
@ -897,6 +912,10 @@ public class BawkBawkBattles extends TeamGame implements IThrown
return;
Player player = event.getEntity();
if (_chickenTeam.HasPlayer(player))
return;
Location death = player.getLocation().clone();
_challenge.getLost().add(player);
@ -994,7 +1013,7 @@ public class BawkBawkBattles extends TeamGame implements IThrown
if (player.equals(other))
continue;
if (UtilMath.offset(other, player) > 5)
if (UtilMath.offset(other, player) > 7)
continue;
if (Recharge.Instance.use(player, "Approach Alive Player", 500, false, false))
@ -1010,6 +1029,82 @@ public class BawkBawkBattles extends TeamGame implements IThrown
}
}
@EventHandler
public void onChickenAttack(UpdateEvent event)
{
if (!IsLive())
return;
if (event.getType() != UpdateType.SEC)
return;
if (_chickenTeam == null)
return;
if (_chickenTeam.GetSize() == 0)
return;
for (Player player : _chickenTeam.GetPlayers(true))
{
Chicken chicken = UtilMath.randomElement(_chickenAttack.getChickens());
// Chickens attacking too many players.
if (!chicken.isOnGround())
return;
UtilEnt.CreatureLook(chicken, player);
//UtilAction.velocity(chicken, UtilAlg.calculateVelocity(player.getVelocity(), chicken.getVelocity(), 1.0D));
UtilAction.velocity(chicken, UtilAlg.getTrajectory(chicken, player).setY(0.3D));
Manager.GetProjectile().AddThrow(
chicken,
null,
this,
-1,
true,
false,
false,
true,
0.8F);
}
}
@EventHandler
public void onChickenAttackParticle(UpdateEvent event)
{
if (!IsLive())
return;
if (event.getType() != UpdateType.TICK)
return;
for (Chicken chicken : _chickenAttack.getChickens())
{
if (!chicken.isOnGround())
{
UtilParticle.PlayParticle(ParticleType.FLAME, chicken.getLocation(), 0.1F, 0.1F, 0.1F, 0.02F, 1, ViewDist.NORMAL);
}
}
}
@EventHandler
public void onChickenAttackPlayerDeath(PlayerDeathEvent event)
{
if (!IsLive())
return;
if (_challenge == null)
return;
Player player = event.getEntity();
if (!_chickenTeam.HasPlayer(player))
return;
_chickenAttack.kill(player);
}
private void gameLostMessage(Player player)
{
UtilPlayer.message(player, "");
@ -1236,8 +1331,8 @@ public class BawkBawkBattles extends TeamGame implements IThrown
_chickenAttack = new ChickenAttack(
this,
new Location(WorldData.World, 50, 0, 0),
new Location(WorldData.World, 47, 0, -3),
new Location(WorldData.World, 53, 0, 3));
new Location(WorldData.World, 45, 0, -5),
new Location(WorldData.World, 55, 0, 5));
}
@EventHandler
@ -1262,10 +1357,25 @@ public class BawkBawkBattles extends TeamGame implements IThrown
}
@EventHandler
public void onBlood(BloodEvent event)
public void onItemSpawn(ItemSpawnEvent event)
{
if (!IsLive())
return;
Item blood = event.getEntity();
ItemStack bloodItem = blood.getItemStack();
if (bloodItem.getType() == Material.INK_SACK && bloodItem.getData().getData() == 1)
{
if (bloodItem.hasItemMeta())
{
if (bloodItem.getItemMeta().hasDisplayName())
{
event.setCancelled(true);
}
}
}
}
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event)
@ -1458,6 +1568,23 @@ public class BawkBawkBattles extends TeamGame implements IThrown
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
getCurrentChallenge().onCollide(target, block, data);
if (data.GetThrown() instanceof Chicken)
{
if (target instanceof Player)
{
Player player = (Player) target;
if (_chickenTeam.HasPlayer(player) && IsAlive(player))
{
player.playSound(player.getLocation(), Sound.CHICKEN_HURT, 2.0F, 1.0F);
player.damage(4.0D);
if (UtilMath.random.nextBoolean())
UtilTextBottom.display(C.cRed + C.Bold + "bawk bawk!", player);
}
}
}
}
@Override

View File

@ -32,11 +32,6 @@ import nautilus.game.arcade.world.WorldData;
public abstract class Challenge implements Listener
{
public enum ChallengeType
{
LastStanding, FirstComplete
}
public BawkBawkBattles Host;
private String _name;

View File

@ -4,11 +4,11 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map.Entry;
import mineplex.core.common.util.UtilPlayer;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import mineplex.core.common.util.UtilPlayer;
public abstract class ChallengeSeperateRooms extends Challenge
{
private HashMap<String, Integer[]> _borders = new HashMap<String, Integer[]>();

View File

@ -28,6 +28,7 @@ import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilShapes;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeAnvilDance extends Challenge
{
@ -56,7 +57,12 @@ public class ChallengeAnvilDance extends Challenge
public ChallengeAnvilDance(BawkBawkBattles host)
{
super(host, ChallengeType.LastStanding, "Anvil Dance", "It's raining anvils!", "Dodge them to stay alive.");
super(
host,
ChallengeType.LastStanding,
"Anvil Dance",
"It's raining anvils!",
"Dodge them to stay alive.");
}
@Override

View File

@ -29,6 +29,7 @@ import mineplex.core.itemstack.ItemBuilder;
import nautilus.game.arcade.game.games.mineware.AntiHackFix;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
import nautilus.game.arcade.game.games.mineware.events.ChallengeEndEvent;
public class ChallengeArrowRampage extends Challenge
@ -45,8 +46,7 @@ public class ChallengeArrowRampage extends Challenge
false,
true,
"You are equipped with explosive arrows.",
"Force your enemy into the void!"
);
"Force your enemy into the void!");
_antiHackFix = new AntiHackFix(this);
}

View File

@ -27,6 +27,7 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeBlockLobbers extends Challenge
{
@ -39,8 +40,7 @@ public class ChallengeBlockLobbers extends Challenge
host, ChallengeType.LastStanding,
"Block Lobbers",
"Throw blocks to other players.",
"Try to knock them off the platform!"
);
"Try to knock them off the platform!");
}
@Override

View File

@ -30,6 +30,7 @@ import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.mineware.AntiHackFix;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeBouncingBlock extends Challenge
{
@ -39,8 +40,13 @@ public class ChallengeBouncingBlock extends Challenge
public ChallengeBouncingBlock(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Bouncing Block", "Jump and punch floating wool blocks.",
"Avoid landing on red wool.", "First to 10 wins!");
super(
host,
ChallengeType.FirstComplete,
"Bouncing Block",
"Jump and punch floating wool blocks.",
"Avoid landing on red wool.",
"First to 10 wins!");
_antiHackFix = new AntiHackFix(this);
}

View File

@ -1,88 +0,0 @@
package nautilus.game.arcade.game.games.mineware.challenges;
import java.util.ArrayList;
import java.util.HashMap;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.ChallengeSeperateRooms;
public class ChallengeBuildBuilding extends ChallengeSeperateRooms
{
private ArrayList<Material> _materials = new ArrayList<Material>();
private HashMap<Location, Material> _build = new HashMap<Location, Material>();
public ChallengeBuildBuilding(BawkBawkBattles host, String challengeName)
{
super(host, ChallengeType.FirstComplete, "Replicate the building!");
for (int x = 0; x < 3; x++)
{
for (int y = 0; y < 5; y++)
{
for (int z = 0; z < 3; z++)
{
}
}
}
}
@Override
public void generateRoom(Location loc)
{
// TODO Auto-generated method stub
}
@Override
public int getBorderX()
{
return 10;
}
@Override
public int getBorderY()
{
return 20;
}
@Override
public int getBorderZ()
{
return 10;
}
@Override
public int getDividersX()
{
return 5;
}
@Override
public int getDividersZ()
{
return 5;
}
@Override
public void cleanupRoom()
{
// TODO Auto-generated method stub
}
@Override
public void setupPlayers()
{
for (Player player : getChallengers())
{
player.setGameMode(GameMode.CREATIVE);
}
}
}

View File

@ -4,17 +4,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilShapes;
import mineplex.core.common.util.UtilTextMiddle;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
@ -25,6 +14,18 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilShapes;
import mineplex.core.common.util.UtilTextMiddle;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeBuildRace extends Challenge
{
// The amount of blocks for every hotbar slot.
@ -44,8 +45,12 @@ public class ChallengeBuildRace extends Challenge
public ChallengeBuildRace(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Build Race", "Your inventory is filled with blocks.",
"Be the first to place them all in the ground!");
super(
host,
ChallengeType.FirstComplete,
"Build Race",
"Your inventory is filled with blocks.",
"Place them all in the ground!");
}
@Override

View File

@ -2,10 +2,6 @@ package nautilus.game.arcade.game.games.mineware.challenges;
import java.util.ArrayList;
import mineplex.core.common.util.UtilMath;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -18,11 +14,20 @@ import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.UtilMath;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeChestLoot extends Challenge
{
public ChallengeChestLoot(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete,"Diamond Seeker", "Find a diamond in the chests.");
super(
host,
ChallengeType.FirstComplete,
"Diamond Seeker",
"Find a diamond in the chests.");
}
@Override

View File

@ -1,125 +0,0 @@
package nautilus.game.arcade.game.games.mineware.challenges;
import java.util.ArrayList;
import java.util.Iterator;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilShapes;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
public class ChallengeChickenFishing extends Challenge
{
private ArrayList<Entity> _chickens = new ArrayList<Entity>();
private ArrayList<Location> _spawns = new ArrayList<Location>();
private ArrayList<Location> _chickenSpawns = new ArrayList<Location>();
public ChallengeChickenFishing(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete,"Chicken Fishing", "Fish all dem Chickens");
}
@Override
public ArrayList<Location> getSpawns()
{
return _spawns;
}
@EventHandler
public void onSecond(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
{
return;
}
Iterator<Entity> itel = _chickens.iterator();
while (itel.hasNext())
{
Entity ent = itel.next();
// TODO Validate chicken is caught
if (!ent.isValid())
{
itel.remove();
}
}
for (Player player : getChallengers())
{
Block block = player.getLocation().getBlock();
if (block.isLiquid())
{
setLost(player);
}
}
}
@Override
public void cleanupRoom()
{
for (Entity chicken : _chickens)
{
chicken.remove();
}
}
@Override
public void setupPlayers()
{
for (Player player : getChallengers())
{
player.getInventory().addItem(new ItemStack(Material.FISHING_ROD));
}
}
@Override
public void generateRoom()
{
int size = (getChallengers().size() / 2) + 4;
for (Location location : UtilShapes.getCircle(getCenter(), true, size))
{
Block block = location.getBlock();
for (int y = 0; y <= 7; y++)
{
Block b = block.getRelative(0, y, 0);
if (y < 3 || (y < 5 && UtilMath.random.nextBoolean()))
{
b.setType(Material.STONE);
}
else if (y != 7)
{
b.setType(Material.DIRT);
}
else
{
b.setType(Material.GRASS);
}
}
_spawns.add(location.clone().add(0.5, 7.1, 0.5));
}
for (Location location : UtilShapes.getCircle(getCenter(), false,
size - 1))
{
_chickenSpawns.add(location.add(0.5, 0.5, 0.5));
}
}
}

View File

@ -15,12 +15,18 @@ import mineplex.core.common.util.UtilShapes;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeCloudFall extends Challenge
{
public ChallengeCloudFall(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Cloud Fall", "Jump and land on the green wool.", "Make sure to avoid the clouds.", "First to the bottom wins!");
super(
host,
ChallengeType.FirstComplete,
"Cloud Fall",
"Jump and land on green wool.",
"Avoid the deadly clouds!");
}
@Override

View File

@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
@ -30,6 +29,7 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeDogsVersusCats extends Challenge
{
@ -42,8 +42,14 @@ public class ChallengeDogsVersusCats extends Challenge
public ChallengeDogsVersusCats(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Dogs VS Cats", "If you are a dog, bark.", "If you are a cat, meow.",
"Look up and punch to bark or meow.", "First team to the end number wins!");
super(
host,
ChallengeType.FirstComplete,
"Dogs Vs Cats",
"If you are a dog, bark.",
"If you are a cat, meow.",
"Look up and punch to bark or meow.",
"First team to the end number wins!");
}
@Override

View File

@ -22,6 +22,7 @@ import mineplex.core.common.util.UtilServer;
import mineplex.core.itemstack.ItemBuilder;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeDragonEgg extends Challenge
{
@ -30,7 +31,11 @@ public class ChallengeDragonEgg extends Challenge
public ChallengeDragonEgg(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Dragon egg", "Whack a dragon egg 10 times.");
super(
host,
ChallengeType.FirstComplete,
"Dragon egg",
"Whack a dragon egg 10 times.");
}
@Override

View File

@ -3,17 +3,6 @@ package nautilus.game.arcade.game.games.mineware.challenges;
import java.util.ArrayList;
import java.util.HashSet;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilShapes;
import mineplex.core.common.util.UtilTextBottom;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
@ -28,6 +17,18 @@ import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.scheduler.BukkitRunnable;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilShapes;
import mineplex.core.common.util.UtilTextBottom;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeFallingBlocks extends Challenge
{
// The chance of an anvil to spawn in a single block.
@ -55,21 +56,36 @@ public class ChallengeFallingBlocks extends Challenge
private HashSet<Block> _remaining = new HashSet<Block>();
// The array of materials used to generate random falling blocks.
private Material[] _materials =
{ Material.GRASS, Material.DIRT, Material.STONE, Material.LOG, Material.WOOD, Material.COBBLESTONE, Material.GRAVEL, Material.COAL_ORE,
Material.IRON_ORE, Material.HAY_BLOCK, Material.JUKEBOX, Material.SMOOTH_BRICK, Material.EMERALD_ORE, Material.FURNACE };
private Material[] _materials = {
Material.GRASS,
Material.DIRT,
Material.STONE,
Material.LOG,
Material.WOOD,
Material.COBBLESTONE,
Material.GRAVEL,
Material.COAL_ORE,
Material.IRON_ORE,
Material.HAY_BLOCK,
Material.JUKEBOX,
Material.SMOOTH_BRICK,
Material.EMERALD_ORE,
Material.FURNACE };
// The array of materials used to generate random floor.
private Material[] _floor =
{ Material.GRASS, Material.DIRT, Material.STONE, Material.COBBLESTONE };
private Material[] _floor = { Material.GRASS, Material.DIRT, Material.STONE, Material.COBBLESTONE };
// The array of sounds used to play when a new wave is being deployed.
private Sound[] _sounds =
{ Sound.DIG_GRASS, Sound.DIG_GRAVEL, Sound.DIG_SAND, Sound.DIG_SNOW, Sound.DIG_STONE, Sound.DIG_WOOD, Sound.DIG_WOOL };
private Sound[] _sounds = { Sound.DIG_GRASS, Sound.DIG_GRAVEL, Sound.DIG_SAND, Sound.DIG_SNOW, Sound.DIG_STONE, Sound.DIG_WOOD, Sound.DIG_WOOL };
public ChallengeFallingBlocks(BawkBawkBattles host)
{
super(host, ChallengeType.LastStanding, "Falling Blocks", "Blocks are falling from the sky!", "Try to avoid getting hit.");
super(
host,
ChallengeType.LastStanding,
"Falling Blocks",
"Blocks are falling from the sky!",
"Try to avoid getting hit.");
_time = (int) _nextWave;
_modifiedSpawnChance = _spawnChance;

View File

@ -2,20 +2,6 @@ package nautilus.game.arcade.game.games.mineware.challenges;
import java.util.ArrayList;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilShapes;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
@ -30,21 +16,51 @@ import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilShapes;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeFastFood extends Challenge
{
private Material[] _food =
{ Material.APPLE, Material.BREAD, Material.GRILLED_PORK, Material.COOKED_BEEF, Material.RAW_FISH, Material.COOKED_FISH, Material.CAKE,
Material.COOKIE, Material.MELON, Material.COOKED_CHICKEN, Material.CARROT_ITEM, Material.BAKED_POTATO, Material.PUMPKIN_PIE };
private Material[] _food = {
Material.APPLE,
Material.BREAD,
Material.GRILLED_PORK,
Material.COOKED_BEEF,
Material.RAW_FISH,
Material.COOKED_FISH,
Material.CAKE,
Material.COOKIE,
Material.MELON,
Material.COOKED_CHICKEN,
Material.CARROT_ITEM,
Material.BAKED_POTATO,
Material.PUMPKIN_PIE };
private Material[] _flowers =
{ Material.LONG_GRASS, Material.YELLOW_FLOWER, Material.RED_ROSE };
private Material[] _flowers = { Material.LONG_GRASS, Material.YELLOW_FLOWER, Material.RED_ROSE };
private int _itemSeperator = 0;
public ChallengeFastFood(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Fast Food", "Your inventory is full of food!", "Punch to throw it in the ground.",
"First player to drop them all wins.");
super(
host,
ChallengeType.FirstComplete,
"Fast Food",
"Your inventory is full of food.",
"Punch to throw it in the ground.",
"First player to drop them all wins!");
}
@Override

View File

@ -39,6 +39,7 @@ import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
@SuppressWarnings("deprecation")
public class ChallengeFishingDay extends Challenge
@ -50,7 +51,11 @@ public class ChallengeFishingDay extends Challenge
public ChallengeFishingDay(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Fishing Day", "Be the first to catch 5 fish.",
super(
host,
ChallengeType.FirstComplete,
"Fishing Day",
"Be the first to catch 5 fish.",
"Watch out for TNT if you miss the fish!");
}

View File

@ -26,6 +26,7 @@ import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeInfestation extends Challenge
{
@ -38,7 +39,12 @@ public class ChallengeInfestation extends Challenge
public ChallengeInfestation(BawkBawkBattles host)
{
super(host, ChallengeType.LastStanding, "Infestation", "Avoid the deadly zombie!", "Watch out, the infected can kill humans.");
super(
host,
ChallengeType.LastStanding,
"Infestation",
"Avoid the deadly zombie.",
"The infected can kill humans!");
}
@Override

View File

@ -5,13 +5,6 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilMath;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
@ -20,6 +13,14 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerMoveEvent;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilMath;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeKangarooJump extends Challenge
{
private long _gameTime = System.currentTimeMillis() + ((UtilMath.r(5) + 20) * 1000);
@ -29,7 +30,12 @@ public class ChallengeKangarooJump extends Challenge
public ChallengeKangarooJump(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Kangaroo Jump", "Jump from block to block.", "Player with the highest height wins!");
super(
host,
ChallengeType.FirstComplete,
"Kangaroo Jump",
"Jump from block to block.",
"Player with the highest height wins!");
}
@Override

View File

@ -23,6 +23,7 @@ import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeKingOfTheHill extends Challenge
{
@ -31,7 +32,11 @@ public class ChallengeKingOfTheHill extends Challenge
public ChallengeKingOfTheHill(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "King Of The Ladder", "Reach the top of the ladder.");
super(
host,
ChallengeType.FirstComplete,
"King Of The Ladder",
"Reach the top of the ladder.");
}
@Override

View File

@ -21,6 +21,7 @@ import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeLavaRun extends Challenge
{
@ -31,7 +32,13 @@ public class ChallengeLavaRun extends Challenge
public ChallengeLavaRun(BawkBawkBattles host)
{
super(host, ChallengeType.LastStanding, "Lava run", "The lava is coming!", "Stand on the obsidian.", "Run! Run! Run!");
super(
host,
ChallengeType.LastStanding,
"Lava Ρun",
"The lava is coming!",
"Stand on the obsidian.",
"Run! Run! Run!");
}
@Override

View File

@ -3,19 +3,6 @@ package nautilus.game.arcade.game.games.mineware.challenges;
import java.util.ArrayList;
import java.util.HashMap;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguiseVillager;
import mineplex.core.hologram.Hologram;
import mineplex.core.hologram.Hologram.HologramTarget;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
@ -32,6 +19,20 @@ import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerItemConsumeEvent;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguiseVillager;
import mineplex.core.hologram.Hologram;
import mineplex.core.hologram.Hologram.HologramTarget;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeMilkACow extends Challenge
{
private Villager _villager;
@ -41,7 +42,12 @@ public class ChallengeMilkACow extends Challenge
public ChallengeMilkACow(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Milk the cows", "Milk 5 different cows.", "Deliver the milk to the villager!");
super(
host,
ChallengeType.FirstComplete,
"Milk a Cow",
"Milk 5 different cows.",
"Deliver the milk to the villager!");
}
@Override
@ -138,29 +144,43 @@ public class ChallengeMilkACow extends Challenge
_villager.setCustomName(C.Bold + "Farmer Joe");
_villager.setCustomNameVisible(true);
String[] names = new String[]
{
"Tom", "Steve", "John", "Harry", "Andrew", "Daniel", "Bobbae", "Jim"
String[] names = new String[] {
"Tom",
"Steve",
"John",
"Harry",
"Andrew",
"Daniel",
"Bobbae",
"Jim"
};
if (UtilMath.r(5) == 0)
{
names = new String[]
{
"Moorten", "Mooington", "Mooley", "Moose", "Mooskee", "Chicken", "Mooffy", "Moozzle",
names = new String[] {
"Moorten",
"Mooington",
"Mooley",
"Moose",
"Mooskee",
"Chicken",
"Mooffy",
"Moozzle",
};
}
for (int i = 0; i < 8; i++)
{
Location loc = getCenter().clone().add(UtilMath.r(((getArenaSize()*2)-1) - (getArenaSize()-1)), 1, UtilMath.r((getArenaSize()*2)-1) - (getArenaSize()-1));
Location loc = getCenter().clone().add(UtilMath.r(((getArenaSize() * 2) - 1) - (getArenaSize() - 1)), 1,
UtilMath.r((getArenaSize() * 2) - 1) - (getArenaSize() - 1));
Cow cow = (Cow) loc.getWorld().spawnEntity(loc, EntityType.COW);
cow.setCustomName(C.cWhite + names[i]);
cow.setCustomNameVisible(true);
_milked.put(cow, new ArrayList<String>());
_cowIndicator.put(cow, new Hologram(Host.Manager.getHologramManager(), cow.getLocation().clone().add(0, 2.5, 0), C.cRed + "Already Milked!"));
_cowIndicator.put(cow,
new Hologram(Host.Manager.getHologramManager(), cow.getLocation().clone().add(0, 2.5, 0), C.cRed + "Already Milked!"));
Hologram holo = _cowIndicator.get(cow);
holo.setHologramTarget(HologramTarget.WHITELIST);

View File

@ -3,10 +3,6 @@ package nautilus.game.arcade.game.games.mineware.challenges;
import java.util.ArrayList;
import java.util.Arrays;
import mineplex.core.common.util.UtilMath;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -17,6 +13,11 @@ import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.UtilMath;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeMineADiamond extends Challenge
{
private ArrayList<Material> _ores = new ArrayList<Material>(Arrays.asList(Material.IRON_ORE, Material.GOLD_ORE,
@ -25,8 +26,11 @@ public class ChallengeMineADiamond extends Challenge
public ChallengeMineADiamond(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Mine a Diamond", "Find a diamond around the map.",
"Be the first to mine one!");
super(
host,
ChallengeType.FirstComplete,
"Mine a Diamond",
"Find a diamond around the map.");
}
@Override
@ -107,7 +111,8 @@ public class ChallengeMineADiamond extends Challenge
UtilMath.r(getArenaSize() * 2) - (getArenaSize()), 1,
UtilMath.r(getArenaSize() * 2) - (getArenaSize()));
if (copy.getType() == Material.DIAMOND_ORE && Math.abs(copy.getX()) < getArenaSize() && Math.abs(copy.getY()) < getArenaSize())
if (copy.getType() == Material.DIAMOND_ORE && Math.abs(copy.getX()) < getArenaSize()
&& Math.abs(copy.getY()) < getArenaSize())
{
i--;
continue;

View File

@ -27,14 +27,14 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
import net.minecraft.server.v1_8_R3.BlockPosition;
import net.minecraft.server.v1_8_R3.PacketPlayOutWorldEvent;
public class ChallengeMinecartDance extends Challenge
{
/*
* _state if 1 = waiting if 2 = stateSwitch if 3 = cartsSpawned and player
* battle
* _state if 1 = waiting if 2 = stateSwitch if 3 = cartsSpawned and player battle
*/
private boolean _isPlayingMusic = false;
private int _availableMinecarts;
@ -44,7 +44,11 @@ public class ChallengeMinecartDance extends Challenge
public ChallengeMinecartDance(BawkBawkBattles host)
{
super(host, ChallengeType.LastStanding, "Musical Minecart", "Get ready when the fireworks change color.",
super(
host,
ChallengeType.LastStanding,
"Musical Minecart",
"Get ready when the fireworks change color.",
"Once they're green, get inside a minecart!");
}
@ -202,7 +206,8 @@ public class ChallengeMinecartDance extends Challenge
{
((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutWorldEvent(1005,
new BlockPosition(getCenter().getBlockX(), getCenter().getBlockY() + 5, getCenter()
.getBlockZ()), 2259, false));
.getBlockZ()),
2259, false));
}
}
if (_timeSinceLastState + 5500 < System.currentTimeMillis())
@ -244,7 +249,8 @@ public class ChallengeMinecartDance extends Challenge
{
((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutWorldEvent(1005,
new BlockPosition(getCenter().getBlockX(), getCenter().getBlockY() + 5, getCenter()
.getBlockZ()), 0, false));
.getBlockZ()),
0, false));
}
}
@ -252,7 +258,8 @@ public class ChallengeMinecartDance extends Challenge
{
Minecart minecart = Host.WorldData.World.spawn(
new Location(Host.WorldData.World, UtilMath.r(getArenaSize(7) * 2) - (getArenaSize(7)), 2,
UtilMath.r(getArenaSize(7) * 2) - (getArenaSize(7))), Minecart.class);
UtilMath.r(getArenaSize(7) * 2) - (getArenaSize(7))),
Minecart.class);
UtilEnt.ghost(minecart, true, false);
_minecarts.add(minecart);
}

View File

@ -22,13 +22,21 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeMiniOneInTheQuiver extends Challenge
{
public ChallengeMiniOneInTheQuiver(BawkBawkBattles host)
{
super(host, ChallengeType.LastStanding, "Mini OITQ", false, true, "Avoid getting hit by arrows.", "You receive an arrow every 4 seconds.",
"Last man standing wins!");
super(
host,
ChallengeType.LastStanding,
"Mini OITQ",
false,
true,
"Shoot arrows to instant kill others.",
"Avoid getting hit by them.",
"Arrow supply every 4 seconds.");
}
@Override

View File

@ -3,10 +3,6 @@ package nautilus.game.arcade.game.games.mineware.challenges;
import java.util.ArrayList;
import java.util.HashMap;
import mineplex.core.common.util.UtilPlayer;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -15,13 +11,22 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerMoveEvent;
import mineplex.core.common.util.UtilPlayer;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeNavigateMaze extends Challenge
{
private HashMap<Player, Long> _playerCompletionTime = new HashMap<Player, Long>();
public ChallengeNavigateMaze(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Nagivation Maze", "Go to the other side of the maze.");
super(
host,
ChallengeType.FirstComplete,
"Nagivation Maze",
"Go to the other side of the maze.");
}
@Override
@ -154,9 +159,11 @@ public class ChallengeNavigateMaze extends Challenge
{
Block block = nextLoop.remove(0);
for (BlockFace face : new BlockFace[]
{
BlockFace.EAST, BlockFace.WEST, BlockFace.SOUTH, BlockFace.NORTH
for (BlockFace face : new BlockFace[] {
BlockFace.EAST,
BlockFace.WEST,
BlockFace.SOUTH,
BlockFace.NORTH
})
{
Block b = block.getRelative(face);

View File

@ -3,6 +3,13 @@ package nautilus.game.arcade.game.games.mineware.challenges;
import java.util.ArrayList;
import java.util.HashSet;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
@ -11,13 +18,7 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengePickASide extends Challenge
{
@ -28,8 +29,12 @@ public class ChallengePickASide extends Challenge
public ChallengePickASide(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Pick a Side", "The side with the fewest players wins!",
"No... Standing in the middle won't work");
super(
host,
ChallengeType.FirstComplete,
"Pick a Side",
"The side with the smallest amount of players wins.",
"Standing in the middle does not work.");
}
public int getMinPlayers()

View File

@ -4,14 +4,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilMath;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -21,6 +13,15 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDeathEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilMath;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengePunchThePig extends Challenge
{
private int _amountOfKills = 5;
@ -30,7 +31,11 @@ public class ChallengePunchThePig extends Challenge
public ChallengePunchThePig(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Punch the Pig", "Kill 5 pigs!");
super(
host,
ChallengeType.FirstComplete,
"Punch the Pig",
"Kill 5 pigs.");
}
@Override

View File

@ -31,6 +31,7 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
import net.md_5.bungee.api.ChatColor;
public class ChallengeRedLightGreenLight extends Challenge
@ -48,7 +49,13 @@ public class ChallengeRedLightGreenLight extends Challenge
public ChallengeRedLightGreenLight(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Red Light, Green Light", false, false, "Be the first to reach the end.", "Don't move while the fireworks are red!");
super(
host,
ChallengeType.FirstComplete,
"Red Light, Green Light",
"Be the first to reach the end.",
"You can move when the fireworks are green.",
"Stay still when the fireworks turn red.");
}
@Override
@ -164,7 +171,9 @@ public class ChallengeRedLightGreenLight extends Challenge
{
return;
}
UtilAction.velocity(event.getPlayer(), UtilAlg.getTrajectory2d(event.getPlayer().getLocation(), new Location(getCenter().getWorld(), -32, 5, 0)), 1.5, true, 0.4, 0, 10, true);
UtilAction.velocity(event.getPlayer(),
UtilAlg.getTrajectory2d(event.getPlayer().getLocation(), new Location(getCenter().getWorld(), -32, 5, 0)), 1.5, true, 0.4, 0, 10,
true);
_cooldownedPlayers.add(event.getPlayer().getName());
new BukkitRunnable()

View File

@ -28,6 +28,7 @@ import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeReverseTag extends Challenge
{
@ -38,9 +39,14 @@ public class ChallengeReverseTag extends Challenge
private HashSet<String> _cooldowned = new HashSet<String>();
private HashSet<Player> _nonTaggedPlayers = new HashSet<Player>();
public ChallengeReverseTag(BawkBawkBattles Host)
public ChallengeReverseTag(BawkBawkBattles host)
{
super(Host, ChallengeType.FirstComplete, "Reverse Tag", "Be a sparkling person until the end.", "Punch the sparking people to become one!");
super(
host,
ChallengeType.FirstComplete,
"Reverse Tag",
"Punch a sparkling person to become one.",
"Stay sparkling until the end.");
}
@Override
@ -246,7 +252,6 @@ public class ChallengeReverseTag extends Challenge
}
}.runTaskLater(Host.Manager.getPlugin(), 20 * _cooldown);
for (int i = 0; i <= 8; i++)
{
player.getInventory().setItem(i, ItemStackFactory.Instance.CreateStack(35, (byte) 5));

View File

@ -20,6 +20,7 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeRunner extends Challenge
{
@ -27,8 +28,12 @@ public class ChallengeRunner extends Challenge
public ChallengeRunner(BawkBawkBattles host)
{
super(host, ChallengeType.LastStanding, "Runner",
"Blocks are disappearing beneath you! Run away!");
super(
host,
ChallengeType.LastStanding,
"Runner",
"Blocks below your feet are falling.",
"Run as fast as you can!");
}
@Override

View File

@ -19,15 +19,21 @@ import mineplex.core.common.util.UtilTextMiddle;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeRushPush extends Challenge
{
private boolean _challengeEnded = false;
private HashMap<String, String> _teams = new HashMap<String, String>();
public ChallengeRushPush(BawkBawkBattles host)
{
super(host, ChallengeType.LastStanding, "Rush push", true, true, "Rush to your enemy.",
super(
host,
ChallengeType.LastStanding,
"Rush push",
true,
true,
"Rush to your enemy.",
"Push them off the platform.");
}

View File

@ -4,16 +4,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilMath;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -29,6 +19,17 @@ import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.ProjectileLaunchEvent;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilMath;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeShootChickens extends Challenge
{
private ArrayList<Chicken> _chickens = new ArrayList<Chicken>();
@ -39,7 +40,12 @@ public class ChallengeShootChickens extends Challenge
public ChallengeShootChickens(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Chicken Shooting", "Shoot 6 chickens!");
super(
host,
ChallengeType.FirstComplete,
"Chicken Shooting",
"Shoot 6 chickens.",
"When a chicken lands, it dissapears.");
}
@Override
@ -164,7 +170,8 @@ public class ChallengeShootChickens extends Challenge
if (_chickens.size() < 11 + (getChallengers().size() * 2))
{
Location loc = getCenter().clone().add(UtilMath.r(getArenaSize()*2) - (getArenaSize()), 15, UtilMath.r(getArenaSize()*2) - (getArenaSize()));
Location loc = getCenter().clone().add(UtilMath.r(getArenaSize() * 2) - (getArenaSize()), 15,
UtilMath.r(getArenaSize() * 2) - (getArenaSize()));
Host.CreatureAllowOverride = true;
Chicken chicken = (Chicken) loc.getWorld().spawnEntity(loc, EntityType.CHICKEN);
@ -183,7 +190,8 @@ public class ChallengeShootChickens extends Challenge
for (Player player : Host.GetPlayers(true))
{
player.getInventory().setItem(0,new ItemBuilder(Material.BOW).addEnchantment(Enchantment.ARROW_INFINITE, 1).setUnbreakable(true).build());
player.getInventory().setItem(0,
new ItemBuilder(Material.BOW).addEnchantment(Enchantment.ARROW_INFINITE, 1).setUnbreakable(true).build());
player.getInventory().setItem(9, new ItemStack(Material.ARROW));
_killedChickens.put(player.getName(), 0);

View File

@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
import mineplex.core.common.util.UtilMath;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeSmashOff extends Challenge
{
@ -17,7 +18,13 @@ public class ChallengeSmashOff extends Challenge
public ChallengeSmashOff(BawkBawkBattles host)
{
super(host, ChallengeType.LastStanding, "Smash off", false, true, "Knock other players off the platform!");
super(
host,
ChallengeType.LastStanding,
"Smash Off",
false,
true,
"Knock all others off the platform.");
}
@Override

View File

@ -14,12 +14,16 @@ import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeSpleef extends Challenge
{
public ChallengeSpleef(BawkBawkBattles host)
{
super(host, ChallengeType.LastStanding, "Spleef",
super(
host,
ChallengeType.LastStanding,
"Spleef",
"Destroy the blocks beneath other players!");
}

View File

@ -5,6 +5,14 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map.Entry;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilServer;
@ -13,14 +21,7 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.inventory.ItemStack;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeStandOnColor extends Challenge
{
@ -33,7 +34,11 @@ public class ChallengeStandOnColor extends Challenge
public ChallengeStandOnColor(BawkBawkBattles host)
{
super(host, ChallengeType.LastStanding, "Color Change", "Stand on the correct color.");
super(
host,
ChallengeType.LastStanding,
"Color Change",
"Stand on the correct color.");
for (int i = 0; i <= 15; i++)
{

View File

@ -26,6 +26,7 @@ import mineplex.core.recharge.Recharge;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeTntLauncher extends Challenge
{
@ -34,7 +35,14 @@ public class ChallengeTntLauncher extends Challenge
public ChallengeTntLauncher(BawkBawkBattles host)
{
super(host, ChallengeType.LastStanding, "Deadly TNT", false, true, "Throw TNT to other players.", "Don't get knocked off!");
super(
host,
ChallengeType.LastStanding,
"Deadly TNT",
false,
true,
"Throw TNT to other players.",
"Do not get knocked off.");
}
@Override

View File

@ -3,13 +3,6 @@ package nautilus.game.arcade.game.games.mineware.challenges;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilShapes;
import mineplex.core.common.util.UtilTextMiddle;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
@ -27,6 +20,14 @@ import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilShapes;
import mineplex.core.common.util.UtilTextMiddle;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeTreasureDigger extends Challenge
{
private LinkedHashMap<Material, Double> _lootChance = new LinkedHashMap<Material, Double>();
@ -34,8 +35,12 @@ public class ChallengeTreasureDigger extends Challenge
public ChallengeTreasureDigger(BawkBawkBattles host)
{
super(host, ChallengeType.LastStanding, "Treasure Digger", "Search for treasure below the sand.", "Find weapons to kill the others!",
"Be the last person to stay alive.");
super(
host,
ChallengeType.LastStanding,
"Treasure Digger",
"Search for treasure below the sand.",
"Find weapons to kill the others!");
_lootChance.put(Material.BONE, 20.0);
_lootChance.put(Material.STRING, 20.0);

View File

@ -38,6 +38,7 @@ import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeVolleyPig extends Challenge
{
@ -51,7 +52,11 @@ public class ChallengeVolleyPig extends Challenge
public ChallengeVolleyPig(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Volley Pig", "Punch the pig on the enemy side.", "Do not cross the middle!");
super(
host,
ChallengeType.FirstComplete,
"Volley Pig",
"Punch the pig on the enemy side.");
}
@Override

View File

@ -30,6 +30,7 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeWaterHorror extends Challenge
{
@ -43,7 +44,11 @@ public class ChallengeWaterHorror extends Challenge
public ChallengeWaterHorror(BawkBawkBattles host)
{
super(host, ChallengeType.LastStanding, "Water Horror", "Deadly TNT is spawning from the water!",
super(
host,
ChallengeType.LastStanding,
"Water Horror",
"TNT is spawning from the water!",
"Use your boat to dodge explosions.");
}

View File

@ -20,6 +20,7 @@ import mineplex.core.common.util.UtilMath;
import mineplex.core.projectile.ProjectileUser;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
import nautilus.game.arcade.game.games.mineware.events.ChallengeEndEvent;
public class ChallengeWaveCrush extends Challenge
@ -33,7 +34,11 @@ public class ChallengeWaveCrush extends Challenge
public ChallengeWaveCrush(BawkBawkBattles host)
{
super(host, ChallengeType.LastStanding, "Wave Crush", "Avoid the crushing waves!");
super(
host,
ChallengeType.LastStanding,
"Wave Crush",
"Avoid the crushing waves.");
}
@Override

View File

@ -3,19 +3,6 @@ package nautilus.game.arcade.game.games.mineware.challenges.removed;
import java.util.ArrayList;
import java.util.HashMap;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilShapes;
import mineplex.core.itemstack.ItemBuilder;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import org.bukkit.FireworkEffect.Type;
import org.bukkit.Location;
import org.bukkit.Material;
@ -32,6 +19,20 @@ import org.bukkit.material.Wool;
import org.bukkit.projectiles.ProjectileSource;
import org.bukkit.scheduler.BukkitRunnable;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilShapes;
import mineplex.core.itemstack.ItemBuilder;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeBlockShot extends Challenge
{
private HashMap<String, Integer> _shotBlocks = new HashMap<String, Integer>();
@ -40,7 +41,11 @@ public class ChallengeBlockShot extends Challenge
public ChallengeBlockShot(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Block Shot", "Shoot down 5 blocks");
super(
host,
ChallengeType.FirstComplete,
"Block Shot",
"Shoot down 5 blocks");
}
@Override

View File

@ -18,12 +18,17 @@ import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeDiamondFall extends Challenge
{
public ChallengeDiamondFall(BawkBawkBattles host)
{
super(host, ChallengeType.LastStanding, "Diamond Fall", "Loot the most diamonds from chests!");
super(
host,
ChallengeType.LastStanding,
"Diamond Fall",
"Loot the most diamonds from chests!");
}
@Override

View File

@ -16,6 +16,7 @@ import mineplex.core.common.util.UtilPlayer;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeHitTargets extends Challenge
{
@ -24,7 +25,11 @@ public class ChallengeHitTargets extends Challenge
public ChallengeHitTargets(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Hit target", "Hit the chosen players");
super(
host,
ChallengeType.FirstComplete,
"Hit target",
"Hit the chosen players.");
}
@EventHandler

View File

@ -27,6 +27,7 @@ import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.ChallengeSeperateRooms;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeNameThatSound extends ChallengeSeperateRooms
{
@ -38,7 +39,10 @@ public class ChallengeNameThatSound extends ChallengeSeperateRooms
public ChallengeNameThatSound(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Hit the creature that makes the noises");
super(
host,
ChallengeType.FirstComplete,
"Hit the creature that makes the noises.");
_sounds.put(EntityType.ZOMBIE, new Sound[] {
Sound.ZOMBIE_DEATH,

View File

@ -5,17 +5,6 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Random;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.events.ChallengeEndEvent;
import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.FireworkEffect;
@ -37,6 +26,18 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scheduler.BukkitTask;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
import nautilus.game.arcade.game.games.mineware.events.ChallengeEndEvent;
public class ChallengeSimonSays extends Challenge
{
private boolean _truthful = true;
@ -56,8 +57,13 @@ public class ChallengeSimonSays extends Challenge
public ChallengeSimonSays(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Simon Says", "Do everything Simon says", "Don't listen to anyone else!",
"first with 3 correct wins!");
super(
host,
ChallengeType.FirstComplete,
"Simon Says",
"Do everything that Simon says.",
"Don't listen to anyone else!",
"First with 3 correct answers wins.");
}
private enum simonTypes

View File

@ -8,19 +8,24 @@ import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.UtilMath;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeSkyFall extends Challenge
{
public ChallengeSkyFall(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Skyfall", "Land on the bottom pad, knock players around with snowballs!");
super(
host,
ChallengeType.FirstComplete,
"Skyfall",
"Land on the bottom pad, knock players around with snowballs!");
}
@Override

View File

@ -20,6 +20,7 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilMath;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.mineware.Challenge;
import nautilus.game.arcade.game.games.mineware.ChallengeType;
public class ChallengeTameTheWolf extends Challenge
{
@ -31,7 +32,11 @@ public class ChallengeTameTheWolf extends Challenge
public ChallengeTameTheWolf(BawkBawkBattles host)
{
super(host, ChallengeType.FirstComplete, "Tame The Wolf", "Find the right item", "To tame the wolf!");
super(
host,
ChallengeType.FirstComplete,
"Tame The Wolf",
"Find the correct item to tame the wolf.");
}
@Override

View File

@ -11,11 +11,16 @@ import org.bukkit.block.BlockFace;
import org.bukkit.entity.Chicken;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.scheduler.BukkitRunnable;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.disguise.disguises.DisguiseChicken;
@ -78,32 +83,46 @@ public class ChickenAttack
player.teleport(_center);
UtilTextMiddle.display(C.cRed + "Chicken Attack", "You ran out of lives!", 5, 40, 5, player);
UtilTextMiddle.display(C.cRed + "Chicken Attack!", "You ran out of lives.", 5, 40, 5, player);
player.playSound(player.getLocation(), Sound.WITHER_SPAWN, 1.0F, 1.0F);
debugDeathTask(player);
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, Integer.MAX_VALUE, 1));
ensurePlayerKill(player);
System.out.println("Chicken attack triggered for " + player.getName() + ".");
}
private void debugDeathTask(Player player)
private void ensurePlayerKill(Player player)
{
new BukkitRunnable()
{
@Override
public void run()
{
if (_host.IsLive())
if (_host.IsLive() && _host.getChickenTeam().HasPlayer(player) && _host.IsAlive(player))
{
UtilPlayer.message(player, C.cWhite + C.Bold + "You have been moved to spectators.");
kill(player);
}
else
{
cancel();
}
}.runTaskLater(_plugin, 100L);
}
}.runTaskLater(_plugin, 400L);
}
private void kill(Player player)
public void kill(Player player)
{
System.out.println("Killed: " + player.getName());
_host.Manager.Clear(player);
new BukkitRunnable()
{
@Override
public void run()
{
_host.SetPlayerState(player, PlayerState.OUT);
DisguiseChicken disguise = new DisguiseChicken(player);
@ -117,6 +136,8 @@ public class ChickenAttack
player.playSound(player.getLocation(), Sound.BAT_TAKEOFF, 1.0F, 1.0F);
}
}.runTaskLater(_plugin, 1L);
}
private void spawnChickens()
{
@ -139,7 +160,10 @@ public class ChickenAttack
{
_chickens.add(chicken);
// TODO: Make chickens attack player.
UtilEnt.addLookAtPlayerAI(chicken, 2.0F);
if (UtilMath.random.nextDouble() * 100 < 10.0)
chicken.setBaby();
}
public boolean isGroupMember(Chicken chicken)
@ -157,6 +181,11 @@ public class ChickenAttack
_chickens.clear();
}
public ArrayList<Chicken> getChickens()
{
return _chickens;
}
public Location getPlatformCenter()
{
return _center;