Added new kits, Changed Compass feature, Fixed a lot of bugs
This commit is contained in:
parent
d46ac59e10
commit
b986cf968e
@ -1,40 +1,28 @@
|
|||||||
package nautilus.game.arcade.game.games.wither;
|
package nautilus.game.arcade.game.games.wither;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.EntityEffect;
|
|
||||||
import org.bukkit.GameMode;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
|
||||||
import org.bukkit.entity.LivingEntity;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.entity.ThrownPotion;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.EventPriority;
|
|
||||||
import org.bukkit.event.entity.EntityCombustEvent;
|
|
||||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
|
||||||
import org.bukkit.potion.PotionEffectType;
|
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilAction;
|
import mineplex.core.common.util.UtilAction;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
import mineplex.core.common.util.UtilBlock;
|
import mineplex.core.common.util.UtilBlock;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
import mineplex.core.common.util.UtilMath;
|
import mineplex.core.common.util.UtilMath;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.common.util.UtilTextMiddle;
|
import mineplex.core.common.util.UtilTextMiddle;
|
||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
import mineplex.core.data.BlockData;
|
import mineplex.core.data.BlockData;
|
||||||
|
import mineplex.core.itemstack.ItemBuilder;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
||||||
@ -43,13 +31,48 @@ import nautilus.game.arcade.ArcadeManager;
|
|||||||
import nautilus.game.arcade.GameType;
|
import nautilus.game.arcade.GameType;
|
||||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||||
import nautilus.game.arcade.game.GameTeam;
|
import nautilus.game.arcade.game.GameTeam;
|
||||||
import nautilus.game.arcade.game.TeamGame;
|
|
||||||
import nautilus.game.arcade.game.GameTeam.PlayerState;
|
import nautilus.game.arcade.game.GameTeam.PlayerState;
|
||||||
|
import nautilus.game.arcade.game.TeamGame;
|
||||||
import nautilus.game.arcade.game.games.paintball.PlayerCopy;
|
import nautilus.game.arcade.game.games.paintball.PlayerCopy;
|
||||||
import nautilus.game.arcade.game.games.wither.kit.*;
|
import nautilus.game.arcade.game.games.wither.events.HumanReviveEvent;
|
||||||
|
import nautilus.game.arcade.game.games.wither.kit.KitHumanArcher;
|
||||||
|
import nautilus.game.arcade.game.games.wither.kit.KitHumanMedic;
|
||||||
|
import nautilus.game.arcade.game.games.wither.kit.KitHumanEditor;
|
||||||
|
import nautilus.game.arcade.game.games.wither.kit.KitWitherMinion;
|
||||||
import nautilus.game.arcade.kit.Kit;
|
import nautilus.game.arcade.kit.Kit;
|
||||||
import nautilus.game.arcade.kit.NullKit;
|
import nautilus.game.arcade.kit.NullKit;
|
||||||
import nautilus.game.arcade.kit.perks.data.IBlockRestorer;
|
import nautilus.game.arcade.kit.perks.data.IBlockRestorer;
|
||||||
|
import nautilus.game.arcade.stats.WitherAssaultReviveTracker;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.EntityEffect;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Projectile;
|
||||||
|
import org.bukkit.entity.ThrownPotion;
|
||||||
|
import org.bukkit.entity.Wither;
|
||||||
|
import org.bukkit.entity.WitherSkull;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
|
import org.bukkit.event.entity.EntityCombustEvent;
|
||||||
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
|
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class WitherGame extends TeamGame implements IBlockRestorer
|
public class WitherGame extends TeamGame implements IBlockRestorer
|
||||||
{
|
{
|
||||||
@ -59,6 +82,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
private double _witherFactor = 2.5;
|
private double _witherFactor = 2.5;
|
||||||
|
|
||||||
private int _yLimit = 0;
|
private int _yLimit = 0;
|
||||||
|
private int _maxY;
|
||||||
|
|
||||||
private long _gameTime = 300000;
|
private long _gameTime = 300000;
|
||||||
|
|
||||||
@ -68,6 +92,8 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
// private HashMap<Player, Integer> _lives = new HashMap<Player, Integer>();
|
// private HashMap<Player, Integer> _lives = new HashMap<Player, Integer>();
|
||||||
|
|
||||||
private HashSet<BlockData> _blocks = new HashSet<BlockData>();
|
private HashSet<BlockData> _blocks = new HashSet<BlockData>();
|
||||||
|
|
||||||
|
private ArrayList<Location> _locationsOfBlocks = new ArrayList<Location>();
|
||||||
|
|
||||||
public WitherGame(ArcadeManager manager)
|
public WitherGame(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
@ -75,24 +101,22 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
|
|
||||||
new Kit[]
|
new Kit[]
|
||||||
{
|
{
|
||||||
new KitHumanArcher(manager), new NullKit(manager),
|
new KitHumanArcher(manager),
|
||||||
new NullKit(manager), new NullKit(manager),
|
new KitHumanMedic(manager),
|
||||||
|
new KitHumanEditor(manager),
|
||||||
|
new NullKit(manager),
|
||||||
new KitWitherMinion(manager),
|
new KitWitherMinion(manager),
|
||||||
},
|
},
|
||||||
|
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
|
|
||||||
C.cGreen + "Humans" + C.cWhite
|
C.cGreen + "Humans" + C.cWhite + " Run and hide from the Withers",
|
||||||
+ " Run and hide from the Withers",
|
|
||||||
C.cGreen + "Humans" + C.cWhite + " Revive your dead allies!",
|
C.cGreen + "Humans" + C.cWhite + " Revive your dead allies!",
|
||||||
C.cGreen + "Humans" + C.cWhite
|
C.cGreen + "Humans" + C.cWhite + " Win by surviving for 5 minutes",
|
||||||
+ " Win by surviving for 5 minutes",
|
|
||||||
" ",
|
" ",
|
||||||
C.cRed + "Withers" + C.cWhite
|
C.cRed + "Withers" + C.cWhite + " Moves very slowly when near ground",
|
||||||
+ " Moves very slowly when near ground",
|
C.cRed + "Withers" + C.cWhite + " Kill all the Humans within 5 Minutes",
|
||||||
C.cRed + "Withers" + C.cWhite
|
|
||||||
+ " Kill all the Humans within 5 Minutes",
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.DeathOut = true;
|
this.DeathOut = true;
|
||||||
@ -101,9 +125,12 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
this.DeathSpectateSecs = 4;
|
this.DeathSpectateSecs = 4;
|
||||||
this.HungerSet = 20;
|
this.HungerSet = 20;
|
||||||
this.WorldBoundaryKill = false;
|
this.WorldBoundaryKill = false;
|
||||||
|
this.CompassEnabled = false;
|
||||||
this.CompassEnabled = true;
|
|
||||||
this.CompassGiveItem = false;
|
//Customizing for the Editor kit
|
||||||
|
this.BlockBreak = true;
|
||||||
|
this.BlockPlace = true;
|
||||||
|
this.ItemPickup = true;
|
||||||
|
|
||||||
this.KitRegisterState = GameState.Prepare;
|
this.KitRegisterState = GameState.Prepare;
|
||||||
|
|
||||||
@ -112,9 +139,13 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
|
|
||||||
_help = new String[]
|
_help = new String[]
|
||||||
{
|
{
|
||||||
C.cRed + C.Bold + "This game is still under development!",
|
"This game will soon not be under development anymore ;)",
|
||||||
|
"Blocks placed by an Editor can be passed by other humans by " + C.cDGreen + "Right-clicking the block",
|
||||||
|
"Withers are too powerful to be killed. Hiding is the only option!",
|
||||||
|
"Medics are a valuable asset. Stick with them and keep them safe!",
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -177,6 +208,151 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
setWither(player, true);
|
setWither(player, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @EventHandler
|
||||||
|
// public void assignCompassOnStart(GameStateChangeEvent event)
|
||||||
|
// {
|
||||||
|
// if (event.GetState() != GameState.Live)
|
||||||
|
// return;
|
||||||
|
//
|
||||||
|
// for (Player players : _withers.GetPlayers(true))
|
||||||
|
// {
|
||||||
|
// ItemStack compass = new ItemBuilder(Material.COMPASS, 1).build();
|
||||||
|
//
|
||||||
|
// ItemMeta im = compass.getItemMeta();
|
||||||
|
// im.setLore(new ArrayList<String>(Arrays.asList(
|
||||||
|
// F.item("A compass that trigger"),
|
||||||
|
// F.item("your ability to track humans!"))));
|
||||||
|
// im.setDisplayName(F.name("Scent Trigger"));
|
||||||
|
//
|
||||||
|
// compass.setItemMeta(im);
|
||||||
|
//
|
||||||
|
// players.getInventory().setItem(7, compass);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Cancel wither shooting in waiting lobby
|
||||||
|
@EventHandler
|
||||||
|
public void onWitherSkullFire(ProjectileLaunchEvent event)
|
||||||
|
{
|
||||||
|
if (GetState() == GameState.Recruit || GetState() == GameState.Prepare)
|
||||||
|
{
|
||||||
|
Projectile proj = event.getEntity();
|
||||||
|
WitherSkull ws = (WitherSkull) proj;
|
||||||
|
|
||||||
|
if (ws.getShooter() instanceof Wither)
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void handleCustomBlockPlace(BlockPlaceEvent event)
|
||||||
|
{
|
||||||
|
if(!IsLive())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!GetKit(event.getPlayer()).GetName().contentEquals("Human Editor"))
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_maxY = GetTeamList().get(1).GetSpawn().getBlockY() - 5;
|
||||||
|
if(event.getBlock().getLocation().getBlockY() < _maxY)
|
||||||
|
{
|
||||||
|
event.getPlayer().sendMessage(F.main("BlockChecker", "You may not build under this height!"));
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_locationsOfBlocks.add(event.getBlock().getLocation());
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void handleCustomBlockbreak(BlockBreakEvent event)
|
||||||
|
{
|
||||||
|
if(!IsLive())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!GetKit(event.getPlayer()).GetName().contentEquals("Human Editor"))
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Location blockLocation = event.getBlock().getLocation();
|
||||||
|
_maxY = GetTeamList().get(1).GetSpawn().getBlockY() - 4;
|
||||||
|
if(blockLocation.add(0,1,0).getBlock().getType() == Material.AIR)
|
||||||
|
{
|
||||||
|
for(Player humans: _runners.GetPlayers(true))
|
||||||
|
{
|
||||||
|
if(IsAlive(humans))
|
||||||
|
{
|
||||||
|
if(humans.getLocation().add(0,-1,0).getBlock().equals(event.getBlock()))
|
||||||
|
{
|
||||||
|
if(humans.getName() != event.getPlayer().getName())
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(blockLocation.getBlockY() < _maxY)
|
||||||
|
{
|
||||||
|
event.getPlayer().sendMessage(F.main("BlockChecker", "You may not build under this height!"));
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void handleCustomItemPickup(PlayerPickupItemEvent event)
|
||||||
|
{
|
||||||
|
if(!IsLive())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!GetKit(event.getPlayer()).GetName().contentEquals("Human Editor"))
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//On Player interact with a placed block by Editor
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerInteract(PlayerInteractEvent event)
|
||||||
|
{
|
||||||
|
if(!IsLive())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!IsAlive(event.getPlayer()))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(event.getAction() == Action.RIGHT_CLICK_BLOCK)
|
||||||
|
{
|
||||||
|
Block clickedBlock = event.getClickedBlock();
|
||||||
|
|
||||||
|
if(_locationsOfBlocks.contains(clickedBlock.getLocation()))
|
||||||
|
{
|
||||||
|
if(!(event.getPlayer().getInventory().getItem(event.getPlayer().getInventory().getHeldItemSlot()) instanceof Block))
|
||||||
|
{
|
||||||
|
UtilParticle.PlayParticle(ParticleType.FLAME, event.getClickedBlock().getLocation().add(0.5, 0.5, 0.5), 0, 0, 0, 0, 1, ViewDist.LONG, UtilServer.getPlayers());
|
||||||
|
event.getClickedBlock().getWorld().playSound(event.getClickedBlock().getLocation(), Sound.NOTE_STICKS, 2f, 1f);
|
||||||
|
Manager.GetBlockRestore().Add(event.getClickedBlock(), 0, event.getClickedBlock().getData(), 2000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setWither(Player player, boolean forced)
|
public void setWither(Player player, boolean forced)
|
||||||
{
|
{
|
||||||
// _lives.remove(player);
|
// _lives.remove(player);
|
||||||
@ -184,7 +360,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
SetPlayerTeam(player, _withers, true);
|
SetPlayerTeam(player, _withers, true);
|
||||||
|
|
||||||
// Kit
|
// Kit
|
||||||
Kit newKit = GetKits()[4];
|
Kit newKit = GetKits()[GetKits().length-1];
|
||||||
|
|
||||||
SetKit(player, newKit, false);
|
SetKit(player, newKit, false);
|
||||||
newKit.ApplyKit(player);
|
newKit.ApplyKit(player);
|
||||||
@ -244,6 +420,24 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void removeUselessPlayerCopies(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if(event.getType() != UpdateType.TWOSEC)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for(Player players: _doubles.keySet())
|
||||||
|
{
|
||||||
|
if(!players.isOnline())
|
||||||
|
{
|
||||||
|
PlayerCopy pc = _doubles.get(players);
|
||||||
|
pc.GetEntity().remove();
|
||||||
|
_doubles.remove(players);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// @EventHandler
|
// @EventHandler
|
||||||
// public void playerLivesDisplay(PlayerKitGiveEvent event)
|
// public void playerLivesDisplay(PlayerKitGiveEvent event)
|
||||||
@ -272,9 +466,10 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Players Quit
|
// Players Quit
|
||||||
if (GetPlayers(true).size() < 2)
|
if (GetPlayers(true).size() < 1)
|
||||||
{
|
{
|
||||||
SetState(GameState.End);
|
SetState(GameState.End);
|
||||||
|
_locationsOfBlocks.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
GameTeam winner = null;
|
GameTeam winner = null;
|
||||||
@ -307,6 +502,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
|
|
||||||
// End
|
// End
|
||||||
SetState(GameState.End);
|
SetState(GameState.End);
|
||||||
|
_locationsOfBlocks.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -390,6 +586,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
for (Player player : _withers.GetPlayers(true))
|
for (Player player : _withers.GetPlayers(true))
|
||||||
{
|
{
|
||||||
ArrayList<Location> collisions = new ArrayList<Location>();
|
ArrayList<Location> collisions = new ArrayList<Location>();
|
||||||
|
_maxY = GetTeamList().get(1).GetSpawn().getBlockY();
|
||||||
|
|
||||||
// Fly Speed
|
// Fly Speed
|
||||||
double speed = 0.09 - (_yLimit - player.getLocation().getY()) * 0.006;
|
double speed = 0.09 - (_yLimit - player.getLocation().getY()) * 0.006;
|
||||||
@ -569,7 +766,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
|
|
||||||
_doubles.put(player, new PlayerCopy(this, player, ChatColor.YELLOW));
|
_doubles.put(player, new PlayerCopy(this, player, ChatColor.YELLOW));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void playerIn(final Player player, final LivingEntity copy)
|
public void playerIn(final Player player, final LivingEntity copy)
|
||||||
{
|
{
|
||||||
// State
|
// State
|
||||||
@ -662,6 +859,8 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
copyIterator.remove();
|
copyIterator.remove();
|
||||||
|
|
||||||
AddGems(thrower, 3, "Revived Ally", true, true);
|
AddGems(thrower, 3, "Revived Ally", true, true);
|
||||||
|
|
||||||
|
Bukkit.getPluginManager().callEvent(new HumanReviveEvent(thrower, copy.GetPlayer()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Revive
|
// Revive
|
||||||
|
@ -24,22 +24,20 @@ public class KitHumanArcher extends Kit
|
|||||||
{
|
{
|
||||||
public KitHumanArcher(ArcadeManager manager)
|
public KitHumanArcher(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Human Archer", KitAvailability.Free,
|
super(manager, "Human Archer", KitAvailability.Free,
|
||||||
|
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
""
|
""
|
||||||
},
|
},
|
||||||
|
|
||||||
new Perk[]
|
new Perk[]
|
||||||
{
|
{
|
||||||
new PerkDoubleJump("Double Jump", 1.2, 1, true, 4000, true),
|
new PerkDoubleJump("Double Jump", 1.2, 1, true, 4000, true),
|
||||||
new PerkWitherArrowBlind(6),
|
new PerkWitherArrowBlind(6),
|
||||||
new PerkFletcher(4, 4, true),
|
new PerkFletcher(4, 4, true),
|
||||||
|
|
||||||
},
|
}, EntityType.ZOMBIE, null);
|
||||||
EntityType.ZOMBIE,
|
|
||||||
null);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,20 +46,20 @@ public class KitHumanArcher extends Kit
|
|||||||
{
|
{
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
|
||||||
|
|
||||||
ItemStack potion = new ItemStack(Material.POTION, 2, (short)16429); // 16422
|
ItemStack potion = new ItemStack(Material.POTION, 2, (short) 16429); // 16422
|
||||||
PotionMeta potionMeta = (PotionMeta)potion.getItemMeta();
|
PotionMeta potionMeta = (PotionMeta) potion.getItemMeta();
|
||||||
potionMeta.setDisplayName(ChatColor.RESET + "Revival Potion");
|
potionMeta.setDisplayName(ChatColor.RESET + "Revival Potion");
|
||||||
potion.setItemMeta(potionMeta);
|
potion.setItemMeta(potionMeta);
|
||||||
player.getInventory().addItem(potion);
|
player.getInventory().addItem(potion);
|
||||||
|
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void SpawnCustom(LivingEntity ent)
|
public void SpawnCustom(LivingEntity ent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,65 +0,0 @@
|
|||||||
package nautilus.game.arcade.game.games.wither.kit;
|
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.entity.LivingEntity;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.inventory.meta.PotionMeta;
|
|
||||||
|
|
||||||
import mineplex.core.disguise.disguises.DisguisePlayer;
|
|
||||||
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.PerkBlockRestorer;
|
|
||||||
import nautilus.game.arcade.kit.perks.PerkDoubleJump;
|
|
||||||
import nautilus.game.arcade.kit.perks.PerkIronShell;
|
|
||||||
|
|
||||||
public class KitHumanBuilder extends Kit
|
|
||||||
{
|
|
||||||
public KitHumanBuilder(ArcadeManager manager)
|
|
||||||
{
|
|
||||||
super(manager, "Human Builder", KitAvailability.Free,
|
|
||||||
|
|
||||||
new String[]
|
|
||||||
{
|
|
||||||
""
|
|
||||||
},
|
|
||||||
|
|
||||||
new Perk[]
|
|
||||||
{
|
|
||||||
new PerkDoubleJump("Double Jump", 1, 0.8, true, 6000, true),
|
|
||||||
new PerkIronShell(),
|
|
||||||
new PerkBlockRestorer()
|
|
||||||
},
|
|
||||||
EntityType.ZOMBIE,
|
|
||||||
null);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void GiveItems(Player player)
|
|
||||||
{
|
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
|
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SPADE));
|
|
||||||
|
|
||||||
ItemStack potion = new ItemStack(Material.POTION, 2, (short)16429); // 16422
|
|
||||||
PotionMeta potionMeta = (PotionMeta)potion.getItemMeta();
|
|
||||||
potionMeta.setDisplayName(ChatColor.RESET + "Revival Potion");
|
|
||||||
potion.setItemMeta(potionMeta);
|
|
||||||
player.getInventory().addItem(potion);
|
|
||||||
|
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void SpawnCustom(LivingEntity ent)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -26,57 +26,60 @@ public class KitWitherMinion extends Kit
|
|||||||
{
|
{
|
||||||
public KitWitherMinion(ArcadeManager manager)
|
public KitWitherMinion(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Wither", KitAvailability.Free,
|
super(manager, "Wither", KitAvailability.Free,
|
||||||
|
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
""
|
""
|
||||||
},
|
},
|
||||||
|
|
||||||
new Perk[]
|
new Perk[]
|
||||||
{
|
{
|
||||||
new PerkWitherArrows(),
|
new PerkWitherArrows(), new PerkWitherAttack(),
|
||||||
new PerkWitherAttack(),
|
new PerkWitherMinion(), new PerkWitherCompassScent()
|
||||||
new PerkWitherMinion()
|
}, EntityType.WITHER, null);
|
||||||
},
|
|
||||||
EntityType.WITHER,
|
|
||||||
null);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
// public void SpawnCustom(LivingEntity ent)
|
// public void SpawnCustom(LivingEntity ent)
|
||||||
// {
|
// {
|
||||||
// ent.setMaxHealth(300);
|
// ent.setMaxHealth(300);
|
||||||
// ent.setHealth(300);
|
// ent.setHealth(300);
|
||||||
//
|
//
|
||||||
// DisguiseWither disguise = new DisguiseWither(ent);
|
// DisguiseWither disguise = new DisguiseWither(ent);
|
||||||
// disguise.SetName(C.cYellow + "Wither");
|
// disguise.SetName(C.cYellow + "Wither");
|
||||||
// disguise.SetCustomNameVisible(true);
|
// disguise.SetCustomNameVisible(true);
|
||||||
// Manager.GetDisguise().disguise(disguise);
|
// Manager.GetDisguise().disguise(disguise);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void GiveItems(Player player)
|
public void GiveItems(Player player)
|
||||||
{
|
{
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.GOLD_SWORD, (byte)0, 1,
|
player.getInventory().addItem(
|
||||||
C.cYellow + C.Bold + "Left-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Wither Skull"));
|
ItemStackFactory.Instance.CreateStack(Material.GOLD_SWORD,
|
||||||
|
(byte) 0, 1, C.cYellow + C.Bold + "Left-Click"
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD, (byte)0, 1,
|
+ C.cWhite + C.Bold + " - " + C.cGreen + C.Bold
|
||||||
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Skeletal Minions"));
|
+ "Wither Skull"));
|
||||||
|
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.COMPASS, (byte)0, 1,
|
|
||||||
C.cYellow + C.Bold + "Human Finder X-9000"));
|
|
||||||
|
|
||||||
//Disguise
|
player.getInventory().addItem(
|
||||||
|
ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD,
|
||||||
|
(byte) 0, 1, C.cYellow + C.Bold + "Right-Click"
|
||||||
|
+ C.cWhite + C.Bold + " - " + C.cGreen + C.Bold
|
||||||
|
+ "Skeletal Minions"));
|
||||||
|
|
||||||
|
player.getInventory().addItem(
|
||||||
|
ItemStackFactory.Instance
|
||||||
|
.CreateStack(Material.COMPASS, (byte) 0, 1, C.cYellow
|
||||||
|
+ C.Bold + "Human Finder X-9000"));
|
||||||
|
|
||||||
|
// Disguise
|
||||||
DisguiseWither disguise = new DisguiseWither(player);
|
DisguiseWither disguise = new DisguiseWither(player);
|
||||||
|
|
||||||
if (Manager.GetGame().GetTeam(player) != null)
|
if (Manager.GetGame().GetTeam(player) != null)
|
||||||
disguise.setName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
disguise.setName(Manager.GetGame().GetTeam(player).GetColor()
|
||||||
else
|
+ player.getName());
|
||||||
disguise.setName(player.getName());
|
else disguise.setName(player.getName());
|
||||||
|
|
||||||
disguise.setCustomNameVisible(true);
|
disguise.setCustomNameVisible(true);
|
||||||
Manager.GetDisguise().disguise(disguise);
|
Manager.GetDisguise().disguise(disguise);
|
||||||
@ -87,25 +90,25 @@ public class KitWitherMinion extends Kit
|
|||||||
{
|
{
|
||||||
if (event.IsCancelled())
|
if (event.IsCancelled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Player player = event.GetDamageePlayer();
|
Player player = event.GetDamageePlayer();
|
||||||
if (player == null)
|
if (player == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (HasKit(player))
|
if (HasKit(player))
|
||||||
event.SetCancelled("Wither Immunity");
|
event.SetCancelled("Wither Immunity");
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void witherMeleeCancel(CustomDamageEvent event)
|
public void witherMeleeCancel(CustomDamageEvent event)
|
||||||
{
|
{
|
||||||
if (event.IsCancelled())
|
if (event.IsCancelled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Player player = event.GetDamagerPlayer(true);
|
Player player = event.GetDamagerPlayer(true);
|
||||||
if (player == null)
|
if (player == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!HasKit(player))
|
if (!HasKit(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -120,7 +123,7 @@ public class KitWitherMinion extends Kit
|
|||||||
{
|
{
|
||||||
if (event.getType() != UpdateType.TICK)
|
if (event.getType() != UpdateType.TICK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (Player player : UtilServer.getPlayers())
|
for (Player player : UtilServer.getPlayers())
|
||||||
{
|
{
|
||||||
if (!HasKit(player))
|
if (!HasKit(player))
|
||||||
|
Loading…
Reference in New Issue
Block a user