Cooperative games in a stochastic environment