diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java index e8e067a39..0bd7232af 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -630,7 +630,9 @@ public abstract class Char extends Actor { if (Dungeon.level.adjacent( step, pos ) && buff( Vertigo.class ) != null) { sprite.interruptMotion(); int newPos = pos + PathFinder.NEIGHBOURS8[Random.Int( 8 )]; - if (!(Dungeon.level.passable[newPos] || Dungeon.level.avoid[newPos]) || Actor.findChar( newPos ) != null) + if (!(Dungeon.level.passable[newPos] || Dungeon.level.avoid[newPos]) + || (properties.contains(Property.LARGE) && !Dungeon.level.openSpace[pos]) + || Actor.findChar( newPos ) != null) return; else { sprite.move(pos, newPos); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfHealth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfHealth.java index bf9e20ea4..44caf4db2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfHealth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfHealth.java @@ -70,14 +70,21 @@ public class WaterOfHealth extends WellWater { if (item instanceof DewVial && !((DewVial)item).isFull()) { ((DewVial)item).fill(); CellEmitter.get( pos ).start( Speck.factory( Speck.HEALING ), 0.4f, 4 ); - } else if (ScrollOfRemoveCurse.uncurse( null, item )){ - CellEmitter.get( pos ).start( ShadowParticle.UP, 0.05f, 10 ); - } if ( item instanceof Ankh && !(((Ankh) item).isBlessed())){ + Sample.INSTANCE.play( Assets.SND_DRINK ); + return item; + } else if ( item instanceof Ankh && !(((Ankh) item).isBlessed())){ ((Ankh) item).bless(); CellEmitter.get( pos ).start(Speck.factory(Speck.LIGHT), 0.2f, 3); + Sample.INSTANCE.play( Assets.SND_DRINK ); + return item; + } else if (ScrollOfRemoveCurse.uncursable(item)) { + if (ScrollOfRemoveCurse.uncurse( null, item )){ + CellEmitter.get( pos ).start( ShadowParticle.UP, 0.05f, 10 ); + } + Sample.INSTANCE.play( Assets.SND_DRINK ); + return item; } - Sample.INSTANCE.play( Assets.SND_DRINK ); - return item; + return null; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Brute.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Brute.java index d2115fb82..acbd2a095 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Brute.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Brute.java @@ -79,9 +79,9 @@ public class Brute extends Mob { } @Override - public boolean isAlive() { + public synchronized boolean isAlive() { if (HP > 0){ - return true; + return true; } else { if (!hasRaged){ triggerEnrage(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Golem.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Golem.java index e46a79fb1..b59d336a5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Golem.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Golem.java @@ -183,7 +183,8 @@ public class Golem extends Mob { int oldPos = pos; - if (enemyTeleCooldown <= 0 && Random.Int(100/distance(enemy)) == 0){ + if (enemyTeleCooldown <= 0 && Random.Int(100/distance(enemy)) == 0 + && !Char.hasProp(enemy, Property.IMMOVABLE)){ if (sprite != null && (sprite.visible || enemy.sprite.visible)) { sprite.zap( enemy.pos ); return false; @@ -196,7 +197,7 @@ public class Golem extends Mob { spend( 1 / speed() ); return moveSprite( oldPos, pos ); - } else if (enemyTeleCooldown <= 0) { + } else if (enemyTeleCooldown <= 0 && !Char.hasProp(enemy, Property.IMMOVABLE)) { if (sprite != null && (sprite.visible || enemy.sprite.visible)) { sprite.zap( enemy.pos ); return false; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Statue.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Statue.java index b06bbc48b..efba8f21f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Statue.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Statue.java @@ -21,6 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs; +import com.shatteredpixel.shatteredpixeldungeon.Challenges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; @@ -168,7 +169,7 @@ public class Statue extends Mob { } public static Statue random(){ - if (Random.Int(10) == 0){ + if (Random.Int(10) == 0 && !Dungeon.isChallenged(Challenges.NO_ARMOR)){ return new ArmoredStatue(); } else { return new Statue(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java index 4f54768e1..34c267e02 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java @@ -290,7 +290,7 @@ public class YogDzewa extends Mob { if (phase < 4 && HP <= HT - 300*phase){ HP = HT - 300*phase; - Dungeon.level.viewDistance--; + Dungeon.level.viewDistance = Math.max(1, Dungeon.level.viewDistance-1); if (Dungeon.hero.buff(Light.class) == null){ Dungeon.hero.viewDistance = Dungeon.level.viewDistance; } 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 ab0c6fcb8..3da34cd12 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -759,7 +759,7 @@ public abstract class Level implements Bundlable { heap.drop(item); } - if (Dungeon.level != null) { + if (Dungeon.level != null && ShatteredPixelDungeon.scene() instanceof GameScene) { pressCell( cell ); } 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 e77cbe7f8..a351728ab 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewCavesBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewCavesBossLevel.java @@ -183,6 +183,10 @@ public class NewCavesBossLevel extends Level { @Override public int randomRespawnCell( Char ch ) { + //this check is mainly here for DM-300, to prevent an infinite loop + if (Char.hasProp(ch, Char.Property.LARGE) && map[entrance] != Terrain.ENTRANCE){ + return -1; + } int cell; do { cell = entrance + PathFinder.NEIGHBOURS8[Random.Int(8)]; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewPrisonBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewPrisonBossLevel.java index 16487d9d1..de6de4fe8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewPrisonBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewPrisonBossLevel.java @@ -134,17 +134,6 @@ public class NewPrisonBossLevel extends Level { triggered = bundle.getBooleanArray(TRIGGERED); - //compatibility with pre-0.7.5a saves - if (state == State.WON){ - int cell = pointToCell(endStart); - int i = 0; - while (cell < length()){ - System.arraycopy(endMap, i, map, cell, 14); - i += 14; - cell += width(); - } - exit = pointToCell(levelExit); - } } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java index b4e44065a..0065d592a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java @@ -217,6 +217,7 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip //returns where the center of this sprite will be after it completes any motion in progress public PointF destinationCenter(){ + PosTweener motion = this.motion; if (motion != null){ return new PointF(motion.end.x + width()/2f, motion.end.y + height()/2f); } else {