Bug Dreadsylvanian skeleton issues

Veracity

Developer
Staff member
I've been struggling to get skeletons to log correctly in the session log and be decorated correctly in the Relay Browser.

Here is how KoL works for everything except skeletons:

Standard KoL fight page has a 'monname' span around the name of the monster.
Haiku fight page does not have that.
Standard KoL fight page marks up the monster's name in bold.

Here's how KoLmafia uses the above:

The Encounter: line in the session log has the name of the monster - that part which is bold.
We use the name as the monster 'type' - unless it's a generic monster, in which case we translate it based on image.
If the monster is Elemental, color the name - and only the name - in the appropriate color

Every monster in Dreadsylvania works like the above - except for the skeletons.

Skeletons are named "Prisoner XXX: name including nickname"
Skeletons have additional lines for Sentence: and Crime:
Every kind of skeleton - except the Hot Skeleton - has a 'monname' span.
The Hot Skeleton does not have that span.
Skeletons with the 'monname' span wrap said span around all three lines - Prisoner X:, Sentence:, and Crime:
On the first line, "Prisoner X:" is bold but the name with nickname is not bold.

KoLmafia has the following issues trying to deal with all that:

- The "name" pulled out for the Encounter: line in the session log is merely "Prisoner X" - since that is the first bold part. The rest of the name (and nickname) is not only not bold, it has other markup.
- We now insert a 'monname' span to duplicate KoL's for the Hot Skeleton. But, since we use the beginning and end of the span to decide what to color - we insert a "class=elementX" into the span directive - all three lines - Name, Sentence, and Crime - end up getting colored for all elemental skeletons.

In the ideal world, we'd have this:

- In the session log - Encounter: Prisoner XXX first "nickname" last
- The whole name - and only the name - gets colored appropriately
 
KoL itself has done some work on this since I wrote this. It appears that every monster - even haiku monsters - now has a <span id='monname'> wrapping the name. Skeletons continue to have a unique 3-line "name" (Prisoner, Sentence, and Crime) with line breaks - and then a <span id="monname" style="display:none">cold skeleton</span> telling you what kind of monster it is. Interestingly, the other kinds of Dreadsylvanian monsters do not have that extra span.

In any case, when looking for encounters, there are now exactly two patterns to look for: Dreadsylvanian skeletons and everything else.

Revision 12489 looks for those two patterns (in the opposite order) and successfully extracts the whole "Prisoner XXX: first "nickname" last" for skeletons to log in the session log.

That's half of what I want. The rest would be coloring the name - and only the name - of skeletons with the appropriate elemental color. Therefore, I leave this open for now.
 
Back
Top