From ce838e0225ad54337ec2e5c15ce277d044a4b4df Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Fri, 30 Dec 2022 14:14:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=83=A8=E5=88=86ui=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E5=89=A7=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- public/main.js | 1 + public/project/data.js | 71 ++++++++++++-------------- public/project/floors/MT0.js | 20 ++++---- public/project/floors/MT1.js | 9 ++-- public/project/floors/MT5.js | 44 ++-------------- public/project/floors/MT6.js | 68 ++++++++++++++++--------- public/project/items.js | 2 +- public/project/plugins.js | 45 ++++++++++------ public/styles.css | 99 ++++++++++++++++++++++++++++++++---- src/components/box.vue | 6 ++- src/components/enemyOne.vue | 19 +++---- src/data/desc.json | 55 +++++++++++++++++++- src/data/settings.json | 14 ++++- src/plugin/settings.ts | 30 ++++++++++- src/plugin/utils.ts | 4 +- src/types/plugin.d.ts | 5 ++ src/ui/chapter.vue | 22 ++++---- src/ui/markedEnemy.vue | 6 +-- src/ui/settings.vue | 56 ++++++++++++++++---- src/ui/statusBar.vue | 24 ++++++++- 21 files changed, 418 insertions(+), 184 deletions(-) diff --git a/index.html b/index.html index ae68d05..d07aadf 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,7 @@ - +
diff --git a/public/main.js b/public/main.js index bf13921..7768204 100644 --- a/public/main.js +++ b/public/main.js @@ -237,6 +237,7 @@ main.prototype.init = function (mode, callback) { var span = document.createElement('span'); span.setAttribute('class', 'startButton'); span.innerText = value.title || ''; + span.id = value.name; (function (span, str_) { span.onclick = function () { core.events.startGame(str_); diff --git a/public/project/data.js b/public/project/data.js index dfdd2cf..65218f2 100644 --- a/public/project/data.js +++ b/public/project/data.js @@ -199,7 +199,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "levelChoose": [ { "title": "简单", - "name": "Easy", + "name": "easy", "hard": 1, "color": [ 0, @@ -440,41 +440,11 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = } ], "startText": [ - { - "type": "setValue", - "name": "flag:usePlatFly", - "value": "true" - }, - { - "type": "setValue", - "name": "flag:__useMinimap__", - "value": "true" - }, - { - "type": "setValue", - "name": "flag:fixToBook", - "value": "false" - }, { "type": "setValue", "name": "flag:itemDetail", "value": "true" }, - { - "type": "setValue", - "name": "item:book", - "value": "1" - }, - { - "type": "setValue", - "name": "item:wand", - "value": "1" - }, - { - "type": "setValue", - "name": "item:I330", - "value": "1" - }, { "type": "hideStatusBar" }, @@ -504,37 +474,62 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "type": "playSound", "name": "paper.mp3" }, - "这是人类史上的一大进展", + "在万物的发展中,任何物体都有它自己的发光点。", { "type": "playSound", "name": "paper.mp3" }, - "人类开始使用工具", + "人类,这个起初完全不起眼的种族,", { "type": "playSound", "name": "paper.mp3" }, - "人类开始使用武器", + "却在那一天发生了惊天的变动。", { "type": "playSound", "name": "paper.mp3" }, - "人类开始狩猎", + "那曾是一个不起眼的日子。", { "type": "playSound", "name": "paper.mp3" }, - "人类终于摆脱了四肢行走", + "直到一记闪电劈在了山上。", { "type": "playSound", "name": "paper.mp3" }, - "它让人类创造无限可能", + "山火蔓延,霎时间,茂密的树林已然变为了焦炭。", { "type": "playSound", "name": "paper.mp3" }, - "这是人类史上最辉煌的时刻", + "山火的发生让野兽饥不择食,", + { + "type": "playSound", + "name": "paper.mp3" + }, + "无数的人类被野兽硬生生拖走。", + { + "type": "playSound", + "name": "paper.mp3" + }, + "那又是一个不起眼的日子,", + { + "type": "playSound", + "name": "paper.mp3" + }, + "却让人类又一次发生了翻天地覆的变化。", + { + "type": "playSound", + "name": "paper.mp3" + }, + "一位野蛮人,也是我们的主角,", + { + "type": "playSound", + "name": "paper.mp3" + }, + "踏上了属于他的旅途。", { "type": "sleep", "time": 1000 diff --git a/public/project/floors/MT0.js b/public/project/floors/MT0.js index a0b4f62..ed9c3de 100644 --- a/public/project/floors/MT0.js +++ b/public/project/floors/MT0.js @@ -21,20 +21,18 @@ main.floors.MT0= [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, 34, 34,141, 0,141, 0,559, 0,141, 0,141,141,141,20040], - [141,141,141,141, 0, 0,558, 46,560, 0, 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], [141, 33, 33,492, 0,141,129, 0,129,141, 0,141, 33, 33,20040], [141,141,141,141,141,141,141,141,141,141,141,141,141,141,20040] ], "firstArrive": [ - "\t[原始人]\b[up,hero]家里柴火不够了,今天又要去砍柴了啊", - "\t[原始人]\b[up,hero]最好还能带点食物回来", - "\t[原始人]\b[up,hero]希望不要遇到什么凶猛的动物吧", - "\t[原始人]\b[up,hero]......", - "\t[原始人]\b[up,hero]家里面那些奇怪的石头还是没办法移走", - "\t[原始人]\b[up,hero]之后再想办法吧", - "请耐心等待字体加载完成,否则很多地方显示会很奇怪,大概需要十秒,过一段时间打开任意界面再关闭即可", + "\t[原始人]\b[up,hero]家里有没有柴火了,看来需要上山砍柴了啊。", + "\t[原始人]\b[up,hero]刚刚经历过山火,山上的柴火也不多了。", + "\t[原始人]\b[up,hero]为什么这么倒霉的事会摊在我头上。", + "\t[原始人]\b[up,hero]哎,不管了,先出去看看再说。", + "\r[red]注意!!!\r[]该塔新增了很多新的功能,同时对样板的ui进行了大幅度的改动,操作也有改变,由于内容过多,这里不再一一描述,具体请在道具栏查看百科全书!!百科全书是在你面前的几个道具中的其中一个", { "type": "function", "function": "function(){\ncore.showChapter('序章 起源');\n}" @@ -46,7 +44,9 @@ main.floors.MT0= "\t[原始人]\b[up,hero]出去找些柴火" ], "8,13": [ - "本塔有很多新的功能,所有的说明都详细地写在了前方的百科全书里面,里面包含所有的功能说明,不阅读可能会影响正常的游戏体验,请仔细阅读。" + "本塔有很多新的功能,所有的说明都详细地写在了前方的百科全书里面,里面包含所有的功能说明,不阅读可能会影响正常的游戏体验,请仔细阅读。", + "例如你现在首先感受到的应该是状态栏的变动,你可以打开百科全书阅读状态栏相关内容。里面包含状态栏的功能说明与布局说明等。", + "注意百科全书中的内容非常基础详细,如果对魔塔有一定的了解,可以选择性地阅读。" ], "8,12": [ "该塔计分方式:生命+5000*黄钥匙+15000*蓝钥匙" diff --git a/public/project/floors/MT1.js b/public/project/floors/MT1.js index 3309eb8..97f237a 100644 --- a/public/project/floors/MT1.js +++ b/public/project/floors/MT1.js @@ -14,9 +14,10 @@ main.floors.MT1= "defaultGround": "T331", "bgm": "cave.mp3", "firstArrive": [ - "\t[原始人]\b[up,hero]今天还是有这些黏糊糊的东西吗", - "\t[原始人]\b[up,hero]打过去就好了", - "\t[原始人]\b[up,hero]他们的反抗能力很弱的", + "\t[原始人]\b[up,hero]呼,今天也有这些黏糊糊的东西啊。", + "\t[原始人]\b[up,hero]真是奇怪,自从那次山火之后这里就出现了这些东西。", + "\t[原始人]\b[up,hero]真是搞不清他们的来历。", + "\t[原始人]\b[up,hero]不过好在他们反抗能力很弱,随便打打就能打过去了。", { "type": "if", "condition": "(flag:hard===1)", @@ -25,7 +26,7 @@ main.floors.MT1= "type": "confirm", "text": "是否阅读魔塔基本游戏规则(教程)", "yes": [ - "魔塔遵循你打我一下,我打你一下的原则,每次造成的伤害时己方攻击减去对方防御\n红宝石可以增加攻击,蓝宝石可以增加防御,血瓶增加血量\n打怪物可以获得经验和金币,经验可用于升级,金币可用于购物\n以上就是基本规则,祝您游戏愉快!" + "魔塔遵循你打我一下,我打你一下的原则,每次造成的伤害为己方攻击减去对方防御\n红宝石可以增加攻击,蓝宝石可以增加防御,血瓶增加血量\n打怪物可以获得经验和金币,经验可用于升级,金币可用于购物\n以上就是基本规则,祝您游戏愉快!" ], "no": [ "祝您游戏愉快" diff --git a/public/project/floors/MT5.js b/public/project/floors/MT5.js index 7a37cac..2a1f244 100644 --- a/public/project/floors/MT5.js +++ b/public/project/floors/MT5.js @@ -66,61 +66,27 @@ main.floors.MT5= "textfont": 20, "time": 25 }, - "他们走出了洞穴!!!!!", + "人类简史——起源篇", { "type": "playSound", "name": "paper.mp3" }, - "他们终于摆脱了那种远古的生活方式!", + "走出山洞,看似一个不起眼的举动,却是一个让残酷的真相永远地消失在了历史中的举动。", { "type": "playSound", "name": "paper.mp3" }, - "此时此刻,他们站在了明亮的草地之上", + "但是,这个举动,也是人类至今都能与自然和谐共处的根本。", { "type": "playSound", "name": "paper.mp3" }, - "身向高山,背临江水", - { - "type": "playSound", - "name": "paper.mp3" - }, - "此时此刻,他们站在了历史的转折处", - { - "type": "playSound", - "name": "paper.mp3" - }, - "前进之力,无法阻挡", - { - "type": "playSound", - "name": "paper.mp3" - }, - "此时此刻,星空闪耀着文明的曙光", - { - "type": "playSound", - "name": "paper.mp3" - }, - "普照世间,闪耀一世", - { - "type": "playSound", - "name": "paper.mp3" - }, - "点破苍穹,斩断寰宇", - { - "type": "playSound", - "name": "paper.mp3" - }, - "星星之火,可以燎原", - { - "type": "playSound", - "name": "paper.mp3" - }, - "文明之光,就在眼前!", + "那些残酷的历史将无人知晓,那些人类的残忍杀戮将不会出现。", { "type": "playSound", "name": "paper.mp3" }, + "而这些源头便是这看似无足轻重的一个举动。", { "type": "setText", "text": [ diff --git a/public/project/floors/MT6.js b/public/project/floors/MT6.js index 63f6558..c99721f 100644 --- a/public/project/floors/MT6.js +++ b/public/project/floors/MT6.js @@ -18,27 +18,52 @@ main.floors.MT6= "type": "setCurtain", "time": 500 }, - "\t[原始人]\b[down,hero]感觉今天和之前有些不大一样", - "\t[原始人]\b[down,hero]......", - "\t[原始人]\b[down,hero]等一下,草地上那是什么?", - "\t[智慧结晶]\b[down,4,4]我是智慧的结晶,存储着大量的智慧", - "\t[原始人]\b[down,hero]?还会说话?", - "\t[智慧结晶]\b[down,4,4]不要大惊小怪,我只是后人的智慧凝结而成的结晶罢了", - "\t[智慧结晶]\b[down,4,4]你可以吸收我的智慧,来让你更有智慧", - "\t[智慧结晶]\b[down,4,4]这样,你便能做一些其他你现在做不到事情", - "\t[原始人]\b[down,hero]所以,我只要把你拿在手上就行了?", - "\t[智慧结晶]\b[down,4,4]不,你只需要捏碎我,便可吸收我的全部智慧", - "\t[智慧结晶]\b[down,4,4]至于我会说话,只是后人给我的特有功能,让你知道我的能力而已", - "\t[智慧结晶]\b[down,4,4]这个功能会在我完成任务后自动关闭", - "\t[智慧结晶]\b[down,4,4]也就是说,马上我就不会说话了", - "\t[智慧结晶]\b[down,4,4]现在,你懂我的能力了吗?", - "\t[原始人]\b[down,hero]大概...懂了吧", - "\t[智慧结晶]\b[down,4,4]嗯,那我就离开了,记得捏碎我哦!", - "\t[原始人]\b[down,hero].......", - "\t[原始人]\b[down,hero]试着去捏碎它吧", + "\t[原始人]\b[down,hero]外面也有这些怪物吗。", + "\t[原始人]\b[down,hero]看来上山会有很大的难度啊。", + "\t[智慧结晶]\b[down,4,4]哦?看起来你需要一些帮助?", + "\t[原始人]\b[down,hero]谁?谁在说话?", + "\t[智慧结晶]\b[down,4,4]你往左边看看,那有一个绿色水晶,我就是那个绿色水晶。", + { + "type": "changePos", + "direction": "right" + }, + { + "type": "sleep", + "time": 300 + }, + { + "type": "moveHero", + "steps": [ + "right:1" + ] + }, + "\t[原始人]\b[down,hero]这东西会说话?", + "\t[智慧结晶]\b[down,4,4]对呀对呀。", + "\t[智慧结晶]\b[down,4,4]我叫智慧结晶,是专门来帮助你的。", + "\t[原始人]\b[down,hero]帮助我?你这样怎么帮助我?", + "\t[智慧结晶]\b[down,4,4]别着急,我先给你说一下我的来历。", + "\t[智慧结晶]\b[down,4,4]未来的人类想要拯救他们自己的世界,但是无能为力,只好向历史出手。", + "\t[智慧结晶]\b[down,4,4]于是他们便通过一些方法将我们传送到了这里,让我们来帮助你们。", + "\t[智慧结晶]\b[down,4,4]这样历史便会改写,他们才有可能成功。", + "\t[原始人]\b[down,hero]那你怎么帮助我呢?", + "\t[智慧结晶]\b[down,4,4]很简单,我有很多智慧,你只需要把我放到手里,我就会消失。", + "\t[智慧结晶]\b[down,4,4]我的智慧也会传递给你,你也就能变强了。", + "\t[原始人]\b[down,hero]智慧?智慧有什么用?", + "\t[智慧结晶]\b[down,hero]之后你就会知道的。", { "type": "function", - "function": "function(){\ncore.displayChapter(1);\n}" + "function": "function(){\ncore.getNextItem();\n}" + }, + { + "type": "sleep", + "time": 300 + }, + "智慧涌入了原始人的大脑", + "\t[原始人]\b[down,hero]这种感觉...", + "\t[原始人]\b[down,hero]感觉好像可以学习一些简单的东西了。", + { + "type": "function", + "function": "function(){\ncore.showChapter('第一章 勇气');\n}" }, { "type": "setValue", @@ -54,11 +79,6 @@ main.floors.MT6= "type": "setValue", "name": "item:cross", "value": "1" - }, - { - "type": "sleep", - "time": 3000, - "noSkip": true } ], "eachArrive": [], diff --git a/public/project/items.js b/public/project/items.js index 8cf8845..6602d7b 100644 --- a/public/project/items.js +++ b/public/project/items.js @@ -343,7 +343,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cross": { "cls": "constants", "name": "查看技能", - "text": "技能查看器", + "text": "查看勇士的技能", "canUseItemEffect": true, "useItemEffect": "core.openSkills();" }, diff --git a/public/project/plugins.js b/public/project/plugins.js index 62f1adf..da3bb44 100644 --- a/public/project/plugins.js +++ b/public/project/plugins.js @@ -5988,19 +5988,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = { * @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}`); - } - }); + const css = document.getElementById('mota-css'); + css.remove(); + const link = document.createElement('link'); + link.rel = 'stylesheet'; + link.type = 'text/css'; + link.href = data; + link.id = 'mota-css'; + document.head.appendChild(link); + console.log(`css hot reload: ${data}`); } /** @@ -6262,6 +6258,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = { }; this.showChapter = function (chapter) { + if (main.replayChecking) return; core.plugin.chapterContent.value = chapter; core.plugin.chapterShowed.value = true; }; @@ -6319,14 +6316,32 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = { for (const id in remain) { const name = core.material.enemys[id].name; now.push(`${title}(${floor}): ${name} * ${remain[id]}`); - if (now.length === 20) { + if (now.length === 10) { str.push(now.join('\n')); now = []; } } } - if (now.length > 0) str.push(now.join('\n')); + if (now.length > 0) { + str.push(now.join('\n')); + str[0] = `当前剩余怪物:\n${str[0]}`; + } + return str; }; + }, + replay: function () { + const replayableSettings = ['autoSkill']; + + // 注册修改设置的录像操作 + core.registerReplayAction('settings', name => { + if (!name.startsWith('set:')) return false; + const [, setting, value] = name.split(':'); + const v = eval(value); + if (typeof v !== 'boolean') return false; + if (!replayableSettings.includes(setting)) return false; + flags[setting] = v; + return true; + }); } }; diff --git a/public/styles.css b/public/styles.css index 8b55efb..278e7e7 100644 --- a/public/styles.css +++ b/public/styles.css @@ -109,7 +109,6 @@ body { } #startLogo { - user-select: none; position: absolute; z-index: 290; left: 0; @@ -118,21 +117,37 @@ body { margin-right: auto; margin-top: 8%; max-width: 100%; + color: transparent; text-align: center; - font: bold 4em STXingkai; + font: 4em 'normal'; + font-weight: 200; + background-image: linear-gradient( + to right, + rgb(0, 0, 0), + rgb(44, 44, 44), + rgb(136, 0, 214), + rgb(0, 2, 97), + rgb(0, 2, 97) + ); + background-clip: text; + -webkit-background-clip: text; + text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5), + -1px -1px 3px rgba(255, 255, 255, 0.3), 5px 5px 5px rgba(0, 0, 0, 0.4); + filter: brightness(1.8); + user-select: none; } #startTitle { - user-select: none; position: absolute; z-index: 280; } #startButtonGroup { - width: auto; + width: 33%; position: absolute; text-align: center; font-size: 1.4em; + font-family: 'normal'; display: none; z-index: 310; bottom: 0; @@ -140,14 +155,50 @@ body { left: 50%; transform: translateX(-50%); padding: 15px 25px; - min-width: 20%; /* default value */ - background-color: #32369f; - opacity: 0.85; - color: #ffffff; - border: #ffffff 2px solid; + background-image: linear-gradient( + to bottom, + rgba(76, 73, 255, 0.7), + rgba(106, 40, 145, 0.7) + ); + border: #ffffff 1px solid; caret-color: #ffd700; border-radius: 10px; + text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4), + 0px 0px 1px rgba(255, 255, 255, 0.3); +} + +#playGame { + color: transparent; + background-image: linear-gradient( + to bottom, + rgb(255, 255, 255), + rgb(0, 255, 255) + ); + background-clip: text; + -webkit-background-clip: text; +} + +#loadGame { + color: transparent; + background-image: linear-gradient( + to bottom, + rgb(255, 255, 255), + rgb(0, 255, 55) + ); + background-clip: text; + -webkit-background-clip: text; +} + +#replayGame { + color: transparent; + background-image: linear-gradient( + to bottom, + rgb(255, 255, 255), + rgb(255, 251, 0) + ); + background-clip: text; + -webkit-background-clip: text; } #startButtons { @@ -158,17 +209,45 @@ body { display: none; } +#easy { + background-image: linear-gradient( + to bottom, + rgb(255, 255, 255), + rgb(87, 255, 72) + ); +} + +span#hard { + background-image: linear-gradient( + to bottom, + rgb(255, 255, 255), + rgb(255, 0, 0) + ); +} + +#levelChooseButtons span { + color: transparent; + background-clip: text; + -webkit-background-clip: text; +} + .startButton { width: 100%; margin: 0; font-weight: bold; display: block; cursor: pointer; - padding: 4px 0; border-color: transparent; border-width: 2px; border-style: solid; border-radius: 6px; + transition: box-shadow 0.3s linear, transform 0.3s linear; + box-shadow: 0px 0px 7px rgba(0, 0, 0, 0.4); + transform: scale(1); +} + +.startButton:hover { + transform: scale(1.2); } .onChoiceAnimate { diff --git a/src/components/box.vue b/src/components/box.vue index 367f485..95d42d9 100644 --- a/src/components/box.vue +++ b/src/components/box.vue @@ -133,14 +133,16 @@ function bottomDrag(x: number, y: number) { } function resize() { - move = document.getElementById(`box-move-${id}`) as HTMLDivElement; main = document.getElementById(`box-${id}`) as HTMLDivElement; + move = document.getElementById(`box-move-${id}`) as HTMLDivElement; leftB = document.getElementById(`border-left-${id}`) as HTMLDivElement; topB = document.getElementById(`border-top-${id}`) as HTMLDivElement; rightB = document.getElementById(`border-right-${id}`) as HTMLDivElement; bottomB = document.getElementById(`border-bottom-${id}`) as HTMLDivElement; drag = document.getElementById(`box-drag-${id}`) as HTMLElement; + if (!main) return; + if (has(props.left)) left.value = props.left; if (has(props.top)) top.value = props.top; if (has(props.width)) width.value = props.width; @@ -158,6 +160,8 @@ onMounted(async () => { await sleep(50); resize(); + if (!main) return; + useDrag( drag, dragFn, diff --git a/src/components/enemyOne.vue b/src/components/enemyOne.vue index 1d411cf..5123a56 100644 --- a/src/components/enemyOne.vue +++ b/src/components/enemyOne.vue @@ -69,14 +69,13 @@ >