v3.0.0: fixed rare cases where breaking potions can affect bomb AOE
bombs now pre-process cells instead
This commit is contained in:
@@ -142,7 +142,8 @@ public class Bomb extends Item {
|
|||||||
|
|
||||||
if (explodesDestructively()) {
|
if (explodesDestructively()) {
|
||||||
|
|
||||||
ArrayList<Char> affected = new ArrayList<>();
|
ArrayList<Integer> affectedCells = new ArrayList<>();
|
||||||
|
ArrayList<Char> affectedChars = new ArrayList<>();
|
||||||
|
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
CellEmitter.center(cell).burst(BlastParticle.FACTORY, 30);
|
CellEmitter.center(cell).burst(BlastParticle.FACTORY, 30);
|
||||||
@@ -155,6 +156,15 @@ public class Bomb extends Item {
|
|||||||
PathFinder.buildDistanceMap( cell, explodable, explosionRange() );
|
PathFinder.buildDistanceMap( cell, explodable, explosionRange() );
|
||||||
for (int i = 0; i < PathFinder.distance.length; i++) {
|
for (int i = 0; i < PathFinder.distance.length; i++) {
|
||||||
if (PathFinder.distance[i] != Integer.MAX_VALUE) {
|
if (PathFinder.distance[i] != Integer.MAX_VALUE) {
|
||||||
|
affectedCells.add(i);
|
||||||
|
Char ch = Actor.findChar(i);
|
||||||
|
if (ch != null) {
|
||||||
|
affectedChars.add(ch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i : affectedCells){
|
||||||
if (Dungeon.level.heroFOV[i]) {
|
if (Dungeon.level.heroFOV[i]) {
|
||||||
CellEmitter.get(i).burst(SmokeParticle.FACTORY, 4);
|
CellEmitter.get(i).burst(SmokeParticle.FACTORY, 4);
|
||||||
}
|
}
|
||||||
@@ -170,15 +180,9 @@ public class Bomb extends Item {
|
|||||||
if (heap != null) {
|
if (heap != null) {
|
||||||
heap.explode();
|
heap.explode();
|
||||||
}
|
}
|
||||||
|
|
||||||
Char ch = Actor.findChar(i);
|
|
||||||
if (ch != null) {
|
|
||||||
affected.add(ch);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Char ch : affected){
|
for (Char ch : affectedChars){
|
||||||
|
|
||||||
//if they have already been killed by another bomb
|
//if they have already been killed by another bomb
|
||||||
if(!ch.isAlive()){
|
if(!ch.isAlive()){
|
||||||
|
|||||||
Reference in New Issue
Block a user