Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.02 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[Contest Entry : Five Star Over Suwa Lake]
  3. #Text[Test script]
  4. #PlayLevel[Hi]
  5. #Player[FREE]
  6. #BGM[.\Faith.mp3]
  7. #ScriptVersion[2]
  8.  
  9. script_enemy_main {
  10.  
  11. let BG2 = (GetCurrentScriptDirectory~"img\carbg1.png");
  12. let BG = (GetCurrentScriptDirectory~"img\cardbg.png");
  13. let ImgBoss = (GetCurrentScriptDirectory~"img\stg5enm.png");
  14. let BossFace = (GetCurrentScriptDirectory~"img\face05ct.png");
  15.  
  16. let frame3 = 0;
  17. let angleC = 0;
  18. let animM = 0;
  19. let animI = 0;
  20. let scroll = 0;
  21. SetCommonData("Wave", 0);
  22.  
  23.  
  24.  
  25. let frame = 0;
  26. let a = 0;
  27. let u = 0;
  28. let frame2 = 0;
  29. let angle= 0;
  30. let speed = 5;
  31. let n = 60;
  32. let i = 0;
  33. let T = 30;
  34. let f = 0;
  35. let f2 = 0;
  36.  
  37.  
  38. #include_function ".\MCircle.txt";
  39. #include_function ".\charge.dnh";
  40. #include_function ".\enemyanim.dnh";
  41. #include_function ".\cutin.txt";
  42.  
  43. @Initialize {
  44.  
  45. LoadGraphic(BG);
  46. LoadGraphic(BG2);
  47. LoadGraphic(ImgBoss);
  48. LoadGraphic(BossFace);
  49. SetDurableSpellCard;
  50. SetLife(10000);
  51. SetTimer(120);
  52. CutIn(YOUMU, "Star Sign "\""Five Star Over Suwa Lake"\", BossFace, 0, 0,0, 0);
  53. cutin("KANAKO",BossFace,0,0,256,512);
  54. SetScore(200000);
  55. SetDamageRate(100, 100);
  56. MagicCircle(false);
  57. SetEnemyMarker(true);
  58.  
  59.  
  60. SetMovePosition02(GetCenterX,GetCenterY-55, 50);
  61. SetInvincibility(240);
  62. LoadUserShotData(GetCurrentScriptDirectory~"NewSD\supershot.txt");
  63. }
  64.  
  65. @MainLoop {
  66.  
  67. frame++;
  68. f+=1;
  69. f2+=1;
  70. if(frame == 60){charge;}
  71. if(frame == 90){
  72. GreenStar;
  73.  
  74. time;}
  75.  
  76.  
  77. yield;
  78. }
  79.  
  80. @DrawLoop {
  81.  
  82. MiniCircle;
  83. Circle;
  84.  
  85. SetTexture(ImgBoss);
  86.  
  87. SetGraphicAngle(0,0,0);
  88. SetGraphicScale(1,1);
  89. SetRenderState(ALPHA);
  90. SetAlpha(100);
  91. SetColor(255, 255, 255);
  92. SetGraphicRect(0,0,64,64);
  93. if(f == 50){
  94. f=0;
  95. }
  96.  
  97. if(GetSpeedX()==0){
  98. if(f<10){SetGraphicRect(0,0,64,64);}
  99. if(f>=10 && f<20){SetGraphicRect(64,0,128,64);}
  100. if(f>=20 && f<30){SetGraphicRect(128,0,192,64);}
  101. if(f>=40){SetGraphicRect(192,0,256,64);}
  102. f++;
  103. }
  104.  
  105. SetAlpha(255);
  106. SetRenderState(ALPHA);
  107. SetGraphicScale(1,1);
  108. DrawGraphic(GetX,GetY);
  109.  
  110. }
  111. @BackGround{
  112. scroll += 1;
  113.  
  114.  
  115. SetTexture(BG);
  116. SetGraphicRect(0,0,384,448);
  117. SetAlpha(255);
  118. SetRenderState(ALPHA);
  119. SetGraphicAngle(0, 0, 0);
  120. SetGraphicScale(1,1);
  121. DrawGraphic(GetCenterX,GetCenterY);
  122.  
  123. SetTexture(BG2);
  124. SetGraphicRect(0,(0+scroll),512,(512+scroll));
  125. SetAlpha(255);
  126. SetRenderState(ALPHA);
  127. SetGraphicScale(1,1);
  128. SetGraphicAngle(0, 0, 0);
  129. DrawGraphic(GetCenterX,GetCenterY);
  130. }
  131. @Finalize {
  132. DeleteGraphic(BG);
  133. DeleteGraphic(BG2);
  134. }
  135.  
  136.  
  137. task Main{
  138. loop(60){yield;}
  139. RedStar;
  140.  
  141. }
  142. ////////////////////////////////////////////////////////////////////////////////////////////////////
  143. //////////////////////////////////////Begining of the red///////////////////////////////////////////
  144. ////////////////////////////////////////////////////////////////////////////////////////////////////
  145.  
  146. ///////LAUNCHER///////
  147.  
  148. task RedStar{
  149. let time = 240;
  150. loop(6){
  151. let angle = 270;
  152. let u = 100;
  153. PlaySE(GetCurrentScriptDirectory~"sound\BulletWave.wav");
  154. loop(5){
  155. RedLaser(GetPlayerX+u*cos(angle),GetPlayerY+u*sin(angle),angle+180-(360/20),((u*cos(18))*2)*1.02,6,2,10,u);
  156. angle+=(360/5)*2;
  157. }
  158.  
  159. loop(time){yield;}
  160. time-=10;
  161. }
  162. loop(380){yield;}
  163. DeleteEnemyShotToItem(ALL);
  164. OrangeStar;
  165.  
  166.  
  167. }
  168.  
  169. ///////BULLET SPAWN///////
  170. task RedStar2(x,y,radius,density,an,graphic){
  171.  
  172. let angle = an;
  173. let angle2 = an+180;
  174. let u = radius;
  175. let u2 = 0;
  176. let lag = density+120;
  177. PlaySE(GetCurrentScriptDirectory~"sound\Shot1.wav");
  178. loop(density){
  179.  
  180. let oX = x;
  181. let oY = y;
  182. RedBullet(oX-u2*cos(angle),oY-u2*sin(angle),0,angle2,graphic,10,lag);
  183.  
  184. u2+=((u*2)/(density));
  185. angle2+=7;
  186.  
  187. }
  188.  
  189. }
  190. ///////BULLETS///////
  191. task RedBullet(x,y,s,angle,g,d,t) {
  192.  
  193. let obj = Obj_Create(OBJ_SHOT);
  194. Obj_SetSpeed(obj,s);
  195. Obj_SetAngle(obj,angle);
  196. ObjShot_SetGraphic(obj,g);
  197. Obj_SetPosition(obj,x,y);
  198. ObjShot_SetBombResist(obj,true);
  199. ObjShot_SetDelay(obj,d);
  200.  
  201. loop(t){yield;}
  202.  
  203. loop(120){
  204. Obj_SetSpeed(obj,Obj_GetSpeed(obj)+0.005);
  205. yield;
  206. }
  207. yield;
  208. }
  209.  
  210. ///////LASER///////
  211.  
  212. task RedLaser(x, y, a, Len, width, graphic, turn, big) {
  213.  
  214.  
  215. let obj = Obj_Create(OBJ_LASER);
  216.  
  217. Obj_SetPosition (obj,x,y);
  218. Obj_SetAngle (obj, a);
  219. ObjLaser_SetLength (obj, Len);
  220. ObjLaser_SetWidth (obj, width);
  221. ObjShot_SetGraphic(obj, graphic);
  222. ObjLaser_SetSource(obj, false);
  223. Obj_SetAutoDelete(obj,false);
  224.  
  225. let x1 = Obj_GetX(obj);
  226. let y1 = Obj_GetY(obj);
  227. let x2 = GetX;
  228. let y2 = GetY;
  229. let dir = 0;
  230. let ang = atan2(y2-y1,x2-x1);
  231.  
  232. /////////////////////turn around player/////////////////////
  233.  
  234. while(turn >= 0.5){
  235. turn-=0.05;
  236.  
  237. Obj_SetPosition (obj,GetPlayerX+(big)*cos(a+180+360/20),GetPlayerY+(big)*sin(a+180+360/20));
  238. Obj_SetAngle (obj, a);
  239. ObjLaser_SetWidth (obj, 2);
  240. Obj_SetCollisionToPlayer (obj,false);
  241. a+=turn;
  242.  
  243. yield;
  244. }
  245.  
  246. /////////////////////become solid/////////////////////
  247.  
  248. loop(31){
  249. Obj_SetPosition (obj,GetPlayerX+(big)*cos(a+180+360/20),GetPlayerY+(big)*sin(a+180+360/20));
  250. Obj_SetAngle (obj, a);
  251. a+=0.5;
  252. yield;
  253. }
  254. let Xdown = GetPlayerX;
  255. let Ydown = GetPlayerY;
  256. loop(60){yield;}
  257.  
  258. while(ObjLaser_GetWidth(obj) < width){
  259. ObjLaser_SetWidth(obj,ObjLaser_GetWidth(obj)+0.5);
  260. yield;
  261. }
  262. PlaySE(GetCurrentScriptDirectory~"sound\Laser2.wav");
  263. ObjLaser_SetWidth (obj, width);
  264. Obj_SetCollisionToPlayer(obj,true);
  265.  
  266. /////////////////////check///////////////////////////
  267. if(Ydown>GetPlayerY){dir = 1;}
  268. if(Ydown<=GetPlayerY){dir = 2;}
  269. loop(60){yield;}
  270. let count = 24;
  271.  
  272. /////////////////////go!go!go!up/////////////////////
  273.  
  274. alternative(dir)
  275. case(1){
  276. while(Ydown >= GetClipMinY-50){
  277. count++;
  278. Ydown-=5;
  279. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  280. Obj_SetAngle (obj, a);
  281. a+=7;
  282. if(count%35==0 && Obj_GetX(obj) > GetClipMinX-75){
  283. RedStar2(Obj_GetX(obj),Obj_GetY(obj),big,20,a+180-5,83);
  284. }
  285.  
  286. if(Ydown < GetClipMinY-50){
  287. Obj_Delete(obj);
  288. }
  289. yield;
  290. }
  291. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  292. Obj_Delete(obj);
  293. }
  294.  
  295. /////////////////////go!go!down!/////////////////////
  296.  
  297. case(2){
  298. while(Ydown <= GetClipMaxY+50){
  299. count++;
  300. Ydown+=5;
  301. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  302. Obj_SetAngle (obj, a);
  303. a+=7;
  304. if(count%35==0 && Obj_GetX(obj) > GetClipMinX-75){
  305. RedStar2(Obj_GetX(obj),Obj_GetY(obj),big,20,a+180-5,83);
  306. }
  307. if(Ydown > GetClipMaxY+50){
  308.  
  309.  
  310. }
  311. yield;
  312. }
  313. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  314. Obj_Delete(obj);
  315. }
  316.  
  317. //////////////////////////////////////////////////////////
  318.  
  319. if(Obj_GetX(obj) <= 10 || Obj_GetY(obj) <=10 || Obj_GetY(obj) >= GetClipMaxY+10 || Obj_GetX(obj) <= GetClipMaxX+10){Obj_Delete(obj);}
  320.  
  321. }
  322. ////////////////////////////////////////////////////////////////////////////////////////////////////
  323. ///////////////////////////////////////////End of the red///////////////////////////////////////////
  324. ////////////////////////////////////////////////////////////////////////////////////////////////////
  325.  
  326.  
  327. ////////////////////////////////////////////////////////////////////////////////////////////////////
  328. //////////////////////////////////////Begining of the green/////////////////////////////////////////
  329. ////////////////////////////////////////////////////////////////////////////////////////////////////
  330.  
  331. task GreenStar{
  332. let time = 150;
  333. loop(10){
  334. PlaySE(GetCurrentScriptDirectory~"sound\BulletWave.wav");
  335. /////////Top/////////
  336. let angle = 270;
  337. let u = 65;
  338.  
  339. loop(5){
  340. GreenLaser(GetPlayerX+u*cos(angle),(GetClipMinY-u)+u*sin(angle),angle+180-(360/20),((u*cos(18))*2)*1.02,6,6,2,u,0,2,1);
  341. angle+=(360/5)*2;
  342. }
  343. /////////Bottom/////////
  344. let angle = 270;
  345. let u = 65;
  346.  
  347. loop(5){
  348. GreenLaser(GetPlayerX+u*cos(angle),(GetClipMaxY+u)+u*sin(angle),angle+180-(360/20),((u*cos(18))*2)*1.02,6,6,2,u,0,-2,2);
  349. angle+=(360/5)*2;
  350. }
  351. /////////Left/////////
  352. let angle = 270;
  353. let u = 65;
  354.  
  355. loop(5){
  356. GreenLaser((GetClipMinX-u)+u*cos(angle),GetPlayerY+u*sin(angle),angle+180-(360/20),((u*cos(18))*2)*1.02,6,6,2,u,2,0,3);
  357. angle+=(360/5)*2;
  358. }
  359. /////////Right/////////
  360. let angle = 270;
  361. let u = 65;
  362.  
  363. loop(5){
  364. GreenLaser((GetClipMaxX+u)+u*cos(angle),GetPlayerY+u*sin(angle),angle+180-(360/20),((u*cos(18))*2)*1.02,6,6,2,u,-2,0,4);
  365. angle+=(360/5)*2;
  366. }
  367. loop(time){yield;}
  368. time -= 7;
  369. }
  370.  
  371. loop(150){yield;}
  372. DeleteEnemyShotToItem(ALL);
  373. BlueStar;
  374. }
  375.  
  376.  
  377. task GreenLaser(x, y, a, Len, width, graphic, turn, big, Xfall, Yfall,type) {
  378.  
  379.  
  380. let obj = Obj_Create(OBJ_LASER);
  381.  
  382. Obj_SetPosition (obj,x,y);
  383. Obj_SetAngle (obj, a);
  384. ObjLaser_SetLength (obj, Len);
  385. ObjLaser_SetWidth (obj, width);
  386. ObjShot_SetGraphic(obj, graphic);
  387. ObjLaser_SetSource(obj, false);
  388. Obj_SetAutoDelete(obj,false);
  389.  
  390.  
  391. alternative(type)
  392. /////////////////////Top To Bottom/////////////////////
  393. case(1){
  394. let Xdown = GetPlayerX;
  395. let Ydown = GetClipMinY-big;
  396. while(Ydown <= GetClipMaxY+100){
  397. Ydown+=Yfall;
  398. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  399. Obj_SetAngle (obj, a);
  400. a+=turn;
  401.  
  402. if(Ydown >= GetClipMaxY+100){
  403. Obj_Delete(obj);
  404. }
  405. yield;
  406. }
  407. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  408. Obj_Delete(obj);
  409. }
  410. /////////////////////Bottom To Top/////////////////////
  411. case(2){
  412. let Xdown = GetPlayerX;
  413. let Ydown = GetClipMaxY+big;
  414. while(Ydown >= GetClipMinY-100){
  415. Ydown+=Yfall;
  416. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  417. Obj_SetAngle (obj, a);
  418. a+=turn;
  419.  
  420. if(Ydown <= GetClipMinY-100){
  421. Obj_Delete(obj);
  422. }
  423. yield;
  424. }
  425. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  426. Obj_Delete(obj);
  427. }
  428. /////////////////////Left To Right/////////////////////
  429. case(3){
  430. let Xdown = GetClipMinX-big;
  431. let Ydown = GetPlayerY;
  432. while(Xdown <= GetClipMaxX+100){
  433. Xdown+=Xfall;
  434. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  435. Obj_SetAngle (obj, a);
  436. a+=turn;
  437.  
  438. if(Ydown >= GetClipMaxX+100){
  439. Obj_Delete(obj);
  440. }
  441. yield;
  442. }
  443. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  444. Obj_Delete(obj);
  445. }
  446. /////////////////////Right To Left/////////////////////
  447. case(4){
  448. let Xdown = GetClipMaxX+big;
  449. let Ydown = GetPlayerY;
  450. while(Xdown >= GetClipMinX-100){
  451. Xdown+=Xfall;
  452. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  453. Obj_SetAngle (obj, a);
  454. a+=turn;
  455.  
  456. if(Ydown <= GetClipMinX-100){
  457. Obj_Delete(obj);
  458. }
  459. yield;
  460. }
  461. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  462. Obj_Delete(obj);
  463. }
  464. }
  465.  
  466. ////////////////////////////////////////////////////////////////////////////////////////////////////
  467. /////////////////////////////////////////End of the green///////////////////////////////////////////
  468. ////////////////////////////////////////////////////////////////////////////////////////////////////
  469.  
  470.  
  471.  
  472. ////////////////////////////////////////////////////////////////////////////////////////////////////
  473. //////////////////////////////////////Begining of the orange/////////////////////////////////////////
  474. ////////////////////////////////////////////////////////////////////////////////////////////////////
  475.  
  476.  
  477. ///////LAUNCHER///////
  478. task OrangeStar{
  479.  
  480. let angle = 270;
  481. let u = 230;
  482. let time = 120;
  483.  
  484. loop(5){
  485. OrangeLaser(GetCenterX+u*cos(angle),(GetCenterY+15)+u*sin(angle),angle+180-(360/20),((u*cos(18))*2),6,8,10,u,time);
  486. time+=85;
  487. angle+=(360/5)*2;
  488. }
  489. yield;
  490. loop(2200){yield;}
  491. DeleteEnemyShotToItem(ALL);
  492. }
  493. ///////BULLET SPAWN///////
  494. task OrangeStar2(x,y,radius,density,an,graphic){
  495.  
  496. let acc = 0;
  497. loop(3){
  498. let angle = an;
  499. let angle2 = an+(acc/5)+180;
  500. let angle3 = an+(acc/5)+180;
  501. let u = radius;
  502. let u2 = 0;
  503. let lag = density+120;
  504.  
  505. loop(density-3){
  506.  
  507. let oX = x;
  508. let oY = y;
  509. PlaySE(GetCurrentScriptDirectory~"sound\Shot1.wav");
  510. RedBullet(oX-u2*cos(angle),oY-u2*sin(angle),0,angle3,graphic,10,lag);
  511. RedBullet(oX-u2*cos(angle),oY-u2*sin(angle),0,angle2,graphic,10,lag);
  512. u2+=((u*2)/(density));
  513. angle2+=7;
  514. angle3+=360/5/density;
  515. lag+=1;
  516.  
  517. loop(1){yield;}
  518. }
  519. loop(85*4){yield;}}
  520.  
  521. }
  522. ///////LASER///////
  523. task OrangeLaser(x, y, a, Len, width, graphic, turn, big,t) {
  524.  
  525.  
  526. let obj = Obj_Create(OBJ_LASER);
  527.  
  528. Obj_SetPosition (obj,x,y);
  529. Obj_SetAngle (obj, a);
  530. ObjLaser_SetLength (obj, Len);
  531. ObjLaser_SetWidth (obj, width);
  532. ObjShot_SetGraphic(obj, graphic);
  533. ObjLaser_SetSource(obj, false);
  534. Obj_SetAutoDelete(obj,false);
  535. Obj_SetCollisionToPlayer(obj,false);
  536. ObjLaser_SetWidth (obj, 2);
  537.  
  538. loop(t){yield;}
  539. PlaySE(GetCurrentScriptDirectory~"sound\Laser2.wav");
  540. ObjLaser_SetWidth (obj, width+3);
  541. Obj_SetCollisionToPlayer(obj,true);
  542.  
  543. OrangeStar2(Obj_GetX(obj),Obj_GetY(obj),big,85,a+180,94);
  544. while(!Obj_BeDeleted(obj)){
  545. let angle = a+180+((360-36)/48);
  546. loop(12){
  547. CreateShot01(Obj_GetX(obj),Obj_GetY(obj),rand(5,1),angle+rand(-144,144+18),177,0);
  548.  
  549. } loop(4){yield;} }
  550.  
  551. }
  552.  
  553. ////////////////////////////////////////////////////////////////////////////////////////////////////
  554. ///////////////////////////////////////////End of orange////////////////////////////////////////////
  555. ////////////////////////////////////////////////////////////////////////////////////////////////////
  556.  
  557.  
  558. ////////////////////////////////////////////////////////////////////////////////////////////////////
  559. //////////////////////////////////////Begining of the violet/////////////////////////////////////////
  560. ////////////////////////////////////////////////////////////////////////////////////////////////////
  561.  
  562. task VioletStar{
  563.  
  564. /////////////1/////////
  565. let u = 80;
  566. let Y = 65-1650;
  567. let angle = 270;
  568. PlaySE(GetCurrentScriptDirectory~"sound\Shot2.wav");
  569. loop(11){
  570. let X = 94-1400;
  571. loop(11){
  572.  
  573.  
  574.  
  575. loop(5){
  576. VioletLaser(X+u*cos(angle),Y+u*sin(angle),angle+180-(360/20),((u*cos(18))*2)*1.02+2,10,3,1,u,X,Y,45);
  577. angle+=(360/5)*2;
  578. }
  579. X+=65*2;
  580. u-=0.5;
  581. }
  582. Y+=150;
  583.  
  584. }
  585. loop(780){yield;}
  586. /////////2//////////
  587. PlaySE(GetCurrentScriptDirectory~"sound\Shot2.wav");
  588. let u = 80;
  589. let Y = 65-1650;
  590. let angle = 270;
  591. loop(11){
  592. let X = 94+1700;
  593. loop(11){
  594.  
  595.  
  596.  
  597. loop(5){
  598. VioletLaser(X+u*cos(angle),Y+u*sin(angle),angle+180-(360/20),((u*cos(18))*2)*1.02+2,10,3,-1,u,X,Y,135);
  599. angle+=(360/5)*2;
  600. }
  601. X-=65*2;
  602. u-=0.5;
  603. }
  604. Y+=150;
  605.  
  606.  
  607.  
  608. }
  609. loop(780){yield;}
  610. loop(60){yield;}
  611. DeleteEnemyShotToItem(ALL);
  612. RedStar;
  613.  
  614.  
  615. }
  616. ///////LASER///////
  617. task VioletLaser(x, y, a, Len, width, graphic, turn, big,X,Y,fall) {
  618.  
  619.  
  620. let obj = Obj_Create(OBJ_LASER);
  621.  
  622. Obj_SetPosition (obj,x,y);
  623. Obj_SetAngle (obj, a);
  624. ObjLaser_SetLength (obj, Len);
  625. ObjLaser_SetWidth (obj, width);
  626. ObjShot_SetGraphic(obj, graphic);
  627. ObjLaser_SetSource(obj, false);
  628. Obj_SetAutoDelete(obj,false);
  629. Obj_SetCollisionToPlayer(obj,true);
  630. let phase = 1;
  631. let u = 0;
  632.  
  633. while(!Obj_BeDeleted(obj)){
  634. let Xdown = X+u*cos(fall);
  635. let Ydown = Y+u*sin(fall);
  636.  
  637. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  638. Obj_SetAngle (obj, a);
  639. a+=turn/2;
  640. if(phase == 1){u+=3;}
  641.  
  642. yield;
  643. if((Obj_GetX(obj) > GetClipMaxX+big+50 && turn == 1) || (Obj_GetX(obj) < GetClipMinX-big-50 && turn == -1) || Obj_GetY(obj) > GetClipMaxY+big+50 ){Obj_Delete(obj);}
  644. }
  645.  
  646. }
  647.  
  648.  
  649. ////////////////////////////////////////////////////////////////////////////////////////////////////
  650. ////////////////////////////////////////End of the violet///////////////////////////////////////////
  651. ////////////////////////////////////////////////////////////////////////////////////////////////////
  652.  
  653. ////////////////////////////////////////////////////////////////////////////////////////////////////
  654. //////////////////////////////////////Begining of the blue//////////////////////////////////////////
  655. ////////////////////////////////////////////////////////////////////////////////////////////////////
  656.  
  657. task BlueStar{
  658. loop(4){
  659. PlaySE(GetCurrentScriptDirectory~"sound\Laser2.wav");
  660. let angle = 270;
  661. let u = 50;
  662.  
  663. loop(5){
  664. BlueLaser((0-u)+u*cos(angle),50+u*sin(angle),angle+180-(360/20),((u*cos(18))*2)*1.02,6,4,5,u,GetClipMinX-u,60,3);
  665. angle+=(360/5)*2;
  666. }
  667. loop(108){yield;}}
  668.  
  669. loop(630){yield;}
  670. DeleteEnemyShotToItem(ALL);
  671. VioletStar;
  672. }
  673. ///////BULLET SPAWN///////
  674. task BlueStar2(x,y,radius,density,an,graphic,X,Y){
  675.  
  676. let angle = an;
  677. let angle2 = an;
  678. let u = radius;
  679. let u2 = 0;
  680. let lag = density+60;
  681.  
  682. loop(density){
  683.  
  684. let oX = x;
  685. let oY = y;
  686. if(oX > 0){
  687. BlueBullet(oX-u2*cos(angle),oY-u2*sin(angle),0,angle2,graphic,10,lag);
  688. }
  689. u2+=((u*2)/(density));
  690. angle2=atan2(GetPlayerY-X,GetPlayerX-Y);
  691.  
  692. }
  693.  
  694. }
  695. ///////BULLETS///////
  696. task BlueBullet(x,y,s,angle,g,d,t) {
  697.  
  698. let bullet = Obj_Create(OBJ_SHOT);
  699. Obj_SetPosition(bullet,x,y);
  700. Obj_SetSpeed(bullet,s);
  701. Obj_SetAngle(bullet,atan2(GetPlayerY-Obj_GetY(bullet),GetPlayerX-Obj_GetX(bullet)));
  702. ObjShot_SetGraphic(bullet,g);
  703. ObjShot_SetBombResist(bullet,false);
  704. ObjShot_SetDelay(bullet,d);
  705.  
  706. loop(t){yield;}
  707.  
  708. while(!Obj_BeDeleted(bullet)){
  709. Obj_SetSpeed(bullet,Obj_GetSpeed(bullet)+0.0075);
  710. if(Obj_GetX(bullet) <= 0 && Obj_GetY(bullet) <= 0){Obj_Delete(bullet);}
  711. yield;
  712. }
  713. yield;
  714. }
  715.  
  716. task BlueLaser(x, y, a, Len, width, graphic, turn, big,X,Y,fall) {
  717.  
  718.  
  719. let obj = Obj_Create(OBJ_LASER);
  720.  
  721. Obj_SetPosition (obj,x,y);
  722. Obj_SetAngle (obj, a);
  723. ObjLaser_SetLength (obj, Len);
  724. ObjLaser_SetWidth (obj, width);
  725. ObjShot_SetGraphic(obj, graphic);
  726. ObjLaser_SetSource(obj, false);
  727. Obj_SetAutoDelete(obj,false);
  728. Obj_SetCollisionToPlayer(obj,true);
  729. let phase = 1;
  730. let u = 0;
  731. let count = 0;
  732. let density = 10;
  733.  
  734. while(!Obj_BeDeleted(obj)){
  735. //////Left => Right/////
  736. while(phase == 1){
  737.  
  738. let Xdown = X;
  739. let Ydown = Y;
  740.  
  741. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  742. Obj_SetAngle (obj, a);
  743. a+=turn;
  744. X+=fall;
  745. count++;
  746. if(count%99==0 && Obj_GetX(obj) > GetClipMinX-75){
  747. BlueStar2(Obj_GetX(obj),Obj_GetY(obj),big,density,a+180-5,87,X,Y);
  748. PlaySE(GetCurrentScriptDirectory~"sound\Shot1.wav");
  749. }
  750. if(X >= 448-70 && phase == 1){phase = 2;}
  751. yield;
  752. }
  753. //////Right => Bottom/////
  754. while(phase == 2){
  755.  
  756. let Xdown = X;
  757. let Ydown = Y;
  758. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  759. Obj_SetAngle (obj, a);
  760. a+=turn;
  761. Y+=fall;
  762. count++;
  763. if(count%99==0 && Obj_GetX(obj) > GetClipMinX-75){
  764. BlueStar2(Obj_GetX(obj),Obj_GetY(obj),big,density,a+180-5,87,X,Y);
  765. PlaySE(GetCurrentScriptDirectory~"sound\Shot1.wav");
  766. }
  767. if(Y >= 480-60 && phase == 2){phase = 3;}
  768. yield;
  769. }
  770. //////Bottom => Left/////
  771. while(phase == 3){
  772.  
  773. let Xdown = X;
  774. let Ydown = Y;
  775. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  776. Obj_SetAngle (obj, a);
  777. a+=turn;
  778. X-=fall;
  779. count++;
  780. if(count%99==0 && Obj_GetX(obj) > GetClipMinX-75){
  781. BlueStar2(Obj_GetX(obj),Obj_GetY(obj),big,density,a+180-5,87,X,Y);
  782. PlaySE(GetCurrentScriptDirectory~"sound\Shot1.wav");
  783. }
  784. if(X <= 0+70 && phase == 3){phase = 4;}
  785. yield;
  786. }
  787. //////Right => Bottom/////
  788. while(phase == 4){
  789.  
  790. let Xdown = X;
  791. let Ydown = Y;
  792. Obj_SetPosition (obj,Xdown+(big)*cos(a+180+360/20),Ydown+(big)*sin(a+180+360/20));
  793. Obj_SetAngle (obj, a);
  794. a+=turn;
  795. Y-=fall;
  796. count++;
  797. if(count%99==0 && Obj_GetX(obj) > GetClipMinX-75){
  798. BlueStar2(Obj_GetX(obj),Obj_GetY(obj),big,density,a+180-5,87,X,Y);
  799. PlaySE(GetCurrentScriptDirectory~"sound\Shot1.wav");
  800. }
  801. if(Y <= 0+60 && phase == 4){phase = 1;}
  802. yield;
  803. }
  804.  
  805.  
  806. yield;
  807. if((Obj_GetX(obj) > GetClipMaxX+big+50 && turn == 1) || (Obj_GetX(obj) < GetClipMinX-big-50 && turn == -1) || Obj_GetY(obj) > GetClipMaxY+big+50 ){Obj_Delete(obj);}
  808. }
  809.  
  810. }
  811.  
  812.  
  813. ////////////////////////////////////////////////////////////////////////////////////////////////////
  814. //////////////////////////////////////End of the blue///////////////////////////////////////////////
  815. ////////////////////////////////////////////////////////////////////////////////////////////////////
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831. ///////////////COMMON FUNTIONS///////////////
  832. task time{
  833. loop{
  834. loop(60){yield;}
  835. if(GetTimer<=10){PlaySE(GetCurrentScriptDirectory~"sound\timeout.wav");}
  836. if(GetTimer<=5){PlaySE(GetCurrentScriptDirectory~"sound\timeout2.wav");}
  837. yield;
  838. }
  839. }
  840.  
  841. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement