public void AttributeXp(int xp) { PlayerExperience += xp; PlayerLevel = XpPointsUtil.GetLevelForXp(PlayerExperience); _serverLocalPlayerPlayerStatisticsView.Xp = PlayerExperience; _serverLocalPlayerPlayerStatisticsView.Level = PlayerLevel; }
public void UpdatePlayerStats(StatsCollection stats, StatsCollection best) { PlayerStatisticsView serverLocalPlayerStatisticsView = ServerLocalPlayerStatisticsView; int xp = serverLocalPlayerStatisticsView.Xp + GameState.Current.Statistics.GainedXp; int levelForXp = XpPointsUtil.GetLevelForXp(xp); SetPlayerStatisticsView(new PlayerStatisticsView(serverLocalPlayerStatisticsView.Cmid, serverLocalPlayerStatisticsView.Splats + stats.GetKills(), serverLocalPlayerStatisticsView.Splatted + stats.Deaths, serverLocalPlayerStatisticsView.Shots + stats.GetShots(), serverLocalPlayerStatisticsView.Hits + stats.GetHits(), serverLocalPlayerStatisticsView.Headshots + stats.Headshots, serverLocalPlayerStatisticsView.Nutshots + stats.Nutshots, xp, levelForXp, new PlayerPersonalRecordStatisticsView(( serverLocalPlayerStatisticsView.PersonalRecord.MostHeadshots <= best.Headshots) ? best.Headshots : serverLocalPlayerStatisticsView.PersonalRecord.MostHeadshots, (serverLocalPlayerStatisticsView.PersonalRecord.MostNutshots <= best.Nutshots) ? best.Nutshots : serverLocalPlayerStatisticsView.PersonalRecord.MostNutshots, (serverLocalPlayerStatisticsView.PersonalRecord.MostConsecutiveSnipes <= best.ConsecutiveSnipes) ? best.ConsecutiveSnipes : serverLocalPlayerStatisticsView.PersonalRecord.MostConsecutiveSnipes, 0, (serverLocalPlayerStatisticsView.PersonalRecord.MostSplats <= best.GetKills()) ? best.GetKills() : serverLocalPlayerStatisticsView.PersonalRecord.MostSplats, (serverLocalPlayerStatisticsView.PersonalRecord.MostDamageDealt <= best.GetDamageDealt()) ? best.GetDamageDealt() : serverLocalPlayerStatisticsView.PersonalRecord.MostDamageDealt, (serverLocalPlayerStatisticsView.PersonalRecord.MostDamageReceived <= best.DamageReceived) ? best.DamageReceived : serverLocalPlayerStatisticsView.PersonalRecord.MostDamageReceived, (serverLocalPlayerStatisticsView.PersonalRecord.MostArmorPickedUp <= best.ArmorPickedUp) ? best.ArmorPickedUp : serverLocalPlayerStatisticsView.PersonalRecord.MostArmorPickedUp, (serverLocalPlayerStatisticsView.PersonalRecord.MostHealthPickedUp <= best.HealthPickedUp) ? best.HealthPickedUp : serverLocalPlayerStatisticsView.PersonalRecord.MostHealthPickedUp, (serverLocalPlayerStatisticsView.PersonalRecord.MostMeleeSplats <= best.MeleeKills) ? best.MeleeKills : serverLocalPlayerStatisticsView.PersonalRecord.MostMeleeSplats, (serverLocalPlayerStatisticsView.PersonalRecord.MostMachinegunSplats <= best.MachineGunKills) ? best.MachineGunKills : serverLocalPlayerStatisticsView.PersonalRecord.MostMachinegunSplats, (serverLocalPlayerStatisticsView.PersonalRecord.MostShotgunSplats <= best.ShotgunSplats) ? best.ShotgunSplats : serverLocalPlayerStatisticsView.PersonalRecord.MostShotgunSplats, (serverLocalPlayerStatisticsView.PersonalRecord.MostSniperSplats <= best.SniperKills) ? best.SniperKills : serverLocalPlayerStatisticsView.PersonalRecord.MostSniperSplats, (serverLocalPlayerStatisticsView.PersonalRecord.MostSplattergunSplats <= best.SplattergunKills) ? best.SplattergunKills : serverLocalPlayerStatisticsView.PersonalRecord.MostSplattergunSplats, (serverLocalPlayerStatisticsView.PersonalRecord.MostCannonSplats <= best.CannonKills) ? best.CannonKills : serverLocalPlayerStatisticsView.PersonalRecord.MostCannonSplats, (serverLocalPlayerStatisticsView.PersonalRecord.MostLauncherSplats <= best.LauncherKills) ? best.LauncherKills : serverLocalPlayerStatisticsView.PersonalRecord.MostLauncherSplats), new PlayerWeaponStatisticsView(serverLocalPlayerStatisticsView.WeaponStatistics.MeleeTotalSplats + stats.MeleeKills, serverLocalPlayerStatisticsView.WeaponStatistics.MachineGunTotalSplats + stats.MachineGunKills, serverLocalPlayerStatisticsView.WeaponStatistics.ShotgunTotalSplats + stats.ShotgunSplats, serverLocalPlayerStatisticsView.WeaponStatistics.SniperTotalSplats + stats.SniperKills, serverLocalPlayerStatisticsView.WeaponStatistics.SplattergunTotalSplats + stats.SplattergunKills, serverLocalPlayerStatisticsView.WeaponStatistics.CannonTotalSplats + stats.CannonKills, serverLocalPlayerStatisticsView.WeaponStatistics.LauncherTotalSplats + stats.LauncherKills, serverLocalPlayerStatisticsView.WeaponStatistics.MeleeTotalShotsFired + stats.MeleeShotsFired, serverLocalPlayerStatisticsView.WeaponStatistics.MeleeTotalShotsHit + stats.MeleeShotsHit, serverLocalPlayerStatisticsView.WeaponStatistics.MeleeTotalDamageDone + stats.MeleeDamageDone, serverLocalPlayerStatisticsView.WeaponStatistics.MachineGunTotalShotsFired + stats.MachineGunShotsFired, serverLocalPlayerStatisticsView.WeaponStatistics.MachineGunTotalShotsHit + stats.MachineGunShotsHit, serverLocalPlayerStatisticsView.WeaponStatistics.MachineGunTotalDamageDone + stats.MachineGunDamageDone, serverLocalPlayerStatisticsView.WeaponStatistics.ShotgunTotalShotsFired + stats.ShotgunShotsFired, serverLocalPlayerStatisticsView.WeaponStatistics.ShotgunTotalShotsHit + stats.ShotgunShotsHit, serverLocalPlayerStatisticsView.WeaponStatistics.ShotgunTotalDamageDone + stats.ShotgunDamageDone, serverLocalPlayerStatisticsView.WeaponStatistics.SniperTotalShotsFired + stats.SniperShotsFired, serverLocalPlayerStatisticsView.WeaponStatistics.SniperTotalShotsHit + stats.SniperShotsHit, serverLocalPlayerStatisticsView.WeaponStatistics.SniperTotalDamageDone + stats.SniperDamageDone, serverLocalPlayerStatisticsView.WeaponStatistics.SplattergunTotalShotsFired + stats.SplattergunShotsFired, serverLocalPlayerStatisticsView.WeaponStatistics.SplattergunTotalShotsHit + stats.SplattergunShotsHit, serverLocalPlayerStatisticsView.WeaponStatistics.SplattergunTotalDamageDone + stats.SplattergunDamageDone, serverLocalPlayerStatisticsView.WeaponStatistics.CannonTotalShotsFired + stats.CannonShotsFired, serverLocalPlayerStatisticsView.WeaponStatistics.CannonTotalShotsHit + stats.CannonShotsHit, serverLocalPlayerStatisticsView.WeaponStatistics.CannonTotalDamageDone + stats.CannonDamageDone, serverLocalPlayerStatisticsView.WeaponStatistics.LauncherTotalShotsFired + stats.LauncherShotsFired, serverLocalPlayerStatisticsView.WeaponStatistics.LauncherTotalShotsHit + stats.LauncherShotsHit, serverLocalPlayerStatisticsView.WeaponStatistics.LauncherTotalDamageDone + stats.LauncherDamageDone))); }
// Token: 0x06000C37 RID: 3127 RVA: 0x00052188 File Offset: 0x00050388 private void DrawXPMeter(Rect position) { float num = (float)(this._playerNextLevelXpReq - this._playerCurrentLevelXpReq); this._xpSliderPos = ((num <= 0f) ? 0f : Mathf.Clamp01((float)(PlayerDataManager.PlayerExperience - this._playerCurrentLevelXpReq) / num)); GUI.BeginGroup(position); if (PlayerDataManager.PlayerLevel < XpPointsUtil.MaxPlayerLevel) { GUI.Label(new Rect(0f, 0f, 200f, 16f), LocalizedStrings.CurrentXP + " " + PlayerDataManager.PlayerExperience.ToString("N0"), BlueStonez.label_interparkbold_11pt_left); GUI.Label(new Rect(position.width - 200f, 0f, 200f, 16f), LocalizedStrings.RemainingXP + " " + Mathf.Max(0, this._playerNextLevelXpReq - PlayerDataManager.PlayerExperience).ToString("N0"), BlueStonez.label_interparkbold_11pt_right); GUI.Box(new Rect(0f, 25f, position.width, 23f), GUIContent.none, BlueStonez.progressbar_large_background); GUI.color = ColorScheme.ProgressBar; GUI.Box(new Rect(2f, 27f, (float)Mathf.RoundToInt((position.width - 4f) * this._xpSliderPos), 19f), GUIContent.none, BlueStonez.progressbar_large_thumb); GUI.color = Color.white; GUI.Label(new Rect(0f, 50f, position.width, 16f), XpPointsUtil.GetLevelDescription(PlayerDataManager.PlayerLevel), BlueStonez.label_interparkbold_11pt_left); GUI.Label(new Rect(0f, 50f, position.width, 16f), XpPointsUtil.GetLevelDescription(PlayerDataManager.PlayerLevel + 1), BlueStonez.label_interparkbold_11pt_right); } else { GUI.Label(new Rect(0f, 0f, 200f, 16f), LocalizedStrings.CurrentXP + " " + PlayerDataManager.PlayerExperience.ToString("N0"), BlueStonez.label_interparkbold_11pt_left); GUI.Label(new Rect(position.width - 200f, 0f, 200f, 16f), "(Lvl " + PlayerDataManager.PlayerLevel + ")", BlueStonez.label_interparkbold_11pt_right); GUI.color = new Color(0f, 0.607f, 0.662f); GUI.Box(new Rect(0f, 30f, position.width, 23f), "YOU ARE FLOATING IN UBER SPACE", BlueStonez.label_interparkbold_18pt); GUI.color = Color.white; } GUI.EndGroup(); }
public void SetPlayerStatisticsView(PlayerStatisticsView value) { if (value != null) { _serverLocalPlayerPlayerStatisticsView = value; PlayerExperience = value.Xp; PlayerLevel = XpPointsUtil.GetLevelForXp(value.Xp); } }
// Token: 0x06000C2C RID: 3116 RVA: 0x000511B0 File Offset: 0x0004F3B0 private void OnEnable() { XpPointsUtil.GetXpRangeForLevel(PlayerDataManager.PlayerLevel, out this._playerCurrentLevelXpReq, out this._playerNextLevelXpReq); base.StartCoroutine(this.ScrollStatsFromRight(0.25f)); this.UpdateWeaponStatList(); if (MouseOrbit.Instance != null) { MouseOrbit.Instance.MaxX = Screen.width - 490; } }
// Token: 0x0600179C RID: 6044 RVA: 0x000805A4 File Offset: 0x0007E7A4 private void Update() { int playerExperience = PlayerDataManager.PlayerExperience; if ((float)playerExperience != this.cachedXP) { this.cachedXP = (float)playerExperience; int levelForXp = XpPointsUtil.GetLevelForXp(playerExperience); this.currentLevel.text = "Lvl " + levelForXp; this.nextLevel.text = "Lvl " + Mathf.Clamp(levelForXp + 1, 1, XpPointsUtil.MaxPlayerLevel); int num; int num2; XpPointsUtil.GetXpRangeForLevel(levelForXp, out num, out num2); base.StopAllCoroutines(); base.StartCoroutine(this.Animate((float)(playerExperience - num) / (float)(num2 - num))); } }