v2.4.0: removed cases of game directly using dungeon seed for levelgen
This commit is contained in:
@@ -102,6 +102,10 @@ public class Dungeon {
|
|||||||
STRENGTH_POTIONS,
|
STRENGTH_POTIONS,
|
||||||
UPGRADE_SCROLLS,
|
UPGRADE_SCROLLS,
|
||||||
ARCANE_STYLI,
|
ARCANE_STYLI,
|
||||||
|
ENCH_STONE,
|
||||||
|
INT_STONE,
|
||||||
|
TRINKET_CATA,
|
||||||
|
LAB_ROOM, //actually a room, but logic is the same
|
||||||
|
|
||||||
//Health potion sources
|
//Health potion sources
|
||||||
//enemies
|
//enemies
|
||||||
@@ -256,7 +260,7 @@ public class Dungeon {
|
|||||||
QuickSlotButton.reset();
|
QuickSlotButton.reset();
|
||||||
Toolbar.swappedQuickslots = false;
|
Toolbar.swappedQuickslots = false;
|
||||||
|
|
||||||
depth = 1;
|
depth = 15;
|
||||||
branch = 0;
|
branch = 0;
|
||||||
generatedLevels.clear();
|
generatedLevels.clear();
|
||||||
|
|
||||||
@@ -554,6 +558,46 @@ public class Dungeon {
|
|||||||
return Random.Int(5 - floorThisSet) < asLeftThisSet;
|
return Random.Int(5 - floorThisSet) < asLeftThisSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean enchStoneNeeded(){
|
||||||
|
//1 enchantment stone, spawns on chapter 2 or 3
|
||||||
|
if (!LimitedDrops.ENCH_STONE.dropped()){
|
||||||
|
int region = 1+depth/5;
|
||||||
|
if (region > 1){
|
||||||
|
int floorsVisited = depth - 5;
|
||||||
|
if (floorsVisited > 4) floorsVisited--; //skip floor 10
|
||||||
|
return Random.Int(9-floorsVisited) == 0; //1/8 chance each floor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean intStoneNeeded(){
|
||||||
|
//one stone on floors 1-3
|
||||||
|
return !LimitedDrops.INT_STONE.dropped() && Random.Int(4-depth) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean trinketCataNeeded(){
|
||||||
|
//one trinket catalyst on floors 1-3
|
||||||
|
return !LimitedDrops.TRINKET_CATA.dropped() && Random.Int(4-depth) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean labRoomNeeded(){
|
||||||
|
//one laboratory each floor set, in floor 3 or 4, 1/2 chance each floor
|
||||||
|
int region = 1+depth/5;
|
||||||
|
if (region > LimitedDrops.LAB_ROOM.count){
|
||||||
|
int floorThisRegion = depth%5;
|
||||||
|
if (floorThisRegion >= 4 || (floorThisRegion == 3 && Random.Int(2) == 0)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1/4
|
||||||
|
// 3/4 * 1/3 = 3/12 = 1/4
|
||||||
|
// 3/4 * 2/3 * 1/2 = 6/24 = 1/4
|
||||||
|
// 1/4
|
||||||
|
|
||||||
private static final String INIT_VER = "init_ver";
|
private static final String INIT_VER = "init_ver";
|
||||||
private static final String VERSION = "version";
|
private static final String VERSION = "version";
|
||||||
private static final String SEED = "seed";
|
private static final String SEED = "seed";
|
||||||
|
|||||||
+10
-10
@@ -70,16 +70,16 @@ public class TrapMechanism extends Trinket {
|
|||||||
}
|
}
|
||||||
if (mech.levelFeels.isEmpty()){
|
if (mech.levelFeels.isEmpty()){
|
||||||
Random.pushGenerator(Dungeon.seed+1);
|
Random.pushGenerator(Dungeon.seed+1);
|
||||||
mech.levelFeels.add(true);
|
mech.levelFeels.add(true);
|
||||||
mech.levelFeels.add(true);
|
mech.levelFeels.add(true);
|
||||||
mech.levelFeels.add(true);
|
mech.levelFeels.add(true);
|
||||||
mech.levelFeels.add(false);
|
mech.levelFeels.add(false);
|
||||||
mech.levelFeels.add(false);
|
mech.levelFeels.add(false);
|
||||||
mech.levelFeels.add(false);
|
mech.levelFeels.add(false);
|
||||||
for (int i = 0; i <= mech.shuffles; i++) {
|
for (int i = 0; i <= mech.shuffles; i++) {
|
||||||
Random.shuffle(mech.levelFeels);
|
Random.shuffle(mech.levelFeels);
|
||||||
}
|
}
|
||||||
mech.shuffles++;
|
mech.shuffles++;
|
||||||
Random.popGenerator();
|
Random.popGenerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -219,18 +219,16 @@ public abstract class Level implements Bundlable {
|
|||||||
Dungeon.LimitedDrops.ARCANE_STYLI.count++;
|
Dungeon.LimitedDrops.ARCANE_STYLI.count++;
|
||||||
addItemToSpawn( new Stylus() );
|
addItemToSpawn( new Stylus() );
|
||||||
}
|
}
|
||||||
//one scroll of transmutation is guaranteed to spawn somewhere on chapter 2-4
|
if ( Dungeon.enchStoneNeeded() ){
|
||||||
int enchChapter = (int)((Dungeon.seed / 10) % 3) + 1;
|
Dungeon.LimitedDrops.ENCH_STONE.drop();
|
||||||
if ( Dungeon.depth / 5 == enchChapter &&
|
|
||||||
Dungeon.seed % 4 + 1 == Dungeon.depth % 5){
|
|
||||||
addItemToSpawn( new StoneOfEnchantment() );
|
addItemToSpawn( new StoneOfEnchantment() );
|
||||||
}
|
}
|
||||||
|
if ( Dungeon.intStoneNeeded() ){
|
||||||
if ( Dungeon.depth == ((Dungeon.seed % 3) + 1)){
|
Dungeon.LimitedDrops.INT_STONE.drop();
|
||||||
addItemToSpawn( new StoneOfIntuition() );
|
addItemToSpawn( new StoneOfIntuition() );
|
||||||
}
|
}
|
||||||
|
if ( Dungeon.trinketCataNeeded() ){
|
||||||
if ( Dungeon.depth == (((Dungeon.seed+1) % 3) + 1)){
|
Dungeon.LimitedDrops.TRINKET_CATA.drop();
|
||||||
addItemToSpawn( new TrinketCatalyst());
|
addItemToSpawn( new TrinketCatalyst());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -131,8 +131,9 @@ public abstract class SpecialRoom extends Room {
|
|||||||
public static void initForFloor(){
|
public static void initForFloor(){
|
||||||
floorSpecials = (ArrayList<Class<?extends Room>>) runSpecials.clone();
|
floorSpecials = (ArrayList<Class<?extends Room>>) runSpecials.clone();
|
||||||
|
|
||||||
//laboratory rooms spawn at set intervals every chapter, on 3rd or 4th floor
|
//laboratory rooms spawn on floor 3 or 4 each chapter
|
||||||
if (Dungeon.depth%5 == (Dungeon.seed%2 + 3)){
|
if (Dungeon.labRoomNeeded()){
|
||||||
|
Dungeon.LimitedDrops.LAB_ROOM.count++;
|
||||||
floorSpecials.add(0, LaboratoryRoom.class);
|
floorSpecials.add(0, LaboratoryRoom.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user