v0.4.0: adjusted some scroll logic
This commit is contained in:
committed by
Evan Debenham
parent
ababc270dd
commit
99760aac86
+13
-19
@@ -29,44 +29,35 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
||||
public class ScrollOfRemoveCurse extends Scroll {
|
||||
public class ScrollOfRemoveCurse extends InventoryScroll {
|
||||
|
||||
{
|
||||
initials = 8;
|
||||
mode = WndBag.Mode.UNIDED_OR_CURSED;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doRead() {
|
||||
|
||||
protected void onItemSelected(Item item) {
|
||||
new Flare( 6, 32 ).show( curUser.sprite, 2f ) ;
|
||||
Sample.INSTANCE.play( Assets.SND_READ );
|
||||
Invisibility.dispel();
|
||||
|
||||
boolean procced = uncurse( curUser, curUser.belongings.backpack.items.toArray( new Item[0] ) );
|
||||
procced = uncurse( curUser,
|
||||
curUser.belongings.weapon,
|
||||
curUser.belongings.armor,
|
||||
curUser.belongings.misc1,
|
||||
curUser.belongings.misc2) || procced;
|
||||
|
||||
|
||||
boolean procced = uncurse( curUser, item );
|
||||
|
||||
Weakness.detach( curUser, Weakness.class );
|
||||
|
||||
|
||||
if (procced) {
|
||||
GLog.p( Messages.get(this, "cleansed") );
|
||||
} else {
|
||||
GLog.i( Messages.get(this, "not_cleansed") );
|
||||
}
|
||||
|
||||
setKnown();
|
||||
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
|
||||
public static boolean uncurse( Hero hero, Item... items ) {
|
||||
|
||||
boolean procced = false;
|
||||
@@ -91,6 +82,9 @@ public class ScrollOfRemoveCurse extends Scroll {
|
||||
procced = true;
|
||||
}
|
||||
}
|
||||
if (item instanceof Ring && item.level() <= 0){
|
||||
item.upgrade(1 - item.level());
|
||||
}
|
||||
if (item instanceof Bag){
|
||||
for (Item bagItem : ((Bag)item).items){
|
||||
if (bagItem != null && bagItem.cursed) {
|
||||
|
||||
Reference in New Issue
Block a user