@@ -118,7 +118,7 @@ def register_entity(self, entity: Entity) -> None:
118118 elif not self .setup_done :
119119 self .initial_entities .append (entity )
120120
121- # Update player.starting_hero for Maestra of the Masquerade
121+ # Infer player class and card from " Maestra of the Masquerade" revealing herself
122122 if (
123123 entity .type == CardType .HERO and
124124 entity .tags .get (GameTag .CREATOR_DBID ) == MAESTRA_DISGUISE_DBF_ID
@@ -132,11 +132,30 @@ def register_entity(self, entity: Entity) -> None:
132132 # one.
133133 player .initial_hero_entity_id = entity .id
134134
135- # At this point we know that Maestra must be in the starting of the player,
136- # because otherwise the reveal would not happen. Manually add it to the list
137- # of starting cards
135+ # At this point we know that Maestra must be in the starting deck of the
136+ # player, because otherwise the reveal would not happen. Manually add it to
137+ # the list of starting cards
138138 player ._known_starting_card_ids .add ("SW_050" )
139139
140+ # Infer Tourists when they reveal themselves
141+ if (
142+ entity .tags .get (GameTag .ZONE ) == Zone .REMOVEDFROMGAME and
143+ entity .tags .get (GameTag .TOURIST ) == 1
144+ ):
145+ # This might be the fake Tourist that the game pops up to explain why a card was
146+ # present in the player's deck. Double-check that the card was created by the
147+ # Tourist VFX enchantment.
148+ creator_id = entity .tags .get (GameTag .CREATOR )
149+ creator = self .find_entity_by_id (creator_id ) if creator_id else None
150+ creator_is_vfx = (
151+ getattr (creator , "card_id" ) == "VAC_422e"
152+ if creator is not None else False
153+ )
154+ player = entity .controller
155+ tourist_card_id = getattr (entity , "card_id" )
156+ if creator_is_vfx and player is not None and tourist_card_id is not None :
157+ player ._known_starting_card_ids .add (tourist_card_id )
158+
140159 def reset (self ) -> None :
141160 for entity in self .entities :
142161 if entity is self :
@@ -214,15 +233,14 @@ def known_starting_deck_list(self) -> List[str]:
214233 Blade) and well-known transforms (e.g. Spellstones, Unidentified Objects, Worgens)
215234 so that the initial card id is included rather than the final card id.
216235 """
217- ret = list (self ._known_starting_card_ids )
218-
219236 original_card_ids = [
220237 get_original_card_id (entity .initial_card_id )
221238 for entity in self .initial_deck if entity .initial_card_id
222239 ]
223- ret = ret + [card_id for card_id in original_card_ids if card_id not in ret ]
224-
225- return ret
240+ return original_card_ids + [
241+ card_id for card_id in self ._known_starting_card_ids
242+ if card_id not in original_card_ids
243+ ]
226244
227245 @property
228246 def entities (self ) -> Iterator [Entity ]:
0 commit comments