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 SwitchWorldLine(MsgInformationEx MsgDTO, object[] param) { var option = WaiterSvc.WaitForOptions(MsgDTO.FromGroup, MsgDTO.FromQQ, "请选择需要切换的世界线:", CrossWorldAiSvc.AllWorlds.Select(w => w.Name).ToArray(), MsgDTO.BindAi); if (option < 0) { MsgSender.PushMsg(MsgDTO, "操作取消!"); return(false); } var worldLine = CrossWorldAiSvc.AllWorlds[option]; var group = GroupSettingSvc[MsgDTO.FromGroup]; group.WorldLine = worldLine.Name; group.Update(); MsgSender.PushMsg(MsgDTO, "世界线切换成功!"); return(true); }
public bool FunctionBonus(MsgInformationEx MsgDTO, object[] param) { var command = param[0] as string; var qqNum = (long)param[1]; var count = (int)(long)param[2]; var enters = CrossWorldAiSvc[MsgDTO.FromGroup].AllAvailableGroupCommands.Where(p => p.Command == command).ToList(); if (enters.IsNullOrEmpty()) { MsgSender.PushMsg(MsgDTO, "未找到该功能!", true); return(false); } var enter = enters.First(); if (enters.Count > 1) { var options = enters.Select(p => $"{p.Command} {p.SyntaxHint}").ToArray(); var response = WaiterSvc.WaitForOptions(MsgDTO.FromGroup, MsgDTO.FromQQ, "请选择需要奖励的功能:", options, MsgDTO.BindAi); if (response < 0) { MsgSender.PushMsg(MsgDTO, "操作取消!"); return(false); } enter = enters[response]; } var dailyLimit = DailyLimitRecord.Get(qqNum, enter.ID); dailyLimit.Decache(count); dailyLimit.Update(); MsgSender.PushMsg(MsgDTO, "奖励已生效!"); return(true); }
public bool OpenFinalTreasure(MsgInformationEx MsgDTO, object[] param) { var record = SegmentRecord.Get(MsgDTO.FromQQ); if (!record.CanOpenFinalTreasure) { MsgSender.PushMsg(MsgDTO, "很遗憾,你还不能开启终极宝藏,继续努力吧!(开启过所有其他宝藏才能开启终极宝藏!)", true); return(false); } var options = new[] { "获取500金币", "随机获取商店售卖的一件商品*5", "宠物获取50点经验值", "捞瓶子机会*5(仅当日有效)" }; var selectedIdx = WaiterSvc.WaitForOptions(MsgDTO.FromGroup, MsgDTO.FromQQ, "请选择你要开启的宝藏:", options, MsgDTO.BindAi); if (selectedIdx < 0) { MsgSender.PushMsg(MsgDTO, "你已经放弃了思考!"); return(false); } switch (selectedIdx) { case 0: { var osPerson = OSPerson.GetPerson(MsgDTO.FromQQ); osPerson.Golds += 500; osPerson.Update(); MsgSender.PushMsg(MsgDTO, $"恭喜你获得了 {500.CurencyFormat()}!"); break; } case 1: { var items = TransHelper.GetDailySellItems(); var randItem = items.RandElement(); MsgSender.PushMsg(MsgDTO, $"恭喜你获得了 {randItem.Name}*5!"); var collo = ItemCollectionRecord.Get(MsgDTO.FromQQ); var msg = collo.ItemIncome(randItem.Name, 5); if (!string.IsNullOrEmpty(msg)) { MsgSender.PushMsg(MsgDTO, msg); } break; } case 2: { var pet = PetRecord.Get(MsgDTO.FromQQ); var msg = pet.ExtGain(MsgDTO, 50); MsgSender.PushMsg(MsgDTO, msg); break; } case 3: { var dailyLimit = DailyLimitRecord.Get(MsgDTO.FromQQ, "DriftBottleAI_FishingBottle"); dailyLimit.Decache(5); dailyLimit.Update(); MsgSender.PushMsg(MsgDTO, "恭喜你获取 捞瓶子机会*5(仅当日有效) !"); break; } } record.FinalTreasureCount++; record.Update(); return(true); }
public bool UpdateElement(MsgInformationEx MsgDTO, object[] param) { var archaeologist = Archaeologist.Get(MsgDTO.FromQQ); if (archaeologist.IsDead) { MsgSender.PushMsg(MsgDTO, $"你当前处在死亡惩罚时间中,无法进行该操作!复活时间:{archaeologist.RebornTime:yyyy-MM-dd HH:mm:ss}"); return(false); } var asset = ArchAsset.Get(MsgDTO.FromQQ); var flameEles = asset.FlameEssence; var iceEles = asset.IceEssence; var lightningEles = asset.LightningEssence; var flameNeed = archaeologist.Flame * 10; var iceNeed = archaeologist.Ice * 10; var lighningNeed = archaeologist.Lightning * 10; var options = new[] { $"{Emoji.火焰}:({flameEles}/{flameNeed})", $"{Emoji.雪花}:({iceEles}/{iceNeed})", $"{Emoji.闪电}:({lightningEles}/{lighningNeed})", "取消" }; var option = WaiterSvc.WaitForOptions(MsgDTO.FromGroup, MsgDTO.FromQQ, "请选择你要晋升的元素之力!", options, MsgDTO.BindAi); if (option < 0 || option == 3) { MsgSender.PushMsg(MsgDTO, "操作取消!"); return(false); } switch (option) { case 0 when flameEles < flameNeed: MsgSender.PushMsg(MsgDTO, "火焰精魄不足,无法晋升!"); return(false); case 0: asset.FlameEssence -= flameNeed; archaeologist.Flame++; break; case 1 when iceEles < iceNeed: MsgSender.PushMsg(MsgDTO, "寒冰精魄不足,无法晋升!"); return(false); case 1: asset.IceEssence -= iceNeed; archaeologist.Ice++; break; case 2 when lightningEles < lighningNeed: MsgSender.PushMsg(MsgDTO, "雷电精魄不足,无法晋升!"); return(false); case 2: asset.LightningEssence -= lighningNeed; archaeologist.Lightning++; break; } asset.Update(); archaeologist.Update(); MsgSender.PushMsg(MsgDTO, "晋升成功!"); return(true); }