/// <summary> /// Trigger OnActive WaveSetting from DataBlock /// </summary> /// <param name="node">Spawnnode</param> /// <param name="type">SpawnType</param> public void TriggerOnActiveWave(AIG_CourseNode node = null, SurvivalWaveSpawnType type = SurvivalWaveSpawnType.InRelationToClosestAlivePlayer) { if (WardenObjectiveManager.HasValidWaveSettings(ObjectiveData.WavesOnActivate)) { TriggerWave(ObjectiveData.WavesOnActivate, node, type); } }
public void ForceWin() { if (SNet.IsMaster) { WardenObjectiveManager.OnWinConditionSolved(LG_LayerType.MainLayer); } }
public void TriggerWave(Il2CppSystem.Collections.Generic.List <GenericEnemyWaveData> waveData, AIG_CourseNode node = null, SurvivalWaveSpawnType type = SurvivalWaveSpawnType.InRelationToClosestAlivePlayer) { if (node == null) { node = Builder.GetStartingArea().m_courseNode; } WardenObjectiveManager.TriggerEnemyWaves(waveData, node, type); }
public void SolvedObjectiveItem(iWardenObjectiveItem item) { if (Base.IsDefaultObjective) { WardenObjectiveManager.OnLocalPlayerSolvedObjectiveItem(Base.LayerType, item); } else { //TODO: Behaviour for Custom Objective } }
/// <summary> /// Stop All Wave /// </summary> public void StopAllWave() { WardenObjectiveManager.StopAllWardenObjectiveEnemyWaves(); }
public static bool Invoke(LG_WardenObjective_Reactor __instance) { float num1 = (1f - __instance.m_currentWaveProgress) * __instance.m_currentDuration; switch (__instance.m_currentState.status) { case eReactorStatus.Active_Idle: __instance.SetGUIMessage(false); break; case eReactorStatus.Startup_intro: __instance.SetGUIMessage(true, "REACTOR STARTUP TEST (" + (object)__instance.m_currentWaveCount + " of " + (object)__instance.m_waveCountMax + ") WARMING UP.. ", ePUIMessageStyle.Default); int num2 = (int)__instance.m_sound.SetRTPCValue(GAME_PARAMETERS.REACTOR_POWER, __instance.m_currentWaveProgress * 100f); if (!__instance.m_alarmCountdownPlayed && (double)num1 <= 10.0) { int num3 = (int)__instance.m_sound.Post(EVENTS.REACTOR_ALARM_COUNTDOWN); __instance.m_alarmCountdownPlayed = true; } if (!WardenObjectiveManager.ActiveWardenObjective(__instance.SpawnNode.LayerType).LightsOnDuringIntro) { float num3 = (float)((double)__instance.m_currentWaveProgress * (double)__instance.m_currentWaveProgress * 0.400000005960464 + 0.0500000007450581); __instance.UpdateLightCollection(true, true, true, 32f, 2f, num3, num3); break; } break; case eReactorStatus.Startup_intense: __instance.SetGUIMessage(true, "REACTOR PERFORMING HIGH INTENSITY TEST (" + (object)__instance.m_currentWaveCount + "/" + (object)__instance.m_waveCountMax + ")"); __instance.UpdateLightCollection(false, true, true, 32f, 2f); if (!__instance.m_alarmCountdownPlayed && (double)num1 <= 10.0) { int num3 = (int)__instance.m_sound.Post(EVENTS.REACTOR_ALARM_WARNING_3); __instance.m_alarmCountdownPlayed = true; break; } break; case eReactorStatus.Startup_waitForVerify: if (__instance.m_currentWaveData.HasVerificationTerminal) { __instance.SetGUIMessage(true, "VERIFICATION (" + (object)__instance.m_currentWaveCount + "/" + (object)__instance.m_waveCountMax + "). CODE REQUIRED FOR <color=orange>REACTOR_VERIFY</color> LOCATED IN LOG FILE IN <color=orange>" + __instance.m_currentWaveData.VerificationTerminalSerial + "</color>", ePUIMessageStyle.Warning, timerPrefix: "<size=125%>TIME UNTIL RESET: ", timerSuffix: "</size>"); } else { __instance.SetGUIMessage(true, "SECURITY VERIFICATION (" + (object)__instance.m_currentWaveCount + "/" + (object)__instance.m_waveCountMax + "). USE COMMAND <color=orange>REACTOR_VERIFY</color> AND CODE <color=orange>" + __instance.CurrentStateOverrideCode + "</color> BEFORE SAFETY RESET!", ePUIMessageStyle.Warning, timerPrefix: "<size=125%>TIME UNTIL RESET: ", timerSuffix: "</size>"); } __instance.m_lightCollection.UpdateRandomMode(100f); break; case eReactorStatus.Startup_complete: __instance.SetGUIMessage(true, "REACTOR STARTUP SEQUENCE COMPLETED", ePUIMessageStyle.Default, false); if (SNetwork.SNet.IsMaster && (double)Clock.Time > (double)__instance.m_objectiveCompleteTimer) { __instance.AttemptInteract(eReactorInteraction.Goto_active); WardenObjectiveManager.OnLocalPlayerSolvedObjectiveItem(__instance.SpawnNode.LayerType, __instance.TryCast <iWardenObjectiveItem>()); break; } break; case eReactorStatus.Shutdown_waitForVerify: __instance.SetGUIMessage(true, "SECURITY VERIFICATION REQUIRED. USE COMMAND <color=orange>REACTOR_VERIFY</color> AND CODE <color=orange>" + __instance.CurrentStateOverrideCode + "</color> TO VERIFY.", ePUIMessageStyle.Warning, false); break; case eReactorStatus.Shutdown_puzzleChaos: __instance.SetGUIMessage(false); break; case eReactorStatus.Shutdown_complete: if ((double)Clock.Time > (double)__instance.m_objectiveCompleteTimer) { if (!__instance.m_shutdownCompleteShown) { GuiManager.PlayerLayer.m_wardenIntel.ShowSubObjectiveMessage("", "REACTOR SHUTDOWN SEQUENCE COMPLETED"); __instance.m_shutdownCompleteShown = true; } if (SNetwork.SNet.IsMaster) { __instance.AttemptInteract(eReactorInteraction.Goto_inactive); WardenObjectiveManager.OnLocalPlayerSolvedObjectiveItem(__instance.SpawnNode.LayerType, __instance.TryCast <iWardenObjectiveItem>()); break; } break; } break; } if (!SNetwork.SNet.IsMaster) { return(false); } if (__instance.m_spawnEnemies && __instance.m_currentEnemyWaveIndex < __instance.m_currentWaveData.EnemyWaves.Count) { ReactorWaveEnemyData enemyWave = __instance.m_currentWaveData.EnemyWaves[__instance.m_currentEnemyWaveIndex]; if ((double)__instance.m_currentWaveProgress > (double)enemyWave.SpawnTimeRel) { Debug.Log(Deb.Enemy("Reactor Spawning wave at " + (object)enemyWave.SpawnTimeRel + " with type: " + (object)enemyWave.SpawnType)); if (Mastermind.Current.TryGetEvent(__instance.m_enemyWaveID, out Mastermind.MastermindEvent masterMindEvent)) { masterMindEvent.StopEvent(); } ushort m_enemyWaveID; switch (enemyWave.SpawnType) { case eReactorWaveSpawnType.ClosestToReactorNoPlayerBetween: if (Mastermind.Current.TriggerSurvivalWave(__instance.m_reactorArea.m_courseNode, enemyWave.WaveSettings, enemyWave.WavePopulation, out m_enemyWaveID, SurvivalWaveSpawnType.ClosestToSuppliedNodeButNoBetweenPlayers)) { __instance.m_enemyWaveID = m_enemyWaveID; } else { __instance.m_enemyWaveID = 0; } ++__instance.m_currentEnemyWaveIndex; break; case eReactorWaveSpawnType.InElevatorZone: if (Mastermind.Current.TriggerSurvivalWave(Builder.GetElevatorZone().m_courseNodes[0], enemyWave.WaveSettings, enemyWave.WavePopulation, out m_enemyWaveID, SurvivalWaveSpawnType.InSuppliedCourseNodeZone)) { __instance.m_enemyWaveID = m_enemyWaveID; } else { __instance.m_enemyWaveID = 0; } ++__instance.m_currentEnemyWaveIndex; break; } } } if (!__instance.m_progressUpdateEnabled) { return(false); } __instance.m_currentWaveProgress += Clock.Delta / __instance.m_currentDuration; __instance.AttemptInteract(eReactorInteraction.Update_stateProgress, __instance.m_currentWaveProgress); if ((double)__instance.m_currentWaveProgress < 1.0) { return(false); } Debug.Log("MASTER, startupStateProgress done, current status: " + __instance.m_currentState.status + " currennt count: " + __instance.m_currentWaveCount); switch (__instance.m_currentState.status) { case eReactorStatus.Startup_intro: __instance.AttemptInteract(eReactorInteraction.Intensify_startup, __instance.m_currentWaveProgress); break; case eReactorStatus.Startup_intense: __instance.AttemptInteract(eReactorInteraction.WaitForVerify_startup, __instance.m_currentWaveProgress); break; case eReactorStatus.Startup_waitForVerify: __instance.AttemptInteract(eReactorInteraction.Verify_fail, __instance.m_currentWaveProgress); break; case eReactorStatus.Shutdown_intro: __instance.AttemptInteract(eReactorInteraction.WaitForVerify_shutdown, __instance.m_currentWaveProgress); break; default: Debug.LogError("MASTER, Reactor m_startupStateProgress reached 1 in a state withouth action, status: " + __instance.m_currentState.status); break; } return(false); }
/// <summary> /// Set Warden Objective hint Fragment (such as [ITEM_SERIAL]) /// </summary> /// <param name="type">Fragment Type</param> /// <param name="text">String to be placed in selected Fragment</param> public void SetObjectiveTextFragment(eWardenTextFragment type, string text) { WardenObjectiveManager.SetObjectiveTextFragment(Base.LayerType, type, text); }
public void Solved() { WardenObjectiveManager.OnLocalPlayerSolvedObjectiveItem(Layer, ItemCast); OnSolvedEvent?.Invoke(); OnSolved(); }
public void Found() { WardenObjectiveManager.OnLocalPlayerFoundObjectiveItem(Layer, ItemCast); OnFoundEvent?.Invoke(); OnFound(); }
private void OnUpdate() { if (ObjectiveStatus.ObjectiveStatus == eWardenObjectiveStatus.WardenObjectiveItemSolved) { if (TimerContext.EndType == EndEventType.OnGotoWin) { CurrentStatus = TimerStatus.Disabled; } if (TimerContext.StartType == StartEventType.OnGotoWin) { CurrentStatus = TimerStatus.CountingDelay; } } var timerData = CurrentStepData; switch (CurrentStatus) { case TimerStatus.CountingDelay: Timer += Clock.Delta; SyncTimer += Clock.Delta; GUIUtil.SetMessageVisible(false); GUIUtil.SetTimerVisible(false); //Done Counting if (Timer >= timerData.Delay) { Timer = 0.0f; CurrentStatus = TimerStatus.CountingTimer; if (timerData.TriggerWaveData.Length > 0) { TriggerWave(timerData.TriggerWaveData.ToList(), Builder.GetStartingArea().m_courseNode); } SyncReplicator(); } break; case TimerStatus.CountingTimer: Timer += Clock.Delta; SyncTimer += Clock.Delta; GUIUtil.SetMessageVisible(true); GUIUtil.SetTimerVisible(true); //Set Message var message = timerData.BaseMessage; message = message.Replace("[TIMER]", TimerFormat(timerData.Duration, Timer)); message = message.Replace("[PERCENT]", PercentFormat(timerData.Duration, Timer)); message = message.Replace("[PERCENT_INVERT]", InvertPercentFormat(timerData.Duration, Timer)); GUIUtil.SetMessage(message); //Set Percent var percent = (Timer / timerData.Duration); switch (timerData.FillStyle) { case TimerStyle.InvertedPercent: percent = 1.0f - percent; break; case TimerStyle.Zero: percent = 0.0f; break; case TimerStyle.One: percent = 1.0f; break; } GUIUtil.SetTimer(percent); //Done Counting if (Timer >= timerData.Duration) { Timer = 0.0f; switch (timerData.DoneType) { case DoneEventType.ForceFail: ForceFail(); break; case DoneEventType.ForceWin: ForceWin(); break; } //Stop All Wave if (timerData.StopAllWaveWhenDone) { StopAllWave(); } //Execute Done Events if (timerData.DoneEvents.Length > 0) { foreach (var e in timerData.DoneEvents) { CoroutineManager.StartCoroutine(WardenObjectiveManager.ExcecuteEvent(e)); } } //Jump to Next Step or Disable whole Timer if (CurrentStep < TimerContext.Steps.Length - 1) { CurrentStep++; CurrentStatus = TimerStatus.CountingDelay; } else { CurrentStatus = TimerStatus.Disabled; GUIUtil.SetMessageVisible(false); GUIUtil.SetTimerVisible(false); } SyncReplicator(); } break; } if (SyncTimer >= 15.0f) { SyncTimer = 0.0f; SyncReplicator(); } }
public void RegisterObjectiveItemForCollection(iWardenObjectiveItem item) { WardenObjectiveManager.RegisterObjectiveItemForCollection(Base.LayerType, item); }