ACE3/addons/medical_engine/script_macros_config.hpp
Grim a85074a797
Medical Engine - Remove ACE_HDBracket hitpoint (#9732)
* Medical Engine - Remove ACE_HDBracket hitpoint

* skip context 4

* move checks to vars

* skip uav/logic entities

* add check for arm/leg hitpoints

* Update addons/medical_engine/functions/fnc_handleDamage.sqf

Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>

* don't skip context 2

* clearer custom hitpoint array name

* reenable compile cache

* remove debug mode

* lazy eval

* whitespace

* update comment

* Update fnc_handleDamage.sqf header

* Update addons/medical_engine/functions/fnc_handleDamage.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/medical_engine/XEH_postInit.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* update hitpoint test

* missing "

* Update addons/medical/dev/test_hitpointConfigs.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

---------

Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
2024-06-11 11:11:28 -03:00

51 lines
1.7 KiB
C++

/*
Usage:
#include "\z\ace\addons\medical_engine\script_macros_config.hpp"
class CfgVehicles {
class My_AwesomeUnit_base;
class My_AwesomeUnit: My_AwesomeUnit_base {
class HitPoints {
class HitHands;
class HitLegs;
ADD_ACE_HITPOINTS;
};
};
};
*/
// Our method for adding left and right arm and leg armor. Uses those selections
// that are used for animations and therefore exist in all third party units.
// This used to take the armor values as parameters; it now inherits the values
// of `armor`, `passThrough` and `explosionShielding` from the existing hitpoints
// for vanilla consistency.
// "ACE_HDBracket" is a special hit point. It is designed in a way where the
// "HandleDamage" event handler will compute it at the end of every damage
// calculation step. This way we can figure out which hit point took the most
// damage from one projectile and should be receiving the ACE medical wound.
// the hit point itself should not take any damage
// It is important that the "ACE_HDBracket" hit point is the last in the config,
// but has the same selection as the first one (always "HitHead" for soldiers).
#define ADD_ACE_HITPOINTS\
class HitLeftArm: HitHands {\
material = -1;\
name = "hand_l";\
radius = 0.08;\
visual = "injury_hands";\
minimalHit = 0.01;\
};\
class HitRightArm: HitLeftArm {\
name = "hand_r";\
};\
class HitLeftLeg: HitLegs {\
material = -1;\
name = "leg_l";\
radius = 0.1;\
visual = "injury_legs";\
minimalHit = 0.01;\
};\
class HitRightLeg: HitLeftLeg {\
name = "leg_r";\
}