mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
fix treatment functionality
This commit is contained in:
parent
b74245c323
commit
27314c34b1
@ -214,7 +214,7 @@ class ACE_Medical_Injuries {
|
||||
class fractures {
|
||||
class Femur {
|
||||
name = CSTRING(Wounds_Femur);
|
||||
selections[] = {"Head", "Torso"};
|
||||
selections[] = {"Head", "Body"};
|
||||
pain = 0.2;
|
||||
causes[] = {"Bullet", "VehicleCrash", "Backblast", "Explosive", "Shell", "Grenade"};
|
||||
minDamage = 0.5;
|
||||
|
@ -7,9 +7,9 @@ ADDON = false;
|
||||
[QEGVAR(medical_engine,woundReceived), {
|
||||
params ["_unit", "_woundedHitPoint", "_receivedDamage", "", "_ammo"];
|
||||
|
||||
private _selectionName = EGVAR(medical,SELECTIONS) param [EGVAR(medical,HITPOINTS) find _woundedHitPoint]; // @todo
|
||||
// private _selectionName = EGVAR(medical,SELECTIONS) select (EGVAR(medical,HITPOINTS) find _woundedHitPoint); // @todo
|
||||
private _typeOfDamage = _ammo call FUNC(getTypeOfDamage);
|
||||
[_unit, _selectionName, _receivedDamage, _ammo, _typeOfDamage] call FUNC(woundsHandler); // TODO also support the sqf variant
|
||||
[_unit, _woundedHitPoint, _receivedDamage, _ammo, _typeOfDamage] call FUNC(woundsHandler); // TODO also support the sqf variant
|
||||
|
||||
[_unit, EGVAR(medical,STATE_MACHINE)] call EFUNC(medical,addStateHandler);
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
@ -20,6 +20,8 @@
|
||||
params ["_unit", "_selectionName", "_damage", "_typeOfProjectile", "_typeOfDamage"];
|
||||
TRACE_6("ACE_DEBUG: woundshandler",_unit, _selectionName, _damage, _shooter, _typeOfProjectile,_typeOfDamage);
|
||||
|
||||
systemChat format["input: %1", _this];
|
||||
|
||||
if (_typeOfDamage == "") then {_typeOfDamage = "unknown";};
|
||||
|
||||
// Administration for open wounds and ids
|
||||
|
@ -21,8 +21,9 @@ private ["_bodyPartn", "_injuryTypeInfo", "_allInjuriesForDamageType", "_allPoss
|
||||
params ["_unit", "_selectionName", "_damage", "_typeOfProjectile", "_typeOfDamage"];
|
||||
TRACE_6("ACE_DEBUG: HandleDamage_WoundsOLD Called",_unit, _selectionName, _damage, _shooter, _typeOfProjectile,_typeOfDamage);
|
||||
|
||||
systemChat format["input: %1", _this];
|
||||
// Convert the selectionName to a number and ensure it is a valid selection.
|
||||
_bodyPartn = [_selectionName] call EFUNC(medical,selectionNameToNumber);
|
||||
_bodyPartn = EGVAR(medical,HITPOINTS) find _selectionName; //[_selectionName] call EFUNC(medical,selectionNameToNumber);
|
||||
if (_bodyPartn < 0) exitWith {};
|
||||
|
||||
if (_typeOfDamage == "") then {_typeOfDamage = "unknown";};
|
||||
|
@ -60,7 +60,7 @@ _damaged = [false, false, false, false, false, false];
|
||||
_selectionBloodLoss = [0, 0, 0, 0, 0, 0];
|
||||
|
||||
_allInjuryTexts = [];
|
||||
if ((EGVAR(medical,level) >= 2) ) then { // && {([_target] call EFUNC(medical,hasMedicalEnabled))}
|
||||
if (EGVAR(medical,level) >= 2) then { // && {([_target] call EFUNC(medical,hasMedicalEnabled))}
|
||||
_openWounds = _target getVariable [QEGVAR(medical,openWounds), []];
|
||||
private "_amountOf";
|
||||
{
|
||||
|
@ -12,7 +12,7 @@
|
||||
* Can Treat <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [player, cursorTarget, "Head", "SurgicalKit"] call ace_medical_fnc_canTreat
|
||||
* [player, cursorTarget, "Head", "SurgicalKit"] call ace_medical_treatment_fnc_canTreat
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
@ -23,7 +23,7 @@ params ["_caller", "_target", "_selectionName", "_className"];
|
||||
|
||||
if !(_target isKindOf "CAManBase") exitWith { false };
|
||||
|
||||
private _config = (ConfigFile >> "ACE_Medical_Treatment" >> (["Basic", "Advanced"] select (GVAR(level)>=2)) >> _className);
|
||||
private _config = (configFile >> "ACE_Medical_Treatment_Actions" >> (["Basic", "Advanced"] select (EGVAR(medical,level)>=2)) >> _className);
|
||||
|
||||
if !(isClass _config) exitwith {false};
|
||||
|
||||
@ -35,10 +35,11 @@ private _medicRequired = if (isNumber (_config >> "requiredMedic")) then {
|
||||
} else {
|
||||
// Check for required class
|
||||
if (isText (_config >> "requiredMedic")) exitwith {
|
||||
missionNamespace getVariable [(getText (_config >> "requiredMedic")), 0]
|
||||
missionNamespace getVariable [getText (_config >> "requiredMedic"), 0];
|
||||
};
|
||||
0;
|
||||
};
|
||||
|
||||
if !([_caller, _medicRequired] call EFUNC(medical,isMedic)) exitwith { false };
|
||||
|
||||
private _items = getArray (_config >> "items");
|
||||
@ -61,7 +62,9 @@ if (getText (_config >> "condition") != "") then {
|
||||
_return = [_caller, _target, _selectionName, _className] call _condition;
|
||||
};
|
||||
};
|
||||
if (!_return) exitwith { false };
|
||||
if (!_return) exitwith {
|
||||
false;
|
||||
};
|
||||
|
||||
private _patientStateCondition = if (isText(_config >> "patientStateCondition")) then {
|
||||
missionNamespace getVariable [getText(_config >> "patientStateCondition"), 0]
|
||||
|
@ -17,7 +17,7 @@ params ["_unit"];
|
||||
|
||||
while {({_x == "FirstAidKit"} count items _unit) > 0} do {
|
||||
_unit removeItem "FirstAidKit";
|
||||
if (GVAR(level) >= 2) then {
|
||||
if (EGVAR(medical,level) >= 2) then {
|
||||
_unit addItem "ACE_fieldDressing";
|
||||
_unit addItem "ACE_packingBandage";
|
||||
_unit addItem "ACE_morphine";
|
||||
@ -31,7 +31,7 @@ while {({_x == "FirstAidKit"} count items _unit) > 0} do {
|
||||
|
||||
while {({_x == "Medikit"} count items _unit) > 0} do {
|
||||
_unit removeItem "Medikit";
|
||||
if (GVAR(level) >= 2) then {
|
||||
if (EGVAR(medical,level) >= 2) then {
|
||||
_unit addItemToBackpack "ACE_fieldDressing";
|
||||
_unit addItemToBackpack "ACE_packingBandage";
|
||||
_unit addItemToBackpack "ACE_packingBandage";
|
||||
|
@ -25,9 +25,9 @@ if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exit
|
||||
|
||||
if !(_target isKindOf "CAManBase") exitWith {false};
|
||||
|
||||
private _config = (configFile >> "ACE_Medical_Treatment" >> "Basic" >> _className);
|
||||
if (GVAR(level) >= 2) then {
|
||||
_config = (configFile >> "ACE_Medical_Treatment" >> "Advanced" >> _className);
|
||||
private _config = (configFile >> "ACE_Medical_Treatment_Actions" >> "Basic" >> _className);
|
||||
if (EGVAR(medical,level) >= 2) then {
|
||||
_config = (configFile >> "ACE_Medical_Treatment_Actions" >> "Advanced" >> _className);
|
||||
};
|
||||
|
||||
if !(isClass _config) exitwith {false};
|
||||
|
@ -57,9 +57,9 @@ if ((_weaponSelect params [["_previousWeapon", ""]]) && {(_previousWeapon != "")
|
||||
} forEach _usersOfItems;
|
||||
|
||||
// Record specific callback
|
||||
private _config = (configFile >> "ACE_Medical_Treatment" >> "Basic" >> _className);
|
||||
if (GVAR(level) >= 2) then {
|
||||
_config = (configFile >> "ACE_Medical_Treatment" >> "Advanced" >> _className);
|
||||
private _config = (configFile >> "ACE_Medical_Treatment_Actions" >> "Basic" >> _className);
|
||||
if (EGVAR(medical,level) >= 2) then {
|
||||
_config = (configFile >> "ACE_Medical_Treatment_Actions" >> "Advanced" >> _className);
|
||||
};
|
||||
|
||||
private _callback = getText (_config >> "callbackFailure");
|
||||
|
@ -52,9 +52,9 @@ if ((_weaponSelect params [["_previousWeapon", ""]]) && {(_previousWeapon != "")
|
||||
};
|
||||
|
||||
// Record specific callback
|
||||
private _config = (configFile >> "ACE_Medical_Treatment" >> "Basic" >> _className);
|
||||
if (GVAR(level) >= 2) then {
|
||||
_config = (configFile >> "ACE_Medical_Treatment" >> "Advanced" >> _className);
|
||||
private _config = (configFile >> "ACE_Medical_Treatment_Actions" >> "Basic" >> _className);
|
||||
if (EGVAR(medical,level) >= 2) then {
|
||||
_config = (configFile >> "ACE_Medical_Treatment_Actions" >> "Advanced" >> _className);
|
||||
};
|
||||
|
||||
private _callback = getText (_config >> "callbackSuccess");
|
||||
|
Loading…
Reference in New Issue
Block a user