示例#1
0
    /// <summary>
    /// 初始化英雄出战选人页
    /// </summary>
    /// <param name="hero"></param>
    public void initBattleHero(GDEHeroData hero)
    {
        type         = SDConstants.ItemType.Hero;
        itemId       = hero.id;
        itemHashcode = hero.hashCode;
        //

        //
        ROHeroData dal = SDDataManager.Instance.getHeroDataByID(itemId, hero.starNumUpgradeTimes);

        //if (frameImg != null) frameImg.gameObject.SetActive(false);

        upText.gameObject.SetActive(true);
        upText.text   = SDGameManager.T("Lv.") + SDDataManager.Instance.getLevelByExp(hero.exp);
        downText.text = SDGameManager.T(dal.Info.Name);
        slider?.gameObject.SetActive(false);
        //
        int status = SDDataManager.Instance.getHeroStatus(hero.hashCode);

        if (status == 0)
        {
            isSelected = false;
            isUnable   = false;
        }//无业
        else if (status == 1)
        {
            isSelected = true;
            isUnable   = false;
        }//战斗队伍中
        else
        {
            isSelected = false;
            isUnable   = true;
        }//其他状态
        //statusImg.gameObject.SetActive(true);
        //statusImg.sprite = herostat
        starVision.StarNum = dal.starNum;

        if (careerImg)
        {
            Sprite career = dal.Info.Career.Icon;
            careerImg.sprite = career;
        }
        if (raceImg)
        {
            Sprite race = dal.Info.Race.Icon;
            if (dal.Info.Race.NAME == "无种族")
            {
                HeroRace _r = dal.Info.Race;
                race = _r.Icon;
            }
            raceImg.sprite = race;
        }
        itemBgImg.sprite = SDDataManager.Instance.heroBgSpriteByRarity(dal.Info.Rarity);
        frameImg.sprite  = SDDataManager.Instance.heroFrameSpriteByRarity(dal.Info.Rarity);
    }
示例#2
0
 public void initThisUnitTeam(GDEunitTeamData Team)
 {
     if (BTP == null)
     {
         BTP = GetComponentInParent <BattleTeamPanel>();
     }
     TeamEmpty.gameObject.SetActive(false);
     if (Team != null)
     {
         this.TeamId = Team.id;
         List <GDEHeroData> all = SDDataManager.Instance.getHerosFromTeam(TeamId);
         if (all.Count > 0)
         {
             //
             if (!string.IsNullOrEmpty(Team.goddess))
             {
                 GoddessInfo goddess = SDDataManager.Instance.getGoddessInfoById(Team.goddess);
                 TeamGoddess.GetComponentInChildren <Image>().sprite
                     = goddess.FaceIcon;
             }
             else
             {
             }
             //
             if (Team.teamName != "" && Team.teamName != null)
             {
                 TeamNameText.text = Team.teamName;
             }
             else
             {
                 TeamNameText.text = randomTeamNameBefore() + SDGameManager.T("小队") + Team.id;
             }
             //
             for (int i = 0; i < all.Count; i++)
             {
                 TeamHeroes[i] = all[i].hashCode;
             }
             //
             if (Team.badge > 0)
             {
             }
             else
             {
             }
         }
         else
         {
             ShowEmpty();
         }
     }
     else
     {
         ShowEmpty();
     }
 }
示例#3
0
 public void refreshAllPurchaseTypeBtns()
 {
     for (int i = 0; i < (int)purchaseType.end; i++)
     {
         if (i < BtnsContent.childCount && BtnsContent.GetChild(i).GetComponent <Button>())
         {
             BtnsContent.GetChild(i).GetComponentInChildren <Text>().text
                 = SDGameManager.T(((purchaseType)i).ToString());
         }
     }
 }
示例#4
0
 private void FixedUpdate()
 {
     if (CDTime > 0 && countDownTime > 0)
     {
         countDownTime -= Time.deltaTime;
         return;
     }
     countDownTime = 1.0f;
     CDTime--;
     autoCloseText.text = SDGameManager.T("AutoCloseCDTime") + "00:0" + CDTime;
 }
