mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-05-02 04:13:24 +08:00
fix: 录像验证
This commit is contained in:
parent
3f808a848c
commit
d4467b4d11
@ -9,4 +9,5 @@ script/**/*.js
|
|||||||
public/editor.html
|
public/editor.html
|
||||||
keyCodes.ts
|
keyCodes.ts
|
||||||
*.md
|
*.md
|
||||||
setting.ts
|
setting.ts
|
||||||
|
dist/project/data.js
|
@ -3394,58 +3394,74 @@ 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;
|
||||||
Mota.require('var', 'bgm').changeTo(bgm, startTime);
|
Mota.r(() => {
|
||||||
|
Mota.require('var', 'bgm').changeTo(bgm, startTime);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
////// 暂停背景音乐的播放 //////
|
////// 暂停背景音乐的播放 //////
|
||||||
control.prototype.pauseBgm = function () {
|
control.prototype.pauseBgm = function () {
|
||||||
if (main.mode !== 'play') return;
|
if (main.mode !== 'play') return;
|
||||||
Mota.require('var', 'bgm').pause();
|
Mota.r(() => {
|
||||||
|
Mota.require('var', 'bgm').pause();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
////// 恢复背景音乐的播放 //////
|
////// 恢复背景音乐的播放 //////
|
||||||
control.prototype.resumeBgm = function (resumeTime) {
|
control.prototype.resumeBgm = function (resumeTime) {
|
||||||
if (main.mode !== 'play') return;
|
if (main.mode !== 'play') return;
|
||||||
Mota.require('var', 'bgm').resume();
|
Mota.r(() => {
|
||||||
|
Mota.require('var', 'bgm').resume();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
////// 更改背景音乐的播放 //////
|
////// 更改背景音乐的播放 //////
|
||||||
control.prototype.triggerBgm = function () {
|
control.prototype.triggerBgm = function () {
|
||||||
if (main.mode !== 'play') return;
|
if (main.mode !== 'play') return;
|
||||||
const bgm = Mota.require('var', 'bgm');
|
Mota.r(() => {
|
||||||
bgm.disable = !bgm.disable;
|
const bgm = Mota.require('var', 'bgm');
|
||||||
|
bgm.disable = !bgm.disable;
|
||||||
|
|
||||||
if (!bgm.disable) this.resumeBgm();
|
if (!bgm.disable) this.resumeBgm();
|
||||||
else this.pauseBgm();
|
else this.pauseBgm();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// todo: deprecate playSound, stopSound, getPlayingSounds
|
// todo: deprecate playSound, stopSound, getPlayingSounds
|
||||||
////// 播放音频 //////
|
////// 播放音频 //////
|
||||||
control.prototype.playSound = function (sound, pitch, callback) {
|
control.prototype.playSound = function (sound, pitch, callback) {
|
||||||
sound = core.getMappedName(sound);
|
Mota.r(() => {
|
||||||
Mota.require('var', 'sound').play(sound, callback);
|
sound = core.getMappedName(sound);
|
||||||
|
Mota.require('var', 'sound').play(sound, callback);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
////// 停止所有音频 //////
|
////// 停止所有音频 //////
|
||||||
control.prototype.stopSound = function (id) {
|
control.prototype.stopSound = function (id) {
|
||||||
if (typeof id === 'number') Mota.require('var', 'sound').stop(id);
|
Mota.r(() => {
|
||||||
else Mota.require('var', 'sound').stopAll();
|
if (typeof id === 'number') Mota.require('var', 'sound').stop(id);
|
||||||
|
else Mota.require('var', 'sound').stopAll();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
////// 获得当前正在播放的所有(指定)音效的id列表 //////
|
////// 获得当前正在播放的所有(指定)音效的id列表 //////
|
||||||
control.prototype.getPlayingSounds = function (name) {
|
control.prototype.getPlayingSounds = function (name) {
|
||||||
name = core.getMappedName(name);
|
Mota.r(() => {
|
||||||
return Mota.require('var', 'sound').getPlaying(name);
|
name = core.getMappedName(name);
|
||||||
|
return Mota.require('var', 'sound').getPlaying(name);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
////// 检查bgm状态 //////
|
////// 检查bgm状态 //////
|
||||||
control.prototype.checkBgm = function () {
|
control.prototype.checkBgm = function () {
|
||||||
const bgm = Mota.require('var', 'bgm');
|
Mota.r(() => {
|
||||||
if (bgm.disable) {
|
const bgm = Mota.require('var', 'bgm');
|
||||||
bgm.pause();
|
if (bgm.disable) {
|
||||||
} else if (!bgm.playing) {
|
bgm.pause();
|
||||||
bgm.changeTo(bgm.now ?? main.startBgm);
|
} else if (!bgm.playing) {
|
||||||
}
|
bgm.changeTo(bgm.now ?? main.startBgm);
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
///// 设置屏幕放缩 //////
|
///// 设置屏幕放缩 //////
|
||||||
|
@ -306,6 +306,7 @@ core.prototype.initSync = function (coreData, callback) {
|
|||||||
this._forwardFuncs();
|
this._forwardFuncs();
|
||||||
for (var key in coreData) core[key] = coreData[key];
|
for (var key in coreData) core[key] = coreData[key];
|
||||||
this._loadGameProcessSync();
|
this._loadGameProcessSync();
|
||||||
|
this._loadPluginSync();
|
||||||
this._init_flags();
|
this._init_flags();
|
||||||
this._init_platform();
|
this._init_platform();
|
||||||
this._init_others();
|
this._init_others();
|
||||||
@ -319,6 +320,18 @@ core.prototype._loadPluginAsync = async function () {
|
|||||||
if (!main.useCompress) {
|
if (!main.useCompress) {
|
||||||
await main.loadScript(`project/plugins.js?v=${main.version}`);
|
await main.loadScript(`project/plugins.js?v=${main.version}`);
|
||||||
}
|
}
|
||||||
|
this._initPlugins();
|
||||||
|
};
|
||||||
|
|
||||||
|
core.prototype._loadPluginSync = function () {
|
||||||
|
if (main.useCompress) main.loadMod('project', 'project', () => 0);
|
||||||
|
else {
|
||||||
|
main.pureData.forEach(v => main.loadMod('project', v, () => 0));
|
||||||
|
}
|
||||||
|
this._initPlugins();
|
||||||
|
};
|
||||||
|
|
||||||
|
core.prototype._initPlugins = function () {
|
||||||
for (const [key, value] of Object.entries(
|
for (const [key, value] of Object.entries(
|
||||||
plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1
|
plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1
|
||||||
)) {
|
)) {
|
||||||
@ -331,10 +344,6 @@ core.prototype._loadPluginAsync = async function () {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
core.prototype._loadPluginSync = function () {
|
|
||||||
main.loadMod('project', 'plugins', () => 0);
|
|
||||||
};
|
|
||||||
|
|
||||||
core.prototype._loadGameProcess = async function () {
|
core.prototype._loadGameProcess = async function () {
|
||||||
// 加载游戏进程代码
|
// 加载游戏进程代码
|
||||||
if (main.pluginUseCompress && main.replayChecking) {
|
if (main.pluginUseCompress && main.replayChecking) {
|
||||||
|
@ -486,7 +486,9 @@ loader.prototype._loadMusic_sync = function () {
|
|||||||
core.loader.loadOneSound(t);
|
core.loader.loadOneSound(t);
|
||||||
});
|
});
|
||||||
// 直接开始播放
|
// 直接开始播放
|
||||||
core.playBgm(main.startBgm);
|
Mota.r(() => {
|
||||||
|
core.playBgm(main.startBgm);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
loader.prototype._loadMusic_async = function (onprogress, onfinished) {
|
loader.prototype._loadMusic_async = function (onprogress, onfinished) {
|
||||||
@ -525,12 +527,14 @@ loader.prototype.loadOneMusic = function (name) {
|
|||||||
music.loop = 'loop';
|
music.loop = 'loop';
|
||||||
core.material.bgms[name] = music;
|
core.material.bgms[name] = music;
|
||||||
} else {
|
} else {
|
||||||
if (!main.renderLoaded) {
|
Mota.r(() => {
|
||||||
Mota.require('var', 'hook').once('renderLoaded', () => {
|
if (!main.renderLoaded) {
|
||||||
Mota.require('var', 'bgm').add(`bgms.${name}`, music);
|
Mota.require('var', 'hook').once('renderLoaded', () => {
|
||||||
});
|
Mota.require('var', 'bgm').add(`bgms.${name}`, music);
|
||||||
}
|
});
|
||||||
Mota.require('var', 'bgm').add(`bgms.${name}`, music);
|
}
|
||||||
|
Mota.require('var', 'bgm').add(`bgms.${name}`, music);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -543,15 +547,17 @@ loader.prototype.loadOneSound = function (name) {
|
|||||||
if (main.mode === 'editor') {
|
if (main.mode === 'editor') {
|
||||||
core.loader._loadOneSound_decodeData(name, data);
|
core.loader._loadOneSound_decodeData(name, data);
|
||||||
} else {
|
} else {
|
||||||
if (!main.renderLoaded) {
|
Mota.r(() => {
|
||||||
Mota.require('var', 'hook').once('renderLoaded', () => {
|
if (!main.renderLoaded) {
|
||||||
|
Mota.require('var', 'hook').once('renderLoaded', () => {
|
||||||
|
const sound = Mota.require('var', 'sound');
|
||||||
|
sound.add(`sounds.${name}`, data);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
const sound = Mota.require('var', 'sound');
|
const sound = Mota.require('var', 'sound');
|
||||||
sound.add(`sounds.${name}`, data);
|
sound.add(`sounds.${name}`, data);
|
||||||
});
|
}
|
||||||
} else {
|
});
|
||||||
const sound = Mota.require('var', 'sound');
|
|
||||||
sound.add(`sounds.${name}`, data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (e) {
|
function (e) {
|
||||||
|
@ -298,10 +298,15 @@ main.prototype.loadSync = function (mode, callback) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
core.initSync(coreData, callback);
|
core.initSync(coreData, callback);
|
||||||
|
main.loading.emit('coreLoaded');
|
||||||
|
main.loading.emit('coreInit');
|
||||||
|
core.initStatus.maps = core.maps._initMaps();
|
||||||
core.resize();
|
core.resize();
|
||||||
main.core = core;
|
main.core = core;
|
||||||
|
|
||||||
core.completeAchievement = () => 0;
|
core.completeAchievement = () => 0;
|
||||||
|
|
||||||
|
core.plugin = { drawLight: 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
main.prototype.loadAsync = async function (mode, callback) {
|
main.prototype.loadAsync = async function (mode, callback) {
|
||||||
|
@ -114,7 +114,7 @@ class GameListener extends EventEmitter<ListenerEvent> {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
if (main.replayChecking) return;
|
||||||
if (!!window.core) {
|
if (!!window.core) {
|
||||||
this.init();
|
this.init();
|
||||||
} else {
|
} else {
|
||||||
|
@ -31,10 +31,11 @@ export function init() {
|
|||||||
floor.enemy.calMapDamage();
|
floor.enemy.calMapDamage();
|
||||||
core.status.damage.data = [];
|
core.status.damage.data = [];
|
||||||
|
|
||||||
floor.enemy.render(true);
|
Mota.r(() => {
|
||||||
|
floor.enemy.render(true);
|
||||||
getItemDetail(floorId, onMap); // 宝石血瓶详细信息
|
getItemDetail(floorId, onMap); // 宝石血瓶详细信息
|
||||||
this.drawDamage(ctx, floorId);
|
this.drawDamage(ctx, floorId);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user