diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Drowsy.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Drowsy.java index c15413a10..0a4834927 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Drowsy.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Drowsy.java @@ -48,10 +48,10 @@ public class Drowsy extends Buff { @Override public boolean act(){ - Buff.affect(target, MagicalSleep.class); + Buff.affect(target, MagicalSleep.class); - detach(); - return true; + detach(); + return true; } @Override 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 39c766fb5..6fcd9dd6f 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 @@ -36,7 +36,7 @@ public abstract class InventoryScroll extends Scroll { protected WndBag.Mode mode = WndBag.Mode.ALL; @Override - protected void doRead() { + public void doRead() { if (!isKnown()) { setKnown(); 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 89bd57a90..f347bee5f 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 @@ -147,7 +147,10 @@ public abstract class Scroll extends Item { } } - abstract protected void doRead(); + public abstract void doRead(); + + //currently only used in scrolls owned by the unstable spellbook + public abstract void empoweredRead(); protected void readAnimation() { curUser.spend( TIME_TO_READ ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfIdentify.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfIdentify.java index 30d2673d4..126d73dd1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfIdentify.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfIdentify.java @@ -21,12 +21,17 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls; +import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.effects.Identification; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; +import com.watabou.noosa.audio.Sample; +import com.watabou.utils.Random; + +import java.util.ArrayList; public class ScrollOfIdentify extends InventoryScroll { @@ -37,6 +42,24 @@ public class ScrollOfIdentify extends InventoryScroll { bones = true; } + @Override + public void empoweredRead() { + ArrayList unIDed = new ArrayList<>(); + + for( Item i : curUser.belongings){ + if (!i.isIdentified()){ + unIDed.add(i); + } + } + + if (unIDed.size() > 1) { + Random.element(unIDed).identify(); + Sample.INSTANCE.play( Assets.SND_TELEPORT ); + } + + doRead(); + } + @Override protected void onItemSelected( Item item ) { 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 597650565..b0bdc8481 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 @@ -40,7 +40,7 @@ public class ScrollOfLullaby extends Scroll { } @Override - protected void doRead() { + public void doRead() { curUser.sprite.centerEmitter().start( Speck.factory( Speck.NOTE ), 0.3f, 5 ); Sample.INSTANCE.play( Assets.SND_LULLABY ); @@ -62,6 +62,17 @@ public class ScrollOfLullaby extends Scroll { readAnimation(); } + @Override + public void empoweredRead() { + doRead(); + for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { + if (Level.fieldOfView[mob.pos]) { + Buff drowsy = mob.buff(Drowsy.class); + if (drowsy != null) drowsy.act(); + } + } + } + @Override public int price() { return isKnown() ? 40 * quantity : super.price(); 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 d18faf215..ceae52ad6 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 @@ -23,7 +23,10 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls; 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; import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; @@ -41,7 +44,7 @@ public class ScrollOfMagicMapping extends Scroll { } @Override - protected void doRead() { + public void doRead() { int length = Dungeon.level.length(); int[] map = Dungeon.level.map; @@ -86,6 +89,14 @@ public class ScrollOfMagicMapping extends Scroll { readAnimation(); } + @Override + public void empoweredRead() { + doRead(); + Buff.affect( curUser, MindVision.class, MindVision.DURATION ); + Buff.affect( curUser, Awareness.class, Awareness.DURATION ); + Dungeon.observe(); + } + @Override public int price() { return isKnown() ? 40 * quantity : super.price(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicalInfusion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicalInfusion.java index f78f8dae8..793f25238 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicalInfusion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicalInfusion.java @@ -55,6 +55,11 @@ public class ScrollOfMagicalInfusion extends InventoryScroll { curUser.sprite.emitter().start(Speck.factory(Speck.UP), 0.2f, 3); Enchanting.show(curUser, item); } + + @Override + public void empoweredRead() { + //does nothing for now, this should never happen. + } @Override public int price() { 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 c9c0875f7..6ccb6d399 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 @@ -23,11 +23,15 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls; import com.shatteredpixel.shatteredpixeldungeon.Assets; 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.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.watabou.noosa.audio.Sample; +import com.watabou.utils.Bundle; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; @@ -42,18 +46,45 @@ public class ScrollOfMirrorImage extends Scroll { private static final int NIMAGES = 3; @Override - protected void doRead() { + public void doRead() { + int spawnedImages = spawnImages(curUser, NIMAGES); + + if (spawnedImages > 0) { + setKnown(); + } + + Sample.INSTANCE.play( Assets.SND_READ ); + Invisibility.dispel(); + + readAnimation(); + } + + @Override + public void empoweredRead() { + //spawns 2 images right away, delays 4 of them, 6 total. + new DelayedImageSpawner(6 - spawnImages(curUser, 2), 2, 3).attachTo(curUser); + + setKnown(); + + Sample.INSTANCE.play( Assets.SND_READ ); + Invisibility.dispel(); + + readAnimation(); + } + + //returns the number of images spawned + public static int spawnImages( Hero hero, int nImages ){ ArrayList respawnPoints = new ArrayList(); for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { - int p = curUser.pos + PathFinder.NEIGHBOURS8[i]; + int p = hero.pos + PathFinder.NEIGHBOURS8[i]; if (Actor.findChar( p ) == null && (Level.passable[p] || Level.avoid[p])) { respawnPoints.add( p ); } } - int nImages = NIMAGES; + int spawned = 0; while (nImages > 0 && respawnPoints.size() > 0) { int index = Random.index( respawnPoints ); @@ -64,16 +95,74 @@ public class ScrollOfMirrorImage extends Scroll { respawnPoints.remove( index ); nImages--; + spawned++; } - if (nImages < NIMAGES) { - setKnown(); + return spawned; + } + + public static class DelayedImageSpawner extends Buff{ + + public DelayedImageSpawner(){ + this(NIMAGES, NIMAGES, 1); } - Sample.INSTANCE.play( Assets.SND_READ ); - Invisibility.dispel(); - - readAnimation(); + public DelayedImageSpawner( int total, int perRound, float delay){ + super(); + totImages = total; + imPerRound = perRound; + this.delay = delay; + } + + private int totImages; + private int imPerRound; + private float delay; + + @Override + public boolean attachTo(Char target) { + if (super.attachTo(target)){ + spend(delay); + return true; + } else { + return false; + } + } + + @Override + public boolean act() { + + int spawned = spawnImages((Hero)target, Math.min(totImages, imPerRound)); + + totImages -= spawned; + + if (totImages <0){ + detach(); + } else { + spend( delay ); + } + + return true; + } + + private static final String TOTAL = "images"; + private static final String PER_ROUND = "per_round"; + private static final String DELAY = "delay"; + + @Override + public void storeInBundle(Bundle bundle) { + super.storeInBundle(bundle); + bundle.put( TOTAL, totImages ); + bundle.put( PER_ROUND, imPerRound ); + bundle.put( DELAY, delay ); + } + + @Override + public void restoreFromBundle(Bundle bundle) { + super.restoreFromBundle(bundle); + totImages = bundle.getInt( TOTAL ); + imPerRound = bundle.getInt( PER_ROUND ); + delay = bundle.getFloat( DELAY ); + } } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfPsionicBlast.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfPsionicBlast.java index 9681076f2..526621274 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfPsionicBlast.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfPsionicBlast.java @@ -44,7 +44,7 @@ public class ScrollOfPsionicBlast extends Scroll { } @Override - protected void doRead() { + public void doRead() { GameScene.flash( 0xFFFFFF ); @@ -63,8 +63,8 @@ public class ScrollOfPsionicBlast extends Scroll { Dungeon.observe(); setKnown(); - - curUser.spendAndNext( TIME_TO_READ ); //no animation here, the flash interrupts it anyway. + + readAnimation(); if (!curUser.isAlive()) { Dungeon.fail( getClass() ); @@ -72,6 +72,24 @@ public class ScrollOfPsionicBlast extends Scroll { } } + @Override + public void empoweredRead() { + GameScene.flash( 0xFFFFFF ); + + Sample.INSTANCE.play( Assets.SND_BLAST ); + Invisibility.dispel(); + + for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { + if (Level.fieldOfView[mob.pos]) { + mob.damage(mob.HT, this ); + } + } + + setKnown(); + + readAnimation(); + } + @Override public int price() { return isKnown() ? 50 * quantity : super.price(); 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 f44704a12..c3d71a3c7 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 @@ -42,7 +42,7 @@ public class ScrollOfRage extends Scroll { } @Override - protected void doRead() { + public void doRead() { for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { mob.beckon( curUser.pos ); @@ -70,7 +70,24 @@ public class ScrollOfRage extends Scroll { readAnimation(); } - + + @Override + public void empoweredRead() { + for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { + if (Level.fieldOfView[mob.pos]) { + Buff.prolong(mob, Amok.class, 5f); + } + } + + setKnown(); + + curUser.sprite.centerEmitter().start( Speck.factory( Speck.SCREAM ), 0.3f, 3 ); + Sample.INSTANCE.play( Assets.SND_READ ); + Invisibility.dispel(); + + readAnimation(); + } + @Override public int price() { return isKnown() ? 30 * quantity : super.price(); 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 3498398e2..49de57718 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 @@ -41,7 +41,7 @@ public class ScrollOfRecharging extends Scroll { } @Override - protected void doRead() { + public void doRead() { Buff.affect(curUser, Recharging.class, BUFF_DURATION); charge(curUser); @@ -56,6 +56,12 @@ public class ScrollOfRecharging extends Scroll { readAnimation(); } + @Override + public void empoweredRead() { + doRead(); + Buff.append(curUser, Recharging.class, BUFF_DURATION/3f); + } + public static void charge( Hero hero ) { hero.sprite.centerEmitter().burst( EnergyParticle.FACTORY, 15 ); } 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 1741202e5..fad0804da 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 @@ -21,6 +21,8 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls; +import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; @@ -32,6 +34,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; +import com.watabou.noosa.audio.Sample; public class ScrollOfRemoveCurse extends InventoryScroll { @@ -39,7 +42,19 @@ public class ScrollOfRemoveCurse extends InventoryScroll { initials = 8; mode = WndBag.Mode.UNIDED_OR_CURSED; } - + + @Override + public void empoweredRead() { + for (Item item : curUser.belongings){ + if (item.cursed){ + item.cursedKnown = true; + } + } + Sample.INSTANCE.play( Assets.SND_READ ); + Invisibility.dispel(); + doRead(); + } + @Override protected void onItemSelected(Item item) { new Flare( 6, 32 ).show( curUser.sprite, 2f ) ; 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 e8ddfd940..d224cf817 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 @@ -23,15 +23,21 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls; 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.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite; +import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; import com.watabou.noosa.tweeners.AlphaTweener; +import com.watabou.utils.PathFinder; public class ScrollOfTeleportation extends Scroll { @@ -40,7 +46,7 @@ public class ScrollOfTeleportation extends Scroll { } @Override - protected void doRead() { + public void doRead() { Sample.INSTANCE.play( Assets.SND_READ ); Invisibility.dispel(); @@ -51,7 +57,49 @@ public class ScrollOfTeleportation extends Scroll { readAnimation(); } - public static void teleportHero( Hero hero ) { + @Override + public void empoweredRead() { + + if (Dungeon.bossLevel()){ + GLog.w( Messages.get(this, "no_tele") ); + return; + } + + GameScene.selectCell(new CellSelector.Listener() { + @Override + public void onSelect(Integer target) { + if (target != null) { + //time isn't spent + ((HeroSprite)curUser.sprite).read(); + teleportToLocation(curUser, target); + } + } + + @Override + public String prompt() { + return Messages.get(ScrollOfTeleportation.class, "prompt"); + } + }); + } + + public static void teleportToLocation(Hero hero, int pos){ + PathFinder.buildDistanceMap(pos, BArray.or(Level.passable, Level.avoid, null)); + if (PathFinder.distance[hero.pos] == Integer.MAX_VALUE + || (!Level.passable[pos] && !Level.avoid[pos]) + || Actor.findChar(pos) != null){ + GLog.w( Messages.get(ScrollOfTeleportation.class, "cant_reach") ); + return; + } + + appear( hero, pos ); + Dungeon.level.press( pos, hero ); + Dungeon.observe(); + GameScene.updateFog(); + + GLog.i( Messages.get(ScrollOfTeleportation.class, "tele") ); + } + + public static void teleportHero(Hero hero ) { int count = 10; int pos; 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 92a6068dc..c8cbd68c8 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,6 +25,7 @@ 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.Paralysis; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; @@ -40,7 +41,7 @@ public class ScrollOfTerror extends Scroll { } @Override - protected void doRead() { + public void doRead() { new Flare( 5, 32 ).color( 0xFF0000, true ).show( curUser.sprite, 2f ); Sample.INSTANCE.play( Assets.SND_READ ); @@ -73,7 +74,21 @@ public class ScrollOfTerror extends Scroll { readAnimation(); } - + + @Override + public void empoweredRead() { + doRead(); + for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { + if (Level.fieldOfView[mob.pos]) { + Terror t = mob.buff(Terror.class); + if (t != null){ + Buff.prolong(mob, Terror.class, Terror.DURATION*1.5f); + Buff.affect(mob, Paralysis.class, Terror.DURATION*.5f); + } + } + } + } + @Override public int price() { return isKnown() ? 30 * quantity : super.price(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfUpgrade.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfUpgrade.java index 4f03acb1e..f304a13c9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfUpgrade.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfUpgrade.java @@ -114,7 +114,12 @@ public class ScrollOfUpgrade extends InventoryScroll { GLog.p( Messages.get(ScrollOfUpgrade.class, "remove_curse") ); hero.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10 ); } - + + @Override + public void empoweredRead() { + //does nothing for now, this should never happen. + } + @Override public int price() { return isKnown() ? 50 * quantity : super.price(); 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 91ec601e6..0b070b963 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 @@ -434,9 +434,10 @@ public abstract class Wand extends Item { if (lock == null || lock.regenOn()) partialCharge += 1f/turnsToCharge; - Recharging bonus = target.buff(Recharging.class); - if (bonus != null && bonus.remainder() > 0f){ - partialCharge += CHARGE_BUFF_BONUS * bonus.remainder(); + for (Recharging bonus : target.buffs(Recharging.class)){ + if (bonus != null && bonus.remainder() > 0f) { + partialCharge += CHARGE_BUFF_BONUS * bonus.remainder(); + } } } diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index fe8414c68..81a5a3415 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -612,6 +612,8 @@ items.scrolls.scrollofremovecurse.desc=The incantation on this scroll will insta items.scrolls.scrollofteleportation.name=scroll of teleportation items.scrolls.scrollofteleportation.tele=In a blink of an eye you were teleported to another location of the level. items.scrolls.scrollofteleportation.no_tele=Strong magic aura of this place prevents you from teleporting! +items.scrolls.scrollofteleportation.cant_reach=You can't teleport there +items.scrolls.scrollofteleportation.prompt=Choose a location to teleport items.scrolls.scrollofteleportation.desc=The spell on this parchment instantly transports the reader to a random location on the dungeon level. It can be used to escape a dangerous situation, but the unlucky reader might find themselves in an even more dangerous place. items.scrolls.scrollofterror.name=scroll of terror