Advertisement
Lunarethic

Untitled

Nov 12th, 2013
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.80 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[Trap Sign "Ice Cage"]
  3. #Text[Cirno's Spell Card]
  4. #BGM[script\cirno\bgm\Marisa.mp3]
  5. #PlayLevel[Lunatic]
  6. #Player[FREE]
  7. #ScriptVersion[2]
  8.  
  9. script_enemy_main {
  10.  
  11. let CSD = GetCurrentScriptDirectory;
  12.  
  13. let boss = CSD ~ "system/anm.png";
  14. let cut = CSD ~ "system/cirnocutin.png";
  15. let bg = CSD ~ "bg/trapbg.png";
  16. let lay = CSD ~ "system/lay.png";
  17. let slide = 0;
  18. let spell = CSD ~ "sfx/Spell.wav";
  19. let sfx1 = CSD ~ "sfx/ReverseA.wav";
  20. let sfx2 = CSD ~ "sfx/ShotB.wav";
  21. let sfx3 = CSD ~ "sfx/ShotA.wav";
  22. let sfx4 = CSD ~ "sfx/Shot2.wav";
  23. let concenfx = CSD ~ "sfx/Concen.wav";
  24.  
  25. let f = 0;
  26. let f2 = 0;
  27.  
  28. @Initialize {
  29. LoadSE(spell);
  30. PlaySE(spell);
  31. LoadSE(sfx2);
  32. LoadSE(concenfx);
  33. LoadSE(sfx1);
  34. LoadSE(sfx3);
  35. SetLife(500);
  36. SetDamageRate(10,15);
  37. SetTimer(90);
  38. SetScore(48000000);
  39. SetShotAutoDeleteClip(100,100,100,100);
  40. SetMovePosition01(GetCenterX, GetClipMinY + 120, 5);
  41. LoadGraphic(boss);
  42. LoadGraphic(cut);
  43. LoadGraphic(bg);
  44. LoadGraphic(lay);
  45. LoadSE(sfx4);
  46.  
  47. CutIn(YOUMU, "Trap Sign"\""Ice Cage"\",cut,0,0,507,600);
  48.  
  49. mainTask;
  50.  
  51. }
  52.  
  53. @MainLoop {
  54. SetCollisionA(GetX,GetY,24);
  55. SetCollisionB(GetX,GetY,16);
  56. yield;
  57. }
  58.  
  59. @DrawLoop {
  60.  
  61. SetTexture(boss);
  62. SetRenderState(ALPHA);
  63. SetAlpha(255);
  64. SetGraphicScale(1,1);
  65. SetGraphicAngle(0,0,0);
  66.  
  67. if(int(GetSpeedX())==0){
  68. if(f<10){ SetGraphicRect(0,0,64,64); }
  69. if(f>=10 && f<20){ SetGraphicRect(64,0,128,64); }
  70. if(f>=20 && f<30){ SetGraphicRect(128,0,192,64); }
  71. if(f>=30 && f<40){ SetGraphicRect(192,0,256,64); }
  72. f2=0;
  73. }
  74.  
  75. if(GetSpeedX()>0){
  76. if(f2<5){ SetGraphicRect(0,64,64,128); }
  77. if(f2>=5 && f2<10){ SetGraphicRect(64,64,128,128); }
  78. if(f2>=10 && f2<15){ SetGraphicRect(128,64,192,128); }
  79. if(f2>=15){ SetGraphicRect(192,64,256,128); }
  80. f2++;
  81. }
  82.  
  83. if(GetSpeedX()<0){
  84. SetGraphicAngle(180,0,0);
  85. if(f2<5){ SetGraphicRect(0,64,64,128); }
  86. if(f2>=5 && f2<10){ SetGraphicRect(64,64,128,128); }
  87. if(f2>=10 && f2<15){ SetGraphicRect(128,64,192,128); }
  88. if(f2>=15){ SetGraphicRect(192,64,256,128); }
  89. f2++;
  90. }
  91.  
  92. DrawGraphic(GetX,GetY);
  93.  
  94. f++;
  95. if(f==40){f=0;}
  96.  
  97. }
  98.  
  99. @BackGround {
  100.  
  101. SetTexture(bg);
  102. SetRenderState(ALPHA);
  103. SetAlpha(255);
  104. SetGraphicRect(0,0,1600,1118);
  105. SetGraphicScale(1,1);
  106. SetGraphicAngle(0,0,0);
  107. DrawGraphic(GetCenterX,GetCenterY);
  108.  
  109. SetTexture(lay);
  110. SetRenderState(ADD);
  111. SetGraphicRect(0,0,20000,20000);
  112. SetGraphicScale(1,1);
  113. SetGraphicAngle(0,0,0);
  114. DrawGraphic(GetCenterX+slide,GetCenterY+slide);
  115.  
  116. slide+=2;
  117. }
  118.  
  119. @Finalize {
  120. DeleteGraphic(boss);
  121. DeleteGraphic(bg);
  122. DeleteGraphic(cut);
  123. DeleteSE(sfx1);
  124. DeleteSE(sfx2);
  125. DeleteSE(concenfx);
  126. DeleteSE(sfx3);
  127. DeleteSE(sfx4);
  128.  
  129. }
  130.  
  131.  
  132. task mainTask{
  133. yield;
  134. cage;
  135. wait(60);
  136. PlaySE(concenfx);
  137. Concentration01(60);
  138. Concentration02(60);
  139. movement;
  140. }
  141.  
  142. // movement
  143. task movement{
  144. wait(60);
  145. loop{
  146. wait(120);
  147. shot;
  148. wait(100);
  149. spin;
  150. spin2;
  151. wait(10);
  152. SetMovePosition03(GetCenterX-125,GetCenterY,7,5);//goes left
  153. wait(90);
  154. PlaySE(sfx4);
  155. circle(GetEnemyX,GetEnemyY,3,0,1);
  156. circle(GetEnemyX,GetEnemyY,3,-90,1);
  157. circle(GetEnemyX,GetEnemyY,3,90,1);
  158. circle(GetEnemyX,GetEnemyY,3,60,1);
  159. circle(GetEnemyX,GetEnemyY,3,-60,1);
  160. circle(GetEnemyX,GetEnemyY,3,30,1);
  161. circle(GetEnemyX,GetEnemyY,3,-30,1);
  162. wait(240);
  163. SetMovePosition03(GetCenterX+125,GetCenterY,7,5);//goes right
  164. wait(240);
  165. SetMovePosition03(GetCenterX, GetClipMinY + 120,7,5);//goes center
  166. wait(1);
  167. yield;
  168. }
  169. }
  170.  
  171. //object bullet cage
  172. task cage{
  173. wait(190);
  174. PlaySE(sfx1);
  175. loop{
  176. right(GetCenterX+185,GetClipMaxY,20,270);
  177. left(GetCenterX-185,GetClipMaxY,20,270);
  178. top(GetCenterX-185,GetClipMinY,20,0);
  179. bottom(GetCenterX+185,GetClipMaxY,20,180);
  180. diag1(GetCenterX-185,GetClipMinY,20,51); // left side
  181. diag2(GetCenterX+185,GetClipMinY,20,129); // right side
  182. yield;
  183. }
  184. }
  185.  
  186. //right object bullet
  187. task right(x,y,speed,angle){
  188. let obj=Obj_Create(OBJ_SHOT);
  189.  
  190. Obj_SetPosition(obj,x,y);
  191. Obj_SetAngle(obj,angle);
  192. Obj_SetSpeed(obj,speed);
  193. ObjShot_SetGraphic(obj,WHITE04);
  194. ObjShot_SetDelay(obj,5);
  195. ObjShot_SetBombResist(obj,true);
  196.  
  197. while(Obj_BeDeleted(obj)==false) {
  198. yield;
  199. }
  200. }
  201.  
  202. task left(x,y,speed,angle){
  203. let obj=Obj_Create(OBJ_SHOT);
  204.  
  205. Obj_SetPosition(obj,x,y);
  206. Obj_SetAngle(obj,angle);
  207. Obj_SetSpeed(obj,speed);
  208. ObjShot_SetGraphic(obj,WHITE04);
  209. ObjShot_SetDelay(obj,5);
  210. ObjShot_SetBombResist(obj,true);
  211.  
  212. while(Obj_BeDeleted(obj)==false) {
  213. yield;
  214. }
  215. }
  216.  
  217. task top(x,y,speed,angle){
  218. let obj=Obj_Create(OBJ_SHOT);
  219.  
  220. Obj_SetPosition(obj,x,y);
  221. Obj_SetAngle(obj,angle);
  222. Obj_SetSpeed(obj,speed);
  223. ObjShot_SetGraphic(obj,WHITE04);
  224. ObjShot_SetDelay(obj,5);
  225. ObjShot_SetBombResist(obj,true);
  226.  
  227. while(Obj_BeDeleted(obj)==false) {
  228. yield;
  229. }
  230. }
  231.  
  232. task bottom(x,y,speed,angle){
  233. let obj=Obj_Create(OBJ_SHOT);
  234.  
  235. Obj_SetPosition(obj,x,y);
  236. Obj_SetAngle(obj,angle);
  237. Obj_SetSpeed(obj,speed);
  238. ObjShot_SetGraphic(obj,WHITE04);
  239. ObjShot_SetDelay(obj,5);
  240. ObjShot_SetBombResist(obj,true);
  241.  
  242. while(Obj_BeDeleted(obj)==false) {
  243. yield;
  244. }
  245. }
  246.  
  247. task diag1(x,y,speed,angle){
  248. let obj=Obj_Create(OBJ_SHOT);
  249.  
  250. Obj_SetPosition(obj,x,y);
  251. Obj_SetAngle(obj,angle);
  252. Obj_SetSpeed(obj,speed);
  253. ObjShot_SetGraphic(obj,WHITE04);
  254. ObjShot_SetDelay(obj,5);
  255. ObjShot_SetBombResist(obj,true);
  256.  
  257. while(Obj_BeDeleted(obj)==false) {
  258. yield;
  259. }
  260. }
  261.  
  262. task diag2(x,y,speed,angle){
  263. let obj=Obj_Create(OBJ_SHOT);
  264.  
  265. Obj_SetPosition(obj,x,y);
  266. Obj_SetAngle(obj,angle);
  267. Obj_SetSpeed(obj,speed);
  268. ObjShot_SetGraphic(obj,WHITE04);
  269. ObjShot_SetDelay(obj,5);
  270. ObjShot_SetBombResist(obj,true);
  271.  
  272. while(Obj_BeDeleted(obj)==false) {
  273. yield;
  274. }
  275. }
  276.  
  277. // Attack Center Side
  278. task spin{
  279. let x = 0;
  280. let dir = 0;
  281. wait(1);
  282. loop(1){
  283. PlaySE(sfx3);
  284. while(x<36){
  285. CreateShotA(1,GetEnemyX,GetEnemyY,1);
  286. SetShotDataA(1,0,1,dir,1,-1,3,BLUE21);
  287. SetShotDataA(1,160,1,dir,0,-1,NULL,BLUE21);
  288. FireShot(1);
  289.  
  290. dir+=360/36;
  291. x++;
  292. }
  293. x = 0;
  294. dir = 0;
  295. wait(10);
  296. yield;
  297.  
  298. }
  299. }
  300.  
  301. task spin2{
  302. let x = 0;
  303. let dir = 0;
  304. wait(1);
  305. loop(1){
  306. PlaySE(sfx3);
  307. while(x<36){
  308. CreateShotA(1,GetEnemyX,GetEnemyY,1);
  309. SetShotDataA(1,0,1,dir,-1,-1,3,GREEN21);
  310. SetShotDataA(1,160,1,dir,0,-1,NULL,BLUE21);
  311. FireShot(1);
  312.  
  313. dir+=360/36;
  314. x++;
  315. }
  316. x = 0;
  317. dir = 0;
  318. wait(10);
  319. yield;
  320.  
  321. }
  322. }
  323.  
  324. task shot{
  325. let x = 0;
  326. let dir = 0;
  327. wait(1);
  328. loop(10){
  329. PlaySE(sfx2);
  330. while(x<36){
  331. CreateShotA(1,GetEnemyX,GetEnemyY,1);
  332. SetShotDataA(1,0,1,dir,0,-10,1,BLUE02);
  333. SetShotDataA(1,30,3,dir,0,1,2,NULL);
  334. FireShot(1);
  335.  
  336. dir+=360/5;
  337. x++;
  338. }
  339. x = 0;
  340. dir += 20;
  341. wait(10);
  342. yield;
  343.  
  344. }
  345. }
  346.  
  347. //Attack Left Side
  348. task circle(x,y,v,dir,delay){
  349. let obj=Obj_Create(OBJ_SHOT);
  350. let time = 0;
  351.  
  352. Obj_SetPosition(obj,x,y);
  353. Obj_SetSpeed(obj,v);
  354. Obj_SetAngle(obj,dir);
  355. ObjShot_SetGraphic(obj,RED03);
  356. ObjShot_SetDelay(obj,delay);
  357. ObjShot_SetBombResist(obj,true);
  358.  
  359. //as long as the object exist
  360. while(!Obj_BeDeleted(obj)){
  361.  
  362. //Scatter Shot X side
  363. if(Obj_GetX(obj) > GetClipMaxX) {
  364. PlaySE(sfx1);
  365. loop(15){CreateShot01(Obj_GetX(obj),Obj_GetY(obj),3,dir,BLUE01,0); dir+=360/8; }
  366. Obj_Delete(obj);
  367. }
  368.  
  369. //ScatterSide Y Side MAX
  370. if(Obj_GetY(obj) > GetClipMaxY) {
  371. PlaySE(sfx1);
  372. loop(15){CreateShot01(Obj_GetX(obj),Obj_GetY(obj),3,dir,BLUE01,0); dir+=360/8; }
  373. Obj_Delete(obj);
  374. }
  375.  
  376. //Trail
  377. if(time==5){
  378. PlaySE(sfx3);
  379. CreateShotA(1,Obj_GetX(obj),Obj_GetY(obj),15);
  380. SetShotDataA(1,0,0,rand(0,359),0,0,0,BLUE04);
  381. SetShotDataA(1,160,0,NULL,0,0.01,2,BLUE04);
  382. FireShot(1);
  383. time = 0;
  384.  
  385. }
  386. time++;
  387. yield;
  388. }
  389. }
  390.  
  391. //Wait Function
  392. function wait(w){
  393. loop(w) {yield;}
  394. }
  395.  
  396.  
  397.  
  398. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement