From fb5735d5b94d5ea9e014e360a5f33991daaadc34 Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Sat, 1 Apr 2023 12:21:42 -0700 Subject: [PATCH] Multiple actions per turn Allow a pattern of multiple actions per turn. Card options can "refund" an action to the player if they should be free, or zero out the remaining actions if they should force the turn to go directly to the simulation step. --- cardsim/player.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/cardsim/player.go b/cardsim/player.go index f487f41..169c328 100644 --- a/cardsim/player.go +++ b/cardsim/player.go @@ -4,13 +4,16 @@ import "math/rand" // Player stores all gameplay state for one player. type Player[C StatsCollection] struct { - Stats C - Name string - Deck *Deck[C] - Hand []Card[C] - HandLimit int - Rules *RuleCollection[C] - Rand rand.Rand - Turn int - PendingMessages []Message + Stats C + Name string + Deck *Deck[C] + Hand []Card[C] + HandLimit int + ActionsPerTurn int + ActionsRemaining int + PermanentActions []Card[C] + Rules *RuleCollection[C] + Rand rand.Rand + Turn int + PendingMessages []Message }