v0.4.0: updated well of transformation logic

This commit is contained in:
Evan Debenham 2016-06-09 07:19:29 -04:00 committed by Evan Debenham
parent 13bb64468e
commit 51fedcb229
2 changed files with 29 additions and 51 deletions

View File

@ -36,6 +36,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.BattleAxe;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Dagger;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Glaive;
@ -47,8 +48,10 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Quarterstaff;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Spear;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Sword;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.WarHammer;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
import com.watabou.utils.Random;
public class WaterOfTransmutation extends WellWater {
@ -87,41 +90,18 @@ public class WaterOfTransmutation extends WellWater {
emitter.start( Speck.factory( Speck.CHANGE ), 0.2f, 0 );
}
private MeleeWeapon changeWeapon( MeleeWeapon w ) {
private Weapon changeWeapon( MeleeWeapon w ) {
MeleeWeapon n = null;
Weapon n;
Category c = Generator.wepTiers[w.tier-1];
if (w instanceof Knuckles) {
n = new Dagger();
} else if (w instanceof Dagger) {
n = new Knuckles();
do {
try {
n = (Weapon)c.classes[Random.chances(c.probs)].newInstance();
} catch (Exception e) {
return null;
}
else if (w instanceof Spear) {
n = new Quarterstaff();
} else if (w instanceof Quarterstaff) {
n = new Spear();
}
else if (w instanceof Sword) {
n = new Mace();
} else if (w instanceof Mace) {
n = new Sword();
}
else if (w instanceof Longsword) {
n = new BattleAxe();
} else if (w instanceof BattleAxe) {
n = new Longsword();
}
else if (w instanceof Glaive) {
n = new WarHammer();
} else if (w instanceof WarHammer) {
n = new Glaive();
}
if (n != null) {
} while (!(n instanceof MeleeWeapon) || n.getClass() == w.getClass());
int level = w.level();
if (level > 0) {
@ -137,9 +117,7 @@ public class WaterOfTransmutation extends WellWater {
n.imbue = w.imbue;
return n;
} else {
return null;
}
}
private Ring changeRing( Ring r ) {

View File

@ -332,7 +332,7 @@ public class Generator {
}
}
private static final Category[] wepTiers = new Category[]{
public static final Category[] wepTiers = new Category[]{
Category.WEP_T1,
Category.WEP_T2,
Category.WEP_T3,