diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java b/src/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java index 9ee1c4246..70b4c83c5 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java @@ -45,11 +45,11 @@ public class ShatteredPixelDungeon extends Game { com.watabou.utils.Bundle.addAlias( com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shock.class, "com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Swing" ); - /* If I rename scroll of weapon upgrade, uncomment this and correct it. + com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfEnchantment.class, + com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion.class, "com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfWeaponUpgrade" ); - */ + } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfTransmutation.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfTransmutation.java index 77a509087..6862f8bf7 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfTransmutation.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfTransmutation.java @@ -31,7 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; 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.scrolls.ScrollOfWeaponUpgrade; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.*; import com.shatteredpixel.shatteredpixeldungeon.plants.Plant; @@ -116,11 +116,7 @@ public class WaterOfTransmutation extends WellWater { n.degrade( -level ); } - //FIXME enchantment should be preserved. - /*if (w.isEnchanted()) { - n.enchant(); - }*/ - + n.enchantment = w.enchantment; n.levelKnown = w.levelKnown; n.cursedKnown = w.cursedKnown; n.cursed = w.cursed; @@ -197,9 +193,9 @@ public class WaterOfTransmutation extends WellWater { private Scroll changeScroll( Scroll s ) { if (s instanceof ScrollOfUpgrade) { - return new ScrollOfWeaponUpgrade(); + return new ScrollOfMagicalInfusion(); - } else if (s instanceof ScrollOfWeaponUpgrade) { + } else if (s instanceof ScrollOfMagicalInfusion) { return new ScrollOfUpgrade(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 51f88300d..8a3ecee39 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -85,7 +85,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfWeaponUpgrade; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon; @@ -625,7 +625,7 @@ public class Hero extends Char { } else { boolean important = - ((item instanceof ScrollOfUpgrade || item instanceof ScrollOfWeaponUpgrade) && ((Scroll)item).isKnown()) || + ((item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion) && ((Scroll)item).isKnown()) || ((item instanceof PotionOfStrength || item instanceof PotionOfMight) && ((Potion)item).isKnown()); if (important) { GLog.p( TXT_YOU_NOW_HAVE, item.name() ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java index 6d9d189b7..e4e55ce79 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java @@ -95,7 +95,7 @@ public class Generator { ScrollOfRage.class, ScrollOfTerror.class, ScrollOfLullaby.class, - ScrollOfWeaponUpgrade.class, + ScrollOfMagicalInfusion.class, ScrollOfPsionicBlast.class, ScrollOfMirrorImage.class }; Category.SCROLL.probs = new float[]{ 30, 10, 15, 0, 10, 15, 12, 8, 8, 0, 3, 6 }; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/Stylus.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/Stylus.java index e44386eab..edc787dd2 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/Stylus.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/Stylus.java @@ -32,7 +32,7 @@ import java.util.ArrayList; public class Stylus extends Item { private static final String TXT_SELECT_ARMOR = "Select an armor to inscribe on"; - private static final String TXT_INSCRIBED = "you inscribed the your %s with the stylus"; + private static final String TXT_INSCRIBED = "you inscribed your %s with the stylus"; private static final float TIME_TO_INSCRIBE = 2; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java index 54d4ea477..02f9a9b3d 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java @@ -172,10 +172,6 @@ public class Armor extends EquipableItem { return super.upgrade(); } - public Item safeUpgrade() { - return upgrade( glyph != null ); - } - @Override public Item degrade() { DR -= tier; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java index f7b214a2b..4121b9aab 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java @@ -51,7 +51,7 @@ public abstract class Scroll extends Item { ScrollOfRage.class, ScrollOfTerror.class, ScrollOfLullaby.class, - ScrollOfWeaponUpgrade.class, + ScrollOfMagicalInfusion.class, ScrollOfPsionicBlast.class, ScrollOfMirrorImage.class }; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfWeaponUpgrade.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicalInfusion.java similarity index 61% rename from src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfWeaponUpgrade.java rename to src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicalInfusion.java index 479511b7d..e48ffe7e8 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfWeaponUpgrade.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicalInfusion.java @@ -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."; } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java index 57398443f..99670e9f1 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java @@ -56,7 +56,7 @@ public class Weapon extends KindOfWeapon { private int hitsToKnow = HITS_TO_KNOW; - protected Enchantment enchantment; + public Enchantment enchantment; @Override public void proc( Char attacker, Char defender, int damage ) { @@ -223,7 +223,7 @@ public class Weapon extends KindOfWeapon { public boolean isEnchanted() { return enchantment != null; } - + @Override public ItemSprite.Glowing glowing() { return enchantment != null ? enchantment.glowing() : null; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index 811739cc9..fac306cdb 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -58,7 +58,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfWealth; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfWeaponUpgrade; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion; import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; import com.shatteredpixel.shatteredpixeldungeon.levels.features.Door; import com.shatteredpixel.shatteredpixeldungeon.levels.features.HighGrass; @@ -213,7 +213,7 @@ public abstract class Level implements Bundlable { } if (Random.Float() > Math.pow(0.95, bonus)){ if (Random.Int(2) == 0) - addItemToSpawn( new ScrollOfWeaponUpgrade() ); + addItemToSpawn( new ScrollOfMagicalInfusion() ); else addItemToSpawn( new PotionOfMight() ); }