forked from s464965/WMICraft
Merge pull request 'fixed hp directions' (#26) from code_fix into master
Reviewed-on: s464965/WMICraft#26
This commit is contained in:
commit
4d88b300ae
@ -47,7 +47,7 @@ class DecisionTree:
|
|||||||
opponents_parsed = []
|
opponents_parsed = []
|
||||||
for opponent in opponents:
|
for opponent in opponents:
|
||||||
opponents_parsed.append(
|
opponents_parsed.append(
|
||||||
(manhattan_distance(current_knight.position, opponent.position), parse_hp(opponent.current_hp)))
|
(manhattan_distance(current_knight.position, opponent.position), parse_hp(opponent.health_bar.current_hp)))
|
||||||
|
|
||||||
prediction = self.get_prediction(tower_dist=distance_to_castle, tower_hp=castle.current_hp,
|
prediction = self.get_prediction(tower_dist=distance_to_castle, tower_hp=castle.current_hp,
|
||||||
mob1_dist=monsters_parsed[0][0], mob1_hp=monsters_parsed[0][1],
|
mob1_dist=monsters_parsed[0][0], mob1_hp=monsters_parsed[0][1],
|
||||||
@ -56,7 +56,7 @@ class DecisionTree:
|
|||||||
opp2_dist=opponents_parsed[1][0], opp2_hp=opponents_parsed[1][1],
|
opp2_dist=opponents_parsed[1][0], opp2_hp=opponents_parsed[1][1],
|
||||||
opp3_dist=opponents_parsed[2][0], opp3_hp=opponents_parsed[2][1],
|
opp3_dist=opponents_parsed[2][0], opp3_hp=opponents_parsed[2][1],
|
||||||
opp4_dist=opponents_parsed[3][0], opp4_hp=opponents_parsed[3][1],
|
opp4_dist=opponents_parsed[3][0], opp4_hp=opponents_parsed[3][1],
|
||||||
agent_hp=current_knight.current_hp)
|
agent_hp=current_knight.health_bar.current_hp)
|
||||||
print(prediction)
|
print(prediction)
|
||||||
if prediction == 'tower': # castle...
|
if prediction == 'tower': # castle...
|
||||||
return castle_neighbors(grid, castle_bottom_right_row=castle.position[0],
|
return castle_neighbors(grid, castle_bottom_right_row=castle.position[0],
|
||||||
|
Loading…
Reference in New Issue
Block a user