BananaCupcake

Untitled

Oct 15th, 2017
75
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #TouhouDanmakufu[Single]
  2. #ScriptVersion[3]
  3. #Title["Test System Contest or not NONSPELL BOTH 1"]
  4. #Text["???"]
  5.  
  6. // Example, definitely required for cut-in.
  7. let Cutin = GetCurrentScriptDirectory ~ "img/flan_cutin.png";
  8. let imgBoss = GetCurrentScriptDirectory ~ "img/koishisprite.png";
  9. let objBoss;
  10. let objEnemy;
  11. let objScene=GetEnemyBossSceneObjectID();
  12. let size = 0.8;
  13. let type = true;
  14. let obj = 1;
  15. let bSpell = false;
  16. let l = 1024;
  17. let w = 40;
  18. let dt = 1000;
  19. let graph = 41;
  20. let delay = 10;
  21.  
  22. #include "./System !/Default_Effect.txt"
  23. #include "./System !/Shot/AllStarShot_Const.txt"
  24. #include "./Cutin.txt"
  25. #include "./SoundFunctions.txt"
  26. #include "./draw_koishi.txt"
  27. #include "./img/draw_flan2.txt"
  28.  
  29. @Initialize{
  30. objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  31. objEnemy = ObjEnemy_Create(OBJ_ENEMY);
  32. ObjEnemy_Regist(objBoss);
  33. ObjEnemy_Regist(objEnemy);
  34. ObjMove_SetDestAtFrame(objBoss, GetCenterX, 100, 100);
  35. ObjMove_SetDestAtFrame(objEnemy, GetCenterX, 60, 100);
  36. TFinalize;
  37. MainTask;
  38. RenderBG;
  39. DrawName;
  40. TDrawLoop;
  41. TDrawLoop2;
  42. Move;
  43. }
  44.  
  45. @Event {
  46. alternative(GetEventType())
  47. case(EV_REQUEST_LIFE){
  48. SetScriptResult(6000);
  49. }
  50. case(EV_REQUEST_TIMER){
  51. SetScriptResult(150);
  52. }
  53. case(EV_REQUEST_SPELL_SCORE){
  54. SetScriptResult(1000000);
  55. }
  56. }
  57.  
  58. @MainLoop {
  59. ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 32);
  60. ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 24);
  61. ObjEnemy_SetIntersectionCircleToShot(objEnemy, ObjMove_GetX(objEnemy), ObjMove_GetY(objEnemy), 32);
  62. ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ObjMove_GetX(objEnemy), ObjMove_GetY(objEnemy), 24);
  63. let objScene = GetEnemyBossSceneObjectID();
  64. if(objScene != ID_INVALID && ObjEnemyBossScene_GetInfo(objScene, INFO_IS_SPELL))
  65. {
  66. bSpell = false;
  67. }
  68. else
  69. {
  70. bSpell = false;
  71. }
  72. yield;
  73. }
  74.  
  75. task MainTask{
  76. wait(120);
  77. ObjMove_SetDestAtFrame(objBoss, GetCenterX, 20, 60);
  78. ObjMove_SetDestAtFrame(objEnemy, GetCenterX, 150, 90);
  79. magiccircle(objBoss,size,type);
  80. magiccircle2(objEnemy,size,type);
  81. fireKoishi;
  82. fireFlandre;
  83. }
  84.  
  85. task fireKoishi{
  86. while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0) {
  87. let angle = rand(0,360);
  88. let frame = -180;
  89. let frame2 = -180;
  90. wait(40);
  91. PlaySound("Shot7",100,0);
  92. loop(12) {
  93. ascent(i in 0 .. 6) {
  94. CreateShotA2(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 8+0.075*i, angle+3*frame2+2.7*i+1, -0.2+0.01*i, 1.85+0.2*i, 236, 6*i);
  95. }
  96. angle += 360/12;
  97. }
  98. }
  99. }
  100.  
  101. task fireFlandre{
  102. while(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0) {
  103. let angleT = rand(0,360);
  104. let frame3 = -180;
  105. let frame4 = -180;
  106. wait(40);
  107. PlaySound("Shot7",100,0);
  108. loop(12) {
  109. ascent(i in 0 .. 6) {
  110. CreateShotA2(ObjMove_GetX(objEnemy), ObjMove_GetY(objEnemy), 8+0.075*i, angleT+3*frame4+2.7*i+1, -0.2+0.01*i, 1.85+0.2*i, 236, 6*i);
  111. }
  112. angleT += 360/12;
  113. }
  114. }
  115. }
  116.  
  117. task Move{
  118. while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
  119. ObjMove_SetDestAtFrame(objBoss, rand(GetCenterX() + 90, GetCenterX() - 90), rand(GetCenterY() - 90, GetCenterY() - 90), 80);
  120. wait(300);
  121. }
  122. while(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0){
  123. ObjMove_SetDestAtFrame(objEnemy, rand(GetCenterX() + 90, GetCenterX() - 90), rand(GetCenterY() - 90, GetCenterY() - 90), 80);
  124. wait(300);
  125. }
  126. }
  127.  
  128. task DrawName{
  129. let objText = ObjText_Create();
  130. let alpha = 255;
  131. ObjText_SetText(objText, "Koishi & Flandre");
  132. ObjText_SetFontSize(objText, 12);
  133. ObjText_SetFontColorTop(objText, 255, 255, 255);
  134. ObjText_SetFontColorBottom(objText, 0, 255, 128);
  135. ObjText_SetFontBorderType(objText, BORDER_SHADOW);
  136. ObjText_SetFontBorderColor(objText,0, 128, 128);
  137. ObjText_SetFontBorderWidth(objText, 2);
  138. ObjRender_SetPosition(objText,0,12,0);
  139. while(!Obj_IsDeleted(objText)){
  140. if(GetPlayerY>80 && alpha<255){alpha+=10;}
  141. if(GetPlayerY<=80 && alpha>100){alpha-=10;}
  142. ObjRender_SetAlpha(objText,alpha);
  143. yield;
  144. }
  145. }
  146.  
  147. task RenderBG{
  148. let path1 = GetCurrentScriptDirectory() ~ "img/PlaceSnow.png";
  149. let obj1 = ObjPrim_Create(OBJ_SPRITE_2D);
  150. ObjRender_SetBlendType(obj1, BLEND_ALPHA);
  151. Obj_SetRenderPriority(obj1, 0.20);
  152. ObjPrim_SetTexture(obj1, path1);
  153. ObjSprite2D_SetSourceRect(obj1, 0, 0, 384, 448);
  154. ObjSprite2D_SetDestRect(obj1, -256, -256, 256, 256);
  155. ObjRender_SetPosition(obj1, 384/2, 448/2, 1);
  156. let frame = 0;
  157. let alpha = 0;
  158. frame++;
  159. yield;
  160.  
  161. }
  162.  
  163. task magiccircle(objBoss,size,type){
  164. let obj=ObjPrim_Create(OBJ_SPRITE_2D);
  165. let GCSD = GetCurrentScriptDirectory;
  166. let img=GCSD~"img/MG (3).png";
  167. let spin = 0;
  168. let s = 0;
  169. LoadTexture(img);
  170. ObjPrim_SetTexture(obj,img);
  171. ObjSprite2D_SetSourceRect(obj,0,0,256,256);
  172. ObjSprite2D_SetDestCenter(obj);
  173. ObjRender_SetScaleXYZ(obj,size,size,size);
  174. ObjRender_SetAlpha(obj,230);
  175. Obj_SetRenderPriority(obj,0.35);
  176. while(!Obj_IsDeleted(objBoss)){
  177. spin += 3;
  178. ObjRender_SetAngleXYZ(obj,0,0,-spin*1.5);
  179. ObjRender_SetPosition(obj,ObjMove_GetX(objBoss),ObjMove_GetY(objBoss),0);
  180. if(type==true){
  181. ObjRender_SetScaleXYZ(obj,size+0.08*sin(spin),size+0.08*sin(spin),0);
  182. }
  183. ObjMove_SetPosition(obj,ObjMove_GetX(objBoss), ObjMove_GetY(objBoss));
  184. yield;
  185. }
  186. Obj_Delete(obj);
  187. }
  188.  
  189. task magiccircle2(objEnemy,size,type){
  190. let obj=ObjPrim_Create(OBJ_SPRITE_2D);
  191. let GCSD = GetCurrentScriptDirectory;
  192. let img=GCSD~"img/MG (3).png";
  193. let spin = 0;
  194. let s = 0;
  195. LoadTexture(img);
  196. ObjPrim_SetTexture(obj,img);
  197. ObjSprite2D_SetSourceRect(obj,0,0,256,256);
  198. ObjSprite2D_SetDestCenter(obj);
  199. ObjRender_SetScaleXYZ(obj,size,size,size);
  200. ObjRender_SetAlpha(obj,230);
  201. Obj_SetRenderPriority(obj,0.35);
  202. while(!Obj_IsDeleted(objEnemy)){
  203. spin += 3;
  204. ObjRender_SetAngleXYZ(obj,0,0,-spin*1.5);
  205. ObjRender_SetPosition(obj,ObjMove_GetX(objEnemy),ObjMove_GetY(objEnemy),0);
  206. if(type==true){
  207. ObjRender_SetScaleXYZ(obj,size+0.08*sin(spin),size+0.08*sin(spin),0);
  208. }
  209. ObjMove_SetPosition(obj,ObjMove_GetX(objEnemy), ObjMove_GetY(objEnemy));
  210. yield;
  211. }
  212. Obj_Delete(obj);
  213. }
  214.  
  215. task TFinalize{
  216. while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){yield;}
  217. while(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0){yield;}
  218. Obj_Delete(objBoss);
  219. Obj_Delete(objEnemy);
  220. DeleteShotAll(TYPE_ALL,TYPE_IMMEDIATE);
  221. SetAutoDeleteObject(true);
  222. CloseScript(GetOwnScriptID());
  223. return;
  224. }
  225.  
  226. function GetCenterX(){
  227. return GetStgFrameWidth() / 2;
  228. }
  229.  
  230. function GetCenterY(){
  231. return GetStgFrameWidth() / 2;
  232. }
  233.  
  234. function wait(n){
  235. loop(n){yield;}
  236. }
RAW Paste Data