mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Missing privates. Lazy evaluation.
This commit is contained in:
parent
934339d1df
commit
89927a8b94
@ -33,7 +33,7 @@ private _classID = 0;
|
||||
private _causes = GET_ARRAY(_entry >> "causes",[]);
|
||||
private _causeLimping = GET_NUMBER(_entry >> "causeLimping",0);
|
||||
|
||||
if (count _causes > 0) then {
|
||||
if !(_causes isEqualTo []) then {
|
||||
GVAR(woundClassNames) pushBack _className;
|
||||
GVAR(woundsData) pushBack [_classID, _selections, _bleeding, _pain, [_minDamage, _maxDamage], _causes, _className, _causeLimping];
|
||||
_classID = _classID + 1;
|
||||
|
@ -96,14 +96,14 @@ private _woundsCreated = [];
|
||||
_bodyPartVisParams set [[1,2,3,3,4,4] select _bodyPartNToAdd, true]; // Mark the body part index needs updating
|
||||
|
||||
// Create a new injury. Format [ID, classID, bodypart, percentage treated, bleeding rate]
|
||||
_injury = [_woundID, _woundClassIDToAdd, _bodyPartNToAdd, 1, _injuryBleedingRate];
|
||||
private _injury = [_woundID, _woundClassIDToAdd, _bodyPartNToAdd, 1, _injuryBleedingRate];
|
||||
|
||||
// The higher the nastiness likelihood the higher the change to get a painful and bloody wound
|
||||
private _nastinessLikelihood = linearConversion [0, 20, (_woundDamage / _thresholdWoundCount), 0.5, 30, true];
|
||||
private _bleedingModifier = 0.25 + 8 * exp ((random [-4.5, -5, -6]) / _nastinessLikelihood);
|
||||
private _painModifier = 0.05 + 2 * exp (-2 / _nastinessLikelihood);
|
||||
|
||||
_bleeding = _injuryBleedingRate * _bleedingModifier;
|
||||
private _bleeding = _injuryBleedingRate * _bleedingModifier;
|
||||
private _pain = _injuryPain * _painModifier;
|
||||
_painLevel = _painLevel + _pain;
|
||||
|
||||
|
@ -32,7 +32,7 @@ if (_hitPoint isEqualTo "") then {
|
||||
};
|
||||
|
||||
// Damage can be disabled with old variable or via sqf command allowDamage
|
||||
if !(isDamageAllowed _unit && _unit getVariable [QEGVAR(medical,allowDamage), true]) exitWith {_oldDamage};
|
||||
if !(isDamageAllowed _unit && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) exitWith {_oldDamage};
|
||||
|
||||
// Damages are stored for "ace_hdbracket" event triggered last
|
||||
private _newDamage = _damage - _oldDamage;
|
||||
|
@ -25,7 +25,7 @@ private _options = ["triage" , "examine", "bandage", "medication", "airway", "ad
|
||||
|
||||
for "_idc" from START_IDC to END_IDC step 1 do {
|
||||
private _amount = [ACE_player, GVAR(INTERACTION_TARGET), _options select (_idc - START_IDC)] call FUNC(getTreatmentOptions);
|
||||
if ((count _amount) > 0 || _idc == START_IDC || _idc == END_IDC) then {
|
||||
if (!(_amount isEqualTo []) || {_idc == START_IDC} || {_idc == END_IDC}) then {
|
||||
(_display displayCtrl _idc) ctrlSettextColor [1, 1, 1, 1];
|
||||
} else {
|
||||
(_display displayCtrl _idc) ctrlSettextColor [0.4, 0.4, 0.4, 1];
|
||||
|
@ -18,7 +18,7 @@ params ["_caller", "_target", "_bodyPart"];
|
||||
|
||||
private _heartRate = 0;
|
||||
|
||||
if (alive _target && !([_target, _bodyPart] call FUNC(hasTourniquetAppliedTo))) then {
|
||||
if (alive _target && {!([_target, _bodyPart] call FUNC(hasTourniquetAppliedTo))}) then {
|
||||
_heartRate = GET_HEART_RATE(_target);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user