v2.5.0: minions that die with bosses no longer add to encounter count
This commit is contained in:
@@ -353,6 +353,7 @@ public class CrystalSpire extends Mob {
|
||||
}
|
||||
}
|
||||
|
||||
Bestiary.skipCountingEncounters = true;
|
||||
for (Char ch : Actor.chars()){
|
||||
if (fieldOfView[ch.pos]) {
|
||||
if (ch instanceof CrystalGuardian) {
|
||||
@@ -363,6 +364,7 @@ public class CrystalSpire extends Mob {
|
||||
}
|
||||
}
|
||||
}
|
||||
Bestiary.skipCountingEncounters = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfForce;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfLightning;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Bestiary;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.CityBossLevel;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
@@ -497,13 +498,11 @@ public class DwarfKing extends Mob {
|
||||
for (Summoning s : buffs(Summoning.class)) {
|
||||
s.detach();
|
||||
}
|
||||
for (Mob m : Dungeon.level.mobs.toArray(new Mob[0])) {
|
||||
if (m.alignment == alignment) {
|
||||
if (m instanceof Ghoul || m instanceof Monk || m instanceof Warlock || m instanceof Golem) {
|
||||
m.die(null);
|
||||
}
|
||||
}
|
||||
Bestiary.skipCountingEncounters = true;
|
||||
for (Mob m : getSubjects()) {
|
||||
m.die(null);
|
||||
}
|
||||
Bestiary.skipCountingEncounters = false;
|
||||
for (Buff b: buffs()){
|
||||
if (b instanceof LifeLink){
|
||||
b.detach();
|
||||
@@ -568,9 +567,11 @@ public class DwarfKing extends Mob {
|
||||
|
||||
Dungeon.level.unseal();
|
||||
|
||||
Bestiary.skipCountingEncounters = true;
|
||||
for (Mob m : getSubjects()){
|
||||
m.die(null);
|
||||
}
|
||||
Bestiary.skipCountingEncounters = false;
|
||||
|
||||
LloydsBeacon beacon = Dungeon.hero.belongings.getItem(LloydsBeacon.class);
|
||||
if (beacon != null) {
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Bestiary;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Rotberry;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.RotHeartSprite;
|
||||
@@ -95,11 +96,13 @@ public class RotHeart extends Mob {
|
||||
@Override
|
||||
public void destroy() {
|
||||
super.destroy();
|
||||
Bestiary.skipCountingEncounters = true;
|
||||
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[Dungeon.level.mobs.size()])){
|
||||
if (mob instanceof RotLasher){
|
||||
mob.die(null);
|
||||
}
|
||||
}
|
||||
Bestiary.skipCountingEncounters = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.TargetedCell;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.PurpleParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Bestiary;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
@@ -514,11 +515,13 @@ public class YogDzewa extends Mob {
|
||||
@Override
|
||||
public void die( Object cause ) {
|
||||
|
||||
Bestiary.skipCountingEncounters = true;
|
||||
for (Mob mob : (Iterable<Mob>)Dungeon.level.mobs.clone()) {
|
||||
if (mob instanceof Larva || mob instanceof YogRipper || mob instanceof YogEye || mob instanceof YogScorpio) {
|
||||
mob.die( cause );
|
||||
}
|
||||
}
|
||||
Bestiary.skipCountingEncounters = false;
|
||||
|
||||
updateVisibility(Dungeon.level);
|
||||
|
||||
|
||||
@@ -304,11 +304,17 @@ public enum Bestiary {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//used primarily when bosses are killed and need to clean up their minions
|
||||
public static boolean skipCountingEncounters = false;
|
||||
|
||||
public static void countEncounter(Class<?> cls){
|
||||
countEncounters(cls, 1);
|
||||
}
|
||||
|
||||
public static void countEncounters(Class<?> cls, int encounters){
|
||||
if (skipCountingEncounters){
|
||||
return;
|
||||
}
|
||||
if (classConversions.containsKey(cls)){
|
||||
cls = classConversions.get(cls);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user