minetest-mods / drinks

Adds a machine to juice fruits and veggies in Minetest
Other
8 stars 4 forks source link

Request: Drink juice to reduce both thirst and hunger #6

Open Golutazem opened 5 years ago

Golutazem commented 5 years ago

Currently, if both the thirst and hungry mods are installed, only thirst is decreased, which means that juice has no advantage over water. Implementing this feature would make it so that juice reduces both thirst and hunger.

NathanSalapat commented 5 years ago

While that is true, I didn't want to make it so a person could just drink juice and not need to eat anything. I suppose I could make it that a drink reduced hunger a slight bit.

Golutazem commented 5 years ago

That is what I had in mind also. You could define values for both hunger and thirst and then compute happens if there is only 1 for example.

Orange Juice { satiety = 1 , quench = 4 } If exists mod hungry, If exists mod thirsty then satiety += juice.satiety else satiety += juice.satiety * 2

and similar if only thirsty exists. This sort of idea, regardless of how it is implemented.

NathanSalapat commented 5 years ago

I have two different files that handle the registration and uses of the different drink containers, one is loaded if the thirsty mod is enabled and the other is used if it is not. It looks like the current code actually does reduce hunger slightly either way. Look at drinks.lua and drinks2.lua. Maybe the values should be tweaked, as right now it looks like they are the same regardless of if the thirsty mod is enabled.

Golutazem commented 5 years ago

I do not remember which juice I tried, but drinking many gave no reduction of hunger. My thirst was already quenched (not thirsty) could it be that in that case, the code does not add satiety? It only increases satiety if you are thirsty and thirst is quenched?

The author of thirsty has not logged into the forum for a while and it needs some maintenance. The ultimate solution would be for Drinks to replace Thirsty.

NathanSalapat commented 5 years ago

If you drank from a canteen with juice it will only replenish thirst, because the code treats all canteens the same, as they are provided from the thirsty mod, and it doesn't do anything with hunger, just the thirst.

Golutazem commented 5 years ago

I guess that was it.

Golutazem commented 4 years ago

Nope, It was not the canteen. No container replenishes hunger.

NathanSalapat commented 4 years ago

   local desc = drinks.drink_table[i][1]
   local craft = drinks.drink_table[i][2]
   local color = drinks.drink_table[i][3]
   local health = drinks.drink_table[i][4]
   health = health or 1```
Is the code responsible for getting the heal amount. None of the entries in drinks.drink_table provide any heal values, so every drink should provide 1 health.

Maybe I have an error in drinks.lua where the drinking and eating is handled. I"ll look into it.