Merge remote-tracking branch 'origin/master'

This commit is contained in:
Shaun Bennett 2015-01-30 00:37:16 -05:00
commit 9b5b1f635f
20 changed files with 654 additions and 63 deletions

View File

@ -64,7 +64,7 @@ public class SuperSmash extends SoloGame
private Location _powerupCurrent = null;
private Location _powerupTarget = null;
private EnderCrystal _powerup = null;
private long _lastPowerup = 0;
private long _nextPowerup = 0;
private HashSet<BlockData> _restoreBlock = new HashSet<BlockData>();
@ -141,6 +141,8 @@ public class SuperSmash extends SoloGame
for (Player player : GetPlayers(true))
_lives.put(player, 4);
_nextPowerup = (long) (System.currentTimeMillis() + 120000 + 180000 * Math.random());
}
@EventHandler
@ -242,7 +244,7 @@ public class SuperSmash extends SoloGame
if (_powerup == null)
{
if (!UtilTime.elapsed(_lastPowerup, 12000))
if (System.currentTimeMillis() < _nextPowerup)
return;
if (WorldData.GetDataLocs("RED").isEmpty())
@ -253,7 +255,7 @@ public class SuperSmash extends SoloGame
Location newTarget = UtilAlg.Random(WorldData.GetDataLocs("RED"));
_powerupTarget = newTarget;
_powerupCurrent = _powerupTarget.clone().add(0, 160, 0);
_powerupCurrent = _powerupTarget.clone().add(0, 120, 0);
//Blocks
for (int x=-1 ; x<=1 ; x++)
@ -285,8 +287,7 @@ public class SuperSmash extends SoloGame
_powerupTarget = null;
_powerupCurrent = null;
_lastPowerup = System.currentTimeMillis();
//Restore Blocks
for (BlockData block : _restoreBlock)
block.restore(true);
@ -332,11 +333,9 @@ public class SuperSmash extends SoloGame
best.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.NETHER_STAR, (byte)0, ((SmashKit)GetKit(best)).getSuperCharges(),
C.cYellow + C.Bold + "Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + ((SmashKit)GetKit(best)).getSuperName()));
_lastPowerup = System.currentTimeMillis();
_nextPowerup = (long) (System.currentTimeMillis() + 120000 + 180000 * Math.random());
Manager.GetGame().Announce(C.Bold + best.getName() + " collected " + C.cGreen + C.Bold + "Smash Crystal" + ChatColor.RESET + C.Bold + "!");
best.setHealth(20);
}
}

View File

@ -47,7 +47,7 @@ public class KitBlaze extends SmashKit
},
EntityType.BLAZE,
new ItemStack(Material.BLAZE_ROD),
"Phoenix", 16000, Sound.BLAZE_DEATH);
"Phoenix", 18000, Sound.BLAZE_DEATH);
}

View File

@ -104,10 +104,7 @@ public class KitCreeper extends SmashKit
@Override
public void giveSuperItems(Player player)
{
player.getInventory().remove(Material.IRON_SPADE);
player.getInventory().remove(Material.IRON_AXE);
UtilInv.Update(player);
}
@Override

View File

@ -43,7 +43,7 @@ public class KitSkeleton extends SmashKit
new PerkKnockbackArrow(1.75),
new PerkBoneExplosion(),
new PerkRopedArrow("Roped Arrow", 1, 5000),
new PerkBarrage(5, 300, true, false),
new PerkBarrage(5, 300, true, true),
new PerkSkeletonArrowStorm()
},
EntityType.SKELETON,

View File

@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.smash.kits;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@ -18,6 +19,7 @@ import nautilus.game.arcade.kit.SmashKit;
import nautilus.game.arcade.kit.perks.PerkSmashStats;
import nautilus.game.arcade.kit.perks.PerkSpiderLeap;
import nautilus.game.arcade.kit.perks.PerkNeedler;
import nautilus.game.arcade.kit.perks.PerkSpidersNest;
import nautilus.game.arcade.kit.perks.PerkWebShot;
public class KitSpider extends SmashKit
@ -32,14 +34,15 @@ public class KitSpider extends SmashKit
new Perk[]
{
new PerkSmashStats(7, 1.6, 0.3, 5.5),
new PerkSmashStats(7, 1.5, 0.3, 6),
new PerkSpiderLeap(),
new PerkNeedler(),
new PerkWebShot(),
new PerkSpidersNest()
},
EntityType.SPIDER,
new ItemStack(Material.WEB),
"", 0, null);
"Spider Nest", 30000, Sound.SPIDER_DEATH);
}
@Override
@ -88,8 +91,20 @@ public class KitSpider extends SmashKit
ChatColor.RESET + "",
ChatColor.RESET + C.cAqua + "Wall Climb uses Energy (Experience Bar)",
}));
if (Manager.GetGame().GetState() == GameState.Recruit)
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.NETHER_STAR, (byte)0, 1,
C.cYellow + C.Bold + "Smash Crystal" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Spiders Nest",
new String[]
{
ChatColor.RESET + "Spawn a nest of webs around you to trap",
ChatColor.RESET + "enemy players. Your attacks heal you and",
ChatColor.RESET + "permanently increase your health. ",
ChatColor.RESET + "",
ChatColor.RESET + "Your abilities have a one second recharge.",
}));
player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.LEATHER_HELMET));
player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET));
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));

View File

@ -2,14 +2,17 @@ package nautilus.game.arcade.game.games.smash.kits;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilInv;
import mineplex.core.disguise.disguises.DisguiseBase;
import mineplex.core.disguise.disguises.DisguiseWolf;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.kit.KitAvailability;
@ -37,7 +40,7 @@ public class KitWolf extends SmashKit
},
EntityType.WOLF,
new ItemStack(Material.BONE),
"", 0, null);
"Frenzy", 30000, Sound.WOLF_HOWL);
}
@Override
@ -74,6 +77,16 @@ public class KitWolf extends SmashKit
ChatColor.RESET + "+1 Damage for 3 seconds. Bonus damage",
ChatColor.RESET + "stacks from multiple hits.",
}));
if (Manager.GetGame().GetState() == GameState.Recruit)
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.NETHER_STAR, (byte)0, 1,
C.cYellow + C.Bold + "Smash Crystal" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Frenzy",
new String[]
{
ChatColor.RESET + "Gain incredible speed, regeneration",
ChatColor.RESET + "and damage. All your abilities recharge",
ChatColor.RESET + "extremely rapidly.",
}));
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE));
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS));
@ -101,4 +114,30 @@ public class KitWolf extends SmashKit
disguise.setCustomNameVisible(true);
Manager.GetDisguise().disguise(disguise);
}
@Override
public void activateSuperCustom(Player player)
{
Manager.GetCondition().Factory().Strength(GetName(), player, player, 30, 1, false, false, false);
Manager.GetCondition().Factory().Speed(GetName(), player, player, 30, 2, false, false, false);
Manager.GetCondition().Factory().Regen(GetName(), player, player, 30, 2, false, false, false);
DisguiseBase disguise = Manager.GetDisguise().getDisguise(player);
if (disguise instanceof DisguiseWolf)
{
((DisguiseWolf)disguise).setAngry(true);
Manager.GetDisguise().updateDisguise(disguise);
}
}
@Override
public void deactivateSuperCustom(Player player)
{
DisguiseBase disguise = Manager.GetDisguise().getDisguise(player);
if (disguise instanceof DisguiseWolf)
{
((DisguiseWolf)disguise).setAngry(false);
Manager.GetDisguise().updateDisguise(disguise);
}
}
}

View File

