v2.0.0: fixed errors with new ghoul logic and sacrificial fire
This commit is contained in:
@@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.SacrificialFire;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy;
|
||||||
@@ -150,9 +151,9 @@ public class Ghoul extends Mob {
|
|||||||
Ghoul nearby = GhoulLifeLink.searchForHost(this);
|
Ghoul nearby = GhoulLifeLink.searchForHost(this);
|
||||||
if (nearby != null){
|
if (nearby != null){
|
||||||
beingLifeLinked = true;
|
beingLifeLinked = true;
|
||||||
|
timesDowned++;
|
||||||
Actor.remove(this);
|
Actor.remove(this);
|
||||||
Dungeon.level.mobs.remove( this );
|
Dungeon.level.mobs.remove( this );
|
||||||
timesDowned++;
|
|
||||||
Buff.append(nearby, GhoulLifeLink.class).set(timesDowned*5, this);
|
Buff.append(nearby, GhoulLifeLink.class).set(timesDowned*5, this);
|
||||||
((GhoulSprite)sprite).crumple();
|
((GhoulSprite)sprite).crumple();
|
||||||
return;
|
return;
|
||||||
@@ -176,10 +177,14 @@ public class Ghoul extends Mob {
|
|||||||
protected synchronized void onRemove() {
|
protected synchronized void onRemove() {
|
||||||
if (beingLifeLinked) {
|
if (beingLifeLinked) {
|
||||||
for (Buff buff : buffs()) {
|
for (Buff buff : buffs()) {
|
||||||
//ally buffs, champion, and king damager are preserved when removed via life link
|
if (buff instanceof SacrificialFire.Marked){
|
||||||
if (!(buff instanceof AllyBuff)
|
//don't remove and postpone so marked stays on
|
||||||
&& (!(buff instanceof ChampionEnemy))
|
Buff.prolong(this, SacrificialFire.Marked.class, timesDowned*5);
|
||||||
&& !(buff instanceof DwarfKing.KingDamager)) {
|
} else if (buff instanceof AllyBuff
|
||||||
|
|| buff instanceof ChampionEnemy
|
||||||
|
|| buff instanceof DwarfKing.KingDamager) {
|
||||||
|
//don't remove
|
||||||
|
} else {
|
||||||
buff.detach();
|
buff.detach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -251,6 +256,7 @@ public class Ghoul extends Mob {
|
|||||||
|
|
||||||
if (Dungeon.level.pit[ghoul.pos]){
|
if (Dungeon.level.pit[ghoul.pos]){
|
||||||
super.detach();
|
super.detach();
|
||||||
|
ghoul.beingLifeLinked = false;
|
||||||
ghoul.die(this);
|
ghoul.die(this);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -313,6 +319,7 @@ public class Ghoul extends Mob {
|
|||||||
attachTo(newHost);
|
attachTo(newHost);
|
||||||
timeToNow();
|
timeToNow();
|
||||||
} else {
|
} else {
|
||||||
|
ghoul.beingLifeLinked = false;
|
||||||
ghoul.die(this);
|
ghoul.die(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user