mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-02-26 16:17:05 +08:00
修复录像
This commit is contained in:
parent
ecc886c261
commit
31210256d8
@ -216,6 +216,8 @@ function main() {
|
||||
|
||||
this.__VERSION__ = '2.10.0';
|
||||
this.__VERSION_CODE__ = 510;
|
||||
|
||||
this.timestamp = 0;
|
||||
}
|
||||
// >>>> body end
|
||||
|
||||
@ -468,6 +470,7 @@ main.prototype.importFonts = function (fonts) {
|
||||
font +
|
||||
'"; src: url("project/fonts/' +
|
||||
font +
|
||||
(main.pluginUseCompress ? '-' + main.timestamp : '') +
|
||||
'.ttf") format("truetype"); }';
|
||||
});
|
||||
style.innerHTML = html;
|
||||
|
@ -70,7 +70,7 @@ main.floors.MT16=
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": "function(){\ncore.status.maps.MT14.canFlyFrom = false;\ncore.chaseInit1();\n}"
|
||||
"function": "function(){\ncore.status.maps.MT14.canFlyFrom = false;\ncore.plugin.chase.chaseInit1();\n}"
|
||||
},
|
||||
{
|
||||
"type": "show",
|
||||
|
23
public/project/plugin/chase.js
Normal file
23
public/project/plugin/chase.js
Normal file
@ -0,0 +1,23 @@
|
||||
export function chaseInit1() {
|
||||
const ids = ['MT13', 'MT14', 'MT15'];
|
||||
const toRemove = [];
|
||||
ids.forEach(v => {
|
||||
core.status.maps[v].cannotMoveDirectly = true;
|
||||
core.extractBlocks(v);
|
||||
core.status.maps[v].blocks.forEach(vv => {
|
||||
if (
|
||||
['animates', 'items'].includes(vv.event.cls) &&
|
||||
!vv.event.id.endsWith('Portal')
|
||||
) {
|
||||
toRemove.push([vv.x, vv.y, v]);
|
||||
}
|
||||
});
|
||||
});
|
||||
toRemove.forEach(v => {
|
||||
core.removeBlock(...v);
|
||||
});
|
||||
}
|
||||
|
||||
core.plugin.chase = {
|
||||
chaseInit1
|
||||
};
|
@ -16,6 +16,7 @@ import * as skillTree from './skillTree.js';
|
||||
import * as study from './study.js';
|
||||
import * as towerBoss from './towerBoss.js';
|
||||
import * as utils from './utils.js';
|
||||
import * as chase from './chase.js';
|
||||
|
||||
export {
|
||||
halo,
|
||||
@ -28,5 +29,6 @@ export {
|
||||
skillTree,
|
||||
study,
|
||||
towerBoss,
|
||||
utils
|
||||
utils,
|
||||
chase
|
||||
};
|
||||
|
@ -6,6 +6,7 @@ import * as babel from '@babel/core';
|
||||
import * as rollup from 'rollup';
|
||||
|
||||
(async function () {
|
||||
const timestamp = Date.now();
|
||||
// 1. 去除未使用的文件
|
||||
const data = (() => {
|
||||
const data = fss.readFileSync('./public/project/data.js', 'utf-8');
|
||||
@ -98,6 +99,14 @@ import * as rollup from 'rollup';
|
||||
})()
|
||||
)
|
||||
]);
|
||||
await Promise.all([
|
||||
...fonts.map(v => {
|
||||
return fse.rename(
|
||||
`./dist/project/fonts/${v}.ttf`,
|
||||
`./dist/project/fonts/${v}-${timestamp}.ttf`
|
||||
);
|
||||
})
|
||||
]);
|
||||
} catch (e) {
|
||||
await fse.copy('./public/project/fonts', './dist/project/fonts');
|
||||
}
|
||||
@ -122,10 +131,12 @@ import * as rollup from 'rollup';
|
||||
// 4. 压缩main.js
|
||||
try {
|
||||
// 先获取不能压缩的部分
|
||||
const main = (await fs.readFile('./public/main.js', 'utf-8')).replace(
|
||||
const main = (await fs.readFile('./public/main.js', 'utf-8'))
|
||||
.replace(
|
||||
/this.pluginUseCompress\s*=\s*false\;/,
|
||||
'this.pluginUseCompress = true;'
|
||||
);
|
||||
)
|
||||
.replace('this.timestamp = 0', `this.timestamp = ${timestamp};`);
|
||||
|
||||
const endIndex = main.indexOf('// >>>> body end');
|
||||
const nonCompress = main.slice(0, endIndex);
|
||||
|
@ -123,23 +123,7 @@ export const camera1: ChaseCameraData[] = [
|
||||
* 追逐战开始前的初始化函数,移除所有血瓶和门等
|
||||
*/
|
||||
export function init1() {
|
||||
const ids: FloorIds[] = ['MT13', 'MT14', 'MT15'];
|
||||
const toRemove: [number, number, FloorIds][] = [];
|
||||
ids.forEach(v => {
|
||||
core.status.maps[v].cannotMoveDirectly = true;
|
||||
core.extractBlocks(v);
|
||||
core.status.maps[v].blocks.forEach(vv => {
|
||||
if (
|
||||
['animates', 'items'].includes(vv.event.cls) &&
|
||||
!vv.event.id.endsWith('Portal')
|
||||
) {
|
||||
toRemove.push([vv.x, vv.y, v]);
|
||||
}
|
||||
});
|
||||
});
|
||||
toRemove.forEach(v => {
|
||||
core.removeBlock(...v);
|
||||
});
|
||||
return core.plugin.chase.chaseInit1();
|
||||
}
|
||||
|
||||
export function chaseShake(chase: Chase) {
|
||||
|
5
src/types/plugin.d.ts
vendored
5
src/types/plugin.d.ts
vendored
@ -29,6 +29,7 @@ interface PluginDeclaration
|
||||
study: GamePluginStudy;
|
||||
hero: GamePluginHeroRealStatus;
|
||||
replay: PluginReplay;
|
||||
chase: PluginChase;
|
||||
|
||||
skills: Record<Chapter, Skill[]>;
|
||||
skillEffects: SkillEffects;
|
||||
@ -434,6 +435,10 @@ interface PluginReplay {
|
||||
clip(...replace: string[]): void;
|
||||
}
|
||||
|
||||
interface PluginChase {
|
||||
chaseInit1(): void;
|
||||
}
|
||||
|
||||
interface SkillEffects {
|
||||
jumpIgnoreFloor: FloorIds[];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user