From 3a4a9b9ed0bf9ee26ab4ad44ca2b3fcf565f2ed5 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 24 Feb 2022 12:35:39 -0500 Subject: [PATCH] v1.2.0: adjusted great crab logic, now more standard with other dodgers --- .../assets/messages/actors/actors.properties | 1 - .../actors/mobs/GreatCrab.java | 22 ++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index ee1130899..95d1aed50 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -982,7 +982,6 @@ actors.mobs.goo.desc=Little is known about The Goo. It's quite possible that it actors.mobs.greatcrab.name=great crab actors.mobs.greatcrab.noticed=The crab blocks with its massive claw. -actors.mobs.greatcrab.blocked=blocked actors.mobs.greatcrab.def_verb=blocked actors.mobs.greatcrab.desc=This crab is gigantic, even compared to other sewer crabs. Its blue shell is covered in cracks and barnacles, showing great age. It lumbers around slowly, barely keeping balance with its massive claw.\n\nWhile the crab only has one claw, its size easily compensates. The crab holds the claw in front of any threat, shielding itself behind an impenetrable wall of carapace. However, the crab cannot block attacks it doesn't see coming, or attacks from multiple enemies at once. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GreatCrab.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GreatCrab.java index 00467edcb..a8f6501d3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GreatCrab.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GreatCrab.java @@ -70,19 +70,31 @@ public class GreatCrab extends Crab { @Override public void damage( int dmg, Object src ){ - //crab blocks all attacks originating from its current enemy if it sees them. - //All direct damage is negated, no exceptions. environmental effects go through as normal. + //crab blocks all wand damage from the hero if it sees them. + //Direct damage is negated, but add-on effects and environmental effects go through as normal. if ((enemySeen && state != SLEEPING && paralysed == 0) - && ((src instanceof Wand && enemy == Dungeon.hero) - || (src instanceof Char && enemy == src))){ + && (src instanceof Wand && enemy == Dungeon.hero)){ GLog.n( Messages.get(this, "noticed") ); - sprite.showStatus( CharSprite.NEUTRAL, Messages.get(this, "blocked") ); + sprite.showStatus( CharSprite.NEUTRAL, Messages.get(this, "def_verb") ); Sample.INSTANCE.play( Assets.Sounds.HIT_PARRY, 1, Random.Float(0.96f, 1.05f)); } else { super.damage( dmg, src ); } } + @Override + public int defenseSkill( Char enemy ) { + //crab blocks all melee attacks from its current target + if (enemySeen && state != SLEEPING && paralysed == 0 && enemy == this.enemy){ + if (sprite != null && sprite.visible) { + Sample.INSTANCE.play(Assets.Sounds.HIT_PARRY, 1, Random.Float(0.96f, 1.05f)); + GLog.n( Messages.get(this, "noticed") ); + } + return INFINITE_EVASION; + } + return super.defenseSkill( enemy ); + } + @Override public void die( Object cause ) { super.die( cause );