if(phase==23 && stagephase==1){
	SetShotColor(255,255,255);

	ObjEffect_SetTexture(boss1,GRmasahiro); outfit1=1;
//	ObjEffect_SetTexture(boss2,GRshinichi); outfit2=1;
	if(enemiescalled<1){
		CreateEnemyBossFromFile("script\Events\Nightmare\Boss.txt",cx,miny-50,0,0,NULL);
		}
	enemiescalled++;
	if(enemiescalled==1){ nextphase=1; }
}

if(phase==24 && stagephase==1 && GetCommonData("Conversation")==1){
	if(frame%60==0){ enemiescalled++; }	
	SetCommonData("InEvent",1);
	if(enemiescalled==1){ nextphase=1; SetCommonData("Conversation",0); }
}

if(phase==25 && stagephase==1){
	if(frame%60==0){
	if(enemiescalled==1){ CreateEnemyFromFile("script\Functions\ExtraFadeout.txt",cx,cy,0,0,[8,181]); }
	enemiescalled++; }
	
	if(GetCommonData("HighScoreNightmare")<(GetScore-oldscore)){ SetCommonData("HighScoreNightmare",GetScore-oldscore); }

	if(enemiescalled==5){
		if(GetCommonData("TrumpCardUnlocked")[14]==0){
		//Masahiro's
		let spellcarddataarray=GetCommonData("NewTrumpCardsUnlocked");
		spellcarddataarray[14]=1;
		SetCommonData("NewTrumpCardsUnlocked",spellcarddataarray);

		let spellcarddataarray=GetCommonData("TrumpCardUnlocked");
		spellcarddataarray[14]=1;
		SetCommonData("TrumpCardUnlocked",spellcarddataarray);

		let spellcarddataarray=GetCommonData("SpellcardData");
		spellcarddataarray[81]=0.5;
		SetCommonData("SpellcardData",spellcarddataarray);
		}
	SaveCommonData;
	ClearStage;
	}
}