v2.4.0: fixed armband steal tracker not persisting in some cases

This commit is contained in:
Evan Debenham
2024-04-19 13:57:21 -04:00
parent 345b6fe79d
commit 6a19ea87cc
2 changed files with 11 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Rat;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.MasterThievesArmband;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
@@ -146,6 +147,11 @@ public class Ratmogrify extends ArmorAbility {
}
}
MasterThievesArmband.StolenTracker stealTracker = ch.buff(MasterThievesArmband.StolenTracker.class);
if (stealTracker != null){
ch.remove(stealTracker);
}
Actor.remove( ch );
ch.sprite.killAndErase();
Dungeon.level.mobs.remove(ch);
@@ -153,6 +159,9 @@ public class Ratmogrify extends ArmorAbility {
for (ChampionEnemy champ : champBuffs){
ch.add(champ);
}
if (stealTracker != null) {
ch.add(stealTracker);
}
GameScene.add(rat);

View File

@@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.duelist.Ch
import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText;
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.MasterThievesArmband;
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
@@ -185,6 +186,7 @@ public class Ghoul extends Mob {
Buff.prolong(this, SacrificialFire.Marked.class, timesDowned*5);
} else if (buff instanceof AllyBuff
|| buff instanceof ChampionEnemy
|| buff instanceof MasterThievesArmband.StolenTracker
|| buff instanceof DwarfKing.KingDamager) {
//don't remove
} else {