Epoch/Sources/epoch_code/compile/EPOCH_unitSpawnIncrease.sqf

26 lines
956 B
Plaintext
Raw Normal View History

2015-12-07 16:24:52 +00:00
/*
Author: Aaron Clark - EpochMod.com
Contributors:
Description:
Antagonist spawn chance increase function
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
2016-06-13 16:54:19 +00:00
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_unitSpawnIncrease.sqf
2015-12-07 16:24:52 +00:00
*/
2016-09-01 00:29:08 +00:00
//[[[cog import generate_private_arrays ]]]
private ["_index","_playerSpawnArray","_playerSpawnArrayKey"];
2016-09-01 00:29:08 +00:00
//[[[end]]]
params ["_spawnName", ["_increase",1]];
_index = EPOCH_spawnIndex find _spawnName;
2015-09-14 20:55:36 +00:00
if (_index != -1) then{
2017-09-27 02:20:41 +00:00
_playerSpawnArrayKeyFinal = "EPOCH_playerSpawnArray";
if (isNil "_playerSpawnArrayKey") then {_playerSpawnArrayKeyFinal = _playerSpawnArrayKey};
_playerSpawnArray = missionNamespace getVariable [_playerSpawnArrayKeyFinal,[]];
_playerSpawnArray set[_index, ((_playerSpawnArray select _index) + _increase) min (EPOCH_spawnLimits select _index)];
2015-09-14 20:55:36 +00:00
};