From d8d8c8484f9df5e3bf29dc6f6326e5bc80a80b21 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 12 Dec 2023 13:00:55 -0500 Subject: [PATCH] v2.3.0: made a few improvements to fungi quest layouts and terrain logic --- .../shatteredpixeldungeon/levels/Level.java | 25 +++++++++++-------- .../levels/features/HighGrass.java | 9 +++++++ .../levels/rooms/quest/MineGiantRoom.java | 13 +++++----- .../levels/rooms/quest/MineLargeRoom.java | 19 ++++++++++++-- 4 files changed, 47 insertions(+), 19 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index 1e1b06091..11980a239 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -52,6 +52,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GnollGeomancer; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Piranha; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.YogFist; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Sheep; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlowParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.WindParticle; @@ -1220,20 +1221,24 @@ public abstract class Level implements Bundlable { if (modifiableBlocking == null || modifiableBlocking.length != Dungeon.level.losBlocking.length){ modifiableBlocking = new boolean[Dungeon.level.losBlocking.length]; } - - if ((c instanceof Hero && ((Hero) c).subClass == HeroSubClass.WARDEN) - || c instanceof YogFist.SoiledFist || c instanceof GnollGeomancer) { - if (blocking == null) { - System.arraycopy(Dungeon.level.losBlocking, 0, modifiableBlocking, 0, modifiableBlocking.length); - blocking = modifiableBlocking; - } - for (int i = 0; i < blocking.length; i++){ - if (blocking[i] && (Dungeon.level.map[i] == Terrain.HIGH_GRASS || Dungeon.level.map[i] == Terrain.FURROWED_GRASS)){ - blocking[i] = false; + + //grass is see-through by some specific entities, but not during the fungi quest + if (!(Dungeon.level instanceof MiningLevel) || Blacksmith.Quest.Type() != Blacksmith.Quest.FUNGI){ + if ((c instanceof Hero && ((Hero) c).subClass == HeroSubClass.WARDEN) + || c instanceof YogFist.SoiledFist || c instanceof GnollGeomancer) { + if (blocking == null) { + System.arraycopy(Dungeon.level.losBlocking, 0, modifiableBlocking, 0, modifiableBlocking.length); + blocking = modifiableBlocking; + } + for (int i = 0; i < blocking.length; i++) { + if (blocking[i] && (Dungeon.level.map[i] == Terrain.HIGH_GRASS || Dungeon.level.map[i] == Terrain.FURROWED_GRASS)) { + blocking[i] = false; + } } } } + //allies and specific enemies can see through shrouding fog if ((c.alignment != Char.Alignment.ALLY && !(c instanceof GnollGeomancer)) && Dungeon.level.blobs.containsKey(SmokeScreen.class) && Dungeon.level.blobs.get(SmokeScreen.class).volume > 0) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java index 62e85882e..15d9e0cad 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java @@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.ArmoredStatue; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle; import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop; @@ -39,6 +40,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature; import com.shatteredpixel.shatteredpixeldungeon.items.food.Berry; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; +import com.shatteredpixel.shatteredpixeldungeon.levels.MiningLevel; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.watabou.utils.Random; @@ -110,6 +112,13 @@ public class HighGrass { } } + + //grass gives 1/3 the normal amount of loot in fungi level + if (Dungeon.level instanceof MiningLevel + && Blacksmith.Quest.Type() == Blacksmith.Quest.FUNGI + && Random.Int(3) != 0){ + naturalismLevel = 0; + } if (naturalismLevel >= 0) { // Seed, scales from 1/25 to 1/9 diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/quest/MineGiantRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/quest/MineGiantRoom.java index 0c19a6204..735048572 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/quest/MineGiantRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/quest/MineGiantRoom.java @@ -127,14 +127,13 @@ public class MineGiantRoom extends CaveRoom { level.mobs.add(g); } else if (Blacksmith.Quest.Type() == Blacksmith.Quest.FUNGI){ - Painter.fillEllipse(level, this, 3, Terrain.EMPTY); + Painter.fillEllipse(level, this, 2, Terrain.HIGH_GRASS); + + Painter.fillEllipse(level, this, 3, Terrain.GRASS); + + Painter.fillEllipse(level, this, 4, Terrain.HIGH_GRASS); + Painter.fillEllipse(level, this, 5, Terrain.GRASS); - for (int i = 0; i < width()*height()/2; i ++){ - Point r = random(1); - if (level.map[level.pointToCell(r)] != Terrain.WALL) { - Painter.set(level, r, Terrain.HIGH_GRASS); - } - } } else { Painter.fillEllipse(level, this, 3, Terrain.EMPTY); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/quest/MineLargeRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/quest/MineLargeRoom.java index 42602cf1a..4cc96866a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/quest/MineLargeRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/quest/MineLargeRoom.java @@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.CrystalGuardian; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GnollGuard; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GnollSapper; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.RotLasher; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; @@ -180,15 +181,29 @@ public class MineLargeRoom extends CaveRoom { } } } else if (Blacksmith.Quest.Type() == Blacksmith.Quest.FUNGI){ - Painter.fillEllipse(level, this, 3, Terrain.EMPTY); - for (int i = 0; i < width() * height() / 4; i++) { + for (Point p : getPoints()){ + int cell = level.pointToCell(p); + if (level.map[cell] == Terrain.EMPTY){ + level.map[cell] = Terrain.HIGH_GRASS; + } + } + + Painter.fillEllipse(level, this, 3, Terrain.GRASS); + + for (int i = 0; i < width() * height() / 6; i++) { Point r = random(1); if (level.map[level.pointToCell(r)] != Terrain.WALL) { Painter.set(level, r, Terrain.HIGH_GRASS); } } + Point p = center(); + RotLasher m = new RotLasher(); //placeholder enemy + m.pos = level.pointToCell(p); + level.mobs.add(m); + Painter.set(level, p, Terrain.GRASS); + } else { Painter.fillEllipse(level, this, 3, Terrain.EMPTY); }