Added achievements and final polish.

This commit is contained in:
Mysticate 2015-09-23 15:18:44 -04:00
parent 1f84907309
commit 84331901d4
17 changed files with 750 additions and 138 deletions

View File

@ -708,7 +708,43 @@ public enum Achievement
new String[]{"Evolution.EvolveKill"}, new String[]{"Evolution.EvolveKill"},
new String[]{"Kill 25 people while they", "Are trying to evolve"}, new String[]{"Kill 25 people while they", "Are trying to evolve"},
new int[]{25}, new int[]{25},
AchievementCategory.EVOLUTION) AchievementCategory.EVOLUTION),
MONSTER_MAZE_WINS("Maze Master", 1200,
new String[]{"Monster Maze.Wins"},
new String[]{"Win 40 games of Monster Maze"},
new int[]{40},
AchievementCategory.MONSTER_MAZE),
MONSTER_MAZE_HARD_MODE("Hard Mode", 1000,
new String[]{"Monster Maze.Hard Mode"},
new String[]{"Win a game without using", "any kit abilities"},
new int[]{1},
AchievementCategory.MONSTER_MAZE),
MONSTER_MAZE_NINJA("Ninja", 1200,
new String[]{"Monster Maze.Ninja"},
new String[]{"Win a game without", "touching a monster"},
new int[]{1},
AchievementCategory.MONSTER_MAZE),
MONSTER_MAZE_SPEEDSTER("Speedy McGee", 1000,
new String[]{"Monster Maze.Speed"},
new String[]{"Be the first to the", "Safe Pad 50 times"},
new int[]{50},
AchievementCategory.MONSTER_MAZE),
MONSTER_MAZE_SURVIVAL("Die Already!", 1200,
new String[]{"Monster Maze.ToughCompetition"},
new String[]{"Survive past the 15th Safe Pad"},
new int[]{1},
AchievementCategory.MONSTER_MAZE),
MONSTER_MAZE_PILOT("Pilot", 800, //TODO
new String[]{"Monster Maze.Pilot"},
new String[]{"Get hit by a monster and", "land on the Safe Pad"},
new int[]{1},
AchievementCategory.MONSTER_MAZE),
; ;

View File

@ -127,7 +127,13 @@ public enum AchievementCategory
EVOLUTION("Evolution", null, EVOLUTION("Evolution", null,
new StatDisplay[] {StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED}, new StatDisplay[] {StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED},
Material.MONSTER_EGG, 0, GameCategory.ARCADE, "Harvester Kit"); Material.MONSTER_EGG, 0, GameCategory.ARCADE, "Harvester Kit"),
MONSTER_MAZE("Monster Maze", null,
new StatDisplay[] {StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED},
Material.ROTTEN_FLESH, 0, GameCategory.ARCADE, "SoonTM"),
;
private String _name; private String _name;
private String[] _statsToPull; private String[] _statsToPull;

View File

@ -3,13 +3,12 @@ package nautilus.game.arcade.game.games.monstermaze;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import mineplex.core.common.util.UtilMath;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilWorld;
public class MMMazes public class MMMazes
{ {
public static MazePreset getRandomMapPreset(Location loc) public static MazePreset getRandomMapPreset(Location loc)
@ -95,16 +94,30 @@ public class MMMazes
} }
} }
@SuppressWarnings("deprecation")
public void build() public void build()
{ {
for(Location loc : _maze) for (Location loc : _maze)
{ {
loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.QUARTZ_BLOCK); Location mod = loc.clone();
mod.subtract(0, 1, 0).getBlock().setType(Material.QUARTZ_BLOCK);
mod.subtract(0, 1, 0).getBlock().setType(Material.QUARTZ_BLOCK);
mod.getBlock().setData((byte) 2);
mod.subtract(0, 1, 0).getBlock().setType(Material.STEP);
mod.getBlock().setData((byte) 15);
} }
for(Location loc : _spawns) for(Location loc : _spawns)
{ {
loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.GOLD_BLOCK); Location mod = loc.clone();
for (int i = 0 ; i < 3 ; i++)
{
mod.subtract(0, i, 0).getBlock().setType(Material.GOLD_BLOCK);
}
} }
for(Location loc : _centerSafeZone) for(Location loc : _centerSafeZone)

View File

