fixed some OITQ stuff

This commit is contained in:
Mini-Chiss 2015-08-02 23:17:23 +02:00
parent 4cc810f1c0
commit 0a84bd69d8
2 changed files with 46 additions and 30 deletions

View File

@ -80,6 +80,8 @@ public class Quiver extends SoloGame
this.BlockBreakAllow.add(102); this.BlockBreakAllow.add(102);
this.BlockBreakAllow.add(20); this.BlockBreakAllow.add(20);
this.DeathSpectateSecs = 2;
_scoreObj = Scoreboard.GetScoreboard().registerNewObjective("Kills", "dummy"); _scoreObj = Scoreboard.GetScoreboard().registerNewObjective("Kills", "dummy");
_scoreObj.setDisplaySlot(DisplaySlot.BELOW_NAME); _scoreObj.setDisplaySlot(DisplaySlot.BELOW_NAME);

View File

@ -1,12 +1,16 @@
package nautilus.game.arcade.kit.perks; 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.UtilPlayer;
import mineplex.core.updater.UpdateType; import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
import org.bukkit.Sound;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -16,8 +20,8 @@ public class PerkVanishing extends Perk
{ {
super("Vanishing Act", new String[] super("Vanishing Act", new String[]
{ {
"Become invisible for two seconds after a melee kill.", "Become invisible for 2 seconds each kill.",
"You will lose invisibility if you attack or charge your bow." "Attacking with melee removes invisibility."
}); });
} }
@ -27,9 +31,9 @@ public class PerkVanishing extends Perk
if (!Manager.GetGame().IsLive()) if (!Manager.GetGame().IsLive())
return; return;
//If it's an arrow kill (OITQ) // //If it's an arrow kill (OITQ)
if (!event.GetLog().GetKiller().GetReason().toLowerCase().contains("instagib")) // if (!event.GetLog().GetKiller().GetReason().toLowerCase().contains("instagib"))
return; // return;
if (!event.GetLog().GetKiller().IsPlayer()) if (!event.GetLog().GetKiller().IsPlayer())
return; return;
@ -46,14 +50,25 @@ public class PerkVanishing extends Perk
return; return;
Manager.GetCondition().Factory().Cloak("Vanishing Act", killer, null, 2, false, true); 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 @EventHandler
public void remove(CustomDamageEvent event) public void remove(CustomDamageEvent event)
{ {
if (event.isCancelled())
return;
if (!Manager.GetGame().IsLive()) if (!Manager.GetGame().IsLive())
return; return;
//Arrow damage, ignore it!
if (event.GetDamage() > 10)
return;
Player damager = event.GetDamagerPlayer(true); Player damager = event.GetDamagerPlayer(true);
if (damager == null) if (damager == null)
@ -65,29 +80,28 @@ public class PerkVanishing extends Perk
if (!Kit.HasKit(damager)) if (!Kit.HasKit(damager))
return; return;
if (Manager.GetCondition().IsCloaked(damager)) Manager.GetCondition().EndCondition(damager, ConditionType.CLOAK, null);
Manager.GetCondition().Clean(damager);
} }
@EventHandler // @EventHandler
public void remove(UpdateEvent event) // public void remove(UpdateEvent event)
{ // {
if (event.getType() != UpdateType.TICK) // if (event.getType() != UpdateType.TICK)
return; // return;
//
if (!Manager.GetGame().IsLive()) // if (!Manager.GetGame().IsLive())
return; // return;
//
for (Player player : Manager.GetGame().GetPlayers(true)) // for (Player player : Manager.GetGame().GetPlayers(true))
{ // {
if (!Kit.HasKit(player)) // if (!Kit.HasKit(player))
continue; // continue;
//
if (!UtilPlayer.isChargingBow(player)) // if (!UtilPlayer.isChargingBow(player))
continue; // continue;
//
if (Manager.GetCondition().IsCloaked(player)) // if (Manager.GetCondition().IsCloaked(player))
Manager.GetCondition().Clean(player); // Manager.GetCondition().Clean(player);
} // }
} // }
} }