#1807 - Clean bandages if no damage on hitpoint

This commit is contained in:
PabstMirror 2015-08-05 17:32:00 -05:00
parent ce1256b75f
commit 6ab72e905c
6 changed files with 20 additions and 5 deletions

View File

@ -25,7 +25,7 @@ class ACE_Medical_Actions {
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic"; animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic";
animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
litter[] = { {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} }; litter[] = { {"All", "_previousDamage > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, {"All", "_previousDamage <= 0", {"ACE_MedicalLitter_clean"}} };
}; };
class Morphine: Bandage { class Morphine: Bandage {
displayName = CSTRING(Inject_Morphine); displayName = CSTRING(Inject_Morphine);
@ -121,7 +121,7 @@ class ACE_Medical_Actions {
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic"; animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic";
animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
litter[] = { {"All", "", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} }; litter[] = { {"All", "_previousDamage > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, {"All", "_previousDamage <= 0", {"ACE_MedicalLitter_clean"}} };
}; };
class PackingBandage: fieldDressing { class PackingBandage: fieldDressing {
items[] = {"ACE_packingBandage"}; items[] = {"ACE_packingBandage"};

View File

@ -717,6 +717,9 @@ class CfgVehicles {
destrType = "DestructNo"; destrType = "DestructNo";
model = QUOTE(PATHTOF(data\littergeneric.p3d)); model = QUOTE(PATHTOF(data\littergeneric.p3d));
}; };
class ACE_MedicalLitter_clean: ACE_MedicalLitterBase {
model = QUOTE(PATHTOF(data\littergeneric_clean.p3d));
};
class ACE_MedicalLitter_bandage1: ACE_MedicalLitterBase { class ACE_MedicalLitter_bandage1: ACE_MedicalLitterBase {
model = QUOTE(PATHTOF(data\littergeneric_bandages1.p3d)); model = QUOTE(PATHTOF(data\littergeneric_bandages1.p3d));
}; };

Binary file not shown.

Binary file not shown.

View File

@ -16,12 +16,13 @@
#define MIN_ENTRIES_LITTER_CONFIG 3 #define MIN_ENTRIES_LITTER_CONFIG 3
private ["_target", "_className", "_config", "_litter", "_createLitter", "_position", "_createdLitter", "_caller", "_selectionName", "_usersOfItems"]; private ["_target", "_className", "_config", "_litter", "_createLitter", "_position", "_createdLitter", "_caller", "_selectionName", "_usersOfItems", "_previousDamage"];
_caller = _this select 0; _caller = _this select 0;
_target = _this select 1; _target = _this select 1;
_selectionName = _this select 2; _selectionName = _this select 2;
_className = _this select 3; _className = _this select 3;
_usersOfItems = _this select 5; _usersOfItems = _this select 5;
_previousDamage = _this select 6;
if !(GVAR(allowLitterCreation)) exitwith {}; if !(GVAR(allowLitterCreation)) exitwith {};
if (vehicle _caller != _caller || vehicle _target != _target) exitwith {}; if (vehicle _caller != _caller || vehicle _target != _target) exitwith {};
@ -76,7 +77,7 @@ _createdLitter = [];
_litterCondition = missionNamespace getvariable _litterCondition; _litterCondition = missionNamespace getvariable _litterCondition;
if (typeName _litterCondition != "CODE") then {_litterCondition = {false}}; if (typeName _litterCondition != "CODE") then {_litterCondition = {false}};
}; };
if !([_caller, _target, _selectionName, _className, _usersOfItems] call _litterCondition) exitwith {}; if !([_caller, _target, _selectionName, _className, _usersOfItems, _previousDamage] call _litterCondition) exitwith {};
if (typeName _litterOptions == "ARRAY") then { if (typeName _litterOptions == "ARRAY") then {
// Loop through through the litter options and place the litter // Loop through through the litter options and place the litter

View File

@ -62,8 +62,19 @@ if (isNil _callback) then {
_callback = missionNamespace getvariable _callback; _callback = missionNamespace getvariable _callback;
}; };
_args call _callback; //Get current damage before treatment (for litter)
_previousDamage = switch (toLower _selectionName) do {
case ("head"): {_target getHitPointDamage "HitHead"};
case ("body"): {_target getHitPointDamage "HitBody"};
case ("hand_l"): {_target getHitPointDamage "HitLeftArm"};
case ("hand_r"): {_target getHitPointDamage "HitRightArm"};
case ("leg_l"): {_target getHitPointDamage "HitLeftLeg"};
case ("leg_r"): {_target getHitPointDamage "HitRightLeg"};
default {damage _target};
};
_args call _callback;
_args pushBack _previousDamage;
_args call FUNC(createLitter); _args call FUNC(createLitter);
//If we're not already tracking vitals, start: //If we're not already tracking vitals, start: