修复录像

This commit is contained in:
unanmed 2023-04-29 11:25:18 +08:00
parent ecc886c261
commit 31210256d8
7 changed files with 51 additions and 23 deletions

View File

@ -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;

View File

@ -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",

View 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
};

View File

@ -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
};

View File

@ -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);

View File

@ -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) {

View File

@ -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[];
}