v3.0.0: adjusted shared upgrades to scale based on thrown wep tier

This commit is contained in:
Evan Debenham
2025-01-10 13:35:08 -05:00
parent 096761983c
commit 002c97ab5b
3 changed files with 16 additions and 9 deletions

View File

@@ -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.

View File

@@ -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();

View File

@@ -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);
}