Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu[Stage]
- #ScriptVersion[3]
- #Title["MMM Stage 1"]
- #Text["See title."]
- #Background["script/default_system/Default_Background_IceMountain.txt"]
- #include "script/default_system/Default_ShotConst.txt"
- #include "script/default_system/Default_Effect.txt"
- #include "script/MMM/Function_Splash.txt"
- #include "script/MMM/Function_Dialogue.txt"
- function wait(w) { loop(w) { yield; } }
- function waitS(q) { loop(q*60){yield;}}
- //BGM LOOP TIMES: 12.566, 127
- let fairy = GetCurrentScriptDirectory ~ "/img/enm.png";
- let BGM = GetCurrentScriptDirectory ~ "/sound/STG1.ogg";
- let Bullet = GetCurrentScriptDirectory ~ "/sound/Bullet.wav";
- let enmdie = GetCurrentScriptDirectory ~ "/sound/enmdie.wav";
- let hght = GetStgFrameHeight();
- let wdth = GetStgFrameWidth();
- @Initialize {
- LoadSound(BGM);
- LoadSound(Bullet);
- LoadSound(enmdie);
- LoadTexture(fairy);
- wait(60);
- PlayBGM(BGM, 12.566, 127);
- CreateCommonDataArea("SpellFunctions");
- LoadCommonDataAreaA1("SpellFunctions");
- StageStart;
- }
- @MainLoop {
- yield;
- }
- @Finalize {
- }
- task StageStart {
- let dir = GetCurrentScriptDirectory();
- Splash(1);
- waitS(13);
- SpawnEnemies;
- }
- task Enemy01(x, y, xDest, yDest, spd) {
- let Enm1 = ObjEnemy_Create(OBJ_ENEMY);
- let Enm1X = 0;
- let Enm1Y = 0;
- ObjEnemy_Regist(Enm1);
- ObjEnemy_SetLife(Enm1, 150);
- ObjPrim_SetTexture(Enm1, fairy);
- ObjRender_SetScaleXYZ(Enm1, 1, 1, 1);
- ObjSprite2D_SetSourceRect(Enm1, 0, 0, 32, 32);
- ObjSprite2D_SetDestCenter(Enm1);
- ObjMove_SetPosition(Enm1, x, y);
- ObjMove_SetDestAtSpeed(Enm1, xDest, yDest, spd);
- let countFrame = 0;
- while(ObjEnemy_GetInfo(Enm1,INFO_LIFE)>0){
- Enm1X = ObjMove_GetX(Enm1);
- Enm1Y = ObjMove_GetY(Enm1);
- ObjEnemy_SetIntersectionCircleToShot(Enm1, Enm1X, Enm1Y, 10);
- countFrame++;
- if(countFrame == 30) {//Should enemy shoot?
- fireE;
- countFrame = 0;
- }
- if (Enm1Y > hght+40) {//Testing to see if enemy should be deleted
- Obj_Delete(Enm1);
- }
- yield;
- }
- PlaySE(enmdie);
- AddScore(5000);
- TExplosionA(Enm1X, Enm1Y, 10, 0.1);
- Obj_Delete(Enm1);
- task fireE {
- CreateShotA1(Enm1X,Enm1Y,1,GetAngleToPlayer(Enm1), 245,0);
- PlaySE(Bullet);
- }
- }
- task Enemy02(x, y, xDest, yDest, spd, dir) {
- let Enm2 = ObjEnemy_Create(OBJ_ENEMY);
- let Enm2X = 0;
- let Enm2Y = 0;
- ObjEnemy_Regist(Enm2);
- ObjEnemy_SetLife(Enm2, 150);
- ObjPrim_SetTexture(Enm2, fairy);
- ObjRender_SetScaleXYZ(Enm2, 1, 1, 1);
- ObjSprite2D_SetSourceRect(Enm2, 0, 0, 32, 32);
- ObjSprite2D_SetDestCenter(Enm2);
- ObjMove_SetPosition(Enm2, x, y);
- ObjMove_SetDestAtSpeed(Enm2, xDest, yDest, spd);
- let countFrame = 0;
- let delFrame = 0;
- while(ObjEnemy_GetInfo(Enm2,INFO_LIFE)>0){
- Enm2X = ObjMove_GetX(Enm2);
- Enm2Y = ObjMove_GetY(Enm2);
- ObjEnemy_SetIntersectionCircleToShot(Enm2, Enm2X, Enm2Y, 10);
- countFrame++;
- if(countFrame == 60) { //Should the enemy shoot this frame?
- fireE;
- countFrame = 0;
- }
- if (Enm2X >= wdth+40 && dir == "RIGHT" ) { //Testing to see if enemy should be deleted
- Obj_Delete(Enm2);
- }
- if (Enm2X <= -40 && dir == "LEFT" ) {//Testing to see if enemy should be deleted
- Obj_Delete(Enm2);
- }
- yield;
- }
- PlaySE(enmdie);
- AddScore(5000);
- TExplosionA(Enm2X, Enm2Y, 10, 0.1);
- Obj_Delete(Enm2);
- task fireE {
- ascent(i in 0..18){
- CreateShotA1(Enm2X,Enm2Y,0.7,i*20+rand(1,10), 243,0);
- }
- PlaySE(Bullet);
- }
- }
- task Enemy03(x, y, xDest, yDest, spd) {
- let Enm3 = ObjEnemy_Create(OBJ_ENEMY);
- let Enm3X = 0;
- let Enm3Y = 0;
- ObjEnemy_Regist(Enm3);
- ObjEnemy_SetLife(Enm3, 50);
- ObjPrim_SetTexture(Enm3, fairy);
- ObjRender_SetScaleXYZ(Enm3, 1, 1, 1);
- ObjSprite2D_SetSourceRect(Enm3, 0, 0, 32, 32);
- ObjSprite2D_SetDestCenter(Enm3);
- ObjMove_SetPosition(Enm3, x, y);
- ObjMove_SetDestAtSpeed(Enm3, xDest, yDest, spd);
- let countFrame = 0;
- while(ObjEnemy_GetInfo(Enm3,INFO_LIFE)>0){
- Enm3X = ObjMove_GetX(Enm3);
- Enm3Y = ObjMove_GetY(Enm3);
- ObjEnemy_SetIntersectionCircleToShot(Enm3, Enm3X, Enm3Y, 10);
- countFrame++;
- if(countFrame == 30) {//Should enemy shoot?
- fireE;
- countFrame = 0;
- }
- if (Enm3Y > hght+40) {//Testing to see if enemy should be deleted
- Obj_Delete(Enm3);
- }
- yield;
- }
- PlaySE(enmdie);
- AddScore(2000);
- TExplosionA(Enm3X, Enm3Y, 10, 0.1);
- Obj_Delete(Enm3);
- task fireE {
- CreateShotA1(Enm3X,Enm3Y,2,GetAngleToPlayer(Enm3), 245,0);
- PlaySE(Bullet);
- }
- }
- task Enemy04(x, y, xDest, yDest, spd) {
- let Enm4 = ObjEnemy_Create(OBJ_ENEMY);
- let Enm4X = 0;
- let Enm4Y = 0;
- ObjEnemy_Regist(Enm4);
- ObjEnemy_SetLife(Enm4, 20);
- ObjPrim_SetTexture(Enm4, fairy);
- ObjRender_SetScaleXYZ(Enm4, 1, 1, 1);
- ObjSprite2D_SetSourceRect(Enm4, 0, 0, 32, 32);
- ObjSprite2D_SetDestCenter(Enm4);
- ObjMove_SetPosition(Enm4, x, y);
- ObjMove_SetDestAtSpeed(Enm4, xDest, yDest, spd);
- let countFrame = 0;
- while(ObjEnemy_GetInfo(Enm4,INFO_LIFE)>0){
- Enm4X = ObjMove_GetX(Enm4);
- Enm4Y = ObjMove_GetY(Enm4);
- ObjEnemy_SetIntersectionCircleToShot(Enm4, Enm4X, Enm4Y, 10);
- if (Enm4Y > hght+40) {//Testing to see if enemy should be deleted
- Obj_Delete(Enm4);
- }
- yield;
- }
- PlaySE(enmdie);
- AddScore(2000);
- TExplosionA(Enm4X, Enm4Y, 10, 0.1);
- Obj_Delete(Enm4);
- }
- task SpawnEnemies {
- let dir = GetCurrentScriptDirectory();
- Enemy01(100, -20, 100, 800, 2);
- Enemy01(300, -20, 300, 800, 2); //initial few enemies
- waitS(9); // 22 SECONDS
- loop(4){
- Enemy02(-20, 30, 600, 30, 3, "RIGHT"); //launch a line of four enemies shooting bullets kind of fast to the right side
- wait(30);
- } //26 SECONDS
- loop(4){
- Enemy02(wdth+20, 80, -60, 80, 3, "LEFT"); //launch a line of four enemies shooting bullets kind of fast to the left side
- wait(30);
- } //30 SECONDS
- loop(10) {
- Enemy03(wdth/2, -20, rand(50, wdth-50), 800, 3);
- Enemy03(wdth/2, -20, rand(wdth/2 -30, wdth/2 + 30), 800, 3);
- wait(30);
- } //35 SECONDS
- waitS(5); //40 SECONDS
- loop(30) { //barrage before midboss
- Enemy04(rand(10, wdth-10), -20, rand(10, wdth-10), 800, 5);
- Enemy04(rand(10, wdth-10), -20, rand(10, wdth-10), 800, 5);
- wait(10);
- }
- //45 SECONDS
- waitS(7);
- let MdBss1 = LoadScript(dir ~ "Stage 1 Midboss1.txt");
- StartScript(MdBss1);
- while(!IsCloseScript(MdBss1) && GetPlayerState() != STATE_END) {
- yield;
- }
- let MdBss2 = LoadScript(dir ~ "Stage 1 Midboss2.txt");
- StartScript(MdBss2);
- while(!IsCloseScript(MdBss2) && GetPlayerState() != STATE_END) {
- yield;
- }
- let MdBss3 = LoadScript(dir ~ "Stage 1 Midboss3.txt");
- StartScript(MdBss3);
- while(!IsCloseScript(MdBss3) && GetPlayerState() != STATE_END) {
- yield;
- }
- let posNew = 0;
- loop(4){
- posNew = rand(20, cx- 20);
- Enemy01(posNew, -20, posNew, 800, 5);
- wait(15);
- }
- loop(4){
- posNew = rand(cx+20, GetStgFrameWidth - 20);
- Enemy01(posNew, -20, posNew, 800, 5);
- wait(15);
- }
- waitS(7);
- let Script = LoadScript(dir ~ "Stage 1 Boss.txt");
- DialogueStarter(0, GetCurrentScriptDirectory ~ "/img/LilyCutin.png", 290, 235, "Lily White", "Ugh, I hate being all the way up here.");
- wait(10);
- while( GetVirtualKeyState(VK_SHOT) != KEY_PUSH) { yield;}
- ChangeText(1, "What's so bad about being in the Land Above the Clouds?", 0, 1, 0);
- wait(10);
- while( GetVirtualKeyState(VK_SHOT) != KEY_PUSH) { yield;}
- ChangeText(0, "Hm...?", 0, 1, 0);
- wait(10);
- while( GetVirtualKeyState(VK_SHOT) != KEY_PUSH) { yield;}
- ChangeText(1, "After all, it's the place where I live!", 1, 1, 2);
- wait(10);
- while( GetVirtualKeyState(VK_SHOT) != KEY_PUSH) { yield;}
- ChangeText(0, "You biased idiot... Did you screw up the mushrooms?", 0, 1, 1);
- wait(10);
- while( GetVirtualKeyState(VK_SHOT) != KEY_PUSH) { yield;}
- ChangeText(1, "Doubtful... Now, I'll show you the way out if you don't like it here!", 0, 1, 2);
- wait(10);
- while( GetVirtualKeyState(VK_SHOT) != KEY_PUSH) { yield;}
- ChangeText(0, "...", 0, 1, 0);
- wait(10);
- while( GetVirtualKeyState(VK_SHOT) != KEY_PUSH) { yield;}
- ChangeText(1, "...", 0, 1, 0);
- wait(10);
- while( GetVirtualKeyState(VK_SHOT) != KEY_PUSH) { yield;}
- ChangeText(0, "Justin isn't very good at writing dialogue, is he?", 0, 1, 0);
- wait(10);
- while( GetVirtualKeyState(VK_SHOT) != KEY_PUSH) { yield;}
- ChangeText(1, "Nope.", 0, 1, 3);
- wait(10);
- while( GetVirtualKeyState(VK_SHOT) != KEY_PUSH) { yield;}
- StopSound(BGM);
- FinishDialogue;
- StartScript(Script);
- while(!IsCloseScript(Script) && GetPlayerState() != STATE_END) {
- yield;
- }
- wait(240);
- CloseStgScene();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement