From 831e9fee20efae678039d17b4a9c16267b510033 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 12 Feb 2021 18:37:18 -0500 Subject: [PATCH] v0.9.2: implemented the speedy stealth talent --- .../assets/messages/actors/actors.properties | 4 +++- .../actors/buffs/Momentum.java | 18 ++++++++++++++++-- .../actors/hero/Hero.java | 14 +++++++------- .../actors/hero/Talent.java | 4 ++-- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index f9c1d1668..cd229c49d 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -403,7 +403,9 @@ actors.hero.talent.bounty_hunter.desc=_+1:_ When the Assassin kills an enemy wit actors.hero.talent.evasive_armor.title=evasive armor actors.hero.talent.evasive_armor.desc=_+1:_ While freerunning, the Freerunner gains an additional _+1 evasion_ per excess point of strength on his armor.\n\n_+2:_ While freerunning, the Freerunner gains an additional _+2 evasion_ per excess point of strength on his armor.\n\n_+3:_ While freerunning, the Freerunner gains an additional _+3 evasion_ per excess point of strength on his armor. actors.hero.talent.projectile_momentum.title=projectile momentum -actors.hero.talent.projectile_momentum.desc=_+1:_ While freerunning, the Freerunner gains _+20% accuracy and +10% damage_ with thrown weapons.\n\n_+1:_ While freerunning, the Freerunner gains _+40% accuracy and +20% damage_ with thrown weapons.\n\n_+1:_ While freerunning, the Freerunner gains _+60% accuracy and +30% damage_ with thrown weapons. +actors.hero.talent.projectile_momentum.desc=_+1:_ While freerunning, the Freerunner gains _+20% accuracy and +10% damage_ with thrown weapons.\n\n_+2:_ While freerunning, the Freerunner gains _+40% accuracy and +20% damage_ with thrown weapons.\n\n_+3:_ While freerunning, the Freerunner gains _+60% accuracy and +30% damage_ with thrown weapons. +actors.hero.talent.speedy_stealth.title=speedy stealth +actors.hero.talent.speedy_stealth.desc=_+1:_ The Freerunner gains 2 stacks of momentum per turn while he is invisible.\n\n_+2:_ In addition to the benefits of +1, freerunning no longer counts down while the Freerunner is invisible.\n\n_+3:_ In addition to the benefits of +1 and +2, The Freerunner moves at 2x speed while invisible, regardless of whether he is freerunning or not. actors.hero.talent.natures_bounty.title=nature's bounty actors.hero.talent.natures_bounty.desc=_+1:_ The Huntress can find _4 berries_ hidden in tall grass as she explores the earlier stages of the dungeon.\n\n_+2:_ The Huntress can find _6 berries_ hidden in tall grass as she explores the earlier stages of the dungeon. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Momentum.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Momentum.java index c80409034..97f9bb1a1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Momentum.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Momentum.java @@ -52,8 +52,16 @@ public class Momentum extends Buff implements ActionIndicator.Action { if (freerunCooldown > 0){ freerunCooldown--; } + + if (freerunCooldown == 0 && target.invisible > 0 && Dungeon.hero.pointsInTalent(Talent.SPEEDY_STEALTH) >= 1){ + momentumStacks = Math.min(momentumStacks + 2, 10); + movedLastTurn = true; + } + if (freerunTurns > 0){ - freerunTurns--; + if (target.invisible == 0 || Dungeon.hero.pointsInTalent(Talent.SPEEDY_STEALTH) < 2) { + freerunTurns--; + } } else if (!movedLastTurn){ momentumStacks = Math.min(momentumStacks -1, Math.round(momentumStacks * 0.667f)); if (momentumStacks <= 0) { @@ -81,7 +89,13 @@ public class Momentum extends Buff implements ActionIndicator.Action { } public float speedMultiplier(){ - return (freerunTurns > 0) ? 2 : 1; + if (freerunning()){ + return 2; + } else if (target.invisible > 0 && Dungeon.hero.pointsInTalent(Talent.SPEEDY_STEALTH) == 3){ + return 2; + } else { + return 1; + } } public int evasionBonus( int heroLvl, int excessArmorStr ){ 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 53c85cf46..8933efa19 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 @@ -483,8 +483,8 @@ public class Hero extends Char { } Momentum momentum = buff(Momentum.class); - if (momentum != null && momentum.freerunning()){ - ((HeroSprite)sprite).sprint( 1.5f ); + if (momentum != null){ + ((HeroSprite)sprite).sprint( momentum.freerunning() ? 1.5f : 1f ); speed *= momentum.speedMultiplier(); } else { ((HeroSprite)sprite).sprint( 1f ); @@ -1294,7 +1294,11 @@ public class Hero extends Char { } if (step != -1) { - + + if (subClass == HeroSubClass.FREERUNNER){ + Buff.affect(this, Momentum.class).gainStack(); + } + float speed = speed(); sprite.move(pos, step); @@ -1304,10 +1308,6 @@ public class Hero extends Char { justMoved = true; search(false); - - if (subClass == HeroSubClass.FREERUNNER){ - Buff.affect(this, Momentum.class).gainStack(); - } return true; 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 52ac0f4a5..86381b336 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 @@ -97,7 +97,7 @@ public enum Talent { //Assassin T3 ENHANCED_LETHALITY(75, 3), ASSASSINS_REACH(76, 3), BOUNTY_HUNTER(77, 3), //Freerunner T3 - EVASIVE_ARMOR(78, 3), PROJECTILE_MOMENTUM(79, 3), FREERUNNER_T3_3(80, 3), + EVASIVE_ARMOR(78, 3), PROJECTILE_MOMENTUM(79, 3), SPEEDY_STEALTH(80, 3), //Huntress T1 NATURES_BOUNTY(96), SURVIVALISTS_INTUITION(97), FOLLOWUP_STRIKE(98), NATURES_AID(99), @@ -473,7 +473,7 @@ public enum Talent { Collections.addAll(tierTalents, ENHANCED_LETHALITY, ASSASSINS_REACH, BOUNTY_HUNTER); break; case FREERUNNER: - Collections.addAll(tierTalents, EVASIVE_ARMOR, PROJECTILE_MOMENTUM, FREERUNNER_T3_3); + Collections.addAll(tierTalents, EVASIVE_ARMOR, PROJECTILE_MOMENTUM, SPEEDY_STEALTH); break; case SNIPER: Collections.addAll(tierTalents, FARSIGHT, SHARED_ENCHANTMENT, SHARED_UPGRADES);