mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 11:14:44 +02:00
@ -19,7 +19,7 @@ public class Archery {
|
||||
public static double skillShotMaxBonusPercentage = AdvancedConfig.getInstance().getSkillShotBonusMax();
|
||||
public static double skillShotMaxBonusDamage = AdvancedConfig.getInstance().getSkillShotDamageMax();
|
||||
|
||||
public static double dazeModifier = AdvancedConfig.getInstance().getDazeModifier();
|
||||
public static double dazeBonusDamage = AdvancedConfig.getInstance().getDazeBonusDamage();
|
||||
|
||||
public static final double DISTANCE_XP_MULTIPLIER = 0.025;
|
||||
|
||||
|
@ -1,11 +1,9 @@
|
||||
package com.gmail.nossr50.skills.archery;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
@ -18,7 +16,6 @@ import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.skills.CombatUtils;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
|
||||
public class ArcheryManager extends SkillManager {
|
||||
@ -70,9 +67,8 @@ public class ArcheryManager extends SkillManager {
|
||||
* Handle the effects of the Daze ability
|
||||
*
|
||||
* @param defender The {@link Player} being affected by the ability
|
||||
* @param arrow The {@link Arrow} that was fired
|
||||
*/
|
||||
public double daze(Player defender, Arrow arrow) {
|
||||
public double daze(Player defender) {
|
||||
if (!SkillUtils.activationSuccessful(SecondaryAbility.DAZE, getPlayer(), getSkillLevel(), activationChance)) {
|
||||
return 0;
|
||||
}
|
||||
@ -91,24 +87,21 @@ public class ArcheryManager extends SkillManager {
|
||||
getPlayer().sendMessage(LocaleLoader.getString("Combat.TargetDazed"));
|
||||
}
|
||||
|
||||
return CombatUtils.callFakeDamageEvent(arrow, defender, DamageCause.PROJECTILE, Archery.dazeModifier);
|
||||
return Archery.dazeBonusDamage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the effects of the Skill Shot ability
|
||||
*
|
||||
* @param target The {@link LivingEntity} being affected by the ability
|
||||
* @param damage The amount of damage initially dealt by the event
|
||||
* @param arrow The {@link Arrow} that was fired
|
||||
*/
|
||||
public double skillShot(LivingEntity target, double damage, Arrow arrow) {
|
||||
public double skillShot(double damage) {
|
||||
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);
|
||||
|
||||
return CombatUtils.callFakeDamageEvent(arrow, target, DamageCause.PROJECTILE, archeryBonus);
|
||||
return Math.min(damage * damageBonusPercent, Archery.skillShotMaxBonusDamage);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
package com.gmail.nossr50.skills.axes;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageModifier;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
@ -49,17 +52,13 @@ public class AxesManager extends SkillManager {
|
||||
|
||||
/**
|
||||
* Handle the effects of the Axe Mastery ability
|
||||
*
|
||||
* @param target The {@link LivingEntity} being affected by the ability
|
||||
*/
|
||||
public double axeMastery(LivingEntity target) {
|
||||
public double axeMastery() {
|
||||
if (!SkillUtils.activationSuccessful(SecondaryAbility.AXE_MASTERY, getPlayer())) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
double axeBonus = Math.min(getSkillLevel() / (Axes.axeMasteryMaxBonusLevel / Axes.axeMasteryMaxBonus), Axes.axeMasteryMaxBonus);
|
||||
|
||||
return CombatUtils.callFakeDamageEvent(getPlayer(), target, axeBonus);
|
||||
return Math.min(getSkillLevel() / (Axes.axeMasteryMaxBonusLevel / Axes.axeMasteryMaxBonus), Axes.axeMasteryMaxBonus);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -86,7 +85,7 @@ public class AxesManager extends SkillManager {
|
||||
damage = (damage * Axes.criticalHitPVEModifier) - damage;
|
||||
}
|
||||
|
||||
return CombatUtils.callFakeDamageEvent(player, target, damage);
|
||||
return damage;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -133,7 +132,7 @@ public class AxesManager extends SkillManager {
|
||||
}
|
||||
}
|
||||
|
||||
return CombatUtils.callFakeDamageEvent(player, target, Axes.greaterImpactBonusDamage);
|
||||
return Axes.greaterImpactBonusDamage;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -142,7 +141,7 @@ public class AxesManager extends SkillManager {
|
||||
* @param target The {@link LivingEntity} being affected by the ability
|
||||
* @param damage The amount of damage initially dealt by the event
|
||||
*/
|
||||
public void skullSplitterCheck(LivingEntity target, double damage) {
|
||||
CombatUtils.applyAbilityAoE(getPlayer(), target, damage / Axes.skullSplitterModifier, skill);
|
||||
public void skullSplitterCheck(LivingEntity target, double damage, Map<DamageModifier, Double> modifiers) {
|
||||
CombatUtils.applyAbilityAoE(getPlayer(), target, damage / Axes.skullSplitterModifier, modifiers, skill);
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.gmail.nossr50.util.skills.CombatUtils;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
|
||||
public class TamingManager extends SkillManager {
|
||||
@ -113,9 +112,8 @@ public class TamingManager extends SkillManager {
|
||||
*
|
||||
* @param target The LivingEntity to apply Gore on
|
||||
* @param damage The initial damage
|
||||
* @param wolf The wolf using the ability
|
||||
*/
|
||||
public double gore(LivingEntity target, double damage, Wolf wolf) {
|
||||
public double gore(LivingEntity target, double damage) {
|
||||
if (!SkillUtils.activationSuccessful(SecondaryAbility.GORE, getPlayer(), getSkillLevel(), activationChance)) {
|
||||
return 0;
|
||||
}
|
||||
@ -129,11 +127,11 @@ public class TamingManager extends SkillManager {
|
||||
getPlayer().sendMessage(LocaleLoader.getString("Combat.Gore"));
|
||||
|
||||
damage = (damage * Taming.goreModifier) - damage;
|
||||
return CombatUtils.callFakeDamageEvent(wolf, target, damage);
|
||||
return damage;
|
||||
}
|
||||
|
||||
public double sharpenedClaws(LivingEntity target, Wolf wolf) {
|
||||
return CombatUtils.callFakeDamageEvent(wolf, target, Taming.sharpenedClawsBonusDamage);
|
||||
public double sharpenedClaws() {
|
||||
return Taming.sharpenedClawsBonusDamage;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,13 +1,10 @@
|
||||
package com.gmail.nossr50.skills.unarmed;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageModifier;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.bukkit.material.SmoothBrick;
|
||||
@ -25,7 +22,6 @@ import com.gmail.nossr50.util.EventUtils;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.skills.CombatUtils;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
|
||||
public class UnarmedManager extends SkillManager {
|
||||
@ -124,28 +120,23 @@ public class UnarmedManager extends SkillManager {
|
||||
/**
|
||||
* Handle the effects of the Berserk ability
|
||||
*
|
||||
* @param target The {@link LivingEntity} being affected by the ability
|
||||
* @param damage The amount of damage initially dealt by the event
|
||||
*/
|
||||
public double berserkDamage(LivingEntity target, double damage, Map<DamageModifier, Double> modifiers) {
|
||||
public double berserkDamage(double damage) {
|
||||
damage = (damage * Unarmed.berserkDamageModifier) - damage;
|
||||
|
||||
return CombatUtils.callFakeDamageEvent(getPlayer(), target, damage, modifiers);
|
||||
return damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the effects of the Iron Arm ability
|
||||
*
|
||||
* @param target The {@link LivingEntity} being affected by the ability
|
||||
*/
|
||||
public double ironArm(LivingEntity target, Map<DamageModifier, Double> modifiers) {
|
||||
public double ironArm() {
|
||||
if (!SkillUtils.activationSuccessful(SecondaryAbility.IRON_ARM, getPlayer())) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
double unarmedBonus = Math.min(Unarmed.ironArmMinBonusDamage + (getSkillLevel() / Unarmed.ironArmIncreaseLevel), Unarmed.ironArmMaxBonusDamage);
|
||||
|
||||
return CombatUtils.callFakeDamageEvent(getPlayer(), target, unarmedBonus, modifiers);
|
||||
return Math.min(Unarmed.ironArmMinBonusDamage + (getSkillLevel() / Unarmed.ironArmIncreaseLevel), Unarmed.ironArmMaxBonusDamage);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user