//#東方弾幕風[Single]
#ScriptVersion[3]
#Title["小傘会話"]
#Text["小傘会話"]
#System["./system/system.dnh"]
//Background["./background.dnh"]

#include "./lib/lib_boss.dnh"
#include "./lib/lib_anime_Kogasa.dnh"
#include "./lib/lib_talk.dnh"

//敵画像の設定
imgEnemy = DIR ~ "img/dot_kogasa.png"; //敵画像ファイル

//----------------------------------------------------
//敵の動作
//----------------------------------------------------
@Event
{
	alternative(GetEventType())
	case(EV_REQUEST_LIFE)
	{
		SetScriptResult(1);
	}
}

@Initialize
{
	Boss_Init;
	ObjMove_SetPosition(objEnemy, GetStgFrameWidth, -64);
	TMain;
}

@MainLoop
{
	if (eAlive)
	{
		//敵の座標を取得
		eX = ObjMove_GetX(objEnemy);
		eY = ObjMove_GetY(objEnemy);
	}
	DrawBoss(objEnemy);
	yield;
}

@Loading
{
	LoadFiles_InLoading;
}

task TMain
{
	Boss_StandBy2;
	Boss_SetAura();

	wait(15);

	objPlayer = GetPlayerObjectID();
	let pType = GetPlayerType();
	alternative(pType)
	case(1) { Talk_Reimu; }
	case(2) { Talk_Marisa; }
	case(3) { Talk_Sanae; }
	case(4) { Talk_Youmu; }
	others { Talk_Other; }

	ObjEnemy_SetLife(objEnemy, 0);
}

task Act_Move
{
	SetMovePositionHermite(objEnemy, xIni-30, yIni-60, 200, 0, 150, 240, 75);
	SetAction(ACT_MOVE, 75);
	wait(75);
	SetMovePositionHermite(objEnemy, xIni, yIni, 50, 0, 50, 90, 45);
	SetAction(ACT_MOVE, 45);
}


sub Talk_Reimu
{
	let imgTalkA01	= DIR ~ "img/cutin/ImgKogasa01.png";	//うらめしやー
	let imgTalkA02	= DIR ~ "img/cutin/ImgKogasa02.png";	//笑い
	let imgTalkA03	= DIR ~ "img/cutin/ImgKogasa03.png";	//ふふん
	let imgTalkA04	= DIR ~ "img/cutin/ImgKogasa04.png";	//えっ
	let imgTalkA05	= DIR ~ "img/cutin/ImgKogasa05.png";	//ぼろりんちょ

	let imgTalkB01 = DIR ~ "img/cutin/ImgReimu01.png";	//ふつう
	let imgTalkB02 = DIR ~ "img/cutin/ImgReimu02.png";	//笑い
	let imgTalkB03 = DIR ~ "img/cutin/ImgReimu03.png";	//怒り
	let imgTalkB04 = DIR ~ "img/cutin/ImgReimu04.png";	//呆れ

	Talk_RefleshObject;

	let px = 160; let py = 90;
	let tx = px+220; let ty = py+180;

	let px2 = -160; let py2 = 135;
	let tx2 = px2+260; let ty2 = py2+160;

	Talk_SetText(380, 64, 1, FUKIDASHI_YELLOW,
		"ふっふっふ、よく来たわね。", "");

	Talk_SetFace(0, imgTalkB01, px2, py2, 512, 512, 0.75);
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"さてはあんた…。", "");
	Talk_SetText_Timer(380, 64, 1, FUKIDASHI_YELLOW,
		"そう、私こそが謎の…。", "", 35);
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"この前の妖怪ね。", "");
	Talk_SetFace(0, imgTalkB03, px2, py2, 512, 512, 0.75);
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"私を招き入れるなんて", "良い度胸してるわね。");

	Act_Move();

	Talk_SetFace(1, imgTalkA04, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"決め台詞に被せないでよ！", "");
	Talk_SetFace(0, imgTalkB04, px2, py2, 512, 512, 0.75);
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"私も暇じゃないのよ。", "");
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"用があるならさっさと", "済ませて欲しいんだけど。");
	Talk_SetFace(1, imgTalkA05, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"招く相手間違えたかしら…。", "");
	Talk_SetFace(1, imgTalkA04, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"えーっと、とにかく…。", "ここで会ったが百年目！");


	SetCommonData("BGM_SCENE", 1);
	Talk_SetFace(1, imgTalkA03, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"今の私はニュー小傘！", "");
	Talk_SetFace(1, imgTalkA02, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"準備は万端、お腹は満タン！", "");
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"進化した私に恐れおののくのだ！", "");
	Talk_SetFace(1, imgTalkA01, px, py, 512, 512, 1);
	Talk_SetText_ShakeTimer(tx, ty, 1, FUKIDASHI_YELLOW,
		"さあ、ふるえるがいい", "",180);

	Talk_DeleteObject;
}

