Guest User

test script

a guest
Jul 18th, 2017
571
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.93 KB | None | 0 0
  1. #TouhouDanmakufu[Single]
  2. #ScriptVersion[3]
  3. #Title["TEST"]
  4. #Text[""]
  5. #Background["./bg/BG_t.txt"]
  6.  
  7. #include "./shot/bullet_lib.txt"
  8. #include "./eff/effects.txt"
  9. #include "./Cutin.h"
  10. #include "./lib_ev.txt"
  11. #include "./lib_sfx.txt"
  12. #include "./lib_misc.txt"
  13. #include "./lib_shot.txt"
  14. #include "./boss_render.txt"
  15.  
  16. //*****
  17. //All custom functions in this single script are labeled
  18. //*****
  19.  
  20. let Boss;
  21. let BossX = 0;
  22. let BossY = 0;
  23.  
  24. let objScene = GetEnemyBossSceneObjectID();
  25.  
  26. @Initialize {
  27.     SetAutoDeleteObject(true);
  28.     SetShotAutoDeleteClip(8,8,8,8);
  29.    
  30.     LoadEnemyShotData(dummypath);
  31.    
  32.     Boss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  33.     ObjEnemy_Regist(Boss);
  34.    
  35.     ObjEnemy_SetDamageRate(Boss,0,0);
  36.    
  37.     ObjMove_SetPosition(Boss,GetStgFrameWidth()/2,130);
  38.    
  39.     EnemyHitSFX(Boss);  //Sound effect for when the boss takes damage; defined in lib_sfx.txt
  40.     SetCommonData("BossID","TAMAKO");
  41.    
  42.     mainTask;
  43. }
  44.  
  45. @Event {
  46.     alternative(GetEventType())
  47.     case(EV_REQUEST_LIFE) {
  48.          SetScriptResult(3000);
  49.     }
  50.     case(EV_REQUEST_TIMER) {
  51.          SetScriptResult(60);
  52.     }
  53. }
  54.  
  55. @MainLoop {
  56.     BossX = ObjMove_GetX(Boss);
  57.     BossY = ObjMove_GetY(Boss);
  58.    
  59.     ObjEnemy_SetIntersectionCircleToShot(Boss,BossX,BossY,42);
  60.     ObjEnemy_SetIntersectionCircleToPlayer(Boss,BossX,BossY,32);
  61.    
  62.     SetCommonData("BossX",ObjMove_GetX(Boss));
  63.     SetCommonData("BossY",ObjMove_GetY(Boss));
  64.     SetCommonData("BossMove",ObjMove_GetAngle(Boss));
  65.     SetCommonData("BossSpeed",ObjMove_GetSpeed(Boss));
  66.    
  67.     yield;
  68. }
  69.  
  70. @Finalize {
  71.  
  72. }
  73.  
  74. task mainTask {
  75.     movement;
  76.     TEnd;
  77. }
  78.  
  79. task movement {
  80.     wait(90);
  81.     Obj_SetValue(Boss,"cast",1);
  82.     soundControl(Boss,0,summonSFX,90);
  83.     ascent(a in 1..4){
  84.         ParticleCharge(Boss,90*a,rand(3.9,4.5),1,25,50,80,[192,88,36],[270,150]);   //Particle charge effect; defined in effects.txt
  85.     }  
  86.     ChargeEffect(Boss,3,10,3.6,54,[230,160,40]);    //Shockwave charge effect; defined in effects.txt
  87.     wait(130);
  88.     renderBoss(objScene,Boss);  //Rendering the boss' sprite; defined in boss_render.txt
  89.     wait(30);
  90.     ObjEnemy_SetDamageRate(Boss,45,25);
  91.     Shot1;
  92. }
  93.  
  94.  
  95. task Shot1 {
  96.     let angleS = angleToPlayer(Boss);   //Angle from the boss object to the player object; defined in lib_misc.txt
  97.    
  98.     while(!Obj_IsDeleted(Boss)){
  99.         ShotA1(angleS,-1,6,4,3);
  100.         angleS += 11;
  101.         wait(12);
  102.     }
  103.    
  104.     task ShotA1(angle,offset,num1,num2,shotID){
  105.         ascent(a in 0..num1){
  106.             soundControl(Boss,0,bulletShot1SFX,40); //Custom task for playing sound effects; defined in lib_misc.txt
  107.             loop(num2){
  108.                 let shot1A = CreateShotA1(BossX+48*cos(angle),BossY+48*sin(angle),3-a/num1,angle,shotID,12);
  109.                 angle += 360/num2;
  110.             }
  111.             angle += offset;
  112.         }
  113.     }
  114. }
  115.  
  116.  
  117. task TEnd {
  118.     while(ObjEnemy_GetInfo(Boss,INFO_LIFE) > 0) {
  119.         yield;
  120.     }
  121.     NotifyEventAll(EV_DELETE_BULLET,[BossX,BossY,40,2]);    //Notification for the end of a single script, gradually deletes all bullets onscreen, going outward from the boss
  122.     wait(15);
  123.     Obj_Delete(Boss);
  124.     wait(2);
  125.     CloseScript(GetOwnScriptID);
  126. }
Advertisement
Add Comment
Please, Sign In to add comment