From 633e3d3db5f94cbb760c144dcc63a3d2eb1d9860 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 20 Jan 2020 13:42:51 -0500 Subject: [PATCH] v0.8.0: fixes/tweaks: - DM-300 is now immune to sleep - Pylons now knock away items ontop of them - fixed further rare DM-300 crash issues --- .../shatteredpixeldungeon/actors/mobs/NewDM300.java | 5 +++++ .../shatteredpixeldungeon/actors/mobs/Pylon.java | 10 ++++++++++ .../levels/NewCavesBossLevel.java | 3 +++ 3 files changed, 18 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java index e3b0bc0a5..72946155b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java @@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Sleep; import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; @@ -535,6 +536,10 @@ public class NewDM300 extends Mob { return desc; } + { + immunities.add(Sleep.class); + } + public static class FallingRocks extends Blob { { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Pylon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Pylon.java index c482b90ea..a6fe13a3a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Pylon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Pylon.java @@ -36,6 +36,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Lightning; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SparkParticle; +import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.levels.NewCavesBossLevel; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; @@ -71,6 +72,15 @@ public class Pylon extends Mob { protected boolean act() { spend(TICK); + Heap heap = Dungeon.level.heaps.get( pos ); + if (heap != null) { + int n; + do { + n = pos + PathFinder.NEIGHBOURS8[Random.Int( 8 )]; + } while (!Dungeon.level.passable[n] && !Dungeon.level.avoid[n]); + Dungeon.level.drop( heap.pickUp(), n ).sprite.drop( pos ); + } + if (alignment == Alignment.NEUTRAL){ return true; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewCavesBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewCavesBossLevel.java index fb1229e18..7cd779075 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewCavesBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewCavesBossLevel.java @@ -753,6 +753,9 @@ public class NewCavesBossLevel extends Level { energySourceSprite = c.sprite; } } + if (energySourceSprite == null){ + return; + } } float dist = Math.abs(energySourceSprite.x - x) + Math.abs(energySourceSprite.y - y);