#東方弾幕風
#Title[白符「初期化」]
#Text[データを初期化します]
#Image[.]
#BackGround[User]
	#Player[.\player/Marisa/Marisa.txt,.\player/Reimu/Reimu.txt]
#ScriptVersion[2]
script_enemy_main {
    let name    = "白符「初期化」";
let csd = GetCurrentScriptDirectory;
    let imgBoss =csd ~ "lib/dot_cirno.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 k in 0..150)//スペル履歴の初期化
		{
			SetCommonDataEx(NsScore,NsSpellG[k],0);
			SetCommonDataEx(NsScore,NsSpellC[k],0);
			SetCommonDataEx(NsScore,NsSpellB[k],0);

			SetCommonDataEx(NsScore,NsSpellGRA[k],0);
			SetCommonDataEx(NsScore,NsSpellCRA[k],0);
			SetCommonDataEx(NsScore,NsSpellBRA[k],0);

			SetCommonDataEx(NsScore,NsSpellGRB[k],0);
			SetCommonDataEx(NsScore,NsSpellCRB[k],0);
			SetCommonDataEx(NsScore,NsSpellBRB[k],0);

			SetCommonDataEx(NsScore,NsSpellGMA[k],0);
			SetCommonDataEx(NsScore,NsSpellCMA[k],0);
			SetCommonDataEx(NsScore,NsSpellBMA[k],0);

			SetCommonDataEx(NsScore,NsSpellGMB[k],0);
			SetCommonDataEx(NsScore,NsSpellCMB[k],0);
			SetCommonDataEx(NsScore,NsSpellBMB[k],0);

			SetCommonDataEx(NsScore,NsSpellGO[k],0);
			SetCommonDataEx(NsScore,NsSpellCO[k],0);
			SetCommonDataEx(NsScore,NsSpellBO[k],0);
		}

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

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

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

			SetCommonDataEx(NsScore,NsHiScoreReimuALunatic[i],0);
			SetCommonDataEx(NsScore,NsHiScoreReimuBLunatic[i],0);
			SetCommonDataEx(NsScore,NsHiScoreMarisaALunatic[i],0);
			SetCommonDataEx(NsScore,NsHiScoreMarisaBLunatic[i],0);
			SetCommonDataEx(NsScore,NsHiScoreOthersLunatic[i],0);

			SetCommonDataEx(NsScore,NsHiScoreReimuAExtra[i],0);
			SetCommonDataEx(NsScore,NsHiScoreReimuBExtra[i],0);
			SetCommonDataEx(NsScore,NsHiScoreMarisaAExtra[i],0);
			SetCommonDataEx(NsScore,NsHiScoreMarisaBExtra[i],0);
			SetCommonDataEx(NsScore,NsHiScoreOthersExtra[i],0);
		}

		//プレイ回数の初期化
		SetCommonDataEx(NsScore,NsFrequencyReimuAEasy,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuBEasy,0);
		SetCommonDataEx(NsScore,NsFrequencyMarisaAEasy,0);
		SetCommonDataEx(NsScore,NsFrequencyMarisaBEasy,0);
		SetCommonDataEx(NsScore,NsFrequencyOthersEasy,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuANormal,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuBNormal,0);
		SetCommonDataEx(NsScore,NsFrequencyMarisaANormal,0);
		SetCommonDataEx(NsScore,NsFrequencyMarisaBNormal,0);
		SetCommonDataEx(NsScore,NsFrequencyOthersNormal,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuAHard,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuBHard,0);
		SetCommonDataEx(NsScore,NsFrequencyMarisaAHard,0);
		SetCommonDataEx(NsScore,NsFrequencyMarisaBHard,0);
		SetCommonDataEx(NsScore,NsFrequencyOthersHard,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuALunatic,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuBLunatic,0);
		SetCommonDataEx(NsScore,NsFrequencyMarisaALunatic,0);
		SetCommonDataEx(NsScore,NsFrequencyMarisaBLunatic,0);
		SetCommonDataEx(NsScore,NsFrequencyOthersLunatic,0);
		SetCommonDataEx(NsScore,"ExFlag","false");
		SetCommonDataEx(NsScore,"SecretFlag","false");//フラグの初期化

		SetCommonDataEx(NsScore,NsUpTime,0);//起動時間の初期化
		SetCommonDataEx(NsScore,NsPlayTime,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/data.txt"
#include_function ".\txt/stagedata.txt"
#include_function ".\lib/lib_anime_Sakuya.txt"
}
