#東方弾幕風
#Title[白符「初期化」]
#Text[データを初期化します]
#Image[.]
#BackGround[User]
#Player[.\player/MarisaA\MarisaA.txt,.\player/MarisaB\MarisaB.txt,.\player/MarisaC\MarisaC.txt,.\player/MarisaD\MarisaD.txt]
#ScriptVersion[2]
script_enemy_main {

#include_function ".\txt\StageInitialization.txt"//
#include_function ".\txt/stagedata.txt"

    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();

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

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

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

			SetCommonDataEx(NsScore,NsHiScoreReimuALuna[i],0);
			SetCommonDataEx(NsScore,NsHiScoreReimuBLuna[i],0);
			SetCommonDataEx(NsScore,NsHiScoreReimuCLuna[i],0);
			SetCommonDataEx(NsScore,NsHiScoreReimuDLuna[i],0);
			SetCommonDataEx(NsScore,NsHiScoreReimuELuna[i],0);

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

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

			SetCommonDataEx(NsScore,NsHiScoreReimuAHard2[i],10-i);
			SetCommonDataEx(NsScore,NsHiScoreReimuBHard2[i],10-i);
			SetCommonDataEx(NsScore,NsHiScoreReimuCHard2[i],10-i);
			SetCommonDataEx(NsScore,NsHiScoreReimuDHard2[i],10-i);
			SetCommonDataEx(NsScore,NsHiScoreReimuEHard2[i],10-i);

			SetCommonDataEx(NsScore,NsHiScoreReimuALuna2[i],10-i);
			SetCommonDataEx(NsScore,NsHiScoreReimuBLuna2[i],10-i);
			SetCommonDataEx(NsScore,NsHiScoreReimuCLuna2[i],10-i);
			SetCommonDataEx(NsScore,NsHiScoreReimuDLuna2[i],10-i);
			SetCommonDataEx(NsScore,NsHiScoreReimuELuna2[i],10-i);
		}
///////////////////////////////////////////////////////////////////////////////////////////////////////
		ascent(let i in 0..5)//ハイスコアの初期化
		{
			SetCommonDataEx(NsScore,NsStageHiScoreReimuAEasy[i],0);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuBEasy[i],0);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuCEasy[i],0);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuDEasy[i],0);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuEEasy[i],0);

			SetCommonDataEx(NsScore,NsStageHiScoreReimuANormal[i],0);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuBNormal[i],0);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuCNormal[i],0);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuDNormal[i],0);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuENormal[i],0);

			SetCommonDataEx(NsScore,NsStageHiScoreReimuAHard[i],0);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuBHard[i],0);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuCHard[i],0);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuDHard[i],0);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuEHard[i],0);

			SetCommonDataEx(NsScore,NsStageHiScoreReimuALuna[i],0);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuBLuna[i],0);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuCLuna[i],0);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuDLuna[i],0);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuELuna[i],0);

			SetCommonDataEx(NsScore,NsStageHiScoreReimuAEasy2[i],10);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuBEasy2[i],10);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuCEasy2[i],10);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuDEasy2[i],10);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuEEasy2[i],10);

			SetCommonDataEx(NsScore,NsStageHiScoreReimuANormal2[i],10);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuBNormal2[i],10);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuCNormal2[i],10);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuDNormal2[i],10);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuENormal2[i],10);

			SetCommonDataEx(NsScore,NsStageHiScoreReimuAHard2[i],10);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuBHard2[i],10);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuCHard2[i],10);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuDHard2[i],10);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuEHard2[i],10);

			SetCommonDataEx(NsScore,NsStageHiScoreReimuALuna2[i],10);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuBLuna2[i],10);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuCLuna2[i],10);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuDLuna2[i],10);
			SetCommonDataEx(NsScore,NsStageHiScoreReimuELuna2[i],10);
		}

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

		SetCommonDataEx(NsScore,NsFrequencyReimuANormal,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuBNormal,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuCNormal,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuDNormal,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuENormal,0);

		SetCommonDataEx(NsScore,NsFrequencyReimuAHard,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuBHard,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuCHard,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuDHard,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuEHard,0);

		SetCommonDataEx(NsScore,NsFrequencyReimuALuna,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuBLuna,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuCLuna,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuDLuna,0);
		SetCommonDataEx(NsScore,NsFrequencyReimuELuna,0);

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

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

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

		SetCommonDataEx(NsScore,"InitialLife",3);
		SetCommonDataEx(NsScore,"InitialBomb",3);

		SetCommonDataEx(NsScore,NsAllFragment,0);//総取得フラグメントの初期化
		SetCommonDataEx(NsScore,NsAllFragment2,0);

		SetCommonDataEx(NsScore,"LOWSPIRALNUM",0);//1面スパイラル回数の初期化
		SetCommonDataEx(NsScore,"UseAutoBombCount",0);//オートボム回数の初期化
		SetCommonDataEx(NsScore,"BurstModeErazeBulletNumAM",0);//誘爆弾消しの数の初期化
		SetCommonDataEx(NsScore,NsContinueCount,0);//コンティニュー回数の初期化

	ascent(i in 1..6)
	{//ネームの初期化
		SetCommonDataEx(NsScore,NsStageHiScoreEasyName[i-1],"NoName");
		SetCommonDataEx(NsScore,NsStageHiScoreNormalName[i-1],"NoName");
		SetCommonDataEx(NsScore,NsStageHiScoreHardName[i-1],"NoName");
	}
	ascent(i in 1..11)
	{//ネームの初期化
		SetCommonDataEx(NsScore,NsHiScoreEasyName[i-1],"NoName");
		SetCommonDataEx(NsScore,NsHiScoreNormalName[i-1],"NoName");
		SetCommonDataEx(NsScore,NsHiScoreHardName[i-1],"NoName");
	}
    }

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

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

    @Finalize {
		DeleteGraphic(imgBoss);

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

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