From d05315e50a55b15f110c5958f620250e6df09e9e Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 13 Feb 2018 20:10:21 -0500 Subject: [PATCH] v0.6.3: shops now stock two random tipped darts instead of two darts also reduced the droprate for blandfruit seeds --- .../shatteredpixeldungeon/items/Generator.java | 2 +- .../items/wands/WandOfRegrowth.java | 2 +- .../items/weapon/missiles/darts/TippedDart.java | 16 ++++++++++++++++ .../levels/features/HighGrass.java | 2 +- .../levels/rooms/special/ShopRoom.java | 4 ++-- .../shatteredpixeldungeon/plants/Plant.java | 2 +- 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java index 9deb4f73d..d387973b8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java @@ -406,7 +406,7 @@ public class Generator { Dreamfoil.Seed.class, Stormvine.Seed.class, Starflower.Seed.class}; - SEED.probs = new float[]{ 12, 12, 12, 12, 12, 12, 12, 0, 3, 12, 12, 1 }; + SEED.probs = new float[]{ 10, 10, 10, 10, 10, 10, 10, 0, 2, 10, 10, 1 }; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java index 8c310dbac..2aac758bf 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java @@ -130,7 +130,7 @@ public class WandOfRegrowth extends Wand { Plant.Seed seed = (Plant.Seed) Generator.random(Generator.Category.SEED); if (seed instanceof BlandfruitBush.Seed) { - if (Random.Int(5) - Dungeon.LimitedDrops.BLANDFRUIT_SEED.count >= 0) { + if (Random.Int(3) - Dungeon.LimitedDrops.BLANDFRUIT_SEED.count >= 0) { floor.plant(seed, cells.next()); Dungeon.LimitedDrops.BLANDFRUIT_SEED.count++; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/TippedDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/TippedDart.java index 804cc4db8..6de37ef29 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/TippedDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/TippedDart.java @@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion; +import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Recipe; import com.shatteredpixel.shatteredpixeldungeon.plants.Blindweed; @@ -83,6 +84,21 @@ public abstract class TippedDart extends Dart { types.put(Sungrass.Seed.class, HealingDart.class); } + public static TippedDart randomTipped(){ + Plant.Seed s; + do{ + s = (Plant.Seed) Generator.random(Generator.Category.SEED); + } while (!types.containsKey(s.getClass())); + + try{ + return (TippedDart) types.get(s.getClass()).newInstance().quantity(2); + } catch (Exception e) { + ShatteredPixelDungeon.reportException(e); + return null; + } + + } + public static class TipDart extends Recipe{ @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java index 6c0385aa3..60a3c4ee4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java @@ -69,7 +69,7 @@ public class HighGrass { Item seed = Generator.random(Generator.Category.SEED); if (seed instanceof BlandfruitBush.Seed) { - if (Random.Int(5) - Dungeon.LimitedDrops.BLANDFRUIT_SEED.count >= 0) { + if (Random.Int(3) - Dungeon.LimitedDrops.BLANDFRUIT_SEED.count >= 0) { level.drop(seed, pos).sprite.drop(); Dungeon.LimitedDrops.BLANDFRUIT_SEED.count++; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java index 5c27cc4f2..67ee1e063 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java @@ -68,8 +68,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Shuriken; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ThrowingHammer; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Tomahawk; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Trident; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.Dart; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.IncendiaryDart; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.TippedDart; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; @@ -202,7 +202,7 @@ public class ShopRoom extends SpecialRoom { break; } - itemsToSpawn.add( new Dart().quantity(2) ); + itemsToSpawn.add( TippedDart.randomTipped() ); itemsToSpawn.add( new MerchantsBeacon() ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java index 97d03af09..3792cf1b4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java @@ -89,7 +89,7 @@ public abstract class Plant implements Bundlable { Item seed = Generator.random(Generator.Category.SEED); if (seed instanceof BlandfruitBush.Seed) { - if (Random.Int(5) - Dungeon.LimitedDrops.BLANDFRUIT_SEED.count >= 0) { + if (Random.Int(3) - Dungeon.LimitedDrops.BLANDFRUIT_SEED.count >= 0) { Dungeon.level.drop(seed, pos).sprite.drop(); Dungeon.LimitedDrops.BLANDFRUIT_SEED.count++; }