Exemple #1
0
 /// <summary>
 /// 更新拥有形象(强化等级,进阶等级,形象,形象背景)
 /// </summary>
 private void updateCommonInfo()
 {
     if (magicWeapon.getPhaseLv() > 0)
     {
         phaseLv.gameObject.SetActive(true);
         phaseLv.text = "+" + magicWeapon.getPhaseLv().ToString();
     }
     else
     {
         phaseLv.gameObject.SetActive(false);
     }
     magicName.text = QualityManagerment.getQualityColor(magicWeapon.getMagicWeaponQuality()) + magicWeapon.getName();
     ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + magicWeapon.getIconId(), icon);
     strengLv.text      = "Lv." + magicWeapon.getStrengLv().ToString() + "/" + magicWeapon.getMaxStrengLv().ToString();
     icon_bg.spriteName = QualityManagerment.qualityIDtoMagicWeapon(magicWeapon.getMagicWeaponQuality());
     if (starPrefab != null)
     {
         Utils.RemoveAllChild(icon.transform);
         int starLevel = MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(magicWeapon.sid).starLevel;
         if (starLevel > 0)
         {
             ShowStars show = NGUITools.AddChild(icon.gameObject, starPrefab).GetComponent <ShowStars>();
             show.initStar(starLevel, MagicWeaponManagerment.USEDBUMAGIC_ATTRSHOW);
         }
     }
     jobType.gameObject.SetActive(true);
     jobBg.gameObject.SetActive(true);
     if (magicWeapon.getMgType() == JobType.POWER)  //力
     {
         jobType.spriteName = "roleType_2s";
     }
     else if (magicWeapon.getMgType() == JobType.MAGIC)    //魔
     {
         jobType.spriteName = "roleType_5s";
     }
     else if (magicWeapon.getMgType() == JobType.AGILE)    //敏
     {
         jobType.spriteName = "roleType_3s";
     }
     else if (magicWeapon.getMgType() == JobType.POISON)    //毒
     {
         jobType.spriteName = "roleType_4s";
     }
     else if (magicWeapon.getMgType() == JobType.COUNTER_ATTACK)    //反
     {
         jobType.spriteName = "roleType_1s";
     }
     else if (magicWeapon.getMgType() == JobType.ASSIST)    //辅
     {
         jobType.spriteName = "roleType_6s";
     }
     else
     {
         jobType.gameObject.SetActive(false);
         jobBg.gameObject.SetActive(false);
     }
     updateAttrChanges();
     updateSkills();
 }
Exemple #2
0
    /// <summary>
    /// 计算神器所带的已经激活的主动技能附加的战斗力
    /// </summary>
    /// <param name="card"></param>
    /// <returns></returns>
    public int getCardMagicWeaponCombat(Card card)
    {
        if (card.magicWeaponUID == null || card.magicWeaponUID == "")
        {
            return(0);
        }
        MagicWeapon mw = StorageManagerment.Instance.getMagicWeapon(card.magicWeaponUID);

        if (mw == null)
        {
            return(0);
        }
        List <int> activationSkill = mw.activationSkill;//技能对战斗力的影响

        if (activationSkill == null || activationSkill.Count < 1)
        {
            return(0);
        }
        int combatNum = 0;

        for (int i = 0; i < activationSkill.Count; i++)   //遍历所有的激活的神器技能
        {
            SkillSample sample = SkillSampleManager.Instance.getSkillSampleBySid(activationSkill[i]);
            if (sample == null)
            {
                return(combatNum);
            }
            else
            {
                if (sample.showType == 1 || sample.showType == 0)
                {
                    combatNum += (int)(CommandConfigManager.Instance.combatMagicWeapon()[mw.getMaxPhaseLv()] * Math.Pow(mw.getPhaseLv(), CommandConfigManager.Instance.combatMagicNum()));
                    return(combatNum);
                }
            }
        }
        return(combatNum);
    }
Exemple #3
0
 /// <summary>
 /// 更新拥有形象(强化等级,进阶等级,形象,形象背景)
 /// </summary>
 private void updateCommonInfo()
 {
     if (magicWeapon.getPhaseLv() > 0)
     {
         phaseLv.gameObject.SetActive(true);
         phaseLv.text = "+" + magicWeapon.getPhaseLv().ToString();
     }
     else
     {
         phaseLv.gameObject.SetActive(false);
     }
     towerBar.updateValue((float)magicWeapon.getLuckNumber(), (float)100);
     towerValue.text = magicWeapon.getLuckNumber() + "%";
     magicName.text  = QualityManagerment.getQualityColor(magicWeapon.getMagicWeaponQuality()) + magicWeapon.getName();
     phaseNum.text   = magicWeapon.getPhaseLv() + "/" + magicWeapon.getMaxPhaseLv();
     phaseButton.disableButton(false);
     if (magicWeapon.getPhaseLv() == magicWeapon.getMaxPhaseLv())
     {
         phaseNum.text = LanguageConfigManager.Instance.getLanguage("magicweapLiii03");
         //phaseButton.disableButton(true);
     }
     updateSuccess();
     ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + magicWeapon.getIconId(), icon);
     icon_bg.spriteName = QualityManagerment.qualityIDtoMagicWeapon(magicWeapon.getMagicWeaponQuality());
     if (starPrefab != null)
     {
         Utils.RemoveAllChild(icon.transform);
         int starLevel = MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(magicWeapon.sid).starLevel;
         if (starLevel > 0)
         {
             ShowStars show = NGUITools.AddChild(icon.gameObject, starPrefab).GetComponent <ShowStars>();
             show.initStar(starLevel, MagicWeaponManagerment.USEDBUMAGIC_ATTRSHOW);
         }
     }
     //职业显示
     jobType.gameObject.SetActive(true);
     jobBg.gameObject.SetActive(true);
     if (magicWeapon.getMgType() == JobType.POWER)  //力
     {
         jobType.spriteName = "roleType_2s";
     }
     else if (magicWeapon.getMgType() == JobType.MAGIC)    //魔
     {
         jobType.spriteName = "roleType_5s";
     }
     else if (magicWeapon.getMgType() == JobType.AGILE)    //敏
     {
         jobType.spriteName = "roleType_3s";
     }
     else if (magicWeapon.getMgType() == JobType.POISON)    //毒
     {
         jobType.spriteName = "roleType_4s";
     }
     else if (magicWeapon.getMgType() == JobType.COUNTER_ATTACK)    //反
     {
         jobType.spriteName = "roleType_1s";
     }
     else if (magicWeapon.getMgType() == JobType.ASSIST)    //辅
     {
         jobType.spriteName = "roleType_6s";
     }
     else
     {
         jobType.gameObject.SetActive(false);
         jobBg.gameObject.SetActive(false);
     }
     updateSkills();
     updateProp();
 }
    public void UpdateMagicWeapon(MagicWeapon mWeapon, int type)
    {
        magicWeapon = mWeapon;
        intoType    = type;
        if (intoType == MagicWeaponType.FROM_CARD_BOOK_NOT_M)
        {
            //没有秘宝的情况敢进入单独仓库界面 是想上装的节奏
            if (magicWeapon.state == MagicWeaponType.ON_USED)
            {
                putonButton.gameObject.SetActive(false);
            }
            else
            {
                putonButton.gameObject.SetActive(true);
                putonButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0013");
                putonButton.onClickEvent   = putOnMagicWeapon;
            }
        }
        else if (intoType == MagicWeaponType.STRENG)
        {
            putonButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0012");
            putonButton.onClickEvent   = gotoStrengWindow;          //进入强化界面
        }
        else if (intoType == MagicWeaponType.FROM_CARD_BOOK_HAVE_M) //替换
        {
            putonButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0036");
            putonButton.onClickEvent   = gotoReplareWindow;
        }
        iconButton.onClickEvent = gotoStrengWindowformIcon;

        //更新秘宝的强化等级
        if (magicWeapon.getPhaseLv() > 0)  //更新秘宝的进阶等级
        {
            starLevel.gameObject.SetActive(true);
            starLevel.text = "+" + magicWeapon.getPhaseLv().ToString();
        }
        else
        {
            starLevel.gameObject.SetActive(false);
        }
        //更新秘宝的名字、图片、强化等级、状态、是否是新装备、职业类型
        typeIcon.gameObject.SetActive(true);
        typeQuality.gameObject.SetActive(true);
        if (magicWeapon.getMgType() == JobType.POWER)  //力
        {
            typeIcon.spriteName = "roleType_2";
        }
        else if (magicWeapon.getMgType() == JobType.MAGIC)    //魔
        {
            typeIcon.spriteName = "roleType_5";
        }
        else if (magicWeapon.getMgType() == JobType.AGILE)    //敏
        {
            typeIcon.spriteName = "roleType_3";
        }
        else if (magicWeapon.getMgType() == JobType.POISON)    //毒
        {
            typeIcon.spriteName = "roleType_4";
        }
        else if (magicWeapon.getMgType() == JobType.COUNTER_ATTACK)    //反
        {
            typeIcon.spriteName = "roleType_1";
        }
        else if (magicWeapon.getMgType() == JobType.ASSIST)    //辅
        {
            typeIcon.spriteName = "roleType_6";
        }
        else
        {
            typeIcon.gameObject.SetActive(false);
            typeQuality.gameObject.SetActive(false);
        }
        //更新神器职业背景颜色,用以区分品质
        typeQuality.spriteName = QualityManagerment.qualityIconBgToBackGround(magicWeapon.getMagicWeaponQuality());
        mwname.text            = QualityManagerment.getQualityColor(magicWeapon.getMagicWeaponQuality()) + magicWeapon.getName();
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + magicWeapon.getIconId(), itemIcon);
        stengLv.text = "Lv." + magicWeapon.getStrengLv().ToString();
        if (magicWeapon.state == 1)
        {
            state.text = LanguageConfigManager.Instance.getLanguage("s0017");
        }
        else
        {
            state.text = "";
        }
        if (magicWeapon.getIsNew())
        {
            if (isNew != null && !isNew.gameObject.activeSelf)
            {
                isNew.gameObject.SetActive(true);
            }
        }
        else if (isNew != null && isNew.gameObject.activeSelf)
        {
            isNew.gameObject.SetActive(false);
        }
        //更新秘宝图片的背景 用品质来区分
        quality.spriteName = QualityManagerment.qualityIDtoMagicWeapon(magicWeapon.getMagicWeaponQuality());
        //更新秘宝的属性
        AttrChange[] attrs = magicWeapon.getAttrChanges();
        for (int j = 0; j < equipAttributeValue.Length; j++)  //所有属性全清零
        {
            equipAttribute[j].text      = "";
            equipAttributeValue[j].text = "";
        }
        if (attrs != null && attrs.Length > 0 && attrs[0] != null)
        {
            for (int i = 0; i < attrs.Length; i++)
            {
                equipAttribute[i].text = attrs[i].typeToString();
                if (equipAttributeValue[i] != null)
                {
                    equipAttributeValue[i].text = attrs[i].num + "";
                }
            }
        }
        if (magicWeapon != null && starPrefab != null)
        {
            Utils.RemoveAllChild(itemIcon.transform);
            int level = MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(magicWeapon.sid).starLevel;
            if (level > 0)
            {
                GameObject obj  = NGUITools.AddChild(itemIcon.gameObject, starPrefab);
                ShowStars  show = obj.GetComponent <ShowStars>();
                show.initStar(level, MagicWeaponManagerment.USEDBUMAGIC_ATTRSHOW);
            }
        }
    }