Tons of changes.

This commit is contained in:
Mysticate 2015-09-23 23:44:10 -04:00
parent 125b823a65
commit 842da3d6fb
4 changed files with 614 additions and 302 deletions

View File

@ -1,7 +1,9 @@
package nautilus.game.arcade.game.games.monstermaze; package nautilus.game.arcade.game.games.monstermaze;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
import java.util.List;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
@ -16,7 +18,7 @@ public class MMMazes
{ {
public static MazePreset getRandomMapPreset(Location loc) public static MazePreset getRandomMapPreset(Location loc)
{ {
return new MazePreset(M1, loc); // TODO randomization return new MazePreset(getRandomMap(), loc);
} }
public static class MazePreset public static class MazePreset
@ -96,20 +98,31 @@ public class MMMazes
} }
} }
} }
ArrayList<Location> locsToPickFrom = new ArrayList<>(_validSafePadSpawns); ArrayList<Location> locsToPickFrom = new ArrayList<>(_validSafePadSpawns);
int numberOfSafeZones = 4; int numberOfSafeZones = 8;
for(int i = 0; i < numberOfSafeZones; i++) for (int i = 0; i < numberOfSafeZones; i++)
{ {
Location l = UtilAlg.Random(locsToPickFrom); Location toAdd = null;
if (locsToPickFrom == null)
for(Block b : UtilBlock.getInBoundingBox(l.clone().add(1, 0, 1), l.clone().subtract(1, 0, 1), false))
{ {
_safeZones.add(b.getLocation()); toAdd = UtilAlg.Random(locsToPickFrom);
} }
else
for(Block b : UtilBlock.getInRadius(l.getBlock(), 6).keySet()) {
ArrayList<Location> toBeAwayFrom = new ArrayList<Location>(_safeZones);
toBeAwayFrom.add(_center);
toAdd = UtilAlg.getLocationAwayFromOtherLocations(locsToPickFrom, toBeAwayFrom);
}
_safeZones.add(toAdd);
// for(Block b : UtilBlock.getInBoundingBox(toAdd.clone().add(1, 0, 1), toAdd.clone().subtract(1, 0, 1), false))
// {
// _safeZones.add(b.getLocation());
// }
for (Block b : UtilBlock.getInRadius(toAdd.getBlock(), 6).keySet())
{ {
locsToPickFrom.remove(b.getLocation()); locsToPickFrom.remove(b.getLocation());
} }
@ -162,21 +175,26 @@ public class MMMazes
for (int i = 0 ; i < 3 ; i++) for (int i = 0 ; i < 3 ; i++)
{ {
mod.subtract(0, i, 0).getBlock().setType(Material.GOLD_BLOCK); mod.subtract(0, 1, 0).getBlock().setType(Material.GOLD_BLOCK);
} }
} }
for(Location loc : _centerSafeZone) for(Location loc : _centerSafeZone)
{ {
loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.STAINED_GLASS); for (int i = 0 ; i < 3 ; i++)
loc.getBlock().getRelative(BlockFace.DOWN).setData((byte)8); {
Block cur = loc.clone().subtract(0, i, 0).getBlock();
cur.getRelative(BlockFace.DOWN).setType(Material.STAINED_CLAY);
cur.getRelative(BlockFace.DOWN).setData((byte) 13);
}
} }
for(Location loc : _safeZones) // for(Location loc : _safeZones)
{ // {
loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.STAINED_GLASS); // loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.STAINED_CLAY);
loc.getBlock().getRelative(BlockFace.DOWN).setData((byte)8); // loc.getBlock().getRelative(BlockFace.DOWN).setData((byte) 5);
} // }
_built = true; _built = true;
} }
@ -185,6 +203,11 @@ public class MMMazes
return _spawns; return _spawns;
} }
public ArrayList<Location> getSafeZones()
{
return _safeZones;
}
public boolean isBuilt() public boolean isBuilt()
{ {
return _built; return _built;
@ -205,120 +228,329 @@ public class MMMazes
{ {
return _centerSafeZone; return _centerSafeZone;
} }
public ArrayList<Location> getValidSafePadSpawns() public ArrayList<Location> getValidSafePadSpawns()
{ {
return _validSafePadSpawns; return _validSafePadSpawns;
} }
public Location getCenter() public Location getCenter()
{ {
return _center; return _center;
} }
} }
// PARSED MAZES // PARSED MAZES
private static final int[][] M1 = { private static final int[][] getRandomMap()
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,2,0,0,0},
{0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0},
};
} }

View File

@ -61,6 +61,7 @@ public class Maze implements Listener
private HashSet<Block> _waypoints; private HashSet<Block> _waypoints;
private HashSet<Block> _disabledWaypoints; private HashSet<Block> _disabledWaypoints;
private HashSet<Block> _oldDisabledWaypoints; private HashSet<Block> _oldDisabledWaypoints;
private ArrayList<Location> _safeZones;
private Location _center; private Location _center;
@ -68,6 +69,7 @@ public class Maze implements Listener
private SafePad _safePad = null; private SafePad _safePad = null;
private SafePad _oldSafePad = null; private SafePad _oldSafePad = null;
private boolean _canSpawn = true;
private ArrayList<Player> _playersOnPad = new ArrayList<Player>(); private ArrayList<Player> _playersOnPad = new ArrayList<Player>();
@ -80,6 +82,10 @@ public class Maze implements Listener
private HashMap<Entity, MazeMobWaypoint> _ents = new HashMap<Entity, MazeMobWaypoint>(); private HashMap<Entity, MazeMobWaypoint> _ents = new HashMap<Entity, MazeMobWaypoint>();
private long _lastBeacon = System.currentTimeMillis();
private int _curSafe = 0;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public Maze(MonsterMaze host, MazePreset maze) public Maze(MonsterMaze host, MazePreset maze)
{ {
@ -88,6 +94,7 @@ public class Maze implements Listener
_map = maze.getMaze(); _map = maze.getMaze();
_spawns = maze.getSpawns(); _spawns = maze.getSpawns();
_goals = maze.getValidSafePadSpawns(); _goals = maze.getValidSafePadSpawns();
_safeZones = maze.getSafeZones();
_waypoints = new HashSet<Block>(); _waypoints = new HashSet<Block>();
_disabledWaypoints = new HashSet<Block>(); _disabledWaypoints = new HashSet<Block>();
@ -108,11 +115,14 @@ public class Maze implements Listener
loc.getBlock().setType(Material.STAINED_GLASS); loc.getBlock().setType(Material.STAINED_GLASS);
loc.getBlock().setData((byte)3); loc.getBlock().setData((byte)3);
} }
_center = maze.getCenter(); _center = maze.getCenter();
pickNextLocForSafePad();
} }
public SafePad getSafePad()
{
return _safePad;
}
public boolean isOnPad(Player player) public boolean isOnPad(Player player)
{ {
if (_safePad == null) if (_safePad == null)
@ -123,7 +133,7 @@ public class Maze implements Listener
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
{ {
for(Player p : Host.GetPlayers(true)) for(Player p : Host.GetPlayers(true))
{ {
@ -133,11 +143,11 @@ public class Maze implements Listener
if(Host.GetState() == GameState.Live) if(Host.GetState() == GameState.Live)
{ {
UtilRadar.displayRadar(p, Arrays.asList(_safePadRadarData), false); UtilRadar.displayRadar(p, Arrays.asList(_safePadRadarData), true);
} }
} }
} }
if (Host.IsLive()) if (Host.IsLive())
{ {
//checkGoal(); //checkGoal();
@ -145,7 +155,20 @@ public class Maze implements Listener
move(); move();
bump(); bump();
removeMobsOnSafePad(); removeMobsOnSafePad();
if(_phaseTimer > 15)
if (_safePad == null && UtilTime.elapsed(_lastBeacon, 3000 + (1000 * UtilMath.r(10))))
{
try
{
spawnSafePad();
}
catch (Exception ex)
{
System.out.println("AN EXCEPTION OCCURED WHILE TRYING TO SPAWN A SAFE PAD!");
}
}
if (_phaseTimer > 15)
{ {
for(Player p : Host.GetPlayers(true)) for(Player p : Host.GetPlayers(true))
{ {
@ -356,6 +379,36 @@ public class Maze implements Listener
return cur; return cur;
} }
@SuppressWarnings("deprecation")
public void addSafeZone()
{
if (_safeZones.isEmpty())
return;
Location zone = _safeZones.remove(UtilMath.r(_safeZones.size()));
for (Block b : UtilBlock.getInBoundingBox(zone.clone().add(1, 0, 1), zone.clone().subtract(1, 0, 1), false))
{
for (int i = 0 ; i < 3 ; i++)
{
Block cur = b.getLocation().clone().subtract(0, i, 0).getBlock();
cur.getRelative(BlockFace.DOWN).setType(Material.STAINED_CLAY);
cur.getRelative(BlockFace.DOWN).setData((byte) 13);
}
Iterator<Location> iterator = _map.iterator();
while (iterator.hasNext())
{
Location loc = iterator.next();
if (loc.getBlockX() == b.getX() && loc.getBlockY() == b.getY() && loc.getBlockZ() == b.getZ())
{
iterator.remove();
}
}
}
}
public void fillSpawn(int numToSpawn) public void fillSpawn(int numToSpawn)
{ {
System.out.println("spawning " + numToSpawn + " entities on map"); System.out.println("spawning " + numToSpawn + " entities on map");
@ -442,65 +495,90 @@ public class Maze implements Listener
private void pickNextLocForSafePad() // short method name private void pickNextLocForSafePad() // short method name
{ {
ArrayList<Location> goals = new ArrayList<Location>(_goals); if (_oldSafePad != null)
if(_oldSafePad != null)
{ {
goals.clear(); _nextSafePadLoc = UtilAlg.findFurthest(_oldSafePad.getLocation(), _goals);
for(Location loc : _goals) }
{ else
if(UtilMath.offset2d(loc, _oldSafePad.getLocation()) > 60) {
{ _nextSafePadLoc = _goals.get(UtilMath.r(_goals.size()));
goals.add(loc);
}
}
} }
System.out.println("Picking next goal from " + goals.size() + " goals.");
_nextSafePadLoc = UtilAlg.Random(goals);
_safePadRadarData = new RadarData(_nextSafePadLoc, '\u25A0' + ""); _safePadRadarData = new RadarData(_nextSafePadLoc, '\u25A0' + "");
} }
private void stopSafePad()
{
if (_safePad != null)
{
_oldSafePad = _safePad;
_safePad = null;
_oldSafePad.turnOffBeacon();
_padDecayTimer = 11;
_oldDisabledWaypoints = new HashSet<Block>(_disabledWaypoints);
}
}
public void spawnSafePad() public void spawnSafePad()
{ {
if(_safePad != null) if (!_canSpawn)
{ return;
_oldSafePad = _safePad;
_oldSafePad.turnOffBeacon(); pickNextLocForSafePad();
_padDecayTimer = 11;
_oldDisabledWaypoints = new HashSet<>(_disabledWaypoints);
}
_disabledWaypoints.clear(); _disabledWaypoints.clear();
_canSpawn = false;
final Maze instance = this;
_safePad = new SafePad(Host, this, _nextSafePadLoc.clone().subtract(0,1,0)); // maybe don't need to clone() //Delay
_safePad.build(); final SafePad safePad = new SafePad(Host, instance, _nextSafePadLoc.clone().subtract(0, 1, 0)); // maybe don't need to clone()
safePad.build();
Iterator<Block> iter = _waypoints.iterator(); addSafeZone();
while (iter.hasNext()) {
Block b = iter.next(); //Delay for beacon.
if(UtilBlock.getInBoundingBox(_safePad.getLocation().clone().add(2, 0, 2), _safePad.getLocation().clone().add(-2, 0, -2)).contains(b.getRelative(BlockFace.DOWN))) Bukkit.getScheduler().scheduleSyncDelayedTask(Host.Manager.getPlugin(), new Runnable()
{
@Override
public void run()
{ {
_disabledWaypoints.add(b); _curSafe++;
iter.remove();
_canSpawn = true;
_safePad = safePad;
Host.Announce(F.main("Game", "A Safe Pad has spawned!"));
UtilTextMiddle.display("", C.cYellow + C.Bold + "A Safe Pad has spawned!", 5, 40, 5);
Iterator<Block> iter = _waypoints.iterator();
while (iter.hasNext()) {
Block b = iter.next();
if (UtilBlock.getInBoundingBox(_safePad.getLocation().clone().add(2, 0, 2), _safePad.getLocation().clone().add(-2, 0, -2)).contains(b.getRelative(BlockFace.DOWN)))
{
_disabledWaypoints.add(b);
iter.remove();
}
}
Iterator<Entity> it = _ents.keySet().iterator();
while (it.hasNext()) {
Entity e = it.next();
if (_safePad.isOn(e))
{
System.out.println("entity on newly spawned safepad removed");
_ents.remove(_ents.get(e));
it.remove();
e.remove();
}
}
Bukkit.getPluginManager().callEvent(new SafepadBuildEvent());
} }
} }, 50);
Iterator<Entity> it = _ents.keySet().iterator();
while (it.hasNext()) {
Entity e = it.next();
if(_safePad.isOn(e))
{
System.out.println("entity on newly spawned safepad removed");
_ents.remove(_ents.get(e));
it.remove();
e.remove();
}
}
Bukkit.getPluginManager().callEvent(new SafepadBuildEvent());
} }
public void decrementSafePadTime() public void decrementSafePadTime()
{ {
if(_padDecayTimer == -1) return; if(_padDecayTimer == -1) return;
@ -511,7 +589,7 @@ public class Maze implements Listener
{ {
if(_padDecayTimer == 10) if(_padDecayTimer == 10)
{ {
_oldSafePad.setGlassData((byte)5); // green _oldSafePad.setBreakData((byte)5); // green
_oldSafePad.turnOffBeacon(); _oldSafePad.turnOffBeacon();
_oldSafePad.setCrackedProgress(1); _oldSafePad.setCrackedProgress(1);
} }
@ -521,7 +599,7 @@ public class Maze implements Listener
} }
else if(_padDecayTimer == 8) else if(_padDecayTimer == 8)
{ {
_oldSafePad.setGlassData((byte)4); // yellow _oldSafePad.setBreakData((byte)4); // yellow
_oldSafePad.setCrackedProgress(3); _oldSafePad.setCrackedProgress(3);
} }
else if(_padDecayTimer == 7) else if(_padDecayTimer == 7)
@ -530,7 +608,7 @@ public class Maze implements Listener
} }
else if(_padDecayTimer == 6) else if(_padDecayTimer == 6)
{ {
_oldSafePad.setGlassData((byte)1); // orange _oldSafePad.setBreakData((byte)1); // orange
_oldSafePad.setCrackedProgress(5); _oldSafePad.setCrackedProgress(5);
} }
else if(_padDecayTimer == 5) else if(_padDecayTimer == 5)
@ -539,7 +617,7 @@ public class Maze implements Listener
} }
else if(_padDecayTimer == 4) else if(_padDecayTimer == 4)
{ {
_oldSafePad.setGlassData((byte)14); // red _oldSafePad.setBreakData((byte)14); // red
_oldSafePad.setCrackedProgress(7); _oldSafePad.setCrackedProgress(7);
} }
else if(_padDecayTimer == 3) else if(_padDecayTimer == 3)
@ -553,7 +631,8 @@ public class Maze implements Listener
else if(_padDecayTimer == 1) else if(_padDecayTimer == 1)
{ {
_oldSafePad.setCrackedProgress(-1); _oldSafePad.setCrackedProgress(-1);
_oldSafePad.destroy(); _oldSafePad.destroyBase();
_oldSafePad.destroySurface();
if(_oldDisabledWaypoints.size() > 0) if(_oldDisabledWaypoints.size() > 0)
{ {
@ -563,9 +642,11 @@ public class Maze implements Listener
} }
_oldDisabledWaypoints.clear(); _oldDisabledWaypoints.clear();
} }
_oldSafePad = null; // make sure mobs can go on it.
} }
} }
if(_padDecayTimer == 1) if (_padDecayTimer == 1)
{ {
_padDecayTimer = -1; _padDecayTimer = -1;
} }
@ -578,34 +659,32 @@ 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
{ {
UtilTextMiddle.display(C.cGreen + C.Bold + _phaseTimer, C.cWhite + "Seconds Left", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); UtilTextMiddle.display("", C.cGreen + C.Bold + _phaseTimer, 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.cGreen + C.Bold + _phaseTimer, C.cWhite + "Seconds Left", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); UtilTextMiddle.display("", C.cGreen + C.Bold + _phaseTimer, 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, C.cWhite + "Seconds Left", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); UtilTextMiddle.display("", C.cGreen + C.Bold + _phaseTimer, 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, C.cWhite + "Seconds Left", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); UtilTextMiddle.display("", C.cYellow + C.Bold + _phaseTimer, 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()]));
} }
if(_phaseTimer == 2) if(_phaseTimer == 2)
{ {
pickNextLocForSafePad(); UtilTextMiddle.display("", C.cGold + C.Bold + _phaseTimer, 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()]));
UtilFirework.playFirework(_nextSafePadLoc, Type.BALL, Color.ORANGE, false, false);
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, C.cWhite + "Seconds Left", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); UtilTextMiddle.display("", C.cRed + C.Bold + _phaseTimer, 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()]));
} }
if(_phaseTimer == 0) if(_phaseTimer == 0)
@ -614,6 +693,7 @@ public class Maze implements Listener
{ {
if(_safePad.isOn(p)) if(_safePad.isOn(p))
{ {
UtilTextMiddle.display("", C.cYellow + C.Bold + "The Safe Pad expired!", 5, 40, 5);
// maybe send them a happy message? =) // maybe send them a happy message? =)
// UtilPlayer.message(p, F.main("Game", "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!"));
} }
@ -622,15 +702,18 @@ public class Maze implements Listener
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.cRed + "You didn't make it to the Safe Pad!", 5, 40, 5, p); UtilTextMiddle.display("", C.cRed + C.Bold + "You didn't make it to the Safe Pad!", 5, 40, 5, p);
UtilPlayer.message(p, F.main("Game", "You didn't make it to the Safe Pad!")); UtilPlayer.message(p, F.main("Game", "You didn't make it to the Safe Pad!"));
} }
} }
spawn(15); spawn(15);
spawnSafePad();
stopSafePad();
_lastBeacon = System.currentTimeMillis();
_playersOnPad.clear(); _playersOnPad.clear();
//_phaseTimer = -1; //_phaseTimer = -1;
_phaseTimer = 90; _phaseTimer = 90 - (_curSafe * 3);
} }
} }
@ -659,18 +742,18 @@ public class Maze implements Listener
} }
} }
UtilTextMiddle.display(C.cYellow + C.Bold + "Safe Pad", C.cWhite + "You got to the Safe Pad first!", 5, 40, 5, p); UtilTextMiddle.display("", C.cYellow + C.Bold + "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.cYellow + C.Bold + "Safe Pad", C.cWhite + "You got to the Safe Pad!", 5, 40, 5, p); UtilTextMiddle.display("", C.cYellow + C.Bold + "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.cRed + C.Bold + "DANGER", C.cWhite + "Get back to the Safe Pad!", 0, 10, 0, p); UtilTextMiddle.display("", C.cRed + C.Bold + "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);
} }
} }

View File

@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.monstermaze;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
@ -71,6 +72,8 @@ public class MonsterMaze extends SoloGame
this.PrepareFreeze = false; this.PrepareFreeze = false;
this.HungerSet = 20;
registerStatTrackers( registerStatTrackers(
new SnowmanHitTracker(this), new SnowmanHitTracker(this),
new AbilityUseTracker(this), new AbilityUseTracker(this),
@ -97,32 +100,15 @@ public class MonsterMaze extends SoloGame
@EventHandler @EventHandler
public void GameStateChange(GameStateChangeEvent event) public void GameStateChange(GameStateChangeEvent event)
{ {
if(event.GetState() == GameState.Prepare) if(event.GetState() == GameState.Live)
{
//if(WorldData.MapName.contains("MonsterTest")) _monsterType = EntityType.CREEPER;
setupJumpers();
}
else if(event.GetState() == GameState.Live)
{ {
_maze.removePlayerContainmentUnit(); _maze.removePlayerContainmentUnit();
Announce(C.cYellow + C.Scramble + "@@" + C.cAqua + C.Bold + " Monster Maze is best played in 3rd Person! (Push F5) " + C.cYellow + C.Scramble + "@@"); Announce(C.cYellow + C.Scramble + "@@" + C.cAqua + C.Bold + " Monster Maze is best played in 3rd Person! (Push F5) " + C.cYellow + C.Scramble + "@@");
UtilTextMiddle.display(C.cYellow + C.Bold + "Push F5", C.cAqua + C.Bold + "Monster Maze is best played in 3rd Person!");
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)
{ {
@ -136,17 +122,6 @@ public class MonsterMaze extends SoloGame
} }
} }
private void setupJumpers()
{
for(Player p : GetPlayers(true))
{
if(GetKit(p) instanceof KitJumper)
{
setJumpsLeft(p, 5);
}
}
}
private void setJumpsLeft(Player player, int jumps) private void setJumpsLeft(Player player, int jumps)
{ {
if (jumps <= 0) if (jumps <= 0)
@ -202,7 +177,7 @@ public class MonsterMaze extends SoloGame
{ {
if (IsLive() && UtilInv.contains(pl, Material.FEATHER, (byte) 0, 1)) if (IsLive() && UtilInv.contains(pl, Material.FEATHER, (byte) 0, 1))
{ {
while (Manager.GetCondition().HasCondition(pl, ConditionType.JUMP, null)) while (Manager.GetCondition().GetActiveCondition(pl, ConditionType.JUMP) != null)
Manager.GetCondition().GetActiveCondition(pl, ConditionType.JUMP).Expire(); Manager.GetCondition().GetActiveCondition(pl, ConditionType.JUMP).Expire();
} }
else else
@ -211,16 +186,8 @@ public class MonsterMaze extends SoloGame
Manager.GetCondition().Factory().Jump("No jumping", pl, null, 9999999, 250, true, false, false); Manager.GetCondition().Factory().Jump("No jumping", pl, null, 9999999, 250, true, false, false);
} }
if (GetPlayers(true).size() > 4) if (!Manager.GetCondition().HasCondition(pl, ConditionType.INVISIBILITY, null))
{ Manager.GetCondition().Factory().Invisible("Hide players", pl, null, 9999999, 2, true, false, false);
if (!Manager.GetCondition().HasCondition(pl, ConditionType.INVISIBILITY, null))
Manager.GetCondition().Factory().Invisible("Hide players", pl, null, 9999999, 2, true, false, false);
}
else
{
while (Manager.GetCondition().HasCondition(pl, ConditionType.INVISIBILITY, null))
Manager.GetCondition().GetActiveCondition(pl, ConditionType.INVISIBILITY).Expire();
}
} }
} }
@ -278,8 +245,7 @@ public class MonsterMaze extends SoloGame
Scoreboard.Write(C.cYellow + C.Bold + "Players"); Scoreboard.Write(C.cYellow + C.Bold + "Players");
if (GetPlayers(true).size() > 6) if (GetPlayers(true).size() > 6)
{ {
Scoreboard.Write(C.cWhite + GetPlayers(true).size()); Scoreboard.Write(C.cWhite + GetPlayers(true).size());
} }
else else
@ -294,13 +260,13 @@ public class MonsterMaze extends SoloGame
Scoreboard.Write(C.cGreen + C.Bold + "Safe Pad"); Scoreboard.Write(C.cGreen + C.Bold + "Safe Pad");
if (IsLive()) if (_maze.getSafePad() != null)
{ {
Scoreboard.Write(C.cWhite + UtilTime.MakeStr(_maze.getPhaseTimer() * 1000)); Scoreboard.Write(C.cWhite + UtilTime.MakeStr(_maze.getPhaseTimer() * 1000));
} }
else else
{ {
Scoreboard.Write("Unknown"); Scoreboard.Write("None");
} }
Scoreboard.Draw(); Scoreboard.Draw();

View File

@ -3,11 +3,6 @@ package nautilus.game.arcade.game.games.monstermaze;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import mineplex.core.common.util.MapUtil; import mineplex.core.common.util.MapUtil;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle;
@ -17,6 +12,12 @@ import mineplex.core.common.util.UtilPlayer;
import net.minecraft.server.v1_7_R4.Packet; import net.minecraft.server.v1_7_R4.Packet;
import net.minecraft.server.v1_7_R4.PacketPlayOutBlockBreakAnimation; import net.minecraft.server.v1_7_R4.PacketPlayOutBlockBreakAnimation;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
public class SafePad public class SafePad
{ {
private MonsterMaze Host; private MonsterMaze Host;
@ -33,52 +34,61 @@ public class SafePad
_loc = loc; _loc = loc;
//beacon surface
for (int x = -2 ; x < 3 ; x++)
{
for (int z = -2 ; z < 3 ; z++)
{
if (x == 0 && z == 0)
continue;
_blocks.add(new SafePadBlock(loc.clone().add(x, 0, z), Material.STAINED_CLAY, (byte) 5));
}
}
// beacon // beacon
_blocks.add(new SafePadBlock(loc.clone().add(0, 0, 0), Material.BEACON, (byte)0)); _blocks.add(new SafePadBlock(loc.clone().add(0, 0, 0), Material.BEACON, (byte)0));
// beacon base // beacon base
_blocks.add(new SafePadBlock(loc.clone().add(-1, -1, -1), Material.GOLD_BLOCK, (byte)0)); for (int x = -1 ; x < 2 ; x++)
_blocks.add(new SafePadBlock(loc.clone().add(0, -1, -1), Material.GOLD_BLOCK, (byte)0)); {
_blocks.add(new SafePadBlock(loc.clone().add(1, -1, -1), Material.GOLD_BLOCK, (byte)0)); for (int z = -1 ; z < 2 ; z++)
{
_blocks.add(new SafePadBlock(loc.clone().add(x, -1, z), Material.IRON_BLOCK, (byte)0));
}
}
_blocks.add(new SafePadBlock(loc.clone().add(-1, -1, 0), Material.GOLD_BLOCK, (byte)0)); // corner blocks
_blocks.add(new SafePadBlock(loc.clone().add(0, -1, 0), Material.GOLD_BLOCK, (byte)0)); _blocks.add(new SafePadBlock(loc.clone().add(2, -1, 2), Material.QUARTZ_BLOCK, (byte) 1));
_blocks.add(new SafePadBlock(loc.clone().add(1, -1, 0), Material.GOLD_BLOCK, (byte)0)); _blocks.add(new SafePadBlock(loc.clone().add(-2, -1, 2), Material.QUARTZ_BLOCK, (byte) 1));
_blocks.add(new SafePadBlock(loc.clone().add(2, -1, -2), Material.QUARTZ_BLOCK, (byte) 1));
_blocks.add(new SafePadBlock(loc.clone().add(-2, -1, -2), Material.QUARTZ_BLOCK, (byte) 1));
_blocks.add(new SafePadBlock(loc.clone().add(-1, -1, 1), Material.GOLD_BLOCK, (byte)0)); // stairs
_blocks.add(new SafePadBlock(loc.clone().add(0, -1, 1), Material.GOLD_BLOCK, (byte)0)); _blocks.add(new SafePadBlock(loc.clone().add(-1, -1, 2), Material.QUARTZ_STAIRS, (byte) 7));
_blocks.add(new SafePadBlock(loc.clone().add(1, -1, 1), Material.GOLD_BLOCK, (byte)0)); _blocks.add(new SafePadBlock(loc.clone().add(0, -1, 2), Material.QUARTZ_STAIRS, (byte) 7));
_blocks.add(new SafePadBlock(loc.clone().add(1, -1, 2), Material.QUARTZ_STAIRS, (byte) 7));
// glass _blocks.add(new SafePadBlock(loc.clone().add(-1, -1, -2), Material.QUARTZ_STAIRS, (byte) 6));
_blocks.add(new SafePadBlock(loc.clone().add(-2, 0, -2), Material.STAINED_GLASS, (byte)5)); _blocks.add(new SafePadBlock(loc.clone().add(0, -1, -2), Material.QUARTZ_STAIRS, (byte) 6));
_blocks.add(new SafePadBlock(loc.clone().add(-1, 0, -2), Material.STAINED_GLASS, (byte)5)); _blocks.add(new SafePadBlock(loc.clone().add(1, -1, -2), Material.QUARTZ_STAIRS, (byte) 6));
_blocks.add(new SafePadBlock(loc.clone().add(0, 0, -2), Material.STAINED_GLASS, (byte)5));
_blocks.add(new SafePadBlock(loc.clone().add(1, 0, -2), Material.STAINED_GLASS, (byte)5)); _blocks.add(new SafePadBlock(loc.clone().add(2, -1, -1), Material.QUARTZ_STAIRS, (byte) 5));
_blocks.add(new SafePadBlock(loc.clone().add(2, 0, -2), Material.STAINED_GLASS, (byte)5)); _blocks.add(new SafePadBlock(loc.clone().add(2, -1, 0), Material.QUARTZ_STAIRS, (byte) 5));
_blocks.add(new SafePadBlock(loc.clone().add(2, -1, 1), Material.QUARTZ_STAIRS, (byte) 5));
_blocks.add(new SafePadBlock(loc.clone().add(-2, -1, -1), Material.QUARTZ_STAIRS, (byte) 4));
_blocks.add(new SafePadBlock(loc.clone().add(-2, -1, 0), Material.QUARTZ_STAIRS, (byte) 4));
_blocks.add(new SafePadBlock(loc.clone().add(-2, -1, 1), Material.QUARTZ_STAIRS, (byte) 4));
_blocks.add(new SafePadBlock(loc.clone().add(-2, 0, -1), Material.STAINED_GLASS, (byte)5)); // air slabs
_blocks.add(new SafePadBlock(loc.clone().add(-1, 0, -1), Material.STAINED_GLASS, (byte)5)); for (int x = -2 ; x < 3 ; x++)
_blocks.add(new SafePadBlock(loc.clone().add(0, 0, -1), Material.STAINED_GLASS, (byte)5)); {
_blocks.add(new SafePadBlock(loc.clone().add(1, 0, -1), Material.STAINED_GLASS, (byte)5)); for (int z = -2 ; z < 3 ; z++)
_blocks.add(new SafePadBlock(loc.clone().add(2, 0, -1), Material.STAINED_GLASS, (byte)5)); {
_blocks.add(new SafePadBlock(loc.clone().add(x, -2, z), Material.AIR, (byte) 0));
_blocks.add(new SafePadBlock(loc.clone().add(-2, 0, 0), Material.STAINED_GLASS, (byte)5)); }
_blocks.add(new SafePadBlock(loc.clone().add(-1, 0, 0), Material.STAINED_GLASS, (byte)5)); }
// (this is where the beacon is, so no glass)
_blocks.add(new SafePadBlock(loc.clone().add(1, 0, 0), Material.STAINED_GLASS, (byte)5));
_blocks.add(new SafePadBlock(loc.clone().add(2, 0, 0), Material.STAINED_GLASS, (byte)5));
_blocks.add(new SafePadBlock(loc.clone().add(-2, 0, 1), Material.STAINED_GLASS, (byte)5));
_blocks.add(new SafePadBlock(loc.clone().add(-1, 0, 1), Material.STAINED_GLASS, (byte)5));
_blocks.add(new SafePadBlock(loc.clone().add(0, 0, 1), Material.STAINED_GLASS, (byte)5));
_blocks.add(new SafePadBlock(loc.clone().add(1, 0, 1), Material.STAINED_GLASS, (byte)5));
_blocks.add(new SafePadBlock(loc.clone().add(2, 0, 1), Material.STAINED_GLASS, (byte)5));
_blocks.add(new SafePadBlock(loc.clone().add(-2, 0, 2), Material.STAINED_GLASS, (byte)5));
_blocks.add(new SafePadBlock(loc.clone().add(-1, 0, 2), Material.STAINED_GLASS, (byte)5));
_blocks.add(new SafePadBlock(loc.clone().add(0, 0, 2), Material.STAINED_GLASS, (byte)5));
_blocks.add(new SafePadBlock(loc.clone().add(1, 0, 2), Material.STAINED_GLASS, (byte)5));
_blocks.add(new SafePadBlock(loc.clone().add(2, 0, 2), Material.STAINED_GLASS, (byte)5));
} }
public class SafePadBlock public class SafePadBlock
@ -137,12 +147,14 @@ public class SafePad
public void build() public void build()
{ {
MapUtil.QuickChangeBlockAt(_loc, _tempMat.getId(), _tempData); MapUtil.QuickChangeBlockAt(_loc, _tempMat.getId(), _tempData);
_loc.getWorld().playEffect(_loc, Effect.STEP_SOUND, _loc.getBlock().getTypeId());
} }
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public void restore() public void restore()
{ {
MapUtil.QuickChangeBlockAt(_loc, _origM.getId(), _origD); MapUtil.QuickChangeBlockAt(_loc, _origM.getId(), _origD);
_loc.getWorld().playEffect(_loc, Effect.STEP_SOUND, _loc.getBlock().getTypeId());
} }
} }
@ -154,24 +166,28 @@ public class SafePad
} }
} }
public void setGlassData(byte newData) public void setBreakData(byte newData)
{ {
for(SafePadBlock spb : _blocks) for (SafePadBlock spb : _blocks)
{ {
if(!spb.getBlockMaterial().equals(Material.STAINED_GLASS)) continue; if (spb.getBlockMaterial() != Material.STAINED_CLAY)
continue;
spb.setData(newData); spb.setData(newData);
} }
} }
public void turnOffBeacon() public void turnOffBeacon()
{ {
for(SafePadBlock bl : _blocks) for (SafePadBlock bl : _blocks)
{ {
if(bl.getBlockMaterial().equals(Material.GOLD_BLOCK)) bl.restore(); if (bl.getBlockMaterial() == Material.IRON_BLOCK)
if(bl.getBlockMaterial().equals(Material.BEACON)) bl.setMaterial(Material.QUARTZ_BLOCK);
if (bl.getBlockMaterial() == Material.BEACON)
{ {
bl.setMaterial(Material.STAINED_GLASS); bl.setMaterial(Material.STAINED_CLAY);
bl.setData((byte)5); bl.setData((byte) 5);
} }
} }
} }
@ -184,9 +200,10 @@ public class SafePad
while(iter.hasNext()) while(iter.hasNext())
{ {
SafePadBlock spb = iter.next(); SafePadBlock spb = iter.next();
if(!spb.getLocation().getBlock().getType().equals(Material.STAINED_GLASS)) continue; if (!spb.getLocation().getBlock().getType().equals(Material.STAINED_CLAY))
continue;
UtilParticle.PlayParticle(ParticleType.BLOCK_DUST.getParticle(Material.STAINED_GLASS, spb.getBlockData()), spb.getLocation(), 0.5f, 0.5f, 0.5f, 0.05f, 8, ViewDist.NORMAL, Host.GetPlayers(false).toArray(new Player[Host.GetPlayers(false).size()])); UtilParticle.PlayParticle(ParticleType.BLOCK_DUST.getParticle(Material.STAINED_CLAY, spb.getBlockData()), spb.getLocation(), 0.5f, 0.5f, 0.5f, 0.05f, 8, ViewDist.NORMAL, Host.GetPlayers(false).toArray(new Player[Host.GetPlayers(false).size()]));
i++; i++;
@ -211,15 +228,29 @@ public class SafePad
} }
}*/ }*/
} }
public void destroy() public void destroyBase()
{ {
for(SafePadBlock bl : _blocks) for (final SafePadBlock bl : _blocks)
{ {
bl.restore(); if (bl.getBlockMaterial() == Material.QUARTZ_BLOCK || bl.getBlockMaterial() == Material.QUARTZ_STAIRS)
{
bl.restore();
}
} }
} }
public void destroySurface()
{
for (final SafePadBlock bl : _blocks)
{
if (bl.getBlockMaterial() != Material.QUARTZ_BLOCK && bl.getBlockMaterial() != Material.QUARTZ_STAIRS)
{
bl.restore();
}
}
}
public Location getLocation() public Location getLocation()
{ {
return _loc; return _loc;
@ -227,6 +258,6 @@ public class SafePad
public boolean isOn(Entity e) public boolean isOn(Entity e)
{ {
return UtilAlg.inBoundingBox(e.getLocation(), getLocation().clone().add(2, 0, 2), getLocation().clone().add(-2, 5, -2)); return UtilAlg.inBoundingBox(e.getLocation(), getLocation().clone().add(2.999, 5, 2), getLocation().clone().add(-2, 0, -2.999));
} }
} }