Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu
- #Title[Practice Spellcard]
- #Text[Spellcard, with Familiars]
- #Player[FREE]//always capitalize FREE
- #ScriptVersion[2]
- script_enemy_main{
- let CSD = GetCurrentScriptDirectory;
- let imgBoss = CSD ~ "img\aki.png";
- let cut = CSD ~ "img\cirnocut.png";
- let bg = CSD ~ "img\snowbg.png";
- let lay = CSD ~ "img\blizzard.png";
- let f = 0;
- let f2 = 0;
- @Initialize{
- SetLife(3000);
- SetTimer(70);
- SetMovePosition01(GetCenterX, GetCenterY-60,5);
- LoadGraphic(imgBoss);
- mainTask;
- }
- @MainLoop{
- SetCollisionA(GetX,GetY,20);
- SetCollisionB(GetX,GetY,15);
- yield;
- }
- @DrawLoop{
- DrawGraphic(GetX, GetY);
- SetTexture(imgBoss);
- SetRenderState(ALPHA);
- SetAlpha(255);
- SetGraphicScale(1,1);
- SetGraphicAngle(0,0,0);
- if(int(GetSpeedX())==0){
- if(f<10){SetGraphicRect(0,0,63,63);}
- if(f>=10 && f<20){SetGraphicRect(63,0,126,63);}
- if(f>=20 && f<30){SetGraphicRect(126,0,189,63);}
- if(f>=30 && f<40){SetGraphicRect(189,0,252,63);}
- f2=0;
- }
- if(int(GetSpeedX())>0){
- if(f2<5){SetGraphicRect(0,63,63,126);}
- if(f2>=5 && f2<10){SetGraphicRect(63,63,126,126);}
- if(f2>=10 && f2<15){SetGraphicRect(126,63,189,126);}
- if(f2>=15){SetGraphicRect(189,63,252,126);}
- f2++;
- }
- if(int(GetSpeedX())<0){
- SetGraphicAngle(180,0,0);//mirrors set image
- if(f2<5){SetGraphicRect(0,63,63,126);}
- if(f2>=5 && f2<10){SetGraphicRect(63,63,126,126);}
- if(f2>=10 && f2<15){SetGraphicRect(126,63,189,126);}
- if(f2>=15){SetGraphicRect(189,63,252,126);}
- f2++;
- }
- DrawGraphic(GetX,GetY);
- f++;
- if(f==40){
- f=0;
- }
- }
- @BackGround{
- }
- @Finalize{
- DeleteGraphic(imgBoss);
- }
- task mainTask{
- wait(90);
- yield;
- spawn;
- }
- sub spawn{
- /*space for spawning sound effect
- PlaySe(CSD ~ "sfx\spawnfam.wav");
- CreateEnemyFromScript("starFam",GetEnemyX,GetEnemyY,0,0,0);
- CreateEnemyFromScript("starFam",GetEnemyX,GetEnemyY,0,0,180);
- }
- function wait(w){
- loop(w){
- yield;
- }
- }
- }
- //Familiars
- script_enemy starFam{
- let CSD = GetCurrentScriptDirectory;
- let imgFam = CSD ~ "img\familiar1.png";
- let dir = 0;
- let r = 80;
- let spin = 0;
- let famAnge = GetArgument;
- @Initialize{
- SetLife(800);
- //SetDamageRateEx(taken dmg by shot, by , transferred dmg by shot to boss, bomb to boss);
- SetDamageRateEx(25,15,25,15);
- LoadGraphic(imgFam);
- mainTask;
- }
- @MainLoop{
- SetCollisionA(GetX,GetY,20);
- SetCollisionB(GetX,GetY,20);
- yield;
- }
- @DrawLoop{
- SetTexture(imgFam);
- SetRenderState(ALPHA);
- SetAlpha(255);
- SetGraphicScale(1,1);
- SetGraphicAngle(0,0,spin);
- SetGraphicRect(0,0,65,67);
- DrawGraphic(GetX,GetY);
- SetTexture(imgFam);
- SetRenderState(ALPHA);
- SetAlpha(255);
- SetGraphicScale(1,1);
- SetGraphicAngle(0,0,spin);
- SetGraphicRect(0,0,65,67);
- DrawGraphic(GetX,GetY);
- spin-=10;
- }
- task mainTask{
- yield;
- movement;
- }
- task movement{
- loop{
- SetMovePosition3(GetEnemyX+r*cos(dir+famAngle),GetEnemyY+60*sin(dir+famAngle),20,10);
- dir++;
- yield;
- }
- }
- @Finalize{
- //deletes the image
- DeleteGraphic(imgFam);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment