-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Medical - Add more API getters (#10514)
Co-authored-by: johnb432 <[email protected]> Co-authored-by: Grim <[email protected]>
- Loading branch information
1 parent
6026969
commit 24d2c61
Showing
4 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: DartRuffian | ||
* Calculate the total blood loss of a unit. | ||
* | ||
* Arguments: | ||
* 0: Unit <OBJECT> | ||
* | ||
* Return Value: | ||
* Total blood loss of unit (litres/second) <NUMBER> | ||
* | ||
* Example: | ||
* player call ace_medical_fnc_getBloodLoss | ||
* | ||
* Public: Yes | ||
*/ | ||
|
||
params [["_unit", objNull, [objNull]]]; | ||
|
||
if (!local _unit) exitWith { | ||
ERROR_1("unit [%1] is not local",_unit); | ||
-1 | ||
}; | ||
|
||
GET_BLOOD_LOSS(_unit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: DartRuffian | ||
* Checks if a unit is in stable condition (stable vitals, awake, and not bleeding). | ||
* Unit shouldn't require further treatment if true and not injured. | ||
* | ||
* Arguments: | ||
* 0: Unit <OBJECT> | ||
* | ||
* Return Value: | ||
* Is unit stable <BOOL> | ||
* | ||
* Example: | ||
* player call ace_medical_fnc_isInStableCondition | ||
* | ||
* Public: Yes | ||
*/ | ||
|
||
params [["_unit", objNull, [objNull]]]; | ||
|
||
if (!alive _unit) exitWith { false }; | ||
|
||
_unit call EFUNC(medical_status,isInStableCondition) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: DartRuffian | ||
* Checks if a unit is injured (bleeding, fractured limbs, low blood, etc). | ||
* Unit may still require further treatment even if false. | ||
* | ||
* Arguments: | ||
* 0: Unit <OBJECT> | ||
* | ||
* Return Value: | ||
* Is unit injured <BOOL> | ||
* | ||
* Example: | ||
* player call ace_medical_fnc_isInjured | ||
* | ||
* Public: Yes | ||
*/ | ||
|
||
params [["_unit", objNull, [objNull]]]; | ||
|
||
if (!alive _unit) exitWith { false }; | ||
|
||
private _fractures = GET_FRACTURES(_unit); | ||
|
||
((_fractures select HITPOINT_INDEX_LARM) == 1) || {(_fractures select HITPOINT_INDEX_RARM) == 1} || | ||
{_unit call EFUNC(medical_ai,isInjured)} |