v2.3.0: fixed mimics not dropping loot if ally buffed from hiding

This commit is contained in:
Evan Debenham
2024-01-02 23:44:33 -05:00
parent 025ba0e12d
commit 95fb84bd75

View File

@@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Statistics;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
@@ -50,7 +51,7 @@ public abstract class AllyBuff extends Buff{
//for when applying an ally buff should also cause that enemy to give exp/loot as if they had died
//consider that chars with the ally alignment do not drop items or award exp on death
public static void affectAndLoot(Mob enemy, Hero hero, Class<?extends AllyBuff> buffCls){
boolean wasEnemy = enemy.alignment == Char.Alignment.ENEMY;
boolean wasEnemy = enemy.alignment == Char.Alignment.ENEMY || enemy instanceof Mimic;
Buff.affect(enemy, buffCls);
if (enemy.buff(buffCls) != null && wasEnemy){