@@ -166,7 +166,8 @@ def test_initial_deck_with_sideboard_cards_shuffled_in_at_start_of_game(
166166 ):
167167 # Commander Beatrix shuffles 10 copies of her sideboard card into the deck
168168 # during CREATE_GAME, before the game is set up. The card was picked during
169- # deckbuilding, so the copies are part of the submitted deck list.
169+ # deckbuilding, so the copies are part of the submitted deck list. She reveals
170+ # herself first, which is what lets us recognise her as the creator.
170171 beatrix = Card (5 , None )
171172 beatrix .tags .update ({
172173 GameTag .ZONE : Zone .DECK ,
@@ -203,6 +204,41 @@ def test_initial_deck_with_sideboard_cards_shuffled_in_at_start_of_game(
203204 assert list (player .initial_deck ) == [beatrix , copy ]
204205 assert player .known_starting_deck_list == ["JAIL_397" , "CS2_231" ]
205206
207+ def test_initial_deck_with_unlisted_sideboard_card_creating_during_setup (
208+ self , game , player
209+ ):
210+ # Only the sideboards we know join the deck at the start of the game count. Having
211+ # a sideboard is not enough on its own: a card that creates something in the deck
212+ # during setup for any other reason must not have it counted as a deck card, which
213+ # is why START_OF_GAME_SIDEBOARD_CARDS is an explicit list.
214+ etc = Card (5 , None )
215+ etc .tags .update ({
216+ GameTag .ZONE : Zone .DECK ,
217+ GameTag .CONTROLLER : player .player_id ,
218+ })
219+ game .register_entity (etc )
220+ etc .reveal ("ETC_080" , {
221+ GameTag .CARDTYPE : CardType .MINION ,
222+ GameTag .MAX_SIDEBOARD_CARDS : 3 ,
223+ })
224+
225+ generated = Card (6 , None )
226+ generated .tags .update ({
227+ GameTag .ZONE : Zone .DECK ,
228+ GameTag .CONTROLLER : player .player_id ,
229+ })
230+ game .register_entity (generated )
231+ generated .tag_change (GameTag .DISPLAYED_CREATOR , etc .id )
232+ generated .reveal ("CS2_231" , {
233+ GameTag .CARDTYPE : CardType .MINION ,
234+ GameTag .CREATOR : etc .id ,
235+ GameTag .DISPLAYED_CREATOR : etc .id ,
236+ })
237+
238+ assert not generated .is_original_entity
239+ assert generated .initial_card_id is None
240+ assert list (player .initial_deck ) == [etc ]
241+
206242 def test_initial_deck_with_sideboard_cards_created_after_setup (self , game , player ):
207243 # E.T.C., Band Manager also has a sideboard, but its cards are created once it is
208244 # played, long after setup. Those are not deck cards.
0 commit comments