Arsenal - Add stat to show how AI will use ammo (#8434)

* Arsenal - Show AI Usage

* Add condition and move to ballistics

* Add stringtables

* add getVar
This commit is contained in:
PabstMirror 2023-08-29 14:34:24 -05:00 committed by GitHub
parent e6a8222966
commit fdb7330385
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 65 additions and 1 deletions

View File

@ -67,4 +67,14 @@ class EGVAR(arsenal,stats) {
textStatement = QUOTE([ARR_2(_this select 0, _this select 1)] call FUNC(statTextStatement_weaponMuzzleVelocity));
tabs[] = {{0,1}, {}};
};
class ACE_magazineAiUsage: statBase {
scope = 2;
priority = 0;
stats[] = {"aiAmmoUsageFlags"};
displayName= CSTRING(ammoUsage_ai);
showText= 1;
textStatement = QUOTE(call FUNC(statTextStatement_magazineAiUsage));
condition = QUOTE(is3DEN || {!isNull getAssignedCuratorLogic player} || {missionNamespace getVariable [ARR_2(QQGVAR(showAIMagazineUse), missionName == 'Arsenal')]});
tabs[] = {{}, {4}};
};
};

View File

@ -1,2 +1,3 @@
PREP(statTextStatement_weaponMuzzleVelocity);
PREP(statTextStatement_magazineAiUsage);
PREP(statTextStatement_magazineMuzzleVelocity);
PREP(statTextStatement_weaponMuzzleVelocity);

View File

@ -0,0 +1,32 @@
#include "script_component.hpp"
/*
* Author: PabstMirror
* Text statement for the magazine's AI Usage.
*
* Arguments:
* 0: not used
* 1: item config path (CONFIG)
*
* Return Value:
* String to display
*
* Public: No
*/
params ["", "_config"];
TRACE_1("statTextStatement_magazineAiUsage",_config);
private _ammo = getText (_config >> "ammo");
private _aiAmmoUsageFlags = getNumber (configFile >> "CfgAmmo" >> _ammo >> "aiAmmoUsageFlags");
private _cost = getNumber (configFile >> "CfgAmmo" >> _ammo >> "cost");
private _output = [];
if ([_aiAmmoUsageFlags, 1] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_illumination) };
if ([_aiAmmoUsageFlags, 4] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_concealment) };
if ([_aiAmmoUsageFlags, 64] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_infantry) };
if ([_aiAmmoUsageFlags, 128] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_lightVehicle) };
if ([_aiAmmoUsageFlags, 256] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_armor) };
if ([_aiAmmoUsageFlags, 512] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_aircraft) };
(_output joinString ", ") + format [" [%1 %2]", localize "str_a3_cfgvehicles_modulecuratorsetobjectcost_f_arguments_cost", _cost]

View File

@ -3511,5 +3511,26 @@
<Turkish>Namlu çıkış hızı</Turkish>
<Korean>총구 속도</Korean>
</Key>
<Key ID="STR_ACE_Ballistics_ammoUsage_ai">
<English>AI Usage</English>
</Key>
<Key ID="STR_ACE_Ballistics_ammoUsageShort_illumination">
<English>Illum</English>
</Key>
<Key ID="STR_ACE_Ballistics_ammoUsageShort_concealment">
<English>Smoke</English>
</Key>
<Key ID="STR_ACE_Ballistics_ammoUsageShort_infantry">
<English>Inf</English>
</Key>
<Key ID="STR_ACE_Ballistics_ammoUsageShort_lightVehicle">
<English>Veh</English>
</Key>
<Key ID="STR_ACE_Ballistics_ammoUsageShort_armor">
<English>Armor</English>
</Key>
<Key ID="STR_ACE_Ballistics_ammoUsageShort_aircraft">
<English>Air</English>
</Key>
</Package>
</Project>