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

Explosives - Add AP mine with scripted medical damage #10609

Merged
merged 2 commits into from
Jan 13, 2025
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
13 changes: 13 additions & 0 deletions addons/explosives/ACE_Medical_Injuries.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class ACE_Medical_Injuries {
class damageTypes {
class woundHandlers;
class explosive {
class woundHandlers: woundHandlers {};
};
class GVAR(toePopper): explosive {
class woundHandlers: woundHandlers {
ADDON = QFUNC(woundsHandlerToePopper);
};
};
};
};
3 changes: 3 additions & 0 deletions addons/explosives/CfgAmmo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ class CfgAmmo {
GVAR(defuseObjectPosition)[] = {0.0, -0.05, 0.15};
};
class APERSMine_Range_Ammo;
class ACE_APERSMine_ToePopper_Ammo: APERSMine_Range_Ammo {
ACE_damageType = QGVAR(toePopper);
};
class TrainingMine_Ammo: APERSMine_Range_Ammo {
GVAR(magazine) = "TrainingMine_Mag";
GVAR(size) = 0;
Expand Down
4 changes: 4 additions & 0 deletions addons/explosives/CfgMagazines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ class CfgMagazines {
};
};
};
class ACE_APERSMine_ToePopper_Mag: APERSMine_Range_Mag {
displayName = CSTRING(apersToePopper);
ammo = "ACE_APERSMine_ToePopper_Ammo";
};
class APERSTripMine_Wire_Mag: ATMine_Range_Mag {
GVAR(setupObject) = "ACE_Explosives_Place_APERSTripwireMine";
class ACE_Triggers {
Expand Down
6 changes: 6 additions & 0 deletions addons/explosives/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,12 @@ class CfgVehicles {
class APERSBoundingMine: MineBase {
ammo = "ACE_APERSBoundingMine_Range_Ammo";
};
class APERSMine;
class ACE_APERSMine_ToePopper: APERSMine {
author = ECSTRING(common,aceteam);
ammo = "ACE_APERSMine_ToePopper_Ammo";
displayName = CSTRING(apersToePopper);
};

class DemoCharge_F: MineBase {
ammo = "ACE_DemoCharge_Remote_Ammo";
Expand Down
2 changes: 1 addition & 1 deletion addons/explosives/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class CfgWeapons {
muzzles[] += {QGVAR(muzzle)};
class PutMuzzle: Default {};
class GVAR(muzzle): PutMuzzle {
magazines[] = {"ACE_FlareTripMine_Mag"};
magazines[] = {"ACE_FlareTripMine_Mag", "ACE_APERSMine_ToePopper_Mag"};
};
};

Expand Down
1 change: 1 addition & 0 deletions addons/explosives/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ PREP(triggerType);
PREP(allowDefuse);
PREP(isAllowedDefuse);
PREP(checkDetonateHandlers);
PREP(woundsHandlerToePopper);
1 change: 1 addition & 0 deletions addons/explosives/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class CfgPatches {

#include "ACE_Triggers.hpp"
#include "ACE_Arsenal_Stats.hpp"
#include "ACE_Medical_Injuries.hpp"

// UI stuff
class RscText;
Expand Down
30 changes: 30 additions & 0 deletions addons/explosives/functions/fnc_woundsHandlerToePopper.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include "..\script_component.hpp"
/*
* Author: PabstMirror
* Wound handler for the toe-popper ammo; only does damage to legs
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Damage <ARRAY>
*
* Return Value:
* <ARRAY>
*
* Example:
* [player, []] call ace_explosives_fnc_woundsHandlerToePopper
*
* Public: No
*/

params ["", "_array"];
TRACE_1("woundsHandlerToePopper",_this);

_array = _array select {
_x params ["", "_part"];
_part in ["LeftLeg", "RightLeg"]
};

_this set [1, _array];

_this

3 changes: 3 additions & 0 deletions addons/explosives/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1209,5 +1209,8 @@
<Turkish>Zamanlayıcı</Turkish>
<Hungarian>Időzítő</Hungarian>
</Key>
<Key ID="STR_ACE_Explosives_apersToePopper">
<English>APERS Mine (Toe-Popper)</English>
</Key>
</Package>
</Project>
5 changes: 5 additions & 0 deletions addons/realisticnames/compat_explosives/CfgMagazines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ class CfgMagazines {
class ACE_DemoCharge_Remote_Mag_Throwable: ACE_SatchelCharge_Remote_Mag_Throwable {
displayName = CSTRING(DemoChargeThrowable_Name);
};

class APERSMine_Range_Mag;
class ACE_APERSMine_ToePopper_Mag: APERSMine_Range_Mag {
displayName = CSTRING(APERSMine_ToePopper_Name);
};
};
3 changes: 3 additions & 0 deletions addons/realisticnames/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@
<Turkish>VS-50 Anti-Personel Mayını</Turkish>
<Hungarian>VS-50 gyalogsági taposóakna</Hungarian>
</Key>
<Key ID="STR_ACE_RealisticNames_APERSMine_ToePopper_Name">
<English>VS-50 Anti-Personnel Mine (Toe-Popper)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_APERSTripwireMine_Name">
<English>PMR-3 Anti-Personnel Tripwire Mine</English>
<Czech>PMR-3 Protipěchotní mina (drát)</Czech>
Expand Down
Loading