v0.3.5: polish on the warrior's seal

This commit is contained in:
Evan Debenham 2016-04-15 11:13:52 -04:00
parent 0e4c0b6499
commit e883272242
6 changed files with 33 additions and 22 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -109,7 +109,7 @@ public enum HeroClass {
Dart darts = new Dart( 8 ); Dart darts = new Dart( 8 );
darts.identify().collect(); darts.identify().collect();
new BrokenSeal().collect(); hero.belongings.armor.affixSeal(new BrokenSeal());
Dungeon.quickslot.setSlot(0, darts); Dungeon.quickslot.setSlot(0, darts);

View File

@ -21,14 +21,12 @@
package com.shatteredpixel.shatteredpixeldungeon.effects; package com.shatteredpixel.shatteredpixeldungeon.effects;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.util.FloatMath;
import android.util.SparseArray; import android.util.SparseArray;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.watabou.noosa.Game; import com.watabou.noosa.Game;
import com.watabou.noosa.Image; import com.watabou.noosa.Image;
import com.watabou.noosa.TextureFilm; import com.watabou.noosa.TextureFilm;
import com.watabou.noosa.particles.Emitter; import com.watabou.noosa.particles.Emitter;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.watabou.utils.ColorMath; import com.watabou.utils.ColorMath;
import com.watabou.utils.PointF; import com.watabou.utils.PointF;
import com.watabou.utils.Random; import com.watabou.utils.Random;
@ -439,10 +437,18 @@ public class Speck extends Image {
} }
public static Emitter.Factory factory( final int type ) { 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 ) { 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 ); 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 ) { public void emit ( Emitter emitter, int index, float x, float y ) {
Speck p = (Speck)emitter.recycle( Speck.class ); Speck p = (Speck)emitter.recycle( Speck.class );
p.reset( index, x, y, type ); p.reset( index, x, y, type );
if (tint != 0 ) p.tint( tint );
} }
@Override @Override
public boolean lightMode() { public boolean lightMode() {

View File

@ -61,7 +61,7 @@ public class BrokenSeal extends Item {
GLog.p(Messages.get(BrokenSeal.class, "affix")); GLog.p(Messages.get(BrokenSeal.class, "affix"));
Dungeon.hero.sprite.operate(Dungeon.hero.pos); Dungeon.hero.sprite.operate(Dungeon.hero.pos);
Sample.INSTANCE.play(Assets.SND_UNLOCK); Sample.INSTANCE.play(Assets.SND_UNLOCK);
armor.affixSigil((BrokenSeal)curItem); armor.affixSeal((BrokenSeal)curItem);
curItem.detach(Dungeon.hero.belongings.backpack); curItem.detach(Dungeon.hero.belongings.backpack);
} }
} }

View File

