koishi-plugin-noah 2.0.6 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ import { Context } from 'koishi';
2
+ import { CoreConfig } from '../../types/config';
3
+ export declare function link(ctx: Context, _config: CoreConfig): void;
@@ -7,7 +7,15 @@ import { BaseDrawer } from '../BaseDrawer';
7
7
  */
8
8
  export declare class SDVXDrawer extends BaseDrawer {
9
9
  ctx: Context;
10
+ private fontsLoaded;
11
+ private recentAssets;
12
+ private vfAssets;
10
13
  constructor(ctx: Context);
14
+ private ensureFontsLoaded;
15
+ private ensureRecentAssets;
16
+ private ensureVFAssets;
17
+ private loadImageMap;
18
+ private fitText;
11
19
  /**
12
20
  * Format difficulty level text.
13
21
  * If it's an integer like 17 / 20, keep trailing ".0" (e.g. "17.0").
@@ -0,0 +1,3 @@
1
+ import { Context, Logger } from 'koishi';
2
+ import { SDVXConfig } from '../../../types/config';
3
+ export declare function radar(ctx: Context, config: SDVXConfig, logger: Logger): void;
@@ -0,0 +1,15 @@
1
+ import { SDVXClearType, SDVXGrade } from './types';
2
+ /** 所有分数等级(从高到低) */
3
+ export declare const ALL_GRADES: SDVXGrade[];
4
+ /** 所有通关类型(从高到低) */
5
+ export declare const ALL_CLEAR_TYPES: SDVXClearType[];
6
+ /** 分数等级映射表 */
7
+ export declare const SCORE_GRADE_MAP: {
8
+ min: number;
9
+ max: number;
10
+ grade: SDVXGrade;
11
+ }[];
12
+ /** 通关类型缩写映射(小写缩写 → 标准名称) */
13
+ export declare const CLEAR_TYPE_ABBR_MAP: Record<string, SDVXClearType>;
14
+ /** 根据分数获取等级 */
15
+ export declare function getGradeByScore(score: number): SDVXGrade;
@@ -1,4 +1,4 @@
1
- import { SDVXScore, SDVXGrade, SDVXClearType, SDVXMusicDifficulty } from '../types';
1
+ import { SDVXClearType, SDVXGrade, SDVXMusicDifficulty, SDVXScore } from '../types';
2
2
  export declare class ScoreService {
3
3
  private static instance;
4
4
  private constructor();
@@ -31,4 +31,20 @@ export declare class ScoreService {
31
31
  musicDiff?: number | number[];
32
32
  radarFeature?: keyof SDVXMusicDifficulty['radar'] | (keyof SDVXMusicDifficulty['radar'])[];
33
33
  }): SDVXScore[];
34
+ /**
35
+ * 计算单曲在某个雷达分类下的贡献值 F
36
+ */
37
+ private calcSongRadarContribution;
38
+ /**
39
+ * 计算玩家六维雷达(显示值,如 200.00)
40
+ * 算法:每个分类取每首歌最高贡献的难度,取 top50 求和,再除以 400000
41
+ */
42
+ getPlayerRadarByAllScore(scores: SDVXScore[]): {
43
+ notes: number;
44
+ peak: number;
45
+ tsumami: number;
46
+ tricky: number;
47
+ hand_trip: number;
48
+ one_hand: number;
49
+ };
34
50
  }
@@ -1,20 +1,13 @@
1
+ import { getGradeByScore } from '../constants';
2
+ export { getGradeByScore };
1
3
  import { SDVXGrade, SDVXClearType } from '../types';
4
+ import { QueryParams } from './param-parser';
2
5
  /**
3
6
  * VF 查找表类型
4
7
  * Key: `${levelScaled}-${grade}-${clearType}-${vfInt}`
5
8
  * Value: QueryResult(每个组合只保留最小分数)
6
9
  */
7
10
  type VFLookupTable = Map<string, QueryResult>;
8
- /**
9
- * 查询参数接口
10
- */
11
- export interface QueryParams {
12
- level?: number | number[];
13
- score?: number | number[];
14
- grade?: SDVXGrade | SDVXGrade[];
15
- clearType?: SDVXClearType | SDVXClearType[];
16
- vf?: number | number[];
17
- }
18
11
  /**
19
12
  * 查询结果接口
20
13
  */
@@ -25,10 +18,6 @@ export interface QueryResult {
25
18
  clearType: SDVXClearType;
26
19
  vf: number;
27
20
  }
28
- /**
29
- * 根据分数获取等级
30
- */
31
- export declare function getGradeByScore(score: number): SDVXGrade;
32
21
  /**
33
22
  * 根据分数获取可能的通关类型
34
23
  */
@@ -77,4 +66,3 @@ export declare function getVfRange(vf?: number | number[]): number[];
77
66
  * 生成查询结果(使用查找表)
78
67
  */
79
68
  export declare function generateQueryResults(params: QueryParams): QueryResult[];
80
- export {};
@@ -0,0 +1,16 @@
1
+ import { Schema } from 'koishi';
2
+ import { GlobalConfig } from '../types/config';
3
+ export declare const globalConfig: Schema<Schemastery.ObjectS<{
4
+ official_support_url: Schema<string, string>;
5
+ maoServerUrl: Schema<string, string>;
6
+ maoApiKey: Schema<string, string>;
7
+ }>, Schemastery.ObjectT<{
8
+ official_support_url: Schema<string, string>;
9
+ maoServerUrl: Schema<string, string>;
10
+ maoApiKey: Schema<string, string>;
11
+ }>>;
12
+ declare module 'koishi' {
13
+ interface Context {
14
+ globalConfig: GlobalConfig;
15
+ }
16
+ }