/************************************************************************ * 運命「ミゼラブルフェイト」 * * このファイルは、東方弾幕風用のスクリプトファイルです。 * * 東方弾幕風内の script フォルダにそのままコピーしてください。 * * * * 制作者:yutaka * * * ************************************************************************/ #東方弾幕風 #Title[運命「ミゼラブルフェイト」] #Text[] #Image[] #BackGround[] #BGM[] #PlayLevel[Normal] #Player[FREE] #ScriptVersion[2] script_enemy_main { let name ="運命「ミゼラブルフェイト」"; let imgBoss ="script\img\ExRumia.png"; let cntX =GetCenterX; let cntY =GetCenterY; let maxX =GetClipMaxX; let maxY =GetClipMaxY; let minX =GetClipMinX; let minY =GetClipMinY; @Initialize { SetLife(4500); SetTimer(60); SetScore(200000); CutIn(YOUMU, name, "", 0, 0, 0, 0); LoadGraphic(imgBoss); SetTexture(imgBoss); TMain; } @MainLoop { SetCollisionA(GetX, GetY, 32); SetCollisionB(GetX, GetY, 16); yield; } @DrawLoop { DrawGraphic(GetX, GetY); } @Finalize { DeleteGraphic(imgBoss); loop(24) { let x = GetX + rand(-64, 64); let y = GetY + rand(-64, 64); CreateItem(ITEM_SCORE, x, y); } } task TMain{ yield; SStandBy; TDamage; TMove; TChainMain; } sub SStandBy{ let wIni=120; SetInvincibility(wIni); SetMovePosition02(cntX, minY+128, wIni); SetGraphicMove; wait(wIni); } task TDamage{ SetDamageRate(30, 30); wait(300); SetDamageRate(60, 60); wait(600); SetDamageRate(100, 60); } task TMove{ let x; let y; let xb; let yb; let xd; let yd; loop{ xb=GetX; yb=GetY; xd=rand(30, 90); yd=rand(-20, 20); if(GetPlayerXmaxX) {x=xb-xd; } } y=yb+yd; if(y>maxY) {y=maxY; } else if(y>(minY+maxY)/2) {y=(minY+maxY)/2; } SetMovePosition02(x, y, 60); wait(180); } } task TChainMain { let n; let db; let dv; let wNxt; let a=true; loop{ if(a) { n=7; db=90; dv=30; wNxt=60; a=false; } else { n=4; db=GetAngleToPlayer; dv=12; wNxt=180; a=true; } ascent(let m in 0..n){ TChain(db+(m-(n-1)/2)*dv); } wait(wNxt); } } task TChain(db) { let obj; let vb=2; let v=vb; let d=db; let dvb=1; let dv; let wDly=30; let n=60/dvb; let m=6; obj=Obj_Create(OBJ_SHOT); Obj_SetPosition(obj, GetX, GetY); Obj_SetSpeed(obj, v); Obj_SetAngle(obj, d); ObjShot_SetDelay(obj, wDly); ObjShot_SetBombResist(obj, true); ObjShot_SetGraphic(obj, RED31); wait(wDly); TChainAbs(obj); wait(40); loop(m) { if(turnRight(obj)) {dv=dvb; } else {dv=-dvb; } loop(n) { d+=dv; if(Obj_GetY(obj)>maxY) {Obj_Delete(obj); } Obj_SetAngle(obj, d); wait(1); } } } task TChainAbs(objb) { let wInt=9; while(! Obj_BeDeleted(objb)) { TChainAbsShot(objb); wait(wInt); } } task TChainAbsShot(objb) { let obj; let wDlt=90; obj=Obj_Create(OBJ_SHOT); Obj_SetPosition(obj, Obj_GetX(objb), Obj_GetY(objb)); Obj_SetSpeed(obj, 0); Obj_SetAngle(obj, Obj_GetAngle(objb)); ObjShot_SetGraphic(obj, RED12); wait(wDlt); Obj_Delete(obj); } function turnRight(obj) { let x1=Obj_GetX(obj); let y1=Obj_GetY(obj); let x2=GetPlayerX; let y2=GetPlayerY; let d1=atan1(x2-x1, y2-y1); let d2=Obj_GetAngle(obj); let d=deg(d2-d1); if(d>=0) {return false;} else {return true; } } sub SetGraphicStop { SetGraphicRect( 0, 0, 64, 64); } sub SetGraphicPose { SetGraphicRect( 64, 0, 128, 64); } sub SetGraphicLeft { SetGraphicRect(128, 0, 192, 64); } sub SetGraphicRight { SetGraphicRect(192, 0, 256, 64); } sub SetGraphicMove { if(GetSpeedX < 0) { SetGraphicLeft; } else { SetGraphicRight; } } function deg(d) { d=d%360; if(d>180) {d-=360; } return d; } function atan1(x, y) { if(x>=0) {return atan(y/x); } else {return atan(y/x)-180; } } function wait(w) {loop(w){yield;};} }