THIS IS HALLOWEEN THIS IS HALLOWEEN

This commit is contained in:
Chiss 2013-10-29 10:41:53 +11:00
parent ab9cce3910
commit ad487e48bd
9 changed files with 95 additions and 36 deletions

View File

@ -551,35 +551,6 @@ public class HubManager extends MiniClientPlugin<HubClient>
{
return _visibilityManager;
}
@EventHandler
public void HeartDisplay(UpdateEvent event)
{
if (event.getType() != UpdateType.FASTER)
return;
for (Player player : UtilServer.getPlayers())
{
if (!player.isOp())
continue;
for (Player other : UtilServer.getPlayers())
{
if (player.getName().equalsIgnoreCase("Chiss"))
UtilParticle.PlayParticle(other, ParticleType.HEART, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 1);
else if (player.getName().equalsIgnoreCase("defek7"))
UtilParticle.PlayParticle(other, ParticleType.FIREWORKS_SPARK, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2);
else if (player.getName().equalsIgnoreCase("Spu_"))
UtilParticle.PlayParticle(other, ParticleType.FLAME, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2);
else if (player.getName().equalsIgnoreCase("sterling_"))
UtilParticle.PlayParticle(other, ParticleType.WITCH_MAGIC, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2);
}
}
}
public void SetPortalDelay(Entity ent)
{
@ -599,4 +570,35 @@ public class HubManager extends MiniClientPlugin<HubClient>
return UtilTime.elapsed(_portalTime.get(player.getName()), 5000);
}
@EventHandler
public void HeartDisplay(UpdateEvent event)
{
if (event.getType() != UpdateType.FASTER)
return;
for (Player player : UtilServer.getPlayers())
{
if (!player.isOp() && !player.getName().equals("MonsieurApple"))
continue;
for (Player other : UtilServer.getPlayers())
{
if (player.getName().equalsIgnoreCase("Chiss"))
UtilParticle.PlayParticle(other, ParticleType.HEART, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 1);
else if (player.getName().equalsIgnoreCase("defek7"))
UtilParticle.PlayParticle(other, ParticleType.FIREWORKS_SPARK, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2);
else if (player.getName().equalsIgnoreCase("Spu_"))
UtilParticle.PlayParticle(other, ParticleType.FLAME, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2);
else if (player.getName().equalsIgnoreCase("sterling_"))
UtilParticle.PlayParticle(other, ParticleType.WITCH_MAGIC, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2);
else if (player.getName().equalsIgnoreCase("MonsieurApple"))
UtilParticle.PlayParticle(other, ParticleType.SPLASH, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 10);
}
}
}
}

View File

@ -51,6 +51,9 @@ public class Halloween extends SoloGame
private int _maxMobs = 80;
private ArrayList<CreatureBase> _mobs = new ArrayList<CreatureBase>();
public long total = 0;
public long move = 0;
public Halloween(ArcadeManager manager)
{
@ -111,9 +114,26 @@ public class Halloween extends SoloGame
GetTeamList().add(new GameTeam("Pumpkin King", ChatColor.RED, WorldData.GetDataLocs("RED")));
}
@EventHandler(priority = EventPriority.MONITOR)
public void TimeReport(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC)
return;
System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
System.out.println("Total Time: " + UtilTime.convertString(total, 4, TimeUnit.MILLISECONDS));
System.out.println("Move Time: " + UtilTime.convertString(move, 4, TimeUnit.MILLISECONDS));
System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
total = 0;
move = 0;
}
@EventHandler
public void SoundUpdate(UpdateEvent event)
{
long start = System.currentTimeMillis();
if (event.getType() != UpdateType.SLOW)
return;
@ -125,11 +145,15 @@ public class Halloween extends SoloGame
for (Player player : UtilServer.getPlayers())
player.playSound(player.getLocation(), Sound.AMBIENCE_CAVE, 3f, 1f);
total += System.currentTimeMillis() - start;
}
@EventHandler
public void WaveUpdate(UpdateEvent event)
{
long start = System.currentTimeMillis();
if (event.getType() != UpdateType.TICK)
return;
@ -142,6 +166,8 @@ public class Halloween extends SoloGame
EndCheck();
}
total += System.currentTimeMillis() - start;
}
public ArrayList<Location> GetSpawnSet(int i)
@ -168,6 +194,8 @@ public class Halloween extends SoloGame
@EventHandler
public void CreatureMoveUpdate(UpdateEvent event)
{
long start = System.currentTimeMillis();
if (event.getType() != UpdateType.TICK)
return;
@ -184,11 +212,16 @@ public class Halloween extends SoloGame
}
_mobs.add(base);
total += System.currentTimeMillis() - start;
move += System.currentTimeMillis() - start;
}
@EventHandler
public void CreatureUpdate(UpdateEvent event)
{
long start = System.currentTimeMillis();
if (!IsLive())
return;
@ -201,20 +234,30 @@ public class Halloween extends SoloGame
if (base.Updater(event))
mobIterator.remove();
}
total += System.currentTimeMillis() - start;
}
@EventHandler
public void CreatureDamage(CustomDamageEvent event)
{
long start = System.currentTimeMillis();
for (CreatureBase base : _mobs)
base.Damage(event);
total += System.currentTimeMillis() - start;
}
@EventHandler
public void CreatureTarget(EntityTargetEvent event)
{
long start = System.currentTimeMillis();
for (CreatureBase base : _mobs)
base.Target(event);
total += System.currentTimeMillis() - start;
}
@EventHandler(priority = EventPriority.HIGHEST)

View File

@ -8,6 +8,7 @@ import nautilus.game.arcade.game.Game;
import org.bukkit.Location;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityTargetEvent;
public class MobCreeper extends CreatureBase<Creeper> implements InterfaceMove
@ -58,7 +59,8 @@ public class MobCreeper extends CreatureBase<Creeper> implements InterfaceMove
//Untarget
if (GetEntity().getTarget() != null)
{
if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10)
if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10 ||
(GetEntity().getTarget() instanceof Player && Host.IsAlive((Player)GetEntity().getTarget())))
{
GetEntity().setTarget(null);
}

View File

@ -8,6 +8,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.Game;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.entity.Zombie;
import org.bukkit.event.entity.EntityTargetEvent;
@ -64,7 +65,8 @@ public class MobPigZombie extends CreatureBase<Zombie> implements InterfaceMove
//Untarget
if (GetEntity().getTarget() != null)
{
if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10)
if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10 ||
(GetEntity().getTarget() instanceof Player && Host.IsAlive((Player)GetEntity().getTarget())))
{
GetEntity().setTarget(null);
}

View File

@ -8,6 +8,7 @@ import nautilus.game.arcade.game.Game;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.entity.Skeleton;
import org.bukkit.event.entity.EntityTargetEvent;
import org.bukkit.inventory.ItemStack;
@ -63,7 +64,8 @@ public class MobSkeletonArcher extends CreatureBase<Skeleton> implements Interfa
//Untarget
if (GetEntity().getTarget() != null)
{
if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10)
if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10 ||
(GetEntity().getTarget() instanceof Player && Host.IsAlive((Player)GetEntity().getTarget())))
{
GetEntity().setTarget(null);
}

View File

@ -9,6 +9,7 @@ import nautilus.game.arcade.game.Game;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.entity.Zombie;
import org.bukkit.event.entity.EntityTargetEvent;
import org.bukkit.inventory.ItemStack;
@ -66,7 +67,8 @@ public class MobSkeletonWarrior extends CreatureBase<Zombie> implements Interfac
//Untarget
if (GetEntity().getTarget() != null)
{
if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10)
if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10 ||
(GetEntity().getTarget() instanceof Player && Host.IsAlive((Player)GetEntity().getTarget())))
{
GetEntity().setTarget(null);
}

View File

@ -12,6 +12,7 @@ import nautilus.game.arcade.game.Game;
import org.bukkit.Location;
import org.bukkit.entity.CaveSpider;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityTargetEvent;
public class MobSpiderLeaper extends CreatureBase<CaveSpider> implements InterfaceMove
@ -82,7 +83,8 @@ public class MobSpiderLeaper extends CreatureBase<CaveSpider> implements Interfa
//Untarget
if (GetEntity().getTarget() != null)
{
if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10)
if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10 ||
(GetEntity().getTarget() instanceof Player && Host.IsAlive((Player)GetEntity().getTarget())))
{
GetEntity().setTarget(null);
}

View File

@ -9,6 +9,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.Game;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.entity.Zombie;
import org.bukkit.event.entity.EntityTargetEvent;
@ -63,7 +64,8 @@ public class MobSpiderSmasher extends CreatureBase<Zombie> implements InterfaceM
//Untarget
if (GetEntity().getTarget() != null)
{
if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10)
if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10 ||
(GetEntity().getTarget() instanceof Player && Host.IsAlive((Player)GetEntity().getTarget())))
{
GetEntity().setTarget(null);
}

View File

@ -8,6 +8,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.Game;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.entity.Zombie;
import org.bukkit.event.entity.EntityTargetEvent;
@ -53,7 +54,8 @@ public class MobZombie extends CreatureBase<Zombie> implements InterfaceMove
//Untarget
if (GetEntity().getTarget() != null)
{
if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10)
if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10 ||
(GetEntity().getTarget() instanceof Player && Host.IsAlive((Player)GetEntity().getTarget())))
{
GetEntity().setTarget(null);
}