v0.7.1: added conversion logic for huntress boomerangs

This commit is contained in:
Evan Debenham 2018-11-22 01:54:31 -05:00
parent b79098d46a
commit 47d01ebe00
2 changed files with 29 additions and 0 deletions

View File

@ -41,6 +41,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow;
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
import com.shatteredpixel.shatteredpixeldungeon.levels.CavesBossLevel;
import com.shatteredpixel.shatteredpixeldungeon.levels.CavesLevel;
@ -395,6 +397,28 @@ public class Dungeon {
hero.curAction = hero.lastAction = null;
//pre-0.7.1 saves. Adjusting for spirit bows in weapon slot or with upgrades.
SpiritBow bow;
if (hero.belongings.weapon instanceof SpiritBow){
bow = (SpiritBow)hero.belongings.weapon;
hero.belongings.weapon = null;
if (!bow.collect()){
level.drop(bow, hero.pos);
}
} else {
bow = hero.belongings.getItem(SpiritBow.class);
}
if (bow != null && bow.spentUpgrades() > 0){
ScrollOfUpgrade refund = new ScrollOfUpgrade();
refund.quantity(bow.spentUpgrades());
bow.level(0);
if (!refund.collect()){
level.drop(refund, hero.pos);
}
}
observe();
try {
saveAll();

View File

@ -143,6 +143,11 @@ public class ShatteredPixelDungeon extends Game {
com.shatteredpixel.shatteredpixeldungeon.items.spells.MagicalInfusion.class,
"com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion" );
//v0.7.1
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow.class,
"com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Boomerang" );
}
@Override