Put throwRandomEvent() into its own function.