@ -8,6 +8,31 @@ import java.util.Iterator;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set; import java.util.Set;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.RadarData;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilRadar;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTime;
import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.game.games.monstermaze.MMMazes.MazePreset;
import nautilus.game.arcade.game.games.monstermaze.MazeMobWaypoint.CardinalDirection;
import nautilus.game.arcade.game.games.monstermaze.events.AbilityUseEvent;
import nautilus.game.arcade.game.games.monstermaze.events.SafepadBuildEvent;
import nautilus.game.arcade.game.games.monstermaze.events.SnowmanHitEvent;
import nautilus.game.arcade.game.games.monstermaze.kits.KitSmasher;
import org.bukkit.Bukkit;
import org.bukkit.Color; import org.bukkit.Color;
import org.bukkit.FireworkEffect.Type; import org.bukkit.FireworkEffect.Type;
import org.bukkit.Location; import org.bukkit.Location;
@ -22,34 +47,10 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.Snowman; import org.bukkit.entity.Snowman;
import org.bukkit.entity.Zombie; import org.bukkit.entity.Zombie;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.RadarData;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilRadar;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTextTop;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.game.games.monstermaze.MMMazes.MazePreset;
import nautilus.game.arcade.game.games.monstermaze.MazeMobWaypoint.CardinalDirection;
import nautilus.game.arcade.game.games.monstermaze.kits.KitSmasher;
public class Maze implements Listener public class Maze implements Listener
{ {
private MonsterMaze Host; private MonsterMaze Host;
@ -78,6 +79,7 @@ public class Maze implements Listener
private HashMap<Entity, MazeMobWaypoint> _ents = new HashMap<Entity, MazeMobWaypoint>(); private HashMap<Entity, MazeMobWaypoint> _ents = new HashMap<Entity, MazeMobWaypoint>();
@SuppressWarnings("deprecation")
public Maze(MonsterMaze host, MazePreset maze) public Maze(MonsterMaze host, MazePreset maze)
{ {
Host = host; Host = host;
@ -110,6 +112,14 @@ public class Maze implements Listener
pickNextLocForSafePad(); pickNextLocForSafePad();
} }
public boolean isOnPad(Player player)
{
if (_safePad == null)
return false;
return _safePad.isOn(player);
}
public void update() public void update()
{ {
if(_safePad != null) // TODO probably a good idea to check if this will screw up compasses in inventories before the game starts if(_safePad != null) // TODO probably a good idea to check if this will screw up compasses in inventories before the game starts
@ -117,7 +127,7 @@ public class Maze implements Listener
for(Player p : Host.GetPlayers(true)) for(Player p : Host.GetPlayers(true))
{ {
p.setCompassTarget(_nextSafePadLoc); p.setCompassTarget(_nextSafePadLoc);
UtilRadar.displayRadar(p, Arrays.asList(_safePadRadarData), false); UtilRadar.displayRadar(p, Arrays.asList(_safePadRadarData), true);
} }
} }
@ -135,7 +145,7 @@ public class Maze implements Listener
p.setExp(0); p.setExp(0);
} }
UtilTextTop.displayProgress(C.cAqua + C.Bold + "Be the first player to get to the Safe Pad!", 100, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); // UtilTextTop.displayProgress(C.cAqua + C.Bold + "Be the first player to get to the Safe Pad!", 100, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()]));
} }
else else
{ {
@ -143,13 +153,14 @@ public class Maze implements Listener
for(Player p : Host.GetPlayers(true)) for(Player p : Host.GetPlayers(true))
{ {
p.setExp((float)percentage); p.setExp((float)percentage);
if(_safePad.isOn(p)) // if(_safePad.isOn(p))
{ // {
UtilTextTop.displayProgress(C.cGreen + C.Bold + "Stay on the Safe Pad for " + _phaseTimer + " more seconds!", percentage, p); // UtilTextTop.displayProgress(C.cGreen + C.Bold + "Stay on the Safe Pad for " + _phaseTimer + " more seconds!", percentage, p);
} // }
else { // else
UtilTextTop.displayProgress(C.cRed + C.Bold + "You have " + _phaseTimer + " seconds to get to the Safe Pad!", percentage, p); // {
} // UtilTextTop.displayProgress(C.cRed + C.Bold + "You have " + _phaseTimer + " seconds to get to the Safe Pad!", percentage, p);
// }
} }
} }
} }
@ -212,6 +223,8 @@ public class Maze implements Listener
Host.Manager.GetDamage().NewDamageEvent(player, (LivingEntity)ent, null, Host.Manager.GetDamage().NewDamageEvent(player, (LivingEntity)ent, null,
DamageCause.ENTITY_ATTACK, 4, false, false, false, DamageCause.ENTITY_ATTACK, 4, false, false, false,
"Monster", "Monster Attack"); "Monster", "Monster Attack");
Bukkit.getPluginManager().callEvent(new SnowmanHitEvent(player));
} }
} }
} }
@ -465,6 +478,8 @@ public class Maze implements Listener
e.remove(); e.remove();
} }
} }
Bukkit.getPluginManager().callEvent(new SafepadBuildEvent());
} }
public void decrementSafePadTime() public void decrementSafePadTime()
@ -545,34 +560,34 @@ public class Maze implements Listener
_phaseTimer--; _phaseTimer--;
if(_phaseTimer == 20) // only gets to this by running out of time naturally, not by player if(_phaseTimer == 20) // only gets to this by running out of time naturally, not by player
{ {
Host.Announce(C.cRed + C.Bold + "Nobody has gotten to the Safe Pad yet! Twenty seconds left."); UtilTextMiddle.display(C.cGreen + C.Bold + "20", C.cWhite + "Seconds Left", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()]));
} }
if(_phaseTimer == 15 || _phaseTimer == 10) if(_phaseTimer == 15 || _phaseTimer == 10)
{ {
UtilTextMiddle.display("", C.cAqua + C.Bold + _phaseTimer + " seconds to get to the Safe Pad!", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); UtilTextMiddle.display(C.cGreen + C.Bold + _phaseTimer, C.cWhite + "Seconds Left", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()]));
} }
if(_phaseTimer == 5 || _phaseTimer == 4) if(_phaseTimer == 5 || _phaseTimer == 4)
{ {
UtilTextMiddle.display("", C.cGreen + C.Bold + _phaseTimer + "...", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); UtilTextMiddle.display(C.cGreen + C.Bold + _phaseTimer, C.cWhite + "Seconds Left", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()]));
} }
if(_phaseTimer == 3) if(_phaseTimer == 3)
{ {
UtilTextMiddle.display("", C.cYellow + C.Bold + _phaseTimer + "...", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); UtilTextMiddle.display(C.cYellow + C.Bold + _phaseTimer, C.cWhite + "Seconds Left", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()]));
} }
if(_phaseTimer == 2) if(_phaseTimer == 2)
{ {
pickNextLocForSafePad(); pickNextLocForSafePad();
UtilFirework.playFirework(_nextSafePadLoc, Type.BALL, Color.ORANGE, false, false); UtilFirework.playFirework(_nextSafePadLoc, Type.BALL, Color.ORANGE, false, false);
UtilTextMiddle.display("", C.cGold + C.Bold + _phaseTimer + "...", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); UtilTextMiddle.display(C.cGold + C.Bold + _phaseTimer, C.cWhite + "Seconds Left", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()]));
} }
if(_phaseTimer == 1) if(_phaseTimer == 1)
{ {
UtilTextMiddle.display("", C.cRed + C.Bold + _phaseTimer + "...", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); UtilTextMiddle.display(C.cRed + C.Bold + _phaseTimer, C.cWhite + "Seconds Left", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()]));
} }
if(_phaseTimer == 0) if(_phaseTimer == 0)
@ -582,15 +597,15 @@ public class Maze implements Listener
if(_safePad.isOn(p)) if(_safePad.isOn(p))
{ {
// maybe send them a happy message? =) // maybe send them a happy message? =)
UtilPlayer.message(p, F.main("Game", C.cGreen + "Since you were on the Safe Pad, you didn't die!")); // UtilPlayer.message(p, F.main("Game", "Since you were on the Safe Pad, you didn't die!"));
} }
else else
{ {
Host.Manager.GetDamage().NewDamageEvent(p, null, null, Host.Manager.GetDamage().NewDamageEvent(p, null, null,
DamageCause.CUSTOM, 500, false, false, false, DamageCause.CUSTOM, 500, false, false, false,
"Game", "Map damage"); "Game", "Map damage");
UtilTextMiddle.display(C.cDRed + C.Bold + "Failure", C.cRed + "You didn't make it to the Safe Pad in time!", 5, 40, 5, p); UtilTextMiddle.display("", C.cRed + "You didn't make it to the Safe Pad!", 5, 40, 5, p);
UtilPlayer.message(p, F.main("Game", C.cRed + "You died because you weren't on the Safe Pad!")); UtilPlayer.message(p, F.main("Game", "You didn't make it to the Safe Pad!"));
} }
} }
spawn(15); spawn(15);
@ -608,7 +623,7 @@ public class Maze implements Listener
{ {
if(_safePad.isOn(p) && !_playersOnPad.contains(p)) if(_safePad.isOn(p) && !_playersOnPad.contains(p))
{ {
UtilPlayer.message(p, F.main("Game", C.cGreen + "Great, you made it. Stay on the Safe Pad!")); UtilPlayer.message(p, F.main("Game", "You made it to the Safe Pad!"));
_playersOnPad.add(p); _playersOnPad.add(p);
Host.AddGems(p, 2, "Got to Safe Pad", true, true); Host.AddGems(p, 2, "Got to Safe Pad", true, true);
if(_playersOnPad.size() == 1) // first player if(_playersOnPad.size() == 1) // first player
@ -621,23 +636,23 @@ public class Maze implements Listener
pElse.remove(p); pElse.remove(p);
for(Player i : pElse) for(Player i : pElse)
{ {
UtilPlayer.message(i, C.cRed + C.Bold + p.getName() + " was the first to make it to the Safe Pad!"); UtilPlayer.message(i, F.main("Game", F.name(p.getName()) + " made it to the Safe Pad first!"));
UtilPlayer.message(i, C.cGray + "Everyone not on the Safe Pad in 15 seconds will die!"); // I don't like this message UtilPlayer.message(i, F.main("Game", "You have " + F.time("15 Seconds") + " to make it to the Safe Pad!"));
} }
} }
UtilTextMiddle.display(C.cGold + C.Bold + "AWESOME!", C.cGold + "You were the first to make it to the Safe Pad!", 5, 40, 5, p); UtilTextMiddle.display(C.cYellow + C.Bold + "Safe Pad", C.cWhite + "You got to the Safe Pad first!", 5, 40, 5, p);
Host.AddGems(p, 7.5, "First to Safe Pad", true, true); Host.AddGems(p, 7.5, "First to Safe Pad", true, true);
p.playSound(p.getLocation(), Sound.SUCCESSFUL_HIT, 1.0f, 1.0f); p.playSound(p.getLocation(), Sound.SUCCESSFUL_HIT, 1.0f, 1.0f);
} else // not the first } else // not the first
{ {
p.playSound(p.getLocation(), Sound.SUCCESSFUL_HIT, 1.0f, 1.0f); p.playSound(p.getLocation(), Sound.SUCCESSFUL_HIT, 1.0f, 1.0f);
UtilTextMiddle.display(C.cGreen + C.Bold + "Great!", C.cGreen + "Stay on the Safe Pad!", 5, 40, 5, p); UtilTextMiddle.display(C.cYellow + C.Bold + "Safe Pad", C.cWhite + "You got to the Safe Pad!", 5, 40, 5, p);
} }
} }
if(!_safePad.isOn(p) && _playersOnPad.contains(p)) if(!_safePad.isOn(p) && _playersOnPad.contains(p))
{ {
UtilTextMiddle.display(C.cDRed + C.Bold + "Danger!", C.cRed + "Get back to the Safe Pad!", 0, 10, 0, p); UtilTextMiddle.display(C.cRed + C.Bold + "DANGER", C.cWhite + "Get back to the Safe Pad!", 0, 10, 0, p);
//UtilTextBottom.display(C.cRed + "Get back to the Safe Pad!", p); //UtilTextBottom.display(C.cRed + "Get back to the Safe Pad!", p);
} }
} }
@ -677,6 +692,8 @@ public class Maze implements Listener
ent.teleport(UtilAlg.Random(_spawns)); ent.teleport(UtilAlg.Random(_spawns));
} }
} }
Bukkit.getPluginManager().callEvent(new AbilityUseEvent(player));
} }
public void removePlayerContainmentUnit() public void removePlayerContainmentUnit()

