Exemple #1
0
 public void AssignPower(int pbPower, CardVo vo)
 {
     SingingAdditon    = (int)Math.Ceiling(pbPower * vo.GrowthRateS);
     DancingAdditon    = (int)Math.Ceiling(pbPower * vo.GrowthRateD);
     OriginalAdditon   = (int)Math.Ceiling(pbPower * vo.GrowthRateC);
     PopularityAdditon = (int)Math.Ceiling(pbPower * vo.GrowthRatePo);
     GlamourAdditon    = (int)Math.Ceiling(pbPower * vo.GrowthRateCh);
     WillpowerAdditon  = (int)Math.Ceiling(pbPower * vo.GrowthRatePe);
 }
Exemple #2
0
        private void InitData()
        {
            CardPB cardPb = GlobalData.CardModel.GetCardBase(CardId);

            Name       = cardPb.CardName;
            Credit     = cardPb.Credit;
            RequireNum = cardPb.Puzzle;
            Player     = cardPb.Player;
            Name       = CardVo.SpliceCardName(Name, cardPb.Player);
            CardVo     = new CardVo();
            CardVo.InitData(cardPb);
            var vo = GlobalData.CardModel.GetUserCardById(CardId);

            CardPath = vo != null?CardVo.SmallCardPath(vo.UserNeedShowEvoCard() && vo.Level > 60) : CardVo.SmallCardPath();
        }
Exemple #3
0
        private void SetCredit(CardVo vo)
        {
            string spName = "UIAtlas_Common_newR";

            if (vo.Credit == CreditPB.Ssr)
            {
                spName = "UIAtlas_Common_newSSR";
            }
            else if (vo.Credit == CreditPB.Sr)
            {
                spName = "UIAtlas_Common_newSR";
            }
            _cardCreditImage.sprite = AssetManager.Instance.GetSpriteAtlas(spName);
            //_cardCreditImage.SetNativeSize();
        }
Exemple #4
0
        public void SetData(AppointmentRuleVo vo)
        {
            _tips.text = I18NManager.Get("LoveAppointment_NoRoleWindowTips");//"获得此星缘可解锁恋爱剧情";

            for (int i = 0; i < _btnGroup.childCount; i++)
            {
                Transform roleStory = _btnGroup.GetChild(i);
                //Debug.LogError(vo.ActiveCards[i]);
                if (vo.ActiveCards[i] <= 0)
                {
                    continue;
                }
                _btnGroup.GetChild(i).gameObject.Show();
                RawImage role      = roleStory.Find("RoleImage").GetComponent <RawImage>();
                Text     storyName = roleStory.Find("Text").GetComponent <Text>();
                var      card      = GlobalData.CardModel.GetCardBase(vo.ActiveCards[i]);
                role.texture   = ResourceManager.Load <Texture>("Card/Image/MiddleCard/" + vo.ActiveCards[i], ModuleConfig.MODULE_LOVEAPPOINTMENT);
                storyName.text = CardVo.SpliceCardName(card.CardName, card.Player);
            }
        }
