v0.2.2: further tweaks to heroes remains system
This commit is contained in:
@@ -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<Item> items = new ArrayList<Item>();
|
||||
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 );
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user