# AIGetUserInt

FlagsNative

# Arguments

  • int — player
  • int — index

Returns — int

native int AIGetUserInt(int player, int index);

Category: Unclassified

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeBuildAI.galaxy:130

    // only set the build menu if it wasn't from the player
    if (!PlayerBeaconBuildMenuWasFromPlayer(player, c_buildMenuOpening)) {
        currentOpening = AIGetUserInt(player, c_openingBuildType);

        if (currentOpening == e_buildType_Rush) {

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeBuildAI.galaxy:176

    // only set the build menu if it wasn't from the player
    if (!PlayerBeaconBuildMenuWasFromPlayer(player, c_buildMenuLateGame)) {
        currentLateGame = AIGetUserInt(player, c_lateGameBuildType);

        if (currentLateGame == e_buildType_HighTech) {

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeBuildAI.galaxy:206

    
    // air map default logic
    if (AIGetUserInt(player, c_numGroundStartLocs) == 0) {
        AISetUserInt(player, c_openingBuildType, e_buildType_Air);
        AISetUserInt(player, c_lateGameBuildType, e_buildType_Air);

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeBuildAI.galaxy:299


        if (aicommBuild == e_buildType_Macro) {
            if (AIGetUserInt(player, c_numGroundStartLocs) == 0) {
                // macro on an air map = air
                aicommBuild = e_buildType_Air;

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeBuildAI.galaxy:410

//--------------------------------------------------------------------------------------------------
void AIChooseNextOpeningBuild (int player) {
    int currentOpening = AIGetUserInt(player, c_openingBuildType);
    int currentBuildIndex = AIGetUserInt(player, c_currentBuildIndex);
    int playerChosenBuild;

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeBuildAI.galaxy:411

void AIChooseNextOpeningBuild (int player) {
    int currentOpening = AIGetUserInt(player, c_openingBuildType);
    int currentBuildIndex = AIGetUserInt(player, c_currentBuildIndex);
    int playerChosenBuild;
    int buildType;

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeBuildAI.galaxy:417

    // first see if the player has chosen a specific build
    AISetNextBuildFromPlayerInput(player);
    playerChosenBuild = AIGetUserInt(player, c_openingBuildType);

    // if it wasn't overriden by the player, preserve our existing opening build

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeBuildAI.galaxy:429

    
    // if we haven't choosen an opening build type, do so now
    if (AIGetUserInt(player, c_openingBuildType) == e_buildType_Invalid) {
        if (AIGetCoopFlag(player, c_coopTraining)) {
            AISetUserInt(player, c_openingBuildType, e_buildType_Timing);

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeBuildAI.galaxy:540


    // if the player hasn't choosen a late game build type, do so now
    if (AIGetUserInt(player, c_lateGameBuildType) == e_buildType_Invalid) {
        randomRoll = RandomInt(1, 100);

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeBuildAI.galaxy:572

    if (PlayerBeaconBuildMenuWasFromPlayer(player, c_buildMenuOpening)) {
        aicommBuild = AIGetOpeningScriptTypeFromBuildMenu(player);
        if (aicommBuild != e_buildType_Invalid && aicommBuild != AIGetUserInt(player, c_openingBuildType)) {
            return true;
        }

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeHighAI.galaxy:225

    int race;
    
    if (AIGetUserInt(player, c_numGroundStartLocs) == 0) {
        AISetFlag(player, e_flagsEarlyDefScout, false);
        AIEarlyDefenseEnable(player, false, false);

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeHighAI.galaxy:241

                enableScouting = true;
            }
            else if (AIGetUserInt(player, c_numGroundStartLocs) > 0) {
                if (time > 150) {
                    // scout around just to be safe

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeLowAI.galaxy:49


    while (index < c_ldMaxArmyStockSize) {
        count = AIGetUserInt(player, index);
        if (count <= 0) {
            break;

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeLowAI.galaxy:64

    }
    if (index >= c_ldMaxArmyStockSize) {
        if (AIGetUserInt(player, index) > 0) {
            ErrorMeleeScript(player, "AISetStockArmy too much data");
        }

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeLowAI.galaxy:80


    while (index < c_ldMaxArmyStockSize) {
        count = AIGetUserInt(player, index);
        if (count <= 0) {
            break;

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeLowAI.galaxy:94

    }
    if (index >= c_ldMaxArmyStockSize) {
        if (AIGetUserInt(player, index) > 0) {
            ErrorMeleeScript(player, "AISetStockArmy too much data");
        }

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeLowAI.galaxy:114


    if (AIState(player, e_mainState) == e_mainState_Open) {
        if (AIGetUserInt(player, c_openingBuildType) == e_buildType_Macro) {
            // macro build doesn't attack between open & mid
            sendAttack = false;

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeLowAI.galaxy:279

int AIGetArmyDelay (int player, int duration, int phase) {
    int armyCount = AIGetStockArmyCount(player);
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int timePerUnit;

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeLowAI.galaxy:314


void AISetupNextArmy (int player, int buildType, int newPhase, funcref<TemplateArmySetup> armyFunc ) {
    int origPhase = AIGetUserInt(player, c_ldNextArmyPhase);
    int origDuration = AIGetUserInt(player, c_ldNextArmyDuration);
    int origEndTime = AIGetUserInt(player, c_nextArmyTime);

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeLowAI.galaxy:315

void AISetupNextArmy (int player, int buildType, int newPhase, funcref<TemplateArmySetup> armyFunc ) {
    int origPhase = AIGetUserInt(player, c_ldNextArmyPhase);
    int origDuration = AIGetUserInt(player, c_ldNextArmyDuration);
    int origEndTime = AIGetUserInt(player, c_nextArmyTime);
    int origStartTime = 0;

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeLowAI.galaxy:316

    int origPhase = AIGetUserInt(player, c_ldNextArmyPhase);
    int origDuration = AIGetUserInt(player, c_ldNextArmyDuration);
    int origEndTime = AIGetUserInt(player, c_nextArmyTime);
    int origStartTime = 0;
    fixed origTimeElapsed = 0.0;

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:760

        count = AIWaveUnitCount(w) + AIWaveUnitCount(AIWaveGet(player, c_waveMain));

        if ((AIWaveGetTimeSinceRetreat(w) > 120) && (AIGetUserInt(player, c_delayNextAttack) < AIGetTime())) {            
            // if we're allowed to attack && we've waited at least 120 seonds after retreating, consider attacking

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossChIn.galaxy:49

    UpdateHDProtossOpening(player);
    
    buildIndex = AIGetUserInt(player, c_currentBuildIndex);
    if (buildIndex == e_hdBuildIndex_POpenRush_ZealotStalker)               { done = ProtossOpenRushZealotStalkerChIn (player); }
    else if (buildIndex == e_hdBuildIndex_POpenRush_ProxyGate)              { done = ProtossOpenRushProxyGateChIn (player); }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossChIn.galaxy:78

    
    // enable scouting as appropriate
    if (AIGetUserInt(player, c_numGroundStartLocs) > 0) {
        AIScoutingEnable(player, 15, c_PU_Probe);
        AIEarlyDefenseScouting(player);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossChIn.galaxy:89

    UpdateHDProtossMidGame(player);
    
    buildIndex = AIGetUserInt(player, c_currentBuildIndex);
    if (buildIndex == e_hdBuildIndex_PMidRushTiming_FourGateRobo)           { done = ProtossMidRushTimingFourGateRoboChIn (player); }
    else if (buildIndex == e_hdBuildIndex_PMidRushTiming_DefensiveExpand)   { done = ProtossMidRushTimingDefensiveExpandChIn (player); }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossChIn.galaxy:2112


// On an air map build at least one transport as long as we have some other units/army
    if (AIGetUserInt(player, c_numGroundStartLocs) == 0) {
        AISetStock( player, 1, c_PU_WarpPrism );
    }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossChRe.galaxy:19

    UpdateHDProtossOpening(player);
    
    buildIndex = AIGetUserInt(player, c_currentBuildIndex);
    if (buildIndex == e_hdBuildIndex_POpenRush_ZealotStalker)               { done = ProtossOpenRushZealotStalkerVyHd (player); }
    else if (buildIndex == e_hdBuildIndex_POpenRush_ProxyGate)              { done = ProtossOpenRushProxyGateVyHd (player); }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossChRe.galaxy:48

    
    // enable scouting as appropriate
    if (AIGetUserInt(player, c_numGroundStartLocs) > 0) {
        AIScoutingEnable(player, 15, c_PU_Probe);
        AIEarlyDefenseScouting(player);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossChRe.galaxy:59

    UpdateHDProtossMidGame(player);
    
    buildIndex = AIGetUserInt(player, c_currentBuildIndex);
    if (buildIndex == e_hdBuildIndex_PMidRushTiming_FourGateRobo)           { done = ProtossMidRushTimingFourGateRoboVyHd (player); }
    else if (buildIndex == e_hdBuildIndex_PMidRushTiming_DefensiveExpand)   { done = ProtossMidRushTimingDefensiveExpandVyHd (player); }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossChVi.galaxy:19

    UpdateHDProtossOpening(player);
    
    buildIndex = AIGetUserInt(player, c_currentBuildIndex);
    if (buildIndex == e_hdBuildIndex_POpenRush_ZealotStalker)               { done = ProtossOpenRushZealotStalkerVyHd (player); }
    else if (buildIndex == e_hdBuildIndex_POpenRush_ProxyGate)              { done = ProtossOpenRushProxyGateVyHd (player); }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossChVi.galaxy:48

    
    // enable scouting as appropriate
    if (AIGetUserInt(player, c_numGroundStartLocs) > 0) {
        AIScoutingEnable(player, 15, c_PU_Probe);
        AIEarlyDefenseScouting(player);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossChVi.galaxy:59

    UpdateHDProtossMidGame(player);
    
    buildIndex = AIGetUserInt(player, c_currentBuildIndex);
    if (buildIndex == e_hdBuildIndex_PMidRushTiming_FourGateRobo)           { done = ProtossMidRushTimingFourGateRoboVyHd (player); }
    else if (buildIndex == e_hdBuildIndex_PMidRushTiming_DefensiveExpand)   { done = ProtossMidRushTimingDefensiveExpandVyHd (player); }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossEasy.galaxy:13


    if (phase < c_ldPhaseLate) {
        buildType = AIGetUserInt(player, c_openingBuildType);
    } else {
        buildType = AIGetUserInt(player, c_lateGameBuildType);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossEasy.galaxy:15

        buildType = AIGetUserInt(player, c_openingBuildType);
    } else {
        buildType = AIGetUserInt(player, c_lateGameBuildType);
    }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossEasy.galaxy:131


    AIChooseNextOpeningBuild(player);
    buildType = AIGetUserInt(player, c_openingBuildType);
    AISetupNextArmy (player, buildType, c_ldPhaseOpen, ProtossOpenArmyInitEasy);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossEasy.galaxy:141

//--------------------------------------------------------------------------------------------------
void ProtossOpenBuildEasy (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossEasy.galaxy:142

void ProtossOpenBuildEasy (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossEasy.galaxy:143

    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossEasy.galaxy:338


    AIChooseNextOpeningBuild(player);
    buildType = AIGetUserInt(player, c_openingBuildType);
    AISetupNextArmy (player, buildType, c_ldPhaseMid, ProtossMidArmyInitEasy);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossEasy.galaxy:352

//--------------------------------------------------------------------------------------------------
void ProtossMidBuildEasy (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossEasy.galaxy:353

void ProtossMidBuildEasy (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossEasy.galaxy:354

    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHard.galaxy:13


    if (phase < c_ldPhaseLate) {
        buildType = AIGetUserInt(player, c_openingBuildType);
    } else {
        buildType = AIGetUserInt(player, c_lateGameBuildType);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHard.galaxy:15

        buildType = AIGetUserInt(player, c_openingBuildType);
    } else {
        buildType = AIGetUserInt(player, c_lateGameBuildType);
    }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHard.galaxy:257


    AIChooseNextOpeningBuild(player);
    buildType = AIGetUserInt(player, c_openingBuildType);
    AISetupNextArmy (player, buildType, c_ldPhaseOpen, ProtossOpenArmyInitHard);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHard.galaxy:267

//--------------------------------------------------------------------------------------------------
void ProtossOpenBuildHard (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHard.galaxy:268

void ProtossOpenBuildHard (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHard.galaxy:269

    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHard.galaxy:543


    AIChooseNextOpeningBuild(player);
    buildType = AIGetUserInt(player, c_openingBuildType);
    AISetupNextArmy (player, buildType, c_ldPhaseMid, ProtossMidArmyInitHard);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHard.galaxy:557

//--------------------------------------------------------------------------------------------------
void ProtossMidBuildHard (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHard.galaxy:558

void ProtossMidBuildHard (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHard.galaxy:559

    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHdVH.galaxy:49

    UpdateHDProtossOpening(player);
    
    buildIndex = AIGetUserInt(player, c_currentBuildIndex);
    if (buildIndex == e_hdBuildIndex_POpenRush_ZealotStalker)               { done = ProtossOpenRushZealotStalkerHdVH (player); }
    else if (buildIndex == e_hdBuildIndex_POpenRush_ProxyGate)              { done = ProtossOpenRushProxyGateHdVH (player); }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHdVH.galaxy:78

    
    // enable scouting as appropriate
    if (AIGetUserInt(player, c_numGroundStartLocs) > 0) {
        AIScoutingEnable(player, 15, c_PU_Probe);
        AIEarlyDefenseScouting(player);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHdVH.galaxy:89

    UpdateHDProtossMidGame(player);
    
    buildIndex = AIGetUserInt(player, c_currentBuildIndex);
    if (buildIndex == e_hdBuildIndex_PMidRushTiming_FourGateRobo)           { done = ProtossMidRushTimingFourGateRoboHdVH (player); }
    else if (buildIndex == e_hdBuildIndex_PMidRushTiming_DefensiveExpand)   { done = ProtossMidRushTimingDefensiveExpandHdVH (player); }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHdVH.galaxy:2111


// On an air map build at least one transport as long as we have some other units/army
    if (AIGetUserInt(player, c_numGroundStartLocs) == 0) {
        AISetStock( player, 1, c_PU_WarpPrism );
    }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHigh.galaxy:309

int OpenChooseHDProtossCounterBuild (int player, bool onlyMustSwitch) {
    // counter logic is primarily aimed at 1v1 games and does not consider allies under attack etc
    int currentOpening = AIGetUserInt(player, c_openingBuildType);
    int lobbyBuild = PlayerAIBuildNumber(player);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHigh.galaxy:316

        return e_buildType_Invalid;
    }
    if (AIGetUserInt(player, c_specificLobbyBuild) != e_buildType_Invalid) {
        return e_buildType_Invalid;
    }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHigh.galaxy:338

    else if (currentOpening == e_buildType_Timing) {
        if (AIHighCurrentlyUnderHeavyAttack(player))  {
            if (AIGetUserInt(player, c_currentBuildIndex) == e_hdBuildIndex_POpenTiming_DTRush) {
                if (AITechCount(player, c_PB_DarkShrine, c_techCountInProgressOrBetter) <= 0) {
                    // unless we're close to getting dt, switch to four gate

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHigh.galaxy:344

                }
            }
            else if (AIGetUserInt(player, c_currentBuildIndex) == e_hdBuildIndex_POpenTiming_StalkerBlink) {
                if (AITechCount(player, c_PR_StalkerBlink, c_techCountInProgressOrBetter) <= 0) {
                    // unless we're close to getting blink, switch to four gate

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHigh.galaxy:355

        if (AIIsExpandingOrHasExpanded(player)) {
            // if we've already expanded, just stick with a power build, but use the defensive one
            if (AIGetUserInt(player, c_currentBuildIndex) != e_hdBuildIndex_POpenPowerMacro_DefenseExpGnd) {
                return e_hdBuildIndex_POpenPowerMacro_DefenseExpGnd;
            }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHigh.galaxy:446

int MidChooseHDProtossCounterBuild (int player, bool onlyMustSwitch) {
    // counter logic is primarily aimed at 1v1 games and does not consider allies under attack etc
    int currentOpening = AIGetUserInt(player, c_openingBuildType);
    int currentExactBuild = AIGetUserInt(player, c_currentBuildIndex);
    int lobbyBuild = PlayerAIBuildNumber(player);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHigh.galaxy:447

    // counter logic is primarily aimed at 1v1 games and does not consider allies under attack etc
    int currentOpening = AIGetUserInt(player, c_openingBuildType);
    int currentExactBuild = AIGetUserInt(player, c_currentBuildIndex);
    int lobbyBuild = PlayerAIBuildNumber(player);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHigh.galaxy:454

        return e_buildType_Invalid;
    }
    if (AIGetUserInt(player, c_specificLobbyBuild) != e_buildType_Invalid) {
        return e_buildType_Invalid;
    }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHigh.galaxy:517

int LateChooseHDProtossCounterBuild (int player, bool onlyMustSwitch) {
    // counter logic is primarily aimed at 1v1 games and does not consider allies under attack etc
    int currentLateGame = AIGetUserInt(player, c_lateGameBuildType);
    int currentBuildIndex = AIGetUserInt(player, c_currentBuildIndex);
    int newLateGame = e_buildType_Core;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHigh.galaxy:518

    // counter logic is primarily aimed at 1v1 games and does not consider allies under attack etc
    int currentLateGame = AIGetUserInt(player, c_lateGameBuildType);
    int currentBuildIndex = AIGetUserInt(player, c_currentBuildIndex);
    int newLateGame = e_buildType_Core;
    bool needsNewBuild = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMdHd.galaxy:13


    if (phase < c_ldPhaseLate) {
        buildType = AIGetUserInt(player, c_openingBuildType);
    } else {
        buildType = AIGetUserInt(player, c_lateGameBuildType);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMdHd.galaxy:15

        buildType = AIGetUserInt(player, c_openingBuildType);
    } else {
        buildType = AIGetUserInt(player, c_lateGameBuildType);
    }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMdHd.galaxy:222


    AIChooseNextOpeningBuild(player);
    buildType = AIGetUserInt(player, c_openingBuildType);
    AISetupNextArmy (player, buildType, c_ldPhaseOpen, ProtossOpenArmyInitMdHd);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMdHd.galaxy:232

//--------------------------------------------------------------------------------------------------
void ProtossOpenBuildMdHd (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMdHd.galaxy:233

void ProtossOpenBuildMdHd (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMdHd.galaxy:234

    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMdHd.galaxy:505


    AIChooseNextOpeningBuild(player);
    buildType = AIGetUserInt(player, c_openingBuildType);
    AISetupNextArmy (player, buildType, c_ldPhaseMid, ProtossMidArmyInitMdHd);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMdHd.galaxy:519

//--------------------------------------------------------------------------------------------------
void ProtossMidBuildMdHd (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMdHd.galaxy:520

void ProtossMidBuildMdHd (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMdHd.galaxy:521

    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMedi.galaxy:13


    if (phase < c_ldPhaseLate) {
        buildType = AIGetUserInt(player, c_openingBuildType);
    } else {
        buildType = AIGetUserInt(player, c_lateGameBuildType);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMedi.galaxy:15

        buildType = AIGetUserInt(player, c_openingBuildType);
    } else {
        buildType = AIGetUserInt(player, c_lateGameBuildType);
    }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMedi.galaxy:188


    AIChooseNextOpeningBuild(player);
    buildType = AIGetUserInt(player, c_openingBuildType);
    AISetupNextArmy (player, buildType, c_ldPhaseOpen, ProtossOpenArmyInitMedi);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMedi.galaxy:198

//--------------------------------------------------------------------------------------------------
void ProtossOpenBuildMedi (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMedi.galaxy:199

void ProtossOpenBuildMedi (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMedi.galaxy:200

    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMedi.galaxy:418


    AIChooseNextOpeningBuild(player);
    buildType = AIGetUserInt(player, c_openingBuildType);
    AISetupNextArmy (player, buildType, c_ldPhaseMid, ProtossMidArmyInitMedi);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMedi.galaxy:432

//--------------------------------------------------------------------------------------------------
void ProtossMidBuildMedi (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMedi.galaxy:433

void ProtossMidBuildMedi (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossMedi.galaxy:434

    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossVyEy.galaxy:13


    if (phase < c_ldPhaseLate) {
        buildType = AIGetUserInt(player, c_openingBuildType);
    } else {
        buildType = AIGetUserInt(player, c_lateGameBuildType);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossVyEy.galaxy:15

        buildType = AIGetUserInt(player, c_openingBuildType);
    } else {
        buildType = AIGetUserInt(player, c_lateGameBuildType);
    }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossVyEy.galaxy:113


    AIChooseNextOpeningBuild(player);
    buildType = AIGetUserInt(player, c_openingBuildType);
    AISetupNextArmy (player, buildType, c_ldPhaseOpen, ProtossOpenArmyInitVyEy);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossVyEy.galaxy:123

//--------------------------------------------------------------------------------------------------
void ProtossOpenBuildVyEy (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossVyEy.galaxy:124

void ProtossOpenBuildVyEy (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossVyEy.galaxy:125

    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossVyEy.galaxy:305


    AIChooseNextOpeningBuild(player);
    buildType = AIGetUserInt(player, c_openingBuildType);
    AISetupNextArmy (player, buildType, c_ldPhaseMid, ProtossMidArmyInitVyEy);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossVyEy.galaxy:319

//--------------------------------------------------------------------------------------------------
void ProtossMidBuildVyEy (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossVyEy.galaxy:320

void ProtossMidBuildVyEy (int player) {
    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossVyEy.galaxy:321

    int buildType = AIGetUserInt(player, c_openingBuildType);
    int armyRoll = AIGetUserInt(player, c_ldNextArmyRoll);
    int timeOut = AIGetUserInt(player, c_nextArmyTime);
    bool nextState = false;

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossVyHd.galaxy:82

    UpdateHDProtossOpening(player);
    
    buildIndex = AIGetUserInt(player, c_currentBuildIndex);
    if (buildIndex == e_hdBuildIndex_POpenRush_ZealotStalker)               { done = ProtossOpenRushZealotStalkerVyHd (player); }
    else if (buildIndex == e_hdBuildIndex_POpenRush_ProxyGate)              { done = ProtossOpenRushProxyGateVyHd (player); }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossVyHd.galaxy:111

    
    // enable scouting as appropriate
    if (AIGetUserInt(player, c_numGroundStartLocs) > 0) {
        AIScoutingEnable(player, 15, c_PU_Probe);
        AIEarlyDefenseScouting(player);

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossVyHd.galaxy:122

    UpdateHDProtossMidGame(player);
    
    buildIndex = AIGetUserInt(player, c_currentBuildIndex);
    if (buildIndex == e_hdBuildIndex_PMidRushTiming_FourGateRobo)           { done = ProtossMidRushTimingFourGateRoboVyHd (player); }
    else if (buildIndex == e_hdBuildIndex_PMidRushTiming_DefensiveExpand)   { done = ProtossMidRushTimingDefensiveExpandVyHd (player); }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossVyHd.galaxy:2142


// On an air map build at least one transport as long as we have some other units/army
    if (AIGetUserInt(player, c_numGroundStartLocs) == 0) {
        AISetStock( player, 1, c_PU_WarpPrism );
    }