diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java index 9b9287cee..9f4741e07 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java @@ -28,13 +28,13 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.KindofMisc; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag; import com.shatteredpixel.shatteredpixeldungeon.items.keys.Key; import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; -import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.watabou.utils.Bundle; import com.watabou.utils.Random; @@ -140,7 +140,12 @@ public class Belongings implements Iterable { public static void preview( GamesInProgress.Info info, Bundle bundle ) { if (bundle.contains( ARMOR )){ - info.armorTier = ((Armor)bundle.get( ARMOR )).tier; + Armor armor = ((Armor)bundle.get( ARMOR )); + if (armor instanceof ClassArmor){ + info.armorTier = 6; + } else { + info.armorTier = armor.tier; + } } else { info.armorTier = 0; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 8d7dddaba..14b052ef3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -66,6 +66,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Heap.Type; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity; @@ -373,7 +374,13 @@ public class Hero extends Char { } public int tier() { - return belongings.armor == null ? 0 : belongings.armor.tier; + if (belongings.armor instanceof ClassArmor){ + return 6; + } else if (belongings.armor != null){ + return belongings.armor.tier; + } else { + return 0; + } } public boolean shoot( Char enemy, MissileWeapon wep ) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java index 3356972f4..3af33bd4f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java @@ -21,7 +21,6 @@ package com.shatteredpixel.shatteredpixeldungeon.items.armor; -import com.shatteredpixel.shatteredpixeldungeon.Challenges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; @@ -55,11 +54,12 @@ abstract public class ClassArmor extends Armor { public float charge = 0; public ClassArmor() { - super( 6 ); + super( 5 ); } @Override public void activate(Char ch) { + super.activate(ch); charger = new Charger(); charger.attachTo(ch); } @@ -103,7 +103,7 @@ abstract public class ClassArmor extends Armor { } classArmor.level(armor.level() - (armor.curseInfusionBonus ? 1 : 0)); - classArmor.armorTier = armor.tier; + classArmor.tier = armor.tier; classArmor.augment = armor.augment; classArmor.inscribe( armor.glyph ); classArmor.cursed = armor.cursed; @@ -121,14 +121,14 @@ abstract public class ClassArmor extends Armor { @Override public void storeInBundle( Bundle bundle ) { super.storeInBundle( bundle ); - bundle.put( ARMOR_TIER, armorTier ); + bundle.put( ARMOR_TIER, tier ); bundle.put( CHARGE, charge ); } @Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle( bundle ); - armorTier = bundle.getInt( ARMOR_TIER ); + tier = bundle.getInt( ARMOR_TIER ); charge = bundle.getFloat(CHARGE); } @@ -190,25 +190,6 @@ abstract public class ClassArmor extends Armor { return desc; } - - @Override - public int STRReq(int lvl) { - return STRReq(armorTier, lvl); - } - - @Override - public int DRMax(int lvl){ - if (Dungeon.isChallenged(Challenges.NO_ARMOR)){ - return 1 + armorTier + lvl + augment.defenseFactor(lvl); - } - - int max = armorTier * (2 + lvl) + augment.defenseFactor(lvl); - if (lvl > max){ - return ((lvl - max)+1)/2; - } else { - return max; - } - } @Override public boolean isIdentified() {