v2.2.0: added some very basic levelgen code for fungus quest
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user