mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Medical Treatment - Scale bandage time based on amount of wound treated (#7049)
* Medical Treatment - Scale bandage time based on amount of wound treated * ignore basic bandage? * add debug trace
This commit is contained in:
parent
f99980d55f
commit
d52fedf39f
@ -21,7 +21,7 @@
|
|||||||
params ["_medic", "_patient", "_bodypart", "_bandage"];
|
params ["_medic", "_patient", "_bodypart", "_bandage"];
|
||||||
|
|
||||||
private _partIndex = ALL_BODY_PARTS find toLower _bodyPart;
|
private _partIndex = ALL_BODY_PARTS find toLower _bodyPart;
|
||||||
if (_partIndex < 0) exitWith { 0 };
|
if (_partIndex < 0) exitWith { ERROR_1("invalid partIndex - %1",_this); 0 };
|
||||||
|
|
||||||
private _targetWound = [_patient, _bandage, _partIndex] call FUNC(findMostEffectiveWound);
|
private _targetWound = [_patient, _bandage, _partIndex] call FUNC(findMostEffectiveWound);
|
||||||
_targetWound params ["_wound", "_woundIndex", "_effectiveness"];
|
_targetWound params ["_wound", "_woundIndex", "_effectiveness"];
|
||||||
@ -34,11 +34,12 @@ _wound params ["_classID", "", "_amountOf", "_bloodloss", "_damage"];
|
|||||||
private _category = (_classID % 10);
|
private _category = (_classID % 10);
|
||||||
|
|
||||||
// Base bandage time is based on wound size and remaining percentage
|
// Base bandage time is based on wound size and remaining percentage
|
||||||
private _bandageTime = ([
|
private _bandageTime = [BANDAGE_TIME_S, BANDAGE_TIME_M, BANDAGE_TIME_L] select _category;
|
||||||
BANDAGE_TIME_S,
|
|
||||||
BANDAGE_TIME_M,
|
// Scale bandage time based on amount left and effectiveness (less time if only a little wound left)
|
||||||
BANDAGE_TIME_L
|
if (GVAR(advancedBandages)) then { // basicBandage will have a very high effectiveness and can be ignored
|
||||||
] select _category) * _amountOf;
|
_bandageTime = _bandageTime * (linearConversion [0, _effectiveness, _amountOf, 0.666, 1, true]);
|
||||||
|
};
|
||||||
|
|
||||||
// Medics are more practised at applying bandages
|
// Medics are more practised at applying bandages
|
||||||
if ([_medic] call FUNC(isMedic)) then {
|
if ([_medic] call FUNC(isMedic)) then {
|
||||||
@ -50,5 +51,6 @@ if (_medic == _patient) then {
|
|||||||
_bandageTime = _bandageTime + BANDAGE_TIME_MOD_SELF;
|
_bandageTime = _bandageTime + BANDAGE_TIME_MOD_SELF;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
TRACE_1("",_bandageTime);
|
||||||
// Nobody can bandage instantly
|
// Nobody can bandage instantly
|
||||||
_bandageTime max 2
|
_bandageTime max 2.25
|
||||||
|
Loading…
Reference in New Issue
Block a user