diff --git a/public/main.js b/public/main.js index 491e7f8..d15c554 100644 --- a/public/main.js +++ b/public/main.js @@ -504,6 +504,7 @@ main.prototype.listen = function () { main.dom.body.onkeydown = function (e) { if (main.editorOpened) return; try { + if (e.keyCode === 27) e.preventDefault(); if (main.dom.inputDiv.style.display == 'block') return; if ( main.core && @@ -539,6 +540,7 @@ main.prototype.listen = function () { ) { // ESC main.core.showStartAnimate(true); + e.preventDefault(); } e.stopPropagation(); return; @@ -873,40 +875,6 @@ main.prototype.listen = function () { } }; - ////// 点击“开始游戏”时 ////// - // main.dom.playGame.onclick = function () { - // main.dom.startButtons.style.display = 'none'; - // main.core.control.checkBgm(); - - // if (main.levelChoose.length == 0) { - // core.events.startGame(''); - // } else { - // main.dom.levelChooseButtons.style.display = 'block'; - // main.selectedButton = null; - // main.selectButton(0); - // } - // }; - - // ////// 点击“载入游戏”时 ////// - // main.dom.loadGame.onclick = function () { - // main.core.control.checkBgm(); - // main.core.load(); - // }; - - // ////// 点击“录像回放”时 ////// - // main.dom.replayGame.onclick = function () { - // main.core.control.checkBgm(); - // main.core.chooseReplayFile(); - // }; - - // main.dom.musicBtn.onclick = function () { - // try { - // if (main.core) main.core.triggerBgm(); - // } catch (ee) { - // console.error(ee); - // } - // }; - window.onblur = function () { if (main.core && main.core.control) { try { diff --git a/public/project/floors/MT0.js b/public/project/floors/MT0.js index 19596ea..85d318b 100644 --- a/public/project/floors/MT0.js +++ b/public/project/floors/MT0.js @@ -20,7 +20,7 @@ main.floors.MT0= [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, 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,642, 0,141, 0,141, 33, 33,20040], [141, 34, 34,141, 0,141, 45,559, 46,141, 0,141,141,141,20040], [141,141,141,141, 0, 0,558, 0,560, 0, 0,141, 33, 33,20040], [141, 33, 33,141, 0,141,367, 0,129,141, 0,494,482,482,20040], diff --git a/public/project/floors/MT14.js b/public/project/floors/MT14.js index 6272456..4605be8 100644 --- a/public/project/floors/MT14.js +++ b/public/project/floors/MT14.js @@ -212,10 +212,18 @@ main.floors.MT14= } ], "127,1": [ - "你是怎么办到的?!" + "你是怎么办到的?!", + { + "type": "function", + "function": "function(){\nif (!core.isReplaying()) {\n\tcore.addMountSign(2);\n}\n}" + } ], "26,14": [ - "不作死就不会死" + "不作死就不会死", + { + "type": "function", + "function": "function(){\nif (!core.isReplaying()) {\n\tcore.addMountSign(1);\n}\n}" + } ], "8,2": [ "这一层有一个必须使用跳跃的地方,需要1个跳跃次数,你一共有3个跳跃次数,请规划好", diff --git a/public/project/floors/MT15.js b/public/project/floors/MT15.js index a91ddc1..c7e14e7 100644 --- a/public/project/floors/MT15.js +++ b/public/project/floors/MT15.js @@ -34,13 +34,25 @@ main.floors.MT15= "parallelDo": "", "events": { "44,0": [ - "不愧是你!!!" + "不愧是你!!!", + { + "type": "function", + "function": "function(){\nif (!core.isReplaying()) {\n\tcore.addMountSign(4);\n}\n}" + } ], "62,0": [ - "卧槽!你连这都到了?!" + "卧槽!你连这都到了?!", + { + "type": "function", + "function": "function(){\nif (!core.isReplaying()) {\n\tcore.addMountSign(5);\n}\n}" + } ], "9,0": [ - "这边没有彩蛋,往右边走→_→" + "这边没有彩蛋,往右边走→_→", + { + "type": "function", + "function": "function(){\nif (!core.isReplaying()) {\n\tcore.addMountSign(3);\n}\n}" + } ], "13,7": [ "看到下面那个绝对防御怪了吗?", @@ -72,9 +84,9 @@ main.floors.MT15= "autoEvent": {}, "cannotMove": {}, "map": [ - [30144,30145,30146,30147,30144,30145,30146,30147, 0,129, 0, 0, 0, 0, 0, 0, 0, 0, 0,20075, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,129,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,129,20055], - [30152,30153,30154,30155,30152,30153,30154,30155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20058], - [30160,30161,30162,30163,30160,30161,30162,30163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,336,141,141,141,141,141,141,141,141,141,141,20007,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20074], + [30144,30145,30146,30147,30144,30145,30146,30147, 0,129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,129,20055], + [30152,30153,30154,30155,30152,30153,30154,30155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20057,20057,20057,20057, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20058], + [30160,30161,30162,30163,30160,30161,30162,30163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,336,141,141,141,141,141,141,141,141,141,141,20007,20065,20065,20065,20065, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20074], [ 0, 0, 0, 0, 0, 0, 0, 0, 0,390,403,378, 21,484,492, 0, 27, 0, 0, 0, 28, 32,492,396,376,484,403,492,378,492,376,30152,30153,30154,30155, 34,511,484,376,403,378, 0,499, 0, 28,381, 28, 33,511,141,484, 0,269, 0,336,378, 0,512,336,482, 27,381, 0,20007], [ 0, 0, 0, 0, 0, 0, 0, 0, 0,141,141,141,141,512,141, 33, 0, 28, 0,503,141,141,141, 0,336,336,336,340, 0,141, 0,30160,30161,30162,30163, 28,336,336,336,336,336,494,484,390,403,403,396, 0, 0,492, 0,336, 0,482,492,482,336, 0,336,336,336,492,244, 94], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 33,378,492, 0,381, 0,503,141,141,141, 0, 27, 0,141,512, 0, 32,403,340,403,141,403, 0,244, 34, 27,381,492,403, 0,482, 0,378,336,336,336,512,336,492,376,403,378, 28, 0, 0,511, 0,492,390, 0,403, 0,484, 0, 0], @@ -90,8 +102,8 @@ main.floors.MT15= ], "bgmap": [ [ 0, 0, 0, 0, 0, 0, 0, 0,20076,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20075, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20076,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20054,20055], - [ 0, 0, 0, 0, 0, 0, 0, 0,20047,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0,20047,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [ 0, 0, 0, 0, 0, 0, 0, 0,20047,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20047, 0, 0, 0, 0,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057,20057, 0], + [ 0, 0, 0, 0, 0, 0, 0, 0,20047,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20047, 0, 0, 0, 0,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065,20065, 0], [20054,20054,20054,20054,20054,20054,20054,20054,20055, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [20057,20057,20057,20057,20057,20057,20057,20057,20058, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20037,20038,20038,20038,20038,20039, 0, 0, 0,20045,20047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [20065,20065,20065,20065,20065,20065,20065,20065,20074, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20045, 0, 0, 0, 0,20047, 0, 0, 0,20045,20047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20037], diff --git a/public/project/functions.js b/public/project/functions.js index 82e87bb..a15807c 100644 --- a/public/project/functions.js +++ b/public/project/functions.js @@ -206,6 +206,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { core.visitFloor(floorId); } } + core.checkVisitedFloor(); }, flyTo: function (toId, callback) { // 楼层传送器的使用,从当前楼层飞往toId diff --git a/public/project/icons.js b/public/project/icons.js index 8943749..73d5e92 100644 --- a/public/project/icons.js +++ b/public/project/icons.js @@ -598,7 +598,8 @@ var icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 = "I574": 99, "I575": 100, "I589": 101, - "I641": 102 + "I641": 102, + "I642": 103 }, "autotile": { "autotile": 0, diff --git a/public/project/items.js b/public/project/items.js index 42a829b..17912b6 100644 --- a/public/project/items.js +++ b/public/project/items.js @@ -1357,5 +1357,11 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "mana": 5 } } + }, + "I642": { + "cls": "constants", + "name": "成就", + "canUseItemEffect": "true", + "useItemEffect": "core.plugin.achievementOpened.value = true;" } } \ No newline at end of file diff --git a/public/project/maps.js b/public/project/maps.js index d7589f0..e08cc1d 100644 --- a/public/project/maps.js +++ b/public/project/maps.js @@ -570,6 +570,7 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e = "639": {"cls":"npc48","id":"N639"}, "640": {"cls":"terrains","id":"T640","canPass":true}, "641": {"cls":"items","id":"I641"}, + "642": {"cls":"items","id":"I642"}, "20032": {"cls":"tileset","id":"X20032","cannotOut":["up","left"],"cannotIn":["up","left"]}, "20033": {"cls":"tileset","id":"X20033","cannotOut":["up"],"cannotIn":["up"]}, "20034": {"cls":"tileset","id":"X20034","cannotOut":["up","right"],"cannotIn":["up","right"]}, diff --git a/public/project/materials/items.png b/public/project/materials/items.png index ae61e62..860669c 100644 Binary files a/public/project/materials/items.png and b/public/project/materials/items.png differ diff --git a/src/data/achievement.json b/src/data/achievement.json index 801a232..09b9015 100644 --- a/src/data/achievement.json +++ b/src/data/achievement.json @@ -37,7 +37,7 @@ "text": [ "第一章完成度达到100%" ], - "progress": "100 / 100", + "progress": "${core.getChapterCompletion(1)} / 100", "percent": true, "point": 50 }, @@ -46,7 +46,7 @@ "text": [ "与山路上的若干个神秘木牌对话" ], - "progress": "5 / 5", + "progress": "${core.getLocalStorage('mountSign', 0)} / 5", "hide": "该探索成就需要你自己探索如何达成", "point": 25 }, @@ -55,7 +55,7 @@ "text": [ "第二章完成度达到100%" ], - "progress": "100 / 100", + "progress": "${core.getChapterCompletion(2)} / 100", "percent": true, "point": 50 }, diff --git a/src/data/settings.json b/src/data/settings.json index bf8667d..b9a8f39 100644 --- a/src/data/settings.json +++ b/src/data/settings.json @@ -1,7 +1,10 @@ { "fullscreen": { "text": "全屏游戏", - "desc": ["是否全屏进行游戏"] + "desc": [ + "是否全屏进行游戏,全屏后按ESC退出全屏,不能开启系统设置菜单,请按下方的按钮打开。", + "进入或退出全屏后请存读档一下,以解决一部分绘制问题。" + ] }, "transition": { "text": "界面动画", diff --git a/src/initPlugin.ts b/src/initPlugin.ts index 30b72c9..806f57b 100644 --- a/src/initPlugin.ts +++ b/src/initPlugin.ts @@ -13,6 +13,8 @@ import fixed from './plugin/ui/fixed'; import webglUtils from './plugin/webgl/utils'; import shadow from './plugin/shadow/shadow'; import gameShadow from './plugin/shadow/gameShadow'; +import achievement from './plugin/ui/achievement'; +import completion, { floors } from './plugin/completion'; function forward() { const toForward: any[] = [ @@ -30,7 +32,9 @@ function forward() { fixed(), webglUtils(), shadow(), - gameShadow() + gameShadow(), + achievement(), + completion() ]; // 初始化所有插件,并转发到core上 @@ -52,6 +56,13 @@ function forward() { console.log('插件转发完成!'); })(); + + Object.values(floors).forEach((v, i) => { + const from = core.floorIds.indexOf(v[0]); + const to = core.floorIds.indexOf(v[1]); + const all = core.floorIds.slice(from, to + 1); + floors[i + 1] = all; + }); } main.forward = forward; diff --git a/src/plugin/completion.ts b/src/plugin/completion.ts new file mode 100644 index 0000000..7b1e3a0 --- /dev/null +++ b/src/plugin/completion.ts @@ -0,0 +1,108 @@ +import { + AchievementType, + completeAchievement, + hasCompletedAchievement +} from './ui/achievement'; +import { changeLocalStorage } from './utils'; +import list from '../data/achievement.json'; + +export default function init() { + return { getChapterCompletion, checkVisitedFloor }; +} + +export const floors: Record = { + 1: ['MT0', 'tower7'] +}; +const achis: Record> = { + 1: { + normal: [0, 1], + challenge: [0], + explore: [1] + } +}; + +export const achiDict: Record = { + 1: 0 +}; + +/** + * 检查所有到达过的楼层,用于成就的计算 + */ +export function checkVisitedFloor() { + changeLocalStorage>>( + 'visitedFloor', + data => { + let needUpdate = false; + core.floorIds.forEach(v => { + if (core.hasVisitedFloor(v)) { + data[v] = true; + needUpdate = true; + } + }); + if (needUpdate) { + checkCompletionAchievement(); + } + + return data; + }, + {} + ); +} + +/** + * 获取一个章节的完成度 + * @param num 章节 + */ +export function getChapterCompletion(num: number) { + if (!achis[num]) return 0; + let res = 0; + const all = floors[num]; + const achiNum = Object.values(achis[num]).reduce( + (pre, cur) => pre + cur.length, + 0 + ); + + // 计算到达过的楼层 + let visitedFloor = 0; + const visited = core.getLocalStorage>>( + 'visitedFloor', + {} + ); + all.forEach(v => { + if (visited[v]) visitedFloor++; + }); + const floorRatio = all.length / (all.length + achiNum); + const floorPoint = (floorRatio * visitedFloor) / all.length; + + let completedPoint = 0; + let totalPoint = 0; + + // 计算成就,占比按成就点走 + for (const [type, achi] of Object.entries(achis[num]) as [ + AchievementType, + number[] + ][]) { + achi.forEach(v => { + totalPoint += list[type][v].point; + if (hasCompletedAchievement(type, v)) { + completedPoint += list[type][v].point; + } + }); + } + const achiPoint = (completedPoint / totalPoint) * (1 - floorRatio); + + res = floorPoint + achiPoint; + + return Math.floor(res * 100); +} + +/** + * 检查完成度成就是否完成 + */ +export function checkCompletionAchievement() { + [1].forEach(v => { + if (getChapterCompletion(v) >= 100) { + completeAchievement('explore', achiDict[v]); + } + }); +} diff --git a/src/plugin/ui/achievement.ts b/src/plugin/ui/achievement.ts index 3de6769..ae4ef8c 100644 --- a/src/plugin/ui/achievement.ts +++ b/src/plugin/ui/achievement.ts @@ -1,6 +1,7 @@ import { ref } from 'vue'; import list from '../../data/achievement.json'; -import { has } from '../utils'; +import { achiDict, checkCompletionAchievement } from '../completion'; +import { changeLocalStorage, has } from '../utils'; type AchievementList = typeof list; export type AchievementType = keyof AchievementList; @@ -17,7 +18,7 @@ export interface Achievement { } export default function init() { - return {}; + return { completeAchievement, hasCompletedAchievement, addMountSign }; } export const showComplete = ref(false); @@ -37,13 +38,22 @@ export const totalPoint = Object.values(list) * @param index 成就索引 */ export function completeAchievement(type: AchievementType, index: number) { - const now = core.getLocalStorage('achievement', { - normal: [], - challenge: [], - explore: [] - }); - now[type][index] = true; - core.setLocalStorage('achievement', now); + if (flags.debug) return; + changeLocalStorage( + 'achievement', + data => { + data[type][index] = true; + return data; + }, + { + normal: [], + challenge: [], + explore: [] + } + ); + if (type === 'explore' && !Object.values(achiDict).includes(index)) { + checkCompletionAchievement(); + } completeAchi.value = `${type},${index}`; showComplete.value = true; } @@ -81,3 +91,32 @@ export function getNowPoint() { } return res; } + +// ----- 各个成就相关的函数 + +/** + * 山路木牌 + * @param id 木牌id + */ +export function addMountSign(id: number) { + if (flags.debug) return; + if ( + !core.getLocalStorage(`mountSign_${id}`, false) && + !hasCompletedAchievement('explore', 1) + ) { + changeLocalStorage( + 'mountSign', + n => { + if (n + 1 >= 5) { + completeAchievement('explore', 1); + for (const i of [1, 2, 3, 4, 5]) { + core.removeLocalStorage(`mountSign_${i}`); + } + } + return n + 1; + }, + 0 + ); + core.setLocalStorage(`mountSign_${id}`, true); + } +} diff --git a/src/plugin/uiController.ts b/src/plugin/uiController.ts index c4ea368..e08d2df 100644 --- a/src/plugin/uiController.ts +++ b/src/plugin/uiController.ts @@ -95,7 +95,8 @@ export default function init() { shopOpened, startOpened, startAnimationEnded, - loaded + loaded, + achievementOpened }; } diff --git a/src/plugin/utils.ts b/src/plugin/utils.ts index ea5d7fe..b19ef2f 100644 --- a/src/plugin/utils.ts +++ b/src/plugin/utils.ts @@ -15,7 +15,7 @@ type CanParseCss = keyof { }; export default function init() { - return { has, getDamageColor, parseCss, tip }; + return { has, getDamageColor, parseCss, tip, changeLocalStorage }; } /** @@ -212,3 +212,19 @@ export async function doByInterval( } } } + +/** + * 更改一个本地存储 + * @param name 要更改的信息 + * @param fn 更改时执行的函数 + * @param defaultValue 如果不存在时获取的默认值 + */ +export function changeLocalStorage( + name: string, + fn: (data: T) => T, + defaultValue?: T +) { + const now = core.getLocalStorage(name, defaultValue); + const to = fn(now); + core.setLocalStorage(name, to); +} diff --git a/src/source/cls.d.ts b/src/source/cls.d.ts index 17047bf..6760e0d 100644 --- a/src/source/cls.d.ts +++ b/src/source/cls.d.ts @@ -569,6 +569,7 @@ interface IdToCls { N639: 'npc48'; T640: 'terrains'; I641: 'items'; + I642: 'items'; X20032: 'tileset'; X20033: 'tileset'; X20034: 'tileset'; diff --git a/src/source/items.d.ts b/src/source/items.d.ts index 741685e..307232e 100644 --- a/src/source/items.d.ts +++ b/src/source/items.d.ts @@ -186,4 +186,5 @@ interface ItemDeclaration { I575: 'equips'; I589: 'equips'; I641: 'equips'; + I642: 'constants'; } \ No newline at end of file diff --git a/src/source/maps.d.ts b/src/source/maps.d.ts index 8da6bfe..e50b440 100644 --- a/src/source/maps.d.ts +++ b/src/source/maps.d.ts @@ -569,6 +569,7 @@ interface IdToNumber { N639: 639; T640: 640; I641: 641; + I642: 642; X20032: 20032; X20033: 20033; X20034: 20034; @@ -1221,6 +1222,7 @@ interface NumberToId { 639: 'N639'; 640: 'T640'; 641: 'I641'; + 642: 'I642'; 20032: 'X20032'; 20033: 'X20033'; 20034: 'X20034'; diff --git a/src/types/plugin.d.ts b/src/types/plugin.d.ts index cdd0487..37a9945 100644 --- a/src/types/plugin.d.ts +++ b/src/types/plugin.d.ts @@ -20,7 +20,8 @@ interface PluginDeclaration PluginUse, SkillTree, MiniMap, - HeroRealStatus { + HeroRealStatus, + PluginAchievement { /** * 添加函数 例:添加弹出文字,像这个就可以使用core.addPop或core.plugin.addPop调用 * @param px 弹出的横坐标 @@ -389,6 +390,32 @@ interface HeroRealStatus { ): HeroStatus[K]; } +interface PluginAchievement { + /** + * 完成一个成就 + * @param type 成就类型 + * @param index 成就索引 + */ + completeAchievement(type: AchievementType, index: number): void; + + /** + * 是否完成了某个成就 + * @param type 成就类型 + * @param index 成就索引 + */ + hasCompletedAchievement(type: AchievementType, index: number): boolean; + + /** + * 获取当前成就点数 + */ + getNowPoint(): number; + + /** + * 检查所有到达过的楼层,用于成就的计算 + */ + checkVisitedFloor(): void; +} + type Chapter = 'chapter1' | 'chapter2'; interface Skill { diff --git a/src/ui/achievement.vue b/src/ui/achievement.vue index 66d868b..2664df0 100644 --- a/src/ui/achievement.vue +++ b/src/ui/achievement.vue @@ -19,7 +19,7 @@
- +
diff --git a/src/ui/settings.vue b/src/ui/settings.vue index 9363ffb..cbed829 100644 --- a/src/ui/settings.vue +++ b/src/ui/settings.vue @@ -112,7 +112,9 @@ type Settings = typeof settingInfo; const core = window.core; -const selected = ref('transition'); +const selected = ref('fullscreen'); + +fullscreen.value = !!document.fullscreenElement; const descText = computed(() => { return splitText(settingInfo[selected.value].desc);