From 39662320827fd317b1d46fd666b41e926c8b0b1b Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 27 Nov 2024 11:37:05 -0500 Subject: [PATCH] v3.0.0: expanded artifacts that can trigger illuminate for priest --- .../assets/messages/actors/actors.properties | 2 +- .../items/artifacts/Artifact.java | 8 ----- .../items/artifacts/DriedRose.java | 14 +++++--- .../items/artifacts/TimekeepersHourglass.java | 8 +++++ .../items/artifacts/UnstableSpellbook.java | 34 +++++++++++++++++++ 5 files changed, 52 insertions(+), 14 deletions(-) diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index da8afbf5a..f8f180ae2 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -564,7 +564,7 @@ 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. actors.hero.spells.guidinglight.desc=The Cleric fires a bolt of magical energy which strikes a target, dealing 2-6 damage and illuminating them. The next physical attack made against an illuminated enemy is guaranteed to hit them. -actors.hero.spells.guidinglight.desc_priest=_This spell is more powerful when cast by the Priest._ The first cast of the spell every 100 turns costs no tome charges, and illumination can be triggered by wands and some artifacts, dealing bonus damage equal to the item's level plus five. +actors.hero.spells.guidinglight.desc_priest=_This spell is more powerful when cast by the Priest._ The first cast of the spell every 100 turns costs no tome charges, and illumination can be triggered by wands and some artifacts, dealing bonus damage equal to the item's level plus five. Any artifact that directly affects an enemy will trigger this effect. actors.hero.spells.guidinglight$guidinglightpriestcooldown.name=Guiding Light actors.hero.spells.guidinglight$guidinglightpriestcooldown.desc=The Priest will be able to cast Guiding Light for free again after 100 turns elapse.\n\nTurns remaining: %s. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java index 90e2c9273..6952cb49b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java @@ -137,14 +137,6 @@ public class Artifact extends KindofMisc { upgrade(Math.round((transferLvl*levelCap)/10f)); } - //TODO CLERIC consider all the cases in which this might happen, atm it's fairly conservative - // Currently works with 4/10 artifacts, could also: - // It should definitely trigger from unstable spellbook - // could possibly trigger from dried rose ghost melee - // maybe from hitting a target while time frozen from hourglass? - // could trigger from items crafted via toolkit? That's a big stretch - // makes no sense with horn, unless I work out some kind of self-buff that then applies to melee or spells - // 0 sense with chalice in all cases public static void artifactProc(Char target, int artifLevel, int chargesUsed){ if (Dungeon.hero.subClass == HeroSubClass.PRIEST && target.buff(GuidingLight.Illuminated.class) != null) { target.buff(GuidingLight.Illuminated.class).detach(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java index dc871c5f0..28f407233 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java @@ -643,13 +643,17 @@ public class DriedRose extends Artifact { @Override public int attackProc(Char enemy, int damage) { damage = super.attackProc(enemy, damage); - if (rose != null && rose.weapon != null) { - damage = rose.weapon.proc( this, enemy, damage ); - if (!enemy.isAlive() && enemy == Dungeon.hero){ - Dungeon.fail(this); - GLog.n( Messages.capitalize(Messages.get(Char.class, "kill", name())) ); + if (rose != null) { + if (rose.weapon != null) { + damage = rose.weapon.proc(this, enemy, damage); + if (!enemy.isAlive() && enemy == Dungeon.hero) { + Dungeon.fail(this); + GLog.n(Messages.capitalize(Messages.get(Char.class, "kill", name()))); + } } + Artifact.artifactProc(Dungeon.hero, rose.visiblyUpgraded(), 0); } + return damage; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java index 8e071e6c3..ec1b4f6c6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java @@ -120,6 +120,14 @@ public class TimekeepersHourglass extends Artifact { Talent.onArtifactUsed(Dungeon.hero); activeBuff.attachTo(Dungeon.hero); } else if (index == 1) { + + //This might be really good... + for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { + if (Dungeon.level.heroFOV[mob.pos]) { + artifactProc(mob, visiblyUpgraded(), 1); + } + } + GLog.i( Messages.get(TimekeepersHourglass.class, "onfreeze") ); GameScene.flash(0x80FFFFFF); Sample.INSTANCE.play(Assets.Sounds.TELEPORT); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java index af60687f7..01515d520 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java @@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; @@ -37,8 +38,11 @@ import com.shatteredpixel.shatteredpixeldungeon.items.bags.ScrollHolder; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfLullaby; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRage; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTerror; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTransmutation; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ExoticScroll; import com.shatteredpixel.shatteredpixeldungeon.journal.Catalog; @@ -157,9 +161,11 @@ public class UnstableSpellbook extends Artifact { curItem = scroll; charge--; scroll.anonymize(); + checkForArtifactProc(curUser, scroll); scroll.doRead(); Talent.onArtifactUsed(Dungeon.hero); } else { + checkForArtifactProc(curUser, fScroll); fScroll.doRead(); Talent.onArtifactUsed(Dungeon.hero); } @@ -172,9 +178,20 @@ public class UnstableSpellbook extends Artifact { } }); } else { + checkForArtifactProc(curUser, scroll); scroll.doRead(); Talent.onArtifactUsed(Dungeon.hero); } + + //scrolls that are AOE on all visible: + //lullaby + // rage, challenge(?) + // retrib, psy blast + // terror, dread + + //Scrolls that are targeted: + //siren's song (also AOE tho) + updateQuickslot(); } @@ -183,6 +200,23 @@ public class UnstableSpellbook extends Artifact { } } + private void checkForArtifactProc(Hero user, Scroll scroll){ + //if the base scroll (exotics all match) is an AOE effect, then also trigger illuminate + if (scroll instanceof ScrollOfLullaby + || scroll instanceof ScrollOfRemoveCurse || scroll instanceof ScrollOfTerror) { + for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { + if (Dungeon.level.heroFOV[mob.pos]) { + artifactProc(mob, visiblyUpgraded(), 1); + } + } + //except rage, which affects everything even if it isn't visible + } else if (scroll instanceof ScrollOfRage){ + for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { + artifactProc(mob, visiblyUpgraded(), 1); + } + } + } + //forces the reading of a regular scroll if the player tried to exploit by quitting the game when the menu was up public static class ExploitHandler extends Buff { { actPriority = VFX_PRIO; }