Merging 1.7.5 Source: levels changes

This commit is contained in:
Evan Debenham
2015-02-02 11:10:04 -05:00
parent e931525669
commit 9dab291797
6 changed files with 35 additions and 38 deletions
@@ -47,6 +47,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.AlchemistsToolkit;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.ScrollHolder;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.SeedPouch;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
@@ -54,6 +56,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMight;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfWealth;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfWeaponUpgrade;
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm;
@@ -116,8 +119,6 @@ public abstract class Level implements Bundlable {
private static final String TXT_HIDDEN_PLATE_CLICKS = "A hidden pressure plate clicks!";
public static boolean resizingNeeded;
// This one can be different from resizingNeeded if the level
// was created in the older version of the game
public static int loadedMapSize;
public int[] map;
@@ -197,7 +198,7 @@ public abstract class Level implements Bundlable {
addItemToSpawn( new PotionOfStrength() );
Dungeon.limitedDrops.strengthPotions.count++;
}
if (Dungeon.soeNeeded()) {
if (Dungeon.souNeeded()) {
addItemToSpawn( new ScrollOfUpgrade() );
Dungeon.limitedDrops.upgradeScrolls.count++;
}
@@ -369,7 +370,8 @@ public abstract class Level implements Bundlable {
}
private void adjustMapSize() {
// For levels from older saves
// For levels saved before 1.6.3
// Seeing as shattered started on 1.7.1 this is never used, but the code may be resused in future.
if (map.length < LENGTH) {
resizingNeeded = true;
@@ -414,10 +416,13 @@ public abstract class Level implements Bundlable {
}
abstract protected boolean build();
abstract protected void decorate();
abstract protected void createMobs();
abstract protected void createItems();
public void addVisuals( Scene scene ) {
for (int i=0; i < LENGTH; i++) {
if (pit[i]) {
@@ -597,11 +602,13 @@ public abstract class Level implements Bundlable {
public Heap drop( Item item, int cell ) {
//This messy if statement deals will items which should not drop in challenges primarily.
if ((Dungeon.isChallenged( Challenges.NO_FOOD ) && (item instanceof Food || item instanceof BlandfruitBush.Seed)) ||
(Dungeon.isChallenged( Challenges.NO_ARMOR ) && item instanceof Armor) ||
(Dungeon.isChallenged( Challenges.NO_HEALING ) && item instanceof PotionOfHealing) ||
(Dungeon.isChallenged( Challenges.NO_HERBALISM ) && (item instanceof Plant.Seed || item instanceof Dewdrop)) ||
item == null) {
(Dungeon.isChallenged( Challenges.NO_HERBALISM ) && (item instanceof Plant.Seed || item instanceof Dewdrop || item instanceof SeedPouch)) ||
(Dungeon.isChallenged( Challenges.NO_SCROLLS ) && ((item instanceof Scroll && !(item instanceof ScrollOfUpgrade)) || item instanceof ScrollHolder)) ||
item == null) {
Heap heap = new Heap();
GameScene.add( heap );