From 56cf1723a8e2bf8c4cb0ecf4743d1bf22e36a866 Mon Sep 17 00:00:00 2001 From: strawberry42271 <2806566736@qq.com> Date: Tue, 3 Jun 2025 20:52:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8A=E6=B3=A2=E6=8D=9F=E5=A4=B1=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=EF=BC=8C=E5=B0=8F=E8=8A=92=E8=AE=B0=E5=BE=97=E6=94=B9?= =?UTF-8?q?=E5=89=A7=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/floors/jiuguan.js | 24 ------------------------ project/functions.js | 13 ++++++++++++- project/plugins.js | 24 +++++++++++++++--------- 3 files changed, 27 insertions(+), 34 deletions(-) diff --git a/project/floors/jiuguan.js b/project/floors/jiuguan.js index 07f4309..523052a 100644 --- a/project/floors/jiuguan.js +++ b/project/floors/jiuguan.js @@ -26,30 +26,6 @@ main.floors.jiuguan= ], "direction": "down" } - ], - "4,10": [ - { - "type": "over", - "text": "这段话将在屏幕中心", - "image": "bg_5043.png", - "memory": false, - "time": 3000, - "hidetime": 30, - "sound": "", - "textColor": [ - 255, - 255, - 255, - 1 - ], - "boldColor": [ - 0, - 0, - 0, - 1 - ], - "font": "bold 48px Verdana" - } ] }, "changeFloor": {}, diff --git a/project/functions.js b/project/functions.js index 98db7b7..0554389 100644 --- a/project/functions.js +++ b/project/functions.js @@ -316,6 +316,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = } // 获得战斗伤害信息 var damageInfo = core.getDamageInfo(enemyId, null, x, y) || {}; + if ((!core.getFlag("noAnimate") || damageInfo.damage >= core.status.hero.hp) && (!main.replayChecking && !core.isReplaying())) await core.attackAnimate( enemyId, damageInfo.start[0], @@ -1032,7 +1033,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = } } //需要变更 - const onegcd = gcd(...oneTurn) //最大公约数 oneTurn = lcm(...oneTurn) //单次回合长度 //在这里处理equip的初始位置now @@ -1055,6 +1055,17 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = enemyinfo.now = 0 heroinfo.now = oneTurn / 2 } + let max = heroinfo.speed + if (enemyinfo.speed > max) max = enemyinfo.speed + equipInfo.forEach(v => { if (v.speed > max) max = v.speed }) + let i = 1 + while (oneTurn * i / max < 15) { + i++ + } + heroinfo.now *= i + enemyinfo.now *= i + equipInfo.forEach(v => { v.now *= i }) + oneTurn *= i const start = [core.clone(heroinfo), core.clone(enemyinfo), core.clone(equipInfo), oneTurn] //记录开始战斗时的属性并转发 //---第三部分:递归开始--- diff --git a/project/plugins.js b/project/plugins.js index 584c838..393c3c8 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -2896,8 +2896,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = if (!core.status.floorId || timestamp - now < 50) return now = timestamp; globalAlphafloor += globalAlphafloorStatus; - if (globalAlphafloor === 100) globalAlphafloorStatus = -2; - if (globalAlphafloor === 0) globalAlphafloorStatus = 2; + if (globalAlphafloor === 100) globalAlphafloorStatus = -4; + if (globalAlphafloor === 0) globalAlphafloorStatus = 4; if (core.domStyle.isVertical) { core.clearMap( @@ -3083,8 +3083,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.drawImage( uictx, "green.webp", - MAP_BLOCK_LEFT_VERTICAL + 42, - MAP_BLOCK_TOP_VERTICAL + 57 + MAP_BLOCK_LEFT_VERTICAL + 44, + MAP_BLOCK_TOP_VERTICAL + 57, 20, 20 ); uictx.globalAlpha = 1; } else { @@ -3095,7 +3095,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = uictx, "green.webp", MAP_BLOCK_LEFT + 50, - MAP_BLOCK_TOP + 57 + MAP_BLOCK_TOP + 60, 20, 20 ); uictx.globalAlpha = 1; } @@ -20061,13 +20061,13 @@ let time=0 "回合战斗动画": function () { // 在此增加新插件 - const ctx = core.createCanvas("animateAttack", 0, 0, 416, 416, 80) + const changeY = -30 let easy = false; const { imagelighter } = core.plugin.utils; const { lcm, gcd } = core.plugin.utils; - const anctx = core.createCanvas("animate2", 0, 0, 416, 416, 91) + let a = [] function drawAnimate(name, centerX, centerY) { @@ -20100,6 +20100,8 @@ let time=0 function animationFrame(callback1) { let time = 0 + const ctx = core.getContextByName("animateAttack") ?? core.createCanvas("animateAttack", 0, 0, 416, 416, 80) + const anctx = core.getContextByName("animate2") ?? core.createCanvas("animate2", 0, 0, 416, 416, 91) core.registerAnimationFrame("animate2", true, function (timestamp) { if ( timestamp - core.animateFrame.animate2Time < 50 || @@ -20174,6 +20176,9 @@ let time=0 heroanimateList, enemyanimateList ) { + + const ctx = core.getContextByName("animateAttack") ?? core.createCanvas("animateAttack", 0, 0, 416, 416, 80) + const anctx = core.getContextByName("animate2") ?? core.createCanvas("animate2", 0, 0, 416, 416, 91) //参数分别为怪物id、真实属性,战斗信息,特殊装备(如火焰风衣)属性特殊装备属性为以元组{equipId,oneDamage,speed,now:0}构成的数组(列出每个需要计算的特殊装备,没有则为空数组或不填) core.lockControl(); core.clearMap(ctx); @@ -20262,6 +20267,8 @@ let time=0 equipInfo.forEach(function (v) { if (v.onAttack) onAttack = true; }); + const ctx = core.getContextByName("animateAttack") ?? core.createCanvas("animateAttack", 0, 0, 416, 416, 80) + const anctx = core.getContextByName("animate2") ?? core.createCanvas("animate2", 0, 0, 416, 416, 91) core.clearMap(ctx); let animate = Math.floor(farme / 15); @@ -20926,8 +20933,7 @@ let time=0 } core.registerAnimationFrame("attackAnimate", true, (temptime) => { - if (!time) time = temptime - if (temptime - time < 50) return + time = temptime; drawAttackAnimate( heroInfo,