1485 lines
74 KiB
Plaintext
1485 lines
74 KiB
Plaintext
#東方弾幕風[Package]
|
||
#Title["be gay do crimes"]
|
||
#Text["NOOOO I DON'T WANNA MAKE MENUS *dies*"]
|
||
|
||
// Font installation: Anke Calligraph, Connecting Chain Handserif, Unispace, etc.
|
||
|
||
string pathPlayer = "";
|
||
string pathStage = "";
|
||
|
||
string[] PlayerArray =
|
||
["script/player/PrideJam_ByakMiko/ByakMiko_Main.dnh",
|
||
"script/player/PrideJam_RinnoRemi/RinnoRemi_Main.dnh"];
|
||
|
||
string[] StageArray =
|
||
["script/game/Stage_Arcade.dnh",
|
||
"script/game/Stage_Gentle.dnh"];
|
||
|
||
|
||
@Initialize
|
||
{
|
||
|
||
StartScript("script/KevinSystem/Init.dnh");
|
||
|
||
AddArchiveFile("script/game.dat");
|
||
AddArchiveFile("script/KevinSystem.dat");
|
||
|
||
if(IsCommonDataAreaExists("PIV") == false){
|
||
CreateCommonDataArea("PIV");
|
||
SetAreaCommonData("PIV", "currentvalue", 10000);
|
||
}
|
||
|
||
else{
|
||
SetAreaCommonData("PIV", "currentvalue", 10000);
|
||
}
|
||
|
||
if(IsCommonDataAreaExists("ScriptID") == false){
|
||
CreateCommonDataArea("ScriptID");
|
||
SetAreaCommonData("ScriptID", "SystemID", 0);
|
||
SetAreaCommonData("ScriptID", "ItemID", 0);
|
||
}
|
||
|
||
TInstallFont();
|
||
LanguageSelect();
|
||
|
||
let diffIndex = 0;
|
||
let playerIndex = 0;
|
||
|
||
}
|
||
|
||
let dirSystem = "script/KevinSystem/";
|
||
int lang = GetCommonData("Language", 0);
|
||
|
||
function TInstallFont{
|
||
|
||
// JP Text
|
||
InstallFont(dirSystem ~ "./font/FOT-NewCinemaAStd-D_1.otf");
|
||
InstallFont(dirSystem ~ "./font/Corporate-Logo-Rounded.otf");
|
||
InstallFont(dirSystem ~ "./font/OtsutomeFont_Ver3.ttf");
|
||
|
||
// English Text
|
||
InstallFont(dirSystem ~ "./font/Revue Regular.ttf");
|
||
InstallFont(dirSystem ~ "./font/Uni Sans Heavy.otf");
|
||
InstallFont(dirSystem ~ "./font/Exotic 350 Demi Bold BT.ttf");
|
||
InstallFont(dirSystem ~ "./font/unispace rg.ttf");
|
||
InstallFont(dirSystem ~ "./font/Connecting Chain Handserif.ttf");
|
||
InstallFont(dirSystem ~ "./font/AnkeCall.ttf");
|
||
|
||
// Misc
|
||
|
||
InstallFont(dirSystem ~ "./font/origa___.ttf");
|
||
|
||
|
||
}
|
||
|
||
// Initialize common data: Configurations, high scores for difficulties and players
|
||
|
||
/* CONFIG
|
||
|
||
BGM Volume
|
||
Sound Volume
|
||
Starting Lives Setting (0 to 999) (but why would you want to set your starting lives to 0??????)
|
||
Background Opacity (255 to 0, disables background rendering if at 0)
|
||
Dialogue Skip Setting (ON/OFF)
|
||
|
||
*/
|
||
|
||
// Load/create common data for config
|
||
|
||
if(LoadCommonDataAreaA2("Config", "script/game/config.dat") == false){
|
||
|
||
CreateCommonDataArea("Config");
|
||
SetAreaCommonData("Config", "BGMVol", 100);
|
||
SetAreaCommonData("Config", "SEVol", 100);
|
||
SetAreaCommonData("Config", "StartingLife", 3);
|
||
SetAreaCommonData("Config", "BGOpacity", 100); // By percentage
|
||
SetAreaCommonData("Config", "DialogueSkip", 0); // 0: no, 1: yes
|
||
SetAreaCommonData("Config", "PlayerShotOpacity", 60);
|
||
SetAreaCommonData("Config", "BGMSelect", 0); // O: Yal, 1: Wareya
|
||
SetAreaCommonData("Config", "ItemOpacity", 60);
|
||
|
||
// 1.01a
|
||
|
||
SetAreaCommonData("Config", "EffectCut", 0);
|
||
|
||
SaveCommonDataAreaA2("Config", "script/game/config.dat");
|
||
}
|
||
|
||
else{
|
||
LoadCommonDataAreaA2("Config", "script/game/config.dat");
|
||
}
|
||
|
||
// High Score
|
||
|
||
if(LoadCommonDataAreaA2("Data", "script/game/data.dat") == false){
|
||
|
||
CreateCommonDataArea("Data");
|
||
SetAreaCommonData("Data", "High Score", 0);
|
||
|
||
SaveCommonDataAreaA2("Data", "script/game/data.dat");
|
||
}
|
||
|
||
else{
|
||
LoadCommonDataAreaA2("Data", "script/game/data.dat");
|
||
}
|
||
|
||
@MainLoop
|
||
{
|
||
lang = GetCommonData("Language", 0);
|
||
yield;
|
||
}
|
||
|
||
@Finalize
|
||
{
|
||
}
|
||
|
||
// Lol mkm
|
||
function CreateTextObject(
|
||
float mx, my, size,
|
||
string text, font,
|
||
int colorTop, colorBottom,
|
||
int borderColor, borderWidth,
|
||
int renderPriority
|
||
){
|
||
|
||
let obj = ObjText_Create();
|
||
ObjText_SetText(obj, text);
|
||
ObjText_SetFontSize(obj, size);
|
||
ObjText_SetFontType(obj, font);
|
||
ObjText_SetFontColorTop(obj, colorTop);
|
||
ObjText_SetFontColorBottom(obj, colorBottom);
|
||
ObjText_SetFontBorderType(obj, BORDER_FULL);
|
||
ObjText_SetFontBorderColor(obj, borderColor);
|
||
ObjText_SetFontBorderWidth(obj, borderWidth);
|
||
Obj_SetRenderPriorityI(obj, renderPriority);
|
||
ObjRender_SetX(obj, mx);
|
||
ObjRender_SetY(obj, my);
|
||
return obj;
|
||
|
||
}
|
||
|
||
function <int> _Create2DImage(imgpath, int[] rectarray){
|
||
|
||
int imgname = ObjPrim_Create(OBJ_SPRITE_2D);
|
||
ObjPrim_SetTexture(imgname, imgpath);
|
||
ObjSprite2D_SetSourceRect(imgname, rectarray);
|
||
ObjSprite2D_SetDestCenter(imgname);
|
||
//ObjRender_SetPosition(imgname, positionstart)
|
||
|
||
return imgname;
|
||
}
|
||
|
||
function DigitToCommaArray(num){ //Natashinitai
|
||
|
||
let srcStr = IntToString(num);
|
||
let res = [];
|
||
let nChar = 0;
|
||
for(let i = length(srcStr) - 1; i >= 0; i--){
|
||
res = [srcStr[i]] ~ res;
|
||
nChar++;
|
||
if(nChar % 3 == 0 && i > 0) res = "," ~ res;
|
||
}
|
||
return res;
|
||
|
||
}
|
||
|
||
//----------------------------------------------------
|
||
// タイトルシーン
|
||
//----------------------------------------------------
|
||
task LanguageSelect(){
|
||
|
||
int image = _Create2DImage("script/game/PackageLib/PlaceholderTitleImage_Player.png", [0, 0, 1920, 1080]);
|
||
LoadTextureEx(image, true, true);
|
||
|
||
Obj_SetRenderPriorityI(image, 0);
|
||
ObjSprite2D_SetDestRect(image, 0, 0, 1920, 1080);
|
||
|
||
let bEndTitleScene = false;
|
||
|
||
task TMenuItem(
|
||
let index,
|
||
float mx, my, size,
|
||
string text
|
||
)
|
||
{
|
||
let objText = CreateTextObject(
|
||
mx, my, size,
|
||
text, "コーポレート・ロゴ(ラウンド) ver2 Bold",
|
||
0xFFFFFF, 0xFFFFFF,
|
||
0x070076, size/10,
|
||
2
|
||
);
|
||
let objSelect = CreateTextObject(
|
||
mx, my, size,
|
||
text, "コーポレート・ロゴ(ラウンド) ver2 Bold",
|
||
0xFFFFFF, 0xFFFFFF,
|
||
0x070076, size/10,
|
||
2
|
||
);
|
||
|
||
//ObjText_SetMaxWidth(objText, GetScreenWidth());
|
||
ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER);
|
||
|
||
//ObjText_SetMaxWidth(objSelect, GetScreenWidth);
|
||
ObjText_SetHorizontalAlignment(objSelect, ALIGNMENT_CENTER);
|
||
|
||
ObjRender_SetBlendType(objSelect, BLEND_ADD_RGB);
|
||
while(!bEndTitleScene)
|
||
{
|
||
Obj_SetVisible(objSelect, index == selectIndex);
|
||
yield;
|
||
}
|
||
Obj_Delete(objText);
|
||
Obj_Delete(objSelect);
|
||
}
|
||
|
||
let INDEX_ENG = 0;
|
||
let INDEX_JP = 1;
|
||
|
||
let selectIndex = 0;//選択位置
|
||
|
||
//メニュー配置
|
||
let mx = GetScreenWidth()/2;
|
||
let my = 1*GetScreenHeight()/5;
|
||
|
||
let texts = ["English", "日本語"];
|
||
|
||
var countMenu = length(texts);
|
||
|
||
ascent(var iText in 0 .. countMenu)
|
||
{
|
||
TMenuItem(iText, mx, my, 90, texts[iText]);
|
||
my += 120;
|
||
}
|
||
|
||
// Create Extend Text
|
||
|
||
let objText = CreateTextObject(
|
||
GetScreenWidth()/2, 3*GetScreenHeight()/5-120, 50,
|
||
"", "コーポレート・ロゴ(ラウンド) ver2 Bold",
|
||
0xFFFFFF, 0xFFFFFF,
|
||
0x070076, 60/10,
|
||
2
|
||
);
|
||
|
||
ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER);
|
||
|
||
ObjText_SetText(objText,
|
||
"[font sz=60]LIFE EXTEND AT[r][font oc=(50, 76, 156)]250,000,000[r][font oc=(50, 76, 156)]500,000,000[r][font oc=(50, 76, 156)]1,000,000,000[r][font oc=(50, 76, 156)]2,500,000,000[r][font oc=(50, 76, 156)]5,000,000,000[r][font oc=(50, 76, 156)]10,000,000,000"
|
||
);
|
||
|
||
//キー状態がリセットされるまで待機
|
||
while(GetVirtualKeyState(VK_OK) != KEY_FREE){yield;}
|
||
|
||
//メニュー選択処理
|
||
let frameKeyHold = 0;//キー押しっぱなしフレーム数
|
||
loop
|
||
{
|
||
//決定
|
||
if(GetVirtualKeyState(VK_OK) == KEY_PUSH)
|
||
{
|
||
if(selectIndex == INDEX_ENG)
|
||
{
|
||
SetCommonData("Language", 0); // English
|
||
TTitleScene();
|
||
}
|
||
else if(selectIndex == INDEX_JP)
|
||
{
|
||
SetCommonData("Language", 1); // Japanese
|
||
TTitleScene();
|
||
}
|
||
break;
|
||
}
|
||
|
||
//カーソル移動
|
||
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(objText);
|
||
Obj_Delete(image);
|
||
|
||
|
||
}
|
||
|
||
task TTitleScene
|
||
{
|
||
//タイトルシーン終了フラグ
|
||
|
||
if(IsCommonDataAreaExists("PIV") == false){
|
||
CreateCommonDataArea("PIV");
|
||
SetAreaCommonData("PIV", "currentvalue", 10000);
|
||
}
|
||
|
||
else{
|
||
SetAreaCommonData("PIV", "currentvalue", 10000);
|
||
}
|
||
|
||
let objText = CreateTextObject(
|
||
GetScreenWidth()/2, 0.75*GetScreenHeight()/5, 50,
|
||
"", "Otsutome_font Bold",
|
||
0xFFFFFF, 0xFFFFFF,
|
||
0xC02456, 60/10,
|
||
2
|
||
);
|
||
|
||
ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER);
|
||
|
||
/*ObjText_SetText(objText,
|
||
"[font sz=150 oc=(78, 102, 255)]東方氷湖暴[r][font sz=90 oc=(0, 26, 190)]RAMPAGE OF THE STRONGEST!"
|
||
);*/
|
||
|
||
int image = _Create2DImage("script/game/PackageLib/PlaceholderTitleImage.png", [0, 0, 1920, 1080]);
|
||
LoadTextureEx(image, true, true);
|
||
|
||
Obj_SetRenderPriorityI(image, 0);
|
||
ObjSprite2D_SetDestRect(image, 0, 0, 1920, 1080);
|
||
|
||
let bEndTitleScene = false;
|
||
|
||
let objScore = CreateTextObject(
|
||
GetScreenWidth()/2, 8*GetScreenHeight()/9, 30,
|
||
"", "Origami Mommy",
|
||
0xFFFFFF, 0xFFFFFF,
|
||
0xFF944E, 30/10,
|
||
2
|
||
);
|
||
|
||
ObjText_SetHorizontalAlignment(objScore, ALIGNMENT_CENTER);
|
||
|
||
int skor = GetAreaCommonData("Data", "High Score", 0);
|
||
|
||
if (skor >= 40000000000){
|
||
|
||
ObjText_SetText(objScore,
|
||
"YOU ARE THE STRONGEST!!!!!! " ~ DigitToCommaArray(GetAreaCommonData("Data", "High Score", 0))
|
||
);
|
||
|
||
}
|
||
|
||
else if (skor >= 30000000000){
|
||
ObjText_SetText(objScore,
|
||
"THE STRONGEST!!!!! " ~ DigitToCommaArray(GetAreaCommonData("Data", "High Score", 0))
|
||
);
|
||
}
|
||
|
||
else if (skor >= 20000000000){
|
||
ObjText_SetText(objScore,
|
||
"THE STRONGEST!!!! " ~ DigitToCommaArray(GetAreaCommonData("Data", "High Score", 0))
|
||
);
|
||
}
|
||
|
||
else if (skor >= 10000000000){
|
||
ObjText_SetText(objScore,
|
||
"THE STRONGEST!!! " ~ DigitToCommaArray(GetAreaCommonData("Data", "High Score", 0))
|
||
);
|
||
}
|
||
|
||
else if (skor >= 5000000000){
|
||
ObjText_SetText(objScore,
|
||
"THE STRONGEST!! " ~ DigitToCommaArray(GetAreaCommonData("Data", "High Score", 0))
|
||
);
|
||
}
|
||
|
||
else if (skor > 0){
|
||
ObjText_SetText(objScore,
|
||
"THE STRONGEST! " ~ DigitToCommaArray(GetAreaCommonData("Data", "High Score", 0))
|
||
);
|
||
}
|
||
|
||
else{
|
||
ObjText_SetText(objScore,
|
||
"CAN YOU BE THE STRONGEST? " ~ DigitToCommaArray(GetAreaCommonData("Data", "High Score", 0))
|
||
);
|
||
}
|
||
|
||
|
||
//メニュー
|
||
|
||
task TMenuItem(
|
||
let index,
|
||
float mx, my, size,
|
||
string text
|
||
)
|
||
{
|
||
let objText = CreateTextObject(
|
||
mx, my, size,
|
||
text, "コーポレート・ロゴ(ラウンド) ver2 Bold",
|
||
0xFFFFFF, 0xFFFFFF,
|
||
0x070076, size/10,
|
||
2
|
||
);
|
||
let objSelect = CreateTextObject(
|
||
mx, my, size,
|
||
text, "コーポレート・ロゴ(ラウンド) ver2 Bold",
|
||
0xFFFFFF, 0xFFFFFF,
|
||
0x070076, size/10,
|
||
2
|
||
);
|
||
|
||
//ObjText_SetMaxWidth(objText, GetScreenWidth());
|
||
ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER);
|
||
|
||
//ObjText_SetMaxWidth(objSelect, GetScreenWidth);
|
||
ObjText_SetHorizontalAlignment(objSelect, ALIGNMENT_CENTER);
|
||
|
||
ObjRender_SetBlendType(objSelect, BLEND_ADD_RGB);
|
||
|
||
Obj_SetVisible(objSelect, false);
|
||
|
||
while(!bEndTitleScene)
|
||
{
|
||
if(index == selectIndex){
|
||
ObjText_SetFontBorderWidth(objText, size/6);
|
||
ObjText_SetFontSize(objText, size*1.15);
|
||
ObjText_SetFontBorderColor(objText, 0x008BFF);
|
||
}
|
||
|
||
else{
|
||
ObjText_SetFontBorderWidth(objText, size/10);
|
||
ObjText_SetFontSize(objText, size);
|
||
ObjText_SetFontBorderColor(objText, 0x070076);
|
||
}
|
||
|
||
yield;
|
||
}
|
||
Obj_Delete(objText);
|
||
Obj_Delete(objSelect);
|
||
}
|
||
|
||
let INDEX_START = 0;
|
||
let INDEX_MANUAL = 1;
|
||
let INDEX_REPLAY = 2;
|
||
let INDEX_CONFIG = 3;
|
||
let INDEX_QUIT = 4;
|
||
|
||
let selectIndex = 0;//選択位置
|
||
|
||
//メニュー配置
|
||
let mx = 3*GetScreenWidth()/4;
|
||
let my = 2.6*GetScreenHeight()/5;
|
||
|
||
let texts = ["START GAME", "READ MANUAL", "VIEW REPLAY", "OPTIONS", "END GAME"];
|
||
|
||
var countMenu = length(texts);
|
||
|
||
ascent(var iText in 0 .. countMenu)
|
||
{
|
||
TMenuItem(iText, mx, my, 48, texts[iText]);
|
||
my += 60;
|
||
}
|
||
|
||
//キー状態がリセットされるまで待機
|
||
while(GetVirtualKeyState(VK_OK) != KEY_FREE){yield;}
|
||
|
||
//メニュー選択処理
|
||
let frameKeyHold = 0;//キー押しっぱなしフレーム数
|
||
loop
|
||
{
|
||
//決定
|
||
if(GetVirtualKeyState(VK_OK) == KEY_PUSH)
|
||
{
|
||
if(selectIndex == INDEX_START)
|
||
{
|
||
SetCommonData("Difficulty", "Standard");
|
||
TStageScene("", "TBA", GetAreaCommonData("Config", "StartingLife", 3), GetAreaCommonData("Config", "DialogueSkip", 0), false);
|
||
}
|
||
if(selectIndex == INDEX_MANUAL)
|
||
{
|
||
TManualScene();
|
||
}
|
||
else if(selectIndex == INDEX_REPLAY)
|
||
{
|
||
TReplaySelectScene();
|
||
}
|
||
else if(selectIndex == INDEX_CONFIG)
|
||
{
|
||
TConfigScene();
|
||
}
|
||
else if(selectIndex == INDEX_QUIT)
|
||
{
|
||
ClosePackage();
|
||
}
|
||
break;
|
||
}
|
||
|
||
//カーソル移動
|
||
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(image);
|
||
Obj_Delete(objText);
|
||
Obj_Delete(objScore);
|
||
|
||
}
|
||
|
||
// Configurations
|
||
|
||
task TConfigScene{
|
||
|
||
// Credit: Kobito
|
||
|
||
int image = _Create2DImage("script/game/PackageLib/PlaceholderTitleImage_Player.png", [0, 0, 1920, 1080]);
|
||
LoadTextureEx(image, true, true);
|
||
|
||
Obj_SetRenderPriorityI(image, 0);
|
||
ObjSprite2D_SetDestRect(image, 0, 0, 1920, 1080);
|
||
|
||
let bEndTitleScene = false;
|
||
|
||
// BGM, SE, Life, BG, Skip, PlayerShot, Item
|
||
|
||
let settingDefault = [100, 100, 3, 100, 0, 60, 60, 0, 0];
|
||
let setting = [0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||
let settingMax = [100, 100, 999, 100, 1, 100, 100, 3, 1];
|
||
let holdInterval = [2, 2, 1, 2, 30, 2, 2, 30, 30];
|
||
|
||
setting[0] = GetAreaCommonData("Config", "BGMVol", 100);
|
||
setting[1] = GetAreaCommonData("Config", "SEVol", 100);
|
||
setting[2] = GetAreaCommonData("Config", "StartingLife", 3);
|
||
setting[3] = GetAreaCommonData("Config", "BGOpacity", 255);
|
||
setting[4] = GetAreaCommonData("Config", "BGMSelect", 0);
|
||
setting[5] = GetAreaCommonData("Config", "PlayerShotOpacity", 60);
|
||
setting[6] = GetAreaCommonData("Config", "ItemOpacity", 60);
|
||
setting[7] = GetAreaCommonData("Config", "EffectCut", 0);
|
||
setting[8] = GetCommonData("Language", 0);
|
||
|
||
let selectIndex = 0;
|
||
var countMenu = 10;
|
||
|
||
let texts = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||
|
||
let objWarning = CreateTextObject(
|
||
GetScreenWidth()/2, 10*GetScreenHeight()/12, [38, 48][lang],
|
||
["High scores are only saved with 3 starting lives or fewer.[r]Press X/Cancel to save settings and return to the menu.",
|
||
"ライフカウンター<=3たらだけハイスコアは記録します。[r]X/CANCEL:コンフィグをセーブとメニューに帰る"][lang], "コーポレート・ロゴ(ラウンド) ver2 Bold",
|
||
0xFFFFFF, 0xFFFFFF,
|
||
0xFF6D64, 35/10,
|
||
2
|
||
);
|
||
|
||
ObjText_SetHorizontalAlignment(objWarning, ALIGNMENT_CENTER);
|
||
|
||
function <int> TMenuItem(
|
||
let index,
|
||
float mx, my, size,
|
||
string text
|
||
)
|
||
{
|
||
let objText = CreateTextObject(
|
||
mx, my, size,
|
||
text, "コーポレート・ロゴ(ラウンド) ver2 Bold",
|
||
0xFFFFFF, 0xFFFFFF,
|
||
0x000000, size/10,
|
||
2
|
||
);
|
||
|
||
//ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER);
|
||
|
||
async{
|
||
while(!bEndTitleScene)
|
||
{
|
||
if(index == selectIndex){ObjRender_SetColor(objText, 255, 255, 255);}
|
||
else{ObjRender_SetColor(objText, 100, 100, 100);}
|
||
yield;
|
||
}
|
||
Obj_Delete(objText);
|
||
}
|
||
|
||
return objText;
|
||
|
||
}
|
||
|
||
float mx = GetScreenWidth()/2-GetScreenWidth()/5;
|
||
float my = 1.5*GetScreenHeight()/12;
|
||
|
||
ascent(i in 0..10){texts[i] = TMenuItem(i, mx, my+i*GetScreenHeight()/15, 45, "");}
|
||
|
||
ObjText_SetText(texts[9], ["Reset to Default", "DEFAULT"][lang]);
|
||
|
||
function ChangeSetting(a, b){
|
||
setting[a] += b;
|
||
if(setting[a] < 0){setting[a] = settingMax[a];}
|
||
else if(setting[a] > settingMax[a]){setting[a] = 0;}
|
||
}
|
||
|
||
let configText = [
|
||
["BGM Volume: ", "SFX Volume:", "Starting Lives:", "Background Opacity:", "BGM Selection:", "Player Shot Opacity:", "Item Opacity: ", "Effect Cut Level: ", "Language: "],
|
||
["BGM Vol: ", "SFX Vol: ", "ライフカウンター: ", "背景の透明:", "BGM SELECT:", "プレイヤーショットの透明: ", "アイテムの透明:", "エフェクトカット:", "言語: "]
|
||
];
|
||
|
||
function UpdateTexts{
|
||
ObjText_SetText(texts[0], configText[lang][0]~" " ~ IntToString(setting[0]));
|
||
ObjText_SetText(texts[1], configText[lang][1]~" " ~ IntToString(setting[1]));
|
||
|
||
ObjText_SetText(texts[2], configText[lang][2]~" " ~ IntToString(setting[2]));
|
||
|
||
ObjText_SetText(texts[3], configText[lang][3]~" " ~ IntToString(setting[3]) ~ "%");
|
||
|
||
alternative(setting[4])
|
||
case(0){ObjText_SetText(texts[4], configText[lang][4]~" Yal");}
|
||
case(1){ObjText_SetText(texts[4], configText[lang][4]~" Wareya");}
|
||
|
||
alternative(setting[5])
|
||
case(0){ObjText_SetText(texts[5], configText[lang][5]~" " ~ IntToString(setting[5]) ~ [" (Why???)", " (なんで???)"][lang]);}
|
||
case(60){ObjText_SetText(texts[5],configText[lang][5]~" " ~ IntToString(setting[5]) ~ [" (Recommended)", " (推薦)"][lang]);}
|
||
case(100){ObjText_SetText(texts[5],configText[lang][5]~" " ~ IntToString(setting[5]) ~ [" (Eye-Blinding)", " (逆上)"][lang]);}
|
||
others{ObjText_SetText(texts[5], configText[lang][5]~" " ~ IntToString(setting[5]));}
|
||
|
||
alternative(setting[6])
|
||
case(0){ObjText_SetText(texts[6], configText[lang][6]~" " ~ IntToString(setting[6]) ~ [" (Why???)", " (なんで???)"][lang]);}
|
||
case(60){ObjText_SetText(texts[6], configText[lang][6]~" " ~ IntToString(setting[6]) ~ [" (Recommended)", " (推薦)"][lang]);}
|
||
case(100){ObjText_SetText(texts[6], configText[lang][6]~" " ~ IntToString(setting[6]) ~ [" (Eye-Blinding)", " (逆上)"][lang]);}
|
||
others{ObjText_SetText(texts[6], configText[lang][6]~" " ~ IntToString(setting[6]));}
|
||
|
||
alternative(setting[7])
|
||
case(0){ObjText_SetText(texts[7], configText[lang][7]~ " " ~ IntToString(setting[7]) ~ [" (Full Effects)", " (全部エフェクト)"][lang]);}
|
||
case(1){ObjText_SetText(texts[7], configText[lang][7]~ " " ~ IntToString(setting[7]) ~ [" (No Item Popups)", " (アイテムポップアップじゃない)"][lang]);}
|
||
case(2){ObjText_SetText(texts[7], configText[lang][7]~ " " ~ IntToString(setting[7]) ~ [" (No Explosion Effects)", " (爆発エフェクトじゃない)"][lang]);}
|
||
case(3){ObjText_SetText(texts[7], configText[lang][7]~ " " ~ IntToString(setting[7]) ~ [" (No Effects)", " (エフェクトじゃない)"][lang]);}
|
||
others{ObjText_SetText(texts[7], configText[lang][7]~ " " ~ IntToString(setting[7]));}
|
||
|
||
alternative(setting[8])
|
||
case(0){ObjText_SetText(texts[8], configText[lang][8]~" English");}
|
||
case(1){ObjText_SetText(texts[8], configText[lang][8]~" 日本語");}
|
||
|
||
}
|
||
|
||
UpdateTexts();
|
||
|
||
while(GetVirtualKeyState(VK_OK) != KEY_FREE){yield;}
|
||
|
||
let frameKeyHold = 0;
|
||
let frameKeyHoldSide = 0;
|
||
|
||
loop{
|
||
|
||
UpdateTexts();
|
||
|
||
if(GetVirtualKeyState(VK_CANCEL) == KEY_PUSH){
|
||
TTitleScene();
|
||
break;
|
||
}
|
||
|
||
// Select option to configure
|
||
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;}
|
||
|
||
if(GetVirtualKeyState(VK_RIGHT) == KEY_HOLD || GetVirtualKeyState(VK_LEFT) == KEY_HOLD){frameKeyHoldSide++;}
|
||
else{frameKeyHoldSide = 0;}
|
||
|
||
if(GetVirtualKeyState(VK_RIGHT) == KEY_PUSH || GetVirtualKeyState(VK_RIGHT) == KEY_HOLD){
|
||
if(GetVirtualKeyState(VK_RIGHT) == KEY_PUSH || (frameKeyHoldSide >= 30 && frameKeyHoldSide % holdInterval[selectIndex] == 0)){
|
||
if (selectIndex >= 9){}
|
||
else{ChangeSetting(selectIndex, 1);}
|
||
}
|
||
}
|
||
else if(GetVirtualKeyState(VK_LEFT) == KEY_PUSH || GetVirtualKeyState(VK_LEFT) == KEY_HOLD){
|
||
if(GetVirtualKeyState(VK_LEFT) == KEY_PUSH || (frameKeyHoldSide >= 30 && frameKeyHoldSide % holdInterval[selectIndex] == 0)){
|
||
if (selectIndex >= 9){}
|
||
else{ChangeSetting(selectIndex, -1);}
|
||
}
|
||
}
|
||
|
||
if(selectIndex == 9 && GetVirtualKeyState(VK_OK) == KEY_PUSH){
|
||
ascent(i in 0..8){
|
||
setting[i] = settingDefault[i];
|
||
selectIndex = 0;
|
||
}
|
||
}
|
||
|
||
SetAreaCommonData("Config", "BGMVol", setting[0]);
|
||
SetAreaCommonData("Config", "SEVol", setting[1]);
|
||
SetAreaCommonData("Config", "StartingLife", setting[2]);
|
||
SetAreaCommonData("Config", "BGOpacity", setting[3]);
|
||
SetAreaCommonData("Config", "BGMSelect", setting[4]);
|
||
SetAreaCommonData("Config", "PlayerShotOpacity", setting[5]);
|
||
SetAreaCommonData("Config", "ItemOpacity", setting[6]);
|
||
SetAreaCommonData("Config", "EffectCut", setting[7]);
|
||
SetCommonData("Language", setting[8]);
|
||
|
||
ObjText_SetText(texts[9], ["Reset to Default", "DEFAULT"][lang]);
|
||
ObjText_SetText(objWarning, ["High scores are only saved with 3 starting lives or fewer.[r]Press X/Cancel to save settings and return to the menu.", "ライフカウンター<=3たらだけハイスコアは記録します。[r]X/CANCEL:コンフィグをセーブとメニューに帰る"][lang]);
|
||
|
||
//SetSoundDivisionVolumeRate(SOUND_BGM, GetAreaCommonData("Config", "BGMVol", 100)*0.01);
|
||
//SetSoundDivisionVolumeRate(SOUND_SE, GetAreaCommonData("Config", "SEVol", 100)*0.01);
|
||
|
||
yield;
|
||
}
|
||
|
||
SaveCommonDataAreaA2("Config", "script/game/config.dat");
|
||
bEndTitleScene = true;
|
||
Obj_Delete(image);
|
||
Obj_Delete(objWarning);
|
||
}
|
||
|
||
// Manual
|
||
|
||
task TManualScene(){
|
||
|
||
bool bEndTitleScene = false;
|
||
|
||
int image = _Create2DImage("script/game/PackageLib/PlaceholderTitleImage_Player.png", [0, 0, 1920, 1080]);
|
||
LoadTextureEx(image, true, true);
|
||
|
||
Obj_SetRenderPriorityI(image, 0);
|
||
ObjRender_SetAlpha(image, 255/2);
|
||
ObjSprite2D_SetDestRect(image, 0, 0, 1920, 1080);
|
||
|
||
int imageManual = _Create2DImage(["script/game/PackageLib/Manual.png", "script/game/PackageLib/Manual_JP.png"][lang], [0, 0, 1920, 1080]);
|
||
LoadTextureEx(imageManual, true, true);
|
||
|
||
Obj_SetRenderPriorityI(imageManual, 1);
|
||
ObjRender_SetAlpha(imageManual, 255);
|
||
ObjSprite2D_SetDestRect(imageManual, 0, 0, 1920, 1080);
|
||
|
||
Obj_SetVisible(imageManual, false);
|
||
|
||
//Obj_SetVisible(imgArcade, false);
|
||
//Obj_SetVisible(imgGentle, false);
|
||
|
||
//キー状態がリセットされるまで待機
|
||
while(GetVirtualKeyState(VK_OK) != KEY_FREE){yield;}
|
||
|
||
//メニュー選択処理
|
||
let frameKeyHold = 0;//キー押しっぱなしフレーム数
|
||
loop
|
||
{
|
||
Obj_SetVisible(imageManual, true);
|
||
if(GetVirtualKeyState(VK_CANCEL) == KEY_PUSH){
|
||
TTitleScene();
|
||
break;
|
||
}
|
||
|
||
yield;
|
||
}
|
||
|
||
bEndTitleScene = true;
|
||
Obj_Delete(image);
|
||
Obj_Delete(imageManual);
|
||
|
||
}
|
||
|
||
//----------------------------------------------------
|
||
// ステージシーン
|
||
//----------------------------------------------------
|
||
|
||
task TDifficultySelect(){
|
||
|
||
bool bEndTitleScene = false;
|
||
|
||
int image = _Create2DImage("script/game/PackageLib/PlaceholderTitleImage_Player.png", [0, 0, 1920, 1080]);
|
||
LoadTextureEx(image, true, true);
|
||
|
||
Obj_SetRenderPriorityI(image, 0);
|
||
ObjSprite2D_SetDestRect(image, 0, 0, 1920, 1080);
|
||
|
||
//Obj_SetVisible(imgArcade, false);
|
||
//Obj_SetVisible(imgGentle, false);
|
||
|
||
task TMenuItem(
|
||
let index,
|
||
float mx, my, size,
|
||
string text
|
||
)
|
||
{
|
||
let objText = CreateTextObject(
|
||
mx, my, size,
|
||
text, "コーポレート・ロゴ(ラウンド) ver2 Bold",
|
||
0xFFFFFF, 0xFFFFFF,
|
||
0xAA0E2B, size/10,
|
||
2
|
||
);
|
||
let objSelect = CreateTextObject(
|
||
mx, my, size,
|
||
text, "コーポレート・ロゴ(ラウンド) ver2 Bold",
|
||
0xFFFFFF, 0xFFFFFF,
|
||
0xAA0E2B, size/10,
|
||
2
|
||
);
|
||
|
||
//ObjText_SetMaxWidth(objText, GetScreenWidth()/4);
|
||
ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER);
|
||
|
||
//ObjText_SetMaxWidth(objSelect, GetScreenWidth()/4);
|
||
ObjText_SetHorizontalAlignment(objSelect, ALIGNMENT_CENTER);
|
||
|
||
ObjRender_SetBlendType(objSelect, BLEND_ADD_RGB);
|
||
while(!bEndTitleScene)
|
||
{
|
||
Obj_SetVisible(objSelect, index == selectIndex);
|
||
yield;
|
||
}
|
||
Obj_Delete(objText);
|
||
Obj_Delete(objSelect);
|
||
}
|
||
|
||
let INDEX_NORMAL = 0;
|
||
let INDEX_HARD = 1;
|
||
let INDEX_LUNATIC = 2;
|
||
|
||
let selectIndex = 0;//選択位置
|
||
|
||
//メニュー配置
|
||
let mx = GetScreenWidth()/2;
|
||
let my = 1*GetScreenHeight()/5;
|
||
|
||
let texts = [
|
||
|
||
[
|
||
"[font oc=(0, 147, 213) sz=90]Normal Mode[r][font oc=(50, 76, 156)]A lighthearted difficulty[r][font oc=(50, 76, 156)]for beginners and intermediate players.",
|
||
|
||
"[font oc=(220, 0, 219) sz=90]Hard Mode[r][font oc=(125, 14, 170)]A challenging difficulty[r][font oc=(125, 14, 170)]for ambitious players.",
|
||
|
||
"[font oc=(227, 0, 0) sz=90]Lunatic Mode[r][font oc=(114, 55, 46)]You can choose this, but why would you?"
|
||
],
|
||
|
||
[
|
||
"[font oc=(0, 147, 213) sz=90]Normal Mode[r][font oc=(50, 76, 156)]初心者のための静かなレベルです。",
|
||
|
||
"[font oc=(220, 0, 219) sz=90]Hard Mode[r][font oc=(125, 14, 170)]意欲的な名人のための難しいレベルです。",
|
||
|
||
"[font oc=(227, 0, 0) sz=90]Lunatic Mode[r][font oc=(114, 55, 46)]なんで?"
|
||
]
|
||
|
||
];
|
||
|
||
var countMenu = length(texts[lang]);
|
||
|
||
for(int iText = 0; iText <= 2; iText++)
|
||
{
|
||
TMenuItem(iText, mx, my, 40, texts[lang][iText]);
|
||
my += 240;
|
||
}
|
||
|
||
//キー状態がリセットされるまで待機
|
||
while(GetVirtualKeyState(VK_OK) != KEY_FREE){yield;}
|
||
|
||
//メニュー選択処理
|
||
let frameKeyHold = 0;//キー押しっぱなしフレーム数
|
||
loop
|
||
{
|
||
if(GetVirtualKeyState(VK_CANCEL) == KEY_PUSH){
|
||
TTitleScene();
|
||
break;
|
||
}
|
||
|
||
else if(GetVirtualKeyState(VK_OK) == KEY_PUSH)
|
||
{
|
||
if(selectIndex == INDEX_NORMAL)
|
||
{
|
||
SetCommonData("Difficulty", "Normal");
|
||
TStageScene("", "TBA", GetAreaCommonData("Config", "StartingLife", 3), GetAreaCommonData("Config", "DialogueSkip", 0), false);
|
||
}
|
||
else if(selectIndex == INDEX_HARD)
|
||
{
|
||
SetCommonData("Difficulty", "Hard");
|
||
TStageScene("", "TBA", GetAreaCommonData("Config", "StartingLife", 3), GetAreaCommonData("Config", "DialogueSkip", 0), false);
|
||
}
|
||
else if(selectIndex == INDEX_LUNATIC)
|
||
{
|
||
SetCommonData("Difficulty", "Lunatic");
|
||
TStageScene("", "TBA", GetAreaCommonData("Config", "StartingLife", 3), GetAreaCommonData("Config", "DialogueSkip", 0), false);
|
||
}
|
||
break;
|
||
}
|
||
|
||
//カーソル移動
|
||
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(image);
|
||
|
||
}
|
||
|
||
task TPlayerSelect(){
|
||
|
||
bool bEndTitleScene = false;
|
||
|
||
int image = _Create2DImage("script/game/PackageLib/PlaceholderTitleImage_Player.png", [0, 0, 1920, 1080]);
|
||
LoadTextureEx(image, true, true);
|
||
|
||
Obj_SetRenderPriorityI(image, 0);
|
||
ObjSprite2D_SetDestRect(image, 0, 0, 1920, 1080);
|
||
|
||
int imgByakMiko = _Create2DImage("script/game/PackageLib/ByakMiko_Select.png", [0, 0, 1800, 1080]);
|
||
LoadTextureEx(imgByakMiko, true, true);
|
||
Obj_SetRenderPriorityI(imgByakMiko, 2);
|
||
ObjRender_SetPosition(imgByakMiko, GetScreenWidth()/2, 2*GetScreenHeight()/5+120, 0);
|
||
ObjRender_SetScaleXYZ(imgByakMiko, 0.84);
|
||
|
||
int imgRinnoRemi = _Create2DImage("script/game/PackageLib/RinnoRemi_Select.png", [0, 0, 1800, 1080]);
|
||
LoadTextureEx(imgRinnoRemi, true, true);
|
||
Obj_SetRenderPriorityI(imgRinnoRemi, 2);
|
||
ObjRender_SetPosition(imgRinnoRemi, GetScreenWidth()/2, 2*GetScreenHeight()/5+120, 0);
|
||
ObjRender_SetScaleXYZ(imgRinnoRemi, 0.84);
|
||
|
||
Obj_SetVisible(imgByakMiko, false);
|
||
Obj_SetVisible(imgRinnoRemi, false);
|
||
|
||
task TMenuItem(
|
||
let index,
|
||
float mx, my, size,
|
||
string text
|
||
)
|
||
{
|
||
let objText = CreateTextObject(
|
||
mx, my, size,
|
||
text, "Unispace",
|
||
0xFFFFFF, 0xFFFFFF,
|
||
0xAA0E2B, size/10,
|
||
2
|
||
);
|
||
let objSelect = CreateTextObject(
|
||
mx, my, size,
|
||
text, "Unispace",
|
||
0xFFFFFF, 0xFFFFFF,
|
||
0xAA0E2B, size/10,
|
||
2
|
||
);
|
||
|
||
//ObjText_SetMaxWidth(objText, GetScreenWidth());
|
||
ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER);
|
||
|
||
//ObjText_SetMaxWidth(objSelect, GetScreenWidth);
|
||
ObjText_SetHorizontalAlignment(objSelect, ALIGNMENT_CENTER);
|
||
|
||
ObjRender_SetBlendType(objSelect, BLEND_ADD_RGB);
|
||
while(!bEndTitleScene)
|
||
{
|
||
Obj_SetVisible(objSelect, false);
|
||
Obj_SetVisible(objText, false);
|
||
yield;
|
||
}
|
||
Obj_Delete(objText);
|
||
Obj_Delete(objSelect);
|
||
}
|
||
|
||
let INDEX_BYAKMIKO = 0;
|
||
let INDEX_RINNOREMI = 1;
|
||
|
||
let selectIndex = 0;//選択位置
|
||
|
||
//メニュー配置
|
||
let mx = GetScreenWidth()/3;
|
||
let my = 2*GetScreenHeight()/5;
|
||
|
||
let texts = ["Byakuren Hijiri &[r]Toyosatomimi no Miko", "Rinnosuke Morichika &[r]Remilio Scarlet"];
|
||
|
||
var countMenu = length(texts);
|
||
|
||
ascent(var iText in 0 .. countMenu)
|
||
{
|
||
TMenuItem(iText, mx, my, 35, texts[iText]);
|
||
mx *= 2;
|
||
}
|
||
|
||
//キー状態がリセットされるまで待機
|
||
while(GetVirtualKeyState(VK_OK) != KEY_FREE){yield;}
|
||
|
||
//メニュー選択処理
|
||
let frameKeyHold = 0;//キー押しっぱなしフレーム数
|
||
loop
|
||
{
|
||
if(GetVirtualKeyState(VK_CANCEL) == KEY_PUSH){
|
||
TTitleScene();
|
||
break;
|
||
}
|
||
|
||
else if(GetVirtualKeyState(VK_OK) == KEY_PUSH)
|
||
{
|
||
if(selectIndex == INDEX_BYAKMIKO)
|
||
{
|
||
pathPlayer = PlayerArray[0];
|
||
TStageScene("", "TBA", GetAreaCommonData("Config", "StartingLife", 3), GetAreaCommonData("Config", "DialogueSkip", 0), false);
|
||
}
|
||
else if(selectIndex == INDEX_RINNOREMI)
|
||
{
|
||
pathPlayer = PlayerArray[1];
|
||
TStageScene("", "TBA", GetAreaCommonData("Config", "StartingLife", 3), GetAreaCommonData("Config", "DialogueSkip", 0), false);
|
||
}
|
||
break;
|
||
}
|
||
|
||
if(selectIndex == INDEX_BYAKMIKO)
|
||
{
|
||
Obj_SetVisible(imgByakMiko, true);
|
||
Obj_SetVisible(imgRinnoRemi, false);
|
||
}
|
||
else if(selectIndex == INDEX_RINNOREMI)
|
||
{
|
||
Obj_SetVisible(imgRinnoRemi, true);
|
||
Obj_SetVisible(imgByakMiko, false);
|
||
}
|
||
|
||
//カーソル移動
|
||
if(GetVirtualKeyState(VK_LEFT) == KEY_PUSH)
|
||
{
|
||
selectIndex--;
|
||
}
|
||
else if(GetVirtualKeyState(VK_RIGHT) == KEY_PUSH)
|
||
{
|
||
selectIndex++;
|
||
}
|
||
else if(GetVirtualKeyState(VK_LEFT) == KEY_HOLD)
|
||
{
|
||
frameKeyHold++;
|
||
if(frameKeyHold == 30 || (frameKeyHold > 30 && (frameKeyHold % 10 == 0)))
|
||
{
|
||
selectIndex--;
|
||
}
|
||
}
|
||
else if(GetVirtualKeyState(VK_RIGHT) == 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(image);
|
||
|
||
Obj_Delete(imgByakMiko);
|
||
Obj_Delete(imgRinnoRemi);
|
||
|
||
}
|
||
|
||
task TStageScene(let pathReplay, let pathPlayer, let pathLives, let modeDialog, bool isRetry)
|
||
{
|
||
let dirCurrent = GetCurrentScriptDirectory();
|
||
let dirModule = GetModuleDirectory();
|
||
|
||
if(IsCommonDataAreaExists("PIV") == false){
|
||
CreateCommonDataArea("PIV");
|
||
SetAreaCommonData("PIV", "currentvalue", 10000);
|
||
}
|
||
|
||
else{
|
||
SetAreaCommonData("PIV", "currentvalue", 10000);
|
||
}
|
||
|
||
//--------------------------------
|
||
//画面遷移
|
||
RenderSceneToTransitionTexture();
|
||
TTransition();
|
||
|
||
//--------------------------------
|
||
//ステージ初期化
|
||
InitializeStageScene();
|
||
if(length(pathReplay) > 0)
|
||
{
|
||
SetStageReplayFile(pathReplay);
|
||
}
|
||
|
||
//--------------------------------
|
||
//初期ステージ設定
|
||
let indexStage = 0; //ステージインデックス
|
||
SetStageIndex(indexStage);
|
||
SetStageMainScript("script/game/Boss_Plural.dnh");
|
||
SetStagePlayerScript("script/player/Chimata/Chimata_Main.dnh");
|
||
SetCommonData("Starting Lives", pathLives);
|
||
if(!isRetry){SetCommonData("Dialogue Skip Mode", modeDialog);}
|
||
else{}
|
||
StartStageScene();
|
||
|
||
//--------------------------------
|
||
//ステージ操作
|
||
loop
|
||
{
|
||
//--------------------------------
|
||
//一時停止チェック
|
||
if(GetVirtualKeyState(VK_PAUSE) == KEY_PUSH)
|
||
{
|
||
let resPause = RunPauseScene();
|
||
alternative(resPause)
|
||
case(RESULT_RETRY)
|
||
{
|
||
//最初からやり直す
|
||
if(!IsReplay())
|
||
{
|
||
//リトライ
|
||
TerminateStageScene();
|
||
TStageScene("", "TBA", GetAreaCommonData("Config", "StartingLife", 3), GetAreaCommonData("Config", "DialogueSkip", 0), false);
|
||
return;
|
||
}
|
||
}
|
||
case(RESULT_END)
|
||
{
|
||
//一時停止中の終了
|
||
TerminateStageScene();
|
||
}
|
||
}
|
||
|
||
if(!IsReplay() && GetKeyState(KEY_BACK) == KEY_PUSH)
|
||
{
|
||
//リトライ
|
||
TerminateStageScene();
|
||
TStageScene("", "TBA", GetAreaCommonData("Config", "StartingLife", 3), GetAreaCommonData("Config", "DialogueSkip", 0), false);
|
||
return;
|
||
}
|
||
|
||
//--------------------------------
|
||
//ステージ完了待ち
|
||
let stgSceneState = GetStageSceneState();
|
||
if(stgSceneState == STAGE_STATE_FINISHED)
|
||
{
|
||
//ステージ終了結果を取得
|
||
let stageResult = GetStageSceneResult();
|
||
alternative(stageResult)
|
||
case(STAGE_RESULT_CLEARED)
|
||
{
|
||
TEndScene();
|
||
break;
|
||
}
|
||
case(STAGE_RESULT_PLAYER_DOWN)
|
||
{
|
||
//自機残機0
|
||
TEndScene();
|
||
break;
|
||
}
|
||
case(STAGE_RESULT_BREAK_OFF)
|
||
{
|
||
TTitleScene();
|
||
break;
|
||
}
|
||
}
|
||
yield;
|
||
}
|
||
|
||
TTransition();
|
||
}
|
||
|
||
|
||
//----------------------------------------------------
|
||
// 終了シーン
|
||
//----------------------------------------------------
|
||
task TEndScene()
|
||
{
|
||
if(IsReplay())
|
||
{
|
||
TTitleScene();
|
||
return;
|
||
}
|
||
|
||
//--------------------------------
|
||
//ステージ終了処理
|
||
FinalizeStageScene();
|
||
|
||
//--------------------------------
|
||
//終了シーンスクリプト起動
|
||
let dirModule = GetModuleDirectory();
|
||
let pathScript = "script/KevinSystem/kevin_system/Kevin_EndScene.txt";
|
||
let idScript = LoadScript(pathScript);
|
||
StartScript(idScript);
|
||
|
||
while(!IsCloseScript(idScript))
|
||
{
|
||
yield;
|
||
}
|
||
|
||
//--------------------------------
|
||
//終了シーン結果処理
|
||
let result = GetScriptResult(idScript);
|
||
alternative(result)
|
||
case(RESULT_SAVE_REPLAY)
|
||
{
|
||
//リプレイ保存
|
||
TReplaySaveScene();
|
||
}
|
||
case(RESULT_END)
|
||
{
|
||
//再生終了
|
||
TTitleScene();
|
||
}
|
||
case(RESULT_RETRY)
|
||
{
|
||
//リトライ
|
||
TStageScene("", "TBA", GetAreaCommonData("Config", "StartingLife", 3), GetAreaCommonData("Config", "DialogueSkip", 0),false);
|
||
}
|
||
}
|
||
|
||
//----------------------------------------------------
|
||
// 一時停止シーン
|
||
//----------------------------------------------------
|
||
function RunPauseScene()
|
||
{
|
||
RenderSceneToTransitionTexture();
|
||
PauseStageScene(true);
|
||
|
||
let dirModule = GetModuleDirectory();
|
||
let pathScript = "script/KevinSystem/kevin_system/Kevin_Pause.txt";
|
||
|
||
//--------------------------------
|
||
//一時停止シーンンスクリプト起動
|
||
let idScript = LoadScript(pathScript);
|
||
StartScript(idScript);
|
||
|
||
while(!IsCloseScript(idScript))
|
||
{
|
||
yield;
|
||
}
|
||
|
||
PauseStageScene(false);
|
||
|
||
let res = GetScriptResult(idScript);
|
||
return res;
|
||
}
|
||
|
||
|
||
//----------------------------------------------------
|
||
// リプレイ選択シーン
|
||
//----------------------------------------------------
|
||
task TReplaySelectScene()
|
||
{
|
||
LoadReplayList();
|
||
let dirCurrent = GetCurrentScriptDirectory();
|
||
let pathScript = "script/ExRumia/ExRumia_Package_ReplaySelectScene.txt";
|
||
|
||
//--------------------------------
|
||
//リプレイ選択シーンスクリプト起動
|
||
let idScript = LoadScript(pathScript);
|
||
|
||
StartScript(idScript);
|
||
|
||
while(!IsCloseScript(idScript))
|
||
{
|
||
yield;
|
||
}
|
||
|
||
//--------------------------------
|
||
//リプレイ選択シーン結果処理
|
||
LoadReplayList();
|
||
|
||
let result = GetScriptResult(idScript);
|
||
|
||
let resultStage, resultTeam;
|
||
|
||
if(result == 99999999*69420)
|
||
{
|
||
//タイトルシーンへ戻る
|
||
TTitleScene();
|
||
}
|
||
else
|
||
{
|
||
let resultPath = GetReplayInfo(result, REPLAY_FILE_PATH);
|
||
|
||
if(GetReplayUserData(result, "Difficulty") == "Normal"){SetCommonData("Difficulty", "Normal");}
|
||
else if(GetReplayUserData(result, "Difficulty") == "Hard"){SetCommonData("Difficulty", "Hard");}
|
||
else if(GetReplayUserData(result, "Difficulty") == "Lunatic"){SetCommonData("Difficulty", "Lunatic");}
|
||
|
||
//リプレイ再生開始
|
||
TStageScene(
|
||
resultPath,
|
||
"TBA",
|
||
GetReplayUserData(result, "Starting Lives"),
|
||
GetReplayUserData(result, "Dialogue Skip"),
|
||
false
|
||
);
|
||
}
|
||
|
||
}
|
||
|
||
|
||
//----------------------------------------------------
|
||
// リプレイ保存シーン
|
||
//----------------------------------------------------
|
||
task TReplaySaveScene()
|
||
{
|
||
LoadReplayList();
|
||
let dirModule = GetModuleDirectory();
|
||
let pathScript = dirModule ~ "script/KevinSystem/kevin_system/Kevin_ReplaySave.txt";
|
||
|
||
//--------------------------------
|
||
//リプレイ保存シーンスクリプト起動
|
||
let idScript = LoadScript(pathScript);
|
||
StartScript(idScript);
|
||
|
||
while(!IsCloseScript(idScript))
|
||
{
|
||
yield;
|
||
}
|
||
|
||
|
||
//--------------------------------
|
||
//タイトルシーンへ遷移
|
||
TTitleScene();
|
||
}
|
||
|
||
|
||
//----------------------------------------------------
|
||
// 画面遷移エフェクト
|
||
//----------------------------------------------------
|
||
function RenderSceneToTransitionTexture()
|
||
{
|
||
//現在のシーン内容を画面遷移用テクスチャに描画
|
||
let textureName = GetTransitionRenderTargetName();
|
||
RenderToTextureA1(textureName, 0, 100, true);
|
||
}
|
||
|
||
task TTransition
|
||
{
|
||
let textureName = GetTransitionRenderTargetName();
|
||
|
||
let objImage = ObjPrim_Create(OBJ_SPRITE_2D); //2Dスプライトオブジェクト生成
|
||
Obj_SetRenderPriorityI(objImage, 100); //描画優先度を設定
|
||
ObjPrim_SetTexture(objImage, textureName); //テクスチャを設定
|
||
ObjSprite2D_SetSourceRect(objImage, 0, 0, 1920, 1080);
|
||
ObjSprite2D_SetDestRect(objImage, 0, 0, 1920, 1080);
|
||
|
||
let alpha = 255;
|
||
while(alpha > 0)
|
||
{
|
||
ObjRender_SetAlpha(objImage, alpha);
|
||
alpha -= 16;
|
||
yield;
|
||
}
|
||
Obj_Delete(objImage);
|
||
}
|
||
|