Merge branch 'master' of ssh://dev.mineplex.com:7999/min/Mineplex
Conflicts: Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/Halloween2013_BatGun.java Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/Halloween2013_Helmet.java Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/ArmorGadget.java Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/Gadget.java Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/ItemGadget.java Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobGhast.java
This commit is contained in:
commit
9bc9cc2bb8
@ -2,6 +2,7 @@ package mineplex.core.common.util;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import net.minecraft.server.v1_6_R3.Packet63WorldParticles;
|
||||
|
||||
import org.bukkit.Location;
|
||||
@ -104,4 +105,10 @@ public class UtilParticle
|
||||
|
||||
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
|
||||
}
|
||||
|
||||
public static void PlayParticle(ParticleType type, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count)
|
||||
{
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
PlayParticle(player, type, location, offsetX, offsetY, offsetZ, speed, count);
|
||||
}
|
||||
}
|
@ -291,8 +291,7 @@ public class Explosion extends MiniPlugin
|
||||
|
||||
blocks.put(cur, new AbstractMap.SimpleEntry<Integer, Byte>(cur.getTypeId(), cur.getData()));
|
||||
|
||||
if (cur.getTypeId() != 98 || cur.getData() != 0)
|
||||
cur.setType(Material.AIR);
|
||||
cur.setType(Material.AIR);
|
||||
}
|
||||
|
||||
//DELAY
|
||||
|
@ -1,12 +1,5 @@
|
||||
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 org.bukkit.Bukkit;
|
||||
@ -46,6 +39,7 @@ import mineplex.core.common.util.UtilMath;
|
||||
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.UtilWorld;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
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 String _pigStacker = "0 - Nobody";
|
||||
|
||||
public String DragonTextA = "Mineplex";
|
||||
public String DragonTextB = "";
|
||||
|
||||
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)
|
||||
{
|
||||
@ -121,50 +113,6 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
_partyManager = partyManager;
|
||||
_tutorialManager = new TutorialManager(this, donationManager, taskManager, _textCreator);
|
||||
_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)
|
||||
@ -322,6 +270,8 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
player.getScoreboard().resetScores(event.getPlayer());
|
||||
|
||||
_scoreboards.remove(event.getPlayer());
|
||||
|
||||
_portalTime.remove(event.getPlayer().getName());
|
||||
}
|
||||
|
||||
@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.gadget.gadgets.Halloween2013_BatGun;
|
||||
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.ArmorSlot;
|
||||
import mineplex.hub.gadget.types.Gadget;
|
||||
@ -32,6 +33,10 @@ public class GadgetManager extends MiniPlugin
|
||||
{
|
||||
_gadgets = new HashSet<Gadget>();
|
||||
|
||||
//Items
|
||||
_gadgets.add(new PaintballGun(this));
|
||||
|
||||
//Halloween 2013
|
||||
_gadgets.add(new Halloween2013_BatGun(this));
|
||||
_gadgets.add(new Halloween2013_Helmet(this));
|
||||
}
|
||||
|
@ -1,5 +1,9 @@
|
||||
package mineplex.hub.gadget.gadgets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Bat;
|
||||
@ -7,16 +11,40 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.block.Action;
|
||||
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.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.hub.gadget.GadgetManager;
|
||||
import mineplex.hub.gadget.types.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)
|
||||
{
|
||||
super(manager, "Halloween2013_BatGun", "Bat Gun", 10000, Material.COAL_BLOCK, (byte)0);
|
||||
super(manager, "Gadget_Halloween2013_BatGun", "Bat Blaster", 10000, new String[]
|
||||
{
|
||||
C.cWhite + "Launch waves of annoying bats",
|
||||
C.cWhite + "at people you don't like!",
|
||||
},
|
||||
Material.IRON_BARDING, (byte)0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -29,29 +57,115 @@ public class Halloween2013_BatGun extends ItemGadget
|
||||
public void Disable(Player player)
|
||||
{
|
||||
this.RemoveItem(player);
|
||||
|
||||
Clear(player);
|
||||
}
|
||||
|
||||
@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;
|
||||
|
||||
if (!UtilGear.isMat(event.getPlayer().getItemInHand(), Material.IRON_BARDING))
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
|
||||
if (!IsActive(player))
|
||||
return;
|
||||
|
||||
if (!Recharge.Instance.use(player, GetName(), 10000, true))
|
||||
if (!Recharge.Instance.use(player, GetName(), 8000, true))
|
||||
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);
|
||||
player.getWorld().playSound(player.getLocation(), Sound.BAT_HURT, 2f, 1f);
|
||||
//Start
|
||||
_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.entity.Player;
|
||||
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.disguise.disguises.DisguiseSkeleton;
|
||||
import mineplex.hub.gadget.GadgetManager;
|
||||
@ -15,21 +14,30 @@ public class Halloween2013_Helmet extends ArmorGadget
|
||||
{
|
||||
public Halloween2013_Helmet(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Halloween2013_Helmet", "Pumpkin Kings Head", -1, 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
|
||||
public void Enable(final Player player)
|
||||
{
|
||||
this.ApplyArmor(player);
|
||||
|
||||
|
||||
DisguiseSkeleton disguise = new DisguiseSkeleton(player);
|
||||
disguise.showArmor();
|
||||
disguise.SetName(player.getName());
|
||||
disguise.SetCustomNameVisible(true);
|
||||
disguise.SetSkeletonType(SkeletonType.WITHER);
|
||||
Manager.Manager.GetDisguise().disguise(disguise);
|
||||
|
||||
|
||||
Manager.Manager.GetPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.Manager.GetPlugin(), new Runnable()
|
||||
{
|
||||
public void run()
|
||||
@ -49,13 +57,6 @@ public class Halloween2013_Helmet extends ArmorGadget
|
||||
this.RemoveArmor(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,15 +22,17 @@ public abstract class ArmorGadget extends Gadget
|
||||
private Material _material;
|
||||
private byte _data;
|
||||
|
||||
public ArmorGadget(GadgetManager manager, String code, String name, int cost, 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, cost);
|
||||
super(manager, code, name, desc);
|
||||
|
||||
_slot = slot;
|
||||
_material = mat;
|
||||
_data = data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ArmorSlot GetSlot()
|
||||
{
|
||||
return _slot;
|
||||
|
@ -19,15 +19,15 @@ public abstract class Gadget implements Listener
|
||||
|
||||
private String _code;
|
||||
private String _name;
|
||||
private int _cost;
|
||||
private String[] _desc;
|
||||
|
||||
public Gadget(GadgetManager manager, String code, String name, int cost)
|
||||
public Gadget(GadgetManager manager, String code, String name, String[] desc)
|
||||
{
|
||||
Manager = manager;
|
||||
|
||||
_code = code;
|
||||
_name = name;
|
||||
_cost = cost;
|
||||
_desc = desc;
|
||||
|
||||
Manager.GetPlugin().getServer().getPluginManager().registerEvents(this, Manager.GetPlugin());
|
||||
}
|
||||
@ -37,16 +37,16 @@ public abstract class Gadget implements Listener
|
||||
return _name;
|
||||
}
|
||||
|
||||
public String[] GetDesc()
|
||||
{
|
||||
return _desc;
|
||||
}
|
||||
|
||||
public String GetCode()
|
||||
{
|
||||
return _code;
|
||||
}
|
||||
|
||||
public int getCost()
|
||||
{
|
||||
return _cost;
|
||||
}
|
||||
|
||||
public HashSet<Player> GetOwners()
|
||||
{
|
||||
return _owners;
|
||||
|
@ -16,9 +16,9 @@ public abstract class ItemGadget extends Gadget
|
||||
private Material _material;
|
||||
private byte _data;
|
||||
|
||||
public ItemGadget(GadgetManager manager, String code, String name, int cost, Material mat, byte data)
|
||||
public ItemGadget(GadgetManager manager, String code, String name, String[] desc, Material mat, byte data)
|
||||
{
|
||||
super(manager, code, name, cost);
|
||||
super(manager, code, name, desc);
|
||||
|
||||
_material = mat;
|
||||
_data = data;
|
||||
@ -38,7 +38,7 @@ public abstract class ItemGadget extends Gadget
|
||||
{
|
||||
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);
|
||||
|
||||
@ -47,7 +47,7 @@ public abstract class ItemGadget extends Gadget
|
||||
|
||||
public void RemoveItem(Player player)
|
||||
{
|
||||
player.getInventory().setItem(3, null);
|
||||
player.getInventory().setItem(2, null);
|
||||
|
||||
_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 Super Smash Mobs Kit: " + C.cYellow + C.Bold + "Witch" + ChatColor.RESET + "!",
|
||||
"New Halloween Hub Items! Limited time to unlock!",
|
||||
"New Hub Mount: " + C.cYellow + C.Bold + "Horse of Horror" + ChatColor.RESET + "!",
|
||||
"Halloween Hub Items! Limited time to unlock!",
|
||||
"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 + "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;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
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.UtilEvent;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
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<Entity> _tempStackShift = new HashSet<Entity>();
|
||||
|
||||
private HashMap<String, Long> _portalTime = new HashMap<String, Long>();
|
||||
|
||||
|
||||
private int _slot = 7;
|
||||
|
||||
@ -97,7 +95,6 @@ public class StackerManager extends MiniPlugin implements IThrown
|
||||
{
|
||||
_disabled.remove(event.getPlayer());
|
||||
_tempStackShift.remove(event.getPlayer());
|
||||
_portalTime.remove(event.getPlayer().getName());
|
||||
}
|
||||
|
||||
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!"));
|
||||
|
||||
//Portal Delay
|
||||
SetPortalDelay(stacker);
|
||||
SetPortalDelay(stackee);
|
||||
Manager.SetPortalDelay(stacker);
|
||||
Manager.SetPortalDelay(stackee);
|
||||
|
||||
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);
|
||||
|
||||
//Portal Delay
|
||||
SetPortalDelay(thrower);
|
||||
SetPortalDelay(throwee);
|
||||
Manager.SetPortalDelay(thrower);
|
||||
Manager.SetPortalDelay(throwee);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -272,7 +269,7 @@ public class StackerManager extends MiniPlugin implements IThrown
|
||||
while (rider != null)
|
||||
{
|
||||
//Portal Delay
|
||||
SetPortalDelay(rider);
|
||||
Manager.SetPortalDelay(rider);
|
||||
|
||||
rider.leaveVehicle();
|
||||
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);
|
||||
|
||||
//Portal Delay
|
||||
SetPortalDelay(target);
|
||||
Manager.SetPortalDelay(target);
|
||||
}
|
||||
|
||||
@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 _name;
|
||||
private String[] _desc;
|
||||
|
||||
private Color _color;
|
||||
private Style _style;
|
||||
@ -45,12 +46,13 @@ public class Mount implements Listener
|
||||
private double _jump;
|
||||
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;
|
||||
|
||||
_code = code;
|
||||
_name = name;
|
||||
_desc = desc;
|
||||
_color = color;
|
||||
_style = style;
|
||||
_variant = variant;
|
||||
@ -65,6 +67,11 @@ public class Mount implements Listener
|
||||
return _name;
|
||||
}
|
||||
|
||||
public String[] GetDesc()
|
||||
{
|
||||
return _desc;
|
||||
}
|
||||
|
||||
public String GetCode()
|
||||
{
|
||||
return _code;
|
||||
|
@ -11,6 +11,10 @@ public class Mule extends Mount
|
||||
{
|
||||
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.player.PlayerToggleSneakEvent;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
@ -20,14 +21,13 @@ public class Undead extends Mount
|
||||
{
|
||||
public Undead(MountManager manager)
|
||||
{
|
||||
super(manager, "MountHalloween2013", "Horse of Horror", Color.BLACK, Style.BLACK_DOTS, Variant.SKELETON_HORSE, 0.8, null);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Test(PlayerToggleSneakEvent event)
|
||||
{
|
||||
if (event.getPlayer().isSneaking())
|
||||
this.Enable(event.getPlayer());
|
||||
super(manager, "Mount_Halloween2013", "Infernal Horror", new String[]
|
||||
{
|
||||
C.cWhite + "The most ghastly horse in",
|
||||
C.cWhite + "existance, from the pits of",
|
||||
C.cWhite + "the Nether."
|
||||
},
|
||||
Color.BLACK, Style.BLACK_DOTS, Variant.SKELETON_HORSE, 0.8, null);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -65,4 +65,20 @@ public class Undead extends Mount
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Toggle(PlayerToggleSneakEvent event)
|
||||
{
|
||||
if (event.getPlayer().isSneaking())
|
||||
return;
|
||||
|
||||
if (IsActive(event.getPlayer()))
|
||||
{
|
||||
this.Disable(event.getPlayer());
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Enable(event.getPlayer());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ public class ServerManager extends MiniPlugin
|
||||
|
||||
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);
|
||||
return;
|
||||
|
@ -26,7 +26,7 @@ public class KitArcher extends Kit
|
||||
new Perk[]
|
||||
{
|
||||
new PerkFletcher(20, 3, true),
|
||||
new PerkBarrage(5, 250, true),
|
||||
new PerkBarrage(5, 250, true, false),
|
||||
},
|
||||
EntityType.ZOMBIE,
|
||||
new ItemStack(Material.BOW));
|
||||
|
@ -28,7 +28,7 @@ public class KitHumanMarksman extends Kit
|
||||
},
|
||||
new Perk[]
|
||||
{
|
||||
new PerkBarrage(5, 250, true),
|
||||
new PerkBarrage(5, 250, true, false),
|
||||
new PerkFletcher(2, 4, false),
|
||||
},
|
||||
EntityType.ZOMBIE,
|
||||
|
@ -31,7 +31,7 @@ public class KitSkeleton extends Kit
|
||||
new Perk[]
|
||||
{
|
||||
new PerkFletcher(3, 2, false),
|
||||
new PerkBarrage(5, 250, true)
|
||||
new PerkBarrage(5, 250, true, false)
|
||||
},
|
||||
EntityType.SLIME,
|
||||
null);
|
||||
|
@ -1,21 +1,30 @@
|
||||
package nautilus.game.arcade.game.games.halloween;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityBreakDoorEvent;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.event.entity.EntityTargetEvent;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
@ -37,6 +46,7 @@ public class Halloween extends SoloGame
|
||||
private ArrayList<WaveBase> _waves;
|
||||
private int _wave = 0;
|
||||
|
||||
private int _maxMobs = 100;
|
||||
private HashSet<CreatureBase> _mobs = new HashSet<CreatureBase>();
|
||||
private PumpkinKing _king;
|
||||
|
||||
@ -53,9 +63,10 @@ public class Halloween extends SoloGame
|
||||
|
||||
new String[]
|
||||
{
|
||||
"Do not die.",
|
||||
"Work as a team!",
|
||||
"Revive fallen allies!",
|
||||
"Defeat the hordes of monsters"
|
||||
"Defeat the waves of monsters",
|
||||
"Kill the Pumpkin King"
|
||||
});
|
||||
|
||||
this.DamagePvP = false;
|
||||
@ -80,23 +91,22 @@ public class Halloween extends SoloGame
|
||||
_spawns.add(WorldData.GetDataLocs("BLUE"));
|
||||
|
||||
_waves = new ArrayList<WaveBase>();
|
||||
//_waves.add(new Wave1(this));
|
||||
//_waves.add(new Wave2(this));
|
||||
//_waves.add(new Wave3(this));
|
||||
//_waves.add(new Wave4(this));
|
||||
_waves.add(new Wave1(this));
|
||||
_waves.add(new Wave2(this));
|
||||
_waves.add(new Wave3(this));
|
||||
_waves.add(new Wave4(this));
|
||||
_waves.add(new Wave5(this));
|
||||
//_waves.add(new Wave6(this));
|
||||
_waves.add(new WaveBoss(this));
|
||||
_waves.add(new WaveVictory(this));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void TeamGen(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.Live)
|
||||
return;
|
||||
|
||||
GetTeamList().add(new GameTeam("Halloween Monsters", ChatColor.RED, WorldData.GetDataLocs("RED")));
|
||||
GetTeamList().add(new GameTeam("Pumpkin King", ChatColor.RED, WorldData.GetDataLocs("RED")));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -183,7 +193,7 @@ public class Halloween extends SoloGame
|
||||
for (CreatureBase base : _mobs)
|
||||
base.Target(event);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void EntityDeath(EntityDeathEvent event)
|
||||
{
|
||||
@ -198,6 +208,9 @@ public class Halloween extends SoloGame
|
||||
|
||||
if (_wave >= _waves.size())
|
||||
{
|
||||
for (Player player : GetPlayers(false))
|
||||
Manager.GetGame().AddGems(player, 30, "Killing the Pumpkin King", false);
|
||||
|
||||
SetState(GameState.End);
|
||||
SetCustomWinLine("You defeated the Pumpkin King!!!");
|
||||
AnnounceEnd(this.GetTeamList().get(0));
|
||||
@ -214,9 +227,87 @@ public class Halloween extends SoloGame
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Door(EntityBreakDoorEvent event)
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void GemAward(CustomDamageEvent event)
|
||||
{
|
||||
if (event.IsCancelled())
|
||||
return;
|
||||
|
||||
Player player = event.GetDamagerPlayer(true);
|
||||
if (player == null) return;
|
||||
|
||||
for (int i=0 ; i<event.GetDamage() ; i++)
|
||||
Manager.GetGame().AddGems(player, 0.01, "Damage", true);
|
||||
}
|
||||
|
||||
public int GetMaxMobs()
|
||||
{
|
||||
return _maxMobs;
|
||||
}
|
||||
|
||||
private long _helpTimer = 0;
|
||||
private int _helpIndex = 0;
|
||||
private String[] _help = new String[]
|
||||
{
|
||||
C.cAqua + "Work together with your team mates.",
|
||||
C.cGreen + "Each kit gives a buff to nearby allies.",
|
||||
C.cAqua + "Kill monsters to keep their numbers down.",
|
||||
C.cGreen + "Kill giants quickly.",
|
||||
C.cAqua + "Defend your team mates from monsters.",
|
||||
C.cGreen + "Stick together to survive.",
|
||||
};
|
||||
|
||||
@EventHandler
|
||||
public void StateUpdate(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SEC)
|
||||
return;
|
||||
|
||||
if (this.GetState() != GameState.Recruit)
|
||||
return;
|
||||
|
||||
if (!UtilTime.elapsed(_helpTimer, 8000))
|
||||
return;
|
||||
|
||||
_helpTimer = System.currentTimeMillis();
|
||||
|
||||
Announce(C.cWhite + C.Bold + "TIP " + ChatColor.RESET + _help[_helpIndex]);
|
||||
|
||||
_helpIndex = (_helpIndex + 1)%_help.length;
|
||||
}
|
||||
}
|
||||
|
@ -84,6 +84,9 @@ public abstract class CreatureBase<T extends LivingEntity>
|
||||
|
||||
public Location GetRoamTarget()
|
||||
{
|
||||
if (Math.random() > 0.75)
|
||||
return GetPlayerTarget();
|
||||
|
||||
Vector vec = new Vector(UtilMath.r(80) - 40, 0, UtilMath.r(80) - 40);
|
||||
return vec.toLocation(Host.GetSpectatorLocation().getWorld());
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public class MobCreeper extends CreatureBase<Creeper>
|
||||
@Override
|
||||
public void SpawnCustom(Creeper ent)
|
||||
{
|
||||
|
||||
ent.setCustomName("Creeper");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -43,7 +43,7 @@ public class MobCreeper extends CreatureBase<Creeper>
|
||||
@Override
|
||||
public void Update(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SEC)
|
||||
if (event.getType() != UpdateType.SLOW)
|
||||
return;
|
||||
|
||||
//New Target via Distance
|
||||
|
@ -1,7 +1,9 @@
|
||||
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.UtilEnt;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
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.entity.Ghast;
|
||||
import org.bukkit.event.entity.EntityTargetEvent;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class MobGhast extends CreatureBase<Ghast>
|
||||
{
|
||||
private Location _loc;
|
||||
|
||||
public MobGhast(Game game, Location loc)
|
||||
{
|
||||
super(game, null, Ghast.class, loc);
|
||||
@ -22,7 +27,13 @@ public class MobGhast extends CreatureBase<Ghast>
|
||||
@Override
|
||||
public void SpawnCustom(Ghast ent)
|
||||
{
|
||||
UtilEnt.Vegetate(ent);
|
||||
//UtilEnt.Vegetate(ent);
|
||||
_loc = ent.getLocation();
|
||||
|
||||
ent.setMaxHealth(80);
|
||||
ent.setHealth(80);
|
||||
|
||||
ent.setCustomName("Ghast");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -40,17 +51,34 @@ public class MobGhast extends CreatureBase<Ghast>
|
||||
@Override
|
||||
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()
|
||||
{
|
||||
if (GetTarget() == null)
|
||||
SetTarget(GetPlayerTarget());
|
||||
SetTarget(GetPlayerTarget().add(0, 20, 0));
|
||||
|
||||
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();
|
||||
|
||||
ent.setMaxHealth(120);
|
||||
ent.setHealth(120);
|
||||
ent.setMaxHealth(300);
|
||||
ent.setHealth(300);
|
||||
|
||||
ent.setCustomName("Giant");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -55,15 +57,15 @@ public class MobGiant extends CreatureBase<Giant>
|
||||
if (event.getType() == UpdateType.TICK)
|
||||
Move();
|
||||
|
||||
if (event.getType() == UpdateType.FASTER)
|
||||
if (event.getType() == UpdateType.FAST)
|
||||
Destroy();
|
||||
}
|
||||
|
||||
private void Destroy()
|
||||
{
|
||||
Host.Manager.GetExplosion().BlockExplosion(UtilBlock.getInRadius(GetEntity().getLocation().add(0, 8, 0), 6d).keySet(), GetEntity().getLocation().add(0, 8, 0), false);
|
||||
Host.Manager.GetExplosion().BlockExplosion(UtilBlock.getInRadius(GetEntity().getLocation().add(0, 2, 0), 3.5d).keySet(), GetEntity().getLocation(), true);
|
||||
Host.Manager.GetExplosion().BlockExplosion(UtilBlock.getInRadius(GetEntity().getLocation().add(0, 0, 0), 3.5d).keySet(), GetEntity().getLocation(), true);
|
||||
Host.Manager.GetExplosion().BlockExplosion(UtilBlock.getInRadius(GetEntity().getLocation().add(0, 2, 0), 5d).keySet(), GetEntity().getLocation(), true);
|
||||
Host.Manager.GetExplosion().BlockExplosion(UtilBlock.getInRadius(GetEntity().getLocation().add(0, 0, 0), 5d).keySet(), GetEntity().getLocation(), true);
|
||||
}
|
||||
|
||||
private void Move()
|
||||
@ -85,7 +87,10 @@ public class MobGiant extends CreatureBase<Giant>
|
||||
_tpLoc.setPitch(UtilAlg.GetPitch(dir));
|
||||
_tpLoc.setYaw(UtilAlg.GetYaw(dir));
|
||||
|
||||
_tpLoc.add(dir.multiply(0.1));
|
||||
double speed = Math.min(0.30, 0.15 + (GetEntity().getTicksLived() / 12000d));
|
||||
|
||||
|
||||
_tpLoc.add(dir.multiply(speed));
|
||||
|
||||
//Move
|
||||
GetEntity().teleport(_tpLoc);
|
||||
|
@ -30,6 +30,8 @@ public class MobPigZombie extends CreatureBase<Zombie>
|
||||
Host.Manager.GetDisguise().disguise(disguise);
|
||||
|
||||
Host.Manager.GetCondition().Factory().Speed("Speed", ent, ent, 99999, 1, false, false, false);
|
||||
|
||||
ent.setCustomName("Nether Zombie");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -47,7 +49,7 @@ public class MobPigZombie extends CreatureBase<Zombie>
|
||||
@Override
|
||||
public void Update(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() == UpdateType.FAST)
|
||||
if (event.getType() == UpdateType.SLOW)
|
||||
Move();
|
||||
}
|
||||
|
||||
@ -83,11 +85,11 @@ public class MobPigZombie extends CreatureBase<Zombie>
|
||||
|
||||
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
|
||||
{
|
||||
nav.a(GetTarget().getX(), GetTarget().getY(), GetTarget().getZ(), 1.2f);
|
||||
nav.a(GetTarget().getX(), GetTarget().getY(), GetTarget().getZ(), 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,9 @@ public class MobSkeletonArcher extends CreatureBase<Skeleton>
|
||||
public void SpawnCustom(Skeleton ent)
|
||||
{
|
||||
ent.getEquipment().setItemInHand(new ItemStack(Material.BOW));
|
||||
ent.setCustomName("Skeleton Archer");
|
||||
|
||||
Host.Manager.GetCondition().Factory().Speed("Speed", ent, ent, 99999, 0, false, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -45,7 +48,7 @@ public class MobSkeletonArcher extends CreatureBase<Skeleton>
|
||||
@Override
|
||||
public void Update(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SEC)
|
||||
if (event.getType() != UpdateType.SLOW)
|
||||
return;
|
||||
|
||||
//New Target via Distance
|
||||
|
@ -3,6 +3,8 @@ package nautilus.game.arcade.game.games.halloween.creatures;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.disguise.disguises.DisguiseSkeleton;
|
||||
import mineplex.core.disguise.disguises.DisguiseSpider;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
@ -13,21 +15,26 @@ import net.minecraft.server.v1_6_R3.Navigation;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
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.inventory.ItemStack;
|
||||
|
||||
public class MobSkeletonWarrior extends CreatureBase<Skeleton>
|
||||
public class MobSkeletonWarrior extends CreatureBase<Zombie>
|
||||
{
|
||||
public MobSkeletonWarrior(Game game, Location loc)
|
||||
{
|
||||
super(game, null, Skeleton.class, loc);
|
||||
super(game, null, Zombie.class, loc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void SpawnCustom(Skeleton ent)
|
||||
public void SpawnCustom(Zombie ent)
|
||||
{
|
||||
ent.getEquipment().setItemInHand(new ItemStack(Material.WOOD_SWORD));
|
||||
DisguiseSkeleton spider = new DisguiseSkeleton(ent);
|
||||
Host.Manager.GetDisguise().disguise(spider);
|
||||
ent.setCustomName("Skeleton Warrior");
|
||||
ent.getEquipment().setItemInHand(new ItemStack(Material.WOOD_HOE));
|
||||
|
||||
Host.Manager.GetCondition().Factory().Speed("Speed", ent, ent, 99999, 0, false, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -45,7 +52,7 @@ public class MobSkeletonWarrior extends CreatureBase<Skeleton>
|
||||
@Override
|
||||
public void Update(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
if (event.getType() != UpdateType.SLOW)
|
||||
return;
|
||||
|
||||
//New Target via Distance
|
||||
|
@ -27,7 +27,9 @@ public class MobSpiderLeaper extends CreatureBase<CaveSpider>
|
||||
@Override
|
||||
public void SpawnCustom(CaveSpider ent)
|
||||
{
|
||||
ent.setCustomName("Leaping Spider");
|
||||
|
||||
Host.Manager.GetCondition().Factory().Speed("Speed", GetEntity(), GetEntity(), 99999, 1, false, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,8 +1,6 @@
|
||||
package nautilus.game.arcade.game.games.halloween.creatures;
|
||||
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.disguise.disguises.DisguiseSpider;
|
||||
@ -30,6 +28,7 @@ public class MobSpiderWebber extends CreatureBase<Zombie>
|
||||
{
|
||||
DisguiseSpider spider = new DisguiseSpider(ent);
|
||||
Host.Manager.GetDisguise().disguise(spider);
|
||||
ent.setCustomName("Smashing Spider");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -50,19 +49,8 @@ public class MobSpiderWebber extends CreatureBase<Zombie>
|
||||
if (event.getType() == UpdateType.FAST)
|
||||
Move();
|
||||
|
||||
if (event.getType() == UpdateType.SEC)
|
||||
Web();
|
||||
}
|
||||
|
||||
private void Web()
|
||||
{
|
||||
if (GetTarget() == null)
|
||||
return;
|
||||
|
||||
if (Math.random() > 0.5)
|
||||
return;
|
||||
|
||||
|
||||
if (event.getType() == UpdateType.SLOW)
|
||||
Speed();
|
||||
}
|
||||
|
||||
private void Move()
|
||||
@ -105,4 +93,14 @@ public class MobSpiderWebber extends CreatureBase<Zombie>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Speed()
|
||||
{
|
||||
if (GetEntity().getTicksLived() > 3600)
|
||||
Host.Manager.GetCondition().Factory().Speed("Speed", GetEntity(), GetEntity(), 10, 2, false, false, false);
|
||||
else if (GetEntity().getTicksLived() > 2400)
|
||||
Host.Manager.GetCondition().Factory().Speed("Speed", GetEntity(), GetEntity(), 10, 1, false, false, false);
|
||||
else if (GetEntity().getTicksLived() > 1200)
|
||||
Host.Manager.GetCondition().Factory().Speed("Speed", GetEntity(), GetEntity(), 10, 0, false, false, false);
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ public class MobZombie extends CreatureBase<Zombie>
|
||||
public void SpawnCustom(Zombie ent)
|
||||
{
|
||||
Move();
|
||||
Host.Manager.GetCondition().Factory().Speed("Zombie", ent, ent, 99999, 0, false, false, false);
|
||||
ent.setCustomName("Zombie");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -38,8 +38,11 @@ public class MobZombie extends CreatureBase<Zombie>
|
||||
@Override
|
||||
public void Update(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() == UpdateType.SEC)
|
||||
if (event.getType() == UpdateType.SLOW)
|
||||
Move();
|
||||
|
||||
if (event.getType() == UpdateType.SLOW)
|
||||
Speed();
|
||||
}
|
||||
|
||||
private void Move()
|
||||
@ -88,4 +91,14 @@ public class MobZombie extends CreatureBase<Zombie>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Speed()
|
||||
{
|
||||
if (GetEntity().getTicksLived() > 3600)
|
||||
Host.Manager.GetCondition().Factory().Speed("Speed", GetEntity(), GetEntity(), 10, 2, false, false, false);
|
||||
else if (GetEntity().getTicksLived() > 2400)
|
||||
Host.Manager.GetCondition().Factory().Speed("Speed", GetEntity(), GetEntity(), 10, 1, false, false, false);
|
||||
else if (GetEntity().getTicksLived() > 1200)
|
||||
Host.Manager.GetCondition().Factory().Speed("Speed", GetEntity(), GetEntity(), 10, 0, false, false, false);
|
||||
}
|
||||
}
|
||||
|
@ -14,9 +14,11 @@ import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilDisplay;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
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.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
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.Navigation;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -94,6 +95,9 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
||||
//Attacked King
|
||||
if (event.GetDamageeEntity().equals(GetEntity()))
|
||||
{
|
||||
if (event.GetProjectile() != null)
|
||||
event.GetProjectile().remove();
|
||||
|
||||
if (_shields.size() > 0)
|
||||
{
|
||||
event.SetCancelled("Shielded");
|
||||
@ -113,6 +117,9 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
||||
//Attacked Minion
|
||||
else if (_minions.contains(event.GetDamageeEntity()))
|
||||
{
|
||||
if (event.GetProjectile() != null)
|
||||
event.GetProjectile().remove();
|
||||
|
||||
if (_shields.size() > 0)
|
||||
{
|
||||
event.SetCancelled("Shielded");
|
||||
@ -131,8 +138,11 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
||||
|
||||
if (event.GetCause() != DamageCause.PROJECTILE && event.GetCause() != DamageCause.LIGHTNING)
|
||||
return;
|
||||
|
||||
|
||||
event.GetProjectile().remove();
|
||||
|
||||
if (event.GetDamagerPlayer(true) == null)
|
||||
return;
|
||||
|
||||
//Effect
|
||||
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);
|
||||
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
|
||||
EntityCreature ec = ((CraftCreature)minion).getHandle();
|
||||
@ -381,9 +395,17 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
||||
{
|
||||
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.isValid() && Math.random() > 0.90)
|
||||
if (arrow.isValid() && Math.random() > 0.50)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -417,27 +439,46 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
||||
}
|
||||
}
|
||||
|
||||
if (GetState() != 1)
|
||||
return;
|
||||
|
||||
for (int i=0 ; i<_minions.size() ; i++)
|
||||
//Circle
|
||||
if (GetState() == 1)
|
||||
{
|
||||
Skeleton minion = _minions.get(i);
|
||||
for (int i=0 ; i<_minions.size() ; i++)
|
||||
{
|
||||
Skeleton minion = _minions.get(i);
|
||||
|
||||
if (!minion.isValid())
|
||||
continue;
|
||||
if (!minion.isValid())
|
||||
continue;
|
||||
|
||||
Vector traj = UtilAlg.getTrajectory2d(GetEntity(), minion);
|
||||
traj.add(new Vector(0,Math.random()*0.2,0));
|
||||
Vector traj = UtilAlg.getTrajectory2d(GetEntity(), minion);
|
||||
traj.add(new Vector(0,Math.random()*0.25,0));
|
||||
|
||||
Arrow arrow = GetEntity().getWorld().spawnArrow(minion.getEyeLocation().add(traj), traj, 2f, 16f);
|
||||
arrow.setShooter(minion);
|
||||
|
||||
_arrows.add(arrow);
|
||||
Arrow arrow = GetEntity().getWorld().spawnArrow(minion.getEyeLocation().add(traj), traj, 2f, 16f);
|
||||
arrow.setShooter(minion);
|
||||
|
||||
_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
|
||||
public void ShieldSpawn()
|
||||
{
|
||||
@ -453,7 +494,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
||||
shieldIterator.remove();
|
||||
}
|
||||
|
||||
if (!UtilTime.elapsed(_shieldSpawn, 3000))
|
||||
if (!UtilTime.elapsed(_shieldSpawn, 8000))
|
||||
return;
|
||||
|
||||
if (_shields.size() >= _shieldsMax)
|
||||
@ -464,7 +505,21 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
||||
|
||||
int toSpawn = 1;
|
||||
if (_shields.size() == 0)
|
||||
{
|
||||
toSpawn = _shieldsMax;
|
||||
|
||||
//Sound
|
||||
GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.WITHER_HURT, 10f, 1.5f);
|
||||
|
||||
if (GetEntity().getTicksLived() > 100)
|
||||
Host.Announce(C.cAqua + C.Bold + "Flame Shield has regenerated!");
|
||||
}
|
||||
else
|
||||
{
|
||||
//Sound
|
||||
GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.WITHER_HURT, 1f, 2f);
|
||||
}
|
||||
|
||||
|
||||
for (int i=0 ; i<toSpawn ; i++)
|
||||
{
|
||||
@ -487,7 +542,8 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
||||
for (int i=0 ; i<_shields.size() ; 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());
|
||||
|
||||
@ -543,6 +599,9 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
||||
|
||||
//Target
|
||||
_minionTargets.put(minion, GetRandomPlayer());
|
||||
|
||||
//Announce
|
||||
Host.Announce(C.cAqua + C.Bold + "Kill the Pumpkin Minions!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -556,9 +615,10 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
||||
{
|
||||
if (UtilTime.elapsed(_stateTime, 10000))
|
||||
{
|
||||
double r = Math.random();
|
||||
|
||||
SetState(1);
|
||||
if (Math.random() > 0.5)
|
||||
SetState(1);
|
||||
else
|
||||
SetState(2);
|
||||
}
|
||||
}
|
||||
//Outward Arrows
|
||||
@ -614,9 +674,11 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
||||
{
|
||||
SetState(4);
|
||||
|
||||
//Announce
|
||||
Host.Announce(C.cAqua + C.Bold + "Kill the Pumpkin King!!!");
|
||||
|
||||
//Sound
|
||||
GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.WITHER_SPAWN, 10f, 1.5f);
|
||||
GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.ZOMBIE_PIG_ANGRY, 10f, 0.5f);
|
||||
|
||||
//Speed
|
||||
Host.Manager.GetCondition().Factory().Speed("King Speed", GetEntity(), GetEntity(), 9999, 1, false, false, false);
|
||||
@ -670,4 +732,9 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
||||
|
||||
return Host.GetPlayers(true).get(UtilMath.r(Host.GetPlayers(true).size()));
|
||||
}
|
||||
|
||||
public boolean IsFinal()
|
||||
{
|
||||
return _minions.size() == 0;
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,8 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
@ -26,13 +28,14 @@ public class KitFinn extends SmashKit
|
||||
{
|
||||
"Jake is hiding in his pocket.",
|
||||
"",
|
||||
"Nearby allies receive " + C.cGreen + "Speed 1"
|
||||
},
|
||||
|
||||
new Perk[]
|
||||
{
|
||||
new PerkInfernoFinn(),
|
||||
new PerkBlizzardFinn(),
|
||||
new PerkFletcher(4, 4, false),
|
||||
new PerkFletcher(3, 4, true),
|
||||
},
|
||||
|
||||
EntityType.ZOMBIE, new ItemStack(Material.GOLD_SWORD));
|
||||
@ -85,4 +88,28 @@ public class KitFinn extends SmashKit
|
||||
Manager.GetCondition().Factory().FireItemImmunity(GetName(), player, player, 1.9, false);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Aura(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
return;
|
||||
|
||||
for (Player player : Manager.GetGame().GetPlayers(true))
|
||||
{
|
||||
if (!HasKit(player))
|
||||
continue;
|
||||
|
||||
for (Player other : Manager.GetGame().GetPlayers(true))
|
||||
{
|
||||
if (other.equals(player))
|
||||
continue;
|
||||
|
||||
if (UtilMath.offset(player, other) > 8)
|
||||
continue;
|
||||
|
||||
Manager.GetCondition().Factory().Speed("Aura", other, player, 1.9, 0, false, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,8 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
@ -26,14 +28,13 @@ public class KitRobinHood extends SmashKit
|
||||
{
|
||||
"Trick or treating from the rich...",
|
||||
"",
|
||||
"Nearby allies receive " + C.cGreen + "Regeneration 1"
|
||||
},
|
||||
|
||||
new Perk[]
|
||||
{
|
||||
new PerkSpeed(1),
|
||||
new PerkRegeneration(0),
|
||||
new PerkFletcher(1, 4, false),
|
||||
new PerkBarrage(4, 250, false),
|
||||
{
|
||||
new PerkFletcher(1, 4, true),
|
||||
new PerkBarrage(4, 250, true, true),
|
||||
new PerkQuickshotRobinHood()
|
||||
},
|
||||
|
||||
@ -86,4 +87,28 @@ public class KitRobinHood extends SmashKit
|
||||
Manager.GetCondition().Factory().FireItemImmunity(GetName(), player, player, 1.9, false);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Aura(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
return;
|
||||
|
||||
for (Player player : Manager.GetGame().GetPlayers(true))
|
||||
{
|
||||
if (!HasKit(player))
|
||||
continue;
|
||||
|
||||
for (Player other : Manager.GetGame().GetPlayers(true))
|
||||
{
|
||||
if (other.equals(player))
|
||||
continue;
|
||||
|
||||
if (UtilMath.offset(player, other) > 8)
|
||||
continue;
|
||||
|
||||
Manager.GetCondition().Factory().Regen("Aura", other, player, 1.9, 0, false, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,9 +7,12 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
@ -20,18 +23,19 @@ public class KitThor extends SmashKit
|
||||
{
|
||||
public KitThor(ArcadeManager manager)
|
||||
{
|
||||
super(manager, "Thor Costume", KitAvailability.Free,
|
||||
super(manager, "Thor", KitAvailability.Free,
|
||||
|
||||
new String[]
|
||||
{
|
||||
"Dress up as Thor, and smash those monsters!",
|
||||
"Smash and kill with your Thor Hammer!",
|
||||
"",
|
||||
"Nearby allies receive " + C.cGreen + "Strength 1"
|
||||
},
|
||||
|
||||
new Perk[]
|
||||
{
|
||||
new PerkKnockbackAttack(2),
|
||||
new PerkFletcher(4, 4, false),
|
||||
new PerkFletcher(3, 4, true),
|
||||
new PerkSeismicHammer(),
|
||||
new PerkHammerThrow(),
|
||||
},
|
||||
@ -85,4 +89,38 @@ public class KitThor extends SmashKit
|
||||
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);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Aura(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
return;
|
||||
|
||||
for (Player player : Manager.GetGame().GetPlayers(true))
|
||||
{
|
||||
if (!HasKit(player))
|
||||
continue;
|
||||
|
||||
for (Player other : Manager.GetGame().GetPlayers(true))
|
||||
{
|
||||
if (other.equals(player))
|
||||
continue;
|
||||
|
||||
if (UtilMath.offset(player, other) > 8)
|
||||
continue;
|
||||
|
||||
Manager.GetCondition().Factory().Strength("Aura", other, player, 1.9, 0, false, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,30 +2,29 @@ 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.MobSkeletonArcher;
|
||||
import nautilus.game.arcade.game.games.halloween.creatures.MobZombie;
|
||||
import nautilus.game.arcade.game.games.halloween.creatures.MobSkeletonWarrior;
|
||||
|
||||
public class Wave1 extends WaveBase
|
||||
{
|
||||
public Wave1(Halloween host)
|
||||
{
|
||||
super(host, "Zombies and Skeletons and Creepers! OH MY!", 60000, host.GetSpawnSet(1));
|
||||
super(host, "Skeletons? Farmers? FARMER SKELETONS!!!", 60000, host.GetSpawnSet(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Spawn(int tick)
|
||||
{
|
||||
if (UtilTime.elapsed(_start, 20000))
|
||||
if (UtilTime.elapsed(_start, 15000))
|
||||
return;
|
||||
|
||||
if (Host.GetCreatures().size() > Host.GetMaxMobs())
|
||||
return;
|
||||
|
||||
if (tick % 10 == 0)
|
||||
Host.AddCreature(new MobZombie(Host, GetSpawn()));
|
||||
Host.AddCreature(new MobSkeletonWarrior(Host, GetSpawn()));
|
||||
|
||||
if (tick % 20 == 0)
|
||||
Host.AddCreature(new MobSkeletonArcher(Host, GetSpawn()));
|
||||
|
||||
if (tick % 30 == 0)
|
||||
Host.AddCreature(new MobCreeper(Host, GetSpawn()));
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ 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 Wave2 extends WaveBase
|
||||
@ -17,19 +16,19 @@ public class Wave2 extends WaveBase
|
||||
@Override
|
||||
public void Spawn(int tick)
|
||||
{
|
||||
if (UtilTime.elapsed(_start, 20000))
|
||||
if (UtilTime.elapsed(_start, 15000))
|
||||
return;
|
||||
|
||||
if (tick == 0)
|
||||
Host.AddCreature(new MobGiant(Host, GetSpawn()));
|
||||
|
||||
if (Host.GetCreatures().size() > Host.GetMaxMobs())
|
||||
return;
|
||||
|
||||
if (tick % 10 == 0)
|
||||
Host.AddCreature(new MobZombie(Host, GetSpawn()));
|
||||
|
||||
if (tick % 20 == 0)
|
||||
Host.AddCreature(new MobSkeletonArcher(Host, GetSpawn()));
|
||||
|
||||
if (tick % 30 == 0)
|
||||
if (tick % 25 == 0)
|
||||
Host.AddCreature(new MobCreeper(Host, GetSpawn()));
|
||||
}
|
||||
}
|
||||
|
@ -15,13 +15,13 @@ public class Wave3 extends WaveBase
|
||||
@Override
|
||||
public void Spawn(int tick)
|
||||
{
|
||||
if (UtilTime.elapsed(_start, 20000))
|
||||
if (Host.GetCreatures().size() > Host.GetMaxMobs())
|
||||
return;
|
||||
|
||||
if (tick % 10 == 0)
|
||||
if (tick > 200 && tick % 10 == 0 && !UtilTime.elapsed(_start, 25000))
|
||||
Host.AddCreature(new MobSpiderWebber(Host, GetSpawn()));
|
||||
|
||||
if (tick % 10 == 0)
|
||||
if (tick % 10 == 0 && !UtilTime.elapsed(_start, 15000))
|
||||
Host.AddCreature(new MobSpiderLeaper(Host, GetSpawn()));
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package nautilus.game.arcade.game.games.halloween.waves;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import nautilus.game.arcade.game.games.halloween.Halloween;
|
||||
import nautilus.game.arcade.game.games.halloween.creatures.MobGhast;
|
||||
@ -9,17 +11,26 @@ public class Wave4 extends WaveBase
|
||||
{
|
||||
public Wave4(Halloween host)
|
||||
{
|
||||
super(host, "Ghasts (and friends)", 60000, host.GetSpawnSet(3));
|
||||
super(host, "Ghasts and friends!", 60000, host.GetSpawnSet(3));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Spawn(int tick)
|
||||
{
|
||||
if (UtilTime.elapsed(_start, 20000))
|
||||
if (UtilTime.elapsed(_start, 25000))
|
||||
return;
|
||||
|
||||
if (tick % 100 == 0)
|
||||
Host.AddCreature(new MobGhast(Host, GetSpawn().clone().add(0, 30, 0)));
|
||||
if (tick > 0 && tick % 100 == 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() > Host.GetMaxMobs())
|
||||
return;
|
||||
|
||||
if (tick % 20 == 0)
|
||||
Host.AddCreature(new MobPigZombie(Host, GetSpawn()));
|
||||
|
@ -1,19 +1,15 @@
|
||||
package nautilus.game.arcade.game.games.halloween.waves;
|
||||
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
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.MobGhast;
|
||||
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;
|
||||
import nautilus.game.arcade.game.games.halloween.creatures.*;
|
||||
|
||||
public class Wave5 extends WaveBase
|
||||
{
|
||||
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
|
||||
@ -23,6 +19,27 @@ public class Wave5 extends WaveBase
|
||||
return;
|
||||
|
||||
if (tick == 0)
|
||||
Host.AddCreature(new MobGhast(Host, GetSpawn().clone().add(0, 40, 0)));
|
||||
SpawnBeacons(Host.GetSpawnSet(2));
|
||||
|
||||
if (tick == 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() > Host.GetMaxMobs())
|
||||
return;
|
||||
|
||||
if (tick % 20 == 0)
|
||||
{
|
||||
Host.AddCreature(new MobZombie(Host, Host.GetSpawnSet(1).get(UtilMath.r(Host.GetSpawnSet(1).size()))));
|
||||
Host.AddCreature(new MobZombie(Host, Host.GetSpawnSet(2).get(UtilMath.r(Host.GetSpawnSet(2).size()))));
|
||||
}
|
||||
|
||||
if (tick % 60 == 0)
|
||||
{
|
||||
Host.AddCreature(new MobCreeper(Host, Host.GetSpawnSet(1).get(UtilMath.r(Host.GetSpawnSet(1).size()))));
|
||||
Host.AddCreature(new MobCreeper(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.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.PumpkinKing;
|
||||
|
||||
@ -11,7 +12,7 @@ public class WaveBoss extends WaveBase
|
||||
|
||||
public WaveBoss(Halloween host)
|
||||
{
|
||||
super(host, "The Pumpkin King", 0, host.GetSpawnSet(3));
|
||||
super(host, "The Pumpkin King", 0, host.GetSpawnSet(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -22,15 +23,22 @@ public class WaveBoss extends WaveBase
|
||||
_king = new PumpkinKing(Host, Host.WorldData.GetDataLocs("BLACK").get(0));
|
||||
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)
|
||||
Host.AddCreature(new MobZombie(Host, Host.GetRandomSpawn()));
|
||||
else
|
||||
Host.AddCreature(new MobCreeper(Host, Host.GetRandomSpawn()));
|
||||
}
|
||||
|
||||
//Giant every 2 minutes
|
||||
if (tick % 2400 == 0 && !_king.IsFinal())
|
||||
{
|
||||
Host.AddCreature(new MobGiant(Host, GetSpawn()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -25,7 +25,7 @@ public class KitArcher extends Kit
|
||||
new Perk[]
|
||||
{
|
||||
new PerkFletcher(20, 3, true),
|
||||
new PerkBarrage(5, 250, true),
|
||||
new PerkBarrage(5, 250, true, false),
|
||||
},
|
||||
EntityType.ZOMBIE,
|
||||
new ItemStack(Material.BOW));
|
||||
|
@ -47,6 +47,7 @@ public class SuperSmash extends SoloGame
|
||||
|
||||
new Kit[]
|
||||
{
|
||||
new KitWitch(manager),
|
||||
new KitSkeleton(manager),
|
||||
new KitGolem(manager),
|
||||
new KitSpider(manager),
|
||||
@ -64,6 +65,7 @@ public class SuperSmash extends SoloGame
|
||||
//new KitWither(manager),
|
||||
new KitWolf(manager),
|
||||
|
||||
|
||||
},
|
||||
|
||||
new String[]
|
||||
|
@ -27,7 +27,7 @@ public class KitBlaze extends SmashKit
|
||||
{
|
||||
public KitBlaze(ArcadeManager manager)
|
||||
{
|
||||
super(manager, "Blaze", KitAvailability.Green,
|
||||
super(manager, "Blaze", KitAvailability.Blue,
|
||||
|
||||
new String[]
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ public class KitSkeleton extends SmashKit
|
||||
new PerkKnockbackArrow(2),
|
||||
new PerkBoneExplosion(),
|
||||
new PerkRopedArrow("Roped Arrow", 1, 5000),
|
||||
new PerkBarrage(5, 250, true),
|
||||
new PerkBarrage(5, 250, true, false),
|
||||
},
|
||||
EntityType.SKELETON,
|
||||
new ItemStack(Material.BOW));
|
||||
|
@ -0,0 +1,106 @@
|
||||
package nautilus.game.arcade.game.games.smash.kits;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.disguise.disguises.DisguiseWitch;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.game.Game.GameState;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.SmashKit;
|
||||
import nautilus.game.arcade.kit.perks.*;
|
||||
|
||||
public class KitWitch extends SmashKit
|
||||
{
|
||||
public KitWitch(ArcadeManager manager)
|
||||
{
|
||||
super(manager, "Witch", KitAvailability.Blue,
|
||||
|
||||
new String[]
|
||||
{
|
||||
},
|
||||
|
||||
new Perk[]
|
||||
{
|
||||
new PerkSmashStats(6, 1.5, 0.15, 5),
|
||||
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
|
||||
new PerkWitchPotion(),
|
||||
new PerkBatWave(),
|
||||
|
||||
|
||||
},
|
||||
EntityType.WITCH,
|
||||
new ItemStack(Material.POTION));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void GiveItems(Player player)
|
||||
{
|
||||
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 + "Stun Potion",
|
||||
new String[]
|
||||
{
|
||||
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,
|
||||
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Bat Wave",
|
||||
new String[]
|
||||
{
|
||||
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().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS));
|
||||
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS));
|
||||
|
||||
//Disguise
|
||||
DisguiseWitch disguise = new DisguiseWitch(player);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Visuals(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FASTER)
|
||||
return;
|
||||
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
{
|
||||
if (!HasKit(player))
|
||||
continue;
|
||||
|
||||
for (Player other : UtilServer.getPlayers())
|
||||
{
|
||||
UtilParticle.PlayParticle(other, ParticleType.WITCH_MAGIC, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -22,7 +22,7 @@ public class KitWolf extends SmashKit
|
||||
{
|
||||
public KitWolf(ArcadeManager manager)
|
||||
{
|
||||
super(manager, "Wolf", KitAvailability.Blue,
|
||||
super(manager, "Wolf", KitAvailability.Green,
|
||||
|
||||
new String[]
|
||||
{
|
||||
|
@ -27,7 +27,7 @@ public class KitShredder extends Kit
|
||||
{
|
||||
new PerkConstructor("Constructor", 4, 6, Material.WOOL, "Wool", false),
|
||||
new PerkFletcher(4, 2, false),
|
||||
new PerkBarrage(5, 250, false),
|
||||
new PerkBarrage(5, 250, false, false),
|
||||
},
|
||||
EntityType.ZOMBIE,
|
||||
new ItemStack(Material.BOW));
|
||||
|
@ -27,7 +27,7 @@ public class KitSurvivorArcher extends Kit
|
||||
new Perk[]
|
||||
{
|
||||
new PerkFletcher(2, 8, true),
|
||||
new PerkBarrage(5, 250, true)
|
||||
new PerkBarrage(5, 250, true, false)
|
||||
},
|
||||
EntityType.SKELETON,
|
||||
new ItemStack(Material.BOW));
|
||||
|
@ -10,9 +10,11 @@ import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.entity.EntityShootBowEvent;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.util.Vector;
|
||||
@ -23,6 +25,7 @@ import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
public class PerkBarrage extends Perk
|
||||
@ -36,8 +39,9 @@ public class PerkBarrage extends Perk
|
||||
private int _max;
|
||||
private long _tick;
|
||||
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[]
|
||||
{
|
||||
@ -47,6 +51,7 @@ public class PerkBarrage extends Perk
|
||||
_max = max;
|
||||
_tick = tick;
|
||||
_remove = remove;
|
||||
_noDelay = noDelay;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -189,6 +194,36 @@ public class PerkBarrage extends Perk
|
||||
_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
|
||||
public void BarrageProjectileHit(ProjectileHitEvent event)
|
||||
|
@ -0,0 +1,250 @@
|
||||
package nautilus.game.arcade.kit.perks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Bat;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
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.UtilParticle;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
public class PerkBatWave extends Perk
|
||||
{
|
||||
private HashMap<Player, Long> _active = new HashMap<Player, Long>();
|
||||
private HashMap<Player, Location> _direction = new HashMap<Player, Location>();
|
||||
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()
|
||||
{
|
||||
super("Bat Wave", new String[]
|
||||
{
|
||||
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
|
||||
public void Activate(PlayerInteractEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
|
||||
return;
|
||||
|
||||
if (UtilBlock.usable(event.getClickedBlock()))
|
||||
return;
|
||||
|
||||
if (!event.getPlayer().getItemInHand().getType().toString().contains("_SPADE"))
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (!Kit.HasKit(player))
|
||||
return;
|
||||
|
||||
if (!Recharge.Instance.use(player, GetName(), 8000, false))
|
||||
{
|
||||
if (_active.containsKey(player))
|
||||
{
|
||||
if (!Recharge.Instance.use(player, "Leash Bats", 500, false))
|
||||
return;
|
||||
|
||||
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()) + "."));
|
||||
}
|
||||
}
|
||||
|
||||
@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), 2000))
|
||||
{
|
||||
Clear(cur);
|
||||
continue;
|
||||
}
|
||||
|
||||
Location loc = _direction.get(cur);
|
||||
|
||||
Vector batVec = new Vector(0,0,0);
|
||||
double batCount = 0;
|
||||
|
||||
//Bat Movement
|
||||
for (Bat bat : _bats.get(cur))
|
||||
{
|
||||
if (!bat.isValid())
|
||||
continue;
|
||||
|
||||
batVec.add(bat.getLocation().toVector());
|
||||
batCount++;
|
||||
|
||||
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.75).add(rand));
|
||||
|
||||
for (Player other : Manager.GetGame().GetPlayers(true))
|
||||
{
|
||||
if (other.equals(cur))
|
||||
continue;
|
||||
|
||||
if (!Recharge.Instance.usable(other, "Hit by Bat"))
|
||||
continue;
|
||||
|
||||
if (UtilEnt.hitBox(bat.getLocation(), other, 2, null))
|
||||
{
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(other, cur, null,
|
||||
DamageCause.CUSTOM, 2.5, true, true, false,
|
||||
cur.getName(), GetName());
|
||||
|
||||
//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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Player Pull
|
||||
if (_pulling.contains(cur))
|
||||
{
|
||||
batVec.multiply(1/batCount);
|
||||
|
||||
Location batLoc = batVec.toLocation(cur.getWorld());
|
||||
|
||||
UtilAction.velocity(cur, UtilAlg.getTrajectory(cur.getLocation(), batLoc), 0.5, false, 0, 0, 10, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void PlayerQuit(PlayerQuitEvent event)
|
||||
{
|
||||
Clear(event.getPlayer());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void PlayerDeath(PlayerDeathEvent event)
|
||||
{
|
||||
Clear(event.getEntity());
|
||||
}
|
||||
|
||||
public void Clear(Player player)
|
||||
{
|
||||
_active.remove(player);
|
||||
_direction.remove(player);
|
||||
_pulling.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);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Knockback(CustomDamageEvent event)
|
||||
{
|
||||
if (event.GetReason() == null || !event.GetReason().contains(GetName()))
|
||||
return;
|
||||
|
||||
event.AddKnockback(GetName(), 1.75);
|
||||
}
|
||||
}
|
@ -85,7 +85,7 @@ public class PerkBlizzardFinn extends Perk
|
||||
continue;
|
||||
}
|
||||
|
||||
if (UtilTime.elapsed(_active.get(player), 1500))
|
||||
if (UtilTime.elapsed(_active.get(player), 2000))
|
||||
{
|
||||
_active.remove(player);
|
||||
continue;
|
||||
|
@ -129,7 +129,7 @@ public class PerkHammerThrow extends Perk implements IThrown
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
DamageCause.LIGHTNING, 12, true, true, false,
|
||||
DamageCause.LIGHTNING, 16, true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ import org.bukkit.util.Vector;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
@ -85,7 +86,7 @@ public class PerkInfernoFinn extends Perk
|
||||
|
||||
//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());
|
||||
double x = 0.07 - (UtilMath.r(14)/100d);
|
||||
@ -101,7 +102,7 @@ public class PerkInfernoFinn extends Perk
|
||||
@EventHandler
|
||||
public void Refresh(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SLOWER)
|
||||
if (event.getType() != UpdateType.SLOW)
|
||||
return;
|
||||
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
@ -112,8 +113,13 @@ public class PerkInfernoFinn extends Perk
|
||||
if (!Kit.HasKit(player))
|
||||
continue;
|
||||
|
||||
player.getInventory().remove(Material.GOLD_SWORD);
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.GOLD_SWORD, (byte)0, 1, "Flaming Sword"));
|
||||
if (!UtilGear.isMat(player.getItemInHand(), Material.GOLD_SWORD))
|
||||
continue;
|
||||
|
||||
if (player.getItemInHand().getDurability() == player.getItemInHand().getType().getMaxDurability())
|
||||
player.getItemInHand().setDurability((short) (player.getItemInHand().getDurability()+1));
|
||||
else
|
||||
player.getItemInHand().setDurability((short) (player.getItemInHand().getDurability()-1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package nautilus.game.arcade.kit.perks;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -52,5 +53,7 @@ public class PerkQuickshotRobinHood extends Perk
|
||||
|
||||
Arrow arrow = player.launchProjectile(Arrow.class);
|
||||
arrow.setVelocity(player.getLocation().getDirection().multiply(2));
|
||||
|
||||
player.getWorld().playSound(player.getLocation(), Sound.SHOOT_ARROW, 1f, 1f);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,61 @@
|
||||
package nautilus.game.arcade.kit.perks;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
public class PerkWitchBroom extends Perk
|
||||
{
|
||||
private HashMap<Player, Long> _active = new HashMap<Player, Long>();
|
||||
|
||||
public PerkWitchBroom()
|
||||
{
|
||||
super("Broomstick", new String[]
|
||||
{
|
||||
C.cYellow + "Right-Click" + C.cGray + " to use " + C.cGreen + "Broomstick"
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void Activate(PlayerInteractEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
|
||||
return;
|
||||
|
||||
if (UtilBlock.usable(event.getClickedBlock()))
|
||||
return;
|
||||
|
||||
if (!event.getPlayer().getItemInHand().getType().toString().contains("_AXE"))
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (!Kit.HasKit(player))
|
||||
return;
|
||||
|
||||
if (!Recharge.Instance.use(player, GetName(), 8000, true))
|
||||
return;
|
||||
|
||||
//Start
|
||||
_active.put(player, System.currentTimeMillis());
|
||||
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
|
||||
}
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
package nautilus.game.arcade.kit.perks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.entity.ThrownPotion;
|
||||
import org.bukkit.event.EventHandler;
|
||||
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 mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
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.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
public class PerkWitchPotion extends Perk
|
||||
{
|
||||
private ArrayList<Projectile> _proj = new ArrayList<Projectile>();
|
||||
|
||||
public PerkWitchPotion()
|
||||
{
|
||||
super("Stun Potion", new String[]
|
||||
{
|
||||
C.cYellow + "Right-Click" + C.cGray + " to use " + C.cGreen + "Paralyze Potion"
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void Activate(PlayerInteractEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
|
||||
return;
|
||||
|
||||
if (UtilBlock.usable(event.getClickedBlock()))
|
||||
return;
|
||||
|
||||
if (!event.getPlayer().getItemInHand().getType().toString().contains("_AXE"))
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (!Kit.HasKit(player))
|
||||
return;
|
||||
|
||||
if (!Recharge.Instance.use(player, GetName(), 2000, true))
|
||||
return;
|
||||
|
||||
//Start
|
||||
ThrownPotion potion = player.launchProjectile(ThrownPotion.class);
|
||||
UtilAction.velocity(potion, player.getLocation().getDirection(), 1, false, 0, 0.2, 10, false);
|
||||
|
||||
_proj.add(potion);
|
||||
|
||||
//Inform
|
||||
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))
|
||||
if (!player.equals(other))
|
||||
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);
|
||||
playerIterator.remove();
|
||||
|
@ -4,6 +4,7 @@ import java.util.Iterator;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilDisplay;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
@ -34,6 +35,8 @@ import org.bukkit.event.Listener;
|
||||
public class GameManager implements Listener
|
||||
{
|
||||
ArcadeManager Manager;
|
||||
|
||||
private int _colorId = 0;
|
||||
|
||||
public GameManager(ArcadeManager manager)
|
||||
{
|
||||
@ -41,6 +44,38 @@ public class GameManager implements Listener
|
||||
|
||||
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
|
||||
public void StateUpdate(UpdateEvent event)
|
||||
|
Loading…
Reference in New Issue
Block a user