Mineplex2018-withcommit/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCripple.java
Chiss ea81e558ea Added;
- Death Tag
- Dragon Escape
- Barbarians

Spleef; added hunger
Dragons; added knockback
Turf Forts; buffed shredder + fixed infil on respawn

Added knockack to 1 damage attacks.
Removed 'hit sound' from hitting mobs (just plays animal sound)
2013-09-11 12:22:55 +10:00

51 lines
1.2 KiB
Java

package nautilus.game.arcade.kit.perks;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.C;
import nautilus.game.arcade.kit.Perk;
public class PerkCripple extends Perk
{
private int _power;
private double _time;
public PerkCripple(int power, double time)
{
super("Knockback", new String[]
{
C.cGray + "Attacks give Slow " + power + " for " + time + " seconds.",
});
_power = power;
_time = time;
}
@EventHandler(priority = EventPriority.HIGH)
public void Knockback(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetCause() != DamageCause.ENTITY_ATTACK)
return;
Player damager = event.GetDamagerPlayer(false);
if (damager == null) return;
if (!Kit.HasKit(damager))
return;
if (!Manager.IsAlive(damager))
return;
event.SetKnockback(false);
Manager.GetCondition().Factory().Slow("Cripple", event.GetDamageeEntity(), damager, _time, _power, false, false, false, false);
}
}