Пример #1
0
 public void ReadXML(XmlNode xmlNode)
 {
     try
     {
         foreach (XmlNode childNode in xmlNode.ChildNodes)
         {
             if (childNode.Name == "NumDice")
             {
                 NumDice = Convert.ToInt32(childNode.InnerText);
             }
             else if (childNode.Name == "Die")
             {
                 Die = Methods.GetDieTypeFromString(childNode.InnerText);
             }
             else if (childNode.Name == "Modifier")
             {
                 Modifier = Convert.ToInt32(childNode.InnerText);
             }
             else if (childNode.Name == "DamageDescriptorSet")
             {
                 DamageDescriptorSet = new DamageDescriptorSet(childNode);
             }
         }
     }
     catch (XmlException e)
     {
         MessageBox.Show(e.ToString());
     }
 }
Пример #2
0
 public CreatureAttributes()
 {
     Type                 = Types.Creature.Humanoid;
     ChallengeRating      = 1;
     AttackSets           = new FullyObservableCollection <AttackSet>();
     Strength             = 10;
     Dexterity            = 10;
     Constitution         = 10;
     Intelligence         = 10;
     Wisdom               = 10;
     Charisma             = 10;
     BaseAttackBonus      = 0;
     GrappleModifier      = 0;
     HitPoints            = 3;
     HitDice              = 1;
     HitDieType           = Types.Die.d3;
     ArmorClass           = 10;
     TouchArmorClass      = 10;
     FlatFootedArmorClass = 10;
     Speed                = new SpeedSet(30);
     FortitudeSave        = 0;
     ReflexSave           = 0;
     WillSave             = 0;
     Feats                = new List <string>();
     Space                = 5;
     Reach                = 5;
     Size                 = Types.Size.Medium;
     DamageReductions     = new ObservableCollection <DamageReduction>();
     Immunities           = new DamageDescriptorSet();
     EnergyResistances    = new ObservableCollection <EnergyResistance>();
     SpellResistance      = 0;
     FastHealing          = 0;
     SpecialAttacks       = "";
     SpecialQualities     = new List <string>();
 }
Пример #3
0
        public bool IsBypassedBy(DamageDescriptorSet damage)
        {
            bool bypassed = true;

            if (!damage.IsEnergyDamage())
            {
                foreach (Types.Damage drDamageType in DamageTypes.ToList())
                {
                    bool matched = damage.Contains(drDamageType);

                    // If none of the weapon's damage qualities match this part of the damage type, then
                    if (!matched)
                    {
                        bypassed = false;
                        break;
                    }
                }
            }
            return(bypassed);
        }
Пример #4
0
 public void ReadXML(XmlNode xmlNode)
 {
     try
     {
         foreach (XmlNode childNode in xmlNode.ChildNodes)
         {
             if (childNode.Name == "Value")
             {
                 Value = Convert.ToInt32(childNode.InnerText);
             }
             else if (childNode.Name == "DamageDescriptorSet")
             {
                 DamageTypes = new DamageDescriptorSet();
                 DamageTypes.ReadXML(childNode);
             }
         }
     }
     catch (XmlException e)
     {
         MessageBox.Show(e.ToString());
     }
 }
Пример #5
0
 public DamageReduction(DamageReduction other)
 {
     _value      = other._value;
     DamageTypes = new DamageDescriptorSet(other.DamageTypes);
 }
Пример #6
0
 public DamageReduction()
 {
     _types = new DamageDescriptorSet();
 }
Пример #7
0
 public Damage(Damage other)
 {
     DamageDescriptorSet = new DamageDescriptorSet(other.DamageDescriptorSet);
 }
Пример #8
0
 public Damage()
 {
     _damageDescriptorSet = new DamageDescriptorSet();
 }
Пример #9
0
 public DamageSet(DamageSet other)
 {
     Amount = other.Amount;
     DamageDescriptorSet = new DamageDescriptorSet(other.DamageDescriptorSet);
 }
Пример #10
0
 public DamageSet(int amount, DamageDescriptorSet damageDescriptorSet)
 {
     _amount = amount;
     _damageDescriptorSet = damageDescriptorSet;
 }
Пример #11
0
 public DamageDescriptorSet(DamageDescriptorSet other)
 {
     _descriptors = new HashSet <Types.Damage>(other._descriptors);
 }