Added SSM Spider and Squid Kit

prepared DamageManager.java for disguise sounds
minor SSM balance changes
fixed compass targetting self.
This commit is contained in:
Chiss 2013-09-02 14:40:06 +10:00
parent 789a26471d
commit c483d869a5
26 changed files with 937 additions and 76 deletions

View File

@ -0,0 +1,34 @@
package mineplex.core.disguise.disguises;
public class DisguiseSquid extends DisguiseMonster
{
public DisguiseSquid(org.bukkit.entity.Entity entity)
{
super(entity);
DataWatcher.a(16, new Byte((byte)0));
}
public boolean bT()
{
return (DataWatcher.getByte(16) & 0x01) != 0;
}
public void a(boolean flag)
{
byte b0 = DataWatcher.getByte(16);
if (flag)
b0 = (byte)(b0 | 0x1);
else
b0 = (byte)(b0 & 0xFFFFFFFE);
DataWatcher.watch(16, Byte.valueOf(b0));
}
@Override
protected int GetEntityTypeId()
{
return 94;
}
}

View File

@ -364,11 +364,11 @@ public class DamageManager extends MiniPlugin
LivingEntity damagee = event.GetDamageeEntity();
if (damagee == null) return;
if (_disguiseManager.isDisguised(damagee))
{
//_disguiseManager.getDisguise(damagee).playHurtSound(damagee.getLocation());
System.out.println("No sound");
//return;
return;
}
//Sound

View File

@ -225,7 +225,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation, IChat
{
return _gameLobbyManager;
}
public ArcadeShop GetShop()
{
return _arcadeShop;

View File

@ -61,6 +61,9 @@ public class CompassAddon extends MiniPlugin
for (Player other : Manager.GetGame().GetPlayers(true))
{
if (other.equals(player))
continue;
GameTeam otherTeam = Manager.GetGame().GetTeam(other);
//Same Team (Not Solo Game) && Alive

View File

@ -41,12 +41,15 @@ public class SuperSmash extends SoloGame
{
new KitSkeleton(manager),
new KitEnderman(manager),
new KitBlaze(manager),
new KitGolem(manager),
new KitSnowman(manager),
//new KitSpider(manager),
new KitSlime(manager),
new KitSpider(manager),
new KitSnowman(manager),
new KitBlaze(manager),
new KitChicken(manager),
new KitSkySquid(manager),
},
new String[]

View File

@ -25,7 +25,7 @@ public class KitBlaze extends SmashKit
{
public KitBlaze(ArcadeManager manager)
{
super(manager, "Blaze", KitAvailability.Free,
super(manager, "Blaze", KitAvailability.Green,
new String[]
{
@ -33,7 +33,7 @@ public class KitBlaze extends SmashKit
new Perk[]
{
new PerkSmashStats(6, 1.5, 0.25, 4),
new PerkSmashStats(6, 1.5, 0.25, 5),
new PerkDoubleJump("Double Jump", 1, 1, false),
new PerkKnockbackFire(1.50),
new PerkSpeed(0),
@ -51,8 +51,8 @@ public class KitBlaze extends SmashKit
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD, (byte)0, 1, C.cYellow + C.Bold + "Hold Block" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Inferno"));
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 + "Firefly"));
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));
//Disguise

View File

@ -92,6 +92,7 @@ public class KitEnderman extends SmashKit
disguise.SetCarriedId(id);
disguise.SetCarriedData(data);
//disguise.Update();
Manager.GetDisguise().updateDisguise(disguise);
}
}

View File

@ -0,0 +1,53 @@
package nautilus.game.arcade.game.standalone.smash.kits;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import mineplex.core.common.util.C;
import mineplex.core.disguise.disguises.DisguiseSpider;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
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.PerkSmashStats;
public class KitKnight extends SmashKit
{
public KitKnight(ArcadeManager manager)
{
super(manager, ChatColor.RED + "Undead Knight", KitAvailability.Blue,
new String[]
{
},
new Perk[]
{
new PerkSmashStats(7, 1.6, 0.25, 5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
},
EntityType.HORSE,
null);
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD, (byte)0, 1, C.cYellow + C.Bold + "Hold/Release Block" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "???"));
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 + "???"));
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
DisguiseSpider disguise = new DisguiseSpider(player);
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
disguise.SetCustomNameVisible(true);
Manager.GetDisguise().disguise(disguise);
}
}

