2015-04-13 05:23:00 +00:00
|
|
|
// by commy2 and esteldunedain
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
ACE_Modifier = 0;
|
|
|
|
|
2015-09-28 15:20:56 +00:00
|
|
|
["pardon", {(_this select 0) addRating -rating (_this select 0)}] call EFUNC(common,addEventHandler);
|
2015-04-13 05:46:45 +00:00
|
|
|
|
2015-09-28 15:11:53 +00:00
|
|
|
["getDown", {
|
|
|
|
params ["_target"];
|
|
|
|
|
|
|
|
_target setUnitPos "DOWN";
|
2015-08-11 03:08:13 +00:00
|
|
|
}] call EFUNC(common,addEventHandler);
|
|
|
|
|
2015-09-28 15:11:53 +00:00
|
|
|
["sendAway", {
|
|
|
|
params ["_unit", "_position"];
|
|
|
|
|
|
|
|
_unit setUnitPos "AUTO";
|
|
|
|
_unit doMove _position;
|
|
|
|
}] call EFUNC(common,addEventHandler);
|
2015-08-11 03:08:13 +00:00
|
|
|
|
2016-02-05 03:26:54 +00:00
|
|
|
["lampTurnOn", {
|
|
|
|
params ["_lamp", "_hitPointsDamage", "_disabledLampDMG"];
|
|
|
|
{if((_x select 1) == _disabledLampDMG) then {_lamp setHit [_x select 0, 0];};nil} count _hitPointsDamage;
|
|
|
|
}] call EFUNC(common,addEventHandler);
|
|
|
|
|
|
|
|
["lampTurnOff", {
|
|
|
|
params ["_lamp", "_hitPointsDamage", "_disabledLampDMG"];
|
|
|
|
{_lamp setHit [_x select 0, (_x select 1) max _disabledLampDMG];nil} count _hitPointsDamage;
|
|
|
|
}] call EFUNC(common,addEventHandler);
|
|
|
|
|
2015-04-13 05:23:00 +00:00
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
|
|
|
|
GVAR(isOpeningDoor) = false;
|
|
|
|
|
2015-09-28 15:11:53 +00:00
|
|
|
["tapShoulder", {
|
|
|
|
params ["_unit", "_shoulderNum"];
|
|
|
|
|
|
|
|
if (_unit == ACE_player) then {
|
|
|
|
addCamShake [4, 0.5, 5];
|
2015-11-24 17:25:56 +00:00
|
|
|
private _message = parseText format ([["%1 >", localize LSTRING(YouWereTappedRight)], ["< %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 1));
|
|
|
|
[_message] call EFUNC(common,displayTextStructured);
|
2015-09-28 15:11:53 +00:00
|
|
|
};
|
|
|
|
}] call EFUNC(common,addEventHandler);
|
|
|
|
|
2015-09-28 12:35:05 +00:00
|
|
|
// add keybinds
|
|
|
|
["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
|
2015-09-28 12:35:05 +00:00
|
|
|
}, {
|
2015-04-13 05:23:00 +00:00
|
|
|
//Probably don't want any condidtions here, so variable never gets locked down
|
|
|
|
// Statement
|
|
|
|
GVAR(isOpeningDoor) = false;
|
|
|
|
true
|
|
|
|
},
|
2015-09-28 12:35:05 +00:00
|
|
|
[57, [false, true, false]], false] call CBA_fnc_addKeybind; //Key CTRL+Space
|
2015-04-13 05:23:00 +00:00
|
|
|
|
|
|
|
|
2015-09-28 12:35:05 +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};
|
|
|
|
|
2015-11-24 17:25:56 +00:00
|
|
|
//Tap whichever shoulder is closest
|
|
|
|
private _shoulderNum = [0, 1] select (([cursorTarget, ACE_player] call BIS_fnc_relativeDirTo) > 180);
|
2016-02-05 03:26:54 +00:00
|
|
|
|
2015-04-13 05:23:00 +00:00
|
|
|
// Statement
|
2015-11-24 17:25:56 +00:00
|
|
|
[ACE_player, cursorTarget, _shoulderNum] call FUNC(tapShoulder);
|
2015-04-13 05:23:00 +00:00
|
|
|
true
|
|
|
|
},
|
|
|
|
{false},
|
2015-09-28 12:35:05 +00:00
|
|
|
[20, [true, false, false]], false] call CBA_fnc_addKeybind;
|
2015-04-13 05:23:00 +00:00
|
|
|
|
|
|
|
["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);
|