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