From e1bfd1bbbc3b1e94ad2defc79df5544d5e6601fa Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 7 Dec 2018 16:30:31 -0500 Subject: [PATCH] v0.7.1: bugfixes: - fixed spirit bow not working with ring of sharpshooting - fixed curse infusion not cursing spirit bow - removed boomerang from the catalog - fixed missile weapons being cursable in various situations --- .../shatteredpixeldungeon/Bones.java | 16 +++++++++------- .../items/spells/CurseInfusion.java | 4 ++-- .../items/weapon/SpiritBow.java | 7 +++++-- .../shatteredpixeldungeon/journal/Catalog.java | 5 ++--- .../levels/traps/CursingTrap.java | 3 ++- .../shatteredpixeldungeon/windows/WndBag.java | 2 +- 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Bones.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Bones.java index f0d4c4f3e..f1ee31826 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Bones.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Bones.java @@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Gold; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon; import com.watabou.utils.Bundle; import com.watabou.utils.FileUtils; import com.watabou.utils.Random; @@ -159,16 +160,17 @@ public class Bones { } } - if (item.isUpgradable()) { + if (item.isUpgradable() && !(item instanceof MissileWeapon)) { item.cursed = true; item.cursedKnown = true; - if (item.isUpgradable()) { - //caps at +3 - if (item.level() > 3) { - item.degrade( item.level() - 3 ); - } - item.levelKnown = false; + } + + if (item.isUpgradable()) { + //caps at +3 + if (item.level() > 3) { + item.degrade( item.level() - 3 ); } + item.levelKnown = false; } item.reset(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/CurseInfusion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/CurseInfusion.java index 1e38f4a7b..3b6921f0e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/CurseInfusion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/CurseInfusion.java @@ -28,9 +28,9 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; import com.shatteredpixel.shatteredpixeldungeon.items.quest.MetalShard; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Boomerang; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; import com.watabou.noosa.audio.Sample; @@ -49,7 +49,7 @@ public class CurseInfusion extends InventorySpell { Sample.INSTANCE.play(Assets.SND_CURSED); item.cursed = true; - if (item instanceof MeleeWeapon || item instanceof Boomerang) { + if (item instanceof MeleeWeapon || item instanceof SpiritBow) { Weapon w = (Weapon) item; Class curr = null; if (w.enchantment != null) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/SpiritBow.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/SpiritBow.java index c5f52b482..fc6ebb0fd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/SpiritBow.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/SpiritBow.java @@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfFuror; +import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector; @@ -125,12 +126,12 @@ public class SpiritBow extends Weapon { @Override public int min(int lvl) { - return 1 + Dungeon.hero.lvl/6; + return 1 + Dungeon.hero.lvl/6 + RingOfSharpshooting.levelDamageBonus(Dungeon.hero); } @Override public int max(int lvl) { - return 6 + Dungeon.hero.lvl/3; + return 6 + Dungeon.hero.lvl/3 + 2*RingOfSharpshooting.levelDamageBonus(Dungeon.hero); } private int targetPos; @@ -264,6 +265,8 @@ public class SpiritBow extends Weapon { if (enemy == null){ user.spendAndNext(castDelay(user, dst)); + sniperSpecial = false; + flurryCount = -1; return; } QuickSlotButton.target(enemy); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Catalog.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Catalog.java index 58e874217..661157484 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Catalog.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Catalog.java @@ -116,7 +116,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Sword; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.WarHammer; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Whip; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.WornShortsword; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Boomerang; import com.watabou.utils.Bundle; import java.util.ArrayList; @@ -155,7 +154,7 @@ public enum Catalog { WEAPONS.seen.put( Knuckles.class, false); WEAPONS.seen.put( Dagger.class, false); WEAPONS.seen.put( MagesStaff.class, false); - WEAPONS.seen.put( Boomerang.class, false); + //WEAPONS.seen.put( Boomerang.class, false); WEAPONS.seen.put( Shortsword.class, false); WEAPONS.seen.put( HandAxe.class, false); WEAPONS.seen.put( Spear.class, false); @@ -253,7 +252,7 @@ public enum Catalog { SCROLLS.seen.put( ScrollOfTerror.class, false); SCROLLS.seen.put( ScrollOfLullaby.class, false); SCROLLS.seen.put( ScrollOfRage.class, false); - SCROLLS.seen.put( ScrollOfRetribution.class, false); + SCROLLS.seen.put( ScrollOfRetribution.class, false); SCROLLS.seen.put( ScrollOfTransmutation.class, false); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/CursingTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/CursingTrap.java index a594a74f7..10452044f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/CursingTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/CursingTrap.java @@ -34,6 +34,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.KindofMisc; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Boomerang; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; @@ -59,7 +60,7 @@ public class CursingTrap extends Trap { Heap heap = Dungeon.level.heaps.get( pos ); if (heap != null){ for (Item item : heap.items){ - if (item.isUpgradable()) + if (item.isUpgradable() && !(item instanceof MissileWeapon)) curse(item); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java index 61e971456..042f1dea7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java @@ -390,7 +390,7 @@ public class WndBag extends WndTabbed { mode == Mode.UPGRADEABLE && item.isUpgradable() || mode == Mode.UNIDENTIFED && !item.isIdentified() || mode == Mode.UNCURSABLE && ScrollOfRemoveCurse.uncursable(item) || - mode == Mode.CURSABLE && ((item instanceof EquipableItem && !(item instanceof MissileWeapon)) || item instanceof Boomerang || item instanceof Wand) || + mode == Mode.CURSABLE && ((item instanceof EquipableItem && !(item instanceof MissileWeapon)) || item instanceof Wand) || mode == Mode.QUICKSLOT && (item.defaultAction != null) || mode == Mode.WEAPON && (item instanceof MeleeWeapon || item instanceof Boomerang) || mode == Mode.ARMOR && (item instanceof Armor) ||