-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added Code for IED Zeus Module
- Loading branch information
Showing
11 changed files
with
201 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
params ["_object", "_isLarge"]; | ||
_failed = { | ||
params ["_args", "_elapsedTime", "_totalTime", "_errorCode"]; | ||
_bomb = _args select 0; | ||
_isLarge = _args select 1; | ||
[_bomb, _isLarge] call f_fnc_iedBoom; | ||
}; | ||
|
||
_condition_power = { | ||
_canDefuse = [_player, "ACE_DefusalKit" ] call BIS_fnc_hasItem; | ||
_isDefused = _target getVariable ["defused_power", false]; | ||
(_canDefuse == true) and (_isDefused == false); | ||
}; | ||
_finish_power = { | ||
params ["_args", "_elapsedTime", "_totalTime", "_errorCode"]; | ||
_bomb = _args select 0; | ||
_bomb setVariable ["defused_power", true, true]; | ||
}; | ||
_statement_power = { | ||
params ["_target", "_player", "_params"]; | ||
_finish_code = _params select 0; | ||
_failed_code = _params select 1; | ||
_isLarge = _params select 2; | ||
[60, [_target, _isLarge], _finish_code, _failed_code, "Defusing Power Source..."] call ace_common_fnc_progressBar; | ||
}; | ||
|
||
_action_power = ["Defuse Power Source", "Defuse Power Source", "", _statement_power, _condition_power, {}, [_finish_power, _failed, _isLarge]] call ace_interact_menu_fnc_createAction; | ||
[_object, 0, ["ACE_MainActions"], _action_power] call ace_interact_menu_fnc_addActionToObject; | ||
|
||
_condition_init = { | ||
_canDefuse = [_player, "ACE_DefusalKit" ] call BIS_fnc_hasItem; | ||
_isDefused = _target getVariable ["defused_init", false]; | ||
(_canDefuse == true) and (_isDefused == false); | ||
}; | ||
_finish_init = { | ||
params ["_args", "_elapsedTime", "_totalTime", "_errorCode"]; | ||
_bomb = _args select 0; | ||
_bomb setVariable ["defused_init", true, true]; | ||
}; | ||
_statement_init = { | ||
params ["_target", "_player", "_params"]; | ||
_finish_code = _params select 0; | ||
_failed_code = _params select 1; | ||
_isLarge = _params select 2; | ||
_previousStepDone = _target getVariable ["defused_power", false]; | ||
if (_previousStepDone == false) then { | ||
_target setDamage 1; | ||
} else { | ||
[60, [_target, _isLarge], _finish_code, _failed_code, "Defusing Initiator..."] call ace_common_fnc_progressBar; | ||
}; | ||
}; | ||
|
||
_action_init = ["Defuse Initiator", "Defuse Initiator", "", _statement_init, _condition_init, {}, [_finish_init, _failed, _isLarge]] call ace_interact_menu_fnc_createAction; | ||
[_object, 0, ["ACE_MainActions"], _action_init] call ace_interact_menu_fnc_addActionToObject; | ||
|
||
_condition_det = { | ||
_canDefuse = [_player, "ACE_DefusalKit" ] call BIS_fnc_hasItem; | ||
_isDefused = _target getVariable ["defused", false]; | ||
(_canDefuse == true) and (_isDefused == false); | ||
}; | ||
_finish_det = { | ||
params ["_args", "_elapsedTime", "_totalTime", "_errorCode"]; | ||
_bomb = _args select 0; | ||
_bomb setVariable ["defused", true, true]; | ||
}; | ||
_statement_det = { | ||
params ["_target", "_player", "_params"]; | ||
_finish_code = _params select 0; | ||
_failed_code = _params select 1; | ||
_isLarge = _params select 2; | ||
_previousStepDone = _target getVariable ["defused_init", false]; | ||
if (_previousStepDone == false) then { | ||
_target setDamage 1; | ||
} else { | ||
[60, [_target, _isLarge], _finish_code, _failed_code, "Defusing Detonator..."] call ace_common_fnc_progressBar; | ||
}; | ||
}; | ||
|
||
_action_det = ["Defuse Detonator", "Defuse Detonator", "", _statement_det, _condition_det, {}, [_finish_det, _failed, _isLarge]] call ace_interact_menu_fnc_createAction; | ||
[_object, 0, ["ACE_MainActions"], _action_det] call ace_interact_menu_fnc_addActionToObject; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
Created By: JC | ||
*/ | ||
#include "macros.hpp" | ||
|
||
// TODO Handle the case where we run this twice against the same object (set a var on the object saying "isIED"?) | ||
params ["_object", "_isLarge", "_isProxy", "_proxySide", "_proxyRange"]; | ||
[_object, _isLarge] call f_fnc_addDefuseActionsToObject; | ||
[_object, _isLarge] call f_fnc_addZeusDetonationToIED; | ||
|
||
if (_isProxy == true) then { | ||
[_object, _isLarge, _proxySide, _proxyRange] call f_fnc_addProxyFuseTriggerToIED; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
Created By: JC | ||
*/ | ||
#include "macros.hpp" | ||
params ["_object", "_isLarge", "_proxySide", "_proxyRange"]; | ||
private _proxy = createTrigger ["EmptyDetector", getPos _object]; | ||
// TODO Test when multiplee proxy-fused IEDs are on field | ||
_proxy setVariable ["iedObj", _object]; | ||
_proxy setTriggerActivation [str _proxySide, "PRESENT", false]; | ||
_proxy setTriggerArea [_proxyRange, _proxyRange, 0, false, _proxyRange * 2]; // *2 because the z axis goes above and below the ground | ||
private _onAct = "thisTrigger getVariable ""iedObj"" setDamage 1;"; | ||
private _cond = "thisList findIf {_x != thisTrigger getVariable ""iedObj""} > -1"; | ||
_proxy setTriggerStatements [_cond, _onAct, ""]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Allows Zeus to detonate the IED by setting its HP to 0 (done by way of a trigger) | ||
// In so doing, also prevents the object from taking damage (so that stray bullets don't detonate it!) | ||
|
||
params ["_object", "_isLarge"]; | ||
_object allowDamage false; | ||
_object setVariable ["isLargeIED", _isLarge]; | ||
_object addEventHandler ["Killed", { | ||
params ["_unit", "_killer"]; | ||
[_unit, _unit getVariable ["isLargeIED", false]] call f_fnc_iedBoom; | ||
}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
params ["_object", "_isLarge"]; | ||
_isDefused = _object getVariable ["defused", false]; | ||
if (_isDefused == false) then { | ||
if (_isLarge == true) then { | ||
_explosive1 = "SatchelCharge_Remote_Ammo_Scripted" createVehicle (getPos _object); | ||
_explosive1 setDamage 1; | ||
_explosive2 = "SatchelCharge_Remote_Ammo_Scripted" createVehicle (getPos _object); | ||
_explosive2 setDamage 1; | ||
_explosive3 = "SatchelCharge_Remote_Ammo_Scripted" createVehicle (getPos _object); | ||
_explosive3 setDamage 1; | ||
} else { | ||
_explosive = "DemoCharge_Remote_Ammo_Scripted" createVehicle (getPos _object); | ||
_explosive setDamage 1; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
class ied | ||
{ | ||
file = "components\ied"; | ||
class addDefuseActionsToObject | ||
{ | ||
}; | ||
class addIEDToObject | ||
{ | ||
}; | ||
class addZeusDetonationToIED | ||
{ | ||
}; | ||
class iedBoom | ||
{ | ||
}; | ||
class addProxyFuseTriggerToIED | ||
{ | ||
}; | ||
}; | ||
class ied_zen | ||
{ | ||
file = "components\ied\zen"; | ||
class zen_makeIED | ||
{ | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "../../macros.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
Created By: JC | ||
*/ | ||
#include "../macros.hpp" | ||
|
||
CLIENT_ONLY; | ||
|
||
params ["_object"]; | ||
|
||
if (isNull _object) then | ||
{ | ||
["No object selected."] call zen_common_fnc_showMessage; | ||
} else { | ||
["Create IED", | ||
[ | ||
["CHECKBOX", "Large IED?", false], | ||
["CHECKBOX", "Is proximity-fused?", false], | ||
["SIDES", "Activated by side (for proximity fuses)", west], | ||
["SLIDER:RADIUS", "Proximity fusing range (metres)", [0, 100, 10, 1, _object, [1, 0, 0, 1]]] | ||
], | ||
{ | ||
params ["_dialogValues", "_args"]; | ||
_dialogValues params ["_isLarge", "_isProxy", "_proxySide", "_proxyRange"]; | ||
_args params ["_object"]; | ||
[_object, _isLarge, _isProxy, _proxySide, _proxyRange] remoteExec ["f_fnc_addIEDToObject", 2]; | ||
["Adding IED to '%1'.", _object] call zen_common_fnc_showMessage; | ||
}, | ||
{}, | ||
[_object]] call zen_dialog_fnc_create; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
call | ||
{ | ||
private _iedCreate = { [_this#1] call f_fnc_zen_makeIED }; | ||
[ | ||
"[CAFE3] IEDs", | ||
"Make object into IED", | ||
_iedCreate | ||
|
||
] call zen_custom_modules_fnc_register; | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters