SecondaryAbilityEvent now implements Cancellable

Fire SecondaryAbilityEvent for abilities with static chances

Also cleanup some of the event handling for Armor Impact, Greater
Impact and Fast Food
This commit is contained in:
TfT_02
2014-05-11 14:58:08 +02:00
parent 3d242bbdb6
commit e7e62b8d40
10 changed files with 64 additions and 28 deletions

View File

@ -102,6 +102,10 @@ public class ArcheryManager extends SkillManager {
* @param arrow The {@link Arrow} that was fired
*/
public double skillShot(LivingEntity target, double damage, Arrow arrow) {
if (!SkillUtils.activationSuccessful(SecondaryAbility.SKILL_SHOT, getPlayer())) {
return damage;
}
double damageBonusPercent = Math.min(((getSkillLevel() / Archery.skillShotIncreaseLevel) * Archery.skillShotIncreasePercentage), Archery.skillShotMaxBonusPercentage);
double archeryBonus = Math.min(damage * damageBonusPercent, Archery.skillShotMaxBonusDamage);