From 0bac8d9d0461e501ef9a3f688c7e2d2c3c88f6f5 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 2 Feb 2025 12:32:52 -0500 Subject: [PATCH] v3.0.0: fixed targeted cleric spells not updating targeted char --- .../actors/hero/spells/BodyForm.java | 8 +++++--- .../actors/hero/spells/GuidingLight.java | 7 +++++++ .../actors/hero/spells/HolyLance.java | 7 +++++++ .../actors/hero/spells/MnemonicPrayer.java | 3 +++ .../actors/hero/spells/ShieldOfLight.java | 3 +++ .../shatteredpixeldungeon/actors/hero/spells/Sunray.java | 7 +++++++ 6 files changed, 32 insertions(+), 3 deletions(-) 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 2a79ca553..8ea6432e9 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,12 +21,12 @@ 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.actors.hero.abilities.cleric.Trinity; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; +import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon; -import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class BodyForm extends ClericSpell { @@ -49,7 +49,9 @@ public class BodyForm extends ClericSpell { @Override public void onCast(HolyTome tome, Hero hero) { - GLog.w("not implemented yet!"); + + GameScene.show(new Trinity.WndItemtypeSelect(tome, this)); + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/GuidingLight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/GuidingLight.java index 91794c966..98dd5881d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/GuidingLight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/GuidingLight.java @@ -37,6 +37,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon; +import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.Image; import com.watabou.noosa.audio.Sample; @@ -65,6 +66,12 @@ public class GuidingLight extends TargetedClericSpell { return; } + if (Actor.findChar(aim.collisionPos) != null) { + QuickSlotButton.target(Actor.findChar(aim.collisionPos)); + } else { + QuickSlotButton.target(Actor.findChar(target)); + } + hero.busy(); Sample.INSTANCE.play( Assets.Sounds.ZAP ); hero.sprite.zap(target); 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 26f9abb71..b6b6cb387 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 @@ -40,6 +40,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.MissileSprite; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon; +import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.Image; import com.watabou.noosa.audio.Sample; @@ -93,6 +94,12 @@ public class HolyLance extends TargetedClericSpell { return; } + if (Actor.findChar(aim.collisionPos) != null) { + QuickSlotButton.target(Actor.findChar(aim.collisionPos)); + } else { + QuickSlotButton.target(Actor.findChar(target)); + } + hero.sprite.zap( target ); hero.busy(); 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 a0ef3bf73..064e07261 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 @@ -57,6 +57,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.plants.Sungrass; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon; +import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; @@ -93,6 +94,8 @@ public class MnemonicPrayer extends TargetedClericSpell { return; } + QuickSlotButton.target(ch); + float extension = 2 + hero.pointsInTalent(Talent.MNEMONIC_PRAYER); if (ch.alignment == Char.Alignment.ALLY){ 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 626287742..10317a3c6 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 @@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon; +import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundle; @@ -71,6 +72,8 @@ public class ShieldOfLight extends TargetedClericSpell { return; } + QuickSlotButton.target(ch); + Sample.INSTANCE.play(Assets.Sounds.READ); hero.sprite.operate(hero.pos); 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 5d8695e7e..dd33a7a4e 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 @@ -38,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon; +import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Random; @@ -77,6 +78,12 @@ public class Sunray extends TargetedClericSpell { return; } + if (Actor.findChar(aim.collisionPos) != null) { + QuickSlotButton.target(Actor.findChar(aim.collisionPos)); + } else { + QuickSlotButton.target(Actor.findChar(target)); + } + hero.busy(); Sample.INSTANCE.play( Assets.Sounds.RAY ); hero.sprite.zap(target);