Feature Item Groups

Darzil

Developer
I've been trying to come up with a good plan for being able to say a particular monster drops "one of these X things Y percent of the time" - for example wine rack drops two dusty bottles, various drop beans now, etc, without listing huge numbers of drops.

I was considering adding a 'comment' to monster drops, that would be treated as strings, stored in a different array and just displayed as it is (in Area Combat Data and when fighting monsters).

It then struck me that maybe I was missing a trick here, and that actually knowing what was in a group of items could be useful in other places to simplify code.

So, seeking feedback on the following idea :

Set up data file itemgroups.txt. First column is a generic string name for the group, following columns are the other items in the group (names or numbers as other files).
Set up ItemGroupDatabase, with the above stored in arrays.
Set up useful functions / ash commands, for things like isInGroup( item ), getGroupItems ( itemGroup ).
Replace all existing code that groups together a small number of items and treats them equally (eg Lasagna, Saucy Pasta, Beans, Dusty Wines, Paper Strips, etc) to be item groups using isInGroup().
Handle and allow monsters dropping Item Groups as well as Items in monster.txt.

Thoughts ?
 

Veracity

Developer
Staff member
Sort of like zapgroups.

(No monster drops more than one avatar potion. How would this help with manuel potions?)
 

heeheehee

Developer
Staff member
That sounds useful. Arrays might be inefficient for large groups, but I doubt we'll have groups bigger than maybe 100 items. Paper strips are no longer relevant, since the nemesis cave was revamped. Other groups that come to mind:

- drops: planks / fasteners, ant familiar equipment, beatles shirts, clan dungeon boss outfit pieces
- consumption stuff: chocolates (with shared counter), beers (frosty mug, salty mouth), salads (salad fork), martinis (tux shirt) -- these may cause your specified format to have awkwardly long lines, but then again, so will saucy pasta.
 

Bale

Minion
Manuel potions are standard conditional drops, something that mafia already models. Maybe Erich was thinking that this would provide information about the nature of the conditional.

I would really appreciate the feature. Great idea. It always annoys me that the planks and fasteners are so badly modeled when I choose to adventure instead of clovering that area.
 

Erich

Member
I misunderstood the original proposal, my apologies. I may still be a little fuzzy, due to [insert massive amounts of real life stuffs here], but if you don't mind, I'd like to try to wrap my sleep deprived brain around it:

Things like the Assassin have an item drop group, where they can drop 1 of a group of 3 items, depending on [condition]. Your proposal would put them into something along the lines of isInGroup(ninja).
 

Veracity

Developer
Staff member
I think so - except that is a bad example, since the assassin drops item A then item B then item C, with no variation; if you have none, you get A, if you have A, you get B, and if you have B, you get C.

A better example would be the grizzled rodeo clown which drops a "can of beans" - exactly one, from the set of all "cans of beans". He has a 100% drop rate for a "can of beans", but does that mean that his drop rate for each of the 8 "cans of beans" is 12.5%? Yes, I suppose so. But, not really. He doesn't drop each of the 8 at 12.5% - which would mean that Item drop could raise the percentages and that you might get more than one. No. You have will get exactly one "can of beans" - at 100%, no item drop modifiers needed - and which one will be a "pick one of eight".
 
Top