-
Notifications
You must be signed in to change notification settings - Fork 747
Medical Statemachine - Optimize medical handling for uninjured AI units #11101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
397e2ad
Medical Statemachine - Optimize medical handling for uninjured AI units
PabstMirror 1bcce03
reset vitals deltaT
PabstMirror 172ad94
fix locality, doc
PabstMirror 1644949
Update medical-framework.md
PabstMirror 827c14b
Update docs/wiki/framework/medical-framework.md
PabstMirror d8448fd
Activate on calls to ace_medical_fnc APIs
PabstMirror 4586f40
Update fnc_fullHeal.sqf
PabstMirror 6ebce65
ace_medical_statemachine_fnc_checkForMedicalActivity
PabstMirror a2b725d
Update fnc_deserializeState.sqf
PabstMirror e046b11
move to engine
PabstMirror 649aa76
Update script_component.hpp
PabstMirror 4d88dfe
Apply suggestion from @PabstMirror
PabstMirror 02d3f04
Merge branch 'master' into reduceMedicalSync
PabstMirror 76cce59
checkForMedicalActivity and add note to not change
PabstMirror 6f8feb4
Update docs/wiki/framework/medical-framework.md
PabstMirror File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
48 changes: 48 additions & 0 deletions
48
addons/medical_engine/functions/fnc_checkForMedicalActivity.sqf
This file contains hidden or 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,48 @@ | ||
| #include "..\script_component.hpp" | ||
| /* | ||
| * Author: PabstMirror | ||
| * Checks for scripted medical activity on a unit | ||
| * | ||
| * Arguments: | ||
| * 0: Unit <OBJECT> | ||
| * | ||
| * Return Value: | ||
| * None | ||
| * | ||
| * Example: | ||
| * [player] call ace_medical_engine_fnc_checkForMedicalActivity | ||
| * | ||
| * Public: No | ||
| */ | ||
| params ["_unit"]; | ||
| TRACE_1("checkForMedicalActivity",_unit); | ||
|
|
||
| if (!alive _unit || {!local _unit}) exitWith {}; | ||
| if (_unit getVariable [QEGVAR(medical,medicalActivity), false]) exitWith {}; | ||
|
|
||
| { | ||
| _x params ["_var", "_default"]; | ||
| if (_unit isNil _var) then { continue }; | ||
| private _current = _unit getVariable [_var, _default]; | ||
| if (_current isNotEqualTo _default) exitWith { | ||
| TRACE_2("unit has non-defaults",_unit,_var); | ||
| [QEGVAR(medical,activateMedical), _unit] call CBA_fnc_localEvent; | ||
| }; | ||
| } forEach [ | ||
| [VAR_BLOOD_VOL, DEFAULT_BLOOD_VOLUME], | ||
| [VAR_HEART_RATE, DEFAULT_HEART_RATE], | ||
| [VAR_BLOOD_PRESS, [80, 120]], | ||
| [VAR_HEMORRHAGE, 0], | ||
| [VAR_PAIN, 0], | ||
| [VAR_PAIN_SUPP, 0], | ||
| [VAR_OPEN_WOUNDS, createHashMap], | ||
| [VAR_BANDAGED_WOUNDS, createHashMap], | ||
| [VAR_STITCHED_WOUNDS, createHashMap], | ||
| [VAR_FRACTURES, DEFAULT_FRACTURE_VALUES], | ||
| [VAR_TOURNIQUET, DEFAULT_TOURNIQUET_VALUES], | ||
| [VAR_MEDICATIONS, []], | ||
| [QEGVAR(medical,occludedMedications), []], | ||
| [QEGVAR(medical,ivBags), []], | ||
| [VAR_BODYPART_DAMAGE, DEFAULT_BODYPART_DAMAGE_VALUES] | ||
| ]; | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.