public bool Reborn(MsgInformationEx MsgDTO, object[] param) { var archaeologist = Archaeologist.Get(MsgDTO.FromQQ); if (!archaeologist.IsDead) { MsgSender.PushMsg(MsgDTO, "活着的人,是不需要复活的!"); return(false); } var asset = ArchAsset.Get(MsgDTO.FromQQ); if (asset.RedStarStone < 1) { MsgSender.PushMsg(MsgDTO, $"你没有足够的赤星石来复活!({asset.RedStarStone}/1)"); return(false); } var msg = $"此操作将会花费赤星石*1,你当前剩余赤星石({asset.RedStarStone})颗,是否确认?"; if (!WaiterSvc.WaitForConfirm(MsgDTO, msg, 10)) { MsgSender.PushMsg(MsgDTO, "操作取消!"); return(false); } asset.RedStarStone--; archaeologist.RebornTime = DateTime.Now; asset.Update(); archaeologist.Update(); MsgSender.PushMsg(MsgDTO, "祈愿成功!"); return(true); }
private bool SellItem(MsgInformationEx MsgDTO, DriftBottleItemModel item, int count = 1) { var record = ItemCollectionRecord.Get(MsgDTO.FromQQ); if (!record.CheckItem(item.Name, count)) { MsgSender.PushMsg(MsgDTO, "你的背包里没有足够多的该物品!"); return(false); } var price = HonorSvc.GetItemPrice(item, MsgDTO.FromQQ); var msg = $"贩卖 {item.Name}*{count} 将获得 {(price * count).CurencyFormat()},是否确认贩卖?"; if (!WaiterSvc.WaitForConfirm(MsgDTO, msg)) { MsgSender.PushMsg(MsgDTO, "交易取消!"); return(false); } var osPerson = OSPerson.GetPerson(MsgDTO.FromQQ); TransHelper.SellItemToShop(item.Name, osPerson, count); osPerson.Update(); MsgSender.PushMsg(MsgDTO, $"贩卖成功!你当前拥有金币 {osPerson.Golds.CurencyFormat()}"); return(true); }
public bool Fight(MsgInformationEx MsgDTO, object[] param) { var aimNum = (long)param[0]; if (MsgDTO.FromQQ == aimNum) { MsgSender.PushMsg(MsgDTO, "你无法跟自己对决!"); return(false); } if (BindAiSvc.AllAiNums.Contains(aimNum)) { MsgSender.PushMsg(MsgDTO, "鱼唇的人类,你无法挑战ai的威严!"); return(false); } if (ChessSvc.IsGroupInPlaying(MsgDTO.FromGroup)) { MsgSender.PushMsg(MsgDTO, "本群正在进行一场对决,请稍后再试!"); return(false); } if (OSPersonBuff.CheckBuff(MsgDTO.FromQQ, "黄砂")) { MsgSender.PushMsg(MsgDTO, "你当前无法进行挑战!(黄砂)"); return(false); } if (!WaiterSvc.WaitForConfirm(MsgDTO.FromGroup, aimNum, $"{CodeApi.Code_At(MsgDTO.FromQQ)} 正在向你发起一场对决,是否接受?", MsgDTO.BindAi, 10)) { MsgSender.PushMsg(MsgDTO, "对决取消!"); return(false); } if (ChessSvc.IsQQInPlaying(MsgDTO.FromQQ)) { MsgSender.PushMsg(MsgDTO, "你正在进行一场对决,请稍后再试!"); return(false); } if (ChessSvc.IsQQInPlaying(aimNum)) { MsgSender.PushMsg(MsgDTO, "你的对手正在进行一场对决,请稍后再试!"); return(false); } ChessSvc.StartAGame(MsgDTO.FromGroup, MsgDTO.FromQQ, aimNum, (GroupNum, QQNum, Msg, judge) => { var msg = MsgDTO.Clone(); msg.FromQQ = QQNum; msg.FromGroup = GroupNum; var info = WaiterSvc.WaitForInformation(msg, Msg, information => information.FromGroup == GroupNum && information.FromQQ == QQNum && judge(information.Msg), 10, true); return(info == null ? string.Empty : info.Msg); }, MsgDTO.BindAi); return(true); }
private bool DealDiet(MsgInformationEx MsgDTO, string name, long aimQQ, int price) { var aimDietRec = CookingRecord.Get(aimQQ); if (!aimDietRec.CheckDiet(name)) { MsgSender.PushMsg(MsgDTO, "对方没有该菜肴!"); return(false); } var dietModel = CookingDietSvc[name]; if (dietModel.EstimatedPrice < price) { MsgSender.PushMsg(MsgDTO, $"交易价格不能低于该菜肴的成本价格({dietModel.EstimatedPrice.CurencyFormat()})!"); return(false); } var sourceOSPerson = OSPerson.GetPerson(MsgDTO.FromQQ); var fee = OSPersonBuff.CheckBuff(MsgDTO.FromQQ, "苍天") ? 0 : price / 20; if (sourceOSPerson.Golds < price + fee) { MsgSender.PushMsg(MsgDTO, "你没有足够的金币来支付!"); return(false); } var count = aimDietRec.CookedDietDic[name]; var msg = $"收到来自 {CodeApi.Code_At(MsgDTO.FromQQ)} 的交易请求:\r\n" + $"希望得到的菜肴:{name}\r\n" + $"价格:{price.CurencyFormat()}({dietModel.EstimatedPrice.CurencyFormat()})\r\n" + $"你当前持有:{count}个,是否确认交易?"; if (!WaiterSvc.WaitForConfirm(MsgDTO.FromGroup, aimQQ, msg, MsgDTO.BindAi, 10)) { MsgSender.PushMsg(MsgDTO, "交易取消!"); return(false); } var sourceDietRec = CookingRecord.Get(MsgDTO.FromQQ); sourceDietRec.AddDiet(name); sourceDietRec.Update(); aimDietRec.DietConsume(name); aimDietRec.Update(); sourceOSPerson.Golds -= price + fee; sourceOSPerson.Update(); var aimOSPerson = OSPerson.GetPerson(aimQQ); aimOSPerson.Golds += price; aimOSPerson.Update(); MsgSender.PushMsg(MsgDTO, "交易完毕!"); return(true); }
public bool Xunyuan(MsgInformationEx MsgDTO, object[] param) { var aimQQ = (long)param[0]; if (aimQQ == MsgDTO.FromQQ) { MsgSender.PushMsg(MsgDTO, "你无法和自己寻缘!"); return(false); } if (!XunYuanMgr.CheckGroup(MsgDTO.FromGroup)) { MsgSender.PushMsg(MsgDTO, "此群正在进行一场寻缘,请稍候再试!"); return(false); } if (!XunYuanMgr.CheckQQNum(MsgDTO.FromQQ)) { MsgSender.PushMsg(MsgDTO, "你正在进行一场寻缘,请稍候再试!"); return(false); } if (!XunYuanMgr.CheckQQNum(aimQQ)) { MsgSender.PushMsg(MsgDTO, "对方正在进行一场寻缘,请稍候再试!"); return(false); } var msg = $"{CodeApi.Code_At(aimQQ)} 你正被邀请参加一次寻缘,是否同意?"; if (!WaiterSvc.WaitForConfirm(MsgDTO.FromGroup, aimQQ, msg, MsgDTO.BindAi)) { MsgSender.PushMsg(MsgDTO, "操作取消!"); return(false); } var Gamers = new[] { MsgDTO.FromQQ, aimQQ }.Select(p => { var armerRecord = PersonArmerRecord.Get(p); var osPerson = OSPerson_Doremi.GetPerson(p); var levelModel = LevelSvc.GetByLevel(osPerson.Level); var battleArmers = Rander.RandSort(armerRecord.Armers.ToArray()).Take(10).ToDictionary(a => a.Key, a => a.Value); return(new XunYuanGamingModel() { QQNum = p, Armers = battleArmers, EscapeArmers = armerRecord.EscapeArmers, BasicHP = levelModel.HP, HP = levelModel.HP + ArmerSvc.CountHP(battleArmers), BasicAttack = levelModel.Atk, Attack = levelModel.Atk + ArmerSvc.CountAtk(battleArmers) }); }).ToArray(); XunYuanMgr.StartGame(Gamers, MsgDTO.FromGroup, MsgDTO.BindAi); return(true); }
public bool SellRedundant(MsgInformationEx MsgDTO, object[] param) { if (OSPersonBuff.CheckBuff(MsgDTO.FromQQ, "快晴")) { MsgSender.PushMsg(MsgDTO, "你无法进行该操作!(快晴)"); return(false); } var record = ItemCollectionRecord.Get(MsgDTO.FromQQ); var ics = record.HonorCollections.Values.SelectMany(hc => hc.Items.Where(p => p.Value > 1)).ToList(); if (ics.IsNullOrEmpty()) { MsgSender.PushMsg(MsgDTO, "你没有任何多余的物品!"); return(false); } var ictm = ics.Select(p => new { p.Key, Count = p.Value - 1, IsLimit = HonorSvc.IsLimitItem(p.Key), Price = HonorSvc.GetItemPrice(HonorSvc.FindItem(p.Key), MsgDTO.FromQQ) }).ToList(); var msg = $"你即将贩卖{ictm.Sum(i => i.Count)}件物品," + $"其中有{ictm.Count(i => i.IsLimit)}件限定物品," + $"共价值{ictm.Sum(p => p.Price * p.Count).CurencyFormat()},是否继续?"; if (!WaiterSvc.WaitForConfirm(MsgDTO, msg)) { MsgSender.PushMsg(MsgDTO, "操作取消!"); return(false); } foreach (var ic in ictm) { record.ItemConsume(ic.Key, ic.Count); } record.Update(); var osPerson = OSPerson.GetPerson(MsgDTO.FromQQ); osPerson.Golds += ictm.Sum(p => p.Price * p.Count); osPerson.Update(); MsgSender.PushMsg(MsgDTO, $"贩卖成功,你当前拥有{osPerson.Golds.CurencyFormat()}!"); return(true); }
public bool MakeGift(MsgInformationEx MsgDTO, object[] param) { var name = param[0] as string; var gift = GiftSvc[name]; if (gift == null) { MsgSender.PushMsg(MsgDTO, "未查找到该礼物!"); return(false); } var sellingGifts = GiftSvc.SellingGifts; if (sellingGifts.All(p => p.Name != name)) { MsgSender.PushMsg(MsgDTO, "该礼物未在礼物商店中出售,请使用 礼物商店 命令查看今日可兑换的礼物!", true); return(false); } var itemRecord = ItemCollectionRecord.Get(MsgDTO.FromQQ); var mdic = itemRecord.HonorCollections.SelectMany(p => p.Value.Items).ToDictionary(p => p.Key, p => p.Value); var osPerson = OSPerson.GetPerson(MsgDTO.FromQQ); if (!gift.Check(mdic, osPerson.Golds, out var msg)) { MsgSender.PushMsg(MsgDTO, $"兑换{name}需要:\r\n{msg}材料不足,无法兑换!"); return(false); } if (!WaiterSvc.WaitForConfirm(MsgDTO, $"兑换{name}需要:\r\n{msg}是否兑换?")) { MsgSender.PushMsg(MsgDTO, "操作取消!"); return(false); } itemRecord.ItemConsume(gift.MaterialDic); itemRecord.Update(); osPerson.Golds -= gift.GoldNeed; osPerson.GiftIncome(name); osPerson.Update(); MsgSender.PushMsg(MsgDTO, "兑换成功!可以使用 赠送礼物 命令将礼物送给其他人!", true); return(true); }
public bool AdvantureAgainst(MsgInformationEx MsgDTO, object[] param) { var aimNum = (long)param[0]; if (MsgDTO.FromQQ == aimNum) { MsgSender.PushMsg(MsgDTO, "你无法跟自己对决!"); return(false); } if (BindAiSvc.AllAiNums.Contains(aimNum)) { MsgSender.PushMsg(MsgDTO, "鱼唇的人类,你无法挑战ai的威严!"); return(false); } if (!AdvGameSvc.CheckGroup(MsgDTO.FromGroup)) { MsgSender.PushMsg(MsgDTO, "本群正在进行一场对决,请稍后再试!"); return(false); } if (!WaiterSvc.WaitForConfirm(MsgDTO.FromGroup, aimNum, $"{CodeApi.Code_At(MsgDTO.FromQQ)} 正在向你发起一场冒险对决,是否接受?", MsgDTO.BindAi, 10)) { MsgSender.PushMsg(MsgDTO, "对决取消!"); return(false); } if (!AdvGameSvc.CheckPlayer(aimNum)) { MsgSender.PushMsg(MsgDTO, "你的对手正在进行一场对决,请稍后再试!"); return(false); } if (!AdvGameSvc.CheckPlayer(MsgDTO.FromQQ)) { MsgSender.PushMsg(MsgDTO, "你正在进行一场对决,请稍后再试!"); return(false); } AdvGameSvc.GameStart(MsgDTO.FromGroup, MsgDTO.FromQQ, aimNum, 1, MsgDTO.BindAi); return(true); }
public bool ExchangeOwner(MsgInformationEx MsgDTO, object[] param) { var aimQQ = (long)param[0]; if (!WaiterSvc.WaitForConfirm(MsgDTO, $"【警告】是否确认将群主移交给 {CodeApi.Code_At(aimQQ)}?(此操作不可逆)")) { MsgSender.PushMsg(MsgDTO, "操作取消!"); return(false); } var setting = GroupSettingSvc[MsgDTO.FromGroup]; setting.AuthInfo.Owner = aimQQ; setting.Update(); MsgSender.PushMsg(MsgDTO, "已成功移交群主!"); return(true); }
public bool StartAdv(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); if (asset.GreenAmbur == 0 && asset.BlueAmbur == 0) { MsgSender.PushMsg(MsgDTO, "很抱歉,你没有任何琥珀,无法开启副本!"); return(false); } if (asset.GreenAmbur > 0) { asset.GreenAmbur -= 1; } else { if (!WaiterSvc.WaitForConfirm(MsgDTO, $"此操作将消耗 碧蓝琥珀*1 (你当前剩余 {asset.BlueAmbur}),是否继续?")) { MsgSender.PushMsg(MsgDTO, "操作取消!"); return(false); } asset.BlueAmbur -= 1; } asset.Update(); var engine = new ArchAdvEngine(MsgDTO); engine.StartAdv(); return(true); }
private bool SellHonor(MsgInformationEx MsgDTO, string honorName) { var colleRec = ItemCollectionRecord.Get(MsgDTO.FromQQ); if (colleRec.HonorCollections.IsNullOrEmpty()) { MsgSender.PushMsg(MsgDTO, "你尚未拥有任何物品!"); return(false); } var items = HonorSvc.FindHonor(honorName).Items; var honorCollection = colleRec.HonorCollections; if (!honorCollection.ContainsKey(honorName) || honorCollection[honorName].Items.Count < items.Count) { MsgSender.PushMsg(MsgDTO, "你尚未集齐该成就下的所有物品!"); return(false); } var price = HonorSvc.GetHonorPrice(honorName, MsgDTO.FromQQ); var msg = $"贩卖此成就将获得 {price.CurencyFormat()},是否确认贩卖?"; if (!WaiterSvc.WaitForConfirm(MsgDTO, msg)) { MsgSender.PushMsg(MsgDTO, "交易取消!"); return(false); } var osPerson = OSPerson.GetPerson(MsgDTO.FromQQ); TransHelper.SellHonorToShop(colleRec, honorName, osPerson); colleRec.Update(); osPerson.Update(); MsgSender.PushMsg(MsgDTO, $"贩卖成功!你当前拥有金币 {osPerson.Golds.CurencyFormat()}"); return(true); }
public bool RefreshVipShop(MsgInformationEx MsgDTO, object[] param) { var osPerson = OSPerson.GetPerson(MsgDTO.FromQQ); if (osPerson.Diamonds < 10) { MsgSender.PushMsg(MsgDTO, $"很抱歉,你当前的钻石余额不足,无法刷新vip商店!({osPerson.Diamonds}/10)"); return(false); } if (!WaiterSvc.WaitForConfirm(MsgDTO, $"此操作将花费{10.CurencyFormat("Diamond")},是否继续?")) { MsgSender.PushMsg(MsgDTO, "操作取消!"); return(false); } osPerson.Diamonds -= 10; osPerson.Update(); DailyVipGoodsRecord.Refresh(MsgDTO.FromQQ); MsgSender.PushMsg(MsgDTO, "刷新成功!"); return(true); }
public bool Cook(MsgInformationEx MsgDTO, object[] param) { var dietName = param[0] as string; var Diet = CookingDietSvc[dietName]; if (Diet == null) { MsgSender.PushMsg(MsgDTO, "未查找到相关菜肴名称!"); return(false); } var pet = PetRecord.Get(MsgDTO.FromQQ); if (pet.Level < Diet.Level) { MsgSender.PushMsg(MsgDTO, $"{pet.Name}的等级太低,还不能烹饪该菜肴!({pet.Level}/{Diet.Level})"); return(false); } var cookingRec = CookingRecord.Get(MsgDTO.FromQQ); if (cookingRec.LearndDietMenu.IsNullOrEmpty() || !cookingRec.LearndDietMenu.Contains(dietName)) { MsgSender.PushMsg(MsgDTO, $"你尚未学会{dietName}的烹饪方法!(可使用【{Diet.ExchangeHonor}】兑换,详情请参见【帮助 兑换菜谱】)"); return(false); } var falvoringNeedStr = string.Join(",", Diet.Flavorings.Select(f => $"{f.Key}({cookingRec.FlavoringDic.GetDicValueSafe(f.Key)}/{f.Value})")); if (!Diet.Flavorings.IsNullOrEmpty() && !cookingRec.CheckFlavorings(Diet.Flavorings)) { MsgSender.PushMsg(MsgDTO, $"调味料不足!({falvoringNeedStr})"); return(false); } var itemColle = ItemCollectionRecord.Get(MsgDTO.FromQQ); var allitems = itemColle.AllItemsDic; var materialNeedStr = string.Join(",", Diet.Materials.Select(m => $"{m.Key}({allitems.GetDicValueSafe(m.Key)}/{m.Value})")); if (!Diet.Materials.IsNullOrEmpty() && !itemColle.CheckItem(Diet.Materials)) { MsgSender.PushMsg(MsgDTO, $"材料不足!({materialNeedStr})"); return(false); } var msg = $"烹饪 {dietName} 将需要消耗\r\n{falvoringNeedStr}\r\n{materialNeedStr}\r\n是否确认?"; if (!WaiterSvc.WaitForConfirm(MsgDTO, msg)) { MsgSender.PushMsg(MsgDTO, "操作取消!"); return(false); } cookingRec.FlavoringConsume(Diet.Flavorings); itemColle.ItemConsume(Diet.Materials); cookingRec.AddDiet(dietName); cookingRec.Update(); itemColle.Update(); MsgSender.PushMsg(MsgDTO, "烹饪成功!"); return(true); }
public bool Fight(MsgInformationEx MsgDTO, object[] param) { var aimQQ = (long)param[0]; if (aimQQ == MsgDTO.FromQQ) { MsgSender.PushMsg(MsgDTO, "你无法挑战你自己!"); return(false); } if (!PetAgainstSvc.CheckGroup(MsgDTO.FromGroup)) { MsgSender.PushMsg(MsgDTO, "本群正在进行一场宠物对决,请稍后再试!"); return(false); } if (!PetAgainstSvc.CheckQQ(MsgDTO.FromQQ)) { MsgSender.PushMsg(MsgDTO, "你的宠物正在进行一场宠物对决,请稍后再试!"); return(false); } if (!PetAgainstSvc.CheckQQ(aimQQ)) { MsgSender.PushMsg(MsgDTO, "你的对手正在进行一场宠物对决,请稍后再试!"); return(false); } if (BindAiSvc.AllAiNums.Contains(aimQQ)) { MsgSender.PushMsg(MsgDTO, "鱼唇的人类,你无法挑战AI的威严!", true); return(false); } var sourcePet = PetRecord.Get(MsgDTO.FromQQ); var expRec = ExpeditionRecord.GetLastest(MsgDTO.FromQQ); if (expRec != null && expRec.IsExpediting) { MsgSender.PushMsg(MsgDTO, $"{sourcePet.Name}正在【{expRec.Scene}】进行一项伟大的远征,请于{expRec.EndTime:yyyy-MM-dd HH:mm:ss}后再试!"); return(false); } if (sourcePet.Level < 3) { MsgSender.PushMsg(MsgDTO, $"{sourcePet.Name}还没到3级,无法参加宠物对决!"); return(false); } var aimPet = PetRecord.Get(aimQQ); if (aimPet.Level < 3) { MsgSender.PushMsg(MsgDTO, "对方的宠物还没到3级,无法参加宠物对决!"); return(false); } expRec = ExpeditionRecord.GetLastest(aimQQ); if (expRec != null && expRec.IsExpediting) { MsgSender.PushMsg(MsgDTO, $"{aimPet.Name}正在【{expRec.Scene}】进行一项伟大的远征,请于{expRec.EndTime:yyyy-MM-dd HH:mm:ss}后再试!"); return(false); } if (!WaiterSvc.WaitForConfirm(MsgDTO.FromGroup, aimQQ, "你被邀请参加一场宠物对决,是否同意?", MsgDTO.BindAi, 10)) { MsgSender.PushMsg(MsgDTO, "对决取消!"); return(false); } PetAgainstSvc.StartGame(sourcePet, aimPet, MsgDTO.FromGroup, MsgDTO.BindAi); return(true); }
private bool DealItem(MsgInformationEx MsgDTO, string name, long aimQQ, int price) { var aimRecord = ItemCollectionRecord.Get(aimQQ); if (!aimRecord.CheckItem(name)) { MsgSender.PushMsg(MsgDTO, "对方没有该物品!"); return(false); } var originPrice = HonorSvc.GetItemPrice(HonorSvc.FindItem(name), aimQQ); if (originPrice > price) { MsgSender.PushMsg(MsgDTO, $"收购价格无法低于系统价格({originPrice.CurencyFormat()})!"); return(false); } var sourceOSPerson = OSPerson.GetPerson(MsgDTO.FromQQ); var fee = OSPersonBuff.CheckBuff(MsgDTO.FromQQ, "苍天") ? 0 : price / 20; if (sourceOSPerson.Golds < price + fee) { MsgSender.PushMsg(MsgDTO, "你没有足够的金币来支付!"); return(false); } var count = aimRecord.GetCount(name); var msg = $"收到来自 {CodeApi.Code_At(MsgDTO.FromQQ)} 的交易请求:\r\n" + $"希望得到的物品:{name}\r\n" + $"价格:{price.CurencyFormat()}({originPrice.CurencyFormat()})\r\n" + $"你当前持有:{count}个,是否确认交易?"; if (!WaiterSvc.WaitForConfirm(MsgDTO.FromGroup, aimQQ, msg, MsgDTO.BindAi, 10)) { MsgSender.PushMsg(MsgDTO, "交易取消!"); return(false); } aimRecord.ItemConsume(name); aimRecord.Update(); var sourceRecord = ItemCollectionRecord.Get(MsgDTO.FromQQ); var content = sourceRecord.ItemIncome(name); if (!string.IsNullOrEmpty(content)) { MsgSender.PushMsg(MsgDTO, content, true); } var aimOSPerson = OSPerson.GetPerson(aimQQ); sourceOSPerson.Golds -= price + fee; aimOSPerson.Golds += price; sourceOSPerson.Update(); aimOSPerson.Update(); MsgSender.PushMsg(MsgDTO, "交易完毕!"); return(true); }