refactor: 修复所有问题

This commit is contained in:
unanmed 2025-03-09 22:13:53 +08:00
parent 74f0386fd9
commit 5c520e3d52
68 changed files with 1230 additions and 1077 deletions

View File

@ -3,9 +3,11 @@ import { OpusDecoder, VorbisDecoder } from './decoder';
import { AudioType } from './support'; import { AudioType } from './support';
import { AudioDecoder } from './decoder'; import { AudioDecoder } from './decoder';
loadAllBgm(); export function createAudio() {
AudioDecoder.registerDecoder(AudioType.Ogg, VorbisDecoder); loadAllBgm();
AudioDecoder.registerDecoder(AudioType.Opus, OpusDecoder); AudioDecoder.registerDecoder(AudioType.Ogg, VorbisDecoder);
AudioDecoder.registerDecoder(AudioType.Opus, OpusDecoder);
}
export * from './support'; export * from './support';
export * from './effect'; export * from './effect';

View File

@ -51,5 +51,3 @@ isAudioSupport(AudioType.Wav);
isAudioSupport(AudioType.Flac); isAudioSupport(AudioType.Flac);
isAudioSupport(AudioType.Opus); isAudioSupport(AudioType.Opus);
isAudioSupport(AudioType.Aac); isAudioSupport(AudioType.Aac);
console.log(supportMap);

View File

@ -1,4 +1,3 @@
import { Patch } from '@motajs/legacy-common';
import { patchAudio } from './audio'; import { patchAudio } from './audio';
import { patchWeather } from './weather'; import { patchWeather } from './weather';
import { patchUI } from './ui'; import { patchUI } from './ui';

View File

@ -1,6 +1,16 @@
import { loading } from '@user/data-base';
import { createAudio } from './audio';
import { patchAll } from './fallback'; import { patchAll } from './fallback';
import { createGameRenderer, createRender } from './render';
patchAll(); export function create() {
createAudio();
patchAll();
createRender();
loading.once('coreInit', () => {
createGameRenderer();
});
}
export * from './action'; export * from './action';
export * from './weather'; export * from './weather';

View File

