v1.2.2: fixed great crab being able to block attacks from invis enemies
This commit is contained in:
parent
6a1c05be4b
commit
9c8b6d44f5
|
@ -72,8 +72,12 @@ public class GreatCrab extends Crab {
|
|||
public void damage( int dmg, Object src ){
|
||||
//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)){
|
||||
if (enemySeen
|
||||
&& state != SLEEPING
|
||||
&& paralysed == 0
|
||||
&& src instanceof Wand
|
||||
&& enemy == Dungeon.hero
|
||||
&& enemy.invisible == 0){
|
||||
GLog.n( Messages.get(this, "noticed") );
|
||||
sprite.showStatus( CharSprite.NEUTRAL, Messages.get(this, "def_verb") );
|
||||
Sample.INSTANCE.play( Assets.Sounds.HIT_PARRY, 1, Random.Float(0.96f, 1.05f));
|
||||
|
@ -85,7 +89,11 @@ public class GreatCrab extends Crab {
|
|||
@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 (enemySeen
|
||||
&& state != SLEEPING
|
||||
&& paralysed == 0
|
||||
&& enemy == this.enemy
|
||||
&& enemy.invisible == 0){
|
||||
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") );
|
||||
|
|
Loading…
Reference in New Issue
Block a user