Advertisement
Guest User

h

a guest
Jul 4th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.62 KB | None | 0 0
  1. #TouhouDanmakufu[Single]
  2. #ScriptVersion[3]
  3. #Title["Tutorial 8"]
  4. #include "script/default_system/Default_ShotConst.txt"
  5.  
  6. let objBoss;
  7. let objScene= GetEnemyBossSceneObjectID();
  8. let bossX = 0;
  9. let bossY = 0;
  10.  
  11. let imgExRumia = GetCurrentScriptDirectory ~ "ExRumia.png";
  12.  
  13. @Event{
  14.     alternative(GetEventType())
  15.     case(EV_REQUEST_LIFE){
  16.         SetScriptResult(500);
  17.     }
  18.     case(EV_REQUEST_TIMER){
  19.         SetScriptResult(60);
  20.     }
  21.     case(EV_REQUEST_SPELL_SCORE){
  22.         SetScriptResult(1000);
  23.     }
  24. }
  25.  
  26. @Initialize{
  27.     objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  28.     ObjEnemy_Regist(objBoss);
  29.     ObjEnemyBossScene_StartSpell(objScene);
  30.     ObjPrim_SetTexture(objBoss, imgExRumia);
  31.     ObjSprite2D_SetSourceRect(objBoss, 64, 1, 127, 64);
  32.         ObjSprite2D_SetDestCenter(objBoss);
  33.     ObjMove_SetDestAtSpeed(objBoss, 82, 100, 100);
  34.    
  35. }      
  36.  
  37. @MainLoop{
  38.     bossX = ObjMove_GetX(objBoss);
  39.     bossY = ObjMove_GetY(objBoss);
  40.     yield;
  41.     MainTask;
  42.  
  43.     task MainTask{
  44.         let wait = 120;
  45.         fireA;
  46.     }
  47.  
  48.     task fireA{
  49.         while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
  50.             let angleT = 0;
  51.         loop(30){
  52.             CreateShotA1(bossX + 90*cos(angleT), bossY + 90*sin(angleT), 2, angleT, 1, 0);
  53.             angleT += 360/30;
  54.         }
  55. }
  56.  
  57. @Finalize{
  58.     while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){yield;}
  59.     if(ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SHOOTDOWN_COUNT)
  60.             +ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SPELL_COUNT) == 0){
  61.         AddScore(ObjEnemyBossScene_GetInfo(objScene, INFO_SPELL_SCORE));
  62.     }
  63.     Obj_Delete(objBoss);
  64.     DeleteShotAll(TYPE_ALL,TYPE_IMMEDIATE);
  65.     SetAutoDeleteObject(true);
  66.     CloseScript(GetOwnScriptID());
  67.     return;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement