修改主对象的名称

This commit is contained in:
unanmed 2023-09-06 11:59:44 +08:00
parent e6d96f6e2a
commit 7073ac92c6
35 changed files with 122 additions and 134 deletions

View File

@ -2317,7 +2317,7 @@ control.prototype._doSL_load = function (id, callback) {
1 1
)[0]; )[0];
if (!main.replayChecking) { if (!main.replayChecking) {
ancTe.plugin.ui.startOpened.value = false; mota.plugin.ui.startOpened.value = false;
} }
if (core.isPlaying() && !core.status.gameOver) { if (core.isPlaying() && !core.status.gameOver) {
core.control.autosave(0); core.control.autosave(0);
@ -2334,7 +2334,7 @@ control.prototype._doSL_load = function (id, callback) {
null, null,
function (data) { function (data) {
if (!main.replayChecking && data) { if (!main.replayChecking && data) {
ancTe.plugin.ui.startOpened.value = false; mota.plugin.ui.startOpened.value = false;
} }
if (id == 'autoSave' && data != null) { if (id == 'autoSave' && data != null) {
core.saves.autosave.data = data; core.saves.autosave.data = data;
@ -3013,7 +3013,7 @@ control.prototype.removeSwitch = function (x, y, floorId, name) {
control.prototype.lockControl = function () { control.prototype.lockControl = function () {
core.status.lockControl = true; core.status.lockControl = true;
if (!main.replayChecking) { if (!main.replayChecking) {
ancTe.plugin.fixed.showFixed.value = false; mota.plugin.fixed.showFixed.value = false;
} }
}; };
@ -3346,19 +3346,19 @@ control.prototype.screenFlash = function (
control.prototype.playBgm = function (bgm, startTime) { control.prototype.playBgm = function (bgm, startTime) {
bgm = core.getMappedName(bgm); bgm = core.getMappedName(bgm);
if (main.mode !== 'play') return; if (main.mode !== 'play') return;
ancTe.bgm.play(bgm, startTime); mota.bgm.play(bgm, startTime);
}; };
////// 暂停背景音乐的播放 ////// ////// 暂停背景音乐的播放 //////
control.prototype.pauseBgm = function () { control.prototype.pauseBgm = function () {
if (main.mode !== 'play') return; if (main.mode !== 'play') return;
ancTe.bgm.pause(); mota.bgm.pause();
}; };
////// 恢复背景音乐的播放 ////// ////// 恢复背景音乐的播放 //////
control.prototype.resumeBgm = function (resumeTime) { control.prototype.resumeBgm = function (resumeTime) {
if (main.mode !== 'play') return; if (main.mode !== 'play') return;
ancTe.bgm.resume(); mota.bgm.resume();
}; };
////// 更改背景音乐的播放 ////// ////// 更改背景音乐的播放 //////
@ -3380,19 +3380,19 @@ control.prototype.playSound = function (sound, pitch, callback) {
!core.material.sounds[sound] !core.material.sounds[sound]
) )
return; return;
ancTe.sound.play(sound, callback); mota.sound.play(sound, callback);
}; };
////// 停止所有音频 ////// ////// 停止所有音频 //////
control.prototype.stopSound = function (id) { control.prototype.stopSound = function (id) {
if (typeof id === 'number') ancTe.sound.stop(id); if (typeof id === 'number') mota.sound.stop(id);
else ancTe.sound.stopAll(); else mota.sound.stopAll();
}; };
////// 获得当前正在播放的所有指定音效的id列表 ////// ////// 获得当前正在播放的所有指定音效的id列表 //////
control.prototype.getPlayingSounds = function (name) { control.prototype.getPlayingSounds = function (name) {
name = core.getMappedName(name); name = core.getMappedName(name);
return ancTe.sound.getPlaying(name); return mota.sound.getPlaying(name);
}; };
////// 检查bgm状态 ////// ////// 检查bgm状态 //////

View File

@ -26,7 +26,7 @@ events.prototype.startGame = function (hard, seed, route, callback) {
hard = hard || ''; hard = hard || '';
core.dom.gameGroup.style.display = 'block'; core.dom.gameGroup.style.display = 'block';
if (!main.replayChecking) { if (!main.replayChecking) {
ancTe.plugin.ui.startOpened.value = false; mota.plugin.ui.startOpened.value = false;
} }
if (main.mode != 'play') return; if (main.mode != 'play') return;

View File

@ -3108,7 +3108,7 @@ maps.prototype.removeBlock = function (x, y, floorId) {
const block = blocks[i]; const block = blocks[i];
this.removeBlockByIndex(i, floorId); this.removeBlockByIndex(i, floorId);
this._removeBlockFromMap(floorId, block); this._removeBlockFromMap(floorId, block);
if (!main.replayChecking) ancTe.plugin.gameShadow.updateShadow(true); if (!main.replayChecking) mota.plugin.gameShadow.updateShadow(true);
return true; return true;
} }
return false; return false;
@ -3271,7 +3271,7 @@ maps.prototype.setBlock = function (number, x, y, floorId, noredraw) {
} }
} }
} }
if (!main.replayChecking) ancTe.plugin.gameShadow.updateShadow(true); if (!main.replayChecking) mota.plugin.gameShadow.updateShadow(true);
}; };
maps.prototype.animateSetBlock = function ( maps.prototype.animateSetBlock = function (

View File

@ -4228,6 +4228,6 @@ ui.prototype.deleteAllCanvas = function () {
this.deleteCanvas(function () { this.deleteCanvas(function () {
return true; return true;
}); });
if (main.mode === 'play' && !main.replayChecking && ancTe.plugin.shadow) if (main.mode === 'play' && !main.replayChecking && mota.plugin.shadow)
ancTe.plugin.shadow.initShadowCanvas(); mota.plugin.shadow.initShadowCanvas();
}; };

View File

@ -405,7 +405,7 @@ main.prototype.loadAsync = async function (mode, callback) {
await core.init(coreData, callback); await core.init(coreData, callback);
if (main.mode === 'play') main.loading.emit('coreInit'); if (main.mode === 'play') main.loading.emit('coreInit');
if (main.mode === 'play') { if (main.mode === 'play') {
ancTe.plugin.mark.showMarkedEnemy.value = true; mota.plugin.mark.showMarkedEnemy.value = true;
} }
core.resize(); core.resize();

View File

@ -50,8 +50,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) {
ancTe.plugin.fly.splitArea(); mota.plugin.fly.splitArea();
ancTe.game.hook.emit('reset'); mota.game.hook.emit('reset');
} else { } else {
flags.autoSkill ??= true; flags.autoSkill ??= true;
} }
@ -144,8 +144,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
core.drawMap(floorId); core.drawMap(floorId);
if (!main.replayChecking) { if (!main.replayChecking) {
ancTe.plugin.gameShadow.updateShadow(); mota.plugin.gameShadow.updateShadow();
ancTe.plugin.gameCanvas.setCanvasFilterByFloorId(floorId); mota.plugin.gameCanvas.setCanvasFilterByFloorId(floorId);
} }
// 切换楼层BGM // 切换楼层BGM
@ -206,7 +206,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
} }
} }
if (!flags.debug && !main.replayChecking) if (!flags.debug && !main.replayChecking)
ancTe.plugin.completion.checkVisitedFloor(); mota.plugin.completion.checkVisitedFloor();
}, },
flyTo: function (toId, callback) { flyTo: function (toId, callback) {
// 楼层传送器的使用从当前楼层飞往toId // 楼层传送器的使用从当前楼层飞往toId
@ -406,15 +406,15 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
case 67: // C怪物临界 case 67: // C怪物临界
if (core.getBlockCls(mx, my)?.startsWith('enemy')) { if (core.getBlockCls(mx, my)?.startsWith('enemy')) {
core.plugin.fixedDetailPanel = 'critical'; core.plugin.fixedDetailPanel = 'critical';
ancTe.plugin.fixed.showFixed.value = false; mota.plugin.fixed.showFixed.value = false;
ancTe.plugin.ui.fixedDetailOpened.value = true; mota.plugin.ui.fixedDetailOpened.value = true;
} }
break; break;
case 69: // E怪物属性 case 69: // E怪物属性
if (core.getBlockCls(mx, my)?.startsWith('enemy')) { if (core.getBlockCls(mx, my)?.startsWith('enemy')) {
core.plugin.fixedDetailPanel = 'special'; core.plugin.fixedDetailPanel = 'special';
ancTe.plugin.fixed.showFixed.value = false; mota.plugin.fixed.showFixed.value = false;
ancTe.plugin.ui.fixedDetailOpened.value = true; mota.plugin.ui.fixedDetailOpened.value = true;
} }
break; break;
case 77: // M快速标记 case 77: // M快速标记
@ -422,18 +422,15 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
const block = blocks[`${mx},${my}`]; const block = blocks[`${mx},${my}`];
if (block.event.cls.startsWith('enemy')) { if (block.event.cls.startsWith('enemy')) {
const name = core.material.enemys[block.event.id].name; const name = core.material.enemys[block.event.id].name;
if (ancTe.plugin.mark.hasMarkedEnemy(block.event.id)) { if (mota.plugin.mark.hasMarkedEnemy(block.event.id)) {
ancTe.plugin.utils.tip( mota.plugin.utils.tip(
'success', 'success',
`已取消标记${name}` `已取消标记${name}`
); );
ancTe.plugin.mark.unmarkEnemy(block.event.id); mota.plugin.mark.unmarkEnemy(block.event.id);
} else { } else {
ancTe.plugin.utils.tip( mota.plugin.utils.tip('success', `已标记${name}`);
'success', mota.plugin.mark.checkMarkedEnemy(block.event.id);
`已标记${name}`
);
ancTe.plugin.mark.checkMarkedEnemy(block.event.id);
} }
} }
break; break;
@ -449,7 +446,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
case 49: // 1: 断灭之刃 case 49: // 1: 断灭之刃
if (!flags.bladeOn) break; if (!flags.bladeOn) break;
if (flags.autoSkill) { if (flags.autoSkill) {
ancTe.plugin.utils.tip('error', '已开启自动切换技能!'); mota.plugin.utils.tip('error', '已开启自动切换技能!');
break; break;
} }
core.status.route.push('key:49'); // 将按键记在录像中 core.status.route.push('key:49'); // 将按键记在录像中
@ -476,7 +473,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
case 51: // 3: 铸剑为盾 case 51: // 3: 铸剑为盾
if (!flags.shieldOn) break; if (!flags.shieldOn) break;
if (flags.autoSkill) { if (flags.autoSkill) {
ancTe.plugin.utils.tip('error', '已开启自动切换技能!'); mota.plugin.utils.tip('error', '已开启自动切换技能!');
break; break;
} }
core.status.route.push('key:51'); // 将按键记在录像中 core.status.route.push('key:51'); // 将按键记在录像中
@ -583,7 +580,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
if (callback) callback(); if (callback) callback();
if (flags.onChase) { if (flags.onChase) {
ancTe.plugin.fly.startChase(flags.chaseIndex); mota.plugin.fly.startChase(flags.chaseIndex);
if (flags.chaseIndex === 1) { if (flags.chaseIndex === 1) {
core.playBgm('escape.mp3', 43.5); core.playBgm('escape.mp3', 43.5);
} }
@ -643,9 +640,9 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
core.plugin.skillTree.getSkillLevel(11) > 0 && core.plugin.skillTree.getSkillLevel(11) > 0 &&
(core.status.hero.special?.num ?? []).length > 0 (core.status.hero.special?.num ?? []).length > 0
) { ) {
ancTe.plugin.ui.showStudiedSkill.value = true; mota.plugin.ui.showStudiedSkill.value = true;
} else { } else {
ancTe.plugin.ui.showStudiedSkill.value = false; mota.plugin.ui.showStudiedSkill.value = false;
} }
}, },
moveOneStep: function (callback) { moveOneStep: function (callback) {

View File

@ -1161,21 +1161,21 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"name": "bgm查看器", "name": "bgm查看器",
"canUseItemEffect": "true", "canUseItemEffect": "true",
"text": "可以查看游戏内你已经听过的bgm歌曲名格式歌手——歌曲名。未完工。", "text": "可以查看游戏内你已经听过的bgm歌曲名格式歌手——歌曲名。未完工。",
"useItemEffect": "ancTe.plugin.utils.tip('warn', '当前道具还未制作完成!');\n// ancTe.plugin.ui.bgmOpened.value = true;" "useItemEffect": "mota.plugin.utils.tip('warn', '当前道具还未制作完成!');\n// mota.plugin.ui.bgmOpened.value = true;"
}, },
"I559": { "I559": {
"cls": "constants", "cls": "constants",
"name": "系统设置", "name": "系统设置",
"canUseItemEffect": "true", "canUseItemEffect": "true",
"text": "内含所有系统设置项", "text": "内含所有系统设置项",
"useItemEffect": "if (!core.isReplaying()) ancTe.plugin.ui.settingsOpened.value = true;" "useItemEffect": "if (!core.isReplaying()) mota.plugin.ui.settingsOpened.value = true;"
}, },
"I560": { "I560": {
"cls": "constants", "cls": "constants",
"name": "百科全书", "name": "百科全书",
"canUseItemEffect": "true", "canUseItemEffect": "true",
"text": "一个包含游戏中所有功能详细说明的百科全书,可以查看游戏中所有的功能", "text": "一个包含游戏中所有功能详细说明的百科全书,可以查看游戏中所有的功能",
"useItemEffect": "if (!core.isReplaying()) ancTe.plugin.ui.descOpened.value = true;" "useItemEffect": "if (!core.isReplaying()) mota.plugin.ui.descOpened.value = true;"
}, },
"I565": { "I565": {
"cls": "constants", "cls": "constants",
@ -1233,7 +1233,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "constants", "cls": "constants",
"name": "成就", "name": "成就",
"canUseItemEffect": "true", "canUseItemEffect": "true",
"useItemEffect": "ancTe.plugin.ui.achievementOpened.value = true;", "useItemEffect": "mota.plugin.ui.achievementOpened.value = true;",
"text": "可以查看成就" "text": "可以查看成就"
} }
} }

