Exemple #1
0
        private void HeartLevelAndGoodFeelToTotalTouch(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.QueryLevelUpFeelNeedTouch(i - 1);
            }
            if (level != 5)
            {
                num += feel;
            }
            total = num;
        }
Exemple #2
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);
        }
Exemple #3
0
        public void IncreaseTouchGoodFeel(int amount)
        {
            if ((this._currentGalTouchInfo != null) && !this._waitingForResponse)
            {
                GoodFeelLimitType none = GoodFeelLimitType.None;
                bool flag = amount <= 0;
                amount = Mathf.Clamp(amount, -this._currentGalTouchInfo.touchGoodFeel, this.GetTodayRemainGoodFeel());
                if (this._currentGalTouchInfo.heartLevel > 4)
                {
                    if (this.GalTouchInfoChanged != null)
                    {
                        this.GalTouchInfoChanged(this._currentGalTouchInfo.touchGoodFeel + this._currentGalTouchInfo.battleGoodFeel, this._currentGalTouchInfo.heartLevel, this._currentGalTouchInfo.touchGoodFeel + this._currentGalTouchInfo.battleGoodFeel, this._currentGalTouchInfo.heartLevel, GoodFeelLimitType.ReachMax);
                    }
                }
                else
                {
                    int num  = GalTouchData.QueryLevelUpFeelNeedTouch(this._currentGalTouchInfo.heartLevel);
                    int num2 = GalTouchData.QueryLevelUpFeelNeedBattle(this._currentGalTouchInfo.heartLevel);
                    if ((this._currentGalTouchInfo.battleGoodFeel >= num2) && !this.IsLimitedByMission(this._currentGalTouchInfo))
                    {
                        int total = 0;
                        int feel  = 0;
                        int level = 1;
                        this.HeartLevelAndGoodFeelToTotal(this._currentGalTouchInfo.touchGoodFeel + this._currentGalTouchInfo.battleGoodFeel, this._currentGalTouchInfo.heartLevel, out total);
                        int num6 = total + amount;
                        this.TotalToHeartLevelAndGoodFeel(num6, out feel, out level);
                        if (this._currentGalTouchInfo.heartLevel != level)
                        {
                            num6 = Mathf.Min(num6, this.GetLevelTotalTouchLimit(this._currentGalTouchInfo.heartLevel + 1));
                            this.TotalToHeartLevelAndGoodFeel(num6, out feel, out level);
                        }
                        this.HeartLevelAndGoodFeelToTotal(feel, level, out num6);
                        this._currentGalTouchInfo.todayAddedFeel += num6 - total;
                        if ((amount == 0) && (this.GetTodayRemainGoodFeel() == 0))
                        {
                            none = GoodFeelLimitType.DialyGoodFeel;
                        }
                        if (this.GalTouchInfoChanged != null)
                        {
                            this.GalTouchInfoChanged(this._currentGalTouchInfo.touchGoodFeel + this._currentGalTouchInfo.battleGoodFeel, this._currentGalTouchInfo.heartLevel, feel, level, none);
                        }
                        if (level != this._currentGalTouchInfo.heartLevel)
                        {
                            this._currentGalTouchInfo.battleGoodFeel = 0;
                        }
                        this._currentGalTouchInfo.touchGoodFeel = feel - this._currentGalTouchInfo.battleGoodFeel;
                        this._currentGalTouchInfo.heartLevel    = level;
                        Singleton <NetworkManager> .Instance.RequestGalAddGoodFeel(this._currentGalTouchInfo.avatarId, num6 - total, 1);

                        this._waitingForResponse = true;
                    }
                    else
                    {
                        int num7 = Mathf.Clamp(this._currentGalTouchInfo.touchGoodFeel + amount, 0, num - 1);
                        amount = num7 - this._currentGalTouchInfo.touchGoodFeel;
                        if ((amount == 0) && !flag)
                        {
                            if (this.GetTodayRemainGoodFeel() == 0)
                            {
                                none = GoodFeelLimitType.DialyGoodFeel;
                            }
                            else if (this._currentGalTouchInfo.battleGoodFeel < num2)
                            {
                                none = GoodFeelLimitType.Battle;
                            }
                            else if (this.IsLimitedByMission(this._currentGalTouchInfo))
                            {
                                none = GoodFeelLimitType.Mission;
                            }
                        }
                        else
                        {
                            none = GoodFeelLimitType.None;
                        }
                        if (this.GalTouchInfoChanged != null)
                        {
                            this.GalTouchInfoChanged(this._currentGalTouchInfo.touchGoodFeel + this._currentGalTouchInfo.battleGoodFeel, this._currentGalTouchInfo.heartLevel, num7 + this._currentGalTouchInfo.battleGoodFeel, this._currentGalTouchInfo.heartLevel, none);
                        }
                        Singleton <NetworkManager> .Instance.RequestGalAddGoodFeel(this._currentGalTouchInfo.avatarId, amount, 1);

                        this._currentGalTouchInfo.todayAddedFeel += amount;
                        this._waitingForResponse = true;
                        this._currentGalTouchInfo.touchGoodFeel = num7;
                    }
                }
            }
        }