From f59fc8c304c90f51068e7848626c87213010190b Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 19 Nov 2014 10:56:26 -0500 Subject: [PATCH] v0.2.3: refactored levelling on some artifacts --- .../items/artifacts/ChaliceOfBlood.java | 13 +++++++--- .../items/artifacts/CloakOfShadows.java | 8 +++++- .../items/artifacts/SandalsOfNature.java | 26 ++++++++++++------- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java index 373f3bba6..4dedc6329 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java @@ -5,6 +5,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.ResultDescriptions; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle; +import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.plants.Earthroot; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -110,13 +111,17 @@ public class ChaliceOfBlood extends Artifact { GLog.n("The Chalice sucks your life essence dry..."); } else { upgrade(); - if (level >= 7) - image = ItemSpriteSheet.ARTIFACT_CHALICE3; - else if (level >= 3) - image = ItemSpriteSheet.ARTIFACT_CHALICE2; } } + @Override + public Item upgrade() { + if (level >= 6) + image = ItemSpriteSheet.ARTIFACT_CHALICE3; + else if (level >= 2) + image = ItemSpriteSheet.ARTIFACT_CHALICE2; + return super.upgrade(); + } @Override protected ArtifactBuff passiveBuff() { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java index 94a0e146e..93f8aa541 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java @@ -5,6 +5,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlot; @@ -113,6 +114,12 @@ public class CloakOfShadows extends Artifact { return new cloakStealth(); } + @Override + public Item upgrade() { + chargeCap++; + return super.upgrade(); + } + @Override public String desc() { String desc = "This light silken cloak shimmers in and out of your vision as it sways in the air. When worn, " + @@ -223,7 +230,6 @@ public class CloakOfShadows extends Artifact { if (exp >= (level+1)*50 && level < levelCap) { upgrade(); - chargeCap++; exp -= level*50; GLog.p("Your Cloak Grows Stronger!"); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java index f05b72a2a..b8a93c8f8 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java @@ -140,6 +140,20 @@ public class SandalsOfNature extends Artifact { return desc; } + @Override + public Item upgrade() { + if (level < 0) + image = ItemSpriteSheet.ARTIFACT_SANDALS; + else if (level == 0) + image = ItemSpriteSheet.ARTIFACT_SHOES; + else if (level == 1) + image = ItemSpriteSheet.ARTIFACT_BOOTS; + else if (level >= 2) + image = ItemSpriteSheet.ARTIFACT_GREAVES; + name = NAMES[level+1]; + return super.upgrade(); + } + private static final String SEEDS = "seeds"; private static final String NAME = "name"; @@ -184,17 +198,9 @@ public class SandalsOfNature extends Artifact { seeds.clear(); upgrade(); if (level >= 1 && level <= 3) { - GLog.p("Your " + name + " surge in size, they are now " + NAMES[level] + "!"); - name = NAMES[level]; + GLog.p("Your " + NAMES[level-1] + " surge in size, they are now " + NAMES[level] + "!"); } - if (level <= 0) - image = ItemSpriteSheet.ARTIFACT_SANDALS; - else if (level == 1) - image = ItemSpriteSheet.ARTIFACT_SHOES; - else if (level == 2) - image = ItemSpriteSheet.ARTIFACT_BOOTS; - else if (level >= 3) - image = ItemSpriteSheet.ARTIFACT_GREAVES; + } else { GLog.i("Your " + name + " absorb the seed, they seem healthier."); }