Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu[Single]
- #ScriptVersion[3]
- #Title["S3"]
- #Text[""]
- #Background["./bg/BG_t.txt"]
- //#include "script/default_system/Event Functions.txt"
- #include "./shot/bullet_lib.txt"
- #include "./eff/effects.txt"
- #include "./Cutin.h"
- #include "./lib_ev.txt"
- #include "./lib_sfx.txt"
- #include "./lib_misc.txt"
- #include "./boss_render.txt"
- #include "./familiar_render.txt"
- let Boss;
- let BossX = 0;
- let BossY = 0;
- let objScene = GetEnemyBossSceneObjectID();
- @Initialize {
- SetAutoDeleteObject(true);
- SetShotAutoDeleteClip(128,64,128,64);
- Boss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
- ObjEnemy_Regist(Boss);
- ObjEnemy_SetDamageRate(Boss,0,0);
- ObjMove_SetDestAtWeight(Boss,GetStgFrameWidth()/2,196,9,5);
- EnemyHitSFX(Boss);
- SetCommonData("BossID","TAMAKO");
- mainTask;
- }
- @Event {
- alternative(GetEventType())
- case(EV_REQUEST_LIFE) {
- SetScriptResult(1200);
- }
- case(EV_REQUEST_TIMER) {
- SetScriptResult(80);
- }
- case(EV_REQUEST_SPELL_SCORE) {
- SetScriptResult(6000000+(GetCommonData("PointValue",0)*100));
- }
- case(EV_GAIN_SPELL) {
- AddScore(RoundUp(10,ObjEnemyBossScene_GetInfo(objScene,INFO_SPELL_SCORE)));
- }
- }
- @MainLoop {
- BossX = ObjMove_GetX(Boss);
- BossY = ObjMove_GetY(Boss);
- ObjEnemy_SetIntersectionCircleToShot(Boss,BossX,BossY,42);
- ObjEnemy_SetIntersectionCircleToPlayer(Boss,BossX,BossY,32);
- SetCommonData("BossX",ObjMove_GetX(Boss));
- SetCommonData("BossY",ObjMove_GetY(Boss));
- SetCommonData("BossMove",ObjMove_GetAngle(Boss));
- SetCommonData("BossSpeed",ObjMove_GetSpeed(Boss));
- yield;
- }
- @Finalize {
- }
- task mainTask {
- renderBoss(objScene,Boss);
- movement;
- TEnd;
- }
- task movement {
- wait(5);
- startspell;
- wait(90);
- ObjEnemy_SetDamageRate(Boss,20,5);
- wait(60);
- Obj_SetValue(Boss,"cast",1);
- FamiliarSummon(6,"YELLOW",0,-1);
- wait(90);
- Obj_SetValue(Boss,"cast",0);
- wait(120);
- //Obj_SetValue(Boss,"cast",1);
- //MShot;
- task startspell {
- let spellcut = GetCurrentScriptDirectory~"tamako01.png";
- CutInS1(Boss, "KANAKO", "Conversion \"Gathering Belief\"", spellcut, 0, 0, 512, 512);
- ObjSound_Play(spellSFX);
- ObjSound_Play(burstSFX);
- ObjEnemyBossScene_StartSpell(objScene);
- }
- }
- task FamiliarSummon(num,type,angle,dir){
- //let shoton = false;
- let count = 0;
- soundControl(Boss,0,warpSFX,99);
- loop(num){
- FamiliarMovement(type,angle,dir);
- angle += 360/num;
- }
- task FamiliarMovement(type,angle,dir) {
- let dist = 0;
- let xdist = 0;
- let ydist = 0;
- let fdist = 160;
- let pdist = 0.7;
- let speed = 2.5;
- let sspeed = 2;
- let c = 30;
- //let sw = 0;
- let pos = [ObjMove_GetX(Boss),ObjMove_GetY(Boss)];
- let fam = RenderFamiliar(Boss,type,pos[0],pos[1],120,[0,0],true,1);
- //let angleM = ObjMove_GetAngle(fam);
- while(!Obj_IsDeleted(Boss)){
- while(xdist<fdist && ydist<fdist){
- xdist += pdist;
- ydist += pdist;
- angle += speed*dir;
- ObjRender_SetPosition(fam,pos[0]+xdist*cos(angle),pos[1]+ydist*sin(angle),0);
- yield;
- }
- if(speed > 1.25 && pdist > 0.01){
- speed -= 1.25/30;
- pdist -= 0.69/30;
- }
- if(pdist <= 0.01){
- //shoton = true;
- }
- //sw++;
- count++;
- dist = GetObjDistance(fam,Boss);
- /*if((count%c) == 0){
- FShot(fam,c,count,dir,sspeed,(dist/sspeed));
- }*/
- FShot(fam,c,count,dir,sspeed,(dist/sspeed));
- //SetCommonData("DistFamiliarToBoss",dist);
- xdist += pdist;
- ydist += pdist;
- angle += speed*dir;
- ObjRender_SetPosition(fam,pos[0]+xdist*cos(angle),pos[1]+ydist*sin(angle),0);
- yield;
- }
- }
- task FShot(obj,c,count,dir,speed,sdelay){
- let angle = 0;
- //wait(mdelay);
- if(!Obj_IsDeleted(obj) && count%c == 0){
- angle = CoordToBoss(Boss,ObjMove_GetX(obj),ObjMove_GetY(obj));
- soundControl(Boss,0,bulletShot1SFX,45);
- let shot = CreateShotA1(ObjMove_GetX(obj),ObjMove_GetY(obj),speed,angle,268,16);
- FSubShot(shot,52,sdelay);
- //wait(pause);
- }
- //ObjRender_SetBlendType(shot,BLEND_ADD_ARGB);
- }
- task FSubShot(sobj,shotID,delay){
- wait(delay);
- let sshot = CreateShotA1(ObjMove_GetX(sobj),ObjMove_GetY(sobj),ObjMove_GetSpeed(sobj)*0.75,ObjMove_GetAngle(sobj),shotID,15);
- ObjRender_SetBlendType(sshot,BLEND_ADD_ARGB);
- DeleteEffect_Main(ObjMove_GetX(sobj),ObjMove_GetY(sobj),sobj);
- }
- }
- task MShot {
- while(ObjEnemy_GetInfo(Boss,INFO_LIFE) > 0){
- Obj_SetValue(Boss,"cast",1);
- ParticleCharge(Boss,45,[192,88,36]);
- ChargeEffect(Boss,3,10,3,54,[230,160,40]);
- wait(70);
- ShotA2(5,angleToPlayer(Boss),151);
- wait(150);
- Obj_SetValue(Boss,"cast",0);
- wait(150);
- }
- task ShotA2(num,angle,shotID){
- let s = 0;
- loop(num){
- soundControl(Boss,0,slashSFX,75);
- soundControl(Boss,0,bulletShot2SFX,65);
- let mshot = CreateLooseLaserA1(BossX+1*cos(angle),BossY+1*sin(angle),1,angle,60,60,shotID,24);
- ObjLaser_SetGrazeInvalidFrame(mshot,3);
- bulletControl01(Boss,mshot,10,7,0.05,0);
- TailShot(mshot,2,ObjMove_GetAngle(mshot)+90,238,4,24);
- angle += 360/num;
- }
- }
- task TailShot(sobj,num,angle,shotID,pause,delay){
- let c = 0;
- let maxspd = 1;
- wait(delay);
- while(!Obj_IsDeleted(sobj)){
- c++;
- soundControl(Boss,0,bulletShot2SFX,50);
- loop(num){
- let sshot = CreateShotA1(ObjMove_GetX(sobj),ObjMove_GetY(sobj),0,angle,shotID,30);
- ObjRender_SetBlendType(sshot,BLEND_ADD_ARGB);
- bulletControl01(Boss,sshot,45,maxspd,maxspd/100,0);
- /*if(c%2 == 0){
- DeleteShotAtFrame(sshot,45);
- }*/
- angle += 360/num;
- }
- angle += 18;
- //maxspd -= 0.02;
- wait(pause);
- }
- }
- task DeleteShotAtFrame(sobj,frame){
- wait(frame);
- DeleteEffect_Main(ObjMove_GetX(sobj),ObjMove_GetY(sobj),sobj);
- }
- }
- task TEnd {
- while(ObjEnemy_GetInfo(Boss,INFO_LIFE) > 0) {
- yield;
- }
- NotifyEventAll(EV_DELETE_BULLET,[BossX,BossY,40,2]);
- wait(15);
- Obj_Delete(Boss);
- wait(2);
- CloseScript(GetOwnScriptID);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement