Control for semi- and fully-autonomous ships is a broad and complex field. Making autonomous high-level decisions in place of the captain is considered difficult, partly due to the risks and uncertainties involved. Though human operators located in onshore control centers are still needed for safety and regulatory reasons, there is a growing demand for complex decisions to be made by the onboard control system itself, both during normal operations and extraordinary circumstances. Model predictive control (MPC) is a promising approach to tackle this problem. In this paper, a dynamic risk-based decision-making algorithm is constructed through the use of heuristic objectives, capable of planning suitable vessel trajectories in emergency situations. Nonlinear programming using the direct multiple-shooting method implemented with the CasADi framework is considered, and the resulting control performance of several emergency scenarios is analyzed using simulation. The developed algorithm proved capable of both generating suitable trajectories below a certain risk threshold, and to engage the safety systems appropriately. It is concluded that MPC with independent risk cost terms is a promising method for autonomous ship trajectory planning and emergency management.