public static void FactionTownReset_OnCommand(CommandEventArgs e) { MonolithCollection monoliths = BaseMonolith.Monoliths; for (int i = 0; i < monoliths.Count; ++i) { monoliths[i].Sigil = null; } TownCollection towns = Town.Towns; for (int i = 0; i < towns.Count; ++i) { towns[i].Silver = 0; towns[i].Sheriff = null; towns[i].Finance = null; towns[i].Tax = 0; towns[i].Owner = null; } SigilCollection sigils = Sigil.Sigils; for (int i = 0; i < sigils.Count; ++i) { sigils[i].Corrupted = null; sigils[i].Corrupting = null; sigils[i].LastStolen = DateTime.MinValue; sigils[i].GraceStart = DateTime.MinValue; sigils[i].CorruptionStart = DateTime.MinValue; sigils[i].PurificationStart = DateTime.MinValue; sigils[i].LastMonolith = null; sigils[i].ReturnHome(); } FactionCollection factions = Faction.Factions; for (int i = 0; i < factions.Count; ++i) { Faction f = factions[i]; ArrayList list = new ArrayList(f.State.FactionItems); for (int j = 0; j < list.Count; ++j) { FactionItem fi = (FactionItem)list[j]; if (fi.Expiration == DateTime.MinValue) { fi.Item.Delete(); } else { fi.Detach(); } } } }
public static void ProcessTick() { SigilCollection sigils = Sigil.Sigils; for (int i = 0; i < sigils.Count; ++i) { Sigil sigil = sigils[i]; if (!sigil.IsBeingCorrupted && sigil.GraceStart != DateTime.MinValue && (sigil.GraceStart + Sigil.CorruptionGrace) < DateTime.Now) { if (sigil.LastMonolith is StrongholdMonolith && (sigil.Corrupted == null || sigil.LastMonolith.Faction != sigil.Corrupted)) { sigil.Corrupting = sigil.LastMonolith.Faction; sigil.CorruptionStart = DateTime.Now; } else { sigil.Corrupting = null; sigil.CorruptionStart = DateTime.MinValue; } sigil.GraceStart = DateTime.MinValue; } if (sigil.LastMonolith == null || sigil.LastMonolith.Sigil == null) { if ((sigil.LastStolen + Sigil.ReturnPeriod) < DateTime.Now) { sigil.ReturnHome(); } } else { if (sigil.IsBeingCorrupted && (sigil.CorruptionStart + Sigil.CorruptionPeriod) < DateTime.Now) { sigil.Corrupted = sigil.Corrupting; sigil.Corrupting = null; sigil.CorruptionStart = DateTime.MinValue; sigil.GraceStart = DateTime.MinValue; } else if (sigil.IsPurifying && (sigil.PurificationStart + Sigil.PurificationPeriod) < DateTime.Now) { sigil.PurificationStart = DateTime.MinValue; sigil.Corrupted = null; sigil.Corrupting = null; sigil.CorruptionStart = DateTime.MinValue; sigil.GraceStart = DateTime.MinValue; } } } }
/// <summary> /// Default constructor for enumerator. /// </summary> /// <param name="collection">Instance of the collection to enumerate.</param> internal SigilCollectionEnumerator(SigilCollection collection) { _index = -1; _collection = collection; }