2015-04-13 05:23:00 +00:00
|
|
|
// by commy2 and esteldunedain
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
ACE_Modifier = 0;
|
|
|
|
|
2015-04-13 05:46:45 +00:00
|
|
|
//SelectLeader Event Handler for BecomeLeader action:
|
|
|
|
[QGVAR(selectLeader), {
|
|
|
|
PARAMS_2(_group,_leader);
|
|
|
|
_group selectLeader _leader;
|
|
|
|
}] call EFUNC(common,addEventHandler);
|
|
|
|
|
2015-08-11 03:08:13 +00:00
|
|
|
//Pushing boats from FUNC(push)
|
|
|
|
[QGVAR(pushBoat), {
|
|
|
|
params ["_boat", "_newVelocity"];
|
|
|
|
_boat setVelocity _newVelocity;
|
|
|
|
}] call EFUNC(common,addEventHandler);
|
|
|
|
|
|
|
|
|
2015-04-13 05:23:00 +00:00
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
|
|
|
|
GVAR(isOpeningDoor) = false;
|
|
|
|
|
|
|
|
// restore global fire teams for JIP
|
2015-05-01 23:12:24 +00:00
|
|
|
private ["_team"];
|
2015-04-13 05:23:00 +00:00
|
|
|
{
|
|
|
|
_team = _x getVariable [QGVAR(assignedFireTeam), ""];
|
|
|
|
if (_team != "") then {_x assignTeam _team};
|
|
|
|
} forEach allUnits;
|
|
|
|
|
|
|
|
|
|
|
|
// Add keybinds
|
2015-05-28 19:59:04 +00:00
|
|
|
["ACE3 Common", QGVAR(openDoor), localize LSTRING(OpenDoor),
|
2015-04-13 05:23:00 +00:00
|
|
|
{
|
|
|
|
// Conditions: canInteract
|
|
|
|
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
|
|
|
// Conditions: specific
|
2015-08-30 09:13:26 +00:00
|
|
|
if (GVAR(isOpeningDoor) || {[MACRO_DOOR_REACH_DISTANCE] call FUNC(getDoor) select 1 == ''}) exitWith {false};
|
2015-04-13 05:23:00 +00:00
|
|
|
|
|
|
|
// Statement
|
|
|
|
call EFUNC(interaction,openDoor);
|
|
|
|
true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
//Probably don't want any condidtions here, so variable never gets locked down
|
|
|
|
// Statement
|
|
|
|
GVAR(isOpeningDoor) = false;
|
|
|
|
true
|
|
|
|
},
|
|
|
|
[57, [false, true, false]], false] call cba_fnc_addKeybind; //Key CTRL+Space
|
|
|
|
|
|
|
|
|
2015-05-28 19:59:04 +00:00
|
|
|
["ACE3 Common", QGVAR(tapShoulder), localize LSTRING(TapShoulder),
|
2015-04-13 05:23:00 +00:00
|
|
|
{
|
|
|
|
// Conditions: canInteract
|
|
|
|
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
|
|
|
// Conditions: specific
|
|
|
|
if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false};
|
|
|
|
|
|
|
|
// Statement
|
2015-05-15 18:52:09 +00:00
|
|
|
[ACE_player, cursorTarget, 0] call FUNC(tapShoulder);
|
2015-04-13 05:23:00 +00:00
|
|
|
true
|
|
|
|
},
|
|
|
|
{false},
|
|
|
|
[20, [true, false, false]], false] call cba_fnc_addKeybind;
|
|
|
|
|
2015-05-28 19:59:04 +00:00
|
|
|
["ACE3 Common", QGVAR(modifierKey), localize LSTRING(ModifierKey),
|
2015-04-13 05:23:00 +00:00
|
|
|
{
|
|
|
|
// Conditions: canInteract
|
|
|
|
//if !([ACE_player, objNull, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; // not needed
|
|
|
|
|
|
|
|
// Statement
|
|
|
|
ACE_Modifier = 1;
|
|
|
|
// Return false so it doesn't block other actions
|
|
|
|
false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
//Probably don't want any condidtions here, so variable never gets locked down
|
|
|
|
ACE_Modifier = 0;
|
|
|
|
false;
|
|
|
|
},
|
|
|
|
[29, [false, false, false]], false] call cba_fnc_addKeybind;
|
|
|
|
|
|
|
|
["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition);
|
2015-08-30 20:03:45 +00:00
|
|
|
["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition);
|