private void UpdateHint(GoodFeelLimitType limitType) { if (limitType == GoodFeelLimitType.DialyGoodFeel) { this._galTouchView.SetHintContent(LocalizationGeneralLogic.GetText("Impression_Dialy_Limit", new object[0])); this._galTouchView.SetHintVisible(true); } else if (limitType == GoodFeelLimitType.Battle) { this._galTouchView.SetHintContent(LocalizationGeneralLogic.GetText("Impression_Battle_Limit", new object[0])); this._galTouchView.SetHintVisible(true); } else if (limitType == GoodFeelLimitType.Mission) { this._galTouchView.SetHintContent(LocalizationGeneralLogic.GetText("Impression_Mission_Limit", new object[0])); this._galTouchView.SetHintVisible(true); } else { this._galTouchView.SetHintVisible(false); } }
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); } }
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; } } } }