Merge pull request #5182 from acemod/GitHawk-rearm_supply

Rearm - Limited Supply (Fix Merge Conflcits)
This commit is contained in:
PabstMirror 2017-06-08 11:45:12 -05:00 committed by GitHub
commit 1be9e7ca30
45 changed files with 981 additions and 298 deletions

View File

@ -1,23 +1,25 @@
/*
* Author: commy2, Glowbal
* Author: commy2, Glowbal, GitHawk
* Display a structured text.
*
* Arguments:
* 0: Text <ANY>
* 1: Size of the textbox <NUMBER> (default: 1.5)
* 2: Target Unit. Will only display if target is the player controlled object <OBJECT> (default: ACE_player)
* 3: Custom Width <NUMBER> (optional)
*
* Return Value:
* None
*
* Example:
*
* [["Test: %1", 123], 1.5] call ace_common_fnc_displayTextStructured
* ["wow", 1, ace_player, 3] call ace_common_fnc_displayTextStructured
*
* Public: Yes
*/
#include "script_component.hpp"
params [["_text", ""], ["_size", 1.5, [0]], ["_target", ACE_player, [objNull]]];
params [["_text", ""], ["_size", 1.5, [0]], ["_target", ACE_player, [objNull]], ["_width", 10, [0]]];
if (_target != ACE_player) exitWith {};
@ -55,9 +57,9 @@ private _wPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_W", (10
private _hPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_H", (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))];
*/
private _xPos = ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40));
private _xPos = ((safezoneX + safezoneW) - (_width *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40));
private _yPos = safeZoneY + 0.175 * safezoneH;
private _wPos = (10 *(((safezoneW / safezoneH) min 1.2) / 40));
private _wPos = (_width *(((safezoneW / safezoneH) min 1.2) / 40));
private _hPos = (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25));
// Zeus Interface Open and Display would be under the "CREATE" list

View File

@ -7,4 +7,11 @@ class ACE_Settings {
typeName = "SCALAR";
values[] = {CSTRING(RearmSettings_vehicle), CSTRING(RearmSettings_magazine), CSTRING(RearmSettings_caliber)};
};
class GVAR(supply) {
displayName = CSTRING(RearmSettings_supply_DisplayName);
description = CSTRING(RearmSettings_supply_Description);
value = 0;
typeName = "SCALAR";
values[] = {CSTRING(RearmSettings_unlimited), CSTRING(RearmSettings_limited), CSTRING(RearmSettings_magazineSupply)};
};
};

View File

