예제 #1
0
 protected Dictionary <AttrType, float> GetDataPool(DataManager.DataPoolType type)
 {
     if (!this._dataPool.ContainsKey(type))
     {
         this._dataPool.Add(type, new Dictionary <AttrType, float>());
     }
     return(this._dataPool[type]);
 }
예제 #2
0
    public float GetAttr(DataManager.DataPoolType DataPoolType, AttrType type)
    {
        Dictionary <AttrType, float> dataPool = this.GetDataPool(DataPoolType);

        if (!dataPool.ContainsKey(type))
        {
            dataPool.Add(type, 0f);
        }
        return(dataPool[type]);
    }
예제 #3
0
    protected float SetAttr(DataManager.DataPoolType dataPoolType, AttrType attrType, float value)
    {
        Dictionary <AttrType, float> dataPool = this.GetDataPool(dataPoolType);

        if (!dataPool.ContainsKey(attrType))
        {
            dataPool.Add(attrType, value);
        }
        else
        {
            dataPool[attrType] = value;
        }
        return(value);
    }
예제 #4
0
    protected float SetAttr(DataManager.DataPoolType dataPoolType, AttrType attrType, float value)
    {
        if (CharacterDataMgr.instance != null && dataPoolType == DataManager.DataPoolType.CurrentData)
        {
            AttrNumberData attrNumberData = CharacterDataMgr.instance.GetAttrNumberData(attrType);
            if (attrNumberData != null)
            {
                if (value > attrNumberData.m_fMaxValue)
                {
                    value = attrNumberData.m_fMaxValue;
                }
                else if (value < attrNumberData.m_fMinValue)
                {
                    value = attrNumberData.m_fMinValue;
                }
            }
        }
        this._dataPool[(int)dataPoolType][(int)attrType] = value;
        if (dataPoolType == DataManager.DataPoolType.CurrentData && this.self.isPlayer)
        {
            switch (attrType)
            {
            case AttrType.Attack:
            case AttrType.Armor:
            case AttrType.MoveSpeed:
            case AttrType.AttackSpeed:
                goto IL_AA;

            case AttrType.DodgeProp:
IL_90:
                switch (attrType)
                {
                case AttrType.MagicResist:
                case AttrType.MagicPower:
                    goto IL_AA;
                }
                return(value);
            }
            goto IL_90;
IL_AA:
            MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)25057, new MsgData_AttrChangeData
            {
                nType  = (int)attrType,
                fValue = value
            }, 0f);
            MobaMessageManager.ExecuteMsg(message);
        }
        return(value);
    }
예제 #5
0
 protected float[] GetDataPool(DataManager.DataPoolType type)
 {
     return(this._dataPool[(int)type]);
 }
예제 #6
0
 public float GetAttr(DataManager.DataPoolType DataPoolType, AttrType type)
 {
     return(this._dataPool[(int)DataPoolType][(int)type]);
 }