// Pie Chart 2 (Pie Chart remake)
//

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <Outpost2DLL.h>
#include <OP2Helper.h>

// Used below to randomize bases
#define numof(array) (sizeof(array)/sizeof(array[0]))
#define autosize(array) numof(array), array

char MapName[]		 = "on6_01.map";
char LevelDesc[]	 = "6P, LoS, 'Pie Chart Remake'";
char TechtreeName[]	 = "MULTITEK.TXT";
SDescBlock DescBlock = { MultiLastOneStanding, 6, 12, 0 };


BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
	if (fdwReason == DLL_PROCESS_ATTACH)
	{
		DisableThreadLibraryCalls(hinstDLL);
	}

    return TRUE;
}

// ---------------------------------------------------------------------------------------------
// Base and Mining Beacon Setup Functions

// Base 1
void SetupBase1(int i)
{
    Player[i].CenterViewOn(30+31, 41-1);
    Unit Unit1;

    // Determine which weapon to use for Guard Posts and Initial Vehicles
    map_id Weapon1 = mapLaser;
    if (Player[i].IsEden() == 0)
    {
        Weapon1 = mapMicrowave;
    }

    // Setup Structures
    TethysGame::CreateUnit(Unit1, mapCommandCenter,    LOCATION(30+31, 41-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapCommonOreSmelter, LOCATION(32+31, 44-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapTokamak,          LOCATION(35+31, 35-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapAgridome,         LOCATION(26+31, 41-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapStandardLab,      LOCATION(34+31, 41-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapStructureFactory, LOCATION(27+31, 44-1), i, mapNone, 0);

    // Set the SF's cargo based on difficulty.
    switch (Player[i].Difficulty() )
    {
        case 0:
            Unit1.SetFactoryCargo(0, mapTokamak, mapNone);
            Unit1.SetFactoryCargo(1, mapNursery, mapNone);
            Unit1.SetFactoryCargo(2, mapUniversity, mapNone);
            Unit1.SetFactoryCargo(3, mapVehicleFactory, mapNone);
            Unit1.SetFactoryCargo(4, mapRobotCommand, mapNone);
            Unit1.SetFactoryCargo(5, mapResidence, mapNone);
            break;
        case 1:
            Unit1.SetFactoryCargo(0, mapTokamak, mapNone);
            Unit1.SetFactoryCargo(1, mapNursery, mapNone);
            Unit1.SetFactoryCargo(2, mapUniversity, mapNone);
            break;
        case 2:
            // Nothing.  How sad.
            break;
    }

    TethysGame::CreateUnit(Unit1, mapGuardPost, LOCATION(45+31, 65-1), i, Weapon1, 0);
    TethysGame::CreateUnit(Unit1, mapGuardPost, LOCATION(16+31, 40-1), i, Weapon1, 0);

    // Setup Vehicles
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(29+31, 46-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(30+31, 46-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(29+31, 45-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(33+31, 46-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(34+31, 45-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(36+31, 44-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    TethysGame::CreateUnit(Unit1, mapRoboSurveyor, LOCATION(25+31, 37-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapEarthworker,  LOCATION(27+31, 38-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapRoboMiner,    LOCATION(26+31, 38-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    // Setup Tubes/Walls
    TethysGame::CreateWallOrTube(16+31, 38-1, -1, mapWall);
    TethysGame::CreateWallOrTube(16+31, 42-1, -1, mapWall);

    // Setup Initial Units
    switch (TethysGame::InitialUnits() )
    {
        case 12:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(34+31, 44-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 11:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(24+31, 33-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 10:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(25+31, 33-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 9:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(34+31, 43-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 8:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(34+31, 42-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 7:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(36+31, 33-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 6:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(35+31, 42-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 5:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(26+31, 34-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 4:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(36+31, 42-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 3:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(25+31, 34-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 2:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(36+31, 43-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 1:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(35+31, 43-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 0:
            break;
    }

} // end SetupBase1

// Base 2
void SetupBase2(int i)
{
    Player[i].CenterViewOn(63+31, 32-1);
    Unit Unit1;

    // Determine which weapon to use for Guard Posts and Initial Vehicles
    map_id Weapon1 = mapLaser;
    if (Player[i].IsEden() == 0)
    {
        Weapon1 = mapMicrowave;
    }

    // Setup Structures
    TethysGame::CreateUnit(Unit1, mapCommandCenter,    LOCATION(63+31, 32-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapCommonOreSmelter, LOCATION(65+31, 35-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapTokamak,          LOCATION(68+31, 26-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapAgridome,         LOCATION(59+31, 32-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapStandardLab,      LOCATION(67+31, 32-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapStructureFactory, LOCATION(60+31, 35-1), i, mapNone, 0);

    // Set the SF's cargo based on difficulty.
    switch (Player[i].Difficulty() )
    {
        case 0:
            Unit1.SetFactoryCargo(0, mapTokamak, mapNone);
            Unit1.SetFactoryCargo(1, mapNursery, mapNone);
            Unit1.SetFactoryCargo(2, mapUniversity, mapNone);
            Unit1.SetFactoryCargo(3, mapVehicleFactory, mapNone);
            Unit1.SetFactoryCargo(4, mapRobotCommand, mapNone);
            Unit1.SetFactoryCargo(5, mapResidence, mapNone);
            break;
        case 1:
            Unit1.SetFactoryCargo(0, mapTokamak, mapNone);
            Unit1.SetFactoryCargo(1, mapNursery, mapNone);
            Unit1.SetFactoryCargo(2, mapUniversity, mapNone);
            break;
        case 2:
            // Nothing.  How sad.
            break;
    }

    TethysGame::CreateUnit(Unit1, mapGuardPost, LOCATION(58+31, 16-1), i, Weapon1, 0);
    TethysGame::CreateUnit(Unit1, mapGuardPost, LOCATION(60+31, 51-1), i, Weapon1, 0);

    // Setup Vehicles
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(62+31, 37-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(63+31, 37-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(62+31, 36-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(66+31, 37-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(67+31, 36-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(69+31, 35-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    TethysGame::CreateUnit(Unit1, mapRoboSurveyor, LOCATION(58+31, 28-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapEarthworker,  LOCATION(59+31, 29-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapRoboMiner,    LOCATION(60+31, 29-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    // Setup Tubes/Walls
    TethysGame::CreateWallOrTube(55+31, 15-1, -1, mapWall);
    TethysGame::CreateWallOrTube(55+31, 16-1, -1, mapWall);
    TethysGame::CreateWallOrTube(56+31, 16-1, -1, mapWall);
    TethysGame::CreateWallOrTube(60+31, 17-1, -1, mapWall);
    TethysGame::CreateWallOrTube(58+31, 51-1, -1, mapWall);
    TethysGame::CreateWallOrTube(62+31, 51-1, -1, mapWall);
    TethysGame::CreateWallOrTube(63+31, 51-1, -1, mapWall);

    // Setup Initial Units
    switch (TethysGame::InitialUnits() )
    {
        case 12:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(64+31, 27-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 11:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(57+31, 26-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 10:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(57+31, 25-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 9:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(69+31, 34-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 8:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(64+31, 28-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 7:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(57+31, 24-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 6:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(68+31, 34-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 5:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(63+31, 28-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 4:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(58+31, 24-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 3:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(59+31, 24-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 2:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(59+31, 25-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 1:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(58+31, 25-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 0:
            break;
    }

} // end SetupBase2

// Base 3
void SetupBase3(int i)
{
    Player[i].CenterViewOn(97+31, 34-1);
    Unit Unit1;

    // Determine which weapon to use for Guard Posts and Initial Vehicles
    map_id Weapon1 = mapLaser;
    if (Player[i].IsEden() == 0)
    {
        Weapon1 = mapMicrowave;
    }

    // Setup Structures
    TethysGame::CreateUnit(Unit1, mapCommandCenter,    LOCATION( 97+31, 34-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapCommonOreSmelter, LOCATION( 97+31, 43-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapTokamak,          LOCATION(106+31, 44-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapAgridome,         LOCATION( 97+31, 37-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapStandardLab,      LOCATION( 97+31, 40-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapStructureFactory, LOCATION(102+31, 35-1), i, mapNone, 0);

    // Set the SF's cargo based on difficulty.
    switch (Player[i].Difficulty() )
    {
        case 0:
            Unit1.SetFactoryCargo(0, mapTokamak, mapNone);
            Unit1.SetFactoryCargo(1, mapNursery, mapNone);
            Unit1.SetFactoryCargo(2, mapUniversity, mapNone);
            Unit1.SetFactoryCargo(3, mapVehicleFactory, mapNone);
            Unit1.SetFactoryCargo(4, mapRobotCommand, mapNone);
            Unit1.SetFactoryCargo(5, mapResidence, mapNone);
            break;
        case 1:
            Unit1.SetFactoryCargo(0, mapTokamak, mapNone);
            Unit1.SetFactoryCargo(1, mapNursery, mapNone);
            Unit1.SetFactoryCargo(2, mapUniversity, mapNone);
            break;
        case 2:
            // Nothing.  How sad.
            break;
    }

    TethysGame::CreateUnit(Unit1, mapGuardPost, LOCATION( 78+31, 60-1), i, Weapon1, 0);
    TethysGame::CreateUnit(Unit1, mapGuardPost, LOCATION(118+31, 33-1), i, Weapon1, 0);

    // Setup Vehicles
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(104+31, 37-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(105+31, 37-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(105+31, 36-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION( 99+31, 45-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(100+31, 44-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(102+31, 45-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    TethysGame::CreateUnit(Unit1, mapRoboSurveyor, LOCATION(100+31, 38-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapEarthworker,  LOCATION(102+31, 38-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapRoboMiner,    LOCATION(101+31, 39-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    // Setup Tubes/Walls
    //TethysGame::CreateWallOrTube(55+31, 15-1, -1, mapWall);

    // Setup Initial Units
    switch (TethysGame::InitialUnits() )
    {
        case 12:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(103+31, 40-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 11:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(105+31, 34-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 10:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(103+31, 41-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 9:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(105+31, 33-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 8:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(106+31, 33-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 7:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(102+31, 41-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 6:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(107+31, 33-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 5:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(106+31, 39-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 4:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(107+31, 34-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 3:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(106+31, 40-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 2:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(106+31, 34-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 1:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(105+31, 40-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 0:
            break;
    }

} // end SetupBase3

// Base 4
void SetupBase4(int i)
{
    Player[i].CenterViewOn(33+31, 92-1);
    Unit Unit1;

    // Determine which weapon to use for Guard Posts and Initial Vehicles
    map_id Weapon1 = mapLaser;
    if (Player[i].IsEden() == 0)
    {
        Weapon1 = mapMicrowave;
    }

    // Setup Structures
    TethysGame::CreateUnit(Unit1, mapCommandCenter,    LOCATION(33+31, 92-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapCommonOreSmelter, LOCATION(30+31, 96-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapTokamak,          LOCATION(38+31, 97-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapAgridome,         LOCATION(29+31, 92-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapStandardLab,      LOCATION(34+31, 89-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapStructureFactory, LOCATION(30+31, 88-1), i, mapNone, 0);

    // Set the SF's cargo based on difficulty.
    // Set the SF's cargo based on difficulty.
    switch (Player[i].Difficulty() )
    {
        case 0:
            Unit1.SetFactoryCargo(0, mapTokamak, mapNone);
            Unit1.SetFactoryCargo(1, mapNursery, mapNone);
            Unit1.SetFactoryCargo(2, mapUniversity, mapNone);
            Unit1.SetFactoryCargo(3, mapVehicleFactory, mapNone);
            Unit1.SetFactoryCargo(4, mapRobotCommand, mapNone);
            Unit1.SetFactoryCargo(5, mapResidence, mapNone);
            break;
        case 1:
            Unit1.SetFactoryCargo(0, mapTokamak, mapNone);
            Unit1.SetFactoryCargo(1, mapNursery, mapNone);
            Unit1.SetFactoryCargo(2, mapUniversity, mapNone);
            break;
        case 2:
            // Nothing.  How sad.
            break;
    }

    TethysGame::CreateUnit(Unit1, mapGuardPost, LOCATION(54+31, 73-1), i, Weapon1, 0);
    TethysGame::CreateUnit(Unit1, mapGuardPost, LOCATION(15+31, 99-1), i, Weapon1, 0);

    // Setup Vehicles
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(31+31, 90-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(32+31, 90-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(32+31, 89-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(28+31, 98-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(31+31, 98-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(32+31, 97-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    TethysGame::CreateUnit(Unit1, mapRoboSurveyor, LOCATION(32+31, 86-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapEarthworker,  LOCATION(27+31, 94-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapRoboMiner,    LOCATION(33+31, 87-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    // Setup Tubes/Walls
    TethysGame::CreateWallOrTube(15+31, 101-1, -1, mapWall);

    // Setup Initial Units
    switch (TethysGame::InitialUnits() )
    {
        case 12:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(33+31, 95-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 11:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(39+31, 91-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 10:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(37+31, 85-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 9:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(38+31, 85-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 8:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(38+31, 86-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 7:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(39+31, 92-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 6:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(38+31, 92-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 5:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(34+31, 95-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 4:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(35+31, 95-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 3:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(35+31, 96-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 2:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(37+31, 86-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 1:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(34+31, 96-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 0:
            break;
    }

} // end SetupBase4

// Base 5
void SetupBase5(int i)
{
    Player[i].CenterViewOn(83+31, 104-1);
    Unit Unit1;

    // Determine which weapon to use for Guard Posts and Initial Vehicles
    map_id Weapon1 = mapLaser;
    if (Player[i].IsEden() == 0)
    {
        Weapon1 = mapMicrowave;
    }

    // Setup Structures
    TethysGame::CreateUnit(Unit1, mapCommandCenter,    LOCATION(83+31, 104-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapCommonOreSmelter, LOCATION(76+31, 107-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapTokamak,          LOCATION(75+31,  98-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapAgridome,         LOCATION(79+31, 104-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapStandardLab,      LOCATION(83+31, 101-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapStructureFactory, LOCATION(83+31, 107-1), i, mapNone, 0);

    // Set the SF's cargo based on difficulty.
    switch (Player[i].Difficulty() )
    {
        case 0:
            Unit1.SetFactoryCargo(0, mapTokamak, mapNone);
            Unit1.SetFactoryCargo(1, mapNursery, mapNone);
            Unit1.SetFactoryCargo(2, mapUniversity, mapNone);
            Unit1.SetFactoryCargo(3, mapVehicleFactory, mapNone);
            Unit1.SetFactoryCargo(4, mapRobotCommand, mapNone);
            Unit1.SetFactoryCargo(5, mapResidence, mapNone);
            break;
        case 1:
            Unit1.SetFactoryCargo(0, mapTokamak, mapNone);
            Unit1.SetFactoryCargo(1, mapNursery, mapNone);
            Unit1.SetFactoryCargo(2, mapUniversity, mapNone);
            break;
        case 2:
            // Nothing.  How sad.
            break;
    }

    TethysGame::CreateUnit(Unit1, mapGuardPost, LOCATION(64+31,  82-1), i, Weapon1, 0);
    TethysGame::CreateUnit(Unit1, mapGuardPost, LOCATION(75+31, 119-1), i, Weapon1, 0);

    // Setup Vehicles
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(77+31, 109-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(78+31, 109-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(78+31, 108-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(82+31, 109-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(84+31, 109-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(80+31, 108-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    TethysGame::CreateUnit(Unit1, mapRoboSurveyor, LOCATION(79+31, 100-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapEarthworker,  LOCATION(79+31,  98-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapRoboMiner,    LOCATION(80+31,  99-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    // Setup Tubes/Walls
    TethysGame::CreateWallOrTube(66+31,  82-1, -1, mapWall);
    TethysGame::CreateWallOrTube(72+31, 119-1, -1, mapWall);
    TethysGame::CreateWallOrTube(73+31, 119-1, -1, mapWall);
    TethysGame::CreateWallOrTube(77+31, 119-1, -1, mapWall);
    TethysGame::CreateWallOrTube(78+31, 119-1, -1, mapWall);

    // Setup Initial Units
    switch (TethysGame::InitialUnits() )
    {
        case 12:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(82+31,  97-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 11:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(82+31,  96-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 10:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(75+31, 101-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 9:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(80+31, 107-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 8:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(76+31, 101-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 7:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(83+31,  96-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 6:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(85+31,  96-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 5:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(84+31,  97-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 4:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(79+31, 107-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 3:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(76+31, 102-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 2:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(83+31,  97-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 1:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(75+31, 102-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 0:
            break;
    }

} // end SetupBase5

// Base 6
void SetupBase6(int i)
{
    Player[i].CenterViewOn(105+31, 82-1);
    Unit Unit1;

    // Determine which weapon to use for Guard Posts and Initial Vehicles
    map_id Weapon1 = mapLaser;
    if (Player[i].IsEden() == 0)
    {
        Weapon1 = mapMicrowave;
    }

    // Setup Structures
    TethysGame::CreateUnit(Unit1, mapCommandCenter,    LOCATION(105+31, 82-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapCommonOreSmelter, LOCATION(105+31, 91-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapTokamak,          LOCATION(114+31, 92-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapAgridome,         LOCATION(105+31, 85-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapStandardLab,      LOCATION(105+31, 88-1), i, mapNone, 0);
    TethysGame::CreateUnit(Unit1, mapStructureFactory, LOCATION(110+31, 83-1), i, mapNone, 0);

    // Set the SF's cargo based on difficulty.
    switch (Player[i].Difficulty() )
    {
        case 0:
            Unit1.SetFactoryCargo(0, mapTokamak, mapNone);
            Unit1.SetFactoryCargo(1, mapNursery, mapNone);
            Unit1.SetFactoryCargo(2, mapUniversity, mapNone);
            Unit1.SetFactoryCargo(3, mapVehicleFactory, mapNone);
            Unit1.SetFactoryCargo(4, mapRobotCommand, mapNone);
            Unit1.SetFactoryCargo(5, mapResidence, mapNone);
            break;
        case 1:
            Unit1.SetFactoryCargo(0, mapTokamak, mapNone);
            Unit1.SetFactoryCargo(1, mapNursery, mapNone);
            Unit1.SetFactoryCargo(2, mapUniversity, mapNone);
            break;
        case 2:
            // Nothing.  How sad.
            break;
    }

    TethysGame::CreateUnit(Unit1, mapGuardPost, LOCATION( 78+31,  69-1), i, Weapon1, 0);
    TethysGame::CreateUnit(Unit1, mapGuardPost, LOCATION(120+31, 84-1), i, Weapon1, 0);

    // Setup Vehicles
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(112+31, 85-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(113+31, 85-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapConVec, LOCATION(113+31, 86-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(107+31, 93-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(108+31, 92-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapCargoTruck, LOCATION(110+31, 93-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    TethysGame::CreateUnit(Unit1, mapRoboSurveyor, LOCATION(108+31, 86-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapEarthworker,  LOCATION(110+31, 86-1), i, mapNone, 0);
        Unit1.DoSetLights(1);
    TethysGame::CreateUnit(Unit1, mapRoboMiner,    LOCATION(109+31, 87-1), i, mapNone, 0);
        Unit1.DoSetLights(1);

    // Setup Tubes/Walls
    TethysGame::CreateWallOrTube(120+31,  82-1, -1, mapWall);
    TethysGame::CreateWallOrTube(120+31,  86-1, -1, mapWall);
    TethysGame::CreateWallOrTube(120+31,  87-1, -1, mapWall);

    // Setup Initial Units
    switch (TethysGame::InitialUnits() )
    {
        case 12:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(110+31, 88-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 11:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(113+31, 82-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 10:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(114+31, 88-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 9:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(113+31, 81-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 8:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(111+31, 88-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 7:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(114+31, 81-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 6:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(115+31, 81-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 5:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(115+31, 82-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 4:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(113+31, 88-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 3:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(111+31, 89-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 2:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(110+31, 89-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 1:
            TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(114+31, 82-1), i, Weapon1, 0);
                Unit1.DoSetLights(1);
        case 0:
            break;
    }

} // end SetupBase6

// Randomize Player Starting Locations
void DoRandomBases()
{
    // Randomized Base code.
    int i[6] = { 0, 1, 2, 3, 4, 5 };
    RandomizeList(autosize(i) );

    // Create bases - check to make sure owner is active first!
    if (Player[i[0]].IsHuman() )
    {
        SetupBase1(i[0]);
    }

    if (Player[i[1]].IsHuman() )
    {
        SetupBase2(i[1]);
    }

    if (Player[i[2]].IsHuman()  )
    {
        SetupBase3(i[2]);
    }

    if (Player[i[3]].IsHuman()  )
    {
        SetupBase4(i[3]);
    }

    if (Player[i[4]].IsHuman()  )
    {
        SetupBase5(i[4]);
    }

    if (Player[i[5]].IsHuman()  )
    {
        SetupBase6(i[5]);
    }

}   // end DoRandomBases

void SetupMiningLocations()
{
    // Common Ore Mines
    TethysGame::CreateBeacon(mapMiningBeacon,  36+31,  54-1, 0, 1, 1);    // Base 1
    TethysGame::CreateBeacon(mapMiningBeacon,  61+31,  44-1, 0, 1, 1);    // Base 2
    TethysGame::CreateBeacon(mapMiningBeacon,  99+31,  52-1, 0, 1, 1);    // Base 3
    TethysGame::CreateBeacon(mapMiningBeacon,  29+31, 106-1, 0, 1, 1);    // Base 4
    TethysGame::CreateBeacon(mapMiningBeacon,  81+31, 115-1, 0, 1, 1);    // Base 5
    TethysGame::CreateBeacon(mapMiningBeacon, 107+31,  99-1, 0, 1, 1);    // Base 6

    // Rare Ore Mines
    TethysGame::CreateBeacon(mapMiningBeacon,  27+31,  29-1, 1, 2, 1);    // Base 1
    TethysGame::CreateBeacon(mapMiningBeacon,  50+31,  17-1, 1, 2, 1);    // Base 2
    TethysGame::CreateBeacon(mapMiningBeacon, 102+31,  23-1, 1, 2, 1);    // Base 3
    TethysGame::CreateBeacon(mapMiningBeacon,  25+31,  82-1, 1, 2, 1);    // Base 4
    TethysGame::CreateBeacon(mapMiningBeacon,  83+31,  91-1, 1, 2, 1);    // Base 5
    TethysGame::CreateBeacon(mapMiningBeacon, 114+31,  73-1, 1, 2, 1);    // Base 6

    TethysGame::CreateBeacon(mapMiningBeacon, 66+31, 65-1, 1, 0, 1);
    TethysGame::CreateBeacon(mapMiningBeacon, 66+31, 68-1, 1, 0, 1);

    // Random Mines
    TethysGame::CreateBeacon(mapMiningBeacon,  77+31,   6-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon, 126+31,  42-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon, 126+31,  16-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon, 116+31,   7-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon,  63+31, 126-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon,   9+31,  16-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon,  39+31,   5-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon, 102+31,   6-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon, 126+31,  95-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon, 101+31, 126-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon,  21+31, 120-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon,   4+31,  87-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon,   5+31,  64-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon,   5+31,  47-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon, 126+31,  71-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon, 114+31, 114-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon, 126+31, 105-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon,  47+31, 114-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon,   9+31, 110-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon, 126+31,  42-1, -1, -1, 1);
    TethysGame::CreateBeacon(mapMiningBeacon,  20+31,  16-1, -1, -1, 1);

    // Fumaroles
    TethysGame::CreateBeacon(mapFumarole,  40+31,  42-1, -1, -1, -1);    // Base 1 (#1)
    TethysGame::CreateBeacon(mapFumarole,  35+31,  62-1, -1, -1, -1);    // Base 1 (#2)

    TethysGame::CreateBeacon(mapFumarole,  53+31,  46-1, -1, -1, -1);    // Base 2 (#1)
    TethysGame::CreateBeacon(mapFumarole,  70+31,  40-1, -1, -1, -1);    // Base 2 (#2)

    TethysGame::CreateBeacon(mapFumarole,  89+31,  26-1, -1, -1, -1);    // Base 3 (#1)
    TethysGame::CreateBeacon(mapFumarole,  82+31,  57-1, -1, -1, -1);    // Base 3 (#2)

    TethysGame::CreateBeacon(mapFumarole,  19+31,  81-1, -1, -1, -1);    // Base 4 (#1)
    TethysGame::CreateBeacon(mapFumarole,  50+31,  85-1, -1, -1, -1);    // Base 4 (#2)

    TethysGame::CreateBeacon(mapFumarole,  66+31, 101-1, -1, -1, -1);    // Base 5 (#1)
    TethysGame::CreateBeacon(mapFumarole,  88+31, 114-1, -1, -1, -1);    // Base 5 (#2)

    TethysGame::CreateBeacon(mapFumarole,  94+31,  90-1, -1, -1, -1);    // Base 6 (#1)
    TethysGame::CreateBeacon(mapFumarole,  99+31,  74-1, -1, -1, -1);    // Base 6 (#2)

    TethysGame::CreateBeacon(mapFumarole,  10+31,  64-1, -1, -1, -1);
    TethysGame::CreateBeacon(mapFumarole,  60+31,  67-1, -1, -1, -1);
    TethysGame::CreateBeacon(mapFumarole,  56+31, 121-1, -1, -1, -1);
    TethysGame::CreateBeacon(mapFumarole, 120+31,  60-1, -1, -1, -1);

    // Create the all-important inaccessible Fumarole on the mountaintop near Base 1.
    // It's so cute!  Uhh, I mean... What a waste!
    TethysGame::CreateBeacon(mapFumarole, 23+31, 68-1, -1, -1, -1);

    // Magma Vents
    TethysGame::CreateBeacon(mapMagmaVent,   2+31,  37-1, -1, -1, -1);
    TethysGame::CreateBeacon(mapMagmaVent,   2+31,  83-1, -1, -1, -1);
    TethysGame::CreateBeacon(mapMagmaVent,  38+31,   2-1, -1, -1, -1);
    TethysGame::CreateBeacon(mapMagmaVent,  98+31,   7-1, -1, -1, -1);
    TethysGame::CreateBeacon(mapMagmaVent, 127+31,  32-1, -1, -1, -1);
    TethysGame::CreateBeacon(mapMagmaVent,  17+31, 125-1, -1, -1, -1);


} // end SetupMiningLocations
// ---------------------------------------------------------------------------------------------
int InitProc()
{
	// Setup Morale
	TethysGame::FreeMoraleLevel(-1);            // Set morale unsteady if Morale Steady off
	if (TethysGame::UsesMorale() == 1)
	{
	    TethysGame::ForceMoraleGood(-1);        // Lock morale at 75 for all players if Morale Steady on
	}

	// Setup Day/Night
	TethysGame::SetDaylightEverywhere(1);       // Turn on perma-day if Day/Night off
	if (TethysGame::UsesDayNight() == 1)
	{
	    TethysGame::SetDaylightEverywhere(0);   // But turn it off if Day/Night is on
        TethysGame::SetDaylightMoves(1);        // Also make the daylight move
	}

	// Setup Disasters
	if (TethysGame::CanHaveDisasters() == 1)
	{
        // Create a short-duration vortex every 140~160 marks
	    CreateTimeTrigger(1, 0, 14000, 16000, "Vortex");
	}

    // Setup Initial Resources
    for (int i = 0; i < TethysGame::NoPlayers(); i++)
    {
        InitPlayerResources(i);		// Sets up "standard" resources (idententical to original Dynamix games)
    }

	// Create Player Bases
	DoRandomBases();

	// Create Mining Beacons, Fumaroles, and Magma Vents
    SetupMiningLocations();

	// Setup Victory Conditions comment this line out to test in debug mode)
	CreateLastOneStandingVictoryCondition();

	return 1; // return 1 if OK; 0 on failure
} // end InitProc

void AIProc()
{
    // Nothing in AIProc today...
}

// ---------------------------------------------------------------------------------------------
// Disasters

SCRIPT_API void Vortex()
{
    // Pie Chart's disasters are kinda disappointing...
    TethysGame::SetTornado(TethysGame::GetRand(128)+31, TethysGame::GetRand(128)+31,
                           TethysGame::GetRand(6)+3, TethysGame::GetRand(128)+31,
                           TethysGame::GetRand(128)+31, 0);

	// Notice how I split this up over multiple lines?  A "line" of code can stetch over multiple lines of text!

} // end Vortex

// end Disasters
// ---------------------------------------------------------------------------------------------

void __cdecl GetSaveRegions(struct BufferDesc &bufDesc)
{
	bufDesc.bufferStart = 0;	// Pointer to a buffer that needs to be saved
	bufDesc.length = 0;			// sizeof(buffer)
}

int StatusProc()
{
	return 0; // must return 0
}

SCRIPT_API void None()
{
}

