v0.2.3: bones now transfer artifact levels (but they are capped as usual)
This commit is contained in:
parent
977a320fc2
commit
b73ee347f6
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ public class WaterOfTransmutation extends WellWater {
|
|||
if (n != null){
|
||||
n.cursedKnown = a.cursedKnown;
|
||||
n.cursed = a.cursed;
|
||||
n.transferUpgrade(a);
|
||||
n.transferUpgrade(a.visiblyUpgraded());
|
||||
Journal.remove( Feature.WELL_OF_TRANSMUTATION );
|
||||
}
|
||||
|
||||
|
|
|
@ -138,10 +138,9 @@ public class Artifact extends KindofMisc {
|
|||
return ((level*10)/levelCap);
|
||||
}
|
||||
|
||||
//transfers upgrades from another artifact, in terms of displayed level
|
||||
public void transferUpgrade(Artifact a) {
|
||||
int transferLvl = Math.round((a.visiblyUpgraded()*levelCap)/10);
|
||||
upgrade(transferLvl);
|
||||
//transfers upgrades from another artifact, transfer level will equal the displayed level
|
||||
public void transferUpgrade(int transferLvl) {
|
||||
upgrade(Math.round((float)(transferLvl*levelCap)/10));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user