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); } }
public Creature(CreatureAttributes attributes) : base(attributes) { BaseAttributes = attributes.Clone(); ModifiedAttributes = attributes.Clone(); _usedAttacksOfOpportunity = 0; }
public new CreatureAttributes GetEffectiveAttributes() { CreatureAttributes effectiveAttributes = ModifiedAttributes.Clone(); foreach (Effect.Effect effect in Effects) { if (!effect.PerTurn) { effect.ApplyTo(effectiveAttributes, BaseAttributes); } } return(effectiveAttributes); }
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])); } } }
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; }
public override int GetHitPointChange() { return(CreatureAttributes.CalculateHitPointChange(DamageSets)); }
public Hit(CreatureAttributes creatureAttributes) { _damageSets = new List <DamageSet>(); _weapon = new Weapon(); _creatureAttributes = creatureAttributes; }