From 12f545dff9fdab9201ac666aed601737cf3dfef6 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 27 Mar 2018 21:12:23 -0400 Subject: [PATCH] v0.6.4: bugfixes: - fixed ethereal chains losing charge on load - fixed missile weapons being lost in some cases - fixed warden being able to exploit rotberry --- .../items/artifacts/Artifact.java | 3 ++- .../items/weapon/missiles/MissileWeapon.java | 11 +++++++++-- .../shatteredpixeldungeon/plants/Rotberry.java | 13 +++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java index 4e16dcf56..4c5dc2b2e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java @@ -236,7 +236,8 @@ public class Artifact extends KindofMisc { public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle(bundle); exp = bundle.getInt( EXP ); - charge = Math.min( chargeCap, bundle.getInt( CHARGE )); + if (chargeCap > 0) charge = Math.min( chargeCap, bundle.getInt( CHARGE )); + else charge = bundle.getInt( CHARGE ); partialCharge = bundle.getFloat( PARTIALCHARGE ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java index c422098d2..9e08260a8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java @@ -152,8 +152,15 @@ abstract public class MissileWeapon extends Weapon { durability -= durabilityPerUse(); } if (durability > 0){ - if (enemy.isAlive() && sticky) Buff.affect(enemy, PinCushion.class).stick(this); - else Dungeon.level.drop( this, enemy.pos).sprite.drop(); + //attempt to stick the missile weapon to the enemy, just drop it if we can't. + if (enemy.isAlive() && sticky) { + PinCushion p = Buff.affect(enemy, PinCushion.class); + if (p.target == enemy){ + p.stick(this); + return; + } + } + Dungeon.level.drop( this, enemy.pos ).sprite.drop(); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Rotberry.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Rotberry.java index 7a7c6dbb9..8dfb9ee3e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Rotberry.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Rotberry.java @@ -22,6 +22,8 @@ package com.shatteredpixel.shatteredpixeldungeon.plants; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; +import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -35,6 +37,17 @@ public class Rotberry extends Plant { public void activate() { Dungeon.level.drop( new Seed(), pos ).sprite.drop(); } + + @Override + public void wither() { + Dungeon.level.uproot( pos ); + + if (Dungeon.level.heroFOV[pos]) { + CellEmitter.get( pos ).burst( LeafParticle.GENERAL, 6 ); + } + + //no warden benefit + } public static class Seed extends Plant.Seed { {