void Collide(string &in asParent, string &in asChild, int alState)
{
//BEGIN FOR THE 3RD MAP//
if(GetGlobalVarInt("PlayedPath_1") == 1 && GetGlobalVarInt("PlayedPath_2") == 1)
{
ChangeMap("Path_3", "PlayerStartArea_1", "", "");
SetGlobalVarInt("FinalLevel", 1);
return;
}
if(GetGlobalVarInt("PlayedPath_2") == 1 && GetGlobalVarInt("PlayedPath_3") == 1)
{
ChangeMap("Path_1", "PlayerStartArea_1", "", "");
SetGlobalVarInt("FinalLevel", 1);
return;
}
if(GetGlobalVarInt("PlayedPath_1") == 1 && GetGlobalVarInt("PlayedPath_3") == 1)
{
ChangeMap("Path_2", "PlayerStartArea_1", "", "");
SetGlobalVarInt("FinalLevel", 1);
return;
}
//END FOR THE 3RD MAP//
//BEGIN FOR THE 2ND MAP//
if(GetGlobalVarInt("PlayedFirstPath_1") == 1)
{
AddTimer("ChangeMap_Second_"+RandInt(2, 3), 0, "ChangeMap_Second");
return;
}
if(GetGlobalVarInt("PlayedFirstPath_2") == 1)
{
AddTimer("ChangeMap_Second_"+RandInt(1, 2), 0, "ChangeMap_Second_1_3");
//IF THE PLAYER PLAYED 1 AND 3, CALL SEPARATE TIMER THAT CHOOSES BETWEEN 1 AND 3//
return;
}
if(GetGlobalVarInt("PlayedFirstPath_3") == 1)
{
AddTimer("ChangeMap_Second_"+RandInt(1, 2), 0, "ChangeMap_Second");
return;
}
//END FOR THE 2ND MAP//
//BEGIN FOR THE 1ST MAP. CHOOSE RANDOM LEVEL//
AddTimer("ChangeMap_First_"+RandInt(1, 3), 0, "ChangeMap_First");
//END FOR THE 1ST MAP//
}
//BGEIN FIRST MAP CHOOSE//
void ChangeMap_First(string &in asTimer)
{
if(asTimer == "ChangeMap_First_1")
{
SetGlobalVarInt("PlayedFirstPath_1", 1);
SetGlobalVarInt("PlayedPath_1", 1);
ChangeMap("Path_1", "PlayerStartArea_1", "", "");
return;
}
if(asTimer == "ChangeMap_First_2")
{
SetGlobalVarInt("PlayedFirstPath_2", 1);
SetGlobalVarInt("PlayedPath_2", 1);
ChangeMap("Path_2", "PlayerStartArea_1", "", "");
return;
}
if(asTimer == "ChangeMap_First_3")
{
SetGlobalVarInt("PlayedFirstPath_3", 1);
SetGlobalVarInt("PlayedPath_3", 1);
ChangeMap("Path_3", "PlayerStartArea_1", "", "");
return;
}
}
//END FIRST MAP CHOOSE//
//BEGIN SECOND MAP CHOOSE//
void ChangeMap_Second(string &in asTimer)
{
if(asTimer == "ChangeMap_Second_1")
{
SetGlobalVarInt("PlayedSecondPath_1", 1);
SetGlobalVarInt("PlayedPath_1", 1);
ChangeMap("Path_1", "PlayerStartArea_1", "", "");
return;
}
if(asTimer == "ChangeMap_Second_2")
{
SetGlobalVarInt("PlayedSecondPath_2", 1);
SetGlobalVarInt("PlayedPath_2", 1);
ChangeMap("Path_2", "PlayerStartArea_1", "", "");
return;
}
if(asTimer == "ChangeMap_Second_3")
{
SetGlobalVarInt("PlayedSecondPath_3", 1);
SetGlobalVarInt("PlayedPath_3", 1);
ChangeMap("Path_3", "PlayerStartArea_1", "", "");
return;
}
}
void ChangeMap_Second_1_3(string &in asTimer)
{
if(asTimer == "ChangeMap_Second_1")
{
AddTimer("ChangeMap_Second_1", 0, "ChangeMap_Second");
return;
}
if(asTimer == "ChangeMap_Second_2")
{
AddTimer("ChangeMap_Second_3", 0, "ChangeMap_Second");
return;
}
}
//END SECOND MAP CHOOSE//