Example #1
0
        /// <summary>
        /// Display input in text boxes and lists
        /// </summary>
        /// <param name="monsterToDisplay"></param>
        private void DisplayMonsterStats(Monster monsterToDisplay)
        {
            txtAC.Text    = monsterToDisplay.ArmorClass.ToString();
            txtDEX.Text   = monsterToDisplay.DexterityModifier.ToString();
            txtHP.Text    = monsterToDisplay.TotalHealth.ToString();
            txtName.Text  = monsterToDisplay.Name;
            txtPP.Text    = monsterToDisplay.PassivePerception.ToString();
            txtSpeed.Text = monsterToDisplay.PassivePerception.ToString();
            cmbMonsterTypes.SelectedValue = monsterToDisplay.Type;
            chkMultiattack.IsChecked      = monsterToDisplay.Multiattack;

            foreach (DamageType resistance in monsterToDisplay.Resistances)
            {
                lstResistances.Items.Add(resistance);
                Resistances.Add(resistance);
            }

            foreach (DamageType immunity in monsterToDisplay.Immunities)
            {
                lstImmunities.Items.Add(immunity);
                Immunities.Add(immunity);
            }

            foreach (Attack attack in monsterToDisplay.Attacks)
            {
                lstAttacks.Items.Add(attack);
                Attacks.Add(attack);
            }

            foreach (MonsterSpecial monsterSpecial in monsterToDisplay.MonsterSpecials)
            {
                lstMonsterSpecials.Items.Add(monsterSpecial);
                MonsterSpecials.Add(monsterSpecial);
            }
        }
Example #2
0
 public void AddImmunity(DamageTypes damageType)
 {
     Immunities.Add(damageType);
 }