v2.4.0: improved when the player taps on an enemy that charmed them

This commit is contained in:
Evan Debenham
2024-04-07 16:23:07 -04:00
parent f23962ec56
commit f857349a57
2 changed files with 9 additions and 1 deletions

View File

@@ -141,6 +141,7 @@ actors.buffs.championenemy$growing.desc=Growing champions gain a steadily increa
actors.buffs.charm.name=charmed
actors.buffs.charm.heromsg=You are charmed!
actors.buffs.charm.cant_attack=You are charmed by that enemy and can't attack them.
actors.buffs.charm.desc=A charm is manipulative magic that can make enemies temporarily adore each other.\n\nCharacters affected by charm are unable to directly attack the enemy they are charmed by. Attacking other targets is still possible however. The shock of pain will lessen the duration of charm.\n\nTurns of charm remaining: %s.
actors.buffs.chill.name=chilled

View File

@@ -43,6 +43,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Berserk;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bless;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Combo;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Foresight;
@@ -1305,7 +1306,13 @@ public class Hero extends Char {
enemy = action.target;
if (enemy.isAlive() && canAttack( enemy ) && !isCharmedBy( enemy ) && enemy.invisible == 0) {
if (isCharmedBy( enemy )){
GLog.w( Messages.get(Charm.class, "cant_attack"));
ready();
return false;
}
if (enemy.isAlive() && canAttack( enemy ) && enemy.invisible == 0) {
if (heroClass != HeroClass.DUELIST
&& hasTalent(Talent.AGGRESSIVE_BARRIER)