Bug - Fixed Mafia should refuse to use B items in Beecore

slyz

Developer
Edit by Minion, Bale: This was originally posted in THIS thread.


Although it won't remove 'b' items from any Item Manager list, a change in UseItemRequest.maximumUses() would prevent server hits by adding something like this:
PHP:
String itemName = ItemDatabase.getItemName( itemId );

if ( KoLCharacter.inBeecore() && itemName.toLowerCase().indexOf( "b" ) != -1 )
{
	UseItemRequest.limiter = "bees";
	return 0;
}
Results in:
Code:
> use 1 briefcase

(usable quantity of briefcase is limited to 0 by bees)
 

Attachments

  • BeeUsing.patch
    898 bytes · Views: 56
Last edited by a moderator:

Veracity

Developer
Staff member
Although it won't remove 'b' items from any Item Manager list, a change in UseItemRequest.maximumUses() would prevent server hits by adding something like this:
PHP:
String itemName = ItemDatabase.getItemName( itemId );

if ( KoLCharacter.inBeecore() && itemName.toLowerCase().indexOf( "b" ) != -1 )
{
	UseItemRequest.limiter = "bees";
	return 0;
}
Except that some "important" items ARE usable.
 

slyz

Developer
Ah right. I guess I should try to draw up a list then. Or are all "quest" items useable, and is that property enough to discern exceptions? I guess not, given the recent request about the Chest of the Bonerdagon.
 

slyz

Developer
According to the KoL Wiki, the following 'b' items are useable in Beecore:
  • Cobb's Knob map
  • Enchanted bean
  • Ball polish
  • Black market map
  • Orcish Frat House blueprints
  • IOTM foldables

Would making an IntegerArray containing the item IDs of those items and using contains() to check for exceptions be OK ?
 

Veracity

Developer
Staff member
Would making an IntegerArray containing the item IDs of those items and using contains() to check for exceptions be OK ?
I'm not sure it's worth the trouble. Just let the user try to use the items and report failures. That way, if they add new "important" items later, we don't have to change.
 

Veracity

Developer
Staff member
Edit by Minion, Bale: This post was originally written in another thread, HERE. It was a very long post so only the relevant portion of the original post is retained in this thread's copy.

But, as I said, this thread is cumbersome, and I'd prefer if each such issue got split into its own thread. Perhaps some Minion would be interested in doing that? ;)

1) Save server hits by refusing to use any item or familiar with a "b" in their name.

I suppose. But now that the Item Manager has !b filtering and the Gear Changer won't even show you "b" familiars, I think this is nice, but unnecessary. But what about combat items, via your CCS? A CCS with a "b" item should probably abort.
 
Last edited by a moderator:

Veracity

Developer
Staff member
Revision 9512 does enough of this, I think:

I stuck in a use-limiter, as initially suggested, with exemptions for the IOTM foldables, the black market map, the frathouse blueprints, and ball polish. The Cobb's knob map is allowed, but has a new use limiter of the encryption key. The Wiki is incorrect about the enchanted bean being usable in Beecore.

We detect the failure of B combat items and should abort the CCS if you attempt and fail to use one. I initially considered not even trying to use such items in combat, but that gets tricky, what with embedded macros and such, so we'll detect after the fact, rather than before.
 
Top