Advertisement
Guest User

Untitled

a guest
Nov 20th, 2014
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.74 KB | None | 0 0
  1. /////////FAIRY_ANIM.TXT (WORKS WITH THE ANIMATION LIBRARY FROM BLARGEL)\\\\\\\\\\\
  2.  
  3. #include_function "script\enm\stage1\AnimationLib.txt"
  4. let ImgFairy = GetCurrentScriptDirectory ~ ".img\enemy.png";
  5.  
  6. CreateAnimation("fairy_b", "idle", 1);
  7. SetAnimationFrame("fairy_b", "idle", 0, ImgFairy, 1, 4, 0, 42, 30);
  8. SetAnimationFrame("fairy_b", "idle", 0, ImgFairy, 1, 54, 0, 92, 30);
  9. SetAnimationFrame("fairy_b", "idle", 0, ImgFairy, 1, 104, 0, 142, 30);
  10. SetAnimationFrame("fairy_b", "idle", 0, ImgFairy, 1, 154, 0, 192, 30);
  11.  
  12. CreateAnimation("fairy_b", "left", 1);
  13. SetAnimationFrame("fairy_b", "left", 0, ImgFairy, 1, 0, 128, 128, 256);
  14.  
  15. CreateAnimation("fairy_b", "right", 1);
  16. SetAnimationFrame("fairy_b", "right", 0, ImgFairy, 1, 0, 256, 128, 384);
  17.  
  18. CreateAnimation("fairy_b", "attack", 1);
  19. SetAnimationFrame("fairy_b", "attack", 0, ImgFairy, 1, 0, 384, 128, 512);
  20.  
  21. ///////////02.txt (ENEMY SCRIPT) \\\\\\\\\\\\
  22.  
  23. //Start Fairy. Shoots Semi-Aimed Danmaku
  24.  
  25. script_enemy_main
  26. {
  27.  
  28. let csd = GetCurrentScriptDirectory;
  29.  
  30. let CustomShot = "\lib\Supershot\supershot.txt";
  31. //let Shot1 = csd ~ ".\enm1se\se_bigshot.wav";
  32. //let Shot2 = csd ~ ".\enm1se\se_bigshot.wav";
  33.  
  34. let cx = GetCenterX; let cy = GetCenterY;
  35. let minx = GetClipMinX; let maxx = GetClipMaxX;
  36. let miny = GetClipMinY; let maxy = GetClipMaxY;
  37. let atp = GetAngleToPlayer;
  38.  
  39. let count = 0;
  40.  
  41. /////////////////////////////////////////////////
  42.  
  43. @Initialize
  44. {
  45. /*** *** Declare Initial *** ***/
  46. SetLife(1);
  47. SetDamageRate(0, 0);
  48. SetScore(1000);
  49. MainTask;
  50. Animate("fairy_b", "idle", true);
  51.  
  52. /*** *** Loading Data *** ***/
  53.  
  54. LoadUserShotData(CustomShot);
  55. LoadGraphic(ImgFairy);
  56. }
  57.  
  58. /////////////////////////////////////////////////
  59.  
  60. @MainLoop
  61. {
  62.  
  63. /*** *** Interaction Logic *** ***/
  64.  
  65. SetCollisionA(GetX, GetY, 24);
  66. SetCollisionB(GetX, GetY, 12);
  67.  
  68.  
  69. yield;
  70.  
  71. }
  72.  
  73. /////////////////////////////////////////////////
  74.  
  75. @DrawLoop
  76. {
  77.  
  78. DrawAnimatedSprite("fairy_b", GetX, GetY);
  79.  
  80. }
  81.  
  82. /////////////////////////////////////////////////
  83.  
  84. @Finalize
  85. {
  86.  
  87. }
  88.  
  89. /////////////////////////////////////////////////
  90.  
  91. task MainTask
  92. {
  93.  
  94. SetSpeed(1);
  95. SetAngle(0);
  96. }
  97.  
  98. #include_function ".\Fairy_Anim.txt";
  99. }
  100.  
  101. //////////////// Task_Stage.txt (Stage Script) \\\\\\\\\\\\\\
  102.  
  103. #TouhouDanmakufu[Stage]
  104. #Title[Stage 1]
  105. #Text[None]
  106. #Player[player\Reimu\Hakurei.txt]
  107. #ScriptVersion[2]
  108.  
  109. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  110.  
  111. script_stage_main
  112. {
  113.  
  114. let csd = GetCurrentScriptDirectory;
  115.  
  116. let StageBGM = GetCurrentScriptDirectory ~ ".\bgm\02.mp3";
  117. let BossBGM = GetCurrentScriptDirectory ~ ".\bgm\03.mp3";
  118.  
  119. let BG1 = GetCurrentScriptDirectory ~ ".\world\stg1a.png";
  120. let BG2 = GetCurrentScriptDirectory ~ ".\world\stg1b.png";
  121. let BG3 = GetCurrentScriptDirectory ~ ".\world\stg1c.png";
  122.  
  123. let ImgFairy = csd ~ ".enm\stage1\enemy\img\enemy.png";
  124.  
  125. let Mid1 = GetCurrentScriptDirectory ~ ".\enm\stage1\Midboss_Plural_1.txt";
  126. let Mid2 = GetCurrentScriptDirectory ~ ".\enm\stage1\Midboss_Plural_2.txt";
  127.  
  128. let Fairy1 = GetCurrentScriptDirectory ~ ".\enm\stage1\enemy\02.txt";
  129. let Fairy = [Fairy1];
  130.  
  131. let bgscroll = 0;
  132. let a = 0;
  133. let angle = 0;
  134. let move0 = 0;
  135. let move1 = 0;
  136. let C_Value1 = 60;
  137. let C_Value2 = 80;
  138. let C_Value3 = 80;
  139.  
  140. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  141.  
  142. @Initialize
  143. {
  144.  
  145. SetCommonData("Difficulty", "Easy");
  146.  
  147. LoadGraphic(BG1);
  148. LoadGraphic(BG2);
  149. LoadGraphic(BG3);
  150. LoadGraphic(ImgFairy);
  151. LoadMusic(StageBGM);
  152. LoadMusic(BossBGM);
  153.  
  154. CompileEnemyFromFile(Fairy1);
  155. StageTask;
  156.  
  157. }
  158.  
  159. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  160.  
  161. task StageTask
  162. {
  163.  
  164. loop(90){yield}
  165.  
  166. PlayMusic(StageBGM);
  167.  
  168. CreateEnemyFromFile(Fairy1, GetClipMinX - 20, GetCenterY , 1, 0, 0);
  169.  
  170. loop(500){yield}
  171. alternative(GetCommonData("Difficulty"))
  172. case("Easy"){CreateEnemyBossFromFile(Mid1,0,0,0,0,0);}
  173. case("Normal"){CreateEnemyBossFromFile(Mid1,0,0,0,0,0);}
  174. case("Hard"){CreateEnemyBossFromFile(Mid2,0,0,0,0,0);}
  175. case("Lunatic"){CreateEnemyBossFromFile(Mid2,0,0,0,0,0);}
  176.  
  177. loop(60){yield}
  178. while(IsBossExisting){yield;}
  179.  
  180. loop(60){C_Value1++; C_Value2-=0.33; C_Value3+=0.75; yield;}
  181.  
  182. loop(300){yield}
  183.  
  184. PlayMusic(BossBGM);
  185.  
  186. //CreateEnemyBossFromFile(Boss[0],0,0,0,0,0);
  187. loop(60){yield}
  188. while(IsBossExisting){yield;}
  189.  
  190. loop(5000){yield}
  191.  
  192. Clear;
  193.  
  194. }
  195.  
  196. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  197.  
  198. @MainLoop
  199. {
  200.  
  201. bgscroll+=0.75;
  202. a++;
  203. move0++;
  204.  
  205. yield;
  206.  
  207. }
  208.  
  209. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  210.  
  211. @BackGround
  212. {
  213.  
  214. WriteZBuffer(true);
  215. UseZBuffer(true);
  216.  
  217. SetPerspectiveClip(100, 1500);
  218. SetFog(300, 600, C_Value1, C_Value2, C_Value3); //Green Mist, Pre-Midoss
  219. SetViewTo(0, 0, 0);
  220. SetViewFrom(900-move0, 70+move0/10*2, 55-move0/10);
  221.  
  222. if(move0<100)
  223. {
  224. move1+=0.5;
  225. a+=2;
  226. }
  227. move0=100.0*sin(move1);
  228.  
  229. SetTexture(BG1);
  230. SetGraphicRect(0, 0-a/2, 1000, 1000-a/2);
  231. SetGraphicAngle(130, 0, 0);
  232. DrawGraphic3D(0, 0, 0);
  233.  
  234. SetTexture(BG1);
  235. SetGraphicRect(0, 0-a/2, 1000, 1000-a/2);
  236. SetGraphicAngle(80, 0, 0);
  237. DrawGraphic3D(0, 0, 0);
  238.  
  239. SetTexture(BG2);
  240. SetGraphicRect(0, 0+a/2*1.2, 1000, 1000+a/2*1.2);
  241. SetGraphicAngle(300, 0, 0);
  242. SetAlpha(255);
  243. SetGraphicScale(1, 1);
  244. DrawGraphic3D(300, 200, 200);
  245.  
  246. SetTexture(BG2);
  247. SetGraphicRect(0, 0+a/2*1.2, 1000, 1000+a/2*1.2);
  248. SetGraphicAngle(300, 0, 0);
  249. SetAlpha(255);
  250. SetGraphicScale(-1, 1);
  251. DrawGraphic3D(-300, 200, 200);
  252.  
  253. }
  254.  
  255.  
  256. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  257.  
  258. @Finalize
  259. {
  260.  
  261. }
  262.  
  263. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement