Example #1
0
    public void initWindow(Card oldCard, CallBackMsg call)
    {
        callback = call;
        int value = 0;
        CardBaseAttribute oldCardAttr = CardManagerment.Instance.getCardAllWholeAttr(oldCard);
        BloodPointSample  pointSample = BloodConfigManager.Instance.getBloodPointSampleBySid(CardSampleManager.Instance.getBloodSid(oldCard.sid));

        if (pointSample != null)
        {
            BloodItemSample itemSample = BloodItemConfigManager.Instance.getBolldItemSampleBySid(BloodConfigManager.Instance.getCurrentItemSid(pointSample, oldCard.cardBloodLevel));
            if (itemSample == null)
            {
                return;
            }
            bloodEffect[] effect = itemSample.effects;
            for (int i = 0; i < effect.Length; i++)
            {
                value = effect[i].perAllAttr;
            }
        }
        int[] costs = CommandConfigManager.Instance.getEvoCostByQuality(oldCard.getQualityId());
        oldEvoLevel.text      = oldCard.getEvoLevel() + "";
        newEvoLevel.text      = oldCard.getEvoLevel() + "[FF0000]-" + (oldCard.getEvoLevel() - oldCard.getEvoLevelForBlood(oldCard.getEvoTimes() == 0 ? costs[0] : costs[oldCard.getEvoTimes() - 1])) + "[-]";
        oldCombat.text        = oldCard.getCardCombat() + "";
        newCombat.text        = oldCard.getCardCombat() + "[358C35]+" + value + "%" + "[-]";
        oldQuality.spriteName = QualityManagerment.qualityIDToStringByBG(oldCard.getQualityId());
        newQuality.spriteName = QualityManagerment.qualityIDToStringByBG(oldCard.getQualityId() + 1);
    }
    void updateNeedProp()
    {
        int currentIndex = BloodConfigManager.Instance.getCurrentBloodMapIndex(choosedCard.sid,
                                                                               choosedCard.cardBloodLevel);
        BloodItemSample bis = BloodItemConfigManager.Instance.getBolldItemSampleBySid(currentItemMap[currentIndex]);

        PrizeSample[] ps = bis.condition;
        needPropTwoPoint.SetActive(ps.Length == 2);
        for (int i = 0; i < ps.Length; i++)
        {
            needProps[i].GetComponent <BloodEvoPropView>().init(ps[i]);
            if (i == 0)
            {
                ResourcesManager.Instance.LoadAssetBundleTexture(ps[i].getIconPath(), needropTexture1);
                needPropDesc1.text = ps[i].getPrizeName() + ":" + ps[i].getPrizeHadNum() + "";
            }
            else if (i == 1)
            {
                ResourcesManager.Instance.LoadAssetBundleTexture(ps[i].getIconPath(), needPropTexture2);
                needPropDesc2.text = ps[i].getPrizeName() + ":" + ps[i].getPrizeHadNum() + "";
            }
            else if (choosedCard.getQualityId() == QualityType.MYTH)
            {
                ResourcesManager.Instance.LoadAssetBundleTexture(ps[ps.Length - 1].getIconPath(), needropTexture1);
                needPropDesc1.text = ps[ps.Length - 1].getPrizeName() + ":" + ps[ps.Length - 1].getPrizeHadNum() + "";
            }
        }
    }
Example #3
0
    //解析配置
    public override void parseConfig(string str)
    {
        BloodItemSample be = new BloodItemSample(str);

        if (list == null)
        {
            list = new List <BloodItemSample>();
        }
        list.Add(be);
    }
Example #4
0
    /// <summary>
    /// 组装血脉技能
    /// </summary>
    /// <param name="sid"></param>
    /// <param name="lv"></param>
    /// <returns></returns>
    public List <Skill> isActiveSkillSid(int sid, int lv)
    {
        CardSample       cs  = CardSampleManager.Instance.getRoleSampleBySid(sid);//卡片模板
        BloodPointSample bps = getBloodPointSampleBySid(cs.bloodPointSid);

        int[][]      totalItem = bps.itemSid;
        List <Skill> sids      = new List <Skill>();
        int          tempNum   = 0;

        for (int i = 0; i < totalItem.Length; i++)
        {
            if (totalItem[i].Length == 1 && totalItem[i][0] == 0)
            {
                continue;
            }
            int[] temp = totalItem[i];
            for (int j = 0; j < temp.Length; j++)
            {
                if (lv > tempNum)
                {
                    BloodItemSample btss = BloodItemConfigManager.Instance.getBolldItemSampleBySid(temp[j]);
                    if (btss != null)
                    {
                        bloodEffect[] bes = btss.effects;
                        for (int m = 0; m < bes.Length; m++)
                        {
                            if (bes[m].type == 5)
                            {
                                Skill tempSkill = new Skill(bes[m].skillSid, 0, 0);
                                tempSkill.setSkillStateType(SkillStateType.ATTR);
                                sids.Add(tempSkill);
                            }
                            else if (bes[m].type == 6)
                            {
                                Skill newSkill = new Skill(bes[m].skillSid, 0, 0);
                                Skill oldSkill = new Skill(bes[m].drSkillSid, 0, 0);
                                newSkill.setSkillStateType(SkillStateType.ATTR);
                                oldSkill.setSkillStateType(SkillStateType.ATTR);
                                sids.Add(newSkill);
                                for (int k = 0; k < sids.Count; k++)
                                {
                                    if (oldSkill.sid == sids[k].sid)
                                    {
                                        sids.Remove(sids[k]);
                                    }
                                }
                            }
                        }
                    }
                }
                tempNum++;
            }
        }
        return(sids);
    }
Example #5
0
    public void init(BloodPointSample bps, int lv)
    {
        int             itemSid = BloodConfigManager.Instance.getCurrentItemSid(bps, lv);
        BloodItemSample bis     = BloodItemConfigManager.Instance.getBolldItemSampleBySid(itemSid);

        bloodEffect[] beffects = bis.effects;
        string        dec      = "";

        for (int i = 0; i < beffects.Length; i++)
        {
            dec += beffects[i].dec;
        }
        addAttrDesc.text = dec;
    }
Example #6
0
 /// <summary>
 /// 初始化方法
 /// </summary>
 /// <param name="win"></param>
 /// <param name="bts"></param>
 public void init(BloodItemSample bts, int color, int line, int pointTypee, Card card, int indexx, Transform fatherTran)
 {
     faTherTransform = fatherTran;
     chooseCard      = card;
     index           = indexx;
     bloodItemSample = bts;
     colorr          = color;
     bloodItemMap    = BloodConfigManager.Instance.getCurrentBloodMap(card.sid, card.cardBloodLevel);
     lineType        = line;
     pointType       = pointTypee;
     updateItem();
     timer = TimerManager.Instance.getTimer(100);
     timer.addOnTimer(refreshData);
     timer.start();
 }
