mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
18f09b9310
- ace_addedHeartRateAdjustment -> ace_heartRateAdjustmentAdded - ace_cargoAddedByClass -> ace_cargoByClassAdded - ace_enteredCardiacArrest -> ace_cardiacArrestEntered - ace_itemAddedToTriageCard -> ace_triageCardItemAdded - ace_reload_linkedAmmo -> ace_reload_ammoLinked - ace_reload_returnedAmmo -> ace_reload_ammoReturned - ace_treatmentSuccess -> ace_treatmentSucceded - ace_common_engineOn -> ace_common_setEngine - ace_explosives_clientRequestOrientations -> ace_explosives_requestOrientations - ace_explosives_serverSendOrientations -> ace_explosives_sendOrientations - ace_interaction_lampTurnOff -> ace_interaction_setLampOff - ace_interaction_lampTurnOn -> ace_interaction_setLampOn - ace_overheating_spareBarrelsLoadCoolest -> ace_overheating_loadCoolestSpareBarrel - ace_overheating_spareBarrelsSendTemperatureHint -> ace_overheating_sendSpareBarrelTemperatureHint Close #3533
82 lines
2.8 KiB
Plaintext
82 lines
2.8 KiB
Plaintext
// by commy2 and esteldunedain
|
|
#include "script_component.hpp"
|
|
|
|
ACE_Modifier = 0;
|
|
|
|
[QGVAR(pardon), {(_this select 0) addRating -rating (_this select 0)}] call CBA_fnc_addEventHandler;
|
|
|
|
[QGVAR(getDown), {
|
|
params ["_target"];
|
|
|
|
_target setUnitPos "DOWN";
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
[QGVAR(sendAway), {
|
|
params ["_unit", "_position"];
|
|
|
|
_unit setUnitPos "AUTO";
|
|
_unit doMove _position;
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
[QGVAR(setLampOn), {
|
|
params ["_lamp", "_hitPointsDamage", "_disabledLampDMG"];
|
|
{if((_x select 1) == _disabledLampDMG) then {_lamp setHit [_x select 0, 0];};nil} count _hitPointsDamage;
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
[QGVAR(setLampOff), {
|
|
params ["_lamp", "_hitPointsDamage", "_disabledLampDMG"];
|
|
{_lamp setHit [_x select 0, (_x select 1) max _disabledLampDMG];nil} count _hitPointsDamage;
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
GVAR(isOpeningDoor) = false;
|
|
|
|
[QGVAR(tapShoulder), {
|
|
params ["_unit", "_shoulderNum"];
|
|
|
|
if (_unit == ACE_player) then {
|
|
addCamShake [4, 0.5, 5];
|
|
private _message = parseText format ([["%1 >", localize LSTRING(YouWereTappedRight)], ["< %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 1));
|
|
[_message] call EFUNC(common,displayTextStructured);
|
|
};
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
// add keybinds
|
|
["ACE3 Common", QGVAR(openDoor), localize LSTRING(OpenDoor), {
|
|
// Conditions: canInteract
|
|
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
|
// Conditions: specific
|
|
if (GVAR(isOpeningDoor) || {[MACRO_DOOR_REACH_DISTANCE] call FUNC(getDoor) select 1 == ''}) exitWith {false};
|
|
|
|
// 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
|
|
|
|
|
|
["ACE3 Common", QGVAR(tapShoulder), localize LSTRING(TapShoulder), {
|
|
// Conditions: canInteract
|
|
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
|
// Conditions: specific
|
|
if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false};
|
|
|
|
//Tap whichever shoulder is closest
|
|
private _shoulderNum = [0, 1] select (([cursorTarget, ACE_player] call BIS_fnc_relativeDirTo) > 180);
|
|
|
|
// Statement
|
|
[ACE_player, cursorTarget, _shoulderNum] call FUNC(tapShoulder);
|
|
true
|
|
},
|
|
{false},
|
|
[20, [true, false, false]], false] call CBA_fnc_addKeybind;
|
|
|
|
["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition);
|
|
["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition);
|