v2.3.0: curse infusion now only replaces existing curses after first use

This commit is contained in:
Evan Debenham
2023-11-08 14:43:57 -05:00
parent fae73101aa
commit f9e346b2ca
2 changed files with 10 additions and 4 deletions

View File

@@ -1145,7 +1145,7 @@ items.spells.beaconofreturning.desc=This intricate spell grants the user the abi
items.spells.curseinfusion.name=curse infusion
items.spells.curseinfusion.inv_title=Curse an item
items.spells.curseinfusion.desc=This spell infuses a piece of equipment with the same powerful malignant magic present within DM-300. The item it is used on will immediately be cursed, and any enchantment or glyph it may have had will be overridden.\n\nIn the case of weapons, armor, and wands, the item will gain upgrades in addition to being cursed. Curse infusion upgrades do not stack, and the upgrades are lost if the item becomes uncursed.
items.spells.curseinfusion.desc=This spell infuses a piece of equipment with the same powerful malignant magic present within DM-300. The item it is used on will immediately be cursed, and any enchantment or glyph it may have had will be overridden.\n\nIn the case of weapons, armor, and wands, the item will gain upgrades in addition to being cursed. Curse infusion upgrades do not stack, and the upgrades are lost if the item becomes uncursed.\n\nMultiple curse infusions can also be used to change the curse on a weapon or armor.
items.spells.featherfall.name=feather fall
items.spells.featherfall.light=You feel light as a feather!

View File

@@ -61,7 +61,10 @@ public class CurseInfusion extends InventorySpell {
if (item instanceof MeleeWeapon || item instanceof SpiritBow) {
Weapon w = (Weapon) item;
if (w.enchantment != null) {
w.enchant(Weapon.Enchantment.randomCurse(w.enchantment.getClass()));
//if we are freshly applying curse infusion, don't replace an existing curse
if (w.hasGoodEnchant() || w.curseInfusionBonus) {
w.enchant(Weapon.Enchantment.randomCurse(w.enchantment.getClass()));
}
} else {
w.enchant(Weapon.Enchantment.randomCurse());
}
@@ -72,8 +75,11 @@ public class CurseInfusion extends InventorySpell {
} else if (item instanceof Armor){
Armor a = (Armor) item;
if (a.glyph != null){
a.inscribe(Armor.Glyph.randomCurse(a.glyph.getClass()));
} else {
//if we are freshly applying curse infusion, don't replace an existing curse
if (a.hasGoodGlyph() || a.curseInfusionBonus) {
a.inscribe(Armor.Glyph.randomCurse(a.glyph.getClass()));
}
} else if (a.hasGoodGlyph() || a.curseInfusionBonus) {
a.inscribe(Armor.Glyph.randomCurse());
}
a.curseInfusionBonus = true;