v3.0.0: finished implementing the divine intervention spell

This commit is contained in:
Evan Debenham
2024-12-15 23:39:17 -05:00
parent 3c577c3fbc
commit 6c49a87479
2 changed files with 16 additions and 3 deletions
@@ -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
@@ -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