Added onteam and onsameteam conditions