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__ = '2.10.0';
|
||||||
this.__VERSION_CODE__ = 510;
|
this.__VERSION_CODE__ = 510;
|
||||||
|
|
||||||
|
this.timestamp = 0;
|
||||||
}
|
}
|
||||||
// >>>> body end
|
// >>>> body end
|
||||||
|
|
||||||
@ -468,6 +470,7 @@ main.prototype.importFonts = function (fonts) {
|
|||||||
font +
|
font +
|
||||||
'"; src: url("project/fonts/' +
|
'"; src: url("project/fonts/' +
|
||||||
font +
|
font +
|
||||||
|
(main.pluginUseCompress ? '-' + main.timestamp : '') +
|
||||||
'.ttf") format("truetype"); }';
|
'.ttf") format("truetype"); }';
|
||||||
});
|
});
|
||||||
style.innerHTML = html;
|
style.innerHTML = html;
|
||||||
|
@ -70,7 +70,7 @@ main.floors.MT16=
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "function",
|
"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",
|
"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 study from './study.js';
|
||||||
import * as towerBoss from './towerBoss.js';
|
import * as towerBoss from './towerBoss.js';
|
||||||
import * as utils from './utils.js';
|
import * as utils from './utils.js';
|
||||||
|
import * as chase from './chase.js';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
halo,
|
halo,
|
||||||
@ -28,5 +29,6 @@ export {
|
|||||||
skillTree,
|
skillTree,
|
||||||
study,
|
study,
|
||||||
towerBoss,
|
towerBoss,
|
||||||
utils
|
utils,
|
||||||
|
chase
|
||||||
};
|
};
|
||||||
|
@ -6,6 +6,7 @@ import * as babel from '@babel/core';
|
|||||||
import * as rollup from 'rollup';
|
import * as rollup from 'rollup';
|
||||||
|
|
||||||
(async function () {
|
(async function () {
|
||||||
|
const timestamp = Date.now();
|
||||||
// 1. 去除未使用的文件
|
// 1. 去除未使用的文件
|
||||||
const data = (() => {
|
const data = (() => {
|
||||||
const data = fss.readFileSync('./public/project/data.js', 'utf-8');
|
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) {
|
} catch (e) {
|
||||||
await fse.copy('./public/project/fonts', './dist/project/fonts');
|
await fse.copy('./public/project/fonts', './dist/project/fonts');
|
||||||
}
|
}
|
||||||
@ -122,10 +131,12 @@ import * as rollup from 'rollup';
|
|||||||
// 4. 压缩main.js
|
// 4. 压缩main.js
|
||||||
try {
|
try {
|
||||||
// 先获取不能压缩的部分
|
// 先获取不能压缩的部分
|
||||||
const main = (await fs.readFile('./public/main.js', 'utf-8')).replace(
|
const main = (await fs.readFile('./public/main.js', 'utf-8'))
|
||||||
/this.pluginUseCompress\s*=\s*false\;/,
|
.replace(
|
||||||
'this.pluginUseCompress = true;'
|
/this.pluginUseCompress\s*=\s*false\;/,
|
||||||
);
|
'this.pluginUseCompress = true;'
|
||||||
|
)
|
||||||
|
.replace('this.timestamp = 0', `this.timestamp = ${timestamp};`);
|
||||||
|
|
||||||
const endIndex = main.indexOf('// >>>> body end');
|
const endIndex = main.indexOf('// >>>> body end');
|
||||||
const nonCompress = main.slice(0, endIndex);
|
const nonCompress = main.slice(0, endIndex);
|
||||||
|
@ -123,23 +123,7 @@ export const camera1: ChaseCameraData[] = [
|
|||||||
* 追逐战开始前的初始化函数,移除所有血瓶和门等
|
* 追逐战开始前的初始化函数,移除所有血瓶和门等
|
||||||
*/
|
*/
|
||||||
export function init1() {
|
export function init1() {
|
||||||
const ids: FloorIds[] = ['MT13', 'MT14', 'MT15'];
|
return core.plugin.chase.chaseInit1();
|
||||||
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);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function chaseShake(chase: Chase) {
|
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;
|
study: GamePluginStudy;
|
||||||
hero: GamePluginHeroRealStatus;
|
hero: GamePluginHeroRealStatus;
|
||||||
replay: PluginReplay;
|
replay: PluginReplay;
|
||||||
|
chase: PluginChase;
|
||||||
|
|
||||||
skills: Record<Chapter, Skill[]>;
|
skills: Record<Chapter, Skill[]>;
|
||||||
skillEffects: SkillEffects;
|
skillEffects: SkillEffects;
|
||||||
@ -434,6 +435,10 @@ interface PluginReplay {
|
|||||||
clip(...replace: string[]): void;
|
clip(...replace: string[]): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface PluginChase {
|
||||||
|
chaseInit1(): void;
|
||||||
|
}
|
||||||
|
|
||||||
interface SkillEffects {
|
interface SkillEffects {
|
||||||
jumpIgnoreFloor: FloorIds[];
|
jumpIgnoreFloor: FloorIds[];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user