View File

@ -1,8 +1,29 @@
package nautilus.game.arcade.game.games.monstermaze; package nautilus.game.arcade.game.games.monstermaze;
import java.util.HashMap; import mineplex.core.common.util.C;
import java.util.UUID; import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilTime;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.monstermaze.MMMazes.MazePreset;
import nautilus.game.arcade.game.games.monstermaze.events.AbilityUseEvent;
import nautilus.game.arcade.game.games.monstermaze.kits.KitJumper;
import nautilus.game.arcade.game.games.monstermaze.kits.KitSmasher;
import nautilus.game.arcade.game.games.monstermaze.trackers.AbilityUseTracker;
import nautilus.game.arcade.game.games.monstermaze.trackers.FirstToSafepadTracker;
import nautilus.game.arcade.game.games.monstermaze.trackers.PilotTracker;
import nautilus.game.arcade.game.games.monstermaze.trackers.SnowmanHitTracker;
import nautilus.game.arcade.game.games.monstermaze.trackers.SurvivePast15thSafepadTracker;
import nautilus.game.arcade.kit.Kit;
import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
@ -16,25 +37,8 @@ import org.bukkit.event.block.EntityBlockFormEvent;
import org.bukkit.event.entity.EntityCombustEvent; import org.bukkit.event.entity.EntityCombustEvent;
import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.scoreboard.Team; import org.bukkit.scoreboard.Team;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.monstermaze.MMMazes.MazePreset;
import nautilus.game.arcade.game.games.monstermaze.kits.KitJumper;
import nautilus.game.arcade.game.games.monstermaze.kits.KitSmasher;
import nautilus.game.arcade.kit.Kit;
public class MonsterMaze extends SoloGame public class MonsterMaze extends SoloGame
{ {
private Maze _maze; private Maze _maze;
@ -43,9 +47,8 @@ public class MonsterMaze extends SoloGame
private MazePreset _preset; private MazePreset _preset;
private Location _center; private Location _center;
private HashMap<UUID, Integer> _jumperData = new HashMap<>(); @SuppressWarnings("unchecked")
public MonsterMaze(ArcadeManager manager) public MonsterMaze(ArcadeManager manager)
{ {
super(manager, GameType.MonsterMaze, super(manager, GameType.MonsterMaze,
@ -58,7 +61,9 @@ public class MonsterMaze extends SoloGame
new String[] new String[]
{ {
"Be the first to make it to the Safe Pad, but avoid the monsters!" "Run over the maze and don't fall off,",
"but make sure you avoid the monsters!",
"Make it to a Safe Pad or be killed!"
}); });
this.DamagePvP = false; this.DamagePvP = false;
@ -66,9 +71,21 @@ public class MonsterMaze extends SoloGame
this.PrepareFreeze = false; this.PrepareFreeze = false;
registerStatTrackers(
new SnowmanHitTracker(this),
new AbilityUseTracker(this),
new FirstToSafepadTracker(this),
new PilotTracker(this),
new SurvivePast15thSafepadTracker(this)
);
//_maze = new SnowmanMaze(this, WorldData.GetDataLocs("GRAY")/*, WorldData.GetCustomLocs("103")*/); //_maze = new SnowmanMaze(this, WorldData.GetDataLocs("GRAY")/*, WorldData.GetCustomLocs("103")*/);
} }
public Maze getMaze()
{
return _maze;
}
@EventHandler @EventHandler
public void Update(UpdateEvent event) public void Update(UpdateEvent event)
{ {
@ -83,17 +100,29 @@ public class MonsterMaze extends SoloGame
if(event.GetState() == GameState.Prepare) if(event.GetState() == GameState.Prepare)
{ {
//if(WorldData.MapName.contains("MonsterTest")) _monsterType = EntityType.CREEPER; //if(WorldData.MapName.contains("MonsterTest")) _monsterType = EntityType.CREEPER;
_maze.spawnSafePad();
setupJumpers(); setupJumpers();
} }
else if(event.GetState() == GameState.Live) else if(event.GetState() == GameState.Live)
{ {
_maze.removePlayerContainmentUnit(); _maze.removePlayerContainmentUnit();
UtilTextMiddle.display(C.cAqua + C.Bold + "Push F5", C.cWhite + "Monster Maze is best played in 3rd Person", 10, 70, 10); Announce(C.cYellow + C.Scramble + "@@" + C.cAqua + C.Bold + " Monster Maze is best played in 3rd Person! (Push F5) " + C.cYellow + C.Scramble + "@@");
for (Team team : GetScoreboard().GetScoreboard().getTeams()) for (Team team : GetScoreboard().GetScoreboard().getTeams())
team.setCanSeeFriendlyInvisibles(true); team.setCanSeeFriendlyInvisibles(true);
Bukkit.getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable()
{
@Override
public void run()
{
if (!IsLive())
return;
_maze.spawnSafePad();
}
}, 80);
} }
else if(event.GetState() == GameState.Recruit) else if(event.GetState() == GameState.Recruit)
{ {
@ -113,30 +142,53 @@ public class MonsterMaze extends SoloGame
{ {
if(GetKit(p) instanceof KitJumper) if(GetKit(p) instanceof KitJumper)
{ {
_jumperData.put(p.getUniqueId(), 5); setJumpsLeft(p, 5);
} }
} }
} }
private void setJumpsLeft(Player player, int jumps)
{
if (jumps <= 0)
{
player.getInventory().setItem(8, null);
}
else
{
player.getInventory().setItem(8, ItemStackFactory.Instance.CreateStack(Material.FEATHER, (byte)0, jumps, C.cYellow + C.Bold + jumps + " Jumps Remaining"));
}
}
@EventHandler @EventHandler
public void smasher(PlayerInteractEvent event) public void smasher(PlayerInteractEvent event)
{ {
if (!IsLive())
return;
_maze.smasher(event); _maze.smasher(event);
} }
@EventHandler @EventHandler
public void jumpEvent(UpdateEvent event) public void jumpEvent(UpdateEvent event)
{ {
if(event.getType() != UpdateType.TICK) return; if(event.getType() != UpdateType.TICK)
if(GetState() != GameState.Live) return; return;
for(Player p : GetPlayers(true))
if (!IsLive())
return;
for (Player p : GetPlayers(true))
{ {
if(!_jumperData.containsKey(p.getUniqueId()) || !Recharge.Instance.usable(p, "MM Player Jump") || p.getLocation().getY()-_center.getY() <= 0 || !Recharge.Instance.usable(p, "Monster Launch")) continue; if (!UtilInv.contains(p, "Jumps Remaining", Material.FEATHER, (byte) 0, 1) || p.getLocation().getY()-_center.getY() <= 0 || !Recharge.Instance.usable(p, "MM Player Jump") || !Recharge.Instance.usable(p, "Monster Launch"))
continue;
_jumperData.put(p.getUniqueId(), _jumperData.get(p.getUniqueId())-1); setJumpsLeft(p, p.getInventory().getItem(8).getAmount() - 1);
p.playSound(p.getLocation(), Sound.CHICKEN_EGG_POP, 1.0f, 1.0f); p.playSound(p.getLocation(), Sound.CHICKEN_EGG_POP, 1.0f, 1.0f);
Recharge.Instance.useForce(p, "MM Player Jump", 750); Recharge.Instance.useForce(p, "MM Player Jump", 750);
Bukkit.getPluginManager().callEvent(new AbilityUseEvent(p));
} }
} }
@ -145,25 +197,29 @@ public class MonsterMaze extends SoloGame
{ {
if(event.getType() != UpdateType.TICK) return; if(event.getType() != UpdateType.TICK) return;
if(!InProgress()) return; if(!InProgress()) return;
for(Player pl : GetPlayers(true)) for(Player pl : GetPlayers(true))
{ {
if(_jumperData.containsKey(pl.getUniqueId()) && _jumperData.get(pl.getUniqueId()) > 0) if (IsLive() && UtilInv.contains(pl, Material.FEATHER, (byte) 0, 1))
{ {
pl.getInventory().setItem(8, ItemStackFactory.Instance.CreateStack(Material.FEATHER, (byte)0, _jumperData.get(pl.getUniqueId()), while (Manager.GetCondition().HasCondition(pl, ConditionType.JUMP, null))
C.cYellow + C.Bold + _jumperData.get(pl.getUniqueId()) + " Jumps Remaining")); Manager.GetCondition().GetActiveCondition(pl, ConditionType.JUMP).Expire();
} }
else else
{ {
pl.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 1000000000, 250)); if (!Manager.GetCondition().HasCondition(pl, ConditionType.JUMP, null))
pl.getInventory().setItem(8, ItemStackFactory.Instance.CreateStack(Material.AIR, (byte)0, 1, "" )); Manager.GetCondition().Factory().Jump("No jumping", pl, null, 9999999, 250, true, false, false);
} }
if(GetPlayers(true).size() > 4)
if (GetPlayers(true).size() > 4)
{ {
pl.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 1000000000, 250)); if (!Manager.GetCondition().HasCondition(pl, ConditionType.INVISIBILITY, null))
Manager.GetCondition().Factory().Invisible("Hide players", pl, null, 9999999, 2, true, false, false);
} }
else else
{ {
pl.removePotionEffect(PotionEffectType.INVISIBILITY); while (Manager.GetCondition().HasCondition(pl, ConditionType.INVISIBILITY, null))
Manager.GetCondition().GetActiveCondition(pl, ConditionType.INVISIBILITY).Expire();
} }
} }
} }
@ -216,32 +272,36 @@ public class MonsterMaze extends SoloGame
return; return;
Scoreboard.Reset(); Scoreboard.Reset();
Scoreboard.WriteBlank(); Scoreboard.WriteBlank();
Scoreboard.Write(C.cDPurple + C.Bold + "Beacon Timer"); if (GetPlayers(true).size() > 6)
if(IsLive())
{ {
Scoreboard.Write(_maze.getPhaseTimer() + " Seconds"); Scoreboard.Write(C.cYellow + C.Bold + "Players");
Scoreboard.Write(C.cWhite + GetPlayers(true).size());
} }
else else
{ {
Scoreboard.Write("--"); for (Player p : GetPlayers(true))
}
Scoreboard.WriteBlank();
if(GetPlayers(true).size() > 5)
{
Scoreboard.Write(C.cWhite + GetPlayers(true).size() + " Players");
}
else
{
for(Player p : GetPlayers(true))
{ {
Scoreboard.Write(p.getName()); Scoreboard.Write(C.cWhite + p.getName());
} }
} }
Scoreboard.WriteBlank();
Scoreboard.Write(C.cGreen + C.Bold + "Safe Pad");
if (IsLive())
{
Scoreboard.Write(C.cWhite + UtilTime.MakeStr(_maze.getPhaseTimer() * 1000));
}
else
{
Scoreboard.Write("Unknown");
}
Scoreboard.Draw(); Scoreboard.Draw();
} }
} }

