From 83764f36d726bfd7ae4374ebeb94fbdec6bf53e5 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 20 Jul 2018 23:37:03 -0400 Subject: [PATCH] v0.7.0: significantly adjusted spellbook mechanics for new scrolls --- core/src/main/assets/consumable_icons.png | Bin 739 -> 2780 bytes .../items/artifacts/UnstableSpellbook.java | 44 ++++++++++++++---- .../items/scrolls/exotic/ExoticScroll.java | 25 ++++++++++ .../messages/items/items.properties | 1 + 4 files changed, 62 insertions(+), 8 deletions(-) diff --git a/core/src/main/assets/consumable_icons.png b/core/src/main/assets/consumable_icons.png index 9ee74ba85f6bae748c87903c2d25bfc6865baf88..6db333710ad876f8d6282df44a941f516bc5e225 100644 GIT binary patch literal 2780 zcmV<23M2K2P)k8xqN;70?~G5Vw;NK|yUyaEm@Dnwf+cX^nBRB#lEEqNWea zgFMW=+3-+&(=e4GP26A?SNfn~Vz6n{TALOX5CM0LQRA#2ZL^_Cv+H)#<=cmQ&*j`R z_YO14Y_ZFioSbv+;hed5e!uVU9e@nw!4!v)r7*yvscVtH+-A|TKKE=@)_ZLGxgo1( z;TY!pygG+7`QE|jy3hZG5CGg9E#QsorimF$1QPQHQyeZSq^L;%E-54uWGE@5D8~@7 zPTEwd(S{*X2_StC$>8g~W3yzaFN6MexqUCQ1{miP5zSr?F;R@v2bn%G#LG9Vu;$+l ze~p4em1F`g?xUILR8-zqeYrLTq-)#y$q9T4%|1h&bmlqbOci`u(?tuF0C@ngaosfC z94%m(3;u}Qk&sY80*1KuGnAa(1s@kt={zA3{ zdBztGt}2@bz^E#l2D9zKn*nr~;|_B!zK{qHS2Au4X?Up!JY31D6_BL|s{jD{+vOCg zFLTs>6MR?G&m1z=>#HnRAix)602T=(jhCOn<_5Mt{+q3L0{`OYM(YoP&$*mg#|_~W zurGH3m%B1@BR?4dh(Lp51po+xV+A0B45AFWOa{XOY#1U6K?eWJ_gRh4RsjI|`uf;RA{YRh zbHpPv2y889?E5VOTg%yh*Ne_e>sbb0*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v4ZVvZN8c$~g| tLD1hPqAoTI773U$9DiQF?3{rM1H-Z_x_?$|ni~m9HlD72F6*2UngEB#b58&O 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.