mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-02-28 06:31:43 +01:00
Added cap for goliath
This commit is contained in:
parent
0d50c5e2a8
commit
3e0e7696f8
@ -5,6 +5,8 @@ import com.willfp.ecoenchants.enchantments.EcoEnchants;
|
|||||||
import org.bukkit.attribute.Attribute;
|
import org.bukkit.attribute.Attribute;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
|
import org.kingdoms.utils.caffeine.checkerframework.checker.units.qual.A;
|
||||||
|
|
||||||
public final class Goliath extends EcoEnchant {
|
public final class Goliath extends EcoEnchant {
|
||||||
public Goliath() {
|
public Goliath() {
|
||||||
super(
|
super(
|
||||||
@ -25,6 +27,10 @@ public final class Goliath extends EcoEnchant {
|
|||||||
double damage = event.getDamage();
|
double damage = event.getDamage();
|
||||||
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier");
|
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier");
|
||||||
double bonus = 1 + (multiplier * level * timesMoreHealth);
|
double bonus = 1 + (multiplier * level * timesMoreHealth);
|
||||||
|
if(bonus - 1 > this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier-cap")) {
|
||||||
|
bonus = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier-cap") + 1;
|
||||||
|
}
|
||||||
|
A
|
||||||
event.setDamage(damage * bonus);
|
event.setDamage(damage * bonus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,3 +21,4 @@ general-config:
|
|||||||
|
|
||||||
config:
|
config:
|
||||||
multiplier: 0.01 # If enemy has 200 health, and you have 20 w/ goliath 8 then your damage is multiplied by: ((200/10)*8*0.01) + 1 = 2.6
|
multiplier: 0.01 # If enemy has 200 health, and you have 20 w/ goliath 8 then your damage is multiplied by: ((200/10)*8*0.01) + 1 = 2.6
|
||||||
|
multiplier-cap: 2.5 # Never deal more than x times more damage
|
Loading…
Reference in New Issue
Block a user