clean up/remove a ton of includes, especially of types.h (include in header if you need it, not in every .c file).
rules should be in their own modules. here: upkeep is a concept all by itself, should have its own tests, etc. movement code should be in move.c. cleaning up some superfluous include directives.