View File

@ -20,7 +20,7 @@ import net.minecraft.server.v1_7_R4.PacketPlayOutBlockBreakAnimation;
public class SafePad public class SafePad
{ {
private MonsterMaze Host; private MonsterMaze Host;
private Maze _maze; // private Maze _maze;
private Location _loc; private Location _loc;
@ -29,7 +29,7 @@ public class SafePad
public SafePad(MonsterMaze host, Maze maze, Location loc) public SafePad(MonsterMaze host, Maze maze, Location loc)
{ {
Host = host; Host = host;
_maze = maze; // _maze = maze;
_loc = loc; _loc = loc;
@ -91,6 +91,7 @@ public class SafePad
Location _loc; Location _loc;
@SuppressWarnings("deprecation")
public SafePadBlock(Location loc, Material newMat, byte newData) public SafePadBlock(Location loc, Material newMat, byte newData)
{ {
_origM = loc.getBlock().getType(); _origM = loc.getBlock().getType();
@ -102,12 +103,14 @@ public class SafePad
_loc = loc; _loc = loc;
} }
@SuppressWarnings("deprecation")
public void setMaterial(Material m) public void setMaterial(Material m)
{ {
_tempMat = m; _tempMat = m;
MapUtil.QuickChangeBlockAt(_loc, _tempMat.getId(), _tempData); MapUtil.QuickChangeBlockAt(_loc, _tempMat.getId(), _tempData);
} }
@SuppressWarnings("deprecation")
public void setData(byte b) // for glass changing public void setData(byte b) // for glass changing
{ {
_tempData = b; _tempData = b;
@ -119,6 +122,7 @@ public class SafePad
return _loc.getBlock().getType(); return _loc.getBlock().getType();
} }
@SuppressWarnings("deprecation")
public byte getBlockData() public byte getBlockData()
{ {
return _loc.getBlock().getData(); return _loc.getBlock().getData();
@ -129,11 +133,13 @@ public class SafePad
return _loc; return _loc;
} }
@SuppressWarnings("deprecation")
public void build() public void build()
{ {
MapUtil.QuickChangeBlockAt(_loc, _tempMat.getId(), _tempData); MapUtil.QuickChangeBlockAt(_loc, _tempMat.getId(), _tempData);
} }
@SuppressWarnings("deprecation")
public void restore() public void restore()
{ {
MapUtil.QuickChangeBlockAt(_loc, _origM.getId(), _origD); MapUtil.QuickChangeBlockAt(_loc, _origM.getId(), _origD);

View File

@ -0,0 +1,30 @@
package nautilus.game.arcade.game.games.monstermaze.events;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
public class AbilityUseEvent extends PlayerEvent
{
/**
* @author Mysticate
*/
private static final HandlerList _handlers = new HandlerList();
private static HandlerList getHandlerList()
{
return _handlers;
}
@Override
public HandlerList getHandlers()
{
return getHandlerList();
}
public AbilityUseEvent(Player player)
{
super(player);
}
}

View File

@ -0,0 +1,30 @@
package nautilus.game.arcade.game.games.monstermaze.events;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
public class FirstToSafepadEvent extends PlayerEvent
{
/**
* @author Mysticate
*/
private static final HandlerList _handlers = new HandlerList();
private static HandlerList getHandlerList()
{
return _handlers;
}
@Override
public HandlerList getHandlers()
{
return getHandlerList();
}
public FirstToSafepadEvent(Player player)
{
super(player);
}
}

View File

@ -0,0 +1,24 @@
package nautilus.game.arcade.game.games.monstermaze.events;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class SafepadBuildEvent extends Event
{
/**
* @author Mysticate
*/
private static final HandlerList _handlers = new HandlerList();
private static HandlerList getHandlerList()
{
return _handlers;
}
@Override
public HandlerList getHandlers()
{
return getHandlerList();
}
}

View File

@ -0,0 +1,30 @@
package nautilus.game.arcade.game.games.monstermaze.events;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
public class SnowmanHitEvent extends PlayerEvent
{
/**
* @author Mysticate
*/
private static final HandlerList _handlers = new HandlerList();
private static HandlerList getHandlerList()
{
return _handlers;
}
@Override
public HandlerList getHandlers()
{
return getHandlerList();
}
public SnowmanHitEvent(Player player)
{
super(player);
}
}

View File

@ -1,17 +1,17 @@
package nautilus.game.arcade.game.games.monstermaze.kits; package nautilus.game.arcade.game.games.monstermaze.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.*;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public class KitJumper extends Kit public class KitJumper extends Kit
{ {
@ -21,23 +21,27 @@ public class KitJumper extends Kit
new String[] new String[]
{ {
"Your legs are reinforced with metal braces,", "Your legs are reinforced with metal braces."
"so you can jump an extra five times!"
}, },
new Perk[] new Perk[]
{ {
new Perk("Jumper", new String[]
{
C.cGray + "You can jump " + C.cYellow + "5 Times" + C.cGray + "."
})
{
}
}, },
EntityType.SKELETON, EntityType.SKELETON,
new ItemStack(Material.FEATHER)); new ItemStack(Material.FEATHER));
} }
@Override @Override
public void GiveItems(Player player) public void GiveItems(Player player)
{ {
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.COMPASS, (byte)0, 1, player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.COMPASS, (byte)0, 1,
C.cYellow + "Safe Pad Tracking Device™")); F.item("Safe Pad Finder")));
} }
} }

