Buff necrotic
Now heals between 0 and (level * 10%) of the damage dealt. Meaning necrotic 9 deals up to 90% of the damage dealt
@@ -14,12 +14,12 @@ public class NecroticModifier extends Modifier {
@Override
public int afterLivingHit(IModifierToolStack tool, int level, LivingEntity attacker, LivingEntity target, float damageDealt, boolean isCritical, float cooldown) {
if (cooldown > 0.9 && damageDealt > 0) {
- // every level gives a +10% chance of healing you 10%
- if (attacker.getRNG().nextFloat() < level * 0.1) {
- attacker.heal(0.1f * damageDealt);
+ // heals between 0 and (level) * 10% of damage dealt
+ float heal = attacker.getRNG().nextFloat() * damageDealt * level * 0.1f;
+ attacker.heal(heal);
+ if (heal > 2) {
attacker.world.playSound(null, attacker.getPosX(), attacker.getPosY(), attacker.getPosZ(), SoundEvents.ENTITY_ZOMBIE_INFECT, SoundCategory.PLAYERS, 1.0f, 1.0f);
}
-
}
return 0;
}
