public override string ToString() { return(string.Format("{0} ({1}{2}DMG: {3}{4}, {5}x on Crit{6}){7}", this.Name, (FiringType != string.Empty ? string.Format("{0} ", FiringType) : string.Empty), (Range > 0d ? string.Format("Rng: {0} ", Range.ToString()) : string.Empty), WeaponDamage.ToString(), (DamageType != string.Empty ? string.Format(" - ({0})", DamageType) : string.Empty), CritMultiplier.ToString(), ReloadTime > 0 ? (currentReload > 0 ? string.Format(", Reloading: {0}/{1}", currentReload, ReloadTime) : string.Format(", {0} Reload", ReloadTime.ToString())) : "", IsDestroyed ? " [DESTROYED!]" : "" )); }
public void WriteXML(XmlWriter xmlWriter) { xmlWriter.WriteStartElement("Attack"); xmlWriter.WriteStartElement("Name"); xmlWriter.WriteString(Name); xmlWriter.WriteEndElement(); xmlWriter.WriteStartElement("Modifier"); xmlWriter.WriteString(Modifier.ToString()); xmlWriter.WriteEndElement(); xmlWriter.WriteStartElement("Type"); xmlWriter.WriteString(Methods.GetAttackTypeString(Type)); xmlWriter.WriteEndElement(); xmlWriter.WriteStartElement("Ability"); xmlWriter.WriteString(Methods.GetAbilityString(Ability)); xmlWriter.WriteEndElement(); xmlWriter.WriteStartElement("Damages"); foreach (Damage damage in Damages) { damage.WriteXML(xmlWriter); } xmlWriter.WriteEndElement(); xmlWriter.WriteStartElement("ThreatRangeMin"); xmlWriter.WriteString(ThreatRangeMin.ToString()); xmlWriter.WriteEndElement(); xmlWriter.WriteStartElement("CritMultiplier"); xmlWriter.WriteString(CritMultiplier.ToString()); xmlWriter.WriteEndElement(); xmlWriter.WriteStartElement("TwoHanded"); xmlWriter.WriteString(TwoHanded.ToString()); xmlWriter.WriteEndElement(); xmlWriter.WriteEndElement(); }