View File

@ -1,17 +1,17 @@
package nautilus.game.arcade.game.games.monstermaze.kits; package nautilus.game.arcade.game.games.monstermaze.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.*;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public class KitSmasher extends Kit public class KitSmasher extends Kit
{ {
@ -21,26 +21,30 @@ public class KitSmasher extends Kit
new String[] new String[]
{ {
"You can perform three smashing actions,", "You really hate monsters..."
"which helps you clear your path!"
}, },
new Perk[] new Perk[]
{ {
new Perk("Smasher", new String[]
{
F.elem("Click") + " to use " + F.skill("Smash"),
})
{
}
}, },
EntityType.SKELETON, EntityType.SKELETON,
new ItemStack(Material.ANVIL)); new ItemStack(Material.ANVIL));
} }
@Override @Override
public void GiveItems(Player player) public void GiveItems(Player player)
{ {
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.COMPASS, (byte)0, 1, player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.COMPASS, (byte)0, 1,
C.cYellow + "Safe Pad Tracking Device™")); F.item("Safe Pad Finder")));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.ANVIL, (byte)0, 3, player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.ANVIL, (byte)0, 3,
C.cYellow + C.Bold + "Right-click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Smash")); C.cYellow + C.Bold + "Right Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Smash"));
} }
} }

View File

