In my game, each unit has two types of HP: Hard and Soft. Soft represents the human part of the unit, while hard represents anything mechanical. For example, a regular rifleman would have 100 softHP, and 0 hardHP. Another example would be the Tank which has 100 soft and 1000 hard (subject to balancing).
Now, the problem I'm facing is the fact that it should be enough for one of these types of HPs to be =< 0 for the unit to die - a Tank can't work without its driver, and it needs its gears, nuts, and bolts to function properly.
At first I was thinking of setting the soft and hard values for a unit, but leave, for example infantry, with an undefined value for hard HP, but this becomes an issue when a weapon hurts a unit: A weapon can hurt both hard and soft. A check for undefined value also becomes an issue, as many other things can affect HP as well, thus necessitating this check to be done many places, which to me seems very redundant. Another thing I was thinking of would be to set the hard HP for infantry abnormally high, to the point where it would "never" reach 0, but this is bound to bite me at a later point, I'm sure. I could easily overcome this hurdle some other way, but I would love some fresh eyes on this, in case there are any obvious solutions that I'm missing.
Any suggestions? Pseudo-code would be appreciated.