v2.0.2: fixed downed ghoul sprites not updating on observe

This commit is contained in:
Evan Debenham
2023-04-11 12:35:31 -04:00
parent 7042919648
commit b69240ce4f
2 changed files with 12 additions and 2 deletions
@@ -238,8 +238,6 @@ public class Ghoul extends Mob {
@Override
public boolean act() {
ghoul.sprite.visible = Dungeon.level.heroFOV[ghoul.pos];
if (target.alignment != ghoul.alignment){
detach();
return true;
@@ -302,6 +300,12 @@ public class Ghoul extends Mob {
return true;
}
public void updateVisibility(){
if (ghoul != null && ghoul.sprite != null){
ghoul.sprite.visible = Dungeon.level.heroFOV[ghoul.pos];
}
}
public void set(int turns, Ghoul ghoul){
this.ghoul = ghoul;
turnsToRevive = turns;
@@ -39,6 +39,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.DemonSpawner;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Ghoul;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Snake;
import com.shatteredpixel.shatteredpixeldungeon.effects.BannerSprites;
@@ -1243,6 +1244,11 @@ public class GameScene extends PixelScene {
if (scene != null) {
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
if (mob.sprite != null) mob.sprite.visible = Dungeon.level.heroFOV[mob.pos];
if (mob instanceof Ghoul){
for (Ghoul.GhoulLifeLink link : mob.buffs(Ghoul.GhoulLifeLink.class)){
link.updateVisibility();
}
}
}
}
}