Changed: Dragging/carrying now works for units with broken legs

Added unload and load of unconscious units
This commit is contained in:
Glowbal 2015-04-09 21:23:10 +02:00
parent 0926397ab4
commit 093d340ee7
7 changed files with 782 additions and 830 deletions

View File

@ -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)}

View File

@ -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)}

View File

@ -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

View File

@ -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));
};
};
};
};
};

View File

@ -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 {

View File

@ -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>