-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
1,929 additions
and
585 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
/* | ||
Author: Genesis | ||
Description: | ||
Orders group to clear building | ||
Parameter(s): | ||
0: GROUP - Clearing group | ||
1: OBJECT - Enemy to clear out | ||
Returns: | ||
STRING | ||
*/ | ||
|
||
params ["_group","_enemy"]; | ||
|
||
private _building = (nearestObject [_enemy, "House"]); | ||
|
||
private _buildingPositions = [_building] call BIS_fnc_buildingPositions; | ||
|
||
// Not enterable | ||
if (count _buildingPositions < 3) exitWith {}; | ||
|
||
private _bbr = boundingBoxReal _building; // TODO: Replace 'boundingBoxReal' with '0 BoundingBoxReal' on devbranch | ||
private _p1 = _bbr select 0; | ||
private _p2 = _bbr select 1; | ||
// Check if unit is inside of the closest building | ||
if | ||
!( | ||
_enemy inArea | ||
[ | ||
getPos _building, // Center of building | ||
(abs ((_p2 select 0) - (_p1 select 0)) / 2), // Maximum Width / 2 | ||
(abs ((_p2 select 1) - (_p1 select 1)) / 2), // Maximum Length / 2 | ||
getDir _building, // Building facing | ||
true // Is rectangular | ||
] | ||
) exitWith {}; | ||
|
||
if VCM_Debug then {systemChat format ["VCOM: %1 clearing out %2", _group, _enemy]}; | ||
|
||
private _finalPositions = []; | ||
_finalPositions = (_buildingPositions inAreaArray [getPosATL _enemy, 3, 3, 0, false, 1.5]); | ||
|
||
if (_finalPositions isEqualTo []) then | ||
{ | ||
// Settle for the three closest | ||
private _temp = [_buildingPositions, [], {_x distance _enemy}] call BIS_fnc_sortBy; | ||
for "_i" from 0 to 2 do {_finalPositions pushBack (_temp select _i)}; | ||
}; | ||
|
||
{ | ||
doStop _x; | ||
_x doMove selectRandom _finalPositions; | ||
} foreach (units _group); |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
Author: Freddo | ||
Description: | ||
Makes unit request support. | ||
Parameter(s): | ||
GROUP - Group that is requesting support. | ||
Returns: | ||
BOOLEAN | ||
*/ | ||
|
||
private _group = _this; | ||
private _leader = leader _group; | ||
private _rtrn = false; | ||
|
||
if (!(_group call VCM_fnc_GroupHasRadio) || _group getVariable ["VCM_TOUGHSQUAD", false]) exitWith {_rtrn}; | ||
|
||
// Calculate enemy forces value | ||
private _knownEnemyG = ([_leader, 500, false] call VCM_fnc_KnownEnemyGroupArray); | ||
private _enemyValue = 0; | ||
{ | ||
_enemyValue = _enemyValue + (_x call VCM_fnc_GroupValue); | ||
}forEach _knownEnemyG; | ||
|
||
// Add a bit of +- inaccuracy | ||
_enemyValue = (_enemyValue * (0.75 + random 0.5)); | ||
|
||
// Calculate friendly forces value in vincinity | ||
private _knownFriendlyG = ([_leader, false, 500] call VCM_fnc_FriendlyGroupArray); | ||
private _friendlyValue = 0; | ||
{ | ||
_friendlyValue = _friendlyValue + (_x call VCM_fnc_GroupValue); | ||
}forEach _knownFriendlyG; | ||
|
||
// Friendly forces are superior to enemies | ||
if ((_friendlyValue * 1.25) > _enemyValue) exitWith {_rtrn}; | ||
|
||
if VCM_DEBUG then {systemChat format ["VCOM: %1 calling for support", _group]}; | ||
|
||
// Find eligible groups | ||
private _targetValue = (_enemyValue - (_friendlyValue * 1.25)); | ||
private _eligibleSquads = []; | ||
private _eligibleSquadsValue = 0; | ||
{ | ||
if (_eligibleSquadsValue > _targetValue) exitWith {}; | ||
if (_x call VCM_fnc_CanReinforce) then | ||
{ | ||
_eligibleSquadsValue = (_eligibleSquadsValue + (_x call VCM_fnc_GroupValue)); | ||
_eligibleSquads pushBack _x; | ||
}; | ||
} forEach ([_leader, true, VCM_WARNDIST] call VCM_fnc_FriendlyGroupArray); | ||
|
||
if (count _eligibleSquads isEqualTo 0) exitWith {_rtrn}; | ||
|
||
//Create waypoints | ||
{ | ||
if !(_x call VCM_fnc_CheckSituation isEqualTo "REINFORCE") then { | ||
private _leader = leader _x; | ||
if VCM_DEBUG then {systemChat format ["VCOM: %1 moving to reinforce %2", _x, _group]}; | ||
private _wp = (_x addWaypoint [position _leader, 100]); | ||
_wp setWaypointSpeed "FULL"; | ||
if (behaviour _leader isEqualTo "SAFE") then {_x setBehaviour "AWARE"}; | ||
[_x, "REINFORCE"] call VCM_fnc_SetSituation; | ||
}; | ||
}forEach _eligibleSquads; | ||
_rtrn = true; | ||
_rtrn |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.