예제 #1
0
 public bool HaveGemCanImprove(GameCmd.EquipPos pos, GameCmd.GemType gemType)
 {
     for (EquipManager.EquipGridIndexType i = EquipManager.EquipGridIndexType.First; i < EquipManager.EquipGridIndexType.Max; i++)
     {
         if (JudgeEquipPosCanInlay(pos, i, gemType))
         {
             return(true);
         }
     }
     return(false);
 }
예제 #2
0
 public GemInlayUpdateData GetGemInlayUpdateData(GameCmd.GemType gemType)
 {
     return(mdicCanInlayDatas.ContainsKey(gemType) ? mdicCanInlayDatas[gemType] : null);
 }
예제 #3
0
    public bool JudgeEquipPosCanInlay(GameCmd.EquipPos pos, EquipManager.EquipGridIndexType index, GameCmd.GemType gemType)
    {
        uint inlayBaseId = 0;
        int  matchNum    = 0;

        if (!emgr.IsUnlockEquipGridIndex(index))
        {
            return(false);
        }
        else if (emgr.TryGetEquipGridInlayGem(pos, index, out inlayBaseId))
        {
            Gem InlayItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <Gem>(inlayBaseId, ItemDefine.ItemDataType.Gem);
            //镶嵌的宝石小与背包的宝石?
            StructGemInlayDatas(pos);
            GemInlayUpdateData updateData = GetGemInlayUpdateData(gemType);
            if (null != updateData)
            {
                updateData.HaveGemCanInlay = false;
                uint canInlayBaseId = 0;
                if (null != updateData && updateData.TryGetCanInlayGem(out canInlayBaseId))
                {
                    Gem canInlayItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <Gem>(canInlayBaseId, ItemDefine.ItemDataType.Gem);
                    if (InlayItem != null && canInlayItem != null)
                    {
                        bool higher = canInlayItem.FightPowerNum > InlayItem.FightPowerNum;
                        if (higher)
                        {
                            matchNum++;
                            updateData.HaveGemCanInlay = true;
                        }
                    }
                }
            }
        }
        else
        {
            StructGemInlayDatas(pos);
            GemInlayUpdateData updateData = GetGemInlayUpdateData(gemType);
            if (null != updateData)
            {
                updateData.HaveGemCanInlay = false;
                uint canInlayBaseId = 0;
                if (null != updateData && updateData.TryGetCanInlayGem(out canInlayBaseId))
                {
                    matchNum++;
                    updateData.HaveGemCanInlay = true;
                }
            }
        }
        return(matchNum > 0);
    }
예제 #4
0
 public GemInlayUpdateData(GameCmd.GemType gmType)
 {
     this.m_emGemType = gmType;
     Reset();
     itemmgr = DataManager.Manager <ItemManager>();
 }