Epoch/Sources/epoch_code/compile/setup/masterLoop/Event6.sqf

22 lines
822 B
Plaintext
Raw Normal View History

2017-09-27 15:13:42 +00:00
_playerNuisance = missionNamespace getVariable [_playerNuisanceKey, _playerNuisanceDefault];
_playerSoiled = missionNamespace getVariable [_playerSoiledKey, _playerSoiledDefault];
_spawnChance = ((_playerNuisance + _playerSoiled)/2) max 1;
// add more antagonist spawn chances
if (random _antagonistRndChance < _spawnChance) then {
2017-09-07 16:50:26 +00:00
// selectRandomWeighted arma 1.76 or higher
(selectRandomWeighted _antagonistChances) call EPOCH_unitSpawnIncrease;
};
// diag_log format["DEBUG: _spawnChance %1",_spawnChance];
_spawnUnits = [];
{
if (_x > 0) then{
_spawnUnits pushBack(EPOCH_spawnIndex select _forEachIndex);
};
} forEach _playerSpawnArray;
// test spawning one antagonist every 10 minutes select one unit at random to spawn
if !(_spawnUnits isEqualTo[]) then{
(selectRandom _spawnUnits) call EPOCH_unitSpawn;
};