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(20);
this.DeathSpectateSecs = 2;
_scoreObj = Scoreboard.GetScoreboard().registerNewObjective("Kills", "dummy");
_scoreObj.setDisplaySlot(DisplaySlot.BELOW_NAME);

View File

@ -1,12 +1,16 @@
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.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
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;
@ -16,8 +20,8 @@ public class PerkVanishing extends Perk
{
super("Vanishing Act", new String[]
{
"Become invisible for two seconds after a melee kill.",
"You will lose invisibility if you attack or charge your bow."
"Become invisible for 2 seconds each kill.",
"Attacking with melee removes invisibility."
});
}
@ -27,9 +31,9 @@ public class PerkVanishing extends Perk
if (!Manager.GetGame().IsLive())
return;
//If it's an arrow kill (OITQ)
if (!event.GetLog().GetKiller().GetReason().toLowerCase().contains("instagib"))
return;
// //If it's an arrow kill (OITQ)
// if (!event.GetLog().GetKiller().GetReason().toLowerCase().contains("instagib"))
// return;
if (!event.GetLog().GetKiller().IsPlayer())
return;
@ -46,14 +50,25 @@ public class PerkVanishing extends Perk
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)
@ -65,29 +80,28 @@ public class PerkVanishing extends Perk
if (!Kit.HasKit(damager))
return;
if (Manager.GetCondition().IsCloaked(damager))
Manager.GetCondition().Clean(damager);
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);
}
}
// @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);
// }
// }
}