v2.2.0: transmute scroll no longer turns pots/scrolls into exotics
The alchemy changes in v1.1.0 largely made this pointless anyway, as it's more efficient to just scrap transmutation for energy.
This commit is contained in:
+22
-16
@@ -131,7 +131,7 @@ public class ScrollOfTransmutation extends InventoryScroll {
|
|||||||
if (item instanceof MagesStaff) {
|
if (item instanceof MagesStaff) {
|
||||||
return changeStaff((MagesStaff) item);
|
return changeStaff((MagesStaff) item);
|
||||||
}else if (item instanceof TippedDart){
|
}else if (item instanceof TippedDart){
|
||||||
return changeTippeDart( (TippedDart)item );
|
return changeTippedDart( (TippedDart)item );
|
||||||
} else if (item instanceof MeleeWeapon || item instanceof MissileWeapon) {
|
} else if (item instanceof MeleeWeapon || item instanceof MissileWeapon) {
|
||||||
return changeWeapon( (Weapon)item );
|
return changeWeapon( (Weapon)item );
|
||||||
} else if (item instanceof Scroll) {
|
} else if (item instanceof Scroll) {
|
||||||
@@ -182,7 +182,7 @@ public class ScrollOfTransmutation extends InventoryScroll {
|
|||||||
return staff;
|
return staff;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static TippedDart changeTippeDart( TippedDart dart ){
|
private static TippedDart changeTippedDart( TippedDart dart ){
|
||||||
TippedDart n;
|
TippedDart n;
|
||||||
do {
|
do {
|
||||||
n = TippedDart.randomTipped(1);
|
n = TippedDart.randomTipped(1);
|
||||||
@@ -192,7 +192,6 @@ public class ScrollOfTransmutation extends InventoryScroll {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Weapon changeWeapon( Weapon w ) {
|
private static Weapon changeWeapon( Weapon w ) {
|
||||||
|
|
||||||
Weapon n;
|
Weapon n;
|
||||||
Generator.Category c;
|
Generator.Category c;
|
||||||
if (w instanceof MeleeWeapon) {
|
if (w instanceof MeleeWeapon) {
|
||||||
@@ -276,7 +275,6 @@ public class ScrollOfTransmutation extends InventoryScroll {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Wand changeWand( Wand w ) {
|
private static Wand changeWand( Wand w ) {
|
||||||
|
|
||||||
Wand n;
|
Wand n;
|
||||||
do {
|
do {
|
||||||
n = (Wand)Generator.random( Generator.Category.WAND );
|
n = (Wand)Generator.random( Generator.Category.WAND );
|
||||||
@@ -300,7 +298,6 @@ public class ScrollOfTransmutation extends InventoryScroll {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Plant.Seed changeSeed( Plant.Seed s ) {
|
private static Plant.Seed changeSeed( Plant.Seed s ) {
|
||||||
|
|
||||||
Plant.Seed n;
|
Plant.Seed n;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@@ -311,7 +308,6 @@ public class ScrollOfTransmutation extends InventoryScroll {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Runestone changeStone( Runestone r ) {
|
private static Runestone changeStone( Runestone r ) {
|
||||||
|
|
||||||
Runestone n;
|
Runestone n;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@@ -322,19 +318,29 @@ public class ScrollOfTransmutation extends InventoryScroll {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Scroll changeScroll( Scroll s ) {
|
private static Scroll changeScroll( Scroll s ) {
|
||||||
if (s instanceof ExoticScroll) {
|
Scroll n;
|
||||||
return Reflection.newInstance(ExoticScroll.exoToReg.get(s.getClass()));
|
|
||||||
} else {
|
do {
|
||||||
return Reflection.newInstance(ExoticScroll.regToExo.get(s.getClass()));
|
n = (Scroll)Generator.randomUsingDefaults( Generator.Category.SCROLL );
|
||||||
}
|
if (s instanceof ExoticScroll){
|
||||||
|
n = Reflection.newInstance(ExoticScroll.regToExo.get(n.getClass()));
|
||||||
|
}
|
||||||
|
} while (n.getClass() == s.getClass());
|
||||||
|
|
||||||
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Potion changePotion( Potion p ) {
|
private static Potion changePotion( Potion p ) {
|
||||||
if (p instanceof ExoticPotion) {
|
Potion n;
|
||||||
return Reflection.newInstance(ExoticPotion.exoToReg.get(p.getClass()));
|
|
||||||
} else {
|
do {
|
||||||
return Reflection.newInstance(ExoticPotion.regToExo.get(p.getClass()));
|
n = (Potion)Generator.randomUsingDefaults( Generator.Category.POTION );
|
||||||
}
|
if (p instanceof ExoticPotion){
|
||||||
|
n = Reflection.newInstance(ExoticPotion.regToExo.get(n.getClass()));
|
||||||
|
}
|
||||||
|
} while (n.getClass() == p.getClass());
|
||||||
|
|
||||||
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+1
-25
@@ -21,27 +21,22 @@
|
|||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.items.spells;
|
package com.shatteredpixel.shatteredpixeldungeon.items.spells;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Transmuting;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Transmuting;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.AlchemicalCatalyst;
|
import com.shatteredpixel.shatteredpixeldungeon.items.potions.AlchemicalCatalyst;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.brews.Brew;
|
import com.shatteredpixel.shatteredpixeldungeon.items.potions.brews.Brew;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.Elixir;
|
import com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.Elixir;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.ExoticPotion;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTransmutation;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTransmutation;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ExoticScroll;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.Runestone;
|
import com.shatteredpixel.shatteredpixeldungeon.items.stones.Runestone;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.TippedDart;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.TippedDart;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
|
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
import com.watabou.utils.Reflection;
|
|
||||||
|
|
||||||
public class Recycle extends InventorySpell {
|
public class Recycle extends InventorySpell {
|
||||||
|
|
||||||
@@ -60,26 +55,7 @@ public class Recycle extends InventorySpell {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onItemSelected(Item item) {
|
protected void onItemSelected(Item item) {
|
||||||
Item result;
|
Item result = ScrollOfTransmutation.changeItem(item);
|
||||||
do {
|
|
||||||
if (item instanceof Potion) {
|
|
||||||
result = Generator.randomUsingDefaults(Generator.Category.POTION);
|
|
||||||
if (item instanceof ExoticPotion){
|
|
||||||
result = Reflection.newInstance(ExoticPotion.regToExo.get(result.getClass()));
|
|
||||||
}
|
|
||||||
} else if (item instanceof Scroll) {
|
|
||||||
result = Generator.randomUsingDefaults(Generator.Category.SCROLL);
|
|
||||||
if (item instanceof ExoticScroll){
|
|
||||||
result = Reflection.newInstance(ExoticScroll.regToExo.get(result.getClass()));
|
|
||||||
}
|
|
||||||
} else if (item instanceof Plant.Seed) {
|
|
||||||
result = Generator.randomUsingDefaults(Generator.Category.SEED);
|
|
||||||
} else if (item instanceof Runestone) {
|
|
||||||
result = Generator.randomUsingDefaults(Generator.Category.STONE);
|
|
||||||
} else {
|
|
||||||
result = TippedDart.randomTipped(1);
|
|
||||||
}
|
|
||||||
} while (result.getClass() == item.getClass() || Challenges.isItemBlocked(result));
|
|
||||||
|
|
||||||
item.detach(curUser.belongings.backpack);
|
item.detach(curUser.belongings.backpack);
|
||||||
GLog.p(Messages.get(this, "recycled", result.name()));
|
GLog.p(Messages.get(this, "recycled", result.name()));
|
||||||
|
|||||||
Reference in New Issue
Block a user