public static void AdjustNJS(float njs, BeatmapObjectSpawnController _spawnController) { float halfJumpDur = 4f; float maxHalfJump = _spawnController.GetPrivateField<float>("_maxHalfJumpDistance"); float noteJumpStartBeatOffset = BS_Utils.Plugin.LevelData.GameplayCoreSceneSetupData.difficultyBeatmap.noteJumpStartBeatOffset; float moveSpeed = _spawnController.GetPrivateField<float>("_moveSpeed"); float moveDir = _spawnController.GetPrivateField<float>("_moveDurationInBeats"); float jumpDis; float spawnAheadTime; float moveDis; float bpm = _spawnController.GetPrivateField<float>("_beatsPerMinute"); float num = 60f / bpm; moveDis = moveSpeed * num * moveDir; while (njs * num * halfJumpDur > maxHalfJump) { halfJumpDur /= 2f; } halfJumpDur += noteJumpStartBeatOffset; if (halfJumpDur < 1f) halfJumpDur = 1f; // halfJumpDur = spawnController.GetPrivateField<float>("_halfJumpDurationInBeats"); jumpDis = njs * num * halfJumpDur * 2f; spawnAheadTime = moveDis / moveSpeed + jumpDis * 0.5f / njs; _spawnController.SetPrivateField("_halfJumpDurationInBeats", halfJumpDur); _spawnController.SetPrivateField("_spawnAheadTime", spawnAheadTime); _spawnController.SetPrivateField("_jumpDistance", jumpDis); _spawnController.SetPrivateField("_noteJumpMovementSpeed", njs); _spawnController.SetPrivateField("_moveDistance", moveDis); }