mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Changed: Dragging/carrying now works for units with broken legs
Added unload and load of unconscious units
This commit is contained in:
parent
0926397ab4
commit
093d340ee7
@ -22,4 +22,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
// a static weapon has to be empty for dragging
|
||||
if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false};
|
||||
|
||||
alive _target && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false])}
|
||||
alive _target && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || ((_target getHitPointDamage "HitLeftLeg") + (_target getHitPointDamage "HitRightLeg") > 0.4)}
|
||||
|
@ -22,4 +22,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
// a static weapon has to be empty for dragging
|
||||
if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false};
|
||||
|
||||
alive _target && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false])}
|
||||
alive _target && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || ((_target getHitPointDamage "HitLeftLeg") + (_target getHitPointDamage "HitRightLeg") > 0.4)}
|
||||
|
@ -9,6 +9,8 @@ _isUnconscious = _this select 1;
|
||||
private "_player";
|
||||
_player = ACE_player;
|
||||
|
||||
if ((_unit getHitPointDamage "HitLeftLeg") + (_unit getHitPointDamage "HitRightLeg") > 0.4) exitwith {};
|
||||
|
||||
if (_player getVariable [QGVAR(isDragging), false]) then {
|
||||
|
||||
private "_draggedObject";
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -444,6 +444,26 @@ class CfgVehicles {
|
||||
#define EXCEPTIONS exceptions[] = {"isNotInside"};
|
||||
#include "ACE_Medical_Actions.hpp"
|
||||
};
|
||||
class GVAR(loadPatient) {
|
||||
displayName = "$STR_ACE_Medical_LoadPatient";
|
||||
distance = 5;
|
||||
condition = QUOTE(_target getvariable[ARR_2(QUOTE(QUOTE(ACE_isUnconscious)),false)] && vehicle _target == _target);
|
||||
statement = QUOTE([ARR_2(_player, _target)] call DFUNC(actionLoadUnit));
|
||||
showDisabled = 0;
|
||||
priority = 2;
|
||||
icon = PATHTOF(UI\icons\medical_cross.paa);
|
||||
exceptions[] = {"isNotDragging", "isNotCarrying"};
|
||||
};
|
||||
class GVAR(UnLoadPatient) {
|
||||
displayName = "$STR_ACE_Medical_UnloadPatient";
|
||||
distance = 5;
|
||||
condition = QUOTE(_target getvariable[ARR_2(QUOTE(QUOTE(ACE_isUnconscious)),false)] && vehicle _target != _target);
|
||||
statement = QUOTE([ARR_2(_player, _target)] call DFUNC(actionUnloadUnit));
|
||||
showDisabled = 0;
|
||||
priority = 2;
|
||||
icon = PATHTOF(UI\icons\medical_cross.paa);
|
||||
exceptions[] = {"isNotDragging", "isNotCarrying"};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -972,84 +992,4 @@ class CfgVehicles {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// Patient unload from vehicle actions
|
||||
class LandVehicle;
|
||||
class Car: LandVehicle {
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
class ACE_UnloadPatients {
|
||||
displayName = "$STR_ACE_Medical_UnloadPatient";
|
||||
condition = "true";
|
||||
statement = "";
|
||||
insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions));
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
class Tank: LandVehicle {
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
class ACE_UnloadPatients {
|
||||
displayName = "$STR_ACE_Medical_UnloadPatient";
|
||||
condition = "true";
|
||||
statement = "";
|
||||
insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions));
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Air;
|
||||
class Helicopter: Air {
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
class ACE_UnloadPatients {
|
||||
displayName = "$STR_ACE_Medical_UnloadPatient";
|
||||
condition = "true";
|
||||
statement = "";
|
||||
insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions));
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
class Plane: Air {
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
class ACE_UnloadPatients {
|
||||
displayName = "$STR_ACE_Medical_UnloadPatient";
|
||||
condition = "true";
|
||||
statement = "";
|
||||
insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions));
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Ship;
|
||||
class Ship_F: Ship {
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
class ACE_UnloadPatients {
|
||||
displayName = "$STR_ACE_Medical_UnloadPatient";
|
||||
condition = "true";
|
||||
statement = "";
|
||||
insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions));
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class StaticWeapon: LandVehicle {
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
class ACE_UnloadPatients {
|
||||
displayName = "$STR_ACE_Medical_UnloadPatient";
|
||||
condition = "true";
|
||||
statement = "";
|
||||
insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions));
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -22,6 +22,12 @@ if ([_target] call EFUNC(common,isAwake)) exitwith {
|
||||
// TODO localization
|
||||
["displayTextStructured", [_caller], [["This person (%1) is awake and cannot be loaded", [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent);
|
||||
};
|
||||
if ([_target] call FUNC(isBeingCarried)) then {
|
||||
[_caller, _target] call FUNC(dropObject_carry);
|
||||
};
|
||||
if ([_target] call FUNC(isBeingDragged)) then {
|
||||
[_caller, _target] call FUNC(dropObject);
|
||||
};
|
||||
|
||||
_vehicle = [_caller, _target] call EFUNC(common,loadPerson);
|
||||
if (!isNull _vehicle) then {
|
||||
|
@ -876,6 +876,9 @@
|
||||
<Key ID="STR_ACE_Medical_UnloadPatient">
|
||||
<English>Unload patient</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Medical_LoadPatient">
|
||||
<English>Load patient</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_MEDICAL_PlaceInBodyBag">
|
||||
<English>Place body in bodybag</English>
|
||||
</Key>
|
||||
|
Loading…
Reference in New Issue
Block a user