Skip to content

Commit a54a631

Browse files
committed
Revert "Merge branch 'Quickchat-kickoffs' into master"
This reverts commit a13f764, reversing changes made to f507f82.
1 parent a13f764 commit a54a631

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

FormularBot.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,7 @@
1616

1717

1818
class FormularBot(GoslingAgent):
19-
#Responds to quickchats receieved from other players
20-
global ally_taking_kickoff
21-
def handle_quick_chat(self, index, team, quick_chat):
22-
try:
23-
a = ally_taking_kickoff
24-
except:
25-
ally_taking_kickoff = 'False'
26-
if team == self.team:
27-
if self.kickoff_flag:
28-
if quick_chat == QuickChats.Information_IGotIt and ally_taking_kickoff != True:
29-
self.send_quick_chat(QuickChats.CHAT_TEAM_ONLY, QuickChats.Information_Defending)
30-
ally_taking_kickoff = True
31-
if quick_chat == QuickChats.Information_Defending:
32-
self.send_quick_chat(QuickChats.CHAT_TEAM_ONLY, QuickChats.Information_IGotIt)
33-
ally_taking_kickoff = False
34-
else:
35-
print('ignoring message from other team')
3619
def run(agent):
37-
if agent.kickoff_finished:
38-
ally_taking_kickoff = 'False'
39-
try:
40-
a = ally_taking_kickoff
41-
except:
42-
ally_taking_kickoff = 'False'
43-
4420
global stack
4521
distance_ball_friendly_goal = (agent.ball.location - agent.friend_goal.location).magnitude()
4622
distance_ball_foe_goal = (agent.ball.location - agent.foe_goal.location).magnitude()
@@ -84,7 +60,7 @@ def run(agent):
8460
closest_ally_friendly_goal_distance = ally_to_friendly_goal_distance
8561

8662
closest_to_ball = distance_to_ball < closest_ally_to_ball_distance
87-
joint_closest_to_ball = round(distance_to_ball) == round(closest_ally_to_ball_distance)
63+
joint_closest_to_ball = distance_to_ball == closest_ally_to_ball_distance
8864
closest_to_friendly_goal = distance_to_friendly_goal <= closest_ally_friendly_goal_distance
8965

9066
#Works out kickoff position and passes that variable onto kickoff function in routines
@@ -114,7 +90,6 @@ def run(agent):
11490
else:
11591
goalie = False
11692

117-
11893
#Only go for kickoff if closest or joint closest and on left side
11994
if agent.kickoff_flag and (closest_to_ball or (joint_closest_to_ball and (kickoff_position == 'diagonal_left' or kickoff_position == 'back_left'))):
12095
go_for_kickoff = True

0 commit comments

Comments
 (0)