From 6c49a87479a621974106fb79369d35162686c533 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 15 Dec 2024 23:39:17 -0500 Subject: [PATCH] v3.0.0: finished implementing the divine intervention spell --- .../assets/messages/actors/actors.properties | 2 +- .../actors/hero/spells/DivineIntervention.java | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index ce4b348ca..5d691a9ed 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -567,7 +567,7 @@ actors.hero.spells.divinesense$divinesensetracker.desc=The Cleric is temporarily actors.hero.spells.divineintervention.name=divine intervention actors.hero.spells.divineintervention.short_desc=Massive shield boost to Cleric and allies. -actors.hero.spells.divineintervention.desc=TODO +actors.hero.spells.divineintervention.desc=The Cleric pours a tremendous amount of power from their tome into themselves and allies, boosting everyone to %d shielding. This spell's incredible defensive power is weighed against its very high charge cost.\n\nJust like other shielding granted by ascended form, this shielding does not decay normally, but will immediately expire when ascended form ends. actors.hero.spells.flash.name=flash actors.hero.spells.flash.prompt=Choose a location 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 d2949a618..a4f934c9f 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 @@ -21,6 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells; +import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; @@ -29,9 +30,12 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ShieldBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.cleric.AscendedForm; +import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon; +import com.watabou.noosa.audio.Sample; public class DivineIntervention extends ClericSpell { @@ -44,7 +48,7 @@ public class DivineIntervention extends ClericSpell { @Override public float chargeUse(Hero hero) { - return 2; //TODO + return 6; } @Override @@ -55,11 +59,13 @@ public class DivineIntervention extends ClericSpell { @Override public void onCast(HolyTome tome, Hero hero) { - //TODO vfx + Sample.INSTANCE.play(Assets.Sounds.CHARGEUP, 1, 1.2f); + hero.sprite.operate(hero.pos); for (Char ch : Actor.chars()){ if (ch.alignment == Char.Alignment.ALLY && ch != hero){ Buff.affect(ch, DivineShield.class).setShield(150 + 50*hero.pointsInTalent(Talent.DIVINE_INTERVENTION)); + new Flare(6, 32).color(0xFFFF00, true).show(ch.sprite, 2f); } } @@ -68,9 +74,16 @@ public class DivineIntervention extends ClericSpell { //we apply buffs here so that the 6 charge cost and shield boost do not stack hero.buff(AscendedForm.AscendBuff.class).setShield(150 + 50*hero.pointsInTalent(Talent.DIVINE_INTERVENTION)); + new Flare(6, 32).color(0xFFFF00, true).show(hero.sprite, 2f); } + @Override + public String desc() { + int shield = 150 + 50*Dungeon.hero.pointsInTalent(Talent.DIVINE_INTERVENTION); + return Messages.get(this, "desc", shield) + "\n\n" + Messages.get(this, "charge_cost", (int)chargeUse(Dungeon.hero)); + } + public static class DivineShield extends ShieldBuff{ @Override