Skip to content
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

Medical - Add API for fully healing a unit #10498

Merged
merged 9 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions addons/medical/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PREP(addDamageToUnit);
PREP(adjustPainLevel);
PREP(deserializeState);
PREP(fullHeal);
PREP(serializeState);
PREP(setUnconscious);
31 changes: 31 additions & 0 deletions addons/medical/functions/fnc_fullHeal.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include "..\script_component.hpp"
/*
* Author: DartRuffian
* Fully heals the patient.
*
* Arguments:
* 0: Patient <OBJECT>
* 1: Medic <OBJECT> (default: objNull)
* 2: Log message <BOOL> (default: true)
DartRuffian marked this conversation as resolved.
Show resolved Hide resolved
*
* Return Value:
* None
*
* Example:
* player call ace_medical_fnc_fullHeal
*
* Public: Yes
*/

params [["_patient", objNull, [objNull]], ["_medic", objNull, [objNull]], ["_logMessage", true, [true]]];

if (isNull _medic) then {
_medic = _patient;
};

if (!alive _patient) exitWith {
ERROR_2("fullHeal [medic %1][patient %2] Bad parameters",_medic,_patient);
DartRuffian marked this conversation as resolved.
Show resolved Hide resolved
};

[_medic, _patient, _logMessage] call EFUNC(medical_treatment,fullHeal);
nil
DartRuffian marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 5 additions & 2 deletions addons/medical_treatment/functions/fnc_fullHeal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Arguments:
* 0: Medic <OBJECT>
* 1: Patient <OBJECT>
* 2: Log message <BOOL> (default: true)
*
* Return Value:
* None
Expand All @@ -16,8 +17,10 @@
* Public: No
*/

params ["_medic", "_patient"];
params ["_medic", "_patient", ["_showMessage", true]];
DartRuffian marked this conversation as resolved.
Show resolved Hide resolved

[_patient, "activity", LSTRING(Activity_fullHeal), [[_medic, false, true] call EFUNC(common,getName)]] call FUNC(addToLog);
if (_showMessage) then {
[_patient, "activity", LSTRING(Activity_fullHeal), [[_medic, false, true] call EFUNC(common,getName)]] call FUNC(addToLog);
};

[QGVAR(fullHealLocal), _patient, _patient] call CBA_fnc_targetEvent;