From bedc2089bec05e7e2b144f27270db0932862bdc5 Mon Sep 17 00:00:00 2001 From: JOJO <1498581755@qq.com> Date: Thu, 6 Aug 2026 14:50:12 +0800 Subject: [PATCH] =?UTF-8?q?=E9=92=A2=E7=90=B4Boss=E5=A4=A7=E6=BF=80?= =?UTF-8?q?=E5=85=89=E6=9C=80=E7=BB=88=E9=87=8D=E6=94=B9=EF=BC=9A=E6=9B=B4?= =?UTF-8?q?=E7=B2=97+=E6=89=A9=E5=8F=A3=E5=8D=8A=E5=9C=86+=E5=B9=B3?= =?UTF-8?q?=E6=BB=91=E8=93=84=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 大激光宽度从6改为14,明显粗于普通激光(w=4) - 发射口加入向下扩口半圆:arc(...,0,Math.PI),半径0→w*0.6随发射扩大 - 蓄力机制改为平滑增减:检测到玩家每帧+1(上限60),离开时每帧-1(下限0) - 蓄力圆环随进度自然缩放,离开时缓慢缩小直到消失(不瞬间清零) - bossBeam增加dur0字段保存初始持续时间,供扩口动画计算 --- star-raid/js/enemies.js | 16 ++++++++-------- star-raid/js/render.js | 6 ++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/star-raid/js/enemies.js b/star-raid/js/enemies.js index 7376642..d8ac5bd 100644 --- a/star-raid/js/enemies.js +++ b/star-raid/js/enemies.js @@ -210,7 +210,7 @@ function bossHit(x,y,r){ } function shuffled(n){const a=[];for(let i=0;i0;i--){const j=rndi(0,i),t=a[i];a[i]=a[j];a[j]=t;}return a;} function bossBeam(x1,y1,x2,y2,w,col,tele,dur,dmg,src){ // Boss光束:tele帧预警→dur帧伤害;src={b,ox,oy,followX2}时发射点跟随Boss - G.bbeams.push({x1,y1,x2,y2,w,col,tele,life:dur,dmg:dmg||20,cd:0,src:src||null}); + G.bbeams.push({x1,y1,x2,y2,w,col,tele,life:dur,dur0:dur,dmg:dmg||20,cd:0,src:src||null}); } function spawnFunnels(b,n){ // 夺权者X:蓝白长钉无人机(环绕僚机;定期脱离环绕摆阵型齐射) for(let i=0;i0; // 巨宽核心激光期间压制其他攻击 - // 钢琴:大炮塔惩罚激光——玩家站在炮塔水平正下方蓄力1秒后发射99999伤害大激光(不管上下远近,只管左右) + // 钢琴:大炮塔惩罚激光——玩家站在炮塔水平正下方蓄力后发射99999伤害大激光(不管上下远近,只管左右) if(b.idx===4&&!lck){ const off0=b.phase>=1?16:0,p=G.p; const leftX=b.x-(112+off0),rightX=b.x+(112+off0); if(p.dead<=0&&Math.abs(p.x-leftX)<14){ - b.pedLasL=(b.pedLasL||0)+1; - if(b.pedLasL>=60){bossBeam(leftX,b.y+10,leftX,H+8,6,"#ff3355",10,40,99999,{b,ox:-(112+off0),oy:10,followX2:true});b.pedLasL=0;SFX.warn();} - }else b.pedLasL=0; + b.pedLasL=Math.min(60,(b.pedLasL||0)+1); + if(b.pedLasL>=60){bossBeam(leftX,b.y+10,leftX,H+8,14,"#ff3355",10,40,99999,{b,ox:-(112+off0),oy:10,followX2:true});b.pedLasL=0;SFX.warn();} + }else b.pedLasL=Math.max(0,(b.pedLasL||0)-1); if(p.dead<=0&&Math.abs(p.x-rightX)<14){ - b.pedLasR=(b.pedLasR||0)+1; - if(b.pedLasR>=60){bossBeam(rightX,b.y+10,rightX,H+8,6,"#ff3355",10,40,99999,{b,ox:(112+off0),oy:10,followX2:true});b.pedLasR=0;SFX.warn();} - }else b.pedLasR=0; + b.pedLasR=Math.min(60,(b.pedLasR||0)+1); + if(b.pedLasR>=60){bossBeam(rightX,b.y+10,rightX,H+8,14,"#ff3355",10,40,99999,{b,ox:(112+off0),oy:10,followX2:true});b.pedLasR=0;SFX.warn();} + }else b.pedLasR=Math.max(0,(b.pedLasR||0)-1); } // —— 主攻击 —— b.mainT--; diff --git a/star-raid/js/render.js b/star-raid/js/render.js index 7b0655b..454552a 100644 --- a/star-raid/js/render.js +++ b/star-raid/js/render.js @@ -224,6 +224,12 @@ function drawBossFx(){ ctx.beginPath();ctx.moveTo(bm.x1,bm.y1);ctx.lineTo(bm.x2,bm.y2);ctx.stroke();ctx.globalAlpha=1;}} else{ctx.globalCompositeOperation="lighter"; ctx.globalAlpha=clamp(bm.life/10,0,1)*0.85; + // 大激光起点扩口半圆(发射时较小然后扩大) + if(bm.dmg>=90000){const pR=Math.min(bm.w*0.7,bm.w*0.6*(1-bm.life/(bm.dur0||1))); + if(pR>0.5){ctx.fillStyle=bm.col; + ctx.beginPath();ctx.arc(bm.x1,bm.y1,pR,0,Math.PI);ctx.fill(); + ctx.strokeStyle="#fff";ctx.lineWidth=Math.max(1,pR/3); + ctx.beginPath();ctx.arc(bm.x1,bm.y1,pR,0,Math.PI);ctx.stroke();}} ctx.strokeStyle=bm.col;ctx.lineWidth=bm.w; ctx.beginPath();ctx.moveTo(bm.x1,bm.y1);ctx.lineTo(bm.x2,bm.y2);ctx.stroke(); ctx.strokeStyle="#fff";ctx.lineWidth=Math.max(1,bm.w/3);