From db28e0695b1a7b22f9b778db8fcb60333679d52a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 6 Apr 2022 16:58:24 -0400 Subject: [PATCH] v1.2.2: sacrifice rooms now require a bit less exp and are easier to use --- .../actors/blobs/SacrificialFire.java | 52 +++++++++++-------- .../levels/rooms/special/SacrificeRoom.java | 2 +- 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/SacrificialFire.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/SacrificialFire.java index 0e6ea8667..14b461796 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/SacrificialFire.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/SacrificialFire.java @@ -68,20 +68,23 @@ public class SacrificialFire extends Blob { off[cell] = cur[cell]; volume += off[cell]; - Char ch = Actor.findChar( cell ); - if (ch != null && off[cell] > 0){ - if (Dungeon.level.heroFOV[cell] && ch.buff( Marked.class ) == null) { - CellEmitter.get(cell).burst( SacrificialParticle.FACTORY, 5 ); + if (off[cell] > 0){ + for (int k : PathFinder.NEIGHBOURS9){ + Char ch = Actor.findChar( cell+k ); + 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 - && Dungeon.level.heroFOV[cell] - && Dungeon.level.mobCount() == 0 - && bonusSpawns > 0){ - if (Dungeon.level.spawnMob(4)) { - bonusSpawns--; + if (Dungeon.level.heroFOV[cell] + && Dungeon.level.mobCount() == 0 + && bonusSpawns > 0) { + if (Dungeon.level.spawnMob(4)) { + bonusSpawns--; + } } } } @@ -89,7 +92,7 @@ public class SacrificialFire extends Blob { } //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) ); } @@ -99,7 +102,7 @@ public class SacrificialFire extends Blob { curEmitter = emitter; //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) ); } @@ -125,8 +128,15 @@ public class SacrificialFire extends Blob { public static void sacrifice( Char ch ) { 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; if (ch instanceof Mob) { @@ -147,25 +157,25 @@ public class SacrificialFire extends Blob { if (exp > 0) { - int volume = fire.cur[ch.pos] - exp; + int volume = fire.cur[firePos] - exp; if (volume > 0) { - fire.cur[ch.pos] -= exp; + fire.cur[firePos] -= exp; fire.volume -= exp; fire.bonusSpawns++; - CellEmitter.get(ch.pos).burst( SacrificialParticle.FACTORY, 20 ); + CellEmitter.get(firePos).burst( SacrificialParticle.FACTORY, 20 ); Sample.INSTANCE.play(Assets.Sounds.BURNING ); GLog.w( Messages.get(SacrificialFire.class, "worthy")); } else { - fire.clear(ch.pos); + fire.clear(firePos); 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 ); 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 { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/SacrificeRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/SacrificeRoom.java index de37ded35..aa7e89216 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/SacrificeRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/SacrificeRoom.java @@ -58,7 +58,7 @@ public class SacrificeRoom extends SpecialRoom { Painter.fill( level, c.x - 1, c.y - 1, 3, 3, Terrain.EMBERS ); 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 ); }