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); }
public bool RecentPic(MsgInformationEx MsgDTO, object[] param) { var picUrl = PicCacher.Random(); MsgSender.PushMsg(MsgDTO, CodeApi.Code_Image_Relational(picUrl)); return(true); }
public bool MiniStory(MsgInformationEx MsgDTO, object[] param) { var rec = ArknightsMiniStoryRecord.GetLast(); var msg = $"【No.{rec.No}】\r\n{CodeApi.Code_Image_Relational(CachePath + rec.Path)}"; MsgSender.PushMsg(MsgDTO, msg); return(true); }
public bool MiniStoryIndex(MsgInformationEx MsgDTO, object[] param) { var no = (int)(long)param[0]; var rec = ArknightsMiniStoryRecord.Get(no); if (rec == null) { MsgSender.PushMsg(MsgDTO, "未找到相应的期号!"); return(false); } var msg = $"【No.{rec.No}】\r\n{CodeApi.Code_Image_Relational(CachePath + rec.Path)}"; MsgSender.PushMsg(MsgDTO, msg); return(true); }
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); }
private void SendTarotFortune(MsgInformationEx MsgDTO, TarotCacheModel data) { if (data == null) { return; } var ptr = data.IsPos ? "正位" : "逆位"; var msg = $"{CodeApi.Code_Image_Relational($"{TarotServerPath}{data.SerialName}/{data.CardName}.jpg")}\r\n"; msg += $"牌名:{ptr}{data.CardName}\r\n"; msg += $"{ptr}解释:"; var model = ModelList.First(p => p.Name == data.CardName); msg += data.IsPos ? model.正位 : model.逆位; MsgSender.PushMsg(MsgDTO, msg, true); }
public void Review(MsgInformationEx MsgDTO) { var record = MongoService <PicReviewRecord> .Get(p => p.Status == PicReviewStatus.Waiting).OrderBy(p => p.CreateTime).FirstOrDefault(); if (record == null) { MsgSender.PushMsg(MsgDTO, "暂无待审核的图片!"); return; } var msg = $"{CodeApi.Code_Image_Relational($"{CachePath}{record.PicName}")}\r\n"; msg += $"来自 {GroupSettingSvc[record.GroupNum].Name} 的 {record.QQNum}\r\n"; msg += $"用途:{record.Usage}\r\n"; msg += "是否通过?"; var option = WaiterSvc.WaitForOptions(MsgDTO.FromGroup, MsgDTO.FromQQ, msg, new[] { "通过", "不通过", "取消" }, MsgDTO.BindAi); if (option < 0 || option == 2) { MsgSender.PushMsg(MsgDTO, "操作取消!"); return; } record.Status = option == 0 ? PicReviewStatus.Passed : PicReviewStatus.Refused; record.ReviewTime = DateTime.Now; record.Update(); ReviewCallBack[record.Usage](record); msg = record.Status == PicReviewStatus.Passed ? $"恭喜你,你在{record.CreateTime:yyyy-MM-dd HH:mm:ss}提交的用于{record.Usage}的图片审核通过!" : $"很遗憾,你在{record.CreateTime:yyyy-MM-dd HH:mm:ss}提交的用于{record.Usage}的图片未能审核通过!"; MsgSender.PushMsg(record.GroupNum, record.QQNum, msg, GroupSettingSvc[record.GroupNum].BindAi); var picTempFile = new FileInfo($"{CachePath}{record.PicName}"); picTempFile.Delete(); var count = MongoService <PicReviewRecord> .Count(p => p.Status == PicReviewStatus.Waiting); MsgSender.PushMsg(MsgDTO, $"审核完毕!还有{count}张待审核的图片!"); }
public bool Boom(MsgInformationEx MsgDTO, object[] param) { var backInfo = WaiterSvc.WaitForInformation( new MsgCommand { Command = CommandType.SendGroup, Msg = "请于5秒内输入指令码!", ToGroup = MsgDTO.FromGroup, BindAi = MsgDTO.BindAi }, info => info.Msg == BoomCode.ToString()); if (backInfo == null) { MsgSender.PushMsg(MsgDTO, "自爆失败!"); return(false); } if (CodeDate.AddMinutes(5) < DateTime.Now) { MsgSender.PushMsg(MsgDTO, "指令码已失效!"); return(false); } MsgSender.PushMsg(MsgDTO, "AI即将自爆!"); Thread.Sleep(1000); for (var i = 5; i > 0; i--) { MsgSender.PushMsg(MsgDTO, i.ToString()); Thread.Sleep(1000); } MsgSender.PushMsg(MsgDTO, CodeApi.Code_Image_Relational("images/boom.jpg")); BoomCode = Rander.RandInt(10000); Thread.Sleep(1000); return(true); }
public bool ViewItem(MsgInformationEx MsgDTO, object[] param) { var name = param[0] as string; var item = HonorSvc.FindItem(name); if (item == null) { MsgSender.PushMsg(MsgDTO, $"未找到该物品:{name}"); return(false); } var record = ItemCollectionRecord.Get(MsgDTO.FromQQ); var msg = $"{(string.IsNullOrEmpty(item.PicPath) ? string.Empty : $"{CodeApi.Code_Image_Relational(item.PicPath)}\r\n")}" + $"{item.Name}\r\n" + $" {item.Description}\r\n" + $"稀有率:{HonorSvc.ItemRate(item)}%\r\n" + $"价格:{HonorSvc.GetItemPrice(item, MsgDTO.FromQQ).CurencyFormat()}\r\n" + $"特性:{(item.Attributes == null ? "无" : string.Join(",", item.Attributes))}\r\n" + $"可解锁成就:{HonorSvc.FindHonorFullName(item.Name)}\r\n" + $"你拥有该物品:{record.GetCount(item.Name)}个"; MsgSender.PushMsg(MsgDTO, msg); return(true); }
public static void ShowCard(string cardName, MsgInformationEx MsgDTO) { MsgSender.PushMsg(MsgDTO, CodeApi.Code_Image_Relational(PicPath + cardName)); }
public override string ToString() { return($"【{Name}】\r\n{CodeApi.Code_Image_Relational(PicPath)}\r\n{Description}"); }
public override string ToString() { return($"【{Name}】\r\n{CodeApi.Code_Image_Relational(PicPath)}\r\n{Description}\r\n需要碎片:{string.Join(Emoji.星星, Segments.Select(s => $"【{s.Name}】"))}"); }