Merge branch 'thanos-mineware' into develop
This commit is contained in:
commit
a7b30f4f59
@ -769,11 +769,11 @@ public enum Achievement
|
||||
new int[] {3},
|
||||
AchievementCategory.BAWK_BAWK_BATTLES),
|
||||
|
||||
// BAWK_BAWK_BATTLES_BOUNCING_SHADOW("Bouncing Shadow", 500,
|
||||
// new String[]{"Bawk Bawk Battles.BouncingShadow"},
|
||||
// new String[]{C.cGray + "Bouncing Block Challenge", "Win 3 entire rounds", "without stepping on red wool"},
|
||||
// new int[] {3},
|
||||
// AchievementCategory.BAWK_BAWK_BATTLES),
|
||||
BAWK_BAWK_BATTLES_BOUNCING_SHADOW("Bouncing Shadow", 500,
|
||||
new String[]{"Bawk Bawk Battles.BouncingShadow"},
|
||||
new String[]{C.cGray + "Bouncing Block Challenge", "Win 3 entire rounds", "without stepping on red wool"},
|
||||
new int[] {3},
|
||||
AchievementCategory.BAWK_BAWK_BATTLES),
|
||||
|
||||
//Bomb Lobbers
|
||||
BOMB_LOBBERS_WINS("Master Bomber", 1200,
|
||||
|
@ -32,7 +32,7 @@ public enum GameDisplay
|
||||
Micro("Micro Battle", Material.LAVA_BUCKET, (byte)0, GameCategory.ARCADE, 24),
|
||||
MilkCow("Milk the Cow", Material.MILK_BUCKET, (byte)0, GameCategory.ARCADE, 27),
|
||||
MineStrike("MineStrike", Material.TNT, (byte)0, GameCategory.CHAMPIONS, 25),// Temp set to CHAMPIONS to fix UI bug
|
||||
BawkBawkBattles("Bawk Bawk Battles", Material.EGG, (byte)0, GameCategory.EXTRA, 26),
|
||||
BawkBawkBattles("Bawk Bawk Battles", Material.EGG, (byte)0, GameCategory.CLASSICS, 26),
|
||||
OldMineWare("Old MineWare", Material.PAPER, (byte)0, GameCategory.EXTRA, 26),
|
||||
Paintball("Super Paintball", Material.ENDER_PEARL, (byte)0, GameCategory.ARCADE, 28),
|
||||
Quiver("One in the Quiver", Material.ARROW, (byte)0, GameCategory.ARCADE, 29),
|
||||
|
@ -924,6 +924,11 @@ public class ServerManager extends MiniDbClientPlugin<SimpleClanToken> implement
|
||||
return _serverNpcShopMap.get("Weekend Brawl");
|
||||
}
|
||||
|
||||
public ShopBase<ServerManager> getBawkShop()
|
||||
{
|
||||
return _serverNpcShopMap.get("Bawk Bawk Battles");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getQuery(int accountId, String uuid, String name)
|
||||
{
|
||||
|
@ -41,25 +41,32 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
@Override
|
||||
protected void buildPage()
|
||||
{
|
||||
add(2, Material.QUARTZ_BLOCK, C.cYellowB + "Speed Builders " + C.cGray + "Competitive Building", new String[]
|
||||
add(1, Material.EGG, C.cYellowB + "Bawk Bawk Battles " + C.cGray + "Challenges", new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "NEW GAME",
|
||||
C.Reset + "",
|
||||
C.Reset + "Follow Bawk Bawk's instructions",
|
||||
C.Reset + "Complete different tasks",
|
||||
C.Reset + "If you lose, chickens will devour you!"
|
||||
}, "BBB", "Bawk_Bawk_Battles", new SelectBawkButton(this));
|
||||
|
||||
add(3, Material.QUARTZ_BLOCK, C.cYellowB + "Speed Builders " + C.cGray + "Competitive Building", new String[]
|
||||
{
|
||||
C.Reset + "",
|
||||
C.Reset + "Memorize Gwen the Guardian's builds",
|
||||
C.Reset + "Then recreate them in a short amount of time.",
|
||||
C.Reset + "The least correct builder is eliminated.",
|
||||
}, "SB", "Speed_Builders", new SelectSBButton(this));
|
||||
|
||||
add(4, Material.BOOK_AND_QUILL, C.cYellowB + "Draw My Thing " + C.cGray + "Pictionary", new String[]
|
||||
add(5, Material.BOOK_AND_QUILL, C.cYellowB + "Draw My Thing " + C.cGray + "Pictionary", new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "NEW UPDATE",
|
||||
C.Reset + "",
|
||||
C.Reset + "Players take turns at drawing a random",
|
||||
C.Reset + "word. Whoever guesses it within the time",
|
||||
C.Reset + "limit gets some points!",
|
||||
}, "DMT", "Draw_My_Thing", new SelectDMTButton(this));
|
||||
|
||||
add(6, Material.TNT, C.cYellowB + "Dragon Escape " + C.cGray + "Fast Paced Parkour", new String[]
|
||||
add(7, Material.TNT, C.cYellowB + "Dragon Escape " + C.cGray + "Fast Paced Parkour", new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "FEATURED ARCADE GAME",
|
||||
C.Reset + "",
|
||||
@ -192,7 +199,6 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
|
||||
add(41, Material.BREWING_STAND_ITEM, C.cYellowB + "Monster Maze " + C.cGray + "Snow Sprint", new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "BETA GAME",
|
||||
C.Reset + "",
|
||||
C.Reset + "Run along a maze avoiding",
|
||||
C.Reset + "evil monsters. Get to the",
|
||||
@ -570,6 +576,11 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
{
|
||||
getPlugin().getValentinesShop().attemptShopOpen(player);
|
||||
}
|
||||
|
||||
public void openBawk(Player player)
|
||||
{
|
||||
getPlugin().getBawkShop().attemptShopOpen(player);
|
||||
}
|
||||
|
||||
/*
|
||||
ADDITIONAL LORES;
|
||||
|
@ -0,0 +1,23 @@
|
||||
package mineplex.hub.server.ui.button;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import mineplex.hub.server.ui.ServerGameMenu;
|
||||
|
||||
public class SelectBawkButton implements IButton
|
||||
{
|
||||
private ServerGameMenu _menu;
|
||||
|
||||
public SelectBawkButton(ServerGameMenu menu)
|
||||
{
|
||||
_menu = menu;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
_menu.openBawk(player);
|
||||
}
|
||||
}
|
@ -1344,4 +1344,4 @@ public class Minestrike extends TeamGame
|
||||
{
|
||||
return _gunModule;
|
||||
}
|
||||
}
|
||||
}
|
@ -29,6 +29,7 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.player.PlayerArmorStandManipulateEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
@ -41,6 +42,7 @@ import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
@ -78,12 +80,14 @@ import nautilus.game.arcade.game.games.mineware.challenge.ChallengeSettings;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeAnvilDance;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeArrowRampage;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeBlockLobbers;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeBouncingBlock;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeBuildRace;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeChickenShooting;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeColorChange;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeDeadlyTnt;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeDiamondHunt;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeDogsVersusCats;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeEggSmash;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeEmpty;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeFallingBlocks;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeFastFood;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeKangarooJump;
|
||||
@ -100,7 +104,6 @@ import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeReverseT
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeRushPush;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeSmashOff;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeTreasureDigger;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeVolleyPig;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeWaterHorror;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeWaveCrush;
|
||||
import nautilus.game.arcade.game.games.mineware.effect.ChickenAttack;
|
||||
@ -108,6 +111,7 @@ import nautilus.game.arcade.game.games.mineware.effect.DeathEffect;
|
||||
import nautilus.game.arcade.game.games.mineware.effect.DeathEffectData;
|
||||
import nautilus.game.arcade.game.games.mineware.events.ChallengeEndEvent;
|
||||
import nautilus.game.arcade.game.games.mineware.kit.KitBawksFood;
|
||||
import nautilus.game.arcade.game.games.mineware.tracker.BouncingShadowTracker;
|
||||
import nautilus.game.arcade.game.games.mineware.tracker.DragonKingTracker;
|
||||
import nautilus.game.arcade.game.games.mineware.tracker.EliteArcherTracker;
|
||||
import nautilus.game.arcade.game.games.mineware.tracker.MilkManTracker;
|
||||
@ -254,6 +258,7 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
populateChallenges();
|
||||
|
||||
registerStatTrackers(
|
||||
new BouncingShadowTracker(this),
|
||||
new DragonKingTracker(this),
|
||||
new EliteArcherTracker(this),
|
||||
new MilkManTracker(this),
|
||||
@ -271,11 +276,12 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
new ChallengeAnvilDance(this),
|
||||
new ChallengeArrowRampage(this),
|
||||
new ChallengeBlockLobbers(this),
|
||||
new ChallengeBouncingBlock(this),
|
||||
new ChallengeBuildRace(this),
|
||||
new ChallengeColorChange(this),
|
||||
new ChallengeChickenShooting(this),
|
||||
new ChallengeDeadlyTnt(this),
|
||||
new ChallengeDiamondHunt(this),
|
||||
new ChallengeDogsVersusCats(this),
|
||||
new ChallengeEggSmash(this),
|
||||
new ChallengeFallingBlocks(this),
|
||||
new ChallengeFastFood(this),
|
||||
@ -294,8 +300,18 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
new ChallengeRushPush(this),
|
||||
new ChallengeSmashOff(this),
|
||||
new ChallengeTreasureDigger(this),
|
||||
new ChallengeVolleyPig(this),
|
||||
new ChallengeWaveCrush(this));
|
||||
|
||||
/*
|
||||
* Removed:
|
||||
*
|
||||
* Cloud Fall
|
||||
* Dogs Vs Cats
|
||||
* Fishing Day
|
||||
* Navigation Maze
|
||||
* Volley Pig
|
||||
* Zombie Infection
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -367,27 +383,33 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
|
||||
private Challenge selectChallenge()
|
||||
{
|
||||
int limit = _list.size();
|
||||
int attemps = 0;
|
||||
|
||||
Challenge instance = _list.random();
|
||||
|
||||
while (!isSuitable(instance))
|
||||
if (GetPlayers(false).size() > MIN_PLAYERS_BLOCK_ATTEMPT)
|
||||
{
|
||||
if (attemps < limit)
|
||||
{
|
||||
instance = _list.random();
|
||||
attemps++;
|
||||
}
|
||||
else
|
||||
{
|
||||
_list.resetPlayed();
|
||||
attemps = 0;
|
||||
}
|
||||
}
|
||||
int limit = _list.size();
|
||||
int attemps = 0;
|
||||
|
||||
System.out.println("Found matching challenge: " + instance.getName());
|
||||
return instance;
|
||||
Challenge instance = _list.random();
|
||||
|
||||
while (!isSuitable(instance))
|
||||
{
|
||||
if (attemps < limit)
|
||||
{
|
||||
instance = _list.random();
|
||||
attemps++;
|
||||
}
|
||||
else
|
||||
{
|
||||
_list.resetPlayed();
|
||||
attemps = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ChallengeEmpty(this);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isSuitable(Challenge instance)
|
||||
@ -688,7 +710,7 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
private void showDescriptionText()
|
||||
{
|
||||
List<String> messages = Lists.newArrayList(_challenge.getDescription());
|
||||
messages.add(0, C.cGray + "Bawk Bawk says...");
|
||||
messages.add(0, C.cGray + "Bawk Bawk commands...");
|
||||
|
||||
new BukkitRunnable()
|
||||
{
|
||||
@ -1475,6 +1497,74 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
return "";
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void debugCommands(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
String message = event.getMessage();
|
||||
|
||||
if (Manager.GetClients().hasRank(player, Rank.SNR_MODERATOR))
|
||||
{
|
||||
if (message.startsWith("/restrict"))
|
||||
{
|
||||
String[] pieces = message.split(" ");
|
||||
|
||||
if (pieces.length > 1)
|
||||
{
|
||||
String challenge = F.combine(pieces, 1, null, false).trim();
|
||||
|
||||
if (_list.restrict(challenge))
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", "Restricted to " + F.elem(challenge) + " challenge."));
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", "Could not find any challenge by that name."));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", "All challenge restrictions were cleared."));
|
||||
_list.unrestrict();
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
else if (message.startsWith("/skip"))
|
||||
{
|
||||
if (IsLive())
|
||||
{
|
||||
endCurrentChallenge();
|
||||
|
||||
Announce(C.cAqua + C.Bold + player.getName() + " skipped this challenge.");
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", "You cannot skip a challenge if the game is not started."));
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
else if (message.startsWith("/lose"))
|
||||
{
|
||||
if (IsLive() && _challenge != null && IsAlive(player))
|
||||
{
|
||||
setLives(player, 0);
|
||||
_challenge.getData().addLostPlayer(player);
|
||||
_deathEffect.playDeath(player, player.getLocation());
|
||||
GetScoreboard().ResetScore(player.getName());
|
||||
_chickenAttack.start(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", "You cannot lose at this time."));
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper methods
|
||||
*/
|
||||
|
@ -57,7 +57,6 @@ public class ChallengeList
|
||||
{
|
||||
if (challenge.getName().contains(name))
|
||||
{
|
||||
System.out.println("Restricted: " + challenge.getName());
|
||||
_restricted = challenge;
|
||||
return true;
|
||||
}
|
||||
|
@ -1,158 +0,0 @@
|
||||
package nautilus.game.arcade.game.games.mineware.challenge.other;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.Challenge;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.ChallengeType;
|
||||
|
||||
/**
|
||||
* Not used.
|
||||
* @deprecated
|
||||
*/
|
||||
public abstract class ChallengeSeperateRooms extends Challenge
|
||||
{
|
||||
private HashMap<String, Integer[]> _borders = new HashMap<String, Integer[]>();
|
||||
private HashMap<Location, Entry<Integer[], Location>> _spawns = new HashMap<Location, Entry<Integer[], Location>>();
|
||||
private HashMap<String, Location> _rooms = new HashMap<String, Location>();
|
||||
private double _borderX, _borderZ;
|
||||
|
||||
public ChallengeSeperateRooms(BawkBawkBattles host, ChallengeType challengeType, String challengeName)
|
||||
{
|
||||
super(host, challengeType, challengeName);
|
||||
}
|
||||
|
||||
public Location getRoom(Player player)
|
||||
{
|
||||
System.out.print("2. " + player.getName());
|
||||
return _rooms.get(player.getName()).clone();
|
||||
}
|
||||
|
||||
public void assignRooms()
|
||||
{
|
||||
for (Player player : getPlayersAlive())
|
||||
{
|
||||
for (Entry<Location, Entry<Integer[], Location>> entry : _spawns.entrySet())
|
||||
{
|
||||
if (entry.getKey().distance(player.getLocation()) < 1)
|
||||
{
|
||||
System.out.print("1. " + player.getName());
|
||||
_rooms.put(player.getName(), entry.getValue().getValue());
|
||||
_borders.put(player.getName(), entry.getValue().getKey());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public final void generateRoom()
|
||||
{
|
||||
int size = getPlayersAlive().size();
|
||||
|
||||
int x = 1;
|
||||
int z = 1;
|
||||
|
||||
while (size > x * z)
|
||||
{
|
||||
if (x > z)
|
||||
{
|
||||
z++;
|
||||
}
|
||||
else
|
||||
{
|
||||
x++;
|
||||
}
|
||||
}
|
||||
|
||||
_borderX = (x * getBorderX()) + (x * getDividersX());
|
||||
_borderZ = (z * getBorderZ()) + (z * getDividersZ());
|
||||
_borderX /= 2;
|
||||
_borderZ /= 2;
|
||||
_borderX = Math.ceil(_borderX);
|
||||
_borderZ = Math.ceil(_borderZ);
|
||||
|
||||
int players = 0;
|
||||
|
||||
for (int x1 = 0; x1 < x; x1++)
|
||||
{
|
||||
for (int z1 = 0; z1 < z; z1++)
|
||||
{
|
||||
if (++players > size)
|
||||
continue;
|
||||
|
||||
double lX = (x1 * getBorderX()) + (x1 * getDividersX());
|
||||
double lZ = (z1 * getBorderZ()) + (z1 * getDividersZ());
|
||||
lX -= _borderX;
|
||||
lZ -= _borderZ;
|
||||
|
||||
Location loc = getCenter().clone().add(lX, 0, lZ);
|
||||
|
||||
generateRoom(loc.clone());
|
||||
|
||||
_spawns.put(getSpawn(loc.clone()), new HashMap.SimpleEntry(new Integer[]
|
||||
{
|
||||
loc.getBlockX(), loc.getBlockX() + getBorderX(),
|
||||
|
||||
loc.getBlockY(), loc.getBlockY() + getBorderY(),
|
||||
|
||||
loc.getBlockZ(), loc.getBlockZ() + getBorderZ()
|
||||
}, loc.clone()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start()
|
||||
{
|
||||
super.start();
|
||||
|
||||
setBorder((int) -Math.ceil(_borderX), (int) Math.ceil(_borderX), 0, 256, (int) -Math.ceil(_borderZ),
|
||||
(int) Math.ceil(_borderZ));
|
||||
}
|
||||
|
||||
public abstract void generateRoom(Location loc);
|
||||
|
||||
public abstract int getBorderX();
|
||||
|
||||
public abstract int getBorderY();
|
||||
|
||||
public abstract int getBorderZ();
|
||||
|
||||
public abstract int getDividersX();
|
||||
|
||||
public abstract int getDividersZ();
|
||||
|
||||
public Location getSpawn(Location roomLocation)
|
||||
{
|
||||
return roomLocation.clone().add((getBorderX() + 1) / 2D, 1.1, (getBorderZ() + 1) / 2D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Location> createSpawns()
|
||||
{
|
||||
return new ArrayList<Location>(_spawns.keySet());
|
||||
}
|
||||
|
||||
public boolean isInsideMap(Player player)
|
||||
{
|
||||
Location loc = player.getLocation();
|
||||
|
||||
if (!_borders.containsKey(player.getName()) || UtilPlayer.isSpectator(player))
|
||||
{
|
||||
return super.isInsideMap(player);
|
||||
}
|
||||
|
||||
Integer[] borders = _borders.get(player.getName());
|
||||
|
||||
return !(loc.getX() >= borders[1] + 1 || loc.getX() <= borders[0] || loc.getZ() >= borders[5] + 1
|
||||
|| loc.getZ() <= borders[4] || loc.getY() >= borders[3] + 1 || loc.getY() <= borders[2]);
|
||||
}
|
||||
|
||||
}
|
@ -55,7 +55,7 @@ public class ChallengeBouncingBlock extends Challenge implements LogicTracker
|
||||
private static final float SCORE_SOUND_PITCH = 0.2F;
|
||||
private static final int SCORE_BLOCK_HEIGHT = 6;
|
||||
private static final int SCORE_BLOCK_HEIGHT_ADD = 5;
|
||||
private static final int SCORE_BLOCK_HEIGHT_MAX = SCORE_BLOCK_HEIGHT + SCORE_BLOCK_HEIGHT_ADD;
|
||||
private static final int SCORE_BLOCK_DATA_RANGE = 16;
|
||||
private static final int SCORE_BLOCK_SPAWN_SHIFT = 2;
|
||||
private static final int SCORE_BLOCK_BOUND_MULTIPLY = 2;
|
||||
private static final double SCORE_FIREWORK_LOCATION_ADD = 0.5;
|
||||
@ -177,7 +177,7 @@ public class ChallengeBouncingBlock extends Challenge implements LogicTracker
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
for (Player player : getPlayersIn(true))
|
||||
for (Player player : getPlayersIn(false))
|
||||
{
|
||||
UtilTextBottom.display(C.Bold + "Score: " + C.Reset + C.cYellow + C.Bold + _score.get(player), player);
|
||||
}
|
||||
@ -230,7 +230,7 @@ public class ChallengeBouncingBlock extends Challenge implements LogicTracker
|
||||
increment(player, 1);
|
||||
player.playSound(player.getLocation(), Sound.SUCCESSFUL_HIT, SCORE_SOUND_VOLUME, SCORE_SOUND_PITCH);
|
||||
resetBlock(block);
|
||||
spawnRandomWool();
|
||||
spawnRandomWool(true);
|
||||
}
|
||||
|
||||
private void checkCompleted(Player player)
|
||||
@ -238,7 +238,6 @@ public class ChallengeBouncingBlock extends Challenge implements LogicTracker
|
||||
if (_score.get(player) >= SCORE_GOAL)
|
||||
{
|
||||
setCompleted(player);
|
||||
UtilTextBottom.display(C.cGreen + C.Bold + "Completed!", player);
|
||||
}
|
||||
}
|
||||
|
||||
@ -279,40 +278,15 @@ public class ChallengeBouncingBlock extends Challenge implements LogicTracker
|
||||
}
|
||||
}
|
||||
|
||||
private static final double SCORE_BLOCK_SPAWN_CHANCE = 0.1;
|
||||
private static final int SCORE_BLOCK_DATA_RANGE = 16;
|
||||
|
||||
private void spawnStartingWool()
|
||||
{
|
||||
whileLoop: while (_blocks.size() <= Settings.getMaxCompletedCount() + 1)
|
||||
for (int i = 0; i < Host.getPlayersWithRemainingLives() + 1; i++)
|
||||
{
|
||||
for (int x = -getArenaSize(); x <= getArenaSize(); x++)
|
||||
{
|
||||
for (int z = -getArenaSize(); z <= getArenaSize(); z++)
|
||||
{
|
||||
for (int y = SCORE_BLOCK_HEIGHT; y <= SCORE_BLOCK_HEIGHT_MAX; y++)
|
||||
{
|
||||
Block block = getCenter().getBlock().getRelative(x, y, z);
|
||||
|
||||
if (block.isEmpty() || block.getType() == null)
|
||||
{
|
||||
if (Math.random() < SCORE_BLOCK_SPAWN_CHANCE)
|
||||
{
|
||||
spawnRandomWoolAt(x, y, z);
|
||||
|
||||
if (_blocks.size() >= Settings.getMaxCompletedCount() + 1)
|
||||
{
|
||||
break whileLoop;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
spawnRandomWool(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void spawnRandomWool()
|
||||
private void spawnRandomWool(boolean firework)
|
||||
{
|
||||
int size = getArenaSize(MAP_MIN_SIZE) - SCORE_BLOCK_SPAWN_SHIFT;
|
||||
|
||||
@ -320,11 +294,18 @@ public class ChallengeBouncingBlock extends Challenge implements LogicTracker
|
||||
int y = SCORE_BLOCK_HEIGHT + UtilMath.r(SCORE_BLOCK_HEIGHT_ADD);
|
||||
int z = UtilMath.r(size * SCORE_BLOCK_BOUND_MULTIPLY) - size;
|
||||
|
||||
spawnRandomWoolAt(x, y, z);
|
||||
while (!Host.WorldData.World.getBlockAt(x, y, z).isEmpty())
|
||||
{
|
||||
x = UtilMath.r(size * SCORE_BLOCK_BOUND_MULTIPLY) - size;
|
||||
y = SCORE_BLOCK_HEIGHT + UtilMath.r(SCORE_BLOCK_HEIGHT_ADD);
|
||||
z = UtilMath.r(size * SCORE_BLOCK_BOUND_MULTIPLY) - size;
|
||||
}
|
||||
|
||||
spawnRandomWoolAt(x, y, z, firework);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void spawnRandomWoolAt(int x, int y, int z)
|
||||
private void spawnRandomWoolAt(int x, int y, int z, boolean firework)
|
||||
{
|
||||
Block b = getCenter().getBlock().getRelative(x, y, z);
|
||||
Byte color = (byte) UtilMath.r(SCORE_BLOCK_DATA_RANGE);
|
||||
@ -335,7 +316,11 @@ public class ChallengeBouncingBlock extends Challenge implements LogicTracker
|
||||
}
|
||||
|
||||
setBlock(b, Material.WOOL, color);
|
||||
UtilFirework.playFirework(b.getLocation().add(SCORE_FIREWORK_LOCATION_ADD, SCORE_FIREWORK_LOCATION_ADD, SCORE_FIREWORK_LOCATION_ADD), Type.BALL, DyeColor.getByWoolData(b.getData()).getColor(), false, false);
|
||||
|
||||
if (firework)
|
||||
{
|
||||
UtilFirework.playFirework(b.getLocation().add(SCORE_FIREWORK_LOCATION_ADD, SCORE_FIREWORK_LOCATION_ADD, SCORE_FIREWORK_LOCATION_ADD), Type.BALL, DyeColor.getByWoolData(b.getData()).getColor(), false, false);
|
||||
}
|
||||
|
||||
_blocks.add(b);
|
||||
}
|
||||
|
@ -144,7 +144,6 @@ public class ChallengeBuildRace extends Challenge implements LogicTracker
|
||||
|
||||
if (!Data.isModifiedBlock(block.getRelative(BlockFace.DOWN)))
|
||||
{
|
||||
System.out.println("Cancel");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
@ -357,7 +357,7 @@ public class ChallengeChickenShooting extends Challenge implements NumberTracker
|
||||
|
||||
chicken.setMaxHealth(CHICKEN_HEATH);
|
||||
chicken.setHealth(CHICKEN_HEATH);
|
||||
|
||||
|
||||
if (Math.random() < CHICKEN_BABY_SPAWN_CHANCE)
|
||||
{
|
||||
chicken.setBaby();
|
||||
|
@ -19,6 +19,8 @@ import nautilus.game.arcade.game.games.mineware.challenge.ChallengeType;
|
||||
|
||||
/**
|
||||
* A challenge based on dropping from a platform in the correct block.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public class ChallengeCloudFall extends Challenge
|
||||
{
|
||||
@ -84,7 +86,6 @@ public class ChallengeCloudFall extends Challenge
|
||||
Host.DamageFall = false;
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onCustomDamage(CustomDamageEvent event)
|
||||
{
|
||||
@ -142,7 +143,6 @@ public class ChallengeCloudFall extends Challenge
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private boolean isLandingBlock(Block block)
|
||||
{
|
||||
return block.getType() == LANDING_PLATFORM_BLOCK_TYPE && block.getData() == LANDING_PLATFORM_BLOCK_DATA;
|
||||
|
@ -31,7 +31,7 @@ public class ChallengeColorChange extends Challenge
|
||||
private static final int SPAWN_COORDINATES_MULTIPLE = 2;
|
||||
private static final int MAP_HEIGHT = 1;
|
||||
|
||||
private static final long TIME_DELAY = 3000;
|
||||
private static final long TIME_DELAY = 5000;
|
||||
private static final int TIME_DELAY_DECREMENT_RATE = 100;
|
||||
private static final int RESET_DELAY = 4000;
|
||||
|
||||
@ -104,6 +104,7 @@ public class ChallengeColorChange extends Challenge
|
||||
{
|
||||
_isFalling = false;
|
||||
_lastSound = 0;
|
||||
_lastGeneratedPlatforms.clear();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -34,6 +34,8 @@ import nautilus.game.arcade.game.games.mineware.challenge.TeamChallenge;
|
||||
|
||||
/**
|
||||
* A team based challenge with players disguised as dogs and cats.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public class ChallengeDogsVersusCats extends TeamChallenge
|
||||
{
|
||||
|
@ -0,0 +1,40 @@
|
||||
package nautilus.game.arcade.game.games.mineware.challenge.type;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.Challenge;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.ChallengeType;
|
||||
|
||||
/**
|
||||
* This challenge is used to prevent the game from crashing if it's forced to start with only one player.
|
||||
*/
|
||||
public class ChallengeEmpty extends Challenge
|
||||
{
|
||||
public ChallengeEmpty(BawkBawkBattles host)
|
||||
{
|
||||
super(host, ChallengeType.FirstComplete, "Empty", "Not enough players");
|
||||
|
||||
Settings.setUseMapHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Location> createSpawns()
|
||||
{
|
||||
ArrayList<Location> spawns = new ArrayList<>();
|
||||
spawns.add(getCenter().add(0, 1, 0));
|
||||
return spawns;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMap()
|
||||
{
|
||||
Block center = getCenter().getBlock();
|
||||
center.setType(Material.BARRIER);
|
||||
addBlock(center);
|
||||
}
|
||||
}
|
@ -55,7 +55,7 @@ public class ChallengeFallingBlocks extends Challenge implements NumberTracker
|
||||
|
||||
private static final int PLAYER_CAMP_MAX_HEIGHT = 3;
|
||||
private static final byte ADDITIONAL_BLOCK_DATA = 2;
|
||||
private static final float BLOCK_HITBOX_GROW = 0.7F;
|
||||
private static final float BLOCK_HITBOX_GROW = 0.6F;
|
||||
|
||||
private static final Material[] MATERIALS = {
|
||||
Material.GRASS,
|
||||
@ -234,12 +234,7 @@ public class ChallengeFallingBlocks extends Challenge implements NumberTracker
|
||||
if (!isChallengeValid())
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (_waveTracker.containsKey(player))
|
||||
{
|
||||
_waveTracker.remove(player);
|
||||
}
|
||||
_waveTracker.remove(event.getPlayer());
|
||||
}
|
||||
|
||||
private void initializeWaveTracker()
|
||||
|
@ -43,8 +43,9 @@ import nautilus.game.arcade.game.games.mineware.challenge.ChallengeType;
|
||||
|
||||
/**
|
||||
* A challenge based on fishing.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class ChallengeFishingDay extends Challenge
|
||||
{
|
||||
private int _startingLureLevel = 8;
|
||||
|
@ -149,7 +149,6 @@ public class ChallengeLavaRun extends Challenge
|
||||
_modifiedDelay += _modifiedDelayMin;
|
||||
}
|
||||
|
||||
System.out.println("Delay: " + _modifiedDelay);
|
||||
_disappearingBlocks++;
|
||||
_shouldMoveObsidian = false;
|
||||
}
|
||||
|
@ -20,6 +20,8 @@ import nautilus.game.arcade.game.games.mineware.challenge.NumberTracker;
|
||||
|
||||
/**
|
||||
* A challenge based on mazes.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public class ChallengeNavigationMaze extends Challenge implements NumberTracker
|
||||
{
|
||||
|
@ -199,7 +199,11 @@ public class ChallengeReverseTag extends TeamChallenge implements LogicTracker
|
||||
return;
|
||||
|
||||
Player player = event.getEntity();
|
||||
getFirstTeam().remove(player);
|
||||
|
||||
if (!isPlayerValid(player))
|
||||
return;
|
||||
|
||||
_tagTracker.put(player, false);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -267,14 +271,7 @@ public class ChallengeReverseTag extends TeamChallenge implements LogicTracker
|
||||
|
||||
private void trackTag(Player player)
|
||||
{
|
||||
if (_tagTracker.containsKey(player))
|
||||
{
|
||||
if (_tagTracker.get(player))
|
||||
{
|
||||
_tagTracker.put(player, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!_tagTracker.containsKey(player))
|
||||
{
|
||||
_tagTracker.put(player, true);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class ChallengeRushPush extends TeamChallenge
|
||||
(byte) 11,
|
||||
(byte) 14,
|
||||
"Rush Push",
|
||||
"Attack to the enemy team.",
|
||||
"Attack the enemy team.",
|
||||
"Push them off the platform.");
|
||||
|
||||
Settings.setUseMapHeight();
|
||||
|
@ -34,6 +34,8 @@ import nautilus.game.arcade.game.games.mineware.challenge.TeamChallenge;
|
||||
|
||||
/**
|
||||
* A challenge based on volley.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public class ChallengeVolleyPig extends TeamChallenge
|
||||
{
|
||||
@ -164,7 +166,6 @@ public class ChallengeVolleyPig extends TeamChallenge
|
||||
_redSide = 0;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onPlayerMove(PlayerMoveEvent event)
|
||||
{
|
||||
@ -308,7 +309,6 @@ public class ChallengeVolleyPig extends TeamChallenge
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void increaseTeamScore()
|
||||
{
|
||||
if (_pig.isValid())
|
||||
|
@ -62,7 +62,7 @@ public class ChallengeWaveCrush extends Challenge implements NumberTracker
|
||||
ChallengeType.LastStanding,
|
||||
"Wave Crush",
|
||||
"Waves of blocks are coming towards you!",
|
||||
"Avoid getting him by them.");
|
||||
"Avoid getting hit by them.");
|
||||
|
||||
Settings.setUseMapHeight();
|
||||
}
|
||||
@ -119,11 +119,7 @@ public class ChallengeWaveCrush extends Challenge implements NumberTracker
|
||||
{
|
||||
_modifiedNextWaveDelay = NEXT_WAVE_DELAY;
|
||||
|
||||
for (Player player : getPlayersAlive())
|
||||
{
|
||||
_survivedWaves.put(player, 0);
|
||||
}
|
||||
|
||||
initializeWaveTracker();
|
||||
startWavesTask();
|
||||
}
|
||||
|
||||
@ -143,12 +139,7 @@ public class ChallengeWaveCrush extends Challenge implements NumberTracker
|
||||
if (!isChallengeValid())
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (_survivedWaves.containsKey(player))
|
||||
{
|
||||
_survivedWaves.remove(player);
|
||||
}
|
||||
_survivedWaves.remove(event.getPlayer());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -161,6 +152,7 @@ public class ChallengeWaveCrush extends Challenge implements NumberTracker
|
||||
if (isPlayerValid(player))
|
||||
{
|
||||
Host.Manager.GetDamage().NewDamageEvent(target, null, null, DamageCause.PROJECTILE, player.getHealth(), false, false, false, "Falling Block", "Wave Crush");
|
||||
subtractWaveCount(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -179,6 +171,22 @@ public class ChallengeWaveCrush extends Challenge implements NumberTracker
|
||||
return COLORS[_colorIndex];
|
||||
}
|
||||
|
||||
private void initializeWaveTracker()
|
||||
{
|
||||
for (Player player : getPlayersAlive())
|
||||
{
|
||||
_survivedWaves.put(player, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private void subtractWaveCount(Player player)
|
||||
{
|
||||
if (Data.isLost(player) && _survivedWaves.get(player) > 0)
|
||||
{
|
||||
_survivedWaves.put(player, _survivedWaves.get(player) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void startWavesTask()
|
||||
{
|
||||
new BukkitRunnable()
|
||||
|
@ -35,6 +35,8 @@ import nautilus.game.arcade.game.games.mineware.challenge.other.ZombieWrapper;
|
||||
|
||||
/**
|
||||
* A challenge based on zombie survival.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public class ChallengeZombieInfection extends Challenge
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ public class ChickenAttack
|
||||
player.teleport(_center);
|
||||
|
||||
UtilTextMiddle.display(C.cRed + "Chicken Attack!", "You ran out of lives.", INFORM_TITLTE_FADE_IN_TICKS, INFORM_TITLTE_STAY_TICKS, INFORM_TITLTE_FADE_OUT_TICKS, player);
|
||||
UtilPlayer.message(player, F.main("Game", "You failed to follow bawk bawk's instructions and you ran out of lives. His minions are now attacking you."));
|
||||
UtilPlayer.message(player, F.main("Game", "You failed to follow Bawk Bawk's commands. Now his chickens will devour you!"));
|
||||
player.playSound(player.getLocation(), Sound.WITHER_SPAWN, 1.0F, 1.0F);
|
||||
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, Integer.MAX_VALUE, 1));
|
||||
|
@ -30,9 +30,8 @@ public class BouncingShadowTracker extends ChallengeStatTracker
|
||||
|
||||
for (Player player : getGame().GetPlayers(true))
|
||||
{
|
||||
if (bouncingBlock.hasData(player) && bouncingBlock.getData().isDone(player))
|
||||
if (bouncingBlock.hasData(player) && bouncingBlock.getData().isCompleted(player))
|
||||
{
|
||||
System.out.println("Bouncing Shadow: " + player.getName());
|
||||
addStat(player, "BouncingShadow", 1, false, false);
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ public class DragonKingTracker extends ChallengeStatTracker
|
||||
|
||||
if (score > 0)
|
||||
{
|
||||
System.out.println("Dragon King: " + player.getName());
|
||||
addStat(player, "DragonKing", score, false, false);
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ public class EliteArcherTracker extends ChallengeStatTracker
|
||||
|
||||
if (score > 0)
|
||||
{
|
||||
System.out.println("Elite Archer: " + player.getName());
|
||||
addStat(player, "EliteArcher", score, false, false);
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ public class MilkManTracker extends ChallengeStatTracker
|
||||
|
||||
if (score > 0)
|
||||
{
|
||||
System.out.println("Milk Man: " + player.getName());
|
||||
addStat(player, "MilkMan", score, false, false);
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ public class PinataMasterTracker extends ChallengeStatTracker
|
||||
|
||||
if (score > 0)
|
||||
{
|
||||
System.out.println("Pinata Master: " + player.getName());
|
||||
addStat(player, "PinataMaster", score, false, false);
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ public class PixelNinjaTracker extends ChallengeStatTracker
|
||||
|
||||
if (score > 0)
|
||||
{
|
||||
System.out.println("Pixel Ninja: " + player.getName());
|
||||
addStat(player, "PixelNinja", score, false, false);
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,6 @@ public class SpeedyBuildersTracker extends ChallengeStatTracker
|
||||
{
|
||||
if (buildRace.hasData(player) && buildRace.getData().isDone(player))
|
||||
{
|
||||
System.out.println("Speedy Builders: " + player.getName());
|
||||
addStat(player, "SpeedyBuilders", 1, false, false);
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ public class SurfUpTracker extends ChallengeStatTracker
|
||||
|
||||
if (score > 0)
|
||||
{
|
||||
System.out.println("Surf Up: " + player.getName());
|
||||
addStat(player, "SurfUp", score, false, false);
|
||||
}
|
||||
}
|
||||
|
@ -28,11 +28,10 @@ public class TagMasterTracker extends ChallengeStatTracker
|
||||
{
|
||||
ChallengeReverseTag reverseTag = (ChallengeReverseTag) challenge;
|
||||
|
||||
for (Player player : reverseTag.getFirstTeam().getPlayers())
|
||||
for (Player player : getGame().GetPlayers(true))
|
||||
{
|
||||
if (reverseTag.hasData(player))
|
||||
{
|
||||
System.out.println("Tag Master: " + player.getName());
|
||||
addStat(player, "TagMaster", 1, false, false);
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ public class VeteranTracker extends StatTracker<Game>
|
||||
|
||||
if (winner != null)
|
||||
{
|
||||
System.out.println("Veteran: " + winner.getName());
|
||||
addStat(winner, "Veteran", 1, true, false);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user