@Override protected void activate(final int cell) { boolean[] FOV = new boolean[Dungeon.level.length()]; Point c = Dungeon.level.cellToPoint(cell); ShadowCaster.castShadow(c.x, c.y, FOV, Dungeon.level.losBlocking, DIST);
@Override protected void activate(final int cell) { boolean[] FOV = new boolean[Dungeon.level.length()]; Point c = Dungeon.level.cellToPoint(cell); ShadowCaster.castShadow(c.x, c.y, FOV, Dungeon.level.losBlocking, DIST);
@Override public void explode(int cell) { super.explode(cell); boolean[] FOV = new boolean[Dungeon.level.length()]; Point c = Dungeon.level.cellToPoint(cell); ShadowCaster.castShadow(c.x, c.y, FOV, Dungeon.level.losBlocking, 8); for (int i = 0; i < FOV.length; i++) { if (FOV[i]) { if (Dungeon.level.heroFOV[i] && !Dungeon.level.solid[i]) { //TODO better vfx? CellEmitter.center( i ).burst( BlastParticle.FACTORY, 5 ); } Char ch = Actor.findChar(i); if (ch != null){ //regular bomb damage int damage = Math.round(Random.NormalIntRange( Dungeon.depth+5, 10 + Dungeon.depth * 2 )); damage -= ch.drRoll(); ch.damage(damage, this); if (ch == Dungeon.hero && !ch.isAlive()) Dungeon.fail(Bomb.class); } } } }
@Override public void explode(int cell) { super.explode(cell); boolean[] FOV = new boolean[Dungeon.level.length()]; Point c = Dungeon.level.cellToPoint(cell); ShadowCaster.castShadow(c.x, c.y, FOV, Dungeon.level.losBlocking, 8); for (int i = 0; i < FOV.length; i++) { if (FOV[i]) { if (Dungeon.level.heroFOV[i] && !Dungeon.level.solid[i]) { //TODO better vfx? CellEmitter.center( i ).burst( BlastParticle.FACTORY, 5 ); } Char ch = Actor.findChar(i); if (ch != null){ //regular bomb damage int damage = Math.round(Random.NormalIntRange( Dungeon.depth+5, 10 + Dungeon.depth * 2 )); damage -= ch.drRoll(); ch.damage(damage, this); if (ch == Dungeon.hero && !ch.isAlive()) Dungeon.fail(Bomb.class); } } } }