v0.7.1: bugfixes:

- fixed keys spawning without chests in secret chest chasms rooms when challenges were enabled
- fixed fireblast rarely damaging enemies who move into it's effect as it's resolving
- fixed dew drops rarely landing on stairs, making them inaccessible.
This commit is contained in:
Evan Debenham 2018-11-18 19:23:55 -05:00
parent 24e311dc58
commit b6f8aacd9d
3 changed files with 58 additions and 32 deletions

View File

@ -42,6 +42,7 @@ import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Callback; import com.watabou.utils.Callback;
import com.watabou.utils.PathFinder; import com.watabou.utils.PathFinder;
import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
public class WandOfFireblast extends DamageWand { public class WandOfFireblast extends DamageWand {
@ -71,6 +72,7 @@ public class WandOfFireblast extends DamageWand {
@Override @Override
protected void onZap( Ballistica bolt ) { protected void onZap( Ballistica bolt ) {
ArrayList<Char> affectedChars = new ArrayList<>();
for( int cell : affectedCells){ for( int cell : affectedCells){
//ignore caster cell //ignore caster cell
@ -86,7 +88,11 @@ public class WandOfFireblast extends DamageWand {
Char ch = Actor.findChar( cell ); Char ch = Actor.findChar( cell );
if (ch != null) { if (ch != null) {
affectedChars.add(ch);
}
}
for ( Char ch : affectedChars ){
processSoulMark(ch, chargesPerCast()); processSoulMark(ch, chargesPerCast());
ch.damage(damageRoll(), this); ch.damage(damageRoll(), this);
Buff.affect( ch, Burning.class ).reignite( ch ); Buff.affect( ch, Burning.class ).reignite( ch );
@ -100,7 +106,6 @@ public class WandOfFireblast extends DamageWand {
} }
} }
} }
}
//burn... BURNNNNN!..... //burn... BURNNNNN!.....
private void spreadFlames(int cell, float strength){ private void spreadFlames(int cell, float strength){

View File

@ -310,7 +310,9 @@ public class WandOfRegrowth extends Wand {
ArrayList<Integer> candidates = new ArrayList<Integer>(); ArrayList<Integer> candidates = new ArrayList<Integer>();
for (int i : PathFinder.NEIGHBOURS8){ for (int i : PathFinder.NEIGHBOURS8){
if (Dungeon.level.passable[pos+i]){ if (Dungeon.level.passable[pos+i]
&& pos+i != Dungeon.level.entrance
&& pos+i != Dungeon.level.exit){
candidates.add(pos+i); candidates.add(pos+i);
} }
} }
@ -344,7 +346,9 @@ public class WandOfRegrowth extends Wand {
ArrayList<Integer> candidates = new ArrayList<Integer>(); ArrayList<Integer> candidates = new ArrayList<Integer>();
for (int i : PathFinder.NEIGHBOURS8){ for (int i : PathFinder.NEIGHBOURS8){
if (Dungeon.level.passable[pos+i]){ if (Dungeon.level.passable[pos+i]
&& pos+i != Dungeon.level.entrance
&& pos+i != Dungeon.level.exit){
candidates.add(pos+i); candidates.add(pos+i);
} }
} }

View File

@ -62,38 +62,55 @@ public class SecretChestChasmRoom extends SecretRoom {
Painter.fill(level, this, Terrain.WALL); Painter.fill(level, this, Terrain.WALL);
Painter.fill(level, this, 1, Terrain.CHASM); Painter.fill(level, this, 1, Terrain.CHASM);
Point p = new Point(left+1, top+1); int chests = 0;
Painter.set(level, p, Terrain.EMPTY_SP);
level.drop(new GoldenKey(Dungeon.depth), level.pointToCell(p));
p.x = right-1; Point p = new Point(left+3, top+3);
Painter.set(level, p, Terrain.EMPTY_SP);
level.drop(new GoldenKey(Dungeon.depth), level.pointToCell(p));
p.y = bottom-1;
Painter.set(level, p, Terrain.EMPTY_SP);
level.drop(new GoldenKey(Dungeon.depth), level.pointToCell(p));
p.x = left+1;
Painter.set(level, p, Terrain.EMPTY_SP);
level.drop(new GoldenKey(Dungeon.depth), level.pointToCell(p));
p = new Point(left+3, top+3);
Painter.set(level, p, Terrain.EMPTY_SP); Painter.set(level, p, Terrain.EMPTY_SP);
level.drop(Generator.random(), level.pointToCell(p)).type = Heap.Type.LOCKED_CHEST; level.drop(Generator.random(), level.pointToCell(p)).type = Heap.Type.LOCKED_CHEST;
if (level.heaps.get(level.pointToCell(p)) != null) chests++;
p.x = right-3; p.x = right-3;
Painter.set(level, p, Terrain.EMPTY_SP); Painter.set(level, p, Terrain.EMPTY_SP);
level.drop(Generator.random(), level.pointToCell(p)).type = Heap.Type.LOCKED_CHEST; level.drop(Generator.random(), level.pointToCell(p)).type = Heap.Type.LOCKED_CHEST;
if (level.heaps.get(level.pointToCell(p)) != null) chests++;
p.y = bottom-3; p.y = bottom-3;
Painter.set(level, p, Terrain.EMPTY_SP); Painter.set(level, p, Terrain.EMPTY_SP);
level.drop(Generator.random(), level.pointToCell(p)).type = Heap.Type.LOCKED_CHEST; level.drop(Generator.random(), level.pointToCell(p)).type = Heap.Type.LOCKED_CHEST;
if (level.heaps.get(level.pointToCell(p)) != null) chests++;
p.x = left+3; p.x = left+3;
Painter.set(level, p, Terrain.EMPTY_SP); Painter.set(level, p, Terrain.EMPTY_SP);
level.drop(Generator.random(), level.pointToCell(p)).type = Heap.Type.LOCKED_CHEST; level.drop(Generator.random(), level.pointToCell(p)).type = Heap.Type.LOCKED_CHEST;
if (level.heaps.get(level.pointToCell(p)) != null) chests++;
p = new Point(left+1, top+1);
Painter.set(level, p, Terrain.EMPTY_SP);
if (chests > 0) {
level.drop(new GoldenKey(Dungeon.depth), level.pointToCell(p));
chests--;
}
p.x = right-1;
Painter.set(level, p, Terrain.EMPTY_SP);
if (chests > 0) {
level.drop(new GoldenKey(Dungeon.depth), level.pointToCell(p));
chests--;
}
p.y = bottom-1;
Painter.set(level, p, Terrain.EMPTY_SP);
if (chests > 0) {
level.drop(new GoldenKey(Dungeon.depth), level.pointToCell(p));
chests--;
}
p.x = left+1;
Painter.set(level, p, Terrain.EMPTY_SP);
if (chests > 0) {
level.drop(new GoldenKey(Dungeon.depth), level.pointToCell(p));
chests--;
}
level.addItemToSpawn(new PotionOfLevitation()); level.addItemToSpawn(new PotionOfLevitation());