@ -0,0 +1,85 @@
package nautilus.game.arcade.game.games.monstermaze.trackers;
import java.util.ArrayList;
import java.util.List;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.monstermaze.MonsterMaze;
import nautilus.game.arcade.game.games.monstermaze.events.AbilityUseEvent;
import nautilus.game.arcade.stats.StatTracker;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
public class AbilityUseTracker extends StatTracker<MonsterMaze>
{
/**
* @author Mysticate
*/
private List<String> _out = new ArrayList<String>();
public AbilityUseTracker(MonsterMaze game)
{
super(game);
}
@EventHandler
public void onAbilityUse(AbilityUseEvent event)
{
if (!getGame().IsLive())
return;
if (isOut(event.getPlayer()))
return;
setOut(event.getPlayer());
}
@EventHandler(priority = EventPriority.MONITOR)
public void onGameEnd(GameStateChangeEvent event)
{
if (event.GetState() != GameState.End)
return;
if (getGame().getWinners() == null)
return;
for (Player player : getGame().getWinners())
{
if (isOut(player))
continue;
addStat(player);
}
_out.clear();
}
private boolean isOut(Player player)
{
for (String out : _out)
{
if (out.equalsIgnoreCase(player.getName()))
{
return true;
}
}
return false;
}
private void setOut(Player player)
{
if (isOut(player))
return;
_out.add(player.getName());
}
private void addStat(Player player)
{
addStat(player, "Hard Mode", 1, true, false);
}
}

