v0.2.3: artifacts are now unique, also have better interaction with remains

This commit is contained in:
Evan Debenham
2014-11-18 21:04:59 -05:00
parent e58df1bc9c
commit 567f80a689
3 changed files with 102 additions and 3 deletions
@@ -18,8 +18,10 @@
package com.shatteredpixel.shatteredpixeldungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlot;
import com.watabou.noosa.Game;
@@ -143,6 +145,22 @@ public class Bones {
if (depth == Dungeon.depth && Dungeon.challenges == 0) {
Game.instance.deleteFile( BONES_FILE );
depth = 0;
if (item instanceof Artifact){
if (Generator.removeArtifact((Artifact)item)) {
try {
item = item.getClass().newInstance();
item.cursed = true;
item.cursedKnown = true;
return item;
} catch (Exception e) {
return new Gold(Random.NormalIntRange(150, 250));
}
} else {
return new Gold(Random.NormalIntRange(150, 250));
}
}
if (item.isUpgradable()) {
item.cursed = true;