v2.2.0: added some very basic levelgen code for fungus quest

This commit is contained in:
Evan Debenham
2023-10-09 11:43:41 -04:00
parent 876811703f
commit 8a07131c53
5 changed files with 31 additions and 3 deletions

View File

@@ -374,7 +374,7 @@ public class Blacksmith extends NPC {
//currently only the crystal quest is ready to play
//we still roll for quest type however, to ensure seed consistency
type = 3+Random.Int(1);
type = 1+Random.Int(1);
alternative = false;
given = false;

View File

@@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Bat;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.CrystalWisp;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GnollGuard;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Spinner;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
@@ -131,8 +132,8 @@ public class MiningLevel extends CavesLevel {
protected Painter painter() {
return new MiningLevelPainter()
.setGold(Random.NormalIntRange(42, 46))
.setWater(0.35f, 6)
.setGrass(0.10f, 3);
.setWater(Blacksmith.Quest.Type() == Blacksmith.Quest.FUNGI ? 0.1f : 0.35f, 6)
.setGrass(Blacksmith.Quest.Type() == Blacksmith.Quest.FUNGI ? 0.65f : 0.10f, 3);
}
@Override
@@ -142,6 +143,8 @@ public class MiningLevel extends CavesLevel {
return new Bat();
case Blacksmith.Quest.CRYSTAL:
return new CrystalWisp();
case Blacksmith.Quest.FUNGI:
return new Spinner();
case Blacksmith.Quest.GNOLL:
return new GnollGuard();
}

View File

@@ -67,6 +67,16 @@ public class MineGiantRoom extends CaveRoom {
level.mobs.add(m);
Painter.set(level, p, Terrain.EMPTY);
} else if (Blacksmith.Quest.Type() == Blacksmith.Quest.FUNGI){
Painter.fillEllipse(level, this, 3, Terrain.EMPTY);
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 if (Blacksmith.Quest.Type() == Blacksmith.Quest.GNOLL){
Painter.fillEllipse(level, this, 3, Terrain.EMPTY);

View File

@@ -92,6 +92,16 @@ public class MineLargeRoom extends CaveRoom {
level.mobs.add(m);
Painter.set(level, p, Terrain.EMPTY);
} else if (Blacksmith.Quest.Type() == Blacksmith.Quest.FUNGI){
Painter.fillEllipse(level, this, 3, Terrain.EMPTY);
for (int i = 0; i < width() * height() / 4; i++) {
Point r = random(1);
if (level.map[level.pointToCell(r)] != Terrain.WALL) {
Painter.set(level, r, Terrain.HIGH_GRASS);
}
}
} else if (Blacksmith.Quest.Type() == Blacksmith.Quest.GNOLL){
Painter.fillEllipse(level, this, 3, Terrain.EMPTY);

View File

@@ -46,6 +46,11 @@ public class MineSecretRoom extends SecretRoom {
if (Blacksmith.Quest.Type() == Blacksmith.Quest.CRYSTAL) {
Painter.fill(level, this, 1, Terrain.MINE_CRYSTAL);
} else if (Blacksmith.Quest.Type() == Blacksmith.Quest.FUNGI) {
Painter.fill(level, this, 1, Terrain.HIGH_GRASS);
//random plant?
} else if (Blacksmith.Quest.Type() == Blacksmith.Quest.GNOLL) {
Painter.fill( level, this, 1, Terrain.EMPTY_SP );
level.drop(new DarkGold().quantity(Random.NormalIntRange(3, 5)), level.pointToCell(center())).type = Heap.Type.CHEST;