Guest User

h

a guest
Dec 27th, 2011
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. #東方弾幕風[Single]
  2. #ScriptVersion[3]
  3. #Title["SampleA01"]
  4. #Text["SampleA01:Curve lasers"]
  5.  
  6. #include"script/default_system/Default_ShotConst.txt"
  7.  
  8. let objPlayer;
  9. let objEnemy;
  10. let frame = 0;
  11.  
  12. @Event
  13. {
  14. alternative(GetEventType())
  15. case(EV_REQUEST_LIFE)
  16. {
  17.  
  18. SetScriptResult(500);
  19. }
  20. case(EV_REQUEST_TIMER){SetScriptResult(90);}
  21.  
  22.  
  23. }
  24.  
  25. @Initialize
  26. {
  27. objPlayer = GetPlayerObjectID();
  28.  
  29. let objScene = GetEnemyBossSceneObjectID();
  30. ObjEnemyBossScene_StartSpell(objScene);
  31. objEnemy = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  32. ObjEnemy_Regist(objEnemy);
  33.  
  34. let imgExRumia = GetCurrentScriptDirectory ~ "Typhi.png";
  35. ObjPrim_SetTexture(objEnemy, imgExRumia);
  36. ObjSprite2D_SetSourceRect(objEnemy, 0, 0, 42, 42);
  37. ObjSprite2D_SetDestCenter(objEnemy);
  38.  
  39.  
  40.  
  41. let cx = GetStgFrameWidth() / 2;
  42. ObjMove_SetDestAtFrame(objEnemy, cx, 60, 60);
  43.  
  44. ObjEnemy_SetDamageRate(objEnemy, 10, 10);
  45.  
  46. }
  47.  
  48. @MainLoop
  49. {
  50. yield;
  51. }
  52. ObjEnemy_SetIntersectionCircleToShot(objEnemy, ex, ey, 32);
  53. ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ex, ey, 24);
  54.  
  55.  
  56.  
  57. if(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) <= 0)
  58. {
  59. DeleteShotAll(TYPE_ALL,TYPE_ITEM);
  60. Obj_Delete(objEnemy);
  61. CloseScript(GetOwnScriptID());
  62. return;
  63. }
  64. }
  65.  
  66.  
  67. task EDivShot(x,y,a,g,d,k){
  68.  
  69. let obj=ObjShot_Create(OBJ_SHOT);
  70. ObjMove_SetPosition(obj,x,y);
  71. ObjShot_SetGraphic(obj,g);
  72. ObjMove_SetAngle(obj,a);
  73. ObjMove_SetSpeed(obj,0);
  74. ObjShot_Regist(obj);
  75.  
  76. let t=0;
  77.  
  78. while(GetLife>0 && !Obj_IsDeleted(obj)){
  79.  
  80. t++;
  81. yield;
  82.  
  83. if(t==d){CreateShotA2(ObjMove_GetX(obj),ObjMove_GetY(obj),0,a-60,0.05,1.5,g+1,0);
  84. CreateShotA2(ObjMove_GetX(obj),ObjMove_GetY(obj),0,a+60,0.05,1.5,g+1,0);}
  85.  
  86. if(t==d+60){ObjMove_SetAngle(obj,a+k);}
  87. if(t>=d+60){ObjMove_SetSpeed(obj,(t-(d+60))*0.01);}
  88.  
  89. }
  90. Obj_Delete(obj);
  91. }
Advertisement
Add Comment
Please, Sign In to add comment