KarinaSnow

My Third Non-Spell!

Mar 17th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. #TouhouDanmakufu[Single]
  2. #ScriptVersion[3]
  3. #Title["Karina's Third Non-Spell"]
  4. #Text["By Karina, [r]Thank you Sparen, your tutorial helped quite alot."]
  5. #BGM[""]
  6.  
  7. #include"script/default_system/Default_ShotConst.txt"
  8.  
  9. let objBoss;
  10. let objScene=GetEnemyBossSceneObjectID();
  11. let count = 0;
  12.  
  13. @Event{
  14. alternative(GetEventType())
  15. case(EV_REQUEST_LIFE){
  16. SetScriptResult(1650);
  17. }
  18. case(EV_REQUEST_TIMER){
  19. SetScriptResult(60);
  20. }
  21. }
  22.  
  23. @Initialize{
  24. objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  25. ObjEnemy_Regist(objBoss);
  26. let imgExRumia = GetCurrentScriptDirectory ~ "ExRumia.png";
  27. ObjPrim_SetTexture(objBoss, imgExRumia);
  28. ObjSprite2D_SetSourceRect(objBoss, 64, 1, 127, 64);
  29. ObjSprite2D_SetDestCenter(objBoss);
  30. ObjMove_SetDestAtFrame(objBoss, GetCenterX, 60, 60);
  31. if(count==0){
  32. movement;
  33. }
  34. TFinalize;
  35. }
  36.  
  37.  
  38.  
  39. @MainLoop{
  40. ObjEnemy_SetIntersectionCircleToShot((objBoss), ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 32);
  41. ObjEnemy_SetIntersectionCircleToPlayer((objBoss), ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 24);
  42. if(count==0){
  43. TDrawLoop;}
  44. if(count%5==0&&count>=60){
  45. fire;
  46. }
  47. if(count%35==0&&count>=60){
  48. fireB;
  49. }
  50. if(count%140==0&&count>=60){
  51. homingring(3);
  52. }
  53. count++;
  54. yield;
  55. }
  56.  
  57. task fire{
  58. if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;}
  59. let angleT = GetAngleToPlayer(objBoss);
  60. loop(25){
  61. CreateShotA2(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), -3.5, count,0.15, 3, DS_BALL_S_ORANGE, 5);
  62. CreateShotA2(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), -4, count+120,0.15, 3, DS_BALL_S_YELLOW, 5);
  63. CreateShotA2(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), -4.5, count-120, 0.15, 3, DS_BALL_S_WHITE, 5);
  64. angleT+=360/25;
  65. }
  66. }
  67. task fireB{
  68. if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;}
  69. let angle = 0;
  70. while(angle<360&&count%2==0){
  71. CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 2.5, angle, DS_BALL_S_A_PURPLE, 30);
  72. angle += 10;
  73. }
  74. while(angle<360&&!count%2==0){
  75. CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 2.5, angle+5, DS_BALL_S_A_PURPLE, 30);
  76. angle += 10;
  77. }
  78. }
  79.  
  80. task homingring(i){
  81. if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;}
  82. let angle = 0;
  83. while(angle<360){
  84. let obj = CreateShotA2(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 5, angle, -0.10, 1, DS_ICE_RED+i, 30);
  85. ObjMove_AddPatternA4(obj, 60, 3, 0, 0, 0, 3+(i/3), GetPlayerObjectID, NO_CHANGE);
  86. angle += 15;
  87. if(i==7){
  88. i=0;
  89. }
  90. i++;
  91. }
  92. }
  93. task movement{
  94. while(ObjEnemy_GetInfo(objBoss,INFO_LIFE)>0){
  95. ObjMove_SetDestAtFrame(objBoss, rand(GetCenterX+120,GetCenterX-120), rand(GetCenterY-120,GetCenterY-120), 60);
  96. wait(200);
  97. }
  98. }
  99.  
  100. task TDrawLoop {
  101. let imgExRumia = GetCurrentScriptDirectory ~ "ExRumia.png";
  102. ObjPrim_SetTexture(objBoss, imgExRumia);
  103. ObjSprite2D_SetSourceRect(objBoss, 64, 1, 127, 64);
  104. }
  105.  
  106. task TFinalize {
  107. while(ObjEnemy_GetInfo(objBoss,INFO_LIFE)>0){yield;}
  108. if(ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SHOOTDOWN_COUNT)
  109. +ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SPELL_COUNT) == 0){
  110. AddScore(ObjEnemyBossScene_GetInfo(objScene,INFO_SPELL_SCORE));
  111. }
  112. Obj_Delete(objBoss);
  113. DeleteShotAll(TYPE_ALL,TYPE_IMMEDIATE);
  114. SetAutoDeleteObject(true);
  115. CloseScript(GetOwnScriptID());
  116. return;
  117. }
  118.  
  119. function GetCenterX{
  120. return GetStgFrameWidth/2;
  121. }
  122.  
  123. function GetCenterY{
  124. return GetStgFrameHeight/2;
  125. }
  126.  
  127. function wait(n){
  128. loop(n){yield;}
  129. }
Advertisement
Add Comment
Please, Sign In to add comment