ACE3/optionals/compat_sog/functions/fnc_handlePunjiTrapDamage.sqf

48 lines
1.2 KiB
Plaintext
Raw Normal View History

S.O.G. Prairie Fire Compatibility (#8284) * Added initial compat * Added G-Forces compatibility * Added Reload compatibility * Add fuel capacities to planes and helicopters * Add fuel capacities to wheeled and tracked vehicles, added fuel cargo config * Add fuel capacities to OH-6 * Removed custom fuel capacities from Mi-2 with external tanks * Fix config errors * Add CSW compatibility for static guns * Add ACE arsenal to EMM main menu * Add CBA versioning check for SOG:PF * Add vn_emm to requiredAddons required for main menu patching * Fix arsenal not being added to main menu * Fix styling of ACE Arsenal button * Add CSW compat for mortars * Disable dragging of large statics * Disable frag for molotov * Set damage type of melee ammo * Add custom damage handling for punji traps * Add ACE Explosives compat to M18 Claymores * Improve digDistance of Claymore x3 * Add ACE Explosives compat to M14 and M16 mines * Add Explosives compat for M16 Trip Wire mines * Add Explosives compat for F1 Trip Wire mines * Add Explosives compat for Arty Shell Trip wire mine * Improve interaction points for explosives * Add Explosives compat for Satchel charge and AT mine * Add Explosives compat for Punji traps, improve comments * Add Explosives compat to M112 Breaching charge * Rename mines.hpp to explosives.hpp * Allow digging spiderholes with entrenching tool * Fix minor config errors * Add CSW pictures, models and stringtable entries * Add missing stringtable entries * Add CSW weapon pictures and stringtable entries * Handle punji trap damage with disabled medical * Disable cookoff for bicycles * Remove custom digging tools (needs deeper changes) * Improve spiderhole digging translation * Fill CfgPatches units and weapons arrays for Zeus * Add witty comment * Use lowercase for external component names * Fix indentation * Fix missing base class * Remove accidentally added files * pboProject fixes for S.O.G. Prairie Fire Compatibility (#8311) * Change macros to work with pboproject * Add placeholders for VN p3d files * Add ending newlines Co-authored-by: jonpas <jonpas33@gmail.com> * Fix UBC Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com> Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com> Co-authored-by: Björn Dahlgren <bjorn@dahlgren.io> Co-authored-by: jonpas <jonpas33@gmail.com> Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>
2021-10-05 11:28:43 +00:00
#include "script_component.hpp"
/*
* Author: BaerMitUmlaut
* Manually triggers punji trap damage.
*
* Arguments:
* 0: Punji trap <OBJECT>
* 1: Affected units <ARRAY of OBJECT>
S.O.G. Prairie Fire Compatibility (#8284) * Added initial compat * Added G-Forces compatibility * Added Reload compatibility * Add fuel capacities to planes and helicopters * Add fuel capacities to wheeled and tracked vehicles, added fuel cargo config * Add fuel capacities to OH-6 * Removed custom fuel capacities from Mi-2 with external tanks * Fix config errors * Add CSW compatibility for static guns * Add ACE arsenal to EMM main menu * Add CBA versioning check for SOG:PF * Add vn_emm to requiredAddons required for main menu patching * Fix arsenal not being added to main menu * Fix styling of ACE Arsenal button * Add CSW compat for mortars * Disable dragging of large statics * Disable frag for molotov * Set damage type of melee ammo * Add custom damage handling for punji traps * Add ACE Explosives compat to M18 Claymores * Improve digDistance of Claymore x3 * Add ACE Explosives compat to M14 and M16 mines * Add Explosives compat for M16 Trip Wire mines * Add Explosives compat for F1 Trip Wire mines * Add Explosives compat for Arty Shell Trip wire mine * Improve interaction points for explosives * Add Explosives compat for Satchel charge and AT mine * Add Explosives compat for Punji traps, improve comments * Add Explosives compat to M112 Breaching charge * Rename mines.hpp to explosives.hpp * Allow digging spiderholes with entrenching tool * Fix minor config errors * Add CSW pictures, models and stringtable entries * Add missing stringtable entries * Add CSW weapon pictures and stringtable entries * Handle punji trap damage with disabled medical * Disable cookoff for bicycles * Remove custom digging tools (needs deeper changes) * Improve spiderhole digging translation * Fill CfgPatches units and weapons arrays for Zeus * Add witty comment * Use lowercase for external component names * Fix indentation * Fix missing base class * Remove accidentally added files * pboProject fixes for S.O.G. Prairie Fire Compatibility (#8311) * Change macros to work with pboproject * Add placeholders for VN p3d files * Add ending newlines Co-authored-by: jonpas <jonpas33@gmail.com> * Fix UBC Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com> Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com> Co-authored-by: Björn Dahlgren <bjorn@dahlgren.io> Co-authored-by: jonpas <jonpas33@gmail.com> Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>
2021-10-05 11:28:43 +00:00
*
* Return Value:
* None
*
* Example:
* [trap] call ace_compat_sog_fnc_handlePunjiTrapDamage
*
* Public: No
*/
params ["_trap", "_affectedUnits"];
S.O.G. Prairie Fire Compatibility (#8284) * Added initial compat * Added G-Forces compatibility * Added Reload compatibility * Add fuel capacities to planes and helicopters * Add fuel capacities to wheeled and tracked vehicles, added fuel cargo config * Add fuel capacities to OH-6 * Removed custom fuel capacities from Mi-2 with external tanks * Fix config errors * Add CSW compatibility for static guns * Add ACE arsenal to EMM main menu * Add CBA versioning check for SOG:PF * Add vn_emm to requiredAddons required for main menu patching * Fix arsenal not being added to main menu * Fix styling of ACE Arsenal button * Add CSW compat for mortars * Disable dragging of large statics * Disable frag for molotov * Set damage type of melee ammo * Add custom damage handling for punji traps * Add ACE Explosives compat to M18 Claymores * Improve digDistance of Claymore x3 * Add ACE Explosives compat to M14 and M16 mines * Add Explosives compat for M16 Trip Wire mines * Add Explosives compat for F1 Trip Wire mines * Add Explosives compat for Arty Shell Trip wire mine * Improve interaction points for explosives * Add Explosives compat for Satchel charge and AT mine * Add Explosives compat for Punji traps, improve comments * Add Explosives compat to M112 Breaching charge * Rename mines.hpp to explosives.hpp * Allow digging spiderholes with entrenching tool * Fix minor config errors * Add CSW pictures, models and stringtable entries * Add missing stringtable entries * Add CSW weapon pictures and stringtable entries * Handle punji trap damage with disabled medical * Disable cookoff for bicycles * Remove custom digging tools (needs deeper changes) * Improve spiderhole digging translation * Fill CfgPatches units and weapons arrays for Zeus * Add witty comment * Use lowercase for external component names * Fix indentation * Fix missing base class * Remove accidentally added files * pboProject fixes for S.O.G. Prairie Fire Compatibility (#8311) * Change macros to work with pboproject * Add placeholders for VN p3d files * Add ending newlines Co-authored-by: jonpas <jonpas33@gmail.com> * Fix UBC Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com> Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com> Co-authored-by: Björn Dahlgren <bjorn@dahlgren.io> Co-authored-by: jonpas <jonpas33@gmail.com> Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>
2021-10-05 11:28:43 +00:00
(getShotParents _trap) params ["", "_instigator"];
private _bodyParts = [];
private _stabCount = 0;
switch (typeOf _trap select [0, 16]) do {
// Large trap
case "vn_mine_punji_01": {
_bodyParts = ["LeftLeg", "RightLeg", "Body"];
_stabCount = random [7, 10, 13];
};
// Small trap
case "vn_mine_punji_02": {
_bodyParts = ["LeftLeg", "RightLeg"];
_stabCount = random [3, 5, 7];
};
// Whip trap
case "vn_mine_punji_03": {
_bodyParts = ["LeftLeg", "RightLeg", "Body"];
_stabCount = random [3, 5, 7];
};
};
{
for "_i" from 0 to _stabCount do {
[_x, random [1, 2, 3], selectRandom _bodyParts, "stab", _instigator] call EFUNC(medical,addDamageToUnit);
};
} forEach _affectedUnits select {isDamageAllowed _x}; // isDamageAllowed already does local check