IED count has now a civil reputation dependency

This commit is contained in:
Christian 2017-09-27 12:37:49 +02:00
parent 4d277843bf
commit 9acc878b78
3 changed files with 40 additions and 26 deletions

View File

@ -1,7 +1,7 @@
params [ "_sector", "_radius", "_number" ];
private [ "_activation_radius_infantry", "_activation_radius_vehicles", "_spread", "_infantry_trigger", "_ultra_strong", "_vehicle_trigger", "_ied_type", "_ied_obj", "_roadobj", "_goes_boom"];
params ["_sector", "_radius", "_number"];
private ["_activation_radius_infantry", "_activation_radius_vehicles", "_spread", "_infantry_trigger", "_ultra_strong", "_vehicle_trigger", "_ied_type", "_ied_obj", "_roadobj", "_goes_boom"];
if ( _number <= 0 ) exitWith {};
if (_number <= 0) exitWith {};
_number = round _number;
@ -9,33 +9,33 @@ _activation_radius_infantry = 6.66;
_activation_radius_vehicles = 10;
_spread = 7;
_infantry_trigger = 2 + (floor (random 3));
_infantry_trigger = 1 + (ceil (random 2));
_ultra_strong = false;
if ( random 100 < 12 ) then {
if (random 100 < 12) then {
_ultra_strong = true;
};
_vehicle_trigger = 1;
_ied_type = [ "IEDLandBig_F","IEDLandSmall_F","IEDUrbanBig_F","IEDUrbanSmall_F" ] call BIS_fnc_selectRandom;
_ied_type = ["IEDLandBig_F","IEDLandSmall_F","IEDUrbanBig_F","IEDUrbanSmall_F"] call BIS_fnc_selectRandom;
_ied_obj = objNull;
_roadobj = [ [ getmarkerpos (_sector), random(_radius), random(360) ] call BIS_fnc_relPos, _radius, [] ] call BIS_fnc_nearestRoad;
_roadobj = [[getmarkerpos (_sector), random (_radius), random (360)] call BIS_fnc_relPos, _radius, []] call BIS_fnc_nearestRoad;
_goes_boom = false;
if (_number > 0) then {
[ _sector, _radius, _number - 1 ] spawn ied_manager;
[_sector, _radius, _number - 1] spawn ied_manager;
};
if ( !(isnull _roadobj) ) then {
if (!(isnull _roadobj)) then {
_roadpos = getpos _roadobj;
_ied_obj = createMine [ _ied_type, [ _roadpos, _spread, random(360) ] call BIS_fnc_relPos, [], 0];
_ied_obj = createMine [_ied_type, [_roadpos, _spread, random (360)] call BIS_fnc_relPos, [], 0];
_ied_obj setdir (random 360);
while { _sector in active_sectors && mineActive _ied_obj && !_goes_boom } do {
_nearinfantry = [ (getpos _ied_obj) nearEntities [ "Man", _activation_radius_infantry ] , { side _x == GRLIB_side_friendly } ] call BIS_fnc_conditionalSelect;
_nearvehicles = [ (getpos _ied_obj) nearEntities [ [ "Car", "Tank", "Air" ], _activation_radius_vehicles ] , { side _x == GRLIB_side_friendly } ] call BIS_fnc_conditionalSelect;
if ( count _nearinfantry >= _infantry_trigger || count _nearvehicles >= _vehicle_trigger ) then {
if ( _ultra_strong ) then {
while {_sector in active_sectors && mineActive _ied_obj && !_goes_boom} do {
_nearinfantry = [(getpos _ied_obj) nearEntities ["Man", _activation_radius_infantry] , {side _x == GRLIB_side_friendly}] call BIS_fnc_conditionalSelect;
_nearvehicles = [(getpos _ied_obj) nearEntities [["Car", "Tank", "Air"], _activation_radius_vehicles] , {side _x == GRLIB_side_friendly}] call BIS_fnc_conditionalSelect;
if (count _nearinfantry >= _infantry_trigger || count _nearvehicles >= _vehicle_trigger) then {
if (_ultra_strong) then {
"Bomb_04_F" createVehicle (getpos _ied_obj);
deleteVehicle _ied_obj;
} else {
@ -50,4 +50,4 @@ if ( !(isnull _roadobj) ) then {
sleep 1800;
if ( !(isNull _ied_obj) ) then { deleteVehicle _ied_obj; };
if (!(isNull _ied_obj)) then {deleteVehicle _ied_obj;};

View File

@ -56,10 +56,14 @@ if ( (!(_sector in blufor_sectors)) && ( ( [ getmarkerpos _sector , [ _opforcou
_spawncivs = true;
_building_ai_max = round (50 * _popfactor) ;
_building_range = 110;
_building_range = 200;
_local_capture_size = _local_capture_size * 1.4;
_iedcount = (2 + (floor (random 4))) * GRLIB_difficulty_modifier;
if ( _iedcount > 10 ) then { _iedcount = 10 };
if (KP_liberation_civ_rep < 0) then {
_iedcount = round (2 + (ceil (random 4)) * (round ((KP_liberation_civ_rep * -1) / 33)) * GRLIB_difficulty_modifier);
} else {
_iedcount = 0;
};
if (_iedcount > 16) then {_iedcount = 16};
};
if ( _sector in sectors_capture ) then {
_vehtospawn = [];
@ -69,9 +73,13 @@ if ( (!(_sector in blufor_sectors)) && ( ( [ getmarkerpos _sector , [ _opforcou
if((random 100) > (33 / GRLIB_difficulty_modifier)) then { _vehtospawn pushback (militia_vehicles call BIS_fnc_selectRandom); };
_spawncivs = true;
_building_ai_max = round ((floor (18 + (round (combat_readiness / 10 )))) * _popfactor);
_building_range = 70;
_iedcount = (floor (random 4)) * GRLIB_difficulty_modifier;
if ( _iedcount > 7 ) then { _iedcount = 7 };
_building_range = 120;
if (KP_liberation_civ_rep < 0) then {
_iedcount = round ((ceil (random 4)) * (round ((KP_liberation_civ_rep * -1) / 33)) * GRLIB_difficulty_modifier);
} else {
_iedcount = 0;
};
if (_iedcount > 12) then {_iedcount = 12};
};
if ( _sector in sectors_military ) then {
_infsquad = "csat";
@ -89,7 +97,7 @@ if ( (!(_sector in blufor_sectors)) && ( ( [ getmarkerpos _sector , [ _opforcou
if((random 100) > (66 / GRLIB_difficulty_modifier)) then { _vehtospawn pushback ( [] call F_getAdaptiveVehicle ); };
_spawncivs = false;
_building_ai_max = round ((floor (18 + (round (combat_readiness / 4 )))) * _popfactor);
_building_range = 110;
_building_range = 120;
};
if ( _sector in sectors_factory ) then {
_vehtospawn = [];
@ -102,9 +110,13 @@ if ( (!(_sector in blufor_sectors)) && ( ( [ getmarkerpos _sector , [ _opforcou
if((random 100) > 33) then { _vehtospawn pushback (militia_vehicles call BIS_fnc_selectRandom); };
_spawncivs = false;
_building_ai_max = round ((floor (18 + (round (combat_readiness / 10 )))) * _popfactor);
_building_range = 100;
_iedcount = (floor (random 3)) * GRLIB_difficulty_modifier;
if ( _iedcount > 5 ) then { _iedcount = 5 };
_building_range = 120;
if (KP_liberation_civ_rep < 0) then {
_iedcount = round ((ceil (random 3)) * (round ((KP_liberation_civ_rep * -1) / 33)) * GRLIB_difficulty_modifier);
} else {
_iedcount = 0;
};
if (_iedcount > 8) then {_iedcount = 8};
};
if ( _sector in sectors_tower ) then {
_spawncivs = false;
@ -169,6 +181,7 @@ if ( (!(_sector in blufor_sectors)) && ( ( [ getmarkerpos _sector , [ _opforcou
_managed_units = _managed_units + ( [ _sector ] call F_spawnCivilians );
};
if (KP_liberation_debug) then {private _text = format ["[KP LIBERATION] [IED] Sector: %1 (%2) - Range: %3 - Count: %4", _sector, (markerText _sector), _building_range, _iedcount];_text remoteExec ["diag_log",2];};
[ _sector, _building_range, _iedcount ] spawn ied_manager;
sleep 10;

View File

@ -184,6 +184,7 @@ class Missions
* Tweaked: Removed the logistic convoy cap of 26 (which was due to the alphabet).
* Tweaked: Captured enemy vehicles are now also listed in the commanders zeus interface.
* Tweaked: Cities won't be able to produce resources anymore.
* Tweaked: IED count in cities, capitals and factories is now dependend on the civil reputation.
* Fixed: Player got custom recoil and aiming coefficients on respawn.
* Fixed: Rare script error on closing respawn screen directly after joining the mission.
* Fixed: Players could deploy multiple FOBs when they selected deploy fast enough on the same container.