v0.7.0: adjusted the spawn mechanics of alchemy rooms, and spawnrates of some consumables

This commit is contained in:
Evan Debenham 2018-05-28 18:04:52 -04:00
parent b6cfc6db56
commit 9fc8ec2f0d
5 changed files with 38 additions and 38 deletions

View File

@ -54,7 +54,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfInvisibility; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfInvisibility;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLevitation; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLevitation;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMight;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMindVision; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMindVision;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfParalyticGas; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfParalyticGas;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfPurity; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfPurity;
@ -76,7 +75,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfLullaby; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfLullaby;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMirrorImage; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMirrorImage;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfPsionicBlast; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfPsionicBlast;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRage; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRage;
@ -218,34 +216,35 @@ public class Generator {
GOLD.probs = new float[]{ 1 }; GOLD.probs = new float[]{ 1 };
SCROLL.classes = new Class<?>[]{ SCROLL.classes = new Class<?>[]{
ScrollOfUpgrade.class, //3 drop every chapter, see Dungeon.souNeeded()
ScrollOfIdentify.class, ScrollOfIdentify.class,
ScrollOfTeleportation.class,
ScrollOfRemoveCurse.class, ScrollOfRemoveCurse.class,
ScrollOfUpgrade.class,
ScrollOfRecharging.class,
ScrollOfMagicMapping.class, ScrollOfMagicMapping.class,
ScrollOfRage.class, ScrollOfMirrorImage.class,
ScrollOfTerror.class, ScrollOfRecharging.class,
ScrollOfLullaby.class, ScrollOfLullaby.class,
ScrollOfMagicalInfusion.class,
ScrollOfPsionicBlast.class, ScrollOfPsionicBlast.class,
ScrollOfMirrorImage.class }; ScrollOfRage.class,
SCROLL.probs = new float[]{ 30, 10, 20, 0, 15, 15, 12, 8, 8, 0, 4, 10 }; ScrollOfTeleportation.class,
ScrollOfTerror.class,
/*ScrollOfTransmutation.class*/ //1 additional scroll guaranteed on floors 6-19
};
SCROLL.probs = new float[]{ 0, 6, 4, 3, 3, 3, 2, 2, 2, 2, 2/*, 1*/ };
POTION.classes = new Class<?>[]{ POTION.classes = new Class<?>[]{
PotionOfStrength.class, //2 drop every chapter, see Dungeon.posNeeded()
PotionOfHealing.class, PotionOfHealing.class,
PotionOfExperience.class,
PotionOfToxicGas.class,
PotionOfParalyticGas.class,
PotionOfLiquidFlame.class,
PotionOfLevitation.class,
PotionOfStrength.class,
PotionOfMindVision.class, PotionOfMindVision.class,
PotionOfPurity.class, PotionOfFrost.class,
PotionOfLiquidFlame.class,
PotionOfToxicGas.class,
/* PotionOfHaste.class */
PotionOfInvisibility.class, PotionOfInvisibility.class,
PotionOfMight.class, PotionOfLevitation.class,
PotionOfFrost.class }; PotionOfParalyticGas.class,
POTION.probs = new float[]{ 45, 4, 15, 10, 15, 10, 0, 20, 12, 10, 0, 10 }; PotionOfPurity.class,
PotionOfExperience.class};
POTION.probs = new float[]{ 0, 6, 4, 3, 3, 3, /*2,*/ 2, 2, 2, 2, 1 };
//TODO: add last ones when implemented //TODO: add last ones when implemented
WAND.classes = new Class<?>[]{ WAND.classes = new Class<?>[]{

View File

@ -42,9 +42,9 @@ import com.watabou.utils.Random;
import java.util.HashMap; import java.util.HashMap;
//TODO specific implementation
public class SecretLaboratoryRoom extends SecretRoom { public class SecretLaboratoryRoom extends SecretRoom {
//TODO adjust based on changes to generator chances
private static HashMap<Class<? extends Potion>, Float> potionChances = new HashMap<>(); private static HashMap<Class<? extends Potion>, Float> potionChances = new HashMap<>();
static{ static{
potionChances.put(PotionOfHealing.class, 2f); potionChances.put(PotionOfHealing.class, 2f);
@ -70,7 +70,7 @@ public class SecretLaboratoryRoom extends SecretRoom {
Painter.set( level, pot, Terrain.ALCHEMY ); Painter.set( level, pot, Terrain.ALCHEMY );
Alchemy alchemy = new Alchemy(); Alchemy alchemy = new Alchemy();
alchemy.seed( level, pot.x + level.width() * pot.y, Random.IntRange(30, 60) ); alchemy.seed( level, pot.x + level.width() * pot.y, Random.IntRange(20, 30) );
level.blobs.put( Alchemy.class, alchemy ); level.blobs.put( Alchemy.class, alchemy );
int n = Random.IntRange( 2, 3 ); int n = Random.IntRange( 2, 3 );

View File

@ -40,7 +40,6 @@ import com.watabou.utils.Random;
import java.util.HashMap; import java.util.HashMap;
//TODO specific implementation
public class SecretLibraryRoom extends SecretRoom { public class SecretLibraryRoom extends SecretRoom {
@Override @Override
@ -53,6 +52,7 @@ public class SecretLibraryRoom extends SecretRoom {
return Math.max(7, super.minHeight()); return Math.max(7, super.minHeight());
} }
//TODO adjust based on changes to generator chances
private static HashMap<Class<? extends Scroll>, Float> scrollChances = new HashMap<>(); private static HashMap<Class<? extends Scroll>, Float> scrollChances = new HashMap<>();
static{ static{
scrollChances.put( ScrollOfIdentify.class, 1f ); scrollChances.put( ScrollOfIdentify.class, 1f );

View File

@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Alchemy; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Alchemy;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
@ -55,10 +54,11 @@ public class LaboratoryRoom extends SpecialRoom {
Painter.set( level, pot, Terrain.ALCHEMY ); Painter.set( level, pot, Terrain.ALCHEMY );
Alchemy alchemy = new Alchemy(); Alchemy alchemy = new Alchemy();
alchemy.seed( level, pot.x + level.width() * pot.y, Random.IntRange(25, 50) ); int chapter = 1 + Dungeon.depth/5;
alchemy.seed( level, pot.x + level.width() * pot.y, chapter*10 + Random.IntRange(0, 20) );
level.blobs.put( Alchemy.class, alchemy ); level.blobs.put( Alchemy.class, alchemy );
int n = Random.IntRange( 2, 3 ); int n = Random.IntRange( 1, 2 );
for (int i=0; i < n; i++) { for (int i=0; i < n; i++) {
int pos; int pos;
do { do {
@ -69,8 +69,7 @@ public class LaboratoryRoom extends SpecialRoom {
level.drop( prize( level ), pos ); level.drop( prize( level ), pos );
} }
entrance.set( Door.Type.LOCKED ); entrance.set( Door.Type.REGULAR );
level.addItemToSpawn( new IronKey( Dungeon.depth ) );
} }
private static Item prize( Level level ) { private static Item prize( Level level ) {

View File

@ -30,7 +30,6 @@ import com.watabou.utils.Random;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
public class SpecialRoom extends Room { public class SpecialRoom extends Room {
@ -61,7 +60,7 @@ public class SpecialRoom extends Room {
private static final ArrayList<Class<? extends SpecialRoom>> ALL_SPEC = new ArrayList<>( Arrays.asList( private static final ArrayList<Class<? extends SpecialRoom>> ALL_SPEC = new ArrayList<>( Arrays.asList(
WeakFloorRoom.class, MagicWellRoom.class, CryptRoom.class, PoolRoom.class, GardenRoom.class, LibraryRoom.class, ArmoryRoom.class, WeakFloorRoom.class, MagicWellRoom.class, CryptRoom.class, PoolRoom.class, GardenRoom.class, LibraryRoom.class, ArmoryRoom.class,
TreasuryRoom.class, TrapsRoom.class, StorageRoom.class, StatueRoom.class, LaboratoryRoom.class, VaultRoom.class TreasuryRoom.class, TrapsRoom.class, StorageRoom.class, StatueRoom.class, VaultRoom.class
) ); ) );
public static ArrayList<Class<? extends Room>> runSpecials = new ArrayList<>(); public static ArrayList<Class<? extends Room>> runSpecials = new ArrayList<>();
@ -79,18 +78,17 @@ public class SpecialRoom extends Room {
} }
public static void initForFloor(){ public static void initForFloor(){
//laboratory rooms are more common
int labIdx = runSpecials.indexOf(LaboratoryRoom.class);
if (labIdx > 0) {
Collections.swap(runSpecials, labIdx-1, labIdx);
}
floorSpecials = (ArrayList<Class<?extends Room>>) runSpecials.clone(); floorSpecials = (ArrayList<Class<?extends Room>>) runSpecials.clone();
//laboratory rooms spawn at set intervals every chapter
if (Dungeon.depth%5 == (Dungeon.seed%3 + 2)){
floorSpecials.add(0, LaboratoryRoom.class);
}
} }
private static void useType( Class<?extends Room> type ) { private static void useType( Class<?extends Room> type ) {
if (runSpecials.remove( type )) {
floorSpecials.remove( type ); floorSpecials.remove( type );
if (runSpecials.remove( type )) {
runSpecials.add( type ); runSpecials.add( type );
} }
} }
@ -109,7 +107,6 @@ public class SpecialRoom extends Room {
floorSpecials.remove( ArmoryRoom.class ); floorSpecials.remove( ArmoryRoom.class );
floorSpecials.remove( CryptRoom.class ); floorSpecials.remove( CryptRoom.class );
floorSpecials.remove( LaboratoryRoom.class );
floorSpecials.remove( LibraryRoom.class ); floorSpecials.remove( LibraryRoom.class );
floorSpecials.remove( StatueRoom.class ); floorSpecials.remove( StatueRoom.class );
floorSpecials.remove( TreasuryRoom.class ); floorSpecials.remove( TreasuryRoom.class );
@ -126,6 +123,11 @@ public class SpecialRoom extends Room {
guaranteedWellDepth = Integer.MAX_VALUE; guaranteedWellDepth = Integer.MAX_VALUE;
return r; return r;
} else if (floorSpecials.contains(LaboratoryRoom.class)) {
useType(LaboratoryRoom.class);
return new LaboratoryRoom();
} else { } else {
if (Dungeon.bossLevel(Dungeon.depth + 1)){ if (Dungeon.bossLevel(Dungeon.depth + 1)){