Advertisement
Guest User

FBoss Sp3

a guest
Jul 5th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.88 KB | None | 0 0
  1. #TouhouDanmakufu[Single]
  2. #ScriptVersion[3]
  3. #Title["S3"]
  4. #Text[""]
  5. #Background["./bg/BG_t.txt"]
  6.  
  7. //#include "script/default_system/Event Functions.txt"
  8. #include "./shot/bullet_lib.txt"
  9. #include "./eff/effects.txt"
  10. #include "./Cutin.h"
  11. #include "./lib_ev.txt"
  12. #include "./lib_sfx.txt"
  13. #include "./lib_misc.txt"
  14. #include "./boss_render.txt"
  15. #include "./familiar_render.txt"
  16.  
  17. let Boss;
  18. let BossX = 0;
  19. let BossY = 0;
  20.  
  21. let objScene = GetEnemyBossSceneObjectID();
  22.  
  23. @Initialize {
  24.     SetAutoDeleteObject(true);
  25.     SetShotAutoDeleteClip(128,64,128,64);
  26.    
  27.     Boss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  28.     ObjEnemy_Regist(Boss);
  29.    
  30.     ObjEnemy_SetDamageRate(Boss,0,0);
  31.    
  32.     ObjMove_SetDestAtWeight(Boss,GetStgFrameWidth()/2,196,9,5);
  33.    
  34.     EnemyHitSFX(Boss);
  35.     SetCommonData("BossID","TAMAKO");
  36.    
  37.     mainTask;
  38. }
  39.  
  40. @Event {
  41.     alternative(GetEventType())
  42.     case(EV_REQUEST_LIFE) {
  43.          SetScriptResult(1200);
  44.     }
  45.     case(EV_REQUEST_TIMER) {
  46.          SetScriptResult(80);
  47.     }
  48.     case(EV_REQUEST_SPELL_SCORE) {
  49.         SetScriptResult(6000000+(GetCommonData("PointValue",0)*100));
  50.     }
  51.     case(EV_GAIN_SPELL) {
  52.         AddScore(RoundUp(10,ObjEnemyBossScene_GetInfo(objScene,INFO_SPELL_SCORE)));
  53.     }
  54. }
  55.  
  56. @MainLoop {
  57.     BossX = ObjMove_GetX(Boss);
  58.     BossY = ObjMove_GetY(Boss);
  59.    
  60.     ObjEnemy_SetIntersectionCircleToShot(Boss,BossX,BossY,42);
  61.     ObjEnemy_SetIntersectionCircleToPlayer(Boss,BossX,BossY,32);
  62.    
  63.     SetCommonData("BossX",ObjMove_GetX(Boss));
  64.     SetCommonData("BossY",ObjMove_GetY(Boss));
  65.     SetCommonData("BossMove",ObjMove_GetAngle(Boss));
  66.     SetCommonData("BossSpeed",ObjMove_GetSpeed(Boss));
  67.    
  68.     yield;
  69. }
  70.  
  71. @Finalize {
  72.  
  73. }
  74.  
  75. task mainTask {
  76.     renderBoss(objScene,Boss);
  77.     movement;
  78.     TEnd;
  79. }
  80.  
  81. task movement {
  82.     wait(5);
  83.     startspell;
  84.     wait(90);
  85.     ObjEnemy_SetDamageRate(Boss,20,5);
  86.     wait(60);
  87.     Obj_SetValue(Boss,"cast",1);
  88.     FamiliarSummon(6,"YELLOW",0,-1);
  89.     wait(90);
  90.     Obj_SetValue(Boss,"cast",0);
  91.     wait(120);
  92.     //Obj_SetValue(Boss,"cast",1);
  93.     //MShot;
  94.    
  95.     task startspell {
  96.         let spellcut = GetCurrentScriptDirectory~"tamako01.png";
  97.        
  98.         CutInS1(Boss, "KANAKO", "Conversion \"Gathering Belief\"", spellcut, 0, 0, 512, 512);
  99.         ObjSound_Play(spellSFX);
  100.         ObjSound_Play(burstSFX);
  101.         ObjEnemyBossScene_StartSpell(objScene);
  102.     }
  103. }
  104.  
  105. task FamiliarSummon(num,type,angle,dir){
  106.     //let shoton = false;
  107.     let count = 0;
  108.    
  109.     soundControl(Boss,0,warpSFX,99);
  110.     loop(num){
  111.         FamiliarMovement(type,angle,dir);
  112.         angle += 360/num;
  113.     }
  114.    
  115.     task FamiliarMovement(type,angle,dir) {
  116.         let dist = 0;
  117.         let xdist = 0;
  118.         let ydist = 0;
  119.         let fdist = 160;
  120.         let pdist = 0.7;
  121.         let speed = 2.5;
  122.         let sspeed = 2;
  123.         let c = 30;
  124.         //let sw = 0;
  125.         let pos = [ObjMove_GetX(Boss),ObjMove_GetY(Boss)];
  126.         let fam = RenderFamiliar(Boss,type,pos[0],pos[1],120,[0,0],true,1);
  127.         //let angleM = ObjMove_GetAngle(fam);
  128.        
  129.         while(!Obj_IsDeleted(Boss)){
  130.             while(xdist<fdist && ydist<fdist){
  131.                 xdist += pdist;
  132.                 ydist += pdist;
  133.                 angle += speed*dir;
  134.                 ObjRender_SetPosition(fam,pos[0]+xdist*cos(angle),pos[1]+ydist*sin(angle),0);  
  135.                    
  136.                 yield;
  137.             }
  138.             if(speed > 1.25 && pdist > 0.01){
  139.                 speed -= 1.25/30;
  140.                 pdist -= 0.69/30;
  141.             }
  142.             if(pdist <= 0.01){
  143.                 //shoton = true;
  144.             }
  145.             //sw++;
  146.             count++;
  147.             dist = GetObjDistance(fam,Boss);
  148.             /*if((count%c) == 0){
  149.                 FShot(fam,c,count,dir,sspeed,(dist/sspeed));
  150.             }*/
  151.             FShot(fam,c,count,dir,sspeed,(dist/sspeed));
  152.             //SetCommonData("DistFamiliarToBoss",dist);
  153.             xdist += pdist;
  154.             ydist += pdist;
  155.             angle += speed*dir;
  156.             ObjRender_SetPosition(fam,pos[0]+xdist*cos(angle),pos[1]+ydist*sin(angle),0);
  157.                
  158.             yield;
  159.         }
  160.     }
  161.    
  162.     task FShot(obj,c,count,dir,speed,sdelay){
  163.         let angle = 0;
  164.         //wait(mdelay);
  165.         if(!Obj_IsDeleted(obj) && count%c == 0){
  166.             angle = CoordToBoss(Boss,ObjMove_GetX(obj),ObjMove_GetY(obj));
  167.             soundControl(Boss,0,bulletShot1SFX,45);
  168.             let shot = CreateShotA1(ObjMove_GetX(obj),ObjMove_GetY(obj),speed,angle,268,16);
  169.             FSubShot(shot,52,sdelay);
  170.             //wait(pause); 
  171.         }
  172.         //ObjRender_SetBlendType(shot,BLEND_ADD_ARGB);
  173.     }
  174.    
  175.     task FSubShot(sobj,shotID,delay){
  176.         wait(delay);
  177.         let sshot = CreateShotA1(ObjMove_GetX(sobj),ObjMove_GetY(sobj),ObjMove_GetSpeed(sobj)*0.75,ObjMove_GetAngle(sobj),shotID,15);
  178.         ObjRender_SetBlendType(sshot,BLEND_ADD_ARGB);
  179.         DeleteEffect_Main(ObjMove_GetX(sobj),ObjMove_GetY(sobj),sobj);
  180.     }
  181. }
  182.  
  183. task MShot {
  184.     while(ObjEnemy_GetInfo(Boss,INFO_LIFE) > 0){
  185.         Obj_SetValue(Boss,"cast",1);
  186.         ParticleCharge(Boss,45,[192,88,36]);
  187.         ChargeEffect(Boss,3,10,3,54,[230,160,40]);
  188.         wait(70);
  189.         ShotA2(5,angleToPlayer(Boss),151);
  190.         wait(150);
  191.         Obj_SetValue(Boss,"cast",0);
  192.         wait(150);
  193.     }
  194.    
  195.     task ShotA2(num,angle,shotID){
  196.         let s = 0;
  197.         loop(num){
  198.             soundControl(Boss,0,slashSFX,75);
  199.             soundControl(Boss,0,bulletShot2SFX,65);
  200.             let mshot = CreateLooseLaserA1(BossX+1*cos(angle),BossY+1*sin(angle),1,angle,60,60,shotID,24);
  201.             ObjLaser_SetGrazeInvalidFrame(mshot,3);
  202.             bulletControl01(Boss,mshot,10,7,0.05,0);
  203.             TailShot(mshot,2,ObjMove_GetAngle(mshot)+90,238,4,24);
  204.             angle += 360/num;
  205.         }
  206.     }
  207.    
  208.     task TailShot(sobj,num,angle,shotID,pause,delay){
  209.         let c = 0;
  210.         let maxspd = 1;
  211.        
  212.         wait(delay);
  213.         while(!Obj_IsDeleted(sobj)){
  214.             c++;
  215.             soundControl(Boss,0,bulletShot2SFX,50);
  216.             loop(num){
  217.                 let sshot = CreateShotA1(ObjMove_GetX(sobj),ObjMove_GetY(sobj),0,angle,shotID,30);
  218.                 ObjRender_SetBlendType(sshot,BLEND_ADD_ARGB);
  219.                 bulletControl01(Boss,sshot,45,maxspd,maxspd/100,0);
  220.                 /*if(c%2 == 0){
  221.                     DeleteShotAtFrame(sshot,45);
  222.                 }*/
  223.                 angle += 360/num;
  224.             }
  225.             angle += 18;
  226.             //maxspd -= 0.02;
  227.             wait(pause);
  228.         }
  229.     }
  230.    
  231.     task DeleteShotAtFrame(sobj,frame){
  232.         wait(frame);
  233.         DeleteEffect_Main(ObjMove_GetX(sobj),ObjMove_GetY(sobj),sobj);
  234.     }
  235. }
  236.  
  237.  
  238.  
  239. task TEnd {
  240.     while(ObjEnemy_GetInfo(Boss,INFO_LIFE) > 0) {
  241.         yield;
  242.     }
  243.     NotifyEventAll(EV_DELETE_BULLET,[BossX,BossY,40,2]);
  244.     wait(15);
  245.     Obj_Delete(Boss);
  246.     wait(2);
  247.     CloseScript(GetOwnScriptID);
  248. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement