From 320b6344251bd78c43690277992cdfcbeb8c8bf2 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 6 Feb 2021 18:04:20 -0500 Subject: [PATCH] v0.9.2: implemented the barkskin talent --- core/src/main/assets/messages/actors/actors.properties | 2 ++ .../shatteredpixeldungeon/actors/buffs/Barkskin.java | 4 ++-- .../shatteredpixeldungeon/actors/hero/Hero.java | 4 ++-- .../shatteredpixeldungeon/actors/hero/Talent.java | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index 3d15cd3d6..36d0f587f 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -417,6 +417,8 @@ actors.hero.talent.farsight.title=farsight actors.hero.talent.farsight.desc=_+1:_ The Sniper's vision range is _increased by 25%_\n\n_+2:_ The Sniper's vision range is _increased by 50%_\n\n_+3:_ The Sniper's vision range is _increased by 75%_ actors.hero.talent.durable_tips.title=durable tips actors.hero.talent.durable_tips.desc=_+1:_ Tipped darts have _2x durability_ when the Warden uses them.\n\n_+2:_ Tipped darts have _3x durability_ when the Warden uses them.\n\n_+3:_ Tipped darts have _4x durability_ when the Warden uses them. +actors.hero.talent.barkskin.title=barkskin +actors.hero.talent.barkskin.desc=_+1:_ When stepping in grass, the Warden gains barkskin equivalent to her level for _1 turn_.\n\n_+2:_ When stepping in grass, the Warden gains barkskin equivalent to her level for _2 turns_.\n\n_+3:_ When stepping in grass, the Warden gains barkskin equivalent to her level for _3 turns_. actors.hero.hero.name=you actors.hero.hero.leave=You can't leave yet, the rest of the dungeon awaits below! diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Barkskin.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Barkskin.java index 56c229078..c81a822c0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Barkskin.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Barkskin.java @@ -59,7 +59,7 @@ public class Barkskin extends Buff { public void set( int value, int time ) { //decide whether to override, preferring high value + low interval - if (Math.sqrt(interval)*level < Math.sqrt(time)*value) { + if (Math.sqrt(interval)*level <= Math.sqrt(time)*value) { level = value; interval = time; spend(time - cooldown() - 1); @@ -74,7 +74,7 @@ public class Barkskin extends Buff { @Override public float iconFadePercent() { if (target instanceof Hero){ - float max = ((Hero) target).lvl + 5; + float max = ((Hero) target).lvl; return (max-level)/max; } return 0; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 61375fb1f..96a7fde3b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -643,8 +643,8 @@ public class Hero extends Char { } } - if( subClass == HeroSubClass.WARDEN && Dungeon.level.map[pos] == Terrain.FURROWED_GRASS){ - Buff.affect(this, Barkskin.class).set( lvl + 5, 1 ); + if(hasTalent(Talent.BARKSKIN) && Dungeon.level.map[pos] == Terrain.FURROWED_GRASS){ + Buff.affect(this, Barkskin.class).set( lvl, pointsInTalent(Talent.BARKSKIN) ); } return actResult; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java index da04e999a..b3afd822f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java @@ -108,7 +108,7 @@ public enum Talent { //Sniper T3 FARSIGHT(107, 3), SNIPER_T3_2(108, 3), SNIPER_T3_3(109, 3), //Warden T3 - DURABLE_TIPS(110, 3), WARDEN_T3_2(111, 3), WARDEN_T3_3(112, 3); + DURABLE_TIPS(110, 3), BARKSKIN(111, 3), WARDEN_T3_3(112, 3); public static class ImprovisedProjectileCooldown extends FlavourBuff{}; public static class LethalMomentumTracker extends FlavourBuff{}; @@ -479,7 +479,7 @@ public enum Talent { Collections.addAll(tierTalents, FARSIGHT, SNIPER_T3_2, SNIPER_T3_3); break; case WARDEN: - Collections.addAll(tierTalents, DURABLE_TIPS, WARDEN_T3_2, WARDEN_T3_3); + Collections.addAll(tierTalents, DURABLE_TIPS, BARKSKIN, WARDEN_T3_3); break; } for (Talent talent : tierTalents){