#TouhouDanmakufu[Plural]
#ScriptVersion[3]
#Title["stage 3 boss script"]
#Text["test6"] 
#include "./3dstage3.txt"
#System["./my_system/My_system.txt"]


@Event{
}

@Initialize{


    TPlural;
}

@MainLoop{
    yield;
}

function wait(w) { loop(w) { yield; } }

task TPlural{

	if (GetCommonData("Difficulty", 3) == 3){
    let dir = GetCurrentScriptDirectory();
    let obj = ObjEnemyBossScene_Create();
	ObjEnemyBossScene_Add(obj, 0, dir ~ "./appear3.txt");
	ObjEnemyBossScene_Add(obj, 1, dir ~ "./dialogstage3.txt");
	ObjEnemyBossScene_Add(obj, 2, dir ~ "./3nonspell.txt");
	ObjEnemyBossScene_Add(obj, 3, dir ~ "./3spellcard1.txt");
    ObjEnemyBossScene_Add(obj, 4, dir ~ "./3nonspell2.txt");
	ObjEnemyBossScene_Add(obj, 5, dir ~ "./3spellcard2.txt");
    ObjEnemyBossScene_Add(obj, 5, dir ~ "./3nonspell3.txt");

	ObjEnemyBossScene_Add(obj, 6, dir ~ "./3spellcard6.txt");
	ObjEnemyBossScene_Add(obj, 7, dir ~ "./3spellcard4.txt");
	ObjEnemyBossScene_Add(obj, 7, dir ~ "./3spellcard3.txt");
    ObjEnemyBossScene_LoadInThread(obj);
    ObjEnemyBossScene_Regist(obj);
    while(!Obj_IsDeleted(obj)){
        yield;
    }
    CloseScript(GetOwnScriptID());
	}
	


	if (GetCommonData("Difficulty", 2) == 2){
    let dir = GetCurrentScriptDirectory();
    let obj = ObjEnemyBossScene_Create();
	ObjEnemyBossScene_Add(obj, 0, dir ~ "./appear3.txt");
	ObjEnemyBossScene_Add(obj, 1, dir ~ "./dialogstage3.txt");
	ObjEnemyBossScene_Add(obj, 2, dir ~ "./3nonspell.txt");
	ObjEnemyBossScene_Add(obj, 3, dir ~ "./3spellcard2.txt");
    ObjEnemyBossScene_Add(obj, 4, dir ~ "./3nonspell2.txt");
	ObjEnemyBossScene_Add(obj, 6, dir ~ "./3spellcard5.txt");
    ObjEnemyBossScene_Add(obj, 6, dir ~ "./3nonspell3.txt");
	ObjEnemyBossScene_Add(obj, 7, dir ~ "./3spellcard4.txt");
	ObjEnemyBossScene_Add(obj, 7, dir ~ "./3spellcard3.txt");
    ObjEnemyBossScene_LoadInThread(obj);
    ObjEnemyBossScene_Regist(obj);
    while(!Obj_IsDeleted(obj)){
        yield;
    }
    CloseScript(GetOwnScriptID());
	}
	
		if (GetCommonData("Difficulty", 1) == 1){
    let dir = GetCurrentScriptDirectory();
    let obj = ObjEnemyBossScene_Create();
	ObjEnemyBossScene_Add(obj, 0, dir ~ "./appear3.txt");
	ObjEnemyBossScene_Add(obj, 1, dir ~ "./dialogstage3.txt");
	ObjEnemyBossScene_Add(obj, 2, dir ~ "./3nonspell.txt");
	ObjEnemyBossScene_Add(obj, 3, dir ~ "./3spellcard2.txt");
    ObjEnemyBossScene_Add(obj, 4, dir ~ "./3nonspell2.txt");
	ObjEnemyBossScene_Add(obj, 6, dir ~ "./3spellcard5.txt");
    ObjEnemyBossScene_Add(obj, 6, dir ~ "./3nonspell3.txt");
	ObjEnemyBossScene_Add(obj, 7, dir ~ "./3spellcard4.txt");
	ObjEnemyBossScene_Add(obj, 7, dir ~ "./3spellcard3.txt");
    ObjEnemyBossScene_LoadInThread(obj);
    ObjEnemyBossScene_Regist(obj);
    while(!Obj_IsDeleted(obj)){
        yield;
    }
    CloseScript(GetOwnScriptID());
	}
	
	if (GetCommonData("Difficulty", 0) == 0){
	
	 let dir = GetCurrentScriptDirectory();
    let obj = ObjEnemyBossScene_Create();
	ObjEnemyBossScene_Add(obj, 0, dir ~ "./appear3.txt");
	ObjEnemyBossScene_Add(obj, 1, dir ~ "./dialogstage3.txt");
	ObjEnemyBossScene_Add(obj, 2, dir ~ "./3nonspell.txt");
	ObjEnemyBossScene_Add(obj, 3, dir ~ "./3spellcard2.txt");
    ObjEnemyBossScene_Add(obj, 4, dir ~ "./3nonspell2.txt");
	ObjEnemyBossScene_Add(obj, 6, dir ~ "./3spellcard5.txt");
    ObjEnemyBossScene_Add(obj, 6, dir ~ "./3nonspell3.txt");
	ObjEnemyBossScene_Add(obj, 7, dir ~ "./3spellcard4.txt");
	ObjEnemyBossScene_Add(obj, 7, dir ~ "./3spellcard3.txt");
    ObjEnemyBossScene_LoadInThread(obj);
    ObjEnemyBossScene_Regist(obj);
    while(!Obj_IsDeleted(obj)){
        yield;
    }
    CloseScript(GetOwnScriptID());
	
	}
}
