Esempio n. 1
0
    // 等级提升的加成,即:累加每一级的属性值 [5/26/2015 Zmy]
    public float GetAppendLevelAttributeValue(EM_EXTEND_ATTRIBUTE nType)
    {
        if (m_pRowData.getLevel() <= 1)
        {
            return(0);
        }
        float nSum = 0;

        for (int nLevel = m_pRowData.getLevel() - 1; nLevel >= 1; nLevel--)
        {
            int nTableID             = m_pRowData.GetID() - (m_pRowData.getLevel() - nLevel);//上一级的ID = 当前ID  - (当前等级与上一级的差值)
            ArtifactTemplate _tmpRow = (ArtifactTemplate)DataTemplate.GetInstance().m_ArtifactTable.getTableData(nTableID);
            if (_tmpRow != null && _tmpRow.getLevel() == nLevel)
            {
                for (int i = 0; i < GlobalMembers.MAX_ARTIFACT_HERO_COUNT; i++)
                {
                    if (_tmpRow.getAttriType()[i] == (int)nType)
                    {
                        nSum += _tmpRow.getAttriValue()[i];
                        break;
                    }
                }
            }
        }
        return(nSum);
    }
Esempio n. 2
0
 // 属性加成值 [5/26/2015 Zmy]
 public float GetAppendArrtibuteValue(EM_EXTEND_ATTRIBUTE nType)
 {
     for (int i = 0; i < GlobalMembers.MAX_ARTIFACT_HERO_COUNT; i++)
     {
         if (m_pRowData.getAttriType()[i] == (int)nType)
         {
             return(m_pRowData.getAttriValue()[i]);
         }
     }
     return(0);
 }
Esempio n. 3
0
    void Show(ArtifactTemplate artifact, bool isReach)
    {
        // 英雄 ID
        int[] heroID     = artifact.getHeroID();
        int[] heroNumber = artifact.getHeroNum();

        // 初始化属性数据
        int[] attrType  = artifact.getAttriType();
        int[] attrValue = artifact.getAttriValue();
        for (int i = 0; i < attrType.Length; i++)
        {
            if (attrType[i] == -1)
            {
                continue;
            }

            _attributeList.transform.GetChild(i).gameObject.SetActive(true);
            Text attrNameText  = _attributeList.transform.GetChild(i).FindChild("AttrName").GetComponent <Text>();
            Text attrValueText = _attributeList.transform.GetChild(i).FindChild("AttrValue").GetComponent <Text>();
            Text attrStateText = _attributeList.transform.GetChild(i).FindChild("AttrState").GetComponent <Text>();
            attrStateText.color = new Color(133.0f / 255, 247.0f / 255, 32.0f / 255);
            if (isReach)
            {
                attrValueText.text = attrValue[i].ToString();
            }
            else
            {
                attrValueText.text = "0";
                string str = GameUtils.getString("relics_content5");
                attrStateText.text = string.Format(str, attrValue[i].ToString());
            }
            switch (attrType[i])
            {
            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_MAXHP:
            {
                attrNameText.text = GameUtils.getString("baseattribute1des");
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_PHYSICALATTACK:
            {
                attrNameText.text = GameUtils.getString("hero_train_type2");
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_PHYSICALDEFENCE:
            {
                attrNameText.text = GameUtils.getString("hero_train_type4");
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_MAGICATTACK:
            {
                attrNameText.text = GameUtils.getString("hero_train_type3");
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_MAGICDEFENCE:
            {
                attrNameText.text = GameUtils.getString("hero_train_type5");
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_HIT:
            {
                attrNameText.text = GameUtils.getString("baseattribute6des");
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_DODGE:
            {
                attrNameText.text = GameUtils.getString("baseattribute7des");
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_CRITICAL:
            {
                attrNameText.text = GameUtils.getString("baseattribute8des");
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_TENACITY:
            {
                attrNameText.text = GameUtils.getString("baseattribute9des");
            }
            break;

            default:
                break;
            }
        }
    }