sub Talk_Marisa
{
	let imgTalkA01	= DIR ~ "img/cutin/ImgKogasa01.png";	//うらめしやー
	let imgTalkA02	= DIR ~ "img/cutin/ImgKogasa02.png";	//笑い
	let imgTalkA03	= DIR ~ "img/cutin/ImgKogasa03.png";	//ふふん
	let imgTalkA04	= DIR ~ "img/cutin/ImgKogasa04.png";	//えっ
	let imgTalkA05	= DIR ~ "img/cutin/ImgKogasa05.png";	//ぼろりんちょ

	let imgTalkB01 = DIR ~ "img/cutin/ImgMarisa01.png";	//ふつう
	let imgTalkB02 = DIR ~ "img/cutin/ImgMarisa02.png";	//笑い
	let imgTalkB03 = DIR ~ "img/cutin/ImgMarisa03.png";	//ウィンク
	let imgTalkB04 = DIR ~ "img/cutin/ImgMarisa04.png";	//呆れ

	Talk_RefleshObject;

	let px = 160; let py = 90;
	let tx = px+220; let ty = py+180;

	let px2 = -155; let py2 = 127;
	let tx2 = px2+250; let ty2 = py2+180;

	Talk_SetText(380, 64, 1, FUKIDASHI_YELLOW,
		"ふっふっふ、よく来たわね。", "");

	Talk_SetFace(0, imgTalkB01, px2, py2, 512, 512, 0.75);
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"おお？お前は…。", "");
	Talk_SetText_Timer(380, 64, 1, FUKIDASHI_YELLOW,
		"そう、私こそが謎の…。", "", 35);
	Talk_SetFace(0, imgTalkB02, px2, py2, 512, 512, 0.75);
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"またお前か。なんかようかい？", "");

	Act_Move();

	Talk_SetFace(1, imgTalkA04, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"決め台詞に被せないでよ！", "");
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"悪いな、わざとだ。", "");
	Talk_SetFace(0, imgTalkB01, px2, py2, 512, 512, 0.75);
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"ところで何で呼ばれだんだ？", "この前のお礼なら間に合ってるぜ。");
	Talk_SetFace(1, imgTalkA05, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"お礼参りの用ならあるけどね。", "");
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"私もついでに", "ぶっ飛ばしたじゃない！");
	Talk_SetFace(0, imgTalkB03, px2, py2, 512, 512, 0.75);
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"妖怪だから仕方がない。", "");
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"これだから", "人間はうらめしいわ。");


	SetCommonData("BGM_SCENE", 1);
	Talk_SetFace(1, imgTalkA03, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"…ここで会ったが百年目！", "");
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"今の私はニュー小傘！", "");
	Talk_SetFace(1, imgTalkA02, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"準備は万端、お腹は満タン！", "");
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"進化した私に恐れおののくのだ！", "");
	Talk_SetFace(1, imgTalkA01, px, py, 512, 512, 1);
	Talk_SetText_ShakeTimer(tx, ty, 1, FUKIDASHI_YELLOW,
		"さあ、ふるえるがいい", "",180);

	Talk_DeleteObject;
}

