# Get Cloaked Attacker

Grammar — Position of the Nth player|# cloaked attacker
FlagsNative | Function

Returns the position of the last attack from a cloaked unit against a player specified by the Player parameter.

# Arguments

  • int — Player

Returns — point

native point AIGetCloakedAttacker(int p);

Category: AI Advanced / Tactical / Functions

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/SharedAI.galaxy:9

//--------------------------------------------------------------------------------------------------
bool AINeedsDetection (int player) {
    if (AIGetCloakedAttacker(player) != null) {
        return true;
    }

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1057

    //  If something is attacking while cloaked and we can defend if we reveal it, cast sweep.
    //
    loc = AIGetCloakedAttacker(player);  // includes unscanned detect beacon
    if (loc == null) {
        return false;

mods/core.stormmodbase.stormdata/TriggerLibs/SharedAI.galaxy:9

//--------------------------------------------------------------------------------------------------
bool AINeedsDetection (int player) {
    if (AIGetCloakedAttacker(player) != null) {
        return true;
    }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:13087

        if (auto3F461774_var < 0) { break; }
        lv_aIHasSeenCloakedUnit = AISawCloakedUnit(auto3F461774_var);
        lv_cloakedAttacker_Current = AIGetCloakedAttacker(auto3F461774_var);
        if (((lv_aIHasSeenCloakedUnit == true) || (lv_cloakedAttacker_Current != null) || (libCOMI_gf_AISuspectDetectionDanger(auto3F461774_var) == true))) {
            libCOMI_gv_cM_CoopAI_AIDetection_Build = true;

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1037

    //  If something is attacking while cloaked and we can defend if we reveal it, cast sweep.
    //
    loc = AIGetCloakedAttacker(player);  // includes unscanned detect beacon
    if (loc == null) {
        return false;

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/Tactical/TacticalAIWar3.galaxy:313

        return false;
    }
    loc = AIGetCloakedAttacker(player);  // includes unscanned detect beacon
    if (loc == null) {
        return false;