Beispiel #1
0
    /// <summary>
    /// 计算卡片装备精炼的非属性战斗力
    /// </summary>
    /// <param name="_card"></param>
    /// <returns></returns>
    public int getCardEquipRefineCombat(Card _card)
    {
        int attr = 0;

        if (_card.getEquips() == null || _card.getEquips().Length < 1)
        {
            return(0);
        }
        string[] equips = _card.getEquips();
        for (int i = 0; i < equips.Length; i++)
        {
            Equip equip = StorageManagerment.Instance.getEquip(equips[i]);
            if (RefineSampleManager.Instance.getRefineSampleBySid(equip.sid) == null)
            {
                continue;
            }
            RefinelvInfo rfinfo = RefineSampleManager.Instance.getRefineSampleBySid(equip.sid).refinelvAttr[equip.getrefineLevel()];
            for (int j = 0; j < rfinfo.items.Count; j++)
            {
                AttrRefineChangeSample acs = rfinfo.items[j];
                attr += acs.getAttrRefineCombatValue();
            }
        }
        return(attr);
    }
Beispiel #2
0
 private void parseEffects(string str)
 {
     //表示空
     if (str == Convert.ToString(0))
     {
         return;
     }
     string[] strArr = str.Split('#');
     //effects = new AttrChangeSample[strArr.Length];
     for (int i = 0; i < strArr.Length; i++)
     {
         AttrRefineChangeSample attr = new AttrRefineChangeSample();
         attr.parse(strArr[i]);
         if (attr.getAttrType() == AttrChangeType.HP)
         {
             dec.Add(LanguageConfigManager.Instance.getLanguage("refine_008"));
         }
         else if (attr.getAttrType() == AttrChangeType.ATTACK)
         {
             dec.Add(LanguageConfigManager.Instance.getLanguage("refine_019"));
         }
         else if (attr.getAttrType() == AttrChangeType.DEFENSE)
         {
             dec.Add(LanguageConfigManager.Instance.getLanguage("refine_018"));
         }
         else if (attr.getAttrType() == AttrChangeType.AGILE)
         {
             dec.Add(LanguageConfigManager.Instance.getLanguage("refine_016"));
         }
         else if (attr.getAttrType() == AttrChangeType.MAGIC)
         {
             dec.Add(LanguageConfigManager.Instance.getLanguage("refine_010"));
         }
         else if (attr.getAttrType() == AttrChangeType.PER_AGILE)
         {
             dec.Add(LanguageConfigManager.Instance.getLanguage("refine_016"));
         }
         else if (attr.getAttrType() == AttrChangeType.PER_ATTACK)
         {
             dec.Add(LanguageConfigManager.Instance.getLanguage("refine_019"));
         }
         else if (attr.getAttrType() == AttrChangeType.PER_DEFENSE)
         {
             dec.Add(LanguageConfigManager.Instance.getLanguage("refine_018"));
         }
         else if (attr.getAttrType() == AttrChangeType.PER_HP)
         {
             dec.Add(LanguageConfigManager.Instance.getLanguage("refine_008"));
         }
         else if (attr.getAttrType() == AttrChangeType.PER_MAGIC)
         {
             dec.Add(LanguageConfigManager.Instance.getLanguage("refine_010"));
         }
         else if (attr.getAttrType() == AttrChangeType.DESC1)
         {
             dec.Add(LanguageConfigManager.Instance.getLanguage("refine_013"));
         }
         else if (attr.getAttrType() == AttrChangeType.DESC2)
         {
             dec.Add(LanguageConfigManager.Instance.getLanguage("refine_021"));
         }
         else if (attr.getAttrType() == AttrChangeType.DESC3)
         {
             dec.Add(LanguageConfigManager.Instance.getLanguage("refine_014"));
         }
         else if (attr.getAttrType() == AttrChangeType.DESC4)
         {
             dec.Add(LanguageConfigManager.Instance.getLanguage("refine_021"));
         }
         items.Add(attr);
     }
 }
    public void updateEquip()
    {
        //更新物品
        if (chooseEquip != null)
        {
            Equip tmp = StorageManagerment.Instance.getEquip(chooseEquip.uid);
            if (tmp != null)
            {
                chooseEquip = tmp;
            }
        }
        if (chooseEquip != null)
        {
            currentPart = chooseEquip.getPartId();
            changeButtonShow();
            // shuxingLook.SetActive(RefineSampleManager.Instance.getRefineSampleBySid(chooseEquip.sid) != null);
            if (chooseEquip.getrefineLevel() > 0)
            {
                equipRefineShow = true;
            }
            for (int i = 0; i < shuxing.Length; i++)
            {
                shuxing[i].gameObject.SetActive(false);
                shuxing2[i].gameObject.SetActive(false);
            }
            shuxingdengji2.text = chooseEquip.getrefineLevel() + "/" + chooseEquip.getRefineMaxLevel();
            if (chooseEquip.getrefineLevel() <= 0 || (UserManager.Instance.self.getUserLevel() < 30 && type != EquipAttrWindow.OTHER))
            {
                ;
            }
            else
            {
                int          chooseEquiplevel = chooseEquip.getrefineLevel();
                int[]        a         = new int[3];
                string[]     b         = new string[3];
                RefinelvInfo newrfinfo = RefineSampleManager.Instance.getRefineSampleBySid(chooseEquip.sid).refinelvAttr[chooseEquiplevel];
                for (int j = 0; j < newrfinfo.items.Count; j++)
                {
                    AttrRefineChangeSample acs = newrfinfo.items[j];
                    for (int k = 0; k < 3; k++)
                    {
                        if (b[k] == null)
                        {
                            b[k]  = acs.getAttrType();
                            a[k] += acs.getAttrRefineValue(0);
                            break;
                        }
                        if (b[k] == acs.getAttrType())
                        {
                            a[k] += acs.getAttrRefineValue(0);
                            break;
                        }
                    }
                }
                for (int j = 0; j < 3; j++)
                {
                    if (b[j] != null)
                    {
                        equipRefineShow = true;
                        shuxing[j].gameObject.SetActive(true);
                        shuxing2[j].gameObject.SetActive(true);
                        shuxing[j].spriteName = "attr_" + b[j];
                        shuxing2[j].text      = a[j].ToString();
                    }
                }
            }
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + chooseEquip.getIconId(), equipImage);
            level.text     = "Lv." + chooseEquip.getLevel() + "/" + chooseEquip.getMaxLevel();
            equipName.text = chooseEquip.getName();
            AttrChange[] attrs = chooseEquip.getAttrChanges();
            attrLabel1.text = "";
            attrLabel2.text = "";
            if (attrs != null)
            {
                if (attrs.Length > 0 && attrs [0] != null)
                {
                    attrLabel1.text   = attrs [0].num.ToString();
                    attrbg.spriteName = ("attr_" + attrs [0].type);
                }
                if (attrs.Length > 1 && attrs [1] != null)
                {
                    attrLabel2.text   = attrs [1].num.ToString();
                    attrbg.spriteName = ("attr_" + attrs [1].type);
                }
            }

            qualityLabel.text  = LanguageConfigManager.Instance.getLanguage("s0084") + QualityManagerment.getQualityName(chooseEquip.getQualityId());
            partLabel.text     = LanguageConfigManager.Instance.getLanguage("s0083") + EquipPartType.getPartName(chooseEquip.getPartId());
            descriptlabel.text = "";
            if (chooseEquip.getQualityId() >= 5 && chooseEquip.equpStarState > 0)
            {
                basicSuit = SuitSampleManager.Instance.getSuitSampleBySid(chooseEquip.getSuitSid() * 100 + chooseEquip.equpStarState);
            }
            else
            {
                basicSuit = SuitSampleManager.Instance.getSuitSampleBySid(chooseEquip.getSuitSid());
            }
            quality.spriteName = QualityManagerment.qualityIDToIconSpriteName(chooseEquip.getQualityId());
            if (ChooseTypeSampleManager.Instance.isToEat(chooseEquip, ChooseTypeSampleManager.TYPE_EQUIP_EXP))
            {
                suitTitle.text = LanguageConfigManager.Instance.getLanguage("JustToEat00");
                eatDesc.text   = LanguageConfigManager.Instance.getLanguage("JustToEat02", chooseEquip.getEatenExp().ToString());
                typeProject [0].SetActive(false);
                typeProject [1].SetActive(true);
            }
            else
            {
                typeProject [0].SetActive(true);
                typeProject [1].SetActive(false);
                suitTitle.text = QualityManagerment.getQualityColor(chooseEquip.getQualityId()) + basicSuit.name + "[FFFFFF]" + LanguageConfigManager.Instance.getLanguage("s0010");
                findAllpart(basicSuit);
                findAllEffect(basicSuit, chooseEquip.equpStarState);
            }
        }
    }
Beispiel #4
0
    public void updateContent()
    {
        upequip     = StorageManagerment.Instance.getEquip(upequip.uid);
        equipIconID = EquipmentSampleManager.Instance.getEquipSampleBySid(upequip.sid).iconId;
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + equipIconID, equipbg);
        int maxLevel = upequip.getRefineMaxLevel();
        int nowLevel = upequip.getrefineLevel();

        int[]    a  = new int[3];
        string[] b  = new string[3];
        int[]    aa = new int[3];
        string[] bb = new string[3];
        if (nowLevel == 0)
        {
            noRefine.gameObject.SetActive(true);
        }
        else
        {
            noRefine.gameObject.SetActive(false);
            RefinelvInfo newrfinfo = RefineSampleManager.Instance.getRefineSampleBySid(upequip.sid).refinelvAttr[nowLevel];
            for (int j = 0; j < newrfinfo.items.Count; j++)
            {
                AttrRefineChangeSample acs = newrfinfo.items[j];
                for (int k = 0; k < 3; k++)
                {
                    if (b[k] == null)
                    {
                        b[k]  = acs.getAttrType();
                        a[k] += acs.getAttrRefineValue(0);
                        break;
                    }
                    if (b[k] != acs.getAttrType())
                    {
                        continue;
                    }
                    a[k] += acs.getAttrRefineValue(0);
                    break;
                }
            }
            for (int j = 0; j < 3; j++)
            {
                if (b[j] == null)
                {
                    continue;
                }
                shuxing1[j].text = a[j].ToString();
                rootsprites[j].gameObject.SetActive(true);
                sprites[j].GetComponent <UISprite>().spriteName = "attr_" + getAttrTypePer(b[j]);
            }
        }
        if (nowLevel == maxLevel)
        {
            shuxing2[0].gameObject.SetActive(false);
            //shuxing2[1].text = LanguageConfigManager.Instance.getLanguage("refine_023");
            maxRefine.gameObject.SetActive(true);
            shuxing2[2].gameObject.SetActive(false);
            rootsprites2[0].gameObject.SetActive(false);
            rootsprites2[1].gameObject.SetActive(false);
            rootsprites2[2].gameObject.SetActive(false);
            upTexture[0].gameObject.SetActive(false);
            upTexture[1].gameObject.SetActive(false);
            upTexture[2].gameObject.SetActive(false);
            shuxing3[0].gameObject.SetActive(false);
            shuxing3[1].gameObject.SetActive(false);
            shuxing3[2].gameObject.SetActive(false);
        }
        else
        {
            int          nextlevel  = upequip.getrefineLevel() + 1;
            RefinelvInfo nextrfinfo = RefineSampleManager.Instance.getRefineSampleBySid(upequip.sid).refinelvAttr[nextlevel];
            for (int j = 0; j < nextrfinfo.items.Count; j++)
            {
                AttrRefineChangeSample acs = nextrfinfo.items[j];
                for (int k = 0; k < 3; k++)
                {
                    if (bb[k] == null)
                    {
                        bb[k]  = acs.getAttrType();
                        aa[k] += acs.getAttrRefineValue(0);
                        break;
                    }
                    if (bb[k] != acs.getAttrType())
                    {
                        continue;
                    }
                    aa[k] += acs.getAttrRefineValue(0);
                    break;
                }
            }
            for (int j = 0; j < 3; j++)
            {
                if (bb[j] == null)
                {
                    continue;
                }
                int  upnum = 0;
                bool falg  = false;
                for (int n = 0; n < 3; n++)
                {
                    if (b[n] == null)
                    {
                        continue;
                    }
                    if (b[n] == bb[j])
                    {
                        upnum = aa[j] - a[n];
                        falg  = true;
                        break;
                    }
                }
                if (!falg)
                {
                    upnum = aa[j];
                }
                // int upnum = aa[j] - a[j];
                shuxing2[j].text = (aa[j] - upnum).ToString(); //+" " + "[358C35]" + "+" + " " + upnum.ToString() + "[-]";
                shuxing3[j].text = " " + "[358C35]" + "+" + " " + upnum + "[-]";
                sprites2[j].GetComponent <UISprite>().spriteName = "attr_" + getAttrTypePer(bb[j]);
                rootsprites2[j].gameObject.SetActive(true);
                upTexture[j].gameObject.SetActive(false);
                if (upnum != 0)
                {
                    upTexture[j].gameObject.SetActive(true);
                }
            }
        }
        equipLv.text  = upequip.getrefineLevel() + " " + LanguageConfigManager.Instance.getLanguage("refine_024");
        expLabel.text = EXPSampleManager.Instance.getExpBarShow(upequip.getRefineExpSid(), upequip.getrefineEXP());
        rockEXP       = CommandConfigManager.Instance.getRefinePropEXP();
        refinePropSid = CommandConfigManager.Instance.getRefinePropSid();
        setPrizeShow();
        updateInfo();
    }
Beispiel #5
0
 public override void copy(object destObj)
 {
     base.copy(destObj);
     AttrRefineChangeSample dest = destObj as AttrRefineChangeSample;
 }