The functions for executing ship abilities share common logic. There might be a smart way to reduce code duplication.