diff --git a/assets/items.png b/assets/items.png index a24f95aeb..c97dd983f 100644 Binary files a/assets/items.png and b/assets/items.png differ diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java index e5fa6d7f3..dc2d4dffa 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java @@ -109,7 +109,7 @@ public enum HeroClass { Dart darts = new Dart( 8 ); darts.identify().collect(); - new BrokenSeal().collect(); + hero.belongings.armor.affixSeal(new BrokenSeal()); Dungeon.quickslot.setSlot(0, darts); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/effects/Speck.java b/src/com/shatteredpixel/shatteredpixeldungeon/effects/Speck.java index d4b24526c..8c557395d 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/effects/Speck.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/effects/Speck.java @@ -21,14 +21,12 @@ package com.shatteredpixel.shatteredpixeldungeon.effects; import android.annotation.SuppressLint; -import android.util.FloatMath; import android.util.SparseArray; - +import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.watabou.noosa.Game; import com.watabou.noosa.Image; import com.watabou.noosa.TextureFilm; import com.watabou.noosa.particles.Emitter; -import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.watabou.utils.ColorMath; import com.watabou.utils.PointF; import com.watabou.utils.Random; @@ -439,10 +437,18 @@ public class Speck extends Image { } public static Emitter.Factory factory( final int type ) { - return factory( type, false ); + return factory( type, false, 0 ); } public static Emitter.Factory factory( final int type, final boolean lightMode ) { + return factory( type, lightMode, 0 ); + } + + public static Emitter.Factory factory( final int type, final int tint ) { + return factory( type, false, tint ); + } + + public static Emitter.Factory factory( final int type, final boolean lightMode, final int tint ) { Emitter.Factory factory = factories.get( type ); @@ -452,6 +458,7 @@ public class Speck extends Image { public void emit ( Emitter emitter, int index, float x, float y ) { Speck p = (Speck)emitter.recycle( Speck.class ); p.reset( index, x, y, type ); + if (tint != 0 ) p.tint( tint ); } @Override public boolean lightMode() { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/BrokenSeal.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/BrokenSeal.java index ceec16cba..50736bda7 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/BrokenSeal.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/BrokenSeal.java @@ -61,7 +61,7 @@ public class BrokenSeal extends Item { GLog.p(Messages.get(BrokenSeal.class, "affix")); Dungeon.hero.sprite.operate(Dungeon.hero.pos); Sample.INSTANCE.play(Assets.SND_UNLOCK); - armor.affixSigil((BrokenSeal)curItem); + armor.affixSeal((BrokenSeal)curItem); curItem.detach(Dungeon.hero.belongings.backpack); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java index 758970b78..a49b569fc 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java @@ -64,7 +64,7 @@ public class Armor extends EquipableItem { private int hitsToKnow = HITS_TO_KNOW; public Glyph glyph; - private boolean sigil; + private boolean seal; public Armor( int tier ) { @@ -75,14 +75,14 @@ public class Armor extends EquipableItem { private static final String UNFAMILIRIARITY = "unfamiliarity"; private static final String GLYPH = "glyph"; - private static final String SIGIL = "sigil"; + private static final String SEAL = "seal"; @Override public void storeInBundle( Bundle bundle ) { super.storeInBundle( bundle ); bundle.put( UNFAMILIRIARITY, hitsToKnow ); bundle.put( GLYPH, glyph ); - bundle.put( SIGIL, sigil ); + bundle.put( SEAL, seal); } @Override @@ -92,28 +92,28 @@ public class Armor extends EquipableItem { hitsToKnow = HITS_TO_KNOW; } inscribe((Glyph) bundle.get(GLYPH)); - sigil = bundle.getBoolean(SIGIL); - if (sigil) unique = true; + seal = bundle.getBoolean(SEAL); + if (seal) unique = true; } @Override public void reset() { super.reset(); - //armor can be kept in bones between runs, the sigil cannot. - sigil = false; + //armor can be kept in bones between runs, the seal cannot. + seal = false; } @Override public ArrayList actions(Hero hero) { ArrayList actions = super.actions(hero); - if (sigil) actions.add(AC_DETACH); + if (seal) actions.add(AC_DETACH); return actions; } @Override public void execute(Hero hero, String action) { - if (action.equals(AC_DETACH) && sigil){ - sigil = false; + if (action.equals(AC_DETACH) && seal){ + seal = false; BrokenSeal.WarriorShield sigilBuff = hero.buff(BrokenSeal.WarriorShield.class); if (sigilBuff != null) sigilBuff.setArmor(null); @@ -163,11 +163,11 @@ public class Armor extends EquipableItem { @Override public void activate(Char ch) { - if (sigil) Buff.affect(ch, BrokenSeal.WarriorShield.class).setArmor(this); + if (seal) Buff.affect(ch, BrokenSeal.WarriorShield.class).setArmor(this); } - public void affixSigil(BrokenSeal sigil){ - this.sigil = true; + public void affixSeal(BrokenSeal sigil){ + this.seal = true; if (sigil.level() > 0){ //doesn't override existing glyphs, but doesn't create one either upgrade(glyph != null); @@ -293,6 +293,8 @@ public class Armor extends EquipableItem { info += "\n\n" + Messages.get(Armor.class, "cursed_worn"); } else if (cursedKnown && cursed) { info += "\n\n" + Messages.get(Armor.class, "cursed"); + } else if (seal) { + info += "\n\n" + Messages.get(Armor.class, "seal_attached"); } return info; @@ -300,11 +302,11 @@ public class Armor extends EquipableItem { @Override public Emitter emitter() { - if (!sigil) return super.emitter(); + if (!seal) return super.emitter(); Emitter emitter = new Emitter(); emitter.pos(10f, 6f); emitter.fillTarget = false; - emitter.pour(Speck.factory( Speck.LIGHT ), 1f); + emitter.pour(Speck.factory( Speck.LIGHT, 0xFFCC0000 ), 0.6f); return emitter; } @@ -343,6 +345,7 @@ public class Armor extends EquipableItem { @Override public int price() { + if (seal) return 0; int price = 10 * (1 << (tier - 1)); if (glyph != null) { price *= 1.5; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index bc222f441..9df2a5d50 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -41,6 +41,7 @@ items.armor.armor.probably_too_heavy=Probably this armor is too heavy for you. items.armor.armor.inscribed=It is inscribed with a %s. items.armor.armor.cursed_worn=Because this armor is cursed, you are powerless to remove it. items.armor.armor.cursed=You can feel a malevolent magic lurking within this armor. +items.armor.armor.seal_attached=The Warrior's broken seal is attached to this armor. items.armor.armor$glyph.glyph=glyph items.armor.armor$glyph.killed=%s killed you... @@ -809,7 +810,7 @@ items.brokenseal.prompt=Select an armor items.brokenseal.unknown_armor=You must identify that armor first. items.brokenseal.degraded_armor=That armor is in too poor a condition. items.brokenseal.affix=You affix the sigil to your armor! -items.brokenseal.desc=A broken seal from the warrior's past.\n\nMORE STUFF NEEDED HERE. +items.brokenseal.desc=A wax seal, meant to be affixed to armor. The writing on its paper has long since faded, and it is broken down the middle. Through a bit of magic, the seal can be moved between armors, carrying over a single upgrade.\n\nA memento from his home, the seal helps the warrior persevere. While wearing the seal the warrior will slowly generate shielding ontop of his health based on the quality of his armor. items.dewdrop.name=dewdrop items.dewdrop.value=%+dHP