A foreach loop might be the piece you're missing:
for ship in ships:
if ship.active:
return
reset_turn() --> for ship in ships: ship.active = true
altho for your use case I would have a copy of the ships array named ships_active and pop them until ships_active.empty()
at the start of the iteration:
var ships_active = ships_array
and then next_ship_to_play = ships_active.pop_back() or something like that depending on your context
anyway everything depends 🙂