Merging 1.9.1 source: item changes
This commit is contained in:
@@ -79,7 +79,7 @@ public abstract class InventoryScroll extends Scroll {
|
||||
if (item != null) {
|
||||
|
||||
((InventoryScroll)curItem).onItemSelected( item );
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
((InventoryScroll)curItem).readAnimation();
|
||||
|
||||
Sample.INSTANCE.play( Assets.SND_READ );
|
||||
Invisibility.dispel();
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.ItemStatusHandler;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.UnstableSpellbook;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.utils.Bundle;
|
||||
@@ -143,6 +144,12 @@ public abstract class Scroll extends Item {
|
||||
}
|
||||
|
||||
abstract protected void doRead();
|
||||
|
||||
protected void readAnimation() {
|
||||
curUser.spend( TIME_TO_READ );
|
||||
curUser.busy();
|
||||
((HeroSprite)curUser.sprite).read();
|
||||
}
|
||||
|
||||
public boolean isKnown() {
|
||||
return handler.isKnown( this );
|
||||
|
||||
@@ -57,8 +57,8 @@ public class ScrollOfLullaby extends Scroll {
|
||||
GLog.i( "The scroll utters a soothing melody. You feel very sleepy." );
|
||||
|
||||
setKnown();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -83,8 +83,8 @@ public class ScrollOfMagicMapping extends Scroll {
|
||||
Invisibility.dispel();
|
||||
|
||||
setKnown();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-4
@@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Enchanting;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
@@ -46,7 +47,7 @@ public class ScrollOfMagicalInfusion extends InventoryScroll {
|
||||
@Override
|
||||
protected void onItemSelected( Item item ) {
|
||||
|
||||
ScrollOfRemoveCurse.uncurse( Dungeon.hero, item );
|
||||
ScrollOfRemoveCurse.uncurse(Dungeon.hero, item);
|
||||
if (item instanceof Weapon)
|
||||
((Weapon)item).upgrade(true);
|
||||
else
|
||||
@@ -54,9 +55,10 @@ public class ScrollOfMagicalInfusion extends InventoryScroll {
|
||||
|
||||
GLog.p( TXT_INFUSE, item.name() );
|
||||
|
||||
Badges.validateItemLevelAquired( item );
|
||||
|
||||
curUser.sprite.emitter().start( Speck.factory( Speck.UP ), 0.2f, 3 );
|
||||
Badges.validateItemLevelAquired(item);
|
||||
|
||||
curUser.sprite.emitter().start(Speck.factory(Speck.UP), 0.2f, 3);
|
||||
Enchanting.show(curUser, item);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -71,8 +71,8 @@ public class ScrollOfMirrorImage extends Scroll {
|
||||
|
||||
Sample.INSTANCE.play( Assets.SND_READ );
|
||||
Invisibility.dispel();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -64,8 +64,8 @@ public class ScrollOfPsionicBlast extends Scroll {
|
||||
Dungeon.observe();
|
||||
|
||||
setKnown();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ ); //no animation here, the flash interrupts it anyway.
|
||||
|
||||
if (!curUser.isAlive()) {
|
||||
Dungeon.fail( Utils.format(ResultDescriptions.ITEM, name ));
|
||||
|
||||
@@ -66,8 +66,8 @@ public class ScrollOfRage extends Scroll {
|
||||
curUser.sprite.centerEmitter().start( Speck.factory( Speck.SCREAM ), 0.3f, 3 );
|
||||
Sample.INSTANCE.play( Assets.SND_CHALLENGE );
|
||||
Invisibility.dispel();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -52,8 +52,8 @@ public class ScrollOfRecharging extends Scroll {
|
||||
GLog.i( "a surge of energy courses through your body, invigorating your wands.");
|
||||
SpellSprite.show( curUser, SpellSprite.CHARGE );
|
||||
setKnown();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -66,8 +66,8 @@ public class ScrollOfRemoveCurse extends Scroll {
|
||||
}
|
||||
|
||||
setKnown();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -51,8 +51,8 @@ public class ScrollOfTeleportation extends Scroll {
|
||||
|
||||
teleportHero( curUser );
|
||||
setKnown();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
public static void teleportHero( Hero hero ) {
|
||||
|
||||
@@ -69,8 +69,8 @@ public class ScrollOfTerror extends Scroll {
|
||||
GLog.i( "The scroll emits a brilliant flash of red light and the monsters flee!" );
|
||||
}
|
||||
setKnown();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user