mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #3753 from acemod/blockEngine-statusEffect
Add blockEngine status effect
This commit is contained in:
commit
ed9d05d6dd
@ -76,3 +76,9 @@ class Extended_FiredBIS_EventHandlers {
|
|||||||
ADDON = QUOTE(_this call FUNC(firedEH));
|
ADDON = QUOTE(_this call FUNC(firedEH));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Extended_Engine_EventHandlers {
|
||||||
|
class All {
|
||||||
|
ADDON = QUOTE(_this call FUNC(handleEngine));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
@ -87,6 +87,7 @@ PREP(getWindDirection);
|
|||||||
PREP(getZoom);
|
PREP(getZoom);
|
||||||
PREP(goKneeling);
|
PREP(goKneeling);
|
||||||
PREP(hadamardProduct);
|
PREP(hadamardProduct);
|
||||||
|
PREP(handleEngine);
|
||||||
PREP(handleModifierKey);
|
PREP(handleModifierKey);
|
||||||
PREP(handleModifierKeyUp);
|
PREP(handleModifierKeyUp);
|
||||||
PREP(handleScrollWheel);
|
PREP(handleScrollWheel);
|
||||||
|
@ -64,6 +64,7 @@
|
|||||||
["blockSprint", false, []] call FUNC(statusEffect_addType);
|
["blockSprint", false, []] call FUNC(statusEffect_addType);
|
||||||
["setCaptive", true, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), QEGVAR(medical,unconscious)]] call FUNC(statusEffect_addType);
|
["setCaptive", true, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), QEGVAR(medical,unconscious)]] call FUNC(statusEffect_addType);
|
||||||
["blockDamage", false, ["fixCollision"]] call FUNC(statusEffect_addType);
|
["blockDamage", false, ["fixCollision"]] call FUNC(statusEffect_addType);
|
||||||
|
["blockEngine", false, ["ACE_Refuel"]] call FUNC(statusEffect_addType);
|
||||||
|
|
||||||
["forceWalk", {
|
["forceWalk", {
|
||||||
params ["_object", "_set"];
|
params ["_object", "_set"];
|
||||||
@ -90,6 +91,11 @@
|
|||||||
_object allowDamage (_set == 0);
|
_object allowDamage (_set == 0);
|
||||||
};
|
};
|
||||||
}] call FUNC(addEventHandler);
|
}] call FUNC(addEventHandler);
|
||||||
|
["blockEngine", {
|
||||||
|
params ["_vehicle", "_set"];
|
||||||
|
_vehicle setVariable [QGVAR(blockEngine), _set > 0, true];
|
||||||
|
_vehicle engineOn false;
|
||||||
|
}] call FUNC(addEventHandler);
|
||||||
|
|
||||||
//Add a fix for BIS's zeus remoteControl module not reseting variables on DC when RC a unit
|
//Add a fix for BIS's zeus remoteControl module not reseting variables on DC when RC a unit
|
||||||
//This variable is used for isPlayer checks
|
//This variable is used for isPlayer checks
|
||||||
|
19
addons/common/functions/fnc_handleEngine.sqf
Normal file
19
addons/common/functions/fnc_handleEngine.sqf
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Author: BaerMitUmlaut
|
||||||
|
* Blocks turning on the vehicles engine if set by the status effect handler.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Vehicle <OBJECT>
|
||||||
|
* 1: Engine state <BOOL>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
params ["_vehicle", "_engineOn"];
|
||||||
|
|
||||||
|
if (local _vehicle && {_engineOn} && {_vehicle getVariable [QGVAR(blockEngine), false]}) then {
|
||||||
|
_vehicle engineOn false;
|
||||||
|
};
|
@ -17,9 +17,7 @@
|
|||||||
|
|
||||||
params [["_target", objNull, [objNull]]];
|
params [["_target", objNull, [objNull]]];
|
||||||
|
|
||||||
["setVanillaHitPointDamage", _target, [_target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]] ] ] call EFUNC(common,objectEvent);
|
[_target, "blockEngine", "ACE_Refuel", false] call EFUNC(common,statusEffect_set);
|
||||||
|
|
||||||
_target setVariable [QGVAR(engineHit), nil, true];
|
|
||||||
_target setVariable [QGVAR(isConnected), false, true];
|
_target setVariable [QGVAR(isConnected), false, true];
|
||||||
|
|
||||||
private _nozzle = _target getVariable [QGVAR(ownedNozzle), nil];
|
private _nozzle = _target getVariable [QGVAR(ownedNozzle), nil];
|
||||||
|
@ -48,8 +48,7 @@ if (isNull _nozzle || {_source != _target}) exitWith {false};
|
|||||||
};
|
};
|
||||||
deleteVehicle _nozzle;
|
deleteVehicle _nozzle;
|
||||||
|
|
||||||
["setVanillaHitPointDamage", _target, [_target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]] ] ] call EFUNC(common,objectEvent);
|
[_target, "blockEngine", "ACE_Refuel", false] call EFUNC(common,statusEffect_set);
|
||||||
_target setVariable [QGVAR(engineHit), nil, true];
|
|
||||||
},
|
},
|
||||||
"",
|
"",
|
||||||
localize LSTRING(ReturnAction),
|
localize LSTRING(ReturnAction),
|
||||||
|
@ -26,8 +26,7 @@ REFUEL_HOLSTER_WEAPON
|
|||||||
|
|
||||||
private _endPosOffset = [0, 0, 0];
|
private _endPosOffset = [0, 0, 0];
|
||||||
if (isNull _nozzle) then { // func is called on fuel truck
|
if (isNull _nozzle) then { // func is called on fuel truck
|
||||||
_target setVariable [QGVAR(engineHit), _target getHitPointDamage "HitEngine", true];
|
[_target, "blockEngine", "ACE_Refuel", true] call EFUNC(common,statusEffect_set);
|
||||||
["setVanillaHitPointDamage", _target, [_target, ["HitEngine", 1]] ] call EFUNC(common,objectEvent);
|
|
||||||
|
|
||||||
_target setVariable [QGVAR(isConnected), true, true];
|
_target setVariable [QGVAR(isConnected), true, true];
|
||||||
_endPosOffset = getArray (configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hooks));
|
_endPosOffset = getArray (configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hooks));
|
||||||
|
Loading…
Reference in New Issue
Block a user