Epoch/Sources/epoch_code/compile/setup/masterLoop/Event5.sqf
vbawol 40f2c98f0c 0.5 b684 pt1
[Added] Customizability of units spawned by UAV alert via CfgEpochClient
> uavAlertUnitSpawnTemplate. (Default: I_Soldier_EPOCH)
[Changed] Great White Sharks will now spawn if player is deep enough in
the ocean.
[Changed] Objects or Players that have been given "Crypto" variable can
be accessed via the dynamic menu (Space Bar) for a "Take Crypto" action.
changed zombieRndChance to zombieRngChance and added default entry into
CfgEpochClient
2017-02-28 10:34:24 -06:00

61 lines
1.9 KiB
Plaintext

_position = getPosATL player;
EPOCH_nearestLocations = nearestLocations[player, ["NameCityCapital", "NameCity", "Airport"], 300];
EPOCH_playerIsSwimming = false;
if !(surfaceIsWater _position) then {
if (EPOCH_nearestLocations isEqualTo []) then{
if (count(_position nearEntities["Animal_Base_F", 800]) < 2) then {
call EPOCH_client_loadAnimalBrain;
};
};
} else {
// spawn shark if player is deep water and not in vehicle
if (vehicle player == player) then{
_offsetZ = ((_position vectorDiff getPosASL player) select 2);
EPOCH_playerIsSwimming = (_offsetZ > 1.7);
if (_offsetZ > 50) then {
["GreatWhite_F", player, true] call EPOCH_unitSpawn;
};
};
};
// default power state
EPOCH_nearPower = false;
EPOCH_chargeRate = 0;
// energy Charge from nearby power plants
_powerSources = nearestObjects[player, ["Land_spp_Tower_F","Land_wpp_Turbine_V2_F","Land_wpp_Turbine_V1_F","SolarGen_EPOCH"], _energyRange];
if !(_powerSources isEqualTo[]) then {
_totalCapacity = 0;
{
_powerClass = typeOf _x;
_powerCap = getNumber(_cfgBaseBuilding >> _powerClass >> "powerCapacity");
_powerType = getNumber(_cfgBaseBuilding >> _powerClass >> "powerType");
if (_powerCap == 0) then {
_powerCap = 100;
};
if (_powerType == 1) then {
if (sunOrMoon < 1) then {
_powerCap = _powerCap/2;
};
};
_totalCapacity = _totalCapacity + _powerCap;
} forEach _powerSources;
if (_totalCapacity > 0) then {
_players = player nearEntities[["Epoch_Male_F", "Epoch_Female_F"], _energyRange];
if (_players isEqualTo []) then {
EPOCH_chargeRate = ceil _totalCapacity;
} else {
EPOCH_chargeRate = ceil (_totalCapacity / (count _players));
};
EPOCH_nearPower = true;
};
};
// downtick Alcohol
EPOCH_playerAlcohol = ((EPOCH_playerAlcohol - 1) min 100) max 0;
EPOCH_playerAliveTime = round(EPOCH_playerAliveTime + (_tickTime - EPOCH_clientAliveTimer));
EPOCH_clientAliveTimer = _tickTime;