From 1e62a6bd889a29bedb0528803a3d5254a8116084 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 20 Oct 2014 22:55:37 -0400 Subject: [PATCH] Merging Source v1.7.2: level changes --- .../levels/CavesBossLevel.java | 2 +- .../levels/CityBossLevel.java | 2 +- .../levels/HallsBossLevel.java | 2 - .../levels/HallsLevel.java | 2 - .../levels/LastLevel.java | 2 - .../shatteredpixeldungeon/levels/Level.java | 24 +++++++++--- .../levels/PrisonBossLevel.java | 2 +- .../shatteredpixeldungeon/levels/Terrain.java | 2 +- .../levels/features/HighGrass.java | 37 ++++++++++--------- .../levels/painters/ShopPainter.java | 4 ++ .../levels/traps/PoisonTrap.java | 2 +- .../levels/traps/SummoningTrap.java | 2 +- 12 files changed, 49 insertions(+), 34 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java index ec962d818..2d6f1ead0 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java @@ -221,7 +221,7 @@ public class CavesBossLevel extends Level { locked = true; Mob boss = Bestiary.mob( Dungeon.depth ); - boss.state = Mob.State.HUNTING; + boss.state = boss.HUNTING; do { boss.pos = Random.Int( LENGTH ); } while ( diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java index 254118971..77a435cb1 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java @@ -179,7 +179,7 @@ public class CityBossLevel extends Level { locked = true; Mob boss = Bestiary.mob( Dungeon.depth ); - boss.state = Mob.State.HUNTING; + boss.state = boss.HUNTING; do { boss.pos = Random.Int( LENGTH ); } while ( diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java index 8075a9a7e..fd067170e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java @@ -238,8 +238,6 @@ public class HallsBossLevel extends Level { switch (tile) { case Terrain.WATER: return "It looks like lava, but it's cold and probably safe to touch."; - case Terrain.EMPTY_DECO: - return "Candles on the floor are probably remains of some ritual that took place here."; case Terrain.STATUE: case Terrain.STATUE_SP: return "The pillar is made of real humanoid skulls. Awesome."; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/HallsLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/HallsLevel.java index bde545dd7..96a70482f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/HallsLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/HallsLevel.java @@ -132,8 +132,6 @@ public class HallsLevel extends RegularLevel { switch (tile) { case Terrain.WATER: return "It looks like lava, but it's cold and probably safe to touch."; - case Terrain.EMPTY_DECO: - return "Candles on the floor are probably remains of some ritual that took place here."; case Terrain.STATUE: case Terrain.STATUE_SP: return "The pillar is made of real humanoid skulls. Awesome."; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java index b517715c2..c368dec26 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java @@ -114,8 +114,6 @@ public class LastLevel extends Level { switch (tile) { case Terrain.WATER: return "It looks like lava, but it's cold and probably safe to touch."; - case Terrain.EMPTY_DECO: - return "Candles on the floor are probably remains of some ritual that took place here."; case Terrain.STATUE: case Terrain.STATUE_SP: return "The pillar is made of real humanoid skulls. Awesome."; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index f6d1f74e0..6963eb216 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.plants.BlandfruitBush; import com.watabou.noosa.Scene; import com.watabou.noosa.audio.Sample; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Challenges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; @@ -50,9 +51,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlowParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.WindParticle; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; +import com.shatteredpixel.shatteredpixeldungeon.items.Gold; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Stylus; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; +import com.shatteredpixel.shatteredpixeldungeon.items.food.Food; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; @@ -112,8 +117,8 @@ public abstract class Level implements Bundlable { public int[] map; public boolean[] visited; public boolean[] mapped; - - public int viewDistance = 8; + + public int viewDistance = Dungeon.isChallenged( Challenges.DARKNESS ) ? 3: 8; public static boolean[] fieldOfView = new boolean[LENGTH]; @@ -397,7 +402,7 @@ public abstract class Level implements Bundlable { if (mobs.size() < nMobs()) { Mob mob = Bestiary.mutable( Dungeon.depth ); - mob.state = Mob.State.WANDERING; + mob.state = mob.WANDERING; mob.pos = randomRespawnCell(); if (Dungeon.hero.isAlive() && mob.pos != -1) { GameScene.add( mob ); @@ -541,7 +546,17 @@ public abstract class Level implements Bundlable { } public Heap drop( Item item, int cell ) { - + + if (Dungeon.isChallenged( Challenges.NO_FOOD ) && item instanceof Food) { + item = new Gold( item.price() ); + } else + if (Dungeon.isChallenged( Challenges.NO_ARMOR ) && item instanceof Armor) { + item = new Gold( item.price() ); + } else + if (Dungeon.isChallenged( Challenges.NO_HEALING ) && item instanceof PotionOfHealing) { + item = new Gold( item.price() ); + } + if ((map[cell] == Terrain.ALCHEMY) && (item instanceof BlandfruitBush.Seed || !(item instanceof Plant.Seed || (item instanceof Blandfruit && ((Blandfruit) item).potionAttrib == null && heaps.get(cell) == null)))) { int n; @@ -838,7 +853,6 @@ public abstract class Level implements Bundlable { } } if (c.buff( Awareness.class ) != null) { - for (Heap heap : heaps.values()) { int p = heap.pos; fieldOfView[p] = true; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java index 0f85550dd..2dda8e655 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java @@ -317,7 +317,7 @@ public class PrisonBossLevel extends RegularLevel { } while (pos == cell || Actor.findChar( pos ) != null); Mob boss = Bestiary.mob( Dungeon.depth ); - boss.state = Mob.State.HUNTING; + boss.state = boss.HUNTING; boss.pos = pos; GameScene.add( boss ); boss.notice(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/Terrain.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/Terrain.java index ac8f46eee..d0c06b18c 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/Terrain.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/Terrain.java @@ -92,7 +92,7 @@ public class Terrain { flags[WALL] = LOS_BLOCKING | SOLID | UNSTITCHABLE; flags[DOOR] = PASSABLE | LOS_BLOCKING | FLAMABLE | SOLID | UNSTITCHABLE; flags[OPEN_DOOR] = PASSABLE | FLAMABLE | UNSTITCHABLE; - flags[ENTRANCE] = PASSABLE; + flags[ENTRANCE] = PASSABLE/* | SOLID*/; flags[EXIT] = PASSABLE; flags[EMBERS] = PASSABLE; flags[LOCKED_DOOR] = LOS_BLOCKING | SOLID | UNSTITCHABLE; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java index 16b4ff33c..e6cb55337 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java @@ -17,6 +17,7 @@ */ package com.shatteredpixel.shatteredpixeldungeon.levels.features; +import com.shatteredpixel.shatteredpixeldungeon.Challenges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin; @@ -39,25 +40,27 @@ public class HighGrass { Level.set( pos, Terrain.GRASS ); GameScene.updateMap( pos ); - - int naturalismLevel = 0; - if (ch != null) { - SandalsOfNature.Naturalism naturalism = ch.buff( SandalsOfNature.Naturalism.class ); - if (naturalism != null) { - naturalismLevel = naturalism.level()+1; - naturalism.charge(); + + if (!Dungeon.isChallenged( Challenges.NO_HERBALISM )) { + int naturalismLevel = 0; + if (ch != null) { + SandalsOfNature.Naturalism naturalism = ch.buff( SandalsOfNature.Naturalism.class ); + if (naturalism != null) { + naturalismLevel = naturalism.level()+1; + naturalism.charge(); + } + } + + // Seed + if (Random.Int(18-((int)(naturalismLevel*3.34))) == 0) { + level.drop( Generator.random( Generator.Category.SEED ), pos ).sprite.drop(); + } + + // Dew + if (Random.Int( 6-naturalismLevel ) == 0) { + level.drop( new Dewdrop(), pos ).sprite.drop(); } } - - // Seed - if (Random.Int(18-((int)(naturalismLevel*3.34))) == 0) { - level.drop( Generator.random( Generator.Category.SEED ), pos ).sprite.drop(); - } - - // Dew - if (Random.Int( 6-naturalismLevel ) == 0) { - level.drop( new Dewdrop(), pos ).sprite.drop(); - } int leaves = 4; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/ShopPainter.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/ShopPainter.java index 00f29aef1..3df6a3d42 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/ShopPainter.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/ShopPainter.java @@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Torch; +import com.shatteredpixel.shatteredpixeldungeon.items.Weightstone; import com.shatteredpixel.shatteredpixeldungeon.items.armor.*; import com.shatteredpixel.shatteredpixeldungeon.items.bags.ScrollHolder; import com.shatteredpixel.shatteredpixeldungeon.items.bags.SeedPouch; @@ -95,18 +96,21 @@ public class ShopPainter extends Painter { items.add( (Random.Int( 2 ) == 0 ? new Quarterstaff() : new Spear()).identify() ); items.add( new LeatherArmor().identify() ); items.add( new SeedPouch() ); + items.add( new Weightstone() ); break; case 11: items.add( (Random.Int( 2 ) == 0 ? new Sword() : new Mace()).identify() ); items.add( new MailArmor().identify() ); items.add( new ScrollHolder() ); + items.add( new Weightstone() ); break; case 16: items.add( (Random.Int( 2 ) == 0 ? new Longsword() : new BattleAxe()).identify() ); items.add( new ScaleArmor().identify() ); items.add( new WandHolster() ); + items.add( new Weightstone() ); break; case 21: diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/PoisonTrap.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/PoisonTrap.java index a176d930d..36a2ec365 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/PoisonTrap.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/PoisonTrap.java @@ -31,7 +31,7 @@ public class PoisonTrap { public static void trigger( int pos, Char ch ) { if (ch != null) { - Buff.affect( ch, Poison.class ).set( 5 + Math.min( Dungeon.depth, 15 ) ); + Buff.affect( ch, Poison.class ).set( Poison.durationFactor( ch ) * (4 + Dungeon.depth / 2) ); } CellEmitter.center( pos ).burst( PoisonParticle.SPLASH, 3 ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/SummoningTrap.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/SummoningTrap.java index 093bc6ef9..f7cb879cc 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/SummoningTrap.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/SummoningTrap.java @@ -80,7 +80,7 @@ public class SummoningTrap { for (Integer point : respawnPoints) { Mob mob = Bestiary.mob( Dungeon.depth ); - mob.state = Mob.State.WANDERING; + mob.state = mob.WANDERING; GameScene.add( mob, DELAY ); WandOfBlink.appear( mob, point ); }