#東方弾幕風
#Title[白符「初期化」]
#Text[データを初期化します]
#Image[.]
#BackGround[User]
#Player[.\player/MarisaA\MarisaA.txt,.\player/MarisaA\MarisaAAuto.txt,.\player/MarisaB\MarisaB.txt,.\player/MarisaB\MarisaBAuto.txt]
#ScriptVersion[2]
script_enemy_main {
    let name    = "白符「初期化」";
let csd = GetCurrentScriptDirectory;
    let imgBoss =csd ~ "lib/dot_cirno.png"; 

	let csd=GetCurrentScriptDirectory;
	let imgBG=csd ~ "img/MenuBG.png";
	let imgItem=csd ~ "img/Item.png";
	let imgDifficult=csd ~ "img/letter.png";
	let imgResult=csd ~ "img/resultletter.png";
	let imgPlayerAndBomb=csd ~ "img/shot_all.png";
	let imgMenuEffect=csd ~ "img/effect_tiny.png";
	let imgNumber=csd ~ "img/Number.png";
	let imgBer=csd ~ "img/ber.png";

    @Initialize {		
	CreateCommonDataArea(NsScore);
	//LoadCommonDataEx(NsScore,savePathstage);
	SetCommonData(NsGetSpell,0);
	let isRep = IsReplay();
	SetCommonData(NsIsReplay,isRep);
	SetX(GetCenterX);
	SetY(GetClipMinY + 128);// 初期位置
        SetLife(100);
        LoadGraphic(imgBoss);
        SetTexture(imgBoss);
	InitializeAction();
    }

    @MainLoop {
        SetCollisionA(GetX, GetY, 32);
    }

    @DrawLoop {
        DrawGraphic(GetX, GetY);
	DrawBoss( imgBoss );
    }

    @Finalize {
		DeleteGraphic(imgBoss);

		ascent(let i in 0..10)//ハイスコアの初期化
		{
			SetCommonDataEx(NsScore,NsHiScoreReimuAEasy[i],0);
			SetCommonDataEx(NsScore,NsHiScoreReimuBEasy[i],0);


			SetCommonDataEx(NsScore,NsHiScoreReimuANormal[i],0);
			SetCommonDataEx(NsScore,NsHiScoreReimuBNormal[i],0);


			SetCommonDataEx(NsScore,NsHiScoreReimuAHard[i],0);
			SetCommonDataEx(NsScore,NsHiScoreReimuBHard[i],0);

			SetCommonDataEx(NsScore,NsHiScoreReimuAEasy2[i],10-i);
			SetCommonDataEx(NsScore,NsHiScoreReimuBEasy2[i],10-i);


			SetCommonDataEx(NsScore,NsHiScoreReimuANormal2[i],10-i);
			SetCommonDataEx(NsScore,NsHiScoreReimuBNormal2[i],10-i);


			SetCommonDataEx(NsScore,NsHiScoreReimuAHard2[i],10-i);
			SetCommonDataEx(NsScore,NsHiScoreReimuBHard2[i],10-i);
		}

		//プレイ回数の初期化
		SetCommonDataEx(NsScore,NsFrequencyReimuAEasy,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuBEasy,0);

		SetCommonDataEx(NsScore,NsFrequencyReimuANormal,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuBNormal,0);

		SetCommonDataEx(NsScore,NsFrequencyReimuAHard,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuBHard,0);

		SetCommonDataEx(NsScore,"ExFlag","true");
		SetCommonDataEx(NsScore,"SecretFlag","true");//フラグの初期化

		SetCommonDataEx(NsScore,NsUpTime,0);//起動時間の初期化
		SetCommonDataEx(NsScore,NsPlayTime,0);//プレイ時間の初期化

		ascent(let k in 0..30)
		{//実績の初期化
			SetCommonDataEx(NsScore,NsAchievement[k],0);
		}

		SetCommonDataEx(NsScore,NsAllFragment,0);
		SetCommonDataEx(NsScore,NsAllFragment2,0);

		SetCommonDataEx(NsScore,"LOWSPIRALNUM",0);
		SetCommonDataEx(NsScore,"UseAutoBombCount",0);
		SetCommonDataEx(NsScore,"BurstModeErazeBulletNumAM",0);
		SetCommonDataEx(NsScore,NsContinueCount,0);

	if(GetCommonDataDefault(NsIsReplay,true) == false)
	{
		SaveCommonDataEx(NsScore,savePathstage);
	}
	ClearCommonDataEx(NsScore);
	DeleteCommonData(NsGetSpell);
	DeleteCommonData(NsDefeatFrame);
	DeleteCommonData(NsDefeatPosX);
	DeleteCommonData(NsDefeatPosY);
	DeleteCommonData(NsBossFrame);
	DeleteCommonData(NsIsReplay);
//デリート&初期化したデータを保存
    }


#include_function ".\txt/stagedata.txt"
#include_function ".\lib/lib_anime_Patchouli.txt"
}