@ -6,7 +6,7 @@
displayName = CSTRING(Rearm); \
distance = REARM_ACTION_DISTANCE; \
condition = QUOTE(_this call FUNC(canRearm)); \
statement = QUOTE(_player call FUNC(rearm)); \
statement = QUOTE(_this call FUNC(rearm)); \
exceptions[] = {"isNotInside"}; \
icon = QPATHTOF(ui\icon_rearm_interact.paa); \
}; \
@ -16,6 +16,26 @@
#define MACRO_REARM_TRUCK_ACTIONS \
class ACE_Actions: ACE_Actions { \
class ACE_MainActions: ACE_MainActions { \
class GVAR(ReadSupplyCounter) { \
displayName = CSTRING(ReadSupplyCounter); \
distance = REARM_ACTION_DISTANCE; \
condition = QUOTE(_this call FUNC(canReadSupplyCounter)); \
statement = QUOTE(_this call FUNC(readSupplyCounter)); \
exceptions[] = {"isNotInside"}; \
showDisabled = 0; \
priority = 2; \
icon = PATHTOF(ui\icon_rearm_interact.paa); \
}; \
class GVAR(Rearm) { \
displayName = CSTRING(Rearm); \
distance = REARM_ACTION_DISTANCE; \
condition = QUOTE(_this call FUNC(canRearmVehicle)); \
insertChildren = QUOTE(_target call FUNC(addRearmActions)); \
exceptions[] = {"isNotInside"}; \
showDisabled = 0; \
priority = 2; \
icon = PATHTOF(ui\icon_rearm_interact.paa); \
}; \
class GVAR(TakeAmmo) { \
displayName = CSTRING(TakeAmmo); \
distance = REARM_ACTION_DISTANCE; \
@ -37,6 +57,9 @@
}; \
};
#define MACRO_REARM_DEFAULT_SUPPLY \
GVAR(defaultSupply) = 1200;
class CBA_Extended_EventHandlers;
class CfgVehicles {
@ -72,6 +95,26 @@ class CfgVehicles {
};
};
};
class supply {
displayName = CSTRING(RearmSettings_supply_DisplayName);
description = CSTRING(RearmSettings_supply_Description);
typeName = "NUMBER";
class values {
class unlimited {
name = CSTRING(RearmSettings_unlimited);
value = 0;
default = 1;
};
class magazine {
name = CSTRING(RearmSettings_limited);
value = 1;
};
class caliber {
name = CSTRING(RearmSettings_magazineSupply);
value = 2;
};
};
};
};
class ModuleDescription {
description = CSTRING(RearmSettings_Module_Description);
@ -114,6 +157,7 @@ class CfgVehicles {
class Truck_03_base_F: Truck_F {};
class O_Truck_03_ammo_F: Truck_03_base_F {
transportAmmo = 0;
MACRO_REARM_DEFAULT_SUPPLY
MACRO_REARM_TRUCK_ACTIONS
};
@ -121,10 +165,12 @@ class CfgVehicles {
class Truck_02_Ammo_base_F: Truck_02_base_F {};
class I_Truck_02_ammo_F: Truck_02_Ammo_base_F {
transportAmmo = 0;
MACRO_REARM_DEFAULT_SUPPLY
MACRO_REARM_TRUCK_ACTIONS
};
class O_Truck_02_Ammo_F: Truck_02_Ammo_base_F {
transportAmmo = 0;
MACRO_REARM_DEFAULT_SUPPLY
MACRO_REARM_TRUCK_ACTIONS
};
@ -133,6 +179,7 @@ class CfgVehicles {
class B_Truck_01_mover_F: B_Truck_01_transport_F {};
class B_Truck_01_ammo_F: B_Truck_01_mover_F {
transportAmmo = 0;
MACRO_REARM_DEFAULT_SUPPLY
MACRO_REARM_TRUCK_ACTIONS
};
@ -148,6 +195,7 @@ class CfgVehicles {
class Heli_Transport_04_base_F: Helicopter_Base_H {};
class O_Heli_Transport_04_ammo_F: Heli_Transport_04_base_F {
transportAmmo = 0;
MACRO_REARM_DEFAULT_SUPPLY
MACRO_REARM_TRUCK_ACTIONS
};
@ -163,11 +211,13 @@ class CfgVehicles {
class Pod_Heli_Transport_04_base_F: Slingload_base_F {};
class Land_Pod_Heli_Transport_04_ammo_F: Pod_Heli_Transport_04_base_F {
transportAmmo = 0;
MACRO_REARM_DEFAULT_SUPPLY
MACRO_REARM_TRUCK_ACTIONS
};
class B_Slingload_01_Ammo_F: Slingload_01_Base_F {
transportAmmo = 0;
MACRO_REARM_DEFAULT_SUPPLY
MACRO_REARM_TRUCK_ACTIONS
};

View File

@ -1,26 +1,38 @@
PREP(addMagazineToSupply);
PREP(addRearmActions);
PREP(addVehicleMagazinesToSupply);
PREP(canReadSupplyCounter);
PREP(canRearm);
PREP(canRearmVehicle);
PREP(canStoreAmmo);
PREP(canTakeAmmo);
PREP(createDummy);
PREP(disable);
PREP(dropAmmo);
PREP(getCaliber);
PREP(getConfigMagazines);
PREP(getMaxMagazines);
PREP(getNeedRearmMagazines);
PREP(getSupplyCount);
PREP(getVehicleMagazines);
PREP(grabAmmo);
PREP(handleKilled);
PREP(handleUnconscious);
PREP(hasEnoughSupply);
PREP(magazineInSupply);
PREP(makeDummy);
PREP(moduleRearmSettings);
PREP(pickUpAmmo);
PREP(readSupplyCounter);
PREP(rearm);
PREP(rearmEntireVehicle);
PREP(rearmEntireVehicleSuccess);
PREP(rearmEntireVehicleSuccessLocal);
PREP(rearmSuccess);
PREP(rearmSuccessLocal);
PREP(removeMagazineFromSupply);
PREP(setSupplyCount);
PREP(storeAmmo);
PREP(takeAmmo);
PREP(takeSuccess);

View File

@ -1,6 +1,6 @@
#include "script_component.hpp"
["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;
["ace_unconscious", LINKFUNC(handleUnconscious)] call CBA_fnc_addEventHandler;
["vehicle", {
params ["_unit"];
[_unit] call FUNC(dropAmmo);
@ -10,9 +10,9 @@ if (isServer) then {
addMissionEventHandler ["HandleDisconnect", {params ["_unit"]; [_unit] call FUNC(dropAmmo)}];
};
[QGVAR(makeDummyEH), FUNC(makeDummy)] call CBA_fnc_addEventHandler;
[QGVAR(rearmEntireVehicleSuccessLocalEH), FUNC(rearmEntireVehicleSuccessLocal)] call CBA_fnc_addEventHandler;
[QGVAR(rearmSuccessLocalEH), FUNC(rearmSuccessLocal)] call CBA_fnc_addEventHandler;
[QGVAR(makeDummyEH), LINKFUNC(makeDummy)] call CBA_fnc_addEventHandler;
[QGVAR(rearmEntireVehicleSuccessLocalEH), LINKFUNC(rearmEntireVehicleSuccessLocal)] call CBA_fnc_addEventHandler;
[QGVAR(rearmSuccessLocalEH), LINKFUNC(rearmSuccessLocal)] call CBA_fnc_addEventHandler;
#ifdef DEBUG_MODE_FULL

View File

@ -10,4 +10,4 @@ if !(isNull _dummy) then {
detach _dummy;
deleteVehicle _dummy;
};
_unit setVariable [QGVAR(dummy), nil];
_unit setVariable [QGVAR(dummy), nil];

View File

@ -0,0 +1,69 @@
/*
* Author: GitHawk
* Adds magazines to the supply.
*
* Arguments:
* 0: Ammo Truck <OBJECT>
* 1: Magazine Classname <STRING>
* 2: Only partial <BOOL>(optional)
*
* Return Value:
* None
*
* Example:
* [ammo_truck, "32Rnd_155mm_Mo_shells"] call ace_rearm_fnc_addMagazineToSupply
*
* Public: Yes
*/
#include "script_component.hpp"
params [
["_truck", objNull, [objNull]],
["_magazineClass", "", [""]],
["_partial", false, [false]]
];
if (isNull _truck ||
{_magazineClass isEqualTo ""} ||
{GVAR(supply) == 0}) exitWith {};
([_magazineClass] call FUNC(getCaliber)) params ["_cal", "_idx"];
// With limited supply, we add the caliber to the supply count
if (GVAR(supply) == 1) then {
private _supply = [_truck] call FUNC(getSupplyCount);
if (!_partial || {GVAR(level) == 1}) then {
[_truck, _supply + _cal] call FUNC(setSupplyCount);
} else {
private _magazinePart = ((REARM_COUNT select _idx) / (getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count"))) min 1;
[_truck, (_supply + (_cal * _magazinePart))] call FUNC(setSupplyCount);
};
};
// With magazine specific supply, we add or update the magazineSupply array
if (GVAR(supply) == 2) then {
private _magazineSupply = _truck getVariable [QGVAR(magazineSupply), []];
private _magazineIdx = -1;
{
_x params ["_magazine", "_rounds"];
if ((_magazine isEqualTo _magazineClass)) exitWith {
_magazineIdx = _forEachIndex;
};
} forEach _magazineSupply;
private _roundsPerTransaction = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count");
if (_partial) then {
_roundsPerTransaction = _roundsPerTransaction min (REARM_COUNT select _idx);
};
if (_magazineIdx == -1) then {
if (count _magazineSupply == 0) then {
_magazineSupply = [[_magazineClass, _roundsPerTransaction]];
} else {
_magazineSupply append [[_magazineClass, _roundsPerTransaction]];
}
} else {
(_magazineSupply select _magazineIdx) params ["", "_rounds"];
_magazineSupply set [_magazineIdx, [_magazineClass, (_rounds + _roundsPerTransaction)]];
};
_truck setVariable [QGVAR(magazineSupply), _magazineSupply, true];
};

View File

@ -15,26 +15,27 @@
*/
#include "script_component.hpp"
private ["_vehicleActions", "_actions", "_action", "_vehicles", "_vehicle", "_needToAdd", "_magazineHelper", "_turretPath", "_magazines", "_magazine", "_icon", "_cnt"];
params [["_target", objNull, [objNull]]];
params [
["_truck", objNull, [objNull]]
];
_vehicles = nearestObjects [_target, ["AllVehicles"], 20];
private _vehicles = nearestObjects [_truck, ["AllVehicles"], 20];
if (count _vehicles < 2) exitWith {false}; // Rearming needs at least 2 vehicles
_vehicleActions = [];
private _vehicleActions = [];
{
_actions = [];
_vehicle = _x;
_needToAdd = false;
_action = [];
if !((_vehicle == _target) || (_vehicle isKindOf "CAManBase")) then {
_magazineHelper = [];
private _actions = [];
private _vehicle = _x;
private _needToAdd = false;
private _action = [];
if !((_vehicle == _truck) || (_vehicle isKindOf "CAManBase")) then {
private _magazineHelper = [];
{
_turretPath = _x;
_magazines = [_vehicle, _turretPath] call FUNC(getConfigMagazines);
private _turretPath = _x;
private _magazines = [_vehicle, _turretPath] call FUNC(getVehicleMagazines);
{
_magazine = _x;
_currentMagazines = { _x == _magazine } count (_vehicle magazinesTurret _turretPath);
private _magazine = _x;
private _currentMagazines = { _x == _magazine } count (_vehicle magazinesTurret _turretPath);
if ((_currentMagazines < ([_vehicle, _turretPath, _magazine] call FUNC(getMaxMagazines))) && !(_magazine in _magazineHelper)) then {
_action = [_magazine,
getText(configFile >> "CfgMagazines" >> _magazine >> "displayName"),
@ -43,9 +44,11 @@ _vehicleActions = [];
{true},
{},
[_magazine, _vehicle]] call EFUNC(interact_menu,createAction);
_actions pushBack [_action, [], _target];
_magazineHelper pushBack _magazine;
_needToAdd = true;
if (GVAR(supply) == 0 || {(GVAR(supply) == 1) && ([_truck, _magazine] call FUNC(hasEnoughSupply))} || {(GVAR(supply) == 2) && ([_truck, _magazine] call FUNC(magazineInSupply))}) then {
_actions pushBack [_action, [], _truck];
_magazineHelper pushBack _magazine;
_needToAdd = true;
};
} else {
if (((_vehicle magazineTurretAmmo [_magazine, _turretPath]) < getNumber (configFile >> "CfgMagazines" >> _magazine >> "count")) && !(_magazine in _magazineHelper)) then {
_action = [_magazine,
@ -55,16 +58,20 @@ _vehicleActions = [];
{true},
{},
[_magazine, _vehicle]] call EFUNC(interact_menu,createAction);
_actions pushBack [_action, [], _target];
_magazineHelper pushBack _magazine;
_needToAdd = true;
if (GVAR(supply) == 0 || {(GVAR(supply) == 1) && ([_truck, _magazine] call FUNC(hasEnoughSupply))} || {(GVAR(supply) == 2) && ([_truck, _magazine] call FUNC(magazineInSupply))}) then {
_actions pushBack [_action, [], _truck];
_magazineHelper pushBack _magazine;
_needToAdd = true;
};
};
};
} forEach _magazines;
} forEach REARM_TURRET_PATHS;
false
} count _magazines;
false
} count REARM_TURRET_PATHS;
};
if (_needToAdd && !(_vehicle getVariable [QGVAR(disabled), false])) then {
_icon = getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "Icon");
private _icon = getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "Icon");
if !((_icon select [0, 1]) == "\") then {
_icon = "";
};
@ -76,7 +83,7 @@ _vehicleActions = [];
{true},
{},
_vehicle] call EFUNC(interact_menu,createAction);
_vehicleActions pushBack [_action, [], _target];
_vehicleActions pushBack [_action, [], _truck];
} else {
_action = [_vehicle,
getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName"),
@ -85,9 +92,10 @@ _vehicleActions = [];
{true},
{},
[]] call EFUNC(interact_menu,createAction);
_vehicleActions pushBack [_action, _actions, _target];
_vehicleActions pushBack [_action, _actions, _truck];
};
};
} forEach _vehicles;
false
} count _vehicles;
_vehicleActions

View File

@ -0,0 +1,40 @@
/*
* Author: GitHawk
* Adds all magazines of a vehicle to the supply.
*
* Arguments:
* 0: Ammo Truck <OBJECT>
* 1: Vehicle or Vehicle class <OBJECT/STRING>
*
* Return Value:
* None
*
* Example:
* [ammo_truck, tank] call ace_rearm_fnc_addVehicleMagazinesToSupply
* [ammo_truck, "B_MBT_01_arty_F"] call ace_rearm_fnc_addVehicleMagazinesToSupply
*
* Public: Yes
*/
#include "script_component.hpp"
params [
["_truck", objNull, [objNull]],
["_vehicle", objNull, [objNull, ""]]
];
if (isNull _truck ||
{_vehicle isEqualType objNull}) exitWith {};
private _string = [_vehicle, typeOf _vehicle] select (_vehicle isEqualType objNull);
if (_string == "") exitWith {
ERROR_1("_string [%1] is empty in ace_rearm_fnc_addVehicleMagazinesToSupply",_string);
};
{
private _turretPath = _x;
private _magazines = [_string, _turretPath] call FUNC(getConfigMagazines);
{
[_truck, _x] call FUNC(addMagazineToSupply);
false
} count _magazines;
false
} count REARM_TURRET_PATHS;

View File

@ -0,0 +1,29 @@
/*
* Author: GitHawk
* Checks if unit can read supply counter.
*
* Arguments:
* 0: Ammo Truck <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* Can read supply counter <BOOL>
*
* Example:
* [ammo_truck, player] call ace_rearm_fnc_canReadSupplyCounter
*
* Public: No
*/
#include "script_component.hpp"
params [
["_truck", objNull, [objNull]],
["_unit", objNull, [objNull]]
];
!(isNull _unit ||
{!(_unit isKindOf "CAManBase")} ||
{!local _unit} ||
{!alive _truck} ||
{(_truck distance _unit) > REARM_ACTION_DISTANCE} ||
{GVAR(supply) == 0})

View File

@ -3,29 +3,30 @@
* Check if a unit can rearm.
*
* Arguments:
* 0: Target <OBJECT>
* 0: Vehicle <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* Can Rearm <BOOL>
*
* Example:
* [player, tank] call ace_rearm_fnc_canRearm
* [tank, player] call ace_rearm_fnc_canRearm
*
* Public: No
*/
#include "script_component.hpp"
private ["_dummy","_magazineClass"];
params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]];
params [
["_vehicle", objNull, [objNull]],
["_unit", objNull, [objNull]]
];
if (!alive _target) exitWith {false};
if (!alive _vehicle) exitWith {false};
if (GVAR(level) == 0 || {isNull _unit} || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {_vehicle distance _unit > REARM_ACTION_DISTANCE} || {_vehicle getVariable [QGVAR(disabled), false]}) exitWith {false};
if (GVAR(level) == 0 || {isNull _unit} || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {([_unit, _target] call EFUNC(interaction,getInteractionDistance)) > REARM_ACTION_DISTANCE} || {_target getVariable [QGVAR(disabled), false]}) exitWith {false};
_dummy = _unit getVariable [QGVAR(dummy), objNull];
private _dummy = _unit getVariable [QGVAR(dummy), objNull];
if (isNull _dummy) exitwith {false};
_magazineClass = _dummy getVariable QGVAR(magazineClass);
private _magazineClass = _dummy getVariable QGVAR(magazineClass);
if (isNil "_magazineClass") exitWith {false};
([_target, _magazineClass] call FUNC(getNeedRearmMagazines)) select 0
([_vehicle, _magazineClass] call FUNC(getNeedRearmMagazines)) select 0

View File

@ -0,0 +1,29 @@
/*
* Author: GitHawk
* Check if a unit can rearm a vehicle.
*
* Arguments:
* 0: Vehicle <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* Can Pick Up Ammo <BOOL>
*
* Example:
* [tank, player] call ace_rearm_fnc_canRearmVehicle
*
* Public: No
*/
#include "script_component.hpp"
params [
["_vehicle", objNull, [objNull]],
["_unit", objNull, [objNull]]
];
!(isNull _unit ||
{!(_unit isKindOf "CAManBase")} ||
{!local _unit} ||
{(_vehicle distance _unit) > REARM_ACTION_DISTANCE} ||
{!isNull (_unit getVariable [QGVAR(dummy), objNull])} ||
{GVAR(level) > 0})

View File

@ -10,17 +10,20 @@
* Can Store Ammo <BOOL>
*
* Example:
* [player, tank] call ace_rearm_fnc_canStoreAmmo
* [ammo_truck, player] call ace_rearm_fnc_canStoreAmmo
*
* Public: No
*/
#include "script_component.hpp"
params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]];
params [
["_truck", objNull, [objNull]],
["_unit", objNull, [objNull]]
];
!(isNull _unit ||
{!alive _target} ||
{!alive _truck} ||
{!(_unit isKindOf "CAManBase")} ||
{!local _unit} ||
{(_target distance _unit) > REARM_ACTION_DISTANCE} ||
{(_truck distance _unit) > REARM_ACTION_DISTANCE} ||
{isNull (_unit getVariable [QGVAR(dummy), objNull])})

View File

@ -10,17 +10,21 @@
* Can Pick Up Ammo <BOOL>
*
* Example:
* [player, tank] call ace_rearm_fnc_canTakeAmmo
* [ammo_truck, player] call ace_rearm_fnc_canTakeAmmo
*
* Public: No
*/
#include "script_component.hpp"
params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]];
params [
["_truck", objNull, [objNull]],
["_unit", objNull, [objNull]]
];
!(isNull _unit ||
{!alive _target} ||
{!alive _truck} ||
{!(_unit isKindOf "CAManBase")} ||
{!local _unit} ||
{(_target distance _unit) > REARM_ACTION_DISTANCE} ||
{!isNull (_unit getVariable [QGVAR(dummy), objNull])})
{(_truck distance _unit) > REARM_ACTION_DISTANCE} ||
{!isNull (_unit getVariable [QGVAR(dummy), objNull])} ||
{GVAR(level) == 0})

View File

@ -10,18 +10,20 @@
* Created Dummy <OBJECT>
*
* Example:
* ["500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_createDummy
* [player, "500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_createDummy
*
* Public: No
*/
#include "script_component.hpp"
private ["_ammo", "_dummyName", "_dummy"];
params [["_unit", objNull, [objNull]], ["_magazineClass", "", [""]]];
params [
["_unit", objNull, [objNull]],
["_magazineClass", "", [""]]
];
_ammo = getText (configFile >> "CfgMagazines" >> _magazineClass >> "ammo");
_dummyName = getText (configFile >> "CfgAmmo" >> _ammo >> QGVAR(dummy));
_dummy = objNull;
private _ammo = getText (configFile >> "CfgMagazines" >> _magazineClass >> "ammo");
private _dummyName = getText (configFile >> "CfgAmmo" >> _ammo >> QGVAR(dummy));
private _dummy = objNull;
if !(_dummyName == "") then {
_dummy = _dummyName createVehicle (position _unit);
} else {

View File

@ -3,8 +3,8 @@
* Disables rearm for a vehicle.
*
* Arguments:
* 0: Target <OBJECT>
* 1: Disable <BOOL><OPTIONAL>
* 0: Vehicle <OBJECT>
* 1: Disable <BOOL>(optional)
*
* Return Value:
* None
@ -17,5 +17,9 @@
*/
#include "script_component.hpp"
params [["_target", objNull, [objNull]], ["_disable", true, [true]]];
_target setVariable [QGVAR(disabled), _disable, true];
params [
["_vehicle", objNull, [objNull]],
["_disable", true, [true]]
];
_vehicle setVariable [QGVAR(disabled), _disable, true];

View File

@ -4,8 +4,8 @@
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Delete dummy object <BOOL> (optional)
* 2: Unholster Weapon <BOOL> (optional)
* 1: Delete dummy object <BOOL>(optional)
* 2: Unholster Weapon <BOOL>(optional)
*
* Return Value:
* None
@ -17,12 +17,13 @@
*/
#include "script_component.hpp"
private ["_dummy", "_actionID"];
params [["_unit", objNull, [objNull]], ["_delete", false, [false]], ["_unholster", true, [true]]];
params [
["_unit", objNull, [objNull]],
["_delete", false, [false]],
["_unholster", true, [true]]
];
if (isNull _unit) exitWith {};
_dummy = _unit getVariable [QGVAR(dummy), objNull];
private _dummy = _unit getVariable [QGVAR(dummy), objNull];
if !(isNull _dummy) then {
detach _dummy;
if (_delete) then {
@ -31,9 +32,8 @@ if !(isNull _dummy) then {
_dummy setVelocity [0,0,-0.1];
};
_unit setVariable [QGVAR(dummy), objNull];
//_unit setVariable [QEGVAR(dragging,isCarrying), false, true]; // breaks things, since it hides interact menu on _target
};
_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1];
private _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1];
if (_actionID != -1) then {
_unit removeAction _actionID;
_unit setVariable [QGVAR(ReleaseActionID), nil];

View File

@ -0,0 +1,50 @@
/*
* Author: GitHawk
* Get the caliber of the ammo in a magazine and return its parameters.
*
* Arguments:
* 0: Magazine Classname <STRING>
*
* Return Value:
* 0: Caliber information <ARRAY>
* 0: Rounded caliber <NUMBER>
* 1: Caliber index <NUMBER>
*
* Example:
* ["500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_getCaliber
*
* Public: No
*/
#include "script_component.hpp"
params [
["_magazineClass", "", [""]]
];
if (_magazineClass isEqualTo "") exitWith {[8, 2]};
private _ammo = getText (configFile >> "CfgMagazines" >> _magazineClass >> "ammo");
private _tmpCal = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_caliber");
private _cal = 8;
if (_tmpCal > 0) then {
_cal = _tmpCal;
} else {
_tmpCal = getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(caliber));
if (_tmpCal > 0) then {
_cal = _tmpCal;
} else {
diag_log format ["[ACE] ERROR: Undefined Ammo [%1 : %2]", _ammo, inheritsFrom (configFile >> "CfgAmmo" >> _ammo)];
if (_ammo isKindOf "BulletBase") then {
_cal = 8;
} else {
_cal = 100;
};
};
};
_cal = round _cal;
private _idx = REARM_CALIBERS find _cal;
if (_idx == -1 ) then {
_idx = 2;
};
[_cal, _idx]

View File

@ -1,32 +1,37 @@
/*
* Author: GitHawk, Jonpas
* Returns all magazines a turret can hold according to config.
* Returns all magazines a turret of a vehicle class can hold according to config.
*
* Arguments:
* 0: Target <OBJECT>
* 0: Vehicle class <STRING>
* 1: Turret Path <ARRAY>
*
* Return Value:
* Magazine classes in TurretPath <ARRAY>
*
* Example:
* [vehicle, [0]] call ace_rearm_fnc_getConfigMagazines
* ["B_MBT_01_arty_F", [0]] call ace_rearm_fnc_getConfigMagazines
*
* Public: No
*/
#include "script_component.hpp"
params [["_target", objNull, [objNull]], ["_turretPath", [], [[]]]];
params [
["_cfgString", "", [""]],
["_turretPath", [], [[]]]
];
if (isNull _target) exitWith {[]};
if (_cfgString == "") exitWith {[]};
_cfg = configFile >> "CfgVehicles" >> (typeOf _target) >> "Turrets";
private _cfg = configFile >> "CfgVehicles" >> _cfgString >> "Turrets";
if !(isClass _cfg) exitWith {[]};
if (count _turretPath == 1) then {
_turretPath params ["_subPath"];
if (_subPath == -1) exitWith {
_cfg = configFile >> "CfgVehicles" >> (typeOf _target);
_cfg = configFile >> "CfgVehicles" >> _cfgString;
};
if (count _cfg > _subPath) then {

View File

@ -3,7 +3,7 @@
* Calculates the maximum number of magazines a turret can hold according to config.
*
* Arguments:
* 0: Target <OBJECT>
* 0: Vehicle <OBJECT>
* 1: Turret Path <ARRAY>
* 2: Magazine Classname <STRING>
*
@ -17,9 +17,13 @@
*/
#include "script_component.hpp"
params [["_target", objNull, [objNull]], ["_turretPath", [], [[]]], ["_magazineClass", "", [""]]];
params [
["_vehicle", objNull, [objNull]],
["_turretPath", [], [[]]],
["_magazineClass", "", [""]]
];
if (isNull _target) exitWith {0};
if (isNull _vehicle) exitWith {0};
private _count = {_x == _magazineClass} count ([_target, _turretPath] call FUNC(getConfigMagazines));
private _count = {_x == _magazineClass} count ([_vehicle, _turretPath] call FUNC(getVehicleMagazines));
_count

View File

@ -3,7 +3,7 @@
* Get rearm return value.
*
* Arguments:
* 0: Target <OBJECT>
* 0: Vehicle <OBJECT>
* 1: Magazine Classname <STRING>
*
* Return Value:
@ -13,32 +13,35 @@
* 2: Number of current magazines in turret path <NUMBER>
*
* Example:
* [tank, "mag"] call ace_rearm_fnc_getNeedRearmMagazines
* [tank, "500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_getNeedRearmMagazines
*
* Public: No
*/
#include "script_component.hpp"
private ["_return", "_magazines", "_currentMagazines"];
params ["_target", "_magazineClass"];
params [
["_vehicle", objNull, [objNull]],
["_magazineClass", "", [""]]
];
_return = [false, [], 0];
private _return = [false, [], 0];
{
_magazines = [_target, _x] call FUNC(getConfigMagazines);
private _magazines = [_vehicle, _x] call FUNC(getVehicleMagazines);
if (_magazineClass in _magazines) then {
_currentMagazines = {_x == _magazineClass} count (_target magazinesTurret _x);
private _currentMagazines = {_x == _magazineClass} count (_vehicle magazinesTurret _x);
if ((_target magazineTurretAmmo [_magazineClass, _x]) < getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count")) exitWith {
if ((_vehicle magazineTurretAmmo [_magazineClass, _x]) < getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count")) exitWith {
_return = [true, _x, _currentMagazines];
};
if (_currentMagazines < ([_target, _x, _magazineClass] call FUNC(getMaxMagazines))) exitWith {
if (_currentMagazines < ([_vehicle, _x, _magazineClass] call FUNC(getMaxMagazines))) exitWith {
_return = [true, _x, _currentMagazines];
};
};
if (_return select 0) exitWith {};
} forEach REARM_TURRET_PATHS;
false
} count REARM_TURRET_PATHS;
_return

View File

@ -0,0 +1,29 @@
/*
* Author: GitHawk
* Get the supply count.
*
* Arguments:
* 0: Ammo Truck <OBJECT>
*
* Return Value:
* Supply count <NUMBER>
*
* Example:
* [ammo_truck] call ace_rearm_fnc_getSupplyCount
*
* Public: Yes
*/
#include "script_component.hpp"
params [
["_truck", objNull, [objNull]]
];
private _supply = _truck getVariable QGVAR(currentSupply);
if (isNil "_supply") then {
_supply = getNumber (configFile >> "CfgVehicles" >> typeOf _truck >> QGVAR(defaultSupply));
_truck setVariable [QGVAR(currentSupply), _supply, true];
};
_supply

View File

@ -0,0 +1,26 @@
/*
* Author: GitHawk, Jonpas
* Returns all magazines a turret of a vehicle object can hold according to config.
*
* Arguments:
* 0: Vehicle <OBJECT>
* 1: Turret Path <ARRAY>
*
* Return Value:
* Magazine classes in TurretPath <ARRAY>
*
* Example:
* [vehicle, [0]] call ace_rearm_fnc_getVehicleMagazines
*
* Public: No
*/
#include "script_component.hpp"
params [
["_vehicle", objNull, [objNull]],
["_turretPath", [], [[]]]
];
if (isNull _vehicle) exitWith {[]};
([typeOf _vehicle, _turretPath] call FUNC(getConfigMagazines))

View File

@ -16,15 +16,19 @@
*/
#include "script_component.hpp"
params [["_dummy", objNull, [objNull]], ["_unit", objNull, [objNull]]];
params [
["_dummy", objNull, [objNull]],
["_unit", objNull, [objNull]]
];
REARM_HOLSTER_WEAPON
REARM_HOLSTER_WEAPON;
[_unit, "forceWalk", QGVAR(vehRearm), true] call EFUNC(common,statusEffect_set);
[
5,
[_dummy, _unit],
{
private ["_actionID"];
params ["_args"];
_args params ["_dummy", "_unit"];
[_dummy, _unit] call FUNC(pickUpAmmo);

View File

@ -15,7 +15,9 @@
*/
#include "script_component.hpp"
params [["_unit", objNull, [objNull]]];
params [
["_unit", objNull, [objNull]]
];
if (!local _unit) exitWith {};

View File

@ -16,7 +16,10 @@
*/
#include "script_component.hpp"
params [["_unit", objNull, [objNull]], ["_isUnconscious", false, [false]]];
params [
["_unit", objNull, [objNull]],
["_isUnconscious", false, [false]]
];
if (!local _unit || {!_isUnconscious}) exitWith {};

View File

@ -0,0 +1,42 @@
/*
* Author: GitHawk
* Check whether enough supply is left to take the magazine.
*
* Arguments:
* 0: Ammo Truck <OBJECT>
* 1: Magazine Classname <STRING>
*
* Return Value:
* Enough supply <BOOL>
*
* Example:
* [ammo_truck, "500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_hasEnoughSupply
*
* Public: No
*/
#include "script_component.hpp"
params [
["_truck", objNull, [objNull]],
["_magazineClass", "", [""]]
];
if (isNull _truck ||
{_magazineClass isEqualTo ""}) exitWith {false};
// With infinite supply, there is always enough
if (GVAR(supply) == 0) exitWith {true};
// With magazine specific supply, we need to check stored magazines
if (GVAR(supply) == 2) exitWith {_this call FUNC(magazineInSupply)};
private _supply = [_truck] call FUNC(getSupplyCount);
([_magazineClass] call FUNC(getCaliber)) params ["_cal", "_idx"];
// With caliber based rearming, we only need partial supply
if (GVAR(level) == 2) exitWith {
// If REARM_COUNT is bigger than the magazine size, we might get a bigger number than 1
private _magazinePart = ((REARM_COUNT select _idx) / (getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count"))) min 1;
(_cal * _magazinePart <= _supply)
};
(_cal <= _supply)

View File

@ -0,0 +1,42 @@
/*
* Author: GitHawk
* Returns true if the magazine is in the current supply
*
* Arguments:
* 0: Ammo Truck <OBJECT>
* 1: Magazine Classname <STRING>
*
* Return Value:
* Magazine in supply <BOOL>
*
* Example:
* [ammo_truck, "500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_magazineInSupply
*
* Public: No
*/
#include "script_component.hpp"
params [
["_truck", objNull, [objNull]],
["_magazineClass", "", [""]]
];
if (isNull _truck ||
{_magazineClass isEqualTo ""}) exitWith {false};
// With limited supply, we need to check supply
if (GVAR(supply) == 1) exitWith {_this call FUNC(hasEnoughSupply)};
// With magazine specific supply, we need to check them
if (GVAR(supply) == 2) exitWith {
private _magazineSupply = _truck getVariable [QGVAR(magazineSupply), []];
private _magazinePresent = false;
{
_x params ["_magazine", "_rounds"];
if ((_magazine isEqualTo _magazineClass) && (_rounds > 0)) exitWith {_magazinePresent = true; };
false
} count _magazineSupply;
_magazinePresent
};
// With infinite supply, there is always one left
true

View File

@ -16,7 +16,10 @@
*/
#include "script_component.hpp"
params [["_obj", objNull, [objNull]], ["_dirAndUp", [[1,0,0],[0,0,1]], [[]]]];
params [
["_obj", objNull, [objNull]],
["_dirAndUp", [[1,0,0],[0,0,1]], [[]]]
];
_obj setVectorDirAndUp _dirAndUp;
_obj allowDamage false;

View File

@ -17,10 +17,15 @@
*/
#include "script_component.hpp"
params ["_logic", "", ["_activated", false, [false]]];
params [
"_logic",
"",
["_activated", false, [false]]
];
if (!_activated) exitWith {};
[_logic, QGVAR(level), "level"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(supply), "supply"] call EFUNC(common,readSettingFromModule);
diag_log text format ["[ACE]: Rearm Module Initialized on level: %1", GVAR(level)];
INFO_2("Module Initialized [level: %1][supply: %2]", GVAR(level), GVAR(supply));

View File

@ -16,15 +16,18 @@
*/
#include "script_component.hpp"
params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]];
params [
["_dummy", objNull, [objNull]],
["_unit", objNull, [objNull]]
];
_dummy = _unit getVariable [QGVAR(dummy), objNull];
if !(isNull _dummy) exitWith {};
private _attachedDummy = _unit getVariable [QGVAR(dummy), objNull];
if !(isNull _attachedDummy) exitWith {};
//_target attachTo [_unit, [0,0.7,0], "pelvis"];
_target attachTo [_unit, [0,1,0], "pelvis"];
{
[QGVAR(makeDummyEH), [_dummy, [[-1,0,0],[0,0,1]]], _x] call CBA_fnc_targetEvent;
} count (position _unit nearObjects ["CAManBase", 100]);
_unit setVariable [QGVAR(dummy), _target];
//_unit setVariable [QEGVAR(dragging,isCarrying), true, true]; // breaks things, since it hides interact menu on _target
_dummy attachTo [_unit, [0,1,0], "pelvis"];
private _nearUnits = _unit nearObjects ["CAManBase", 100];
// disableCollisionWith damage with the nearby units:
[QGVAR(makeDummyEH), [_dummy, [[-1,0,0],[0,0,1]]], _nearUnits] call CBA_fnc_targetEvent;
_unit setVariable [QGVAR(dummy), _dummy];

View File

@ -0,0 +1,78 @@
/*
* Author: GitHawk
* Get the remaining ammunition amount.
*
* Arguments:
* 0: Ammo Truck <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [ammo_truck, player] call ace_rearm_fnc_readSupplyCounter
*
* Public: No
*/
#include "script_component.hpp"
params [
["_truck", objNull, [objNull]],
["_unit", objNull, [objNull]]
];
if (GVAR(supply) == 0) exitWith {};
if (GVAR(supply) == 1) then {
[
5,
[_unit, _truck, [_truck] call FUNC(getSupplyCount)],
{
params ["_args"];
_args params [["_unit", objNull, [objNull]], ["_truck", objNull, [objNull]], ["_supplyCount", 0, [0]]];
if (_supplyCount > 0 ) then {
[[LSTRING(Hint_RemainingSupplyPoints), _supplyCount], 2, _unit] call EFUNC(common,displayTextStructured);
} else {
[LSTRING(Hint_EmptySupplyPoints), 2, _unit] call EFUNC(common,displayTextStructured);
};
true
},
{true},
localize LSTRING(ReadSupplyCounterAction),
{true},
["isnotinside"]
] call EFUNC(common,progressBar);
} else {
[
5,
[_unit, _truck],
{
params ["_args"];
_args params [["_unit", objNull, [objNull]], ["_truck", objNull, [objNull]]];
private _supply = 1.5;
private _numChars = count (localize LSTRING(Hint_RemainingAmmo));
private _text = "";
private _magazines = _truck getVariable QGVAR(magazineSupply);
if !(isNil "_magazines") then {
{
_x params ["_magazineClass", "_rounds"];
private _line = format ["%1: %2", getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), _rounds];
_numChars = _numChars max (count _line);
_text = format ["%1<br/>%2", _text, _line];
_supply = _supply + 0.5;
false
} count _magazines;
};
if (_supply > 1.5) then {
[[LSTRING(Hint_RemainingAmmo), _text], _supply, _unit, (_numChars/2.9)] call EFUNC(common,displayTextStructured);
} else {
[LSTRING(Hint_Empty), 2, _unit] call EFUNC(common,displayTextStructured);
};
true
},
{true},
localize LSTRING(ReadSupplyCounterAction),
{true},
["isnotinside"]
] call EFUNC(common,progressBar);
};

View File

@ -3,52 +3,33 @@
* Starts progress bar for rearming a vehicle.
*
* Arguments:
* 0: Unit <OBJECT>
* 0: Target Vehicle <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player] call ace_rearm_fnc_rearm
* [tank, player] call ace_rearm_fnc_rearm
*
* Public: No
*/
#include "script_component.hpp"
private ["_magazineClass", "_ammo", "_tmpCal", "_cal", "_idx", "_needRearmMags", "_magazineDisplayName"];
params [["_unit", objNull, [objNull]]];
params [
["_target", objNull, [objNull]],
["_unit", objNull, [objNull]]
];
_dummy = _unit getVariable [QGVAR(dummy), objNull];
if (isNull _dummy) exitwith {false};
_magazineClass = _dummy getVariable QGVAR(magazineClass);
private _attachedDummy = _unit getVariable [QGVAR(dummy), objNull];
if (isNull _attachedDummy) exitwith {false};
private _magazineClass = _attachedDummy getVariable QGVAR(magazineClass);
if (isNil "_magazineClass") exitWith {false};
_ammo = getText (configFile >> "CfgMagazines" >> _magazineClass >> "ammo");
_tmpCal = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_caliber");
_cal = 8;
if (_tmpCal > 0) then {
_cal = _tmpCal;
} else {
_tmpCal = getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(caliber));
if (_tmpCal > 0) then {
_cal = _tmpCal;
} else {
diag_log format ["[ACE] ERROR: Undefined Ammo [%1 : %2]", _ammo, inheritsFrom (configFile >> "CfgAmmo" >> _ammo)];
if (_ammo isKindOf "BulletBase") then {
_cal = 8;
} else {
_cal = 100;
};
};
};
_cal = round _cal;
_idx = REARM_CALIBERS find _cal;
if (_idx == -1) then {
_idx = 2;
};
([_magazineClass] call FUNC(getCaliber)) params ["_cal", "_idx"];
// Get magazines that can be rearmed
_needRearmMags = [_target, _magazineClass] call FUNC(getNeedRearmMagazines);
private _needRearmMags = [_target, _magazineClass] call FUNC(getNeedRearmMagazines);
_needRearmMags params ["_needRearm", "_turretPath", "_cnt"];
// Exit if no magazines need rearming
@ -56,9 +37,7 @@ if (!_needRearm) exitWith {
diag_log format ["[ACE] ERROR: Could not find turret for %1 in %2", _magazineClass, typeOf _target];
};
//hint format ["Magazine: %1\nAmmo: %2\nCaliber: %3\nIndex: %4\nTurretPath: %5\nREARM_DURATION_REARM: %6\nCount: %7", _magazine, _ammo, _cal, _idx, _turretPath, (REARM_DURATION_REARM select _idx), (REARM_COUNT select _idx)];
_magazineDisplayName = getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName");
private _magazineDisplayName = getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName");
if (_magazineDisplayName == "") then {
_magazineDisplayName = _magazineClass;
diag_log format ["[ACE] ERROR: Magazine is missing display name [%1]", _magazineClass];

View File

@ -16,11 +16,16 @@
* Public: No
*/
#include "script_component.hpp"
params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]], ["_vehicle", objNull, [objNull]]]; // _target is for future possible finite ammo, _unit placeholder
params [
["_truck", objNull, [objNull]],
"",
["_vehicle", objNull, [objNull]]
];
[
10,
_vehicle,
[_truck, _vehicle],
FUNC(rearmEntireVehicleSuccess),
"",
format [localize LSTRING(BasicRearmAction), getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")],

View File

@ -3,41 +3,36 @@
* Rearm an entire vehicle.
*
* Arguments:
* 0: Vehicle <OBJECT>
* 0: Rearm information <ARRAY>
* 0: Ammo Truck <OBJECT>
* 1: Vehicle <OBJECT
*
* Return Value:
* None
*
* Example:
* [tank] call ace_rearm_fnc_rearmEntireVehicleSuccess
* [[ammo_truck, tank]] call ace_rearm_fnc_rearmEntireVehicleSuccess
*
* Public: No
*/
#include "script_component.hpp"
private ["_turretPath", "_magazines", "_magazine", "_currentMagazines", "_maxMagazines", "_maxRounds", "_currentRounds"];
params [["_vehicle", objNull, [objNull]]];
TRACE_1("params",_vehicle);
params ["_args"];
_args params [
["_truck", objNull, [objNull]],
["_vehicle", objNull, [objNull]]
];
//ToDo: Cleanup with CBA_fnc_ownerEvent in CBA 2.4.2
{
[QGVAR(rearmEntireVehicleSuccessLocalEH), [_vehicle, _x]] call CBA_fnc_globalEvent;
} forEach REARM_TURRET_PATHS;
/*
if (isServer) then {
{
_turretOwnerID = _vehicle turretOwner _x;
private _turretOwnerID = _vehicle turretOwner _x;
if (_turretOwnerID == 0) then {
//wtf is _truck from???
[QGVAR(rearmEntireVehicleSuccessLocalEH), [_truck, _vehicle, _x], _truck] call CBA_fnc_targetEvent;
} else {
[QGVAR(rearmEntireVehicleSuccessLocalEH), [_truck, _vehicle, _x], _turretOwnerID] call CBA_fnc_targetEvent;
[QGVAR(rearmEntireVehicleSuccessLocalEH), [_truck, _vehicle, _x], _turretOwnerID] call CBA_fnc_ownerEvent;
};
false
} count REARM_TURRET_PATHS;
} else {
[QGVAR(rearmEntireVehicleSuccessLocalEH), _this] call CBA_fnc_serverEvent;
};
*/

View File

@ -3,33 +3,34 @@
* Rearm an entire turret locally.
*
* Arguments:
* 0: Vehicle <OBJECT>
* 1: TurretPath <ARRAY>
* 0: Ammo Truck <OBJECT>
* 1: Vehicle <OBJECT>
* 2: TurretPath <ARRAY>
*
* Return Value:
* None
*
* Example:
* [tank, [0]] call ace_rearm_fnc_rearmEntireVehicleSuccessLocal
* [ammo_truck, tank, [0]] call ace_rearm_fnc_rearmEntireVehicleSuccessLocal
*
* Public: No
*/
#include "script_component.hpp"
private ["_magazines", "_magazine", "_currentMagazines", "_maxMagazines", "_maxRounds", "_currentRounds"];
params [["_vehicle", objNull, [objNull]], ["_turretPath", [], [[]]]];
TRACE_2("params",_vehicle,_turretPath);
params [
["_truck", objNull, [objNull]],
["_vehicle", objNull, [objNull]],
["_turretPath", [], [[]]]
];
//ToDo: Cleanup with CBA_fnc_ownerEvent in CBA 2.4.2
if (!(_vehicle turretLocal _turretPath)) exitWith {TRACE_1("not local turret",_turretPath);};
_magazines = [_vehicle, _turretPath] call FUNC(getConfigMagazines);
private _magazines = [_vehicle, _turretPath] call FUNC(getVehicleMagazines);
if (isNil "_magazines") exitWith {};
{
_magazine = _x;
_currentMagazines = { _x == _magazine } count (_vehicle magazinesTurret _turretPath);
_maxMagazines = [_vehicle, _turretPath, _magazine] call FUNC(getMaxMagazines);
_maxRounds = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count");
_currentRounds = _vehicle magazineTurretAmmo [_magazine, _turretPath];
private _magazine = _x;
private _currentMagazines = { _x == _magazine } count (_vehicle magazinesTurret _turretPath);
private _maxMagazines = [_vehicle, _turretPath, _magazine] call FUNC(getMaxMagazines);
private _maxRounds = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count");
private _currentRounds = _vehicle magazineTurretAmmo [_magazine, _turretPath];
TRACE_7("Rearmed Turret",_vehicle,_turretPath,_currentMagazines,_maxMagazines,_currentRounds,_maxRounds,_magazine);
@ -38,11 +39,28 @@ _magazines = [_vehicle, _turretPath] call FUNC(getConfigMagazines);
_currentMagazines = _currentMagazines + 1;
};
if (_currentMagazines < _maxMagazines) then {
_vehicle setMagazineTurretAmmo [_magazine, _maxRounds, _turretPath];
for "_idx" from 1 to (_maxMagazines - _currentMagazines) do {
_vehicle addMagazineTurret [_magazine, _turretPath];
private _success = true;
if (GVAR(supply) > 0) then {
_success = [_truck, _magazine, (_maxRounds - _currentRounds)] call FUNC(removeMagazineFromSupply);
};
if (_success) then {
_vehicle setMagazineTurretAmmo [_magazine, _maxRounds, _turretPath];
for "_idx" from 1 to (_maxMagazines - _currentMagazines) do {
_success = true;
if (GVAR(supply) > 0) then {
_success = [_truck, _magazine, _maxRounds] call FUNC(removeMagazineFromSupply);
};
_vehicle addMagazineTurret [_magazine, _turretPath];
};
};
} else {
_vehicle setMagazineTurretAmmo [_magazine, _maxRounds, _turretPath];
private _success = true;
if (GVAR(supply) > 0) then {
_success = [_truck, _magazine, (_maxRounds - _currentRounds)] call FUNC(removeMagazineFromSupply);
};
if (_success) then {
_vehicle setMagazineTurretAmmo [_magazine, _maxRounds, _turretPath];
};
};
} foreach _magazines;
false
} count _magazines;

View File

@ -4,7 +4,7 @@
*
* Arguments:
* 0: Params <ARRAY>
* 0: Target <OBJECT>
* 0: Vehicle <OBJECT>
* 1: Unit <OBJECT>
* 2: Turret Path <ARRAY>
* 3: Number of magazines <NUMBER>
@ -21,29 +21,23 @@
*/
#include "script_component.hpp"
private ["_dummy", "_weaponSelect", "_turretOwnerID"];
params [["_args", [objNull, objNull, [], 0, "", 0], [[]], [6]]];
_args params ["_target", "_unit", "_turretPath", "_numMagazines", "_magazineClass", "_numRounds"];
TRACE_6("params",_target,_unit,_turretPath,_numMagazines,_magazineClass,_numRounds);
//hint format ["Target: %1\nTurretPath: %2\nNumMagazines: %3\nMagazine: %4\nNumRounds: %5", _target, _turretPath, _numMagazines, _magazineClass, _numRounds];
params [
["_args", [objNull, objNull, [], 0, "", 0], [[]], [6]]
];
_args params ["_vehicle", "_unit", "_turretPath", "_numMagazines", "_magazineClass", "_numRounds"];
TRACE_6("rearmSuccess",_vehicle,_unit,_turretPath,_numMagazines,_magazineClass,_numRounds);
if (local _unit) then {
[_unit, true, true] call FUNC(dropAmmo);
};
//ToDo: Cleanup with CBA_fnc_ownerEvent in CBA 2.4.2
[QGVAR(rearmSuccessLocalEH), _this] call CBA_fnc_globalEvent;
/*
if (isServer) then {
_turretOwnerID = _target turretOwner _turretPath;
private _turretOwnerID = _vehicle turretOwner _turretPath;
if (_turretOwnerID == 0) then {
[QGVAR(rearmSuccessLocalEH), _this, _vehicle] call CBA_fnc_targetEvent;
[QGVAR(rearmSuccessLocalEH), _this, [_vehicle]] call CBA_fnc_targetEvent;
} else {
[QGVAR(rearmSuccessLocalEH), _this, _turretOwnerID] call CBA_fnc_targetEvent;
[QGVAR(rearmSuccessLocalEH), _this, _turretOwnerID] call CBA_fnc_ownerEvent;
};
} else {
[QGVAR(rearmSuccessLocalEH), _this] call CBA_fnc_serverEvent;
[QGVAR(rearmSuccessLocalEH), _this] call EFUNC(common,serverEvent);
};
*/

View File

@ -4,7 +4,7 @@
*
* Arguments:
* 0: Params <ARRAY>
* 0: Target <OBJECT>
* 0: Vehicle <OBJECT>
* 1: Unit <OBJECT>
* 2: Turret Path <ARRAY>
* 3: Number of magazines <NUMBER>
@ -15,96 +15,77 @@
* None
*
* Example:
* [[vehicle, player, [-1], 2, "5000Rnd_762x51_Belt", 500]] call ace_rearm_fnc_rearmSuccess
* [[vehicle, player, [-1], 2, "5000Rnd_762x51_Belt", 500]] call ace_rearm_fnc_rearmSuccessLocal
*
* Public: No
*/
#include "script_component.hpp"
private ["_rounds", "_currentRounds", "_maxMagazines", "_currentMagazines", "_dummy", "_weaponSelect"];
params [["_args", [objNull, objNull, [], 0, "", 0], [[]], [6]]];
_args params ["_target", "_unit", "_turretPath", "_numMagazines", "_magazineClass", "_numRounds"];
TRACE_6("params",_target,_unit,_turretPath,_numMagazines,_magazineClass,_numRounds);
params [
["_args", [objNull, objNull, [], 0, "", 0], [[]], [6]]
];
_args params ["_vehicle", "_unit", "_turretPath", "_numMagazines", "_magazineClass", "_numRounds"];
TRACE_6("rearmSuccessLocal",_vehicle,_unit,_turretPath,_numMagazines,_magazineClass,_numRounds);
//ToDo: Cleanup with CBA_fnc_ownerEvent in CBA 2.4.2
if (!(_target turretLocal _turretPath)) exitWith {TRACE_1("not local turret",_turretPath);};
private _rounds = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count");
private _currentRounds = 0;
private _maxMagazines = [_vehicle, _turretPath, _magazineClass] call FUNC(getMaxMagazines);
//hint format ["Target: %1\nTurretPath: %2\nNumMagazines: %3\nMagazine: %4\nNumRounds: %5\nUnit: %6", _target, _turretPath, _numMagazines, _magazineClass, _numRounds, _unit];
_rounds = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count");
_currentRounds = 0;
_maxMagazines = [_target, _turretPath, _magazineClass] call FUNC(getMaxMagazines);
if (_maxMagazines == 1) then {
_currentMagazines = { _x == _magazineClass } count (_target magazinesTurret _turretPath);
private _currentMagazines = { _x == _magazineClass } count (_vehicle magazinesTurret _turretPath);
if (_currentMagazines == 0 && {!(_turretPath isEqualTo [-1])}) then {
// Driver gun will always retain it's magazines
_target addMagazineTurret [_magazineClass, _turretPath];
_vehicle addMagazineTurret [_magazineClass, _turretPath];
_vehicle setMagazineTurretAmmo [_magazineClass, 0, _turretPath];
};
if (GVAR(level) == 1) then {
// Fill magazine completely
_target setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath];
[QEGVAR(common,displayTextStructured),
[
[LSTRING(Hint_RearmedTriple), _rounds,
_vehicle setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath];
[QEGVAR(common,displayTextStructured), [[LSTRING(Hint_RearmedTriple), _rounds,
getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"),
getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit
],
[_unit]] call CBA_fnc_targetEvent;
getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], 3, _unit], [_unit]] call CBA_fnc_targetEvent;
} else {
// Fill only at most _numRounds
_target setMagazineTurretAmmo [_magazineClass, ((_target magazineTurretAmmo [_magazineClass, _turretPath]) + _numRounds) min _rounds, _turretPath];
[QEGVAR(common,displayTextStructured),
[
[LSTRING(Hint_RearmedTriple), _numRounds,
_vehicle setMagazineTurretAmmo [_magazineClass, ((_vehicle magazineTurretAmmo [_magazineClass, _turretPath]) + _numRounds) min _rounds, _turretPath];
[QEGVAR(common,displayTextStructured), [[LSTRING(Hint_RearmedTriple), _numRounds,
getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"),
getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit
],
[_unit]] call CBA_fnc_targetEvent;
getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], 3, _unit], [_unit]] call CBA_fnc_targetEvent;
};
} else {
for "_idx" from 1 to (_maxMagazines+1) do {
_currentRounds = _target magazineTurretAmmo [_magazineClass, _turretPath];
_currentRounds = _vehicle magazineTurretAmmo [_magazineClass, _turretPath];
if (_currentRounds > 0 || {_idx == (_maxMagazines+1)}) exitWith {
if (_idx == (_maxMagazines+1) && {!(_turretPath isEqualTo [-1])}) then {
_target addMagazineTurret [_magazineClass, _turretPath];
_vehicle addMagazineTurret [_magazineClass, _turretPath];
};
if (GVAR(level) == 2) then {
//hint format ["Target: %1\nTurretPath: %2\nNumMagazines: %3\nMaxMagazines %4\nMagazine: %5\nNumRounds: %6\nMagazine: %7", _target, _turretPath, _numMagazines, _maxMagazines, _currentRounds, _numRounds, _magazineClass];
//hint format ["Target: %1\nTurretPath: %2\nNumMagazines: %3\nMaxMagazines %4\nMagazine: %5\nNumRounds: %6\nMagazine: %7", _vehicle, _turretPath, _numMagazines, _maxMagazines, _currentRounds, _numRounds, _magazineClass];
// Fill only at most _numRounds
if ((_currentRounds + _numRounds) > _rounds) then {
_target setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath];
_vehicle setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath];
if (_numMagazines < _maxMagazines) then {
_target addMagazineTurret [_magazineClass, _turretPath];
_target setMagazineTurretAmmo [_magazineClass, _currentRounds + _numRounds - _rounds, _turretPath];
_vehicle addMagazineTurret [_magazineClass, _turretPath];
_vehicle setMagazineTurretAmmo [_magazineClass, _currentRounds + _numRounds - _rounds, _turretPath];
};
} else {
_target setMagazineTurretAmmo [_magazineClass, _currentRounds + _numRounds, _turretPath];
_vehicle setMagazineTurretAmmo [_magazineClass, _currentRounds + _numRounds, _turretPath];
};
[QEGVAR(common,displayTextStructured),
[
[LSTRING(Hint_RearmedTriple), _numRounds,
[QEGVAR(common,displayTextStructured), [[LSTRING(Hint_RearmedTriple), _numRounds,
getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"),
getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit
],
[_unit]] call CBA_fnc_targetEvent;
getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], 3, _unit], [_unit]] call CBA_fnc_targetEvent;
} else {
// Fill current magazine completely and fill next magazine partially
_target setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath];
_vehicle setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath];
if (_numMagazines < _maxMagazines) then {
_target addMagazineTurret [_magazineClass, _turretPath];
_target setMagazineTurretAmmo [_magazineClass, _currentRounds, _turretPath];
_vehicle addMagazineTurret [_magazineClass, _turretPath];
_vehicle setMagazineTurretAmmo [_magazineClass, _currentRounds, _turretPath];
};
[QEGVAR(common,displayTextStructured),
[
[LSTRING(Hint_RearmedTriple), _rounds,
[QEGVAR(common,displayTextStructured), [[LSTRING(Hint_RearmedTriple), _rounds,
getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"),
getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit
],
[_unit]] call CBA_fnc_targetEvent;
getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], 3, _unit], [_unit]] call CBA_fnc_targetEvent;
};
};
_target removeMagazineTurret [_magazineClass, _turretPath];
_vehicle removeMagazineTurret [_magazineClass, _turretPath];
_numMagazines = _numMagazines - 1;
};
};

View File

@ -0,0 +1,90 @@
/*
* Author: GitHawk
* Removes a magazine from the supply.
*
* Arguments:
* 0: Ammo Truck <OBJECT>
* 1: Magazine Classname <STRING>
* 2: Number of Rounds to withdraw <NUMBER>(optional)
*
* Return Value:
* Magazine was removed <BOOL>
*
* Example:
* [ammo_truck, "500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_removeMagazineFromSupply
*
* Public: Yes
*/
#include "script_component.hpp"
params [
["_truck", objNull, [objNull]],
["_magazineClass", "", [""]],
["_numRounds", -1, [0]]
];
if (isNull _truck ||
{_magazineClass isEqualTo ""}) exitWith {false};
private _return = false;
([_magazineClass] call FUNC(getCaliber)) params ["_cal", "_idx"];
if (GVAR(supply) == 1) then {
private _supply = [_truck] call FUNC(getSupplyCount);
if (GVAR(level) == 2) then {
// Remove partial magazine supply count
private _rearmAmount = (REARM_COUNT select _idx);
if (_numRounds > 0) then {
_rearmAmount = _numRounds;
};
private _magazinePart = (_rearmAmount / (getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count"))) min 1;
if (_supply >= (_cal * _magazinePart)) then {
[_truck, (_supply - (_cal * _magazinePart))] call FUNC(setSupplyCount);
_return = true;
};
} else {
// Remove entire magazine supply count
if (_supply >= _cal) then {
[_truck, (_supply - _cal)] call FUNC(setSupplyCount);
_return = true;
};
};
};
if (GVAR(supply) == 2) then {
private _magazineSupply = _truck getVariable [QGVAR(magazineSupply), []];
private _magazineIdx = -1;
{
_x params ["_magazine"];
if ((_magazine isEqualTo _magazineClass)) exitWith {
_magazineIdx = _forEachIndex;
};
} forEach _magazineSupply;
if (_magazineIdx == -1) exitWith {false};
(_magazineSupply select _magazineIdx) params ["", "_rounds"];
private _configRounds = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count");
if (GVAR(level) == 2) then {
// With caliber based rearming, we need to remove the correct amount
private _rearmAmount = (REARM_COUNT select _idx);
if (_numRounds > 0) then {
if (_numRounds > _rearmAmount) then {
_rearmAmount = ceil (_numRounds / _rearmAmount);
};
};
private _roundsPerTransaction = _rearmAmount min _configRounds;
if (_rounds >= _roundsPerTransaction) then {
_magazineSupply set [_magazineIdx, [_magazineClass, (_rounds - _roundsPerTransaction)]];
_truck setVariable [QGVAR(magazineSupply), _magazineSupply, true];
_return = true;
};
} else {
// Remove entire magazine
if (_rounds >= _configRounds) then {
_magazineSupply set [_magazineIdx, [_magazineClass, (_rounds - _configRounds)]];
_truck setVariable [QGVAR(magazineSupply), _magazineSupply, true];
_return = true;
};
};
};
_return

View File

@ -0,0 +1,26 @@
/*
* Author: GitHawk
* Sets the supply count.
*
* Arguments:
* 0: Ammo Truck <OBJECT>
* 1: Supply Count <NUMBER>
*
* Return Value:
* None
*
* Example:
* [ammo_truck, 1000] call ace_rearm_fnc_setSupplyCount
*
* Public: Yes
*/
#include "script_component.hpp"
params [
["_truck", objNull, [objNull]],
["_supply", 0, [0]]
];
if (isNull _truck) exitWith {};
_truck setVariable [QGVAR(currentSupply), (_supply max 0), true];

View File

@ -3,30 +3,38 @@
* Stores ammo in an ammo truck.
*
* Arguments:
* 0: Target <OBJECT>
* 0: Ammo Truck <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player, dummy] call ace_rearm_fnc_storeAmmo
* [ammo_truck, player] call ace_rearm_fnc_storeAmmo
*
* Public: No
*/
#include "script_component.hpp"
params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]];
params [
["_truck", objNull, [objNull]],
["_unit", objNull, [objNull]]
];
private _dummy = _unit getVariable [QGVAR(dummy), objNull];
if (isNull _dummy) exitwith {};
private _attachedDummy = _unit getVariable [QGVAR(dummy), objNull];
if (isNull _attachedDummy) exitwith {};
[
5,
_unit,
{params ["_unit"]; [_unit, true, true] call FUNC(dropAmmo)},
[_unit, _truck, _attachedDummy],
{
params ["_args"];
_args params ["_unit", "_truck", "_attachedDummy"];
[_truck, (_attachedDummy getVariable [QGVAR(magazineClass), ""]), true] call FUNC(addMagazineToSupply);
[_unit, true, true] call FUNC(dropAmmo);
},
"",
format [localize LSTRING(StoreAmmoAction), getText(configFile >> "CfgMagazines" >> (_dummy getVariable QGVAR(magazineClass)) >> "displayName"), getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")],
format [localize LSTRING(StoreAmmoAction), getText(configFile >> "CfgMagazines" >> (_attachedDummy getVariable QGVAR(magazineClass)) >> "displayName"), getText(configFile >> "CfgVehicles" >> (typeOf _truck) >> "displayName")],
{true},
["isnotinside"]
] call EFUNC(common,progressBar);

View File

@ -19,40 +19,20 @@
*/
#include "script_component.hpp"
private ["_ammo", "_tmpCal", "_cal", "_idx"];
params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]], ["_args", ["", objNull], [[]]]];
params [
["_truck", objNull, [objNull]],
["_unit", objNull, [objNull]],
["_args", ["", objNull], [[]]]
];
_args params ["_magazineClass", "_vehicle"];
_ammo = getText (configFile >> "CfgMagazines" >> _magazineClass >> "ammo");
_tmpCal = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_caliber");
_cal = 8;
if (_tmpCal > 0) then {
_cal = _tmpCal;
} else {
_tmpCal = getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(caliber));
if (_tmpCal > 0) then {
_cal = _tmpCal;
} else {
diag_log format ["[ACE] ERROR: Undefined Ammo [%1 : %2]", _ammo, inheritsFrom (configFile >> "CfgAmmo" >> _ammo)];
if (_ammo isKindOf "BulletBase") then {
_cal = 8;
} else {
_cal = 100;
};
};
};
_cal = round _cal;
_idx = REARM_CALIBERS find _cal;
if (_idx == -1 ) then {
_idx = 2;
};
([_magazineClass] call FUNC(getCaliber)) params ["_cal", "_idx"];
REARM_HOLSTER_WEAPON
REARM_HOLSTER_WEAPON;
[
(REARM_DURATION_TAKE select _idx),
[_unit, _magazineClass, _target],
[_unit, _magazineClass, _truck],
FUNC(takeSuccess),
"",
format [localize LSTRING(TakeAction), getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")],

View File

@ -18,15 +18,22 @@
*/
#include "script_component.hpp"
private ["_ammo", "_dummyName", "_dummy", "_actionID"];
params [["_args", [objNull, "", objNull], [[]]]];
_args params ["_unit", "_magazineClass", "_target"]; // _target is for future possible finite ammo
params [
["_args", [objNull, "", objNull], [[]], 3]
];
_args params ["_unit", "_magazineClass", "_truck"];
private _success = true;
if (GVAR(supply) > 0) then {
_success = [_truck, _magazineClass] call FUNC(removeMagazineFromSupply);
};
if !(_success) exitWith {};
[_unit, "forceWalk", QGVAR(vehRearm), true] call EFUNC(common,statusEffect_set);
_dummy = [_unit, _magazineClass] call FUNC(createDummy);
private _dummy = [_unit, _magazineClass] call FUNC(createDummy);
[_dummy, _unit] call FUNC(pickUpAmmo);
_actionID = _unit addAction [
private _actionID = _unit addAction [
format ["<t color='#FF0000'>%1</t>", localize ELSTRING(dragging,Drop)],
'(_this select 0) call FUNC(dropAmmo)',
nil,
@ -34,6 +41,6 @@ _actionID = _unit addAction [
false,
true,
"",
'!isNull (_target getVariable [QGVAR(dummy), objNull])'
'!isNull (_truck getVariable [QGVAR(dummy), objNull])'
];
_unit setVariable [QGVAR(ReleaseActionID), _actionID];

View File

@ -28,12 +28,13 @@
#define REARM_HOLSTER_WEAPON \
_unit setVariable [QGVAR(selectedWeaponOnRearm), currentWeapon _unit]; \
TRACE_2("REARM_HOLSTER_WEAPON",_unit,currentWeapon _unit); \
_unit action ["SwitchWeapon", _unit, _unit, 299];
#define REARM_UNHOLSTER_WEAPON \
_weaponSelect = _unit getVariable QGVAR(selectedWeaponOnRearm); \
TRACE_2("REARM_UNHOLSTER_WEAPON",_unit,_weaponSelect); \
if (!isNil "_weaponSelect") then { \
TRACE_2("REARM_UNHOLSTER_WEAPON",_unit,_weaponSelect); \
_unit selectWeapon _weaponSelect; \
_unit setVariable [QGVAR(selectedWeaponOnRearm), nil]; \
};

View File

@ -92,6 +92,46 @@
<Japanese>口径に基づいた度合い</Japanese>
<Korean>구경에 따라 수량 설정</Korean>
</Key>
<Key ID="STR_ACE_Rearm_RearmSettings_supply_DisplayName">
<English>Ammunition supply</English>
<German>Munitionsvorat</German>
</Key>
<Key ID="STR_ACE_Rearm_RearmSettings_supply_Description">
<English>How much ammunition does an ammo truck carry?</English>
<German>Wie viel Munition transportiert ein Munitionslaster?</German>
</Key>
<Key ID="STR_ACE_Rearm_RearmSettings_unlimited">
<English>Unlimited ammo supply</English>
<German>Unbegrenzter Munitionsvorat</German>
</Key>
<Key ID="STR_ACE_Rearm_RearmSettings_limited">
<English>Limited ammo supply based on caliber</English>
<German>Begrenzter, kaliberabhängiger Munitionsvorat</German>
</Key>
<Key ID="STR_ACE_Rearm_RearmSettings_magazineSupply">
<English>Only specific Magazines</English>
<German>Nur bestimmte Magazine</German>
</Key>
<Key ID="STR_ACE_Rearm_ReadSupplyCounter">
<English>Check remaining ammunition</English>
<German>Verbleibende Munition prüfen</German>
</Key>
<Key ID="STR_ACE_Rearm_ReadSupplyCounterAction">
<English>Checking remaining ammunition...</English>
<German>Überprüfe verbleibende Munition...</German>
</Key>
<Key ID="STR_ACE_Rearm_Hint_RemainingSupplyPoints">
<English>There is ammunition worth %1 points left.</English>
<German>Es ist noch Munition für %1 Punkte übrig.</German>
</Key>
<Key ID="STR_ACE_Rearm_Hint_RemainingAmmo">
<English>The following ammunition is left:%1</English>
<German>Folgende Munition ist übrig:%1</German>
</Key>
<Key ID="STR_ACE_Rearm_Hint_Empty">
<English>There is no ammunition left.</English>
<German>Es ist keine Munition übrig.</German>
</Key>
<Key ID="STR_ACE_Rearm_Rearm">
<English>Rearm</English>
<German>Aufmunitionieren</German>