move doAttack to agent.py