From 5b083c2244fee1ba144ddbde0c33bef5e48eba05 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 6 Jan 2025 14:46:34 -0500 Subject: [PATCH] v3.0.0: fixed an exploit where guiding light could mitigate encumbrance --- .../main/assets/messages/actors/actors.properties | 2 +- .../shatteredpixeldungeon/actors/mobs/Mob.java | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index 5992cdf16..0a2adecd2 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -576,7 +576,7 @@ actors.hero.spells.flash.desc=The Cleric channels their ascended form at a nearb actors.hero.spells.guidinglight.name=guiding light 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=The Cleric fires a bolt of magical energy which strikes a target, dealing 2-6 damage and illuminating them. The next non-encumbered 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, other characters, and artifacts that directly affect enemies. When triggered in this way, illuminated deals bonus magic damage equal to the Priest's level. 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/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index de9f43530..c020a099a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -665,9 +665,21 @@ public abstract class Mob extends Char { @Override public int defenseSkill( Char enemy ) { + if (buff(GuidingLight.Illuminated.class) != null){ + //if the attacker is the hero, they must be using a weapon they have the str for + if (enemy instanceof Hero){ + Hero h = (Hero) enemy; + if (!(h.belongings.attackingWeapon() instanceof Weapon) + || ((Weapon) h.belongings.attackingWeapon()).STRReq() <= h.STR()){ + return 0; + } + } else { + return 0; + } + } + if ( !surprisedBy(enemy) && paralysed == 0 - && buff(GuidingLight.Illuminated.class) == null && !(alignment == Alignment.ALLY && enemy == Dungeon.hero)) { return this.defenseSkill; } else {