v1.2.0: adjusted great crab logic, now more standard with other dodgers

This commit is contained in:
Evan Debenham 2022-02-24 12:35:39 -05:00
parent 033d0f725c
commit 3a4a9b9ed0
2 changed files with 17 additions and 6 deletions

View File

@ -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.

View File

@ -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 );