Mewkyuu

rogus spell 1

Sep 9th, 2011
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.11 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[Grass sign - Growth of beautiful Fantasy -]
  3. #Text[Not everyone can see...]
  4. #Player[FREE]
  5. #ScriptVersion[2]
  6. #BGM[bgm\Medicine.mp3]
  7.  
  8. script_enemy_main{
  9.  
  10. let CSD = GetCurrentScriptDirectory;
  11. CreateEnemyFromScript("Familiar6", GetCenterX, GetCenterY-60, 0, 0, NULL);
  12. let imgBoss = CSD ~ "system\Kora.png";
  13. let cut = CSD ~ "system\Koracut.png";
  14. let bg = CSD ~ "system\Temple.png";
  15. let imagefile = CSD ~ "system\DanmakuFlower.png";
  16.  
  17. @Initialize{
  18. SetLife(10000);
  19. SetTimer(120);
  20. SetScore(100000);
  21. SetMovePosition01(GetCenterX,GetCenterY,5);
  22. LoadGraphic(imgBoss);
  23. LoadGraphic(imagefile);
  24. LoadGraphic(cut);
  25. LoadGraphic(bg);
  26.  
  27. CutIn(YOUMU,"Grass sign - Growth of beautiful Fantasy -",cut,0,0,300,384);
  28.  
  29. mainTask;
  30. }
  31.  
  32. @MainLoop{
  33. SetCollisionA(GetX,GetY,32);
  34. SetCollisionB(GetX,GetY,16);
  35. yield;
  36. }
  37.  
  38. @DrawLoop{
  39.  
  40. // data for the boss
  41. SetTexture(imgBoss);
  42. SetRenderState(ALPHA);
  43. SetAlpha(225);
  44. SetGraphicRect(0,0,110,110);
  45. SetGraphicScale(0.5,0.5);
  46. SetGraphicAngle(0,0,0);
  47. DrawGraphic(GetX,GetY);
  48.  
  49. }
  50.  
  51. @BackGround{
  52. SetTexture(bg);
  53. SetRenderState(ALPHA);
  54. SetAlpha(225);
  55. SetGraphicRect(0,0,512,512);
  56. SetGraphicScale(1,1);
  57. SetGraphicAngle(0,0,0);
  58. DrawGraphic(GetCenterX,GetCenterY);
  59.  
  60. }
  61.  
  62. @Finalize{
  63. // delete the image from memory
  64. DeleteGraphic(imgBoss);
  65. DeleteGraphic(cut);
  66. DeleteGraphic(bg);
  67. DeleteGraphic(imagefile);
  68.  
  69. }
  70.  
  71. task TaiyouEffect(x,y) {
  72. let dir = 0;
  73. let size = 1;
  74. let b = 128;
  75. let objid = Obj_Create(OBJ_EFFECT);
  76. Obj_SetX(objid, x);
  77. Obj_SetY(objid, y);
  78. ObjEffect_SetLayer(objid, 1);
  79. ObjEffect_SetTexture(objid, imagefile);
  80. ObjEffect_SetPrimitiveType(objid, PRIMITIVE_TRIANGLEFAN);
  81. ObjEffect_CreateVertex(objid, 4);
  82. ObjEffect_SetVertexXY(objid, 0, -b, -b);
  83. ObjEffect_SetVertexXY(objid, 1, b, -b);
  84. ObjEffect_SetVertexXY(objid, 2, b, b);
  85. ObjEffect_SetVertexXY(objid, 3, -b, b);
  86. ObjEffect_SetVertexUV(objid, 0, 0, 0);
  87. ObjEffect_SetVertexUV(objid, 1, b*2, 0);
  88. ObjEffect_SetVertexUV(objid, 2, b*2, b*2);
  89. ObjEffect_SetVertexUV(objid, 3, 0, b*2);
  90. ObjEffect_SetVertexUV(objid, 0, 0, 0);
  91. ObjEffect_SetVertexUV(objid, 1, b*2, 0);
  92. ObjEffect_SetVertexUV(objid, 2, b*2, b*2);
  93. ObjEffect_SetVertexUV(objid, 3, 0, b*2);
  94. ObjEffect_SetRenderState(objid, ALPHA);
  95. ascent(i in 0..4) { ObjEffect_SetVertexColor(objid, i, 255, 255, 255, 255); }
  96. let grazecounter = 0; let togivegraze = 5;
  97. while(!Obj_BeDeleted(objid)){
  98. ObjEffect_SetScale(objid, size, size);
  99. SetCollisionB(Obj_GetX(objid),Obj_GetY(objid),b*size*9/10);
  100. Obj_SetAngle(objid,0);
  101. Obj_SetPosition(objid, Obj_GetX(objid),Obj_GetY(objid));
  102. if(Obj_GetX(objid)>GetClipMaxX+256){Obj_Delete(objid);}
  103. if(Obj_GetX(objid)<GetClipMinX-256){Obj_Delete(objid);}
  104. if(Obj_GetY(objid)>GetClipMaxY+256){Obj_Delete(objid);}
  105. if(Obj_GetY(objid)<GetClipMinY-256){Obj_Delete(objid);}
  106. grazecounter++;
  107. if(((GetPlayerX-Obj_GetX(objid))^2+(GetPlayerY-Obj_GetY(objid))^2)^0.5 < b*1.1 && grazecounter == togivegraze) { grazecounter = 0; AddGraze(1); }
  108. yield;
  109. }
  110. }
  111.  
  112. task movement{
  113. loop{
  114. SetMovePosition01(GetCenterX-100,120,1);
  115. wait(480);
  116. SetMovePosition01(GetCenterX+90,300,1);
  117. wait(480);
  118. SetMovePosition01(GetCenterX-110,300,1);
  119. wait(480);
  120. yield;
  121. }
  122. }
  123.  
  124.  
  125. // main task, activates stuff.
  126. task mainTask{
  127. wait(140);
  128. yield;
  129. fire;
  130. }
  131.  
  132. task fire2{
  133.  
  134. loop(1){
  135. PlaySE(CSD ~ "\system\bom17_c.wav");
  136. TaiyouEffect(GetEnemyX,GetEnemyY);
  137. yield;
  138. }
  139. }
  140.  
  141.  
  142. task fire{
  143. let x = 0;
  144. let dir = 270;
  145.  
  146. while(x<16){
  147. superbullet3(GetEnemyX+50*cos(dir),GetEnemyY+50*sin(dir),0.5,dir,GREEN03,0);
  148. dir+=22.5;
  149. x++;
  150. }
  151. }
  152.  
  153. task superbullet3(x,y,v,dir,graphic,delay){
  154.  
  155. let obj = Obj_Create(OBJ_SHOT);
  156.  
  157. Obj_SetPosition(obj,x,y);
  158. Obj_SetSpeed(obj,v);
  159. Obj_SetAngle(obj,dir);
  160. ObjShot_SetGraphic(obj,graphic);
  161. ObjShot_SetDelay(obj,delay);
  162. ObjShot_SetBombResist(obj,true);
  163.  
  164. while(!Obj_BeDeleted(obj)){
  165.  
  166. wait(240);
  167. Obj_SetSpeed(obj,0.4);
  168. Obj_SetAngle(obj,dir-180);
  169. ObjShot_SetGraphic(obj,GREEN03);
  170. loop(10){
  171. CreateShot01(Obj_GetX(obj),Obj_GetY(obj),0.5,dir,GREEN01,0);
  172. dir+=360/10;
  173. }
  174. wait(20);
  175. loop(10){
  176. CreateShot01(Obj_GetX(obj),Obj_GetY(obj),0.5,dir,GREEN01,0);
  177. dir+=360/10;
  178. }
  179. loop(10){
  180. CreateShot01(Obj_GetX(obj),Obj_GetY(obj),0.5,dir,GREEN01,0);
  181. dir+=360/10;
  182. }
  183. loop(10){
  184. CreateShot01(Obj_GetX(obj),Obj_GetY(obj),0.5,dir,GREEN01,0);
  185. dir+=360/10;
  186. }
  187. wait(20);
  188. loop(10){
  189. CreateShot01(Obj_GetX(obj),Obj_GetY(obj),0.5,dir,GREEN01,0);
  190. dir+=360/10;
  191. }
  192. wait(20);
  193. loop(10){
  194. CreateShot01(Obj_GetX(obj),Obj_GetY(obj),0.5,dir,GREEN01,0);
  195. dir+=360/10;
  196. }
  197. wait(20);
  198. loop(10){
  199. CreateShot01(Obj_GetX(obj),Obj_GetY(obj),0.5,dir,GREEN01,0);
  200. dir+=360/10;
  201. }
  202. wait(480);
  203. yield;
  204. }
  205. superbullet3(x,y,v,dir,graphic,delay);
  206. }
  207.  
  208. task fire3{
  209.  
  210. loop{
  211. ascent(i in 20..30){
  212. CreateLaserB(i, 600, 100, BLUE04,80);
  213. SetLaserDataB(i, 0, 0, 100, 0, 180+i*12, 0.5, 0+i*12, 0.3);
  214. SetShotKillTime(i,120);
  215. FireShot(i);}
  216. wait(360);
  217.  
  218. yield;
  219. }
  220. }
  221.  
  222. task fire4{
  223.  
  224. loop{
  225. ascent(i in 0..30){
  226. CreateLaserB(i, 200, 100, RED04,80);
  227. SetLaserDataB(i, 0, 0, 100, 0, 180+i*12, 0.2, 0+i*12, 2);
  228. SetShotKillTime(i,120);
  229. FireShot(i);}
  230. wait(480);
  231.  
  232. yield;
  233. }
  234. }
  235.  
  236. task fire5{
  237. let x = 0;
  238. let dir = 0;
  239.  
  240. loop{
  241. while(x<36){
  242. CreateShotA(1,GetCenterX+30*cos(dir),GetCenterY+30*sin(dir),30);
  243. SetShotDataA(1,0,0,dir,0,0,0,BLUE04);
  244. SetShotDataA(1,60,2,dir,0.9,0,3,BLUE04);
  245. SetShotKillTime(1,840);
  246. FireShot(1);
  247.  
  248. dir+=360/6;
  249. x++;
  250. }
  251. x = 0;
  252. dir = 0;
  253. wait(60);
  254. yield;
  255. }
  256. }
  257.  
  258. // wait function
  259. function wait(w){
  260. loop(w){yield;}
  261. }
  262.  
  263.  
  264.  
  265.  
  266. }
  267.  
  268. -----------------------------------------------------------------------------------------------------------------
  269.  
  270. script_enemy Familiar6
  271. {
  272. let CSD = GetCurrentScriptDirectory;
  273. let x=GetX();
  274. let y=GetY();
  275. let arg=GetArgument();
  276. let enemyspeed=GetSpeed();
  277. let shotgra=GetAngle();
  278. let minX=GetClipMinX();
  279. let maxX=GetClipMaxX();
  280. let minY=GetClipMinY();
  281. let maxY=GetClipMaxY();
  282. let cenX=GetCenterX();
  283. let cenY=GetCenterY();
  284. let seal=GetCurrentScriptDirectory~".\system\seal1.png";
  285. let imagefile = CSD ~ "system\DanmakuFlower.png";
  286.  
  287. let ang=0;
  288. let g_angle=0;
  289. let length=0;
  290. let count=80;
  291. let flg=0;
  292.  
  293. //include_function "lib\SHOT_REPLACE\shot_replace.dnh"
  294.  
  295. @Initialize
  296. {
  297. SetX(x);
  298. SetY(y);
  299.  
  300. LoadGraphic(seal);
  301. LoadGraphic(imagefile);
  302. SetLife(100);
  303. //shotinit;
  304.  
  305. mainTask;
  306. }
  307.  
  308. @MainLoop { yield; }
  309.  
  310. task mainTask{
  311. wait(120);
  312. tasuku;
  313. fire3;
  314. wait(60);
  315. fire2;
  316. yield;
  317. }
  318.  
  319. task TaiyouEffect(x,y) {
  320. let dir = 0;
  321. let size = 0.5;
  322. let b = 128;
  323. let objid = Obj_Create(OBJ_EFFECT);
  324. Obj_SetX(objid, x);
  325. Obj_SetY(objid, y);
  326. ObjEffect_SetLayer(objid, 1);
  327. ObjEffect_SetTexture(objid, imagefile);
  328. ObjEffect_SetPrimitiveType(objid, PRIMITIVE_TRIANGLEFAN);
  329. ObjEffect_CreateVertex(objid, 4);
  330. ObjEffect_SetVertexXY(objid, 0, -b, -b);
  331. ObjEffect_SetVertexXY(objid, 1, b, -b);
  332. ObjEffect_SetVertexXY(objid, 2, b, b);
  333. ObjEffect_SetVertexXY(objid, 3, -b, b);
  334. ObjEffect_SetVertexUV(objid, 0, 0, 0);
  335. ObjEffect_SetVertexUV(objid, 1, b*2, 0);
  336. ObjEffect_SetVertexUV(objid, 2, b*2, b*2);
  337. ObjEffect_SetVertexUV(objid, 3, 0, b*2);
  338. ObjEffect_SetVertexUV(objid, 0, 0, 0);
  339. ObjEffect_SetVertexUV(objid, 1, b*2, 0);
  340. ObjEffect_SetVertexUV(objid, 2, b*2, b*2);
  341. ObjEffect_SetVertexUV(objid, 3, 0, b*2);
  342. ObjEffect_SetRenderState(objid, ALPHA);
  343. ascent(i in 0..4) { ObjEffect_SetVertexColor(objid, i, 255, 255, 255, 255); }
  344. let grazecounter = 0; let togivegraze = 5;
  345. while(!Obj_BeDeleted(objid)){
  346. ObjEffect_SetScale(objid, size, size);
  347. SetCollisionB(Obj_GetX(objid),Obj_GetY(objid),b*size*7/10);
  348. Obj_SetAngle(objid,atan2(GetEnemyY-Obj_GetY(objid),GetEnemyX-Obj_GetX(objid)));
  349. Obj_SetSpeed(objid,0.5);
  350. Obj_SetPosition(objid, Obj_GetX(objid),Obj_GetY(objid));
  351. if(Obj_GetX(objid)>GetClipMaxX+256){Obj_Delete(objid);}
  352. if(Obj_GetX(objid)<GetClipMinX-256){Obj_Delete(objid);}
  353. if(Obj_GetY(objid)>GetClipMaxY+256){Obj_Delete(objid);}
  354. if(Obj_GetY(objid)<GetClipMinY-256){Obj_Delete(objid);}
  355. grazecounter++;
  356. if(((GetPlayerX-Obj_GetX(objid))^2+(GetPlayerY-Obj_GetY(objid))^2)^0.5 < b*1.1 && grazecounter == togivegraze) { grazecounter = 0; AddGraze(1); }
  357. yield;
  358. }
  359. }
  360.  
  361. task tasuku { loop {
  362. SetMovePosition02(GetEnemyX+0*cos(ang), GetEnemyY+0*sin(ang), 15); ang+=-35/4;ang%=360; yield;
  363. }
  364. }
  365.  
  366. task movement{
  367. SetMovePosition02(GetEnemyX+35*cos(ang), GetEnemyX+35*sin(ang), 15); ang+=7/4;ang%=360; yield;
  368. }
  369.  
  370. task fire2{
  371.  
  372. loop(1){
  373. wait(40);
  374. PlaySE(CSD ~ "\system\se_kira00.wav");
  375. TaiyouEffect(GetEnemyX,GetEnemyY);
  376. yield;
  377. }
  378. }
  379.  
  380. task fire3{
  381. loop(1){
  382. Concentration01(100);
  383. yield;
  384. }
  385. }
  386.  
  387. task fire121{
  388. let x = 0;
  389. let dir = 0;
  390.  
  391. loop{
  392. while(x<36){
  393. CreateShotA(1,GetX,GetY,90);
  394. SetShotDataA(1,0,0,dir,0,0,0,YELLOW02);
  395. SetShotDataA(1,60,1,-dir,0,0,0,YELLOW02);
  396.  
  397.  
  398. FireShot(1);
  399.  
  400. dir+=360/36;
  401. x++;
  402. }
  403. x = 0;
  404. dir = 0;
  405. wait(60);
  406. yield;
  407. }
  408. }
  409.  
  410. task fire155{
  411. let x = 0;
  412. let dir = 90;
  413.  
  414. while(x<16){
  415. superbulletac(GetX+50*cos(dir),GetY+50*sin(dir),0.6,dir+180,WHITE02,0);
  416. dir+=60;
  417. x++;
  418. }
  419. }
  420.  
  421. task superbulletac(x,y,v,dir,graphic,delay){
  422.  
  423. let obj = Obj_Create(OBJ_SHOT);
  424.  
  425. Obj_SetPosition(obj,x,y);
  426. Obj_SetSpeed(obj,v);
  427. Obj_SetAngle(obj,dir);
  428. ObjShot_SetGraphic(obj,graphic);
  429. ObjShot_SetDelay(obj,delay);
  430. ObjShot_SetBombResist(obj,true);
  431.  
  432. while(!Obj_BeDeleted(obj)){
  433.  
  434. wait(80);
  435. Obj_SetSpeed(obj,0.5);
  436. Obj_SetAngle(obj,dir+90);
  437. ObjShot_SetGraphic(obj,WHITE02);
  438. loop(8){
  439. CreateShot01(Obj_GetX(obj),Obj_GetY(obj),2,dir,PURPLE04,0);
  440. dir+=360/8;
  441. }
  442. loop(30){
  443. CreateShot01(Obj_GetX(obj),Obj_GetY(obj),2,dir,RED04,0);
  444. dir+=360/30;
  445. }
  446. wait(120);
  447. loop(8){
  448. CreateShot01(Obj_GetX(obj),Obj_GetY(obj),1,dir,BLUE04,0);
  449. dir+=360/8;
  450. }
  451. wait(5);
  452. loop(8){
  453. CreateShot01(Obj_GetX(obj),Obj_GetY(obj),1,dir,GREEN04,0);
  454. dir+=360/8;
  455. }
  456. wait(5);
  457. loop(8){
  458. CreateShot01(Obj_GetX(obj),Obj_GetY(obj),1,dir,YELLOW04,0);
  459. dir+=360/8;
  460. }
  461. wait(5);
  462. loop(8){
  463. CreateShot01(Obj_GetX(obj),Obj_GetY(obj),1,dir,BLUE04,0);
  464. dir+=360/8;
  465. }
  466. wait(5);
  467. loop(8){
  468. CreateShot01(Obj_GetX(obj),Obj_GetY(obj),1,dir,GREEN04,0);
  469. dir+=360/8;
  470. }
  471. wait(5);
  472. loop(8){
  473. CreateShot01(Obj_GetX(obj),Obj_GetY(obj),1,dir,YELLOW04,0);
  474. dir+=360/8;
  475. }
  476. wait(60);
  477. Obj_Delete(obj);
  478. wait(30);
  479. yield;
  480. }
  481. superbulletac(x,y,v,dir,graphic,delay);
  482. }
  483.  
  484.  
  485. function wait(n){loop(n){yield;}}
  486. function GetGapX(x,gapLength,gapAngle){return x+gapLength*cos(gapAngle);}
  487. function GetGapY(y,gapLength,gapAngle){return y+gapLength*sin(gapAngle);}
  488.  
  489. @DrawLoop
  490. {
  491. SetTexture(seal);
  492. SetGraphicRect(1,1,256,256);
  493. SetAlpha(128);
  494. SetGraphicAngle(0,0,0);
  495. DrawGraphic(GetX(),GetY());
  496. SetGraphicAngle(0,0,0);
  497. }
  498.  
  499. @Finalize
  500. {
  501. DeleteGraphic(imagefile);
  502. }
  503.  
  504. }
Advertisement
Add Comment
Please, Sign In to add comment