Example #7
0
    /// <summary>
    /// 卡片是否拥有了血脉技能
    /// </summary>
    /// <param name="sid"></param>
    /// <param name="lv"></param>
    /// <returns></returns>
    public bool isActiveSkill(int sid, int lv)
    {
        CardSample       cs  = CardSampleManager.Instance.getRoleSampleBySid(sid);//卡片模板
        BloodPointSample bps = getBloodPointSampleBySid(cs.bloodPointSid);

        int[][] totalItem = bps.itemSid;
        int     tempNum   = 0;

        for (int i = 0; i < totalItem.Length; i++)
        {
            if (totalItem[i].Length == 1 && totalItem[i][0] == 0)
            {
                continue;
            }
            int[] temp = totalItem[i];
            for (int j = 0; j < temp.Length; j++)
            {
                if (lv >= tempNum)
                {
                    BloodItemSample btss = BloodItemConfigManager.Instance.getBolldItemSampleBySid(temp[j]);
                    if (btss != null)
                    {
                        bloodEffect[] bes = btss.effects;
                        for (int m = 0; m < bes.Length; m++)
                        {
                            if (bes[m].type == 5)
                            {
                                return(true);
                            }
                        }
                    }
                }
                tempNum++;
            }
        }
        return(false);
    }
    public void bloodSuccessCallBack(BloodItemSample bis, Vector3 v3, int lineType)
    {
        bloodEffect[] blEffects = bis.effects;
        this.lineType = lineType;
        int hp = 0, attack = 0, defec = 0, magic = 0, agile = 0;//保存具体数值属性

        if (lineType == 0)
        {
            if (choosedCard.cardBloodLevel == BloodConfigManager.Instance.getTotalItemNum(choosedCard.sid) && choosedCard.getQualityId() == QualityType.MYTH)
            {
                for (int i = 0; i < blEffects.Length; i++)
                {
                    hp     += blEffects[i].hp;
                    attack += blEffects[i].attack;
                    defec  += blEffects[i].defec;
                    magic  += blEffects[i].magic;
                    agile  += blEffects[i].agile;
                }
                CardBaseAttribute cardAttr = CardManagerment.Instance.getCardAllWholeAttr(choosedCard);
                for (int i = 0; i < blEffects.Length; i++)
                {
                    hp     += (int)((cardAttr.getWholeHp() + hp) * ((float)blEffects[i].perhp / 100));
                    attack += (int)((cardAttr.getWholeAtt() + attack) * ((float)blEffects[i].perattack / 100));
                    defec  += (int)((cardAttr.getWholeDEF() + defec) * ((float)blEffects[i].perdefec / 100));
                    magic  += (int)((cardAttr.getWholeMAG() + magic) * ((float)blEffects[i].permagic / 100));
                    agile  += (int)((cardAttr.getWholeAGI() + agile) * ((float)blEffects[i].peragile / 100));
                }
                if (hp != 0)
                {
                    playerEffect(addLabel[0], evoAddAttrLabel[0], hp, 0);
                }
                if (attack != 0)
                {
                    playerEffect(addLabel[1], evoAddAttrLabel[1], attack, 1);
                }
                if (defec != 0)
                {
                    playerEffect(addLabel[2], evoAddAttrLabel[2], defec, 2);
                }
                if (magic != 0)
                {
                    playerEffect(addLabel[3], evoAddAttrLabel[3], magic, 3);
                }
                if (agile != 0)
                {
                    playerEffect(addLabel[4], evoAddAttrLabel[4], agile, 4);
                }
                StartCoroutine(Utils.DelayRun(() => {
                    if (BloodManagement.Instance.prizes != null && BloodManagement.Instance.prizes.Length > 0)
                    {
                        UiManager.Instance.openDialogWindow <BloodEvoWindow>((win => {
                            win.Initialize(BloodManagement.Instance.prizes);
                        }));
                    }
                }, 0.5f));
                return;
            }
            showQualityEvo();
        }
        if (blEffects[0].type == 5 || blEffects[0].type == 6)
        {
            if (blEffects[0].type == 5)
            {
                StartCoroutine(playSkillEffect(blEffects[0].skillSid, v3));
            }
            else
            {
                StartCoroutine(playSkillEffect(blEffects[0].drSkillSid, blEffects[0].skillSid, v3));
            }
        }
        else
        {
            for (int i = 0; i < blEffects.Length; i++)
            {
                hp     += blEffects[i].hp;
                attack += blEffects[i].attack;
                defec  += blEffects[i].defec;
                magic  += blEffects[i].magic;
                agile  += blEffects[i].agile;
            }
            CardBaseAttribute cardAttr = CardManagerment.Instance.getCardAllWholeAttr(choosedCard);
            for (int i = 0; i < blEffects.Length; i++)
            {
                hp     += (int)((cardAttr.getWholeHp() + hp) * ((float)blEffects[i].perhp / 100));
                attack += (int)((cardAttr.getWholeAtt() + attack) * ((float)blEffects[i].perattack / 100));
                defec  += (int)((cardAttr.getWholeDEF() + defec) * ((float)blEffects[i].perdefec / 100));
                magic  += (int)((cardAttr.getWholeMAG() + magic) * ((float)blEffects[i].permagic / 100));
                agile  += (int)((cardAttr.getWholeAGI() + agile) * ((float)blEffects[i].peragile / 100));
            }
            if (hp != 0)
            {
                playerEffect(addLabel[0], evoAddAttrLabel[0], hp, 0);
            }
            if (attack != 0)
            {
                playerEffect(addLabel[1], evoAddAttrLabel[1], attack, 1);
            }
            if (defec != 0)
            {
                playerEffect(addLabel[2], evoAddAttrLabel[2], defec, 2);
            }
            if (magic != 0)
            {
                playerEffect(addLabel[3], evoAddAttrLabel[3], magic, 3);
            }
            if (agile != 0)
            {
                playerEffect(addLabel[4], evoAddAttrLabel[4], agile, 4);
            }
        }
    }
    /// <summary>
    /// 更新可以加的属性值
    /// </summary>
    /// <param name="bps"></param>
    void updateChangeAttrs(BloodPointSample bps)
    {
        for (int i = 0; i < evoAddAttrLabel.Length; i++)  //不管什么情况都先清零在说
        {
            evoAddAttrLabel[i].text = "";
        }
        if (choosedCard.cardBloodLevel >= bps.maxLv)
        {
            return;                                                                                                    //没有满级才会显示
        }
        int             bloodItemSid = BloodConfigManager.Instance.getCurrentItemSid(bps, choosedCard.cardBloodLevel); //拿到具体的节点信息Sid
        BloodItemSample bis          = BloodItemConfigManager.Instance.getBolldItemSampleBySid(bloodItemSid);

        if (bis == null)
        {
            return;
        }
        bloodEffect[] blEffects = bis.effects;
        int           hp = 0, attack = 0, defec = 0, magic = 0, agile = 0;//保存具体数值属性

        for (int i = 0; i < blEffects.Length; i++)
        {
            hp     += blEffects[i].hp;
            attack += blEffects[i].attack;
            defec  += blEffects[i].defec;
            magic  += blEffects[i].magic;
            agile  += blEffects[i].agile;
        }
        CardBaseAttribute cardAttr = CardManagerment.Instance.getCardAllWholeAttr(choosedCard);

        for (int i = 0; i < blEffects.Length; i++)
        {
            if (blEffects[i].perhp == 0)
            {
                if (hp == 0)
                {
                    evoAddAttrLabel[0].text = "";
                }
                else
                {
                    evoAddAttrLabel[0].text = "+" + hp;
                }
            }
            else
            {
                evoAddAttrLabel[0].text = "+" + (cardAttr.getWholeHp() + hp) * (1.0f + (float)blEffects[i].perhp / 100);
            }
            if (blEffects[i].perattack == 0)
            {
                if (attack == 0)
                {
                    evoAddAttrLabel[1].text = "";
                }
                else
                {
                    evoAddAttrLabel[1].text = "+" + attack;
                }
            }
            else
            {
                evoAddAttrLabel[1].text = "+" + (cardAttr.getWholeAtt() + attack) * (1.0f + (float)blEffects[i].perattack / 100);
            }
            if (blEffects[i].perdefec == 0)
            {
                if (defec == 0)
                {
                    evoAddAttrLabel[2].text = "";
                }
                else
                {
                    evoAddAttrLabel[2].text = "+" + defec;
                }
            }
            else
            {
                evoAddAttrLabel[2].text = "+" + (cardAttr.getWholeDEF() + defec) * (1.0f + (float)blEffects[i].perdefec / 100);
            }
            if (blEffects[i].permagic == 0)
            {
                if (magic == 0)
                {
                    evoAddAttrLabel[3].text = "";
                }
                else
                {
                    evoAddAttrLabel[3].text = "+" + magic;
                }
            }
            else
            {
                evoAddAttrLabel[3].text = "+" + (cardAttr.getWholeMAG() + magic) * (1.0f + (float)blEffects[i].permagic / 100);
            }
            if (blEffects[i].peragile == 0)
            {
                if (agile == 0)
                {
                    evoAddAttrLabel[4].text = "";
                }
                else
                {
                    evoAddAttrLabel[4].text = "+" + agile;
                }
            }
            else
            {
                evoAddAttrLabel[4].text = "+" + (cardAttr.getWholeAGI() + agile) * (1.0f + (float)blEffects[i].peragile / 100);
            }
        }
    }
    /// <summary>
    /// 更新血脉节点
    /// </summary>
    public void updateBloodPoint()
    {
        MaskWindow.LockUI();
        for (int i = 0; i < pointContentFather.transform.childCount; i++)
        {
            DestroyImmediate(pointContentFather.transform.GetChild(i).gameObject);
            i--;
        }
        //if (choosedCard.cardBloodLevel == BloodConfigManager.Instance.getTotalItemNum(choosedCard.sid) || choosedCard.getQualityId() == QualityType.MYTH)
        //    return;
        GameObject a;
        float      y            = 0;
        int        currentIndex = 0;

        if (choosedCard.cardBloodLevel == 0)
        {
            currentIndex = 0;
        }
        else
        {
            currentIndex = choosedCard.cardBloodLevel;
        }
        //if (choosedCard.getQualityId() == QualityType.MYTH)
        //    currentIndex = 50;
        for (int k = 0; k < totalMap.Length; k++)
        {
            if (isPressed)
            {
                if (k == currentIndex)
                {
                    y = (k - 1) * 134;
                    break;
                }
            }
            else
            {
                if (k == currentIndex)
                {
                    y = k * 134;
                    break;
                }
            }
        }
        if (choosedCard.cardBloodLevel == totalMap.Length && choosedCard.getQualityId() == QualityType.MYTH)
        {
            if (isPressed)
            {
                y = (totalMap.Length - 2) * 134;
            }
            else
            {
                y = (totalMap.Length - 1) * 134;
            }
        }
        pontFatherContentForEffect.transform.localPosition             = Vector3.zero;
        pontFatherContentForEffect.GetComponent <UIPanel>().clipOffset = new Vector2(0f, 0f);
        int[] colorList = BloodConfigManager.Instance.getBloodItemColor(choosedCard.sid, choosedCard.cardBloodLevel);
        for (int i = 0; i < totalMap.Length; i++)
        {
            a = Instantiate(bloodPointPrefab) as GameObject;
            BloodPointItem bloodItem = a.GetComponent <BloodPointItem>();
            bloodItem.name                    = StringKit.intToFixString(i + 1);
            bloodItem.fatherWindow            = this;
            bloodItem.transform.parent        = pointContentFather.transform;
            bloodItem.transform.localScale    = Vector3.one;
            bloodItem.transform.localPosition = new Vector3((i % 2) * 137, y, 0f);
            BloodItemSample bts           = BloodItemConfigManager.Instance.getBolldItemSampleBySid(totalMap[i]);
            int             color         = colorList[i] - 2;
            int             line          = 0;
            int             currentIndexx = currentIndex;
            if (i != totalMap.Length - 1)
            {
                if (i % 2 == 1)
                {
                    line = 1;
                }
                else
                {
                    line = 2;
                }
            }
            if (i < currentIndexx)
            {
                currentIndexx = 2;
            }
            else if (i == currentIndexx)
            {
                // pointContentFather.transform.localPosition=new Vector3(pointContentFather.transform.localPosition.x,i*134,pointContentFather.transform.localPosition.z);
                currentIndexx = 1;
            }
            else
            {
                currentIndexx = 0;
            }
            int index = BloodConfigManager.Instance.getCurrentBloodLvColor(choosedCard.sid, i)[1];
            bloodItem.init(bts, color, line, currentIndexx, choosedCard, index, pontFatherContentForEffect.transform);
            y -= 134;
        }
        if (isPressed)
        {
            pontFatherContentForEffect.GetComponent <UIPanel>().clipOffset += new Vector2(0f, -134f);
            TweenPosition tp = TweenPosition.Begin(pontFatherContentForEffect, 0.7f, (pontFatherContentForEffect.transform.localPosition + new Vector3(0, 134, 0)));
            tp.from = new Vector3(0, pontFatherContentForEffect.transform.localPosition.y, 0);
            EventDelegate.Add(tp.onFinished, () => {
                MaskWindow.UnlockUI();
            }, true);
        }
    }