Beispiel #1
0
        public object KouArcInfo(string name = null)
        {
            return(null);

            KouArcaeaInfo arcaeaInfo = new KouArcaeaInfo();

            return(arcaeaInfo.Default(name));
        }
Beispiel #2
0
        public string KouCalConstant([KouPluginArgument(Name = "定数/歌曲名[+难度类型]")] string nameOrConstant,
                                     [KouPluginArgument(Name = "分数")] int score,
                                     [KouPluginArgument(Name = "歌曲ptt反推定数")] double?ptt = null)
        {
            if (score < 0 || score > 11000000)
            {
                return("这个分数怎么有点奇怪呢");
            }
            if (ptt != null)
            {
                return($"{score}分的谱面ptt={ptt}时,谱面定数约为{ArcaeaData.CalSongChartConstant(ptt.Value, score):F3}");
            }
            if (KouStringTool.TryToDouble(nameOrConstant, out double constant))
            {
                return($"定数{constant}时,{score}分的ptt为{ArcaeaData.CalSongScorePtt(constant, score):F3}");
            }
            KouArcaeaInfo kouArcaeaInfo = new KouArcaeaInfo
            {
                SongName = nameOrConstant
            };
            var    songs  = kouArcaeaInfo.GetSatisfiedSong(ratingClass: PluginArcaeaSong.RatingClass.Future);
            string result = "";

            if (songs.Count == 0)
            {
                return($"找不到是哪个歌");
            }
            else if (songs.Count > 4)
            {
                result = $"具体是指下面哪个歌呢?\n{songs.ToSetString()}";
            }
            else
            {
                foreach (var song in songs)
                {
                    if (song.ChartConstant == null)
                    {
                        continue;
                    }
                    double con = song.ChartConstant.Value;
                    result += $"{song.ToString(FormatType.Brief)} {score}分的ptt为{ArcaeaData.CalSongScorePtt(con, score):F3}\n";
                }
            }
            return(result.Trim());
        }