示例#5
0
 public void SumonTenTimes_n()
 {
     CurrentAltarType = AltarType.n_tenTime;
     if (SDDataManager.Instance.getConsumableNum(Coupon_n_tenTimes.ID) > 0)
     {
         InitDAP();
     }
     else
     {
         if (SDDataManager.Instance.getConsumableNum(Coupon_n_oneTime.ID) > 10)
         {
             InitDAP();
         }
         else
         {
             if (SDDataManager.Instance.PlayerData.damond
                 >= SDConstants.altarDamondCost * 10)
             {
                 if (SDDataManager.Instance.PlayerData.damond >= SDConstants.altarDamondCost)
                 {
                     PopoutController.CreatePopoutAlert
                     (
                         SDGameManager.T("提醒")
                         , SDGameManager.T("确认消耗")
                         + SDConstants.altarDamondCost * 10
                         + SDGameManager.T("钻石")
                         , 25, false,
                         PopoutController.PopoutWIndowAlertType.ConfirmMessage
                         , (PopoutController pop
                            , PopoutController.PopoutWindowAlertActionType type)
                         =>
                     {
                         if (type == PopoutController.PopoutWindowAlertActionType.OnConfirm)
                         {
                             InitDAP();     //pop.Dismiss();
                         }
                         else
                         {
                             //pop.Dismiss();
                         }
                         StartCoroutine(pop.Dismiss());
                     }
                     );
                 }
                 else
                 {
                     Debug.Log("无法获取:道具或钻石不足");
                     return;
                 }
             }
         }
     }
 }
示例#6
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);
    }
示例#7
0
    /// <summary>
    /// 构建英雄数据
    /// </summary>
    /// <param name="heroJob"></param>
    /// <param name="grade">英雄当前等级</param>
    /// <param name="quality"></param>
    /// <param name="Level"></param>
    /// <param name="ra"></param>
    /// <param name="raRate"></param>
    /// <param name="speed"></param>
    /// <param name="cri"></param>
    /// <param name="criDmg"></param>
    /// <param name="dmgReduction"></param>
    /// <param name="dmgReflection"></param>
    /// <param name="RewardRate"></param>
    /// <param name="bcRegendPerTurn"></param>
    /// <param name="id"></param>
    /// <param name="name"></param>
    /// <param name="wakeNum"></param>
    public virtual void initData_Hero(Job heroJob, Race heroRace, int grade
                                      , int quality, int Level
                                      , RoleAttributeList ra
                                      , int criDmg, int dmgReduction, int dmgReflection, int RewardRate
                                      , RoleBarChart bcRegendPerTurn, string id, string name, int wakeNum)
    {
        LEVEL                 = Level;
        Quality               = quality;
        RoleBasicRA           = ra.Clone;
        CRIDmg                = criDmg;
        DmgReduction          = dmgReduction; DmgReflection = dmgReflection;
        this.RewardRate       = RewardRate;
        BarChartRegendPerTurn = bcRegendPerTurn;
        ID = id; Name = name;
        AddMultiplier(grade);
        AddWakeMultiplier(wakeNum);
        //补充设置(职业影响)
        switch (heroJob)
        {
        case Job.Fighter:
            initData_supplement_H_Fighter(RoleBasicRA, grade);
            break;

        case Job.Ranger:
            initData_supplement_H_Ranger(RoleBasicRA, grade);
            break;

        case Job.Priest:
            initData_supplement_H_Priest(RoleBasicRA, grade);
            break;

        case Job.Caster:
            initData_supplement_H_Caster(RoleBasicRA, grade);
            break;
        }
        switch (heroRace)
        {
        case Race.Human:
            initData_supplement_H_human();
            break;

        case Race.Elf:
            initData_supplement_H_elf();
            break;

        case Race.Dragonborn:
            initData_supplement_H_dragonborn();
            break;
        }
        AddLEVELNumMultiplier(LEVEL);
        Name = SDGameManager.T(name);
    }
