v0.7.0: significantly adjusted spellbook mechanics for new scrolls
This commit is contained in:
parent
ab1b9f23d6
commit
83764f36d7
Binary file not shown.
Before Width: | Height: | Size: 739 B After Width: | Height: | Size: 2.7 KiB |
|
@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
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.ScrollOfRemoveCurse;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTransmutation;
|
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.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
import com.watabou.utils.Random;
|
import com.watabou.utils.Random;
|
||||||
|
@ -54,9 +57,9 @@ public class UnstableSpellbook extends Artifact {
|
||||||
|
|
||||||
levelCap = 10;
|
levelCap = 10;
|
||||||
|
|
||||||
charge = (int)(level()*0.4f)+2;
|
charge = (int)(level()*0.6f)+2;
|
||||||
partialCharge = 0;
|
partialCharge = 0;
|
||||||
chargeCap = (int)(level()*0.4f)+2;
|
chargeCap = (int)(level()*0.6f)+2;
|
||||||
|
|
||||||
defaultAction = AC_READ;
|
defaultAction = AC_READ;
|
||||||
}
|
}
|
||||||
|
@ -103,7 +106,7 @@ public class UnstableSpellbook extends Artifact {
|
||||||
|
|
||||||
if (hero.buff( Blindness.class ) != null) GLog.w( Messages.get(this, "blinded") );
|
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 (!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 if (cursed) GLog.i( Messages.get(this, "cursed") );
|
||||||
else {
|
else {
|
||||||
charge--;
|
charge--;
|
||||||
|
@ -125,10 +128,35 @@ public class UnstableSpellbook extends Artifact {
|
||||||
curUser = hero;
|
curUser = hero;
|
||||||
|
|
||||||
//if this scroll hasn't been given to the book
|
//if this scroll hasn't been given to the book
|
||||||
if (scrolls.contains(scroll.getClass())) {
|
if (!scrolls.contains(scroll.getClass())) {
|
||||||
scroll.doRead();
|
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 {
|
} else {
|
||||||
scroll.empoweredRead();
|
scroll.doRead();
|
||||||
}
|
}
|
||||||
updateQuickslot();
|
updateQuickslot();
|
||||||
}
|
}
|
||||||
|
@ -145,7 +173,7 @@ public class UnstableSpellbook extends Artifact {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item upgrade() {
|
public Item upgrade() {
|
||||||
chargeCap = (int)((level()+1)*0.4f)+2;
|
chargeCap = (int)((level()+1)*0.6f)+2;
|
||||||
|
|
||||||
//for artifact transmutation.
|
//for artifact transmutation.
|
||||||
while (!scrolls.isEmpty() && scrolls.size() > (levelCap-1-level()))
|
while (!scrolls.isEmpty() && scrolls.size() > (levelCap-1-level()))
|
||||||
|
@ -198,7 +226,7 @@ public class UnstableSpellbook extends Artifact {
|
||||||
public boolean act() {
|
public boolean act() {
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
LockedFloor lock = target.buff(LockedFloor.class);
|
||||||
if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) {
|
if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) {
|
||||||
partialCharge += 1 / (160f - (chargeCap - charge)*15f);
|
partialCharge += 1 / (120f - (chargeCap - charge)*5f);
|
||||||
|
|
||||||
if (partialCharge >= 1) {
|
if (partialCharge >= 1) {
|
||||||
partialCharge --;
|
partialCharge --;
|
||||||
|
|
|
@ -27,8 +27,13 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Recipe;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfLullaby;
|
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.ScrollOfRage;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse;
|
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.ScrollOfTerror;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.Runestone;
|
import com.shatteredpixel.shatteredpixeldungeon.items.stones.Runestone;
|
||||||
|
@ -62,6 +67,26 @@ public abstract class ExoticScroll extends Scroll {
|
||||||
|
|
||||||
regToExo.put(ScrollOfTerror.class, ScrollOfPetrification.class);
|
regToExo.put(ScrollOfTerror.class, ScrollOfPetrification.class);
|
||||||
exoToReg.put(ScrollOfPetrification.class, ScrollOfTerror.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
|
@Override
|
||||||
|
|
|
@ -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_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_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.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.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user