From 1940663bb756e494b08bf28864c445300febe545 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 22 Aug 2020 12:51:09 -0400 Subject: [PATCH] v0.8.2c: standardized invisibility dispelling, always after an effect --- .../shatteredpixeldungeon/items/armor/HuntressArmor.java | 4 ++-- .../shatteredpixeldungeon/items/armor/MageArmor.java | 2 +- .../shatteredpixeldungeon/items/armor/WarriorArmor.java | 3 +-- .../items/scrolls/InventoryScroll.java | 2 -- .../shatteredpixeldungeon/items/scrolls/Scroll.java | 2 ++ .../items/scrolls/ScrollOfLullaby.java | 3 --- .../items/scrolls/ScrollOfMagicMapping.java | 2 -- .../items/scrolls/ScrollOfMirrorImage.java | 3 --- .../shatteredpixeldungeon/items/scrolls/ScrollOfRage.java | 3 --- .../items/scrolls/ScrollOfRecharging.java | 2 -- .../items/scrolls/ScrollOfRemoveCurse.java | 2 -- .../items/scrolls/ScrollOfRetribution.java | 3 --- .../items/scrolls/ScrollOfTeleportation.java | 2 -- .../items/scrolls/ScrollOfTerror.java | 2 -- .../items/scrolls/exotic/ScrollOfAffection.java | 2 -- .../items/scrolls/exotic/ScrollOfAntiMagic.java | 3 --- .../items/scrolls/exotic/ScrollOfConfusion.java | 2 -- .../items/scrolls/exotic/ScrollOfDivination.java | 8 +++----- .../items/scrolls/exotic/ScrollOfEnchantment.java | 3 --- .../items/scrolls/exotic/ScrollOfForesight.java | 2 -- .../items/scrolls/exotic/ScrollOfMysticalEnergy.java | 2 -- .../items/scrolls/exotic/ScrollOfPetrification.java | 2 -- .../items/scrolls/exotic/ScrollOfPolymorph.java | 2 -- .../items/scrolls/exotic/ScrollOfPrismaticImage.java | 2 -- .../items/scrolls/exotic/ScrollOfPsionicBlast.java | 2 -- .../shatteredpixeldungeon/items/spells/TargetedSpell.java | 2 +- .../shatteredpixeldungeon/items/stones/Runestone.java | 2 ++ .../shatteredpixeldungeon/items/wands/Wand.java | 8 ++------ 28 files changed, 14 insertions(+), 63 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/HuntressArmor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/HuntressArmor.java index a6e435d03..1c031c92d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/HuntressArmor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/HuntressArmor.java @@ -47,7 +47,6 @@ public class HuntressArmor extends ClassArmor { @Override public void doSpecial() { - Invisibility.dispel(); charge -= 35; updateQuickslot(); @@ -64,6 +63,7 @@ public class HuntressArmor extends ClassArmor { curUser.attack( targets.get( this ) ); targets.remove( this ); if (targets.isEmpty()) { + Invisibility.dispel(); curUser.spendAndNext( curUser.attackDelay() ); } } @@ -80,7 +80,7 @@ public class HuntressArmor extends ClassArmor { GLog.w( Messages.get(this, "no_enemies") ); return; } - + curUser.sprite.zap( curUser.pos ); curUser.busy(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/MageArmor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/MageArmor.java index b69c177d2..1d1f5990c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/MageArmor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/MageArmor.java @@ -44,7 +44,6 @@ public class MageArmor extends ClassArmor { @Override public void doSpecial() { - Invisibility.dispel(); charge -= 35; updateQuickslot(); @@ -59,6 +58,7 @@ public class MageArmor extends ClassArmor { curUser.spend( Actor.TICK ); curUser.sprite.operate( curUser.pos ); + Invisibility.dispel(); curUser.busy(); curUser.sprite.emitter().start( ElmoParticle.FACTORY, 0.025f, 20 ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/WarriorArmor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/WarriorArmor.java index 8a35ee8fa..e8ced6c11 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/WarriorArmor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/WarriorArmor.java @@ -65,8 +65,6 @@ public class WarriorArmor extends ClassArmor { if (Actor.findChar( cell ) != null && cell != curUser.pos) cell = route.path.get(route.dist-1); - - Invisibility.dispel(); charge -= 35; updateQuickslot(); @@ -90,6 +88,7 @@ public class WarriorArmor extends ClassArmor { CellEmitter.center(dest).burst(Speck.factory(Speck.DUST), 10); Camera.main.shake(2, 0.5f); + Invisibility.dispel(); curUser.spendAndNext(LEAP_TIME); } }); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/InventoryScroll.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/InventoryScroll.java index 9ad694b56..6e89212ce 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/InventoryScroll.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/InventoryScroll.java @@ -22,7 +22,6 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls; import com.shatteredpixel.shatteredpixeldungeon.Assets; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -86,7 +85,6 @@ public abstract class InventoryScroll extends Scroll { ((InventoryScroll)curItem).readAnimation(); Sample.INSTANCE.play( Assets.Sounds.READ ); - Invisibility.dispel(); } else if (identifiedByUse && !((Scroll)curItem).anonymous) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java index 70d816bfa..c0deca9db 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.items.Item; @@ -196,6 +197,7 @@ public abstract class Scroll extends Item { protected void readAnimation() { curUser.spend( TIME_TO_READ ); curUser.busy(); + Invisibility.dispel(); ((HeroSprite)curUser.sprite).read(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfLullaby.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfLullaby.java index e36dba87d..9dcd9fc2f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfLullaby.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfLullaby.java @@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -44,7 +43,6 @@ public class ScrollOfLullaby extends Scroll { curUser.sprite.centerEmitter().start( Speck.factory( Speck.NOTE ), 0.3f, 5 ); Sample.INSTANCE.play( Assets.Sounds.LULLABY ); - Invisibility.dispel(); for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { if (Dungeon.level.heroFOV[mob.pos]) { @@ -58,7 +56,6 @@ public class ScrollOfLullaby extends Scroll { GLog.i( Messages.get(this, "sooth") ); setKnown(); - readAnimation(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicMapping.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicMapping.java index 2ba3d81c9..4d4970ce5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicMapping.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicMapping.java @@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Awareness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MindVision; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; @@ -82,7 +81,6 @@ public class ScrollOfMagicMapping extends Scroll { SpellSprite.show( curUser, SpellSprite.MAP ); Sample.INSTANCE.play( Assets.Sounds.READ ); - Invisibility.dispel(); setKnown(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java index 2b676755f..05e12b0fd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java @@ -26,7 +26,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -55,7 +54,6 @@ public class ScrollOfMirrorImage extends Scroll { } Sample.INSTANCE.play( Assets.Sounds.READ ); - Invisibility.dispel(); readAnimation(); } @@ -68,7 +66,6 @@ public class ScrollOfMirrorImage extends Scroll { setKnown(); Sample.INSTANCE.play( Assets.Sounds.READ ); - Invisibility.dispel(); readAnimation(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRage.java index e1c62cf67..d34980cdd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRage.java @@ -26,7 +26,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -55,7 +54,6 @@ public class ScrollOfRage extends Scroll { curUser.sprite.centerEmitter().start( Speck.factory( Speck.SCREAM ), 0.3f, 3 ); Sample.INSTANCE.play( Assets.Sounds.CHALLENGE ); - Invisibility.dispel(); readAnimation(); } @@ -72,7 +70,6 @@ public class ScrollOfRage extends Scroll { curUser.sprite.centerEmitter().start( Speck.factory( Speck.SCREAM ), 0.3f, 3 ); Sample.INSTANCE.play( Assets.Sounds.READ ); - Invisibility.dispel(); readAnimation(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRecharging.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRecharging.java index d983cacb8..4b63fa850 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRecharging.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRecharging.java @@ -24,7 +24,6 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging; import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.EnergyParticle; @@ -47,7 +46,6 @@ public class ScrollOfRecharging extends Scroll { Sample.INSTANCE.play( Assets.Sounds.READ ); Sample.INSTANCE.play( Assets.Sounds.CHARGEUP ); - Invisibility.dispel(); GLog.i( Messages.get(this, "surge") ); SpellSprite.show( curUser, SpellSprite.CHARGE ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRemoveCurse.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRemoveCurse.java index 228c970e8..0ab6bc70e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRemoveCurse.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRemoveCurse.java @@ -24,7 +24,6 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Degrade; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle; @@ -54,7 +53,6 @@ public class ScrollOfRemoveCurse extends InventoryScroll { } } Sample.INSTANCE.play( Assets.Sounds.READ ); - Invisibility.dispel(); doRead(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRetribution.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRetribution.java index f8f3b4607..add5b13c1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRetribution.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRetribution.java @@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -48,7 +47,6 @@ public class ScrollOfRetribution extends Scroll { float power = Math.min( 4f, 4.45f*hpPercent); Sample.INSTANCE.play( Assets.Sounds.BLAST ); - Invisibility.dispel(); for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { if (Dungeon.level.heroFOV[mob.pos]) { @@ -75,7 +73,6 @@ public class ScrollOfRetribution extends Scroll { GameScene.flash( 0xFFFFFF ); Sample.INSTANCE.play( Assets.Sounds.BLAST ); - Invisibility.dispel(); //scales from 3x to 5x power, maxing at ~20% HP float hpPercent = (curUser.HT - curUser.HP)/(float)(curUser.HT); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java index 326681141..a452375c0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java @@ -25,7 +25,6 @@ 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.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.levels.RegularLevel; @@ -58,7 +57,6 @@ public class ScrollOfTeleportation extends Scroll { public void doRead() { Sample.INSTANCE.play( Assets.Sounds.READ ); - Invisibility.dispel(); teleportPreferringUnseen( curUser ); setKnown(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTerror.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTerror.java index ac7233115..2f2bedc69 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTerror.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTerror.java @@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; @@ -46,7 +45,6 @@ public class ScrollOfTerror extends Scroll { new Flare( 5, 32 ).color( 0xFF0000, true ).show( curUser.sprite, 2f ); Sample.INSTANCE.play( Assets.Sounds.READ ); - Invisibility.dispel(); int count = 0; Mob affected = null; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfAffection.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfAffection.java index 8665b020f..2652a82fc 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfAffection.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfAffection.java @@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -42,7 +41,6 @@ public class ScrollOfAffection extends ExoticScroll { curUser.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 ); Sample.INSTANCE.play( Assets.Sounds.CHARMS ); - Invisibility.dispel(); for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { if (Dungeon.level.heroFOV[mob.pos]) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfAntiMagic.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfAntiMagic.java index 189f3e336..562d665f7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfAntiMagic.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfAntiMagic.java @@ -22,7 +22,6 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune; import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -36,8 +35,6 @@ public class ScrollOfAntiMagic extends ExoticScroll { @Override public void doRead() { - Invisibility.dispel(); - Buff.affect( curUser, MagicImmune.class, MagicImmune.DURATION ); new Flare( 5, 32 ).color( 0xFF0000, true ).show( curUser.sprite, 2f ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfConfusion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfConfusion.java index afa751777..e4c58b6f4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfConfusion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfConfusion.java @@ -26,7 +26,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; @@ -52,7 +51,6 @@ public class ScrollOfConfusion extends ExoticScroll { curUser.sprite.centerEmitter().start( Speck.factory( Speck.SCREAM ), 0.3f, 3 ); Sample.INSTANCE.play( Assets.Sounds.READ ); - Invisibility.dispel(); readAnimation(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfDivination.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfDivination.java index af86fdf6f..d08f98a42 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfDivination.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfDivination.java @@ -22,7 +22,6 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic; import com.shatteredpixel.shatteredpixeldungeon.Assets; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.effects.Identification; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; @@ -55,11 +54,7 @@ public class ScrollOfDivination extends ExoticScroll { curUser.sprite.parent.add( new Identification( curUser.sprite.center().offset( 0, -16 ) ) ); - readAnimation(); - setKnown(); - Sample.INSTANCE.play( Assets.Sounds.READ ); - Invisibility.dispel(); HashSet> potions = Potion.getUnknown(); HashSet> scrolls = Scroll.getUnknown(); @@ -122,6 +117,9 @@ public class ScrollOfDivination extends ExoticScroll { } GameScene.show(new WndDivination( IDed )); + + readAnimation(); + setKnown(); } private class WndDivination extends Window { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfEnchantment.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfEnchantment.java index 745da5927..a34d96f51 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfEnchantment.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfEnchantment.java @@ -22,7 +22,6 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic; import com.shatteredpixel.shatteredpixeldungeon.Assets; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.effects.Enchanting; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; @@ -81,7 +80,6 @@ public class ScrollOfEnchantment extends ExoticScroll { ((ScrollOfEnchantment)curItem).readAnimation(); Sample.INSTANCE.play( Assets.Sounds.READ ); - Invisibility.dispel(); Enchanting.show(curUser, item); } } @@ -118,7 +116,6 @@ public class ScrollOfEnchantment extends ExoticScroll { ((ScrollOfEnchantment)curItem).readAnimation(); Sample.INSTANCE.play( Assets.Sounds.READ ); - Invisibility.dispel(); Enchanting.show(curUser, item); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfForesight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfForesight.java index 64569325a..12f9e6d47 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfForesight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfForesight.java @@ -24,7 +24,6 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Foresight; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; @@ -39,7 +38,6 @@ public class ScrollOfForesight extends ExoticScroll { public void doRead() { SpellSprite.show( curUser, SpellSprite.MAP ); Sample.INSTANCE.play( Assets.Sounds.READ ); - Invisibility.dispel(); Buff.affect(curUser, Foresight.class, Foresight.DURATION); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfMysticalEnergy.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfMysticalEnergy.java index 3e447dafb..8669fe372 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfMysticalEnergy.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfMysticalEnergy.java @@ -24,7 +24,6 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ArtifactRecharge; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -44,7 +43,6 @@ public class ScrollOfMysticalEnergy extends ExoticScroll { Sample.INSTANCE.play( Assets.Sounds.READ ); Sample.INSTANCE.play( Assets.Sounds.CHARGEUP ); - Invisibility.dispel(); SpellSprite.show( curUser, SpellSprite.CHARGE ); setKnown(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPetrification.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPetrification.java index 6686177cb..42d9bdd56 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPetrification.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPetrification.java @@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; @@ -42,7 +41,6 @@ public class ScrollOfPetrification extends ExoticScroll { public void doRead() { new Flare( 5, 32 ).color( 0xFF0000, true ).show( curUser.sprite, 2f ); Sample.INSTANCE.play( Assets.Sounds.READ ); - Invisibility.dispel(); for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { if (mob.alignment != Char.Alignment.ALLY && Dungeon.level.heroFOV[mob.pos]) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPolymorph.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPolymorph.java index 7208d4eca..a6639bd64 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPolymorph.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPolymorph.java @@ -24,7 +24,6 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Sheep; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; @@ -47,7 +46,6 @@ public class ScrollOfPolymorph extends ExoticScroll { new Flare( 5, 32 ).color( 0xFFFFFF, true ).show( curUser.sprite, 2f ); Sample.INSTANCE.play( Assets.Sounds.READ ); - Invisibility.dispel(); for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { if (mob.alignment != Char.Alignment.ALLY && Dungeon.level.heroFOV[mob.pos]) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPrismaticImage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPrismaticImage.java index c1578089b..caf011110 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPrismaticImage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPrismaticImage.java @@ -24,7 +24,6 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PrismaticGuard; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.PrismaticImage; @@ -57,7 +56,6 @@ public class ScrollOfPrismaticImage extends ExoticScroll { setKnown(); Sample.INSTANCE.play( Assets.Sounds.READ ); - Invisibility.dispel(); readAnimation(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPsionicBlast.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPsionicBlast.java index fcb53224a..464aae913 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPsionicBlast.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPsionicBlast.java @@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -46,7 +45,6 @@ public class ScrollOfPsionicBlast extends ExoticScroll { GameScene.flash( 0xFFFFFF ); Sample.INSTANCE.play( Assets.Sounds.BLAST ); - Invisibility.dispel(); int targets = 0; for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/TargetedSpell.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/TargetedSpell.java index 72f2af1e9..5579fa62f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/TargetedSpell.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/TargetedSpell.java @@ -82,12 +82,12 @@ public abstract class TargetedSpell extends Spell { QuickSlotButton.target(Actor.findChar(cell)); curUser.busy(); - Invisibility.dispel(); curSpell.fx(shot, new Callback() { public void call() { curSpell.affectTarget(shot, curUser); curSpell.detach( curUser.belongings.backpack ); + Invisibility.dispel(); curSpell.updateQuickslot(); curUser.spendAndNext( 1f ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/Runestone.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/Runestone.java index f8fd7b0e8..a03dca043 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/Runestone.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/Runestone.java @@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.stones; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -38,6 +39,7 @@ public abstract class Runestone extends Item { super.onThrow( cell ); } else { activate(cell); + Invisibility.dispel(); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java index 921c58f07..a99b6b66f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java @@ -335,6 +335,8 @@ public abstract class Wand extends Item { if (buff != null && buff.level() > super.buffedLvl()){ buff.detach(); } + + Invisibility.dispel(); if (curUser.heroClass == HeroClass.MAGE) levelKnown = true; updateQuickslot(); @@ -408,11 +410,6 @@ public abstract class Wand extends Item { usesLeftToID = bundle.getInt( USES_LEFT_TO_ID ); availableUsesToID = bundle.getInt( AVAILABLE_USES ); - //pre-0.7.2 saves - if (bundle.contains( "unfamiliarity" )){ - usesLeftToID = Math.min(10, bundle.getInt( "unfamiliarity" )); - availableUsesToID = USES_TO_ID/2f; - } curCharges = bundle.getInt( CUR_CHARGES ); curChargeKnown = bundle.getBoolean( CUR_CHARGE_KNOWN ); partialCharge = bundle.getFloat( PARTIALCHARGE ); @@ -465,7 +462,6 @@ public abstract class Wand extends Item { if (curWand.tryToZap(curUser, target)) { curUser.busy(); - Invisibility.dispel(); if (curWand.cursed){ if (!curWand.cursedKnown){