Influences of habitat distribution and maternal investment on settlement of lecithotrophic larvae: modelling an ecological transition