formatting

This commit is contained in:
Glowbal 2015-04-07 19:56:54 +02:00
parent 3d82cb8eac
commit 526e24f133
13 changed files with 80 additions and 83 deletions

View File

@ -17,7 +17,7 @@ private "_caller";
_caller = _this select 0;
if (!isnil QGVAR(DROP_ADDACTION)) then {
[_caller,objNull] call EFUNC(common,carryObj);
_caller removeAction GVAR(DROP_ADDACTION);
[_caller,objNull] call EFUNC(common,carryObj);
_caller removeAction GVAR(DROP_ADDACTION);
GVAR(DROP_ADDACTION) = nil;
};

View File

@ -26,7 +26,6 @@ _tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]];
// Check if there is a tourniquet on this bodypart
if ((_tourniquets select _part) == 0) exitwith {
// TODO localization
_output = "There is no tourniquet on this body part!";
["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent);
};
@ -37,5 +36,3 @@ _target setvariable [QGVAR(tourniquets), _tourniquets, true];
// Adding the tourniquet item to the caller
_caller addItem "ACE_tourniquet";
// "AinvPknlMstpSlayWrflDnon_medic

View File

@ -67,9 +67,9 @@ _newUnit selectWeapon (primaryWeapon _newUnit);
// We are attaching the old unit and hiding it, so we can keep the original unit until later.
_oldBody attachTo [_newUnit, [0,0,0]];
if (isMultiplayer) then {
hideObjectGlobal _oldBody;
hideObjectGlobal _oldBody;
} else {
hideObject _oldBody;
hideObject _oldBody;
};
_newUnit setvariable [QGVAR(copyOfUnit), _oldBody, true];

View File

@ -22,11 +22,11 @@ if (isnil "_display") exitwith {};
_pos = [0,0,0,0];
if (_show) then {
_pos = ctrlPosition (_display displayCtrl 2001);
_pos = ctrlPosition (_display displayCtrl 2001);
};
for "_idc" from 2002 to 2006 step 1 do {
_pos set [1, (_pos select 1) + (_pos select 3)];
_ctrl = (_display displayCtrl _idc);
_ctrl ctrlSetPosition _pos;
_ctrl ctrlCommit 0;
_pos set [1, (_pos select 1) + (_pos select 3)];
_ctrl = (_display displayCtrl _idc);
_ctrl ctrlSetPosition _pos;
_ctrl ctrlCommit 0;
};

View File

@ -38,81 +38,81 @@ _reopeningMaxDelay = 200;
_config = (ConfigFile >> "ACE_Medical_Advanced" >> "Treatment" >> "Bandaging");
if (isClass (_config >> _bandage)) then {
_config = (_config >> _bandage);
_reopeningChance = getNumber (_config >> "reopeningChance");
_reopeningMinDelay = getNumber (_config >> "reopeningMinDelay");
_reopeningMaxDelay = getNumber (_config >> "reopeningMaxDelay") max _reopeningMinDelay;
_reopeningChance = getNumber (_config >> "reopeningChance");
_reopeningMinDelay = getNumber (_config >> "reopeningMinDelay");
_reopeningMaxDelay = getNumber (_config >> "reopeningMaxDelay") max _reopeningMinDelay;
};
if (isClass (_config >> _className)) then {
_woundTreatmentConfig = (_config >> _className);
if (isNumber (_woundTreatmentConfig >> "reopeningChance")) then {
_reopeningChance = getNumber (_woundTreatmentConfig >> "reopeningChance");
};
_reopeningChance = getNumber (_woundTreatmentConfig >> "reopeningChance");
};
if (isNumber (_woundTreatmentConfig >> "reopeningMinDelay")) then {
_reopeningMinDelay = getNumber (_woundTreatmentConfig >> "reopeningMinDelay");
};
_reopeningMinDelay = getNumber (_woundTreatmentConfig >> "reopeningMinDelay");
};
if (isNumber (_woundTreatmentConfig >> "reopeningMaxDelay")) then {
_reopeningMaxDelay = getNumber (_woundTreatmentConfig >> "reopeningMaxDelay") max _reopeningMinDelay;
};
_reopeningMaxDelay = getNumber (_woundTreatmentConfig >> "reopeningMaxDelay") max _reopeningMinDelay;
};
};
_bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []];
_exist = false;
_injuryId = _injury select 0;
{
if ((_x select 0) == _injuryId) exitwith {
_exist = true;
_existingInjury = _x;
_existingInjury set [3, (_existingInjury select 3) + _impact];
_bandagedWounds set [_foreachIndex, _existingInjury];
};
if ((_x select 0) == _injuryId) exitwith {
_exist = true;
_existingInjury = _x;
_existingInjury set [3, (_existingInjury select 3) + _impact];
_bandagedWounds set [_foreachIndex, _existingInjury];
};
}foreach _bandagedWounds;
if !(_exist) then {
// [ID, classID, bodypart, percentage treated, bloodloss rate]
_bandagedWounds pushback [_injuryId, _injury select 1, _injury select 2, _impact, _injury select 4];
// [ID, classID, bodypart, percentage treated, bloodloss rate]
_bandagedWounds pushback [_injuryId, _injury select 1, _injury select 2, _impact, _injury select 4];
};
_target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true];
// Check if we are ever going to reopen this
if (random(1) <= _reopeningChance) then {
_delay = _reopeningMinDelay + random(_reopeningMaxDelay - _reopeningMinDelay);
[{
private ["_target", "_impact", "_part", "_injuryIndex", "_bandage", "_injury", "_openWounds", "_selectedInjury","_bandagedWounds","_exist"];
_target = _this select 0;
_impact = _this select 1;
_part = _this select 2;
_injuryIndex = _this select 3;
_injury = _this select 4;
_delay = _reopeningMinDelay + random(_reopeningMaxDelay - _reopeningMinDelay);
[{
private ["_target", "_impact", "_part", "_injuryIndex", "_bandage", "_injury", "_openWounds", "_selectedInjury","_bandagedWounds","_exist"];
_target = _this select 0;
_impact = _this select 1;
_part = _this select 2;
_injuryIndex = _this select 3;
_injury = _this select 4;
if (alive _target) then {
_openWounds = _target getvariable [QGVAR(openWounds), []];
if ((count _openWounds)-1 < _injuryIndex) exitwith {};
_selectedInjury = _openWounds select _injuryIndex;
if (_selectedInjury select 0 == _injury select 0) then { // matching the IDs
_selectedInjury set [3, (_selectedInjury select 3) + _impact];
_openWounds set [_injuryIndex, _selectedInjury];
_target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC];
if (USE_WOUND_EVENT_SYNC) then {
["medical_propagateWound", [_target, _selectedInjury]] call EFUNC(common,globalEvent);
};
_bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []];
_exist = false;
_injuryId = _injury select 0;
{
if ((_x select 0) == _injuryId) exitwith {
_exist = true;
_existingInjury = _x;
_existingInjury set [3, ((_existingInjury select 3) - _impact) max 0];
_bandagedWounds set [_foreachIndex, _existingInjury];
};
}foreach _bandagedWounds;
if (alive _target) then {
_openWounds = _target getvariable [QGVAR(openWounds), []];
if ((count _openWounds)-1 < _injuryIndex) exitwith {};
_selectedInjury = _openWounds select _injuryIndex;
if (_selectedInjury select 0 == _injury select 0) then { // matching the IDs
_selectedInjury set [3, (_selectedInjury select 3) + _impact];
_openWounds set [_injuryIndex, _selectedInjury];
_target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC];
if (USE_WOUND_EVENT_SYNC) then {
["medical_propagateWound", [_target, _selectedInjury]] call EFUNC(common,globalEvent);
};
_bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []];
_exist = false;
_injuryId = _injury select 0;
{
if ((_x select 0) == _injuryId) exitwith {
_exist = true;
_existingInjury = _x;
_existingInjury set [3, ((_existingInjury select 3) - _impact) max 0];
_bandagedWounds set [_foreachIndex, _existingInjury];
};
}foreach _bandagedWounds;
if (_exist) then {
_target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true];
};
};
// Otherwise something went wrong, we we don't reopen them..
};
}, [_target, _impact, _part, _injuryIndex, _injury], _delay, 0] call EFUNC(common,waitAndExecute);
if (_exist) then {
_target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true];
};
};
// Otherwise something went wrong, we we don't reopen them..
};
}, [_target, _impact, _part, _injuryIndex, _injury], _delay, 0] call EFUNC(common,waitAndExecute);
};

