The main change is for pirates cards "penalty" to be marking players who lost to the pirates in the database as having lost (column card_action_choice). Then, when the pirates have been defeated or all players have faced them, the hazards are applied to players who lost. A new card method finishCard allows pirates to shift to the penalty phase and all other cards to draw the next card.
I was also able to combine the code for applying hazards from both meteors and pirates. The meteors is done similarly to how the pirates was accomplished - by setting the card_action_choice of all players still in flight to "lost".
The main change is for pirates cards "penalty" to be marking players who lost to the pirates in the database as having lost (column
card_action_choice
). Then, when the pirates have been defeated or all players have faced them, the hazards are applied to players who lost. A new card methodfinishCard
allows pirates to shift to the penalty phase and all other cards to draw the next card.I was also able to combine the code for applying hazards from both meteors and pirates. The meteors is done similarly to how the pirates was accomplished - by setting the
card_action_choice
of all players still in flight to "lost".