Merge pull request #568 from Ignatz-HeMan/patch-1

Building Configs
This commit is contained in:
vbawol 2016-07-09 08:40:54 -05:00 committed by GitHub
commit dd42401de2
2 changed files with 61 additions and 5 deletions

View File

@ -39,6 +39,19 @@ _buildingCountLimit = getNumber(_config >> "buildingCountLimit");
if (_buildingJammerRange == 0) then { _buildingJammerRange = 75; }; if (_buildingJammerRange == 0) then { _buildingJammerRange = 75; };
if (_buildingCountLimit == 0) then { _buildingCountLimit = 200; }; if (_buildingCountLimit == 0) then { _buildingCountLimit = 200; };
_buildingCountLeader = getNumber(_config >> "buildingCountLeader");
_buildingCountPerMember = getNumber(_config >> "buildingCountPerMember");
_storagecountLeader = getNumber(_config >> "storagecountLeader");
_storagecountPerMember = getNumber(_config >> "storagecountPerMember");
_minjammerdistance = getNumber(_config >> "minJammerDistance");
_maxbuildingheigh = getNumber(_config >> "maxBuildingHeigh");
_jammerpergroup = getNumber(_config >> "JammerPerGroup");
if (_buildingCountLeader == 0) then { _buildingCountLeader = _buildingCountLimit};
if (_storagecountLeader == 0) then { _storagecountLeader = 100};
if (_minjammerdistance == 0) then { _minjammerdistance = _buildingJammerRange*3};
if (_maxbuildingheigh == 0) then { _maxbuildingheigh = 100};
if (_jammerpergroup == 0) then { _jammerpergroup = 2};
// input // input
params ["_objType"]; params ["_objType"];
_obj = objNull; _obj = objNull;
@ -52,7 +65,7 @@ _simulClass = getText(_cfgBaseBuilding >> _objType >> "simulClass");
_bypassJammer = getNumber(_cfgBaseBuilding >> _staticClass >> "bypassJammer"); _bypassJammer = getNumber(_cfgBaseBuilding >> _staticClass >> "bypassJammer");
// Jammer // Jammer
_jammer = nearestObjects[player, ["PlotPole_EPOCH"], _buildingJammerRange*3]; _jammer = nearestObjects[player, ["PlotPole_EPOCH"], _minjammerdistance];
if !(_jammer isEqualTo []) then { if !(_jammer isEqualTo []) then {
if (_objType in ["PlotPole_EPOCH", "PlotPole_SIM_EPOCH"]) then { if (_objType in ["PlotPole_EPOCH", "PlotPole_SIM_EPOCH"]) then {
{ {
@ -70,6 +83,7 @@ if !(_jammer isEqualTo []) then {
} foreach _jammer; } foreach _jammer;
if !(isNull _nearestJammer) then { if !(isNull _nearestJammer) then {
if ((getposatl player) select 2 < _maxbuildingheigh) then {
if ((_nearestJammer getVariable["BUILD_OWNER", "-1"]) in[getPlayerUID player, Epoch_my_GroupUID]) then { if ((_nearestJammer getVariable["BUILD_OWNER", "-1"]) in[getPlayerUID player, Epoch_my_GroupUID]) then {
_ownedJammerExists = true; _ownedJammerExists = true;
} else { } else {
@ -77,10 +91,44 @@ if !(_jammer isEqualTo []) then {
["Building Disallowed: Frequency Blocked", 5] call Epoch_message; ["Building Disallowed: Frequency Blocked", 5] call Epoch_message;
}; };
_objectCount = count nearestObjects[_nearestJammer, ["Constructions_static_F"], _buildingJammerRange]; _objectCount = count nearestObjects[_nearestJammer, ["Constructions_static_F"], _buildingJammerRange];
_membercount = 0;
if (count Epoch_my_Group > 0) then {
_membercount = count (Epoch_my_Group select 3) + count (Epoch_my_Group select 4);
};
if (_objType in ["WorkBench_EPOCH","StorageShelf_EPOCH","Tipi_EPOCH","LockBox_EPOCH","Safe_EPOCH","StorageShelf_SIM_EPOCH","LockBox_SIM_EPOCH","Safe_SIM_EPOCH","Workbench_SIM_EPOCH","Tipi_SIM_EPOCH"]) then {
_buildingCountLimit = _storagecountLeader + _storagecountPerMember*_membercount;
_objectCount = count nearestObjects[_nearestJammer, ["Buildable_Storage","Constructions_lockedstatic_F"], _buildingJammerRange];
}
else {
_buildingCountLimit = _buildingCountLeader + _buildingCountPerMember*_membercount;
_objectCount = count nearestObjects[_nearestJammer, ["Constructions_static_F","Constructions_foundation_F"], _buildingJammerRange];
};
if (_objectCount >= _buildingCountLimit) then { if (_objectCount >= _buildingCountLimit) then {
_buildingAllowed = false; _buildingAllowed = false;
["Building Disallowed: Frequency Overloaded", 5] call Epoch_message; [format["Building Disallowed: Frequency Overloaded: Limit %1", _buildingCountLimit], 5] call Epoch_message;
}; };
}
else {
_buildingAllowed = false;
["Building Disallowed: Max building heigh reached", 5] call Epoch_message;
};
};
};
}
else {
if (_objType in ["PlotPole_EPOCH", "PlotPole_SIM_EPOCH"]) then {
_alljammer = allmissionobjects 'PlotPole_EPOCH';
_c = 0;
{
if ((_x getVariable["BUILD_OWNER", "-1"]) in[getPlayerUID player, Epoch_my_GroupUID]) then {
_c = _c+1;
};
} foreach _alljammer;
if (_c >= _jammerpergroup) then {
_buildingAllowed = false;
[format["Building Disallowed: Max %1 Jammer per Group!", _jammerpergroup], 5] call Epoch_message;
}; };
}; };
}; };
@ -126,20 +174,20 @@ if (getNumber(_config >> "buildingNearbyMilitary") == 0) then{
}; };
if !(_restricted isEqualTo []) then { if !(_restricted isEqualTo []) then {
_buildingAllowed = false; _buildingAllowed = false;
["Building Disallowed: Protected Frequency", 5] call Epoch_message; ["Building Disallowed: Area Blocked", 5] call Epoch_message;
}; };
_restrictedLocations = nearestLocations [player, ["NameCityCapital"], 300]; _restrictedLocations = nearestLocations [player, ["NameCityCapital"], 300];
if !(_restrictedLocations isEqualTo []) then { if !(_restrictedLocations isEqualTo []) then {
_buildingAllowed = false; _buildingAllowed = false;
["Building Disallowed: Protected Frequency", 5] call Epoch_message; ["Building Disallowed: Area Blocked", 5] call Epoch_message;
}; };
_myPosATL = getPosATL player; _myPosATL = getPosATL player;
{ {
if ((_x select 0) distance _myPosATL < (_x select 1)) exitWith { if ((_x select 0) distance _myPosATL < (_x select 1)) exitWith {
_buildingAllowed = false; _buildingAllowed = false;
["Building Disallowed: Protected Frequency", 5] call Epoch_message; ["Building Disallowed: Area Blocked", 5] call Epoch_message;
}; };
} forEach(getArray(_config >> worldname >> "blockedArea")); } forEach(getArray(_config >> worldname >> "blockedArea"));

View File

@ -21,6 +21,14 @@ class CfgEpochClient
buildingRequireJammer = 0; // 1 = to allow building without a jammer buildingRequireJammer = 0; // 1 = to allow building without a jammer
buildingCountLimit = 200; // how many objects can be built within range of a jammer buildingCountLimit = 200; // how many objects can be built within range of a jammer
buildingJammerRange = 75; // jammer range in meters buildingJammerRange = 75; // jammer range in meters
minJammerDistance = 650; // min distance to next Jammer
maxBuildingHeigh = 33; // Max heigh, building is allowed
buildingCountLeader = 125; // Building count limit if Player has no group
buildingCountPerMember = 5; // Additional building counts per group member
storagecountLeader = 10; // Storage count limit if Player has no group
storagecountPerMember = 5; // Additional Storage counts per group member
maxdoors = 8; // Max allowed doors per Group
maxgates = 5; // Max allowed Gates per Group
disableRemoteSensors = true; // disableRemoteSensors true disableRemoteSensors = true; // disableRemoteSensors true
EPOCH_news[] = {"Word is that Sappers have a new boss.","Dogs will often lure them monsters away.","My dog was blown up. I miss him.."}; EPOCH_news[] = {"Word is that Sappers have a new boss.","Dogs will often lure them monsters away.","My dog was blown up. I miss him.."};
deathMorphClass[] = {"Epoch_Sapper_F","Epoch_SapperB_F","I_UAV_01_F","Epoch_Cloak_F"};//Random selection of these classes when player morphs after death. Currently available: Epoch_Cloak_F, Epoch_SapperB_F, Epoch_Sapper_F, I_UAV_01_F deathMorphClass[] = {"Epoch_Sapper_F","Epoch_SapperB_F","I_UAV_01_F","Epoch_Cloak_F"};//Random selection of these classes when player morphs after death. Currently available: Epoch_Cloak_F, Epoch_SapperB_F, Epoch_Sapper_F, I_UAV_01_F