script_enemy_main{

let speakingside=0;
let movecharacter=0;
let characterscroll=0;
let oldside=0;

let i=0;
let j=0;
let letter=0;
let letters=[];
let letterscale=[];
let letterfade=[];
let letterred=[];
let lettergreen=[];
let letterblue=[];

let line="";
let writingtime=0;
let nextline=0;
let newword=0;
let wordsize=0;
let lineypos=0;

let wait=0;
let busywriting=0;
let shortbreak=0;
let skipped=0;
let currentline=GetArgument;
let linenumber=1;
let textcolor=[0,0,0];
let newcolor=[textcolor[0],textcolor[1],textcolor[2],0,0,0];
let nameappear=0;

let lastline=currentline;
let waittime=180;
let enableZ=true;
let enableskip=true;

let GRtextbar=("\script\Images\OtherEffects\Textbar.png");
let GRtext=("\script\Images\OtherEffects\TextDialogue.png");
let GRnames=("\script\Images\OtherEffects\Names.png");

let SEtext=("\script\SoundEffects\text1.wav");

let CHAmayaNormal06=("\script\Images\CharacterBig\AmayaNormal06.png");
let CHAyanoNormal03=("\script\Images\CharacterBig\AyanoNormal03.png");
let CHHarunaNormal07=("\script\Images\CharacterBig\HarunaNormal07.png");
let CHHotaruYukata02=("\script\Images\CharacterBig\HotaruYukata02.png");
let CHKurumiYukata04=("\script\Images\CharacterBig\KurumiYukata04.png");
let CHMaiNormal05=("\script\Images\CharacterBig\MaiNormal05.png");
let CHMasahiroNormal07=("\script\Images\CharacterBig\MasahiroNormal07.png");
let CHMidoriNormal02=("\script\Images\CharacterBig\MidoriNormal02.png");
let CHNanamiNormal05=("\script\Images\CharacterBig\NanamiNormal05.png");
let CHRyoYukata10=("\script\Images\CharacterBig\RyoYukata10.png");
let CHSayuriNormal04=("\script\Images\CharacterBig\SayuriNormal04.png");
let CHSetsukoNormal02=("\script\Images\CharacterBig\SetsukoNormal02.png");
let CHShinichiNormal01=("\script\Images\CharacterBig\ShinichiNormal01.png");
let CHTakeoNormal04=("\script\Images\CharacterBig\TakeoNormal04.png");
let CHTomokoNormal10=("\script\Images\CharacterBig\TomokoNormal10.png");
let CHTomomiNormal05=("\script\Images\CharacterBig\TomomiNormal05.png");
let CHYoukoNormal02=("\script\Images\CharacterBig\YoukoNormal02.png");
let CHWitches=("\script\Images\CharacterBig\Witches.png");
let CHEmpty=("\script\Images\CharacterBig\Empty.png");

let OBJtextbar=0; let OBJtext=0; let OBJleft=0; let OBJright=0;
let textbarscale=0;

let miny=GetClipMinY; let maxy=GetClipMaxY; let minx=GetClipMinX; let maxx=GetClipMaxX;
let cx=320; let cy=240;
let frame=0; let time=0;

@Initialize{
	SetLife(1000);
	SetX(cx);
	SetY(-1000);

	LoadGraphic("\script\Images\CharacterBig\KurumiYukata04.png");
	LoadGraphic("\script\Images\CharacterBig\HotaruYukata02.png");
	LoadGraphic("\script\Images\CharacterBig\TomokoNormal10.png");
	LoadGraphic("\script\Images\CharacterBig\SetsukoNormal02.png");
	LoadGraphic("\script\Images\CharacterBig\AyanoNormal03.png");
	LoadGraphic("\script\Images\CharacterBig\MidoriNormal02.png");
	LoadGraphic("\script\Images\CharacterBig\TomomiNormal05.png");
	LoadGraphic("\script\Images\CharacterBig\YoukoNormal02.png");
	LoadGraphic("\script\Images\CharacterBig\AmayaNormal06.png");
	LoadGraphic("\script\Images\CharacterBig\SayuriNormal04.png");
	LoadGraphic("\script\Images\CharacterBig\MaiNormal05.png");
	LoadGraphic("\script\Images\CharacterBig\HarunaNormal07.png");
	LoadGraphic("\script\Images\CharacterBig\TakeoNormal04.png");
	LoadGraphic("\script\Images\CharacterBig\MasahiroNormal07.png");
	LoadGraphic("\script\Images\CharacterBig\RyoYukata10.png");
	LoadGraphic("\script\Images\CharacterBig\ShinichiNormal01.png");
	LoadGraphic("\script\Images\CharacterBig\NanamiNormal05.png");
	LoadGraphic("\script\Images\CharacterBig\Witches.png");
	LoadGraphic("\script\Images\CharacterBig\Empty.png");

	LoadGraphic("\script\Images\OtherEffects\Textbar.png");
	LoadGraphic("\script\Images\OtherEffects\TextDialogue.png");
	
	SetCommonData("PauseSpellcardPractise",1);
}
	
@MainLoop{

CollectItems;

if(time==0){
	OBJleft=(Obj_Create(OBJ_EFFECT));
	ObjEffect_SetLayer(OBJleft,8); Obj_SetPosition(OBJleft,cx-200,cy+60); ObjEffect_SetTexture(OBJleft,CHEmpty);
	ObjEffect_SetPrimitiveType(OBJleft,PRIMITIVE_TRIANGLESTRIP); ObjEffect_CreateVertex(OBJleft,4); ObjEffect_SetAngle(OBJleft,0,180,0);
	ObjEffect_SetVertexXY(OBJleft,0,-175,-175); ObjEffect_SetVertexUV(OBJleft,0,0,0);
	ObjEffect_SetVertexXY(OBJleft,1,175,-175); ObjEffect_SetVertexUV(OBJleft,1,350,0);
	ObjEffect_SetVertexXY(OBJleft,2,-175,175); ObjEffect_SetVertexUV(OBJleft,2,0,350);
	ObjEffect_SetVertexXY(OBJleft,3,175,175); ObjEffect_SetVertexUV(OBJleft,3,350,350);
	ObjEffect_SetVertexColor(OBJleft,0,255,255,255,255); ObjEffect_SetVertexColor(OBJleft,1,255,255,255,255);
	ObjEffect_SetVertexColor(OBJleft,2,255,255,255,255); ObjEffect_SetVertexColor(OBJleft,3,255,255,255,255);

	OBJright=(Obj_Create(OBJ_EFFECT));
	ObjEffect_SetLayer(OBJright,8); Obj_SetPosition(OBJright,cx+200,cy+60); ObjEffect_SetTexture(OBJright,CHEmpty );
	ObjEffect_SetPrimitiveType(OBJright,PRIMITIVE_TRIANGLESTRIP); ObjEffect_CreateVertex(OBJright,4); ObjEffect_SetAngle(OBJright,0,0,0);
	ObjEffect_SetVertexXY(OBJright,0,-175,-175); ObjEffect_SetVertexUV(OBJright,0,0,0);
	ObjEffect_SetVertexXY(OBJright,1,175,-175); ObjEffect_SetVertexUV(OBJright,1,350,0);
	ObjEffect_SetVertexXY(OBJright,2,-175,175); ObjEffect_SetVertexUV(OBJright,2,0,350);
	ObjEffect_SetVertexXY(OBJright,3,175,175); ObjEffect_SetVertexUV(OBJright,3,350,350);
	ObjEffect_SetVertexColor(OBJright,0,255,255,255,255); ObjEffect_SetVertexColor(OBJright,1,255,255,255,255);
	ObjEffect_SetVertexColor(OBJright,2,255,255,255,255); ObjEffect_SetVertexColor(OBJright,3,255,255,255,255);
	
	OBJtextbar=(Obj_Create(OBJ_EFFECT));
	ObjEffect_SetLayer(OBJtextbar,8); Obj_SetPosition(OBJtextbar,cx,maxy-70); ObjEffect_SetTexture(OBJtextbar,GRtextbar);
	ObjEffect_SetRenderState(OBJtextbar,ALPHA); ObjEffect_SetScale(OBJtextbar,1,1);
	ObjEffect_SetScale(OBJtextbar,1,0);
	ObjEffect_SetPrimitiveType(OBJtextbar,PRIMITIVE_TRIANGLESTRIP); ObjEffect_CreateVertex(OBJtextbar,4);
	ObjEffect_SetVertexXY(OBJtextbar,0,-190,-50); ObjEffect_SetVertexUV(OBJtextbar,0,0,0);
	ObjEffect_SetVertexXY(OBJtextbar,1,190,-50); ObjEffect_SetVertexUV(OBJtextbar,1,380,0);
	ObjEffect_SetVertexXY(OBJtextbar,2,-190,50); ObjEffect_SetVertexUV(OBJtextbar,2,0,100);
	ObjEffect_SetVertexXY(OBJtextbar,3,190,50); ObjEffect_SetVertexUV(OBJtextbar,3,380,100);
	ObjEffect_SetVertexColor(OBJtextbar,0,200,255,255,255); ObjEffect_SetVertexColor(OBJtextbar,1,200,255,255,255);
	ObjEffect_SetVertexColor(OBJtextbar,2,200,255,255,255); ObjEffect_SetVertexColor(OBJtextbar,3,200,255,255,255);
}
if(time>=0){

if(textbarscale<1){ textbarscale+=0.1; }
if(textbarscale<0){ Obj_Delete(OBJtextbar); }
ObjEffect_SetScale(OBJtextbar,1,textbarscale);


WriteLine(1,"Kurumi","Capture 25 spellcards and clear the game if you want to be submissed by my [Superficial Charm].",CHKurumiYukata04);
WriteLine(2,"Hotaru","If you want to try out [Flashover],% all you have to do is clear the game using the fire element only.",CHHotaruYukata02);
WriteLine(3,"Tomoko","[Monolith] is a lot tougher than my last spellcard,% so I`ll only let you try it if you clear the game on Normal or harder.",CHTomokoNormal10);
WriteLine(4,"Setsuko","You have to be out of your mind to unlock this,% because you can only play [Last Word] if you survive [Speaking Is Silver, Silence Is Golden].",CHSetsukoNormal02);
WriteLine(5,"Ayano","I don`t think I`m ready to practise [Vermilion Bird Of The South] with you yet.+But it should be fine when you get at least 100 spellcard points.",CHAyanoNormal03);
WriteLine(6,"Midori","Why does [Philophobia] require you to get the bad end by continuing the game?",CHMidoriNormal02);
WriteLine(7,"Tomomi","Do your best and try not to lose more than 5 lives in one go,% so we can play [Three-Card Monte] together.",CHTomomiNormal05);
WriteLine(8,"Youko","Sorry,% but can you get about 200 spellcard points first?+I`m still increasing the difficulty of [Yasakani No Magatama]%.%.%.",CHYoukoNormal02);
WriteLine(9,"Amaya","Youko told me I shouldn`t allow you to try out [Yata No Kagami] before you captured [Lunacy],% sorry about that.",CHAmayaNormal06);
WriteLine(10,"Sayuri","You still lack 100 years of experience before you can try and beat [Sucker Effect],% sucker!+Now go capture [Devil`s Torture Chamber].",CHSayuriNormal04);
WriteLine(11,"Mai","If you`ve heard every song in the game,% we`ll make another one in [Musical Score].",CHMaiNormal05);
WriteLine(12,"Haruna","Don`t focus too much on yourself,% clear the game focussing 50 percent of the time at max,% if you want to face [Clairvoyance].",CHHarunaNormal07);
WriteLine(13,"Takeo","Unlocking [Kusanagi No Tsurugi] requires you to clear the game by using only the Water element.",CHTakeoNormal04);
WriteLine(14,"Masahiro","I should clear Nightmare if I want to fight my own Trump Card [Panacea].+Which makes no sense at all%.%.%.",CHMasahiroNormal07);
WriteLine(15,"Ryo","Girls can try out [Shadow Clone] whenever they want.% But you can be glad I`ll let you try it when you graze at least 2500 bullets in one run.",CHRyoYukata10);
WriteLine(16,"Shinichi","Don`t bomb more than 5 times before clearing the game,% because I got plenty for you in [Lock On And Terminate The Target].",CHShinichiNormal01);
WriteLine(17,"Nanami","Just clear the Extra stage if you want to have a taste of Nanami`s [La Tomatina] Trump Card.",CHNanamiNormal05);
WriteLine(18,"Witches","If you want to face our [Eternal Recurrence],% you have to beat the game with all five elements first.% Switching midgame is allowed,% continuing is not.",CHWitches);


#include_function "script/Functions/Main Menu/UnlockRequirementsTextWriter.txt";

} //>0


if(nextline==1 || GetKeyState(VK_UP)==KEY_PUSH || GetKeyState(VK_DOWN)==KEY_PUSH || GetKeyState(VK_LEFT)==KEY_PUSH || GetKeyState(VK_RIGHT)==KEY_PUSH || GetKeyState(VK_BOMB)==KEY_PUSH){
	SetShotColor(255,255,255);

	Obj_Delete(OBJleft);
	Obj_Delete(OBJright);
	Obj_Delete(OBJtextbar);

	SetCommonData("PauseSpellcardPractise",0);
	VanishEnemy;
}


time++;
frame++;
}

}