From 452276522433bad05b805bcb40917b9a5abf4c85 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 1 Mar 2023 13:49:30 -0500 Subject: [PATCH] v2.0.0: red sentries now roll accuracy like other enemies --- .../levels/rooms/special/SentryRoom.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/SentryRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/SentryRoom.java index b4d0615e3..0a2f07b36 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/SentryRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/SentryRoom.java @@ -42,6 +42,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.EmptyRoom; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.MobSprite; import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -276,14 +277,23 @@ public class SentryRoom extends SpecialRoom { } public void onZapComplete(){ - Dungeon.hero.damage(Random.NormalIntRange(2+Dungeon.depth/2, 4+Dungeon.depth), new Eye.DeathGaze()); - if (!Dungeon.hero.isAlive()){ - Badges.validateDeathFromEnemyMagic(); - Dungeon.fail( getClass() ); - GLog.n( Messages.capitalize(Messages.get(Char.class, "kill", name())) ); + if (hit(this, Dungeon.hero, true)) { + Dungeon.hero.damage(Random.NormalIntRange(2 + Dungeon.depth / 2, 4 + Dungeon.depth), new Eye.DeathGaze()); + if (!Dungeon.hero.isAlive()) { + Badges.validateDeathFromEnemyMagic(); + Dungeon.fail(getClass()); + GLog.n(Messages.capitalize(Messages.get(Char.class, "kill", name()))); + } + } else { + Dungeon.hero.sprite.showStatus( CharSprite.NEUTRAL, Dungeon.hero.defenseVerb() ); } } + @Override + public int attackSkill(Char target) { + return 20 + Dungeon.depth * 2; + } + @Override public int defenseSkill( Char enemy ) { return INFINITE_EVASION;