View File

@ -24,9 +24,9 @@ if (GVAR(level) >= 2) then {
_unit setvariable [QGVAR(airwayStatus), 0];
if (USE_WOUND_EVENT_SYNC) then {
_openWounds = _unit getvariable [QGVAR(openWounds), []];
{
["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent);
}foreach _openWounds;
};
_openWounds = _unit getvariable [QGVAR(openWounds), []];
{
["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent);
}foreach _openWounds;
};
};

View File

@ -33,7 +33,7 @@ if (_carrying >= 0) then {
_target setvariable [QGVAR(hasCopy), nil, true];
};
_caller setvariable [QGVAR(isCarrying), -1, true];
_caller setvariable [QGVAR(isCarrying), -1, true];
if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then {
_caller removeWeapon "ACE_FakePrimaryWeapon";
};

View File

@ -20,8 +20,8 @@ _lastId = _this select 1;
_originOfrequest = _this select 2;
if (local _unit) then {
_openWounds = _unit getvariable [QGVAR(openWounds), []];
{
["medical_propagateWound", [_originOfrequest], [_unit, _x]] call EFUNC(common,targetEvent);
}foreach _openWounds;
_openWounds = _unit getvariable [QGVAR(openWounds), []];
{
["medical_propagateWound", [_originOfrequest], [_unit, _x]] call EFUNC(common,targetEvent);
}foreach _openWounds;
};

View File

@ -27,7 +27,7 @@ _items = _this select 4;
_specificSpot = if (count _this > 6) then {_this select 6} else {-1};
if !([_target] call FUNC(hasMedicalEnabled)) exitwith {
_this call FUNC(treatmentBasic_bandage);
_this call FUNC(treatmentBasic_bandage);
};
[[_target, _className, _selectionName, _specificSpot], QUOTE(DFUNC(treatmentAdvanced_bandageLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */

View File

@ -24,5 +24,5 @@ _className = _this select 3;
[_target, false] call FUNC(setUnconscious);
if (_target getvariable [QGVAR(inReviveState), false]) then {
_target setvariable [QGVAR(inReviveState), nil, true];
_target setvariable [QGVAR(inReviveState), nil, true];
};

View File

@ -37,6 +37,6 @@ _varName = format["ACE_Medical_IVVolume_%1",_typeOf];
_target setvariable [_varName, (_target getvariable [_varName, 0]) + _volumeAdded, true];
if !(_varName in GVAR(IVBags)) then {
GVAR(IVBags) pushback _varName;
publicVariable QGVAR(IVBags);
GVAR(IVBags) pushback _varName;
publicVariable QGVAR(IVBags);
};

View File

@ -30,12 +30,12 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then {
_caller removeWeapon "ACE_FakePrimaryWeapon";
};
if (vehicle _caller == _caller) then {
[_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation);
[_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation);
};
_caller setvariable [QGVAR(treatmentPrevAnimCaller), nil];
{
(_x select 0) addItem (_x select 1);
(_x select 0) addItem (_x select 1);
}foreach _usersOfItems;
// Record specific callback

View File

@ -28,7 +28,7 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then {
_caller removeWeapon "ACE_FakePrimaryWeapon";
};
if (vehicle _caller == _caller) then {
[_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation);
[_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation);
};
_caller setvariable [QGVAR(treatmentPrevAnimCaller), nil];