Another modbug.
When I am using abilities from troops, like skills, I use the defendabledamage. For example, the modifier below should hit for damage equal to 1 per Troopcount in fire damage.
<GameModifier>
<ModType>Unit</ModType>
<Attribute>DefendableDamage</Attribute>
<AttackStat>UnitStat_Attack_Fire</AttackStat>
<Calculate InternalName="Calc" ValueOwner="CastingUnit">
<Expression><![CDATA[[Unit_GetTroopCount]]]></Expression>
</Calculate>
<Calculate InternalName="Value">
<Expression><![CDATA[[Calc]]]></Expression>
</Calculate>
</GameModifier>
But for some reason, the Unit_GetTroopCount does NOT function inside this gamemodifier. The returned value from Unit_GetTroopCount (castingunit) is ALWAYS one. The expected behaviour is that the Unit_GetTroopCount properly reads the troopcount from the casting unit.
This one is actually very bad for us modders, because it makes it difficult to add unique skills to our troops, such as special strikes.
Observed in 0.77 beta.
Edit: Just so we're clear, I do understand how defendabledamage works. And I understand that if I attack a target with no fire resistance with a 9-troopcount unit, this ability should deal 4-9 damage. It ALWAYS deals 1 damage.