#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["St1_StartTalk"]
#Text["..."]
#System[".\system\Default_System.txt"]


#include"./lib/AllStarShot_Const.dnh"
#include"./lib/TheFunctions.txt"
#include"./BGTask.txt"
#include"./Animation_lib_satori.txt"
#include"./lib/Dialogue Prototype2.dnh"
let Enemy = ID_INVALID;
let EnemyX = 0;
let EnemyY = 0;

@Event{
	alternative(GetEventType)
	case(EV_REQUEST_LIFE){SetScriptResult(2000);}
	case(EV_REQUEST_TIMER){SetScriptResult(-1);}
//case(EV_REQUEST_SPELL_SCORE){SetScriptResult(90000);}
}

@Initialize{
	Enemy = ObjEnemy_Create(OBJ_ENEMY_BOSS);
	ObjEnemy_Regist(Enemy);
SetDamageRateAtFrame(Enemy,60,10,120);
SetAutoDeleteObject(true);
InitializeAction(Enemy,DrossDot);
DrawBoss_Task(Enemy);
//name("Michael Derpy",0,10);
//LifeCircleBar_A(Enemy,0.8,0.2,true);
//LifeCircleBar_B(Enemy,0.2,0.0,true);
//LifeCircleBar_Marker(Enemy,0.8);
//LifeStock(2,1);
//TWaveCircle_Shadertask(Enemy,5);
//TAura(Enemy,5);
LoadSounds;
ObjRender_SetPosition(Enemy,-80, 0,0);
	//ObjMove_SetDestAtWeight(Enemy, GetStgFrameWidth/2, 100, 10,5);
	BossActions;
}

@MainLoop{

	yield;
}

task BossActions{
	ShootBullets;
//Texto;
	while(ObjEnemy_GetInfo(Enemy, INFO_LIFE) > 0){
		EnemyX = ObjMove_GetX(Enemy);
		EnemyY = ObjMove_GetY(Enemy);
		//ObjEnemy_SetIntersectionCircleToShot(Enemy, EnemyX, EnemyY, 40);
		//ObjEnemy_SetIntersectionCircleToPlayer(Enemy, EnemyX, EnemyY, 30);
                                          
		yield;
	}
DeleteShotAll(TYPE_ALL, TYPE_ITEM);
	Obj_Delete(Enemy);
	//loop(60){yield;}
	CloseScript(GetOwnScriptID);
}
function wait(t){loop(t){yield;}}

task ShootBullets{
wait(60);
talk;
wait(90);

loop{

wait(40);

}
}

sub talk{
/*
Set"x"Port"N"(Marisa15);
*/

//SetEventSpeaker(ENEMY1_SPEAKS);
	//SetEventTextA(SAY_YELLOW, "Si, Gusano sera tuyo, ahora[r]alejate de mi camino");

	let Charla ;
	let gusano = "";
	let lapros = "";
	let michael = MichaelNormal;
	SetCommonData("OnEvent",true);
	WaitToMove;
	StartEvent;
	SetPlayerNumber(1);
	SetEnemyNumber(1);
	
	//SetNewPlayerPort1(Alice2);
	if(GetAreaCommonData("GAMEDATA","Personaje",defchar) == 0){
	SetNewPlayerPort1(GusanoAngry); // Normal
	//SetEventSpeaker(PLAYER1_SPEAKS);
	
	
	
	SetNewEnemyPort1(DrossPluton); 
	SetEventSpeaker(ENEMY1_SPEAKS);
	CharacterTitle(GetStgFrameWidth/2,270,3,GetLanguage);
	PlaySFX(PlutonLarge);
	Charla = ["My Book, Moon of Pluto",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],120);
	Charla = ["Is now avilable",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],100);
	Charla = ["In all the libraries of Argentina",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],120);
	Charla = ["Chile,Uruguay,Paraguay,Bolivia,[r]Mexico,Peru,Colombia",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],420);
	Charla = ["Center America,Spain,China,Japan,[r]Nazi Germany,Guatemala",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],420);
	Charla = ["South Africa,Brazil,Bagdad City,[r]Pripiat Ghost Town,Ukraine",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],420);
    Charla = ["Antarctica,North Pole,Bangladesh,[r]North Korea,Namekusei",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],380);
	Charla = ["Gotham City,Vatican City,Roman[r]Empire,Chernobyl,Marine Abyss",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],340);
	Charla = ["Pensylvania State,Jerusalem,the[r]Poveglia Island in Italy",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],300);
	Charla = ["Pompeya and Herculano,Cambodia,[r]Egypt,Babiera Town,Russia",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],390);
	Charla = ["Turkmenistan,Italy,England,Irak,[r]the Ancient Jew cementery,France",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],390);
	Charla = ["Arabia Saudita,ancient Persia,[r]Merianas' strech,Norway",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],360);
	Charla = ["Loki's Castle,India,Underworld of[r]Various Countries,Deep Web",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],390);
	Charla = ["Taringa,4Chan,Your Mother's P****",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],240);
	Charla = ["All the Universes,All the[r]Dimensions",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],150);
	Charla = ["All the Realities of the[r]Cosmos and the Creation",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],150);
	Charla = ["And Venezuela",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],120);
	Charla = ["Please, read it, I know[r]all you audience will like it",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],300);
	Charla = ["Many thanks, and a huge hug.",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],240);
	Charla = ["Dross has talked",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],90);
	Charla = ["And I wish you a insignificant[r]life expectance",""];
	SetEventTextB(SAY_YELLOW,Charla[GetLanguage],320);
	
	}
	else{
	
	}
	EndEvent;
	SetCommonData("OnEvent",false);
	ObjEnemy_SetLife(Enemy,0);
}

function WaitToMove{
SetAction(Enemy,ACT_MOVE,70);
ObjMove_SetDestAtWeight(Enemy, GetStgFrameWidth/2, 100, 10,5);
wait(90);
}