Mewkyuu

Untitled

Dec 26th, 2011
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. #TouhouDanmakufu
  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. let ex = ObjMove_GetX(objEnemy);
  52. let ey = ObjMove_GetY(objEnemy);
  53. ObjEnemy_SetIntersectionCircleToShot(objEnemy, ex, ey, 32);
  54. ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ex, ey, 24);
  55.  
  56.  
  57.  
  58. if(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) <= 0)
  59. {
  60. DeleteShotAll(TYPE_ALL,TYPE_ITEM);
  61. Obj_Delete(objEnemy);
  62. CloseScript(GetOwnScriptID());
  63. return;
  64. }
  65. }
  66.  
  67.  
  68. task EDivShot(x,y,a,g,d,k){
  69.  
  70. let obj=ObjShot_Create(OBJ_SHOT);
  71. ObjMove_SetPosition(obj,x,y);
  72. ObjShot_SetGraphic(obj,g);
  73. ObjMove_SetAngle(obj,a);
  74. ObjMove_SetSpeed(obj,0);
  75. ObjShot_Regist(obj);
  76.  
  77. let t=0;
  78.  
  79. while(ObjEnemy_GetInfo(objEnemy, INFO_LIFE)>0 && !Obj_IsDeleted(obj)){
  80.  
  81. t++;
  82. yield;
  83.  
  84. if(t==d){CreateShotA2(ObjMove_GetX(obj),ObjMove_GetY(obj),0,a-60,0.05,1.5,g+1,0);
  85. CreateShotA2(ObjMove_GetX(obj),ObjMove_GetY(obj),0,a+60,0.05,1.5,g+1,0);}
  86.  
  87. if(t==d+60){ObjMove_SetAngle(obj,a+k);}
  88. if(t>=d+60){ObjMove_SetSpeed(obj,(t-(d+60))*0.01);}
  89.  
  90. }
  91. Obj_Delete(obj);
  92. }
Advertisement
Add Comment
Please, Sign In to add comment