@@ -40,7 +40,7 @@ public class EventHandlers
4040
4141 public EventHandlers ( Plugin plugin ) => this . plugin = plugin ;
4242
43- public string GetGamemodeName ( )
43+ private string GetGamemodeName ( )
4444 {
4545 switch ( CurrentGamemode )
4646 {
@@ -57,6 +57,12 @@ public string GetGamemodeName()
5757 }
5858 }
5959
60+ private IEnumerator < float > DelayedRoundEnd ( float delay )
61+ {
62+ yield return Timing . WaitForSeconds ( delay ) ;
63+ Round . EndRound ( true ) ;
64+ }
65+
6066 #region Gamemodes
6167 public IEnumerator < float > DodgeBall ( )
6268 {
@@ -271,6 +277,10 @@ public void OnRoundStart()
271277 }
272278 Map . Broadcast ( 6 , "<color=red>The " + GetGamemodeName ( ) + " round has started!</color>" ) ;
273279 }
280+ if ( CurrentGamemode == Gamemode . BlueScreenOfDeath )
281+ {
282+ Timing . RunCoroutine ( DelayedRoundEnd ( 900 ) , "DelayedRoundEnd" ) ;
283+ }
274284 }
275285
276286 public void OnRoundEnding ( EndingRoundEventArgs ev )
@@ -297,6 +307,7 @@ public void OnRoundEnd( RoundEndedEventArgs ev )
297307 Map . Broadcast ( 6 , "<color=red>The " + GetGamemodeName ( ) + " round has ended.</color>" ) ;
298308 CurrentGamemode = 0 ;
299309 ServerConsole . FriendlyFire = FriendlyFireDefault ;
310+ Timing . KillCoroutines ( "DelayedRoundEnd" ) ;
300311 }
301312 }
302313
@@ -320,15 +331,6 @@ public void OnItemDropped( DroppingItemEventArgs ev )
320331 }
321332 }
322333
323- public void OnGeneratorActivate ( ActivatingGeneratorEventArgs ev )
324- {
325- // Set generator activation time to 5 minutes
326- if ( CurrentGamemode == Gamemode . BlueScreenOfDeath )
327- {
328- ev . Generator . ActivationTime = 300 ;
329- }
330- }
331-
332334 public void OnGeneratorDeactivate ( StoppingGeneratorEventArgs ev )
333335 {
334336 // Prevent generators from being deactivated once they're active
0 commit comments