NarumiSTG_HyperSnowDrifter/script/KevinSystem/Kevin_System.txt

927 lines
25 KiB
Plaintext

// SYSTEM FOR STATION GAME
let dirCurrent = GetCurrentScriptDirectory();
// Change accordingly!
int offsetX = 1551;
int baseY = 155;
int spaceY = 135;
float scale = 1.15*1.6;
int sel = 0;
// Item, life, spell graphics
let graphicimg = dirCurrent ~ "./img/yo.png";
let lifebarimg = dirCurrent ~ "./img/lifebar.png";
LoadTextureEx(graphicimg, true, true);
let pointerPIV;
//#include "./../script/soundtask.txt"
#include "script/KevinSystem/Init.dnh"
#include "script/KevinSystem/kevin_system/Lib_Const.dnh"
#include "script/KevinSystem/GeneralSoundLib.txt"
#include "script/default_system/Default_Effect.txt"
#include "script/KevinSystem/kevin_system/Kevin_EffectLib.dnh"
@Initialize
{
if(!IsCommonDataAreaExists("PIV")){
CreateCommonDataArea("PIV");
SetAreaCommonData("PIV", "currentvalue", 10000);
}
else{}
pointerPIV = LoadAreaCommonDataValuePointer("PIV", "currentvalue", 10000);
_SoundTask();
SetAreaCommonData("ScriptID", "SystemID", GetOwnScriptID());
//SetCommonDataPtr("SystemIDPtr", GetOwnScriptID());
SetStgFrame(0, 0, 1280, 720, 20, 80);
sel = prand_int(0, 99);
// Pixel art
SetShotTextureFilter(FILTER_NONE, FILTER_NONE);
SetItemTextureFilter(FILTER_NONE, FILTER_NONE);
SetPauseScriptPath(GetCurrentScriptDirectory() ~ "kevin_system/Kevin_Pause.txt");
SetEndSceneScriptPath(GetCurrentScriptDirectory() ~ "kevin_system/Kevin_EndScene.txt");
SetReplaySaveSceneScriptPath(GetCurrentScriptDirectory() ~ "kevin_system/Kevin_ReplaySave.txt");
InitEffect();
InitFrame();
//TInstallFont(); Moved to package.
TScore();
LifeDisplay();
//TGraze();
//SetPlayerLife(9);
//SpellDisplay();
THighScore();
//TValueDisplay();
StartItemScript(dirCurrent ~ "./kevin_system/KevinSystem_Item.txt");
TExtendSystem();
//TBossLife();
TBossTimer();
TCurrentFps();
TReplayFps();
//_SoundTask;
}
@MainLoop
{
yield;
}
@Event
{
alternative(GetEventType())
case(EV_START_BOSS_SPELL)
{
let path = dirCurrent ~ "Default_System_MagicCircle.txt";
let id = LoadScript(path);
StartScript(id);
}
case(EV_GAIN_SPELL)
{
let objScene = GetEnemyBossSceneObjectID();
let spellbonus = ObjEnemyBossScene_GetInfo(objScene, INFO_SPELL_SCORE);
TScoreAward(spellbonus);
}
// Arguments: [enemy x, y], particle list to use
case(EV_EXPLODE)
{
float[] pos = GetEventArgument(0);
//int listTarget = GetEventArgument(1);
if(GetCommonDataPtr(EFFECTCUT_PTR, 0) >= 2){ObjSound_Play(sfxBoom);}
//_EffectListPreRender(PetalEffect, imgEffect, [0, 0, 256, 256]);
else{_ExplosionEffect(pos[0], pos[1], PetalEffect);}
}
}
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;
}
// Grants extends based on score
task TExtendSystem(){
// NEXT: Text (y around 650?) (x around 2250?)
/*let NextText =
CreateTextObject(
1625, 465, 30,
"NEXT:", "Connecting Chain Handserif",
0xA70053, 0xA70053,
0xFFFFFF, 2,
1
);*/
//ObjText_SetFontBold(NextText, true);
// Indicates the score threshold needed for the next extend
let ExtendThresholdText =
CreateTextObject(
1450, 160, 28,
"", "Unispace",
0xFF98A9, 0xFFFFFF,
0x000000, 4,
2
);
ObjText_SetFontBold(ExtendThresholdText, true);
ObjText_SetHorizontalAlignment(ExtendThresholdText, ALIGNMENT_LEFT);
int len = 0;
int count = 0;
// Millions
let req = [
];
alternative(GetCommonData("Difficulty", "Standard"))
case("Novice"){
req = [250, 500, 1000, 1800];
len = 3;
}
case("Standard"){
req = [400, 800, 1500, 2500];
len = 3;
}
others{
req = [1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 11000, 12000, 13000, 14000, 15000, 16000, 17000, 18000, 19000, 20000];
len = 19;
}
let next = 0;
// NARUMISTG
req = [
10, 20, 40, 80, 120
];
loop{
count = (trunc(GetScore())/10)*10;
if(next <= length(req)-1){
if(count >= req[next]*1000000){
next++;
SetPlayerLife(GetPlayerLife+1);
ExtendSFX;
ExtendEffect;
}
}
if(next <= len){ObjText_SetText(ExtendThresholdText, "[font tc=(255, 43, 78) bc=(255, 128, 149)]NEXT: [font clr]" ~ DigitToCommaArray(req[next]*1000000));}
else{ObjText_SetText(ExtendThresholdText, "MAXIMUM");}
yield;
}
}
task ExtendEffect(){
int time = 30;
int timeDisappear = 30;
float x = GetPlayerX();
float y = GetPlayerY()-90;
int extendText = CreateTextObject(
x, y, 75,
"Life[r]Extend!", "Exotc350 DmBd BT",
0xFF61AE, 0xFFFFFF,
0x5E0064, 6,
42
);
ObjText_SetLinePitch(extendText, -2);
ObjText_SetFontBold(extendText, true);
ObjText_SetHorizontalAlignment(extendText, ALIGNMENT_CENTER);
ascent(i in 0..time){
ObjRender_SetY(extendText, Interpolate_Decelerate(y, y-120, i/time));
yield;
}
wait(15);
ascent(i in 0..timeDisappear){
ObjRender_SetAlpha(extendText, Interpolate_Decelerate(255, 0, i/timeDisappear));
yield;
}
Obj_Delete(extendText);
}
//----------------------------------------------------
//枠外の背景表示
//----------------------------------------------------
task InitFrame()
{
let path1 = GetCurrentScriptDirectory() ~ "img/HUD1.png";
let path2 = GetCurrentScriptDirectory() ~ "img/HUD2.png";
let obj1 = ObjPrim_Create(OBJ_SPRITE_2D);
let obj2 = ObjPrim_Create(OBJ_SPRITE_2D);
LoadTextureEx(path1, true, true);
LoadTextureEx(path2, true, true);
ObjPrim_SetTexture(obj1, path1);
ObjPrim_SetTexture(obj2, path2);
int[] arr = [obj1, obj2];
for each(int obj in ref arr){
ObjRender_SetTextureFilterMag(obj, FILTER_NONE);
ObjRender_SetTextureFilterMin(obj, FILTER_NONE);
ObjRender_SetTextureFilterMip(obj, FILTER_NONE);
Obj_SetRenderPriority(obj, 79);
ObjSprite2D_SetSourceRect(obj, 0, 0, GetScreenWidth(), GetScreenHeight());
ObjSprite2D_SetDestRect(obj, 0, 0, GetScreenWidth(), GetScreenHeight());
}
// If player moves to vertical bounds, lower opacity
while(true){
if(GetPlayerY() > GetStgFrameHeight() * 7/8){
ObjRender_SetAlpha(obj2, 125);
}
else{ObjRender_SetAlpha(obj2, 255);}
if(GetPlayerY() < GetStgFrameHeight() * 1/8){
ObjRender_SetAlpha(obj1, 125);
}
else{ObjRender_SetAlpha(obj1, 255);}
yield;
}
}
//----------------------------------------------------
//スコア表示
//----------------------------------------------------
task THighScore(){
let DATA_PLAYER = GetPlayerReplayName();
let DATA_DIFFICULTY = GetCommonData("Difficulty", "Standard");
let objScoreNo = ObjText_Create();
ObjText_SetFontSize(objScoreNo, 32);
ObjText_SetFontBold(objScoreNo, true);
ObjText_SetFontType(objScoreNo, "GravityBold8");
ObjText_SetFontColorTop(objScoreNo, 0xFFFFFF);
ObjText_SetFontColorBottom(objScoreNo, 0xFFB061);
ObjText_SetFontBorderType(objScoreNo, BORDER_FULL);
ObjText_SetFontBorderColor(objScoreNo, 0xAB3D00);
ObjText_SetFontBorderWidth(objScoreNo, 4);
//ObjText_SetFontWeight(objScoreNo, 1000);
Obj_SetRenderPriorityI(objScoreNo, 79);
ObjText_SetSidePitch(objScoreNo, -2);
ObjRender_SetPosition(objScoreNo, 192, 12, 0);
while(true){
let score = GetAreaCommonData("Data_" ~ DATA_PLAYER, "HighScore_" ~ DATA_DIFFICULTY, 0);
score = min(score,999999999990);
let yass = DigitToCommaArray(score);
ObjText_SetText(objScoreNo, yass);
yield;
}
}
task TScore(){
// New score system using rtos
// For score with zeroes at the end: Truncate score/10, and then multiply it by 10
let objScoreNo = ObjText_Create();
ObjText_SetFontSize(objScoreNo, 32);
ObjText_SetFontBold(objScoreNo, true);
ObjText_SetFontType(objScoreNo, "GravityBold8");
ObjText_SetFontColorTop(objScoreNo, 0xFFFFFF);
ObjText_SetFontColorBottom(objScoreNo, 0x8944CE);
ObjText_SetFontBorderType(objScoreNo, BORDER_FULL);
ObjText_SetFontBorderColor(objScoreNo, 0x391339);
ObjText_SetFontBorderWidth(objScoreNo, 4);
//ObjText_SetFontWeight(objScoreNo, 1000);
Obj_SetRenderPriorityI(objScoreNo, 79);
ObjText_SetSidePitch(objScoreNo, -2);
ObjRender_SetPosition(objScoreNo, 192, 56, 0);
while(true){
if(GetPlayerY() < GetStgFrameHeight() * 1/8){
ObjRender_SetAlpha(objScoreNo, 125);
}
else{ObjRender_SetAlpha(objScoreNo, 255);}
let score = trunc(GetScore()/10) * 10;
score = min(score,999999999990);
let yass = DigitToCommaArray(score);
ObjText_SetText(objScoreNo, yass);
yield;
}
}
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;
}
//----------------------------------------------------
//Graze表示
//----------------------------------------------------
task TGraze()
{
let grazenum = ObjText_Create();
ObjText_SetFontSize(grazenum, 58);
ObjText_SetFontBold(grazenum, true);
ObjText_SetFontType(grazenum, "Anke Calligraph");
ObjText_SetFontColorTop(grazenum, 0x8898A3);
ObjText_SetFontColorBottom(grazenum, 0xD2E0FF);
ObjText_SetFontBorderType(grazenum, BORDER_FULL);
ObjText_SetFontBorderColor(grazenum, 0xFFFFFF);
ObjText_SetFontBorderWidth(grazenum, 3);
Obj_SetRenderPriorityI(grazenum, 1);
ObjRender_SetX(grazenum, offsetX-10);
ObjRender_SetY(grazenum, baseY*0.8+spaceY*5);
while(true){
let graze = GetGraze();
ObjText_SetText(grazenum, rtos("00000", graze));
yield;
}
}
task TValueDisplay(){
let objPIVNum = ObjText_Create();
ObjText_SetFontSize(objPIVNum, 45);
ObjText_SetFontBold(objPIVNum, true);
ObjText_SetFontType(objPIVNum, "Origami Mommy");
ObjText_SetFontColorTop(objPIVNum,0xFFFFFF);
ObjText_SetFontColorBottom(objPIVNum,0xFFFFFF);
ObjText_SetFontBorderType(objPIVNum, BORDER_FULL);
ObjText_SetFontBorderColor(objPIVNum, 0xDC47C8);
ObjText_SetFontBorderWidth(objPIVNum, 4);
ObjText_SetHorizontalAlignment(objPIVNum, ALIGNMENT_LEFT);
//ObjText_SetFontWeight(objPIVNum, 1000);
Obj_SetRenderPriorityI(objPIVNum, 2);
//ObjText_SetSidePitch(objPIVNum, -3);
ObjRender_SetPosition(objPIVNum, 1440, 275, 0);
// DEBUG
//Obj_SetVisible(objPIV, false);
int value = 0;
while(true){
value = min(GetCommonDataPtr(pointerPIV, 10000), 9999999990);
//PIVMultiplierValue = value/1000;
let yass = vtos("-5.2f", value/10000);
if(value < 100000){ObjText_SetText(objPIVNum, yass ~ "[font size=25 ox=-24 oy=18]x");}
else{ObjText_SetText(objPIVNum, yass ~ "[font size=25 oy=18]x");}
yield;
}
}
//----------------------------------------------------
//残機表示
//----------------------------------------------------
/*task TPlayerLife
{
let lifenum = ObjText_Create();
ObjText_SetFontSize(lifenum, 22);
ObjText_SetFontBold(lifenum, false);
ObjText_SetFontType(lifenum, "Unispace");
ObjText_SetFontColorTop(lifenum,255,255,255);
ObjText_SetFontColorBottom(lifenum,255,255,255);
Obj_SetRenderPriorityI(lifenum, 1);
ObjRender_SetX(lifenum,507);
ObjRender_SetY(lifenum,101);
while(true){
let liferemain = GetPlayerLife();
ObjText_SetText(lifenum, rtos("00", liferemain));
yield;
}
}*/
//----------------------------------------------------
//残スペル表示
//----------------------------------------------------
task TPlayerSpell
{
let spellnum = ObjText_Create();
ObjText_SetFontSize(spellnum, 22);
ObjText_SetFontBold(spellnum, false);
ObjText_SetFontType(spellnum, "Unispace");
ObjText_SetFontColorTop(spellnum,255,255,255);
ObjText_SetFontColorBottom(spellnum,255,255,255);
Obj_SetRenderPriorityI(spellnum, 1);
ObjRender_SetX(spellnum,offsetX);
ObjRender_SetY(spellnum,baseY+spaceY*3);
while(true){
let spellremain = GetPlayerSpell();
ObjText_SetText(spellnum, rtos("00", spellremain));
yield;
}
}
// New life task
task LifeDisplay(){
// oh god oh no
let liferemain;
let lifecounter = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
let lifeshow = graphicimg;
Obj_SetRenderPriorityI(lifecounter, 79);
ObjPrim_SetTexture(lifecounter, lifeshow);
//ObjSpriteList2D_SetSourceRect(lifecounter, 256, 0, 384, 128);
//ObjRender_SetScaleXYZ(lifecounter, 0.5, 0.5, 1);
//ObjSpriteList2D_SetDestCenter(lifecounter);
int maxText = CreateTextObject(
1440, 390, 45,
"ASCENSION", "Origami Mommy",
0x280644, 0x701582,
0xD1B4FF, 3.5,
2
);
ObjText_SetFontWeight(maxText, 1000);
int MaxLife = GetCommonData("Life Limit", 99999);
loop{
SetPlayerLife(min(MaxLife, GetPlayerLife()));
if(GetPlayerY() < GetStgFrameHeight() * 1/8){
ObjRender_SetAlpha(lifecounter, 125);
}
else{ObjRender_SetAlpha(lifecounter, 255);}
ObjSpriteList2D_ClearVertexCount(lifecounter);
ObjSpriteList2D_SetSourceRect(lifecounter, 608, 288, 640, 288+32);
ObjRender_SetTextureFilterMag(lifecounter, FILTER_NONE);
ObjSpriteList2D_SetDestCenter(lifecounter);
ObjRender_SetScaleXYZ(lifecounter, 2, 2, 1);
liferemain = GetPlayerLife();
ascent(i in 0..liferemain){
ObjRender_SetPosition(lifecounter, 710+i*24, 30, 0);
ObjSpriteList2D_AddVertex(lifecounter);
}
yield;
}
}
// New spell task
task SpellDisplay{
int text = CreateTextObject(
1820, 380, 32,
"MAX", "Origami Mommy",
0xFFB4F7, 0xFFFFFF,
0x6600BE, 4,
2
);
Obj_SetVisible(text, false);
ObjText_SetSidePitch(text, -4);
ObjText_SetHorizontalAlignment(text, ALIGNMENT_CENTER);
let spellremain;
let spellcounter = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
let spellshow = graphicimg;
Obj_SetRenderPriorityI(spellcounter, 1);
ObjPrim_SetTexture(spellcounter, spellshow);
loop{
if(GetPlayerSpell() > 5){SetPlayerSpell(5);}
if(GetPlayerSpell() == 5){Obj_SetVisible(text, true);}
else{Obj_SetVisible(text, false);}
ObjSpriteList2D_ClearVertexCount(spellcounter);
ObjSpriteList2D_SetSourceRect(spellcounter, 640, 128, 768, 256);
ObjSpriteList2D_SetDestCenter(spellcounter);
ObjRender_SetScaleXYZ(spellcounter, 0.3*scale, 0.3*scale, 1);
spellremain = GetPlayerSpell();
ascent(i in 0..spellremain){
ObjRender_SetPosition(spellcounter, 1604+i*32, 392, 0);
ObjSpriteList2D_AddVertex(spellcounter);
}
yield;
}
}
//----------------------------------------------------
// Edited ExRumia system
//----------------------------------------------------
task TBossLife
// Lifebar starts at x = 352, ends at x = 925
{
let path = lifebarimg;
let obj = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
let objStar = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
let objDivision = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
let objLifebar = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
//bool BossExist = false;
ObjPrim_SetTexture(obj, path);
Obj_SetRenderPriorityI(obj, 72);
ObjRender_SetAlpha(obj, 255);
ObjPrim_SetTexture(objStar, path);
Obj_SetRenderPriorityI(objStar, 70);
ObjPrim_SetTexture(objDivision, path);
Obj_SetRenderPriorityI(objDivision, 72);
ObjPrim_SetTexture(objLifebar, path);
Obj_SetRenderPriorityI(objLifebar, 70);
ObjRender_SetAlpha(objLifebar, 140);
//Obj_SetVisible(objLifebar, false);
let lastRemStep = -1;
let lifeRateRender = 0;
let objScene = ID_INVALID;
loop
{
objScene = GetEnemyBossSceneObjectID();
ObjSpriteList2D_ClearVertexCount(obj);
ObjSpriteList2D_ClearVertexCount(objLifebar);
ObjSpriteList2D_ClearVertexCount(objStar);
ObjSpriteList2D_ClearVertexCount(objDivision);
if(objScene != ID_INVALID)
{
//BossExist = true;
ObjSpriteList2D_SetSourceRect(objLifebar, 8, 6, 801, 50);
ObjSpriteList2D_SetDestCenter(objLifebar);
ObjRender_SetScaleXYZ(objLifebar, 1.12, 1.25, 1);
ascent (i in 0..1){
ObjRender_SetPosition(objLifebar, 455, 40, 1);
ObjSpriteList2D_AddVertex(objLifebar);
}
RenderActiveLife();
}
yield;
}
/*task RenderLifebar(){
ObjSprite2D_SetSourceRect(objLifebar, 5, 5, 534, 34);
ObjSprite2D_SetDestCenter(objLifebar);
ObjRender_SetPosition(objLifebar, 352, 20, 1);
while(BossExist){
Obj_SetVisible(objLifebar, true);
yield;
}
}*/
function RenderActiveLife()
{
//残りステップ
let countRemStep = ObjEnemyBossScene_GetInfo(objScene, INFO_REMAIN_STEP_COUNT);
if(lastRemStep != countRemStep)
{
//ステップが変化
lifeRateRender = 0;
}
//Overall active life
let lifeTotalMax = ObjEnemyBossScene_GetInfo(objScene, INFO_ACTIVE_STEP_TOTAL_MAX_LIFE);
let lifeTotal = ObjEnemyBossScene_GetInfo(objScene, INFO_ACTIVE_STEP_TOTAL_LIFE);
let lifeRate = min(lifeTotal / lifeTotalMax, lifeRateRender);
ObjSpriteList2D_SetSourceRect(obj, 7, 119, 800, 159);
ObjSpriteList2D_SetDestRect(obj, 11, 20, 12 + (890-2) * lifeRate, 60);
ObjRender_SetColorHSV(obj, -60, 384, 384);
ObjSpriteList2D_AddVertex(obj);
ObjRender_SetBlendType(obj, BLEND_ALPHA);
//Life "division" bar
ObjSpriteList2D_SetSourceRect(objDivision, 8, 56, 27, 111);
//ObjRender_SetColorHSV(objDivision, 32, 255, 255);
let listLifeDiv = [0] ~ ObjEnemyBossScene_GetInfo(objScene, INFO_ACTIVE_STEP_LIFE_RATE_LIST);
ascent(iDiv in 1 .. length(listLifeDiv)-1)
{
let rate = listLifeDiv[iDiv];
let x = (GetStgFrameWidth()) * 0.98 * (1-rate);
ObjSpriteList2D_SetDestRect(objDivision, x-4, 62, x+24, 118);
ObjSpriteList2D_AddVertex(objDivision);
}
//Boss star rendering
ObjRender_SetScaleXYZ(objStar, 0.6, 0.6, 1);
ObjSpriteList2D_SetSourceRect(objStar, 0, 169, 268, 430);
Obj_SetRenderPriority(objStar, 1);
ascent(iStep in 0 .. countRemStep)
{
ObjRender_SetPosition(objStar, GetStgFrameWidth()*1.6, 35+45*iStep, 1);
ObjSpriteList2D_SetDestCenter(objStar);
ObjSpriteList2D_AddVertex(objStar);
}
lifeRateRender += 0.01;
lifeRateRender = min(lifeRateRender, 1);
lastRemStep = countRemStep;
if(GetCommonData("IsFightingBoss", false) == true){
if(ObjMove_GetY(GetPlayerObjectID()) < GetStgFrameHeight()/6){
ObjRender_SetAlpha(obj, 60);
ObjRender_SetAlpha(objLifebar, 30);
}
else{
ObjRender_SetAlpha(obj, 255);
ObjRender_SetAlpha(objLifebar, 140);
}
}
else{
ObjRender_SetAlpha(obj, 0);
ObjRender_SetAlpha(objLifebar, 0);
}
}
}
//----------------------------------------------------
//タイマー表示
//----------------------------------------------------
task TBossTimer
{
let textTimer = ObjText_Create();
ObjText_SetFontSize(textTimer, 20);
ObjText_SetFontType(textTimer, "GravityRegular5");
//ObjText_SetMaxWidth(textTimer, GetStgFrameWidth()/6);
ObjText_SetHorizontalAlignment(textTimer, ALIGNMENT_LEFT);
ObjText_SetFontBold(textTimer, true);
ObjText_SetFontColorTop(textTimer, 0xFFFFFF);
ObjText_SetFontColorBottom(textTimer, 0xFFFFFF);
ObjText_SetFontBorderType(textTimer, BORDER_FULL);
ObjText_SetFontBorderColor(textTimer, 0x45A6FF);
ObjText_SetFontBorderWidth(textTimer, 5);
Obj_SetRenderPriorityI(textTimer, 73);
//ObjRender_SetX(textTimer, GetStgFrameWidth()/2);
ObjRender_SetX(textTimer, 710);
ObjRender_SetY(textTimer, 125);
Obj_SetVisible(textTimer, true);
let pathDigit = GetCurrentScriptDirectory() ~ "img/Default_SystemDigit.png";
let obj = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
ObjPrim_SetTexture(obj, lifebarimg);
ObjRender_SetBlendType(obj, BLEND_ADD_RGB);
Obj_SetRenderPriority(obj, 0.75);
//ObjRender_SetY(obj, 38);
let count = 2;
let objScene = ID_INVALID;
loop
{
objScene = GetEnemyBossSceneObjectID();
ObjSpriteList2D_ClearVertexCount(obj);
if(objScene != ID_INVALID)
{
Obj_SetVisible(textTimer, true);
RenderTimer();
}
else{Obj_SetVisible(textTimer, false);
}
yield;
}
task RenderTimer()
{
let timer = ObjEnemyBossScene_GetInfo(objScene, INFO_TIMERF)/60;
timer = min(timer, 999.99);
ObjText_SetText(textTimer, rtos("000.00", timer) ~ "[font sz=15 oy=18]s LEFT");
ObjSpriteList2D_SetSourceRect(obj, 404, 225, 537, 374);
ObjRender_SetScaleXYZ(obj, 1, 1, 1);
ObjSpriteList2D_SetDestCenter(obj);
ObjRender_SetPosition(textTimer, 590, 55, 1);
//ObjSpriteList2D_AddVertex(obj);
if(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) <= 10 && ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) > 0){
if(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMERF) % 60 == 0 || ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) < 1){_Timeout();}
ObjText_SetFontBorderColor(textTimer, 0xF0396C);
}
else{ObjText_SetFontBorderColor(textTimer, 0x45A6FF); ObjText_SetFontSize(textTimer, 35);}
if(ObjMove_GetY(GetPlayerObjectID()) < GetStgFrameHeight()/8){
ObjRender_SetAlpha(textTimer, 60);
}
else{
ObjRender_SetAlpha(textTimer, 255);
}
yield;
}
task _Timeout(){ // HOLY FUCK THE TIMER IS RUNNING OUT BITCH
ascent(i in 0..30){
ObjText_SetFontSize(textTimer, Interpolate_Decelerate(50, 25, i/30));
//ObjRender_SetScaleXYZ(obj, Interpolate_Decelerate(0.6, 0.38, i/30));
yield;
}
}
}
task TScoreAward(dascore){
let objText = ObjText_Create();
int x = rand_int(0, 99);
RegularAward;
task RegularAward{
let fontsizearray = [70, 70, 70, 65, 60, 65, 70, 70, 70, 40, 40];
let textarray = ["So Cool Bestie!", "Bimbo Eliminated!", "Wig Snatched!", "Neutralized Boss Sexiness!", "Gay Rights Confirmed!", "Himbo Kisses!", "Slay Button Hit!", "Yass!!!!", "Gatekept, Gaslit, Girlbossed!", "Spell Card Capture!"];
int y = rand_int(0, length(textarray)-2);
ObjText_SetText(objText, textarray[y]); // Selects a random capture text from the array
ObjText_SetFontSize(objText, fontsizearray[y]*1.5);
ObjText_SetFontType(objText, "Exotc350 DmBd BT");
//ObjText_SetMaxWidth(objText, GetStgFrameWidth());
ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER);
ObjText_SetFontBold(objText, true);
ObjText_SetFontColorTop(objText, 0xFFD34D);
ObjText_SetFontColorBottom(objText, 0xFFF2CA);
ObjText_SetFontBorderType(objText, BORDER_FULL);
ObjText_SetFontBorderColor(objText,0, 0, 0);
ObjText_SetFontBorderWidth(objText, 3);
Obj_SetRenderPriority(objText, 0.6);
ObjRender_SetX(objText, GetStgFrameWidth()/2);
ObjRender_SetY(objText, GetStgFrameHeight()/5);
}
let scorefinal = trunc(dascore/10) * 10;
let scorescene = GetEnemyBossSceneObjectID();
if (ObjEnemyBossScene_GetInfo(scorescene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 &&
ObjEnemyBossScene_GetInfo(scorescene, INFO_PLAYER_SPELL_COUNT) == 0){
AddScore(scorefinal);
}
let strScore = "Capture Bonus +" ~ DigitToCommaArray(scorefinal);
let objScore = ObjText_Create();
ObjText_SetText(objScore, strScore);
ObjText_SetFontSize(objScore, 85);
ObjText_SetFontType(objScore, "Anke Calligraph");
ObjText_SetMaxWidth(objScore, GetStgFrameWidth());
ObjText_SetHorizontalAlignment(objScore, ALIGNMENT_CENTER);
ObjText_SetFontBold(objScore, true);
ObjText_SetFontColorTop(objScore, 0x9C2400);
ObjText_SetFontColorBottom(objScore, 0xFF982A);
ObjText_SetFontBorderType(objScore, BORDER_FULL);
ObjText_SetFontBorderColor(objScore, 255, 255, 255);
ObjText_SetFontBorderWidth(objScore, 3);
Obj_SetRenderPriority(objScore, 0.6);
ObjRender_SetX(objScore, GetStgFrameWidth()/2 - (GetStgFrameWidth()/2-5));
ObjRender_SetY(objScore, GetStgFrameHeight()/3.2-15);
wait(120);
Obj_Delete(objText);
Obj_Delete(objScore);
}
//----------------------------------------------------
//FPS表示
//----------------------------------------------------
task TCurrentFps()
{
if(IsReplay()){return;}
let objText = ObjText_Create();
ObjText_SetFontSize(objText, 36);
ObjText_SetFontBold(objText, true);
ObjText_SetFontType(objText, "Unispace");
ObjText_SetFontColorTop(objText, 0x6747FF);
ObjText_SetFontColorBottom(objText, 0xAEC4FF);
ObjText_SetFontBorderType(objText, BORDER_FULL);
ObjText_SetFontBorderColor(objText, 38, 3, 93);
ObjText_SetFontBorderWidth(objText, 1.5);
ObjText_SetHorizontalAlignment(objText, ALIGNMENT_RIGHT);
ObjText_SetMaxWidth(objText, GetScreenWidth() - 8);
Obj_SetRenderPriority(objText, 1.0);
ObjRender_SetX(objText, 0);
ObjRender_SetY(objText, GetScreenHeight() - 48);
loop
{
let fps = GetCurrentFps();
let text = vtos("1.2f", fps) ~ "fps";
ObjText_SetText(objText, text);
yield;
}
}
task TReplayFps()
{
if(!IsReplay()){return;}
let objText = ObjText_Create();
ObjText_SetFontSize(objText, 36);
ObjText_SetFontType(objText, "Unispace");
ObjText_SetFontBold(objText, true);
ObjText_SetFontColorTop(objText, 128, 128, 255);
ObjText_SetFontColorBottom(objText, 255, 255, 255);
ObjText_SetFontBorderType(objText, BORDER_FULL);
ObjText_SetHorizontalAlignment(objText, ALIGNMENT_RIGHT);
ObjText_SetFontBorderColor(objText,38, 3, 93);
ObjText_SetFontBorderWidth(objText, 1);
Obj_SetRenderPriorityI(objText, 79);
let px = GetStgFrameWidth() - 10;
let py = GetStgFrameHeight() - 42;
ObjRender_SetX(objText, px);
ObjRender_SetY(objText, py);
loop
{
let fps = GetReplayFps();
let text = vtos("1.2f", fps);
ObjText_SetText(objText, "REPLAY MODE: " ~ text ~ "fps");
yield;
}
}
//----------------------------------------------------
//ユーティリティ
//----------------------------------------------------