Advertisement
Guest User

Ph3 test code

a guest
Aug 19th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.99 KB | None | 0 0
  1. #TouhouDanmakufu[Single]
  2. #ScriptVersion[3]
  3. #Title["Test script"]
  4. #Text["EX Rumia's First Spell Card : Star Sign?Midnight Reverie?"]
  5. #Image["./img/ExRumia(???????????????).png"]
  6. #Background["script/default_system/Default_Background_IceMountain1.txt"]
  7.  
  8. #include"script/Project/Cutin.txt"
  9. #include"script/Project/Shot/ZUNShot_Const.txt"
  10.  
  11. #include"script/default_system/Default_Effect.txt"
  12. #include"script/Project/Render.txt"
  13. let objEnemy;
  14. let score = 0;
  15. let fail = 0;
  16. let frame2 = 0;
  17. let frame = 0;
  18. let angle = 0;
  19. let objScene = GetEnemyBossSceneObjectID();
  20. let spellcard = "script/Project/se/se_cat00.wav";
  21. let Cutimg = "script/Project/CutKesima.png";
  22. let shot = "script/Project/se/heart.wav";
  23. let bConcentrationMotion = true;
  24. @Initialize
  25. {
  26. // CreateCommonDataArea("SpellFunctions");
  27. // LoadCommonDataAreaA1("SpellFunctions");
  28. objEnemy = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  29. ObjEnemy_Regist(objEnemy);
  30. ObjEnemy_SetDamageRate(objEnemy, 100, 10);//Sets damage rate to 10%
  31. TRender(1);
  32. LoadSound(shot);
  33. LoadSound(spellcard);
  34. PlaySE(spellcard);
  35. TEnd;
  36. CutInS1(objEnemy, "BYAKUREN","Silient Breeze",Cutimg, 0, 0, 300, 400);
  37. ObjEnemyBossScene_StartSpell(objScene);
  38. DeleteShotAll(TYPE_ALL, TYPE_ITEM);//Removes all enemy bullets upon appearance
  39. let GetCenterY = GetStgFrameHeight() / 2;
  40. let GetCenterX = GetStgFrameWidth() / 2;//defines the variable cx as the horizontal middle of the stage. (Stage width / 2)
  41. ObjMove_SetDestAtFrame(objEnemy, GetCenterX, 120, 60);
  42.  
  43.  
  44. }
  45.  
  46. @MainLoop
  47. {
  48. let px = GetPlayerX();
  49. let py = GetPlayerY();
  50.  
  51. let GetX = ObjMove_GetX(objEnemy);
  52. let GetY = ObjMove_GetY(objEnemy);
  53. ObjEnemy_SetIntersectionCircleToShot(objEnemy, GetX, GetY, 32);//Sets the hitbox against player bullets
  54. ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, GetX, GetY, 24);//Sets the hitbox against the player
  55. score = ObjEnemyBossScene_GetInfo(objScene,INFO_SPELL_SCORE);
  56. let angleToPlayer = atan2(py - GetY, px - GetX);
  57. frame++;
  58. frame2++;
  59. angle++;
  60. yield;
  61.  
  62.  
  63.  
  64. if(frame==-120){
  65. loop(5){
  66. CreateShotA1(GetX,GetY,2,-angle,402,10);
  67. CreateShotA1(GetX,GetY,2,angle,401,10);
  68. angle +=360/5;
  69. }
  70. PlaySE(shot);
  71. frame = 100;
  72. }
  73.  
  74. if(frame2==120){
  75.  
  76.  
  77. ObjMove_SetDestAtFrame(objEnemy, GetCenterX+rand(-150,150), GetY, 60);
  78. frame2 = 0;
  79. }
  80.  
  81. if(ObjEnemyBossScene_GetInfo(objScene,INFO_PLAYER_SPELL_COUNT)>=1){
  82. fail = 1;
  83.  
  84. }
  85. if(fail==1){
  86. score = 0;
  87. }
  88.  
  89. }
  90. @Event
  91. {
  92. alternative(GetEventType())
  93. case(EV_REQUEST_LIFE)
  94. {
  95. SetScriptResult(500);//Sets the life to 1500
  96. }
  97. case(EV_REQUEST_TIMER)
  98. {
  99. SetScriptResult(90);//Sets the time limit to 60
  100. }
  101. case(EV_REQUEST_SPELL_SCORE)
  102. {
  103. SetScriptResult(100000);//Sets spellcard bonus to 30000 points
  104. }
  105. }
  106.  
  107.  
  108. //And other enemy controllers
  109.  
  110. //----------------------------------------------------
  111. //End Standby tasks
  112. //----------------------------------------------------
  113. task TEnd
  114. {
  115. while(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0)
  116. {
  117. yield;
  118. }
  119. AddScore(score);
  120. let GetX = ObjMove_GetX(objEnemy);
  121. let GetY = ObjMove_GetY(objEnemy);
  122. TExplosionA(GetX, GetY, 10, 0.6);
  123. loop(30){yield;}
  124. Obj_Delete(objEnemy);
  125.  
  126. CloseScript(GetOwnScriptID());
  127.  
  128. DeleteShotAll(TYPE_ALL, TYPE_ITEM);//Removes all enemy bullets
  129.  
  130. //When making plural scripts,
  131. //Deleting the enemy allows the plural script to proceed on to the next script.
  132. //Do not forget to delete the enemy.
  133.  
  134. DeleteShotAll(TYPE_ALL, TYPE_ITEM);//Removes all enemy bullets
  135. loop(30){yield;}
  136.  
  137. //Please close the script at the end
  138. CloseScript(GetOwnScriptID());
  139. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement