Beispiel #1
0
        public bool ResolveItem(MsgInformationEx MsgDTO, object[] param)
        {
            var name = param[0] as string;
            var item = HonorSvc.FindItem(name);

            if (item == null)
            {
                MsgSender.PushMsg(MsgDTO, "未查找到相关物品!");
                return(false);
            }

            var itemColle = ItemCollectionRecord.Get(MsgDTO.FromQQ);

            if (!itemColle.CheckItem(name))
            {
                MsgSender.PushMsg(MsgDTO, "你尚未持有该物品!");
                return(false);
            }

            itemColle.ItemConsume(name);
            itemColle.Update();

            var count      = Math.Max(item.Price / 20, 1);
            var flavorings = ExpeditionSceneSvc.RandFlavorings(count);

            var cookingRec = CookingRecord.Get(MsgDTO.FromQQ);

            cookingRec.FlavoringIncome(flavorings);
            cookingRec.Update();

            var msg = flavorings.Select(p => $"{p.Key}×{p.Value}").JoinToString(",");

            MsgSender.PushMsg(MsgDTO, $"分解成功!你获得了:\r\n{msg}");
            return(true);
        }
Beispiel #2
0
        private bool StartExpedite(MsgInformationEx MsgDTO)
        {
            var extEndur = VipArmerRecord.Get(MsgDTO.FromQQ).CheckArmer("耐力护符") ? 10 : 0;

            var pet              = PetRecord.Get(MsgDTO.FromQQ);
            var petLevel         = PetLevelSvc[pet.Level];
            var enduranceConsume = PetEnduranceRecord.Get(MsgDTO.FromQQ);
            var curEndurance     = petLevel.Endurance - enduranceConsume.ConsumeTotal + extEndur;

            var todayExpeditions = ExpeditionSceneSvc.TodayExpedition().Where(p => p.Endurance <= curEndurance).ToList();

            if (todayExpeditions.IsNullOrEmpty())
            {
                MsgSender.PushMsg(MsgDTO, $"{pet.Name}已经累的完全动不了了!");
                return(false);
            }

            var msg       = $"请选择远征副本:\r\n{todayExpeditions.Select((exp, idx) => $"{idx + 1}:{exp.ToString(curEndurance)}").JoinToString("\r\n")}";
            var selection = WaiterSvc.WaitForNum(MsgDTO.FromGroup, MsgDTO.FromQQ, msg, i => i > 0 && i <= todayExpeditions.Count, MsgDTO.BindAi, 12, false);

            if (selection < 0)
            {
                MsgSender.PushMsg(MsgDTO, "操作取消");
                return(false);
            }

            var aimExpedition = todayExpeditions[selection - 1];
            var expRec        = new ExpeditionRecord
            {
                EndTime = DateTime.Now.AddMinutes(aimExpedition.TimeConsume),
                QQNum   = MsgDTO.FromQQ,
                Scene   = aimExpedition.Name
            };

            expRec.Insert();

            enduranceConsume.ConsumeTotal += aimExpedition.Endurance;
            enduranceConsume.Update();

            MsgSender.PushMsg(MsgDTO, $"远征开始!目标:【{aimExpedition.Name}】!(请于{expRec.EndTime:yyyy-MM-dd HH:mm:ss}后使用 宠物远征 命令回收远征奖励!)");
            return(true);
        }