v2.2.0: fixed further errors with seal transferring and class armor
This commit is contained in:
@@ -43,6 +43,7 @@ import com.watabou.noosa.audio.Sample;
|
|||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class BrokenSeal extends Item {
|
public class BrokenSeal extends Item {
|
||||||
|
|
||||||
@@ -63,6 +64,21 @@ public class BrokenSeal extends Item {
|
|||||||
|
|
||||||
private Armor.Glyph glyph;
|
private Armor.Glyph glyph;
|
||||||
|
|
||||||
|
public boolean canTransferGlyph(){
|
||||||
|
if (glyph == null){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (Dungeon.hero.pointsInTalent(Talent.RUNIC_TRANSFERENCE) == 2){
|
||||||
|
return true;
|
||||||
|
} else if (Dungeon.hero.pointsInTalent(Talent.RUNIC_TRANSFERENCE) == 1
|
||||||
|
&& (Arrays.asList(Armor.Glyph.common).contains(glyph.getClass())
|
||||||
|
|| Arrays.asList(Armor.Glyph.uncommon).contains(glyph.getClass()))){
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Armor.Glyph getGlyph(){
|
public Armor.Glyph getGlyph(){
|
||||||
return glyph;
|
return glyph;
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-17
@@ -183,16 +183,10 @@ public class Armor extends EquipableItem {
|
|||||||
if (detaching.level() > 0){
|
if (detaching.level() > 0){
|
||||||
degrade();
|
degrade();
|
||||||
}
|
}
|
||||||
if (detaching.getGlyph() != null){
|
if (detaching.canTransferGlyph()){
|
||||||
if (hero.hasTalent(Talent.RUNIC_TRANSFERENCE)
|
inscribe(null);
|
||||||
&& (Arrays.asList(Glyph.common).contains(detaching.getGlyph().getClass())
|
} else {
|
||||||
|| Arrays.asList(Glyph.uncommon).contains(detaching.getGlyph().getClass()))){
|
detaching.setGlyph(null);
|
||||||
inscribe(null);
|
|
||||||
} else if (hero.pointsInTalent(Talent.RUNIC_TRANSFERENCE) == 2){
|
|
||||||
inscribe(null);
|
|
||||||
} else {
|
|
||||||
detaching.setGlyph(null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
GLog.i( Messages.get(Armor.class, "detach_seal") );
|
GLog.i( Messages.get(Armor.class, "detach_seal") );
|
||||||
hero.sprite.operate(hero.pos);
|
hero.sprite.operate(hero.pos);
|
||||||
@@ -633,17 +627,17 @@ public class Armor extends EquipableItem {
|
|||||||
|
|
||||||
public static abstract class Glyph implements Bundlable {
|
public static abstract class Glyph implements Bundlable {
|
||||||
|
|
||||||
private static final Class<?>[] common = new Class<?>[]{
|
public static final Class<?>[] common = new Class<?>[]{
|
||||||
Obfuscation.class, Swiftness.class, Viscosity.class, Potential.class };
|
Obfuscation.class, Swiftness.class, Viscosity.class, Potential.class };
|
||||||
|
|
||||||
private static final Class<?>[] uncommon = new Class<?>[]{
|
public static final Class<?>[] uncommon = new Class<?>[]{
|
||||||
Brimstone.class, Stone.class, Entanglement.class,
|
Brimstone.class, Stone.class, Entanglement.class,
|
||||||
Repulsion.class, Camouflage.class, Flow.class };
|
Repulsion.class, Camouflage.class, Flow.class };
|
||||||
|
|
||||||
private static final Class<?>[] rare = new Class<?>[]{
|
public static final Class<?>[] rare = new Class<?>[]{
|
||||||
Affection.class, AntiMagic.class, Thorns.class };
|
Affection.class, AntiMagic.class, Thorns.class };
|
||||||
|
|
||||||
private static final float[] typeChances = new float[]{
|
public static final float[] typeChances = new float[]{
|
||||||
50, //12.5% each
|
50, //12.5% each
|
||||||
40, //6.67% each
|
40, //6.67% each
|
||||||
10 //3.33% each
|
10 //3.33% each
|
||||||
|
|||||||
+25
-13
@@ -31,7 +31,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
@@ -119,17 +118,9 @@ abstract public class ClassArmor extends Armor {
|
|||||||
classArmor.level(armor.trueLevel());
|
classArmor.level(armor.trueLevel());
|
||||||
classArmor.tier = armor.tier;
|
classArmor.tier = armor.tier;
|
||||||
classArmor.augment = armor.augment;
|
classArmor.augment = armor.augment;
|
||||||
BrokenSeal seal = armor.checkSeal();
|
classArmor.inscribe(armor.glyph);
|
||||||
if (seal != null) {
|
if (armor.seal != null) {
|
||||||
//want to preserve whether the glyph is on the armor or the seal
|
classArmor.seal = armor.seal;
|
||||||
if (seal.getGlyph() != null) {
|
|
||||||
classArmor.affixSeal(seal);
|
|
||||||
} else {
|
|
||||||
classArmor.inscribe(armor.glyph);
|
|
||||||
classArmor.affixSeal(seal);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
classArmor.inscribe(armor.glyph);
|
|
||||||
}
|
}
|
||||||
classArmor.cursed = armor.cursed;
|
classArmor.cursed = armor.cursed;
|
||||||
classArmor.curseInfusionBonus = armor.curseInfusionBonus;
|
classArmor.curseInfusionBonus = armor.curseInfusionBonus;
|
||||||
@@ -235,17 +226,38 @@ abstract public class ClassArmor extends Armor {
|
|||||||
level(armor.trueLevel());
|
level(armor.trueLevel());
|
||||||
tier = armor.tier;
|
tier = armor.tier;
|
||||||
augment = armor.augment;
|
augment = armor.augment;
|
||||||
inscribe( armor.glyph );
|
|
||||||
cursed = armor.cursed;
|
cursed = armor.cursed;
|
||||||
curseInfusionBonus = armor.curseInfusionBonus;
|
curseInfusionBonus = armor.curseInfusionBonus;
|
||||||
masteryPotionBonus = armor.masteryPotionBonus;
|
masteryPotionBonus = armor.masteryPotionBonus;
|
||||||
if (armor.checkSeal() != null) {
|
if (armor.checkSeal() != null) {
|
||||||
|
inscribe(armor.glyph);
|
||||||
seal = armor.checkSeal();
|
seal = armor.checkSeal();
|
||||||
if (seal.level() > 0) {
|
if (seal.level() > 0) {
|
||||||
int newLevel = trueLevel() + 1;
|
int newLevel = trueLevel() + 1;
|
||||||
level(newLevel);
|
level(newLevel);
|
||||||
Badges.validateItemLevelAquired(ClassArmor.this);
|
Badges.validateItemLevelAquired(ClassArmor.this);
|
||||||
}
|
}
|
||||||
|
} else if (checkSeal() != null){
|
||||||
|
//automates the process of detaching the glyph manually
|
||||||
|
// and re-affixing it to the new armor
|
||||||
|
if (seal.level() > 0 && trueLevel() <= armor.trueLevel()){
|
||||||
|
int newLevel = trueLevel() + 1;
|
||||||
|
level(newLevel);
|
||||||
|
Badges.validateItemLevelAquired(ClassArmor.this);
|
||||||
|
}
|
||||||
|
|
||||||
|
//if both source and destination armor have glyphs
|
||||||
|
// we assume the player wants the glyph on the destination armor
|
||||||
|
// they can always manually detach first if they don't.
|
||||||
|
// otherwise we automate glyph transfer just like upgrades
|
||||||
|
if (armor.glyph == null && seal.canTransferGlyph()){
|
||||||
|
//do nothing, keep our glyph
|
||||||
|
} else {
|
||||||
|
inscribe(armor.glyph);
|
||||||
|
seal.setGlyph(null);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
inscribe(armor.glyph);
|
||||||
}
|
}
|
||||||
|
|
||||||
identify();
|
identify();
|
||||||
|
|||||||
+8
-8
@@ -347,18 +347,18 @@ abstract public class Weapon extends KindOfWeapon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static abstract class Enchantment implements Bundlable {
|
public static abstract class Enchantment implements Bundlable {
|
||||||
|
|
||||||
private static final Class<?>[] common = new Class<?>[]{
|
public static final Class<?>[] common = new Class<?>[]{
|
||||||
Blazing.class, Chilling.class, Kinetic.class, Shocking.class};
|
Blazing.class, Chilling.class, Kinetic.class, Shocking.class};
|
||||||
|
|
||||||
private static final Class<?>[] uncommon = new Class<?>[]{
|
public static final Class<?>[] uncommon = new Class<?>[]{
|
||||||
Blocking.class, Blooming.class, Elastic.class,
|
Blocking.class, Blooming.class, Elastic.class,
|
||||||
Lucky.class, Projecting.class, Unstable.class};
|
Lucky.class, Projecting.class, Unstable.class};
|
||||||
|
|
||||||
private static final Class<?>[] rare = new Class<?>[]{
|
public static final Class<?>[] rare = new Class<?>[]{
|
||||||
Corrupting.class, Grim.class, Vampiric.class};
|
Corrupting.class, Grim.class, Vampiric.class};
|
||||||
|
|
||||||
private static final float[] typeChances = new float[]{
|
public static final float[] typeChances = new float[]{
|
||||||
50, //12.5% each
|
50, //12.5% each
|
||||||
40, //6.67% each
|
40, //6.67% each
|
||||||
10 //3.33% each
|
10 //3.33% each
|
||||||
|
|||||||
Reference in New Issue
Block a user