koishi-plugin-noah 1.7.1 → 1.7.5
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.
- package/lib/core/utils/server.d.ts +8 -0
- package/lib/games/sdvx/commands/info.d.ts +3 -0
- package/lib/games/sdvx/utils/vf.d.ts +23 -3
- package/lib/index.cjs +1579 -507
- package/lib/index.d.ts +1 -1
- package/lib/slash/config.d.ts +2 -0
- package/lib/slash/database.d.ts +41 -0
- package/lib/slash/discord/adapter.d.ts +20 -0
- package/lib/slash/discord/index.d.ts +21 -0
- package/lib/slash/index.d.ts +7 -0
- package/lib/slash/registry.d.ts +7 -0
- package/lib/slash/service.d.ts +62 -0
- package/lib/slash/types.d.ts +47 -0
- package/lib/types/config.d.ts +16 -0
- package/package.json +2 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Context } from 'koishi';
|
|
2
|
+
import { ServerService } from '../services/server-service';
|
|
3
|
+
import { UserService } from '../services/user-service';
|
|
4
|
+
/**
|
|
5
|
+
* Ensure the user has an Official (KONAMI) server and return its id.
|
|
6
|
+
* Creates one with the configured support URL when missing.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ensureOfficialServerForUser(ctx: Context, serverService: ServerService, userService: UserService, uid: number, officialSupportUrl?: string): Promise<number>;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { SDVXGrade, SDVXClearType, SDVXScore } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* 使用 100 作为倍率基准,避免浮点误差。
|
|
4
|
+
*/
|
|
5
|
+
export declare const FACTOR_SCALE = 100;
|
|
6
|
+
/**
|
|
7
|
+
* VF 公式中的常量(分数与系数乘积乘以缩放后再取整)。
|
|
8
|
+
*/
|
|
9
|
+
export declare const VOLFORCE_BASE_DENOMINATOR: bigint;
|
|
2
10
|
/**
|
|
3
11
|
* 计算 Volforce 值
|
|
4
|
-
* @param raw_score - API
|
|
5
|
-
* @returns
|
|
12
|
+
* @param raw_score - API 返回的单曲成绩
|
|
13
|
+
* @returns 保留 0.05 步进的 Volforce
|
|
6
14
|
*/
|
|
7
15
|
export declare function calculateVolforce(raw_score: SDVXScore): number;
|
|
8
16
|
/**
|
|
@@ -11,9 +19,21 @@ export declare function calculateVolforce(raw_score: SDVXScore): number;
|
|
|
11
19
|
* @returns 等级系数
|
|
12
20
|
*/
|
|
13
21
|
export declare function getGradeFactor(grade: SDVXGrade): number;
|
|
22
|
+
/**
|
|
23
|
+
* 获取指定等级系数的整数缩放值
|
|
24
|
+
*/
|
|
25
|
+
export declare function getGradeFactorScale(grade: SDVXGrade): number;
|
|
14
26
|
/**
|
|
15
27
|
* 获取指定通关类型的系数
|
|
16
28
|
* @param clearType - 要获取系数的通关类型
|
|
17
|
-
* @returns
|
|
29
|
+
* @returns 通关系数
|
|
18
30
|
*/
|
|
19
31
|
export declare function getClearFactor(clearType: SDVXClearType): number;
|
|
32
|
+
/**
|
|
33
|
+
* 获取指定通关类型系数的整数缩放值
|
|
34
|
+
*/
|
|
35
|
+
export declare function getClearFactorScale(clearType: SDVXClearType): number;
|
|
36
|
+
/**
|
|
37
|
+
* 基于整数系数返回精确的 VF 整数值,方便复用。
|
|
38
|
+
*/
|
|
39
|
+
export declare function calculateVolforceIntValue(level: number, score: number, grade: SDVXGrade, clearType: SDVXClearType): number;
|