mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-31 23:19:35 +08:00
修改主对象的名称
This commit is contained in:
parent
e6d96f6e2a
commit
7073ac92c6
@ -2317,7 +2317,7 @@ control.prototype._doSL_load = function (id, callback) {
|
||||
1
|
||||
)[0];
|
||||
if (!main.replayChecking) {
|
||||
ancTe.plugin.ui.startOpened.value = false;
|
||||
mota.plugin.ui.startOpened.value = false;
|
||||
}
|
||||
if (core.isPlaying() && !core.status.gameOver) {
|
||||
core.control.autosave(0);
|
||||
@ -2334,7 +2334,7 @@ control.prototype._doSL_load = function (id, callback) {
|
||||
null,
|
||||
function (data) {
|
||||
if (!main.replayChecking && data) {
|
||||
ancTe.plugin.ui.startOpened.value = false;
|
||||
mota.plugin.ui.startOpened.value = false;
|
||||
}
|
||||
if (id == 'autoSave' && data != null) {
|
||||
core.saves.autosave.data = data;
|
||||
@ -3013,7 +3013,7 @@ control.prototype.removeSwitch = function (x, y, floorId, name) {
|
||||
control.prototype.lockControl = function () {
|
||||
core.status.lockControl = true;
|
||||
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) {
|
||||
bgm = core.getMappedName(bgm);
|
||||
if (main.mode !== 'play') return;
|
||||
ancTe.bgm.play(bgm, startTime);
|
||||
mota.bgm.play(bgm, startTime);
|
||||
};
|
||||
|
||||
////// 暂停背景音乐的播放 //////
|
||||
control.prototype.pauseBgm = function () {
|
||||
if (main.mode !== 'play') return;
|
||||
ancTe.bgm.pause();
|
||||
mota.bgm.pause();
|
||||
};
|
||||
|
||||
////// 恢复背景音乐的播放 //////
|
||||
control.prototype.resumeBgm = function (resumeTime) {
|
||||
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]
|
||||
)
|
||||
return;
|
||||
ancTe.sound.play(sound, callback);
|
||||
mota.sound.play(sound, callback);
|
||||
};
|
||||
|
||||
////// 停止所有音频 //////
|
||||
control.prototype.stopSound = function (id) {
|
||||
if (typeof id === 'number') ancTe.sound.stop(id);
|
||||
else ancTe.sound.stopAll();
|
||||
if (typeof id === 'number') mota.sound.stop(id);
|
||||
else mota.sound.stopAll();
|
||||
};
|
||||
|
||||
////// 获得当前正在播放的所有(指定)音效的id列表 //////
|
||||
control.prototype.getPlayingSounds = function (name) {
|
||||
name = core.getMappedName(name);
|
||||
return ancTe.sound.getPlaying(name);
|
||||
return mota.sound.getPlaying(name);
|
||||
};
|
||||
|
||||
////// 检查bgm状态 //////
|
||||
|
@ -26,7 +26,7 @@ events.prototype.startGame = function (hard, seed, route, callback) {
|
||||
hard = hard || '';
|
||||
core.dom.gameGroup.style.display = 'block';
|
||||
if (!main.replayChecking) {
|
||||
ancTe.plugin.ui.startOpened.value = false;
|
||||
mota.plugin.ui.startOpened.value = false;
|
||||
}
|
||||
|
||||
if (main.mode != 'play') return;
|
||||
|
@ -3108,7 +3108,7 @@ maps.prototype.removeBlock = function (x, y, floorId) {
|
||||
const block = blocks[i];
|
||||
this.removeBlockByIndex(i, floorId);
|
||||
this._removeBlockFromMap(floorId, block);
|
||||
if (!main.replayChecking) ancTe.plugin.gameShadow.updateShadow(true);
|
||||
if (!main.replayChecking) mota.plugin.gameShadow.updateShadow(true);
|
||||
return true;
|
||||
}
|
||||
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 (
|
||||
|
@ -4228,6 +4228,6 @@ ui.prototype.deleteAllCanvas = function () {
|
||||
this.deleteCanvas(function () {
|
||||
return true;
|
||||
});
|
||||
if (main.mode === 'play' && !main.replayChecking && ancTe.plugin.shadow)
|
||||
ancTe.plugin.shadow.initShadowCanvas();
|
||||
if (main.mode === 'play' && !main.replayChecking && mota.plugin.shadow)
|
||||
mota.plugin.shadow.initShadowCanvas();
|
||||
};
|
||||
|
@ -405,7 +405,7 @@ main.prototype.loadAsync = async function (mode, callback) {
|
||||
await core.init(coreData, callback);
|
||||
if (main.mode === 'play') main.loading.emit('coreInit');
|
||||
if (main.mode === 'play') {
|
||||
ancTe.plugin.mark.showMarkedEnemy.value = true;
|
||||
mota.plugin.mark.showMarkedEnemy.value = true;
|
||||
}
|
||||
|
||||
core.resize();
|
||||
|
@ -50,8 +50,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
||||
core.hideStatusBar(core.hasFlag('showToolbox'));
|
||||
else core.showStatusBar();
|
||||
if (main.mode === 'play' && !main.replayChecking) {
|
||||
ancTe.plugin.fly.splitArea();
|
||||
ancTe.game.hook.emit('reset');
|
||||
mota.plugin.fly.splitArea();
|
||||
mota.game.hook.emit('reset');
|
||||
} else {
|
||||
flags.autoSkill ??= true;
|
||||
}
|
||||
@ -144,8 +144,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
||||
core.drawMap(floorId);
|
||||
|
||||
if (!main.replayChecking) {
|
||||
ancTe.plugin.gameShadow.updateShadow();
|
||||
ancTe.plugin.gameCanvas.setCanvasFilterByFloorId(floorId);
|
||||
mota.plugin.gameShadow.updateShadow();
|
||||
mota.plugin.gameCanvas.setCanvasFilterByFloorId(floorId);
|
||||
}
|
||||
|
||||
// 切换楼层BGM
|
||||
@ -206,7 +206,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
||||
}
|
||||
}
|
||||
if (!flags.debug && !main.replayChecking)
|
||||
ancTe.plugin.completion.checkVisitedFloor();
|
||||
mota.plugin.completion.checkVisitedFloor();
|
||||
},
|
||||
flyTo: function (toId, callback) {
|
||||
// 楼层传送器的使用,从当前楼层飞往toId
|
||||
@ -406,15 +406,15 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
||||
case 67: // C:怪物临界
|
||||
if (core.getBlockCls(mx, my)?.startsWith('enemy')) {
|
||||
core.plugin.fixedDetailPanel = 'critical';
|
||||
ancTe.plugin.fixed.showFixed.value = false;
|
||||
ancTe.plugin.ui.fixedDetailOpened.value = true;
|
||||
mota.plugin.fixed.showFixed.value = false;
|
||||
mota.plugin.ui.fixedDetailOpened.value = true;
|
||||
}
|
||||
break;
|
||||
case 69: // E:怪物属性
|
||||
if (core.getBlockCls(mx, my)?.startsWith('enemy')) {
|
||||
core.plugin.fixedDetailPanel = 'special';
|
||||
ancTe.plugin.fixed.showFixed.value = false;
|
||||
ancTe.plugin.ui.fixedDetailOpened.value = true;
|
||||
mota.plugin.fixed.showFixed.value = false;
|
||||
mota.plugin.ui.fixedDetailOpened.value = true;
|
||||
}
|
||||
break;
|
||||
case 77: // M:快速标记
|
||||
@ -422,18 +422,15 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
||||
const block = blocks[`${mx},${my}`];
|
||||
if (block.event.cls.startsWith('enemy')) {
|
||||
const name = core.material.enemys[block.event.id].name;
|
||||
if (ancTe.plugin.mark.hasMarkedEnemy(block.event.id)) {
|
||||
ancTe.plugin.utils.tip(
|
||||
if (mota.plugin.mark.hasMarkedEnemy(block.event.id)) {
|
||||
mota.plugin.utils.tip(
|
||||
'success',
|
||||
`已取消标记${name}!`
|
||||
);
|
||||
ancTe.plugin.mark.unmarkEnemy(block.event.id);
|
||||
mota.plugin.mark.unmarkEnemy(block.event.id);
|
||||
} else {
|
||||
ancTe.plugin.utils.tip(
|
||||
'success',
|
||||
`已标记${name}!`
|
||||
);
|
||||
ancTe.plugin.mark.checkMarkedEnemy(block.event.id);
|
||||
mota.plugin.utils.tip('success', `已标记${name}!`);
|
||||
mota.plugin.mark.checkMarkedEnemy(block.event.id);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -449,7 +446,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
||||
case 49: // 1: 断灭之刃
|
||||
if (!flags.bladeOn) break;
|
||||
if (flags.autoSkill) {
|
||||
ancTe.plugin.utils.tip('error', '已开启自动切换技能!');
|
||||
mota.plugin.utils.tip('error', '已开启自动切换技能!');
|
||||
break;
|
||||
}
|
||||
core.status.route.push('key:49'); // 将按键记在录像中
|
||||
@ -476,7 +473,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
||||
case 51: // 3: 铸剑为盾
|
||||
if (!flags.shieldOn) break;
|
||||
if (flags.autoSkill) {
|
||||
ancTe.plugin.utils.tip('error', '已开启自动切换技能!');
|
||||
mota.plugin.utils.tip('error', '已开启自动切换技能!');
|
||||
break;
|
||||
}
|
||||
core.status.route.push('key:51'); // 将按键记在录像中
|
||||
@ -583,7 +580,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
||||
if (callback) callback();
|
||||
|
||||
if (flags.onChase) {
|
||||
ancTe.plugin.fly.startChase(flags.chaseIndex);
|
||||
mota.plugin.fly.startChase(flags.chaseIndex);
|
||||
if (flags.chaseIndex === 1) {
|
||||
core.playBgm('escape.mp3', 43.5);
|
||||
}
|
||||
@ -643,9 +640,9 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
||||
core.plugin.skillTree.getSkillLevel(11) > 0 &&
|
||||
(core.status.hero.special?.num ?? []).length > 0
|
||||
) {
|
||||
ancTe.plugin.ui.showStudiedSkill.value = true;
|
||||
mota.plugin.ui.showStudiedSkill.value = true;
|
||||
} else {
|
||||
ancTe.plugin.ui.showStudiedSkill.value = false;
|
||||
mota.plugin.ui.showStudiedSkill.value = false;
|
||||
}
|
||||
},
|
||||
moveOneStep: function (callback) {
|
||||
|
@ -1161,21 +1161,21 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
|
||||
"name": "bgm查看器",
|
||||
"canUseItemEffect": "true",
|
||||
"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": {
|
||||
"cls": "constants",
|
||||
"name": "系统设置",
|
||||
"canUseItemEffect": "true",
|
||||
"text": "内含所有系统设置项",
|
||||
"useItemEffect": "if (!core.isReplaying()) ancTe.plugin.ui.settingsOpened.value = true;"
|
||||
"useItemEffect": "if (!core.isReplaying()) mota.plugin.ui.settingsOpened.value = true;"
|
||||
},
|
||||
"I560": {
|
||||
"cls": "constants",
|
||||
"name": "百科全书",
|
||||
"canUseItemEffect": "true",
|
||||
"text": "一个包含游戏中所有功能详细说明的百科全书,可以查看游戏中所有的功能",
|
||||
"useItemEffect": "if (!core.isReplaying()) ancTe.plugin.ui.descOpened.value = true;"
|
||||
"useItemEffect": "if (!core.isReplaying()) mota.plugin.ui.descOpened.value = true;"
|
||||
},
|
||||
"I565": {
|
||||
"cls": "constants",
|
||||
@ -1233,7 +1233,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
|
||||
"cls": "constants",
|
||||
"name": "成就",
|
||||
"canUseItemEffect": "true",
|
||||
"useItemEffect": "ancTe.plugin.ui.achievementOpened.value = true;",
|
||||
"useItemEffect": "mota.plugin.ui.achievementOpened.value = true;",
|
||||
"text": "可以查看成就"
|
||||
}
|
||||
}
|
@ -68,7 +68,7 @@ onMounted(async () => {
|
||||
resize();
|
||||
|
||||
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);
|
||||
});
|
||||
onUpdated(resize);
|
||||
|
@ -35,7 +35,7 @@ interface AncTePlugin {
|
||||
frag: ReturnType<typeof import('../plugin/fx/frag').default>;
|
||||
}
|
||||
|
||||
export interface AncTe {
|
||||
export interface Mota {
|
||||
sound: SoundController;
|
||||
/** 游戏资源 */
|
||||
resource: ResourceStore<Exclude<ResourceType, 'zip'>>;
|
||||
@ -53,7 +53,7 @@ export interface AncTe {
|
||||
}
|
||||
|
||||
function ready() {
|
||||
window.ancTe = {
|
||||
window.mota = {
|
||||
bgm: new BgmController(),
|
||||
resource: new ResourceStore(),
|
||||
zipResource: new ResourceStore(),
|
||||
|
@ -19,9 +19,9 @@ export function readyAllResource() {
|
||||
info.resource.forEach(v => {
|
||||
const type = getTypeByResource(v);
|
||||
if (type === 'zip') {
|
||||
ancTe.zipResource.set(v, new Resource(v, 'zip'));
|
||||
mota.zipResource.set(v, new Resource(v, 'zip'));
|
||||
} 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 => {
|
||||
const type = getTypeByResource(v);
|
||||
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', () => {
|
||||
const animates = new Resource('__all_animates__', 'text');
|
||||
ancTe.resource.set('__all_animates__', animates);
|
||||
mota.resource.set('__all_animates__', animates);
|
||||
animates.active();
|
||||
});
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ export class Resource<
|
||||
protected onLoadStart(v?: ResourceData[T]) {
|
||||
if (this.format === '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') {
|
||||
document.fonts.add(new FontFace(this.name, v as ArrayBuffer));
|
||||
} 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') {
|
||||
const name = `${this.name}${this.ext}` as ImageIds;
|
||||
loading.on(
|
||||
@ -109,7 +109,7 @@ export class Resource<
|
||||
const id = `${base}.${name}`;
|
||||
const type = getTypeByResource(id) as NonZipResource;
|
||||
const format = getZipFormatByType(type);
|
||||
ancTe.resource.set(
|
||||
mota.resource.set(
|
||||
id,
|
||||
new Resource(id, type).setData(file.async(format))
|
||||
);
|
||||
|
@ -37,7 +37,7 @@ export class Hotkey extends EventEmitter<HotkeyEvent> {
|
||||
constructor(id: string, storage: boolean = true) {
|
||||
super();
|
||||
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')) {
|
||||
const id = block.event.id as EnemyIds;
|
||||
const name = core.material.enemys[id].name;
|
||||
if (ancTe.plugin.mark.hasMarkedEnemy(id)) {
|
||||
if (mota.plugin.mark.hasMarkedEnemy(id)) {
|
||||
tip('success', `已取消标记${name}!`);
|
||||
ancTe.plugin.mark.unmarkEnemy(id);
|
||||
mota.plugin.mark.unmarkEnemy(id);
|
||||
} else {
|
||||
tip('success', `已标记${name}!`);
|
||||
ancTe.plugin.mark.checkMarkedEnemy(false);
|
||||
mota.plugin.mark.checkMarkedEnemy(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -303,8 +303,8 @@ hotkey
|
||||
const [mx, my] = getLocFromMouseLoc(x, y);
|
||||
if (core.getBlockCls(mx, my)?.startsWith('enemy')) {
|
||||
core.plugin.fixedDetailPanel = 'special';
|
||||
ancTe.plugin.fixed.showFixed.value = false;
|
||||
ancTe.plugin.ui.fixedDetailOpened.value = true;
|
||||
mota.plugin.fixed.showFixed.value = false;
|
||||
mota.plugin.ui.fixedDetailOpened.value = true;
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -315,8 +315,8 @@ hotkey
|
||||
const [mx, my] = getLocFromMouseLoc(x, y);
|
||||
if (core.getBlockCls(mx, my)?.startsWith('enemy')) {
|
||||
core.plugin.fixedDetailPanel = 'critical';
|
||||
ancTe.plugin.fixed.showFixed.value = false;
|
||||
ancTe.plugin.ui.fixedDetailOpened.value = true;
|
||||
mota.plugin.fixed.showFixed.value = false;
|
||||
mota.plugin.ui.fixedDetailOpened.value = true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -248,7 +248,7 @@ export class UiController extends Focus<IndexedGameUi> {
|
||||
* 根据ui的唯一标识符进行聚焦
|
||||
* @param num 要聚焦于的ui的唯一标识符
|
||||
*/
|
||||
focusByNum(num: number, add?: boolean) {
|
||||
focusByNum(num: number) {
|
||||
const ui = this.stack.find(v => v.num === num);
|
||||
if (!ui) return;
|
||||
this.focus(ui);
|
||||
|
@ -403,7 +403,7 @@ interface SettingStorage {
|
||||
}
|
||||
|
||||
const storage = new GameStorage<SettingStorage>(
|
||||
GameStorage.fromAuthor('AncTe', 'setting')
|
||||
GameStorage.fromAuthor('Mota', 'setting')
|
||||
);
|
||||
|
||||
loading.once('coreInit', () => {
|
||||
|
@ -19,10 +19,10 @@ import gameCanvas from '../plugin/fx/gameCanvas';
|
||||
import noise from '../plugin/fx/noise';
|
||||
import smooth from '../plugin/fx/smoothView';
|
||||
import frag from '../plugin/fx/frag';
|
||||
import { AncTe } from '.';
|
||||
import { Mota } from '.';
|
||||
|
||||
export function resolvePlugin() {
|
||||
const toForward: [keyof AncTe['plugin'], any][] = [
|
||||
const toForward: [keyof Mota['plugin'], any][] = [
|
||||
['pop', pop()],
|
||||
['ui', ui()],
|
||||
['use', use()],
|
||||
@ -47,7 +47,7 @@ export function resolvePlugin() {
|
||||
];
|
||||
|
||||
for (const [key, obj] of toForward) {
|
||||
ancTe.plugin[key] = obj;
|
||||
mota.plugin[key] = obj;
|
||||
}
|
||||
|
||||
// 完成度相关
|
||||
|
@ -37,7 +37,7 @@
|
||||
"text": [
|
||||
"第一章完成度达到100%"
|
||||
],
|
||||
"progress": "${ancTe.plugin.completion.getChapterCompletion(1)} / 100",
|
||||
"progress": "${mota.plugin.completion.getChapterCompletion(1)} / 100",
|
||||
"percent": true,
|
||||
"point": 50
|
||||
},
|
||||
@ -55,7 +55,7 @@
|
||||
"text": [
|
||||
"第二章完成度达到100%"
|
||||
],
|
||||
"progress": "${ancTe.plugin.completion.getChapterCompletion(2)} / 100",
|
||||
"progress": "${mota.plugin.completion.getChapterCompletion(2)} / 100",
|
||||
"percent": true,
|
||||
"point": 50
|
||||
},
|
||||
|
@ -175,7 +175,7 @@ core.events.afterBattle = function (
|
||||
canvas.width = 32;
|
||||
canvas.height = 32;
|
||||
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;
|
||||
frag.style.imageRendering = 'pixelated';
|
||||
frag.style.width = `${frag.width * core.domStyle.scale}px`;
|
||||
|
@ -10,7 +10,7 @@ control.prototype.checkBlock = function (forceMockery: boolean = false) {
|
||||
const damage = info?.damage;
|
||||
if (damage) {
|
||||
if (!main.replayChecking) {
|
||||
ancTe.plugin.pop.addPop(
|
||||
mota.plugin.pop.addPop(
|
||||
(x - core.bigmap.offsetX / 32) * 32 + 12,
|
||||
(y - core.bigmap.offsetY / 32) * 32 + 20,
|
||||
(-damage).toString()
|
||||
|
@ -36,7 +36,7 @@ export function removeMaps(fromId, toId, force) {
|
||||
deleted = true;
|
||||
}
|
||||
if (deleted && !main.replayChecking) {
|
||||
ancTe.plugin.fly.splitArea();
|
||||
mota.plugin.fly.splitArea();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -227,7 +227,7 @@ export function getSkillConsume(skill) {
|
||||
|
||||
export function openTree() {
|
||||
if (main.replayChecking) return;
|
||||
ancTe.plugin.ui.skillTreeOpened.value = true;
|
||||
mota.plugin.ui.skillTreeOpened.value = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -496,11 +496,7 @@ function intelligentArrow(fromSelf) {
|
||||
damaged[loc + direction] = true;
|
||||
core.drawHeroAnimate('hand');
|
||||
core.status.hero.hp -= 1000;
|
||||
ancTe.plugin.pop.addPop(
|
||||
x * 32 + 16,
|
||||
y * 32 + 16,
|
||||
-1000
|
||||
);
|
||||
mota.plugin.pop.addPop(x * 32 + 16, y * 32 + 16, -1000);
|
||||
core.updateStatusBar();
|
||||
if (core.status.hero.hp < 0) {
|
||||
clearInterval(skill1);
|
||||
@ -515,11 +511,7 @@ function intelligentArrow(fromSelf) {
|
||||
damaged[loc + direction] = true;
|
||||
core.drawHeroAnimate('hand');
|
||||
core.status.hero.hp -= 1000;
|
||||
ancTe.plugin.pop.addPop(
|
||||
x * 32 + 16,
|
||||
y * 32 + 16,
|
||||
-1000
|
||||
);
|
||||
mota.plugin.pop.addPop(x * 32 + 16, y * 32 + 16, -1000);
|
||||
core.updateStatusBar();
|
||||
if (core.status.hero.hp < 0) {
|
||||
clearInterval(skill1);
|
||||
@ -645,7 +637,7 @@ function icyMomentem() {
|
||||
if (x == locs[index][0] && y == locs[index][1]) {
|
||||
core.drawHeroAnimate('hand');
|
||||
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();
|
||||
if (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;
|
||||
if (Math.abs(hx - x) <= 1 && Math.abs(hy - y) <= 1) {
|
||||
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();
|
||||
if (core.status.hero.hp < 0) {
|
||||
core.status.hero.hp = 0;
|
||||
@ -984,7 +976,7 @@ function ballThunder() {
|
||||
) {
|
||||
damaged[i] = true;
|
||||
core.status.hero.hp -= 3000;
|
||||
ancTe.plugin.pop.addPop(
|
||||
mota.plugin.pop.addPop(
|
||||
x * 32 + 16,
|
||||
y * 32 + 16,
|
||||
-3000
|
||||
@ -1494,7 +1486,7 @@ function boomingAnimate() {
|
||||
hy = core.status.hero.loc.y;
|
||||
if (loc[0] == hx && loc[1] == hy) {
|
||||
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();
|
||||
if (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];
|
||||
if (n1 * n2 <= 0) {
|
||||
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.playSound('electron.mp3');
|
||||
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];
|
||||
if (n1 * n2 <= 0) {
|
||||
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.playSound('electron.mp3');
|
||||
if (core.status.hero.hp < 0) {
|
||||
|
@ -12,35 +12,34 @@ export {};
|
||||
function openItemShop(itemShopId) {
|
||||
if (!core.isReplaying()) {
|
||||
core.plugin.openedShopId = itemShopId;
|
||||
ancTe.plugin.ui.shopOpened.value = true;
|
||||
mota.plugin.ui.shopOpened.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
function updateVueStatusBar() {
|
||||
if (main.replayChecking) return;
|
||||
ancTe.plugin.status.statusBarStatus.value =
|
||||
!ancTe.plugin.status.statusBarStatus.value;
|
||||
ancTe.plugin.mark.checkMarkedEnemy();
|
||||
mota.plugin.status.statusBarStatus.value =
|
||||
!mota.plugin.status.statusBarStatus.value;
|
||||
mota.plugin.mark.checkMarkedEnemy();
|
||||
}
|
||||
|
||||
ui.prototype.drawBook = function () {
|
||||
if (!core.isReplaying())
|
||||
return (ancTe.plugin.ui.bookOpened.value = true);
|
||||
return (mota.plugin.ui.bookOpened.value = true);
|
||||
};
|
||||
|
||||
ui.prototype._drawToolbox = function () {
|
||||
if (!core.isReplaying())
|
||||
return (ancTe.plugin.ui.toolOpened.value = true);
|
||||
return (mota.plugin.ui.toolOpened.value = true);
|
||||
};
|
||||
|
||||
ui.prototype._drawEquipbox = function () {
|
||||
if (!core.isReplaying())
|
||||
return (ancTe.plugin.ui.equipOpened.value = true);
|
||||
return (mota.plugin.ui.equipOpened.value = true);
|
||||
};
|
||||
|
||||
ui.prototype.drawFly = function () {
|
||||
if (!core.isReplaying())
|
||||
return (ancTe.plugin.ui.flyOpened.value = true);
|
||||
if (!core.isReplaying()) return (mota.plugin.ui.flyOpened.value = true);
|
||||
};
|
||||
|
||||
control.prototype.updateStatusBar_update = function () {
|
||||
@ -58,7 +57,7 @@ export {};
|
||||
control.prototype.showStatusBar = function () {
|
||||
if (main.mode == 'editor') return;
|
||||
core.removeFlag('hideStatusBar');
|
||||
ancTe.plugin.ui.showStatusBar.value = true;
|
||||
mota.plugin.ui.showStatusBar.value = true;
|
||||
core.dom.tools.hard.style.display = 'block';
|
||||
core.dom.toolBar.style.display = 'block';
|
||||
};
|
||||
@ -69,7 +68,7 @@ export {};
|
||||
// 如果原本就是隐藏的,则先显示
|
||||
if (!core.domStyle.showStatusBar) this.showStatusBar();
|
||||
if (core.isReplaying()) showToolbox = true;
|
||||
ancTe.plugin.ui.showStatusBar.value = false;
|
||||
mota.plugin.ui.showStatusBar.value = false;
|
||||
|
||||
var toolItems = core.dom.tools;
|
||||
core.setFlag('hideStatusBar', true);
|
||||
@ -88,13 +87,13 @@ export {};
|
||||
|
||||
function showChapter(chapter) {
|
||||
if (core.isReplaying()) return;
|
||||
ancTe.plugin.chapter.chapterContent.value = chapter;
|
||||
ancTe.plugin.chapter.chapterShowed.value = true;
|
||||
mota.plugin.chapter.chapterContent.value = chapter;
|
||||
mota.plugin.chapter.chapterShowed.value = true;
|
||||
}
|
||||
|
||||
function openSkill() {
|
||||
if (core.isReplaying()) return;
|
||||
ancTe.plugin.ui.skillOpened.value = true;
|
||||
mota.plugin.ui.skillOpened.value = true;
|
||||
}
|
||||
|
||||
core.plugin.gameUi = {
|
||||
|
4
src/types/plugin.d.ts
vendored
4
src/types/plugin.d.ts
vendored
@ -451,7 +451,7 @@ type Forward<T> = {
|
||||
|
||||
type ForwardKeys<T> = keyof Forward<T>;
|
||||
|
||||
declare const ancTe: import('../core/index').AncTe;
|
||||
declare const mota: import('../core/index').Mota;
|
||||
interface Window {
|
||||
ancTe: import('../core/index').AncTe;
|
||||
mota: import('../core/index').Mota;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ const content = computed(() => {
|
||||
const name = computed(() => list[selected.value]!.name);
|
||||
|
||||
function exit() {
|
||||
ancTe.plugin.ui.bgmOpened.value = false;
|
||||
mota.plugin.ui.bgmOpened.value = false;
|
||||
}
|
||||
|
||||
function select(id: BgmIds) {
|
||||
|
@ -113,8 +113,8 @@ async function show() {
|
||||
*/
|
||||
async function exit() {
|
||||
noClosePanel.value = true;
|
||||
ancTe.plugin.ui.bookOpened.value = false;
|
||||
if (ancTe.plugin.ui.transition.value) await sleep(650);
|
||||
mota.plugin.ui.bookOpened.value = false;
|
||||
if (mota.plugin.ui.transition.value) await sleep(650);
|
||||
else await sleep(100);
|
||||
if (core.events.recoverEvents(core.status.event.interval)) {
|
||||
return;
|
||||
@ -191,7 +191,7 @@ function keydown(e: KeyboardEvent) {
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
if (ancTe.plugin.ui.transition.value) await sleep(600);
|
||||
if (mota.plugin.ui.transition.value) await sleep(600);
|
||||
else await sleep(50);
|
||||
document.addEventListener('keyup', keyup);
|
||||
document.addEventListener('keydown', keydown);
|
||||
|
@ -28,7 +28,7 @@ type DescKey = keyof typeof desc;
|
||||
const selected = ref(Object.keys(desc)[0] as DescKey);
|
||||
|
||||
function exit() {
|
||||
ancTe.plugin.ui.descOpened.value = false;
|
||||
mota.plugin.ui.descOpened.value = false;
|
||||
}
|
||||
|
||||
const content = computed(() => {
|
||||
|
@ -303,7 +303,7 @@ function changeSort() {
|
||||
}
|
||||
|
||||
function exit() {
|
||||
ancTe.plugin.ui.equipOpened.value = false;
|
||||
mota.plugin.ui.equipOpened.value = false;
|
||||
}
|
||||
|
||||
function clickList(i: number) {
|
||||
@ -421,12 +421,12 @@ function dragout(e: Event) {
|
||||
}
|
||||
|
||||
async function toTool() {
|
||||
const before = ancTe.plugin.ui.transition.value;
|
||||
ancTe.plugin.ui.transition.value = false;
|
||||
const before = mota.plugin.ui.transition.value;
|
||||
mota.plugin.ui.transition.value = false;
|
||||
exit();
|
||||
await sleep(50);
|
||||
ancTe.plugin.ui.toolOpened.value = true;
|
||||
ancTe.plugin.ui.transition.value = before;
|
||||
mota.plugin.ui.toolOpened.value = true;
|
||||
mota.plugin.ui.transition.value = before;
|
||||
}
|
||||
|
||||
function keyup(e: KeyboardEvent) {
|
||||
@ -447,7 +447,7 @@ watch(toShow, n => {
|
||||
|
||||
onMounted(async () => {
|
||||
bind();
|
||||
if (ancTe.plugin.ui.transition.value) await sleep(600);
|
||||
if (mota.plugin.ui.transition.value) await sleep(600);
|
||||
else await sleep(50);
|
||||
document.addEventListener('keyup', keyup);
|
||||
});
|
||||
|
@ -72,7 +72,7 @@ async function calHeight() {
|
||||
vw = window.innerWidth;
|
||||
width.value = vh * 0.28;
|
||||
await new Promise(res => requestAnimationFrame(res));
|
||||
if (ancTe.plugin.ui.fixedDetailOpened.value) {
|
||||
if (mota.plugin.ui.fixedDetailOpened.value) {
|
||||
showFixed.value = false;
|
||||
}
|
||||
updateMain();
|
||||
|
@ -30,7 +30,7 @@ if (enemy) {
|
||||
}
|
||||
|
||||
function close() {
|
||||
ancTe.plugin.ui.fixedDetailOpened.value = false;
|
||||
mota.plugin.ui.fixedDetailOpened.value = false;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -147,7 +147,7 @@ let thumbCtx: CanvasRenderingContext2D;
|
||||
let downloadMode = false;
|
||||
|
||||
function exit() {
|
||||
ancTe.plugin.ui.flyOpened.value = false;
|
||||
mota.plugin.ui.flyOpened.value = false;
|
||||
}
|
||||
|
||||
const title = computed(() => {
|
||||
@ -610,7 +610,7 @@ onMounted(async () => {
|
||||
});
|
||||
|
||||
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);
|
||||
map.addEventListener('touchstart', touchdown);
|
||||
|
@ -182,7 +182,7 @@ function key(e: KeyboardEvent) {
|
||||
|
||||
onMounted(async () => {
|
||||
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);
|
||||
});
|
||||
|
||||
|
@ -303,12 +303,12 @@ function keydown(e: KeyboardEvent) {
|
||||
|
||||
function exit() {
|
||||
if (bought) core.status.route.push('closeShop');
|
||||
ancTe.plugin.ui.shopOpened.value = false;
|
||||
mota.plugin.ui.shopOpened.value = false;
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
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('keydown', keydown);
|
||||
core.status.route.push(`openShop:${id}`);
|
||||
|
@ -60,7 +60,7 @@ const content = computed(() => {
|
||||
});
|
||||
|
||||
function exit() {
|
||||
ancTe.plugin.ui.skillOpened.value = false;
|
||||
mota.plugin.ui.skillOpened.value = false;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -173,7 +173,7 @@ const level = computed(() => {
|
||||
});
|
||||
|
||||
function exit() {
|
||||
ancTe.plugin.ui.skillTreeOpened.value = false;
|
||||
mota.plugin.ui.skillTreeOpened.value = false;
|
||||
}
|
||||
|
||||
function resize() {
|
||||
@ -274,7 +274,7 @@ onMounted(async () => {
|
||||
draw();
|
||||
|
||||
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);
|
||||
document.addEventListener('keyup', key);
|
||||
});
|
||||
|
@ -165,19 +165,19 @@ async function select(id: ShowItemIds, nouse: boolean = false) {
|
||||
}
|
||||
|
||||
function exit() {
|
||||
ancTe.plugin.ui.toolOpened.value = false;
|
||||
mota.plugin.ui.toolOpened.value = false;
|
||||
}
|
||||
|
||||
async function use(id: ShowItemIds) {
|
||||
if (id === 'none') return;
|
||||
if (core.canUseItem(id)) {
|
||||
// 应该暂时把动画去掉
|
||||
const before = ancTe.plugin.ui.transition.value;
|
||||
ancTe.plugin.ui.transition.value = false;
|
||||
const before = mota.plugin.ui.transition.value;
|
||||
mota.plugin.ui.transition.value = false;
|
||||
exit();
|
||||
await sleep(50);
|
||||
core.useItem(id);
|
||||
ancTe.plugin.ui.transition.value = before;
|
||||
mota.plugin.ui.transition.value = before;
|
||||
} else {
|
||||
message.warn({
|
||||
content: '当前无法使用该道具!',
|
||||
@ -187,12 +187,12 @@ async function use(id: ShowItemIds) {
|
||||
}
|
||||
|
||||
async function toEquip() {
|
||||
const before = ancTe.plugin.ui.transition.value;
|
||||
ancTe.plugin.ui.transition.value = false;
|
||||
const before = mota.plugin.ui.transition.value;
|
||||
mota.plugin.ui.transition.value = false;
|
||||
exit();
|
||||
await sleep(50);
|
||||
ancTe.plugin.ui.equipOpened.value = true;
|
||||
ancTe.plugin.ui.transition.value = before;
|
||||
mota.plugin.ui.equipOpened.value = true;
|
||||
mota.plugin.ui.transition.value = before;
|
||||
}
|
||||
|
||||
function keyup(e: KeyboardEvent) {
|
||||
@ -239,7 +239,7 @@ function keydown(e: KeyboardEvent) {
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
if (ancTe.plugin.ui.transition.value) await sleep(600);
|
||||
if (mota.plugin.ui.transition.value) await sleep(600);
|
||||
else await sleep(50);
|
||||
document.addEventListener('keyup', keyup);
|
||||
document.addEventListener('keydown', keydown);
|
||||
|
Loading…
Reference in New Issue
Block a user