mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-02-03 11:31:21 +01:00
More cleanup
This commit is contained in:
parent
4cceb06ed6
commit
c29fe0bc87
@ -13,9 +13,19 @@ public abstract class AbilityResult {
|
|||||||
return ability;
|
return ability;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param path
|
||||||
|
* Path of ability modifier
|
||||||
|
* @return Calculates a new value for a given ability modifier
|
||||||
|
*/
|
||||||
public double getModifier(String path) {
|
public double getModifier(String path) {
|
||||||
return ability.getModifier(path);
|
return ability.getModifier(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return If the ability is cast successfully. This method is used to apply
|
||||||
|
* extra ability conditions (player must be on the ground, must aim
|
||||||
|
* at an entity..)
|
||||||
|
*/
|
||||||
public abstract boolean isSuccessful();
|
public abstract boolean isSuccessful();
|
||||||
}
|
}
|
||||||
|
@ -417,15 +417,11 @@ public class PlayerData {
|
|||||||
* target, removes resources needed from the player
|
* target, removes resources needed from the player
|
||||||
*/
|
*/
|
||||||
if (ability.hasModifier("mana"))
|
if (ability.hasModifier("mana"))
|
||||||
rpgPlayer.giveMana(-ability.getModifier("mana"));
|
rpgPlayer.giveMana(-abilityResult.getModifier("mana"));
|
||||||
if (ability.hasModifier("stamina"))
|
if (ability.hasModifier("stamina"))
|
||||||
rpgPlayer.giveStamina(-ability.getModifier("stamina"));
|
rpgPlayer.giveStamina(-abilityResult.getModifier("stamina"));
|
||||||
|
|
||||||
double cooldown = ability.getModifier("cooldown");
|
|
||||||
|
|
||||||
// apply cooldown reduction
|
|
||||||
cooldown *= 1 - Math.min(.8, stats.getStat(ItemStat.COOLDOWN_REDUCTION) / 100);
|
|
||||||
|
|
||||||
|
double cooldown = abilityResult.getModifier("cooldown") * (1 - Math.min(.8, stats.getStat(ItemStat.COOLDOWN_REDUCTION) / 100));
|
||||||
if (cooldown > 0)
|
if (cooldown > 0)
|
||||||
applyAbilityCooldown(ability.getAbility(), cooldown);
|
applyAbilityCooldown(ability.getAbility(), cooldown);
|
||||||
|
|
||||||
|
@ -8,10 +8,10 @@ import net.Indyuce.mmoitems.stat.data.type.Mergeable;
|
|||||||
import net.Indyuce.mmoitems.stat.data.type.StatData;
|
import net.Indyuce.mmoitems.stat.data.type.StatData;
|
||||||
|
|
||||||
public class DoubleData implements StatData, Mergeable {
|
public class DoubleData implements StatData, Mergeable {
|
||||||
private static final Random random = new Random();
|
|
||||||
|
|
||||||
private double min, max;
|
private double min, max;
|
||||||
|
|
||||||
|
private static final Random random = new Random();
|
||||||
|
|
||||||
public DoubleData(Object object) {
|
public DoubleData(Object object) {
|
||||||
if (object instanceof Number) {
|
if (object instanceof Number) {
|
||||||
min = Double.valueOf(object.toString());
|
min = Double.valueOf(object.toString());
|
||||||
|
@ -14,8 +14,8 @@ import net.Indyuce.mmoitems.stat.data.type.StatData;
|
|||||||
|
|
||||||
public abstract class InternalStat extends ItemStat {
|
public abstract class InternalStat extends ItemStat {
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* internal stats can be used to store specific item data and cannot be
|
* Internal stats can be used to store specific item data and cannot be
|
||||||
* edited in the item edition GUI since they only exist once the item is
|
* edited in the item edition GUI since they only exist once the item is
|
||||||
* physically generated.
|
* physically generated.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user