changed onAttack to onAttacked for clarification of method