Exemplo n.º 1
0
 public void ArmorConstrucotorReturnsMaxDex2()
 {
     Armor = new Armor(1, 2, 3, 4, 5, 6.0, 7.00m, "name");
     int actual = Armor.MaxDexBonus;
     int expect = 2;
     Assert.AreEqual(expect, actual);
 }
Exemplo n.º 2
0
 public void ArmorConstrucotorReturnsACpenaltyReturn3()
 {
     Armor = new Armor(1, 2, 3, 4, 5, 6.0, 7.00m, "name");
     int actual = Armor.ArmorCheckPenalty;
     int expect = 3;
     Assert.AreEqual(expect, actual);
 }
Exemplo n.º 3
0
 public void ArmorConstrucotorReturnsCost6()
 {
     Armor = new Armor(1, 2, 3, 4, 5, 6.0, 7.00m, "name");
     double actual = Armor.Cost;
     double expect = 6.0;
     Assert.AreEqual(expect, actual);
 }
Exemplo n.º 4
0
 public void ArmorConstrucotorReturnsSpellFailure4()
 {
     Armor = new Armor(1, 2, 3, 4, 5, 6.0, 7.00m, "name");
     int actual = Armor.ArcaneSpellFailure;
     int expect = 4;
     Assert.AreEqual(expect, actual);
 }
Exemplo n.º 5
0
 public void ArmorConstrucotorReturnsSpeedReturns5()
 {
     Armor = new Armor(1, 2, 3, 4, 5, 6.0, 7.00m, "name");
     int actual = Armor.Speed;
     int expect = 5;
     Assert.AreEqual(expect, actual);
 }
Exemplo n.º 6
0
 public void SetupArmor()
 {
     Armor armor = new Armor();
     Armor = armor;
 }
Exemplo n.º 7
0
 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);
 }
Exemplo n.º 8
0
        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);
            }
        }
Exemplo n.º 9
0
 public void ArmorConstrucotorReturnsWeight700M()
 {
     Armor = new Armor(1, 2, 3, 4, 5, 6.0, 7.00m, "name");
     decimal actual = Armor.Weight;
     decimal expect = 7.00m;
     Assert.AreEqual(expect, actual);
 }
Exemplo n.º 10
0
        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);
            }
        }
Exemplo n.º 11
0
        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);
        }
Exemplo n.º 12
0
        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();
            }
        }
Exemplo n.º 13
0
 private void armorComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     Armor armor = new Armor();
     DisplayArmor((armor.BuildArmor(armorComboBox.SelectedItem.ToString())));
 }
Exemplo n.º 14
0
 public void DisplayArmor(Armor armor)
 {
     armorArmorBonusTextBox.Text = armor.ArmorBonus.ToString();
     armorMaxDexBonusTextBox.Text = armor.MaxDexBonus.ToString();
     armorArmorCheckPenaltyTextBox.Text = armor.ArmorCheckPenalty.ToString();
     armorCheckPenaltyTextBox.Text = armor.ArmorCheckPenalty.ToString();
     armorArcaneSpellFailureTextBox.Text = armor.ArcaneSpellFailure.ToString();
     armorSpeedTextBox.Text = armor.Speed.ToString();
     costArmorTextBox.Text = armor.Cost.ToString();
     armorWeightTextBox.Text = armor.Weight.ToString();
 }