From cc7b5940b6863ffd611d33947913f7c2e18c2521 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 5 Feb 2021 20:17:28 -0500 Subject: [PATCH] v0.9.2: added the projectile momentum talent --- .../main/assets/messages/actors/actors.properties | 2 ++ .../shatteredpixeldungeon/actors/hero/Talent.java | 4 ++-- .../items/weapon/missiles/MissileWeapon.java | 13 +++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index f70d213df..e7de51882 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -388,6 +388,8 @@ actors.hero.talent.bounty_hunter.title=bounty hunter actors.hero.talent.bounty_hunter.desc=_+1:_ When the Assassin kills an enemy with a prepared strike they drop _10 extra gold_.\n\n_+2:_ When the Assassin kills an enemy with a prepared strike they drop _20 extra gold_.\n\n_+3:_ When the Assassin kills an enemy with a prepared strike they drop _30 extra gold_. 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.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/hero/Talent.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java index 647a8e11e..cb9bebcf7 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), ASSASSIN_T3_2(76, 3), BOUNTY_HUNTER(77, 3), //Freerunner T3 - EVASIVE_ARMOR(78, 3), FREERUNNER_T3_2(79, 3), FREERUNNER_T3_3(80, 3), + EVASIVE_ARMOR(78, 3), PROJECTILE_MOMENTUM(79, 3), FREERUNNER_T3_3(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, ASSASSIN_T3_2, BOUNTY_HUNTER); break; case FREERUNNER: - Collections.addAll(tierTalents, EVASIVE_ARMOR, FREERUNNER_T3_2, FREERUNNER_T3_3); + Collections.addAll(tierTalents, EVASIVE_ARMOR, PROJECTILE_MOMENTUM, FREERUNNER_T3_3); break; case SNIPER: Collections.addAll(tierTalents, FARSIGHT, SNIPER_T3_2, SNIPER_T3_3); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java index 0bbc9f66a..704341010 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java @@ -26,6 +26,7 @@ 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.Corruption; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Momentum; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; @@ -150,6 +151,15 @@ abstract public class MissileWeapon extends Weapon { } } + @Override + public float accuracyFactor(Char owner) { + float accFactor = super.accuracyFactor(owner); + if (owner instanceof Hero && owner.buff(Momentum.class) != null && owner.buff(Momentum.class).freerunning()){ + accFactor *= 1f + 0.2f*((Hero) owner).pointsInTalent(Talent.PROJECTILE_MOMENTUM); + } + return accFactor; + } + @Override public void doThrow(Hero hero) { parent = null; //reset parent before throwing, just incase @@ -270,6 +280,9 @@ abstract public class MissileWeapon extends Weapon { if (exStr > 0) { damage += Random.IntRange( 0, exStr ); } + if (owner.buff(Momentum.class) != null && owner.buff(Momentum.class).freerunning()) { + damage = Math.round(damage * (1f + 0.1f * ((Hero) owner).pointsInTalent(Talent.PROJECTILE_MOMENTUM))); + } } return damage;