Exemple #1
0
        public bool MyPet(MsgInformationEx MsgDTO, object[] param)
        {
            var pet = PetRecord.Get(MsgDTO.FromQQ);

            var levelModel = PetLevelSvc[pet.Level];

            var HasExtEndur = VipArmerRecord.Get(MsgDTO.FromQQ).CheckArmer("耐力护符");
            var extEndur    = HasExtEndur ? "(+10)" : string.Empty;
            var petEndur    = levelModel.Endurance - PetEnduranceRecord.Get(MsgDTO.FromQQ).ConsumeTotal + (HasExtEndur ? 10 : 0);

            var session = new MsgSession(MsgDTO);

            session.Add($"{CodeApi.Code_Image_Relational(pet.PicPath)}");
            session.Add($"名称:{pet.Name}");
            session.Add($"种族:{pet.PetNo}");
            session.Add($"食性:{pet.Attribute ?? "无"}");
            session.Add($"等级:{Utility.LevelEmoji(pet.Level)}");
            session.Add($"{Emoji.心}:{levelModel.HP}");
            session.Add($"耐力:{petEndur}/{levelModel.Endurance}{extEndur}");
            session.Add($"经验值:{pet.Exp}/{levelModel.Exp}");

            if (!pet.Skills.IsNullOrEmpty())
            {
                session.Add($"技能:{pet.Skills.Select(p => $"{p.Key}({p.Value})").JoinToString(",")}");
            }
            if (pet.RemainSkillPoints > 0)
            {
                session.Add($"可用技能点:{pet.RemainSkillPoints}");
            }

            session.Send();
            return(true);
        }
Exemple #2
0
        public bool Purchase(MsgInformationEx MsgDTO)
        {
            var armerRec = VipArmerRecord.Get(MsgDTO.FromQQ);
            var armer    = new ArmerModel {
                Name = Name, Description = Description
            };

            armerRec.Armers.Add(armer);
            armerRec.Update();

            MsgSender.PushMsg(MsgDTO, "购买成功!");
            return(true);
        }
Exemple #3
0
        public bool Purchase(MsgInformationEx MsgDTO)
        {
            var armerRec = VipArmerRecord.Get(MsgDTO.FromQQ);
            var armer    = new ArmerModel()
            {
                Name = "耐力护符", Description = "使宠物的耐力上限增加10,持续10天。", ExpiryTime = DateTime.Now.AddDays(10)
            };

            armerRec.Armers.Add(armer);
            armerRec.Update();

            MsgSender.PushMsg(MsgDTO, $"购买成功!有效期至:{armer.ExpiryTime:yyyy-MM-dd HH:mm:ss}");
            return(true);
        }
Exemple #4
0
        private void FishItem(MsgInformationEx MsgDTO)
        {
            if (OSPersonBuff.CheckBuff(MsgDTO.FromQQ, "梅雨") && Rander.RandInt(100) < 30)
            {
                MsgSender.PushMsg(MsgDTO, "欸呀呀,捞瓶子失败了!(梅雨)", true);
                return;
            }

            var item      = HonorSvc.RandItem();
            var record    = ItemCollectionRecord.Get(MsgDTO.FromQQ);
            var honorName = HonorSvc.FindHonorName(item.Name);

            var count     = 1;
            var vipArmers = VipArmerRecord.Get(MsgDTO.FromQQ);

            if (vipArmers.CheckArmer("安妮的镜子"))
            {
                count = 2;
            }
            vipArmers.Armers.Remove(p => p.Name == "安妮的镜子");
            vipArmers.Update();

            DriftBottleAnalyzeRecord.Record(item.Name, count);

            var s   = record.ItemIncome(item.Name, count);
            var msg = "你捞到了 \r\n" +
                      $"{(string.IsNullOrEmpty(item.PicPath) ? string.Empty : $"{CodeApi.Code_Image_Relational(item.PicPath)}\r\n")}" +
                      $"{item.Name}{(count > 1 ? $"*{count}" : string.Empty)} \r\n" +
                      $"    {item.Description} \r\n" +
                      $"稀有率为 {HonorSvc.ItemRate(item)}%\r\n" +
                      $"售价为:{item.Price} 金币\r\n" +
                      $"特性:{(item.Attributes == null ? "无" : string.Join(",", item.Attributes))}\r\n" +
                      $"你总共拥有该物品 {record.HonorCollections[honorName].Items[item.Name]}个";

            if (!string.IsNullOrEmpty(s))
            {
                msg += $"\r\n{s}";
            }

            if (OSPersonBuff.CheckBuff(MsgDTO.FromQQ, "钻石尘") && Rander.RandInt(100) < 50)
            {
                OSPerson.GoldConsume(MsgDTO.FromQQ, 40);
                msg += "\r\n欸呀呀,你丢失了40金币(钻石尘)";
            }

            MsgSender.PushMsg(MsgDTO, msg, true);
        }
Exemple #5
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);
        }