Bug How should KoLMafia consider Eternity Codpiece slots for 'have_equipped' and 'equipped_amount'

Irrat

Member
So here's a puzzle.
You are wearing BCZ in a codpiece slot. Currently kolmafia does not make a distinction between the codpiece being equipped or not, when considering the codpiece gems. It's all equipped according to mafia.
So, have_equipped, equipped_amount and conditional skills that rely on an item being equipped. All of them will report the same regardless if you're wearing codpiece or not. Yes, you have it equipped.

That's obviously a bug, especially in regards to the conditional skills. You do not actually have those skills available in combat. Which, I muse, should also take into account if you have the stats to cast the skills, but that's a distraction...

The question is, if an item is equipped in a codpiece slot but the codpiece is not worn. Should kolmafia report that item for equipped_amount?
Maybe, overload equipped_amount(item, boolean includeAllFamiliars) to boolean includeAllFamiliarsAndSlots?

Just a bit unsure because existing codebases may not account for "does this item exist for the player" as the larger thought.

Like, there's obviously a bug here already to address, just not sure if while addressing that bug, we can safely claim that every codpiece gem is no longer equipped (and thus not in an equipment slot) when the codpiece is not equipped.

I'm personally of the opinion that changing have_equipped to return false when the codpiece is not worn, is fairly safe. And to another extent, we should report 0 for equipped_amount. And leading from there, we should overload includeAllFamiliars to includeAllFamiliarsAndSlots and change it to apply to other equipment, such as folder and card sleeve, that have slots that are transient.

Opening this as a thread because it seems a bit large of a change to make as a PR, without discussing it first.
 
Back
Top