# AIDefenseThreat

FlagsNative

# Arguments

  • int — type
  • int — player
  • wave — w

Returns — bool

native bool AIDefenseThreat(int type, int player, wave w);

Category: Unclassified

# Examples

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

    fixed threatEval = 0;
    
    if (!AIDefenseThreat(c_dtRealSelfThreat | c_dtIncludeCantAttack, player, c_nullWave)) {
        return false;
    }

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

    fixed threatEval = 0;
    
    if (!AIDefenseThreat(c_dtRealSelfThreat | c_dtIncludeCantAttack, player, c_nullWave)) {
        return false;
    }

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

void DebugWave (int player, string name, wave w) {
    string threat;
    if (AIDefenseThreat(c_dtAnyThreat, player, w)) {
        threat = "true";
    }

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

    }

    if (AIDefenseThreat(c_dtAnyThreat, player, w)) {
        AIDefendSelfWithWave(player, w);
    }

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

    }

    if (AIDefenseThreat(c_dtAnyThreat, player, w)) {
        AIDefendSelfWithWave(player, w);
        return;

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

            return;
        }
        if (AIDefenseThreat(c_dtRealThreat, player, w)) {
            AIDefendSelfWithWave(player, w);
            return;

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

    obsLife = UnitGetPropertyInt(obstruction, c_unitPropLifePercent, c_unitPropCurrent);
    if (obsLife > 15) {
        if (AIDefenseThreat(c_dtRealThreat, player, w)) {
            AIDefendSelfWithWave(player, w);
            return;

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

    }

    if (AIDefenseThreat(c_dtRealSelfThreat, player, w)) {
        return true;
    }

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

    fixed defenseEval = 0;
    
    if (!AIDefenseThreat(c_dtRealSelfThreat | c_dtIncludeCantAttack, player, c_nullWave)) {
        return false;
    }

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

    fixed threatEval = 0;
    
    if (!AIDefenseThreat(c_dtRealSelfThreat | c_dtIncludeCantAttack, player, c_nullWave)) {
        return false;
    }

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

    fixed threatEval = 0;
    
    if (!AIDefenseThreat(c_dtRealSelfThreat | c_dtIncludeCantAttack, player, c_nullWave)) {
        return false;
    }

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:533

    fixed defenseEval = 0;
    
    if (!AIDefenseThreat(c_dtRealSelfThreat | c_dtIncludeCantAttack, player, c_nullWave)) {
        return false;
    }