public void BuildArmorFullPlateReturnsFullPlate() { Armor armor = new Armor(); Armor fullPlate = armor.BuildArmor("Full plate"); string actual = fullPlate.Name; string expected = "Full plate"; Assert.AreEqual(expected, actual); }
private void removeButton_Click(object sender, EventArgs e) { Armor armor = new Armor(); Armor EquipArmor; if (armorComboBox.SelectedItem != null) { int acBonus; int.TryParse(aCBonusTextBox.Text, out acBonus); EquipArmor = armor.BuildArmor(armorComboBox.SelectedItem.ToString()); aCBonusTextBox.Text = (acBonus - EquipArmor.ArmorBonus).ToString(); dexACModifierTextBox.Text =Player.PlayerClass.StatMods.DexAbilityMod.ToString(); dexACModifierTextBox.ResetForeColor(); armorArmorCheckPenaltyTextBox.Clear(); armorArcaneSpellFailureTextBox.Clear(); CalculateTotalArmorClass(); UnassignACPenaltyToSkills(EquipArmor.ArmorCheckPenalty); } }
private void equipButton_Click(object sender, EventArgs e) { Armor armor = new Armor(); if (armorComboBox.SelectedItem != null) { Armor EquipArmor = armor.BuildArmor(armorComboBox.SelectedItem.ToString()); aCBonusTextBox.Text = EquipArmor.ArmorBonus.ToString(); if (Player.PlayerClass.StatMods.DexAbilityMod >= EquipArmor.MaxDexBonus) { dexACModifierTextBox.Text = EquipArmor.MaxDexBonus.ToString(); dexACModifierTextBox.ForeColor = Color.Red; } armorArmorCheckPenaltyTextBox.Text = EquipArmor.ArmorCheckPenalty.ToString(); armorArcaneSpellFailureTextBox.Text = EquipArmor.ArcaneSpellFailure.ToString(); CalculateTotalArmorClass(); AssignACPenaltyToSkills(EquipArmor.ArmorCheckPenalty); } }
private void removeArmorButton_Click(object sender, EventArgs e) { Armor armor = new Armor(); if (armorComboBox.SelectedItem != null) { Equipment removedArmor = armor.BuildArmor(goodsListBox.SelectedItem.ToString()); TotalWeight = TotalWeight - removedArmor.Weight; Player.PlayerClass.Gold = Player.PlayerClass.Gold + removedArmor.Cost; } DisplayLoadAndWeight(); goldTextBox.Text = Player.PlayerClass.Gold.ToString(); armorListBox.Items.Remove(armorListBox.SelectedItem); equipArmorListBox.Items.Remove(equipArmorListBox.SelectedItem); }
private void addArmorButton_Click(object sender, EventArgs e) { Armor armor = new Armor(); Armor shinyArmor = armor.BuildArmor(armorComboBox.SelectedItem.ToString()); DisplayArmor(shinyArmor); if ((armorComboBox.SelectedItem == null) || (!((Player.PlayerClass.Gold - shinyArmor.Cost) >= 0))) { MessageBox.Show(Broke); armorComboBox.ResetText(); } else { armorListBox.Items.Add(armorComboBox.Text); equipArmorListBox.Items.Add(armorComboBox.Text); TotalWeight = TotalWeight + shinyArmor.Weight; DisplayLoadAndWeight(); Player.PlayerClass.Gold = Player.PlayerClass.Gold - shinyArmor.Cost; goldTextBox.Text = Player.PlayerClass.Gold.ToString(); } }
private void armorComboBox_SelectedIndexChanged(object sender, EventArgs e) { Armor armor = new Armor(); DisplayArmor((armor.BuildArmor(armorComboBox.SelectedItem.ToString()))); }