Exemplo n.º 1
0
        public AValueData GetValueData(int nValueID, bool bCreateNew)
        {
            if (nValueID < 0 || nValueID >= (int)AValueType.Count)
            {
                return(null);
            }

            if (!Datas.ContainsKey(nValueID))
            {
                if (bCreateNew)
                {
                    ConfigData info = XWorldGameModule.GetGameManager <AValueDefine>().GetAValueInfo(nValueID);
                    if (null == info)
                    {
                        return(null);
                    }
                    AValueData pData = new AValueData(info.GetInt("MaxDepth"));
                    Datas.Add(nValueID, pData);
                    return(pData);
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(Datas[nValueID]);
            }
        }
Exemplo n.º 2
0
        public void OnLoadConfig(ConfigData data)
        {
            int dataID = data.GetInt("DataID");

            m_vConfigDatas.ForceAddList(dataID, data);

            AValueStruct pStruct = GetAValue(dataID, 0, true);

            if (null == pStruct)
            {
                return;
            }

            int nValueID = (int)XWorldGameModule.GetGameManager <AValueDefine>().GetValueID(data.GetString("ValueName"));

            if (nValueID < 0)
            {
                return;
            }
            int   ComputeLevel  = data.GetInt("ComputeLevel");
            int   ComputeMode   = data.GetInt("ComputeMode");
            float AbsoluteValue = data.GetFloat("AbsoluteValue");
            float PercentValue  = data.GetFloat("PercentValue");

            pStruct.SetValueData(nValueID, ComputeLevel, ComputeMode, AbsoluteValue, PercentValue);

            AValueMask pMask = GetAValueMask(dataID, true);

            if (null == pMask)
            {
                pMask.Combine(pStruct);
            }
        }
Exemplo n.º 3
0
        public override bool Check(ActorObj obj, GCommonConditionParam param)
        {
            List <ProjectileClient> projectileList = XWorldGameModule.GetGameManager <ProjectileManager>().GetProjectileByAvatarSkill(obj.ServerID, nSkillID);

            if (null == projectileList || 0 == projectileList.Count)
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 4
0
        public void UpdateSlots(int nSlots, bool bReset)
        {
            if (m_nSlots == nSlots)
            {
                return;
            }

            if (bReset)
            {
                SkillData skillData = XWorldGameModule.GetGameManager <ModifyDataManager>().GetSkillData(DataID);
                if (skillData != null)
                {
                    Clone(skillData, this);
                }
                else
                {
                    return;
                }
            }

            m_nSlots = nSlots;
            if ((m_nSlotsMask & m_nSlots) <= 0)
            {
                return;
            }

            ModifyData modifyData = XWorldGameModule.GetGameManager <ModifyDataManager>().GetSkillSlotsData(DataID);

            if (modifyData == null)
            {
                return;
            }

            for (int i = 0; i < 32; ++i)
            {
                int _slot = 1 << i;
                if (_slot > m_nSlots)
                {
                    break;
                }

                if ((m_nSlots & _slot) <= 0)
                {
                    continue;
                }

                ModifyList modifyList = modifyData.GetModifyList(_slot);
                if (modifyList != null)
                {
                    Combine(modifyList);
                }
            }
        }
Exemplo n.º 5
0
        public float CalcuteScore(bool bUseBalanceValue, bool bPlayer)
        {
            float fScoreAttr = 0;

            for (int i = 0; i < (int)AValueType.Count; ++i)
            {
                AValueInfo info = XWorldGameModule.GetGameManager <AValueDefine>().Infos[i];
                if (bUseBalanceValue)
                {
                    if (bPlayer)
                    {
                        fScoreAttr += (Values[i] - info.fBaseValueBalance) * info.FightFactor;
                    }
                }
                else
                {
                    fScoreAttr += Values[i] * info.FightFactor;
                }
            }
            return(fScoreAttr);
        }
Exemplo n.º 6
0
 public SkillAreaLogic()
 {
     m_pLocalPlayer = XWorldGameModule.GetGameManager <ActorManager>().GetLocalPlayer();
 }