v0.2.3d: several tweaks to quest generation, should fix occasional crashing when using ankh on floors 1-9, and blacksmith rarely failing to spawn.
This commit is contained in:
parent
6457f0cf71
commit
58c3317b72
|
@ -303,7 +303,7 @@ public class Blacksmith extends NPC {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void spawn( Collection<Room> rooms ) {
|
public static boolean spawn( Collection<Room> rooms ) {
|
||||||
if (!spawned && Dungeon.depth > 11 && Random.Int( 15 - Dungeon.depth ) == 0) {
|
if (!spawned && Dungeon.depth > 11 && Random.Int( 15 - Dungeon.depth ) == 0) {
|
||||||
|
|
||||||
Room blacksmith = null;
|
Room blacksmith = null;
|
||||||
|
@ -321,6 +321,7 @@ public class Blacksmith extends NPC {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return spawned;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,7 +209,7 @@ public class Imp extends NPC {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void spawn( CityLevel level, Room room ) {
|
public static void spawn( CityLevel level ) {
|
||||||
if (!spawned && Dungeon.depth > 16 && Random.Int( 20 - Dungeon.depth ) == 0) {
|
if (!spawned && Dungeon.depth > 16 && Random.Int( 20 - Dungeon.depth ) == 0) {
|
||||||
|
|
||||||
Imp npc = new Imp();
|
Imp npc = new Imp();
|
||||||
|
|
|
@ -59,10 +59,13 @@ public class CavesLevel extends RegularLevel {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void assignRoomType() {
|
protected boolean build() {
|
||||||
super.assignRoomType();
|
if (!super.build()) return false;
|
||||||
|
|
||||||
Blacksmith.Quest.spawn( rooms );
|
if (!Blacksmith.Quest.spawn( rooms ) && Dungeon.depth == 14)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class CityLevel extends RegularLevel {
|
||||||
protected void createItems() {
|
protected void createItems() {
|
||||||
super.createItems();
|
super.createItems();
|
||||||
|
|
||||||
Imp.Quest.spawn( this, roomEntrance );
|
Imp.Quest.spawn( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -66,8 +66,8 @@ public class PrisonLevel extends RegularLevel {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createMobs() {
|
protected void createItems() {
|
||||||
super.createMobs();
|
super.createItems();
|
||||||
|
|
||||||
Wandmaker.Quest.spawn( this, roomEntrance );
|
Wandmaker.Quest.spawn( this, roomEntrance );
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,19 +102,14 @@ public class SewerLevel extends RegularLevel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void createMobs() {
|
|
||||||
super.createMobs();
|
|
||||||
|
|
||||||
Ghost.Quest.spawn( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createItems() {
|
protected void createItems() {
|
||||||
if (Dungeon.dewVial && Random.Int( 4 - Dungeon.depth ) == 0) {
|
if (Dungeon.dewVial && Random.Int( 4 - Dungeon.depth ) == 0) {
|
||||||
addItemToSpawn( new DewVial() );
|
addItemToSpawn( new DewVial() );
|
||||||
Dungeon.dewVial = false;
|
Dungeon.dewVial = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ghost.Quest.spawn( this );
|
||||||
|
|
||||||
super.createItems();
|
super.createItems();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user