From 1c9eced78ddcc45ef18ff9bd1efe3dfcd0c6bde7 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 10 Mar 2025 14:38:34 -0400 Subject: [PATCH] v3.0.1: holy wep and ward extension now caps at 100 turns --- .../actors/hero/spells/ClericSpell.java | 4 ++-- .../actors/hero/spells/HolyWard.java | 8 ++++++++ .../actors/hero/spells/HolyWeapon.java | 8 ++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/ClericSpell.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/ClericSpell.java index bf2a1bbf6..f71795372 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/ClericSpell.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/ClericSpell.java @@ -88,10 +88,10 @@ public abstract class ClericSpell { Talent.onArtifactUsed(hero); if (hero.subClass == HeroSubClass.PALADIN){ if (this != HolyWeapon.INSTANCE && hero.buff(HolyWeapon.HolyWepBuff.class) != null){ - Buff.affect(hero, HolyWeapon.HolyWepBuff.class, 10*chargeUse(hero)); + hero.buff(HolyWeapon.HolyWepBuff.class).extend(10*chargeUse(hero)); } if (this != HolyWard.INSTANCE && hero.buff(HolyWard.HolyArmBuff.class) != null){ - Buff.affect(hero, HolyWard.HolyArmBuff.class, 10*chargeUse(hero)); + hero.buff(HolyWard.HolyArmBuff.class).extend(10*chargeUse(hero)); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyWard.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyWard.java index 634d03e50..3dadad7a5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyWard.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyWard.java @@ -101,6 +101,14 @@ public class HolyWard extends ClericSpell { super.detach(); Item.updateQuickslot(); } + + public void extend(float extension){ + if (cooldown()+extension <= 2*DURATION){ + spend(extension); + } else { + postpone(2*DURATION); + } + } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyWeapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyWeapon.java index 42593a5f1..b810a49fd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyWeapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyWeapon.java @@ -106,6 +106,14 @@ public class HolyWeapon extends ClericSpell { super.detach(); Item.updateQuickslot(); } + + public void extend(float extension){ + if (cooldown()+extension <= 2*DURATION){ + spend(extension); + } else { + postpone(2*DURATION); + } + } } }