v0.2.3: bones now transfer artifact levels (but they are capped as usual)

This commit is contained in:
Evan Debenham
2014-11-19 13:20:38 -05:00
parent 977a320fc2
commit b73ee347f6
3 changed files with 13 additions and 10 deletions
@@ -149,16 +149,20 @@ public class Bones {
if (item instanceof Artifact){
if (Generator.removeArtifact((Artifact)item)) {
try {
item = item.getClass().newInstance();
item.cursed = true;
item.cursedKnown = true;
Artifact artifact = (Artifact)item.getClass().newInstance();
artifact.cursed = true;
artifact.cursedKnown = true;
//caps displayed artifact level
artifact.transferUpgrade(Math.min(
item.visiblyUpgraded(),
1 + ((Dungeon.depth * 3) / 10)));
return item;
} catch (Exception e) {
return new Gold(Random.NormalIntRange(150, 250));
return new Gold(item.price());
}
} else {
return new Gold(Random.NormalIntRange(150, 250));
return new Gold(item.price());
}
}