diff --git a/core/src/main/assets/consumable_icons.png b/core/src/main/assets/consumable_icons.png index 9ee74ba85..6db333710 100644 Binary files a/core/src/main/assets/consumable_icons.png and b/core/src/main/assets/consumable_icons.png differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java index 9f0c6eca0..8406a145b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; @@ -35,11 +36,13 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMappi import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTransmutation; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ExoticScroll; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; +import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundle; import com.watabou.utils.Random; @@ -54,9 +57,9 @@ public class UnstableSpellbook extends Artifact { levelCap = 10; - charge = (int)(level()*0.4f)+2; + charge = (int)(level()*0.6f)+2; partialCharge = 0; - chargeCap = (int)(level()*0.4f)+2; + chargeCap = (int)(level()*0.6f)+2; defaultAction = AC_READ; } @@ -103,7 +106,7 @@ public class UnstableSpellbook extends Artifact { if (hero.buff( Blindness.class ) != null) GLog.w( Messages.get(this, "blinded") ); else if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") ); - else if (charge == 0) GLog.i( Messages.get(this, "no_charge") ); + else if (charge <= 0) GLog.i( Messages.get(this, "no_charge") ); else if (cursed) GLog.i( Messages.get(this, "cursed") ); else { charge--; @@ -125,10 +128,35 @@ public class UnstableSpellbook extends Artifact { curUser = hero; //if this scroll hasn't been given to the book - if (scrolls.contains(scroll.getClass())) { - scroll.doRead(); + if (!scrolls.contains(scroll.getClass())) { + final Scroll fScroll = scroll; + GameScene.show(new WndOptions( + Messages.get(this, "prompt"), + Messages.get(this, "read_empowered"), + scroll.trueName(), + Messages.get(ExoticScroll.regToExo.get(scroll.getClass()), "name")){ + @Override + protected void onSelect(int index) { + if (index == 1){ + try { + Scroll scroll = ExoticScroll.regToExo.get(fScroll.getClass()).newInstance(); + charge --; + scroll.doRead(); + } catch ( Exception e) { + ShatteredPixelDungeon.reportException(e); + } + } else { + fScroll.doRead(); + } + } + + @Override + public void onBackPressed() { + //do nothing + } + }); } else { - scroll.empoweredRead(); + scroll.doRead(); } updateQuickslot(); } @@ -145,7 +173,7 @@ public class UnstableSpellbook extends Artifact { @Override public Item upgrade() { - chargeCap = (int)((level()+1)*0.4f)+2; + chargeCap = (int)((level()+1)*0.6f)+2; //for artifact transmutation. while (!scrolls.isEmpty() && scrolls.size() > (levelCap-1-level())) @@ -198,7 +226,7 @@ public class UnstableSpellbook extends Artifact { public boolean act() { LockedFloor lock = target.buff(LockedFloor.class); if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) { - partialCharge += 1 / (160f - (chargeCap - charge)*15f); + partialCharge += 1 / (120f - (chargeCap - charge)*5f); if (partialCharge >= 1) { partialCharge --; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ExoticScroll.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ExoticScroll.java index 28e897236..db0a03305 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ExoticScroll.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ExoticScroll.java @@ -27,8 +27,13 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Recipe; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfLullaby; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMirrorImage; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfPsionicBlast; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRage; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTerror; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; import com.shatteredpixel.shatteredpixeldungeon.items.stones.Runestone; @@ -62,6 +67,26 @@ public abstract class ExoticScroll extends Scroll { regToExo.put(ScrollOfTerror.class, ScrollOfPetrification.class); exoToReg.put(ScrollOfPetrification.class, ScrollOfTerror.class); + + regToExo.put(ScrollOfTerror.class, ScrollOfPetrification.class); + exoToReg.put(ScrollOfPetrification.class, ScrollOfTerror.class); + + //TODO + + regToExo.put(ScrollOfTeleportation.class, ScrollOfPetrification.class); + exoToReg.put(ScrollOfPetrification.class, ScrollOfTeleportation.class); + + regToExo.put(ScrollOfRecharging.class, ScrollOfPetrification.class); + exoToReg.put(ScrollOfPetrification.class, ScrollOfRecharging.class); + + regToExo.put(ScrollOfMagicMapping.class, ScrollOfPetrification.class); + exoToReg.put(ScrollOfPetrification.class, ScrollOfMagicMapping.class); + + regToExo.put(ScrollOfPsionicBlast.class, ScrollOfPetrification.class); + exoToReg.put(ScrollOfPetrification.class, ScrollOfPsionicBlast.class); + + regToExo.put(ScrollOfMirrorImage.class, ScrollOfPetrification.class); + exoToReg.put(ScrollOfPetrification.class, ScrollOfMirrorImage.class); } @Override 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 27fe48c8f..4d69f2174 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 @@ -323,6 +323,7 @@ items.artifacts.unstablespellbook.desc=This Tome is in surprising good condition items.artifacts.unstablespellbook.desc_cursed=The cursed book has bound itself to you, it is inhibiting your ability to use most scrolls. items.artifacts.unstablespellbook.desc_index=The book is incomplete. Its index is currently pointing to the following blank pages: items.artifacts.unstablespellbook.desc_empowered=The scrolls that you've added to the book are glowing with power. Their magic seems stronger than it was before they were placed in the book. +items.artifacts.unstablespellbook.read_empowered=The scroll you added to the spellbook surges with energy. You are able to channel either the regular, or exotic version of this scroll's effect.\n\nChoosing the exotic variant will cost 2 charges instead of 1.