Bounce baby bounce.
This commit is contained in:
parent
d709071feb
commit
c021fbf9ed
@ -16,9 +16,11 @@ import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
|||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.UtilAction;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilTextMiddle;
|
import mineplex.core.common.util.UtilTextMiddle;
|
||||||
|
import mineplex.core.recharge.Recharge;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import nautilus.game.arcade.ArcadeManager;
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
@ -352,6 +354,17 @@ public class Gladiators extends SoloGame
|
|||||||
|
|
||||||
if (closest != _playerArenas.get(p))
|
if (closest != _playerArenas.get(p))
|
||||||
{
|
{
|
||||||
|
if (_playerArenas.get(p).getColour().furtherOut(closest.getColour()))
|
||||||
|
{
|
||||||
|
// No going backwards. Bounce baby bounce.
|
||||||
|
if (Recharge.Instance.use(p, "Arena Bounce", 500, false, false))
|
||||||
|
{
|
||||||
|
UtilAction.velocity(p, UtilAlg.getTrajectory2d(e.getTo(), p.getLocation()), 1.7, true, 0.5, 0, 5, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Manager.getPluginManager().callEvent(new PlayerChangeArenaEvent(e.getPlayer(), closest, _playerArenas.get(p)));
|
Manager.getPluginManager().callEvent(new PlayerChangeArenaEvent(e.getPlayer(), closest, _playerArenas.get(p)));
|
||||||
_playerArenas.put(p, closest);
|
_playerArenas.put(p, closest);
|
||||||
}
|
}
|
||||||
@ -608,16 +621,4 @@ public class Gladiators extends SoloGame
|
|||||||
{
|
{
|
||||||
return _roundState;
|
return _roundState;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void arenaBounce(UpdateEvent e)
|
|
||||||
{
|
|
||||||
if (e.getType() != UpdateType.TICK)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (Player p : GetPlayers(true))
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user