v2.5.3: vampiric no longer triggers on allies or neutral characters

This commit is contained in:
Evan Debenham
2024-09-22 17:45:08 -04:00
parent c8ab576320
commit fdbcb877d7

View File

@@ -22,6 +22,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic;
import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
@@ -42,7 +43,9 @@ public class Vampiric extends Weapon.Enchantment {
healChance *= procChanceMultiplier(attacker);
if (Random.Float() < healChance){
if (Random.Float() < healChance
&& attacker.alignment != defender.alignment
&& (defender.alignment != Char.Alignment.NEUTRAL || defender instanceof Mimic)){
float powerMulti = Math.max(1f, healChance);