Beispiel #1
0
        public void OnNoteWasFullyCut(CutScoreBuffer acsb)
        {
            int beforeCutScore;
            int afterCutScore;
            int cutDistanceScore;

            NoteCutInfo noteCutInfo = (NoteCutInfo)noteCutInfoField.GetValue(acsb);
            NoteData    noteData    = noteCutMapping[noteCutInfo];

            noteCutMapping.Remove(noteCutInfo);

            SetNoteCutStatus(noteData, noteCutInfo, false);

            // public static ScoreModel.RawScoreWithoutMultiplier(NoteCutInfo, out int beforeCutRawScore, out int afterCutRawScore, out int cutDistanceRawScore)
            ScoreModel.RawScoreWithoutMultiplier(noteCutInfo, out beforeCutScore, out afterCutScore, out cutDistanceScore);

            int multiplier = (int)cutScoreBufferMultiplierField.GetValue(acsb);

            statusManager.gameStatus.initialScore     = beforeCutScore + cutDistanceScore;
            statusManager.gameStatus.finalScore       = beforeCutScore + afterCutScore + cutDistanceScore;
            statusManager.gameStatus.cutDistanceScore = cutDistanceScore;
            statusManager.gameStatus.cutMultiplier    = multiplier;

            statusManager.EmitStatusUpdate(ChangedProperties.PerformanceAndNoteCut, "noteFullyCut");

            acsb.didFinishEvent -= OnNoteWasFullyCut;
        }
Beispiel #2
0
        public override void HandleCutScoreBufferDidFinish(CutScoreBuffer cutScoreBuffer)
        {
            if (_configuration != null)
            {
                Judge(cutScoreBuffer);
            }

            base.HandleCutScoreBufferDidFinish(cutScoreBuffer);
        }
Beispiel #3
0
        private void RecordHitValueSecondary(CutScoreBuffer score, NoteData data, ScoreFinishEventHandler fn)
        {
            float newEnergy;

            switch (PluginConfig.Instance.secondaryMode)
            {
            case PluginConfig.MeasurementMode.None:
                return;

            case PluginConfig.MeasurementMode.Energy:
                newEnergy = energyCounter.energy;
                break;

            case PluginConfig.MeasurementMode.PercentModified:
                newEnergy = (float)scoreController.modifiedScore / scoreController.immediateMaxPossibleModifiedScore;
                break;

            case PluginConfig.MeasurementMode.PercentRaw:
                newEnergy = rankCounter.relativeScore;
                break;

            case PluginConfig.MeasurementMode.CutValue:
                if (score == null)
                {
                    return;
                }

                newEnergy = score.cutScore / 115.0f;
                break;

            case PluginConfig.MeasurementMode.AvgCutValue:
                if (score == null)
                {
                    return;
                }

                secondaryAverageHitValue = ((secondaryAverageHitValue * secondaryAverageHitValueSize) + score.cutScore / 115.0f) / ++secondaryAverageHitValueSize;
                newEnergy = secondaryAverageHitValue;
                break;

            default:
                Logger.log.Error("An invalid mode was specified! PerformanceMeter will not record scores, resulting in a blank graph. Check the readme for the valid modes.");
                return;
            }

            if (secondaryEnergyList.Count == 0)
            {
                secondaryEnergyList.Add(new Pair <float, float>(0, newEnergy));
            }
            secondaryEnergyList.Add(new Pair <float, float>(data.time, newEnergy));

            if (score != null)
            {
                score.UnregisterDidFinishReceiver(fn);
            }
        }
Beispiel #4
0
        private void Judge(CutScoreBuffer cutScoreBuffer, int?assumedAfterCutScore = null)
        {
            var before         = cutScoreBuffer.beforeCutScore;
            var after          = assumedAfterCutScore ?? cutScoreBuffer.afterCutScore;
            var accuracy       = cutScoreBuffer.centerDistanceCutScore;
            var total          = before + after + accuracy;
            var timeDependence = Mathf.Abs(_noteCutInfo !.Value.cutNormal.z);

            _judgmentService.Judge(cutScoreBuffer.noteScoreDefinition, ref _text, ref _color, total, before, after, accuracy, timeDependence);
        }
Beispiel #5
0
 public void HandleCutScoreBufferDidFinish(CutScoreBuffer cutScoreBuffer)
 {
     if (!secondary)
     {
         controller.RecordHitValue(cutScoreBuffer, data, this);
     }
     else
     {
         controller.RecordHitValueSecondary(cutScoreBuffer, data, this);
     }
 }
Beispiel #6
0
        private void OnNoteWasFullyCut(CutScoreBuffer csb)
        {
            var noteCutInfo = csb.GetPrivateField <NoteCutInfo>("_noteCutInfo");

            if (csb != null)
            {
                csb.didFinishEvent -= OnNoteWasFullyCut;
            }

            ScoreController.RawScoreWithoutMultiplier(noteCutInfo, out var score, out var afterScore, out var cutDistanceScore);
            OnNoteFullyCut(score + afterScore + cutDistanceScore);
        }
Beispiel #7
0
        public override void HandleCutScoreBufferDidChange(CutScoreBuffer cutScoreBuffer)
        {
            if (_configuration == null)
            {
                base.HandleCutScoreBufferDidChange(cutScoreBuffer);
                return;
            }

            if (_configuration.DoIntermediateUpdates)
            {
                Judge(cutScoreBuffer);
            }
        }
        //゚+。*゚+。。+゚*。+゚ ゚+。*゚+。。+゚*。+゚ ゚+。*゚+。*゚+。。+゚*。+゚ ゚+。*゚+。。+゚*。+゚ ゚+。*゚+。*゚+。。+゚*。+゚ ゚+。*゚+。。+゚*。+゚ ゚+。*
        #region // パブリックメソッド
        public void HandleCutScoreBufferDidFinish(CutScoreBuffer cutScoreBuffer)
        {
            cutScoreBuffer.didFinishEvent.Remove(this);
            if (cutScoreBuffer is CustomCutBuffer customCutBuffer)
            {
                var noteCutInfo = customCutBuffer.NoteCutInfo;
                this.SetNoteCutStatus(customCutBuffer.NoteController, noteCutInfo, false);
                // public static ScoreModel.RawScoreWithoutMultiplier(NoteCutInfo, out int beforeCutRawScore, out int afterCutRawScore, out int cutDistanceRawScore)
                ScoreModel.RawScoreWithoutMultiplier(noteCutInfo.swingRatingCounter, noteCutInfo.cutDistanceToCenter, out var beforeCutScore, out var afterCutScore, out var cutDistanceScore);

                var multiplier = customCutBuffer.multiplier;

                this.gameStatus.initialScore     = beforeCutScore + cutDistanceScore;
                this.gameStatus.finalScore       = beforeCutScore + afterCutScore + cutDistanceScore;
                this.gameStatus.cutDistanceScore = cutDistanceScore;
                this.gameStatus.cutMultiplier    = multiplier;

                this.statusManager.EmitStatusUpdate(ChangedProperty.PerformanceAndNoteCut, BeatSaberEvent.NoteFullyCut);
                this.cutBufferPool.Despawn(customCutBuffer);
            }
        }