Add debug instrumentation to weapons_lib.py (used when buying ships).