first attempt at the combat function. little clunky, but works well overall. main issue is that it does not deal with range