Arsenal - Add grenade fuse time stat (#7694)

* Arsenal - Add grenade fuse time stat

* Add German translation

Co-authored-by: Jo David <github@jonathandavid.de>

* Add French translations

Co-authored-by: Elgin675 <elgin675@hotmail.com>

* Improve IR grenades handling

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Get ammo config once

Co-authored-by: Jo David <github@jonathandavid.de>
Co-authored-by: Elgin675 <elgin675@hotmail.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
mharis001 2020-06-07 20:58:55 -04:00 committed by GitHub
parent e25b02263a
commit 99df791c43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 53 additions and 1 deletions

View File

@ -115,8 +115,17 @@ class GVAR(stats) {
stats[] = {"ammo"};
displayName = CSTRING(statTTL);
showText = 1;
textStatement= QUOTE(call FUNC(statTextStatement_smokeChemTTL));
textStatement = QUOTE(call FUNC(statTextStatement_smokeChemTTL));
condition = QUOTE((configName (_this select 1)) isKindOf [ARR_2('smokeShell', configFile >> 'CfgMagazines')]);
tabs[] = {{}, {5}};
};
class ACE_explosionTime: statBase {
scope = 2;
priority = 3;
displayName = CSTRING(StatExplosionTime);
showText = 1;
textStatement = QUOTE(call FUNC(statTextStatement_explosionTime));
condition = QUOTE(true);
tabs[] = {{}, {5}};
};
};

View File

@ -64,6 +64,7 @@ PREP(statBarStatement_default);
PREP(statBarStatement_impact);
PREP(statBarStatement_rateOfFIre);
PREP(statTextStatement_accuracy);
PREP(statTextStatement_explosionTime);
PREP(statTextStatement_mass);
PREP(statTextStatement_rateOfFire);
PREP(statTextStatement_scopeMag);

View File

@ -0,0 +1,33 @@
#include "script_component.hpp"
/*
* Author: mharis001
* Text statement for the explosion time stat.
*
* Arguments:
* 0: Stats Array (not used) <ARRAY>
* 1: Item Config <CONFIG>
*
* Return Value:
* Stat Text <STRING>
*
* Example:
* [_stats, _config] call ace_arsenal_fnc_statTextStatement_explosionTime
*
* Public: No
*/
params ["", "_config"];
private _ammoConfig = configFile >> "CfgAmmo" >> getText (_config >> "ammo");
private _timeToLive = getNumber (_ammoConfig >> "timeToLive");
private _explosionTime = getNumber (_ammoConfig >> "explosionTime");
if (_explosionTime > _timeToLive) exitWith {
"-" // Handle IR grenades
};
if (_explosionTime == -1) exitWith {
localize LSTRING(DetonatesOnImpact)
};
format ["%1s", _explosionTime]

View File

@ -1319,5 +1319,14 @@
<Czech>Time to live</Czech>
<Turkish>Bitme Süresi</Turkish>
</Key>
<Key ID="STR_ACE_Arsenal_StatExplosionTime">
<English>Fuse Time</English>
<French>Retard avant détonation</French>
</Key>
<Key ID="STR_ACE_Arsenal_DetonatesOnImpact">
<English>Detonates on impact</English>
<German>Aufschlagzünder</German>
<French>Détonation à l'impact</French>
</Key>
</Package>
</Project>