v0.9.0: implemented a defensive talent for rogue and huntress

This commit is contained in:
Evan Debenham 2020-09-18 17:39:05 -04:00
parent 1421b2b7b7
commit d4666e94b1
4 changed files with 34 additions and 8 deletions

View File

@ -318,16 +318,16 @@ actors.hero.talent.thiefs_intuition.title=thief's intuition
actors.hero.talent.thiefs_intuition.desc=_+1:_ The Rogue identifies rings _2x faster_, and identifies the type of a ring _when he equips it_.\n\n_+2:_ The Rogue identifies rings _when he equips them_, and identifies the type of a ring _when he picks it up_. actors.hero.talent.thiefs_intuition.desc=_+1:_ The Rogue identifies rings _2x faster_, and identifies the type of a ring _when he equips it_.\n\n_+2:_ The Rogue identifies rings _when he equips them_, and identifies the type of a ring _when he picks it up_.
actors.hero.talent.test_rogue_3.title=test talent actors.hero.talent.test_rogue_3.title=test talent
actors.hero.talent.test_rogue_3.desc=TODO actors.hero.talent.test_rogue_3.desc=TODO
actors.hero.talent.test_rogue_4.title=test talent actors.hero.talent.mending_shadows.title=mending shadows
actors.hero.talent.test_rogue_4.desc=TODO actors.hero.talent.mending_shadows.desc=_+1:_ The Rogue heals for 1 HP every _3 consecutive turns_ that he is hidden by his cloak.\n\n_+2:_ The Rogue heals for 1 HP every _2 consecutive turns_ that he is hidden by his cloak.
actors.hero.talent.invigorating_meal.title=invigorating meal actors.hero.talent.invigorating_meal.title=invigorating meal
actors.hero.talent.invigorating_meal.desc=_+1:_ Eating at below 50% health takes 1 turn and grants the Huntress _2 turns of haste_.\n\n_+2:_ Eating at below 50% health takes 1 turn and grants the Huntress _3 turns of haste_. actors.hero.talent.invigorating_meal.desc=_+1:_ Eating at below 50% health takes 1 turn and grants the Huntress _2 turns of haste_.\n\n_+2:_ Eating at below 50% health takes 1 turn and grants the Huntress _3 turns of haste_.
actors.hero.talent.survivalists_intuition.title=survivalist's intuition actors.hero.talent.survivalists_intuition.title=survivalist's intuition
actors.hero.talent.survivalists_intuition.desc=_+1:_ The Huntress identifies all equipment _1.5x faster_.\n\n_+2:_ The Huntress identifies all equipment _2x faster_. actors.hero.talent.survivalists_intuition.desc=_+1:_ The Huntress identifies all equipment _1.5x faster_.\n\n_+2:_ The Huntress identifies all equipment _2x faster_.
actors.hero.talent.test_huntress_3.title=test talent actors.hero.talent.test_huntress_3.title=test talent
actors.hero.talent.test_huntress_3.desc=TODO actors.hero.talent.test_huntress_3.desc=TODO
actors.hero.talent.test_huntress_4.title=test talent actors.hero.talent.natures_aid.title=nature's aid
actors.hero.talent.test_huntress_4.desc=TODO actors.hero.talent.natures_aid.desc=_+1:_ The Huntress gains 2 armor of barkskin for _4 turns_ when a plant is trampled in her vision.\n\n_+2:_ The Huntress gains 2 armor of barkskin for _6 turns_ when a plant is trampled in her vision.
actors.hero.hero.name=you actors.hero.hero.name=you
actors.hero.hero.leave=You can't leave yet, the rest of the dungeon awaits below! actors.hero.hero.leave=You can't leave yet, the rest of the dungeon awaits below!

View File

@ -56,12 +56,12 @@ public enum Talent {
RATIONED_MEAL(32), RATIONED_MEAL(32),
THIEFS_INTUITION(33), THIEFS_INTUITION(33),
TEST_ROGUE_3(34), TEST_ROGUE_3(34),
TEST_ROGUE_4(35), MENDING_SHADOWS(35),
INVIGORATING_MEAL(48), INVIGORATING_MEAL(48),
SURVIVALISTS_INTUITION(49), SURVIVALISTS_INTUITION(49),
TEST_HUNTRESS_3(50), TEST_HUNTRESS_3(50),
TEST_HUNTRESS_4(51); NATURES_AID(51);
int icon; int icon;
@ -185,10 +185,10 @@ public enum Talent {
Collections.addAll(tierTalents, ENERGIZING_MEAL, SCHOLARS_INTUITION, TESTED_HYPOTHESIS, ENERGIZING_UPGRADE); Collections.addAll(tierTalents, ENERGIZING_MEAL, SCHOLARS_INTUITION, TESTED_HYPOTHESIS, ENERGIZING_UPGRADE);
break; break;
case ROGUE: case ROGUE:
Collections.addAll(tierTalents, RATIONED_MEAL, THIEFS_INTUITION, TEST_ROGUE_3, TEST_ROGUE_4); Collections.addAll(tierTalents, RATIONED_MEAL, THIEFS_INTUITION, TEST_ROGUE_3, MENDING_SHADOWS);
break; break;
case HUNTRESS: case HUNTRESS:
Collections.addAll(tierTalents, INVIGORATING_MEAL, SURVIVALISTS_INTUITION, TEST_HUNTRESS_3, TEST_HUNTRESS_4); Collections.addAll(tierTalents, INVIGORATING_MEAL, SURVIVALISTS_INTUITION, TEST_HUNTRESS_3, NATURES_AID);
break; break;
} }
for (Talent talent : tierTalents){ for (Talent talent : tierTalents){

View File

@ -29,6 +29,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Preparation; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Preparation;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
@ -240,10 +242,23 @@ public class CloakOfShadows extends Artifact {
} }
} }
//starts at -1 to account for turn cloak was activated
float healInc = -1;
@Override @Override
public boolean act(){ public boolean act(){
turnsToCost--; turnsToCost--;
if (((Hero)target).hasTalent(Talent.MENDING_SHADOWS)){
healInc++;
// 3/2 turns to heal
if (healInc >= 4 - ((Hero) target).pointsInTalent(Talent.MENDING_SHADOWS)){
healInc = 0;
target.HP = Math.min(target.HT, target.HP+1);
target.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
}
}
if (turnsToCost <= 0){ if (turnsToCost <= 0){
charge--; charge--;
if (charge < 0) { if (charge < 0) {
@ -312,12 +327,14 @@ public class CloakOfShadows extends Artifact {
} }
private static final String TURNSTOCOST = "turnsToCost"; private static final String TURNSTOCOST = "turnsToCost";
private static final String HEAL_INC = "heal_inc";
@Override @Override
public void storeInBundle(Bundle bundle) { public void storeInBundle(Bundle bundle) {
super.storeInBundle(bundle); super.storeInBundle(bundle);
bundle.put( TURNSTOCOST , turnsToCost); bundle.put( TURNSTOCOST , turnsToCost);
bundle.put( HEAL_INC, healInc);
} }
@Override @Override
@ -325,6 +342,7 @@ public class CloakOfShadows extends Artifact {
super.restoreFromBundle(bundle); super.restoreFromBundle(bundle);
turnsToCost = bundle.getInt( TURNSTOCOST ); turnsToCost = bundle.getInt( TURNSTOCOST );
healInc = bundle.getFloat( HEAL_INC );
} }
} }
} }

View File

@ -26,8 +26,11 @@ import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; 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.Barkskin;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@ -65,6 +68,11 @@ public abstract class Plant implements Bundlable {
wither(); wither();
activate( ch ); activate( ch );
if (Dungeon.level.heroFOV[pos] && Dungeon.hero.hasTalent(Talent.NATURES_AID)){
// 4/6 turns based on talent points spent
Buff.affect(Dungeon.hero, Barkskin.class).set(2, 2*(1+Dungeon.hero.pointsInTalent(Talent.NATURES_AID)));
}
} }
public abstract void activate( Char ch ); public abstract void activate( Char ch );