mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Wirecutter - better sound effects, cleanup
This commit is contained in:
parent
59ae4623ff
commit
23f47f97ae
@ -1,4 +1,3 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
|
@ -1,12 +1,7 @@
|
||||
class CfgSounds {
|
||||
class ACE_Wirecutter_sound {
|
||||
name = "ACE_wirecutter_sound";
|
||||
sound[] = {QUOTE(PATHTOF(sound\wire_cut.ogg)), "db-0", 1};
|
||||
titles[] = {};
|
||||
};
|
||||
class ACE_Wirecutter_sound_long {
|
||||
name = "ACE_wirecutter_sound_long";
|
||||
sound[] = {QUOTE(PATHTOF(sound\wire_cut_long.ogg)), "db-0", 1};
|
||||
titles[] = {};
|
||||
};
|
||||
class ACE_Wirecutter_sound {
|
||||
name = "ACE_wirecutter_sound";
|
||||
sound[] = {QUOTE(PATHTOF(sound\wirecut.ogg)), "db-0", 1};
|
||||
titles[] = {};
|
||||
};
|
||||
};
|
||||
|
@ -1,16 +1,16 @@
|
||||
class CfgWeapons {
|
||||
class InventoryItem_Base_F;
|
||||
class ACE_ItemCore;
|
||||
class InventoryItem_Base_F;
|
||||
class ACE_ItemCore;
|
||||
|
||||
class ACE_wirecutter: ACE_ItemCore {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
displayName = "$STR_ACE_logistics_wirecutter_wirecutterName";
|
||||
descriptionShort = "$STR_ACE_logistics_wirecutter_wirecutterDescription";
|
||||
model = "\A3\weapons_F\ammo\mag_univ.p3d";
|
||||
picture = QUOTE(PATHTOF(ui\item_wirecutter_ca.paa));
|
||||
scope = 2;
|
||||
class ItemInfo: InventoryItem_Base_F {
|
||||
mass = 100;
|
||||
class ACE_wirecutter: ACE_ItemCore {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
displayName = "$STR_ACE_logistics_wirecutter_wirecutterName";
|
||||
descriptionShort = "$STR_ACE_logistics_wirecutter_wirecutterDescription";
|
||||
model = "\A3\weapons_F\ammo\mag_univ.p3d";
|
||||
picture = QUOTE(PATHTOF(ui\item_wirecutter_ca.paa));
|
||||
scope = 2;
|
||||
class ItemInfo: InventoryItem_Base_F {
|
||||
mass = 100;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -3,7 +3,7 @@
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
weapons[] = {"ACE_wirecutter"};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_interaction"};
|
||||
author[] = {"gpgpgpgp", "PabstMirror"};
|
||||
|
@ -16,19 +16,26 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define SOUND_CLIP_TIME_SPACEING 1.5
|
||||
private ["_timeToCut"];
|
||||
|
||||
PARAMS_2(_unit,_fenceObject);
|
||||
if (_unit != ACE_player) exitWith {};
|
||||
|
||||
_timeToCut = if ([ACE_player] call EFUNC(common,isEngineer)) then {5} else {10};
|
||||
_timeToCut = if ([ACE_player] call EFUNC(common,isEngineer)) then {7.5} else {11};
|
||||
|
||||
[ACE_player, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation);
|
||||
|
||||
if (_timeToCut > 5) then {
|
||||
playSound "ACE_wirecutter_sound_long";
|
||||
} else {
|
||||
playSound "ACE_wirecutter_sound";
|
||||
_progressCheck = {
|
||||
PARAMS_2(_args,_passedTime);
|
||||
EXPLODE_2_PVT(_args,_fenceObject,_lastSoundEffectTime);
|
||||
if (_passedTime > (_lastSoundEffectTime + SOUND_CLIP_TIME_SPACEING)) then {
|
||||
// playSound "ACE_wirecutter_sound";
|
||||
playSound3D [QUOTE(PATHTO_R(sound\wirecut.ogg)), objNull, false, (getPosASL ACE_player), 1, 1, 10];
|
||||
_args set [1, _passedTime];
|
||||
};
|
||||
|
||||
((!isNull _fenceObject) && {(damage _fenceObject) < 1} && {("ACE_wirecutter" in (items ACE_player))})
|
||||
};
|
||||
|
||||
[_timeToCut, [_fenceObject], {(_this select 0) call FUNC(cutDownFenceCallback)}, {(_this select 0) call FUNC(cutDownFenceAbort)}, localize "STR_ACE_logistics_wirecutter_CuttingFence"] call EFUNC(common,progressBar);
|
||||
[_timeToCut, [_fenceObject,0], {(_this select 0) call FUNC(cutDownFenceCallback)}, {(_this select 0) call FUNC(cutDownFenceAbort)}, localize "STR_ACE_logistics_wirecutter_CuttingFence", _progressCheck] call EFUNC(common,progressBar);
|
||||
|
@ -20,9 +20,9 @@ PARAMS_1(_unit);
|
||||
|
||||
_nearestFence = objNull;
|
||||
{
|
||||
if ((isNull _nearestFence) && {[_x] call FUNC(isFence)}) then {
|
||||
_nearestFence = _x;
|
||||
};
|
||||
if ((isNull _nearestFence) && {[_x] call FUNC(isFence)}) then {
|
||||
_nearestFence = _x;
|
||||
};
|
||||
} forEach nearestObjects [_unit, [], 15];
|
||||
|
||||
_nearestFence
|
||||
|
@ -35,7 +35,7 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {};
|
||||
} else {
|
||||
// Prevent Rare Error when ending mission with interact key down:
|
||||
if (isNull ace_player) exitWith {};
|
||||
|
||||
|
||||
//If player moved >5 meters from last pos, then rescan
|
||||
if (((getPosASL ace_player) distance _setPosition) > 5) then {
|
||||
|
||||
|
@ -17,11 +17,9 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
//find is case sensitive, so keep everything lowercase
|
||||
#define FENCE_A3_TYPENAMES ["land_net_fence_4m_f", "land_net_fence_8m_f", "land_net_fenced_8m_f", "land_new_wiredfence_5m_f", "land_new_wiredfence_10m_dam_f", "land_new_wiredfence_10m_f", "land_pipe_fence_4m_f", "land_pipe_fence_4mnolc_f", "land_sportground_fence_f", "land_wired_fence_4m_f", "land_wired_fence_4md_f", "land_wired_fence_8m_f", "land_wired_fence_8md_f", "land_razorwire_f"]
|
||||
#define FENCE_A3_P3DS ["mil_wiredfence_f.p3d"]
|
||||
#define FENCE_TYPENAMES ["land_net_fence_4m_f", "land_net_fence_8m_f", "land_net_fenced_8m_f", "land_new_wiredfence_5m_f", "land_new_wiredfence_10m_dam_f", "land_new_wiredfence_10m_f", "land_pipe_fence_4m_f", "land_pipe_fence_4mnolc_f", "land_sportground_fence_f", "land_wired_fence_4m_f", "land_wired_fence_4md_f", "land_wired_fence_8m_f", "land_wired_fence_8md_f", "land_razorwire_f"]
|
||||
|
||||
#define FENCE_AIA_TYPENAMES []
|
||||
#define FENCE_AIA_P3DS ["wall_indfnc_3.p3d", "wall_indfnc_9.p3d", "wall_indfnc_corner.p3d", "pletivo_wired.p3d", "wall_fen1_5.p3d"]
|
||||
#define FENCE_P3DS ["mil_wiredfence_f.p3d","wall_indfnc_3.p3d", "wall_indfnc_9.p3d", "wall_indfnc_corner.p3d", "pletivo_wired.p3d", "wall_fen1_5.p3d"]
|
||||
|
||||
private ["_typeOf", "_returnValue"];
|
||||
PARAMS_1(_object);
|
||||
@ -30,14 +28,15 @@ _typeOf = toLower (typeOf _object);
|
||||
_returnValue = false;
|
||||
|
||||
if (_typeOf != "") then {
|
||||
_returnValue = _typeOf in (FENCE_A3_TYPENAMES + FENCE_AIA_TYPENAMES);
|
||||
//If the fence has configEntry we can check it directly
|
||||
_returnValue = _typeOf in FENCE_TYPENAMES;
|
||||
} else {
|
||||
_typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d"
|
||||
{
|
||||
if ((_typeOf find _x) != -1) then {
|
||||
if ((_typeOf find _x) != -1) exitWith {
|
||||
_returnValue = true;
|
||||
};
|
||||
} forEach (FENCE_A3_P3DS + FENCE_AIA_P3DS);
|
||||
} forEach FENCE_P3DS;
|
||||
};
|
||||
|
||||
_returnValue
|
||||
|
Loading…
Reference in New Issue
Block a user