NarumiSTG_HyperSnowDrifter/script/GayGunner_Package.dnh

655 lines
30 KiB
Plaintext
Raw Normal View History

2023-01-26 11:34:56 +00:00
<EFBFBD><EFBFBD>#qg<71>e>_U^<5E><>[Package]
#Title["be gay do crimes"]
#Text["A NEW PACKAGE!"]
// Logic control bools
#include "./Package_FuncLib.dnh"
#include "./Package_MenuLib.dnh"
bool IsGameStart = false; // Set to true during StageScene
// Font installation: Anke Calligraph, Connecting Chain Handserif, Unispace, etc.
string pathPlayer = "";
string pathStage = "";
string[] PlayerArray =
["script/player/Narumi/Player_Main.dnh",
"script/player/Kouryuu/Player_Main.dnh"];
string[] PlayerReplayName = ["Narumi", "Kouryuu"];
string[] DifficultyName = ["Novice", "Standard", "Extra"];
float BGMRate = GetAreaCommonData("Config", "BGMVol", 100) * 0.01;
int objTitleBGM = ObjSound_Create();
@Initialize
{
StartScript("script/KevinSystem/Init.dnh");
//AddArchiveFile("script/Jam10.dat");
//AddArchiveFile("script/KevinSystem.dat");
ObjSound_Load(objTitleBGM, "script/Jam10/PackageLib/AAAAA.mp3");
ObjSound_SetSoundDivision(objTitleBGM, SOUND_BGM);
//ObjSound_SetResumeEnable(objTitleBGM, true);
ObjSound_SetLoopEnable(objTitleBGM, true);
//ObjSound_SetLoopTime(objBGM, 0.00, 89.618);
ObjSound_SetVolumeRate(objTitleBGM, 0);
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);
}
ImgLoad();
_RenderTitleBackground();
TInstallFont();
TTitleScene();
let diffIndex = 0;
let playerIndex = 0;
}
let dirSystem = "script/KevinSystem/";
let dirLib = "script/Jam10/PackageLib/";
int lang = GetCommonData("Language", 0);
// 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/Jam10/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/Jam10/config.dat");
}
else{
LoadCommonDataAreaA2("Config", "script/Jam10/config.dat");
}
// High Score
if(
LoadCommonDataAreaA2("Data_" ~ PlayerReplayName[0], "script/Jam10/data_Pl0.dat") == false &&
LoadCommonDataAreaA2("Data_" ~ PlayerReplayName[1], "script/Jam10/data_Pl1.dat") == false
){
CreateCommonDataArea("Data_" ~ PlayerReplayName[0]);
CreateCommonDataArea("Data_" ~ PlayerReplayName[1]);
for each(diff in DifficultyName){
SetAreaCommonData("Data_" ~ PlayerReplayName[0], "HighScore_" ~ diff, 0);
SetAreaCommonData("Data_" ~ PlayerReplayName[1], "HighScore_" ~ diff, 0);
}
SaveCommonDataAreaA2("Data_" ~ PlayerReplayName[0], "script/Jam10/data_Pl0.dat");
SaveCommonDataAreaA2("Data_" ~ PlayerReplayName[1], "script/Jam10/data_Pl1.dat");
}
else{
LoadCommonDataAreaA2("Data_" ~ PlayerReplayName[0], "script/Jam10/data_Pl0.dat");
LoadCommonDataAreaA2("Data_" ~ PlayerReplayName[1], "script/Jam10/data_Pl1.dat");
}
@MainLoop
{
lang = GetCommonData("Language", 0);
yield;
}
@Finalize
{
}
//----------------------------------------------------
// <00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
//----------------------------------------------------
task TTitleScene
{
if(!ObjSound_IsPlaying(objTitleBGM)){
ObjSound_Play(objTitleBGM);
ObjSound_SetVolumeRate(objTitleBGM, 75*GetAreaCommonData("Config", "BGMVol", 100)*0.01);
}
else{}
IsGameStart = false;
/*ObjText_SetText(objText,
"[font sz=150 oc=(78, 102, 255)]qg<71>e7lVn<56>f[r][font sz=90 oc=(0, 26, 190)]RAMPAGE OF THE STRONGEST!"
);*/
let bEndTitleScene = false;
int text = CreateTextObject(
GetScreenWidth()/2, 4.5*GetScreenHeight()/5, 36,
"", "Unispace",
0xFFFFFF, 0xFFFFFF,
0x000000, 4,
4
);
ObjText_SetHorizontalAlignment(text, ALIGNMENT_CENTER);
ObjText_SetAutoTransCenter(text, true);
let textArray = [
"Begin the game.",
"View the instructions for the game.",
"View your magnificent replays!",
"Configure the game's settings to your liking.",
"See you soon...?"
];
//int img = _Create2DImage("script/Jam10/PackageLib/TitleImage_Title2.png", [0, 0, 1536, 1024]);
//Obj_SetRenderPriorityI(img, 5);
//ObjRender_SetScaleXYZ(img, 1);
//ObjSprite2D_SetDestCenter(img);
let INDEX_START = 0;
let INDEX_MANUAL = 1;
let INDEX_REPLAY = 2;
let INDEX_CONFIG = 3;
let INDEX_QUIT = 4;
let selectIndex = 0;//x<><78>bMOn
task MenuItem(string text, int index, float posX, posY){
float size = 32;
int[] item = TMenuItem(
1, "GravityBold8",
posX, posY, size,
0x5EFFD7, 0xFFFFFF, 0x30008D,
text
);
while(!bEndTitleScene)
{
ObjRender_SetPosition(item[1], ObjRender_GetX(item[0]), ObjRender_GetY(item[0]), 1);
if(index == selectIndex){
ObjText_SetFontBorderWidth(item[0], size/6);
ObjText_SetFontSize(item[0], size*1.15);
ObjText_SetFontBorderColor(item[0], 0xA87CFF);
}
else{
ObjText_SetFontBorderWidth(item[0], size/10);
ObjText_SetFontSize(item[0], size);
ObjText_SetFontBorderColor(item[0], 0x30008D);
}
yield;
}
Obj_Delete(item[0]);
Obj_Delete(item[1]);
}
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0M<30>n
let mx = 1*GetScreenWidth()/2;
let my = 2*GetScreenHeight()/5;
let texts = ["START GAME", "MANUAL", "VIEW REPLAY", "OPTIONS", "END GAME"];
var countMenu = length(texts);
ascent(var iText in 0 .. countMenu)
{
MenuItem(texts[iText], iText, mx, my);
my += 50;
}
//<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>[
ObjText_SetText(text, textArray[selectIndex]);
//ObjRender_SetPosition(img, mx, 1.5*GetScreenHeight()/5, 1);
if(GetVirtualKeyState(VK_OK) == KEY_PUSH)
{
if(selectIndex == INDEX_START)
{
pathPlayer = PlayerArray[0];
SetCommonData("Difficulty", "Standard");
TStageScene("", pathPlayer, 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;
}
//<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;
}
Obj_Delete(text);
bEndTitleScene = true;
}
//----------------------------------------------------
// <00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
//----------------------------------------------------
task TStageScene(let pathReplay, let pathPlayer, let pathLives, let modeDialog, bool isRetry)
{
IsGameStart = true;
if(ObjSound_IsPlaying(objTitleBGM)){
ObjSound_Stop(objTitleBGM);
}
else{}
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("script/Jam10/Game_Plural.dnh");
SetStagePlayerScript(pathPlayer);
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("", pathPlayer, GetAreaCommonData("Config", "StartingLife", 3), GetAreaCommonData("Config", "DialogueSkip", 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("", pathPlayer, GetAreaCommonData("Config", "StartingLife", 3), GetAreaCommonData("Config", "DialogueSkip", 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("", pathPlayer, GetAreaCommonData("Config", "StartingLife", 3), GetAreaCommonData("Config", "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 pathPlayerReplay = "";
let resultStage, resultTeam;
if(result == 99999999*69420)
{
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0x0;b<>0
TTitleScene();
//ObjSound_Stop(objTitleBGM);
}
else
{
let resultPath = GetReplayInfo(result, REPLAY_FILE_PATH);
if (GetReplayInfo(result, REPLAY_PLAYER_NAME) == "Narumi") {pathPlayerReplay = PlayerArray[0];}
else if (GetReplayInfo(result, REPLAY_PLAYER_NAME) == "Kouryuu") {pathPlayerReplay = PlayerArray[1];}
if(GetReplayUserData(result, "Difficulty") == "Novice"){SetCommonData("Difficulty", "Novice");}
else if(GetReplayUserData(result, "Difficulty") == "Standard"){SetCommonData("Difficulty", "Standard");}
else if(GetReplayUserData(result, "Difficulty") == "Extra"){SetCommonData("Difficulty", "Extra");}
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>Qu<><75><EFBFBD>Y
WriteLog(pathPlayerReplay);
TStageScene(
resultPath,
pathPlayerReplay,
GetReplayUserData(result, "Starting Lives"),
GetReplayUserData(result, "Dialogue Skip"),
false
);
ObjSound_Stop(objTitleBGM);
}
}
//----------------------------------------------------
// <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);
}