Ejemplo n.º 1
0
        void BoomTimerElapsed(string channel)
        {
            if (m_cooldown.ContainsKey(channel))
            {
                L.Log("WARNING: Wanted to BOOM but the timer should already be deleted.");
                m_timers.Remove(channel);
                return;
            }

            var data = m_timers[channel];

            data.timer.Stop();

            // Maybe don't explode at all
            if (Utils.random.Next(0, 100) >= 90)
            {
                E.Say(channel, "The bomb appears to be defective.. bad quality.");
                data = null;
                m_timers.Remove(channel);
                return;
            }

            E.Say(channel, "BOOOM! " + data.nick + " died instantly.");

            var cooldown = new SucklessTimer(Utils.random.Next(60, 90) * 1000.0);

            cooldown.Elapsed += delegate {
                m_cooldown.Remove(channel);
            };
            m_cooldown[channel] = cooldown;
            m_timers.Remove(channel);
        }
Ejemplo n.º 2
0
 public DisarmData(string _nick, string _color, double interval)
 {
     nick  = _nick;
     color = _color;
     timer = new SucklessTimer(interval);
 }