depending on how many units you have you could set variables (can be string, or you use an integer for each attack type) for each unit and check for that instead.
if a unit has two different attack types you can check also the attacked unit, wether it's flying, building, etc. and then determine it by that.
it's sort of a big one time effort though