public void SongFinished(StandardLevelSceneSetupDataSO sender, LevelCompletionResults levelCompletionResults, IDifficultyBeatmap difficultyBeatmap, GameplayModifiers gameplayModifiers) { try { if (sender == null || levelCompletionResults == null || difficultyBeatmap == null || gameplayModifiers == null) { return; } Logger.Debug("Finished song: " + levelCompletionResults.levelEndStateType + " - " + levelCompletionResults.songDuration + " - - " + levelCompletionResults.endSongTime); PlayerDataModelSO _playerDataModel = Resources.FindObjectsOfTypeAll <PlayerDataModelSO>().First(); _playerDataModel.currentLocalPlayer.playerAllOverallStatsData.soloFreePlayOverallStatsData.UpdateWithLevelCompletionResults(levelCompletionResults); _playerDataModel.Save(); if (levelCompletionResults.levelEndStateType != LevelCompletionResults.LevelEndStateType.Failed && levelCompletionResults.levelEndStateType != LevelCompletionResults.LevelEndStateType.Cleared) { return; } PlayerDataModelSO.LocalPlayer currentLocalPlayer = _playerDataModel.currentLocalPlayer; bool cleared = levelCompletionResults.levelEndStateType == LevelCompletionResults.LevelEndStateType.Cleared; string levelID = difficultyBeatmap.level.levelID; BeatmapDifficulty difficulty = difficultyBeatmap.difficulty; PlayerLevelStatsData playerLevelStatsData = currentLocalPlayer.GetPlayerLevelStatsData(levelID, difficulty); bool newHighScore = playerLevelStatsData.highScore < levelCompletionResults.score; playerLevelStatsData.IncreaseNumberOfGameplays(); if (cleared) { playerLevelStatsData.UpdateScoreData(levelCompletionResults.score, levelCompletionResults.maxCombo, levelCompletionResults.fullCombo, levelCompletionResults.rank); Resources.FindObjectsOfTypeAll <PlatformLeaderboardsModel>().First().AddScore(difficultyBeatmap, levelCompletionResults.unmodifiedScore, gameplayModifiers); } } catch (Exception e) { Data.Logger.Error(e); } }
public static void SaveRecord(IDifficultyBeatmap beatmap, LevelCompletionResults result, bool submissionDisabled = false) { // We now keep failed records. var cleared = result.levelEndStateType == LevelCompletionResults.LevelEndStateType.Cleared; // If submissionDisabled = true, we assume custom gameplay modifiers are applied. var param = ModsToParam(result.gameplayModifiers); param |= submissionDisabled ? Param.SubmissionDisabled : 0; var record = new Record { Date = DateTimeOffset.Now.ToUnixTimeMilliseconds(), ModifiedScore = result.modifiedScore, RawScore = result.rawScore, LastNote = cleared ? -1 : result.goodCutsCount + result.badCutsCount + result.missedCount, Param = (int)param }; var beatmapCharacteristicName = beatmap.parentDifficultyBeatmapSet.beatmapCharacteristic.serializedName; var difficulty = $"{beatmap.level.levelID}___{(int)beatmap.difficulty}___{beatmapCharacteristicName}"; if (!Records.ContainsKey(difficulty)) { Records.Add(difficulty, new List <Record>()); } Records[difficulty].Add(record); // Save to a file. We do this synchronously because the overhead is small. (400 ms / 15 MB, 60 ms / 1 MB) SaveRecordsToFile(); Plugin.Log?.Info($"Saved a new record {difficulty} ({result.modifiedScore})."); }
private static void UploadScore(IDifficultyBeatmap levelDifficulty, LevelCompletionResults results, out bool newHighScore) { var freePlayCoordinator = Resources.FindObjectsOfTypeAll <SoloFreePlayFlowCoordinator>().First(); var dataModel = freePlayCoordinator.GetPrivateField <PlayerDataModel>("_playerDataModel"); PlayerData currentLocalPlayer = dataModel.playerData; PlayerLevelStatsData playerLevelStatsData = currentLocalPlayer.GetPlayerLevelStatsData(levelDifficulty.level.levelID, levelDifficulty.difficulty, levelDifficulty.parentDifficultyBeatmapSet.beatmapCharacteristic); int prevHighScore = playerLevelStatsData.highScore; LevelCompletionResults levelCompletionResults = results; playerLevelStatsData.UpdateScoreData(levelCompletionResults.modifiedScore, levelCompletionResults.maxCombo, levelCompletionResults.fullCombo, levelCompletionResults.rank); newHighScore = playerLevelStatsData.highScore > prevHighScore; var platFormLeaderBoardsModel = freePlayCoordinator.GetPrivateField <PlatformLeaderboardsModel>("_platformLeaderboardsModel"); platFormLeaderBoardsModel.UploadScore( levelDifficulty, results.rawScore, results.modifiedScore, results.fullCombo, results.goodCutsCount, results.badCutsCount, results.missedCount, results.maxCombo, results.energy, results.gameplayModifiers); }
public void FinalizeData(LevelCompletionResults results) { if (songDataType == SongDataType.none && results.levelEndStateType == LevelCompletionResults.LevelEndStateType.Cleared) { songDataType = SongDataType.pass; } else if (songDataType == SongDataType.none && results.levelEndStateType == LevelCompletionResults.LevelEndStateType.Failed) { songDataType = SongDataType.fail; } dataCollector.UnregisterCollector(this); foreach (ITracker t in trackers.Values) { t.EndOfSong(results, this); } foreach (ITracker t in deepTrackers.Values) { t.EndOfSong(results, this); } deepTrackerResult = JsonConvert.SerializeObject(this, Formatting.None); // We store DeepTrackers in a private variable so it does not get serialized. Maybe find a better way to do so ? iDontLikeThat = deepTrackers; deepTrackers = null; trackerResult = JsonConvert.SerializeObject(this, Formatting.None); deepTrackers = iDontLikeThat; iDontLikeThat = null; }
public void Update() { if (_hasFailed && (Configuration.Instance.autoSkip || _vrControllersInputManager.MenuButtonDown()) && !_skipped) { // Stop the base coroutine and call the necessary functions to fail the level as quickly as possible if (_standardLevel) { _standardLevelFailedController.StopAllCoroutines(); LevelCompletionResults.LevelEndAction levelEndAction = _standardInitData.autoRestart ? LevelCompletionResults.LevelEndAction.Restart : LevelCompletionResults.LevelEndAction.None; LevelCompletionResults levelCompletionResults = _prepareLevelCompletionResults.FillLevelCompletionResults(LevelCompletionResults.LevelEndStateType.Failed, levelEndAction); _standardLevelSceneSetupData.Finish(levelCompletionResults); } else { _missionLevelFailedController.StopAllCoroutines(); LevelCompletionResults.LevelEndAction levelEndAction = _missionInitData.autoRestart ? LevelCompletionResults.LevelEndAction.Restart : LevelCompletionResults.LevelEndAction.None; LevelCompletionResults levelCompletionResults = _prepareLevelCompletionResults.FillLevelCompletionResults(LevelCompletionResults.LevelEndStateType.Failed, levelEndAction); MissionObjectiveResult[] results = _missionObjectiveCheckersManager.GetResults(); MissionCompletionResults missionCompletionReuslts = new MissionCompletionResults(levelCompletionResults, results); _missionLevelSceneSetupData.Finish(missionCompletionReuslts); } _skipped = true; } }
private void NoteWasCut(NoteController noteController, NoteCutInfo noteCutInfo) { if (noteController.noteData.colorType == ColorType.None || noteController.noteData.beatmapObjectType != BeatmapObjectType.Note) { return; } AllNotesCountDidChangeEvent(allNotesCount++, cuttableNotes); if (noteCutInfo.allIsOK) { NoteWasCutEvent((int)noteCutInfo.saberType); GoodCutCountDidChangeEvent(goodCutCount++); } else { BadCutCountDidChangeEvent(badCutCount++); } if (Mathf.Approximately(noteController.noteData.time, _lastNoteTime)) { _lastNoteTime = 0f; LevelFinishedEvent(); LevelCompletionResults results = _prepareLevelCompletionResults.FillLevelCompletionResults(LevelCompletionResults.LevelEndStateType.Cleared, LevelCompletionResults.LevelEndAction.None); if (results.modifiedScore > highScore) { NewHighscore(); } } }
private void LevelClearEvent(StandardLevelScenesTransitionSetupDataSO data, LevelCompletionResults result) { var _mainGameSceneSetupData = BS_Utils.Plugin.LevelData; var _beatmapData = _mainGameSceneSetupData?.GameplayCoreSceneSetupData?.difficultyBeatmap?.beatmapData; if (_beatmapData != null) { var songDuration = _mainGameSceneSetupData?.GameplayCoreSceneSetupData?.difficultyBeatmap?.level?.beatmapLevelData?.audioClip?.length ?? -1f; var songName = _mainGameSceneSetupData.GameplayCoreSceneSetupData.difficultyBeatmap.level.songName; DiaryData.LevelCleared(songName, songDuration, _beatmapData.notesCount); } string date = DateTime.Now.ToString("yyyy_MM_dd_"); String filepath = "D:/BeatSaberMod/" + date + "record.csv"; DiaryData.WritePlayData(filepath); DiaryData.Update(); List <Vector2> goodGraph = DiaryData.GetLastGoodRateGraphPoint(); Log.Write("LevelClearEvent goodGraph Count = " + goodGraph.Count.ToString()); floatingScreenForScore.rootViewController.gameObject.SetActive(true); floatingScreenForScore.GetComponent <GraphContainer>().gameObject.SetActive(true); floatingScreenForScore.GetComponent <GraphContainer>().Draw(DiaryData.GetLastGoodRateGraphPoint()); }
static void Postfix(ResultsViewController __instance) { Type type = __instance.GetType(); BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.NonPublic; FieldInfo rank = type.GetField("_rankText", bindingFlags); FieldInfo pb = type.GetField("_newHighScore", bindingFlags); FieldInfo comp = type.GetField("_levelCompletionResults", bindingFlags); TextMeshProUGUI tmp = (TextMeshProUGUI)rank.GetValue(__instance); LevelCompletionResults compres = (LevelCompletionResults)comp.GetValue(__instance); bool personalBest = (bool)pb.GetValue(__instance); Plugin.Log.Notice("FC: " + compres.fullCombo.ToString() + " Rank: " + tmp.text + " PB: " + personalBest.ToString()); if (personalBest && !__instance.practice) { Data.Player.currentData.Coins += 1; } if (rank.Equals("S") && !__instance.practice) { Data.Player.currentData.Coins += 2; } if (compres.fullCombo && !__instance.practice) { Data.Player.currentData.Coins += 3; } if (rank.Equals("SS") && !__instance.practice) { Data.Player.currentData.Coins += 4; } }
public void EndOfSong(LevelCompletionResults results, SongData data) { rightSaber = results.rightSaberMovementDistance; rightHand = results.rightHandMovementDistance; leftSaber = results.leftSaberMovementDistance; leftHand = results.leftHandMovementDistance; }
static void Prefix(LevelCompletionResults levelCompletionResults) { if (ScoreSubmission.disabled || ScoreSubmission.prolongedDisable) { ScoreSubmission.DisableScoreSaberScoreSubmission(); } }
private void UploadData(StandardLevelScenesTransitionSetupDataSO data, LevelCompletionResults results, bool isCampaign) { if (songData != null && !songData.IsAReplay() && results.levelEndAction == LevelCompletionResults.LevelEndAction.None) { songData.FinalizeData(results); if (isCampaign) { songData.songDataType = SongDataType.campaign; } if (!songData.IsPraticeMode()) { if (results.levelEndStateType == LevelCompletionResults.LevelEndStateType.Cleared && SettingsMenu.instance.DisablePass) { Logger.log.Info("Pass upload is disabled in the settings."); } else if (results.levelEndStateType == LevelCompletionResults.LevelEndStateType.Failed && SettingsMenu.instance.DisableFails) { Logger.log.Info("Fail upload is disabled in the settings."); } else { HTTPManager.UploadSongJson(songData.GetTrackersResults(), songData.GetTinyJson()); } } FileManager.SaveSongStats(songData.GetDeepTrackersResults()); FileManager.SavePBScoreGraph((songData.trackers["scoreGraphTracker"] as ScoreGraphTracker).graph, (songData.trackers["scoreTracker"] as ScoreTracker).score, songData.songID); storedData = songData; songDataFinished = true; songData = null; } }
public void SongFinished(StandardLevelScenesTransitionSetupDataSO sender, LevelCompletionResults levelCompletionResults, IDifficultyBeatmap difficultyBeatmap, GameplayModifiers gameplayModifiers, bool practice) { if (Client.Instance.InRadioMode) { PluginUI.instance.radioFlowCoordinator.lastDifficulty = difficultyBeatmap; PluginUI.instance.radioFlowCoordinator.lastResults = levelCompletionResults; } if (Config.Instance.SpectatorMode || Client.disableScoreSubmission || ScoreSubmission.Disabled || ScoreSubmission.ProlongedDisabled) { List <string> reasons = new List <string>(); if (Config.Instance.SpectatorMode) { reasons.Add("Spectator mode"); } if (Client.disableScoreSubmission) { reasons.Add("Multiplayer score submission disabled by another mod"); } if (ScoreSubmission.Disabled) { reasons.Add("Score submission is disabled by " + ScoreSubmission.ModString); } if (ScoreSubmission.ProlongedDisabled) { reasons.Add("Score submission is disabled for a prolonged time by " + ScoreSubmission.ProlongedModString); } Misc.Logger.Warning("\nScore submission is disabled! Reason:\n" + string.Join(",\n", reasons)); return; } PlayerDataModelSO _playerDataModel = Resources.FindObjectsOfTypeAll <PlayerDataModelSO>().First(); _playerDataModel.currentLocalPlayer.playerAllOverallStatsData.soloFreePlayOverallStatsData.UpdateWithLevelCompletionResults(levelCompletionResults); _playerDataModel.Save(); if (levelCompletionResults.levelEndStateType != LevelCompletionResults.LevelEndStateType.Failed && levelCompletionResults.levelEndStateType != LevelCompletionResults.LevelEndStateType.Cleared) { return; } PlayerDataModelSO.LocalPlayer currentLocalPlayer = _playerDataModel.currentLocalPlayer; bool cleared = levelCompletionResults.levelEndStateType == LevelCompletionResults.LevelEndStateType.Cleared; string levelID = difficultyBeatmap.level.levelID; BeatmapDifficulty difficulty = difficultyBeatmap.difficulty; BeatmapCharacteristicSO beatmapCharacteristic = difficultyBeatmap.parentDifficultyBeatmapSet.beatmapCharacteristic; PlayerLevelStatsData playerLevelStatsData = currentLocalPlayer.GetPlayerLevelStatsData(levelID, difficulty, beatmapCharacteristic); bool newHighScore = playerLevelStatsData.highScore < levelCompletionResults.score; playerLevelStatsData.IncreaseNumberOfGameplays(); if (cleared) { Misc.Logger.Info("Submitting score..."); playerLevelStatsData.UpdateScoreData(levelCompletionResults.score, levelCompletionResults.maxCombo, levelCompletionResults.fullCombo, levelCompletionResults.rank); Resources.FindObjectsOfTypeAll <PlatformLeaderboardsModel>().First().AddScore(difficultyBeatmap, levelCompletionResults.unmodifiedScore, gameplayModifiers); Misc.Logger.Info("Score submitted!"); } }
private void OnLevelFinished(StandardLevelScenesTransitionSetupDataSO scene, LevelCompletionResults result) { if (_isPractice || Gamemode.IsPartyActive) { return; } SaveRecord(scene?.difficultyBeatmap, result, false); }
static void Prefix(LevelCompletionResults levelCompletionResults) { if (ScoreSubmission.disabled || ScoreSubmission.prolongedDisable) { //Utilities.Logger.Log("Score Submission Disabled"); ScoreSubmission.DisableScoreSaberScoreSubmission(); } }
public static void Prefix(ref LevelCompletionResults levelCompletionResults, ref IDifficultyBeatmap difficultyBeatmap, ref bool practice, ref bool newHighScore) { #if DEBUG levelCompletionResults.SetField("levelEndStateType", LevelCompletionResults.LevelEndStateType.Cleared); practice = false; newHighScore = true; #endif }
static void Prefix(LevelCompletionResults levelCompletionResults, ref bool practice) { if (ScoreSubmission.disabled || ScoreSubmission.prolongedDisable) { // Utilities.Logger.Log("Score Submission Disabled"); practice = true; } }
static void Prefix(LevelCompletionResults levelCompletionResults, ref bool practice) { if (ScoreSubmission.WasDisabled || ScoreSubmission.disabled || ScoreSubmission.prolongedDisable) { //Utilities.Logger.Log($"Score Submission Disabled by {string.Join("|", ScoreSubmission.LastDisablers)}"); practice = true; } }
public void OnLevelDidFinish(StandardLevelScenesTransitionSetupDataSO scene, LevelCompletionResults result) { state = 0; Plugin.Log.Info("OnLevelDidFinish"); Destroy(newCam); camObj = null; newCam = null; }
static void Postfix(ref SoloFreePlayFlowCoordinator __instance, LevelCompletionResults levelCompletionResults) { // Show end of song UI if (levelCompletionResults.levelEndAction == LevelCompletionResults.LevelEndAction.None) { EndOfLevelUICreator.Show(__instance); } }
static bool Prefix(MissionLevelScenesTransitionSetupDataSO missionLevelScenesTransitionSetupData, MissionCompletionResults missionCompletionResults, CampaignFlowCoordinator __instance, MissionSelectionNavigationController ____missionSelectionNavigationController) { if (!(____missionSelectionNavigationController.selectedMissionNode.missionData is CustomMissionDataSO)) { return(true); } ChallengeExternalModifiers.onChallengeEnd?.Invoke(); if (missionCompletionResults.levelCompletionResults.levelEndAction == LevelCompletionResults.LevelEndAction.Restart) { ____missionSelectionNavigationController.GetPrivateField <Action <MissionSelectionNavigationController> >("didPressPlayButtonEvent")(____missionSelectionNavigationController); return(false); } if (missionCompletionResults.levelCompletionResults.levelEndStateType == LevelCompletionResults.LevelEndStateType.Cleared && missionCompletionResults.IsMissionComplete) { CustomMissionDataSO customMissionData = ____missionSelectionNavigationController.selectedMissionNode.missionData as CustomMissionDataSO; Campaign campaign = customMissionData.campaign; Challenge challenge = customMissionData.challenge; foreach (UnlockableItem item in challenge.unlockableItems) { try { item.UnlockItem(campaign.path); } catch (Exception ex) { Console.WriteLine("Failed to unlock item: " + item.fileName + " - Exception: " + ex.Message); } } UnlockedItemsViewController unlockedItemsViewController = Resources.FindObjectsOfTypeAll <UnlockedItemsViewController>().First(); unlockedItemsViewController.items = challenge.unlockableItems; unlockedItemsViewController.index = 0; if (unlockedItemsViewController.items.Count > 0) { __instance.InvokeMethod("SetBottomScreenViewController", new object[] { unlockedItemsViewController, false }); } if (challenge.unlockMap) { UnlockedMaps.CompletedChallenge(challenge.name); } //Score submission if (customMissionData.gameplayModifiers.songSpeedMul == 1f && customMissionData.gameplayModifiers.fastNotes == false && customMissionData.gameplayModifiers.failOnSaberClash == false) { SoloFreePlayFlowCoordinator freePlayCoordinator = Resources.FindObjectsOfTypeAll <SoloFreePlayFlowCoordinator>().First(); PlayerDataModelSO dataModel = freePlayCoordinator.GetPrivateField <PlayerDataModelSO>("_playerDataModel"); PlayerData currentLocalPlayer = dataModel.playerData; IDifficultyBeatmap difficultyBeatmap = Loader.BeatmapLevelsModelSO.GetBeatmapLevelIfLoaded(customMissionData.customLevel.levelID).beatmapLevelData.GetDifficultyBeatmap(customMissionData.beatmapCharacteristic, customMissionData.beatmapDifficulty); PlayerLevelStatsData playerLevelStatsData = currentLocalPlayer.GetPlayerLevelStatsData(difficultyBeatmap.level.levelID, difficultyBeatmap.difficulty, difficultyBeatmap.parentDifficultyBeatmapSet.beatmapCharacteristic); LevelCompletionResults levelCompletionResults = missionCompletionResults.levelCompletionResults; playerLevelStatsData.UpdateScoreData(levelCompletionResults.modifiedScore, levelCompletionResults.maxCombo, levelCompletionResults.fullCombo, levelCompletionResults.rank); //todo Need change??? //freePlayCoordinator.GetPrivateField<PlatformLeaderboardsModel>("_platformLeaderboardsModel").AddScoreFromComletionResults(difficultyBeatmap, levelCompletionResults); } __instance.StartCoroutine(CustomCampaignLeaderboard.SubmitScore(challenge, missionCompletionResults)); } return(true); }
static void Postfix(ref LevelCompletionResults __result, LevelCompletionResults.LevelEndStateType levelEndStateType) { if ((ScoreSubmission.WasDisabled || ScoreSubmission.disabled || ScoreSubmission.prolongedDisable) && levelEndStateType == LevelCompletionResults.LevelEndStateType.Cleared) { Plugin.scenesTransitionSetupData.Get <GameplayCoreSceneSetupData>().SetField("practiceSettings", new PracticeSettings()); Plugin.scenesTransitionSetupData = null; __result.SetField("rawScore", -__result.rawScore); } }
private void SaveRecord(IDifficultyBeatmap beatmap, LevelCompletionResults result, bool isMultiplayer) { if (result?.rawScore > 0) { // Actually there's no way to know if any custom modifier was applied if the user failed a map. var submissionDisabled = ScoreSubmission.WasDisabled || ScoreSubmission.Disabled || ScoreSubmission.ProlongedDisabled; SPHModel.SaveRecord(beatmap, result, submissionDisabled, isMultiplayer); } }
private void OnLevelClear(StandardLevelScenesTransitionSetupDataSO unused, LevelCompletionResults unusedResult) // level cleared delegate { //Plugin.Log.Debug("Level Ended"); isLevel = false; activePause = false; isPaused = false; DestroyBBCollider(); ResetSaberPos(); ResetFireOnce(); }
public void OnMultiplayerLevelFinished(LevelCompletionResults results) { if (results.levelEndStateType == LevelCompletionResults.LevelEndStateType.Cleared) { OnLevelFinished(); } else if (results.levelEndStateType == LevelCompletionResults.LevelEndStateType.Failed) { OnLevelFailed(); } }
public void Show(CustomPreviewBeatmapLevel customPreviewBeatmapLevel, BeatmapDifficulty difficulty, IDifficultyBeatmap levelDifficulty, LevelCompletionResults results, bool newHighScore) { this.beatmap = customPreviewBeatmapLevel; this.difficulty = difficulty; this.levelDifficulty = levelDifficulty; this.levelCompletionResults = results; this.newHighScore = newHighScore; mainFlowCoordinator = Resources.FindObjectsOfTypeAll <MainFlowCoordinator>().First(); BeatSaberUI.PresentFlowCoordinator(mainFlowCoordinator, this); }
/*private IEnumerator TMP() * { * GameObject screen = GameObject.Find("LeftScreen/GameplaySetupViewController/BSMLBackground"); * * while(screen == null) * { * yield return new WaitForSeconds(1); * screen = GameObject.Find("LeftScreen/GameplaySetupViewController/BSMLBackground"); * } * * GameObject go = new GameObject("BSDHistoryButton", typeof(Button)); * go.transform.SetParent(screen.transform, false); * RectTransform rt = go.AddComponent<RectTransform>(); * * rt.anchorMin = new Vector2(0.15f, -0.08f); * rt.anchorMax = new Vector2(0.35f, -0.02f); * rt.offsetMin = Vector2.zero; * rt.offsetMax = Vector2.zero; * * ImageView image = go.AddComponent<ImageView>(); * //image.sprite = BeatSaberMarkupLanguage.Utilities.ImageResources.WhitePixel; * image.sprite = Resources.FindObjectsOfTypeAll<Sprite>().Where(x => x.name == "RoundRect10").First(); * image.material = BeatSaberMarkupLanguage.Utilities.ImageResources.NoGlowMat; * image.type = Image.Type.Sliced; * image.preserveAspect = true; * image.color = new Color32(63, 21, 69, 255); // new Color32(140, 42, 145, 255); * }*/ private void DiscardSongData(StandardLevelScenesTransitionSetupDataSO data, LevelCompletionResults results) { // Prevent a nullref exception, but it shouldn't happen in the first place (might mean some trackers do not get destroyed), so some investigation required if (songData == null) { return; } songData.GetDataCollector().UnregisterCollector(songData); songData = null; }
private void OnLevelQuit(StandardLevelScenesTransitionSetupDataSO unused, LevelCompletionResults unusedResult) // level quit delegate { //Plugin.Log.Debug("Level Quit"); isLevel = false; activePause = false; subToResumeFireOnce = true; isPaused = false; DestroyBBCollider(); ResetSaberPos(); ResetFireOnce(); }
public void OnScoreDidChange(int score) { statusManager.gameStatus.score = score; statusManager.gameStatus.currentMaxScore = ScoreController.MaxScoreForNumberOfNotes(statusManager.gameStatus.passedNotes); // public static string LevelCompletionResults.GetRankName(LevelCompletionResults.Rank) LevelCompletionResults.Rank rank = (LevelCompletionResults.Rank)getRankForScoreMethod.Invoke(null, new object[] { score, statusManager.gameStatus.currentMaxScore }); statusManager.gameStatus.rank = LevelCompletionResults.GetRankName(rank); statusManager.EmitStatusUpdate(ChangedProperties.Performance, "scoreChanged"); }
public LevelCompletionResultsWrapper(LevelCompletionResults results, int playCount, int maxModifiedScore) { _results = results; GameplayModifiers = new GameplayModifiersWrapper(results.gameplayModifiers); PlayCount = playCount; MaxModifiedScore = maxModifiedScore; if (MaxModifiedScore != 0) { ScorePercent = ((float)results.rawScore / MaxModifiedScore) * 100f; } }
public void GetMaxScores(LevelCompletionResults results, SongData data) { IDifficultyBeatmap beatmap = data.GetGCSSD().difficultyBeatmap; PlayerLevelStatsData stats = data.GetPlayerData().playerData.GetPlayerLevelStatsData(beatmap.level.levelID, beatmap.difficulty, beatmap.parentDifficultyBeatmapSet.beatmapCharacteristic); maxRawScore = ScoreModel.MaxRawScoreForNumberOfNotes(beatmap.beatmapData.cuttableNotesType); modifiersMultiplier = GetTotalMultiplier(data.GetPlayerData().playerData.gameplayModifiers, results.energy); maxScore = Mathf.RoundToInt(maxRawScore * modifiersMultiplier); personalBestModifiedRatio = stats.highScore / (float)maxScore; personalBestRawRatio = stats.highScore / (float)maxRawScore; personalBest = stats.highScore; }