示例#1
0
        private void SendWFAlert(WFAlert alert)
        {
            var result = "指挥官, Ordis拦截到了一条警报, 您要开始另一项光荣的打砸抢任务了吗?\r\n" +
                         WFFormatter.ToString(alert).AddHelpInfo().AddPlatformInfo();

            Messenger.Broadcast(result);
            sendedAlertsSet.Add(alert.Id);
        }
示例#2
0
        public static string ToString(WFAlert alert)
        {
            var mission = alert.Mission;
            var reward  = mission.Reward;
            var time    = (alert.Expiry - DateTime.Now).Humanize(int.MaxValue, CultureInfo.GetCultureInfo("zh-CN"), TimeUnit.Day, TimeUnit.Minute, " ");

            return($"[{mission.Node}] 等级{mission.MinEnemyLevel}~{mission.MaxEnemyLevel}:\r\n" +
                   $"- 类型:     {mission.Type} - {mission.Faction}\r\n" +
                   $"- 奖励:     {ToString(reward)}\r\n" +
                   //$"-过期时间: {alert.Expiry}({time} 后)" +
                   $"- 过期时间: {time} 后");
        }
示例#3
0
 private void SendWFAlert(WFAlert alert)
 {
     lock (WFAlertLocker)
     {
         var reward = alert.Mission.Reward;
         if (reward.Items.Any() || reward.CountedItems.Any())
         {
             var result = "指挥官, Ordis拦截到了一条警报, 您要开始另一项光荣的打砸抢任务了吗?\r\n" +
                          WFFormatter.ToString(alert) +
                          "\r\n可使用: /help来查看机器人的更多说明.";
             Messenger.Broadcast(result);
             sendedAlertsSet.Add(alert.Id);
         }
     }
 }
示例#4
0
        public void TranslateAlert(WFAlert alert)
        {
            var mission = alert.Mission;

            mission.Node = TranslateNode(mission.Node);
            mission.Type = dictTranslators["Mission"].Translate(mission.Type);
            TranslateReward(mission.Reward);

            void TranslateReward(Reward reward)
            {
                foreach (var item in reward.CountedItems)
                {
                    item.Type = alertTranslator.Translate(item.Type);
                }

                for (var i = 0; i < reward.Items.Length; i++)
                {
                    reward.Items[i] = alertTranslator.Translate(reward.Items[i]);
                }
            }
        }