[freq] food group super-categories
Syndaryl opened this issue ยท 3 comments
I'd like to be able to set up my food groups with e.g. veggie, fruit, dairy, grain, protein, sugar, monster, fatty, and label the standard five "good" foods, and the extra three "bad" foods. ("Monster" would be for foods like rotten meat, fugu, clownfish, and suspect meats added by other mods).
I'd ideally then like to be able to test for the number of times a given food item fits into one of the subgroups. That way I can weight results for overall "goodness".
Other examples of super-categories might be "raw" and "cooked", or instead of making "monster" a bad category, super-categories might be "normal", "delicious", and "icky" (as defined by the modpack).
Case examples:
Submarine sandwich. Categorized as veggie, grain, protein - Ideally I should be able to query "how many $good" this is and get back 3.
Decadent chocolate cake. Categorized as grain, sugar, fat - $good = 1, $bad = 2.
Deep fried zombie pigman bacon surprise with sticky toffee. Categorized as sugar, fat, monster. $good = 0, $bad = 3.
To continue the use example, something that has a $good+$bad=5 (the maximum) could be exempt from stacking penalties, while Deep fried zombie pigman bacon surprise with sticky toffee, which is super-bad for you, starts with a fractional multiplier and rapidly escalates to worthlessness.
Another way to do this (probably simpler) would be to just query if something belongs to a given group. Instead of asking for a $good count, I can do (IS("veggie")+IS("fruit")+IS("protein")+IS("dairy")+IS("grain")) or somesuch.
(IS("veggie")+IS("fruit")+IS("protein")+IS("dairy")+IS("grain"))
This seems like a good solution, but unfortunately the expression parser I'm using doesn't currently support string literals, although it should be possible to add (see ezylang/EvalEx#70).