v0.7.0: various bugfixes:
- fixed wells of knowledge marking scrolls/potion as not cursed - fixed various unstable spellbook errors relating to transmutation - fixed scroll of transmutation duplicating cursed worn items - fixed wands not setting themselves as cursed known when uncursed - fixed darts not being usable in alchemy
This commit is contained in:
parent
c662e2a338
commit
170ca7f9b3
core/src/main/java/com/shatteredpixel/shatteredpixeldungeon
actors/hero
items
windows
|
@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.hero;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.KindofMisc;
|
||||
|
@ -183,7 +184,9 @@ public class Belongings implements Iterable<Item> {
|
|||
Badges.validateItemLevelAquired(misc2);
|
||||
}
|
||||
for (Item item : backpack) {
|
||||
item.cursedKnown = true;
|
||||
if (item instanceof EquipableItem || item instanceof Wand) {
|
||||
item.cursedKnown = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,8 @@ import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.Dart;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.TippedDart;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -151,6 +153,11 @@ public abstract class Recipe {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static boolean usableInRecipe(Item item){
|
||||
return item.isIdentified()
|
||||
&& (!(item instanceof EquipableItem) || item instanceof Dart)
|
||||
&& !(item instanceof Wand);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -80,7 +80,8 @@ public class UnstableSpellbook extends Artifact {
|
|||
probs[i] = 0;
|
||||
|
||||
i = Random.chances(probs);
|
||||
};
|
||||
}
|
||||
scrolls.remove(ScrollOfTransmutation.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -147,7 +148,7 @@ public class UnstableSpellbook extends Artifact {
|
|||
chargeCap = (int)((level()+1)*0.4f)+2;
|
||||
|
||||
//for artifact transmutation.
|
||||
while (scrolls.size() > (levelCap-1-level()))
|
||||
while (!scrolls.isEmpty() && scrolls.size() > (levelCap-1-level()))
|
||||
scrolls.remove(0);
|
||||
|
||||
return super.upgrade();
|
||||
|
|
|
@ -89,6 +89,7 @@ public class ScrollOfTransmutation extends InventoryScroll {
|
|||
curItem.collect( curUser.belongings.backpack );
|
||||
} else {
|
||||
if (item.isEquipped(Dungeon.hero)){
|
||||
item.cursed = false; //to allow it to be unequipped
|
||||
((EquipableItem)item).doUnequip(Dungeon.hero, false);
|
||||
((EquipableItem)result).doEquip(Dungeon.hero);
|
||||
} else {
|
||||
|
|
|
@ -385,7 +385,6 @@ public abstract class Wand extends Item {
|
|||
if (curWand.cursed){
|
||||
CursedWand.cursedZap(curWand, curUser, new Ballistica( curUser.pos, target, Ballistica.MAGIC_BOLT));
|
||||
if (!curWand.cursedKnown){
|
||||
curWand.cursedKnown = true;
|
||||
GLog.n(Messages.get(Wand.class, "curse_discover", curWand.name()));
|
||||
}
|
||||
} else {
|
||||
|
@ -396,6 +395,7 @@ public abstract class Wand extends Item {
|
|||
}
|
||||
});
|
||||
}
|
||||
curWand.cursedKnown = true;
|
||||
|
||||
Invisibility.dispel();
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Recipe;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.MagicalHolster;
|
||||
|
@ -402,7 +403,7 @@ public class WndBag extends WndTabbed {
|
|||
mode == Mode.SCROLL && (item instanceof Scroll) ||
|
||||
mode == Mode.UNIDED_POTION_OR_SCROLL && (!item.isIdentified() && (item instanceof Scroll || item instanceof Potion)) ||
|
||||
mode == Mode.EQUIPMENT && (item instanceof EquipableItem) ||
|
||||
mode == Mode.ALCHEMY && (!(item instanceof EquipableItem) && item.isIdentified()) ||
|
||||
mode == Mode.ALCHEMY && Recipe.usableInRecipe(item) ||
|
||||
mode == Mode.TRANMSUTABLE && ScrollOfTransmutation.canTransmute(item) ||
|
||||
mode == Mode.ALL
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue
Block a user