diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java index 3671b6291..c3469805b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java @@ -53,11 +53,11 @@ public class Burning extends Buff implements Hero.Doom { private static final float DURATION = 8f; private float left; - - //for tracking burning of hero items - private int burnIncrement = 0; + private boolean acted = false; //whether the debuff has done any damage at all yet + private int burnIncrement = 0; //for tracking burning of hero items private static final String LEFT = "left"; + private static final String ACTED = "acted"; private static final String BURN = "burnIncrement"; { @@ -69,6 +69,7 @@ public class Burning extends Buff implements Hero.Doom { public void storeInBundle( Bundle bundle ) { super.storeInBundle( bundle ); bundle.put( LEFT, left ); + bundle.put( ACTED, acted ); bundle.put( BURN, burnIncrement ); } @@ -76,6 +77,7 @@ public class Burning extends Buff implements Hero.Doom { public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle(bundle); left = bundle.getFloat( LEFT ); + acted = bundle.getBoolean( ACTED ); burnIncrement = bundle.getInt( BURN ); } @@ -88,9 +90,12 @@ public class Burning extends Buff implements Hero.Doom { @Override public boolean act() { - - if (target.isAlive() && !target.isImmune(getClass())) { - + + if (acted && Dungeon.level.water[target.pos] && !target.flying){ + detach(); + } else if (target.isAlive() && !target.isImmune(getClass())) { + + acted = true; int damage = Random.NormalIntRange( 1, 3 + Dungeon.scalingDepth()/4 ); Buff.detach( target, Chill.class); @@ -192,6 +197,7 @@ public class Burning extends Buff implements Hero.Doom { } } left = duration; + acted = false; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java index 626c0354b..a290bbd5f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java @@ -36,20 +36,25 @@ public class Ooze extends Buff { type = buffType.NEGATIVE; announced = true; } - + private float left; + private boolean acted = false; //whether the debuff has done any damage at all yet + private static final String LEFT = "left"; + private static final String ACTED = "acted"; @Override public void storeInBundle( Bundle bundle ) { super.storeInBundle( bundle ); bundle.put( LEFT, left ); + bundle.put( ACTED, acted ); } @Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle(bundle); left = bundle.getFloat(LEFT); + acted = bundle.getBoolean(ACTED); } @Override @@ -74,17 +79,25 @@ public class Ooze extends Buff { public void set(float left){ this.left = left; + acted = false; } @Override public boolean act() { - if (target.isAlive()) { + //washing away happens before debuff effects if debuff has gotten to act + if (acted && Dungeon.level.water[target.pos] && !target.flying){ + detach(); + } else if (target.isAlive()) { + if (Dungeon.scalingDepth() > 5) { target.damage(1 + Dungeon.scalingDepth() / 5, this); + acted = true; } else if (Dungeon.scalingDepth() == 5){ target.damage(1, this); //1 dmg per turn vs Goo + acted = true; } else if (Random.Int(2) == 0) { target.damage(1, this); //0.5 dmg per turn in sewers + acted = true; } if (!target.isAlive() && target == Dungeon.hero) { @@ -99,7 +112,7 @@ public class Ooze extends Buff { } else { detach(); } - if (Dungeon.level.water[target.pos]) { + if (Dungeon.level.water[target.pos] && !target.flying){ detach(); } return true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index c51c42078..be2274b1b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -35,10 +35,12 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.WellWater; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Awareness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicalSight; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MindVision; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Ooze; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.RevealedArea; @@ -1096,6 +1098,16 @@ public abstract class Level implements Bundlable { if (!ch.flying){ + //we call act here instead of detach in case the debuffs haven't managed to deal dmg once yet + if (map[ch.pos] == Terrain.WATER){ + if (ch.buff(Burning.class) != null){ + ch.buff(Burning.class).act(); + } + if (ch.buff(Ooze.class) != null){ + ch.buff(Ooze.class).act(); + } + } + if ( (map[ch.pos] == Terrain.GRASS || map[ch.pos] == Terrain.EMBERS) && ch == Dungeon.hero && Dungeon.hero.hasTalent(Talent.REJUVENATING_STEPS) && ch.buff(Talent.RejuvenatingStepsCooldown.class) == null){