diff --git a/assets/items.png b/assets/items.png index 99960e5ca..02cfab925 100644 Binary files a/assets/items.png and b/assets/items.png differ diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/ItemStatusHandler.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/ItemStatusHandler.java index 4c555235b..cd9062893 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/ItemStatusHandler.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/ItemStatusHandler.java @@ -93,7 +93,7 @@ public class ItemStatusHandler { Class item = (Class)(items[i]); String itemName = item.toString(); - if (bundle.contains( itemName + PFX_LABEL ) && Dungeon.version > 3) { + if (bundle.contains( itemName + PFX_LABEL ) && Dungeon.version > 4) { String label = bundle.getString( itemName + PFX_LABEL ); labels.put( item, label ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java index 802a9a93a..62b0b5c86 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java @@ -31,6 +31,9 @@ public class Artifact extends KindofMisc { protected Buff activeBuff; //level is used internally to track upgrades to artifacts, size/logic varies per artifact. + //already inherited from item superclass + //exp is used to count progress towards levels for some artifacts + protected int exp = 0; //levelCap is the artifact's maximum level protected int levelCap = 0; @@ -164,14 +167,14 @@ public class Artifact extends KindofMisc { @Override public void storeInBundle( Bundle bundle ) { - bundle.put( "level", level ); + bundle.put( "exp", exp ); bundle.put( "charge", charge ); bundle.put( "partialcharge", partialCharge); } @Override public void restoreFromBundle( Bundle bundle ) { - level = bundle.getInt("level"); + exp = bundle.getInt("exp"); charge = bundle.getInt("charge"); partialCharge = bundle.getFloat("partialcharge"); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java index 7e0a3914e..c78fba86e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java @@ -33,7 +33,7 @@ public class ChaliceOfBlood extends Artifact { { name = "Chalice of Blood"; - image = ItemSpriteSheet.ARTIFACT_CHALICE; + image = ItemSpriteSheet.ARTIFACT_CHALICE1; level = 0; levelCap = 8; //charge & chargecap are unused @@ -56,7 +56,7 @@ public class ChaliceOfBlood extends Artifact { int damage = (level*2)*(level*2); - if (damage > hero.HT*(3/4)) { + if (damage > hero.HP*0.75) { GameScene.show( new WndOptions(TXT_CHALICE, TXT_PRICK, TXT_YES, TXT_NO) { @@ -79,15 +79,6 @@ public class ChaliceOfBlood extends Artifact { hero.spendAndNext(3f); - Earthroot.Armor armor = hero.buff(Earthroot.Armor.class); - if (armor != null) { - damage = armor.absorb(damage); - } - - damage -= Random.IntRange(0, hero.dr()); - - hero.damage(damage, this); - //TODO: make sure this look good if (damage == 0){ GLog.i("You prick yourself, that hardly hurt at all!"); @@ -105,11 +96,27 @@ public class ChaliceOfBlood extends Artifact { hero.sprite.emitter().burst( ShadowParticle.CURSE, 6 ); } + Earthroot.Armor armor = hero.buff(Earthroot.Armor.class); + if (armor != null) { + damage = armor.absorb(damage); + } + + damage -= Random.IntRange(0, hero.dr()); + + hero.damage(damage, this); + + + if (!hero.isAlive()) { Dungeon.fail(Utils.format(ResultDescriptions.ITEM, name, Dungeon.depth)); GLog.n("The Chalice sucks your life essence dry..."); - } else + } else { level++; + if (level >= 5) + image = ItemSpriteSheet.ARTIFACT_CHALICE2; + else if (level >= 3) + image = ItemSpriteSheet.ARTIFACT_CHALICE3; + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java index a1ec24e22..e1323f6eb 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java @@ -224,7 +224,6 @@ public class CloakOfShadows extends Artifact { bundle.put("chargecap", chargeCap); bundle.put("stealthed", stealthed); bundle.put("cooldown", cooldown); - bundle.put("exp", exp); } @Override @@ -233,6 +232,5 @@ public class CloakOfShadows extends Artifact { chargeCap = bundle.getInt("chargecap"); stealthed = bundle.getBoolean("stealthed"); cooldown = bundle.getInt("cooldown"); - exp = bundle.getInt("exp"); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HornOfPlenty.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HornOfPlenty.java index 025fc37b0..867bfb197 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HornOfPlenty.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HornOfPlenty.java @@ -30,7 +30,7 @@ public class HornOfPlenty extends Artifact { { name = "Horn of Plenty"; - image = ItemSpriteSheet.ARTIFACT_HORN; + image = ItemSpriteSheet.ARTIFACT_HORN1; level = 0; levelCap = 30; charge = 0; @@ -97,7 +97,7 @@ public class HornOfPlenty extends Artifact { Badges.validateFoodEaten(); - image = ItemSpriteSheet.ARTIFACT_HORN; + image = ItemSpriteSheet.ARTIFACT_HORN1; } else if (action.equals(AC_STORE)){ diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java b/src/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java index b814b563a..f304d48ec 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java @@ -130,80 +130,88 @@ public class ItemSpriteSheet { public static final int RING_AGATE = ROW7+10; public static final int RING_DIAMOND = ROW7+11; - //Row Eight: Artifacts - //ssssshhh.... + //Row Eight: Artifacts with Static Images public static final int ARTIFACT_CLOAK = ROW8+0; - public static final int ARTIFACT_HORN = ROW8+1; - public static final int ARTIFACT_CHALICE = 0; - public static final int ARTIFACT_SANDALS = 0; - public static final int ARTIFACT_ARMBAND = 0; - public static final int ARTIFACT_CAPE = 0; + public static final int ARTIFACT_ARMBAND = ROW8+1; + public static final int ARTIFACT_CAPE = ROW8+2; public static final int ARTIFACT_TALISMAN = 0; - //Row Nine: Scrolls - public static final int SCROLL_KAUNAN = ROW9+0; - public static final int SCROLL_SOWILO = ROW9+1; - public static final int SCROLL_LAGUZ = ROW9+2; - public static final int SCROLL_YNGVI = ROW9+3; - public static final int SCROLL_GYFU = ROW9+4; - public static final int SCROLL_RAIDO = ROW9+5; - public static final int SCROLL_ISAZ = ROW9+6; - public static final int SCROLL_MANNAZ = ROW9+7; - public static final int SCROLL_NAUDIZ = ROW9+8; - public static final int SCROLL_BERKANAN = ROW9+9; - public static final int SCROLL_ODAL = ROW9+10; - public static final int SCROLL_TIWAZ = ROW9+11; - //Row Ten: Potions - public static final int POTION_CRIMSON = ROW10+0; - public static final int POTION_AMBER = ROW10+1; - public static final int POTION_GOLDEN = ROW10+2; - public static final int POTION_JADE = ROW10+3; - public static final int POTION_TURQUOISE = ROW10+4; - public static final int POTION_AZURE = ROW10+5; - public static final int POTION_INDIGO = ROW10+6; - public static final int POTION_MAGENTA = ROW10+7; - public static final int POTION_BISTRE = ROW10+8; - public static final int POTION_CHARCOAL = ROW10+9; - public static final int POTION_SILVER = ROW10+10; - public static final int POTION_IVORY = ROW10+11; + //Row Nine: Artifacts with Dynamic Images + public static final int ARTIFACT_HORN1 = ROW9+0; + public static final int ARTIFACT_HORN2 = ROW9+1; + public static final int ARTIFACT_HORN3 = ROW9+2; + public static final int ARTIFACT_HORN4 = ROW9+3; + public static final int ARTIFACT_CHALICE1 = ROW9+4; + public static final int ARTIFACT_CHALICE2 = ROW9+5; + public static final int ARTIFACT_CHALICE3 = ROW9+6; + public static final int ARTIFACT_SANDALS = ROW9+7; + public static final int ARTIFACT_SHOES = ROW9+8; + public static final int ARTIFACT_BOOTS = ROW9+9; + public static final int ARTIFACT_LEGGINGS = ROW9+10; - //Row Eleven: Seeds - public static final int SEED_ROTBERRY = ROW11+0; - public static final int SEED_FIREBLOOM = ROW11+1; - public static final int SEED_BLINDWEED = ROW11+2; - public static final int SEED_SUNGRASS = ROW11+3; - public static final int SEED_ICECAP = ROW11+4; - public static final int SEED_SORROWMOSS = ROW11+5; - public static final int SEED_EARTHROOT = ROW11+6; - public static final int SEED_FADELEAF = ROW11+7; - public static final int SEED_BLANDFRUIT = ROW11+8; + //Row Ten: Scrolls + public static final int SCROLL_KAUNAN = ROW10+0; + public static final int SCROLL_SOWILO = ROW10+1; + public static final int SCROLL_LAGUZ = ROW10+2; + public static final int SCROLL_YNGVI = ROW10+3; + public static final int SCROLL_GYFU = ROW10+4; + public static final int SCROLL_RAIDO = ROW10+5; + public static final int SCROLL_ISAZ = ROW10+6; + public static final int SCROLL_MANNAZ = ROW10+7; + public static final int SCROLL_NAUDIZ = ROW10+8; + public static final int SCROLL_BERKANAN = ROW10+9; + public static final int SCROLL_ODAL = ROW10+10; + public static final int SCROLL_TIWAZ = ROW10+11; - //Row Twelve: Food - public static final int MEAT = ROW12+0; - public static final int STEAK = ROW12+1; - public static final int OVERPRICED = ROW12+2; - public static final int CARPACCIO = ROW12+3; - public static final int BLANDFRUIT = ROW12+4; - public static final int RATION = ROW12+5; - public static final int PASTY = ROW12+6; + //Row Eleven: Potions + public static final int POTION_CRIMSON = ROW11+0; + public static final int POTION_AMBER = ROW11+1; + public static final int POTION_GOLDEN = ROW11+2; + public static final int POTION_JADE = ROW11+3; + public static final int POTION_TURQUOISE = ROW11+4; + public static final int POTION_AZURE = ROW11+5; + public static final int POTION_INDIGO = ROW11+6; + public static final int POTION_MAGENTA = ROW11+7; + public static final int POTION_BISTRE = ROW11+8; + public static final int POTION_CHARCOAL = ROW11+9; + public static final int POTION_SILVER = ROW11+10; + public static final int POTION_IVORY = ROW11+11; - //Row Thirteen: Quest Items - public static final int ROSE = ROW13+0; - public static final int SKULL = ROW13+1; - public static final int DUST = ROW13+2; - public static final int PICKAXE = ROW13+3; - public static final int ORE = ROW13+4; - public static final int TOKEN = ROW13+5; + //Row Twelve: Seeds + public static final int SEED_ROTBERRY = ROW12+0; + public static final int SEED_FIREBLOOM = ROW12+1; + public static final int SEED_BLINDWEED = ROW12+2; + public static final int SEED_SUNGRASS = ROW12+3; + public static final int SEED_ICECAP = ROW12+4; + public static final int SEED_SORROWMOSS = ROW12+5; + public static final int SEED_EARTHROOT = ROW12+6; + public static final int SEED_FADELEAF = ROW12+7; + public static final int SEED_BLANDFRUIT = ROW12+8; - //Row Fourteen: Containers/Bags - public static final int VIAL = ROW14+0; - public static final int POUCH = ROW14+1; - public static final int HOLDER = ROW14+2; - public static final int BANDOLIER = ROW14+3; - public static final int HOLSTER = ROW14+4; + //Row Theirteen: Food + public static final int MEAT = ROW13+0; + public static final int STEAK = ROW13+1; + public static final int OVERPRICED = ROW13+2; + public static final int CARPACCIO = ROW13+3; + public static final int BLANDFRUIT = ROW13+4; + public static final int RATION = ROW13+5; + public static final int PASTY = ROW13+6; - //Row Fifteen: Unused + //Row Fourteen: Quest Items + public static final int ROSE = ROW14+0; + public static final int SKULL = ROW14+1; + public static final int DUST = ROW14+2; + public static final int PICKAXE = ROW14+3; + public static final int ORE = ROW14+4; + public static final int TOKEN = ROW14+5; + + //Row Fifteen: Containers/Bags + public static final int VIAL = ROW15+0; + public static final int POUCH = ROW15+1; + public static final int HOLDER = ROW15+2; + public static final int BANDOLIER = ROW15+3; + public static final int HOLSTER = ROW15+4; //Row Sixteen: Unused