Esempio n. 1
0
        public bool ConsumeRedStarStone_Re(MsgInformationEx MsgDTO, object[] param)
        {
            var asset = ArchAsset.Get(MsgDTO.FromQQ);

            if (asset.RedStarStone == 0)
            {
                MsgSender.PushMsg(MsgDTO, "赤星石不足!", true);
                return(false);
            }

            var buffs = OSPersonBuff.Get(MsgDTO.FromQQ);

            if (buffs.IsNullOrEmpty() || buffs.All(p => p.IsPositive))
            {
                MsgSender.PushMsg(MsgDTO, "你没有任何负面状态!");
                return(false);
            }

            foreach (var buff in buffs.Where(p => !p.IsPositive))
            {
                buff.Remove();
            }

            asset.RedStarStone--;
            asset.Update();

            MsgSender.PushMsg(MsgDTO, "赤星净化(驱散成功)!");
            return(true);
        }
Esempio n. 2
0
        public bool ViewItem(MsgInformationEx MsgDTO, object[] param)
        {
            var osPerson      = OSPerson.GetPerson(MsgDTO.FromQQ);
            var itemRecord    = ItemCollectionRecord.Get(MsgDTO.FromQQ);
            var glamourRecord = GlamourRecord.Get(MsgDTO.FromGroup, MsgDTO.FromQQ);

            var normalHonors = itemRecord.HonorCollections.Where(h => h.Value.Type == HonorType.Normal).ToList();
            var items        = normalHonors.Select(p => p.Value).SelectMany(h => h.Items.Keys).ToList();

            var allNormalItems = HonorSvc.HonorList.Where(h => !h.IsLimit).SelectMany(h => h.Items).Select(p => p.Name).ToArray();

            var msgList = new List <string>();

            if (!osPerson.HonorNames.IsNullOrEmpty())
            {
                msgList.Add(string.Join("", osPerson.HonorNames.Select(h => $"【{h}】")));
            }
            msgList.Add($"等级:{osPerson.EmojiLevel}");
            msgList.Add($"经验值:{items.Count}/{allNormalItems.Length}{(items.Count == allNormalItems.Length ? "(可转生)" : string.Empty)}");

            msgList.Add($"金币:{osPerson.Golds.CurencyFormat()}");
            if (osPerson.Diamonds > 0)
            {
                msgList.Add($"钻石:{osPerson.Diamonds.CurencyFormat("Diamond")}");
            }
            msgList.Add($"物品数量:{itemRecord.TotalItemCount()}");
            msgList.Add($"成就数量:{itemRecord.HonorList?.Count ?? 0}");
            if (glamourRecord.Glamour > 0)
            {
                msgList.Add($"魅力值:{glamourRecord.Glamour}");
            }

            var buffs = OSPersonBuff.Get(MsgDTO.FromQQ);

            if (!buffs.IsNullOrEmpty())
            {
                msgList.Add("Buff列表:");
                msgList.AddRange(buffs.Select(b => $"{b.Name}:{b.Description}({b.ExpiryTime})"));
            }

            MsgSender.PushMsg(MsgDTO, string.Join("\r\n", msgList), true);
            return(true);
        }