Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TouhouDanmakufu
- #Title[Rin Spell1]
- #Text[]
- #Player[FREE]
- #ScriptVersion[2]
- script_enemy_main {
- #include_function ".\SHOT_REPLACE\shot_replace.dnh";
- let Cut = GetCurrentScriptDirectory~"cutin.png";
- let ImgBoss = GetCurrentScriptDirectory~"pl11_bs.png";
- let f = 0;
- let f2 = 0;
- @Initialize {
- SetLife(1500);
- SetDamageRate(15,2);
- SetTimer(99);
- SetScore(1000000);
- LoadGraphic(Cut);
- SetEnemyMarker(true);
- SetMovePosition02(GetCenterX, GetClipMinY + 120, 120);
- CutIn(YOUMU,"Flower Sign"\""Eternal Branches of the Azalea"\", "Cut",0,0,512,477);
- LoadGraphic(ImgBoss);
- SetTexture(ImgBoss);
- SetGraphicRect(0, 0, 64, 64);
- // LoadSE(shot);
- shotinit;
- MainTask;
- }
- @MainLoop {
- SetCollisionA(GetX, GetY, 32);
- SetCollisionB(GetX, GetY, 24);
- yield;
- }
- @DrawLoop{
- SetTexture(ImgBoss);
- SetRenderState(ALPHA);
- SetAlpha(255);
- SetGraphicScale(1,1);
- SetGraphicAngle(0,0,0);
- if(int(GetSpeedX())==0){
- if(f<10){ SetGraphicRect(0,0,64,64); }
- if(f>=10 && f<20){ SetGraphicRect(64,0,128,64); }
- if(f>=20 && f<30){ SetGraphicRect(128,0,192,64); }
- if(f>=30 && f<40){ SetGraphicRect(192,0,256,64); }
- f2=0;
- }
- if(GetSpeedX()<0){
- if(f2<10){ SetGraphicRect(0,64,64,128); }
- if(f2>=10 && f2<20){ SetGraphicRect(64,64,128,128); }
- if(f2>=20 && f2<30){ SetGraphicRect(128,64,192,128); }
- if(f2>=30){ SetGraphicRect(192,64,256,128); }
- f2++;
- }
- if(GetSpeedX()>0){
- if(f2<10){ SetGraphicRect(0,128,64,192); }
- if(f2>=10 && f2<20){ SetGraphicRect(64,128,128,192); }
- if(f2>=20 && f2<30){ SetGraphicRect(128,128,192,192); }
- if(f2>=30){ SetGraphicRect(192,128,256,192); }
- f2++;
- }
- DrawGraphic(GetX,GetY);
- f++;
- if(f==40){f=0;}
- }
- @Finalize {
- DeleteGraphic(ImgBoss);
- }
- task MainTask{
- wait(120);
- yield;
- Movement;
- }
- task Movement{
- loop{
- ShotMain;
- wait(260);
- yield;
- }
- }
- task Shot1(x,y,v,angle,graphic,delay){
- let obj = Obj_Create(OBJ_SHOT);
- Obj_SetPosition(obj,x,y);
- Obj_SetSpeed(obj,v);
- Obj_SetAngle(obj,angle);
- ObjShot_SetGraphic(obj,graphic);
- ObjShot_SetDelay(obj,delay);
- ObjShot_SetBombResist(obj,true);
- while(!Obj_BeDeleted(obj)){
- wait(2.5);
- loop(1){
- CreateShotA(1, Obj_GetX(obj), Obj_GetY(obj), 0);
- SetShotDataA(1, 0, 0, angle + GetAngleToPlayer, 0.5, 0, 5, 52);
- SetShotDataA(1, 180, 2, angle + GetAngleToPlayer, 0, 0, 5, 55);
- FireShot(1);
- angle += 360/16;
- }
- }
- }
- task ShotMain{
- let x = 0;
- let angle = rand_int(0,359);
- while(x<8){
- Shot1(GetEnemyX+30*cos(angle),GetEnemyY+30*sin(angle),1,angle,236,0);
- angle+=45;
- x++;
- }
- }
- //Wait
- function wait(let frames){
- loop(frames){yield;}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement