Implement Unconc Event Handler

This commit is contained in:
PabstMirror 2015-03-10 11:08:15 -05:00
parent 93a1cdaab6
commit 3f32627d61
5 changed files with 39 additions and 59 deletions

View File

@ -27,12 +27,5 @@ if (isServer) then {
["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler); ["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler);
["SetSurrendered", {_this call FUNC(setSurrendered)}] call EFUNC(common,addEventHandler); ["SetSurrendered", {_this call FUNC(setSurrendered)}] call EFUNC(common,addEventHandler);
//TODO: Medical Integration Events??? //Medical Integration Events???
["medical_onUnconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call EFUNC(common,addEventHandler);
// [_unit, "knockedOut", {
// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleKnockedOut};
// }] call ACE_Core_fnc_addCustomEventhandler;
// [_unit, "wokeUp", {
// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleWokeUp};
// }] call ACE_Core_fnc_addCustomEventhandler;

View File

@ -19,10 +19,9 @@ PREP(doUnloadCaptive);
PREP(handleGetIn); PREP(handleGetIn);
PREP(handleGetOut); PREP(handleGetOut);
PREP(handleKilled); PREP(handleKilled);
PREP(handleKnockedOut); PREP(handleOnUnconscious);
PREP(handlePlayerChanged); PREP(handlePlayerChanged);
PREP(handleUnitInitPost); PREP(handleUnitInitPost);
PREP(handleWokeUp);
PREP(handleZeusDisplayChanged); PREP(handleZeusDisplayChanged);
PREP(moduleSurrender); PREP(moduleSurrender);
PREP(setHandcuffed); PREP(setHandcuffed);

View File

@ -1,25 +0,0 @@
/*
* Author: commy2, PabstMirror
* Handles when a unit gets knocked out. Ends surrendering.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [bob, true] call ACE_captives_fnc_handleKnockedOut
*
* Public: No
*/
#include "script_component.hpp"
//ToDo: Waiting on medical integration
PARAMS_1(_unit);
if (_unit getVariable [QGVAR(isSurrendering), false]) then { //If surrendering, stop
[_unit, false] call FUNC(setSurrendered);
};

View File

@ -0,0 +1,36 @@
/*
* Author: commy2, PabstMirror
* Handles the "medical_onUnconscious" event
*
* Arguments:
* 0: Unit <OBJECT>
* 0: Is Unconsisisiouses <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* [bob, true] call ACE_captives_fnc_handleOnUnconscious
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_isUnconc);
if (!local _unit) exitWith {};
systemChat format ["med: %1", _this];
if (_isUnconc) then {
//Knocked out: If surrendering, stop
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
[_unit, false] call FUNC(setSurrendered);
};
} else {
//Woke up: if handcuffed, goto animation
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
};
};

View File

@ -1,23 +0,0 @@
/*
* Author: commy2
* TODO
*
* Arguments:
* 0: _unit <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [bob] call ACE_captives_fnc_handleWokeUp
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_unit);
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
[_unit, "ACE_AmovPercMstpScapWnonDnon", 0] call EFUNC(common,doAnimation);
};