herp-a-derp/Corruption-of-Champions — pull request #530 by rentazilla (2014-07-16 08:03:18+00:00)
Title: Gently refactor heat and rut

This pull request adds `Player.goIntoHeat()` and `Player.goIntoRut()` methods which encapsulate the logic used to put a player into heat or rut. That includes gender and pregnancy checks, intensifying a heat or rut that's already in progress, and (optionally) outputting the messages usually used when entering heat or rut. It also adds `Creature.inHeat` and `Creature.inRut` accessors which tell you if the player is currently in heat or rut.

It does *not* in any way change how heat or rut status is stored or how CoC updates that status over time; it just adds some convenience functions for the most common things most code needs to do with heat and rut. Hopefully it won't have a terribly serious impact on the code base—it'll just replace a few long expressions or dozen-line tangles of copypasta with single, easy-to-read calls.

Most of the commits in this pull request were carefully tailored to avoid changing the behavior of any part of the game. However, the final commit, 683bd54, does change the parameters of certain heats with unusual settings. (I did this to simplify the interface of the method so it can take one general-purpose "intensity" parameter instead of four specific parameters that tweak various aspects of the heat status.) If you want to avoid that, omit that commit when merging this pull request.