From 763ff0f3e7085e33f669c9e4760d00883468ec9e Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Tue, 30 Apr 2024 21:01:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=BB=84=E8=93=9D=E9=97=A8=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/_server/editor_multi.js | 16 ++-- public/project/enemys.js | 2 +- public/project/floors/MT50.js | 3 +- public/project/floors/MT51.js | 2 +- public/project/floors/MT52.js | 7 ++ public/project/floors/MT53.js | 35 +++++--- public/project/floors/MT54.js | 128 +++++++++++++++++++--------- public/project/floors/MT55.js | 110 +++++++++++++++--------- public/project/items.js | 60 ++++++------- src/core/fx/shadow.ts | 13 +-- src/core/main/init/hotkey.ts | 8 ++ src/game/index.ts | 4 + src/game/mechanism/misc.ts | 78 +++++++++++++++++ src/game/system.ts | 7 +- src/plugin/game/enemy/checkblock.ts | 3 +- 15 files changed, 332 insertions(+), 144 deletions(-) create mode 100644 src/game/mechanism/misc.ts diff --git a/public/_server/editor_multi.js b/public/_server/editor_multi.js index daaf274..c286d40 100644 --- a/public/_server/editor_multi.js +++ b/public/_server/editor_multi.js @@ -291,10 +291,10 @@ editor_multi = function () { _previewButton.onclick = function () { if (!editor_multi.preview) return; _format(); - if (editor_multi.hasError()) { - alert("当前好像存在严重的语法错误,请处理后再预览。"); - return; - } + // if (editor_multi.hasError()) { + // alert("当前好像存在严重的语法错误,请处理后再预览。"); + // return; + // } editor.uievent.previewEditorMulti(editor_multi.preview, codeEditor.getValue()); } @@ -350,10 +350,10 @@ editor_multi = function () { } editor_multi.confirm = function (keep) { - if (editor_multi.hasError()) { - alert("当前好像存在严重的语法错误,请处理后再保存。\n严重的语法错误可能会导致整个编辑器的崩溃。"); - return; - } + // if (editor_multi.hasError()) { + // alert("当前好像存在严重的语法错误,请处理后再保存。\n严重的语法错误可能会导致整个编辑器的崩溃。"); + // return; + // } if (!editor_multi.id) { editor_multi.id = ''; diff --git a/public/project/enemys.js b/public/project/enemys.js index 36d81e0..8a9c1b3 100644 --- a/public/project/enemys.js +++ b/public/project/enemys.js @@ -173,7 +173,7 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 = "E646": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "E647": {"name":"苍蓝之灵-虚","hp":30000,"atk":5000,"def":3000,"money":10,"exp":2500,"point":0,"special":[28],"paleShield":10}, "E656": {"name":"触手史莱姆","hp":12500,"atk":5000,"def":2500,"money":4,"exp":200,"point":0,"special":[8],"together":25}, - "E657": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "E657": {"name":"触手法师","hp":50000,"atk":2000,"def":3000,"money":5,"exp":300,"point":0,"special":[8,13],"crit":null,"together":25}, "E658": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "E659": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]} } \ No newline at end of file diff --git a/public/project/floors/MT50.js b/public/project/floors/MT50.js index c63de40..3f4465e 100644 --- a/public/project/floors/MT50.js +++ b/public/project/floors/MT50.js @@ -31,7 +31,8 @@ main.floors.MT50= "欢迎来到苍蓝之殿,这是本塔第二章里面最大的一个区,也是最复杂的一个区。整个苍蓝之殿分为无个部分:左下角、右下角、左上角、右上角和中心,每个部分都有不一样的玩法,多多动脑哦。" ], "9,13": [ - "在你刚进入苍蓝之殿时,你只能先前往左下角部分(本地图的左面),右下角暂时不能前往。注意往上走往左依然可以进入左下角,不要只盯着这个地图的左边不放。" + "在你刚进入苍蓝之殿时,你只能先前往左下角部分(本地图的左面),右下角暂时不能前往。注意往上走往左依然可以进入左下角,不要只盯着这个地图的左边不放。", + "注意火炬可通行,而且跳跃时会跳过火炬,不会跳到火炬上" ], "9,1": [ "建议优先点出学习技能,对于特定场景将会非常有帮助", diff --git a/public/project/floors/MT51.js b/public/project/floors/MT51.js index 698599f..d797263 100644 --- a/public/project/floors/MT51.js +++ b/public/project/floors/MT51.js @@ -92,7 +92,7 @@ main.floors.MT51= [648,648,648,648,648, 0,648,648,648, 33,648,648,648,578,648], [648,594, 33,381,648,539, 34,492, 0,243,648,376,403,378,648], [648, 33,648,492,648, 0,648,648,648, 0,648, 33, 21, 33,648], - [648, 27,648, 0, 34, 0,219, 0, 34, 0,648,648,494,648,648], + [648, 27,648, 0, 34, 0,219, 0,103, 0,648,648,494,648,648], [648,243,648,656,648,648, 0,648, 0,648,648, 27, 0, 0, 94], [ 92, 0, 34, 0, 27,492, 34,648, 0, 0,539, 0,381, 0,648], [648,648,648,648,648,648, 0,648,656,648,648,648,648,648,648], diff --git a/public/project/floors/MT52.js b/public/project/floors/MT52.js index 3d6c08d..b7cff35 100644 --- a/public/project/floors/MT52.js +++ b/public/project/floors/MT52.js @@ -24,6 +24,13 @@ main.floors.MT52= 0, 8 ] + }, + "4,0": { + "floorId": "MT54", + "loc": [ + 4, + 14 + ] } }, "beforeBattle": {}, diff --git a/public/project/floors/MT53.js b/public/project/floors/MT53.js index dd6c20d..653932b 100644 --- a/public/project/floors/MT53.js +++ b/public/project/floors/MT53.js @@ -24,6 +24,13 @@ main.floors.MT53= 7, 0 ] + }, + "0,7": { + "floorId": "MT54", + "loc": [ + 14, + 7 + ] } }, "beforeBattle": {}, @@ -34,20 +41,20 @@ main.floors.MT53= "cannotMove": {}, "cannotMoveIn": {}, "map": [ - [648,648,648,648,648,648,648,648,648,648,648,648,648,648,648], - [648,656, 0,219,648, 0, 0, 0,243, 0, 0,492,482,482,648], - [648, 0,648, 0,648,648,648,578,648,648,656,648,648,648,648], - [648, 0,648, 0,648, 0, 0, 0,648, 0, 0,648, 0, 0,648], - [648, 0,648,563,492, 0, 0, 0,648, 0, 0,240, 0, 0,648], - [648, 0,648,648,648,648,494,648,648,219,648,648,648,648,648], - [648, 0,578, 0,648,403, 0,484,648, 0, 0,648, 0, 0,648], - [ 92, 0,648, 0,648, 0, 21, 0,648, 0, 0,220, 0, 0, 94], - [648,648,648, 0,648,376, 0,378,648, 0, 0,648, 0, 0,648], - [648, 0,648, 0,648,648,249,648,648,219,648,648,648,648,648], - [648, 0,648, 0, 0,596, 0, 0,648, 0, 0,539, 0, 0,648], - [648, 0,243, 0, 0,648, 0, 0,648, 0, 0,648, 0, 0,648], - [648,601,648,648,648,648,243,648,648,648,539,648, 0, 0,648], - [648, 0, 0, 0, 0,648, 0, 0, 0, 0, 0,656, 0, 0,648], + [648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648], + [648,656, 34,219,648, 0,482, 0,243, 29, 33,492,482,482,648], + [648, 0,648,381,648,648,648,578,648,648,656,648,648,648,648], + [648, 0,648,482,648, 27,484, 28,648,381, 0,648,376,403,648], + [648, 0,648,563,492, 0,381, 0,648, 0, 34,240,484,378,648], + [648,484,648,648,648,648,494,648,648,219,648,648,648,648,648], + [648, 0,578, 0,648,403, 0,484,648, 0, 33,648, 33, 0,648], + [ 92, 0,648,482,648, 0, 21, 0,648,103, 0,220, 0, 0, 94], + [648,492,648, 0,648,376, 0,378,648, 0, 33,648, 33, 0,648], + [648,381,648,381,648,648,249,648,648,219,648,648,648,492,648], + [648,482,648, 0, 0,596, 33, 0,492, 0, 0,539, 27, 0,648], + [648, 0,243,378, 0,648, 0,103,648, 33, 0,648, 0, 28,648], + [648,601,648,492,648,648,243,648,648,648,539,648, 29, 0,648], + [648, 28, 0, 0, 27,648, 0, 0, 34, 0, 0,656, 0,482,648], [648,648,648,648,648,648,648, 93,648,648,648,648,648,648,648] ], "bgmap": [ diff --git a/public/project/floors/MT54.js b/public/project/floors/MT54.js index e94194a..38f01cd 100644 --- a/public/project/floors/MT54.js +++ b/public/project/floors/MT54.js @@ -1,45 +1,91 @@ main.floors.MT54= { -"floorId": "MT54", -"title": "苍蓝之殿-左下", -"name": "54", -"width": 15, -"height": 15, -"canFlyTo": true, -"canFlyFrom": true, -"canUseQuickShop": true, -"cannotViewMap": false, -"images": [], -"ratio": 8, -"defaultGround": "T650", -"bgm": "palaceSouth.mp3", -"firstArrive": [], -"eachArrive": [], -"parallelDo": "", -"events": {}, -"changeFloor": {}, -"beforeBattle": {}, -"afterBattle": {}, -"afterGetItem": {}, -"afterOpenDoor": {}, -"autoEvent": {}, -"cannotMove": {}, -"cannotMoveIn": {}, -"map": [ - [ 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, 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, 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, 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, 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, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + "floorId": "MT54", + "title": "苍蓝之殿-左下", + "name": "54", + "width": 15, + "height": 15, + "canFlyTo": true, + "canFlyFrom": true, + "canUseQuickShop": true, + "cannotViewMap": false, + "images": [], + "ratio": 8, + "defaultGround": "T650", + "bgm": "palaceSouth.mp3", + "firstArrive": [], + "eachArrive": [], + "parallelDo": "", + "events": { + "9,13": [ + "注意,对于同时拥有二连击、三连击等连击属性时,各连击之间为乘算叠加", + "那个开关一定要试着去触发一下" + ], + "7,9": [ + { + "type": "function", + "async": true, + "function": "function(){\nMota.require('module', 'Mechanism').BluePalace.doorConvert(7, 9);\n}" + } + ] + }, + "changeFloor": { + "14,7": { + "floorId": "MT53", + "loc": [ + 0, + 7 + ] + }, + "4,14": { + "floorId": "MT52", + "loc": [ + 4, + 0 + ] + }, + "0,7": { + "floorId": "MT55", + "loc": [ + 14, + 7 + ] + } + }, + "beforeBattle": {}, + "afterBattle": {}, + "afterGetItem": {}, + "afterOpenDoor": {}, + "autoEvent": {}, + "cannotMove": {}, + "cannotMoveIn": {}, + "map": [ + [648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648], + [648, 28, 33,648, 0, 27,648, 0, 0,656, 0,482, 0, 0,648], + [648, 33, 27,601, 29, 0,563, 0, 0,648,648,648,648,539,648], + [648,648,492,648,648,220,648,648,648,648,487,441,492, 0,648], + [648, 0,482, 0,219, 0,103,656, 0,648,594,648,648,578,648], + [648, 29, 0, 29,648,378, 0,648,381,494,376,240,378,491,648], + [648,648,648,539,648,648,648,648,376,648,648,648,648,648,648], + [ 92, 0,648, 0,657,403,482,648,482,492,482,484,648, 0, 94], + [648, 0,648, 0,648,648,648,648,656,648,492,648,648, 0,648], + [648, 0,656, 0, 27,381,648,660, 21,648, 0, 0, 0, 0,648], + [648,648,648,648,103, 21,648,648,648,648,539,648,648,648,648], + [648, 28,648, 0, 28,482,648, 0, 27, 0, 33, 0, 28, 0,648], + [648, 33,648,596,648,648,648,596,648,648,494,648,648,249,648], + [648, 27,243, 0, 0, 0, 0, 0, 0,129,376,378,381,491,648], + [648,648,648,648, 93,648,648,648,648,648,648,648,648,648,648] ], + "bgmap": [ + +], + "fgmap": [ + +], + "bg2map": [ + +], + "fg2map": [ + +] } \ No newline at end of file diff --git a/public/project/floors/MT55.js b/public/project/floors/MT55.js index afd8d97..9b1ce04 100644 --- a/public/project/floors/MT55.js +++ b/public/project/floors/MT55.js @@ -1,45 +1,73 @@ main.floors.MT55= { -"floorId": "MT55", -"title": "苍蓝之殿-左下", -"name": "55", -"width": 15, -"height": 15, -"canFlyTo": true, -"canFlyFrom": true, -"canUseQuickShop": true, -"cannotViewMap": false, -"images": [], -"ratio": 8, -"defaultGround": "T650", -"bgm": "palaceSouth.mp3", -"firstArrive": [], -"eachArrive": [], -"parallelDo": "", -"events": {}, -"changeFloor": {}, -"beforeBattle": {}, -"afterBattle": {}, -"afterGetItem": {}, -"afterOpenDoor": {}, -"autoEvent": {}, -"cannotMove": {}, -"cannotMoveIn": {}, -"map": [ - [ 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, 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, 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, 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, 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, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + "floorId": "MT55", + "title": "苍蓝之殿-左下", + "name": "55", + "width": 15, + "height": 15, + "canFlyTo": true, + "canFlyFrom": true, + "canUseQuickShop": true, + "cannotViewMap": false, + "images": [], + "ratio": 8, + "defaultGround": "T650", + "bgm": "palaceSouth.mp3", + "firstArrive": [], + "eachArrive": [], + "parallelDo": "", + "events": { + "6,7": [ + { + "type": "function", + "async": true, + "function": "function(){\nMota.require('module', 'Mechanism').BluePalace.doorConvert(6, 7);\n}" + } + ] + }, + "changeFloor": { + "14,7": { + "floorId": "MT54", + "loc": [ + 0, + 7 + ] + } + }, + "beforeBattle": {}, + "afterBattle": {}, + "afterGetItem": {}, + "afterOpenDoor": {}, + "autoEvent": {}, + "cannotMove": {}, + "cannotMoveIn": {}, + "map": [ + [648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648], + [648, 0, 0,648, 0, 0,648, 0,578, 0, 0,648, 0, 0,648], + [648, 0, 0,648, 0, 0,219, 0,648, 0, 0,648, 0, 0,648], + [648,601,648,648,648,648,648,563,648,648,648,648,657,648,648], + [648,103, 0,594, 0, 0,648, 0, 0, 0, 0,648, 33, 27,648], + [648, 0, 0,648, 0, 0,648,648,648,648,656,648, 29, 33,648], + [648,657,648,648,648,648,648, 0, 27, 0,482,648,648,243,648], + [648, 0, 0, 0, 0, 0,660,381,103,648,648,648, 0, 0, 94], + [648,648,648,648,492,648,648, 0, 28,656, 0, 0, 0, 0,648], + [648, 0, 0,601, 0, 0,648,494,648,648,657,648,648,648,648], + [648, 0, 0,648, 0, 0,492, 0, 0, 0, 0,648, 0, 0,648], + [648,240,648,648,648,492,648,243,648,648,648,648, 0, 0,648], + [648, 0, 0,648, 0, 0,648, 0,648, 0, 0,648,648,220,648], + [648, 0, 0,249, 0, 0,648, 0,657, 0, 0, 0, 0, 0,648], + [648,648,648,648,648,648,648,648,648,648,648,648,648,648,648] ], + "bgmap": [ + +], + "fgmap": [ + +], + "bg2map": [ + +], + "fg2map": [ + +] } \ No newline at end of file diff --git a/public/project/items.js b/public/project/items.js index cc4ad93..a17a43e 100644 --- a/public/project/items.js +++ b/public/project/items.js @@ -40,8 +40,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cls": "items", "name": "小绿宝石", "text": ",护盾+${core.values.greenGem}", - "itemEffect": "core.status.hero.mdef += 20 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1)", - "itemEffectTip": ",智慧+${20 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1)}", + "itemEffect": "core.status.hero.mdef += Math.round(20 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))", + "itemEffectTip": ",智慧+${Math.round(20 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))}", "useItemEffect": "core.status.hero.mdef += core.values.greenGem", "canUseItemEffect": "true" }, @@ -97,8 +97,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cls": "items", "name": "红血瓶", "text": ",生命+${core.values.redPotion}", - "itemEffect": "core.status.hero.hp += 100 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50)", - "itemEffectTip": ",生命+${100 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50)}", + "itemEffect": "core.status.hero.hp += Math.round(100 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", + "itemEffectTip": ",生命+${Math.round(100 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}", "useItemEffect": "core.status.hero.hp += core.values.redPotion", "canUseItemEffect": "true" }, @@ -106,8 +106,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cls": "items", "name": "蓝血瓶", "text": ",生命+${core.values.bluePotion}", - "itemEffect": "core.status.hero.hp += 200 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50)", - "itemEffectTip": ",生命+${200 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50)}", + "itemEffect": "core.status.hero.hp += Math.round(200 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", + "itemEffectTip": ",生命+${Math.round(200 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}", "useItemEffect": "core.status.hero.hp += core.values.bluePotion", "canUseItemEffect": "true" }, @@ -115,8 +115,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cls": "items", "name": "黄血瓶", "text": ",生命+${core.values.yellowPotion}", - "itemEffect": "core.status.hero.hp += 400 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50)", - "itemEffectTip": ",生命+${400 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50)}", + "itemEffect": "core.status.hero.hp += Math.round(400 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", + "itemEffectTip": ",生命+${Math.round(400 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}", "useItemEffect": "core.status.hero.hp += core.values.yellowPotion", "canUseItemEffect": "true" }, @@ -124,8 +124,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cls": "items", "name": "绿血瓶", "text": ",生命+${core.values.greenPotion}", - "itemEffect": "core.status.hero.hp += 800 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50)", - "itemEffectTip": ",生命+${800 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50)}", + "itemEffect": "core.status.hero.hp += Math.round(800 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", + "itemEffectTip": ",生命+${Math.round(800 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}", "useItemEffect": "core.status.hero.hp += core.values.greenPotion", "canUseItemEffect": "true" }, @@ -626,8 +626,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cls": "items", "name": "中绿宝石", "text": ",护盾+${core.values.greenGem}", - "itemEffect": "core.status.hero.mdef += 40 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1)", - "itemEffectTip": ",智慧+${40 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1)}", + "itemEffect": "core.status.hero.mdef += Math.round(40 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))", + "itemEffectTip": ",智慧+${Math.round(40 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))}", "useItemEffect": "core.status.hero.mdef += core.values.greenGem", "canUseItemEffect": "true" }, @@ -729,8 +729,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cls": "items", "name": "大绿宝石", "text": ",护盾+${core.values.greenGem}", - "itemEffect": "core.status.hero.mdef += 80 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1)", - "itemEffectTip": ",智慧+${80 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1)}", + "itemEffect": "core.status.hero.mdef += Math.round(80 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))", + "itemEffectTip": ",智慧+${Math.round(80 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))}", "useItemEffect": "core.status.hero.mdef += core.values.greenGem", "canUseItemEffect": "true" }, @@ -896,8 +896,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cls": "items", "name": "超大绿宝石", "text": ",护盾+${core.values.greenGem}", - "itemEffect": "core.status.hero.mdef += 160 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1)", - "itemEffectTip": ",智慧+${160 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1)}", + "itemEffect": "core.status.hero.mdef += Math.round(160 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))", + "itemEffectTip": ",智慧+${Math.round(160 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))}", "useItemEffect": "core.status.hero.mdef += core.values.greenGem", "canUseItemEffect": "true" }, @@ -1019,8 +1019,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cls": "items", "name": "璀璨绿宝石", "text": ",护盾+${core.values.greenGem}", - "itemEffect": "core.status.hero.mdef += 320 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1)", - "itemEffectTip": ",智慧+${320 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1)}", + "itemEffect": "core.status.hero.mdef += Math.round(320 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))", + "itemEffectTip": ",智慧+${Math.round(320 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))}", "useItemEffect": "core.status.hero.mdef += core.values.greenGem", "canUseItemEffect": "true" }, @@ -1050,8 +1050,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cls": "items", "name": "新物品", "text": ",防御+${core.values.blueGem}", - "itemEffect": "core.status.hero.mdef += 640 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1)", - "itemEffectTip": ",智慧+${640 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1)}", + "itemEffect": "core.status.hero.mdef += Math.round(640 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))", + "itemEffectTip": ",智慧+${Math.round(640 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))}", "useItemEffect": "core.status.hero.def += core.values.blueGem", "canUseItemEffect": "true" }, @@ -1071,8 +1071,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cls": "items", "name": "史诗绿宝石", "text": ",护盾+${core.values.greenGem}", - "itemEffect": "core.status.hero.mdef += 1280 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1)", - "itemEffectTip": ",智慧+${1280 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1)}", + "itemEffect": "core.status.hero.mdef += Math.round(1280 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))", + "itemEffectTip": ",智慧+${Math.round(1280 * core.status.thisMap.ratio / core.getFlag(\"hard\") * (Mota.Plugin.require('skillTree_g').getSkillLevel(12) / 20 + 1))}", "useItemEffect": "core.status.hero.mdef += core.values.greenGem", "canUseItemEffect": "true" }, @@ -1100,8 +1100,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cls": "items", "name": "大红血瓶", "text": ",生命+${core.values.redPotion}", - "itemEffect": "core.status.hero.hp += 1000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50)", - "itemEffectTip": ",生命+${1000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50)}", + "itemEffect": "core.status.hero.hp += Math.round(1000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", + "itemEffectTip": ",生命+${Math.round(1000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}", "useItemEffect": "core.status.hero.hp += core.values.redPotion", "canUseItemEffect": "true" }, @@ -1113,8 +1113,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cls": "items", "name": "大蓝血瓶", "text": ",生命+${core.values.redPotion}", - "itemEffect": "core.status.hero.hp += 2000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50)", - "itemEffectTip": ",生命+${2000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50)}", + "itemEffect": "core.status.hero.hp += Math.round(2000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", + "itemEffectTip": ",生命+${Math.round(2000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}", "useItemEffect": "core.status.hero.hp += core.values.redPotion", "canUseItemEffect": "true" }, @@ -1130,8 +1130,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cls": "items", "name": "大绿血瓶", "text": ",生命+${core.values.redPotion}", - "itemEffect": "core.status.hero.hp += 8000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50)", - "itemEffectTip": ",生命+${8000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50)}", + "itemEffect": "core.status.hero.hp += Math.round(8000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", + "itemEffectTip": ",生命+${Math.round(8000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}", "useItemEffect": "core.status.hero.hp += core.values.redPotion", "canUseItemEffect": "true" }, @@ -1151,8 +1151,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cls": "items", "name": "大黄血瓶", "text": ",生命+${core.values.redPotion}", - "itemEffect": "core.status.hero.hp += 4000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50)", - "itemEffectTip": ",生命+${4000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50)}", + "itemEffect": "core.status.hero.hp += Math.round(4000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))", + "itemEffectTip": ",生命+${Math.round(4000 * core.status.thisMap.ratio * (1 + Mota.Plugin.require('skillTree_g').getSkillLevel(13) / 50))}", "useItemEffect": "core.status.hero.hp += core.values.redPotion", "canUseItemEffect": "true" }, diff --git a/src/core/fx/shadow.ts b/src/core/fx/shadow.ts index 9cdd774..5daf1c7 100644 --- a/src/core/fx/shadow.ts +++ b/src/core/fx/shadow.ts @@ -11,11 +11,12 @@ import { setCanvasFilterByFloorId } from '@/plugin/fx/gameCanvas'; * 最大光源数量,必须设置,且光源数不能超过这个值,这个值决定了会预留多少的缓冲区,因此最好尽可能小,同时游戏过程中不可修改 * 这个值越大,对显卡尤其是显存的要求会越大,不过考虑到各种设备的性能差异,不建议超过10 */ -const MAX_LIGHT_NUM = 10; +const MAX_LIGHT_NUM = 5; /** 阴影层的Z值 */ const Z_INDEX = 55; // 我也不知道这个数怎么来的,试出来是这个,别动就行 const FOVY = Math.PI / 1.86; +const ignore: Set = new Set([660]); interface LightConfig { decay: number; @@ -76,7 +77,7 @@ Mota.require('var', 'loading').once('coreInit', () => { 103, { decay: 50, r: 300, color: [0.9333, 0.6, 0.333, 0.3] }, { background: [0, 0, 0, 0.26] }, - { decay: 50, r: 200, color: [0, 0, 0, 0] } + { decay: 50, r: 250, color: [0, 0, 0, 0] } ); addLightFromBlock( ['MT50'], @@ -97,7 +98,7 @@ Mota.require('var', 'loading').once('coreInit', () => { y: core.status.heroCenter.py }); }); - shadow.requestRefresh(); + if (shadow.followHero.size > 0) shadow.requestRefresh(); } } }); @@ -1207,7 +1208,8 @@ export function calMapWalls(floor: FloorIds, nocache: boolean = false) { if ( !used.has(x + y * width) && requiredCls.includes(block.event.cls) && - block.event.noPass + block.event.noPass && + !ignore.has(block.id) ) { const queue: Block[] = [block]; const arr: [number, number][] = []; @@ -1233,7 +1235,8 @@ export function calMapWalls(floor: FloorIds, nocache: boolean = false) { if ( requiredCls.includes(blk.event.cls) && blk.event.noPass && - !used.has(blk.x + blk.y * width) + !used.has(blk.x + blk.y * width) && + !ignore.has(blk.id) ) { used.add(blk.x + blk.y * width); queue.push(blk); diff --git a/src/core/main/init/hotkey.ts b/src/core/main/init/hotkey.ts index 8b3b490..520dd8b 100644 --- a/src/core/main/init/hotkey.ts +++ b/src/core/main/init/hotkey.ts @@ -236,6 +236,11 @@ gameKey name: '评论区', defaults: KeyCode.KeyP }) + .register({ + id: 'debug', + name: '调试模式', + defaults: KeyCode.F8 + }) // -------------------- .group('general', '通用按键') .register({ @@ -557,6 +562,9 @@ gameKey if (flags.shield) flags.shield = false; else flags.shield = true; core.updateStatusBar(); + }) + .realize('debug', () => { + core.debug(); }); // ----- Storage diff --git a/src/game/index.ts b/src/game/index.ts index 509314a..b4b45b2 100644 --- a/src/game/index.ts +++ b/src/game/index.ts @@ -7,6 +7,7 @@ import { specials } from './enemy/special'; import { gameListener, hook, loading } from './game'; import * as battle from './enemy/battle'; import * as hero from './hero'; +import * as miscMechanism from './mechanism/misc'; // ----- 类注册 Mota.register('class', 'DamageEnemy', damage.DamageEnemy); @@ -25,6 +26,9 @@ Mota.register('var', 'hook', hook); Mota.register('var', 'gameListener', gameListener); Mota.register('var', 'loading', loading); // ----- 模块注册 +Mota.register('module', 'Mechanism', { + BluePalace: miscMechanism.BluePalace +}); main.loading = loading; diff --git a/src/game/mechanism/misc.ts b/src/game/mechanism/misc.ts new file mode 100644 index 0000000..b6ee5da --- /dev/null +++ b/src/game/mechanism/misc.ts @@ -0,0 +1,78 @@ +import { has } from '@/plugin/game/utils'; + +export namespace BluePalace { + type DoorConvertInfo = [id: AllIds, x: number, y: number]; + + function drawDoors( + ctx: CanvasRenderingContext2D, + convert: DoorConvertInfo[], + frame: number + ) { + ctx.clearRect(0, 0, 480, 480); + convert.forEach(v => { + core.drawIcon(ctx, v[0], v[1] * 32, v[2] * 32, 32, 32, frame); + }); + } + + export function doorConvert( + x?: number, + y?: number, + floorId: FloorIds = core.status.floorId + ) { + core.autosave(); + core.extractBlocks(floorId); + const blocks = core.status.maps[floorId].blocks; + + const ctx = core.createCanvas(`@doorConvert`, 0, 0, 480, 480, 35); + const time = core.values.animateSpeed / 4; + + const toConvert: DoorConvertInfo[] = []; + blocks.forEach(v => { + if (v.id === 492) { + core.setBlock(494, v.x, v.y, floorId); + toConvert.push(['A492', v.x, v.y]); + } else if (v.id === 494) { + core.setBlock(492, v.x, v.y, floorId); + toConvert.push(['A494', v.x, v.y]); + } + }); + + if (has(x) && has(y)) { + core.removeBlock(x, y, floorId); + } + + if (core.isReplaying() || core.status.floorId !== floorId) { + core.doAction(); + return; + } + + core.lockControl(); + core.playSound('door.mp3'); + + new Promise(res => { + drawDoors(ctx, toConvert, 0); + setTimeout(res, time); + }) + .then(() => { + drawDoors(ctx, toConvert, 1); + return new Promise(res => { + setTimeout(res, time); + }); + }) + .then(() => { + drawDoors(ctx, toConvert, 2); + return new Promise(res => { + setTimeout(res, time); + }); + }) + .then(() => { + drawDoors(ctx, toConvert, 3); + return new Promise(res => { + core.unlockControl(); + core.deleteCanvas('@doorConvert'); + core.doAction(); + setTimeout(res, time); + }); + }); + } +} diff --git a/src/game/system.ts b/src/game/system.ts index dd8fd9e..03002d6 100644 --- a/src/game/system.ts +++ b/src/game/system.ts @@ -24,6 +24,7 @@ import type * as hero from './hero'; import type * as damage from './enemy/damage'; import type { Logger } from '@/core/common/logger'; import type { Danmaku } from '@/core/main/custom/danmaku'; +import type * as misc from './mechanism/misc'; interface ClassInterface { // 渲染进程与游戏进程通用 @@ -85,7 +86,11 @@ interface VariableInterface { logger: Logger; } -interface ModuleInterface {} +interface ModuleInterface { + Mechanism: { + BluePalace: typeof misc.BluePalace; + }; +} interface SystemInterfaceMap { class: ClassInterface; diff --git a/src/plugin/game/enemy/checkblock.ts b/src/plugin/game/enemy/checkblock.ts index 34f2416..0e7ea88 100644 --- a/src/plugin/game/enemy/checkblock.ts +++ b/src/plugin/game/enemy/checkblock.ts @@ -132,7 +132,8 @@ function checkMockery(loc: string, force: boolean = false) { 'npcs', 'npc48', 'terrains' - ].includes(block.event.cls) + ].includes(block.event.cls) && + block.event.noPass ) { action.push( {