Adds star trip timeout and fight condition calculation.
Some minor refactorings.