diff --git a/src/main/java/xyz/nearmisses/patience/mc_rebalance/enchant_effects/CollapseEffect.java b/src/main/java/xyz/nearmisses/patience/mc_rebalance/enchant_effects/CollapseEffect.java index f3a93cd..708a400 100644 --- a/src/main/java/xyz/nearmisses/patience/mc_rebalance/enchant_effects/CollapseEffect.java +++ b/src/main/java/xyz/nearmisses/patience/mc_rebalance/enchant_effects/CollapseEffect.java @@ -40,16 +40,24 @@ public record CollapseEffect(LevelBasedValue amount) implements EnchantmentEntit for (Holder viableEffect : viableEffects) { if (enemy.hasEffect(viableEffect)) { MobEffectInstance effect = enemy.getEffect(viableEffect); + float cap = this.amount.calculate(level); // This is not the same way it's calculated in the Wither Skeleton file. This is because the Wither Skeleton version is wither-specific. // Until we figure out the appropriate balance for these effects in a zero-immunity context (and I figure out a better way to simplify the maths), this should be easier to account for. // It's also still reasonably interesting because it creates a choice between Crumble for Wither effect and poison splash potions, // as well as punishing loading too many effects at once due to their local iframes. // AKA: this minimises the odds that players start 1-tapping each other. - float damage = (effect.getAmplifier() + 1) * effect.getDuration() + 0.05f; - enemy.hurt(enemy.damageSources().magic(), Math.min(damage, this.amount.calculate(level))); + float damage = (effect.getAmplifier() + 1) * effect.getDuration() * 0.05f; + + enemy.hurt(enemy.damageSources().magic(), Math.min(damage, cap)); enemy.invulnerableTime = 0; enemy.removeEffect(effect.getEffect()); + + if(damage>cap){ + int spentDuration = (int) ( cap * 20 / (effect.getAmplifier()+1) ); + MobEffectInstance newEffect = new MobEffectInstance(effect.getEffect(), effect.getDuration()-spentDuration, effect.getAmplifier()); + enemy.addEffect(newEffect, context.owner()); + } } } } diff --git a/src/main/resources/data/mc_rebalance/enchantment/collapse.json b/src/main/resources/data/mc_rebalance/enchantment/collapse.json index cb89bc2..4e352e4 100644 --- a/src/main/resources/data/mc_rebalance/enchantment/collapse.json +++ b/src/main/resources/data/mc_rebalance/enchantment/collapse.json @@ -26,7 +26,7 @@ "enchanted": "attacker", "effect": { "type": "mc_rebalance:collapse", - "amount": 20.0 + "amount": 12.0 } } ]