# Get Cloaked Attacker
Grammar — Position of the Nth player|# cloaked attacker
Flags —Native
|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);
# Related
Category: AI Advanced / Tactical / Functions
- Same Command —
bool
— AISameCommand - Last Attacker —
unit
— AILastAttacker - Last Attack —
int
— AILastAttack - Get Wants To Move Status —
bool
— AIControlWantsToMove - Is Ignored By Wave —
bool
— AIIsIgnoredByWave - Is In Combat —
bool
— AIUnitIsInCombat - Get Cloaked Attacker —
point
— AIGetCloakedAttacker - Get Best Target Point On Group —
point
— AIBestTargetPoint - Find Units —
unitgroup
— AIFindUnits - Get Default Combat Priority —
unit
— AIDefaultCombatPriority - Combat Diff Flag Special High Priority —
bool
— AICombatDiffFlagCatSpecialHighPrio - Combat Diff Flag Splash High Priority —
bool
— AICombatDiffFlagCatSplashHighPrio - Combat Diff Flag Timed Low Priority —
bool
— AICombatDiffFlagCatTimedLowPrio - Combat Diff Flag Workers Normal Priority —
bool
— AICombatDiffFlagCatWorkersNormalPrio - Combat Diff Flag Sort Buildings Priority —
bool
— AICombatDiffFlagCatSortBuildingsPrio - Combat Diff Flag Healers —
bool
— AICombatDiffFlagTieBreakHealers - Combat Diff Flag Low Health —
bool
— AICombatDiffFlagTieBreakLowHP - Combat Diff Flag Bonus Damage —
bool
— AICombatDiffFlagTieBreakBonusDamage - Combat Diff Flag Injured —
bool
— AICombatDiffFlagTieBreakInjured - Combat Diff Flag Detector —
bool
— AICombatDiffFlagTieBreakDetector - Combat Diff Flag Siege Range —
bool
— AICombatDiffFlagTieBreakRange - Does Unit Have Tactical Disabled —
bool
— AIIsTacticalDisabled
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/SharedAI.galaxy:9
//--------------------------------------------------------------------------------------------------
bool AINeedsDetection (int player) {
if (AIGetCloakedAttacker(player) != null) {
return true;
}
mods/core.sc2mod — base.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.stormmod — base.stormdata/TriggerLibs/SharedAI.galaxy:9
//--------------------------------------------------------------------------------------------------
bool AINeedsDetection (int player) {
if (AIGetCloakedAttacker(player) != null) {
return true;
}
mods/starcoop/starcoop.sc2mod — base.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.sc2mod — base.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.sc2mod — base.sc2data/TriggerLibs/Tactical/TacticalAIWar3.galaxy:313
return false;
}
loc = AIGetCloakedAttacker(player); // includes unscanned detect beacon
if (loc == null) {
return false;