Epoch/Sources/epoch_code/compile/setup/masterLoop/Event6.sqf
vbawol a0e9ec0153 digest concept
-use the second set of GVARs to track adding and removing attributes.
-Epoch_player* vars moved to local vars only accessible inside the
master loop.
-TODO: finish digest system with a config entry to control digest
limits. Some extra logic is needed.

Basically, when you consume some food, it will not increase your hunger
level immediately but raise over time.

Each of these should have limits on how much you can store in the digest
and how much each tick the digest var can affect the local player var in
the master loop.
2017-09-20 09:23:46 -05:00

20 lines
647 B
Plaintext

_spawnChance = ((_playerNuisance + _playerSoiled)/2) max 1;
// add more antagonist spawn chances
if (random _antagonistRndChance < _spawnChance) then {
// 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 EPOCH_playerSpawnArray;
// test spawning one antagonist every 10 minutes select one unit at random to spawn
if !(_spawnUnits isEqualTo[]) then{
(selectRandom _spawnUnits) call EPOCH_unitSpawn;
};