script_enemy_main {
    #include_function ".\spellcard.txt"
    #include_function ".\..\lib\enemyfunctions.txt"
    #include_function "script\lib\dialoguefunctions.txt"
	let nitoriimg=GetCurrentScriptDirectory~"img\nitori.png";
	let rinimg=GetCurrentScriptDirectory~"img\rinnosuke.png";

sub SetDialogue{
	yield;
	SetCharImg("RIGHT", rinimg, 0, 0, 64, 64);
	AddDialogueText("Ahhhh... You win...", 255, 128, 128, 255);
	SetCharImg("RIGHT", "", 0, 0, 64, 64);
	AddDialogueText("SELF DESTRUCT INITIATED", 255, 255, 255, 255);
	AddDialogueText("3", 255, 255, 255, 255);
	AddDialogueText("2", 255, 255, 255, 255);
	AddDialogueText("1", 255, 255, 255, 255);
	DialogueVariableChange(1, 1);
	DialogueWait(30);
	SetCharImg("LEFT", nitoriimg, 0, 0, 64, 64);
	AddDialogueText("Wait... He EXPLODED!?!?!?", 255, 128, 255, 128);
	SetCharImg("LEFT", "", 0, 0, 64, 64);
	SetCharImg("RIGHT", rinimg, 0, 0, 64, 64);
	AddDialogueText("Ah... oohhh...", 255, 128, 128, 255);
	SetCharImg("LEFT", nitoriimg, 0, 0, 64, 64);
	SetCharImg("RIGHT", "", 0, 0, 64, 64);
	AddDialogueText("Rinnosuke! I thought you exploded?", 255, 128, 255, 128);
	SetCharImg("LEFT", "", 0, 0, 64, 64);
	SetCharImg("RIGHT", rinimg, 0, 0, 64, 64);
	AddDialogueText("I did not... That was a copy of me... I was stuck inside that forsaken machine he built after ambushing my beloved Kourindou.", 255, 128, 128, 255);
	SetCharImg("LEFT", nitoriimg, 0, 0, 64, 64);
	SetCharImg("RIGHT", "", 0, 0, 64, 64);
	AddDialogueText("Oh... Come with me... You need help...", 255, 128, 255, 128);
	SetCharImg("LEFT", "", 0, 0, 64, 64);
	SetCharImg("RIGHT", rinimg, 0, 0, 64, 64);
	AddDialogueText("No. It is ok. Better yet, allow me to help you. I assume you would want to solve this problem?", 255, 128, 128, 255);
	SetCharImg("LEFT", nitoriimg, 0, 0, 64, 64);
	SetCharImg("RIGHT", "", 0, 0, 64, 64);
	AddDialogueText("Yes, actually I would.", 255, 128, 255, 128);
	SetCharImg("LEFT", "", 0, 0, 64, 64);
	SetCharImg("RIGHT", rinimg, 0, 0, 64, 64);
	AddDialogueText("Good... I shall go along with you on your journey...", 255, 128, 128, 255);
	AddDialogueText("First we have to find out where to go...", 255, 128, 128, 255);
	SetCharImg("RIGHT", "", 0, 0, 64, 64);
	AddDialogueText("Congratulations! Rinnosuke has accompanied you on your journey!", 255, 255, 255, 255);
	AddDialogueText("Over time, more and more people will join you on your journey.", 255, 255, 255, 255);
	AddDialogueText("On each stage, you will be allowed to choose one person to bring along with you.", 255, 255, 255, 255);
	AddDialogueText("These people have special abilities and will help you throughout the stage.", 255, 255, 255, 255);
	AddDialogueText("Rinnosuke follows enemies and occasionally collects the surrounding items.", 255, 255, 255, 255);
	InitializeDialogue(0);
}

	@Initialize {
		EnemyInit(10, 0);
		LoadGraphic(nitoriimg);
		LoadGraphic(rinimg);
		SetDialogue;
		ClearScreen;
	}
	
	@MainLoop{
		if(changevariables[1]==1){PlaySE(GetCurrentScriptDirectory~"sound\BossExplose.wav"); changevariables[1]=2;}
        yield;
	}

	@DrawLoop {
	}
	
	@Finalize {
	}
}