-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
e6a8222
commit fdb7330
Showing
4 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
PREP(statTextStatement_weaponMuzzleVelocity); | ||
PREP(statTextStatement_magazineAiUsage); | ||
PREP(statTextStatement_magazineMuzzleVelocity); | ||
PREP(statTextStatement_weaponMuzzleVelocity); |
32 changes: 32 additions & 0 deletions
32
addons/ballistics/functions/fnc_statTextStatement_magazineAiUsage.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters