v3.2.0: enchant/curse adjustments for thrown weapons:

- projecting can now stack from multiple sources
- explosive now deals an extra 9x uses of durability dmg
- friendly thrown weps now deal 0 dmg if charmed
This commit is contained in:
Evan Debenham
2025-07-22 15:42:55 -04:00
parent 688c2eb502
commit 629f6cefeb
4 changed files with 22 additions and 6 deletions

View File

@@ -1718,7 +1718,7 @@ items.weapon.curses.displacing.elestrike_desc=An elemental strike with a displac
items.weapon.curses.explosive.name=explosive %s
items.weapon.curses.explosive.warm=Warm...
items.weapon.curses.explosive.hot=Hot!
items.weapon.curses.explosive.desc=Explosive weapons steadily build up power and explode, damaging the wearer and enemy.
items.weapon.curses.explosive.desc=Explosive weapons steadily build up power and explode, damaging anything nearby.
items.weapon.curses.explosive.desc_cool=Your weapon is currently cool to the touch.
items.weapon.curses.explosive.desc_warm=Your weapon is building energy and getting warm...
items.weapon.curses.explosive.desc_hot=Your weapon is hot! It's about to explode!

View File

@@ -81,6 +81,11 @@ public class Explosive extends Weapon.Enchantment {
durability = 100;
Item.updateQuickslot();
if (weapon instanceof MissileWeapon){
//the explosion damages thrown weapons
((MissileWeapon) weapon).damage(9*((MissileWeapon) weapon).durabilityPerUse());
}
}
if (weapon instanceof MissileWeapon

View File

@@ -36,6 +36,10 @@ public class Friendly extends Weapon.Enchantment {
@Override
public int proc(Weapon weapon, Char attacker, Char defender, int damage ) {
if (attacker.buff(Charm.class) != null && attacker.buff(Charm.class).object == defender.id()){
damage = 0;
}
float procChance = 1/10f * procChanceMultiplier(attacker);
if (Random.Float() < procChance) {

View File

@@ -189,18 +189,20 @@ abstract public class MissileWeapon extends Weapon {
@Override
public int throwPos(Hero user, int dst) {
//TODO do we want to let these stack?
boolean projecting = hasEnchant(Projecting.class, user);
int projecting = 0;
if (hasEnchant(Projecting.class, user)){
projecting += 4;
}
if (Random.Int(3) < user.pointsInTalent(Talent.SHARED_ENCHANTMENT)){
SpiritBow bow = Dungeon.hero.belongings.getItem(SpiritBow.class);
if (bow != null && bow.hasEnchant(Projecting.class, user)) {
projecting = true;
projecting += 4;
}
}
if (projecting
if (projecting > 0
&& (Dungeon.level.passable[dst] || Dungeon.level.avoid[dst] || Actor.findChar(dst) != null)
&& Dungeon.level.distance(user.pos, dst) <= Math.round(4 * Enchantment.genericProcChanceMultiplier(user))){
&& Dungeon.level.distance(user.pos, dst) <= Math.round(projecting * Enchantment.genericProcChanceMultiplier(user))){
return dst;
} else {
return super.throwPos(user, dst);
@@ -421,6 +423,11 @@ abstract public class MissileWeapon extends Weapon {
durability = Math.min(durability, MAX_DURABILITY);
}
public void damage( float amount ){
durability -= amount;
durability = Math.max(durability, 1); //cannot break from doing this
}
public final float durabilityPerUse(){
return durabilityPerUse(level());
}