king.target & king.target_cell
mohamad-shadfar opened this issue · comments
Hi
I printed the "target" of king and "target_cell" of the king but "target_cell" returns None and "target" returns the cell of attacking by the king.
the point is in the document you said that "target_cell" returns cell of the target that gets attack by the king but in code, "target" returns the cell the gets attack by the king.
a = world.get_king_by_id(world.get_me().player_id)
print("playerid of king is : ", a.player_id )
print("hp of king is : ", a.hp)
print("center of king is : ", a.center)
print("attack of king is : ", a.attack )
print("range of king is : ", a.range )
print("is_alive of king is : ", a.is_alive )
print("target of king is : ", a.target )
print("target cell of king is : ", a.target_cell)
turn started: 49
playerid of king is : 0
hp of king is : 7
center of king is : <Cell | (2, 2)>
attack of king is : 10
range of king is : 6
is_alive of king is : True
target of king is : 41
target cell of king is : None
turn started: 50
playerid of king is : 0
hp of king is : -1
center of king is : <Cell | (2, 2)>
attack of king is : 10
range of king is : 6
is_alive of king is : True
target of king is : None
target cell of king is : None
When a king dies, these fields won't be valid.
We'll add this to the documentation. Thanks for your consideration.