Medical Status - API to modify getBloodLoss (#9926)

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
This commit is contained in:
BrettMayson 2024-04-06 19:18:07 -06:00 committed by GitHub
parent 431c4d616e
commit f3f7f2c492
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 3 deletions

View File

@ -23,4 +23,10 @@ if (_woundBleeding == 0) exitWith {0};
private _cardiacOutput = [_unit] call FUNC(getCardiacOutput);
// even if heart stops blood will still flow slowly (gravity)
(_woundBleeding * (_cardiacOutput max CARDIAC_OUTPUT_MIN) * EGVAR(medical,bleedingCoefficient))
private _bloodLoss = (_woundBleeding * (_cardiacOutput max CARDIAC_OUTPUT_MIN) * EGVAR(medical,bleedingCoefficient));
private _eventArgs = [_unit, _bloodLoss]; // Pass by reference
[QGVAR(getBloodLoss), _eventArgs] call CBA_fnc_localEvent;
_eventArgs select 1 // return

View File

@ -146,7 +146,13 @@ MenuType: 0 = Interaction, 1 = Self Interaction
|---------- |------------|----------|------|-------------|
| `ace_medical_treatment_fullHealLocalMod` | [_patient] | Local | Listen | Called before a local unit is fully healed, mods can listen and apply their own healing logic
### 2.15 Interaction (`ace_interaction`)
### 2.15 Medical Status (`ace_medical_status`)
| Event Key | Parameters | Locality | Type | Description |
|---------- |------------|----------|------|-------------|
| `ace_medical_status_getBloodLoss` | [_unit, _bloodLoss] | Local | Listen | Called when blood loss is calculated for a unit, mods can listen and modify the blood loss value by modifying the array
### 2.16 Interaction (`ace_interaction`)
| Event Key | Parameters | Locality | Type | Description |
|---------- |------------|----------|------|-------------|
@ -271,4 +277,4 @@ Calls a globally synchronized event, which will also be run on JIP players unles
// Event called on another machine (tapping above target machine)
["ace_interact_tapShoulder", [arguments], [target]] call CBA_fnc_targetEvent;
```
```