Added paintball gun Gadget
Added bat blaster Gadget Halloween Game near-completed Added SSM Witch
This commit is contained in:
parent
8958b8998f
commit
723b57cd46
@ -1,12 +1,5 @@
|
|||||||
package mineplex.hub;
|
package mineplex.hub;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.BufferedWriter;
|
|
||||||
import java.io.DataInputStream;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileWriter;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -46,6 +39,7 @@ import mineplex.core.common.util.UtilMath;
|
|||||||
import mineplex.core.common.util.UtilParticle;
|
import mineplex.core.common.util.UtilParticle;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
import mineplex.core.common.util.UtilWorld;
|
import mineplex.core.common.util.UtilWorld;
|
||||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
import mineplex.core.disguise.DisguiseManager;
|
import mineplex.core.disguise.DisguiseManager;
|
||||||
@ -86,12 +80,10 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
|||||||
private HashMap<Player, Scoreboard> _scoreboards = new HashMap<Player, Scoreboard>();
|
private HashMap<Player, Scoreboard> _scoreboards = new HashMap<Player, Scoreboard>();
|
||||||
|
|
||||||
private String _pigStacker = "0 - Nobody";
|
private String _pigStacker = "0 - Nobody";
|
||||||
|
|
||||||
public String DragonTextA = "Mineplex";
|
|
||||||
public String DragonTextB = "";
|
|
||||||
|
|
||||||
private boolean _shuttingDown;
|
private boolean _shuttingDown;
|
||||||
|
|
||||||
|
private HashMap<String, Long> _portalTime = new HashMap<String, Long>();
|
||||||
|
|
||||||
public HubManager(JavaPlugin plugin, BlockRestore blockRestore, CoreClientManager clientManager, DonationManager donationManager, ConditionManager conditionManager, DisguiseManager disguiseManager, TaskManager taskManager, Portal portal, PartyManager partyManager)
|
public HubManager(JavaPlugin plugin, BlockRestore blockRestore, CoreClientManager clientManager, DonationManager donationManager, ConditionManager conditionManager, DisguiseManager disguiseManager, TaskManager taskManager, Portal portal, PartyManager partyManager)
|
||||||
{
|
{
|
||||||
@ -121,50 +113,6 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
|||||||
_partyManager = partyManager;
|
_partyManager = partyManager;
|
||||||
_tutorialManager = new TutorialManager(this, donationManager, taskManager, _textCreator);
|
_tutorialManager = new TutorialManager(this, donationManager, taskManager, _textCreator);
|
||||||
_visibilityManager = new VisibilityManager(this);
|
_visibilityManager = new VisibilityManager(this);
|
||||||
|
|
||||||
DragonTextB = GetDragonText();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String GetDragonText()
|
|
||||||
{
|
|
||||||
File file = new File("DragonText.dat");
|
|
||||||
|
|
||||||
//Write If Blank
|
|
||||||
if (!file.exists())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
FileWriter fstream = new FileWriter(file);
|
|
||||||
BufferedWriter out = new BufferedWriter(fstream);
|
|
||||||
|
|
||||||
out.write("Home of Premium Game Modes");
|
|
||||||
|
|
||||||
out.close();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
System.out.println("Error: Game World GetId Write Exception");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String line = "Home of Premium Game Modes";
|
|
||||||
|
|
||||||
//Read
|
|
||||||
try
|
|
||||||
{
|
|
||||||
FileInputStream fstream = new FileInputStream(file);
|
|
||||||
DataInputStream in = new DataInputStream(fstream);
|
|
||||||
BufferedReader br = new BufferedReader(new InputStreamReader(in));
|
|
||||||
line = br.readLine();
|
|
||||||
|
|
||||||
in.close();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
System.out.println("Error: Game World GetId Read Exception");
|
|
||||||
}
|
|
||||||
|
|
||||||
return line;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
@ -322,6 +270,8 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
|||||||
player.getScoreboard().resetScores(event.getPlayer());
|
player.getScoreboard().resetScores(event.getPlayer());
|
||||||
|
|
||||||
_scoreboards.remove(event.getPlayer());
|
_scoreboards.remove(event.getPlayer());
|
||||||
|
|
||||||
|
_portalTime.remove(event.getPlayer().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -631,4 +581,23 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetPortalDelay(Entity ent)
|
||||||
|
{
|
||||||
|
if (ent instanceof Player)
|
||||||
|
_portalTime.put(((Player)ent).getName(), System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean CanPortal(Player player)
|
||||||
|
{
|
||||||
|
//Riding
|
||||||
|
if (player.getVehicle() != null || player.getPassenger() != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
//Portal Delay
|
||||||
|
if (!_portalTime.containsKey(player.getName()))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return UtilTime.elapsed(_portalTime.get(player.getName()), 5000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import mineplex.core.MiniPlugin;
|
|||||||
import mineplex.hub.HubManager;
|
import mineplex.hub.HubManager;
|
||||||
import mineplex.hub.gadget.gadgets.Halloween2013_BatGun;
|
import mineplex.hub.gadget.gadgets.Halloween2013_BatGun;
|
||||||
import mineplex.hub.gadget.gadgets.Halloween2013_Helmet;
|
import mineplex.hub.gadget.gadgets.Halloween2013_Helmet;
|
||||||
|
import mineplex.hub.gadget.gadgets.PaintballGun;
|
||||||
import mineplex.hub.gadget.types.ArmorGadget;
|
import mineplex.hub.gadget.types.ArmorGadget;
|
||||||
import mineplex.hub.gadget.types.ArmorGadget.ArmorSlot;
|
import mineplex.hub.gadget.types.ArmorGadget.ArmorSlot;
|
||||||
import mineplex.hub.gadget.types.Gadget;
|
import mineplex.hub.gadget.types.Gadget;
|
||||||
@ -32,6 +33,10 @@ public class GadgetManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
_gadgets = new HashSet<Gadget>();
|
_gadgets = new HashSet<Gadget>();
|
||||||
|
|
||||||
|
//Items
|
||||||
|
_gadgets.add(new PaintballGun(this));
|
||||||
|
|
||||||
|
//Halloween 2013
|
||||||
_gadgets.add(new Halloween2013_BatGun(this));
|
_gadgets.add(new Halloween2013_BatGun(this));
|
||||||
_gadgets.add(new Halloween2013_Helmet(this));
|
_gadgets.add(new Halloween2013_Helmet(this));
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
package mineplex.hub.gadget.gadgets;
|
package mineplex.hub.gadget.gadgets;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Bat;
|
import org.bukkit.entity.Bat;
|
||||||
@ -7,16 +11,40 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilBlock;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilGear;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
import mineplex.core.recharge.Recharge;
|
import mineplex.core.recharge.Recharge;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.hub.gadget.GadgetManager;
|
import mineplex.hub.gadget.GadgetManager;
|
||||||
import mineplex.hub.gadget.types.ItemGadget;
|
import mineplex.hub.gadget.types.ItemGadget;
|
||||||
|
|
||||||
public class Halloween2013_BatGun extends ItemGadget
|
public class Halloween2013_BatGun extends ItemGadget
|
||||||
{
|
{
|
||||||
|
private HashMap<Player, Long> _active = new HashMap<Player, Long>();
|
||||||
|
private HashMap<Player, Location> _velocity = new HashMap<Player, Location>();
|
||||||
|
private HashMap<Player, ArrayList<Bat>> _bats = new HashMap<Player, ArrayList<Bat>>();
|
||||||
|
|
||||||
public Halloween2013_BatGun(GadgetManager manager)
|
public Halloween2013_BatGun(GadgetManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Halloween2013_BatGun", "Bat Gun", Material.COAL_BLOCK, (byte)0);
|
super(manager, "Gadget_Halloween2013_BatGun", "Bat Blaster", new String[]
|
||||||
|
{
|
||||||
|
C.cWhite + "Launch waves of annoying bats",
|
||||||
|
C.cWhite + "at people you don't like!",
|
||||||
|
},
|
||||||
|
Material.IRON_BARDING, (byte)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -29,29 +57,115 @@ public class Halloween2013_BatGun extends ItemGadget
|
|||||||
public void Disable(Player player)
|
public void Disable(Player player)
|
||||||
{
|
{
|
||||||
this.RemoveItem(player);
|
this.RemoveItem(player);
|
||||||
|
|
||||||
|
Clear(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void ItemUse(PlayerInteractEvent event)
|
public void Activate(PlayerInteractEvent event)
|
||||||
{
|
{
|
||||||
if (event.getAction() == Action.PHYSICAL)
|
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (UtilBlock.usable(event.getClickedBlock()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!UtilGear.isMat(event.getPlayer().getItemInHand(), Material.IRON_BARDING))
|
||||||
|
return;
|
||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
if (!IsActive(player))
|
if (!IsActive(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!Recharge.Instance.use(player, GetName(), 10000, true))
|
if (!Recharge.Instance.use(player, GetName(), 8000, true))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (int i=0 ; i<10 ; i++)
|
|
||||||
{
|
|
||||||
Bat bat = player.getWorld().spawn(player.getEyeLocation(), Bat.class);
|
|
||||||
bat.setVelocity(player.getLocation().getDirection().multiply(2));
|
|
||||||
}
|
|
||||||
|
|
||||||
player.getWorld().playSound(player.getLocation(), Sound.BAT_TAKEOFF, 2f, 1f);
|
//Start
|
||||||
player.getWorld().playSound(player.getLocation(), Sound.BAT_HURT, 2f, 1f);
|
_velocity.put(player, player.getEyeLocation());
|
||||||
|
_active.put(player, System.currentTimeMillis());
|
||||||
|
|
||||||
|
_bats.put(player, new ArrayList<Bat>());
|
||||||
|
|
||||||
|
for (int i=0 ; i<16 ; i++)
|
||||||
|
_bats.get(player).add(player.getWorld().spawn(player.getEyeLocation(), Bat.class));
|
||||||
|
|
||||||
|
//Inform
|
||||||
|
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void Update(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Player cur : UtilServer.getPlayers())
|
||||||
|
{
|
||||||
|
if (!_active.containsKey(cur))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (UtilTime.elapsed(_active.get(cur), 3000))
|
||||||
|
{
|
||||||
|
Clear(cur);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Location loc = _velocity.get(cur);
|
||||||
|
|
||||||
|
//Bat Movement
|
||||||
|
for (Bat bat : _bats.get(cur))
|
||||||
|
{
|
||||||
|
if (!bat.isValid())
|
||||||
|
continue;
|
||||||
|
Vector rand = new Vector((Math.random() - 0.5)/3, (Math.random() - 0.5)/3, (Math.random() - 0.5)/3);
|
||||||
|
bat.setVelocity(loc.getDirection().clone().multiply(0.5).add(rand));
|
||||||
|
|
||||||
|
for (Player other : UtilServer.getPlayers())
|
||||||
|
{
|
||||||
|
if (other.equals(cur))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!Recharge.Instance.usable(other, "Hit by Bat"))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (UtilEnt.hitBox(bat.getLocation(), other, 2, null))
|
||||||
|
{
|
||||||
|
//Damage Event
|
||||||
|
UtilAction.velocity(other, UtilAlg.getTrajectory(cur, other), 0.4, false, 0, 0.2, 10, true);
|
||||||
|
|
||||||
|
//Effect
|
||||||
|
bat.getWorld().playSound(bat.getLocation(), Sound.BAT_HURT, 1f, 1f);
|
||||||
|
UtilParticle.PlayParticle(ParticleType.LARGE_SMOKE, bat.getLocation(), 0, 0, 0, 0, 3);
|
||||||
|
|
||||||
|
bat.remove();
|
||||||
|
|
||||||
|
//Recharge on hit
|
||||||
|
Recharge.Instance.useForce(other, "Hit by Bat", 200);
|
||||||
|
|
||||||
|
//No Portal
|
||||||
|
Manager.Manager.SetPortalDelay(other);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Clear(Player player)
|
||||||
|
{
|
||||||
|
_active.remove(player);
|
||||||
|
_velocity.remove(player);
|
||||||
|
if (_bats.containsKey(player))
|
||||||
|
{
|
||||||
|
for (Bat bat : _bats.get(player))
|
||||||
|
{
|
||||||
|
if (bat.isValid())
|
||||||
|
UtilParticle.PlayParticle(ParticleType.LARGE_SMOKE, bat.getLocation(), 0, 0, 0, 0, 3);
|
||||||
|
|
||||||
|
bat.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
_bats.remove(player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,8 @@ package mineplex.hub.gadget.gadgets;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Skeleton.SkeletonType;
|
import org.bukkit.entity.Skeleton.SkeletonType;
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.UtilServer;
|
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;
|
||||||
@ -15,21 +14,30 @@ public class Halloween2013_Helmet extends ArmorGadget
|
|||||||
{
|
{
|
||||||
public Halloween2013_Helmet(GadgetManager manager)
|
public Halloween2013_Helmet(GadgetManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Halloween2013_Helmet", "Pumpkin Kings Head", ArmorSlot.Helmet, Material.PUMPKIN, (byte)0);
|
super(manager, "Gadget_Halloween2013_Helmet", "Pumpkin Kings Head", new String[]
|
||||||
|
{
|
||||||
|
C.cWhite + "Transforms the wearer into",
|
||||||
|
C.cWhite + "the dreaded Pumpkin King!",
|
||||||
|
"",
|
||||||
|
C.cYellow + "Earned by defeating the Pumpkin King",
|
||||||
|
C.cYellow + "in the 2013 Halloween Horror Event.",
|
||||||
|
},
|
||||||
|
ArmorSlot.Helmet, Material.PUMPKIN, (byte)0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Enable(final 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.showArmor();
|
||||||
disguise.SetName(player.getName());
|
disguise.SetName(player.getName());
|
||||||
disguise.SetCustomNameVisible(true);
|
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()
|
Manager.Manager.GetPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.Manager.GetPlugin(), new Runnable()
|
||||||
{
|
{
|
||||||
public void run()
|
public void run()
|
||||||
@ -49,13 +57,6 @@ public class Halloween2013_Helmet extends ArmorGadget
|
|||||||
this.RemoveArmor(player);
|
this.RemoveArmor(player);
|
||||||
Manager.Manager.GetDisguise().undisguise(player);
|
Manager.Manager.GetDisguise().undisguise(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void TOGGLE(PlayerDropItemEvent event)
|
|
||||||
{
|
|
||||||
if (!this.IsActive(event.getPlayer()))
|
|
||||||
Enable(event.getPlayer());
|
|
||||||
else
|
|
||||||
Disable(event.getPlayer());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,113 @@
|
|||||||
|
package mineplex.hub.gadget.gadgets;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import org.bukkit.Effect;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.entity.EnderPearl;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Projectile;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
|
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.UtilBlock;
|
||||||
|
import mineplex.core.recharge.Recharge;
|
||||||
|
import mineplex.hub.gadget.GadgetManager;
|
||||||
|
import mineplex.hub.gadget.types.ItemGadget;
|
||||||
|
|
||||||
|
public class PaintballGun extends ItemGadget
|
||||||
|
{
|
||||||
|
private HashSet<Projectile> _balls = new HashSet<Projectile>();
|
||||||
|
|
||||||
|
public PaintballGun(GadgetManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Gadget_PaintballGun", "Paintball Gun", new String[]
|
||||||
|
{
|
||||||
|
C.cWhite + "PEW PEW PEW PEW!",
|
||||||
|
},
|
||||||
|
Material.GOLD_BARDING, (byte)0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void Enable(Player player)
|
||||||
|
{
|
||||||
|
this.ApplyItem(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void Disable(Player player)
|
||||||
|
{
|
||||||
|
this.RemoveItem(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void Shoot(PlayerInteractEvent event)
|
||||||
|
{
|
||||||
|
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (UtilBlock.usable(event.getClickedBlock()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.getPlayer().getItemInHand() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.getPlayer().getItemInHand().getType() != Material.GOLD_BARDING)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
if (!IsActive(player))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!Recharge.Instance.use(player, GetName(), 400, false))
|
||||||
|
return;
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
|
|
||||||
|
Projectile proj = player.launchProjectile(EnderPearl.class);
|
||||||
|
proj.setVelocity(proj.getVelocity().multiply(2));
|
||||||
|
_balls.add(proj);
|
||||||
|
|
||||||
|
//Sound
|
||||||
|
player.getWorld().playSound(player.getLocation(), Sound.CHICKEN_EGG_POP, 1.5f, 1.2f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void Paint(ProjectileHitEvent event)
|
||||||
|
{
|
||||||
|
Location loc = event.getEntity().getLocation().add(event.getEntity().getVelocity());
|
||||||
|
|
||||||
|
byte color = 2;
|
||||||
|
double r = Math.random();
|
||||||
|
if (r > 0.8) color = 4;
|
||||||
|
else if (r > 0.6) color = 5;
|
||||||
|
else if (r > 0.4) color = 9;
|
||||||
|
else if (r > 0.2) color = 14;
|
||||||
|
|
||||||
|
for (Block block : UtilBlock.getInRadius(loc, 1.5d).keySet())
|
||||||
|
{
|
||||||
|
if (!UtilBlock.solid(block))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Manager.Manager.GetBlockRestore().Add(block, 35, color, 4000);
|
||||||
|
}
|
||||||
|
|
||||||
|
loc.getWorld().playEffect(loc, Effect.STEP_SOUND, 49);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void Teleport(PlayerTeleportEvent event)
|
||||||
|
{
|
||||||
|
if (event.getCause() == TeleportCause.ENDER_PEARL)
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
@ -22,9 +22,9 @@ public abstract class ArmorGadget extends Gadget
|
|||||||
private Material _material;
|
private Material _material;
|
||||||
private byte _data;
|
private byte _data;
|
||||||
|
|
||||||
public ArmorGadget(GadgetManager manager, String code, String name, ArmorSlot slot, Material mat, byte data)
|
public ArmorGadget(GadgetManager manager, String code, String name, String[] desc, ArmorSlot slot, Material mat, byte data)
|
||||||
{
|
{
|
||||||
super(manager, code, name);
|
super(manager, code, name, desc);
|
||||||
|
|
||||||
_slot = slot;
|
_slot = slot;
|
||||||
_material = mat;
|
_material = mat;
|
||||||
|
@ -19,13 +19,15 @@ public abstract class Gadget implements Listener
|
|||||||
|
|
||||||
private String _code;
|
private String _code;
|
||||||
private String _name;
|
private String _name;
|
||||||
|
private String[] _desc;
|
||||||
|
|
||||||
public Gadget(GadgetManager manager, String code, String name)
|
public Gadget(GadgetManager manager, String code, String name, String[] desc)
|
||||||
{
|
{
|
||||||
Manager = manager;
|
Manager = manager;
|
||||||
|
|
||||||
_code = code;
|
_code = code;
|
||||||
_name = name;
|
_name = name;
|
||||||
|
_desc = desc;
|
||||||
|
|
||||||
Manager.GetPlugin().getServer().getPluginManager().registerEvents(this, Manager.GetPlugin());
|
Manager.GetPlugin().getServer().getPluginManager().registerEvents(this, Manager.GetPlugin());
|
||||||
}
|
}
|
||||||
@ -35,6 +37,11 @@ public abstract class Gadget implements Listener
|
|||||||
return _name;
|
return _name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String[] GetDesc()
|
||||||
|
{
|
||||||
|
return _desc;
|
||||||
|
}
|
||||||
|
|
||||||
public String GetCode()
|
public String GetCode()
|
||||||
{
|
{
|
||||||
return _code;
|
return _code;
|
||||||
|
@ -16,9 +16,9 @@ public abstract class ItemGadget extends Gadget
|
|||||||
private Material _material;
|
private Material _material;
|
||||||
private byte _data;
|
private byte _data;
|
||||||
|
|
||||||
public ItemGadget(GadgetManager manager, String code, String name, Material mat, byte data)
|
public ItemGadget(GadgetManager manager, String code, String name, String[] desc, Material mat, byte data)
|
||||||
{
|
{
|
||||||
super(manager, code, name);
|
super(manager, code, name, desc);
|
||||||
|
|
||||||
_material = mat;
|
_material = mat;
|
||||||
_data = data;
|
_data = data;
|
||||||
@ -38,7 +38,7 @@ public abstract class ItemGadget extends Gadget
|
|||||||
{
|
{
|
||||||
Manager.RemoveItem(player);
|
Manager.RemoveItem(player);
|
||||||
|
|
||||||
player.getInventory().setItem(3, ItemStackFactory.Instance.CreateStack(_material, _data, 1, F.item(GetName())));
|
player.getInventory().setItem(2, ItemStackFactory.Instance.CreateStack(_material, _data, 1, F.item(GetName())));
|
||||||
|
|
||||||
_active.add(player);
|
_active.add(player);
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ public abstract class ItemGadget extends Gadget
|
|||||||
|
|
||||||
public void RemoveItem(Player player)
|
public void RemoveItem(Player player)
|
||||||
{
|
{
|
||||||
player.getInventory().setItem(3, null);
|
player.getInventory().setItem(2, null);
|
||||||
|
|
||||||
_active.remove(player);
|
_active.remove(player);
|
||||||
|
|
||||||
|
@ -33,10 +33,12 @@ public class NewsManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
"New Game: " + C.cGold + C.Bold + "Halloween Horror" + ChatColor.RESET + "! Limited time!",
|
"New Game: " + C.cGold + C.Bold + "Halloween Horror" + ChatColor.RESET + "! Limited time!",
|
||||||
"New Super Smash Mobs Kit: " + C.cYellow + C.Bold + "Witch" + ChatColor.RESET + "!",
|
"New Super Smash Mobs Kit: " + C.cYellow + C.Bold + "Witch" + ChatColor.RESET + "!",
|
||||||
"New Halloween Hub Items! Limited time to unlock!",
|
"Halloween Hub Items! Limited time to unlock!",
|
||||||
"New Hub Mount: " + C.cYellow + C.Bold + "Horse of Horror" + ChatColor.RESET + "!",
|
"Halloween Sale! " + C.cGreen + C.Bold + "50% OFF" + ChatColor.RESET + " everything!",
|
||||||
|
"New Hub Mount: " + C.cYellow + C.Bold + "Infernal Horror" + ChatColor.RESET + "!",
|
||||||
"New Hub Gadget: " + C.cYellow + C.Bold + "Pumpkin Kings Head" + ChatColor.RESET + "!",
|
"New Hub Gadget: " + C.cYellow + C.Bold + "Pumpkin Kings Head" + ChatColor.RESET + "!",
|
||||||
"New Hub Gadget: " + C.cYellow + C.Bold + "Bat Cannon" + ChatColor.RESET + "!",
|
"New Hub Gadget: " + C.cYellow + C.Bold + "Bat Blaster" + ChatColor.RESET + "!",
|
||||||
|
"Halloween Sale! " + C.cGreen + C.Bold + "50% OFF" + ChatColor.RESET + " everything!",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package mineplex.hub.modules;
|
package mineplex.hub.modules;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
@ -26,7 +25,6 @@ import mineplex.core.common.util.UtilAlg;
|
|||||||
import mineplex.core.common.util.UtilEnt;
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.common.util.UtilEvent;
|
import mineplex.core.common.util.UtilEvent;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilTime;
|
|
||||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import mineplex.core.projectile.IThrown;
|
import mineplex.core.projectile.IThrown;
|
||||||
@ -44,7 +42,7 @@ public class StackerManager extends MiniPlugin implements IThrown
|
|||||||
private HashSet<Player> _disabled = new HashSet<Player>();
|
private HashSet<Player> _disabled = new HashSet<Player>();
|
||||||
private HashSet<Entity> _tempStackShift = new HashSet<Entity>();
|
private HashSet<Entity> _tempStackShift = new HashSet<Entity>();
|
||||||
|
|
||||||
private HashMap<String, Long> _portalTime = new HashMap<String, Long>();
|
|
||||||
|
|
||||||
private int _slot = 7;
|
private int _slot = 7;
|
||||||
|
|
||||||
@ -97,7 +95,6 @@ public class StackerManager extends MiniPlugin implements IThrown
|
|||||||
{
|
{
|
||||||
_disabled.remove(event.getPlayer());
|
_disabled.remove(event.getPlayer());
|
||||||
_tempStackShift.remove(event.getPlayer());
|
_tempStackShift.remove(event.getPlayer());
|
||||||
_portalTime.remove(event.getPlayer().getName());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean CanStack(LivingEntity ent)
|
public boolean CanStack(LivingEntity ent)
|
||||||
@ -192,8 +189,8 @@ public class StackerManager extends MiniPlugin implements IThrown
|
|||||||
UtilPlayer.message(stackee, F.main("Stacker", "Push " + F.skill("Crouch") + " to escape!"));
|
UtilPlayer.message(stackee, F.main("Stacker", "Push " + F.skill("Crouch") + " to escape!"));
|
||||||
|
|
||||||
//Portal Delay
|
//Portal Delay
|
||||||
SetPortalDelay(stacker);
|
Manager.SetPortalDelay(stacker);
|
||||||
SetPortalDelay(stackee);
|
Manager.SetPortalDelay(stackee);
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -252,8 +249,8 @@ public class StackerManager extends MiniPlugin implements IThrown
|
|||||||
_projectileManager.AddThrow(throwee, thrower, this, -1, true, false, true, false, 2.4d);
|
_projectileManager.AddThrow(throwee, thrower, this, -1, true, false, true, false, 2.4d);
|
||||||
|
|
||||||
//Portal Delay
|
//Portal Delay
|
||||||
SetPortalDelay(thrower);
|
Manager.SetPortalDelay(thrower);
|
||||||
SetPortalDelay(throwee);
|
Manager.SetPortalDelay(throwee);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -272,7 +269,7 @@ public class StackerManager extends MiniPlugin implements IThrown
|
|||||||
while (rider != null)
|
while (rider != null)
|
||||||
{
|
{
|
||||||
//Portal Delay
|
//Portal Delay
|
||||||
SetPortalDelay(rider);
|
Manager.SetPortalDelay(rider);
|
||||||
|
|
||||||
rider.leaveVehicle();
|
rider.leaveVehicle();
|
||||||
rider.setVelocity(new Vector(0.25 - Math.random()/2, Math.random()/2, 0.25 - Math.random()/2));
|
rider.setVelocity(new Vector(0.25 - Math.random()/2, Math.random()/2, 0.25 - Math.random()/2));
|
||||||
@ -285,7 +282,7 @@ public class StackerManager extends MiniPlugin implements IThrown
|
|||||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.HURT, 1f, 1f);
|
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.HURT, 1f, 1f);
|
||||||
|
|
||||||
//Portal Delay
|
//Portal Delay
|
||||||
SetPortalDelay(target);
|
Manager.SetPortalDelay(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -299,23 +296,4 @@ public class StackerManager extends MiniPlugin implements IThrown
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPortalDelay(Entity ent)
|
|
||||||
{
|
|
||||||
if (ent instanceof Player)
|
|
||||||
_portalTime.put(((Player)ent).getName(), System.currentTimeMillis());
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean CanPortal(Player player)
|
|
||||||
{
|
|
||||||
//Riding
|
|
||||||
if (player.getVehicle() != null || player.getPassenger() != null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
//Portal Delay
|
|
||||||
if (!_portalTime.containsKey(player.getName()))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return UtilTime.elapsed(_portalTime.get(player.getName()), 5000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@ public class Mount implements Listener
|
|||||||
private String _code;
|
private String _code;
|
||||||
|
|
||||||
private String _name;
|
private String _name;
|
||||||
|
private String[] _desc;
|
||||||
|
|
||||||
private Color _color;
|
private Color _color;
|
||||||
private Style _style;
|
private Style _style;
|
||||||
@ -45,12 +46,13 @@ public class Mount implements Listener
|
|||||||
private double _jump;
|
private double _jump;
|
||||||
private Material _armor;
|
private Material _armor;
|
||||||
|
|
||||||
public Mount(MountManager manager, String code, String name, Color color, Style style, Variant variant, double jump, Material armor)
|
public Mount(MountManager manager, String code, String name, String[] desc, Color color, Style style, Variant variant, double jump, Material armor)
|
||||||
{
|
{
|
||||||
Manager = manager;
|
Manager = manager;
|
||||||
|
|
||||||
_code = code;
|
_code = code;
|
||||||
_name = name;
|
_name = name;
|
||||||
|
_desc = desc;
|
||||||
_color = color;
|
_color = color;
|
||||||
_style = style;
|
_style = style;
|
||||||
_variant = variant;
|
_variant = variant;
|
||||||
@ -65,6 +67,11 @@ public class Mount implements Listener
|
|||||||
return _name;
|
return _name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String[] GetDesc()
|
||||||
|
{
|
||||||
|
return _desc;
|
||||||
|
}
|
||||||
|
|
||||||
public String GetCode()
|
public String GetCode()
|
||||||
{
|
{
|
||||||
return _code;
|
return _code;
|
||||||
|
@ -11,6 +11,10 @@ public class Mule extends Mount
|
|||||||
{
|
{
|
||||||
public Mule(MountManager manager)
|
public Mule(MountManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "MountMule", "Horse of Horror", Color.BLACK, Style.BLACK_DOTS, Variant.MULE, 1.0, null);
|
super(manager, "Mount_Mule", "Horse of Horror", new String[]
|
||||||
|
{
|
||||||
|
"Muley muley!"
|
||||||
|
},
|
||||||
|
Color.BLACK, Style.BLACK_DOTS, Variant.MULE, 1.0, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.player.PlayerToggleSneakEvent;
|
import org.bukkit.event.player.PlayerToggleSneakEvent;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.UtilParticle;
|
import mineplex.core.common.util.UtilParticle;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
@ -20,14 +21,13 @@ public class Undead extends Mount
|
|||||||
{
|
{
|
||||||
public Undead(MountManager manager)
|
public Undead(MountManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "MountHalloween2013", "Horse of Horror", Color.BLACK, Style.BLACK_DOTS, Variant.SKELETON_HORSE, 0.8, null);
|
super(manager, "Mount_Halloween2013", "Infernal Horror", new String[]
|
||||||
}
|
{
|
||||||
|
C.cWhite + "The most ghastly horse in",
|
||||||
@EventHandler
|
C.cWhite + "existance, from the pits of",
|
||||||
public void Test(PlayerToggleSneakEvent event)
|
C.cWhite + "the Nether."
|
||||||
{
|
},
|
||||||
if (event.getPlayer().isSneaking())
|
Color.BLACK, Style.BLACK_DOTS, Variant.SKELETON_HORSE, 0.8, null);
|
||||||
this.Enable(event.getPlayer());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
@ -120,7 +120,7 @@ public class ServerManager extends MiniPlugin
|
|||||||
|
|
||||||
Player player = (Player)event.getEntity();
|
Player player = (Player)event.getEntity();
|
||||||
|
|
||||||
if (!_stackerManager.CanPortal(player))
|
if (!_hubManager.CanPortal(player))
|
||||||
{
|
{
|
||||||
UtilAction.velocity(player, UtilAlg.getTrajectory(player.getLocation(), _hubManager.GetSpawn()), 1, true, 0.8, 0, 1, true);
|
UtilAction.velocity(player, UtilAlg.getTrajectory(player.getLocation(), _hubManager.GetSpawn()), 1, true, 0.8, 0, 1, true);
|
||||||
return;
|
return;
|
||||||
|
@ -26,7 +26,7 @@ public class KitArcher extends Kit
|
|||||||
new Perk[]
|
new Perk[]
|
||||||
{
|
{
|
||||||
new PerkFletcher(20, 3, true),
|
new PerkFletcher(20, 3, true),
|
||||||
new PerkBarrage(5, 250, true),
|
new PerkBarrage(5, 250, true, false),
|
||||||
},
|
},
|
||||||
EntityType.ZOMBIE,
|
EntityType.ZOMBIE,
|
||||||
new ItemStack(Material.BOW));
|
new ItemStack(Material.BOW));
|
||||||
|
@ -28,7 +28,7 @@ public class KitHumanMarksman extends Kit
|
|||||||
},
|
},
|
||||||
new Perk[]
|
new Perk[]
|
||||||
{
|
{
|
||||||
new PerkBarrage(5, 250, true),
|
new PerkBarrage(5, 250, true, false),
|
||||||
new PerkFletcher(2, 4, false),
|
new PerkFletcher(2, 4, false),
|
||||||
},
|
},
|
||||||
EntityType.ZOMBIE,
|
EntityType.ZOMBIE,
|
||||||
|
@ -31,7 +31,7 @@ public class KitSkeleton extends Kit
|
|||||||
new Perk[]
|
new Perk[]
|
||||||
{
|
{
|
||||||
new PerkFletcher(3, 2, false),
|
new PerkFletcher(3, 2, false),
|
||||||
new PerkBarrage(5, 250, true)
|
new PerkBarrage(5, 250, true, false)
|
||||||
},
|
},
|
||||||
EntityType.SLIME,
|
EntityType.SLIME,
|
||||||
null);
|
null);
|
||||||
|
@ -1,19 +1,26 @@
|
|||||||
package nautilus.game.arcade.game.games.halloween;
|
package nautilus.game.arcade.game.games.halloween;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.*;
|
import org.bukkit.entity.*;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.entity.EntityBreakDoorEvent;
|
import org.bukkit.event.entity.EntityBreakDoorEvent;
|
||||||
import org.bukkit.event.entity.EntityDeathEvent;
|
import org.bukkit.event.entity.EntityDeathEvent;
|
||||||
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
import org.bukkit.event.entity.EntityTargetEvent;
|
import org.bukkit.event.entity.EntityTargetEvent;
|
||||||
|
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilBlock;
|
||||||
import mineplex.core.common.util.UtilMath;
|
import mineplex.core.common.util.UtilMath;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
@ -80,12 +87,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 WaveBoss(this));
|
_waves.add(new WaveBoss(this));
|
||||||
_waves.add(new WaveVictory(this));
|
_waves.add(new WaveVictory(this));
|
||||||
}
|
}
|
||||||
@ -214,9 +220,37 @@ public class Halloween extends SoloGame
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void Door(EntityBreakDoorEvent event)
|
public void Explosion(EntityExplodeEvent event)
|
||||||
{
|
{
|
||||||
System.out.println("Door Break");
|
if (event.getEntity() instanceof Fireball)
|
||||||
|
{
|
||||||
|
event.blockList().clear();
|
||||||
|
|
||||||
|
Collection<Block> blocks = UtilBlock.getInRadius(event.getLocation(), 3.5d).keySet();
|
||||||
|
|
||||||
|
Iterator<Block> blockIterator = blocks.iterator();
|
||||||
|
|
||||||
|
while (blockIterator.hasNext())
|
||||||
|
{
|
||||||
|
Block block = blockIterator.next();
|
||||||
|
|
||||||
|
if (block.getY() < 4)
|
||||||
|
blockIterator.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
Manager.GetExplosion().BlockExplosion(blocks, event.getLocation(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void ItemSpawn(ItemSpawnEvent event)
|
||||||
|
{
|
||||||
|
Material type = event.getEntity().getItemStack().getType();
|
||||||
|
|
||||||
|
if (type == Material.DIAMOND_AXE || type == Material.FIRE || type == Material.SNOW_BALL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public class MobCreeper extends CreatureBase<Creeper>
|
|||||||
@Override
|
@Override
|
||||||
public void SpawnCustom(Creeper ent)
|
public void SpawnCustom(Creeper ent)
|
||||||
{
|
{
|
||||||
|
ent.setCustomName("Creeper");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -43,7 +43,7 @@ public class MobCreeper extends CreatureBase<Creeper>
|
|||||||
@Override
|
@Override
|
||||||
public void Update(UpdateEvent event)
|
public void Update(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (event.getType() != UpdateType.SEC)
|
if (event.getType() != UpdateType.SLOW)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//New Target via Distance
|
//New Target via Distance
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
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.common.util.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
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;
|
||||||
@ -11,9 +13,12 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftGhast;
|
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftGhast;
|
||||||
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>
|
||||||
{
|
{
|
||||||
|
private Location _loc;
|
||||||
|
|
||||||
public MobGhast(Game game, Location loc)
|
public MobGhast(Game game, Location loc)
|
||||||
{
|
{
|
||||||
super(game, null, Ghast.class, loc);
|
super(game, null, Ghast.class, loc);
|
||||||
@ -22,7 +27,13 @@ public class MobGhast extends CreatureBase<Ghast>
|
|||||||
@Override
|
@Override
|
||||||
public void SpawnCustom(Ghast ent)
|
public void SpawnCustom(Ghast ent)
|
||||||
{
|
{
|
||||||
UtilEnt.Vegetate(ent);
|
//UtilEnt.Vegetate(ent);
|
||||||
|
_loc = ent.getLocation();
|
||||||
|
|
||||||
|
ent.setMaxHealth(80);
|
||||||
|
ent.setHealth(80);
|
||||||
|
|
||||||
|
ent.setCustomName("Ghast");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -40,16 +51,34 @@ public class MobGhast extends CreatureBase<Ghast>
|
|||||||
@Override
|
@Override
|
||||||
public void Update(UpdateEvent event)
|
public void Update(UpdateEvent event)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
if (event.getType() == UpdateType.TICK)
|
||||||
|
Move();
|
||||||
|
|
||||||
|
if (event.getType() == UpdateType.FAST)
|
||||||
|
Destroy();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Destroy()
|
||||||
|
{
|
||||||
|
Host.Manager.GetExplosion().BlockExplosion(UtilBlock.getInRadius(GetEntity().getLocation().add(0, 0, 0), 8d).keySet(), GetEntity().getLocation(), true);
|
||||||
|
}
|
||||||
|
|
||||||
private void Move()
|
private void Move()
|
||||||
{
|
{
|
||||||
if (GetTarget() == null)
|
SetTarget(GetPlayerTarget().add(0, 20, 0));
|
||||||
SetTarget(GetPlayerTarget());
|
|
||||||
|
if (UtilMath.offset(GetEntity().getLocation(), GetTarget()) < 30)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Vector dir = UtilAlg.getTrajectory(GetEntity().getLocation(), GetTarget());
|
||||||
|
|
||||||
|
((CraftGhast)GetEntity()).getHandle().setPositionRotation(
|
||||||
|
_loc.getX(), _loc.getY(), _loc.getZ(),
|
||||||
|
UtilAlg.GetYaw(dir), UtilAlg.GetPitch(dir));
|
||||||
|
|
||||||
|
_loc.add(dir.multiply(0.25));
|
||||||
|
|
||||||
((CraftGhast)GetEntity()).getHandle().i = GetTarget().getX();
|
|
||||||
((CraftGhast)GetEntity()).getHandle().j = GetTarget().getY();
|
|
||||||
((CraftGhast)GetEntity()).getHandle().bn = GetTarget().getZ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,10 @@ public class MobGiant extends CreatureBase<Giant>
|
|||||||
{
|
{
|
||||||
_tpLoc = ent.getLocation();
|
_tpLoc = ent.getLocation();
|
||||||
|
|
||||||
ent.setMaxHealth(120);
|
ent.setMaxHealth(300);
|
||||||
ent.setHealth(120);
|
ent.setHealth(300);
|
||||||
|
|
||||||
|
ent.setCustomName("Giant");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -55,7 +57,7 @@ public class MobGiant extends CreatureBase<Giant>
|
|||||||
if (event.getType() == UpdateType.TICK)
|
if (event.getType() == UpdateType.TICK)
|
||||||
Move();
|
Move();
|
||||||
|
|
||||||
if (event.getType() == UpdateType.FASTER)
|
if (event.getType() == UpdateType.FAST)
|
||||||
Destroy();
|
Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,8 @@ public class MobPigZombie extends CreatureBase<Zombie>
|
|||||||
Host.Manager.GetDisguise().disguise(disguise);
|
Host.Manager.GetDisguise().disguise(disguise);
|
||||||
|
|
||||||
Host.Manager.GetCondition().Factory().Speed("Speed", ent, ent, 99999, 1, false, false, false);
|
Host.Manager.GetCondition().Factory().Speed("Speed", ent, ent, 99999, 1, false, false, false);
|
||||||
|
|
||||||
|
ent.setCustomName("Nether Zombie");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -47,7 +49,7 @@ public class MobPigZombie extends CreatureBase<Zombie>
|
|||||||
@Override
|
@Override
|
||||||
public void Update(UpdateEvent event)
|
public void Update(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (event.getType() == UpdateType.FAST)
|
if (event.getType() == UpdateType.SLOW)
|
||||||
Move();
|
Move();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,11 +85,11 @@ public class MobPigZombie 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ public class MobSkeletonArcher extends CreatureBase<Skeleton>
|
|||||||
public void SpawnCustom(Skeleton ent)
|
public void SpawnCustom(Skeleton ent)
|
||||||
{
|
{
|
||||||
ent.getEquipment().setItemInHand(new ItemStack(Material.BOW));
|
ent.getEquipment().setItemInHand(new ItemStack(Material.BOW));
|
||||||
|
ent.setCustomName("Skeleton Archer");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -45,7 +46,7 @@ public class MobSkeletonArcher extends CreatureBase<Skeleton>
|
|||||||
@Override
|
@Override
|
||||||
public void Update(UpdateEvent event)
|
public void Update(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (event.getType() != UpdateType.SEC)
|
if (event.getType() != UpdateType.SLOW)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//New Target via Distance
|
//New Target via Distance
|
||||||
|
@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.halloween.creatures;
|
|||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
import mineplex.core.common.util.UtilMath;
|
import mineplex.core.common.util.UtilMath;
|
||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseSpider;
|
||||||
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;
|
||||||
@ -13,21 +14,24 @@ import net.minecraft.server.v1_6_R3.Navigation;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftCreature;
|
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftCreature;
|
||||||
import org.bukkit.entity.Skeleton;
|
import org.bukkit.entity.Zombie;
|
||||||
import org.bukkit.event.entity.EntityTargetEvent;
|
import org.bukkit.event.entity.EntityTargetEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class MobSkeletonWarrior extends CreatureBase<Skeleton>
|
public class MobSkeletonWarrior extends CreatureBase<Zombie>
|
||||||
{
|
{
|
||||||
public MobSkeletonWarrior(Game game, Location loc)
|
public MobSkeletonWarrior(Game game, Location loc)
|
||||||
{
|
{
|
||||||
super(game, null, Skeleton.class, loc);
|
super(game, null, Zombie.class, loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void SpawnCustom(Skeleton ent)
|
public void SpawnCustom(Zombie ent)
|
||||||
{
|
{
|
||||||
ent.getEquipment().setItemInHand(new ItemStack(Material.WOOD_SWORD));
|
DisguiseSpider spider = new DisguiseSpider(ent);
|
||||||
|
Host.Manager.GetDisguise().disguise(spider);
|
||||||
|
ent.setCustomName("Skeleton Warrior");
|
||||||
|
ent.getEquipment().setItemInHand(new ItemStack(Material.WOOD_HOE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -45,7 +49,7 @@ public class MobSkeletonWarrior extends CreatureBase<Skeleton>
|
|||||||
@Override
|
@Override
|
||||||
public void Update(UpdateEvent event)
|
public void Update(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (event.getType() != UpdateType.FAST)
|
if (event.getType() != UpdateType.SLOW)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//New Target via Distance
|
//New Target via Distance
|
||||||
|
@ -27,7 +27,7 @@ public class MobSpiderLeaper extends CreatureBase<CaveSpider>
|
|||||||
@Override
|
@Override
|
||||||
public void SpawnCustom(CaveSpider ent)
|
public void SpawnCustom(CaveSpider ent)
|
||||||
{
|
{
|
||||||
|
ent.setCustomName("Leaping Spider");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -30,6 +30,7 @@ public class MobSpiderWebber extends CreatureBase<Zombie>
|
|||||||
{
|
{
|
||||||
DisguiseSpider spider = new DisguiseSpider(ent);
|
DisguiseSpider spider = new DisguiseSpider(ent);
|
||||||
Host.Manager.GetDisguise().disguise(spider);
|
Host.Manager.GetDisguise().disguise(spider);
|
||||||
|
ent.setCustomName("Smashing Spider");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -26,7 +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);
|
ent.setCustomName("Zombie");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -38,7 +38,7 @@ public class MobZombie extends CreatureBase<Zombie>
|
|||||||
@Override
|
@Override
|
||||||
public void Update(UpdateEvent event)
|
public void Update(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (event.getType() == UpdateType.SEC)
|
if (event.getType() == UpdateType.SLOW)
|
||||||
Move();
|
Move();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,9 +14,11 @@ import mineplex.core.common.util.UtilBlock;
|
|||||||
import mineplex.core.common.util.UtilDisplay;
|
import mineplex.core.common.util.UtilDisplay;
|
||||||
import mineplex.core.common.util.UtilEnt;
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.common.util.UtilMath;
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
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;
|
||||||
@ -25,7 +27,6 @@ import net.minecraft.server.v1_6_R3.EntityArrow;
|
|||||||
import net.minecraft.server.v1_6_R3.EntityCreature;
|
import net.minecraft.server.v1_6_R3.EntityCreature;
|
||||||
import net.minecraft.server.v1_6_R3.Navigation;
|
import net.minecraft.server.v1_6_R3.Navigation;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -94,6 +95,9 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
|||||||
//Attacked King
|
//Attacked King
|
||||||
if (event.GetDamageeEntity().equals(GetEntity()))
|
if (event.GetDamageeEntity().equals(GetEntity()))
|
||||||
{
|
{
|
||||||
|
if (event.GetProjectile() != null)
|
||||||
|
event.GetProjectile().remove();
|
||||||
|
|
||||||
if (_shields.size() > 0)
|
if (_shields.size() > 0)
|
||||||
{
|
{
|
||||||
event.SetCancelled("Shielded");
|
event.SetCancelled("Shielded");
|
||||||
@ -113,6 +117,9 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
|||||||
//Attacked Minion
|
//Attacked Minion
|
||||||
else if (_minions.contains(event.GetDamageeEntity()))
|
else if (_minions.contains(event.GetDamageeEntity()))
|
||||||
{
|
{
|
||||||
|
if (event.GetProjectile() != null)
|
||||||
|
event.GetProjectile().remove();
|
||||||
|
|
||||||
if (_shields.size() > 0)
|
if (_shields.size() > 0)
|
||||||
{
|
{
|
||||||
event.SetCancelled("Shielded");
|
event.SetCancelled("Shielded");
|
||||||
@ -131,8 +138,11 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
|||||||
|
|
||||||
if (event.GetCause() != DamageCause.PROJECTILE && event.GetCause() != DamageCause.LIGHTNING)
|
if (event.GetCause() != DamageCause.PROJECTILE && event.GetCause() != DamageCause.LIGHTNING)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
event.GetProjectile().remove();
|
event.GetProjectile().remove();
|
||||||
|
|
||||||
|
if (event.GetDamagerPlayer(true) == null)
|
||||||
|
return;
|
||||||
|
|
||||||
//Effect
|
//Effect
|
||||||
Host.Manager.GetBlood().Effects(event.GetDamageeEntity().getLocation(), 10, 0.2, null, 0f, 0f, Material.FIRE, (byte)0, 10, false);
|
Host.Manager.GetBlood().Effects(event.GetDamageeEntity().getLocation(), 10, 0.2, null, 0f, 0f, Material.FIRE, (byte)0, 10, false);
|
||||||
@ -345,7 +355,11 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
|||||||
|
|
||||||
Location loc = GetEntity().getLocation().add(oX, oY, oZ);
|
Location loc = GetEntity().getLocation().add(oX, oY, oZ);
|
||||||
if (UtilMath.offset(loc, minion.getLocation()) > 16)
|
if (UtilMath.offset(loc, minion.getLocation()) > 16)
|
||||||
loc = minion.getLocation().add(UtilAlg.getTrajectory(minion.getLocation(), GetEntity().getLocation().add(oX, oY, oZ)).multiply(16));
|
{
|
||||||
|
Host.Manager.GetBlood().Effects(minion.getLocation(), 10, 0.2, Sound.SKELETON_HURT, 1f, 1f, Material.BONE, (byte)0, 20, false);
|
||||||
|
minion.teleport(loc);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
//Move
|
//Move
|
||||||
EntityCreature ec = ((CraftCreature)minion).getHandle();
|
EntityCreature ec = ((CraftCreature)minion).getHandle();
|
||||||
@ -381,9 +395,17 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
|||||||
{
|
{
|
||||||
Arrow arrow = arrowIterator.next();
|
Arrow arrow = arrowIterator.next();
|
||||||
|
|
||||||
|
if (arrow.getLocation().getY() > 30 && arrow.getVelocity().getY() > 0)
|
||||||
|
{
|
||||||
|
Player target = Host.GetPlayers(true).get(UtilMath.r(Host.GetPlayers(true).size()));
|
||||||
|
arrow.teleport(target.getLocation().add(Math.random() * 8 - 4, Math.random() * 10 + 30, Math.random() * 8 - 4));
|
||||||
|
arrow.setVelocity(arrow.getVelocity().setY(-0.1));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (arrow.getTicksLived() > 200 || arrow.isOnGround())
|
if (arrow.getTicksLived() > 200 || arrow.isOnGround())
|
||||||
{
|
{
|
||||||
if (arrow.isValid() && Math.random() > 0.90)
|
if (arrow.isValid() && Math.random() > 0.50)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -417,27 +439,46 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetState() != 1)
|
//Circle
|
||||||
return;
|
if (GetState() == 1)
|
||||||
|
|
||||||
for (int i=0 ; i<_minions.size() ; i++)
|
|
||||||
{
|
{
|
||||||
Skeleton minion = _minions.get(i);
|
for (int i=0 ; i<_minions.size() ; i++)
|
||||||
|
{
|
||||||
|
Skeleton minion = _minions.get(i);
|
||||||
|
|
||||||
if (!minion.isValid())
|
if (!minion.isValid())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Vector traj = UtilAlg.getTrajectory2d(GetEntity(), minion);
|
Vector traj = UtilAlg.getTrajectory2d(GetEntity(), minion);
|
||||||
traj.add(new Vector(0,Math.random()*0.2,0));
|
traj.add(new Vector(0,Math.random()*0.25,0));
|
||||||
|
|
||||||
Arrow arrow = GetEntity().getWorld().spawnArrow(minion.getEyeLocation().add(traj), traj, 2f, 16f);
|
Arrow arrow = GetEntity().getWorld().spawnArrow(minion.getEyeLocation().add(traj), traj, 2f, 16f);
|
||||||
arrow.setShooter(minion);
|
arrow.setShooter(minion);
|
||||||
|
|
||||||
_arrows.add(arrow);
|
_arrows.add(arrow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Up
|
||||||
|
else if (GetState() == 2)
|
||||||
|
{
|
||||||
|
for (int i=0 ; i<_minions.size() ; i++)
|
||||||
|
{
|
||||||
|
Skeleton minion = _minions.get(i);
|
||||||
|
|
||||||
|
if (!minion.isValid())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Vector traj = new Vector(0,1,0);
|
||||||
|
|
||||||
|
Arrow arrow = GetEntity().getWorld().spawnArrow(minion.getEyeLocation().add(traj), traj, 2f, 16f);
|
||||||
|
arrow.setShooter(minion);
|
||||||
|
|
||||||
|
_arrows.add(arrow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void ShieldSpawn()
|
public void ShieldSpawn()
|
||||||
{
|
{
|
||||||
@ -464,7 +505,18 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
|||||||
|
|
||||||
int toSpawn = 1;
|
int toSpawn = 1;
|
||||||
if (_shields.size() == 0)
|
if (_shields.size() == 0)
|
||||||
|
{
|
||||||
toSpawn = _shieldsMax;
|
toSpawn = _shieldsMax;
|
||||||
|
|
||||||
|
//Sound
|
||||||
|
GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.WITHER_HURT, 10f, 1.5f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Sound
|
||||||
|
GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.WITHER_HURT, 1f, 2f);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for (int i=0 ; i<toSpawn ; i++)
|
for (int i=0 ; i<toSpawn ; i++)
|
||||||
{
|
{
|
||||||
@ -487,7 +539,8 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
|||||||
for (int i=0 ; i<_shields.size() ; i++)
|
for (int i=0 ; i<_shields.size() ; i++)
|
||||||
{
|
{
|
||||||
Slime shield = _shields.get(i);
|
Slime shield = _shields.get(i);
|
||||||
shield.setFireTicks(10);
|
|
||||||
|
UtilParticle.PlayParticle(ParticleType.FLAME, shield.getLocation(), 0.1f, 0.1f, 0.1f, 0, 1);
|
||||||
|
|
||||||
double lead = i * ((2d * Math.PI)/_shields.size());
|
double lead = i * ((2d * Math.PI)/_shields.size());
|
||||||
|
|
||||||
@ -556,9 +609,10 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
|||||||
{
|
{
|
||||||
if (UtilTime.elapsed(_stateTime, 10000))
|
if (UtilTime.elapsed(_stateTime, 10000))
|
||||||
{
|
{
|
||||||
double r = Math.random();
|
if (Math.random() > 0.5)
|
||||||
|
SetState(1);
|
||||||
SetState(1);
|
else
|
||||||
|
SetState(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Outward Arrows
|
//Outward Arrows
|
||||||
@ -616,7 +670,6 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
|||||||
|
|
||||||
//Sound
|
//Sound
|
||||||
GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.WITHER_SPAWN, 10f, 1.5f);
|
GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.WITHER_SPAWN, 10f, 1.5f);
|
||||||
GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.ZOMBIE_PIG_ANGRY, 10f, 0.5f);
|
|
||||||
|
|
||||||
//Speed
|
//Speed
|
||||||
Host.Manager.GetCondition().Factory().Speed("King Speed", GetEntity(), GetEntity(), 9999, 1, false, false, false);
|
Host.Manager.GetCondition().Factory().Speed("King Speed", GetEntity(), GetEntity(), 9999, 1, false, false, false);
|
||||||
@ -670,4 +723,9 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
|||||||
|
|
||||||
return Host.GetPlayers(true).get(UtilMath.r(Host.GetPlayers(true).size()));
|
return Host.GetPlayers(true).get(UtilMath.r(Host.GetPlayers(true).size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean IsFinal()
|
||||||
|
{
|
||||||
|
return _minions.size() == 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ public class KitFinn extends SmashKit
|
|||||||
{
|
{
|
||||||
new PerkInfernoFinn(),
|
new PerkInfernoFinn(),
|
||||||
new PerkBlizzardFinn(),
|
new PerkBlizzardFinn(),
|
||||||
new PerkFletcher(4, 4, false),
|
new PerkFletcher(3, 4, true),
|
||||||
},
|
},
|
||||||
|
|
||||||
EntityType.ZOMBIE, new ItemStack(Material.GOLD_SWORD));
|
EntityType.ZOMBIE, new ItemStack(Material.GOLD_SWORD));
|
||||||
|
@ -32,8 +32,8 @@ public class KitRobinHood extends SmashKit
|
|||||||
{
|
{
|
||||||
new PerkSpeed(1),
|
new PerkSpeed(1),
|
||||||
new PerkRegeneration(0),
|
new PerkRegeneration(0),
|
||||||
new PerkFletcher(1, 4, false),
|
new PerkFletcher(1, 4, true),
|
||||||
new PerkBarrage(4, 250, false),
|
new PerkBarrage(4, 250, true, true),
|
||||||
new PerkQuickshotRobinHood()
|
new PerkQuickshotRobinHood()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
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 nautilus.game.arcade.ArcadeManager;
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
import nautilus.game.arcade.kit.KitAvailability;
|
import nautilus.game.arcade.kit.KitAvailability;
|
||||||
import nautilus.game.arcade.kit.Perk;
|
import nautilus.game.arcade.kit.Perk;
|
||||||
@ -20,18 +21,18 @@ public class KitThor extends SmashKit
|
|||||||
{
|
{
|
||||||
public KitThor(ArcadeManager manager)
|
public KitThor(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Thor Costume", KitAvailability.Free,
|
super(manager, "Thor", KitAvailability.Free,
|
||||||
|
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
"Dress up as Thor, and smash those monsters!",
|
"Smash and kill with your Thor Hammer!",
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
|
|
||||||
new Perk[]
|
new Perk[]
|
||||||
{
|
{
|
||||||
new PerkKnockbackAttack(2),
|
new PerkKnockbackAttack(2),
|
||||||
new PerkFletcher(4, 4, false),
|
new PerkFletcher(3, 4, true),
|
||||||
new PerkSeismicHammer(),
|
new PerkSeismicHammer(),
|
||||||
new PerkHammerThrow(),
|
new PerkHammerThrow(),
|
||||||
},
|
},
|
||||||
@ -85,4 +86,14 @@ public class KitThor extends SmashKit
|
|||||||
Manager.GetCondition().Factory().FireItemImmunity(GetName(), player, player, 1.9, false);
|
Manager.GetCondition().Factory().FireItemImmunity(GetName(), player, player, 1.9, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void DamageBoost(CustomDamageEvent event)
|
||||||
|
{
|
||||||
|
Player damagee = event.GetDamageePlayer();
|
||||||
|
if (damagee == null) return;
|
||||||
|
|
||||||
|
if (HasKit(damagee))
|
||||||
|
event.AddMod("Thor Boost", "Thor Boost", 4, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,9 @@ public class Wave1 extends WaveBase
|
|||||||
if (UtilTime.elapsed(_start, 20000))
|
if (UtilTime.elapsed(_start, 20000))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (Host.GetCreatures().size() > 60)
|
||||||
|
return;
|
||||||
|
|
||||||
if (tick % 10 == 0)
|
if (tick % 10 == 0)
|
||||||
Host.AddCreature(new MobZombie(Host, GetSpawn()));
|
Host.AddCreature(new MobZombie(Host, GetSpawn()));
|
||||||
|
|
||||||
|
@ -23,6 +23,9 @@ public class Wave2 extends WaveBase
|
|||||||
if (tick == 0)
|
if (tick == 0)
|
||||||
Host.AddCreature(new MobGiant(Host, GetSpawn()));
|
Host.AddCreature(new MobGiant(Host, GetSpawn()));
|
||||||
|
|
||||||
|
if (Host.GetCreatures().size() > 60)
|
||||||
|
return;
|
||||||
|
|
||||||
if (tick % 10 == 0)
|
if (tick % 10 == 0)
|
||||||
Host.AddCreature(new MobZombie(Host, GetSpawn()));
|
Host.AddCreature(new MobZombie(Host, GetSpawn()));
|
||||||
|
|
||||||
|
@ -18,6 +18,9 @@ public class Wave3 extends WaveBase
|
|||||||
if (UtilTime.elapsed(_start, 20000))
|
if (UtilTime.elapsed(_start, 20000))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (Host.GetCreatures().size() > 60)
|
||||||
|
return;
|
||||||
|
|
||||||
if (tick % 10 == 0)
|
if (tick % 10 == 0)
|
||||||
Host.AddCreature(new MobSpiderWebber(Host, GetSpawn()));
|
Host.AddCreature(new MobSpiderWebber(Host, GetSpawn()));
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package nautilus.game.arcade.game.games.halloween.waves;
|
package nautilus.game.arcade.game.games.halloween.waves;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
|
||||||
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.MobGhast;
|
import nautilus.game.arcade.game.games.halloween.creatures.MobGhast;
|
||||||
@ -9,7 +11,7 @@ public class Wave4 extends WaveBase
|
|||||||
{
|
{
|
||||||
public Wave4(Halloween host)
|
public Wave4(Halloween host)
|
||||||
{
|
{
|
||||||
super(host, "Ghasts (and friends)", 60000, host.GetSpawnSet(3));
|
super(host, "Ghasts (and friends!)", 60000, host.GetSpawnSet(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -18,8 +20,17 @@ public class Wave4 extends WaveBase
|
|||||||
if (UtilTime.elapsed(_start, 20000))
|
if (UtilTime.elapsed(_start, 20000))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (tick % 100 == 0)
|
if (tick > 0 && tick % 100 == 0)
|
||||||
Host.AddCreature(new MobGhast(Host, GetSpawn().clone().add(0, 30, 0)));
|
{
|
||||||
|
Location loc = GetSpawn();
|
||||||
|
loc.setY(30 + 20 * Math.random());
|
||||||
|
loc.setX(80 * Math.random() - 40);
|
||||||
|
loc.setZ(80 * Math.random() - 40);
|
||||||
|
Host.AddCreature(new MobGhast(Host, loc));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Host.GetCreatures().size() > 60)
|
||||||
|
return;
|
||||||
|
|
||||||
if (tick % 20 == 0)
|
if (tick % 20 == 0)
|
||||||
Host.AddCreature(new MobPigZombie(Host, GetSpawn()));
|
Host.AddCreature(new MobPigZombie(Host, GetSpawn()));
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
package nautilus.game.arcade.game.games.halloween.waves;
|
package nautilus.game.arcade.game.games.halloween.waves;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
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.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.MobWitch;
|
|
||||||
import nautilus.game.arcade.game.games.halloween.creatures.MobZombie;
|
|
||||||
|
|
||||||
public class Wave5 extends WaveBase
|
public class Wave5 extends WaveBase
|
||||||
{
|
{
|
||||||
public Wave5(Halloween host)
|
public Wave5(Halloween host)
|
||||||
{
|
{
|
||||||
super(host, "Witches and Wolves", 60000, host.GetSpawnSet(3));
|
super(host, "Double the Giants! Double the fun!", 60000, host.GetSpawnSet(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -22,7 +18,27 @@ public class Wave5 extends WaveBase
|
|||||||
if (UtilTime.elapsed(_start, 20000))
|
if (UtilTime.elapsed(_start, 20000))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
this.SpawnBeacons(Host.GetSpawnSet(2));
|
||||||
|
|
||||||
if (tick == 0)
|
if (tick == 0)
|
||||||
Host.AddCreature(new MobGhast(Host, GetSpawn().clone().add(0, 40, 0)));
|
{
|
||||||
|
Host.AddCreature(new MobGiant(Host, Host.GetSpawnSet(1).get(UtilMath.r(Host.GetSpawnSet(1).size()))));
|
||||||
|
Host.AddCreature(new MobGiant(Host, Host.GetSpawnSet(2).get(UtilMath.r(Host.GetSpawnSet(2).size()))));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Host.GetCreatures().size() > 60)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (tick % 20 == 0)
|
||||||
|
{
|
||||||
|
Host.AddCreature(new MobGiant(Host, Host.GetSpawnSet(1).get(UtilMath.r(Host.GetSpawnSet(1).size()))));
|
||||||
|
Host.AddCreature(new MobGiant(Host, Host.GetSpawnSet(2).get(UtilMath.r(Host.GetSpawnSet(2).size()))));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tick % 40 == 0)
|
||||||
|
{
|
||||||
|
Host.AddCreature(new MobGiant(Host, Host.GetSpawnSet(1).get(UtilMath.r(Host.GetSpawnSet(1).size()))));
|
||||||
|
Host.AddCreature(new MobGiant(Host, Host.GetSpawnSet(2).get(UtilMath.r(Host.GetSpawnSet(2).size()))));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
package nautilus.game.arcade.game.games.halloween.waves;
|
|
||||||
|
|
||||||
import mineplex.core.common.util.UtilTime;
|
|
||||||
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.MobGiant;
|
|
||||||
import nautilus.game.arcade.game.games.halloween.creatures.MobSkeletonArcher;
|
|
||||||
import nautilus.game.arcade.game.games.halloween.creatures.MobZombie;
|
|
||||||
|
|
||||||
public class Wave6 extends WaveBase
|
|
||||||
{
|
|
||||||
public Wave6(Halloween host)
|
|
||||||
{
|
|
||||||
super(host, "Fiery Night", 60000, host.GetSpawnSet(3));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void Spawn(int tick)
|
|
||||||
{
|
|
||||||
if (UtilTime.elapsed(_start, 20000))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (tick == 0)
|
|
||||||
Host.AddCreature(new MobGiant(Host, GetSpawn()));
|
|
||||||
|
|
||||||
if (tick % 10 == 0)
|
|
||||||
Host.AddCreature(new MobZombie(Host, GetSpawn()));
|
|
||||||
|
|
||||||
if (tick % 20 == 0)
|
|
||||||
Host.AddCreature(new MobSkeletonArcher(Host, GetSpawn()));
|
|
||||||
|
|
||||||
if (tick % 30 == 0)
|
|
||||||
Host.AddCreature(new MobCreeper(Host, GetSpawn()));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
package nautilus.game.arcade.game.games.halloween.waves;
|
|
||||||
|
|
||||||
import mineplex.core.common.util.UtilTime;
|
|
||||||
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.MobGiant;
|
|
||||||
import nautilus.game.arcade.game.games.halloween.creatures.MobSkeletonArcher;
|
|
||||||
import nautilus.game.arcade.game.games.halloween.creatures.MobZombie;
|
|
||||||
|
|
||||||
public class Wave7 extends WaveBase
|
|
||||||
{
|
|
||||||
public Wave7(Halloween host)
|
|
||||||
{
|
|
||||||
super(host, "Giants, Zombies, Witches and Ghasts...", 60000, host.GetSpawnSet(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void Spawn(int tick)
|
|
||||||
{
|
|
||||||
if (UtilTime.elapsed(_start, 20000))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (tick == 0)
|
|
||||||
Host.AddCreature(new MobGiant(Host, GetSpawn()));
|
|
||||||
|
|
||||||
if (tick % 10 == 0)
|
|
||||||
Host.AddCreature(new MobZombie(Host, GetSpawn()));
|
|
||||||
|
|
||||||
if (tick % 20 == 0)
|
|
||||||
Host.AddCreature(new MobSkeletonArcher(Host, GetSpawn()));
|
|
||||||
|
|
||||||
if (tick % 30 == 0)
|
|
||||||
Host.AddCreature(new MobCreeper(Host, GetSpawn()));
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,6 +2,7 @@ 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.MobCreeper;
|
||||||
|
import nautilus.game.arcade.game.games.halloween.creatures.MobGiant;
|
||||||
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;
|
||||||
|
|
||||||
@ -11,7 +12,7 @@ public class WaveBoss extends WaveBase
|
|||||||
|
|
||||||
public WaveBoss(Halloween host)
|
public WaveBoss(Halloween host)
|
||||||
{
|
{
|
||||||
super(host, "The Pumpkin King", 0, host.GetSpawnSet(3));
|
super(host, "The Pumpkin King", 0, host.GetSpawnSet(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -22,15 +23,22 @@ public class WaveBoss extends WaveBase
|
|||||||
_king = new PumpkinKing(Host, Host.WorldData.GetDataLocs("BLACK").get(0));
|
_king = new PumpkinKing(Host, Host.WorldData.GetDataLocs("BLACK").get(0));
|
||||||
Host.AddCreature(_king);
|
Host.AddCreature(_king);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Host.GetCreatures().size() < 30)
|
//Increasing difficulty of mobs
|
||||||
|
if (Host.GetCreatures().size() < 20 + (tick/300) && !_king.IsFinal())
|
||||||
{
|
{
|
||||||
if (tick % 30 == 0)
|
if (tick % Math.max(5, 20 - tick/600) == 0)
|
||||||
if (Math.random() > 0.10)
|
if (Math.random() > 0.10)
|
||||||
Host.AddCreature(new MobZombie(Host, Host.GetRandomSpawn()));
|
Host.AddCreature(new MobZombie(Host, Host.GetRandomSpawn()));
|
||||||
else
|
else
|
||||||
Host.AddCreature(new MobCreeper(Host, Host.GetRandomSpawn()));
|
Host.AddCreature(new MobCreeper(Host, Host.GetRandomSpawn()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Giant every 2 minutes
|
||||||
|
if (tick % 2400 == 0 && !_king.IsFinal())
|
||||||
|
{
|
||||||
|
Host.AddCreature(new MobGiant(Host, GetSpawn()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -25,7 +25,7 @@ public class KitArcher extends Kit
|
|||||||
new Perk[]
|
new Perk[]
|
||||||
{
|
{
|
||||||
new PerkFletcher(20, 3, true),
|
new PerkFletcher(20, 3, true),
|
||||||
new PerkBarrage(5, 250, true),
|
new PerkBarrage(5, 250, true, false),
|
||||||
},
|
},
|
||||||
EntityType.ZOMBIE,
|
EntityType.ZOMBIE,
|
||||||
new ItemStack(Material.BOW));
|
new ItemStack(Material.BOW));
|
||||||
|
@ -40,7 +40,7 @@ public class KitSkeleton extends SmashKit
|
|||||||
new PerkKnockbackArrow(2),
|
new PerkKnockbackArrow(2),
|
||||||
new PerkBoneExplosion(),
|
new PerkBoneExplosion(),
|
||||||
new PerkRopedArrow("Roped Arrow", 1, 5000),
|
new PerkRopedArrow("Roped Arrow", 1, 5000),
|
||||||
new PerkBarrage(5, 250, true),
|
new PerkBarrage(5, 250, true, false),
|
||||||
},
|
},
|
||||||
EntityType.SKELETON,
|
EntityType.SKELETON,
|
||||||
new ItemStack(Material.BOW));
|
new ItemStack(Material.BOW));
|
||||||
|
@ -11,11 +11,12 @@ import mineplex.core.common.util.C;
|
|||||||
import mineplex.core.common.util.UtilParticle;
|
import mineplex.core.common.util.UtilParticle;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
import mineplex.core.disguise.disguises.DisguiseSkeleton;
|
import mineplex.core.disguise.disguises.DisguiseWitch;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
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;
|
||||||
|
import nautilus.game.arcade.game.Game.GameState;
|
||||||
import nautilus.game.arcade.kit.KitAvailability;
|
import nautilus.game.arcade.kit.KitAvailability;
|
||||||
import nautilus.game.arcade.kit.Perk;
|
import nautilus.game.arcade.kit.Perk;
|
||||||
import nautilus.game.arcade.kit.SmashKit;
|
import nautilus.game.arcade.kit.SmashKit;
|
||||||
@ -35,8 +36,9 @@ public class KitWitch extends SmashKit
|
|||||||
{
|
{
|
||||||
new PerkSmashStats(6, 1.5, 0.15, 5),
|
new PerkSmashStats(6, 1.5, 0.15, 5),
|
||||||
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
|
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
|
||||||
|
new PerkWitchPotion(),
|
||||||
new PerkBatWave(),
|
new PerkBatWave(),
|
||||||
new PerkWitchPotion()
|
|
||||||
|
|
||||||
},
|
},
|
||||||
EntityType.WITCH,
|
EntityType.WITCH,
|
||||||
@ -46,28 +48,39 @@ public class KitWitch extends SmashKit
|
|||||||
@Override
|
@Override
|
||||||
public void GiveItems(Player player)
|
public void GiveItems(Player player)
|
||||||
{
|
{
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD, (byte)0, 1,
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1,
|
||||||
C.cYellow + C.Bold + "Hold Block" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "",
|
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Stun Potion",
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
ChatColor.RESET + "",
|
ChatColor.RESET + "Throw a potion that damages and slows",
|
||||||
|
ChatColor.RESET + "anything it splashes onto!",
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SPADE, (byte)0, 1,
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1,
|
|
||||||
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Bat Wave",
|
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Bat Wave",
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
ChatColor.RESET + "",
|
ChatColor.RESET + "Release a wave of bats which give",
|
||||||
|
ChatColor.RESET + "damage and knockback to anything they",
|
||||||
|
ChatColor.RESET + "collide with.",
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
if (Manager.GetGame().GetState() == GameState.Recruit)
|
||||||
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.LEASH, (byte)0, 1,
|
||||||
|
C.cYellow + C.Bold + "Double Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Bat Leash",
|
||||||
|
new String[]
|
||||||
|
{
|
||||||
|
ChatColor.RESET + "Attach a rope to your wave of bats,",
|
||||||
|
ChatColor.RESET + "causing you to be pulled behind them!",
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE));
|
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE));
|
||||||
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS));
|
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS));
|
||||||
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS));
|
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS));
|
||||||
|
|
||||||
//Disguise
|
//Disguise
|
||||||
DisguiseSkeleton disguise = new DisguiseSkeleton(player);
|
DisguiseWitch disguise = new DisguiseWitch(player);
|
||||||
disguise.SetName(C.cYellow + player.getName());
|
disguise.SetName(C.cYellow + player.getName());
|
||||||
disguise.SetCustomNameVisible(true);
|
disguise.SetCustomNameVisible(true);
|
||||||
Manager.GetDisguise().disguise(disguise);
|
Manager.GetDisguise().disguise(disguise);
|
||||||
|
@ -27,7 +27,7 @@ public class KitShredder extends Kit
|
|||||||
{
|
{
|
||||||
new PerkConstructor("Constructor", 4, 6, Material.WOOL, "Wool", false),
|
new PerkConstructor("Constructor", 4, 6, Material.WOOL, "Wool", false),
|
||||||
new PerkFletcher(4, 2, false),
|
new PerkFletcher(4, 2, false),
|
||||||
new PerkBarrage(5, 250, false),
|
new PerkBarrage(5, 250, false, false),
|
||||||
},
|
},
|
||||||
EntityType.ZOMBIE,
|
EntityType.ZOMBIE,
|
||||||
new ItemStack(Material.BOW));
|
new ItemStack(Material.BOW));
|
||||||
|
@ -27,7 +27,7 @@ public class KitSurvivorArcher extends Kit
|
|||||||
new Perk[]
|
new Perk[]
|
||||||
{
|
{
|
||||||
new PerkFletcher(2, 8, true),
|
new PerkFletcher(2, 8, true),
|
||||||
new PerkBarrage(5, 250, true)
|
new PerkBarrage(5, 250, true, false)
|
||||||
},
|
},
|
||||||
EntityType.SKELETON,
|
EntityType.SKELETON,
|
||||||
new ItemStack(Material.BOW));
|
new ItemStack(Material.BOW));
|
||||||
|
@ -10,9 +10,11 @@ import org.bukkit.entity.Arrow;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.entity.EntityShootBowEvent;
|
import org.bukkit.event.entity.EntityShootBowEvent;
|
||||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
@ -23,6 +25,7 @@ import mineplex.core.common.util.UtilServer;
|
|||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
import nautilus.game.arcade.kit.Perk;
|
import nautilus.game.arcade.kit.Perk;
|
||||||
|
|
||||||
public class PerkBarrage extends Perk
|
public class PerkBarrage extends Perk
|
||||||
@ -36,8 +39,9 @@ public class PerkBarrage extends Perk
|
|||||||
private int _max;
|
private int _max;
|
||||||
private long _tick;
|
private long _tick;
|
||||||
private boolean _remove;
|
private boolean _remove;
|
||||||
|
private boolean _noDelay;
|
||||||
|
|
||||||
public PerkBarrage(int max, long tick, boolean remove)
|
public PerkBarrage(int max, long tick, boolean remove, boolean noDelay)
|
||||||
{
|
{
|
||||||
super("Barrage", new String[]
|
super("Barrage", new String[]
|
||||||
{
|
{
|
||||||
@ -47,6 +51,7 @@ public class PerkBarrage extends Perk
|
|||||||
_max = max;
|
_max = max;
|
||||||
_tick = tick;
|
_tick = tick;
|
||||||
_remove = remove;
|
_remove = remove;
|
||||||
|
_noDelay = noDelay;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -189,6 +194,36 @@ public class PerkBarrage extends Perk
|
|||||||
_firing.remove(cur);
|
_firing.remove(cur);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
|
public void BarrageDamageTime(CustomDamageEvent event)
|
||||||
|
{
|
||||||
|
if (!_noDelay)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.GetProjectile() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.GetDamagerPlayer(true) == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!(event.GetProjectile() instanceof Arrow))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player damager = event.GetDamagerPlayer(true);
|
||||||
|
|
||||||
|
if (!Kit.HasKit(damager))
|
||||||
|
return;
|
||||||
|
|
||||||
|
event.SetCancelled("Barrage Cancel");
|
||||||
|
|
||||||
|
event.GetProjectile().remove();
|
||||||
|
|
||||||
|
//Damage Event
|
||||||
|
Manager.GetDamage().NewDamageEvent(event.GetDamageeEntity(), damager, null,
|
||||||
|
DamageCause.THORNS, event.GetDamage(), true, true, false,
|
||||||
|
damager.getName(), GetName());
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void BarrageProjectileHit(ProjectileHitEvent event)
|
public void BarrageProjectileHit(ProjectileHitEvent event)
|
||||||
|
@ -2,6 +2,7 @@ package nautilus.game.arcade.kit.perks;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
@ -21,7 +22,6 @@ import mineplex.core.common.util.UtilAction;
|
|||||||
import mineplex.core.common.util.UtilAlg;
|
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.common.util.UtilEnt;
|
||||||
import mineplex.core.common.util.UtilMath;
|
|
||||||
import mineplex.core.common.util.UtilParticle;
|
import mineplex.core.common.util.UtilParticle;
|
||||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
@ -36,17 +36,32 @@ import nautilus.game.arcade.kit.Perk;
|
|||||||
public class PerkBatWave extends Perk
|
public class PerkBatWave extends Perk
|
||||||
{
|
{
|
||||||
private HashMap<Player, Long> _active = new HashMap<Player, Long>();
|
private HashMap<Player, Long> _active = new HashMap<Player, Long>();
|
||||||
private HashMap<Player, Location> _velocity = new HashMap<Player, Location>();
|
private HashMap<Player, Location> _direction = new HashMap<Player, Location>();
|
||||||
private HashMap<Player, ArrayList<Bat>> _bats = new HashMap<Player, ArrayList<Bat>>();
|
private HashMap<Player, ArrayList<Bat>> _bats = new HashMap<Player, ArrayList<Bat>>();
|
||||||
|
private HashSet<Player> _pulling = new HashSet<Player>();
|
||||||
|
private HashSet<Player> _allowLeash = new HashSet<Player>();
|
||||||
|
|
||||||
public PerkBatWave()
|
public PerkBatWave()
|
||||||
{
|
{
|
||||||
super("Bat Wave", new String[]
|
super("Bat Wave", new String[]
|
||||||
{
|
{
|
||||||
C.cYellow + "Right-Click" + C.cGray + " to use " + C.cGreen + "Bat Wave"
|
C.cYellow + "Right-Click" + C.cGray + " to use " + C.cGreen + "Bat Wave",
|
||||||
|
C.cYellow + "Double Right-Click" + C.cGray + " to use " + C.cGreen + "Bat Leash"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void Deactivate(CustomDamageEvent event)
|
||||||
|
{
|
||||||
|
Player player = event.GetDamageePlayer();
|
||||||
|
if (player == null) return;
|
||||||
|
|
||||||
|
if (_pulling.remove(player))
|
||||||
|
{
|
||||||
|
for (Bat bat : _bats.get(player))
|
||||||
|
bat.setLeashHolder(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void Activate(PlayerInteractEvent event)
|
public void Activate(PlayerInteractEvent event)
|
||||||
@ -60,7 +75,7 @@ public class PerkBatWave extends Perk
|
|||||||
if (UtilBlock.usable(event.getClickedBlock()))
|
if (UtilBlock.usable(event.getClickedBlock()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!event.getPlayer().getItemInHand().getType().toString().contains("_AXE"))
|
if (!event.getPlayer().getItemInHand().getType().toString().contains("_SPADE"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
@ -68,26 +83,55 @@ public class PerkBatWave extends Perk
|
|||||||
if (!Kit.HasKit(player))
|
if (!Kit.HasKit(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!Recharge.Instance.use(player, GetName(), 8000, true))
|
if (!Recharge.Instance.use(player, GetName(), 8000, false))
|
||||||
return;
|
|
||||||
|
|
||||||
//Start
|
|
||||||
_velocity.put(player, player.getEyeLocation());
|
|
||||||
_active.put(player, System.currentTimeMillis());
|
|
||||||
|
|
||||||
_bats.put(player, new ArrayList<Bat>());
|
|
||||||
|
|
||||||
for (int i=0 ; i<16 ; i++)
|
|
||||||
{
|
{
|
||||||
Manager.GetGame().CreatureAllowOverride = true;
|
if (_active.containsKey(player))
|
||||||
Bat bat = player.getWorld().spawn(player.getEyeLocation(), Bat.class);
|
{
|
||||||
_bats.get(player).add(bat);
|
if (!Recharge.Instance.use(player, "Leash Bats", 500, false))
|
||||||
//bat.setLeashHolder(player);
|
return;
|
||||||
Manager.GetGame().CreatureAllowOverride = false;
|
|
||||||
|
if (!_pulling.remove(player))
|
||||||
|
{
|
||||||
|
if (_allowLeash.remove(player))
|
||||||
|
{
|
||||||
|
_pulling.add(player);
|
||||||
|
|
||||||
|
for (Bat bat : _bats.get(player))
|
||||||
|
bat.setLeashHolder(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (Bat bat : _bats.get(player))
|
||||||
|
bat.setLeashHolder(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Inform
|
||||||
|
Recharge.Instance.use(player, GetName(), 8000, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Start
|
||||||
|
_direction.put(player, player.getEyeLocation());
|
||||||
|
_active.put(player, System.currentTimeMillis());
|
||||||
|
_allowLeash.add(player);
|
||||||
|
|
||||||
|
_bats.put(player, new ArrayList<Bat>());
|
||||||
|
|
||||||
|
for (int i=0 ; i<16 ; i++)
|
||||||
|
{
|
||||||
|
Manager.GetGame().CreatureAllowOverride = true;
|
||||||
|
Bat bat = player.getWorld().spawn(player.getEyeLocation(), Bat.class);
|
||||||
|
_bats.get(player).add(bat);
|
||||||
|
Manager.GetGame().CreatureAllowOverride = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Inform
|
||||||
|
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Inform
|
|
||||||
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -107,10 +151,10 @@ public class PerkBatWave extends Perk
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Location loc = _velocity.get(cur);
|
Location loc = _direction.get(cur);
|
||||||
|
|
||||||
//Vector batVec = new Vector(0,0,0);
|
Vector batVec = new Vector(0,0,0);
|
||||||
//double batCount = 0;
|
double batCount = 0;
|
||||||
|
|
||||||
//Bat Movement
|
//Bat Movement
|
||||||
for (Bat bat : _bats.get(cur))
|
for (Bat bat : _bats.get(cur))
|
||||||
@ -118,11 +162,11 @@ public class PerkBatWave extends Perk
|
|||||||
if (!bat.isValid())
|
if (!bat.isValid())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//batVec.add(bat.getLocation().toVector());
|
batVec.add(bat.getLocation().toVector());
|
||||||
//batCount++;
|
batCount++;
|
||||||
|
|
||||||
Vector rand = new Vector((Math.random() - 0.5)/3, (Math.random() - 0.5)/3, (Math.random() - 0.5)/3);
|
Vector rand = new Vector((Math.random() - 0.5)/3, (Math.random() - 0.5)/3, (Math.random() - 0.5)/3);
|
||||||
bat.setVelocity(loc.getDirection().clone().multiply(0.5).add(rand));
|
bat.setVelocity(loc.getDirection().clone().multiply(0.75).add(rand));
|
||||||
|
|
||||||
for (Player other : Manager.GetGame().GetPlayers(true))
|
for (Player other : Manager.GetGame().GetPlayers(true))
|
||||||
{
|
{
|
||||||
@ -136,7 +180,7 @@ public class PerkBatWave extends Perk
|
|||||||
{
|
{
|
||||||
//Damage Event
|
//Damage Event
|
||||||
Manager.GetDamage().NewDamageEvent(other, cur, null,
|
Manager.GetDamage().NewDamageEvent(other, cur, null,
|
||||||
DamageCause.CUSTOM, 2, true, true, false,
|
DamageCause.CUSTOM, 2.5, true, true, false,
|
||||||
cur.getName(), GetName());
|
cur.getName(), GetName());
|
||||||
|
|
||||||
//Effect
|
//Effect
|
||||||
@ -152,13 +196,14 @@ public class PerkBatWave extends Perk
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Player Pull
|
//Player Pull
|
||||||
/*
|
if (_pulling.contains(cur))
|
||||||
batVec.multiply(1/batCount);
|
{
|
||||||
|
batVec.multiply(1/batCount);
|
||||||
Location batLoc = batVec.toLocation(cur.getWorld());
|
|
||||||
|
Location batLoc = batVec.toLocation(cur.getWorld());
|
||||||
UtilAction.velocity(cur, UtilAlg.getTrajectory(cur.getLocation(), batLoc), 0.3, false, 0, 0, 10, false);
|
|
||||||
*/
|
UtilAction.velocity(cur, UtilAlg.getTrajectory(cur.getLocation(), batLoc), 0.5, false, 0, 0, 10, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,7 +222,8 @@ public class PerkBatWave extends Perk
|
|||||||
public void Clear(Player player)
|
public void Clear(Player player)
|
||||||
{
|
{
|
||||||
_active.remove(player);
|
_active.remove(player);
|
||||||
_velocity.remove(player);
|
_direction.remove(player);
|
||||||
|
_pulling.remove(player);
|
||||||
if (_bats.containsKey(player))
|
if (_bats.containsKey(player))
|
||||||
{
|
{
|
||||||
for (Bat bat : _bats.get(player))
|
for (Bat bat : _bats.get(player))
|
||||||
@ -199,6 +245,6 @@ public class PerkBatWave extends Perk
|
|||||||
if (event.GetReason() == null || !event.GetReason().contains(GetName()))
|
if (event.GetReason() == null || !event.GetReason().contains(GetName()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
event.AddKnockback(GetName(), 1);
|
event.AddKnockback(GetName(), 1.75);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ public class PerkBlizzardFinn extends Perk
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UtilTime.elapsed(_active.get(player), 1500))
|
if (UtilTime.elapsed(_active.get(player), 2000))
|
||||||
{
|
{
|
||||||
_active.remove(player);
|
_active.remove(player);
|
||||||
continue;
|
continue;
|
||||||
|
@ -85,7 +85,7 @@ public class PerkInfernoFinn extends Perk
|
|||||||
|
|
||||||
//Fire
|
//Fire
|
||||||
Item fire = cur.getWorld().dropItem(cur.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.FIRE));
|
Item fire = cur.getWorld().dropItem(cur.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.FIRE));
|
||||||
Manager.GetFire().Add(fire, cur, 0.7, 0, 0.5, 2, "Inferno");
|
Manager.GetFire().Add(fire, cur, 0.7, 0, 2, 2, "Inferno");
|
||||||
|
|
||||||
fire.teleport(cur.getEyeLocation());
|
fire.teleport(cur.getEyeLocation());
|
||||||
double x = 0.07 - (UtilMath.r(14)/100d);
|
double x = 0.07 - (UtilMath.r(14)/100d);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package nautilus.game.arcade.kit.perks;
|
package nautilus.game.arcade.kit.perks;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -52,5 +53,7 @@ public class PerkQuickshotRobinHood extends Perk
|
|||||||
|
|
||||||
Arrow arrow = player.launchProjectile(Arrow.class);
|
Arrow arrow = player.launchProjectile(Arrow.class);
|
||||||
arrow.setVelocity(player.getLocation().getDirection().multiply(2));
|
arrow.setVelocity(player.getLocation().getDirection().multiply(2));
|
||||||
|
|
||||||
|
player.getWorld().playSound(player.getLocation(), Sound.SHOOT_ARROW, 1f, 1f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,29 +1,41 @@
|
|||||||
package nautilus.game.arcade.kit.perks;
|
package nautilus.game.arcade.kit.perks;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.entity.ThrownPotion;
|
import org.bukkit.entity.ThrownPotion;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilAction;
|
import mineplex.core.common.util.UtilAction;
|
||||||
import mineplex.core.common.util.UtilBlock;
|
import mineplex.core.common.util.UtilBlock;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.recharge.Recharge;
|
import mineplex.core.recharge.Recharge;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
import nautilus.game.arcade.kit.Perk;
|
import nautilus.game.arcade.kit.Perk;
|
||||||
|
|
||||||
public class PerkWitchPotion extends Perk
|
public class PerkWitchPotion extends Perk
|
||||||
{
|
{
|
||||||
|
private ArrayList<Projectile> _proj = new ArrayList<Projectile>();
|
||||||
|
|
||||||
public PerkWitchPotion()
|
public PerkWitchPotion()
|
||||||
{
|
{
|
||||||
super("Throw Potion", new String[]
|
super("Stun Potion", new String[]
|
||||||
{
|
{
|
||||||
C.cYellow + "Right-Click" + C.cGray + " to use " + C.cGreen + "Throw Potion"
|
C.cYellow + "Right-Click" + C.cGray + " to use " + C.cGreen + "Paralyze Potion"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,7 +52,7 @@ public class PerkWitchPotion extends Perk
|
|||||||
if (UtilBlock.usable(event.getClickedBlock()))
|
if (UtilBlock.usable(event.getClickedBlock()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!event.getPlayer().getItemInHand().getType().toString().contains("_SPADE"))
|
if (!event.getPlayer().getItemInHand().getType().toString().contains("_AXE"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
@ -53,9 +65,57 @@ public class PerkWitchPotion extends Perk
|
|||||||
|
|
||||||
//Start
|
//Start
|
||||||
ThrownPotion potion = player.launchProjectile(ThrownPotion.class);
|
ThrownPotion potion = player.launchProjectile(ThrownPotion.class);
|
||||||
UtilAction.velocity(potion, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false);
|
UtilAction.velocity(potion, player.getLocation().getDirection(), 1, false, 0, 0.2, 10, false);
|
||||||
|
|
||||||
|
_proj.add(potion);
|
||||||
|
|
||||||
//Inform
|
//Inform
|
||||||
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
|
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void Hit(ProjectileHitEvent event)
|
||||||
|
{
|
||||||
|
if (!_proj.remove(event.getEntity()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Player player : Manager.GetGame().GetPlayers(true))
|
||||||
|
{
|
||||||
|
if (player.equals(event.getEntity().getShooter()))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (UtilMath.offset(player.getLocation().add(0,1,0), event.getEntity().getLocation()) > 3)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//Damage Event
|
||||||
|
Manager.GetDamage().NewDamageEvent(player, event.getEntity().getShooter(), null,
|
||||||
|
DamageCause.CUSTOM, 4, false, true, false,
|
||||||
|
UtilEnt.getName(event.getEntity().getShooter()), GetName());
|
||||||
|
|
||||||
|
//Slow
|
||||||
|
Manager.GetCondition().Factory().Slow(GetName(), player, event.getEntity().getShooter(), 2, 2, false, false, true, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void Update(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Iterator<Projectile> potionIterator = _proj.iterator();
|
||||||
|
|
||||||
|
while (potionIterator.hasNext())
|
||||||
|
{
|
||||||
|
Projectile proj = potionIterator.next();
|
||||||
|
|
||||||
|
if (!proj.isValid())
|
||||||
|
{
|
||||||
|
potionIterator.remove();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
UtilParticle.PlayParticle(ParticleType.FIREWORKS_SPARK, proj.getLocation(), 0, 0, 0, 0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -287,7 +287,7 @@ public class PerkWolf extends Perk
|
|||||||
for (Player other : Manager.GetGame().GetPlayers(true))
|
for (Player other : Manager.GetGame().GetPlayers(true))
|
||||||
if (!player.equals(other))
|
if (!player.equals(other))
|
||||||
if (other.getGameMode() == GameMode.SURVIVAL)
|
if (other.getGameMode() == GameMode.SURVIVAL)
|
||||||
if (UtilEnt.hitBox(player.getLocation(), other, 2, null))
|
if (UtilEnt.hitBox(player.getLocation().add(0, 1, 0), other, 2, null))
|
||||||
{
|
{
|
||||||
StrikeHit(player, other);
|
StrikeHit(player, other);
|
||||||
playerIterator.remove();
|
playerIterator.remove();
|
||||||
|
@ -4,6 +4,7 @@ import java.util.Iterator;
|
|||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilDisplay;
|
||||||
import mineplex.core.common.util.UtilInv;
|
import mineplex.core.common.util.UtilInv;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
@ -34,6 +35,8 @@ import org.bukkit.event.Listener;
|
|||||||
public class GameManager implements Listener
|
public class GameManager implements Listener
|
||||||
{
|
{
|
||||||
ArcadeManager Manager;
|
ArcadeManager Manager;
|
||||||
|
|
||||||
|
private int _colorId = 0;
|
||||||
|
|
||||||
public GameManager(ArcadeManager manager)
|
public GameManager(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
@ -41,6 +44,38 @@ public class GameManager implements Listener
|
|||||||
|
|
||||||
Manager.GetPluginManager().registerEvents(this, Manager.GetPlugin());
|
Manager.GetPluginManager().registerEvents(this, Manager.GetPlugin());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void DisplayIP(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.FASTER)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (Manager.GetGame() != null && Manager.GetGame().GetState() != GameState.Live)
|
||||||
|
{
|
||||||
|
ChatColor col = ChatColor.RED;
|
||||||
|
if (_colorId == 1) col = ChatColor.YELLOW;
|
||||||
|
else if (_colorId == 2) col = ChatColor.GREEN;
|
||||||
|
else if (_colorId == 3) col = ChatColor.AQUA;
|
||||||
|
_colorId = (_colorId+1)%4;
|
||||||
|
|
||||||
|
String text = col + C.Bold + "US.MINEPLEX.COM EU.MINEPLEX.COM";
|
||||||
|
|
||||||
|
double health = 1;
|
||||||
|
if (Manager.GetGame().GetState() == GameState.Prepare)
|
||||||
|
{
|
||||||
|
health = (9 - (System.currentTimeMillis() - Manager.GetGame().GetStateTime())/1000d) / 9d;
|
||||||
|
}
|
||||||
|
else if (Manager.GetGame().GetState() == GameState.Recruit)
|
||||||
|
{
|
||||||
|
if (Manager.GetGame().GetCountdown() >= 0)
|
||||||
|
health = Manager.GetGame().GetCountdown() / 60d;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Player player : UtilServer.getPlayers())
|
||||||
|
UtilDisplay.displayTextBar(Manager.GetPlugin(), player, health, text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void StateUpdate(UpdateEvent event)
|
public void StateUpdate(UpdateEvent event)
|
||||||
|
Loading…
Reference in New Issue
Block a user