v0.2.4: corrected enchamtent/glyph logic, renamed scroll of Weapon Upgrade to Scroll of Magical Infusion

This commit is contained in:
Evan Debenham
2015-02-06 15:11:17 -05:00
parent 92afe5977e
commit b2e29708a0
10 changed files with 33 additions and 39 deletions
@@ -51,7 +51,7 @@ public abstract class Scroll extends Item {
ScrollOfRage.class,
ScrollOfTerror.class,
ScrollOfLullaby.class,
ScrollOfWeaponUpgrade.class,
ScrollOfMagicalInfusion.class,
ScrollOfPsionicBlast.class,
ScrollOfMirrorImage.class
};
@@ -21,33 +21,35 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
public class ScrollOfWeaponUpgrade extends InventoryScroll {
public class ScrollOfMagicalInfusion extends InventoryScroll {
private static final String TXT_LOOKS_BETTER = "your %s certainly looks better now";
private static final String TXT_INFUSE = "your %s is infused with arcane energy!";
{
name = "Scroll of Weapon Upgrade";
inventoryTitle = "Select a weapon to upgrade";
mode = WndBag.Mode.WEAPON;
name = "Scroll of Magical Infusion";
inventoryTitle = "Select an item to infuse";
mode = WndBag.Mode.ENCHANTABLE;
bones = true;
}
@Override
protected void onItemSelected( Item item ) {
ScrollOfRemoveCurse.uncurse( Dungeon.hero, item );
if (item instanceof Weapon)
((Weapon)item).upgrade(true);
else
((Armor)item).upgrade(true);
Weapon weapon = (Weapon)item;
GLog.p( TXT_INFUSE, item.name() );
ScrollOfRemoveCurse.uncurse( Dungeon.hero, weapon );
weapon.upgrade( true );
GLog.p( TXT_LOOKS_BETTER, weapon.name() );
Badges.validateItemLevelAquired( weapon );
Badges.validateItemLevelAquired( item );
curUser.sprite.emitter().start( Speck.factory( Speck.UP ), 0.2f, 3 );
}
@@ -55,8 +57,8 @@ public class ScrollOfWeaponUpgrade extends InventoryScroll {
@Override
public String desc() {
return
"This scroll will upgrade a melee weapon, improving its quality. In contrast to a regular Scroll of Upgrade, " +
"this specialized version will never destroy an enchantment on a weapon. On the contrary, it is able to imbue " +
"an unenchanted weapon with a random enchantment.";
"This scroll will infuse a weapon or armor with powerful magical energy.\n\n" +
"In addition to being upgraded, A weapon will gain a magical enchantment, or armor will be imbued with a magical glyph.\n\n" +
"If the item already has an enchantment or glyph, it will never be erased by the upgrade.";
}
}