View File

@ -0,0 +1,56 @@
package nautilus.game.arcade.game.standalone.smash.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import mineplex.core.common.util.C;
import mineplex.core.disguise.disguises.DisguiseSquid;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
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.PerkInkBlast;
import nautilus.game.arcade.kit.perks.PerkSmashStats;
import nautilus.game.arcade.kit.perks.PerkSuperSquid;
public class KitSkySquid extends SmashKit
{
public KitSkySquid(ArcadeManager manager)
{
super(manager, "Sky Squid", KitAvailability.Blue,
new String[]
{
},
new Perk[]
{
new PerkSmashStats(7, 1.5, 0.25, 5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkSuperSquid(),
new PerkInkBlast(),
},
EntityType.SQUID,
null);
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD, (byte)0, 1, C.cYellow + C.Bold + "Hold/Release Block" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Super Squid"));
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 + "Ink Blast"));
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
DisguiseSquid disguise = new DisguiseSquid(player);
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
disguise.SetCustomNameVisible(true);
Manager.GetDisguise().disguise(disguise);
}
}

View File

@ -43,7 +43,7 @@ public class KitSlime extends SmashKit
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD, (byte)0, 1, C.cYellow + C.Bold + "Hold/Release Block" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Slime Rocket"));
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 + "Slime Slam"));
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET));
player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET));
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE));
//Disguise

View File

@ -22,7 +22,7 @@ public class KitSnowman extends SmashKit
{
public KitSnowman(ArcadeManager manager)
{
super(manager, "Snowman", KitAvailability.Free,
super(manager, "Snowman", KitAvailability.Green,
new String[]
{

View File

@ -11,8 +11,10 @@ import nautilus.game.arcade.ArcadeManager;
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.PerkSmashStats;
import nautilus.game.arcade.kit.perks.PerkSpiderLeap;
import nautilus.game.arcade.kit.perks.PerkNeedler;
import nautilus.game.arcade.kit.perks.PerkWebShot;
public class KitSpider extends SmashKit
{
@ -26,8 +28,10 @@ public class KitSpider extends SmashKit
new Perk[]
{
new PerkSmashStats(7, 1.6, 0.25, 5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkSmashStats(6, 1.75, 0.25, 5),
new PerkSpiderLeap(),
new PerkNeedler(),
new PerkWebShot(),
},
EntityType.SPIDER,
null);
@ -36,8 +40,8 @@ public class KitSpider extends SmashKit
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD, (byte)0, 1, C.cYellow + C.Bold + "Hold/Release Block" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "???"));
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 + "???"));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD, (byte)0, 1, C.cYellow + C.Bold + "Hold/Release Block" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Needler"));
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 + "Web Shot"));
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE));
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS));

View File

@ -0,0 +1,54 @@
package nautilus.game.arcade.game.standalone.smash.kits;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.disguise.disguises.DisguiseSpider;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
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.PerkSmashStats;
public class KitWitherSkeleton extends SmashKit
{
public KitWitherSkeleton(ArcadeManager manager)
{
super(manager, ChatColor.RED + "Wither Skeleton", KitAvailability.Blue,
new String[]
{
},
new Perk[]
{
new PerkSmashStats(7, 1.6, 0.25, 5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
},
EntityType.SKELETON,
new ItemStack(Material.IRON_SWORD));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD, (byte)0, 1, C.cYellow + C.Bold + "Hold/Release Block" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "???"));
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 + "???"));
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
DisguiseSpider disguise = new DisguiseSpider(player);
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
disguise.SetCustomNameVisible(true);
Manager.GetDisguise().disguise(disguise);
}
}

View File

@ -13,6 +13,8 @@ import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Skeleton;
import org.bukkit.entity.Skeleton.SkeletonType;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
@ -108,6 +110,12 @@ public abstract class Kit implements Listener
entity.setCustomName(GetAvailability().GetColor() + GetName() + " Kit" + (GetAvailability() == KitAvailability.Blue ? ChatColor.GRAY + " (" + ChatColor.WHITE + "Ultra" + ChatColor.GRAY + ")" : ""));
entity.setCustomNameVisible(true);
entity.getEquipment().setItemInHand(_itemInHand);
if (type == EntityType.SKELETON && GetName().contains("Wither"))
{
Skeleton skel = (Skeleton)entity;
skel.setSkeletonType(SkeletonType.WITHER);
}
UtilEnt.Vegetate(entity);

