This commit is contained in:
Ty Sayers 2015-08-02 18:21:01 -04:00
commit fa2bcf7f69
4 changed files with 188 additions and 19 deletions

View File

@ -5,18 +5,6 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
@ -32,12 +20,28 @@ import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.quiver.kits.*;
import nautilus.game.arcade.game.games.quiver.kits.KitBrawler;
import nautilus.game.arcade.game.games.quiver.kits.KitEnchanter;
import nautilus.game.arcade.game.games.quiver.kits.KitLeaper;
import nautilus.game.arcade.game.games.quiver.kits.KitNinja;
import nautilus.game.arcade.game.games.quiver.kits.KitSlamShot;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.stats.SharpShooterStatTracker;
import nautilus.game.arcade.stats.WinWithoutBowStatTracker;
import nautilus.game.arcade.stats.WinWithoutDyingStatTracker;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
public class Quiver extends SoloGame
{
private ArrayList<QuiverScore> _ranks = new ArrayList<QuiverScore>();
@ -56,7 +60,8 @@ public class Quiver extends SoloGame
new KitLeaper(manager),
new KitBrawler(manager),
new KitEnchanter(manager),
new KitSlamShot(manager)
new KitSlamShot(manager),
new KitNinja(manager)
},
new String[]
@ -75,6 +80,8 @@ public class Quiver extends SoloGame
this.BlockBreakAllow.add(102);
this.BlockBreakAllow.add(20);
this.DeathSpectateSecs = 2;
_scoreObj = Scoreboard.GetScoreboard().registerNewObjective("Kills", "dummy");
_scoreObj.setDisplaySlot(DisplaySlot.BELOW_NAME);

View File

@ -0,0 +1,56 @@
package nautilus.game.arcade.game.games.quiver.kits;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilServer;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkVanishing;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
public class KitNinja extends Kit
{
public KitNinja(ArcadeManager manager)
{
super(manager, "Ninja", KitAvailability.Achievement, 0, new String[]
{
"You're a sneaky one, you!"
}, new Perk[]
{
new PerkVanishing()
}, EntityType.ZOMBIE, new ItemBuilder(Material.GOLD_SWORD).build());
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(new ItemBuilder(Material.GOLD_SWORD).setUnbreakable(true).build());
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
if (Manager.GetGame().GetState() == GameState.Live)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(262, (byte)0, 1, F.item("Super Arrow")));
final Player fPlayer = player;
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable()
{
public void run()
{
UtilInv.Update(fPlayer);
}
}, 10);
}
}
}

View File

@ -21,9 +21,8 @@ public class KitSlamShot extends Kit
{
public KitSlamShot(ArcadeManager manager)
{
super(manager, "Slam Shooter", KitAvailability.Achievement,
new String[]
super(manager, "Slam Shooter", KitAvailability.Gem,
5000, new String[]
{
"Gets 2 arrows for killing slammed players!"
},
@ -33,7 +32,7 @@ public class KitSlamShot extends Kit
new PerkSeismicSlamOITQ()
},
EntityType.ZOMBIE,
new ItemStack(Material.IRON_SPADE));
new ItemStack(Material.DIAMOND_SPADE));
this.setAchievementRequirements(new Achievement[]
{
@ -47,7 +46,7 @@ public class KitSlamShot extends Kit
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SPADE));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SPADE));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
if (Manager.GetGame().GetState() == GameState.Live)

View File

@ -0,0 +1,107 @@
package nautilus.game.arcade.kit.perks;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
public class PerkVanishing extends Perk
{
public PerkVanishing()
{
super("Vanishing Act", new String[]
{
"Become invisible for 2 seconds each kill.",
"Attacking with melee removes invisibility."
});
}
@EventHandler
public void kill(CombatDeathEvent event)
{
if (!Manager.GetGame().IsLive())
return;
// //If it's an arrow kill (OITQ)
// if (!event.GetLog().GetKiller().GetReason().toLowerCase().contains("instagib"))
// return;
if (!event.GetLog().GetKiller().IsPlayer())
return;
Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
if (killer == null)
return;
if (!Manager.IsAlive(killer))
return;
if (!Kit.HasKit(killer))
return;
Manager.GetCondition().Factory().Cloak("Vanishing Act", killer, null, 2, false, true);
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, killer.getLocation().add(0, 1, 0), 0, 0, 0, 0, 1, ViewDist.LONG, UtilServer.getPlayers());
killer.getWorld().playSound(killer.getLocation(), Sound.FIZZ, 1f, 2f);
}
@EventHandler
public void remove(CustomDamageEvent event)
{
if (event.isCancelled())
return;
if (!Manager.GetGame().IsLive())
return;
//Arrow damage, ignore it!
if (event.GetDamage() > 10)
return;
Player damager = event.GetDamagerPlayer(true);
if (damager == null)
return;
if (!Manager.IsAlive(damager))
return;
if (!Kit.HasKit(damager))
return;
Manager.GetCondition().EndCondition(damager, ConditionType.CLOAK, null);
}
// @EventHandler
// public void remove(UpdateEvent event)
// {
// if (event.getType() != UpdateType.TICK)
// return;
//
// if (!Manager.GetGame().IsLive())
// return;
//
// for (Player player : Manager.GetGame().GetPlayers(true))
// {
// if (!Kit.HasKit(player))
// continue;
//
// if (!UtilPlayer.isChargingBow(player))
// continue;
//
// if (Manager.GetCondition().IsCloaked(player))
// Manager.GetCondition().Clean(player);
// }
// }
}