View File

@ -0,0 +1,34 @@
package nautilus.game.arcade.game.games.monstermaze.trackers;
import nautilus.game.arcade.game.games.monstermaze.MonsterMaze;
import nautilus.game.arcade.game.games.monstermaze.events.FirstToSafepadEvent;
import nautilus.game.arcade.stats.StatTracker;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
public class FirstToSafepadTracker extends StatTracker<MonsterMaze>
{
/**
* @author Mysticate
*/
public FirstToSafepadTracker(MonsterMaze game)
{
super(game);
}
@EventHandler
public void onSafepadFirst(FirstToSafepadEvent event)
{
if (!getGame().IsLive())
return;
addStat(event.getPlayer());
}
private void addStat(Player player)
{
addStat(player, "Speed", 1, false, false);
}
}

View File

@ -0,0 +1,104 @@
package nautilus.game.arcade.game.games.monstermaze.trackers;
import java.util.concurrent.ConcurrentHashMap;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.monstermaze.MonsterMaze;
import nautilus.game.arcade.game.games.monstermaze.events.SnowmanHitEvent;
import nautilus.game.arcade.stats.StatTracker;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
public class PilotTracker extends StatTracker<MonsterMaze>
{
/**
* @author Mysticate
*/
private ConcurrentHashMap<Player, Long> _launched = new ConcurrentHashMap<Player, Long>();
public PilotTracker(MonsterMaze game)
{
super(game);
}
@EventHandler
public void onSnowmanHit(SnowmanHitEvent event)
{
if (!getGame().IsLive())
return;
if (isLaunched(event.getPlayer()))
return;
setLaunched(event.getPlayer());
}
@EventHandler
public void onUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
if (!getGame().IsLive())
{
_launched.clear();
return;
}
for (Player player : _launched.keySet())
{
if (player == null || !player.isOnline() || !getGame().IsAlive(player) || UtilPlayer.isSpectator(player))
{
_launched.remove(player);
if (_launched.contains(player)) System.out.println("CONCURRENT HASHMAP BROKE AND STILL HAS THE PLAYER IN IT!");
continue;
}
if (UtilEnt.isGrounded(player))
{
_launched.remove(player);
if (_launched.contains(player)) System.out.println("CONCURRENT HASHMAP BROKE AND STILL HAS THE PLAYER IN IT!");
if (getGame().getMaze().isOnPad(player))
{
addStat(player);
}
continue;
}
if (UtilTime.elapsed(_launched.get(player), 2000))
{
_launched.remove(player);
if (_launched.contains(player)) System.out.println("CONCURRENT HASHMAP BROKE AND STILL HAS THE PLAYER IN IT!");
continue;
}
}
}
private boolean isLaunched(Player player)
{
return _launched.containsKey(player);
}
private void setLaunched(Player player)
{
_launched.put(player, System.currentTimeMillis());
}
private void addStat(Player player)
{
addStat(player, "Pilot", 1, true, false);
}
}

