AI item count function, additional log output

This allows AI units to try to conserve items without having to track
their own item usage.  Also fixed an issue in RSB II P2 where Robert
could end up doing heavy damage to himself with Tonics if he ran out of
Holy Water to cure repeated Zombie inflictions.