v0.9.1: implemented the runic transference talent
This commit is contained in:
parent
7acab31316
commit
1182a13cef
|
@ -1614,6 +1614,8 @@ items.brokenseal.unknown_armor=You must identify that armor first.
|
|||
items.brokenseal.degraded_armor=The condition of this armor is too poor.
|
||||
items.brokenseal.affix=You affix the seal to your armor!
|
||||
items.brokenseal.desc=A wax seal, affixed to armor as a symbol of valor. All the markings on the seal have worn off with age and it is broken in half down the middle.\n\nA memento from his home, the seal helps the warrior persevere. While wearing the seal the warrior will slowly generate shielding on top of his health based on the quality of his armor.\n\nThe seal can be _affixed to armor,_ and moved between armors. It can carry a single upgrade with it.
|
||||
items.brokenseal.choose_title=Choose a Glyph
|
||||
items.brokenseal.choose_desc=Both this armor and the broken seal are carrying a glyph. Pick which glyph should be kept.\n\nNote that if you pick the glyph that is currently on the armor, the seal will not be able to transfer it later.
|
||||
|
||||
items.dewdrop.name=dewdrop
|
||||
items.dewdrop.value=%+dHP
|
||||
|
|
|
@ -29,9 +29,11 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndUseItem;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
||||
|
@ -54,6 +56,21 @@ public class BrokenSeal extends Item {
|
|||
defaultAction = AC_INFO;
|
||||
}
|
||||
|
||||
private Armor.Glyph glyph;
|
||||
|
||||
public Armor.Glyph getGlyph(){
|
||||
return glyph;
|
||||
}
|
||||
|
||||
public void setGlyph( Armor.Glyph glyph ){
|
||||
this.glyph = glyph;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemSprite.Glowing glowing() {
|
||||
return glyph != null ? glyph.glowing() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<String> actions(Hero hero) {
|
||||
ArrayList<String> actions = super.actions(hero);
|
||||
|
@ -89,6 +106,23 @@ public class BrokenSeal extends Item {
|
|||
GLog.w(Messages.get(BrokenSeal.class, "unknown_armor"));
|
||||
} else if (armor.cursed || armor.level() < 0){
|
||||
GLog.w(Messages.get(BrokenSeal.class, "degraded_armor"));
|
||||
} else if (armor.glyph != null && ((BrokenSeal)curItem).getGlyph() != null) {
|
||||
GameScene.show(new WndOptions(Messages.get(BrokenSeal.class, "choose_title"),
|
||||
Messages.get(BrokenSeal.class, "choose_desc"),
|
||||
armor.glyph.name(),
|
||||
((BrokenSeal)curItem).getGlyph().name()){
|
||||
@Override
|
||||
protected void onSelect(int index) {
|
||||
if (index == 0) ((BrokenSeal)curItem).setGlyph(null);
|
||||
//if index is 1, then the glyph transfer happens in affixSeal
|
||||
|
||||
GLog.p(Messages.get(BrokenSeal.class, "affix"));
|
||||
Dungeon.hero.sprite.operate(Dungeon.hero.pos);
|
||||
Sample.INSTANCE.play(Assets.Sounds.UNLOCK);
|
||||
armor.affixSeal((BrokenSeal)curItem);
|
||||
curItem.detach(Dungeon.hero.belongings.backpack);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
GLog.p(Messages.get(BrokenSeal.class, "affix"));
|
||||
Dungeon.hero.sprite.operate(Dungeon.hero.pos);
|
||||
|
|
|
@ -173,6 +173,17 @@ public class Armor extends EquipableItem {
|
|||
if (seal.level() > 0){
|
||||
degrade();
|
||||
}
|
||||
if (seal.getGlyph() != null){
|
||||
if (hero.hasTalent(Talent.RUNIC_TRANSFERENCE)
|
||||
&& Arrays.asList(Glyph.common).contains(seal.getGlyph().getClass())){
|
||||
inscribe(null);
|
||||
} else if (hero.pointsInTalent(Talent.RUNIC_TRANSFERENCE) == 2
|
||||
&& Arrays.asList(Glyph.uncommon).contains(seal.getGlyph().getClass())){
|
||||
inscribe(null);
|
||||
} else {
|
||||
seal.setGlyph(null);
|
||||
}
|
||||
}
|
||||
GLog.i( Messages.get(Armor.class, "detach_seal") );
|
||||
hero.sprite.operate(hero.pos);
|
||||
if (!seal.collect()){
|
||||
|
@ -223,6 +234,9 @@ public class Armor extends EquipableItem {
|
|||
level(level()+1);
|
||||
Badges.validateItemLevelAquired(this);
|
||||
}
|
||||
if (seal.getGlyph() != null){
|
||||
inscribe(seal.getGlyph());
|
||||
}
|
||||
if (isEquipped(Dungeon.hero)){
|
||||
Buff.affect(Dungeon.hero, BrokenSeal.WarriorShield.class).setArmor(this);
|
||||
}
|
||||
|
@ -542,6 +556,11 @@ public class Armor extends EquipableItem {
|
|||
if (glyph == null || !glyph.curse()) curseInfusionBonus = false;
|
||||
this.glyph = glyph;
|
||||
updateQuickslot();
|
||||
//the hero needs runic transference to actually transfer, but we still attach the glyph here
|
||||
// in case they take that talent in the future
|
||||
if (glyph != null && seal != null){
|
||||
seal.setGlyph(glyph);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user