Advertisement
Guest User

Untitled

a guest
Sep 19th, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. #TouhouDanmakufu[Single]
  2. #ScriptVersion[3]
  3. #Title["Shingeki no Ellen"]
  4. #Text["Ellen a repere quelqu'un un peu trop enclin a parler anglais. Cette personne est Reimu. Saura-t-elle empecher Ellen Catablor de lui faire gouter a son pouvoir du goulag eternel ?"]
  5.  
  6. let bossObj;
  7. let bossX = 0;
  8. let bossY = 0;
  9. let animFrame = 0;
  10. let animFrame2 = 0;
  11.  
  12. let imgBoss = GetCurrentScriptDirectory ~ "jojolen.png";
  13. let bg = GetCurrentScriptDirectory ~ "shitlen.png";
  14.  
  15. #include"script/default_system/ZUNShot_Const.txt"
  16. #include"script/default_system/Default_Effect.txt"
  17. #include"script/default_system/Default_ShotConst.txt"
  18.  
  19. @Initialize {
  20.  
  21. let objScene = GetEnemyBossSceneObjectID();
  22. ObjEnemyBossScene_StartSpell(objScene);
  23.  
  24. // define a boss in bossObj and register it
  25. bossObj = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  26. ObjEnemy_Regist(bossObj);
  27.  
  28. // warp boss to this location when initialized.
  29. ObjMove_SetPosition(bossObj,300,300);
  30.  
  31. LoadSound(GetCurrentScriptDirectory ~ "ellen.mp3");
  32. PlayBGM(GetCurrentScriptDirectory ~ "ellen.mp3",0,384);
  33.  
  34. // move boss to desired x y location at desired speed
  35. ObjMove_SetDestAtSpeed(bossObj,192,120,5);
  36.  
  37. mainTask; // run mainTask
  38. }
  39.  
  40. @Event {
  41. // setting the boss timer and life
  42. alternative(GetEventType())
  43. case(EV_REQUEST_LIFE) {
  44. SetScriptResult(10000);
  45. }
  46. case(EV_REQUEST_TIMER) {
  47. SetScriptResult(600);
  48. }
  49. case(EV_REQUEST_SPELL_SCORE) {
  50. SetScriptResult(30000);
  51. }
  52. }
  53.  
  54. @MainLoop {
  55. bossX = ObjMove_GetX(bossObj);
  56. bossY = ObjMove_GetY(bossObj);
  57.  
  58. // collision for shot and player
  59. ObjEnemy_SetIntersectionCircleToShot(bossObj,bossX,bossY,35);
  60. ObjEnemy_SetIntersectionCircleToPlayer(bossObj,bossX,bossY,35);
  61. yield;
  62. }
  63.  
  64. @Finalize { }
  65.  
  66. // your best friend, forever.
  67. function wait(w) { loop(w) { yield; } }
  68.  
  69. task mainTask {
  70. renderBoss;
  71. renderBG;
  72. movement;
  73. TEnd;
  74. }
  75.  
  76. task renderBG {
  77. let obj = ObjPrim_Create(OBJ_SPRITE_2D);
  78. Obj_SetRenderPriorityI(obj,21);
  79. ObjPrim_SetTexture(obj,bg);
  80. ObjSprite2D_SetSourceRect(obj,0,0,475,475);
  81. ObjSprite2D_SetDestRect(obj,0,0,GetStgFrameWidth,GetStgFrameHeight);
  82. }
  83.  
  84. task renderBoss {
  85. let dir;
  86. let speed;
  87.  
  88. // texture the boss, set centre as true centre.
  89. ObjPrim_SetTexture(bossObj,imgBoss);
  90. ObjSprite2D_SetSourceRect(bossObj,0,0,193,217);
  91. ObjSprite2D_SetDestCenter(bossObj);
  92. ObjRender_SetScaleXYZ(bossObj,1.0,1.0,0);
  93.  
  94. task movement {
  95. wait(60);
  96. while(!Obj_IsDeleted(bossObj)) {
  97. fire;
  98. wait(30);
  99. yield;
  100. }
  101. }
  102.  
  103. task fire {
  104. let radius = 32;
  105. let direction = 0;
  106. let numberOfBullets = 36;
  107. loop(numberOfBullets) {
  108. CreateShotA1(bossX+radius*cos(direction),bossY+radius*sin(direction),5,direction,54,0);
  109. CreateShotA1(bossX+radius*cos(direction),bossY+radius*sin(direction),5,direction,156,30);
  110. direction += 360/numberOfBullets;
  111. }
  112.  
  113. loop(60) { yield; }
  114. }
  115.  
  116. task TEnd
  117. {
  118. while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > 0) {
  119. yield;
  120. }
  121.  
  122. TExplosionA(bossX,bossY,10,0.5);
  123. Obj_Delete(bossObj);
  124. DeleteShotAll(TYPE_ALL, TYPE_ITEM);
  125. wait(30);
  126. CloseScript(GetOwnScriptID());
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement