This commit is contained in:
Mysticate 2015-09-30 22:31:03 -04:00
parent 4a023c4644
commit a6d7cccbe5
4 changed files with 39 additions and 16 deletions

View File

@ -736,7 +736,7 @@ public enum Achievement
MONSTER_MAZE_SURVIVAL("Die Already!", 1200, MONSTER_MAZE_SURVIVAL("Die Already!", 1200,
new String[]{"Monster Maze.ToughCompetition"}, new String[]{"Monster Maze.ToughCompetition"},
new String[]{"Survive past the 15th Safe Pad"}, new String[]{"Survive past the 10th Safe Pad"},
new int[]{1}, new int[]{1},
AchievementCategory.MONSTER_MAZE), AchievementCategory.MONSTER_MAZE),

View File

@ -141,12 +141,36 @@ public class Maze implements Listener
return _curSafe; return _curSafe;
} }
public boolean isOnPad(Player player) public boolean isOnPad(Player player, boolean checkNotActive )
{ {
if (_safePad == null) if (_safePad == null)
return false; return false;
return _safePad.isOn(player); if (_safePad.isOn(player))
return true;
if (checkNotActive)
{
for (SafePad pad : _oldSafePads)
{
if (pad.isOn(player))
{
return true;
}
}
if (_nextSafePad != null)
{
if (_nextSafePad.isOn(player))
{
return true;
}
}
return false;
}
return false;
} }
@EventHandler @EventHandler
@ -252,8 +276,8 @@ public class Maze implements Listener
} }
return; return;
} }
float percentage = (float) Math.min(Math.max(_phaseTimer / 15, 0), 1); float percentage = (float) Math.min(Math.max(_phaseTimer / Math.max(6, 16 - (_curSafe - 1)), 0), 1);
for (Player p : _host.GetPlayers(true)) for (Player p : _host.GetPlayers(true))
{ {
p.setExp(percentage); p.setExp(percentage);
@ -297,7 +321,7 @@ public class Maze implements Listener
if (!Recharge.Instance.usable(player, "Monster Hit")) if (!Recharge.Instance.usable(player, "Monster Hit"))
continue; continue;
if (isOnPad(player)) if (isOnPad(player, true))
continue; continue;
//Hit Snowman //Hit Snowman
@ -893,33 +917,33 @@ 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 + (int) _phaseTimer, 5, 40, 5, _host.GetPlayers(true).toArray(new Player[_host.GetPlayers(true).size()])); UtilTextMiddle.display("", C.cGreen + C.Bold + (int) _phaseTimer, 5, 40, 5);
} }
if(_phaseTimer == 15 || _phaseTimer == 10) if(_phaseTimer == 15 || _phaseTimer == 10)
{ {
UtilTextMiddle.display("", C.cGreen + C.Bold + (int) _phaseTimer, 5, 40, 5, _host.GetPlayers(true).toArray(new Player[_host.GetPlayers(true).size()])); UtilTextMiddle.display("", C.cGreen + C.Bold + (int) _phaseTimer, 5, 40, 5);
} }
if(_phaseTimer == 5 || _phaseTimer == 4) if(_phaseTimer == 5 || _phaseTimer == 4)
{ {
UtilTextMiddle.display("", C.cGreen + C.Bold + (int) _phaseTimer, 5, 40, 5, _host.GetPlayers(true).toArray(new Player[_host.GetPlayers(true).size()])); UtilTextMiddle.display("", C.cGreen + C.Bold + (int) _phaseTimer, 5, 40, 5);
} }
if(_phaseTimer == 3) if(_phaseTimer == 3)
{ {
UtilTextMiddle.display("", C.cYellow + C.Bold + (int) _phaseTimer, 5, 40, 5, _host.GetPlayers(true).toArray(new Player[_host.GetPlayers(true).size()])); UtilTextMiddle.display("", C.cYellow + C.Bold + (int) _phaseTimer, 5, 40, 5);
} }
if(_phaseTimer == 2) if(_phaseTimer == 2)
{ {
UtilTextMiddle.display("", C.cGold + C.Bold + (int) _phaseTimer, 5, 40, 5, _host.GetPlayers(true).toArray(new Player[_host.GetPlayers(true).size()])); UtilTextMiddle.display("", C.cGold + C.Bold + (int) _phaseTimer, 5, 40, 5);
spawnSafePad(); spawnSafePad();
} }
if(_phaseTimer == 1) if(_phaseTimer == 1)
{ {
UtilTextMiddle.display("", C.cRed + C.Bold + (int) _phaseTimer, 5, 40, 5, _host.GetPlayers(true).toArray(new Player[_host.GetPlayers(true).size()])); UtilTextMiddle.display("", C.cRed + C.Bold + (int) _phaseTimer, 5, 40, 5);
} }
if(_phaseTimer == 0) if(_phaseTimer == 0)

View File

@ -12,7 +12,6 @@ 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.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
@ -138,14 +137,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()); // _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()); // _loc.getWorld().playEffect(_loc, Effect.STEP_SOUND, _loc.getBlock().getTypeId());
} }
} }

View File

@ -71,7 +71,7 @@ public class PilotTracker extends StatTracker<MonsterMaze>
{ {
_launched.remove(player); _launched.remove(player);
if (getGame().getMaze().isOnPad(player)) if (getGame().getMaze().isOnPad(player, false))
{ {
addStat(player); addStat(player);
} }