子弹图像是从梦终剧抠过来的, ExRumia的图像还被我改成了Creeper World的CRPL Image ಠ_ಠ
#東方弾幕風
#Title[Laser FTW]
#Text[test]
#Image[]
#ScriptVersion[2]
#include_function ".\shot_All.dnh"
#include_function ".\_index_UserShot.dnh"
script_enemy_main
{
LoadUserShotData("script\test\shot_All.dnh");
let count=0;
let cx=GetCenterX();
let cy=GetCenterY();
let imgExRumia="script\img\ExRumia.png";
LoadGraphic(imgExRumia);
SetGraphicRect(64,1,127,64);
@Initialize()
{
SetShotColor(255,255,255);
SetLife(5000);
SetX(224);
SetY(200);
}
@MainLoop()
{
if(count%240==0){act;}
SetCollisionA(GetX(),GetY(),32);
SetCollisionB(GetX(),GetY(),24);
count++;
yield;
}
@DrawLoop()
{
SetTexture(imgExRumia);
DrawGraphic(GetX(),GetY());
}
@Finalize()
{
DeleteGraphic(imgExRumia);
}
task charge(let x, let y, let vx, let vy, let dx, let dy, let t)
{
let cnt=0;
let xx=dx-x;
let yy=dy-y;
let ax=xx/(t*t/2)-vx/(t/2);
let ay=yy/(t*t/2)-vy/(t/2);
while(cnt<t+1)
{
SetShotColor(255,25,25);
CreateShotA(1,x+cnt*vx+0.5*ax*cnt*cnt,y+cnt*vy+0.5*ay*cnt*cnt,20);
SetShotDataA(1,0,0,0,0,0,0,WHITE01);
SetShotKillTime(1,0);
FireShot(1);
SetShotColor(255,255,255);
cnt++;
yield;
}
}
task aux(let x,let h,let c)
{
let obj=Obj_Create(OBJ_LASER);
let cnt=-c;
let R=rand(25,255);
Obj_SetX(obj,x);
Obj_SetY(obj,500);
Obj_SetAngle(obj,270);
ObjLaser_SetLength(obj,1);
ObjLaser_SetWidth(obj,30);
ObjShot_SetGraphic(obj,RED01);
ObjLaser_SetSource(obj,false);
while(!Obj_BeDeleted(obj))
{
if(cnt>0){ObjLaser_SetLength(obj,h*cnt*cnt*(7/8)^cnt);}
if(cnt>90){Obj_Delete(obj);}
if(cnt==10){loop(12){SetShotColor(255,R,R);CreateShot12(x,440,rand(-0.5,0.5),rand(0,-9),0,0.07,0,5,241,0);R=rand(25,255);}SetShotColor(255,255,255);}
cnt++;
yield;
}
}
task laser(let x)
{
let obj=Obj_Create(OBJ_LASER);
let cnt=0;
let a1=4;
let a2=180;
Obj_SetX(obj,x);
Obj_SetY(obj,0);
Obj_SetAngle(obj,90);
ObjLaser_SetLength(obj,480);
ObjLaser_SetWidth(obj,450);
ObjShot_SetGraphic(obj,153);
ObjLaser_SetSource(obj,false);
loop(31){loop(7){CreateShot01(x,460,a1,a2,225,0);a1+=0.8;}a1=4;a2+=6;}
while(!Obj_BeDeleted(obj))
{
ObjLaser_SetWidth(obj,2300*(5/6)^cnt);
if(cnt>90){Obj_Delete(obj);}
cnt++;
yield;
}
}
function cloud(let r ,let x, let y)
{
SetShotColor(255,25,25);
loop(r)
{
let R=rand(0,360);
let R2=rand(0,4);
CreateShotA(1,x+200*sin(R)/(R2+0.5),y+100*cos(R)/(R2+0.5),40);
SetShotDataA(1,0,0,0,0,0,0,WHITE01);
SetShotKillTime(1,0);
FireShot(1);
}
SetShotColor(255,255,255);
}
task act
{
let cnt=0;
let tx=GetPlayerX();
let R1=rand(0,360);
let R2=rand(2,5);
while(cnt<300)
{
R1=rand(-90,90);
R2=rand(10,25);
if(cnt<80){tx=(29*tx+GetPlayerX())/30;}
if(cnt%2==0&&cnt<90){charge(GetX(),GetY(),R2*sin(R1),R2*cos(R1),rand(tx-60,tx+60),0,30);}
if(cnt==80){R1=0;loop(30){charge(tx+500*sin(R1),20+500*cos(R1),20*sin(R1+130),20*cos(R1+130),tx,20,40);R1+=12;}}
if(cnt>30&&cnt<120){cloud(floor((cnt-30)/10)^2,tx,0);}
if(cnt==119){laser(tx);let i=0;loop(40){aux(tx+i*224/20,12,0.5*i);aux(tx-i*224/20,12,0.5*i);i++;}i=0;}
cnt++;
yield;
}
}
}
#東方弾幕風
#Title[Laser FTW]
#Text[test]
#Image[]
#ScriptVersion[2]
#include_function ".\shot_All.dnh"
#include_function ".\_index_UserShot.dnh"
script_enemy_main
{
LoadUserShotData("script\test\shot_All.dnh");
let count=0;
let cx=GetCenterX();
let cy=GetCenterY();
let imgExRumia="script\img\ExRumia.png";
LoadGraphic(imgExRumia);
SetGraphicRect(64,1,127,64);
@Initialize()
{
SetShotColor(255,255,255);
SetLife(5000);
SetX(224);
SetY(200);
}
@MainLoop()
{
if(count%240==0){act;}
SetCollisionA(GetX(),GetY(),32);
SetCollisionB(GetX(),GetY(),24);
count++;
yield;
}
@DrawLoop()
{
SetTexture(imgExRumia);
DrawGraphic(GetX(),GetY());
}
@Finalize()
{
DeleteGraphic(imgExRumia);
}
task charge(let x, let y, let vx, let vy, let dx, let dy, let t)
{
let cnt=0;
let xx=dx-x;
let yy=dy-y;
let ax=xx/(t*t/2)-vx/(t/2);
let ay=yy/(t*t/2)-vy/(t/2);
while(cnt<t+1)
{
SetShotColor(255,25,25);
CreateShotA(1,x+cnt*vx+0.5*ax*cnt*cnt,y+cnt*vy+0.5*ay*cnt*cnt,20);
SetShotDataA(1,0,0,0,0,0,0,WHITE01);
SetShotKillTime(1,0);
FireShot(1);
SetShotColor(255,255,255);
cnt++;
yield;
}
}
task aux(let x,let h,let c)
{
let obj=Obj_Create(OBJ_LASER);
let cnt=-c;
let R=rand(25,255);
Obj_SetX(obj,x);
Obj_SetY(obj,500);
Obj_SetAngle(obj,270);
ObjLaser_SetLength(obj,1);
ObjLaser_SetWidth(obj,30);
ObjShot_SetGraphic(obj,RED01);
ObjLaser_SetSource(obj,false);
while(!Obj_BeDeleted(obj))
{
if(cnt>0){ObjLaser_SetLength(obj,h*cnt*cnt*(7/8)^cnt);}
if(cnt>90){Obj_Delete(obj);}
if(cnt==10){loop(12){SetShotColor(255,R,R);CreateShot12(x,440,rand(-0.5,0.5),rand(0,-9),0,0.07,0,5,241,0);R=rand(25,255);}SetShotColor(255,255,255);}
cnt++;
yield;
}
}
task laser(let x)
{
let obj=Obj_Create(OBJ_LASER);
let cnt=0;
let a1=4;
let a2=180;
Obj_SetX(obj,x);
Obj_SetY(obj,0);
Obj_SetAngle(obj,90);
ObjLaser_SetLength(obj,480);
ObjLaser_SetWidth(obj,450);
ObjShot_SetGraphic(obj,153);
ObjLaser_SetSource(obj,false);
loop(31){loop(7){CreateShot01(x,460,a1,a2,225,0);a1+=0.8;}a1=4;a2+=6;}
while(!Obj_BeDeleted(obj))
{
ObjLaser_SetWidth(obj,2300*(5/6)^cnt);
if(cnt>90){Obj_Delete(obj);}
cnt++;
yield;
}
}
function cloud(let r ,let x, let y)
{
SetShotColor(255,25,25);
loop(r)
{
let R=rand(0,360);
let R2=rand(0,4);
CreateShotA(1,x+200*sin(R)/(R2+0.5),y+100*cos(R)/(R2+0.5),40);
SetShotDataA(1,0,0,0,0,0,0,WHITE01);
SetShotKillTime(1,0);
FireShot(1);
}
SetShotColor(255,255,255);
}
task act
{
let cnt=0;
let tx=GetPlayerX();
let R1=rand(0,360);
let R2=rand(2,5);
while(cnt<300)
{
R1=rand(-90,90);
R2=rand(10,25);
if(cnt<80){tx=(29*tx+GetPlayerX())/30;}
if(cnt%2==0&&cnt<90){charge(GetX(),GetY(),R2*sin(R1),R2*cos(R1),rand(tx-60,tx+60),0,30);}
if(cnt==80){R1=0;loop(30){charge(tx+500*sin(R1),20+500*cos(R1),20*sin(R1+130),20*cos(R1+130),tx,20,40);R1+=12;}}
if(cnt>30&&cnt<120){cloud(floor((cnt-30)/10)^2,tx,0);}
if(cnt==119){laser(tx);let i=0;loop(40){aux(tx+i*224/20,12,0.5*i);aux(tx-i*224/20,12,0.5*i);i++;}i=0;}
cnt++;
yield;
}
}
}