Compare commits

...

3 Commits

Author SHA1 Message Date
吴 健赟
7fef0df1e6 docs:render/components 2025-09-23 11:22:49 +08:00
7cbe35e246 chore: 修复两个 eslint 报错 2025-09-23 10:41:51 +08:00
d1d6ebbdcb chore: 更新旧样板类型标注 2025-09-23 10:39:14 +08:00
28 changed files with 521 additions and 841 deletions

View File

@ -44,6 +44,7 @@ export class HeroKeyMover {
down: data[config?.down ?? 'moveDown']
};
// 静止时尝试启动移动
this.ticker.add(() => {
if (!this.moving) {
if (this.pressedKey.size > 0) {
@ -56,6 +57,10 @@ export class HeroKeyMover {
});
}
/**
*
* @param code
*/
private onPressKey = (code: KeyCode) => {
if (core.isReplaying() || !core.isPlaying()) return;
core.waitHeroToStop();
@ -65,6 +70,10 @@ export class HeroKeyMover {
else if (code === this.hotkeyData.down.key) this.press('down');
};
/**
*
* @param code
*/
private onReleaseKey = (code: KeyCode) => {
if (code === this.hotkeyData.left.key) this.release('left');
else if (code === this.hotkeyData.right.key) this.release('right');
@ -135,18 +144,26 @@ export class HeroKeyMover {
this.controller?.stop();
}
/**
*
*/
private onStepEnd = () => {
const con = this.controller;
if (!con) return;
// 被禁止操作时
if (core.status.lockControl) {
con.stop();
return;
}
// 未移动时
if (!this.moving) {
con.stop();
return;
}
// 尝试移动
if (this.pressedKey.size > 0) {
if (con.queue.length === 0) {
con.push({ type: 'dir', value: this.moveDir });

View File

@ -9,17 +9,29 @@ import { useKey } from '../use';
import { sleep } from 'mutate-animate';
export interface ConfirmBoxProps extends DefaultProps, TextContentProps {
/** 确认框的提示文本内容 */
text: string;
/** 确认框对话框的宽度 */
width: number;
/** 确认框对话框的位置 */
loc: ElementLocator;
/** 确认/取消按钮的字体样式 */
selFont?: Font;
/** 确认/取消按钮的文本颜色 */
selFill?: CanvasStyle;
/** 对话框内部所有元素的内边距 */
pad?: number;
/** 确认按钮的显示文本,默认为"确认" */
yesText?: string;
/** 取消按钮的显示文本,默认为"取消" */
noText?: string;
/** 窗口皮肤图片ID用于对话框背景绘制 */
winskin?: ImageIds;
/** 是否默认选中确认按钮 */
defaultYes?: boolean;
/** 对话框背景颜色,当未设置 winskin 时生效 */
color?: CanvasStyle;
/** 对话框边框颜色,当未设置 winskin 时生效 */
border?: CanvasStyle;
}
@ -198,21 +210,37 @@ export type ChoiceItem<T extends ChoiceKey = ChoiceKey> = [
];
export interface ChoicesProps extends DefaultProps, TextContentProps {
/** 选项数组 */
choices: ChoiceItem[];
/** 选择框对话框的位置 */
loc: ElementLocator;
/** 选择框对话框的宽度 */
width: number;
/** 选择框的最大高度,超过时将分页显示 */
maxHeight?: number;
/** 选择框的提示文本内容 */
text?: string;
/** 选择框的标题文本 */
title?: string;
/** 窗口皮肤图片ID用于对话框背景绘制 */
winskin?: ImageIds;
/** 对话框背景颜色,当未设置 winskin 时生效 */
color?: CanvasStyle;
/** 对话框边框颜色,当未设置 winskin 时生效 */
border?: CanvasStyle;
/** 选项文本的字体样式 */
selFont?: Font;
/** 选项文本的颜色 */
selFill?: CanvasStyle;
/** 标题文本的字体样式 */
titleFont?: Font;
/** 标题文本的颜色 */
titleFill?: CanvasStyle;
/** 对话框内部所有元素的内边距 */
pad?: number;
/** 选项之间的垂直间隔 */
interval?: number;
/** 默认选中的选项索引 */
selected?: number;
}

View File

@ -146,6 +146,7 @@ export const Input = defineComponent<InputProps, InputEmits, keyof InputEmits>(
const renderer = MotaRenderer.get('render-main');
const canvas = renderer?.getCanvas();
if (!canvas) return;
const chain: RenderItem[] = [];
let now: RenderItem | undefined = root.value;
if (!now) return;
@ -153,6 +154,8 @@ export const Input = defineComponent<InputProps, InputEmits, keyof InputEmits>(
chain.unshift(now);
now = now.parent;
}
// 应用内边距偏移.
const { clientLeft, clientTop } = canvas;
const trans = new Transform();
trans.translate(clientLeft, clientTop);
@ -163,8 +166,11 @@ export const Input = defineComponent<InputProps, InputEmits, keyof InputEmits>(
trans.multiply(item.transform);
}
trans.translate(padding.value, padding.value);
// 构建CSS transform的matrix字符串
const [a, b, , c, d, , e, f] = trans.mat;
const str = `matrix(${a},${b},${c},${d},${e},${f})`;
const w = width.value * core.domStyle.scale;
const h = height.value * core.domStyle.scale;
const font = props.font ?? Font.defaults();
@ -237,17 +243,29 @@ export const Input = defineComponent<InputProps, InputEmits, keyof InputEmits>(
);
export interface InputBoxProps extends TextContentProps {
/** 输入框对话框的位置 */
loc: ElementLocator;
/** 传递给内部 Input 组件的配置参数,用于自定义输入行为 */
input?: InputProps;
/** 窗口皮肤图片ID用于对话框背景绘制 */
winskin?: ImageIds;
/** 对话框背景颜色,当未设置 winskin 时生效 */
color?: CanvasStyle;
/** 对话框边框颜色,当未设置 winskin 时生效 */
border?: CanvasStyle;
/** 对话框内部所有元素的内边距 */
pad?: number;
/** 内部输入框区域的高度 */
inputHeight?: number;
/** 对话框顶部的提示文本 */
text?: string;
/** 确认按钮的显示文本,默认为"确认" */
yesText?: string;
/** 取消按钮的显示文本,默认为"取消" */
noText?: string;
/** 确认/取消按钮的字体样式 */
selFont?: Font;
/** 确认/取消按钮的文本颜色 */
selFill?: CanvasStyle;
}
@ -505,6 +523,11 @@ export function getInput(
/**
* `getInput` {@link getInput}
* @param controller UI
* @param text
* @param loc
* @param width
* @param props props {@link ConfirmBoxProps}
*/
export async function getInputNumber(
controller: IUIMountable,

View File

@ -54,6 +54,7 @@ export interface ScrollExpose {
export interface ScrollProps extends DefaultProps {
loc: ElementLocator;
hor?: boolean;
/** 是否不允许滚动 */
noscroll?: boolean;
/**
*

View File

@ -500,18 +500,28 @@ export const Textbox = defineComponent<
}, textboxOptions);
interface TextboxStoreEmits {
/** 结束打字机动画的回调函数 */
endType: () => void;
/** 隐藏文本框的回调函数 */
hide: () => void;
/** 显示文本框的回调函数 */
show: () => void;
/** 更新文本框配置的回调函数 */
update: (value: TextboxProps) => void;
/** 设置显示文本的回调函数 */
setText: (text: string) => void;
}
interface TextboxStoreEvent {
/** 文本框配置更新事件,传递更新后的配置值 */
update: [value: TextboxProps];
/** 文本框显示事件 */
show: [];
/** 文本框隐藏事件 */
hide: [];
/** 打字机开始打字事件 */
typeStart: [];
/** 打字机结束打字事件 */
typeEnd: [];
}

View File

@ -75,10 +75,15 @@ interface TyperConfig extends ITextContentConfig {
}
interface ParserStatus {
/** 画布填充描边样式 */
fillStyle: CanvasStyle;
/** 描边样式 */
fontFamily: string;
/** 字体大小 */
fontSize: number;
/** 是否斜体 */
fontItalic: boolean;
/** 字体粗细 */
fontWeight: number;
}

View File

@ -8,10 +8,15 @@ import { defineComponent, ref, watch } from 'vue';
import { SetupComponentOptions } from '@motajs/system-ui';
export interface ThumbnailProps extends SpriteProps {
/** 缩略图的位置 */
loc: ElementLocator;
/** 楼层 ID */
floorId: FloorIds;
/** 缩略图填充样式 */
padStyle?: CanvasStyle;
/** 楼层信息 */
map?: Block[];
/** 角色信息 */
hero?: HeroStatus;
// configs
damage?: boolean;

View File

@ -8,9 +8,13 @@ import { texture } from '../elements';
import { SetupComponentOptions } from '@motajs/system-ui';
export interface TipProps extends DefaultProps {
/** 显示的位置 */
loc: ElementLocator;
/** 边距 */
pad?: [number, number];
/** 圆角 */
corner?: number;
/** 显示的图标 */
id?: string;
}

View File

@ -133,7 +133,7 @@ export function patchBattle() {
// const enemy = getSingleEnemy(data.id as EnemyIds);
// todo: 与不在地图上的怪物战斗
} else {
if (data.floorId != core.status.floorId) {
if (data.floorId !== core.status.floorId) {
core.doAction();
return;
}
@ -246,7 +246,7 @@ export function patchBattle() {
} else core.drawHeroAnimate(animate);
// 如果已有事件正在处理中
if (core.status.event.id == null) core.continueAutomaticRoute();
if (isNil(core.status.event.id)) core.continueAutomaticRoute();
else core.clearContinueAutomaticRoute();
core.checkAutoEvents();

View File

@ -1,6 +1,7 @@
import { Patch, PatchClass } from '@motajs/legacy-common';
import { EnemyCollection, ensureFloorDamage } from '@user/data-state';
import { formatDamage } from '@user/data-utils';
import { isNil } from 'lodash-es';
export function patchDamage() {
const patch = new Patch(PatchClass.Control);
@ -13,7 +14,7 @@ export function patchDamage() {
) {
if (!floorId || core.status.gameOver || main.mode !== 'play')
return;
const onMap = ctx == null;
const onMap = isNil(ctx);
const floor = core.status.maps[floorId];
// 没有怪物手册
@ -49,7 +50,6 @@ export function patchDamage() {
function renderThumbnailDamage(col: EnemyCollection) {
core.status.damage.data = [];
core.status.damage.extraData = [];
core.status.damage.dir = [];
// 怪物伤害
col.list.forEach(v => {

View File

@ -402,6 +402,8 @@ importers:
packages-user/types: {}
packages/animate: {}
packages/client:
dependencies:
'@motajs/client-base':

View File

@ -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: '数据统计'
}
}
}

View File

@ -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: [],

View File

@ -1,4 +1,4 @@
///<reference path="../../types/declaration/core.d.ts" />
///<reference path="../../src/types/declaration/core.d.ts" />
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
];
}
}
};

View File

@ -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<K extends ActionKey>(

View File

@ -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<string, WeatherAction>;
@ -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 01
@ -465,7 +465,7 @@ interface Control {
nextX(n?: number): number;
/**
* @deprecated
* @deprecated 使\
* n格的纵坐标
* @example core.jumpHero(core.nextX(2), core.nextY(2)); // 主角向前跃过一格,即跳跃靴道具的使用效果
* @param n 01
@ -473,7 +473,7 @@ interface Control {
nextY(n?: number): number;
/**
* @deprecated
* @deprecated 使\
* 齿()
* @example core.nearHero(6, 6, 6); // 判定主角是否身处点66的半径为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<K extends keyof HeroStatus>(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<K extends keyof HeroStatus>(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<K extends keyof NumbericHeroStatus>(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<K extends keyof NumbericHeroStatus>(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<K extends keyof NumbericHeroStatus>(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<K extends keyof DiredLoc>(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<T>(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<BgmIds>, 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;

View File

@ -117,11 +117,13 @@ interface Material {
readonly images: MaterialImages;
/**
* @deprecated `BgmController` \
*
*/
readonly bgms: Record<BgmIds, HTMLAudioElement>;
/**
* @deprecated `SoundController` \
*
*/
readonly sounds: Record<SoundIds, AudioBuffer>;
@ -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<Tip>;
@ -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<number, AudioBufferSourceNode & { __name: string }>;
/**
*
*/
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<HTMLDivElement>;
/**
* @deprecated 使\
*
*/
tools: HTMLCollectionOf<HTMLImageElement>;
/**
* @deprecated 使\
*
*/
gameCanvas: HTMLCollectionOf<HTMLCanvasElement>;
/**
* @deprecated 使\
* <p><span>
*/
statusLabels: HTMLCollectionOf<HTMLSpanElement | HTMLParagraphElement>;
/**
* @deprecated 使\
* <p>
*/
statusText: HTMLCollectionOf<HTMLParagraphElement>;
/**
* @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优化下1013\*1333\*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<number, string>;
@ -693,13 +583,13 @@ interface Autosave {
storage: true;
/**
* @deprecated
* @deprecated 使使\
* 5raf时间戳
*/
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<string, HTMLImageElement>;
/**
* @deprecated 使\
*
*/
readonly image: Record<string, HTMLImageElement>;
} & {
/**
* @deprecated 使\
*/
readonly [key: string]: HTMLElement;
};
@ -917,19 +813,19 @@ interface Core extends Pick<Main, CoreDataFromMain> {
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<Main, CoreDataFromMain> {
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<MusicStatus>;
@ -969,13 +865,13 @@ interface Core extends Pick<Main, CoreDataFromMain> {
readonly platform: Readonly<CorePlatform>;
/**
* @deprecated
* @deprecated 使\
* dom样式
*/
readonly domStyle: Readonly<DomStyle>;
/**
* @deprecated
* @deprecated 使\
*
*/
readonly bigmap: CoreBigmap;
@ -996,7 +892,7 @@ interface Core extends Pick<Main, CoreDataFromMain> {
readonly initStatus: DeepReadonly<InitGameStatus>;
/**
* @deprecated
* @deprecated \
*
*/
readonly dymCanvas: Record<string, CanvasRenderingContext2D>;
@ -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<string, CanvasRenderingContext2D>;
@ -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<P>;
};
/**
*
*/
declare const plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1: PluginDeclaration;
interface Window {
core: CoreMixin;
/** @deprecated */
/** @deprecated 可使用,将会在 2.C 中有新接口 */
flags: Flags;
hero: HeroStatus;
}

View File

@ -79,7 +79,7 @@ interface FirstData {
title: string;
/**
* mota.config.ts中的一致
*
*/
name: string;

View File

@ -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或敌人对象

View File

@ -18,19 +18,19 @@ interface Events extends EventData {
eventdata: EventData;
/**
* @deprecated
* @deprecated 使\
*
*/
commonEvent: Record<EventDeclaration, MotaEvent>;
/**
* @deprecated
* @deprecated 使\
*
*/
systemEvent: Record<string, SystemEventFunc>;
/**
* @deprecated
* @deprecated 使\
*
*/
actions: Record<string, EventFunc>;
@ -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<ImageIds>): 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<TextAttribute>): 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 01
@ -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;

View File

@ -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<Exclude<Cls, 'enemys' | 'enemy48'>>,
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;
/**
*
*/

View File

@ -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

View File

@ -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<BgmIds>): void;
/**
* @deprecated
* @deprecated \
* bgm的缓存
* @param name bgm的id或名称
*/

View File

@ -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<DrawMapConfig>): 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<DrawMapConfig>): 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
*/

View File

@ -8,11 +8,6 @@ type CanParseCss = keyof {
: never]: CSSStyleDeclaration[P];
};
interface PluginDeclaration {
init(): void;
_afterLoadResouce(): void;
}
type Forward<T> = {
[K in keyof T as T[K] extends (...params: any) => any
? K extends `_${string}`

View File

@ -1,65 +1,3 @@
/**
* buff缓存
*/
interface EnemyBuffCache {
/**
*
*/
hp_buff: number;
/**
*
*/
atk_buff: number;
/**
*
*/
def_buff: number;
/**
*
*/
guards: [number, number, string][];
}
interface CheckBlockStatus {
/**
*
*/
ambush: Record<LocString, [number, number, string, Dir]>;
/**
*
*/
repulse: Record<LocString, [number, number, string, Dir]>;
/**
* 0
*/
damage: Record<LocString, number>;
/**
*
*/
needCache: boolean;
/**
*
*/
type: Record<LocString, Record<string, number>>;
/**
*
*/
cache: Record<string, DeepReadonly<EnemyBuffCache>>;
/**
*
*/
halo: Record<LocString, string[]>;
}
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<FloorIds, Record<LocString, Block>>;
/**
* @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<AutoEvent[]>;
/**
* @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<IdToNumber[AllIdsOf<'autotile'>]>[];
/**
* @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<CheckBlockStatus>;
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<ItemCls, 'items'>]: Record<ItemIdOf<P>, number>;
};
/**
*
*/
special: {
num: number[];
last: number[];
[k: string]: any;
};
buff: Partial<Record<keyof NumbericHeroStatus, number>>;
}

View File

@ -213,14 +213,14 @@ interface Ui {
uidata: UiData;
/**
* @deprecated
* @deprecated \
* contextnull
* 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 `<icon>` \
* 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` `<winskin>` \
* 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<T extends Exclude<ItemCls, 'items'>>(cls: T): ItemIdOf<T>[];
/**
* @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 styletrue
* @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;

View File

@ -1,19 +1,19 @@
/** 工具类 主要用来进行一些辅助函数的计算 */
interface Utils {
/**
* @deprecated
* @deprecated 使\
*
*/
readonly scan: DeepReadonly<Scan>;
/**
* @deprecated
* @deprecated 使\
*
*/
readonly scan2: DeepReadonly<Scan2>;
/**
* @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`
* ba的开头Array.unshift就行
* @example core.unshift(todo, {type: 'unfollow'}); // 在事件指令数组todo的开头插入“取消所有跟随者”指令
* @param a
@ -57,7 +57,7 @@ interface Utils {
unshift<A extends any[], B extends any[]>(a: A, b: B): [...B, ...A];
/**
* @deprecated
* @deprecated 使 js `Array.push`
* ba的末尾Array.push就行
* @example core.push(todo, {type: 'unfollow'}); // 在事件指令数组todo的末尾插入“取消所有跟随者”指令
* @param a
@ -67,14 +67,14 @@ interface Utils {
push<A extends any[], B extends any[]>(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<T>(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<T>(
@ -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<T>(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<T extends any[]>(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 使\
* 10000w,e,z,j,g
* @example core.formatBigNumber(123456789); // "12346w"
* @param x
@ -278,19 +278,19 @@ interface Utils {
*/
formatBigNumber<T extends string>(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` \
* nullundefined和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 02147483648
@ -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