钢琴Boss大炮塔:蓄力发射后进入5秒消退期,期间不重复检测

- 三态状态机:空闲(0)→蓄力(1-60)→发射+消退(61-360)→空闲(0)
- 蓄满60帧发射激光,随后进入300帧(5秒)消退倒计时
- 消退期间不检测玩家位置,圆环保持满状态显示
- 倒计时结束后才重新允许检测玩家是否在炮塔下方
This commit is contained in:
JOJO 2026-08-06 14:58:17 +08:00
parent 2d26af9958
commit 90ee0ea0f9
2 changed files with 26 additions and 12 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"); 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.5,4,3,8,"#1b2434");
px(px2-1,10,2,3,"#ff3355"); px(px2-1,10,2,3,"#ff3355");
// 大激光蓄力前摇:画在炮塔口下方的蓄力圆(与小激光琴键蓄力圆同源,换色赤红) // 大激光蓄力/消退圆环:蓄力期(1-60)逐渐变大,消退期(61-360)保持最大最后回0消失
const prog=sd<0?((b.pedLasL||0)/60):((b.pedLasR||0)/60); const raw=sd<0?(b.pedLasL||0):(b.pedLasR||0);
if(prog>0){const a=Math.min(prog,1); if(raw>0){const a=Math.min(raw/60,1);
ctx.globalAlpha=0.3+0.55*a;ctx.strokeStyle="#ff3355";ctx.lineWidth=1.5; 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.beginPath();ctx.arc(px2,14,2+3.5*a,0,TAU);ctx.stroke();
ctx.globalAlpha=0.22*a;ctx.fillStyle="#ff3355"; ctx.globalAlpha=0.22*a;ctx.fillStyle="#ff3355";

View File

@ -350,18 +350,32 @@ function updateBoss(){
} }
} }
const lck=(b.laserT||0)>0; // 巨宽核心激光期间压制其他攻击 const lck=(b.laserT||0)>0; // 巨宽核心激光期间压制其他攻击
// 钢琴:大炮塔惩罚激光——玩家站在炮塔水平正下方蓄力后发射99999伤害大激光不管上下远近只管左右 // 钢琴:大炮塔惩罚激光——三态:蓄力(1-60)→发射→消退(61-360)→空闲(0)
if(b.idx===4&&!lck){ if(b.idx===4&&!lck){
const off0=b.phase>=1?16:0,p=G.p; const off0=b.phase>=1?16:0,p=G.p;
const leftX=b.x-(112+off0),rightX=b.x+(112+off0); const leftX=b.x-(112+off0),rightX=b.x+(112+off0);
if(p.dead<=0&&Math.abs(p.x-leftX)<14){ // 左炮
b.pedLasL=Math.min(60,(b.pedLasL||0)+1); const l=b.pedLasL||0;
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();} if(l===0&&p.dead<=0&&Math.abs(p.x-leftX)<14){
}else b.pedLasL=Math.max(0,(b.pedLasL||0)-1); b.pedLasL=1;
if(p.dead<=0&&Math.abs(p.x-rightX)<14){ }else if(l>0&&l<60){
b.pedLasR=Math.min(60,(b.pedLasR||0)+1); if(p.dead<=0&&Math.abs(p.x-leftX)<14)b.pedLasL=l+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.pedLasL=Math.max(0,l-1);
}else b.pedLasR=Math.max(0,(b.pedLasR||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=360;SFX.warn();}
}else if(l>=60){
b.pedLasL=l-1;
}
// 右炮
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;
}
} }
// —— 主攻击 —— // —— 主攻击 ——
b.mainT--; b.mainT--;