v0.8.2: fixed logic errors in new targeted trap behaviour

This commit is contained in:
Evan Debenham 2020-07-31 23:58:59 -04:00
parent 07d58369f8
commit 525b934789
4 changed files with 4 additions and 0 deletions

View File

@ -58,6 +58,7 @@ public class DisintegrationTrap extends Trap {
Ballistica bolt = new Ballistica(pos, ch.pos, Ballistica.PROJECTILE);
if (bolt.collisionPos == ch.pos && curDist < closestDist){
target = ch;
closestDist = curDist;
}
}
}

View File

@ -57,6 +57,7 @@ public class GrimTrap extends Trap {
Ballistica bolt = new Ballistica(pos, ch.pos, Ballistica.PROJECTILE);
if (bolt.collisionPos == ch.pos && curDist < closestDist){
target = ch;
closestDist = curDist;
}
}
}

View File

@ -69,6 +69,7 @@ public class PoisonDartTrap extends Trap {
Ballistica bolt = new Ballistica(pos, ch.pos, Ballistica.PROJECTILE);
if (canTarget(ch) && bolt.collisionPos == ch.pos && curDist < closestDist){
target = ch;
closestDist = curDist;
}
}
}

View File

@ -54,6 +54,7 @@ public class WornDartTrap extends Trap {
Ballistica bolt = new Ballistica(pos, ch.pos, Ballistica.PROJECTILE);
if (bolt.collisionPos == ch.pos && curDist < closestDist){
target = ch;
closestDist = curDist;
}
}
}