View File

@ -23,11 +23,11 @@ public abstract class SmashKit extends Kit
{
for (int i=0 ; i<3 ; i++)
UtilPlayer.message(player, "");
UtilPlayer.message(player, ArcadeFormat.Line);
UtilPlayer.message(player, "§aKit - §f§l" + GetName());
//Desc
for (String line : GetDesc())
{
@ -39,14 +39,20 @@ public abstract class SmashKit extends Kit
{
if (!perk.IsVisible())
continue;
for (String line : perk.GetDesc())
{
UtilPlayer.message(player, C.cGray + " " + line);
}
}
UtilPlayer.message(player, ArcadeFormat.Line);
}
@Override
public int GetCost()
{
return 3000;
}
}

View File

@ -19,6 +19,7 @@ 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.perks.data.BlockTossData;
import nautilus.game.arcade.kit.perks.event.PerkBlockGrabEvent;
import nautilus.game.arcade.kit.perks.event.PerkBlockThrowEvent;
@ -35,7 +36,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
public class PerkBlockToss extends Perk implements IThrown
{
private HashMap<Player, FallingBlock> _holding = new HashMap<Player, FallingBlock>();
private HashMap<Player, BlockTossData> _hold = new HashMap<Player, BlockTossData>();
private HashMap<Player, Long> _charge = new HashMap<Player, Long>();
private HashSet<Player> _charged = new HashSet<Player>();
private HashMap<FallingBlock, Player> _falling = new HashMap<FallingBlock, Player>();
@ -63,7 +64,7 @@ public class PerkBlockToss extends Perk implements IThrown
if (!UtilGear.isSword(player.getItemInHand()))
return;
if (_holding.containsKey(player))
if (_hold.containsKey(player))
return;
Block grab = event.getClickedBlock();
@ -81,19 +82,19 @@ public class PerkBlockToss extends Perk implements IThrown
PerkBlockGrabEvent blockEvent = new PerkBlockGrabEvent(player, grab.getTypeId(), grab.getData());
UtilServer.getServer().getPluginManager().callEvent(blockEvent);
//Block to Item
FallingBlock block = player.getWorld().spawnFallingBlock(player.getEyeLocation(), event.getClickedBlock().getType(), (byte)0);
//Block to Data
int id = grab.getTypeId();
byte data = grab.getData();
//Remove Block
Manager.GetBlockRestore().Add(event.getClickedBlock(), 0, (byte)0, 10000);
//Action
player.eject();
player.setPassenger(block);
_holding.put(player, block);
_falling.put(block, player);
_hold.put(player, new BlockTossData(id, data));
_charge.put(player, System.currentTimeMillis());
//Effect
player.getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, block.getMaterial().getId());
player.getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, id);
}
@EventHandler
@ -102,29 +103,10 @@ public class PerkBlockToss extends Perk implements IThrown
if (event.getType() != UpdateType.TICK)
return;
HashSet<Player> voidSet = new HashSet<Player>();
HashSet<Player> throwSet = new HashSet<Player>();
for (Player cur : _holding.keySet())
for (Player cur : _hold.keySet())
{
if (cur.getPassenger() == null)
{
voidSet.add(cur);
continue;
}
if (_holding.get(cur).getVehicle() == null)
{
voidSet.add(cur);
continue;
}
if (!_holding.get(cur).getVehicle().equals(cur))
{
voidSet.add(cur);
continue;
}
//Throw
if (!cur.isBlocking())
throwSet.add(cur);
@ -138,32 +120,25 @@ public class PerkBlockToss extends Perk implements IThrown
}
}
for (Player cur : voidSet)
{
FallingBlock block = _holding.remove(cur);
_charge.remove(cur);
_charged.remove(cur);
block.remove();
//Event
PerkBlockThrowEvent blockEvent = new PerkBlockThrowEvent(cur);
UtilServer.getServer().getPluginManager().callEvent(blockEvent);
}
for (Player cur : throwSet)
{
FallingBlock block = _holding.remove(cur);
BlockTossData data = _hold.remove(cur);
FallingBlock block = cur.getWorld().spawnFallingBlock(cur.getEyeLocation().add(cur.getLocation().getDirection()), data.Type, data.Data);
_falling.put(block, cur);
_charged.remove(cur);
long charge = System.currentTimeMillis() - _charge.remove(cur);
//Throw
cur.eject();
double mult = 1;
double mult = 1.2;
if (charge < 1000)
mult = mult * (charge/1000d);
//Action
UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0, 0, 1, true);
UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0.2, 0, 1, true);
Manager.GetProjectile().AddThrow(block, cur, this, -1, true, true, true,
null, 0, 0, null, 0, UpdateType.FASTEST, 2d);

View File

@ -7,6 +7,7 @@ import org.bukkit.Color;
import org.bukkit.FireworkEffect;
import org.bukkit.FireworkEffect.Type;
import org.bukkit.Sound;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Chicken;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
@ -117,6 +118,10 @@ public class PerkChickenRocket extends Perk
//Hit Entity
for (Entity ent : data.Player.getWorld().getEntities())
{
if (ent instanceof Arrow)
if (((Arrow)ent).isOnGround())
continue;
if (ent.equals(data.Player))
continue;

View File

@ -0,0 +1,138 @@
package nautilus.game.arcade.kit.perks;
import org.bukkit.Effect;
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.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 mineplex.core.updater.UpdateType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk;
public class PerkInkBlast extends Perk implements IThrown
{
public PerkInkBlast()
{
super("Ink Blast", new String[]
{
C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Ink Blast"
});
}
@EventHandler
public void ShootWeb(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() == null)
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(), 6000, true))
return;
event.setCancelled(true);
UtilInv.remove(player, Material.WEB, (byte)0, 1);
UtilInv.Update(player);
for (int i=0 ; i<5 ; i++)
{
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.INK_SACK));
Vector random = new Vector(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);
random.normalize();
random.multiply(0.15);
UtilAction.velocity(ent, player.getLocation().getDirection().add(random), 0.8 + 0.4 * Math.random(), false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true,
null, 1f, 1f,
Effect.SMOKE, 4, UpdateType.TICK,
2d);
}
//Inform
UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + "."));
//Effect
player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, 1.5f, 0.75f);
player.getWorld().playSound(player.getLocation(), Sound.SPLASH, 0.75f, 1f);
}
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
Explode(data);
if (target == null)
return;
//Damage Event
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
DamageCause.PROJECTILE, 2.5, true, true, false,
UtilEnt.getName(data.GetThrower()), GetName());
Manager.GetCondition().Factory().Blind(GetName(), target, data.GetThrower(), 2.5, 0, false, false, false);
}
@Override
public void Idle(ProjectileUser data)
{
Explode(data);
}
@Override
public void Expire(ProjectileUser data)
{
Explode(data);
}
public void Explode(ProjectileUser data)
{
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.EXPLODE, 0.75f, 1.25f);
data.GetThrown().remove();
}
@EventHandler
public void Knockback(CustomDamageEvent event)
{
if (event.GetReason() == null || !event.GetReason().contains(GetName()))
return;
event.AddKnockback(GetName(), 2);
}
}

View File

@ -0,0 +1,153 @@
package nautilus.game.arcade.kit.perks;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import org.bukkit.Sound;
import org.bukkit.entity.Arrow;
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 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.common.util.UtilServer;
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 PerkNeedler extends Perk
{
private HashMap<Player, Integer> _active = new HashMap<Player, Integer>();
private HashSet<Arrow> _arrows = new HashSet<Arrow>();
public PerkNeedler()
{
super("Needler", new String[]
{
C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Needler"
});
}
@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("_SWORD"))
return;
Player player = event.getPlayer();
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, GetName(), 2000, true))
return;
_active.put(player, 7);
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 (!cur.isBlocking())
{
_active.remove(cur);
continue;
}
int count = _active.get(cur) - 1;
if (count <= 0)
{
_active.remove(cur);
continue;
}
else
{
_active.put(cur, count);
}
Arrow arrow = cur.getWorld().spawnArrow(cur.getEyeLocation().add(cur.getLocation().getDirection()),
cur.getLocation().getDirection(), 1.2f, 6);
arrow.setShooter(cur);
_arrows.add(arrow);
//Sound
cur.getWorld().playSound(cur.getLocation(), Sound.SPIDER_IDLE, 0.8f, 2f);
}
}
@EventHandler
public void ArrowDamamge(CustomDamageEvent event)
{
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("Needler Cancel");
event.GetProjectile().remove();
//Damage Event
Manager.GetDamage().NewDamageEvent(event.GetDamageeEntity(), damager, null,
DamageCause.THORNS, 1.1, true, true, false,
damager.getName(), GetName());
Manager.GetCondition().Factory().Poison(GetName(), event.GetDamageeEntity(), damager, 2, 0, false, false, false);
}
@EventHandler
public void Clean(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC)
return;
for (Iterator<Arrow> arrowIterator = _arrows.iterator(); arrowIterator.hasNext();)
{
Arrow arrow = arrowIterator.next();
if (arrow.isOnGround() || !arrow.isValid() || arrow.getTicksLived() > 300)
{
arrowIterator.remove();
arrow.remove();
}
}
}
}

View File

@ -21,6 +21,7 @@ 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.disguise.disguises.DisguiseSlime;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
@ -54,9 +55,21 @@ public class PerkSlimeRocket extends Perk implements IThrown
{
if (!Kit.HasKit(player))
continue;
int size = 1;
if (player.getExp() > 0.8) size = 3;
else if (player.getExp() > 0.55) size = 2;
DisguiseSlime slime = (DisguiseSlime)Manager.GetDisguise().getDisguise(player);
if (slime.GetSize() != size)
{
slime.SetSize(size);
Manager.GetDisguise().updateDisguise(slime);
}
if (player.isBlocking())
return;
continue;
player.setExp((float) Math.min(0.999, player.getExp()+0.004));
}

View File

@ -18,13 +18,13 @@ public class PerkSmashStats extends Perk
private double _knockbackTaken;
private double _regen;
public PerkSmashStats(int damage, double knockbackTaken, double regen, double armor)
public PerkSmashStats(double damage, double knockbackTaken, double regen, double armor)
{
super("Smash Stats", new String[]
{
(C.cAqua + "Damage: " + C.cWhite + damage) + C.cWhite + " " + (C.cAqua + "Knockback Taken: " + C.cWhite + (int)(knockbackTaken*100)),
(C.cAqua + "Armor: " + C.cWhite + armor) + C.cWhite + " " + (C.cAqua + "Health Regeneration: " + C.cWhite + regen + " per Second"),
(C.cAqua + "Damage: " + C.cWhite + damage) + C.cWhite + " " + (C.cAqua + "Knockback Taken: " + C.cWhite + (int)(knockbackTaken*100) + "%"),
(C.cAqua + "Armor: " + C.cWhite + armor) + C.cWhite + " " + (C.cAqua + "Health Regeneration: " + C.cWhite + regen + " per Second"),
});
_damage = damage;
@ -48,10 +48,7 @@ public class PerkSmashStats extends Perk
return;
double mod = _damage - event.GetDamageInitial();
if (mod == 0)
return;
event.AddMod(damager.getName(), "Attack", mod, true);
}

View File

@ -0,0 +1,126 @@
package nautilus.game.arcade.kit.perks;
import org.bukkit.GameMode;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerToggleFlightEvent;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilServer;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.kit.Perk;
public class PerkSpiderLeap extends Perk
{
public PerkSpiderLeap()
{
super("Spider Leap", new String[]
{
C.cYellow + "Tap Jump Twice" + C.cGray + " to " + C.cGreen + "Spider Leap",
C.cYellow + "Hold Crouch" + C.cGray + " to " + C.cGreen + "Wall Climb",
C.cWhite + "Spider Leap and Wall Climb require Energy (Experience Bar)."
});
}
@EventHandler
public void WallClimb(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : UtilServer.getPlayers())
{
if (player.getGameMode() == GameMode.CREATIVE)
continue;
if (!Kit.HasKit(player))
continue;
if (!player.isSneaking())
{
player.setExp((float) Math.min(0.999, player.getExp()+0.01));
continue;
}
player.setExp((float) Math.max(0, player.getExp()-(1f/60f)));
if (player.getExp() <= 0)
continue;
for (Block block : UtilBlock.getSurrounding(player.getLocation().getBlock()))
{
if (!UtilBlock.airFoliage(block))
{
player.setVelocity(new Vector(0,0,0));
AllowFlight(player);
continue;
}
}
}
}
@EventHandler
public void FlightHop(PlayerToggleFlightEvent event)
{
Player player = event.getPlayer();
if (!Kit.HasKit(player))
return;
if (player.getGameMode() == GameMode.CREATIVE)
return;
event.setCancelled(true);
player.setFlying(false);
//Disable Flight
player.setAllowFlight(false);
//Velocity
UtilAction.velocity(player, 1.0, 0.2, 1.0, true);
//UtilAction.velocity(player, player.getLocation().getDirection(), 1.0, true, 1.0, 0, 1.0, true);
//Sound
player.getWorld().playSound(player.getLocation(), Sound.SPIDER_IDLE, 1f, 1.5f);
}
@EventHandler
public void FlightUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : UtilServer.getPlayers())
{
if (player.getGameMode() == GameMode.CREATIVE)
continue;
if (!Kit.HasKit(player))
continue;
if (UtilEnt.isGrounded(player) || UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN)))
AllowFlight(player);
}
}
public void AllowFlight(Player player)
{
if (player.getAllowFlight())
return;
if (player.getExp() > 3f/18f)
{
player.setExp((float) Math.max(0, player.getExp()-(3f/18f)));
player.setAllowFlight(true);
}
}
}

