#TouhouDanmakufu[Plural]
#ScriptVersion[3]
#Title["stage 2 boss script"]
#Text[test6] 

#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 ~ "./appear2.txt");
	ObjEnemyBossScene_Add(obj, 0, dir ~ "./dialogstage2.txt");
	ObjEnemyBossScene_Add(obj, 0, dir ~ "./2nonspell.txt");
    ObjEnemyBossScene_Add(obj, 1, dir ~ "./2spellcard3.txt");
	ObjEnemyBossScene_Add(obj, 2, dir ~ "./2nonspell3.txt");
    ObjEnemyBossScene_Add(obj, 2, dir ~ "./2spellcard2.txt");
	ObjEnemyBossScene_Add(obj, 3, dir ~ "./2nonspell2.txt");
	ObjEnemyBossScene_Add(obj, 3, dir ~ "./2spellcard1.txt");
	ObjEnemyBossScene_Add(obj, 4, dir ~ "./2spellcard4.txt");
	ObjEnemyBossScene_Add(obj, 5, dir ~ "./2spellcard5.txt");
	ObjEnemyBossScene_Add(obj, 6, dir ~ "./dialogstage22.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 ~ "./appear2.txt");
	ObjEnemyBossScene_Add(obj, 0, dir ~ "./dialogstage2.txt");
	ObjEnemyBossScene_Add(obj, 0, dir ~ "./2nonspell.txt");
    ObjEnemyBossScene_Add(obj, 1, dir ~ "./2spellcard3.txt");
	ObjEnemyBossScene_Add(obj, 2, dir ~ "./2nonspell3.txt");
    ObjEnemyBossScene_Add(obj, 2, dir ~ "./2spellcard2.txt");
	ObjEnemyBossScene_Add(obj, 3, dir ~ "./2nonspell2.txt");
	ObjEnemyBossScene_Add(obj, 3, dir ~ "./2spellcard1.txt");
	ObjEnemyBossScene_Add(obj, 4, dir ~ "./2spellcard4.txt");
	ObjEnemyBossScene_Add(obj, 5, dir ~ "./2spellcard5.txt");
	ObjEnemyBossScene_Add(obj, 6, dir ~ "./dialogstage22.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 ~ "./appear2.txt");
	ObjEnemyBossScene_Add(obj, 0, dir ~ "./dialogstage2.txt");
	ObjEnemyBossScene_Add(obj, 0, dir ~ "./2nonspell.txt");
    ObjEnemyBossScene_Add(obj, 1, dir ~ "./2spellcard3.txt");
	
	ObjEnemyBossScene_Add(obj, 3, dir ~ "./2nonspell2.txt");
	ObjEnemyBossScene_Add(obj, 3, dir ~ "./2spellcard1.txt");
	ObjEnemyBossScene_Add(obj, 4, dir ~ "./2spellcard4.txt");
	ObjEnemyBossScene_Add(obj, 5, dir ~ "./2spellcard5.txt");
	ObjEnemyBossScene_Add(obj, 6, dir ~ "./dialogstage22.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 ~ "./appear2.txt");
	ObjEnemyBossScene_Add(obj, 0, dir ~ "./dialogstage2.txt");
	ObjEnemyBossScene_Add(obj, 0, dir ~ "./2nonspell.txt");
    ObjEnemyBossScene_Add(obj, 1, dir ~ "./2spellcard3.txt");
	ObjEnemyBossScene_Add(obj, 2, dir ~ "./2nonspell3.txt");
ObjEnemyBossScene_Add(obj, 3, dir ~ "./2spellcard1.txt");
	ObjEnemyBossScene_Add(obj, 3, dir ~ "./2nonspell2.txt");
	
	ObjEnemyBossScene_Add(obj, 4, dir ~ "./2spellcard4.txt");
	ObjEnemyBossScene_Add(obj, 5, dir ~ "./2spellcard5.txt");
	ObjEnemyBossScene_Add(obj, 6, dir ~ "./dialogstage22.txt");
    ObjEnemyBossScene_LoadInThread(obj);
    ObjEnemyBossScene_Regist(obj);
    while(!Obj_IsDeleted(obj)){
        yield;
    }
    CloseScript(GetOwnScriptID());
	}
}
