Merge pull request #3013 from acemod/bloodyLitter

Fix litter for adv - Add bloody p3d for Pack/qClot
This commit is contained in:
PabstMirror 2015-12-14 19:23:51 -06:00
commit 886c13f6a9
3 changed files with 45 additions and 15 deletions

View File

@ -27,7 +27,10 @@ class ACE_Medical_Actions {
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic";
animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
litter[] = { {"All", "_previousDamage > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, {"All", "_previousDamage <= 0", {"ACE_MedicalLitter_clean"}} };
litter[] = {
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
};
};
class Morphine: Bandage {
displayName = CSTRING(Inject_Morphine);
@ -163,12 +166,19 @@ class ACE_Medical_Actions {
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic";
animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
litter[] = { {"All", "_previousDamage > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, {"All", "_previousDamage <= 0", {"ACE_MedicalLitter_clean"}} };
litter[] = {
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
};
};
class PackingBandage: fieldDressing {
displayName = CSTRING(Actions_PackingBandage);
items[] = {"ACE_packingBandage"};
litter[] = { {"All", "", {"ACE_MedicalLitter_packingBandage"}}};
litter[] = {
{"All", "", {"ACE_MedicalLitter_packingBandage"}},
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
};
};
class ElasticBandage: fieldDressing {
displayName = CSTRING(Actions_ElasticBandage);
@ -177,7 +187,11 @@ class ACE_Medical_Actions {
class QuikClot: fieldDressing {
displayName = CSTRING(Actions_QuikClot);
items[] = {"ACE_quikclot"};
litter[] = { {"All", "", {"ACE_MedicalLitter_QuickClot"}}};
litter[] = {
{"All", "", {"ACE_MedicalLitter_QuickClot"}},
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
};
};
class Tourniquet: fieldDressing {
displayName = CSTRING(Apply_Tourniquet);
@ -296,9 +310,9 @@ class ACE_Medical_Actions {
animationCallerSelf = "";
animationCallerSelfProne = "";
litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"}},
{"All", "_previousDamage > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}} },
{"All", "_previousDamage > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_previousDamage <= 0", {"ACE_MedicalLitter_clean"}}
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
};
};
class CheckPulse: fieldDressing {

View File

@ -9,7 +9,7 @@
* 3: The treatment classname <STRING>
* 4: ?
* 5: Users of Items <?>
* 6: Previous Damage <NUMBER>
* 6: Blood Loss on selection (previously called _previousDamage) <NUMBER>
*
* Return Value:
* None
@ -22,7 +22,10 @@
#define MIN_ENTRIES_LITTER_CONFIG 3
private ["_config", "_litter", "_createLitter", "_position", "_createdLitter"];
params ["_caller", "_target", "_selectionName", "_className", "", "_usersOfItems", "_previousDamage"];
params ["_caller", "_target", "_selectionName", "_className", "", "_usersOfItems", "_bloodLossOnSelection"];
//Ensures comptibilty with other possible medical treatment configs
private _previousDamage = _bloodLossOnSelection;
if !(GVAR(allowLitterCreation)) exitwith {};
if (vehicle _caller != _caller || vehicle _target != _target) exitwith {};
@ -72,7 +75,7 @@ _createdLitter = [];
_litterCondition = missionNamespace getvariable _litterCondition;
if (!(_litterCondition isEqualType {})) then {_litterCondition = {false}};
};
if !([_caller, _target, _selectionName, _className, _usersOfItems, _previousDamage] call _litterCondition) exitwith {};
if !([_caller, _target, _selectionName, _className, _usersOfItems, _bloodLossOnSelection] call _litterCondition) exitwith {};
if (_litterOptions isEqualType []) then {
// Loop through through the litter options and place the litter

View File

@ -65,15 +65,28 @@ if (isNil _callback) then {
_callback = missionNamespace getvariable _callback;
};
//Get current damage before treatment (for litter)
_previousDamage = if (_selectionName in GVAR(SELECTIONS)) then {
_target getHitPointDamage ([_target, _selectionName, true] call FUNC(translateSelections));
//Get current blood loose on limb (for "bloody" litter)
private _bloodLossOnSelection = 0;
private _partNumber = ([_selectionName] call FUNC(selectionNameToNumber)) max 0;
if ((GVAR(level) >= 2) && {([_target] call FUNC(hasMedicalEnabled))}) then {
//Advanced Medical - Add all bleeding from wounds on selection
private _openWounds = _target getvariable [QGVAR(openWounds), []];
{
_x params ["", "", "_selectionX", "_amountOf", "_bleedingRatio"];
if (_selectionX == _partNumber) then {
_bloodLossOnSelection = _bloodLossOnSelection + (_amountOf * _bleedingRatio);
};
} forEach _openWounds;
TRACE_1("advanced",_bloodLossOnSelection);
} else {
damage _target;
//Basic Medical (just use blodyPartStatus):
private _damageBodyParts = _target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]];
_bloodLossOnSelection = _damageBodyParts select _partNumber
TRACE_1("basic",_bloodLossOnSelection);
};
_args call _callback;
_args pushBack _previousDamage;
_args pushBack _bloodLossOnSelection;
_args call FUNC(createLitter);
//If we're not already tracking vitals, start: