Possible to make units regenerate HP in a city by a percentage?
Is it possible to have a unit regenerate their health when stationed in a city by a percentage, rather than a set number? I am looking into the code right now to see if it is possible. I have been able to make a spell which gives HP back by a percentage but I am not sure exactly how to make units regen hp by a percentage while stationed in a town. I have put in some code but not tested it yet, curious if anyone has figured this out.
Also, is it possible to get the regen tactical or strategic spell to regen by a percentage rather then a set number? Have only looked into it briefly but I am not sure if it is possible.
Actually, now that I think about it, maybe like this for tactical regen:
<GameModifier>
<ModType>Unit</ModType>
<Attribute>CurHealth</Attribute>
<PerTurn>1</PerTurn>
<Calculate InternalName="Calc" ValueOwner="TargetUnit">
<Expression><![CDATA[[Unit_GetHPCurrent] * .25]]></Expression>
</Calculate>
<Calculate InternalName="Value">
<Expression><![CDATA[[Calc]]]></Expression>
</Calculate>
<Calculate InternalName="ValueForFormattedDescription">
<Expression><![CDATA[[Calc]]]></Expression>
</Calculate>
</GameModifier>