Wow. That was some seriously ugly hacking I just did, but I got some useful results.
I bet it would be easier and cleaner in ASH.
There's a monster with a raw defense of 21. The manual lists that as floor(21*.9), which is 18. ceil(18/.9) is 20 instead of 21. Information is lost.
Really? How do you know the raw defense is 21?
My experience, from looking at hundreds of examples, is that the Manuel displays ceil, not floor. If the Manuel says it is 18, then, by golly, the "raw defense" is 20, not 21. If our data file says it is 21, our data is wrong.
I the end, I kept everything as 90% until the final output, then I convert. If the conversion is unclear, I output both numbers. It's ugly.
I will look at and incorporate your data.
As you probably know, the MM doesn't worry about duplicate names, while monsters.txt tries to have unique names. Also, monsters.txt sometimes includes articles (a, an, the, some) when Manuel doesn't. I managed to ignore those articles.
Ah, yes. We have different names for the Orcish Frat Boys, the Ninja Snowmen, and so on.
Regarding the articles - we may want to include the articles only when KoL itself includes them. We used to always ignore them, but it annoyed me when I was fighting "The Man" and my session log kept saying "Man does 10 damage" or what have you. So, I retained them for monsters that seemed to be unique entities - like constellations, which, strangely, KoL does NOT name that way.
Removing the articles, as appropriate, from monsters.txt at this time might break some scripts...
I skipped some monsters with duplicate names, because my code doesn't handle that well. (nightstands, nemesis forms, protectors, etc)
I have the nightstands.
We should have all 3 nemesis forms in the data files, anyway, since they are effectively different monsters. We can distinguish them by which location they appear in, if not by the image. There may be a bug report about that.
There is a feature request for the protectors. The problem is that they all have the same image and the same location.
Now that I know what to do, I really should try doing it in ash, so other can run it.
I would recommend this. I bet it would be a lot easier, too: Look up each Manuel page of the quest log in turn, iterate over it with a regexp, look up the monster using to_monster( string ), compare the data using monster_attack( monster), monster_defense( monster), and monster_hp( monster), and output a data line if it's different - or if the monster is not present in KoLmafia's database.