mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Add ace_setting for scaling cookoff effect length (#4842)
* Add getVar for scaling cookoff effect length * Switch to ace_setting * Add notes about merging settings
This commit is contained in:
parent
7cdf2d75a3
commit
e9b5bde371
@ -12,10 +12,16 @@ class ACE_Settings {
|
||||
value = 1;
|
||||
typeName = "BOOL";
|
||||
};
|
||||
class GVAR(enableAmmoCookoff) {
|
||||
class GVAR(enableAmmoCookoff) { // For CBA Setting Switch: we can eliminate and just use (ammoCookoffDuration == 0)
|
||||
displayName = CSTRING(enableAmmoCookoff_name);
|
||||
description = CSTRING(enableAmmoCookoff_tooltip);
|
||||
value = 1;
|
||||
typeName = "BOOL";
|
||||
};
|
||||
class GVAR(ammoCookoffDuration) {
|
||||
displayName = CSTRING(ammoCookoffDuration_name);
|
||||
description = CSTRING(ammoCookoffDuration_tooltip);
|
||||
value = 1;
|
||||
typeName = "SCALAR";
|
||||
};
|
||||
};
|
||||
|
@ -81,6 +81,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace;
|
||||
["AllVehicles", "killed", {
|
||||
params ["_vehicle"];
|
||||
if (_vehicle getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmoCookoff)]) then {
|
||||
if (GVAR(ammoCookoffDuration) == 0) exitWith {};
|
||||
([_vehicle] call FUNC(getVehicleAmmo)) params ["_mags", "_total"];
|
||||
[_vehicle, _mags, _total] call FUNC(detonateAmmunition);
|
||||
};
|
||||
|
@ -45,6 +45,7 @@ if (local _box) then {
|
||||
// These functions are smart and do all the cooking off work
|
||||
if (local _box) then {
|
||||
if (_box getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmoCookoff)]) then {
|
||||
if (GVAR(ammoCookoffDuration) == 0) exitWith {};
|
||||
([_box] call FUNC(getVehicleAmmo)) params ["_mags", "_total"];
|
||||
[_box, _mags, _total] call FUNC(detonateAmmunition);
|
||||
};
|
||||
|
@ -31,7 +31,7 @@ private _magazine = _magazines select _magazineIndex;
|
||||
_magazine params ["_magazineClassname", "_amountOfMagazines"];
|
||||
|
||||
if (_amountOfMagazines > 0) exitWith {
|
||||
private _removed = _amountOfMagazines min floor(1 + random(6));
|
||||
private _removed = _amountOfMagazines min floor(1 + random(6 / GVAR(ammoCookoffDuration)));
|
||||
|
||||
_amountOfMagazines = _amountOfMagazines - _removed;
|
||||
if (_amountOfMagazines <= 0) then {
|
||||
|
@ -60,5 +60,11 @@
|
||||
<German>Ermöglicht Selbstzündung von Munition. Feuert Projektile der Munition ab, solange das Fahrzeug brennt und Munition besitzt.</German>
|
||||
<Polish>Aktywuje samozapłon amunicji. Wystrzeliwuje pociski podczas gdy pojazd płonie i posiada amunicję.</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_CookOff_ammoCookoffDuration_name">
|
||||
<English>Ammunition cook off duration</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_CookOff_ammoCookoffDuration_tooltip">
|
||||
<English>Multiplier for how long cook off lasts [Setting to 0 will disable ammo cookoff]</English>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user