some more stuff on the checklist
This commit is contained in:
parent
efbabb1519
commit
62c49fa8e6
@ -19,6 +19,7 @@ import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTextBottom;
|
||||
import mineplex.core.common.util.UtilTextMiddle;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.disguise.disguises.DisguiseGuardian;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
@ -37,15 +38,15 @@ import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftGuardian;
|
||||
import org.bukkit.entity.ArmorStand;
|
||||
import org.bukkit.entity.Guardian;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Zombie;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.BlockGrowEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.EntityCombustEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
@ -58,7 +59,8 @@ public class SpeedBuilder extends SoloGame
|
||||
private SpeedBuilderState _state = SpeedBuilderState.Viewing;
|
||||
private long _stateTime = System.currentTimeMillis();
|
||||
|
||||
private int _countStage;
|
||||
private int _buildCountStage;
|
||||
private int _viewCountStage;
|
||||
|
||||
private int _buildTime = 35;
|
||||
|
||||
@ -71,7 +73,8 @@ public class SpeedBuilder extends SoloGame
|
||||
|
||||
private NautHashMap<Player, RecreationData> _buildRecreations = new NautHashMap<Player, RecreationData>();
|
||||
|
||||
private Guardian _judgeGuardian;
|
||||
private Zombie _judgeEntity;
|
||||
private DisguiseGuardian _judgeDisguise;
|
||||
private ArmorStand _judgeSupport;
|
||||
private Location _judgeSpawn;
|
||||
private ArmorStand _judgeLaserTarget;
|
||||
@ -202,28 +205,35 @@ public class SpeedBuilder extends SoloGame
|
||||
{
|
||||
CreatureAllowOverride = true;
|
||||
|
||||
_judgeGuardian = _judgeSpawn.getWorld().spawn(_judgeSpawn, Guardian.class);
|
||||
_judgeEntity = _judgeSpawn.getWorld().spawn(_judgeSpawn, Zombie.class);
|
||||
_judgeSupport = _judgeSpawn.getWorld().spawn(_judgeSpawn, ArmorStand.class);
|
||||
|
||||
CreatureAllowOverride = false;
|
||||
|
||||
UtilEnt.Vegetate(_judgeGuardian, true);
|
||||
UtilEnt.Vegetate(_judgeEntity, true);
|
||||
|
||||
_judgeGuardian.setElder(true);
|
||||
_judgeDisguise = new DisguiseGuardian(_judgeEntity);
|
||||
|
||||
_judgeDisguise.setElder(true);
|
||||
|
||||
Manager.GetDisguise().disguise(_judgeDisguise);
|
||||
|
||||
_judgeSupport.setVisible(false);
|
||||
_judgeSupport.setGravity(false);
|
||||
_judgeSupport.setSmall(true);
|
||||
|
||||
_judgeSupport.setPassenger(_judgeGuardian);
|
||||
_judgeSupport.setPassenger(_judgeEntity);
|
||||
}
|
||||
|
||||
public void despawnJudge()
|
||||
{
|
||||
_judgeGuardian.remove();
|
||||
Manager.GetDisguise().undisguise(_judgeEntity);
|
||||
|
||||
_judgeEntity.remove();
|
||||
_judgeSupport.remove();
|
||||
|
||||
_judgeGuardian = null;
|
||||
_judgeDisguise = null;
|
||||
_judgeEntity = null;
|
||||
_judgeSupport = null;
|
||||
}
|
||||
|
||||
@ -234,7 +244,9 @@ public class SpeedBuilder extends SoloGame
|
||||
if (_judgeLaserTarget == null)
|
||||
return;
|
||||
|
||||
((CraftGuardian) _judgeGuardian).getHandle().getDataWatcher().watch(17, 0);
|
||||
_judgeDisguise.setTarget(0);
|
||||
|
||||
Manager.GetDisguise().updateDisguise(_judgeDisguise);
|
||||
|
||||
_judgeLaserTarget.remove();
|
||||
|
||||
@ -247,7 +259,7 @@ public class SpeedBuilder extends SoloGame
|
||||
|
||||
CreatureAllowOverride = true;
|
||||
|
||||
_judgeLaserTarget = _judgeGuardian.getWorld().spawn(loc, ArmorStand.class);
|
||||
_judgeLaserTarget = _judgeEntity.getWorld().spawn(loc, ArmorStand.class);
|
||||
|
||||
CreatureAllowOverride = false;
|
||||
|
||||
@ -255,12 +267,24 @@ public class SpeedBuilder extends SoloGame
|
||||
_judgeLaserTarget.setGravity(false);
|
||||
_judgeLaserTarget.setSmall(true);
|
||||
|
||||
UtilEnt.CreatureLook(_judgeGuardian, _judgeLaserTarget.getLocation());
|
||||
UtilEnt.CreatureLook(_judgeEntity, _judgeLaserTarget.getLocation());
|
||||
|
||||
((CraftGuardian) _judgeGuardian).getHandle().getDataWatcher().watch(17, _judgeLaserTarget.getEntityId());
|
||||
_judgeDisguise.setTarget(_judgeLaserTarget.getEntityId());
|
||||
|
||||
Manager.GetDisguise().updateDisguise(_judgeDisguise);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPrepare(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.Prepare)
|
||||
return;
|
||||
|
||||
spawnJudge();
|
||||
//GUARDIAN LAZORZ WILL ROXORZ YOUR BOXORZ
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onLive(GameStateChangeEvent event)
|
||||
{
|
||||
@ -415,7 +439,10 @@ public class SpeedBuilder extends SoloGame
|
||||
ItemPickup = true;
|
||||
BlockPlace = true;
|
||||
|
||||
_countStage = 0;
|
||||
_buildCountStage = 0;
|
||||
|
||||
//Sometimes it doesn't show in the update method
|
||||
UtilTextMiddle.display("", C.cRed + "View Time Over!");
|
||||
|
||||
Announce(F.main("Build", "Recreate the build shown."));
|
||||
|
||||
@ -475,9 +502,6 @@ public class SpeedBuilder extends SoloGame
|
||||
|
||||
pasteBuildInCenter(_currentBuild);
|
||||
|
||||
//SIGILS AND HIS GUARDIANS
|
||||
spawnJudge();
|
||||
|
||||
setSpeedBuilderState(SpeedBuilderState.Reviewing);
|
||||
}
|
||||
}
|
||||
@ -491,8 +515,6 @@ public class SpeedBuilder extends SoloGame
|
||||
{
|
||||
clearCenterArea(true);
|
||||
|
||||
despawnJudge();
|
||||
|
||||
_currentBuild = UtilAlg.Random(_buildData);
|
||||
|
||||
for (RecreationData recreation : _buildRecreations.values())
|
||||
@ -503,7 +525,7 @@ public class SpeedBuilder extends SoloGame
|
||||
if (_buildTime > 1)
|
||||
_buildTime--;
|
||||
|
||||
UtilTextMiddle.display("", C.cRed + "Next Build Commencing...");
|
||||
_viewCountStage = 0;
|
||||
|
||||
Announce(F.main("Build", "You will recreate this build."));
|
||||
|
||||
@ -544,6 +566,9 @@ public class SpeedBuilder extends SoloGame
|
||||
_buildRecreations.remove(eliminating.Player);
|
||||
|
||||
eliminating.Player.damage(9001);
|
||||
|
||||
if (_toEliminate.isEmpty() && GetPlayers(true).size() > 1)
|
||||
UtilTextMiddle.display("", C.cRed + "Next Build Commencing...");
|
||||
}
|
||||
}, 40L);
|
||||
}
|
||||
@ -583,17 +608,40 @@ public class SpeedBuilder extends SoloGame
|
||||
if (_state != SpeedBuilderState.Building)
|
||||
return;
|
||||
|
||||
if (UtilTime.elapsed(_stateTime, 1000 * _countStage))
|
||||
if (UtilTime.elapsed(_stateTime, 1000 * _buildCountStage))
|
||||
{
|
||||
ArrayList<Player> players = new ArrayList<Player>(UtilServer.getServer().getOnlinePlayers());
|
||||
players.removeAll(_perfectBuild.keySet());
|
||||
|
||||
if (_countStage == _buildTime)
|
||||
if (_buildCountStage == _buildTime)
|
||||
UtilTextMiddle.display("", C.cRed + "TIME'S UP!");
|
||||
else if (_countStage >= _buildTime - 5)
|
||||
UtilTextMiddle.display("", C.cGreen + (_buildTime - _countStage), players.toArray(new Player[0]));
|
||||
else if (_buildCountStage >= _buildTime - 5)
|
||||
UtilTextMiddle.display("", C.cGreen + (_buildTime - _buildCountStage), players.toArray(new Player[0]));
|
||||
|
||||
_countStage++;
|
||||
_buildCountStage++;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void viewCountdown(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
if (_state != SpeedBuilderState.Viewing)
|
||||
return;
|
||||
|
||||
if (UtilTime.elapsed(_stateTime, _viewCountStage * 1000))
|
||||
{
|
||||
if (_viewCountStage == 10)
|
||||
UtilTextMiddle.display("", C.cRed + "View Time Over!");
|
||||
else
|
||||
UtilTextMiddle.display("", C.cGreen + (10 - _viewCountStage));
|
||||
|
||||
_viewCountStage++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -665,6 +713,13 @@ public class SpeedBuilder extends SoloGame
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void stopJudgeCombust(EntityCombustEvent event)
|
||||
{
|
||||
if (event.getEntity().equals(_judgeEntity))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler
|
||||
public void ScoreboardUpdate(UpdateEvent event)
|
||||
|
@ -1,6 +1,5 @@
|
||||
package nautilus.game.arcade.game.games.speedbuilder.data;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.MapUtil;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.hologram.Hologram;
|
||||
@ -33,7 +32,7 @@ public class DemolitionData
|
||||
|
||||
public void spawnHologram()
|
||||
{
|
||||
_hologram = new Hologram(Parent.Game.Manager.getHologramManager(), Block.getLocation().add(0.5, 0.5, 0.5), C.cGreen + "3");
|
||||
_hologram = new Hologram(Parent.Game.Manager.getHologramManager(), Block.getLocation().add(0.5, 0.5, 0.5), "3");
|
||||
|
||||
_hologram.start();
|
||||
}
|
||||
@ -52,13 +51,9 @@ public class DemolitionData
|
||||
if (secondsLeft < 0)
|
||||
secondsLeft = 0;
|
||||
|
||||
if (secondsLeft == 3)
|
||||
_hologram.setText(C.cGreen + "3");
|
||||
else if (secondsLeft == 2)
|
||||
_hologram.setText(C.cGold + "2");
|
||||
else if (secondsLeft == 1)
|
||||
_hologram.setText(C.cRed + "1");
|
||||
else if (secondsLeft == 0)
|
||||
_hologram.setText("" + secondsLeft);
|
||||
|
||||
if (secondsLeft == 0)
|
||||
breakBlock();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user