示例#8
0
    public override void RefreshImprovePanel()
    {
        base.RefreshImprovePanel();

        int hashcode           = equipDetail.equipHashcode;
        GDEEquipmentData equip = SDDataManager.Instance.getEquipmentByHashcode(hashcode);

        if (lvText && expText && expSlider && expSlider_listorder)
        {
            int lv = equip.lv;
            lvText.text = SDGameManager.T("Lv.") + lv;
        }
    }
示例#9
0
 public virtual void initData(int level, RoleAttributeList dataRA
                              , int criDmg, int dmgReduction, int dmgReflection, int RewardRate
                              , RoleBarChart bcRegendPerTurn, string id, string name, int wakeNum)
 {
     LEVEL                 = level;
     RoleBasicRA           = dataRA.Clone;
     CRIDmg                = criDmg;
     DmgReduction          = dmgReduction;
     DmgReflection         = dmgReflection;
     this.RewardRate       = RewardRate;
     BarChartRegendPerTurn = bcRegendPerTurn;
     ID = id; Name = SDGameManager.T(name);
 }
示例#10
0
    public void initEnemy(GDEItemData item)
    {
        itemId  = item.id;
        itemNum = item.num;
        EnemyInfo E = SDDataManager.Instance.getEnemyInfoById(itemId);

        itemLevel = E.EnemyRank.Index;
        if (upText)
        {
            upText.gameObject.SetActive(true);
            upText.text = SDGameManager.T(E.Name);
        }
        starVision.StarNum = itemLevel;
    }
示例#11
0
    public void initPurchase(GDEItemData Purchase, bool useDamond = false)
    {
        itemId       = Purchase.id;
        itemNum      = Purchase.num;
        extraTrigger = useDamond;
        SDConstants.ItemType item_type = SDDataManager.Instance.getItemTypeById(itemId);
        type = item_type;
        int bpg = 0;

        if (type == SDConstants.ItemType.Consumable)
        {
            consumableItem data = SDDataManager.Instance.getConsumableById(itemId);
            if (upText)
            {
                upText.text = SDGameManager.T(data.name);
            }
            //
            itemImg.sprite   = data.IconFromAtlas;
            itemBgImg.sprite = SDDataManager.Instance.baseBgSpriteByRarity(data.LEVEL);
            frameImg.sprite  = SDDataManager.Instance.baseFrameSpriteByRarity(data.LEVEL);
            //
            string downT = "";
            if (!useDamond)
            {
                bpg   = data.buyPrice_coin * Purchase.num;
                downT = SDGameManager.T("金币") + " - " + bpg;
            }
            else
            {
                bpg   = data.buyPrice_diamond * Purchase.num;
                downT = SDGameManager.T("钻石") + " - " + bpg;
            }
            if (downText)
            {
                downText.text = downT;
            }
        }


        if (SDDataManager.Instance.PlayerData.damond < bpg)
        {
            downText.transform.parent.GetComponent <Button>().interactable = false;
        }
        else
        {
            downText.transform.parent.GetComponent <Button>().interactable = true;
        }
    }
示例#12
0
    public void initRuneInPage(GDERuneData E)
    {
        if (E == null || E.Hashcode <= 0)
        {
            isEmpty = true; return;
        }
        isEmpty = false;
        if (upText)
        {
            upText.text = SDGameManager.T("Lv.")
                          + E.level;
        }
        if (starVision)
        {
            starVision.gameObject.SetActive(false);
        }
        RuneItem item = SDDataManager.Instance.getRuneItemById(E.id);

        //
        frameImg.sprite  = SDDataManager.Instance.baseFrameSpriteByRarity(item.Quality);
        itemBgImg.sprite = SDDataManager.Instance.baseBgSpriteByRarity(item.Quality);
        //
        itemHashcode = E.Hashcode;
        itemId       = E.id;
        GoddessDetailPanel GDP = GetComponentInParent <GoddessDetailPanel>();

        if (GDP == null)
        {
            return;
        }
        string goddessId = GDP.CurrentGoddess.ID;

        isSelected = false;
        if (SDDataManager.Instance.checkRuneEquippedByGoddess(itemHashcode, goddessId, out int pos))
        {
            isSelected   = true;
            index        = pos;
            upText.text += "-----" + index;
        }
        else if (SDDataManager.Instance.checkRuneStatus(itemHashcode))
        {
            isSelected = true;
        }
    }
示例#13
0
    public void initHeroDetailPanel(int hashcode
                                    , SDConstants.CharacterType type = SDConstants.CharacterType.Hero)
    {
        Type = type;
        if (Type == SDConstants.CharacterType.Hero)
        {
            equipList.BuildEquipListBase();
            equipList.HD = this;
            if (_hero == null)
            {
                _hero = equipList.gameObject.AddComponent <SDHero>();
            }
            ID = SDDataManager.Instance.getHeroIdByHashcode(hashcode);
            GDEHeroData hero = SDDataManager.Instance.GetHeroOwnedByHashcode(hashcode);
            Hashcode = hashcode;

            setHero(Hashcode);
            setHelmet(Hashcode);
            setBreastplate(Hashcode);
            // setGardebras(Hashcode);//已过期
            setLegging(Hashcode);
            setJewelry(Hashcode, false);
            setJewelry(Hashcode, true);
            setWeapon(Hashcode);
            InitHeroBasicProperties();
            RALPanel.initRAL(this.RoleBasicRA
                             , Type
                             , SDDataManager.Instance.getLevelByExp(hero.exp));//视觉展示属性
            setRoleBaseMessiage();
            if (LvText)
            {
                int exp = hero.exp;
                int lv  = SDDataManager.Instance.getLevelByExp(exp);
                LvText.text = SDGameManager.T("Lv.") + lv;
            }


            readHeroSkills();
            //
            heroHeadImg.initHeroCharacterModel(Hashcode, SDConstants.HERO_MODEL_BIG_RATIO);
        }
    }
示例#14
0
 public void initGameRevive()
 {
     Time.timeScale = 1;
     //
     UIEffectManager.Instance.hideAnimFadeOut(gameFailPanel);
     UIEffectManager.Instance.showAnimFadeIn(gameRevivePanel);
     GameS.initAllDropsAndCoins();
     //
     autoCloseText.gameObject.SetActive(false);
     if (SDDataManager.Instance.SettingData.isAutoHang ||
         SDDataManager.Instance.SettingData.isAutoBattle)
     {
         Invoke("closeBtnTapped", 10f);
         CDTime        = 10;
         countDownTime = 1f;
         autoCloseText.gameObject.SetActive(true);
         autoCloseText.text = SDGameManager.T("AutoCloseCDTimes") + "00:10";
     }
     reviveTimesText.text = "";
 }
示例#15
0
    public void showCurrentItemDetail(string id, int num)
    {
        CDP.id = id;
        consumableItem item = SDDataManager.Instance.getConsumableById(id);

        currentItemType = item.ItemType;
        if (currentItemType == SDConstants.ItemType.Consumable)
        {
            ResolveBtn.gameObject.SetActive(!item.isProp);
        }
        CDP.initDetailPanel(id);

        //
        if (item.MaterialType == SDConstants.MaterialType.equip_reap)
        {
            CDP.SelectedNumSlider.gameObject.SetActive(true);
            ResolveBtn.gameObject.SetActive(true);
            //
            ResolveBtn.GetComponentInChildren <Text>().text
                = SDGameManager.T("解锁");
        }
        else if (item.MaterialType == SDConstants.MaterialType.treasure ||
                 item.MaterialType == SDConstants.MaterialType.key ||
                 item.MaterialType == SDConstants.MaterialType.goddess_piece ||
                 item.MaterialType == SDConstants.MaterialType.end)
        {
            CDP.SelectedNumSlider.gameObject.SetActive(false);
            ResolveBtn.gameObject.SetActive(false);
        }
        else
        {
            CDP.SelectedNumSlider.gameObject.SetActive(true);
            ResolveBtn.gameObject.SetActive(true);
            //
            ResolveBtn.GetComponentInChildren <Text>().text
                = SDGameManager.T("出售");
        }
    }
