# Reaction direction change based on phase of reactants and products

I am curious specifically how the entropy of a reaction will change if the phases of the reactants and products at different conditions change.

For instance, a reaction

$$\ce{O2(g) + C(s) -> CO2(g)}$$

has a positive entropy because there is no net change in the moles of gas in the system and the product is more complex in its degrees of freedom (secondary). If one were to change the conditions (temperature and pressure) such that oxygen is a gas but $\ce{CO2}$ is a liquid or solid, would the change in entropy for the system become negative?

$$\ce{O2(g) + C(s) -> CO2(l)}$$ Or $$\ce{O2(g) + C(s) -> CO2(s)}$$

If the $\Delta H$ is still negative but the $\Delta S$ is now positive, isn't the Gibbs energy now able to be positive or negative, making this a valid method of manipulating the directionality of a given reaction?