From dcb4d220eb0b3b4019e4340a4fcfb8e47bf8c21b Mon Sep 17 00:00:00 2001 From: ShakeFlower Date: Wed, 19 Mar 2025 21:11:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4=E8=A3=85=E5=A4=87?= =?UTF-8?q?=E5=92=8C=E9=81=93=E5=85=B7=E7=9A=84=E5=B1=9E=E6=80=A7=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _server/MotaActionParser.js | 10 +++++----- project/items.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/_server/MotaActionParser.js b/_server/MotaActionParser.js index c7a816ea..ce01e5bd 100644 --- a/_server/MotaActionParser.js +++ b/_server/MotaActionParser.js @@ -69,12 +69,12 @@ ActionParser.prototype.parse = function (obj,type) { return MotaActionBlocks['floorPartition_m'].xmlText([text_choices]); case 'equip': - if(!obj) obj={}; + if (!obj) obj = {}; var buildEquip = function (obj) { obj = obj || {}; var text_choices = null; - var knownEquipListKeys = MotaActionBlocks['Equip_List'].options.map(function (one) {return one[1];}) - Object.keys(obj).sort().forEach(function (key) { + var knownEquipListKeys = MotaActionBlocks['Equip_List'].options.map(function (one) { return one[1]; }) + Object.keys(obj).sort((a, b) => b.localeCompare(a)).forEach(function (key) { var one = knownEquipListKeys.indexOf(key) >= 0 ? 'equipKnown' : 'equipUnknown'; text_choices = MotaActionBlocks[one].xmlText([ key, obj[key], text_choices @@ -83,7 +83,7 @@ ActionParser.prototype.parse = function (obj,type) { return text_choices; } return MotaActionBlocks['equip_m'].xmlText([obj.type, obj.animate, buildEquip(obj.value), buildEquip(obj.percentage), - this.parseList(obj.equipEvent), this.parseList(obj.unequipEvent)]); + this.parseList(obj.equipEvent), this.parseList(obj.unequipEvent)]); case 'itemEffect': if (!obj) obj = {}; @@ -91,7 +91,7 @@ ActionParser.prototype.parse = function (obj,type) { obj = obj || {}; var text_choices = null; var knownItemListKeys = MotaActionBlocks['ItemEffect_List'].options.map(function (one) { return one[1]; }) - Object.keys(obj).sort().forEach(function (key) { + Object.keys(obj).sort((a, b) => b.localeCompare(a)).forEach(function (key) { var addValue = obj[key]; var noNeed = key.endsWith(':o'); if (noNeed) key = key.substring(0, key.length - 2); diff --git a/project/items.js b/project/items.js index cd88243e..e73265da 100644 --- a/project/items.js +++ b/project/items.js @@ -113,9 +113,9 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "itemEffectEvent": { "sound": "gem.mp3", "value": { - "mdef:o": "core.values.greenGem", + "atk:o": "core.values.redGem", "def:o": "core.values.blueGem", - "atk:o": "core.values.redGem" + "mdef:o": "core.values.greenGem" } } },