Bug - Fixed Mafia doesn't undisambiguate Shadows

zarqon

Well-known member
Went up against my shadow using a relay override for fight.php which lists all of my combat options, and the table included every attack option, most of which are useless against the shadow. So I figured I could remove all the options that don't restore HP when facing the shadow, so I did an if (last_monster() == $monster[your shadow]) check in the script.

This accomplished nothing, since according to mafia I was facing $monster[none].

It's not a particularly big deal, but it would be swell if mafia could recognize that all of the various possible shadows are just Your Shadow.

I didn't know whether to call this a "Bug" or not -- feel free to re-mark it if it should be a feature request.
 

zarqon

Well-known member
Since this is exactly the same issue, I'll add this here as well:

Basement monsters -- checking last_monster() returns $monster[none].
 

Bale

Minion
For what it is worth....


Code:
[COLOR="olive"]> ash last_monster()[/COLOR]

Returned: shadow marinara mage
base_hp => 0
base_attack => 0
base_defense => 0
base_initiative => 0
attack_element => none
defense_element => none
min_meat => 0
max_meat => 0
base_mainstat_exp => 0.0
phylum => none
poison => none

Mafia actually recognizes the shadow as a brand new monster whenever it is encountered, named according to whatever the character's level title is currently. Those shadows really should be disambiguated into a single $monster[Your Shadow] so that they can be scripted. That monster has stats according to KoLmafia, they just aren't being used. Note below:

Code:
[COLOR="olive"]> ash $monster[your shadow][/COLOR]

Returned: Your Shadow
base_hp => 400
base_attack => 150
base_defense => 135
base_initiative => 150
attack_element => none
defense_element => none
min_meat => 0
max_meat => 0
base_mainstat_exp => 100.0
phylum => none
poison => none

Basically the same problem that keeps monsters in Farnswarthy's Basement from being scriptable.
 

zarqon

Well-known member
You mean ambiguated, not disambiguated. Perhaps the "undisambiguated" in my thread title was too clever for its own good.

But yes, mafia making brand new $monsters as they are encountered doesn't change this problem -- shadows and basement monsters all need ambiguating so that a) they can be identified, and 2) they can have useful stats. I suppose the former is possible in ASH now by comparing last_monster().to_string() to a list of all 18 possible shadow names and all possible basement monster names (would need some regexes for that since the list of possible basement monster names is theoretically unlimited), but it still doesn't help with the latter.
 

Bale

Minion
Actually, if you reduced your level to 12, then there are more than 18 possible shadow names. (I don't believe the quest is removed if you reduce your mainstat.)

I was just thinking that this is probably the same problem as identifying hobos. Perhaps it would be best to check for the 12 possible monster images in the fight page. Is that how KoLmafia identifies Hobos?
 

slyz

Developer
For Hobos, Mafia checks the ID of your last adventure location and picks a name depending on that, in AdventureRequest.translateGenericType(). That's where slimes and sorority monsters are undisambiguated too.

It seems to only work for snarfblat locations, though.
 

Bale

Minion
Then if you run into a romantic monster or a Feast of Boris monster in Hobopolis, mafia will assume it encountered a Hobo? Well, that's a pretty minor bug. That does explain why the same solution would not work for your shadow and basement monsters.
 

Veracity

Developer
Staff member
Since this is exactly the same issue, I'll add this here as well.
Please don't EVER do this. Just because YOU think it is "exactly the same issue" does not mean that fixing one issue will fix the other issue.

In particular, revision 10232 adds 90 lines - 15 class levels for each of 6 classes - to a data file and should (untested) translate all "Shadow xxx" to "Your Shadow".

Since it is "exactly the same issue", that change OBVIOUSLY fixed the basement monsters, too, right?
Not.

So, maybe it's NOT "exactly the same issue".
 

Veracity

Developer
Staff member
FWIW, Revision 10233 should turn "The beast with 1056 Eyes" (and all other numbers of eyes ) into "the beast with n eyes" (which is in $monsters), and similarly for all the basement monsters.

The fix was completely different and unrelated to what needed to be done for the shadows.
 

zarqon

Well-known member
Though wrapped and presented as to a dim-witted child, the gift itself was much appreciated. Thank you.
 
Top