Particle changes

This commit is contained in:
Sam 2016-09-03 20:13:08 +01:00
parent 4b1c93150b
commit b3212fc003
3 changed files with 41 additions and 15 deletions

View File

@ -83,11 +83,8 @@ public enum GameDisplay
Valentines("Valentines Vendetta", Material.LEATHER, (byte)0, GameCategory.EXTRA, 61),
Basketball("Hoops", Material.SLIME_BALL, (byte)0, GameCategory.EXTRA, 63),
<<<<<<< HEAD
QuiverPayload("One in the Quiver Payload", Material.ARROW, (byte)0, GameCategory.ARCADE, 64),
=======
>>>>>>> refs/remotes/origin/develop
Event("Mineplex Event", Material.CAKE, (byte)0, GameCategory.EVENT, 999),

View File

@ -526,7 +526,7 @@ public class QuiverPayload extends TeamGame
return;
}
if (event.getType() == UpdateType.TWOSEC && _isOvertime)
if (event.getType() == UpdateType.SEC && _isOvertime)
{
if (_lastOvertimeTrack.isEmpty())
{
@ -595,6 +595,11 @@ public class QuiverPayload extends TeamGame
{
powerupGenerator.update();
}
for (SpawnBarrier spawnBarrier : _spawnBarrier)
{
spawnBarrier.playParticles();
}
_coloredMessage = !_coloredMessage;
@ -1130,7 +1135,12 @@ public class QuiverPayload extends TeamGame
@EventHandler
public void onCombatDeath(CombatDeathEvent event)
{
if (event.GetLog().GetKiller().GetName() == null || !(event.GetEvent().getEntity() instanceof Player))
if (event.GetEvent().getEntity() == null || event.GetLog().GetKiller().GetName() == null)
{
return;
}
if (!(event.GetEvent().getEntity() instanceof Player))
{
return;
}

View File

@ -37,19 +37,19 @@ public class SpawnBarrier
}
public void update()
{
{
for (Player player : _game.GetPlayers(true))
{
if (UtilPlayer.isSpectator(player))
{
continue;
}
if(_game.GetTeam(player).equals(_gameTeam))
if (_game.GetTeam(player).equals(_gameTeam))
{
continue;
}
}
for (Location location : _gameTeam.GetSpawns())
{
if (UtilMath.offset(player.getLocation(), location) < 5)
@ -57,24 +57,43 @@ public class SpawnBarrier
_game.Manager.GetDamage().NewDamageEvent(player, null, null, DamageCause.VOID, 9001, false, true, true, _game.GetName(), "Spawn Shield");
}
}
for (Location location : _barriers)
{
if (UtilMath.offset(player.getLocation(), location) < 3)
{
UtilAction.velocity(player, UtilAlg.getTrajectory(location, player.getLocation()).normalize().setY(0.4));
}
}
}
}
public void playParticles()
{
for (Player player : _game.GetPlayers(true))
{
if (UtilPlayer.isSpectator(player))
{
continue;
}
if (_game.GetTeam(player).equals(_gameTeam))
{
continue;
}
for (Location location : _barriers)
{
UtilParticle.PlayParticle(ParticleType.BARRIER, location.clone().add(0, 0.5, 0), 0, 0, 0, 0.1F, 1, ViewDist.SHORT, player);
}
}
}
public GameTeam getGameTeam()
{
{
return _gameTeam;
}
public Set<Location> getBlocks()
{
return _barriers;