少年修仙传客户端代码仓库
client_linchunjie
2018-11-07 1353fa6afbfbf1f01a745253fa380ffbdb05df3b
System/Chat/ChatBubbleModel.cs
@@ -68,33 +68,26 @@
            return chatBubbles.TryGetValue(id, out bubble);
        }
        public bool IsBubbleGot(int id, out int reason)
        public bool IsBubbleGot(int id)
        {
            ChatBubble bubble;
            reason = 0;
            if (TryGetBubble(id, out bubble))
            {
                var config = Config.Instance.Get<ChatBubbleBoxConfig>(id);
                if (config.NeedLV != 0)
                {
                    reason = 1;
                    return PlayerDatas.Instance.baseData.LV >= config.NeedLV;
                }
                if (config.NeedVIPLVGift != 0)
                {
                    reason = 2;
                    var gift = vipModel.GetVipGift(config.NeedVIPLVGift);
                    return gift != null && gift.hasBuy;
                }
                bool got = false;
                try
                {
                    reason = 3;
                    return MathUtility.GetBitValue(bubbleState, (ushort)id);
                    got = MathUtility.GetBitValue(bubbleState, (ushort)id);
                }
                catch (ArgumentOutOfRangeException)
                {
                    DebugEx.LogError("目前不支持id超过31的聊天框:" + id);
                }
                if (!got && config.NeedLV != 0)
                {
                    return PlayerDatas.Instance.baseData.LV >= config.NeedLV;
                }
                return got;
            }
            return false;
        }
@@ -112,8 +105,7 @@
        public void SendUseBubble(int id)
        {
            var reason = 0;
            if (!IsBubbleGot(id, out reason))
            if (!IsBubbleGot(id))
            {
                return;
            }