private bool ForceEventActive(SpecialEventType eventType) { if (!ApplicationMgr.IsInternal()) { return(false); } if (this.m_forcedActiveEvents == null) { this.m_forcedActiveEvents = new HashSet <SpecialEventType>(); string str = Vars.Key("Events.ForceActive").GetStr(null); if (string.IsNullOrEmpty(str)) { return(false); } char[] separator = new char[] { ' ', ',', ';' }; string[] strArray = str.Split(separator, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < strArray.Length; i++) { SpecialEventType type; if (EnumUtils.TryGetEnum <SpecialEventType>(strArray[i], StringComparison.OrdinalIgnoreCase, out type)) { this.m_forcedActiveEvents.Add(type); } } } return(this.m_forcedActiveEvents.Contains(eventType)); }
public SpecialEvent(SpecialEventType type, int price, int occurrence, bool messageOnly) { _type = type; _price = price; _occurrence = occurrence; _messageOnly = messageOnly; }
public bool HasEventEnded(SpecialEventType eventType) { if (this.ForceEventActive(eventType)) { return(false); } return(!this.m_eventTimings.ContainsKey(eventType) || this.m_eventTimings[eventType].HasEnded()); }
public DateTime?GetEventLocalStartTime(SpecialEventType eventType) { if (!this.m_eventTimings.ContainsKey(eventType)) { return(null); } return(this.m_eventTimings[eventType].StartTime); }
private void GetGraphLineSettings(SpecialEventType EventType, out bool ShowLine, out bool ShowImage, out Color LineColor, out Image DrawnImage) { switch (EventType) { case SpecialEventType.Blink: { ShowLine = Settings.p_GraphBlinkLineShow; ShowImage = Settings.p_GraphBlinkImageShow && Settings.p_GraphBlinkImage != null; LineColor = Settings.p_GraphBlinkLineColor; DrawnImage = Settings.p_GraphBlinkImage; break; } case SpecialEventType.Pickup: { ShowLine = Settings.p_GraphPickupLineShow; ShowImage = Settings.p_GraphPickupImageShow && Settings.p_GraphPickupImage != null; LineColor = Settings.p_GraphPickupLineColor; DrawnImage = Settings.p_GraphPickupImage; break; } case SpecialEventType.Drink: { ShowLine = Settings.p_GraphDrinkLineShow; ShowImage = Settings.p_GraphDrinkImageShow && Settings.p_GraphDrinkImage != null; LineColor = Settings.p_GraphDrinkLineColor; DrawnImage = Settings.p_GraphDrinkImage; break; } case SpecialEventType.Split: { ShowLine = Settings.p_GraphSplitLineShow; ShowImage = Settings.p_GraphSplitImageShow && Settings.p_GraphSplitImage != null; LineColor = Settings.p_GraphSplitLineColor; DrawnImage = Settings.p_GraphSplitImage; break; } case SpecialEventType.Load: { ShowLine = Settings.p_GraphLoadLineShow; ShowImage = Settings.p_GraphLoadImageShow && Settings.p_GraphLoadImage != null; LineColor = Settings.p_GraphLoadLineColor; DrawnImage = Settings.p_GraphLoadImage; break; } default: { ShowLine = ShowImage = false; LineColor = Color.Transparent; DrawnImage = null; break; } } }
public bool IsEventActive(SpecialEventType eventType, bool activeIfDoesNotExist) { if (this.ForceEventActive(eventType)) { return(true); } if (!this.m_eventTimings.ContainsKey(eventType)) { return(activeIfDoesNotExist); } return(this.m_eventTimings[eventType].IsActiveNow()); }
private SpecialEvent GetSpecialEvent(ref int i, SpecialEventType Type) { while (i >= 0) { var Event = SpecialEvents[i--]; if (Event.Type == Type) { return(Event); } } return(new SpecialEvent(SpecialEventType.Empty, -1)); }
public bool LoadEvent(SpecialEventType eventType) { for (int i = 0; i < this.m_EventDefs.Count; i++) { SpecialEventVisualDef def = this.m_EventDefs[i]; if (def.m_EventType == eventType) { string name = FileUtils.GameAssetPathToName(def.m_Prefab); AssetLoader.Get().LoadGameObject(name, null, null, false); return(true); } } return(false); }
public bool UnloadEvent(SpecialEventType eventType) { for (int i = 0; i < this.m_EventDefs.Count; i++) { SpecialEventVisualDef def = this.m_EventDefs[i]; if (def.m_EventType == eventType) { GameObject obj2 = GameObject.Find(FileUtils.GameAssetPathToName(def.m_Prefab + "(Clone)")); if (obj2 != null) { UnityEngine.Object.Destroy(obj2); } } } return(false); }
public FormTest() { InitializeComponent(); for (AlertType type = AlertType.Alert; type <= AlertType.WildWontStayAboardReactor; type++) { selAlertType.Items.Add(type); } selAlertType.SelectedIndex = 0; for (SpecialEventType type = SpecialEventType.Artifact; type < SpecialEventType.WildGetsOut; type++) { selSpecialEvent.Items.Add(type); } selSpecialEvent.SelectedIndex = 0; }
public StarSystem(Hashtable hash) : base(hash) { _id = (StarSystemId)GetValueFromHash(hash, "_id", _id); _x = (int)GetValueFromHash(hash, "_x", _x); _y = (int)GetValueFromHash(hash, "_y", _y); _size = (Size)GetValueFromHash(hash, "_size", _size); _techLevel = (TechLevel)GetValueFromHash(hash, "_techLevel", _techLevel); _politicalSystemType = (PoliticalSystemType)GetValueFromHash(hash, "_politicalSystemType", _politicalSystemType); _systemPressure = (SystemPressure)GetValueFromHash(hash, "_systemPressure", _systemPressure); _specialResource = (SpecialResource)GetValueFromHash(hash, "_specialResource", _specialResource); _specialEventType = (SpecialEventType)GetValueFromHash(hash, "_specialEventType", _specialEventType); _tradeItems = (int[])GetValueFromHash(hash, "_tradeItems", _tradeItems); _countDown = (int)GetValueFromHash(hash, "_countDown", _countDown); _visited = (bool)GetValueFromHash(hash, "_visited", _visited); _shipyardId = (ShipyardId)GetValueFromHash(hash, "_shipyardId", _shipyardId); }
public Achievement(int id, bool enabled, Group achieveGroup, int maxProgress, Trigger trigger, TAG_RACE?raceReq, TAG_CLASS?classReq, TAG_CARD_SET?cardSetReq, ClickTriggerType?clickType, SpecialEventType eventTrigger, UnlockableFeature?unlockedFeature, List <RewardData> rewards, RewardVisualTiming rewardTiming) { this.m_id = id; this.m_enabled = enabled; this.m_group = achieveGroup; this.m_maxProgress = maxProgress; this.m_trigger = trigger; this.m_raceReq = raceReq; this.m_classReq = classReq; this.m_cardSetReq = cardSetReq; this.m_clickType = clickType; this.m_eventTrigger = eventTrigger; this.SetRewards(rewards); this.m_unlockedFeature = unlockedFeature; this.m_rewardTiming = rewardTiming; this.m_progress = 0; this.m_ackProgress = NEW_ACHIEVE_ACK_PROGRESS; this.m_completionCount = 0; this.m_active = false; this.m_dateGiven = 0L; this.m_dateCompleted = 0L; }
private bool FindDistantSystem(StarSystemId baseSystem, SpecialEventType specEvent) { int bestDistance = 999; int system = -1; for (int i = 0; i < Universe.Length; i++) { int distance = Functions.Distance(Universe[(int)baseSystem], Universe[i]); if (distance >= 70 && distance < bestDistance && Universe[i].SpecialEventType == SpecialEventType.Na) { system = i; bestDistance = distance; } } if (system >= 0) Universe[system].SpecialEventType = specEvent; return (system >= 0); }
public bool IsEventActive(SpecialEventType eventType, bool activeIfDoesNotExist) { Class272.Enum20[] enumArray1 = new Class272.Enum20[] { Class272.Enum20.ValueType, Class272.Enum20.Boolean }; object[] objArray1 = new object[] { eventType, activeIfDoesNotExist }; return(base.method_10 <bool>("IsEventActive", enumArray1, objArray1)); }
public bool HasEventStarted(SpecialEventType eventType) { object[] objArray1 = new object[] { eventType }; return(base.method_11 <bool>("HasEventStarted", objArray1)); }
public bool ForceEventActive(SpecialEventType eventType) { object[] objArray1 = new object[] { eventType }; return(base.method_11 <bool>("ForceEventActive", objArray1)); }
public bool UnloadEvent(SpecialEventType eventType) { object[] objArray1 = new object[] { eventType }; return(base.method_11 <bool>("UnloadEvent", objArray1)); }
private SpecialEvent GetSpecialEvent(ref int i,SpecialEventType Type){ while(i >= 0){ var Event = SpecialEvents[i--]; if(Event.Type == Type) return Event; } return new SpecialEvent(SpecialEventType.Empty,-1); }
public SpecialEvent(SpecialEventType Type,int Time,int Length = 0){ this.Type = Type; this.Time = Time; this.Length = Length; }
public bool HasActiveAchievesForEvent(SpecialEventType eventTrigger) { object[] objArray1 = new object[] { eventTrigger }; return(base.method_11 <bool>("HasActiveAchievesForEvent", objArray1)); }
public SpecialEvent(SpecialEventType type, int price, int occurrence, bool messageOnly) { Type = type; Price = price; Occurrence = occurrence; MessageOnly = messageOnly; }
public bool IsWingOpen(int wing) { SpecialEventType wingOpenEvent = this.GetWingOpenEvent(wing); return(SpecialEventManager.Get().IsEventActive(wingOpenEvent, false)); }
private void GetGraphLineSettings(SpecialEventType EventType, out bool ShowLine,out bool ShowImage,out Color LineColor,out Image DrawnImage){ switch(EventType){ case SpecialEventType.Blink: { ShowLine = Settings.p_GraphBlinkLineShow; ShowImage = Settings.p_GraphBlinkImageShow && Settings.p_GraphBlinkImage != null; LineColor = Settings.p_GraphBlinkLineColor; DrawnImage = Settings.p_GraphBlinkImage; break; } case SpecialEventType.Pickup: { ShowLine = Settings.p_GraphPickupLineShow; ShowImage = Settings.p_GraphPickupImageShow && Settings.p_GraphPickupImage != null; LineColor = Settings.p_GraphPickupLineColor; DrawnImage = Settings.p_GraphPickupImage; break; } case SpecialEventType.Drink: { ShowLine = Settings.p_GraphDrinkLineShow; ShowImage = Settings.p_GraphDrinkImageShow && Settings.p_GraphDrinkImage != null; LineColor = Settings.p_GraphDrinkLineColor; DrawnImage = Settings.p_GraphDrinkImage; break; } case SpecialEventType.Split: { ShowLine = Settings.p_GraphSplitLineShow; ShowImage = Settings.p_GraphSplitImageShow && Settings.p_GraphSplitImage != null; LineColor = Settings.p_GraphSplitLineColor; DrawnImage = Settings.p_GraphSplitImage; break; } case SpecialEventType.Load: { ShowLine = Settings.p_GraphLoadLineShow; ShowImage = Settings.p_GraphLoadImageShow && Settings.p_GraphLoadImage != null; LineColor = Settings.p_GraphLoadLineColor; DrawnImage = Settings.p_GraphLoadImage; break; } default: { ShowLine = ShowImage = false; LineColor = Color.Transparent; DrawnImage = null; break; } } }
public SpecialEvent(SpecialEventType Type, int Time, int Length = 0) { this.Type = Type; this.Time = Time; this.Length = Length; }