Remove unneeded and deprecated functions from medical

This commit is contained in:
Glowbal 2016-06-13 12:24:28 +02:00
parent d568041838
commit 58f43f8a51
11 changed files with 0 additions and 235 deletions

View File

@ -15,8 +15,6 @@ class ACE_Medical_Actions {
condition = "";
patientStateCondition = 0;
itemConsumed = 1;
//callbackSuccess = QUOTE(DFUNC(treatmentBasic_bandage));
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_bandage));
callbackFailure = "";
callbackProgress = "";

View File

@ -35,7 +35,6 @@ PREP(handleDamage);
PREP(handleDamage_advanced);
PREP(handleDamage_advancedSetDamage);
PREP(handleDamage_airway);
PREP(handleDamage_basic);
PREP(handleDamage_caching);
PREP(handleDamage_fractures);
PREP(handleDamage_internalInjuries);
@ -61,8 +60,6 @@ PREP(itemCheck);
PREP(medicationEffectLoop);
PREP(modifyMedicalAction);
PREP(onMedicationUsage);
PREP(onWoundUpdateRequest);
PREP(onPropagateWound);
PREP(parseConfigForInjuries);
PREP(playInjuredSound);
PREP(reviveStateLoop);
@ -88,8 +85,6 @@ PREP(treatmentAdvanced_fullHealTreatmentTime);
PREP(treatmentAdvanced_medication);
PREP(treatmentAdvanced_medicationLocal);
PREP(treatmentAdvanced_surgicalKit_onProgress);
PREP(treatmentBasic_bandage);
PREP(treatmentBasic_bandageLocal);
PREP(treatmentBasic_bloodbag);
PREP(treatmentBasic_bloodbagLocal);
PREP(treatmentBasic_epipen);
@ -113,7 +108,6 @@ PREP(moduleAssignMedicRoles);
PREP(moduleAssignMedicalVehicle);
PREP(moduleAssignMedicalFacility);
PREP(copyDeadBody);
PREP(requestWoundSync);
PREP(unconsciousPFH);
// Networked litter

View File

@ -21,7 +21,6 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"];
[QGVAR(treatmentAdvanced_CPRLocal), DFUNC(treatmentAdvanced_CPRLocal)] call CBA_fnc_addEventHandler;
[QGVAR(treatmentAdvanced_fullHealLocal), DFUNC(treatmentAdvanced_fullHealLocal)] call CBA_fnc_addEventHandler;
[QGVAR(treatmentAdvanced_medicationLocal), DFUNC(treatmentAdvanced_medicationLocal)] call CBA_fnc_addEventHandler;
[QGVAR(treatmentBasic_bandageLocal), DFUNC(treatmentBasic_bandageLocal)] call CBA_fnc_addEventHandler;
[QGVAR(treatmentBasic_bloodbagLocal), DFUNC(treatmentBasic_bloodbagLocal)] call CBA_fnc_addEventHandler;
[QGVAR(treatmentBasic_morphineLocal), DFUNC(treatmentBasic_morphineLocal)] call CBA_fnc_addEventHandler;
[QGVAR(treatmentIVLocal), DFUNC(treatmentIVLocal)] call CBA_fnc_addEventHandler;

View File

@ -40,7 +40,6 @@ class ACE_newEvents {
treatmentIVLocal = QGVAR(treatmentIVLocal);
treatmentBasic_morphineLocal = QGVAR(treatmentBasic_morphineLocal);
treatmentBasic_bloodbagLocal = QGVAR(treatmentBasic_bloodbagLocal);
treatmentBasic_bandageLocal = QGVAR(treatmentBasic_bandageLocal);
treatmentAdvanced_medicationLocal = QGVAR(treatmentAdvanced_medicationLocal);
treatmentAdvanced_fullHealLocal = QGVAR(treatmentAdvanced_fullHealLocal);
treatmentAdvanced_CPRLocal = QGVAR(treatmentAdvanced_CPRLocal);

View File

@ -24,10 +24,6 @@ params ["_target", ["_show", true], ["_selectionN", 0]];
GVAR(currentSelectedSelectionN) = [0, _selectionN] select (IS_SCALAR(_selectionN));
GVAR(displayPatientInformationTarget) = [ObjNull, _target] select _show;
if (USE_WOUND_EVENT_SYNC) then {
[_target, ACE_player] call FUNC(requestWoundSync);
};
if (_show) then {
("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutRsc [QGVAR(DisplayInformation),"PLAIN"];

View File

@ -1,61 +0,0 @@
/*
* Author: KoffeinFlummi, Glowbal
* Handle damage basic medical
*
* Arguments:
*
* Return Value:
* <nil>
*
* Public: No
*/
#include "script_component.hpp"
params ["_target"];
TRACE_1("ACE_DEBUG: HandleDamage_BASIC Called",_target);
private _damageBodyParts = _target getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]];
private _cache_params = _target getVariable [QGVAR(cachedHandleDamageParams), []];
private _cache_damages = _target getVariable QGVAR(cachedDamages);
TRACE_4("ACE_DEBUG: HandleDamage BASIC",_unit, _damageBodyParts,_cache_params,_cache_damages);
{
_x params ["_unit","_selectionName","_amountOfDamage","_sourceOfDamage","_typeOfProjectile","_typeOfDamage"];
TRACE_6("_x",_unit,_selectionName,_amountOfDamage,_sourceOfDamage,_typeOfProjectile,_typeOfDamage);
if !(isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) then {
_part = [_selectionName] call FUNC(selectionNameToNumber);
if (_part < 0) exitwith {};
private ["_newDamage", "_pain"];
_newDamage = (_cache_damages select _foreachIndex);
_damageBodyParts set [_part, (_damageBodyParts select _part) + _newDamage];
_unit setVariable [QGVAR(bodyPartStatus), _damageBodyParts];
if (alive _unit && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
// If it reaches this, we can assume that the hit did not kill this unit, as this function is called 3 frames after the damage has been passed.
if ([_unit, _part, if (_part > 1) then {_newDamage * 1.3} else {_newDamage * 2}] call FUNC(determineIfFatal)) then {
[_unit, true, 0.5+random(10)] call FUNC(setUnconscious);
};
};
_pain = _unit getVariable [QGVAR(pain), 0];
_pain = _pain + (_newDamage / 4) * (1 - (_unit getVariable [QGVAR(morphine), 0]));
_unit setVariable [QGVAR(pain), _pain min 1, true];
};
}foreach _cache_params;
// We broadcast the value across the net here, in order to avoid broadcasting it multiple times earlier in the above code block
_target setVariable [QGVAR(bodyPartStatus), _damageBodyParts, true];
TRACE_2("ACE_DEBUG: HandleDamage BASIC Broadcast value here",_unit, _target getVariable QGVAR(bodyPartStatus));
EXPLODE_6_PVT(_damageBodyParts,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL);
_target setHitPointDamage ["hitHead", _headDamage min 0.95];
_target setHitPointDamage ["hitBody", _torsoDamage min 0.95];
_target setHitPointDamage ["hitHands", (_handsDamageR + _handsDamageL) min 0.95];
_target setHitPointDamage ["hitLegs", (_legsDamageR + _legsDamageL) min 0.95];
{
private _hitPointName = [_target, _x, true] call FUNC(translateSelections);
_target setHitPointDamage [_hitPointName, (_damageBodyParts select _foreachIndex) min 0.95];
}foreach GVAR(SELECTIONS);

View File

@ -1,36 +0,0 @@
/*
* Author: Glowbal
* Adds a new injury to the wounds collection from remote clients. Is used to split up the large collection of injuries broadcasting across network.
*
* Arguments:
* 0: The remote unit <OBJECT>
* 1: injury <ARRAY>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_unit", "_injury", "_openWounds", "_injuryID", "_exists"];
params ["_unit", "_injury"];
if (!local _unit) then {
_openWounds = _unit getVariable[QGVAR(openWounds), []];
_injuryID = _injury select 0;
_exists = false;
{
if (_x select 0 == _injuryID) exitWith {
_exists = true;
_openWounds set [_forEachIndex, _injury];
};
} forEach _openWounds;
if (!_exists) then {
_openWounds pushBack _injury;
};
_unit setVariable [QGVAR(openWounds), _openWounds];
};

View File

@ -1,24 +0,0 @@
/*
* Author: Glowbal
* Handles an wound update request.
*
* Arguments:
* 0: The Unit <OBJECT>
* 1: Origin object <OBJECT>
*
* ReturnValue:
* None
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_unit", "_openWounds", "_originOfrequest"];
params ["_unit", "_originOfrequest"];
if (local _unit && !(local _originOfrequest)) then {
_openWounds = _unit getVariable [QGVAR(openWounds), []];
{
["ace_medical_propagateWound", [_unit, _x], [_originOfrequest]] call CBA_fnc_targetEvent;
} forEach _openWounds;
};

View File

@ -1,22 +0,0 @@
/*
* Author: Glowbal
* Ask for the latest wound information.
*
* Arguments:
* 0: The target <OBJECT>
* 1: object belonging to the caller <OBJECT>
*
* ReturnValue:
* None
*
* Public: Yes
*/
#include "script_component.hpp"
params [ "_target", "_caller"];
if (local _target || GVAR(level) < 2) exitWith {}; // if the target is local, we already got the most update to date information
if (_target getVariable [QGVAR(isWoundSynced), false]) exitWith {};
_target setVariable [QGVAR(isWoundSynced), true];
["ace_medical_woundUpdateRequest", [_target, _caller], [_target]] call CBA_fnc_targetEvent;

View File

@ -1,27 +0,0 @@
/*
* Author: KoffeinFlummi
* Callback when the bandaging treatment is complete
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
* 2: Selection Name <STRING>
* 3: Treatment classname <STRING>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#define BANDAGEHEAL 0.8
private ["_hitSelections", "_hitPoints", "_point", "_damage"];
params ["_caller", "_target", "_selection", "_className"];
if (local _target) then {
[QGVAR(treatmentBasic_bandageLocal), [_target, _selection]] call CBA_fnc_localEvent;
} else {
[QGVAR(treatmentBasic_bandageLocal), [_target, _selection], _target] call CBA_fnc_targetEvent;
};

View File

@ -1,51 +0,0 @@
/*
* Author: Glowbal
* Handles the bandage of a patient.
*
* Arguments:
* 0: The patient <OBJECT>
* 1: Treatment classname <STRING>
*
*
* Return Value:
* Succesful treatment started <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
#define BANDAGEHEAL 0.8
params ["_target", "_selectionName"];
private _damageBodyParts = _target getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]];
// Ensure it is a valid bodypart
private _part = [_selectionName] call FUNC(selectionNameToNumber);
if (_part < 0) exitwith {false};
if ((_damageBodyParts select _part) > 0) then {
private _damageOnPart = (_damageBodyParts select _part);
// Temp quick fix to change in behaviour of basic medical bandaging
if (_damageOnPart - BANDAGEHEAL > 0) then {
_damageOnPart = _damageOnPart - (_damageOnPart * BANDAGEHEAL);
} else {
_damageOnPart = _damageOnPart - BANDAGEHEAL;
};
_damageBodyParts set [_part, _damageOnPart max 0];
_target setVariable [QGVAR(bodyPartStatus), _damageBodyParts, true];
TRACE_2("ACE_DEBUG: Treatment BASIC Bandage Broadcast value here",_unit, _target getVariable QGVAR(bodyPartStatus));
};
EXPLODE_6_PVT(_damageBodyParts,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL);
_target setHitPointDamage ["hitHead", _headDamage min 0.95];
_target setHitPointDamage ["hitBody", _torsoDamage min 0.95];
_target setHitPointDamage ["hitHands", (_handsDamageR + _handsDamageL) min 0.95];
_target setHitPointDamage ["hitLegs", (_legsDamageR + _legsDamageL) min 0.95];
{
private _hitPointName = [_target, _x, true] call FUNC(translateSelections);
_target setHitPointDamage [_hitPointName, (_damageBodyParts select _foreachIndex) min 0.95];
}foreach GVAR(SELECTIONS);
true;