v0.2.2: further tweaks to heroes remains system

This commit is contained in:
Evan Debenham
2014-10-30 11:16:19 -04:00
parent 462f4c9d8b
commit 55b920f9bb
2 changed files with 22 additions and 13 deletions
@@ -18,10 +18,9 @@
package com.shatteredpixel.shatteredpixeldungeon; package com.shatteredpixel.shatteredpixeldungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem;
import com.shatteredpixel.shatteredpixeldungeon.items.Gold; import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; 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.shatteredpixel.shatteredpixeldungeon.ui.QuickSlot;
import com.watabou.noosa.Game; import com.watabou.noosa.Game;
import com.watabou.utils.Bundle; import com.watabou.utils.Bundle;
@@ -45,11 +44,14 @@ public class Bones {
public static void leave() { public static void leave() {
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); item = pickItem(Dungeon.hero);
depth = Dungeon.depth;
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.put( LEVEL, depth ); bundle.put( LEVEL, depth );
bundle.put( ITEM, item ); bundle.put( ITEM, item );
@@ -92,22 +94,26 @@ public class Bones {
ArrayList<Item> items = new ArrayList<Item>(); ArrayList<Item> items = new ArrayList<Item>();
while (iterator.hasNext()){ while (iterator.hasNext()){
curItem = iterator.next(); curItem = iterator.next();
if (curItem.bones && !(curItem instanceof EquipableItem)) if (curItem.bones)
items.add(curItem); items.add(curItem);
} }
if (!items.isEmpty()) { if (Random.Int(3) < items.size()) {
item = Random.element(items); item = Random.element(items);
if (item.stackable){ 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 (item == null) {
if (Dungeon.gold > 0) { if (Dungeon.gold > 50) {
item = new Gold( Random.NormalIntRange( 1, Dungeon.gold ) ); item = new Gold( Random.NormalIntRange( 50, Dungeon.gold ) );
} else { } else {
item = new Gold( 1 ); item = new Gold( 50 );
} }
} }
return item; return item;
@@ -139,7 +145,8 @@ public class Bones {
item.cursed = true; item.cursed = true;
item.cursedKnown = true; item.cursedKnown = true;
if (item.isUpgradable()) { 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) { if (lvl < item.level) {
item.degrade( item.level - lvl ); item.degrade( item.level - lvl );
} }
@@ -25,6 +25,8 @@ public class ClothArmor extends Armor {
{ {
name = "cloth armor"; name = "cloth armor";
image = ItemSpriteSheet.ARMOR_CLOTH; image = ItemSpriteSheet.ARMOR_CLOTH;
bones = false; //Finding them in bones would be semi-frequent and disappointing.
} }
public ClothArmor() { public ClothArmor() {