@ -64,7 +64,7 @@ public class Armor extends EquipableItem {
private int hitsToKnow = HITS_TO_KNOW; private int hitsToKnow = HITS_TO_KNOW;
public Glyph glyph; public Glyph glyph;
private boolean sigil; private boolean seal;
public Armor( int tier ) { public Armor( int tier ) {
@ -75,14 +75,14 @@ public class Armor extends EquipableItem {
private static final String UNFAMILIRIARITY = "unfamiliarity"; private static final String UNFAMILIRIARITY = "unfamiliarity";
private static final String GLYPH = "glyph"; private static final String GLYPH = "glyph";
private static final String SIGIL = "sigil"; private static final String SEAL = "seal";
@Override @Override
public void storeInBundle( Bundle bundle ) { public void storeInBundle( Bundle bundle ) {
super.storeInBundle( bundle ); super.storeInBundle( bundle );
bundle.put( UNFAMILIRIARITY, hitsToKnow ); bundle.put( UNFAMILIRIARITY, hitsToKnow );
bundle.put( GLYPH, glyph ); bundle.put( GLYPH, glyph );
bundle.put( SIGIL, sigil ); bundle.put( SEAL, seal);
} }
@Override @Override
@ -92,28 +92,28 @@ public class Armor extends EquipableItem {
hitsToKnow = HITS_TO_KNOW; hitsToKnow = HITS_TO_KNOW;
} }
inscribe((Glyph) bundle.get(GLYPH)); inscribe((Glyph) bundle.get(GLYPH));
sigil = bundle.getBoolean(SIGIL); seal = bundle.getBoolean(SEAL);
if (sigil) unique = true; if (seal) unique = true;
} }
@Override @Override
public void reset() { public void reset() {
super.reset(); super.reset();
//armor can be kept in bones between runs, the sigil cannot. //armor can be kept in bones between runs, the seal cannot.
sigil = false; seal = false;
} }
@Override @Override
public ArrayList<String> actions(Hero hero) { public ArrayList<String> actions(Hero hero) {
ArrayList<String> actions = super.actions(hero); ArrayList<String> actions = super.actions(hero);
if (sigil) actions.add(AC_DETACH); if (seal) actions.add(AC_DETACH);
return actions; return actions;
} }
@Override @Override
public void execute(Hero hero, String action) { public void execute(Hero hero, String action) {
if (action.equals(AC_DETACH) && sigil){ if (action.equals(AC_DETACH) && seal){
sigil = false; seal = false;
BrokenSeal.WarriorShield sigilBuff = hero.buff(BrokenSeal.WarriorShield.class); BrokenSeal.WarriorShield sigilBuff = hero.buff(BrokenSeal.WarriorShield.class);
if (sigilBuff != null) sigilBuff.setArmor(null); if (sigilBuff != null) sigilBuff.setArmor(null);
@ -163,11 +163,11 @@ public class Armor extends EquipableItem {
@Override @Override
public void activate(Char ch) { 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){ public void affixSeal(BrokenSeal sigil){
this.sigil = true; this.seal = true;
if (sigil.level() > 0){ if (sigil.level() > 0){
//doesn't override existing glyphs, but doesn't create one either //doesn't override existing glyphs, but doesn't create one either
upgrade(glyph != null); upgrade(glyph != null);
@ -293,6 +293,8 @@ public class Armor extends EquipableItem {
info += "\n\n" + Messages.get(Armor.class, "cursed_worn"); info += "\n\n" + Messages.get(Armor.class, "cursed_worn");
} else if (cursedKnown && cursed) { } else if (cursedKnown && cursed) {
info += "\n\n" + Messages.get(Armor.class, "cursed"); info += "\n\n" + Messages.get(Armor.class, "cursed");
} else if (seal) {
info += "\n\n" + Messages.get(Armor.class, "seal_attached");
} }
return info; return info;
@ -300,11 +302,11 @@ public class Armor extends EquipableItem {
@Override @Override
public Emitter emitter() { public Emitter emitter() {
if (!sigil) return super.emitter(); if (!seal) return super.emitter();
Emitter emitter = new Emitter(); Emitter emitter = new Emitter();
emitter.pos(10f, 6f); emitter.pos(10f, 6f);
emitter.fillTarget = false; emitter.fillTarget = false;
emitter.pour(Speck.factory( Speck.LIGHT ), 1f); emitter.pour(Speck.factory( Speck.LIGHT, 0xFFCC0000 ), 0.6f);
return emitter; return emitter;
} }
@ -343,6 +345,7 @@ public class Armor extends EquipableItem {
@Override @Override
public int price() { public int price() {
if (seal) return 0;
int price = 10 * (1 << (tier - 1)); int price = 10 * (1 << (tier - 1));
if (glyph != null) { if (glyph != null) {
price *= 1.5; price *= 1.5;

View File

@ -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.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_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.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.glyph=glyph
items.armor.armor$glyph.killed=%s killed you... 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.unknown_armor=You must identify that armor first.
items.brokenseal.degraded_armor=That armor is in too poor a condition. items.brokenseal.degraded_armor=That armor is in too poor a condition.
items.brokenseal.affix=You affix the sigil to your armor! 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.name=dewdrop
items.dewdrop.value=%+dHP items.dewdrop.value=%+dHP