preliminary work to unify combat function

- trying to make attack one function for both player and monster without
too much code duplication

For now I just generalized the monster function code