diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java index 97241bb19..8953c0e49 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java @@ -249,6 +249,8 @@ public class Preparation extends Buff implements ActionIndicator.Action { AttackLevel lvl = AttackLevel.getLvl(turnsInvis); boolean[] passable = Dungeon.level.passable.clone(); + //need to consider enemy cell as passable in case they are on a trap or chasm + passable[cell] = true; PathFinder.buildDistanceMap(Dungeon.hero.pos, passable, lvl.blinkDistance+1); if (PathFinder.distance[cell] == Integer.MAX_VALUE){ GLog.w(Messages.get(Preparation.class, "out_of_reach")); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Stone.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Stone.java index 9af73455f..6ceec1356 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Stone.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Stone.java @@ -39,7 +39,7 @@ public class Stone extends Armor.Glyph { float hitChance; if (evasion >= accuracy){ - hitChance = 1f - (1f - (accuracy/evasion))/2f; + hitChance = (accuracy/evasion)/2f; } else { hitChance = 1f - (evasion/accuracy)/2f; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java index 91ff41540..39f5d1742 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java @@ -303,5 +303,21 @@ public class CloakOfShadows extends Artifact { updateQuickslot(); super.detach(); } + + private static final String TURNSTOCOST = "turnsToCost"; + + @Override + public void storeInBundle(Bundle bundle) { + super.storeInBundle(bundle); + + bundle.put( TURNSTOCOST , turnsToCost); + } + + @Override + public void restoreFromBundle(Bundle bundle) { + super.restoreFromBundle(bundle); + + turnsToCost = bundle.getInt( TURNSTOCOST ); + } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java index 5492bfed7..dbd556fb8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java @@ -197,7 +197,7 @@ public class TimekeepersHourglass extends Artifact { if (bundle.contains( BUFF )){ Bundle buffBundle = bundle.getBundle( BUFF ); - if (buffBundle.contains( timeFreeze.PARTIALTIME )) + if (buffBundle.contains( timeFreeze.PRESSES )) activeBuff = new timeFreeze(); else activeBuff = new timeStasis(); @@ -290,15 +290,15 @@ public class TimekeepersHourglass extends Artifact { type = buffType.POSITIVE; } - float partialTime = 0f; + float turnsToCost = 0f; - ArrayList presses = new ArrayList(); + ArrayList presses = new ArrayList<>(); public void processTime(float time){ - partialTime += time; + turnsToCost -= time; - while (partialTime >= 2f){ - partialTime -= 2f; + while (turnsToCost < 0f){ + turnsToCost += 2f; charge --; } @@ -337,11 +337,6 @@ public class TimekeepersHourglass extends Artifact { for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) if (mob.paralysed <= 0) mob.sprite.remove(CharSprite.State.PARALYSED); GameScene.freezeEmitters = false; - - while (partialTime > 0f){ - partialTime -= 2f; - charge --; - } updateQuickslot(); super.detach(); @@ -351,7 +346,7 @@ public class TimekeepersHourglass extends Artifact { } private static final String PRESSES = "presses"; - private static final String PARTIALTIME = "partialtime"; + private static final String TURNSTOCOST = "turnsToCost"; @Override public void storeInBundle(Bundle bundle) { @@ -362,7 +357,7 @@ public class TimekeepersHourglass extends Artifact { values[i] = presses.get(i); bundle.put( PRESSES , values ); - bundle.put( PARTIALTIME , partialTime ); + bundle.put( TURNSTOCOST , turnsToCost); } @Override @@ -373,7 +368,7 @@ public class TimekeepersHourglass extends Artifact { for (int value : values) presses.add(value); - partialTime = bundle.getFloat( PARTIALTIME ); + turnsToCost = bundle.getFloat( TURNSTOCOST ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java index c7395ffa4..1de07d6d8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java @@ -226,6 +226,10 @@ public class WandOfCorruption extends Wand { buff.detach(); } } + if (enemy.alignment == Char.Alignment.ENEMY){ + enemy.rollToDropLoot(); + } + Buff.affect(enemy, Corruption.class); Statistics.enemiesSlain++; @@ -237,9 +241,6 @@ public class WandOfCorruption extends Wand { } else { curUser.earnExp(0, enemy.getClass()); } - if (enemy.alignment == Char.Alignment.ENEMY){ - enemy.rollToDropLoot(); - } } else { Buff.affect(enemy, Doom.class); }