示例#16
0
 public void initOneSkillSlot(OneSkill skill)
 {
     if (skill == null)
     {
         emptyPanel.gameObject.SetActive(true);
         return;
     }
     if (skill.lv < 0 || string.IsNullOrEmpty(skill.skillId))
     {
         emptyPanel.gameObject.SetActive(true);
     }
     else
     {
         emptyPanel.gameObject.SetActive(false);
         lv = skill.lv;
         slotAboveText.text = SDGameManager.T("Lv.") + lv;
         Transform skillBtn;;
         if (skill.UseAppointedPrefab)
         {
             skillBtn = skill.SkillPrefab;
         }
         else
         {
             skillBtn = HDP.skillDetailList.AllSkillList[skill.SkillFunctionID];
         }
         skillItemImg.color = skillBtn.GetComponent <Image>().color;
     }
     id      = skill.skillId;
     isOmega = skill.isOmegaSkill;
     if (isOmega)
     {
         skillBgIcon.sprite = SDDataManager.Instance.baseFrameSpriteByRarity(3);
     }
     else
     {
         skillBgIcon.sprite = SDDataManager.Instance.baseFrameSpriteByRarity(1);
     }
 }
示例#17
0
    public void initEquipDetailVision(GDEEquipmentData equip)
    {
        equipId       = equip.id;
        equipHashcode = equip.hashcode;
        equipData     = SDDataManager.Instance.GetEquipItemById(equipId);

        //
        int lv = equip.lv;

        nameText.text = (lv > 0?SDGameManager.T("Lv.") + lv + "·":"") + equipData.NAME;


        equipLv            = lv;
        equipPosImg.sprite = SDDataManager.Instance.equipPosIcon(equipData.EquipPos);
        equipPosImg.SetNativeSize();
        starVision.StarNum = equip.quality;
        //
        equipIcon.sprite      = equipData.IconFromAtlas;
        equipBgIcon.sprite    = SDDataManager.Instance.baseBgSpriteByRarity(equipData.LEVEL);
        equipFrameIcon.sprite = SDDataManager.Instance.baseFrameSpriteByRarity(equipData.LEVEL);
        //
        EDP.EmptyPanel.gameObject.SetActive(false);
    }
示例#18
0
 public void initSkillItem(OneSkill baseskilldata, int heroHashcode = 0)
 {
     deploy        = SDConstants.deployType.skill;
     ItemId        = baseskilldata.skillId;
     lv            = baseskilldata.lv;
     DownText.text = SDGameManager.T("Lv.") + lv;
     if (heroHashcode > 0)
     {
         OneSkill S = SDDataManager.Instance.getOwnedSkillById
                          (ItemId, heroHashcode);
         isOmega = S.isOmegaSkill;
         if (isOmega)
         {
             itemFrameImg.sprite = SDDataManager.Instance
                                   .baseFrameSpriteByRarity(3);
         }
         else
         {
             itemFrameImg.sprite = SDDataManager.Instance
                                   .baseFrameSpriteByRarity(1);
         }
     }
 }
示例#19
0
    public void initHero(GDEHeroData hero)
    {
        type         = SDConstants.ItemType.Hero;
        itemId       = hero.id;
        itemHashcode = hero.hashCode;
        if (fightForceText)
        {
            fightForceText.text
                = "" + (SDDataManager.Instance.getHeroOriginalBattleForceByHashCode(itemHashcode));//读取角色战斗力
        }
        SDConstants.CharacterAnimType animType = (SDConstants.CharacterAnimType)
                                                     (SDDataManager.Instance.getHeroCareerById(itemId));
        ROHeroData roh = SDDataManager.Instance.getHeroDataByID(itemId, hero.starNumUpgradeTimes);

        if (characterModel != null)
        {
            characterModel.initHeroCharacterModel(itemHashcode, SDConstants.HERO_MODEL_RATIO);
        }
        itemLevel = SDDataManager.Instance.getLevelByExp(hero.exp);
        if (upText)
        {
            upText.gameObject.SetActive(false);
        }
        if (downText)
        {
            downText.text = SDGameManager.T("Lv.") + itemLevel;
        }
        if (slider)
        {
            slider.gameObject.SetActive(false);
        }
        if (starVision)
        {
            starVision.StarNum = roh.starNum;
        }
        if (statusImg)
        {
            statusImg.gameObject.SetActive(true);
            statusImg.sprite = UIEffectManager.Instance.heroStatusSps[hero.status];
        }

        //
        if (itemImg)
        {
        }
        //
        if (careerImg)
        {
            Sprite career = roh.Info.Career.Icon;
            careerImg.sprite = career;
        }
        if (raceImg)
        {
            Sprite race = roh.Info.Race.Icon;
            if (roh.Info.Race.NAME == "无种族")
            {
                HeroRace _r = roh.Info.Race;
                race = _r.Icon;
            }
            raceImg.sprite = race;
        }
        if (itemBgImg)
        {
            itemBgImg.sprite
                = SDDataManager.Instance.heroBgSpriteByRarity(roh.Info.Rarity);
        }
        if (frameImg)
        {
            frameImg.sprite
                = SDDataManager.Instance.heroFrameSpriteByRarity(roh.Info.Rarity);
        }
    }
