Пример #1
0
    /// <summary>
    /// FIXME: 临时函数, 现在直接使用camp_list表里的声望默认值来初始化对不同阵营的声望
    /// </summary>
    private void InitPrestige()
    {
        // camplist表中, 阵营ID从1开始
        uint camp = m_Property.GetCampID();

        if (camp < 1)
        {
            Debug.LogErrorFormat("templateID为{0}的怪阵营错误", m_Property.GetTemplateID());
        }

        CfgEternityProxy cfgEternityProxy = GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy;

        int count = cfgEternityProxy.GetCampCount();

        for (int campIndex = 0; campIndex < count; campIndex++)
        {
            CampList campVO   = cfgEternityProxy.GetCampVOByIndex(campIndex);
            CampNode?campnode = campVO.NodeCampList(campIndex);
            if (!campnode.HasValue)
            {
                Debug.LogError("CampList表错误. 不该出现的错误");
                continue;
            }

            m_Property.SetPrestige(campnode.Value.CampOther, cfgEternityProxy.GetCampRelationVO(camp, campnode.Value.CampOther).Value.PrestigeInit);
        }
    }
Пример #2
0
    /// <summary>
    /// 获取阵营关系
    /// </summary>
    /// <param name="selfCampType">自已的阵营ID</param>
    /// <param name="targetCampType">对方的阵营ID</param>
    /// <returns></returns>
    public CampNode?GetCampRelationVO(uint selfCampType, uint targetCampType)
    {
        CampList campVO = GetCampVOByKey(selfCampType);
        int      count  = campVO.NodeCampListLength;

        for (int i = 0; i < count; i++)
        {
            CampNode?mergeObject = campVO.NodeCampList(i);
            if (mergeObject.HasValue && mergeObject.Value.CampOther == targetCampType)
            {
                return(mergeObject.Value);
            }
        }
        return(null);
    }