Mineplex2018-withcommit/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkMammoth.java

51 lines
1.1 KiB
Java
Raw Normal View History

2013-08-27 17:14:08 +02:00
package nautilus.game.arcade.kit.perks;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.C;
import nautilus.game.arcade.kit.Perk;
public class PerkMammoth extends Perk
{
public PerkMammoth()
{
super("Mammoth", new String[]
{
2013-11-22 08:40:38 +01:00
C.cGray + "Take 50% knockback and deal 150% knockback",
2013-08-27 17:14:08 +02:00
});
}
@EventHandler(priority = EventPriority.HIGH)
public void KnockbackIncrease(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
Player damager = event.GetDamagerPlayer(false);
if (damager == null) return;
if (!Kit.HasKit(damager))
return;
event.AddKnockback(GetName(), 1.5d);
}
@EventHandler(priority = EventPriority.HIGH)
public void KnockbackDecrease(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
Player damagee = event.GetDamageePlayer();
if (damagee == null) return;
if (!Kit.HasKit(damagee))
return;
event.AddKnockback(GetName(), 0.5d);
}
}