示例#20
0
 public void initThisItem()
 {
     BtnText.text = SDGameManager.T(Item.Data);
     Icon.sprite  = Item.IconFromAtlas;
     refreshThisItemDetail();
 }
示例#21
0
    public void InitHeroBasicProperties()
    {
        if (_hero)
        {
            this.RoleBasicRA           = _hero.RoleBasicRA.Clone;
            this.CRIDmg                = _hero.CRIDmg;
            this.DmgReduction          = _hero.DmgReduction;
            this.DmgReflection         = _hero.DmgReflection;
            this.RewardRate            = _hero.RewardRate;
            this.BarChartRegendPerTurn = _hero.BarChartRegendPerTurn;

            this.ID    = _hero.ID;
            this.Name  = SDGameManager.T(_hero.Name);
            this.LEVEL = _hero.LEVEL;
        }

        if (_helmet)
        {
            this.RoleBasicRA           += _helmet.RoleBasicRA.Clone;
            this.CRIDmg                += _helmet.CRIDmg;
            this.DmgReduction          += _helmet.DmgReduction;
            this.DmgReflection         += _helmet.DmgReflection;
            this.RewardRate            += _helmet.RewardRate;
            this.BarChartRegendPerTurn += _helmet.BarChartRegendPerTurn;
        }
        if (_breastplate)
        {
            this.RoleBasicRA           += _breastplate.RoleBasicRA.Clone;
            this.CRIDmg                += _breastplate.CRIDmg;
            this.DmgReduction          += _breastplate.DmgReduction;
            this.DmgReflection         += _breastplate.DmgReflection;
            this.RewardRate            += _breastplate.RewardRate;
            this.BarChartRegendPerTurn += _breastplate.BarChartRegendPerTurn;
        }
        if (_gardebras)
        {
            this.RoleBasicRA           += _gardebras.RoleBasicRA.Clone;
            this.CRIDmg                += _gardebras.CRIDmg;
            this.DmgReduction          += _gardebras.DmgReduction;
            this.DmgReflection         += _gardebras.DmgReflection;
            this.RewardRate            += _gardebras.RewardRate;
            this.BarChartRegendPerTurn += _gardebras.BarChartRegendPerTurn;
        }
        if (_legging)
        {
            this.RoleBasicRA           += _legging.RoleBasicRA.Clone;
            this.CRIDmg                += _legging.CRIDmg;
            this.DmgReduction          += _legging.DmgReduction;
            this.DmgReflection         += _legging.DmgReflection;
            this.RewardRate            += _legging.RewardRate;
            this.BarChartRegendPerTurn += _legging.BarChartRegendPerTurn;
        }
        if (_jewelry0)
        {
            this.RoleBasicRA           += _jewelry0.RoleBasicRA.Clone;
            this.CRIDmg                += _jewelry0.CRIDmg;
            this.DmgReduction          += _jewelry0.DmgReduction;
            this.DmgReflection         += _jewelry0.DmgReflection;
            this.RewardRate            += _jewelry0.RewardRate;
            this.BarChartRegendPerTurn += _jewelry0.BarChartRegendPerTurn;
        }
        if (_jewelry1)
        {
            this.RoleBasicRA           += _jewelry1.RoleBasicRA.Clone;
            this.CRIDmg                += _jewelry1.CRIDmg;
            this.DmgReduction          += _jewelry1.DmgReduction;
            this.DmgReflection         += _jewelry1.DmgReflection;
            this.RewardRate            += _jewelry1.RewardRate;
            this.BarChartRegendPerTurn += _jewelry1.BarChartRegendPerTurn;
        }
        if (_weapon)
        {
            this.RoleBasicRA           += _weapon.RoleBasicRA.Clone;
            this.CRIDmg                += _weapon.CRIDmg;
            this.DmgReduction          += _weapon.DmgReduction;
            this.DmgReflection         += _weapon.DmgReflection;
            this.RewardRate            += _weapon.RewardRate;
            this.BarChartRegendPerTurn += _weapon.BarChartRegendPerTurn;
        }
        //

        initRoleClassData();
    }
