public void initBreastplate(int heroHashCode) { GDEEquipmentData armor = SDDataManager.Instance.getHeroEquipBreastplate(heroHashCode); Breastplate a = unit_model.gameObject.AddComponent <Breastplate>(); HeroProperty._breastplate = a; if (armor == null || string.IsNullOrEmpty(armor.id)) { HeroProperty._breastplate.initDataEmpty(); return; } EquipItem Item = SDDataManager.Instance.GetEquipItemById(armor.id); if (Item == null) { HeroProperty._breastplate.initDataEmpty(); return; } // HeroProperty._breastplate.initData(Item.LEVEL, Item.RAL, 0, 0, 0, 0, RoleBarChart.zero , Item.ID, Item.NAME, 0); HeroProperty._breastplate.PassiveEffectInit(Item.PassiveEffect); HeroProperty._breastplate.armorRank = Item.ArmorRank; int lv = armor.lv; HeroProperty._breastplate.initGradeShow(lv); }
public void BuildEquipListBase() { if (_helmet == null && helmetD != null) { _helmet = helmetD.gameObject.AddComponent <Helmet>(); } if (_breastplate == null && breastplateD != null) { _breastplate = breastplateD.gameObject.AddComponent <Breastplate>(); } if (_gardebras == null && gardebrasD != null) { _gardebras = gardebrasD.gameObject.AddComponent <Gardebras>(); } if (_legging == null && leggingD != null) { _legging = leggingD.gameObject.AddComponent <Legging>(); } if (_jewelry0 == null && jewelry0D != null) { _jewelry0 = jewelry0D.gameObject.AddComponent <Jewelry>(); } if (_jewelry1 == null && jewelry1D != null) { _jewelry1 = jewelry1D.gameObject.AddComponent <Jewelry>(); } if (_weapon == null && weaponD != null) { _weapon = weaponD.gameObject.AddComponent <SDWeapon>(); } }
public void Steel_Medium_Masterwork() { // Arrange var armor = new Breastplate(SizeCategory.Medium, BreastplateMaterial.Steel) { IsMasterwork = true }; // Assert Assert.IsTrue(armor.IsMasterwork); Assert.IsTrue(armor.MasterworkIsToggleable); Assert.AreEqual(3, armor.ArmorCheckPenalty()); Assert.AreEqual(350, armor.GetMarketPrice()); Assert.AreEqual("Masterwork Breastplate", armor.ToString()); }
public void Adamantine_Small_Default() { // Arrange var armor = new Breastplate(SizeCategory.Small, BreastplateMaterial.Adamantine); // Assert Assert.IsTrue(armor.IsMasterwork); Assert.IsFalse(armor.MasterworkIsToggleable); Assert.AreEqual(6, armor.GetArmorBonus()); Assert.AreEqual(3, armor.ArmorCheckPenalty()); Assert.AreEqual(3, armor.MaximumDexterityBonus()); Assert.AreEqual(10_200, armor.GetMarketPrice()); Assert.AreEqual(15, armor.GetWeight()); Assert.AreEqual(0.25, armor.SpeedPenalty); Assert.AreEqual("Adamantine Breastplate", armor.ToString()); }
public void Steel_Large() { // Arrange var armor = new Breastplate(SizeCategory.Large, BreastplateMaterial.Steel); // Assert Assert.IsFalse(armor.IsMasterwork); Assert.IsTrue(armor.MasterworkIsToggleable); Assert.AreEqual(6, armor.GetArmorBonus()); Assert.AreEqual(4, armor.ArmorCheckPenalty()); Assert.AreEqual(3, armor.MaximumDexterityBonus()); Assert.AreEqual(400, armor.GetMarketPrice()); Assert.AreEqual(60, armor.GetWeight()); Assert.AreEqual(.25, armor.SpeedPenalty); Assert.AreEqual("Breastplate", armor.ToString()); }
public void Dragonhide_Large() { // Arrange var armor = new Breastplate(SizeCategory.Large, DragonhideColor.Red); // Assert Assert.IsTrue(armor.IsMasterwork); Assert.IsFalse(armor.MasterworkIsToggleable); Assert.AreEqual(3, armor.ArmorCheckPenalty()); Assert.AreEqual(3, armor.MaximumDexterityBonus()); Assert.AreEqual(.25, armor.SpeedPenalty); Assert.AreEqual(60, armor.GetWeight()); Assert.AreEqual(1100, armor.MundaneMarketPrice()); Assert.AreEqual(Dragonhide.Hardness, armor.Hardness.MaterialHardness); Assert.AreEqual("Red Dragonhide Breastplate", armor.ToString()); }
public void Mithral_Medium() { // Arrange var armor = new Breastplate(SizeCategory.Medium, BreastplateMaterial.Mithral); // Assert Assert.IsTrue(armor.IsMasterwork); Assert.IsFalse(armor.MasterworkIsToggleable); Assert.AreEqual(6, armor.GetArmorBonus()); Assert.AreEqual(1, armor.ArmorCheckPenalty()); Assert.AreEqual(5, armor.MaximumDexterityBonus()); Assert.AreEqual(4200, armor.GetMarketPrice()); Assert.AreEqual(15, armor.GetWeight()); Assert.AreEqual(0, armor.SpeedPenalty); Assert.AreEqual("Mithral Breastplate", armor.ToString()); }
public void Adamantine_ApplyTo_DamageReduction() { // Arrange var damageReductionTracker = Mock.Of <IDamageReductionTracker>(); var mockCharacter = new Mock <ICharacter>(); mockCharacter.Setup(c => c.DamageReduction) .Returns(damageReductionTracker); var armor = new Breastplate(SizeCategory.Medium, BreastplateMaterial.Adamantine); // Act armor.ApplyTo(mockCharacter.Object); // Assert Mock.Get(damageReductionTracker) .Verify(drt => drt.Add(It.Is <Func <byte> >(calc => 2 == calc()), It.Is <String>(bpb => "—" == bpb)), "Equipping an adamantine breastplate should bestow DR 2/— on the character wearing it."); }