#東方弾幕風[Player]
#Menu[回避専用機体・魔理沙型]
#Text[弾が撃てません
ボムは画面内の弾を全て消すだけです]
#Image[.\img\neta148.png]
#ReplayName[Marisa]
#ScriptVersion[2]

script_player_main {
	#include_function ".\CommonScript.txt"

	let player = csd ~ "img\player_marisa.png";
	let onbomb = 0;

	let PlayerRect = [9, 2, 40, 46];
	let PlayerRect_L = [4, 50, 42, 94];
	let PlayerRect_R = [7, 98, 46, 142];
	@Initialize {
		LoadGraphic(player);
		LoadGraphic(border);

		LoadSE(burst);

		SetPlayerLifeImage(player, 3, 162, 17, 176);
		SetRebirthFrame(15);
		SetSpeed(5, 2);
		SetAutoEffect(false);

		TMain;
	}

	@MainLoop {
		value;
		keycheck;

		SetIntersectionCircle(GetPlayerX, GetPlayerY, 0);

		yield;
	}

	@Missed {MainLoop}

	@SpellCard {
		if(onbomb == 0) {
			bomb;
		} else {
			AddBomb(1);
		}
	}

	@DrawLoop {
		SetTexture(player);
		SetGraphicAngle(0, 0, 0);
		SetGraphicScale(1.0, 1.0);
		SetRenderState(ALPHA);
		SetAlpha(255);

		if(LKey == KEY_PUSH || LKey == KEY_HOLD) {
			SetGraphicRect(PlayerRect_L[0], PlayerRect_L[1], PlayerRect_L[2], PlayerRect_L[3]);
		} else if(RKey == KEY_PUSH || RKey == KEY_HOLD) {
			SetGraphicRect(PlayerRect_R[0], PlayerRect_R[1], PlayerRect_R[2], PlayerRect_R[3]);
		} else  {
			SetGraphicRect(PlayerRect[0], PlayerRect[1], PlayerRect[2], PlayerRect[3]);
		}

		DrawGraphic(GetPlayerX, GetPlayerY);

		autodraw;
	}

	@Finalize {

	}

	// メインタスク
	task TMain {
		yield;
	}
}