@ -17,12 +17,13 @@ import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.SmashKit;
import nautilus.game.arcade.kit.perks.PerkDoubleJump;
import nautilus.game.arcade.kit.perks.PerkFleshArrow;
import nautilus.game.arcade.kit.perks.PerkFletcher;
import nautilus.game.arcade.kit.perks.PerkKnockbackArrow;
import nautilus.game.arcade.kit.perks.PerkNightLivingDead;
import nautilus.game.arcade.kit.perks.PerkOvercharge;
import nautilus.game.arcade.kit.perks.PerkSmashStats;
import nautilus.game.arcade.kit.perks.PerkDeathsGrasp;
import nautilus.game.arcade.kit.perks.PerkZombieBile;
public class KitZombie extends SmashKit
{
@ -39,8 +40,9 @@ public class KitZombie extends SmashKit
new PerkSmashStats(6, 1.25, 0.3, 4.5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkFletcher(2, 2, false),
new PerkKnockbackArrow(2),
new PerkFleshArrow(),
new PerkKnockbackArrow(1.5),
new PerkOvercharge(6, 250, true),
new PerkZombieBile(),
new PerkDeathsGrasp(),
new PerkNightLivingDead()
@ -54,35 +56,37 @@ public class KitZombie extends SmashKit
public void giveCoreItems(Player player)
{
UtilInv.Clear(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 + "Deaths Grasp",
C.cYellow + C.Bold + "Left-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Bile Blaster",
new String[]
{
ChatColor.RESET + "Leap forwards. If you collide with an opponent,",
ChatColor.RESET + "you deal damage, throw them behind you and",
ChatColor.RESET + "instantly recharges the ability.",
ChatColor.RESET + "Spew up your dinner from last night.",
ChatColor.RESET + "Deals damage and knockback to enemies.",
}));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1,
C.cYellow + C.Bold + "Left-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Flesh Arrow",
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Deaths Grasp",
new String[]
{
ChatColor.RESET + "Instantly fires an arrow with a baby ",
ChatColor.RESET + "zombie impaled on it. The zombie will",
ChatColor.RESET + "attack enemies after the arrow hits.",
ChatColor.RESET + "Leap forwards. If you collide with an ",
ChatColor.RESET + "opponent, you deal damage, throw them ",
ChatColor.RESET + "behind you and recharge the ability.",
ChatColor.RESET + "",
ChatColor.RESET + "Arrows deal double damage to enemies",
ChatColor.RESET + "recently hit by Deaths Grasp.",
}));
if (Manager.GetGame().GetState() == GameState.Recruit)
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BONE, (byte)0, 1,
C.cYellow + C.Bold + "Passive" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Combo Shot",
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.ARROW, (byte)0, 1,
C.cYellow + C.Bold + "Left-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Corrupted Arrow",
new String[]
{
ChatColor.RESET + "Your arrows deal 2x damage to oppoents",
ChatColor.RESET + "who are airborne from Deaths Grasp.",
ChatColor.RESET + "",
ChatColor.RESET + "Charge your arrows to corrupt them,",
ChatColor.RESET + "adding up to an additional 6 damage.",
}));
if (Manager.GetGame().GetState() == GameState.Recruit)
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.NETHER_STAR, (byte)0, 1,
C.cYellow + C.Bold + "Smash Crystal" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Night of the Living Dead",

View File

@ -109,6 +109,9 @@ public abstract class SmashKit extends Kit
activateSuper(event.getPlayer());
//Heal
event.getPlayer().setHealth(event.getPlayer().getMaxHealth());
//Inform + Effect
event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), _superSound, 20f, 1f);

View File