示例#22
0
    public void refreshSelectedEquipmentDetail(int hashcode)
    {
        if (hashcode > 0)
        {
            GDEEquipmentData equip = SDDataManager.Instance.getEquipmentByHashcode(hashcode);

            if (equip != null)
            {
                currentEquipHashcode = equip.hashcode;
                equipedItemName.text
                    = SDDataManager.Instance.getEquipNameByHashcode(currentEquipHashcode);
                equipedItemLevel.text = SDGameManager.T("Lv.")
                                        + equip.lv;
                equipedItemBattleForce.text
                    = "" + SDDataManager.Instance.getEquipBattleForceByHashCode(equip.hashcode);
                //
                equipIcon.sprite = SDDataManager.Instance.GetEquipIconById(equip.id);
                EquipItem item = SDDataManager.Instance.GetEquipItemById(equip.id);
                equipFrameIcon.sprite = SDDataManager.Instance.baseFrameSpriteByRarity(item.LEVEL);
                equipBgIcon.sprite    = SDDataManager.Instance.baseBgSpriteByRarity(item.LEVEL);
                //
                equipedItemBtn.gameObject.SetActive(true);
                if (equip.OwnerHashcode > 0)//判断是否已被装备
                {
                    bool flag = false;
                    if (equip.OwnerHashcode == heroDetail.Hashcode)//是当前角色装备
                    {
                        flag = true;
                        if (SDDataManager.Instance.getEquipPosById(equip.id) == 4)
                        {
                            if (!isSecondJewelryPos &&
                                SDDataManager.Instance.getHeroByHashcode(heroDetail.Hashcode)
                                .jewelry0.hashcode != equip.hashcode)
                            {
                                flag = false;
                            }
                            else if (isSecondJewelryPos &&
                                     SDDataManager.Instance.getHeroByHashcode(heroDetail.Hashcode)
                                     .jewelry1.hashcode != equip.hashcode)
                            {
                                flag = false;
                            }
                        }
                    }
                    else
                    {
                        flag = false;
                    }
                    if (flag)
                    {
                        equipItemBtnText.text = SDGameManager.T("解除装备");
                    }
                    else
                    {
                        equipedItemBtn.gameObject.SetActive(false);
                        equipItemBtnText.text = SDGameManager.T("无法装备");
                    }
                }
                else
                {
                    equipItemBtnText.text = SDGameManager.T("装备");
                }
            }
        }
    }
