Exemplo n.º 1
0
 private void i_update_commentary()
 {
     _time_since_last_commentary += 1;
     _time_since_last_important  += 1;
     _time_since_last_cheer      += 1;
     if (UiPanelGame.inst.can_take_message())
     {
         if (_last_event == CommentaryEvent.Idle)
         {
             if (_time_since_last_commentary > 850)
             {
                 LoadedCommentary tar = random_commentary_for_event_type(_last_event);
                 UiPanelGame.inst._chats.push_message(tar._text, tar._announcer);
                 _time_since_last_commentary = 0;
                 _last_event = CommentaryEvent.Idle;
             }
         }
         else if (_time_since_last_commentary > 200)
         {
             LoadedCommentary tar = random_commentary_for_event_type(_last_event);
             UiPanelGame.inst._chats.push_message(tar._text, tar._announcer);
             _time_since_last_commentary = 0;
             _last_event = CommentaryEvent.Idle;
         }
     }
 }
Exemplo n.º 2
0
 public void notify_event(CommentaryEvent type, bool important = false)
 {
     if (_last_event == CommentaryEvent.ShotOnGoal)
     {
         return;
     }
     _last_event = type;
     if (important && _time_since_last_important > 100)
     {
         UiPanelGame.inst._chats.clear_messages();
         if (_time_since_last_cheer > 500)
         {
             Main.AudioController.PlayEffect("crowd");
             _time_since_last_cheer = 0;
         }
         _time_since_last_important  = 0;
         _time_since_last_commentary = 0;
         LoadedCommentary tar = random_commentary_for_event_type(_last_event);
         UiPanelGame.inst._chats.push_message(tar._text, tar._announcer);
     }
 }