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

View File

@ -149,16 +149,20 @@ public class Bones {
if (item instanceof Artifact){ if (item instanceof Artifact){
if (Generator.removeArtifact((Artifact)item)) { if (Generator.removeArtifact((Artifact)item)) {
try { try {
item = item.getClass().newInstance(); Artifact artifact = (Artifact)item.getClass().newInstance();
item.cursed = true; artifact.cursed = true;
item.cursedKnown = true; artifact.cursedKnown = true;
//caps displayed artifact level
artifact.transferUpgrade(Math.min(
item.visiblyUpgraded(),
1 + ((Dungeon.depth * 3) / 10)));
return item; return item;
} catch (Exception e) { } catch (Exception e) {
return new Gold(Random.NormalIntRange(150, 250)); return new Gold(item.price());
} }
} else { } else {
return new Gold(Random.NormalIntRange(150, 250)); return new Gold(item.price());
} }
} }

View File

@ -173,7 +173,7 @@ public class WaterOfTransmutation extends WellWater {
if (n != null){ if (n != null){
n.cursedKnown = a.cursedKnown; n.cursedKnown = a.cursedKnown;
n.cursed = a.cursed; n.cursed = a.cursed;
n.transferUpgrade(a); n.transferUpgrade(a.visiblyUpgraded());
Journal.remove( Feature.WELL_OF_TRANSMUTATION ); Journal.remove( Feature.WELL_OF_TRANSMUTATION );
} }

View File

@ -138,10 +138,9 @@ public class Artifact extends KindofMisc {
return ((level*10)/levelCap); return ((level*10)/levelCap);
} }
//transfers upgrades from another artifact, in terms of displayed level //transfers upgrades from another artifact, transfer level will equal the displayed level
public void transferUpgrade(Artifact a) { public void transferUpgrade(int transferLvl) {
int transferLvl = Math.round((a.visiblyUpgraded()*levelCap)/10); upgrade(Math.round((float)(transferLvl*levelCap)/10));
upgrade(transferLvl);
} }
@Override @Override