Exemple #1
0
        /// <summary>
        /// 判断能否抽卡,并发送一定的自定义信息
        /// </summary>
        /// <param name="e"></param>
        /// <param name="poolInfo"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public static bool CanGacha(CQGroupMessageEventArgs e, PoolInfo poolInfo, int count)
        {
            if (!Event_GroupMessage.GroupInini(e))
            {
                return(false);
            }
            if (!Event_GroupMessage.IDExist(e))
            {
                e.FromGroup.SendGroupMessage(Event_GroupMessage.noReg.Replace("<@>", $"[CQ:at,qq={e.FromQQ.Id}]"));
                return(false);
            }
            int diamond = Event_GroupMessage.GetDiamond(e);

            if (diamond < count * poolInfo.PerGachaConsumption)
            {
                e.FromGroup.SendGroupMessage(Event_GroupMessage.lowDiamond.Replace("<@>", $"[CQ:at,qq={e.FromQQ.Id}]").Replace("<#>", diamond.ToString()));
                return(false);
            }
            e.FromGroup.SendGroupMessage(Event_GroupMessage.BP10.Replace("<@>", $"[CQ:at,qq={e.FromQQ.Id}]"));
            return(true);
        }