Well, isMultiUsable looks (mostly) good:
MULTIPLE, HP_RESTORE, MP_RESTORE, and HPMP_RESTORE are assumed to be multiple - unless explicitly given the USABLE attribute. (I'll note that it makes no sense for a MULTIPLE item to be given that attribute; it was intended for the restores.)
Anything else CAN be multiusable - if it is given the MULTIPLE attribute. So, probably this:
Code:
switch ( useType )
{
case KoLConstants.CONSUME_MULTIPLE:
return true;
case KoLConstants.HP_RESTORE:
case KoLConstants.MP_RESTORE:
case KoLConstants.HPMP_RESTORE:
return ( attributes & ItemDatabase.ATTR_USABLE ) == 0;
default:
return ( attributes & ItemDatabase.ATTR_MULTIPLE ) != 0;
}
We could go either way in whether restores should be multi-usable by default.
- if we say "yes", we will get a bug report when a user tries to multi-use one and it doesn't work. We will also be told by the new "relstring" code that we have it wrong.
- If we say "no", we will get a bug report when a user tries to use several of them and complains that KoLmafia is using them one at a time. Again, the new "relstring" code will tell us that we have it wrong.
The so-called "good reasons" I had for assuming restoratives were multi-usable was that we'll get bug reports whichever way we go, but most of them are multiusable, so we'll get fewer bug reports that way.
The "good reason" to go the other way is that single-using a multi-usable thing works, whereas multi-using a single-use thing does not. So, I might have made the wrong decision.
Similarly, we used to get lots of bug reports of the latter sort when we assumed that "potions" or "candy" things were multi-usable - because the large majority of them are - and people ran in to the occasional ones that were not. Now, when we see a new potion, unless we can test it right away - by looking at the inventory page - we enter them in as "usable" and change them later.
That is the thing, though - we don't automatically mark an item as "hp", "mp", or "hpmp". We initially enter tham as "usable" and then change them to be restoratives - and we could/should check at that time whether they are single or multiusable, and if the default is multi, enter them as, say, "hp,usable".
Well, isMultiUsable should be (slightly) changed as I listed above. We'll have to decide if we want to remove the "restoratives are multi-usable" default - and then add "multiple" to all of the ones that currently are. I'm inclined to not do that and just assume the dev who marks restoratives as such in items.txt will mark them as single usable, as I mentioned, if they are not multiusable.
Huh. I should just make the "log new items using relstring" function mark items as multiple if the relstring says they are - rather than just saying "usable", logging them to the user - and then changing them after the fact. That will make it easy to decide if you need to say ",usable".