钢琴Boss大炮塔:蓄力/消退拆分为独立字段,消退期不显示圆环

- pedLasL(0-60)专门管蓄力,pedLasLCd(300→0)专门管消退倒计时
- 蓄力满60发射激光,发射后pedLasL清0,pedLasLCd置300开始5秒消退
- 消退期间每帧-1,不检测玩家,不显示蓄力圆环
- 消退结束后pedLasLCd=0,才重新允许检测玩家是否在炮塔下方
This commit is contained in:
JOJO 2026-08-06 15:01:13 +08:00
parent b8df012c4d
commit 4ea33f42d9
2 changed files with 18 additions and 24 deletions

View File

@ -45,9 +45,9 @@ function drawPiano(b,t,fl,split){
circ(px2,2,5.5,"#5a1a1a");circ(px2-1.5,0,2.5,"#8a2a2a");
px(px2-1.5,4,3,8,"#1b2434");
px(px2-1,10,2,3,"#ff3355");
// 大激光蓄力/消退圆环:蓄力期(1-60)逐渐变大,消退期(61-360)保持最大最后回0消失
// 大激光蓄力圆环:仅在蓄力阶段(1-59)显示,消退期不显示
const raw=sd<0?(b.pedLasL||0):(b.pedLasR||0);
if(raw>0){const a=Math.min(raw/60,1);
if(raw>0&&raw<60){const a=raw/60;
ctx.globalAlpha=0.3+0.55*a;ctx.strokeStyle="#ff3355";ctx.lineWidth=1.5;
ctx.beginPath();ctx.arc(px2,14,2+3.5*a,0,TAU);ctx.stroke();
ctx.globalAlpha=0.22*a;ctx.fillStyle="#ff3355";

View File

@ -350,32 +350,26 @@ function updateBoss(){
}
}
const lck=(b.laserT||0)>0; // 巨宽核心激光期间压制其他攻击
// 钢琴:大炮塔惩罚激光——三态:蓄力(1-60)→发射→消退(61-360)→空闲(0)
// 钢琴:大炮塔惩罚激光——蓄力与消退分离蓄力pedLasL(0-60) + 消退pedLasLCd(300→0)
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);
// 左炮
const l=b.pedLasL||0;
if(l===0&&p.dead<=0&&Math.abs(p.x-leftX)<14){
b.pedLasL=1;
}else if(l>0&&l<60){
// 左炮:消退倒计时优先
if((b.pedLasLCd||0)>0){b.pedLasLCd=b.pedLasLCd-1;}
else{const l=b.pedLasL||0;
if(l===0&&p.dead<=0&&Math.abs(p.x-leftX)<14){b.pedLasL=1;}
else if(l>0&&l<60){
if(p.dead<=0&&Math.abs(p.x-leftX)<14)b.pedLasL=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=360;SFX.warn();}
}else if(l>=60){
b.pedLasL=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();}}}
// 右炮
const r=b.pedLasR||0;
if(r===0&&p.dead<=0&&Math.abs(p.x-rightX)<14){
b.pedLasR=1;
}else if(r>0&&r<60){
if((b.pedLasRCd||0)>0){b.pedLasRCd=b.pedLasRCd-1;}
else{const r=b.pedLasR||0;
if(r===0&&p.dead<=0&&Math.abs(p.x-rightX)<14){b.pedLasR=1;}
else if(r>0&&r<60){
if(p.dead<=0&&Math.abs(p.x-rightX)<14)b.pedLasR=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=360;SFX.warn();}
}else if(r>=60){
b.pedLasR=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();}}}
}
// —— 主攻击 ——
b.mainT--;