//一時停止中スクリプト //#include "./../../script/soundtask.txt" #include "script/KevinSystem/GeneralSoundLib.txt" int STGWIDTH = GetStgFrameWidth(); int STGHEIGHT = GetStgFrameHeight(); @Initialize { _SoundTask(); PauseGameSFX; SetAutoDeleteObject(true); //TBackground(); TBackgroundNew(0, 0); TMenu(); TFunFact(); //_SoundTask; } @MainLoop { yield; } @Finalize { } task TFunFact(){ //int y = 0; let textchoices = [ "Even though her parents gave her an entire crash course[r]on how royals enjoy tea, Erika is more a coffee fan.", "Pankevin is terrified of heights, but loves rollercoasters & thrill rides.[r]He only rides the ones with shoulder harnesses to feel safer,[r]and always goes with Kouda.", "Rachel has been exterminated at least twice by Housui[r]for constantly nagging her to let Rachel experiment.", "There are a total of 18 fun facts on this pause menu,[r]including this one. How many have you found?", "The creator of this game is incredibly self-indulgent.[r]You probably figured out this one, though...", "Connecting Chain Handserif is the creator's favorite font.[r]As a Brazilian once said, \"this bitch is[r]hyperfixated on that font\".", "Pankevin is acquainted with a duck who casts ice magic in the[r]Outside World. His name is Caleb.", "Marisa and Housui often duel in the Forest of Magic.[r]Their antics have incited Alice's wrath so much that[r]she just doesn't care anymore.", "Whenever Tenshi and Shion organize banquets at the Hakurei Shrine,[r]Erika is the self-appointed taste tester of the food.[r]It's gone from \"unbearable\" to \"passable\" according to her.", "Kouda always has a pair of fluffy cat-ear headphones on hand wherever[r]he goes, so he can plop them on when he's overwhelmed by loud sounds.[r]Pankevin keeps the headphones for Kouda in his huge quiver[r]when they're traveling together.", "Tenshi and Erika were planning to bring Shion along for[r]their adventures, but the latter was exhausted after[r]the oil overflow incident and stayed out.[r](If Shion came along, they would be too powerful...)", "Housui's favorite food are amarylis flowers.[r]...That's what she says, but it's probably just mochi.", "Inside Pankevin's huge quiver, there are many refillable water containers,[r]a portable sketchbook & watercolor set, some snacks, and a pair of[r]fluffy cat-ear headphones for Kouda.", "Pankevin = Panda + Kevin, not Pansexual x Kevin. Pankevin is bi.", "Thank you for playing this game! It means a lot to me :D", "Erika Rankyuu debuted in the creator's first game, Enigma of the Storm. [r]It was made for a bullet hell game contest in a Discord server.", "Housui Henkawa debuted in Unstable and Unimaginable Power, [r]a Touhou fangame. It's very well-crafted and polished, so go ahead[r]and play it! Housui's the Extra boss, by the way.", "Housui is not bald.", ]; int x = prand_int(0, length(textchoices)-1); //y = length(textchoices); let objText = ObjText_Create(); ObjText_SetText(objText, textchoices[x]); ObjText_SetFontSize(objText, 18.5); ObjText_SetFontType(objText, "Connecting Chain Handserif"); ObjText_SetMaxWidth(objText, STGWIDTH); ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER); ObjText_SetFontBold(objText, true); ObjText_SetFontColorTop(objText, 255, 255, 255); ObjText_SetFontColorBottom(objText, 255, 255, 255); ObjText_SetFontBorderType(objText, BORDER_FULL); ObjText_SetFontBorderColor(objText, 0x7D39D9); ObjText_SetFontBorderWidth(objText, 2); Obj_SetRenderPriorityI(objText, 10); ObjRender_SetX(objText, STGWIDTH-255); ObjRender_SetY(objText, STGHEIGHT-75); } // renderX and renderY will be TOP-LEFT COORDS task TBackgroundNew(renderX, renderY){ // Render semi-transparent primitive background task TRenderPrim(selection){ // Thank you for the PrimMaker Ferase :omegaflooshed: ObjRender_SetPosition(selection, renderX+640, renderY+360, 0); // Since the render priority of the r.target is under 20 // Set up vert 0 ObjPrim_SetVertexPosition(selection,0,-640,-360,0); ObjPrim_SetVertexColor(selection,0,0xA487FF); ObjPrim_SetVertexUVT(selection, 0, 0, 0); // Set up vert 1 ObjPrim_SetVertexPosition(selection,1,640,-360,0); ObjPrim_SetVertexColor(selection,1,0xA487FF); ObjPrim_SetVertexUVT(selection, 1, 1280, 0); // Set up vert 2 ObjPrim_SetVertexPosition(selection,2,640,360,0); ObjPrim_SetVertexColor(selection,2,0xA487FF); ObjPrim_SetVertexUVT(selection, 2, 1280, 720); // Set up vert 3 ObjPrim_SetVertexPosition(selection,3,640,360,0); ObjPrim_SetVertexColor(selection,3,0xF187FF); ObjPrim_SetVertexUVT(selection, 3, 1280, 720); // Set up vert 4 ObjPrim_SetVertexPosition(selection,4,-640,360,0); ObjPrim_SetVertexColor(selection,4,0xF187FF); ObjPrim_SetVertexUVT(selection, 4, 0, 720); // Set up vert 5 ObjPrim_SetVertexPosition(selection,5,-640,-360,0); ObjPrim_SetVertexColor(selection,5,0xF187FF); ObjPrim_SetVertexUVT(selection, 5, 0, 0); for(int i = 0; i <= 5; i++){ ObjPrim_SetVertexAlpha(selection, i, 100); } } // Render... the render target??? let objBG = ObjPrim_Create(OBJ_PRIMITIVE_2D); ObjPrim_SetPrimitiveType(objBG, PRIMITIVE_TRIANGLELIST); ObjPrim_SetVertexCount(objBG, 6); let target = "target"; CreateRenderTargetEx(target, 1280, 720); ObjPrim_SetTexture(objBG, target); //SetInvalidRenderPriorityA1(20, 80); RenderToTextureA1(target, 0, 100, true); //RenderToTextureB1(target, objBG, true); Obj_SetRenderPriorityI(objBG, 0); TRenderPrim(objBG); } task TBackground { task TVertex(var index, var left, var top, var right, var bottom) { ObjPrim_SetVertexPosition(obj, index + 0, left, top, 0); ObjPrim_SetVertexPosition(obj, index + 1, left, bottom, 0); ObjPrim_SetVertexPosition(obj, index + 2, right, top, 0); ObjPrim_SetVertexPosition(obj, index + 3, right, top, 0); ObjPrim_SetVertexPosition(obj, index + 4, left, bottom, 0); ObjPrim_SetVertexPosition(obj, index + 5, right, bottom, 0); ObjPrim_SetVertexUVT(obj, index + 0, left, top); ObjPrim_SetVertexUVT(obj, index + 1, left, bottom); ObjPrim_SetVertexUVT(obj, index + 2, right, top); ObjPrim_SetVertexUVT(obj, index + 3, right, top); ObjPrim_SetVertexUVT(obj, index + 4, left, bottom); ObjPrim_SetVertexUVT(obj, index + 5, right, bottom); //STGシーン内のみアニメーション if(left >= 341 && right <= 937 && top >= 45 && bottom <= 677) { let alpha = 255; while(alpha >= 128) { ObjPrim_SetVertexAlpha(obj, index + 0, alpha); ObjPrim_SetVertexAlpha(obj, index + 1, alpha/2); ObjPrim_SetVertexAlpha(obj, index + 2, alpha/2); ObjPrim_SetVertexAlpha(obj, index + 3, alpha/2); ObjPrim_SetVertexAlpha(obj, index + 4, alpha/2); ObjPrim_SetVertexAlpha(obj, index + 5, alpha); alpha -= 255 / frame; yield; } } } //分割設定 let frame = 30; let countH = 20; //分割数 let countV = 30; let width = 1280 / countH; let height = 720 / countV; let target = GetTransitionRenderTargetName(); let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D); //2D頂点ブジェクト生成 ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLELIST); ObjPrim_SetVertexCount(obj, countH * countV * 6); Obj_SetRenderPriorityI(obj, 0); //描画優先度を設定 ObjPrim_SetTexture(obj, target); //テクスチャを設定 ascent(ix in 0.. countH) { ascent(iy in 0.. countV) { let index = (ix + iy * countH) * 6; let left = ix * width; let right = left + width; let top = iy * height; let bottom = top + height; TVertex(index, left, top, right, bottom); } } } task TMenu { let selectIndex = 0;//選択位置 task TMenuItem(let index, let mx, let my, let text) { function CreateTextObject(let mx, let my, let text) { let obj = ObjText_Create(); ObjText_SetText(obj, text); ObjText_SetFontSize(obj, 35); ObjText_SetFontType(obj, "Exotc350 DmBd BT"); ObjText_SetFontBold(obj, true); ObjText_SetHorizontalAlignment(obj, ALIGNMENT_CENTER); ObjText_SetMaxWidth(obj, STGWIDTH); ObjText_SetFontColorTop(obj, 155, 45, 175); ObjText_SetFontColorBottom(obj, 200, 80, 255); ObjText_SetFontBorderType(obj, BORDER_FULL); ObjText_SetFontBorderColor(obj, 255, 255, 255); ObjText_SetFontBorderWidth(obj, 1.75); Obj_SetRenderPriorityI(obj, 10); ObjRender_SetX(obj, mx); ObjRender_SetY(obj, my); return obj; } let objText = CreateTextObject(mx, my, text); let objSelect = CreateTextObject(mx, my, text); ObjRender_SetBlendType(objSelect, BLEND_ADD_RGB); loop { Obj_SetVisible(objSelect, index == selectIndex); yield; } } //メニュー配置 int x = prand_int(0, 6); let textchoices = ["A Brief Respite", "Yassification Paused", "Tea Time", "Heroic Moratorium", "World Comes to A Halt","A Moment to Breathe", "Players are Resting Warmly"]; let objText = ObjText_Create(); ObjText_SetText(objText, textchoices[x]); ObjText_SetFontSize(objText, 50); ObjText_SetFontType(objText, "Exotc350 DmBd BT"); ObjText_SetMaxWidth(objText, STGWIDTH); ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER); ObjText_SetFontBold(objText, true); ObjText_SetFontColorTop(objText, 75, 255, 255); ObjText_SetFontColorBottom(objText, 180, 255, 255); ObjText_SetFontBorderType(objText, BORDER_FULL); ObjText_SetFontBorderColor(objText,0, 0, 0); ObjText_SetFontBorderWidth(objText, 3); Obj_SetRenderPriorityI(objText, 10); ObjRender_SetX(objText, STGWIDTH-255); ObjRender_SetY(objText, 100); let mx = STGWIDTH-255; let my = 175; let texts = ["Resume The Faceoff", "Accept Your Losses", "Take Another Shot"]; var countMenu = length(texts); ascent(var iText in 0 .. countMenu) { TMenuItem(iText, mx, my, texts[iText]); my += 45; } //キー状態がリセットされるまで待機 while(GetVirtualKeyState(VK_PAUSE) != KEY_FREE){yield;} //メニュー選択処理 let frameKeyHold = 0;//キー押しっぱなしフレーム数 //PauseGameSFX; loop { //決定 if(GetVirtualKeyState(VK_OK) == KEY_PULL) { let listResult = [RESULT_CANCEL, RESULT_END, RESULT_RETRY]; SetScriptResult(listResult[selectIndex]); CloseScript(GetOwnScriptID()); return; } //キャンセル if(GetVirtualKeyState(VK_CANCEL) == KEY_PULL || GetVirtualKeyState(VK_PAUSE) == KEY_PULL) { SetScriptResult(RESULT_CANCEL); CloseScript(GetOwnScriptID()); return; } //カーソル移動 if(GetVirtualKeyState(VK_UP) == KEY_PUSH) { SelectOptionSFX; selectIndex--; } else if(GetVirtualKeyState(VK_DOWN) == KEY_PUSH) { SelectOptionSFX; selectIndex++; } else if(GetVirtualKeyState(VK_UP) == KEY_HOLD) { frameKeyHold++; if(frameKeyHold == 30 || (frameKeyHold > 30 && (frameKeyHold % 10 == 0))) { SelectOptionSFX; selectIndex--; } } else if(GetVirtualKeyState(VK_DOWN) == KEY_HOLD) { frameKeyHold++; if(frameKeyHold == 30 || (frameKeyHold > 30 && (frameKeyHold % 10 == 0))) { SelectOptionSFX; selectIndex++; } } else { frameKeyHold = 0; } if(selectIndex < 0) { selectIndex = countMenu - 1; } else { selectIndex %= countMenu; } yield; } }