sub Talk_Sanae
{
	let imgTalkA01	= DIR ~ "img/cutin/ImgKogasa01.png";	//うらめしやー
	let imgTalkA02	= DIR ~ "img/cutin/ImgKogasa02.png";	//笑い
	let imgTalkA03	= DIR ~ "img/cutin/ImgKogasa03.png";	//ふふん
	let imgTalkA04	= DIR ~ "img/cutin/ImgKogasa04.png";	//えっ
	let imgTalkA05	= DIR ~ "img/cutin/ImgKogasa05.png";	//ぼろりんちょ

	let imgTalkB01 = DIR ~ "img/cutin/ImgSanae01.png";	//ふふん
	let imgTalkB02 = DIR ~ "img/cutin/ImgSanae02.png";	//笑い
	let imgTalkB03 = DIR ~ "img/cutin/ImgSanae03.png";	//呆れ
	let imgTalkB04 = DIR ~ "img/cutin/ImgSanae04.png";	//ふつう

	Talk_RefleshObject;

	let px = 160; let py = 90;
	let tx = px+220; let ty = py+180;

	let px2 = -160; let py2 = 127;
	let tx2 = px2+260; let ty2 = py2+160;

	Talk_SetText(380, 64, 1, FUKIDASHI_YELLOW,
		"ふっふっふ、よく来たわね。", "");

	Talk_SetFace(0, imgTalkB01, px2, py2, 512, 512, 0.75);
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"さてはあなた…。", "");
	Talk_SetText_Timer(380, 64, 1, FUKIDASHI_YELLOW,
		"そう、私こそが謎の…。", "", 35);
	Talk_SetFace(0, imgTalkB02, px2, py2, 512, 512, 0.75);
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"小傘さん、妙な手紙を", "寄こしてどういうおつもりですか？");

	Act_Move();

	Talk_SetFace(1, imgTalkA04, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"決め台詞に被せないでよ！", "");
	Talk_SetFace(0, imgTalkB01, px2, py2, 512, 512, 0.75);
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"ふうん。", "");
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"妖怪に口上を持って行かれて", "しまっては、風祝の名が廃るわ。");
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"風祝って何だったっけ？", "");
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"えーっと、とにかく…。", "ここで会ったが百年目！");


	SetCommonData("BGM_SCENE", 1);
	Talk_SetFace(1, imgTalkA03, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"今の私はニュー小傘！", "");
	Talk_SetFace(1, imgTalkA02, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"準備は万端、お腹は満タン！", "");
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"進化した私に恐れおののくのだ！", "");
	Talk_SetFace(1, imgTalkA01, px, py, 512, 512, 1);
	Talk_SetText_ShakeTimer(tx, ty, 1, FUKIDASHI_YELLOW,
		"さあ、ふるえるがいい", "",180);

	Talk_DeleteObject;
}

sub Talk_Youmu
{
	let imgTalkA01	= DIR ~ "img/cutin/ImgKogasa01.png";	//うらめしやー
	let imgTalkA02	= DIR ~ "img/cutin/ImgKogasa02.png";	//笑い
	let imgTalkA03	= DIR ~ "img/cutin/ImgKogasa03.png";	//ふふん
	let imgTalkA04	= DIR ~ "img/cutin/ImgKogasa04.png";	//えっ
	let imgTalkA05	= DIR ~ "img/cutin/ImgKogasa05.png";	//ぼろりんちょ

	let imgTalkB01 = DIR ~ "img/cutin/ImgYoumu01.png";	//ふつう
	let imgTalkB02 = DIR ~ "img/cutin/ImgYoumu02.png";	//呆れ
	let imgTalkB03 = DIR ~ "img/cutin/ImgYoumu03.png";	//泣き
	let imgTalkB04 = DIR ~ "img/cutin/ImgYoumu04.png";	//曲者ッ

	Talk_RefleshObject;

	let px = 160; let py = 90;
	let tx = px+220; let ty = py+180;

	let px2 = -180; let py2 = 67;
	let tx2 = px2+285; let ty2 = py2+215;

	Talk_SetText(380, 64, 1, FUKIDASHI_YELLOW,
		"ふっふっふ、よく来たわね。", "");

	Talk_SetFace(0, imgTalkB01, px2, py2, 512, 512, 0.87);
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"あなたは…。", "");
	Talk_SetText(380, 64, 1, FUKIDASHI_YELLOW,
		"そう、私こそが謎の妖怪「K」！", "");
	Talk_SetText(380, 64, 1, FUKIDASHI_YELLOW,
		"チャーミングにして", "ミステリアス！");
	Talk_SetFace(0, imgTalkB02, px2, py2, 512, 512, 0.87);
	Talk_SetText(380, 64, 1, FUKIDASHI_YELLOW,
		"妖怪界のアイドルとは", "ワタクシの事よ！");

	Act_Move();

	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"（どこから突っ込もう…。）", "");
	Talk_SetFace(1, imgTalkA01, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"ふふん、", "驚いて声も出ないかしら。");
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"間違ってはいませんけどね。", "");
	Talk_SetFace(0, imgTalkB01, px2, py2, 512, 512, 0.87);
	Talk_SetText(tx2, ty2, 0, FUKIDASHI_YELLOW,
		"ところで、こんな所に呼び出して", "何のつもりですか？");
	Talk_SetFace(1, imgTalkA02, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"よくぞ聞いてくれたわ！", "");


	SetCommonData("BGM_SCENE", 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"ここで会ったが百年目！", "");
	Talk_SetFace(1, imgTalkA03, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"今の私はニュー小傘！", "");
	Talk_SetFace(1, imgTalkA02, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"準備は万端、お腹は満タン！", "");
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"進化した私に恐れおののくのだ！", "");
	Talk_SetFace(1, imgTalkA01, px, py, 512, 512, 1);
	Talk_SetText_ShakeTimer(tx, ty, 1, FUKIDASHI_YELLOW,
		"さあ、ふるえるがいい", "",180);

	Talk_DeleteObject;
}


sub Talk_Other
{
	let imgTalkA01	= DIR ~ "img/cutin/ImgKogasa01.png";	//うらめしやー
	let imgTalkA02	= DIR ~ "img/cutin/ImgKogasa02.png";	//笑い
	let imgTalkA03	= DIR ~ "img/cutin/ImgKogasa03.png";	//ふふん
	let imgTalkA04	= DIR ~ "img/cutin/ImgKogasa04.png";	//えっ
	let imgTalkA05	= DIR ~ "img/cutin/ImgKogasa05.png";	//ぼろりんちょ

	Talk_RefleshObject;

	let px = 160; let py = 90;
	let tx = px+220; let ty = py+180;

	let px2 = -160; let py2 = 127;
	let tx2 = px2+260; let ty2 = py2+160;

	Talk_SetText(380, 64, 1, FUKIDASHI_YELLOW,
		"ふっふっふ、よく来たわね。", "");
	Talk_SetText(380, 64, 1, FUKIDASHI_YELLOW,
		"…ってあれ？", "");

	Act_Move();

	Talk_SetFace(1, imgTalkA04, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"あなた、呼んだ覚えないん", "だけど。迷子かしら？");
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"えーっと…まぁいいわ！", "");


	SetCommonData("BGM_SCENE", 1);
	Talk_SetFace(1, imgTalkA03, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"ここで会ったが百年目！", "");
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"今の私はニュー小傘！", "");
	Talk_SetFace(1, imgTalkA02, px, py, 512, 512, 1);
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"準備は万端、お腹は満タン！", "");
	Talk_SetText(tx, ty, 1, FUKIDASHI_YELLOW,
		"進化した私に恐れおののくのだ！", "");
	Talk_SetFace(1, imgTalkA01, px, py, 512, 512, 1);
	Talk_SetText_ShakeTimer(tx, ty, 1, FUKIDASHI_YELLOW,
		"さあ、ふるえるがいい", "",180);

	Talk_DeleteObject;
}