@ -126,7 +126,7 @@ public class PerkBarrage extends SmashPerk
{
if (_useExp)
{
cur.setLevel(_charge.get(cur));
cur.setExp(0f);
}
_charge.remove(cur);
_chargeLast.remove(cur);
@ -138,7 +138,7 @@ public class PerkBarrage extends SmashPerk
if (_useExp)
{
cur.setLevel(_charge.get(cur));
cur.setExp(Math.min(0.9999f, (float)_charge.get(cur) / (float)_max));
}
_chargeLast.put(cur, System.currentTimeMillis());
@ -204,7 +204,7 @@ public class PerkBarrage extends SmashPerk
_charge.put(cur, arrows - 1);
if (_useExp)
{
cur.setLevel(_charge.get(cur));
cur.setExp(Math.min(0.9999f, (float)_charge.get(cur) / (float)_max));
}
// Fire Arrow
@ -219,7 +219,7 @@ public class PerkBarrage extends SmashPerk
{
if (_useExp)
{
cur.setLevel(0);
cur.setExp(0f);
}
_charge.remove(cur);
_chargeLast.remove(cur);

View File

@ -135,7 +135,7 @@ public class PerkBoneRush extends SmashPerk implements IThrown
event.AddKnockback(GetName(), 10);
if (event.GetReason() != null && event.GetReason().contains("Bone Storm"))
event.AddKnockback(GetName(), 15);
event.AddKnockback(GetName(), 6);
}
@Override
@ -153,7 +153,7 @@ public class PerkBoneRush extends SmashPerk implements IThrown
if (isSuperActive(damager))
{
damage = 1.4;
damage = 3;
reason = "Bone Storm";
}

View File

@ -50,7 +50,7 @@ public class PerkDeadlyBones extends SmashPerk
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, GetName(), 400, true, true))
if (!Recharge.Instance.use(player, GetName(), 400, false, false))
return;
_active.put(player.getWorld().dropItemNaturally(player.getLocation().add(0, 0.5, 0),
@ -70,7 +70,7 @@ public class PerkDeadlyBones extends SmashPerk
Item item = itemIter.next();
//Not Ready
if (item.isValid() && item.getTicksLived() < 60)
if (item.isValid() && item.getTicksLived() < 50)
continue;
//Effect
@ -80,14 +80,14 @@ public class PerkDeadlyBones extends SmashPerk
Player player = _active.get(item);
//Damage
HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(player.getLocation(), 4);
HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(item.getLocation(), 4);
for (LivingEntity cur : targets.keySet())
{
if (cur.equals(player))
continue;
Manager.GetDamage().NewDamageEvent(cur, player, null,
DamageCause.CUSTOM, 4 * targets.get(cur) + 0.5, true, true, false,
DamageCause.CUSTOM, 4 * targets.get(cur) + 1, true, true, false,
player.getName(), GetName());
}

View File

@ -43,7 +43,7 @@ public class PerkDeathsGrasp extends Perk
super("Deaths Grasp", new String[]
{
C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Deaths Grasp",
C.cGray + "+4 Arrow Damage to enemies thrown by Deaths Grasp"
C.cGray + "+100% Arrow Damage to enemies thrown by Deaths Grasp"
});
}
@ -53,13 +53,13 @@ public class PerkDeathsGrasp extends Perk
if (event.isCancelled())
return;
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
if (event.getAction() != Action.LEFT_CLICK_AIR && event.getAction() != Action.LEFT_CLICK_BLOCK)
return;
if (UtilBlock.usable(event.getClickedBlock()))
return;
if (!UtilGear.isAxe(event.getPlayer().getItemInHand()))
if (!UtilGear.isBow(event.getPlayer().getItemInHand()))
return;
Player player = event.getPlayer();
@ -114,7 +114,7 @@ public class PerkDeathsGrasp extends Perk
if (!UtilTime.elapsed(_live.get(ent), 1000))
continue;
_live.remove(ent);
leapIter.remove();
}
//Weakness End
@ -177,7 +177,7 @@ public class PerkDeathsGrasp extends Perk
if (!Manager.IsAlive(damager))
return;
event.AddMod(GetName(), GetName() + " Combo", 4, true);
event.AddMult(GetName(), GetName() + " Combo", 2, true);
UtilParticle.PlayParticle(ParticleType.RED_DUST, event.GetDamageeEntity().getLocation(), 0.5f, 0.5f, 0.5f, 0, 20);
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, event.GetDamageeEntity().getLocation(), 0, 0, 0, 0, 1);

View File

@ -122,10 +122,10 @@ public class PerkFirefly extends SmashPerk
if (_tick == 0)
{
//Firework
UtilFirework.playFirework(data.Player.getLocation().add(0, 0.6, 0), Type.BURST, Color.RED, superActive, superActive);
UtilFirework.playFirework(data.Player.getLocation().add(0, 0.6, 0), isSuperActive(data.Player) ? Type.BALL : Type.BURST, Color.RED, false, superActive);
}
for (Player other : UtilPlayer.getNearby(data.Player.getLocation(), isSuperActive(data.Player) ? 5 : 4))
for (Player other : UtilPlayer.getNearby(data.Player.getLocation(), isSuperActive(data.Player) ? 6 : 4))
{
if (other.equals(data.Player))
continue;

View File

@ -22,8 +22,9 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.SmashPerk;
public class PerkNeedler extends Perk
public class PerkNeedler extends SmashPerk
{
private HashMap<Player, Integer> _active = new HashMap<Player, Integer>();
private HashSet<Arrow> _arrows = new HashSet<Arrow>();
@ -56,7 +57,7 @@ public class PerkNeedler extends Perk
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, GetName(), 1800, true, true))
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? 600 : 1800, !isSuperActive(player), !isSuperActive(player)))
return;
_active.put(player, 8);

View File

@ -0,0 +1,202 @@
package nautilus.game.arcade.kit.perks;
import java.util.Iterator;
import java.util.WeakHashMap;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
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.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.SmashPerk;
public class PerkOvercharge extends SmashPerk
{
private WeakHashMap<Player, Integer> _charge = new WeakHashMap<Player, Integer>();
private WeakHashMap<Player, Long> _chargeLast = new WeakHashMap<Player, Long>();
private WeakHashMap<Arrow, Integer> _arrows = new WeakHashMap<Arrow, Integer>();
private int _max;
private long _tick;
private boolean _useExp;
public PerkOvercharge(int max, long tick, boolean useExpBar)
{
super("Corrupted Arrow", new String[]
{
C.cYellow + "Charge" + C.cGray + " your Bow to use " + C.cGreen + "Corrupted Arrow"
});
_useExp = useExpBar;
_max = max;
_tick = tick;
}
@EventHandler
public void drawBow(PlayerInteractEvent event)
{
Player player = event.getPlayer();
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
return;
if (player.getItemInHand() == null || player.getItemInHand().getType() != Material.BOW)
return;
if (isSuperActive(player))
return;
if (!Kit.HasKit(player))
return;
if (!player.getInventory().contains(Material.ARROW))
return;
if (event.getClickedBlock() != null)
if (UtilBlock.usable(event.getClickedBlock()))
return;
// Start Charge
_charge.put(player, 0);
_chargeLast.put(player, System.currentTimeMillis());
}
@EventHandler
public void charge(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player cur : UtilServer.getPlayers())
{
// Not Charging
if (!_charge.containsKey(cur))
continue;
// Max Charge
if (_charge.get(cur) >= _max)
continue;
// Charge Interval
if (_charge.get(cur) == 0)
{
if (!UtilTime.elapsed(_chargeLast.get(cur), 1000))
continue;
}
else
{
if (!UtilTime.elapsed(_chargeLast.get(cur), _tick))
continue;
}
// No Longer Holding Bow
if (cur.getItemInHand() == null || cur.getItemInHand().getType() != Material.BOW)
{
if (_useExp)
cur.setExp(0f);
_charge.remove(cur);
_chargeLast.remove(cur);
continue;
}
// Increase Charge
_charge.put(cur, _charge.get(cur) + 1);
if (_useExp)
cur.setExp(Math.min(0.9999f, (float)_charge.get(cur) / (float)_max));
_chargeLast.put(cur, System.currentTimeMillis());
// Effect
cur.playSound(cur.getLocation(), Sound.CLICK, 1f, 1f + (0.1f * _charge.get(cur)));
}
}
@EventHandler(priority = EventPriority.HIGH)
public void fireBow(EntityShootBowEvent event)
{
if (event.isCancelled())
return;
if (!Manager.GetGame().IsLive())
return;
if (!(event.getEntity() instanceof Player))
return;
if (!(event.getProjectile() instanceof Arrow))
return;
Player player = (Player) event.getEntity();
if (!_charge.containsKey(player))
return;
int charge = _charge.remove(player);
if (charge <= 0)
return;
// Start Barrage
_arrows.put((Arrow)event.getProjectile(), charge);
player.setExp(0f);
}
@EventHandler(priority = EventPriority.HIGH)
public void damageBonus(CustomDamageEvent event)
{
if (event.GetProjectile() == null)
return;
if (!_arrows.containsKey(event.GetProjectile()))
return;
int charge = _arrows.remove(event.GetProjectile());
event.AddMod(GetName(), GetName(), charge, true);
}
@EventHandler
public void clean(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Iterator<Arrow> arrowIterator = _arrows.keySet().iterator(); arrowIterator.hasNext();)
{
Arrow arrow = arrowIterator.next();
if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround() || arrow.getTicksLived() > 120)
arrowIterator.remove();
else
UtilParticle.PlayParticle(ParticleType.RED_DUST, arrow.getLocation(), 0, 0, 0, 0, 1);
}
}
@EventHandler
public void quit(PlayerQuitEvent event)
{
Player player = event.getPlayer();
_charge.remove(player);
_chargeLast.remove(player);
}
}

View File

@ -0,0 +1,111 @@
package nautilus.game.arcade.kit.perks;
import java.util.HashMap;
import java.util.WeakHashMap;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.SmashPerk;
public class PerkSpidersNest extends SmashPerk
{
private WeakHashMap<LivingEntity, Double> _preHealth = new WeakHashMap<LivingEntity, Double>();
public PerkSpidersNest()
{
super("Spider Nest", new String[] {});
}
@Override
public void addSuperCustom(Player player)
{
//Nest
HashMap<Block, Double> blocks = UtilBlock.getInRadius(player.getLocation().getBlock(), 16);
for (Block block : blocks.keySet())
{
if (blocks.get(block) > 0.07)
continue;
if (!UtilBlock.airFoliage(block))
continue;
if (block.getY() < player.getLocation().getY() + 10)
Manager.GetBlockRestore().Add(block, 30, (byte)0, (long) (30000 + 5000 * Math.random()));
}
//Regen
Manager.GetCondition().Factory().Regen(GetName(), player, player, 30, 0, false, false, false);
}
@EventHandler(priority = EventPriority.HIGH)
public void damagePre(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetCause() != DamageCause.ENTITY_ATTACK &&
event.GetCause() != DamageCause.PROJECTILE &&
event.GetCause() != DamageCause.CUSTOM)
return;
Player damager = event.GetDamagerPlayer(true);
if (damager == null)
return;
LivingEntity damagee = event.GetDamageeEntity();
if (damagee == null)
return;
if (!isSuperActive(damager))
return;
_preHealth.put(damagee, damagee.getHealth());
}
@EventHandler(priority = EventPriority.MONITOR)
public void damagePost(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
Player damager = event.GetDamagerPlayer(true);
if (damager == null)
return;
LivingEntity damagee = event.GetDamageeEntity();
if (damagee == null)
return;
if (!isSuperActive(damager))
return;
if (!_preHealth.containsKey(damagee))
return;
double diff = (_preHealth.remove(damagee) - damagee.getHealth())/2d;
if (diff <= 0)
return;
damager.setMaxHealth(Math.min(60, damager.getMaxHealth() + diff));
damager.setHealth(damager.getHealth() + diff);
UtilParticle.PlayParticle(ParticleType.HEART, damager.getLocation().add(0, 1, 0), 0, 0, 0, 0, 1);
UtilParticle.PlayParticle(ParticleType.RED_DUST, damagee.getLocation().add(0, 1, 0), 0.4f, 0.4f, 0.4f, 0, 12);
if (event.GetCause() == DamageCause.ENTITY_ATTACK)
damager.getWorld().playSound(damager.getLocation(), Sound.SPIDER_IDLE, 1.5f, 1f);
}
}

View File

@ -17,15 +17,14 @@ 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.UtilInv;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.SmashPerk;
public class PerkWebShot extends Perk implements IThrown
public class PerkWebShot extends SmashPerk implements IThrown
{
public PerkWebShot()
{
@ -59,7 +58,7 @@ public class PerkWebShot extends Perk implements IThrown
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, GetName(), 10000, true, true))
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? 1000 : 10000, !isSuperActive(player), !isSuperActive(player)))
return;
event.setCancelled(true);

View File

@ -9,7 +9,6 @@ import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftWolf;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Wolf;
@ -34,11 +33,11 @@ import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.SmashPerk;
import net.minecraft.server.v1_7_R4.EntityCreature;
import net.minecraft.server.v1_7_R4.Navigation;
public class PerkWolf extends Perk
public class PerkWolf extends SmashPerk
{
private HashMap<Wolf, Player> _owner = new HashMap<Wolf, Player>();
private HashMap<Wolf, LivingEntity> _tackle = new HashMap<Wolf, LivingEntity>();
@ -83,7 +82,7 @@ public class PerkWolf extends Perk
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, "Cub Tackle", 8000, true, true))
if (!Recharge.Instance.use(player, "Cub Tackle", isSuperActive(player) ? 800 : 8000, !isSuperActive(player), !isSuperActive(player)))
return;
//Get Nearest Wolf
@ -256,7 +255,7 @@ public class PerkWolf extends Perk
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, "Wolf Strike", 8000, true, true))
if (!Recharge.Instance.use(player, "Wolf Strike", isSuperActive(player) ? 800 : 8000, !isSuperActive(player), !isSuperActive(player)))
return;
//Velocity
@ -426,4 +425,11 @@ public class PerkWolf extends Perk
player.setExp(Math.min(0.9999f, _repeat.get(player).size()/9f));
}
}
@Override
public void addSuperCustom(Player player)
{
Recharge.Instance.recharge(player, "Wolf Strike");
Recharge.Instance.recharge(player, "Cub Tackle");
}
}

