diff --git a/packages-user/data-fallback/src/damage.ts b/packages-user/data-fallback/src/damage.ts index 82f20fa..878d414 100644 --- a/packages-user/data-fallback/src/damage.ts +++ b/packages-user/data-fallback/src/damage.ts @@ -49,7 +49,6 @@ export function patchDamage() { function renderThumbnailDamage(col: EnemyCollection) { core.status.damage.data = []; core.status.damage.extraData = []; - core.status.damage.dir = []; // 怪物伤害 col.list.forEach(v => { diff --git a/public/_server/table/functions.comment.js b/public/_server/table/functions.comment.js index 1d49e76..2f7dbfc 100644 --- a/public/_server/table/functions.comment.js +++ b/public/_server/table/functions.comment.js @@ -46,41 +46,6 @@ var functions_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { _type: 'textarea', _lint: true, _data: '楼层飞行' - }, - afterBattle: { - _leaf: true, - _type: 'textarea', - _lint: true, - _data: '战后脚本' - }, - afterOpenDoor: { - _leaf: true, - _type: 'textarea', - _lint: true, - _data: '开门后脚本' - }, - afterGetItem: { - _leaf: true, - _type: 'textarea', - _lint: true, - _data: '道具后脚本' - }, - afterPushBox: { - _leaf: true, - _type: 'textarea', - _lint: true, - _data: '推箱子后' - } - } - }, - actions: { - _type: 'object', - _data: { - onKeyUp: { - _leaf: true, - _type: 'textarea', - _lint: true, - _data: '按键处理' } } }, @@ -99,24 +64,12 @@ var functions_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { _lint: true, _data: '读档操作' }, - getStatusLabel: { - _leaf: true, - _type: 'textarea', - _lint: true, - _data: '状态名定义' - }, updateStatusBar: { _leaf: true, _type: 'textarea', _lint: true, _data: '更新状态栏' }, - updateCheckBlock: { - _leaf: true, - _type: 'textarea', - _lint: true, - _data: '阻激夹域伤害' - }, moveOneStep: { _leaf: true, _type: 'textarea', @@ -128,23 +81,6 @@ var functions_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { _type: 'textarea', _lint: true, _data: '瞬间移动' - }, - parallelDo: { - _leaf: true, - _type: 'textarea', - _lint: true, - _data: '并行脚本' - } - } - }, - ui: { - _type: 'object', - _data: { - drawStatistics: { - _leaf: true, - _type: 'textarea', - _lint: true, - _data: '数据统计' } } } diff --git a/public/libs/core.js b/public/libs/core.js index 35d8e0f..2fa2a8d 100644 --- a/public/libs/core.js +++ b/public/libs/core.js @@ -54,17 +54,6 @@ function core() { moveTime: 0, lastLegTime: 0, leftLeg: true, - weather: { - time: 0, - type: null, - level: 1, - nodes: [], - data: null, - fog: null, - cloud: null, - sun: null - }, - tip: null, asyncId: {}, lastAsyncId: null }; @@ -108,7 +97,7 @@ function core() { isVertical: false, showStatusBar: true, toolbarBtn: false, - hdCanvas: ['damage', 'ui', 'data'] + hdCanvas: [] }; this.bigmap = { canvas: [], diff --git a/public/project/functions.js b/public/project/functions.js index a416c7f..624acac 100644 --- a/public/project/functions.js +++ b/public/project/functions.js @@ -1,4 +1,4 @@ -/// +/// var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { events: { @@ -492,57 +492,5 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { } return false; } - }, - ui: { - drawStatistics: function () { - // 浏览地图时参与的统计项目 - - return [ - 'yellowDoor', - 'blueDoor', - 'redDoor', - 'greenDoor', - 'steelDoor', - 'yellowKey', - 'blueKey', - 'redKey', - 'greenKey', - 'steelKey', - 'redGem', - 'blueGem', - 'greenGem', - 'yellowGem', - 'redPotion', - 'bluePotion', - 'greenPotion', - 'yellowPotion', - 'superPotion', - 'pickaxe', - 'bomb', - 'centerFly', - 'icePickaxe', - 'freezeBadge', - 'earthquake', - 'upFly', - 'downFly', - 'jumpShoes', - 'lifeWand', - 'poisonWine', - 'weakWine', - 'curseWine', - 'superWine', - 'sword1', - 'sword2', - 'sword3', - 'sword4', - 'sword5', - 'shield1', - 'shield2', - 'shield3', - 'shield4', - 'shield5' - // 在这里可以增加新的ID来进行统计个数,只能增加道具ID - ]; - } } }; diff --git a/src/types/declaration/action.d.ts b/src/types/declaration/action.d.ts index 7ef7ab4..31b7d3d 100644 --- a/src/types/declaration/action.d.ts +++ b/src/types/declaration/action.d.ts @@ -94,7 +94,7 @@ interface Actions extends VoidedActionFuncs { }; /** - * @deprecated + * @deprecated 可使用,考虑使用 Hotkey 实现按键,使用 onClick 等实现点击\ * 此函数将注册一个用户交互行为。 * @param action 要注册的交互类型 * @param name 自定义名称,可被注销使用 @@ -109,7 +109,7 @@ interface Actions extends VoidedActionFuncs { ): void; /** - * @deprecated + * @deprecated 可使用,考虑使用 Hotkey 实现按键,使用 onClick 等实现点击\ * 注销一个用户交互行为 * @param action 要注销的交互类型 * @param name 要注销的自定义名称 @@ -117,7 +117,7 @@ interface Actions extends VoidedActionFuncs { unregisterAction(action: ActionKey, name: string): void; /** - * @deprecated + * @deprecated 可使用,考虑使用 Hotkey 实现按键,使用 onClick 等实现点击\ * 执行一个用户交互行为 */ doRegisteredAction( diff --git a/src/types/declaration/control.d.ts b/src/types/declaration/control.d.ts index 9576d0e..272aaee 100644 --- a/src/types/declaration/control.d.ts +++ b/src/types/declaration/control.d.ts @@ -193,7 +193,7 @@ interface Control { readonly noAutoEvent: boolean; /** - * @deprecated + * @deprecated 可使用,考虑换用 `Ticker` 类实现帧动画\ * 注册的帧动画 */ readonly renderFrameFunc: RenderFrame[]; @@ -204,13 +204,13 @@ interface Control { readonly replayActions: ReplayAction[]; /** - * @deprecated + * @deprecated 可使用,但是此行为一般不再会被用到\ * 注册的resize操作 */ readonly resizes: ResizeAction[]; /** - * @deprecated + * @deprecated 已失效,考虑使用新的 `WeatherController` 天气系统\ * 注册的天气 */ readonly weathers: Record; @@ -221,7 +221,7 @@ interface Control { readonly controldata: ControlData; /** - * @deprecated + * @deprecated 可使用,考虑换用 `Ticker` 接口实现帧动画\ * 注册一个animationFrame * @param name 名称,可用来作为注销使用 * @param needPlaying 是否只在游戏运行时才执行(在标题界面不执行) @@ -234,14 +234,14 @@ interface Control { ): void; /** - * @deprecated + * @deprecated 可使用,考虑换用 `Ticker` 接口实现帧动画\ * 注销一个animationFrame * @param name 要注销的函数名称 */ unregisterAnimationFrame(name: string): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 进入标题画面 * @example core.showStartAnimate(); // 重启游戏但不重置bgm * @param noAnimate 是否不由黑屏淡入而是立即亮屏 @@ -250,7 +250,7 @@ interface Control { showStartAnimate(noAnimate?: boolean, callback?: () => void): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 淡出标题画面 * @example core.hideStartAnimate(core.startGame); // 淡出标题画面并开始新游戏,跳过难度选择 * @param callback 标题画面完全淡出后的回调函数 @@ -301,26 +301,26 @@ interface Control { setAutomaticRoute(destX: number, destY: number, stepPostfix: Loc[]): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 连续行走 * @param steps 压缩的步伐数组,每项表示朝某方向走多少步 */ setAutoHeroMove(steps?: CompressedStep[]): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 设置行走的效果动画 */ setHeroMoveInterval(callback?: () => any): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 每移动一格后执行的函数 */ moveOneStep(callback?: () => any): void; /** - * @deprecated 尽量不要使用!!可以使用HeroMover来实现 + * @deprecated 可使用,考虑换用 `HeroMover` 接口\ * 尝试前进一步,如果面前不可被踏入就会直接触发该点事件 * @example core.moveAction(core.doAction); // 尝试前进一步,然后继续事件处理 * @param callback 走一步后的回调函数 @@ -328,7 +328,7 @@ interface Control { moveAction(callback?: () => void): void; /** - * @deprecated 尽量不要使用!!可以使用HeroMover来实现 + * @deprecated 可使用,考虑换用 `HeroMover` 接口\ * 向指定方向移动一格 * @example core.moveHero(); // 连续前进 * @param direction 移动的方向,不设置就是勇士当前的方向 @@ -337,13 +337,13 @@ interface Control { moveHero(direction?: Dir, callback?: () => void): void; /** - * @deprecated + * @deprecated 考虑换用 `HeroMover` 接口\ * 当前是否正在移动 */ isMoving(): boolean; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 停止勇士的一切行动并等待勇士停下 * @example core.waitHeroToStop(core.vibrate); // 等待勇士停下,然后视野左右抖动1秒 * @param callback 勇士停止后的回调函数 @@ -351,7 +351,7 @@ interface Control { waitHeroToStop(callback?: () => void, waitOnly?: boolean): void; /** - * @deprecated + * @deprecated 可使用,考虑换用 `HeroMover` 接口\ * 主角转向并计入录像,不会导致跟随者聚集,会导致视野重置到以主角为中心 * @example core.turnHero(); // 主角顺时针旋转,即单击主角或按下Z键的效果 * @param direction 主角的新朝向,可为up, down, left, right, :left, :right, :back七种之一,不填视为:right @@ -375,7 +375,7 @@ interface Control { tryMoveDirectly(destX: number, destY: number): boolean; /** - * @deprecated + * @deprecated 已失效,此接口已经不会再被使用到\ * 绘制主角和跟随者并重置视野到以主角为中心 * @example core.drawHero(); // 原地绘制主角的静止帧 * @param status 绘制状态 @@ -389,7 +389,7 @@ interface Control { ): void; /** - * @deprecated + * @deprecated 已失效,暂时没有替代接口\ * 改变勇士的不透明度 * @param opacity 要设置成的不透明度 * @param moveMode 动画的缓动模式 @@ -404,7 +404,7 @@ interface Control { ): void; /** - * @deprecated + * @deprecated 已失效,此接口已经不会再被使用到\ * 设置游戏系统画布的偏移量 * @param canvasId 字符串或数字,根据ts的说法应该只能填数字,但是浏览器会提高字符串的方式。 * 但是还是建议填数字,排列顺序一般是纵深从低到高排列 @@ -418,7 +418,7 @@ interface Control { ): void; /** - * @deprecated + * @deprecated 已失效,此接口已经不会再被使用到\ * 加减所有游戏系统画布的偏移 * @param x 增加的横坐标 * @param y 增加的纵坐标 @@ -426,13 +426,13 @@ interface Control { addGameCanvasTranslate(x: number, y: number): void; /** - * @deprecated + * @deprecated 已失效,此接口已经不会再被使用到\ * 更新大地图的可见区域 */ updateViewport(): void; /** - * @deprecated + * @deprecated 已失效,此接口已经不会再被使用到\ * 设置视野范围 * @param px 相对大地图左上角的偏移横坐标,单位像素 * @param py 相对大地图左上角的偏移纵坐标,单位像素 @@ -440,8 +440,8 @@ interface Control { setViewport(px?: number, py?: number): void; /** - * @deprecated - * 移动视野范围,这东西真的有人用吗...高级动画 + setViewport就完事了( + * @deprecated 已失效,此接口已经不会再被使用到\ + * 移动视野范围 * @param x 移动的横坐标,单位格子 * @param y 移动的纵坐标,单位格子 * @param moveMode 缓动方式 @@ -457,7 +457,7 @@ interface Control { ): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 获取主角面前第n格的横坐标 * @example core.closeDoor(core.nextX(), core.nextY(), 'yellowDoor', core.turnHero); // 在主角面前关上一扇黄门,然后主角顺时针旋转90° * @param n 目标格与主角的距离,面前为正数,背后为负数,脚下为0,不填视为1 @@ -465,7 +465,7 @@ interface Control { nextX(n?: number): number; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 获取主角面前第n格的纵坐标 * @example core.jumpHero(core.nextX(2), core.nextY(2)); // 主角向前跃过一格,即跳跃靴道具的使用效果 * @param n 目标格与主角的距离,面前为正数,背后为负数,脚下为0,不填视为1 @@ -473,7 +473,7 @@ interface Control { nextY(n?: number): number; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 判定主角是否身处某个点的锯齿领域(取曼哈顿距离) * @example core.nearHero(6, 6, 6); // 判定主角是否身处点(6,6)的半径为6的锯齿领域 * @param x 领域的中心横坐标 @@ -483,19 +483,19 @@ interface Control { nearHero(x: number, y: number, n?: number): boolean; /** - * @deprecated + * @deprecated 已失效,暂时没有替代接口\ * 立刻聚集所有的跟随者 */ gatherFollowers(): void; /** - * @deprecated + * @deprecated 已失效,暂时没有替代接口\ * 更新跟随者坐标 */ updateFollowers(): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 检查并执行领域、夹击、阻击事件 */ checkBlock(): void; @@ -509,7 +509,7 @@ interface Control { updateDamage(floorId?: FloorIds, ctx?: CtxRefer): void; /** - * @deprecated + * @deprecated 已失效,此接口已经不会再被使用\ * 重绘地图显伤 * @param ctx 绘制到的画布 */ @@ -669,7 +669,7 @@ interface Control { removeSave(index: number, callback?: () => void): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 设置主角的某个属性 * @example core.setStatus('loc', {x : 0, y : 0, direction : 'up'}); // 设置主角位置为地图左上角,脸朝上 * @param name 属性名 @@ -678,7 +678,7 @@ interface Control { setStatus(name: K, value: HeroStatus[K]): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 增减主角的某个属性,等价于core.setStatus(name, core.getStatus(name) + value) * @example core.addStatus('name', '酱'); // 在主角的名字后加一个“酱”字 * @param name 属性名 @@ -690,7 +690,7 @@ interface Control { ): void; /** - * @deprecated + * @deprecated 可使用,考虑换用 `getHeroStatusOn` 接口\ * 读取主角的某个属性,不包括百分比修正 * @example core.getStatus('loc'); // 读取主角的坐标和朝向 * @param name 属性名 @@ -699,7 +699,7 @@ interface Control { getStatus(name: K): HeroStatus[K]; /** - * @deprecated + * @deprecated 可使用,考虑换用 `getHeroStatusOn` 接口\ * 从status中获得属性,如果不存在则从勇士属性中获取 * @param status 要从中获取的属性对象 * @param name 属性名 @@ -710,7 +710,7 @@ interface Control { ): HeroStatus[K]; /** - * @deprecated + * @deprecated 可使用,考虑换用 `getHeroStatusOn` 接口\ * 计算主角的某个属性,包括百分比修正 * @example core.getRealStatus('atk'); // 计算主角的攻击力,包括百分比修正。战斗使用的就是这个值 * @param name 属性名,注意只能用于数值类属性 @@ -718,7 +718,7 @@ interface Control { getRealStatus(name: K): number; /** - * @deprecated + * @deprecated 可使用,考虑换用 `getHeroStatusOn` 接口\ * 从status中获得增幅后的属性,如果不存在则从勇士属性中获取 * @param status 要从中获取的属性对象 * @param name 属性名 @@ -729,14 +729,14 @@ interface Control { ): number; /** - * @deprecated + * @deprecated 已失效,暂时没有替代接口\ * 获得勇士原始属性(无装备和衰弱影响) * @param name 获取的属性名 */ getNakedStatus(name?: keyof NumbericHeroStatus): number; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 设置主角某个属性的百分比修正倍率,初始值为1, * 倍率存放在flag: `__${name}_${buff}__` 中 * @example core.setBuff('atk', 0.5); // 主角能发挥出的攻击力减半 @@ -746,7 +746,7 @@ interface Control { setBuff(name: K, value?: number): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 增减主角某个属性的百分比修正倍率,加减法叠加和抵消。等价于 core.setBuff(name, core.getBuff(name) + value) * @example core.addBuff('atk', -0.1); // 主角获得一层“攻击力减一成”的负面效果 * @param name 属性名,注意只能用于数值类属性 @@ -755,7 +755,7 @@ interface Control { addBuff(name: K, value: number): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 读取主角某个属性的百分比修正倍率,初始值为1 * @example core.getBuff('atk'); // 主角当前能发挥出多大比例的攻击力 * @param name 属性的英文名 @@ -763,7 +763,7 @@ interface Control { getBuff(name: keyof NumbericHeroStatus): number; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 设置勇士位置 * 值得注意的是,这句话虽然会使勇士改变位置,但并不会使界面重新绘制; * 如需立刻重新绘制地图还需调用:core.clearMap('hero'); core.drawHero(); 来对界面进行更新。 @@ -779,20 +779,20 @@ interface Control { setHeroLoc(name: 'direction', value: Dir, noGather?: boolean): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 获取主角的位置,朝向 * @example core.getHeroLoc(); // 获取主角的位置和朝向 * @param name 要读取横坐标还是纵坐标还是朝向还是都读取 */ getHeroLoc(): DiredLoc; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * @param name 要读取横坐标还是纵坐标还是朝向还是都读取 */ getHeroLoc(name: K): DiredLoc[K]; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 根据级别的数字获取对应的名称,后者定义在全塔属性 * @example core.getLvName(); // 获取主角当前级别的名称,如“下级佣兵” * @param lv 级别的数字,不填则视为主角当前的级别 @@ -801,7 +801,7 @@ interface Control { getLvName(lv?: number): string; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 获得下次升级需要的经验值。 * 升级扣除模式下会返回经验差值;非扣除模式下会返回总共需要的经验值。 * 如果无法进行下次升级,返回null。 @@ -809,7 +809,7 @@ interface Control { getNextLvUpNeed(): number | null; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 设置一个flag变量 * @example core.setFlag('poison', true); // 令主角中毒 * @param name 变量名,支持中文,这东西用中文就是不规范( @@ -818,7 +818,7 @@ interface Control { setFlag(name: string, value?: any): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 增减一个flag变量,等价于 core.setFlag(name, core.getFlag(name, 0) + value) * @example core.addFlag('hatred', 1); // 增加1点仇恨值 * @param name 变量名,支持中文 @@ -827,7 +827,7 @@ interface Control { addFlag(name: string, value: number | string): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 获取一个flag变量 * @param name 变量名,支持中文,这东西用中文就是不规范( * @param defaultValue 当变量不存在时的返回值,可选(事件流中默认填0)。 @@ -836,7 +836,7 @@ interface Control { getFlag(name: string, defaultValue?: T): T; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 判定一个flag变量是否不为falsy * @example core.hasFlag('poison'); // 判断主角当前是否中毒 * @param name 变量名,支持中文,这东西用中文就是不规范( @@ -844,14 +844,14 @@ interface Control { hasFlag(name: string): boolean; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 删除某个flag * @param name 要删除的变量名 */ removeFlag(name: string): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 设置某个独立开关 * @param x 横坐标 * @param y 纵坐标 @@ -868,7 +868,7 @@ interface Control { ): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 获得某个独立开关 * @param x 横坐标 * @param y 纵坐标 @@ -885,7 +885,7 @@ interface Control { ): T; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 增加某个独立开关 * @param x 横坐标 * @param y 纵坐标 @@ -902,7 +902,7 @@ interface Control { ): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 是否存在某个独立开关 * @param x 横坐标 * @param y 纵坐标 @@ -917,7 +917,7 @@ interface Control { ): boolean; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 删除某个独立开关 * @param x 横坐标 * @param y 纵坐标 @@ -932,16 +932,19 @@ interface Control { ): void; /** + * @deprecated 可使用,暂时没有替代接口\ * 锁定用户控制,常常用于事件处理 */ lockControl(): void; /** + * @deprecated 可使用,暂时没有替代接口\ * 解锁用户控制 */ unlockControl(): void; /** + * @deprecated 可能已失效,暂时没有替代接口\ * 开启调试模式, 此模式下可以按Ctrl键进行穿墙, 并忽略一切事件。 * 此模式下不可回放录像和上传成绩。 */ @@ -963,7 +966,7 @@ interface Control { getMappedName(name: string): string; /** - * @deprecated + * @deprecated 可使用,考虑换用新的 `WeatherController` 接口\ * 设置天气,不计入存档。如需长期生效请使用core.events._action_setWeather()函数 * @example core.setWeather('fog', 10); // 设置十级大雾天 * @param type 新天气的类型,不填视为无天气 @@ -972,7 +975,7 @@ interface Control { setWeather(type?: string, level?: WeatherLevel): void; /** - * @deprecated + * @deprecated 已失效,考虑换用新的 `WeatherController` 接口\ * 注册一个天气 * @param name 天气的名称 * @param initFunc 初始化函数 @@ -985,14 +988,14 @@ interface Control { ): void; /** - * @deprecated + * @deprecated 已失效,考虑换用新的 `WeatherController` 接口\ * 注销一个天气 * @param name 要注销的天气名称 */ unregisterWeather(name: string): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 更改画面色调,不计入存档。如需长期生效请使用core.events._action_setCurtain()函数 * @example core.setCurtain(); // 恢复画面色调,用时四分之三秒 * @param color 颜色数组,不填视为[0, 0, 0, 0] @@ -1008,7 +1011,7 @@ interface Control { ): void; /** - * @deprecated + * @deprecated 可能已失效,暂时没有替代接口\ * 画面闪烁 * @example core.screenFlash([255, 0, 0, 1], 3); // 红屏一闪而过 * @param color 颜色数组 @@ -1026,7 +1029,7 @@ interface Control { ): void; /** - * @deprecated + * @deprecated 可使用,考虑换用新的 `BgmController` 接口\ * 播放背景音乐,中途开播但不计入存档且只会持续到下次场景切换。如需长期生效请将背景音乐的文件名赋值给flags.__bgm__ * @example core.playBgm('bgm.mp3', 30); // 播放bgm.mp3,并跳过前半分钟 * @param bgm 背景音乐的文件名,支持全塔属性中映射前的中文名 @@ -1035,31 +1038,31 @@ interface Control { playBgm(bgm: BgmIds | NameMapIn, startTime?: number): void; /** - * @deprecated + * @deprecated 可使用,考虑换用新的 `BgmController` 接口\ * 暂停背景音乐的播放 */ pauseBgm(): void; /** - * @deprecated + * @deprecated 可使用,考虑换用新的 `BgmController` 接口\ * 恢复背景音乐的播放 */ resumeBgm(resumeTime?: number): void; /** - * @deprecated + * @deprecated 可使用,考虑换用新的 `BgmController` 接口\ * 设置音乐图标的开启关闭状态 */ setMusicBtn(): void; /** - * @deprecated + * @deprecated 可使用,考虑换用新的 `BgmController` 接口\ * 开启或关闭背景音乐的播放 */ triggerBgm(): void; /** - * @deprecated + * @deprecated 可使用,考虑换用新的 `SoundController` 接口\ * 播放一个音效 * @param sound 音效名 * @param pitch 音调,同时会修改播放速度,100为原速 @@ -1077,39 +1080,39 @@ interface Control { ): number; /** - * @deprecated + * @deprecated 可使用,考虑换用新的 `SoundController` 接口\ * 停止音频 * @param id 停止的音频标识符,不填则停止所有 */ stopSound(id?: number): void; /** - * @deprecated + * @deprecated 已失效,考虑换用新的 `SoundController` 接口\ * 获得正在播放的所有音效的id列表 */ getPlayingSounds(): number[]; /** - * @deprecated + * @deprecated 可使用,考虑换用新的 `BgmController` 接口\ * 检查bgm状态,没有播放的话就播放 */ checkBgm(): void; /** - * @deprecated + * @deprecated 可能已失效,考虑换用 `MotaRenderer.setScale` 接口\ * 设置屏幕放缩 * @param delta 在所有可用放缩数组中增加的下标数 */ setDisplayScale(delta: number): void; /** - * @deprecated + * @deprecated 可能已失效,此接口已经不会被使用到\ * 清空状态栏 */ clearStatusBar(): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 更新状态栏和地图显伤,会在下一个动画帧更新 * @param doNotCheckAutoEvents 是否不检查自动事件 * @param immediate 是否立刻刷新,而非延迟到下一动画帧刷新 @@ -1117,27 +1120,27 @@ interface Control { updateStatusBar(doNotCheckAutoEvents?: boolean, immediate?: boolean): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 显示状态栏 */ showStatusBar(): void; /** - * @deprecated + * @deprecated 可使用,暂时没有替代接口\ * 隐藏状态栏 * @param showToolbox 是否显示工具栏 */ hideStatusBar(showToolbox?: boolean): void; /** - * @deprecated + * @deprecated 已失效,此接口已经不会被使用到\ * 改变工具栏为按钮1-8 * @param useButton 是否显示为按钮1-8 */ setToolbarButton(useButton?: boolean): void; /** - * @deprecated + * @deprecated 可使用,此接口已经不会被使用到\ * 注册一个resize函数 * @param name 名称,可供注销使用 * @param func 游戏画面发生变化时执行的函数 @@ -1145,13 +1148,13 @@ interface Control { registerResize(name: string, func: ResizeFunc): void; /** - * @deprecated + * @deprecated 可使用,此接口已经不会被使用到\ * 注销一个resize函数 */ unregisterResize(name: string): void; /** - * @deprecated + * @deprecated 可使用,此接口已经不会被使用到\ * 屏幕分辨率改变后执行的函数 */ resize(): void; diff --git a/src/types/declaration/core.d.ts b/src/types/declaration/core.d.ts index eceace2..a5e1bd8 100644 --- a/src/types/declaration/core.d.ts +++ b/src/types/declaration/core.d.ts @@ -117,11 +117,13 @@ interface Material { readonly images: MaterialImages; /** + * @deprecated 可能已失效,考虑换用 `BgmController` 接口\ * 音乐信息 */ readonly bgms: Record; /** + * @deprecated 可能已失效,考虑换用 `SoundController` 接口\ * 音效信息 */ readonly sounds: Record; @@ -153,16 +155,19 @@ interface Material { readonly ground: CanvasRenderingContext2D; /** + * @deprecated 已失效,此接口已经不会再被用到\ * 楼层背景的画布context */ readonly groundCanvas: CanvasRenderingContext2D; /** + * @deprecated 已失效,此接口已经不会再被用到\ * 楼层背景的canvas样式 */ readonly groundPattern: CanvasPattern; /** + * @deprecated 已失效,此接口已经不会再被用到\ * 自动元件的父子关系 */ readonly autotileEdges: Record< @@ -218,6 +223,7 @@ interface AnimateFrame { globalAnimate: boolean; /** + * @deprecated 可使用,此接口已经不会再被用到\ * 当前raf的时间戳,即从游戏加载完毕到现在经过的时间 */ readonly globalTime: number; @@ -240,7 +246,7 @@ interface AnimateFrame { readonly animateTime: number; /** - * @deprecated + * @deprecated 已失效,此接口已经不会再被用到\ * 勇士移动的时候上一次的换腿时间 */ moveTime: number; @@ -252,18 +258,19 @@ interface AnimateFrame { lastLegTime: number; /** - * @deprecated + * @deprecated 已失效,此接口已经不会再被用到\ * 当前是否在左腿上,使用了四帧插件时无效 */ leftLeg: boolean; /** - * @deprecated + * @deprecated 已失效,考虑换用 `WeatherController` 接口\ * 当前天气信息 */ readonly weather: Weather; /** + * @deprecated 已失效,考虑换用 `WeatherController` 接口\ * 左上角提示 */ readonly tip?: Readonly; @@ -279,156 +286,11 @@ interface AnimateFrame { lastAsyncId: number; } -interface Weather { - /** - * 当前的raf时间戳,同globalTime,但只有部分天气有用 - */ - time: number; +interface Weather {} - /** - * 当前天气类型 - */ - type: string; +interface Tip {} - /** - * 谁会去用这个玩意??? - */ - nodes: any[]; - - /** - * 谁会去用这个玩意??? - */ - data: any; - - /** - * 当前的天气等级 - */ - readonly level: number; - - /** - * 雾的图片信息 - */ - readonly fog: HTMLImageElement; - - /** - * 多云的图片信息 - */ - readonly cloud: HTMLImageElement; - - /** - * 晴天的图片信息 - */ - readonly sun: HTMLImageElement; -} - -interface Tip { - /** - * 显示的文字 - */ - text: string; - - /** - * 文字的左边像素位置 - */ - textX: 21 | 45; - - /** - * 提示的宽度 - */ - width: number; - - /** - * 当前的不透明度,会在显示提示时不断变化 - */ - opacity: number; - - /** - * 在显示阶段还是常亮阶段还是消失阶段 - */ - stage: number; - - /** - * 图标的帧数,即显示图标的第几帧 - */ - frame: number; - - /** - * 当前的raf时间戳 - */ - time: number; - - /** - * 在提示进入常亮阶段后经过了多长时间 - */ - displayTime: number; -} - -interface MusicStatus { - /** - * AudioContext信息,注意如果浏览器不支持的话会是null - */ - audioContext: AudioContext; - - /** - * 是否允许播放BGM - */ - bgmStatus: boolean; - - /** - * 是否允许播放SE - */ - soundStatus: boolean; - - /** - * 正在播放的BGM - */ - playingBgm: string; - - /** - * 上次播放的bgm - */ - lastBgm: string; - - /** - * 音量控制节点,只对音效有效,但为什么样板只有一个呢 - */ - gainNode: GainNode; - - /** - * 正在播放的SE,这个__name是音效名 - */ - playingSounds: Record; - - /** - * 用户音量 - */ - userVolume: number; - - /** - * 设计音量,好吧其实不能设计,只有淡入淡出的时候有用 - */ - designVolume: number; - - /** - * 音乐播放速度 - */ - bgmSpeed: number; - - /** - * 修改音乐播放速度时是否修改音调 - */ - bgmUsePitch: boolean; - - /** - * 缓存过BGM内容 - */ - cachedBgms: string[]; - - /** - * 缓存的bgm数量 - */ - cachedBgmCount: 8; -} +interface MusicStatus {} interface CorePlatform { /** @@ -507,60 +369,74 @@ interface CorePlatform { */ type MainDom = { /** + * @deprecated 已失效,此接口已经不会再被使用到\ * 所有的状态信息 */ status: HTMLCollectionOf; /** + * @deprecated 已失效,此接口已经不会再被使用到\ * 所有的工具栏图片 */ tools: HTMLCollectionOf; /** + * @deprecated 已失效,此接口已经不会再被使用到\ * 所有的游戏画布 */ gameCanvas: HTMLCollectionOf; /** + * @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 目标地址