Example #1
0
    void Btn_Slot_Skill(int index)
    {
        SingleSlot slot = AllSlots[index];

        slot.ClearSlot();
        StockPage.refreshStockConditions_heroImprove();
    }
Example #2
0
    void confirmImprove_skill()
    {
        if (currentAddingFigure == 0)
        {
            return;
        }
        bool flag = true;

        for (int i = 0; i < AllSlots.Length; i++)
        {
            SingleSlot slot = AllSlots[i];
            if (slot.isEmpty || slot.isLocked)
            {
                continue;
            }
            bool _flag = slot.consumeContentInSlot();
            if (!_flag)
            {
                flag = false; continue;
            }
        }
        if (!flag)
        {
            return;
        }
        SDDataManager.Instance.addMainSkillGradeToHeroByHashcode
            (heroDetail.Hashcode, currentAddingFigure);


        refreshHeroData_skill();
        //
        heroDetail.initHeroDetailPanel(heroDetail.Hashcode);
    }
Example #3
0
    public void refreshCurrentNewAddingSkill()
    {
        currentAddingFigure = 0;
        //GDEHeroData data = SDDataManager.Instance.getHeroByHashcode(heroDetail.Hashcode);
        skillSelect.initHeroAllSkills();
        int MaxG = SDDataManager.Instance.SkillGradeNumWaitingForImprove(heroDetail.Hashcode);

        if (MaxG <= 0)
        {
            BtnToConfirmCurrentImprove.interactable = false;
        }
        Debug.Log("MAG: " + MaxG);
        for (int i = 0; i < AllSlots.Length; i++)
        {
            bool       locked = MaxG <= i;
            SingleSlot slot   = AllSlots[i];
            slot.isLocked = locked;
            if (!slot.isEmpty && !slot.isLocked)
            {
                currentAddingFigure++;
            }
        }
        //预计技能升级动画



        //升级确认按钮状态
        BtnToConfirmCurrentImprove.interactable = currentAddingFigure > 0;
    }
Example #4
0
    public void refreshCurrentNewAddingExp()
    {
        currentAddingFigure = 0;
        GDEHeroData data = SDDataManager.Instance.getHeroByHashcode(heroDetail.Hashcode);

        //HeroInfo indo = SDDataManager.Instance.getHeroInfoById(data.id);
        for (int i = 0; i < AllSlots.Length; i++)
        {
            bool locked = SDDataManager.Instance.checkHeroExpIfOverflow
                              (data.exp, heroDetail.StarNumVision.StarNum);
            SingleSlot slot = AllSlots[i];
            slot.isLocked = locked;
            if (!slot.isEmpty && !slot.isLocked)
            {
                if (slot.ItemType == SDConstants.ItemType.Hero)
                {
                    int _exp = SDDataManager.Instance.getHeroExpPrice(heroDetail.Hashcode);
                    currentAddingFigure += _exp;
                }
                else if (slot.ItemType == SDConstants.ItemType.Consumable)
                {
                    int _exp = SDDataManager.Instance.getFigureFromMaterial(slot._id);
                    currentAddingFigure += _exp;
                }
            }
        }
        //预计等级提升动画
        int oldLv = SDDataManager.Instance.getLevelByExp(data.exp);
        int newLv = SDDataManager.Instance.getLevelByExp(data.exp + currentAddingFigure);

        expPart_lv_text.text = SDGameManager.T("Lv.") + oldLv
                               + " > "
                               + SDGameManager.T("Lv.") + newLv;
        expPart_exp_text.text = (data.exp - SDDataManager.Instance.getMinExpReachLevel(oldLv)
                                 + currentAddingFigure) + "/" + SDDataManager.Instance.ExpBulkPerLevel(oldLv);
        expPart_slider_old.localScale = new Vector3
                                            ((data.exp - SDDataManager.Instance.getMinExpReachLevel(oldLv))
                                            * 1f / SDDataManager.Instance.ExpBulkPerLevel(oldLv), 1, 1);
        int overExp = data.exp + currentAddingFigure
                      - SDDataManager.Instance.getMinExpReachLevel(oldLv);
        float rate = overExp * 1f / SDDataManager.Instance.ExpBulkPerLevel(oldLv);

        expPart_slider_new.localScale = new Vector3(rate, 1, 1);

        //升级确认按钮状态
        BtnToConfirmCurrentImprove.interactable = currentAddingFigure > 0 &&
                                                  !SDDataManager.Instance.checkHeroExpIfOverflow
                                                      (data.exp, heroDetail.StarNumVision.StarNum);

        //exp专有
        TooFlowToAdd = SDDataManager.Instance.checkHeroExpIfOverflow
                           (data.exp + currentAddingFigure, heroDetail.StarNumVision.StarNum);
    }
Example #5
0
 public bool addStockToSlot_Skill(RTSingleStockItem stock)
 {
     for (int i = 0; i < AllSlots.Length; i++)
     {
         SingleSlot slot = AllSlots[i];
         if (slot.isEmpty && !slot.isLocked)
         {
             slot.AddFromStock(stock);
             return(true);
         }
     }
     return(false);
 }
Example #6
0
    void confirmImprove_star()
    {
        if (currentAddingFigure == 0)
        {
            return;
        }
        bool flag         = true;
        int  skillUpgrade = 0;

        for (int i = 0; i < AllSlots.Length; i++)
        {
            SingleSlot slot = AllSlots[i];
            if (slot.isEmpty || slot.isLocked)
            {
                continue;
            }
            bool _flag = slot.consumeContentInSlot();
            if (!_flag)
            {
                flag = false; continue;
            }
            // 在升星时使用同角色
            if (slot.ItemType == SDConstants.ItemType.Hero && slot._id == heroDetail.ID)
            {
                skillUpgrade++;
            }
        }
        if (!flag)
        {
            return;
        }
        if (skillUpgrade > 0)
        {
            SDDataManager.Instance.addMainSkillGradeToHeroByHashcode
                (heroDetail.Hashcode, skillUpgrade);
        }
        SDDataManager.Instance.addStarToHeroByHashcode(heroDetail.Hashcode);
        refreshHeroData_star();
        //
        heroDetail.initHeroDetailPanel(heroDetail.Hashcode);
    }