Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

Disentangle activation and consumption

Open Fris0uman opened this issue 1 year ago • 7 comments

Summary

Infrastructure "Disentangle eat and activate for food"

Purpose of change

Potential fix for #76414

Describe the solution

  • Eat only eats food and doesn't check for activation

  • Activate only activates and doesn't look for eating

  • Drugs don't show in the activate menu, only in the consumption menu

  • Pet food remains a special case as it can be eaten and activated to do 2 different things

  • Make ALCOHOL a flag instead of a use action which should simplify a little bit the rest of #83668 but will still need to be removed later

  • Add NO_AUTO_CONSUME flag to some alcoholic drink that didn't have it [UNRELATED CHANGE]

Describe alternatives you've considered

Testing

  • activate in progress food > it works
  • activate in progress drugs > it works
  • activate in progress mutagen > it works
  • activate juvenile sourdough > you activate it
  • Eat pet food to eat it
  • Activate pet food to tame a pet
  • eat 10 morphine > dies
  • Eat corn cob > it disappears > get 99 kcal
  • Eat 20 whisky > pass out
  • Eat 1 whisky > get 79 kcal
  • Eat dog food > get 450 kcal
  • eat aspirin > get painkiller effect

Additional context

Drugs could do with their own menu

Fris0uman avatar Oct 09 '24 09:10 Fris0uman

I like the approach, good luck on shaking out the cobwebs 👍

RenechCDDA avatar Oct 09 '24 11:10 RenechCDDA

I am assuming this also breaks poison?

Karol1223 avatar Oct 09 '24 12:10 Karol1223

Not a comment on the actual content of the PR, but just want to point out that you misspelled disentangle so you don't get this published to the changelog with a typo in the title :)

AudBobb avatar Oct 10 '24 04:10 AudBobb

I think the activate menu is less usable for drugs than the "eat" menu. It does not stay open, will not re-open to the same item last used, and the filter is vastly wider, with no way to filter for drugs specifically.

ehughsbaird avatar Jul 19 '25 21:07 ehughsbaird

Iirc you cant "use" liquids, so liquid medicine (disinfectant) could only be applied by "eating" it. Not sure how to handle this other then allowing liquids to be "used"

marilynias avatar Jul 21 '25 11:07 marilynias

What does this do to goblin fruit in XE? Will their effects apply on eating?

Maleclypse avatar Aug 13 '25 20:08 Maleclypse

Yes, it should. The eat function in character.cpp still calls you.consume_effects( food ), which does all of the vitamins and nutrients and thirst and stomach volume and whatnot and also calls activate_consume_eocs( *this, food );. This activates whatever EOCs the food has.

All this patch does is make it so that you cannot (a)ctivate food items, you can only (e)at them. It doesn’t change what happens when you eat things.

db48x avatar Aug 13 '25 21:08 db48x