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

40 lines
851 B
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.core.common.util.C;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk;
public class PerkStrength extends Perk
{
private int _power;
public PerkStrength(int power)
{
super("Strength", new String[]
{
C.cGray + "You deal " + power + " more damage",
});
_power = power;
}
@EventHandler(priority = EventPriority.HIGH)
public void DamageDecrease(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
Player damager = event.GetDamagerPlayer(true);
if (damager == null) return;
if (!Kit.HasKit(damager))
return;
event.AddMod(damager.getName(), GetName(), _power, false);
}
}