diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java index f255ef5d4..5dbf1641d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java @@ -43,6 +43,8 @@ abstract public class ClassArmor extends Armor { } private int armorTier; + + protected float charge = 0; public ClassArmor() { super( 6 ); @@ -78,23 +80,31 @@ abstract public class ClassArmor extends Armor { classArmor.cursed = armor.cursed; classArmor.curseInfusionBonus = armor.curseInfusionBonus; classArmor.identify(); + + classArmor.charge = 0; + if (owner.lvl > 18){ + classArmor.charge += (owner.lvl-18)*25; + if (classArmor.charge > 100) classArmor.charge = 100; + } return classArmor; } private static final String ARMOR_TIER = "armortier"; + private static final String CHARGE = "charge"; @Override public void storeInBundle( Bundle bundle ) { super.storeInBundle( bundle ); bundle.put( ARMOR_TIER, armorTier ); + bundle.put( CHARGE, charge ); } @Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle( bundle ); - armorTier = bundle.getInt( ARMOR_TIER ); + charge = bundle.getFloat(CHARGE); } @Override @@ -105,7 +115,12 @@ abstract public class ClassArmor extends Armor { } return actions; } - + + @Override + public String status() { + return Messages.format( "%.0f%%", charge ); + } + @Override public void execute( Hero hero, String action ) { @@ -113,19 +128,26 @@ abstract public class ClassArmor extends Armor { if (action.equals(AC_SPECIAL)) { - if (hero.HP < 3) { - GLog.w( Messages.get(this, "low_hp") ); - } else if (!isEquipped( hero )) { + if (!isEquipped( hero )) { GLog.w( Messages.get(this, "not_equipped") ); - } else { + } else if (charge < 35) { + GLog.w( Messages.get(this, "low_charge") ); + } else { curUser = hero; - Invisibility.dispel(); doSpecial(); } } } + @Override + public void onHeroGainExp(float levelPercent, Hero hero) { + super.onHeroGainExp(levelPercent, hero); + charge += 50 * levelPercent; + if (charge > 100) charge = 100; + updateQuickslot(); + } + abstract public void doSpecial(); @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/HuntressArmor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/HuntressArmor.java index 2cb152cdb..725d4cdae 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/HuntressArmor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/HuntressArmor.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.armor; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Shuriken; @@ -45,7 +46,11 @@ public class HuntressArmor extends ClassArmor { @Override public void doSpecial() { - + + Invisibility.dispel(); + charge -= 35; + updateQuickslot(); + Item proto = new Shuriken(); for (Mob mob : Dungeon.level.mobs) { @@ -76,8 +81,6 @@ public class HuntressArmor extends ClassArmor { return; } - curUser.HP -= (curUser.HP / 3); - curUser.sprite.zap( curUser.pos ); curUser.busy(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/MageArmor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/MageArmor.java index 73d300abe..295e1f248 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/MageArmor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/MageArmor.java @@ -27,11 +27,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; +import com.watabou.utils.Random; public class MageArmor extends ClassArmor { @@ -41,23 +43,28 @@ public class MageArmor extends ClassArmor { @Override public void doSpecial() { - + + Invisibility.dispel(); + charge -= 35; + updateQuickslot(); + for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { if (Dungeon.level.heroFOV[mob.pos] && mob.alignment != Char.Alignment.ALLY) { Buff.affect( mob, Burning.class ).reignite( mob ); - Buff.prolong( mob, Roots.class, 3 ); + Buff.prolong( mob, Roots.class, 5 ); + mob.damage(Random.NormalIntRange(4, 16 + Dungeon.depth), Burning.class); } } - - curUser.HP -= (curUser.HP / 3); curUser.spend( Actor.TICK ); curUser.sprite.operate( curUser.pos ); curUser.busy(); - curUser.sprite.centerEmitter().start( ElmoParticle.FACTORY, 0.15f, 4 ); - Sample.INSTANCE.play( Assets.SND_READ ); + curUser.sprite.emitter().start( ElmoParticle.FACTORY, 0.025f, 20 ); + Sample.INSTANCE.play( Assets.SND_BURNING ); + Sample.INSTANCE.play( Assets.SND_BURNING ); + Sample.INSTANCE.play( Assets.SND_BURNING ); } } \ No newline at end of file diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/RogueArmor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/RogueArmor.java index fc8422dd3..bc756b0c5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/RogueArmor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/RogueArmor.java @@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; @@ -50,7 +51,7 @@ public class RogueArmor extends ClassArmor { GameScene.selectCell( teleporter ); } - protected static CellSelector.Listener teleporter = new CellSelector.Listener() { + protected CellSelector.Listener teleporter = new CellSelector.Listener() { @Override public void onSelect( Integer target ) { @@ -67,18 +68,20 @@ public class RogueArmor extends ClassArmor { return; } - curUser.HP -= (curUser.HP / 3); + charge -= 35; + updateQuickslot(); for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - if (Dungeon.level.heroFOV[mob.pos] && mob.alignment != Char.Alignment.ALLY) { - Buff.prolong( mob, Blindness.class, 2 ); + if (Dungeon.level.adjacent(mob.pos, curUser.pos) && mob.alignment != Char.Alignment.ALLY) { + Buff.prolong( mob, Blindness.class, 5 ); if (mob.state == mob.HUNTING) mob.state = mob.WANDERING; mob.sprite.emitter().burst( Speck.factory( Speck.LIGHT ), 4 ); } } - + Buff.affect(curUser, Invisibility.class, 10f); + + CellEmitter.get( curUser.pos ).burst( Speck.factory( Speck.WOOL ), 10 ); ScrollOfTeleportation.appear( curUser, target ); - CellEmitter.get( target ).burst( Speck.factory( Speck.WOOL ), 10 ); Sample.INSTANCE.play( Assets.SND_PUFF ); Dungeon.level.occupyCell(curUser ); Dungeon.observe(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/WarriorArmor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/WarriorArmor.java index 42638ae21..5a0113c84 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/WarriorArmor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/WarriorArmor.java @@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; @@ -40,7 +41,7 @@ import com.watabou.utils.PathFinder; public class WarriorArmor extends ClassArmor { private static int LEAP_TIME = 1; - private static int SHOCK_TIME = 3; + private static int SHOCK_TIME = 5; { image = ItemSpriteSheet.ARMOR_WARRIOR; @@ -51,7 +52,7 @@ public class WarriorArmor extends ClassArmor { GameScene.selectCell( leaper ); } - protected static CellSelector.Listener leaper = new CellSelector.Listener() { + protected CellSelector.Listener leaper = new CellSelector.Listener() { @Override public void onSelect( Integer target ) { @@ -65,7 +66,9 @@ public class WarriorArmor extends ClassArmor { cell = route.path.get(route.dist-1); - curUser.HP -= (curUser.HP / 3); + Invisibility.dispel(); + charge -= 35; + updateQuickslot(); final int dest = cell; curUser.busy(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java index 4c1b87395..31d0aca9d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java @@ -275,8 +275,8 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip public void jump( int from, int to, Callback callback ) { jumpCallback = callback; - int distance = Dungeon.level.distance( from, to ); - jumpTweener = new JumpTweener( this, worldToCamera( to ), distance * 4, distance * 0.1f ); + float distance = Dungeon.level.trueDistance( from, to ); + jumpTweener = new JumpTweener( this, worldToCamera( to ), distance * 2, distance * 0.1f ); jumpTweener.listener = this; parent.add( jumpTweener ); @@ -681,14 +681,14 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip private static class JumpTweener extends Tweener { - public Visual visual; + public CharSprite visual; public PointF start; public PointF end; public float height; - public JumpTweener( Visual visual, PointF pos, float height, float time ) { + public JumpTweener( CharSprite visual, PointF pos, float height, float time ) { super( visual, time ); this.visual = visual; @@ -700,7 +700,9 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip @Override protected void updateValues( float progress ) { - visual.point( PointF.inter( start, end, progress ).offset( 0, -height * 4 * progress * (1 - progress) ) ); + float hVal = -height * 4 * progress * (1 - progress); + visual.point( PointF.inter( start, end, progress ).offset( 0, hVal ) ); + visual.shadowOffset = 0.25f - hVal*0.8f; } } } diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index cdb37dec1..60f29ee88 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -93,8 +93,8 @@ items.armor.armor.seal_attached=The Warrior's broken seal is attached to this ar items.armor.armor$glyph.glyph=glyph items.armor.armor$glyph.killed=%s killed you... -items.armor.classarmor.low_hp=Your health is too low! items.armor.classarmor.not_equipped=You need to be wearing this armor to use its special power! +items.armor.classarmor.low_charge=The armor does not have enough charge to use its special power! items.armor.clotharmor.name=cloth armor items.armor.clotharmor.desc=This lightweight armor offers basic protection. @@ -102,14 +102,14 @@ items.armor.clotharmor.desc=This lightweight armor offers basic protection. items.armor.huntressarmor.name=huntress cloak items.armor.huntressarmor.ac_special=SPECTRAL BLADES items.armor.huntressarmor.no_enemies=No enemies in sight -items.armor.huntressarmor.desc=A huntress in such cloak can create a fan of spectral blades. Each of these blades will target a single enemy in the huntress's field of view, inflicting damage depending on her currently equipped melee weapon. +items.armor.huntressarmor.desc=While wearing this cloak, the huntress can create a fan of spectral blades. Each of these blades will target a single enemy in the huntress's field of view, inflicting damage depending on her currently equipped melee weapon.\n\nUsing this ability will consume 35% of the armor's charge. The armor steadily builds charge as the huntress gains experience. items.armor.leatherarmor.name=leather armor items.armor.leatherarmor.desc=Armor made from tanned monster hide. Not as light as cloth armor but provides better protection. items.armor.magearmor.name=mage robe items.armor.magearmor.ac_special=MOLTEN EARTH -items.armor.magearmor.desc=Wearing this gorgeous robe, a mage can cast a spell of molten earth: all the enemies in his field of view will be set on fire and unable to move at the same time. +items.armor.magearmor.desc=While wearing this gorgeous robe, the mage can cast a spell of molten earth. All the enemies in his field of view will be rooted to the ground and blasted by flames.\n\nUsing this ability will consume 35% of the armor's charge. The armor steadily builds charge as the mage gains experience. items.armor.mailarmor.name=mail armor items.armor.mailarmor.desc=Interlocking metal links make for a tough but flexible suit of armor. @@ -121,7 +121,7 @@ items.armor.roguearmor.name=rogue garb items.armor.roguearmor.ac_special=SMOKE BOMB items.armor.roguearmor.fov=You can only jump to an empty location in your field of view items.armor.roguearmor.prompt=Choose a location to jump to -items.armor.roguearmor.desc=Wearing this dark garb, a rogue can perform a trick, that is called "smoke bomb": he blinds enemies who could see him and jumps aside. +items.armor.roguearmor.desc=When wearing this dark garb, the rogue can blink to any nearby location which he can see, leaving a plume of smoke where he stood. This ability makes the rogue temporarily invisible, and blinds any enemies adjacent to his old location.\n\nUsing this ability will consume 35% of the armor's charge. The armor steadily builds charge as the rogue gains experience. items.armor.scalearmor.name=scale armor items.armor.scalearmor.desc=The metal scales sewn onto a leather vest create a flexible, yet protective armor. @@ -129,7 +129,7 @@ items.armor.scalearmor.desc=The metal scales sewn onto a leather vest create a f items.armor.warriorarmor.name=warrior suit of armor items.armor.warriorarmor.ac_special=HEROIC LEAP items.armor.warriorarmor.prompt=Choose direction to leap -items.armor.warriorarmor.desc=While this armor looks heavy, it allows a warrior to perform heroic leap towards a targeted location, slamming down to stun all neighbouring enemies. +items.armor.warriorarmor.desc=While this armor looks heavy, it allows the warrior to perform a heroic leap towards a targeted location, slamming down to stun all neighbouring enemies.\n\nUsing this ability will consume 35% of the armor's charge. The armor steadily builds charge as the warrior gains experience. @@ -1670,7 +1670,7 @@ items.stylus.ac_inscribe=INSCRIBE items.stylus.prompt=Select an armor items.stylus.identify=You must identify that armor first. items.stylus.cursed=The stylus's magic will not work on cursed armor. -items.stylus.inscribed=You inscribed your armor with the stylus +items.stylus.inscribed=You inscribed your armor with the stylus. items.stylus.desc=This arcane stylus is made of some dark, very hard stone. Using it you can inscribe a magical glyph on your armor, but you have no power over choosing what glyph it will be, the stylus will decide it for you. items.tomeofmastery.name=Tome of Mastery