From 0ec0dc1c53860024ac8870cdb11a9a8c48fbc27b Mon Sep 17 00:00:00 2001 From: strawberry42271 <2806566736@qq.com> Date: Wed, 30 Apr 2025 00:03:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=98=E8=AF=BB=E6=A1=A3?= =?UTF-8?q?=E5=8F=8A=E5=8A=A8=E7=94=BBbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _server/editor_uievent.js | 4 +- libs/control.js | 1 + libs/ui.js | 4 +- project/data.js | 2 +- project/floors/jiaocheng02.js | 23 --- project/functions.js | 8 +- project/plugins.js | 326 +++++++++++++++++++++------------- 7 files changed, 219 insertions(+), 149 deletions(-) diff --git a/_server/editor_uievent.js b/_server/editor_uievent.js index 6f064fb..741457c 100644 --- a/_server/editor_uievent.js +++ b/_server/editor_uievent.js @@ -587,12 +587,12 @@ editor_uievent_wrapper = function (editor) { var disabled = _isTileset && value.indexOf(one) >= 0 ? 'disabled' : '' html += ` ${one}`; // 预览图片 - if (one.endsWith('.png') || one.endsWith('.jpg') || one.endsWith('.jpeg') || one.endsWith('.gif')) { + if (one.endsWith('.png') || one.endsWith('.jpg') || one.endsWith('.jpeg') || one.endsWith('.gif')||one.endsWith('.webp')) { html += ""; html += '
'; } // 试听音频 - if (one.endsWith('.mp3') || one.endsWith('.ogg') || one.endsWith('.wav') || one.endsWith('.m4a') || one.endsWith('.flac')) { + if (one.endsWith('.mp3') || one.endsWith('.ogg') || one.endsWith('.wav') || one.endsWith('.m4a') || one.endsWith('.flac')||one.endsWith('.opus')) { html += "" html += " 音调:"; html += `0:00 / 0:00
diff --git a/libs/control.js b/libs/control.js index 93b4a0a..f7fa011 100644 --- a/libs/control.js +++ b/libs/control.js @@ -2489,6 +2489,7 @@ control.prototype.checkAutosave = function () { ////// 实际进行存读档事件 ////// control.prototype.doSL = function (id, type) { + switch (type) { case "save": this._doSL_save(id); diff --git a/libs/ui.js b/libs/ui.js index bcead0e..182a9e0 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -1269,7 +1269,9 @@ ui.prototype._drawTextContent_drawChar = function (tempCtx, content, config, ch) // 输出 var left = config.offsetX, top = config.offsetY + config.topMargin; - core.fillText(tempCtx, ch, left, top); + tempCtx.lineWidth = 2; + tempCtx.strokeText( ch, left, top); + tempCtx.fillText( ch, left, top); config.blocks.push({ left: config.offsetX, top: config.offsetY, width: charwidth, height: config.currfont + config.lineMargin, diff --git a/project/data.js b/project/data.js index 9457803..bb1d6e1 100644 --- a/project/data.js +++ b/project/data.js @@ -2124,7 +2124,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "animateSpeed": 300, "moveSpeed": 100, "statusCanvasRowsOnMobile": 3, - "floorChangeTime": 0, + "floorChangeTime": 500, "yellowGem": 2 }, "flags": { diff --git a/project/floors/jiaocheng02.js b/project/floors/jiaocheng02.js index 7990160..8cea02c 100644 --- a/project/floors/jiaocheng02.js +++ b/project/floors/jiaocheng02.js @@ -284,29 +284,6 @@ main.floors.jiaocheng02= "type": "hide", "remove": true } - ], - "3,8": [ - { - "type": "animationDrawable", - "allFarme": 30, - "color": [ - 0, - 0, - 0 - ], - "imageList": [ - { - "image": "" - } - ], - "soundList": [ - { - "sound": "", - "startfarme": 0, - "stopbefore": false - } - ] - } ] }, "changeFloor": { diff --git a/project/functions.js b/project/functions.js index fc50b74..67c2734 100644 --- a/project/functions.js +++ b/project/functions.js @@ -145,7 +145,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = // ---------- 重绘新地图;这一步将会设置core.status.floorId ---------- // core.drawMap(floorId); - // 切换楼层BGM if (core.status.maps[floorId].bgm) { var bgm = core.status.maps[floorId].bgm; @@ -190,14 +189,16 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = } else { // 每次抵达楼层执行的事件 core.insertAction(core.floors[floorId].eachArrive); - core.ui.statusBar._update_map(); + // 首次抵达楼层时执行的事件(后插入,先执行) if (!core.hasVisitedFloor(floorId)) { core.insertAction(core.floors[floorId].firstArrive); core.visitFloor(floorId); core.plugin.bfs(); } + } + if (!core.isReplaying()) core.plugin.drawCommentSign() }, "flyTo": function (toId, callback) { @@ -1760,13 +1761,14 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = } }, "updateStatusBar": function () { - if (!core.control.noAutoEvents) core.checkAutoEvents() + // 更新状态栏 core.ui.statusBar.update(); // 更新阻激夹域的伤害值 core.updateCheckBlock(); // 更新全地图显伤 core.updateDamage(); + }, "updateCheckBlock": function (floorId) { // 领域、夹击、阻击等的伤害值计算 diff --git a/project/plugins.js b/project/plugins.js index cc38544..5493ef4 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -2828,8 +2828,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = const ctx = core.dymCanvas[name], canvas = ctx.canvas; const ratio = canvas.hasAttribute("isHD") ? core.domStyle.ratio : 1; - canvas.style.width = (innerSize / ratio) * core.domStyle.scale + "px"; - canvas.style.height = (innerSize / ratio) * core.domStyle.scale + "px"; + canvas.style.width = core.__PIXELS__ * core.domStyle.scale + "px"; + canvas.style.height = core.__PIXELS__ * core.domStyle.scale + "px"; canvas.style.left = parseFloat(canvas.getAttribute("_left")) * core.domStyle.scale + "px"; canvas.style.top = @@ -2956,6 +2956,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = _resize_canvas(obj); if (core.status.automaticRoute == null) core.status.automaticRoute = {}; + + core.updateStatusBar(); if (main.dom.CGUI && main.dom.CGUI.style.display === "block") core.ui.CG.update(); @@ -3021,6 +3023,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } _redrawMap() { if (core.domStyle.isVertical) { + core.clearMap( uictx, MAP_BLOCK_LEFT_VERTICAL, @@ -3747,10 +3750,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = 31 * 3, 31 * 3, ]); - if (core.status.lockControl || core.isMoving()) return; + if (core.isReplaying()) { this.replayAction[col][row].call(core); } else if (core.isPlaying()) { + if (core.status.lockControl || core.isMoving()) return; if (col === 0 && row === 3) { core.doSL("autoSave", "load"); } else if (col === 1 && row === 3) { @@ -3834,10 +3838,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = 31 * 3, 31 * 3, ]); - if (core.status.lockControl || core.isMoving()) return; + if (core.isReplaying()) { this.replayAction[col][row].call(core); } else if (core.isPlaying()) { + if (core.status.lockControl || core.isMoving()) return; if (col === 0 && row === 3) { core.doSL("autoSave", "load"); } else if (col === 1 && row === 3) { @@ -15606,6 +15611,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }, "滑动转场": function () { // 在此增加新插件 + const defaultChange = { left: "leftPortal", // 左箭头 up: "upPortal", // 上箭头 @@ -15625,14 +15631,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }; let allChangeEntries = Object.entries(defaultChange); const move = document.createElement("canvas"); - const speed = 12; - let modedata = 0; + const move2 = document.createElement("canvas"); - move.width = 1248; - move.height = 1248; + move.width = 416; + move.height = 416; + move2.width = 416; + move2.height = 416; const ctx = move.getContext("2d"); - + const ctx2 = move2.getContext("2d"); events.prototype.changeFloor = function ( floorId, stair, @@ -15661,6 +15668,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = this._changeFloor_beforeChange(info, block, callback); }; + const { Animation, linear, bezier, circle, hyper, trigo, power, inverseTrigo, shake, sleep } = core.plugin.animate + events.prototype._changeFloor_beforeChange = function ( info, block, @@ -15689,95 +15698,100 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ); const v = dirData[dir][1], // 水平数值 h = dirData[dir][0]; //竖直数值 - ctx.clearRect(0, 0, 1248, 1248); + ctx.clearRect(0, 0, 416, 416); + ctx2.clearRect(0, 0, 416, 416); core.drawThumbnail(core.status.floorId, null, { damage: data.damage, ctx: ctx, - x: 416, - y: 416, + x: 0, + y: 0, size: 1, all: data.all, }); if (dir !== "upFloor" && dir !== "downFloor") { core.drawThumbnail(toFloorId, null, { damage: dataTo.damage, - ctx: ctx, - x: 416 + 416 * v, - y: 416 + 416 * h, + ctx: ctx2, + x: 0, + y: 0, size: 1, all: dataTo.all, }); - var _run = function () { - var cb = function () { - modedata = 0; - core.clearUI(); - core.clearMap("data"); + const changefloor = async function () { + const animate = new Animation() + const change = core.createCanvas("change", 0, 0, 416, 416, 100) + change.canvas.style.width = core.__PIXELS__ * core.domStyle.scale + "px" + change.canvas.style.height = core.__PIXELS__ * core.domStyle.scale + "px" + + const fn = () => { + + + const x1 = -animate.x * v; + const y1 = -animate.x * h + const x2 = (416 - animate.x) * v; + const y2 = (416 - animate.x) * h; + + + let status = animate.x > 208 ? "rightFoot" : "leftFoot"; + + + const img = core.material.images.hero; + const heroIconArr = core.material.icons.hero; + const width = core.material.icons.hero.width || 32; + const height = core.material.icons.hero.height; + const heroIcon = heroIconArr[dir]; + const imgx = (heroIcon[status] % 4) * width, + imgy = heroIcon.loc * height, + x = core.status.hero.loc.x * 32 - + core.bigmap.offsetX - + (animate.x - (animate.x * 32) / 416) * v, + y = core.status.hero.loc.y * 32 - + 16 - + (animate.x - (animate.x * 32) / 416) * h; + const ctx3 = core.dymCanvas.change + core.clearMap(ctx3) + core.fillRect(ctx3, x1, + y1, 416, 416) + ctx3.drawImage( + move, + 0, 0, 416, 416, + x1, + y1, 416, 416 + + ); + + ctx3.drawImage( + move2, + 0, 0, 416, 416, + x2, + y2, + 416, 416 + ); + ctx3.drawImage( + img, + imgx, imgy, + width, + height, + x, y, + width, + height + ); + } + animate.ticker.add(fn) + + animate.mode(linear()).time(core.values.floorChangeTime).move(416, 0) + await animate.all(); + animate.ticker.destroy() + + window.setTimeout(function () { core.events._changeFloor_changing(info, callback); - }; + core.clearMap(change) + }, 25) - var animate = window.setInterval( - function () { - if (modedata >= 416) { - delete core.animateFrame.asyncId[animate]; - clearInterval(animate); - cb(); - } else { - core.clearUI(); - core.clearMap("data"); + } + changefloor() - core.canvas.data.drawImage( - move, - 416 + modedata * v, - 416 + modedata * h, - 416, - 416, - 0, - 0, - 416, - 416 - ); - let status = "leftFoot"; - - if (modedata > 208) { - status = "rightFoot"; - } - const img = core.material.images.hero; - const heroIconArr = core.material.icons.hero; - const width = core.material.icons.hero.width || 32; - const height = core.material.icons.hero.height; - const heroIcon = heroIconArr[dir]; - - core.canvas.data.drawImage( - img, - (heroIcon[status] % 4) * width, - heroIcon.loc * height, - width, - height, - core.status.hero.loc.x * 32 - - core.bigmap.offsetX - - (modedata - (modedata * 32) / 416) * v, - core.status.hero.loc.y * 32 - - 16 - - (modedata - (modedata * 32) / 416) * h, - width, - height - ); - modedata += speed; - clearInterval(animate); - delete core.animateFrame.asyncId[animate]; - _run(); - } - }, - core.status.replay.speed == 24 ? - 1 : - 10 / core.status.replay.speed - ); - - core.animateFrame.lastAsyncId = animate; - core.animateFrame.asyncId[animate] = cb; - }; - _run(); return; } } @@ -19688,6 +19702,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = let now = 0; let start = 0 + let sounds = [] core.registerAnimationFrame( "animationDrawable", @@ -19790,10 +19805,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = one.sound && core.sounds[one.sound] && core.musicStatus.soundStatus; - if (farme >= one.startfarme && lisen && !one.start) { + if (farme >= one.startfarme && lisen && !one.start && sounds.includes(farme)) { one.start = true if (one.stopbefore) core.stopSound(); core.playSound(one.sound); + sounds.includes(farme) } }); ctx.globalAlpha = 1; @@ -21429,6 +21445,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = "start": 0, "pause": false, "pausetime": 0, + 'sounds': [], "index": 0, }); @@ -21476,7 +21493,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = obj.animate, core.status.heroCenter.px, core.status.heroCenter.py, - obj.index + obj.index, + obj.sounds ); } else { core.maps._drawAnimateFrame( @@ -21484,7 +21502,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = obj.animate, obj.centerX, obj.centerY, - obj.index + obj.index, + obj.sounds ); } }); @@ -23648,7 +23667,34 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = return; }; + control.prototype._doSL_replayLoad_afterGet = function (id, data) { + if (!data) { + core.playSound("操作失败"); + return core.drawTip("无效的存档"); + } + if (data.version != core.firstData.version) { + core.playSound("操作失败"); + return core.drawTip("存档版本不匹配"); + } + if (data.hero.flags.__events__ && data.guid != core.getGuid()) { + core.playSound("操作失败"); + return core.drawTip("此存档可能存在风险,无法读档"); + } + var route = core.subarray(core.status.route, core.decodeRoute(data.route)); + if (route == null) { + core.playSound("操作失败"); + return core.drawTip("无法从此存档回放录像"); + } + core.closePanel() + core.loadData(data, function () { + core.removeFlag("__fromLoad__"); + core.startReplay(route); + core.drawTip("回退到存档节点"); + }); + }; + function saveLoadclick(x, y) { //点击画布(x,y)触发的效果 + debugger const makeBox = ([x, y], [w, h]) => { //创建点击检测区域 return [ [x, y], @@ -23796,47 +23842,44 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = choose = false let a = Math.ceil((y - 224) / 100) let real_id = 9 * page + a - if (real_id == index) { - if (core.status.event.data.mode === "fav") { - real_id = core.saves.favorite[a - 1] - } - if (core.status.event.data.mode !== "fav" && core.status.event.data.mode !== "all") { - real_id = core.saves[core.status.event.data.mode][a - 1] - } + if (core.status.event.data.mode === "fav") { + real_id = core.saves.favorite[9 * page + a - 1] + } + if (core.status.event.data.mode !== "fav" && core.status.event.data.mode !== "all") { + real_id = core.saves[core.status.event.data.mode][9 * page + a - 1] + } + if (10 * page + a == index) { + + core.saveLoad.setId(real_id) + core.doSL(real_id, core.status.event.id) return } else { - if (core.status.event.data.mode === "fav") { - real_id = core.saves.favorite[a - 1] - } - if (core.status.event.data.mode !== "fav" && core.status.event.data.mode !== "all") { - real_id = core.saves[core.status.event.data.mode][a - 1] - } + + core.saveLoad.setId(real_id) } core.ui._drawSLPanel(10 * page + a) + return; } if (inRect(pos, save9box)) { choose = false let real_id = 9 * page + 9 - if (real_id == index) { - if (core.status.event.data.mode === "fav") { - real_id = core.saves.favorite[9 * page + 8] - } - if (core.status.event.data.mode !== "fav" && core.status.event.data.mode !== "all") { - real_id = core.saves[core.status.event.data.mode][9 * page + 8] - } + if (core.status.event.data.mode === "fav") { + real_id = core.saves.favorite[9 * page + 8] + } + if (core.status.event.data.mode !== "fav" && core.status.event.data.mode !== "all") { + real_id = core.saves[core.status.event.data.mode][9 * page + 8] + } + if (10 * page + 9 == index) { + core.saveLoad.setId(real_id) core.doSL(real_id, core.status.event.id) return } else { - real_id = core.saves.favorite[9 * page + 8] - if (core.status.event.data.mode !== "fav" && core.status.event.data.mode !== "all") { - real_id = core.saves[core.status.event.data.mode][9 * page + 8] - } core.saveLoad.setId(real_id) } @@ -23882,7 +23925,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.myprompt("请输入想要显示的存档名(长度不超过5字符)", null, function (value) { if (value && value.length <= 5) { + core.saves.favoriteName[real_id] = value; + + + core.setLocalStorage("_saveName", core.saves.favoriteName) core.control._updateFavoriteSaves(); core.ui._drawSLPanel(10 * page + offset); } else if (value) { @@ -23965,6 +24012,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.saves.favorite = core.saves.favorite.sort(function (a, b) { return a - b; }); // 保证有序 } + core.control._updateFavoriteSaves() core.ui._drawSLPanel(index); return @@ -24158,11 +24206,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = for (let i = 1; i < 9; i++) { core.setLocalStorage("class_" + i, core.saves["class_" + i]) } + core.setLocalStorage("favoriteName", core.saves.favoriteName); }; ////// 绘制存档/读档界面 ////// ui.prototype._drawSLPanel = function (index, refresh) { - core.control._updateFavoriteSaves() + core.control._loadClassSaves(); core.control._loadFavoriteSaves(); @@ -24460,8 +24509,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ui.prototype._drawSLPanel_loadSave = function (page, callback) { var ids = [0]; - for (var i = 1; i <= 10; ++i) { - var id = 10 * page + i; + for (var i = 1; i <= 9; ++i) { + var id = 9 * page + i; if (core.status.event.data.mode == 'fav') id = core.saves.favorite[id - 1]; // 因为favorite第一个不是自动存档 所以要偏移1 if (core.status.event.data.mode !== 'fav' && core.status.event.data.mode !== "all") @@ -25688,7 +25737,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = for (var i = 0; i < core.status.animateObjs.length; i++) { var obj = core.status.animateObjs[i]; if (obj.pause) obj.pausetime += frametime - if (obj.start === 0) obj.start = core.animateFrame.animateTime + if (obj.start === 0) { + obj.sounds = [] + obj.start = core.animateFrame.animateTime + } obj.index = Math.floor((core.animateFrame.animateTime - obj.start - obj.pausetime) / (1000 / 60)) if (obj.reverse) obj.index = obj.animate.frames.length - obj.index if ((!obj.reverse && obj.index >= obj.animate.frames.length) || (obj.reverse && obj.index <= 0)) { @@ -25696,9 +25748,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = if (obj.reverse) { obj.index = obj.animate.frames.length obj.start = core.animateFrame.animateTime + obj.sounds = [] obj.pausetime = 0 } else { obj.start = core.animateFrame.animateTime + obj.sounds = [] obj.index = 0 obj.pausetime = 0 } @@ -25731,12 +25785,13 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = const heroy = core.status.hero.loc.y * 32 + 32 + sy - core.material.icons.hero.height / 2; core.status.animateObjs.forEach(function (obj) { + if (obj.hero) { - core.maps._drawAnimateFrame('animate', obj.animate, herox, heroy, obj.index); + core.maps._drawAnimateFrame('animate', obj.animate, herox, heroy, obj.index, obj.sounds); } else { - core.maps._drawAnimateFrame('animate', obj.animate, tran.value[obj.id + obj.name + "x"], tran.value[obj.id + obj.name + "y"], obj.index); + core.maps._drawAnimateFrame('animate', obj.animate, tran.value[obj.id + obj.name + "x"], tran.value[obj.id + obj.name + "y"], obj.index, obj.sounds); } }); } @@ -25760,12 +25815,13 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = centerX += core.bigmap.offsetX; centerY += core.bigmap.offsetY; } + var id = setTimeout(null); animate.se = animate.se || {}; if (typeof animate.se == 'string') animate.se = { 1: animate.se }; tran.mode(linear()).time(1).absolute() tran.value[id + name + "x"] = centerX tran.value[id + name + "y"] = centerY - var id = setTimeout(null); + core.status.animateObjs.push({ "name": name, "id": id, @@ -25776,6 +25832,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = "pause": false, "pausetime": 0, "index": 0, + 'sounds': [], "callback": callback }); @@ -25815,6 +25872,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = "loop": loop, "pausetime": 0, "index": 0, + 'sounds': [], "callback": callback }) else core.status.animateObjs.push({ @@ -25829,6 +25887,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = "loop": loop, "pausetime": 0, "index": 0, + 'sounds': [], "callback": callback }); @@ -25862,6 +25921,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = "pause": false, "pausetime": 0, "index": 0, + 'sounds': [], "callback": callback }); @@ -25877,11 +25937,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ////// 绘制动画的某一帧 ////// - maps.prototype._drawAnimateFrame = function (name, animate, centerX, centerY, index) { + maps.prototype._drawAnimateFrame = function (name, animate, centerX, centerY, index, sounds) { var ctx = core.getContextByName(name); if (!ctx) return; var frame = animate.frames[index % animate.frame]; - core.playSound((animate.se || {})[index % animate.frame + 1], (animate.pitch || {})[index % animate.frame + 1]); + if (!sounds.includes(index)) { + core.playSound((animate.se || {})[index % animate.frame + 1], (animate.pitch || {})[index % animate.frame + 1]); + sounds.push(index) + } var ratio = animate.ratio; frame.forEach(function (t) { var image = animate.images[t.index]; @@ -26033,6 +26096,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = reverse: reverse, pausetime: 0, farme: 0, + sounds: [] }; core.plugin.playing.add(data); @@ -26085,10 +26149,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = one.farme = data.allFarme one.start = thistime one.pausetime = 0 + one.sounds = [] } else { one.start = thistime one.farme = 0 one.pausetime = 0 + one.sounds = [] } } } @@ -26223,9 +26289,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = sound.sound && core.material.sounds[sound.sound] && core.musicStatus.soundStatus; - if (one.farme == sound.startfarme && lisen) { + if (one.farme == sound.startfarme && lisen && one.sounds.includes(one.farme)) { if (sound.stopbefore) core.stopSound(); core.playSound(sound.sound); + one.sounds.push(one.farme) } }); @@ -26233,5 +26300,26 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }); }); +}, + "任务系统": function () { +// 在此增加新插件 +this.task = { //任务总表(键名和id后期改为"floorId+'.'+npc+'.'+Number"的格式,即“楼层名.npc名.任务序号”) + 1: { id: 1, name: "寻找丢失的钱袋", text: "梅尔森的钱袋被小偷偷走了,去找到小偷并拿回梅尔森的钱袋", type: "物品" } +} + +this.taskAccept = function (id) { //任务接取 + let accept = core.getFlag("accept") ?? []; //正在进行任务 + let success = core.getFlag("success") ?? []; //已提交任务 + let nocontinue = false + accept.forEach(v => { if (v.id === id) nocontinue = ture }) + success.forEach(v => { if (v.id === id) nocontinue = ture }) + if (nocontinue) return //已接取或已完成该任务return + let task = this.task[id] //获取任务内容 + switch (task.type) { + case "物品": + + break; + } +} } } \ No newline at end of file