Merged instant death and execution into one setting

This commit is contained in:
BaerMitUmlaut 2016-11-09 19:01:55 +01:00
parent 08a378bb2d
commit dac4a4dc42
5 changed files with 17 additions and 22 deletions

View File

@ -64,13 +64,13 @@ class ACE_Medical_StateMachine {
// Transition state for handling instant death
// This state raises the next transition in the same frame
onStateEntered = QUOTE(DFUNC(enteredStateFatalInjury));
class InstantDeathPrevented {
class SecondChance {
events[] = {QGVAR(FatalInjuryInstantTransition)};
targetState = "CardiacArrest";
condition = QUOTE(!GVAR(enableInstantDeath));
onTransition = QUOTE(DFUNC(transitionInstantDeathPrevented));
condition = QUOTE(GVAR(allowDeathMode) > 0);
onTransition = QUOTE(DFUNC(transitionSecondChance));
};
class InstantDeath {
class Death {
events[] = {QGVAR(FatalInjuryInstantTransition)};
targetState = "Dead";
condition = "true";
@ -79,9 +79,9 @@ class ACE_Medical_StateMachine {
class CardiacArrest {
onStateEntered = QUOTE(DFUNC(enteredStateCardiacArrest));
onStateLeaving = '_this setVariable [QGVAR(cardiacArrestStart), nil]';
class Death {
class TimerRanOut {
targetState = "Dead";
condition = QUOTE(DFUNC(conditionCardiacArrestDeath));
condition = QUOTE(DFUNC(conditionCardiacArrestTimer));
};
class Reanimated {
targetState = "Unconscious";

View File

@ -38,20 +38,15 @@ GVAR(STATE_MACHINE) = (configFile >> "ACE_Medical_StateMachine") call CBA_statem
] call CBA_Settings_fnc_init;
[
QGVAR(enableInstantDeath),
"CHECKBOX",
["Enable Instant Death", "Enables units instantly dying without entering cardiac arrest first."], //@todo
QGVAR(allowDeathMode),
"LIST",
["Kill unit after", ""], //@todo
"ACE Medical", // @todo
true,
true
] call CBA_Settings_fnc_init;
[
QGVAR(enableExecutions),
"CHECKBOX",
["Enable Executions", "Enables killing units that are in cardiac arrest. Only matters when instant death is disabled."], //@todo
"ACE Medical", // @todo
true,
[
[0, 1, 2],
["Fatal wound", "Second chance after fatal wound", "Only cardiac arrest time expiration"],
0
],
true
] call CBA_Settings_fnc_init;

View File

@ -1,6 +1,6 @@
/*
* Author: BaerMitUmlaut
* Handles a unit entering cardiac arrest.
* Checks if the cardiac arrest timer ran out.
*
* Arguments:
* 0: The Unit <OBJECT>

View File

@ -13,4 +13,4 @@
#include "script_component.hpp"
params ["_unit"];
GVAR(enableInstantDeath) || {GVAR(enableExecutions) && {!(_unit getVariable [QGVAR(deathBlocked), false])}}
(GVAR(allowDeathMode) < 2) && {!(_unit getVariable [QGVAR(deathBlocked), false])}}

View File

@ -1,6 +1,6 @@
/*
* Author: BaerMitUmlaut
* Prevents instant death for 1 second.
* Gives the unit a second chance and prevents death for 1 second.
*
* Arguments:
* 0: The Unit <OBJECT>