v2.0.0: fixed cursed items being non-removable when in lost invent
This commit is contained in:
@@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LostInventory;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
|
||||||
@@ -116,7 +117,9 @@ public abstract class EquipableItem extends Item {
|
|||||||
|
|
||||||
public boolean doUnequip( Hero hero, boolean collect, boolean single ) {
|
public boolean doUnequip( Hero hero, boolean collect, boolean single ) {
|
||||||
|
|
||||||
if (cursed && hero.buff(MagicImmune.class) == null) {
|
if (cursed
|
||||||
|
&& hero.buff(MagicImmune.class) == null
|
||||||
|
&& (hero.buff(LostInventory.class) == null || keptThoughLostInvent)) {
|
||||||
GLog.w(Messages.get(EquipableItem.class, "unequip_cursed"));
|
GLog.w(Messages.get(EquipableItem.class, "unequip_cursed"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user