v0.8.0: overhauled class armors, they now build charge based on exp

This commit is contained in:
Evan Debenham 2020-02-11 01:30:24 -05:00
parent 36d5e0384c
commit c062edbdb6
7 changed files with 76 additions and 36 deletions

View File

@ -43,6 +43,8 @@ abstract public class ClassArmor extends Armor {
} }
private int armorTier; private int armorTier;
protected float charge = 0;
public ClassArmor() { public ClassArmor() {
super( 6 ); super( 6 );
@ -78,23 +80,31 @@ abstract public class ClassArmor extends Armor {
classArmor.cursed = armor.cursed; classArmor.cursed = armor.cursed;
classArmor.curseInfusionBonus = armor.curseInfusionBonus; classArmor.curseInfusionBonus = armor.curseInfusionBonus;
classArmor.identify(); classArmor.identify();
classArmor.charge = 0;
if (owner.lvl > 18){
classArmor.charge += (owner.lvl-18)*25;
if (classArmor.charge > 100) classArmor.charge = 100;
}
return classArmor; return classArmor;
} }
private static final String ARMOR_TIER = "armortier"; private static final String ARMOR_TIER = "armortier";
private static final String CHARGE = "charge";
@Override @Override
public void storeInBundle( Bundle bundle ) { public void storeInBundle( Bundle bundle ) {
super.storeInBundle( bundle ); super.storeInBundle( bundle );
bundle.put( ARMOR_TIER, armorTier ); bundle.put( ARMOR_TIER, armorTier );
bundle.put( CHARGE, charge );
} }
@Override @Override
public void restoreFromBundle( Bundle bundle ) { public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle( bundle ); super.restoreFromBundle( bundle );
armorTier = bundle.getInt( ARMOR_TIER ); armorTier = bundle.getInt( ARMOR_TIER );
charge = bundle.getFloat(CHARGE);
} }
@Override @Override
@ -105,7 +115,12 @@ abstract public class ClassArmor extends Armor {
} }
return actions; return actions;
} }
@Override
public String status() {
return Messages.format( "%.0f%%", charge );
}
@Override @Override
public void execute( Hero hero, String action ) { public void execute( Hero hero, String action ) {
@ -113,19 +128,26 @@ abstract public class ClassArmor extends Armor {
if (action.equals(AC_SPECIAL)) { if (action.equals(AC_SPECIAL)) {
if (hero.HP < 3) { if (!isEquipped( hero )) {
GLog.w( Messages.get(this, "low_hp") );
} else if (!isEquipped( hero )) {
GLog.w( Messages.get(this, "not_equipped") ); GLog.w( Messages.get(this, "not_equipped") );
} else { } else if (charge < 35) {
GLog.w( Messages.get(this, "low_charge") );
} else {
curUser = hero; curUser = hero;
Invisibility.dispel();
doSpecial(); 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(); abstract public void doSpecial();
@Override @Override

View File

@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.armor;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Shuriken; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Shuriken;
@ -45,7 +46,11 @@ public class HuntressArmor extends ClassArmor {
@Override @Override
public void doSpecial() { public void doSpecial() {
Invisibility.dispel();
charge -= 35;
updateQuickslot();
Item proto = new Shuriken(); Item proto = new Shuriken();
for (Mob mob : Dungeon.level.mobs) { for (Mob mob : Dungeon.level.mobs) {
@ -76,8 +81,6 @@ public class HuntressArmor extends ClassArmor {
return; return;
} }
curUser.HP -= (curUser.HP / 3);
curUser.sprite.zap( curUser.pos ); curUser.sprite.zap( curUser.pos );
curUser.busy(); curUser.busy();
} }

View File

@ -27,11 +27,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning; 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.buffs.Roots;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Random;
public class MageArmor extends ClassArmor { public class MageArmor extends ClassArmor {
@ -41,23 +43,28 @@ public class MageArmor extends ClassArmor {
@Override @Override
public void doSpecial() { public void doSpecial() {
Invisibility.dispel();
charge -= 35;
updateQuickslot();
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
if (Dungeon.level.heroFOV[mob.pos] if (Dungeon.level.heroFOV[mob.pos]
&& mob.alignment != Char.Alignment.ALLY) { && mob.alignment != Char.Alignment.ALLY) {
Buff.affect( mob, Burning.class ).reignite( mob ); 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.spend( Actor.TICK );
curUser.sprite.operate( curUser.pos ); curUser.sprite.operate( curUser.pos );
curUser.busy(); curUser.busy();
curUser.sprite.centerEmitter().start( ElmoParticle.FACTORY, 0.15f, 4 ); curUser.sprite.emitter().start( ElmoParticle.FACTORY, 0.025f, 20 );
Sample.INSTANCE.play( Assets.SND_READ ); Sample.INSTANCE.play( Assets.SND_BURNING );
Sample.INSTANCE.play( Assets.SND_BURNING );
Sample.INSTANCE.play( Assets.SND_BURNING );
} }
} }

View File

@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; 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.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
@ -50,7 +51,7 @@ public class RogueArmor extends ClassArmor {
GameScene.selectCell( teleporter ); GameScene.selectCell( teleporter );
} }
protected static CellSelector.Listener teleporter = new CellSelector.Listener() { protected CellSelector.Listener teleporter = new CellSelector.Listener() {
@Override @Override
public void onSelect( Integer target ) { public void onSelect( Integer target ) {
@ -67,18 +68,20 @@ public class RogueArmor extends ClassArmor {
return; return;
} }
curUser.HP -= (curUser.HP / 3); charge -= 35;
updateQuickslot();
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
if (Dungeon.level.heroFOV[mob.pos] && mob.alignment != Char.Alignment.ALLY) { if (Dungeon.level.adjacent(mob.pos, curUser.pos) && mob.alignment != Char.Alignment.ALLY) {
Buff.prolong( mob, Blindness.class, 2 ); Buff.prolong( mob, Blindness.class, 5 );
if (mob.state == mob.HUNTING) mob.state = mob.WANDERING; if (mob.state == mob.HUNTING) mob.state = mob.WANDERING;
mob.sprite.emitter().burst( Speck.factory( Speck.LIGHT ), 4 ); 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 ); ScrollOfTeleportation.appear( curUser, target );
CellEmitter.get( target ).burst( Speck.factory( Speck.WOOL ), 10 );
Sample.INSTANCE.play( Assets.SND_PUFF ); Sample.INSTANCE.play( Assets.SND_PUFF );
Dungeon.level.occupyCell(curUser ); Dungeon.level.occupyCell(curUser );
Dungeon.observe(); Dungeon.observe();

View File

@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; 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.actors.buffs.Paralysis;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
@ -40,7 +41,7 @@ import com.watabou.utils.PathFinder;
public class WarriorArmor extends ClassArmor { public class WarriorArmor extends ClassArmor {
private static int LEAP_TIME = 1; private static int LEAP_TIME = 1;
private static int SHOCK_TIME = 3; private static int SHOCK_TIME = 5;
{ {
image = ItemSpriteSheet.ARMOR_WARRIOR; image = ItemSpriteSheet.ARMOR_WARRIOR;
@ -51,7 +52,7 @@ public class WarriorArmor extends ClassArmor {
GameScene.selectCell( leaper ); GameScene.selectCell( leaper );
} }
protected static CellSelector.Listener leaper = new CellSelector.Listener() { protected CellSelector.Listener leaper = new CellSelector.Listener() {
@Override @Override
public void onSelect( Integer target ) { public void onSelect( Integer target ) {
@ -65,7 +66,9 @@ public class WarriorArmor extends ClassArmor {
cell = route.path.get(route.dist-1); cell = route.path.get(route.dist-1);
curUser.HP -= (curUser.HP / 3); Invisibility.dispel();
charge -= 35;
updateQuickslot();
final int dest = cell; final int dest = cell;
curUser.busy(); curUser.busy();

View File

@ -275,8 +275,8 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
public void jump( int from, int to, Callback callback ) { public void jump( int from, int to, Callback callback ) {
jumpCallback = callback; jumpCallback = callback;
int distance = Dungeon.level.distance( from, to ); float distance = Dungeon.level.trueDistance( from, to );
jumpTweener = new JumpTweener( this, worldToCamera( to ), distance * 4, distance * 0.1f ); jumpTweener = new JumpTweener( this, worldToCamera( to ), distance * 2, distance * 0.1f );
jumpTweener.listener = this; jumpTweener.listener = this;
parent.add( jumpTweener ); parent.add( jumpTweener );
@ -681,14 +681,14 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
private static class JumpTweener extends Tweener { private static class JumpTweener extends Tweener {
public Visual visual; public CharSprite visual;
public PointF start; public PointF start;
public PointF end; public PointF end;
public float height; 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 ); super( visual, time );
this.visual = visual; this.visual = visual;
@ -700,7 +700,9 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
@Override @Override
protected void updateValues( float progress ) { 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;
} }
} }
} }

View File

@ -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.glyph=glyph
items.armor.armor$glyph.killed=%s killed you... 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.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.name=cloth armor
items.armor.clotharmor.desc=This lightweight armor offers basic protection. 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.name=huntress cloak
items.armor.huntressarmor.ac_special=SPECTRAL BLADES items.armor.huntressarmor.ac_special=SPECTRAL BLADES
items.armor.huntressarmor.no_enemies=No enemies in sight 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.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.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.name=mage robe
items.armor.magearmor.ac_special=MOLTEN EARTH 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.name=mail armor
items.armor.mailarmor.desc=Interlocking metal links make for a tough but flexible suit of 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.ac_special=SMOKE BOMB
items.armor.roguearmor.fov=You can only jump to an empty location in your field of view 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.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.name=scale armor
items.armor.scalearmor.desc=The metal scales sewn onto a leather vest create a flexible, yet protective 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.name=warrior suit of armor
items.armor.warriorarmor.ac_special=HEROIC LEAP items.armor.warriorarmor.ac_special=HEROIC LEAP
items.armor.warriorarmor.prompt=Choose direction to 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.prompt=Select an armor
items.stylus.identify=You must identify that armor first. items.stylus.identify=You must identify that armor first.
items.stylus.cursed=The stylus's magic will not work on cursed armor. 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.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 items.tomeofmastery.name=Tome of Mastery