ACE3/addons/arsenal/functions/fnc_statTextStatement_accuracy.sqf
Josuan Albin 9618c2de95 Various ACE Arsenal additions and fixes (#6347)
Arsenal - Various additions and fixes
2018-05-31 18:00:29 -05:00

33 lines
747 B
Plaintext

/*
* Author: Alganthe
* Accuracy text statement.
*
* Arguments:
* 0: stat (STRING)
* 1: item config path (CONFIG)
* 2: Args for configExtreme
* 2.1: Stat limits (ARRAY of BOOL)
* 2.2: Evaluate as a logarithmic number (BOOL)
*
* Return Value:
* Number
*
* Public: No
*/
#include "script_component.hpp"
params ["_stat", "_config", "_args"];
_args params ["_statMinMax", "_configExtremeBool"];
private _fireModes = getArray (_config >> "modes");
private _dispersion = [];
{
_dispersion pushBackUnique (getNumber (_config >> _x >> "dispersion"));
} foreach _fireModes;
_dispersion sort true;
_dispersion = _dispersion select 0;
format ["%1 MIL (%2 MOA)", (_dispersion * 1000) toFixed 2, (_dispersion / pi * 10800) ToFixed 1];