2015-03-10 21:01:46 +00:00
|
|
|
/*
|
|
|
|
* Author: gpgpgpgp, edited by commy2, PabstMirror
|
|
|
|
* Starts cutting down a fence
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: Fence <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Nothing
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player, berlinWall] call ace_logistics_wirecutter_fnc_cutDownFence
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-28 04:42:45 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-04-15 23:32:47 +00:00
|
|
|
#define SOUND_CLIP_TIME_SPACEING 1.5
|
2015-04-18 03:40:37 +00:00
|
|
|
private ["_timeToCut", "_progressCheck"];
|
2015-01-28 04:42:45 +00:00
|
|
|
|
2015-03-10 21:01:46 +00:00
|
|
|
PARAMS_2(_unit,_fenceObject);
|
|
|
|
if (_unit != ACE_player) exitWith {};
|
2015-01-28 04:42:45 +00:00
|
|
|
|
2015-04-15 23:32:47 +00:00
|
|
|
_timeToCut = if ([ACE_player] call EFUNC(common,isEngineer)) then {7.5} else {11};
|
2015-01-28 04:42:45 +00:00
|
|
|
|
|
|
|
[ACE_player, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation);
|
|
|
|
|
2015-04-15 23:32:47 +00:00
|
|
|
_progressCheck = {
|
|
|
|
PARAMS_2(_args,_passedTime);
|
|
|
|
EXPLODE_2_PVT(_args,_fenceObject,_lastSoundEffectTime);
|
|
|
|
if (_passedTime > (_lastSoundEffectTime + SOUND_CLIP_TIME_SPACEING)) then {
|
|
|
|
// playSound "ACE_wirecutter_sound";
|
2015-04-16 03:27:12 +00:00
|
|
|
playSound3D [QUOTE(PATHTO_R(sound\wirecut.ogg)), objNull, false, (getPosASL ACE_player), 3, 1, 10];
|
2015-04-15 23:32:47 +00:00
|
|
|
_args set [1, _passedTime];
|
|
|
|
};
|
|
|
|
|
|
|
|
((!isNull _fenceObject) && {(damage _fenceObject) < 1} && {("ACE_wirecutter" in (items ACE_player))})
|
2015-01-28 04:42:45 +00:00
|
|
|
};
|
|
|
|
|
2015-05-28 19:59:04 +00:00
|
|
|
[_timeToCut, [_fenceObject,0], {(_this select 0) call FUNC(cutDownFenceCallback)}, {(_this select 0) call FUNC(cutDownFenceAbort)}, localize LSTRING(CuttingFence), _progressCheck] call EFUNC(common,progressBar);
|