
#Title[enm4 before talk()]
#Text[P X@퓬Ob()]
#Player[FREE]
#BackGround[Default]
#ScriptVersion[2]

script_event Event01{
	let i		= 0;
	let csd		= GetCurrentScriptDirectory;
	let plaimg	= [csd~".\enm4img\Mar00.png",//normal
				csd~".\enm4img\Mar01.png",//sly
				csd~".\enm4img\Mar02.png",//grin
				csd~".\enm4img\Mar03.png",//scared
				csd~".\enm4img\Mar04.png",//grr
				csd~".\enm4img\Mar05.png",//tired
				csd~".\enm4img\Mar06.png",//smile
				csd~".\enm4img\Mar07.png",//angry
				csd~".\enm4img\Mar08.png"];//proud
	let enmimg	= [csd~".\enm4img\mmm10000.png",
					csd~".\enm4img\mmm10001.png",
					csd~".\enm4img\mmm10002.png",
					csd~".\enm4img\mmm10003.png",
					csd~".\enm4img\mmm10004.png",
					csd~".\enm4img\mmm10005.png"];
	
	@Initialize {
		loop(9){
			LoadGraphic(plaimg[i]);
			i++;
		}
		i=0;
		loop(6){
			LoadGraphic(enmimg[i]);
			i++;
		}
		i=0;
		CreateCommonDataArea("in");
		SetCommonDataEx("in","move",false);
		SetCommonDataEx("in","music",false);
		SetCommonDataEx("in","snd",false);
	}
	
	@MainLoop {
		SetChar(LEFT,plaimg[0]);//LN^̉摜ݒ
		SetGraphicRect(LEFT,120,1,384,512/1.5);
		MoveChar(LEFT,FRONT);
		TextOut("\c[BLUE]So, now, is an oni gonna come out?\n
		Or a snake?");
		
		MoveChar(LEFT,BACK);
		TextOut("\c[RED]And another sign appeared in heaven:");
		SetCommonDataEx("in","move",true);

		SetChar(RIGHT,enmimg[3]);
		SetGraphicRect(RIGHT,1,1,384/1.5,512/1.5);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]Behold, a great, fiery red dragon.");

		SetChar(LEFT,plaimg[3]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]What, a dragon? Where, where?");

		SetChar(RIGHT,enmimg[0]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		SetCommonDataEx("in","snd",true);
		TextOut("\c[RED]If thou keep looking away like that,\n
		thou won't even know who it was that\n
		devoured thee.");

		SetChar(LEFT,plaimg[8]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]Ack! I'm not someone you can just eat!");

		SetChar(RIGHT,enmimg[0]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]Indeed, thou do seem rather inedible.");

		SetChar(LEFT,plaimg[4]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]Well, that's good to...\n
		Wait, what do you mean, `inedible'?");

		SetChar(RIGHT,enmimg[0]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]A woman clothed with stars has\n
		appeared, hm...?\n 
		It seems the disgusting prophecy meant 
		to bind me has at last been unleashed.");
		TextOut("\c[RED]However, I will not allow that. I hid\n
		my identity and went to the East,\n
		saving up my power in preparation for\n
		this time.");

		SetChar(LEFT,plaimg[3]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]Huh? You're not one of the eight\n
		million Shinto gods?");

		SetChar(RIGHT,enmimg[0]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]I have masqueraded as a star god of\n
		theirs, yes, but that ends here.");
		SetCommonDataEx("in","music",true);
		TextOut("\c[RED]Amongst the eight million gods, those\n
		who could match me were not even\n
		numerous enough to count with the\n
		fingers on both hands.");

		SetChar(LEFT,plaimg[2]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]I'm pretty strong, you know.  Be\n
		careful that you don't end up\n
		breaking one of your precious fingers.");

		SetChar(RIGHT,enmimg[0]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]The pole star is Venus - the morning\n
		star that illuminates darkness,\n
		and an overpowering light that brings\n
		all to ruin.");
		SetChar(RIGHT,enmimg[3]);
		TextOut("\c[RED]O human who can do nothing but\n
		imitate the stars!\n
		Know how foolish it is to bear thy\n
		fangs against them!");

		End();
	}
		
	@Finalize {
	}
}

script_enemy_main {
    let imgSPNB   = GetCurrentScriptDirectory~".\enm4eff\spellEfect.png";
    let imgEffect = GetCurrentScriptDirectory~".\enm4eff\bossEfect.png";
    let imgEffect2= GetCurrentScriptDirectory~".\enm4eff\wave.png";
    let t5        = GetCurrentScriptDirectory~".\enm4se\timer1.wav";
    let t10       = GetCurrentScriptDirectory~".\enm4se\timer2.wav";
    let tan       = GetCurrentScriptDirectory~".\enm4se\shot1.wav";
    let kira      = GetCurrentScriptDirectory~".\enm4se\shot2.wav";
    let Gspel     = GetCurrentScriptDirectory~".\enm4se\echo5.wav";
    let laser     = GetCurrentScriptDirectory~".\enm4se\Laser2.wav";
    let power     = GetCurrentScriptDirectory~".\enm4se\enemy_powereffect.wav";
    let powerl    = GetCurrentScriptDirectory~".\enm4se\power_logo.wav";
    let gekiha    = GetCurrentScriptDirectory~".\enm4se\BossEnd.wav";
    let powerla   = GetCurrentScriptDirectory~".\enm4se\power_logo.wav";
    let kaku      = GetCurrentScriptDirectory~".\enm4se\j.wav";
    let frame     = 0;
    let GetAngle  = 0;
    let angle     = 0;
    let angle2    = 0;
    let angleBase = 0;
    let count     = 0;
    let timer     = 0;
    let shotdir   = GetCurrentScriptDirectory ~ "kshotData.txt";
    let MinX	  = GetClipMinX;
    let MaxX	  = GetClipMaxX;
    let CenX	  = GetCenterX;
    let MinY	  = GetClipMinY;
    let MaxY	  = GetClipMaxY;
    let CenY	  = GetCenterY;
    let T_count   = 0;
    let Damage    = 0;
    let a         = 0;
    let b         = 0;
    let S_count   = 0;
    let w         = 0;
    let lp        = 0;

    @Initialize {
	SetX(MaxX+100);
	SetY(MinY-100);

	SetLife(5000);
	SetDamageRate(0,0);

	/*e폜@(l64)*/
	SetShotAutoDeleteClip(30,30,30,30);

	LoadUserShotData(shotdir);
	LoadGraphic(imgEffect);
	LoadGraphic(imgEffect2);
	LoadGraphic(imgSPNB);
	Aura(8,255,50,150);
	MagicCircle(false);
	SetRateScoreSystemEnable(false);
	EnemyTexture04(true);
	VSname(1);
	VSname2(0,1);
	VSname2(10,1);
	VSname2(20,1);
	VSname2(30,1);
	CreateEventFromScript("Event01");
    }

    @MainLoop {
		yield;
		
		let gm	= GetCommonDataEx("in","move");
		if(gm==true){
			SetMovePosition03(CenX,CenY-120,10,5);
		}
		if(OnEvent==false){
			SetLife(0);
		}
}

    @DrawLoop {
	}

    @Finalize {
		DeleteCommonDataEx("in","move");
		DeleteCommonDataEx("in","music");
		DeleteCommonDataEx("in","snd");
	}

	#include_function".\Obj_Control.txt"
	#include_function".\lib_kshot.txt"
}