View File

@ -68,7 +68,7 @@ onMounted(async () => {
resize(); resize();
await sleep(50); await sleep(50);
if (ancTe.plugin.ui.transition.value) await sleep(600); if (mota.plugin.ui.transition.value) await sleep(600);
document.addEventListener('keyup', key); document.addEventListener('keyup', key);
}); });
onUpdated(resize); onUpdated(resize);

View File

@ -35,7 +35,7 @@ interface AncTePlugin {
frag: ReturnType<typeof import('../plugin/fx/frag').default>; frag: ReturnType<typeof import('../plugin/fx/frag').default>;
} }
export interface AncTe { export interface Mota {
sound: SoundController; sound: SoundController;
/** 游戏资源 */ /** 游戏资源 */
resource: ResourceStore<Exclude<ResourceType, 'zip'>>; resource: ResourceStore<Exclude<ResourceType, 'zip'>>;
@ -53,7 +53,7 @@ export interface AncTe {
} }
function ready() { function ready() {
window.ancTe = { window.mota = {
bgm: new BgmController(), bgm: new BgmController(),
resource: new ResourceStore(), resource: new ResourceStore(),
zipResource: new ResourceStore(), zipResource: new ResourceStore(),

View File

@ -19,9 +19,9 @@ export function readyAllResource() {
info.resource.forEach(v => { info.resource.forEach(v => {
const type = getTypeByResource(v); const type = getTypeByResource(v);
if (type === 'zip') { if (type === 'zip') {
ancTe.zipResource.set(v, new Resource(v, 'zip')); mota.zipResource.set(v, new Resource(v, 'zip'));
} else { } else {
ancTe.resource.set(v, new Resource(v, type)); mota.resource.set(v, new Resource(v, type));
} }
}); });
} }
@ -35,13 +35,13 @@ export function readyAllResource() {
loadData.forEach(v => { loadData.forEach(v => {
const type = getTypeByResource(v); const type = getTypeByResource(v);
if (type !== 'zip') { if (type !== 'zip') {
ancTe.resource.set(v, new Resource(v, type)); mota.resource.set(v, new Resource(v, type));
} }
}); });
ancTe.resource.forEach(v => v.active()); mota.resource.forEach(v => v.active());
loading.once('coreInit', () => { loading.once('coreInit', () => {
const animates = new Resource('__all_animates__', 'text'); const animates = new Resource('__all_animates__', 'text');
ancTe.resource.set('__all_animates__', animates); mota.resource.set('__all_animates__', animates);
animates.active(); animates.active();
}); });
} }

View File

@ -52,7 +52,7 @@ export class Resource<
protected onLoadStart(v?: ResourceData[T]) { protected onLoadStart(v?: ResourceData[T]) {
if (this.format === 'bgm') { if (this.format === 'bgm') {
// bgm 单独处理,因为它可以边播放边加载 // bgm 单独处理,因为它可以边播放边加载
ancTe.bgm.add(this.uri, v!); mota.bgm.add(this.uri, v!);
} }
} }
@ -61,7 +61,7 @@ export class Resource<
if (this.type === 'fonts') { if (this.type === 'fonts') {
document.fonts.add(new FontFace(this.name, v as ArrayBuffer)); document.fonts.add(new FontFace(this.name, v as ArrayBuffer));
} else if (this.type === 'sounds') { } else if (this.type === 'sounds') {
ancTe.sound.add(this.uri, v as ArrayBuffer); mota.sound.add(this.uri, v as ArrayBuffer);
} else if (this.type === 'images') { } else if (this.type === 'images') {
const name = `${this.name}${this.ext}` as ImageIds; const name = `${this.name}${this.ext}` as ImageIds;
loading.on( loading.on(
@ -109,7 +109,7 @@ export class Resource<
const id = `${base}.${name}`; const id = `${base}.${name}`;
const type = getTypeByResource(id) as NonZipResource; const type = getTypeByResource(id) as NonZipResource;
const format = getZipFormatByType(type); const format = getZipFormatByType(type);
ancTe.resource.set( mota.resource.set(
id, id,
new Resource(id, type).setData(file.async(format)) new Resource(id, type).setData(file.async(format))
); );

View File

@ -37,7 +37,7 @@ export class Hotkey extends EventEmitter<HotkeyEvent> {
constructor(id: string, storage: boolean = true) { constructor(id: string, storage: boolean = true) {
super(); super();
if (storage) { if (storage) {
this.storage = new GameStorage(GameStorage.fromAuthor('AncTe', id)); this.storage = new GameStorage(GameStorage.fromAuthor('Mota', id));
} }
} }
@ -274,12 +274,12 @@ hotkey
if (block.event.cls.startsWith('enemy')) { if (block.event.cls.startsWith('enemy')) {
const id = block.event.id as EnemyIds; const id = block.event.id as EnemyIds;
const name = core.material.enemys[id].name; const name = core.material.enemys[id].name;
if (ancTe.plugin.mark.hasMarkedEnemy(id)) { if (mota.plugin.mark.hasMarkedEnemy(id)) {
tip('success', `已取消标记${name}`); tip('success', `已取消标记${name}`);
ancTe.plugin.mark.unmarkEnemy(id); mota.plugin.mark.unmarkEnemy(id);
} else { } else {
tip('success', `已标记${name}`); tip('success', `已标记${name}`);
ancTe.plugin.mark.checkMarkedEnemy(false); mota.plugin.mark.checkMarkedEnemy(false);
} }
} }
} }
@ -303,8 +303,8 @@ hotkey
const [mx, my] = getLocFromMouseLoc(x, y); const [mx, my] = getLocFromMouseLoc(x, y);
if (core.getBlockCls(mx, my)?.startsWith('enemy')) { if (core.getBlockCls(mx, my)?.startsWith('enemy')) {
core.plugin.fixedDetailPanel = 'special'; core.plugin.fixedDetailPanel = 'special';
ancTe.plugin.fixed.showFixed.value = false; mota.plugin.fixed.showFixed.value = false;
ancTe.plugin.ui.fixedDetailOpened.value = true; mota.plugin.ui.fixedDetailOpened.value = true;
} }
} }
}) })
@ -315,8 +315,8 @@ hotkey
const [mx, my] = getLocFromMouseLoc(x, y); const [mx, my] = getLocFromMouseLoc(x, y);
if (core.getBlockCls(mx, my)?.startsWith('enemy')) { if (core.getBlockCls(mx, my)?.startsWith('enemy')) {
core.plugin.fixedDetailPanel = 'critical'; core.plugin.fixedDetailPanel = 'critical';
ancTe.plugin.fixed.showFixed.value = false; mota.plugin.fixed.showFixed.value = false;
ancTe.plugin.ui.fixedDetailOpened.value = true; mota.plugin.ui.fixedDetailOpened.value = true;
} }
} }
}) })

