# AIHasNearbyOpenExpansion

FlagsNative

# Arguments

  • int — player

Returns — bool

native bool AIHasNearbyOpenExpansion(int player);

Category: Unclassified

# Examples

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

    if (enemyRace == c_raceMulti) {
        // multiple opponents
        if (!AIHasNearbyOpenExpansion(player)) {
            // no nearby expansion, avoid macro & power builds
            if (AIGetNumTeams() > 2) {

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

    else {
        // single opponent
        if (!AIHasNearbyOpenExpansion(player)) {
            // no nearby expansion, avoid macro & power builds
            rushChance      = 5;

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


    if (!AIIsExpandingOrHasExpanded(player)) {
        if (!AIHasNearbyOpenExpansion(player)) {
            return false;
        }

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


    if (!AIIsExpandingOrHasExpanded(player)) {
        if (!AIHasNearbyOpenExpansion(player)) {
            return false;
        }

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


    if (!AIIsExpandingOrHasExpanded(player)) {
        if (!AIHasNearbyOpenExpansion(player)) {
            return false;
        }

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


    if (!AIIsExpandingOrHasExpanded(player)) {
        if (!AIHasNearbyOpenExpansion(player)) {
            return false;
        }

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


    if (!AIIsExpandingOrHasExpanded(player)) {
        if (!AIHasNearbyOpenExpansion(player)) {
            return false;
        }

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


    if (!AIIsExpandingOrHasExpanded(player)) {
        if (!AIHasNearbyOpenExpansion(player)) {
            return false;
        }

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

        AISetSubStateChanceRace( e_hdBuildIndex_POpenPowerMacro_DefenseExpGnd,  20,    20,    20,    20 ); // 100, 100, 100, 100
    } else if (openingType == e_buildType_Air) {
        if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, go for a one base attack
            AISetSubStateChance( e_hdBuildIndex_POpenAir_OneBaseAir,        70 ); //   70

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

            AISetSubStateChance( e_hdBuildIndex_PMidAir_Macro,               40 ); //  100
        }
        else if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, continue to be a bit more aggressive
            AISetSubStateChance( e_hdBuildIndex_PMidAir_ExpansionVoidray,     30 ); //   30

mods/liberty.sc2modbase.sc2data/TriggerLibs/Terran/TerranHigh.galaxy:197

        AISetSubStateChanceRace( e_hdBuildIndex_TOpenPowerMacro_DefenseExpGnd,  20,    20,    20,    20 ); // 100, 100, 100, 100
    } else if (openingType == e_buildType_Air) {
        if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, go for a one base attack
            AISetSubStateChance( e_hdBuildIndex_TOpenAir_OneBaseAir,        50 ); //   50

mods/liberty.sc2modbase.sc2data/TriggerLibs/Terran/TerranHigh.galaxy:254

            AISetSubStateChance( e_hdBuildIndex_TMidAir_Macro,                      40 ); //  100
        }
        else if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, continue to be a bit more aggressive
            AISetSubStateChance( e_hdBuildIndex_TMidAir_ExpansionVikingBanshee,     30 ); //   30

mods/liberty.sc2modbase.sc2data/TriggerLibs/Zerg/ZergHigh.galaxy:186

        AISetSubStateChance( e_hdBuildIndex_ZOpenPowerMacro_DefenseExpGnd,  60 ); //  100
    } else if (openingType == e_buildType_Air) {
        if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, go for a one base attack
            AISetSubStateChance( e_hdBuildIndex_ZOpenAir_OneBaseMuta,       70 ); //   70

mods/liberty.sc2modbase.sc2data/TriggerLibs/Zerg/ZergHigh.galaxy:237

            AISetSubStateChance( e_hdBuildIndex_ZMidAir_Macro,              40 ); //  100
        }
        else if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, continue to be a bit more aggressive
            AISetSubStateChance( e_hdBuildIndex_ZMidAir_ExpansionMuta,      30 ); //   30

mods/swarm.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHigh.galaxy:196

        AISetSubStateChanceRace( e_hdBuildIndex_POpenPowerMacro_DefenseExpGnd,  20,    20,    20,    20 ); // 100, 100, 100, 100
    } else if (openingType == e_buildType_Air) {
        if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, go for a one base attack
            AISetSubStateChance( e_hdBuildIndex_POpenAir_OneBaseAir,        70 ); //   70

mods/swarm.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHigh.galaxy:246

            AISetSubStateChance( e_hdBuildIndex_PMidAir_Macro,               40 ); //  100
        }
        else if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, continue to be a bit more aggressive
            AISetSubStateChance( e_hdBuildIndex_PMidAir_ExpansionVoidray,     30 ); //   30

mods/swarm.sc2modbase.sc2data/TriggerLibs/Terran/TerranHigh.galaxy:197

        AISetSubStateChanceRace( e_hdBuildIndex_TOpenPowerMacro_DefenseExpGnd,  20,    20,    20,    20 ); // 100, 100, 100, 100
    } else if (openingType == e_buildType_Air) {
        if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, go for a one base attack
            AISetSubStateChance( e_hdBuildIndex_TOpenAir_OneBaseAir,        50 ); //   50

mods/swarm.sc2modbase.sc2data/TriggerLibs/Terran/TerranHigh.galaxy:254

            AISetSubStateChance( e_hdBuildIndex_TMidAir_Macro,                      40 ); //  100
        }
        else if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, continue to be a bit more aggressive
            AISetSubStateChance( e_hdBuildIndex_TMidAir_ExpansionVikingBanshee,     30 ); //   30

mods/swarm.sc2modbase.sc2data/TriggerLibs/Zerg/ZergHigh.galaxy:188

        AISetSubStateChance( e_hdBuildIndex_ZOpenPowerMacro_DefenseExpGnd,  60 ); //  100
    } else if (openingType == e_buildType_Air) {
        if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, go for a one base attack
            AISetSubStateChance( e_hdBuildIndex_ZOpenAir_OneBaseMuta,       70 ); //   70

mods/swarm.sc2modbase.sc2data/TriggerLibs/Zerg/ZergHigh.galaxy:239

            AISetSubStateChance( e_hdBuildIndex_ZMidAir_Macro,              40 ); //  100
        }
        else if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, continue to be a bit more aggressive
            AISetSubStateChance( e_hdBuildIndex_ZMidAir_ExpansionMuta,      30 ); //   30

mods/void.sc2modbase.sc2data/TriggerLibs/MeleeHighAI.galaxy:336


    if (!AIIsExpandingOrHasExpanded(player)) {
        if (!AIHasNearbyOpenExpansion(player)) {
            return false;
        }

mods/void.sc2modbase.sc2data/TriggerLibs/MeleeHighAI.galaxy:373


    if (!AIIsExpandingOrHasExpanded(player)) {
        if (!AIHasNearbyOpenExpansion(player)) {
            return false;
        }

mods/void.sc2modbase.sc2data/TriggerLibs/MeleeHighAI.galaxy:410


    if (!AIIsExpandingOrHasExpanded(player)) {
        if (!AIHasNearbyOpenExpansion(player)) {
            return false;
        }

mods/void.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHigh.galaxy:201

        AISetSubStateChanceRace( e_hdBuildIndex_POpenPowerMacro_DefenseExpGnd,  20,    20,    20,    20 ); // 100, 100, 100, 100
    } else if (openingType == e_buildType_Air) {
        if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, go for a one base attack
            AISetSubStateChance( e_hdBuildIndex_POpenAir_OneBaseAir,        70 ); //   70

mods/void.sc2modbase.sc2data/TriggerLibs/Protoss/ProtossHigh.galaxy:251

            AISetSubStateChance( e_hdBuildIndex_PMidAir_Macro,               40 ); //  100
        }
        else if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, continue to be a bit more aggressive
            AISetSubStateChance( e_hdBuildIndex_PMidAir_ExpansionVoidray,     30 ); //   30

mods/void.sc2modbase.sc2data/TriggerLibs/Terran/TerranHigh.galaxy:199

        AISetSubStateChanceRace( e_hdBuildIndex_TOpenPowerMacro_DefenseExpGnd,  20,    20,    20,    20 ); // 100, 100, 100, 100
    } else if (openingType == e_buildType_Air) {
        if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, go for a one base attack
            AISetSubStateChance( e_hdBuildIndex_TOpenAir_OneBaseAir,        50 ); //   50

mods/void.sc2modbase.sc2data/TriggerLibs/Terran/TerranHigh.galaxy:256

            AISetSubStateChance( e_hdBuildIndex_TMidAir_Macro,                      40 ); //  100
        }
        else if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, continue to be a bit more aggressive
            AISetSubStateChance( e_hdBuildIndex_TMidAir_ExpansionVikingBanshee,     30 ); //   30

mods/void.sc2modbase.sc2data/TriggerLibs/Zerg/ZergHigh.galaxy:194

        AISetSubStateChance( e_hdBuildIndex_ZOpenPowerMacro_DefenseExpGnd,  60 ); //  100
    } else if (openingType == e_buildType_Air) {
        if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, go for a one base attack
            AISetSubStateChance( e_hdBuildIndex_ZOpenAir_OneBaseMuta,       70 ); //   70

mods/void.sc2modbase.sc2data/TriggerLibs/Zerg/ZergHigh.galaxy:246

            AISetSubStateChance( e_hdBuildIndex_ZMidAir_Macro,              40 ); //  100
        }
        else if (!AIHasNearbyOpenExpansion(player) && !AIIsExpandingOrHasExpanded(player)) {
            // can't easily expand, continue to be a bit more aggressive
            AISetSubStateChance( e_hdBuildIndex_ZMidAir_ExpansionMuta,      30 ); //   30