2012-06-15 03:10:47 +02:00
|
|
|
package com.gmail.nossr50.skills.unarmed;
|
|
|
|
|
|
|
|
import org.bukkit.ChatColor;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
2012-06-25 14:52:20 +02:00
|
|
|
import com.gmail.nossr50.datatypes.SkillType;
|
2012-06-15 03:10:47 +02:00
|
|
|
import com.gmail.nossr50.util.Misc;
|
2012-06-25 14:52:20 +02:00
|
|
|
import com.gmail.nossr50.util.Users;
|
2012-06-15 03:10:47 +02:00
|
|
|
|
|
|
|
public class IronGripEventHandler {
|
|
|
|
private UnarmedManager manager;
|
|
|
|
private Player defender;
|
|
|
|
protected int skillModifier;
|
|
|
|
|
|
|
|
protected IronGripEventHandler(UnarmedManager manager, Player defender) {
|
|
|
|
this.manager = manager;
|
|
|
|
this.defender = defender;
|
|
|
|
|
|
|
|
calculateSkillModifier();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void calculateSkillModifier() {
|
2012-06-25 14:52:20 +02:00
|
|
|
this.skillModifier = Misc.skillCheck(Users.getProfile(defender).getSkillLevel(SkillType.UNARMED), Unarmed.IRON_GRIP_MAX_BONUS_LEVEL);
|
2012-06-15 03:10:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
protected void sendAbilityMessages() {
|
|
|
|
defender.sendMessage(ChatColor.GREEN + "Your iron grip kept you from being disarmed!"); //TODO: Use locale
|
|
|
|
manager.getPlayer().sendMessage(ChatColor.RED + "Your opponent has an iron grip!"); //TODO: Use locale
|
|
|
|
}
|
|
|
|
}
|