Fixed indentation

This commit is contained in:
Glowbal
2015-02-28 19:28:05 +01:00
parent 451f8b6d0b
commit d293008586
15 changed files with 119 additions and 119 deletions

View File

@ -24,9 +24,9 @@ if !(_unit getvariable[QGVAR(addedToUnitLoop),false]) then{
}; };
if ([_unit] call FUNC(hasMedicalEnabled)) then { if ([_unit] call FUNC(hasMedicalEnabled)) then {
[{ [{
private "_unit"; private "_unit";
_unit = (_this select 0) select 0; _unit = (_this select 0) select 0;
if (!alive _unit || !local _unit) then { if (!alive _unit || !local _unit) then {
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
} else { } else {
@ -41,5 +41,5 @@ if ([_unit] call FUNC(hasMedicalEnabled)) then {
[_unit] call FUNC(playInjuredSound); [_unit] call FUNC(playInjuredSound);
}; };
}; };
}, 1, [_unit]] call CBA_fnc_addPerFrameHandler; }, 1, [_unit]] call CBA_fnc_addPerFrameHandler;
}; };

View File

@ -24,7 +24,7 @@ _className = _this select 3;
_config = (ConfigFile >> "ACE_Medical_Treatments" >> "Basic" >> _className); _config = (ConfigFile >> "ACE_Medical_Treatments" >> "Basic" >> _className);
if (GVAR(level)>=1) then { if (GVAR(level)>=1) then {
_config = (ConfigFile >> "ACE_Medical_Treatments" >> "Advanced" >> _className); _config = (ConfigFile >> "ACE_Medical_Treatments" >> "Advanced" >> _className);
}; };
if !(isClass _config) exitwith {false}; if !(isClass _config) exitwith {false};
@ -40,9 +40,9 @@ if ("All" in _locations) exitwith {true};
_return = false; _return = false;
{ {
if (_x == "field") exitwith {_return = true;}; if (_x == "field") exitwith {_return = true;};
if (_x == "MedicalFacility" && {[_caller, _target] call FUNC(inMedicalFacility)}) exitwith {_return = true;}; if (_x == "MedicalFacility" && {[_caller, _target] call FUNC(inMedicalFacility)}) exitwith {_return = true;};
if (_x == "MedicalVehicle" && {[_caller, _target] call FUNC(inMedicalVehicle)}) exitwith {_return = true;}; if (_x == "MedicalVehicle" && {[_caller, _target] call FUNC(inMedicalVehicle)}) exitwith {_return = true;};
}foreach _locations; }foreach _locations;
_return; _return;

View File

@ -19,27 +19,27 @@ _totalBloodLoss = 0;
// Advanced medical bloodloss handling // Advanced medical bloodloss handling
if (GVAR(level) >= 1) then { if (GVAR(level) >= 1) then {
_tourniquets = _this getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; _tourniquets = _this getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]];
_openWounds = _this getvariable [QGVAR(openWounds), []]; _openWounds = _this getvariable [QGVAR(openWounds), []];
//_cardiacOutput = [_this] call FUNC(getCardiacOutput); //_cardiacOutput = [_this] call FUNC(getCardiacOutput);
{ {
if ((_tourniquets select (_x select 2)) < 1) then { if ((_tourniquets select (_x select 2)) < 1) then {
// total bleeding ratio * percentage of injury left // total bleeding ratio * percentage of injury left
_totalBloodLoss = _totalBloodLoss + ((_x select 4) * (_x select 3)); _totalBloodLoss = _totalBloodLoss + ((_x select 4) * (_x select 3));
// (((BLOODLOSS_SMALL_WOUNDS * (_x select 0))) + ((BLOODLOSS_MEDIUM_WOUNDS * (_x select 1))) + ((BLOODLOSS_LARGE_WOUNDS * (_x select 2))) * (_cardiacOutput / DEFAULT_CARDIAC_OUTPUT)); // (((BLOODLOSS_SMALL_WOUNDS * (_x select 0))) + ((BLOODLOSS_MEDIUM_WOUNDS * (_x select 1))) + ((BLOODLOSS_LARGE_WOUNDS * (_x select 2))) * (_cardiacOutput / DEFAULT_CARDIAC_OUTPUT));
}; };
}foreach _openWounds; }foreach _openWounds;
_internalWounds = _this getvariable [QGVAR(internalWounds), []]; _internalWounds = _this getvariable [QGVAR(internalWounds), []];
{ {
_totalBloodLoss = _totalBloodLoss + ((_x select 4) * (_x select 3)); _totalBloodLoss = _totalBloodLoss + ((_x select 4) * (_x select 3));
}foreach _internalWounds; }foreach _internalWounds;
// cap the blood loss to be no greater as the current cardiac output // cap the blood loss to be no greater as the current cardiac output
//(_totalBloodLoss min _cardiacOutput); //(_totalBloodLoss min _cardiacOutput);
} else { } else {
// TODO basic medical // TODO basic medical
}; };
_totalBloodLoss; _totalBloodLoss;

