Kubikiri still not 100% fixed?

Post Reply
DerAva
Posts: 94
Joined: Thu Jan 19, 2017 8:46 am

Kubikiri still not 100% fixed?

Post by DerAva »

Took a Kubikiri shot as the 2nd shot in a DoubleTap action. Critical hit the enemy, did not get a kill.

Here's the whole thing on video, starting with the 1st DT shot:

https://youtu.be/oIEi8xcNTJQ?t=8m8s

LW2 1.3 -> 1.4
Win10

Mod list in video description. Have used Kubikiri several times this campaign to satisfying effect, first time it failed. Can't i I've used it as the 2nd shot in a DT action yet, though.. Can't provide a savegame.
DerAva
Posts: 94
Joined: Thu Jan 19, 2017 8:46 am

Re: Kubikiri still not 100% fixed?

Post by DerAva »

Just adding a post from RealityMachina here who was looking at that situation:
Oh man looking at the Sectopod's HP, I think you got boned by the fact that the game treats HP as a float value instead of an integer as one might think.

(For those unfamiliar with how the game works, basically this means HP is represented as say, 100.000000000 points instead of just 100 points.)

if (TargetUnit.GetCurrentStat(eStat_HP) <= TargetUnit.GetMaxStat(eStat_HP) * class'X2Ability_PerkPackAbilitySet'.default.KUBIKURI_MAX_HP_PCT / 100)

The above is the code LW2/LWPP does for Kubikuri. By default, MAX_HP_PCT is 99. From experience, XCOM 2 will treat a float multiplied by an integer as still a float.

The Sectopod had 102 HP.

103 * 99 is 101.97.

Literally one more point of damage earlier and it would've been a kill.

edit: actually with how XCOM 2 tends to round down with integers, you would've been still screwed out of a kill shot anyway even if the HP values were casted to ints first.
nmkaplan
Posts: 207
Joined: Thu Jan 26, 2017 5:14 pm

Re: Kubikiri still not 100% fixed?

Post by nmkaplan »

Wow, ok, so currently the remaining HP has to be at most 99% of total HP to trigger the "executed" effect, which only comes into play when you have enemies with >100hp
Post Reply