diff --git a/core/src/main/assets/interfaces/hero_icons.png b/core/src/main/assets/interfaces/hero_icons.png index 669c6c3c5..4581249d2 100644 Binary files a/core/src/main/assets/interfaces/hero_icons.png and b/core/src/main/assets/interfaces/hero_icons.png differ diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index 7649b184a..5af334609 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -535,6 +535,13 @@ actors.hero.abilities.ratmogrify$transmograt.rankings_desc=Slain by: ratmogrifie ##Cleric Spells actors.hero.spells.clericspell.charge_cost=Charge cost: %d +actors.hero.spells.detectcurse.name=detect curse +actors.hero.spells.detectcurse.prompt=choose an item +actors.hero.spells.detectcurse.cursed=You sense malevolent magic lurking within this item. +actors.hero.spells.detectcurse.uncursed=This item is free of malevolent magic. +actors.hero.spells.detectcurse.short_desc=identifies whether an item is cursed or not. +actors.hero.spells.detectcurse.desc=The Cleric focuses their senses on an item and determines whether it is cursed or not without having to equip it. + actors.hero.spells.guidinglight.name=guiding light actors.hero.spells.guidinglight.prompt=choose a target actors.hero.spells.guidinglight.short_desc=Deals ranged magic damage and guarantees a hit. @@ -989,8 +996,8 @@ actors.hero.talent.counter_ability.desc=_+1:_ If the Duelist uses a weapon abili #cleric actors.hero.talent.clerict1a.title=fasting actors.hero.talent.clerict1a.desc=_+1:_ The Cleric can cast _???_ at the cost of 1 charge. This spell restores _30 turns of satiety_, grants _3 shielding_, and is cast instantly.\n\n_+2:_ The Cleric can cast _???_ at the cost of 1 charge. This spell restores _50 turns of satiety_, grants _5 shielding_, and is cast instantly. -actors.hero.talent.clerict1b.title=detect curse -actors.hero.talent.clerict1b.desc=_+1:_ The Cleric can cast _Detect Curse,_ a spell that reveals whether an item is cursed at the cost of _3 charges._\n\n_+2:_ The Cleric can cast _Detect Curse,_ a spell that reveals whether an item is cursed at the cost of _2 charges._ +actors.hero.talent.detect_curse.title=detect curse +actors.hero.talent.detect_curse.desc=_+1:_ The Cleric can cast _Detect Curse,_ a spell that reveals whether an item is cursed at the cost of _3 charges._\n\n_+2:_ The Cleric can cast _Detect Curse,_ a spell that reveals whether an item is cursed at the cost of _2 charges._ actors.hero.talent.searing_light.title=searing light actors.hero.talent.searing_light.desc=_+1:_ Physical attacks on enemies illuminated by _Guiding Light_ deal _+3 damage._\n\n_+2:_ Physical attacks on enemies illuminated by _Guiding Light_ deal _+5 damage._ actors.hero.talent.clerict1d.title=circle of healing diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java index 1ed3ee2b0..8df082e9e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java @@ -172,7 +172,7 @@ public enum Talent { FEIGNED_RETREAT(151, 4), EXPOSE_WEAKNESS(152, 4), COUNTER_ABILITY(153, 4), //Cleric T1 - CLERICT1A(160), CLERICT1B(161), SEARING_LIGHT(162), CLERICT1D(163), + CLERICT1A(160), DETECT_CURSE(161), SEARING_LIGHT(162), CLERICT1D(163), //Cleric T2 CLERICT2A(164), CLERICT2B(165), CLERICT2C(166), CLERICT2D(167), CLERICT2E(168), //Cleric T3 @@ -869,7 +869,7 @@ public enum Talent { Collections.addAll(tierTalents, STRENGTHENING_MEAL, ADVENTURERS_INTUITION, PATIENT_STRIKE, AGGRESSIVE_BARRIER); break; case CLERIC: - Collections.addAll(tierTalents, CLERICT1A, CLERICT1B, SEARING_LIGHT, CLERICT1D); + Collections.addAll(tierTalents, CLERICT1A, DETECT_CURSE, SEARING_LIGHT, CLERICT1D); break; } for (Talent talent : tierTalents){ 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 5955fd877..c159c3429 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 @@ -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.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon; @@ -59,6 +61,10 @@ public abstract class ClericSpell { spells.add(HolyWeapon.INSTANCE); spells.add(HolyWard.INSTANCE); + if (cleric.hasTalent(Talent.DETECT_CURSE)){ + spells.add(DetectCurse.INSTANCE); + } + return spells; }; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/DetectCurse.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/DetectCurse.java new file mode 100644 index 000000000..b4ba60e10 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/DetectCurse.java @@ -0,0 +1,80 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2024 Evan Debenham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells; + +import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; +import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem; +import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; +import com.watabou.noosa.audio.Sample; + +public class DetectCurse extends InventoryClericSpell { + + public static final DetectCurse INSTANCE = new DetectCurse(); + + @Override + public int icon() { + return HeroIcon.DETECT_CURSE; + } + + @Override + protected boolean usableOnItem(Item item) { + return item instanceof EquipableItem && !item.isIdentified() && !item.cursedKnown; + } + + @Override + public float chargeUse(Hero hero) { + return 4 - hero.pointsInTalent(Talent.DETECT_CURSE); + } + + @Override + protected void onItemSelected(HolyTome tome, Hero hero, Item item) { + if (item == null){ + return; + } + + item.cursedKnown = true; + + if (item.cursed){ + GLog.w(Messages.get(this, "cursed")); + } else { + GLog.i(Messages.get(this, "uncursed")); + } + + hero.spend( 1f ); + hero.busy(); + hero.sprite.operate(hero.pos); + + tome.spendCharge(chargeUse(hero)); + + Sample.INSTANCE.play( Assets.Sounds.SCAN ); + Invisibility.dispel(); + + } + +} 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 d83de5c13..412140f9e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/HeroIcon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/HeroIcon.java @@ -71,6 +71,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; //action indicator visuals public static final int BERSERK = 80;