mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
c44a1e7ea7
* Cook-off improvements * More changes * Update fnc_getVehicleAmmo.sqf * Better engine fire placement * Update fnc_detonateAmmunition.sqf * Update XEH_postInit.sqf * Update fnc_getVehicleAmmo.sqf * Update events-framework.md * Various improvements * Separate effect handling * Tweaks * Update XEH_postInit.sqf * Prevent double ammo detonation * Fixed objects not being able to cook-off again * Added incendiary rounds as source of box cookoff * Converted enable setting to bool * Fixed brackets * Update fnc_cookOff.sqf * Update CfgEden.hpp * Removed GVAR(enable), added GVAR(enableFire) back * Update initSettings.inc.sqf * Update events-framework.md * Update addons/cookoff/functions/fnc_cookOffEffect.sqf * Restructured, redid API events * Fix effect for JIP, minor optimisations * Removed `cbaSettings_settingChanged` * Renamed variables, tweaked string table entries * Update fire damage #9991 * Capitalize comments again * Fix cookoff for very short durations and fix effect removal being too quick
43 lines
1.2 KiB
Plaintext
43 lines
1.2 KiB
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: tcvm
|
|
* Sets vehicle damage based on HitIndex. Failing that it falls back to HitPoint name.
|
|
*
|
|
* Arguments:
|
|
* 0: The vehicle <OBJECT>
|
|
* 1: Hit Index <NUMBER>
|
|
* 2: Hit Point <STRING>
|
|
* 3: Damage <NUMBER>
|
|
* 4: Whether or not to cap the damage to maximum part damage <BOOL> (default: True)
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [vehicle player, 234, "HitHull"] call ace_vehicle_damage_fnc_addDamage
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_vehicle", "_hitIndex", "_hitPoint", "_damage", ["_capDamageAtCurret", true]];
|
|
|
|
private _currentDamage = _vehicle getHitPointDamage _hitPoint;
|
|
if (_capDamageAtCurret && { _damage < _currentDamage }) exitWith {
|
|
TRACE_4("capping damage at current",_capDamageAtCurret,_damage,_currentDamage,_hitPoint);
|
|
};
|
|
|
|
TRACE_4("adding damage to vehicle",_vehicle,_hitIndex,_hitPoint,_damage);
|
|
if (_hitPoint isEqualTo "#structural") then {
|
|
_hitPoint = "hithull";
|
|
_hitIndex = -1;
|
|
};
|
|
if (_hitIndex >= 0) then {
|
|
_vehicle setHitIndex [_hitIndex, _damage, true];
|
|
} else {
|
|
_vehicle setHitPointDamage [_hitPoint, _damage, true];
|
|
};
|
|
|
|
if (_hitPoint == "hitengine" && {_damage > 0.9}) then {
|
|
[QEGVAR(cookoff,engineFireServer), _vehicle] call CBA_fnc_serverEvent;
|
|
};
|