32 lines
522 B
C#
32 lines
522 B
C#
using Sandbox;
|
|
using System;
|
|
namespace Editor;
|
|
|
|
public static class MotivationManager
|
|
{
|
|
static RealTimeUntil Cooldown;
|
|
|
|
static MotivationManager()
|
|
{
|
|
Game.SetRandomSeed( DateTime.Now.Second );
|
|
Cooldown = 5;
|
|
}
|
|
|
|
[EditorEvent.FrameAttribute]
|
|
public static void Frame()
|
|
{
|
|
if ( !Cooldown )
|
|
{
|
|
return;
|
|
}
|
|
|
|
var notice = new MotivationNotice();
|
|
NoticeManager.Remove( notice, 6 );
|
|
|
|
const int MIN_MINUTES = 2;
|
|
const int MAX_MINUTES = 5;
|
|
|
|
Cooldown = 60 * Game.Random.Next( MIN_MINUTES, MAX_MINUTES );
|
|
}
|
|
}
|