Cirno2022/script/ExRumia/ExRumia_Package_Main.txt

457 lines
19 KiB
Plaintext
Raw Normal View History

2022-09-14 15:23:27 +00:00
<EFBFBD><EFBFBD>#qg<71>e>_U^<5E><>[Package]
#Title["EX<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0"]
#Text["EX<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0"]
@Initialize
{
TTitleScene();
}
@MainLoop
{
yield;
}
@Finalize
{
}
//----------------------------------------------------
// <00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
//----------------------------------------------------
task TTitleScene
{
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0B}<7D>N<EFBFBD>0<EFBFBD>0<EFBFBD>0
let bEndTitleScene = false;
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0-<2D><>[
let dir = GetCurrentScriptDirectory();
let pathTitle = dir ~ "Title.png";
let objTitleImage = ObjPrim_Create(OBJ_SPRITE_2D); //2D<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0ub
Obj_SetRenderPriorityI(objTitleImage, 20); //<00>c;u*QHQ<48>^<5E>0-<2D><>[
ObjPrim_SetTexture(objTitleImage, pathTitle); //<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0-<2D><>[
ObjSprite2D_SetSourceRect(objTitleImage, 0, 0, 640, 480);
ObjSprite2D_SetDestRect(objTitleImage, 0, 0, 640, 480);
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>eW[R
let objTitleText = ObjText_Create();
ObjText_SetText(objTitleText, "<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0");
ObjText_SetFontSize(objTitleText, 40);
ObjText_SetFontBold(objTitleText, true);
ObjText_SetFontColorTop(objTitleText, 128, 128, 255);
ObjText_SetFontColorBottom(objTitleText, 64, 64, 255);
ObjText_SetFontBorderType(objTitleText, BORDER_FULL);
ObjText_SetFontBorderColor(objTitleText,255, 255, 255);
ObjText_SetFontBorderWidth(objTitleText, 2);
Obj_SetRenderPriorityI(objTitleText, 30);
ObjRender_SetX(objTitleText, 48);
ObjRender_SetY(objTitleText, 48);
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
let INDEX_START = 0;
let INDEX_REPLAY = 1;
let INDEX_QUIT = 2;
let selectIndex = 0;//x<><78>bMOn
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, 20);
ObjText_SetFontBold(obj, true);
ObjText_SetFontColorTop(obj, 128, 128, 255);
ObjText_SetFontColorBottom(obj, 64, 64, 255);
ObjText_SetFontBorderType(obj, BORDER_FULL);
ObjText_SetFontBorderColor(obj,255, 255, 255);
ObjText_SetFontBorderWidth(obj, 2);
Obj_SetRenderPriorityI(obj, 30);
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);
while(!bEndTitleScene)
{
Obj_SetVisible(objSelect, index == selectIndex);
yield;
}
Obj_Delete(objText);
Obj_Delete(objSelect);
}
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0M<30>n
let mx = 48;
let my = 360;
let texts = ["Start", "Replay", "Quit"];
var countMenu = length(texts);
ascent(var iText in 0 .. countMenu)
{
TMenuItem(iText, mx, my, texts[iText]);
my += 32;
}
//<00>0<EFBFBD>0<EFBFBD>rKaL0<4C>0<EFBFBD>0<EFBFBD>0<EFBFBD>0U0<55>0<EFBFBD>0~0g0<67>__j
while(GetVirtualKeyState(VK_OK) != KEY_FREE){yield;}
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0x<30><78>b<EFBFBD>Qt
let frameKeyHold = 0;//<00>0<EFBFBD>0<EFBFBD>bW0c0q0j0W0<57>0<EFBFBD>0<EFBFBD>0<EFBFBD>0pe
loop
{
//zl<7A>[
if(GetVirtualKeyState(VK_OK) == KEY_PUSH)
{
if(selectIndex == INDEX_START)
{
TStageScene("");
}
else if(selectIndex == INDEX_REPLAY)
{
TReplaySelectScene();
}
else if(selectIndex == INDEX_QUIT)
{
ClosePackage();
}
break;
}
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>y<EFBFBD>R
if(GetVirtualKeyState(VK_UP) == KEY_PUSH)
{
selectIndex--;
}
else if(GetVirtualKeyState(VK_DOWN) == KEY_PUSH)
{
selectIndex++;
}
else if(GetVirtualKeyState(VK_UP) == KEY_HOLD)
{
frameKeyHold++;
if(frameKeyHold == 30 || (frameKeyHold > 30 && (frameKeyHold % 10 == 0)))
{
selectIndex--;
}
}
else if(GetVirtualKeyState(VK_DOWN) == KEY_HOLD)
{
frameKeyHold++;
if(frameKeyHold == 30 || (frameKeyHold > 30 && (frameKeyHold % 10 == 0)))
{
selectIndex++;
}
}
else
{
frameKeyHold = 0;
}
if(selectIndex < 0)
{
selectIndex = countMenu - 1;
}
else
{
selectIndex %= countMenu;
}
yield;
}
bEndTitleScene = true;
Obj_Delete(objTitleImage);
Obj_Delete(objTitleText);
}
//----------------------------------------------------
// <00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
//----------------------------------------------------
task TStageScene(let pathReplay)
{
let dirCurrent = GetCurrentScriptDirectory();
let dirModule = GetModuleDirectory();
let pathMainScript = dirCurrent ~ "ExRumia_Stage.txt";
let pathPlayer = dirModule ~ "script/player/default_player/Default_Player_Rumia.txt";
//--------------------------------
//;ub<75>w<EFBFBD><77>y
RenderSceneToTransitionTexture();
TTransition();
//--------------------------------
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0RgS
InitializeStageScene();
if(length(pathReplay) > 0)
{
SetStageReplayFile(pathReplay);
}
//--------------------------------
//Rg<>0<EFBFBD>0<EFBFBD>0<EFBFBD>0-<2D><>[
let indexStage = 1; //<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
SetStageIndex(indexStage);
SetStageMainScript(pathMainScript);
SetStagePlayerScript(pathPlayer);
StartStageScene();
//--------------------------------
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>d\O
loop
{
//--------------------------------
//NBf\Pbk<62>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
if(GetVirtualKeyState(VK_PAUSE) == KEY_PUSH)
{
let resPause = RunPauseScene();
alternative(resPause)
case(RESULT_RETRY)
{
//gRK0<4B>0<EFBFBD>0<EFBFBD>0<EFBFBD>vY0
if(!IsReplay())
{
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
TerminateStageScene();
TStageScene("");
return;
}
}
case(RESULT_END)
{
//NBf\Pbk-Nn0B}<7D>N
TerminateStageScene();
}
}
if(!IsReplay() && GetKeyState(KEY_BACK) == KEY_PUSH)
{
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
TerminateStageScene();
TStageScene("");
return;
}
//--------------------------------
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>[<5B>N<EFBFBD>_a0
let stgSceneState = GetStageSceneState();
if(stgSceneState == STAGE_STATE_FINISHED)
{
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0B}<7D>NP}<7D>g<EFBFBD>0<EFBFBD>S<EFBFBD>_
let stageResult = GetStageSceneResult();
alternative(stageResult)
case(STAGE_RESULT_CLEARED)
{
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
if(indexStage == 2)
{
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>02<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0W0_04XTo0B}<7D>N
TEndScene();
break;
}
else
{
//!kn0<6E>0<EFBFBD>0<EFBFBD>0<EFBFBD>0x0w<30><77>y
indexStage++;
SetStageIndex(indexStage);
SetStageMainScript(pathMainScript); //r0h0~0Z0 TX0<58>0<EFBFBD>0<EFBFBD>0<EFBFBD>0...
SetStagePlayerScript(pathPlayer);
StartStageScene();
TTransition();
}
}
case(STAGE_RESULT_PLAYER_DOWN)
{
//<00><>_j<5F>k_j0
TEndScene();
break;
}
case(STAGE_RESULT_BREAK_OFF)
{
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<14>-NB}<7D>N
//NBf\Pbk-Nn0B}<7D>N
TTitleScene();
break;
}
}
yield;
}
TTransition();
}
//----------------------------------------------------
// B}<7D>N<EFBFBD>0<EFBFBD>0<EFBFBD>0
//----------------------------------------------------
task TEndScene()
{
if(IsReplay())
{
TTitleScene();
return;
}
//--------------------------------
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0B}<7D>N<EFBFBD>Qt
FinalizeStageScene();
//--------------------------------
//B}<7D>N<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0w<30><77>R
let dirModule = GetModuleDirectory();
let pathScript = dirModule ~ "script/default_system/Default_EndScene.txt";
let idScript = LoadScript(pathScript);
StartScript(idScript);
while(!IsCloseScript(idScript))
{
yield;
}
//--------------------------------
//B}<7D>N<EFBFBD>0<EFBFBD>0<EFBFBD>0P}<7D>g<EFBFBD>Qt
let result = GetScriptResult(idScript);
alternative(result)
case(RESULT_SAVE_REPLAY)
{
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>OX[
TReplaySaveScene();
}
case(RESULT_END)
{
//<00>QuB}<7D>N
TTitleScene();
}
case(RESULT_RETRY)
{
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
TStageScene("");
}
}
//----------------------------------------------------
// NBf\Pbk<62>0<EFBFBD>0<EFBFBD>0
//----------------------------------------------------
function RunPauseScene()
{
RenderSceneToTransitionTexture();
PauseStageScene(true);
let dirModule = GetModuleDirectory();
let pathScript = dirModule ~ "script/default_system/Default_Pause.txt";
//--------------------------------
//NBf\Pbk<62>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0w<30><77>R
let idScript = LoadScript(pathScript);
StartScript(idScript);
while(!IsCloseScript(idScript))
{
yield;
}
PauseStageScene(false);
let res = GetScriptResult(idScript);
return res;
}
//----------------------------------------------------
// <00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0x<30><78>b<EFBFBD>0<EFBFBD>0<EFBFBD>0
//----------------------------------------------------
task TReplaySelectScene()
{
let dirCurrent = GetCurrentScriptDirectory();
let pathScript = dirCurrent ~ "ExRumia_Package_ReplaySelectScene.txt";
//--------------------------------
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0x<30><78>b<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0w<30><77>R
let idScript = LoadScript(pathScript);
StartScript(idScript);
while(!IsCloseScript(idScript))
{
yield;
}
//--------------------------------
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0x<30><78>b<EFBFBD>0<EFBFBD>0<EFBFBD>0P}<7D>g<EFBFBD>Qt
let result = GetScriptResult(idScript);
if(length(result) == 0)
{
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0x0;b<>0
TTitleScene();
}
else
{
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>Qu<><75><EFBFBD>Y
TStageScene(result);
}
}
//----------------------------------------------------
// <00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>OX[<5B>0<EFBFBD>0<EFBFBD>0
//----------------------------------------------------
task TReplaySaveScene()
{
let dirModule = GetModuleDirectory();
let pathScript = dirModule ~ "script/default_system/Default_ReplaySaveScene.txt";
//--------------------------------
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>OX[<5B>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0w<30><77>R
let idScript = LoadScript(pathScript);
StartScript(idScript);
while(!IsCloseScript(idScript))
{
yield;
}
//--------------------------------
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0x0w<30><77>y
TTitleScene();
}
//----------------------------------------------------
// ;ub<75>w<EFBFBD><77>y<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
//----------------------------------------------------
function RenderSceneToTransitionTexture()
{
//<00>s(Wn0<6E>0<EFBFBD>0<EFBFBD>0<EFBFBD>Q<EFBFBD>[<5B>0;ub<75>w<EFBFBD><77>y(u<>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0k0<6B>c;u
let textureName = GetTransitionRenderTargetName();
RenderToTextureA1(textureName, 0, 100, true);
}
task TTransition
{
let textureName = GetTransitionRenderTargetName();
let objImage = ObjPrim_Create(OBJ_SPRITE_2D); //2D<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0ub
Obj_SetRenderPriorityI(objImage, 100); //<00>c;u*QHQ<48>^<5E>0-<2D><>[
ObjPrim_SetTexture(objImage, textureName); //<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0-<2D><>[
ObjSprite2D_SetSourceRect(objImage, 0, 0, 640, 480);
ObjSprite2D_SetDestRect(objImage, 0, 0, 640, 480);
let alpha = 255;
while(alpha > 0)
{
ObjRender_SetAlpha(objImage, alpha);
alpha -= 16;
yield;
}
Obj_Delete(objImage);
}