From 05c52bdc1faa4a66368959b2e51c206c0ff2790b Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 7 Oct 2025 18:40:32 -0400 Subject: [PATCH] v3.3.0: heavy crossbow now more directly shows dart boosting amount --- .../assets/messages/items/items.properties | 3 ++- .../messages/windows/windows.properties | 1 + .../items/weapon/melee/Crossbow.java | 26 +++++++++++++++++++ .../items/weapon/missiles/darts/Dart.java | 20 +++++++------- .../windows/WndUpgrade.java | 8 ++++++ 5 files changed, 47 insertions(+), 11 deletions(-) diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 8fb4f37f6..a0e56bcab 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -1819,7 +1819,8 @@ items.weapon.melee.battleaxe.ability_desc=The Duelist can perform a _heavy blow_ items.weapon.melee.battleaxe.desc=The enormous steel head of this battle axe puts considerable heft behind each wide stroke. items.weapon.melee.crossbow.name=crossbow -items.weapon.melee.crossbow.stats_desc=This weapon enhances the damage of thrown darts when equipped, and will even grant its enchantment to them. +items.weapon.melee.crossbow.typical_stats_desc=Typically this weapon enhances thrown darts to deal _%1$d-%2$d damage_ when it is equipped, and will even grant its enchantment to them. +items.weapon.melee.crossbow.stats_desc=This weapon enhances thrown darts to deal _%1$d-%2$d damage_ when it is equipped, and will even grant its enchantment to them. items.weapon.melee.crossbow.ability_name=charged shot items.weapon.melee.crossbow.typical_ability_desc=The Duelist can _charge_ her crossbow, causing her next regular attack with it to always hit and apply one of three effects: melee attacks will knock enemies away, untipped darts will typically deal _+%1$d damage_, and tipped darts will apply their effect in a 7x7 area and typically last for _%2$d more uses_. items.weapon.melee.crossbow.ability_desc=The Duelist can _charge_ her crossbow, causing her next regular attack with it to always hit and apply one of three effects: melee attacks will knock enemies away, untipped darts will deal _+%1$d damage_, and tipped darts will apply their effect in a 7x7 area and last for _%2$d more uses_. diff --git a/core/src/main/assets/messages/windows/windows.properties b/core/src/main/assets/messages/windows/windows.properties index 7d1def320..6109a8619 100644 --- a/core/src/main/assets/messages/windows/windows.properties +++ b/core/src/main/assets/messages/windows/windows.properties @@ -372,6 +372,7 @@ windows.wndupgrade.harden=Upgrading this item also has a %d%% chance to break it windows.wndupgrade.resin=This wand has been enhanced with arcane resin, normal upgrades will override resin upgrades! windows.wndupgrade.thrown_dust=Weapons from this set that aren't in your inventory will crumble to dust. windows.wndupgrade.damage=Damage +windows.wndupgrade.dart_damage=Dart Damage windows.wndupgrade.blocking=Blocking windows.wndupgrade.weight=Weight windows.wndupgrade.durability=Durability diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Crossbow.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Crossbow.java index 99fcce464..0dce58f17 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Crossbow.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Crossbow.java @@ -112,6 +112,32 @@ public class Crossbow extends MeleeWeapon { lvl*(tier); //+4 per level, down from +5 } + public int dartMin(){ + return dartMin(buffedLvl()); + } + + public int dartMin(int lvl){ + return 4 + //4 base, up from dart base of 1 + lvl; //+1 per level + } + + public int dartMax(){ + return dartMax(buffedLvl()); + } + + public int dartMax(int lvl){ + return 12 + //12 base, up from dart base of 2 + 3*lvl; //+3 per crossbow level + } + + public String statsInfo(){ + if (isIdentified()){ + return Messages.get(this, "stats_desc", dartMin(), dartMax()); + } else { + return Messages.get(this, "typical_stats_desc", dartMin(0), dartMax(0)); + } + } + @Override protected void duelistAbility(Hero hero, Integer target) { if (hero.buff(ChargedShot.class) != null){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/Dart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/Dart.java index 68182982c..6404e8fbd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/Dart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/Dart.java @@ -84,12 +84,12 @@ public class Dart extends MissileWeapon { public int min(int lvl) { if (bow != null){ if (!(this instanceof TippedDart) && Dungeon.hero.buff(Crossbow.ChargedShot.class) != null){ - //ability increases base dmg by 50%, scaling by 50% - return 8 + //8 base - 2*bow.buffedLvl() + lvl;//+2 per bow level, +1 per level + return bow.dartMin() //crossbow dart damage + + 4 + bow.buffedLvl() //ability increases base dmg by 50%, scaling by 50% + + lvl; //another +1 per level (ring of sharpshooting) } else { - return 4 + //4 base - bow.buffedLvl() + lvl; //+1 per level or bow level + return bow.dartMin() //crossbow dart damage + + lvl; //another +1 per level (ring of sharpshooting) } } else { return 1 + //1 base, down from 2 @@ -101,12 +101,12 @@ public class Dart extends MissileWeapon { public int max(int lvl) { if (bow != null){ if (!(this instanceof TippedDart) && Dungeon.hero.buff(Crossbow.ChargedShot.class) != null){ - //ability increases base dmg by 50%, scaling by 50% - return 16 + //16 base - 4*bow.buffedLvl() + 2*lvl; //+4 per bow level, +2 per level + return bow.dartMax() //crossbow dart damage + + 4 + bow.buffedLvl() //ability increases base dmg by 50%, scaling by 50% + + 2*lvl; //another +2 per level (ring of sharpshooting) } else { - return 12 + //12 base - 3*bow.buffedLvl() + 2*lvl; //+3 per bow level, +2 per level + return bow.dartMax() //crossbow dart damage + + 2*lvl; //another +2 per level (ring of sharpshooting) } } else { return 2 + //2 base, down from 5 diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndUpgrade.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndUpgrade.java index 2b3a94110..21741f73b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndUpgrade.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndUpgrade.java @@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; import com.shatteredpixel.shatteredpixeldungeon.items.spells.MagicalInfusion; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Crossbow; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Greatshield; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; @@ -203,6 +204,13 @@ public class WndUpgrade extends Window { bottom); } + if (toUpgrade instanceof Crossbow){ + bottom = fillFields(Messages.get(this, "dart_damage"), + ((Crossbow) toUpgrade).dartMin(levelFrom) + "-" + ((Crossbow) toUpgrade).dartMax(levelFrom), + ((Crossbow) toUpgrade).dartMin(levelTo) + "-" + ((Crossbow) toUpgrade).dartMax(levelTo), + bottom); + } + if (Dungeon.hero != null && Dungeon.hero.heroClass == HeroClass.DUELIST && toUpgrade instanceof MeleeWeapon && ((MeleeWeapon) toUpgrade).upgradeAbilityStat(levelFrom) != null){ bottom = fillFields(Messages.get(toUpgrade, "upgrade_ability_stat_name"),