From 002c97ab5bb0f18f1d95222ec31b3853ffc22118 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 10 Jan 2025 13:35:08 -0500 Subject: [PATCH] v3.0.0: adjusted shared upgrades to scale based on thrown wep tier --- .../main/assets/messages/actors/actors.properties | 2 +- .../actors/buffs/SnipersMark.java | 15 +++++++-------- .../shatteredpixeldungeon/actors/hero/Hero.java | 8 ++++++++ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index 60947bb10..9de801729 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -1002,7 +1002,7 @@ actors.hero.talent.farsight.desc=_+1:_ The Sniper's vision range is _increased b actors.hero.talent.shared_enchantment.title=shared enchantment actors.hero.talent.shared_enchantment.desc=_+1:_ Thrown weapons have a _33% chance_ to use the enchantment on the Sniper's bow.\n\n_+2:_ Thrown weapons have a _67% chance_ to use the enchantment on the Sniper's bow.\n\n_+3:_ Thrown weapons have a _100% chance_ to use the enchantment on the Sniper's bow.\n\nThis talent does not apply to darts shot from an enchanted crossbow, they already trigger the crossbow's enchantment. actors.hero.talent.shared_upgrades.title=shared upgrades -actors.hero.talent.shared_upgrades.desc=_+1:_ When the Sniper attacks with an upgraded thrown weapon, each level increases the duration of sniper's mark by 1 turn and the damage of her special attack by _10%_.\n\n_+2:_ When the Sniper attacks with an upgraded thrown weapon, each level increases the duration of sniper's mark by 1 turn and the damage of her special attack by _20%_.\n\n_+3:_ When the Sniper attacks with an upgraded thrown weapon, each level increases the duration of sniper's mark by 1 turn and the damage of her special attack by _30%_. +actors.hero.talent.shared_upgrades.desc=_+1:_ When the Sniper attacks with an upgraded thrown weapon, each level increases the duration of sniper's mark by 1 turn and the damage of her special attack by _2.5%_ per tier of the thrown weapon.\n\n_+2:_ When the Sniper attacks with an upgraded thrown weapon, each level increases the duration of sniper's mark by 1 turn and the damage of her special attack by _5%_ per tier of the thrown weapon.\n\n_+3:_ When the Sniper attacks with an upgraded thrown weapon, each level increases the duration of sniper's mark by 1 turn and the damage of her special attack by _7.5%_ per tier of the thrown weapon. 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. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/SnipersMark.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/SnipersMark.java index a8370c7fc..c0c6211a0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/SnipersMark.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/SnipersMark.java @@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; -import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator; @@ -37,10 +36,10 @@ import com.watabou.utils.Bundle; public class SnipersMark extends FlavourBuff implements ActionIndicator.Action { public int object = 0; - public int level = 0; + public float percentDmgBonus = 0; private static final String OBJECT = "object"; - private static final String LEVEL = "level"; + private static final String BONUS = "bonus"; public static final float DURATION = 4f; @@ -48,9 +47,9 @@ public class SnipersMark extends FlavourBuff implements ActionIndicator.Action { type = buffType.POSITIVE; } - public void set(int object, int level){ + public void set(int object, float bonus){ this.object = object; - this.level = level; + this.percentDmgBonus = bonus; } @Override @@ -69,14 +68,14 @@ public class SnipersMark extends FlavourBuff implements ActionIndicator.Action { public void storeInBundle( Bundle bundle ) { super.storeInBundle( bundle ); bundle.put( OBJECT, object ); - bundle.put( LEVEL, level ); + bundle.put( BONUS, percentDmgBonus ); } @Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle( bundle ); object = bundle.getInt( OBJECT ); - level = bundle.getInt( LEVEL ); + percentDmgBonus = bundle.getInt( BONUS ); } @Override @@ -134,7 +133,7 @@ public class SnipersMark extends FlavourBuff implements ActionIndicator.Action { if (cell == -1) return; bow.sniperSpecial = true; - bow.sniperSpecialBonusDamage = level*Dungeon.hero.pointsInTalent(Talent.SHARED_UPGRADES)/10f; + bow.sniperSpecialBonusDamage = percentDmgBonus; arrow.cast(hero, cell); detach(); 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 6790515f7..d14cdc65e 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 @@ -1466,6 +1466,14 @@ public class Hero extends Char { @Override protected boolean act() { if (enemy.isAlive()) { + if (hasTalent(Talent.SHARED_UPGRADES)){ + int bonusTurns = wep.buffedLvl(); + // bonus dmg is 2.5% x talent lvl x weapon level x weapon tier + float bonusDmg = wep.buffedLvl() * ((MissileWeapon) wep).tier * pointsInTalent(Talent.SHARED_UPGRADES) * 0.025f; + Buff.prolong(Hero.this, SnipersMark.class, SnipersMark.DURATION + bonusTurns).set(enemy.id(), bonusDmg); + } else { + Buff.prolong(Hero.this, SnipersMark.class, SnipersMark.DURATION).set(enemy.id(), 0); + } int bonusTurns = hasTalent(Talent.SHARED_UPGRADES) ? wep.buffedLvl() : 0; Buff.prolong(Hero.this, SnipersMark.class, SnipersMark.DURATION + bonusTurns).set(enemy.id(), bonusTurns); }