public void WriteXmlDigest(System.Xml.XmlWriter writer, FFTPatch FFTPatch) { if (HasChanged) { writer.WriteStartElement(GetType().Name); writer.WriteAttributeString("changed", HasChanged.ToString()); foreach (Item i in Items) { if (i.HasChanged) { writer.WriteStartElement(i.GetType().Name); writer.WriteAttributeString("name", i.Name); DigestGenerator.WriteXmlDigest(i, writer, false, false); if (i is Weapon) { Weapon w = i as Weapon; if (w.Formula.Value == 0x02 && (w.Formula.Value != w.WeaponDefault.Formula.Value || w.InflictStatus != w.WeaponDefault.InflictStatus)) { writer.WriteStartElement("CastSpell"); writer.WriteAttributeString("default", AllAbilities.GetNames(FFTPatch.Context)[w.WeaponDefault.InflictStatus]); writer.WriteAttributeString("value", AllAbilities.GetNames(FFTPatch.Context)[w.InflictStatus]); writer.WriteEndElement(); } else if (w.InflictStatus != w.WeaponDefault.InflictStatus) { writer.WriteStartElement("InflictStatusDescription"); writer.WriteAttributeString("default", FFTPatch.InflictStatuses.InflictStatuses[w.WeaponDefault.InflictStatus].Statuses.ToString()); writer.WriteAttributeString("value", FFTPatch.InflictStatuses.InflictStatuses[w.InflictStatus].Statuses.ToString()); writer.WriteEndElement(); } } writer.WriteEndElement(); } } writer.WriteEndElement(); } }
public void WriteXmlDigest(XmlWriter writer, FFTPatch FFTPatch) { if (HasChanged) { writer.WriteStartElement(GetType().Name); writer.WriteAttributeString("value", Offset.ToString("X4")); writer.WriteAttributeString("name", Name); DigestGenerator.WriteXmlDigest(this, writer, false, false); DigestGenerator.WriteXmlDigest(AIFlags, writer, true, true); if (Effect != null && Default.Effect != null) { DigestGenerator.WriteDigestEntry(writer, "Effect", Default.Effect, Effect); } if (IsNormal) { DigestGenerator.WriteXmlDigest(Attributes, writer, true, true); if (Attributes.Formula.Value == 0x02 && (Attributes.Formula.Value != Attributes.Default.Formula.Value || Attributes.InflictStatus != Attributes.Default.InflictStatus)) { writer.WriteStartElement("CastSpell"); writer.WriteAttributeString("default", AllAbilities.GetNames(FFTPatch.Context)[Attributes.Default.InflictStatus]); writer.WriteAttributeString("value", AllAbilities.GetNames(FFTPatch.Context)[Attributes.InflictStatus]); writer.WriteEndElement(); } else if (Attributes.InflictStatus != Attributes.Default.InflictStatus) { writer.WriteStartElement("InflictStatusDescription"); writer.WriteAttributeString("default", FFTPatch.InflictStatuses.InflictStatuses[Attributes.Default.InflictStatus].Statuses.ToString()); writer.WriteAttributeString("value", FFTPatch.InflictStatuses.InflictStatuses[Attributes.InflictStatus].Statuses.ToString()); writer.WriteEndElement(); } } else if (IsItem) { DigestGenerator.WriteDigestEntry(writer, "ItemOffset", Default.ItemOffset, ItemOffset, "0x{0:X2}"); } else if (IsThrowing) { DigestGenerator.WriteDigestEntry(writer, "Throwing", Default.Throwing, Throwing); } else if (IsJumping) { DigestGenerator.WriteDigestEntry(writer, "JumpHorizontal", Default.JumpHorizontal, JumpHorizontal); DigestGenerator.WriteDigestEntry(writer, "JumpVertical", Default.JumpVertical, JumpVertical); } else if (IsCharging) { DigestGenerator.WriteDigestEntry(writer, "ChargeCT", Default.ChargeCT, ChargeCT); DigestGenerator.WriteDigestEntry(writer, "ChargeBonus", Default.ChargeBonus, ChargeBonus); } else if (IsArithmetick) { DigestGenerator.WriteDigestEntry(writer, "ArithmetickSkill", Default.ArithmetickSkill, ArithmetickSkill, "0x{0:X2}"); } else if (IsOther) { DigestGenerator.WriteDigestEntry(writer, "OtherID", Default.OtherID, OtherID, "0x{0:X2}"); } writer.WriteEndElement(); } }