mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
#1807 - Clean bandages if no damage on hitpoint
This commit is contained in:
parent
ce1256b75f
commit
6ab72e905c
@ -25,7 +25,7 @@ class ACE_Medical_Actions {
|
||||
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
|
||||
animationCallerSelf = "AinvPknlMstpSlayW[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 {
|
||||
displayName = CSTRING(Inject_Morphine);
|
||||
@ -121,7 +121,7 @@ class ACE_Medical_Actions {
|
||||
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
|
||||
animationCallerSelf = "AinvPknlMstpSlayW[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 {
|
||||
items[] = {"ACE_packingBandage"};
|
||||
|
@ -717,6 +717,9 @@ class CfgVehicles {
|
||||
destrType = "DestructNo";
|
||||
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 {
|
||||
model = QUOTE(PATHTOF(data\littergeneric_bandages1.p3d));
|
||||
};
|
||||
|
BIN
addons/medical/data/ace_litterclean_co.paa
Normal file
BIN
addons/medical/data/ace_litterclean_co.paa
Normal file
Binary file not shown.
BIN
addons/medical/data/littergeneric_clean.p3d
Normal file
BIN
addons/medical/data/littergeneric_clean.p3d
Normal file
Binary file not shown.
@ -16,12 +16,13 @@
|
||||
|
||||
#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;
|
||||
_target = _this select 1;
|
||||
_selectionName = _this select 2;
|
||||
_className = _this select 3;
|
||||
_usersOfItems = _this select 5;
|
||||
_previousDamage = _this select 6;
|
||||
|
||||
if !(GVAR(allowLitterCreation)) exitwith {};
|
||||
if (vehicle _caller != _caller || vehicle _target != _target) exitwith {};
|
||||
@ -76,7 +77,7 @@ _createdLitter = [];
|
||||
_litterCondition = missionNamespace getvariable _litterCondition;
|
||||
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 {
|
||||
// Loop through through the litter options and place the litter
|
||||
|
@ -62,8 +62,19 @@ if (isNil _callback) then {
|
||||
_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);
|
||||
|
||||
//If we're not already tracking vitals, start:
|
||||
|
Loading…
Reference in New Issue
Block a user