mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Wirecutter - Self->Equipment Action
This commit is contained in:
parent
39a4977efe
commit
0647a80aad
@ -1,98 +1,19 @@
|
||||
#define MACRO_CUTWIRE \
|
||||
class ACE_Wirecutter_cut { \
|
||||
displayName = "$STR_ACE_CutFence"; \
|
||||
distance = 4; \
|
||||
condition = QUOTE('ToolKit' in items _player && {alive _target}); \
|
||||
statement = QUOTE([ARR_2(5, _target)] call FUNC(cutDownFence)); \
|
||||
showDisabled = 1; \
|
||||
priority = 2.1; \
|
||||
icon = QUOTE(PATHTOF(ui\wirecutter_ca.paa)); \
|
||||
};
|
||||
|
||||
#define MACRO_CUTWIRE_LONG \
|
||||
class ACE_Wirecutter_cut { \
|
||||
displayName = "$STR_ACE_CutFence"; \
|
||||
distance = 4; \
|
||||
condition = QUOTE('ToolKit' in items _player && {alive _target}); \
|
||||
statement = QUOTE([ARR_2(5, _target)] call FUNC(cutDownFence)); \
|
||||
showDisabled = 1; \
|
||||
priority = 2.1; \
|
||||
icon = QUOTE(PATHTOF(ui\wirecutter_ca.paa)); \
|
||||
};
|
||||
|
||||
class CfgVehicles {
|
||||
|
||||
class Wall_F;
|
||||
class Land_Net_Fence_4m_F: Wall_F {
|
||||
class ACE_Actions {
|
||||
MACRO_CUTWIRE
|
||||
class Man;
|
||||
class CAManBase: Man {
|
||||
class ACE_SelfActions {
|
||||
class ACE_Equipment {
|
||||
class GVAR(CutFence) {
|
||||
displayName = "$STR_ACE_logistics_wirecutter_CutFence";
|
||||
condition = QUOTE([_player] call FUNC(canCutFence));
|
||||
statement = QUOTE([_player] call FUNC(cutDownFence));
|
||||
exceptions[] = {};
|
||||
showDisabled = 1;
|
||||
priority = 0;
|
||||
icon = PATHTOF(UI\wirecutter_ca.paa);
|
||||
hotkey = "C";
|
||||
};
|
||||
};
|
||||
class Land_Net_Fence_8m_F: Wall_F {
|
||||
class ACE_Actions {
|
||||
MACRO_CUTWIRE_LONG
|
||||
};
|
||||
};
|
||||
class Land_Net_FenceD_8m_F: Wall_F {
|
||||
class ACE_Actions {
|
||||
MACRO_CUTWIRE
|
||||
};
|
||||
};
|
||||
class Land_New_WiredFence_5m_F: Wall_F {
|
||||
class ACE_Actions {
|
||||
MACRO_CUTWIRE
|
||||
};
|
||||
};
|
||||
class Land_New_WiredFence_10m_Dam_F: Wall_F {
|
||||
class ACE_Actions {
|
||||
MACRO_CUTWIRE
|
||||
};
|
||||
};
|
||||
class Land_New_WiredFence_10m_F: Wall_F {
|
||||
class ACE_Actions {
|
||||
MACRO_CUTWIRE_LONG
|
||||
};
|
||||
};
|
||||
class Land_Pipe_fence_4m_F: Wall_F {
|
||||
class ACE_Actions {
|
||||
MACRO_CUTWIRE
|
||||
};
|
||||
};
|
||||
class Land_Pipe_fence_4mNoLC_F: Wall_F {
|
||||
class ACE_Actions {
|
||||
MACRO_CUTWIRE
|
||||
};
|
||||
};
|
||||
class Land_SportGround_fence_F: Wall_F {
|
||||
class ACE_Actions {
|
||||
MACRO_CUTWIRE
|
||||
};
|
||||
};
|
||||
class Land_Wired_Fence_4m_F: Wall_F {
|
||||
class ACE_Actions {
|
||||
MACRO_CUTWIRE
|
||||
};
|
||||
};
|
||||
class Land_Wired_Fence_4mD_F: Wall_F {
|
||||
class ACE_Actions {
|
||||
MACRO_CUTWIRE
|
||||
};
|
||||
};
|
||||
class Land_Wired_Fence_8m_F: Wall_F {
|
||||
class ACE_Actions {
|
||||
MACRO_CUTWIRE_LONG
|
||||
};
|
||||
};
|
||||
class Land_Wired_Fence_8mD_F: Wall_F {
|
||||
class ACE_Actions {
|
||||
MACRO_CUTWIRE
|
||||
};
|
||||
};
|
||||
|
||||
class NonStrategic;
|
||||
class Land_Razorwire_F: NonStrategic {
|
||||
class ACE_Actions {
|
||||
MACRO_CUTWIRE
|
||||
};
|
||||
};
|
||||
};
|
16
addons/logistics_wirecutter/CfgWeapons.hpp
Normal file
16
addons/logistics_wirecutter/CfgWeapons.hpp
Normal file
@ -0,0 +1,16 @@
|
||||
class CfgWeapons {
|
||||
class InventoryItem_Base_F;
|
||||
class ACE_ItemCore;
|
||||
|
||||
class ACE_wirecutter: ACE_ItemCore {
|
||||
author = "$STR_ACE_Core_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;
|
||||
};
|
||||
};
|
||||
};
|
@ -2,8 +2,11 @@
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(canCutFence);
|
||||
PREP(cutDownFence);
|
||||
PREP(cutDownFenceAbort);
|
||||
PREP(cutDownFenceCallback);
|
||||
PREP(getNearestFence);
|
||||
PREP(isFence);
|
||||
|
||||
ADDON = true;
|
||||
|
@ -15,3 +15,4 @@ class CfgPatches {
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgSounds.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
|
@ -0,0 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
PARAMS_1(_unit);
|
||||
|
||||
("ACE_wirecutter" in (items _unit)) && {!(isNull ([_unit] call FUNC(getNearestFence)))}
|
@ -1,14 +1,13 @@
|
||||
// by gpgpgpgp, edited by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_timeToCut,_fenceObject);
|
||||
PARAMS_1(_unit);
|
||||
if (_unit != ACE_player) exitWith {};
|
||||
|
||||
// if (cadetMode) then {
|
||||
// {
|
||||
// [ACE_player, "{_this groupChat localize 'STR_ACE_CuttingFenceChat'}", _x] call ACE_Core_fnc_execRemoteFnc;
|
||||
// } forEach units group ACE_player;
|
||||
// };
|
||||
_fenceObject = [ACE_player] call FUNC(getNearestFence);
|
||||
if (isNull _fenceObject) exitWith {};
|
||||
|
||||
_timeToCut = 5;
|
||||
if !([ACE_player] call EFUNC(common,isEngineer)) then {
|
||||
_timeToCut = _timeToCut + 5;
|
||||
};
|
||||
|
@ -0,0 +1,13 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_nearestFence";
|
||||
PARAMS_1(_unit);
|
||||
|
||||
_nearestFence = objNull;
|
||||
{
|
||||
if ((isNull _nearestFence) && {[_x] call FUNC(isFence)}) then {
|
||||
_nearestFence = _x;
|
||||
};
|
||||
} forEach nearestObjects [_unit, [], 5];
|
||||
|
||||
_nearestFence
|
24
addons/logistics_wirecutter/functions/fnc_isFence.sqf
Normal file
24
addons/logistics_wirecutter/functions/fnc_isFence.sqf
Normal file
@ -0,0 +1,24 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
#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"]
|
||||
|
||||
|
||||
private ["_typeOf", "_returnValue"];
|
||||
PARAMS_1(_object);
|
||||
|
||||
_typeOf = typeOf _object;
|
||||
_returnValue = false;
|
||||
|
||||
if (_typeOf != "") then {
|
||||
systemChat format ["checking %1", _typeOf];
|
||||
_returnValue = _typeOf in FENCE_A3_TYPENAMES;
|
||||
} else {
|
||||
_typeOf = str _object;
|
||||
{
|
||||
if ((_typeOf find _x) != -1) then {
|
||||
_returnValue = true;
|
||||
};
|
||||
} forEach FENCE_A3_P3DS;
|
||||
};
|
||||
_returnValue
|
@ -2,7 +2,15 @@
|
||||
<!-- Edited with tabler - 2014-12-21 -->
|
||||
<Project name="ACE">
|
||||
<Package name="Wirecutter">
|
||||
<Key ID="STR_ACE_CutFence">
|
||||
<Key ID="STR_ACE_logistics_wirecutter_wirecutterName">
|
||||
<English>Wirecutter</English>
|
||||
<German>Drahtschneider</German>
|
||||
<Spanish>Wirecutter</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_logistics_wirecutter_wirecutterDescription">
|
||||
<English>Wirecutter</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_logistics_wirecutter_CutFence">
|
||||
<English>Cut Fence</English>
|
||||
<German>Zaun schneiden</German>
|
||||
<Spanish>Cortar alambrado</Spanish>
|
||||
@ -14,7 +22,7 @@
|
||||
<Hungarian>Drótkerítés átvágása</Hungarian>
|
||||
<Russian>Вырезать забор</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_CuttingFence">
|
||||
<Key ID="STR_ACE_logistics_wirecutter_CuttingFence">
|
||||
<English>Cutting Fences / Wires ...</English>
|
||||
<German>Zaun / Draht schneiden ...</German>
|
||||
<Spanish>Cortando alambrado / cables ...</Spanish>
|
||||
@ -26,19 +34,7 @@
|
||||
<Hungarian>Drótok elvágása ...</Hungarian>
|
||||
<Russian>Вырезаем забор / провода ...</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_CuttingFenceChat">
|
||||
<English>Cutting Fences!</English>
|
||||
<German>Schneide Zaun!</German>
|
||||
<Spanish>Cortando alambrado!</Spanish>
|
||||
<Polish>Przecinanie płotu!</Polish>
|
||||
<Czech>Stříhání plotu!</Czech>
|
||||
<French>Cisaillage!</French>
|
||||
<Portuguese>Cortando Cerca!</Portuguese>
|
||||
<Italian>La sto tagliando!</Italian>
|
||||
<Hungarian>Átvágom a drótkerítést!</Hungarian>
|
||||
<Russian>Вырезаем забор!</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_FenceCut">
|
||||
<Key ID="STR_ACE_logistics_wirecutter_FenceCut">
|
||||
<English>Fence cut</English>
|
||||
<German>Zaun geschnitten</German>
|
||||
<Spanish>Alambrado cortado</Spanish>
|
||||
|
BIN
addons/logistics_wirecutter/ui/item_wirecutter_ca.paa
Normal file
BIN
addons/logistics_wirecutter/ui/item_wirecutter_ca.paa
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user