Skip to content

Commit

Permalink
Encore
Browse files Browse the repository at this point in the history
first v
  • Loading branch information
HTomJMW committed Aug 1, 2018
1 parent 08cdc5c commit 0d2fdfc
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Addons/Strat_mode/Functions/SM_Action_Dismantle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ _caller switchMove animation;
_side= if (_target in (CTI_EAST getVariable ["cti_defences", []])) then { east } else {west};
_maxtime= if (_target in (CTI_P_SideLogic getVariable ["cti_defences", []])) then {7} else {90};

if (_target isKindOf "B_AAA_System_01_F" || _target isKindOf "B_SAM_System_01_F" || _target isKindOf "B_SAM_System_02_F") then {_maxtime = 90};
if (_target isKindOf "B_AAA_System_01_F" || _target isKindOf "B_SAM_System_01_F" || _target isKindOf "B_SAM_System_02_F" || _target isKindOf "B_Radar_System_01_F" || _target isKindOf "B_SAM_System_03_F" || _target isKindOf "O_Radar_System_02_F" || _target isKindOf "O_SAM_System_04_F") then {_maxtime = 90};

while {alive _caller && animationstate _caller == animation &&(getDammage _target) <1 } do {
_target setDamage ((getDammage _target)+1/_maxtime);
Expand Down
2 changes: 1 addition & 1 deletion Client/Functions/Client_PlacingDefense.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ _dir = 0;
_pos = [];
while {!CTI_VAR_StructurePlaced && !CTI_VAR_StructureCanceled} do {
_pos = player modelToWorld [0, _distance_structure + CTI_P_KeyDistance, 0];
CTI_P_PreBuilding_SafePlace = if (_classname == "B_AAA_System_01_F" || _classname == "B_SAM_System_01_F" || _classname == "B_SAM_System_02_F") then {
CTI_P_PreBuilding_SafePlace = if (_classname == "B_AAA_System_01_F" || _classname == "B_SAM_System_01_F" || _classname == "B_SAM_System_02_F" || _classname == "B_Radar_System_01_F" || _classname == "B_SAM_System_03_F" || _classname == "O_Radar_System_02_F" || _classname == "O_SAM_System_04_F") then {
if (_pos distance ([_pos, CTI_P_EnemySide call CTI_CO_FNC_GetSideStructures] call CTI_CO_FNC_GetClosestEntity) >40 && _pos distance (((CTI_P_SideJoined) call CTI_CO_FNC_GetSideLogic) getVariable "cti_hq") >20 && _pos distance ([_pos, CTI_P_SideJoined call CTI_CO_FNC_GetSideStructures] call CTI_CO_FNC_GetClosestEntity) >20 && _pos distance ([_pos, (CTI_P_SideJoined call CTI_CO_FNC_GetSideLogic) getVariable "cti_structures_areas"] call CTI_CO_FNC_GetClosestEntity) >0 && _pos distance ([_pos, (CTI_P_SideJoined call CTI_CO_FNC_GetSideLogic) getVariable "cti_structures_areas"] call CTI_CO_FNC_GetClosestEntity) <250 && _pos distance ( [_pos, ((CTI_P_SideJoined) call CTI_CO_FNC_GetSideLogic) getVariable "cti_structures_wip"] call CTI_CO_FNC_GetClosestEntity) >20 && _pos distance ( [_pos, ((CTI_P_SideJoined) call CTI_CO_FNC_GetSideLogic) getVariable "cti_fobs"] call CTI_CO_FNC_GetClosestEntity) >20 && !surfaceIsWater _pos && !(lineIntersects [ATLtoASL (player modelToWorld (player selectionPosition "pilot")),ATLtoASL (_local modelToWorld (_local selectionPosition "pilot")), player, _local])) then {true} else {false};
} else {
if (_pos distance ([_pos, CTI_P_EnemySide call CTI_CO_FNC_GetSideStructures] call CTI_CO_FNC_GetClosestEntity) >40 && _pos distance (((CTI_P_SideJoined) call CTI_CO_FNC_GetSideLogic) getVariable "cti_hq") >15 && _pos distance ([_pos, CTI_P_SideJoined call CTI_CO_FNC_GetSideStructures] call CTI_CO_FNC_GetClosestEntity) >15 && _pos distance ( [_pos, ((CTI_P_SideJoined) call CTI_CO_FNC_GetSideLogic) getVariable "cti_structures_wip"] call CTI_CO_FNC_GetClosestEntity) >15 && _pos distance ( [_pos, ((CTI_P_SideJoined) call CTI_CO_FNC_GetSideLogic) getVariable "cti_fobs"] call CTI_CO_FNC_GetClosestEntity) >15 && !surfaceIsWater _pos && !(lineIntersects [ATLtoASL (player modelToWorld (player selectionPosition "pilot")),ATLtoASL (_local modelToWorld (_local selectionPosition "pilot")), player, _local])) then {true} else {false};
Expand Down
2 changes: 1 addition & 1 deletion Client/Functions/UI/Functions_UI_ServiceMenu.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ CTI_UI_Service_ProcessRearm = {
_times set [_forEachIndex,_x * CTI_ART_REARM_RATIO];
} forEach _times;
};
if (_unit isKindOf "B_AAA_System_01_F" || _unit isKindOf "B_SAM_System_01_F" || _unit isKindOf "B_SAM_System_02_F") then {
if (_unit isKindOf "B_AAA_System_01_F" || _unit isKindOf "B_SAM_System_01_F" || _unit isKindOf "B_SAM_System_02_F" || _unit isKindOf "B_SAM_System_03_F" || _unit isKindOf "O_SAM_System_04_F") then {
{
_times set [_forEachIndex,_x * 3];
} forEach _times;
Expand Down
12 changes: 12 additions & 0 deletions Common/Config/Base/Base_East.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,18 @@ _prices = _prices + [80000];
_placements = _placements + [[180, 15]];
_categories = _categories + ["Defense"];

_headers = _headers + ["R-750 Cronus Radar - Only on BASE Areas"];
_classes = _classes + ["O_Radar_System_02_F"];
_prices = _prices + [12000];
_placements = _placements + [[180, 15]];
_categories = _categories + ["Defense"];

_headers = _headers + ["S-750 Rhea - Only on BASE Areas"];
_classes = _classes + ["O_SAM_System_04_F"];
_prices = _prices + [40000];
_placements = _placements + [[180, 15]];
_categories = _categories + ["Defense"];

_headers = _headers + ["Lamp"];
_classes = _classes + ["Land_LampHalogen_F"];
_prices = _prices + [5];
Expand Down
12 changes: 12 additions & 0 deletions Common/Config/Base/Base_West.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,18 @@ _prices = _prices + [80000];
_placements = _placements + [[180, 15]];
_categories = _categories + ["Defense"];

_headers = _headers + ["AN/MPQ-105 Radar - Only on BASE Areas"];
_classes = _classes + ["B_Radar_System_01_F"];
_prices = _prices + [12000];
_placements = _placements + [[180, 15]];
_categories = _categories + ["Defense"];

_headers = _headers + ["MIM-145 Defender - Only on BASE Areas"];
_classes = _classes + ["B_SAM_System_03_F"];
_prices = _prices + [40000];
_placements = _placements + [[180, 15]];
_categories = _categories + ["Defense"];

_headers = _headers + ["Lamp"];
_classes = _classes + ["Land_LampHalogen_F"];
_prices = _prices + [5];
Expand Down
9 changes: 9 additions & 0 deletions Server/Functions/Server_BuildDefense.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ if (_defense isKindOf "B_AAA_System_01_F" || _defense isKindOf "B_SAM_System_01_
_defense setPos [_def_pos select 0,_def_pos select 1,(_def_pos select 2) +0.1];
};

if (_defense isKindOf "B_Radar_System_01_F" || _defense isKindOf "B_SAM_System_03_F" || _defense isKindOf "O_Radar_System_02_F" || _defense isKindOf "O_SAM_System_04_F") then {
createVehicleCrew _defense;
_defense joinAsSilent [createGroup _side, 99];
(group _defense) setBehaviour "COMBAT";
(group _defense) setCombatMode "RED";
_defense setVehicleRadar 1;
_defense setVehicleLock "LOCKED";
};


if (missionNamespace getVariable "CTI_TROPHY_APS" == 1) then {
_defense addEventHandler["Fired","_this call TR_HANDLER;"];
Expand Down
6 changes: 3 additions & 3 deletions Server/Functions/Server_HandleStaticDefenses.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ while {! CTI_GAMEOVER} do {


{
if ((_x getVariable ["cti_aman_enabled", false])|| (typeof _x )in ["B_AAA_System_01_F","B_SAM_System_01_F","B_SAM_System_02_F"]) then {
if ((_x getVariable ["cti_aman_enabled", false])|| (typeof _x )in ["B_AAA_System_01_F","B_SAM_System_01_F","B_SAM_System_02_F","B_Radar_System_01_F","B_SAM_System_03_F","O_Radar_System_02_F","O_SAM_System_04_F"]) then {
_defense_team = _logic getVariable "cti_defensive_team";
if (((_x emptyPositions "gunner" > 0)|| (gunner _x ) != (_x getvariable ["CTI_assigned_gunner",objnull]) || ((isnull (_x getvariable ["CTI_assigned_gunner",objnull])) && ! isnull (gunner _x))) && alive _x) then {
_nearest_b = [CTI_BARRACKS, _x, (_side) call CTI_CO_FNC_GetSideStructures, CTI_BASE_DEFENSES_AUTO_REARM_RANGE] call CTI_CO_FNC_GetClosestStructure;
Expand All @@ -55,7 +55,7 @@ while {! CTI_GAMEOVER} do {
_distance = (_var select 4) select 1;
_position = _nearest_b modelToWorld [(sin _direction * _distance), (cos _direction * _distance), 0];

if ((typeof _x )in ["B_AAA_System_01_F","B_SAM_System_01_F","B_SAM_System_02_F"] ) then {
if ((typeof _x )in ["B_AAA_System_01_F","B_SAM_System_01_F","B_SAM_System_02_F","B_Radar_System_01_F","B_SAM_System_03_F","O_Radar_System_02_F","O_SAM_System_04_F"] ) then {
if (isnull (gunner _x) || !alive (gunner _x)) then {
_x deleteVehicleCrew ( gunner _x);
createVehicleCrew _x;
Expand Down Expand Up @@ -116,7 +116,7 @@ while {! CTI_GAMEOVER} do {
diag_log format [":: DEF NG :: %1 of side %2 rearmed", _x,_side];
};
//rearm special Defenenses only ever "_skipRearms" minutes
if((typeof _x )in ["B_AAA_System_01_F","B_SAM_System_01_F","B_SAM_System_02_F"]) then {
if((typeof _x )in ["B_AAA_System_01_F","B_SAM_System_01_F","B_SAM_System_02_F","B_SAM_System_03_F","O_SAM_System_04_F"]) then {
_skippedR = _x getVariable["skipped_rearms", 0];
_x setVariable["skipped_rearms", _skippedR+1];
if(_skippedR >= _skipRearms) then {
Expand Down

0 comments on commit 0d2fdfc

Please sign in to comment.