The Spice of Life

The Spice of Life

16M Downloads

Add food group-based history config option

squeek502 opened this issue ยท 3 comments

commented

Split from #65

Food history is empty
Player eats a food in food group A twice.
Player eats a food in food group C.
Player eats a food in food groups A, B, C.
    Food history length is 4, food journal shows 4.

Thinking about how it would play out in-game, I would still prefer tracking based on total food groups eaten, but I can work with the above settings.

by the way, using the example you copy-pasted, the only thing I am suggesting be change is that:
"Food history length is 4"

Be changed to:
Food history length is 6"

Since that is the total number of food groups eaten across all the foods. Everything else would be the same.


Ah, I see. If I implement that style of food history, I'll make it a config option (use.food.groups.for.food.history.length or something like that).

commented

@abculatter2, do you think foods without a food group should also contribute to this?

For example:

Food history is empty
Player eats a food in food group A twice.
Player eats a food in food group C.
Player eats a food in food groups A, B, C.
    Food history length is 6, food journal shows 4.
Player eats a food not in a food group
    Food history length is ?, food journal shows 5
commented

Does having food in the food journal contribute to diminishing returns? Honestly, I don't really know what that should do. I would probably just make foods not in a food group not contribute to food history.
Also, sorry for late response.

commented

The food journal is just a list of things you've eaten, regardless of whether or not they contribute to diminishing returns. For example, something that doesn't diminish at all (is in a blacklist food group) will still show up in the food journal.

I guess a food without a food group not increasing the length makes sense. So, food history length is basically always just a sum of the count of the food groups of each food in the history.

Something like:

int length = 0;
for (FoodEaten foodEaten : foodHistory)
{
    if (FoodHelper.canFoodDiminish(foodEaten.itemStack))
    {
        length += foodEaten.getFoodGroups().size();
    }
}
return length;