diff --git a/public/project/bgms/chapter2ED.mp3 b/public/project/bgms/chapter2ED.mp3 new file mode 100644 index 0000000..1436bd0 Binary files /dev/null and b/public/project/bgms/chapter2ED.mp3 differ diff --git a/public/project/floors/MT48.js b/public/project/floors/MT48.js index 9301880..46b0ebf 100644 --- a/public/project/floors/MT48.js +++ b/public/project/floors/MT48.js @@ -17,31 +17,6 @@ main.floors.MT48= "eachArrive": [], "parallelDo": "", "events": { - "7,0": [ - "本塔的第二章测试版已结束。", - "本章还剩余最后一个大区域,约30层,较为复杂,请期待下次更新。", - "计分方式:血量/10+黄*2000+蓝*5000+红*10000", - { - "type": "setValue", - "name": "status:hp", - "operator": "/=", - "value": "10" - }, - { - "type": "setValue", - "name": "status:hp", - "operator": "+=", - "value": "item:yellowKey*2000+item:blueKey*5000+item:redKey*10000" - }, - { - "type": "function", - "function": "function(){\ncore.status.hero.hp = Math.ceil(core.status.hero.hp);\n}" - }, - { - "type": "win", - "reason": "第二章测试" - } - ], "7,10": [ "\t[苍蓝之灵-虚,E647]\b[up,7,7]你来了,智慧之神看中的人。", "\t[中级智人]\b[up,hero]你是什么人?", @@ -54,13 +29,110 @@ main.floors.MT48= "\t[苍蓝之灵-虚,E647]\b[up,7,7]你现在还有很多疑虑吧,那里便有你想要找的答案。", "\t[中级智人]\b[up,hero]那么我怎么过去?", "\t[苍蓝之灵-虚,E647]\b[up,7,7]打败我,你便有资格进入。", - "\t[中级智人]\b[up,hero]为什么又是要打架?", + "\t[中级智人]\b[up,hero]为什么又是要打一场?", "\t[苍蓝之灵-虚,E647]\b[up,7,7]......", "\t[苍蓝之灵-虚,E647]\b[up,7,7]之后,你会明白的。", { "type": "hide", "remove": true } + ], + "7,0": [ + { + "type": "if", + "condition": "(flag:pale1!==1)", + "true": [ + { + "type": "setCurtain", + "color": [ + 0, + 0, + 0, + 1 + ], + "time": 1500, + "keep": true + }, + { + "type": "setText", + "text": [ + 0, + 0, + 0, + 1 + ], + "background": "winskin3.png" + }, + "人类简史——进化篇", + { + "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": [ + 255, + 255, + 255, + 1 + ], + "background": "winskin2.png" + }, + { + "type": "changeFloor", + "floorId": "MT49", + "loc": [ + 7, + 14 + ] + }, + { + "type": "setCurtain", + "time": 1500 + }, + "\t[中级智人]\b[up,hero]!!", + "\t[中级智人]\b[up,hero]这,这是!", + "\t[中级智人]\b[up,hero]这就是未来人类的最后底牌了吗?", + "\t[中级智人]\b[up,hero]我一定要弄清楚这里面的东西。", + "\t[中级智人]\b[up,hero]前方,一定会有我所寻找的答案。", + { + "type": "setValue", + "name": "flag:pale1", + "value": "1" + } + ], + "false": [] + } ] }, "changeFloor": { @@ -75,7 +147,7 @@ main.floors.MT48= "beforeBattle": {}, "afterBattle": { "7,7": [ - "\t[中级智人]\b[up,hero]为什么,为什么一定要打架,决定胜负呢?", + "\t[中级智人]\b[up,hero]为什么,为什么一定要打一场,来决定胜负呢?", { "type": "openDoor", "loc": [ diff --git a/public/project/floors/MT49.js b/public/project/floors/MT49.js index 365a05b..4a52ad4 100644 --- a/public/project/floors/MT49.js +++ b/public/project/floors/MT49.js @@ -1,34 +1,95 @@ main.floors.MT49= { -"floorId": "MT49", -"title": "冰封高原", -"name": "49", -"width": 15, -"height": 15, -"canFlyTo": true, -"canFlyFrom": true, -"canUseQuickShop": true, -"cannotViewMap": false, -"images": [], -"ratio": 8, -"defaultGround": "T580", -"bgm": "winter.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], + "floorId": "MT49", + "title": "苍蓝之殿-入", + "name": "49", + "width": 15, + "height": 15, + "canFlyTo": true, + "canFlyFrom": true, + "canUseQuickShop": true, + "cannotViewMap": false, + "images": [], + "ratio": 8, + "defaultGround": "T580", + "bgm": "winter.mp3", + "firstArrive": [], + "eachArrive": [], + "parallelDo": "", + "events": { + "6,10": [ + "以万&定%$*#■◁" + ], + "8,10": [ + "行$天&*至^%?□▼" + ], + "7,14": [ + { + "type": "changeFloor", + "floorId": "MT48", + "loc": [ + 7, + 0 + ] + } + ], + "7,10": [ + { + "type": "changeFloor", + "floorId": "MT50", + "loc": [ + 7, + 14 + ] + } + ] + }, + "changeFloor": {}, + "beforeBattle": {}, + "afterBattle": {}, + "afterGetItem": {}, + "afterOpenDoor": {}, + "autoEvent": {}, + "cannotMove": {}, + "cannotMoveIn": {}, + "map": [ + [ 0, 0,80922,80923,80924,80925,80926,80927,81120,81121,81122,81123,81124, 0, 0], + [ 0, 0,80930,80931,80932,80933,80934,80935,81128,81129,81130,81131,81132, 0, 0], + [ 0, 0,80938,80939,80940,80941,80942,80943,81136,81137,81138,81139,81140, 0, 0], + [ 0, 0,80946,80947,80948,80949,80950,80951,81144,81145,81146,81147,81148, 0, 0], + [ 0, 0,80954,80955,80956,80957,80958,80959,81152,81153,81154,81155,81156, 0, 0], + [ 0, 0,80962,80963,80964,80965,80966,80967,81160,81161,81162,81163,81164, 0, 0], + [ 0, 0,80970,80971,80972,80973,80974,80975,81168,81169,81170,81171,81172, 0, 0], + [ 0, 0,80978,80979,80980,80981,80982,80983,81176,81177,81178,81179,81180, 0, 0], + [ 0, 0,80986,80987,80988,80989,80990,80991,81184,81185,81186,81187,81188, 0, 0], + [ 0, 0,80994,80995,80996,80997,80998,80999,81192,81193,81194,81195,81196, 0, 0], + [ 0, 0,81002,81003, 0,81005,129, 91,129,81201,81202,81203,81204, 0, 0], + [ 0, 0,81069,81070,81071, 0, 0, 0, 0, 0,81069,81070,81071, 0, 0], + [ 0, 0,81077,81078,81079, 0, 0, 0, 0, 0,81077,81078,81079, 0, 0], + [ 0,146,146,146,146, 0, 0, 0, 0, 0, 0, 0,146,146, 0], + [146,146,146,146,146,146, 0, 93, 0,146,146,146,146,146,146] +], + "bgmap": [ + [70067,70067,70067,70067,70067,70067, 0, 0, 0,70067,70067,70067,70067,70067,70067], + [70067,70067,70067,70067,70067,70067, 0, 0, 0,70067,70067,70067,70067,70067,70067], + [70067,70067,70067,70067,70067,70067, 0, 0, 0,70067,70067,70067,70067,70067,70067], + [70067,70067,70067,70067,70067,70067, 0, 0, 0,70067,70067,70067,70067,70067,70067], + [70067,70067,70067,70067,70067,70067, 0, 0, 0,70067,70067,70067,70067,70067,70067], + [70067,70067,70067,70067,70067,70067, 0, 0, 0,70067,70067,70067,70067,70067,70067], + [70067,70067,70067,70067,70067,70067, 0, 0, 0,70067,70067,70067,70067,70067,70067], + [70067,70067,70067,70067,70067,70067, 0, 0, 0,70067,70067,70067,70067,70067,70067], + [70067,70067,70067,70067,70067,70067, 0, 0, 0,70067,70067,70067,70067,70067,70067], + [70067,70067,70048,70049,70049,70049,70056, 0,70058,70049,70049,70049,70050,70067,70067], + [70067,70067,70056, 0, 0, 0,70056, 0,70058, 0, 0, 0,70058,70067,70067], + [70049,70049,70051, 0, 0, 0,70056, 0,70058, 0, 0, 0,70052,70049,70049], + [ 0, 0, 0, 0, 0, 0,70056, 0,70058, 0, 0, 0, 0, 0, 0], + [ 0, 0, 0, 0, 0, 0,70056, 0,70058, 0, 0, 0, 0, 0, 0], + [ 0, 0, 0, 0, 0, 0,70056, 0,70058, 0, 0, 0, 0, 0, 0] +], + "fgmap": [ + +], + "bg2map": [ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], @@ -40,6 +101,12 @@ main.floors.MT49= [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [ 0, 0,81085,81086,81087, 0, 0, 0, 0, 0,81085,81086,81087, 0, 0], + [ 0, 0,81093,81094,81095, 0, 0, 0, 0, 0,81093,81094,81095, 0, 0], + [ 0, 0,81101,81102,81103, 0, 0, 0, 0, 0,81101,81102,81103, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] ], + "fg2map": [ + +] } \ No newline at end of file diff --git a/public/project/floors/MT50.js b/public/project/floors/MT50.js index aabfa84..9c6ab5b 100644 --- a/public/project/floors/MT50.js +++ b/public/project/floors/MT50.js @@ -1,40 +1,84 @@ main.floors.MT50= { -"floorId": "MT50", -"title": "冰封高原", -"name": "50", -"width": 15, -"height": 15, -"canFlyTo": true, -"canFlyFrom": true, -"canUseQuickShop": true, -"cannotViewMap": false, -"images": [], -"ratio": 8, -"defaultGround": "T580", -"bgm": "winter.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], + "floorId": "MT50", + "title": "苍蓝之殿-中", + "name": "50", + "width": 15, + "height": 15, + "canFlyTo": true, + "canFlyFrom": true, + "canUseQuickShop": true, + "cannotViewMap": false, + "images": [], + "ratio": 8, + "defaultGround": "T650", + "bgm": [ + "palaceSouth.mp3", + "winter.mp3" + ], + "firstArrive": [], + "eachArrive": [], + "parallelDo": "", + "events": { + "7,14": [ + { + "type": "changeFloor", + "floorId": "MT49", + "loc": [ + 7, + 10 + ] + } + ], + "5,13": [ + "欢迎来到苍蓝之殿,这是本塔第二章里面最大的一个区,也是最复杂的一个区。整个苍蓝之殿分为四个部分:左下角、右下角、左上角、右上角,每个部分都有不一样的玩法,多多动脑哦。" + ], + "9,13": [ + "在你刚进入苍蓝之殿时,你只能先前往左下角部分(本地图的左面),右下角暂时不能前往。" + ], + "5,1": [ + "左边两个机关门在打完左下角区域的boss后开启,右边同理。" + ], + "9,1": [ + "左下角和右下角两个区域打完之后必须要点开学习技能,不然会卡关。", + "本区域可以使用跳跃技能,不要忘记了。" + ] + }, + "changeFloor": {}, + "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, 0, 0,129, 0, 0, 0,129, 0, 0, 0, 0,648], + [648, 0, 0, 0, 0,648, 0, 0, 0,648, 0, 0, 0, 0,648], + [648, 0, 0, 0, 0,648, 0, 0, 0,648, 0, 0, 0, 0,648], + [648, 0, 0, 0,103,648, 0, 0, 0,648,103, 0, 0, 0,648], + [648, 85,648,648,648,648, 0, 0, 0,648,648,648,648, 85,648], + [648, 0, 0, 0, 0, 0,484, 0,484, 0, 0, 0, 0, 0,648], + [ 92, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 94], + [648, 0, 0, 0, 0, 0,484, 0,484, 0, 0, 0, 0, 0,648], + [648, 85,648,648,648,648, 0, 0, 0,648,648,648,648, 85,648], + [648, 0, 0, 0,103,648, 0, 0, 0,648,103, 0, 0, 0,648], + [648, 0, 0, 0, 0,648, 0, 0, 0,648, 0, 0, 0, 0,648], + [648, 0, 0, 0, 0,648, 0, 0, 0,648, 0, 0, 0, 0,648], + [648, 0, 0, 0, 0,129, 0, 0, 0,129, 0, 0, 0, 0,648], + [648,648,648,648,648,648,648, 93,648,648,648,648,648,648,648] +], + "bgmap": [ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [ 0, 0, 0, 0, 0, 0,50403,50404,50405, 0, 0, 0, 0, 0, 0], + [ 0, 0, 0, 0, 0, 0,50411,50412,50413, 0, 0, 0, 0, 0, 0], + [ 0, 0, 0, 0, 0, 0,50419,50420,50421, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], @@ -42,4 +86,13 @@ main.floors.MT50= [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] ], + "fgmap": [ + +], + "bg2map": [ + +], + "fg2map": [ + +] } \ No newline at end of file diff --git a/public/project/functions.js b/public/project/functions.js index 17e30ca..5dbc1dc 100644 --- a/public/project/functions.js +++ b/public/project/functions.js @@ -145,7 +145,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { // ---------- 重绘新地图;这一步将会设置core.status.floorId ---------- // core.drawMap(floorId); - if (!main.replayChecking) core.updateShadow(); + if (!main.replayChecking) { + core.updateShadow(); + core.setCanvasFilterByFloorId(floorId); + } // 切换楼层BGM if (core.status.maps[floorId].bgm) { diff --git a/public/project/icons.js b/public/project/icons.js index 4f22b6d..6b8f4c0 100644 --- a/public/project/icons.js +++ b/public/project/icons.js @@ -126,7 +126,12 @@ var icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 = "T627": 66, "T628": 67, "T629": 68, - "T640": 69 + "T640": 69, + "T648": 70, + "T649": 71, + "T650": 72, + "T651": 73, + "T652": 74 }, "animates": { "star": 0, diff --git a/public/project/maps.js b/public/project/maps.js index 4357abe..ca96df3 100644 --- a/public/project/maps.js +++ b/public/project/maps.js @@ -84,7 +84,7 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e = "94": {"cls":"animates","id":"rightPortal","canPass":true}, "101": {"cls":"animates","id":"crystalUp"}, "102": {"cls":"animates","id":"crystalBottom"}, - "103": {"cls":"animates","id":"fire"}, + "103": {"cls":"animates","id":"fire","canPass":true,"cannotIn":[]}, "104": {"cls":"animates","id":"switch"}, "105": {"cls":"animates","id":"steelDoor2","doorInfo":{"time":160,"openSound":"door.mp3","closeSound":"door.mp3","keys":{}},"animate":1,"trigger":"openDoor"}, "106": {"cls":"animates","id":"steelDoor3","doorInfo":{"time":160,"openSound":"door.mp3","closeSound":"door.mp3","keys":{}},"animate":1,"trigger":"openDoor"}, @@ -576,6 +576,11 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e = "645": {"cls":"enemys","id":"E645"}, "646": {"cls":"enemys","id":"E646"}, "647": {"cls":"enemys","id":"E647"}, + "648": {"cls":"terrains","id":"T648"}, + "649": {"cls":"terrains","id":"T649"}, + "650": {"cls":"terrains","id":"T650"}, + "651": {"cls":"terrains","id":"T651"}, + "652": {"cls":"terrains","id":"T652"}, "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/terrains.png b/public/project/materials/terrains.png index 8907dea..b3b8b92 100644 Binary files a/public/project/materials/terrains.png and b/public/project/materials/terrains.png differ diff --git a/src/initPlugin.ts b/src/initPlugin.ts index 3da0711..df12276 100644 --- a/src/initPlugin.ts +++ b/src/initPlugin.ts @@ -16,6 +16,8 @@ import gameShadow from './plugin/shadow/gameShadow'; import achievement from './plugin/ui/achievement'; import completion, { floors } from './plugin/completion'; import path from './plugin/fx/path'; +import gameCanvas from './plugin/fx/gameCanvas'; +import noise from './plugin/fx/noise'; function forward() { const toForward: any[] = [ @@ -36,7 +38,9 @@ function forward() { gameShadow(), achievement(), completion(), - path() + path(), + gameCanvas(), + noise() ]; // 初始化所有插件,并转发到core上 diff --git a/src/plugin/fx/gameCanvas.ts b/src/plugin/fx/gameCanvas.ts new file mode 100644 index 0000000..8f8f8eb --- /dev/null +++ b/src/plugin/fx/gameCanvas.ts @@ -0,0 +1,29 @@ +export default function init() { + return { + setGameCanvasFilter, + getCanvasFilterByFloorId, + setCanvasFilterByFloorId + }; +} + +export function setGameCanvasFilter(filter: string) { + ['bg', 'bg2', 'event', 'event2', 'fg', 'fg2', 'hero'].forEach(v => { + core.canvas[v].canvas.style.filter = filter; + }); +} + +const filterMap: [FloorIds[], string][] = [ + [['MT50'], 'brightness(80%)contrast(120%)'] // 童心佬的滤镜( +]; + +export function getCanvasFilterByFloorId( + floorId: FloorIds = core.status.floorId +) { + return filterMap.find(v => v[0].includes(floorId))?.[1] ?? ''; +} + +export function setCanvasFilterByFloorId( + floorId: FloorIds = core.status.floorId +) { + setGameCanvasFilter(getCanvasFilterByFloorId(floorId)); +} diff --git a/src/plugin/fx/noise.ts b/src/plugin/fx/noise.ts new file mode 100644 index 0000000..a22c3f4 --- /dev/null +++ b/src/plugin/fx/noise.ts @@ -0,0 +1,54 @@ +export default function init() { + return { createGaussNoise }; +} + +interface GaussNoiseConfig { + /** 分辨率,最小为1,最大为画布长宽的最大值,默认为画布长宽最大值的一半,过大可能会卡顿 */ + resolution?: number; + /** 画布宽度 */ + width?: number; + /** 画布高度 */ + height?: number; + /** 噪声灰度的均值,范围 0 ~ 255 */ + expectation: number; + /** 噪声灰度方差 */ + deviation: number; + /** 目标画布,如果不指定会创建一个新的 */ + canvas?: HTMLCanvasElement; +} + +/** + * 创建一个高斯噪声 + * @param config 噪声选项 + * @returns 噪声画布 + */ +export function createGaussNoise(config: GaussNoiseConfig): HTMLCanvasElement { + const canvas = config.canvas ?? document.createElement('canvas'); + canvas.width = config.width ?? core._PX_; + canvas.height = config.height ?? core._PY_; + canvas.style.imageRendering = 'pixelated'; + const ctx = canvas.getContext('2d')!; + ctx.imageSmoothingEnabled = false; + + const max = Math.max(canvas.width, canvas.height); + const resolution = Math.min(max, config.resolution ?? max / 2); + + const step = + max === canvas.width + ? canvas.width / resolution + : canvas.height / resolution; + + for (let x = 0; x < canvas.width; x += step) { + for (let y = 0; y < canvas.height; y += step) { + const random = + Math.sqrt(Math.log(Math.random()) * -2) * + Math.sin(2 * Math.PI * Math.random()); + const gray = 255 - random * config.deviation - config.expectation; + + ctx.fillStyle = `rgba(${gray},${gray},${gray},${gray / 255})`; + ctx.fillRect(x, y, step, step); + } + } + + return canvas; +} diff --git a/src/plugin/game/damage.ts b/src/plugin/game/damage.ts index 694c412..1c904cd 100644 --- a/src/plugin/game/damage.ts +++ b/src/plugin/game/damage.ts @@ -60,6 +60,9 @@ export class EnemyCollection implements RangeCollection { this.floorId = floorId; } + /** + * 解析本地图的怪物信息 + */ extract() { core.extractBlocks(this.floorId); core.status.maps[this.floorId].blocks.forEach(v => { diff --git a/src/plugin/game/hotReload.js b/src/plugin/game/hotReload.js index 363bab2..74774eb 100644 --- a/src/plugin/game/hotReload.js +++ b/src/plugin/game/hotReload.js @@ -27,8 +27,9 @@ export {}; async function reloadFloor(data) { // 如果被砍层了直接忽略 if ( - core.status.maps[data].deleted || - core.status.maps[data].forceDelete + core.status.maps && + (core.status.maps[data].deleted || + core.status.maps[data].forceDelete) ) return; // 首先重新加载main.floors对应的楼层 diff --git a/src/plugin/game/skills.js b/src/plugin/game/skills.js index 862e2d9..4729a55 100644 --- a/src/plugin/game/skills.js +++ b/src/plugin/game/skills.js @@ -34,7 +34,9 @@ export const jumpIgnoreFloor = [ 'MT45', 'MT46', 'MT47', - 'MT48' + 'MT48', + 'MT49', + 'MT50' ]; // 跳跃 export function jumpSkill() { diff --git a/src/plugin/shadow/gameShadow.ts b/src/plugin/shadow/gameShadow.ts index b027e38..87a4dfc 100644 --- a/src/plugin/shadow/gameShadow.ts +++ b/src/plugin/shadow/gameShadow.ts @@ -31,8 +31,49 @@ export default function init() { return { updateShadow, clearShadowCache, setCalShadow }; } -const shadowInfo: Partial> = {}; -const backgroundInfo: Partial> = {}; +const shadowInfo: Partial> = { + MT50: [ + { + id: 'mt50_1', + x: 144, + y: 144, + decay: 20, + r: 150, + color: '#ee995333', + noShelter: true + }, + { + id: 'mt50_2', + x: 336, + y: 144, + decay: 20, + r: 150, + color: '#ee995333', + noShelter: true + }, + { + id: 'mt50_2', + x: 336, + y: 336, + decay: 20, + r: 150, + color: '#ee995333', + noShelter: true + }, + { + id: 'mt50_2', + x: 144, + y: 336, + decay: 20, + r: 150, + color: '#ee995333', + noShelter: true + } + ] +}; +const backgroundInfo: Partial> = { + MT50: '#0006' +}; const blurInfo: Partial> = {}; const immersionInfo: Partial> = {}; const shadowCache: Partial> = {}; diff --git a/src/source/cls.d.ts b/src/source/cls.d.ts index 27e445c..3e7bffa 100644 --- a/src/source/cls.d.ts +++ b/src/source/cls.d.ts @@ -575,6 +575,11 @@ interface IdToCls { E645: 'enemys'; E646: 'enemys'; E647: 'enemys'; + T648: 'terrains'; + T649: 'terrains'; + T650: 'terrains'; + T651: 'terrains'; + T652: 'terrains'; X20032: 'tileset'; X20033: 'tileset'; X20034: 'tileset'; diff --git a/src/source/maps.d.ts b/src/source/maps.d.ts index b2214b8..d3c5913 100644 --- a/src/source/maps.d.ts +++ b/src/source/maps.d.ts @@ -575,6 +575,11 @@ interface IdToNumber { E645: 645; E646: 646; E647: 647; + T648: 648; + T649: 649; + T650: 650; + T651: 651; + T652: 652; X20032: 20032; X20033: 20033; X20034: 20034; @@ -1235,6 +1240,11 @@ interface NumberToId { 645: 'E645'; 646: 'E646'; 647: 'E647'; + 648: 'T648'; + 649: 'T649'; + 650: 'T650'; + 651: 'T651'; + 652: 'T652'; 20032: 'X20032'; 20033: 'X20033'; 20034: 'X20034'; diff --git a/vite.config.ts b/vite.config.ts index a78b9a2..10b0f1a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -26,7 +26,7 @@ export default defineConfig({ output: { manualChunks: { antdv: ['ant-design-vue', '@ant-design/icons-vue'], - common: ['lodash', 'axios', 'lz-string', 'chart.js', 'mutate-animate', 'three'] + common: ['lodash-es', 'axios', 'lz-string', 'chart.js', 'mutate-animate', 'three'] } } }