private static bool Prefix(AlphaWarheadController __instance) { if (Recontainer079.isLocked) { return(false); } __instance.doorsOpen = false; ServerLogs.AddLog(ServerLogs.Modules.Warhead, "Countdown started.", ServerLogs.ServerLogType.GameEvent); if ((AlphaWarheadController._resumeScenario != -1 || __instance.scenarios_start[AlphaWarheadController._startScenario].SumTime() != (double)__instance.timeToDetonation) && (AlphaWarheadController._resumeScenario == -1 || __instance.scenarios_resume[AlphaWarheadController._resumeScenario].SumTime() != (double)__instance.timeToDetonation)) { return(false); } var ev = new StartingEventArgs(API.Features.Server.Host); Warhead.OnStarting(ev); if (!ev.IsAllowed) { return(false); } __instance.NetworkinProgress = true; return(false); }
internal void OnWarheadStart(StartingEventArgs ev) { if (!config.Warhead.canBeEnabledGlobal && !config.Warhead.canBeEnabled[ev.Player.Role]) { ev.IsAllowed = false; } }
public void OnWarheadStart(StartingEventArgs ev) { foreach (Npc npc in Npc.List) { NPCWarheadStartedEvent nev = new NPCWarheadStartedEvent(npc, ev.Player); npc.AttachedCoroutines.Add(Timing.CallDelayed(0.1f, () => npc.FireEvent(nev))); } }
internal void OnStarting(StartingEventArgs ev) { if (ev.IsAllowed) { AnnouncementSettings settings = SimpleCassie.Instance.Config.WarheadStart; Log.Info( $"RoundStart: {settings.Enabled}, roundStartMsg: {settings.Message}, roundStartDelay: {settings.Delay}, roundStartNoise: {settings.MakeNoise}"); Timing.RunCoroutine(Extensions.CassieMessage(settings.Message, false, settings.MakeNoise, settings.Delay)); } }
public async void OnStartingWarhead(StartingEventArgs ev) { if (Instance.Config.EventsToLog.StartingWarhead && (ev.Player == null || (ev.Player != null && (!ev.Player.DoNotTrack || !Instance.Config.ShouldRespectDoNotTrack)))) { object[] vars = ev.Player == null ? new object[] { Warhead.DetonationTimer } : new object[] { ev.Player.Nickname, Instance.Config.ShouldLogUserIds ? ev.Player.UserId : Language.Redacted, ev.Player.Role, Warhead.DetonationTimer }; await Network.SendAsync(new RemoteCommand("log", "gameEvents", string.Format(ev.Player == null ? Language.WarheadStarted : Language.PlayerWarheadStarted, vars))).ConfigureAwait(false); } }
public void OnAlphaStart(StartingEventArgs ev) { bool isresumed = AlphaWarheadController._resumeScenario != -1; double left = isresumed ? AlphaWarheadController.Host.timeToDetonation : AlphaWarheadController.Host.timeToDetonation - 4; double count = Math.Truncate(left / 10.0) * 10.0; if (!isresumed) { Map.Broadcast(15, Plugin.Instance.Config.AlphaStart_notresumed.Replace("{sec}", Convert.ToString(count))); } else { Map.Broadcast(15, Plugin.Instance.Config.AlphaStart_resumed.Replace("{sec}", Convert.ToString(count))); } }
internal void Starting(StartingEventArgs ev) { if (Plugin.Instance.Config.Starting == "") { return; } string message = Plugin.Instance.Config.Starting.Replace("%player%", ev.Player.ToString()); if (Plugin.Instance.Config.debug_to_console) { Log.Debug(message: "[ " + Plugin.Instance.Config.warhead_name + "] " + message); } Plugin.sendWebHook(Plugin.Instance.Config.warhead_url, message, Plugin.Instance.Config.warhead_name); }
public void OnAlphaStart(StartingEventArgs ev) { bool isresumed = AlphaWarheadController._resumeScenario != -1; double left = isresumed ? AlphaWarheadController.Host.timeToDetonation : AlphaWarheadController.Host.timeToDetonation - 4; double count = Math.Truncate(left / 10.0) * 10.0; if (!isresumed) { Log.Info($"Alpha Warhead is On t-{count}seconds, {ev.Player.Nickname}({ev.Player})"); Map.Broadcast(15, $"<size=50><color=red>알파탄두</color> 폭★파 절차가 <color=red>실행</color>되었습니다.\n<color=red>시설</color>의 지하가 <color=yellow>{count}</color> 내에 <color=red>폭★발</color>합니다.</size>"); } else { Log.Info($"Alpha Warhead is resumed On t-{count}seconds, {ev.Player.Nickname}({ev.Player})"); Map.Broadcast(15, $"<size=50><color=red>알파탄두</color> 폭★파 절차가 <color=red>다시 실행</color>되었습니다.\n<color=red>시설</color>의 지하가 <color=yellow>{count}</color> 내에 <color=red>폭★발</color>합니다.</size>"); } }
private static bool Prefix(PlayerInteract __instance) { if (!__instance._playerInteractRateLimit.CanExecute(true) || (__instance._hc.CufferId > 0 && !PlayerInteract.CanDisarmedInteract)) { return(false); } GameObject gameObject = GameObject.Find("OutsitePanelScript"); if (!__instance.ChckDis(gameObject.transform.position) || !AlphaWarheadOutsitePanel.nukeside.enabled) { return(false); } if (!gameObject.GetComponent <AlphaWarheadOutsitePanel>().keycardEntered || Recontainer079.isLocked) { return(false); } AlphaWarheadController.Host.doorsOpen = false; ServerLogs.AddLog(ServerLogs.Modules.Warhead, "Countdown started.", ServerLogs.ServerLogType.GameEvent); if ((AlphaWarheadController._resumeScenario == -1 && AlphaWarheadController.Host.scenarios_start[AlphaWarheadController._startScenario].SumTime() == AlphaWarheadController.Host.timeToDetonation) || (AlphaWarheadController._resumeScenario != -1 && AlphaWarheadController.Host.scenarios_resume[AlphaWarheadController._resumeScenario].SumTime() == AlphaWarheadController.Host.timeToDetonation)) { var ev = new StartingEventArgs(API.Features.Player.Get(__instance.gameObject) ?? API.Features.Server.Host); Warhead.OnStarting(ev); if (!ev.IsAllowed) { return(false); } AlphaWarheadController.Host.NetworkinProgress = true; } ServerLogs.AddLog(ServerLogs.Modules.Warhead, __instance.GetComponent <NicknameSync>().MyNick + " (" + __instance.GetComponent <CharacterClassManager>().UserId + ") started the Alpha Warhead detonation.", ServerLogs.ServerLogType.GameEvent); __instance.OnInteract(); return(false); }
/// <inheritdoc cref="Events.Handlers.Warhead.OnStarting(StartingEventArgs)"/> public void OnStarting(StartingEventArgs ev) { Log.Info($"{ev.Player?.Nickname} started the warhead!"); }
/// <summary> /// Called before starting the warhead. /// </summary> /// <param name="ev">The <see cref="StartingEventArgs"/> instance.</param> public static void OnStarting(StartingEventArgs ev) => Starting.InvokeSafely(ev);
private static void OnNukeStart(StartingEventArgs ev) { ev.IsAllowed = !scriptData.disableNuke; }