示例#23
0
    public void consumeToGetItems(string itemId, bool useDamond, int itemNum = 1)
    {
        SDConstants.ItemType type = SDDataManager.Instance.getItemTypeById(itemId);
        int allConsume            = 0;

        if (type == SDConstants.ItemType.Consumable)
        {
            consumableItem data = SDDataManager.Instance.getConsumableItemById(itemId);
            if (!useDamond)
            {
                allConsume = data.buyPrice_coin * itemNum;
            }
            else
            {
                allConsume = data.buyPrice_diamond * itemNum;
            }
        }
        else if (type == SDConstants.ItemType.Consumable)
        {
            consumableItem DATA = SDDataManager.Instance.getConsumableItemById(itemId);
            if (!useDamond)
            {
                allConsume = DATA.buyPrice_coin * itemNum;
            }
            else
            {
                allConsume = DATA.buyPrice_diamond * itemNum;
            }
        }
        else if (type == SDConstants.ItemType.Equip)
        {
        }

        if (allConsume <= 0)
        {
            return;
        }

        if (!useDamond)
        {
            if (ConsumeCoinToGetItems(allConsume, itemId, out int surplus, itemNum))
            {
                Debug.Log("消耗 金币 " + allConsume + " 获得 商品id " + itemId
                          + " X" + itemNum + "====== 剩余 金币 " + surplus);
            }
        }
        else
        {
            PopoutController.CreatePopoutAlert
            (
                "",
                SDGameManager.T("是否确认购买"),
                5,
                true,
                PopoutController.PopoutWIndowAlertType.ConfirmMessage,
                (PopoutController c, PopoutController.PopoutWindowAlertActionType d) =>
            {
                if (d == PopoutController.PopoutWindowAlertActionType.OnConfirm)
                {
                    bool a = ConsumeDamondToGetItems
                                 (allConsume, itemId, out int surplus, itemNum);
                    if (a)
                    {
                        Debug.Log("消耗 钻石 " + allConsume + " 获得 商品id " + itemId
                                  + " X" + itemNum + "====== 剩余 钻石 " + surplus);
                        c._dismissAfterTapBtn = true;
                    }
                }
示例#24
0
    public void initgoddessDetailVision(GDEgoddessData goddess)
    {
        isEmpty = false;
        GoddessInfo info = SDDataManager.Instance.getGoddessInfoById(goddess.id);

        Id = goddess.id;
        int integrity = SDDataManager.Instance.getIntegrityByVolume(goddess.volume, info.Quality);

        if (integrity < 1)
        {
            isLocked = true;
            lockedPanelSlider.localScale = new Vector3
                                               (SDDataManager.Instance.getRateAppraochIntegrity(goddess.volume, info.Quality), 1, 1);
            return;
        }
        isLocked      = false;
        lv            = SDDataManager.Instance.getLevelByExp(goddess.exp);
        nameText.text = SDGameManager.T("Lv.") + lv + "·" + info.name;
        quality       = info.Quality;
        //rarityText.text = SDDataManager.Instance.rarityString(quality);
        //
        expSlider.localScale = new Vector3
                                   (SDDataManager.Instance.getExpRateByExp(goddess.exp), 1, 1);
        volumeSlider.localScale = new Vector3
                                      (SDDataManager.Instance.getRateAppraochIntegrity(goddess.volume, info.Quality), 1, 1);

        //
        if (SDDataManager.Instance.getRuneEquippedByPosAndGoddess
                (0, goddess.id, out GDERuneData data0))
        {
            RuneEquipList[0].initRune(data0);
        }
        else
        {
            RuneEquipList[0].isEmpty = true;
        }
        if (SDDataManager.Instance.getRuneEquippedByPosAndGoddess
                (1, goddess.id, out GDERuneData data1))
        {
            RuneEquipList[1].initRune(data1);
        }
        else
        {
            RuneEquipList[1].isEmpty = true;
        }
        if (SDDataManager.Instance.getRuneEquippedByPosAndGoddess
                (2, goddess.id, out GDERuneData data2))
        {
            RuneEquipList[2].initRune(data2);
        }
        else
        {
            RuneEquipList[2].isEmpty = true;
        }
        if (SDDataManager.Instance.getRuneEquippedByPosAndGoddess
                (3, goddess.id, out GDERuneData data3))
        {
            RuneEquipList[3].initRune(data3);
        }
        else
        {
            RuneEquipList[3].isEmpty = true;
        }

        for (int i = 0; i < RuneEquipList.Length; i++)
        {
            simpleSlotSet slot = RuneEquipList[i];
            slot.resetOnBtnTapped();
            slot.OnBtnTapped += GDP.initRuneEquipAndSetPanel;
        }
    }
示例#25
0
 public void InitData(AttributeData tag, RoleAttributeList ral)
 {
     TAG = tag;
     AttiNameText.text = SDGameManager.T(TAG.ToString().ToLower());
     Refresh(ral);
 }