Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Large IED defuse distance #5261

Merged
merged 7 commits into from
Jun 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion addons/explosives/CfgAmmo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ class CfgAmmo {
class PipeBombCore: TimeBombCore;
class PipeBombBase: PipeBombCore;
*/
// GVAR(size) = 0; is small size
// GVAR(size) = 1; is large size
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be put into the framework page of documentation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

class DirectionalBombBase;
class ClaymoreDirectionalMine_Remote_Ammo: DirectionalBombBase {
GVAR(magazine) = "ClaymoreDirectionalMine_Remote_Mag";
GVAR(Explosive) = "ClaymoreDirectionalMine_Remote_Ammo_Scripted";
GVAR(size) = 0;
GVAR(defuseObjectPosition)[] = {0, 0, 0.038};
soundActivation[] = {"", 0, 0, 0};
soundDeactivation[] = {"", 0, 0, 0};
Expand All @@ -39,6 +42,7 @@ class CfgAmmo {

class APERSTripMine_Wire_Ammo: DirectionalBombBase {
GVAR(defuseObjectPosition)[] = {-1.415, 0, 0.12};
GVAR(size) = 0;
};

class ACE_FlareTripMine_Wire_Ammo: APERSTripMine_Wire_Ammo {
Expand All @@ -58,16 +62,18 @@ class CfgAmmo {
distance = 0;
};
};

class F_20mm_Red;
class ACE_TripFlare_FlareEffect: F_20mm_Red {
triggerTime = 0.1;
GVAR(size) = 0;
};

class SLAMDirectionalMine_Wire_Ammo: DirectionalBombBase {
indirectHitRange = 20;
GVAR(explodeOnDefuseChance) = 1;
GVAR(magazine) = "SLAMDirectionalMine_Wire_Mag";
GVAR(size) = 0;
};
class ACE_SLAMDirectionalMine_Command_Ammo: SLAMDirectionalMine_Wire_Ammo {
mineTrigger = "RemoteTrigger";
Expand All @@ -89,6 +95,7 @@ class CfgAmmo {
class DemoCharge_Remote_Ammo: PipeBombBase {
GVAR(magazine) = "DemoCharge_Remote_Mag";
GVAR(Explosive) = "DemoCharge_Remote_Ammo_Scripted";
GVAR(size) = 0;
GVAR(defuseObjectPosition)[] = {0.07, 0, 0.055};
soundActivation[] = {"", 0, 0, 0};
soundDeactivation[] = {"", 0, 0, 0};
Expand All @@ -99,6 +106,7 @@ class CfgAmmo {
class SatchelCharge_Remote_Ammo: PipeBombBase {
GVAR(magazine) = "SatchelCharge_Remote_Mag";
GVAR(Explosive) = "SatchelCharge_Remote_Ammo_Scripted";
GVAR(size) = 0;
GVAR(defuseObjectPosition)[] = {0.1, 0.1, 0.05};
soundActivation[] = {"", 0, 0, 0};
soundDeactivation[] = {"", 0, 0, 0};
Expand All @@ -110,6 +118,7 @@ class CfgAmmo {
triggerWhenDestroyed = 1;
GVAR(explodeOnDefuseChance) = 0.02;
GVAR(magazine) = "IEDUrbanBig_Remote_Mag";
GVAR(size) = 1;
soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40};
};
class ACE_IEDUrbanBig_Command_Ammo: IEDUrbanBig_Remote_Ammo {
Expand All @@ -123,6 +132,7 @@ class CfgAmmo {
triggerWhenDestroyed = 1;
GVAR(explodeOnDefuseChance) = 0.02;
GVAR(magazine) = "IEDUrbanSmall_Remote_Mag";
GVAR(size) = 0;
soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40};
};
class ACE_IEDUrbanSmall_Command_Ammo: IEDUrbanSmall_Remote_Ammo {
Expand All @@ -136,6 +146,7 @@ class CfgAmmo {
triggerWhenDestroyed = 1;
GVAR(explodeOnDefuseChance) = 0.02;
GVAR(magazine) = "IEDLandBig_Remote_Mag";
GVAR(size) = 1;
soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40};
};
class ACE_IEDLandBig_Command_Ammo: IEDLandBig_Remote_Ammo {
Expand All @@ -149,6 +160,7 @@ class CfgAmmo {
triggerWhenDestroyed = 1;
GVAR(explodeOnDefuseChance) = 0.02;
GVAR(magazine) = "IEDLandSmall_Remote_Mag";
GVAR(size) = 0;
soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40};
};
class ACE_IEDLandSmall_Command_Ammo: IEDLandSmall_Remote_Ammo {
Expand Down
4 changes: 2 additions & 2 deletions addons/explosives/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ class CfgVehicles {
icon = QPATHTOF(UI\Defuse_ca.paa);
};
};
};
};
class ACE_DefuseObject_Large: ACE_DefuseObject {
class ACE_Actions: ACE_Actions {
class ACE_Defuse: ACE_Defuse {
distance = 1.5;
distance = 2;
};
};
};
Expand Down
14 changes: 8 additions & 6 deletions addons/explosives/functions/fnc_interactEH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ if (!("ACE_DefusalKit" in (items ACE_player))) exitWith {};
if (((getPosASL ace_player) distance _setPosition) > 5) then {
{
if (((_x distance ACE_player) < 15) && {!(_x in _minesHelped)}) then {
TRACE_3("Making Defuse Helper",(_x),(typeOf _x),(_x isKindOf "UnderwaterMine_Range_Ammo"));
private _defuseHelper = if (_x isKindOf "UnderwaterMine_Range_Ammo") then {
"ACE_DefuseObject_Large" createVehicleLocal (getPos _x);
} else {
"ACE_DefuseObject" createVehicleLocal (getPos _x);
};

private _config = configFile >> "CfgAmmo" >> typeOf _x;
private _size = getNumber (_config >> QGVAR(size));
TRACE_3("Making Defuse Helper",(_x),(typeOf _x),(_size == 1));
private ["_defuseHelper"];
if (_size == 1) then {
_defuseHelper = "ACE_DefuseObject_Large" createVehicleLocal (getPos _x);
} else {
_defuseHelper = "ACE_DefuseObject" createVehicleLocal (getPos _x);
};

private _defuseObjectPosition = getArray (_config >> QGVAR(defuseObjectPosition));
if (_defuseObjectPosition isEqualTo []) then {
Expand Down
2 changes: 2 additions & 0 deletions docs/wiki/feature/explosives.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Enables attaching explosives to vehicles.
- Select `Disarm`.
- You are safe to pick it up after the action has completed.

**Tip:** To increase the success rate when defusing, make sure you crawl up to the IED.

## 3. Dependencies

{% include dependencies_list.md component="explosives" %}
1 change: 1 addition & 0 deletions docs/wiki/framework/explosives-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class CfgAmmo {
triggerWhenDestroyed = 1; // (Optional) Explode when the object is shot and destroyed (after being placed) (0-disabled, 1-enabled).
ACE_explodeOnDefuse = 0.02; // (Optional) Add a chance for the explosive to detonate after being disarmed (in percent)
ACE_explosives_defuseObjectPosition[] = {-1.415, 0, 0.12}; // (Optional) The position relative to the model where the defuse helper object will be attached and thus the interaction point will be rendered
ACE_explosives_size = 0; // (Optional) Setting to 1 will use a defusal action with a larger radius (useful for large mines or mines with a wide pressure plane trigger area)
};
};
```
Expand Down