Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
6hundred9 authored Mar 27, 2024
1 parent f390b38 commit fea3da3
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions Scp575-Exiled8/Events/ServerHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

using Exiled.API.Features;
using PluginAPI.Events;
using System;
using System.Collections;
using System.Threading;
using MEC;
using System.Collections.Generic;
using Exiled.Events.EventArgs.Server;
using UnityEngine;
using Random = UnityEngine.Random;
using Exiled.Events.EventArgs.Player;

namespace Scp575_Exiled8.Events
{
public class ServerHandler
{
private static Config config = Scp575.Instance.Config;
private static int funny = Scp575.editable;
private static MEC.CoroutineHandle yes;
public static void OnRoundStarted()
{
yes = Timing.RunCoroutine(iHaveNoIdeaWhatToNameThis());
}

public static void OnRoundEnded(RoundEndedEventArgs ev)
{
Timing.KillCoroutines(yes);
funny = config.timesPerRound;
}


public static IEnumerator<float> iHaveNoIdeaWhatToNameThis()
{
for (; ; )
{
if (funny <= 0) break; Cassie.Message(config.recontainCassie);


yield return Random.Range(config.minSpawnTime, config.maxSpawnTime);

int smth = Random.Range(config.minBlackoutTime, config.maxSpawnTime);
if (Random.Range(config.spawnChance, 101) == 100)
{
if (funny == config.timesPerRound) Cassie.Message(config.breachCassie);
Map.TurnOffAllLights(smth);
funny--;
yield return Random.Range(config.minSpawnTime, config.maxSpawnTime);

}
}
}
}
}

0 comments on commit fea3da3

Please sign in to comment.