Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu
- #Title[Grass sign - Growth of beautiful Fantasy -]
- #Text[Not everyone can see...]
- #Player[FREE]
- #ScriptVersion[2]
- #BGM[bgm\Medicine.mp3]
- script_enemy_main{
- let CSD = GetCurrentScriptDirectory;
- CreateEnemyFromScript("Familiar6", GetCenterX, GetCenterY-60, 0, 0, NULL);
- let imgBoss = CSD ~ "system\Kora.png";
- let cut = CSD ~ "system\Koracut.png";
- let bg = CSD ~ "system\Temple.png";
- let imagefile = CSD ~ "system\DanmakuFlower.png";
- @Initialize{
- SetLife(10000);
- SetTimer(120);
- SetScore(100000);
- SetMovePosition01(GetCenterX,GetCenterY,5);
- LoadGraphic(imgBoss);
- LoadGraphic(imagefile);
- LoadGraphic(cut);
- LoadGraphic(bg);
- CutIn(YOUMU,"Grass sign - Growth of beautiful Fantasy -",cut,0,0,300,384);
- mainTask;
- }
- @MainLoop{
- SetCollisionA(GetX,GetY,32);
- SetCollisionB(GetX,GetY,16);
- yield;
- }
- @DrawLoop{
- // data for the boss
- SetTexture(imgBoss);
- SetRenderState(ALPHA);
- SetAlpha(225);
- SetGraphicRect(0,0,110,110);
- SetGraphicScale(0.5,0.5);
- SetGraphicAngle(0,0,0);
- DrawGraphic(GetX,GetY);
- }
- @BackGround{
- SetTexture(bg);
- SetRenderState(ALPHA);
- SetAlpha(225);
- SetGraphicRect(0,0,512,512);
- SetGraphicScale(1,1);
- SetGraphicAngle(0,0,0);
- DrawGraphic(GetCenterX,GetCenterY);
- }
- @Finalize{
- // delete the image from memory
- DeleteGraphic(imgBoss);
- DeleteGraphic(cut);
- DeleteGraphic(bg);
- DeleteGraphic(imagefile);
- }
- task TaiyouEffect(x,y) {
- let dir = 0;
- let size = 1;
- let b = 128;
- let objid = Obj_Create(OBJ_EFFECT);
- Obj_SetX(objid, x);
- Obj_SetY(objid, y);
- ObjEffect_SetLayer(objid, 1);
- ObjEffect_SetTexture(objid, imagefile);
- ObjEffect_SetPrimitiveType(objid, PRIMITIVE_TRIANGLEFAN);
- ObjEffect_CreateVertex(objid, 4);
- ObjEffect_SetVertexXY(objid, 0, -b, -b);
- ObjEffect_SetVertexXY(objid, 1, b, -b);
- ObjEffect_SetVertexXY(objid, 2, b, b);
- ObjEffect_SetVertexXY(objid, 3, -b, b);
- ObjEffect_SetVertexUV(objid, 0, 0, 0);
- ObjEffect_SetVertexUV(objid, 1, b*2, 0);
- ObjEffect_SetVertexUV(objid, 2, b*2, b*2);
- ObjEffect_SetVertexUV(objid, 3, 0, b*2);
- ObjEffect_SetVertexUV(objid, 0, 0, 0);
- ObjEffect_SetVertexUV(objid, 1, b*2, 0);
- ObjEffect_SetVertexUV(objid, 2, b*2, b*2);
- ObjEffect_SetVertexUV(objid, 3, 0, b*2);
- ObjEffect_SetRenderState(objid, ALPHA);
- ascent(i in 0..4) { ObjEffect_SetVertexColor(objid, i, 255, 255, 255, 255); }
- let grazecounter = 0; let togivegraze = 5;
- while(!Obj_BeDeleted(objid)){
- ObjEffect_SetScale(objid, size, size);
- SetCollisionB(Obj_GetX(objid),Obj_GetY(objid),b*size*9/10);
- Obj_SetAngle(objid,0);
- Obj_SetPosition(objid, Obj_GetX(objid),Obj_GetY(objid));
- if(Obj_GetX(objid)>GetClipMaxX+256){Obj_Delete(objid);}
- if(Obj_GetX(objid)<GetClipMinX-256){Obj_Delete(objid);}
- if(Obj_GetY(objid)>GetClipMaxY+256){Obj_Delete(objid);}
- if(Obj_GetY(objid)<GetClipMinY-256){Obj_Delete(objid);}
- grazecounter++;
- if(((GetPlayerX-Obj_GetX(objid))^2+(GetPlayerY-Obj_GetY(objid))^2)^0.5 < b*1.1 && grazecounter == togivegraze) { grazecounter = 0; AddGraze(1); }
- yield;
- }
- }
- task movement{
- loop{
- SetMovePosition01(GetCenterX-100,120,1);
- wait(480);
- SetMovePosition01(GetCenterX+90,300,1);
- wait(480);
- SetMovePosition01(GetCenterX-110,300,1);
- wait(480);
- yield;
- }
- }
- // main task, activates stuff.
- task mainTask{
- wait(140);
- yield;
- fire;
- }
- task fire2{
- loop(1){
- PlaySE(CSD ~ "\system\bom17_c.wav");
- TaiyouEffect(GetEnemyX,GetEnemyY);
- yield;
- }
- }
- task fire{
- let x = 0;
- let dir = 270;
- while(x<16){
- superbullet3(GetEnemyX+50*cos(dir),GetEnemyY+50*sin(dir),0.5,dir,GREEN03,0);
- dir+=22.5;
- x++;
- }
- }
- task superbullet3(x,y,v,dir,graphic,delay){
- let obj = Obj_Create(OBJ_SHOT);
- Obj_SetPosition(obj,x,y);
- Obj_SetSpeed(obj,v);
- Obj_SetAngle(obj,dir);
- ObjShot_SetGraphic(obj,graphic);
- ObjShot_SetDelay(obj,delay);
- ObjShot_SetBombResist(obj,true);
- while(!Obj_BeDeleted(obj)){
- wait(240);
- Obj_SetSpeed(obj,0.4);
- Obj_SetAngle(obj,dir-180);
- ObjShot_SetGraphic(obj,GREEN03);
- loop(10){
- CreateShot01(Obj_GetX(obj),Obj_GetY(obj),0.5,dir,GREEN01,0);
- dir+=360/10;
- }
- wait(20);
- loop(10){
- CreateShot01(Obj_GetX(obj),Obj_GetY(obj),0.5,dir,GREEN01,0);
- dir+=360/10;
- }
- loop(10){
- CreateShot01(Obj_GetX(obj),Obj_GetY(obj),0.5,dir,GREEN01,0);
- dir+=360/10;
- }
- loop(10){
- CreateShot01(Obj_GetX(obj),Obj_GetY(obj),0.5,dir,GREEN01,0);
- dir+=360/10;
- }
- wait(20);
- loop(10){
- CreateShot01(Obj_GetX(obj),Obj_GetY(obj),0.5,dir,GREEN01,0);
- dir+=360/10;
- }
- wait(20);
- loop(10){
- CreateShot01(Obj_GetX(obj),Obj_GetY(obj),0.5,dir,GREEN01,0);
- dir+=360/10;
- }
- wait(20);
- loop(10){
- CreateShot01(Obj_GetX(obj),Obj_GetY(obj),0.5,dir,GREEN01,0);
- dir+=360/10;
- }
- wait(480);
- yield;
- }
- superbullet3(x,y,v,dir,graphic,delay);
- }
- task fire3{
- loop{
- ascent(i in 20..30){
- CreateLaserB(i, 600, 100, BLUE04,80);
- SetLaserDataB(i, 0, 0, 100, 0, 180+i*12, 0.5, 0+i*12, 0.3);
- SetShotKillTime(i,120);
- FireShot(i);}
- wait(360);
- yield;
- }
- }
- task fire4{
- loop{
- ascent(i in 0..30){
- CreateLaserB(i, 200, 100, RED04,80);
- SetLaserDataB(i, 0, 0, 100, 0, 180+i*12, 0.2, 0+i*12, 2);
- SetShotKillTime(i,120);
- FireShot(i);}
- wait(480);
- yield;
- }
- }
- task fire5{
- let x = 0;
- let dir = 0;
- loop{
- while(x<36){
- CreateShotA(1,GetCenterX+30*cos(dir),GetCenterY+30*sin(dir),30);
- SetShotDataA(1,0,0,dir,0,0,0,BLUE04);
- SetShotDataA(1,60,2,dir,0.9,0,3,BLUE04);
- SetShotKillTime(1,840);
- FireShot(1);
- dir+=360/6;
- x++;
- }
- x = 0;
- dir = 0;
- wait(60);
- yield;
- }
- }
- // wait function
- function wait(w){
- loop(w){yield;}
- }
- }
- -----------------------------------------------------------------------------------------------------------------
- script_enemy Familiar6
- {
- let CSD = GetCurrentScriptDirectory;
- let x=GetX();
- let y=GetY();
- let arg=GetArgument();
- let enemyspeed=GetSpeed();
- let shotgra=GetAngle();
- let minX=GetClipMinX();
- let maxX=GetClipMaxX();
- let minY=GetClipMinY();
- let maxY=GetClipMaxY();
- let cenX=GetCenterX();
- let cenY=GetCenterY();
- let seal=GetCurrentScriptDirectory~".\system\seal1.png";
- let imagefile = CSD ~ "system\DanmakuFlower.png";
- let ang=0;
- let g_angle=0;
- let length=0;
- let count=80;
- let flg=0;
- //include_function "lib\SHOT_REPLACE\shot_replace.dnh"
- @Initialize
- {
- SetX(x);
- SetY(y);
- LoadGraphic(seal);
- LoadGraphic(imagefile);
- SetLife(100);
- //shotinit;
- mainTask;
- }
- @MainLoop { yield; }
- task mainTask{
- wait(120);
- tasuku;
- fire3;
- wait(60);
- fire2;
- yield;
- }
- task TaiyouEffect(x,y) {
- let dir = 0;
- let size = 0.5;
- let b = 128;
- let objid = Obj_Create(OBJ_EFFECT);
- Obj_SetX(objid, x);
- Obj_SetY(objid, y);
- ObjEffect_SetLayer(objid, 1);
- ObjEffect_SetTexture(objid, imagefile);
- ObjEffect_SetPrimitiveType(objid, PRIMITIVE_TRIANGLEFAN);
- ObjEffect_CreateVertex(objid, 4);
- ObjEffect_SetVertexXY(objid, 0, -b, -b);
- ObjEffect_SetVertexXY(objid, 1, b, -b);
- ObjEffect_SetVertexXY(objid, 2, b, b);
- ObjEffect_SetVertexXY(objid, 3, -b, b);
- ObjEffect_SetVertexUV(objid, 0, 0, 0);
- ObjEffect_SetVertexUV(objid, 1, b*2, 0);
- ObjEffect_SetVertexUV(objid, 2, b*2, b*2);
- ObjEffect_SetVertexUV(objid, 3, 0, b*2);
- ObjEffect_SetVertexUV(objid, 0, 0, 0);
- ObjEffect_SetVertexUV(objid, 1, b*2, 0);
- ObjEffect_SetVertexUV(objid, 2, b*2, b*2);
- ObjEffect_SetVertexUV(objid, 3, 0, b*2);
- ObjEffect_SetRenderState(objid, ALPHA);
- ascent(i in 0..4) { ObjEffect_SetVertexColor(objid, i, 255, 255, 255, 255); }
- let grazecounter = 0; let togivegraze = 5;
- while(!Obj_BeDeleted(objid)){
- ObjEffect_SetScale(objid, size, size);
- SetCollisionB(Obj_GetX(objid),Obj_GetY(objid),b*size*7/10);
- Obj_SetAngle(objid,atan2(GetEnemyY-Obj_GetY(objid),GetEnemyX-Obj_GetX(objid)));
- Obj_SetSpeed(objid,0.5);
- Obj_SetPosition(objid, Obj_GetX(objid),Obj_GetY(objid));
- if(Obj_GetX(objid)>GetClipMaxX+256){Obj_Delete(objid);}
- if(Obj_GetX(objid)<GetClipMinX-256){Obj_Delete(objid);}
- if(Obj_GetY(objid)>GetClipMaxY+256){Obj_Delete(objid);}
- if(Obj_GetY(objid)<GetClipMinY-256){Obj_Delete(objid);}
- grazecounter++;
- if(((GetPlayerX-Obj_GetX(objid))^2+(GetPlayerY-Obj_GetY(objid))^2)^0.5 < b*1.1 && grazecounter == togivegraze) { grazecounter = 0; AddGraze(1); }
- yield;
- }
- }
- task tasuku { loop {
- SetMovePosition02(GetEnemyX+0*cos(ang), GetEnemyY+0*sin(ang), 15); ang+=-35/4;ang%=360; yield;
- }
- }
- task movement{
- SetMovePosition02(GetEnemyX+35*cos(ang), GetEnemyX+35*sin(ang), 15); ang+=7/4;ang%=360; yield;
- }
- task fire2{
- loop(1){
- wait(40);
- PlaySE(CSD ~ "\system\se_kira00.wav");
- TaiyouEffect(GetEnemyX,GetEnemyY);
- yield;
- }
- }
- task fire3{
- loop(1){
- Concentration01(100);
- yield;
- }
- }
- task fire121{
- let x = 0;
- let dir = 0;
- loop{
- while(x<36){
- CreateShotA(1,GetX,GetY,90);
- SetShotDataA(1,0,0,dir,0,0,0,YELLOW02);
- SetShotDataA(1,60,1,-dir,0,0,0,YELLOW02);
- FireShot(1);
- dir+=360/36;
- x++;
- }
- x = 0;
- dir = 0;
- wait(60);
- yield;
- }
- }
- task fire155{
- let x = 0;
- let dir = 90;
- while(x<16){
- superbulletac(GetX+50*cos(dir),GetY+50*sin(dir),0.6,dir+180,WHITE02,0);
- dir+=60;
- x++;
- }
- }
- task superbulletac(x,y,v,dir,graphic,delay){
- let obj = Obj_Create(OBJ_SHOT);
- Obj_SetPosition(obj,x,y);
- Obj_SetSpeed(obj,v);
- Obj_SetAngle(obj,dir);
- ObjShot_SetGraphic(obj,graphic);
- ObjShot_SetDelay(obj,delay);
- ObjShot_SetBombResist(obj,true);
- while(!Obj_BeDeleted(obj)){
- wait(80);
- Obj_SetSpeed(obj,0.5);
- Obj_SetAngle(obj,dir+90);
- ObjShot_SetGraphic(obj,WHITE02);
- loop(8){
- CreateShot01(Obj_GetX(obj),Obj_GetY(obj),2,dir,PURPLE04,0);
- dir+=360/8;
- }
- loop(30){
- CreateShot01(Obj_GetX(obj),Obj_GetY(obj),2,dir,RED04,0);
- dir+=360/30;
- }
- wait(120);
- loop(8){
- CreateShot01(Obj_GetX(obj),Obj_GetY(obj),1,dir,BLUE04,0);
- dir+=360/8;
- }
- wait(5);
- loop(8){
- CreateShot01(Obj_GetX(obj),Obj_GetY(obj),1,dir,GREEN04,0);
- dir+=360/8;
- }
- wait(5);
- loop(8){
- CreateShot01(Obj_GetX(obj),Obj_GetY(obj),1,dir,YELLOW04,0);
- dir+=360/8;
- }
- wait(5);
- loop(8){
- CreateShot01(Obj_GetX(obj),Obj_GetY(obj),1,dir,BLUE04,0);
- dir+=360/8;
- }
- wait(5);
- loop(8){
- CreateShot01(Obj_GetX(obj),Obj_GetY(obj),1,dir,GREEN04,0);
- dir+=360/8;
- }
- wait(5);
- loop(8){
- CreateShot01(Obj_GetX(obj),Obj_GetY(obj),1,dir,YELLOW04,0);
- dir+=360/8;
- }
- wait(60);
- Obj_Delete(obj);
- wait(30);
- yield;
- }
- superbulletac(x,y,v,dir,graphic,delay);
- }
- function wait(n){loop(n){yield;}}
- function GetGapX(x,gapLength,gapAngle){return x+gapLength*cos(gapAngle);}
- function GetGapY(y,gapLength,gapAngle){return y+gapLength*sin(gapAngle);}
- @DrawLoop
- {
- SetTexture(seal);
- SetGraphicRect(1,1,256,256);
- SetAlpha(128);
- SetGraphicAngle(0,0,0);
- DrawGraphic(GetX(),GetY());
- SetGraphicAngle(0,0,0);
- }
- @Finalize
- {
- DeleteGraphic(imagefile);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment