2015-11-08 15:26:38 +00:00
|
|
|
|
|
|
|
_prevEquippedItem = [];
|
|
|
|
_damagePlayer = damage player;
|
|
|
|
_panic = false;
|
|
|
|
_prevEnergy = EPOCH_playerEnergy;
|
|
|
|
|
|
|
|
// init config data
|
2016-05-23 20:01:40 +00:00
|
|
|
EPOCH_sapperRndChance = ["CfgEpochClient", "sapperRngChance", 100] call EPOCH_fnc_returnConfigEntryV2;
|
2016-06-30 22:43:28 +00:00
|
|
|
EPOCH_zombieRndChance = ["CfgEpochClient", "zombieRndChance", 50] call EPOCH_fnc_returnConfigEntryV2;
|
2015-11-08 15:26:38 +00:00
|
|
|
EPOCH_droneRndChance = ["CfgEpochClient", "droneRngChance", 100] call EPOCH_fnc_returnConfigEntryV2;
|
|
|
|
_baseHTLoss = ["CfgEpochClient", "baseHTLoss", 8] call EPOCH_fnc_returnConfigEntryV2;
|
|
|
|
_energyCostNV = ["CfgEpochClient", "energyCostNV", 3] call EPOCH_fnc_returnConfigEntryV2;
|
|
|
|
_energyRegenMax = ["CfgEpochClient", "energyRegenMax", 5] call EPOCH_fnc_returnConfigEntryV2;
|
|
|
|
_energyRange = ["CfgEpochClient", "energyRange", 75] call EPOCH_fnc_returnConfigEntryV2;
|
|
|
|
|
|
|
|
EPOCH_chargeRate = 0;
|
2016-01-15 19:22:40 +00:00
|
|
|
EPOCH_playerIsSwimming = false;
|
2015-11-08 15:26:38 +00:00
|
|
|
|
|
|
|
// default data if mismatch
|
|
|
|
if (count EPOCH_playerSpawnArray != count EPOCH_spawnIndex) then{
|
2016-05-23 20:01:40 +00:00
|
|
|
EPOCH_playerSpawnArray = [];
|
2015-11-08 15:26:38 +00:00
|
|
|
{ EPOCH_playerSpawnArray pushBack 0 } forEach EPOCH_spawnIndex;
|
|
|
|
};
|
|
|
|
|
2016-08-08 19:45:39 +00:00
|
|
|
//9990 cutRsc ["EpochGameUI","PLAIN",2,false];
|
|
|
|
//_display = uiNamespace getVariable "EPOCH_EpochGameUI";
|
|
|
|
/*
|
|
|
|
EPOCH_fnc_makeCtrl = {
|
|
|
|
params [["_picture",""],["_HUDclass","topRight"]];
|
|
|
|
private _index = missionNamespace getvariable ["EPOCH_dynamicCtrlIndex",1];
|
|
|
|
private _ctrl = [_HUDclass,_index] call epoch_getHUDCtrl;
|
|
|
|
_ctrl ctrlSetText _picture;
|
|
|
|
missionNamespace setvariable ["EPOCH_dynamicCtrlIndex",_index + 1];
|
|
|
|
_ctrl
|
|
|
|
};
|
|
|
|
|
|
|
|
_thirst = ["x\addons\a3_epoch_code\Data\UI\thirst_ca.paa"] call EPOCH_fnc_makeCtrl;
|
|
|
|
_hunger = ["x\addons\a3_epoch_code\Data\UI\hunger_ca.paa"] call EPOCH_fnc_makeCtrl;
|
|
|
|
_broken = ["x\addons\a3_epoch_code\Data\UI\broken_ca.paa"] call EPOCH_fnc_makeCtrl;
|
|
|
|
_oxygen = ["x\addons\a3_epoch_code\Data\UI\oxygen_ca.paa"] call EPOCH_fnc_makeCtrl;
|
|
|
|
_hazzard = ["x\addons\a3_epoch_code\Data\UI\hazzard_ca.paa"] call EPOCH_fnc_makeCtrl;
|
|
|
|
_emergency = ["x\addons\a3_epoch_code\Data\UI\bleeding_ca.paa"] call EPOCH_fnc_makeCtrl;
|
2015-11-08 15:26:38 +00:00
|
|
|
|
2016-08-08 19:45:39 +00:00
|
|
|
diag_log format ["init HUD: %1 %2 %3 %4 %5 %6", _thirst,_hunger,_broken,_oxygen,_hazzard,_emergency];
|
2015-11-08 15:26:38 +00:00
|
|
|
|
|
|
|
{
|
2016-08-08 19:45:39 +00:00
|
|
|
|
2015-11-08 15:26:38 +00:00
|
|
|
_x ctrlShow false;
|
|
|
|
}forEach[_thirst,_hunger,_broken,_oxygen,_hazzard,_emergency];
|
|
|
|
|
2016-08-08 19:45:39 +00:00
|
|
|
*/
|
2015-11-08 15:26:38 +00:00
|
|
|
// find radio
|
|
|
|
{
|
|
|
|
if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) == "ItemRadio") exitWith{
|
|
|
|
EPOCH_equippedItem_PVS = [_x, true, player];
|
|
|
|
};
|
|
|
|
} forEach assignedItems player;
|
|
|
|
|
|
|
|
// lootBubble Init
|
2016-04-08 20:21:46 +00:00
|
|
|
_buildingJammerRange = ["CfgEpochClient", "buildingJammerRange", 75] call EPOCH_fnc_returnConfigEntryV2;
|
|
|
|
_masterConfig = 'CfgBuildingLootPos' call EPOCH_returnConfig;
|
2015-11-08 15:26:38 +00:00
|
|
|
|
2016-04-08 20:21:46 +00:00
|
|
|
_lootClasses = [];
|
|
|
|
_lootClassesIgnore = ['Default'];
|
|
|
|
'_cN = configName _x;if !(_cN in _lootClassesIgnore)then{_lootClasses pushBackUnique _cN};' configClasses _masterConfig;
|
2015-11-08 15:26:38 +00:00
|
|
|
|
|
|
|
_lootBubble = {
|
2016-04-08 20:21:46 +00:00
|
|
|
private["_jammer", "_others", "_objects", "_nearObjects", "_building", "_lootDist", "_lootLoc", "_playerPos", "_distanceTraveled"];
|
2015-11-08 15:26:38 +00:00
|
|
|
_playerPos = getPosATL vehicle player;
|
|
|
|
_distanceTraveled = EPOCH_lastPlayerPos distance _playerPos;
|
|
|
|
if (_distanceTraveled > 10 && _distanceTraveled < 200) then {
|
|
|
|
_lootDist = 30 + _distanceTraveled;
|
2016-04-08 20:21:46 +00:00
|
|
|
_lootLoc = player getRelPos [_lootDist, (random [-180,0,180])];
|
2015-11-08 15:26:38 +00:00
|
|
|
_objects = nearestObjects[_lootLoc, _lootClasses, 30];
|
2016-04-29 13:10:17 +00:00
|
|
|
_jammer = nearestObjects [_lootLoc, ["PlotPole_EPOCH","ProtectionZone_Invisible_F"], _buildingJammerRange];
|
2015-11-08 15:26:38 +00:00
|
|
|
if (!(_objects isEqualTo[]) && (_jammer isEqualTo[])) then {
|
2016-04-08 20:21:46 +00:00
|
|
|
_building = selectRandom _objects;
|
2015-11-08 15:26:38 +00:00
|
|
|
if !(_building in EPOCH_LootedBlds) then {
|
|
|
|
_others = _building nearEntities[["Epoch_Male_F", "Epoch_Female_F"], 15];
|
|
|
|
if (_others isEqualTo[]) then {
|
2016-04-08 20:21:46 +00:00
|
|
|
_nearObjects = nearestObjects[_building, ["WH_Loot", "Animated_Loot"], sizeOf (typeOf _building)];
|
|
|
|
//diag_log format["DEBUG: sizeof %1 %2",sizeOf (typeOf _building), typeOf _building];
|
2015-11-08 15:26:38 +00:00
|
|
|
if (_nearObjects isEqualTo[]) then {
|
2016-04-08 20:21:46 +00:00
|
|
|
[_building] call EPOCH_spawnLoot;
|
2015-11-08 15:26:38 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
EPOCH_lastPlayerPos = _playerPos;
|
|
|
|
};
|
|
|
|
|
|
|
|
// [control,bool] call _fadeUI;
|
|
|
|
_fadeUI = {
|
2016-04-08 20:21:46 +00:00
|
|
|
params ["_ctrl","_bool"];
|
|
|
|
if (_bool) then {
|
2015-11-08 15:26:38 +00:00
|
|
|
if (ctrlFade _ctrl == 0) then {
|
|
|
|
_ctrl ctrlSetFade 1;
|
|
|
|
_ctrl ctrlCommit 0.5;
|
|
|
|
};
|
|
|
|
if (ctrlFade _ctrl == 1) then {
|
|
|
|
_ctrl ctrlSetFade 0;
|
|
|
|
_ctrl ctrlCommit 0.5;
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
if (ctrlFade _ctrl != 1) then {
|
|
|
|
_ctrl ctrlSetFade 0;
|
|
|
|
_ctrl ctrlCommit 0;
|
|
|
|
};
|
|
|
|
};
|
2016-04-08 20:21:46 +00:00
|
|
|
_bool
|
2015-11-08 15:26:38 +00:00
|
|
|
};
|
2016-08-08 19:45:39 +00:00
|
|
|
_scaleUI = {
|
|
|
|
params ["_ctrl","_bool"];
|
|
|
|
private _oemScale = _ctrl getVariable ["ctrl_scale", 1];
|
|
|
|
private _curScale = ctrlScale _ctrl;
|
|
|
|
if (_bool) then {
|
|
|
|
if (_curScale isEqualTo _oemScale) then {
|
|
|
|
_ctrl ctrlSetScale (_oemScale - 0.1);
|
|
|
|
_ctrl ctrlCommit 0.5;
|
|
|
|
} else {
|
|
|
|
_ctrl ctrlSetScale _oemScale;
|
|
|
|
_ctrl ctrlCommit 0.5;
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
if !(_curScale isEqualTo _oemScale) then {
|
|
|
|
_ctrl ctrlSetScale _oemScale;
|
|
|
|
_ctrl ctrlCommit 0.5;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
_bool
|
|
|
|
};
|
2015-11-08 15:26:38 +00:00
|
|
|
|
|
|
|
_cursorTarget = objNull;
|
2016-05-05 16:06:12 +00:00
|
|
|
|
|
|
|
// init cfgBaseBuilding config var
|
|
|
|
_cfgBaseBuilding = 'CfgBaseBuilding' call EPOCH_returnConfig;
|
|
|
|
_cfgObjectInteractions = 'CfgObjectInteractions' call EPOCH_returnConfig;
|