Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu [Single]
- #Title[DDD Part 34a]
- #Text[Danmaku dodging for Dummies part 34a
- Love Sign: Master Spark]
- #Player[FREE]
- #ScriptVersion[2]
- //This is uploaded, Feb 10, 2013
- script_enemy_main {
- #include_function ".\function_cutin.txt";
- let count = -60; //Counter
- let angle = 22.5; //Primary Angle
- let angle2 = 45; //Secondary Angle
- let angle3 = 0; //Tertiary Angle
- let bulletID = 5; //Bullet ID #
- let wvel = 0.25; //Angular Velocity
- let BossImage = GetCurrentScriptDirectory~"yukkuri2.png";
- let BossCutIn = GetCurrentScriptDirectory~"yukkuri2.png";
- let bullet = GetCurrentScriptDirectory~"bullet.wav";
- let laser = GetCurrentScriptDirectory~"laser.wav";
- let spark = GetCurrentScriptDirectory~"spark.wav";
- let ZUNbullet = GetCurrentScriptDirectory~"supershot.txt";
- @Initialize {
- LoadGraphic(BossImage);
- LoadGraphic(BossCutIn);
- LoadUserShotData(ZUNbullet);
- SetLife(5000);
- SetDamageRate(80, 40); //% of shot damage, % of bomb damage
- SetTimer(50);
- SetInvincibility(30);
- cutin("BYAKUREN","Love Sign "\""Master Spark"\",BossCutIn,0,0,207,234);
- SetScore(1000000);
- SetEnemyMarker(true);
- SetDurableSpellCard;
- //LastSpell;
- Concentration01(30); //Frames to charge energy
- MagicCircle(true);
- //SetEffectForZeroLife(30, 130, 0); //TimeIntensitySlowdown0=none
- SetMovePosition02(GetCenterX, GetCenterY - 150, 30);
- LoadSE(bullet);
- LoadSE(laser);
- LoadSE(spark);
- }
- @MainLoop {
- SetCollisionA(GetX, GetY, 32);
- SetCollisionB(GetX, GetY, 24);
- if(count % 720 == 540){
- SetMovePosition03(GetPlayerX, GetCenterY - rand(60,180), 5, 1);
- //Xcor,Ycor,weight deceleration (lower = fluid), velocity
- }
- if(count % 720 == 20){
- Spark;
- PlaySE(spark);
- }
- if(count > 100 && count % 720 < 480 && count % 24 == 0){
- bulletID = rand_int(195,196);
- loop(15){
- CreateShot01(GetX, GetY, 1.5, angle, bulletID, 10);
- angle+=24;
- }
- PlaySE(bullet);
- angle+=12;
- }
- count++;
- yield;
- }
- @DrawLoop {
- SetTexture(BossImage);
- SetGraphicRect(0, 0, 207, 234); //Add one pixel to height and width
- SetAlpha(250);
- SetGraphicAngle(0, 0, 0);
- SetGraphicScale(0.5, 0.5);
- DrawGraphic(GetX,GetY);
- }
- task Spark{
- let sparkE = Obj_Create(OBJ_EFFECT);
- let sparkimg = GetCurrentScriptDirectory~"spell.png";
- let sparkS;
- Obj_SetPosition(sparkE, GetX, GetY);
- ObjEffect_SetAngle(sparkE, 0, 0, GetAngleToPlayer);
- ObjEffect_SetTexture(sparkE, sparkimg);
- ObjEffect_SetRenderState(sparkE, ALPHA);
- ObjEffect_SetPrimitiveType(sparkE, PRIMITIVE_TRIANGLEFAN);
- ObjEffect_CreateVertex(sparkE, 4);
- //LOOK AT HOW I DO THE VERTICES HERE
- ObjEffect_SetVertexUV(sparkE,0, 0, 128);
- ObjEffect_SetVertexUV(sparkE,1, 0, 0);
- ObjEffect_SetVertexUV(sparkE,2, 256, 0);
- ObjEffect_SetVertexUV(sparkE,3, 256, 128);
- //THE UV->XY COORDINATES ARE SET UP LIKE THIS
- // (0,0)---------------(256,0)
- // | |
- // (BOSS) |
- // | |
- // (0,128)-------------(256,128)
- ObjEffect_SetVertexXY(sparkE,0, 0, 64);
- ObjEffect_SetVertexXY(sparkE,1, 0, -64);
- ObjEffect_SetVertexXY(sparkE,2, 256, 64);
- ObjEffect_SetVertexXY(sparkE,3, 256, -64)
- ascent(i in 0..4){ObjEffect_SetVertexColor(sparkE, i, 255, 255, 255, 255);}
- //use SetScale to flatteh and widen laser, including making it twice as long
- ObjEffect_SetScale(sparkE, 0.01, 2); //display thin laser
- loop(120){ yield; } //few frames of delay without laser hitbox
- //delay done, actually fire laser
- sparkS = Obj_Create(OBJ_LASER);
- Obj_SetPosition(sparkS, GetX, GetY);
- Obj_SetAngle(sparkS, GetAngleToPlayer);
- Obj_SetSpeed(sparkS, 0);
- Obj_SetAlpha(sparkS, 200); //the laser is invisible, why is this here
- ObjLaser_SetLength(sparkS, 512);
- ObjLaser_SetSource(sparkS, false);
- ascent(i in 1..121){
- ObjLaser_SetWidth(sparkS, i); //widen laser hitbox
- ObjEffect_SetScale(sparkE, i/120, 2); //widen laser graphic
- yield;
- }
- loop(360){yield;} //some frames with the laser at full size
- descent(i in 1..121){
- ObjLaser_SetWidth(sparkS, i); //flatten laser hitbox
- ObjEffect_SetScale(sparkE, i/120, 2); //flatten laser graphic
- yield;
- }
- //lasers disappear, done
- Obj_Delete(sparkS);
- Obj_Delete(sparkE);
- }
- @Finalize {
- DeleteGraphic(BossImage);
- DeleteGraphic(BossCutIn);
- DeleteSE(bullet);
- DeleteSE(laser);
- DeleteSE(spark);
- }
- @BackGround {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement