@@ -297,14 +297,14 @@ def is_playable(self):
297297 return False
298298 return True
299299
300- def play (self , target = None , choose = None ):
300+ def play (self , target = None , index = None , choose = None ):
301301 """
302302 Queue a Play action on the card.
303303 """
304304 if choose :
305305 # This is a helper so we can do keeper.play(choose=id)
306306 # instead of having to mess with keeper.choose_cards.filter(...)
307- return self .choose_cards .filter (id = choose )[0 ].play (target = target )
307+ return self .choose_cards .filter (id = choose )[0 ].play (target = target , index = index )
308308 if self .has_target ():
309309 if not target :
310310 raise InvalidAction ("%r requires a target to play." % (self ))
@@ -314,7 +314,7 @@ def play(self, target=None, choose=None):
314314 raise InvalidAction ("Do not play %r! Play one of its Choose Cards instead" % (self ))
315315 if not self .is_playable ():
316316 raise InvalidAction ("%r isn't playable." % (self ))
317- self .game .queue_actions (self .controller , [Play (self , target )])
317+ self .game .queue_actions (self .controller , [Play (self , target , index )])
318318 return self
319319
320320 def shuffle_into_deck (self ):
@@ -547,6 +547,7 @@ def __init__(self, data):
547547 self .enrage = False
548548 self .poisonous = False
549549 self .silenced = False
550+ self ._summon_index = None
550551 super ().__init__ (data )
551552
552553 @property
@@ -603,7 +604,10 @@ def update_scripts(self):
603604
604605 def _set_zone (self , value ):
605606 if value == Zone .PLAY :
606- self .controller .field .append (self )
607+ if self ._summon_index is not None :
608+ self .controller .field .insert (self ._summon_index , self )
609+ else :
610+ self .controller .field .append (self )
607611
608612 if self .zone == Zone .PLAY :
609613 self .log ("%r is removed from the field" , self )
0 commit comments