Add function to check if AI and condition from fatal

This commit is contained in:
Arcanum 2017-05-22 20:53:00 +02:00
parent d055845201
commit 31e1e2964b
3 changed files with 52 additions and 1 deletions

View File

@ -61,7 +61,14 @@ class ACE_Medical_StateMachine {
class SecondChance {
events[] = {QGVAR(FatalInjuryInstantTransition)};
targetState = "CardiacArrest";
condition = QUOTE(GVAR(fatalInjuryCondition) > 0);
condition = QUOTE(DFUNC(conditionFromFatalToCardiac));
onTransition = QUOTE(DFUNC(transitionSecondChance));
};
class SecondChanceAI {
events[] = {QGVAR(FatalInjuryInstantTransition)};
targetState = "CardiacArrest";
//conditionFromFatalToCardiac
condition = QUOTE(DFUNC(conditionFromFatalToCardiac));
onTransition = QUOTE(DFUNC(transitionSecondChance));
};
class Death {

View File

@ -0,0 +1,17 @@
/*
* Author: Arcanum
* Condition for trasfer from FatalInjury to Second chance.
*
* Arguments:
* 0: The Unit <OBJECT>
* 1: 1 for AI 0 for player <BOOL>
*
* Return Value:
* Condition fo state machine <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit","_wantAI"];
(GVAR(fatalInjuryConditionAI) > 0) && (QUOTE(_this call FUNC(isAi)) == _wantAI)

View File

@ -0,0 +1,27 @@
/*
* Author: Arcanum
* Check if a unit is AI
*
* Arguments:
* 0: The Unit <OBJECT>
*
* ReturnValue:
* Is AI <BOOL>
*
* Example:
* [player] call ace_medical_fnc_isAI
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit"];
private _return = 0;
if (isPlayer _unit) then {
_return=0;
else {
_return=1;
};
_return