v0.7.5b: tweaked enemy zap animation behaviour

This commit is contained in:
Evan Debenham 2019-10-14 12:17:52 -04:00
parent 1395602687
commit 1b636c7d0d
3 changed files with 29 additions and 11 deletions

View File

@ -173,6 +173,8 @@ public class Necromancer extends Mob {
Buff.affect(mySkeleton, Adrenaline.class, 3f);
}
next();
}
private class Hunting extends Mob.Hunting{
@ -273,6 +275,7 @@ public class Necromancer extends Mob {
} else if (enemySeen && mySkeleton != null){
target = enemy.pos;
spend(TICK);
if (!fieldOfView[mySkeleton.pos]){
@ -290,25 +293,37 @@ public class Necromancer extends Mob {
}
if (telePos != -1){
sprite.zap(telePos);
ScrollOfTeleportation.appear(mySkeleton, telePos);
mySkeleton.teleportSpend();
if (sprite != null && sprite.visible){
sprite.zap(telePos);
return false;
} else {
onZapComplete();
}
}
}
return true;
} else {
//zap skeleton
if (mySkeleton.HP < mySkeleton.HT || mySkeleton.buff(Adrenaline.class) == null) {
sprite.zap(mySkeleton.pos);
if (sprite != null && sprite.visible){
sprite.zap(mySkeleton.pos);
return false;
} else {
onZapComplete();
}
}
}
spend(TICK);
return true;
//otherwise, default to regular hunting behaviour
} else {
return super.act(enemyInFOV, justAlerted);

View File

@ -85,8 +85,7 @@ public class Shaman extends Mob implements Callback {
} else {
boolean visible = fieldOfView[pos] || fieldOfView[enemy.pos];
if (visible) {
if (sprite != null && sprite.visible) {
sprite.zap( enemy.pos );
}
@ -115,7 +114,12 @@ public class Shaman extends Mob implements Callback {
enemy.sprite.showStatus( CharSprite.NEUTRAL, enemy.defenseVerb() );
}
return !visible;
if (sprite != null && sprite.visible) {
sprite.zap( enemy.pos );
return false;
} else {
return true;
}
}
}

View File

@ -84,14 +84,13 @@ public class Warlock extends Mob implements Callback {
} else {
boolean visible = fieldOfView[pos] || fieldOfView[enemy.pos];
if (visible) {
if (sprite != null && sprite.visible) {
sprite.zap( enemy.pos );
return false;
} else {
zap();
return true;
}
return !visible;
}
}