修复录像,修复部分bug,彻底完工

This commit is contained in:
unanmed 2023-04-28 23:58:07 +08:00
parent ebd94fc373
commit e4a556329b
16 changed files with 95 additions and 36 deletions

3
.gitignore vendored
View File

@ -31,4 +31,5 @@ story.md
dist.rar dist.rar
*.h5save *.h5save
*.h5route *.h5route
index.cjs index.cjs
!public/swap/*.h5save

View File

@ -1,4 +1,5 @@
vite.config.ts vite.config.ts
public/project/data.js public/project/data.js
story.md story.md
public/project/floors/*.js public/project/floors/*.js
public/project/items.js

View File

@ -18,7 +18,7 @@ main.floors.MT0=
[141, 34, 34,141, 0,141, 0, 0, 0,141, 0,494,482,482,20040], [141, 34, 34,141, 0,141, 0, 0, 0,141, 0,494,482,482,20040],
[141, 33, 33,492, 0,141, 0, 0, 0,141, 0,141, 33, 33,20040], [141, 33, 33,492, 0,141, 0, 0, 0,141, 0,141, 33, 33,20040],
[141, 34, 34,141, 0,141, 0, 0, 0,141, 0,141,141,141,20040], [141, 34, 34,141, 0,141, 0, 0, 0,141, 0,141,141,141,20040],
[141,141,141,141, 0, 0, 0,141, 0, 0, 0,141, 33, 33,20040], [141,141,141,141, 92, 0, 0,141, 0, 0, 0,141, 33, 33,20040],
[141, 34, 34,141, 0,141, 0, 0, 0,141, 0,494,482,482,20040], [141, 34, 34,141, 0,141, 0, 0, 0,141, 0,494,482,482,20040],
[141, 33, 33,492, 0,141, 0,642, 0,141, 0,141, 33, 33,20040], [141, 33, 33,492, 0,141, 0,642, 0,141, 0,141, 33, 33,20040],
[141, 34, 34,141, 0,141, 45,559, 46,141, 0,141,141,141,20040], [141, 34, 34,141, 0,141, 45,559, 46,141, 0,141,141,141,20040],
@ -55,6 +55,20 @@ main.floors.MT0=
], ],
"6,13": [ "6,13": [
"原声音乐可以在网易云音乐搜索:魔塔 人类:开天辟地 bgm部分音乐因为版权问题可能无法播放或者不在歌单内" "原声音乐可以在网易云音乐搜索:魔塔 人类:开天辟地 bgm部分音乐因为版权问题可能无法播放或者不在歌单内"
],
"3,7": [
"这里允许你跳转到第二章。如果你没玩过第一章,那么建议自己游玩,如果玩过却又不想再打一遍,可以由此跳转",
{
"type": "confirm",
"text": "是否跳转到第二章?",
"yes": [
{
"type": "function",
"function": "function(){\ncore.swapChapter(2, flags.hard);\n}"
}
],
"no": []
}
] ]
}, },
"changeFloor": { "changeFloor": {

View File

@ -70,7 +70,7 @@ main.floors.MT16=
}, },
{ {
"type": "function", "type": "function",
"function": "function(){\ncore.status.maps.MT14.canFlyFrom = false\n}" "function": "function(){\ncore.status.maps.MT14.canFlyFrom = false;\ncore.chaseInit1();\n}"
}, },
{ {
"type": "show", "type": "show",

View File

@ -81,6 +81,10 @@ main.floors.MT18=
], ],
"beforeBattle": {}, "beforeBattle": {},
"cannotMoveIn": {}, "cannotMoveIn": {},
"bg2map": [], "bg2map": [
"fg2map": []
],
"fg2map": [
]
} }

View File

@ -24,7 +24,7 @@ main.floors.MT21=
"true": [ "true": [
{ {
"type": "confirm", "type": "confirm",
"text": "是否提交第一章成绩?", "text": "是否提交第一章成绩?\n提交将结束游戏结算第一章成绩否则将继续第二章",
"yes": [ "yes": [
"计分方式:生命+黄*5000+蓝*15000", "计分方式:生命+黄*5000+蓝*15000",
{ {

View File

@ -1747,7 +1747,12 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
checkLoopMap(); checkLoopMap();
// 追猎 // 追猎
if (core.status.checkBlock.haveHunt) { if (
core.status.checkBlock.haveHunt &&
!core
.getBlockId(core.status.hero.loc.x, core.status.hero.loc.y)
?.endsWith('Portal')
) {
var x = core.status.hero.loc.x, var x = core.status.hero.loc.x,
y = core.status.hero.loc.y; y = core.status.hero.loc.y;
core.status.maps[core.status.floorId].blocks.forEach(function ( core.status.maps[core.status.floorId].blocks.forEach(function (

View File

@ -40,8 +40,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "小绿宝石", "name": "小绿宝石",
"text": ",护盾+${core.values.greenGem}", "text": ",护盾+${core.values.greenGem}",
"itemEffect": "core.status.hero.mdef += 20 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(11) / 20 + 1)", "itemEffect": "core.status.hero.mdef += 20 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(12) / 20 + 1)",
"itemEffectTip": ",智慧+${20 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(11) / 20 + 1)}", "itemEffectTip": ",智慧+${20 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(12) / 20 + 1)}",
"useItemEffect": "core.status.hero.mdef += core.values.greenGem", "useItemEffect": "core.status.hero.mdef += core.values.greenGem",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -626,8 +626,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "中绿宝石", "name": "中绿宝石",
"text": ",护盾+${core.values.greenGem}", "text": ",护盾+${core.values.greenGem}",
"itemEffect": "core.status.hero.mdef += 40 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(11) / 20 + 1)", "itemEffect": "core.status.hero.mdef += 40 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(12) / 20 + 1)",
"itemEffectTip": ",智慧+${40 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(11) / 20 + 1)}", "itemEffectTip": ",智慧+${40 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(12) / 20 + 1)}",
"useItemEffect": "core.status.hero.mdef += core.values.greenGem", "useItemEffect": "core.status.hero.mdef += core.values.greenGem",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -729,8 +729,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "大绿宝石", "name": "大绿宝石",
"text": ",护盾+${core.values.greenGem}", "text": ",护盾+${core.values.greenGem}",
"itemEffect": "core.status.hero.mdef += 80 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(11) / 20 + 1)", "itemEffect": "core.status.hero.mdef += 80 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(12) / 20 + 1)",
"itemEffectTip": ",智慧+${80 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(11) / 20 + 1)}", "itemEffectTip": ",智慧+${80 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(12) / 20 + 1)}",
"useItemEffect": "core.status.hero.mdef += core.values.greenGem", "useItemEffect": "core.status.hero.mdef += core.values.greenGem",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -896,8 +896,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "超大绿宝石", "name": "超大绿宝石",
"text": ",护盾+${core.values.greenGem}", "text": ",护盾+${core.values.greenGem}",
"itemEffect": "core.status.hero.mdef += 160 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(11) / 20 + 1)", "itemEffect": "core.status.hero.mdef += 160 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(12) / 20 + 1)",
"itemEffectTip": ",智慧+${160 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(11) / 20 + 1)}", "itemEffectTip": ",智慧+${160 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(12) / 20 + 1)}",
"useItemEffect": "core.status.hero.mdef += core.values.greenGem", "useItemEffect": "core.status.hero.mdef += core.values.greenGem",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -1019,8 +1019,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "璀璨绿宝石", "name": "璀璨绿宝石",
"text": ",护盾+${core.values.greenGem}", "text": ",护盾+${core.values.greenGem}",
"itemEffect": "core.status.hero.mdef += 320 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(11) / 20 + 1)", "itemEffect": "core.status.hero.mdef += 320 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(12) / 20 + 1)",
"itemEffectTip": ",智慧+${320 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(11) / 20 + 1)}", "itemEffectTip": ",智慧+${320 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(12) / 20 + 1)}",
"useItemEffect": "core.status.hero.mdef += core.values.greenGem", "useItemEffect": "core.status.hero.mdef += core.values.greenGem",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -1050,8 +1050,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "新物品", "name": "新物品",
"text": ",防御+${core.values.blueGem}", "text": ",防御+${core.values.blueGem}",
"itemEffect": "core.status.hero.mdef += 640 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(11) / 20 + 1)", "itemEffect": "core.status.hero.mdef += 640 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(12) / 20 + 1)",
"itemEffectTip": ",智慧+${640 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(11) / 20 + 1)}", "itemEffectTip": ",智慧+${640 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(12) / 20 + 1)}",
"useItemEffect": "core.status.hero.def += core.values.blueGem", "useItemEffect": "core.status.hero.def += core.values.blueGem",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },
@ -1071,8 +1071,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items", "cls": "items",
"name": "史诗绿宝石", "name": "史诗绿宝石",
"text": ",护盾+${core.values.greenGem}", "text": ",护盾+${core.values.greenGem}",
"itemEffect": "core.status.hero.mdef += 1280 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(11) / 20 + 1)", "itemEffect": "core.status.hero.mdef += 1280 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(12) / 20 + 1)",
"itemEffectTip": ",智慧+${1280 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(11) / 20 + 1)}", "itemEffectTip": ",智慧+${1280 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (core.plugin.skillTree.getSkillLevel(12) / 20 + 1)}",
"useItemEffect": "core.status.hero.mdef += core.values.greenGem", "useItemEffect": "core.status.hero.mdef += core.values.greenGem",
"canUseItemEffect": "true" "canUseItemEffect": "true"
}, },

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -79,7 +79,9 @@
"<br>", "<br>",
"2. 影法师", "2. 影法师",
"<br>", "<br>",
"3. 夜战天明889" "3. 夜战天明889",
"<br>",
"4. 霸道的老鼠"
] ]
}, },
"tutorial": { "tutorial": {

View File

@ -2,9 +2,10 @@ import { Animation, circle, hyper, sleep, TimingFn } from 'mutate-animate';
import { completeAchievement } from '../ui/achievement'; import { completeAchievement } from '../ui/achievement';
import { has } from '../utils'; import { has } from '../utils';
import { ChaseCameraData, ChasePath, getChaseDataByIndex } from './data'; import { ChaseCameraData, ChasePath, getChaseDataByIndex } from './data';
import { init1 } from './chase1';
export default function init() { export default function init() {
return { startChase }; return { startChase, chaseInit1: init1 };
} }
export function shake2(power: number, timing: TimingFn): TimingFn { export function shake2(power: number, timing: TimingFn): TimingFn {
@ -31,7 +32,7 @@ export class Chase {
*/ */
showPath: boolean = false; showPath: boolean = false;
endFn?: () => void; endFn?: (lose: boolean) => void;
/** /**
* *
@ -213,14 +214,14 @@ export class Chase {
* *
* @param fn * @param fn
*/ */
onEnd(fn: () => void) { onEnd(fn: (lose: boolean) => void) {
this.endFn = fn; this.endFn = fn;
} }
/** /**
* *
*/ */
end() { end(lose: boolean = false) {
this.ani.ticker.destroy(); this.ani.ticker.destroy();
delete flags.onChase; delete flags.onChase;
delete flags.chase; delete flags.chase;
@ -229,7 +230,7 @@ export class Chase {
delete flags.chaseIndex; delete flags.chaseIndex;
flags.__lockViewport__ = false; flags.__lockViewport__ = false;
core.deleteCanvas('chasePath'); core.deleteCanvas('chasePath');
if (this.endFn) this.endFn(); if (this.endFn) this.endFn(lose);
} }
} }
@ -248,9 +249,9 @@ export async function startChase(index: number) {
const hard = flags.chaseHard; const hard = flags.chaseHard;
// 成就 // 成就
chase.onEnd(() => { chase.onEnd(lose => {
if (hard === 1) { if (hard === 1) {
if (index === 1) { if (index === 1 && !lose) {
completeAchievement('challenge', 0); completeAchievement('challenge', 0);
} }
} }

View File

@ -158,7 +158,7 @@ export async function wolfMove(chase: Chase) {
export function judgeFail1(chase: Chase) { export function judgeFail1(chase: Chase) {
chase.ani.ticker.add(() => { chase.ani.ticker.add(() => {
if (core.status.hero.loc.x > core.bigmap.offsetX / 32 + 17) { if (core.status.hero.loc.x > core.bigmap.offsetX / 32 + 17) {
chase.end(); chase.end(true);
ani.time(750).apply('rect', 0); ani.time(750).apply('rect', 0);
core.lose('逃跑失败'); core.lose('逃跑失败');
} }

View File

@ -64,7 +64,7 @@ watch(useFixed, n => {
core.setLocalStorage('useFixed', n); core.setLocalStorage('useFixed', n);
}); });
watch(autoSkill, n => { watch(autoLocate, n => {
flags.autoLocate = n; flags.autoLocate = n;
core.updateStatusBar(); core.updateStatusBar();
core.status.route.push(`set:autoLocate:${n}`); core.status.route.push(`set:autoLocate:${n}`);
@ -101,9 +101,9 @@ function resetFlag() {
flags.itemDetail ??= true; flags.itemDetail ??= true;
flags.autoLocate ??= true; flags.autoLocate ??= true;
itemDetail.value = flags.itemDetail ? true : false; itemDetail.value = !!flags.itemDetail;
autoSkill.value = flags.autoSkill ? true : false; autoSkill.value = !!flags.autoSkill;
autoLocate.value = flags.autoLocate ? true : false; autoLocate.value = !!flags.autoLocate;
} }
export async function triggerFullscreen() { export async function triggerFullscreen() {

View File

@ -5,6 +5,8 @@ import { isNil } from 'lodash';
import { Animation, sleep, TimingFn } from 'mutate-animate'; import { Animation, sleep, TimingFn } from 'mutate-animate';
import { ComputedRef, ref } from 'vue'; import { ComputedRef, ref } from 'vue';
import { EVENT_KEY_CODE_MAP } from './keyCodes'; import { EVENT_KEY_CODE_MAP } from './keyCodes';
import axios from 'axios';
import { decompressFromBase64 } from 'lz-string';
type CanParseCss = keyof { type CanParseCss = keyof {
[P in keyof CSSStyleDeclaration as CSSStyleDeclaration[P] extends string [P in keyof CSSStyleDeclaration as CSSStyleDeclaration[P] extends string
@ -15,7 +17,14 @@ type CanParseCss = keyof {
}; };
export default function init() { export default function init() {
return { has, getDamageColor, parseCss, tip, changeLocalStorage }; return {
has,
getDamageColor,
parseCss,
tip,
changeLocalStorage,
swapChapter
};
} }
/** /**
@ -228,3 +237,20 @@ export function changeLocalStorage<T>(
const to = fn(now); const to = fn(now);
core.setLocalStorage(name, to); core.setLocalStorage(name, to);
} }
export async function swapChapter(chapter: number, hard: number) {
const h = hard === 2 ? 'hard' : 'easy';
const save = await axios.get(
`${import.meta.env.BASE_URL}swap/${chapter}.${h}.h5save`,
{
responseType: 'text',
responseEncoding: 'utf-8'
}
);
const data = JSON.parse(decompressFromBase64(save.data));
core.loadData(data.data, () => {
core.removeFlag('__fromLoad__');
core.drawTip('读档成功');
});
}

View File

@ -146,6 +146,9 @@ function click(id: keyof Settings) {
} }
if (!ignore.includes(id)) { if (!ignore.includes(id)) {
settings[id].value = !settings[id].value; settings[id].value = !settings[id].value;
if (id === 'autoSkill') {
core.status.route.push(`set:autoSkill:${settings.autoSkill.value}`);
}
} else { } else {
if (id === 'fullscreen') { if (id === 'fullscreen') {
triggerFullscreen(); triggerFullscreen();