Combat improvements flee attack of opportunity
First commit: Adds an attack of opportunity for the opponent. Renamed cardinal move functions (ie: MoveEast) to 'AttemptMoveEast'. This better reflects the ability to trigger these functions even when they are not currently valid (ie: using WASD to move). They now all call MoveTo(x, y). GameSession.MoveTo calls Battle.PlayerAttemptToEscapeCombat(), which raises a message and provides an attack of opportunity to enemy, which can be expanded on in the future (preventing flee based on enemy or debuff, percentage chance to flee, etc).
Second commit: There is now a 2/3 chance to spawn a new monster on opponent death. Removed an unnecessary call to Battle.Dispose() I added in GameSession.MoveTo() on the first commit.
I spent the last few days following the series through Lesson 17 hand-typed, in my own copy of the project, which had unit testing. I am embarrassingly new to committing to open-source projects, but I do not see the unit tests on my fork of the master project. I would be happy to update testing for my commit(s), which the 'How to Contribute' says is required. Please advise me on how to view the current testing code in my project. I am using Github desktop.
Thanks @JBillsDev !
I'll look over the pull request a bit more this week. Since the source code is tied to the lessons, I'd probably need to create a new lesson explaining the change, before merging it.
The unit tests were removed in a subsequent lesson when I added a significant change, and I never got around to adding new tests (real life got in the way). I made a note to myself to check over the contribution guide and update it.
No rush from me whatsoever, was just fun to finally find a project I was confident enough to try committing to.
I completely understand if my code is not up-to-snuff or you do not care for the direction(s) I have taken. I am a hobbyist at best, and I have just really enjoyed your series. It had me far too eager to start my own, which I am enjoying, but I need to take a break and catch up on the rest of this project.