Example #1
0
        public static ExpeditionHistory Get(long QQNum)
        {
            var rec = MongoService <ExpeditionHistory> .GetOnly(p => p.QQNum == QQNum);

            if (rec != null)
            {
                return(rec);
            }

            rec = new ExpeditionHistory()
            {
                QQNum = QQNum
            };
            MongoService <ExpeditionHistory> .Insert(rec);

            return(rec);
        }
Example #2
0
        private void DrawAwards(ExpeditionRecord expeditionRec, MsgInformationEx MsgDTO)
        {
            var expeditionModel = ExpeditionSceneSvc[expeditionRec.Scene];
            var award           = expeditionModel.Award(MsgDTO.FromQQ);

            MsgSender.PushMsg(MsgDTO, award.ToString());

            expeditionRec.IsDrawn = true;
            expeditionRec.Update();

            var history = ExpeditionHistory.Get(MsgDTO.FromQQ);

            history.AddScene(expeditionModel.Name);
            history.EnduranceConsume    += expeditionModel.Endurance;
            history.FlavoringTotal      += award.Flavorings.Count;
            history.GoldsTotal          += award.Gold;
            history.ItemBonusCount      += award.Items.Count;
            history.ItemBonusPriceTotal += award.Items.Sum(item => HonorSvc.FindItem(item).Price);

            history.Update();
        }
Example #3
0
        public bool MyExpeditionHistory(MsgInformationEx MsgDTO, object[] param)
        {
            var history = ExpeditionHistory.Get(MsgDTO.FromQQ);

            if (history.SceneDic.IsNullOrEmpty())
            {
                MsgSender.PushMsg(MsgDTO, "尚未记录到远征信息!");
                return(false);
            }

            var hotScenes = history.SceneDic.OrderByDescending(p => p.Value).Take(3).ToList();
            var session   = new MsgSession(MsgDTO);

            session.Add($"你最热衷的远征地点:{hotScenes.Select(s => $"{s.Key}*{s.Value}次").JoinToString(",")}");
            session.Add($"共获得金币:{history.GoldsTotal.CurencyFormat()}");
            session.Add($"共获得调味料:{history.FlavoringTotal}个");
            session.Add($"共获得物品:{history.ItemBonusCount}个");
            session.Add($"物品总价值:{history.ItemBonusPriceTotal.CurencyFormat()}");

            session.Send();
            return(true);
        }