View File

@ -0,0 +1,148 @@
package nautilus.game.arcade.kit.perks;
import java.util.HashMap;
import java.util.Iterator;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
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.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
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.SmashPerk;
public class PerkZombieBile extends SmashPerk implements IThrown
{
private HashMap<Player, Long> _active = new HashMap<Player, Long>();
public PerkZombieBile()
{
super("Spew Bile", new String[]
{
C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Spew Bile"
});
}
@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(), 10000, true, true))
return;
_active.put(player, System.currentTimeMillis());
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
}
@EventHandler
public void update(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
Iterator<Player> activeIter = _active.keySet().iterator();
while (activeIter.hasNext())
{
Player player = activeIter.next();
//Expire
if (UtilTime.elapsed(_active.get(player), 2000))
{
activeIter.remove();
continue;
}
//Sound
if (Math.random() > 0.85)
player.getWorld().playSound(player.getLocation(), Sound.BURP, 1f, (float)(Math.random() + 0.5));
//Projectiles
for (int i=0 ; i<3 ; i++)
{
Vector rand = new Vector((Math.random()-0.5)*0.6,(Math.random()-0.5)*0.6,(Math.random()-0.5)*0.6);
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()).subtract(0, 0.5, 0), ItemStackFactory.Instance.CreateStack(Material.ROTTEN_FLESH));
UtilAction.velocity(ent, player.getLocation().getDirection().add(rand), 0.8, false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(ent, player, this, System.currentTimeMillis() + 2000, true, true, true, false, 1.5d);
}
}
}
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
data.GetThrown().remove();
if (target == null)
return;
if (target instanceof Player)
if (!Manager.GetGame().IsAlive((Player)target))
return;
//Damage Event
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
DamageCause.CUSTOM, 3, true, false, false,
UtilEnt.getName(data.GetThrower()), GetName());
data.GetThrown().remove();
}
@Override
public void Idle(ProjectileUser data)
{
data.GetThrown().remove();
}
@Override
public void Expire(ProjectileUser data)
{
data.GetThrown().remove();
}
@EventHandler
public void Knockback(CustomDamageEvent event)
{
if (event.GetReason() == null || !event.GetReason().contains(GetName()))
return;
event.AddKnockback(GetName(), 1);
}
}

View File

@ -0,0 +1,67 @@
package nautilus.game.arcade.kit.perks;
import java.util.HashMap;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilMath;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.kit.SmashPerk;
public class PerkZombieRot extends SmashPerk
{
public PerkZombieRot()
{
super("Rot", new String[]
{
C.cGray + "Leave a path that slows and prevents jumping.",
});
}
@EventHandler
public void SnowAura(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (!Kit.HasKit(player))
continue;
//Blocks
HashMap<Block, Double> blocks = UtilBlock.getInRadius(player.getLocation(), 3);
for (Block block : blocks.keySet())
{
if (UtilBlock.solid(block.getRelative(BlockFace.UP)))
continue;
if (!UtilBlock.solid(block))
continue;
//Snow
Manager.GetBlockRestore().Add(block, 159, (byte)12, 3000);
}
}
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (Kit.HasKit(player))
continue;
if (player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() != Material.STAINED_CLAY ||
player.getLocation().getBlock().getRelative(BlockFace.DOWN).getData() != 12)
continue;
Manager.GetCondition().Factory().Slow(GetName(), player, null, 1.9, 1, false, false, false, false);
Manager.GetCondition().Factory().Jump(GetName(), player, null, 1.9, 244, false, false, false);
}
}
}