The goal of the Kata is to refactor some legacy code which is a little bit messy. In order to properly do the refactor, you will have to create unit tests, of course 😉. If you prefer, you can use the branch 'with_tests' and go straight to the refactoring.
The kata topic is inspired in Dungeons and Dragons role game. In that game, whenever a character tries to hurt another one, there's a dice roll and some calculations which take into account the attack and defense skills of the characters involved. As you can imagine, this is just an excuse to toy around with the code, so don't expect 100% fidelity between the game and the code.
In “Working Effectively with Legacy Code” Michael C. Feathers talks about “Extract and Override”. Also Roy Osherove talks about it in the book “Art of Unit Testing“. An alternative is "Peel" or "Slice" as described by Llewellyn Falco, for example in Using ApprovalTests in .Net 14 Peel and Slice.
This exercise was originally designed by Xavi Ametller.