Esempio n. 1
0
        public override void ReadAttributesXML(XmlNode xmlNode)
        {
            bool readBase     = false;
            bool readModified = false;

            try
            {
                foreach (XmlNode childNode in xmlNode.ChildNodes)
                {
                    if (childNode.Name == "BaseAttributes")
                    {
                        BaseAttributes.ReadXML(childNode.ChildNodes[0]);
                        readBase = true;
                    }
                    else if (childNode.Name == "ModifiedAttributes")
                    {
                        ModifiedAttributes.ReadXML(childNode.ChildNodes[0]);
                        readModified = true;
                    }
                }
            }
            catch (XmlException e)
            {
                MessageBox.Show(e.ToString());
            }

            if (readBase && !readModified)
            {
                ModifiedAttributes = new CreatureAttributes(BaseAttributes);
            }
        }
Esempio n. 2
0
 public Creature(CreatureAttributes attributes)
     : base(attributes)
 {
     BaseAttributes            = attributes.Clone();
     ModifiedAttributes        = attributes.Clone();
     _usedAttacksOfOpportunity = 0;
 }
Esempio n. 3
0
        public new CreatureAttributes GetEffectiveAttributes()
        {
            CreatureAttributes effectiveAttributes = ModifiedAttributes.Clone();

            foreach (Effect.Effect effect in Effects)
            {
                if (!effect.PerTurn)
                {
                    effect.ApplyTo(effectiveAttributes, BaseAttributes);
                }
            }
            return(effectiveAttributes);
        }
Esempio n. 4
0
        public Hit(List <int> damages, Weapon weapon, CreatureAttributes creatureAttributes)
        {
            _damageSets         = new List <DamageSet>();
            _weapon             = weapon;
            _creatureAttributes = creatureAttributes;

            for (int d = 0; d < damages.Count; ++d)
            {
                // If there is a corresponding descriptor set
                if (weapon.DamageDescriptorSets.Count > d)
                {
                    _damageSets.Add(new DamageSet(damages[d], weapon.DamageDescriptorSets[d]));
                }
            }
        }
Esempio n. 5
0
 public CreatureAttributes(CreatureAttributes other)
     : base(other)
 {
     Type                 = other._type;
     ChallengeRating      = other._challengeRating;
     AttackSets           = other.AttackSets.Clone();
     Strength             = other.Strength;
     Dexterity            = other.Dexterity;
     Constitution         = other.Constitution;
     Intelligence         = other.Intelligence;
     Wisdom               = other.Wisdom;
     Charisma             = other.Charisma;
     BaseAttackBonus      = other.BaseAttackBonus;
     GrappleModifier      = other.GrappleModifier;
     HitPoints            = other.HitPoints;
     HitDice              = other.HitDice;
     HitDieType           = other.HitDieType;
     ArmorClass           = other.ArmorClass;
     TouchArmorClass      = other.TouchArmorClass;
     FlatFootedArmorClass = other.FlatFootedArmorClass;
     Speed                = other.Speed.Clone();
     FortitudeSave        = other.FortitudeSave;
     ReflexSave           = other.ReflexSave;
     WillSave             = other.WillSave;
     Feats                = other.Feats.Clone();
     Space                = other.Space;
     Reach                = other.Reach;
     Size                 = other.Size;
     DamageReductions     = other.DamageReductions.Clone();
     Immunities           = other.Immunities.Clone();
     EnergyResistances    = other.EnergyResistances.Clone();
     SpellResistance      = other.SpellResistance;
     FastHealing          = FastHealing;
     SpecialAttacks       = other.SpecialAttacks;
     SpecialQualities     = other.SpecialQualities;
 }
Esempio n. 6
0
 public override int GetHitPointChange()
 {
     return(CreatureAttributes.CalculateHitPointChange(DamageSets));
 }
Esempio n. 7
0
 public Hit(CreatureAttributes creatureAttributes)
 {
     _damageSets         = new List <DamageSet>();
     _weapon             = new Weapon();
     _creatureAttributes = creatureAttributes;
 }