View File

@ -0,0 +1,85 @@
package nautilus.game.arcade.game.games.monstermaze.trackers;
import java.util.ArrayList;
import java.util.List;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.monstermaze.MonsterMaze;
import nautilus.game.arcade.game.games.monstermaze.events.SnowmanHitEvent;
import nautilus.game.arcade.stats.StatTracker;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
public class SnowmanHitTracker extends StatTracker<MonsterMaze>
{
/**
* @author Mysticate
*/
private List<String> _out = new ArrayList<String>();
public SnowmanHitTracker(MonsterMaze game)
{
super(game);
}
@EventHandler
public void onSnowmanHit(SnowmanHitEvent event)
{
if (!getGame().IsLive())
return;
if (isOut(event.getPlayer()))
return;
setOut(event.getPlayer());
}
@EventHandler(priority = EventPriority.MONITOR)
public void onGameEnd(GameStateChangeEvent event)
{
if (event.GetState() != GameState.End)
return;
if (getGame().getWinners() == null)
return;
for (Player player : getGame().getWinners())
{
if (isOut(player))
continue;
addStat(player);
}
_out.clear();
}
private boolean isOut(Player player)
{
for (String out : _out)
{
if (out.equalsIgnoreCase(player.getName()))
{
return true;
}
}
return false;
}
private void setOut(Player player)
{
if (isOut(player))
return;
_out.add(player.getName());
}
private void addStat(Player player)
{
addStat(player, "Ninja", 1, true, false);
}
}

View File

@ -0,0 +1,44 @@
package nautilus.game.arcade.game.games.monstermaze.trackers;
import nautilus.game.arcade.game.games.monstermaze.MonsterMaze;
import nautilus.game.arcade.game.games.monstermaze.events.SafepadBuildEvent;
import nautilus.game.arcade.stats.StatTracker;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
public class SurvivePast15thSafepadTracker extends StatTracker<MonsterMaze>
{
/**
* @author Mysticate
*/
private int _cur = 0;
public SurvivePast15thSafepadTracker(MonsterMaze game)
{
super(game);
}
@EventHandler
public void onSafepadBuild(SafepadBuildEvent event)
{
if (!getGame().IsLive())
return;
_cur++;
if (_cur > 15)
{
for (Player player : getGame().GetPlayers(true))
{
addStat(player);
}
}
}
private void addStat(Player player)
{
addStat(player, "ToughCompetition", 1, true, false);
}
}