예제 #1
0
 private void ResetStrengthConsume(INotifyArgs args)
 {
     if (!m_itemFielInfo.IsFullLev())
     {
         int upNeedLev;
         int skillManaValue = m_itemFielInfo.UpgradeConsume(out m_enough, out m_reachUpLev, out upNeedLev);
         //铜币是否足够
         if (m_enough)
         {
             UpgradeConsume.text = "[fffa6f]" + skillManaValue.ToString() + "[-]";
         }
         else
         {
             UpgradeConsume.text = "[fe768b]" + skillManaValue.ToString() + "[-]";
         }
     }
 }
예제 #2
0
    /// <summary>
    /// 根据传入数据实体,初始化技能
    /// </summary>
    /// <param name="itemFielInfo">Item fiel info.</param>
    public void InitItemData(SingleSkillInfo itemFielInfo)
    {
        var hasInfo = itemFielInfo != null;

        Normal.SetActive(hasInfo);
        Empty.SetActive(!hasInfo);
        UnLock.SetActive(hasInfo);
        ItemFielInfo = itemFielInfo;

        if (SkillIconPoint.childCount > 0)
        {
            SkillIconPoint.ClearChild();
        }
        if (hasInfo)
        {
            if (itemFielInfo.IsUnlock())
            {
                Normal.SetActive(true);
                UnLock.SetActive(false);
                BreakLev.text = (itemFielInfo.localSkillData.m_breakLevel - 1).ToString();
                int  skillLev  = itemFielInfo.SkillLevel;
                int  maxLev    = itemFielInfo.localSkillData.m_maxLv;
                bool isFullLev = itemFielInfo.IsFullLev();
                FullLev.SetActive(isFullLev);
                NotFullLev.SetActive(!isFullLev);
                if (!isFullLev)
                {
                    SkillLev.text = skillLev.ToString();
                }
                EquipChange();
            }
            else
            {
                Normal.SetActive(false);
                UnLock.SetActive(true);
                UnLockLev.text = itemFielInfo.localSkillData.m_unlockLevel.ToString();
            }
            var skillIcon = NGUITools.AddChild(SkillIconPoint.gameObject, ItemFielInfo.localSkillData.m_icon);
            skillIcon.transform.localScale = new Vector3(90, 90, 1);
        }
    }
예제 #3
0
    public void InitViewInfo(SingleSkillInfo itemFielInfo)
    {
        m_itemFielInfo = itemFielInfo;
        bool   isNull      = itemFielInfo == null;
        string skillName   = isNull?"":LanguageTextManager.GetString(itemFielInfo.localSkillData.m_name);
        string breakLev    = isNull?"":ConvertBreakLev(itemFielInfo.localSkillData.m_breakLevel);
        string skillLev    = isNull?"":itemFielInfo.SkillLevel.ToString();
        string skillDesc   = isNull?"":LanguageTextManager.GetString(itemFielInfo.localSkillData.m_descSimple);
        string skillPower  = isNull?"":SkillValue.GetSkillValue(itemFielInfo.SkillLevel, itemFielInfo.localSkillData.m_mightParams).ToString();
        string skillHitNum = isNull?"":itemFielInfo.localSkillData.m_skillAttacktimes.ToString();
        string skillCDTime = isNull?"":itemFielInfo.localSkillData.m_coolDown.ToString();

        //float[] skillHurts=itemFielInfo.localSkillData.m_skillDamage;
        if (!isNull)
        {
            //向下取整((向下取整((参数1×(技能等级)^2+参数2×技能等级+参数3)/参数4)×参数4) /1000)*100%
            //int skillHurt = Mathf.FloorToInt((Mathf.FloorToInt((skillHurts[0] * Mathf.Pow(itemFielInfo.SkillLevel, 2) + skillHurts[1] * itemFielInfo.SkillLevel + skillHurts[2]) / skillHurts[3]) * skillHurts[3]) / 1000) * 100;
            //2014-8-27策划修改
            //向下取整((向下取整((参数1×(技能等级)^2+参数2×技能等级+参数3)/参数4)×参数4) /10)
//            int skillHurt = Mathf.FloorToInt((Mathf.FloorToInt((skillHurts[0] * Mathf.Pow(itemFielInfo.SkillLevel, 2) + skillHurts[1] * itemFielInfo.SkillLevel + skillHurts[2]) / skillHurts[3]) * skillHurts[3]) / 10);
//            SkillHurt.text=skillHurt.ToString();
        }
        else
        {
            SkillHurt.text = string.Empty;
        }
        SkillName.text   = skillName;
        BreakLev.text    = breakLev;
        SkillLev.text    = skillLev;
        SkillDesc.text   = skillDesc;
        SkillPower.text  = skillPower;
        SkillHitNum.text = skillHitNum;
        SkillCDTime.text = skillCDTime;


        SkillUpgradeBtn.gameObject.SetActive(!isNull);
        EffPoint.transform.ClearChild();
        //是否满级处理
        if (itemFielInfo.IsFullLev())
        {
            SkillUpgradeBtn.gameObject.SetActive(false);
            NotReachUpLev.gameObject.SetActive(false);
            NGUITools.AddChild(EffPoint, FullLevEff);

            UpgradeConsume.text = "0";
        }
        else
        {
            int upNeedLev;
            int skillManaValue = itemFielInfo.UpgradeConsume(out m_enough, out m_reachUpLev, out upNeedLev);
            SkillUpgradeBtn.gameObject.SetActive(true);

            //铜币是否足够
            if (m_enough)
            {
                SkillUpgradeBtn.Enable = true;
                UpgradeConsume.text    = "[fffa6f]" + skillManaValue.ToString() + "[-]";
                if (m_reachUpLev)
                {
                    NGUITools.AddChild(EffPoint, UpgradeBtnEff);
                }
            }
            else
            {
                //SkillUpgradeBtn.Enable=false;
                UpgradeConsume.text = "[fe768b]" + skillManaValue.ToString() + "[-]";
            }
            NotReachUpLev.text = m_reachUpLev?"":string.Format(LanguageTextManager.GetString("IDS_I7_14"), upNeedLev);
            NotReachUpLev.gameObject.SetActive(!m_reachUpLev);
            SkillUpgradeBtn.gameObject.SetActive(m_reachUpLev);
        }
        //选中特效
    }