v1.2.2: sacrifice rooms now require a bit less exp and are easier to use
This commit is contained in:
parent
6bee83e8c1
commit
db28e0695b
|
@ -68,20 +68,23 @@ public class SacrificialFire extends Blob {
|
||||||
off[cell] = cur[cell];
|
off[cell] = cur[cell];
|
||||||
volume += off[cell];
|
volume += off[cell];
|
||||||
|
|
||||||
Char ch = Actor.findChar( cell );
|
if (off[cell] > 0){
|
||||||
if (ch != null && off[cell] > 0){
|
for (int k : PathFinder.NEIGHBOURS9){
|
||||||
if (Dungeon.level.heroFOV[cell] && ch.buff( Marked.class ) == null) {
|
Char ch = Actor.findChar( cell+k );
|
||||||
CellEmitter.get(cell).burst( SacrificialParticle.FACTORY, 5 );
|
if (ch != null){
|
||||||
|
if (Dungeon.level.heroFOV[cell+k] && ch.buff( Marked.class ) == null) {
|
||||||
|
CellEmitter.get(cell+k).burst( SacrificialParticle.FACTORY, 5 );
|
||||||
|
}
|
||||||
|
Buff.prolong( ch, Marked.class, Marked.DURATION );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Buff.prolong( ch, Marked.class, Marked.DURATION );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (off[cell] > 0
|
if (Dungeon.level.heroFOV[cell]
|
||||||
&& Dungeon.level.heroFOV[cell]
|
&& Dungeon.level.mobCount() == 0
|
||||||
&& Dungeon.level.mobCount() == 0
|
&& bonusSpawns > 0) {
|
||||||
&& bonusSpawns > 0){
|
if (Dungeon.level.spawnMob(4)) {
|
||||||
if (Dungeon.level.spawnMob(4)) {
|
bonusSpawns--;
|
||||||
bonusSpawns--;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +92,7 @@ public class SacrificialFire extends Blob {
|
||||||
}
|
}
|
||||||
|
|
||||||
//a bit brittle, assumes only one tile of sacrificial fire can exist per floor
|
//a bit brittle, assumes only one tile of sacrificial fire can exist per floor
|
||||||
int max = 5 + Dungeon.depth * 5;
|
int max = 6 + Dungeon.depth * 4;
|
||||||
curEmitter.pour( SacrificialParticle.FACTORY, 0.01f + ((volume / (float)max) * 0.09f) );
|
curEmitter.pour( SacrificialParticle.FACTORY, 0.01f + ((volume / (float)max) * 0.09f) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +102,7 @@ public class SacrificialFire extends Blob {
|
||||||
curEmitter = emitter;
|
curEmitter = emitter;
|
||||||
|
|
||||||
//a bit brittle, assumes only one tile of sacrificial fire can exist per floor
|
//a bit brittle, assumes only one tile of sacrificial fire can exist per floor
|
||||||
int max = 5 + Dungeon.depth * 5;
|
int max = 6 + Dungeon.depth * 4;
|
||||||
curEmitter.pour( SacrificialParticle.FACTORY, 0.01f + ((volume / (float)max) * 0.09f) );
|
curEmitter.pour( SacrificialParticle.FACTORY, 0.01f + ((volume / (float)max) * 0.09f) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,8 +128,15 @@ public class SacrificialFire extends Blob {
|
||||||
public static void sacrifice( Char ch ) {
|
public static void sacrifice( Char ch ) {
|
||||||
|
|
||||||
SacrificialFire fire = (SacrificialFire)Dungeon.level.blobs.get( SacrificialFire.class );
|
SacrificialFire fire = (SacrificialFire)Dungeon.level.blobs.get( SacrificialFire.class );
|
||||||
|
int firePos = -1;
|
||||||
|
for (int i : PathFinder.NEIGHBOURS9){
|
||||||
|
if (fire != null && fire.cur[ch.pos+i] > 0){
|
||||||
|
firePos = ch.pos+i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (fire != null && fire.cur[ch.pos] > 0) {
|
if (firePos != -1) {
|
||||||
|
|
||||||
int exp = 0;
|
int exp = 0;
|
||||||
if (ch instanceof Mob) {
|
if (ch instanceof Mob) {
|
||||||
|
@ -147,25 +157,25 @@ public class SacrificialFire extends Blob {
|
||||||
|
|
||||||
if (exp > 0) {
|
if (exp > 0) {
|
||||||
|
|
||||||
int volume = fire.cur[ch.pos] - exp;
|
int volume = fire.cur[firePos] - exp;
|
||||||
if (volume > 0) {
|
if (volume > 0) {
|
||||||
fire.cur[ch.pos] -= exp;
|
fire.cur[firePos] -= exp;
|
||||||
fire.volume -= exp;
|
fire.volume -= exp;
|
||||||
fire.bonusSpawns++;
|
fire.bonusSpawns++;
|
||||||
CellEmitter.get(ch.pos).burst( SacrificialParticle.FACTORY, 20 );
|
CellEmitter.get(firePos).burst( SacrificialParticle.FACTORY, 20 );
|
||||||
Sample.INSTANCE.play(Assets.Sounds.BURNING );
|
Sample.INSTANCE.play(Assets.Sounds.BURNING );
|
||||||
GLog.w( Messages.get(SacrificialFire.class, "worthy"));
|
GLog.w( Messages.get(SacrificialFire.class, "worthy"));
|
||||||
} else {
|
} else {
|
||||||
fire.clear(ch.pos);
|
fire.clear(firePos);
|
||||||
|
|
||||||
for (int i : PathFinder.NEIGHBOURS9){
|
for (int i : PathFinder.NEIGHBOURS9){
|
||||||
CellEmitter.get(ch.pos+i).burst( SacrificialParticle.FACTORY, 20 );
|
CellEmitter.get(firePos+i).burst( SacrificialParticle.FACTORY, 20 );
|
||||||
}
|
}
|
||||||
Sample.INSTANCE.play(Assets.Sounds.BURNING );
|
Sample.INSTANCE.play(Assets.Sounds.BURNING );
|
||||||
Sample.INSTANCE.play(Assets.Sounds.BURNING );
|
Sample.INSTANCE.play(Assets.Sounds.BURNING );
|
||||||
Sample.INSTANCE.play(Assets.Sounds.BURNING );
|
Sample.INSTANCE.play(Assets.Sounds.BURNING );
|
||||||
GLog.w( Messages.get(SacrificialFire.class, "reward"));
|
GLog.w( Messages.get(SacrificialFire.class, "reward"));
|
||||||
Dungeon.level.drop( SacrificeRoom.prize( Dungeon.level ), ch.pos ).sprite.drop();
|
Dungeon.level.drop( SacrificeRoom.prize( Dungeon.level ), firePos ).sprite.drop();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class SacrificeRoom extends SpecialRoom {
|
||||||
Painter.fill( level, c.x - 1, c.y - 1, 3, 3, Terrain.EMBERS );
|
Painter.fill( level, c.x - 1, c.y - 1, 3, 3, Terrain.EMBERS );
|
||||||
Painter.set( level, c, Terrain.PEDESTAL );
|
Painter.set( level, c, Terrain.PEDESTAL );
|
||||||
|
|
||||||
Blob.seed( level.pointToCell(c), 5 + Dungeon.depth * 5, SacrificialFire.class, level );
|
Blob.seed( level.pointToCell(c), 6 + Dungeon.depth * 4, SacrificialFire.class, level );
|
||||||
|
|
||||||
door.set( Door.Type.EMPTY );
|
door.set( Door.Type.EMPTY );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user