This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
forked from official-antistasi-community/A3-Antistasi
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enemy near changes (official-antistasi-community#2381)
* added parameter * using the Parameter instead of constants * needs to be an array * review changes * weird gitness * garage enemyNearCheck changed * review changes, removed getPos * review changes, remove return * review changes, remove 0 * review changes, combined enemiesEngaging and enemyNear * added getPosATL to objects
- Loading branch information
1 parent
c4bfd45
commit 89f4e8a
Showing
11 changed files
with
52 additions
and
22 deletions.
There are no files selected for viewing
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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,30 @@ | ||
private ["_unit","_dist","_return"]; | ||
_unit = _this select 0; | ||
_dist = _this select 1; | ||
_return = false; | ||
{if (_x distance _unit < _dist) exitWith {_return = true}} forEach (allUnits select {((side group _x == Occupants) or (side group _x == Invaders)) and ([_x] call A3A_fnc_canFight)}); | ||
_return | ||
/* | ||
Author: [A3A Team] | ||
Enemy near searches | ||
Arguments: | ||
0.<ANY> location/postion that will be used for the center of search | ||
Return Value: | ||
<BOOL> if enemies are near | ||
Scope: Clients | ||
Environment: Unscheduled | ||
Public: yes | ||
Dependencies: | ||
Example: | ||
[cursorObject] call A3A_fnc_enemyNearCheck; | ||
*/ | ||
|
||
params ["_unitPos"]; | ||
|
||
|
||
|
||
private _nearEnemies = (units Occupants + units Invaders) inAreaArray [_unitPos, enemyNearDistance, enemyNearDistance]; | ||
_nearEnemies = _nearEnemies select { behaviour _x == "COMBAT" and _x call A3A_fnc_canFight }; | ||
|
||
|
||
(_nearEnemies isNotEqualTo []) | ||
|
||
|
||
|
||
|
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 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 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 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 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 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