Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex

Conflicts:
	Plugins/Mineplex.Hub/src/mineplex/hub/gadget/GadgetManager.java
This commit is contained in:
Jonathan Williams 2014-08-07 00:48:32 -07:00
commit c01fbd279d
110 changed files with 2394 additions and 620 deletions

View File

@ -2,7 +2,6 @@ package mineplex.core.common.util;
import java.lang.reflect.Field;
import mineplex.core.common.util.UtilParticle.ParticleType;
import net.minecraft.server.v1_7_R3.PacketPlayOutWorldParticles;
import org.bukkit.Location;
@ -17,7 +16,7 @@ public class UtilParticle
LARGE_EXPLODE("largeexplode"),
FIREWORKS_SPARK("fireworksSpark"),
BUBBLE("bubble"),
SUSPEND("suspend"),
SUSPEND("suspended"),
DEPTH_SUSPEND("depthSuspend"),
TOWN_AURA("townaura"),
CRIT("crit"),
@ -41,11 +40,12 @@ public class UtilParticle
SNOWBALL_POOF("snowballpoof"),
DRIP_WATER("dripWater"),
DRIP_LAVA("dripLava"),
DROPLET("droplet"),
SNOW_SHOVEL("snowshovel"),
SLIME("slime"),
HEART("heart"),
ANGRY_VILLAGER("angryVillager"),
HAPPY_VILLAGER("happerVillager");
HAPPY_VILLAGER("happyVillager");
public String particleName;

View File

@ -1,13 +1,63 @@
package mineplex.core.disguise;
import org.bukkit.entity.Entity;
import org.bukkit.entity.*;
import mineplex.core.disguise.disguises.*;
public class DisguiseFactory
{
protected DisguiseZombie DisguiseZombie(Entity entity)
public static DisguiseBase createDisguise(Entity disguised, EntityType disguiseType)
{
return new DisguiseZombie(entity);
switch (disguiseType)
{
case BAT:
return new DisguiseBat(disguised);
case BLAZE:
return new DisguiseBlaze(disguised);
case OCELOT:
return new DisguiseCat(disguised);
case CHICKEN:
return new DisguiseChicken(disguised);
case COW:
return new DisguiseCow(disguised);
case CREEPER:
return new DisguiseCreeper(disguised);
case ENDERMAN:
return new DisguiseEnderman(disguised);
case HORSE:
return new DisguiseHorse(disguised);
case IRON_GOLEM:
return new DisguiseIronGolem(disguised);
case MAGMA_CUBE:
return new DisguiseMagmaCube(disguised);
case PIG:
return new DisguisePig(disguised);
case PIG_ZOMBIE:
return new DisguisePigZombie(disguised);
case PLAYER:
return new DisguisePlayer(disguised);
case SHEEP:
return new DisguiseSheep(disguised);
case SKELETON:
return new DisguiseSkeleton(disguised);
case SLIME:
return new DisguiseSlime(disguised);
case SNOWMAN:
return new DisguiseSnowman(disguised);
case SPIDER:
return new DisguiseSpider(disguised);
case SQUID:
return new DisguiseSquid(disguised);
case VILLAGER:
return new DisguiseVillager(disguised);
case WITCH:
return new DisguiseWitch(disguised);
case WOLF:
return new DisguiseWolf(disguised);
case ZOMBIE:
return new DisguiseZombie(disguised);
default:
return null;
}
}
}

View File

@ -31,11 +31,6 @@ public abstract class DisguiseBase
{
DataWatcher.watch(0, Entity.getDataWatcher().getByte(0));
DataWatcher.watch(1, Entity.getDataWatcher().getShort(1));
if (this instanceof DisguiseEnderman)
{
DataWatcher.watch(0, Byte.valueOf((byte)(DataWatcher.getByte(0) & ~(1 << 0))));
}
}
public abstract Packet GetSpawnPacket();

View File

@ -21,6 +21,13 @@ public class DisguiseEnderman extends DisguiseMonster
DataWatcher.watch(8, Byte.valueOf((byte)(PotionBrewer.b(Arrays.asList(new MobEffect(MobEffectList.FIRE_RESISTANCE.id, 777))) ? 1 : 0)));
DataWatcher.watch(7, Integer.valueOf(i));
}
public void UpdateDataWatcher()
{
super.UpdateDataWatcher();
DataWatcher.watch(0, Byte.valueOf((byte)(DataWatcher.getByte(0) & ~(1 << 0))));
}
public void SetCarriedId(int i)
{

View File

@ -10,17 +10,25 @@ import net.minecraft.util.com.mojang.authlib.GameProfile;
public class DisguisePlayer extends DisguiseHuman
{
private String _name;
public DisguisePlayer(org.bukkit.entity.Entity entity, String name)
public DisguisePlayer(org.bukkit.entity.Entity entity)
{
super(entity);
}
public DisguisePlayer(org.bukkit.entity.Entity entity, String name)
{
this(entity);
setName(name);
}
public void setName(String name)
{
if (name.length() > 16)
{
name = name.substring(0, 16);
}
_name = name;
_name = name.substring(0, 16);
else
_name = name;
}
@Override

View File

@ -20,6 +20,7 @@ import mineplex.core.energy.event.EnergyEvent.EnergyChangeReason;
public class Energy extends MiniClientPlugin<ClientEnergy>
{
private double _baseEnergy = 180;
private boolean _enabled = true;
public Energy(JavaPlugin plugin)
{
@ -29,6 +30,9 @@ public class Energy extends MiniClientPlugin<ClientEnergy>
@EventHandler
public void Update(UpdateEvent event)
{
if (!_enabled)
return;
if (event.getType() != UpdateType.TICK)
return;
@ -36,7 +40,7 @@ public class Energy extends MiniClientPlugin<ClientEnergy>
UpdateEnergy(cur);
}
public void UpdateEnergy(Player cur)
private void UpdateEnergy(Player cur)
{
if (cur.isDead())
return;
@ -57,6 +61,9 @@ public class Energy extends MiniClientPlugin<ClientEnergy>
public void ModifyEnergy(Player player, double energy)
{
if (!_enabled)
return;
ClientEnergy client = Get(player);
if (energy > 0)
@ -124,6 +131,9 @@ public class Energy extends MiniClientPlugin<ClientEnergy>
@EventHandler
public void handleExp(PlayerExpChangeEvent event)
{
if (!_enabled)
return;
event.setAmount(0);
}
@ -147,6 +157,11 @@ public class Energy extends MiniClientPlugin<ClientEnergy>
protected void loadClientInformation(RetrieveClientInformationEvent event)
{
}
public void setEnabled(boolean b)
{
_enabled = b;
}
/* ENERGY NO LONGER USED ON ATTACK
public void AddEnergySwingMod(Player player, String reason, int amount)

View File

@ -7,6 +7,8 @@ import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin;
@ -14,7 +16,9 @@ import mineplex.core.account.CoreClientManager;
import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.common.Rank;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.disguise.DisguiseManager;
import mineplex.core.donation.DonationManager;
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
@ -39,6 +43,7 @@ public class GadgetManager extends MiniPlugin
private HashSet<Gadget> _gadgets;
private NautHashMap<Player, Long> _lastMove = new NautHashMap<Player, Long>();
private NautHashMap<Player, NautHashMap<GadgetType, Gadget>> _playerActiveGadgetMap = new NautHashMap<Player, NautHashMap<GadgetType, Gadget>>();
public GadgetManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, MountManager mountManager, PetManager petManager, PreferencesManager preferencesManager, DisguiseManager disguiseManager, BlockRestore blockRestore)
@ -69,6 +74,16 @@ public class GadgetManager extends MiniPlugin
//Morphs
_gadgets.add(new MorphBlaze(this));
_gadgets.add(new MorphPumpkinKing(this));
_gadgets.add(new MorphCreeper(this));
_gadgets.add(new MorphChicken(this));
//Particles
_gadgets.add(new ParticleFireRings(this));
_gadgets.add(new ParticleRain(this));
_gadgets.add(new ParticleHelix(this));
_gadgets.add(new ParticleEnchant(this));
_gadgets.add(new ParticleGreen(this));
_gadgets.add(new ParticleFoot(this));
}
@EventHandler
@ -118,6 +133,19 @@ public class GadgetManager extends MiniPlugin
}
}
public void RemoveParticle(Player player)
{
for (Gadget gadget : _gadgets)
{
if (gadget instanceof ParticleGadget)
{
ParticleGadget part = (ParticleGadget)gadget;
part.Disable(player);
}
}
}
public void DisableAll()
{
for (Gadget gadget : _gadgets)
@ -168,6 +196,29 @@ public class GadgetManager extends MiniPlugin
{
return _blockRestore;
}
@EventHandler
public void setMoving(PlayerMoveEvent event)
{
if (UtilMath.offset(event.getFrom(), event.getTo()) <= 0)
return;
_lastMove.put(event.getPlayer(), System.currentTimeMillis());
}
public boolean isMoving(Player player)
{
if (!_lastMove.containsKey(player))
return false;
return !UtilTime.elapsed(_lastMove.get(player), 500);
}
@EventHandler
public void quit(PlayerQuitEvent event)
{
_lastMove.remove(event.getPlayer());
}
public void setActive(Player player, Gadget gadget)
{

View File

@ -1,6 +1,7 @@
package mineplex.core.gadget.gadgets;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent;
@ -62,7 +63,9 @@ public class MorphBlaze extends MorphGadget
player.leaveVehicle();
player.eject();
player.getWorld().playSound(player.getLocation(), Sound.FIZZ, 0.2f, (float)(Math.random()));
UtilParticle.PlayParticle(ParticleType.FLAME, player.getLocation().add(0, 1, 0), 0.25f, 0.25f, 0.25f, 0f, 3);
UtilParticle.PlayParticle(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 1, 0), 0.1f, 0.1f, 0.1f, 0f, 1);
UtilAction.velocity(player, 0.8, 0.1, 1, true);
}
}

View File

@ -30,7 +30,10 @@ public class DragonMount extends Mount<DragonData>
UtilPlayer.message(player, F.main("Mount", "You spawned " + F.elem(GetName()) + "."));
//Store
_active.put(player, new DragonData(this, player));
DragonData dragonData = new DragonData(this, player);
//Set max health to 1 so player doesn't see a bunch of mount hearts flashing when NewsManager changes the health
dragonData.Dragon.setMaxHealth(1.0);
_active.put(player, dragonData);
}
@Override

View File

@ -99,7 +99,18 @@ public class Dragon extends DragonMount
for (DragonData dragon : GetActive().values())
dragon.Dragon.setCustomName(news);
}
public void setHealthPercent(double healthPercent)
{
for (DragonData dragon : GetActive().values())
{
double health = healthPercent * dragon.Dragon.getMaxHealth();
if (health <= 0.0)
health = 0.001;
dragon.Dragon.setHealth(health);
}
}
@EventHandler
public void HeroOwner(PlayerJoinEvent event)
{

View File

@ -84,13 +84,6 @@ public class ServerCommand extends CommandBase<Portal>
else
deniedAccess = true;
}
else if (!servUp.contains("FREE"))
{
if (playerRank.Has(Rank.ULTRA))
Plugin.SendPlayerToServerWithMessage(player, args[0]);
else
deniedAccess = true;
}
else
{
Plugin.SendPlayerToServerWithMessage(player, args[0]);

View File

@ -114,6 +114,7 @@ public class Hub extends JavaPlugin implements IRelation
Fire fire = new Fire(this, conditionManager, damage);
Teleport teleport = new Teleport(this, clientManager, new Spawn(this));
Energy energy = new Energy(this);
energy.setEnabled(false);
ItemFactory itemFactory = new ItemFactory(this, blockRestore, conditionManager, damage, energy, fire, throwManager, webServerAddress);
SkillFactory skillManager = new SkillFactory(this, damage, this, combatManager, conditionManager, throwManager, blockRestore, fire, new Movement(this), teleport, energy, webServerAddress);

View File

@ -904,34 +904,6 @@ public class HubManager extends MiniClientPlugin<HubClient>
return true;
}
@EventHandler
public void HeartDisplay(UpdateEvent event)
{
if (event.getType() != UpdateType.FASTER)
return;
for (Player player : UtilServer.getPlayers())
{
if (!player.isOp())
continue;
for (Player other : UtilServer.getPlayers())
{
if (player.getName().equalsIgnoreCase("Chiss"))
UtilParticle.PlayParticle(other, ParticleType.HEART, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 1);
else if (player.getName().equalsIgnoreCase("defek7"))
UtilParticle.PlayParticle(other, ParticleType.FIREWORKS_SPARK, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2);
else if (player.getName().equalsIgnoreCase("Spu_"))
UtilParticle.PlayParticle(other, ParticleType.FLAME, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2);
else if (player.getName().equalsIgnoreCase("sterling_"))
UtilParticle.PlayParticle(other, ParticleType.WITCH_MAGIC, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2);
}
}
}
@EventHandler
public void SkillTrigger(SkillTriggerEvent event)
{

View File

@ -0,0 +1,272 @@
package mineplex.hub.gadget;
import java.util.HashMap;
import java.util.HashSet;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.Snowball;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack;
import mineplex.core.MiniPlugin;
import mineplex.core.common.Rank;
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.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.hub.HubManager;
import mineplex.hub.gadget.gadgets.*;
import mineplex.hub.gadget.types.MorphGadget;
import mineplex.hub.gadget.types.MorphGadget.ArmorSlot;
import mineplex.hub.gadget.types.Gadget;
import mineplex.hub.gadget.types.ItemGadget;
import mineplex.hub.gadget.types.ParticleGadget;
import mineplex.hub.gadget.ui.GadgetShop;
import mineplex.hub.mount.MountManager;
import mineplex.hub.pet.PetManager;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
public class GadgetManager extends MiniPlugin
{
public HubManager Manager;
private GadgetShop _gadgetShop;
private PetManager _petManager;
private HashSet<Gadget> _gadgets;
private HashMap<Player, Long> _lastMove = new HashMap<Player, Long>();
public GadgetManager(HubManager manager, MountManager mountManager, PetManager petManager)
{
super("Gadget Manager", manager.GetPlugin());
Manager = manager;
_petManager = petManager;
CreateGadgets();
_gadgetShop = new GadgetShop(this, mountManager, Manager.GetClients(), Manager.GetDonation());
}
private void CreateGadgets()
{
_gadgets = new HashSet<Gadget>();
//Items
_gadgets.add(new ItemPaintballGun(this));
_gadgets.add(new ItemBatGun(this));
_gadgets.add(new ItemGemBomb(this));
_gadgets.add(new ItemFirework(this));
_gadgets.add(new ItemTNT(this));
//Morphs
_gadgets.add(new MorphBlaze(this));
_gadgets.add(new MorphPumpkinKing(this));
_gadgets.add(new MorphCreeper(this));
_gadgets.add(new MorphChicken(this));
//Particles
_gadgets.add(new ParticleFireRings(this));
_gadgets.add(new ParticleRain(this));
_gadgets.add(new ParticleHelix(this));
_gadgets.add(new ParticleEnchant(this));
_gadgets.add(new ParticleGreen(this));
_gadgets.add(new ParticleFoot(this));
}
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event)
{
event.getPlayer().getInventory().setItem(4, ItemStackFactory.Instance.CreateStack(Material.CHEST, (byte)0, 1, ChatColor.RESET + C.cGreen + "Gadget Menu"));
if (Manager.GetClients().Get(event.getPlayer()).GetRank().Has(Rank.MODERATOR))
{
for (Gadget gadget : _gadgets)
{
Manager.GetDonation().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(gadget.GetName());
}
}
}
@EventHandler
public void orderThatChest(final PlayerDropItemEvent event)
{
if (event.getItemDrop().getItemStack().getType() == Material.CHEST)
{
Bukkit.getScheduler().scheduleSyncDelayedTask(GetPlugin(), new Runnable()
{
public void run()
{
if (event.getPlayer().isOnline())
{
event.getPlayer().getInventory().remove(Material.CHEST);
event.getPlayer().getInventory().setItem(4, ItemStackFactory.Instance.CreateStack(Material.CHEST, (byte)0, 1, ChatColor.RESET + C.cGreen + "Gadget Menu"));
event.getPlayer().updateInventory();
}
}
});
}
}
@EventHandler
public void openShop(PlayerInteractEvent event)
{
if (event.hasItem() && event.getItem().getType() == Material.CHEST)
{
event.setCancelled(true);
if (!Manager.IsGadgetEnabled())
{
UtilPlayer.message(event.getPlayer(), F.main("Gadget", "Gadgets are currently disabled."));
return;
}
_gadgetShop.attemptShopOpen(event.getPlayer());
}
}
public HashSet<Gadget> getGadgets()
{
return _gadgets;
}
//Disallows two armor gadgets in same slot.
public void RemoveArmor(Player player, ArmorSlot slot)
{
for (Gadget gadget : _gadgets)
{
if (gadget instanceof MorphGadget)
{
MorphGadget armor = (MorphGadget)gadget;
if (armor.GetSlot() == slot)
{
armor.RemoveArmor(player);
}
}
}
}
public void RemoveItem(Player player)
{
for (Gadget gadget : _gadgets)
{
if (gadget instanceof ItemGadget)
{
ItemGadget item = (ItemGadget)gadget;
item.RemoveItem(player);
}
}
}
public void RemoveParticle(Player player)
{
for (Gadget gadget : _gadgets)
{
if (gadget instanceof ParticleGadget)
{
ParticleGadget part = (ParticleGadget)gadget;
part.Disable(player);
}
}
}
@EventHandler
public void SnowballPickup(BlockDamageEvent event)
{
if (!Manager.Mode.equals("Christmas"))
return;
if (event.getBlock().getType() != Material.SNOW)
return;
Player player = event.getPlayer();
RemoveItem(player);
player.getInventory().setItem(3, new ItemStack(Material.SNOW_BALL, 16));
}
@EventHandler
public void SnowballHit(CustomDamageEvent event)
{
if (!Manager.Mode.equals("Christmas"))
return;
Projectile proj = event.GetProjectile();
if (proj == null) return;
if (!(proj instanceof Snowball))
return;
event.SetCancelled("Snowball Cancel");
if (Manager.BumpDisabled(event.GetDamageeEntity()))
return;
if (Manager.BumpDisabled(event.GetDamagerEntity(true)))
return;
UtilAction.velocity(event.GetDamageeEntity(), UtilAlg.getTrajectory2d(event.GetDamagerEntity(true), event.GetDamageeEntity()),
0.4, false, 0, 0.2, 1, false);
//No Portal
Manager.SetPortalDelay(event.GetDamageeEntity());
}
public void DisableAll()
{
for (Gadget gadget : _gadgets)
for (Player player : UtilServer.getPlayers())
gadget.Disable(player);
}
public PetManager getPetManager()
{
return _petManager;
}
@EventHandler
public void setMoving(PlayerMoveEvent event)
{
if (UtilMath.offset(event.getFrom(), event.getTo()) <= 0)
return;
_lastMove.put(event.getPlayer(), System.currentTimeMillis());
}
public boolean isMoving(Player player)
{
if (!_lastMove.containsKey(player))
return false;
return !UtilTime.elapsed(_lastMove.get(player), 500);
}
@EventHandler
public void quit(PlayerQuitEvent event)
{
_lastMove.remove(event.getPlayer());
}
}

View File

@ -0,0 +1,151 @@
package mineplex.hub.gadget.gadgets;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Egg;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerToggleFlightEvent;
import org.bukkit.util.Vector;
import mineplex.core.common.Rank;
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.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.disguise.disguises.DisguiseChicken;
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.MorphGadget;
public class MorphChicken extends MorphGadget
{
public MorphChicken(GadgetManager manager)
{
super(manager, "Chicken Morph", new String[]
{
C.cWhite + "Soar through the air like an fat Chicken!",
" ",
C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Egg Shot",
C.cYellow + "Double Jump" + C.cGray + " to use " + C.cGreen + "Flap",
},
-1,
ArmorSlot.Helmet, Material.FEATHER, (byte)0);
}
@Override
public void EnableCustom(final Player player)
{
this.ApplyArmor(player);
DisguiseChicken disguise = new DisguiseChicken(player);
disguise.SetName(player.getName());
disguise.SetCustomNameVisible(true);
Manager.Manager.GetDisguise().disguise(disguise);
}
@Override
public void Disable(Player player)
{
this.RemoveArmor(player);
Manager.Manager.GetDisguise().undisguise(player);
}
@EventHandler
public void Egg(PlayerInteractEvent event)
{
Player player = event.getPlayer();
if (!IsActive(player))
return;
if (!UtilEvent.isAction(event, ActionType.L))
return;
if (!Recharge.Instance.use(player, GetName(), 100, false, false))
return;
Vector offset = player.getLocation().getDirection();
if (offset.getY() < 0)
offset.setY(0);
Egg egg = player.getWorld().spawn(player.getLocation().add(0, 0.5, 0).add(offset), Egg.class);
egg.setVelocity(player.getLocation().getDirection().add(new Vector(0,0.2,0)));
egg.setShooter(player);
//Effect
player.getWorld().playSound(player.getLocation(), Sound.CHICKEN_EGG_POP, 0.5f, 1f);
}
@EventHandler
public void Flap(PlayerToggleFlightEvent event)
{
Player player = event.getPlayer();
if (player.getGameMode() == GameMode.CREATIVE)
return;
if (!IsActive(player))
return;
event.setCancelled(true);
player.setFlying(false);
//Disable Flight
player.setAllowFlight(false);
double power = 0.4 + (0.5 * player.getExp());
//Velocity
UtilAction.velocity(player, player.getLocation().getDirection(), power, true, power, 0, 10, true);
//Sound
player.getWorld().playSound(player.getLocation(), Sound.BAT_TAKEOFF, (float)(0.3 + player.getExp()), (float)(Math.random()/2+1));
//Set Recharge
Recharge.Instance.use(player, GetName(), 80, false, false);
//Energy
player.setExp(Math.max(0f, player.getExp() - (1f/6f)));
}
@EventHandler
public void FlapUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : GetActive())
{
if (player.getGameMode() == GameMode.CREATIVE)
continue;
if (UtilEnt.isGrounded(player) || UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN)))
{
player.setExp(0.999f);
player.setAllowFlight(true);
}
else if (Recharge.Instance.usable(player, GetName()) && player.getExp() > 0)
{
player.setAllowFlight(true);
}
}
}
@EventHandler
public void HeroOwner(PlayerJoinEvent event)
{
if (Manager.Manager.GetClients().Get(event.getPlayer()).GetRank().Has(Rank.HERO))
{
Manager.Manager.GetDonation().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName());
}
}
}

View File

@ -0,0 +1,175 @@
package mineplex.hub.gadget.gadgets;
import java.util.HashMap;
import org.bukkit.EntityEffect;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.disguise.disguises.DisguiseBase;
import mineplex.core.disguise.disguises.DisguiseCreeper;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.gadget.GadgetManager;
import mineplex.hub.gadget.types.MorphGadget;
public class MorphCreeper extends MorphGadget
{
private HashMap<Player, Long> _active = new HashMap<Player, Long>();
public MorphCreeper(GadgetManager manager)
{
super(manager, "Creeper Morph", new String[]
{
C.cWhite + "Transforms the wearer into a creepy Creeper!",
" ",
C.cYellow + "Crouch" + C.cGray + " to use " + C.cGreen + "Detonate",
},
-1,
ArmorSlot.Helmet, Material.SKULL_ITEM, (byte)4);
}
@Override
public void EnableCustom(final Player player)
{
this.ApplyArmor(player);
DisguiseCreeper disguise = new DisguiseCreeper(player);
disguise.SetName(player.getName());
disguise.SetCustomNameVisible(true);
Manager.Manager.GetDisguise().disguise(disguise);
}
@Override
public void Disable(Player player)
{
this.RemoveArmor(player);
Manager.Manager.GetDisguise().undisguise(player);
}
@EventHandler
public void Trigger(UpdateEvent event)
{
if (event.getType() == UpdateType.TICK)
{
for (Player player : GetActive())
{
if (player.isSneaking())
{
player.leaveVehicle();
player.eject();
if (!_active.containsKey(player))
_active.put(player, System.currentTimeMillis());
double elapsed = (System.currentTimeMillis() - _active.get(player))/1000d;
player.setExp(Math.min(0.99f, (float)(elapsed/1.5)));
//Sound
player.getWorld().playSound(player.getLocation(), Sound.CREEPER_HISS, (float)(0.5 + elapsed), (float)(0.5 + elapsed));
IncreaseSize(player);
}
else if (_active.containsKey(player))
{
//Unpower
DecreaseSize(player);
player.setExp(0f);
double elapsed = (System.currentTimeMillis() - _active.remove(player))/1000d;
if (elapsed < 1.5)
continue;
//Explode
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, player.getLocation(), 0, 0.5f, 0, 0, 1);
player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, 1f, 0.8f);
player.playEffect(EntityEffect.HURT);
//Knockback
HashMap<Player, Double> players = UtilPlayer.getInRadius(player.getLocation(), 8);
for (Player other : players.keySet())
{
if (other.equals(player))
continue;
double mult = players.get(other);
//Knockback
UtilAction.velocity(other, UtilAlg.getTrajectory(player.getLocation(), other.getLocation()), 3 * mult, false, 0, 0.5 + 2 * mult, 10, true);
}
}
}
}
}
public DisguiseCreeper GetDisguise(Player player)
{
DisguiseBase disguise = Manager.Manager.GetDisguise().getDisguise(player);
if (disguise == null)
return null;
if (!(disguise instanceof DisguiseCreeper))
return null;
return (DisguiseCreeper)disguise;
}
public int GetSize(Player player)
{
DisguiseCreeper creeper = GetDisguise(player);
if (creeper == null) return 0;
return creeper.bV();
}
public void DecreaseSize(Player player)
{
DisguiseCreeper creeper = GetDisguise(player);
if (creeper == null) return;
creeper.a(-1);
Manager.Manager.GetDisguise().updateDisguise(creeper);
}
public void IncreaseSize(Player player)
{
DisguiseCreeper creeper = GetDisguise(player);
if (creeper == null) return;
creeper.a(1);
Manager.Manager.GetDisguise().updateDisguise(creeper);
}
@EventHandler
public void HeroOwner(PlayerJoinEvent event)
{
if (Manager.Manager.GetClients().Get(event.getPlayer()).GetRank().Has(Rank.HERO))
{
Manager.Manager.GetDonation().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName());
}
}
@EventHandler
public void Clean(PlayerQuitEvent event)
{
_active.remove(event.getPlayer());
}
}

View File

@ -0,0 +1,49 @@
package mineplex.hub.gadget.gadgets;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.gadget.GadgetManager;
import mineplex.hub.gadget.types.ParticleGadget;
public class ParticleEnchant extends ParticleGadget
{
public ParticleEnchant(GadgetManager manager)
{
super(manager, "Enchanted", new String[]
{
C.cWhite + "The wisdom of the universe",
C.cWhite + "suddenly finds you extremely",
C.cWhite + "attractive, and wants to",
C.cWhite + "\'enchant\' you.",
},
-1,
Material.BOOK, (byte)0);
}
@EventHandler
public void playParticle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : GetActive())
{
if (Manager.isMoving(player))
{
UtilParticle.PlayParticle(ParticleType.ENCHANTMENT_TABLE, player.getLocation().add(0, 1, 0), 0.2f, 0.2f, 0.2f, 0, 4);
}
else
{
UtilParticle.PlayParticle(ParticleType.ENCHANTMENT_TABLE, player.getLocation().add(0, 1.4, 0), 0f, 0f, 0f, 1, 4);
}
}
}
}

View File

@ -0,0 +1,74 @@
package mineplex.hub.gadget.gadgets;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.gadget.GadgetManager;
import mineplex.hub.gadget.types.ParticleGadget;
public class ParticleFireRings extends ParticleGadget
{
public ParticleFireRings(GadgetManager manager)
{
super(manager, "Flame Rings", new String[]
{
C.cWhite + "Forged from the burning ashes",
C.cWhite + "of 1000 Blazes by the infamous",
C.cWhite + "Flame King of the Nether realm.",
},
-1,
Material.BLAZE_POWDER, (byte)0);
}
@EventHandler
public void playParticle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : GetActive())
{
if (Manager.isMoving(player))
{
UtilParticle.PlayParticle(ParticleType.FLAME, player.getLocation().add(0, 1f, 0), 0.2f, 0.2f, 0.2f, 0, 1);
}
else
{
for (int i=0 ; i < 1 ; i++)
{
double lead = i * ((2d * Math.PI)/2);
float x = (float) (Math.sin(player.getTicksLived()/5d + lead) * 1f);
float z = (float) (Math.cos(player.getTicksLived()/5d + lead) * 1f);
float y = (float) (Math.sin(player.getTicksLived()/5d + lead) + 1f);
UtilParticle.PlayParticle(ParticleType.FLAME, player.getLocation().add(x, y, z), 0f, 0f, 0f, 0, 1);
}
for (int i=0 ; i < 1 ; i++)
{
double lead = i * ((2d * Math.PI)/2);
float x = (float) -(Math.sin(player.getTicksLived()/5d + lead) * 1f);
float z = (float) (Math.cos(player.getTicksLived()/5d + lead) * 1f);
float y = (float) (Math.sin(player.getTicksLived()/5d + lead) + 1f);
UtilParticle.PlayParticle(ParticleType.FLAME, player.getLocation().add(x, y, z), 0f, 0f, 0f, 0, 1);
}
//Sound
player.getWorld().playSound(player.getLocation(), Sound.FIRE, 0.2f, 1f);
}
}
}
}

View File

@ -0,0 +1,119 @@
package mineplex.hub.gadget.gadgets;
import java.util.HashMap;
import java.util.Iterator;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
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.UtilTime;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.gadget.GadgetManager;
import mineplex.hub.gadget.types.ParticleGadget;
public class ParticleFoot extends ParticleGadget
{
private boolean _foot = false;
private HashMap<Location, Long> _steps = new HashMap<Location, Long>();
public ParticleFoot(GadgetManager manager)
{
super(manager, "Shadow Walk", new String[]
{
C.cWhite + "In a world where footprints",
C.cWhite + "do not exist, leaving your",
C.cWhite + "shadow behind is the next",
C.cWhite + "best thing.",
},
-1,
Material.LEATHER_BOOTS, (byte)0);
}
@EventHandler
public void playParticle(UpdateEvent event)
{
if (event.getType() != UpdateType.FASTEST)
return;
_foot = !_foot;
cleanSteps();
for (Player player : GetActive())
{
if (!Manager.isMoving(player))
continue;
if (!UtilEnt.isGrounded(player))
continue;
Vector offset;
Vector dir = player.getLocation().getDirection();
dir.setY(0);
dir.normalize();
if (_foot)
{
offset = new Vector(dir.getZ() * -1, 0.1, dir.getX());
}
else
{
offset = new Vector(dir.getZ(), 0.1, dir.getX() * -1);
}
Location loc = player.getLocation().add(offset.multiply(0.2));
if (nearStep(loc))
continue;
if (!UtilBlock.solid(loc.getBlock().getRelative(BlockFace.DOWN)))
continue;
_steps.put(loc, System.currentTimeMillis());
UtilParticle.PlayParticle(ParticleType.FOOTSTEP, loc, 0f, 0f, 0f, 0, 1);
}
}
public void cleanSteps()
{
if (_steps.isEmpty())
return;
Iterator<Location> stepIterator = _steps.keySet().iterator();
while (stepIterator.hasNext())
{
Location step = stepIterator.next();
long time = _steps.get(step);
if (UtilTime.elapsed(time, 10000))
stepIterator.remove();
}
}
public boolean nearStep(Location loc)
{
for (Location other : _steps.keySet())
{
if (UtilMath.offset(loc, other) < 0.3)
return true;
}
return false;
}
}

View File

@ -0,0 +1,52 @@
package mineplex.hub.gadget.gadgets;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.gadget.GadgetManager;
import mineplex.hub.gadget.types.ParticleGadget;
public class ParticleGreen extends ParticleGadget
{
public ParticleGreen(GadgetManager manager)
{
super(manager, "Green Ring", new String[]
{
C.cWhite + "With these sparkles, you",
C.cWhite + "can now sparkle while you",
C.cWhite + "sparkle with CaptainSparklez.",
},
-1,
Material.EMERALD, (byte)0);
}
@EventHandler
public void playParticle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : GetActive())
{
if (Manager.isMoving(player))
{
UtilParticle.PlayParticle(ParticleType.HAPPY_VILLAGER, player.getLocation().add(0, 1f, 0), 0f, 0f, 0f, 0, 1);
}
else
{
float x = (float) (Math.sin(player.getTicksLived()/5d) * 1f);
float z = (float) (Math.cos(player.getTicksLived()/5d) * 1f);
UtilParticle.PlayParticle(ParticleType.HAPPY_VILLAGER, player.getLocation().add(x, 1, z), 0f, 0f, 0f, 0, 1);
}
}
}
}

View File

@ -0,0 +1,71 @@
package mineplex.hub.gadget.gadgets;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.gadget.GadgetManager;
import mineplex.hub.gadget.types.ParticleGadget;
public class ParticleHelix extends ParticleGadget
{
public ParticleHelix(GadgetManager manager)
{
super(manager, "Blood Helix", new String[]
{
C.cWhite + "Ancient legend says this magic",
C.cWhite + "empowers the blood of its user,",
C.cWhite + "giving them godly powers.",
},
-1,
Material.REDSTONE, (byte)0);
}
@EventHandler
public void playParticle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : GetActive())
{
if (Manager.isMoving(player))
{
UtilParticle.PlayParticle(ParticleType.RED_DUST, player.getLocation().add(0, 1, 0), 0.2f, 0.2f, 0.2f, 0, 4);
}
else
{
for (int height=0 ; height <= 20 ; height++)
{
for (int i=0 ; i < 2 ; i++)
{
double lead = i * ((2d * Math.PI)/2);
double heightLead = height * ((2d * Math.PI)/20);
float x = (float) (Math.sin(player.getTicksLived()/20d + lead + heightLead) * 1.2f);
float z = (float) (Math.cos(player.getTicksLived()/20d + lead + heightLead) * 1.2f);
float y = 0.15f * height;
UtilParticle.PlayParticle(ParticleType.RED_DUST, player.getLocation().add(x * (1d - height/22d), y, z * (1d - height/22d)), 0f, 0f, 0f, 0, 1);
}
}
//UtilParticle.PlayParticle(ParticleType.LAVA, player.getLocation().add(0, 3, 0), 0f, 0f, 0f, 0, 2);
//Sound
player.getWorld().playSound(player.getLocation(), Sound.LAVA, 0.3f, 1f);
}
}
}
}

View File

@ -0,0 +1,59 @@
package mineplex.hub.gadget.gadgets;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
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.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.gadget.GadgetManager;
import mineplex.hub.gadget.types.ParticleGadget;
public class ParticleRain extends ParticleGadget
{
public ParticleRain(GadgetManager manager)
{
super(manager, "Rain Cloud", new String[]
{
C.cWhite + "Your very own rain cloud!",
C.cWhite + "Now you never have to worry",
C.cWhite + "about not being wet. Woo...",
},
-1,
Material.INK_SACK, (byte)4);
}
@EventHandler
public void playParticle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : GetActive())
{
if (Manager.isMoving(player))
{
UtilParticle.PlayParticle(ParticleType.SPLASH, player.getLocation().add(0, 1, 0), 0.2f, 0.2f, 0.2f, 0, 4);
}
else
{
UtilParticle.PlayParticle(player, ParticleType.EXPLODE, player.getLocation().add(0, 3.5, 0), 0.6f, 0f, 0.6f, 0, 8);
for (Player other : UtilServer.getPlayers())
if (!player.equals(other))
UtilParticle.PlayParticle(other, ParticleType.CLOUD, player.getLocation().add(0, 3.5, 0), 0.6f, 0.1f, 0.6f, 0, 8);
UtilParticle.PlayParticle(ParticleType.DRIP_WATER, player.getLocation().add(0, 3.5, 0), 0.4f, 0.1f, 0.4f, 0, 2);
//Sound
player.getWorld().playSound(player.getLocation(), Sound.AMBIENCE_RAIN, 0.1f, 1f);
}
}
}
}

View File

@ -0,0 +1,47 @@
package mineplex.hub.gadget.types;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.hub.gadget.GadgetManager;
public abstract class ParticleGadget extends Gadget
{
public ParticleGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data)
{
super(manager, name, desc, cost, mat, data);
}
@Override
public void EnableCustom(Player player)
{
Manager.RemoveParticle(player);
_active.add(player);
UtilPlayer.message(player, F.main("Gadget", "You summoned " + F.elem(GetName()) + "."));
}
@Override
public void Disable(Player player)
{
if (_active.remove(player))
UtilPlayer.message(player, F.main("Gadget", "You unsummoned " + F.elem(GetName()) + "."));
}
@EventHandler
public void Trigger(PlayerCommandPreprocessEvent event)
{
if (event.getMessage().toLowerCase().contains(GetDisplayName().toLowerCase()))
{
this.Enable(event.getPlayer());
event.setCancelled(true);
}
}
}

View File

@ -15,6 +15,9 @@ import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.disguise.disguises.DisguiseBase;
import mineplex.core.disguise.disguises.DisguiseChicken;
import mineplex.core.disguise.disguises.DisguiseCreeper;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.HubManager;
@ -37,7 +40,12 @@ public class JumpManager extends MiniPlugin
if (player.getGameMode() == GameMode.CREATIVE)
return;
//Chicken Cancel
DisguiseBase disguise = Manager.GetDisguise().getDisguise(player);
if (disguise != null && disguise instanceof DisguiseChicken)
return;
event.setCancelled(true);
player.setFlying(false);
@ -78,5 +86,4 @@ public class JumpManager extends MiniPlugin
}
}
}
}

View File

@ -246,15 +246,17 @@ public class NewsManager extends MiniPlugin
String text = col + C.Bold + "MINEPLEX" + ChatColor.RESET + " - " + _news[_newsIndex];
if (text.length() > 64)
text = text.substring(0, 64);
double healthPercent = (double)_newsIndex/(double)(_news.length-1);
for (Player player : UtilServer.getPlayers())
UtilDisplay.displayTextBar(Manager.GetPlugin(), player, (double)_newsIndex/(double)(_news.length-1), text);
UtilDisplay.displayTextBar(Manager.GetPlugin(), player, healthPercent, text);
for (Mount mount : Manager.GetMount().getMounts())
{
if (mount instanceof Dragon)
{
((Dragon)mount).SetName(text);
((Dragon)mount).setHealthPercent(healthPercent);
}
}
}

View File

@ -9,9 +9,4 @@ public class ServerInfo
public String Map;
public String ServerType;
public String Game;
public boolean isFree()
{
return Name.contains("FREE");
}
}

View File

@ -62,7 +62,7 @@ import mineplex.hub.server.ui.ServerNpcShop;
public class ServerManager extends MiniPlugin
{
private static final Long FREE_PORTAL_TIMER = 20000L;
private static final Long FREE_PORTAL_TIMER = 35000L;
private CoreClientManager _clientManager;
private DonationManager _donationManager;
@ -192,10 +192,6 @@ public class ServerManager extends MiniPlugin
{
if ((serverInfo.MOTD.contains("Starting") || serverInfo.MOTD.contains("Recruiting") || serverInfo.MOTD.contains("Waiting") || serverInfo.MOTD.contains("Cup")) && (serverInfo.MaxPlayers - serverInfo.CurrentPlayers) >= slots)
{
// Make sure ultra players get put on premium servers, non premium gets placed on free servers
if (hasUltra == serverInfo.isFree())
continue;
SelectServer(player, serverInfo);
return;
}

View File

@ -26,7 +26,6 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
{
// Shop Item Messages
private static final String MESSAGE_SHOP_URL = ChatColor.RESET + "www.mineplex.com/shop";
private static final String MESSAGE_REQUIRES_PREMIUM = ChatColor.RESET + C.cRed + "Premium requires " + Rank.ULTRA.GetTag(false, false) + C.cRed + " or " + Rank.HERO.GetTag(false, false);
private static final String MESSAGE_BETA_GET_ULTRA = ChatColor.RESET + C.Line + "Get Ultra to join Beta servers!";
private static final String MESSAGE_JOIN = ChatColor.RESET + C.Line + "Click to Join";
private static final String MESSAGE_IN_PROGRESS = ChatColor.RESET + C.Line + "Game in Progress.";
@ -37,8 +36,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
private String _serverNpcKey;
private boolean _onMainPage = true;
private boolean _freeOnly;
public ServerNpcPage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player, String serverNpcKey)
{
super(plugin, shop, clientManager, donationManager, name, player, 54);
@ -76,7 +74,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
}
else
{
buildInProgressServerPage(serverList, _freeOnly, slotsNeeded);
buildInProgressServerPage(serverList, slotsNeeded);
}
}
@ -93,13 +91,13 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
ChatColor.RESET + C.cYellow + "Free players must wait a short time",
ChatColor.RESET + C.cYellow + "to help lighten the load on our servers.",
ChatColor.RESET + "",
ChatColor.RESET + C.cAqua + "Ultra and Hero players have instant",
ChatColor.RESET + C.cAqua + "access to free and premium servers!",
ChatColor.RESET + C.cAqua + "Ultra and Hero players have",
ChatColor.RESET + C.cAqua + "instant access to our servers!",
ChatColor.RESET + "",
ChatColor.RESET + "Visit " + C.cGreen + "www.mineplex.com/shop" + C.cWhite + " for Premium!"
}, seconds, false, false);
AddItem(20, item);
AddItem(22, item);
}
private void clearPage()
@ -114,14 +112,13 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
{
boolean ownsUltraPackage = DonationManager.Get(Player.getName()).OwnsUnknownPackage(serverInfo.ServerType + " ULTRA") || Client.GetRank().Has(Rank.ULTRA);
Material status = Material.REDSTONE_BLOCK;
boolean free = serverInfo.isFree();
List<String> lore = new ArrayList<String>();
String inProgress = (serverInfo.Game == null || serverInfo.ServerType.equalsIgnoreCase("Competitive")) ? MESSAGE_IN_PROGRESS : MESSAGE_SPECTATE;
String wait = (serverInfo.Game == null || serverInfo.ServerType.equalsIgnoreCase("Competitive")) ? null : MESSAGE_WAIT;
if (isStarting(serverInfo) && (serverInfo.MaxPlayers - serverInfo.CurrentPlayers) >= slotsNeeded)
status = free ? Material.EMERALD_BLOCK : Material.DIAMOND_BLOCK;
status = Material.EMERALD_BLOCK;
else if (isInProgress(serverInfo))
status = Material.GOLD_BLOCK;
@ -135,10 +132,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
lore.add(ChatColor.RESET + C.cYellow + "Players: " + C.cWhite + serverInfo.CurrentPlayers + "/" + serverInfo.MaxPlayers);
lore.add(ChatColor.RESET + "");
// Only show motd if the player has access
if (free || ownsUltraPackage)
lore.add(ChatColor.RESET + serverInfo.MOTD);
lore.add(ChatColor.RESET + serverInfo.MOTD);
if (serverInfo.Name.contains("BETA") && !ownsUltraPackage)
{
@ -164,13 +158,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
{
if (!ownsUltraPackage)
{
if (free)
lore.add(MESSAGE_FULL_GET_ULTRA);
else
{
lore.add(MESSAGE_REQUIRES_PREMIUM);
lore.add(MESSAGE_SHOP_URL);
}
lore.add(MESSAGE_FULL_GET_ULTRA);
}
else
{
@ -183,8 +171,6 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
}
else
{
if (free || ownsUltraPackage)
{
if (serverInfo.CurrentPlayers >= serverInfo.MaxPlayers && !ownsUltraPackage)
{
lore.add(MESSAGE_FULL_GET_ULTRA);
@ -193,26 +179,18 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
{
lore.add(MESSAGE_JOIN);
}
}
else
{
lore.add(MESSAGE_REQUIRES_PREMIUM);
lore.add(MESSAGE_SHOP_URL);
}
}
}
return new ShopItem(status, ChatColor.RESET + C.Line + C.Bold + (free ? C.cGreen + "Free Server " : C.cAqua + "Premium Server ") + serverInfo.Name.split("-")[1], lore.toArray(new String[lore.size()]), serverInfo.CurrentPlayers, false);
return new ShopItem(status, ChatColor.RESET + C.cGreen + C.Line + C.Bold + "Server " + serverInfo.Name.split("-")[1], lore.toArray(new String[lore.size()]), serverInfo.CurrentPlayers, false);
}
private void buildAvailableServerPage(List<ServerInfo> serverList, int slotsNeeded)
{
int serversToShow = 5;
int greenCount = 0;
int blueCount = 0;
int yellowFreeCount = 0;
int yellowUltraCount = 0;
int greenStartSlot = 19;
int blueStartSlot = 23;
int yellowCount = 0;
int greenStartSlot = 18 + ((9 - serversToShow) / 2);
boolean showGreen = true;
long portalTime = Plugin.getMillisecondsUntilPortal(Player);
@ -224,73 +202,42 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
for (ServerInfo serverInfo : serverList)
{
boolean free = serverInfo.isFree();
int slot = (free ? greenCount + greenStartSlot : blueCount + blueStartSlot);
int slot = greenCount + greenStartSlot;
if (isStarting(serverInfo) && hasEnoughSlots(serverInfo, slotsNeeded) && (free ? greenCount : blueCount) < 3)
if (isStarting(serverInfo) && hasEnoughSlots(serverInfo, slotsNeeded) && greenCount < serversToShow)
{
if ((free && showGreen) || !free)
if (showGreen)
{
ShopItem shopItem = buildShopItem(serverInfo, slotsNeeded);
if (free)
greenCount++;
else
blueCount++;
greenCount++;
AddButton(slot, shopItem, new JoinServerButton(this, serverInfo));
}
}
else if (isInProgress(serverInfo))
{
if (free)
yellowFreeCount++;
else
yellowUltraCount++;
yellowCount++;
}
}
// AddItem(11, new ShopItem(Material.IRON_BLOCK, C.cGreen + "Free Servers", new String[] {C.cGray + "Anyone can play!" }, 1, false));
// AddItem(15, new ShopItem(Material.IRON_BLOCK, C.cBlue + "Premium Servers", new String[] {C.cGray + "Available to " + Rank.ULTRA.GetTag(true, true) + ChatColor.RESET + C.cGray + " and " + Rank.HERO.GetTag(true, true) + ChatColor.RESET + C.cGray + "!" }, 1, false));
AddButton(38, new ShopItem(Material.GOLD_BLOCK, C.cGreen + yellowFreeCount + " Games In Progress", new String[]{MESSAGE_SPECTATE}, yellowFreeCount > 64 ? 1 : yellowFreeCount, false), new SingleButton()
{
@Override
public void Clicked(Player player)
{
long portalTime = Plugin.getMillisecondsUntilPortal(Player);
if (portalTime <= 0)
{
_onMainPage = false;
_freeOnly = true;
}
else
{
PlayDenySound(Player);
}
}
});
AddButton(42, new ShopItem(Material.GOLD_BLOCK, C.cAqua + yellowUltraCount + " Games In Progress", new String[]{MESSAGE_SPECTATE}, yellowUltraCount > 64 ? 1 : yellowUltraCount, false), new SingleButton()
AddButton(40, new ShopItem(Material.GOLD_BLOCK, C.cAqua + yellowCount++ + " Games In Progress", new String[]{MESSAGE_SPECTATE}, yellowCount > 64 ? 1 : yellowCount, false), new SingleButton()
{
@Override
public void Clicked(Player player)
{
_onMainPage = false;
_freeOnly = false;
}
});
// Clear empty slots
if (showGreen)
{
for (int i = greenCount + greenStartSlot; i < greenStartSlot + 3; i++)
for (int i = greenCount + greenStartSlot; i < greenStartSlot + serversToShow; i++)
{
setItem(i, null);
}
}
for (int i = blueCount + blueStartSlot; i < blueStartSlot + 3; i++)
{
setItem(i, null);
}
}
private boolean isStarting(ServerInfo serverInfo)
@ -308,13 +255,13 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
return (serverInfo.MaxPlayers - serverInfo.CurrentPlayers) >= slotsNeeded;
}
private void buildInProgressServerPage(List<ServerInfo> serverList, boolean freeOnly, int slotsNeeded)
private void buildInProgressServerPage(List<ServerInfo> serverList, int slotsNeeded)
{
int slot = 9;
for (ServerInfo serverInfo : serverList)
{
if (isInProgress(serverInfo) && serverInfo.isFree() == freeOnly && slot < getSize())
if (isInProgress(serverInfo) && slot < getSize())
{
ShopItem shopItem = buildShopItem(serverInfo, slotsNeeded);
@ -351,7 +298,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
{
int slots = Plugin.GetRequiredSlots(player, serverInfo.ServerType);
if ((serverInfo.Name.contains("BETA") && !Client.GetRank().Has(Rank.ULTRA)) || (!serverInfo.isFree() && !(DonationManager.Get(Player.getName()).OwnsUnknownPackage(serverInfo.ServerType + " ULTRA") || Client.GetRank().Has(Rank.ULTRA))) || (serverInfo.MaxPlayers - serverInfo.CurrentPlayers < slots && !(DonationManager.Get(Player.getName()).OwnsUnknownPackage(serverInfo.ServerType + " ULTRA") || Client.GetRank().Has(Rank.ULTRA))))
if ((serverInfo.Name.contains("BETA") && !Client.GetRank().Has(Rank.ULTRA)) || (serverInfo.MaxPlayers - serverInfo.CurrentPlayers < slots && !(DonationManager.Get(Player.getName()).OwnsUnknownPackage(serverInfo.ServerType + " ULTRA") || Client.GetRank().Has(Rank.ULTRA))))
{
PlayDenySound(player);
return;

View File

@ -26,6 +26,7 @@ public enum GameType
Horse("Horseback"),
SurvivalGames("Survival Games"),
SurvivalGamesTeams("Survival Games Teams"),
Micro("Micro Battle"),
MineWare("MineWare"),
MilkCow("Milk the Cow"),
Paintball("Super Paintball"),
@ -37,11 +38,13 @@ public enum GameType
SmashTeams("Super Smash Mobs Teams", "Super Smash Mobs"),
SmashDomination("Super Smash Mobs Domination", "Super Smash Mobs"),
Snake("Snake"),
SneakyAssassins("Sneaky Assassins"),
SnowFight("Snow Fight"),
Spleef("Super Spleef"),
SpleefTeams("Super Spleef Teams"),
Stacker("Super Stacker"),
SquidShooter("Squid Shooter"),
Tug("Tug of Wool"),
TurfWars("Turf Wars"),
UHC("Ultra Hardcore"),
ZombieSurvival("Zombie Survival");

View File

@ -639,7 +639,11 @@ public class MapParser extends JavaPlugin implements Listener
public void Updates(PlayerMoveEvent event)
{
for (World world : this.getServer().getWorlds())
{
world.setTime(8000);
world.setStorm(false);
}
if (event.getPlayer().getGameMode() != GameMode.CREATIVE)
event.getPlayer().setGameMode(GameMode.CREATIVE);

View File

@ -29,7 +29,7 @@ public class Parse
private String[] _args;
private Location _callLoc;
private int _size = 50;
private int _size = 500;
private int _x = 0;
private int _y = 0;
private int _z = 0;
@ -57,6 +57,9 @@ public class Parse
_callLoc = new Location(world, loc.getX(), loc.getY(), loc.getZ());
_mapData = data;
for (String arg : args)
Host.Announce("Parse Arg: " + F.elem(arg));
Initialize();
}
@ -309,10 +312,10 @@ public class Parse
if (wool.getData() == 11)
{
if (!_teamLocs.containsKey("DBlue"))
_teamLocs.put("DBlue", new ArrayList<Location>());
if (!_teamLocs.containsKey("Blue"))
_teamLocs.put("Blue", new ArrayList<Location>());
_teamLocs.get("DBlue").add(wool.getLocation());
_teamLocs.get("Blue").add(wool.getLocation());
//Remove Blocks
block.setTypeId(0);

View File

@ -24,6 +24,7 @@ import nautilus.game.arcade.game.games.evolution.Evolution;
import nautilus.game.arcade.game.games.gravity.Gravity;
import nautilus.game.arcade.game.games.halloween.Halloween;
import nautilus.game.arcade.game.games.hideseek.HideSeek;
import nautilus.game.arcade.game.games.micro.Micro;
import nautilus.game.arcade.game.games.milkcow.MilkCow;
import nautilus.game.arcade.game.games.mineware.MineWare;
import nautilus.game.arcade.game.games.quiver.Quiver;
@ -76,6 +77,7 @@ public class GameFactory
else if (gameType == GameType.Gravity) return new Gravity(_manager);
else if (gameType == GameType.Halloween) return new Halloween(_manager);
else if (gameType == GameType.HideSeek) return new HideSeek(_manager);
else if (gameType == GameType.Micro) return new Micro(_manager);
else if (gameType == GameType.MineWare) return new MineWare(_manager);
else if (gameType == GameType.MilkCow) return new MilkCow(_manager);
else if (gameType == GameType.Paintball) return new Paintball(_manager);

View File

@ -26,6 +26,7 @@ public enum GameType
Horse("Horseback"),
SurvivalGames("Survival Games"),
SurvivalGamesTeams("Survival Games Teams"),
Micro("Micro Battle"),
MineWare("MineWare"),
MilkCow("Milk the Cow"),
Paintball("Super Paintball"),

View File

@ -2,6 +2,7 @@ package nautilus.game.arcade.addons;
import java.util.HashSet;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -84,7 +85,7 @@ public class CompassAddon extends MiniPlugin
if (target != null)
{
if (Manager.GetGame().CompassGiveItem)
if (Manager.GetGame().CompassGiveItem || player.getGameMode() == GameMode.SURVIVAL)
if (!player.getInventory().contains(Material.COMPASS))
{
if (player.getOpenInventory() == null || player.getOpenInventory().getCursor() == null || player.getOpenInventory().getCursor().getType() != Material.COMPASS)

View File

@ -246,6 +246,11 @@ public abstract class Game implements Listener
System.out.println("Loading " + GetName() + "...");
}
public void setKits(Kit[] kits)
{
_kits = kits;
}
public ArrayList<String> GetFiles()
{
return _files;

View File

@ -230,6 +230,9 @@ public abstract class TeamGame extends Game
//Display Individual Players
if (this.GetPlayers(true).size() < 13)
{
if (!team.IsTeamAlive())
continue;
Scoreboard.WriteBlank();
for (Player player : team.GetPlayers(true))

View File

@ -74,7 +74,7 @@ public class BaconBrawl extends SoloGame
if (event.GetCause() == DamageCause.ENTITY_ATTACK || event.GetCause() == DamageCause.CUSTOM || event.GetCause() == DamageCause.PROJECTILE)
{
event.GetDamageeEntity().setHealth(event.GetDamageeEntity().getMaxHealth());
event.AddKnockback("Pig Wrestle", 2);
event.AddKnockback("Pig Wrestle", 1.5 + (GetStateTime() / 60000d));
}
}
}

View File

@ -65,7 +65,7 @@ public class KitBabyPig extends Kit
LivingEntity entity = (LivingEntity) Manager.GetCreature().SpawnEntity(loc, type);
entity.setRemoveWhenFarAway(false);
entity.setCustomName(GetAvailability().GetColor() + GetName() + " Kit" + (GetAvailability() == KitAvailability.Blue ? ChatColor.GRAY + " (" + ChatColor.WHITE + "Ultra" + ChatColor.GRAY + ")" : ""));
entity.setCustomName(GetAvailability().GetColor() + GetName() + " Kit");
entity.setCustomNameVisible(true);
entity.getEquipment().setItemInHand(_itemInHand);

View File

@ -26,7 +26,7 @@ public class KitSheepPig extends Kit
{
public KitSheepPig(ArcadeManager manager)
{
super(manager, "'Pig'", KitAvailability.Blue,
super(manager, "'Pig'", KitAvailability.Green, 5000,
new String[]
{
@ -65,7 +65,7 @@ public class KitSheepPig extends Kit
LivingEntity entity = (LivingEntity) Manager.GetCreature().SpawnEntity(loc, type);
entity.setRemoveWhenFarAway(false);
entity.setCustomName(GetAvailability().GetColor() + GetName() + " Kit" + (GetAvailability() == KitAvailability.Blue ? ChatColor.GRAY + " (" + ChatColor.WHITE + "Ultra" + ChatColor.GRAY + ")" : ""));
entity.setCustomName(GetAvailability().GetColor() + GetName() + " Kit");
entity.setCustomNameVisible(true);
entity.getEquipment().setItemInHand(_itemInHand);

View File

@ -18,7 +18,7 @@ public class KitBomber extends Kit
{
public KitBomber(ArcadeManager manager)
{
super(manager, "Bomber", KitAvailability.Blue,
super(manager, "Bomber", KitAvailability.Green, 5000,
new String[]
{

View File

@ -15,7 +15,7 @@ public class KitBomber extends Kit
{
public KitBomber(ArcadeManager manager)
{
super(manager, "Bomber", KitAvailability.Blue,
super(manager, "Bomber", KitAvailability.Green, 5000,
new String[]
{

View File

@ -16,7 +16,7 @@ public class KitMiner extends Kit
{
public KitMiner(ArcadeManager manager)
{
super(manager, "Miner", KitAvailability.Blue,
super(manager, "Miner", KitAvailability.Green, 5000,
new String[]
{

View File

@ -23,7 +23,7 @@ public class KitHumanAssassin extends Kit
{
public KitHumanAssassin(ArcadeManager manager)
{
super(manager, "Castle Assassin", KitAvailability.Blue,
super(manager, "Castle Assassin", KitAvailability.Green, 5000,
new String[]
{
"Able to kill with a single shot!"

View File

@ -22,7 +22,7 @@ public class KitHumanBrawler extends Kit
{
public KitHumanBrawler(ArcadeManager manager)
{
super(manager, "Castle Brawler", KitAvailability.Blue,
super(manager, "Castle Brawler", KitAvailability.Green, 5000,
new String[]
{

View File

@ -19,7 +19,7 @@ public class KitUndeadZombie extends Kit
{
public KitUndeadZombie(ArcadeManager manager)
{
super(manager, "Undead Zombie", KitAvailability.Blue,
super(manager, "Undead Zombie", KitAvailability.Green, 5000,
new String[]
{

View File

@ -16,7 +16,7 @@ public class KitRunnerTraitor extends Kit
{
public KitRunnerTraitor(ArcadeManager manager)
{
super(manager, "Runner Traitor", KitAvailability.Blue,
super(manager, "Runner Traitor", KitAvailability.Green, 5000,
new String[]
{
"You can deal knockback to other runners!"

View File

@ -16,7 +16,7 @@ public class KitWarper extends Kit
{
public KitWarper(ArcadeManager manager)
{
super(manager, "Warper", KitAvailability.Blue,
super(manager, "Warper", KitAvailability.Green, 5000,
new String[]
{

View File

@ -17,7 +17,7 @@ public class KitPyrotechnic extends Kit
{
public KitPyrotechnic(ArcadeManager manager)
{
super(manager, "Pyrotechnic", KitAvailability.Blue,
super(manager, "Pyrotechnic", KitAvailability.Green, 5000,
new String[]
{

View File

@ -104,8 +104,10 @@ public class Gravity extends SoloGame
this.HungerSet = 10;
this.WorldTimeSet = 18000;
this.CompassEnabled = true;
this.WorldBoundaryKill = false;
}
@Override

View File

@ -104,6 +104,9 @@ public class GravityPlayer extends GravityObject
public void KickOff(Player player)
{
if (!Ent.equals(player))
return;
GrabDelay = System.currentTimeMillis();
AddVelocity(player.getLocation().getDirection().multiply(0.5), 0.5);

View File

@ -22,7 +22,7 @@ public class KitHiderShocker extends Kit
{
public KitHiderShocker(ArcadeManager manager)
{
super(manager, "Shocking Hider", KitAvailability.Blue,
super(manager, "Shocking Hider", KitAvailability.Green, 5000,
new String[]
{

View File

@ -22,7 +22,7 @@ public class KitSeekerRadar extends Kit
{
public KitSeekerRadar(ArcadeManager manager)
{
super(manager, "Radar Hunter", KitAvailability.Blue,
super(manager, "Radar Hunter", KitAvailability.Green, 5000,
new String[]
{
"tick......tick...tick.tick.",

View File

@ -0,0 +1,196 @@
package nautilus.game.arcade.game.games.micro;
import java.util.ArrayList;
import org.bukkit.Location;
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 org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockFromToEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilTime;
import mineplex.core.timing.TimingManager;
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.GameType;
import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.micro.kits.*;
import nautilus.game.arcade.kit.Kit;
public class Micro extends TeamGame
{
private ArrayList<Block> _blocks = new ArrayList<Block>();
private ArrayList<Block> _glass = new ArrayList<Block>();
public Micro(ArcadeManager manager)
{
super(manager, GameType.Micro,
new Kit[]
{
new KitArcher(manager),
new KitWorker(manager),
new KitFighter(manager)
},
new String[]
{
"Small game, big strategy!",
});
this.TeamArmor = true;
this.TeamArmorHotbar = true;
this.InventoryClick = true;
this.ItemDrop = true;
this.ItemPickup = true;
this.BlockBreak = true;
this.BlockPlace = true;
}
@Override
public void ParseData()
{
for (Location loc : WorldData.GetCustomLocs("20"))
_glass.add(loc.getBlock());
for (int y= WorldData.MinY ; y < WorldData.MaxY ; y++)
for (int x= WorldData.MinX ; x < WorldData.MaxX ; x++)
for (int z= WorldData.MinZ ; z < WorldData.MaxZ ; z++)
{
Block block = WorldData.World.getBlockAt(x, y, z);
if (block.getType() == Material.AIR)
continue;
_blocks.add(block);
}
}
@EventHandler
public void BlockPlace(BlockPlaceEvent event)
{
if (event.isCancelled())
return;
_blocks.add(event.getBlock());
}
@EventHandler
public void BlockUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
if (!IsLive())
return;
if (_blocks.isEmpty())
return;
TimingManager.start("Block Fall");
for (int i = 0 ; i < 3 ; i++)
{
Block bestBlock = null;
double bestDist = 0;
for (Block block : _blocks)
{
double dist = UtilMath.offset2d(GetSpectatorLocation(), block.getLocation().add(0.5, 0.5, 0.5));
if (bestBlock == null || dist > bestDist)
{
bestBlock = block;
bestDist = dist;
}
}
//Shuffle Down
while (bestBlock.getRelative(BlockFace.DOWN).getType() != Material.AIR)
bestBlock = bestBlock.getRelative(BlockFace.DOWN);
_blocks.remove(bestBlock);
if (bestBlock.getType() != Material.AIR)
{
if (Math.random() > 0.75)
bestBlock.getWorld().spawnFallingBlock(bestBlock.getLocation().add(0.5, 0.5, 0.5), bestBlock.getType(), bestBlock.getData());
bestBlock.setType(Material.AIR);
}
}
TimingManager.stop("Block Fall");
}
@EventHandler
public void TimeUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
if (!IsLive())
return;
WorldData.World.setTime(WorldData.World.getTime() + 1);
}
@EventHandler
public void FoodUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : GetPlayers(true))
if (player.getFoodLevel() < 2)
player.setFoodLevel(2);
}
@EventHandler
public void BarrierUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
if (!IsLive())
return;
if (_glass.isEmpty())
return;
if (!UtilTime.elapsed(GetStateTime(), 10000))
return;
for (Block block : _glass)
block.setType(Material.AIR);
_glass.clear();
}
@EventHandler
public void BarrierBreak(BlockBreakEvent event)
{
if (_glass.contains(event.getBlock()))
event.setCancelled(true);
}
@EventHandler
public void ArrowDecrease(CustomDamageEvent event)
{
if (event.GetProjectile() == null)
return;
event.AddMod(GetName(), "Projectile Reduce", -2, false);
}
}

View File

@ -0,0 +1,42 @@
package nautilus.game.arcade.game.games.micro.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkFletcher;
public class KitArcher extends Kit
{
public KitArcher(ArcadeManager manager)
{
super(manager, "Archer", KitAvailability.Free,
new String[]
{
"Shoot shoot!"
},
new Perk[]
{
new PerkFletcher(20, 3, true)
},
EntityType.ZOMBIE,
new ItemStack(Material.BOW));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.WOOD_SWORD));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.APPLE, 3));
}
}

View File

@ -0,0 +1,41 @@
package nautilus.game.arcade.game.games.micro.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.*;
public class KitFighter extends Kit
{
public KitFighter(ArcadeManager manager)
{
super(manager, "Fighter", KitAvailability.Free,
new String[]
{
"HE LIKES TO FIGHT!"
},
new Perk[]
{
new PerkIronSkin(1)
},
EntityType.ZOMBIE,
new ItemStack(Material.STONE_SWORD));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.WOOD_SWORD));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.APPLE, 5));
}
}

View File

@ -0,0 +1,42 @@
package nautilus.game.arcade.game.games.micro.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
public class KitWorker extends Kit
{
public KitWorker(ArcadeManager manager)
{
super(manager, "Worker", KitAvailability.Free,
new String[]
{
"DIG DIG!"
},
new Perk[]
{
},
EntityType.ZOMBIE,
new ItemStack(Material.STONE_PICKAXE));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.WOOD_SWORD));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.STONE_SPADE));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.STONE_PICKAXE));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.APPLE, 4));
}
}

View File

@ -81,6 +81,12 @@ public class MineWare extends SoloGame
this.BlockPlace = true;
this.BlockBreak = true;
this.ItemDrop = true;
this.ItemPickup = true;
this.InventoryOpen = true;
this.InventoryClick = true;
PopulateOrders();
}

View File

@ -19,7 +19,7 @@ public class KitMachineGun extends Kit
{
public KitMachineGun(ArcadeManager manager)
{
super(manager, "Machine Gun", KitAvailability.Blue,
super(manager, "Machine Gun", KitAvailability.Green, 5000,
new String[]
{

View File

@ -20,7 +20,7 @@ public class KitElementalist extends Kit
{
public KitElementalist(ArcadeManager manager)
{
super(manager, "Enchanter", KitAvailability.Blue,
super(manager, "Enchanter", KitAvailability.Green, 5000,
new String[]
{

View File

@ -19,7 +19,7 @@ public class KitFrosty extends Kit
{
public KitFrosty(ArcadeManager manager)
{
super(manager, "Frosty", KitAvailability.Blue,
super(manager, "Frosty", KitAvailability.Green, 5000,
new String[]
{

View File

@ -19,7 +19,7 @@ public class KitBrute extends Kit
{
public KitBrute(ArcadeManager manager)
{
super(manager, "Brute", KitAvailability.Blue,
super(manager, "Brute", KitAvailability.Green, 5000,
new String[]
{

View File

@ -27,7 +27,7 @@ public class KitBlaze extends SmashKit
{
public KitBlaze(ArcadeManager manager)
{
super(manager, "Blaze", KitAvailability.Blue,
super(manager, "Blaze", KitAvailability.Green, 6000,
new String[]
{
@ -106,10 +106,4 @@ public class KitBlaze extends SmashKit
Manager.GetCondition().Factory().FireItemImmunity(GetName(), player, player, 1.9, false);
}
}
@Override
public int GetCost()
{
return 6000;
}
}

View File

@ -23,7 +23,7 @@ public class KitChicken extends SmashKit
{
public KitChicken(ArcadeManager manager)
{
super(manager, "Chicken", KitAvailability.Blue,
super(manager, "Chicken", KitAvailability.Green, 5000,
new String[]
{

View File

@ -15,7 +15,7 @@ public class KitComingSoon extends SmashKit
{
public KitComingSoon(ArcadeManager manager)
{
super(manager, C.cRed + "Coming Soon", KitAvailability.Blue,
super(manager, C.cRed + "Coming Soon", KitAvailability.Green, 5000,
new String[]
{

View File

@ -19,7 +19,7 @@ public class KitCow extends SmashKit
{
public KitCow(ArcadeManager manager)
{
super(manager, "Mad Cow", KitAvailability.Blue,
super(manager, "Mad Cow", KitAvailability.Green, 5000,
new String[]
{

View File

@ -24,7 +24,7 @@ public class KitCreeper extends SmashKit
{
public KitCreeper(ArcadeManager manager)
{
super(manager, "Creeper", KitAvailability.Green,
super(manager, "Creeper", KitAvailability.Green, 4000,
new String[]
{
@ -95,10 +95,4 @@ public class KitCreeper extends SmashKit
disguise.SetCustomNameVisible(true);
Manager.GetDisguise().disguise(disguise);
}
@Override
public int GetCost()
{
return 4000;
}
}

View File

@ -34,7 +34,7 @@ public class KitEnderman extends SmashKit
public KitEnderman(ArcadeManager manager)
{
super(manager, "Enderman", KitAvailability.Green,
super(manager, "Enderman", KitAvailability.Green, 4000,
new String[]
{
@ -147,10 +147,4 @@ public class KitEnderman extends SmashKit
}
}
}
@Override
public int GetCost()
{
return 4000;
}
}

View File

@ -50,7 +50,7 @@ public class KitKnight extends SmashKit
public KitKnight(ArcadeManager manager)
{
super(manager, "Undead Knight", KitAvailability.Blue,
super(manager, "Undead Knight", KitAvailability.Green, 5000,
new String[]
{
@ -254,7 +254,7 @@ public class KitKnight extends SmashKit
LivingEntity entity = (LivingEntity) Manager.GetCreature().SpawnEntity(loc, type);
entity.setRemoveWhenFarAway(false);
entity.setCustomName(GetAvailability().GetColor() + GetName() + " Kit" + (GetAvailability() == KitAvailability.Blue ? ChatColor.GRAY + " (" + ChatColor.WHITE + "Ultra" + ChatColor.GRAY + ")" : ""));
entity.setCustomName(GetAvailability().GetColor() + GetName() + " Kit");
entity.setCustomNameVisible(true);
entity.getEquipment().setItemInHand(_itemInHand);

View File

@ -19,7 +19,7 @@ public class KitMagmaCube extends SmashKit
{
public KitMagmaCube(ArcadeManager manager)
{
super(manager, "Magma Cube", KitAvailability.Blue,
super(manager, "Magma Cube", KitAvailability.Green, 5000,
new String[]
{

View File

@ -23,7 +23,7 @@ public class KitPig extends SmashKit
{
public KitPig(ArcadeManager manager)
{
super(manager, "Pig", KitAvailability.Blue,
super(manager, "Pig", KitAvailability.Green, 5000,
new String[]
{

View File

@ -27,7 +27,7 @@ public class KitSkeletalHorse extends SmashKit
{
public KitSkeletalHorse(ArcadeManager manager)
{
super(manager, "Skeletal Horse", KitAvailability.Blue,
super(manager, "Skeletal Horse", KitAvailability.Green, 5000,
new String[]
{
@ -111,7 +111,7 @@ public class KitSkeletalHorse extends SmashKit
LivingEntity entity = (LivingEntity) Manager.GetCreature().SpawnEntity(loc, type);
entity.setRemoveWhenFarAway(false);
entity.setCustomName(GetAvailability().GetColor() + GetName() + " Kit" + (GetAvailability() == KitAvailability.Blue ? ChatColor.GRAY + " (" + ChatColor.WHITE + "Ultra" + ChatColor.GRAY + ")" : ""));
entity.setCustomName(GetAvailability().GetColor() + GetName() + " Kit");
entity.setCustomNameVisible(true);
entity.getEquipment().setItemInHand(_itemInHand);

View File

@ -22,7 +22,7 @@ public class KitSkySquid extends SmashKit
{
public KitSkySquid(ArcadeManager manager)
{
super(manager, "Sky Squid", KitAvailability.Blue,
super(manager, "Sky Squid", KitAvailability.Green, 5000,
new String[]
{

View File

@ -25,7 +25,7 @@ public class KitSnowman extends SmashKit
{
public KitSnowman(ArcadeManager manager)
{
super(manager, "Snowman", KitAvailability.Green,
super(manager, "Snowman", KitAvailability.Green, 5000,
new String[]
{
@ -94,10 +94,4 @@ public class KitSnowman extends SmashKit
disguise.SetCustomNameVisible(true);
Manager.GetDisguise().disguise(disguise);
}
@Override
public int GetCost()
{
return 5000;
}
}

View File

@ -101,10 +101,4 @@ public class KitSpider extends SmashKit
disguise.SetCustomNameVisible(true);
Manager.GetDisguise().disguise(disguise);
}
@Override
public int GetCost()
{
return 2000;
}
}

View File

@ -26,7 +26,7 @@ public class KitWitch extends SmashKit
{
public KitWitch(ArcadeManager manager)
{
super(manager, "Witch", KitAvailability.Blue,
super(manager, "Witch", KitAvailability.Green, 5000,
new String[]
{

View File

@ -29,7 +29,7 @@ public class KitWither extends SmashKit
{
public KitWither(ArcadeManager manager)
{
super(manager, "Wither", KitAvailability.Blue,
super(manager, "Wither", KitAvailability.Green, 5000,
new String[]
{
@ -101,7 +101,7 @@ public class KitWither extends SmashKit
LivingEntity entity = (LivingEntity) Manager.GetCreature().SpawnEntity(loc, type);
entity.setRemoveWhenFarAway(false);
entity.setCustomName(GetAvailability().GetColor() + GetName() + " Kit" + (GetAvailability() == KitAvailability.Blue ? ChatColor.GRAY + " (" + ChatColor.WHITE + "Ultra" + ChatColor.GRAY + ")" : ""));
entity.setCustomName(GetAvailability().GetColor() + GetName() + " Kit");
entity.setCustomNameVisible(true);
entity.getEquipment().setItemInHand(_itemInHand);

View File

@ -24,7 +24,7 @@ public class KitWitherSkeleton extends SmashKit
{
public KitWitherSkeleton(ArcadeManager manager)
{
super(manager, "Wither Skeleton", KitAvailability.Blue,
super(manager, "Wither Skeleton", KitAvailability.Green, 6000,
new String[]
{
@ -83,10 +83,4 @@ public class KitWitherSkeleton extends SmashKit
disguise.hideArmor();
Manager.GetDisguise().disguise(disguise);
}
@Override
public int GetCost()
{
return 6000;
}
}

View File

@ -17,7 +17,7 @@ public class KitInvulnerable extends Kit
{
public KitInvulnerable(ArcadeManager manager)
{
super(manager, "Super Snake", KitAvailability.Blue,
super(manager, "Super Snake", KitAvailability.Green, 5000,
new String[]
{

View File

@ -17,7 +17,7 @@ public class KitOther extends Kit
{
public KitOther(ArcadeManager manager)
{
super(manager, "Other Snake", KitAvailability.Blue,
super(manager, "Other Snake", KitAvailability.Green, 5000,
new String[]
{

View File

@ -1,8 +1,10 @@
package nautilus.game.arcade.game.games.sneakyassassins;
import mineplex.core.common.util.*;
import mineplex.core.disguise.*;
import mineplex.core.updater.*;
import mineplex.core.updater.event.*;
import mineplex.minecraft.game.core.combat.event.*;
import mineplex.minecraft.game.core.damage.*;
import nautilus.game.arcade.*;
import nautilus.game.arcade.events.*;
@ -14,7 +16,10 @@ import nautilus.game.arcade.kit.*;
import org.bukkit.*;
import org.bukkit.entity.*;
import org.bukkit.event.*;
import org.bukkit.event.entity.*;
import org.bukkit.event.hanging.*;
import org.bukkit.event.player.*;
import org.bukkit.potion.*;
import java.util.*;
@ -33,6 +38,8 @@ public class SneakyAssassins extends SoloGame
private final NpcManager _npcManager;
private PowerUpManager _powerUpManager;
private EntityType _disguiseType = EntityType.VILLAGER;
private int _revealCountdown = 60;
public SneakyAssassins(ArcadeManager manager)
{
@ -40,20 +47,29 @@ public class SneakyAssassins extends SoloGame
manager,
GameType.SneakyAssassins,
new Kit[]{
new KitEscapeArtist(manager),
new KitAssassin(manager),
new KitRevealer(manager)
new KitEscapeArtist(manager, EntityType.VILLAGER),
new KitAssassin(manager, EntityType.VILLAGER),
new KitRevealer(manager, EntityType.VILLAGER)
},
new String[]{
"Sneaky Assassins"
new String[]
{
"Each kill grants you +1 Heart",
"Powerups upgrade Armor/Weapon",
"Get 5 Powerups to become a Master!",
"Master has a Compass to find others",
"Last player alive wins!"
}
);
this._npcManager = new NpcManager(this, UtilMath.random);
this.DamageTeamSelf = true;
this.HungerSet = 20;
this.PrepareFreeze = false;
this.HungerSet = 20;
this.CompassEnabled = true;
this.CompassGiveItem = false;
}
@Override
@ -62,6 +78,15 @@ public class SneakyAssassins extends SoloGame
Collections.shuffle(GetTeamList().get(0).GetSpawns());
_powerUpManager = new PowerUpManager(this, UtilMath.random, WorldData.GetDataLocs("RED"));
String disguiseTypeName = WorldData.get("DISGUISE_TYPE");
if (disguiseTypeName != null)
_disguiseType = EntityType.valueOf(disguiseTypeName.toUpperCase());
_npcManager.setDisguiseType(_disguiseType);
for (Kit kit : GetKits())
kit.setEntityType(_disguiseType);
}
public PowerUpManager getPowerUpManager()
@ -74,11 +99,9 @@ public class SneakyAssassins extends SoloGame
{
if (event.GetGame() == this)
{
int count = GetTeamList().get(0).GetSpawns().size() - GetTeamList().get(0).GetSize();
for (int i = 0; i < 80; i++)
for (int i = 0; i < 200; i++)
getNpcManager().spawnNpc();
}
}
}
/*
@ -126,13 +149,165 @@ public class SneakyAssassins extends SoloGame
event.AddMod(GetName(), "Sword Damage", damage - event.GetDamage(), false);
}
@EventHandler
public void onCombatDeath(CombatDeathEvent event)
{
if (event.GetLog().GetKiller() == null)
return;
if (!event.GetLog().GetKiller().IsPlayer())
return;
Player player = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
if (player == null)
return;
player.setMaxHealth(player.getMaxHealth() + 2);
player.getInventory().addItem(SneakyAssassinKit.SMOKE_BOMB.clone());
}
@Override
@EventHandler
public void ScoreboardUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
if (GetTeamList().isEmpty())
return;
Scoreboard.Reset();
Scoreboard.WriteBlank();
GameTeam team = GetTeamList().get(0);
if (team.GetPlayers(false).size() < 13)
{
for (Player player : team.GetPlayers(false))
{
if (team.IsAlive(player))
{
Scoreboard.WriteOrdered("Powerups", C.cGreen + player.getName(), getPowerUpManager().getPowerUpCount(player), true);
}
else
{
Scoreboard.WriteOrdered("Powerups", C.cGray + player.getName(), getPowerUpManager().getPowerUpCount(player), true);
}
}
}
else if (team.GetPlayers(true).size() < 13)
{
for (Player player : team.GetPlayers(true))
{
Scoreboard.WriteOrdered("Powerups", C.cGreen + player.getName(), getPowerUpManager().getPowerUpCount(player), true);
}
}
else
{
Scoreboard.Write(C.cGreen + "Players Alive");
Scoreboard.Write("" + team.GetPlayers(true).size());
Scoreboard.WriteBlank();
Scoreboard.Write(C.cRed + "Players Dead");
Scoreboard.Write("" + (team.GetPlayers(false).size() - team.GetPlayers(true).size()));
}
GetScoreboard().WriteBlank();
GetScoreboard().Write(C.cYellow + "Player Reveal");
GetScoreboard().Write(String.valueOf(Math.max(0, _revealCountdown)) + (_revealCountdown == 1 ? " Second" : " Seconds"));
GetScoreboard().Draw();
}
@EventHandler
public void onRevealCountdown(UpdateEvent event)
{
if (GetState() == GameState.Live && event.getType() == UpdateType.SEC)
{
_revealCountdown--;
if (_revealCountdown <= 3 && _revealCountdown > 0)
{
this.Announce(F.main("Game", C.cYellow + C.Bold + "Players Revealed in " + _revealCountdown + " Seconds"));
}
else if (_revealCountdown == 0)
{
for (Player player : Bukkit.getOnlinePlayers())
{
if (IsAlive(player))
{
Manager.GetDisguise().undisguise(player);
player.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 80, 0));
}
}
this.Announce(F.main("Game", C.cRed + C.Bold + "Players Revealed!"));
}
else if (_revealCountdown == -4)
{
for (Player player : Bukkit.getOnlinePlayers())
{
if (IsAlive(player))
{
Manager.GetDisguise().disguise(DisguiseFactory.createDisguise(player, _disguiseType));
player.removePotionEffect(PotionEffectType.WITHER);
}
}
_revealCountdown = 60;
this.Announce(F.main("Game", C.cGreen + C.Bold + "Players Disguised!"));
}
}
}
@EventHandler(ignoreCancelled = true)
public void onPlayerInteractEntity(PlayerInteractEntityEvent event)
{
if(event.getRightClicked() instanceof Villager)
if (event.getRightClicked() instanceof Villager)
event.setCancelled(true);
}
@EventHandler(ignoreCancelled = true)
public void onEntityCombust(EntityCombustEvent event)
{
event.setCancelled(true);
}
@EventHandler(ignoreCancelled = true)
public void onHangingBreak(HangingBreakEvent event)
{
event.setCancelled(true);
}
@EventHandler(ignoreCancelled = true)
public void onHangingPlace(HangingPlaceEvent event)
{
event.setCancelled(true);
}
@EventHandler(ignoreCancelled = true)
public void onPlayerInteractHanging(PlayerInteractEntityEvent event)
{
if (event.getRightClicked() instanceof Hanging)
event.setCancelled(true);
}
@EventHandler(ignoreCancelled = true)
public void onDamageHanging(EntityDamageEvent event)
{
if (event.getEntity() instanceof Hanging)
event.setCancelled(true);
}
@EventHandler(ignoreCancelled = true)
public void onWitherEffectDamager(CustomDamageEvent event)
{
if (event.GetCause() == EntityDamageEvent.DamageCause.WITHER)
event.SetCancelled("Wither damage disabled");
}
public NpcManager getNpcManager()
{
return _npcManager;

View File

@ -10,7 +10,7 @@ import org.bukkit.inventory.*;
public class KitAssassin extends SneakyAssassinKit
{
public KitAssassin(ArcadeManager manager)
public KitAssassin(ArcadeManager manager, EntityType disguiseType)
{
super(manager, "Ranged Assassin", KitAvailability.Green,
new String[]
@ -19,9 +19,10 @@ public class KitAssassin extends SneakyAssassinKit
},
new Perk[]
{
new PerkSmokebomb(Material.INK_SACK, 5, true)
new PerkSmokebomb(Material.INK_SACK, 4, true)
},
new ItemStack(Material.BOW));
new ItemStack(Material.BOW),
disguiseType);
}
@Override

View File

@ -9,7 +9,7 @@ import org.bukkit.inventory.*;
public class KitEscapeArtist extends SneakyAssassinKit
{
public KitEscapeArtist(ArcadeManager manager)
public KitEscapeArtist(ArcadeManager manager, EntityType disguiseType)
{
super(manager, "Escape Artist", KitAvailability.Free,
new String[]
@ -18,9 +18,10 @@ public class KitEscapeArtist extends SneakyAssassinKit
},
new Perk[]
{
new PerkSmokebomb(Material.INK_SACK, 5, true)
new PerkSmokebomb(Material.INK_SACK, 4, true)
},
new ItemStack(Material.INK_SACK));
new ItemStack(Material.INK_SACK),
disguiseType);
}
@Override

View File

@ -12,19 +12,20 @@ import org.bukkit.inventory.*;
public class KitRevealer extends SneakyAssassinKit
{
public KitRevealer(ArcadeManager manager)
public KitRevealer(ArcadeManager manager, EntityType disguiseType)
{
super(manager, "Revealer", KitAvailability.Blue,
super(manager, "Revealer", KitAvailability.Green, 5000,
new String[]
{
"Carries three Revealers which explode and reveal nearby assassins!"
},
new Perk[]
{
new PerkSmokebomb(Material.INK_SACK, 5, true),
new PerkSmokebomb(Material.INK_SACK, 4, true),
new PerkRevealer()
},
new ItemStack(Material.INK_SACK));
new ItemStack(Material.INK_SACK),
disguiseType);
}
@Override

View File

@ -1,6 +1,7 @@
package nautilus.game.arcade.game.games.sneakyassassins.kits;
import mineplex.core.common.util.*;
import mineplex.core.disguise.*;
import mineplex.core.disguise.disguises.*;
import mineplex.core.itemstack.*;
import nautilus.game.arcade.*;
@ -11,16 +12,31 @@ import org.bukkit.inventory.*;
public abstract class SneakyAssassinKit extends Kit
{
public SneakyAssassinKit(ArcadeManager manager, String name, KitAvailability kitAvailability, String[] kitDesc, Perk[] kitPerks, ItemStack itemInHand)
public static final ItemStack SMOKE_BOMB = ItemStackFactory.Instance.CreateStack(Material.INK_SACK, (byte) 0, 1,
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Smoke Bomb",
new String[]
{
ChatColor.RESET + "Throw a Smoke Bomb.",
ChatColor.RESET + "Everyone within 6 blocks",
ChatColor.RESET + "gets Blindness for 6 seconds.",
});
public SneakyAssassinKit(ArcadeManager manager, String name, KitAvailability kitAvailability, String[] kitDesc, Perk[] kitPerks, ItemStack itemInHand, EntityType disguiseType)
{
super(manager, name, kitAvailability, kitDesc, kitPerks, EntityType.VILLAGER, itemInHand);
super(manager, name, kitAvailability, kitDesc, kitPerks, disguiseType, itemInHand);
}
public SneakyAssassinKit(ArcadeManager manager, String name, KitAvailability kitAvailability, int cost, String[] kitDesc, Perk[] kitPerks, ItemStack itemInHand, EntityType disguiseType)
{
super(manager, name, kitAvailability, cost, kitDesc, kitPerks, disguiseType, itemInHand);
}
@Override
public void GiveItems(Player player)
{
Manager.GetDisguise().disguise(new DisguiseVillager(player));
Manager.GetDisguise().disguise(DisguiseFactory.createDisguise(player, _entityType));
player.getInventory().addItem(new ItemStack(Material.WOOD_SWORD));
player.getInventory().setArmorContents(new ItemStack[]{
new ItemStack(Material.LEATHER_BOOTS),
@ -28,14 +44,6 @@ public abstract class SneakyAssassinKit extends Kit
new ItemStack(Material.LEATHER_CHESTPLATE),
new ItemStack(Material.LEATHER_HELMET)
});
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.INK_SACK, (byte) 0, 1,
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Smoke Bomb",
new String[]
{
ChatColor.RESET + "Throw a Smoke Bomb.",
ChatColor.RESET + "Everyone within 6 blocks",
ChatColor.RESET + "gets Blindness for 6 seconds.",
}));
player.getInventory().addItem(SMOKE_BOMB.clone());
}
}

View File

@ -8,6 +8,7 @@ import nautilus.game.arcade.game.*;
import nautilus.game.arcade.game.games.sneakyassassins.*;
import nautilus.game.arcade.world.*;
import org.bukkit.*;
import org.bukkit.block.*;
import org.bukkit.entity.*;
import org.bukkit.event.*;
import org.bukkit.event.entity.*;
@ -19,6 +20,7 @@ public class NpcManager implements Listener
{
private final SneakyAssassins _sneakyAssassins;
private final Random _random;
private EntityType _disguiseType = EntityType.VILLAGER;
public NpcManager(SneakyAssassins sneakyAssassins, Random random)
{
@ -33,17 +35,17 @@ public class NpcManager implements Listener
return _sneakyAssassins;
}
public Collection<Villager> getNpcs()
public Collection<? extends LivingEntity> getNpcs()
{
return getGame().WorldData.World.getEntitiesByClass(Villager.class);
return (Collection<? extends LivingEntity>) getGame().WorldData.World.getEntitiesByClass(getDisguiseType().getEntityClass());
}
public Villager spawnNpc()
public Entity spawnNpc()
{
Location spawn = getNpcSpawn();
getGame().CreatureAllowOverride = true;
Villager npc = spawn.getWorld().spawn(spawn, Villager.class);
LivingEntity npc = (LivingEntity) spawn.getWorld().spawn(spawn, getDisguiseType().getEntityClass());
npc.setCanPickupItems(false);
npc.setRemoveWhenFarAway(false);
UtilEnt.Vegetate(npc);
@ -68,33 +70,67 @@ public class NpcManager implements Listener
}
@EventHandler
public void onEntityDeath(EntityDeathEvent event)
public void onKillNpc(UpdateEvent event)
{
try
if (event.getType() == UpdateType.SLOW && getGame().GetState() == Game.GameState.Live)
{
if (event.getEntity().getWorld() == getGame().WorldData.World)
List<LivingEntity> npcs = new ArrayList<>(getNpcs());
if (!npcs.isEmpty())
{
event.setDroppedExp(0);
event.getDrops().clear();
LivingEntity npc = UtilAlg.Random(npcs);
UtilParticle.PlayParticle(UtilParticle.ParticleType.LARGE_SMOKE, npc.getLocation(), 0f, 0f, 0f, 0, 1);
npc.remove();
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
@EventHandler
public void onEntityDeath(EntityDeathEvent event)
{
event.setDroppedExp(0);
event.getDrops().clear();
}
public void bustle()
{
for (Villager npc : getNpcs())
for (Entity npc : getNpcs())
{
if (getRandom().nextInt(40) == 0)
{
Location loc = npc.getLocation().add(getRandom().nextDouble() * 32 - 16, 0, getRandom().nextDouble() * 32 - 16);
List<Location> nearby = new ArrayList<>();
if (loc.getWorld().getHighestBlockYAt(loc) > 0)
for (Location location : getGame().GetTeamList().get(0).GetSpawns())
{
UtilEnt.CreatureMove(npc, loc, 0.8f);
if (Math.abs(npc.getLocation().getX() - location.getX()) <= 16 && Math.abs(npc.getLocation().getZ() - location.getZ()) <= 16)
nearby.add(location);
}
if (!nearby.isEmpty())
{
Location location = UtilAlg.Random(nearby);
for (int i = 0; i < 5; i++)
{
int dx = getRandom().nextInt(5) - 2;
int dz = getRandom().nextInt(5) - 2;
Location candidate = location.clone().add(dx, 0, dz);
Block block = candidate.getBlock();
if (!block.getRelative(BlockFace.DOWN).isEmpty() &&
!block.getRelative(BlockFace.DOWN).isLiquid() &&
block.isEmpty() &&
block.getRelative(BlockFace.UP).isEmpty())
{
location = candidate;
break;
}
}
UtilEnt.CreatureMove(npc, location, 0.7f);
}
}
}
@ -109,4 +145,14 @@ public class NpcManager implements Listener
{
return getGame().Manager.GetPlugin();
}
public EntityType getDisguiseType()
{
return _disguiseType;
}
public void setDisguiseType(EntityType disguiseType)
{
_disguiseType = disguiseType;
}
}

View File

@ -32,32 +32,21 @@ public class ArmorPowerUp extends PowerUp
)
);
public ArmorPowerUp(PowerUpManager powerUpManager, Location location)
public ArmorPowerUp()
{
super(powerUpManager, PowerUpType.ARMOR, location);
super(PowerUpType.ARMOR);
}
@Override
public boolean powerUpPlayer(Player player)
public boolean powerUpPlayer(Player player, Random random)
{
boolean powerUp1 = powerUpArmor(player);
boolean powerUp2 = powerUpArmor(player);
boolean powerUp1 = powerUpArmor(player, random);
boolean powerUp2 = powerUpArmor(player, random);
if (powerUp1 || powerUp2)
{
UtilPlayer.message(player, F.main("Power-Up", "Your " + F.item("Armor") + " was upgraded."));
return super.powerUpPlayer(player);
}
else
{
UtilPlayer.message(player, F.main("Power-Up", "Your " + F.item("Armor") + " is already fully upgraded!"));
return false;
}
return powerUp1 || powerUp2;
}
private boolean powerUpArmor(Player player)
public static boolean powerUpArmor(Player player, Random random)
{
ItemStack[] armor = player.getInventory().getArmorContents();
@ -73,7 +62,7 @@ public class ArmorPowerUp extends PowerUp
if (!upgradeable.isEmpty())
{
int choice = upgradeable.get(getPowerUpManager().getRandom().nextInt(upgradeable.size()));
int choice = upgradeable.get(random.nextInt(upgradeable.size()));
int nextLevel = Math.min(ARMOR_PROGRESSION.get(choice).size() - 1, level + 1);
armor[choice] = new ItemStack(ARMOR_PROGRESSION.get(choice).get(nextLevel));

View File

@ -0,0 +1,26 @@
package nautilus.game.arcade.game.games.sneakyassassins.powerups;
import org.bukkit.*;
import org.bukkit.entity.*;
import org.bukkit.inventory.*;
import java.util.*;
public class CompassPowerUp extends PowerUp
{
protected CompassPowerUp()
{
super(PowerUpType.COMPASS);
}
@Override
public boolean powerUpPlayer(Player player, Random random)
{
if (player.getInventory().contains(Material.COMPASS))
return false;
player.getInventory().addItem(new ItemStack(Material.COMPASS));
return true;
}
}

View File

@ -1,111 +1,18 @@
package nautilus.game.arcade.game.games.sneakyassassins.powerups;
import mineplex.core.common.util.*;
import mineplex.core.updater.*;
import mineplex.core.updater.event.*;
import java.util.Random;
import nautilus.game.arcade.game.games.sneakyassassins.kits.*;
import org.bukkit.*;
import org.bukkit.block.*;
import org.bukkit.entity.*;
import org.bukkit.inventory.*;
import org.bukkit.material.*;
import org.bukkit.util.*;
public abstract class PowerUp
{
private final PowerUpManager _powerUpManager;
private final PowerUpType _powerUpType;
private final Location _location;
private Location _effectLocation;
private Block _beaconBlock;
private BlockState[][][] _originalBeaconBlocks = new BlockState[3][2][3];
private Item _item;
public PowerUp(PowerUpManager powerUpManager, PowerUpType powerUpType, Location location)
protected PowerUp(PowerUpType powerUpType)
{
_powerUpManager = powerUpManager;
_powerUpType = powerUpType;
_location = location;
_effectLocation = getLocation().getBlock().getLocation().add(0.5, 0, 0.5);
_effectLocation.setY(250);
}
public PowerUpManager getPowerUpManager()
{
return _powerUpManager;
}
public Location getLocation()
{
return _location;
}
@SuppressWarnings("deprecation")
public void activate()
{
_beaconBlock = getLocation().getBlock().getRelative(BlockFace.DOWN);
for (int x = 0; x < 3; x++)
{
for (int y = 0; y < 2; y++)
{
for (int z = 0; z < 3; z++)
{
Block beaconBaseBlock = _beaconBlock.getRelative(x - 1, y - 1, z - 1);
_originalBeaconBlocks[x][y][z] = beaconBaseBlock.getState();
if (y == 0)
beaconBaseBlock.setType(Material.IRON_BLOCK);
else if (x == 1 && z == 1)
beaconBaseBlock.setType(Material.BEACON);
else
beaconBaseBlock.setTypeIdAndData(Material.STAINED_GLASS.getId(), getPowerUpType().getDyeColor().getWoolData(), false);
}
}
}
}
public void onUpdate(UpdateEvent event)
{
if (event.getType() == UpdateType.FASTEST && _effectLocation != null)
{
FireworkEffect effect = FireworkEffect
.builder()
.flicker(false)
.withColor(getPowerUpType().getColor())
.with(FireworkEffect.Type.BURST)
.trail(false)
.build();
UtilFirework.playFirework(_effectLocation, effect);
_effectLocation.setY(_effectLocation.getY() - 2);
if (_effectLocation.getY() - getLocation().getY() < 2)
{
_effectLocation = null;
Location itemLocation = _beaconBlock.getLocation().add(0.5, 1.5, 0.5);
effect = FireworkEffect
.builder()
.flicker(false)
.withColor(getPowerUpType().getColor())
.with(FireworkEffect.Type.BALL_LARGE)
.trail(true)
.build();
UtilFirework.playFirework(itemLocation, effect);
_item = itemLocation.getWorld().dropItem(itemLocation, new ItemStack(getPowerUpType().getItemType()));
_item.setVelocity(new Vector(0, 0.15, 0));
}
}
}
public Item getItem()
{
return _item;
}
public PowerUpType getPowerUpType()
@ -113,26 +20,5 @@ public abstract class PowerUp
return _powerUpType;
}
public void remove()
{
if (getItem() != null)
{
getItem().remove();
_item = null;
}
for (int x = 0; x < _originalBeaconBlocks.length; x++)
for (int y = 0; y < _originalBeaconBlocks[x].length; y++)
for (int z = 0; z < _originalBeaconBlocks[x][y].length; z++)
_originalBeaconBlocks[x][y][z].update(true, false);
getPowerUpManager().removePowerUp(this);
}
public boolean powerUpPlayer(Player player)
{
player.playSound(player.getEyeLocation(), Sound.LEVEL_UP, 2f, 0.8f);
return true;
}
public abstract boolean powerUpPlayer(Player player, Random random);
}

View File

@ -0,0 +1,126 @@
package nautilus.game.arcade.game.games.sneakyassassins.powerups;
import mineplex.core.common.util.*;
import mineplex.core.updater.*;
import mineplex.core.updater.event.*;
import org.bukkit.*;
import org.bukkit.block.*;
import org.bukkit.entity.*;
import org.bukkit.inventory.*;
import org.bukkit.util.*;
/**
* Created by Tim on 8/5/2014.
*/
public class PowerUpItem
{
private final PowerUpManager _powerUpManager;
private final Location _location;
private Location _effectLocation;
private Block _beaconBlock;
private BlockState[][][] _originalBeaconBlocks = new BlockState[3][2][3];
private Item _item;
public PowerUpItem(PowerUpManager powerUpManager, Location location)
{
_powerUpManager = powerUpManager;
_location = location;
_effectLocation = getLocation().getBlock().getLocation().add(0.5, 0, 0.5);
_effectLocation.setY(250);
}
public PowerUpManager getPowerUpManager()
{
return _powerUpManager;
}
public Location getLocation()
{
return _location;
}
@SuppressWarnings("deprecation")
public void activate()
{
_beaconBlock = getLocation().getBlock().getRelative(BlockFace.DOWN);
for (int x = 0; x < 3; x++)
{
for (int y = 0; y < 2; y++)
{
for (int z = 0; z < 3; z++)
{
Block beaconBaseBlock = _beaconBlock.getRelative(x - 1, y - 1, z - 1);
_originalBeaconBlocks[x][y][z] = beaconBaseBlock.getState();
if (y == 0)
beaconBaseBlock.setType(Material.IRON_BLOCK);
else if (x == 1 && z == 1)
beaconBaseBlock.setType(Material.BEACON);
else
beaconBaseBlock.setTypeIdAndData(Material.STAINED_GLASS.getId(), DyeColor.YELLOW.getWoolData(), false);
}
}
}
}
public void onUpdate(UpdateEvent event)
{
if (event.getType() == UpdateType.FASTEST && _effectLocation != null)
{
FireworkEffect effect = FireworkEffect
.builder()
.flicker(false)
.withColor(Color.YELLOW)
.with(FireworkEffect.Type.BURST)
.trail(false)
.build();
UtilFirework.playFirework(_effectLocation, effect);
_effectLocation.setY(_effectLocation.getY() - 2);
if (_effectLocation.getY() - getLocation().getY() < 2)
{
_effectLocation = null;
Location itemLocation = _beaconBlock.getLocation().add(0.5, 1.5, 0.5);
effect = FireworkEffect
.builder()
.flicker(false)
.withColor(Color.YELLOW)
.with(FireworkEffect.Type.BALL_LARGE)
.trail(true)
.build();
UtilFirework.playFirework(itemLocation, effect);
_item = itemLocation.getWorld().dropItem(itemLocation, new ItemStack(Material.CHEST));
_item.setVelocity(new Vector(0, 0.15, 0));
}
}
}
public Item getItem()
{
return _item;
}
public void remove()
{
if (getItem() != null)
{
getItem().remove();
_item = null;
}
for (int x = 0; x < _originalBeaconBlocks.length; x++)
for (int y = 0; y < _originalBeaconBlocks[x].length; y++)
for (int z = 0; z < _originalBeaconBlocks[x][y].length; z++)
_originalBeaconBlocks[x][y][z].update(true, false);
getPowerUpManager().removePowerUp(this);
}
}

View File

@ -1,5 +1,6 @@
package nautilus.game.arcade.game.games.sneakyassassins.powerups;
import mineplex.core.common.util.*;
import mineplex.core.updater.*;
import mineplex.core.updater.event.*;
import nautilus.game.arcade.events.*;
@ -19,10 +20,10 @@ public class PowerUpManager implements Listener
private final Game _game;
private final Random _random;
private final List<Location> _spawnLocations;
private final List<PowerUp> _powerUps = new ArrayList<>();
private final List<PowerUpItem> _powerUps = new ArrayList<>();
private Location _lastLocation = null;
private int _nextSpawnCountdown = -1;
private final Map<UUID, PowerUp> _powerUpPickUpCooldown = new HashMap<>();
private final Map<UUID, Integer> _powerUpCount = new HashMap<>();
public PowerUpManager(Game game, Random random, List<Location> spawnLocations)
{
@ -70,18 +71,20 @@ public class PowerUpManager implements Listener
public void spawnNextPowerUp()
{
PowerUp powerUp = PowerUpType.values()[getRandom().nextInt(PowerUpType.values().length)].spawn(this, nextLocation());
PowerUpItem powerUp = new PowerUpItem(this, nextLocation());
getPowerUps().add(powerUp);
powerUp.activate();
getGame().Announce(F.main("Game", C.cYellow + C.Bold + "Powerup Spawning..."));
}
public List<PowerUp> getPowerUps()
public List<PowerUpItem> getPowerUps()
{
return _powerUps;
}
boolean removePowerUp(PowerUp powerUp)
boolean removePowerUp(PowerUpItem powerUp)
{
return _powerUps.remove(powerUp);
}
@ -125,7 +128,7 @@ public class PowerUpManager implements Listener
_nextSpawnCountdown--;
}
for (PowerUp powerUp : getPowerUps())
for (PowerUpItem powerUp : getPowerUps())
powerUp.onUpdate(event);
}
@ -147,49 +150,103 @@ public class PowerUpManager implements Listener
}
@EventHandler
public void onPlayerPickUpPowerUp(final PlayerPickupItemEvent event)
public void onPlayerPickUpPowerUp(PlayerPickupItemEvent event)
{
if (getGame().GetTeam(event.getPlayer()) != null)
if (!getGame().IsAlive(event.getPlayer()))
return;
PowerUpItem powerUp = getPowerUpByItem(event.getItem());
if (powerUp == null)
return;
event.setCancelled(true);
int count = getPowerUpCount(event.getPlayer());
if (count <= 4)
{
final PowerUp powerUp = getPowerUpByItem(event.getItem());
powerUp.remove();
if (powerUp != null)
if (PowerUpType.SMOKE_BOMB.powerUpPlayer(event.getPlayer(), getRandom()))
UtilPlayer.message(event.getPlayer(), F.main("Power-Up", "+1 " + F.item("Smoke Bomb")));
if (count == 4)
{
event.setCancelled(true);
PowerUpType.COMPASS.powerUpPlayer(event.getPlayer(), getRandom());
if (_powerUpPickUpCooldown.get(event.getPlayer().getUniqueId()) != powerUp)
UtilPlayer.message(event.getPlayer(), F.main("Game", "You now have a " + F.item("Compass") + " for tracking players"));
getGame().Announce(F.main("Game", F.name(C.Bold + event.getPlayer().getName()) + " has become a " + F.skill(C.Bold + "Master Assassin")));
for (Player player : UtilServer.getPlayers())
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 1f, 1f);
}
else
{
PowerUpType.WEAPON.powerUpPlayer(event.getPlayer(), getRandom());
PowerUpType.ARMOR.powerUpPlayer(event.getPlayer(), getRandom());
UtilPlayer.message(event.getPlayer(), F.main("Game", "Your " + F.item("Sword") + " and " + F.item("Armor") + " have been upgraded!"));
getGame().Announce(F.main("Game", F.name(event.getPlayer().getName()) + " collected a " + F.skill("Powerup") + "."));
}
incrementPowerUpCount(event.getPlayer());
}
schedulePowerUpSpawn(10);
}
@EventHandler
public void onUpdateCompass(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC)
return;
if (getGame().GetState() != GameState.Live)
return;
Player[] players = Bukkit.getOnlinePlayers();
for (Player player : players)
{
if (!getGame().IsPlaying(player))
continue;
if (player.getInventory().contains(Material.COMPASS))
continue;
Player closest = null;
double minDistanceSquared = Double.NaN;
for (Player other : players)
{
if (other == player)
continue;
if (!getGame().IsPlaying(other))
continue;
double distanceSquared = player.getLocation().distanceSquared(other.getLocation());
if (closest == null || distanceSquared < minDistanceSquared)
{
if (powerUp.powerUpPlayer(event.getPlayer()))
{
powerUp.remove();
schedulePowerUpSpawn(10);
}
else
{
_powerUpPickUpCooldown.put(event.getPlayer().getUniqueId(), powerUp);
Bukkit.getScheduler().runTaskLater(getPlugin(), new Runnable()
{
@Override
public void run()
{
if (_powerUpPickUpCooldown.get(event.getPlayer().getUniqueId()) == powerUp)
_powerUpPickUpCooldown.remove(event.getPlayer().getUniqueId());
}
}, 40);
}
closest = other;
minDistanceSquared = distanceSquared;
}
}
if (closest != null)
player.setCompassTarget(closest.getLocation());
}
}
public PowerUp getPowerUpByItem(Item item)
public PowerUpItem getPowerUpByItem(Item item)
{
if (item == null)
return null;
for (PowerUp powerUp : getPowerUps())
for (PowerUpItem powerUp : getPowerUps())
{
if (powerUp.getItem() != null && powerUp.getItem().equals(item))
return powerUp;
@ -197,4 +254,20 @@ public class PowerUpManager implements Listener
return null;
}
public int getPowerUpCount(Player player)
{
Integer count = _powerUpCount.get(player.getUniqueId());
return count == null ? 0 : count;
}
public int incrementPowerUpCount(Player player)
{
int count = getPowerUpCount(player) + 1;
_powerUpCount.put(player.getUniqueId(), count);
return count;
}
}

View File

@ -1,48 +1,26 @@
package nautilus.game.arcade.game.games.sneakyassassins.powerups;
import org.bukkit.*;
import org.bukkit.entity.*;
import java.util.*;
public enum PowerUpType
{
WEAPON(Material.DIAMOND_SWORD, DyeColor.RED),
ARMOR(Material.IRON_CHESTPLATE, DyeColor.BLUE);
WEAPON(new WeaponPowerUp()),
ARMOR(new ArmorPowerUp()),
SMOKE_BOMB(new SmokeBombPowerUp()),
COMPASS(new CompassPowerUp());
private final Material _itemType;
private final DyeColor _color;
private final PowerUp _powerUp;
PowerUpType(Material type, DyeColor color)
PowerUpType(PowerUp powerUp)
{
_itemType = type;
_color = color;
_powerUp = powerUp;
}
public Material getItemType()
public boolean powerUpPlayer(Player player, Random random)
{
return _itemType;
}
public Color getColor()
{
return getDyeColor().getColor();
}
public DyeColor getDyeColor()
{
return _color;
}
public PowerUp spawn(PowerUpManager powerUpManager, Location location)
{
switch (this)
{
case WEAPON:
return new WeaponPowerUp(powerUpManager, location);
case ARMOR:
return new ArmorPowerUp(powerUpManager, location);
default:
return null;
}
return _powerUp.powerUpPlayer(player, random);
}
}

View File

@ -0,0 +1,20 @@
package nautilus.game.arcade.game.games.sneakyassassins.powerups;
import nautilus.game.arcade.game.games.sneakyassassins.kits.*;
import org.bukkit.entity.*;
import java.util.*;
public class SmokeBombPowerUp extends PowerUp
{
protected SmokeBombPowerUp()
{
super(PowerUpType.SMOKE_BOMB);
}
@Override
public boolean powerUpPlayer(Player player, Random random)
{
return player.getInventory().addItem(SneakyAssassinKit.SMOKE_BOMB.clone()).isEmpty();
}
}

View File

@ -1,6 +1,5 @@
package nautilus.game.arcade.game.games.sneakyassassins.powerups;
import mineplex.core.common.util.*;
import org.bukkit.*;
import org.bukkit.entity.*;
import org.bukkit.inventory.*;
@ -12,18 +11,18 @@ public class WeaponPowerUp extends PowerUp
private static final List<Material> SWORD_PROGRESSION = Arrays.asList(
Material.WOOD_SWORD,
Material.STONE_SWORD,
Material.IRON_SWORD,
Material.GOLD_SWORD,
Material.IRON_SWORD,
Material.DIAMOND_SWORD
);
public WeaponPowerUp(PowerUpManager powerUpManager, Location location)
public WeaponPowerUp()
{
super(powerUpManager, PowerUpType.WEAPON, location);
super(PowerUpType.WEAPON);
}
@Override
public boolean powerUpPlayer(Player player)
public boolean powerUpPlayer(Player player, Random random)
{
for (int swordType = 0; swordType < SWORD_PROGRESSION.size(); swordType++)
{
@ -37,15 +36,11 @@ public class WeaponPowerUp extends PowerUp
{
player.getInventory().setItem(swordSlot, new ItemStack(SWORD_PROGRESSION.get(newSwordType)));
UtilPlayer.message(player, F.main("Power-Up", "Your " + F.item("Sword") + " was upgraded."));
return super.powerUpPlayer(player);
return true;
}
}
}
UtilPlayer.message(player, F.main("Power-Up", "Your " + F.item("Sword") + " is already fully upgraded!"));
return false;
}
}

View File

@ -16,7 +16,7 @@ public class KitArcher extends Kit
{
public KitArcher(ArcadeManager manager)
{
super(manager, "Archer", KitAvailability.Blue,
super(manager, "Archer", KitAvailability.Green, 5000,
new String[]
{

View File

@ -20,7 +20,7 @@ public class KitSniper extends Kit
{
public KitSniper(ArcadeManager manager)
{
super(manager, "Squid Sniper", KitAvailability.Blue,
super(manager, "Squid Sniper", KitAvailability.Green, 5000,
new String[]
{

View File

@ -15,7 +15,7 @@ public class KitAssassin extends Kit
{
public KitAssassin(ArcadeManager manager)
{
super(manager, "Assassin", KitAvailability.Blue,
super(manager, "Assassin", KitAvailability.Green, 5000,
new String[]
{

View File

@ -15,7 +15,7 @@ public class KitBeastmaster extends Kit
{
public KitBeastmaster(ArcadeManager manager)
{
super(manager, "Beastmaster", KitAvailability.Blue,
super(manager, "Beastmaster", KitAvailability.Green, 5000,
new String[]
{

View File

@ -15,7 +15,7 @@ public class KitBomber extends Kit
{
public KitBomber(ArcadeManager manager)
{
super(manager, "Bomber", KitAvailability.Blue,
super(manager, "Bomber", KitAvailability.Green, 5000,
new String[]
{

View File

@ -15,7 +15,7 @@ public class KitNecromancer extends Kit
{
public KitNecromancer(ArcadeManager manager)
{
super(manager, "Necromancer", KitAvailability.Blue,
super(manager, "Necromancer", KitAvailability.Green, 5000,
new String[]
{

View File

@ -20,7 +20,7 @@ public class KitShredder extends Kit
{
public KitShredder(ArcadeManager manager)
{
super(manager, "Shredder", KitAvailability.Blue,
super(manager, "Shredder", KitAvailability.Green, 5000,
new String[]
{
"Arrows are weaker, but shred through forts."

Some files were not shown because too many files have changed in this diff Show More