XCOM 2
349 ratings
Make Heals Persist
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
117.436 KB
24 May, 2016 @ 6:47pm
6 Jul, 2017 @ 8:47am
11 Change Notes ( view )

Subscribe to download
Make Heals Persist

Description
This mod changes logic to allow specialist, field medic, medibot, and medikit heals
received on the battlefield to persist after returning to the Avenger.



Summary:

Current logic calculates final damaged received based on the minimum hit points your unit
had at any time during the mission. Even if your soldier was fully healed by your specialist,
he could still show as critically wounded after the battle, and be out of commission a LONG time.

This mod changes the calculation to account for heals from the Medikit, Nanomedkit, Restoration,
and Gremlin. If your unit is partially or fully healed during the mission, it will be reflected
after the mission. The mod does not take into account other heals such as Soulsteal. This
can change if there is enough demand, but I feel this change, as is, increases the importance
of the specialist.


Compatibility:
** Has No Class Overrides ** - should be fine unless another mod is also altering the final hitpoint
calculation by whatever means.

Configuration (Optional):

Edit PERCENTAGE value in XcomMakeHealsPersist.ini to indicate the percentage of the
heals that are actually persisted after the scenario. Valid values are 1 to 100.
Default value is 100.

There are two copies of this variable, one for active heals, and the other for regenerative heals.

Edit the HealingDefinitions and RegenerativeHealingDefinitions arrays to determine which heals you
want to apply.

Through use of this array, you can add heals from other mods, under the following conditions:
1) They are simple single or multi target heals OR a regenerative heal.
2) Are not vampiric heals like the PsiOps class has or complex area effect heals like the Healing Grenade.

How to configure another mod's heal to work with this mod:

You will need to examine the code of the other mod.
Search for a line similar to
`CREATE_X2ABILITY_TEMPLATE(Template, 'YourHealName');

YourHealName is the name of the template that you will need to configure.

Also search for lines similar to:

MedikitHeal = new class'X2Effect_ApplyMedikitHeal';
MedikitHeal.PerUseHP = class'X2Ability_DefaultAbilitySet'.default.MEDIKIT_PERUSEHP;
MedikitHeal.IncreasedHealProject = 'BattlefieldMedicine';
MedikitHeal.IncreasedPerUseHP = class'X2Ability_DefaultAbilitySet'.default.NANOMEDIKIT_PERUSEHP;

You will need to use the values specified in PerUseHP and IncreasedPerUseHP.

Having done this, you will need to add a line in my mod similar to:

HealingDefinitions[0]=(TemplateName="FirstAidHeal", PerUseHP=5,IncreasedHealProject="BattlefieldMedicine",IncreasedPerUseHP=7,MultiTarget="N",BonusAbility="Aptitude",BonusAmount=1)


-- TemplateName is the name of the healing template. This parameter is required.
-- PerUseHP is the number of hitpoits that are healed per use. This parameter is required.
-- IncreasedHealProject is the template name of the project, such as Battlefield Medicine, that increases the efficacy of the heal. This parameter
is optional. Leave as empty quotes if this heal cannot be increased through such a project.
-- IncreasedPerUseHP is the the number of hitpoits that are healed per use AFTER your Increased Heal Project has completed. Optional.
-- MultiTarget specifies if the heal is for single or multiple target use.
-- BonusAbility specifies the unit's special ability that increases the amount healed. ( i.e. "Aptitude" for the Field Medic class )
-- BonusAmount specifies the amount that BonusAbility increases the heal

Regenerative heals have a slightly different definition.

RegenerativeHealingDefinitions[0]=(TemplateName="SparkRegeneration", HealAmount=2,MaxHealAmount=6,HealthRegeneratedName="SparkHealthRegenerated")
-- TemplateName - the name of the healing template. This parameter is required.
-- HealAmount - the number of hitpoints healed per "tick".
-- MaxHealAmount - the total number of hitpoints that can be healed. In the above example a HealAmount of 2, and MaxHealAmount of 6 means that
the heal ticks 3 times. This parameter is required.
-- HealthRegeneratedName - unique name for the heal. This parameter is required.

As you add items to the arrays, make sure that you sequence the new indexes correctly.

Supported heals:
First Aid - Field Medic Mod
Standard Gremlin Heal
Medibot Heal from Medibot Gremlin Mod
Standard Medikit Heal
Standard Nanomedikit Heal
Pacman Heal from Pacman Mod
Standard Restorative Mist Heal
Standard Spark Repair
Spark Regeneration from "GTS Perks for Spark Units" mod
Standard Stasis Vest


Update 6/3/16
Added partial support for Field Medic heals, since several people have asked for it.
Heals by the field medic using the "First Aid" ability will count, minus any class bonuses to healing.

Update 6/9/16
Added support for Medibot heals. ( another mod of mine, check it out )

Update 7/1/16
Added support for Spark Mech Unit self repair heals.

Update 7/18/16
Added support for Spark Mech Unit regeneration perk.

Update 3/4/17
Added configurable arrays to allow the user to add support for other mod's heals.

Update 7/6/17
Added more support for the Field Medic class. Should support all 3 heals for the class, as well as increased healing
from Aptitude.

232 Comments
SubtleAmbition 17 Mar, 2022 @ 7:12am 
I want to curbstomp the fool that thought up this mechanic. Thank you for making this mod.
Spotter 18 Sep, 2021 @ 9:01pm 
@Krj12 Commentary at least for when the game is updated, that the Mod still works. Or on what BUGS may have developed with the new game update would be a good thing. IMHO of course
krj12 (Ken)  [author] 18 Sep, 2021 @ 8:58pm 
Um, no, unless I get overwhelming feedback that the mod no longer functions, I will not be removing it. Otherwise, not sure what updates you think are needed.
Spotter 18 Sep, 2021 @ 6:10pm 
**Nope KR I'm playing the original X2 for now. ***Maybe the mod should just be removed if it's not updated after 2 or 3 years?***
krj12 (Ken)  [author] 17 Sep, 2021 @ 7:36pm 
No, I'm not actively playing the game at this time. There is a WOTC version if that's what you're looking for.
Spotter 17 Sep, 2021 @ 5:30pm 
Any updates for this forthcoming?
sebalokoshoon98 9 Jul, 2020 @ 2:57pm 
Ok, thanks :), and take this just as a suggestion, but you should edit the part where you explain how it works, because some dumb people (like me), could get confuse and spend almost an hour modifying the file once and then again and again and again because they may have understood that they had to edit something in that specific file to make it work properly instead of read the latest comments or better yet, just ask you directly how it to make this work
krj12 (Ken)  [author] 9 Jul, 2020 @ 12:59pm 
No, it wont fully work unless the mod is active at the beginning of a mission. It has to parallel what the game is doing as far as damage taken per unit.
sebalokoshoon98 9 Jul, 2020 @ 8:00am 
So, i dont have to change anything on the XComMakeHealsPersist.ini file?? I was confused because of what your description said about the configuration, btw, i activated this mod in the middle of a mission, that still has something to do about this mod?? Beacuse my wounded soldiers were still wounded after the mission ended, even if i got them fully recovered before finishing the mission
krj12 (Ken)  [author] 9 Jul, 2020 @ 5:40am 
you dont have to manipulate anything unless you have another mod which performs some kind of heal.