From b2cc9f38039e0e317b2153220f8b8c6ea452106d Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 8 Jul 2024 15:12:27 -0400 Subject: [PATCH] v2.5.0: bonus cursed zaps from wondrous resin are now always positive --- core/src/main/assets/messages/items/items.properties | 4 ++-- .../actors/hero/abilities/mage/WildMagic.java | 4 ++++ .../items/trinkets/WondrousResin.java | 7 +++++-- .../shatteredpixeldungeon/items/wands/Wand.java | 2 ++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 0bd8abd36..7d5d54fe0 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -1368,8 +1368,8 @@ items.trinkets.trapmechanism.stats_desc=At its current level this trinket will m items.trinkets.wondrousresin.name=wondrous resin items.trinkets.wondrousresin.desc=This shimmering blue resin appears to have the distilled essence of a cursed wand's magic. The magic from the alchemy pot has seemed to stabilize it somewhat, and it's now affecting your wands. -items.trinkets.wondrousresin.typical_stats_desc=Typically this trinket will force cursed wand effects to become neutral or positive _%1$s%%_ of the time, and will cause uncursed wands to fire an additional cursed zap _%2$s%%_ of the time.\n\nThis trinket costs a moderately large amount of energy to upgrade. -items.trinkets.wondrousresin.stats_desc=At its current level this trinket will force cursed wand effects to become neutral or positive _%1$s%%_ of the time, and will cause uncursed wands to fire an additional cursed zap _%2$s%%_ of the time.\n\nThis trinket costs a moderately large amount of energy to upgrade. +items.trinkets.wondrousresin.typical_stats_desc=Typically this trinket will force cursed wand effects to become neutral or positive _%1$s%%_ of the time, and will cause uncursed wands to fire an additional neutral or positive cursed zap _%2$s%%_ of the time.\n\nThis trinket costs a moderately large amount of energy to upgrade. +items.trinkets.wondrousresin.stats_desc=At its current level this trinket will force cursed wand effects to become neutral or positive _%1$s%%_ of the time, and will cause uncursed wands to fire an additional neutral or positive cursed zap _%2$s%%_ of the time.\n\nThis trinket costs a moderately large amount of energy to upgrade. items.trinkets.trinketcatalyst.name=magical catalyst items.trinkets.trinketcatalyst.window_text=The water begins to glow as you add the catalyst. There are a few nearby items you could imbue with energy to turn into a magical trinket. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/mage/WildMagic.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/mage/WildMagic.java index b6f5ae269..0491afd3f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/mage/WildMagic.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/mage/WildMagic.java @@ -150,12 +150,14 @@ public class WildMagic extends ArmorAbility { @Override protected void onComplete() { if (alsoCursedZap){ + WondrousResin.forcePositive = true; CursedWand.cursedZap(cur, hero, new Ballistica(hero.pos, cell, Ballistica.MAGIC_BOLT), new Callback() { @Override public void call() { + WondrousResin.forcePositive = false; afterZap(cur, wands, hero, cell); } }); @@ -166,12 +168,14 @@ public class WildMagic extends ArmorAbility { }); } else { if (alsoCursedZap){ + WondrousResin.forcePositive = true; CursedWand.cursedZap(cur, hero, new Ballistica(hero.pos, cell, Ballistica.MAGIC_BOLT), new Callback() { @Override public void call() { + WondrousResin.forcePositive = false; afterZap(cur, wands, hero, cell); } }); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/trinkets/WondrousResin.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/trinkets/WondrousResin.java index db5fe86af..cd9f28c8e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/trinkets/WondrousResin.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/trinkets/WondrousResin.java @@ -49,10 +49,13 @@ public class WondrousResin extends Trinket { } } - //TODO currently this trims most rare/v.rare wand effects entirely. Need to improve variety there - // certain effects might also be extremely good with no negatives + //used when bonus curse effects are being created + public static boolean forcePositive = false; public static float positiveCurseEffectChance(){ + if (forcePositive){ + return 1; + } return positiveCurseEffectChance( trinketLevel(WondrousResin.class) ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java index 12b024ce3..98c5a7dae 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java @@ -701,11 +701,13 @@ public abstract class Wand extends Item { public void call() { curWand.onZap(shot); if (Random.Float() < WondrousResin.extraCurseEffectChance()){ + WondrousResin.forcePositive = true; CursedWand.cursedZap(curWand, curUser, new Ballistica(curUser.pos, target, Ballistica.MAGIC_BOLT), new Callback() { @Override public void call() { + WondrousResin.forcePositive = false; curWand.wandUsed(); } });