rebalance all stats
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package net.fretux.ascend.compat;
|
package net.fretux.ascend.compat;
|
||||||
|
|
||||||
|
import net.fretux.ascend.player.StatEffects;
|
||||||
import io.redspace.ironsspellbooks.api.registry.AttributeRegistry;
|
import io.redspace.ironsspellbooks.api.registry.AttributeRegistry;
|
||||||
import net.fretux.ascend.player.PlayerStatsProvider;
|
import net.fretux.ascend.player.PlayerStatsProvider;
|
||||||
import net.minecraft.world.entity.ai.attributes.Attribute;
|
import net.minecraft.world.entity.ai.attributes.Attribute;
|
||||||
@@ -77,11 +78,9 @@ public class IronsSpellbooksCompat {
|
|||||||
(Attribute) AttributeRegistry.MAX_MANA.get(),
|
(Attribute) AttributeRegistry.MAX_MANA.get(),
|
||||||
INT_MAX_MANA_UUID,
|
INT_MAX_MANA_UUID,
|
||||||
"Ascend INT max mana",
|
"Ascend INT max mana",
|
||||||
intelligence * 3.0d
|
StatEffects.getIntelligenceManaBonus(intelligence)
|
||||||
);
|
);
|
||||||
double regenPerPoint = 0.004d;
|
double regenBonus = StatEffects.getIntelligenceAnvilCostReduction(intelligence);
|
||||||
double regenMax = 0.40d;
|
|
||||||
double regenBonus = Math.min(intelligence * regenPerPoint, regenMax);
|
|
||||||
applyMultiplyBaseModifier(
|
applyMultiplyBaseModifier(
|
||||||
player,
|
player,
|
||||||
(Attribute) AttributeRegistry.MANA_REGEN.get(),
|
(Attribute) AttributeRegistry.MANA_REGEN.get(),
|
||||||
@@ -101,9 +100,7 @@ public class IronsSpellbooksCompat {
|
|||||||
if (willpower <= 0) {
|
if (willpower <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
double perPoint = 0.0025d;
|
double reduction = StatEffects.getWillpowerCastTimeReduction(willpower);
|
||||||
double max = 0.25d;
|
|
||||||
double reduction = Math.min(willpower * perPoint, max);
|
|
||||||
Attribute attr = (Attribute) AttributeRegistry.CAST_TIME_REDUCTION.get();
|
Attribute attr = (Attribute) AttributeRegistry.CAST_TIME_REDUCTION.get();
|
||||||
if (attr == null) {
|
if (attr == null) {
|
||||||
return;
|
return;
|
||||||
@@ -135,7 +132,7 @@ public class IronsSpellbooksCompat {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
double manaPerPoint = 1.5d;
|
double manaPerPoint = 1.5d;
|
||||||
double bonusMana = charisma * manaPerPoint;
|
double bonusMana = Math.min(charisma * manaPerPoint, 150.0d);
|
||||||
applyAddModifier(
|
applyAddModifier(
|
||||||
player,
|
player,
|
||||||
(Attribute) AttributeRegistry.MAX_MANA.get(),
|
(Attribute) AttributeRegistry.MAX_MANA.get(),
|
||||||
@@ -143,9 +140,7 @@ public class IronsSpellbooksCompat {
|
|||||||
"Ascend CHA max mana",
|
"Ascend CHA max mana",
|
||||||
bonusMana
|
bonusMana
|
||||||
);
|
);
|
||||||
double supportPerPoint = 0.003d;
|
double supportBonus = StatEffects.getCharismaAllyDamageBonus(charisma);
|
||||||
double supportMax = 0.30d;
|
|
||||||
double supportBonus = Math.min(charisma * supportPerPoint, supportMax);
|
|
||||||
Attribute supportAttr = (Attribute) AttributeRegistry.HOLY_SPELL_POWER.get();
|
Attribute supportAttr = (Attribute) AttributeRegistry.HOLY_SPELL_POWER.get();
|
||||||
if (supportAttr != null && supportBonus > 0.0d) {
|
if (supportAttr != null && supportBonus > 0.0d) {
|
||||||
applyMultiplyBaseModifier(
|
applyMultiplyBaseModifier(
|
||||||
@@ -156,10 +151,8 @@ public class IronsSpellbooksCompat {
|
|||||||
supportBonus
|
supportBonus
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
double minionHpPerPoint = 0.004d;
|
double minionHpBonus = Math.min(StatEffects.getCharismaAllyHealthBonus(charisma) * 1.25d, 0.25d);
|
||||||
double minionDmgPerPoint = 0.003d;
|
double minionDmgBonus = Math.min(StatEffects.getCharismaAllyDamageBonus(charisma) * 1.25d, 0.25d);
|
||||||
double minionHpBonus = Math.min(charisma * minionHpPerPoint, 0.40d);
|
|
||||||
double minionDmgBonus = Math.min(charisma * minionDmgPerPoint, 0.30d);
|
|
||||||
Attribute summonHpAttr = null;
|
Attribute summonHpAttr = null;
|
||||||
Attribute summonDmgAttr = (Attribute) AttributeRegistry.SUMMON_DAMAGE.get();
|
Attribute summonDmgAttr = (Attribute) AttributeRegistry.SUMMON_DAMAGE.get();
|
||||||
if (summonHpAttr != null && minionHpBonus > 0.0d) {
|
if (summonHpAttr != null && minionHpBonus > 0.0d) {
|
||||||
@@ -203,9 +196,7 @@ public class IronsSpellbooksCompat {
|
|||||||
clearMagicScaling(player);
|
clearMagicScaling(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
double spPerPoint = 0.0075d;
|
double spBonus = Math.min(StatEffects.getMagicScalingMultiplier(magicScaling) - 1.0d, 0.35d);
|
||||||
double spMax = 0.75d;
|
|
||||||
double spBonus = Math.min(magicScaling * spPerPoint, spMax);
|
|
||||||
applyMultiplyBaseModifier(
|
applyMultiplyBaseModifier(
|
||||||
player,
|
player,
|
||||||
(Attribute) AttributeRegistry.SPELL_POWER.get(),
|
(Attribute) AttributeRegistry.SPELL_POWER.get(),
|
||||||
@@ -213,9 +204,7 @@ public class IronsSpellbooksCompat {
|
|||||||
"Ascend Magic Scaling spell power",
|
"Ascend Magic Scaling spell power",
|
||||||
spBonus
|
spBonus
|
||||||
);
|
);
|
||||||
double cdrPerPoint = 0.0015d;
|
double cdrBonus = Math.min((StatEffects.getMagicScalingMultiplier(magicScaling) - 1.0d) * 0.4d, 0.14d);
|
||||||
double cdrMax = 0.15d;
|
|
||||||
double cdrBonus = Math.min(magicScaling * cdrPerPoint, cdrMax);
|
|
||||||
applyMultiplyBaseModifier(
|
applyMultiplyBaseModifier(
|
||||||
player,
|
player,
|
||||||
(Attribute) AttributeRegistry.COOLDOWN_REDUCTION.get(),
|
(Attribute) AttributeRegistry.COOLDOWN_REDUCTION.get(),
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ public class ActivityEvents {
|
|||||||
player.getCapability(PlayerStatsProvider.PLAYER_STATS).ifPresent(stats -> {
|
player.getCapability(PlayerStatsProvider.PLAYER_STATS).ifPresent(stats -> {
|
||||||
int agility = stats.getAttributeLevel("agility");
|
int agility = stats.getAttributeLevel("agility");
|
||||||
if (agility <= 0) return;
|
if (agility <= 0) return;
|
||||||
double evadeChance = Math.min(agility * 0.0005d, 0.05d);
|
double evadeChance = StatEffects.getAgilityEvasionChance(agility);
|
||||||
if (player.getRandom().nextDouble() < evadeChance) {
|
if (player.getRandom().nextDouble() < evadeChance) {
|
||||||
float original = event.getAmount();
|
float original = event.getAmount();
|
||||||
event.setAmount(original * 0.1f);
|
event.setAmount(original * 0.1f);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package net.fretux.ascend.event;
|
|||||||
|
|
||||||
import net.fretux.ascend.AscendMod;
|
import net.fretux.ascend.AscendMod;
|
||||||
import net.fretux.ascend.player.PlayerStatsProvider;
|
import net.fretux.ascend.player.PlayerStatsProvider;
|
||||||
|
import net.fretux.ascend.player.StatEffects;
|
||||||
import net.minecraft.world.effect.MobEffectCategory;
|
import net.minecraft.world.effect.MobEffectCategory;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraftforge.event.TickEvent;
|
import net.minecraftforge.event.TickEvent;
|
||||||
@@ -21,9 +22,7 @@ public class FortitudeDefenseEvents {
|
|||||||
player.getCapability(PlayerStatsProvider.PLAYER_STATS).ifPresent(stats -> {
|
player.getCapability(PlayerStatsProvider.PLAYER_STATS).ifPresent(stats -> {
|
||||||
int fortitude = stats.getAttributeLevel("fortitude");
|
int fortitude = stats.getAttributeLevel("fortitude");
|
||||||
if (fortitude <= 0) return;
|
if (fortitude <= 0) return;
|
||||||
double perPoint = 0.004d;
|
double chance = StatEffects.getFortitudeEffectGuardChance(fortitude);
|
||||||
double max = 0.5d;
|
|
||||||
double chance = Math.min(fortitude * perPoint, max);
|
|
||||||
if (chance > 0 && player.getRandom().nextDouble() < chance) {
|
if (chance > 0 && player.getRandom().nextDouble() < chance) {
|
||||||
event.setResult(Event.Result.DENY);
|
event.setResult(Event.Result.DENY);
|
||||||
}
|
}
|
||||||
@@ -38,9 +37,7 @@ public class FortitudeDefenseEvents {
|
|||||||
int fortitude = stats.getAttributeLevel("fortitude");
|
int fortitude = stats.getAttributeLevel("fortitude");
|
||||||
if (fortitude <= 0) return;
|
if (fortitude <= 0) return;
|
||||||
if (player.tickCount % 40 != 0) return;
|
if (player.tickCount % 40 != 0) return;
|
||||||
double perPoint = 0.003d;
|
double chance = StatEffects.getFortitudeCleanseChance(fortitude);
|
||||||
double max = 0.4d;
|
|
||||||
double chance = Math.min(fortitude * perPoint, max);
|
|
||||||
if (chance <= 0) return;
|
if (chance <= 0) return;
|
||||||
if (player.getRandom().nextDouble() >= chance) return;
|
if (player.getRandom().nextDouble() >= chance) return;
|
||||||
player.getActiveEffects().stream()
|
player.getActiveEffects().stream()
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package net.fretux.ascend.event;
|
|||||||
|
|
||||||
import net.fretux.ascend.AscendMod;
|
import net.fretux.ascend.AscendMod;
|
||||||
import net.fretux.ascend.player.PlayerStatsProvider;
|
import net.fretux.ascend.player.PlayerStatsProvider;
|
||||||
|
import net.fretux.ascend.player.StatEffects;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraftforge.event.enchanting.EnchantmentLevelSetEvent;
|
import net.minecraftforge.event.enchanting.EnchantmentLevelSetEvent;
|
||||||
@@ -32,9 +33,7 @@ public class IntelligenceEnchantmentEvents {
|
|||||||
if (intelligence <= 0) return;
|
if (intelligence <= 0) return;
|
||||||
int original = event.getOriginalLevel();
|
int original = event.getOriginalLevel();
|
||||||
if (original <= 0) return;
|
if (original <= 0) return;
|
||||||
double perPoint = 0.005d;
|
double reduction = StatEffects.getIntelligenceAnvilCostReduction(intelligence);
|
||||||
double max = 0.40d;
|
|
||||||
double reduction = Math.min(intelligence * perPoint, max);
|
|
||||||
int newLevel = (int) Math.max(1, Math.floor(original * (1.0d - reduction)));
|
int newLevel = (int) Math.max(1, Math.floor(original * (1.0d - reduction)));
|
||||||
event.setEnchantLevel(newLevel);
|
event.setEnchantLevel(newLevel);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package net.fretux.ascend.event;
|
|||||||
|
|
||||||
import net.fretux.ascend.AscendMod;
|
import net.fretux.ascend.AscendMod;
|
||||||
import net.fretux.ascend.player.PlayerStatsProvider;
|
import net.fretux.ascend.player.PlayerStatsProvider;
|
||||||
|
import net.fretux.ascend.player.StatEffects;
|
||||||
import net.minecraft.world.effect.MobEffectCategory;
|
import net.minecraft.world.effect.MobEffectCategory;
|
||||||
import net.minecraft.world.effect.MobEffectInstance;
|
import net.minecraft.world.effect.MobEffectInstance;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
@@ -24,9 +25,7 @@ public class IntelligencePotionEvents {
|
|||||||
int intel = stats.getAttributeLevel("intelligence");
|
int intel = stats.getAttributeLevel("intelligence");
|
||||||
if (intel <= 0) return;
|
if (intel <= 0) return;
|
||||||
int baseDuration = inst.getDuration();
|
int baseDuration = inst.getDuration();
|
||||||
double durPerPoint = 0.005d;
|
double durBonus = StatEffects.getIntelligenceAnvilCostReduction(intel);
|
||||||
double durMax = 0.5d;
|
|
||||||
double durBonus = Math.min(intel * durPerPoint, durMax);
|
|
||||||
int newDuration = (int) (baseDuration * (1.0d + durBonus));
|
int newDuration = (int) (baseDuration * (1.0d + durBonus));
|
||||||
if (newDuration <= baseDuration) return;
|
if (newDuration <= baseDuration) return;
|
||||||
player.removeEffect(inst.getEffect());
|
player.removeEffect(inst.getEffect());
|
||||||
|
|||||||
@@ -1,25 +1,20 @@
|
|||||||
package net.fretux.ascend.event;
|
package net.fretux.ascend.event;
|
||||||
|
|
||||||
import net.fretux.ascend.AscendMod;
|
import net.fretux.ascend.AscendMod;
|
||||||
import net.fretux.ascend.config.AscendConfig;
|
|
||||||
import net.fretux.ascend.player.PlayerStatsProvider;
|
import net.fretux.ascend.player.PlayerStatsProvider;
|
||||||
|
import net.fretux.ascend.player.StatEffects;
|
||||||
import net.minecraft.world.damagesource.DamageSource;
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.entity.projectile.AbstractArrow;
|
import net.minecraft.world.entity.projectile.AbstractArrow;
|
||||||
import net.minecraft.world.entity.projectile.FireworkRocketEntity;
|
import net.minecraft.world.entity.projectile.FireworkRocketEntity;
|
||||||
import net.minecraft.world.entity.projectile.Projectile;
|
import net.minecraft.world.entity.projectile.Projectile;
|
||||||
import net.minecraft.world.entity.projectile.ThrownTrident;
|
import net.minecraft.world.entity.projectile.ThrownTrident;
|
||||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
|
||||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
|
||||||
@Mod.EventBusSubscriber(modid = AscendMod.MODID)
|
@Mod.EventBusSubscriber(modid = AscendMod.MODID)
|
||||||
public class WeaponMagicScalingEvents {
|
public class WeaponMagicScalingEvents {
|
||||||
private static double getScaling() {
|
|
||||||
return AscendConfig.COMMON.attributeScalingMultiplier.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void onLivingHurt(LivingHurtEvent event) {
|
public static void onLivingHurt(LivingHurtEvent event) {
|
||||||
if (!(event.getSource().getEntity() instanceof Player player)) return;
|
if (!(event.getSource().getEntity() instanceof Player player)) return;
|
||||||
@@ -31,33 +26,12 @@ public class WeaponMagicScalingEvents {
|
|||||||
if (isMagicDamage(event.getSource())) {
|
if (isMagicDamage(event.getSource())) {
|
||||||
int magicScaling = stats.getAttributeLevel("magic_scaling");
|
int magicScaling = stats.getAttributeLevel("magic_scaling");
|
||||||
if (magicScaling > 0) {
|
if (magicScaling > 0) {
|
||||||
double perPoint = 0.005d;
|
double bonusMult = StatEffects.getMagicScalingMultiplier(magicScaling);
|
||||||
double maxBonus = 0.40d;
|
|
||||||
double bonusMult = 1.0d + Math.min(magicScaling * perPoint * getScaling(), maxBonus);
|
|
||||||
modified = (float) (modified * bonusMult);
|
modified = (float) (modified * bonusMult);
|
||||||
}
|
}
|
||||||
} else if (isRangedDamage(event.getSource())) {
|
} else if (isRangedDamage(event.getSource())) {
|
||||||
double rangedMultiplier = getRangedScalingMultiplier(stats, event.getSource());
|
double rangedMultiplier = getRangedScalingMultiplier(stats, event.getSource());
|
||||||
modified = (float) (modified * rangedMultiplier);
|
modified = (float) (modified * rangedMultiplier);
|
||||||
} else {
|
|
||||||
double attackSpeed = 4.0d;
|
|
||||||
if (player.getAttribute(Attributes.ATTACK_SPEED) != null) {
|
|
||||||
attackSpeed = player.getAttribute(Attributes.ATTACK_SPEED).getValue();
|
|
||||||
}
|
|
||||||
String key =
|
|
||||||
(attackSpeed >= 1.8d) ? "light_scaling" :
|
|
||||||
(attackSpeed >= 1.2d) ? "medium_scaling" :
|
|
||||||
"heavy_scaling";
|
|
||||||
int level = stats.getAttributeLevel(key);
|
|
||||||
if (level > 0) {
|
|
||||||
double perPoint =
|
|
||||||
key.equals("light_scaling") ? 0.003d :
|
|
||||||
key.equals("medium_scaling") ? 0.004d :
|
|
||||||
0.005d;
|
|
||||||
double maxBonus = 0.40d;
|
|
||||||
double bonusMult = 1.0d + Math.min(level * perPoint * getScaling(), maxBonus);
|
|
||||||
modified = (float) (modified * bonusMult);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modified != base) {
|
if (modified != base) {
|
||||||
@@ -91,17 +65,13 @@ public class WeaponMagicScalingEvents {
|
|||||||
double bonus = 1.0d;
|
double bonus = 1.0d;
|
||||||
int agility = stats.getAttributeLevel("agility");
|
int agility = stats.getAttributeLevel("agility");
|
||||||
if (agility > 0) {
|
if (agility > 0) {
|
||||||
double perPoint = 0.004d;
|
bonus *= StatEffects.getAgilityRangedDamageMultiplier(agility);
|
||||||
double maxBonus = 0.35d;
|
|
||||||
bonus *= 1.0d + Math.min(agility * perPoint * getScaling(), maxBonus);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source.getDirectEntity() instanceof ThrownTrident) {
|
if (source.getDirectEntity() instanceof ThrownTrident) {
|
||||||
int strength = stats.getAttributeLevel("strength");
|
int strength = stats.getAttributeLevel("strength");
|
||||||
if (strength > 0) {
|
if (strength > 0) {
|
||||||
double perPoint = 0.003d;
|
bonus *= StatEffects.getStrengthTridentDamageMultiplier(strength);
|
||||||
double maxBonus = 0.25d;
|
|
||||||
bonus *= 1.0d + Math.min(strength * perPoint * getScaling(), maxBonus);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,19 +36,13 @@ public final class StatEffects {
|
|||||||
return AscendConfig.COMMON.attributeScalingMultiplier.get();
|
return AscendConfig.COMMON.attributeScalingMultiplier.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static double mediumScalingPercent(int x) {
|
private static double scaledRatio(int level, double perPoint, double max) {
|
||||||
if (x <= 0) return 0.0d;
|
if (level <= 0) return 0.0d;
|
||||||
return Math.pow(3.5d * x, 0.61d);
|
return Math.min(level * perPoint * getScaling(), max);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static double lightScalingPercent(int x) {
|
private static double scalingMultiplier(int level, double perPoint, double maxBonus) {
|
||||||
if (x <= 0) return 0.0d;
|
return 1.0d + scaledRatio(level, perPoint, maxBonus);
|
||||||
return Math.pow(4.0d * x, 0.55d);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static double heavyScalingPercent(int x) {
|
|
||||||
if (x <= 0) return 0.0d;
|
|
||||||
return (0.4d * x) + (5.0d * Math.sin(0.065d * x));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void applyAll(Player player) {
|
public static void applyAll(Player player) {
|
||||||
@@ -68,7 +62,7 @@ public final class StatEffects {
|
|||||||
if (atk != null) {
|
if (atk != null) {
|
||||||
atk.removeModifier(STRENGTH_DAMAGE_UUID);
|
atk.removeModifier(STRENGTH_DAMAGE_UUID);
|
||||||
if (strengthLevel > 0) {
|
if (strengthLevel > 0) {
|
||||||
double dmgBonus = (mediumScalingPercent(strengthLevel) * 0.1d) * getScaling();
|
double dmgBonus = Math.min(strengthLevel * 0.06d * getScaling(), 6.0d);
|
||||||
atk.addTransientModifier(new AttributeModifier(
|
atk.addTransientModifier(new AttributeModifier(
|
||||||
STRENGTH_DAMAGE_UUID,
|
STRENGTH_DAMAGE_UUID,
|
||||||
"Ascend Strength damage bonus",
|
"Ascend Strength damage bonus",
|
||||||
@@ -82,7 +76,7 @@ public final class StatEffects {
|
|||||||
if (kb != null) {
|
if (kb != null) {
|
||||||
kb.removeModifier(STRENGTH_KNOCKBACK_UUID);
|
kb.removeModifier(STRENGTH_KNOCKBACK_UUID);
|
||||||
if (strengthLevel > 0) {
|
if (strengthLevel > 0) {
|
||||||
double kbBonus = (mediumScalingPercent(strengthLevel) * 0.015d) * getScaling();
|
double kbBonus = scaledRatio(strengthLevel, 0.002d, 0.2d);
|
||||||
kb.addTransientModifier(new AttributeModifier(
|
kb.addTransientModifier(new AttributeModifier(
|
||||||
STRENGTH_KNOCKBACK_UUID,
|
STRENGTH_KNOCKBACK_UUID,
|
||||||
"Ascend Strength knockback bonus",
|
"Ascend Strength knockback bonus",
|
||||||
@@ -98,7 +92,7 @@ public final class StatEffects {
|
|||||||
if (move != null) {
|
if (move != null) {
|
||||||
move.removeModifier(AGILITY_SPEED_UUID);
|
move.removeModifier(AGILITY_SPEED_UUID);
|
||||||
if (agilityLevel > 0) {
|
if (agilityLevel > 0) {
|
||||||
double bonus = agilityLevel * 0.0005d * getScaling();
|
double bonus = scaledRatio(agilityLevel, 0.0008d, 0.08d);
|
||||||
move.addTransientModifier(new AttributeModifier(
|
move.addTransientModifier(new AttributeModifier(
|
||||||
AGILITY_SPEED_UUID,
|
AGILITY_SPEED_UUID,
|
||||||
"Ascend Agility speed bonus",
|
"Ascend Agility speed bonus",
|
||||||
@@ -114,7 +108,7 @@ public final class StatEffects {
|
|||||||
if (hp != null) {
|
if (hp != null) {
|
||||||
hp.removeModifier(FORTITUDE_HEALTH_UUID);
|
hp.removeModifier(FORTITUDE_HEALTH_UUID);
|
||||||
if (fortitudeLevel > 0) {
|
if (fortitudeLevel > 0) {
|
||||||
double healthBonus = fortitudeLevel * 0.25d * getScaling();
|
double healthBonus = Math.min(fortitudeLevel * 0.18d * getScaling(), 18.0d);
|
||||||
hp.addTransientModifier(new AttributeModifier(
|
hp.addTransientModifier(new AttributeModifier(
|
||||||
FORTITUDE_HEALTH_UUID,
|
FORTITUDE_HEALTH_UUID,
|
||||||
"Ascend Fortitude health bonus",
|
"Ascend Fortitude health bonus",
|
||||||
@@ -127,7 +121,7 @@ public final class StatEffects {
|
|||||||
if (kbRes != null) {
|
if (kbRes != null) {
|
||||||
kbRes.removeModifier(FORTITUDE_KB_RESIST_UUID);
|
kbRes.removeModifier(FORTITUDE_KB_RESIST_UUID);
|
||||||
if (fortitudeLevel > 0) {
|
if (fortitudeLevel > 0) {
|
||||||
double res = Math.min(0.006d * fortitudeLevel * getScaling(), 0.60d);
|
double res = scaledRatio(fortitudeLevel, 0.003d, 0.3d);
|
||||||
kbRes.addTransientModifier(new AttributeModifier(
|
kbRes.addTransientModifier(new AttributeModifier(
|
||||||
FORTITUDE_KB_RESIST_UUID,
|
FORTITUDE_KB_RESIST_UUID,
|
||||||
"Ascend Fortitude knockback resist",
|
"Ascend Fortitude knockback resist",
|
||||||
@@ -140,22 +134,26 @@ public final class StatEffects {
|
|||||||
|
|
||||||
public static float getWillpowerSanityMultiplier(int willpowerLevel) {
|
public static float getWillpowerSanityMultiplier(int willpowerLevel) {
|
||||||
if (willpowerLevel <= 0) return 1.0f;
|
if (willpowerLevel <= 0) return 1.0f;
|
||||||
double reduction = Math.min(willpowerLevel * 0.005d * getScaling(), 0.5d);
|
double reduction = scaledRatio(willpowerLevel, 0.0035d, 0.35d);
|
||||||
return (float) (1.0d - reduction);
|
return (float) (1.0d - reduction);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float getWillpowerTempoMultiplier(int willpowerLevel) {
|
public static float getWillpowerTempoMultiplier(int willpowerLevel) {
|
||||||
if (willpowerLevel <= 0) return 1.0f;
|
if (willpowerLevel <= 0) return 1.0f;
|
||||||
double bonus = Math.min(willpowerLevel * 0.004d * getScaling(), 0.4d);
|
double bonus = scaledRatio(willpowerLevel, 0.003d, 0.3d);
|
||||||
return (float) (1.0d + bonus);
|
return (float) (1.0d + bonus);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float getWillpowerHealthRegen(int willpowerLevel) {
|
public static float getWillpowerHealthRegen(int willpowerLevel) {
|
||||||
if (willpowerLevel <= 0) return 0.0f;
|
if (willpowerLevel <= 0) return 0.0f;
|
||||||
double bonus = Math.min(willpowerLevel * 0.01d * getScaling(), 2.0d);
|
double bonus = scaledRatio(willpowerLevel, 0.0125d, 1.25d);
|
||||||
return (float) bonus;
|
return (float) bonus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static double getWillpowerCastTimeReduction(int willpowerLevel) {
|
||||||
|
return scaledRatio(willpowerLevel, 0.002d, 0.2d);
|
||||||
|
}
|
||||||
|
|
||||||
public static float getPlayerSanityMultiplier(Player player) {
|
public static float getPlayerSanityMultiplier(Player player) {
|
||||||
return player.getCapability(PlayerStatsProvider.PLAYER_STATS)
|
return player.getCapability(PlayerStatsProvider.PLAYER_STATS)
|
||||||
.map(stats -> getWillpowerSanityMultiplier(stats.getAttributeLevel("willpower")))
|
.map(stats -> getWillpowerSanityMultiplier(stats.getAttributeLevel("willpower")))
|
||||||
@@ -169,52 +167,56 @@ public final class StatEffects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static int getIntelligenceManaBonus(int intelligenceLevel) {
|
public static int getIntelligenceManaBonus(int intelligenceLevel) {
|
||||||
return Math.max(0, intelligenceLevel);
|
return (int) Math.floor(Math.min(intelligenceLevel * 2.0d * getScaling(), 200.0d));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double getIntelligenceAnvilCostReduction(int intelligenceLevel) {
|
public static double getIntelligenceAnvilCostReduction(int intelligenceLevel) {
|
||||||
if (intelligenceLevel <= 0) return 0.0d;
|
return scaledRatio(intelligenceLevel, 0.003d, 0.3d);
|
||||||
double perPoint = 0.005d;
|
|
||||||
double max = 0.40d;
|
|
||||||
return Math.min(intelligenceLevel * perPoint * getScaling(), max);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getIntelligenceKnowledgeGain(int intelligenceLevel, int baseGain) {
|
public static int getIntelligenceKnowledgeGain(int intelligenceLevel, int baseGain) {
|
||||||
if (baseGain <= 0) return baseGain;
|
if (baseGain <= 0) return baseGain;
|
||||||
if (intelligenceLevel <= 0) return baseGain;
|
if (intelligenceLevel <= 0) return baseGain;
|
||||||
double perPoint = 0.005d;
|
double bonus = scaledRatio(intelligenceLevel, 0.003d, 0.3d);
|
||||||
double max = 0.50d;
|
|
||||||
double bonus = Math.min(intelligenceLevel * perPoint * getScaling(), max);
|
|
||||||
int extra = (int) Math.floor(baseGain * bonus);
|
int extra = (int) Math.floor(baseGain * bonus);
|
||||||
return baseGain + Math.max(0, extra);
|
return baseGain + Math.max(0, extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double getCharismaTradeDiscount(int charismaLevel) {
|
public static double getCharismaTradeDiscount(int charismaLevel) {
|
||||||
if (charismaLevel <= 0) return 0.0d;
|
return scaledRatio(charismaLevel, 0.003d, 0.3d);
|
||||||
double perPoint = 0.01d;
|
|
||||||
double max = 0.30d;
|
|
||||||
return Math.min(charismaLevel * perPoint * getScaling(), max);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getCharismaVillagerReputationBonus(int charismaLevel) {
|
public static int getCharismaVillagerReputationBonus(int charismaLevel) {
|
||||||
if (charismaLevel <= 0) return 0;
|
if (charismaLevel <= 0) return 0;
|
||||||
double perPoint = 0.1d;
|
return (int) Math.floor(Math.min(charismaLevel * 0.08d * getScaling(), 8.0d));
|
||||||
double max = 10.0d;
|
|
||||||
return (int) Math.floor(Math.min(charismaLevel * perPoint * getScaling(), max));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double getCharismaAllyHealthBonus(int charismaLevel) {
|
public static double getCharismaAllyHealthBonus(int charismaLevel) {
|
||||||
if (charismaLevel <= 0) return 0.0d;
|
return scaledRatio(charismaLevel, 0.002d, 0.2d);
|
||||||
double perPoint = 0.0025d;
|
|
||||||
double max = 0.25d;
|
|
||||||
return Math.min(charismaLevel * perPoint * getScaling(), max);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double getCharismaAllyDamageBonus(int charismaLevel) {
|
public static double getCharismaAllyDamageBonus(int charismaLevel) {
|
||||||
if (charismaLevel <= 0) return 0.0d;
|
return scaledRatio(charismaLevel, 0.002d, 0.2d);
|
||||||
double perPoint = 0.0020d;
|
}
|
||||||
double max = 0.20d;
|
|
||||||
return Math.min(charismaLevel * perPoint * getScaling(), max);
|
public static double getFortitudeEffectGuardChance(int fortitudeLevel) {
|
||||||
|
return scaledRatio(fortitudeLevel, 0.0025d, 0.25d);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static double getFortitudeCleanseChance(int fortitudeLevel) {
|
||||||
|
return scaledRatio(fortitudeLevel, 0.002d, 0.2d);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static double getAgilityEvasionChance(int agilityLevel) {
|
||||||
|
return scaledRatio(agilityLevel, 0.0015d, 0.15d);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static double getAgilityRangedDamageMultiplier(int agilityLevel) {
|
||||||
|
return 1.0d + Math.min((getLightWeaponScalingMultiplier(agilityLevel) - 1.0d) * 0.7d, 0.25d);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static double getStrengthTridentDamageMultiplier(int strengthLevel) {
|
||||||
|
return 1.0d + Math.min((getWeaponScalingMultiplier(strengthLevel) - 1.0d) * 0.6d, 0.2d);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void applyCharismaAllyBuff(LivingEntity entity, int charismaLevel) {
|
public static void applyCharismaAllyBuff(LivingEntity entity, int charismaLevel) {
|
||||||
@@ -265,27 +267,18 @@ public final class StatEffects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static double getWeaponScalingMultiplier(int scalingLevel) {
|
public static double getWeaponScalingMultiplier(int scalingLevel) {
|
||||||
if (scalingLevel <= 0) return 1.0d;
|
return scalingMultiplier(scalingLevel, 0.0035d, 0.35d);
|
||||||
double percent = mediumScalingPercent(scalingLevel);
|
|
||||||
return 1.0d + (percent / 100.0d);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double getLightWeaponScalingMultiplier(int scalingLevel) {
|
public static double getLightWeaponScalingMultiplier(int scalingLevel) {
|
||||||
if (scalingLevel <= 0) return 1.0d;
|
return scalingMultiplier(scalingLevel, 0.0035d, 0.35d);
|
||||||
double percent = lightScalingPercent(scalingLevel);
|
|
||||||
return 1.0d + (percent / 100.0d);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double getHeavyWeaponScalingMultiplier(int scalingLevel) {
|
public static double getHeavyWeaponScalingMultiplier(int scalingLevel) {
|
||||||
if (scalingLevel <= 0) return 1.0d;
|
return scalingMultiplier(scalingLevel, 0.0035d, 0.35d);
|
||||||
double percent = heavyScalingPercent(scalingLevel);
|
|
||||||
return 1.0d + (percent / 100.0d);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double getMagicScalingMultiplier(int scalingLevel) {
|
public static double getMagicScalingMultiplier(int scalingLevel) {
|
||||||
if (scalingLevel <= 0) return 1.0d;
|
return scalingMultiplier(scalingLevel, 0.0035d, 0.35d);
|
||||||
double perPoint = 0.0075d;
|
|
||||||
double maxBonus = 0.75d;
|
|
||||||
return 1.0d + Math.min(scalingLevel * perPoint, maxBonus);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user