mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
More changes
This commit is contained in:
parent
a999c81fec
commit
d7dafa4d40
@ -73,9 +73,6 @@ if (isServer) then {
|
|||||||
params ["_vehicle", "", "", "_useEffects"];
|
params ["_vehicle", "", "", "_useEffects"];
|
||||||
|
|
||||||
if (_useEffects && {_vehicle getVariable [QGVAR(enableAmmoCookoff), true]}) then {
|
if (_useEffects && {_vehicle getVariable [QGVAR(enableAmmoCookoff), true]}) then {
|
||||||
(_vehicle call FUNC(getVehicleAmmo)) params ["_magazines", "_total"];
|
[QGVAR(detonateAmmunition), [_vehicle, false, objNull, objNull, (random MAX_AMMO_DETONATION_START_DELAY) max MIN_AMMO_DETONATION_START_DELAY]] call CBA_fnc_serverEvent;
|
||||||
|
|
||||||
private _delay = (random MAX_AMMO_DETONATION_START_DELAY) max MIN_AMMO_DETONATION_START_DELAY;
|
|
||||||
[QGVAR(detonateAmmunition), [_vehicle, _magazines, _total, false, objNull, objNull, _delay]] call CBA_fnc_serverEvent;
|
|
||||||
};
|
};
|
||||||
}, nil, ["CAManBase", "StaticWeapon"]] call CBA_fnc_addClassEventHandler;
|
}, nil, ["CAManBase", "StaticWeapon"]] call CBA_fnc_addClassEventHandler;
|
||||||
|
@ -107,7 +107,7 @@ if (_delayBetweenSmokeAndFire) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Wait until we are ready for the next flame
|
// Wait until we are ready for the next flame
|
||||||
if (CBA_missionTime >= _vehicle getVariable [QGVAR(nextFlame), 0]) then {
|
if (_vehicle getVariable [QGVAR(nextFlame), 0] <= CBA_missionTime) then {
|
||||||
private _ring = false;
|
private _ring = false;
|
||||||
|
|
||||||
if (_canRing) then {
|
if (_canRing) then {
|
||||||
|
@ -70,14 +70,9 @@ if (_delay >= 0) then {
|
|||||||
_box setVariable [QGVAR(effects), _effects];
|
_box setVariable [QGVAR(effects), _effects];
|
||||||
};
|
};
|
||||||
|
|
||||||
// These functions are smart and do all the cooking off work
|
// Detonate the ammunition
|
||||||
if (isServer) then {
|
if (isServer) then {
|
||||||
(_box call FUNC(getVehicleAmmo)) params ["_magazines", "_total"];
|
[QGVAR(detonateAmmunition), [_box, true, _killer, _instigator]] call CBA_fnc_localEvent;
|
||||||
|
|
||||||
[QGVAR(detonateAmmunition), [_box, _magazines, _total, true, _killer, _instigator]] call CBA_fnc_localEvent;
|
|
||||||
|
|
||||||
// This shit is busy being on fire, magazines aren't accessible/usable
|
|
||||||
clearMagazineCargoGlobal _box;
|
|
||||||
};
|
};
|
||||||
}, _this, _delay] call CBA_fnc_waitAndExecute;
|
}, _this, _delay] call CBA_fnc_waitAndExecute;
|
||||||
};
|
};
|
||||||
|
@ -84,9 +84,10 @@ if (isServer) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Make flame push object into ground to make effect seem more "alive"
|
// Make flame push object into ground to make effect seem more "alive"
|
||||||
if (_jet && !isGamePaused && {local _vehicle}) then {
|
if (_jet && !isGamePaused && {local _vehicle} && {_vehicle getVariable [QGVAR(nextForceTime), 0] <= CBA_missionTime}) then {
|
||||||
private _force = [0, 0, _factor * -(0.5 min random 1.5) * (0.3 min random 1)] vectorMultiply getMass _vehicle;
|
private _force = [0, 0, _factor * -(0.5 min random 1.5) * (0.3 min random 1)] vectorMultiply getMass _vehicle;
|
||||||
_vehicle addForce [_force, vectorUpVisual _vehicle];
|
_vehicle addForce [_force, vectorUpVisual _vehicle];
|
||||||
|
_vehicle setVariable [QGVAR(nextForceTime), CBA_missionTime + 0.01]; // this prevents bad behaviour when setAccTime is small
|
||||||
};
|
};
|
||||||
|
|
||||||
// Don't spawn visual effects on machines without interfaces
|
// Don't spawn visual effects on machines without interfaces
|
||||||
|
@ -1,34 +1,50 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Glowbal
|
* Author: Glowbal, johnb43
|
||||||
* Detonates ammunition from an object (e.g. vehicle or crate) until no ammo is left.
|
* Detonates ammunition from an object (e.g. vehicle or crate) until no ammo is left.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Object <OBJECT>
|
* 0: Object <OBJECT>
|
||||||
* 1: Magazine array <ARRAY>
|
* 1: Destroy when finished <BOOL> (default: false)
|
||||||
* - 0: Magazine classname <STRING>
|
* 2: Killer <OBJECT> (default: objNull)
|
||||||
* - 1: Ammo count <NUMBER>
|
* 3: Instigator <OBJECT> (default: objNull)
|
||||||
* 2: Total ammo count <NUMBER>
|
* 4: Initial delay <NUMBER> (default: 0)
|
||||||
* 3: Destroy when finished <BOOL> (default: false)
|
|
||||||
* 4: Killer <OBJECT> (default: objNull)
|
|
||||||
* 5: Instigator <OBJECT> (default: objNull)
|
|
||||||
* 6: Initial delay <NUMBER> (default: 0)
|
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing Useful
|
* Nothing Useful
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [cursorObject, magazinesAmmo vehicle player, 1000] call ace_cookoff_fnc_detonateAmmunition
|
* [cursorObject] call ace_cookoff_fnc_detonateAmmunition
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!isServer) exitWith {};
|
if (!isServer) exitWith {};
|
||||||
|
|
||||||
params ["_object", "_magazines", "_totalAmmo", ["_destroyWhenFinished", false], ["_killer", objNull], ["_instigator", objNull], ["_initialDelay", 0]];
|
params ["_object", ["_destroyWhenFinished", false], ["_killer", objNull], ["_instigator", objNull], ["_initialDelay", 0]];
|
||||||
|
|
||||||
if (isNull _object) exitWith {};
|
if (isNull _object) exitWith {};
|
||||||
|
|
||||||
|
private _vehicleAmmo = _object getVariable QGVAR(cookoffMagazines);
|
||||||
|
|
||||||
|
if (isNil "_vehicleAmmo") then {
|
||||||
|
_vehicleAmmo = _object call FUNC(getVehicleAmmo);
|
||||||
|
|
||||||
|
_object setVariable [QGVAR(cookoffMagazines), _vehicleAmmo];
|
||||||
|
|
||||||
|
// TODO: When setMagazineTurretAmmo and magazineTurretAmmo are fixed (https://feedback.bistudio.com/T79689),
|
||||||
|
// we can add gradual ammo removal during cook-off
|
||||||
|
if (GVAR(removeAmmoDuringCookoff)) then {
|
||||||
|
clearMagazineCargoGlobal _object;
|
||||||
|
|
||||||
|
{
|
||||||
|
_object removeMagazinesTurret [_x select 0, _x select 1];
|
||||||
|
} forEach (magazinesAllTurrets _object);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
_vehicleAmmo params ["_magazines", "_totalAmmo"];
|
||||||
|
|
||||||
// If the cook-off has finished, clean up the effects and destroy the object
|
// If the cook-off has finished, clean up the effects and destroy the object
|
||||||
if (_magazines isEqualTo [] || {_totalAmmo <= 0}) exitWith {
|
if (_magazines isEqualTo [] || {_totalAmmo <= 0}) exitWith {
|
||||||
[QGVAR(cleanupEffects), _object] call CBA_fnc_globalEvent;
|
[QGVAR(cleanupEffects), _object] call CBA_fnc_globalEvent;
|
||||||
@ -53,12 +69,12 @@ if (underwater _object || {
|
|||||||
|
|
||||||
// Initial delay allows for a delay for the first time this function runs in its cycle
|
// Initial delay allows for a delay for the first time this function runs in its cycle
|
||||||
if (_initialDelay > 0) exitWith {
|
if (_initialDelay > 0) exitWith {
|
||||||
[FUNC(detonateAmmunition), [_object, _magazines, _totalAmmo, _destroyWhenFinished, _killer, _instigator], _initialDelay] call CBA_fnc_waitAndExecute;
|
[FUNC(detonateAmmunition), [_object, _destroyWhenFinished, _killer, _instigator], _initialDelay] call CBA_fnc_waitAndExecute;
|
||||||
};
|
};
|
||||||
|
|
||||||
private _magazineIndex = floor random (count _magazines);
|
private _magazineIndex = floor random (count _magazines);
|
||||||
private _magazine = _magazines select _magazineIndex;
|
private _magazine = _magazines select _magazineIndex;
|
||||||
_magazine params ["_magazineClassname", "_ammoCount"];
|
_magazine params ["_magazineClassname", "_ammoCount", "_spawnProjectile"];
|
||||||
|
|
||||||
// Make sure ammo is at least 0
|
// Make sure ammo is at least 0
|
||||||
_ammoCount = _ammoCount max 0;
|
_ammoCount = _ammoCount max 0;
|
||||||
@ -78,8 +94,10 @@ private _timeBetweenAmmoDetonation = ((random 10 / sqrt _totalAmmo) min MAX_TIME
|
|||||||
TRACE_2("",_totalAmmo,_timeBetweenAmmoDetonation);
|
TRACE_2("",_totalAmmo,_timeBetweenAmmoDetonation);
|
||||||
_totalAmmo = _totalAmmo - _removed;
|
_totalAmmo = _totalAmmo - _removed;
|
||||||
|
|
||||||
|
_object setVariable [QGVAR(cookoffMagazines), [_magazines, _totalAmmo]];
|
||||||
|
|
||||||
// Detonate the remaining ammo after a delay
|
// Detonate the remaining ammo after a delay
|
||||||
[FUNC(detonateAmmunition), [_object, _magazines, _totalAmmo, _destroyWhenFinished, _killer, _instigator], _timeBetweenAmmoDetonation] call CBA_fnc_waitAndExecute;
|
[FUNC(detonateAmmunition), [_object, _destroyWhenFinished, _killer, _instigator], _timeBetweenAmmoDetonation] call CBA_fnc_waitAndExecute;
|
||||||
|
|
||||||
// Get magazine info, which is used to spawn projectiles
|
// Get magazine info, which is used to spawn projectiles
|
||||||
private _configMagazine = configFile >> "CfgMagazines" >> _magazineClassname;
|
private _configMagazine = configFile >> "CfgMagazines" >> _magazineClassname;
|
||||||
@ -87,12 +105,14 @@ private _ammo = getText (_configMagazine >> "ammo");
|
|||||||
private _configAmmo = configFile >> "CfgAmmo" >> _ammo;
|
private _configAmmo = configFile >> "CfgAmmo" >> _ammo;
|
||||||
|
|
||||||
private _simType = toLower getText (_configAmmo >> "simulation");
|
private _simType = toLower getText (_configAmmo >> "simulation");
|
||||||
private _speed = random (getNumber (_configMagazine >> "initSpeed") / 10) max 1;
|
private _speed = linearConversion [0, 1, random 1, 1, 20, true];
|
||||||
|
|
||||||
private _effect2pos = _object selectionPosition "destructionEffect2";
|
private _effect2pos = _object selectionPosition "destructionEffect2";
|
||||||
|
|
||||||
// Spawns the projectiles, making them either fly in random directions or explode
|
// Spawns the projectiles, making them either fly in random directions or explode
|
||||||
private _fnc_spawnProjectile = {
|
private _fnc_spawnProjectile = {
|
||||||
|
// If the magazines are inside of the cargo (inventory), don't let their projectiles escape the interior of the vehicle
|
||||||
|
if (!_spawnProjectile) exitWith {};
|
||||||
|
|
||||||
params ["_object", "_ammo", "_speed", "_flyAway"];
|
params ["_object", "_ammo", "_speed", "_flyAway"];
|
||||||
|
|
||||||
private _spawnPos = _object modelToWorld [-0.2 + random 0.4, -0.2 + random 0.4, random 3];
|
private _spawnPos = _object modelToWorld [-0.2 + random 0.4, -0.2 + random 0.4, random 3];
|
||||||
|
@ -41,7 +41,7 @@ private _ammo = "";
|
|||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
_ammoToDetonate pushBack [_magazine, _count];
|
_ammoToDetonate pushBack [_magazine, _count, true];
|
||||||
_totalAmmo = _totalAmmo + _count;
|
_totalAmmo = _totalAmmo + _count;
|
||||||
};
|
};
|
||||||
} forEach (magazinesAllTurrets [_vehicle, true]);
|
} forEach (magazinesAllTurrets [_vehicle, true]);
|
||||||
@ -51,7 +51,7 @@ private _ammo = "";
|
|||||||
_x params ["_magazine", "_count"];
|
_x params ["_magazine", "_count"];
|
||||||
|
|
||||||
if (_count > 0 && {!(_magazine call FUNC(isMagazineFlare))}) then {
|
if (_count > 0 && {!(_magazine call FUNC(isMagazineFlare))}) then {
|
||||||
_ammoToDetonate pushBack [_magazine, _count];
|
_ammoToDetonate pushBack [_magazine, _count, false];
|
||||||
_totalAmmo = _totalAmmo + _count;
|
_totalAmmo = _totalAmmo + _count;
|
||||||
};
|
};
|
||||||
} forEach (magazinesAmmoCargo _vehicle);
|
} forEach (magazinesAmmoCargo _vehicle);
|
||||||
@ -63,13 +63,13 @@ private _configSupply = (getNumber (_configVehicle >> "transportAmmo")) max (get
|
|||||||
if (_vehicle getVariable [QEGVAR(rearm,isSupplyVehicle), _configSupply > 0]) then {
|
if (_vehicle getVariable [QEGVAR(rearm,isSupplyVehicle), _configSupply > 0]) then {
|
||||||
TRACE_1("transportAmmo vehicle - adding virtual ammo",typeOf _vehicle);
|
TRACE_1("transportAmmo vehicle - adding virtual ammo",typeOf _vehicle);
|
||||||
|
|
||||||
_ammoToDetonate pushBack ["2000Rnd_65x39_belt", 2000];
|
_ammoToDetonate pushBack ["2000Rnd_65x39_belt", 2000, false];
|
||||||
_totalAmmo = _totalAmmo + 2000;
|
_totalAmmo = _totalAmmo + 2000;
|
||||||
|
|
||||||
_ammoToDetonate pushBack ["20Rnd_105mm_HEAT_MP", 100];
|
_ammoToDetonate pushBack ["20Rnd_105mm_HEAT_MP", 100, true];
|
||||||
_totalAmmo = _totalAmmo + 100;
|
_totalAmmo = _totalAmmo + 100;
|
||||||
|
|
||||||
_ammoToDetonate pushBack ["SatchelCharge_Remote_Mag", 10];
|
_ammoToDetonate pushBack ["SatchelCharge_Remote_Mag", 10, true];
|
||||||
_totalAmmo = _totalAmmo + 10;
|
_totalAmmo = _totalAmmo + 10;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -67,3 +67,13 @@
|
|||||||
1,
|
1,
|
||||||
{[QGVAR(ammoCookoffDuration), _this] call EFUNC(common,cbaSettings_settingChanged)}
|
{[QGVAR(ammoCookoffDuration), _this] call EFUNC(common,cbaSettings_settingChanged)}
|
||||||
] call CBA_fnc_addSetting;
|
] call CBA_fnc_addSetting;
|
||||||
|
|
||||||
|
[
|
||||||
|
QGVAR(removeAmmoDuringCookoff),
|
||||||
|
"CHECKBOX",
|
||||||
|
[LSTRING(removeAmmoDuringCookoff_name), LSTRING(removeAmmoDuringCookoff_tooltip)],
|
||||||
|
LSTRING(category_displayName),
|
||||||
|
true,
|
||||||
|
1,
|
||||||
|
{[QGVAR(removeAmmoDuringCookoff), _this] call EFUNC(common,cbaSettings_settingChanged)}
|
||||||
|
] call CBA_fnc_addSetting;
|
||||||
|
@ -99,5 +99,22 @@
|
|||||||
<French>Contrôle si les véhicules seront toujours détruits après l'auto-inflammation.</French>
|
<French>Contrôle si les véhicules seront toujours détruits après l'auto-inflammation.</French>
|
||||||
<Portuguese>Define se os veículos serão sempre destruídos após cozinhamento.</Portuguese>
|
<Portuguese>Define se os veículos serão sempre destruídos após cozinhamento.</Portuguese>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_CookOff_removeAmmoDuringCookoff_name">
|
||||||
|
<English>Enable ammo removal during cook-off</English>
|
||||||
|
<Japanese>誘爆中の弾薬除去を有効/無効にする</Japanese>
|
||||||
|
<French>Retirer les munitions durant l'auto-inflammation</French>
|
||||||
|
<German>Aktiviert/Deaktiviert Entfernung der Munition beim Durchzünden</German>
|
||||||
|
<Italian>Abilita rimozione munizioni dopo l'esplosione</Italian>
|
||||||
|
<Polish>Włącz/Wyłącz usuwanie amunicji podczas samozapłonu</Polish>
|
||||||
|
<Chinesesimp>启用/禁用殉爆过程中的弹药移除功能</Chinesesimp>
|
||||||
|
<Korean>쿡오프시 탄약 제거 활성화/비활성화</Korean>
|
||||||
|
<Russian>Удалять боеприпасы из-за детонации</Russian>
|
||||||
|
<Spanish>Habilita/Deshabilita ka eliminación de munición durante la detonación inducida por calor</Spanish>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_CookOff_removeAmmoDuringCookoff_tooltip">
|
||||||
|
<English>Removes all ammo during cook-off.</English>
|
||||||
|
<French>Retire des munitions des véhicules durant une auto-inflammation.</French>
|
||||||
|
<German>Entfernt Munition während dem Durchzünden der Munition eines Fahrzeuges.</German>
|
||||||
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: The vehicle <OBJECT>
|
* 0: The vehicle <OBJECT>
|
||||||
* 1: Person who caused detonation <OBJECT> (default: objNull)
|
* 1: Person who caused detonation <OBJECT> (default: objNull)
|
||||||
* 2: An array of vehicle ammo in vehicle <ARRAY> (default: [])
|
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
@ -17,15 +16,9 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
params ["_vehicle", ["_injurer", objNull], ["_vehicleAmmo", []]];
|
params ["_vehicle", ["_injurer", objNull]];
|
||||||
|
|
||||||
if (_vehicleAmmo isEqualTo []) then {
|
if (((_vehicle call EFUNC(cookoff,getVehicleAmmo)) select 1) > 0) then {
|
||||||
_vehicleAmmo = [_vehicle] call EFUNC(cookoff,getVehicleAmmo);
|
|
||||||
};
|
|
||||||
|
|
||||||
[QEGVAR(cookoff,detonateAmmunition), [_vehicle] + _vehicleAmmo] call CBA_fnc_serverEvent;
|
|
||||||
|
|
||||||
if ((_vehicleAmmo select 1) > 0) then {
|
|
||||||
{
|
{
|
||||||
// random amount of injuries
|
// random amount of injuries
|
||||||
for "_i" from 0 to random 5 do {
|
for "_i" from 0 to random 5 do {
|
||||||
@ -33,3 +26,5 @@ if ((_vehicleAmmo select 1) > 0) then {
|
|||||||
};
|
};
|
||||||
} forEach crew _vehicle;
|
} forEach crew _vehicle;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
[QEGVAR(cookoff,detonateAmmunition), [_vehicle, false, _injurer, _injurer]] call CBA_fnc_serverEvent;
|
||||||
|
@ -23,11 +23,12 @@
|
|||||||
|
|
||||||
params ["_vehicle", "_chanceOfFire", "_intensity", ["_injurer", objNull], ["_hitPart", ""], ["_canRing", false], ["_canJet", true]];
|
params ["_vehicle", "_chanceOfFire", "_intensity", ["_injurer", objNull], ["_hitPart", ""], ["_canRing", false], ["_canJet", true]];
|
||||||
|
|
||||||
private _alreadyCookingOff = _vehicle getVariable [QEGVAR(cookoff,isCookingOff), false];
|
// Ignore if the vehicle is already cooking off
|
||||||
|
if (_vehicle getVariable [QEGVAR(cookoff,isCookingOff), false]) exitWith {true};
|
||||||
|
|
||||||
_chanceOfFire = _chanceOfFire * EGVAR(cookoff,probabilityCoef);
|
_chanceOfFire = _chanceOfFire * EGVAR(cookoff,probabilityCoef);
|
||||||
|
|
||||||
if (!_alreadyCookingOff && { _chanceOfFire >= random 1 }) exitWith {
|
if (_chanceOfFire >= random 1) exitWith {
|
||||||
private _configOf = configOf _vehicle;
|
private _configOf = configOf _vehicle;
|
||||||
private _fireDetonateChance = [_configOf >> QGVAR(detonationDuringFireProb), "number", 0] call CBA_fnc_getConfigEntry;
|
private _fireDetonateChance = [_configOf >> QGVAR(detonationDuringFireProb), "number", 0] call CBA_fnc_getConfigEntry;
|
||||||
if (_canRing) then {
|
if (_canRing) then {
|
||||||
@ -52,21 +53,8 @@ if (!_alreadyCookingOff && { _chanceOfFire >= random 1 }) exitWith {
|
|||||||
[_vehicle] spawn FUNC(abandon);
|
[_vehicle] spawn FUNC(abandon);
|
||||||
LOG_1("[%1] is on fire is bailing",_vehicle);
|
LOG_1("[%1] is on fire is bailing",_vehicle);
|
||||||
|
|
||||||
// cant setVehicleAmmo 0 here because it removes FFV unit's ammo
|
|
||||||
if (GVAR(removeAmmoDuringCookoff)) then {
|
|
||||||
private _ammo = [_vehicle] call EFUNC(cookoff,getVehicleAmmo);
|
|
||||||
_ammo params ["_magazines"];
|
|
||||||
TRACE_1("removing magazines",_magazines);
|
|
||||||
{
|
|
||||||
_x params ["_magazine"];
|
|
||||||
_vehicle removeMagazines _magazine;
|
|
||||||
} forEach _magazines;
|
|
||||||
};
|
|
||||||
true
|
true
|
||||||
};
|
};
|
||||||
|
|
||||||
// Avoid RPT spam
|
|
||||||
if (_alreadyCookingOff) exitWith { true };
|
|
||||||
|
|
||||||
LOG_2("[%1] No Cook-off - Chance of fire [%2]",_vehicle,_chanceOfFire);
|
LOG_2("[%1] No Cook-off - Chance of fire [%2]",_vehicle,_chanceOfFire);
|
||||||
false
|
false
|
||||||
|
@ -119,12 +119,12 @@ if (_isCar) then {
|
|||||||
_ammoEffectiveness = (_ammoEffectiveness + (_ammoEffectiveness * 0.5)) min 1;
|
_ammoEffectiveness = (_ammoEffectiveness + (_ammoEffectiveness * 0.5)) min 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
private _currentVehicleAmmo = [_vehicle] call EFUNC(cookoff,getVehicleAmmo);
|
private _currentVehicleAmmo = _vehicle call EFUNC(cookoff,getVehicleAmmo);
|
||||||
private _chanceOfDetonation = 0;
|
private _chanceOfDetonation = 0;
|
||||||
private _explosiveAmmoCount = 0;
|
private _explosiveAmmoCount = 0;
|
||||||
private _nonExplosiveAmmoCount = 0;
|
private _nonExplosiveAmmoCount = 0;
|
||||||
|
|
||||||
if (count (_currentVehicleAmmo select 0) isNotEqualTo 0) then {
|
if ((_currentVehicleAmmo select 1) > 0) then {
|
||||||
private _magConfig = configFile >> "CfgMagazines";
|
private _magConfig = configFile >> "CfgMagazines";
|
||||||
private _ammoConfig = configFile >> "CfgAmmo";
|
private _ammoConfig = configFile >> "CfgAmmo";
|
||||||
private _countOfExplodableAmmo = 0;
|
private _countOfExplodableAmmo = 0;
|
||||||
@ -163,7 +163,7 @@ switch (_hitArea) do {
|
|||||||
_chanceOfFire = 0; // no cookoff for cars
|
_chanceOfFire = 0; // no cookoff for cars
|
||||||
};
|
};
|
||||||
|
|
||||||
if ([_vehicle, _chanceToDetonate, _currentVehicleAmmo, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith {
|
if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith {
|
||||||
[_vehicle] call FUNC(knockOut);
|
[_vehicle] call FUNC(knockOut);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ switch (_hitArea) do {
|
|||||||
_chanceOfFire = 0; // no cookoff for cars
|
_chanceOfFire = 0; // no cookoff for cars
|
||||||
};
|
};
|
||||||
|
|
||||||
if ([_vehicle, _chanceToDetonate, _currentVehicleAmmo, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith {
|
if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith {
|
||||||
[_vehicle, _hitIndex, _hitpointName, 0.89 * _penChance] call FUNC(addDamage);
|
[_vehicle, _hitIndex, _hitpointName, 0.89 * _penChance] call FUNC(addDamage);
|
||||||
[_vehicle] call FUNC(knockOut);
|
[_vehicle] call FUNC(knockOut);
|
||||||
};
|
};
|
||||||
@ -265,7 +265,7 @@ switch (_hitArea) do {
|
|||||||
_chanceOfFire = 0; // no cookoff for cars
|
_chanceOfFire = 0; // no cookoff for cars
|
||||||
};
|
};
|
||||||
|
|
||||||
if ([_vehicle, _chanceToDetonate, _currentVehicleAmmo, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith {
|
if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith {
|
||||||
[_vehicle] call FUNC(knockOut);
|
[_vehicle] call FUNC(knockOut);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,16 +8,6 @@
|
|||||||
true // Needs mission restart
|
true // Needs mission restart
|
||||||
] call CBA_settings_fnc_init;
|
] call CBA_settings_fnc_init;
|
||||||
|
|
||||||
[
|
|
||||||
QGVAR(removeAmmoDuringCookoff), "CHECKBOX",
|
|
||||||
[LSTRING(removeAmmoAfterCookoff_setting_enable), LSTRING(removeAmmoAfterCookoff_setting_description)],
|
|
||||||
LSTRING(category_displayName),
|
|
||||||
true, // default value
|
|
||||||
true, // isGlobal
|
|
||||||
{[QGVAR(removeAmmoDuringCookoff), _this] call EFUNC(common,cbaSettings_settingChanged)},
|
|
||||||
false // Needs mission restart
|
|
||||||
] call CBA_settings_fnc_init;
|
|
||||||
|
|
||||||
[
|
[
|
||||||
QGVAR(enableCarDamage), "CHECKBOX",
|
QGVAR(enableCarDamage), "CHECKBOX",
|
||||||
[LSTRING(carDamage_setting_enable), LSTRING(carDamage_setting_description)],
|
[LSTRING(carDamage_setting_enable), LSTRING(carDamage_setting_description)],
|
||||||
|
@ -49,30 +49,6 @@
|
|||||||
<Russian>Продвинутое повреждение машин</Russian>
|
<Russian>Продвинутое повреждение машин</Russian>
|
||||||
<Spanish>Habilitar/Deshabilitar daño avanzado de coche (Experimental)</Spanish>
|
<Spanish>Habilitar/Deshabilitar daño avanzado de coche (Experimental)</Spanish>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Vehicle_Damage_removeAmmoAfterCookoff_setting_description">
|
|
||||||
<English>Removes all vehicle ammo after cook-off</English>
|
|
||||||
<Japanese>誘爆後に車両から全ての弾薬を削除</Japanese>
|
|
||||||
<French>Retire toutes les munitions des véhicules après une auto-inflammation.</French>
|
|
||||||
<German>Entfernt die gesamte Munition nach dem Durchzünden der Munition eines Fahrzeuges.</German>
|
|
||||||
<Italian>Rimuove tutte le munizioni dal veicolo dopo l'esplosione delle stesse</Italian>
|
|
||||||
<Polish>Usuwa całą amunicję z pojazdu po samozapłonie</Polish>
|
|
||||||
<Chinesesimp>殉爆后移除所有车辆弹药</Chinesesimp>
|
|
||||||
<Korean>쿡오프 현상 후 차량에서 모든 탄약을 제거합니다.</Korean>
|
|
||||||
<Russian>Удалять все боеприпасы из техники после их детонации</Russian>
|
|
||||||
<Spanish>Elimina toda la munición del vehículo despues ser inducida a detonar por calor</Spanish>
|
|
||||||
</Key>
|
|
||||||
<Key ID="STR_ACE_Vehicle_Damage_removeAmmoAfterCookoff_setting_enable">
|
|
||||||
<English>Enable/Disable Ammo Removal During Cook-Off</English>
|
|
||||||
<Japanese>誘爆中の弾薬除去を有効/無効にする</Japanese>
|
|
||||||
<French>Retirer les munitions durant l'auto-inflammation</French>
|
|
||||||
<German>Aktiviert/Deaktiviert Entfernung der Munition beim Durchzünden</German>
|
|
||||||
<Italian>Abilita rimozione munizioni dopo l'esplosione</Italian>
|
|
||||||
<Polish>Włącz/Wyłącz usuwanie amunicji podczas samozapłonu</Polish>
|
|
||||||
<Chinesesimp>启用/禁用殉爆过程中的弹药移除功能</Chinesesimp>
|
|
||||||
<Korean>쿡오프시 탄약 제거 활성화/비활성화</Korean>
|
|
||||||
<Russian>Удалять боеприпасы из-за детонации</Russian>
|
|
||||||
<Spanish>Habilita/Deshabilita ka eliminación de munición durante la detonación inducida por calor</Spanish>
|
|
||||||
</Key>
|
|
||||||
<Key ID="STR_ACE_Vehicle_Damage_generic_turret_wreck">
|
<Key ID="STR_ACE_Vehicle_Damage_generic_turret_wreck">
|
||||||
<English>Wreck (Turret)</English>
|
<English>Wreck (Turret)</English>
|
||||||
<French>Épave (tourelle)</French>
|
<French>Épave (tourelle)</French>
|
||||||
|
Loading…
Reference in New Issue
Block a user