View File

@ -47,9 +47,9 @@ if (GVAR(level) == 0) then {
if (_damageReturn < 0.01) exitWith {0}; if (_damageReturn < 0.01) exitWith {0};
if (GVAR(level) >= 1) then { if (GVAR(level) >= 1) then {
[_unit, _selectionName, _damage, _source, _projectile, _damageReturn] call FUNC(handleDamage_caching); [_unit, _selectionName, _damage, _source, _projectile, _damageReturn] call FUNC(handleDamage_caching);
if (_damageReturn > 0.9) then { if (_damageReturn > 0.9) then {
_hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; _hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"];
_newDamage = _damage - (damage _unit); _newDamage = _damage - (damage _unit);
if (_selectionName in _hitSelections) then { if (_selectionName in _hitSelections) then {
@ -62,7 +62,7 @@ if (GVAR(level) >= 1) then {
} else { } else {
_damageReturn = 0.89; _damageReturn = 0.89;
}; };
}; };
}; };
if (_unit getVariable [QGVAR(preventDeath), false] && {_damageReturn >= 0.9} && {_selection in ["", "head", "body"]}) exitWith { if (_unit getVariable [QGVAR(preventDeath), false] && {_damageReturn >= 0.9} && {_selection in ["", "head", "body"]}) exitWith {

View File

@ -51,7 +51,7 @@ if (GVAR(enableInternalBleeding)) then {
}; };
if (alive _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then { if (alive _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then {
[_unit, _newDamage] call FUNC(reactionToDamage); [_unit, _newDamage] call FUNC(reactionToDamage);
}; };
_returnDamage; _returnDamage;

View File

@ -30,8 +30,8 @@ if (_bodyPartn != 0) exitwith {};
if (_amountOfDamage > 0.4) then { if (_amountOfDamage > 0.4) then {
if (random(1) >= 0.8) then { if (random(1) >= 0.8) then {
if !(_unit getvariable[QGVAR(airwayCollapsed), false]) then { if !(_unit getvariable[QGVAR(airwayCollapsed), false]) then {
_unit setvariable [QGVAR(airwayCollapsed), true, true]; _unit setvariable [QGVAR(airwayCollapsed), true, true];
}; };
}; };
}; };

View File

@ -22,13 +22,13 @@ _items = _this select 2;
_return = true; _return = true;
{ {
// //
if (typeName _x == "ARRAY" && {({[_medic, _patient, _x] call FUNC(hasItem)}count _x == 0)}) exitwith { if (typeName _x == "ARRAY" && {({[_medic, _patient, _x] call FUNC(hasItem)}count _x == 0)}) exitwith {
_return = false; _return = false;
}; };
if (typeName _x == "STRING" && {!([_medic, _patient, _x] call FUNC(hasItem))}) exitwith { if (typeName _x == "STRING" && {!([_medic, _patient, _x] call FUNC(hasItem))}) exitwith {
_return = false; _return = false;
}; };
}foreach _items; }foreach _items;
_return; _return;

View File

@ -71,6 +71,6 @@ _unit setVariable [QGVAR(allUsedMedication), []];
_logs = _unit getvariable [QGVAR(allLogs), []]; _logs = _unit getvariable [QGVAR(allLogs), []];
{ {
_unit setvariable [_x, nil, true]; _unit setvariable [_x, nil, true];
}foreach _logs; }foreach _logs;
_unit setvariable [QGVAR(allLogs), [], true]; _unit setvariable [QGVAR(allLogs), [], true];

View File

@ -24,9 +24,9 @@ if (isnil QGVAR(setting_advancedMedicRoles)) exitwith {
if (GVAR(setting_advancedMedicRoles)) then { if (GVAR(setting_advancedMedicRoles)) then {
_class = _unit getvariable [QGVAR(medicClass), 0]; _class = _unit getvariable [QGVAR(medicClass), 0];
if (_class >= _medicN) then { if (_class >= _medicN) then {
_return = true; _return = true;
}; };
} else { } else {
_return = true; _return = true;
}; };

View File

@ -20,54 +20,54 @@ _allTypes = ["stab", "grenade", "bullet", "explosive", "shell", "punch", "vehicl
_allFoundDamageTypes = []; _allFoundDamageTypes = [];
_configDamageTypes = (_injuryRouteConfig >> "damageTypes"); _configDamageTypes = (_injuryRouteConfig >> "damageTypes");
for "_i" from 0 to (count _configDamageTypes -1) /* step +1 */ do { for "_i" from 0 to (count _configDamageTypes -1) /* step +1 */ do {
if (isClass(_configDamageTypes select _i)) then { if (isClass(_configDamageTypes select _i)) then {
_allFoundDamageTypes pushback (configName (_configDamageTypes select _i)); _allFoundDamageTypes pushback (configName (_configDamageTypes select _i));
}; };
}; };
GVAR(allAvailableDamageTypes) = _allFoundDamageTypes; GVAR(allAvailableDamageTypes) = _allFoundDamageTypes;
_parseForSubClassWounds = { _parseForSubClassWounds = {
_subClass = _this select 0; _subClass = _this select 0;
if (isClass (_entry >> _subClass)) exitwith { if (isClass (_entry >> _subClass)) exitwith {
_subClassConfig = (_entry >> _subClass); _subClassConfig = (_entry >> _subClass);
_subClasstype = _classType + (configName _subClassConfig); _subClasstype = _classType + (configName _subClassConfig);
_subClassselections = if (isArray(_subClassConfig >> "selections")) then { getArray(_subClassConfig >> "selections");} else { _selections }; _subClassselections = if (isArray(_subClassConfig >> "selections")) then { getArray(_subClassConfig >> "selections");} else { _selections };
_subClassbloodLoss = if (isNumber(_subClassConfig >> "bleedingRate")) then { getNumber(_subClassConfig >> "bleedingRate");} else { _bloodLoss }; _subClassbloodLoss = if (isNumber(_subClassConfig >> "bleedingRate")) then { getNumber(_subClassConfig >> "bleedingRate");} else { _bloodLoss };
_subClasspain = if (isNumber(_subClassConfig >> "pain")) then { getNumber(_subClassConfig >> "pain");} else { _pain }; _subClasspain = if (isNumber(_subClassConfig >> "pain")) then { getNumber(_subClassConfig >> "pain");} else { _pain };
_subClassminDamage = if (isNumber(_subClassConfig >> "minDamage")) then { getNumber(_subClassConfig >> "minDamage");} else { _minDamage }; _subClassminDamage = if (isNumber(_subClassConfig >> "minDamage")) then { getNumber(_subClassConfig >> "minDamage");} else { _minDamage };
_subClasscauses = if (isArray(_subClassConfig >> "causes")) then { getArray(_subClassConfig >> "causes");} else { _causes }; _subClasscauses = if (isArray(_subClassConfig >> "causes")) then { getArray(_subClassConfig >> "causes");} else { _causes };
if (count _selections > 0 && count _causes > 0) then { if (count _selections > 0 && count _causes > 0) then {
_allWoundClasses pushback [_subClasstype, _subClassselections, _subClassbloodLoss, _subClasspain, _subClassminDamage, _subClasscauses]; _allWoundClasses pushback [_subClasstype, _subClassselections, _subClassbloodLoss, _subClasspain, _subClassminDamage, _subClasscauses];
}; };
true; true;
}; };
false; false;
}; };
// TODO classTypes are strings currently. Convert them to unqiue IDs instead. // TODO classTypes are strings currently. Convert them to unqiue IDs instead.
_woundsConfig = (_injuriesRootConfig >> "wounds"); _woundsConfig = (_injuriesRootConfig >> "wounds");
_allWoundClasses = []; _allWoundClasses = [];
if (isClass _woundsConfig) then { if (isClass _woundsConfig) then {
_amountOf = count _woundsConfig; _amountOf = count _woundsConfig;
for "_i" from 0 to (_amountOf -1) /* step +1 */ do { for "_i" from 0 to (_amountOf -1) /* step +1 */ do {
_entry = _woundsConfig select _i; _entry = _woundsConfig select _i;
if (isClass _entry) then { if (isClass _entry) then {
_classType = (ConfigName _entry); _classType = (ConfigName _entry);
_selections = if (isArray(_entry >> "selections")) then { getArray(_entry >> "selections");} else {[]}; _selections = if (isArray(_entry >> "selections")) then { getArray(_entry >> "selections");} else {[]};
_bloodLoss = if (isNumber(_entry >> "bleedingRate")) then { getNumber(_entry >> "bleedingRate");} else {0}; _bloodLoss = if (isNumber(_entry >> "bleedingRate")) then { getNumber(_entry >> "bleedingRate");} else {0};
_pain = if (isNumber(_entry >> "pain")) then { getNumber(_entry >> "pain");} else {0}; _pain = if (isNumber(_entry >> "pain")) then { getNumber(_entry >> "pain");} else {0};
_minDamage = if (isNumber(_entry >> "minDamage")) then { getNumber(_entry >> "minDamage");} else {0}; _minDamage = if (isNumber(_entry >> "minDamage")) then { getNumber(_entry >> "minDamage");} else {0};
_causes = if (isArray(_entry >> "causes")) then { getArray(_entry >> "causes");} else {[]}; _causes = if (isArray(_entry >> "causes")) then { getArray(_entry >> "causes");} else {[]};
if (["Minor"] call _parseForSubClassWounds || ["Medium"] call _parseForSubClassWounds || ["Large"] call _parseForSubClassWounds) exitwith {}; // continue to the next one if (["Minor"] call _parseForSubClassWounds || ["Medium"] call _parseForSubClassWounds || ["Large"] call _parseForSubClassWounds) exitwith {}; // continue to the next one
// There were no subclasses, so we will add this one instead. // There were no subclasses, so we will add this one instead.
if (count _selections > 0 && count _causes > 0) then { if (count _selections > 0 && count _causes > 0) then {
_allWoundClasses pushback [_classType, _selections, _bloodLoss, _pain, _minDamage, _causes]; _allWoundClasses pushback [_classType, _selections, _bloodLoss, _pain, _minDamage, _causes];
}; };
true; true;
}; };
}; };
}; };
GVAR(AllWoundInjuryTypes) = _allWoundClasses; GVAR(AllWoundInjuryTypes) = _allWoundClasses;
@ -76,20 +76,20 @@ _thresholds = getArray(_damageTypesConfig >> "thresholds");
_selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific"); _selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific");
{ {
_varName = format[QGVAR(woundInjuryType_%1),_x]; _varName = format[QGVAR(woundInjuryType_%1),_x];
_woundTypes = []; _woundTypes = [];
_type = _x; _type = _x;
{ {
// Check if this type is in the causes of a wound class, if so, we will store the wound types for this damage type // Check if this type is in the causes of a wound class, if so, we will store the wound types for this damage type
if (_type in (_x select 5)) then { if (_type in (_x select 5)) then {
_woundTypes pushback _x; _woundTypes pushback _x;
}; };
}foreach _allWoundClasses; }foreach _allWoundClasses;
_typeThresholds = _thresholds; _typeThresholds = _thresholds;
_selectionSpecificType = _selectionSpecific; _selectionSpecificType = _selectionSpecific;
if (isClass(_damageTypesConfig >> _x)) then { if (isClass(_damageTypesConfig >> _x)) then {
if (isArray(_damageTypesConfig >> _x >> "thresholds")) then { _typeThresholds = getArray(_damageTypesConfig >> _x >> "thresholds");}; if (isArray(_damageTypesConfig >> _x >> "thresholds")) then { _typeThresholds = getArray(_damageTypesConfig >> _x >> "thresholds");};
if (isNumber(_damageTypesConfig >> _x >> "selectionSpecific")) then { _selectionSpecificType = getNumber(_damageTypesConfig >> _x >> "selectionSpecific");}; if (isNumber(_damageTypesConfig >> _x >> "selectionSpecific")) then { _selectionSpecificType = getNumber(_damageTypesConfig >> _x >> "selectionSpecific");};
}; };
missionNamespace setvariable [_varName, [_typeThresholds, _selectionSpecificType > 0, _woundTypes]]; missionNamespace setvariable [_varName, [_typeThresholds, _selectionSpecificType > 0, _woundTypes]];
}foreach _allTypes; }foreach _allTypes;

View File

@ -29,13 +29,13 @@ if (count _items == 0) exitwith {};
if ([_caller, _target, _items] call FUNC(useItems)) then { if ([_caller, _target, _items] call FUNC(useItems)) then {
[[_target, _className], QUOTE(DFUNC(treatmentBandageLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [[_target, _className], QUOTE(DFUNC(treatmentBandageLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
{ {
if (_x != "") then { if (_x != "") then {
[_target, _x] call FUNC(addToTriageCard); [_target, _x] call FUNC(addToTriageCard);
}; };
}foreach _items; }foreach _items;
["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent;
[_target, "activity", "STR_ACE_HAS_BANDAGED_ACTIVITY", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); [_target, "activity", "STR_ACE_HAS_BANDAGED_ACTIVITY", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog);
}; };
true; true;

View File

@ -29,13 +29,13 @@ if (count _items == 0) exitwith {};
if ([_caller, _target, _items] call FUNC(useItems)) then { if ([_caller, _target, _items] call FUNC(useItems)) then {
[[_target, _className], QUOTE(DFUNC(treatmentMedicationLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [[_target, _className], QUOTE(DFUNC(treatmentMedicationLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
{ {
if (_x != "") then { if (_x != "") then {
[_target, _x] call FUNC(addToTriageCard); [_target, _x] call FUNC(addToTriageCard);
}; };
}foreach _items; }foreach _items;
["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent;
[_target, "activity", "STR_ACE_HAS_MEDICATION_ACTIVITY", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); [_target, "activity", "STR_ACE_HAS_MEDICATION_ACTIVITY", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog);
}; };
true; true;

View File

@ -31,5 +31,5 @@ if ([_caller, _target, _items] call FUNC(useItems)) then {
[[_target, _removeItem], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [[_target, _removeItem], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent;
[_target, _removeItem] call FUNC(addToTriageCard); [_target, _removeItem] call FUNC(addToTriageCard);
[_target, "activity", "STR_ACE_HAS_GIVEN_IV_ACTIVITY", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); [_target, "activity", "STR_ACE_HAS_GIVEN_IV_ACTIVITY", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog);
}; };

View File

@ -44,7 +44,7 @@ if ([_caller, _target, _items] call FUNC(useItems)) then {
[[_target, _removeItem], QUOTE(DFUNC(treatmentTourniquetLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [[_target, _removeItem], QUOTE(DFUNC(treatmentTourniquetLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent;
[_target, _removeItem] call FUNC(addToTriageCard); [_target, _removeItem] call FUNC(addToTriageCard);
[_target, "activity", "STR_ACE_HAS_APPLIED_TOURNIQUET_ACTIVITY", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); [_target, "activity", "STR_ACE_HAS_APPLIED_TOURNIQUET_ACTIVITY", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog);
}; };
true; true;

View File

@ -21,15 +21,15 @@ _patient = _this select 1;
_items = _this select 2; _items = _this select 2;
{ {
// handle a one of type use item // handle a one of type use item
if (typeName _x == "ARRAY") then { if (typeName _x == "ARRAY") then {
{ {
if ([_medic, _patient, _x] call FUNC(useItem)) exitwith {}; if ([_medic, _patient, _x] call FUNC(useItem)) exitwith {};
}foreach _x; }foreach _x;
}; };
// handle required item // handle required item
if (typeName _x == "STRING") then { if (typeName _x == "STRING") then {
[_medic, _patient, _x] call FUNC(useItem); [_medic, _patient, _x] call FUNC(useItem);
}; };
}foreach _items; }foreach _items;