v2.0.0: fixed fly swarms never splitting on ascent
This commit is contained in:
@@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy;
|
||||
@@ -83,7 +84,10 @@ public class Swarm extends Mob {
|
||||
@Override
|
||||
public int defenseProc( Char enemy, int damage ) {
|
||||
|
||||
if (HP >= damage + 2) {
|
||||
//accounting for reduced damage on ascension
|
||||
int effectiveDmg = (int)Math.ceil(damage / AscensionChallenge.statModifier(this));
|
||||
|
||||
if (HP >= effectiveDmg + 2) {
|
||||
ArrayList<Integer> candidates = new ArrayList<>();
|
||||
|
||||
int[] neighbours = {pos + 1, pos - 1, pos + Dungeon.level.width(), pos - Dungeon.level.width()};
|
||||
@@ -99,7 +103,7 @@ public class Swarm extends Mob {
|
||||
if (candidates.size() > 0) {
|
||||
|
||||
Swarm clone = split();
|
||||
clone.HP = (HP - damage) / 2;
|
||||
clone.HP = (HP - effectiveDmg) / 2;
|
||||
clone.pos = Random.element( candidates );
|
||||
clone.state = clone.HUNTING;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user