@@ -0,0 +1,1214 @@
+import standard_play%0Aimport behavior%0Aimport skills%0Aimport main%0A%0A## Simplistic play to handle defend clear situation%0A#  Mimicks basic122 offense. One pivot kick and two marking robots%0A#%0Aclass DefendClear(standard_play.StandardPlay):%0A    %0A    def __init__(self, num_supports=2):%0A        super().__init__(continuous=False)%0A%0A        self.add_transition(behavior.Behavior.State.start,%0A                            behavior.Behavior.State.running, lambda: True,%0A                            'Immediately transition to running')%0A%0A        best_opps_to_mark = self.closest_opps_to_our_goal(num_supports)%0A        self.add_subbehavior(skills.pivot_kick.PivotKick(), 'main')%0A        for i in range(num_supports):%0A            mark_skill = skills.mark.Mark()%0A            mark_skill.mark_robot = best_opps_to_mark%5Bi%5D%0A            self.add_subbehavior(mark_skill, 'mark' + str(i))%0A%0A    ## Returns the robots that are closest to our goal%0A    #%0A    # @param num_bots number of robots to return%0A    # @returns bots closest num_bots opponent robots to our goal%0A    def closest_opps_to_our_goal(self, num_bots):%0A        opp_bots = %5Bbot for bot in main.their_robots()%5D%0A        return sorted(opp_bots, key=lambda bot: bot.pos.y)%5B:num_bots%5D%0A

add defend clear