Hi Rongyos,
I don't know if I understand your question exactly, but I will try to explain this bit of code and maybe that will help you.
First of all, if we reach the code you have posted, we already know that we have received a cannon hit (not a machine gun hit).
By this point we have also already calculated our new damage percentage based on this cannon hit. All that has come before this code.
Now, in the code you posted, we have the first part of the "if" statement: if (DamagePct >= 100.0)
This means that we've added up all our damage and it's equal to or over 100%, therefore the tank is "destroyed" and must be disabled.
The second part of the "if" statement is the "else" condition: else we have been hit, and our damage has increased, but we are not yet destroyed (in other words, damage is less than 100%).
In that case we flash the LEDs in the apple that indicate a hit was received. We also enable an invulnerability timer, but only a very brief one. This is simply to prevent receiving multiple hits from a single shot of someone's cannon. As you know, the Tamiya signal lasts for a full second - that would be enough time for us to register many hits if we didn't have this brief timer.
I hope that helps!