v1.3.0: fixed hostile champions being on/off slightly affecting levelgen

This commit is contained in:
Evan Debenham
2022-06-24 10:44:29 -04:00
parent f3ee024217
commit b3ab6b1bed
2 changed files with 14 additions and 10 deletions

View File

@@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
@@ -100,15 +101,20 @@ public abstract class ChampionEnemy extends Buff {
Dungeon.mobsToChampion--;
if (Dungeon.mobsToChampion <= 0){
Class<?extends ChampionEnemy> buffCls;
switch (Random.Int(6)){
case 0: default: Buff.affect(m, Blazing.class); break;
case 1: Buff.affect(m, Projecting.class); break;
case 2: Buff.affect(m, AntiMagic.class); break;
case 3: Buff.affect(m, Giant.class); break;
case 4: Buff.affect(m, Blessed.class); break;
case 5: Buff.affect(m, Growing.class); break;
case 0: default: buffCls = Blazing.class; break;
case 1: buffCls = Projecting.class; break;
case 2: buffCls = AntiMagic.class; break;
case 3: buffCls = Giant.class; break;
case 4: buffCls = Blessed.class; break;
case 5: buffCls = Growing.class; break;
}
if (Dungeon.isChallenged(Challenges.CHAMPION_ENEMIES)) {
Buff.affect(m, buffCls);
m.state = m.WANDERING;
}
m.state = m.WANDERING;
}
}

View File

@@ -483,9 +483,7 @@ public abstract class Level implements Bundlable {
}
Mob m = Reflection.newInstance(mobsToSpawn.remove(0));
if (Dungeon.isChallenged(Challenges.CHAMPION_ENEMIES)){
ChampionEnemy.rollForChampion(m);
}
ChampionEnemy.rollForChampion(m);
return m;
}