public bool MyStatus(MsgInformationEx MsgDTO, object[] param) { var archaeologist = Archaeologist.Get(MsgDTO.FromQQ); var collection = ArchCollection.Get(MsgDTO.FromQQ); var msgList = new List <string>() { $"SAN:{archaeologist.CurSAN}/{archaeologist.SAN}", $"{Emoji.雪花}:{archaeologist.Ice}", $"{Emoji.火焰}:{archaeologist.Flame}", $"{Emoji.闪电}:{archaeologist.Lightning}", $"收藏品碎片:{collection.ItemColles.Sum(p => p.Segments.Sum(s => s.Value))}", $"收藏品:{collection.Collectables.Sum(p => p.Value)}", $"特殊收藏品:{collection.SpecialColles.Count}", $"地图碎片:{collection.MapSegments}" }; if (archaeologist.IsDead) { msgList.Add($"复活时间:{archaeologist.RebornTime:yyyy-MM-dd HH:mm:ss}"); } var msg = string.Join("\r\n", msgList); MsgSender.PushMsg(MsgDTO, msg); return(true); }
public bool MyColles(MsgInformationEx MsgDTO, object[] param) { var collection = ArchCollection.Get(MsgDTO.FromQQ); if (collection.Collectables.IsNullOrEmpty()) { MsgSender.PushMsg(MsgDTO, "你没有任何考古收藏品!", true); return(false); } var msg = $"你当前拥有的考古收藏品有:\r\n{collection.Collectables.Select(p => $"{p.Key}*{p.Value}").JoinToString(",")}"; MsgSender.PushMsg(MsgDTO, msg); return(true); }
public bool SpecialColles(MsgInformationEx MsgDTO, object[] param) { var collection = ArchCollection.Get(MsgDTO.FromQQ); if (collection.SpecialColles.IsNullOrEmpty()) { MsgSender.PushMsg(MsgDTO, "你没有任何特殊收藏品!", true); return(false); } var msg = $"你当前拥有的特殊收藏品有:\r\n{collection.SpecialColles.JoinToString(",")}"; MsgSender.PushMsg(MsgDTO, msg); return(true); }
public bool ItemColles(MsgInformationEx MsgDTO, object[] param) { var collection = ArchCollection.Get(MsgDTO.FromQQ); if (collection.ItemColles.IsNullOrEmpty()) { MsgSender.PushMsg(MsgDTO, "你没有任何收藏品碎片!", true); return(false); } var msgs = collection.ItemColles.Select(p => $"{p.Name}:{p.Segments.OrderBy(s => s.Key).Select(s => $"{s.Key}*{s.Value}").JoinToString(",")}"); MsgSender.PushMsg(MsgDTO, msgs.JoinToString("\r\n")); return(true); }
public static ArchCollection Get(long QQNum) { var rec = MongoService <ArchCollection> .GetOnly(p => p.QQNum == QQNum); if (rec != null) { return(rec); } rec = new ArchCollection() { QQNum = QQNum }; MongoService <ArchCollection> .Insert(rec); return(rec); }
public bool CombineSegments(MsgInformationEx MsgDTO, object[] param) { var collection = ArchCollection.Get(MsgDTO.FromQQ); if (collection.ItemColles.IsNullOrEmpty()) { MsgSender.PushMsg(MsgDTO, "你没有任何收藏品碎片!", true); return(false); } if (collection.ItemColles.All(p => p.Segments.IsNullOrEmpty() || p.Segments.Count < 10)) { MsgSender.PushMsg(MsgDTO, "你没有任何可以合成的收藏品碎片!", true); return(false); } var combineDic = SafeDictionary <string, int> .Empty; var aimColle = collection.ItemColles.FirstOrDefault(p => !p.Segments.IsNullOrEmpty() && p.Segments.Count >= 10); while (aimColle != null) { combineDic[aimColle.Name] += 1; foreach (var segmentsKey in aimColle.Segments.Keys) { aimColle.Segments[segmentsKey] -= 1; } aimColle.Segments.Remove(p => p == 0); collection.ItemColles.Remove(p => p.Segments.IsNullOrEmpty()); aimColle = collection.ItemColles.FirstOrDefault(p => !p.Segments.IsNullOrEmpty() && p.Segments.Count >= 10); } collection.AddCollections(combineDic.Data); collection.Update(); var msg = collection.Collectables.Select(p => $"{p.Key}*{p.Value}").JoinToString(","); MsgSender.PushMsg(MsgDTO, $"合成成功!你获得以下收藏品:\r\n{msg}"); return(true); }