mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Made AI medic use epipen on unconscious patients (#5433)
* Made AI medic use epipen on unconscious patients * Fix epi heal args, use non-local treatment funcs
This commit is contained in:
parent
65c5e6e38e
commit
8d9c17ed88
@ -54,6 +54,7 @@ _target forceSpeed 0;
|
|||||||
|
|
||||||
private _needsBandaging = ([_target] call EFUNC(medical,getBloodLoss)) > 0;
|
private _needsBandaging = ([_target] call EFUNC(medical,getBloodLoss)) > 0;
|
||||||
private _needsMorphine = (_target getVariable [QEGVAR(medical,pain), 0]) > 0.2;
|
private _needsMorphine = (_target getVariable [QEGVAR(medical,pain), 0]) > 0.2;
|
||||||
|
private _needsEpinephrine = _target getVariable ["ACE_isUnconscious", false];
|
||||||
|
|
||||||
switch (true) do {
|
switch (true) do {
|
||||||
case _needsBandaging: {
|
case _needsBandaging: {
|
||||||
@ -66,7 +67,7 @@ switch (true) do {
|
|||||||
};
|
};
|
||||||
} forEach _openWounds;
|
} forEach _openWounds;
|
||||||
private _selection = ["head","body","hand_l","hand_r","leg_l","leg_r"] select _partIndex;
|
private _selection = ["head","body","hand_l","hand_r","leg_l","leg_r"] select _partIndex;
|
||||||
[_target, "Bandage", _selection] call EFUNC(medical,treatmentAdvanced_bandageLocal);
|
[_this, _target, _selection, "Bandage"] call EFUNC(medical,treatmentAdvanced_bandage);
|
||||||
|
|
||||||
#ifdef DEBUG_MODE_FULL
|
#ifdef DEBUG_MODE_FULL
|
||||||
systemChat format ["%1 is bandaging selection %2 on %3", _this, _selection, _target];
|
systemChat format ["%1 is bandaging selection %2 on %3", _this, _selection, _target];
|
||||||
@ -77,7 +78,7 @@ switch (true) do {
|
|||||||
_this setVariable [QGVAR(treatmentOverAt), CBA_missionTime + 5];
|
_this setVariable [QGVAR(treatmentOverAt), CBA_missionTime + 5];
|
||||||
};
|
};
|
||||||
case _needsMorphine: {
|
case _needsMorphine: {
|
||||||
[_target] call EFUNC(medical,treatmentBasic_morphineLocal);
|
[_this, _target] call EFUNC(medical,treatmentBasic_morphine);
|
||||||
[_this, false, false] call FUNC(playTreatmentAnim);
|
[_this, false, false] call FUNC(playTreatmentAnim);
|
||||||
_this setVariable [QGVAR(treatmentOverAt), CBA_missionTime + 2];
|
_this setVariable [QGVAR(treatmentOverAt), CBA_missionTime + 2];
|
||||||
|
|
||||||
@ -85,4 +86,13 @@ switch (true) do {
|
|||||||
systemChat format ["%1 is giving %2 morphine", _this, _target];
|
systemChat format ["%1 is giving %2 morphine", _this, _target];
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
case _needsEpinephrine: {
|
||||||
|
[_this, _target] call EFUNC(medical,treatmentBasic_epipen);
|
||||||
|
[_this, false, false] call FUNC(playTreatmentAnim);
|
||||||
|
_this setVariable [QGVAR(treatmentOverAt), CBA_missionTime + 2];
|
||||||
|
|
||||||
|
#ifdef DEBUG_MODE_FULL
|
||||||
|
systemChat format ["%1 is using an epipen on %2", _this, _target];
|
||||||
|
#endif
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
@ -19,7 +19,7 @@ if !(alive _this) exitWith {false};
|
|||||||
|
|
||||||
private _bloodLoss = [_this] call EFUNC(medical,getBloodLoss);
|
private _bloodLoss = [_this] call EFUNC(medical,getBloodLoss);
|
||||||
private _pain = _this getVariable [QEGVAR(medical,pain), 0];
|
private _pain = _this getVariable [QEGVAR(medical,pain), 0];
|
||||||
// Advanced only?
|
private _unconscious = _this getVariable ["ACE_isUnconscious", false];
|
||||||
// private _heartRate = _this getVariable [QEGVAR(medical,heartRate), 70];
|
// private _heartRate = _this getVariable [QEGVAR(medical,heartRate), 70];
|
||||||
|
|
||||||
(_bloodLoss > 0) || {_pain > 0.2} // || {_heartRate > 100} || {_heartRate < 40}
|
(_bloodLoss > 0) || {_pain > 0.2} || _unconscious // || {_heartRate > 100} || {_heartRate < 40}
|
||||||
|
Loading…
Reference in New Issue
Block a user