TLDR: StabilizeMe mod for XCOM2.
Soldiers gain the ability to stabilize any other soldier that is bleeding out and happens to be carrying a medikit.
This mod was created to fix one annoying "feature" in the game. The scenario usually goes something like this:
- <insert alien here> destroys your specialist's cover
- <insert alien here> scores a critical hit on your specialist
- Your specialist is knocked unconscious and is bleeding out
- and by the way, he's the only one with a medikit
- You go: Oh for f*ck sakes! This is bull!
- The specialist proceeds to bleed out as nobody around him can help him, even though in practise the victim has a medikit lying right beside him.
The mod's operation is quite simple actually. In essence the mod creates a new ability called 'StabilizeMedkitOwner' and injects it to the soldiers in combat. This image describes the technical aspects of the mod:
Explained in short:
-
We create a new ability, called 'StabilizeMedkitOwner'. This ability is like standard stabilize but with special condition, the X2Condition_StabilizeMedkitOwner that checks that the target unit has the an ability that has a X2Effect_RemoveEffects in its AbilityTargetEffects which removes the class'X2StatusEffects'.default.BleedingOutName. Using the X2Effect_RemoveEffects is the standard way of removing effects from units and most if not all medic mods should be doing it that way, which should make the mod compatible with most other medic related mods out there.
-
We create a UIScreenListener that listens the screen change to UITacticalHUD. That's when we'll do our dirty work. Once UITacticalHUD is on the screen, we're in tactical combat and we can empower our squad with the new godly medical ability.
Why do we do this only when we enter tactical combat you must be asking - the reason is that in this way even when we load an existing save game in the middle of combat the new abilities get applied. As you load the game, the strategic data is loaded, the squad set up and the tactical UI loaded - and that's when we apply our new ability. So whenever you enter tactical combat your squad members get checked for the ability, if they don't have it yet then the ability gets added.
The freedom of MIT license applies, so have fun!