Halloween event changes
This commit is contained in:
parent
5563d94111
commit
b74b8e3915
@ -6,6 +6,7 @@ import org.bukkit.entity.Skeleton.SkeletonType;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.disguise.disguises.DisguiseSkeleton;
|
import mineplex.core.disguise.disguises.DisguiseSkeleton;
|
||||||
import mineplex.hub.gadget.GadgetManager;
|
import mineplex.hub.gadget.GadgetManager;
|
||||||
import mineplex.hub.gadget.types.ArmorGadget;
|
import mineplex.hub.gadget.types.ArmorGadget;
|
||||||
@ -18,14 +19,28 @@ public class Halloween2013_Helmet extends ArmorGadget
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Enable(Player player)
|
public void Enable(final Player player)
|
||||||
{
|
{
|
||||||
this.ApplyArmor(player);
|
this.ApplyArmor(player);
|
||||||
|
|
||||||
DisguiseSkeleton disguise = new DisguiseSkeleton(player);
|
DisguiseSkeleton disguise = new DisguiseSkeleton(player);
|
||||||
|
disguise.showArmor();
|
||||||
disguise.SetName(player.getName());
|
disguise.SetName(player.getName());
|
||||||
|
disguise.SetCustomNameVisible(true);
|
||||||
disguise.SetSkeletonType(SkeletonType.WITHER);
|
disguise.SetSkeletonType(SkeletonType.WITHER);
|
||||||
Manager.Manager.GetDisguise().disguise(disguise);
|
Manager.Manager.GetDisguise().disguise(disguise);
|
||||||
|
|
||||||
|
Manager.Manager.GetPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.Manager.GetPlugin(), new Runnable()
|
||||||
|
{
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
for (Player other : UtilServer.getPlayers())
|
||||||
|
{
|
||||||
|
other.hidePlayer(player);
|
||||||
|
other.showPlayer(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -77,11 +77,11 @@ public class ParkourManager extends MiniPlugin
|
|||||||
_lavaParkourReturn.setYaw(90);
|
_lavaParkourReturn.setYaw(90);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean InParkour(Player player)
|
public boolean InParkour(LivingEntity ent)
|
||||||
{
|
{
|
||||||
for (ParkourData data : _parkour)
|
for (ParkourData data : _parkour)
|
||||||
{
|
{
|
||||||
if (UtilMath.offset(player.getLocation(), data.Location) < data.Distance)
|
if (UtilMath.offset(ent.getLocation(), data.Location) < data.Distance)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -125,6 +125,14 @@ public class Mount implements Listener
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Parkour
|
||||||
|
if (Manager.Manager.GetParkour().InParkour(horse))
|
||||||
|
{
|
||||||
|
horse.remove();
|
||||||
|
activeIterator.remove();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
//Move
|
//Move
|
||||||
EntityCreature ec = ((CraftCreature)horse).getHandle();
|
EntityCreature ec = ((CraftCreature)horse).getHandle();
|
||||||
Navigation nav = ec.getNavigation();
|
Navigation nav = ec.getNavigation();
|
||||||
@ -146,6 +154,13 @@ public class Mount implements Listener
|
|||||||
|
|
||||||
public void Enable(Player player)
|
public void Enable(Player player)
|
||||||
{
|
{
|
||||||
|
//Parkour
|
||||||
|
if (Manager.Manager.GetParkour().InParkour(player))
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, F.main("Mount", "You cannot use Mounts near Parkour."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//Remove other mounts
|
//Remove other mounts
|
||||||
Manager.DeregisterAll(player);
|
Manager.DeregisterAll(player);
|
||||||
|
|
||||||
|
@ -80,11 +80,11 @@ public class Halloween extends SoloGame
|
|||||||
_spawns.add(WorldData.GetDataLocs("BLUE"));
|
_spawns.add(WorldData.GetDataLocs("BLUE"));
|
||||||
|
|
||||||
_waves = new ArrayList<WaveBase>();
|
_waves = new ArrayList<WaveBase>();
|
||||||
_waves.add(new Wave1(this));
|
//_waves.add(new Wave1(this));
|
||||||
_waves.add(new Wave2(this));
|
//_waves.add(new Wave2(this));
|
||||||
_waves.add(new Wave3(this));
|
//_waves.add(new Wave3(this));
|
||||||
//_waves.add(new Wave4(this));
|
//_waves.add(new Wave4(this));
|
||||||
//_waves.add(new Wave5(this));
|
_waves.add(new Wave5(this));
|
||||||
//_waves.add(new Wave6(this));
|
//_waves.add(new Wave6(this));
|
||||||
_waves.add(new WaveBoss(this));
|
_waves.add(new WaveBoss(this));
|
||||||
_waves.add(new WaveVictory(this));
|
_waves.add(new WaveVictory(this));
|
||||||
|
@ -1,14 +1,20 @@
|
|||||||
package nautilus.game.arcade.game.games.halloween.creatures;
|
package nautilus.game.arcade.game.games.halloween.creatures;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
import mineplex.core.common.util.UtilBlock;
|
import mineplex.core.common.util.UtilBlock;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
import nautilus.game.arcade.game.Game;
|
import nautilus.game.arcade.game.Game;
|
||||||
|
import net.minecraft.server.v1_6_R3.Entity;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftGhast;
|
||||||
|
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Ghast;
|
import org.bukkit.entity.Ghast;
|
||||||
import org.bukkit.event.entity.EntityTargetEvent;
|
import org.bukkit.event.entity.EntityTargetEvent;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class MobGhast extends CreatureBase<Ghast>
|
public class MobGhast extends CreatureBase<Ghast>
|
||||||
{
|
{
|
||||||
@ -20,7 +26,8 @@ public class MobGhast extends CreatureBase<Ghast>
|
|||||||
@Override
|
@Override
|
||||||
public void SpawnCustom(Ghast ent)
|
public void SpawnCustom(Ghast ent)
|
||||||
{
|
{
|
||||||
ent.teleport(new Location(ent.getWorld(), 0, 50, 0));
|
UtilEnt.Vegetate(ent);
|
||||||
|
((CraftGhast)GetEntity()).getHandle().a(1f, 1f, 0.02f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -38,10 +45,13 @@ public class MobGhast extends CreatureBase<Ghast>
|
|||||||
@Override
|
@Override
|
||||||
public void Update(UpdateEvent event)
|
public void Update(UpdateEvent event)
|
||||||
{
|
{
|
||||||
|
if (true)
|
||||||
|
return;
|
||||||
|
|
||||||
if (event.getType() == UpdateType.TICK)
|
if (event.getType() == UpdateType.TICK)
|
||||||
Move();
|
Move();
|
||||||
|
|
||||||
if (event.getType() == UpdateType.FASTER)
|
if (event.getType() == UpdateType.SEC)
|
||||||
Destroy();
|
Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,6 +62,13 @@ public class MobGhast extends CreatureBase<Ghast>
|
|||||||
|
|
||||||
private void Move()
|
private void Move()
|
||||||
{
|
{
|
||||||
|
if (GetTarget() == null)
|
||||||
|
SetTarget(GetPlayerTarget());
|
||||||
|
|
||||||
|
Vector vel = UtilAlg.getTrajectory(GetEntity().getLocation(), GetTarget());
|
||||||
|
|
||||||
|
((CraftGhast)GetEntity()).getHandle().i = GetTarget().getX();
|
||||||
|
((CraftGhast)GetEntity()).getHandle().j = GetTarget().getY();
|
||||||
|
((CraftGhast)GetEntity()).getHandle().bn = GetTarget().getZ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ import nautilus.game.arcade.game.Game;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Giant;
|
import org.bukkit.entity.Giant;
|
||||||
import org.bukkit.event.entity.EntityTargetEvent;
|
import org.bukkit.event.entity.EntityTargetEvent;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class MobGiant extends CreatureBase<Giant>
|
public class MobGiant extends CreatureBase<Giant>
|
||||||
@ -37,6 +38,9 @@ public class MobGiant extends CreatureBase<Giant>
|
|||||||
{
|
{
|
||||||
if (event.GetDamageeEntity().equals(GetEntity()))
|
if (event.GetDamageeEntity().equals(GetEntity()))
|
||||||
event.SetKnockback(false);
|
event.SetKnockback(false);
|
||||||
|
|
||||||
|
if (event.GetCause() == DamageCause.SUFFOCATION)
|
||||||
|
event.SetCancelled("Suffocation Cancel");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -26,6 +26,7 @@ public class MobZombie extends CreatureBase<Zombie>
|
|||||||
public void SpawnCustom(Zombie ent)
|
public void SpawnCustom(Zombie ent)
|
||||||
{
|
{
|
||||||
Move();
|
Move();
|
||||||
|
Host.Manager.GetCondition().Factory().Speed("Zombie", ent, ent, 99999, 0, false, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -73,11 +74,11 @@ public class MobZombie extends CreatureBase<Zombie>
|
|||||||
|
|
||||||
target.add(UtilAlg.getTrajectory(GetEntity().getLocation(), GetTarget()).multiply(12));
|
target.add(UtilAlg.getTrajectory(GetEntity().getLocation(), GetTarget()).multiply(12));
|
||||||
|
|
||||||
nav.a(target.getX(), target.getY(), target.getZ(), 1.6f);
|
nav.a(target.getX(), target.getY(), target.getZ(), 1f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nav.a(GetTarget().getX(), GetTarget().getY(), GetTarget().getZ(), 1.2f);
|
nav.a(GetTarget().getX(), GetTarget().getY(), GetTarget().getZ(), 1f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.halloween.waves;
|
|||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
import nautilus.game.arcade.game.games.halloween.Halloween;
|
import nautilus.game.arcade.game.games.halloween.Halloween;
|
||||||
import nautilus.game.arcade.game.games.halloween.creatures.MobCreeper;
|
import nautilus.game.arcade.game.games.halloween.creatures.MobCreeper;
|
||||||
|
import nautilus.game.arcade.game.games.halloween.creatures.MobGhast;
|
||||||
import nautilus.game.arcade.game.games.halloween.creatures.MobGiant;
|
import nautilus.game.arcade.game.games.halloween.creatures.MobGiant;
|
||||||
import nautilus.game.arcade.game.games.halloween.creatures.MobSkeletonArcher;
|
import nautilus.game.arcade.game.games.halloween.creatures.MobSkeletonArcher;
|
||||||
import nautilus.game.arcade.game.games.halloween.creatures.MobWitch;
|
import nautilus.game.arcade.game.games.halloween.creatures.MobWitch;
|
||||||
@ -22,6 +23,6 @@ public class Wave5 extends WaveBase
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (tick == 0)
|
if (tick == 0)
|
||||||
Host.AddCreature(new MobWitch(Host, GetSpawn()));
|
Host.AddCreature(new MobGhast(Host, GetSpawn().clone().add(0, 40, 0)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package nautilus.game.arcade.game.games.halloween.waves;
|
package nautilus.game.arcade.game.games.halloween.waves;
|
||||||
|
|
||||||
import nautilus.game.arcade.game.games.halloween.Halloween;
|
import nautilus.game.arcade.game.games.halloween.Halloween;
|
||||||
|
import nautilus.game.arcade.game.games.halloween.creatures.MobCreeper;
|
||||||
import nautilus.game.arcade.game.games.halloween.creatures.MobZombie;
|
import nautilus.game.arcade.game.games.halloween.creatures.MobZombie;
|
||||||
import nautilus.game.arcade.game.games.halloween.creatures.PumpkinKing;
|
import nautilus.game.arcade.game.games.halloween.creatures.PumpkinKing;
|
||||||
|
|
||||||
@ -23,8 +24,13 @@ public class WaveBoss extends WaveBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Host.GetCreatures().size() < 30)
|
if (Host.GetCreatures().size() < 30)
|
||||||
if (tick % 20 == 0)
|
{
|
||||||
|
if (tick % 30 == 0)
|
||||||
|
if (Math.random() > 0.10)
|
||||||
Host.AddCreature(new MobZombie(Host, Host.GetRandomSpawn()));
|
Host.AddCreature(new MobZombie(Host, Host.GetRandomSpawn()));
|
||||||
|
else
|
||||||
|
Host.AddCreature(new MobCreeper(Host, Host.GetRandomSpawn()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user