v2.2.1: added some safety checks to crystal guardians and newborn fire
This commit is contained in:
+1
-1
@@ -201,7 +201,7 @@ public class CrystalGuardian extends Mob{
|
|||||||
@Override
|
@Override
|
||||||
public boolean[] modifyPassable(boolean[] passable) {
|
public boolean[] modifyPassable(boolean[] passable) {
|
||||||
//if we are hunting, we can stomp through crystals, but prefer not to
|
//if we are hunting, we can stomp through crystals, but prefer not to
|
||||||
if (state == HUNTING){
|
if (state == HUNTING && target != -1){
|
||||||
PathFinder.buildDistanceMap(target, passable);
|
PathFinder.buildDistanceMap(target, passable);
|
||||||
|
|
||||||
if (PathFinder.distance[pos] > 2*Dungeon.level.distance(pos, target)) {
|
if (PathFinder.distance[pos] > 2*Dungeon.level.distance(pos, target)) {
|
||||||
|
|||||||
+16
-14
@@ -327,26 +327,28 @@ public abstract class Elemental extends Mob {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void zap() {
|
protected void zap() {
|
||||||
spend( 1f );
|
if (targetingPos != -1) {
|
||||||
|
spend(1f);
|
||||||
|
|
||||||
Invisibility.dispel(this);
|
Invisibility.dispel(this);
|
||||||
|
|
||||||
for (int i : PathFinder.NEIGHBOURS9){
|
for (int i : PathFinder.NEIGHBOURS9) {
|
||||||
if (!Dungeon.level.solid[targetingPos + i]) {
|
if (!Dungeon.level.solid[targetingPos + i]) {
|
||||||
CellEmitter.get(targetingPos+i).burst(ElmoParticle.FACTORY, 5);
|
CellEmitter.get(targetingPos + i).burst(ElmoParticle.FACTORY, 5);
|
||||||
if (Dungeon.level.water[targetingPos+i]){
|
if (Dungeon.level.water[targetingPos + i]) {
|
||||||
GameScene.add(Blob.seed(targetingPos+i, 2, Fire.class));
|
GameScene.add(Blob.seed(targetingPos + i, 2, Fire.class));
|
||||||
} else {
|
} else {
|
||||||
GameScene.add(Blob.seed(targetingPos+i, 8, Fire.class));
|
GameScene.add(Blob.seed(targetingPos + i, 8, Fire.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
Char target = Actor.findChar(targetingPos+i);
|
Char target = Actor.findChar(targetingPos + i);
|
||||||
if (target != null && target != this){
|
if (target != null && target != this) {
|
||||||
Buff.affect(target, Burning.class).reignite(target);
|
Buff.affect(target, Burning.class).reignite(target);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Sample.INSTANCE.play(Assets.Sounds.BURNING);
|
||||||
}
|
}
|
||||||
Sample.INSTANCE.play(Assets.Sounds.BURNING);
|
|
||||||
|
|
||||||
targetingPos = -1;
|
targetingPos = -1;
|
||||||
rangedCooldown = Random.NormalIntRange( 3, 5 );
|
rangedCooldown = Random.NormalIntRange( 3, 5 );
|
||||||
|
|||||||
Reference in New Issue
Block a user