From a0cbb8cdb844ceec08acd6c43728c089aba5cf22 Mon Sep 17 00:00:00 2001 From: strawberry42271 <2806566736@qq.com> Date: Wed, 5 Feb 2025 22:38:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=98=E7=AE=97=E6=B3=95=E6=8A=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/data.js | 7 +- project/functions.js | 2 +- project/items.js | 18 +- project/plugins.js | 2394 +++++++++++++++++++++--------------------- 4 files changed, 1199 insertions(+), 1222 deletions(-) diff --git a/project/data.js b/project/data.js index cf5aaac..d049221 100644 --- a/project/data.js +++ b/project/data.js @@ -1118,7 +1118,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "mana": 0, "atk": 100, "def": 100, - "mdef": 0, + "mdef": 100, "speed": 10, "money": 0, "exp": 0, @@ -1135,7 +1135,8 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = }, "flags": { "itemDetail": true, - "useBetweenLight": true + "useBetweenLight": true, + "__mdef_buff__": 0 }, "followers": [], "steps": 0, @@ -1499,7 +1500,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "startText": [ { "type": "function", - "function": "function(){\ncore.getItem('book',1);core.getItem('fly',1)\n}" + "function": "function(){\ncore.getItem('book', 1);\ncore.getItem('fly', 1);\n}" }, { "type": "insert", diff --git a/project/functions.js b/project/functions.js index 949d962..5e413e0 100644 --- a/project/functions.js +++ b/project/functions.js @@ -1466,7 +1466,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = spell: "法强", matk: "魔攻比例", mhp: "护盾比例", - mdef: "法抗比例", + mdef: "法抗", speed: "速度", money: "金币", exp: "经验", diff --git a/project/items.js b/project/items.js index 761cb9f..52cff8d 100644 --- a/project/items.js +++ b/project/items.js @@ -150,10 +150,10 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "equip": { "type": 0, "animate": "sword", - "value": { + "value": {}, + "percentage": { "mdef": 10 - }, - "percentage": {} + } }, "itemEffect": "core.status.hero.atk += 10", "itemEffectTip": ",攻击+10", @@ -166,10 +166,10 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "equip": { "type": "武器", "animate": "sword", - "value": { + "value": {}, + "percentage": { "mdef": 20 - }, - "percentage": {} + } }, "itemEffect": "core.status.hero.atk += 20", "itemEffectTip": ",攻击+20", @@ -247,10 +247,10 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "text": "一个很普通的铁盾", "equip": { "type": 1, - "value": { + "value": {}, + "percentage": { "mdef": 10 - }, - "percentage": {} + } }, "itemEffect": "core.status.hero.def += 10", "itemEffectTip": ",防御+10", diff --git a/project/plugins.js b/project/plugins.js index 5f9ffbe..8aad116 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -5617,6 +5617,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = var compare2; if (item.equipCls === "双手剑") compare2 = core.compareEquipment(null, core.getEquip(1)); + if (item.equipCls === "盾牌" && core.material.items[core.getEquip(0)].equipCls === "双手剑") + compare2 = core.compareEquipment(null, core.getEquip(0)); if (info.select.action == "unload") compare = core.compareEquipment(null, item.id); // --- 变化值... @@ -5633,22 +5635,27 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = (compare2?.percentage[name] || 0))) / 100 ); - /*if (name === 'mdef') { - nowValue = core.getRealStatus(name) + '%' - newValue = Math.floor( - ((core.getStatus(name) + - ((compare.value[name] || 0) + - (compare2?.value[name] || 0) - 2) * 100) * - (core.getBuff(name) * 100 + - (compare.percentage[name] || 0) + - (compare2?.percentage[name] || 0))) / - 100 - ) + '%'; - }*/ + if (name === "mdef") { + var nowValue = core.getRealStatus(name); + var newValue = Math.round( + (core.getStatus(name) - + (compare.value[name] || 0) - + (compare2?.value[name] || 0)) * + (1 - (1 - core.getBuff(name)) * + ((compare.percentage[name] || 1)) * + ((compare2?.percentage[name] || 1))) + + ); + + } if (nowValue == newValue) continue; var color = newValue > nowValue ? "#00FF00" : "#FF0000"; nowValue = core.formatBigNumber(nowValue); newValue = core.formatBigNumber(newValue); + if (name === "mdef") { + nowValue += '%'; + newValue += '%' + } statusText += core.getStatusLabel(name) + " " + @@ -6225,7 +6232,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.loadEquip(id, function () { core.status.route.push("equip:" + id); info.select.type = type; - //core.setIndexAndSelect("select"); + core.setIndexAndSelect("select"); core.drawEquipbox(); }); } else { @@ -6233,8 +6240,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.unloadEquip(type, function () { core.status.route.push("unEquip:" + type); info.select.type = type; - //info.select.action = 'load' - //core.setIndexAndSelect("select"); + info.select.action = 'load' + core.setIndexAndSelect("select"); core.drawEquipbox(); }); } @@ -6247,7 +6254,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.setPageItems(info.page); var index = info.index || 1; var items = info.pageItems; - if (info.select.type != null) { + /*if (info.select.type != null) { var type = info.select.type; id = core.getEquip(type); info.index = null; @@ -6257,12 +6264,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = type: type, }; return; - } else { - info.select.action = null; - info.select.type = null; - if (toChange == "index") info.index = items.indexOf(info.select.id) + 1; - info.select.id = items[info.index - 1]; - } + } else {*/ + info.select.action = null; + info.select.type = null; + if (toChange == "index") info.index = items.indexOf(info.select.id) + 1; + info.select.id = items[info.index - 1]; + //} }; this.addItemListboxPage = function (num) { @@ -10831,21 +10838,21 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }; }, "自定义常用事件": function () { - // editorBlocklyconfigPlus.js - // 自訂常見事件模板插件 - // 本插件引用了通用函數插件(Utility.js) - // 適用樣板:2.10.3 - // 請注意: - // 此插件對事件編輯器(editor_blocklyconfig)進行複寫,若還有其它針對事件編輯器做複寫的插件,請謹慎使用! - // 此插件對表格操作行為(editor_mode.doActionList)進行複寫,若還有其它對表格操作行為做複寫的插件,請謹慎使用! - // 使用方法: - // 現在在主頁下拉選單多了個常用事件模版,在那邊可以自由設定常用事件模板。 - // 設定完後按F5刷新,再到事件編輯器看就有你設定好的常用事件模板了。 + // editorBlocklyconfigPlus.js + // 自訂常見事件模板插件 + // 本插件引用了通用函數插件(Utility.js) + // 適用樣板:2.10.3 + // 請注意: + // 此插件對事件編輯器(editor_blocklyconfig)進行複寫,若還有其它針對事件編輯器做複寫的插件,請謹慎使用! + // 此插件對表格操作行為(editor_mode.doActionList)進行複寫,若還有其它對表格操作行為做複寫的插件,請謹慎使用! + // 使用方法: + // 現在在主頁下拉選單多了個常用事件模版,在那邊可以自由設定常用事件模板。 + // 設定完後按F5刷新,再到事件編輯器看就有你設定好的常用事件模板了。 - if (main.mode == "editor") { - //#region 配置表格初始化 - let TableFileName = "project/table/CommonEventTemplate_comment.js"; - let TableRow = ` + if (main.mode == "editor") { + //#region 配置表格初始化 + let TableFileName = "project/table/CommonEventTemplate_comment.js"; + let TableRow = ` var CommonEventTemplate_comment = {"_type": "object", "_data": { "CommonEventTemplate": { @@ -10888,241 +10895,221 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } }} `; - if (!events_c12a15a8_c380_4b28_8144_256cba95f760.CommonEventTemplate) { - /** - * @type {{[EvnetName:actionParserJson]}} - */ - events_c12a15a8_c380_4b28_8144_256cba95f760.CommonEventTemplate = { - 检测音乐如果没有开启则系统提示开启: [ - { - type: "if", - condition: "!core.musicStatus.bgmStatus", - true: [ - "\t[系统提示]你当前音乐处于关闭状态,本塔开音乐游戏效果更佳", - ], - false: [], - }, - ], - 仿新新魔塔一次性商人: [ - { - type: "if", - condition: "switch:A", - true: [ - "\t[行商,trader]\b[this]这是购买我的道具后我给玩家的提示。", - { - type: "comment", - text: "下一条指令可视情况使用或不使用", - }, - { - type: "hide", - remove: true, - time: 250, - }, - ], - false: [ - { - type: "confirm", - text: "我有3把黄钥匙,\n你出50金币就卖给你。", - yes: [ - { - type: "if", - condition: "status:money>=50", - true: [ - { - type: "setValue", - name: "status:money", - operator: "-=", - value: "50", - }, - { - type: "setValue", - name: "item:yellowKey", - operator: "+=", - value: "3", - }, - { - type: "playSound", - name: "确定", - stop: true, - }, - { - type: "setValue", - name: "switch:A", - value: "true", - }, - ], - false: [ - { - type: "playSound", - name: "操作失败", - }, - "\t[行商,trader]\b[this]你的金币不足!", - ], - }, - ], - no: [], - }, - ], - }, - ], - 全地图选中一个点: [ - { - type: "comment", - text: "全地图选中一个点,需要用鼠标或触屏操作", - }, - { - type: "setValue", - name: "temp:X", - value: "status:x", - }, - { - type: "setValue", - name: "temp:Y", - value: "status:y", - }, - { - type: "tip", - text: "再次点击闪烁位置确认", - }, - { - type: "while", - condition: "true", - data: [ - { - type: "drawSelector", - image: "winskin.webp", - code: 1, - x: "32*temp:X", - y: "32*temp:Y", - width: 32, - height: 32, - }, - { - type: "wait", - }, - { - type: "if", - condition: "(flag:type === 1)", - true: [ - { - type: "if", - condition: "((temp:X===flag:x)&&(temp:Y===flag:y))", - true: [ - { - type: "break", - n: 1, - }, - ], - }, - { - type: "setValue", - name: "temp:X", - value: "flag:x", - }, - { - type: "setValue", - name: "temp:Y", - value: "flag:y", - }, - ], - }, - ], - }, - { - type: "drawSelector", - code: 1, - }, - { - type: "comment", - text: "流程进行到这里可以对[X,Y]点进行处理,比如", - }, - { - type: "closeDoor", - id: "yellowDoor", - loc: ["temp:X", "temp:Y"], - }, - ], - 多阶段Boss战斗: [ - { - type: "comment", - text: "多阶段boss,请直接作为战后事件使用", - }, - { - type: "setValue", - name: "switch:A", - operator: "+=", - value: "1", - }, - { - type: "switch", - condition: "switch:A", - caseList: [ - { - case: "1", - action: [ - { - type: "setBlock", - number: "redSlime", - }, - "\t[2阶段boss,redSlime]\b[this]你以为你已经打败我了吗?没听说过史莱姆有九条命吗?", - ], - }, - { - case: "2", - action: [ - { - type: "setBlock", - number: "blackSlime", - }, - "\t[3阶段boss,blackSlime]\b[this]不能消灭我的,只会让我更强大!", - ], - }, - { - case: "3", - action: [ - { - type: "setBlock", - number: "slimelord", - }, - "\t[4阶段boss,slimelord]\b[this]我还能打!", - ], - }, - { - case: "4", - action: ["\t[4阶段boss,slimelord]我一定会回来的!"], - }, - ], - }, - ], - }; - } - //#endregion + if (!events_c12a15a8_c380_4b28_8144_256cba95f760.CommonEventTemplate) { + /** + * @type {{[EvnetName:actionParserJson]}} + */ + events_c12a15a8_c380_4b28_8144_256cba95f760.CommonEventTemplate = { + 检测音乐如果没有开启则系统提示开启: [{ + type: "if", + condition: "!core.musicStatus.bgmStatus", + true: [ + "\t[系统提示]你当前音乐处于关闭状态,本塔开音乐游戏效果更佳", + ], + false: [], + }, ], + 仿新新魔塔一次性商人: [{ + type: "if", + condition: "switch:A", + true: [ + "\t[行商,trader]\b[this]这是购买我的道具后我给玩家的提示。", + { + type: "comment", + text: "下一条指令可视情况使用或不使用", + }, + { + type: "hide", + remove: true, + time: 250, + }, + ], + false: [{ + type: "confirm", + text: "我有3把黄钥匙,\n你出50金币就卖给你。", + yes: [{ + type: "if", + condition: "status:money>=50", + true: [{ + type: "setValue", + name: "status:money", + operator: "-=", + value: "50", + }, + { + type: "setValue", + name: "item:yellowKey", + operator: "+=", + value: "3", + }, + { + type: "playSound", + name: "确定", + stop: true, + }, + { + type: "setValue", + name: "switch:A", + value: "true", + }, + ], + false: [{ + type: "playSound", + name: "操作失败", + }, + "\t[行商,trader]\b[this]你的金币不足!", + ], + }, ], + no: [], + }, ], + }, ], + 全地图选中一个点: [{ + type: "comment", + text: "全地图选中一个点,需要用鼠标或触屏操作", + }, + { + type: "setValue", + name: "temp:X", + value: "status:x", + }, + { + type: "setValue", + name: "temp:Y", + value: "status:y", + }, + { + type: "tip", + text: "再次点击闪烁位置确认", + }, + { + type: "while", + condition: "true", + data: [{ + type: "drawSelector", + image: "winskin.webp", + code: 1, + x: "32*temp:X", + y: "32*temp:Y", + width: 32, + height: 32, + }, + { + type: "wait", + }, + { + type: "if", + condition: "(flag:type === 1)", + true: [{ + type: "if", + condition: "((temp:X===flag:x)&&(temp:Y===flag:y))", + true: [{ + type: "break", + n: 1, + }, ], + }, + { + type: "setValue", + name: "temp:X", + value: "flag:x", + }, + { + type: "setValue", + name: "temp:Y", + value: "flag:y", + }, + ], + }, + ], + }, + { + type: "drawSelector", + code: 1, + }, + { + type: "comment", + text: "流程进行到这里可以对[X,Y]点进行处理,比如", + }, + { + type: "closeDoor", + id: "yellowDoor", + loc: ["temp:X", "temp:Y"], + }, + ], + 多阶段Boss战斗: [{ + type: "comment", + text: "多阶段boss,请直接作为战后事件使用", + }, + { + type: "setValue", + name: "switch:A", + operator: "+=", + value: "1", + }, + { + type: "switch", + condition: "switch:A", + caseList: [{ + case: "1", + action: [{ + type: "setBlock", + number: "redSlime", + }, + "\t[2阶段boss,redSlime]\b[this]你以为你已经打败我了吗?没听说过史莱姆有九条命吗?", + ], + }, + { + case: "2", + action: [{ + type: "setBlock", + number: "blackSlime", + }, + "\t[3阶段boss,blackSlime]\b[this]不能消灭我的,只会让我更强大!", + ], + }, + { + case: "3", + action: [{ + type: "setBlock", + number: "slimelord", + }, + "\t[4阶段boss,slimelord]\b[this]我还能打!", + ], + }, + { + case: "4", + action: ["\t[4阶段boss,slimelord]我一定会回来的!"], + }, + ], + }, + ], + }; + } + //#endregion - // 新增模板選項 - let editModeSelect = document.getElementById("editModeSelect"); - let newEditModeOption = document.createElement("option"); - newEditModeOption.value = "CommonEventTemplate"; - newEditModeOption.text = "常見事件模板"; - editModeSelect.add(newEditModeOption); + // 新增模板選項 + let editModeSelect = document.getElementById("editModeSelect"); + let newEditModeOption = document.createElement("option"); + newEditModeOption.value = "CommonEventTemplate"; + newEditModeOption.text = "常見事件模板"; + editModeSelect.add(newEditModeOption); - //檢查可用的編輯模板ID - let leftIDNumber = 11 - 1; - let ExistLeftElement = document.querySelector(".main"); - while (ExistLeftElement) { - leftIDNumber++; - ExistLeftElement = document.getElementById(`left${leftIDNumber}`); - } + //檢查可用的編輯模板ID + let leftIDNumber = 11 - 1; + let ExistLeftElement = document.querySelector(".main"); + while (ExistLeftElement) { + leftIDNumber++; + ExistLeftElement = document.getElementById(`left${leftIDNumber}`); + } - //新增編輯模板 - let MainDiv = document.querySelector(".main"); + //新增編輯模板 + let MainDiv = document.querySelector(".main"); - let CommonEventTemplateMainDiv = document.createElement("div"); - CommonEventTemplateMainDiv.id = `left${leftIDNumber}`; - CommonEventTemplateMainDiv.className = "leftTab"; - CommonEventTemplateMainDiv.style.zIndex = "-1"; - CommonEventTemplateMainDiv.style.opacity = "0"; + let CommonEventTemplateMainDiv = document.createElement("div"); + CommonEventTemplateMainDiv.id = `left${leftIDNumber}`; + CommonEventTemplateMainDiv.className = "leftTab"; + CommonEventTemplateMainDiv.style.zIndex = "-1"; + CommonEventTemplateMainDiv.style.opacity = "0"; - CommonEventTemplateMainDiv.innerHTML = ` + CommonEventTemplateMainDiv.innerHTML = `