钢琴Boss大激光最终修正:5秒持续时间+fill实心完美对接

- 激光持续时间从40帧改为300帧(5秒),匹配用户要求的'持续5秒后消退'
- 大激光绘制改用fill实心风格:
  - 上半圆fill:圆心(bm.x1, bm.y1+pR),顶部=炮口bm.y1,底部直径=bm.y1+pR
  - 矩形fillRect:从半圆底部bm.y1+pR开始向下,宽度=直径bm.w,和半圆完美对接
  - 白边fillRect:窄矩形在主体内
- 彻底去掉stroke描边弧线,消除弧线描边在不同位置的展开差异导致的缝隙
This commit is contained in:
JOJO 2026-08-06 15:07:38 +08:00
parent 4ea33f42d9
commit f7e41d3419
2 changed files with 12 additions and 11 deletions

View File

@ -361,7 +361,7 @@ function updateBoss(){
else if(l>0&&l<60){ else if(l>0&&l<60){
if(p.dead<=0&&Math.abs(p.x-leftX)<14)b.pedLasL=l+1; if(p.dead<=0&&Math.abs(p.x-leftX)<14)b.pedLasL=l+1;
else b.pedLasL=Math.max(0,l-1); else b.pedLasL=Math.max(0,l-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;b.pedLasLCd=300;SFX.warn();}}} if(b.pedLasL>=60){bossBeam(leftX,b.y+10,leftX,H+8,14,"#ff3355",10,300,99999,{b,ox:-(112+off0),oy:10,followX2:true});b.pedLasL=0;b.pedLasLCd=300;SFX.warn();}}}
// 右炮 // 右炮
if((b.pedLasRCd||0)>0){b.pedLasRCd=b.pedLasRCd-1;} if((b.pedLasRCd||0)>0){b.pedLasRCd=b.pedLasRCd-1;}
else{const r=b.pedLasR||0; else{const r=b.pedLasR||0;
@ -369,7 +369,7 @@ function updateBoss(){
else if(r>0&&r<60){ else if(r>0&&r<60){
if(p.dead<=0&&Math.abs(p.x-rightX)<14)b.pedLasR=r+1; if(p.dead<=0&&Math.abs(p.x-rightX)<14)b.pedLasR=r+1;
else b.pedLasR=Math.max(0,r-1); else b.pedLasR=Math.max(0,r-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;b.pedLasRCd=300;SFX.warn();}}} if(b.pedLasR>=60){bossBeam(rightX,b.y+10,rightX,H+8,14,"#ff3355",10,300,99999,{b,ox:(112+off0),oy:10,followX2:true});b.pedLasR=0;b.pedLasRCd=300;SFX.warn();}}}
} }
// —— 主攻击 —— // —— 主攻击 ——
b.mainT--; b.mainT--;

View File

@ -224,16 +224,17 @@ function drawBossFx(){
ctx.beginPath();ctx.moveTo(bm.x1,bm.y1);ctx.lineTo(bm.x2,bm.y2);ctx.stroke();ctx.globalAlpha=1;}} ctx.beginPath();ctx.moveTo(bm.x1,bm.y1);ctx.lineTo(bm.x2,bm.y2);ctx.stroke();ctx.globalAlpha=1;}}
else{ctx.globalCompositeOperation="lighter"; else{ctx.globalCompositeOperation="lighter";
ctx.globalAlpha=clamp(bm.life/10,0,1)*0.85; ctx.globalAlpha=clamp(bm.life/10,0,1)*0.85;
// 大激光起点扩口半圆:弧线描边风格与激光线完全一致(粗主色弧+细白边弧) if(bm.dmg>=90000){ // 大激光fill实心上半圆+fillRect实心矩形边缘完美对接
if(bm.dmg>=90000){const pR=bm.w*0.5; const pR=bm.w*0.5;
ctx.strokeStyle=bm.col;ctx.lineWidth=bm.w; ctx.fillStyle=bm.col;
ctx.beginPath();ctx.arc(bm.x1,bm.y1+pR,pR,Math.PI,0);ctx.stroke(); ctx.beginPath();ctx.arc(bm.x1,bm.y1+pR,pR,0,Math.PI,true);ctx.fill(); // 上半圆:顶部=炮口bm.y1底部直径=bm.y1+pR
ctx.fillRect(bm.x1-pR,bm.y1+pR,bm.w,bm.y2-(bm.y1+pR)); // 矩形:从半圆底部向下,宽=直径
ctx.fillStyle="#fff";
ctx.fillRect(bm.x1-pR/3,bm.y1+pR,pR*2/3,bm.y2-(bm.y1+pR));} // 白边窄矩形
else{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); ctx.strokeStyle="#fff";ctx.lineWidth=Math.max(1,bm.w/3);
ctx.beginPath();ctx.arc(bm.x1,bm.y1+pR,pR,Math.PI,0);ctx.stroke();} ctx.beginPath();ctx.moveTo(bm.x1,bm.y1);ctx.lineTo(bm.x2,bm.y2);ctx.stroke();}
ctx.strokeStyle=bm.col;ctx.lineWidth=bm.w;
ctx.beginPath();ctx.moveTo(bm.x1,bm.y1+bm.w);ctx.lineTo(bm.x2,bm.y2);ctx.stroke();
ctx.strokeStyle="#fff";ctx.lineWidth=Math.max(1,bm.w/3);
ctx.beginPath();ctx.moveTo(bm.x1,bm.y1+bm.w);ctx.lineTo(bm.x2,bm.y2);ctx.stroke();
ctx.globalAlpha=1;ctx.globalCompositeOperation="source-over";} ctx.globalAlpha=1;ctx.globalCompositeOperation="source-over";}
} }
} }