attack() method added to warrior class