#TouhouDanmakufu[Plural]
#ScriptVersion[3]
#Title["Zero Two Boss Battle"]
#Text["\"Darling in the Franxx\"[r]berkolaborasi dengan[r]\"Touhou Project\"[r]Dibuat oleh HilmyNS."]
#include "script/ZT/Library.txt"

let dir = GetCurrentScriptDirectory;
let obj = ObjEnemyBossScene_Create;
let objB;
let Boll = 0;
let Coll = 0;
let Doll = 0;

let texFloor = dir ~ "img/floor.png";
let scroll = 0;
let texFogBG = dir ~ "img/fog.png";

let objImgRight = ObjPrim_Create(OBJ_SPRITE_2D);
let button = 0;


@Event {
	
}

@Initialize {
	SetSkipModeKey(KEY_INVALID);
	SetPlayerLife(3);
	SetPlayerSpell(2);
	mainTask;
}

@MainLoop {
	yield;
}

task mainTask {
	renderStage;
	scrollStage;
	TPlural;
}

task renderStage {
	SetFogEnable(true);
	SetFogParam(1020,1536,1,1,15);
	MakeFogBG(0,0,2048,255,255,255);
	
	MakeFloor(0,0,1536);
	MakeFloor(0,0,1024);
	MakeFloor(0,0,512);
	MakeFloor(0,0,0);
	
	MakeFloor(512,0,1536);
	MakeFloor(512,0,1024);
	MakeFloor(512,0,512);
	MakeFloor(512,0,0);
	
	MakeFloor(-512,0,1536);
	MakeFloor(-512,0,1024);
	MakeFloor(-512,0,512);
	MakeFloor(-512,0,0);
}

task scrollStage {
	SetCameraPerspectiveClip(16,4096);
	SetCameraAzimuthAngle(-90);
	SetCameraElevationAngle(15);
	SetCameraRadius(64);
	SetCameraFocusX(0);
	SetCameraFocusY(256);
	SetCameraFocusZ(-512+scroll);
	
	loop {
		SetCameraFocusZ(-512+scroll);
		if(scroll > 512){
			scroll = 0;
		}
		scroll+=2;
		
		yield;
	}
}

task TPlural {
	SetForbidPlayerSpell(true);
    SetForbidPlayerShot(true);
	TEvent;
	while(button == 0)
	{yield;}
    shotandspell;
	Obj_Delete(objB);
	ObjEnemyBossScene_Add(obj, 0, dir ~ "NonSpell1.txt");
	ObjEnemyBossScene_Add(obj, 0, dir ~ "Spell1.txt");
	ObjEnemyBossScene_Add(obj, 1, dir ~ "NonSpell2.txt");
	ObjEnemyBossScene_Add(obj, 1, dir ~ "Spell2.txt");
	ObjEnemyBossScene_Add(obj, 2, dir ~ "NonSpell3.txt");
	ObjEnemyBossScene_Add(obj, 2, dir ~ "Spell3.txt");
	ObjEnemyBossScene_Add(obj, 3, dir ~ "NonSpell4.txt");
	ObjEnemyBossScene_Add(obj, 3, dir ~ "Spell4.txt");
	ObjEnemyBossScene_Add(obj, 4, dir ~ "NonSpell5.txt");
	ObjEnemyBossScene_Add(obj, 4, dir ~ "Spell5.txt");
	ObjEnemyBossScene_Add(obj, 5, dir ~ "NonSpell6.txt");
	ObjEnemyBossScene_Add(obj, 5, dir ~ "Spell6.txt");
	ObjEnemyBossScene_Add(obj, 6, dir ~ "NonSpell7.txt");
	ObjEnemyBossScene_Add(obj, 6, dir ~ "Spell7.txt");
	ObjEnemyBossScene_Add(obj, 7, dir ~ "Spell8.txt");
	ObjEnemyBossScene_LoadInThread(obj);
	ObjEnemyBossScene_Regist(obj);
	    while(!Obj_IsDeleted(obj)){
        yield;
    }
	waitt(120);
	SetForbidPlayerSpell(true);
    SetForbidPlayerShot(true);
	CreateDialogueEvent2;
    CloseScript(GetOwnScriptID());
}

function waitt(m){
	loop(m){yield;};
    }

function MakeFloor(locX,locY,locZ) {
	let obj = ObjPrim_Create(OBJ_SPRITE_3D);
	ObjPrim_SetTexture(obj,texFloor);
	Obj_SetRenderPriorityI(obj,20);
	ObjSprite3D_SetSourceDestRect(obj,0,0,512,512);
	ObjRender_SetScaleXYZ(obj,1,1,0);
	ObjRender_SetZWrite(obj,true);
	ObjRender_SetAngleXYZ(obj,90,0,0);
	ObjRender_SetPosition(obj,locX,locY,locZ);
}

function MakeFogBG(locX,locY,locZ,red,green,blue) {
	let obj = ObjPrim_Create(OBJ_SPRITE_3D);
	ObjPrim_SetTexture(obj,texFogBG);
	Obj_SetRenderPriorityI(obj,20);
	ObjSprite3D_SetSourceDestRect(obj,0,0,4096,4096);
	ObjRender_SetScaleXYZ(obj,1,1,0);
	ObjRender_SetZWrite(obj,true);
	ObjRender_SetPosition(obj,locX,locY,locZ);
	ObjSprite3D_SetBillboard(obj,true);
}

task BBoll {
	waitt(120);
	Boll = 1;
}

task shotandspell {
	waitt(10);
	SetForbidPlayerSpell(false);
    SetForbidPlayerShot(false);
}

task TEvent {
		LoadSound(operation);
		PlayBGM(operation, 0, 178);
		loop(130){yield;};
        let dialogueobjects = CreateDialogueEvent();
        let textobj = dialogueobjects[1];
        let leftportrait = dialogueobjects[2];
        let rightportrait = dialogueobjects[3];
        let pathReisen1 = GetCurrentScriptDirectory() ~ "img/cutin4.png";
        let pathReimu1 = GetCurrentScriptDirectory() ~ "img/cutin2.png";
        ObjText_SetText(textobj, "Hah? Tempat macam apa ini?");
        ObjText_SetFontBorderColor(textobj, 255, 1, 1);
        SetPortraitToForeground(leftportrait);
        waits(5);
        ObjText_SetText(textobj, "Tak kusangka, youkai celah itu benar-benar[r]mengirimku ke suatu tempat yang aneh.");
        ObjText_SetFontBorderColor(textobj, 255, 1, 1);
        SetPortraitToForeground(leftportrait);
        waits(5);
		objB = ObjPrim_Create(OBJ_SPRITE_2D);
		Obj_SetRenderPriorityI(objB,22);
		ObjPrim_SetTexture(objB,GetCurrentScriptDirectory~"img/ZeroTwoPixel.png");
		ObjSprite2D_SetSourceRect(objB,0,0,20,49);
		ObjSprite2D_SetDestRect(objB,180,-71,201,-21);
			ObjText_SetText(textobj, "");
		let objBmove = 0;
		BBoll;
		while(Boll == 0) {
		ObjSprite2D_SetDestRect(objB,180,-71+objBmove,201,-21+objBmove);
		objBmove += 1;
		yield;};
		SetPortraitToBackground(leftportrait);
		ObjRender_SetAlpha(objImgRight, 0);
		ObjRender_SetX(objImgRight, GetStgFrameLeft() + GetStgFrameWidth()/2 + 140);
		ObjRender_SetY(objImgRight, 288);
		while(Doll < 255) {
		ObjRender_SetAlpha(objImgRight, 0+Doll);
		Doll += 5;
		yield;};
        ObjText_SetText(textobj, "Darling~ Aku mencarimu. Di mana kau~?");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait);
        waits(5);
        ObjText_SetText(textobj, "Permisi, apa kau tinggal di sekitar sini?");
        ObjText_SetFontBorderColor(textobj, 255, 1, 1);
        SetPortraitToForeground(leftportrait); SetPortraitToBackground(rightportrait);
        waits(5);
        ObjText_SetText(textobj, "Olaaa... Kita kedatangan tamu di sini. Apa kau[r]melihat \"darling\"-ku?");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait); SetPortraitToBackground(leftportrait);
        waits(5);
		ObjText_SetText(textobj, "Tidak sama sekali. Aku tidak melihat seseorang[r]sejak aku berada di daerah ini.");
        ObjText_SetFontBorderColor(textobj, 255, 1, 1);
        SetPortraitToForeground(leftportrait); SetPortraitToBackground(rightportrait);
        waits(5);
		ObjText_SetText(textobj, "Oh, begitu rupanya. Kurasa aku akan mencarinya[r]di tempat lain...");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait); SetPortraitToBackground(leftportrait);
        waits(5);
		ObjText_SetText(textobj, "Ngomong-ngomong, apa kau tau tempat ini?");
        ObjText_SetFontBorderColor(textobj, 255, 1, 1);
        SetPortraitToForeground(leftportrait); SetPortraitToBackground(rightportrait);
        waits(5);
		ObjText_SetText(textobj, "Tentu saja. Ini adalah tempat bagi FRANXX untuk[r]berlatih. Lumayan luas, bukan?");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait); SetPortraitToBackground(leftportrait);
        waits(5);
		ObjText_SetText(textobj, "Besar sekali! Apa FRANXX itu seekor monster[r]berukuran raksasa?");
        ObjText_SetFontBorderColor(textobj, 255, 1, 1);
        SetPortraitToForeground(leftportrait); SetPortraitToBackground(rightportrait);
        waits(5);
		ObjText_SetText(textobj, "Bukan. FRANXX merupakan senjata bagi kami para[r]\"parasit\" untuk bertarung melawan Klaxosaur.");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait); SetPortraitToBackground(leftportrait);
        waits(5);
		ObjText_SetText(textobj, "Apa Klaxosaur merupakan musuh kalian?");
        ObjText_SetFontBorderColor(textobj, 255, 1, 1);
        SetPortraitToForeground(leftportrait); SetPortraitToBackground(rightportrait);
        waits(5);
		ObjText_SetText(textobj, "Ya, kami para parasit berusaha memusnahkan[r]spesies Klaxosaur...");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait); SetPortraitToBackground(leftportrait);
        waits(5);
		ObjText_SetText(textobj, "...demi melindungi Plantation dan melestarikan[r]kesejahteraan umat manusia.");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait); SetPortraitToBackground(leftportrait);
        waits(5);
		ObjText_SetText(textobj, "Sepertinya tugasmu lebih sulit dariku.");
        ObjText_SetFontBorderColor(textobj, 255, 1, 1);
        SetPortraitToForeground(leftportrait); SetPortraitToBackground(rightportrait);
        waits(5);
		ObjText_SetText(textobj, "Ngomong-ngomong, siapa namamu? Dan dari[r]mana asalmu?");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait); SetPortraitToBackground(leftportrait);
        waits(5);
		ObjText_SetText(textobj, "Maaf lupa memperkenalkan diri. Namaku Reimu[r]Hakurei, seorang penjaga kuil dari Gensokyo.");
        ObjText_SetFontBorderColor(textobj, 255, 1, 1);
        SetPortraitToForeground(leftportrait); SetPortraitToBackground(rightportrait);
        waits(5);
		ObjText_SetText(textobj, "Aku bertugas membasmi para youkai dan[r]menyelesaikan insiden yang terjadi di Gensokyo.");
        ObjText_SetFontBorderColor(textobj, 255, 1, 1);
        SetPortraitToForeground(leftportrait); SetPortraitToBackground(rightportrait);
        waits(5);
		ObjText_SetText(textobj, "Menarik sekali! Namaku kode:002, rekan-rekan[r]memanggilku Zero Two.");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait); SetPortraitToBackground(leftportrait);
        waits(5);
		ObjText_SetText(textobj, "Aku adalah parasit elite yang satu kokpit dengan[r]kekasihku, Hiro.");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait); SetPortraitToBackground(leftportrait);
        waits(5);
		ObjText_SetText(textobj, "Darling mampu menjadi pilot Strelizia bersamaku.[r]Kami dapat terbang bersama melawan Klaxosaur.");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait); SetPortraitToBackground(leftportrait);
        waits(5);
		ObjText_SetText(textobj, "Rupanya begitu. Kau adalah manusia yang spesial!");
        ObjText_SetFontBorderColor(textobj, 255, 1, 1);
        SetPortraitToForeground(leftportrait); SetPortraitToBackground(rightportrait);
        waits(5);
		ObjText_SetText(textobj, "Aku bukanlah manusia, tapi human-Klaxosaur[r]hybrid. Aku adalah seorang monster!");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait); SetPortraitToBackground(leftportrait);
        waits(5);
		ObjText_SetText(textobj, "Terlihat normal bagiku-");
        ObjText_SetFontBorderColor(textobj, 255, 1, 1);
        SetPortraitToForeground(leftportrait); SetPortraitToBackground(rightportrait);
        waits(5);
		ObjText_SetText(textobj, "Hmm...? Kau tidak takut dengan tanduk dan[r]taringku, ya?");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait); SetPortraitToBackground(leftportrait);
        waits(5);
		ObjText_SetText(textobj, "Tidak.");
        ObjText_SetFontBorderColor(textobj, 255, 1, 1);
        SetPortraitToForeground(leftportrait); SetPortraitToBackground(rightportrait);
        waits(5);
		ObjText_SetText(textobj, "Eh~? Mereka menjulukiku sebagai sang pembunuh[r]rekan.");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait); SetPortraitToBackground(leftportrait);
        waits(5);
		ObjText_SetText(textobj, "Kalau begitu, aku akan uji kemampuanmu dalam[r]sebuah pertarungan!");
        ObjText_SetFontBorderColor(textobj, 255, 1, 1);
        SetPortraitToForeground(leftportrait); SetPortraitToBackground(rightportrait);
        waits(5);
		ObjText_SetText(textobj, "Baiklah. Aku tidak takut denganmu, gadis kuil[r]Hakurei!");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait); SetPortraitToBackground(leftportrait);
        waits(5);
		ObjText_SetText(textobj, "Sangatlah mudah bagiku untuk mengalahkan[r]monster sepertimu.");
        ObjText_SetFontBorderColor(textobj, 255, 1, 1);
        SetPortraitToForeground(leftportrait); SetPortraitToBackground(rightportrait);
        waits(5);
		ObjText_SetText(textobj, "Akan kubuat kau menarik semua perkataanmu!");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait); SetPortraitToBackground(leftportrait);
        waits(5);
		ObjText_SetText(textobj, "Kita tentukan siapa yang paling berkuasa di[r]permainan ini.");
        ObjText_SetFontBorderColor(textobj, 255, 1, 1);
        SetPortraitToForeground(leftportrait); SetPortraitToBackground(rightportrait);
        waits(5);
		ObjText_SetText(textobj, "Ya, akan kutunjukkan seluruh kekuatan dari parasit[r]yang mewarisi darah Klaxosaur!");
        ObjText_SetFontBorderColor(textobj, 255, 1, 200);
        SetPortraitToForeground(rightportrait); SetPortraitToBackground(leftportrait);
        waits(5);
        DestroyDialogueEvent(dialogueobjects);
        button = 1;
		StopSound(operation);
		LoadSound(lga);
		PlayBGM(lga, 0, 150);
    }
	
	function waits(n) {
		loop(n){yield;}
		while(GetVirtualKeyState(VK_OK) == KEY_HOLD){yield;}
		while(GetVirtualKeyState(VK_OK) != KEY_PUSH){yield;}
	}
	
	function CreateDialogueEvent {
    let TEXTBOX_BUFFER = 16;
    let TEXTBOX_WIDTH = GetStgFrameWidth - TEXTBOX_BUFFER*2;
    let TEXTBOX_HEIGHT = 48;
    let objTextBack = ObjPrim_Create(OBJ_SPRITE_2D);
    Obj_SetRenderPriorityI(objTextBack, 83);
    ObjSprite2D_SetSourceRect(objTextBack, 0, 0, 1, 1);
    ObjSprite2D_SetDestRect(objTextBack, 0, 0, TEXTBOX_WIDTH, TEXTBOX_HEIGHT);
    ObjRender_SetX(objTextBack, GetStgFrameLeft() + TEXTBOX_BUFFER);
    ObjRender_SetY(objTextBack, GetStgFrameTop() + GetStgFrameHeight() - TEXTBOX_HEIGHT - TEXTBOX_BUFFER);
    ObjRender_SetColor(objTextBack, 0, 0, 0);
    ascent(i in 0..30){
        ObjRender_SetAlpha(objTextBack, 192/30*i);
        yield;
    }
    ObjRender_SetAlpha(objTextBack, 192);
    let TEXT_MARGIN_LR = 8;
    let TEXT_MARGIN_TOP = 6;
    let TEXT_MAXWIDTH = TEXTBOX_WIDTH - TEXT_MARGIN_LR*2;
    let objText = ObjText_Create();
    ObjText_SetFontSize(objText, 15);
    ObjText_SetFontBold(objText, false);
    ObjText_SetFontType(objText, "Helvetica");
    Obj_SetRenderPriorityI(objText, 83);
    ObjText_SetFontColorTop(objText, 255, 255, 255);
    ObjText_SetFontColorBottom(objText, 255, 255, 255);
    ObjText_SetFontBorderType(objText, BORDER_FULL);
    ObjText_SetFontBorderColor(objText, 255, 255, 255);
    ObjText_SetFontBorderWidth(objText, 1);
    ObjText_SetMaxWidth(objText, TEXT_MAXWIDTH);
    ObjRender_SetX(objText, GetStgFrameLeft() + TEXTBOX_BUFFER + TEXT_MARGIN_LR);
    ObjRender_SetY(objText, GetStgFrameTop() + GetStgFrameHeight() - TEXTBOX_HEIGHT - TEXTBOX_BUFFER + TEXT_MARGIN_TOP);
    let imgpathL = GetCurrentScriptDirectory() ~ "img/cutin4.png";
    let objImgLeft = ObjPrim_Create(OBJ_SPRITE_2D);
    Obj_SetRenderPriorityI(objImgLeft, 81);
    ObjPrim_SetTexture(objImgLeft, imgpathL);
    ObjSprite2D_SetSourceRect(objImgLeft, 0, 0, 230, 354);
    ObjSprite2D_SetDestCenter(objImgLeft);
	ObjRender_SetAlpha(objImgLeft, 0);
	ObjRender_SetX(objImgLeft, GetStgFrameLeft() + GetStgFrameWidth()/2 - 140);
    ObjRender_SetY(objImgLeft, 288);
	while(Coll < 255) {
		ObjRender_SetAlpha(objImgLeft, 0+Coll);
		Coll += 7;
		yield;};
    let imgpathR = GetCurrentScriptDirectory() ~ "img/cutin2.png";
    Obj_SetRenderPriorityI(objImgRight, 81);
    ObjPrim_SetTexture(objImgRight, imgpathR);
    ObjSprite2D_SetSourceRect(objImgRight, 0, 0, 230, 354);
    ObjSprite2D_SetDestCenter(objImgRight);
	ObjRender_SetY(objImgRight, -180);
    return [objTextBack, objText, objImgLeft, objImgRight];
}

function CreateDialogueEvent2 {
	let TEXTBOX_BUFFER = 16;
    let TEXTBOX_WIDTH = GetStgFrameWidth - TEXTBOX_BUFFER*2;
    let TEXTBOX_HEIGHT = 48;
    let objTextBack = ObjPrim_Create(OBJ_SPRITE_2D);
    Obj_SetRenderPriorityI(objTextBack, 83);
    ObjSprite2D_SetSourceRect(objTextBack, 0, 0, 1, 1);
    ObjSprite2D_SetDestRect(objTextBack, 0, 0, TEXTBOX_WIDTH, TEXTBOX_HEIGHT);
    ObjRender_SetX(objTextBack, GetStgFrameLeft() + TEXTBOX_BUFFER);
    ObjRender_SetY(objTextBack, GetStgFrameTop() + GetStgFrameHeight() - TEXTBOX_HEIGHT - TEXTBOX_BUFFER);
    ObjRender_SetColor(objTextBack, 0, 0, 0);
    ascent(i in 0..30){
        ObjRender_SetAlpha(objTextBack, 192/30*i);
        yield;
    }
    ObjRender_SetAlpha(objTextBack, 192);
    let TEXT_MARGIN_LR = 8;
    let TEXT_MARGIN_TOP = 6;
    let TEXT_MAXWIDTH = TEXTBOX_WIDTH - TEXT_MARGIN_LR*2;
    let objText = ObjText_Create();
    ObjText_SetFontSize(objText, 15);
    ObjText_SetFontBold(objText, false);
    ObjText_SetFontType(objText, "Helvetica");
    Obj_SetRenderPriorityI(objText, 83);
    ObjText_SetFontColorTop(objText, 255, 255, 255);
    ObjText_SetFontColorBottom(objText, 255, 255, 255);
    ObjText_SetFontBorderType(objText, BORDER_FULL);
    ObjText_SetFontBorderColor(objText, 255, 255, 255);
    ObjText_SetFontBorderWidth(objText, 1);
    ObjText_SetMaxWidth(objText, TEXT_MAXWIDTH);
    ObjRender_SetX(objText, GetStgFrameLeft() + TEXTBOX_BUFFER + TEXT_MARGIN_LR);
    ObjRender_SetY(objText, GetStgFrameTop() + GetStgFrameHeight() - TEXTBOX_HEIGHT - TEXTBOX_BUFFER + TEXT_MARGIN_TOP);
    let imgpathL = GetCurrentScriptDirectory() ~ "img/cutin4.png";
    let objImgLeft = ObjPrim_Create(OBJ_SPRITE_2D);
    Obj_SetRenderPriorityI(objImgLeft, 81);
    ObjPrim_SetTexture(objImgLeft, imgpathL);
    ObjSprite2D_SetSourceRect(objImgLeft, 0, 0, 230, 354);
    ObjSprite2D_SetDestCenter(objImgLeft);
	ObjRender_SetX(objImgLeft, GetStgFrameLeft() + GetStgFrameWidth()/2 - 140);
    ObjRender_SetY(objImgLeft, 288);
    let imgpathR = GetCurrentScriptDirectory() ~ "img/cutin2.png";
	let objImgRight = ObjPrim_Create(OBJ_SPRITE_2D);
    Obj_SetRenderPriorityI(objImgRight, 81);
    ObjPrim_SetTexture(objImgRight, imgpathR);
    ObjSprite2D_SetSourceRect(objImgRight, 0, 0, 230, 354);
    ObjSprite2D_SetDestCenter(objImgRight);
	ObjRender_SetX(objImgRight, GetStgFrameLeft() + GetStgFrameWidth()/2 + 140);
	ObjRender_SetY(objImgRight, 288);
        ObjText_SetText(objText, "Lihat siapa yang lemah sekarang?");
        ObjText_SetFontBorderColor(objText, 255, 1, 1);
        SetPortraitToForeground(objImgLeft); SetPortraitToBackground(objImgRight);
        waits(5);
        ObjText_SetText(objText, "Tch~ Kau memang lawan yang tak tertandingi...");
        ObjText_SetFontBorderColor(objText, 255, 1, 200);
        SetPortraitToForeground(objImgRight); SetPortraitToBackground(objImgLeft);
        waits(5);
		ObjText_SetText(objText, "Itulah kekuatan luar biasa dari sang penjaga kuil.");
        ObjText_SetFontBorderColor(objText, 255, 1, 1);
        SetPortraitToForeground(objImgLeft); SetPortraitToBackground(objImgRight);
        waits(5);
		ObjText_SetText(objText, "Rasanya seluruh tubuhku ingin menyerah...");
        ObjText_SetFontBorderColor(objText, 255, 1, 200);
        SetPortraitToForeground(objImgRight); SetPortraitToBackground(objImgLeft);
        waits(5);
		ObjText_SetText(objText, "Kau tidak apa-apa, Zero Two?");
        ObjText_SetFontBorderColor(objText, 255, 1, 1);
        SetPortraitToForeground(objImgLeft); SetPortraitToBackground(objImgRight);
        waits(5);
		ObjText_SetText(objText, "Tak apa, aku baik-baik saja. Terima kasih.");
        ObjText_SetFontBorderColor(objText, 255, 1, 200);
        SetPortraitToForeground(objImgRight); SetPortraitToBackground(objImgLeft);
        waits(5);
		ObjText_SetText(objText, "Uhh, di mana kau darling~?");
        ObjText_SetFontBorderColor(objText, 255, 1, 200);
        SetPortraitToForeground(objImgRight); SetPortraitToBackground(objImgLeft);
        waits(5);
		ObjText_SetText(objText, "Aku tidak bisa melakukan apa-apa tanpamu...");
        ObjText_SetFontBorderColor(objText, 255, 1, 200);
        SetPortraitToForeground(objImgRight); SetPortraitToBackground(objImgLeft);
        waits(5);
}

function DestroyDialogueEvent(objects) {
    ascent(i in 0..length(objects)) {
        Obj_Delete(objects[i]);
    }
}
function SetPortraitToBackground(portrait) {
    ObjRender_SetAlpha(portrait, 192);
    ObjRender_SetColor(portrait, 192, 192, 192);
}
function SetPortraitToForeground(portrait) {
    ObjRender_SetAlpha(portrait, 255);
    ObjRender_SetColor(portrait, 255, 255, 255);
}