mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Removed deprecated carry functions
This commit is contained in:
parent
2d265ec6c2
commit
39cbf21278
@ -11,8 +11,6 @@ PREP(actionPlaceInBodyBag);
|
||||
PREP(actionRemoveTourniquet);
|
||||
PREP(actionLoadUnit);
|
||||
PREP(actionUnloadUnit);
|
||||
PREP(actionCarryUnit);
|
||||
PREP(actionDropUnit);
|
||||
PREP(addHeartRateAdjustment);
|
||||
PREP(addToInjuredCollection);
|
||||
PREP(addToLog);
|
||||
@ -22,7 +20,6 @@ PREP(addUnloadPatientActions);
|
||||
PREP(canAccessMedicalEquipment);
|
||||
PREP(canTreat);
|
||||
PREP(canTreatCached);
|
||||
PREP(canCarry);
|
||||
PREP(createLitter);
|
||||
PREP(determineIfFatal);
|
||||
PREP(getBloodLoss);
|
||||
@ -61,7 +58,6 @@ PREP(itemCheck);
|
||||
PREP(onMedicationUsage);
|
||||
PREP(onWoundUpdateRequest);
|
||||
PREP(onPropagateWound);
|
||||
PREP(onCarryObjectDropped);
|
||||
PREP(parseConfigForInjuries);
|
||||
PREP(playInjuredSound);
|
||||
PREP(selectionNameToNumber);
|
||||
|
@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* makes the calling unit start carrying the specified unit
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The caller <OBJECT>
|
||||
* 1: The target <OBJECT>
|
||||
* 2: Carry object. True is carry, false is dragging <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_caller", "_target", "_positionUnit", "_carry"];
|
||||
_caller = _this select 0;
|
||||
_target = _this select 1;
|
||||
_carry = _this select 2;
|
||||
|
||||
if (!(_target isKindOf "CaManBase") || !(_caller isKindOf "CaManBase")) exitwith{ };
|
||||
if (vehicle _caller != _caller || vehicle _target != _target) exitwith {};
|
||||
if (!([_caller] call EFUNC(common,canInteract)) || {_caller == _target} || {(([_target] call EFUNC(common,isAwake)))}) exitwith {};
|
||||
|
||||
if (!alive _target) exitwith {
|
||||
if (GVAR(allowDeadBodyMovement)) then {
|
||||
[{
|
||||
_this call FUNC(actionCarryUnit);
|
||||
}, [_caller, ([_target,_caller] call FUNC(copyDeadBody)), _carry], 0.25, 0.25] call EFUNC(common,waitAndExecute);
|
||||
};
|
||||
};
|
||||
|
||||
if !([_caller,_target] call EFUNC(common,carryObj)) exitwith {};
|
||||
|
||||
if (primaryWeapon _caller == "") then {
|
||||
_caller addWeapon "ACE_FakePrimaryWeapon";
|
||||
};
|
||||
if (currentWeapon _caller != (primaryWeapon _caller)) then {
|
||||
_caller selectWeapon (primaryWeapon _caller);
|
||||
};
|
||||
|
||||
if (_carry) then {
|
||||
_target attachTo [_caller, [0.1, -0.1, -1.25], "LeftShoulder"];
|
||||
[_target, "AinjPfalMstpSnonWnonDf_carried_dead", 2, true] call EFUNC(common,doAnimation);
|
||||
[_caller, "acinpercmstpsraswrfldnon", 1] call EFUNC(common,doAnimation);
|
||||
} else {
|
||||
_target attachTo [_caller, [0.125, 1.007, 0]];
|
||||
_target setDir (getDir _target + 180) % 360;
|
||||
_target setPos ((getPos _target) vectorAdd ((vectorDir _caller) vectorMultiply 1.5));
|
||||
[_caller, "AcinPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation);
|
||||
[_target, "AinjPpneMstpSnonWrflDb", 2, true] call EFUNC(common,doAnimation);
|
||||
};
|
||||
|
||||
[
|
||||
2,
|
||||
[_caller, _target, _carry],
|
||||
{
|
||||
private ["_caller","_target", "_carry", "_args"];
|
||||
_args = _this select 0;
|
||||
_caller = _args select 0;
|
||||
_target = _args select 1;
|
||||
_carry = _args select 2;
|
||||
|
||||
_target setvariable [QGVAR(beingCarried), _caller, true];
|
||||
_caller setvariable [QGVAR(carrying), _target, true];
|
||||
_caller setvariable [QGVAR(isCarrying), if (_carry) then {1} else {0}, true];
|
||||
|
||||
// Removing any old drop scroll wheel actions
|
||||
// TODO Do we still want scroll wheel actions?
|
||||
if (!isnil QGVAR(DROP_ADDACTION)) then {
|
||||
_caller removeAction GVAR(DROP_ADDACTION);
|
||||
GVAR(DROP_ADDACTION) = nil;
|
||||
};
|
||||
// Adding the drop scroll wheel action.
|
||||
GVAR(DROP_ADDACTION) = _caller addAction [format["Drop %1",[_target] call EFUNC(common,getName)], {[_this select 1, _this select 2] call FUNC(actionDropUnit);}];
|
||||
|
||||
[_target, true] call EFUNC(common,disableAI);
|
||||
},
|
||||
{
|
||||
[(_this select 0), objNull,[0, 0, 0]] call EFUNC(common,carryObj);
|
||||
// TODO reset animations..
|
||||
},
|
||||
if (_carry) then {localize "STR_ACE_MEDICAL_ACTION_CARRY"} else {localize "STR_ACE_MEDICAL_ACTION_DRAG"},
|
||||
{true}
|
||||
] call EFUNC(common,progressBar);
|
@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Drop a unit if the caller nit is currently dragging or carrying a unit
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The caller <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_caller";
|
||||
_caller = _this select 0;
|
||||
|
||||
if (!isnil QGVAR(DROP_ADDACTION)) then {
|
||||
[_caller,objNull] call EFUNC(common,carryObj);
|
||||
_caller removeAction GVAR(DROP_ADDACTION);
|
||||
GVAR(DROP_ADDACTION) = nil;
|
||||
};
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Check if caller can carry or drag the target
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The caller <OBJECT>
|
||||
* 1: The target <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_caller", "_target", "_positionUnit", "_carry"];
|
||||
_caller = _this select 0;
|
||||
_target = _this select 1;
|
||||
|
||||
if (!(_target isKindOf "CaManBase") || !(_caller isKindOf "CaManBase")) exitwith{false};
|
||||
|
||||
if (vehicle _caller != _caller || vehicle _target != _target) exitwith {false};
|
||||
|
||||
if (!([_caller] call EFUNC(common,canInteract)) || {_caller == _target} || {(([_target] call EFUNC(common,isAwake)))}) exitwith {false};
|
||||
|
||||
if (!alive _target) exitwith {GVAR(allowDeadBodyMovement)};
|
||||
|
||||
((isNull ([_caller] call FUNC(getCarriedObj))) && {isNull ([_target] call FUNC(getCarriedObj))} && {isNull ([_caller] call FUNC(getCarriedBy))} && {isNull ([_target] call FUNC(getCarriedBy))})
|
@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Called on event CarryObjectDropped
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The caller <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit","_params"];
|
||||
_caller = _this select 0;
|
||||
_target = _caller getvariable [QGVAR(carrying), objNull];
|
||||
_carrying = _caller getvariable [QGVAR(isCarrying), -1];
|
||||
|
||||
if (_carrying >= 0) then {
|
||||
if !(isNull (_target getvariable [QGVAR(copyOfUnit), objNull])) then {
|
||||
_copy = _target;
|
||||
_target = _copy getvariable [QGVAR(copyOfUnit), objNull];
|
||||
if (isMultiplayer) then {
|
||||
_target hideObjectGlobal false;
|
||||
} else {
|
||||
_target hideObject false;
|
||||
};
|
||||
detach _copy;
|
||||
deleteVehicle _copy;
|
||||
_target setvariable [QGVAR(disableInteraction), nil, true];
|
||||
_target setvariable [QGVAR(hasCopy), nil, true];
|
||||
};
|
||||
|
||||
_caller setvariable [QGVAR(isCarrying), -1, true];
|
||||
if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then {
|
||||
_caller removeWeapon "ACE_FakePrimaryWeapon";
|
||||
};
|
||||
|
||||
[_target, false] call EFUNC(common,disableAI);
|
||||
_caller setvariable[QGVAR(onStartMovingUnitParams), nil];
|
||||
|
||||
// handle the drag & carry administration
|
||||
if (_carrying == 0) then {
|
||||
_target setvariable [QGVAR(beingDragged), nil, true];
|
||||
_caller setvariable [QGVAR(dragging), nil, true];
|
||||
} else {
|
||||
_target setvariable [QGVAR(beingCarried), nil, true];
|
||||
_caller setvariable [QGVAR(carrying), nil, true];
|
||||
};
|
||||
|
||||
// handle the drag & carry animiations
|
||||
if ([_caller] call EFUNC(common,isAwake) && (vehicle _caller == _caller)) then {
|
||||
[_caller,"amovpercmstpsraswrfldnon_amovpknlmstpslowwrfldnon", 1] call EFUNC(common,doAnimation);
|
||||
};
|
||||
|
||||
if (vehicle _target == _target) then {
|
||||
if (_carrying == 0) then {
|
||||
[_target,"AinjPpneMstpSnonWrflDb_release", 2, true] call EFUNC(common,doAnimation);
|
||||
} else {
|
||||
[_target,"AinjPfalMstpSnonWrflDnon_carried_Down", 2, true] call EFUNC(common,doAnimation);
|
||||
};
|
||||
} else {
|
||||
if ([_target] call EFUNC(common,isAwake)) then {
|
||||
[_target,"", 2] call EFUNC(common,doAnimation); // TODO play animation for the current seat instead
|
||||
} else {
|
||||
// this might not work properly
|
||||
[_target,([_target] call EFUNC(common,getDeathAnim)), 1] call EFUNC(common,doAnimation);
|
||||
};
|
||||
};
|
||||
|
||||
// Ensure that the unit does not get dropped through the floor of a building
|
||||
if (!surfaceIsWater getPos _caller) then {
|
||||
[{
|
||||
EXPLODE_3_PVT(_this,_caller,_target,_killOnDrop);
|
||||
if (vehicle _target == _target && (vehicle _caller == _caller)) then {
|
||||
// This will set the target body/unit on the correct position, so it doesn't fall through floors.
|
||||
_positionUnit = getPosATL _target;
|
||||
_positionUnit set [2, (getPosATL _caller) select 2];
|
||||
_target setPosATL _positionUnit;
|
||||
};
|
||||
}, [_caller,_target], 0.5, 0.5] call EFUNC(common,waitAndExecute);
|
||||
};
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user