ScarletBlackMarket/script/Gay_Package.dnh

1229 lines
58 KiB
Plaintext
Raw Normal View History

2022-08-20 05:42:00 +00:00
<EFBFBD><EFBFBD>#qg<71>e>_U^<5E><>[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
{
if(IsCommonDataAreaExists("PIV") == false){
CreateCommonDataArea("PIV");
SetAreaCommonData("PIV", "currentvalue", 10000);
}
else{
SetAreaCommonData("PIV", "currentvalue", 10000);
}
TInstallFont();
LanguageSelect();
BackgroundRendering();
2022-08-20 05:42:00 +00:00
let diffIndex = 0;
let playerIndex = 0;
}
let dirSystem = "script/KevinSystem/";
int lang = GetCommonData("Language", 0);
2022-08-20 05:42:00 +00:00
function TInstallFont{
// JP Text
2022-08-20 05:42:00 +00:00
InstallFont(dirSystem ~ "./font/FOT-NewCinemaAStd-D_1.otf");
InstallFont(dirSystem ~ "./font/Corporate-Logo-Rounded.otf");
// English Text
2022-08-20 05:42:00 +00:00
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");
2022-08-20 05:42:00 +00:00
}
// 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
2022-08-20 05:42:00 +00:00
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
// v0.91a
SetAreaCommonData("Config", "PlayerShotOpacity", 60);
SetAreaCommonData("Config", "ItemOpacity", 60);
SaveCommonDataAreaA2("Config", "script/game/config.dat");
}else{
LoadCommonDataAreaA2("Config", "script/game/config.dat");
}
// To-do: Read from common data in the stage scripts
@MainLoop
{
lang = GetCommonData("Language", 0);
2022-08-20 05:42:00 +00:00
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;
}
//----------------------------------------------------
// <00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
//----------------------------------------------------
task BackgroundRendering(){
int image = _Create2DImage("script/game/resourceLib/title.png", [0, 0, 1920, 1080]);
LoadTextureEx(image, true, true);
Obj_SetRenderPriorityI(image, 1);
ObjSprite2D_SetDestRect(image, 0, 0, 1920, 1080);
}
task LanguageSelect(){
let bEndTitleScene = false;
task TMenuItem(
let index,
float mx, my, size,
string text
)
{
let objText = CreateTextObject(
mx, my, size,
text, "<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<08><>0<EFBFBD>0<EFBFBD>0<EFBFBD>0 <09> ver2 Bold",
0xFFFFFF, 0xFFFFFF,
0xAA0E2B, size/10,
2
);
let objSelect = CreateTextObject(
mx, my, size,
text, "<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<08><>0<EFBFBD>0<EFBFBD>0<EFBFBD>0 <09> ver2 Bold",
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, index == selectIndex);
yield;
}
Obj_Delete(objText);
Obj_Delete(objSelect);
}
let INDEX_ENG = 0;
let INDEX_JP = 1;
let selectIndex = 0;//x<><78>bMOn
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0M<30>n
let mx = GetScreenWidth()/2;
let my = 1*GetScreenHeight()/5;
let texts = ["English", "<00>e,g<><67>"];
var countMenu = length(texts);
ascent(var iText in 0 .. countMenu)
{
TMenuItem(iText, mx, my, 90, texts[iText]);
my += 120;
}
//<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_ENG)
{
SetCommonData("Language", 0); // English
TTitleScene();
}
else if(selectIndex == INDEX_JP)
{
SetCommonData("Language", 1); // Japanese
TTitleScene();
}
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;
}
2022-08-20 05:42:00 +00:00
task TTitleScene
{
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0B}<7D>N<EFBFBD>0<EFBFBD>0<EFBFBD>0
if(IsCommonDataAreaExists("PIV") == false){
CreateCommonDataArea("PIV");
SetAreaCommonData("PIV", "currentvalue", 10000);
}
else{
SetAreaCommonData("PIV", "currentvalue", 10000);
}
let bEndTitleScene = false;
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
task TMenuItem(
let index,
float mx, my, size,
string text
)
{
let objText = CreateTextObject(
mx, my, size,
text, "<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<08><>0<EFBFBD>0<EFBFBD>0<EFBFBD>0 <09> ver2 Bold",
2022-08-20 05:42:00 +00:00
0xFFFFFF, 0xFFFFFF,
0xAA0E2B, size/10,
2022-08-20 05:42:00 +00:00
2
);
let objSelect = CreateTextObject(
mx, my, size,
text, "<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<08><>0<EFBFBD>0<EFBFBD>0<EFBFBD>0 <09> ver2 Bold",
2022-08-20 05:42:00 +00:00
0xFFFFFF, 0xFFFFFF,
0xAA0E2B, size/10,
2022-08-20 05:42:00 +00:00
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_START = 0;
let INDEX_REPLAY = 1;
let INDEX_CONFIG = 2;
let INDEX_QUIT = 3;
let selectIndex = 0;//x<><78>bMOn
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0M<30>n
let mx = GetScreenWidth()/2;
let my = 3*GetScreenHeight()/5;
let texts = ["START GAME", "VIEW REPLAY", "OPTIONS", "END GAME"];
2022-08-20 05:42:00 +00:00
var countMenu = length(texts);
ascent(var iText in 0 .. countMenu)
{
TMenuItem(iText, mx, my, 48, texts[iText]);
my += 60;
}
//<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)
{
TDifficultySelect();
}
else if(selectIndex == INDEX_REPLAY)
{
TReplaySelectScene();
}
else if(selectIndex == INDEX_CONFIG)
{
TConfigScene();
}
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;
2022-08-20 05:42:00 +00:00
}
// Configurations
task TConfigScene{
// Credit: Kobito
int image = _Create2DImage("script/game/PackageLib/PlaceholderTitleImage_Empty.png", [0, 0, 1920, 1080]);
LoadTextureEx(image, true, true);
Obj_SetRenderPriorityI(image, 1);
ObjRender_SetAlpha(image, 125);
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];
let setting = [0, 0, 0, 0, 0, 0, 0];
let settingMax = [100, 100, 999, 100, 1, 100, 100];
let holdInterval = [2, 2, 1, 2, 30, 2, 2];
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", "DialogueSkip", 0);
setting[5] = GetAreaCommonData("Config", "PlayerShotOpacity", 60);
setting[6] = GetAreaCommonData("Config", "ItemOpacity", 60);
let selectIndex = 0;
var countMenu = 8;
let texts = [0, 0, 0, 0, 0, 0, 0, 0];
function <int> TMenuItem(
let index,
float mx, my, size,
string text
)
{
let objText = CreateTextObject(
mx, my, size,
text, "<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<08><>0<EFBFBD>0<EFBFBD>0<EFBFBD>0 <09> ver2 Bold",
2022-08-20 05:42:00 +00:00
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 = 2*GetScreenHeight()/12;
ascent(i in 0..8){texts[i] = TMenuItem(i, mx, my+i*GetScreenHeight()/12, 45, "");}
ObjText_SetText(texts[7], "Reset to Default");
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:", "Dialogue/Cutscenes:", "Player Shot Opacity:", "Item Opacity: "],
["BGM Vol: ", "SFX Vol: ", "<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0: ", "̀ofn0<0F>f:", "<00>[q<>:", "<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0n0<0F>f: ", "<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0n0<0F>f:"]
];
2022-08-20 05:42:00 +00:00
function UpdateTexts{
ObjText_SetText(texts[0], configText[lang][0]~" " ~ IntToString(setting[0]));
ObjText_SetText(texts[1], configText[lang][1]~" " ~ IntToString(setting[1]));
2022-08-20 05:42:00 +00:00
alternative(setting[2])
case(3){ObjText_SetText(texts[2], configText[lang][2]~" " ~ IntToString(setting[2]) ~ " (Default)");}
case(69){ObjText_SetText(texts[2], configText[lang][2]~" " ~ IntToString(setting[2]) ~ " (Nice)");}
case(420){ObjText_SetText(texts[2], configText[lang][2]~" " ~ IntToString(setting[2]) ~ " (Don't Do Drugs)");}
others{ObjText_SetText(texts[2], configText[lang][2]~" " ~ IntToString(setting[2]));}
2022-08-20 05:42:00 +00:00
ObjText_SetText(texts[3], configText[lang][3]~" " ~ IntToString(setting[3]) ~ "%");
2022-08-20 05:42:00 +00:00
alternative(setting[4])
case(0){ObjText_SetText(texts[4], configText[lang][4]~" ON");}
case(1){ObjText_SetText(texts[4], configText[lang][4]~" OFF");}
2022-08-20 05:42:00 +00:00
alternative(setting[5])
case(0){ObjText_SetText(texts[5], configText[lang][5]~" " ~ IntToString(setting[5]) ~ " (j0<6A>0g0????)");}
case(60){ObjText_SetText(texts[5],configText[lang][5]~" " ~ IntToString(setting[5]) ~ " (Recommended)");}
case(100){ObjText_SetText(texts[5],configText[lang][5]~" " ~ IntToString(setting[5]) ~ " (Eye-Blinding)");}
others{ObjText_SetText(texts[5], configText[lang][5]~" " ~ IntToString(setting[5]));}
2022-08-20 05:42:00 +00:00
alternative(setting[6])
case(0){ObjText_SetText(texts[6], configText[lang][6]~" " ~ IntToString(setting[6]) ~ " (Why????)");}
case(60){ObjText_SetText(texts[6], configText[lang][6]~" " ~ IntToString(setting[6]) ~ " (Recommended)");}
case(100){ObjText_SetText(texts[6], configText[lang][6]~" " ~ IntToString(setting[6]) ~ " (Eye-Blinding)");}
others{ObjText_SetText(texts[6], configText[lang][6]~" " ~ IntToString(setting[6]));}
2022-08-20 05:42:00 +00:00
}
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)){
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)){
ChangeSetting(selectIndex, -1);
}
}
if(selectIndex == 7 && GetVirtualKeyState(VK_OK) == KEY_PUSH){
ascent(i in -1..6){
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", "DialogueSkip", setting[4]);
SetAreaCommonData("Config", "PlayerShotOpacity", setting[5]);
SetAreaCommonData("Config", "ItemOpacity", setting[6]);
//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);
}
//----------------------------------------------------
// <00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
//----------------------------------------------------
task TDifficultySelect(){
bool bEndTitleScene = false;
//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, "<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<08><>0<EFBFBD>0<EFBFBD>0<EFBFBD>0 <09> ver2 Bold",
2022-08-20 05:42:00 +00:00
0xFFFFFF, 0xFFFFFF,
0xAA0E2B, size/10,
2022-08-20 05:42:00 +00:00
2
);
let objSelect = CreateTextObject(
mx, my, size,
text, "<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<08><>0<EFBFBD>0<EFBFBD>0<EFBFBD>0 <09> ver2 Bold",
2022-08-20 05:42:00 +00:00
0xFFFFFF, 0xFFFFFF,
0xAA0E2B, size/10,
2022-08-20 05:42:00 +00:00
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_NORMAL = 0;
let INDEX_HARD = 1;
let INDEX_LUNATIC = 2;
2022-08-20 05:42:00 +00:00
let selectIndex = 0;//x<><78>bMOn
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0M<30>n
let mx = GetScreenWidth()/3;
let my = 2*GetScreenHeight()/5;
let texts = ["Arcade Mode", "Gentle Mode"];
var countMenu = length(texts);
ascent(var iText in 0 .. countMenu)
{
TMenuItem(iText, mx, my, 65, texts[iText]);
mx *= 2;
}
//<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
{
if(GetVirtualKeyState(VK_CANCEL) == KEY_PUSH){
TTitleScene();
break;
}
else if(GetVirtualKeyState(VK_OK) == KEY_PUSH)
{
if(selectIndex == INDEX_NORMAL)
2022-08-20 05:42:00 +00:00
{
SetCommonData("Difficulty", "Normal");
2022-08-20 05:42:00 +00:00
TPlayerSelect();
}
else if(selectIndex == INDEX_HARD)
2022-08-20 05:42:00 +00:00
{
SetCommonData("Difficulty", "Hard");
2022-08-20 05:42:00 +00:00
TPlayerSelect();
}
else if(selectIndex == INDEX_LUNATIC)
2022-08-20 05:42:00 +00:00
{
SetCommonData("Difficulty", "Lunatic");
TPlayerSelect();
2022-08-20 05:42:00 +00:00
}
break;
}
2022-08-20 05:42:00 +00:00
//<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(image);
2022-08-20 05:42:00 +00:00
}
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, 1);
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,
2022-08-20 05:42:00 +00:00
2
);
let objSelect = CreateTextObject(
mx, my, size,
text, "Unispace",
0xFFFFFF, 0xFFFFFF,
0xAA0E2B, size/10,
2022-08-20 05:42:00 +00:00
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;//x<><78>bMOn
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0M<30>n
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;
}
//<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
{
if(GetVirtualKeyState(VK_CANCEL) == KEY_PUSH){
TTitleScene();
break;
}
else if(GetVirtualKeyState(VK_OK) == KEY_PUSH)
{
if(selectIndex == INDEX_BYAKMIKO)
{
pathPlayer = PlayerArray[0];
TStageScene("", pathStage, pathPlayer, GetAreaCommonData("Config", "StartingLife", 5), GetAreaCommonData("Config", "DialogueSkip", 0), false);
}
else if(selectIndex == INDEX_RINNOREMI)
{
pathPlayer = PlayerArray[1];
TStageScene("", pathStage, pathPlayer, GetAreaCommonData("Config", "StartingLife", 5), 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);
}
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>y<EFBFBD>R
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 pathDifficulty, 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);
}
//--------------------------------
//;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 = 0; //<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
SetStageIndex(indexStage);
SetStageMainScript(pathDifficulty);
SetStagePlayerScript("script/player/Chimata/Chimata_Main.dnh");
2022-08-20 05:42:00 +00:00
SetCommonData("Starting Lives", pathLives);
if(!isRetry){SetCommonData("Dialogue Skip Mode", modeDialog);}
else{}
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("", pathStage, pathPlayer, GetAreaCommonData("Config", "StartingLife", 3), GetAreaCommonData("Config", "Dialogue Skip Mode", 0), true);
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("", pathStage, pathPlayer, GetAreaCommonData("Config", "StartingLife", 3), GetAreaCommonData("Config", "Dialogue Skip Mode", 0), true);
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)
{
TEndScene();
break;
}
case(STAGE_RESULT_PLAYER_DOWN)
{
//<00><>_j<5F>k_j0
TEndScene();
break;
}
case(STAGE_RESULT_BREAK_OFF)
{
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 = "script/KevinSystem/kevin_system/Kevin_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("", pathStage, pathPlayer, GetAreaCommonData("Config", "StartingLife", 5), GetAreaCommonData("DialogueSkip", 0), true);
}
}
//----------------------------------------------------
// NBf\Pbk<62>0<EFBFBD>0<EFBFBD>0
//----------------------------------------------------
function RunPauseScene()
{
RenderSceneToTransitionTexture();
PauseStageScene(true);
let dirModule = GetModuleDirectory();
let pathScript = "script/KevinSystem/kevin_system/Kevin_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()
{
LoadReplayList();
let dirCurrent = GetCurrentScriptDirectory();
let pathScript = "script/ExRumia/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
LoadReplayList();
let result = GetScriptResult(idScript);
let resultStage, resultTeam;
if(result == 99999999*69420)
{
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0x0;b<>0
TTitleScene();
}
else
{
let resultPath = GetReplayInfo(result, REPLAY_FILE_PATH);
if(GetReplayUserData(result, "Difficulty") == "Arcade"){resultStage = StageArray[0]; SetCommonData("Difficulty", "Arcade");}
else{resultStage = StageArray[1]; SetCommonData("Difficulty", "Gentle");}
if(GetReplayInfo(result, REPLAY_PLAYER_NAME) == "ByakMiko"){resultTeam = PlayerArray[0];}
else{resultTeam = PlayerArray[1];}
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>Qu<><75><EFBFBD>Y
TStageScene(resultPath,
resultStage,
resultTeam,
GetReplayUserData(result, "Starting Lives"),
GetReplayUserData(result, "Dialogue Skip"),
false
);
}
}
//----------------------------------------------------
// <00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>OX[<5B>0<EFBFBD>0<EFBFBD>0
//----------------------------------------------------
task TReplaySaveScene()
{
LoadReplayList();
let dirModule = GetModuleDirectory();
let pathScript = dirModule ~ "script/KevinSystem/kevin_system/Kevin_ReplaySave.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, 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);
}