#東方弾幕風
#Title[白符「初期化」]
#Text[データを初期化します]
#Image[.]
#BackGround[User]
#Player[FREE]
#ScriptVersion[2]
script_enemy_main {
    let name    = "白符「初期化」";
let csd = GetCurrentScriptDirectory;

	let csd=GetCurrentScriptDirectory;
	let imgResult="2";
    @Initialize {		
	CreateCommonDataArea(NsScore);
//	LoadCommonDataEx(NsScore,savePathstage);
	SetCommonData(NsGetSpell,0);
	let isRep = IsReplay();
	SetCommonData(NsIsReplay,isRep);
	SetX(GetCenterX);
	SetY(GetClipMinY + 128);// 初期位置
        SetLife(100);
    }

    @MainLoop {
        VanishEnemy;
    }

    @DrawLoop {
        DrawGraphic(GetX, GetY);
    }

    @Finalize {

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

SetCommonDataEx(NsScore,"MenuSpellNo",0);
SetCommonDataEx(NsScore,"MenuSpellLevelNo",0);

	ascent(let i in 0..100)
	{
		SetCommonDataEx(NsScore,Player1Hiscore[i],0);
		SetCommonDataEx(NsScore,Player1AllPhoto[i],0);
		SetCommonDataEx(NsScore,Player1HiPhoto[i],0);
		SetCommonDataEx(NsScore,Player1FirstClearPhoto[i],0);
		SetCommonDataEx(NsScore,Player1Challenge[i],0);
		SetCommonDataEx(NsScore,Player1FirstClearChallenge[i],0);

		SetCommonDataEx(NsScore,Player2Hiscore[i],0);
		SetCommonDataEx(NsScore,Player2AllPhoto[i],0);
		SetCommonDataEx(NsScore,Player2HiPhoto[i],0);
		SetCommonDataEx(NsScore,Player2FirstClearPhoto[i],0);
		SetCommonDataEx(NsScore,Player2Challenge[i],0);
		SetCommonDataEx(NsScore,Player2FirstClearChallenge[i],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"
}
