private void Awake() { instance = this; }
void Start() { instance = this; myyScore = GetComponent <ScoreBase> (); myyScore.DisplayScore(myScore); }
void Start() { scoreBase = FindObjectOfType <ScoreBase>(); soundBase = FindObjectOfType <SoundBase>(); }
public static double GetBeatmapPP(BeatmapBase map, ScoreBase score) { var pp = CalcPP(map, score.LegacyMods ?? LegacyMods.NM, score.Accuracy, (int)score.Combo, (int)score.Misses, map.Ranked); return(pp?.Total ?? -1); }
private static string FormatScore(ScoreBase score, bool useAgo) { string mods = string.Empty; if (score.LegacyMods != LegacyMods.NM) { mods = $" +{score.LegacyMods?.ReadableMods()}"; } string date = score.Date?.ToShortDateString(); if (useAgo && score.Date != null) { TimeSpan ago = DateTime.Now.ToUniversalTime() - score.Date.Value; date = $"{ago:hh\\:mm\\:ss} ago"; } Beatmap beatmap = (Beatmap)score.Beatmap; // html-filtered map title string mapInfo = $"{beatmap.BeatmapSet.Artist} - {beatmap.BeatmapSet.Title} [{score.Beatmap.Version}]".FilterToHTML(); string pp = $"| {score.Pp:N2}pp"; if (beatmap.Mode == Mode.Osu) { try { // Add pp values double scorePp = score.Pp ?? Oppai.GetBeatmapPP(score.Beatmap, score); string possiblePp = string.Empty; if (score.ComboBasedMissCount(beatmap.MaxCombo.Value, beatmap.Sliders.Value) > 0) { // Add possible pp value if they missed var fcScore = new Score { Statistics = new Score.ScoreStatistics { Count300 = (score.Beatmap.ObjectsTotal - score.Count100 - score.Count50) ?? 0, Count100 = score.Count100, Count50 = score.Count50, }, Combo = beatmap.MaxCombo ?? 0, LegacyMods = score.LegacyMods }; double possiblePPval = Oppai.GetBeatmapPP(score.Beatmap, fcScore); possiblePp = $"(~{possiblePPval:N2}pp if FC)"; } pp = $"| {(score.Pp == null ? "~" : "")}{scorePp:N2}pp {possiblePp}"; } catch (Exception e) { Log.Error($"Oppai failed: {e.InnerMessageIfAny()}"); } } var position = string.Empty; if (score.LeaderboardPosition != null) { position = $"#{score.LeaderboardPosition}{(!string.IsNullOrEmpty(mods) ? $" ({score.LegacyMods?.ReadableMods()})" : "") } | "; } var completion = string.Empty; if (useAgo) { completion = $" | {(double)(score.Count300 + score.Count100 + score.Count50 + score.Misses) / score.Beatmap.ObjectsTotal * 100.0:N1}% completion"; } return ($"<b>({score.Grade.GetDescription()})</b> <a href=\"{score.Beatmap.Link}\">{mapInfo}</a><b>{mods} ({score.Accuracy:N2}%)</b>{Environment.NewLine}" + $"{score.Combo}/{beatmap.MaxCombo}x ({score.Count300} / {score.Count100} / {score.Count50} / {score.Misses}) {pp}{Environment.NewLine}" + $"{position}{date}{completion}{Environment.NewLine}{Environment.NewLine}"); }
void Awake() { scoreBest = GetComponent <ScoreBase>(); }
void Start() { scoreBest = GetComponent <ScoreBase>(); scoreBest.DisplayScore(ScoreGame.instance.myScore); }