Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu
- #Title[Suwako Spellcard 1]
- #Text[Spell]
- #BackGround[User(.\img\stage.png,0,0)]
- #PlayLevel[Extra]
- #Player[FREE]
- #ScriptVersion[2]
- script_enemy_main
- {
- #include_function ".\Library.dnh"
- let SuwakoSprite = csd~"img/Suwako/SuwakoSprite.png";
- let cutin = csd~"img/Suwako/SuwakoCutin.png";
- let blank = csd~"img/blank.png";
- let SpellBG01 = csd~"img/Suwako/SpellBG01.png";
- let SpellBG02 = csd~"img/Suwako/SpellBG02.png";
- let angle = 0;
- let angle2 = 0;
- let wave = 0;
- @Initialize
- {
- PlayMusic(csd~"Native Faith.mp3");
- LoadUserShotData(csd~"Shot.txt");
- LoadGraphic(SuwakoSprite);
- LoadGraphic(SpellBG01);
- LoadGraphic(SpellBG02);
- SetText("Splash Sign "\""Water Spreads, Rainbow Falls"\");
- SetLife(1000);
- SetDamageRate(0,0);
- SetTimer(81);
- SetScore(100000);
- SetEnemyMarker(true);
- SetEffectForZeroLife(60,0,0);
- ExCutin("KANAKO", cutin, 0, 0, 256, 512);
- PlaySE(SpellCard);
- MainTask;
- VulnerableSpell;
- Timer;
- MoveAbout;
- InitAnimation;
- Idle;
- }
- task MainTask
- {
- Wait(60);
- SetColor(255,255,0);
- Concentration01(120);
- SetColor(255,255,255);
- PlaySE(Charge1);
- Wait(120);
- Cast;
- Wait(16);
- Fire;
- loop
- {
- CreateLaser01(GetClipMinX+16,GetClipMinY,2,90,256,16,56,10); //red
- CreateLaser01(GetCenterX-120,GetClipMinY,2,90,256,16,68,10); //orange
- CreateLaser01(GetCenterX-65,GetClipMinY,2,90,256,16,67,10); //yellow
- CreateLaser01(rand(204, 245),GetClipMinY,2,90,256,16,64,10); //green
- CreateLaser01(GetCenterX+65,GetClipMinY,2,90,256,16,62,10); //aqua
- CreateLaser01(GetCenterX+120,GetClipMinY,2,90,256,16,60,10); //blue
- CreateLaser01(GetClipMaxX-16,GetClipMinY,2,90,256,16,57,10); //violet
- PlaySE(Laser1);
- Wait(150);
- Rain;
- Shower;
- Wait(1);
- }
- }
- task Rain
- {
- loop(240)
- {
- CreateShot01(rand(30, 420),GetClipMinY,rand(1,2),90,187,10);
- PlaySE(Shot2);
- Wait(15);
- }
- }
- task Shower
- {
- loop(60)
- {
- CreateShot02(GetX,GetY,6,GetAngleToPlayer+sin(wave)*62,-0.1,2,240,10);
- CreateShot02(GetX,GetY,6,GetAngleToPlayer+sin(wave)*62+90,-0.1,2,240,10);
- CreateShot02(GetX,GetY,6,GetAngleToPlayer+sin(wave)*62-90,-0.1,2,240,10);
- CreateShot02(GetX,GetY,6,GetAngleToPlayer+sin(wave)*62+180,-0.1,2,240,10);
- PlaySE(Shot2);
- wave += 6;
- Wait(3);
- }
- }
- task MoveAbout
- {
- SetMovePosition02(GetCenterX,GetCenterY-120,30);
- Move;
- }
- function InitAnimation
- {
- CreateAnimation("Boss", "Idle", 4);
- SetAnimationFrame("Boss","Idle",0,SuwakoSprite,8,0,0,64,64);
- SetAnimationFrame("Boss","Idle",1,SuwakoSprite,8,64,0,128,64);
- SetAnimationFrame("Boss","Idle",2,SuwakoSprite,8,128,0,192,64);
- SetAnimationFrame("Boss","Idle",3,SuwakoSprite,8,192,0,256,64);
- CreateAnimation("Boss", "Move", 4);
- SetAnimationFrame("Boss","Move",0,SuwakoSprite,4,0,64,64,128);
- SetAnimationFrame("Boss","Move",1,SuwakoSprite,4,64,64,128,128);
- SetAnimationFrame("Boss","Move",2,SuwakoSprite,4,128,64,192,128);
- SetAnimationFrame("Boss","Move",3,SuwakoSprite,4,192,64,256,128);
- CreateAnimation("Boss", "StopMove", 3);
- SetAnimationFrame("Boss","StopMove",0,SuwakoSprite,4,192,64,256,128);
- SetAnimationFrame("Boss","StopMove",1,SuwakoSprite,4,128,64,192,128);
- SetAnimationFrame("Boss","StopMove",2,SuwakoSprite,4,64,64,128,128);
- CreateAnimation("Boss", "Cast", 4);
- SetAnimationFrame("Boss","Cast",0,SuwakoSprite,4,0,128,64,192);
- SetAnimationFrame("Boss","Cast",1,SuwakoSprite,4,64,128,128,192);
- SetAnimationFrame("Boss","Cast",2,SuwakoSprite,4,128,128,192,192);
- SetAnimationFrame("Boss","Cast",3,SuwakoSprite,4,192,128,256,192);
- CreateAnimation("Boss", "Fire", 4);
- SetAnimationFrame("Boss","Fire",0,SuwakoSprite,4,0,192,64,256);
- SetAnimationFrame("Boss","Fire",1,SuwakoSprite,4,64,192,128,256);
- SetAnimationFrame("Boss","Fire",2,SuwakoSprite,4,128,192,192,256);
- SetAnimationFrame("Boss","Fire",3,SuwakoSprite,4,192,192,256,256);
- }
- sub Idle{Animate("Boss","Idle",true);}
- sub Cast{xflip = 1; Animate("Boss","Cast",false);}
- sub Fire{Animate("Boss","Fire",true);}
- task Move
- {
- if(GetSpeedX>0)
- {
- xflip = 1;
- Animate("Boss","Move",false);
- yield;
- while(GetSpeed>0.1)
- {
- yield;
- }
- Animate("Boss","StopMove",false);
- }
- if(GetSpeedX<0)
- {
- xflip = -1;
- Animate("Boss","Move",false);
- yield ;
- while(GetSpeed>0.1)
- {
- yield ;
- }
- Animate("Boss","StopMove",false);
- }
- Wait(15);
- Animate("Boss","Idle",true);
- }
- @MainLoop
- {
- SetCollisionA(GetX,GetY,28);
- SetCollisionB(GetX,GetY,28);
- yield;
- }
- @DrawLoop
- {
- SetAlpha(255);
- SetGraphicScale(xflip,1);
- SetColor(255,255,255);
- SetGraphicAngle(0,0,0);
- DrawAnimatedSprite("Boss",GetX,GetY);
- }
- let bgalpha = 0;
- let bgscroll = 0;
- @BackGround
- {
- if (bgalpha < 255){bgalpha += 5;}
- bgscroll += 1.5;
- SetAlpha(bgalpha);
- SetGraphicScale(1,1);
- SetColor(255,255,255);
- SetTexture(SpellBG01);
- SetGraphicRect(0,0,384,448);
- DrawGraphic(GetCenterX,GetCenterY);
- SetTexture(SpellBG02);
- SetGraphicScale(1,1);
- SetGraphicRect(0,0,bgscroll+512,512);
- DrawGraphic(GetCenterX,GetCenterY);
- }
- @Finalize
- {
- DeleteGraphic(SuwakoSprite);
- DeleteGraphic(SpellBG01);
- DeleteGraphic(SpellBG02);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement