Skip to content

Commit

Permalink
Cookoff - Adds heating effect to cookoff (#8685)
Browse files Browse the repository at this point in the history
* Adds heating effect to cookoff 

Makes tanks that cook-off actually heat up on IR.

* Adds cbaEvent 'setTIPars'

* Adds CBAEvent call in cookOff.sqf

* Spaces out line. Adds proper event heading.

* Moves TI event to cookOffEffect.sqf;

* Update addons/cookoff/functions/fnc_cookOffEffect.sqf

Co-authored-by: pterolatypus <pterolatypus@users.noreply.github.com>

* Changes global event for TI pars to local command

* Reverts file to before previous commits in PR.

* Update addons/cookoff/functions/fnc_cookOffEffect.sqf

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>

* Update addons/cookoff/functions/fnc_cookOffEffect.sqf

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>

* Update addons/cookoff/XEH_postInit.sqf

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>

* ti params and add comments to formula

Co-authored-by: pterolatypus <pterolatypus@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>
  • Loading branch information
4 people committed May 17, 2022
1 parent 459e732 commit da1c5d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion addons/cookoff/functions/fnc_cookOff.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ if (_smokeDelayEnabled) then {
_fireSource = selectRandom _positions;
};

[QGVAR(cookOffEffect), [_vehicle, true, _ring, _time, _fireSource]] call CBA_fnc_globalEvent;
[QGVAR(cookOffEffect), [_vehicle, true, _ring, _time, _fireSource, _intensity]] call CBA_fnc_globalEvent;

_intensity = _intensity - (0.5 max random 1);
_vehicle setVariable [QGVAR(intensity), _intensity];
Expand Down
16 changes: 13 additions & 3 deletions addons/cookoff/functions/fnc_cookOffEffect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* 2: Spawn fire ring <Boolean>
* 3: How long effect will last (Max 20 seconds) <Number>
* 4: What selection will fire originate from <String>
* 5: Cookoff intensity value <Number>
*
* Return Value:
* None
Expand All @@ -19,7 +20,7 @@
* Public: No
*/

params ["_obj", "_jet", "_ring", "_time", "_fireSelection"];
params ["_obj", "_jet", "_ring", "_time", "_fireSelection", "_intensity"];
private _light = "#lightpoint" createVehicleLocal [0,0,0];
_light setLightBrightness 5;
_light setLightAmbient [0.8, 0.6, 0.2];
Expand All @@ -43,7 +44,7 @@ if (isServer) then {

[{
params ["_args", "_pfh"];
_args params ["_obj", "_jet", "_ring", "_time", "_startTime", "_light", "_fireSelection", "_sound"];
_args params ["_obj", "_jet", "_ring", "_time", "_startTime", "_light", "_fireSelection", "_sound", "_intensity"];
private _elapsedTime = CBA_missionTime - _startTime;
if (_elapsedTime >= _time) exitWith {
deleteVehicle _light;
Expand Down Expand Up @@ -185,5 +186,14 @@ if (isServer) then {
[2 + random 1], 1, 0, "", "", _obj
];
};
}, 0, [_obj, _jet, _ring, _time, CBA_missionTime, _light, _fireSelection, _sound]] call cba_fnc_addPerFrameHandler;

(getVehicleTIPars _obj) params ["_tiEngine", "_tiWheels", "_tiWeapon"];
_obj setVehicleTIPars [
// formula is designed to have the temperature ramp up quickly and then level out
(_tiEngine + (_intensity * 0.01))/1.005,
(_tiWheels + (_intensity * 0.004))/1.002, // wheels//tracks are further away from burning parts
(_tiWeapon + (_intensity * 0.01))/1.005
];

}, 0, [_obj, _jet, _ring, _time, CBA_missionTime, _light, _fireSelection, _sound, _intensity]] call CBA_fnc_addPerFrameHandler;

0 comments on commit da1c5d3

Please sign in to comment.