View File

@ -0,0 +1,101 @@
package nautilus.game.arcade.kit.perks;
import java.util.HashMap;
import org.bukkit.Effect;
import org.bukkit.Sound;
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.UtilAction;
import mineplex.core.common.util.UtilBlock;
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 PerkSuperSquid extends Perk
{
private HashMap<Player, Long> _active = new HashMap<Player, Long>();
public PerkSuperSquid()
{
super("Super Squid", new String[]
{
C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Super Squid"
});
}
@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("_SWORD"))
return;
Player player = event.getPlayer();
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, GetName(), 8000, 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;
for (Player cur : UtilServer.getPlayers())
{
if (!_active.containsKey(cur))
continue;
if (!cur.isBlocking())
{
_active.remove(cur);
continue;
}
if (UtilTime.elapsed(_active.get(cur), 1000))
{
_active.remove(cur);
continue;
}
UtilAction.velocity(cur, 0.6, 0.1, 1, true);
cur.getWorld().playSound(cur.getLocation(), Sound.SPLASH2, 0.2f, 1f);
cur.getWorld().playEffect(cur.getLocation(), Effect.STEP_SOUND, 8);
}
}
@EventHandler
public void DamageCancel(CustomDamageEvent event)
{
if (_active.containsKey(event.GetDamageeEntity()))
event.SetCancelled("Super Squid");
}
}

View File

@ -0,0 +1,5 @@
package nautilus.game.arcade.kit.perks;
public class PerkWallStick {
}

View File

@ -0,0 +1,113 @@
package nautilus.game.arcade.kit.perks;
import org.bukkit.Location;
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.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.UtilAlg;
import mineplex.core.common.util.UtilBlock;
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;
public class PerkWebShot extends Perk implements IThrown
{
public PerkWebShot()
{
super("Web Shot", new String[]
{
C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Web Shot"
});
}
@EventHandler
public void ShootWeb(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() == null)
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(), 4000, true))
return;
event.setCancelled(true);
UtilInv.remove(player, Material.WEB, (byte)0, 1);
UtilInv.Update(player);
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.WEB));
UtilAction.velocity(ent, player.getLocation().getDirection(), 0.8, false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 2d);
//Inform
UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + "."));
//Effect
player.getWorld().playSound(player.getLocation(), Sound.SPIDER_IDLE, 1f, 0.6f);
}
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
if (target != null)
{
data.GetThrown().remove();
Manager.GetBlockRestore().Add(target.getLocation().getBlock(), 30, (byte)0, 2500);
return;
}
Web(data);
}
@Override
public void Idle(ProjectileUser data)
{
Web(data);
}
@Override
public void Expire(ProjectileUser data)
{
Web(data);
}
public void Web(ProjectileUser data)
{
Location loc = data.GetThrown().getLocation();
data.GetThrown().remove();
Manager.GetBlockRestore().Add(loc.getBlock(), 30, (byte)0, 2500);
}
}

View File

@ -0,0 +1,13 @@
package nautilus.game.arcade.kit.perks.data;
public class BlockTossData
{
public int Type;
public byte Data;
public BlockTossData(int type, byte data)
{
Type = type;
Data = data;
}
}