Exemple #5
0
        public void SetProperties(UserCardVo userCardVo, AdditionType type)
        {
            CardVo vo = userCardVo.CardVo;

            CardAdditionVo curAdditionVo = userCardVo.CurLevelInfo;
            CardAdditionVo additionVo    = userCardVo.NextLevelInfo;
            int            addsing       = 0;
            int            adddance      = 0;
            int            addoriginal   = 0;
            int            addpopularity = 0;
            int            addglamour    = 0;
            int            addwillpower  = 0;

            if (type == AdditionType.Level)
            {
                addsing       = (additionVo.SingingAdditon - curAdditionVo.SingingAdditon);
                adddance      = (additionVo.DancingAdditon - curAdditionVo.DancingAdditon);
                addoriginal   = (additionVo.OriginalAdditon - curAdditionVo.OriginalAdditon);
                addpopularity = (additionVo.PopularityAdditon - curAdditionVo.PopularityAdditon);
                addglamour    = (additionVo.GlamourAdditon - curAdditionVo.GlamourAdditon);
                addwillpower  = (additionVo.WillpowerAdditon - curAdditionVo.WillpowerAdditon);
            }

            if (type == AdditionType.Star)
            {
                addsing       = userCardVo.NextStarInfo.SingingAdditon - userCardVo.CurStarInfo.SingingAdditon;
                adddance      = userCardVo.NextStarInfo.DancingAdditon - userCardVo.CurStarInfo.DancingAdditon;
                addoriginal   = userCardVo.NextStarInfo.OriginalAdditon - userCardVo.CurStarInfo.OriginalAdditon;
                addpopularity = userCardVo.NextStarInfo.PopularityAdditon - userCardVo.CurStarInfo.PopularityAdditon;
                addglamour    = userCardVo.NextStarInfo.GlamourAdditon - userCardVo.CurStarInfo.GlamourAdditon;
                addwillpower  = userCardVo.NextStarInfo.WillpowerAdditon - userCardVo.CurStarInfo.WillpowerAdditon;
            }
            else if (type == AdditionType.Evolution)
            {
                addsing       = userCardVo.EvoInfoAddition.SingingAdditon - userCardVo.CurEvolutionInfo.SingingAdditon;
                adddance      = userCardVo.EvoInfoAddition.DancingAdditon - userCardVo.CurEvolutionInfo.DancingAdditon;
                addoriginal   = userCardVo.EvoInfoAddition.OriginalAdditon - userCardVo.CurEvolutionInfo.OriginalAdditon;
                addpopularity = userCardVo.EvoInfoAddition.PopularityAdditon - userCardVo.CurEvolutionInfo.PopularityAdditon;
                addglamour    = userCardVo.EvoInfoAddition.GlamourAdditon - userCardVo.CurEvolutionInfo.GlamourAdditon;
                addwillpower  = userCardVo.EvoInfoAddition.WillpowerAdditon - userCardVo.CurEvolutionInfo.WillpowerAdditon;
            }

            //正确公式应该是vo.sing*groth+pb.power
            //进化3之前都要显示加号!


            if (addsing > 0 && (int)userCardVo.Evolution < vo.GetMaxEvoTimes())//userCardVo.Level<=userCardVo.CardVo.MaxLevel&&userCardVo.Evolution!=EvolutionPB.Evo1&&
            {
                //Debug.LogError(type+" vo.singing "+vo.Singing+" curAdditionVo "+curAdditionVo.SingingAdditon+" additionVo "+additionVo.SingingAdditon);
                _singText.text       = userCardVo.Singing + "  +" + addsing;
                _danceText.text      = userCardVo.Dancing + "  +" + adddance;
                _originalText.text   = userCardVo.Original + "   +" + addoriginal;     //-curAdditionVo.OriginalAdditon);
                _popularityText.text = userCardVo.Popularity + "   +" + addpopularity; //-curAdditionVo.PopularityAdditon);
                _glamourText.text    = userCardVo.Glamour + "   +" + addglamour;       //-curAdditionVo.GlamourAdditon);
                _willpowerText.text  = userCardVo.Willpower + "   +" + addwillpower;   //-curAdditionVo.WillpowerAdditon);
            }
            else
            {
                //Debug.LogError(type+" vo.singing "+vo.Singing+" curAdditionVo "+curAdditionVo.SingingAdditon+" additionVo "+additionVo.SingingAdditon);
                _singText.text       = userCardVo.Singing.ToString();    //+"  +"+additionVo.SingingAdditon;//(vo.Singing+ curAdditionVo.SingingAdditon )+ "   +" + (additionVo.SingingAdditon-curAdditionVo.SingingAdditon);
                _danceText.text      = userCardVo.Dancing.ToString();    // + "  +" + additionVo.DancingAdditon; //(vo.Dancing + curAdditionVo.DancingAdditon)+"   +" + (additionVo.DancingAdditon-curAdditionVo.DancingAdditon);
                _originalText.text   = userCardVo.Original.ToString();   //+ "   +" + additionVo.OriginalAdditon;//-curAdditionVo.OriginalAdditon);
                _popularityText.text = userCardVo.Popularity.ToString(); // + "   +" + additionVo.PopularityAdditon;//-curAdditionVo.PopularityAdditon);
                _glamourText.text    = userCardVo.Glamour.ToString();    // + "   +" + additionVo.GlamourAdditon;//-curAdditionVo.GlamourAdditon);
                _willpowerText.text  = userCardVo.Willpower.ToString();  // + "   +" + additionVo.WillpowerAdditon; //-curAdditionVo.WillpowerAdditon);
            }

            int cur = userCardVo.Singing + userCardVo.Dancing
                      + userCardVo.Original + userCardVo.Popularity
                      + userCardVo.Glamour + userCardVo.Willpower;

            if (_isOther)
            {
                oldNum = cur;
                newNum = cur;
                setTotal(cur);
            }

            newNum = cur;
            setTotal(newNum);

            if (newNum > oldNum)
            {
                ShowUpgradeEffect();
            }
        }