Beispiel #1
0
        public void OnGalTouchInfoChanged(int oldGoodFeel, int oldHeartLevel, int newGoodFeel, int newHeartLevel, GoodFeelLimitType limitType)
        {
            if (this._galTouchView != null)
            {
                this.UpdateHint(limitType);
                int   num        = GalTouchData.QueryLevelUpFeelNeed(oldHeartLevel);
                float sliderFrom = 0f;
                if (num != 0)
                {
                    sliderFrom = ((float)oldGoodFeel) / ((float)num);
                }
                sliderFrom += oldHeartLevel;
                int   num3     = GalTouchData.QueryLevelUpFeelNeed(newHeartLevel);
                float sliderTo = 0f;
                if (num3 != 0)
                {
                    sliderTo = ((float)newGoodFeel) / ((float)num3);
                }
                sliderTo += newHeartLevel;
                string additionalText       = string.Empty;
                int    avatarGalTouchBuffId = Singleton <GalTouchModule> .Instance.GetAvatarGalTouchBuffId(Singleton <GalTouchModule> .Instance.GetCurrentTouchAvatarID());

                if (avatarGalTouchBuffId != 0)
                {
                    TouchBuffItem touchBuffItem = GalTouchData.GetTouchBuffItem(avatarGalTouchBuffId);
                    if (touchBuffItem != null)
                    {
                        object[] replaceParams = new object[] { GalTouchBuffData.GetCalculatedParam(touchBuffItem.param1, touchBuffItem.param1Add, newHeartLevel).ToString(), GalTouchBuffData.GetCalculatedParam(touchBuffItem.param2, touchBuffItem.param2Add, newHeartLevel).ToString(), GalTouchBuffData.GetCalculatedParam(touchBuffItem.param3, touchBuffItem.param3Add, newHeartLevel).ToString() };
                        additionalText = LocalizationGeneralLogic.GetText(touchBuffItem.detail, replaceParams);
                    }
                }
                this._galTouchView.Show(sliderFrom, sliderTo, newGoodFeel, additionalText);
            }
        }
Beispiel #2
0
        private void SetGoodFeelText(float ratio)
        {
            int   level = (int)ratio;
            float num2  = ratio - level;
            int   num3  = GalTouchData.QueryLevelUpFeelNeed(level);
            int   num4  = (int)(num3 * num2);

            this.goodFeelLabel.text = string.Format("{0}/{1}", (ratio != this._toPer) ? num4.ToString() : this._finalExp.ToString(), num3.ToString());
        }
Beispiel #3
0
        private void HeartLevelAndGoodFeelToTotal(int feel, int level, out int total)
        {
            int num = 0;

            level = Mathf.Clamp(level, 1, 5);
            for (int i = 2; i <= level; i++)
            {
                num += GalTouchData.QueryLevelUpFeelNeed(i - 1);
            }
            if (level != 5)
            {
                num += feel;
            }
            total = num;
        }
Beispiel #4
0
        private int GetLevelTotalTouchLimit(int level)
        {
            int num = 0;

            level = Mathf.Clamp(level, 1, 5);
            for (int i = 1; i < level; i++)
            {
                num += GalTouchData.QueryLevelUpFeelNeed(i);
            }
            if (level != 5)
            {
                num += GalTouchData.QueryLevelUpFeelNeedTouch(level);
            }
            return(num);
        }
Beispiel #5
0
 private void DoSetHeartLevelAndGoodFeel(GalTouchInfoItem item, int heartLevel, int touchGoodFeel, int battleGoodFeel)
 {
     if (item != null)
     {
         int num = touchGoodFeel + battleGoodFeel;
         heartLevel = Mathf.Clamp(heartLevel, 0, 5);
         int num2 = GalTouchData.QueryLevelUpFeelNeed(heartLevel);
         if (num2 != 0)
         {
             num = Mathf.Clamp(num, 0, num2 - 1);
         }
         item.heartLevel     = heartLevel;
         item.touchGoodFeel  = Mathf.Min(touchGoodFeel, num);
         item.battleGoodFeel = Mathf.Max(num - item.touchGoodFeel, 0);
     }
 }
Beispiel #6
0
        private void TotalToHeartLevelAndGoodFeel(int total, out int feel, out int level)
        {
            total = (total >= 0) ? total : 0;
            int num = 1;

            while (true)
            {
                if (num == 5)
                {
                    total = GalTouchData.QueryLevelUpFeelNeed(4);
                    break;
                }
                int num2 = GalTouchData.QueryLevelUpFeelNeed(num);
                if (total < num2)
                {
                    break;
                }
                total -= num2;
                num++;
            }
            feel  = total;
            level = num;
        }