Feature Expand on item_drops_array($monster) or add new function

Irrat

Member
The function item_drops_array(monster) currently works as described here: https://wiki.kolmafia.us/index.php?title=Item_drops_array

We can expand it, and probably should in some manner, because it misses a lot of the nuance that this sheet covers pretty well: https://docs.google.com/spreadsheets/d/1ingSBR8Hrqh3c7M92HP-iB92H4CUnzS8_-fO_9ZIjgo/edit?gid=306313165#gid=306313165

Stuff like a drop being both a quest drop and not pickpocketable, or it being a fake drop where you have to kill the monster directly (Sword of Swords familiar not getting the drop), for example. Currently, that information isn't exposed. Mafia might claim something is always a conditional drop, or always a pickpocketable drop, but the function doesn't expose situations where both are true.

Maybe, in addition to that, item_drops_array could be expanded so that it doesn't have a completely static return value. For example, items that only drop while their condition is currently met could be reflected as relevant. That way, you could see what drops are actually obtainable at this moment. I'm mainly referring to things like quest items here.

The current function doesn't seem like it can easily be changed without breaking existing scripts. One possible modification would be to have it return a string containing all relevant characters instead of a single character. That would, however, break scripts that rely on equality checks rather than contains_string(). For example, returning PC instead of just C.

If a new function were added instead, maybe it could return a map with string keys and boolean values?

I'm not too sure how much data from the sheet actually needs to be added or exposed. The data there is dense and complicated enough that I'm unsure how much of it can fit into KoLmafia's current framework without broader changes, for example, needing to flag particular skills or trackers.

I'm unsure because the current function would effectively be defunct with a new function.
 
Last edited:
Back
Top