v2.5.1: fixed shopkeepers sometimes not clearing gasses when harmed
This commit is contained in:
+13
@@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge;
|
||||
@@ -110,6 +111,14 @@ public class Shopkeeper extends NPC {
|
||||
turnsSinceHarmed = 0;
|
||||
yell(Messages.get(this, "warn"));
|
||||
|
||||
//use a new actor as we can't clear the gas while we're in the middle of processing it
|
||||
Actor.add(new Actor() {
|
||||
{
|
||||
actPriority = VFX_PRIO;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean act() {
|
||||
//cleanses all harmful blobs in the shop
|
||||
ArrayList<Blob> blobs = new ArrayList<>();
|
||||
for (Class c : new BlobImmunity().immunities()){
|
||||
@@ -138,6 +147,10 @@ public class Shopkeeper extends NPC {
|
||||
|
||||
}
|
||||
}
|
||||
Actor.remove(this);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
//There is a 1 turn buffer before more damage/debuffs make the shopkeeper flee
|
||||
//This is mainly to prevent stacked effects from causing an instant flee
|
||||
|
||||
Reference in New Issue
Block a user