From 89064adeb2aa9e6480efbe084e47d2aa1f3246aa Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 20 Jan 2025 15:47:12 -0500 Subject: [PATCH] v3.0.0: added checks on castability for all unlockable spells --- .../actors/hero/spells/AuraOfProtection.java | 5 +++++ .../actors/hero/spells/BlessSpell.java | 5 +++++ .../actors/hero/spells/BodyForm.java | 7 +++++++ .../actors/hero/spells/Cleanse.java | 5 +++++ .../actors/hero/spells/ClericSpell.java | 2 ++ .../actors/hero/spells/DivineIntervention.java | 1 + .../actors/hero/spells/DivineSense.java | 5 +++++ .../actors/hero/spells/Flash.java | 4 +++- .../actors/hero/spells/HallowedGround.java | 5 +++++ .../actors/hero/spells/HolyIntuition.java | 8 +++++++- .../actors/hero/spells/HolyLance.java | 4 +++- .../actors/hero/spells/Judgement.java | 4 +++- .../actors/hero/spells/LayOnHands.java | 5 +++++ .../actors/hero/spells/MindForm.java | 6 ++++++ .../actors/hero/spells/MnemonicPrayer.java | 5 +++++ .../actors/hero/spells/Radiance.java | 6 ++++++ .../actors/hero/spells/RecallInscription.java | 4 +++- .../actors/hero/spells/ShieldOfLight.java | 5 +++++ .../actors/hero/spells/Smite.java | 6 ++++++ .../actors/hero/spells/SpiritForm.java | 6 ++++++ .../actors/hero/spells/Sunray.java | 5 +++++ .../actors/hero/spells/WallOfLight.java | 10 ++++++++++ .../shatteredpixeldungeon/ui/HeroIcon.java | 2 +- 23 files changed, 109 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/AuraOfProtection.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/AuraOfProtection.java index f23f65b74..3a4ff764f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/AuraOfProtection.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/AuraOfProtection.java @@ -56,6 +56,11 @@ public class AuraOfProtection extends ClericSpell { return 2f; } + @Override + public boolean canCast(Hero hero) { + return super.canCast(hero) && hero.hasTalent(Talent.AURA_OF_PROTECTION); + } + @Override public void onCast(HolyTome tome, Hero hero) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/BlessSpell.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/BlessSpell.java index ca0237189..6816ddcba 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/BlessSpell.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/BlessSpell.java @@ -53,6 +53,11 @@ public class BlessSpell extends TargetedClericSpell { return -1; //auto-targeting behaviour is often wrong, so we don't use it } + @Override + public boolean canCast(Hero hero) { + return super.canCast(hero) && hero.hasTalent(Talent.BLESS); + } + @Override protected void onTargetSelected(HolyTome tome, Hero hero, Integer target) { if (target == null){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/BodyForm.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/BodyForm.java index b7a701e75..2a79ca553 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/BodyForm.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/BodyForm.java @@ -21,7 +21,9 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -40,6 +42,11 @@ public class BodyForm extends ClericSpell { return 2; } + @Override + public boolean canCast(Hero hero) { + return super.canCast(hero) && hero.hasTalent(Talent.BODY_FORM); + } + @Override public void onCast(HolyTome tome, Hero hero) { GLog.w("not implemented yet!"); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Cleanse.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Cleanse.java index 8fbe10095..e414e2c49 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Cleanse.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Cleanse.java @@ -61,6 +61,11 @@ public class Cleanse extends ClericSpell { return Messages.get(this, "desc", immunity, shield) + "\n\n" + Messages.get(this, "charge_cost", (int)chargeUse(Dungeon.hero)); } + @Override + public boolean canCast(Hero hero) { + return super.canCast(hero) && hero.hasTalent(Talent.CLEANSE); + } + @Override public void onCast(HolyTome tome, Hero hero) { 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 f30b59890..c19c6db40 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 @@ -204,6 +204,8 @@ public abstract class ClericSpell { spells.add(Radiance.INSTANCE); spells.add(Smite.INSTANCE); spells.add(LayOnHands.INSTANCE); + spells.add(AuraOfProtection.INSTANCE); + spells.add(WallOfLight.INSTANCE); spells.add(HolyLance.INSTANCE); spells.add(HallowedGround.INSTANCE); spells.add(MnemonicPrayer.INSTANCE); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/DivineIntervention.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/DivineIntervention.java index 07533485f..de65f2314 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/DivineIntervention.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/DivineIntervention.java @@ -54,6 +54,7 @@ public class DivineIntervention extends ClericSpell { @Override public boolean canCast(Hero hero) { return super.canCast(hero) + && hero.hasTalent(Talent.DIVINE_INTERVENTION) && hero.buff(AscendedForm.AscendBuff.class) != null && !hero.buff(AscendedForm.AscendBuff.class).divineInverventionCast; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/DivineSense.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/DivineSense.java index b76078704..3efd54398 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/DivineSense.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/DivineSense.java @@ -48,6 +48,11 @@ public class DivineSense extends ClericSpell { return 2; } + @Override + public boolean canCast(Hero hero) { + return super.canCast(hero) && hero.hasTalent(Talent.DIVINE_SENSE); + } + @Override public void onCast(HolyTome tome, Hero hero) { Buff.affect(hero, DivineSenseTracker.class, 30f); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Flash.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Flash.java index 2a0cb2a18..209e62fcd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Flash.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Flash.java @@ -51,7 +51,9 @@ public class Flash extends TargetedClericSpell { @Override public boolean canCast(Hero hero) { - return super.canCast(hero) && hero.buff(AscendedForm.AscendBuff.class) != null; + return super.canCast(hero) + && hero.hasTalent(Talent.FLASH) + && hero.buff(AscendedForm.AscendBuff.class) != null; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HallowedGround.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HallowedGround.java index 915ac22e1..ac2de31ff 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HallowedGround.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HallowedGround.java @@ -73,6 +73,11 @@ public class HallowedGround extends TargetedClericSpell { return Ballistica.STOP_TARGET; } + @Override + public boolean canCast(Hero hero) { + return super.canCast(hero) && hero.hasTalent(Talent.HALLOWED_GROUND); + } + @Override protected void onTargetSelected(HolyTome tome, Hero hero, Integer target) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyIntuition.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyIntuition.java index a47e2e185..c571757f6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyIntuition.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyIntuition.java @@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.effects.Identification; @@ -40,7 +41,7 @@ public class HolyIntuition extends InventoryClericSpell { @Override public int icon() { - return HeroIcon.DETECT_CURSE; + return HeroIcon.HOLY_INTUITION; } @Override @@ -53,6 +54,11 @@ public class HolyIntuition extends InventoryClericSpell { return 4 - hero.pointsInTalent(Talent.HOLY_INTUITION); } + @Override + public boolean canCast(Hero hero) { + return super.canCast(hero) && hero.hasTalent(Talent.HOLY_INTUITION); + } + @Override protected void onItemSelected(HolyTome tome, Hero hero, Item item) { if (item == null){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyLance.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyLance.java index 102de7684..26f9abb71 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyLance.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyLance.java @@ -65,7 +65,9 @@ public class HolyLance extends TargetedClericSpell { @Override public boolean canCast(Hero hero) { - return super.canCast(hero) && hero.buff(LanceCooldown.class) == null; + return super.canCast(hero) + && hero.hasTalent(Talent.HOLY_LANCE) + && hero.buff(LanceCooldown.class) == null; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Judgement.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Judgement.java index 538a6c65c..0ba7922c7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Judgement.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Judgement.java @@ -52,7 +52,9 @@ public class Judgement extends ClericSpell { @Override public boolean canCast(Hero hero) { - return super.canCast(hero) && hero.buff(AscendedForm.AscendBuff.class) != null; + return super.canCast(hero) + && hero.hasTalent(Talent.JUDGEMENT) + && hero.buff(AscendedForm.AscendBuff.class) != null; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/LayOnHands.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/LayOnHands.java index c397c93d8..cea3322cd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/LayOnHands.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/LayOnHands.java @@ -56,6 +56,11 @@ public class LayOnHands extends TargetedClericSpell { return -1; //auto-targeting behaviour is often wrong, so we don't use it } + @Override + public boolean canCast(Hero hero) { + return super.canCast(hero) && hero.hasTalent(Talent.LAY_ON_HANDS); + } + @Override protected void onTargetSelected(HolyTome tome, Hero hero, Integer target) { if (target == null) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/MindForm.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/MindForm.java index 6726882d0..e16b02f3e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/MindForm.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/MindForm.java @@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -40,6 +41,11 @@ public class MindForm extends ClericSpell { return 3; } + @Override + public boolean canCast(Hero hero) { + return super.canCast(hero) && hero.hasTalent(Talent.MIND_FORM); + } + @Override public void onCast(HolyTome tome, Hero hero) { GLog.w("not implemented yet!"); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/MnemonicPrayer.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/MnemonicPrayer.java index c731215a1..a0ef3bf73 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/MnemonicPrayer.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/MnemonicPrayer.java @@ -74,6 +74,11 @@ public class MnemonicPrayer extends TargetedClericSpell { return Ballistica.STOP_TARGET; } + @Override + public boolean canCast(Hero hero) { + return super.canCast(hero) && hero.hasTalent(Talent.MNEMONIC_PRAYER); + } + @Override @SuppressWarnings("unchecked") protected void onTargetSelected(HolyTome tome, Hero hero, Integer target) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Radiance.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Radiance.java index 17d31ef69..aa82dcb18 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Radiance.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Radiance.java @@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Light; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -49,6 +50,11 @@ public class Radiance extends ClericSpell { return 2; } + @Override + public boolean canCast(Hero hero) { + return super.canCast(hero) && hero.subClass == HeroSubClass.PRIEST; + } + @Override public void onCast(HolyTome tome, Hero hero) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/RecallInscription.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/RecallInscription.java index d7c96e672..ad8ba41c9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/RecallInscription.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/RecallInscription.java @@ -119,7 +119,9 @@ public class RecallInscription extends ClericSpell { @Override public boolean canCast(Hero hero) { - return hero.buff(UsedItemTracker.class) != null; + return super.canCast(hero) + && hero.hasTalent(Talent.RECALL_INSCRIPTION) + && hero.buff(UsedItemTracker.class) != null; } public static class UsedItemTracker extends FlavourBuff { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/ShieldOfLight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/ShieldOfLight.java index 2a14baafc..626287742 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/ShieldOfLight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/ShieldOfLight.java @@ -53,6 +53,11 @@ public class ShieldOfLight extends TargetedClericSpell { return Ballistica.STOP_TARGET; } + @Override + public boolean canCast(Hero hero) { + return super.canCast(hero) && hero.hasTalent(Talent.SHIELD_OF_LIGHT); + } + @Override protected void onTargetSelected(HolyTome tome, Hero hero, Integer target) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Smite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Smite.java index 803499531..42d10d1f5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Smite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Smite.java @@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.ui.AttackIndicator; @@ -59,6 +60,11 @@ public class Smite extends TargetedClericSpell { return 2f; } + @Override + public boolean canCast(Hero hero) { + return super.canCast(hero) && hero.subClass == HeroSubClass.PALADIN; + } + @Override protected void onTargetSelected(HolyTome tome, Hero hero, Integer target) { if (target == null) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/SpiritForm.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/SpiritForm.java index eda4da334..59aac29a2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/SpiritForm.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/SpiritForm.java @@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -40,6 +41,11 @@ public class SpiritForm extends ClericSpell { return 4; } + @Override + public boolean canCast(Hero hero) { + return super.canCast(hero) && hero.hasTalent(Talent.SPIRIT_FORM); + } + @Override public void onCast(HolyTome tome, Hero hero) { GLog.w("not implemented yet!"); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Sunray.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Sunray.java index 29aa0f3f1..5d8695e7e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Sunray.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/Sunray.java @@ -59,6 +59,11 @@ public class Sunray extends TargetedClericSpell { return Messages.get(this, "desc", min, max, dur) + "\n\n" + Messages.get(this, "charge_cost", (int)chargeUse(Dungeon.hero)); } + @Override + public boolean canCast(Hero hero) { + return super.canCast(hero) && hero.hasTalent(Talent.SUNRAY); + } + @Override protected void onTargetSelected(HolyTome tome, Hero hero, Integer target) { if (target == null){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/WallOfLight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/WallOfLight.java index 547040ecf..b0eeb9d86 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/WallOfLight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/WallOfLight.java @@ -42,11 +42,21 @@ public class WallOfLight extends TargetedClericSpell { return Messages.get(this, "desc", 1 + 2*Dungeon.hero.pointsInTalent(Talent.WALL_OF_LIGHT)) + "\n\n" + Messages.get(this, "charge_cost", (int)chargeUse(Dungeon.hero)); } + @Override + public int targetingFlags(){ + return -1; //auto-targeting behaviour is often wrong, so we don't use it + } + @Override public float chargeUse(Hero hero) { return 3f; } + @Override + public boolean canCast(Hero hero) { + return super.canCast(hero) && hero.hasTalent(Talent.WALL_OF_LIGHT); + } + @Override protected void onTargetSelected(HolyTome tome, Hero hero, Integer target) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/HeroIcon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/HeroIcon.java index f5e1c9696..a644c76e6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/HeroIcon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/HeroIcon.java @@ -76,7 +76,7 @@ public class HeroIcon extends Image { public static final int GUIDING_LIGHT = 40; public static final int HOLY_WEAPON = 41; public static final int HOLY_WARD = 42; - public static final int DETECT_CURSE = 43; + public static final int HOLY_INTUITION = 43; public static final int SHIELD_OF_LIGHT = 44; public static final int RECALL_GLYPH = 45; public static final int SUNRAY = 46;