From 55b920f9bb6bcb3e249fb0cd9b69af172157f9ba Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 30 Oct 2014 11:16:19 -0400 Subject: [PATCH] v0.2.2: further tweaks to heroes remains system --- .../shatteredpixeldungeon/Bones.java | 33 +++++++++++-------- .../items/armor/ClothArmor.java | 2 ++ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/Bones.java b/src/com/shatteredpixel/shatteredpixeldungeon/Bones.java index 7b6a65d10..c4b91b35e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/Bones.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/Bones.java @@ -18,10 +18,9 @@ package com.shatteredpixel.shatteredpixeldungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; -import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem; import com.shatteredpixel.shatteredpixeldungeon.items.Gold; import com.shatteredpixel.shatteredpixeldungeon.items.Item; -import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon; import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlot; import com.watabou.noosa.Game; import com.watabou.utils.Bundle; @@ -44,11 +43,14 @@ public class Bones { private static Item item; public static void leave() { - - item = pickItem(Dungeon.hero); - - depth = Dungeon.depth; + depth = Dungeon.depth; + + //heroes which have already won the game, or who die much higher than their deepest depth drop no bones. + if (Statistics.amuletObtained || (Statistics.deepestFloor - 5) >= depth) + return; + + item = pickItem(Dungeon.hero); Bundle bundle = new Bundle(); bundle.put( LEVEL, depth ); @@ -92,22 +94,26 @@ public class Bones { ArrayList items = new ArrayList(); while (iterator.hasNext()){ curItem = iterator.next(); - if (curItem.bones && !(curItem instanceof EquipableItem)) + if (curItem.bones) items.add(curItem); } - if (!items.isEmpty()) { + if (Random.Int(3) < items.size()) { item = Random.element(items); if (item.stackable){ - item.quantity((int)Math.sqrt(item.quantity())); + if (item instanceof MissileWeapon){ + item.quantity(Random.NormalIntRange(1, item.quantity())); + } else { + item.quantity(Random.NormalIntRange(1, (item.quantity() + 1) / 2)); + } } } } if (item == null) { - if (Dungeon.gold > 0) { - item = new Gold( Random.NormalIntRange( 1, Dungeon.gold ) ); + if (Dungeon.gold > 50) { + item = new Gold( Random.NormalIntRange( 50, Dungeon.gold ) ); } else { - item = new Gold( 1 ); + item = new Gold( 50 ); } } return item; @@ -139,7 +145,8 @@ public class Bones { item.cursed = true; item.cursedKnown = true; if (item.isUpgradable()) { - int lvl = (Dungeon.depth - 1) * 3 / 5 + 1; + //gain 1 level every 3.333 floors down plus one additional level. + int lvl = 1 + ((Dungeon.depth * 3) / 10); if (lvl < item.level) { item.degrade( item.level - lvl ); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClothArmor.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClothArmor.java index c7e95fc07..ebdbb8556 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClothArmor.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClothArmor.java @@ -25,6 +25,8 @@ public class ClothArmor extends Armor { { name = "cloth armor"; image = ItemSpriteSheet.ARMOR_CLOTH; + + bones = false; //Finding them in bones would be semi-frequent and disappointing. } public ClothArmor() {