v0.2.3: artifacts can now be cursed (couple rough edges to smooth out)

This commit is contained in:
Evan Debenham
2014-11-19 01:36:36 -05:00
parent 268435d390
commit 0ba2ca4302
12 changed files with 143 additions and 66 deletions
@@ -28,12 +28,13 @@ public class Regeneration extends Buff {
@Override
public boolean act() {
if (target.isAlive()) {
if (target.HP < target.HT && !((Hero)target).isStarving()) {
ChaliceOfBlood.chaliceRegen regenBuff = Dungeon.hero.buff( ChaliceOfBlood.chaliceRegen.class);
if (target.HP < target.HT && !((Hero)target).isStarving() && !(regenBuff != null && regenBuff.isCursed())) {
target.HP += 1;
}
ChaliceOfBlood.chaliceRegen regenBuff = Dungeon.hero.buff( ChaliceOfBlood.chaliceRegen.class);
if (regenBuff != null)
spend( Math.max(REGENERATION_DELAY - regenBuff.level(), 0.5f) );
else
@@ -591,7 +591,9 @@ public class Hero extends Char {
if (item instanceof Dewdrop) {
} else {
//TODO: this is triggering very rigidly, consider some sort of refactor
//specifically, right now is causing wrong output with a cursed horn of plenty.
if ((item instanceof ScrollOfUpgrade && ((ScrollOfUpgrade)item).isKnown()) ||
(item instanceof PotionOfStrength && ((PotionOfStrength)item).isKnown())) {
GLog.p( TXT_YOU_NOW_HAVE, item.name() );
@@ -1368,7 +1370,7 @@ public class Hero extends Char {
for (int y = ay; y <= by; y++) {
for (int x = ax, p = ax + y * Level.WIDTH; x <= bx; x++, p++) {
if (Dungeon.visible[p]) {
if (Dungeon.visible[p] && !(foresight != null && foresight.isCursed())) {
if (intentional) {
sprite.parent.addToBack( new CheckedCell( p ) );
@@ -24,8 +24,10 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.TomeOfMastery;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClothArmor;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CloakOfShadows;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfMight;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfMagicMissile;
@@ -116,6 +118,14 @@ public enum HeroClass {
if (!Dungeon.isChallenged(Challenges.NO_FOOD))
new Food().identify().collect();
new ScrollOfIdentify().collect();
HornOfPlenty horn = new HornOfPlenty();
horn.cursed = true;
horn.collect();
new RingOfMight().collect();
}
public Badges.Badge masteryBadge() {