View File

@ -248,7 +248,7 @@ export class UiController extends Focus<IndexedGameUi> {
* ui的唯一标识符进行聚焦 * ui的唯一标识符进行聚焦
* @param num ui的唯一标识符 * @param num ui的唯一标识符
*/ */
focusByNum(num: number, add?: boolean) { focusByNum(num: number) {
const ui = this.stack.find(v => v.num === num); const ui = this.stack.find(v => v.num === num);
if (!ui) return; if (!ui) return;
this.focus(ui); this.focus(ui);

View File

@ -403,7 +403,7 @@ interface SettingStorage {
} }
const storage = new GameStorage<SettingStorage>( const storage = new GameStorage<SettingStorage>(
GameStorage.fromAuthor('AncTe', 'setting') GameStorage.fromAuthor('Mota', 'setting')
); );
loading.once('coreInit', () => { loading.once('coreInit', () => {

View File

@ -19,10 +19,10 @@ import gameCanvas from '../plugin/fx/gameCanvas';
import noise from '../plugin/fx/noise'; import noise from '../plugin/fx/noise';
import smooth from '../plugin/fx/smoothView'; import smooth from '../plugin/fx/smoothView';
import frag from '../plugin/fx/frag'; import frag from '../plugin/fx/frag';
import { AncTe } from '.'; import { Mota } from '.';
export function resolvePlugin() { export function resolvePlugin() {
const toForward: [keyof AncTe['plugin'], any][] = [ const toForward: [keyof Mota['plugin'], any][] = [
['pop', pop()], ['pop', pop()],
['ui', ui()], ['ui', ui()],
['use', use()], ['use', use()],
@ -47,7 +47,7 @@ export function resolvePlugin() {
]; ];
for (const [key, obj] of toForward) { for (const [key, obj] of toForward) {
ancTe.plugin[key] = obj; mota.plugin[key] = obj;
} }
// 完成度相关 // 完成度相关

View File

@ -37,7 +37,7 @@
"text": [ "text": [
"第一章完成度达到100%" "第一章完成度达到100%"
], ],
"progress": "${ancTe.plugin.completion.getChapterCompletion(1)} / 100", "progress": "${mota.plugin.completion.getChapterCompletion(1)} / 100",
"percent": true, "percent": true,
"point": 50 "point": 50
}, },
@ -55,7 +55,7 @@
"text": [ "text": [
"第二章完成度达到100%" "第二章完成度达到100%"
], ],
"progress": "${ancTe.plugin.completion.getChapterCompletion(2)} / 100", "progress": "${mota.plugin.completion.getChapterCompletion(2)} / 100",
"percent": true, "percent": true,
"point": 50 "point": 50
}, },

View File

@ -175,7 +175,7 @@ core.events.afterBattle = function (
canvas.width = 32; canvas.width = 32;
canvas.height = 32; canvas.height = 32;
core.drawIcon(canvas, enemy.id, 0, 0, 32, 32, frame); core.drawIcon(canvas, enemy.id, 0, 0, 32, 32, frame);
const manager = ancTe.plugin.frag.applyFragWith(canvas); const manager = mota.plugin.frag.applyFragWith(canvas);
const frag = manager.canvas; const frag = manager.canvas;
frag.style.imageRendering = 'pixelated'; frag.style.imageRendering = 'pixelated';
frag.style.width = `${frag.width * core.domStyle.scale}px`; frag.style.width = `${frag.width * core.domStyle.scale}px`;

View File

@ -10,7 +10,7 @@ control.prototype.checkBlock = function (forceMockery: boolean = false) {
const damage = info?.damage; const damage = info?.damage;
if (damage) { if (damage) {
if (!main.replayChecking) { if (!main.replayChecking) {
ancTe.plugin.pop.addPop( mota.plugin.pop.addPop(
(x - core.bigmap.offsetX / 32) * 32 + 12, (x - core.bigmap.offsetX / 32) * 32 + 12,
(y - core.bigmap.offsetY / 32) * 32 + 20, (y - core.bigmap.offsetY / 32) * 32 + 20,
(-damage).toString() (-damage).toString()

View File

@ -36,7 +36,7 @@ export function removeMaps(fromId, toId, force) {
deleted = true; deleted = true;
} }
if (deleted && !main.replayChecking) { if (deleted && !main.replayChecking) {
ancTe.plugin.fly.splitArea(); mota.plugin.fly.splitArea();
} }
} }

View File

@ -227,7 +227,7 @@ export function getSkillConsume(skill) {
export function openTree() { export function openTree() {
if (main.replayChecking) return; if (main.replayChecking) return;
ancTe.plugin.ui.skillTreeOpened.value = true; mota.plugin.ui.skillTreeOpened.value = true;
} }
/** /**

View File

@ -496,11 +496,7 @@ function intelligentArrow(fromSelf) {
damaged[loc + direction] = true; damaged[loc + direction] = true;
core.drawHeroAnimate('hand'); core.drawHeroAnimate('hand');
core.status.hero.hp -= 1000; core.status.hero.hp -= 1000;
ancTe.plugin.pop.addPop( mota.plugin.pop.addPop(x * 32 + 16, y * 32 + 16, -1000);
x * 32 + 16,
y * 32 + 16,
-1000
);
core.updateStatusBar(); core.updateStatusBar();
if (core.status.hero.hp < 0) { if (core.status.hero.hp < 0) {
clearInterval(skill1); clearInterval(skill1);
@ -515,11 +511,7 @@ function intelligentArrow(fromSelf) {
damaged[loc + direction] = true; damaged[loc + direction] = true;
core.drawHeroAnimate('hand'); core.drawHeroAnimate('hand');
core.status.hero.hp -= 1000; core.status.hero.hp -= 1000;
ancTe.plugin.pop.addPop( mota.plugin.pop.addPop(x * 32 + 16, y * 32 + 16, -1000);
x * 32 + 16,
y * 32 + 16,
-1000
);
core.updateStatusBar(); core.updateStatusBar();
if (core.status.hero.hp < 0) { if (core.status.hero.hp < 0) {
clearInterval(skill1); clearInterval(skill1);
@ -645,7 +637,7 @@ function icyMomentem() {
if (x == locs[index][0] && y == locs[index][1]) { if (x == locs[index][0] && y == locs[index][1]) {
core.drawHeroAnimate('hand'); core.drawHeroAnimate('hand');
core.status.hero.hp -= 5000; core.status.hero.hp -= 5000;
ancTe.plugin.pop.addPop(x * 32 + 16, y * 32 + 16, -5000); mota.plugin.pop.addPop(x * 32 + 16, y * 32 + 16, -5000);
core.updateStatusBar(); core.updateStatusBar();
if (core.status.hero.hp < 0) { if (core.status.hero.hp < 0) {
core.status.hero.hp = 0; core.status.hero.hp = 0;
@ -820,7 +812,7 @@ function getThunderDamage(x, y, power) {
hy = core.status.hero.loc.y; hy = core.status.hero.loc.y;
if (Math.abs(hx - x) <= 1 && Math.abs(hy - y) <= 1) { if (Math.abs(hx - x) <= 1 && Math.abs(hy - y) <= 1) {
core.status.hero.hp -= 3000 * power; core.status.hero.hp -= 3000 * power;
ancTe.plugin.pop.addPop(x * 32 + 16, y * 32 + 16, -3000 * power); mota.plugin.pop.addPop(x * 32 + 16, y * 32 + 16, -3000 * power);
core.updateStatusBar(); core.updateStatusBar();
if (core.status.hero.hp < 0) { if (core.status.hero.hp < 0) {
core.status.hero.hp = 0; core.status.hero.hp = 0;
@ -984,7 +976,7 @@ function ballThunder() {
) { ) {
damaged[i] = true; damaged[i] = true;
core.status.hero.hp -= 3000; core.status.hero.hp -= 3000;
ancTe.plugin.pop.addPop( mota.plugin.pop.addPop(
x * 32 + 16, x * 32 + 16,
y * 32 + 16, y * 32 + 16,
-3000 -3000
@ -1494,7 +1486,7 @@ function boomingAnimate() {
hy = core.status.hero.loc.y; hy = core.status.hero.loc.y;
if (loc[0] == hx && loc[1] == hy) { if (loc[0] == hx && loc[1] == hy) {
core.status.hero.hp -= 3000; core.status.hero.hp -= 3000;
ancTe.plugin.pop.addPop(x * 32 + 16, y * 32 + 16, -3000); mota.plugin.pop.addPop(x * 32 + 16, y * 32 + 16, -3000);
core.updateStatusBar(); core.updateStatusBar();
if (core.status.hero.hp < 0) { if (core.status.hero.hp < 0) {
core.status.hero.hp = 0; core.status.hero.hp = 0;
@ -1533,7 +1525,7 @@ function lineDamage(x1, y1, x2, y2, damage) {
n2 = ((y2 - y1) / (x2 - x1)) * (loc2[0] - x1) + y1 - loc2[1]; n2 = ((y2 - y1) / (x2 - x1)) * (loc2[0] - x1) + y1 - loc2[1];
if (n1 * n2 <= 0) { if (n1 * n2 <= 0) {
core.status.hero.hp -= damage; core.status.hero.hp -= damage;
ancTe.plugin.pop.addPop(x * 32 + 16, y * 32 + 16, -damage); mota.plugin.pop.addPop(x * 32 + 16, y * 32 + 16, -damage);
core.updateStatusBar(); core.updateStatusBar();
core.playSound('electron.mp3'); core.playSound('electron.mp3');
if (core.status.hero.hp < 0) { if (core.status.hero.hp < 0) {
@ -1553,7 +1545,7 @@ function lineDamage(x1, y1, x2, y2, damage) {
n2 = ((y2 - y1) / (x2 - x1)) * (loc2[0] - x1) + y1 - loc2[1]; n2 = ((y2 - y1) / (x2 - x1)) * (loc2[0] - x1) + y1 - loc2[1];
if (n1 * n2 <= 0) { if (n1 * n2 <= 0) {
core.status.hero.hp -= damage; core.status.hero.hp -= damage;
ancTe.plugin.pop.addPop(x * 32 + 16, y * 32 + 16, -damage); mota.plugin.pop.addPop(x * 32 + 16, y * 32 + 16, -damage);
core.updateStatusBar(); core.updateStatusBar();
core.playSound('electron.mp3'); core.playSound('electron.mp3');
if (core.status.hero.hp < 0) { if (core.status.hero.hp < 0) {

View File

@ -12,35 +12,34 @@ export {};
function openItemShop(itemShopId) { function openItemShop(itemShopId) {
if (!core.isReplaying()) { if (!core.isReplaying()) {
core.plugin.openedShopId = itemShopId; core.plugin.openedShopId = itemShopId;
ancTe.plugin.ui.shopOpened.value = true; mota.plugin.ui.shopOpened.value = true;
} }
} }
function updateVueStatusBar() { function updateVueStatusBar() {
if (main.replayChecking) return; if (main.replayChecking) return;
ancTe.plugin.status.statusBarStatus.value = mota.plugin.status.statusBarStatus.value =
!ancTe.plugin.status.statusBarStatus.value; !mota.plugin.status.statusBarStatus.value;
ancTe.plugin.mark.checkMarkedEnemy(); mota.plugin.mark.checkMarkedEnemy();
} }
ui.prototype.drawBook = function () { ui.prototype.drawBook = function () {
if (!core.isReplaying()) if (!core.isReplaying())
return (ancTe.plugin.ui.bookOpened.value = true); return (mota.plugin.ui.bookOpened.value = true);
}; };
ui.prototype._drawToolbox = function () { ui.prototype._drawToolbox = function () {
if (!core.isReplaying()) if (!core.isReplaying())
return (ancTe.plugin.ui.toolOpened.value = true); return (mota.plugin.ui.toolOpened.value = true);
}; };
ui.prototype._drawEquipbox = function () { ui.prototype._drawEquipbox = function () {
if (!core.isReplaying()) if (!core.isReplaying())
return (ancTe.plugin.ui.equipOpened.value = true); return (mota.plugin.ui.equipOpened.value = true);
}; };
ui.prototype.drawFly = function () { ui.prototype.drawFly = function () {
if (!core.isReplaying()) if (!core.isReplaying()) return (mota.plugin.ui.flyOpened.value = true);
return (ancTe.plugin.ui.flyOpened.value = true);
}; };
control.prototype.updateStatusBar_update = function () { control.prototype.updateStatusBar_update = function () {
@ -58,7 +57,7 @@ export {};
control.prototype.showStatusBar = function () { control.prototype.showStatusBar = function () {
if (main.mode == 'editor') return; if (main.mode == 'editor') return;
core.removeFlag('hideStatusBar'); core.removeFlag('hideStatusBar');
ancTe.plugin.ui.showStatusBar.value = true; mota.plugin.ui.showStatusBar.value = true;
core.dom.tools.hard.style.display = 'block'; core.dom.tools.hard.style.display = 'block';
core.dom.toolBar.style.display = 'block'; core.dom.toolBar.style.display = 'block';
}; };
@ -69,7 +68,7 @@ export {};
// 如果原本就是隐藏的,则先显示 // 如果原本就是隐藏的,则先显示
if (!core.domStyle.showStatusBar) this.showStatusBar(); if (!core.domStyle.showStatusBar) this.showStatusBar();
if (core.isReplaying()) showToolbox = true; if (core.isReplaying()) showToolbox = true;
ancTe.plugin.ui.showStatusBar.value = false; mota.plugin.ui.showStatusBar.value = false;
var toolItems = core.dom.tools; var toolItems = core.dom.tools;
core.setFlag('hideStatusBar', true); core.setFlag('hideStatusBar', true);
@ -88,13 +87,13 @@ export {};
function showChapter(chapter) { function showChapter(chapter) {
if (core.isReplaying()) return; if (core.isReplaying()) return;
ancTe.plugin.chapter.chapterContent.value = chapter; mota.plugin.chapter.chapterContent.value = chapter;
ancTe.plugin.chapter.chapterShowed.value = true; mota.plugin.chapter.chapterShowed.value = true;
} }
function openSkill() { function openSkill() {
if (core.isReplaying()) return; if (core.isReplaying()) return;
ancTe.plugin.ui.skillOpened.value = true; mota.plugin.ui.skillOpened.value = true;
} }
core.plugin.gameUi = { core.plugin.gameUi = {

View File

@ -451,7 +451,7 @@ type Forward<T> = {
type ForwardKeys<T> = keyof Forward<T>; type ForwardKeys<T> = keyof Forward<T>;
declare const ancTe: import('../core/index').AncTe; declare const mota: import('../core/index').Mota;
interface Window { interface Window {
ancTe: import('../core/index').AncTe; mota: import('../core/index').Mota;
} }

View File

@ -51,7 +51,7 @@ const content = computed(() => {
const name = computed(() => list[selected.value]!.name); const name = computed(() => list[selected.value]!.name);
function exit() { function exit() {
ancTe.plugin.ui.bgmOpened.value = false; mota.plugin.ui.bgmOpened.value = false;
} }
function select(id: BgmIds) { function select(id: BgmIds) {

View File

@ -113,8 +113,8 @@ async function show() {
*/ */
async function exit() { async function exit() {
noClosePanel.value = true; noClosePanel.value = true;
ancTe.plugin.ui.bookOpened.value = false; mota.plugin.ui.bookOpened.value = false;
if (ancTe.plugin.ui.transition.value) await sleep(650); if (mota.plugin.ui.transition.value) await sleep(650);
else await sleep(100); else await sleep(100);
if (core.events.recoverEvents(core.status.event.interval)) { if (core.events.recoverEvents(core.status.event.interval)) {
return; return;
@ -191,7 +191,7 @@ function keydown(e: KeyboardEvent) {
} }
onMounted(async () => { onMounted(async () => {
if (ancTe.plugin.ui.transition.value) await sleep(600); if (mota.plugin.ui.transition.value) await sleep(600);
else await sleep(50); else await sleep(50);
document.addEventListener('keyup', keyup); document.addEventListener('keyup', keyup);
document.addEventListener('keydown', keydown); document.addEventListener('keydown', keydown);

View File

@ -28,7 +28,7 @@ type DescKey = keyof typeof desc;
const selected = ref(Object.keys(desc)[0] as DescKey); const selected = ref(Object.keys(desc)[0] as DescKey);
function exit() { function exit() {
ancTe.plugin.ui.descOpened.value = false; mota.plugin.ui.descOpened.value = false;
} }
const content = computed(() => { const content = computed(() => {

View File

@ -303,7 +303,7 @@ function changeSort() {
} }
function exit() { function exit() {
ancTe.plugin.ui.equipOpened.value = false; mota.plugin.ui.equipOpened.value = false;
} }
function clickList(i: number) { function clickList(i: number) {
@ -421,12 +421,12 @@ function dragout(e: Event) {
} }
async function toTool() { async function toTool() {
const before = ancTe.plugin.ui.transition.value; const before = mota.plugin.ui.transition.value;
ancTe.plugin.ui.transition.value = false; mota.plugin.ui.transition.value = false;
exit(); exit();
await sleep(50); await sleep(50);
ancTe.plugin.ui.toolOpened.value = true; mota.plugin.ui.toolOpened.value = true;
ancTe.plugin.ui.transition.value = before; mota.plugin.ui.transition.value = before;
} }
function keyup(e: KeyboardEvent) { function keyup(e: KeyboardEvent) {
@ -447,7 +447,7 @@ watch(toShow, n => {
onMounted(async () => { onMounted(async () => {
bind(); bind();
if (ancTe.plugin.ui.transition.value) await sleep(600); if (mota.plugin.ui.transition.value) await sleep(600);
else await sleep(50); else await sleep(50);
document.addEventListener('keyup', keyup); document.addEventListener('keyup', keyup);
}); });

View File

@ -72,7 +72,7 @@ async function calHeight() {
vw = window.innerWidth; vw = window.innerWidth;
width.value = vh * 0.28; width.value = vh * 0.28;
await new Promise(res => requestAnimationFrame(res)); await new Promise(res => requestAnimationFrame(res));
if (ancTe.plugin.ui.fixedDetailOpened.value) { if (mota.plugin.ui.fixedDetailOpened.value) {
showFixed.value = false; showFixed.value = false;
} }
updateMain(); updateMain();

View File

@ -30,7 +30,7 @@ if (enemy) {
} }
function close() { function close() {
ancTe.plugin.ui.fixedDetailOpened.value = false; mota.plugin.ui.fixedDetailOpened.value = false;
} }
</script> </script>

View File

@ -147,7 +147,7 @@ let thumbCtx: CanvasRenderingContext2D;
let downloadMode = false; let downloadMode = false;
function exit() { function exit() {
ancTe.plugin.ui.flyOpened.value = false; mota.plugin.ui.flyOpened.value = false;
} }
const title = computed(() => { const title = computed(() => {
@ -610,7 +610,7 @@ onMounted(async () => {
}); });
await sleep(50); await sleep(50);
if (ancTe.plugin.ui.transition.value) await sleep(600); if (mota.plugin.ui.transition.value) await sleep(600);
document.addEventListener('keyup', keyup); document.addEventListener('keyup', keyup);
map.addEventListener('touchstart', touchdown); map.addEventListener('touchstart', touchdown);

View File

@ -182,7 +182,7 @@ function key(e: KeyboardEvent) {
onMounted(async () => { onMounted(async () => {
await sleep(50); await sleep(50);
if (ancTe.plugin.ui.transition.value) await sleep(600); if (mota.plugin.ui.transition.value) await sleep(600);
document.addEventListener('keyup', key); document.addEventListener('keyup', key);
}); });

View File

@ -303,12 +303,12 @@ function keydown(e: KeyboardEvent) {
function exit() { function exit() {
if (bought) core.status.route.push('closeShop'); if (bought) core.status.route.push('closeShop');
ancTe.plugin.ui.shopOpened.value = false; mota.plugin.ui.shopOpened.value = false;
} }
onMounted(async () => { onMounted(async () => {
await sleep(50); await sleep(50);
if (ancTe.plugin.ui.transition.value) await sleep(600); if (mota.plugin.ui.transition.value) await sleep(600);
document.addEventListener('keyup', keyup); document.addEventListener('keyup', keyup);
document.addEventListener('keydown', keydown); document.addEventListener('keydown', keydown);
core.status.route.push(`openShop:${id}`); core.status.route.push(`openShop:${id}`);

View File

@ -60,7 +60,7 @@ const content = computed(() => {
}); });
function exit() { function exit() {
ancTe.plugin.ui.skillOpened.value = false; mota.plugin.ui.skillOpened.value = false;
} }
</script> </script>

View File

@ -173,7 +173,7 @@ const level = computed(() => {
}); });
function exit() { function exit() {
ancTe.plugin.ui.skillTreeOpened.value = false; mota.plugin.ui.skillTreeOpened.value = false;
} }
function resize() { function resize() {
@ -274,7 +274,7 @@ onMounted(async () => {
draw(); draw();
await sleep(50); await sleep(50);
if (ancTe.plugin.ui.transition.value) await sleep(600); if (mota.plugin.ui.transition.value) await sleep(600);
canvas.addEventListener('click', click); canvas.addEventListener('click', click);
document.addEventListener('keyup', key); document.addEventListener('keyup', key);
}); });

View File

@ -165,19 +165,19 @@ async function select(id: ShowItemIds, nouse: boolean = false) {
} }
function exit() { function exit() {
ancTe.plugin.ui.toolOpened.value = false; mota.plugin.ui.toolOpened.value = false;
} }
async function use(id: ShowItemIds) { async function use(id: ShowItemIds) {
if (id === 'none') return; if (id === 'none') return;
if (core.canUseItem(id)) { if (core.canUseItem(id)) {
// //
const before = ancTe.plugin.ui.transition.value; const before = mota.plugin.ui.transition.value;
ancTe.plugin.ui.transition.value = false; mota.plugin.ui.transition.value = false;
exit(); exit();
await sleep(50); await sleep(50);
core.useItem(id); core.useItem(id);
ancTe.plugin.ui.transition.value = before; mota.plugin.ui.transition.value = before;
} else { } else {
message.warn({ message.warn({
content: '当前无法使用该道具!', content: '当前无法使用该道具!',
@ -187,12 +187,12 @@ async function use(id: ShowItemIds) {
} }
async function toEquip() { async function toEquip() {
const before = ancTe.plugin.ui.transition.value; const before = mota.plugin.ui.transition.value;
ancTe.plugin.ui.transition.value = false; mota.plugin.ui.transition.value = false;
exit(); exit();
await sleep(50); await sleep(50);
ancTe.plugin.ui.equipOpened.value = true; mota.plugin.ui.equipOpened.value = true;
ancTe.plugin.ui.transition.value = before; mota.plugin.ui.transition.value = before;
} }
function keyup(e: KeyboardEvent) { function keyup(e: KeyboardEvent) {
@ -239,7 +239,7 @@ function keydown(e: KeyboardEvent) {
} }
onMounted(async () => { onMounted(async () => {
if (ancTe.plugin.ui.transition.value) await sleep(600); if (mota.plugin.ui.transition.value) await sleep(600);
else await sleep(50); else await sleep(50);
document.addEventListener('keyup', keyup); document.addEventListener('keyup', keyup);
document.addEventListener('keydown', keydown); document.addEventListener('keydown', keydown);