Exotrireme II Ability Order

Hypothetical scenario: A N'Orr Exotrireme II enters a system and fights three other ships. Those ships produce enough hits to destroy the Exotrireme, and for the sake of argument we'll say the Exotrireme doesn't hit. Does the Exotrireme II ability to sacrifice itself to destroy two opposing ships happen BEFORE hits are assigned? Does it work in the same order as, say, Sustained Damage?