Code:
> pull * dancing fan
Pulling items from storage...
Requests complete.
> closet put * dancing fan
Placing items into closet...
Requests complete.
> closet take * dancing fan
Removing items from closet...
You acquire dancing fan (333)
Requests complete.
Pulling from closet has a normal "You acquire" message with a "rel string", which triggers that check.
ItemDatabase.isMultiUsable:
Code:
public static final boolean isMultiUsable(final int itemId) {
// Anything that you can manipulate with multiuse.php
ConsumptionType useType = ItemDatabase.useTypeById.getOrDefault(itemId, ConsumptionType.NONE);
EnumSet<Attribute> attributes = ItemDatabase.getAttributes(itemId);
return switch (useType) {
case USE_MULTIPLE -> true;
case POTION, AVATAR_POTION, SPLEEN -> !attributes.contains(Attribute.USABLE);
default -> attributes.contains(Attribute.MULTIPLE);
};
}
Avatar potions are assumed to my multi-usable unless they are explicitly marked as "usable" in items.txt.
Note that potions and avatar potions are not explicitly given Attribute.MULTIPLE
I notice that potions in items.txt are all "potion, usable" or "potion, multiple".
I notice that avatar potions in items.txt are all simply "avatar"; we do not give them the "multiple" attribute explicitly.
UseItemRequest.getConsumptionType:
Code:
...
EnumSet<Attribute> attrs = ItemDatabase.getAttributes(itemId);
if (attrs.contains(Attribute.USABLE)) {
return ConsumptionType.USE;
}
if (attrs.contains(Attribute.MULTIPLE)) {
return ConsumptionType.USE_MULTIPLE;
}
if (attrs.contains(Attribute.REUSABLE)) {
return ConsumptionType.USE_INFINITE;
}
return consumptionType;
Items without USABLE or MULTIPLE will end up returning their base type - AVATAR, for example - and that will end up going to inv_use.php to be used one at a time.
UseItemRequest is trying to be "clever" and "efficient" by doings its own Attributes check, rather than calling the special purpose methods in ItemDatabase which do that and other checks.
We could change every "avatar" in items.txt to be "avatar, multiple" (much as we do for "potion").
We could change UseItemRequest.getConsumptionType to call ItemDatabase.isUsable, isMultiUsable, an isReusable - which all check item Attributes.
Or something else.