mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Arsenal - Fix Rate Of Fire stat (#6385)
* Fix the ROF stat in ace arsenal Previous one was wrong when the ROF set as default was different than the one in firemodes * Add missing )
This commit is contained in:
parent
f9943658e9
commit
11df315ce4
@ -33,7 +33,7 @@ class GVAR(stats) {
|
||||
displayName= "$STR_a3_rscdisplayarsenal_stat_rof";
|
||||
showBar = 1;
|
||||
showText = 1;
|
||||
barStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_2([ARR_2(-1.4, 0.31)], [ARR_2(1, 0.01)])])] call FUNC(statBarStatement_default));
|
||||
barStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_2([ARR_2(-1.4, 0.31)], [ARR_2(1, 0.01)])])] call FUNC(statBarStatement_rateOfFIre));
|
||||
textStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_2([ARR_2(-1.4, 0.31)], false)])] call FUNC(statTextStatement_rateOfFire));
|
||||
tabs[] = {{0,1}, {}};
|
||||
};
|
||||
|
@ -50,6 +50,7 @@ PREP(sortPanel);
|
||||
PREP(statBarStatement_accuracy);
|
||||
PREP(statBarStatement_default);
|
||||
PREP(statBarStatement_impact);
|
||||
PREP(statBarStatement_rateOfFIre);
|
||||
PREP(statTextStatement_accuracy);
|
||||
PREP(statTextStatement_mass);
|
||||
PREP(statTextStatement_rateOfFire);
|
||||
|
31
addons/arsenal/functions/fnc_statBarStatement_rateOfFIre.sqf
Normal file
31
addons/arsenal/functions/fnc_statBarStatement_rateOfFIre.sqf
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Rate of fire bar statement.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: stats array (ARRAY)
|
||||
* 1: item config path (CONFIG)
|
||||
* 2: Args
|
||||
* 2.1: Stat limits (ARRAY of BOOL)
|
||||
* 2.2: Bar limits (ARRAY of SCALAR)
|
||||
*
|
||||
* Return Value:
|
||||
* Number
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_stat", "_config", "_args"];
|
||||
_args params ["_statMinMax", "_barLimits"];
|
||||
|
||||
private _fireModes = getArray (_config >> "modes");
|
||||
private _fireRate = [];
|
||||
|
||||
{
|
||||
_fireRate pushBackUnique log (getNumber (_config >> _x >> "reloadTime"));
|
||||
} foreach _fireModes;
|
||||
|
||||
_fireRate sort true;
|
||||
|
||||
linearConversion [_statMinMax select 0, _statMinMax select 1, _fireRate select 0, _barLimits select 0, _barLimits select 1]
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* ROF text statement.
|
||||
* Rate of fire text statement.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: stat (STRING)
|
||||
@ -19,11 +19,14 @@
|
||||
params ["_stat", "_config", "_args"];
|
||||
_args params ["_statMinMax", "_configExtremeBool"];
|
||||
|
||||
private _statValues = [
|
||||
[_config],
|
||||
[_stat],
|
||||
[_configExtremeBool],
|
||||
[_statMinMax select 0]
|
||||
] call BIS_fnc_configExtremes;
|
||||
private _fireModes = getArray (_config >> "modes");
|
||||
private _fireRate = [];
|
||||
|
||||
format ["%1 rpm", round (60 / ((_statValues select 1) select 0))]
|
||||
{
|
||||
_fireRate pushBackUnique (getNumber (_config >> _x >> "reloadTime"));
|
||||
} foreach _fireModes;
|
||||
|
||||
_fireRate sort true;
|
||||
_fireRate = _fireRate select 0;
|
||||
|
||||
format ["%1 rpm", round (60 / _fireRate)]
|
||||
|
Loading…
Reference in New Issue
Block a user