@ -22,8 +22,6 @@ import {
import { IDamageEnemy, IEnemyCollection, MapDamage } from '@motajs/types'; import { IDamageEnemy, IEnemyCollection, MapDamage } from '@motajs/types';
import { UserEnemyInfo } from '@user/data-state'; import { UserEnemyInfo } from '@user/data-state';
const { ensureFloorDamage } = Mota.require('@user/data-state');
/** /**
* *
* @param damage * @param damage
@ -59,6 +57,7 @@ export class FloorDamageExtends
if (!this.sprite || !floor) return; if (!this.sprite || !floor) return;
const map = core.status.maps[floor]; const map = core.status.maps[floor];
this.sprite.setMapSize(map.width, map.height); this.sprite.setMapSize(map.width, map.height);
const { ensureFloorDamage } = Mota.require('@user/data-state');
ensureFloorDamage(floor); ensureFloorDamage(floor);
const enemy = core.status.maps[floor].enemy; const enemy = core.status.maps[floor].enemy;
@ -79,6 +78,7 @@ export class FloorDamageExtends
private onUpdate = (floor: FloorIds) => { private onUpdate = (floor: FloorIds) => {
if (!this.floorBinder.bindThisFloor) { if (!this.floorBinder.bindThisFloor) {
const { ensureFloorDamage } = Mota.require('@user/data-state');
ensureFloorDamage(floor); ensureFloorDamage(floor);
core.status.maps[floor].enemy.calRealAttribute(); core.status.maps[floor].enemy.calRealAttribute();
} }

View File

@ -4,8 +4,11 @@ import { UIController } from '@motajs/system-ui';
import { mainSceneUI } from './ui/main'; import { mainSceneUI } from './ui/main';
import { MAIN_HEIGHT, MAIN_WIDTH } from './shared'; import { MAIN_HEIGHT, MAIN_WIDTH } from './shared';
import { hook } from '@user/data-base'; import { hook } from '@user/data-base';
import { createItemDetail } from './itemDetail';
import { createLoopMap } from './loopMap';
import { createGameCanvas } from './legacy/gameCanvas';
export function create() { export function createGameRenderer() {
const main = new MotaRenderer(); const main = new MotaRenderer();
main.size(MAIN_WIDTH, MAIN_HEIGHT); main.size(MAIN_WIDTH, MAIN_HEIGHT);
@ -34,6 +37,12 @@ export function create() {
console.log(main); console.log(main);
} }
export function createRender() {
createGameCanvas();
createItemDetail();
createLoopMap();
}
export * from './components'; export * from './components';
export * from './ui'; export * from './ui';
export * from './use'; export * from './use';

View File

@ -21,11 +21,13 @@ interface ItemData {
y: number; y: number;
} }
hook.on('setBlock', (x, y, floorId, block) => { export function createItemDetail() {
FloorItemDetail.listened.forEach(v => { hook.on('setBlock', (x, y, floorId, block) => {
v.setBlock(block, x, y); FloorItemDetail.listened.forEach(v => {
v.setBlock(block, x, y);
});
}); });
}); }
export class FloorItemDetail implements ILayerGroupRenderExtends { export class FloorItemDetail implements ILayerGroupRenderExtends {
id: string = 'item-detail'; id: string = 'item-detail';

View File

@ -12,15 +12,19 @@ function getCanvasFilterByFloorId(floorId: FloorIds = core.status.floorId) {
return filterMap.find(v => v[0].includes(floorId))?.[1] ?? ''; return filterMap.find(v => v[0].includes(floorId))?.[1] ?? '';
} }
loading.once('coreInit', () => { export function createGameCanvas() {
filterMap.push( loading.once('coreInit', () => {
[['MT50', 'MT60', 'MT61'], 'contrast(120%)'], // 童心佬的滤镜( filterMap.push(
[ [['MT50', 'MT60', 'MT61'], 'contrast(120%)'], // 童心佬的滤镜(
core.floorIds.slice(61, 70).concat(core.floorIds.slice(72, 107)), [
'contrast(120%)' core.floorIds
] // 童心佬的滤镜( .slice(61, 70)
); .concat(core.floorIds.slice(72, 107)),
}); 'contrast(120%)'
] // 童心佬的滤镜(
);
});
}
export class LayerGroupFilter implements ILayerGroupRenderExtends { export class LayerGroupFilter implements ILayerGroupRenderExtends {
id: string = 'filter'; id: string = 'filter';

View File

@ -18,9 +18,11 @@ let show: boolean = false;
/** 循环式地图中更新视角的委托ticker */ /** 循环式地图中更新视角的委托ticker */
let delegation: number = -1; let delegation: number = -1;
hook.on('changingFloor', (floorId, heroLoc) => { export function createLoopMap() {
enableLoopMapElement(floorId); hook.on('changingFloor', (floorId, heroLoc) => {
}); enableLoopMapElement(floorId);
});
}
function createLayer() { function createLayer() {
const group = new LayerGroup(); const group = new LayerGroup();

View File

@ -7,6 +7,9 @@ interface GameLoadEvent {
autotileLoaded: []; autotileLoaded: [];
coreInit: []; coreInit: [];
loaded: []; loaded: [];
registered: [];
dataRegistered: [];
clientRegistered: [];
} }
class GameLoading extends EventEmitter<GameLoadEvent> { class GameLoading extends EventEmitter<GameLoadEvent> {
@ -58,6 +61,25 @@ class GameLoading extends EventEmitter<GameLoadEvent> {
} }
export const loading = new GameLoading(); export const loading = new GameLoading();
main.loading = loading;
let clientRegistered = false;
let dataRegistered = false;
function checkRegistered() {
if (clientRegistered && dataRegistered) {
loading.emit('registered');
}
}
loading.once('clientRegistered', () => {
clientRegistered = true;
checkRegistered();
});
loading.once('dataRegistered', () => {
dataRegistered = true;
checkRegistered();
});
export interface GameEvent { export interface GameEvent {
/** Emitted in libs/events.js resetGame. */ /** Emitted in libs/events.js resetGame. */

View File

@ -18,6 +18,7 @@ export interface CurrentEnemy {
export function patchBattle() { export function patchBattle() {
const patch = new Patch(PatchClass.Enemys); const patch = new Patch(PatchClass.Enemys);
const patch2 = new Patch(PatchClass.Events);
patch.add('canBattle', function (x, y, floorId) { patch.add('canBattle', function (x, y, floorId) {
const enemy = typeof x === 'number' ? getEnemy(x, y!, floorId) : x; const enemy = typeof x === 'number' ? getEnemy(x, y!, floorId) : x;
@ -31,7 +32,7 @@ export function patchBattle() {
return damage < core.status.hero.hp; return damage < core.status.hero.hp;
}); });
core.events.battle = function battle( function battle(
x: number | DamageEnemy, x: number | DamageEnemy,
y: number, y: number,
force: boolean = false, force: boolean = false,
@ -59,7 +60,7 @@ export function patchBattle() {
// 战后事件 // 战后事件
core.afterBattle(enemy, isLoc ? x : enemy.x, y); core.afterBattle(enemy, isLoc ? x : enemy.x, y);
callback?.(); callback?.();
}; }
const getFacedId = (enemy: DamageEnemy) => { const getFacedId = (enemy: DamageEnemy) => {
const e = enemy.enemy; const e = enemy.enemy;
@ -69,9 +70,7 @@ export function patchBattle() {
return e.id; return e.id;
}; };
core.enemys.getCurrentEnemys = function getCurrentEnemys( patch.add('getCurrentEnemys', function (floorId = core.status.floorId) {
floorId = core.status.floorId
) {
floorId = floorId || core.status.floorId; floorId = floorId || core.status.floorId;
const enemys: CurrentEnemy[] = []; const enemys: CurrentEnemy[] = [];
const used: Record<string, DamageEnemy[]> = {}; const used: Record<string, DamageEnemy[]> = {};
@ -100,9 +99,9 @@ export function patchBattle() {
const bd = b.enemy.calDamage().damage; const bd = b.enemy.calDamage().damage;
return ad - bd; return ad - bd;
}); });
}; });
core.events._sys_battle = function (data: Block, callback?: () => void) { patch2.add('_sys_battle', function (data: Block, callback?: () => void) {
// 检查战前事件 // 检查战前事件
const floor = core.floors[core.status.floorId]; const floor = core.floors[core.status.floorId];
const beforeBattle: MotaEvent = []; const beforeBattle: MotaEvent = [];
@ -126,11 +125,11 @@ export function patchBattle() {
core.insertAction(beforeBattle, data.x, data.y, callback); core.insertAction(beforeBattle, data.x, data.y, callback);
} }
} else { } else {
core.battle(data.x, data.y, false, callback); battle(data.x, data.y, false, callback);
} }
}; });
core.events._action_battle = function (data, x, y, prefix) { patch2.add('_action_battle', function (data, x, y, prefix) {
if (data.id) { if (data.id) {
const enemy = getSingleEnemy(data.id as EnemyIds); const enemy = getSingleEnemy(data.id as EnemyIds);
// todo: 与不在地图上的怪物战斗 // todo: 与不在地图上的怪物战斗
@ -139,118 +138,123 @@ export function patchBattle() {
core.doAction(); core.doAction();
return; return;
} }
const [ex, ey] = this.__action_getLoc( const [ex, ey] = core.events.__action_getLoc(
data.loc, data.loc,
x, x,
y, y,
prefix prefix
) as LocArr; ) as LocArr;
core.battle(ex, ey, true, core.doAction); battle(ex, ey, true, core.doAction);
} }
}; });
core.events.afterBattle = function afterBattle( patch2.add(
enemy: DamageEnemy, 'afterBattle',
x?: number, function (enemy: DamageEnemy, x?: number, y?: number) {
y?: number const floorId = core.status.floorId;
) { const special = enemy.info.special;
const floorId = core.status.floorId;
const special = enemy.info.special;
// 播放战斗动画 // 播放战斗动画
let animate: AnimationIds = 'hand'; let animate: AnimationIds = 'hand';
// 检查当前装备是否存在攻击动画 // 检查当前装备是否存在攻击动画
const equipId = core.getEquip(0); const equipId = core.getEquip(0);
if (equipId && (core.material.items[equipId].equip || {}).animate) if (equipId && (core.material.items[equipId].equip || {}).animate)
animate = core.material.items[equipId].equip.animate; animate = core.material.items[equipId].equip.animate;
// 检查该动画是否存在SE如果不存在则使用默认音效 // 检查该动画是否存在SE如果不存在则使用默认音效
if (!core.material.animates[animate]?.se) core.playSound('attack.opus'); if (!core.material.animates[animate]?.se)
core.playSound('attack.opus');
// 战斗伤害 // 战斗伤害
const info = enemy.calDamage(core.status.hero); const info = enemy.calDamage(core.status.hero);
const damage = info.damage; const damage = info.damage;
// 判定是否致死 // 判定是否致死
if (damage >= core.status.hero.hp) { if (damage >= core.status.hero.hp) {
core.status.hero.hp = 0; core.status.hero.hp = 0;
core.updateStatusBar(false, true); core.updateStatusBar(false, true);
core.events.lose('战斗失败'); core.events.lose('战斗失败');
return; return;
}
// 扣减体力值并记录统计数据
core.status.hero.hp -= damage;
core.status.hero.statistics.battleDamage += damage;
core.status.hero.statistics.battle++;
// 智慧之源
if (special.has(14) && flags.hard === 2) {
core.addFlag(
'inte_' + floorId,
Math.ceil((core.status.hero.mdef / 10) * 0.3) * 10
);
core.status.hero.mdef -=
Math.ceil((core.status.hero.mdef / 10) * 0.3) * 10;
}
// 极昼永夜
if (special.has(22)) {
NightSpecial.addNight(floorId, -enemy.info.night!);
}
if (special.has(23)) {
NightSpecial.addNight(floorId, enemy.info.day!);
}
// 如果是融化怪,需要特殊标记一下
if (special.has(25) && !isNil(x) && !isNil(y)) {
flags[`melt_${floorId}`] ??= {};
flags[`melt_${floorId}`][`${x},${y}`] = enemy.info.melt;
}
// 获得金币
const money = enemy.info.money!;
core.status.hero.money += money;
core.status.hero.statistics.money += money;
// 获得经验
const exp = enemy.info.exp!;
core.status.hero.exp += exp;
core.status.hero.statistics.exp += exp;
const hint =
'打败 ' +
enemy.enemy.name +
',金币+' +
money +
',经验+' +
exp;
core.drawTip(hint, enemy.id);
HeroSkill.disableSkill();
// 事件的处理
const todo: MotaEvent = [];
// 战后事件
if (!isNil(core.status.floorId)) {
const loc = `${x},${y}` as LocString;
todo.push(
...(core.floors[core.status.floorId].afterBattle[loc] ?? [])
);
}
todo.push(...(enemy.enemy.afterBattle ?? []));
// 如果事件不为空,将其插入
if (todo.length > 0) core.insertAction(todo, x, y);
if (!isNil(x) && !isNil(y)) {
core.drawAnimate(animate, x, y);
core.removeBlock(x, y);
} else core.drawHeroAnimate(animate);
// 如果已有事件正在处理中
if (core.status.event.id == null) core.continueAutomaticRoute();
else core.clearContinueAutomaticRoute();
core.checkAutoEvents();
hook.emit('afterBattle', enemy, x, y);
} }
);
// 扣减体力值并记录统计数据
core.status.hero.hp -= damage;
core.status.hero.statistics.battleDamage += damage;
core.status.hero.statistics.battle++;
// 智慧之源
if (special.has(14) && flags.hard === 2) {
core.addFlag(
'inte_' + floorId,
Math.ceil((core.status.hero.mdef / 10) * 0.3) * 10
);
core.status.hero.mdef -=
Math.ceil((core.status.hero.mdef / 10) * 0.3) * 10;
}
// 极昼永夜
if (special.has(22)) {
NightSpecial.addNight(floorId, -enemy.info.night!);
}
if (special.has(23)) {
NightSpecial.addNight(floorId, enemy.info.day!);
}
// 如果是融化怪,需要特殊标记一下
if (special.has(25) && !isNil(x) && !isNil(y)) {
flags[`melt_${floorId}`] ??= {};
flags[`melt_${floorId}`][`${x},${y}`] = enemy.info.melt;
}
// 获得金币
const money = enemy.info.money!;
core.status.hero.money += money;
core.status.hero.statistics.money += money;
// 获得经验
const exp = enemy.info.exp!;
core.status.hero.exp += exp;
core.status.hero.statistics.exp += exp;
const hint =
'打败 ' + enemy.enemy.name + ',金币+' + money + ',经验+' + exp;
core.drawTip(hint, enemy.id);
HeroSkill.disableSkill();
// 事件的处理
const todo: MotaEvent = [];
// 战后事件
if (!isNil(core.status.floorId)) {
const loc = `${x},${y}` as LocString;
todo.push(
...(core.floors[core.status.floorId].afterBattle[loc] ?? [])
);
}
todo.push(...(enemy.enemy.afterBattle ?? []));
// 如果事件不为空,将其插入
if (todo.length > 0) core.insertAction(todo, x, y);
if (!isNil(x) && !isNil(y)) {
core.drawAnimate(animate, x, y);
core.removeBlock(x, y);
} else core.drawHeroAnimate(animate);
// 如果已有事件正在处理中
if (core.status.event.id == null) core.continueAutomaticRoute();
else core.clearContinueAutomaticRoute();
core.checkAutoEvents();
hook.emit('afterBattle', enemy, x, y);
};
} }
loading.once('coreInit', patchBattle); loading.once('coreInit', patchBattle);

View File

@ -18,8 +18,11 @@ import * as ClientModules from '@user/client-modules';
import * as LegacyPluginClient from '@user/legacy-plugin-client'; import * as LegacyPluginClient from '@user/legacy-plugin-client';
import * as MutateAnimate from 'mutate-animate'; import * as MutateAnimate from 'mutate-animate';
import * as Vue from 'vue'; import * as Vue from 'vue';
import { hook, loading } from '@user/data-base';
export function create() { export function create() {
loading.once('registered', createModule);
Mota.register('@motajs/client', Client); Mota.register('@motajs/client', Client);
Mota.register('@motajs/client-base', ClientBase); Mota.register('@motajs/client-base', ClientBase);
Mota.register('@motajs/common', Common); Mota.register('@motajs/common', Common);
@ -39,4 +42,16 @@ export function create() {
Mota.register('@user/legacy-plugin-client', LegacyPluginClient); Mota.register('@user/legacy-plugin-client', LegacyPluginClient);
Mota.register('MutateAnimate', MutateAnimate); Mota.register('MutateAnimate', MutateAnimate);
Mota.register('Vue', Vue); Mota.register('Vue', Vue);
loading.emit('clientRegistered');
}
async function createModule() {
LegacyUI.create();
RenderElements.create();
ClientModules.create();
await import('ant-design-vue/dist/antd.dark.css');
main.renderLoaded = true;
hook.emit('renderLoaded');
} }

View File

@ -1,6 +1,7 @@
{ {
"name": "@user/entry-data", "name": "@user/entry-data",
"dependencies": { "dependencies": {
"@motajs/legacy-common": "workspace:*",
"@user/data-base": "workspace:*", "@user/data-base": "workspace:*",
"@user/data-fallback": "workspace:*", "@user/data-fallback": "workspace:*",
"@user/data-state": "workspace:*", "@user/data-state": "workspace:*",

View File

@ -6,9 +6,17 @@ import * as DataUtils from '@user/data-utils';
import * as LegacyPluginData from '@user/legacy-plugin-data'; import * as LegacyPluginData from '@user/legacy-plugin-data';
export function create() { export function create() {
DataBase.loading.once('registered', createModule);
Mota.register('@user/data-base', DataBase); Mota.register('@user/data-base', DataBase);
Mota.register('@user/data-fallback', DataFallback); Mota.register('@user/data-fallback', DataFallback);
Mota.register('@user/data-state', DataState); Mota.register('@user/data-state', DataState);
Mota.register('@user/data-utils', DataUtils); Mota.register('@user/data-utils', DataUtils);
Mota.register('@user/legacy-plugin-data', LegacyPluginData); Mota.register('@user/legacy-plugin-data', LegacyPluginData);
DataBase.loading.emit('dataRegistered');
}
function createModule() {
LegacyPluginData.create();
} }

View File

@ -1,6 +1,6 @@
import { patchAll } from '@user/data-fallback';
import { createMota } from './mota'; import { createMota } from './mota';
import { create } from './create'; import { create } from './create';
import { patchAll } from '@user/data-fallback';
import { loading } from '@user/data-base'; import { loading } from '@user/data-base';
import { Patch } from '@motajs/legacy-common'; import { Patch } from '@motajs/legacy-common';

View File

@ -93,10 +93,6 @@ class MotaSystem implements IMota {
r = r; r = r;
rf = rf; rf = rf;
constructor() {
throw new Error(`System interface class cannot be constructed.`);
}
require(key: string): any { require(key: string): any {
const data = this.modules[key]; const data = this.modules[key];
if (data) return data; if (data) return data;

View File

@ -56,8 +56,8 @@ export {};
core.status.maps[data].enemy?.calRealAttribute(); core.status.maps[data].enemy?.calRealAttribute();
core.updateStatusBar(true, true); core.updateStatusBar(true, true);
} }
Mota.require('module', 'Shadow').Shadow.update(true); Mota.require('@motajs/legacy-ui').Shadow.update(true);
const Binder = Mota.require('module', 'Render').LayerGroupFloorBinder; const Binder = Mota.require('@motajs/render').LayerGroupFloorBinder;
Binder.activedBinder.forEach(v => { Binder.activedBinder.forEach(v => {
if (v.getFloor() === core.status.floorId) { if (v.getFloor() === core.status.floorId) {
v.updateBindData(); v.updateBindData();

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
import { loading } from '@user/data-base';
import { initFallback } from './fallback'; import { initFallback } from './fallback';
import { initFiveLayer } from './fiveLayer'; import { initFiveLayer } from './fiveLayer';
import { createHook } from './hook'; import { createHook } from './hook';
@ -8,11 +9,15 @@ if (import.meta.env.DEV) {
import('./dev/hotReload'); import('./dev/hotReload');
} }
initFallback(); export function create() {
initFiveLayer(); initFallback();
createHook(); loading.once('coreInit', () => {
initReplay(); initFiveLayer();
initUI(); createHook();
initReplay();
initUI();
});
}
export * from './chase'; export * from './chase';
export * from './fallback'; export * from './fallback';

View File

@ -2,7 +2,7 @@
export function initUI() { export function initUI() {
if (main.mode === 'editor') return; if (main.mode === 'editor') return;
const { mainUi, fixedUi, mainSetting } = Mota.requireAll('var'); const { mainUi, fixedUi, mainSetting } = Mota.require('@motajs/legacy-ui');
ui.prototype.drawBook = function () { ui.prototype.drawBook = function () {
if (!core.isReplaying()) return mainUi.open('book'); if (!core.isReplaying()) return mainUi.open('book');
@ -27,7 +27,7 @@ export function initUI() {
if (!core.control.noAutoEvents) core.checkAutoEvents(); if (!core.control.noAutoEvents) core.checkAutoEvents();
core.control._updateStatusBar_setToolboxIcon(); core.control._updateStatusBar_setToolboxIcon();
core.control.noAutoEvents = true; core.control.noAutoEvents = true;
Mota.require('var', 'hook').emit('statusBarUpdate'); Mota.require('@user/data-base').hook.emit('statusBarUpdate');
}; };
control.prototype.showStatusBar = function () { control.prototype.showStatusBar = function () {

View File

@ -482,46 +482,6 @@
"这些技能一般需要尽早点出。" "这些技能一般需要尽早点出。"
] ]
}, },
"study": {
"text": "学习",
"condition": "Mota.Plugin.require('skillTree_g').getSkillLevel(11) > 0",
"desc": [
"本条目会详细说明学习的机制与所有可以被学习的技能被学习后的效果。当前已经学习的技能会以与状态栏类似的盒子展示出来。",
"<br>",
"<br>",
"首先学习技能消耗的智慧点会越来越多初始消耗的智慧点为500每学习一次增加250。",
"学习的技能可以持续5场战斗在技能树界面每升级一次增加3场",
"<span style=\"color: gold\">当前为${Mota.Plugin.require('skillTree_g').getSkillLevel(11) * 3 + 2}场</span>。",
"学习后对应属性的值,例如抱团怪增加的属性百分比,会与被学习的怪物相同。学习界面可以使用背包中的道具或点击状态栏打开。",
"<br>",
"<br>",
"下面会详细说明每一种可以被学习的技能被学习后的效果,没有列出的均不可学习。",
"<br>",
"<br>",
"<span style=\"color: #fc3\">1. 致命一击</span>勇士每5回合对怪物造成一次强力攻击。",
"<br>",
"<span style=\"color: #bbb0ff\">2. 恶毒</span>:勇士攻击无视怪物的防御。",
"<br>",
"<span style=\"color: #c0b088\">3. 坚固</span>:勇士防御不低于怪物的攻击-1。",
"<br>",
"<span style=\"color: #fe7\">4. n连击</span>勇士每回合攻击n次",
"<br>",
"<span style=\"color: #b30000\">5. 饥渴</span>:勇士在战前吸取怪物一定量的攻击加载自己身上,",
"同时减少怪物相应量的攻击,优先于怪物。",
"<br>",
"<span style=\"color: #fa4\">6. 抱团</span>:勇士周围每有一个拥有抱团属性的怪物,勇士的属性便增加一定值。",
"相应地,拥有抱团属性的怪物也会受到勇士的加成。",
"<br>",
"<span style=\"color: #b0c0dd\">7. 勇气之刃</span>:勇士第一回合造成一定量的伤害,之后正常。",
"<br>",
"<span style=\"color: #ff00d2\">8. 勇气冲锋</span>勇士首先发动冲锋造成一定量的伤害眩晕怪物5回合。",
"学习该技能后,勇士无条件先手。",
"<br>",
"<span style=\"color: #bbb0ff\">9. 魔攻</span>:勇士攻击无视怪物的防御。",
"<br>",
"<span style=\"color: #b0b666\">10. 先攻</span>:勇士无条件先手。"
]
},
"special1": { "special1": {
"text": "第一章怪物特技", "text": "第一章怪物特技",
"condition": "flags.chapter > 0", "condition": "flags.chapter > 0",

View File

@ -26,11 +26,7 @@
"<br>", "<br>",
"注当鼠标移动到怪物上时经过200毫秒才会显示信息防止误操作。" "注当鼠标移动到怪物上时经过200毫秒才会显示信息防止误操作。"
], ],
"hotkey": ["设置游戏中会用到的一些快捷键"], "hotkey": ["设置游戏中会用到的一些快捷键"]
"toolbar": [
"允许你在工具栏上自定义按钮,包括使用道具、开关技能、按下某个按键等。",
"推荐手机进行一些设置"
]
}, },
"utils": { "utils": {
"betterLoad": [ "betterLoad": [

View File

@ -1,2 +1,8 @@
import { createShadow } from './shadow';
export function createFx() {
createShadow();
}
export * from './shadow'; export * from './shadow';
export * from './webgl'; export * from './webgl';

View File

@ -75,50 +75,52 @@ function addLightFromBlock(
}); });
} }
const { hook } = Mota.require('@user/data-base'); export function createShadow() {
const { hook } = Mota.require('@user/data-base');
hook.once('reset', () => { hook.once('reset', () => {
Shadow.init(); Shadow.init();
addLightFromBlock( addLightFromBlock(
core.floorIds core.floorIds
.slice(61, 70) .slice(61, 70)
.concat(core.floorIds.slice(72, 81)) .concat(core.floorIds.slice(72, 81))
.concat(core.floorIds.slice(85, 107)), .concat(core.floorIds.slice(85, 107)),
103, 103,
{ decay: 50, r: 300, color: [0.9333, 0.6, 0.333, 0.3] }, { decay: 50, r: 300, color: [0.9333, 0.6, 0.333, 0.3] },
{ background: [0, 0, 0, 0.2] }, { background: [0, 0, 0, 0.2] },
{ decay: 50, r: 250, color: [0, 0, 0, 0] } { decay: 50, r: 250, color: [0, 0, 0, 0] }
); );
addLightFromBlock( addLightFromBlock(
['MT50', 'MT60', 'MT61', 'MT72', 'MT73', 'MT74', 'MT75'], ['MT50', 'MT60', 'MT61', 'MT72', 'MT73', 'MT74', 'MT75'],
103, 103,
{ {
decay: 20, decay: 20,
r: 150, r: 150,
color: [0.9333, 0.6, 0.333, 0.3], color: [0.9333, 0.6, 0.333, 0.3],
noShelter: true noShelter: true
}, },
{ background: [0, 0, 0, 0.3] } { background: [0, 0, 0, 0.3] }
); );
hook.on('loadData', () => { hook.on('loadData', () => {
Shadow.update(true);
LayerShadowExtends.shadowList.forEach(v => v.update());
});
});
hook.on('reset', () => {
Shadow.update(true); Shadow.update(true);
LayerShadowExtends.shadowList.forEach(v => v.update()); LayerShadowExtends.shadowList.forEach(v => v.update());
}); });
}); hook.on('setBlock', () => {
hook.on('reset', () => { Shadow.update(true);
Shadow.update(true); LayerShadowExtends.shadowList.forEach(v => v.update());
LayerShadowExtends.shadowList.forEach(v => v.update()); });
}); hook.on('changingFloor', floorId => {
hook.on('setBlock', () => { Shadow.clearBuffer();
Shadow.update(true); Shadow.update(true);
LayerShadowExtends.shadowList.forEach(v => v.update()); // setCanvasFilterByFloorId(floorId);
}); LayerShadowExtends.shadowList.forEach(v => v.update());
hook.on('changingFloor', floorId => { });
Shadow.clearBuffer(); }
Shadow.update(true);
// setCanvasFilterByFloorId(floorId);
LayerShadowExtends.shadowList.forEach(v => v.update());
});
// 深度测试着色器 // 深度测试着色器

View File

@ -1,4 +1,10 @@
import 'ant-design-vue/dist/antd.dark.css'; import { createFx } from './fx';
import { createPreset } from './preset';
export function create() {
createFx();
createPreset();
}
export * as UI from './ui'; export * as UI from './ui';
export * as Components from './components'; export * as Components from './components';

View File

@ -21,25 +21,27 @@ if (import.meta.env.DEV) {
Danmaku.backend = `/danmaku`; Danmaku.backend = `/danmaku`;
} }
const { hook } = Mota.require('@user/data-base'); export function createDanmaku() {
const { hook } = Mota.require('@user/data-base');
hook.once('reset', () => { hook.once('reset', () => {
Danmaku.fetch(); Danmaku.fetch();
}); });
// 勇士移动后显示弹幕 // 勇士移动后显示弹幕
hook.on('moveOneStep', (x, y, floor) => { hook.on('moveOneStep', (x, y, floor) => {
const enabled = mainSetting.getValue('ui.danmaku', true); const enabled = mainSetting.getValue('ui.danmaku', true);
if (!enabled) return; if (!enabled) return;
const f = Danmaku.allInPos[floor]; const f = Danmaku.allInPos[floor];
if (f) { if (f) {
const danmaku = f[`${x},${y}`]; const danmaku = f[`${x},${y}`];
if (danmaku) { if (danmaku) {
danmaku.forEach(v => { danmaku.forEach(v => {
setTimeout(() => { setTimeout(() => {
v.show(); v.show();
}, Math.random() * 1000); }, Math.random() * 1000);
}); });
}
} }
} });
}); }

View File

@ -38,30 +38,32 @@ const closeFixed = () => {
// todo: 应当在这里实现查看临界与特殊属性的功能 // todo: 应当在这里实现查看临界与特殊属性的功能
export let hovered: Block | null; export let hovered: Block | null;
const { hook, gameListener } = Mota.require('@user/data-base'); export function createFixed() {
const { hook, gameListener } = Mota.require('@user/data-base');
gameListener.on('hoverBlock', block => { gameListener.on('hoverBlock', block => {
closeFixed();
hovered = block;
});
gameListener.on('leaveBlock', (_, __, leaveGame) => {
showFixed.cancel();
if (!leaveGame) closeFixed();
hovered = null;
});
gameListener.on('mouseMove', e => {
cx = e.clientX;
cy = e.clientY;
showFixed.cancel();
if (hovered) {
showFixed(hovered);
}
});
hook.once('mounted', () => {
const { mainUi } = Mota.require('@motajs/legacy-ui');
mainUi.on('start', () => {
showFixed.cancel();
closeFixed(); closeFixed();
hovered = block;
}); });
}); gameListener.on('leaveBlock', (_, __, leaveGame) => {
showFixed.cancel();
if (!leaveGame) closeFixed();
hovered = null;
});
gameListener.on('mouseMove', e => {
cx = e.clientX;
cy = e.clientY;
showFixed.cancel();
if (hovered) {
showFixed(hovered);
}
});
hook.once('mounted', () => {
const { mainUi } = Mota.require('@motajs/legacy-ui');
mainUi.on('start', () => {
showFixed.cancel();
closeFixed();
});
});
}

View File

@ -1,3 +1,13 @@
import { createDanmaku } from './danmaku';
import { createFixed } from './fixed';
import { createUI } from './ui';
export function createPreset() {
createDanmaku();
createFixed();
createUI();
}
export * from './ui'; export * from './ui';
export * from './settings'; export * from './settings';
export * from './danmaku'; export * from './danmaku';

View File

@ -9,37 +9,39 @@ import { mainSetting } from './settingIns';
//#region legacy-ui //#region legacy-ui
const { hook } = Mota.require('@user/data-base'); export function createUI() {
hook.once('mounted', () => { const { hook } = Mota.require('@user/data-base');
const ui = document.getElementById('ui-main')!; hook.once('mounted', () => {
const fixed = document.getElementById('ui-fixed')!; const ui = document.getElementById('ui-main')!;
const fixed = document.getElementById('ui-fixed')!;
const blur = mainSetting.getSetting('screen.blur'); const blur = mainSetting.getSetting('screen.blur');
mainUi.on('start', () => { mainUi.on('start', () => {
ui.style.display = 'flex'; ui.style.display = 'flex';
if (blur?.value) { if (blur?.value) {
ui.style.backdropFilter = 'blur(5px)'; ui.style.backdropFilter = 'blur(5px)';
ui.style.backgroundColor = 'rgba(0,0,0,0.7333)'; ui.style.backgroundColor = 'rgba(0,0,0,0.7333)';
} else { } else {
ui.style.backdropFilter = 'none'; ui.style.backdropFilter = 'none';
ui.style.backgroundColor = 'rgba(0,0,0,0.85)'; ui.style.backgroundColor = 'rgba(0,0,0,0.85)';
} }
core.lockControl(); core.lockControl();
});
mainUi.on('end', noClosePanel => {
ui.style.display = 'none';
if (!noClosePanel) {
core.closePanel();
}
});
fixedUi.on('start', () => {
fixed.style.display = 'block';
});
fixedUi.on('end', () => {
fixed.style.display = 'none';
});
}); });
mainUi.on('end', noClosePanel => { }
ui.style.display = 'none';
if (!noClosePanel) {
core.closePanel();
}
});
fixedUi.on('start', () => {
fixed.style.display = 'block';
});
fixedUi.on('end', () => {
fixed.style.display = 'none';
});
});
//#endregion //#endregion
@ -145,7 +147,6 @@ function handleUiSetting<T extends number | boolean>(key: string, n: T, _o: T) {
} }
// ----- 游戏的所有设置项 // ----- 游戏的所有设置项
// todo: 虚拟键盘缩放,小地图楼传缩放
mainSetting mainSetting
.register( .register(
'screen', 'screen',
@ -253,10 +254,6 @@ loading.once('coreInit', () => {
isMobile ? 300 : Math.floor(window.innerWidth / 600) * 50 isMobile ? 300 : Math.floor(window.innerWidth / 600) * 50
), ),
'ui.mapLazy': storage.getValue('ui.mapLazy', false), 'ui.mapLazy': storage.getValue('ui.mapLazy', false),
'ui.toolbarScale': storage.getValue(
'ui.toolbarScale',
isMobile ? 50 : Math.floor((window.innerWidth / 1700) * 10) * 10
),
'ui.bookScale': storage.getValue('ui.bookScale', isMobile ? 100 : 80), 'ui.bookScale': storage.getValue('ui.bookScale', isMobile ? 100 : 80),
'ui.danmaku': storage.getValue('ui.danmaku', true), 'ui.danmaku': storage.getValue('ui.danmaku', true),
'ui.danmakuSpeed': storage.getValue( 'ui.danmakuSpeed': storage.getValue(
@ -271,18 +268,6 @@ interface SettingTextData {
[x: string]: string[] | SettingTextData; [x: string]: string[] | SettingTextData;
} }
function getSettingText(obj: SettingTextData, key?: string) {
for (const [k, value] of Object.entries(obj)) {
const setKey = key ? key + '.' + k : k;
if (value instanceof Array) {
mainSetting.setDescription(setKey, value.join('\n'));
} else {
getSettingText(value, setKey);
}
}
}
getSettingText(settingsText);
mainSetting mainSetting
.setDescription('audio.bgmEnabled', `是否开启背景音乐`) .setDescription('audio.bgmEnabled', `是否开启背景音乐`)
.setDescription('audio.bgmVolume', `背景音乐的音量`) .setDescription('audio.bgmVolume', `背景音乐的音量`)
@ -293,7 +278,6 @@ mainSetting
'ui.mapLazy', 'ui.mapLazy',
`是否启用小地图懒更新模式,此模式下剩余怪物数量不会实时更新而变成切换地图后更新,打开小地图时出现卡顿可以尝试开启此设置` `是否启用小地图懒更新模式,此模式下剩余怪物数量不会实时更新而变成切换地图后更新,打开小地图时出现卡顿可以尝试开启此设置`
) )
.setDescription('ui.toolbarScale', `自定义工具栏的缩放比例`)
.setDescription( .setDescription(
'ui.bookScale', 'ui.bookScale',
`怪物手册界面中每个怪物框体的高度缩放,最小值限定为 20% 屏幕高度` `怪物手册界面中每个怪物框体的高度缩放,最小值限定为 20% 屏幕高度`
@ -321,6 +305,18 @@ function setFontSize() {
} }
setFontSize(); setFontSize();
function getSettingText(obj: SettingTextData, key?: string) {
for (const [k, value] of Object.entries(obj)) {
const setKey = key ? key + '.' + k : k;
if (value instanceof Array) {
mainSetting.setDescription(setKey, value.join('\n'));
} else {
getSettingText(value, setKey);
}
}
}
getSettingText(settingsText);
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
setFontSize(); setFontSize();
}); });

View File

@ -16,20 +16,15 @@ mainUi.register(
new GameUi('shop', UI.Shop), new GameUi('shop', UI.Shop),
// new GameUi('achievement', UI.Achievement), // new GameUi('achievement', UI.Achievement),
new GameUi('hotkey', UI.Hotkey), new GameUi('hotkey', UI.Hotkey),
new GameUi('toolEditor', UI.ToolEditor),
new GameUi('virtualKey', VirtualKey) new GameUi('virtualKey', VirtualKey)
// todo: 把游戏主 div 加入到 mainUi 里面
); );
mainUi.showAll(); mainUi.showAll();
export const fixedUi = new UiController(true); export const fixedUi = new UiController(true);
fixedUi.register( fixedUi.register(
new GameUi('markedEnemy', UI.Marked),
new GameUi('fixed', UI.Fixed), new GameUi('fixed', UI.Fixed),
new GameUi('chapter', UI.Chapter), new GameUi('chapter', UI.Chapter),
new GameUi('completeAchi', UI.CompleteAchi),
new GameUi('start', UI.Start), new GameUi('start', UI.Start),
new GameUi('toolbar', UI.Toolbar),
new GameUi('load', UI.Load), new GameUi('load', UI.Load),
new GameUi('danmaku', UI.Danmaku), new GameUi('danmaku', UI.Danmaku),
new GameUi('danmakuEditor', UI.DanmakuEditor), new GameUi('danmakuEditor', UI.DanmakuEditor),

View File

@ -56,7 +56,7 @@ const content = computed(() => {
.join('') .join('')
.replace( .replace(
/level:(\d+)/g, /level:(\d+)/g,
'Mota.Plugin.require("skillTree_g").getSkillLevel($1)' 'Mota.require("@user/data-state").getSkillLevel($1)'
) + ) +
'`' '`'
); );

View File

@ -1,10 +1,8 @@
import { isNil } from 'lodash-es'; import { isNil } from 'lodash-es';
import { Animation, sleep, TimingFn } from 'mutate-animate'; import { Animation, sleep, TimingFn } from 'mutate-animate';
import { Ref, ref } from 'vue'; import { Ref, ref } from 'vue';
import { KeyCode } from '@motajs/client-base';
import axios from 'axios'; import axios from 'axios';
import { decompressFromBase64 } from 'lz-string'; import { decompressFromBase64 } from 'lz-string';
import { Keyboard, KeyboardEmits, isAssist } from '@motajs/system-action';
import { logger } from '@motajs/common'; import { logger } from '@motajs/common';
type CanParseCss = keyof { type CanParseCss = keyof {

View File

@ -14,19 +14,6 @@ const i = (img: ImageMapKeys) => {
const imageMap: Partial<ImageMap> = {}; const imageMap: Partial<ImageMap> = {};
const { loading } = Mota.require('@user/data-base');
loading.once('loaded', () => {
[
'enemys',
'enemy48',
'npcs',
'npc48',
'terrains',
'items',
'animates'
].forEach(v => (imageMap[v as ImageMapKeys] = i(v as ImageMapKeys)));
});
interface AutotileCache { interface AutotileCache {
parent?: Set<AllNumbersOf<'autotile'>>; parent?: Set<AllNumbersOf<'autotile'>>;
frame: number; frame: number;
@ -91,21 +78,21 @@ class TextureCache {
constructor() { constructor() {
this.material = imageMap as Record<ImageMapKeys, HTMLImageElement>; this.material = imageMap as Record<ImageMapKeys, HTMLImageElement>;
}
loading.once('loaded', () => { init() {
const map = maps_90f36752_8815_4be8_b32b_d7fad1d0542e; const map = maps_90f36752_8815_4be8_b32b_d7fad1d0542e;
// @ts-expect-error 无法推导
this.idNumberMap = {};
for (const [key, { id }] of Object.entries(map)) {
// @ts-expect-error 无法推导 // @ts-expect-error 无法推导
this.idNumberMap = {}; this.idNumberMap[id] = parseInt(key) as AllNumbers;
for (const [key, { id }] of Object.entries(map)) { }
// @ts-expect-error 无法推导 this.tileset = core.material.images.tilesets;
this.idNumberMap[id] = parseInt(key) as AllNumbers; this.autotile = splitAutotiles(this.idNumberMap);
} this.images = core.material.images.images;
this.tileset = core.material.images.tilesets; this.calRenderable();
this.autotile = splitAutotiles(this.idNumberMap); this.calAutotileConnections();
this.images = core.material.images.images;
this.calRenderable();
this.calAutotileConnections();
});
} }
/** /**
@ -555,3 +542,19 @@ function splitAutotiles(map: IdToNumber): AutotileCaches {
return cache as AutotileCaches; return cache as AutotileCaches;
} }
export function createCache() {
const { loading } = Mota.require('@user/data-base');
loading.once('loaded', () => {
[
'enemys',
'enemy48',
'npcs',
'npc48',
'terrains',
'items',
'animates'
].forEach(v => (imageMap[v as ImageMapKeys] = i(v as ImageMapKeys)));
texture.init();
});
}

View File

@ -39,14 +39,16 @@ class RenderEmits extends EventEmitter<RenderEvent> {
export const renderEmits = new RenderEmits(); export const renderEmits = new RenderEmits();
Mota.require('@user/data-base').hook.once('reset', () => { export function createFrame() {
let lastTime = 0; Mota.require('@user/data-base').hook.once('reset', () => {
RenderItem.ticker.add(time => { let lastTime = 0;
if (!core.isPlaying()) return; RenderItem.ticker.add(time => {
if (time - lastTime > core.values.animateSpeed) { if (!core.isPlaying()) return;
RenderItem.animatedFrame++; if (time - lastTime > core.values.animateSpeed) {
lastTime = time; RenderItem.animatedFrame++;
renderEmits.emitAnimateFrame(RenderItem.animatedFrame, time); lastTime = time;
} renderEmits.emitAnimateFrame(RenderItem.animatedFrame, time);
}
});
}); });
}); }

View File

@ -1,3 +1,15 @@
import { createCache } from './cache';
import { createFrame } from './frame';
import { createLayer } from './layer';
import { createViewport } from './viewport';
export function create() {
createCache();
createFrame();
createLayer();
createViewport();
}
export * from './animate'; export * from './animate';
export * from './block'; export * from './block';
export * from './cache'; export * from './cache';

View File

@ -1551,49 +1551,51 @@ export class Layer extends Container<ELayerEvent> {
const layerAdapter = new RenderAdapter<Layer>('layer'); const layerAdapter = new RenderAdapter<Layer>('layer');
const { hook } = Mota.require('@user/data-base'); export function createLayer() {
const { hook } = Mota.require('@user/data-base');
hook.on('setBlock', (x, y, floor, block) => { hook.on('setBlock', (x, y, floor, block) => {
const isNow = floor === core.status.floorId; const isNow = floor === core.status.floorId;
LayerGroupFloorBinder.activedBinder.forEach(v => { LayerGroupFloorBinder.activedBinder.forEach(v => {
if (floor === v.floor || (isNow && v.bindThisFloor)) { if (floor === v.floor || (isNow && v.bindThisFloor)) {
v.setBlock('event', block, x, y); v.setBlock('event', block, x, y);
}
});
LayerFloorBinder.listenedBinder.forEach(v => {
if (v.layer.layer === 'event') {
if (v.floor === floor || (isNow && v.bindThisFloor)) {
v.setBlock(block, x, y);
} }
} });
}); LayerFloorBinder.listenedBinder.forEach(v => {
}); if (v.layer.layer === 'event') {
hook.on('changingFloor', floor => { if (v.floor === floor || (isNow && v.bindThisFloor)) {
// 潜在隐患如果putRenderData改成异步那么会变成两帧后才能真正刷新并渲染 v.setBlock(block, x, y);
// 考虑到楼层转换一般不会同时执行很多次,因此这里改为立刻更新 }
LayerGroupFloorBinder.activedBinder.forEach(v => {
if (v.bindThisFloor) v.updateBindData();
v.emit('floorChange', floor);
});
LayerFloorBinder.listenedBinder.forEach(v => {
if (v.bindThisFloor) v.updateBindData();
});
});
hook.on('setBgFgBlock', (name, number, x, y, floor) => {
const isNow = floor === core.status.floorId;
LayerGroupFloorBinder.activedBinder.forEach(v => {
if (floor === v.floor || (isNow && v.bindThisFloor)) {
v.setBlock(name, number, x, y);
}
});
LayerFloorBinder.listenedBinder.forEach(v => {
if (v.layer.layer === name) {
if (v.floor === floor || (isNow && v.bindThisFloor)) {
v.setBlock(number, x, y);
} }
} });
}); });
}); hook.on('changingFloor', floor => {
// 潜在隐患如果putRenderData改成异步那么会变成两帧后才能真正刷新并渲染
// 考虑到楼层转换一般不会同时执行很多次,因此这里改为立刻更新
LayerGroupFloorBinder.activedBinder.forEach(v => {
if (v.bindThisFloor) v.updateBindData();
v.emit('floorChange', floor);
});
LayerFloorBinder.listenedBinder.forEach(v => {
if (v.bindThisFloor) v.updateBindData();
});
});
hook.on('setBgFgBlock', (name, number, x, y, floor) => {
const isNow = floor === core.status.floorId;
LayerGroupFloorBinder.activedBinder.forEach(v => {
if (floor === v.floor || (isNow && v.bindThisFloor)) {
v.setBlock(name, number, x, y);
}
});
LayerFloorBinder.listenedBinder.forEach(v => {
if (v.layer.layer === name) {
if (v.floor === floor || (isNow && v.bindThisFloor)) {
v.setBlock(number, x, y);
}
}
});
});
}
interface LayerGroupBinderEvent { interface LayerGroupBinderEvent {
update: [floor: FloorIds]; update: [floor: FloorIds];

View File

@ -346,7 +346,9 @@ adapter.receiveSync('endMove', item => {
item.endMove(); item.endMove();
}); });
const { hook } = Mota.require('@user/data-base'); export function createViewport() {
hook.on('changingFloor', (_, loc) => { const { hook } = Mota.require('@user/data-base');
adapter.all('setPosition', loc.x, loc.y); hook.on('changingFloor', (_, loc) => {
}); adapter.all('setPosition', loc.x, loc.y);
});
}

View File

@ -3517,7 +3517,7 @@ isShopVisited_e
/* isShopVisited_e /* isShopVisited_e
default : ['shop1'] default : ['shop1']
allShops : ['IdString_0'] allShops : ['IdString_0']
var code = 'Mota.Plugin.require("shop_g").isShopVisited(\'' + IdString_0 + '\')'; var code = 'Mota.require('@user/legacy-plugin-data').isShopVisited(\'' + IdString_0 + '\')';
return [code, Blockly.JavaScript.ORDER_ATOMIC]; return [code, Blockly.JavaScript.ORDER_ATOMIC];
*/; */;

View File

@ -191,7 +191,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_leaf": true, "_leaf": true,
"_type": "popCheckboxSet", "_type": "popCheckboxSet",
"_checkboxSet": function () { "_checkboxSet": function () {
var array = Mota.require('var', 'enemySpecials'); var array = Mota.require('@user/data-state').specials;
var b = [], var b = [],
c = []; c = [];
for (var index = 0; index < array.length; index++) { for (var index = 0; index < array.length; index++) {
@ -313,7 +313,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_leaf": true, "_leaf": true,
"_type": "popCheckboxSet", "_type": "popCheckboxSet",
"_checkboxSet": function () { "_checkboxSet": function () {
var array = Mota.require('var', 'enemySpecials'); var array = Mota.require('@user/data-state').specials;
var b = [], var b = [],
c = []; c = [];
for (var index = 0; index < array.length; index++) { for (var index = 0; index < array.length; index++) {

View File

@ -1,4 +1,4 @@
///<reference path="../../src/types/core.d.ts" /> ///<reference path="../../types/declaration/core.d.ts" />
/* /*
actions.js用户交互的事件的处理 actions.js用户交互的事件的处理
@ -582,7 +582,7 @@ actions.prototype._sys_ondown = function (x, y, px, py) {
y: Math.floor((py + core.bigmap.offsetY) / 32) y: Math.floor((py + core.bigmap.offsetY) / 32)
}; };
const loopMaps = Mota.require('module', 'Mechanism').MiscData.loopMaps; const loopMaps = Mota.require('@user/data-state').MiscData.loopMaps;
if (loopMaps.has(core.status.floorId)) { if (loopMaps.has(core.status.floorId)) {
const floor = core.status.thisMap; const floor = core.status.thisMap;
if (pos.x < 0) pos.x += floor.width; if (pos.x < 0) pos.x += floor.width;
@ -1117,7 +1117,7 @@ actions.prototype._clickAction_text = function () {
// 正在淡入淡出的话不执行 // 正在淡入淡出的话不执行
if (core.status.event.animateUI) return; if (core.status.event.animateUI) return;
const Store = Mota.require('module', 'MainUI').TextboxStore; const Store = Mota.require('@user/client-modules').TextboxStore;
const store = Store.get('main-textbox'); const store = Store.get('main-textbox');
// var data = core.clone(core.status.event.data.current); // var data = core.clone(core.status.event.data.current);
@ -1519,7 +1519,7 @@ actions.prototype._keyUpViewMaps = function (keycode) {
////// 快捷商店界面时的点击操作 ////// ////// 快捷商店界面时的点击操作 //////
actions.prototype._clickQuickShop = function (x, y) { actions.prototype._clickQuickShop = function (x, y) {
const shop = Mota.Plugin.require('shop_g'); const shop = Mota.require('@user/legacy-plugin-data');
var shopIds = shop.listShopIds(); var shopIds = shop.listShopIds();
if (this._out(x)) return; if (this._out(x)) return;
var topIndex = var topIndex =
@ -1557,7 +1557,7 @@ actions.prototype._keyUpQuickShop = function (keycode) {
return; return;
} }
this._selectChoices( this._selectChoices(
Mota.Plugin.require('shop_g').listShopIds().length + 1, Mota.require('@user/data-state').listShopIds().length + 1,
keycode, keycode,
this._clickQuickShop this._clickQuickShop
); );

View File

@ -248,7 +248,7 @@ control.prototype.showStartAnimate = function (noAnimate, callback) {
callback callback
); );
Mota.r(() => { Mota.r(() => {
Mota.require('var', 'fixedUi').open('start'); Mota.require('@motajs/legacy-ui').fixedUi.open('start');
}); });
}; };
@ -526,20 +526,17 @@ control.prototype.setHeroMoveInterval = function (callback) {
// render.move(true); // render.move(true);
// }); // });
core.interval.heroMoveInterval = window.setInterval( core.interval.heroMoveInterval = window.setInterval(function () {
function () { // render.offset += toAdd * 4;
// render.offset += toAdd * 4; core.status.heroMoving += toAdd;
core.status.heroMoving += toAdd; if (core.status.heroMoving >= 8) {
if (core.status.heroMoving >= 8) { clearInterval(core.interval.heroMoveInterval);
clearInterval(core.interval.heroMoveInterval); core.status.heroMoving = 0;
core.status.heroMoving = 0; // render.offset = 0;
// render.offset = 0; // render.move(false);
// render.move(false); if (callback) callback();
if (callback) callback(); }
} }, ((core.values.moveSpeed / 8) * toAdd) / core.status.replay.speed);
},
((core.values.moveSpeed / 8) * toAdd) / core.status.replay.speed
);
}; };
////// 每移动一格后执行的事件 ////// ////// 每移动一格后执行的事件 //////
@ -1139,7 +1136,7 @@ control.prototype.checkBlock = function () {
control.prototype._checkBlock_disableQuickShop = function () { control.prototype._checkBlock_disableQuickShop = function () {
// 禁用快捷商店 // 禁用快捷商店
const { setShopVisited } = Mota.Plugin.require('shop_g'); const { setShopVisited } = Mota.require('@user/data-state');
if (core.flags.disableShopOnDamage) { if (core.flags.disableShopOnDamage) {
Object.keys(core.status.shops).forEach(function (shopId) { Object.keys(core.status.shops).forEach(function (shopId) {
setShopVisited(shopId, false); setShopVisited(shopId, false);
@ -1283,7 +1280,7 @@ control.prototype.startReplay = function (list) {
// 'warn', // 'warn',
// '由于不可抗力,录像播放过程中将没有勇士移动动画' // '由于不可抗力,录像播放过程中将没有勇士移动动画'
// ); // );
Mota.require('var', 'hook').emit('replayStatus', false); Mota.require('@user/data-base').hook.emit('replayStatus', false);
this.replay(); this.replay();
}; };
@ -1298,7 +1295,7 @@ control.prototype.pauseReplay = function () {
if (!core.isPlaying() || !core.isReplaying()) return; if (!core.isPlaying() || !core.isReplaying()) return;
core.status.replay.pausing = true; core.status.replay.pausing = true;
core.drawTip('暂停播放'); core.drawTip('暂停播放');
Mota.require('var', 'hook').emit('replayStatus', false); Mota.require('@user/data-base').hook.emit('replayStatus', false);
core.updateStatusBar(false, true); core.updateStatusBar(false, true);
}; };
@ -1312,7 +1309,7 @@ control.prototype.resumeReplay = function () {
core.status.replay.pausing = false; core.status.replay.pausing = false;
core.drawTip('恢复播放'); core.drawTip('恢复播放');
core.replay(); core.replay();
Mota.require('var', 'hook').emit('replayStatus', true); Mota.require('@user/data-base').hook.emit('replayStatus', true);
core.updateStatusBar(false, true); core.updateStatusBar(false, true);
}; };
@ -1378,7 +1375,7 @@ control.prototype.stopReplay = function (force) {
core.deleteCanvas('replay'); core.deleteCanvas('replay');
core.updateStatusBar(false, true); core.updateStatusBar(false, true);
core.drawTip('停止播放并恢复游戏'); core.drawTip('停止播放并恢复游戏');
Mota.require('var', 'hook').emit('replayStatus', true); Mota.require('@user/data-base').hook.emit('replayStatus', true);
}; };
////// 回退 ////// ////// 回退 //////
@ -1648,7 +1645,10 @@ control.prototype._replay_error = function (action, callback) {
if (core.status.replay.save.length > 0) { if (core.status.replay.save.length > 0) {
core.status.replay.replaying = true; core.status.replay.replaying = true;
core.status.replay.pausing = true; core.status.replay.pausing = true;
Mota.require('var', 'hook').emit('replayStatus', false); Mota.require('@user/data-base').hook.emit(
'replayStatus',
false
);
core.rewindReplay(); core.rewindReplay();
} else { } else {
core.playSound('操作失败'); core.playSound('操作失败');
@ -1754,7 +1754,7 @@ control.prototype._replayAction_equip = function (action) {
const type = core.getEquipTypeById(equipId); const type = core.getEquipTypeById(equipId);
if (type >= 0) t = type; if (type >= 0) t = type;
else { else {
Mota.Plugin.require('render_r').tip( Mota.require('@motajs/legacy-ui').tip(
'error', 'error',
'无法装备' + core.material.items[equipId]?.name '无法装备' + core.material.items[equipId]?.name
); );
@ -2068,7 +2068,7 @@ control.prototype._doSL_load = function (id, callback) {
1 1
)[0]; )[0];
if (!main.replayChecking) { if (!main.replayChecking) {
Mota.require('var', 'fixedUi').closeByName('start'); Mota.require('@motajs/legacy-ui').fixedUi.closeByName('start');
} }
if (core.isPlaying() && !core.status.gameOver) { if (core.isPlaying() && !core.status.gameOver) {
core.control.autosave(0); core.control.autosave(0);
@ -2085,7 +2085,9 @@ control.prototype._doSL_load = function (id, callback) {
null, null,
function (data) { function (data) {
if (!main.replayChecking && data) { if (!main.replayChecking && data) {
Mota.require('var', 'fixedUi').closeByName('start'); Mota.require('@motajs/legacy-ui').fixedUi.closeByName(
'start'
);
} }
if (id == 'autoSave' && data != null) { if (id == 'autoSave' && data != null) {
core.saves.autosave.data = data; core.saves.autosave.data = data;
@ -2143,7 +2145,7 @@ control.prototype._doSL_load_afterGet = function (id, data) {
} }
// 追逐战 // 追逐战
Mota.r(() => { Mota.r(() => {
Mota.Plugin.require('chase_r').end(false); Mota.require('@user/legacy-plugin-client').end(false);
}); });
core.ui.closePanel(); core.ui.closePanel();
core.loadData(data, function () { core.loadData(data, function () {
@ -3114,8 +3116,6 @@ control.prototype.resize = function () {
const width = window.innerWidth; const width = window.innerWidth;
const height = window.innerHeight; const height = window.innerHeight;
const auto = Mota.require('var', 'mainSetting').getValue('autoScale', true);
if (window.innerWidth >= 600) { if (window.innerWidth >= 600) {
// 横屏 // 横屏
core.domStyle.isVertical = false; core.domStyle.isVertical = false;

View File

@ -296,10 +296,14 @@ core.prototype.init = async function (coreData, callback) {
}); });
} else { } else {
if (main.renderLoaded) if (main.renderLoaded)
Mota.require('var', 'fixedUi').open('load', { callback }); Mota.require('@motajs/legacy-ui').fixedUi.open('load', {
callback
});
else { else {
Mota.require('var', 'hook').once('renderLoaded', () => { Mota.require('@user/data-base').hook.once('renderLoaded', () => {
Mota.require('var', 'fixedUi').open('load', { callback }); Mota.require('@motajs/legacy-ui').fixedUi.open('load', {
callback
});
}); });
} }
} }
@ -638,7 +642,7 @@ core.prototype._afterLoadResources = function (callback) {
// if (core.plugin._afterLoadResources) core.plugin._afterLoadResources(); // if (core.plugin._afterLoadResources) core.plugin._afterLoadResources();
core.showStartAnimate(); core.showStartAnimate();
Mota.require('var', 'hook').emit('load'); Mota.require('@user/data-base').hook.emit('load');
if (callback) callback(); if (callback) callback();
}; };

View File

@ -25,11 +25,11 @@ events.prototype.resetGame = function (hero, hard, floorId, maps, values) {
events.prototype.startGame = function (hard, seed, route, callback) { events.prototype.startGame = function (hard, seed, route, callback) {
hard = hard || ''; hard = hard || '';
if (!main.replayChecking) { if (!main.replayChecking) {
Mota.require('var', 'fixedUi').closeByName('start'); Mota.require('@motajs/legacy-ui').fixedUi.closeByName('start');
} }
if (main.mode != 'play') return; if (main.mode != 'play') return;
Mota.Plugin.require('skillTree_g').resetSkillLevel(); Mota.require('@user/data-state').resetSkillLevel();
// 无动画的开始游戏 // 无动画的开始游戏
if (core.flags.startUsingCanvas || route != null) { if (core.flags.startUsingCanvas || route != null) {
@ -314,7 +314,7 @@ events.prototype.restart = function () {
core.hideStatusBar(); core.hideStatusBar();
core.showStartAnimate(); core.showStartAnimate();
core.playBgm(main.startBgm); core.playBgm(main.startBgm);
Mota.require('var', 'hook').emit('restart'); Mota.require('@user/data-base').hook.emit('restart');
}; };
////// 询问是否需要重新开始 ////// ////// 询问是否需要重新开始 //////
@ -537,7 +537,7 @@ events.prototype.openDoor = function (x, y, needKey, callback) {
core.removeBlock(x, y); core.removeBlock(x, y);
setTimeout(function () { setTimeout(function () {
core.status.replay.animate = false; core.status.replay.animate = false;
Mota.require('var', 'hook').emit( Mota.require('@user/data-base').hook.emit(
'afterOpenDoor', 'afterOpenDoor',
block.event.id, block.event.id,
x, x,
@ -627,7 +627,12 @@ events.prototype._openDoor_animate = function (block, x, y, callback) {
core.maps._removeBlockFromMap(core.status.floorId, block); core.maps._removeBlockFromMap(core.status.floorId, block);
if (!locked) core.unlockControl(); if (!locked) core.unlockControl();
core.status.replay.animate = false; core.status.replay.animate = false;
Mota.require('var', 'hook').emit('afterOpenDoor', block.event.id, x, y); Mota.require('@user/data-base').hook.emit(
'afterOpenDoor',
block.event.id,
x,
y
);
if (callback) callback(); if (callback) callback();
}; };
@ -696,18 +701,24 @@ events.prototype.getItem = function (id, num, x, y, isGentleClick, callback) {
(id.endsWith('Key') (id.endsWith('Key')
? '(钥匙类道具,遇到对应的门时自动打开)' ? '(钥匙类道具,遇到对应的门时自动打开)'
: itemCls == 'tools' : itemCls == 'tools'
? '消耗类道具请按T在道具栏使用' ? '消耗类道具请按T在道具栏使用'
: itemCls == 'constants' : itemCls == 'constants'
? '永久类道具请按T在道具栏使用' ? '永久类道具请按T在道具栏使用'
: itemCls == 'equips' : itemCls == 'equips'
? '装备类道具请按Q在装备栏进行装备' ? '装备类道具请按Q在装备栏进行装备'
: '') : '')
); );
} }
itemHint.push(id); itemHint.push(id);
} }
Mota.require('var', 'hook').emit('afterGetItem', id, x, y, isGentleClick); Mota.require('@user/data-base').hook.emit(
'afterGetItem',
id,
x,
y,
isGentleClick
);
if (callback) callback(); if (callback) callback();
}; };
@ -867,7 +878,7 @@ events.prototype._changeFloor_beforeChange = function (info, callback) {
if (info.time === 0 || main.replayChecking) { if (info.time === 0 || main.replayChecking) {
core.events._changeFloor_changing(info, callback); core.events._changeFloor_changing(info, callback);
} else { } else {
const Render = Mota.require('module', 'Render').MotaRenderer; const Render = Mota.require('@motajs/render').MotaRenderer;
const main = Render.get('render-main'); const main = Render.get('render-main');
const change = main.getElementById('floor-change'); const change = main.getElementById('floor-change');
change.setTitle(core.floors[info.floorId]?.title ?? ''); change.setTitle(core.floors[info.floorId]?.title ?? '');
@ -900,7 +911,7 @@ events.prototype._changeFloor_changing = function (info, callback) {
if (info.time === 0 || main.replayChecking) { if (info.time === 0 || main.replayChecking) {
this._changeFloor_afterChange(info, callback); this._changeFloor_afterChange(info, callback);
} else { } else {
const Render = Mota.require('module', 'Render').MotaRenderer; const Render = Mota.require('@motajs/render').MotaRenderer;
const main = Render.get('render-main'); const main = Render.get('render-main');
const change = main.getElementById('floor-change'); const change = main.getElementById('floor-change');
change.hideChange(info.time / 2).then(() => { change.hideChange(info.time / 2).then(() => {
@ -919,7 +930,11 @@ events.prototype._changeFloor_afterChange = function (info, callback) {
events.prototype.changingFloor = function (floorId, heroLoc) { events.prototype.changingFloor = function (floorId, heroLoc) {
this.eventdata.changingFloor(floorId, heroLoc); this.eventdata.changingFloor(floorId, heroLoc);
Mota.require('var', 'hook').emit('changingFloor', floorId, heroLoc); Mota.require('@user/data-base').hook.emit(
'changingFloor',
floorId,
heroLoc
);
}; };
////// 转换楼层结束的事件 ////// ////// 转换楼层结束的事件 //////
@ -1553,7 +1568,7 @@ events.prototype.__action_doAsyncFunc = function (isAsync, func) {
events.prototype._action_text = function (data, x, y, prefix) { events.prototype._action_text = function (data, x, y, prefix) {
if (this.__action_checkReplaying()) return; if (this.__action_checkReplaying()) return;
const Store = Mota.require('module', 'MainUI').TextboxStore; const Store = Mota.require('@user/client-modules').TextboxStore;
const store = Store.get('main-textbox'); const store = Store.get('main-textbox');
const { text } = data; const { text } = data;
let title = ''; let title = '';
@ -2203,13 +2218,13 @@ events.prototype._action_unloadEquip = function (data, x, y, prefix) {
}; };
events.prototype._action_openShop = function (data, x, y, prefix) { events.prototype._action_openShop = function (data, x, y, prefix) {
Mota.Plugin.require('shop_g').setShopVisited(data.id, true); Mota.require('@user/data-state').setShopVisited(data.id, true);
if (data.open) Mota.Plugin.require('shop_g').openShop(data.id, true); if (data.open) Mota.require('@user/data-state').openShop(data.id, true);
core.doAction(); core.doAction();
}; };
events.prototype._action_disableShop = function (data, x, y, prefix) { events.prototype._action_disableShop = function (data, x, y, prefix) {
Mota.Plugin.require('shop_g').setShopVisited(data.id, false); Mota.require('@user/data-state').setShopVisited(data.id, false);
core.doAction(); core.doAction();
}; };
@ -3396,7 +3411,7 @@ events.prototype.openToolbox = function (fromUserAction) {
////// 点击快捷商店按钮时的打开操作 ////// ////// 点击快捷商店按钮时的打开操作 //////
events.prototype.openQuickShop = function (fromUserAction) { events.prototype.openQuickShop = function (fromUserAction) {
if (core.isReplaying()) return; if (core.isReplaying()) return;
const shop = Mota.Plugin.require('shop_g'); const shop = Mota.require('@user/data-state');
if (Object.keys(core.status.shops).length == 0) { if (Object.keys(core.status.shops).length == 0) {
core.playSound('操作失败'); core.playSound('操作失败');

View File

@ -806,7 +806,7 @@ maps.prototype.generateMovableArray = function (floorId) {
for (var x = 0; x < width; ++x) { for (var x = 0; x < width; ++x) {
array[x] = Array(height).fill([]); array[x] = Array(height).fill([]);
} }
const loopMaps = Mota.require('module', 'Mechanism').MiscData.loopMaps; const loopMaps = Mota.require('@user/data-state').MiscData.loopMaps;
const isLoop = loopMaps.has(floorId); const isLoop = loopMaps.has(floorId);
var v2 = floorId == core.status.floorId && core.bigmap.v2; var v2 = floorId == core.status.floorId && core.bigmap.v2;
const half = core._HALF_WIDTH_; const half = core._HALF_WIDTH_;
@ -888,7 +888,7 @@ maps.prototype._canMoveHero_checkPoint = function (
var nx = x + core.utils.scan[direction].x, var nx = x + core.utils.scan[direction].x,
ny = y + core.utils.scan[direction].y; ny = y + core.utils.scan[direction].y;
const loopMaps = Mota.require('module', 'Mechanism').MiscData.loopMaps; const loopMaps = Mota.require('@user/data-state').MiscData.loopMaps;
if (loopMaps.has(floorId)) { if (loopMaps.has(floorId)) {
if (nx < 0) nx = floor.width - 1; if (nx < 0) nx = floor.width - 1;
if (nx >= floor.width) nx = 0; if (nx >= floor.width) nx = 0;
@ -1129,7 +1129,7 @@ maps.prototype.automaticRoute = function (destX, destY) {
var route = this._automaticRoute_bfs(startX, startY, destX, destY); var route = this._automaticRoute_bfs(startX, startY, destX, destY);
if (route[destX + ',' + destY] == null) return []; if (route[destX + ',' + destY] == null) return [];
const floor = core.status.thisMap; const floor = core.status.thisMap;
const loopMaps = Mota.require('module', 'Mechanism').MiscData.loopMaps; const loopMaps = Mota.require('@user/data-state').MiscData.loopMaps;
// 路径数组转换 // 路径数组转换
var ans = [], var ans = [],
@ -1162,7 +1162,7 @@ maps.prototype._automaticRoute_bfs = function (startX, startY, destX, destY) {
queue.queue({ depth: 0, x: startX, y: startY }); queue.queue({ depth: 0, x: startX, y: startY });
var blocks = core.getMapBlocksObj(); var blocks = core.getMapBlocksObj();
const floor = core.status.thisMap; const floor = core.status.thisMap;
const loopMaps = Mota.require('module', 'Mechanism').MiscData.loopMaps; const loopMaps = Mota.require('@user/data-state').MiscData.loopMaps;
while (queue.length != 0) { while (queue.length != 0) {
var curr = queue.dequeue(), var curr = queue.dequeue(),
@ -2654,7 +2654,7 @@ maps.prototype._drawThumbnail_realDrawTempCanvas = function (
options options
) { ) {
Mota.r(() => { Mota.r(() => {
const setting = Mota.require('var', 'mainSetting'); const setting = Mota.require('@motajs/legacy-ui').mainSetting;
options.ctx.imageSmoothingEnabled = !setting.getValue( options.ctx.imageSmoothingEnabled = !setting.getValue(
'screen.antiAliasing', 'screen.antiAliasing',
true true
@ -3230,7 +3230,7 @@ maps.prototype.removeBlockByIndex = function (index, floorId) {
delete core.status.mapBlockObjs[floorId][block.x + ',' + block.y]; delete core.status.mapBlockObjs[floorId][block.x + ',' + block.y];
core.setMapBlockDisabled(floorId, block.x, block.y, true); core.setMapBlockDisabled(floorId, block.x, block.y, true);
this._updateMapArray(floorId, block.x, block.y); this._updateMapArray(floorId, block.x, block.y);
Mota.require('var', 'hook').emit( Mota.require('@user/data-base').hook.emit(
'setBlock', 'setBlock',
block.x, block.x,
block.y, block.y,
@ -3384,7 +3384,7 @@ maps.prototype.setBlock = function (number, x, y, floorId, noredraw) {
} }
} }
} }
Mota.require('var', 'hook').emit( Mota.require('@user/data-base').hook.emit(
'setBlock', 'setBlock',
x, x,
y, y,
@ -3626,7 +3626,7 @@ maps.prototype.setBgFgBlock = function (name, number, x, y, floorId) {
else core.drawFg(floorId); else core.drawFg(floorId);
} }
Mota.require('var', 'hook').emit( Mota.require('@user/data-base').hook.emit(
'setBgFgBlock', 'setBgFgBlock',
name, name,
number, number,

View File

@ -1088,8 +1088,8 @@ ui.prototype._getPosition = function (content) {
py == null py == null
? 'center' ? 'center'
: py > core._HALF_HEIGHT_ : py > core._HALF_HEIGHT_
? 'up' ? 'up'
: 'down'; : 'down';
} }
return ''; return '';
} }
@ -2225,8 +2225,7 @@ ui.prototype._drawTextBox_getHorizontalPosition = function (
paddingRight = 12; paddingRight = 12;
if ((posInfo.px != null && posInfo.py != null) || posInfo.pos) if ((posInfo.px != null && posInfo.py != null) || posInfo.pos)
paddingLeft = 20; paddingLeft = 20;
if (titleInfo.icon != null) if (titleInfo.icon != null) paddingLeft = 62; // 15 + 32 + 15
paddingLeft = 62; // 15 + 32 + 15
else if (titleInfo.image) paddingLeft = 90; // 10 + 70 + 10 else if (titleInfo.image) paddingLeft = 90; // 10 + 70 + 10
var left = 7 + 3 * (core._HALF_WIDTH_ - 6), var left = 7 + 3 * (core._HALF_WIDTH_ - 6),
right = core._PX_ - left, right = core._PX_ - left,
@ -2996,8 +2995,8 @@ ui.prototype._drawSwitchs_display = function () {
(core.flags.extraDamageType == 2 (core.flags.extraDamageType == 2
? '[最简]' ? '[最简]'
: core.flags.extraDamageType == 1 : core.flags.extraDamageType == 1
? '[半透明]' ? '[半透明]'
: '[完整]'), : '[完整]'),
'自动放缩: ' + (core.getLocalStorage('autoScale') ? '[ON]' : '[OFF]'), '自动放缩: ' + (core.getLocalStorage('autoScale') ? '[ON]' : '[OFF]'),
'返回上一级' '返回上一级'
]; ];
@ -3053,7 +3052,7 @@ ui.prototype._drawNotes = function () {
////// 绘制快捷商店选择栏 ////// ////// 绘制快捷商店选择栏 //////
ui.prototype._drawQuickShop = function () { ui.prototype._drawQuickShop = function () {
const shop = Mota.Plugin.require('shop'); const shop = Mota.require('@user/legacy-plugin-data');
core.status.event.id = 'selectShop'; core.status.event.id = 'selectShop';
var shopList = core.status.shops, var shopList = core.status.shops,
keys = shop.listShopIds(); keys = shop.listShopIds();
@ -3662,8 +3661,8 @@ ui.prototype._drawSLPanel_drawRecords = function (n) {
core.status.event.id == 'save' core.status.event.id == 'save'
? '存档' ? '存档'
: core.status.event.id == 'load' : core.status.event.id == 'load'
? '读档' ? '读档'
: '回放'; : '回放';
for (var i = 0; i < (n || 6); i++) { for (var i = 0; i < (n || 6); i++) {
var data = core.status.event.ui[i]; var data = core.status.event.ui[i];

View File

@ -314,7 +314,10 @@ main.prototype.loadAsync = async function (mode, callback) {
if (main.mode === 'editor') return; if (main.mode === 'editor') return;
// 自动放缩最大化 // 自动放缩最大化
let auto = Mota.require('var', 'mainSetting').getValue('autoScale', true); let auto = Mota.require('@motajs/legacy-ui').mainSetting.getValue(
'autoScale',
true
);
if (auto && !core.domStyle.isVertical) { if (auto && !core.domStyle.isVertical) {
const height = window.innerHeight; const height = window.innerHeight;
@ -327,7 +330,7 @@ main.prototype.loadAsync = async function (mode, callback) {
core.domStyle.scale = window.innerWidth / core._PX_; core.domStyle.scale = window.innerWidth / core._PX_;
} }
Mota.r(() => { Mota.r(() => {
Mota.require('module', 'Render').MotaOffscreenCanvas2D.refreshAll(); Mota.require('@motajs/render').MotaOffscreenCanvas2D.refreshAll();
}); });
}; };

View File

@ -50,7 +50,7 @@ main.floors.MT0=
"\r[red]注意!!!\r[]该塔新增了很多新的功能同时对样板的ui进行了大幅度的改动操作也有改变由于内容过多这里不再一一描述具体请在道具栏查看百科全书百科全书是在你面前的几个道具中的其中一个", "\r[red]注意!!!\r[]该塔新增了很多新的功能同时对样板的ui进行了大幅度的改动操作也有改变由于内容过多这里不再一一描述具体请在道具栏查看百科全书百科全书是在你面前的几个道具中的其中一个",
{ {
"type": "function", "type": "function",
"function": "function(){\nif (!core.isReplaying()) Mota.require('var', 'fixedUi').open('chapter', { chapter: '序章 起源' });\n}" "function": "function(){\nif (!core.isReplaying()) Mota.require('@motajs/legacy-ui').fixedUi.open('chapter', { chapter: '序章 起源' });\n}"
} }
], ],
"parallelDo": "", "parallelDo": "",
@ -78,7 +78,7 @@ main.floors.MT0=
"yes": [ "yes": [
{ {
"type": "function", "type": "function",
"function": "function(){\nMota.require('module', 'RenderUtils').swapChapter(2, flags.hard);\n}" "function": "function(){\nMota.require('@motajs/legacy-ui').swapChapter(2, flags.hard);\n}"
} }
], ],
"no": [] "no": []

View File

@ -39,7 +39,7 @@ main.floors.MT12=
"手机端可以点击右下角的难度来切换下方工具栏至数字键", "手机端可以点击右下角的难度来切换下方工具栏至数字键",
{ {
"type": "function", "type": "function",
"function": "function(){\nconst HeroSkill = Mota.require('module', 'Mechanism').HeroSkill;\nHeroSkill.learnSkill(HeroSkill.Jump);\n}" "function": "function(){\nconst HeroSkill = Mota.require('@user/data-state').Mechanism.HeroSkill;\nHeroSkill.learnSkill(HeroSkill.Jump);\n}"
}, },
{ {
"type": "hide", "type": "hide",

View File

@ -147,7 +147,7 @@ main.floors.MT16=
}, },
{ {
"type": "function", "type": "function",
"function": "function(){\nconst controller = Mota.Plugin.require('chase_r').initChase(0);\ncontroller.initAudio(false);\n}" "function": "function(){\nconst controller = Mota.require('@user/legacy-plugin-client').initChase(0);\ncontroller.initAudio(false);\n}"
}, },
{ {
"type": "show", "type": "show",
@ -410,7 +410,7 @@ main.floors.MT16=
"这里是漏怪检测,将会检测\r[gold]洞穴、山路、山脚、平原\r[white]地区的怪物是否清完", "这里是漏怪检测,将会检测\r[gold]洞穴、山路、山脚、平原\r[white]地区的怪物是否清完",
{ {
"type": "function", "type": "function",
"function": "function(){\nconst enemy = Mota.Plugin.require('remainEnemy_g').getRemainEnemyString(core.floorIds.slice(5, 17));\nif (enemy.length === 0) {\n\tcore.insertAction(['当前无剩余怪物!', { \"type\": \"hide\", \"remove\": true }, ]);\n} else {\n\tcore.insertAction(enemy);\n}\n}" "function": "function(){\nconst enemy = Mota.require('@user/legacy-plugin-data').getRemainEnemyString(core.floorIds.slice(5, 17));\nif (enemy.length === 0) {\n\tcore.insertAction(['当前无剩余怪物!', { \"type\": \"hide\", \"remove\": true }, ]);\n} else {\n\tcore.insertAction(enemy);\n}\n}"
}, },
{ {
"type": "loadBgm", "type": "loadBgm",

View File

@ -157,7 +157,7 @@ main.floors.MT21=
"\t[低级智人]\b[up,hero]或许智慧结晶会告诉我答案吧。", "\t[低级智人]\b[up,hero]或许智慧结晶会告诉我答案吧。",
{ {
"type": "function", "type": "function",
"function": "function(){\nif (!core.isReplaying()) Mota.require('var', 'fixedUi').open('chapter', { chapter: '第二章 智慧' });\nMota.Plugin.require('removeMap_g').removeMaps('tower1', 'tower7', true);\ndelete flags.tower1;\ndelete flags.wordsTimeOut;\ndelete flags.boom;\ndelete flags.booming;\n}" "function": "function(){\nif (!core.isReplaying()) Mota.require('@motajs/legacy-ui').fixedUi.open('chapter', { chapter: '第二章 智慧' });\nMota.Plugin.require('removeMap_g').removeMaps('tower1', 'tower7', true);\ndelete flags.tower1;\ndelete flags.wordsTimeOut;\ndelete flags.boom;\ndelete flags.booming;\n}"
}, },
{ {
"type": "setValue", "type": "setValue",

View File

@ -149,7 +149,7 @@ main.floors.MT31=
"这里是漏怪检测,会检测\r[gold]勇气之路\r[]区域是否有遗漏怪物", "这里是漏怪检测,会检测\r[gold]勇气之路\r[]区域是否有遗漏怪物",
{ {
"type": "function", "type": "function",
"function": "function(){\nconst enemy = Mota.Plugin.require('remainEnemy_g').getRemainEnemyString(core.floorIds.slice(17, 23));\nif (enemy.length === 0) {\n\tcore.insertAction(['当前无剩余怪物!', { \"type\": \"hide\", \"remove\": true }, ]);\n} else {\n\tcore.insertAction(enemy);\n}\n}" "function": "function(){\nconst enemy = Mota.require('@user/legacy-plugin-data').getRemainEnemyString(core.floorIds.slice(17, 23));\nif (enemy.length === 0) {\n\tcore.insertAction(['当前无剩余怪物!', { \"type\": \"hide\", \"remove\": true }, ]);\n} else {\n\tcore.insertAction(enemy);\n}\n}"
} }
] ]
}, },

View File

@ -76,7 +76,7 @@ main.floors.MT35=
"这里是漏怪检测,会检测\r[gold]智慧小径\r[]区域是否有遗漏怪物", "这里是漏怪检测,会检测\r[gold]智慧小径\r[]区域是否有遗漏怪物",
{ {
"type": "function", "type": "function",
"function": "function(){\nconst enemy = Mota.Plugin.require('remainEnemy_g').getRemainEnemyString(core.floorIds.slice(30, 40));\nif (enemy.length === 0) {\n\tcore.insertAction(['当前无剩余怪物!', { \"type\": \"hide\", \"remove\": true }, ]);\n} else {\n\tcore.insertAction(enemy);\n}\n}" "function": "function(){\nconst enemy = Mota.require('@user/legacy-plugin-data').getRemainEnemyString(core.floorIds.slice(30, 40));\nif (enemy.length === 0) {\n\tcore.insertAction(['当前无剩余怪物!', { \"type\": \"hide\", \"remove\": true }, ]);\n} else {\n\tcore.insertAction(enemy);\n}\n}"
} }
], ],
"7,0": [ "7,0": [

View File

@ -134,7 +134,7 @@ main.floors.MT5=
"这里是漏怪检测,会检测\r[gold]山洞\r[]区域的怪物是否清空", "这里是漏怪检测,会检测\r[gold]山洞\r[]区域的怪物是否清空",
{ {
"type": "function", "type": "function",
"function": "function(){\nconst enemy = Mota.Plugin.require('remainEnemy_g').getRemainEnemyString(core.floorIds.slice(0, 5));\nif (enemy.length === 0) {\n\tcore.insertAction(['当前无剩余怪物!', { \"type\": \"hide\", \"remove\": true }, ]);\n} else {\n\tcore.insertAction(enemy);\n}\n}" "function": "function(){\nconst enemy = Mota.require('@user/legacy-plugin-data').getRemainEnemyString(core.floorIds.slice(0, 5));\nif (enemy.length === 0) {\n\tcore.insertAction(['当前无剩余怪物!', { \"type\": \"hide\", \"remove\": true }, ]);\n} else {\n\tcore.insertAction(enemy);\n}\n}"
} }
] ]
}, },

View File

@ -25,7 +25,7 @@ main.floors.MT54=
{ {
"type": "function", "type": "function",
"async": true, "async": true,
"function": "function(){\nMota.require('module', 'Mechanism').BluePalace.doorConvert(7, 9);\n}" "function": "function(){\nMota.require('@user/data-state').Mechanism.BluePalace.doorConvert(7, 9);\n}"
} }
] ]
}, },

View File

@ -21,7 +21,7 @@ main.floors.MT55=
{ {
"type": "function", "type": "function",
"async": true, "async": true,
"function": "function(){\nMota.require('module', 'Mechanism').BluePalace.doorConvert(6, 7);\n}" "function": "function(){\nMota.require('@user/data-state').Mechanism.BluePalace.doorConvert(6, 7);\n}"
} }
] ]
}, },

View File

@ -21,7 +21,7 @@ main.floors.MT56=
{ {
"type": "function", "type": "function",
"async": true, "async": true,
"function": "function(){\nMota.require('module', 'Mechanism').BluePalace.doorConvert(3, 8);\n}" "function": "function(){\nMota.require('@user/data-state').Mechanism.BluePalace.doorConvert(3, 8);\n}"
} }
] ]
}, },

View File

@ -21,14 +21,14 @@ main.floors.MT58=
{ {
"type": "function", "type": "function",
"async": true, "async": true,
"function": "function(){\nMota.require('module', 'Mechanism').BluePalace.doorConvert(11, 3);\n}" "function": "function(){\nMota.require('@user/data-state').Mechanism.BluePalace.doorConvert(11, 3);\n}"
} }
], ],
"6,1": [ "6,1": [
{ {
"type": "function", "type": "function",
"async": true, "async": true,
"function": "function(){\nMota.require('module', 'Mechanism').BluePalace.doorConvert(6, 1);\n}" "function": "function(){\nMota.require('@user/data-state').Mechanism.BluePalace.doorConvert(6, 1);\n}"
} }
] ]
}, },

View File

@ -63,7 +63,7 @@ main.floors.MT6=
"\t[原始人]\b[down,hero]感觉好像可以学习一些简单的东西了。", "\t[原始人]\b[down,hero]感觉好像可以学习一些简单的东西了。",
{ {
"type": "function", "type": "function",
"function": "function(){\nif (!core.isReplaying()) Mota.require('var', 'fixedUi').open('chapter', { chapter: '第一章 勇气' });\n}" "function": "function(){\nif (!core.isReplaying()) Mota.require('@motajs/legacy-ui').fixedUi.open('chapter', { chapter: '第一章 勇气' });\n}"
}, },
{ {
"type": "setValue", "type": "setValue",

View File

@ -21,7 +21,7 @@ main.floors.MT80=
{ {
"type": "function", "type": "function",
"async": true, "async": true,
"function": "function(){\nMota.require('module', 'Mechanism').BluePalace.doorConvert(7, 2);\n}" "function": "function(){\nMota.require('@user/data-state').Mechanism.BluePalace.doorConvert(7, 2);\n}"
} }
] ]
}, },

View File

@ -21,14 +21,14 @@ main.floors.MT94=
"这里是漏怪检测,会检测\r[gold]第二章所有\r[]区域是否有遗漏怪物", "这里是漏怪检测,会检测\r[gold]第二章所有\r[]区域是否有遗漏怪物",
{ {
"type": "function", "type": "function",
"function": "function(){\nconst enemy = Mota.Plugin.require('remainEnemy_g').getRemainEnemyString(core.floorIds.slice(40, 107));\nif (enemy.length === 0) {\n\tcore.insertAction(['当前无剩余怪物!', { \"type\": \"hide\", \"remove\": true }, ]);\n} else {\n\tcore.insertAction(enemy);\n}\n}" "function": "function(){\nconst enemy = Mota.require('@user/legacy-plugin-data').getRemainEnemyString(core.floorIds.slice(40, 107));\nif (enemy.length === 0) {\n\tcore.insertAction(['当前无剩余怪物!', { \"type\": \"hide\", \"remove\": true }, ]);\n} else {\n\tcore.insertAction(enemy);\n}\n}"
} }
], ],
"2,5": [ "2,5": [
{ {
"type": "function", "type": "function",
"async": true, "async": true,
"function": "function(){\nMota.require('module', 'Mechanism').BluePalace.doorConvert(2, 5);\n}" "function": "function(){\nMota.require('@user/data-state').Mechanism.BluePalace.doorConvert(2, 5);\n}"
} }
] ]
}, },

View File

@ -21,7 +21,7 @@ main.floors.MT95=
{ {
"type": "function", "type": "function",
"async": true, "async": true,
"function": "function(){\nMota.require('module', 'Mechanism').BluePalace.doorConvert(3, 8);\n}" "function": "function(){\nMota.require('@user/data-state').Mechanism.BluePalace.doorConvert(3, 8);\n}"
} }
] ]
}, },

View File

@ -21,7 +21,7 @@ main.floors.MT96=
{ {
"type": "function", "type": "function",
"async": true, "async": true,
"function": "function(){\nMota.require('module', 'Mechanism').BluePalace.doorConvert(13, 9);\n}" "function": "function(){\nMota.require('@user/data-state').Mechanism.BluePalace.doorConvert(13, 9);\n}"
} }
] ]
}, },

View File

@ -21,7 +21,7 @@ main.floors.tower5=
"这里是漏怪检测,会检测\r[gold]智慧之塔\r[]区域是否有遗漏怪物", "这里是漏怪检测,会检测\r[gold]智慧之塔\r[]区域是否有遗漏怪物",
{ {
"type": "function", "type": "function",
"function": "function(){\nconst enemy = Mota.Plugin.require('remainEnemy_g').getRemainEnemyString([\"tower1\", \"tower2\", \"tower3\", \"tower4\", \"tower5\", \"tower6\"]);\nif (enemy.length === 0) {\n\tcore.insertAction(['当前无剩余怪物!', { \"type\": \"hide\", \"remove\": true }, ]);\n} else {\n\tcore.insertAction(enemy);\n}\n}" "function": "function(){\nconst enemy = Mota.require('@user/legacy-plugin-data').getRemainEnemyString([\"tower1\", \"tower2\", \"tower3\", \"tower4\", \"tower5\", \"tower6\"]);\nif (enemy.length === 0) {\n\tcore.insertAction(['当前无剩余怪物!', { \"type\": \"hide\", \"remove\": true }, ]);\n} else {\n\tcore.insertAction(enemy);\n}\n}"
} }
] ]
}, },

View File

@ -51,8 +51,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
core.hideStatusBar(core.hasFlag('showToolbox')); core.hideStatusBar(core.hasFlag('showToolbox'));
else core.showStatusBar(); else core.showStatusBar();
if (main.mode === 'play' && !main.replayChecking) { if (main.mode === 'play' && !main.replayChecking) {
Mota.Plugin.require('fly_r').splitArea(); Mota.require('@motajs/legacy-ui').splitArea();
Mota.require('var', 'hook').emit('reset'); Mota.require('@user/data-base').hook.emit('reset');
} else { } else {
flags.autoSkill ??= true; flags.autoSkill ??= true;
} }
@ -78,10 +78,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
}); });
} }
const { NightSpecial, HeroSkill } = Mota.require( const { NightSpecial, HeroSkill } =
'module', Mota.require('@user/data-state');
'Mechanism'
);
NightSpecial.clearNight(core.floorIds); NightSpecial.clearNight(core.floorIds);
HeroSkill.clearSkill(); HeroSkill.clearSkill();
}, },
@ -155,7 +153,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
} }
// 根据分区信息自动砍层与恢复 // 根据分区信息自动砍层与恢复
Mota.Plugin.require('removeMap_g')?.autoRemoveMaps?.(floorId); Mota.require('@user/legacy-plugin-data')?.autoRemoveMaps?.(floorId);
// 重置画布尺寸 // 重置画布尺寸
core.maps.resizeMap(floorId); core.maps.resizeMap(floorId);
@ -219,9 +217,12 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
core.visitFloor(floorId); core.visitFloor(floorId);
} }
} }
if (!flags.debug && !main.replayChecking) // if (!flags.debug && !main.replayChecking)
Mota.Plugin.require('completion_r').checkVisitedFloor(); // Mota.Plugin.require('completion_r').checkVisitedFloor();
Mota.require('var', 'hook').emit('afterChangeFloor', floorId); Mota.require('@user/data-base').hook.emit(
'afterChangeFloor',
floorId
);
}, },
flyTo: function (toId, callback) { flyTo: function (toId, callback) {
// 楼层传送器的使用从当前楼层飞往toId // 楼层传送器的使用从当前楼层飞往toId
@ -267,10 +268,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
values[key] = core.clone(core.values[key]); values[key] = core.clone(core.values[key]);
} }
const { NightSpecial, HeroSkill } = Mota.require( const { NightSpecial, HeroSkill } =
'module', Mota.require('@user/data-state');
'Mechanism'
);
// 要存档的内容 // 要存档的内容
var data = { var data = {
@ -283,7 +282,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
version: core.firstData.version, version: core.firstData.version,
guid: core.getGuid(), guid: core.getGuid(),
time: new Date().getTime(), time: new Date().getTime(),
skills: Mota.Plugin.require('skillTree_g').saveSkillTree(), skills: Mota.require('@user/data-state').saveSkillTree(),
night: [...NightSpecial.saveNight()], night: [...NightSpecial.saveNight()],
skill: HeroSkill.saveSkill() skill: HeroSkill.saveSkill()
}; };
@ -329,11 +328,9 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
} }
core.setFlag('__fromLoad__', true); core.setFlag('__fromLoad__', true);
Mota.Plugin.require('skillTree_g').loadSkillTree(data.skills); Mota.require('@user/data-state').loadSkillTree(data.skills);
const { NightSpecial, HeroSkill } = Mota.require( const { NightSpecial, HeroSkill } =
'module', Mota.require('@user/data-state');
'Mechanism'
);
if (!data.night) { if (!data.night) {
// 兼容旧版 // 兼容旧版
@ -389,7 +386,9 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
Mota.r(() => { Mota.r(() => {
if (flags.onChase) { if (flags.onChase) {
const chase = Mota.Plugin.require('chase_r'); const chase = Mota.require(
'@user/legacy-plugin-client'
);
const controller = chase.initChase(0); const controller = chase.initChase(0);
controller.start(true); controller.start(true);
} }
@ -456,7 +455,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
// 如需强行终止行走可以在这里条件判定: // 如需强行终止行走可以在这里条件判定:
// core.stopAutomaticRoute(); // core.stopAutomaticRoute();
Mota.require('var', 'hook').emit( Mota.require('@user/data-base').hook.emit(
'moveOneStep', 'moveOneStep',
nowx, nowx,
nowy, nowy,

View File

@ -40,8 +40,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "小绿宝石", "name": "小绿宝石",
"text": ",护盾+${core.values.greenGem}", "text": ",护盾+${core.values.greenGem}",
"itemEffect": "core.status.hero.mdef += Math.round(20 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))", "itemEffect": "core.status.hero.mdef += Math.round(20 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.require('@user/data-state').getSkillLevel(12) / 20 + 1))",
"itemEffectTip": ",智慧+${Math.round(20 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))}", "itemEffectTip": ",智慧+${Math.round(20 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.require('@user/data-state').getSkillLevel(12) / 20 + 1))}",
"useItemEffect": "core.status.hero.mdef += core.values.greenGem", "useItemEffect": "core.status.hero.mdef += core.values.greenGem",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -97,8 +97,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "红血瓶", "name": "红血瓶",
"text": ",生命+${core.values.redPotion}", "text": ",生命+${core.values.redPotion}",
"itemEffect": "core.status.hero.hp += Math.round(100 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", "itemEffect": "core.status.hero.hp += Math.round(100 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))",
"itemEffectTip": ",生命+${Math.round(100 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}", "itemEffectTip": ",生命+${Math.round(100 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))}",
"useItemEffect": "core.status.hero.hp += core.values.redPotion", "useItemEffect": "core.status.hero.hp += core.values.redPotion",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -106,8 +106,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "蓝血瓶", "name": "蓝血瓶",
"text": ",生命+${core.values.bluePotion}", "text": ",生命+${core.values.bluePotion}",
"itemEffect": "core.status.hero.hp += Math.round(200 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", "itemEffect": "core.status.hero.hp += Math.round(200 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))",
"itemEffectTip": ",生命+${Math.round(200 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}", "itemEffectTip": ",生命+${Math.round(200 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))}",
"useItemEffect": "core.status.hero.hp += core.values.bluePotion", "useItemEffect": "core.status.hero.hp += core.values.bluePotion",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -115,8 +115,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "黄血瓶", "name": "黄血瓶",
"text": ",生命+${core.values.yellowPotion}", "text": ",生命+${core.values.yellowPotion}",
"itemEffect": "core.status.hero.hp += Math.round(400 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", "itemEffect": "core.status.hero.hp += Math.round(400 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))",
"itemEffectTip": ",生命+${Math.round(400 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}", "itemEffectTip": ",生命+${Math.round(400 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))}",
"useItemEffect": "core.status.hero.hp += core.values.yellowPotion", "useItemEffect": "core.status.hero.hp += core.values.yellowPotion",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -124,8 +124,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "绿血瓶", "name": "绿血瓶",
"text": ",生命+${core.values.greenPotion}", "text": ",生命+${core.values.greenPotion}",
"itemEffect": "core.status.hero.hp += Math.round(800 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", "itemEffect": "core.status.hero.hp += Math.round(800 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))",
"itemEffectTip": ",生命+${Math.round(800 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}", "itemEffectTip": ",生命+${Math.round(800 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))}",
"useItemEffect": "core.status.hero.hp += core.values.greenPotion", "useItemEffect": "core.status.hero.hp += core.values.greenPotion",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -349,7 +349,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"name": "查看技能", "name": "查看技能",
"text": "查看勇士的技能", "text": "查看勇士的技能",
"canUseItemEffect": true, "canUseItemEffect": true,
"useItemEffect": "Mota.require('var', 'mainUi').open('skill');" "useItemEffect": "Mota.require('@motajs/legacy-ui').mainUi.open('skill');"
}, },
"dagger": { "dagger": {
"cls": "constants", "cls": "constants",
@ -522,7 +522,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"name": "技能树", "name": "技能树",
"text": "打开技能树", "text": "打开技能树",
"hideInReplay": true, "hideInReplay": true,
"useItemEffect": "Mota.Plugin.require('skillTree_g').openTree();", "useItemEffect": "Mota.require('@user/data-state').openTree();",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
"wand": { "wand": {
@ -626,8 +626,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "中绿宝石", "name": "中绿宝石",
"text": ",护盾+${core.values.greenGem}", "text": ",护盾+${core.values.greenGem}",
"itemEffect": "core.status.hero.mdef += Math.round(40 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))", "itemEffect": "core.status.hero.mdef += Math.round(40 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.require('@user/data-state').getSkillLevel(12) / 20 + 1))",
"itemEffectTip": ",智慧+${Math.round(40 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))}", "itemEffectTip": ",智慧+${Math.round(40 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.require('@user/data-state').getSkillLevel(12) / 20 + 1))}",
"useItemEffect": "core.status.hero.mdef += core.values.greenGem", "useItemEffect": "core.status.hero.mdef += core.values.greenGem",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -729,8 +729,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "大绿宝石", "name": "大绿宝石",
"text": ",护盾+${core.values.greenGem}", "text": ",护盾+${core.values.greenGem}",
"itemEffect": "core.status.hero.mdef += Math.round(80 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))", "itemEffect": "core.status.hero.mdef += Math.round(80 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.require('@user/data-state').getSkillLevel(12) / 20 + 1))",
"itemEffectTip": ",智慧+${Math.round(80 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))}", "itemEffectTip": ",智慧+${Math.round(80 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.require('@user/data-state').getSkillLevel(12) / 20 + 1))}",
"useItemEffect": "core.status.hero.mdef += core.values.greenGem", "useItemEffect": "core.status.hero.mdef += core.values.greenGem",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -896,8 +896,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "超大绿宝石", "name": "超大绿宝石",
"text": ",护盾+${core.values.greenGem}", "text": ",护盾+${core.values.greenGem}",
"itemEffect": "core.status.hero.mdef += Math.round(160 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))", "itemEffect": "core.status.hero.mdef += Math.round(160 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.require('@user/data-state').getSkillLevel(12) / 20 + 1))",
"itemEffectTip": ",智慧+${Math.round(160 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))}", "itemEffectTip": ",智慧+${Math.round(160 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.require('@user/data-state').getSkillLevel(12) / 20 + 1))}",
"useItemEffect": "core.status.hero.mdef += core.values.greenGem", "useItemEffect": "core.status.hero.mdef += core.values.greenGem",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -1019,8 +1019,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "璀璨绿宝石", "name": "璀璨绿宝石",
"text": ",护盾+${core.values.greenGem}", "text": ",护盾+${core.values.greenGem}",
"itemEffect": "core.status.hero.mdef += Math.round(320 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))", "itemEffect": "core.status.hero.mdef += Math.round(320 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.require('@user/data-state').getSkillLevel(12) / 20 + 1))",
"itemEffectTip": ",智慧+${Math.round(320 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))}", "itemEffectTip": ",智慧+${Math.round(320 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.require('@user/data-state').getSkillLevel(12) / 20 + 1))}",
"useItemEffect": "core.status.hero.mdef += core.values.greenGem", "useItemEffect": "core.status.hero.mdef += core.values.greenGem",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -1050,8 +1050,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "传奇绿宝石", "name": "传奇绿宝石",
"text": ",防御+${core.values.blueGem}", "text": ",防御+${core.values.blueGem}",
"itemEffect": "core.status.hero.mdef += Math.round(640 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))", "itemEffect": "core.status.hero.mdef += Math.round(640 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.require('@user/data-state').getSkillLevel(12) / 20 + 1))",
"itemEffectTip": ",智慧+${Math.round(640 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))}", "itemEffectTip": ",智慧+${Math.round(640 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.require('@user/data-state').getSkillLevel(12) / 20 + 1))}",
"useItemEffect": "core.status.hero.def += core.values.blueGem", "useItemEffect": "core.status.hero.def += core.values.blueGem",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -1071,8 +1071,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "史诗绿宝石", "name": "史诗绿宝石",
"text": ",护盾+${core.values.greenGem}", "text": ",护盾+${core.values.greenGem}",
"itemEffect": "core.status.hero.mdef += Math.round(1280 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))", "itemEffect": "core.status.hero.mdef += Math.round(1280 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.require('@user/data-state').getSkillLevel(12) / 20 + 1))",
"itemEffectTip": ",智慧+${Math.round(1280 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))}", "itemEffectTip": ",智慧+${Math.round(1280 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.require('@user/data-state').getSkillLevel(12) / 20 + 1))}",
"useItemEffect": "core.status.hero.mdef += core.values.greenGem", "useItemEffect": "core.status.hero.mdef += core.values.greenGem",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -1100,8 +1100,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "大红血瓶", "name": "大红血瓶",
"text": ",生命+${core.values.redPotion}", "text": ",生命+${core.values.redPotion}",
"itemEffect": "core.status.hero.hp += Math.round(1000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", "itemEffect": "core.status.hero.hp += Math.round(1000 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))",
"itemEffectTip": ",生命+${Math.round(1000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}", "itemEffectTip": ",生命+${Math.round(1000 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))}",
"useItemEffect": "core.status.hero.hp += core.values.redPotion", "useItemEffect": "core.status.hero.hp += core.values.redPotion",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -1113,8 +1113,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "大蓝血瓶", "name": "大蓝血瓶",
"text": ",生命+${core.values.redPotion}", "text": ",生命+${core.values.redPotion}",
"itemEffect": "core.status.hero.hp += Math.round(2000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", "itemEffect": "core.status.hero.hp += Math.round(2000 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))",
"itemEffectTip": ",生命+${Math.round(2000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}", "itemEffectTip": ",生命+${Math.round(2000 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))}",
"useItemEffect": "core.status.hero.hp += core.values.redPotion", "useItemEffect": "core.status.hero.hp += core.values.redPotion",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -1130,8 +1130,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "大绿血瓶", "name": "大绿血瓶",
"text": ",生命+${core.values.redPotion}", "text": ",生命+${core.values.redPotion}",
"itemEffect": "core.status.hero.hp += Math.round(8000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", "itemEffect": "core.status.hero.hp += Math.round(8000 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))",
"itemEffectTip": ",生命+${Math.round(8000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}", "itemEffectTip": ",生命+${Math.round(8000 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))}",
"useItemEffect": "core.status.hero.hp += core.values.redPotion", "useItemEffect": "core.status.hero.hp += core.values.redPotion",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -1151,8 +1151,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "大黄血瓶", "name": "大黄血瓶",
"text": ",生命+${core.values.redPotion}", "text": ",生命+${core.values.redPotion}",
"itemEffect": "core.status.hero.hp += Math.round(4000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", "itemEffect": "core.status.hero.hp += Math.round(4000 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))",
"itemEffectTip": ",生命+${Math.round(4000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}", "itemEffectTip": ",生命+${Math.round(4000 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))}",
"useItemEffect": "core.status.hero.hp += core.values.redPotion", "useItemEffect": "core.status.hero.hp += core.values.redPotion",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -1168,20 +1168,20 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"name": "系统设置", "name": "系统设置",
"canUseItemEffect": "true", "canUseItemEffect": "true",
"text": "内含所有系统设置项", "text": "内含所有系统设置项",
"useItemEffect": "if (!core.isReplaying()) Mota.require('var', 'mainUi').open('settings');" "useItemEffect": "if (!core.isReplaying()) Mota.require('@motajs/legacy-ui').mainUi.open('settings');"
}, },
"I560": { "I560": {
"cls": "constants", "cls": "constants",
"name": "百科全书", "name": "百科全书",
"canUseItemEffect": "true", "canUseItemEffect": "true",
"text": "一个包含游戏中所有功能详细说明的百科全书,可以查看游戏中所有的功能", "text": "一个包含游戏中所有功能详细说明的百科全书,可以查看游戏中所有的功能",
"useItemEffect": "if (!core.isReplaying()) Mota.require('var', 'mainUi').open('desc');" "useItemEffect": "if (!core.isReplaying()) Mota.require('@motajs/legacy-ui').mainUi.open('desc');"
}, },
"I565": { "I565": {
"cls": "constants", "cls": "constants",
"name": "学习", "name": "学习",
"canUseItemEffect": "true", "canUseItemEffect": "true",
"text": "可以学习怪物的技能,学习后持续${Mota.Plugin.require('skillTree_g').getSkillLevel(11) * 3 + 2}场战斗" "text": "可以学习怪物的技能,学习后持续${Mota.require('@user/data-state').getSkillLevel(11) * 3 + 2}场战斗"
}, },
"I574": { "I574": {
"cls": "items", "cls": "items",
@ -1233,7 +1233,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "constants", "cls": "constants",
"name": "成就", "name": "成就",
"canUseItemEffect": "true", "canUseItemEffect": "true",
"useItemEffect": "Mota.require('var', 'mainUi').open('achievement');", "useItemEffect": "Mota.require('@motajs/legacy-ui').mainUi.open('achievement');",
"text": "可以查看成就" "text": "可以查看成就"
}, },
"I662": { "I662": {
@ -1295,28 +1295,28 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "高级红血瓶", "name": "高级红血瓶",
"canUseItemEffect": "true", "canUseItemEffect": "true",
"itemEffect": "core.status.hero.hp += Math.round(10000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", "itemEffect": "core.status.hero.hp += Math.round(10000 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))",
"itemEffectTip": ",生命+${Math.round(10000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}" "itemEffectTip": ",生命+${Math.round(10000 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))}"
}, },
"I695": { "I695": {
"cls": "items", "cls": "items",
"name": "高级蓝血瓶", "name": "高级蓝血瓶",
"canUseItemEffect": "true", "canUseItemEffect": "true",
"itemEffect": "core.status.hero.hp += Math.round(20000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", "itemEffect": "core.status.hero.hp += Math.round(20000 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))",
"itemEffectTip": ",生命+${Math.round(20000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}" "itemEffectTip": ",生命+${Math.round(20000 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))}"
}, },
"I696": { "I696": {
"cls": "items", "cls": "items",
"name": "高级绿血瓶", "name": "高级绿血瓶",
"canUseItemEffect": "true", "canUseItemEffect": "true",
"itemEffect": "core.status.hero.hp += Math.round(40000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", "itemEffect": "core.status.hero.hp += Math.round(40000 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))",
"itemEffectTip": ",生命+${Math.round(40000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}" "itemEffectTip": ",生命+${Math.round(40000 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))}"
}, },
"I697": { "I697": {
"cls": "items", "cls": "items",
"name": "高级紫血瓶", "name": "高级紫血瓶",
"canUseItemEffect": "true", "canUseItemEffect": "true",
"itemEffect": "core.status.hero.hp += Math.round(80000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", "itemEffect": "core.status.hero.hp += Math.round(80000 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))",
"itemEffectTip": ",生命+${Math.round(80000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}" "itemEffectTip": ",生命+${Math.round(80000 * core.status.thisMap.ratio * (1 + Mota.require('@user/data-state').getSkillLevel(13) / 50))}"
} }
} }

View File

@ -1,12 +1,14 @@
import { createApp } from 'vue'; import { createApp } from 'vue';
import App from './App.vue';
import './styles.less'; import './styles.less';
import { createGame } from '@user/entry-client'; import { createGame } from '@user/entry-client';
createApp(App).mount('#root');
// 创建游戏实例 // 创建游戏实例
createGame(); createGame();
(async () => {
const App = (await import('./App.vue')).default;
createApp(App).mount('#root');
})();
main.init('play'); main.init('play');
main.listen(); main.listen();

View File

@ -218,7 +218,7 @@ interface Control {
/** /**
* control函数列表 * control函数列表
*/ */
readonly controlData: ControlData; readonly controldata: ControlData;
/** /**
* @deprecated * @deprecated
@ -1169,6 +1169,15 @@ interface Control {
_replay_SL(): void; _replay_SL(): void;
_replay_viewMap(): void; _replay_viewMap(): void;
_replay_error(action: string): void; _replay_error(action: string): void;
_setAutomaticRoute_isMoving(x: number, y: number): boolean;
_setAutomaticRoute_isTurning(x: number, y: number, postfix: any): boolean;
_setAutomaticRoute_clickMoveDirectly(
x: number,
y: number,
postfix: any
): boolean;
_setAutomaticRoute_drawRoute(step: any): void;
_setAutomaticRoute_setAutoSteps(step: any): void;
} }
declare const control: new () => Control; declare const control: new () => Control;

View File

@ -812,6 +812,20 @@ interface Events extends EventData {
__action_getLoc(data: any, x?: number, y?: number, prefix?: any): any; __action_getLoc(data: any, x?: number, y?: number, prefix?: any): any;
_changeFloor_beforeChange(info: any, callback: () => void): void; _changeFloor_beforeChange(info: any, callback: () => void): void;
_action_moveAction(data: any, x: number, y: number, prefix: any): void;
_openDoor_check(
block: Block,
x: number,
y: number,
needKey: boolean
): boolean;
_openDoor_animate(
block: Block,
x: number,
y: number,
callback?: () => void
): void;
} }
declare const events: new () => Events; declare const events: new () => Events;