fix: 修复一些剧情错误。修复了红录像。
This commit is contained in:
parent
eeb957268a
commit
20bb52034d
1
project/animates/hand3.animate
Normal file
1
project/animates/hand3.animate
Normal file
File diff suppressed because one or more lines are too long
@ -34,10 +34,23 @@ main.floors.MT0=
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
],
|
||||
"firstArrive": [
|
||||
{
|
||||
"type": "if",
|
||||
"condition": "core.isReplaying()",
|
||||
"true": [
|
||||
{
|
||||
"type": "setValue",
|
||||
"name": "flag:uid",
|
||||
"value": "flag:__seed__"
|
||||
}
|
||||
],
|
||||
"false": [
|
||||
{
|
||||
"type": "setValue",
|
||||
"name": "flag:uid",
|
||||
"value": "core.getCookie('id')"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "setValue",
|
||||
|
@ -36,7 +36,7 @@ main.floors.MT33=
|
||||
"operator": "*=",
|
||||
"value": "10"
|
||||
},
|
||||
"生命翻十倍,功防血翻5倍。"
|
||||
"生命翻十倍,功防翻5倍。"
|
||||
],
|
||||
"false": [
|
||||
{
|
||||
|
@ -56,7 +56,7 @@ main.floors.MT44=
|
||||
"四年级的时候,我开始学习编程,并且参加了信息竞赛。",
|
||||
"我第一次参加比赛,我就拿下了市一等奖。",
|
||||
"按理说我应该高兴,因为自己拿了奖,但事实上,我并没有和其他获得一等奖的同学一样高兴,因为我这个电脑编程老师不想教我了。",
|
||||
"我一向与同学的关系不好,还经常动他们关系,他们粉非常反感我。我们老师管不了我,他说什么我也不听,总是按照自己的那一套来,不管学习也好纪律也好,我都与他唱反调。",
|
||||
"我一向与同学的关系不好,而我还有意无意做一些事情,让他们更加反感我。我们老师管不了我,他说什么我也不听,总是按照自己的那一套来,不管学习也好纪律也好,我都与他唱反调。",
|
||||
"后来,我父母找老师说情,依旧没有缓解矛盾,就这样我与我人生中第一个编程老师不愉快的分别了。",
|
||||
"但我并没有放弃我的梦想!因为我喜欢电脑喜欢编程。我父母经过考虑,最终决定花费重金为我请来了一个家教对我进行一对一辅导。",
|
||||
"就这样,我五年级开始了一对一辅导,来参加后面的信息竞赛。而这个老师,也对我后面的人生产生了深远影响。",
|
||||
|
@ -27,7 +27,7 @@ main.floors.MT6=
|
||||
"6,2": [
|
||||
{
|
||||
"type": "if",
|
||||
"condition": "(status:hard===3)",
|
||||
"condition": "(flag:hard===3)",
|
||||
"true": [
|
||||
{
|
||||
"type": "changeFloor",
|
||||
|
@ -46,7 +46,7 @@ main.floors.ND1=
|
||||
1
|
||||
],
|
||||
"action": [
|
||||
"休闲模式带有剧情且难度不算太大,\n讲述了主角从出生到大学毕业的时光,\n跟随主角去探寻人生中的酸甜苦辣。\n拥有百分之五减伤并且让oi篇debuff减弱。适合广大休闲玩家游玩。\n最终计分方式为钥匙计分。",
|
||||
"休闲模式带有剧情且难度不算太大,\n讲述了主角从出生到大学毕业的时光,\n跟随主角去探寻人生中的酸甜苦辣。\n拥有百分之五减伤,先算减伤后算魔防,魔防效果不受减伤影响。并且让oi篇debuff减弱。适合广大休闲玩家游玩。\n最终计分方式为钥匙计分。",
|
||||
{
|
||||
"type": "confirm",
|
||||
"text": "确认要选择休闲模式吗?",
|
||||
@ -78,7 +78,7 @@ main.floors.ND1=
|
||||
1
|
||||
],
|
||||
"action": [
|
||||
"普通模式难度适中,剧情不变。\n讲述了主角从出生到大学毕业的时光,跟随主角去探寻人生中的酸甜苦辣。\n最终计分方式为钥匙计分。",
|
||||
"普通模式难度略高,如果怕卡关建议直接玩休闲模式。\n此模式剧情保留不变,讲述了主角从出生到大学毕业的时光,跟随主角去探寻人生中的酸甜苦辣。\n后面会拿到破墙镐并算入计分,可以破怪物,门,大部分墙。\n最终计分方式为钥匙计分。",
|
||||
{
|
||||
"type": "confirm",
|
||||
"text": "确认要选择普通模式吗?",
|
||||
@ -110,7 +110,7 @@ main.floors.ND1=
|
||||
1
|
||||
],
|
||||
"action": [
|
||||
"挑战模式去掉全部剧情,提升转换效率。\n难度更高,没有破墙镐存在。\n适合喜欢冲榜的玩家优化路线,刷max。\n本塔要知道前因后果需要打前面两个难度,之后再来体验挑战模式效果更佳。\n计分方式为钥匙计分。",
|
||||
"挑战模式去掉全部剧情,提升转换效率。\n难度更高,没有破墙镐存在,适合红海转换塔玩家和想跳过剧情的玩家。\n适合喜欢冲榜的玩家优化路线,刷max。\n本塔要知道前因后果需要打前面两个难度,之后再来体验挑战模式效果更佳。\n计分方式为钥匙计分。",
|
||||
{
|
||||
"type": "confirm",
|
||||
"text": "确认要选择挑战模式吗?",
|
||||
|
@ -1607,7 +1607,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
||||
}
|
||||
}
|
||||
if (core.getFlag("dynHPneed")) core.updateStatusBar()
|
||||
}
|
||||
if (!core.isReplaying() && parseInt(flags.uid)) flags.__seed__ = flags.__rand__ = parseInt(flags.uid)
|
||||
}
|
||||
},
|
||||
"ui": {
|
||||
"getToolboxItems": function (cls) {
|
||||
|
@ -428,7 +428,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
|
||||
"I336": {
|
||||
"cls": "constants",
|
||||
"name": "减分优势",
|
||||
"canUseItemEffect": "true"
|
||||
"canUseItemEffect": "true",
|
||||
"text": "因为签约北大,我只需要过一本线即可考入。此优势会让怪物在战斗前承受自己一次真实伤害。"
|
||||
},
|
||||
"I337": {
|
||||
"cls": "items",
|
||||
|
@ -1656,269 +1656,41 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
||||
window.Sprite = Sprite;
|
||||
},
|
||||
"hotReload": function () {
|
||||
/* ---------- 功能说明 ---------- *
|
||||
core.events._gameOver_doUpload = function (username, ending, norank) {
|
||||
var hp = core.status.hero.hp;
|
||||
if (username == null) hp = 1;
|
||||
core.ui.closePanel();
|
||||
// upload
|
||||
var formData = new FormData();
|
||||
formData.append('type', 'score');
|
||||
formData.append('name', core.firstData.name);
|
||||
formData.append('version', core.firstData.version);
|
||||
formData.append('platform', core.platform.string);
|
||||
formData.append('hard', core.encodeBase64(core.status.hard));
|
||||
formData.append('username', core.encodeBase64(username || ""));
|
||||
formData.append('ending', core.encodeBase64(ending));
|
||||
formData.append('lv', core.status.hero.lv);
|
||||
formData.append('hp', Math.min(hp, Math.pow(2, 63)));
|
||||
formData.append('atk', core.status.hero.atk);
|
||||
formData.append('def', core.status.hero.def);
|
||||
formData.append('mdef', core.status.hero.mdef);
|
||||
formData.append('money', core.status.hero.money);
|
||||
formData.append('experience', core.status.hero.exp);
|
||||
formData.append('steps', core.status.hero.steps);
|
||||
formData.append('norank', norank ? 1 : 0);
|
||||
formData.append('seed', parseInt(core.getFlag('uid')) || 1);
|
||||
formData.append('totalTime', Math.floor(core.status.hero.statistics.totalTime / 1000));
|
||||
formData.append('route', core.encodeRoute(core.status.route));
|
||||
formData.append('base64', 1);
|
||||
|
||||
1. 当 libs/ main.js index.html 中的任意一个文件被更改后,会自动刷新塔的页面
|
||||
2. 修改楼层文件后自动在塔的页面上显示出来,不需要刷新
|
||||
3. 修改脚本编辑或插件编写后也能自动更新更改的插件或脚本,但不保证不会出问题(一般都不会有问题的
|
||||
4. 修改图块属性、怪物属性等后会自动更新
|
||||
5. 当全塔属性被修改时,会自动刷新塔的页面
|
||||
6. 样板的 styles.css 被修改后也可以直接显示,不需要刷新
|
||||
7. 其余内容修改后不会自动更新也不会刷新
|
||||
if (main.isCompetition)
|
||||
core.http("POST", "/games/competition/upload.php", formData);
|
||||
else
|
||||
core.http("POST", "/games/upload.php", formData);
|
||||
|
||||
/* ---------- 使用方式 ---------- *
|
||||
|
||||
1. 前往 https://nodejs.org/en/ 下载node.js的LTS版本(点左边那个绿色按钮)并安装
|
||||
2. 将该插件复制到插件编写中
|
||||
3. 在造塔群的群文件-魔塔样板·改中找到server.js,下载并放到塔的根目录(与启动服务同一级)
|
||||
4. 在该目录下按下shift+鼠标右键(win11只按右键即可),选择在终端打开或在powershell打开
|
||||
5. 运行node server.js即可
|
||||
|
||||
*/
|
||||
|
||||
if (main.mode !== 'play' || main.replayChecking) return;
|
||||
|
||||
/**
|
||||
* 发送请求
|
||||
* @param {string} url
|
||||
* @param {string} type
|
||||
* @param {string} data
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
async function post(url, type, data) {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open(type, url);
|
||||
xhr.send(data);
|
||||
const res = await new Promise(res => {
|
||||
xhr.onload = e => {
|
||||
if (xhr.status !== 200) {
|
||||
console.error(`hot reload: http ${xhr.status}`);
|
||||
res('@error');
|
||||
} else res('success');
|
||||
};
|
||||
xhr.onerror = e => {
|
||||
res('@error');
|
||||
console.error(`hot reload: error on connection`);
|
||||
};
|
||||
});
|
||||
if (res === 'success') return xhr.response;
|
||||
else return '@error';
|
||||
core.events._gameOver_confirmDownload(ending);
|
||||
}
|
||||
|
||||
/**
|
||||
* 热重载css
|
||||
* @param {string} data
|
||||
*/
|
||||
function reloadCss(data) {
|
||||
const all = Array.from(document.getElementsByTagName('link'));
|
||||
all.forEach(v => {
|
||||
if (v.rel !== 'stylesheet') return;
|
||||
if (v.href === `http://127.0.0.1:3000/${data}`) {
|
||||
v.remove();
|
||||
const link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
link.href = data;
|
||||
document.head.appendChild(link);
|
||||
console.log(`css hot reload: ${data}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 热重载楼层
|
||||
* @param {string} data
|
||||
*/
|
||||
async function reloadFloor(data) {
|
||||
// 首先重新加载main.floors对应的楼层
|
||||
await import(`/project/floors/${data}.js?v=${Date.now()}`);
|
||||
// 然后写入core.floors并解析
|
||||
core.floors[data] = main.floors[data];
|
||||
const floor = core.loadFloor(data);
|
||||
if (core.isPlaying()) {
|
||||
core.status.maps[data] = floor;
|
||||
delete core.status.mapBlockObjs[data];
|
||||
core.extractBlocks(data);
|
||||
if (data === core.status.floorId) {
|
||||
core.drawMap(data);
|
||||
core.setWeather(
|
||||
core.animateFrame.weather.type,
|
||||
core.animateFrame.weather.level
|
||||
);
|
||||
}
|
||||
core.updateStatusBar(true, true);
|
||||
}
|
||||
console.log(`floor hot reload: ${data}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 热重载脚本编辑及插件编写
|
||||
* @param {string} data
|
||||
*/
|
||||
async function reloadScript(data) {
|
||||
if (data === 'plugins') {
|
||||
// 插件编写比较好办
|
||||
const before = plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1;
|
||||
// 这里不能用动态导入,因为动态导入会变成模块,变量就不是全局的了
|
||||
const script = document.createElement('script');
|
||||
script.src = `/project/plugins.js?v=${Date.now()}`;
|
||||
document.body.appendChild(script);
|
||||
await new Promise(res => {
|
||||
script.onload = () => res('success');
|
||||
});
|
||||
const after = plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1;
|
||||
// 找到差异的函数
|
||||
for (const id in before) {
|
||||
const fn = before[id];
|
||||
if (typeof fn !== 'function') continue;
|
||||
if (fn.toString() !== after[id]?.toString()) {
|
||||
try {
|
||||
core.plugin[id] = after[id];
|
||||
core.plugin[id].call(core.plugin);
|
||||
core.updateStatusBar(true, true);
|
||||
console.log(`plugin hot reload: ${id}`);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (data === 'functions') {
|
||||
// 脚本编辑略微麻烦点
|
||||
const before = functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a;
|
||||
// 这里不能用动态导入,因为动态导入会变成模块,变量就不是全局的了
|
||||
const script = document.createElement('script');
|
||||
script.src = `/project/functions.js?v=${Date.now()}`;
|
||||
document.body.appendChild(script);
|
||||
await new Promise(res => {
|
||||
script.onload = () => res('success');
|
||||
});
|
||||
const after = functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a;
|
||||
// 找到差异的函数
|
||||
for (const mod in before) {
|
||||
const fns = before[mod];
|
||||
for (const id in fns) {
|
||||
const fn = fns[id];
|
||||
if (typeof fn !== 'function' || id === 'hasSpecial')
|
||||
continue;
|
||||
const now = after[mod][id];
|
||||
if (fn.toString() !== now.toString()) {
|
||||
try {
|
||||
if (mod === 'events') {
|
||||
core.events.eventdata[id] = now;
|
||||
} else if (mod === 'enemys') {
|
||||
core.enemys.enemydata[id] = now;
|
||||
} else if (mod === 'actions') {
|
||||
core.actions.actionsdata[id] = now;
|
||||
} else if (mod === 'control') {
|
||||
core.control.controldata[id] = now;
|
||||
} else if (mod === 'ui') {
|
||||
core.ui.uidata[id] = now;
|
||||
}
|
||||
core.updateStatusBar(true, true);
|
||||
console.log(
|
||||
`function hot reload: ${mod}.${id}`
|
||||
);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 属性热重载,包括全塔属性等
|
||||
* @param {string} data
|
||||
*/
|
||||
async function reloadData(data) {
|
||||
const script = document.createElement('script');
|
||||
script.src = `/project/${data}.js?v=${Date.now()}`;
|
||||
document.body.appendChild(script);
|
||||
await new Promise(res => {
|
||||
script.onload = () => res('success');
|
||||
});
|
||||
|
||||
let after;
|
||||
if (data === 'data')
|
||||
after = data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d;
|
||||
if (data === 'enemys')
|
||||
after = enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80;
|
||||
if (data === 'icons')
|
||||
after = icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1;
|
||||
if (data === 'items')
|
||||
after = items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a;
|
||||
if (data === 'maps')
|
||||
after = maps_90f36752_8815_4be8_b32b_d7fad1d0542e;
|
||||
if (data === 'events')
|
||||
after = events_c12a15a8_c380_4b28_8144_256cba95f760;
|
||||
|
||||
if (data === 'enemys') {
|
||||
core.enemys.enemys = after;
|
||||
for (var enemyId in after) {
|
||||
core.enemys.enemys[enemyId].id = enemyId;
|
||||
}
|
||||
core.material.enemys = core.getEnemys();
|
||||
} else if (data === 'icons') {
|
||||
core.icons.icons = after;
|
||||
core.material.icons = core.getIcons();
|
||||
} else if (data === 'items') {
|
||||
core.items.items = after;
|
||||
for (var itemId in after) {
|
||||
core.items.items[itemId].id = itemId;
|
||||
}
|
||||
core.material.items = core.getItems();
|
||||
} else if (data === 'maps') {
|
||||
core.maps.blocksInfo = after;
|
||||
core.status.mapBlockObjs = {};
|
||||
core.status.number2block = {};
|
||||
Object.values(core.status.maps).forEach(v => delete v.blocks);
|
||||
core.extractBlocks();
|
||||
core.setWeather(
|
||||
core.animateFrame.weather.type,
|
||||
core.animateFrame.weather.level
|
||||
);
|
||||
core.drawMap();
|
||||
} else if (data === 'events') {
|
||||
core.events.commonEvent = after.commonEvent;
|
||||
} else if (data === 'data') {
|
||||
location.reload();
|
||||
}
|
||||
core.updateStatusBar(true, true);
|
||||
console.log(`data hot reload: ${data}`);
|
||||
}
|
||||
|
||||
// 初始化
|
||||
(async function () {
|
||||
const data = await post('/reload', 'POST', 'test');
|
||||
if (data === '@error') {
|
||||
console.log(`未检测到node服务,热重载插件将无法使用`);
|
||||
} else {
|
||||
console.log(`热重载插件加载成功`);
|
||||
// reload
|
||||
setInterval(async () => {
|
||||
const res = await post('/reload', 'POST');
|
||||
if (res === '@error') return;
|
||||
if (res === 'true') location.reload();
|
||||
else return;
|
||||
}, 1000);
|
||||
|
||||
// hot reload
|
||||
setInterval(async () => {
|
||||
const res = await post('/hotReload', 'POST');
|
||||
const data = res.split('@@');
|
||||
data.forEach(v => {
|
||||
if (v === '') return;
|
||||
const [type, file] = v.split(':');
|
||||
if (type === 'css') reloadCss(file);
|
||||
if (type === 'data') reloadData(file);
|
||||
if (type === 'floor') reloadFloor(file);
|
||||
if (type === 'script') reloadScript(file);
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
})();
|
||||
},
|
||||
},
|
||||
"dynamicHP": function () {
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user