From b8178b15b72bf4e2d778963569972961eec7d96f Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 14 Aug 2020 18:20:23 -0400 Subject: [PATCH] v0.8.2a: fixed the following bugs: - pickaxe not getting bloodied by killing bats in rare cases - dried rose ghost healing not respecting level lock limits - wraiths refusing to spawn over traps despite not activating them - clobber knockback not closing doors --- .../actors/buffs/Combo.java | 28 ++++++------------- .../actors/mobs/Wraith.java | 2 +- .../items/artifacts/DriedRose.java | 3 +- .../items/quest/Pickaxe.java | 22 +++++++++++++-- 4 files changed, 31 insertions(+), 24 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java index 2b41d517c..6a5dd81bd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java @@ -30,6 +30,9 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfBlastWave; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon; +import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -271,25 +274,12 @@ public class Combo extends Buff implements ActionIndicator.Action { switch (type){ case CLOBBER: if (enemy.isAlive()){ - if (!enemy.properties().contains(Char.Property.IMMOVABLE)){ - for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { - int ofs = PathFinder.NEIGHBOURS8[i]; - if (enemy.pos - target.pos == ofs) { - int newPos = enemy.pos + ofs; - if ((Dungeon.level.passable[newPos] || Dungeon.level.avoid[newPos]) - && Actor.findChar( newPos ) == null - && (!Char.hasProp(enemy, Char.Property.LARGE) || Dungeon.level.openSpace[newPos])) { - - Actor.addDelayed( new Pushing( enemy, enemy.pos, newPos ), -1 ); - - enemy.pos = newPos; - Dungeon.level.occupyCell(enemy ); - - } - break; - } - } - } + //trace a ballistica to our target (which will also extend past them + Ballistica trajectory = new Ballistica(target.pos, enemy.pos, Ballistica.STOP_TARGET); + //trim it to just be the part that goes past them + trajectory = new Ballistica(trajectory.collisionPos, trajectory.path.get(trajectory.path.size()-1), Ballistica.PROJECTILE); + //knock them back along that ballistica + WandOfBlastWave.throwChar(enemy, trajectory, 2, true, false); Buff.prolong(enemy, Vertigo.class, Random.NormalIntRange(1, 4)); } break; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Wraith.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Wraith.java index 0f2e911c9..c4923f14e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Wraith.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Wraith.java @@ -103,7 +103,7 @@ public class Wraith extends Mob { } public static Wraith spawnAt( int pos ) { - if (Dungeon.level.passable[pos] && Actor.findChar( pos ) == null) { + if (!Dungeon.level.solid[pos] && Actor.findChar( pos ) == null) { Wraith w = new Wraith(); w.adjustStats( Dungeon.depth ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java index b31700cb1..cc2d29646 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java @@ -359,7 +359,8 @@ public class DriedRose extends Artifact { defaultAction = AC_DIRECT; //heals to full over 1000 turns - if (ghost.HP < ghost.HT) { + LockedFloor lock = target.buff(LockedFloor.class); + if (ghost.HP < ghost.HT && (lock == null || lock.regenOn())) { partialCharge += (ghost.HT / 1000f) * RingOfEnergy.artifactChargeMultiplier(target); updateQuickslot(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/Pickaxe.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/Pickaxe.java index fa2d80ae6..0be509c52 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/Pickaxe.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/Pickaxe.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.quest; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Bat; @@ -150,9 +151,24 @@ public class Pickaxe extends Weapon { @Override public int proc( Char attacker, Char defender, int damage ) { - if (!bloodStained && defender instanceof Bat && (defender.HP <= damage)) { - bloodStained = true; - updateQuickslot(); + if (!bloodStained && defender instanceof Bat) { + Actor.add(new Actor() { + + { + actPriority = VFX_PRIO; + } + + @Override + protected boolean act() { + if (!defender.isAlive()){ + bloodStained = true; + updateQuickslot(); + } + + Actor.remove(this); + return true; + } + }); } return damage; }