-
-
Save commy2/4f24be8714f2f998b60f208f916d40ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_this spawn { | |
params [ | |
["_mortar", objNull, [objNull]], | |
["_allSpotters", [], [[]]] | |
]; | |
private _fnc_enemiesKnownByAnySpotter = { | |
private _enemies = allUnits select {side group _x == west}; | |
// all enemies that are ... | |
_enemies select { | |
private _enemy = _x; | |
// ... known by any spotter | |
selectMax (_allSpotters apply {_x knowsAbout _enemy}) > 0.9 | |
} // return | |
}; | |
// wait for at least one spotted target | |
private _targets = []; | |
waitUntil { | |
sleep 10; | |
_targets = call _fnc_enemiesKnownByAnySpotter; | |
!(_targets isEqualTo []) | |
}; | |
private _target = selectRandom _targets; | |
//@todo fire _mortar at _target | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment