钢琴Boss大激光最终重改:更粗+扩口半圆+平滑蓄力
- 大激光宽度从6改为14,明显粗于普通激光(w=4) - 发射口加入向下扩口半圆:arc(...,0,Math.PI),半径0→w*0.6随发射扩大 - 蓄力机制改为平滑增减:检测到玩家每帧+1(上限60),离开时每帧-1(下限0) - 蓄力圆环随进度自然缩放,离开时缓慢缩小直到消失(不瞬间清零) - bossBeam增加dur0字段保存初始持续时间,供扩口动画计算
This commit is contained in:
parent
3d82a4ed35
commit
bedc2089be
@ -210,7 +210,7 @@ function bossHit(x,y,r){
|
|||||||
}
|
}
|
||||||
function shuffled(n){const a=[];for(let i=0;i<n;i++)a.push(i);for(let i=n-1;i>0;i--){const j=rndi(0,i),t=a[i];a[i]=a[j];a[j]=t;}return a;}
|
function shuffled(n){const a=[];for(let i=0;i<n;i++)a.push(i);for(let i=n-1;i>0;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
|
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:蓝白长钉无人机(环绕僚机;定期脱离环绕摆阵型齐射)
|
function spawnFunnels(b,n){ // 夺权者X:蓝白长钉无人机(环绕僚机;定期脱离环绕摆阵型齐射)
|
||||||
for(let i=0;i<n;i++)
|
for(let i=0;i<n;i++)
|
||||||
@ -350,18 +350,18 @@ function updateBoss(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const lck=(b.laserT||0)>0; // 巨宽核心激光期间压制其他攻击
|
const lck=(b.laserT||0)>0; // 巨宽核心激光期间压制其他攻击
|
||||||
// 钢琴:大炮塔惩罚激光——玩家站在炮塔水平正下方蓄力1秒后发射99999伤害大激光(不管上下远近,只管左右)
|
// 钢琴:大炮塔惩罚激光——玩家站在炮塔水平正下方蓄力后发射99999伤害大激光(不管上下远近,只管左右)
|
||||||
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){
|
if(p.dead<=0&&Math.abs(p.x-leftX)<14){
|
||||||
b.pedLasL=(b.pedLasL||0)+1;
|
b.pedLasL=Math.min(60,(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();}
|
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=0;
|
}else b.pedLasL=Math.max(0,(b.pedLasL||0)-1);
|
||||||
if(p.dead<=0&&Math.abs(p.x-rightX)<14){
|
if(p.dead<=0&&Math.abs(p.x-rightX)<14){
|
||||||
b.pedLasR=(b.pedLasR||0)+1;
|
b.pedLasR=Math.min(60,(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();}
|
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=0;
|
}else b.pedLasR=Math.max(0,(b.pedLasR||0)-1);
|
||||||
}
|
}
|
||||||
// —— 主攻击 ——
|
// —— 主攻击 ——
|
||||||
b.mainT--;
|
b.mainT--;
|
||||||
|
|||||||
@ -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;}}
|
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){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.strokeStyle=bm.col;ctx.lineWidth=bm.w;
|
||||||
ctx.beginPath();ctx.moveTo(bm.x1,bm.y1);ctx.lineTo(bm.x2,bm.y2);ctx.stroke();
|
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);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user