#東方弾幕風[Single] #ScriptVersion[3] #Title["サグメ通常コピ"] #Background["script/default_system/Default_Background_IceMountain.txt"] #BGM[DEFAULT] #Player[DEFAULT] #include"script/default_system/Default_ShotConst.txt" #include"script/default_system/Default_Effect.txt" let objEnemy; let bConcentrationMotion = false; let ex ; let ey ; @Initialize { objEnemy = ObjEnemy_Create(OBJ_ENEMY_BOSS); ObjEnemy_Regist(objEnemy); ObjEnemy_SetDamageRate(objEnemy, 10, 10);//披ダメージを10%に設定 TWork; TRender; TEnd; DeleteShotAll(TYPE_ALL, TYPE_ITEM);//出現と同時に敵弾を全て削除 } @MainLoop { ex = ObjMove_GetX(objEnemy); ey = ObjMove_GetY(objEnemy); ObjEnemy_SetIntersectionCircleToShot(objEnemy, ex, ey, 32);//当たり判定(自弾)登録 ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ex, ey, 24);//当たり判定(体当たり)登録 yield; } @Event { alternative(GetEventType()) case(EV_REQUEST_LIFE) { SetScriptResult(300);//ライフを1500に設定 } case(EV_REQUEST_TIMER) { SetScriptResult(60);//時間制限を60秒に設定 } case(EV_REQUEST_SPELL_SCORE) { SetScriptResult(30000);//スペルカードボーナスを30000に設定 } } //---------------------------------------------------- //敵動作 //---------------------------------------------------- task TWork { // Concentration01(150); // CutIn(YOUMU,"星符「ミッドナイトレヴァリエ」",0,0,0,0,0);//スペルカード名表示 //座標(cx, 60)へ60フレームかけて移動する let cx = GetStgFrameWidth() / 2;//STGシーンの中心x座標を取得 ObjMove_SetDestAtFrame(objEnemy, cx, 140, 60); loop(60){yield;} let objScene = GetEnemyBossSceneObjectID(); ObjEnemyBossScene_StartSpell(objScene); loop(90){yield;} while(!Obj_IsDeleted(objEnemy)) { let a=(360/24)*3; let w=0; loop(3){ TShotBlue(ex,ey, 0, 0+a,0,w,1); a-=(360/24); w+=5; loop(5){yield;} loop(3){ TShotBlue(ex,ey, 0, 0+a,1,w,1); a-=(360/24); w+=5; loop(5){yield;} } } loop(210){yield;} a=-(360/24)*3; w=0; loop(3){ TShotBlue(ex,ey, 0, 0+a,0,w,-1); a+=(360/24); w+=5; loop(5){yield;} loop(3){ TShotBlue(ex,ey, 0, 0+a,1,w,-1); a+=(360/24); w+=5; loop(5){yield;} } } loop(210){yield;} } } //---------------------------------------------------- //描画タスク //---------------------------------------------------- task TRender { let imgExRumia = GetCurrentScriptDirectory~"ExRumia.png"; ObjPrim_SetTexture(objEnemy, imgExRumia); while(!Obj_IsDeleted(objEnemy)) { let angle = ObjMove_GetAngle(objEnemy); let speed = ObjMove_GetSpeed(objEnemy); if(speed == 0) { if(bConcentrationMotion) { ObjSprite2D_SetSourceRect(objEnemy, 64, 1, 127, 64); } else { ObjSprite2D_SetSourceRect(objEnemy, 1, 1, 64, 64); } } else if(cos(angle) > 0){ObjSprite2D_SetSourceRect(objEnemy, 192, 1, 255, 64);} else if(cos(angle) < 0){ObjSprite2D_SetSourceRect(objEnemy, 128 ,1, 191, 64);} ObjSprite2D_SetDestCenter(objEnemy); yield; } } //---------------------------------------------------- //弾関連 //---------------------------------------------------- task TShotBlue(x,y,r,angle,co,ww,l) { let C; let C2; if(co==0){C=DS_BALL_M_BLUE;C2=DS_BILL_BLUE;} if(co==1){C=DS_BALL_M_RED;C2=DS_BILL_RED;} let obj = CreateShotA2(x, y, 0, angle, 0, 0, C, 0);//弾を発射 ObjShot_SetSpellResist(obj, true); ObjShot_SetAutoDelete(obj,false); Obj_SetRenderPriorityI(obj,49); let a=0; let aa=9; let c=0; let rr=5; let rrr=1; let t=0; let w=5; let A=0; let sx = ObjMove_GetX(obj); let sy = ObjMove_GetY(obj); loop(75){ loop(4){ sx = ObjMove_GetX(obj); sy = ObjMove_GetY(obj); ObjMove_SetPosition(obj, x+r*cos(angle), y+r*sin(angle)); angle+=((360/24)/w)*l; if(c<20){r+=rr/4;rr=rr;} t+=1; yield; if(Obj_IsDeleted(obj)||t==300-ww){break;} if(t>260-ww){w+=0.1;} } if(Obj_IsDeleted(obj)||t==300-ww){break;} c+=1; if(c==29||c==75){a+=aa*l;} CreateShotA1(ObjMove_GetX(obj)+5*cos(angle+a), ObjMove_GetY(obj)+5*sin(angle+a), 2.0, angle+a, C2, 10); a+=aa*l; A=angle+a; if(aa>1.40){aa=aa/1.13;} if(c==28){a+=10*l;} else {aa=aa/0.99;} } loop(3){ loop(16){ ObjMove_SetPosition(obj, x+r*cos(angle), y+r*sin(angle)); angle+=((360/24)/w)*l; r+=rrr; if(rrr<2.5){rrr+=0.1;} w+=0.4; if(Obj_IsDeleted(obj)){break;} yield; } loop(7){ loop(4){ ObjMove_SetPosition(obj, x+r*cos(angle), y+r*sin(angle)); angle+=((360/24)/w)*l; r+=rrr; if(rrr<2.5){rrr+=0.1;} w+=0.4; if(Obj_IsDeleted(obj)){break;} yield; } let sx = ObjMove_GetX(obj); let sy = ObjMove_GetY(obj); CreateShotA1(sx+5*cos(A), sy+5*sin(A), 2.0, A, C2, 10); } } } //29,75 task TShotRed(angle1, angle2) { let ex = ObjMove_GetX(objEnemy); let ey = ObjMove_GetY(objEnemy); let obj = CreateShotA2(ex, ey, 5, angle1, -0.08, 0, DS_BALL_L_RED, 0);//弾を発射 ObjMove_AddPatternA1(obj, 60, 5, angle2); loop(60){yield;} ascent(i in 0 .. 300) { if(Obj_IsDeleted(obj)){break;} let shotSpeed=rand(0.5,1.5); let sx = ObjMove_GetX(obj); let sy = ObjMove_GetY(obj); CreateShotA1(sx, sy, rand(0.5,1.5), rand(0,360), DS_BALL_S_RED, 60); yield; } } //---------------------------------------------------- //終了待機タスク //---------------------------------------------------- task TEnd { while(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0) { yield; } let ex = ObjMove_GetX(objEnemy); let ey = ObjMove_GetY(objEnemy); TExplosionA(ex, ey, 10, 0.6); DeleteShotAll(TYPE_ALL, TYPE_ITEM);//敵弾を全て削除 Obj_Delete(objEnemy); loop(30){yield;} CloseScript(GetOwnScriptID()); }