Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enemy near changes #2381

Merged
8 changes: 4 additions & 4 deletions A3A/addons/core/functions/Base/fn_flagaction.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ switch _typeX do
};
case "unit":
{
_flag addAction ["Unit Recruitment", {if ([player,300] call A3A_fnc_enemyNearCheck) then {["Unit Recruitment", "You cannot recruit units while there are enemies near you."] call A3A_fnc_customHint;} else { [] spawn A3A_fnc_unit_recruit; };},nil,0,false,true,"","(isPlayer _this) and (_this == _this getVariable ['owner',objNull])",4]
_flag addAction ["Unit Recruitment", {if ([player, enemyNearDistance] call A3A_fnc_enemyNearCheck) then {["Unit Recruitment", "You cannot recruit units while there are enemies near you."] call A3A_fnc_customHint;} else { [] spawn A3A_fnc_unit_recruit; };},nil,0,false,true,"","(isPlayer _this) and (_this == _this getVariable ['owner',objNull])",4]
};
case "vehicle":
{
_flag addAction ["Buy Vehicle", {if ([player,300] call A3A_fnc_enemyNearCheck) then {
_flag addAction ["Buy Vehicle", {if ([player, enemyNearDistance] call A3A_fnc_enemyNearCheck) then {
["Buy Vehicle", "You cannot buy vehicles while there are enemies near you."] call A3A_fnc_customHint;
} else {
if (A3A_GUIDevPreview) then {
Expand Down Expand Up @@ -147,8 +147,8 @@ switch _typeX do
if (true) exitWith { ERROR("Disabled due to UseDoomGUI Switch.") };
#endif
removeAllActions _flag;
_flag addAction ["Unit Recruitment", {if ([player,300] call A3A_fnc_enemyNearCheck) then {["Unit Recruitment", "You cannot recruit units while there are enemies near you."] call A3A_fnc_customHint;} else { [] spawn A3A_fnc_unit_recruit; };},nil,0,false,true,"","(isPlayer _this) and (_this == _this getVariable ['owner',objNull])",4];
_flag addAction ["Buy Vehicle", {if ([player,300] call A3A_fnc_enemyNearCheck) then {
_flag addAction ["Unit Recruitment", {if ([player, enemyNearDistance] call A3A_fnc_enemyNearCheck) then {["Unit Recruitment", "You cannot recruit units while there are enemies near you."] call A3A_fnc_customHint;} else { [] spawn A3A_fnc_unit_recruit; };},nil,0,false,true,"","(isPlayer _this) and (_this == _this getVariable ['owner',objNull])",4];
_flag addAction ["Buy Vehicle", {if ([player, enemyNearDistance] call A3A_fnc_enemyNearCheck) then {
["Buy Vehicle", "You cannot buy vehicles while there are enemies near you."] call A3A_fnc_customHint;
} else {
if (A3A_GUIDevPreview) then {
Expand Down
6 changes: 3 additions & 3 deletions A3A/addons/core/functions/Dialogs/fn_fastTravelRadio.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ if (!isNil "A3A_FFPun_Jailed" && {(getPlayerUID player) in A3A_FFPun_Jailed}) ex

_checkX = false;
//_distanceX = 500 - (([_boss,false] call A3A_fnc_fogCheck) * 450);
_distanceX = 500;
//_distanceX = 500; dead code now
killerswin2 marked this conversation as resolved.
Show resolved Hide resolved

{if ([_x,_distanceX] call A3A_fnc_enemyNearCheck) exitWith {_checkX = true}} forEach units _groupX;
{if ([_x, enemyNearDistance] call A3A_fnc_enemyNearCheck) exitWith {_checkX = true}} forEach units _groupX;

if (_checkX) exitWith {["Fast Travel", "You cannot Fast Travel with enemies near the group."] call A3A_fnc_customHint;};

Expand Down Expand Up @@ -54,7 +54,7 @@ if (count _positionTel > 0) then

//if (_base in outpostsFIA) exitWith {hint "You cannot Fast Travel to roadblocks and watchposts"; openMap [false,false]};

if ([getMarkerPos _base,500] call A3A_fnc_enemyNearCheck) exitWith {["Fast Travel", "You cannot Fast Travel to an area under attack or with enemies in the surrounding."] call A3A_fnc_customHint; openMap [false,false]};
if ([getMarkerPos _base, enemyNearDistance] call A3A_fnc_enemyNearCheck) exitWith {["Fast Travel", "You cannot Fast Travel to an area under attack or with enemies in the surrounding."] call A3A_fnc_customHint; openMap [false,false]};
if (!([player] call A3A_fnc_isMember) && {!([_positionTel] call A3A_fnc_playerLeashCheckPosition)}) exitWith {["Fast Travel", format ["There are no members nearby the target location. You need to be within %1 km of HQ or a member.", ceil (memberDistance/1e3)]] call A3A_fnc_customHint;};

if (_positionTel distance getMarkerPos _base < 50) then
Expand Down
2 changes: 1 addition & 1 deletion A3A/addons/core/functions/REINF/fn_addFIAveh.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FIX_LINE_NUMBERS()
if (!(isNil "placingVehicle") && {placingVehicle}) exitWith {["Add Vehicle", "Unable to buy vehicle, you are already placing something."] call A3A_fnc_customHint;};
if (player != player getVariable ["owner",player]) exitWith {["Add Vehicle", "You cannot buy vehicles while you are controlling AI."] call A3A_fnc_customHint;};
if ([player,300] call A3A_fnc_enemyNearCheck) exitWith {["Add Vehicle", "You cannot buy vehicles with enemies nearby."] call A3A_fnc_customHint;};
if ([player, enemyNearDistance] call A3A_fnc_enemyNearCheck) exitWith {["Add Vehicle", "You cannot buy vehicles with enemies nearby."] call A3A_fnc_customHint;};


private _typeVehX = _this select 0;
Expand Down
2 changes: 1 addition & 1 deletion A3A/addons/core/functions/REINF/fn_garrisonAdd.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ _positionX = getMarkerPos _markerX;

if (surfaceIsWater _positionX) exitWith {["Garrisons", "This Garrison is still updating, please try again in a few seconds."] call A3A_fnc_customHint;};

if ([_positionX,500] call A3A_fnc_enemyNearCheck) exitWith {["Garrisons", "You cannot Recruit Garrison Units with enemies near the zone."] call A3A_fnc_customHint;};
if ([_positionX, enemyNearDistance] call A3A_fnc_enemyNearCheck) exitWith {["Garrisons", "You cannot Recruit Garrison Units with enemies near the zone."] call A3A_fnc_customHint;};
_nul = [-1,-_costs] remoteExec ["A3A_fnc_resourcesFIA",2];
/*
_garrison = [];
Expand Down
2 changes: 1 addition & 1 deletion A3A/addons/core/functions/REINF/fn_garrisonDialog.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if (not(sidesX getVariable [_nearX,sideUnknown] == teamPlayer)) exitWith {
_nul=CreateDialog "build_menu";
#endif
};
if ([_positionX,500] call A3A_fnc_enemyNearCheck) exitWith {
if ([_positionX, enemyNearDistance] call A3A_fnc_enemyNearCheck) exitWith {
["Garrison", "You cannot manage this garrison while there are enemies nearby."] call A3A_fnc_customHint;
#ifdef UseDoomGUI
ERROR("Disabled due to UseDoomGUI Switch.")
Expand Down
2 changes: 1 addition & 1 deletion A3A/addons/core/functions/REINF/fn_reinfPlayer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if (recruitCooldown > time) exitWith {["AI Recruitment", format ["You need to wa

if (player != player getVariable ["owner",player]) exitWith {["AI Recruitment", "You cannot buy units while you are controlling AI."] call A3A_fnc_customHint;};

if ([player,300] call A3A_fnc_enemyNearCheck) exitWith {["AI Recruitment", "You cannot Recruit Units with enemies nearby."] call A3A_fnc_customHint;};
if ([player, enemyNearDistance] call A3A_fnc_enemyNearCheck) exitWith {["AI Recruitment", "You cannot Recruit Units with enemies nearby."] call A3A_fnc_customHint;};

if (player != leader group player) exitWith {["AI Recruitment", "You cannot recruit units as you are not your group leader."] call A3A_fnc_customHint;};

Expand Down
4 changes: 2 additions & 2 deletions A3A/addons/core/functions/init/fn_initClient.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ boxX addAction ["Transfer Vehicle cargo to Ammobox", {[] spawn A3A_fnc_empty;},
boxX addAction ["Move this asset", A3A_fnc_moveHQObject,nil,0,false,true,"","(_this == theBoss)", 4];
if (A3A_hasACE) then { [boxX, boxX] call ace_common_fnc_claim;}; //Disables ALL Ace Interactions
flagX allowDamage false;
flagX addAction ["Unit Recruitment", {if ([player,300] call A3A_fnc_enemyNearCheck) then {["Recruit Unit", "You cannot recruit units while there are enemies near you."] call A3A_fnc_customHint;} else { [] spawn A3A_fnc_unit_recruit; }},nil,0,false,true,"","(isPlayer _this) and (_this == _this getVariable ['owner',objNull]) and (side (group _this) == teamPlayer)"];
flagX addAction ["Unit Recruitment", {if ([player, enemyNearDistance] call A3A_fnc_enemyNearCheck) then {["Recruit Unit", "You cannot recruit units while there are enemies near you."] call A3A_fnc_customHint;} else { [] spawn A3A_fnc_unit_recruit; }},nil,0,false,true,"","(isPlayer _this) and (_this == _this getVariable ['owner',objNull]) and (side (group _this) == teamPlayer)"];
flagX addAction ["Move this asset", A3A_fnc_moveHQObject,nil,0,false,true,"","(_this == theBoss)", 4];

//Adds a light to the flag
Expand All @@ -374,7 +374,7 @@ vehicleBox addAction ["Vehicle Arsenal", JN_fnc_arsenal_handleAction, [], 0, tru
if (A3A_hasACE) then { [vehicleBox, VehicleBox] call ace_common_fnc_claim;}; //Disables ALL Ace Interactions

vehicleBox addAction ["Buy Vehicle", {
if ([player,300] call A3A_fnc_enemyNearCheck) then {
if ([player, enemyNearDistance] call A3A_fnc_enemyNearCheck) then {
["Purchase Vehicle", "You cannot buy vehicles while there are enemies near you."] call A3A_fnc_customHint;
} else {
if (A3A_GUIDevPreview) then {
Expand Down
1 change: 1 addition & 0 deletions A3A/addons/core/functions/init/fn_initParams.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ A3A_paramTable = [
["autoSave", "autoSave", [], true],
["autoSaveInterval", "autoSaveInterval", [], 3600],
["distanceMission", "mRadius", [], 4000],
["enemyNearDistance", "enemyNearDistanceLimit", [], 200],
["skillMult", "AISkill", [], 2],
["civTraffic", "civTraffic", [], 2],
["limitedFT", "allowFT", [], true], // backwards naming...
Expand Down
7 changes: 7 additions & 0 deletions A3A/addons/maps/MissionDescription/params.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ class Params
texts[] = {"Load from save (Default: Yes)","Yes","No"};
default = 9999;
};
class enemyNearDistanceLimit
{
title = "Distance used to check for enemies near";
values[] = {9999,0,100,200,300,400,500};
texts[] = {"Load from save (Default: 200)", "0", "100", "200", "300", "400", "500"};
default = 9999;
};
class AISkill
{
title = "Mission Difficulty";
Expand Down