Epoch/Sources/epoch_code/compile/EPOCH_unitSpawnIncrease.sqf

26 lines
962 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 ]]]
2017-09-29 16:29:20 +00:00
private ["_index","_playerSpawnArray","_playerSpawnArrayKeyFinal"];
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";
2017-09-28 17:00:48 +00:00
if !(isNil "_playerSpawnArrayKey") then {_playerSpawnArrayKeyFinal = _playerSpawnArrayKey};
2017-09-27 02:20:41 +00:00
_playerSpawnArray = missionNamespace getVariable [_playerSpawnArrayKeyFinal,[]];
_playerSpawnArray set[_index, ((_playerSpawnArray select _index) + _increase) min (EPOCH_spawnLimits select _index)];
2015-09-14 20:55:36 +00:00
};