;
/**
+ * @deprecated 已失效,此接口已经不会再被使用到\
* 所有的状态显示信息,有的是有的是就挺离谱
*/
statusLabels: HTMLCollectionOf;
/**
+ * @deprecated 已失效,此接口已经不会再被使用到\
* 标签的状态显示文字
*/
statusText: HTMLCollectionOf;
/**
+ * @deprecated 已失效,此接口已经不会再被使用到\
* 自绘状态栏画布的context
*/
statusCanvasCtx: CanvasRenderingContext2D;
} & {
+ /**
+ * @deprecated 已失效,此接口已经不会再被使用到\
+ */
[key: string]: HTMLElement;
};
interface DomStyle {
/**
+ * @deprecated 可能已失效,此接口已经不会再被使用到\
* 当前缩放大小
*/
scale: number;
/**
+ * @deprecated 可能已失效,此接口已经不会再被使用到\
* 就是window.devicePixelRatio
*/
ratio: number;
/**
+ * @deprecated 已失效,此接口已经不会再被使用到\
* 高清画布列表
*/
hdCanvas: string[];
/**
+ * @deprecated 可能已失效,此接口已经不会再被使用到\
* 可以缩放到的缩放比例,是 [1, 1.25, 1.5, 1.75, 2, 2.25, 2.5] 的子数组
*/
availableScale: number[];
/**
+ * @deprecated 可能已失效,此接口已经不会再被使用到\
* 是否是竖屏
*/
isVertical: boolean;
@@ -571,6 +447,7 @@ interface DomStyle {
showStatusBar: boolean;
/**
+ * @deprecated 可能已失效,此接口已经不会再被使用到\
* 当前道具栏是否是数字键
*/
toolbarBtn: boolean;
@@ -578,26 +455,31 @@ interface DomStyle {
interface CoreBigmap {
/**
+ * @deprecated 已失效,此接口已经不会再被使用到\
* 大地图中会跟随勇士移动的画布
*/
canvas: string[];
/**
+ * @deprecated 可能已失效,此接口已经不会再被使用到\
* 大地图的横向偏移量,单位像素
*/
offsetX: number;
/**
+ * @deprecated 可能已失效,此接口已经不会再被使用到\
* 大地图的纵向偏移量,单位像素
*/
offsetY: number;
/**
+ * @deprecated 可能已失效,此接口已经不会再被使用到\
* v2优化下的横向偏移格子数
*/
posX: number;
/**
+ * @deprecated 可能已失效,此接口已经不会再被使用到\
* v2优化下的纵向偏移格子数
*/
posY: number;
@@ -613,32 +495,37 @@ interface CoreBigmap {
height: number;
/**
+ * @deprecated 可能已失效,此接口已经不会再被使用到\
* 是否使用v2优化
*/
v2: boolean;
/**
+ * @deprecated 可能已失效,此接口已经不会再被使用到\
* 判定为超大的图的地图面积临界,使用了显示宝石血瓶详细信息插件的话是256
*/
threshold: 1024;
/**
+ * @deprecated 可能已失效,此接口已经不会再被使用到\
* v2优化下,显示超出的格子数,例如样板是10,那么13\*13的样板就是33\*33,还用于判断是否进行更新等
*/
extend: 10;
/**
- * @deprecated
+ * @deprecated 已失效,此接口已经不会再被使用到\
* 又出现了!样板中没有的东西
*/
scale: 1;
/**
+ * @deprecated 已失效,此接口已经不会再被使用到\
* 绘制缩略图时的临时画布
*/
tempCanvas: CanvasRenderingContext2D;
/**
+ * @deprecated 已失效,此接口已经不会再被使用到\
* 绘制地图时的双缓冲层
*/
cacheCanvas: CanvasRenderingContext2D;
@@ -646,6 +533,7 @@ interface CoreBigmap {
interface CoreSave {
/**
+ * @deprecated 已失效,此接口已经不会再被使用到\
* 当前存档页面显示的页码数
*/
saveIndex: number;
@@ -661,11 +549,13 @@ interface CoreSave {
autosave: Autosave;
/**
+ * @deprecated 可能已失效,暂时没有替代接口\
* 收藏的存档
*/
favorite: number[];
/**
+ * @deprecated 可能已失效,暂时没有替代接口\
* 保存的存档名称
*/
favoriteName: Record;
@@ -693,13 +583,13 @@ interface Autosave {
storage: true;
/**
- * @deprecated
+ * @deprecated 可使用,此接口应该不会被使用到\
* 每5秒钟会被设置一次的raf时间戳,不知道干什么的。。。
*/
time: number;
/**
- * @deprecated
+ * @deprecated 可使用,此接口应该不会被使用到\
* 样板在不停设置这个东西,但不知道什么用处,因为没有调用它的地方
*/
updated: boolean;
@@ -793,6 +683,7 @@ interface CoreValues {
moveSpeed: number;
/**
+ * @deprecated 已失效,此接口已经不会被使用到\
* 竖屏下状态栏显示行数
*/
statusCanvasRowsOnMobile: 1 | 2 | 3 | 4 | 5;
@@ -805,15 +696,20 @@ interface CoreValues {
type CoreStatusBarElements = {
/**
+ * @deprecated 已失效,此接口已经不会被使用到\
* 状态栏图标信息
*/
readonly icons: Record;
/**
+ * @deprecated 已失效,此接口已经不会被使用到\
* 状态栏的图标元素
*/
readonly image: Record;
} & {
+ /**
+ * @deprecated 已失效,此接口已经不会被使用到\
+ */
readonly [key: string]: HTMLElement;
};
@@ -917,19 +813,19 @@ interface Core extends Pick {
readonly _HALF_HEIGHT_: number;
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 `core._WIDTH_` 和 `core._HEIGHT_` 接口\
* 地图可视部分大小
*/
readonly __SIZE__: number;
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 `core._PX_` 和 `core._PY_` 接口\
* 地图像素
*/
readonly __PIXELS__: number;
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 `core._HALF_WIDTH_` 和 `core._HALF_HEIGHT_` 接口\
* 地图像素的一半
*/
readonly __HALF_SIZE__: number;
@@ -940,25 +836,25 @@ interface Core extends Pick {
readonly material: Material;
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 计时器(样板的神秘操作
*/
readonly timeout: Timeout;
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 定时器
*/
readonly interval: Interval;
/**
- * @deprecated
+ * @deprecated 可使用,此接口已经不会被使用到\
* 全局动画信息
*/
readonly animateFrame: AnimateFrame;
/**
- * @deprecated
+ * @deprecated 可能已失效,考虑换用 `BgmController` 和 `SoundController` 接口\
* 音乐状态
*/
readonly musicStatus: Readonly;
@@ -969,13 +865,13 @@ interface Core extends Pick {
readonly platform: Readonly;
/**
- * @deprecated
+ * @deprecated 部分失效,此接口已经不会再被使用到\
* dom样式
*/
readonly domStyle: Readonly;
/**
- * @deprecated
+ * @deprecated 部分失效,此接口已经不会再被使用到\
* 大地图信息
*/
readonly bigmap: CoreBigmap;
@@ -996,7 +892,7 @@ interface Core extends Pick {
readonly initStatus: DeepReadonly;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 所有的自定义画布
*/
readonly dymCanvas: Record;
@@ -1176,7 +1072,7 @@ interface Main extends MainData {
readonly savePages: number;
/**
- * @deprecated
+ * @deprecated 已失效,此接口已经不会被使用到\
* 循环临界的分界
*/
readonly criticalUseLoop: number;
@@ -1187,16 +1083,19 @@ interface Main extends MainData {
readonly mode: 'play' | 'editor';
/**
+ * @deprecated 已失效,此接口已经不会被使用到\
* 是否使用远程bgm
*/
readonly bgmRemote: boolean;
/**
+ * @deprecated 已失效,此接口已经不会被使用到\
* 远程bgm目录
*/
readonly bgmRemoteRoot: string;
/**
+ * @deprecated 已失效,此接口已经不会被使用到\
* 所有的系统画布
*/
readonly canvas: Record;
@@ -1307,13 +1206,13 @@ interface Main extends MainData {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,此接口已经不会被使用到\
* 设置加载界面的加载提示文字
*/
setMainTipsText(text: string): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新版 `logger` 或直接使用 `console` 接口\
* 输出内容(极不好用,建议换成console,我甚至不知道样板为什么会有这个东西)
* @param e 输出内容
* @param error 输出内容是否是报错
@@ -1321,20 +1220,20 @@ interface Main extends MainData {
log(e: string | Error, error?: boolean): void;
/**
- * @deprecated
+ * @deprecated 已失效,此接口已经不会被使用到\
* 生成选择光标的keyframes
*/
createOnChoiceAnimation(): void;
/**
- * @deprecated
+ * @deprecated 已失效,此接口已经不会被使用到\
* 选中开始界面的一个按钮
* @param index 要选中的按钮
*/
selectButton(index: number): void;
/**
- * @deprecated
+ * @deprecated 已失效,此接口已经不会被使用到\
* 加载一系列字体
* @param fonts 要加载的字体列表
*/
@@ -1347,7 +1246,7 @@ interface Main extends MainData {
listen(): void;
/**
- * @deprecated
+ * @deprecated 已失效,此接口已经不会被使用到\
* 执行ts的插件转发
*/
forward(): void;
@@ -1485,14 +1384,9 @@ declare const maps_90f36752_8815_4be8_b32b_d7fad1d0542e: {
[P in keyof NumberToId]: MapDataOf;
};
-/**
- * 插件信息
- */
-declare const plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1: PluginDeclaration;
-
interface Window {
core: CoreMixin;
- /** @deprecated */
+ /** @deprecated 可使用,将会在 2.C 中有新接口 */
flags: Flags;
hero: HeroStatus;
}
diff --git a/src/types/declaration/data.d.ts b/src/types/declaration/data.d.ts
index 2e0410c..00b0fdf 100644
--- a/src/types/declaration/data.d.ts
+++ b/src/types/declaration/data.d.ts
@@ -79,7 +79,7 @@ interface FirstData {
title: string;
/**
- * 游戏英文名,应当与mota.config.ts中的一致
+ * 游戏英文名
*/
name: string;
diff --git a/src/types/declaration/enemy.d.ts b/src/types/declaration/enemy.d.ts
index 0be0028..942b499 100644
--- a/src/types/declaration/enemy.d.ts
+++ b/src/types/declaration/enemy.d.ts
@@ -218,7 +218,7 @@ interface Enemys {
};
/**
- * @deprecated
+ * @deprecated 可使用,暂时没有替代接口\
* 获得所有怪物原始数据的一个副本
*/
getEnemys(): {
@@ -226,7 +226,7 @@ interface Enemys {
};
/**
- * @deprecated
+ * @deprecated 可能已失效,暂时没有替代接口\
* 判定主角当前能否打败某只敌人
* @example core.canBattle('greenSlime',0,0,'MT0') // 能否打败主塔0层左上角的绿头怪(假设有)
* @param enemy 敌人id或敌人对象
diff --git a/src/types/declaration/event.d.ts b/src/types/declaration/event.d.ts
index 5ad307d..7aab4b2 100644
--- a/src/types/declaration/event.d.ts
+++ b/src/types/declaration/event.d.ts
@@ -18,19 +18,19 @@ interface Events extends EventData {
eventdata: EventData;
/**
- * @deprecated
+ * @deprecated 可能可使用,暂无替代接口\
* 公共事件信息
*/
commonEvent: Record;
/**
- * @deprecated
+ * @deprecated 可能可使用,暂无替代接口\
* 所有的系统事件
*/
systemEvent: Record;
/**
- * @deprecated
+ * @deprecated 可能可使用,暂无替代接口\
* 注册的自定义事件
*/
actions: Record;
@@ -70,7 +70,7 @@ interface Events extends EventData {
confirmRestart(): void;
/**
- * @deprecated
+ * @deprecated 可能可使用,暂无替代接口\
* 注册一个系统事件
* @param type 事件名
* @param func 为事件的处理函数,可接受(data,callback)参数
@@ -78,14 +78,14 @@ interface Events extends EventData {
registerSystemEvent(type: string, func: SystemEventFunc): void;
/**
- * @deprecated
+ * @deprecated 可能可使用,暂无替代接口\
* 注销一个系统事件
* @param type 事件名
*/
unregisterSystemEvent(type: string): void;
/**
- * @deprecated
+ * @deprecated 可能可使用,暂无替代接口\
* 执行一个系统事件
* @param type 执行的事件名
* @param data 数据信息
@@ -121,7 +121,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 获得道具并提示,如果填写了坐标就会删除该点的该道具
* @example core.getItem('book'); // 获得敌人手册并提示
* @param id 道具id,必填
@@ -139,7 +139,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 轻按获得面前的物品或周围唯一物品
* @param noRoute 若为true则不计入录像
*/
@@ -186,7 +186,7 @@ interface Events extends EventData {
onSki(number?: number): boolean;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 注册一个自定义事件
* @param type 事件类型
* @param func 事件的处理函数,可接受(data, x, y, prefix)参数
@@ -195,14 +195,14 @@ interface Events extends EventData {
registerEvent(type: string, func: EventFunc): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 注销一个自定义事件
* @param type 事件类型
*/
unregisterEvent(type: string): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 执行一个自定义事件
* @param data 事件信息
* @param x 事件横坐标
@@ -212,7 +212,7 @@ interface Events extends EventData {
doEvent(data: any, x?: number, y?: number, prefix?: string): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 直接设置事件列表
* @param list 事件信息
* @param x 横坐标
@@ -227,7 +227,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 开始执行一系列自定义事件
* @param list 事件信息
* @param x 横坐标
@@ -242,7 +242,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 执行下一个事件指令,常作为回调
* @example
* // 事件中的原生脚本,配合勾选“不自动执行下一个事件”来达到此改变色调只持续到下次场景切换的效果
@@ -251,7 +251,7 @@ interface Events extends EventData {
doAction(): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 插入一段事件;此项不可插入公共事件,请用 core.insertCommonEvent
* @example core.insertAction('一段文字'); // 插入一个显示文章
* @param action 单个事件指令,或事件指令数组
@@ -269,7 +269,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 插入一个公共事件
* @example core.insertCommonEvent('加点事件', [3]);
* @param name 公共事件名;如果公共事件不存在则直接忽略
@@ -289,27 +289,27 @@ interface Events extends EventData {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 获得一个公共事件
* @param name 公共事件名称
*/
getCommonEvent(name: EventDeclaration): any;
/**
- * @deprecated
+ * @deprecated 可能可使用,暂无替代接口\
* 恢复一个事件
* @param data 事件信息
*/
recoverEvents(data?: any): boolean;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 检测自动事件
*/
checkAutoEvents(): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 当前是否在执行某个自动事件
* @param symbol 自动事件的标识符
* @param value 不太清楚有什么用
@@ -317,7 +317,7 @@ interface Events extends EventData {
autoEventExecuting(symbol?: string, value?: any): boolean;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 当前是否执行过某个自动事件
* @param symbol 自动事件的标识符
* @param value 不太清楚有什么用
@@ -325,113 +325,113 @@ interface Events extends EventData {
autoEventExecuted(symbol?: string, value?: any): boolean;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 将当前点坐标入栈
*/
pushEventLoc(x: number, y: number, floorId?: FloorIds): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 弹出事件坐标点
*/
popEventLoc(): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 预编辑事件
* @param data 事件信息
*/
precompile(data?: any): any;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 点击怪物手册时的打开操作
* @param fromUserAction 是否是用户开启的
*/
openBook(fromUserAction?: boolean): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 点击楼层传送器时的打开操作
* @param fromUserAction 是否是用户开启的
*/
useFly(fromUserAction?: boolean): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 点击装备栏时的打开操作
*/
openEquipbox(fromUserAction?: boolean): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 点击工具栏时的打开操作
* @param fromUserAction 是否是用户开启的
*/
openToolbox(fromUserAction?: boolean): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 点击快捷商店按钮时的打开操作
* @param fromUserAction 是否是用户开启的
*/
openQuickShop(fromUserAction?: boolean): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用 `getVirtualKeyOnce`\
* 点击虚拟键盘时的打开操作
* @param fromUserAction 是否是用户开启的
*/
openKeyBoard(fromUserAction?: boolean): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用 `saveSave`\
* 点击存档按钮时的打开操作
* @param fromUserAction 是否是用户开启的
*/
save(fromUserAction?: boolean): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用 `saveLoad`\
* 点击读档按钮时的打开操作
* @param fromUserAction 是否是用户开启的
*/
load(fromUserAction?: boolean): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用 `openSettings`\
* 点击设置按钮时的操作
* @param fromUserAction 是否是用户开启的
*/
openSettings(fromUserAction?: boolean): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 当前是否有未处理完毕的异步事件(不包含动画和音效)
*/
hasAsync(): boolean;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 立刻停止所有异步事件
*/
stopAsync(): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 是否有异步动画
*/
hasAsyncAnimate(): boolean;
/**
- * @deprecated
+ * @deprecated 已失效,暂无替代接口\
* 跟随
* @param name 要跟随的一个合法的4x4的行走图名称,需要在全塔属性注册
*/
follow(name: ImageIds | NameMapIn): void;
/**
- * @deprecated
+ * @deprecated 已失效,暂无替代接口\
* 取消跟随
* @param name 取消跟随的行走图,不填则取消全部跟随者
*/
@@ -452,7 +452,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated 已失效(大概
+ * @deprecated 已失效,暂无替代接口,考虑在 `getEnemyInfo` 阶段修改怪物属性\
* 设置一项敌人属性并计入存档
* @example core.setEnemy('greenSlime', 'def', 0); // 把绿头怪的防御设为0
* @param id 敌人id
@@ -472,7 +472,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated 已失效(大概
+ * @deprecated 已失效,暂无替代接口,考虑在 `getEnemyInfo` 阶段修改怪物属性\
* 设置某个点的敌人属性
* @param x 横坐标
* @param y 纵坐标
@@ -495,7 +495,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated 已失效(大概
+ * @deprecated 已失效,暂无替代接口,考虑在 `getEnemyInfo` 阶段修改怪物属性\
* 重置某个点的敌人属性
* @param x 横坐标
* @param y 纵坐标
@@ -510,7 +510,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated 已失效(大概
+ * @deprecated 已失效,暂无替代接口,考虑在 `getEnemyInfo` 阶段修改怪物属性\
* 将某个点已经设置的敌人属性移动到其他点
* @param fromX 起始横坐标
* @param fromY 起始纵坐标
@@ -565,7 +565,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 设置文件别名
* @param name 别名
* @param value 别名对应的文件名
@@ -573,13 +573,13 @@ interface Events extends EventData {
setNameMap(name: string, value?: SourceIds): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,考虑换用 `TextboxStore` 接口\
* 设置剧情文本的属性
*/
setTextAttribute(data: Partial): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,考虑换用 `TextboxStore` 接口\
* 移动对话框
* @param code 对话框的代码
* @param loc 目标位置
@@ -598,7 +598,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,考虑换用 `TextboxStore` 接口\
* 清除对话框
* @param code 对话框的代码
* @param callback 回调函数
@@ -621,7 +621,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 显示一张图片
* @example
* // 裁剪winskin.png的最左边128×128px,放大到铺满整个视野,1秒内淡入到50%透明,编号为1
@@ -645,7 +645,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 隐藏一张图片
* @example core.hideImage(1, 1000, core.jumpHero); // 1秒内淡出1号图片,然后主角原地跳跃半秒
* @param code 图片编号
@@ -655,7 +655,7 @@ interface Events extends EventData {
hideImage(code: number, time?: number, callback?: () => void): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 移动一张图片并/或改变其透明度
* @example core.moveImage(1, null, 0.5); // 1秒内把1号图片变为50%透明
* @param code 图片编号
@@ -675,7 +675,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 旋转一张图片
* @param code 图片编号
* @param center 旋转中心像素(以屏幕为基准);不填视为图片本身中心
@@ -694,7 +694,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 放缩一张图片
* @param code 图片编号
* @param center 旋转中心像素(以屏幕为基准);不填视为图片本身中心
@@ -713,7 +713,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 绘制一张动图或擦除所有动图
* @example core.showGif(); // 擦除所有动图
* @param name 动图文件名,可以是全塔属性中映射前的中文名
@@ -729,7 +729,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,考虑换用 `BgmController` 接口\
* 调节bgm的音量
* @example core.setVolume(0, 100, core.jumpHero); // 0.1秒内淡出bgm,然后主角原地跳跃半秒
* @param value 新的音量,为0或不大于1的正数。注意系统设置中是这个值的平方根的十倍
@@ -739,7 +739,7 @@ interface Events extends EventData {
setVolume(value: number, time?: number, callback?: () => void): void;
/**
- * @deprecated
+ * @deprecated 已失效,暂无替代接口,但是此接口应该已经不再会被用到\
* 视野抖动
* @example core.vibrate(); // 视野左右抖动1秒
* @param direction 抖动方向
@@ -757,7 +757,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 强制移动主角(包括后退),这个函数的作者已经看不懂这个函数了
* @example core.eventMoveHero(['forward'], 125, core.jumpHero); // 主角强制前进一步,用时1/8秒,然后主角原地跳跃半秒
* @param steps 步伐数组,注意后退时跟随者的行为会很难看
@@ -767,7 +767,7 @@ interface Events extends EventData {
eventMoveHero(steps: Step[], time?: number, callback?: () => void): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 主角跳跃,跳跃勇士。ex和ey为目标点的坐标,可以为null表示原地跳跃。time为总跳跃时间。
* @example core.jumpHero(); // 主角原地跳跃半秒
* @param ex 跳跃后的横坐标
@@ -783,7 +783,7 @@ interface Events extends EventData {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 `HeroRenderer.setImage` 接口\
* 更改主角行走图
* @example core.setHeroIcon('npc48.png', true); // 把主角从阳光变成样板0层左下角的小姐姐,但不立即刷新
* @param name 新的行走图文件名,可以是全塔属性中映射前的中文名。映射后会被存入core.status.hero.image
@@ -805,6 +805,8 @@ interface Events extends EventData {
callback?: () => void
): void;
+ afterBattle(enemyId: any, x?: number, y?: number): void;
+
_sys_battle(data: Block, callback?: () => void): void;
_action_battle(data: any, x?: number, y?: number, prefix?: any): void;
diff --git a/src/types/declaration/function.d.ts b/src/types/declaration/function.d.ts
index 152d7e9..6c68ae6 100644
--- a/src/types/declaration/function.d.ts
+++ b/src/types/declaration/function.d.ts
@@ -1,13 +1,3 @@
-interface ActionData {
- /**
- * @deprecated
- * 当按键弹起时
- * @param keyCode 按键的keyCode
- * @param altKey 当前是否按下了alt键
- */
- onKeyUp(keyCode: number, altKey: boolean): boolean;
-}
-
interface ControlData {
/**
* 获取保存信息
@@ -39,20 +29,6 @@ interface ControlData {
* @param ignoreSteps 忽略的步数,不填则会自动计算
*/
moveDirectly(x: number, y: number, ignoreSteps?: number): boolean;
-
- /**
- * @deprecated
- * 并行脚本
- * @param time 距离游戏加载完毕经过的时间
- */
- parallelDo(time: number): void;
-}
-
-interface UiData {
- /**
- * 数据统计界面统计的道具数量
- */
- drawStatistics(): AllIdsOf<'items'>[];
}
interface EventData {
@@ -105,63 +81,14 @@ interface EventData {
* @param callback 飞到后的回调函数
*/
flyTo(toId: FloorIds, callback?: () => void): boolean;
-
- /**
- * 与怪物战斗后
- * @param enemyId 打败的怪物
- * @param x 怪物横坐标
- * @param y 怪物纵坐标
- */
- afterBattle(enemyId: any, x?: number, y?: number): void;
-
- /**
- * 开门后
- * @param doorId 门的id
- * @param x 门的横坐标
- * @param y 门的纵坐标
- */
- afterOpenDoor(
- doorId: AllIdsOf>,
- x: number,
- y: number
- ): void;
-
- /**
- * 获得道具后
- * @param itemId 道具id
- * @param x 道具横坐标
- * @param y 道具纵坐标
- * @param isGentleClick 是否是轻按
- */
- afterGetItem(
- itemId: AllIdsOf<'items'>,
- x: number,
- y: number,
- isGentleClick?: boolean
- ): void;
-
- /**
- * 推箱子后
- */
- afterPushBox(): void;
}
interface FunctionsData {
- /**
- * 交互信息
- */
- actions: ActionData;
-
/**
* 游戏的逻辑信息
*/
control: ControlData;
- /**
- * ui信息
- */
- ui: UiData;
-
/**
* 事件信息
*/
diff --git a/src/types/declaration/item.d.ts b/src/types/declaration/item.d.ts
index 29cc83a..8e83b3c 100644
--- a/src/types/declaration/item.d.ts
+++ b/src/types/declaration/item.d.ts
@@ -99,7 +99,7 @@ interface Equip extends EquipBase {
*/
interface Items {
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 获得所有道具
*/
getItems(): {
@@ -107,7 +107,7 @@ interface Items {
};
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 执行即捡即用类的道具获得时的效果
* @example core.getItemEffect('redPotion', 10) // 执行获得10瓶红血的效果
* @param itemId 道具id
@@ -116,7 +116,7 @@ interface Items {
getItemEffect(itemId: AllIdsOf<'items'>, itemNum?: number): void;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 即捡即用类的道具获得时的额外提示
* @example core.getItemEffectTip(redPotion) // (获得 红血瓶)',生命+100'
* @param itemId 道具id
@@ -125,7 +125,7 @@ interface Items {
getItemEffectTip(itemId: AllIdsOf<'items'>): string;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 使用一个道具
* @example core.useItem('pickaxe', true) // 使用破墙镐,不计入录像,无回调
* @param itemId 道具id
@@ -139,7 +139,7 @@ interface Items {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 检查能否使用某种道具
* @example core.canUseItem('pickaxe') // 能否使用破墙镐
* @param itemId 道具id
@@ -148,7 +148,7 @@ interface Items {
canUseItem(itemId: AllIdsOf<'items'>): boolean;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 统计某种道具的持有量
* @example core.itemCount('yellowKey') // 持有多少把黄钥匙
* @param itemId 道具id
@@ -157,7 +157,7 @@ interface Items {
itemCount(itemId: AllIdsOf<'items'>): number;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 检查主角是否持有某种道具(不包括已穿戴的装备)
* @example core.hasItem('yellowKey') // 主角是否持有黄钥匙
* @param itemId 道具id
@@ -166,7 +166,7 @@ interface Items {
hasItem(itemId: AllIdsOf<'items'>): boolean;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 检查主角是否穿戴着某件装备
* @example core.hasEquip('sword5') // 主角是否装备了神圣剑
* @param itemId 装备id
@@ -175,7 +175,7 @@ interface Items {
hasEquip(itemId: ItemIdOf<'equips'>): boolean;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 检查主角某种类型的装备目前是什么
* @example core.getEquip(1) // 主角目前装备了什么盾牌
* @param equipType 装备类型,自然数
@@ -184,7 +184,7 @@ interface Items {
getEquip(equipType: number): ItemIdOf<'equips'> | null;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 设置某种道具的持有量
* @example core.setItem('yellowKey', 3) // 设置黄钥匙为3把
* @param itemId 道具id
@@ -193,7 +193,7 @@ interface Items {
setItem(itemId: AllIdsOf<'items'>, itemNum?: number): void;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 静默增减某种道具的持有量 不会更新游戏画面或是显示提示
* @example core.addItem('yellowKey', -2) // 没收两把黄钥匙
* @param itemId 道具id
@@ -202,7 +202,7 @@ interface Items {
addItem(itemId: AllIdsOf<'items'>, itemNum?: number): void;
/**
- * @deprecated 使用addItem代替。
+ * @deprecated 可使用,考虑用 `addItem` 代替,2.C 将会有替代接口\
* 删除某个物品一定的数量,相当于addItem(itemId, -n);
* @param itemId 道具id
* @param itemNum 减少量,负数表示增加
@@ -210,14 +210,14 @@ interface Items {
removeItem(itemId?: AllIdsOf<'items'>, itemNum?: number): void;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 根据类型获得一个可用的装备孔
* @param equipId 道具名称
*/
getEquipTypeByName(name?: ItemIdOf<'equips'>): number;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 判定某件装备的类型
* @example core.getEquipTypeById('shield5') // 1(盾牌)
* @param equipId 装备id
@@ -226,7 +226,7 @@ interface Items {
getEquipTypeById(equipId: ItemIdOf<'equips'>): number;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 检查能否穿上某件装备
* @example core.canEquip('sword5', true) // 主角可以装备神圣剑吗,如果不能会有提示
* @param equipId 装备id
@@ -236,7 +236,7 @@ interface Items {
canEquip(equipId: ItemIdOf<'equips'>, hint?: boolean): boolean;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 尝试穿上某件背包里的装备并提示
* @example core.loadEquip('sword5') // 尝试装备上背包里的神圣剑,无回调
* @param equipId 装备id
@@ -245,7 +245,7 @@ interface Items {
loadEquip(equipId: ItemIdOf<'equips'>, callback?: () => void): void;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 脱下某个类型的装备
* @example core.unloadEquip(1) // 卸下盾牌,无回调
* @param equipType 装备类型编号,自然数
@@ -254,7 +254,7 @@ interface Items {
unloadEquip(equipType: number, callback?: () => void): void;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 比较两件(类型可不同)装备的优劣
* @example core.compareEquipment('sword5', 'shield5') // 比较神圣剑和神圣盾的优劣
* @param compareEquipId 装备甲的id
@@ -267,7 +267,7 @@ interface Items {
): EquipBase;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 保存当前套装
* @example core.quickSaveEquip(1) // 将当前套装保存为1号套装
* @param index 套装编号,自然数
@@ -275,7 +275,7 @@ interface Items {
quickSaveEquip(index: number): void;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 快速换装
* @example core.quickLoadEquip(1) // 快速换上1号套装
* @param index 套装编号,自然数
@@ -283,7 +283,7 @@ interface Items {
quickLoadEquip(index: number): void;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 设置某个装备的属性并计入存档
* @example core.setEquip('sword1', 'value', 'atk', 300, '+='); // 设置铁剑的攻击力数值再加300
* @param equipId 装备id
@@ -303,7 +303,7 @@ interface Items {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,2.C 将会有替代接口\
* 真正的穿脱装备
* @param type 装备孔
* @param loadId 装上的装备
diff --git a/src/types/declaration/loader.d.ts b/src/types/declaration/loader.d.ts
index 2d54393..153c7d7 100644
--- a/src/types/declaration/loader.d.ts
+++ b/src/types/declaration/loader.d.ts
@@ -3,7 +3,7 @@
*/
interface Loader {
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用 `Resources` 系列接口\
* 加载一系列图片
* @param dir 图片所在目录
* @param names 图片名称列表
@@ -18,7 +18,7 @@ interface Loader {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用 `Resources` 系列接口\
* 加载某一张图片
* @param dir 图片所在目录
* @param imgName 图片名称
@@ -31,7 +31,7 @@ interface Loader {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用 `Resources` 系列接口\
* 从zip中加载一系列图片
* @param url 图片所在目录
* @param names 图片名称列表
@@ -45,28 +45,28 @@ interface Loader {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用 `Resources` 系列接口\
* 加载一个音乐
* @param name 要加载的音乐的名称
*/
loadOneMusic(name: BgmIds): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用 `Resources` 系列接口\
* 加载一个音效
* @param name 要加载的音效的名称
*/
loadOneSound(name: SoundIds): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用 `Resources` 系列接口\
* 加载一个bgm
* @param name 加载的bgm的id或名称
*/
loadBgm(name: BgmIds | NameMapIn): void;
/**
- * @deprecated
+ * @deprecated 已失效,暂无替代接口\
* 释放一个bgm的缓存
* @param name 要释放的bgm的id或名称
*/
diff --git a/src/types/declaration/map.d.ts b/src/types/declaration/map.d.ts
index b338b6a..f310c33 100644
--- a/src/types/declaration/map.d.ts
+++ b/src/types/declaration/map.d.ts
@@ -585,7 +585,7 @@ interface Maps {
compressMap(mapArr?: number[][], floorId?: FloorIds): number[][];
/**
- * @deprecated
+ * @deprecated 已失效,暂无替代接口,可能在 2.B.1 或 2.B.2 中添加替代接口\
* 设置图块的不透明度
* @param opacity 不透明度
* @param x 横坐标
@@ -600,7 +600,7 @@ interface Maps {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,暂无替代接口,可能在 2.B.1 或 2.B.2 中添加替代接口\
* 设置图块的滤镜
* @param filter 滤镜信息
* @param x 横坐标
@@ -810,7 +810,7 @@ interface Maps {
automaticRoute(destX: number, destY: number): DiredLoc[];
/**
- * @deprecated
+ * @deprecated 已失效,暂无替代接口,可能在 2.B.1 或 2.B.2 中添加替代接口\
* 绘制一个图块
* @param block 要绘制的图块
* @param animate 绘制图块的第几帧
@@ -819,14 +819,14 @@ interface Maps {
drawBlock(block?: Block, animate?: number, ctx?: CtxRefer): void;
/**
- * @deprecated
+ * @deprecated 已失效,此接口已经不会被使用到\
* 生成groundPattern
* @param floorId 楼层id
*/
generateGroundPattern(floorId?: FloorIds): void;
/**
- * @deprecated
+ * @deprecated 已失效,此接口已经不会被使用到\
* 地图绘制
* @example core.drawMap(); // 绘制当前地图
* @param floorId 地图id,不填表示当前楼层
@@ -834,13 +834,13 @@ interface Maps {
drawMap(floorId?: FloorIds): void;
/**
- * @deprecated
+ * @deprecated 已失效,此接口已经不会被使用到\
* 重绘地图
*/
redrawMap(): void;
/**
- * @deprecated
+ * @deprecated 已失效,此接口已经不会被使用到\
* 绘制背景层(含贴图,其与背景层矩阵的绘制顺序可通过复写此函数来改变)
* @example core.drawBg(); // 绘制当前地图的背景层
* @param floorId 地图id,不填视为当前地图
@@ -849,7 +849,7 @@ interface Maps {
drawBg(floorId?: FloorIds, config?: Partial): void;
/**
- * @deprecated
+ * @deprecated 已失效,此接口已经不会被使用到\
* 绘制事件层
* @example core.drawEvents(); // 绘制当前地图的事件层
* @param floorId 地图id,不填视为当前地图
@@ -863,7 +863,7 @@ interface Maps {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,此接口已经不会被使用到\
* 绘制前景层(含贴图,其与前景层矩阵的绘制顺序可通过复写此函数来改变)
* @example core.drawFg(); // 绘制当前地图的前景层
* @param floorId 地图id,不填视为当前地图
@@ -872,7 +872,7 @@ interface Maps {
drawFg(floorId?: FloorIds, config?: Partial): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 绘制缩略图
* @example core.drawThumbnail(); // 绘制当前地图的缩略图
* @param floorId 地图id,不填视为当前地图
@@ -1011,7 +1011,7 @@ interface Maps {
): Cls | null;
/**
- * @deprecated
+ * @deprecated 已失效,暂无替代接口,可能在 2.B.1 或 2.B.2 中添加替代接口\
* 获取图块的不透明度
* @param x 横坐标
* @param y 纵坐标
@@ -1026,7 +1026,7 @@ interface Maps {
): number | null;
/**
- * @deprecated
+ * @deprecated 已失效,暂无替代接口,可能在 2.B.1 或 2.B.2 中添加替代接口\
* 获取图块的滤镜
* @param x 横坐标
* @param y 纵坐标
@@ -1140,7 +1140,7 @@ interface Maps {
removeBlockByIndexes(indexes: number[], floorId?: FloorIds): void;
/**
- * @deprecated
+ * @deprecated 已失效,此接口已经不会被使用到\
* 显示前景/背景地图
* @param name 图层名
* @param loc 要显示的坐标列表
@@ -1155,7 +1155,7 @@ interface Maps {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,此接口已经不会被使用到\
* 隐藏前景/背景地图
* @param name 图层名
* @param loc 要显示的坐标列表
@@ -1170,7 +1170,7 @@ interface Maps {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,暂无替代接口,可能在 2.B.1 或 2.B.2 中添加替代接口\
* 显示一个楼层贴图
* @param loc 楼层贴图的位置
* @param floorId 楼层id
@@ -1183,7 +1183,7 @@ interface Maps {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,暂无替代接口,可能在 2.B.1 或 2.B.2 中添加替代接口\
* 隐藏一个楼层贴图
* @param loc 楼层贴图的位置
* @param floorId 楼层id
@@ -1213,7 +1213,7 @@ interface Maps {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,暂无替代接口,可能在 2.B.1 或 2.B.2 中添加替代接口\
* 动画形式转变某点图块
* @param number 要转变成的图块的数字或id
* @param x 横坐标
@@ -1232,7 +1232,7 @@ interface Maps {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,暂无替代接口,可能在 2.B.1 或 2.B.2 中添加替代接口\
* 动画形式转变若干点图块
* @param number 要转变成的图块的数字或id
* @param locs 坐标数组
@@ -1299,7 +1299,7 @@ interface Maps {
resetMap(floorId?: FloorIds | FloorIds[]): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无好用的替代接口,可能在 2.B.1 或 2.B.2 中添加替代接口\
* 移动图块
* @example core.moveBlock(0, 0, ['down']); // 令地图左上角的图块下移一格,用时半秒,再花半秒淡出
* @param x 起点的横坐标
@@ -1319,7 +1319,7 @@ interface Maps {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无好用的替代接口,可能在 2.B.1 或 2.B.2 中添加替代接口\
* 跳跃图块;从V2.7开始不再有音效
* @example core.jumpBlock(0, 0, 0, 0); // 令地图左上角的图块原地跳跃半秒,再花半秒淡出
* @param sx 起点的横坐标
@@ -1341,7 +1341,7 @@ interface Maps {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口,可能在 2.B.1 或 2.B.2 中添加替代接口\
* 显示/隐藏某个块时的动画效果
* @param loc 要显示或隐藏的坐标数组
* @param type 显示还是隐藏还是移除,填数字表示设置不透明度
@@ -1356,19 +1356,19 @@ interface Maps {
): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 添加一个全局动画
* @param block 图块信息
*/
addGlobalAnimate(block?: Block): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 删除所有全局动画
*/
removeGlobalAnimate(): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 删除一个全局动画
* @param x 横坐标
* @param y 纵坐标
@@ -1376,13 +1376,13 @@ interface Maps {
removeGlobalAnimate(x?: number, y?: number): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 绘制UI层的box动画
*/
drawBoxAnimate(): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无好用的替代接口,可能在 2.B.1 或 2.B.2 中添加替代接口\
* 播放动画,注意即使指定了主角的坐标也不会跟随主角移动,如有需要请使用core.drawHeroAnimate(name, callback)函数
* @example core.drawAnimate('attack', core.nextX(), core.nextY(), false, core.vibrate); // 在主角面前一格播放普攻动画,动画停止后视野左右抖动1秒
* @param name 动画文件名,不含后缀
@@ -1401,7 +1401,7 @@ interface Maps {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无好用的替代接口,可能在 2.B.1 或 2.B.2 中添加替代接口\
* 播放跟随勇士的动画
* @param name 动画名
* @param callback 动画停止后的回调函数
@@ -1413,15 +1413,15 @@ interface Maps {
): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,暂无替代接口,可能在 2.B.1 或 2.B.2 中添加替代接口\
* 获得当前正在播放的所有(指定)动画的id列表
* @param name 指定名称
*/
getPlayingAnimates(name?: AnimationIds): number[];
/**
- * @deprecated
- * 立刻停止一个动画播放(已失效)
+ * @deprecated 可能已失效,暂无替代接口,可能在 2.B.1 或 2.B.2 中添加替代接口\
+ * 立刻停止一个动画播放
* @param id 播放动画的编号,即drawAnimate或drawHeroAnimate返回值,不填则停止所有的
* @param doCallback 是否执行该动画的回调函数
*/
diff --git a/src/types/declaration/plugin.d.ts b/src/types/declaration/plugin.d.ts
index 819ba0c..bd2561d 100644
--- a/src/types/declaration/plugin.d.ts
+++ b/src/types/declaration/plugin.d.ts
@@ -8,11 +8,6 @@ type CanParseCss = keyof {
: never]: CSSStyleDeclaration[P];
};
-interface PluginDeclaration {
- init(): void;
- _afterLoadResouce(): void;
-}
-
type Forward = {
[K in keyof T as T[K] extends (...params: any) => any
? K extends `_${string}`
diff --git a/src/types/declaration/status.d.ts b/src/types/declaration/status.d.ts
index 6989cf8..424c8ec 100644
--- a/src/types/declaration/status.d.ts
+++ b/src/types/declaration/status.d.ts
@@ -1,65 +1,3 @@
-/**
- * 怪物buff缓存
- */
-interface EnemyBuffCache {
- /**
- * 生命值提升量
- */
- hp_buff: number;
-
- /**
- * 攻击提升量
- */
- atk_buff: number;
-
- /**
- * 防御提升量
- */
- def_buff: number;
-
- /**
- * 支援信息
- */
- guards: [number, number, string][];
-}
-
-interface CheckBlockStatus {
- /**
- * 捕捉信息
- */
- ambush: Record;
-
- /**
- * 阻击信息
- */
- repulse: Record;
-
- /**
- * 每点的伤害,小于等于0会不显示
- */
- damage: Record;
-
- /**
- * 是否需要重算
- */
- needCache: boolean;
-
- /**
- * 每点的伤害类型
- */
- type: Record>;
-
- /**
- * 缓存信息,是每个怪物受到的光环加成
- */
- cache: Record>;
-
- /**
- * 光环信息
- */
- halo: Record;
-}
-
interface DamageStatus {
/**
* v2优化下当前的偏移横坐标,单位格子
@@ -80,11 +18,6 @@ interface DamageStatus {
* 地图伤害或其它在地图上显示的文字
*/
extraData: DamageStatusExtraData[];
-
- /**
- * 不同方向伤害不同的信息
- */
- dir: DamageDirData[];
}
interface DamageStatusData {
@@ -116,13 +49,6 @@ interface DamageStatusExtraData extends DamageStatusData {
alpha: number;
}
-interface DamageDirData {
- x: number;
- y: number;
- dir: Dir;
- color: Color;
-}
-
interface AutomaticRouteStatus {
/**
* 勇士是否正在移动
@@ -336,21 +262,6 @@ interface TextAttribute {
}
interface StatusStyle {
- /**
- * 游戏的边框颜色
- */
- borderColor: Color;
-
- /**
- * 状态栏文字的颜色
- */
- statusBarColor: Color;
-
- /**
- * 楼层切换样式,css字符串
- */
- floorChangingStyle: string;
-
/**
* 全局字体
*/
@@ -591,7 +502,7 @@ interface InitGameStatus {
mapBlockObjs: Record>;
/**
- * @deprecated
+ * @deprecated 已失效,暂无好用的替代接口,之后可能会新增接口\
* 伤害显示信息
*/
damage: DamageStatus;
@@ -602,13 +513,13 @@ interface InitGameStatus {
lockControl: boolean;
/**
- * @deprecated 迟早给你删喽\
+ * @deprecated 可能可使用,暂无替代接口\
* 勇士移动状态,每个数字干啥的自己去libs翻,这东西太复杂了,不过应该不会有人用这个东西吧(
*/
heroMoving: number;
/**
- * @deprecated
+ * @deprecated 可能可使用,暂无替代接口\
* 勇士是否停下了
*/
heroStop: boolean;
@@ -654,6 +565,7 @@ interface InitGameStatus {
autoEvents: DeepReadonly;
/**
+ * @deprecated 可能已失效,考虑换用 `TextboxStore` 接口\
* 当前的全局剧情文本设置
*/
textAttribute: TextAttribute;
@@ -664,13 +576,13 @@ interface InitGameStatus {
globalAttribute: GlobalAttribute;
/**
- * @deprecated
+ * @deprecated 可能可使用,暂无好用的替代接口\
* 色调的颜色
*/
curtainColor: Color;
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 全局动画对象
*/
globalAnimateObjs: Block<
@@ -678,31 +590,31 @@ interface InitGameStatus {
>[];
/**
- * @deprecated
+ * @deprecated 可能可使用,暂无替代接口\
* 楼层贴图
*/
floorAnimateObjs: FloorAnimate[];
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 所有的BoxAnimate信息
*/
boxAnimateObjs: (BoxAnimate | BigImageBoxAnimate)[];
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 所有的自动元件动画
*/
autotileAnimateObjs: Block]>[];
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 全局动画状态,每经过一个全局动画时间便加一
*/
globalAnimateStatus: number;
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 所有绘制的动画
*/
animateObjs: AnimateObj[];
@@ -713,7 +625,7 @@ interface InitGameStatus {
hard: string;
/**
- * @deprecated
+ * @deprecated 可能已失效,此接口已经不会被使用到\
* 勇士的中心
*/
heroCenter: Record<'px' | 'py', number>;
@@ -756,10 +668,10 @@ interface GameStatus extends InitGameStatus {
thisMap: Floor;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用 `core.status.maps[floorId].mapDamage` 接口\
* 地图伤害
*/
- checkBlock: Readonly;
+ checkBlock: void;
/**
* 当前勇士状态信息。例如core.status.hero.atk就是当前勇士的攻击力数值
@@ -769,18 +681,6 @@ interface GameStatus extends InitGameStatus {
stepPostfix?: DiredLoc[];
}
-interface Follower {
- /**
- * 跟随者的图片id
- */
- name: ImageIds;
-
- direction: Dir;
- x: number;
- y: number;
- stop: boolean;
-}
-
interface HeroStatistics {
/**
* 击败的怪物数量
@@ -931,38 +831,29 @@ interface HeroStatus {
loc: DiredLoc;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 当前的变量
*/
flags: Flags;
/**
- * @deprecated
+ * @deprecated 已失效,暂无替代接口\
* 勇士的跟随者
*/
- followers: Follower[];
+ followers: [];
/**
- * @deprecated
+ * @deprecated 可使用,此接口已经不会被使用到\
*/
statistics: HeroStatistics;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口,2.C 会新增替代接口\
* 勇士拥有的道具
*/
items: {
[P in Exclude]: Record, number>;
};
- /**
- * 勇士学习的特技
- */
- special: {
- num: number[];
- last: number[];
- [k: string]: any;
- };
-
buff: Partial>;
}
diff --git a/src/types/declaration/ui.d.ts b/src/types/declaration/ui.d.ts
index b8e2323..0a8f30c 100644
--- a/src/types/declaration/ui.d.ts
+++ b/src/types/declaration/ui.d.ts
@@ -213,14 +213,14 @@ interface Ui {
uidata: UiData;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 根据画布名找到一个画布的context;支持系统画布和自定义画布。如果不存在画布返回null。
* 也可以传画布的context自身,则返回自己。
*/
getContextByName(canvas: CtxRefer): CanvasRenderingContext2D | null;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 清空某个画布图层
* name为画布名,可以是系统画布之一,也可以是任意自定义动态创建的画布名;还可以直接传画布的context本身。(下同)
* 如果name也可以是'all',若为all则为清空所有系统画布。
@@ -234,7 +234,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 在某个画布上绘制一段文字
* @param text 要绘制的文本
* @param style 绘制的样式
@@ -252,7 +252,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 根据最大宽度自动缩小字体
* @param name 画布
* @param text 文字
@@ -267,7 +267,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 在某个画布上绘制一个描边文字
* @param text 要绘制的文本
* @param style 绘制的样式
@@ -288,7 +288,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 绘制一个矩形
* @param style 绘制的样式
* @param angle 旋转角度,弧度制
@@ -304,7 +304,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 绘制一个矩形的边框
* @param style 绘制的样式
* @param angle 旋转角度,单位弧度
@@ -321,7 +321,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 在某个canvas上绘制一个圆角矩形
*/
fillRoundRect(
@@ -336,7 +336,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 在某个canvas上绘制一个圆角矩形的边框
*/
strokeRoundRect(
@@ -352,7 +352,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 在某个canvas上绘制一个多边形
*/
fillPolygon(
@@ -362,7 +362,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 在某个canvas上绘制一个多边形的边框
*/
strokePolygon(
@@ -373,7 +373,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 在某个canvas上绘制一个椭圆
* @param a 横轴长度的一半
* @param b 纵轴长度的一半
@@ -390,7 +390,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 在某个canvas上绘制一个圆
*/
fillCircle(
@@ -402,7 +402,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 在某个canvas上绘制一个椭圆的边框
* @param a 横轴长度的一半
* @param b 纵轴长度的一半
@@ -420,7 +420,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 在某个canvas上绘制一个圆的边框
*/
strokeCircle(
@@ -433,7 +433,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 在某个canvas上绘制一个扇形
*/
fillArc(
@@ -447,7 +447,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 在某个canvas上绘制一段弧
*/
strokeArc(
@@ -462,7 +462,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 在某个canvas上绘制一条线
*/
drawLine(
@@ -476,7 +476,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 在某个canvas上绘制一个箭头
*/
drawArrow(
@@ -490,80 +490,80 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 设置某个canvas的文字字体
*/
setFont(name: CtxRefer, font: string): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 设置某个canvas的线宽度
*/
setLineWidth(name: CtxRefer, lineWidth: number): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 保存某个canvas状态
*/
saveCanvas(name: CtxRefer): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 回退某个canvas状态
*/
loadCanvas(name: CtxRefer): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 设置某个canvas的绘制不透明度
* @returns 之前画布的不透明度
*/
setAlpha(name: CtxRefer, alpha: number): number;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 设置画布元素的不透明度
*/
setOpacity(name: CtxRefer, opacity: number): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 设置某个canvas的滤镜
*/
setFilter(name: CtxRefer, filter?: string): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 设置某个canvas的填充样式
*/
setFillStyle(name: CtxRefer, style: CanvasStyle): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 设置某个canvas描边样式
*/
setStrokeStyle(name: CtxRefer, style: CanvasStyle): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 设置某个canvas的文字左右对齐方式
*/
setTextAlign(name: CtxRefer, align: CanvasTextAlign): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 设置某个canvas的文字上下对齐方式
*/
setTextBaseline(name: CtxRefer, baseline: CanvasTextBaseline): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 计算某段文字的宽度,注意该函数会设置画布的字体
*/
calWidth(name: CtxRefer, text: string, font?: string): number;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 字符串自动换行的分割
*/
splitLines(
@@ -574,14 +574,14 @@ interface Ui {
): string[];
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 绘制图片
* @param dx 绘制的横坐标
* @param dy 绘制的纵坐标
*/
drawImage(name: CtxRefer, image: ImageSource, dx: number, dy: number): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 绘制图片
* @param dx 绘制的横坐标
* @param dy 绘制的纵坐标
@@ -597,7 +597,7 @@ interface Ui {
dh: number
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 绘制图片
* @param sx 裁剪的横坐标
* @param sy 裁剪的纵坐标
@@ -622,7 +622,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,考虑换用新的渲染系统中的 `` 元素\
* 在某个canvas上绘制一个图标
* @param frame 图标的第几帧
*/
@@ -642,13 +642,13 @@ interface Ui {
closePanel(): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,考虑换用新的渲染系统\
* 清空UI层内容
*/
clearUI(): void;
/**
- * @deprecated
+ * @deprecated 可能可使用,考虑换用新的渲染系统中的 `TipStore` 接口\
* 左上角绘制一段提示
* @param text 要提示的文字内容
* @param id 要绘制的图标ID
@@ -657,13 +657,13 @@ interface Ui {
drawTip(text: string, id?: AllIds, frame?: number): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统中的 `TextboxStore` 接口\
* 地图中间绘制一段文字
*/
drawText(contents?: string, callback?: () => void): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统中的 `Selector` 组件\
* 自绘选择光标
*/
drawUIEventSelector(
@@ -677,14 +677,14 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统中的 `Selector` 组件\
* 清除一个或多个选择光标
* @param code 要清除的选择光标,不填表示清除所有
*/
clearUIEventSelector(code?: number | number[]): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统中的 `Background` 组件或 `` 元素\
* 绘制WindowSkin
* @param direction 指向箭头的方向
*/
@@ -701,7 +701,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统中的 `Background` 组件\
* 绘制一个背景图,可绘制winskin或纯色背景;支持小箭头绘制
*/
drawBackground(
@@ -713,7 +713,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统中的 `Textbox` 组件\
* 绘制一段文字到某个画布上面
* @param ctx 要绘制到的画布
* @param content 要绘制的内容;转义字符只允许保留 \n, \r[...], \i[...], \c[...], \d, \e
@@ -727,7 +727,7 @@ interface Ui {
): ReturnedTextContentConfig;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统中的 `Textbox` 组件\
* 获得某段文字的预计绘制高度
*/
getTextContentHeight(
@@ -736,13 +736,13 @@ interface Ui {
): number;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统中的 `Textbox` 组件和 `TextboxStore` 接口\
* 绘制一个对话框
*/
drawTextBox(content: string, config?: TextBoxConfig): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统中的 `ScrollText` 组件\
* 绘制滚动字幕
*/
drawScrollText(
@@ -753,13 +753,13 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,此接口已经不会被使用到\
* 文本图片化
*/
textImage(content: string, lineHeight?: number): HTMLCanvasElement;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统中的 `getChoices` 接口\
* 绘制一个选项界面
*/
drawChoices(
@@ -770,7 +770,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统中的 `getConfirm` 接口\
* 绘制一个确认框
*/
drawConfirmBox(
@@ -781,37 +781,37 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统中的 `waitbox` 接口\
* 绘制等待界面
*/
drawWaiting(text: string): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统中的 `Page` 接口\
* 绘制分页
*/
drawPagination(page: number, totalPage: number, y?: number): void;
/**
- * @deprecated
+ * @deprecated 已失效,暂无替代接口\
* 绘制怪物手册
*/
drawBook(index: number): void;
/**
- * @deprecated
+ * @deprecated 已失效,暂无替代接口\
* 绘制楼层传送器
*/
drawFly(page: number): void;
/**
- * @deprecated
+ * @deprecated 可能已失效,暂无替代接口\
* 获得所有应该在道具栏显示的某个类型道具
*/
getToolboxItems>(cls: T): ItemIdOf[];
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 动态创建一个画布
* @param name 画布名称,如果已存在则会直接取用当前存在的
* @param x 横坐标
@@ -832,7 +832,7 @@ interface Ui {
): CanvasRenderingContext2D;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 重新定位一个自定义画布
*/
relocateCanvas(
@@ -843,7 +843,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 设置一个自定义画布的旋转角度
*/
rotateCanvas(
@@ -854,7 +854,7 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 重新设置一个自定义画布的大小
* @param styleOnly 是否只修改style,而不修改元素上的长宽,如果是true,会出现模糊现象
* @param isTempCanvas 是否是临时画布,如果填true,会将临时画布修改为高清画布
@@ -868,19 +868,19 @@ interface Ui {
): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 删除一个自定义画布
*/
deleteCanvas(name: string | ((name: string) => boolean)): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统\
* 清空所有的自定义画布
*/
deleteAllCanvas(): void;
/**
- * @deprecated
+ * @deprecated 已失效,考虑换用新的渲染系统中的 `ViewMap` UI\
* 绘制浏览地图
*/
_drawViewMaps(): void;
diff --git a/src/types/declaration/util.d.ts b/src/types/declaration/util.d.ts
index e4e3904..cd41b05 100644
--- a/src/types/declaration/util.d.ts
+++ b/src/types/declaration/util.d.ts
@@ -1,19 +1,19 @@
/** 工具类 主要用来进行一些辅助函数的计算 */
interface Utils {
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 四个方向的坐标增量
*/
readonly scan: DeepReadonly;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 八个方向的坐标增量
*/
readonly scan2: DeepReadonly;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 将一段文字中的${}(表达式)进行替换。很多情况下可以用模板字符串替代
* @example
* // 把主角的生命值和持有的黄钥匙数量代入这句话
@@ -25,7 +25,7 @@ interface Utils {
replaceText(text: string, prefix?: string): string;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 对一个表达式中的特殊规则进行替换,如status:xxx等。
* 其中变量和全局存储会替换中文冒号,其余的不会替换
* @example
@@ -37,7 +37,7 @@ interface Utils {
replaceValue(value: string): string;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 计算一个表达式的值,支持status:xxx等的计算。
* @example core.calValue('status:hp + status:def'); // 计算主角的生命值加防御力
* @param value 待求值的表达式
@@ -47,7 +47,7 @@ interface Utils {
calValue(value: string | Function, prefix?: string): any;
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 js 自带的 `Array.unshift` 接口
* 将b(可以是另一个数组)插入数组a的开头,用Array.unshift就行
* @example core.unshift(todo, {type: 'unfollow'}); // 在事件指令数组todo的开头插入“取消所有跟随者”指令
* @param a 原数组
@@ -57,7 +57,7 @@ interface Utils {
unshift(a: A, b: B): [...B, ...A];
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 js 自带的 `Array.push` 接口
* 将b(可以是另一个数组)插入数组a的末尾,用Array.push就行
* @example core.push(todo, {type: 'unfollow'}); // 在事件指令数组todo的末尾插入“取消所有跟随者”指令
* @param a 原数组
@@ -67,14 +67,14 @@ interface Utils {
push(a: A, b: B): [...A, ...B];
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 解压缩一个数据,我也不知道这个解压的是什么
* @param 要解压的内容,字符串
*/
decompress(value: string): any;
/**
- * @deprecated
+ * @deprecated 可能可使用,考虑换用 `GameStorage` 接口\
* 设置本地存储
* @param key 本地存储的名称
* @param value 本地存储的值,不填代表删除
@@ -82,7 +82,7 @@ interface Utils {
setLocalStorage(key: string, value?: any): void;
/**
- * @deprecated
+ * @deprecated 可能可使用,考虑换用 `GameStorage` 接口\
* 获得本地存储
* @param key 获取的本地存储的名称
* @param defaultValue 当不存在的时候的默认值
@@ -90,14 +90,14 @@ interface Utils {
getLocalStorage(key: string, defaultValue?: T): T;
/**
- * @deprecated
+ * @deprecated 可能可使用,考虑换用 `GameStorage` 接口\
* 移除本地存储
* @param key 要移除的本地存储的值
*/
removeLocalStorage(key: string): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 异步写入localforage
* @param key 写入的键
* @param value 写入的值
@@ -112,7 +112,7 @@ interface Utils {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 从localforage读出一段数据
*/
getLocalForage(
@@ -123,7 +123,7 @@ interface Utils {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 移除localforage的数据
*/
removeLocalForage(
@@ -133,14 +133,14 @@ interface Utils {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 清除localforage所有的数据
* @param callback 清除完毕的回调函数
*/
clearLocalForage(callback?: (err?: Error) => void): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 迭代localforage的数据
* @param iteratee 迭代器
* @param callback 迭代完毕的回调函数
@@ -151,14 +151,14 @@ interface Utils {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 获取localforage数据的所有的键
* @param callback 回调函数
*/
keysLocalForage(callback?: (err: any, keys: string[]) => void): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 获取localforage数据的数据量
* @param callback 回调函数
*/
@@ -167,7 +167,7 @@ interface Utils {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 设置一个全局存储,适用于global:xxx,录像播放时将忽略此函数。
* @example core.setBlobal('一周目已通关', true); // 设置全局存储“一周目已通关”为true,方便二周目游戏中的新要素。
* @param key 全局变量名称,支持中文
@@ -176,7 +176,7 @@ interface Utils {
setGlobal(key: string, value?: any): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 读取一个全局存储,适用于global:xxx,支持录像。
* @example if (core.getGlobal('一周目已通关', false) === true) core.getItem('dagger'); // 二周目游戏进行到此处时会获得一把屠龙匕首
* @param key 全局变量名称,支持中文
@@ -186,7 +186,7 @@ interface Utils {
getGlobal(key: string, defaultValue?: T): T;
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 `lodash-es` 库的 `cloneDeep` 接口或 js 的 `structuredClone` 接口,推荐前者\
* 深拷贝一个对象(函数将原样返回)
* @example core.clone(core.status.hero, (name, value) => (name == 'items' || typeof value == 'number'), false); // 深拷贝主角的属性和道具
* @param data 待拷贝对象
@@ -201,14 +201,14 @@ interface Utils {
): T;
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 js 的 `slice` 接口\
* 深拷贝一个1D或2D的数组
* @param data 要拷贝的数据
*/
cloneArray(data: T): T;
/**
- * @deprecated
+ * @deprecated 可能可使用,暂无替代接口\
* 等比例切分一张图片
* @example core.splitImage(core.material.images.images['npc48.png'], 32, 48); // 把npc48.png切分成若干32×48px的小人
* @param image 图片名(支持映射前的中文名)或图片对象(参见上面的例子),获取不到时返回[]
@@ -223,7 +223,7 @@ interface Utils {
): HTMLImageElement[];
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 格式化日期为字符串
* @param date 时间,不填代表当前时间
* @returns 格式: yyyy-mm-dd hh:mm:ss
@@ -231,7 +231,7 @@ interface Utils {
formatDate(date?: Date): string;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 格式化日期为最简字符串
* @param date 时间,不填代表当前时间
* @returns 格式: yyyymmddhhmmss
@@ -239,7 +239,7 @@ interface Utils {
formatDate2(date?: Date): string;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 格式化时间
* @param time 时间
* @returns 格式: hh:mm:ss
@@ -247,13 +247,13 @@ interface Utils {
formatTime(time: number): string;
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 js 的 `String.padStart` 接口\
* 设置成两位数显示,请使用setDigits代替
*/
setTwoDigits(x: number): string;
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 js 的 `String.padStart` 接口\
* 设置一个数为n位数显示
* @param x 要设置的数
* @param n 设置成的位数
@@ -261,7 +261,7 @@ interface Utils {
setDigits(x: number, n: number): string;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 格式化文件大小
* @param size 大小,字节数
* @returns 格式为xx.xxB KB MB
@@ -269,7 +269,7 @@ interface Utils {
formatSize(size: number): string;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 大数字格式化,单位为10000的倍数(w,e,z,j,g),末尾四舍五入
* @example core.formatBigNumber(123456789); // "12346w"
* @param x 原数字
@@ -278,19 +278,19 @@ interface Utils {
*/
formatBigNumber(x: T, onMap?: number): T;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
*/
formatBigNumber(x: number | string, onMap?: number | boolean): string;
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 `mutate-animate` 库\
* 变速移动,完全可以用mutate-animate代替
* @param mode 缓动模式
*/
applyEasing(mode?: EaseMode): (x: number) => number;
/**
- * @deprecated
+ * @deprecated 可使用,此接口应该不会被使用到\
* 颜色数组转十六进制
* @example core.arrayToRGB([102, 204, 255]); // "#66ccff",加载画面的宣传色
* @param color 一行三列的数组,各元素必须为不大于255的自然数
@@ -299,7 +299,7 @@ interface Utils {
arrayToRGB(color: RGBArray): _RGBA;
/**
- * @deprecated
+ * @deprecated 可使用,此接口应该不会被使用到\
* 颜色数组转字符串
* @example core.arrayToRGBA([102, 204, 255]); // "rgba(102,204,255,1)"
* @param color 一行三列或一行四列的数组,前三个元素必须为不大于255的自然数。
@@ -309,7 +309,7 @@ interface Utils {
arrayToRGBA(color: Color): _RGBA;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 录像一压,其结果会被再次base64压缩
* @example core.encodeRoute(core.status.route); // 一压当前录像
* @param route 原始录像,自定义内容(不予压缩,原样写入)必须由0-9A-Za-z和下划线、冒号组成,
@@ -319,7 +319,7 @@ interface Utils {
encodeRoute(route: string[]): string;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 录像解压的最后一步,即一压的逆过程
* @example core.decodeRoute(core.encodeRoute(core.status.route)); // 一压当前录像再解压-_-|
* @param route 录像解压倒数第二步的结果,即一压的结果
@@ -328,7 +328,7 @@ interface Utils {
decodeRoute(route: string): string[];
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 `lodash-es` 的 `isNil` 接口\
* 判断一个值是否不为null,undefined和NaN
* @example core.isset(0/0); // false,因为0/0等于NaN
* @param v 待测值
@@ -337,7 +337,7 @@ interface Utils {
isset(v?: any): boolean;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口,但此接口应该不会被使用到\
* 判定一个数组是否为另一个数组的前缀,用于录像接续播放
* @example core.subarray(['ad', '米库', '小精灵', '小破草', '小艾'], ['ad', '米库', '小精灵']); // ['小破草', '小艾']
* @param a 可能的母数组,不填或比b短将返回null
@@ -347,7 +347,7 @@ interface Utils {
subarray(a: any[], b: any[]): any[] | null;
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 js 的 `Array.includes` 接口\
* 判定array是不是一个数组,以及element是否在该数组中。使用Array.includes代替
* @param array 可能的数组,不为数组或不填将导致返回值为false
* @param element 待查找的元素
@@ -356,7 +356,7 @@ interface Utils {
inArray(array?: any, element?: any): boolean;
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 `lodash-es` 库的 `clamp` 接口\
* 将x限定在[a,b]区间内,注意a和b可交换
* @example core.clamp(1200, 1, 1000); // 1000
* @param x 原始值,!x为true时x一律视为0
@@ -366,13 +366,13 @@ interface Utils {
clamp(x: number, a: number, b: number): number;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 访问浏览器cookie
*/
getCookie(name: string): string;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 求字符串的国标码字节数,也可用于等宽字体下文本的宽度测算。请注意样板的默认字体Verdana不是等宽字体
* @example core.strlen('无敌ad'); // 6
* @param str 待测字符串
@@ -381,7 +381,7 @@ interface Utils {
strlen(str: string): number;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 计算应当转向某个方向
* @param turn 转向的方向
* @param direction 当前方向,不填视为当前方向
@@ -389,7 +389,7 @@ interface Utils {
turnDirection(turn: HeroTurnDir, direction?: Dir): string;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 通配符匹配,用于搜索图块等批量处理。
* @example core.playSound(core.matchWildcard('*Key', itemId) ? 'item.mp3' : 'door.mp3'); // 判断捡到的是钥匙还是别的道具,从而播放不同的音效
* @param pattern 模式串,每个星号表示任意多个(0个起)字符
@@ -399,7 +399,7 @@ interface Utils {
matchWildcard(pattern: string, string: string): boolean;
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 js 的 `/RegExp/.test(str)` 接口
* 是否满足正则表达式,一般可以直接用/RegExp/.test(str)代替
* @param pattern 正则表达式
* @param string 要匹配的字符串
@@ -407,7 +407,7 @@ interface Utils {
matchRegex(pattern: string, string: string): string;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* base64加密
* @example
* core.encodeBase64('If you found this note in a small wooden box with a heart on it');
@@ -418,7 +418,7 @@ interface Utils {
encodeBase64(str: string): string;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* base64解密
* @example
* core.decodeBase64('SWYgeW91IGZvdW5kIHRoaXMgbm90ZSBpbiBhIHNtYWxsIHdvb2RlbiBib3ggd2l0aCBhIGhlYXJ0IG9uIGl0');
@@ -429,7 +429,7 @@ interface Utils {
decodeBase64(str: string): string;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 不支持SL的随机数
* @exmaple 1 + core.rand(6); // 随机生成一个小于7的正整数,模拟骰子的效果
* @param num 填正数表示生成小于num的随机自然数,否则生成小于1的随机正数
@@ -438,7 +438,7 @@ interface Utils {
rand(num?: number): number;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 支持SL的随机数,并计入录像
* @exmaple 1 + core.rand2(6); // 随机生成一个小于7的正整数,模拟骰子的效果
* @param num 正整数,0或不填会被视为2147483648
@@ -447,7 +447,7 @@ interface Utils {
rand2(num?: number): number;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 尝试请求读取一个本地文件内容 [异步]
* @param success 成功后的回调
* @param error 失败后的回调
@@ -462,14 +462,14 @@ interface Utils {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 文件读取完毕后的内容处理 [异步]
* @param content 读取的内容
*/
readFileContent(content: string): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 弹窗请求下载一个文本文件
* @example core.download('route.txt', core.status.route); // 弹窗请求下载录像
* @param filename 文件名
@@ -478,14 +478,14 @@ interface Utils {
download(filename: string, content: string | string[]): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 尝试复制一段文本到剪切板
* @param data 赋值的东西
*/
copy(data: string): void;
/**
- * @deprecated
+ * @deprecated 可能可使用,考虑换用新渲染系统的 `getConfirm` 接口\
* 显示确认框,类似core.drawConfirmBox()
* @example core.myconfirm('重启游戏?', core.restart); // 弹窗询问玩家是否重启游戏
* @param hint 弹窗的内容
@@ -499,7 +499,7 @@ interface Utils {
): void;
/**
- * @deprecated
+ * @deprecated 可能可使用,考虑换用新渲染系统的 `getInput` 接口\
* 让用户输入一段文字
*/
myprompt(
@@ -509,8 +509,8 @@ interface Utils {
): void;
/**
- * @deprecated
- * 动画显示某对象,有vue了,你还用这个?Transition组件和css的transition比这个强得多
+ * @deprecated 可能可使用,此接口应该不会被使用到\
+ * 动画显示某对象
*/
showWithAnimate(
obj?: HTMLElement,
@@ -519,7 +519,7 @@ interface Utils {
): void;
/**
- * @deprecated
+ * @deprecated 可能可使用,此接口应该不会被使用到\
* 动画使某对象消失
*/
hideWithAnimate(
@@ -529,27 +529,27 @@ interface Utils {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 获得浏览器唯一的guid
*/
getGuid(): string;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 获取一个对象的哈希值
* @param obj 要获取的对象
*/
hashCode(obj: any): number;
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 `lodash-es` 库的 `isEqual` 接口\
* 判定深层相等, 会逐层比较每个元素
* @example core.same(['1', 2], ['1', 2]); // true
*/
same(a: any, b: any): boolean;
/**
- * @deprecated
+ * @deprecated 可使用,暂无替代接口\
* 解压一段内容
*/
unzip(
@@ -561,7 +561,7 @@ interface Utils {
): void;
/**
- * @deprecated
+ * @deprecated 可使用,考虑换用 js 的 `fetch` 接口\
* 发送一个HTTP请求 [异步]
* @param type 请求类型
* @param url 目标地址